summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--ChangeLog.MELT4
-rw-r--r--MAINTAINERS2
-rw-r--r--contrib/ChangeLog4
-rw-r--r--contrib/testsuite-management/x86_64-unknown-linux-gnu.xfail42
-rw-r--r--fixincludes/ChangeLog31
-rw-r--r--fixincludes/README3
-rw-r--r--fixincludes/check.tpl1
-rwxr-xr-xfixincludes/fixinc.in16
-rw-r--r--fixincludes/fixincl.c27
-rw-r--r--fixincludes/fixincl.x511
-rw-r--r--fixincludes/fixlib.h26
-rw-r--r--fixincludes/fixopts.c42
-rw-r--r--fixincludes/fixtests.c2
-rw-r--r--fixincludes/inclhack.def311
-rwxr-xr-xfixincludes/mkfixinc.sh1
-rw-r--r--fixincludes/tests/base/architecture/ppc/math.h84
-rw-r--r--fixincludes/tests/base/ioLib.h19
-rw-r--r--fixincludes/tests/base/math.h10
-rw-r--r--fixincludes/tests/base/sys/stat.h7
-rw-r--r--fixincludes/tests/base/testing.h6
-rw-r--r--gcc/ChangeLog848
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in2
-rw-r--r--gcc/ada/ChangeLog535
-rw-r--r--gcc/ada/Make-generated.in2
-rw-r--r--gcc/ada/aa_util.adb458
-rw-r--r--gcc/ada/aa_util.ads145
-rw-r--r--gcc/ada/adabkend.adb282
-rw-r--r--gcc/ada/adabkend.ads52
-rw-r--r--gcc/ada/ali.adb91
-rw-r--r--gcc/ada/ali.ads11
-rw-r--r--gcc/ada/aspects.adb2
-rw-r--r--gcc/ada/atree.ads2
-rw-r--r--gcc/ada/bcheck.adb58
-rw-r--r--gcc/ada/bindgen.adb155
-rw-r--r--gcc/ada/checks.adb9
-rw-r--r--gcc/ada/debug.adb2
-rw-r--r--gcc/ada/einfo.ads861
-rw-r--r--gcc/ada/exp_alfa.adb13
-rw-r--r--gcc/ada/exp_attr.adb3
-rw-r--r--gcc/ada/exp_ch3.adb100
-rw-r--r--gcc/ada/exp_ch4.adb12
-rw-r--r--gcc/ada/exp_ch9.adb541
-rw-r--r--gcc/ada/exp_ch9.ads15
-rw-r--r--gcc/ada/exp_dbug.adb52
-rw-r--r--gcc/ada/exp_dbug.ads17
-rw-r--r--gcc/ada/exp_disp.adb15
-rw-r--r--gcc/ada/exp_disp.ads5
-rw-r--r--gcc/ada/exp_dist.adb63
-rw-r--r--gcc/ada/exp_dist.ads13
-rw-r--r--gcc/ada/freeze.adb2
-rw-r--r--gcc/ada/g-sechas.adb43
-rw-r--r--gcc/ada/g-sechas.ads42
-rw-r--r--gcc/ada/g-socket.adb2
-rw-r--r--gcc/ada/g-socthi-dummy.adb2
-rw-r--r--gcc/ada/g-socthi-dummy.ads2
-rw-r--r--gcc/ada/g-socthi-mingw.adb4
-rw-r--r--gcc/ada/g-socthi-mingw.ads4
-rw-r--r--gcc/ada/g-socthi-vms.adb4
-rw-r--r--gcc/ada/g-socthi-vms.ads4
-rw-r--r--gcc/ada/g-socthi-vxworks.adb4
-rw-r--r--gcc/ada/g-socthi-vxworks.ads4
-rw-r--r--gcc/ada/g-socthi.adb4
-rw-r--r--gcc/ada/g-socthi.ads4
-rw-r--r--gcc/ada/g-sothco.ads4
-rw-r--r--gcc/ada/gcc-interface/Make-lang.in1276
-rw-r--r--gcc/ada/gcc-interface/Makefile.in2
-rw-r--r--gcc/ada/gnat1drv.adb21
-rw-r--r--gcc/ada/gnat_rm.texi56
-rw-r--r--gcc/ada/gnat_ugn.texi58
-rw-r--r--gcc/ada/i-cstrea.ads2
-rw-r--r--gcc/ada/layout.adb7
-rw-r--r--gcc/ada/lib-writ.adb5
-rw-r--r--gcc/ada/lib-writ.ads4
-rw-r--r--gcc/ada/opt.ads17
-rw-r--r--gcc/ada/par-ch11.adb4
-rw-r--r--gcc/ada/par-ch3.adb9
-rw-r--r--gcc/ada/par-ch4.adb10
-rw-r--r--gcc/ada/par-ch6.adb3
-rw-r--r--gcc/ada/par-prag.adb3
-rw-r--r--gcc/ada/par-util.adb33
-rw-r--r--gcc/ada/par.adb13
-rw-r--r--gcc/ada/pprint.adb682
-rw-r--r--gcc/ada/pprint.ads60
-rw-r--r--gcc/ada/prj-makr.adb7
-rw-r--r--gcc/ada/prj.ads19
-rw-r--r--gcc/ada/projects.texi11
-rw-r--r--gcc/ada/rtsfind.ads28
-rw-r--r--gcc/ada/s-bignum.adb40
-rw-r--r--gcc/ada/s-crtl.ads2
-rw-r--r--gcc/ada/s-oscons-tmplt.c34
-rw-r--r--gcc/ada/s-stratt-xdr.adb131
-rw-r--r--gcc/ada/s-tarest.adb25
-rw-r--r--gcc/ada/s-tarest.ads40
-rw-r--r--gcc/ada/s-taskin.adb36
-rw-r--r--gcc/ada/s-taskin.ads22
-rw-r--r--gcc/ada/s-tassta.adb57
-rw-r--r--gcc/ada/s-tassta.ads14
-rw-r--r--gcc/ada/s-tpoben.adb79
-rw-r--r--gcc/ada/s-tpoben.ads62
-rw-r--r--gcc/ada/s-valboo.adb4
-rw-r--r--gcc/ada/s-valcha.adb4
-rw-r--r--gcc/ada/s-valenu.adb9
-rw-r--r--gcc/ada/s-valint.adb6
-rw-r--r--gcc/ada/s-vallli.adb6
-rw-r--r--gcc/ada/s-valllu.adb6
-rw-r--r--gcc/ada/s-valrea.adb33
-rw-r--r--gcc/ada/s-valuns.adb8
-rw-r--r--gcc/ada/s-valuti.adb36
-rw-r--r--gcc/ada/s-valuti.ads6
-rw-r--r--gcc/ada/s-valwch.adb17
-rw-r--r--gcc/ada/s-win32.ads9
-rw-r--r--gcc/ada/sem_attr.adb4
-rw-r--r--gcc/ada/sem_aux.adb8
-rw-r--r--gcc/ada/sem_ch13.adb148
-rw-r--r--gcc/ada/sem_ch3.adb35
-rw-r--r--gcc/ada/sem_ch5.adb50
-rw-r--r--gcc/ada/sem_ch6.adb32
-rw-r--r--gcc/ada/sem_disp.adb8
-rw-r--r--gcc/ada/sem_elab.adb30
-rw-r--r--gcc/ada/sem_prag.adb171
-rw-r--r--gcc/ada/sem_res.adb13
-rw-r--r--gcc/ada/sem_util.adb28
-rw-r--r--gcc/ada/sem_util.ads8
-rw-r--r--gcc/ada/sinfo-cn.adb6
-rw-r--r--gcc/ada/snames.adb-tmpl12
-rw-r--r--gcc/ada/snames.ads-tmpl23
-rw-r--r--gcc/ada/socket.c12
-rw-r--r--gcc/ada/ug_words2
-rw-r--r--gcc/ada/usage.adb6
-rw-r--r--gcc/ada/vms_data.ads4
-rw-r--r--gcc/ada/warnsw.adb8
-rw-r--r--gcc/ada/warnsw.ads6
-rw-r--r--gcc/ada/xoscons.adb140
-rw-r--r--gcc/ada/xr_tabls.adb63
-rw-r--r--gcc/ada/xr_tabls.ads8
-rw-r--r--gcc/alias.c2
-rw-r--r--gcc/alloc-pool.c70
-rw-r--r--gcc/bitmap.h12
-rw-r--r--gcc/bt-load.c28
-rw-r--r--gcc/c-family/ChangeLog16
-rw-r--r--gcc/c-family/c-common.c2
-rw-r--r--gcc/c-family/c.opt12
-rw-r--r--gcc/c/ChangeLog12
-rw-r--r--gcc/c/c-decl.c14
-rw-r--r--gcc/c/c-typeck.c3
-rw-r--r--gcc/calls.c4
-rw-r--r--gcc/cfg.c12
-rw-r--r--gcc/cfganal.c30
-rw-r--r--gcc/cfgbuild.c4
-rw-r--r--gcc/cfgexpand.c23
-rw-r--r--gcc/cfgloop.c4
-rw-r--r--gcc/cfgloopmanip.c35
-rw-r--r--gcc/cfgrtl.c2
-rw-r--r--gcc/combine.c27
-rw-r--r--gcc/common/config/i386/i386-common.c52
-rw-r--r--gcc/common/config/m68k/m68k-common.c8
-rw-r--r--gcc/config.gcc18
-rw-r--r--gcc/config/aarch64/aarch64-protos.h1
-rw-r--r--gcc/config/aarch64/aarch64-simd.md144
-rw-r--r--gcc/config/aarch64/aarch64.c15
-rw-r--r--gcc/config/aarch64/aarch64.h1
-rw-r--r--gcc/config/aarch64/aarch64.md11
-rw-r--r--gcc/config/aarch64/iterators.md1
-rw-r--r--gcc/config/avr/avr.c3
-rw-r--r--gcc/config/avr/rtems.h1
-rw-r--r--gcc/config/epiphany/resolve-sw-modes.c2
-rw-r--r--gcc/config/i386/cpuid.h3
-rw-r--r--gcc/config/i386/driver-i386.c19
-rw-r--r--gcc/config/i386/fxsrintrin.h61
-rw-r--r--gcc/config/i386/i386-builtin-types.def1
-rw-r--r--gcc/config/i386/i386-c.c6
-rw-r--r--gcc/config/i386/i386.c275
-rw-r--r--gcc/config/i386/i386.h3
-rw-r--r--gcc/config/i386/i386.md236
-rw-r--r--gcc/config/i386/i386.opt12
-rw-r--r--gcc/config/i386/x86intrin.h12
-rw-r--r--gcc/config/i386/xsaveintrin.h61
-rw-r--r--gcc/config/i386/xsaveoptintrin.h47
-rw-r--r--gcc/config/microblaze/rtems.h25
-rw-r--r--gcc/config/microblaze/t-rtems1
-rw-r--r--gcc/config/mips/mips.c2
-rw-r--r--gcc/config/mips/mti-linux.h6
-rw-r--r--gcc/config/mips/t-mti-linux13
-rw-r--r--gcc/config/rl78/rl78.c7
-rw-r--r--gcc/config/rs6000/altivec.md8
-rw-r--r--gcc/config/rs6000/dfp.md10
-rw-r--r--gcc/config/rs6000/linux64.h2
-rw-r--r--gcc/config/rs6000/paired.md4
-rw-r--r--gcc/config/rs6000/rs6000.c21
-rw-r--r--gcc/config/rs6000/rs6000.md20
-rw-r--r--gcc/config/rs6000/sync.md2
-rw-r--r--gcc/config/rs6000/vsx.md8
-rw-r--r--gcc/config/sh/iterators.md4
-rw-r--r--gcc/config/sh/sh.c3
-rw-r--r--gcc/config/sh/sh.md187
-rw-r--r--gcc/config/sparc/constraints.md23
-rw-r--r--gcc/config/sparc/sparc.md16
-rw-r--r--gcc/config/sparc/sync.md4
-rw-r--r--gcc/config/sparc/t-rtems22
-rw-r--r--gcc/config/sparc/t-rtems-6422
-rw-r--r--gcc/config/spu/spu.c4
-rw-r--r--gcc/coverage.c17
-rw-r--r--gcc/cp/ChangeLog63
-rw-r--r--gcc/cp/call.c102
-rw-r--r--gcc/cp/class.c15
-rw-r--r--gcc/cp/cp-tree.h8
-rw-r--r--gcc/cp/init.c3
-rw-r--r--gcc/cp/method.c108
-rw-r--r--gcc/cp/parser.c26
-rw-r--r--gcc/cp/semantics.c2
-rw-r--r--gcc/cp/typeck.c11
-rw-r--r--gcc/cp/typeck2.c8
-rw-r--r--gcc/cprop.c4
-rw-r--r--gcc/cse.c6
-rw-r--r--gcc/dce.c15
-rw-r--r--gcc/ddg.c52
-rw-r--r--gcc/defaults.h4
-rw-r--r--gcc/df-core.c2
-rw-r--r--gcc/doc/cpp.texi3
-rw-r--r--gcc/doc/cppopts.texi4
-rw-r--r--gcc/doc/extend.texi8
-rw-r--r--gcc/doc/generic.texi6
-rw-r--r--gcc/doc/invoke.texi63
-rw-r--r--gcc/doc/md.texi22
-rw-r--r--gcc/doc/sourcebuild.texi2
-rw-r--r--gcc/doc/tm.texi3
-rw-r--r--gcc/doc/tm.texi.in3
-rw-r--r--gcc/domwalk.c2
-rw-r--r--gcc/dse.c14
-rw-r--r--gcc/dwarf2out.c8
-rw-r--r--gcc/ebitmap.c134
-rw-r--r--gcc/ebitmap.h48
-rw-r--r--gcc/except.c2
-rw-r--r--gcc/expmed.c450
-rw-r--r--gcc/expr.c10
-rw-r--r--gcc/fold-const.c17
-rw-r--r--gcc/fortran/ChangeLog23
-rw-r--r--gcc/fortran/array.c2
-rw-r--r--gcc/fortran/check.c4
-rw-r--r--gcc/fortran/expr.c12
-rw-r--r--gcc/fortran/gfortran.h4
-rw-r--r--gcc/fortran/interface.c4
-rw-r--r--gcc/fortran/intrinsic.c4
-rw-r--r--gcc/fortran/io.c9
-rw-r--r--gcc/fortran/resolve.c40
-rw-r--r--gcc/fortran/trans.c28
-rw-r--r--gcc/function.c5
-rw-r--r--gcc/gcse.c36
-rw-r--r--gcc/gimple-pretty-print.c14
-rw-r--r--gcc/gimple.h25
-rw-r--r--gcc/go/ChangeLog11
-rw-r--r--gcc/go/gccgo.texi6
-rw-r--r--gcc/go/go-c.h3
-rw-r--r--gcc/go/go-lang.c8
-rw-r--r--gcc/go/gofrontend/go.cc5
-rw-r--r--gcc/go/gofrontend/gogo.cc4
-rw-r--r--gcc/go/gofrontend/gogo.h14
-rw-r--r--gcc/go/gofrontend/import.cc29
-rw-r--r--gcc/go/gofrontend/import.h4
-rw-r--r--gcc/go/lang.opt4
-rw-r--r--gcc/graphite-sese-to-poly.c2
-rw-r--r--gcc/hash-table.h429
-rw-r--r--gcc/ipa-cp.c9
-rw-r--r--gcc/ipa-inline-analysis.c195
-rw-r--r--gcc/ipa-inline-transform.c28
-rw-r--r--gcc/ipa-inline.c173
-rw-r--r--gcc/ipa-inline.h6
-rw-r--r--gcc/ipa-prop.c7
-rw-r--r--gcc/ira-lives.c6
-rw-r--r--gcc/ira.c22
-rw-r--r--gcc/java/jcf-io.c12
-rw-r--r--gcc/lcm.c128
-rw-r--r--gcc/loop-unroll.c16
-rw-r--r--gcc/lower-subreg.c2
-rw-r--r--gcc/lra-assigns.c57
-rw-r--r--gcc/lra-coalesce.c2
-rw-r--r--gcc/lra-constraints.c922
-rw-r--r--gcc/lra-eliminations.c53
-rw-r--r--gcc/lra-int.h16
-rw-r--r--gcc/lra-lives.c6
-rw-r--r--gcc/lra-spills.c36
-rw-r--r--gcc/lra.c40
-rw-r--r--gcc/mode-switching.c8
-rw-r--r--gcc/modulo-sched.c84
-rw-r--r--gcc/objc/objc-act.c11
-rw-r--r--gcc/recog.c2
-rw-r--r--gcc/ree.c2
-rw-r--r--gcc/regcprop.c2
-rw-r--r--gcc/reload1.c2
-rw-r--r--gcc/rtl.h82
-rw-r--r--gcc/rtlanal.c380
-rw-r--r--gcc/sbitmap.c188
-rw-r--r--gcc/sbitmap.h99
-rw-r--r--gcc/sched-rgn.c36
-rw-r--r--gcc/sel-sched-ir.c2
-rw-r--r--gcc/sel-sched.c4
-rw-r--r--gcc/store-motion.c18
-rw-r--r--gcc/testsuite/ChangeLog203
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/defaulted37.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/defaulted39.C23
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/defaulted40.C23
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/gen-attrs-48-2.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/inh-ctor11.C4
-rw-r--r--gcc/testsuite/g++.dg/ext/transparent-union.C5
-rw-r--r--gcc/testsuite/g++.dg/ext/vector19.C56
-rw-r--r--gcc/testsuite/g++.dg/gomp/tls-template1.C13
-rw-r--r--gcc/testsuite/g++.dg/opt/pr55081.C17
-rw-r--r--gcc/testsuite/g++.dg/other/darwin-cfstring1.C2
-rw-r--r--gcc/testsuite/g++.dg/other/i386-2.C2
-rw-r--r--gcc/testsuite/g++.dg/other/i386-3.C2
-rw-r--r--gcc/testsuite/g++.dg/pr55106.C67
-rw-r--r--gcc/testsuite/g++.dg/template/crash114.C5
-rw-r--r--gcc/testsuite/g++.dg/template/new11.C28
-rw-r--r--gcc/testsuite/g++.dg/torture/pr54902.C131
-rw-r--r--gcc/testsuite/g++.dg/warn/Wno-return-local-addr.C26
-rw-r--r--gcc/testsuite/g++.dg/warn/Wreturn-local-addr.C20
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20111227-2.c44
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20111227-3.c45
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr46309.c31
-rw-r--r--gcc/testsuite/gcc.dg/Wreturn-local-addr.c9
-rw-r--r--gcc/testsuite/gcc.dg/Wshadow-4.c38
-rw-r--r--gcc/testsuite/gcc.dg/Wshadow-4.h3
-rw-r--r--gcc/testsuite/gcc.dg/guality/pr54693.c28
-rw-r--r--gcc/testsuite/gcc.dg/guality/pr54970.c47
-rw-r--r--gcc/testsuite/gcc.dg/hoist-register-pressure-1.c (renamed from gcc/testsuite/gcc.dg/hoist-register-pressure.c)2
-rw-r--r--gcc/testsuite/gcc.dg/hoist-register-pressure-2.c32
-rw-r--r--gcc/testsuite/gcc.dg/ipa/inline-6.c42
-rw-r--r--gcc/testsuite/gcc.dg/ipa/inlinehint-3.c37
-rw-r--r--gcc/testsuite/gcc.dg/pr19105.c22
-rw-r--r--gcc/testsuite/gcc.dg/pr21643.c90
-rw-r--r--gcc/testsuite/gcc.dg/pr46309-2.c147
-rw-r--r--gcc/testsuite/gcc.dg/pr55027.c12
-rw-r--r--gcc/testsuite/gcc.dg/sms-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr53695.c14
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr54824.c16
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr55111.c24
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/cunroll-4.c8
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-perm-2.c3
-rw-r--r--gcc/testsuite/gcc.target/i386/fxrstor-1.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/fxrstor64-1.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/fxsave-1.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/fxsave64-1.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/pr34283.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/pr55093.c80
-rw-r--r--gcc/testsuite/gcc.target/i386/pr55116-1.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/pr55116-2.c86
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-12.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-13.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-14.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-22.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-23.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/xrstor-1.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/xrstor64-1.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/xsave-1.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/xsave64-1.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/xsaveopt-1.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/xsaveopt64-1.c12
-rw-r--r--gcc/testsuite/gcc.target/powerpc/dfmode_off.c47
-rw-r--r--gcc/testsuite/gcc.target/powerpc/dimode_off.c50
-rw-r--r--gcc/testsuite/gcc.target/powerpc/tfmode_off.c49
-rw-r--r--gcc/testsuite/gcc.target/powerpc/timode_off.c51
-rw-r--r--gcc/testsuite/gcc.target/sh/pr53988.c74
-rw-r--r--gcc/testsuite/gfortran.dg/do_check_6.f9084
-rw-r--r--gcc/testsuite/gfortran.dg/pr54967.f9018
-rw-r--r--gcc/testsuite/obj-c++.dg/strings/const-cfstring-2.mm2
-rw-r--r--gcc/tracer.c9
-rw-r--r--gcc/tree-eh.c10
-rw-r--r--gcc/tree-flow.h3
-rw-r--r--gcc/tree-inline.c10
-rw-r--r--gcc/tree-into-ssa.c22
-rw-r--r--gcc/tree-optimize.c19
-rw-r--r--gcc/tree-outof-ssa.c4
-rw-r--r--gcc/tree-sra.c178
-rw-r--r--gcc/tree-ssa-coalesce.c9
-rw-r--r--gcc/tree-ssa-dce.c8
-rw-r--r--gcc/tree-ssa-dom.c2
-rw-r--r--gcc/tree-ssa-live.c2
-rw-r--r--gcc/tree-ssa-live.h2
-rw-r--r--gcc/tree-ssa-loop-im.c2
-rw-r--r--gcc/tree-ssa-loop-ivcanon.c8
-rw-r--r--gcc/tree-ssa-loop-ivopts.c2
-rw-r--r--gcc/tree-ssa-loop-manip.c2
-rw-r--r--gcc/tree-ssa-loop-niter.c39
-rw-r--r--gcc/tree-ssa-phiopt.c2
-rw-r--r--gcc/tree-ssa-pre.c37
-rw-r--r--gcc/tree-ssa-propagate.c4
-rw-r--r--gcc/tree-ssa-reassoc.c665
-rw-r--r--gcc/tree-ssa-structalias.c10
-rw-r--r--gcc/tree-ssa-tail-merge.c20
-rw-r--r--gcc/tree-ssa-threadedge.c20
-rw-r--r--gcc/tree-ssa-threadupdate.c11
-rw-r--r--gcc/tree-stdarg.c2
-rw-r--r--gcc/tree-vect-slp.c4
-rw-r--r--gcc/tree-vrp.c8
-rw-r--r--gcc/tree.c111
-rw-r--r--gcc/tree.h4
-rw-r--r--gcc/valtrack.c81
-rw-r--r--gcc/valtrack.h22
-rw-r--r--gcc/var-tracking.c10
-rw-r--r--gcc/vmsdbgout.c2
-rw-r--r--libbacktrace/ChangeLog26
-rwxr-xr-xlibbacktrace/configure25
-rw-r--r--libbacktrace/configure.ac14
-rw-r--r--libbacktrace/elf.c4
-rw-r--r--libbacktrace/fileline.c4
-rw-r--r--libbacktrace/internal.h10
-rw-r--r--libbacktrace/mmap.c13
-rw-r--r--libbacktrace/posix.c10
-rw-r--r--libffi/ChangeLog5
-rw-r--r--libffi/src/powerpc/linux64.S21
-rw-r--r--libffi/src/powerpc/linux64_closure.S20
-rw-r--r--libgcc/ChangeLog21
-rw-r--r--libgcc/config.host8
-rw-r--r--libgcc/config/i386/crtfastmath.c39
-rw-r--r--libgcc/config/i386/t-crtfm2
-rw-r--r--libgfortran/ChangeLog122
-rw-r--r--libgfortran/generated/bessel_r10.c1
-rw-r--r--libgfortran/generated/bessel_r16.c1
-rw-r--r--libgfortran/generated/bessel_r4.c1
-rw-r--r--libgfortran/generated/bessel_r8.c1
-rw-r--r--libgfortran/generated/iall_i1.c9
-rw-r--r--libgfortran/generated/iall_i16.c9
-rw-r--r--libgfortran/generated/iall_i2.c9
-rw-r--r--libgfortran/generated/iall_i4.c9
-rw-r--r--libgfortran/generated/iall_i8.c9
-rw-r--r--libgfortran/generated/iany_i1.c9
-rw-r--r--libgfortran/generated/iany_i16.c9
-rw-r--r--libgfortran/generated/iany_i2.c9
-rw-r--r--libgfortran/generated/iany_i4.c9
-rw-r--r--libgfortran/generated/iany_i8.c9
-rw-r--r--libgfortran/generated/iparity_i1.c9
-rw-r--r--libgfortran/generated/iparity_i16.c9
-rw-r--r--libgfortran/generated/iparity_i2.c9
-rw-r--r--libgfortran/generated/iparity_i4.c9
-rw-r--r--libgfortran/generated/iparity_i8.c9
-rw-r--r--libgfortran/generated/maxloc1_16_i1.c9
-rw-r--r--libgfortran/generated/maxloc1_16_i16.c9
-rw-r--r--libgfortran/generated/maxloc1_16_i2.c9
-rw-r--r--libgfortran/generated/maxloc1_16_i4.c9
-rw-r--r--libgfortran/generated/maxloc1_16_i8.c9
-rw-r--r--libgfortran/generated/maxloc1_16_r10.c9
-rw-r--r--libgfortran/generated/maxloc1_16_r16.c9
-rw-r--r--libgfortran/generated/maxloc1_16_r4.c9
-rw-r--r--libgfortran/generated/maxloc1_16_r8.c9
-rw-r--r--libgfortran/generated/maxloc1_4_i1.c9
-rw-r--r--libgfortran/generated/maxloc1_4_i16.c9
-rw-r--r--libgfortran/generated/maxloc1_4_i2.c9
-rw-r--r--libgfortran/generated/maxloc1_4_i4.c9
-rw-r--r--libgfortran/generated/maxloc1_4_i8.c9
-rw-r--r--libgfortran/generated/maxloc1_4_r10.c9
-rw-r--r--libgfortran/generated/maxloc1_4_r16.c9
-rw-r--r--libgfortran/generated/maxloc1_4_r4.c9
-rw-r--r--libgfortran/generated/maxloc1_4_r8.c9
-rw-r--r--libgfortran/generated/maxloc1_8_i1.c9
-rw-r--r--libgfortran/generated/maxloc1_8_i16.c9
-rw-r--r--libgfortran/generated/maxloc1_8_i2.c9
-rw-r--r--libgfortran/generated/maxloc1_8_i4.c9
-rw-r--r--libgfortran/generated/maxloc1_8_i8.c9
-rw-r--r--libgfortran/generated/maxloc1_8_r10.c9
-rw-r--r--libgfortran/generated/maxloc1_8_r16.c9
-rw-r--r--libgfortran/generated/maxloc1_8_r4.c9
-rw-r--r--libgfortran/generated/maxloc1_8_r8.c9
-rw-r--r--libgfortran/generated/maxval_i1.c9
-rw-r--r--libgfortran/generated/maxval_i16.c9
-rw-r--r--libgfortran/generated/maxval_i2.c9
-rw-r--r--libgfortran/generated/maxval_i4.c9
-rw-r--r--libgfortran/generated/maxval_i8.c9
-rw-r--r--libgfortran/generated/maxval_r10.c9
-rw-r--r--libgfortran/generated/maxval_r16.c9
-rw-r--r--libgfortran/generated/maxval_r4.c9
-rw-r--r--libgfortran/generated/maxval_r8.c9
-rw-r--r--libgfortran/generated/minloc1_16_i1.c9
-rw-r--r--libgfortran/generated/minloc1_16_i16.c9
-rw-r--r--libgfortran/generated/minloc1_16_i2.c9
-rw-r--r--libgfortran/generated/minloc1_16_i4.c9
-rw-r--r--libgfortran/generated/minloc1_16_i8.c9
-rw-r--r--libgfortran/generated/minloc1_16_r10.c9
-rw-r--r--libgfortran/generated/minloc1_16_r16.c9
-rw-r--r--libgfortran/generated/minloc1_16_r4.c9
-rw-r--r--libgfortran/generated/minloc1_16_r8.c9
-rw-r--r--libgfortran/generated/minloc1_4_i1.c9
-rw-r--r--libgfortran/generated/minloc1_4_i16.c9
-rw-r--r--libgfortran/generated/minloc1_4_i2.c9
-rw-r--r--libgfortran/generated/minloc1_4_i4.c9
-rw-r--r--libgfortran/generated/minloc1_4_i8.c9
-rw-r--r--libgfortran/generated/minloc1_4_r10.c9
-rw-r--r--libgfortran/generated/minloc1_4_r16.c9
-rw-r--r--libgfortran/generated/minloc1_4_r4.c9
-rw-r--r--libgfortran/generated/minloc1_4_r8.c9
-rw-r--r--libgfortran/generated/minloc1_8_i1.c9
-rw-r--r--libgfortran/generated/minloc1_8_i16.c9
-rw-r--r--libgfortran/generated/minloc1_8_i2.c9
-rw-r--r--libgfortran/generated/minloc1_8_i4.c9
-rw-r--r--libgfortran/generated/minloc1_8_i8.c9
-rw-r--r--libgfortran/generated/minloc1_8_r10.c9
-rw-r--r--libgfortran/generated/minloc1_8_r16.c9
-rw-r--r--libgfortran/generated/minloc1_8_r4.c9
-rw-r--r--libgfortran/generated/minloc1_8_r8.c9
-rw-r--r--libgfortran/generated/minval_i1.c9
-rw-r--r--libgfortran/generated/minval_i16.c9
-rw-r--r--libgfortran/generated/minval_i2.c9
-rw-r--r--libgfortran/generated/minval_i4.c9
-rw-r--r--libgfortran/generated/minval_i8.c9
-rw-r--r--libgfortran/generated/minval_r10.c9
-rw-r--r--libgfortran/generated/minval_r16.c9
-rw-r--r--libgfortran/generated/minval_r4.c9
-rw-r--r--libgfortran/generated/minval_r8.c9
-rw-r--r--libgfortran/generated/product_c10.c9
-rw-r--r--libgfortran/generated/product_c16.c9
-rw-r--r--libgfortran/generated/product_c4.c9
-rw-r--r--libgfortran/generated/product_c8.c9
-rw-r--r--libgfortran/generated/product_i1.c9
-rw-r--r--libgfortran/generated/product_i16.c9
-rw-r--r--libgfortran/generated/product_i2.c9
-rw-r--r--libgfortran/generated/product_i4.c9
-rw-r--r--libgfortran/generated/product_i8.c9
-rw-r--r--libgfortran/generated/product_r10.c9
-rw-r--r--libgfortran/generated/product_r16.c9
-rw-r--r--libgfortran/generated/product_r4.c9
-rw-r--r--libgfortran/generated/product_r8.c9
-rw-r--r--libgfortran/generated/sum_c10.c9
-rw-r--r--libgfortran/generated/sum_c16.c9
-rw-r--r--libgfortran/generated/sum_c4.c9
-rw-r--r--libgfortran/generated/sum_c8.c9
-rw-r--r--libgfortran/generated/sum_i1.c9
-rw-r--r--libgfortran/generated/sum_i16.c9
-rw-r--r--libgfortran/generated/sum_i2.c9
-rw-r--r--libgfortran/generated/sum_i4.c9
-rw-r--r--libgfortran/generated/sum_i8.c9
-rw-r--r--libgfortran/generated/sum_r10.c9
-rw-r--r--libgfortran/generated/sum_r16.c9
-rw-r--r--libgfortran/generated/sum_r4.c9
-rw-r--r--libgfortran/generated/sum_r8.c9
-rw-r--r--libgfortran/m4/bessel.m41
-rw-r--r--libgfortran/m4/ifunction.m413
-rw-r--r--libgo/Makefile.am5
-rw-r--r--libgo/Makefile.in3
-rw-r--r--libgo/go/net/sockoptip_solaris.go90
-rw-r--r--libgo/go/syscall/creds_test.go8
-rw-r--r--libgo/go/syscall/syscall_solaris.go13
-rw-r--r--libgomp/testsuite/libgomp.c++/tls-init1.C2
-rw-r--r--libitm/ChangeLog7
-rw-r--r--libitm/acinclude.m414
-rw-r--r--libitm/config.h.in3
-rw-r--r--libitm/configure42
-rw-r--r--libitm/configure.ac1
-rw-r--r--libitm/testsuite/Makefile.in39
-rw-r--r--libstdc++-v3/ChangeLog49
-rw-r--r--libstdc++-v3/include/bits/forward_list.h33
-rw-r--r--libstdc++-v3/include/bits/forward_list.tcc25
-rw-r--r--libstdc++-v3/include/bits/shared_ptr_base.h4
-rw-r--r--libstdc++-v3/include/bits/unordered_map.h1211
-rw-r--r--libstdc++-v3/include/bits/unordered_set.h116
-rw-r--r--libstdc++-v3/include/debug/unordered_map4
-rw-r--r--libstdc++-v3/include/profile/unordered_map4
-rw-r--r--libstdc++-v3/python/libstdcxx/v6/printers.py18
-rw-r--r--libstdc++-v3/testsuite/20_util/shared_ptr/cons/55123.cc30
559 files changed, 16074 insertions, 6245 deletions
diff --git a/ChangeLog b/ChangeLog
index 077989734aa..ffce6913488 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-10-30 Ganesh Gopalasubramanian <Ganesh.Gopalasubramanian@amd.com>
+
+ * MAINTAINERS (Write After Approval): Add myself.
+
+2012-10-26 James Greenhalgh <james.greenhalgh@arm.com>
+
+ * MAINTAINERS (Write After Approval): Add myself.
+
2012-10-24 Sharad Singhai <singhai@google.com>
* MAINTAINERS (Write After Approval): Add myself.
diff --git a/ChangeLog.MELT b/ChangeLog.MELT
index c2fa0944f68..96d38e40636 100644
--- a/ChangeLog.MELT
+++ b/ChangeLog.MELT
@@ -1,4 +1,8 @@
+2012-10-31 Basile Starynkevitch <basile@starynkevitch.net>
+
+ MELT branch merged with trunk rev 193029 using svnmerge.py
+
2012-10-25 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 192797 using svnmerge.py
diff --git a/MAINTAINERS b/MAINTAINERS
index 87c1b4cd963..adec7a466cc 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -372,12 +372,14 @@ Nathan Froyd froydnj@gcc.gnu.org
Chao-ying Fu fu@mips.com
Gary Funck gary@intrepid.com
Pompapathi V Gadad Pompapathi.V.Gadad@nsc.com
+Gopalasubramanian Ganesh Ganesh.Gopalasubramanian@amd.com
Kaveh Ghazi ghazi@gcc.gnu.org
Matthew Gingell gingell@gnat.com
Tristan Gingold gingold@adacore.com
Jan-Benedict Glaw jbglaw@lug-owl.de
Marc Glisse marc.glisse@inria.fr
Anthony Green green@redhat.com
+James Greenhalgh james.greenhalgh@arm.com
Doug Gregor doug.gregor@gmail.com
Matthew Gretton-Dann matthew.gretton-dann@arm.com
Jon Grimm jgrimm2@us.ibm.com
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index d5ec0bab401..6603a26cbc6 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,7 @@
+2012-10-29 Diego Novillo <dnovillo@google.com>
+
+ * testsuite-management/x86_64-unknown-linux-gnu.xfail: Update.
+
2012-10-06 Diego Novillo <dnovillo@google.com>
* testsuite-management/x86_64-unknown-linux-gnu.xfail: Update.
diff --git a/contrib/testsuite-management/x86_64-unknown-linux-gnu.xfail b/contrib/testsuite-management/x86_64-unknown-linux-gnu.xfail
index 59b3f912b19..2f96a4816e8 100644
--- a/contrib/testsuite-management/x86_64-unknown-linux-gnu.xfail
+++ b/contrib/testsuite-management/x86_64-unknown-linux-gnu.xfail
@@ -1,54 +1,68 @@
-XPASS: gcc.dg/Wstrict-overflow-18.c (test for bogus messages, line 20)
-UNRESOLVED: gcc.dg/attr-weakref-1.c compilation failed to produce executable
+FAIL: g++.dg/tree-ssa/pr45453.C -std=gnu++98 (test for excess errors)
+UNRESOLVED: g++.dg/tree-ssa/pr45453.C -std=gnu++11 scan-tree-dump-times optimized "OBJ_TYPE_REF" 1
+UNRESOLVED: g++.dg/tree-ssa/pr45453.C -std=gnu++98 scan-tree-dump-times optimized "OBJ_TYPE_REF" 1
+FAIL: g++.dg/tree-ssa/pr45453.C -std=gnu++11 (test for excess errors)
FAIL: gcc.dg/attr-weakref-1.c (test for excess errors)
+UNRESOLVED: gcc.dg/attr-weakref-1.c compilation failed to produce executable
FAIL: gcc.dg/builtin-object-size-8.c execution test
+FAIL: gcc.dg/graphite/pr42521.c (internal compiler error)
+FAIL: gcc.dg/graphite/pr42521.c (test for excess errors)
+FAIL: gcc.dg/graphite/pr42771.c (internal compiler error)
+FAIL: gcc.dg/graphite/pr42771.c (test for excess errors)
XPASS: gcc.dg/guality/example.c -O2 -flto -fno-use-linker-plugin -flto-partition=none execution test
XPASS: gcc.dg/guality/example.c -O2 execution test
XPASS: gcc.dg/guality/example.c -O0 execution test
XPASS: gcc.dg/guality/guality.c -O2 execution test
+XPASS: gcc.dg/guality/guality.c -O3 -fomit-frame-pointer execution test
+XPASS: gcc.dg/guality/guality.c -O1 execution test
+XPASS: gcc.dg/guality/guality.c -O0 execution test
XPASS: gcc.dg/guality/guality.c -O3 -g execution test
XPASS: gcc.dg/guality/guality.c -O2 -flto -fno-use-linker-plugin -flto-partition=none execution test
-XPASS: gcc.dg/guality/guality.c -O1 execution test
-XPASS: gcc.dg/guality/guality.c -O3 -fomit-frame-pointer execution test
XPASS: gcc.dg/guality/guality.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects execution test
-XPASS: gcc.dg/guality/guality.c -O0 execution test
XPASS: gcc.dg/guality/guality.c -Os execution test
XPASS: gcc.dg/guality/inline-params.c -O2 execution test
XPASS: gcc.dg/guality/inline-params.c -O3 -g execution test
XPASS: gcc.dg/guality/inline-params.c -O2 -flto -fno-use-linker-plugin -flto-partition=none execution test
XPASS: gcc.dg/guality/inline-params.c -O3 -fomit-frame-pointer execution test
XPASS: gcc.dg/guality/inline-params.c -Os execution test
-XPASS: gcc.dg/guality/pr41447-1.c -O2 execution test
XPASS: gcc.dg/guality/pr41447-1.c -O1 execution test
XPASS: gcc.dg/guality/pr41447-1.c -O3 -fomit-frame-pointer execution test
-XPASS: gcc.dg/guality/pr41447-1.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects execution test
XPASS: gcc.dg/guality/pr41447-1.c -O0 execution test
-XPASS: gcc.dg/guality/pr41447-1.c -O3 -g execution test
XPASS: gcc.dg/guality/pr41447-1.c -Os execution test
-XPASS: gcc.dg/guality/pr41616-1.c -O3 -fomit-frame-pointer execution test
+XPASS: gcc.dg/guality/pr41447-1.c -O2 execution test
+XPASS: gcc.dg/guality/pr41447-1.c -O3 -g execution test
+XPASS: gcc.dg/guality/pr41447-1.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects execution test
XPASS: gcc.dg/guality/pr41616-1.c -O1 execution test
-XPASS: gcc.dg/guality/pr41616-1.c -O2 execution test
+XPASS: gcc.dg/guality/pr41616-1.c -O3 -fomit-frame-pointer execution test
XPASS: gcc.dg/guality/pr41616-1.c -O0 execution test
XPASS: gcc.dg/guality/pr41616-1.c -Os execution test
+XPASS: gcc.dg/guality/pr41616-1.c -O2 execution test
XPASS: gcc.dg/guality/pr41616-1.c -O2 -flto -fno-use-linker-plugin -flto-partition=none execution test
XPASS: gcc.dg/guality/pr41616-1.c -O3 -g execution test
XPASS: gcc.dg/inline_3.c (test for excess errors)
XPASS: gcc.dg/inline_4.c (test for excess errors)
+FAIL: gcc.dg/pr44974.c scan-assembler call[^\n]*_Exit
+FAIL: gcc.dg/torture/pr51106-2.c -O1 (test for excess errors)
+FAIL: gcc.dg/torture/pr51106-2.c -Os (test for excess errors)
FAIL: gcc.dg/torture/pr51106-2.c -O2 -flto -fno-use-linker-plugin -flto-partition=none (test for excess errors)
FAIL: gcc.dg/torture/pr51106-2.c -O3 -g (test for excess errors)
FAIL: gcc.dg/torture/pr51106-2.c -O0 (test for excess errors)
-FAIL: gcc.dg/torture/pr51106-2.c -O1 (test for excess errors)
-FAIL: gcc.dg/torture/pr51106-2.c -Os (test for excess errors)
-FAIL: gcc.dg/torture/pr51106-2.c -O3 -fomit-frame-pointer (test for excess errors)
FAIL: gcc.dg/torture/pr51106-2.c -O2 (test for excess errors)
+FAIL: gcc.dg/torture/pr51106-2.c -O3 -fomit-frame-pointer (test for excess errors)
XPASS: gcc.dg/unroll_2.c (test for excess errors)
XPASS: gcc.dg/unroll_3.c (test for excess errors)
XPASS: gcc.dg/unroll_4.c (test for excess errors)
+XPASS: gfortran.dg/do_1.f90 -O0 execution test
+XPASS: gfortran.dg/do_1.f90 -O1 execution test
FAIL: gnat.dg/array11.adb (test for warnings, line 12)
FAIL: gnat.dg/object_overflow.adb (test for warnings, line 8)
FAIL: libmudflap.c++/pass55-frag.cxx (-O2) execution test
FAIL: libmudflap.c++/pass55-frag.cxx ( -O) execution test
FAIL: libmudflap.c++/pass55-frag.cxx (-O3) execution test
-FAIL: sourcelocation output - source compiled test
+FAIL: libmudflap.c/fail37-frag.c (-O3) output pattern test
+FAIL: libmudflap.c/fail37-frag.c (-O2) output pattern test
+FAIL: libmudflap.c/fail37-frag.c (-O3) crash test
+FAIL: libmudflap.c/fail37-frag.c (-O2) crash test
FAIL: sourcelocation -findirect-dispatch output - source compiled test
FAIL: sourcelocation -O3 output - source compiled test
+FAIL: sourcelocation output - source compiled test
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog
index dea4a96927e..99d0f026563 100644
--- a/fixincludes/ChangeLog
+++ b/fixincludes/ChangeLog
@@ -1,3 +1,34 @@
+2012-10-29 Bruce Korb <bkorb@gnu.org>
+
+ * README: testing wrap and replacement fixes is pointless.
+ * fixincl.c: export verbosity enumerations to fixlib.h
+ (run_compiles): mark replacement fixes to be skipped when
+ in testing mode
+ * fixlib.h: add a test mode and enumerations from fixincl.c
+ * check.tpl: set TEST_MODE in environment
+ * fixopts.c (initialize_opts): check for TEST_MODE in environment
+ * inclhack.def: move AAB_darwin7_9_long_double_funcs to
+ darwin_9_long_double_funcs_2. It is not a replacement fix.
+ * fixincl.x: regenerate
+ * tests/base/ioLib.h: the need for this is now exposed, so add it.
+ * tests/base/architecture/ppc/math.h: the correct result is now needed.
+
+2012-10-29 Robert Mason <rbmj@verizon.net>
+
+ * fixinc.in: Omit machine name checks for vxworks
+ * fixincludes/inclhack.def (AAB_vxworks_assert) new replacement fix
+ (AAB_vxworks_regs_vxtypes): another
+ (AAB_vxworks_stdint): yet another
+ (AAB_vxworks_unistd): and another
+ (vxworks_ioctl_macro): reformatting fix
+ (vxworks_mkdir_macro): again
+ (vxworks_regs): and again
+ (vxworks_write_const): and again
+ * tests/base/ioLib.h: new test result
+ * tests/base/math.h: likewise
+ * tests/base/sys/stat.h: likewise
+ * tests/base/testing.h: and again
+
2012-09-29 David Edelsohn <dje.gcc@gmail.com>
* inclhack.def (AAB_aix_fcntl): New fix.
diff --git a/fixincludes/README b/fixincludes/README
index c7144a0ba29..9b482102b28 100644
--- a/fixincludes/README
+++ b/fixincludes/README
@@ -44,6 +44,9 @@ To make your fix, you will need to do several things:
Make sure it is now properly handled. Add tests to the
"test_text" entry(ies) that validate your fix. This will
help ensure that future fixes won't negate your work.
+ Do *NOT* specify test text for "wrap" or "replacement" fixes.
+ There is no real possibility that these fixes will fail.
+ If they do, you will surely know straight away.
5. Go into the fixincludes build directory and type, "make check".
You are guaranteed to have issues printed out as a result.
diff --git a/fixincludes/check.tpl b/fixincludes/check.tpl
index a9810e28a8f..0d1f44431fc 100644
--- a/fixincludes/check.tpl
+++ b/fixincludes/check.tpl
@@ -99,6 +99,7 @@ ENDFOR fix
=]
+export TEST_MODE=true
find . -type f | sed 's;^\./;;' | sort | ../../fixincl
cd ${DESTDIR}
diff --git a/fixincludes/fixinc.in b/fixincludes/fixinc.in
index e73aed99a1b..f7b8d8f1ee3 100755
--- a/fixincludes/fixinc.in
+++ b/fixincludes/fixinc.in
@@ -128,6 +128,22 @@ fi
# # # # # # # # # # # # # # # # # # # # #
#
+# Check to see if the machine_name fix needs to be disabled.
+#
+# On some platforms, machine_name doesn't work properly and
+# breaks some of the header files. Since everything works
+# properly without it, just wipe the macro list to
+# disable the fix.
+
+case "${target_canonical}" in
+ *-*-vxworks*)
+ test -f ${MACRO_LIST} && echo > ${MACRO_LIST}
+ ;;
+esac
+
+
+# # # # # # # # # # # # # # # # # # # # #
+#
# In the file macro_list are listed all the predefined
# macros that are not in the C89 reserved namespace (the reserved
# namespace is all identifiers beginnning with two underscores or one
diff --git a/fixincludes/fixincl.c b/fixincludes/fixincl.c
index 1133534202b..fecfb19e1b1 100644
--- a/fixincludes/fixincl.c
+++ b/fixincludes/fixincl.c
@@ -53,22 +53,8 @@ static const char z_std_preamble[] =
original, manufacturer supplied header file. */\n\n";
int find_base_len = 0;
-
-typedef enum {
- VERB_SILENT = 0,
- VERB_FIXES,
- VERB_APPLIES,
- VERB_PROGRESS,
- VERB_TESTS,
- VERB_EVERYTHING
-} te_verbose;
-
-te_verbose verbose_level = VERB_PROGRESS;
int have_tty = 0;
-#define VLEVEL(l) ((unsigned int) verbose_level >= (unsigned int) l)
-#define NOT_SILENT VLEVEL(VERB_FIXES)
-
pid_t process_chain_head = (pid_t) -1;
char* pz_curr_file; /* name of the current file under test/fix */
@@ -412,8 +398,17 @@ run_compiles (void)
/* FOR every fixup, ... */
do
{
- tTestDesc *p_test = p_fixd->p_test_desc;
- int test_ct = p_fixd->test_ct;
+ tTestDesc *p_test;
+ int test_ct;
+
+ if (fixinc_mode && (p_fixd->fd_flags & FD_REPLACEMENT))
+ {
+ p_fixd->fd_flags |= FD_SKIP_TEST;
+ continue;
+ }
+
+ p_test = p_fixd->p_test_desc;
+ test_ct = p_fixd->test_ct;
/* IF the machine type pointer is not NULL (we are not in test mode)
AND this test is for or not done on particular machines
diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
index b3fb351953f..c4a8ec67991 100644
--- a/fixincludes/fixincl.x
+++ b/fixincludes/fixincl.x
@@ -2,11 +2,11 @@
*
* DO NOT EDIT THIS FILE (fixincl.x)
*
- * It has been AutoGen-ed October 2, 2012 at 09:09:03 PM by AutoGen 5.12
+ * It has been AutoGen-ed October 31, 2012 at 10:35:11 AM by AutoGen 5.16
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT SVN-MERGE THIS FILE, EITHER Tue Oct 2 21:09:03 MEST 2012
+/* DO NOT SVN-MERGE THIS FILE, EITHER Wed Oct 31 10:35:11 CET 2012
*
* You must regenerate it. Use the ./genfixes script.
*
@@ -15,7 +15,7 @@
* certain ANSI-incompatible system header files which are fixed to work
* correctly with ANSI C and placed in a directory that GNU C will search.
*
- * This file contains 216 fixup descriptions.
+ * This file contains 224 fixup descriptions.
*
* See README for more information.
*
@@ -269,44 +269,6 @@ static const char* apzAab_Darwin7_9_Long_Double_FuncsPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description of Aab_Darwin7_9_Long_Double_Funcs_2 fix
- */
-tSCC zAab_Darwin7_9_Long_Double_Funcs_2Name[] =
- "AAB_darwin7_9_long_double_funcs_2";
-
-/*
- * File name selection pattern
- */
-tSCC zAab_Darwin7_9_Long_Double_Funcs_2List[] =
- "math.h\0";
-/*
- * Machine/OS name selection pattern
- */
-tSCC* apzAab_Darwin7_9_Long_Double_Funcs_2Machs[] = {
- "*-*-darwin7.9*",
- (const char*)NULL };
-
-/*
- * content selection pattern - do fix if pattern found
- */
-tSCC zAab_Darwin7_9_Long_Double_Funcs_2Select0[] =
- "#include[ \\t]+\\\"";
-
-#define AAB_DARWIN7_9_LONG_DOUBLE_FUNCS_2_TEST_CT 1
-static tTestDesc aAab_Darwin7_9_Long_Double_Funcs_2Tests[] = {
- { TT_EGREP, zAab_Darwin7_9_Long_Double_Funcs_2Select0, (regex_t*)NULL }, };
-
-/*
- * Fix Command Arguments for Aab_Darwin7_9_Long_Double_Funcs_2
- */
-static const char* apzAab_Darwin7_9_Long_Double_Funcs_2Patch[] = {
- "format",
- "%1<%2.h>",
- "([ \\t]*#[ \\t]*include[ \\t]+)\"([a-z0-9/]+)\\.h\"",
- (char*)NULL };
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * *
- *
* Description of Aab_Fd_Zero_Asm_Posix_Types_H fix
*/
tSCC zAab_Fd_Zero_Asm_Posix_Types_HName[] =
@@ -539,6 +501,241 @@ static const char* apzAab_Sun_MemcpyPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Aab_Vxworks_Assert fix
+ */
+tSCC zAab_Vxworks_AssertName[] =
+ "AAB_vxworks_assert";
+
+/*
+ * File name selection pattern
+ */
+tSCC zAab_Vxworks_AssertList[] =
+ "assert.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzAab_Vxworks_AssertMachs[] = {
+ "*-*-vxworks*",
+ (const char*)NULL };
+#define AAB_VXWORKS_ASSERT_TEST_CT 0
+#define aAab_Vxworks_AssertTests (tTestDesc*)NULL
+
+/*
+ * Fix Command Arguments for Aab_Vxworks_Assert
+ */
+static const char* apzAab_Vxworks_AssertPatch[] = {
+"#ifndef _ASSERT_H\n\
+#define _ASSERT_H\n\n\
+#ifdef assert\n\
+#undef assert\n\
+#endif\n\n\
+#if defined(__STDC__) || defined(__cplusplus)\n\
+extern void __assert (const char*);\n\
+#else\n\
+extern void __assert ();\n\
+#endif\n\n\
+#ifdef NDEBUG\n\
+#define assert(ign) ((void)0)\n\
+#else\n\n\
+#define ASSERT_STRINGIFY(str) ASSERT_STRINGIFY_HELPER(str)\n\
+#define ASSERT_STRINGIFY_HELPER(str) #str\n\n\
+#define assert(test) ((void) \\\n\
+ ((test) ? ((void)0) : \\\n\
+ __assert(\"Assertion failed: \" ASSERT_STRINGIFY(test) \", file \" \\\n\
+ __FILE__ \", line \" ASSERT_STRINGIFY(__LINE__) \"\\n\")))\n\n\
+#endif\n\n\
+#endif",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Aab_Vxworks_Regs_Vxtypes fix
+ */
+tSCC zAab_Vxworks_Regs_VxtypesName[] =
+ "AAB_vxworks_regs_vxtypes";
+
+/*
+ * File name selection pattern
+ */
+tSCC zAab_Vxworks_Regs_VxtypesList[] =
+ "regs.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzAab_Vxworks_Regs_VxtypesMachs[] = {
+ "*-*-vxworks*",
+ (const char*)NULL };
+#define AAB_VXWORKS_REGS_VXTYPES_TEST_CT 0
+#define aAab_Vxworks_Regs_VxtypesTests (tTestDesc*)NULL
+
+/*
+ * Fix Command Arguments for Aab_Vxworks_Regs_Vxtypes
+ */
+static const char* apzAab_Vxworks_Regs_VxtypesPatch[] = {
+"#ifndef _REGS_H\n\
+#define _REGS_H\n\
+#include <types/vxTypesOld.h>\n\
+#include_next <arch/../regs.h>\n\
+#endif",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Aab_Vxworks_Stdint fix
+ */
+tSCC zAab_Vxworks_StdintName[] =
+ "AAB_vxworks_stdint";
+
+/*
+ * File name selection pattern
+ */
+tSCC zAab_Vxworks_StdintList[] =
+ "stdint.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzAab_Vxworks_StdintMachs[] = {
+ "*-*-vxworks*",
+ (const char*)NULL };
+#define AAB_VXWORKS_STDINT_TEST_CT 0
+#define aAab_Vxworks_StdintTests (tTestDesc*)NULL
+
+/*
+ * Fix Command Arguments for Aab_Vxworks_Stdint
+ */
+static const char* apzAab_Vxworks_StdintPatch[] = {
+"#ifndef _STDINT_H\n\
+#define _STDINT_H\n\
+/* get int*_t, uint*_t */\n\
+#include <types/vxTypes.h>\n\n\
+/* get legacy vxworks types for compatibility */\n\
+#include <types/vxTypesOld.h>\n\n\
+typedef long intptr_t;\n\
+typedef unsigned long uintptr_t;\n\n\
+typedef int64_t intmax_t;\n\
+typedef uint64_t uintmax_t;\n\n\
+typedef int8_t int_least8_t;\n\
+typedef int16_t int_least16_t;\n\
+typedef int32_t int_least32_t;\n\
+typedef int64_t int_least64_t;\n\n\
+typedef uint8_t uint_least8_t;\n\
+typedef uint16_t uint_least16_t;\n\
+typedef uint32_t uint_least32_t;\n\
+typedef uint64_t uint_least64_t;\n\n\
+typedef int8_t int_fast8_t;\n\
+typedef int int_fast16_t;\n\
+typedef int32_t int_fast32_t;\n\
+typedef int64_t int_fast64_t;\n\n\
+typedef uint8_t uint_fast8_t;\n\
+typedef unsigned int uint_fast16_t;\n\
+typedef uint32_t uint_fast32_t;\n\
+typedef uint64_t uint_fast64_t;\n\n\
+/* Ranges */\n\
+#define UINT8_MAX (~(uint8_t)0)\n\
+#define UINT8_MIN 0\n\
+#define UINT16_MAX (~(uint16_t)0)\n\
+#define UINT16_MIN 0\n\
+#define UINT32_MAX (~(uint32_t)0)\n\
+#define UINT32_MIN 0\n\
+#define UINT64_MAX (~(uint64_t)0)\n\
+#define UINT64_MIN 0\n\n\
+#define UINTPTR_MAX (~(uintptr_t)0)\n\
+#define UINTPTR_MIN 0\n\n\
+/* Need to do int_fast16_t as well, as type\n\
+ size may be architecture dependent */\n\
+#define UINT_FAST16_MAX (~(uint_fast16_t)0)\n\
+#define UINT_FAST16_MAX 0\n\n\
+#define INT8_MAX (UINT8_MAX>>1)\n\
+#define INT8_MIN (INT8_MAX+1)\n\
+#define INT16_MAX (UINT16_MAX>>1)\n\
+#define INT16_MIN (INT16_MAX+1)\n\
+#define INT32_MAX (UINT32_MAX>>1)\n\
+#define INT32_MIN (INT32_MAX+1)\n\
+#define INT64_MAX (UINT64_MAX>>1)\n\
+#define INT64_MIN (INT64_MAX+1)\n\n\
+#define INTPTR_MAX (UINTPTR_MAX>>1)\n\
+#define INTPTR_MIN (INTPTR_MAX+1)\t\n\n\
+#define INT_FAST16_MAX (UINT_FAST16_MAX>>1)\n\
+#define INT_FAST16_MIN (INT_FAST16_MAX+1)\n\n\
+/* now define equiv. constants */\n\
+#define UINT_FAST8_MAX UINT8_MAX\n\
+#define UINT_FAST8_MIN UINT_FAST8_MIN\n\
+#define INT_FAST8_MAX INT8_MAX\n\
+#define INT_FAST8_MIN INT8_MIN\n\
+#define UINT_FAST32_MAX UINT32_MAX\n\
+#define UINT_FAST32_MIN UINT32_MIN\n\
+#define INT_FAST32_MAX INT32_MAX\n\
+#define INT_FAST32_MIN INT32_MIN\n\
+#define UINT_FAST64_MAX UINT64_MAX\n\
+#define UINT_FAST64_MIN UINT64_MIN\n\
+#define INT_FAST64_MAX INT64_MAX\n\
+#define INT_FAST64_MIN INT64_MIN\n\n\
+#define UINT_LEAST8_MAX UINT8_MAX\n\
+#define UINT_LEAST8_MIN UINT8_MIN\n\
+#define INT_LEAST8_MAX INT8_MAX\n\
+#define INT_LEAST8_MIN INT8_MIN\n\
+#define UINT_LEAST16_MAX UINT16_MAX\n\
+#define UINT_LEAST16_MIN UINT16_MIN\n\
+#define INT_LEAST16_MAX INT16_MAX\n\
+#define INT_LEAST16_MIN INT16_MIN\n\
+#define UINT_LEAST32_MAX UINT32_MAX\n\
+#define UINT_LEAST32_MIN UINT32_MIN\n\
+#define INT_LEAST32_MAX INT32_MAX\n\
+#define INT_LEAST32_MIN INT32_MIN\n\
+#define UINT_LEAST64_MAX UINT64_MAX\n\
+#define UINT_LEAST64_MIN UINT64_MIN\n\
+#define INT_LEAST64_MAX INT64_MAX\n\
+#define INT_LEAST64_MIN INT64_MIN\n\n\
+#define UINTMAX_MAX UINT64_MAX\n\
+#define UINTMAX_MIN UINT64_MIN\n\
+#define INTMAX_MAX INT64_MAX\n\
+#define INTMAX_MIN INT64_MIN\n\n\
+#endif",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Aab_Vxworks_Unistd fix
+ */
+tSCC zAab_Vxworks_UnistdName[] =
+ "AAB_vxworks_unistd";
+
+/*
+ * File name selection pattern
+ */
+tSCC zAab_Vxworks_UnistdList[] =
+ "unistd.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzAab_Vxworks_UnistdMachs[] = {
+ "*-*-vxworks*",
+ (const char*)NULL };
+#define AAB_VXWORKS_UNISTD_TEST_CT 0
+#define aAab_Vxworks_UnistdTests (tTestDesc*)NULL
+
+/*
+ * Fix Command Arguments for Aab_Vxworks_Unistd
+ */
+static const char* apzAab_Vxworks_UnistdPatch[] = {
+"#ifndef _UNISTD_H\n\
+#define _UNISTD_H\n\
+#include_next <unistd.h>\n\
+#include <ioLib.h>\n\
+#ifndef STDIN_FILENO\n\
+#define STDIN_FILENO 0\n\
+#endif\n\
+#ifndef STDOUT_FILENO\n\
+#define STDOUT_FILENO 1\n\
+#endif\n\
+#ifndef STDERR_FILENO\n\
+#define STDERR_FILENO 2\n\
+#endif\n\
+#endif /* _UNISTD_H */",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Aix_Complex fix
*/
tSCC zAix_ComplexName[] =
@@ -1758,7 +1955,7 @@ tSCC zBroken_NanList[] =
* content selection pattern - do fix if pattern found
*/
tSCC zBroken_NanSelect0[] =
- "#if defined(__APPLE_CC__) && (__APPLE_CC__ >= 1345)";
+ "#if defined\\(__APPLE_CC__\\) && \\(__APPLE_CC__ >= 1345\\)";
/*
* content bypass pattern - skip fix if pattern found
@@ -1971,6 +2168,44 @@ extern \"C\" {\n\
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Darwin_9_Long_Double_Funcs_2 fix
+ */
+tSCC zDarwin_9_Long_Double_Funcs_2Name[] =
+ "darwin_9_long_double_funcs_2";
+
+/*
+ * File name selection pattern
+ */
+tSCC zDarwin_9_Long_Double_Funcs_2List[] =
+ "math.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzDarwin_9_Long_Double_Funcs_2Machs[] = {
+ "*-*-darwin7.9*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zDarwin_9_Long_Double_Funcs_2Select0[] =
+ "#include[ \\t]+\\\"";
+
+#define DARWIN_9_LONG_DOUBLE_FUNCS_2_TEST_CT 1
+static tTestDesc aDarwin_9_Long_Double_Funcs_2Tests[] = {
+ { TT_EGREP, zDarwin_9_Long_Double_Funcs_2Select0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Darwin_9_Long_Double_Funcs_2
+ */
+static const char* apzDarwin_9_Long_Double_Funcs_2Patch[] = {
+ "format",
+ "%1<%2.h>",
+ "([ \\t]*#[ \\t]*include[ \\t]+)\"([a-z0-9/]+)\\.h\"",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Darwin_Externc fix
*/
tSCC zDarwin_ExterncName[] =
@@ -8499,6 +8734,68 @@ static const char* apzVxworks_Gcc_ProblemPatch[] = { sed_cmd_z,
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Vxworks_Ioctl_Macro fix
+ */
+tSCC zVxworks_Ioctl_MacroName[] =
+ "vxworks_ioctl_macro";
+
+/*
+ * File name selection pattern
+ */
+tSCC zVxworks_Ioctl_MacroList[] =
+ "ioLib.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzVxworks_Ioctl_MacroMachs[] = {
+ "*-*-vxworks*",
+ (const char*)NULL };
+#define VXWORKS_IOCTL_MACRO_TEST_CT 0
+#define aVxworks_Ioctl_MacroTests (tTestDesc*)NULL
+
+/*
+ * Fix Command Arguments for Vxworks_Ioctl_Macro
+ */
+static const char* apzVxworks_Ioctl_MacroPatch[] = {
+ "format",
+ "%0\n\
+#define ioctl(fd, func, arg) (ioctl)(fd, func, (int)(arg))\n",
+ "extern[\t ]+int[\t ]+ioctl[\t ]*\\([\t ,[:alnum:]]*\\);",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Vxworks_Mkdir_Macro fix
+ */
+tSCC zVxworks_Mkdir_MacroName[] =
+ "vxworks_mkdir_macro";
+
+/*
+ * File name selection pattern
+ */
+tSCC zVxworks_Mkdir_MacroList[] =
+ "sys/stat.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzVxworks_Mkdir_MacroMachs[] = {
+ "*-*-vxworks*",
+ (const char*)NULL };
+#define VXWORKS_MKDIR_MACRO_TEST_CT 0
+#define aVxworks_Mkdir_MacroTests (tTestDesc*)NULL
+
+/*
+ * Fix Command Arguments for Vxworks_Mkdir_Macro
+ */
+static const char* apzVxworks_Mkdir_MacroPatch[] = {
+ "format",
+ "%0\n\
+#define mkdir(dir, ...) ((void)0, ##__VA_ARGS__, (mkdir)(dir))\n",
+ "extern[\t ]+STATUS[\t ]+mkdir[\t ]*\\([\t ]*const[\t ]+char[\t ]*\\*[\t ]*(|[_[:alpha:]][_[:alnum:]]*)\\)[\t ]*;",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Vxworks_Needs_Vxtypes fix
*/
tSCC zVxworks_Needs_VxtypesName[] =
@@ -8582,6 +8879,42 @@ static const char* apzVxworks_Needs_VxworksPatch[] = { sed_cmd_z,
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Vxworks_Regs fix
+ */
+tSCC zVxworks_RegsName[] =
+ "vxworks_regs";
+
+/*
+ * File name selection pattern
+ */
+#define zVxworks_RegsList (char*)NULL
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzVxworks_RegsMachs[] = {
+ "*-*-vxworks*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zVxworks_RegsSelect0[] =
+ "#[\t ]*include[\t ]+[<\"]regs.h[>\"]";
+
+#define VXWORKS_REGS_TEST_CT 1
+static tTestDesc aVxworks_RegsTests[] = {
+ { TT_EGREP, zVxworks_RegsSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Vxworks_Regs
+ */
+static const char* apzVxworks_RegsPatch[] = {
+ "format",
+ "#include <arch/../regs.h>",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Vxworks_Time fix
*/
tSCC zVxworks_TimeName[] =
@@ -8632,6 +8965,36 @@ typedef void (*__gcc_VOIDFUNCPTR) ();\n\
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Vxworks_Write_Const fix
+ */
+tSCC zVxworks_Write_ConstName[] =
+ "vxworks_write_const";
+
+/*
+ * File name selection pattern
+ */
+tSCC zVxworks_Write_ConstList[] =
+ "ioLib.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzVxworks_Write_ConstMachs[] = {
+ "*-*-vxworks*",
+ (const char*)NULL };
+#define VXWORKS_WRITE_CONST_TEST_CT 0
+#define aVxworks_Write_ConstTests (tTestDesc*)NULL
+
+/*
+ * Fix Command Arguments for Vxworks_Write_Const
+ */
+static const char* apzVxworks_Write_ConstPatch[] = {
+ "format",
+ "extern int write (int, const char*, size_t);",
+ "extern[\t ]+int[\t ]+write[\t ]*\\([\t ]*int[\t ]*,[\t ]*char[\t ]*\\*[\t ]*,[\t ]*size_t[\t ]*\\)[\t ]*;",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of X11_Class fix
*/
tSCC zX11_ClassName[] =
@@ -8800,9 +9163,9 @@ static const char* apzX11_SprintfPatch[] = {
*
* List of all fixes
*/
-#define REGEX_COUNT 259
+#define REGEX_COUNT 260
#define MACH_LIST_SIZE_LIMIT 181
-#define FIX_COUNT 216
+#define FIX_COUNT 224
/*
* Enumerate the fixes
@@ -8811,12 +9174,15 @@ typedef enum {
AAB_AIX_STDIO_FIXIDX,
AAB_AIX_FCNTL_FIXIDX,
AAB_DARWIN7_9_LONG_DOUBLE_FUNCS_FIXIDX,
- AAB_DARWIN7_9_LONG_DOUBLE_FUNCS_2_FIXIDX,
AAB_FD_ZERO_ASM_POSIX_TYPES_H_FIXIDX,
AAB_FD_ZERO_GNU_TYPES_H_FIXIDX,
AAB_FD_ZERO_SELECTBITS_H_FIXIDX,
AAB_SOLARIS_SYS_VARARGS_H_FIXIDX,
AAB_SUN_MEMCPY_FIXIDX,
+ AAB_VXWORKS_ASSERT_FIXIDX,
+ AAB_VXWORKS_REGS_VXTYPES_FIXIDX,
+ AAB_VXWORKS_STDINT_FIXIDX,
+ AAB_VXWORKS_UNISTD_FIXIDX,
AIX_COMPLEX_FIXIDX,
AIX_MALLOC_FIXIDX,
AIX_NET_IF_ARP_FIXIDX,
@@ -8854,6 +9220,7 @@ typedef enum {
CTRL_QUOTES_DEF_FIXIDX,
CTRL_QUOTES_USE_FIXIDX,
CXX_UNREADY_FIXIDX,
+ DARWIN_9_LONG_DOUBLE_FUNCS_2_FIXIDX,
DARWIN_EXTERNC_FIXIDX,
DARWIN_GCC4_BREAKAGE_FIXIDX,
DARWIN_PRIVATE_EXTERN_FIXIDX,
@@ -9017,9 +9384,13 @@ typedef enum {
VMS_USE_FAST_SETJMP_FIXIDX,
VOID_NULL_FIXIDX,
VXWORKS_GCC_PROBLEM_FIXIDX,
+ VXWORKS_IOCTL_MACRO_FIXIDX,
+ VXWORKS_MKDIR_MACRO_FIXIDX,
VXWORKS_NEEDS_VXTYPES_FIXIDX,
VXWORKS_NEEDS_VXWORKS_FIXIDX,
+ VXWORKS_REGS_FIXIDX,
VXWORKS_TIME_FIXIDX,
+ VXWORKS_WRITE_CONST_FIXIDX,
X11_CLASS_FIXIDX,
X11_CLASS_USAGE_FIXIDX,
X11_NEW_FIXIDX,
@@ -9042,11 +9413,6 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
AAB_DARWIN7_9_LONG_DOUBLE_FUNCS_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
aAab_Darwin7_9_Long_Double_FuncsTests, apzAab_Darwin7_9_Long_Double_FuncsPatch, 0 },
- { zAab_Darwin7_9_Long_Double_Funcs_2Name, zAab_Darwin7_9_Long_Double_Funcs_2List,
- apzAab_Darwin7_9_Long_Double_Funcs_2Machs,
- AAB_DARWIN7_9_LONG_DOUBLE_FUNCS_2_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
- aAab_Darwin7_9_Long_Double_Funcs_2Tests, apzAab_Darwin7_9_Long_Double_Funcs_2Patch, 0 },
-
{ zAab_Fd_Zero_Asm_Posix_Types_HName, zAab_Fd_Zero_Asm_Posix_Types_HList,
apzAab_Fd_Zero_Asm_Posix_Types_HMachs,
AAB_FD_ZERO_ASM_POSIX_TYPES_H_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
@@ -9072,6 +9438,26 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
AAB_SUN_MEMCPY_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
aAab_Sun_MemcpyTests, apzAab_Sun_MemcpyPatch, 0 },
+ { zAab_Vxworks_AssertName, zAab_Vxworks_AssertList,
+ apzAab_Vxworks_AssertMachs,
+ AAB_VXWORKS_ASSERT_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
+ aAab_Vxworks_AssertTests, apzAab_Vxworks_AssertPatch, 0 },
+
+ { zAab_Vxworks_Regs_VxtypesName, zAab_Vxworks_Regs_VxtypesList,
+ apzAab_Vxworks_Regs_VxtypesMachs,
+ AAB_VXWORKS_REGS_VXTYPES_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
+ aAab_Vxworks_Regs_VxtypesTests, apzAab_Vxworks_Regs_VxtypesPatch, 0 },
+
+ { zAab_Vxworks_StdintName, zAab_Vxworks_StdintList,
+ apzAab_Vxworks_StdintMachs,
+ AAB_VXWORKS_STDINT_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
+ aAab_Vxworks_StdintTests, apzAab_Vxworks_StdintPatch, 0 },
+
+ { zAab_Vxworks_UnistdName, zAab_Vxworks_UnistdList,
+ apzAab_Vxworks_UnistdMachs,
+ AAB_VXWORKS_UNISTD_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
+ aAab_Vxworks_UnistdTests, apzAab_Vxworks_UnistdPatch, 0 },
+
{ zAix_ComplexName, zAix_ComplexList,
apzAix_ComplexMachs,
AIX_COMPLEX_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
@@ -9257,6 +9643,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
CXX_UNREADY_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aCxx_UnreadyTests, apzCxx_UnreadyPatch, 0 },
+ { zDarwin_9_Long_Double_Funcs_2Name, zDarwin_9_Long_Double_Funcs_2List,
+ apzDarwin_9_Long_Double_Funcs_2Machs,
+ DARWIN_9_LONG_DOUBLE_FUNCS_2_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aDarwin_9_Long_Double_Funcs_2Tests, apzDarwin_9_Long_Double_Funcs_2Patch, 0 },
+
{ zDarwin_ExterncName, zDarwin_ExterncList,
apzDarwin_ExterncMachs,
DARWIN_EXTERNC_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
@@ -10072,6 +10463,16 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
VXWORKS_GCC_PROBLEM_TEST_CT, FD_MACH_ONLY,
aVxworks_Gcc_ProblemTests, apzVxworks_Gcc_ProblemPatch, 0 },
+ { zVxworks_Ioctl_MacroName, zVxworks_Ioctl_MacroList,
+ apzVxworks_Ioctl_MacroMachs,
+ VXWORKS_IOCTL_MACRO_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aVxworks_Ioctl_MacroTests, apzVxworks_Ioctl_MacroPatch, 0 },
+
+ { zVxworks_Mkdir_MacroName, zVxworks_Mkdir_MacroList,
+ apzVxworks_Mkdir_MacroMachs,
+ VXWORKS_MKDIR_MACRO_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aVxworks_Mkdir_MacroTests, apzVxworks_Mkdir_MacroPatch, 0 },
+
{ zVxworks_Needs_VxtypesName, zVxworks_Needs_VxtypesList,
apzVxworks_Needs_VxtypesMachs,
VXWORKS_NEEDS_VXTYPES_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
@@ -10082,11 +10483,21 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
VXWORKS_NEEDS_VXWORKS_TEST_CT, FD_MACH_ONLY,
aVxworks_Needs_VxworksTests, apzVxworks_Needs_VxworksPatch, 0 },
+ { zVxworks_RegsName, zVxworks_RegsList,
+ apzVxworks_RegsMachs,
+ VXWORKS_REGS_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aVxworks_RegsTests, apzVxworks_RegsPatch, 0 },
+
{ zVxworks_TimeName, zVxworks_TimeList,
apzVxworks_TimeMachs,
VXWORKS_TIME_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aVxworks_TimeTests, apzVxworks_TimePatch, 0 },
+ { zVxworks_Write_ConstName, zVxworks_Write_ConstList,
+ apzVxworks_Write_ConstMachs,
+ VXWORKS_WRITE_CONST_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aVxworks_Write_ConstTests, apzVxworks_Write_ConstPatch, 0 },
+
{ zX11_ClassName, zX11_ClassList,
apzX11_ClassMachs,
X11_CLASS_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
diff --git a/fixincludes/fixlib.h b/fixincludes/fixlib.h
index 42d98b22558..19df48a8b0f 100644
--- a/fixincludes/fixlib.h
+++ b/fixincludes/fixlib.h
@@ -140,7 +140,10 @@ typedef int apply_fix_p_t; /* Apply Fix Predicate Type */
"amount of user entertainment" ) \
\
_ENV_( pz_find_base, BOOL_TRUE, "FIND_BASE", \
- "leader to trim from file names" )
+ "leader to trim from file names" ) \
+ \
+ _ENV_( pz_test_mode, BOOL_FALSE, "TEST_MODE", \
+ "run fixincludes in test mode" )
#define _ENV_(v,m,n,t) extern tCC* v;
ENV_TABLE
@@ -211,6 +214,27 @@ typedef struct {
extern int gnu_type_map_ct;
+typedef enum {
+ VERB_SILENT = 0,
+ VERB_FIXES,
+ VERB_APPLIES,
+ VERB_PROGRESS,
+ VERB_TESTS,
+ VERB_EVERYTHING
+} te_verbose;
+
+te_verbose verbose_level;
+
+#define VLEVEL(l) ((unsigned int) verbose_level >= (unsigned int) l)
+#define NOT_SILENT VLEVEL(VERB_FIXES)
+
+typedef enum {
+ TESTING_OFF = 0,
+ TESTING_ON = 1
+} fixinc_mode_t;
+
+fixinc_mode_t fixinc_mode;
+
#ifdef HAVE_MMAP_FILE
#define UNLOAD_DATA() do { if (curr_data_mapped) { \
munmap ((void*)pz_curr_data, data_map_size); close (data_map_fd); } \
diff --git a/fixincludes/fixopts.c b/fixincludes/fixopts.c
index d305cd76747..4be36933c8f 100644
--- a/fixincludes/fixopts.c
+++ b/fixincludes/fixopts.c
@@ -20,31 +20,43 @@ along with GCC; see the file COPYING3. If not see
#include "fixlib.h"
-#define _ENV_(v,m,n,t) tCC* v = NULL;
+te_verbose verbose_level = VERB_PROGRESS;
+
+fixinc_mode_t fixinc_mode = TESTING_OFF;
+
+#define _ENV_(v,m,n,t) char const * v = NULL;
ENV_TABLE
#undef _ENV_
-void
-initialize_opts (void)
+static void
+show_not_def (char const * vname)
{
static const char var_not_found[] =
-#ifndef __STDC__
- "fixincl ERROR: %s environment variable not defined\n"
-#else
"fixincl ERROR: %s environment variable not defined\n"
- "each of these must be defined:\n"
-# define _ENV_(vv,mm,nn,tt) "\t" nn " - " tt "\n"
+ "each of these must be defined:\n";
+ static char const not_found_var[] = "\t%s\n";
+
+ fprintf (stderr, var_not_found, vname);
+# define _ENV_(vv,mm,nn,tt) \
+ if (mm) fprintf (stderr, not_found_var, nn);
ENV_TABLE
# undef _ENV_
-#endif
- ;
-#define _ENV_(v,m,n,t) { tSCC var[] = n; \
- v = getenv (var); if (m && (v == NULL)) { \
- fprintf (stderr, var_not_found, var); \
- exit (EXIT_FAILURE); } }
+ exit (EXIT_FAILURE);
+}
-ENV_TABLE
+void
+initialize_opts (void)
+{
+#define _ENV_(v,m,n,t) { \
+ static char const var[] = n; \
+ v = getenv (var); \
+ if (m && (v == NULL)) show_not_def (var); \
+ }
+ ENV_TABLE;
#undef _ENV_
+
+ if ((pz_test_mode != NULL) && (strcmp (pz_test_mode, "true") == 0))
+ fixinc_mode = TESTING_ON;
}
diff --git a/fixincludes/fixtests.c b/fixincludes/fixtests.c
index d668b92f2a1..f95dd73bc16 100644
--- a/fixincludes/fixtests.c
+++ b/fixincludes/fixtests.c
@@ -46,7 +46,7 @@ along with GCC; see the file COPYING3. If not see
#include "fixlib.h"
-#define _ENV_(v,m,n,t) extern tCC* v;
+#define _ENV_(v,m,n,t) extern char const * v;
ENV_TABLE
#undef _ENV_
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index a615194c743..09eac7c6254 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -196,25 +196,6 @@ fix = {
_EndOfHeader_;
};
-
-/*
- * ... and for the previous fix to be useful, you have to not use ""
- * includes.
- */
-fix = {
- hackname = AAB_darwin7_9_long_double_funcs_2;
- mach = "*-*-darwin7.9*";
- files = math.h;
- select = '#include[ \t]+\"';
- c_fix = format;
- c_fix_arg = "%1<%2.h>";
-
- c_fix_arg = '([ \t]*#[ \t]*include[ \t]+)"([a-z0-9/]+)\.h"';
-
- test_text = '#include "architecture/ppc/math.h"';
-};
-
-
/*
* This fixes __FD_ZERO bug for linux 2.x.y (x <= 2 && y <= some n)
*/
@@ -393,6 +374,206 @@ fix = {
_EndOfHeader_;
};
+/*
+ * Fix assert.h on VxWorks:
+ */
+fix = {
+ hackname = AAB_vxworks_assert;
+ files = assert.h;
+ mach = "*-*-vxworks*";
+
+ replace = <<- _EndOfHeader_
+ #ifndef _ASSERT_H
+ #define _ASSERT_H
+
+ #ifdef assert
+ #undef assert
+ #endif
+
+ #if defined(__STDC__) || defined(__cplusplus)
+ extern void __assert (const char*);
+ #else
+ extern void __assert ();
+ #endif
+
+ #ifdef NDEBUG
+ #define assert(ign) ((void)0)
+ #else
+
+ #define ASSERT_STRINGIFY(str) ASSERT_STRINGIFY_HELPER(str)
+ #define ASSERT_STRINGIFY_HELPER(str) #str
+
+ #define assert(test) ((void) \
+ ((test) ? ((void)0) : \
+ __assert("Assertion failed: " ASSERT_STRINGIFY(test) ", file " \
+ __FILE__ ", line " ASSERT_STRINGIFY(__LINE__) "\n")))
+
+ #endif
+
+ #endif
+ _EndOfHeader_;
+};
+
+/*
+ * Add needed include to regs.h (NOT the gcc header) on VxWorks
+ */
+
+fix = {
+ hackname = AAB_vxworks_regs_vxtypes;
+ files = regs.h;
+ mach = "*-*-vxworks*";
+
+ replace = <<- _EndOfHeader_
+ #ifndef _REGS_H
+ #define _REGS_H
+ #include <types/vxTypesOld.h>
+ #include_next <arch/../regs.h>
+ #endif
+ _EndOfHeader_;
+};
+
+/*
+ * Make VxWorks stdint.h a bit more compliant - add typedefs
+ */
+fix = {
+ hackname = AAB_vxworks_stdint;
+ files = stdint.h;
+ mach = "*-*-vxworks*";
+
+ replace = <<- _EndOfHeader_
+ #ifndef _STDINT_H
+ #define _STDINT_H
+ /* get int*_t, uint*_t */
+ #include <types/vxTypes.h>
+
+ /* get legacy vxworks types for compatibility */
+ #include <types/vxTypesOld.h>
+
+ typedef long intptr_t;
+ typedef unsigned long uintptr_t;
+
+ typedef int64_t intmax_t;
+ typedef uint64_t uintmax_t;
+
+ typedef int8_t int_least8_t;
+ typedef int16_t int_least16_t;
+ typedef int32_t int_least32_t;
+ typedef int64_t int_least64_t;
+
+ typedef uint8_t uint_least8_t;
+ typedef uint16_t uint_least16_t;
+ typedef uint32_t uint_least32_t;
+ typedef uint64_t uint_least64_t;
+
+ typedef int8_t int_fast8_t;
+ typedef int int_fast16_t;
+ typedef int32_t int_fast32_t;
+ typedef int64_t int_fast64_t;
+
+ typedef uint8_t uint_fast8_t;
+ typedef unsigned int uint_fast16_t;
+ typedef uint32_t uint_fast32_t;
+ typedef uint64_t uint_fast64_t;
+
+ /* Ranges */
+ #define UINT8_MAX (~(uint8_t)0)
+ #define UINT8_MIN 0
+ #define UINT16_MAX (~(uint16_t)0)
+ #define UINT16_MIN 0
+ #define UINT32_MAX (~(uint32_t)0)
+ #define UINT32_MIN 0
+ #define UINT64_MAX (~(uint64_t)0)
+ #define UINT64_MIN 0
+
+ #define UINTPTR_MAX (~(uintptr_t)0)
+ #define UINTPTR_MIN 0
+
+ /* Need to do int_fast16_t as well, as type
+ size may be architecture dependent */
+ #define UINT_FAST16_MAX (~(uint_fast16_t)0)
+ #define UINT_FAST16_MAX 0
+
+ #define INT8_MAX (UINT8_MAX>>1)
+ #define INT8_MIN (INT8_MAX+1)
+ #define INT16_MAX (UINT16_MAX>>1)
+ #define INT16_MIN (INT16_MAX+1)
+ #define INT32_MAX (UINT32_MAX>>1)
+ #define INT32_MIN (INT32_MAX+1)
+ #define INT64_MAX (UINT64_MAX>>1)
+ #define INT64_MIN (INT64_MAX+1)
+
+ #define INTPTR_MAX (UINTPTR_MAX>>1)
+ #define INTPTR_MIN (INTPTR_MAX+1)
+
+ #define INT_FAST16_MAX (UINT_FAST16_MAX>>1)
+ #define INT_FAST16_MIN (INT_FAST16_MAX+1)
+
+ /* now define equiv. constants */
+ #define UINT_FAST8_MAX UINT8_MAX
+ #define UINT_FAST8_MIN UINT_FAST8_MIN
+ #define INT_FAST8_MAX INT8_MAX
+ #define INT_FAST8_MIN INT8_MIN
+ #define UINT_FAST32_MAX UINT32_MAX
+ #define UINT_FAST32_MIN UINT32_MIN
+ #define INT_FAST32_MAX INT32_MAX
+ #define INT_FAST32_MIN INT32_MIN
+ #define UINT_FAST64_MAX UINT64_MAX
+ #define UINT_FAST64_MIN UINT64_MIN
+ #define INT_FAST64_MAX INT64_MAX
+ #define INT_FAST64_MIN INT64_MIN
+
+ #define UINT_LEAST8_MAX UINT8_MAX
+ #define UINT_LEAST8_MIN UINT8_MIN
+ #define INT_LEAST8_MAX INT8_MAX
+ #define INT_LEAST8_MIN INT8_MIN
+ #define UINT_LEAST16_MAX UINT16_MAX
+ #define UINT_LEAST16_MIN UINT16_MIN
+ #define INT_LEAST16_MAX INT16_MAX
+ #define INT_LEAST16_MIN INT16_MIN
+ #define UINT_LEAST32_MAX UINT32_MAX
+ #define UINT_LEAST32_MIN UINT32_MIN
+ #define INT_LEAST32_MAX INT32_MAX
+ #define INT_LEAST32_MIN INT32_MIN
+ #define UINT_LEAST64_MAX UINT64_MAX
+ #define UINT_LEAST64_MIN UINT64_MIN
+ #define INT_LEAST64_MAX INT64_MAX
+ #define INT_LEAST64_MIN INT64_MIN
+
+ #define UINTMAX_MAX UINT64_MAX
+ #define UINTMAX_MIN UINT64_MIN
+ #define INTMAX_MAX INT64_MAX
+ #define INTMAX_MIN INT64_MIN
+
+ #endif
+ _EndOfHeader_;
+};
+
+/*
+ * This hack makes makes unistd.h more POSIX-compliant on VxWorks
+ */
+fix = {
+ hackname = AAB_vxworks_unistd;
+ files = unistd.h;
+ mach = "*-*-vxworks*";
+
+ replace = <<- _EndOfHeader_
+ #ifndef _UNISTD_H
+ #define _UNISTD_H
+ #include_next <unistd.h>
+ #include <ioLib.h>
+ #ifndef STDIN_FILENO
+ #define STDIN_FILENO 0
+ #endif
+ #ifndef STDOUT_FILENO
+ #define STDOUT_FILENO 1
+ #endif
+ #ifndef STDERR_FILENO
+ #define STDERR_FILENO 2
+ #endif
+ #endif /* _UNISTD_H */
+ _EndOfHeader_;
+};
+
/*
* complex.h on AIX 5 and AIX 6 define _Complex_I and I in terms of __I,
@@ -869,7 +1050,6 @@ fix = {
test_text = "extern void exit ( int );";
};
-
/*
* Remove `extern double cabs' declarations from math.h.
* This conflicts with C99. Discovered on AIX.
@@ -905,7 +1085,7 @@ fix = {
*/
files = "architecture/ppc/math.h";
files = "architecture/*/math.h";
- select = "#if defined(__APPLE_CC__) && (__APPLE_CC__ >= 1345)";
+ select = '#if defined\(__APPLE_CC__\) && \(__APPLE_CC__ >= 1345\)';
bypass = "powl";
c_fix = format;
c_fix_arg = "#if 1";
@@ -979,6 +1159,9 @@ fix = {
test_text = "#define _CTRL(c) ('c'&037)";
};
+/*
+ * Fix various macros used to define ioctl numbers.
+ */
fix = {
hackname = ctrl_quotes_use;
select = "define[ \t]+[A-Z0-9_]+[ \t]+[A-Z0-9_]+CTRL[ \t]*\\( *[^,']";
@@ -1015,6 +1198,23 @@ fix = {
test_text = "extern void* malloc( size_t );";
};
+/*
+ * For the AAB_darwin7_9_long_double_funcs fix to be useful,
+ * you have to not use "" includes.
+ */
+fix = {
+ hackname = darwin_9_long_double_funcs_2;
+ mach = "*-*-darwin7.9*";
+ files = math.h;
+ select = '#include[ \t]+\"';
+ c_fix = format;
+ c_fix_arg = "%1<%2.h>";
+
+ c_fix_arg = '([ \t]*#[ \t]*include[ \t]+)"([a-z0-9/]+)\.h"';
+
+ test_text = '#include "architecture/ppc/math.h"';
+};
+
/*
* On darwin8 and earlier, mach-o/swap.h isn't properly guarded
@@ -2298,6 +2498,9 @@ fix = {
"#define XX_IO(x) ('x'<<8|256)";
};
+/*
+ * Fix the usage of the ioctl macro numbers.
+ */
fix = {
hackname = io_quotes_use;
select = "define[ \t]+[A-Z0-9_]+[ \t]+[A-Z0-9_]+IO[A-Z]*[ \t]*"
@@ -4410,6 +4613,41 @@ fix = {
"#endif /* __GNUC_TYPEOF_FEATURE_BROKEN_USE_DEFAULT_UNTIL_FIXED__ */\n";
};
+/*
+ * Wrap VxWorks ioctl to keep everything pretty
+ */
+fix = {
+ hackname = vxworks_ioctl_macro;
+ files = ioLib.h;
+ mach = "*-*-vxworks*";
+
+ c_fix = format;
+ c_fix_arg = "%0\n"
+ "#define ioctl(fd, func, arg) (ioctl)(fd, func, (int)(arg))\n";
+ c_fix_arg = "extern[\t ]+int[\t ]+ioctl[\t ]*\\([\t ,[:alnum:]]*\\);";
+
+ test_text = "extern int ioctl ( int asdf1234, int jkl , int qwerty ) ;";
+};
+
+/*
+ * Wrap VxWorks mkdir to be posix compliant
+ */
+fix = {
+ hackname = vxworks_mkdir_macro;
+ files = sys/stat.h;
+ mach = "*-*-vxworks*";
+
+ c_fix = format;
+ c_fix_arg = "%0\n"
+ "#define mkdir(dir, ...) ((void)0, ##__VA_ARGS__, (mkdir)(dir))\n";
+ c_fix_arg = "extern[\t ]+STATUS[\t ]+mkdir[\t ]*"
+ "\\([\t ]*const[\t ]+char[\t ]*\\*[\t ]*" /* arg type */
+ "(|[_[:alpha:]][_[:alnum:]]*)" /* arg name (optional) */
+ "\\)[\t ]*;";
+
+ test_text = "extern STATUS mkdir (const char * _qwerty) ;";
+};
+
/*
* Fix VxWorks <time.h> to not require including <vxTypes.h>.
@@ -4443,6 +4681,20 @@ fix = {
"# define\t__INCstath <sys/stat.h>";
};
+/*
+ * Make it so VxWorks does not include gcc/regs.h accidentally
+ */
+fix = {
+ hackname = vxworks_regs;
+ mach = "*-*-vxworks*";
+
+ select = "#[\t ]*include[\t ]+[<\"]regs.h[>\"]";
+ c_fix = format;
+ c_fix_arg = "#include <arch/../regs.h>";
+
+ test_text = "#include <regs.h>\n";
+};
+
/*
* Another bad dependency in VxWorks 5.2 <time.h>.
@@ -4470,6 +4722,23 @@ fix = {
"#define VOIDFUNCPTR (void(*)())";
};
+/*
+ * This hack makes write const-correct on VxWorks
+ */
+fix = {
+ hackname = vxworks_write_const;
+ files = ioLib.h;
+ mach = "*-*-vxworks*";
+
+ c_fix = format;
+ c_fix_arg = "extern int write (int, const char*, size_t);";
+ c_fix_arg = "extern[\t ]+int[\t ]+write[\t ]*\\("
+ "[\t ]*int[\t ]*,"
+ "[\t ]*char[\t ]*\\*[\t ]*,"
+ "[\t ]*size_t[\t ]*\\)[\t ]*;";
+
+ test_text = "extern int write ( int , char * , size_t ) ;";
+};
/*
* There are several name conflicts with C++ reserved words in X11 header
diff --git a/fixincludes/mkfixinc.sh b/fixincludes/mkfixinc.sh
index 89e8ab7d5f2..6653fedb6eb 100755
--- a/fixincludes/mkfixinc.sh
+++ b/fixincludes/mkfixinc.sh
@@ -15,7 +15,6 @@ case $machine in
i?86-*-mingw32* | \
x86_64-*-mingw32* | \
i?86-*-interix* | \
- *-*-vxworks* | \
powerpc-*-eabisim* | \
powerpc-*-eabi* | \
powerpc-*-rtems* | \
diff --git a/fixincludes/tests/base/architecture/ppc/math.h b/fixincludes/tests/base/architecture/ppc/math.h
index dcd04236bc9..4af7808fcc2 100644
--- a/fixincludes/tests/base/architecture/ppc/math.h
+++ b/fixincludes/tests/base/architecture/ppc/math.h
@@ -7,82 +7,8 @@
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
-/* This file prototypes the long double functions available on Mac OS
- 10.3.9. */
-#ifndef __MATH__
-# undef __APPLE_CC__
-# define __APPLE_CC__ 1345
-# include_next <architecture/ppc/math.h>
-# undef __APPLE_CC__
-# define __APPLE_CC__ 1
-# ifndef __LIBMLDBL_COMPAT
-# ifdef __LONG_DOUBLE_128__
-# define __LIBMLDBL_COMPAT(sym) __asm("_" #sym "$LDBL128")
-# else
-# define __LIBMLDBL_COMPAT(sym)
-# endif /* __LONG_DOUBLE_128__ */
-# endif /* __LIBMLDBL_COMPAT */
-# ifdef __cplusplus
- extern "C" {
-# endif
- extern long double acosl( long double ) __LIBMLDBL_COMPAT(acosl);
- extern long double asinl( long double ) __LIBMLDBL_COMPAT(asinl);
- extern long double atanl( long double ) __LIBMLDBL_COMPAT(atanl);
- extern long double atan2l( long double, long double ) __LIBMLDBL_COMPAT(atan2l);
- extern long double cosl( long double ) __LIBMLDBL_COMPAT(cosl);
- extern long double sinl( long double ) __LIBMLDBL_COMPAT(sinl);
- extern long double tanl( long double ) __LIBMLDBL_COMPAT(tanl);
- extern long double acoshl( long double ) __LIBMLDBL_COMPAT(acoshl);
- extern long double asinhl( long double ) __LIBMLDBL_COMPAT(asinhl);
- extern long double atanhl( long double ) __LIBMLDBL_COMPAT(atanhl);
- extern long double coshl( long double ) __LIBMLDBL_COMPAT(coshl);
- extern long double sinhl( long double ) __LIBMLDBL_COMPAT(sinhl);
- extern long double tanhl( long double ) __LIBMLDBL_COMPAT(tanhl);
- extern long double expl( long double ) __LIBMLDBL_COMPAT(expl);
- extern long double exp2l( long double ) __LIBMLDBL_COMPAT(exp2l);
- extern long double expm1l( long double ) __LIBMLDBL_COMPAT(expm1l);
- extern long double logl( long double ) __LIBMLDBL_COMPAT(logl);
- extern long double log10l( long double ) __LIBMLDBL_COMPAT(log10l);
- extern long double log2l( long double ) __LIBMLDBL_COMPAT(log2l);
- extern long double log1pl( long double ) __LIBMLDBL_COMPAT(log1pl);
- extern long double logbl( long double ) __LIBMLDBL_COMPAT(logbl);
- extern long double modfl( long double, long double * ) __LIBMLDBL_COMPAT(modfl);
- extern long double ldexpl( long double, int ) __LIBMLDBL_COMPAT(ldexpl);
- extern long double frexpl( long double, int * ) __LIBMLDBL_COMPAT(frexpl);
- extern int ilogbl( long double ) __LIBMLDBL_COMPAT(ilogbl);
- extern long double scalbnl( long double, int ) __LIBMLDBL_COMPAT(scalbnl);
- extern long double scalblnl( long double, long int ) __LIBMLDBL_COMPAT(scalblnl);
- extern long double fabsl( long double ) __LIBMLDBL_COMPAT(fabsl);
- extern long double cbrtl( long double ) __LIBMLDBL_COMPAT(cbrtl);
- extern long double hypotl( long double, long double ) __LIBMLDBL_COMPAT(hypotl);
- extern long double powl( long double, long double ) __LIBMLDBL_COMPAT(powl);
- extern long double sqrtl( long double ) __LIBMLDBL_COMPAT(sqrtl);
- extern long double erfl( long double ) __LIBMLDBL_COMPAT(erfl);
- extern long double erfcl( long double ) __LIBMLDBL_COMPAT(erfcl);
- extern long double lgammal( long double ) __LIBMLDBL_COMPAT(lgammal);
- extern long double tgammal( long double ) __LIBMLDBL_COMPAT(tgammal);
- extern long double ceill( long double ) __LIBMLDBL_COMPAT(ceill);
- extern long double floorl( long double ) __LIBMLDBL_COMPAT(floorl);
- extern long double nearbyintl( long double ) __LIBMLDBL_COMPAT(nearbyintl);
- extern long double rintl( long double ) __LIBMLDBL_COMPAT(rintl);
- extern long int lrintl( long double ) __LIBMLDBL_COMPAT(lrintl);
- extern long long int llrintl( long double ) __LIBMLDBL_COMPAT(llrintl);
- extern long double roundl( long double ) __LIBMLDBL_COMPAT(roundl);
- extern long int lroundl( long double ) __LIBMLDBL_COMPAT(lroundl);
- extern long long int llroundl( long double ) __LIBMLDBL_COMPAT(llroundl);
- extern long double truncl( long double ) __LIBMLDBL_COMPAT(truncl);
- extern long double fmodl( long double, long double) __LIBMLDBL_COMPAT(fmodl);
- extern long double remainderl( long double, long double ) __LIBMLDBL_COMPAT(remainderl);
- extern long double remquol( long double, long double, int * ) __LIBMLDBL_COMPAT(remquol);
- extern long double copysignl( long double, long double ) __LIBMLDBL_COMPAT(copysignl);
- extern long double nanl( const char * ) __LIBMLDBL_COMPAT(nanl);
- extern long double nextafterl( long double, long double ) __LIBMLDBL_COMPAT(nextafterl);
- extern long double nexttowardl( long double, long double ) __LIBMLDBL_COMPAT(nexttowardl);
- extern long double fdiml( long double, long double ) __LIBMLDBL_COMPAT(fdiml);
- extern long double fmaxl( long double, long double ) __LIBMLDBL_COMPAT(fmaxl);
- extern long double fminl( long double, long double ) __LIBMLDBL_COMPAT(fminl);
- extern long double fmal( long double, long double, long double ) __LIBMLDBL_COMPAT(fmal);
-# ifdef __cplusplus
- }
-# endif
-#endif /* __MATH__ */
+
+
+#if defined( BROKEN_NAN_CHECK )
+#if 1
+#endif /* BROKEN_NAN_CHECK */
diff --git a/fixincludes/tests/base/ioLib.h b/fixincludes/tests/base/ioLib.h
new file mode 100644
index 00000000000..d570c895d57
--- /dev/null
+++ b/fixincludes/tests/base/ioLib.h
@@ -0,0 +1,19 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "fixinc/tests/inc/ioLib.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+
+
+#if defined( VXWORKS_IOCTL_MACRO_CHECK )
+extern int ioctl ( int asdf1234, int jkl , int qwerty ) ;
+#endif /* VXWORKS_IOCTL_MACRO_CHECK */
+
+
+#if defined( VXWORKS_WRITE_CONST_CHECK )
+extern int write (int, const char*, size_t);
+#endif /* VXWORKS_WRITE_CONST_CHECK */
diff --git a/fixincludes/tests/base/math.h b/fixincludes/tests/base/math.h
index a97e88b32c8..766017280b5 100644
--- a/fixincludes/tests/base/math.h
+++ b/fixincludes/tests/base/math.h
@@ -15,11 +15,6 @@
#endif
-#if defined( AAB_DARWIN7_9_LONG_DOUBLE_FUNCS_2_CHECK )
-#include <architecture/ppc/math.h>
-#endif /* AAB_DARWIN7_9_LONG_DOUBLE_FUNCS_2_CHECK */
-
-
#if defined( BROKEN_CABS_CHECK )
#ifdef __STDC__
@@ -30,6 +25,11 @@
#endif /* BROKEN_CABS_CHECK */
+#if defined( DARWIN_9_LONG_DOUBLE_FUNCS_2_CHECK )
+#include <architecture/ppc/math.h>
+#endif /* DARWIN_9_LONG_DOUBLE_FUNCS_2_CHECK */
+
+
#if defined( HPPA_HPUX_FP_MACROS_CHECK )
#endif /* _INCLUDE_HPUX_SOURCE */
diff --git a/fixincludes/tests/base/sys/stat.h b/fixincludes/tests/base/sys/stat.h
index 240c308fdbc..9c81cff94bd 100644
--- a/fixincludes/tests/base/sys/stat.h
+++ b/fixincludes/tests/base/sys/stat.h
@@ -28,6 +28,13 @@ extern int fchmod(int, mode_t);
#endif /* RS6000_FCHMOD_CHECK */
+#if defined( VXWORKS_MKDIR_MACRO_CHECK )
+extern STATUS mkdir (const char * _qwerty) ;
+#define mkdir(dir, ...) ((void)0, ##__VA_ARGS__, (mkdir)(dir))
+
+#endif /* VXWORKS_MKDIR_MACRO_CHECK */
+
+
#if defined( VXWORKS_NEEDS_VXWORKS_CHECK )
#include </dev/null> /* ULONG */
# define __INCstath <sys/stat.h>
diff --git a/fixincludes/tests/base/testing.h b/fixincludes/tests/base/testing.h
index f1ffeffa41a..cf95321fb86 100644
--- a/fixincludes/tests/base/testing.h
+++ b/fixincludes/tests/base/testing.h
@@ -114,3 +114,9 @@ extern size_t
#endif
#endif /* VMS_USE_PRAGMA_EXTERN_MODEL_CHECK */
+
+
+#if defined( VXWORKS_REGS_CHECK )
+#include <arch/../regs.h>
+
+#endif /* VXWORKS_REGS_CHECK */
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 998be31a421..462fe341523 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,738 @@
+2012-10-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/19105
+ PR tree-optimization/21643
+ PR tree-optimization/46309
+ * tree-ssa-reassoc.c (init_range_entry): Add STMT argument
+ and use it if EXP is NULL.
+ (update_range_test): Handle OPCODE equal to ERROR_MARK
+ and oe->op NULL.
+ (optimize_range_tests): Likewise.
+ (final_range_test_p, suitable_cond_bb, no_side_effect_bb, get_ops,
+ maybe_optimize_range_tests): New functions.
+ (reassociate_bb): Call maybe_optimize_range_tests if last
+ stmt of bb is GIMPLE_COND that hasn't been visited yet.
+
+2012-10-31 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * config/rs6000/rs6000.md (insvsi, insvdi, extvsi, extvdi): Rename to...
+ (insvsi_internal, insvdi_internal, extvsi_internal)
+ (extvdi_internal): ...this.
+ (insv, extv): Update accordingly.
+
+2012-10-31 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * combine.c (simplify_comparison): If BITS_BIG_ENDIAN, always assume
+ that zero_extracts of const_ints are doing word-sized extractions.
+
+2012-10-31 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * combine.c (make_extraction): Remove dead wanted_inner_mode-
+ and pos_rtx-related code.
+
+2012-10-31 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * expmed.c (store_bit_field_1): Move generation of MEM insvs
+ to the MEM_P block.
+ (extract_bit_field_1): Likewise extvs and extzvs.
+
+2012-10-31 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * expmed.c (store_bit_field_using_insv): New function,
+ split out from...
+ (store_bit_field_1): ...here.
+ (extract_bit_field_using_extv): New function, split out from...
+ (extract_bit_field_1): ...here.
+
+2012-10-31 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * expmed.c (store_bit_field_1): Use OP_MODE to check whether an
+ insv pattern is available. Remove redundant checks for OP_MODE
+ being MAX_MACHINE_MODE.
+ (extract_bit_field_1): Remove redundant checks for EXT_MODE being
+ MAX_MACHINE_MODE.
+
+2012-10-31 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * expmed.c (store_bit_field_1): Remove test for BLKmode values.
+
+2012-10-31 Ralf Corsépius <ralf.corsepius@rtems.org>,
+ Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * config/sparc/t-rtems: New (Custom multilibs).
+ * config/sparc/t-rtems-64: New (Custom multilibs).
+ * config.gcc (sparc64-*-rtems*): Add sparc/t-rtems-64.
+ (sparc-*-rtems*): Add sparc/t-rtems.
+
+2012-10-31 Alan Modra <amodra@gmail.com>
+
+ * config/rs6000/rs6000.c (legitimize_reload_address): Remove code
+ handling non-aligned ld/std.
+ * config/rs6000/paired.md (movv2sf_paired): Use 'Y' instead of 'o'.
+ * config/rs6000/vsx.md (vsx_mov, vsx_movti): Likewise.
+ * config/rs6000/altivec.md (altivec_mov, altivec_movti): Likewise.
+ * config/rs6000/dfp.md (movtd_internal): Use 'm' instead of 'o'.
+
+2012-10-31 Alan Modra <amodra@gmail.com>
+
+ * config/rs6000/linux64.h (TARGET_OS_CPP_BUILTINS): Define _CALL_LINUX.
+
+2012-10-31 Joern Rennecke <joern.rennecke@embecosm.com>
+
+ * lra-constraints.c (choose_split_class): Add ATTRIBUTE_UNUSED to
+ hard_reg_class.
+
+ PR target/52498
+ * vmsdbgout.c (vmsdbgout_write_source_line): Comment out names of
+ last two parameters.
+
+2012-10-30 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/54551
+ PR debug/54693
+ * valtrack.c (dead_debug_promote_uses): Assert-check that
+ global used bit was clear and initialize entry
+ unconditionally.
+
+2012-10-30 Eric Botcazou <ebotcazou@adacore.com>
+
+ * cse.c (hash_rtx_cb): Replace RTX_UNCHANGING_P with MEM_READONLY_P in
+ head comment.
+ (hash_rtx): Likewise.
+
+2012-10-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR rtl-optimization/55093
+ * rtlanal.c (simplify_subreg_regno): Remove lra_in_progress
+ check for ARG_POINTER_REGNUM.
+
+2012-10-30 Steve Ellcey <sellcey@mips.com>
+
+ * config/mips/mti-linux.h (SYSROOT_SUFFIX_SPEC): Change order
+ and add mabi=64.
+ (DRIVER_SELF_SPECS): Make -n32 the default on mips64* archs.
+ * config/mips/t-mti-linux (MULTILIB_OPTIONS): Change order.
+ (MULTILIB_DIRNAMES): Ditto.
+ (MULTILIB_EXCEPTIONS): New.
+
+2012-10-30 Joern Rennecke <joern.rennecke@embecosm.com>
+
+ * lra-constraints.c (check_secondary_memory_needed_p):
+ Add ATTRIBUTE_UNUSED to parameters.
+
+2012-10-30 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * defaults.h (SLOW_UNALIGNED_ACCESS): Provide default definition.
+ * expmed.c (SLOW_UNALIGNED_ACCESS): Remove default definition.
+ * expr.c (SLOW_UNALIGNED_ACCESS): Likewise.
+ * lra-constraints.c (SLOW_UNALIGNED_ACCESS): Likewise.
+ (simplify_operand_subreg): Don't check STRICT_ALIGNMENT here.
+
+2012-10-30 Jan Hubicka <jh@suse.cz>
+
+ * ipa-inline-analysis.c (eliminated_by_inlining_prob): Cleanup.
+
+2012-10-30 Jan Hubicka <jh@suse.cz>
+
+ * tree-ssa-loop-niter.c (number_of_iterations_exit): New parameter
+ EVERY_ITERATION with implicit value of true.
+ (record_estimate): Check dominance relationship of the basic block
+ we are estimating on instead of relying on UPPER to be false.
+ (struct ilb_data): Drop RELIABLE.
+ (idx_infer_loop_bounds): Update.
+ (infer_loop_bounds_from_ref): Drop parameter RELIABLE.
+ (infer_loop_bounds_from_array): Drop parameter RELIABLE.
+ (infer_loop_bounds_from_undefined): Update comments and handling
+ of RELIABLE.
+ (estimate_numbers_of_iterations_loop): Record all bounds.
+
+2012-10-30 Richard Sandiford <r.sandiford@uk.ibm.com>
+
+ * lra-eliminations.c (lra_eliminate_regs_1): Use simplify_gen_subreg
+ rather than gen_rtx_SUBREG.
+
+2012-10-30 Richard Biener <rguenther@suse.de>
+
+ * gimple.h (gimple_store_p): New predicate.
+ (gimple_assign_load_p): Likewise.
+ * tree-inline.c (estimate_num_insns): Use it.
+
+2012-10-30 Marc Glisse <marc.glisse@inria.fr>
+
+ * fold-const.c (fold_binary_op_with_conditional_arg): Handle vectors.
+ (fold_binary_loc): call it for VEC_COND_EXPR.
+
+2012-10-30 James Greenhalgh <james.greenhalgh@arm.com>
+ Tejas Belagod <tejas.belagod@arm.com>
+
+ * config/aarch64/aarch64-simd.md
+ (aarch64_simd_bsl<mode>_internal): New pattern.
+ (aarch64_simd_bsl<mode>): Likewise.
+ (aarch64_vcond_internal<mode>): Likewise.
+ (vcondu<mode><mode>): Likewise.
+ (vcond<mode><mode>): Likewise.
+ * config/aarch64/iterators.md (UNSPEC_BSL): Add to define_constants.
+
+2012-10-30 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/55111
+ * tree-ssa-pre.c (eliminate_insert): Properly fold the built
+ stmt.
+
+2012-10-30 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/54963
+ * config/sh/iterators.md (SIDI): New mode iterator.
+ * config/sh/sh.md (negdi2): Use parallel around operation and T_REG
+ clobber in expander.
+ (*negdi2): Mark output operand as early clobbered. Add T_REG clobber.
+ Split after reload. Simplify split code.
+ (abssi2, absdi2): Fold expanders into abs<mode>2.
+ (*abssi2, *absdi2): Fold into *abs<mode>2 insn_and_split. Split insns
+ before reload.
+ (*negabssi2, *negabsdi2): Fold into *negabs<mode>2. Add T_REG clobber.
+ Split insns before reload.
+ (negsi_cond): Reformat. Use emit_move_insn instead of
+ gen_movesi.
+ (negdi_cond): Reformat. Use emit_move_insn instead of a pair
+ of gen_movsi. Split insn before reload.
+
+2012-10-30 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/54988
+ * config/sh/sh.md (tstqi_t_zero): Rename to *tstqi_t_zero.
+ (*tst<mode>_t_zero): New insns.
+ * config/sh/iterators.md (lowpart_be, lowpart_le): New mode attributes.
+
+2012-10-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ * gimple-pretty-print.c (dump_gimple_bb_header): Avoid alloca.
+
+2012-10-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/54953
+ * valtrack.h (DEBUG_TEMP_AFTER_WITH_REG_FORCE): New.
+ * valtrack.c (dead_debug_insert_temp): Use emit_debug_insn_after
+ even for where == DEBUG_TEMP_AFTER_WITH_REG_FORCE.
+ * dce.c (word_dce_process_block, dce_process_block): Pass
+ DEBUG_TEMP_AFTER_WITH_REG_FORCE if insn is needed and therefore
+ not going to be eliminated.
+
+2012-10-29 Lawrence Crowl <crowl@google.com>
+
+ * sbitmap.h (sbitmap_copy): Rename bitmap_copy.
+ (sbitmap_copy_n): Rename bitmap_copy_n.
+ (sbitmap_equal): Rename bitmap_equal_p.
+ (sbitmap_empty_p): Rename bitmap_empty_p.
+ (sbitmap_range_empty_p): Rename bitmap_range_empty_p.
+ (sbitmap_zero): Rename bitmap_clear.
+ (sbitmap_ones): Rename bitmap_ones.
+ (sbitmap_vector_zero): Rename bitmap_vector_clear.
+ (sbitmap_vector_ones): Rename bitmap_vector_ones.
+ (sbitmap_not): Rename bitmap_not.
+ (sbitmap_a_and_b_cg): Commented out.
+ (sbitmap_a_and_b): Rename bitmap_and. Add bool return.
+ (sbitmap_difference): Rename bitmap_and_compl.
+ (sbitmap_a_or_b_cg): Commented out.
+ (sbitmap_a_or_b): Rename bitmap_xor. Add bool return.
+ (sbitmap_a_xor_b_cg): Commented out.
+ (sbitmap_a_xor_b): Rename bitmap_xor. Add bool return.
+ (sbitmap_a_and_b_or_c_cg): Rename bitmap_and_or.
+ (sbitmap_a_and_b_or_c): Commented out.
+ (sbitmap_a_or_b_and_c_cg): Rename bitmap_or_and.
+ (sbitmap_a_or_b_and_c): Commented out.
+ (sbitmap_union_of_diff_cg): Rename bitmap_ior_and_compl.
+ (sbitmap_union_of_diff): Commented out.
+ (dump_sbitmap): Rename dump_bitmap.
+ (dump_sbitmap_file): Rename dump_bitmap_file.
+ (debug_sbitmap): Rename debug_bitmap.
+ (dump_sbitmap_vector): Rename dump_bitmap_vector.
+ (sbitmap_first_set_bit): Rename bitmap_first_set_bit.
+ (sbitmap_last_set_bit): Rename bitmap_last_set_bit.
+ (sbitmap_a_subset_b_p): Rename bitmap_subset_p.
+ (sbitmap_any_common_bits): Rename bitmap_intersect_p.
+ (#define sbitmap_free): Reimplement as inline function.
+ (#define sbitmap_vector_free): Reimplement as inline function.
+ * bitmap.h (#define bitmap_zero): Remove as redundant.
+ (#define bitmap_empty_p): Reimplement as inline function.
+ (#define dump_bitmap): Reimplement as inline function.
+
+2012-10-29 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ PR c++/54930
+ * doc/invoke.texi (Warning Options): Document -Wno-return-local-addr.
+
+2012-10-29 H.J. Lu <hongjiu.lu@intel.com>
+
+ * lra-assigns.c: Remove trailing white spaces.
+ * lra-coalesce.c: Likewise.
+ * lra-constraints.c: Likewise.
+ * lra-eliminations.c: Likewise.
+ * lra-int.h: Likewise.
+ * lra-spills.c: Likewise.
+ * lra.c: Likewise.
+
+2012-10-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ PR c/53066
+ * tree.h (FUNCTION_POINTER_TYPE_P): New.
+
+2012-10-29 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/54693
+ * valtrack.c (dead_debug_insert_temp): Defer rescan of
+ newly-emitted debug insn.
+
+2012-10-29 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/54693
+ * tree-ssa-threadedge.c (thread_around_empty_block): Copy
+ debug temps from predecessor before threading.
+
+2012-10-29 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/54551
+ PR debug/54693
+ * valtrack.c (dead_debug_global_find): Accept NULL dtemp.
+ (dead_debug_global_insert): Return new entry.
+ (dead_debug_global_replace_temp): Return early if REG is no
+ longer in place, or if dtemp was already substituted.
+ (dead_debug_promote_uses): Insert for all defs and replace all
+ debug uses at once.
+ (dead_debug_local_finish): Release used after promotion.
+ (dead_debug_insert_temp): Stop if dtemp is NULL.
+
+2012-10-29 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/54693
+ * loop-unroll.c (loop_exit_at_end_p): Skip debug insns.
+
+2012-10-29 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/54693
+ * config/i386/i386.c (add_parameter_dependencies): Stop
+ backward scan at the insn before the incoming head.
+ (ix86_dependencies_evaluation_hook): Skip debug insns. Stop
+ if first_arg is head.
+
+2012-10-29 Andrew Pinski <apinski@cavium.com>
+
+ * config/aarch64/aarch64-protos.h (aarch64_load_tp): New proto.
+ * config/aarch64/aarch64.c (aarch64_load_tp): Export.
+ (aarch64_init_builtins): Don't add __builtin_thread_pointer builtin.
+ * config/aarch64/aarch64.h (aarch64_builtins): Delete
+
+AARCH64_BUILTIN_THREAD_POINTER.
+ * config/aarch64/aarch64.md (get_thread_pointerdi): New pattern.
+
+2012-10-29 Marc Glisse <marc.glisse@inria.fr>
+
+ PR middle-end/55027
+ * tree.c (real_zerop, real_onep, real_twop, real_minus_onep):
+ Handle VECTOR_CST.
+
+2012-10-29 Vladimir Makarov <vmakarov@redhat.com>
+
+ * rtlanal.c (strip_address_mutation): Use SUBREG_REG instead of
+ XEXP.
+
+2012-10-29 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.c (ix86_decompose_address): Use simplify_gen_subreg
+ for all addresses, zero-extended with AND.
+
+2012-10-29 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR middle-end/55116
+ * rtlanal.c (strip_address_mutation): Add SUBREG case.
+
+2012-10-29 Jan Hubicka <jh@suse.cz>
+
+ * ipa-inline.c (want_inline_function_called_once_p): Rename to ...
+ (want_inline_function_to_all_callers_p): check also functions with
+ multiple callers.
+ (ipa_inline): Handle inlining for size into multiple callers.
+
+2012-10-29 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/53695
+ * tracer.c (tracer): Fixup loop structure.
+ * cfgloopmanip.c (force_single_succ_latches): Add assert.
+ (fix_loop_structure): Re-compute loop latches and disambiguate
+ loops with multiple latches if required.
+
+2012-10-29 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.c (ix86_decompose_address): Use simplify_gen_subreg
+ to check SImode equivalent of address, zero-extended with AND RTX.
+ * config/i386/i386.md (ashift to lea splitter): Split to SImode mult.
+ (simple lea to add/shift peephole2s): Remove peephole2s that operate
+ on subregs of DImode operations.
+
+2012-10-28 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR rtl-optimization/55106
+ * lra-constraints.c (skip_usage_debug_insns): New function.
+ (check_secondary_memory_needed_p): Ditto.
+ (inherit_reload_reg): Use the new functions. Improve debug output.
+
+2012-10-29 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * doc/cpp.texi (Search Path): Fix outdated C++ path.
+
+2012-10-28 Jan Hubicka <jh@suse.cz>
+
+ * ipa-inline-analysis.c (eliminated_by_inlining_prob): Handle
+ &this->field expressions.
+
+2012-10-28 Vladimir Makarov <vmakarov@redhat.com>
+
+ * rtl.h (struct rtx_def): Add a comment for member unchanging.
+ * lra-int.h (LRA_TEMP_CLOBBER_P): New macro.
+ (lra_hard_reg_substitution): Rename to lra_final_code_change.
+ * lra-constraints.c (match_reload): Mark temporary clobbers.
+ * lra-spill.c (lra_hard_reg_substitution): Rename to
+ lra_final_code_change. Remove temporary clobbers.
+ * lra.c (lra): Rename to lra_final_code_change.
+
+2012-10-28 Jan Hubicka <jh@suse.cz>
+
+ * ipa-inline.c (edge_badness): Fix overflow.
+ (inline_small_functions): Initialize SCCs correctly.
+ (do_estimate_edge_time, do_estimate_edge_hints): Skip self
+ recursive functions in SCC hints.
+
+2012-10-28 Steven Bosscher <steven@gcc.gnu.org>
+
+ PR rtl-optimization/38711
+ * ira.c (ira): Remove DF_LIVE if the problem is in the stack.
+ (do_reload): Add it back at the end for -O2 and higher.
+
+ * function.c (thread_prologue_and_epilogue_insns): Use
+ REG_SET_TO_HARD_REG_SET instead of CLEAR_HARD_REG_SET and
+ reg_set_to_hard_reg_set.
+
+2012-10-28 Jan Hubicka <jh@suse.cz>
+
+ * ipa-inline.c (edge_badness): Reduce precision; use scc hints.
+ (inline_small_functions): Fix dumps; update all callees after inlining.
+ * ipa-inline.h (INLINE_HINT_in_scc, INLINE_HINT_same_scc): New
+ constants.
+ (inline summary): Add SCC_NO.
+ * ipa-inline-analysis.c (dump_inline_hints): Dump SCC hints.
+ (reset_inline_summary): Reset scc_no.
+ (estimate_node_size_and_time): Set in_scc hint.
+ (do_estimate_edge_time): Add same_scc hint.
+ (do_estimate_edge_hints): Likewise.
+
+2012-10-28 Andreas Schwab <schwab@linux-m68k.org>
+
+ * doc/cppopts.texi: Fix use of @item vs. @itemx inside @table.
+ * doc/extend.texi: Likewise.
+ * doc/generic.texi: Likewise.
+ * doc/invoke.texi: Likewise.
+ * doc/md.texi: Likewise.
+ * doc/sourcebuild.texi: Likewise.
+
+ * doc/tm.texi.in (Misc): Add newline before @end.
+ * doc/tm.texi: Update.
+
+2012-10-27 Joern Rennecke <joern.rennecke@embecosm.com>
+
+ * lra-assigns.c (find_hard_regno_for): Fix use of WORDS_BIG_ENDIAN.
+
+2012-10-27 Georg-Johann Lay <avr@gjlay.de>
+
+ PR target/55034
+ * config/avr/avr.c (avr_out_lpm): Remove unused regno_dest.
+
+2012-10-27 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/55042
+ * config/sh/sh.c (sh1_builtin_p): Comment out unused function.
+
+2012-10-27 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (*lea<mode>): Remove unneeded temporary.
+
+2012-10-26 David S. Miller <davem@davemloft.net>
+
+ * config/sparc/constraints.md: Update unused letter list, move
+ "w" near other memory constraints. Remove no longer relevant
+ comment.
+ * doc/md.texi: Sync sparc constraint documentation with reality.
+
+2012-10-26 DJ Delorie <dj@redhat.com>
+
+ * config/rl78/rl78.c (rl78_as_legitimate_address): Do not allow
+ reg+addend addresses for the _far namespace.
+
+2012-10-26 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * config/rs6000/sync.md (ATOMIC): Correct DI condition.
+
+2012-10-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/54970
+ * cfgexpand.c (expand_debug_expr): Expand &MEM_REF[&var, n]
+ as DEBUG_IMPLICIT_PTR + n if &var expands to DEBUG_IMPLICIT_PTR.
+ * tree-sra.c (create_access_replacement): Allow also MEM_REFs
+ with ADDR_EXPR first operand in DECL_DEBUG_EXPR expressions.
+ * var-tracking.c (track_expr_p): Handle MEM_REFs in DECL_DEBUG_EXPR
+ expressions.
+ * dwarf2out.c (add_var_loc_to_decl): Likewise.
+
+2012-10-26 Jeff Law <law@redhat.com>
+
+ * tree-ssa-threadedge.c (cond_arg_set_in_bb): Use last stmt.
+
+2012-10-26 Gunther Nikl <gnikl@users.sourceforge.net>
+
+ * common/config/m68k/m68k-common.c (m68k_handle_option): Set
+ gcc_options fields of opts_set for -m68020-40 and -m68020-60.
+
+2012-10-26 Teresa Johnson <tejohnson@google.com>
+
+ * ree.c (add_removable_extension): Remove unnecessary
+ mode check with other extension.
+ * testsuite/gcc.c-torture/execute/20111227-2.c: New test.
+ * testsuite/gcc.c-torture/execute/20111227-3.c: Ditto.
+
+2012-10-26 Jan Hubicka <jh@suse.cz>
+
+ * ipa-inline-transform.c (inline_call): Only account size changes
+ for !DECL_EXTERNAL.
+
+2012-10-26 Martin Jambor <mjambor@suse.cz>
+
+ PR debug/54971
+ * tree-sra.c (struct access): New flag grp_to_be_debug_replaced.
+ (dump_access): Dump the new flag.
+ (analyze_access_subtree): Set the new flag when appropriate.
+ (create_access_replacement): Handle debug replacements differently.
+ (generate_subtree_copies): Handle the grp_to_be_debug_replaced flag.
+ (init_subtree_with_zero): Likewise.
+ (sra_modify_expr): Likewise.
+ (load_assign_lhs_subreplacements): Likewise.
+ (sra_modify_assign): Likewise.
+
+2012-10-23 Yuri Rumyantsev <ysrumyan@gmail.com>
+
+ * config/i386/i386.c (insn_is_function_arg) : Add check on CALL
+ instruction.
+ (ix86_dependencies_evaluation_hook): Insert dependencies in all
+ predecessors of call block for non-trivial region avoiding creation
+ of loop-carried dependency to avoid cross-block motion of HW registers.
+
+2012-10-26 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/54824
+ * tree-optimize.c (execute_fixup_cfg): Insert __builtin_unreachable
+ at the end of blocks with no successors.
+
+2012-10-26 Alexander Ivchenko <alexander.ivchenko@intel.com>
+ Uros Bizjak <ubizjak@gmail.com>
+
+ * common/config/i386/i386-common.c
+ (OPTION_MASK_ISA_FXSR_SET): New.
+ (OPTION_MASK_ISA_XSAVE_SET): Likewise.
+ (OPTION_MASK_ISA_XSAVEOPT_SET): Likewise.
+ (ix86_handle_option): Handle mfxsr, mxsave, mxsaveopt options.
+ * config.gcc (i[34567]86-*-*): Add fxsrintrin.h,
+ xsaveintrin.h, xsaveoptintrin.h.
+ (x86_64-*-*): Likewise.
+ * config/i386/fxsrintrin.h: New header.
+ * config/i386/xsaveintrin.h: Likewise.
+ * config/i386/xsaveoptintrin.h: Likewise.
+ * config/i386/driver-i386.c (host_detect_local_cpu): Detect
+ FXSR/XSAVE/XSAVEOPT support.
+ * config/i386/i386-builtin-types.def
+ (VOID_FTYPE_PVOID_INT64): New function type.
+ * config/i386/i386-c.c: Define __FXSR__, __XSAVE__
+ and __XSAVEOPT__ if needed.
+ * config/i386/i386.c (ix86_target_string): Define -mfxsr,
+ -mxsave and -mxsaveopt options.
+ (PTA_FXSR): New.
+ (PTA_XSAVE): Likewise.
+ (PTA_XSAVEOPT): Likewise.
+ (ix86_option_override_internal): Handle new option.
+ (processor_alias_table): Added PTA_FXSR, PTA_XSAVE, PTA_XSAVEOPT.
+ (ix86_valid_target_attribute_inner_p): Add OPT_mfxsr,
+ OPT_mxsave, OPT_mxsaveopt.
+ (ix86_builtins): Add IX86_BUILTIN_FXSAVE, IX86_BUILTIN_FXRSTOR,
+ IX86_BUILTIN_FXSAVE64, IX86_BUILTIN_XSAVE, IX86_BUILTIN_XSAVE64,
+ IX86_BUILTIN_XRSTOR, IX86_BUILTIN_XRSTOR64, IX86_BUILTIN_XSAVEOPT,
+ IX86_BUILTIN_XSAVEOPT64.
+ (ix86_expand_builtin): Handle these built-ins.
+ * config/i386/i386.h (TARGET_FXSR): New.
+ (TARGET_XSAVE): Likewise.
+ (TARGET_XSAVEOPT): Likewise.
+ * config/i386/i386.md (ANY_XSAVE): New int iterator.
+ (ANY_XSAVE64): Likewise.
+ (xsave): New int attribute.
+ (fxsave): New instruction.
+ (fxsave64): Likewise.
+ (fxrstor): Likewise.
+ (fxrstor64): Likewise.
+ (<xsave>): Likewise.
+ (<xsave>_rex64): Likewise.
+ (xrstor): Likewise.
+ (xrstor_rex64): Likewise.
+ (xrstor64): Likewise.
+ * config/i386/i386.opt (mfxsr): New.
+ (mxsave): Likewise.
+ (mxsaveopt): Likewise.
+ * config/i386/x86intrin.h: Include
+ xsaveintrin.h, fxsrintrin.h, xsaveoptintrin.h.
+
+2012-10-26 Ralf Corsépius <ralf.corsepius@rtems.org>
+
+ * config/avr/t-rtems: Revert previous commit.
+
+2012-10-26 Richard Sandiford <rdsandiford@googlemail.com>
+
+ PR bootstrap/55049
+ * Makefile.in (rtlanal.o): Add dependency on addresses.h.
+ * rtl.h (address_info): New structure.
+ (strip_address_mutations, decompose_address, decompose_lea_address)
+ (decompose_mem_address, update_address, get_index_scale)
+ (get_index_code): Declare.
+ * rtlanal.c: Include addresses.h.
+ (strip_address_mutations, must_be_base_p, must_be_index_p)
+ (set_address_segment, set_address_base, set_address_index)
+ (set_address_disp, decompose_incdec_address, decompose_automod_address)
+ (extract_plus_operands, baseness, decompose_normal_address)
+ (decompose_address, decompose_lea_address, decompose_mem_address)
+ (update_address, get_index_scale, get_index_code): New functions.
+ * lra-constraints.c (strip_subreg): New function.
+ (address, extract_loc_address_regs, extract_address_regs)
+ (get_index_scale): Delete.
+ (process_addr_reg): Apply strip_subreg to the location.
+ (uses_hard_regs_p): Use decompose_mem_address.
+ (valid_address_p, base_plus_disp_to_reg, can_add_disp_p)
+ (equiv_address_substitution): Take an address_info rather
+ than an address. Remove other arguments. Avoid using Pmode.
+ (process_address): Use decompose_mem_address and decompose_lea_address.
+ Update calls to above functions.
+
+2012-10-26 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * lra-constraints.c (process_address): Tighten arguments to
+ base_reg_class. Use simplify_gen_binary to generate PLUS rtxes.
+
+2012-10-26 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * lra-constraints.c (get_index_scale, can_add_disp_p): New functions.
+ (equiv_address_substitution): Use them.
+
+2012-10-26 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * lra-constraints.c (valid_address_p): New function, split out from...
+ (process_address): ...here.
+
+2012-10-26 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * lra-constraints.c (process_address): Describe the kinds of address
+ that we might see.
+
+2012-10-25 Vladimir Makarov <vmakarov@redhat.com>
+
+ * lra-int.h (lra_assert): Redefine it gcc_checking_assert.
+ * lra-constraints.c (check_and_process_move): Remove #if
+ ENABLE_ASSERT_CHECKING.
+
+2012-10-26 Ralf Corsépius <ralf.corsepius@rtems.org>
+
+ * config/avr/rtems.h (TARGET_OS_CPP_BUILTINS): Remove
+ __USE_INIT_FINI__.
+ * config/avr/t-rtems (LIB1ASMFUNCS): Filter out _exit.
+
+2012-10-25 David S. Miller <davem@davemloft.net>
+
+ * config/sparc/constraints.md ("U"): Delete.
+ * config/sparc/sparc.md: Use 'r' constraint instead of 'U'.
+ * config/sparc/sync.md: Likewise.
+
+2012-10-25 Lawrence Crowl <crowl@google.com>
+
+ * hash-table.h: Add usage documentation.
+ (template struct typed_free_remove): Clarify documentation.
+ Rename template parameter.
+ (struct typed_noop_remove): Likewise.
+ (descriptor concept): Change typedef T to value_type.
+ Add typedef compare_type. Use more precise template parameter name,
+ Descriptor instead of Descr. Update users to match.
+ (struct hash_table): Change 'find' parameters to use compare_type
+ instead of the value type.
+
+2012-10-25 Jan Hubicka <jh@suse.cz>
+
+ * ipa-cp.c (ipcp_discover_new_direct_edges): If something was turned
+ to direct call update the summary.
+ * ipa-inline-transform.c (inline_call): Sanity check that summaries
+ match the predicted effect; fix updating of summary after edge
+ redirection.
+ * ipa-inline-analysis.c (inline_node_duplication_hook): Do not try
+ to update the summary and recompute it instead.
+ (estimate_function_body_sizes): Fix self size estimation; double
+ check that it agrees with inline_update_overall_summary.
+ (estimate_edge_size_and_time): Handle devirtualizaiton costs.
+ (estimate_edge_devirt_benefit): Update to be called from
+ estimate_edge_size_and_time.
+ (estimate_calls_size_and_time): Update.
+ (estimate_node_size_and_time): Watch overflows.
+ (inline_merge_summary): Likewise.
+ * ipa-prob.c: Include ipa-inline.h
+ (ipa_make_edge_direct_to_target): After redirection update the summary.
+
+2012-10-25 Cary Coutant <ccoutant@google.com>
+
+ PR debug/55063
+ * dwarf2out.c (prune_unused_types_prune): Check whether DIE is
+ already a declaration.
+
+2012-10-25 Vladimir Makarov <vmakarov@redhat.com>
+
+ * 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>
+
+ * config.gcc (microblaze*-*-rtems*): New target.
+ * config/microblaze/rtems.h: New.
+ * config/microblaze/t-rtems: New.
+
+2012-10-25 Jan Hubicka <jh@suse.cz>
+
+ PR tree-optimize/54980
+ * tree-ssa-loop-ivcanon.c (constant_after_peeling): Fix obvious typo.
+ (loop_edge_to_cancel): Be sure that the edge is from an conditional
+ so we can cancel it.
+
+2012-10-25 Marc Glisse <marc.glisse@inria.fr>
+
+ PR c++/54427
+ * tree.c (signed_or_unsigned_type_for): Handle vectors.
+
+2012-10-25 Jan Hubicka <jh@suse.cz>
+
+ * ipa-inline.c (recursive_inlining): Redirect to master
+ clone before testing profitability.
+
+2012-10-25 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/54902
+ * tree-ssa-pre.c (fini_eliminate): Return TODO.
+ (do_pre): Adjust.
+ (execute_fre): Likewise.
+ * tree-ssa-tailmerge.c (tail_merge_optimize): Delete unreachable
+ blocks before computing dominators.
+
+2012-10-25 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * expr.c (emit_block_move_via_loop): Use simplify_gen_binary
+ rather than gen_rtx_PLUS.
+
2012-10-24 Vladimir Makarov <vmakarov@redhat.com>
PR bootstrap/55068
@@ -84,8 +819,7 @@
2012-10-23 David S. Miller <davem@davemloft.net>
* config/sparc/constraints.md ("T", "W"): Change
- definitions to use define_memory_constraint. Do not match
- 'reg'.
+ definitions to use define_memory_constraint. Do not match 'reg'.
* config/sparc/sparc.c (memory_ok_for_ldd): Remove all non-MEM
handling code, update comment.
@@ -198,7 +932,7 @@
Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
Richard Earnshaw <rearnsha@arm.com>
Sofiane Naci <sofiane.naci@arm.com>
- Stephen Thomas <stephen,thomas@arm.com>
+ Stephen Thomas <stephen.thomas@arm.com>
Tejas Belagod <tejas.belagod@arm.com>
Yufeng Zhang <yufeng.zhang@arm.com>
@@ -252,9 +986,8 @@
* tree-ssa-operands.h (struct def_optype_d, def_optype_p): Remove.
(ssa_operands.free_defs): Remove.
(DEF_OP_PTR, DEF_OP): Remove.
- (struct ssa_operand_iterator_d): Remove 'defs', add 'flags'
- members, rename 'phi_stmt' to 'stmt', 'phi_i' to 'i' and 'num_phi'
- to 'numops'.
+ (struct ssa_operand_iterator_d): Remove 'defs', add 'flags' members,
+ rename 'phi_stmt' to 'stmt', 'phi_i' to 'i' and 'num_phi' to 'numops'.
* gimple.h (gimple_statement_with_ops.def_ops): Remove.
(gimple_def_ops, gimple_set_def_ops): Remove.
(gimple_vdef_op): Don't take const gimple, adjust.
@@ -287,13 +1020,11 @@
2012-10-23 Greta Yorsh <Greta.Yorsh@arm.com>
- * config/arm/arm.c (offset_ok_for_ldrd_strd): Return false for
- Thumb1.
+ * config/arm/arm.c (offset_ok_for_ldrd_strd): Return false for Thumb1.
2012-10-23 Vladimir Makarov <vmakarov@redhat.com>
- * dbxout.c (dbxout_symbol_location): Pass new argument to
- alter_subreg.
+ * dbxout.c (dbxout_symbol_location): Pass new argument to alter_subreg.
* dwarf2out.c: Include ira.h and lra.h.
(based_loc_descr, compute_frame_pointer_to_fb_displacement): Use
lra_eliminate_regs for LRA instead of eliminate_regs.
@@ -301,8 +1032,7 @@
emit_move_via_integer. Use emit_move_via_integer for LRA only if
the insn is recognized.
* emit-rtl.c (gen_rtx_REG): Add lra_in_progress.
- (validate_subreg): Don't check offset for LRA and floating point
- modes.
+ (validate_subreg): Don't check offset for LRA and floating point modes.
* final.c (final_scan_insn, cleanup_subreg_operands): Pass new
argument to alter_subreg.
(walk_alter_subreg, output_operand): Ditto.
@@ -338,7 +1068,7 @@
and ira_reg_equiv_const. Call ira_setup_eliminable_regset with a
new argument. Don't flatten IRA IRA for LRA. Don't reassign
conflict allocnos for LRA. Call finish_reg_equiv.
- (do_reload): Prepare code for LRA call. Call LRA.
+ (do_reload): Prepare code for LRA call. Call LRA.
* ira.h (ira_use_lra_p): New external.
(struct target_ira): Add members x_ira_class_subset_p
x_ira_reg_class_subset, and x_ira_reg_classes_intersect_p.
@@ -355,8 +1085,7 @@
(generate_edge_moves, change_loop) Use ira_equiv_no_lvalue_p.
(emit_move_list): Simplify code. Call
ira_update_equiv_info_by_shuffle_insn. Use ira_reg_equiv instead
- of ira_reg_equiv_invariant_p and ira_reg_equiv_const. Change
- assert.
+ of ira_reg_equiv_invariant_p and ira_reg_equiv_const. Change assert.
* ira-int.h (struct target_ira_int): Remove x_ira_class_subset_p
and x_ira_reg_classes_intersect_p.
(ira_class_subset_p, ira_reg_classes_intersect_p): Remove.
@@ -379,13 +1108,11 @@
* lra-lives.c: Ditto.
* lra-spills.c: Ditto.
* Makefile.in (LRA_INT_H): New.
- (OBJS): Add lra.o, lra-assigns.o, lra-coalesce.o,
- lra-constraints.o, lra-eliminations.o, lra-lives.o, and
- lra-spills.o.
+ (OBJS): Add lra.o, lra-assigns.o, lra-coalesce.o, lra-constraints.o,
+ lra-eliminations.o, lra-lives.o, and lra-spills.o.
(dwarf2out.o): Add dependence on ira.h and lra.h.
(ira.o): Add dependence on lra.h.
- (lra.o, lra-assigns.o, lra-coalesce.o, lra-constraints.o): New
- entries.
+ (lra.o, lra-assigns.o, lra-coalesce.o, lra-constraints.o): New entries.
(lra-eliminations.o, lra-lives.o, lra-spills.o): Ditto.
* output.h (alter_subreg): Add new argument.
* rtlanal.c (simplify_subreg_regno): Permit mode changes for LRA.
@@ -394,8 +1121,7 @@
FLOAT_MODE subregs for LRA.
(scratch_operand): Accept pseudos for LRA.
* rtl.h (lra_in_progress): New external.
- (debug_bb_n_slim, debug_bb_slim, print_value_slim): New
- prototypes.
+ (debug_bb_n_slim, debug_bb_slim, print_value_slim): New prototypes.
(debug_rtl_slim, debug_insn_slim): Ditto.
* sdbout.c (sdbout_symbol): Pass new argument to alter_subreg.
* sched-vis.c (print_value_slim): New.
@@ -416,7 +1142,7 @@
(default_different_addr_displacement_p): Ditto.
* timevar.def (TV_LRA, TV_LRA_ELIMINATE, TV_LRA_INHERITANCE): New.
(TV_LRA_CREATE_LIVE_RANGES, TV_LRA_ASSIGN, TV_LRA_COALESCE): New.
- * config/arm/arm.c (load_multiple_sequence): Pass new argument toOB
+ * config/arm/arm.c (load_multiple_sequence): Pass new argument to
alter_subreg.
(store_multiple_sequence): Ditto.
* config/i386/i386.h (enum ix86_tune_indices): Add
@@ -428,8 +1154,7 @@
(ix86_secondary_reload): Add NON_Q_REGS, SIREG, DIREG.
(inline_secondary_memory_needed): Change assert.
(ix86_spill_class): New function.
- (TARGET_LRA_P, TARGET_REGISTER_BANK, TARGET_SPILL_CLASS): New
- macros.
+ (TARGET_LRA_P, TARGET_REGISTER_BANK, TARGET_SPILL_CLASS): New macros.
* config/m68k/m68k.c (emit_move_sequence): Pass new argument to
alter_subreg.
* config/m32r/m32r.c (gen_split_move_double): Ditto.
@@ -538,13 +1263,14 @@
2012-10-22 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/55008
- * gimple-ssa-strength-reduction.c (find_basis_for_candidate): Don't
- allow a candidate to be a basis for itself under another interpretation.
+ * gimple-ssa-strength-reduction.c (find_basis_for_candidate):
+ Don't allow a candidate to be a basis for itself under another
+ interpretation.
2012-10-22 Sharad Singhai <singhai@google.com>
* dumpfile.c (dump_phase_enabled_p): Renamed dump_enabled_p. Update
- all callers.
+ all callers.
(dump_enabled_p): A new function to check if any of the dump files
is available.
(dump_kind_p): Remove check for current_function_decl. Add check for
@@ -879,7 +1605,7 @@
tests to require different effective targets.
(effective_target): New function.
(test_intrinsic): Specify correct effective targets.
- * gcc/config/arm/neon.md (fma<VCVTF:mode>4_intrinsic): New pattern.
+ * config/arm/neon.md (fma<VCVTF:mode>4_intrinsic): New pattern.
(fmsub<VCVTF:mode>4_intrinsic): Likewise.
(neon_vfma<VCVFT:mode>): New expand.
(neon_vfms<VCVFT:mode>): Likewise.
@@ -1068,27 +1794,27 @@
(rs6000_isa_flags_explicit): Define in terms of the
global_options_set structure.
- * gcc/config/rs6000/aix43.h (SUBTARGET_OVERRIDE_OPTIONS):
+ * config/rs6000/aix43.h (SUBTARGET_OVERRIDE_OPTIONS):
Change use of target_flags to rs6000_isa_flags, target_flags_explicit
to rs6000_isa_flags_explicit, and MASK_<xxx> to OPTION_MASK_<xxx>.
- * gcc/config/rs6000/aix51.h (SUBTARGET_OVERRIDE_OPTIONS): Likewise.
- * gcc/config/rs6000/aix52.h (SUBTARGET_OVERRIDE_OPTIONS): Likewise.
- * gcc/config/rs6000/aix53.h (SUBTARGET_OVERRIDE_OPTIONS): Likewise.
- * gcc/config/rs6000/aix61.h (SUBTARGET_OVERRIDE_OPTIONS): Likewise.
- * gcc/config/rs6000/freebsd64.h (RELOCATABLE_NEEDS_FIXUP): Likewise.
+ * config/rs6000/aix51.h (SUBTARGET_OVERRIDE_OPTIONS): Likewise.
+ * config/rs6000/aix52.h (SUBTARGET_OVERRIDE_OPTIONS): Likewise.
+ * config/rs6000/aix53.h (SUBTARGET_OVERRIDE_OPTIONS): Likewise.
+ * config/rs6000/aix61.h (SUBTARGET_OVERRIDE_OPTIONS): Likewise.
+ * config/rs6000/freebsd64.h (RELOCATABLE_NEEDS_FIXUP): Likewise.
(SUBSUBTARGET_OVERRIDE_OPTIONS): Likewise.
- * gcc/config/rs6000/freebsd.h (RELOCATABLE_NEEDS_FIXUP): Likewise.
- * gcc/config/rs6000/linux64.h (RELOCATABLE_NEEDS_FIXUP): Likewise.
+ * config/rs6000/freebsd.h (RELOCATABLE_NEEDS_FIXUP): Likewise.
+ * config/rs6000/linux64.h (RELOCATABLE_NEEDS_FIXUP): Likewise.
(SUBSUBTARGET_OVERRIDE_OPTIONS): Likewise.
(OPTION_LITTLE_ENDIAN): Likewise.
(OPTION_RELOCATABLE): Likewise.
(OPTION_EABI): Likewise.
(OPTION_PROTOTYPE): Likewise.
- * gcc/config/rs6000/linux.h (RELOCATABLE_NEEDS_FIXUP): Likewise.
- * gcc/config/rs6000/option-defaults.h (OPTION_MASK_64BIT): Likewise.
+ * config/rs6000/linux.h (RELOCATABLE_NEEDS_FIXUP): Likewise.
+ * config/rs6000/option-defaults.h (OPTION_MASK_64BIT): Likewise.
(OPT_ARCH32): Likewise.
(OPT_ARCH64): Likewise.
- * gcc/config/rs6000/sysv4.h (TARGET_TOC): Likewise.
+ * config/rs6000/sysv4.h (TARGET_TOC): Likewise.
(SUBTARGET_OVERRIDE_OPTIONS): Likewise.
(SUBSUBTARGET_OVERRIDE_OPTIONS): Likewise.
(TARGET_OS_SYSV_CPP_BUILTINS): Likewise.
@@ -5221,13 +5947,13 @@
2012-09-08 Andi Kleen <ak@linux.intel.com>
- * gcc/lto/lto.c (do_whole_program_analysis): Fix last broken patch.
+ * lto/lto.c (do_whole_program_analysis): Fix last broken patch.
2012-09-08 Andi Kleen <ak@linux.intel.com>
- * gcc/common.opt (-fmem-report-wpa): Add
- * gcc/doc/invoke.texi (-fmem-report-wpa): Document.
- * gcc/lto/lto.c (do_whole_program_analysis): Run mem_report
+ * common.opt (-fmem-report-wpa): Add
+ * doc/invoke.texi (-fmem-report-wpa): Document.
+ * lto/lto.c (do_whole_program_analysis): Run mem_report
when mem_report_wpa is set.
2012-09-07 Anthony Green <green@moxielogic.com>
@@ -5316,10 +6042,10 @@
2012-09-06 Andi Kleen <ak@linux.intel.com>
- * gcc/lto-streamer.h (res_pair): Add.
+ * lto-streamer.h (res_pair): Add.
(lto_file_decl_data): Replace resolutions with respairs.
Add max_index.
- * gcc/lto/lto.c (lto_resolution_read): Remove max_index. Add rp.
+ * lto/lto.c (lto_resolution_read): Remove max_index. Add rp.
Initialize respairs.
(lto_file_finalize): Set up resolutions vector lazily from respairs.
@@ -7761,7 +8487,7 @@
* ggc.h: ... here.
* doc/gty.texi: Document support for C++ templates and
user-provided markers.
- * gcc/gengtype-lex.l: Update copyright year.
+ * gengtype-lex.l: Update copyright year.
Remove support for recognizing DEF_VEC_O, DEF_VEC_P and DEFVEC_I.
* gengtype-parse.c: Update copyright year.
(token_names): Remove DEF_VEC_O, DEF_VEC_P and DEF_VEC_I.
@@ -10463,7 +11189,7 @@
2012-07-30 Oleg Endo <olegendo@gcc.gnu.org>
PR target/39423
- * config/gcc/sh/sh.md (*movsi_index_disp, *movhi_index_disp): New
+ * config/sh/sh.md (*movsi_index_disp, *movhi_index_disp): New
insns.
2012-07-30 Oleg Endo <olegendo@gcc.gnu.org>
@@ -11027,7 +11753,7 @@
(stack_protect_set_<mode>): Likewise.
(stack_protect_test): Likewise.
(stack_protect_test_<mode>): Likewise.
- * gcc/defaults.h: Define macro TARGET_HAS_BIONIC to 0 - target does
+ * defaults.h: Define macro TARGET_HAS_BIONIC to 0 - target does
not have Bionic by default
* config/linux.h: Redefine macro TARGET_HAS_BIONIC to (OPTION_BIONIC)
Macro OPTION_BIONIC is defined in this file and provides Bionic
@@ -11762,15 +12488,15 @@
Set "type" attribute.
* config/mips/generic.md (generic_atomic, generic_syncloop):
New reservations.
- * gcc/config/mips/10000.md, gcc/config/mips/20kc.md,
- * gcc/config/mips/24k.md, gcc/config/mips/4130.md,
- * gcc/config/mips/4k.md, gcc/config/mips/5400.md,
- * gcc/config/mips/5500.md, gcc/config/mips/5k.md,
- * gcc/config/mips/7000.md, gcc/config/mips/74k.md,
- * gcc/config/mips/9000.md, gcc/config/mips/loongson2ef.md,
- * gcc/config/mips/loongson3a.md, gcc/config/mips/octeon.md,
- * gcc/config/mips/sb1.md, gcc/config/mips/sr71k.md,
- * gcc/config/mips/xlr.md: Handle "atomic" and "syncloop" types.
+ * config/mips/10000.md, config/mips/20kc.md,
+ * config/mips/24k.md, config/mips/4130.md,
+ * config/mips/4k.md, config/mips/5400.md,
+ * config/mips/5500.md, config/mips/5k.md,
+ * config/mips/7000.md, config/mips/74k.md,
+ * config/mips/9000.md, config/mips/loongson2ef.md,
+ * config/mips/loongson3a.md, config/mips/octeon.md,
+ * config/mips/sb1.md, config/mips/sr71k.md,
+ * config/mips/xlr.md: Handle "atomic" and "syncloop" types.
2012-07-20 Oleg Endo <olegendo@gcc.gnu.org>
@@ -15922,7 +16648,7 @@
2012-06-12 Maxim Kuvyrkov <maxim@codesourcery.com>
- * gcc/config/mips/mips-tables.opt (xlp): Fix merge typo.
+ * config/mips/mips-tables.opt (xlp): Fix merge typo.
2012-06-11 Roland McGrath <mcgrathr@google.com>
@@ -25264,7 +25990,7 @@
2012-03-07 Georg-Johann Lay <avr@gjlay.de>
PR target/52506
- * gcc/config/avr/avr.c (expand_epilogue): Fix order of restoration
+ * config/avr/avr.c (expand_epilogue): Fix order of restoration
to: RAMPZ, RAMPY, RAMPX, RAMPD.
(expand_prologue): Only clear RAMPZ if it has effect on RAM-read.
@@ -25278,7 +26004,7 @@
2012-03-07 Georg-Johann Lay <avr@gjlay.de>
PR target/52461
- * gcc/config/avr/avr.c (avr_out_lpm): Clear RAMPZ after usage
+ * config/avr/avr.c (avr_out_lpm): Clear RAMPZ after usage
if RAMPZ affects reading from RAM.
2012-03-07 Richard Guenther <rguenther@suse.de>
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 7af4fcd8a57..84df5b43f57 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20121025
+20121031
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 116a5ad275d..efc7c9bcc82 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -2812,7 +2812,7 @@ print-rtl.o : print-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h dumpfile.h $(TM_H)
rtlanal.o : rtlanal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(DIAGNOSTIC_CORE_H) \
$(RTL_H) hard-reg-set.h $(TM_P_H) insn-config.h $(RECOG_H) \
$(FLAGS_H) $(REGS_H) output.h $(TARGET_H) $(FUNCTION_H) $(TREE_H) \
- $(DF_H) $(EMIT_RTL_H)
+ $(DF_H) $(EMIT_RTL_H) addresses.h
varasm.o : varasm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(RTL_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) hard-reg-set.h $(REGS_H) \
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 001a8d901f1..4e37a55e7d0 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,538 @@
+2012-10-30 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/Make-lang.in: Fix and clean up rules for C files.
+
+2012-10-29 Arnaud Charlet <charlet@adacore.com>
+
+ * gcc-interface/Makefile.in (s-oscons.ads): Adjust call to xoscons.
+
+2012-10-29 Pascal Obry <obry@adacore.com>
+
+ * xoscons.adb, Make-generated.in; The template used by xoscons is now
+ given as parameter.
+ * gcc-interface/Make-lang.in: Update dependencies.
+
+2012-10-29 Yannick Moy <moy@adacore.com>
+
+ * exp_dbug.adb (Qualify_Entity_Name): Only do renaming in formal
+ verification mode when there is a homonym.
+
+2012-10-29 Thomas Quinot <quinot@adacore.com>
+
+ * xoscons.adb: Minor reformatting.
+
+2012-10-29 Yannick Moy <moy@adacore.com>
+
+ * exp_alfa.adb (Expand_Alfa): Backtrack change that removed
+ qualification of names in formal verification mode. Instead,
+ the qualification should be modified.
+ * exp_dbug.adb (Qualify_Entity_Name): Modify qualification in formal
+ verification mode, so that only a suffix is added to distinguish
+ homonyms from the same scope.
+
+2012-10-29 Robert Dewar <dewar@adacore.com>
+
+ * gnat_rm.texi: Document that pragma Optimize_Alignment (Space) is
+ ignored with a warning for packed variable length records.
+
+2012-10-29 Thomas Quinot <quinot@adacore.com>
+
+ * socket.c, g-socthi-dummy.adb, g-socthi-dummy.ads, g-socthi-vms.adb,
+ g-socthi-vms.ads, g-socthi-vxworks.adb, g-socthi-vxworks.ads,
+ s-oscons-tmplt.c, g-socthi-mingw.adb, g-socthi-mingw.ads, g-socthi.adb,
+ g-socthi.ads, xoscons.adb, g-socket.adb, g-sothco.ads: Introduce an
+ appropriate subtype for IOCTL requests, since these may be signed or
+ unsigned.
+
+2012-10-29 Gary Dismukes <dismukes@adacore.com>
+
+ * exp_alfa.adb: Minor reformatting.
+
+2012-10-29 Robert Dewar <dewar@adacore.com>
+
+ * gnat_rm.texi, gnat_ugn.texi: Clarify documentation on maximum
+ line length style switch.
+
+2012-10-29 Robert Dewar <dewar@adacore.com>
+
+ * layout.adb (Set_Composite_Alignment): Ignore pragma
+ Optimize_Alignment (Space) for packed variable length records.
+
+2012-10-29 Robert Dewar <dewar@adacore.com>
+
+ * s-bignum.adb: Minor comment change.
+
+2012-10-29 Thomas Quinot <quinot@adacore.com>
+
+ * s-oscons-tmplt.c: Fix signedness of ioctl request identifiers
+ for x86_64-freebsd.
+
+2012-10-29 Yannick Moy <moy@adacore.com>
+
+ * exp_alfa.adb (Expand_Alfa): Remove qualification of names.
+
+2012-10-29 Robert Dewar <dewar@adacore.com>
+
+ * sem_prag.adb: Minor reformatting.
+
+2012-10-29 Robert Dewar <dewar@adacore.com>
+
+ * gnat_rm.texi: Minor rewording.
+
+2012-10-29 Javier Miranda <miranda@adacore.com>
+
+ * exp_disp.ads (Is_Expanded_Dispatching_Call): New subprogram.
+ * exp_disp.adb (Expand_Dispatching_Call): No action needed if the
+ call has been already expanded.
+ (Is_Expanded_Dispatching_Call): New subprogram.
+ * sem_disp.adb (Propagate_Tag): No action needed if the call
+ has been already expanded.
+
+2012-10-29 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * exp_ch9.adb (Create_Index_And_Data): Remove local
+ variable Index_Typ and its uses. The type of the index is now
+ System.Tasking.Entry_Index. Update all related comments.
+ * rtsfind.ads: Add RE_Entry_Index in tables RE_Id and RE_Unit_Table.
+ * s-taskin.adb (Number_Of_Entries): The return type is now Entry_Index.
+ * s-taskin.ads: The index type of Task_Entry_Names_Array is now
+ Entry_Index.
+ (Number_Of_Entries): The return type is now Entry_Index.
+ * s-tpoben.adb (Number_Of_Entries): The return type is now Entry_Index.
+ * s-tpoben.ads: The index type of Protected_Entry_Names_Array
+ is now Entry_Index.
+ (Number_Of_Entries): The return type is now Entry_Index.
+
+2012-10-29 Pascal Obry <obry@adacore.com>
+
+ * gnat_ugn.texi: Add note about SEH setup on x86-windows.
+
+2012-10-29 Eric Botcazou <ebotcazou@adacore.com>
+
+ * s-bignum.adb (Allocate_Bignum): Use the exact layout of
+ Bignum_Data for the overlay.
+
+2012-10-29 Thomas Quinot <quinot@adacore.com>
+
+ * gnat_rm.texi, sem_prag.adb, sem_util.adb, sem_util.ads,
+ par-prag.adb, par-util.adb, snames.ads-tmpl (Sem_Prag.Analyze_Pragma):
+ Handle new pragma Attribute_Definition.
+ (Sem_Util.Bad_Attribute): New routine, moved here
+ from par-util, so that it can be used by the above.
+ (Par_Util.Signal_Bad_Attribute): Processing moved to
+ Sem_Util.Bad_Attribute.
+
+2012-10-29 Robert Dewar <dewar@adacore.com>
+
+ * s-tpoben.ads, s-taskin.ads, exp_ch3.adb: Minor reformatting.
+
+2012-10-29 Yannick Moy <moy@adacore.com>
+
+ * sem_prag.adb, gnat1drv.adb, opt.ads: Rename S14_Extensions
+ into Formal_Extensions.
+
+2012-10-29 Thomas Quinot <quinot@adacore.com>
+
+ * sem_attr.adb: Minor reformatting.
+
+2012-10-29 Tristan Gingold <gingold@adacore.com>
+
+ * gnat_rm.texi: Document implementation advice for Pragma
+ Partition_Elaboration_Policy.
+
+2012-10-29 Yannick Moy <moy@adacore.com>
+
+ * s-bignum.adb (Div_Rem): Reference that Algorithm_D is from
+ the second edition of TAOCP from Knuth, since the algo changed
+ in the third edition. Also correct the definition of 'd' which
+ could overflow.
+
+2012-10-29 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * exp_ch3.adb (Build_Initialization_Call): Create static strings
+ which denote entry [family] names and associate them with the
+ object's Protection_Entries or ATCB.
+ (Build_Init_Statements):
+ Remove local variable Names. Do not generate the entry [family]
+ names inside the init proc because they are now static.
+ * exp_ch9.adb (Build_Entry_Names): Reimplemented. The strings
+ which denote entry [family] names are now generated statically
+ and associated with the concurrent object's Protection_Entries
+ or ATCB during initialization.
+ * exp_ch9.ads (Build_Entry_Names): Change subprogram profile
+ and associated comment on usage.
+ * rtsfind.ads: Add the following entries to tables RE_Id and
+ RE_Unit_Table:
+
+ RE_Protected_Entry_Names_Array RE_Task_Entry_Names_Array
+ RO_PE_Number_Of_Entries RO_PE_Set_Entry_Names
+ RO_ST_Number_Of_Entries RO_ST_Set_Entry_Names
+
+ Remove the following entries from tables RE_Id and RE_Unit_Table:
+
+ RO_PE_Set_Entry_Name RO_TS_Set_Entry_Name
+
+ * s-taskin.adb: Remove with clause for Ada.Unchecked_Deallocation.
+ (Free_Entry_Names_Array): Removed.
+ (Number_Of_Entries): New routine.
+ (Set_Entry_Names): New routine.
+ * s-taskin.ads: Rename type Entry_Names_Array to
+ Task_Entry_Names_Array. Rename type Entry_Names_Array_Access
+ to Task_Entry_Names_Access. Update the type of ACTB field
+ Entry_Names and add a comment on its protection status.
+ (Free_Entry_Names_Array): Removed.
+ (Number_Of_Entries): New routine.
+ (Set_Entry_Names): New routine.
+ * s-tassta.adb (Create_Task): Remove formal parameter
+ Build_Entry_Names. Do not allocate an array to hold the
+ string names of entries and families.
+ (Free_Entry_Names): Removed.
+ (Free_Task): Remove the call to Free_Entry_Names.
+ (Set_Entry_Name): Removed.
+ (Vulnerable_Free_Task): Remove the call to Free_Entry_Names.
+ * s-tassta.ads (Create_Task): Remove formal parameter
+ Build_Entry_Names along with associated comment.
+ (Set_Entry_Name): Removed.
+ * s-tpoben.adb: Remove with clause for Ada.Unchecked_Deallocation.
+ (Finalize): Remove the call to Free_Entry_Names.
+ (Free_Entry_Names): Removed.
+ (Initialize_Protection_Entries):
+ Remove formal parameter Build_Entry_Names. Do not allocate
+ an array to hold the string names of entries and families.
+ (Number_Of_Entries): New routine.
+ (Set_Entry_Name): Removed.
+ (Set_Entry_Names): New routine.
+ * s-tpoben.ads: Add types Protected_Entry_Names_Array and
+ Protected_Entry_Names_Access. Update the type of Protection_Enties
+ field Entry_Names.
+ (Initialize_Protection_Entries): Remove
+ formal parameter Build_Entry_Names along with associated comment.
+ (Number_Of_Entries): New routine.
+ (Set_Entry_Name): Removed.
+ (Set_Entry_Names): New routine.
+
+2012-10-29 Arnaud Charlet <charlet@adacore.com>
+
+ * gnat_ugn.texi: Minor typo fix.
+2012-10-29 Yannick Moy <moy@adacore.com>
+
+ * debug.adb Associate debug switch -gnatd.V to extensions for
+ formal verification.
+ * gnat1drv.adb (Adjust_Global_Switches): Set flag S14_Extensions
+ when -gnatd.V is set.
+ * gnat_rm.texi: Remove doc for Assert_And_Cut.
+ * opt.ads Declare new flag S14_Extensions, to be set when new
+ aspects/pragmas/attributes for formal verification should be
+ accepted.
+ * sem_prag.adb (Analyze_Pragma): Check that S14_Extensions is
+ set when treating pragma Assert_And_Cut.
+
+2012-10-29 Tristan Gingold <gingold@adacore.com>
+
+ * s-tarest.ads, s-tassta.adb: Add a pragma Partition_Elaboration_Policy.
+
+2012-10-29 Robert Dewar <dewar@adacore.com>
+
+ * freeze.adb: Minor reformatting.
+
+2012-10-29 Robert Dewar <dewar@adacore.com>
+
+ * xr_tabls.adb, xr_tabls.ads, exp_ch9.adb, snames.adb-tmpl,
+ snames.ads-tmpl, exp_ch3.adb: Minor reformatting.
+
+2012-10-29 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch6.adb: Call Build_Subprogrm_Instance_Renamings only when
+ generating code.
+
+2012-10-29 Robert Dewar <dewar@adacore.com>
+
+ * gnat_ugn.texi: Add documentation for -gnatw.k/-gnatw.K.
+ * ug_words: Add entries for -gnatw.k/.K for [NO]STANDARD_REDEFINITION.
+ * vms_data.ads: Add entries for [NO]STANDARD_REDEFINITION.
+
+2012-10-29 Tristan Gingold <gingold@adacore.com>
+
+ * exp_ch9.adb, s-tarest.ads, exp_ch3.adb: Update comments.
+
+2012-10-29 Yannick Moy <moy@adacore.com>
+
+ * gnat_rm.texi: Minor documentation addition.
+
+2012-10-29 Emmanuel Briot <briot@adacore.com>
+
+ * xr_tabls.adb, xr_tabls.ads (Add_Declaration, Add_Reference): No
+ longer assume that a parameter declaration is seen after the subprogram
+ that uses it.
+
+2012-10-29 Tristan Gingold <gingold@adacore.com>
+
+ * lib-writ.adb (Write_ALI): Emit partition elaboration policy
+ in P line.
+ * lib-writ.ads: Document partition elaboration policy indication.
+ * sem_prag.adb (Check_Arg_Is_Partition_Elaboration_Policy): New
+ procedure.
+ (Analyze_Pragma): Handle Partition_Elaboration_Policy.
+ (Sig_Flags): Add flag for Pragma_Partition_Elaboration_Policy
+ * ali.adb (Initialize_ALI): Init Partition_Elaboration_Policy_Specified.
+ (Scan_ALI): Read Ex indications.
+ * ali.ads: ALIs_Record: Add Partition_Elaboration_Policy.
+ * par-prag.adb (Prag): Add Partition_Elaboration_Policy.
+ * snames.adb-tmpl (Is_Partition_Elaboration_Policy_Name): New function.
+ * opt.ads (Partition_Elaboration_Policy): Declare.
+ (Partition_Elaboration_Policy_Sloc): Declare.
+ * bcheck.adb (Check_Consistent_Partition_Elaboration_Policy):
+ New procedure. (Check_Configuration_Consistency): Check partition
+ elaboration policy consistency.
+ * snames.ads-tmpl (Name_Partition_Elaboration_Policy): New name.
+ (First_Partition_Elaboration_Policy_Name, Name_Concurrent,
+ Name_Sequential, Last_Partition_Elaboration_Policy_Name): Likewise.
+ (Pragma_Partition_Elaboration_Policy): New literal.
+ (Is_Partition_Elaboration_Policy_Name): New function.
+
+2012-10-29 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch6.adb (Is_Public_Subprogram_For): Handle properly
+ expression functions, which are rewritten as subprogram
+ declarations, when generating invariants for its return value
+ and in-out parameters.
+
+2012-10-29 Arnaud Charlet <charlet@adacore.com>
+
+ * warnsw.adb (Set_GNAT_Mode_Warnings): Unset
+ Warn_On_Standard_Redefinition.
+
+2012-10-29 Javier Miranda <miranda@adacore.com>
+
+ * sem_ch3.adb (Derive_Progenitor_Subprograms): Complete documentation.
+
+2012-10-29 Robert Dewar <dewar@adacore.com>
+
+ * par-ch11.adb (Warn_If_Standard_Redefinition): Add calls.
+ * par-ch3.adb (P_Defining_Identifier): Call
+ Warn_If_Standard_Redefinition if not inside record definition.
+ * par-ch6.adb (Warn_If_Standard_Redefinition): Add calls.
+ * par-util.adb (Warn_If_Standard_Redefinition): New procedure.
+ * par.adb (Inside_Record_Definition): New flag.
+ (Warn_If_Standard_Redefinition): New procedure.
+ * sinfo-cn.adb (Change_Identifier_To_Defining_Identifier): Remove
+ handling of warning for redefining standard name (moved to Par*).
+
+2012-10-29 Javier Miranda <miranda@adacore.com>
+
+ * sem_ch3.adb (Derive_Progenitor_Subprograms): Disable small
+ optimization in generic formal types.
+
+2012-10-29 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch9.adb, exp_ch3.adb: Add comments.
+ * sem_prag.adb: Minor reformatting.
+
+2012-10-29 Tristan Gingold <gingold@adacore.com>
+
+ * bindgen.adb (Gen_Output_File_Ada): Do not emit declaration for
+ Is_Elaborated if not referenced.
+
+2012-10-29 Tristan Gingold <gingold@adacore.com>
+
+ * exp_ch9.adb (Build_Activation_Chain_Entity): Punt in restricted
+ profile.
+ * exp_ch3.adb (Build_Initialization_Call): Do no append _Chain
+ parameter in restricted profile.
+ (Build_Init_Call_Thru): Likewise.
+ (Init_Formals): Likewise.
+ * exp_ch3.adb: Minor reformatting.
+
+2012-10-29 Arnaud Charlet <charlet@adacore.com>
+
+ * usage.adb: Update usage line for -gnatw.k.
+
+2012-10-29 Yannick Moy <moy@adacore.com>
+
+ * sem_prag.adb: Code clean up.
+
+2012-10-29 Vincent Celier <celier@adacore.com>
+
+ * projects.texi: Clarify documentation of attribute
+ Ignore_Source_Sub_Dirs.
+
+2012-10-29 Robert Dewar <dewar@adacore.com>
+
+ * g-sechas.adb, g-sechas.ads, exp_ch9.adb, bindgen.adb, exp_dbug.adb,
+ exp_dbug.ads: Minor reformatting.
+
+2012-10-29 Pascal Obry <obry@adacore.com>
+
+ * g-sechas.adb, g-sechas.ads: (Binary_Message_Digest): New subtype.
+ (Digest): New versions returning a Binary_Message_Digest.
+ (Wide_Digest): Likewise.
+
+2012-10-29 Robert Dewar <dewar@adacore.com>
+
+ * warnsw.adb: Complete previous change.
+
+2012-10-29 Tristan Gingold <gingold@adacore.com>
+
+ * bindgen.adb (Check_File_In_Partition, Check_System_Restrictions_Used):
+ Removed.
+ (Check_Dispatching_Domains_Used): Removed.
+ (Gen_Adafinal): Remove call to above procedures.
+ (Resolve_Binder_Options): Handle system restrictions and dispatching
+ domains.
+
+2012-10-29 Tristan Gingold <gingold@adacore.com>
+
+ * s-tarest.ads, s-tarest.adb (Create_Restricted_Task): Remove
+ Chain parameter.
+ * exp_ch9.adb (Make_Task_Create_Call): Do not add Chain parameter
+ on restricted runtime.
+
+2012-10-29 Pascal Obry <obry@adacore.com>
+
+ * g-sechas.adb, g-sechas.ads: Minor code clean-up.
+
+2012-10-29 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_aux.adb (Get_Rep_Item): Treat Priority and Interrupt_Priority
+ as equivalent, because only one of them can be specified for a
+ task, protected definition, or subprogram body.
+ * aspects.adb ((Same_Aspect): The canonical aspect of
+ Interrupt_Priority is Priority.
+
+2012-10-29 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch13.adb: Minor reformatting.
+
+2012-10-29 Robert Dewar <dewar@adacore.com>
+
+ * i-cstrea.ads: Avoid redefinition of standard symbol string.
+ * prj-makr.adb: Add comment for OK redefinition of Stadard.
+ * prj.ads: Add comment for OK redefinition of Stadard.
+ * s-crtl.ads: Avoid redefinition of standard symbol string.
+ * sinfo-cn.adb (Change_Identifier_To_Defining_Identifier):
+ Generate warning for standard redefinition if
+ Warn_On_Standard_Definition set.
+ * usage.adb: Add lines for -gnatw.k and -gnatw.K
+ * warnsw.adb: Set/reset Warn_On_Standard_Redefinition
+ appropriately.
+ * warnsw.ads (Warn_On_Standard_Redefinition): New flag.
+ * s-stratt-xdr.adb: Avoid new warning.
+
+2012-10-29 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_dbug.ads, exp_dbug.adb (Build_Subprogram_Instance_Renamings):
+ in the body of a subpogram instance, introduce local renamings
+ for actuals of an elementary type, so that GDB can recover the
+ values of these actuals more directly.
+
+2012-10-29 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch5.adb (Analyze_Loop_Statement): Add warning for identical
+ inner/outer ranges.
+
+2012-10-29 Robert Dewar <dewar@adacore.com>
+
+ * einfo.ads: Change terminology "present" to "defined" in talking
+ about whether a given field is defined for a given entity kind.
+
+2012-10-29 Bob Duff <duff@adacore.com>
+
+ * atree.ads: Minor comment fix.
+
+2012-10-29 Bob Duff <duff@adacore.com>
+
+ * sem_ch13.adb (Replace_Type_Reference): Set_Comes_From_Source.
+ Otherwise, the node is ignored by ASIS.
+ * sem_ch5.adb: Minor reformatting.
+
+2012-10-29 Thomas Quinot <quinot@adacore.com>
+
+ * exp_attr.adb, exp_dist.adb, exp_dist.ads (Build_To_Any_Call): Pass
+ an explicit Loc parameter to set the source location of generated
+ nodes.
+
+2012-10-29 Tristan Gingold <gingold@adacore.com>
+
+ * exp_ch9.adb (Build_Task_Activation_Call): Do nothing on
+ restricted profile.
+ * bindgen.adb (System_Tasking_Restricted_Stages_Used): New variable.
+ (Gen_Adainit): Declare and call Activate_Tasks when the above variable
+ is set.
+ (Resolve_Binder_Options): Set the variable.
+ * rtsfind.ads (RE_Activate_Restricted_Tasks): Removed (now unused).
+ * s-tarest.adb (Tasks_Activation_Chain): New variable.
+ (Activate_Restricted_Tasks): Removed, and replaced by ...
+ (Activate_Tasks): New procedure, to activate all tasks at
+ the end of elaboration.
+ (Create_Restricted_Tasks): Chain parameter is now unreferenced. Put
+ the created task on the Tasks_Activation_Chain list.
+ * s-tarest.ads (Activate_Restricted_Tasks): Removed.
+ (Activate_Tasks): Added.
+
+2012-10-29 Gary Dismukes <dismukes@adacore.com>
+
+ * sem_res.adb (Resolve_If_Expression): Compare subtype of the 'then'
+ expression against the subtype of the expression rather than comparing
+ base types, same as is already done for the 'else' expression.
+
+2012-10-29 Steve Baird <baird@adacore.com>
+
+ * sem_ch13.adb (Analyze_Attribute_Definition_Clause): If CodePeer_Mode
+ = True and we detect that an Address specification is used to overlay
+ another object, do not set that object's Treat_As_Volatile flag.
+
+2012-10-29 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch3.adb (Constant_Redeclaration): If the type of a
+ deferred constant has invariants, generate invariant call on
+ the initial value.
+
+2012-10-29 Bob Duff <duff@adacore.com>
+
+ * sem_ch13.adb (Replace_Type_Reference): Use correct sloc for
+ the new node.
+
+2012-10-29 Thomas Quinot <quinot@adacore.com>
+
+ * sem_elab.adb: Minor reformatting and code reorganization.
+
+2012-10-29 Robert Dewar <dewar@adacore.com>
+
+ * par-ch4.adb (P_Primary): Warn on bad use of unary minus.
+
+2012-10-29 Robert Dewar <dewar@adacore.com>
+
+ * s-valuti.ads, s-valuti.adb (Bad_Value): New procedure.
+ * s-valllu.adb, s-valwch.adb, s-valcha.adb, s-valint.adb,
+ s-valuns.adb, s-valrea.adb, s-valboo.adb, s-valenu.adb,
+ s-vallli.adb: Use Bad_Value everywhere.
+
+2012-10-29 Yannick Moy <moy@adacore.com>
+
+ * gnat1drv.adb (Adjust_Global_Switches): Do not suppress checks
+ in Alfa mode.
+
+2012-10-29 Yannick Moy <moy@adacore.com>
+
+ * checks.adb (Apply_Arithmetic_Overflow_Minimized_Eliminated):
+ Add special case for case expression alternative.
+ (Is_Signed_Integer_Arithmetic_Op): Remove special case for case
+ expression alternative.
+ * exp_ch4.adb Minor reformatting.
+
+2012-10-29 Thomas Quinot <quinot@adacore.com>
+
+ * sem_elab.adb: Minor reformatting.
+
+2012-10-29 Bob Duff <duff@adacore.com>
+
+ * sem_res.adb: Minor: Remove redundant test.
+
+2012-10-29 Arnaud Charlet <charlet@adacore.com>
+
+ * pprint.ads, pprint.adb, adabkend.ads, adabkend.adb,
+ aa_util.ads, aa_util.adb: New.
+
2012-10-23 Eric Botcazou <ebotcazou@adacore.com>
* system-linux-mipsel.ads (Stack_Check_Probes): Set to True.
diff --git a/gcc/ada/Make-generated.in b/gcc/ada/Make-generated.in
index 00278df251f..57160ce19b2 100644
--- a/gcc/ada/Make-generated.in
+++ b/gcc/ada/Make-generated.in
@@ -93,7 +93,7 @@ $(ADA_GEN_SUBDIR)/s-oscons.ads : $(ADA_GEN_SUBDIR)/s-oscons-tmplt.c $(ADA_GEN_SU
$(RM) s-oscons-tmplt.i s-oscons-tmplt.s ; \
$(OSCONS_CPP) ; \
$(OSCONS_EXTRACT) ; \
- ./xoscons ) ; \
+ ./xoscons s-oscons ) ; \
$(MOVE_IF_CHANGE) $(ADA_GEN_SUBDIR)/bldtools/oscons/s-oscons.ads $(ADA_GEN_SUBDIR)/s-oscons.ads ; \
$(MOVE_IF_CHANGE) $(ADA_GEN_SUBDIR)/bldtools/oscons/s-oscons.h $(ADA_GEN_SUBDIR)/s-oscons.h
diff --git a/gcc/ada/aa_util.adb b/gcc/ada/aa_util.adb
new file mode 100644
index 00000000000..6ea4421f570
--- /dev/null
+++ b/gcc/ada/aa_util.adb
@@ -0,0 +1,458 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAAMP COMPILER COMPONENTS --
+-- --
+-- A A _ U T I L --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2001-2012, 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- --
+-- 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. --
+-- --
+------------------------------------------------------------------------------
+
+with Sem_Aux; use Sem_Aux;
+with Sinput; use Sinput;
+with Stand; use Stand;
+with Stringt; use Stringt;
+
+with GNAT.Case_Util; use GNAT.Case_Util;
+
+package body AA_Util is
+
+ ----------------------
+ -- Is_Global_Entity --
+ ----------------------
+
+ function Is_Global_Entity (E : Entity_Id) return Boolean is
+ begin
+ return Enclosing_Dynamic_Scope (E) = Standard_Standard;
+ end Is_Global_Entity;
+
+ -----------------
+ -- New_Name_Id --
+ -----------------
+
+ function New_Name_Id (Name : String) return Name_Id is
+ begin
+ for J in 1 .. Name'Length loop
+ Name_Buffer (J) := Name (Name'First + (J - 1));
+ end loop;
+
+ Name_Len := Name'Length;
+ return Name_Find;
+ end New_Name_Id;
+
+ -----------------
+ -- Name_String --
+ -----------------
+
+ function Name_String (Name : Name_Id) return String is
+ begin
+ pragma Assert (Name /= No_Name);
+ return Get_Name_String (Name);
+ end Name_String;
+
+ -------------------
+ -- New_String_Id --
+ -------------------
+
+ function New_String_Id (S : String) return String_Id is
+ begin
+ for J in 1 .. S'Length loop
+ Name_Buffer (J) := S (S'First + (J - 1));
+ end loop;
+
+ Name_Len := S'Length;
+ return String_From_Name_Buffer;
+ end New_String_Id;
+
+ ------------------
+ -- String_Value --
+ ------------------
+
+ function String_Value (Str_Id : String_Id) return String is
+ begin
+ -- ??? pragma Assert (Str_Id /= No_String);
+
+ if Str_Id = No_String then
+ return "";
+ end if;
+
+ String_To_Name_Buffer (Str_Id);
+
+ return Name_Buffer (1 .. Name_Len);
+ end String_Value;
+
+ ---------------
+ -- Next_Name --
+ ---------------
+
+ function Next_Name
+ (Name_Seq : not null access Name_Sequencer;
+ Name_Prefix : String) return Name_Id
+ is
+ begin
+ Name_Seq.Sequence_Number := Name_Seq.Sequence_Number + 1;
+
+ declare
+ Number_Image : constant String := Name_Seq.Sequence_Number'Img;
+ begin
+ return New_Name_Id
+ (Name_Prefix & "__" & Number_Image (2 .. Number_Image'Last));
+ end;
+ end Next_Name;
+
+ --------------------
+ -- Elab_Spec_Name --
+ --------------------
+
+ function Elab_Spec_Name (Module_Name : Name_Id) return Name_Id is
+ begin
+ return New_Name_Id (Name_String (Module_Name) & "___elabs");
+ end Elab_Spec_Name;
+
+ --------------------
+ -- Elab_Spec_Name --
+ --------------------
+
+ function Elab_Body_Name (Module_Name : Name_Id) return Name_Id is
+ begin
+ return New_Name_Id (Name_String (Module_Name) & "___elabb");
+ end Elab_Body_Name;
+
+ --------------------------------
+ -- Source_Name_Without_Suffix --
+ --------------------------------
+
+ function File_Name_Without_Suffix (File_Name : String) return String is
+ Name_Index : Natural := File_Name'Last;
+
+ begin
+ pragma Assert (File_Name'Length > 0);
+
+ -- We loop in reverse to ensure that file names that follow nonstandard
+ -- naming conventions that include additional dots are handled properly,
+ -- preserving dots in front of the main file suffix (for example,
+ -- main.2.ada => main.2).
+
+ while Name_Index >= File_Name'First
+ and then File_Name (Name_Index) /= '.'
+ loop
+ Name_Index := Name_Index - 1;
+ end loop;
+
+ -- Return the part of the file name up to but not including the last dot
+ -- in the name, or return the whole name as is if no dot character was
+ -- found.
+
+ if Name_Index >= File_Name'First then
+ return File_Name (File_Name'First .. Name_Index - 1);
+
+ else
+ return File_Name;
+ end if;
+ end File_Name_Without_Suffix;
+
+ -----------------
+ -- Source_Name --
+ -----------------
+
+ function Source_Name (Sloc : Source_Ptr) return File_Name_Type is
+ begin
+ if Sloc = No_Location or Sloc = Standard_Location then
+ return No_File;
+ else
+ return File_Name (Get_Source_File_Index (Sloc));
+ end if;
+ end Source_Name;
+
+ --------------------------------
+ -- Source_Name_Without_Suffix --
+ --------------------------------
+
+ function Source_Name_Without_Suffix (Sloc : Source_Ptr) return String is
+ Src_Name : constant String :=
+ Name_String (Name_Id (Source_Name (Sloc)));
+ Src_Index : Natural := Src_Name'Last;
+
+ begin
+ pragma Assert (Src_Name'Length > 0);
+
+ -- Treat the presence of a ".dg" suffix specially, stripping it off
+ -- in addition to any suffix preceding it.
+
+ if Src_Name'Length >= 4
+ and then Src_Name (Src_Name'Last - 2 .. Src_Name'Last) = ".dg"
+ then
+ Src_Index := Src_Index - 3;
+ end if;
+
+ return File_Name_Without_Suffix (Src_Name (Src_Name'First .. Src_Index));
+ end Source_Name_Without_Suffix;
+
+ ----------------------
+ -- Source_Id_String --
+ ----------------------
+
+ function Source_Id_String (Unit_Name : Name_Id) return String is
+ Unit_String : String := Name_String (Unit_Name);
+ Name_Last : Positive := Unit_String'Last;
+ Name_Index : Positive := Unit_String'First;
+
+ begin
+ To_Mixed (Unit_String);
+
+ -- Replace any embedded sequences of two or more '_' characters
+ -- with a single '.' character. Note that this will leave any
+ -- leading or trailing single '_' characters untouched, but those
+ -- should normally not occur in compilation unit names (and if
+ -- they do then it's better to leave them as is).
+
+ while Name_Index <= Name_Last loop
+ if Unit_String (Name_Index) = '_'
+ and then Name_Index /= Name_Last
+ and then Unit_String (Name_Index + 1) = '_'
+ then
+ Unit_String (Name_Index) := '.';
+ Name_Index := Name_Index + 1;
+
+ while Unit_String (Name_Index) = '_'
+ and then Name_Index <= Name_Last
+ loop
+ Unit_String (Name_Index .. Name_Last - 1)
+ := Unit_String (Name_Index + 1 .. Name_Last);
+ Name_Last := Name_Last - 1;
+ end loop;
+
+ else
+ Name_Index := Name_Index + 1;
+ end if;
+ end loop;
+
+ return Unit_String (Unit_String'First .. Name_Last);
+ end Source_Id_String;
+
+ -- This version of Source_Id_String is obsolescent and is being
+ -- replaced with the above function.
+
+ function Source_Id_String (Sloc : Source_Ptr) return String is
+ File_Index : Source_File_Index;
+
+ begin
+ -- Use an arbitrary artificial 22-character value for package Standard,
+ -- since Standard doesn't have an associated source file.
+
+ if Sloc <= Standard_Location then
+ return "20010101010101standard";
+
+ -- Return the concatentation of the source file's timestamp and
+ -- its 8-digit hex checksum.
+
+ else
+ File_Index := Get_Source_File_Index (Sloc);
+
+ return String (Time_Stamp (File_Index))
+ & Get_Hex_String (Source_Checksum (File_Index));
+ end if;
+ end Source_Id_String;
+
+ ---------------
+ -- Source_Id --
+ ---------------
+
+ function Source_Id (Unit_Name : Name_Id) return String_Id is
+ begin
+ return New_String_Id (Source_Id_String (Unit_Name));
+ end Source_Id;
+
+ -- This version of Source_Id is obsolescent and is being
+ -- replaced with the above function.
+
+ function Source_Id (Sloc : Source_Ptr) return String_Id is
+ begin
+ return New_String_Id (Source_Id_String (Sloc));
+ end Source_Id;
+
+ -----------
+ -- Image --
+ -----------
+
+ function Image (I : Int) return String is
+ Image_String : constant String := Pos'Image (I);
+ begin
+ if Image_String (1) = ' ' then
+ return Image_String (2 .. Image_String'Last);
+ else
+ return Image_String;
+ end if;
+ end Image;
+
+ --------------
+ -- UI_Image --
+ --------------
+
+ function UI_Image (I : Uint; Format : Integer_Image_Format) return String is
+ begin
+ if Format = Decimal then
+ UI_Image (I, Format => Decimal);
+ return UI_Image_Buffer (1 .. UI_Image_Length);
+
+ elsif Format = Ada_Hex then
+ UI_Image (I, Format => Hex);
+ return UI_Image_Buffer (1 .. UI_Image_Length);
+
+ else
+ pragma Assert (I >= Uint_0);
+
+ UI_Image (I, Format => Hex);
+
+ pragma Assert (UI_Image_Buffer (1 .. 3) = "16#"
+ and then UI_Image_Buffer (UI_Image_Length) = '#');
+
+ -- Declare a string where we will copy the digits from the UI_Image,
+ -- interspersing '_' characters as 4-digit group separators. The
+ -- underscores in UI_Image's result are not always at the places
+ -- where we want them, which is why we do the following copy
+ -- (e.g., we map "16#ABCD_EF#" to "^AB_CDEF^").
+
+ declare
+ Hex_String : String (1 .. UI_Image_Max);
+ Last_Index : Natural;
+ Digit_Count : Natural := 0;
+ UI_Image_Index : Natural := 4; -- Skip past the "16#" bracket
+ Sep_Count : Natural := 0;
+
+ begin
+ -- Count up the number of non-underscore characters in the
+ -- literal value portion of the UI_Image string.
+
+ while UI_Image_Buffer (UI_Image_Index) /= '#' loop
+ if UI_Image_Buffer (UI_Image_Index) /= '_' then
+ Digit_Count := Digit_Count + 1;
+ end if;
+
+ UI_Image_Index := UI_Image_Index + 1;
+ end loop;
+
+ UI_Image_Index := 4; -- Reset the index past the "16#" bracket
+
+ Last_Index := 1;
+
+ Hex_String (Last_Index) := '^';
+ Last_Index := Last_Index + 1;
+
+ -- Copy digits from UI_Image_Buffer to Hex_String, adding
+ -- underscore separators as appropriate. The initial value
+ -- of Sep_Count accounts for the leading '^' and being one
+ -- character ahead after inserting a digit.
+
+ Sep_Count := 2;
+
+ while UI_Image_Buffer (UI_Image_Index) /= '#' loop
+ if UI_Image_Buffer (UI_Image_Index) /= '_' then
+ Hex_String (Last_Index) := UI_Image_Buffer (UI_Image_Index);
+
+ Last_Index := Last_Index + 1;
+
+ -- Add '_' characters to separate groups of four hex
+ -- digits for readability (grouping from right to left).
+
+ if (Digit_Count - (Last_Index - Sep_Count)) mod 4 = 0 then
+ Hex_String (Last_Index) := '_';
+ Last_Index := Last_Index + 1;
+ Sep_Count := Sep_Count + 1;
+ end if;
+ end if;
+
+ UI_Image_Index := UI_Image_Index + 1;
+ end loop;
+
+ -- Back up before any trailing underscore
+
+ if Hex_String (Last_Index - 1) = '_' then
+ Last_Index := Last_Index - 1;
+ end if;
+
+ Hex_String (Last_Index) := '^';
+
+ return Hex_String (1 .. Last_Index);
+ end;
+ end if;
+ end UI_Image;
+
+ --------------
+ -- UR_Image --
+ --------------
+
+ -- Shouldn't this be added to Urealp???
+
+ function UR_Image (R : Ureal) return String is
+
+ -- The algorithm used here for conversion of Ureal values
+ -- is taken from the JGNAT back end.
+
+ Num : Long_Long_Float := 0.0;
+ Den : Long_Long_Float := 0.0;
+ Sign : Long_Long_Float := 1.0;
+ Result : Long_Long_Float;
+ Tmp : Uint;
+ Index : Integer;
+
+ begin
+ if UR_Is_Negative (R) then
+ Sign := -1.0;
+ end if;
+
+ -- In the following calculus, we consider numbers modulo 2 ** 31,
+ -- so that we don't have problems with signed Int...
+
+ Tmp := abs (Numerator (R));
+ Index := 0;
+ while Tmp > 0 loop
+ Num := Num
+ + Long_Long_Float (UI_To_Int (Tmp mod (Uint_2 ** 31)))
+ * (2.0 ** Index);
+ Tmp := Tmp / Uint_2 ** 31;
+ Index := Index + 31;
+ end loop;
+
+ Tmp := abs (Denominator (R));
+ if Rbase (R) /= 0 then
+ Tmp := Rbase (R) ** Tmp;
+ end if;
+
+ Index := 0;
+ while Tmp > 0 loop
+ Den := Den
+ + Long_Long_Float (UI_To_Int (Tmp mod (Uint_2 ** 31)))
+ * (2.0 ** Index);
+ Tmp := Tmp / Uint_2 ** 31;
+ Index := Index + 31;
+ end loop;
+
+ -- If the denominator denotes a negative power of Rbase,
+ -- then multiply by the denominator.
+
+ if Rbase (R) /= 0 and then Denominator (R) < 0 then
+ Result := Sign * Num * Den;
+
+ -- Otherwise compute the quotient
+
+ else
+ Result := Sign * Num / Den;
+ end if;
+
+ return Long_Long_Float'Image (Result);
+ end UR_Image;
+
+end AA_Util;
diff --git a/gcc/ada/aa_util.ads b/gcc/ada/aa_util.ads
new file mode 100644
index 00000000000..27b6183248e
--- /dev/null
+++ b/gcc/ada/aa_util.ads
@@ -0,0 +1,145 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAAMP COMPILER COMPONENTS --
+-- --
+-- A A _ U T I L --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2001-2011, 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- --
+-- 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. --
+-- --
+------------------------------------------------------------------------------
+
+-- This package provides various utility operations used by GNAT back-ends
+-- (e.g. AAMP).
+
+-- This package is a messy grab bag of stuff. These routines should be moved
+-- to appropriate units (sem_util,sem_aux,exp_util,namet,uintp,urealp). ???
+
+with Namet; use Namet;
+with Types; use Types;
+with Uintp; use Uintp;
+with Urealp; use Urealp;
+
+package AA_Util is
+
+ function Is_Global_Entity (E : Entity_Id) return Boolean;
+ -- Returns true if and only if E is a library-level entity (excludes
+ -- entities declared within blocks at the outer level of library packages).
+
+ function New_Name_Id (Name : String) return Name_Id;
+ -- Returns a Name_Id corresponding to the given name string
+
+ function Name_String (Name : Name_Id) return String;
+ -- Returns the name string associated with Name
+
+ function New_String_Id (S : String) return String_Id;
+ -- Returns a String_Id corresponding to the given string
+
+ function String_Value (Str_Id : String_Id) return String;
+ -- Returns the string associated with Str_Id
+
+ -- Name-generation utilities
+
+ type Name_Sequencer is private;
+ -- This type is used to support back-end generation of unique symbol
+ -- (e.g., for string literal objects or labels). By declaring an
+ -- aliased object of type Name_Sequence and passing that object
+ -- to the function Next_Name, a series of names with suffixes
+ -- of the form "__n" will be produced, where n is a string denoting
+ -- a positive integer. The sequence starts with "__1", and increases
+ -- by one on each successive call to Next_Name for a given Name_Sequencer.
+
+ function Next_Name
+ (Name_Seq : not null access Name_Sequencer;
+ Name_Prefix : String) return Name_Id;
+ -- Returns the Name_Id for a name composed of the given Name_Prefix
+ -- concatentated with a unique number suffix of the form "__n",
+ -- as detemined by the current state of Name_Seq.
+
+ function Elab_Spec_Name (Module_Name : Name_Id) return Name_Id;
+ -- Returns a name id for the elaboration subprogram to be associated with
+ -- the specification of the named module. The denoted name is of the form
+ -- "modulename___elabs".
+
+ function Elab_Body_Name (Module_Name : Name_Id) return Name_Id;
+ -- Returns a name id for the elaboration subprogram to be associated
+ -- with the body of the named module. The denoted name is of the form
+ -- "modulename___elabb".
+
+ function File_Name_Without_Suffix (File_Name : String) return String;
+ -- Removes the suffix ('.' followed by other characters), if present, from
+ -- the end of File_Name and returns the shortened name (otherwise simply
+ -- returns File_Name).
+
+ function Source_Name (Sloc : Source_Ptr) return File_Name_Type;
+ -- Returns file name corresponding to the source file name associated with
+ -- the given source position Sloc.
+
+ function Source_Name_Without_Suffix (Sloc : Source_Ptr) return String;
+ -- Returns a string corresponding to the source file name associated with
+ -- the given source position Sloc, with its dot-preceded suffix, if any,
+ -- removed. As examples, the name "main.adb" is mapped to "main" and the
+ -- name "main.2.ada" is mapped to "main.2". As a special case, file names
+ -- with a ".dg" suffix will also strip off the ".dg", so "main.adb.dg"
+ -- becomes simply "main".
+
+ function Source_Id_String (Unit_Name : Name_Id) return String;
+ -- Returns a string that uniquely identifies the unit with the given
+ -- Unit_Name. This string is derived from Unit_Name by replacing any
+ -- multiple underscores with dot ('.') characters and normalizing the
+ -- casing to mixed case (e.g., "ada__strings" is mapped to ("Ada.Strings").
+
+ function Source_Id (Unit_Name : Name_Id) return String_Id;
+ -- Returns a String_Id reference to a string that uniquely identifies
+ -- the program unit having the given name (as defined for function
+ -- Source_Id_String).
+
+ function Source_Id_String (Sloc : Source_Ptr) return String;
+ -- Returns a string that uniquely identifies the source file containing
+ -- the given source location. This string is constructed from the
+ -- concatentation of the date and time stamp of the file with a
+ -- hexadecimal check sum (e.g., "020425143059ABCDEF01").
+
+ function Source_Id (Sloc : Source_Ptr) return String_Id;
+ -- Returns a String_Id reference to a string that uniquely identifies the
+ -- source file containing the given source location (as defined for
+ -- function Source_Id_String).
+
+ function Image (I : Int) return String;
+ -- Returns Int'Image (I), but without a leading space in the case where
+ -- I is nonnegative. Useful for concatenating integers onto other names.
+
+ type Integer_Image_Format is (Decimal, Ada_Hex, AAMP_Hex);
+
+ function UI_Image (I : Uint; Format : Integer_Image_Format) return String;
+ -- Returns the image of the universal integer I, with no leading spaces
+ -- and in the format specified. The Format parameter specifies whether
+ -- the integer representation should be decimal (the default), or Ada
+ -- hexadecimal (Ada_Hex => "16#xxxxx#" format), or AAMP hexadecimal.
+ -- In the latter case, the integer will have the form of a sequence of
+ -- hexadecimal digits bracketed by '^' characters, and will contain '_'
+ -- characters as separators for groups of four hexadecimal digits
+ -- (e.g., ^1C_A3CD^). If the format AAMP_Hex is selected, the universal
+ -- integer must have a nonnegative value.
+
+ function UR_Image (R : Ureal) return String;
+ -- Returns a decimal image of the universal real value R
+
+private
+
+ type Name_Sequencer is record
+ Sequence_Number : Natural := 0;
+ end record;
+
+end AA_Util;
diff --git a/gcc/ada/adabkend.adb b/gcc/ada/adabkend.adb
new file mode 100644
index 00000000000..96bd00d99df
--- /dev/null
+++ b/gcc/ada/adabkend.adb
@@ -0,0 +1,282 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAAMP COMPILER COMPONENTS --
+-- --
+-- A D A B K E N D --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2001-2011, 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- --
+-- 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. --
+-- --
+------------------------------------------------------------------------------
+
+-- This is the version of the Back_End package for back ends written in Ada
+
+with Debug;
+with Lib;
+with Opt; use Opt;
+with Output; use Output;
+with Osint; use Osint;
+with Osint.C; use Osint.C;
+with Switch.C; use Switch.C;
+with Types; use Types;
+
+with System.OS_Lib; use System.OS_Lib;
+
+package body Adabkend is
+
+ use Switch;
+
+ -------------------
+ -- Call_Back_End --
+ -------------------
+
+ procedure Call_Back_End is
+ begin
+ if (Opt.Verbose_Mode or Opt.Full_List)
+ and then not Debug.Debug_Flag_7
+ then
+ Write_Eol;
+ Write_Str (Product_Name);
+ Write_Str (", Copyright ");
+ Write_Str (Copyright_Years);
+ Write_Str (" Ada Core Technologies, Inc.");
+ Write_Str (" (http://www.adacore.com)");
+ Write_Eol;
+ Write_Eol;
+ end if;
+
+ Driver (Lib.Cunit (Types.Main_Unit));
+ end Call_Back_End;
+
+ ------------------------
+ -- Scan_Compiler_Args --
+ ------------------------
+
+ procedure Scan_Compiler_Arguments is
+ Output_File_Name_Seen : Boolean := False;
+ -- Set to True after having scanned the file_name for switch
+ -- "-gnatO file_name"
+
+ Argument_Count : constant Integer := Arg_Count - 1;
+ -- Number of arguments (excluding program name)
+
+ Args : Argument_List (1 .. Argument_Count);
+ Next_Arg : Positive := 1;
+
+ procedure Scan_Back_End_Switches (Switch_Chars : String);
+ -- Procedure to scan out switches stored in Switch_Chars. The first
+ -- character is known to be a valid switch character, and there are no
+ -- blanks or other switch terminator characters in the string, so the
+ -- entire string should consist of valid switch characters, except that
+ -- an optional terminating NUL character is allowed.
+ --
+ -- If the switch is not valid, control will not return. The switches
+ -- must still be scanned to skip the "-o" arguments, or internal GCC
+ -- switches, which may be safely ignored by other back-ends.
+
+ ----------------------------
+ -- Scan_Back_End_Switches --
+ ----------------------------
+
+ procedure Scan_Back_End_Switches (Switch_Chars : String) is
+ First : constant Positive := Switch_Chars'First + 1;
+ Last : constant Natural := Switch_Last (Switch_Chars);
+
+ begin
+ -- Process any back end switches, returning if the switch does not
+ -- affect code generation or falling through if it does, so the
+ -- switch will get stored.
+
+ if Is_Internal_GCC_Switch (Switch_Chars) then
+ Next_Arg := Next_Arg + 1;
+ return; -- ignore this switch
+
+ -- Record that an object file name has been specified. The actual
+ -- file name argument is picked up and saved below by the main body
+ -- of Scan_Compiler_Arguments.
+
+ elsif Switch_Chars (First .. Last) = "o" then
+ if First = Last then
+ Opt.Output_File_Name_Present := True;
+ return;
+ else
+ Fail ("invalid switch: " & Switch_Chars);
+ end if;
+
+ -- Set optimization indicators appropriately. In gcc-based GNAT this
+ -- is picked up from imported variables set by the gcc driver, but
+ -- for compilers with non-gcc back ends we do it here to allow use
+ -- of these switches by the front end. Allowed optimization switches
+ -- are -Os (optimize for size), -O[0123], and -O (same as -O1).
+
+ elsif Switch_Chars (First) = 'O' then
+ if First = Last then
+ Optimization_Level := 1;
+
+ elsif Last - First = 1 then
+ if Switch_Chars (Last) = 's' then
+ Optimize_Size := 1;
+ Optimization_Level := 2; -- Consistent with gcc setting
+
+ elsif Switch_Chars (Last) in '0' .. '3' then
+ Optimization_Level :=
+ Character'Pos (Switch_Chars (Last)) - Character'Pos ('0');
+
+ else
+ Fail ("invalid switch: " & Switch_Chars);
+ end if;
+
+ else
+ Fail ("invalid switch: " & Switch_Chars);
+ end if;
+
+ elsif Switch_Chars (First .. Last) = "quiet" then
+ return; -- ignore this switch
+
+ elsif Switch_Chars (First .. Last) = "c" then
+ return; -- ignore this switch
+
+ -- The -x switch and its language name argument will generally be
+ -- ignored by non-gcc back ends (e.g. the GNAAMP back end). In any
+ -- case, we save the switch and argument in the compilation switches.
+
+ elsif Switch_Chars (First .. Last) = "x" then
+ Lib.Store_Compilation_Switch (Switch_Chars);
+ Next_Arg := Next_Arg + 1;
+
+ declare
+ Argv : constant String := Args (Next_Arg).all;
+
+ begin
+ if Is_Switch (Argv) then
+ Fail ("language name missing after -x");
+ else
+ Lib.Store_Compilation_Switch (Argv);
+ end if;
+ end;
+
+ return;
+
+ -- Special check, the back end switch -fno-inline also sets the
+ -- front end flag to entirely inhibit all inlining. So we store it
+ -- and set the appropriate flag.
+
+ elsif Switch_Chars (First .. Last) = "fno-inline" then
+ Lib.Store_Compilation_Switch (Switch_Chars);
+ Opt.Suppress_All_Inlining := True;
+ return;
+
+ -- Similar processing for -fpreserve-control-flow
+
+ elsif Switch_Chars (First .. Last) = "fpreserve-control-flow" then
+ Lib.Store_Compilation_Switch (Switch_Chars);
+ Opt.Suppress_Control_Flow_Optimizations := True;
+ return;
+
+ -- Ignore all other back end switches
+
+ elsif Is_Back_End_Switch (Switch_Chars) then
+ null;
+
+ -- Give error for junk switch
+
+ else
+ Fail ("invalid switch: " & Switch_Chars);
+ end if;
+
+ -- Store any other GCC switches
+
+ Lib.Store_Compilation_Switch (Switch_Chars);
+ end Scan_Back_End_Switches;
+
+ -- Start of processing for Scan_Compiler_Args
+
+ begin
+ -- Put all the arguments in argument list Args
+
+ for Arg in 1 .. Argument_Count loop
+ declare
+ Argv : String (1 .. Len_Arg (Arg));
+ begin
+ Fill_Arg (Argv'Address, Arg);
+ Args (Arg) := new String'(Argv);
+ end;
+ end loop;
+
+ -- Loop through command line arguments, storing them for later access
+
+ while Next_Arg <= Argument_Count loop
+ Look_At_Arg : declare
+ Argv : constant String := Args (Next_Arg).all;
+
+ begin
+ if Argv'Length = 0 then
+ Fail ("Empty argument");
+ end if;
+
+ -- If the previous switch has set the Output_File_Name_Present
+ -- flag (that is we have seen a -gnatO), then the next argument
+ -- is the name of the output object file.
+
+ if Opt.Output_File_Name_Present
+ and then not Output_File_Name_Seen
+ then
+ if Is_Switch (Argv) then
+ Fail ("Object file name missing after -gnatO");
+ else
+ Set_Output_Object_File_Name (Argv);
+ Output_File_Name_Seen := True;
+ end if;
+
+ -- If the previous switch has set the Search_Directory_Present
+ -- flag (that is if we have just seen -I), then the next
+ -- argument is a search directory path.
+
+ elsif Search_Directory_Present then
+ if Is_Switch (Argv) then
+ Fail ("search directory missing after -I");
+ else
+ Add_Src_Search_Dir (Argv);
+
+ -- Add directory to lib search so that back-end can take as
+ -- input ALI files if needed. Otherwise this won't have any
+ -- impact on the compiler.
+
+ Add_Lib_Search_Dir (Argv);
+
+ Search_Directory_Present := False;
+ end if;
+
+ -- If not a switch, must be a file name
+
+ elsif not Is_Switch (Argv) then
+ Add_File (Argv);
+
+ -- Front end switch
+
+ elsif Is_Front_End_Switch (Argv) then
+ Scan_Front_End_Switches (Argv, Args, Next_Arg);
+
+ -- All non-front-end switches are back-end switches
+
+ else
+ Scan_Back_End_Switches (Argv);
+ end if;
+ end Look_At_Arg;
+
+ Next_Arg := Next_Arg + 1;
+ end loop;
+ end Scan_Compiler_Arguments;
+
+end Adabkend;
diff --git a/gcc/ada/adabkend.ads b/gcc/ada/adabkend.ads
new file mode 100644
index 00000000000..877422c949e
--- /dev/null
+++ b/gcc/ada/adabkend.ads
@@ -0,0 +1,52 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- A D A B K E N D --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 1992-2012, 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. --
+-- --
+------------------------------------------------------------------------------
+
+-- Generic package implementing the common parts of back_end.adb for back ends
+-- written in Ada, thereby reducing code duplication.
+
+with Types;
+
+generic
+ Product_Name : String;
+ Copyright_Years : String;
+
+ with procedure Driver (Root : Types.Node_Id);
+ -- Main driver procedure for back end
+
+ with function Is_Back_End_Switch (Switch : String) return Boolean;
+ -- Back-end specific function to determine validity of switches
+
+package Adabkend is
+
+ procedure Call_Back_End;
+ -- Call back end, i.e. make call to the Driver passing the root
+ -- node for this compilation unit.
+
+ procedure Scan_Compiler_Arguments;
+ -- Acquires command-line parameters passed to the compiler and processes
+ -- them. Calls Scan_Front_End_Switches for any front-end switches
+ -- encountered. See spec of Back_End for more details.
+
+end Adabkend;
diff --git a/gcc/ada/ali.adb b/gcc/ada/ali.adb
index 86ad184de2b..a85fa4bec2f 100644
--- a/gcc/ada/ali.adb
+++ b/gcc/ada/ali.adb
@@ -107,17 +107,18 @@ package body ALI is
-- Initialize global variables recording cumulative options in all
-- ALI files that are read for a given processing run in gnatbind.
- Dynamic_Elaboration_Checks_Specified := False;
- Float_Format_Specified := ' ';
- Locking_Policy_Specified := ' ';
- No_Normalize_Scalars_Specified := False;
- No_Object_Specified := False;
- Normalize_Scalars_Specified := False;
- Queuing_Policy_Specified := ' ';
- Static_Elaboration_Model_Used := False;
- Task_Dispatching_Policy_Specified := ' ';
- Unreserve_All_Interrupts_Specified := False;
- Zero_Cost_Exceptions_Specified := False;
+ Dynamic_Elaboration_Checks_Specified := False;
+ Float_Format_Specified := ' ';
+ Locking_Policy_Specified := ' ';
+ No_Normalize_Scalars_Specified := False;
+ No_Object_Specified := False;
+ Normalize_Scalars_Specified := False;
+ Partition_Elaboration_Policy_Specified := ' ';
+ Queuing_Policy_Specified := ' ';
+ Static_Elaboration_Model_Used := False;
+ Task_Dispatching_Policy_Specified := ' ';
+ Unreserve_All_Interrupts_Specified := False;
+ Zero_Cost_Exceptions_Specified := False;
end Initialize_ALI;
--------------
@@ -813,36 +814,37 @@ package body ALI is
Set_Name_Table_Info (F, Int (Id));
ALIs.Table (Id) := (
- Afile => F,
- Compile_Errors => False,
- First_Interrupt_State => Interrupt_States.Last + 1,
- First_Sdep => No_Sdep_Id,
- First_Specific_Dispatching => Specific_Dispatching.Last + 1,
- First_Unit => No_Unit_Id,
- Float_Format => 'I',
- Last_Interrupt_State => Interrupt_States.Last,
- Last_Sdep => No_Sdep_Id,
- Last_Specific_Dispatching => Specific_Dispatching.Last,
- Last_Unit => No_Unit_Id,
- Locking_Policy => ' ',
- Main_Priority => -1,
- Main_CPU => -1,
- Main_Program => None,
- No_Object => False,
- Normalize_Scalars => False,
- Ofile_Full_Name => Full_Object_File_Name,
- Queuing_Policy => ' ',
- Restrictions => No_Restrictions,
- SAL_Interface => False,
- Sfile => No_File,
- Task_Dispatching_Policy => ' ',
- Time_Slice_Value => -1,
- Allocator_In_Body => False,
- WC_Encoding => 'b',
- Unit_Exception_Table => False,
- Ver => (others => ' '),
- Ver_Len => 0,
- Zero_Cost_Exceptions => False);
+ Afile => F,
+ Compile_Errors => False,
+ First_Interrupt_State => Interrupt_States.Last + 1,
+ First_Sdep => No_Sdep_Id,
+ First_Specific_Dispatching => Specific_Dispatching.Last + 1,
+ First_Unit => No_Unit_Id,
+ Float_Format => 'I',
+ Last_Interrupt_State => Interrupt_States.Last,
+ Last_Sdep => No_Sdep_Id,
+ Last_Specific_Dispatching => Specific_Dispatching.Last,
+ Last_Unit => No_Unit_Id,
+ Locking_Policy => ' ',
+ Main_Priority => -1,
+ Main_CPU => -1,
+ Main_Program => None,
+ No_Object => False,
+ Normalize_Scalars => False,
+ Ofile_Full_Name => Full_Object_File_Name,
+ Partition_Elaboration_Policy => ' ',
+ Queuing_Policy => ' ',
+ Restrictions => No_Restrictions,
+ SAL_Interface => False,
+ Sfile => No_File,
+ Task_Dispatching_Policy => ' ',
+ Time_Slice_Value => -1,
+ Allocator_In_Body => False,
+ WC_Encoding => 'b',
+ Unit_Exception_Table => False,
+ Ver => (others => ' '),
+ Ver_Len => 0,
+ Zero_Cost_Exceptions => False);
-- Now we acquire the input lines from the ALI file. Note that the
-- convention in the following code is that as we enter each section,
@@ -1027,6 +1029,13 @@ package body ALI is
Checkc ('B');
Detect_Blocking := True;
+ -- Processing for Ex
+
+ elsif C = 'E' then
+ Partition_Elaboration_Policy_Specified := Getc;
+ ALIs.Table (Id).Partition_Elaboration_Policy :=
+ Partition_Elaboration_Policy_Specified;
+
-- Processing for FD/FG/FI
elsif C = 'F' then
diff --git a/gcc/ada/ali.ads b/gcc/ada/ali.ads
index 39943c4fcc7..2c800e73283 100644
--- a/gcc/ada/ali.ads
+++ b/gcc/ada/ali.ads
@@ -156,6 +156,12 @@ package ALI is
-- this is a language defined unit. Otherwise set to first character
-- (upper case) of policy name. Not set if 'P' appears in Ignore_Lines.
+ Partition_Elaboration_Policy : Character;
+ -- Indicates partition elaboration policy for units in this file. Space
+ -- means that no Partition_Elaboration_Policy pragma was present or that
+ -- this is a language defined unit. Otherwise set to first character
+ -- (upper case) of policy name. Not set if 'P' appears in Ignore_Lines.
+
Queuing_Policy : Character;
-- Indicates queuing policy for units in this file. Space means tasking
-- was not used, or that no Queuing_Policy pragma was present or that
@@ -485,6 +491,11 @@ package ALI is
-- Set to False by Initialize_ALI. Set to True if an ali file indicates
-- that the file was compiled in Normalize_Scalars mode.
+ Partition_Elaboration_Policy_Specified : Character := ' ';
+ -- Set to blank by Initialize_ALI. Set to the appropriate partition
+ -- elaboration policy character if an ali file contains a P line setting
+ -- the policy.
+
Queuing_Policy_Specified : Character := ' ';
-- Set to blank by Initialize_ALI. Set to the appropriate queuing policy
-- character if an ali file contains a P line setting the queuing policy.
diff --git a/gcc/ada/aspects.adb b/gcc/ada/aspects.adb
index 6605b7185ca..880ee244578 100644
--- a/gcc/ada/aspects.adb
+++ b/gcc/ada/aspects.adb
@@ -275,7 +275,7 @@ package body Aspects is
Aspect_Inline_Always => Aspect_Inline,
Aspect_Input => Aspect_Input,
Aspect_Interrupt_Handler => Aspect_Interrupt_Handler,
- Aspect_Interrupt_Priority => Aspect_Interrupt_Priority,
+ Aspect_Interrupt_Priority => Aspect_Priority,
Aspect_Invariant => Aspect_Invariant,
Aspect_Iterator_Element => Aspect_Iterator_Element,
Aspect_Link_Name => Aspect_Link_Name,
diff --git a/gcc/ada/atree.ads b/gcc/ada/atree.ads
index c0568ba5c77..305ef9f3978 100644
--- a/gcc/ada/atree.ads
+++ b/gcc/ada/atree.ads
@@ -767,7 +767,7 @@ package Atree is
-- Note that this routine is very rarely used, since usually the
-- default mechanism provided sets the right value, but in some
-- unusual cases, the value needs to be reset (e.g. when a source
- -- node is copied, and the copy must not have Comes_From_Source set.
+ -- node is copied, and the copy must not have Comes_From_Source set).
procedure Set_Has_Aspects (N : Node_Id; Val : Boolean := True);
pragma Inline (Set_Has_Aspects);
diff --git a/gcc/ada/bcheck.adb b/gcc/ada/bcheck.adb
index 2efe6da9d6e..09354ecbcbb 100644
--- a/gcc/ada/bcheck.adb
+++ b/gcc/ada/bcheck.adb
@@ -52,6 +52,7 @@ package body Bcheck is
procedure Check_Consistent_Locking_Policy;
procedure Check_Consistent_Normalize_Scalars;
procedure Check_Consistent_Optimize_Alignment;
+ procedure Check_Consistent_Partition_Elaboration_Policy;
procedure Check_Consistent_Queuing_Policy;
procedure Check_Consistent_Restrictions;
procedure Check_Consistent_Restriction_No_Default_Initialization;
@@ -83,6 +84,10 @@ package body Bcheck is
Check_Consistent_Locking_Policy;
end if;
+ if Partition_Elaboration_Policy_Specified /= ' ' then
+ Check_Consistent_Partition_Elaboration_Policy;
+ end if;
+
if Zero_Cost_Exceptions_Specified then
Check_Consistent_Zero_Cost_Exception_Handling;
end if;
@@ -744,6 +749,59 @@ package body Bcheck is
end loop;
end Check_Consistent_Optimize_Alignment;
+ ---------------------------------------------------
+ -- Check_Consistent_Partition_Elaboration_Policy --
+ ---------------------------------------------------
+
+ -- The rule is that all files for which the partition elaboration policy is
+ -- significant must be compiled with the same setting.
+
+ procedure Check_Consistent_Partition_Elaboration_Policy is
+ begin
+ -- First search for a unit specifying a policy and then
+ -- check all remaining units against it.
+
+ Find_Policy : for A1 in ALIs.First .. ALIs.Last loop
+ if ALIs.Table (A1).Partition_Elaboration_Policy /= ' ' then
+ Check_Policy : declare
+ Policy : constant Character :=
+ ALIs.Table (A1).Partition_Elaboration_Policy;
+
+ begin
+ for A2 in A1 + 1 .. ALIs.Last loop
+ if ALIs.Table (A2).Partition_Elaboration_Policy /= ' '
+ and then
+ ALIs.Table (A2).Partition_Elaboration_Policy /= Policy
+ then
+ Error_Msg_File_1 := ALIs.Table (A1).Sfile;
+ Error_Msg_File_2 := ALIs.Table (A2).Sfile;
+
+ Consistency_Error_Msg
+ ("{ and { compiled with different partition "
+ & "elaboration policies");
+ exit Find_Policy;
+ end if;
+ end loop;
+ end Check_Policy;
+
+ -- A No_Task_Hierarchy restriction must be specified for the
+ -- Sequential policy (RM H.6(6/2)).
+
+ if Partition_Elaboration_Policy_Specified = 'S'
+ and then not Cumulative_Restrictions.Set (No_Task_Hierarchy)
+ then
+ Error_Msg_File_1 := ALIs.Table (A1).Sfile;
+ Error_Msg
+ ("{ has sequential partition elaboration policy, but no");
+ Error_Msg
+ ("pragma Restrictions (No_Task_Hierarchy) was specified");
+ end if;
+
+ exit Find_Policy;
+ end if;
+ end loop Find_Policy;
+ end Check_Consistent_Partition_Elaboration_Policy;
+
-------------------------------------
-- Check_Consistent_Queuing_Policy --
-------------------------------------
diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb
index bb5a0aac906..e178a57a21b 100644
--- a/gcc/ada/bindgen.adb
+++ b/gcc/ada/bindgen.adb
@@ -63,20 +63,26 @@ package body Bindgen is
Num_Elab_Calls : Nat := 0;
-- Number of generated calls to elaboration routines
- System_Restrictions_Used : Boolean;
+ System_Restrictions_Used : Boolean := False;
-- Flag indicating whether the unit System.Restrictions is in the closure
- -- of the partition. This is set by Check_System_Restrictions_Used, and
- -- is used to determine whether or not to initialize the restrictions
- -- information in the body of the binder generated file (we do not want
- -- to do this unconditionally, since it drags in the System.Restrictions
- -- unit unconditionally, which is unpleasand, especially for ZFP etc.)
+ -- of the partition. This is set by Resolve_Binder_Options, and is used
+ -- to determine whether or not to initialize the restrictions information
+ -- in the body of the binder generated file (we do not want to do this
+ -- unconditionally, since it drags in the System.Restrictions unit
+ -- unconditionally, which is unpleasand, especially for ZFP etc.)
- Dispatching_Domains_Used : Boolean;
+ Dispatching_Domains_Used : Boolean := False;
-- Flag indicating whether multiprocessor dispatching domains are used in
- -- the closure of the partition. This is set by
- -- Check_Dispatching_Domains_Used, and is used to call the routine to
- -- disallow the creation of new dispatching domains just before calling
- -- the main procedure from the environment task.
+ -- the closure of the partition. This is set by Resolve_Binder_Options, and
+ -- is used to call the routine to disallow the creation of new dispatching
+ -- domains just before calling the main procedure from the environment
+ -- task.
+
+ System_Tasking_Restricted_Stages_Used : Boolean := False;
+ -- Flag indicating whether the unit System.Tasking.Restricted.Stages is in
+ -- the closure of the partition. This is set by Resolve_Binder_Options,
+ -- and it used to call a routine to active all the tasks at the end of
+ -- the elaboration.
Lib_Final_Built : Boolean := False;
-- Flag indicating whether the finalize_library rountine has been built
@@ -236,21 +242,6 @@ package body Bindgen is
-- Local Subprograms --
-----------------------
- procedure Check_File_In_Partition
- (File_Name : String;
- Flag : out Boolean);
- -- If the file indicated by File_Name is in the partition the Flag is set
- -- to True, False otherwise.
-
- procedure Check_System_Restrictions_Used;
- -- Sets flag System_Restrictions_Used (Set to True if and only if the unit
- -- System.Restrictions is present in the partition, otherwise False).
-
- procedure Check_Dispatching_Domains_Used;
- -- Sets flag Dispatching_Domains_Used to True when using the unit
- -- System.Multiprocessors.Dispatching_Domains is present in the partition,
- -- otherwise set to False.
-
procedure Gen_Adainit;
-- Generates the Adainit procedure
@@ -385,43 +376,6 @@ package body Bindgen is
-- First writes its argument (using Set_String (S)), then writes out the
-- contents of statement buffer up to Last, and reset Last to 0
- ------------------------------------
- -- Check_Dispatching_Domains_Used --
- ------------------------------------
-
- procedure Check_Dispatching_Domains_Used is
- begin
- Check_File_In_Partition ("s-mudido.ads", Dispatching_Domains_Used);
- end Check_Dispatching_Domains_Used;
-
- -----------------------------
- -- Check_File_In_Partition --
- -----------------------------
-
- procedure Check_File_In_Partition
- (File_Name : String;
- Flag : out Boolean)
- is
- begin
- for J in Units.First .. Units.Last loop
- if Get_Name_String (Units.Table (J).Sfile) = File_Name then
- Flag := True;
- return;
- end if;
- end loop;
-
- Flag := False;
- end Check_File_In_Partition;
-
- ------------------------------------
- -- Check_System_Restrictions_Used --
- ------------------------------------
-
- procedure Check_System_Restrictions_Used is
- begin
- Check_File_In_Partition ("s-restri.ads", System_Restrictions_Used);
- end Check_System_Restrictions_Used;
-
------------------
-- Gen_Adafinal --
------------------
@@ -534,6 +488,12 @@ package body Bindgen is
WBI ("");
end if;
+ if System_Tasking_Restricted_Stages_Used then
+ WBI (" procedure Activate_Tasks;");
+ WBI (" pragma Import (C, Activate_Tasks," &
+ " ""__gnat_activate_tasks"");");
+ end if;
+
WBI (" begin");
if Main_Priority /= No_Main_Priority then
@@ -625,6 +585,14 @@ package body Bindgen is
WBI (" pragma Import (C, Handler_Installed, " &
"""__gnat_handler_installed"");");
+ -- Import task activation procedure for ravenscar
+
+ if System_Tasking_Restricted_Stages_Used then
+ WBI (" procedure Activate_Tasks;");
+ WBI (" pragma Import (C, Activate_Tasks," &
+ " ""__gnat_activate_tasks"");");
+ end if;
+
-- The import of the soft link which performs library-level object
-- finalization is not needed for VM targets; regular Ada is used in
-- that case. For restricted run-time libraries (ZFP and Ravenscar)
@@ -945,6 +913,10 @@ package body Bindgen is
WBI (" Freeze_Dispatching_Domains;");
end if;
+ if System_Tasking_Restricted_Stages_Used then
+ WBI (" Activate_Tasks;");
+ end if;
+
-- Case of main program is CIL function or procedure
if VM_Target = CLI_Target
@@ -2100,9 +2072,6 @@ package body Bindgen is
-- Generate output file in appropriate language
- Check_System_Restrictions_Used;
- Check_Dispatching_Domains_Used;
-
Gen_Output_File_Ada (Filename);
end Gen_Output_File;
@@ -2425,8 +2394,13 @@ package body Bindgen is
-- The B.1 (39) implementation advice says that the adainit/adafinal
-- routines should be idempotent. Generate a flag to ensure that.
+ -- This is not needed if we are suppressing the standard library
+ -- since it would never be referenced.
+
+ if not Suppress_Standard_Library_On_Target then
+ WBI (" Is_Elaborated : Boolean := False;");
+ end if;
- WBI (" Is_Elaborated : Boolean := False;");
WBI ("");
end if;
@@ -2845,24 +2819,59 @@ package body Bindgen is
----------------------------
procedure Resolve_Binder_Options is
+
+ procedure Check_Package (Var : in out Boolean; Name : String);
+ -- Set Var to true iff the current identifier in Namet is Name. Do
+ -- nothing if it doesn't match. This procedure is just an helper to
+ -- avoid to explicitely deal with length.
+
+ -------------------
+ -- Check_Package --
+ -------------------
+
+ procedure Check_Package (Var : in out Boolean; Name : String) is
+ begin
+ if Name_Len = Name'Length
+ and then Name_Buffer (1 .. Name_Len) = Name
+ then
+ Var := True;
+ end if;
+ end Check_Package;
+
+ -- Start of processing for Check_Package
+
begin
for E in Elab_Order.First .. Elab_Order.Last loop
Get_Name_String (Units.Table (Elab_Order.Table (E)).Uname);
-- This is not a perfect approach, but is the current protocol
-- between the run-time and the binder to indicate that tasking is
- -- used: system.os_interface should always be used by any tasking
+ -- used: System.OS_Interface should always be used by any tasking
-- application.
- if Name_Buffer (1 .. 19) = "system.os_interface" then
- With_GNARL := True;
- end if;
+ Check_Package (With_GNARL, "system.os_interface%s");
-- Ditto for declib and the "dec" package
- if OpenVMS_On_Target and then Name_Buffer (1 .. 5) = "dec%s" then
- With_DECGNAT := True;
+ if OpenVMS_On_Target then
+ Check_Package (With_DECGNAT, "dec%s");
end if;
+
+ -- Ditto for the use of restricted tasking
+
+ Check_Package
+ (System_Tasking_Restricted_Stages_Used,
+ "system.tasking.restricted.stages%s");
+
+ -- Ditto for the use of dispatching domains
+
+ Check_Package
+ (Dispatching_Domains_Used,
+ "system.multiprocessors.dispatching_domains%s");
+
+ -- Ditto for the use of restrictions
+
+ Check_Package (System_Restrictions_Used, "system.restrictions%s");
end loop;
end Resolve_Binder_Options;
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index 061f9796f2a..406d292f09e 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -1108,7 +1108,11 @@ package body Checks is
or else Nkind (P) in N_Membership_Test
or else Nkind (P) in N_Op_Compare
- -- We may also be a range operand in a membership test
+ -- This is also true for an alternative in a case expression
+
+ or else Nkind (P) = N_Case_Expression_Alternative
+
+ -- This is also true for a range operand in a membership test
or else (Nkind (P) = N_Range
and then Nkind (Parent (P)) in N_Membership_Test)
@@ -6268,9 +6272,6 @@ package body Checks is
when N_If_Expression | N_Case_Expression =>
return Is_Signed_Integer_Type (Etype (N));
- when N_Case_Expression_Alternative =>
- return Is_Signed_Integer_Type (Etype (Parent (N)));
-
when others =>
return False;
end case;
diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb
index f6f24f9c7bf..02f04bcecdf 100644
--- a/gcc/ada/debug.adb
+++ b/gcc/ada/debug.adb
@@ -139,7 +139,7 @@ package body Debug is
-- d.S Force Optimize_Alignment (Space)
-- d.T Force Optimize_Alignment (Time)
-- d.U Ignore indirect calls for static elaboration
- -- d.V
+ -- d.V Extensions for formal verification
-- d.W Print out debugging information for Walk_Library_Items
-- d.X Use Expression_With_Actions
-- d.Y Do not use Expression_With_Actions
diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads
index bf360161bcf..08fba5a80c9 100644
--- a/gcc/ada/einfo.ads
+++ b/gcc/ada/einfo.ads
@@ -328,7 +328,7 @@ package Einfo is
-- subtype will raise an assert error.
-- Accept_Address (Elist21)
--- Present in entries. If an accept has a statement sequence, then an
+-- Defined in entries. If an accept has a statement sequence, then an
-- address variable is created, which is used to hold the address of the
-- parameters, as passed by the runtime. Accept_Address holds an element
-- list which represents a stack of entities for these address variables.
@@ -337,7 +337,7 @@ package Einfo is
-- statements referencing the same entry.
-- Access_Disp_Table (Elist16) [implementation base type only]
--- Present in E_Record_Type and E_Record_Subtype entities. Set in tagged
+-- Defined in E_Record_Type and E_Record_Subtype entities. Set in tagged
-- types to point to their dispatch tables. The first two entities are
-- associated with the primary dispatch table: 1) primary dispatch table
-- with user-defined primitives 2) primary dispatch table with predefined
@@ -351,7 +351,7 @@ package Einfo is
-- For a non-tagged record, contains No_Elist.
-- Actual_Subtype (Node17)
--- Present in variables, constants, and formal parameters. This is the
+-- Defined in variables, constants, and formal parameters. This is the
-- subtype imposed by the value of the object, as opposed to its nominal
-- subtype, which is imposed by the declaration. The actual subtype
-- differs from the nominal one when the latter is indefinite (as in the
@@ -377,7 +377,7 @@ package Einfo is
-- Note: Gigi references this field in E_Task_Type entities???
-- Address_Taken (Flag104)
--- Present in all entities. Set if the Address or Unrestricted_Access
+-- Defined in all entities. Set if the Address or Unrestricted_Access
-- attribute is applied directly to the entity, i.e. the entity is the
-- entity of the prefix of the attribute reference. Also set if the
-- entity is the second argument of an Asm_Input or Asm_Output attribute,
@@ -390,7 +390,7 @@ package Einfo is
-- that holds value of the Aft attribute for the type.
-- Alias (Node18)
--- Present in overloadable entities (literals, subprograms, entries) and
+-- Defined in overloadable entities (literals, subprograms, entries) and
-- subprograms that cover a primitive operation of an abstract interface
-- (that is, subprograms with the Interface_Alias attribute). In case of
-- overloaded entities it points to the parent subprogram of a derived
@@ -404,7 +404,7 @@ package Einfo is
-- because it hides the implicit one. Alias is always empty for entries.
-- Alignment (Uint14)
--- Present in entities for types and also in constants, variables
+-- Defined in entities for types and also in constants, variables
-- (including exceptions where it refers to the static data allocated for
-- an exception), loop parameters, and formal parameters. This indicates
-- the desired alignment for a type, or the actual alignment for an
@@ -412,7 +412,7 @@ package Einfo is
-- been set yet. The alignment can be set by an explicit alignment
-- clause, or set by the front-end in package Layout, or set by the
-- back-end as part of the back end back-annotation process. The
--- alignment field is also present in E_Exception entities, but there it
+-- alignment field is also defined in E_Exception entities, but there it
-- is used only by the back-end for back annotation.
-- Alignment_Clause (synthesized)
@@ -427,11 +427,11 @@ package Einfo is
-- into an attribute definition clause for this purpose.
-- Associated_Formal_Package (Node12)
--- Present in packages that are the actuals of formal_packages. Points
+-- Defined in packages that are the actuals of formal_packages. Points
-- to the entity in the declaration for the formal package.
-- Associated_Node_For_Itype (Node8)
--- Present in all type and subtype entities. Set non-Empty only for
+-- Defined in all type and subtype entities. Set non-Empty only for
-- Itypes. Set to point to the associated node for the Itype, i.e.
-- the node whose elaboration generated the Itype. This is used for
-- copying trees, to determine whether or not to copy an Itype, and
@@ -448,14 +448,14 @@ package Einfo is
-- creation of a given itype entity.
-- Associated_Storage_Pool (Node22) [root type only]
--- Present in simple and general access type entities. References the
+-- Defined in simple and general access type entities. References the
-- storage pool to be used for the corresponding collection. A value of
--- Empty means that the default pool is to be used. This is present
+-- Empty means that the default pool is to be used. This is defined
-- only in the root type, since derived types must have the same pool
-- as the parent type.
-- Barrier_Function (Node12)
--- Present in protected entries and entry families. This is the
+-- Defined in protected entries and entry families. This is the
-- subprogram declaration for the body of the function that returns
-- the value of the entry barrier.
@@ -471,7 +471,7 @@ package Einfo is
-- the entity unchanged.
-- Block_Node (Node11)
--- Present in block entities. Points to the identifier in the
+-- Defined in block entities. Points to the identifier in the
-- Block_Statement itself. Used when retrieving the block construct
-- for finalization purposes, The block entity has an implicit label
-- declaration in the enclosing declarative part, and has otherwise
@@ -481,16 +481,16 @@ package Einfo is
-- be rewritten, e.g. in the process of removing dead code.
-- Body_Entity (Node19)
--- Present in package and generic package entities, points to the
+-- Defined in package and generic package entities, points to the
-- corresponding package body entity if one is present.
-- Body_Needed_For_SAL (Flag40)
--- Present in package and subprogram entities that are compilation
+-- Defined in package and subprogram entities that are compilation
-- units. Indicates that the source for the body must be included
-- when the unit is part of a standalone library.
-- C_Pass_By_Copy (Flag125) [implementation base type only]
--- Present in record types. Set if a pragma Convention for the record
+-- Defined in record types. Set if a pragma Convention for the record
-- type specifies convention C_Pass_By_Copy. This convention name is
-- treated as identical in all respects to convention C, except that
-- if it is specified for a record type, then the C_Pass_By_Copy flag
@@ -500,7 +500,7 @@ package Einfo is
-- Export pragma).
-- Can_Never_Be_Null (Flag38)
--- This flag is present in all entities, but can only be set in an object
+-- This flag is defined in all entities, but can only be set in an object
-- which can never have a null value. This is set True for constant
-- access values initialized to a non-null value. This is also True for
-- all access parameters in Ada 83 and Ada 95 modes, and for access
@@ -515,7 +515,7 @@ package Einfo is
-- anonymous access type of a controlling formal.
-- Can_Use_Internal_Rep (Flag229) [base type only]
--- Present in Access_Subprogram_Kind nodes. This flag is set by the
+-- Defined in Access_Subprogram_Kind nodes. This flag is set by the
-- front end and used by the back end. False means that the back end
-- must represent the type in the same way as Convention-C types (and
-- other foreign-convention types). On many targets, this means that
@@ -546,7 +546,7 @@ package Einfo is
-- have convention Ada.
-- Chars (Name1)
--- Present in all entities. This field contains an entry into the names
+-- Defined in all entities. This field contains an entry into the names
-- table that has the character string of the identifier, character
-- literal or operator symbol. See Namet for further details. Note that
-- throughout the processing of the front end, this name is the simple
@@ -557,19 +557,19 @@ package Einfo is
-- entities will contain the encoded qualified names.
-- Checks_May_Be_Suppressed (Flag31)
--- Present in all entities. Set if a pragma Suppress or Unsuppress
+-- Defined in all entities. Set if a pragma Suppress or Unsuppress
-- mentions the entity specifically in the second argument. If this
-- flag is set the Global_Entity_Suppress and Local_Entity_Suppress
-- tables must be consulted to determine if there actually is an active
-- Suppress or Unsuppress pragma that applies to the entity.
-- Class_Wide_Type (Node9)
--- Present in all type entities. For a tagged type or subtype, returns
+-- Defined in all type entities. For a tagged type or subtype, returns
-- the corresponding implicitly declared class-wide type. For a
-- class-wide type, returns itself. Set to Empty for non-tagged types.
-- Cloned_Subtype (Node16)
--- Present in E_Record_Subtype and E_Class_Wide_Subtype entities.
+-- Defined in E_Record_Subtype and E_Class_Wide_Subtype entities.
-- Each such entity can either have a Discriminant_Constraint, in
-- which case it represents a distinct type from the base type (and
-- will have a list of components and discrimants in the list headed by
@@ -588,7 +588,7 @@ package Einfo is
--
-- For E_Class_Wide_Subtype, the presence of Equivalent_Type overrides
-- this field. Note that this field ONLY appears in subtype entries, not
--- in type entries, it is not present, and it is an error to reference
+-- in type entries, it is not defined, and it is an error to reference
-- Cloned_Subtype in an E_Record_Type or E_Class_Wide_Type entity.
-- Comes_From_Source
@@ -598,14 +598,14 @@ package Einfo is
-- in the original source program.
-- Component_Alignment (special field) [base type only]
--- Present in array and record entities. Contains a value of type
+-- Defined in array and record entities. Contains a value of type
-- Component_Alignment_Kind indicating the alignment of components.
-- Set to Calign_Default normally, but can be overridden by use of
-- the Component_Alignment pragma. Note: this field is currently
-- stored in a non-standard way, see body for details.
-- Component_Bit_Offset (Uint11)
--- Present in record components (E_Component, E_Discriminant) if a
+-- Defined in record components (E_Component, E_Discriminant) if a
-- component clause applies to the component. First bit position of
-- given component, computed from the first bit and position values
-- given in the component clause. A value of No_Uint means that the
@@ -624,7 +624,7 @@ package Einfo is
-- use in Gigi, to have this redundant field.
-- Component_Clause (Node13)
--- Present in record components and discriminants. If a record
+-- Defined in record components and discriminants. If a record
-- representation clause is present for the corresponding record type a
-- that specifies a position for the component, then the Component_Clause
-- field of the E_Component entity points to the N_Component_Clause node.
@@ -632,7 +632,7 @@ package Einfo is
-- there was no specification for this component.
-- Component_Size (Uint22) [implementation base type only]
--- Present in array types. It contains the component size value for
+-- Defined in array types. It contains the component size value for
-- the array. A value of No_Uint means that the value is not yet set.
-- The value can be set by the use of a component size clause, or
-- by the front end in package Layout, or by the backend. A negative
@@ -642,55 +642,55 @@ package Einfo is
-- for details of these values.
-- Component_Type (Node20) [implementation base type only]
--- Present in array types and string types. References component type.
+-- Defined in array types and string types. References component type.
-- Corresponding_Concurrent_Type (Node18)
--- Present in record types that are constructed by the expander to
+-- Defined in record types that are constructed by the expander to
-- represent task and protected types (Is_Concurrent_Record_Type flag
-- set True). Points to the entity for the corresponding task type or
-- protected type.
-- Corresponding_Discriminant (Node19)
--- Present in discriminants of a derived type, when the discriminant is
+-- Defined in discriminants of a derived type, when the discriminant is
-- used to constrain a discriminant of the parent type. Points to the
-- corresponding discriminant in the parent type. Otherwise it is Empty.
-- Corresponding_Equality (Node13)
--- Present in function entities for implicit inequality operators.
+-- Defined in function entities for implicit inequality operators.
-- Denotes the explicit or derived equality operation that creates
-- the implicit inequality. Note that this field is not present in
-- other function entities, only in implicit inequality routines,
-- where Comes_From_Source is always False.
-- Corresponding_Protected_Entry (Node18)
--- Present in subprogram bodies. Set for subprogram bodies that implement
+-- Defined in subprogram bodies. Set for subprogram bodies that implement
-- a protected type entry to point to the entity for the entry.
-- Corresponding_Record_Type (Node18)
--- Present in protected and task types and subtypes. References the
+-- Defined in protected and task types and subtypes. References the
-- entity for the corresponding record type constructed by the expander
-- (see Exp_Ch9). This type is used to represent values of the task type.
-- Corresponding_Remote_Type (Node22)
--- Present in record types that describe the fat pointer structure for
+-- Defined in record types that describe the fat pointer structure for
-- Remote_Access_To_Subprogram types. References the original access
-- type.
-- CR_Discriminant (Node23)
--- Present in discriminants of concurrent types. Denotes the homologous
+-- Defined in discriminants of concurrent types. Denotes the homologous
-- discriminant of the corresponding record type. The CR_Discriminant is
-- created at the same time as the discriminal, and used to replace
-- occurrences of the discriminant within the type declaration.
-- Current_Use_Clause (Node27)
--- Present in packages and in types. For packages, denotes the use
+-- Defined in packages and in types. For packages, denotes the use
-- package clause currently in scope that makes the package use_visible.
-- For types, it denotes the use_type clause that makes the operators of
-- the type visible. Used for more precise warning messages on redundant
-- use clauses.
-- Current_Value (Node9)
--- Present in all object entities. Set in E_Variable, E_Constant, formal
+-- Defined in all object entities. Set in E_Variable, E_Constant, formal
-- parameters and E_Loop_Parameter entities if we have trackable current
-- values. Set non-Empty if the (constant) current value of the variable
-- is known, This value is valid only for references from the same
@@ -711,7 +711,7 @@ package Einfo is
-- on this usage, see the procedure Exp_Util.Get_Current_Value_Condition.
-- Debug_Info_Off (Flag166)
--- Present in all entities. Set if a pragma Suppress_Debug_Info applies
+-- Defined in all entities. Set if a pragma Suppress_Debug_Info applies
-- to the entity, or if internal processing in the compiler determines
-- that suppression of debug information is desirable. Note that this
-- flag is only for use by the front end as part of the processing for
@@ -735,15 +735,15 @@ package Einfo is
-- the subprogram_declaration.
-- Default_Aspect_Component_Value (Node19)
--- Present in array types. Holds the static value specified in a
+-- Defined in array types. Holds the static value specified in a
-- default_component_value aspect specification for the array type.
-- Default_Aspect_Value (Node19)
--- Present in scalar types. Holds the static value specified in a
+-- Defined in scalar types. Holds the static value specified in a
-- default_value aspect specification for the type.
-- Default_Expr_Function (Node21)
--- Present in parameters. It holds the entity of the parameterless
+-- Defined in parameters. It holds the entity of the parameterless
-- function that is built to evaluate the default expression if it is
-- more complex than a simple identifier or literal. For the latter
-- simple cases or if there is no default value, this field is Empty.
@@ -756,13 +756,13 @@ package Einfo is
-- would not only waste time, but also generate false error messages.
-- Default_Value (Node20)
--- Present in formal parameters. Points to the node representing the
+-- Defined in formal parameters. Points to the node representing the
-- expression for the default value for the parameter. Empty if the
-- parameter has no default value (which is always the case for OUT
-- and IN OUT parameters in the absence of errors).
-- Delay_Cleanups (Flag114)
--- Present in entities that have finalization lists (subprograms
+-- Defined in entities that have finalization lists (subprograms
-- blocks, and tasks). Set if there are pending generic body
-- instantiations for the corresponding entity. If this flag is
-- set, then generation of cleanup actions for the corresponding
@@ -770,9 +770,9 @@ package Einfo is
-- may affect cleanup generation (see Inline for further details).
-- Delay_Subprogram_Descriptors (Flag50)
--- Present in entities for which exception subprogram descriptors
+-- Defined in entities for which exception subprogram descriptors
-- are generated (subprograms, package declarations and package
--- bodies). Present if there are pending generic body instantiations
+-- bodies). Defined if there are pending generic body instantiations
-- for the corresponding entity. If this flag is set, then generation
-- of the subprogram descriptor for the corresponding enities must
-- be delayed, since the insertion of the generic body may add entries
@@ -787,18 +787,18 @@ package Einfo is
-- enclosing elaboration procedure).
-- Delta_Value (Ureal18)
--- Present in fixed and decimal types. Points to a universal real
+-- Defined in fixed and decimal types. Points to a universal real
-- that holds value of delta for the type, as given in the declaration
-- or as inherited by a subtype or derived type.
-- Dependent_Instances (Elist8)
--- Present in packages that are instances. Holds list of instances
+-- Defined in packages that are instances. Holds list of instances
-- of inner generics. Used to place freeze nodes for those instances
-- after that of the current one, i.e. after the corresponding generic
-- bodies.
-- Depends_On_Private (Flag14)
--- Present in all type entities. Set if the type is private or if it
+-- Defined in all type entities. Set if the type is private or if it
-- depends on a private type.
-- Designated_Type (synthesized)
@@ -808,20 +808,20 @@ package Einfo is
-- full type is returned instead of the incomplete type.
-- Digits_Value (Uint17)
--- Present in floating point types and subtypes and decimal types and
+-- Defined in floating point types and subtypes and decimal types and
-- subtypes. Contains the Digits value specified in the declaration.
-- Direct_Primitive_Operations (Elist10)
--- Present in tagged types and subtypes (including synchronized types),
+-- Defined in tagged types and subtypes (including synchronized types),
-- in tagged private types and in tagged incomplete types. Element list
--- of entities for primitive operations of the tagged type. Not present
+-- of entities for primitive operations of the tagged type. Not defined
-- in untagged types. In order to follow the C++ ABI, entities of
-- primitives that come from source must be stored in this list in the
-- order of their occurrence in the sources. For incomplete types the
-- list is always empty.
-- Directly_Designated_Type (Node20)
--- Present in access types. This field points to the type that is
+-- Defined in access types. This field points to the type that is
-- directly designated by the access type. In the case of an access
-- type to an incomplete type, this field references the incomplete
-- type. Directly_Designated_Type is typically used in implementing the
@@ -831,7 +831,7 @@ package Einfo is
-- incomplete type.
-- Discard_Names (Flag88)
--- Present in types and exception entities. Set if pragma Discard_Names
+-- Defined in types and exception entities. Set if pragma Discard_Names
-- applies to the entity. It is also set for declarative regions and
-- package specs for which a Discard_Names pragma with zero arguments
-- has been encountered. The purpose of setting this flag is to be able
@@ -840,23 +840,23 @@ package Einfo is
-- set to False if a Keep_Names pragma appears for an enumeration type.
-- Discriminal (Node17)
--- Present in discriminants (Discriminant formal: GNAT's first
+-- Defined in discriminants (Discriminant formal: GNAT's first
-- coinage). The entity used as a formal parameter that corresponds
-- to a discriminant. See section "Handling of Discriminants" for
-- full details of the use of discriminals.
-- Discriminal_Link (Node10)
--- Present in discriminals (which have an Ekind of E_In_Parameter,
+-- Defined in discriminals (which have an Ekind of E_In_Parameter,
-- or E_Constant), points back to corresponding discriminant.
-- Discriminant_Checking_Func (Node20)
--- Present in components. Points to the defining identifier of the
+-- Defined in components. Points to the defining identifier of the
-- function built by the expander returns a Boolean indicating whether
-- the given record component exists for the current discriminant
-- values.
-- Discriminant_Constraint (Elist21)
--- Present in entities whose Has_Discriminants flag is set (concurrent
+-- Defined in entities whose Has_Discriminants flag is set (concurrent
-- types, subtypes, record types and subtypes, private types and
-- subtypes, limited private types and subtypes and incomplete types).
-- It is an error to reference the Discriminant_Constraint field if
@@ -883,24 +883,24 @@ package Einfo is
-- Elist (ie it is initialized with a call to New_Elmt_List).
-- Discriminant_Default_Value (Node20)
--- Present in discriminants. Points to the node representing the
+-- Defined in discriminants. Points to the node representing the
-- expression for the default value of the discriminant. Set to
-- Empty if the discriminant has no default value.
-- Discriminant_Number (Uint15)
--- Present in discriminants. Gives the ranking of a discriminant in
+-- Defined in discriminants. Gives the ranking of a discriminant in
-- the list of discriminants of the type, i.e. a sequential integer
-- index starting at 1 and ranging up to number of discriminants.
-- Dispatch_Table_Wrappers (Elist26) [implementation base type only]
--- Present in E_Record_Type and E_Record_Subtype entities. Set in library
+-- Defined in E_Record_Type and E_Record_Subtype entities. Set in library
-- level tagged type entities if we are generating statically allocated
-- dispatch tables. Points to the list of dispatch table wrappers
-- associated with the tagged type. For a non-tagged record, contains
-- No_Elist.
-- DTC_Entity (Node16)
--- Present in function and procedure entities. Set to Empty unless
+-- Defined in function and procedure entities. Set to Empty unless
-- the subprogram is dispatching in which case it references the
-- Dispatch Table pointer Component. That is to say the component _tag
-- for regular Ada tagged types, for CPP_Class types and their
@@ -909,26 +909,26 @@ package Einfo is
-- references the subprogram.
-- DT_Entry_Count (Uint15)
--- Present in E_Component entities. Only used for component marked
+-- Defined in E_Component entities. Only used for component marked
-- Is_Tag. Store the number of entries in the Vtable (or Dispatch Table)
-- DT_Offset_To_Top_Func (Node25)
--- Present in E_Component entities. Only used for component marked
+-- Defined in E_Component entities. Only used for component marked
-- Is_Tag. If present it stores the Offset_To_Top function used to
-- provide this value in tagged types whose ancestor has discriminants.
-- DT_Position (Uint15)
--- Present in function and procedure entities which are dispatching
+-- Defined in function and procedure entities which are dispatching
-- (should not be referenced without first checking that flag
-- Is_Dispatching_Operation is True). Contains the offset into
-- the Vtable for the entry that references the subprogram.
-- Ekind (Ekind)
--- Present in all entities. Contains a value of the enumeration type
+-- Defined in all entities. Contains a value of the enumeration type
-- Entity_Kind declared in a subsequent section in this spec.
-- Elaborate_Body_Desirable (Flag210)
--- Present in package entities. Set if the elaboration circuitry detects
+-- Defined in package entities. Set if the elaboration circuitry detects
-- a case where there is a package body that modifies one or more visible
-- entities in the package spec and there is no explicit Elaborate_Body
-- pragma for the package. This information is passed on to the binder,
@@ -936,7 +936,7 @@ package Einfo is
-- to the spec as possible.
-- Elaboration_Entity (Node13)
--- Present in generic and non-generic package and subprogram entities.
+-- Defined in generic and non-generic package and subprogram entities.
-- This is a counter associated with the unit that is initially set to
-- zero, is incremented when an elaboration request for the unit is
-- made, and is decremented when a finalization request for the unit
@@ -956,7 +956,7 @@ package Einfo is
-- is elaboration code), but is simply not used for any purpose.
-- Elaboration_Entity_Required (Flag174)
--- Present in generic and non-generic package and subprogram entities.
+-- Defined in generic and non-generic package and subprogram entities.
-- Set only if Elaboration_Entity is non-Empty to indicate that the
-- counter is required to be non-zero even if there is no other
-- elaboration code. This occurs when the Elaboration_Entity counter
@@ -966,25 +966,25 @@ package Einfo is
-- need to set the flag.
-- Enclosing_Scope (Node18)
--- Present in labels. Denotes the innermost enclosing construct that
+-- Defined in labels. Denotes the innermost enclosing construct that
-- contains the label. Identical to the scope of the label, except for
-- labels declared in the body of an accept statement, in which case the
-- entry_name is the Enclosing_Scope. Used to validate goto's within
-- accept statements.
-- Entry_Accepted (Flag152)
--- Present in E_Entry and E_Entry_Family entities. Set if there is
+-- Defined in E_Entry and E_Entry_Family entities. Set if there is
-- at least one accept for this entry in the task body. Used to
-- generate warnings for missing accepts.
-- Entry_Bodies_Array (Node15)
--- Present in protected types for which Has_Entries is true.
+-- Defined in protected types for which Has_Entries is true.
-- This is the defining identifier for the array of entry body
-- action procedures and barrier functions used by the runtime to
-- execute the user code associated with each entry.
-- Entry_Cancel_Parameter (Node23)
--- Present in blocks. This only applies to a block statement for
+-- Defined in blocks. This only applies to a block statement for
-- which the Is_Asynchronous_Call_Block flag is set. It
-- contains the defining identifier of an object that must be
-- passed to the Cancel_Task_Entry_Call or Cancel_Protected_Entry_Call
@@ -995,17 +995,17 @@ package Einfo is
-- are declared in outer scopes to this block.
-- Entry_Component (Node11)
--- Present in formal parameters (in, in out and out parameters). Used
+-- Defined in formal parameters (in, in out and out parameters). Used
-- only for formals of entries. References the corresponding component
-- of the entry parameter record for the entry.
-- Entry_Formal (Node16)
--- Present in components of the record built to correspond to entry
+-- Defined in components of the record built to correspond to entry
-- parameters. This field points from the component to the formal. It
-- is the back pointer corresponding to Entry_Component.
-- Entry_Index_Constant (Node18)
--- Present in an entry index parameter. This is an identifier that
+-- Defined in an entry index parameter. This is an identifier that
-- eventually becomes the name of a constant representing the index
-- of the entry family member whose entry body is being executed. Used
-- to expand references to the entry index specification identifier.
@@ -1017,12 +1017,12 @@ package Einfo is
-- 'COUNT when it applies to a family member.
-- Contract (Node24)
--- Present in entries, and in subprogram and generic subprogram entities.
+-- Defined in entries, and in subprogram and generic subprogram entities.
-- Points to the contract of the entity, holding both pre- and
-- postconditions as well as test-cases.
-- Entry_Parameters_Type (Node15)
--- Present in entries. Points to the access-to-record type that is
+-- Defined in entries. Points to the access-to-record type that is
-- constructed by the expander to hold a reference to the parameter
-- values. This reference is manipulated (as an address) by the
-- tasking runtime. The designated record represents a packaging
@@ -1031,11 +1031,11 @@ package Einfo is
-- has no parameters.
-- Enumeration_Pos (Uint11)
--- Present in enumeration literals. Contains the position number
+-- Defined in enumeration literals. Contains the position number
-- corresponding to the value of the enumeration literal.
-- Enumeration_Rep (Uint12)
--- Present in enumeration literals. Contains the representation that
+-- Defined in enumeration literals. Contains the representation that
-- corresponds to the value of the enumeration literal. Note that
-- this is normally the same as Enumeration_Pos except in the presence
-- of representation clauses, where Pos will still represent the
@@ -1043,7 +1043,7 @@ package Einfo is
-- value given in the representation clause.
-- Enumeration_Rep_Expr (Node22)
--- Present in enumeration literals. Points to the expression in an
+-- Defined in enumeration literals. Points to the expression in an
-- associated enumeration rep clause that provides the representation
-- value for this literal. Empty if no enumeration rep clause for this
-- literal (or if rep clause does not have an entry for this literal,
@@ -1051,7 +1051,7 @@ package Einfo is
-- for the same literal.
-- Enum_Pos_To_Rep (Node23)
--- Present in enumeration types (but not enumeration subtypes). Set to
+-- Defined in enumeration types (but not enumeration subtypes). Set to
-- Empty unless the enumeration type has a non-standard representation
-- (i.e. at least one literal has a representation value different from
-- its pos value). In this case, Enum_Pos_To_Rep is the entity for an
@@ -1061,7 +1061,7 @@ package Einfo is
-- full range of representation values.
-- Equivalent_Type (Node18)
--- Present in class wide types and subtypes, access to protected
+-- Defined in class wide types and subtypes, access to protected
-- subprogram types, and in exception types. For a classwide type, it
-- is always Empty. For a class wide subtype, it points to an entity
-- created by the expander which gives Gigi an easily understandable
@@ -1075,7 +1075,7 @@ package Einfo is
-- the record that is the fat pointer representation of an RAST.
-- Esize (Uint12)
--- Present in all types and subtypes, and also for components, constants,
+-- Defined in all types and subtypes, and also for components, constants,
-- and variables, including exceptions where it refers to the static data
-- allocated for an exception. Contains the Object_Size of the type or of
-- the object. A value of zero indicates that the value is not yet known.
@@ -1084,14 +1084,14 @@ package Einfo is
-- value is the value from the component clause, which must be non-
-- negative (but may be zero, which is acceptable for the case of
-- a type with only one possible value). It is also possible for Esize
--- of a component to be set without a component clause present, which
+-- of a component to be set without a component clause defined, which
-- means that the component size is specified, but not the position.
-- See also RM_Size and the section on "Handling of Type'Size Values".
-- During gigi processing, the value is back annotated for all zero
-- values, so that after the call to gigi, the value is properly set.
-- Etype (Node5)
--- Present in all entities. Represents the type of the entity, which
+-- Defined in all entities. Represents the type of the entity, which
-- is itself another entity. For a type entity, points to the parent
-- type for a derived type, or if the type is not derived, points to
-- itself. For a subtype entity, Etype points to the base type. For
@@ -1103,14 +1103,14 @@ package Einfo is
-- Etype of the N_Null node is Empty.
-- Exception_Code (Uint22)
--- Present in exception entities. Set to zero unless either an
+-- Defined in exception entities. Set to zero unless either an
-- Import_Exception or Export_Exception pragma applies to the
-- pragma and specifies a Code value. See description of these
-- pragmas for details. Note that this field is relevant only if
-- Is_VMS_Exception is set.
-- Extra_Formal (Node15)
--- Present in formal parameters in the non-generic case. Certain
+-- Defined in formal parameters in the non-generic case. Certain
-- parameters require extra implicit information to be passed (e.g. the
-- flag indicating if an unconstrained variant record argument is
-- constrained, and the accessibility level for access parameters. See
@@ -1128,19 +1128,19 @@ package Einfo is
-- or entry. Returns Empty if there are no extra formals.
-- Extra_Accessibility (Node13)
--- Present in formal parameters in the non-generic case. Normally Empty,
+-- Defined in formal parameters in the non-generic case. Normally Empty,
-- but if expansion is active, and a parameter is one for which a
-- dynamic accessibility check is required, then an extra formal of type
-- Natural is created (see description of field Extra_Formal), and the
-- Extra_Accessibility field of the formal parameter points to the entity
--- for this extra formal. Also present in variables when compiling
+-- for this extra formal. Also defined in variables when compiling
-- receiving stubs. In this case, a non Empty value means that this
-- variable's accessibility depth has been transmitted by the caller and
-- must be retrieved through the entity designed by this field instead of
-- being computed.
-- Extra_Accessibility_Of_Result (Node19)
--- Present in (non-generic) Function, Operator, and Subprogram_Type
+-- Defined in (non-generic) Function, Operator, and Subprogram_Type
-- entities. Normally Empty, but if expansion is active, and a function
-- is one for which "the accessibility level of the result ... determined
-- by the point of call" (AI05-0234) is needed, then an extra formal of
@@ -1149,26 +1149,26 @@ package Einfo is
-- the entity for this extra formal.
-- Extra_Constrained (Node23)
--- Present in formal parameters in the non-generic case. Normally Empty,
+-- Defined in formal parameters in the non-generic case. Normally Empty,
-- but if expansion is active and a parameter is one for which a dynamic
-- indication of its constrained status is required, then an extra formal
-- of type Boolean is created (see description of field Extra_Formal),
-- and the Extra_Constrained field of the formal parameter points to the
--- entity for this extra formal. Also present in variables when compiling
+-- entity for this extra formal. Also defined in variables when compiling
-- receiving stubs. In this case, a non empty value means that this
-- variable's constrained status has been transmitted by the caller and
-- must be retrieved through the entity designed by this field instead of
-- being computed.
-- Finalization_Master (Node23) [root type only]
--- Present in access-to-controlled or access-to-class-wide types. The
+-- Defined in access-to-controlled or access-to-class-wide types. The
-- field contains the entity of the finalization master which handles
-- dynamically allocated controlled objects referenced by the access
-- type. Empty for access-to-subprogram types. Empty for access types
-- whose designated type does not need finalization actions.
-- Finalize_Storage_Only (Flag158) [base type only]
--- Present in all types. Set on direct controlled types to which a
+-- Defined in all types. Set on direct controlled types to which a
-- valid Finalize_Storage_Only pragma applies. This flag is also set on
-- composite types when they have at least one controlled component and
-- all their controlled components are Finalize_Storage_Only. It is also
@@ -1192,7 +1192,7 @@ package Einfo is
-- find the first discriminant if discriminants are present.
-- First_Entity (Node17)
--- Present in all entities which act as scopes to which a list of
+-- Defined in all entities which act as scopes to which a list of
-- associated entities is attached (blocks, class subtypes and types,
-- entries, functions, loops, packages, procedures, protected objects,
-- record types and subtypes, private types, task types and subtypes).
@@ -1200,7 +1200,7 @@ package Einfo is
-- as a chain pointer with Empty marking the end of the list.
-- First_Exit_Statement (Node8)
--- Present in E_Loop entity. The exit statements for a loop are chained
+-- Defined in E_Loop entity. The exit statements for a loop are chained
-- (in reverse order of appearance) using this field to point to the
-- first entry in the chain (last exit statement in the loop). The
-- entries are chained through the Next_Exit_Statement field of the
@@ -1220,17 +1220,17 @@ package Einfo is
-- all the extra formals (see description of Extra_Formals field).
-- First_Index (Node17)
--- Present in array types and subtypes and in string types and subtypes.
+-- Defined in array types and subtypes and in string types and subtypes.
-- By introducing implicit subtypes for the index constraints, we have
-- 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
--- obtained using Next_Index. Note that this field is present for the
+-- obtained using Next_Index. Note that this field is defined for the
-- case of string literal subtypes, but is always Empty.
-- First_Literal (Node17)
--- Present in all enumeration types, including character and boolean
+-- Defined in all enumeration types, including character and boolean
-- types. This field points to the first enumeration literal entity
-- for the type (i.e. it is set to First (Literals (N)) where N is
-- the enumeration type definition node. A special case occurs with
@@ -1240,14 +1240,14 @@ package Einfo is
-- points to the first literal of the base type in this case.
-- First_Optional_Parameter (Node14)
--- Present in (non-generic) function and procedure entities. Set to a
+-- Defined in (non-generic) function and procedure entities. Set to a
-- non-null value only if a pragma Import_Function, Import_Procedure
-- or Import_Valued_Procedure specifies a First_Optional_Parameter
-- argument, in which case this field points to the parameter entity
-- corresponding to the specified parameter.
-- First_Private_Entity (Node16)
--- Present in all entities containing private parts (packages, protected
+-- Defined in all entities containing private parts (packages, protected
-- types and subtypes, task types and subtypes). The entities on the
-- entity chain are in order of declaration, so the entries for private
-- entities are at the end of the chain. This field points to the first
@@ -1255,7 +1255,7 @@ package Einfo is
-- declared in the private part or if there is no private part.
-- First_Rep_Item (Node6)
--- Present in all entities. If non-empty, points to a linked list of
+-- Defined in all entities. If non-empty, points to a linked list of
-- representation pragmas nodes and representation clause nodes that
-- apply to the entity, linked using Next_Rep_Item, with Empty marking
-- the end of the list. In the case of derived types and subtypes, the
@@ -1289,22 +1289,22 @@ package Einfo is
--
-- Other representation items are included in the chain so that error
-- messages can easily locate the relevant nodes for posting errors.
--- Note in particular that size clauses are present only for this
+-- Note in particular that size clauses are defined only for this
-- purpose, and should only be accessed if Has_Size_Clause is set.
-- Float_Rep (Uint10)
--- Present in floating-point entities. Contains a value of type
+-- Defined in floating-point entities. Contains a value of type
-- Float_Rep_Kind. Together with the Digits_Value uniquely defines
-- the floating-point representation to be used.
-- Freeze_Node (Node7)
--- Present in all entities. If there is an associated freeze node for the
+-- Defined in all entities. If there is an associated freeze node for the
-- entity, this field references this freeze node. If no freeze node is
-- associated with the entity, then this field is Empty. See package
-- Freeze for further details.
-- From_With_Type (Flag159)
--- Present in package and type entities. Indicates that the entity
+-- Defined in package and type entities. Indicates that the entity
-- appears in a With_Type clause in the context of some other unit,
-- either as the prefix (which must be a package), or as a type name.
-- The package can only be used to retrieve such a type, and the type
@@ -1318,7 +1318,7 @@ package Einfo is
-- GNAT with_type clause???
-- Full_View (Node11)
--- Present in all type and subtype entities and in deferred constants.
+-- Defined in all type and subtype entities and in deferred constants.
-- References the entity for the corresponding full type declaration.
-- For all types other than private and incomplete types, this field
-- always contains Empty. If an incomplete type E1 is completed by a
@@ -1327,27 +1327,27 @@ package Einfo is
-- Underlying_Type.
-- Generic_Homonym (Node11)
--- Present in generic packages. The generic homonym is the entity of
+-- Defined in generic packages. The generic homonym is the entity of
-- a renaming declaration inserted in every generic unit. It is used
-- to resolve the name of a local entity that is given by a qualified
-- name, when the generic entity itself is hidden by a local name.
-- Generic_Renamings (Elist23)
--- Present in package and subprogram instances. Holds mapping that
+-- Defined in package and subprogram instances. Holds mapping that
-- associates generic parameters with the corresponding instances, in
-- those cases where the instance is an entity.
-- Handler_Records (List10)
--- Present in subprogram and package entities. Points to a list of
+-- Defined in subprogram and package entities. Points to a list of
-- identifiers referencing the handler record entities for the
-- corresponding unit.
-- Has_Aliased_Components (Flag135) [implementation base type only]
--- Present in array type entities. Indicates that the component type
+-- Defined in array type entities. Indicates that the component type
-- of the array is aliased.
-- Has_Alignment_Clause (Flag46)
--- Present in all type entities and objects. Indicates if an alignment
+-- Defined in all type entities and objects. Indicates if an alignment
-- clause has been given for the entity. If set, then Alignment_Clause
-- returns the N_Attribute_Definition node for the alignment attribute
-- definition clause. Note that it is possible for this flag to be False
@@ -1355,20 +1355,20 @@ package Einfo is
-- of derived type declarations).
-- Has_All_Calls_Remote (Flag79)
--- Present in all library unit entities. Set true if the library unit
+-- Defined in all library unit entities. Set true if the library unit
-- has an All_Calls_Remote pragma. Note that such entities must also
-- be RCI entities, so the flag Is_Remote_Call_Interface will always
-- be set if this flag is set.
-- Has_Anonymous_Master (Flag253)
--- Present in units (top-level functions and procedures, library-level
+-- Defined in units (top-level functions and procedures, library-level
-- packages). Set to True if the associated unit contains a heterogeneous
-- finalization master. The master's name is of the form <unit>AM and it
-- services anonymous access-to-controlled types with an undetermined
-- lifetime.
-- Has_Atomic_Components (Flag86) [implementation base type only]
--- Present in all types and objects. Set only for an array type or
+-- Defined in all types and objects. Set only for an array type or
-- an array object if a valid pragma Atomic_Components applies to the
-- type or object. Note that in the case of an object, this flag is
-- only set on the object if there was an explicit pragma for the
@@ -1384,7 +1384,7 @@ package Einfo is
-- Attach_Handler pragma in the corresponding specification.
-- Has_Biased_Representation (Flag139)
--- Present in discrete types (where it applies to the type'size value),
+-- Defined in discrete types (where it applies to the type'size value),
-- and to objects (both stand-alone and components), where it applies to
-- the size of the object from a size or record component clause. In
-- all cases it indicates that the size in question is smaller than
@@ -1400,27 +1400,27 @@ package Einfo is
-- the subtype is still an unbiased type.
-- Has_Completion (Flag26)
--- Present in all entities that require a completion (functions,
+-- Defined in all entities that require a completion (functions,
-- procedures, private types, limited private types, incomplete types,
-- constants and packages that require a body). The flag is set if the
-- completion has been encountered and analyzed.
-- Has_Completion_In_Body (Flag71)
--- Present in all entities for types and subtypes. Set only in "Taft
+-- Defined in all entities for types and subtypes. Set only in "Taft
-- amendment types" (incomplete types whose full declaration appears in
-- the package body).
-- Has_Complex_Representation (Flag140) [implementation base type only]
--- Present in all type entities. Set only for a record base type to
+-- Defined in all type entities. Set only for a record base type to
-- which a valid pragma Complex_Representation applies.
-- Has_Component_Size_Clause (Flag68) [implementation base type only]
--- Present in all type entities. Set if a component size clause is
--- present for the given type. Note that this flag can be False even
+-- Defined in all type entities. Set if a component size clause is
+-- Defined for the given type. Note that this flag can be False even
-- if Component_Size is non-zero (happens in the case of derived types).
-- Has_Constrained_Partial_View (Flag187)
--- Present in private type and their completions, when the private
+-- Defined in private type and their completions, when the private
-- type has no discriminants and the full view has discriminants with
-- defaults. In Ada 2005 heap-allocated objects of such types are not
-- constrained, and can change their discriminants with full assignment.
@@ -1431,50 +1431,51 @@ package Einfo is
-- [when in a generic body].
-- Has_Contiguous_Rep (Flag181)
--- Present in enumeration types. True if the type as a representation
+-- Defined in enumeration types. True if the type as a representation
-- clause whose entries are successive integers.
-- Has_Controlling_Result (Flag98)
--- Present in E_Function entities. True if the function is a primitive
+-- Defined in E_Function entities. True if the function is a primitive
-- function of a tagged type which can dispatch on result.
-- Has_Controlled_Component (Flag43) [base type only]
--- Present in all type and subtype entities. Set only for composite type
+-- Defined in all type and subtype entities. Set only for composite type
-- entities which contain a component that either is a controlled type,
-- or itself contains controlled component (i.e. either Is_Controlled or
-- Has_Controlled_Component is set for at least one component).
-- Has_Convention_Pragma (Flag119)
--- Present in all entities. Set true for an entity for which a valid
+-- Defined in all entities. Set true for an entity for which a valid
-- Convention, Import, or Export pragma has been given. Used to prevent
-- more than one such pragma appearing for a given entity (RM B.1(45)).
--- Has_Delayed_Aspects (Flag200) Present in all entities. Set true if the
--- Rep_Item chain for the entity has one or more N_Aspect_Definition
--- nodes chained which are not to be evaluated till the freeze point.
--- The aspect definition expression clause has been preanalyzed to get
--- visibility at the point of use, but no other action has been taken.
+-- Has_Delayed_Aspects (Flag200)
+-- Defined in all entities. Set true if the Rep_Item chain for the entity
+-- has one or more N_Aspect_Definition nodes chained which are not to be
+-- evaluated till the freeze point. The aspect definition expression
+-- clause has been preanalyzed to get visibility at the point of use,
+-- but no other action has been taken.
-- Has_Delayed_Freeze (Flag18)
--- Present in all entities. Set to indicate that an explicit freeze
+-- Defined in all entities. Set to indicate that an explicit freeze
-- node must be generated for the entity at its freezing point. See
-- separate section ("Delayed Freezing and Elaboration") for details.
-- Has_Default_Aspect (Flag39) [base type only]
--- Present in entities for types and subtypes, set for scalar types with
+-- Defined in entities for types and subtypes, set for scalar types with
-- a Default_Value aspect and array types with a Default_Component_Value
-- apsect. If this flag is set, then a corresponding aspect specification
-- node will be present on the rep item chain for the entity.
-- Has_Discriminants (Flag5)
--- Present in all types and subtypes. For types that are allowed to have
+-- Defined in all types and subtypes. For types that are allowed to have
-- discriminants (record types and subtypes, task types and subtypes,
-- protected types and subtypes, private types, limited private types,
-- and incomplete types), indicates if the corresponding type or subtype
-- has a known discriminant part. Always false for all other types.
-- Has_Dispatch_Table (Flag220)
--- Present in E_Record_Types that are tagged. Set to indicate that the
+-- Defined in E_Record_Types that are tagged. Set to indicate that the
-- corresponding dispatch table is already built. This flag is used to
-- avoid duplicate construction of library level dispatch tables (because
-- the declaration of library level objects cause premature construction
@@ -1486,19 +1487,19 @@ package Einfo is
-- within the task or protected definition for the type.
-- Has_Enumeration_Rep_Clause (Flag66)
--- Present in enumeration types. Set if an enumeration representation
+-- Defined in enumeration types. Set if an enumeration representation
-- clause has been given for this enumeration type. Used to prevent more
-- than one enumeration representation clause for a given type. Note
-- that this does not imply a representation with holes, since the rep
-- clause may merely confirm the default 0..N representation.
-- Has_External_Tag_Rep_Clause (Flag110)
--- Present in tagged types. Set if an external_tag rep. clause has been
+-- Defined in tagged types. Set if an external_tag rep. clause has been
-- given for this type. Use to avoid the generation of the default
-- external_tag.
-- Has_Exit (Flag47)
--- Present in loop entities. Set if the loop contains an exit statement.
+-- Defined in loop entities. Set if the loop contains an exit statement.
-- Has_Foreign_Convention (synthesized)
-- Applies to all entities. Determines if the Convention for the
@@ -1506,7 +1507,7 @@ package Einfo is
-- Convention_Intrinsic, Convention_Entry or Convention_Protected).
-- Has_Forward_Instantiation (Flag175)
--- Present in package entities. Set true for packages that contain
+-- Defined in package entities. Set true for packages that contain
-- instantiations of local generic entities, before the corresponding
-- generic body has been seen. If a package has a forward instantiation,
-- we cannot inline subprograms appearing in the same package because
@@ -1514,13 +1515,13 @@ package Einfo is
-- linear elaboration of front-end inlining.
-- Has_Fully_Qualified_Name (Flag173)
--- Present in all entities. Set True if the name in the Chars field has
+-- Defined in all entities. Set True if the name in the Chars field has
-- been replaced by the fully qualified name, as used for debug output.
-- See Exp_Dbug for a full description of the use of this flag and also
-- the related flag Has_Qualified_Name.
-- Has_Gigi_Rep_Item (Flag82)
--- Present in all entities. Set if the rep item chain (referenced by
+-- Defined in all entities. Set if the rep item chain (referenced by
-- First_Rep_Item and linked through the Next_Rep_Item chain) contains a
-- representation item that needs to be specially processed by Gigi, i.e.
-- one of the following items:
@@ -1538,21 +1539,21 @@ package Einfo is
-- be present.
-- Has_Homonym (Flag56)
--- Present in all entities. Set if an entity has a homonym in the same
+-- Defined in all entities. Set if an entity has a homonym in the same
-- scope. Used by Gigi to generate unique names for such entities.
-- Has_Implicit_Dereference (Flag251)
--- Present in types and discriminants. Set if the type has an aspect
+-- Defined in types and discriminants. Set if the type has an aspect
-- Implicit_Dereference. Set also on the discriminant named in the aspect
-- clause, to simplify type resolution.
-- Has_Initial_Value (Flag219)
--- Present in entities for variables and out parameters. Set if there
+-- Defined in entities for variables and out parameters. Set if there
-- is an explicit initial value expression in the declaration of the
-- variable. Note that this is set only if this initial value is
-- explicit, it is not set for the case of implicit initialization
-- of access types or controlled types. Always set to False for out
--- parameters. Also present in entities for in and in-out parameters,
+-- parameters. Also defined in entities for in and in-out parameters,
-- but always false in these cases.
-- Has_Interrupt_Handler (synthesized)
@@ -1561,7 +1562,7 @@ package Einfo is
-- Interrupt_Handler applies.
-- Has_Invariants (Flag232)
--- Present in all type entities and in subprogram entities. Set True in
+-- Defined in all type entities and in subprogram entities. Set True in
-- private types if an Invariant or Invariant'Class aspect applies to the
-- type, or if the type inherits one or more Invariant'Class aspects.
-- Also set in the corresponding full type. Note: if this flag is set
@@ -1573,7 +1574,7 @@ package Einfo is
-- Subprograms_For_Type.
-- Has_Inheritable_Invariants (Flag248)
--- Present in all type entities. Set True in private types from which one
+-- Defined in all type entities. Set True in private types from which one
-- or more Invariant'Class aspects will be inherited if a another type is
-- derived from the type (i.e. those types which have an Invariant'Class
-- aspect, or which inherit one or more Invariant'Class aspects). Also
@@ -1582,30 +1583,30 @@ package Einfo is
-- also be set in the private type.
-- Has_Machine_Radix_Clause (Flag83)
--- Present in decimal types and subtypes, set if a Machine_Radix
+-- Defined in decimal types and subtypes, set if a Machine_Radix
-- representation clause is present. This flag is used to detect
-- the error of multiple machine radix clauses for a single type.
-- Has_Master_Entity (Flag21)
--- Present in entities that can appear in the scope stack (see spec
+-- Defined in entities that can appear in the scope stack (see spec
-- of Sem). It is set if a task master entity (_master) has been
-- declared and initialized in the corresponding scope.
-- Has_Missing_Return (Flag142)
--- Present in functions and generic functions. Set if there is one or
+-- Defined in functions and generic functions. Set if there is one or
-- more missing return statements in the function. This is used to
-- control wrapping of the body in Exp_Ch6 to ensure that the program
-- error exception is correctly raised in this case at runtime.
-- Has_Nested_Block_With_Handler (Flag101)
--- Present in scope entities. Set if there is a nested block within the
+-- Defined in scope entities. Set if there is a nested block within the
-- scope that has an exception handler and the two scopes are in the
-- same procedure. This is used by the backend for controlling certain
-- optimizations to ensure that they are consistent with exceptions.
-- See documentation in Gigi for further details.
-- Has_Non_Standard_Rep (Flag75) [implementation base type only]
--- Present in all type entities. Set when some representation clause
+-- Defined in all type entities. Set when some representation clause
-- or pragma causes the representation of the item to be significantly
-- modified. In this category are changes of small or radix for a
-- fixed-point type, change of component size for an array, and record
@@ -1615,12 +1616,12 @@ package Einfo is
-- stored bit patterns.
-- Has_Object_Size_Clause (Flag172)
--- Present in entities for types and subtypes. Set if an Object_Size
+-- Defined in entities for types and subtypes. Set if an Object_Size
-- clause has been processed for the type Used to prevent multiple
-- Object_Size clauses for a given entity.
-- Has_Per_Object_Constraint (Flag154)
--- Present in E_Component entities, true if the subtype of the
+-- Defined in E_Component entities, true if the subtype of the
-- component has a per object constraint. Per object constraints result
-- from the following situations:
--
@@ -1636,19 +1637,19 @@ package Einfo is
-- discriminant of the enclosing type.
-- Has_Postconditions (Flag240)
--- Present in subprogram entities. Set if postconditions are active for
+-- Defined in subprogram entities. Set if postconditions are active for
-- the procedure, and a _postconditions procedure has been generated.
-- Has_Pragma_Controlled (Flag27) [implementation base type only]
--- Present in access type entities. It is set if a pragma Controlled
+-- Defined in access type entities. It is set if a pragma Controlled
-- applies to the access type.
-- Has_Pragma_Elaborate_Body (Flag150)
--- Present in all entities. Set in compilation unit entities if a
+-- Defined in all entities. Set in compilation unit entities if a
-- pragma Elaborate_Body applies to the compilation unit.
-- Has_Pragma_Inline (Flag157)
--- Present in all entities. Set for functions and procedures for which a
+-- Defined in all entities. Set for functions and procedures for which a
-- pragma Inline or Inline_Always applies to the subprogram. Note that
-- this flag can be set even if Is_Inlined is not set. This happens for
-- pragma Inline (if Inline_Active is False). In other words, the flag
@@ -1657,50 +1658,50 @@ package Einfo is
-- whether inlining is actually active for the entity.
-- Has_Pragma_Inline_Always (Flag230)
--- Present in all entities. Set for functions and procedures for which a
+-- Defined in all entities. Set for functions and procedures for which a
-- pragma Inline_Always applies. Note that if this flag is set, the flag
-- Has_Pragma_Inline is also set.
-- Has_Pragma_Ordered (Flag198) [implementation base type only]
--- Present in entities for enumeration types. If set indicates that a
+-- Defined in entities for enumeration types. If set indicates that a
-- valid pragma Ordered was given for the type. This flag is inherited
-- by derived enumeration types. We don't need to distinguish the derived
-- case since we allow multiple occurrences of this pragma anyway.
-- Has_Pragma_Pack (Flag121) [implementation base type only]
--- Present in array and record type entities. If set, indicates that a
+-- Defined in array and record type entities. If set, indicates that a
-- valid pragma Pack was given for the type. Note that this flag is not
-- inherited by derived type. See also the Is_Packed flag.
-- Has_Pragma_Pure (Flag203)
--- Present in all entities. If set, indicates that a valid pragma Pure
+-- Defined in all entities. If set, indicates that a valid pragma Pure
-- was given for the entity. In some cases, we need to test whether
-- Is_Pure was explicitly set using this pragma.
-- Has_Pragma_Preelab_Init (Flag221)
--- Present in type and subtype entities. If set indicates that a valid
+-- Defined in type and subtype entities. If set indicates that a valid
-- pragma Preelaborable_Initialization applies to the type.
-- Has_Pragma_Pure_Function (Flag179)
--- Present in all entities. If set, indicates that a valid pragma
+-- Defined in all entities. If set, indicates that a valid pragma
-- Pure_Function was given for the entity. In some cases, we need to
-- know that Is_Pure was explicitly set using this pragma. We also set
-- this flag for some internal entities that we know should be treated
-- as pure for optimization purposes.
-- Has_Pragma_Thread_Local_Storage (Flag169)
--- Present in all entities. If set, indicates that a valid pragma
+-- Defined in all entities. If set, indicates that a valid pragma
-- Thread_Local_Storage was given for the entity.
-- Has_Pragma_Unmodified (Flag233)
--- Present in all entities. Can only be set for variables (E_Variable,
+-- Defined in all entities. Can only be set for variables (E_Variable,
-- E_Out_Parameter, E_In_Out_Parameter). Set if a valid pragma Unmodified
-- applies to the variable, indicating that no warning should be given
-- if the entity is never modified. Note that clients should generally
-- not test this flag directly, but instead use function Has_Unmodified.
-- Has_Pragma_Unreferenced (Flag180)
--- Present in all entities. Set if a valid pragma Unreferenced applies
+-- Defined in all entities. Set if a valid pragma Unreferenced applies
-- to the entity, indicating that no warning should be given if the
-- entity has no references, but a warning should be given if it is
-- in fact referenced. For private types, this flag is set in both the
@@ -1709,21 +1710,21 @@ package Einfo is
-- use function Has_Unreferenced.
-- Has_Pragma_Unreferenced_Objects (Flag212)
--- Present in type and subtype entities. Set if a valid pragma
+-- Defined in type and subtype entities. Set if a valid pragma
-- Unreferenced_Objects applies to the type, indicating that no warning
-- should be given for objects of such a type for being unreferenced
-- (but unlike the case with pragma Unreferenced, it is ok to reference
-- such an object and no warning is generated.
-- Has_Predicates (Flag250)
--- Present in all entities. Set in type and subtype entities if a pragma
+-- 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.
-- Has_Primitive_Operations (Flag120) [base type only]
--- Present in all type entities. Set if at least one primitive operation
+-- Defined in all type entities. Set if at least one primitive operation
-- is defined for the type.
-- Has_Private_Ancestor (Flag151)
@@ -1735,14 +1736,14 @@ package Einfo is
-- This is part of AI05-0115.
-- Has_Private_Declaration (Flag155)
--- Present in all entities. Returns True if it is the defining entity
+-- Defined in all entities. Returns True if it is the defining entity
-- of a private type declaration or its corresponding full declaration.
-- This flag is thus preserved when the full and the partial views are
-- exchanged, to indicate if a full type declaration is a completion.
-- Used for semantic checks in E.4(18) and elsewhere.
-- Has_Qualified_Name (Flag161)
--- Present in all entities. Set True if the name in the Chars field
+-- Defined in all entities. Set True if the name in the Chars field
-- has been replaced by its qualified name, as used for debug output.
-- See Exp_Dbug for a full description of qualification requirements.
-- For some entities, the name is the fully qualified name, but there
@@ -1752,37 +1753,37 @@ package Einfo is
-- indeed include the fully qualified name.
-- Has_RACW (Flag214)
--- Present in package spec entities. Set if the spec contains the
--- declaration of a remote access-to-classwide type.
+-- Defined in package spec entities. Set if the spec contains the
+-- declaration of a remote access-to-classwide type.
-- Has_Record_Rep_Clause (Flag65) [implementation base type only]
--- Present in record types. Set if a record representation clause has
+-- Defined in record types. Set if a record representation clause has
-- been given for this record type. Used to prevent more than one such
-- clause for a given record type. Note that this is initially cleared
-- for a derived type, even though the representation is inherited. See
-- also the flag Has_Specified_Layout.
-- Has_Recursive_Call (Flag143)
--- Present in procedures. Set if a direct parameterless recursive call
+-- Defined in procedures. Set if a direct parameterless recursive call
-- is detected while analyzing the body. Used to activate some error
-- checks for infinite recursion.
-- Has_Size_Clause (Flag29)
--- Present in entities for types and objects. Set if a size clause is
--- present for the entity. Used to prevent multiple Size clauses for a
+-- Defined in entities for types and objects. Set if a size clause is
+-- Defined for the entity. Used to prevent multiple Size clauses for a
-- given entity. Note that it is always initially cleared for a derived
-- type, even though the Size for such a type is inherited from a Size
-- clause given for the parent type.
-- Has_Small_Clause (Flag67)
--- Present in ordinary fixed point types (but not subtypes). Indicates
+-- Defined in ordinary fixed point types (but not subtypes). Indicates
-- that a small clause has been given for the entity. Used to prevent
-- multiple Small clauses for a given entity. Note that it is always
-- initially cleared for a derived type, even though the Small for such
-- a type is inherited from a Small clause given for the parent type.
-- Has_Specified_Layout (Flag100) [implementation base type only]
--- Present in all type entities. Set for a record type or subtype if
+-- Defined in all type entities. Set for a record type or subtype if
-- the record layout has been specified by a record representation
-- clause. Note that this differs from the flag Has_Record_Rep_Clause
-- in that it is inherited by a derived type. Has_Record_Rep_Clause is
@@ -1794,35 +1795,35 @@ package Einfo is
-- Has_Specified_Stream_Output (Flag191)
-- Has_Specified_Stream_Read (Flag192)
-- Has_Specified_Stream_Write (Flag193)
--- Present in all type and subtype entities. Set for a given view if the
+-- Defined in all type and subtype entities. Set for a given view if the
-- corresponding stream-oriented attribute has been defined by an
-- attribute definition clause. When such a clause occurs, a TSS is set
-- on the underlying full view; the flags are used to track visibility of
-- the attribute definition clause for partial or incomplete views.
-- Has_Static_Discriminants (Flag211)
--- Present in record subtypes constrained by discriminant values. Set if
+-- Defined in record subtypes constrained by discriminant values. Set if
-- all the discriminant values have static values, meaning that in the
-- case of a variant record, the component list can be trimmed down to
-- include only the components corresponding to these discriminants.
-- Has_Storage_Size_Clause (Flag23) [implementation base type only]
--- Present in task types and access types. It is set if a Storage_Size
+-- 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
-- one type. Note that this flag is initially cleared for a derived type
-- even though the Storage_Size for such a type is inherited from a
-- Storage_Size clause given for the parent type. Note that in the case
--- of access types, this flag is present only in the root type, since a
+-- of access types, this flag is defined only in the root type, since a
-- storage size clause cannot be given to a derived type.
-- Has_Stream_Size_Clause (Flag184)
--- Present in all entities. It is set for types which have a Stream_Size
+-- Defined in all entities. It is set for types which have a Stream_Size
-- clause attribute. Used to prevent multiple Stream_Size clauses for a
-- given entity, and also whether it is necessary to check for a stream
-- size clause.
-- Has_Task (Flag30) [base type only]
--- Present in all type entities. Set on task types themselves, and also
+-- Defined in all type entities. Set on task types themselves, and also
-- (recursively) on any composite type which has a component for which
-- Has_Task is set. The meaning is that an allocator or declaration of
-- such an object must create the required tasks. Note: the flag is not
@@ -1833,7 +1834,7 @@ package Einfo is
-- referencing a dispatch table whose contents are pointers to thunks.
-- Has_Unchecked_Union (Flag123) [base type only]
--- Present in all type entities. Set on unchecked unions themselves
+-- Defined in all type entities. Set on unchecked unions themselves
-- and (recursively) on any composite type which has a component for
-- which Has_Unchecked_Union is set. The meaning is that a comparison
-- operation for the type is not permitted. Note that the flag is not
@@ -1841,7 +1842,7 @@ package Einfo is
-- the flag Has_Unchecked_Union set.
-- Has_Unknown_Discriminants (Flag72)
--- Present in all entities. Set for types with unknown discriminants.
+-- Defined in all entities. Set for types with unknown discriminants.
-- Types can have unknown discriminants either from their declaration or
-- through type derivation. The use of this flag exactly meets the spec
-- in RM 3.7(26). Note that all class-wide types are considered to have
@@ -1854,14 +1855,14 @@ package Einfo is
-- inherited in certain contexts.
-- Has_Up_Level_Access (Flag215)
--- Present in E_Variable and E_Constant entities. Set if the entity
--- is a local variable declared in a subprogram p and is accessed in
--- a subprogram nested inside p. Currently this flag is only set when
--- VM_Target /= No_VM, for efficiency, since only the .NET back-end
--- makes use of it to generate proper code for up-level references.
+-- Defined in E_Variable and E_Constant entities. Set if the entity
+-- is a local variable declared in a subprogram p and is accessed in
+-- a subprogram nested inside p. Currently this flag is only set when
+-- VM_Target /= No_VM, for efficiency, since only the .NET back-end
+-- makes use of it to generate proper code for up-level references.
-- Has_Volatile_Components (Flag87) [implementation base type only]
--- Present in all types and objects. Set only for an array type or array
+-- Defined in all types and objects. Set only for an array type or array
-- object if a valid pragma Volatile_Components or a valid pragma
-- Atomic_Components applies to the type or object. Note that in the case
-- of an object, this flag is only set on the object if there was an
@@ -1872,7 +1873,7 @@ package Einfo is
-- subtype in the usual manner.
-- Has_Xref_Entry (Flag182)
--- Present in all entities. Set if an entity has an entry in the Xref
+-- Defined in all entities. Set if an entity has an entry in the Xref
-- information generated in ali files. This is true for all source
-- entities in the extended main source file. It is also true of entities
-- in other packages that are referenced directly or indirectly from the
@@ -1881,7 +1882,7 @@ package Einfo is
-- further details).
-- Hiding_Loop_Variable (Node8)
--- Present in variables. Set only if a variable of a discrete type is
+-- Defined in variables. Set only if a variable of a discrete type is
-- hidden by a loop variable in the same local scope, in which case
-- the Hiding_Loop_Variable field of the hidden variable points to
-- the E_Loop_Parameter entity doing the hiding. Used in processing
@@ -1889,7 +1890,7 @@ package Einfo is
-- or is referenced without being set.
-- Homonym (Node4)
--- Present in all entities. Link for list of entities that have the
+-- Defined in all entities. Link for list of entities that have the
-- same source name and that are declared in the same or enclosing
-- scopes. Homonyms in the same scope are overloaded. Used for name
-- resolution and for the generation of debugging information.
@@ -1902,37 +1903,37 @@ package Einfo is
-- returns the entity unchanged.
-- Interface_Alias (Node25)
--- Present in subprograms that cover a primitive operation of an abstract
+-- Defined in subprograms that cover a primitive operation of an abstract
-- interface type. Can be set only if the Is_Hidden flag is also set,
-- since such entities are always hidden. Points to its associated
-- interface subprogram. It is used to register the subprogram in
-- secondary dispatch table of the interface (Ada 2005: AI-251).
-- Interfaces (Elist25)
--- Present in record types and subtypes. List of abstract interfaces
+-- Defined in record types and subtypes. List of abstract interfaces
-- implemented by a tagged type that are not already implemented by the
-- ancestors (Ada 2005: AI-251).
-- In_Package_Body (Flag48)
--- Present in package entities. Set on the entity that denotes the
+-- Defined in package entities. Set on the entity that denotes the
-- package (the defining occurrence of the package declaration) while
-- analyzing and expanding the package body. Reset on completion of
-- analysis/expansion.
-- In_Private_Part (Flag45)
--- Present in all entities. Can be set only in package entities and
+-- Defined in all entities. Can be set only in package entities and
-- objects. For package entities, this flag is set to indicate that the
-- private part of the package is being analyzed. The flag is reset at
-- the end of the package declaration. For objects it indicates that the
-- declaration of the object occurs in the private part of a package.
-- Inner_Instances (Elist23)
--- Present in generic units. Contains element list of units that are
+-- Defined in generic units. Contains element list of units that are
-- instantiated within the given generic. Used to diagnose circular
-- instantiations.
-- Interface_Name (Node21)
--- Present in constants, variables, exceptions, functions, procedures,
+-- Defined in constants, variables, exceptions, functions, procedures,
-- packages, components (JGNAT only), discriminants (JGNAT only), and
-- access to subprograms (JGNAT only). Set to Empty unless an export,
-- import, or interface name pragma has explicitly specified an external
@@ -1956,34 +1957,34 @@ package Einfo is
-- because Java names are case sensitive).
-- Invariant_Procedure (synthesized)
--- Present in types and subtypes. Set for private types if one or more
+-- Defined in types and subtypes. Set for private types if one or more
-- Invariant, or Invariant'Class, or inherited Invariant'Class aspects
-- apply to the type. Points to the entity for a procedure which checks
-- the invariant. This invariant procedure takes a single argument of the
-- given type, and returns if the invariant holds, or raises exception
-- Assertion_Error with an appropriate message if it does not hold. This
--- attribute is present but always empty for private subtypes. This
+-- attribute is defined but always empty for private subtypes. This
-- attribute is also set for the corresponding full type.
--
-- 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.
-- In_Use (Flag8)
--- Present in packages and types. Set when analyzing a use clause for
+-- Defined in packages and types. Set when analyzing a use clause for
-- the corresponding entity. Reset at end of corresponding declarative
-- part. The flag on a type is also used to determine the visibility of
-- the primitive operators of the type.
-- Is_Abstract_Subprogram (Flag19)
--- Present in all subprograms and entries. Set for abstract subprograms.
+-- Defined in all subprograms and entries. Set for abstract subprograms.
-- Always False for enumeration literals and entries. See also
-- Requires_Overriding.
-- Is_Abstract_Type (Flag146)
--- Present in all types. Set for abstract types.
+-- Defined in all types. Set for abstract types.
-- Is_Access_Constant (Flag69)
--- Present in access types and subtypes. Indicates that the keyword
+-- Defined in access types and subtypes. Indicates that the keyword
-- constant was present in the access type definition.
-- Is_Access_Protected_Subprogram_Type (synthesized)
@@ -1994,33 +1995,33 @@ package Einfo is
-- Applies to all entities, true for access types and subtypes
-- Is_Ada_2005_Only (Flag185)
--- Present in all entities, true if a valid pragma Ada_05 or Ada_2005
+-- Defined in all entities, true if a valid pragma Ada_05 or Ada_2005
-- applies to the entity which specifically names the entity, indicating
-- that the entity is Ada 2005 only. Note that this flag is not set if
-- the entity is part of a unit compiled with the normal no-argument form
-- of pragma Ada_05 or Ada_2005.
-- Is_Ada_2012_Only (Flag199)
--- Present in all entities, true if a valid pragma Ada_12 or Ada_2012
+-- Defined in all entities, true if a valid pragma Ada_12 or Ada_2012
-- applies to the entity which specifically names the entity, indicating
-- that the entity is Ada 2012 only. Note that this flag is not set if
-- the entity is part of a unit compiled with the normal no-argument form
-- of pragma Ada_12 or Ada_2012.
-- Is_Aliased (Flag15)
--- Present in all entities. Set for objects and types whose declarations
+-- Defined in all entities. Set for objects and types whose declarations
-- carry the keyword aliased, and on record components that have the
-- keyword. For Ada 2012, also applies to formal parameters.
-- Is_AST_Entry (Flag132)
--- Present in entry entities. Set if a valid pragma AST_Entry applies
+-- Defined in entry entities. Set if a valid pragma AST_Entry applies
-- to the entry. This flag can only be set in OpenVMS versions of GNAT.
-- Note: we also allow the flag to appear in entry families, but given
-- the current implementation of the pragma AST_Entry, this flag will
-- always be False in entry families.
-- Is_Atomic (Flag85)
--- Present in all type entities, and also in constants, components and
+-- Defined in all type entities, and also in constants, components and
-- variables. Set if a pragma Atomic or Shared applies to the entity.
-- In the case of private and incomplete types, this flag is set in
-- both the partial view and the full view.
@@ -2029,14 +2030,14 @@ package Einfo is
-- Applies to all entities, true for array types and subtypes
-- Is_Asynchronous (Flag81)
--- Present in all type entities and in procedure entities. Set
+-- Defined in all type entities and in procedure entities. Set
-- if a pragma Asynchronous applies to the entity.
-- Is_Base_Type (synthesized)
-- Applies to type and subtype entities. True if entity is a base type
-- Is_Bit_Packed_Array (Flag122) [implementation base type only]
--- Present in all entities. This flag is set for a packed array type that
+-- Defined in all entities. This flag is set for a packed array type that
-- is bit packed (i.e. the component size is known by the front end and
-- is in the range 1-7, 9-15, 17-31, or 33-63). Is_Packed is always set
-- if Is_Bit_Packed_Array is set, but it is possible for Is_Packed to be
@@ -2049,34 +2050,34 @@ package Einfo is
-- i.e. Standard.Boolean and all types ultimately derived from it.
-- Is_Called (Flag102)
--- Present in subprograms. Returns true if the subprogram is called
+-- Defined in subprograms. Returns true if the subprogram is called
-- in the unit being compiled or in a unit in the context. Used for
-- inlining.
-- Is_Character_Type (Flag63)
--- Present in all entities. Set for character types and subtypes,
+-- Defined in all entities. Set for character types and subtypes,
-- i.e. enumeration types that have at least one character literal.
-- Is_Child_Unit (Flag73)
--- Present in all entities. Set only for defining entities of program
+-- Defined in all entities. Set only for defining entities of program
-- units that are child units (but False for subunits).
-- Is_Class_Wide_Type (synthesized)
-- Applies to all entities, true for class wide types and subtypes
-- Is_Class_Wide_Equivalent_Type (Flag35)
--- Present in record types and subtypes. Set to True, if the type acts
+-- Defined in record types and subtypes. Set to True, if the type acts
-- as a class-wide equivalent type, i.e. the Equivalent_Type field of
-- some class-wide subtype entity references this record type.
-- Is_Compilation_Unit (Flag149)
--- Present in all entities. Set if the entity is a package or subprogram
+-- Defined in all entities. Set if the entity is a package or subprogram
-- entity for a compilation unit other than a subunit (since we treat
-- subunits as part of the same compilation operation as the ultimate
-- parent, we do not consider them to be separate units for this flag).
-- Is_Completely_Hidden (Flag103)
--- Present in all entities. This flag can be set only for E_Discriminant
+-- Defined in all entities. This flag can be set only for E_Discriminant
-- entities. This flag can be set only for girder discriminants of
-- untagged types. When set, the entity is a girder discriminant of a
-- derived untagged type which is not directly visible in the derived
@@ -2090,7 +2091,7 @@ package Einfo is
-- not both) is true of any type.
-- Is_Concurrent_Record_Type (Flag20)
--- Present in record types and subtypes. Set if the type was created
+-- Defined in record types and subtypes. Set if the type was created
-- by the expander to represent a task or protected type. For every
-- concurrent type, such as record type is constructed, and task and
-- protected objects are instances of this record type at runtime
@@ -2107,37 +2108,37 @@ package Einfo is
-- E_In_Parameter entities.
-- Is_Constrained (Flag12)
--- Present in types or subtypes which may have index, discriminant
+-- Defined in types or subtypes which may have index, discriminant
-- or range constraint (i.e. array types and subtypes, record types
-- and subtypes, string types and subtypes, and all numeric types).
-- Set if the type or subtype is constrained.
-- Is_Constr_Subt_For_U_Nominal (Flag80)
--- Present in all types and subtypes. Set true only for the constructed
+-- Defined in all types and subtypes. Set true only for the constructed
-- subtype of an object whose nominal subtype is unconstrained. Note
-- that the constructed subtype itself will be constrained.
-- Is_Constr_Subt_For_UN_Aliased (Flag141)
--- Present in all types and subtypes. This flag can be set only if
+-- Defined in all types and subtypes. This flag can be set only if
-- Is_Constr_Subt_For_U_Nominal is also set. It indicates that in
-- addition the object concerned is aliased. This flag is used by
-- Gigi to determine whether a template must be constructed.
-- Is_Constructor (Flag76)
--- Present in function and procedure entities. Set if a pragma
+-- Defined in function and procedure entities. Set if a pragma
-- CPP_Constructor applies to the subprogram.
-- Is_Controlled (Flag42) [base type only]
--- Present in all type entities. Indicates that the type is controlled,
+-- Defined in all type entities. Indicates that the type is controlled,
-- i.e. is either a descendant of Ada.Finalization.Controlled or of
-- Ada.Finalization.Limited_Controlled.
-- Is_Controlling_Formal (Flag97)
--- Present in all Formal_Kind entities. Marks the controlling parameters
+-- Defined in all Formal_Kind entities. Marks the controlling parameters
-- of dispatching operations.
-- Is_CPP_Class (Flag74)
--- Present in all type entities, set only for tagged types to which a
+-- Defined in all type entities, set only for tagged types to which a
-- valid pragma Import (CPP, ...) or pragma CPP_Class has been applied.
-- Is_Decimal_Fixed_Point_Type (synthesized)
@@ -2145,7 +2146,7 @@ package Einfo is
-- types and subtypes.
-- Is_Descendent_Of_Address (Flag223)
--- Present in all type and subtype entities. Indicates that a type is an
+-- Defined in all type and subtype entities. Indicates that a type is an
-- address type that is visibly a numeric type. Used for semantic checks
-- on VMS to remove ambiguities in universal integer expressions that may
-- have an address interpretation
@@ -2158,7 +2159,7 @@ package Einfo is
-- and all fixed-point types and subtypes.
-- Is_Discrim_SO_Function (Flag176)
--- Present in all entities. Set only in E_Function entities that Layout
+-- Defined in all entities. Set only in E_Function entities that Layout
-- creates to compute discriminant-dependent dynamic size/offset values.
-- Is_Discriminal (synthesized)
@@ -2170,7 +2171,7 @@ package Einfo is
-- entity is associated with a dispatch table.
-- Is_Dispatching_Operation (Flag6)
--- Present in all entities. Set true for procedures, functions,
+-- Defined in all entities. Set true for procedures, functions,
-- generic procedures and generic functions if the corresponding
-- operation is dispatching.
@@ -2185,25 +2186,25 @@ package Einfo is
-- not both) is true of any type.
-- Is_Eliminated (Flag124)
--- Present in type entities, subprogram entities, and object entities.
+-- Defined in type entities, subprogram entities, and object entities.
-- Indicates that the corresponding entity has been eliminated by use
-- of pragma Eliminate. Also used to mark subprogram entities whose
-- declaration and body are within unreachable code that is removed.
-- Is_Enumeration_Type (synthesized)
--- Present in all entities, true for enumeration types and subtypes
+-- Defined in all entities, true for enumeration types and subtypes
-- Is_Entry (synthesized)
-- Applies to all entities, True only for entry and entry family
-- entities and False for all other entity kinds.
-- Is_Entry_Formal (Flag52)
--- Present in all entities. Set only for entry formals (which can
+-- Defined in all entities. Set only for entry formals (which can
-- only be in, in-out or out parameters). This flag is used to speed
-- up the test for the need to replace references in Exp_Ch2.
-- Is_Exported (Flag99)
--- Present in all entities. Set if the entity is exported. For now we
+-- Defined in all entities. Set if the entity is exported. For now we
-- only allow the export of constants, exceptions, functions, procedures
-- and variables, but that may well change later on. Exceptions can only
-- be exported in the OpenVMS and Java VM implementations of GNAT.
@@ -2213,7 +2214,7 @@ package Einfo is
-- code to process local or library level objects.
-- Is_First_Subtype (Flag70)
--- Present in all entities. True for first subtypes (RM 3.2.1(6)),
+-- Defined in all entities. True for first subtypes (RM 3.2.1(6)),
-- i.e. the entity in the type declaration that introduced the type.
-- This may be the base type itself (e.g. for record declarations and
-- enumeration type declarations), or it may be the first subtype of
@@ -2234,25 +2235,25 @@ package Einfo is
-- Applies to all entities, true for generic IN and IN OUT parameters
-- Is_Formal_Subprogram (Flag111)
--- Present in all entities. Set for generic formal subprograms.
+-- Defined in all entities. Set for generic formal subprograms.
-- Is_For_Access_Subtype (Flag118)
--- Present in E_Private_Subtype and E_Record_Subtype entities. Means the
+-- Defined in E_Private_Subtype and E_Record_Subtype entities. Means the
-- sole purpose of the type is to be designated by an Access_Subtype and
-- hence should not be expanded into components because the type may not
-- have been found or frozen yet.
-- Is_Frozen (Flag4)
--- Present in all type and subtype entities. Set if type or subtype has
+-- Defined in all type and subtype entities. Set if type or subtype has
-- been frozen.
-- Is_Generic_Actual_Type (Flag94)
--- Present in all type and subtype entities. Set in the subtype
+-- Defined in all type and subtype entities. Set in the subtype
-- declaration that renames the generic formal as a subtype of the
-- actual. Guarantees that the subtype is not static within the instance.
-- Is_Generic_Instance (Flag130)
--- Present in all entities. Set to indicate that the entity is an
+-- Defined in all entities. Set to indicate that the entity is an
-- instance of a generic unit, or a formal package (which is an instance
-- of the template).
@@ -2261,7 +2262,7 @@ package Einfo is
-- (generic function, generic subprogram), False for all other entities.
-- Is_Generic_Type (Flag13)
--- Present in all entities. Set for types which are generic formal types.
+-- Defined in all entities. Set for types which are generic formal types.
-- Such types have an Ekind that corresponds to their classification, so
-- the Ekind cannot be used to identify generic formal types.
@@ -2271,7 +2272,7 @@ package Einfo is
-- other entities.
-- Is_Hidden (Flag57)
--- Present in all entities. Set true for all entities declared in the
+-- 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
-- formal package declared without a box. For library level entities,
-- this flag is set if the entity is not publicly visible. This flag
@@ -2281,22 +2282,22 @@ package Einfo is
-- Private_Declaration in sem_ch7).
-- Is_Hidden_Open_Scope (Flag171)
--- Present in all entities. Set true for a scope that contains the
+-- Defined in all entities. Set true for a scope that contains the
-- instantiation of a child unit, and whose entities are not visible
-- during analysis of the instance.
-- Is_Immediately_Visible (Flag7)
--- Present in all entities. Set if entity is immediately visible, i.e.
+-- Defined in all entities. Set if entity is immediately visible, i.e.
-- is defined in some currently open scope (RM 8.3(4)).
-- Is_Implementation_Defined (Flag254)
--- Present in all entities. Set if a pragma Implementation_Defined is
+-- Defined in all entities. Set if a pragma Implementation_Defined is
-- applied to the pragma. Used to mark all implementation defined
-- identifiers in standard library packages, and to implement the
-- restriction No_Implementation_Identifiers.
-- Is_Imported (Flag24)
--- Present in all entities. Set if the entity is imported. For now we
+-- Defined in all entities. Set if the entity is imported. For now we
-- only allow the import of exceptions, functions, procedures, packages.
-- and variables. Exceptions can only be imported in the OpenVMS and
-- Java VM implementations of GNAT. Packages and types can only be
@@ -2309,7 +2310,7 @@ package Einfo is
-- Applies to all entities, true for incomplete types and subtypes
-- Is_Inlined (Flag11)
--- Present in all entities. Set for functions and procedures which are
+-- Defined in all entities. Set for functions and procedures which are
-- to be inlined. For subprograms created during expansion, this flag
-- may be set directly by the expander to request inlining. Also set
-- for packages that contain inlined subprograms, whose bodies must be
@@ -2318,7 +2319,7 @@ package Einfo is
-- of inlined subprograms. See also Has_Pragma_Inline.
-- Is_Instantiated (Flag126)
--- Present in generic packages and generic subprograms. Set if the unit
+-- Defined in generic packages and generic subprograms. Set if the unit
-- is instantiated from somewhere in the extended main source unit. This
-- flag is used to control warnings about the unit being uninstantiated.
-- Also set in a package that is used as an actual for a generic package
@@ -2329,7 +2330,7 @@ package Einfo is
-- Applies to all entities, true for integer types and subtypes
-- Is_Interface (Flag186)
--- Present in record types and subtypes. Set to indicate that the current
+-- Defined in record types and subtypes. Set to indicate that the current
-- entity corresponds with an abstract interface. Because abstract
-- interfaces are conceptually a special kind of abstract tagged types
-- we represent them by means of tagged record types and subtypes
@@ -2338,7 +2339,7 @@ package Einfo is
-- (Ada 2005: AI-251).
-- Is_Internal (Flag17)
--- Present in all entities. Set to indicate an entity created during
+-- Defined in all entities. Set to indicate an entity created during
-- semantic processing (e.g. an implicit type, or a temporary). The
-- current uses of this flag are:
--
@@ -2362,12 +2363,12 @@ package Einfo is
-- also the attribute Interface_Alias.
-- Is_Interrupt_Handler (Flag89)
--- Present in procedures. Set if a pragma Interrupt_Handler applies
+-- Defined in procedures. Set if a pragma Interrupt_Handler applies
-- to the procedure. The procedure must be parameterless, and on all
-- targets except AAMP it must be a protected procedure.
-- Is_Intrinsic_Subprogram (Flag64)
--- Present in functions and procedures. It is set if a valid pragma
+-- Defined in functions and procedures. It is set if a valid pragma
-- Interface or Import is present for this subprogram specifying pragma
-- Intrinsic. Valid means that the name and profile of the subprogram
-- match the requirements of one of the recognized intrinsic subprograms
@@ -2377,7 +2378,7 @@ package Einfo is
-- to intrinsic, which causes intrinsic code to be generated.
-- Is_Itype (Flag91)
--- Present in all entities. Set to indicate that a type is an Itype,
+-- Defined in all entities. Set to indicate that a type is an Itype,
-- which means that the declaration for the type does not appear
-- explicitly in the tree. Instead gigi will elaborate the type when it
-- is first used. Has_Delayed_Freeze can be set for Itypes, and the
@@ -2387,7 +2388,7 @@ package Einfo is
-- to be defined) must be in the same scope as the type.
-- Is_Known_Non_Null (Flag37)
--- Present in all entities. Relevant (and can be set True) only for
+-- Defined in all entities. Relevant (and can be set True) only for
-- objects of an access type. It is set if the object is currently
-- known to have a non-null value (meaning that no access checks
-- are needed). The indication can for example come from assignment
@@ -2408,7 +2409,7 @@ package Einfo is
-- Thus this flag has no meaning to the back end.
-- Is_Known_Null (Flag204)
--- Present in all entities. Relevant (and can be set True) only for
+-- Defined in all entities. Relevant (and can be set True) only for
-- objects of an access type. It is set if the object is currently known
-- to have a null value (meaning that a dereference will surely raise
-- constraint error exception). The indication can come from an
@@ -2418,7 +2419,7 @@ package Einfo is
-- the Is_Known_Non_Null flag apply equally to the Is_Known_Null flag.
-- Is_Known_Valid (Flag170)
--- Present in all entities. Relevant for types (and subtype) and
+-- Defined in all entities. Relevant for types (and subtype) and
-- for objects (and enumeration literals) of a discrete type.
--
-- The purpose of this flag is to implement the requirement stated
@@ -2452,24 +2453,24 @@ package Einfo is
-- Thus this flag has no meaning to the back end.
-- Is_Limited_Composite (Flag106)
--- Present in all entities. Set for composite types that have a limited
+-- Defined in all entities. Set for composite types that have a limited
-- component. Used to enforce the rule that operations on the composite
-- type that depend on the full view of the component do not become
-- visible until the immediate scope of the composite type itself
-- (RM 7.3.1 (5)).
-- Is_Limited_Interface (Flag197)
--- Present in record types and subtypes. True for interface types, if
+-- Defined in record types and subtypes. True for interface types, if
-- interface is declared limited, task, protected, or synchronized, or
-- is derived from a limited interface.
-- Is_Limited_Record (Flag25)
--- Present in all entities. Set to true for record (sub)types if the
+-- Defined in all entities. Set to true for record (sub)types if the
-- record is declared to be limited. Note that this flag is not set
-- simply because some components of the record are limited.
-- Is_Local_Anonymous_Access (Flag194)
--- Present in access types. Set for an anonymous access type to indicate
+-- Defined in access types. Set for an anonymous access type to indicate
-- that the type is created for a record component with an access
-- definition, an array component, or (pre-Ada 2012) a standalone object.
-- Such anonymous types have an accessibility level equal to that of the
@@ -2478,7 +2479,7 @@ package Einfo is
-- (as of Ada 2012) stand-alone objects.
-- Is_Machine_Code_Subprogram (Flag137)
--- Present in subprogram entities. Set to indicate that the subprogram
+-- Defined in subprogram entities. Set to indicate that the subprogram
-- is a machine code subprogram (i.e. its body includes at least one
-- code statement). Also indicates that all necessary semantic checks
-- as required by RM 13.8(3) have been performed.
@@ -2487,7 +2488,7 @@ package Einfo is
-- Applies to all entities. True if entity is a modular integer type
-- Is_Non_Static_Subtype (Flag109)
--- Present in all type and subtype entities. It is set in some (but not
+-- Defined in all type and subtype entities. It is set in some (but not
-- all) cases in which a subtype is known to be non-static. Before this
-- flag was added, the computation of whether a subtype was static was
-- entirely synthesized, by looking at the bounds, and the immediate
@@ -2503,7 +2504,7 @@ package Einfo is
-- tests for static subtypes greatly simplified.
-- Is_Null_Init_Proc (Flag178)
--- Present in procedure entities. Set for generated init proc procedures
+-- Defined in procedure entities. Set for generated init proc procedures
-- (used to initialize composite types), if the code for the procedure
-- is null (i.e. is a return and nothing else). Such null initialization
-- procedures are generated in case some client is compiled using the
@@ -2520,17 +2521,17 @@ package Einfo is
-- including generic formal parameters.
-- Is_Obsolescent (Flag153)
--- Present in all entities. Set for any entity for which a valid pragma
+-- Defined in all entities. Set for any entity for which a valid pragma
-- Obsolescent applies.
-- Is_Only_Out_Parameter (Flag226)
--- Present in formal parameter entities. Set if this parameter is the
+-- Defined in formal parameter entities. Set if this parameter is the
-- only OUT parameter for this formal part. If there is more than one
-- out parameter, or if there is some other IN OUT parameter then this
-- flag is not set in any of them. Used in generation of warnings.
-- Is_Optional_Parameter (Flag134)
--- Present in parameter entities. Set if the parameter is specified as
+-- Defined in parameter entities. Set if the parameter is specified as
-- optional by use of a First_Optional_Parameter argument to one of the
-- extended Import pragmas. Can only be set for OpenVMS versions of GNAT.
@@ -2543,11 +2544,11 @@ package Einfo is
-- False for all other entities.
-- Is_Package_Body_Entity (Flag160)
--- Present in all entities. Set for entities defined at the top level
+-- Defined in all entities. Set for entities defined at the top level
-- of a package body. Used to control externally generated names.
-- Is_Packed (Flag51) [implementation base type only]
--- Present in all type entities. This flag is set only for record and
+-- Defined in all type entities. This flag is set only for record and
-- array types which have a packed representation. There are three
-- cases which cause packing:
--
@@ -2583,7 +2584,7 @@ package Einfo is
-- Is_Packed flag gets turned off.
-- Is_Packed_Array_Type (Flag138)
--- Present in all entities. This flag is set on the entity for the type
+-- Defined in all entities. This flag is set on the entity for the type
-- used to implement a packed array (either a modular type, or a subtype
-- of Packed_Bytes{1,2,4} as appropriate). The flag is set if and only
-- if the type appears in the Packed_Array_Type field of some other type
@@ -2594,26 +2595,26 @@ package Einfo is
-- to the original array type for which this is the packed array type.
-- Is_Potentially_Use_Visible (Flag9)
--- Present in all entities. Set if entity is potentially use visible,
+-- Defined in all entities. Set if entity is potentially use visible,
-- i.e. it is defined in a package that appears in a currently active
-- use clause (RM 8.4(8)). Note that potentially use visible entities
-- are not necessarily use visible (RM 8.4(9-11)).
-- Is_Preelaborated (Flag59)
--- Present in all entities, set in E_Package and E_Generic_Package
+-- Defined in all entities, set in E_Package and E_Generic_Package
-- entities to which a pragma Preelaborate is applied, and also in
-- all entities within such packages. Note that the fact that this
-- flag is set does not necesarily mean that no elaboration code is
-- generated for the package.
-- Is_Primitive (Flag218)
--- Present in overloadable entities and in generic subprograms. Set to
+-- Defined in overloadable entities and in generic subprograms. Set to
-- indicate that this is a primitive operation of some type, which may
-- be a tagged type or a non-tagged type. Used to verify overriding
-- indicators in bodies.
-- Is_Primitive_Wrapper (Flag195)
--- Present in functions and procedures created by the expander to serve
+-- Defined in functions and procedures created by the expander to serve
-- as an indirection mechanism to overriding primitives of concurrent
-- types, entries and protected procedures.
@@ -2622,19 +2623,19 @@ package Einfo is
-- components. Such entities appear as constants or variables.
-- Is_Private_Composite (Flag107)
--- Present in composite types that have a private component. Used to
+-- Defined in composite types that have a private component. Used to
-- enforce the rule that operations on the composite type that depend
-- on the full view of the component, do not become visible until the
-- immediate scope of the composite type itself (7.3.1 (5)). Both this
-- flag and Is_Limited_Composite are needed.
-- Is_Private_Descendant (Flag53)
--- Present in entities that can represent library units (packages,
+-- Defined in entities that can represent library units (packages,
-- functions, procedures). Set if the library unit is itself a private
-- child unit, or if it is the descendent of a private child unit.
-- Is_Private_Primitive (Flag245)
--- Present in subprograms. Set if the operation is a primitive of a
+-- Defined in subprograms. Set if the operation is a primitive of a
-- tagged type (procedure or function dispatching on result) whose
-- full view has not been seen. Used in particular for primitive
-- subprograms of a synchronized type declared between the two views
@@ -2646,24 +2647,24 @@ package Einfo is
-- as well as for record with private types as subtypes
-- Is_Processed_Transient (Flag252)
--- Present in entities of variables and constants. Set when a transient
--- object needs to be finalized and it has already been processed by the
--- transient scope machinery. This flag signals the general finalization
--- mechanism to ignore the transient object.
+-- Defined in entities of variables and constants. Set when a transient
+-- object needs to be finalized and it has already been processed by the
+-- transient scope machinery. This flag signals the general finalization
+-- mechanism to ignore the transient object.
-- Is_Protected_Component (synthesized)
-- Applicable to all entities, true if the entity denotes a private
-- component of a protected type.
-- Is_Protected_Interface (synthesized)
--- Present in types that are interfaces. True if interface is declared
+-- Defined in types that are interfaces. True if interface is declared
-- protected, or is derived from protected interfaces.
-- Is_Protected_Type (synthesized)
-- Applies to all entities, true for protected types and subtypes
-- Is_Public (Flag10)
--- Present in all entities. Set to indicate that an entity defined in
+-- Defined in all entities. Set to indicate that an entity defined in
-- one compilation unit can be referenced from other compilation units.
-- If this reference causes a reference in the generated variable, for
-- example in the case of a variable name, then Gigi will generate an
@@ -2674,7 +2675,7 @@ package Einfo is
-- Corresponding_Concurrent_Type is a protected type.
-- Is_Pure (Flag44)
--- Present in all entities. Set in all entities of a unit to which a
+-- Defined in all entities. Set in all entities of a unit to which a
-- pragma Pure is applied, and also set for the entity of the unit
-- itself. In addition, this flag may be set for any other functions
-- or procedures that are known to be side effect free, so in the case
@@ -2684,16 +2685,16 @@ package Einfo is
-- by access parameters).
-- Is_Pure_Unit_Access_Type (Flag189)
--- Present in access type and subtype entities. Set if the type or
+-- Defined in access type and subtype entities. Set if the type or
-- subtype appears in a pure unit. Used to give an error message at
-- freeze time if the access type has a storage pool.
-- Is_RACW_Stub_Type (Flag244)
--- Present in all types, true for the stub types generated for remote
+-- Defined in all types, true for the stub types generated for remote
-- access-to-class-wide types.
-- Is_Raised (Flag224)
--- Present in exception entities. Set if the entity is referenced by a
+-- Defined in exception entities. Set if the entity is referenced by a
-- a raise statement.
-- Is_Real_Type (synthesized)
@@ -2704,29 +2705,29 @@ package Einfo is
-- includes class-wide types and subtypes (which are also records)
-- Is_Remote_Call_Interface (Flag62)
--- Present in all entities. Set in E_Package and E_Generic_Package
+-- Defined in all entities. Set in E_Package and E_Generic_Package
-- entities to which a pragma Remote_Call_Interface is applied, and
-- also on entities declared in the visible part of such a package.
-- Is_Remote_Types (Flag61)
--- Present in all entities. Set in E_Package and E_Generic_Package
+-- Defined in all entities. Set in E_Package and E_Generic_Package
-- entities to which a pragma Remote_Types is applied, and also on
-- entities declared in the visible part of the spec of such a package.
-- Also set for types which are generic formal types to which the
-- pragma Remote_Access_Type applies.
-- Is_Renaming_Of_Object (Flag112)
--- Present in all entities, set only for a variable or constant for
+-- Defined in all entities, set only for a variable or constant for
-- which the Renamed_Object field is non-empty and for which the
-- renaming is handled by the front end, by macro substitution of
-- a copy of the (evaluated) name tree whereever the variable is used.
-- Is_Return_Object (Flag209)
--- Present in all object entities. True if the object is the return
+-- Defined in all object entities. True if the object is the return
-- object of an extended_return_statement; False otherwise.
-- Is_Safe_To_Reevaluate (Flag249)
--- Present in all entities. Set in variables that are initialized by
+-- Defined in all entities. Set in variables that are initialized by
-- means of an assignment statement. When initialized their contents
-- never change and hence they can be seen by the backend as constants.
-- See also Is_True_Constant.
@@ -2735,7 +2736,7 @@ package Einfo is
-- Applies to all entities, true for scalar types and subtypes
-- Is_Shared_Passive (Flag60)
--- Present in all entities. Set in E_Package and E_Generic_Package
+-- Defined in all entities. Set in E_Package and E_Generic_Package
-- entities to which a pragma Shared_Passive is applied, and also in
-- all entities within such packages.
@@ -2745,7 +2746,7 @@ package Einfo is
-- Wide_Wide_Character).
-- Is_Statically_Allocated (Flag28)
--- Present in all entities. This can only be set True for exception,
+-- Defined in all entities. This can only be set True for exception,
-- variable, constant, and type/subtype entities. If the flag is set,
-- then the variable or constant must be allocated statically rather
-- than on the local stack frame. For exceptions, the meaning is that
@@ -2771,21 +2772,21 @@ package Einfo is
-- entities.
-- Is_Synchronized_Interface (synthesized)
--- Present in types that are interfaces. True if interface is declared
+-- Defined in types that are interfaces. True if interface is declared
-- synchronized, task, or protected, or is derived from a synchronized
-- interface.
-- Is_Tag (Flag78)
--- Present in E_Component and E_Constant entities. For regular tagged
+-- Defined in E_Component and E_Constant entities. For regular tagged
-- type this flag is set on the tag component (whose name is Name_uTag).
-- For CPP_Class tagged types, this flag marks the pointer to the main
-- vtable (i.e. the one to be extended by derivation).
-- Is_Tagged_Type (Flag55)
--- Present in all entities. Set for an entity for a tagged type.
+-- Defined in all entities. Set for an entity for a tagged type.
-- Is_Task_Interface (synthesized)
--- Present in types that are interfaces. True if interface is declared as
+-- Defined in types that are interfaces. True if interface is declared as
-- a task interface, or if it is derived from task interfaces.
-- Is_Task_Record_Type (synthesized)
@@ -2796,7 +2797,7 @@ package Einfo is
-- Applies to all entities. True for task types and subtypes
-- Is_Thunk (Flag225)
--- Present in all entities for subprograms (functions, procedures, and
+-- 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
@@ -2806,13 +2807,13 @@ package Einfo is
-- handle extra actuals associated with accessibility level.
-- Is_Trivial_Subprogram (Flag235)
--- Present in all entities. Set in subprograms where either the body
+-- Defined in all entities. Set in subprograms where either the body
-- consists of a single null statement, or the first or only statement
-- of the body raises an exception. This is used for suppressing certain
-- warnings, see Sem_Ch6.Analyze_Subprogram_Body discussion for details.
-- Is_True_Constant (Flag163)
--- Present in all entities for constants and variables. Set in constants
+-- Defined in all entities for constants and variables. Set in constants
-- and variables which have an initial value specified but which are
-- never assigned, partially or in the whole. For variables, it means
-- that the variable was initialized but never modified, and hence can be
@@ -2825,18 +2826,18 @@ package Einfo is
-- Applies to all entities, true for a type entity
-- Is_Unchecked_Union (Flag117) [implementation base type only]
--- Present in all entities. Set only in record types to which the
+-- Defined in all entities. Set only in record types to which the
-- pragma Unchecked_Union has been validly applied.
-- Is_Underlying_Record_View (Flag246) [base type only]
--- Present in all entities. Set only in record types that represent the
+-- Defined in all entities. Set only in record types that represent the
-- underlying record view. This view is built for derivations of types
-- with unknown discriminants; it is a record with the same structure
-- as its corresponding record type, but whose parent is the full view
-- of the parent in the original type extension.
-- Is_Unsigned_Type (Flag144)
--- Present in all types, but can be set only for discrete and fixed-point
+-- Defined in all types, but can be set only for discrete and fixed-point
-- type and subtype entities. This flag is only valid if the entity is
-- frozen. If set it indicates that the representation is known to be
-- unsigned (i.e. that no negative values appear in the range). This is
@@ -2848,29 +2849,29 @@ package Einfo is
-- at its bounds or the bounds of the corresponding base type.
-- Is_Valued_Procedure (Flag127)
--- Present in procedure entities. Set if an Import_Valued_Procedure
+-- Defined in procedure entities. Set if an Import_Valued_Procedure
-- or Export_Valued_Procedure pragma applies to the procedure entity.
-- Is_Visible_Child_Unit (Flag116)
--- Present in compilation units that are child units. Once compiled,
+-- Defined in compilation units that are child units. Once compiled,
-- child units remain chained to the entities in the parent unit, and
-- a separate flag must be used to indicate whether the names are
-- visible by selected notation, or not.
-- Is_Visible_Formal (Flag206)
--- Present in all entities. Set True for instances of the formals of a
+-- Defined in all entities. Set True for instances of the formals of a
-- formal package. Indicates that the entity must be made visible in the
-- body of the instance, to reproduce the visibility of the generic.
-- This simplifies visibility settings in instance bodies.
-- Is_VMS_Exception (Flag133)
--- Present in all entities. Set only for exception entities where the
+-- Defined in all entities. Set only for exception entities where the
-- exception was specified in an Import_Exception or Export_Exception
-- pragma with the VMS option for Form. See description of these pragmas
-- for details. This flag can only be set in OpenVMS versions of GNAT.
-- Is_Volatile (Flag16)
--- Present in all type entities, and also in constants, components and
+-- Defined in all type entities, and also in constants, components and
-- variables. Set if a pragma Volatile applies to the entity. Also set
-- if pragma Shared or pragma Atomic applies to entity. In the case of
-- private or incomplete types, this flag is set in both the private
@@ -2884,30 +2885,30 @@ package Einfo is
-- rather than testing this flag.
-- Is_Wrapper_Package (synthesized)
--- Present in package entities. Indicates that the package has been
+-- Defined in package entities. Indicates that the package has been
-- created as a wrapper for a subprogram instantiation.
-- Itype_Printed (Flag202)
--- Present in all type and subtype entities. Set in Itypes if the Itype
+-- Defined in all type and subtype entities. Set in Itypes if the Itype
-- has been printed by Sprint. This is used to avoid printing an Itype
-- more than once.
-- Kill_Elaboration_Checks (Flag32)
--- Present in all entities. Set by the expander to kill elaboration
+-- Defined in all entities. Set by the expander to kill elaboration
-- checks which are known not to be needed. Equivalent in effect to
-- the use of pragma Suppress (Elaboration_Checks) for that entity
-- except that the effect is permanent and cannot be undone by a
-- subsequent pragma Unsuppress.
-- Kill_Range_Checks (Flag33)
--- Present in all entities. Equivalent in effect to the use of pragma
+-- Defined in all entities. Equivalent in effect to the use of pragma
-- Suppress (Range_Checks) for that entity except that the result is
-- permanent and cannot be undone by a subsequent pragma Unsuppress.
-- This is currently only used in one odd situation in Sem_Ch3 for
-- record types, and it would be good to get rid of it???
-- Known_To_Have_Preelab_Init (Flag207)
--- Present in all type and subtype entities. If set, then the type is
+-- Defined in all type and subtype entities. If set, then the type is
-- known to have preelaborable initialization. In the case of a partial
-- view of a private type, it is only possible for this to be set if a
-- pragma Preelaborable_Initialization is given for the type. For other
@@ -2916,14 +2917,14 @@ package Einfo is
-- preelaborable initialization.
-- Last_Assignment (Node26)
--- Present in entities for variables, and OUT or IN OUT formals. Set for
+-- Defined in entities for variables, and OUT or IN OUT formals. Set for
-- a local variable or formal to point to the left side of an assignment
-- statement assigning a value to the variable. Cleared if the value of
-- the entity is referenced. Used to warn about dubious assignment
-- statements whose value is not used.
-- Last_Entity (Node20)
--- Present in all entities which act as scopes to which a list of
+-- Defined in all entities which act as scopes to which a list of
-- associated entities is attached (blocks, class subtypes and types,
-- entries, functions, loops, packages, procedures, protected objects,
-- record types and subtypes, private types, task types and subtypes).
@@ -2938,28 +2939,28 @@ package Einfo is
-- definition) or in an entry.
-- Limited_View (Node23)
--- Present in non-generic package entities that are not instances. Bona
+-- Defined in non-generic package entities that are not instances. Bona
-- fide package with the limited-view list through the first_entity and
-- first_private attributes. The elements of this list are the shadow
-- entities created for the types and local packages that are declared
-- in a package appearing in a limited_with clause (Ada 2005: AI-50217)
-- Lit_Indexes (Node15)
--- Present in enumeration types and subtypes. Non-empty only for the
+-- Defined in enumeration types and subtypes. Non-empty only for the
-- case of an enumeration root type, where it contains the entity for
-- the generated indexes entity. See unit Exp_Imgv for full details of
-- the nature and use of this entity for implementing the Image and
-- Value attributes for the enumeration type in question.
-- Lit_Strings (Node16)
--- Present in enumeration types and subtypes. Non-empty only for the
+-- Defined in enumeration types and subtypes. Non-empty only for the
-- case of an enumeration root type, where it contains the entity for
-- the literals string entity. See unit Exp_Imgv for full details of
-- the nature and use of this entity for implementing the Image and
-- Value attributes for the enumeration type in question.
-- Low_Bound_Tested (Flag205)
--- Present in all entities. Currently this can only be set True for
+-- Defined in all entities. Currently this can only be set True for
-- formal parameter entries of a standard unconstrained one-dimensional
-- array or string type. Indicates that an explicit test of the low bound
-- of the formal appeared in the code, e.g. in a pragma Assert. If this
@@ -2967,14 +2968,14 @@ package Einfo is
-- are suppressed.
-- Machine_Radix_10 (Flag84)
--- Present in decimal types and subtypes, set if the Machine_Radix is 10,
+-- Defined in decimal types and subtypes, set if the Machine_Radix is 10,
-- as the result of the specification of a machine radix representation
-- clause. Note that it is possible for this flag to be set without
-- having Has_Machine_Radix_Clause True. This happens when a type is
-- derived from a type with a clause present.
-- Master_Id (Node17)
--- Present in access types and subtypes. Empty unless Has_Task is
+-- Defined in access types and subtypes. Empty unless Has_Task is
-- set for the designated type, in which case it points to the entity
-- for the Master_Id for the access type master. Also set for access-to-
-- limited-class-wide types whose root may be extended with task
@@ -2982,25 +2983,25 @@ package Einfo is
-- used to reference tasks implementing such interface.
-- Materialize_Entity (Flag168)
--- Present in all entities. Set only for renamed obects which should be
+-- Defined in all entities. Set only for renamed obects which should be
-- materialized for debugging purposes. This means that a memory location
-- containing the renamed address should be allocated. This is needed so
-- that the debugger can find the entity.
-- Mechanism (Uint8) (returned as Mechanism_Type)
--- Present in functions and non-generic formal parameters. Indicates
+-- Defined in functions and non-generic formal parameters. Indicates
-- the mechanism to be used for the function return or for the formal
-- parameter. See separate section on passing mechanisms. This field
-- is also set (to the default value of zero) in a subprogram body
-- entity but not used in this context.
-- Modulus (Uint17) [base type only]
--- Present in modular types. Contains the modulus. For the binary case,
+-- Defined in modular types. Contains the modulus. For the binary case,
-- this will be a power of 2, but if Non_Binary_Modulus is set, then it
-- will not be a power of 2.
-- Must_Be_On_Byte_Boundary (Flag183)
--- Present in entities for types and subtypes. Set if objects of the type
+-- Defined in entities for types and subtypes. Set if objects of the type
-- must always be allocated on a byte boundary (more accurately a storage
-- unit boundary). The front end checks that component clauses respect
-- this rule, and the back end ensures that record packing does not
@@ -3008,14 +3009,14 @@ package Einfo is
-- longer than 64 bits where the component size is not a power of 2.
-- Must_Have_Preelab_Init (Flag208)
--- Present in entities for types and subtypes. Set in the full type of a
+-- Defined in entities for types and subtypes. Set in the full type of a
-- private type or subtype if a pragma Has_Preelaborable_Initialization
-- is present for the private type. Used to check that the full type has
-- preelaborable initialization at freeze time (this has to be deferred
-- to the freeze point because of the rule about overriding Initialize).
-- Needs_Debug_Info (Flag147)
--- Present in all entities. Set if the entity requires normal debugging
+-- Defined in all entities. Set if the entity requires normal debugging
-- information to be generated. This is true of all entities that have
-- Comes_From_Source set, and also transitively for entities associated
-- with such components (e.g. their types). It is true for all entities
@@ -3026,7 +3027,7 @@ package Einfo is
-- so that the flag is set properly on subsidiary entities.
-- Needs_No_Actuals (Flag22)
--- Present in callable entities (subprograms, entries, access to
+-- Defined in callable entities (subprograms, entries, access to
-- subprograms) which can be called without actuals because all of
-- their formals (if any) have default values. This flag simplifies the
-- resolution of the syntactic ambiguity involving a call to these
@@ -3035,7 +3036,7 @@ package Einfo is
-- used to resolve various cases of entry calls.
-- Never_Set_In_Source (Flag115)
--- Present in all entities, but can be set only for variables and
+-- Defined in all entities, but can be set only for variables and
-- parameters. This flag is set if the object is never assigned a value
-- in user source code, either by assignment or by being used as an out
-- or in out parameter. Note that this flag is not reset from using an
@@ -3098,7 +3099,7 @@ package Einfo is
-- Returns Empty if there are no more.
-- Next_Entity (Node2)
--- Present in all entities. The entities of a scope are chained, with
+-- Defined in all entities. The entities of a scope are chained, with
-- the head of the list being in the First_Entity field of the scope
-- entity. All entities use the Next_Entity field as a forward pointer
-- for this list, with Empty indicating the end of the list. Since this
@@ -3126,7 +3127,7 @@ package Einfo is
-- nodes for the indexes, not to entities.
-- Next_Inlined_Subprogram (Node12)
--- Present in subprograms. Used to chain inlined subprograms used in
+-- Defined in subprograms. Used to chain inlined subprograms used in
-- the current compilation, in the order in which they must be compiled
-- by Gigi to insure that all inlinings are performed.
@@ -3136,44 +3137,44 @@ package Einfo is
-- for Next, but its use is preferred in this context.
-- Non_Binary_Modulus (Flag58) [base type only]
--- Present in all subtype and type entities. Set for modular integer
+-- Defined in all subtype and type entities. Set for modular integer
-- types if the modulus value is other than a power of 2.
-- Non_Limited_View (Node17)
--- Present in incomplete types that are the shadow entities created
+-- Defined in incomplete types that are the shadow entities created
-- when analyzing a limited_with_clause (Ada 2005: AI-50217). Points to
-- the defining entity in the original declaration.
-- Nonzero_Is_True (Flag162) [base type only]
--- Present in enumeration types. True if any non-zero value is to be
+-- Defined in enumeration types. True if any non-zero value is to be
-- interpreted as true. Currently this is set true for derived Boolean
-- types which have a convention of C, C++ or Fortran.
-- No_Pool_Assigned (Flag131) [root type only]
--- Present in access types. Set if a storage size clause applies to the
+-- Defined in access types. Set if a storage size clause applies to the
-- variable with a static expression value of zero. This flag is used to
-- generate errors if any attempt is made to allocate or free an instance
-- of such an access type. This is set only in the root type, since
-- derived types must have the same pool.
-- No_Return (Flag113)
--- Present in all entities. Always false except in the case of procedures
+-- Defined in all entities. Always false except in the case of procedures
-- and generic procedures for which a pragma No_Return is given.
-- Normalized_First_Bit (Uint8)
--- Present in components and discriminants. Indicates the normalized
+-- Defined in components and discriminants. Indicates the normalized
-- value of First_Bit for the component, i.e. the offset within the
-- lowest addressed storage unit containing part or all of the field.
-- Set to No_Uint if no first bit position is assigned yet.
-- Normalized_Position (Uint14)
--- Present in components and discriminants. Indicates the normalized
+-- Defined in components and discriminants. Indicates the normalized
-- value of Position for the component, i.e. the offset in storage
-- units from the start of the record to the lowest addressed storage
-- unit containing part or all of the field.
-- Normalized_Position_Max (Uint10)
--- Present in components and discriminants. For almost all cases, this
+-- Defined in components and discriminants. For almost all cases, this
-- is the same as Normalized_Position. The one exception is for the case
-- of a discriminated record containing one or more arrays whose length
-- depends on discriminants. In this case, the Normalized_Position_Max
@@ -3184,7 +3185,7 @@ package Einfo is
-- there are default discriminants, and also for the 'Size value).
-- No_Strict_Aliasing (Flag136) [base type only]
--- Present in access types. Set to direct the back end to avoid any
+-- Defined in access types. Set to direct the back end to avoid any
-- optimizations based on an assumption about the aliasing status of
-- objects designated by the access type. For the case of the gcc
-- back end, the effect is as though all references to objects of
@@ -3206,7 +3207,7 @@ package Einfo is
-- formals as a value of type Pos.
-- OK_To_Rename (Flag247)
--- Present only in entities for variables. If this flag is set, it
+-- Defined only in entities for variables. If this flag is set, it
-- means that if the entity is used as the initial value of an object
-- declaration, the object declaration can be safely converted into a
-- renaming to avoid an extra copy. This is set for variables which are
@@ -3217,13 +3218,13 @@ package Einfo is
-- types, it is cheaper to do the copy.
-- OK_To_Reorder_Components (Flag239) [base type only]
--- Present in record types. Set if the back end is permitted to reorder
+-- Defined in record types. Set if the back end is permitted to reorder
-- the components. If not set, the record must be layed out in the order
-- in which the components are declared textually. Currently this flag
-- can only be set by debug switches.
-- Optimize_Alignment_Space (Flag241)
--- A flag present in type, subtype, variable, and constant entities. This
+-- Defined in type, subtype, variable, and constant entities. This
-- flag records that the type or object is to be layed out in a manner
-- consistent with Optimize_Alignment (Space) mode. The compiler and
-- binder ensure a consistent view of any given type or object. If pragma
@@ -3231,7 +3232,7 @@ package Einfo is
-- of the flags Optimize_Alignment_Space/Optimize_Alignment_Time is set.
-- Optimize_Alignment_Time (Flag242)
--- A flag present in type, subtype, variable, and constant entities. This
+-- Defined in type, subtype, variable, and constant entities. This
-- flag records that the type or object is to be layed out in a manner
-- consistent with Optimize_Alignment (Time) mode. The compiler and
-- binder ensure a consistent view of any given type or object. If pragma
@@ -3239,20 +3240,20 @@ package Einfo is
-- of the flags Optimize_Alignment_Space/Optimize_Alignment_Time is set.
-- Original_Access_Type (Node26)
--- Present in E_Access_Subprogram_Type entities. Set only if the access
+-- Defined in E_Access_Subprogram_Type entities. Set only if the access
-- type was generated by the expander as part of processing an access
-- to protected subprogram type. Points to the access to protected
-- subprogram type.
-- Original_Array_Type (Node21)
--- Present in modular types and array types and subtypes. Set only
+-- Defined in modular types and array types and subtypes. Set only
-- if the Is_Packed_Array_Type flag is set, indicating that the type
-- is the implementation type for a packed array, and in this case it
-- points to the original array type for which this is the packed
-- array implementation type.
-- Original_Record_Component (Node22)
--- Present in components, including discriminants. The usage depends
+-- Defined in components, including discriminants. The usage depends
-- on whether the record is a base type and whether it is tagged.
--
-- In base tagged types:
@@ -3272,11 +3273,11 @@ package Einfo is
-- Points to the component in the base type.
-- Overlays_Constant (Flag243)
--- Present in all entities. Set only for a variable for which there is
+-- Defined in all entities. Set only for a variable for which there is
-- an address clause which causes the variable to overlay a constant.
-- Overridden_Operation (Node26)
--- Present in subprograms. For overriding operations, points to the
+-- Defined in subprograms. For overriding operations, points to the
-- user-defined parent subprogram that is being overridden. Note: this
-- attribute uses the same field as Static_Initialization. The latter
-- is only defined for internal initialization procedures, for which
@@ -3284,7 +3285,7 @@ package Einfo is
-- set for init_procs.
-- Package_Instantiation (Node26)
--- Present in packages and generic packages. When present, this field
+-- Defined in packages and generic packages. When defined, this field
-- references an N_Generic_Instantiation node associated with an
-- instantiated package. In the case where the referenced node has
-- been rewritten to an N_Package_Specification, the instantiation
@@ -3296,7 +3297,7 @@ package Einfo is
-- with formal packages. ???
-- Packed_Array_Type (Node23)
--- Present in array types and subtypes, including the string literal
+-- Defined in array types and subtypes, including the string literal
-- subtype case, if the corresponding type is packed (either bit packed
-- or packed to eliminate holes in non-contiguous enumeration type index
-- types). References the type used to represent the packed array, which
@@ -3313,23 +3314,23 @@ package Einfo is
-- is one of E_[In/Out/In_Out]_Parameter)
-- Parent_Subtype (Node19) [base type only]
--- Present in E_Record_Type. Set only for derived tagged types, in which
+-- Defined in E_Record_Type. Set only for derived tagged types, in which
-- case it points to the subtype of the parent type. This is the type
-- that is used as the Etype of the _parent field.
-- Postcondition_Proc (Node8)
--- Present only in procedure entities, saves the entity of the generated
+-- Defined only in procedure entities, saves the entity of the generated
-- postcondition proc if one is present, otherwise is set to Empty. Used
-- to generate the call to this procedure in case the expander inserts
-- implicit return statements.
-- PPC_Wrapper (Node25)
--- Present in entries and entry families. Set only if pre- or post-
+-- Defined in entries and entry families. Set only if pre- or post-
-- conditions are present. The precondition_wrapper body is the original
-- entry call, decorated with the given precondition for the entry.
-- Predicate_Function (synthesized)
--- Present in all types. Set for types for which (Has_Predicates is True)
+-- Defined in all types. Set for types for which (Has_Predicates is True)
-- and for which a predicate procedure has been built that tests that the
-- specified predicates are True. Contains the entity for the function
-- which takes a single argument of the given type, and returns True if
@@ -3339,23 +3340,23 @@ package Einfo is
-- way this is stored is as an element of the Subprograms_For_Type field.
-- Primitive_Operations (synthesized)
--- Present in concurrent types, tagged record types and subtypes, tagged
+-- Defined in concurrent types, tagged record types and subtypes, tagged
-- private types and tagged incomplete types. For concurrent types whose
-- Corresponding_Record_Type (CRT) is available, returns the list of
-- Direct_Primitive_Operations of its CRT; otherwise returns No_Elist.
-- For all the other types returns the Direct_Primitive_Operations.
-- Prival (Node17)
--- Present in private components of protected types. Refers to the entity
+-- Defined in private components of protected types. Refers to the entity
-- of the component renaming declaration generated inside protected
-- subprograms, entries or barrier functions.
-- Prival_Link (Node20)
--- Present in constants and variables which rename private components of
+-- Defined in constants and variables which rename private components of
-- protected types. Set to the original private component.
-- Private_Dependents (Elist18)
--- Present in private (sub)types. Records the subtypes of the private
+-- Defined in private (sub)types. Records the subtypes of the private
-- type, derivations from it, and records and arrays with components
-- dependent on the type.
--
@@ -3386,13 +3387,13 @@ package Einfo is
-- restore the private view saved in the shadow.
-- Protected_Formal (Node22)
--- Present in formal parameters (in, in out and out parameters). Used
+-- Defined in formal parameters (in, in out and out parameters). Used
-- only for formals of protected operations. References corresponding
-- formal parameter in the unprotected version of the operation that
-- is created during expansion.
-- Protected_Body_Subprogram (Node11)
--- Present in protected operations. References the entity for the
+-- Defined in protected operations. References the entity for the
-- subprogram which implements the body of the operation.
-- Protection_Object (Node23)
@@ -3401,32 +3402,32 @@ package Einfo is
-- types.
-- Reachable (Flag49)
--- Present in labels. The flag is set over the range of statements in
+-- Defined in labels. The flag is set over the range of statements in
-- which a goto to that label is legal.
-- Referenced (Flag156)
--- Present in all entities. Set if the entity is referenced, except for
+-- Defined in all entities. Set if the entity is referenced, except for
-- the case of an appearance of a simple variable that is not a renaming
-- as the left side of an assignment in which case Referenced_As_LHS is
-- set instead, or a similar appearance as an out parameter actual, in
-- which case Referenced_As_Out_Parameter is set.
-- Referenced_As_LHS (Flag36):
--- Present in all entities. This flag is set instead of Referenced if a
+-- Defined in all entities. This flag is set instead of Referenced if a
-- simple variable that is not a renaming appears as the left side of an
-- assignment. The reason we distinguish this kind of reference is that
-- we have a separate warning for variables that are only assigned and
-- never read.
-- Referenced_As_Out_Parameter (Flag227):
--- Present in all entities. This flag is set instead of Referenced if a
+-- Defined in all entities. This flag is set instead of Referenced if a
-- simple variable that is not a renaming appears as an actual for an out
-- formal. The reason we distinguish this kind of reference is that
-- we have a separate warning for variables that are only assigned and
-- never read, and out parameters are a special case.
-- Register_Exception_Call (Node20)
--- Present in exception entities. When an exception is declared,
+-- Defined in exception entities. When an exception is declared,
-- a call is expanded to Register_Exception. This field points to
-- the expanded N_Procedure_Call_Statement node for this call. It
-- is used for Import/Export_Exception processing to modify the
@@ -3434,13 +3435,13 @@ package Einfo is
-- used for handling these pragmas at runtime.
-- Related_Array_Object (Node25)
--- Present in array types and subtypes. Used only for the base type
+-- Defined in array types and subtypes. Used only for the base type
-- and subtype created for an anonymous array object. Set to point
-- to the entity of the corresponding array object. Currently used
-- only for type-related error messages.
-- Related_Expression (Node24)
--- Present in variables and types. Set only for internally generated
+-- Defined in variables and types. Set only for internally generated
-- entities, where it may be used to denote the source expression whose
-- elaboration created the variable declaration. If set, it is used
-- for generating clearer messages from CodePeer.
@@ -3449,40 +3450,40 @@ package Einfo is
-- odd to have two mechanisms here???
-- Related_Instance (Node15)
--- Present in the wrapper packages created for subprogram instances.
+-- Defined in the wrapper packages created for subprogram instances.
-- The internal subprogram that implements the instance is inside the
-- wrapper package, but for debugging purposes its external symbol
-- must correspond to the name and scope of the related instance.
-- Related_Type (Node27)
--- Present in components, constants and variables. Set when there is an
+-- Defined in components, constants and variables. Set when there is an
-- associated dispatch table to point to entities containing primary or
-- secondary tags. Not set in the _tag component of record types.
-- Relative_Deadline_Variable (Node26) [implementation base type only]
--- Present in task type entities. This flag is set if a valid and
+-- Defined in task type entities. This flag is set if a valid and
-- effective pragma Relative_Deadline applies to the base type. Points
-- to the entity for a variable that is created to hold the value given
-- in a Relative_Deadline pragma for a task type.
-- Renamed_Entity (Node18)
--- Present in exceptions, packages, subprograms and generic units. Set
+-- Defined in exceptions, packages, subprograms and generic units. Set
-- for entities that are defined by a renaming declaration. Denotes the
-- renamed entity, or transitively the ultimate renamed entity if
-- there is a chain of renaming declarations. Empty if no renaming.
-- Renamed_In_Spec (Flag231)
--- Present in package entities. If a package renaming occurs within
+-- Defined in package entities. If a package renaming occurs within
-- a package spec, then this flag is set on the renamed package. The
-- purpose is to prevent a warning about unused entities in the renamed
-- package. Such a warning would be inappropriate since clients of the
-- package can see the entities in the package via the renaming.
-- Renamed_Object (Node18)
--- Present in all objects (constants, variables, components, formal
+-- Defined in all objects (constants, variables, components, formal
-- parameters, generic formal parameters, and loop parameters).
--- ??? Present in discriminants?
+-- ??? Defined in discriminants?
-- Set non-Empty if the object was declared by a renaming declaration,
-- in which case it references the tree node for the name of the renamed
-- object. This is only possible for the variable and constant cases.
@@ -3493,8 +3494,8 @@ package Einfo is
-- Empty otherwise (it is always empty for loop parameters).
-- Renaming_Map (Uint9)
--- Present in generic subprograms, generic packages, and their
--- instances. Also present in the instances of the corresponding
+-- Defined in generic subprograms, generic packages, and their
+-- instances. Also defined in the instances of the corresponding
-- bodies. Denotes the renaming map (generic entities => instance
-- entities) used to construct the instance by givin an index into
-- the tables used to represent these maps. See Sem_Ch12 for further
@@ -3502,32 +3503,32 @@ package Einfo is
-- instance is the actual corresponding to a formal package.
-- Requires_Overriding (Flag213)
--- Present in all subprograms and entries. Set for subprograms that
+-- Defined in all subprograms and entries. Set for subprograms that
-- require overriding as defined by RM-2005-3.9.3(6/2). Note that this
-- is True only for implicitly declare subprograms; it is not set on the
-- parent type's subprogram. See also Is_Abstract_Subprogram.
-- Return_Present (Flag54)
--- Present in function and generic function entities. Set if the
+-- Defined in function and generic function entities. Set if the
-- function contains a return statement (used for error checking).
-- This flag can also be set in procedure and generic procedure
-- entities (for convenience in setting it), but is only tested
-- for the function case.
-- Return_Applies_To (Node8)
--- Present in E_Return_Statement. Points to the entity representing
+-- Defined in E_Return_Statement. Points to the entity representing
-- the construct to which the return statement applies, as defined in
-- RM-6.5(4/2). Note that a (simple) return statement within an
-- extended_return_statement applies to the extended_return_statement,
-- even though it causes the whole function to return.
-- Returns_By_Ref (Flag90)
--- Present in function entities, to indicate that the function
+-- Defined in function entities, to indicate that the function
-- returns the result by reference, either because its return type is a
-- by-reference-type or because it uses explicitly the secondary stack.
-- Reverse_Bit_Order (Flag164) [base type only]
--- Present in all record type entities. Set if entity has a Bit_Order
+-- Defined in all record type entities. Set if entity has a Bit_Order
-- aspect (set by an aspect clause or attribute definition clause) that
-- has reversed the order of bits from the default value. When this flag
-- is set, a component clause must specify a set of bits entirely within
@@ -3535,7 +3536,7 @@ package Einfo is
-- Ada 2005 AI-133), or must occupy an integral number of storage units.
-- Reverse_Storage_Order (Flag93) [base type only]
--- Present in all record and array type entities. Set if entity has a
+-- Defined in all record and array type entities. Set if entity has a
-- Scalar_Storage_Order aspect (set by an aspect clause or attribute
-- definition clause) that has reversed the order of storage elements
-- from the default value. When this flag is set for a record type,
@@ -3543,7 +3544,7 @@ package Einfo is
-- or as the target default value).
-- RM_Size (Uint13)
--- Present in all type and subtype entities. Contains the value of
+-- Defined in all type and subtype entities. Contains the value of
-- type'Size as defined in the RM. See also the Esize field and
-- and the description on "Handling of Type'Size Values". A value
-- of zero in this field for a non-discrete type means that
@@ -3562,7 +3563,7 @@ package Einfo is
-- in the RM root type applies to a class of types, not to a type.
-- Scalar_Range (Node20)
--- Present in all scalar types (including modular types, where the
+-- Defined in all scalar types (including modular types, where the
-- bounds are 0 .. modulus - 1). References a node in the tree that
-- contains the bounds for the range. Note that this information
-- could be obtained by rummaging around the tree, but it is more
@@ -3572,12 +3573,12 @@ package Einfo is
-- subtype reference (a subtype is converted into a range).
-- Scale_Value (Uint15)
--- Present in decimal fixed-point types and subtypes. Contains the scale
+-- Defined in decimal fixed-point types and subtypes. Contains the scale
-- for the type (i.e. the value of type'Scale = the number of decimal
-- digits after the decimal point).
-- Scope (Node3)
--- Present in all entities. Points to the entity for the scope (block,
+-- Defined in all entities. Points to the entity for the scope (block,
-- loop, subprogram, package etc.) in which the entity is declared.
-- Since this field is in the base part of the entity node, the access
-- routines for this field are in Sinfo. Note that for a child package,
@@ -3592,7 +3593,7 @@ package Einfo is
-- is the Scope_Depth of the record scope.
-- Scope_Depth_Value (Uint22)
--- Present in program units, blocks, concurrent types, and entries.
+-- Defined in program units, blocks, concurrent types, and entries.
-- Indicates the number of scopes that statically enclose the declaration
-- of the unit or type. Library units have a depth of zero. Note that
-- record types can act as scopes but do NOT have this field set (see
@@ -3604,13 +3605,13 @@ package Einfo is
-- needed, since returns an invalid value in this case!
-- Sec_Stack_Needed_For_Return (Flag167)
--- Present in scope entities (blocks, functions, procedures, tasks,
+-- Defined in scope entities (blocks, functions, procedures, tasks,
-- entries). Set to True when secondary stack is used to hold the
-- returned value of a function and thus should not be released on
-- scope exit.
-- Shadow_Entities (List14)
--- Present in package and generic package entities. Points to a list
+-- Defined in package and generic package entities. Points to a list
-- of entities that correspond to private types. For each private type
-- a shadow entity is created that holds a copy of the private view.
-- In regions of the program where the full views of these private
@@ -3622,12 +3623,12 @@ package Einfo is
-- entry and subsequent entries are obtained using Next.
-- Shared_Var_Procs_Instance (Node22)
--- Present in variables. Set non-Empty only if Is_Shared_Passive is
+-- Defined in variables. Set non-Empty only if Is_Shared_Passive is
-- set, in which case this is the entity for the associated instance of
-- System.Shared_Storage.Shared_Var_Procs. See Exp_Smem for full details.
-- Size_Check_Code (Node19)
--- Present in constants and variables. Normally Empty. Set if code is
+-- Defined in constants and variables. Normally Empty. Set if code is
-- generated to check the size of the object. This field is used to
-- suppress this code if a subsequent address clause is encountered.
@@ -3641,13 +3642,13 @@ package Einfo is
-- is not applicable to the entity.
-- Size_Depends_On_Discriminant (Flag177)
--- Present in all entities for types and subtypes. Indicates that the
+-- Defined in all entities for types and subtypes. Indicates that the
-- size of the type depends on the value of one or more discriminants.
-- Currently, this flag is only set for arrays which have one or more
-- bounds depending on a discriminant value.
-- Size_Known_At_Compile_Time (Flag92)
--- Present in all entities for types and subtypes. Indicates that the
+-- Defined in all entities for types and subtypes. Indicates that the
-- size of objects of the type is known at compile time. This flag is
-- used to optimize some generated code sequences, and also to enable
-- some error checks (e.g. disallowing component clauses on variable
@@ -3657,18 +3658,18 @@ package Einfo is
-- assume that it is not known).
-- Small_Value (Ureal21)
--- Present in fixed point types. Points to the universal real for the
+-- Defined in fixed point types. Points to the universal real for the
-- Small of the type, either as given in a representation clause, or
-- as computed (as a power of two) by the compiler.
-- Spec_Entity (Node19)
--- Present in package body entities. Points to corresponding package
--- spec entity. Also present in subprogram body parameters in the
+-- Defined in package body entities. Points to corresponding package
+-- spec entity. Also defined in subprogram body parameters in the
-- case where there is a separate spec, where this field references
-- the corresponding parameter entities in the spec.
-- Static_Predicate (List25)
--- Present in discrete types/subtypes with predicates (Has_Predicates
+-- Defined in discrete types/subtypes with predicates (Has_Predicates
-- set True). Set if the type/subtype has a static predicate. Points to
-- a list of expression and N_Range nodes that represent the predicate
-- in canonical form. The canonical form has entries sorted in ascending
@@ -3679,7 +3680,7 @@ package Einfo is
-- within the subtype range.
-- Status_Flag_Or_Transient_Decl (Node15)
--- Present in variables and constants. Applies to objects that require
+-- Defined in variables and constants. Applies to objects that require
-- special treatment by the finalization machinery. Such examples are
-- extended return results, if and case expression results and objects
-- inside N_Expression_With_Actions nodes. The attribute contains the
@@ -3687,22 +3688,22 @@ package Einfo is
-- of code or the declaration of a "hook" object.
-- Storage_Size_Variable (Node15) [implementation base type only]
--- Present in access types and task type entities. This flag is set
+-- Defined in access types and task type entities. This flag is set
-- if a valid and effective pragma Storage_Size applies to the base
-- type. Points to the entity for a variable that is created to
-- hold the value given in a Storage_Size pragma for an access
-- collection or a task type. Note that in the access type case,
--- this field is present only in the root type (since derived types
+-- this field is defined only in the root type (since derived types
-- share the same storage pool).
-- Static_Elaboration_Desired (Flag77)
--- Present in library-level packages. Set by the pragma of the same
+-- Defined in library-level packages. Set by the pragma of the same
-- name, to indicate that static initialization must be attempted for
-- all types declared in the package, and that a warning must be emitted
-- for those types to which static initialization is not available.
-- Static_Initialization (Node26)
--- Present in initialization procedures for types whose objects can be
+-- Defined in initialization procedures for types whose objects can be
-- initialized statically. The value of this attribute is a positional
-- aggregate whose components are compile-time static values. Used
-- when available in object declarations to eliminate the call to the
@@ -3711,31 +3712,31 @@ package Einfo is
-- irrelevant in init_procs.
-- Stored_Constraint (Elist23)
--- Present in entities that can have discriminants (concurrent types
+-- Defined in entities that can have discriminants (concurrent types
-- subtypes, record types and subtypes, private types and subtypes,
-- limited private types and subtypes and incomplete types). Points
-- to an element list containing the expressions for each of the
-- stored discriminants for the record (sub)type.
-- Strict_Alignment (Flag145) [implementation base type only]
--- Present in all type entities. Indicates that some containing part
+-- Defined in all type entities. Indicates that some containing part
-- is either aliased or tagged. This prohibits packing the object
-- tighter than its natural size and alignment.
-- String_Literal_Length (Uint16)
--- Present in string literal subtypes (which are created to correspond
+-- Defined in string literal subtypes (which are created to correspond
-- to string literals in the program). Contains the length of the string
-- literal.
-- String_Literal_Low_Bound (Node15)
--- Present in string literal subtypes (which are created to correspond
+-- Defined in string literal subtypes (which are created to correspond
-- to string literals in the program). Contains an expression whose
-- value represents the low bound of the literal. This is a copy of
-- the low bound of the applicable index constraint if there is one,
-- or a copy of the low bound of the index base type if not.
-- Subprograms_For_Type (Node29)
--- Present in all type entities, and in subprogram entities. This is used
+-- Defined in all type entities, and in subprogram entities. This is used
-- to hold a list of subprogram entities for subprograms associated with
-- the type, linked through the Subprogram_List field of the subprogram
-- entity. Basically this is a way of multiplexing the single field to
@@ -3745,7 +3746,7 @@ package Einfo is
-- names to access entries in this list.
-- Suppress_Elaboration_Warnings (Flag148)
--- Present in all entities, can be set only for subprogram entities and
+-- Defined in all entities, can be set only for subprogram entities and
-- for variables. If this flag is set then Sem_Elab will not generate
-- elaboration warnings for the subprogram or variable. Suppression of
-- such warnings is automatic for subprograms for which elaboration
@@ -3756,7 +3757,7 @@ package Einfo is
-- avoid multiple elaboration warnings for the same variable.
-- Suppress_Initialization (Flag105)
--- Present in all type and subtype entities. If set for the base type,
+-- Defined in all type and subtype entities. If set for the base type,
-- then the generation of initialization procedures is suppressed for the
-- type. Any other implicit initialiation (e.g. from the use of pragma
-- Initialize_Scalars) is also suppressed if this flag is set either for
@@ -3766,17 +3767,17 @@ package Einfo is
-- table entities set it.
-- Suppress_Style_Checks (Flag165)
--- Present in all entities. Suppresses any style checks specifically
+-- Defined in all entities. Suppresses any style checks specifically
-- associated with the given entity if set.
-- Suppress_Value_Tracking_On_Call (Flag217)
--- Present in all entities. Set in a scope entity if value tracking is to
+-- Defined in all entities. Set in a scope entity if value tracking is to
-- be suppressed on any call within the scope. Used when an access to a
-- local subprogram is computed, to deal with the possibility that this
-- value may be passed around, and if used, may clobber a local variable.
-- Task_Body_Procedure (Node25)
--- Present in task types and subtypes. Points to the entity for the task
+-- Defined in task types and subtypes. Points to the entity for the task
-- task body procedure (as further described in Exp_Ch9, task bodies are
-- expanded into procedures). A convenient function to retrieve this
-- field is Sem_Util.Get_Task_Body_Procedure.
@@ -3785,7 +3786,7 @@ package Einfo is
-- Underlying_Type of the Root_Type???
-- Treat_As_Volatile (Flag41)
--- Present in all type entities, and also in constants, components and
+-- Defined in all type entities, and also in constants, components and
-- variables. Set if this entity is to be treated as volatile for code
-- generation purposes. Always set if Is_Volatile is set, but can also
-- be set as a result of situations (such as address overlays) where
@@ -3816,7 +3817,7 @@ package Einfo is
-- bound is in units of small, and is an integer.
-- Underlying_Full_View (Node19)
--- Present in private subtypes that are the completion of other private
+-- Defined in private subtypes that are the completion of other private
-- types, or in private types that are derived from private subtypes. If
-- the full view of a private type T is derived from another private type
-- with discriminants Td, the full view of T is also private, and there
@@ -3830,7 +3831,7 @@ package Einfo is
-- can serve directly as the full view of T.
-- Underlying_Record_View (Node28)
--- Present in record types. Set for record types that are extensions of
+-- Defined in record types. Set for record types that are extensions of
-- types with unknown discriminants, and also set for internally built
-- underlying record views to reference its original record type. Record
-- types that are extensions of types with unknown discriminants do not
@@ -3851,7 +3852,7 @@ package Einfo is
-- type, its underlying type is taken.
-- Universal_Aliasing (Flag216) [implementation base type only]
--- Present in all type entities. Set to direct the back-end to avoid
+-- Defined in all type entities. Set to direct the back-end to avoid
-- any optimizations based on type-based alias analysis for this type.
-- Indicates that objects of this type can alias objects of any other
-- types, which guarantees that any objects can be referenced through
@@ -3860,57 +3861,57 @@ package Einfo is
-- types designating this type were subject to No_Strict_Aliasing.
-- Unset_Reference (Node16)
--- Present in variables and out parameters. This is normally Empty. It
+-- Defined in variables and out parameters. This is normally Empty. It
-- is set to point to an identifier that represents a reference to the
-- entity before any value has been set. Only the first such reference
-- is identified. This field is used to generate a warning message if
-- necessary (see Sem_Warn.Check_Unset_Reference).
-- Used_As_Generic_Actual (Flag222)
--- Present in all entities, set if the entity is used as an argument to
+-- Defined in all entities, set if the entity is used as an argument to
-- a generic instantiation. Used to tune certain warning messages.
-- Uses_Lock_Free (Flag188)
--- Present in protected type entities. Set to True when the Lock Free
+-- Defined in protected type entities. Set to True when the Lock Free
-- implementation is used for the protected type. This implemenatation is
-- based on atomic transactions and doesn't require anymore the use of
-- Protection object (see System.Tasking.Protected_Objects).
-- Uses_Sec_Stack (Flag95)
--- Present in scope entities (blocks,functions, procedures, tasks,
+-- Defined in scope entities (blocks,functions, procedures, tasks,
-- entries). Set to True when secondary stack is used in this scope and
-- must be released on exit unless Sec_Stack_Needed_For_Return is set.
-- Warnings_Off (Flag96)
--- Present in all entities. Set if a pragma Warnings (Off, entity-name)
+-- Defined in all entities. Set if a pragma Warnings (Off, entity-name)
-- is used to suppress warnings for a given entity. It is also used by
-- the compiler in some situations to kill spurious warnings. Note that
-- clients should generally not test this flag directly, but instead
-- use function Has_Warnings_Off.
-- Warnings_Off_Used (Flag236)
--- Present in all entities. Can only be set if Warnings_Off is set. If
+-- Defined in all entities. Can only be set if Warnings_Off is set. If
-- set indicates that a warning was suppressed by the Warnings_Off flag,
-- and Unmodified/Unreferenced would not have suppressed the warning.
-- Warnings_Off_Used_Unmodified (Flag237)
--- Present in all entities. Can only be set if Warnings_Off is set and
+-- Defined in all entities. Can only be set if Warnings_Off is set and
-- Has_Pragma_Unmodified is not set. If set indicates that a warning was
-- suppressed by the Warnings_Off status but that pragma Unmodified
-- would also have suppressed the warning.
-- Warnings_Off_Used_Unreferenced (Flag238)
--- Present in all entities. Can only be set if Warnings_Off is set and
+-- Defined in all entities. Can only be set if Warnings_Off is set and
-- Has_Pragma_Unreferenced is not set. If set indicates that a warning
-- was suppressed by the Warnings_Off status but that pragma Unreferenced
-- would also have suppressed the warning.
-- Was_Hidden (Flag196)
--- Present in all entities. Used to save the value of the Is_Hidden
+-- Defined in all entities. Used to save the value of the Is_Hidden
-- attribute when the limited-view is installed (Ada 2005: AI-217).
-- Wrapped_Entity (Node27)
--- Present in functions and procedures which have been classified as
+-- Defined in functions and procedures which have been classified as
-- Is_Primitive_Wrapper. Set to the entity being wrapper.
--------------------------------------
diff --git a/gcc/ada/exp_alfa.adb b/gcc/ada/exp_alfa.adb
index 2a640fd5423..69a6e2b0cec 100644
--- a/gcc/ada/exp_alfa.adb
+++ b/gcc/ada/exp_alfa.adb
@@ -81,6 +81,14 @@ package body Exp_Alfa is
when N_Attribute_Reference =>
Expand_Alfa_N_Attribute_Reference (N);
+ -- Qualification of entity names in formal verification mode
+ -- is limited to the addition of a suffix for homonyms (see
+ -- Exp_Dbug.Qualify_Entity_Name). We used to qualify entity names
+ -- as full expansion does, but this was removed as this prevents the
+ -- verification back-end from using a short name for debugging and
+ -- user interaction. The verification back-end already takes care
+ -- of qualifying names when needed.
+
when N_Block_Statement |
N_Package_Body |
N_Package_Declaration |
@@ -97,6 +105,9 @@ package body Exp_Alfa is
when N_In =>
Expand_Alfa_N_In (N);
+ -- A NOT IN B gets transformed to NOT (A IN B). This is the same
+ -- expansion used in the normal case, so shared the code.
+
when N_Not_In =>
Expand_N_Not_In (N);
@@ -106,6 +117,8 @@ package body Exp_Alfa is
when N_Simple_Return_Statement =>
Expand_Alfa_N_Simple_Return_Statement (N);
+ -- In Alfa mode, no other constructs require expansion
+
when others =>
null;
end case;
diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb
index 04930a9bd7c..1b50d293f8c 100644
--- a/gcc/ada/exp_attr.adb
+++ b/gcc/ada/exp_attr.adb
@@ -5141,7 +5141,8 @@ package body Exp_Attr is
begin
Rewrite (N,
Build_To_Any_Call
- (Convert_To (P_Type,
+ (Loc,
+ Convert_To (P_Type,
Relocate_Node (First (Exprs))), Decls));
Insert_Actions (N, Decls);
Analyze_And_Resolve (N, RTE (RE_Any));
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index af5dadd9abc..f7081a6480d 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -1537,7 +1537,12 @@ package body Exp_Ch3 is
Append_To (Args, Make_Identifier (Loc, Name_uMaster));
end if;
- Append_To (Args, Make_Identifier (Loc, Name_uChain));
+ -- Add _Chain (not done in the restricted profile because not used,
+ -- see comment for Create_Restricted_Task in s-tarest.ads).
+
+ if not Restricted_Profile then
+ Append_To (Args, Make_Identifier (Loc, Name_uChain));
+ end if;
-- Ada 2005 (AI-287): In case of default initialized components
-- with tasks, we generate a null string actual parameter.
@@ -1699,6 +1704,18 @@ package body Exp_Ch3 is
end if;
end if;
+ -- When the object is either protected or a task, create static strings
+ -- which denote the names of entries and families. Associate the strings
+ -- with the concurrent object's Protection_Entries or ATCB. This is a
+ -- VMS Debug feature.
+
+ if OpenVMS_On_Target
+ and then Is_Concurrent_Type (Typ)
+ and then Entry_Names_OK
+ then
+ Build_Entry_Names (Id_Ref, Typ, Res);
+ end if;
+
return Res;
exception
@@ -1987,7 +2004,14 @@ package body Exp_Ch3 is
Append_To (Args, Make_Identifier (Loc, Name_uMaster));
end if;
- Append_To (Args, Make_Identifier (Loc, Name_uChain));
+ if not Restricted_Profile then
+
+ -- No _Chain for the restricted profile because not used,
+ -- see comment of Create_Restricted_Task in s-tarest.ads.
+
+ Append_To (Args, Make_Identifier (Loc, Name_uChain));
+ end if;
+
Append_To (Args, Make_Identifier (Loc, Name_uTask_Name));
First_Discr_Param := Next (Next (Next (First_Discr_Param)));
end if;
@@ -2653,7 +2677,6 @@ package body Exp_Ch3 is
Decl : Node_Id;
Has_POC : Boolean;
Id : Entity_Id;
- Names : Node_Id;
Stmts : List_Id;
Typ : Entity_Id;
@@ -2997,17 +3020,6 @@ package body Exp_Ch3 is
Append_To (Stmts, Make_Task_Create_Call (Rec_Type));
- -- Generate the statements which map a string entry name to a
- -- task entry index. Note that the task may not have entries.
-
- if Entry_Names_OK then
- Names := Build_Entry_Names (Rec_Type);
-
- if Present (Names) then
- Append_To (Stmts, Names);
- end if;
- end if;
-
declare
Task_Type : constant Entity_Id :=
Corresponding_Concurrent_Type (Rec_Type);
@@ -3061,18 +3073,6 @@ package body Exp_Ch3 is
if Is_Protected_Record_Type (Rec_Type) then
Append_List_To (Stmts,
Make_Initialize_Protection (Rec_Type));
-
- -- Generate the statements which map a string entry name to a
- -- protected entry index. Note that the protected type may not
- -- have entries.
-
- if Entry_Names_OK then
- Names := Build_Entry_Names (Rec_Type);
-
- if Present (Names) then
- Append_To (Stmts, Names);
- end if;
- end if;
end if;
-- Second pass: components with per-object constraints
@@ -3101,8 +3101,7 @@ package body Exp_Ch3 is
Clean_Task_Names (Typ, Proc_Id);
- -- Preserve the initialization state in the current
- -- counter.
+ -- Preserve initialization state in the current counter
if Needs_Finalization (Typ) then
if No (Counter_Id) then
@@ -7791,24 +7790,30 @@ package body Exp_Ch3 is
Make_Parameter_Specification (Loc,
Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_uMaster),
- Parameter_Type => New_Reference_To (RTE (RE_Master_Id), Loc)));
+ Parameter_Type =>
+ New_Reference_To (RTE (RE_Master_Id), Loc)));
- Append_To (Formals,
- Make_Parameter_Specification (Loc,
- Defining_Identifier =>
- Make_Defining_Identifier (Loc, Name_uChain),
- In_Present => True,
- Out_Present => True,
- Parameter_Type =>
- New_Reference_To (RTE (RE_Activation_Chain), Loc)));
+ if not Restricted_Profile then
+
+ -- No _Chain for the restricted profile because not used, see
+ -- comment for Create_Restricted_Task in s-tarest.ads.
+
+ Append_To (Formals,
+ Make_Parameter_Specification (Loc,
+ Defining_Identifier =>
+ Make_Defining_Identifier (Loc, Name_uChain),
+ In_Present => True,
+ Out_Present => True,
+ Parameter_Type =>
+ New_Reference_To (RTE (RE_Activation_Chain), Loc)));
+ end if;
Append_To (Formals,
Make_Parameter_Specification (Loc,
Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_uTask_Name),
- In_Present => True,
- Parameter_Type =>
- New_Reference_To (Standard_String, Loc)));
+ In_Present => True,
+ Parameter_Type => New_Reference_To (Standard_String, Loc)));
end if;
return Formals;
@@ -7907,7 +7912,7 @@ package body Exp_Ch3 is
(RTE (RE_Set_Dynamic_Offset_To_Top), Loc),
Parameter_Associations => New_List (
Make_Attribute_Reference (Loc,
- Prefix => New_Copy_Tree (Target),
+ Prefix => New_Copy_Tree (Target),
Attribute_Name => Name_Address),
Unchecked_Convert_To (RTE (RE_Tag),
@@ -7920,7 +7925,7 @@ package body Exp_Ch3 is
Make_Attribute_Reference (Loc,
Prefix =>
Make_Selected_Component (Loc,
- Prefix => New_Copy_Tree (Target),
+ Prefix => New_Copy_Tree (Target),
Selector_Name =>
New_Reference_To (Tag_Comp, Loc)),
Attribute_Name => Name_Position)),
@@ -7946,18 +7951,17 @@ package body Exp_Ch3 is
(Offset_To_Top_Comp, Loc)),
Expression =>
Make_Attribute_Reference (Loc,
- Prefix =>
+ Prefix =>
Make_Selected_Component (Loc,
- Prefix => New_Copy_Tree (Target),
- Selector_Name =>
- New_Reference_To (Tag_Comp, Loc)),
+ Prefix => New_Copy_Tree (Target),
+ Selector_Name => New_Reference_To (Tag_Comp, Loc)),
Attribute_Name => Name_Position)));
-- Normal case: No discriminants in the parent type
else
- -- Don't need to set any value if this interface shares
- -- the primary dispatch table.
+ -- Don't need to set any value if this interface shares the
+ -- primary dispatch table.
if not Is_Ancestor (Iface, Typ, Use_Full_View => True) then
Append_To (Stmts_List,
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index ee9ce0c50f2..ebdbcdeb316 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -3877,8 +3877,8 @@ package body Exp_Ch4 is
end if;
-- Right operand is a subtype name and the subtype has a predicate. We
- -- have to make sure predicate is checked, and for that we need to use
- -- the standard N_In circuitry with appropriate types.
+ -- have to make sure the predicate is checked, and for that we need to
+ -- use the standard N_In circuitry with appropriate types.
else
pragma Assert (Present (Predicate_Function (Etype (Rop))));
@@ -3921,7 +3921,7 @@ package body Exp_Ch4 is
-- Bnn
-- end
- -- A bit gruesome, but here goes.
+ -- A bit gruesome, but there doesn't seem to be a simpler way
declare
Blk : constant Node_Id := Make_Bignum_Block (Loc);
@@ -3937,10 +3937,8 @@ package body Exp_Ch4 is
Nin :=
Make_In (Loc,
- Left_Opnd =>
- Convert_To (Base_Type (Etype (Rop)),
- New_Occurrence_Of (Lnn, Loc)),
- Right_Opnd => New_Occurrence_Of (Etype (Rop), Loc));
+ Left_Opnd => Convert_To (TB, New_Occurrence_Of (Lnn, Loc)),
+ Right_Opnd => New_Occurrence_Of (T, Loc));
Set_No_Minimize_Eliminate (Nin);
-- Now decorate the block
diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb
index 8a7089eff06..82a7a309c72 100644
--- a/gcc/ada/exp_ch9.adb
+++ b/gcc/ada/exp_ch9.adb
@@ -911,10 +911,16 @@ package body Exp_Ch9 is
-- Start of processing for Build_Activation_Chain_Entity
begin
+ -- Activation chain is never used in restricted profile, see comment
+ -- for Create_Restricted_Task in s-tarest.ads.
+
+ if Restricted_Profile then
+ return;
+ end if;
+
Find_Enclosing_Context (N, Context, Context_Id, Decls);
- -- If an activation chain entity has not been declared already, create
- -- one.
+ -- If activation chain entity has not been declared already, create one
if Nkind (Context) = N_Extended_Return_Statement
or else No (Activation_Chain_Entity (Context))
@@ -1357,59 +1363,54 @@ package body Exp_Ch9 is
-- Build_Entry_Names --
-----------------------
- function Build_Entry_Names (Conc_Typ : Entity_Id) return Node_Id is
- Loc : constant Source_Ptr := Sloc (Conc_Typ);
- B_Decls : List_Id;
- B_Stmts : List_Id;
- Comp : Node_Id;
- Index : Entity_Id;
- Index_Typ : RE_Id;
- Typ : Entity_Id := Conc_Typ;
+ procedure Build_Entry_Names
+ (Obj_Ref : Node_Id;
+ Obj_Typ : Entity_Id;
+ Stmts : List_Id)
+ is
+ Loc : constant Source_Ptr := Sloc (Obj_Ref);
+ Data : Entity_Id := Empty;
+ Index : Entity_Id := Empty;
+ Typ : Entity_Id := Obj_Typ;
- procedure Build_Entry_Family_Name (Id : Entity_Id);
- -- Generate:
- -- for Lnn in Family_Low .. Family_High loop
- -- Inn := Inn + 1;
- -- Set_Entry_Name
- -- (_init._object <or> _init._task_id,
- -- Inn,
- -- new String ("<Entry name>(" & Lnn'Img & ")"));
- -- end loop;
- -- Note that the bounds of the range may reference discriminants. The
- -- above construct is added directly to the statements of the block.
-
- procedure Build_Entry_Name (Id : Entity_Id);
- -- Generate:
- -- Inn := Inn + 1;
- -- Set_Entry_Name
- -- (_init._object <or>_init._task_id,
- -- Inn,
- -- new String ("<Entry name>");
- -- The above construct is added directly to the statements of the block.
-
- function Build_Set_Entry_Name_Call (Arg3 : Node_Id) return Node_Id;
- -- Generate the call to the runtime routine Set_Entry_Name with actuals
- -- _init._task_id or _init._object, Inn and Arg3.
-
- procedure Increment_Index (Stmts : List_Id);
- -- Generate the following and add it to Stmts
- -- Inn := Inn + 1;
-
- -----------------------------
- -- Build_Entry_Family_Name --
- -----------------------------
-
- procedure Build_Entry_Family_Name (Id : Entity_Id) is
- Def : constant Node_Id :=
- Discrete_Subtype_Definition (Parent (Id));
- L_Id : constant Entity_Id := Make_Temporary (Loc, 'L');
- L_Stmts : constant List_Id := New_List;
- Val : Node_Id;
+ procedure Build_Entry_Name (Comp_Id : Entity_Id);
+ -- Given an entry [family], create a static string which denotes the
+ -- name of Comp_Id and assign it to the underlying data structure which
+ -- contains the entry names of a concurrent object.
+
+ function Object_Reference return Node_Id;
+ -- Return a reference to field _object or _task_id depending on the
+ -- concurrent object being processed.
+
+ ----------------------
+ -- Build_Entry_Name --
+ ----------------------
+ procedure Build_Entry_Name (Comp_Id : Entity_Id) is
function Build_Range (Def : Node_Id) return Node_Id;
-- Given a discrete subtype definition of an entry family, generate a
-- range node which covers the range of Def's type.
+ procedure Create_Index_And_Data;
+ -- Generate the declarations of variables Index and Data. Subsequent
+ -- calls do nothing.
+
+ function Increment_Index return Node_Id;
+ -- Increment the index used in the assignment of string names to the
+ -- Data array.
+
+ function Name_Declaration (Def_Id : Entity_Id) return Node_Id;
+ -- Given the name of a temporary variable, create the following
+ -- declaration for it:
+ --
+ -- Def_Id : aliased constant String := <String_Name_From_Buffer>;
+
+ function Set_Entry_Name (Def_Id : Entity_Id) return Node_Id;
+ -- Given the name of a temporary variable, place it in the array of
+ -- string names. Generate:
+ --
+ -- Data (Index) := Def_Id'Unchecked_Access;
+
-----------------
-- Build_Range --
-----------------
@@ -1426,7 +1427,10 @@ package body Exp_Ch9 is
if Is_Entity_Name (Low)
and then Ekind (Entity (Low)) = E_Discriminant
then
- Low := Make_Identifier (Loc, Chars (Low));
+ Low :=
+ Make_Selected_Component (Loc,
+ Prefix => New_Copy_Tree (Obj_Ref),
+ Selector_Name => Make_Identifier (Loc, Chars (Low)));
else
Low := New_Copy_Tree (Low);
end if;
@@ -1434,7 +1438,10 @@ package body Exp_Ch9 is
if Is_Entity_Name (High)
and then Ekind (Entity (High)) = E_Discriminant
then
- High := Make_Identifier (Loc, Chars (High));
+ High :=
+ Make_Selected_Component (Loc,
+ Prefix => New_Copy_Tree (Obj_Ref),
+ Selector_Name => Make_Identifier (Loc, Chars (High)));
else
High := New_Copy_Tree (High);
end if;
@@ -1445,150 +1452,236 @@ package body Exp_Ch9 is
High_Bound => High);
end Build_Range;
- -- Start of processing for Build_Entry_Family_Name
+ ---------------------------
+ -- Create_Index_And_Data --
+ ---------------------------
- begin
- Get_Name_String (Chars (Id));
+ procedure Create_Index_And_Data is
+ begin
+ if No (Index) and then No (Data) then
+ declare
+ Count : RE_Id;
+ Data_Typ : RE_Id;
+ Size : Entity_Id;
- -- Add a leading '('
+ begin
+ if Is_Protected_Type (Typ) then
+ Count := RO_PE_Number_Of_Entries;
+ Data_Typ := RE_Protected_Entry_Names_Array;
+ else
+ Count := RO_ST_Number_Of_Entries;
+ Data_Typ := RE_Task_Entry_Names_Array;
+ end if;
- Add_Char_To_Name_Buffer ('(');
+ -- Step 1: Generate the declaration of the index variable:
- -- Generate:
- -- new String'("<Entry name>(" & Lnn'Img & ")");
+ -- Index : Entry_Index := 1;
- -- This is an implicit heap allocation, and Comes_From_Source is
- -- False, which ensures that it will get flagged as a violation of
- -- No_Implicit_Heap_Allocations when that restriction applies.
+ Index := Make_Temporary (Loc, 'I');
- Val :=
- Make_Allocator (Loc,
- Make_Qualified_Expression (Loc,
- Subtype_Mark =>
- New_Reference_To (Standard_String, Loc),
- Expression =>
- Make_Op_Concat (Loc,
- Left_Opnd =>
- Make_Op_Concat (Loc,
- Left_Opnd =>
- Make_String_Literal (Loc,
- Strval => String_From_Name_Buffer),
- Right_Opnd =>
- Make_Attribute_Reference (Loc,
- Prefix =>
- New_Reference_To (L_Id, Loc),
- Attribute_Name => Name_Img)),
- Right_Opnd =>
- Make_String_Literal (Loc,
- Strval => ")"))));
+ Append_To (Stmts,
+ Make_Object_Declaration (Loc,
+ Defining_Identifier => Index,
+ Object_Definition =>
+ New_Reference_To (RTE (RE_Entry_Index), Loc),
+ Expression => Make_Integer_Literal (Loc, 1)));
- Increment_Index (L_Stmts);
- Append_To (L_Stmts, Build_Set_Entry_Name_Call (Val));
+ -- Step 2: Generate the declaration of an array to house all
+ -- names:
- -- Generate:
- -- for Lnn in Family_Low .. Family_High loop
- -- Inn := Inn + 1;
- -- Set_Entry_Name
- -- (_init._object <or> _init._task_id, Inn, <Val>);
- -- end loop;
+ -- Size : constant Entry_Index := <Count> (Obj_Ref);
+ -- Data : aliased <Data_Typ> := (1 .. Size => null);
- Append_To (B_Stmts,
- Make_Loop_Statement (Loc,
- Iteration_Scheme =>
- Make_Iteration_Scheme (Loc,
- Loop_Parameter_Specification =>
- Make_Loop_Parameter_Specification (Loc,
- Defining_Identifier => L_Id,
- Discrete_Subtype_Definition => Build_Range (Def))),
- Statements => L_Stmts,
- End_Label => Empty));
- end Build_Entry_Family_Name;
+ Size := Make_Temporary (Loc, 'S');
- ----------------------
- -- Build_Entry_Name --
- ----------------------
+ Append_To (Stmts,
+ Make_Object_Declaration (Loc,
+ Defining_Identifier => Size,
+ Constant_Present => True,
+ Object_Definition =>
+ New_Reference_To (RTE (RE_Entry_Index), Loc),
+ Expression =>
+ Make_Function_Call (Loc,
+ Name =>
+ New_Reference_To (RTE (Count), Loc),
+ Parameter_Associations =>
+ New_List (Object_Reference))));
+
+ Data := Make_Temporary (Loc, 'A');
+
+ Append_To (Stmts,
+ Make_Object_Declaration (Loc,
+ Defining_Identifier => Data,
+ Aliased_Present => True,
+ Object_Definition =>
+ New_Reference_To (RTE (Data_Typ), Loc),
+ Expression =>
+ Make_Aggregate (Loc,
+ Component_Associations => New_List (
+ Make_Component_Association (Loc,
+ Choices => New_List (
+ Make_Range (Loc,
+ Low_Bound => Make_Integer_Literal (Loc, 1),
+ High_Bound => New_Reference_To (Size, Loc))),
+ Expression => Make_Null (Loc))))));
+ end;
+ end if;
+ end Create_Index_And_Data;
- procedure Build_Entry_Name (Id : Entity_Id) is
- Val : Node_Id;
+ ---------------------
+ -- Increment_Index --
+ ---------------------
+
+ function Increment_Index return Node_Id is
+ begin
+ return
+ Make_Assignment_Statement (Loc,
+ Name => New_Reference_To (Index, Loc),
+ Expression =>
+ Make_Op_Add (Loc,
+ Left_Opnd => New_Reference_To (Index, Loc),
+ Right_Opnd => Make_Integer_Literal (Loc, 1)));
+ end Increment_Index;
+
+ ----------------------
+ -- Name_Declaration --
+ ----------------------
+
+ function Name_Declaration (Def_Id : Entity_Id) return Node_Id is
+ begin
+ return
+ Make_Object_Declaration (Loc,
+ Defining_Identifier => Def_Id,
+ Aliased_Present => True,
+ Constant_Present => True,
+ Object_Definition => New_Reference_To (Standard_String, Loc),
+ Expression =>
+ Make_String_Literal (Loc, String_From_Name_Buffer));
+ end Name_Declaration;
+
+ --------------------
+ -- Set_Entry_Name --
+ --------------------
+
+ function Set_Entry_Name (Def_Id : Entity_Id) return Node_Id is
+ begin
+ return
+ Make_Assignment_Statement (Loc,
+ Name =>
+ Make_Indexed_Component (Loc,
+ Prefix => New_Reference_To (Data, Loc),
+ Expressions => New_List (New_Reference_To (Index, Loc))),
+
+ Expression =>
+ Make_Attribute_Reference (Loc,
+ Prefix => New_Reference_To (Def_Id, Loc),
+ Attribute_Name => Name_Unchecked_Access));
+ end Set_Entry_Name;
+
+ -- Local variables
+
+ Temp_Id : Entity_Id;
+ Subt_Def : Node_Id;
+
+ -- Start of processing for Build_Entry_Name
begin
- Get_Name_String (Chars (Id));
+ if Ekind (Comp_Id) = E_Entry_Family then
+ Subt_Def := Discrete_Subtype_Definition (Parent (Comp_Id));
- -- This is an implicit heap allocation, and Comes_From_Source is
- -- False, which ensures that it will get flagged as a violation of
- -- No_Implicit_Heap_Allocations when that restriction applies.
+ Create_Index_And_Data;
- Val :=
- Make_Allocator (Loc,
- Make_Qualified_Expression (Loc,
- Subtype_Mark =>
- New_Reference_To (Standard_String, Loc),
- Expression =>
- Make_String_Literal (Loc,
- String_From_Name_Buffer)));
+ -- Step 1: Create the string name of the entry family.
+ -- Generate:
+ -- Temp : aliased constant String := "name ()";
+
+ Temp_Id := Make_Temporary (Loc, 'S');
+ Get_Name_String (Chars (Comp_Id));
+ Add_Char_To_Name_Buffer (' ');
+ Add_Char_To_Name_Buffer ('(');
+ Add_Char_To_Name_Buffer (')');
- Increment_Index (B_Stmts);
- Append_To (B_Stmts, Build_Set_Entry_Name_Call (Val));
+ Append_To (Stmts, Name_Declaration (Temp_Id));
+
+ -- Generate:
+ -- for Member in Family_Low .. Family_High loop
+ -- Set_Entry_Name (...);
+ -- Index := Index + 1;
+ -- end loop;
+
+ Append_To (Stmts,
+ Make_Loop_Statement (Loc,
+ Iteration_Scheme =>
+ Make_Iteration_Scheme (Loc,
+ Loop_Parameter_Specification =>
+ Make_Loop_Parameter_Specification (Loc,
+ Defining_Identifier =>
+ Make_Temporary (Loc, 'L'),
+ Discrete_Subtype_Definition =>
+ Build_Range (Subt_Def))),
+
+ Statements => New_List (
+ Set_Entry_Name (Temp_Id),
+ Increment_Index),
+ End_Label => Empty));
+
+ -- Entry
+
+ else
+ Create_Index_And_Data;
+
+ -- Step 1: Create the string name of the entry. Generate:
+ -- Temp : aliased constant String := "name";
+
+ Temp_Id := Make_Temporary (Loc, 'S');
+ Get_Name_String (Chars (Comp_Id));
+
+ Append_To (Stmts, Name_Declaration (Temp_Id));
+
+ -- Step 2: Associate the string name with the underlying data
+ -- structure.
+
+ Append_To (Stmts, Set_Entry_Name (Temp_Id));
+ Append_To (Stmts, Increment_Index);
+ end if;
end Build_Entry_Name;
- -------------------------------
- -- Build_Set_Entry_Name_Call --
- -------------------------------
+ ----------------------
+ -- Object_Reference --
+ ----------------------
- function Build_Set_Entry_Name_Call (Arg3 : Node_Id) return Node_Id is
- Arg1 : Name_Id;
- Proc : RE_Id;
+ function Object_Reference return Node_Id is
+ Conc_Typ : constant Entity_Id := Corresponding_Record_Type (Typ);
+ Field : Name_Id;
+ Ref : Node_Id;
begin
- -- Determine the proper name for the first argument and the RTS
- -- routine to call.
-
if Is_Protected_Type (Typ) then
- Arg1 := Name_uObject;
- Proc := RO_PE_Set_Entry_Name;
-
- else pragma Assert (Is_Task_Type (Typ));
- Arg1 := Name_uTask_Id;
- Proc := RO_TS_Set_Entry_Name;
+ Field := Name_uObject;
+ else
+ Field := Name_uTask_Id;
end if;
- -- Generate:
- -- Set_Entry_Name (_init.Arg1, Inn, Arg3);
+ Ref :=
+ Make_Selected_Component (Loc,
+ Prefix =>
+ Unchecked_Convert_To (Conc_Typ, New_Copy_Tree (Obj_Ref)),
+ Selector_Name => Make_Identifier (Loc, Field));
- return
- Make_Procedure_Call_Statement (Loc,
- Name =>
- New_Reference_To (RTE (Proc), Loc),
- Parameter_Associations => New_List (
- Make_Selected_Component (Loc, -- _init._object
- Prefix => -- _init._task_id
- Make_Identifier (Loc, Name_uInit),
- Selector_Name =>
- Make_Identifier (Loc, Arg1)),
- New_Reference_To (Index, Loc), -- Inn
- Arg3)); -- Val
- end Build_Set_Entry_Name_Call;
+ if Is_Protected_Type (Typ) then
+ Ref :=
+ Make_Attribute_Reference (Loc,
+ Prefix => Ref,
+ Attribute_Name => Name_Unchecked_Access);
+ end if;
- ---------------------
- -- Increment_Index --
- ---------------------
+ return Ref;
+ end Object_Reference;
- procedure Increment_Index (Stmts : List_Id) is
- begin
- -- Generate:
- -- Inn := Inn + 1;
+ -- Local variables
- Append_To (Stmts,
- Make_Assignment_Statement (Loc,
- Name =>
- New_Reference_To (Index, Loc),
- Expression =>
- Make_Op_Add (Loc,
- Left_Opnd =>
- New_Reference_To (Index, Loc),
- Right_Opnd =>
- Make_Integer_Literal (Loc, 1))));
- end Increment_Index;
+ Comp : Node_Id;
+ Proc : RE_Id;
-- Start of processing for Build_Entry_Names
@@ -1599,67 +1692,57 @@ package body Exp_Ch9 is
Typ := Corresponding_Concurrent_Type (Typ);
end if;
- pragma Assert (Is_Protected_Type (Typ) or else Is_Task_Type (Typ));
+ pragma Assert (Is_Concurrent_Type (Typ));
-- Nothing to do if the type has no entries
if not Has_Entries (Typ) then
- return Empty;
+ return;
end if;
-- Avoid generating entry names for a protected type with only one entry
if Is_Protected_Type (Typ)
- and then Find_Protection_Type (Typ) /= RTE (RE_Protection_Entries)
+ and then Find_Protection_Type (Base_Type (Typ)) /=
+ RTE (RE_Protection_Entries)
then
- return Empty;
- end if;
-
- Index := Make_Temporary (Loc, 'I');
-
- -- Step 1: Generate the declaration of the index variable:
- -- Inn : Protected_Entry_Index := 0;
- -- or
- -- Inn : Task_Entry_Index := 0;
-
- if Is_Protected_Type (Typ) then
- Index_Typ := RE_Protected_Entry_Index;
- else
- Index_Typ := RE_Task_Entry_Index;
+ return;
end if;
- B_Decls := New_List;
- Append_To (B_Decls,
- Make_Object_Declaration (Loc,
- Defining_Identifier => Index,
- Object_Definition => New_Reference_To (RTE (Index_Typ), Loc),
- Expression => Make_Integer_Literal (Loc, 0)));
-
- B_Stmts := New_List;
-
- -- Step 2: Generate a call to Set_Entry_Name for each entry and entry
- -- family member.
+ -- Step 1: Populate the array with statically generated strings denoting
+ -- entries and entry family names.
Comp := First_Entity (Typ);
while Present (Comp) loop
- if Ekind (Comp) = E_Entry then
+ if Comes_From_Source (Comp)
+ and then Ekind_In (Comp, E_Entry, E_Entry_Family)
+ then
Build_Entry_Name (Comp);
-
- elsif Ekind (Comp) = E_Entry_Family then
- Build_Entry_Family_Name (Comp);
end if;
Next_Entity (Comp);
end loop;
- -- Step 3: Wrap the statements in a block
+ -- Step 2: Associate the array with the related concurrent object:
- return
- Make_Block_Statement (Loc,
- Declarations => B_Decls,
- Handled_Statement_Sequence =>
- Make_Handled_Sequence_Of_Statements (Loc,
- Statements => B_Stmts));
+ -- Set_Entry_Names (Obj_Ref, <Data>'Unchecked_Access);
+
+ if Present (Data) then
+ if Is_Protected_Type (Typ) then
+ Proc := RO_PE_Set_Entry_Names;
+ else
+ Proc := RO_ST_Set_Entry_Names;
+ end if;
+
+ Append_To (Stmts,
+ Make_Procedure_Call_Statement (Loc,
+ Name => New_Reference_To (RTE (Proc), Loc),
+ Parameter_Associations => New_List (
+ Object_Reference,
+ Make_Attribute_Reference (Loc,
+ Prefix => New_Reference_To (Data, Loc),
+ Attribute_Name => Name_Unchecked_Access))));
+ end if;
end Build_Entry_Names;
---------------------------
@@ -4817,6 +4900,13 @@ package body Exp_Ch9 is
P : Node_Id;
begin
+ -- On restricted profile, all the tasks will be activated at the end
+ -- of the elaboration (Sequential elaboration policy).
+
+ if Restricted_Profile then
+ return;
+ end if;
+
-- Get the activation chain entity. Except in the case of a package
-- body, this is in the node that was passed. For a package body, we
-- have to find the corresponding package declaration node.
@@ -4835,11 +4925,7 @@ package body Exp_Ch9 is
end if;
if Present (Chain) then
- if Restricted_Profile then
- Name := New_Reference_To (RTE (RE_Activate_Restricted_Tasks), Loc);
- else
- Name := New_Reference_To (RTE (RE_Activate_Tasks), Loc);
- end if;
+ Name := New_Reference_To (RTE (RE_Activate_Tasks), Loc);
Call :=
Make_Procedure_Call_Statement (Loc,
@@ -13496,20 +13582,6 @@ package body Exp_Ch9 is
Make_Attribute_Reference (Loc,
Prefix => New_Reference_To (P_Arr, Loc),
Attribute_Name => Name_Unrestricted_Access));
-
- -- Build_Entry_Names generation flag. When set to true,
- -- the runtime will allocate an array to hold the string
- -- names of protected entries.
-
- if not Restricted_Profile then
- if Entry_Names_OK then
- Append_To (Args,
- New_Reference_To (Standard_True, Loc));
- else
- Append_To (Args,
- New_Reference_To (Standard_False, Loc));
- end if;
- end if;
end if;
elsif Pkg_Id =
@@ -13520,7 +13592,6 @@ package body Exp_Ch9 is
elsif Pkg_Id = System_Tasking_Protected_Objects_Entries then
Append_To (Args, Make_Null (Loc));
Append_To (Args, Make_Null (Loc));
- Append_To (Args, New_Reference_To (Standard_False, Loc));
end if;
Append_To (L,
@@ -13909,10 +13980,12 @@ package body Exp_Ch9 is
Prefix => Make_Identifier (Loc, New_External_Name (Tnam, 'E')),
Attribute_Name => Name_Unchecked_Access));
- -- Chain parameter. This is a reference to the _Chain parameter of
- -- the initialization procedure.
+ -- Chain parameter. This is a reference to the Chain parameter of the
+ -- initialization procedure. There is no chain in restricted profile.
- Append_To (Args, Make_Identifier (Loc, Name_uChain));
+ if not Restricted_Profile then
+ Append_To (Args, Make_Identifier (Loc, Name_uChain));
+ end if;
-- Task name parameter. Take this from the _Task_Id parameter to the
-- init call unless there is a Task_Name pragma, in which case we take
@@ -13942,16 +14015,6 @@ package body Exp_Ch9 is
Prefix => Make_Identifier (Loc, Name_uInit),
Selector_Name => Make_Identifier (Loc, Name_uTask_Id)));
- -- Build_Entry_Names generation flag. When set to true, the runtime
- -- will allocate an array to hold the string names of task entries.
-
- if not Restricted_Profile then
- Append_To (Args,
- New_Reference_To
- (Boolean_Literals (Has_Entries (Ttyp) and then Entry_Names_OK),
- Loc));
- end if;
-
if Restricted_Profile then
Name := New_Reference_To (RTE (RE_Create_Restricted_Task), Loc);
else
diff --git a/gcc/ada/exp_ch9.ads b/gcc/ada/exp_ch9.ads
index 3bbbf0dc719..65b0c195302 100644
--- a/gcc/ada/exp_ch9.ads
+++ b/gcc/ada/exp_ch9.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, 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- --
@@ -55,10 +55,15 @@ package Exp_Ch9 is
-- interface, ensure that the designated type has a _master and generate
-- a renaming of the said master to service the access type.
- function Build_Entry_Names (Conc_Typ : Entity_Id) return Node_Id;
- -- Create the statements which populate the entry names array of a task or
- -- protected type. The statements are wrapped inside a block due to a local
- -- declaration.
+ procedure Build_Entry_Names
+ (Obj_Ref : Node_Id;
+ Obj_Typ : Entity_Id;
+ Stmts : List_Id);
+ -- Given a concurrent object, create static string names for all entries
+ -- and entry families. Associate each name with the Protection_Entries or
+ -- ATCB field of the object. Obj_Ref is a reference to the concurrent
+ -- object. Obj_Typ is the type of the object. Stmts is the list where all
+ -- generated code is attached.
procedure Build_Master_Entity (Obj_Or_Typ : Entity_Id);
-- Given the name of an object or a type which is either a task, contains
diff --git a/gcc/ada/exp_dbug.adb b/gcc/ada/exp_dbug.adb
index 5d605d75c50..9267982f85f 100644
--- a/gcc/ada/exp_dbug.adb
+++ b/gcc/ada/exp_dbug.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1996-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1996-2012, 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- --
@@ -902,6 +902,39 @@ package body Exp_Dbug is
end if;
end Get_Variant_Encoding;
+ -----------------------------------------
+ -- Build_Subprogram_Instance_Renamings --
+ -----------------------------------------
+
+ procedure Build_Subprogram_Instance_Renamings
+ (N : Node_Id;
+ Wrapper : Entity_Id)
+ is
+ Loc : Source_Ptr;
+ Decl : Node_Id;
+ E : Entity_Id;
+
+ begin
+ E := First_Entity (Wrapper);
+ while Present (E) loop
+ if Nkind (Parent (E)) = N_Object_Declaration
+ and then Is_Elementary_Type (Etype (E))
+ then
+ Loc := Sloc (Expression (Parent (E)));
+ Decl := Make_Object_Renaming_Declaration (Loc,
+ Defining_Identifier =>
+ Make_Defining_Identifier (Loc, Chars (E)),
+ Subtype_Mark => New_Occurrence_Of (Etype (E), Loc),
+ Name => New_Occurrence_Of (E, Loc));
+
+ Append (Decl, Declarations (N));
+ Set_Needs_Debug_Info (Defining_Identifier (Decl));
+ end if;
+
+ Next_Entity (E);
+ end loop;
+ end Build_Subprogram_Instance_Renamings;
+
------------------------------------
-- Get_Secondary_DT_External_Name --
------------------------------------
@@ -1274,6 +1307,23 @@ package body Exp_Dbug is
if Has_Qualified_Name (Ent) then
return;
+ -- In formal verification mode, simply append a suffix for homonyms, but
+ -- do not mark the name as being qualified. We used to qualify entity
+ -- names as full expansion does, but this was removed as this prevents
+ -- the verification back-end from using a short name for debugging and
+ -- user interaction. The verification back-end already takes care of
+ -- qualifying names when needed.
+
+ elsif Alfa_Mode then
+ if Has_Homonym (Ent) then
+ Get_Name_String (Chars (Ent));
+ Append_Homonym_Number (Ent);
+ Output_Homonym_Numbers_Suffix;
+ Set_Chars (Ent, Name_Enter);
+ end if;
+
+ return;
+
-- If the entity is a variable encoding the debug name for an object
-- renaming, then the qualified name of the entity associated with the
-- renamed object can now be incorporated in the debug name.
diff --git a/gcc/ada/exp_dbug.ads b/gcc/ada/exp_dbug.ads
index 0290168ff01..86099f66f75 100644
--- a/gcc/ada/exp_dbug.ads
+++ b/gcc/ada/exp_dbug.ads
@@ -1442,6 +1442,23 @@ package Exp_Dbug is
-- corresponding to variants, and consider the fields inside as belonging
-- to the containing record.
+ -----------------------------------------------
+ -- Extra renamings for subprogram instances --
+ -----------------------------------------------
+
+ procedure Build_Subprogram_Instance_Renamings
+ (N : Node_Id;
+ Wrapper : Entity_Id);
+ -- The debugger has difficulties in recovering the value of actuals of an
+ -- elementary type, from within the body of a subprogram instantiation.
+ -- This is because such actuals generate an object declaration that is
+ -- placed within the wrapper package of the instance, and the entity in
+ -- these declarations is encoded in a complex way that GDB does not handle
+ -- well. These new renaming declarations appear within the body of the
+ -- subprogram, and are redundant from a visibility point of view, but They
+ -- should have no measurable performance impact, and require no special
+ -- decoding in the debugger.
+
-------------------------------------------
-- Character literals in Character Types --
-------------------------------------------
diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb
index 9b5cb5716ea..c3cd9c037b2 100644
--- a/gcc/ada/exp_disp.adb
+++ b/gcc/ada/exp_disp.adb
@@ -703,6 +703,10 @@ package body Exp_Disp is
-- previously notified the violation of this restriction.
or else Restriction_Active (No_Dispatching_Calls)
+
+ -- No action needed if the dispatching call has been already expanded
+
+ or else Is_Expanded_Dispatching_Call (Name (Call_Node))
then
return;
end if;
@@ -1975,6 +1979,17 @@ package body Exp_Disp is
and then not Restriction_Active (No_Dispatching_Calls);
end Has_DT;
+ ----------------------------------
+ -- Is_Expanded_Dispatching_Call --
+ ----------------------------------
+
+ function Is_Expanded_Dispatching_Call (N : Node_Id) return Boolean is
+ begin
+ return Nkind (N) in N_Subprogram_Call
+ and then Nkind (Name (N)) = N_Explicit_Dereference
+ and then Is_Dispatch_Table_Entity (Etype (Name (N)));
+ end Is_Expanded_Dispatching_Call;
+
-----------------------------------------
-- Is_Predefined_Dispatching_Operation --
-----------------------------------------
diff --git a/gcc/ada/exp_disp.ads b/gcc/ada/exp_disp.ads
index 9943bda0f63..f95fba5adfe 100644
--- a/gcc/ada/exp_disp.ads
+++ b/gcc/ada/exp_disp.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, 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- --
@@ -245,6 +245,9 @@ package Exp_Disp is
function Has_CPP_Constructors (Typ : Entity_Id) return Boolean;
-- Returns true if the type has CPP constructors
+ function Is_Expanded_Dispatching_Call (N : Node_Id) return Boolean;
+ -- Returns true if N is the expanded code of a dispatching call
+
function Is_Predefined_Dispatching_Operation (E : Entity_Id) return Boolean;
-- Ada 2005 (AI-251): Determines if E is a predefined primitive operation
diff --git a/gcc/ada/exp_dist.adb b/gcc/ada/exp_dist.adb
index 4a59b2a6343..cf8243e9ca7 100644
--- a/gcc/ada/exp_dist.adb
+++ b/gcc/ada/exp_dist.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, 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- --
@@ -803,12 +803,14 @@ package body Exp_Dist is
-- the declaration and entity for the newly-created function.
function Build_To_Any_Call
- (N : Node_Id;
+ (Loc : Source_Ptr;
+ N : Node_Id;
Decls : List_Id) return Node_Id;
-- Build call to To_Any attribute function with expression as actual
- -- parameter. Decls is the declarations list for an appropriate
- -- enclosing scope of the point where the call will be inserted; if
- -- the To_Any attribute for Typ needs to be generated at this point,
+ -- parameter. Loc is the reference location ofr generated nodes,
+ -- Decls is the declarations list for an appropriate enclosing scope
+ -- of the point where the call will be inserted; if the To_Any
+ -- attribute for the type of N needs to be generated at this point,
-- its declaration is appended to Decls.
procedure Build_To_Any_Function
@@ -879,7 +881,8 @@ package body Exp_Dist is
renames PolyORB_Support.Helpers.Build_From_Any_Call;
function Build_To_Any_Call
- (N : Node_Id;
+ (Loc : Source_Ptr;
+ N : Node_Id;
Decls : List_Id) return Node_Id
renames PolyORB_Support.Helpers.Build_To_Any_Call;
@@ -6562,7 +6565,7 @@ package body Exp_Dist is
Object_Definition => New_Occurrence_Of (RTE (RE_Any), Loc),
Expression =>
PolyORB_Support.Helpers.Build_To_Any_Call
- (RACW_Parameter, No_List)));
+ (Loc, RACW_Parameter, No_List)));
Statements := New_List (
Make_Procedure_Call_Statement (Loc,
@@ -7362,7 +7365,7 @@ package body Exp_Dist is
-- the first one.
Expr := PolyORB_Support.Helpers.Build_To_Any_Call
- (Actual_Parameter, Decls);
+ (Loc, Actual_Parameter, Decls);
else
Expr := Make_Function_Call (Loc,
@@ -7448,7 +7451,7 @@ package body Exp_Dist is
New_Occurrence_Of (RTE (RE_Any), Loc),
Expression =>
PolyORB_Support.Helpers.Build_To_Any_Call
- (Parameter_Exp, Decls)));
+ (Loc, Parameter_Exp, Decls)));
Append_To (Extra_Formal_Statements,
Add_Parameter_To_NVList (Loc,
@@ -7934,7 +7937,7 @@ package body Exp_Dist is
Parameter_Associations => New_List (
New_Occurrence_Of (Any, Loc),
PolyORB_Support.Helpers.Build_To_Any_Call
- (New_Occurrence_Of (Object, Loc), Decls))));
+ (Loc, New_Occurrence_Of (Object, Loc), Decls))));
end if;
-- For RACW controlling formals, the Etyp of Object is always
@@ -8094,7 +8097,7 @@ package body Exp_Dist is
Parameter_Associations => New_List (
New_Occurrence_Of (Request_Parameter, Loc),
PolyORB_Support.Helpers.Build_To_Any_Call
- (New_Occurrence_Of (Result, Loc), Decls))));
+ (Loc, New_Occurrence_Of (Result, Loc), Decls))));
-- A DSA function does not have out or inout arguments
end;
@@ -9219,11 +9222,10 @@ package body Exp_Dist is
-----------------------
function Build_To_Any_Call
- (N : Node_Id;
+ (Loc : Source_Ptr;
+ N : Node_Id;
Decls : List_Id) return Node_Id
is
- Loc : constant Source_Ptr := Sloc (N);
-
Typ : Entity_Id := Etype (N);
U_Type : Entity_Id;
C_Type : Entity_Id;
@@ -9463,7 +9465,8 @@ package body Exp_Dist is
(Rt_Type,
New_Occurrence_Of (Expr_Parameter, Loc));
begin
- Set_Expression (Any_Decl, Build_To_Any_Call (Expr, Decls));
+ Set_Expression (Any_Decl,
+ Build_To_Any_Call (Loc, Expr, Decls));
end;
elsif Is_Record_Type (Typ) and then not Is_Tagged_Type (Typ) then
@@ -9479,7 +9482,7 @@ package body Exp_Dist is
begin
Set_Expression
- (Any_Decl, Build_To_Any_Call (Expr, Decls));
+ (Any_Decl, Build_To_Any_Call (Loc, Expr, Decls));
end;
-- Comment needed here (and label on declare block ???)
@@ -9535,7 +9538,7 @@ package body Exp_Dist is
RTE (RE_Add_Aggregate_Element), Loc),
Parameter_Associations => New_List (
New_Occurrence_Of (Container, Loc),
- Build_To_Any_Call (Field_Ref, Decls))));
+ Build_To_Any_Call (Loc, Field_Ref, Decls))));
else
-- A variant part
@@ -9660,7 +9663,8 @@ package body Exp_Dist is
Parameter_Associations => New_List (
New_Occurrence_Of (Union_Any, Loc),
Build_To_Any_Call
- (Make_Discriminant_Reference,
+ (Loc,
+ Make_Discriminant_Reference,
Block_Decls))));
-- Populate inner struct aggregate
@@ -9761,7 +9765,8 @@ package body Exp_Dist is
Choices => New_List (
Make_Integer_Literal (Loc, Counter)),
Expression =>
- Build_To_Any_Call (Discriminant, Decls)));
+ Build_To_Any_Call (Loc,
+ Discriminant, Decls)));
end;
Counter := Counter + 1;
@@ -9850,7 +9855,7 @@ package body Exp_Dist is
if Etype (Datum) = RTE (RE_Any) then
Element_Any := Datum;
else
- Element_Any := Build_To_Any_Call (Datum, Decls);
+ Element_Any := Build_To_Any_Call (Loc, Datum, Decls);
end if;
Append_To (Stmts,
@@ -9889,7 +9894,7 @@ package body Exp_Dist is
RTE (RE_Add_Aggregate_Element), Loc),
Parameter_Associations => New_List (
New_Occurrence_Of (Any, Loc),
- Build_To_Any_Call (
+ Build_To_Any_Call (Loc,
OK_Convert_To (Etype (Index),
Make_Attribute_Reference (Loc,
Prefix =>
@@ -9910,7 +9915,7 @@ package body Exp_Dist is
-- Integer types
Set_Expression (Any_Decl,
- Build_To_Any_Call (
+ Build_To_Any_Call (Loc,
OK_Convert_To (
Find_Numeric_Representation (Typ),
New_Occurrence_Of (Expr_Parameter, Loc)),
@@ -10454,7 +10459,7 @@ package body Exp_Dist is
Set_Etype (Expr, Disc_Type);
Append_To (Union_TC_Params,
- Build_To_Any_Call (Expr, Decls));
+ Build_To_Any_Call (Loc, Expr, Decls));
Add_Params_For_Variant_Components;
J := J + Uint_1;
@@ -10495,7 +10500,7 @@ package body Exp_Dist is
begin
Set_Etype (Exp, Disc_Type);
Append_To (Union_TC_Params,
- Build_To_Any_Call (Exp, Decls));
+ Build_To_Any_Call (Loc, Exp, Decls));
end;
Add_Params_For_Variant_Components;
@@ -10509,7 +10514,7 @@ package body Exp_Dist is
New_Copy_Tree (Choice);
begin
Append_To (Union_TC_Params,
- Build_To_Any_Call (Exp, Decls));
+ Build_To_Any_Call (Loc, Exp, Decls));
end;
Add_Params_For_Variant_Components;
@@ -10679,7 +10684,7 @@ package body Exp_Dist is
if Constrained then
Inner_TypeCode := Make_Constructed_TypeCode
(RTE (RE_TC_Array), New_List (
- Build_To_Any_Call (
+ Build_To_Any_Call (Loc,
OK_Convert_To (RTE (RE_Unsigned_32),
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Typ, Loc),
@@ -10688,7 +10693,7 @@ package body Exp_Dist is
Make_Integer_Literal (Loc,
Intval => Ndim - J + 1)))),
Decls),
- Build_To_Any_Call (Inner_TypeCode, Decls)));
+ Build_To_Any_Call (Loc, Inner_TypeCode, Decls)));
else
-- Unconstrained case: add low bound for each
@@ -10705,11 +10710,11 @@ package body Exp_Dist is
Inner_TypeCode := Make_Constructed_TypeCode
(RTE (RE_TC_Sequence), New_List (
- Build_To_Any_Call (
+ Build_To_Any_Call (Loc,
OK_Convert_To (RTE (RE_Unsigned_32),
Make_Integer_Literal (Loc, 0)),
Decls),
- Build_To_Any_Call (Inner_TypeCode, Decls)));
+ Build_To_Any_Call (Loc, Inner_TypeCode, Decls)));
end if;
end loop;
diff --git a/gcc/ada/exp_dist.ads b/gcc/ada/exp_dist.ads
index 49b96a8d03e..a0bb6c113db 100644
--- a/gcc/ada/exp_dist.ads
+++ b/gcc/ada/exp_dist.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, 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- --
@@ -144,13 +144,14 @@ package Exp_Dist is
-- declaration is appended to Decls.
function Build_To_Any_Call
- (N : Node_Id;
+ (Loc : Source_Ptr;
+ N : Node_Id;
Decls : List_Id) return Node_Id;
-- Build call to To_Any attribute function with expression as actual
- -- parameter. Decls is the declarations list for an appropriate
- -- enclosing scope of the point where the call will be inserted; if
- -- the To_Any attribute for Typ needs to be generated at this point,
- -- its declaration is appended to Decls.
+ -- parameter. Loc is the reference location for generated nodes, Decls is
+ -- the declarations list for an appropriate enclosing scope of the point
+ -- where the call will be inserted; if the To_Any attribute for Typ needs
+ -- to be generated at this point, its declaration is appended to Decls.
function Build_TypeCode_Call
(Loc : Source_Ptr;
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index 9e0cbcacf80..6c647111627 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -4652,7 +4652,7 @@ package body Freeze is
-- this is where we analye the expression (after the type is frozen,
-- since in the case of Default_Value, we are analyzing with the
-- type itself, and we treat Default_Component_Value similarly for
- -- the sake of uniformity.
+ -- the sake of uniformity).
if Is_First_Subtype (E) and then Has_Default_Aspect (E) then
declare
diff --git a/gcc/ada/g-sechas.adb b/gcc/ada/g-sechas.adb
index 78eddc3a29e..4b396f112ed 100644
--- a/gcc/ada/g-sechas.adb
+++ b/gcc/ada/g-sechas.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2009-2012, 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,8 +34,6 @@ with Interfaces; use Interfaces;
package body GNAT.Secure_Hashes is
- use Ada.Streams;
-
Hex_Digit : constant array (Stream_Element range 0 .. 15) of Character :=
"0123456789abcdef";
@@ -186,14 +184,38 @@ package body GNAT.Secure_Hashes is
return Digest (C);
end Digest;
+ function Digest (C : Context) return Binary_Message_Digest is
+ Hash_Bits : Stream_Element_Array
+ (1 .. Stream_Element_Offset (Hash_Length));
+ begin
+ Final (C, Hash_Bits);
+ return Hash_Bits;
+ end Digest;
+
+ function Digest (S : String) return Binary_Message_Digest is
+ C : Context;
+ begin
+ Update (C, S);
+ return Digest (C);
+ end Digest;
+
+ function Digest
+ (A : Stream_Element_Array) return Binary_Message_Digest
+ is
+ C : Context;
+ begin
+ Update (C, A);
+ return Digest (C);
+ end Digest;
+
-----------
-- Final --
-----------
- -- Once a complete message has been processed, it is padded with one
- -- 1 bit followed by enough 0 bits so that the last block is
- -- 2 * Word'Size bits short of being completed. The last 2 * Word'Size
- -- bits are set to the message size in bits (excluding padding).
+ -- Once a complete message has been processed, it is padded with one 1
+ -- bit followed by enough 0 bits so that the last block is 2 * Word'Size
+ -- bits short of being completed. The last 2 * Word'Size bits are set to
+ -- the message size in bits (excluding padding).
procedure Final
(C : Context;
@@ -327,6 +349,13 @@ package body GNAT.Secure_Hashes is
return Digest (C);
end Wide_Digest;
+ function Wide_Digest (W : Wide_String) return Binary_Message_Digest is
+ C : Context;
+ begin
+ Wide_Update (C, W);
+ return Digest (C);
+ end Wide_Digest;
+
end H;
-------------------------
diff --git a/gcc/ada/g-sechas.ads b/gcc/ada/g-sechas.ads
index 7fe34b172f8..f3f71601de5 100644
--- a/gcc/ada/g-sechas.ads
+++ b/gcc/ada/g-sechas.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2009-2012, 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,8 +36,10 @@
-- This is an internal unit and should be not used directly in applications.
-- Use GNAT.MD5 and GNAT.SHA* instead.
-with Ada.Streams;
+with Ada.Streams; use Ada.Streams;
+
with Interfaces;
+
with System;
package GNAT.Secure_Hashes is
@@ -84,16 +86,15 @@ package GNAT.Secure_Hashes is
procedure To_Hash
(H : State;
- H_Bits : out Ada.Streams.Stream_Element_Array);
- -- Convert H to stream representation with the given bit order.
- -- If H_Bits is smaller than the internal hash state, then the state
+ H_Bits : out Stream_Element_Array);
+ -- Convert H to stream representation with the given bit order. If
+ -- H_Bits is smaller than the internal hash state, then the state
-- is truncated.
end Hash_Function_State;
- -- Generic hashing framework:
- -- The user interface for each implemented secure hash function is an
- -- instance of this generic package.
+ -- Generic hashing framework: The user interface for each implemented
+ -- secure hash function is an instance of this generic package.
generic
Block_Words : Natural;
@@ -147,7 +148,7 @@ package GNAT.Secure_Hashes is
procedure Wide_Update (C : in out Context; Input : Wide_String);
procedure Update
(C : in out Context;
- Input : Ada.Streams.Stream_Element_Array);
+ Input : Stream_Element_Array);
-- Update C to process the given input. Successive calls to Update are
-- equivalent to a single call with the concatenation of the inputs. For
-- the Wide_String version, each Wide_Character is processed low order
@@ -156,6 +157,22 @@ package GNAT.Secure_Hashes is
Word_Length : constant Natural := Hash_State.Word'Size / 8;
Hash_Length : constant Natural := Hash_Words * Word_Length;
+ subtype Binary_Message_Digest is
+ Stream_Element_Array (1 .. Stream_Element_Offset (Hash_Length));
+ -- The fixed-length byte array returned by Digest, providing
+ -- the hash in binary representation.
+
+ function Digest (C : Context) return Binary_Message_Digest;
+ -- Return hash for the data accumulated with C
+
+ function Digest (S : String) return Binary_Message_Digest;
+ function Wide_Digest (W : Wide_String) return Binary_Message_Digest;
+ function Digest
+ (A : Stream_Element_Array) return Binary_Message_Digest;
+ -- These functions are equivalent to the corresponding Update (or
+ -- Wide_Update) on a default initialized Context, followed by Digest
+ -- on the resulting Context.
+
subtype Message_Digest is String (1 .. 2 * Hash_Length);
-- The fixed-length string returned by Digest, providing the hash in
-- hexadecimal representation.
@@ -164,10 +181,9 @@ package GNAT.Secure_Hashes is
-- Return hash for the data accumulated with C in hexadecimal
-- representation.
- function Digest (S : String) return Message_Digest;
- function Wide_Digest (W : Wide_String) return Message_Digest;
- function Digest
- (A : Ada.Streams.Stream_Element_Array) return Message_Digest;
+ function Digest (S : String) return Message_Digest;
+ function Wide_Digest (W : Wide_String) return Message_Digest;
+ function Digest (A : Stream_Element_Array) return Message_Digest;
-- These functions are equivalent to the corresponding Update (or
-- Wide_Update) on a default initialized Context, followed by Digest
-- on the resulting Context.
diff --git a/gcc/ada/g-socket.adb b/gcc/ada/g-socket.adb
index 731919be3ba..c7b71208ff0 100644
--- a/gcc/ada/g-socket.adb
+++ b/gcc/ada/g-socket.adb
@@ -80,7 +80,7 @@ package body GNAT.Sockets is
Shut_Write => SOSC.SHUT_WR,
Shut_Read_Write => SOSC.SHUT_RDWR);
- Requests : constant array (Request_Name) of C.int :=
+ Requests : constant array (Request_Name) of SOSC.IOCTL_Req_T :=
(Non_Blocking_IO => SOSC.FIONBIO,
N_Bytes_To_Read => SOSC.FIONREAD);
diff --git a/gcc/ada/g-socthi-dummy.adb b/gcc/ada/g-socthi-dummy.adb
index b247c12e02b..b5ed8e26e15 100644
--- a/gcc/ada/g-socthi-dummy.adb
+++ b/gcc/ada/g-socthi-dummy.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2010, AdaCore --
+-- Copyright (C) 2001-2012, 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- --
diff --git a/gcc/ada/g-socthi-dummy.ads b/gcc/ada/g-socthi-dummy.ads
index 36780a0ee0f..d7fc9824fc2 100644
--- a/gcc/ada/g-socthi-dummy.ads
+++ b/gcc/ada/g-socthi-dummy.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2010, AdaCore --
+-- Copyright (C) 2001-2012, 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- --
diff --git a/gcc/ada/g-socthi-mingw.adb b/gcc/ada/g-socthi-mingw.adb
index 972940221ff..ad82c167d67 100644
--- a/gcc/ada/g-socthi-mingw.adb
+++ b/gcc/ada/g-socthi-mingw.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2011, AdaCore --
+-- Copyright (C) 2001-2012, 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- --
@@ -256,7 +256,7 @@ package body GNAT.Sockets.Thin is
function Socket_Ioctl
(S : C.int;
- Req : C.int;
+ Req : SOSC.IOCTL_Req_T;
Arg : access C.int) return C.int
is
begin
diff --git a/gcc/ada/g-socthi-mingw.ads b/gcc/ada/g-socthi-mingw.ads
index 03688f63946..b1493a7cfed 100644
--- a/gcc/ada/g-socthi-mingw.ads
+++ b/gcc/ada/g-socthi-mingw.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2010, AdaCore --
+-- Copyright (C) 2001-2012, 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- --
@@ -118,7 +118,7 @@ package GNAT.Sockets.Thin is
function Socket_Ioctl
(S : C.int;
- Req : C.int;
+ Req : SOSC.IOCTL_Req_T;
Arg : access C.int) return C.int;
function C_Listen
diff --git a/gcc/ada/g-socthi-vms.adb b/gcc/ada/g-socthi-vms.adb
index 51c28fb601a..8a49dc5b0d5 100644
--- a/gcc/ada/g-socthi-vms.adb
+++ b/gcc/ada/g-socthi-vms.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2011, AdaCore --
+-- Copyright (C) 2001-2012, 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- --
@@ -227,7 +227,7 @@ package body GNAT.Sockets.Thin is
function Socket_Ioctl
(S : C.int;
- Req : C.int;
+ Req : SOSC.IOCTL_Req_T;
Arg : access C.int) return C.int
is
begin
diff --git a/gcc/ada/g-socthi-vms.ads b/gcc/ada/g-socthi-vms.ads
index 7b9f9173197..3aea7d22778 100644
--- a/gcc/ada/g-socthi-vms.ads
+++ b/gcc/ada/g-socthi-vms.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2002-2010, AdaCore --
+-- Copyright (C) 2002-2012, 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- --
@@ -121,7 +121,7 @@ package GNAT.Sockets.Thin is
function Socket_Ioctl
(S : C.int;
- Req : C.int;
+ Req : SOSC.IOCTL_Req_T;
Arg : access C.int) return C.int;
function C_Listen
diff --git a/gcc/ada/g-socthi-vxworks.adb b/gcc/ada/g-socthi-vxworks.adb
index 33c5d0ca85c..87549edb6c6 100644
--- a/gcc/ada/g-socthi-vxworks.adb
+++ b/gcc/ada/g-socthi-vxworks.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2002-2010, AdaCore --
+-- Copyright (C) 2002-2012, 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- --
@@ -235,7 +235,7 @@ package body GNAT.Sockets.Thin is
function Socket_Ioctl
(S : C.int;
- Req : C.int;
+ Req : SOSC.IOCTL_Req_T;
Arg : access C.int) return C.int
is
begin
diff --git a/gcc/ada/g-socthi-vxworks.ads b/gcc/ada/g-socthi-vxworks.ads
index e019303bea0..793258baa96 100644
--- a/gcc/ada/g-socthi-vxworks.ads
+++ b/gcc/ada/g-socthi-vxworks.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2002-2010, AdaCore --
+-- Copyright (C) 2002-2012, 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- --
@@ -119,7 +119,7 @@ package GNAT.Sockets.Thin is
function Socket_Ioctl
(S : C.int;
- Req : C.int;
+ Req : SOSC.IOCTL_Req_T;
Arg : access C.int) return C.int;
function C_Listen
diff --git a/gcc/ada/g-socthi.adb b/gcc/ada/g-socthi.adb
index 77551eec3c5..801936f9ba5 100644
--- a/gcc/ada/g-socthi.adb
+++ b/gcc/ada/g-socthi.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2010, AdaCore --
+-- Copyright (C) 2001-2012, 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- --
@@ -233,7 +233,7 @@ package body GNAT.Sockets.Thin is
function Socket_Ioctl
(S : C.int;
- Req : C.int;
+ Req : SOSC.IOCTL_Req_T;
Arg : access C.int) return C.int
is
begin
diff --git a/gcc/ada/g-socthi.ads b/gcc/ada/g-socthi.ads
index 15747cf14a2..b034e258538 100644
--- a/gcc/ada/g-socthi.ads
+++ b/gcc/ada/g-socthi.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2010, AdaCore --
+-- Copyright (C) 2001-2012, 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- --
@@ -120,7 +120,7 @@ package GNAT.Sockets.Thin is
function Socket_Ioctl
(S : C.int;
- Req : C.int;
+ Req : SOSC.IOCTL_Req_T;
Arg : access C.int) return C.int;
function C_Listen
diff --git a/gcc/ada/g-sothco.ads b/gcc/ada/g-sothco.ads
index f5f8e185aa9..b957f225e80 100644
--- a/gcc/ada/g-sothco.ads
+++ b/gcc/ada/g-sothco.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2008-2010, AdaCore --
+-- Copyright (C) 2008-2012, 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- --
@@ -385,7 +385,7 @@ package GNAT.Sockets.Thin_Common is
function C_Ioctl
(Fd : C.int;
- Req : C.int;
+ Req : SOSC.IOCTL_Req_T;
Arg : access C.int) return C.int;
private
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index a2c868b8614..05b3b2be8d9 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -953,33 +953,20 @@ ada/mdll-fil.o : ada/mdll-fil.adb ada/mdll.ads ada/mdll-fil.ads
ada/mdll-utl.o : ada/mdll-utl.adb ada/mdll.ads ada/mdll-utl.ads ada/sdefault.ads ada/types.ads
$(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
-ada/adadecode.o : ada/adadecode.c $(CONFIG_H) $(SYSTEM_H) ada/adadecode.h
-ada/adaint.o : ada/adaint.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h
-ada/argv.o : ada/argv.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h
-ada/cstreams.o : ada/cstreams.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h
-ada/exit.o : ada/exit.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h
-ada/final.o : ada/final.c $(CONFIG_H) $(SYSTEM_H) ada/raise.h
-ada/link.o : ada/link.c
-
-ada/targext.o : ada/targext.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H)
- $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
- $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
-
+ada/adadecode.o : ada/adadecode.c $(CONFIG_H) $(SYSTEM_H) ada/adadecode.h ada/adaint.h
+ada/adaint.o : ada/adaint.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h version.h
+ada/argv.o : ada/argv.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h
ada/cio.o : ada/cio.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h
- $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
- $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
-
+ada/cstreams.o : ada/cstreams.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h
+ada/env.o: ada/env.c $(CONFIG_H) $(SYSTEM_H) ada/env.h
+ada/exit.o : ada/exit.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h
+ada/final.o : ada/final.c
ada/init.o : ada/init.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h ada/raise.h
- $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
- $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
-
-ada/initialize.o : ada/initialize.c
- $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
- $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
-
+ada/initialize.o : ada/initialize.c $(CONFIG_H) $(SYSTEM_H) ada/raise.h
+ada/link.o : ada/link.c auto-host.h
ada/raise.o : ada/raise.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h ada/raise.h
- $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
- $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
+ada/seh_init.o: ada/seh_init.c $(CONFIG_H) $(SYSTEM_H) ada/raise.h
+ada/targext.o : ada/targext.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H)
ada/cuintp.o : ada/gcc-interface/cuintp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(TREE_H) ada/gcc-interface/ada.h ada/types.h ada/uintp.h \
@@ -1264,24 +1251,24 @@ ada/checks.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/g-htable.ads ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads \
ada/itypes.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
ada/lib-load.ads ada/lib-sort.adb ada/lib-util.ads ada/lib-xref.ads \
- ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb \
- ada/opt.ads ada/opt.adb ada/output.ads ada/put_alfa.ads \
- ada/restrict.ads ada/restrict.adb ada/rident.ads ada/rtsfind.ads \
- ada/rtsfind.adb ada/scans.ads ada/sem.ads ada/sem_attr.ads \
- ada/sem_aux.ads 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_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-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/namet.ads ada/namet-sp.ads ada/nlists.ads ada/nlists.adb \
+ ada/nmake.ads ada/nmake.adb ada/opt.ads ada/opt.adb ada/output.ads \
+ ada/put_alfa.ads ada/restrict.ads ada/restrict.adb ada/rident.ads \
+ ada/rtsfind.ads ada/rtsfind.adb ada/scans.ads ada/sem.ads \
+ ada/sem_attr.ads ada/sem_aux.ads 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_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-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
@@ -1318,24 +1305,24 @@ ada/cstand.o : ada/ada.ads ada/a-except.ads ada/a-unccon.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/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/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-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/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/urealp.adb \
- ada/widechar.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/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-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/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/urealp.adb ada/widechar.ads
ada/debug.o : ada/debug.ads ada/debug.adb ada/system.ads
@@ -1441,26 +1428,26 @@ ada/exp_aggr.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/get_targ.ads ada/gnat.ads ada/g-hesorg.ads ada/g-htable.ads \
ada/hostparm.ads ada/inline.ads ada/itypes.ads ada/lib.ads ada/lib.adb \
ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb ada/lib-util.ads \
- ada/lib-xref.ads ada/namet.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/restrict.adb ada/rident.ads ada/rtsfind.ads \
- ada/rtsfind.adb ada/scans.ads ada/sem.ads ada/sem_aggr.ads \
- ada/sem_attr.ads ada/sem_aux.ads 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_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-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/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/restrict.adb ada/rident.ads \
+ ada/rtsfind.ads ada/rtsfind.adb ada/scans.ads ada/sem.ads \
+ ada/sem_aggr.ads ada/sem_attr.ads ada/sem_aux.ads 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_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-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 \
@@ -1514,16 +1501,16 @@ ada/exp_attr.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/gnat.ads ada/g-hesorg.ads ada/g-htable.ads ada/gnatvsn.ads \
ada/hostparm.ads ada/inline.ads ada/itypes.ads ada/lib.ads ada/lib.adb \
ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb ada/lib-util.ads \
- ada/lib-xref.ads ada/namet.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/restrict.adb ada/rident.ads ada/rtsfind.ads \
- ada/scans.ads ada/sem.ads ada/sem.adb ada/sem_attr.ads ada/sem_aux.ads \
- ada/sem_ch10.ads ada/sem_ch11.ads ada/sem_ch12.ads ada/sem_ch13.ads \
- ada/sem_ch2.ads ada/sem_ch3.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/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/restrict.adb ada/rident.ads \
+ ada/rtsfind.ads ada/scans.ads ada/sem.ads ada/sem.adb ada/sem_attr.ads \
+ ada/sem_aux.ads ada/sem_ch10.ads ada/sem_ch11.ads ada/sem_ch12.ads \
+ ada/sem_ch13.ads ada/sem_ch2.ads ada/sem_ch3.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/stringt.adb ada/style.ads ada/styleg.ads \
ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-carun8.ads \
ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
@@ -1679,26 +1666,26 @@ ada/exp_ch4.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/gnat.ads ada/g-hesorg.ads ada/g-htable.ads ada/hostparm.ads \
ada/inline.ads ada/itypes.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
ada/lib-sort.adb ada/lib-util.ads ada/lib-xref.ads ada/namet.ads \
- ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
- ada/output.ads ada/par_sco.ads ada/put_alfa.ads ada/restrict.ads \
- ada/restrict.adb ada/rident.ads ada/rtsfind.ads ada/scans.ads \
- ada/scil_ll.ads ada/sem.ads ada/sem_attr.ads ada/sem_aux.ads \
- ada/sem_aux.adb 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/style.ads ada/styleg.ads \
- ada/styleg.adb ada/stylesw.ads ada/system.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/namet-sp.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads \
+ ada/nmake.adb ada/opt.ads ada/output.ads ada/par_sco.ads \
+ ada/put_alfa.ads ada/restrict.ads ada/restrict.adb ada/rident.ads \
+ ada/rtsfind.ads ada/scans.ads ada/scil_ll.ads ada/sem.ads \
+ ada/sem_attr.ads ada/sem_aux.ads ada/sem_aux.adb 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/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
+ ada/system.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 \
@@ -1712,24 +1699,25 @@ ada/exp_ch5.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/fname-uf.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \
ada/g-htable.ads ada/hostparm.ads ada/inline.ads ada/itypes.ads \
ada/lib.ads ada/lib-util.ads ada/lib-xref.ads ada/namet.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/restrict.adb \
- ada/rident.ads ada/rtsfind.ads ada/scans.ads ada/sem.ads \
- ada/sem_attr.ads ada/sem_aux.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-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/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/restrict.adb ada/rident.ads ada/rtsfind.ads \
+ ada/scans.ads ada/sem.ads ada/sem_attr.ads ada/sem_aux.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-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 \
@@ -1746,28 +1734,29 @@ ada/exp_ch6.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/gnat.ads ada/g-hesorg.ads ada/g-htable.ads ada/hostparm.ads \
ada/inline.ads ada/itypes.ads ada/layout.ads ada/lib.ads ada/lib.adb \
ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb ada/lib-util.ads \
- ada/lib-xref.ads ada/namet.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/restrict.adb ada/rident.ads ada/rtsfind.ads \
- ada/rtsfind.adb ada/scans.ads ada/scil_ll.ads ada/sem.ads ada/sem.adb \
- ada/sem_attr.ads ada/sem_aux.ads ada/sem_aux.adb ada/sem_ch10.ads \
- ada/sem_ch11.ads ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch2.ads \
- ada/sem_ch3.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_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-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/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/restrict.adb ada/rident.ads \
+ ada/rtsfind.ads ada/rtsfind.adb ada/scans.ads ada/scil_ll.ads \
+ ada/sem.ads ada/sem.adb ada/sem_attr.ads ada/sem_aux.ads \
+ ada/sem_aux.adb ada/sem_ch10.ads ada/sem_ch11.ads ada/sem_ch12.ads \
+ ada/sem_ch13.ads ada/sem_ch2.ads ada/sem_ch3.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_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-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 \
@@ -1781,26 +1770,27 @@ ada/exp_ch7.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/get_targ.ads ada/gnat.ads ada/g-hesorg.ads ada/g-htable.ads \
ada/hostparm.ads ada/inline.ads ada/itypes.ads ada/lib.ads ada/lib.adb \
ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb ada/lib-util.ads \
- ada/lib-xref.ads ada/namet.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/restrict.adb ada/rident.ads ada/rtsfind.ads \
- ada/scans.ads ada/sem.ads ada/sem.adb ada/sem_attr.ads ada/sem_aux.ads \
- ada/sem_aux.adb ada/sem_ch10.ads ada/sem_ch11.ads ada/sem_ch12.ads \
- ada/sem_ch13.ads ada/sem_ch2.ads ada/sem_ch3.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-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/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/restrict.adb ada/rident.ads \
+ ada/rtsfind.ads ada/scans.ads ada/sem.ads ada/sem.adb ada/sem_attr.ads \
+ ada/sem_aux.ads ada/sem_aux.adb ada/sem_ch10.ads ada/sem_ch11.ads \
+ ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch2.ads ada/sem_ch3.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-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 \
@@ -1837,26 +1827,26 @@ ada/exp_ch9.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/get_targ.ads ada/gnat.ads ada/g-htable.ads ada/gnatvsn.ads \
ada/hostparm.ads ada/inline.ads ada/interfac.ads ada/itypes.ads \
ada/layout.ads ada/lib.ads ada/lib-util.ads ada/lib-xref.ads \
- ada/namet.ads ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads \
- ada/nmake.adb ada/opt.ads ada/opt.adb ada/output.ads ada/put_alfa.ads \
- ada/restrict.ads ada/restrict.adb ada/rident.ads ada/rtsfind.ads \
- ada/scans.ads ada/sem.ads ada/sem_attr.ads ada/sem_aux.ads \
- ada/sem_aux.adb ada/sem_ch11.ads ada/sem_ch13.ads ada/sem_ch3.ads \
- ada/sem_ch5.ads ada/sem_ch6.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-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/namet.ads ada/namet.adb ada/namet-sp.ads ada/nlists.ads \
+ ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/opt.adb \
+ ada/output.ads ada/put_alfa.ads ada/restrict.ads ada/restrict.adb \
+ ada/rident.ads ada/rtsfind.ads ada/scans.ads ada/sem.ads \
+ ada/sem_attr.ads ada/sem_aux.ads ada/sem_aux.adb ada/sem_ch11.ads \
+ ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch5.ads ada/sem_ch6.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-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 \
@@ -1868,23 +1858,24 @@ ada/exp_code.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/g-hesorg.ads ada/g-htable.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-xref.ads ada/namet.ads ada/namet.adb \
- 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/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-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/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/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-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 \
@@ -1915,24 +1906,24 @@ ada/exp_disp.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/fname.ads ada/fname-uf.ads ada/freeze.ads ada/get_targ.ads \
ada/gnat.ads ada/g-htable.ads ada/gnatvsn.ads ada/hostparm.ads \
ada/inline.ads ada/itypes.ads ada/layout.ads ada/lib.ads \
- ada/lib-util.ads ada/lib-xref.ads ada/namet.ads ada/nlists.ads \
- ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/opt.adb \
- ada/output.ads ada/put_alfa.ads ada/restrict.ads ada/restrict.adb \
- ada/rident.ads ada/rtsfind.ads ada/scans.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/stringt.ads \
- ada/stringt.adb ada/style.ads ada/styleg.ads ada/styleg.adb \
- ada/stylesw.ads ada/system.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/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/opt.adb ada/output.ads ada/put_alfa.ads ada/restrict.ads \
+ ada/restrict.adb ada/rident.ads ada/rtsfind.ads ada/scans.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/stringt.ads ada/stringt.adb ada/style.ads ada/styleg.ads \
+ ada/styleg.adb ada/stylesw.ads ada/system.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/exp_dist.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
@@ -2017,24 +2008,24 @@ ada/exp_intr.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/get_targ.ads ada/gnat.ads ada/g-byorma.ads ada/g-htable.ads \
ada/hostparm.ads ada/inline.ads ada/interfac.ads ada/itypes.ads \
ada/lib.ads ada/lib-util.ads ada/lib-xref.ads ada/namet.ads \
- ada/namet.adb 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/restrict.adb ada/rident.ads ada/rtsfind.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-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/namet.adb 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/restrict.adb ada/rident.ads ada/rtsfind.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-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 \
@@ -2266,29 +2257,29 @@ ada/freeze.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/g-hesorg.ads ada/g-htable.ads ada/hostparm.ads ada/inline.ads \
ada/itypes.ads ada/layout.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
ada/lib-load.ads ada/lib-sort.adb ada/lib-util.ads ada/lib-xref.ads \
- ada/namet.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/sem.ads ada/sem.adb \
- ada/sem_aggr.ads ada/sem_attr.ads ada/sem_aux.ads ada/sem_aux.adb \
- ada/sem_cat.ads ada/sem_ch10.ads ada/sem_ch11.ads ada/sem_ch12.ads \
- ada/sem_ch13.ads ada/sem_ch2.ads ada/sem_ch3.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_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_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-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/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/sem.ads ada/sem.adb ada/sem_aggr.ads ada/sem_attr.ads \
+ ada/sem_aux.ads ada/sem_aux.adb ada/sem_cat.ads ada/sem_ch10.ads \
+ ada/sem_ch11.ads ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch2.ads \
+ ada/sem_ch3.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_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_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-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 \
@@ -2465,23 +2456,24 @@ ada/layout.o : ada/ada.ads ada/a-except.ads ada/a-unccon.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/layout.ads ada/layout.adb ada/lib.ads \
- ada/lib-util.ads ada/lib-xref.ads ada/namet.ads ada/nlists.ads \
- ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
- ada/put_alfa.ads ada/repinfo.ads ada/repinfo.adb 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/stringt.ads \
- ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
- ada/system.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/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/repinfo.ads ada/repinfo.adb \
+ 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/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
+ ada/stylesw.ads ada/system.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/lib-load.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 \
@@ -2554,24 +2546,25 @@ ada/lib-xref.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/g-htable.ads ada/g-table.ads ada/g-table.adb ada/hostparm.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-xref.ads ada/lib-xref.adb \
- ada/lib-xref-alfa.adb ada/namet.ads ada/nlists.ads ada/nlists.adb \
- ada/nmake.ads ada/nmake.adb ada/opt.ads ada/osint.ads ada/osint-c.ads \
- ada/output.ads ada/put_alfa.ads ada/put_alfa.adb 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_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-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-xref-alfa.adb ada/namet.ads ada/namet-sp.ads ada/nlists.ads \
+ ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/osint.ads \
+ ada/osint-c.ads ada/output.ads ada/put_alfa.ads ada/put_alfa.adb \
+ 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_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-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 \
@@ -2701,13 +2694,15 @@ ada/output.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/par.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 ada/atree.ads \
- ada/atree.adb ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads \
- ada/elists.ads ada/elists.adb ada/err_vars.ads ada/errout.ads \
- ada/errout.adb ada/erroutc.ads ada/exp_tss.ads ada/fname.ads \
- ada/fname-uf.ads ada/gnat.ads ada/g-byorma.ads ada/g-hesorg.ads \
- ada/g-htable.ads ada/g-speche.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/interfac.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
- ada/lib-load.ads ada/lib-sort.adb ada/namet.ads ada/namet.adb \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads \
+ ada/einfo.ads ada/elists.ads ada/elists.adb ada/err_vars.ads \
+ ada/errout.ads ada/errout.adb ada/erroutc.ads ada/exp_ch11.ads \
+ ada/exp_disp.ads ada/exp_tss.ads ada/exp_util.ads ada/fname.ads \
+ ada/fname-uf.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \
+ ada/g-byorma.ads ada/g-hesorg.ads ada/g-htable.ads ada/g-speche.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/interfac.ads ada/lib.ads \
+ ada/lib.adb ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb \
+ ada/lib-util.ads ada/lib-xref.ads ada/namet.ads ada/namet.adb \
ada/namet-sp.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads \
ada/nmake.adb ada/opt.ads ada/osint.ads ada/output.ads ada/par.ads \
ada/par.adb ada/par-ch10.adb ada/par-ch11.adb ada/par-ch12.adb \
@@ -2715,22 +2710,25 @@ ada/par.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads ada/a-uncdea.ads \
ada/par-ch5.adb ada/par-ch6.adb ada/par-ch7.adb ada/par-ch8.adb \
ada/par-ch9.adb ada/par-endh.adb ada/par-labl.adb ada/par-load.adb \
ada/par-prag.adb ada/par-sync.adb ada/par-tchk.adb ada/par-util.adb \
- ada/par_sco.ads ada/restrict.ads ada/rident.ads ada/scans.ads \
- ada/scans.adb ada/scn.ads ada/scng.ads ada/scng.adb ada/sem_aux.ads \
- ada/sem_util.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-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/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
+ ada/par_sco.ads ada/put_alfa.ads ada/restrict.ads ada/rident.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-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/widechar.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/atree.ads \
@@ -3148,10 +3146,10 @@ ada/sem_attr.o : ada/ada.ads ada/a-charac.ads ada/a-chlat1.ads \
ada/get_targ.ads ada/gnat.ads ada/g-byorma.ads ada/g-htable.ads \
ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads ada/itypes.ads \
ada/lib.ads ada/lib-load.ads ada/lib-util.ads ada/lib-xref.ads \
- ada/namet.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/restrict.adb ada/rident.ads ada/rtsfind.ads ada/scans.ads \
- ada/sdefault.ads ada/sem.ads ada/sem.adb ada/sem_aggr.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/restrict.adb ada/rident.ads ada/rtsfind.ads \
+ ada/scans.ads ada/sdefault.ads ada/sem.ads ada/sem.adb ada/sem_aggr.ads \
ada/sem_attr.ads ada/sem_attr.adb ada/sem_aux.ads ada/sem_aux.adb \
ada/sem_cat.ads ada/sem_ch10.ads ada/sem_ch11.ads ada/sem_ch12.ads \
ada/sem_ch13.ads ada/sem_ch2.ads ada/sem_ch3.ads ada/sem_ch4.ads \
@@ -3214,22 +3212,23 @@ ada/sem_cat.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/freeze.ads ada/get_targ.ads ada/gnat.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/lib-util.ads ada/lib-xref.ads \
- ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/opt.ads \
- ada/output.ads ada/put_alfa.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_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-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/namet.ads ada/namet-sp.ads ada/nlists.ads ada/nlists.adb \
+ ada/nmake.ads ada/opt.ads ada/output.ads ada/put_alfa.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_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-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 \
@@ -3242,27 +3241,27 @@ ada/sem_ch10.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/g-htable.ads ada/gnatvsn.ads ada/hostparm.ads ada/impunit.ads \
ada/inline.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
ada/lib-load.ads ada/lib-sort.adb ada/lib-util.ads ada/lib-xref.ads \
- ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb \
- ada/opt.ads ada/opt.adb ada/output.ads ada/par_sco.ads ada/put_alfa.ads \
- ada/restrict.ads ada/restrict.adb ada/rident.ads ada/rtsfind.ads \
- ada/scans.ads ada/sem.ads ada/sem.adb ada/sem_attr.ads ada/sem_aux.ads \
- ada/sem_ch10.ads ada/sem_ch10.adb ada/sem_ch11.ads ada/sem_ch12.ads \
- ada/sem_ch13.ads ada/sem_ch2.ads ada/sem_ch3.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_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-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/namet.ads ada/namet-sp.ads ada/nlists.ads ada/nlists.adb \
+ ada/nmake.ads ada/nmake.adb ada/opt.ads ada/opt.adb ada/output.ads \
+ ada/par_sco.ads ada/put_alfa.ads ada/restrict.ads ada/restrict.adb \
+ ada/rident.ads ada/rtsfind.ads ada/scans.ads ada/sem.ads ada/sem.adb \
+ ada/sem_attr.ads ada/sem_aux.ads ada/sem_ch10.ads ada/sem_ch10.adb \
+ ada/sem_ch11.ads ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch2.ads \
+ ada/sem_ch3.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_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-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 \
@@ -3296,10 +3295,10 @@ ada/sem_ch12.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/hostparm.ads ada/inline.ads ada/inline.adb ada/itypes.ads \
ada/lib.ads ada/lib.adb ada/lib-list.adb ada/lib-load.ads \
ada/lib-sort.adb ada/lib-util.ads ada/lib-xref.ads ada/namet.ads \
- ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
- ada/opt.adb ada/output.ads ada/put_alfa.ads ada/restrict.ads \
- ada/rident.ads ada/rtsfind.ads ada/rtsfind.adb ada/scans.ads \
- ada/sem.ads ada/sem.adb ada/sem_attr.ads ada/sem_aux.ads \
+ ada/namet-sp.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads \
+ ada/nmake.adb ada/opt.ads ada/opt.adb ada/output.ads ada/put_alfa.ads \
+ ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/rtsfind.adb \
+ ada/scans.ads ada/sem.ads ada/sem.adb ada/sem_attr.ads ada/sem_aux.ads \
ada/sem_cat.ads ada/sem_ch10.ads ada/sem_ch11.ads ada/sem_ch12.ads \
ada/sem_ch12.adb ada/sem_ch13.ads ada/sem_ch2.ads ada/sem_ch3.ads \
ada/sem_ch4.ads ada/sem_ch5.ads ada/sem_ch6.ads ada/sem_ch7.ads \
@@ -3332,27 +3331,27 @@ ada/sem_ch13.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/g-htable.ads ada/hostparm.ads ada/inline.ads ada/itypes.ads \
ada/lib.ads ada/lib.adb ada/lib-list.adb ada/lib-load.ads \
ada/lib-sort.adb ada/lib-util.ads ada/lib-xref.ads ada/namet.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/rtsfind.adb ada/scans.ads ada/sem.ads \
- ada/sem_attr.ads ada/sem_aux.ads ada/sem_aux.adb ada/sem_cat.ads \
- ada/sem_ch13.ads ada/sem_ch13.adb ada/sem_ch3.ads ada/sem_ch6.ads \
- ada/sem_ch7.ads ada/sem_ch8.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-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/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/rtsfind.adb \
+ ada/scans.ads ada/sem.ads ada/sem_attr.ads ada/sem_aux.ads \
+ ada/sem_aux.adb ada/sem_cat.ads ada/sem_ch13.ads ada/sem_ch13.adb \
+ ada/sem_ch3.ads ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.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-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 \
@@ -3382,29 +3381,30 @@ ada/sem_ch3.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/hostparm.ads ada/inline.ads ada/itypes.ads ada/layout.ads \
ada/lib.ads ada/lib.adb ada/lib-list.adb ada/lib-load.ads \
ada/lib-sort.adb ada/lib-util.ads ada/lib-xref.ads ada/namet.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/restrict.adb \
- ada/rident.ads ada/rtsfind.ads ada/scans.ads ada/sem.ads ada/sem.adb \
- ada/sem_attr.ads ada/sem_aux.ads ada/sem_aux.adb ada/sem_case.ads \
- ada/sem_case.adb ada/sem_cat.ads ada/sem_cat.adb ada/sem_ch10.ads \
- ada/sem_ch11.ads ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch2.ads \
- ada/sem_ch3.ads ada/sem_ch3.adb 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_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_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-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/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/restrict.adb ada/rident.ads ada/rtsfind.ads \
+ ada/scans.ads ada/sem.ads ada/sem.adb ada/sem_attr.ads ada/sem_aux.ads \
+ ada/sem_aux.adb ada/sem_case.ads ada/sem_case.adb ada/sem_cat.ads \
+ ada/sem_cat.adb ada/sem_ch10.ads ada/sem_ch11.ads ada/sem_ch12.ads \
+ ada/sem_ch13.ads ada/sem_ch2.ads ada/sem_ch3.ads ada/sem_ch3.adb \
+ 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_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_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-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 \
@@ -3451,30 +3451,30 @@ ada/sem_ch5.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-hesorg.ads \
ada/g-htable.ads ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads \
ada/itypes.ads ada/lib.ads ada/lib-load.ads ada/lib-util.ads \
- ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nlists.adb \
- ada/nmake.ads ada/nmake.adb ada/opt.ads ada/opt.adb ada/output.ads \
- ada/par_sco.ads ada/put_alfa.ads ada/restrict.ads ada/restrict.adb \
- ada/rident.ads ada/rtsfind.ads ada/scans.ads ada/sem.ads ada/sem.adb \
- ada/sem_aggr.ads ada/sem_attr.ads ada/sem_aux.ads ada/sem_case.ads \
- ada/sem_case.adb ada/sem_cat.ads ada/sem_ch10.ads ada/sem_ch11.ads \
- ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch2.ads ada/sem_ch3.ads \
- ada/sem_ch4.ads ada/sem_ch5.ads ada/sem_ch5.adb ada/sem_ch6.ads \
- ada/sem_ch7.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_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-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/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/opt.adb \
+ ada/output.ads ada/par_sco.ads ada/put_alfa.ads ada/restrict.ads \
+ ada/restrict.adb ada/rident.ads ada/rtsfind.ads ada/scans.ads \
+ ada/sem.ads ada/sem.adb ada/sem_aggr.ads ada/sem_attr.ads \
+ ada/sem_aux.ads ada/sem_case.ads ada/sem_case.adb ada/sem_cat.ads \
+ ada/sem_ch10.ads ada/sem_ch11.ads ada/sem_ch12.ads ada/sem_ch13.ads \
+ ada/sem_ch2.ads ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch5.ads \
+ ada/sem_ch5.adb ada/sem_ch6.ads ada/sem_ch7.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_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-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 \
@@ -3482,35 +3482,36 @@ ada/sem_ch6.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/debug_a.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \
ada/elists.adb ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
ada/eval_fat.ads ada/exp_ch11.ads ada/exp_ch6.ads ada/exp_ch7.ads \
- ada/exp_ch9.ads ada/exp_disp.ads ada/exp_tss.ads ada/exp_util.ads \
- ada/expander.ads ada/fname.ads ada/fname-uf.ads ada/freeze.ads \
- ada/get_targ.ads ada/gnat.ads ada/g-hesorg.ads ada/g-htable.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads ada/itypes.ads \
- ada/layout.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
+ ada/exp_ch9.ads ada/exp_dbug.ads ada/exp_disp.ads ada/exp_tss.ads \
+ ada/exp_util.ads ada/expander.ads ada/fname.ads ada/fname-uf.ads \
+ ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-hesorg.ads \
+ ada/g-htable.ads ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads \
+ ada/itypes.ads ada/layout.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
ada/lib-load.ads ada/lib-sort.adb ada/lib-util.ads ada/lib-xref.ads \
- ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb \
- ada/opt.ads ada/opt.adb ada/output.ads ada/put_alfa.ads \
- ada/restrict.ads ada/restrict.adb ada/rident.ads ada/rtsfind.ads \
- ada/scans.ads ada/sem.ads ada/sem.adb ada/sem_attr.ads ada/sem_aux.ads \
- ada/sem_aux.adb ada/sem_cat.ads ada/sem_ch10.ads ada/sem_ch11.ads \
- ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch2.ads ada/sem_ch3.ads \
- ada/sem_ch4.ads ada/sem_ch5.ads ada/sem_ch6.ads ada/sem_ch6.adb \
- ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_ch9.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-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/namet.ads ada/namet-sp.ads ada/nlists.ads ada/nlists.adb \
+ ada/nmake.ads ada/nmake.adb ada/opt.ads ada/opt.adb ada/output.ads \
+ ada/put_alfa.ads ada/restrict.ads ada/restrict.adb ada/rident.ads \
+ ada/rtsfind.ads ada/scans.ads ada/sem.ads ada/sem.adb ada/sem_attr.ads \
+ ada/sem_aux.ads ada/sem_aux.adb ada/sem_cat.ads ada/sem_ch10.ads \
+ ada/sem_ch11.ads ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch2.ads \
+ ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch5.ads ada/sem_ch6.ads \
+ ada/sem_ch6.adb ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_ch9.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-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 \
@@ -3522,24 +3523,25 @@ ada/sem_ch7.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/gnat.ads ada/g-hesorg.ads ada/g-htable.ads ada/hostparm.ads \
ada/inline.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
ada/lib-sort.adb ada/lib-util.ads ada/lib-xref.ads ada/namet.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/sem.ads ada/sem_attr.ads \
- ada/sem_aux.ads ada/sem_cat.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-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/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/sem.ads ada/sem_attr.ads ada/sem_aux.ads ada/sem_cat.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-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 \
@@ -3588,29 +3590,29 @@ ada/sem_ch9.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \
ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads ada/itypes.ads \
ada/layout.ads ada/lib.ads ada/lib-load.ads ada/lib-util.ads \
- ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nlists.adb \
- ada/nmake.ads ada/nmake.adb ada/opt.ads ada/opt.adb ada/output.ads \
- ada/put_alfa.ads ada/restrict.ads ada/restrict.adb ada/rident.ads \
- ada/rtsfind.ads ada/scans.ads ada/sem.ads ada/sem.adb ada/sem_aggr.ads \
- ada/sem_attr.ads ada/sem_aux.ads ada/sem_cat.ads ada/sem_ch10.ads \
- ada/sem_ch11.ads ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch2.ads \
- ada/sem_ch3.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_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-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/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/opt.adb \
+ ada/output.ads ada/put_alfa.ads ada/restrict.ads ada/restrict.adb \
+ ada/rident.ads ada/rtsfind.ads ada/scans.ads ada/sem.ads ada/sem.adb \
+ ada/sem_aggr.ads ada/sem_attr.ads ada/sem_aux.ads ada/sem_cat.ads \
+ ada/sem_ch10.ads ada/sem_ch11.ads ada/sem_ch12.ads ada/sem_ch13.ads \
+ ada/sem_ch2.ads ada/sem_ch3.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_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-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 \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -3622,24 +3624,25 @@ ada/sem_dim.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/g-byorma.ads ada/g-hesorg.ads ada/g-htable.ads ada/hostparm.ads \
ada/lib.ads ada/lib.adb ada/lib-list.adb ada/lib-load.ads \
ada/lib-sort.adb ada/lib-util.ads ada/lib-xref.ads ada/namet.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/rtsfind.adb 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-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/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/rtsfind.adb \
+ 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-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 \
@@ -3651,15 +3654,15 @@ ada/sem_disp.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/exp_util.ads ada/fname.ads ada/fname-uf.ads ada/freeze.ads \
ada/get_targ.ads ada/gnat.ads ada/g-htable.ads ada/gnatvsn.ads \
ada/hostparm.ads ada/itypes.ads ada/layout.ads ada/lib.ads \
- ada/lib-util.ads ada/lib-xref.ads ada/namet.ads ada/nlists.ads \
- ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/opt.adb \
- ada/output.ads ada/put_alfa.ads ada/restrict.ads ada/restrict.adb \
- ada/rident.ads ada/rtsfind.ads ada/scans.ads ada/scil_ll.ads \
- ada/sem.ads ada/sem_attr.ads ada/sem_aux.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/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/opt.adb ada/output.ads ada/put_alfa.ads ada/restrict.ads \
+ ada/restrict.adb ada/rident.ads ada/rtsfind.ads ada/scans.ads \
+ ada/scil_ll.ads ada/sem.ads ada/sem_attr.ads ada/sem_aux.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-exctab.ads ada/s-htable.ads \
ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
@@ -3697,23 +3700,24 @@ ada/sem_elab.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/gnat.ads ada/g-hesorg.ads ada/g-htable.ads ada/hostparm.ads \
ada/lib.ads ada/lib.adb ada/lib-list.adb ada/lib-load.ads \
ada/lib-sort.adb ada/lib-util.ads ada/lib-xref.ads ada/namet.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/restrict.adb \
- ada/rident.ads ada/rtsfind.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/stringt.ads ada/style.ads \
- ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.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/widechar.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/restrict.adb ada/rident.ads ada/rtsfind.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/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
+ ada/stylesw.ads ada/system.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/widechar.ads
ada/sem_elim.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,27 +3747,27 @@ ada/sem_eval.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/exp_disp.ads ada/exp_tss.ads ada/exp_util.ads ada/expander.ads \
ada/fname.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \
ada/g-htable.ads ada/hostparm.ads ada/itypes.ads ada/lib.ads \
- ada/lib-util.ads ada/lib-xref.ads ada/namet.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/sem.ads ada/sem_aggr.ads ada/sem_attr.ads \
- ada/sem_aux.ads ada/sem_aux.adb ada/sem_cat.ads ada/sem_ch13.ads \
- ada/sem_ch4.ads ada/sem_ch6.ads ada/sem_ch8.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-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/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/sem.ads ada/sem_aggr.ads \
+ ada/sem_attr.ads ada/sem_aux.ads ada/sem_aux.adb ada/sem_cat.ads \
+ ada/sem_ch13.ads ada/sem_ch4.ads ada/sem_ch6.ads ada/sem_ch8.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-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 \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -3856,31 +3860,31 @@ ada/sem_res.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/gnat.ads ada/g-hesorg.ads ada/g-htable.ads ada/gnatvsn.ads \
ada/hostparm.ads ada/inline.ads ada/itypes.ads ada/lib.ads ada/lib.adb \
ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb ada/lib-util.ads \
- ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nlists.adb \
- ada/nmake.ads ada/nmake.adb ada/opt.ads ada/opt.adb ada/output.ads \
- ada/put_alfa.ads ada/restrict.ads ada/restrict.adb ada/rident.ads \
- ada/rtsfind.ads ada/rtsfind.adb ada/scans.ads ada/sem.ads ada/sem.adb \
- ada/sem_aggr.ads ada/sem_attr.ads ada/sem_aux.ads ada/sem_cat.ads \
- ada/sem_ch10.ads ada/sem_ch11.ads ada/sem_ch12.ads ada/sem_ch13.ads \
- ada/sem_ch2.ads ada/sem_ch3.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_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_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-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/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/opt.adb \
+ ada/output.ads ada/put_alfa.ads ada/restrict.ads ada/restrict.adb \
+ ada/rident.ads ada/rtsfind.ads ada/rtsfind.adb ada/scans.ads \
+ ada/sem.ads ada/sem.adb ada/sem_aggr.ads ada/sem_attr.ads \
+ ada/sem_aux.ads ada/sem_cat.ads ada/sem_ch10.ads ada/sem_ch11.ads \
+ ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch2.ads ada/sem_ch3.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_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_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-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 \
@@ -3917,23 +3921,24 @@ ada/sem_type.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-hesorg.ads \
ada/g-htable.ads ada/hostparm.ads ada/inline.ads ada/lib.ads \
ada/lib.adb ada/lib-list.adb ada/lib-sort.adb ada/lib-util.ads \
- ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nlists.adb \
- ada/nmake.ads ada/opt.ads ada/output.ads ada/put_alfa.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_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/stringt.ads \
- ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
- ada/system.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/treepr.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/lib-xref.ads ada/namet.ads ada/namet-sp.ads ada/nlists.ads \
+ ada/nlists.adb ada/nmake.ads ada/opt.ads ada/output.ads \
+ ada/put_alfa.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_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/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
+ ada/stylesw.ads ada/system.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/treepr.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.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 \
@@ -3946,28 +3951,29 @@ ada/sem_util.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/g-byorma.ads ada/g-hesorg.ads ada/g-htable.ads ada/hostparm.ads \
ada/inline.ads ada/interfac.ads ada/lib.ads ada/lib.adb \
ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb ada/lib-util.ads \
- ada/lib-xref.ads ada/namet.ads ada/namet.adb 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/restrict.adb ada/rident.ads \
- ada/rtsfind.ads ada/rtsfind.adb ada/scans.ads ada/sem.ads ada/sem.adb \
- ada/sem_attr.ads ada/sem_aux.ads ada/sem_cat.ads ada/sem_ch10.ads \
- ada/sem_ch11.ads ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch2.ads \
- ada/sem_ch3.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_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-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/lib-xref.ads ada/namet.ads ada/namet.adb 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/restrict.adb \
+ ada/rident.ads ada/rtsfind.ads ada/rtsfind.adb ada/scans.ads \
+ ada/sem.ads ada/sem.adb ada/sem_attr.ads ada/sem_aux.ads \
+ ada/sem_cat.ads ada/sem_ch10.ads ada/sem_ch11.ads ada/sem_ch12.ads \
+ ada/sem_ch13.ads ada/sem_ch2.ads ada/sem_ch3.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_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-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 \
@@ -3990,8 +3996,8 @@ ada/sem_warn.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-byorma.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/lib-util.ads \
- ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nlists.adb \
- ada/nmake.ads ada/opt.ads ada/output.ads ada/par_sco.ads \
+ ada/lib-xref.ads ada/namet.ads ada/namet-sp.ads ada/nlists.ads \
+ ada/nlists.adb ada/nmake.ads ada/opt.ads ada/output.ads ada/par_sco.ads \
ada/put_alfa.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_aux.adb ada/sem_ch8.ads ada/sem_disp.ads ada/sem_eval.ads \
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
index d2491073c0b..dd71b322415 100644
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -2610,7 +2610,7 @@ $(RTSDIR)/s-oscons.ads: ../stamp-gnatlib1-$(RTSDIR) s-oscons-tmplt.c gsocket.h .
(cd $(RTSDIR) ; \
$(OSCONS_CPP) ; \
$(OSCONS_EXTRACT) ; \
- ../bldtools/oscons/xoscons)
+ ../bldtools/oscons/xoscons s-oscons)
# Don't use semicolon separated shell commands that involve list expansions.
# The semicolon triggers a call to DCL on VMS and DCL can't handle command
diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb
index a4d01c9f8ba..47c4b177f01 100644
--- a/gcc/ada/gnat1drv.adb
+++ b/gcc/ada/gnat1drv.adb
@@ -418,8 +418,11 @@ procedure Gnat1drv is
-- Set switches for formal verification mode
- if Debug_Flag_Dot_FF then
+ if Debug_Flag_Dot_VV then
+ Formal_Extensions := True;
+ end if;
+ if Debug_Flag_Dot_FF then
Alfa_Mode := True;
-- Set strict standard interpretation of compiler permissions
@@ -448,15 +451,13 @@ procedure Gnat1drv is
Restrict.Restrictions.Set (No_Initialize_Scalars) := True;
- -- Suppress all language checks since they are handled implicitly by
- -- the formal verification backend.
- -- Turn off dynamic elaboration checks.
- -- Turn off alignment checks.
- -- Turn off validity checking.
-
- Suppress_Options := Suppress_All;
- Dynamic_Elaboration_Checks := False;
- Reset_Validity_Check_Options;
+ -- Note: at this point we used to suppress various checks, but that
+ -- is not what we want. We need the semantic processing for these
+ -- checks (which will set flags like Do_Overflow_Check, showing the
+ -- points at which potential checks are required semantically). We
+ -- don't want the expansion associated with these checks, but that
+ -- happens anyway because this expansion is simply not done in the
+ -- Alfa version of the expander.
-- Kill debug of generated code, since it messes up sloc values
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index 9e875bc9c52..ef57af5217f 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -107,6 +107,7 @@ Implementation Defined Pragmas
* Pragma Assert::
* Pragma Assertion_Policy::
* Pragma Assume_No_Invalid_Values::
+* Pragma Attribute_Definition::
* Pragma Ast_Entry::
* Pragma C_Pass_By_Copy::
* Pragma Check::
@@ -845,6 +846,7 @@ consideration, the use of these pragmas should be minimized.
* Pragma Assert::
* Pragma Assertion_Policy::
* Pragma Assume_No_Invalid_Values::
+* Pragma Attribute_Definition::
* Pragma Ast_Entry::
* Pragma C_Pass_By_Copy::
* Pragma Check::
@@ -1195,7 +1197,6 @@ 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 Assertion_Policy
@unnumberedsec Pragma Assertion_Policy
@findex Debug_Policy
@@ -1309,6 +1310,31 @@ resulting from an OpenVMS system service call. The pragma does not affect
normal use of the entry. For further details on this pragma, see the
DEC Ada Language Reference Manual, section 9.12a.
+@node Pragma Attribute_Definition
+@unnumberedsec Pragma Attribute_Definition
+@findex Attribute_Definition
+@noindent
+Syntax:
+@smallexample @c ada
+pragma Attribute_Definition
+ ([Attribute =>] ATTRIBUTE_DESIGNATOR,
+ [Entity =>] LOCAL_NAME,
+ [Expression =>] EXPRESSION | NAME);
+@end smallexample
+
+@noindent
+If @code{Attribute} is a known attribute name, this pragma is equivalent to
+the attribute definition clause:
+
+@smallexample @c ada
+ for Entity'Attribute use Expression;
+@end smallexample
+
+If @code{Attribute} is not a recognized attribute name, the pragma is
+ignored, and a warning is emitted. This allows source
+code to be written that takes advantage of some new attribute, while remaining
+compilable with earlier compilers.
+
@node Pragma C_Pass_By_Copy
@unnumberedsec Pragma C_Pass_By_Copy
@cindex Passing by copy
@@ -4006,6 +4032,12 @@ allowed to be bigger than the size of the type, but it can waste space if for
example fields of type R appear in an enclosing record. If the above type is
compiled in @code{Optimize_Alignment (Space)} mode, the alignment is set to 1.
+However, there is one case in which SPACE is ignored. If a variable length
+record (that is a discriminated record with a component which is an array
+whose length depends on a discriminant), has a pragam pack, then it is not
+in general possible to set the alignment of such a record to one, so the
+pragma is ignored in this case (with a warning).
+
Specifying TIME causes larger default alignments to be chosen in the case of
small types with sizes that are not a power of 2. For example, consider:
@@ -7951,7 +7983,7 @@ features are used, as defined in Annex J of the Ada Reference Manual.
wide types
appear, and that no wide or wide wide string or character literals
appear in the program (that is literals representing characters not in
-type @code{Character}.
+type @code{Character}).
@node SPARK
@unnumberedsubsec SPARK
@@ -9423,6 +9455,18 @@ accuracy in some portions of the domain.
@end cartouche
Followed.
+@cindex Sequential elaboration policy
+@unnumberedsec H.6(15/2): Pragma Partition_Elaboration_Policy
+
+@sp 1
+@cartouche
+If the partition elaboration policy is @code{Sequential} and the
+Environment task becomes permanently blocked during elaboration then the
+partition is deadlocked and it is recommended that the partition be
+immediately terminated.
+@end cartouche
+Not followed.
+
@c -----------------------------------------
@node Implementation Defined Characteristics
@chapter Implementation Defined Characteristics
@@ -9515,8 +9559,12 @@ See separate section on source representation.
length. See 2.2(15).
@end cartouche
@noindent
-The maximum line length is 255 characters and the maximum length of a
-lexical element is also 255 characters.
+The maximum line length is 255 characters and the maximum length of
+a lexical element is also 255 characters. This is the default setting
+if not overridden by the use of compiler switch @option{-gnaty} (which
+sets the maximum to 79) or @option{-gnatyMnn} which allows the maximum
+line length to be specified to be any value up to 32767. The maximum
+length of a lexical element is the same as the maximum line length.
@sp 1
@cartouche
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index b94f035ba91..2455b880a7b 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -5159,6 +5159,7 @@ switch are
@option{-gnatwh} (hiding),
@option{-gnatw.h} (holes (gaps) in record layouts)
@option{-gnatw.i} (overlapping actuals),
+@option{-gnatw.k} (redefinition of names in standard),
@option{-gnatwl} (elaboration warnings),
@option{-gnatw.l} (inherited aspects),
@option{-gnatw.o} (warn on values set by out parameters ignored),
@@ -5469,6 +5470,24 @@ This warning can also be turned on using @option{-gnatwa}.
@cindex @option{-gnatwK} (@command{gcc})
This switch disables warnings on variables that could be declared constants.
+@item -gnatw.k
+@emph{Activate warnings on redefinition of names in standard.}
+@cindex @option{-gnatw.k} (@command{gcc})
+This switch activates warnings for declarations that declare a name that
+is defined in package Standard. Such declarations can be confusing,
+especially since the names in package Standard continue to be directly
+visible, meaning that use visibiliy on such redeclared names does not
+work as expected. Names of discriminants and components in records are
+not included in this check.
+This warning is not part of the warnings activated by @option{-gnatwa}.
+It must be explicitly activated.
+
+@item -gnatw.K
+@emph{Suppress warnings on variables that could be constants.}
+@cindex @option{-gnatwK} (@command{gcc})
+This switch activates warnings for declarations that declare a name that
+is defined in package Standard.
+
@item -gnatwl
@emph{Activate warnings for elaboration pragmas.}
@cindex @option{-gnatwl} (@command{gcc})
@@ -6638,13 +6657,16 @@ any trailing blanks. The value of 79 allows convenient display on an
80 character wide device or window, allowing for possible special
treatment of 80 character lines. Note that this count is of
characters in the source text. This means that a tab character counts
-as one character in this count but a wide character sequence counts as
+as one character in this count and a wide character sequence counts as
a single character (however many bytes are needed in the encoding).
@item ^Mnnn^MAX_LENGTH=nnn^
@emph{Set maximum line length.}
The length of lines must not exceed the
given value @option{nnn}. The maximum value that can be specified is 32767.
+If neither style option for setting the line length is used, then the
+default is 255. This also controls the maximum length of lexical elements,
+where the only restriction is that they must fit on a single line.
@item ^n^STANDARD_CASING^
@emph{Check casing of entities in Standard.}
@@ -19131,7 +19153,7 @@ only.
@item -fada-spec-parent=@var{unit}
@cindex -fada-spec-parent (@command{gcc})
-Specifies that all files generated by @option{-fdump-ada-spec-slim} are
+Specifies that all files generated by @option{-fdump-ada-spec*} are
to be child units of the specified parent unit.
@item -C
@@ -28327,6 +28349,38 @@ other part of your application. In this case, use GNAT to build the DLL
or whatever environment to build your executable.
@end enumerate
+In addition to the description about C main in
+@pxref{Mixed Language Programming} section, if the C main uses a
+stand-alone library it is required on x86-windows to
+setup the SEH context. For this the C main must looks like this:
+
+@smallexample
+/* main.c */
+extern void adainit (void);
+extern void adafinal (void);
+extern void __gnat_initialize(void*);
+extern void call_to_ada (void);
+
+int main (int argc, char *argv[])
+@{
+ int SEH [2];
+
+ /* Initialize the SEH context */
+ __gnat_initialize (&SEH);
+
+ adainit();
+
+ /* Then call Ada services in the stand-alone library */
+
+ call_to_ada();
+
+ adafinal();
+@}
+@end smallexample
+
+Note that this is not needed on x86_64-windows where the Windows
+native SEH support is used.
+
@node Windows Calling Conventions
@section Windows Calling Conventions
@findex Stdcall
diff --git a/gcc/ada/i-cstrea.ads b/gcc/ada/i-cstrea.ads
index 37d8ab733db..8882a7d3de6 100644
--- a/gcc/ada/i-cstrea.ads
+++ b/gcc/ada/i-cstrea.ads
@@ -175,7 +175,7 @@ package Interfaces.C_Streams is
mode : int;
size : size_t) return int;
- procedure tmpnam (string : chars) renames System.CRTL.tmpnam;
+ procedure tmpnam (str : chars) renames System.CRTL.tmpnam;
-- The parameter must be a pointer to a string buffer of at least L_tmpnam
-- bytes (the call with a null parameter is not supported). The returned
-- value, which is just a copy of the input argument, is discarded.
diff --git a/gcc/ada/layout.adb b/gcc/ada/layout.adb
index 1f44196bded..651107f24c4 100644
--- a/gcc/ada/layout.adb
+++ b/gcc/ada/layout.adb
@@ -2882,7 +2882,12 @@ package body Layout is
and then Is_Packed (E)
and then not Is_Atomic (E)
then
- Align := 1;
+ if not Size_Known_At_Compile_Time (E) then
+ Error_Msg_N ("Optimize_Alignment has no effect for &", E);
+ Error_Msg_N ("\pragma is ignored for variable length record?", E);
+ else
+ Align := 1;
+ end if;
-- Not a record, or not packed
diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb
index 1c55a06aa3e..e84023c1f19 100644
--- a/gcc/ada/lib-writ.adb
+++ b/gcc/ada/lib-writ.adb
@@ -1099,6 +1099,11 @@ package body Lib.Writ is
end if;
end if;
+ if Partition_Elaboration_Policy /= ' ' then
+ Write_Info_Str (" E");
+ Write_Info_Char (Partition_Elaboration_Policy);
+ end if;
+
if not Object then
Write_Info_Str (" NO");
end if;
diff --git a/gcc/ada/lib-writ.ads b/gcc/ada/lib-writ.ads
index fdc99482afe..72f10d9c11a 100644
--- a/gcc/ada/lib-writ.ads
+++ b/gcc/ada/lib-writ.ads
@@ -196,6 +196,10 @@ package Lib.Writ is
-- DB Detect_Blocking pragma is in effect for all units in this
-- file.
--
+ -- Ex A valid Partition_Elaboration_Policy pragma applies to all
+ -- the units in this file, where x is the first character
+ -- (upper case) of the policy name (e.g. 'C' for Concurrent).
+ --
-- FD Configuration pragmas apply to all the units in this file
-- specifying a possibly non-standard floating point format
-- (VAX float with Long_Float using D_Float).
diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads
index 88194b3023b..9221be94e04 100644
--- a/gcc/ada/opt.ads
+++ b/gcc/ada/opt.ads
@@ -1085,6 +1085,18 @@ package Opt is
-- True if output of list of objects is requested (-O switch set). List is
-- output under the given filename, or standard output if not specified.
+ Partition_Elaboration_Policy : Character := ' ';
+ -- GNAT, GNATBIND
+ -- Set to ' ' for the default case (no elaboration policy specified). Reset
+ -- to first character (uppercase) of locking policy name if a valid pragma
+ -- Partition_Elaboration_Policy is encountered.
+
+ Partition_Elaboration_Policy_Sloc : Source_Ptr := No_Location;
+ -- GNAT, GNATBIND
+ -- Remember location of previous Partition_Elaboration_Policy pragma. This
+ -- is used for inconsistency error messages. A value of System_Location is
+ -- used if the policy is set in package System.
+
Persistent_BSS_Mode : Boolean := False;
-- GNAT
-- True if a Persistent_BSS configuration pragma is in effect, causing
@@ -1924,6 +1936,11 @@ package Opt is
-- for integers are limited to the strict minimum with this option. Set by
-- debug flag -gnatd.D.
+ Formal_Extensions : Boolean := False;
+ -- When this flag is set, new aspects/pragmas/attributes are accepted,
+ -- whose main purpose is to facilitate formal verification. Set by debug
+ -- flag -gnatd.V.
+
function Full_Expander_Active return Boolean;
pragma Inline (Full_Expander_Active);
-- Returns the value of (Expander_Active and not Alfa_Mode). This "flag"
diff --git a/gcc/ada/par-ch11.adb b/gcc/ada/par-ch11.adb
index a11894cb8f8..c255325699f 100644
--- a/gcc/ada/par-ch11.adb
+++ b/gcc/ada/par-ch11.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, 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- --
@@ -137,12 +137,14 @@ package body Ch11 is
Scan; -- past :
Change_Identifier_To_Defining_Identifier (Choice_Param_Node);
+ Warn_If_Standard_Redefinition (Choice_Param_Node);
Set_Choice_Parameter (Handler_Node, Choice_Param_Node);
elsif Token = Tok_Others then
Error_Msg_AP -- CODEFIX
("missing "":""");
Change_Identifier_To_Defining_Identifier (Choice_Param_Node);
+ Warn_If_Standard_Redefinition (Choice_Param_Node);
Set_Choice_Parameter (Handler_Node, Choice_Param_Node);
else
diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb
index bfc4f592bf3..728a704f5f6 100644
--- a/gcc/ada/par-ch3.adb
+++ b/gcc/ada/par-ch3.adb
@@ -243,6 +243,13 @@ package body Ch3 is
if Ident_Node /= Error then
Change_Identifier_To_Defining_Identifier (Ident_Node);
+
+ -- Warn if standard redefinition, except that we never warn on a
+ -- record field definition (since this is always a harmless case).
+
+ if not Inside_Record_Definition then
+ Warn_If_Standard_Redefinition (Ident_Node);
+ end if;
end if;
return Ident_Node;
@@ -3191,6 +3198,7 @@ package body Ch3 is
Rec_Node : Node_Id;
begin
+ Inside_Record_Definition := True;
Rec_Node := New_Node (N_Record_Definition, Token_Ptr);
-- Null record case
@@ -3235,6 +3243,7 @@ package body Ch3 is
end loop;
end if;
+ Inside_Record_Definition := False;
return Rec_Node;
end P_Record_Definition;
diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb
index df13d005855..352feeaf86e 100644
--- a/gcc/ada/par-ch4.adb
+++ b/gcc/ada/par-ch4.adb
@@ -2364,6 +2364,7 @@ package body Ch4 is
begin
-- The loop runs more than once only if misplaced pragmas are found
+ -- or if a misplaced unary minus is skipped.
loop
case Token is
@@ -2537,8 +2538,15 @@ package body Ch4 is
return P_Identifier;
end if;
+ -- Minus may well be an improper attempt at a unary minus. Give
+ -- a message, skip the minus and keep going!
+
+ when Tok_Minus =>
+ Error_Msg_SC ("parentheses required for unary minus");
+ Scan; -- past minus
+
-- Anything else is illegal as the first token of a primary, but
- -- we test for a reserved identifier so that it is treated nicely
+ -- we test for some common errors, to improve error messages.
when others =>
if Is_Reserved_Identifier then
diff --git a/gcc/ada/par-ch6.adb b/gcc/ada/par-ch6.adb
index 4f6ccb52339..c0fc7734e72 100644
--- a/gcc/ada/par-ch6.adb
+++ b/gcc/ada/par-ch6.adb
@@ -1139,6 +1139,7 @@ package body Ch6 is
if Token /= Tok_Dot then
Change_Identifier_To_Defining_Identifier (Ident_Node);
+ Warn_If_Standard_Redefinition (Ident_Node);
return Ident_Node;
-- Child library unit name case
@@ -1176,6 +1177,7 @@ package body Ch6 is
Change_Node (Prefix_Node, N_Defining_Program_Unit_Name);
Set_Name (Prefix_Node, Name_Node);
Change_Identifier_To_Defining_Identifier (Ident_Node);
+ Warn_If_Standard_Redefinition (Ident_Node);
Set_Defining_Identifier (Prefix_Node, Ident_Node);
-- All set with unit name parsed
@@ -1667,6 +1669,7 @@ package body Ch6 is
begin
Return_Obj := Token_Node;
Change_Identifier_To_Defining_Identifier (Return_Obj);
+ Warn_If_Standard_Redefinition (Return_Obj);
Decl_Node := New_Node (N_Object_Declaration, Token_Ptr);
Set_Defining_Identifier (Decl_Node, Return_Obj);
diff --git a/gcc/ada/par-prag.adb b/gcc/ada/par-prag.adb
index 8b071424567..7dcf94033bb 100644
--- a/gcc/ada/par-prag.adb
+++ b/gcc/ada/par-prag.adb
@@ -1098,10 +1098,12 @@ begin
Pragma_All_Calls_Remote |
Pragma_Annotate |
Pragma_Assert |
+ Pragma_Assert_And_Cut |
Pragma_Asynchronous |
Pragma_Atomic |
Pragma_Atomic_Components |
Pragma_Attach_Handler |
+ Pragma_Attribute_Definition |
Pragma_Check |
Pragma_Check_Name |
Pragma_Check_Policy |
@@ -1201,6 +1203,7 @@ begin
Pragma_Optimize_Alignment |
Pragma_Overflow_Checks |
Pragma_Pack |
+ Pragma_Partition_Elaboration_Policy |
Pragma_Passive |
Pragma_Preelaborable_Initialization |
Pragma_Polling |
diff --git a/gcc/ada/par-util.adb b/gcc/ada/par-util.adb
index efcf70bf352..3baf9f51f57 100644
--- a/gcc/ada/par-util.adb
+++ b/gcc/ada/par-util.adb
@@ -27,6 +27,7 @@ with Csets; use Csets;
with Namet.Sp; use Namet.Sp;
with Stylesw; use Stylesw;
with Uintp; use Uintp;
+with Warnsw; use Warnsw;
with GNAT.Spelling_Checker; use GNAT.Spelling_Checker;
@@ -715,20 +716,7 @@ package body Util is
procedure Signal_Bad_Attribute is
begin
- Error_Msg_N ("unrecognized attribute&", Token_Node);
-
- -- Check for possible misspelling
-
- Error_Msg_Name_1 := First_Attribute_Name;
- while Error_Msg_Name_1 <= Last_Attribute_Name loop
- if Is_Bad_Spelling_Of (Token_Name, Error_Msg_Name_1) then
- Error_Msg_N -- CODEFIX
- ("\possible misspelling of %", Token_Node);
- exit;
- end if;
-
- Error_Msg_Name_1 := Error_Msg_Name_1 + 1;
- end loop;
+ Bad_Attribute (Token_Node, Token_Name, Warn => False);
end Signal_Bad_Attribute;
-----------------------------
@@ -762,4 +750,21 @@ package body Util is
return (Token_Ptr = First_Non_Blank_Location or else Token = Tok_EOF);
end Token_Is_At_Start_Of_Line;
+ -----------------------------------
+ -- Warn_If_Standard_Redefinition --
+ -----------------------------------
+
+ procedure Warn_If_Standard_Redefinition (N : Node_Id) is
+ begin
+ if Warn_On_Standard_Redefinition then
+ declare
+ C : constant Entity_Id := Current_Entity (N);
+ begin
+ if Present (C) and then Sloc (C) = Standard_Location then
+ Error_Msg_N ("redefinition of entity& in Standard?", N);
+ end if;
+ end;
+ end if;
+ end Warn_If_Standard_Redefinition;
+
end Util;
diff --git a/gcc/ada/par.adb b/gcc/ada/par.adb
index 486c0f3da65..571713f3d51 100644
--- a/gcc/ada/par.adb
+++ b/gcc/ada/par.adb
@@ -59,7 +59,7 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is
Num_Library_Units : Natural := 0;
-- Count number of units parsed (relevant only in syntax check only mode,
- -- since in semantics check mode only a single unit is permitted anyway)
+ -- since in semantics check mode only a single unit is permitted anyway).
Save_Config_Switches : Config_Switches_Type;
-- Variable used to save values of config switches while we parse the
@@ -67,7 +67,11 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is
Loop_Block_Count : Nat := 0;
-- Counter used for constructing loop/block names (see the routine
- -- Par.Ch5.Get_Loop_Block_Name)
+ -- Par.Ch5.Get_Loop_Block_Name).
+
+ Inside_Record_Definition : Boolean := False;
+ -- Flag set True within a record definition. Used to control warning
+ -- for redefinition of standard entities (not issued for field names).
--------------------
-- Error Recovery --
@@ -1264,6 +1268,11 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is
function Token_Is_At_End_Of_Line return Boolean;
-- Determines if the current token is the last token on the line
+ procedure Warn_If_Standard_Redefinition (N : Node_Id);
+ -- Issues a warning if Warn_On_Standard_Redefinition is set True, and
+ -- the Node N (which is a Defining_Identifier node with the Chars field
+ -- set) is a renaming of an entity in package Standard.
+
end Util;
--------------
diff --git a/gcc/ada/pprint.adb b/gcc/ada/pprint.adb
new file mode 100644
index 00000000000..b01ac2657c9
--- /dev/null
+++ b/gcc/ada/pprint.adb
@@ -0,0 +1,682 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- P P R I N T --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2008-2012, 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 Atree; use Atree;
+with Einfo; use Einfo;
+with Namet; use Namet;
+with Nlists; use Nlists;
+with Opt; use Opt;
+with Sinfo; use Sinfo;
+with Sinput; use Sinput;
+with Snames; use Snames;
+with Uintp; use Uintp;
+
+package body Pprint is
+
+ List_Name_Count : Integer := 0;
+ -- Counter used to prevent infinite recursion while computing name of
+ -- complex expressions.
+
+ ----------------------
+ -- Expression_Image --
+ ----------------------
+
+ function Expression_Image (Expr : Node_Id; Default : String)
+ return String is
+ Left : Node_Id := Original_Node (Expr);
+ Right : Node_Id := Original_Node (Expr);
+ From_Source : constant Boolean :=
+ Comes_From_Source (Expr) and then not Opt.Debug_Generated_Code;
+ Append_Paren : Boolean := False;
+
+ function Expr_Name
+ (Expr : Node_Id;
+ Take_Prefix : Boolean := True;
+ Expand_Type : Boolean := True) return String;
+ -- Return string corresponding to Expr. If no string can be extracted,
+ -- return "...". If Take_Prefix is True, go back to prefix when needed,
+ -- otherwise only consider the right-hand side of an expression. If
+ -- Expand_Type is True and Expr is a type, try to expand Expr (an
+ -- internally generated type) into a user understandable name.
+
+ Max_List : constant := 3;
+ -- Limit number of list elements to dump
+
+ Max_Expr_Elements : constant := 24;
+ -- Limit number of elements in an expression for use by Expr_Name
+
+ Num_Elements : Natural := 0;
+ -- Current number of elements processed by Expr_Name
+
+ function List_Name
+ (List : Node_Id;
+ Add_Space : Boolean := True;
+ Add_Paren : Boolean := True) return String;
+ -- Return a string corresponding to List
+
+ function List_Name
+ (List : Node_Id;
+ Add_Space : Boolean := True;
+ Add_Paren : Boolean := True) return String
+ is
+ function Internal_List_Name
+ (List : Node_Id;
+ First : Boolean := True;
+ Add_Space : Boolean := True;
+ Add_Paren : Boolean := True;
+ Num : Natural := 1) return String;
+
+ ------------------------
+ -- Internal_List_Name --
+ ------------------------
+
+ function Internal_List_Name
+ (List : Node_Id;
+ First : Boolean := True;
+ Add_Space : Boolean := True;
+ Add_Paren : Boolean := True;
+ Num : Natural := 1) return String
+ is
+ function Prepend (S : String) return String;
+
+ -------------
+ -- Prepend --
+ -------------
+
+ function Prepend (S : String) return String is
+ begin
+ if Add_Space then
+ if Add_Paren then
+ return " (" & S;
+ else
+ return ' ' & S;
+ end if;
+ elsif Add_Paren then
+ return '(' & S;
+ else
+ return S;
+ end if;
+ end Prepend;
+
+ -- Start of processing for Internal_List_Name
+
+ begin
+ if not Present (List) then
+ if First or else not Add_Paren then
+ return "";
+ else
+ return ")";
+ end if;
+ elsif Num > Max_List then
+ if Add_Paren then
+ return ", ...)";
+ else
+ return ", ...";
+ end if;
+ end if;
+
+ if First then
+ return Prepend
+ (Expr_Name (List)
+ & Internal_List_Name (Next (List),
+ First => False,
+ Add_Paren => Add_Paren,
+ Num => Num + 1));
+ else
+ return ", " & Expr_Name (List) &
+ Internal_List_Name
+ (Next (List),
+ First => False,
+ Add_Paren => Add_Paren,
+ Num => Num + 1);
+ end if;
+ end Internal_List_Name;
+
+ -- Start of processing for List_Name
+
+ begin
+ -- Prevent infinite recursion by limiting depth to 3
+
+ if List_Name_Count > 3 then
+ return "...";
+ end if;
+
+ List_Name_Count := List_Name_Count + 1;
+ declare
+ Result : constant String :=
+ Internal_List_Name
+ (List, Add_Space => Add_Space, Add_Paren => Add_Paren);
+ begin
+ List_Name_Count := List_Name_Count - 1;
+ return Result;
+ end;
+ end List_Name;
+
+ ---------------
+ -- Expr_Name --
+ ---------------
+
+ function Expr_Name
+ (Expr : Node_Id;
+ Take_Prefix : Boolean := True;
+ Expand_Type : Boolean := True) return String
+ is
+ begin
+ Num_Elements := Num_Elements + 1;
+
+ if Num_Elements > Max_Expr_Elements then
+ return "...";
+ end if;
+
+ case Nkind (Expr) is
+ when N_Defining_Identifier | N_Identifier =>
+ return Ident_Image (Expr, Expression_Image.Expr, Expand_Type);
+
+ when N_Character_Literal =>
+ declare
+ Char : constant Int :=
+ UI_To_Int (Char_Literal_Value (Expr));
+ begin
+ if Char in 32 .. 127 then
+ return "'" & Character'Val (Char) & "'";
+ else
+ UI_Image (Char_Literal_Value (Expr));
+ return "'\" & UI_Image_Buffer (1 .. UI_Image_Length)
+ & "'";
+ end if;
+ end;
+
+ when N_Integer_Literal =>
+ UI_Image (Intval (Expr));
+ return UI_Image_Buffer (1 .. UI_Image_Length);
+
+ when N_Real_Literal =>
+ return Real_Image (Realval (Expr));
+
+ when N_String_Literal =>
+ return String_Image (Strval (Expr));
+
+ when N_Allocator =>
+ return "new " & Expr_Name (Expression (Expr));
+
+ when N_Aggregate =>
+ if Present (Sinfo.Expressions (Expr)) then
+ return List_Name
+ (First (Sinfo.Expressions (Expr)), Add_Space => False);
+
+ elsif Null_Record_Present (Expr) then
+ return ("(null record)");
+
+ else
+ return List_Name
+ (First (Component_Associations (Expr)),
+ Add_Space => False, Add_Paren => False);
+ end if;
+
+ when N_Extension_Aggregate =>
+ return "(" & Expr_Name (Ancestor_Part (Expr)) &
+ " with " &
+ List_Name (First (Sinfo.Expressions (Expr)),
+ Add_Space => False, Add_Paren => False) &
+ ")";
+
+ when N_Attribute_Reference =>
+ if Take_Prefix then
+ declare
+ Str : constant String := Expr_Name (Prefix (Expr))
+ & "'" & Get_Name_String (Attribute_Name (Expr));
+ Id : constant Attribute_Id :=
+ Get_Attribute_Id (Attribute_Name (Expr));
+ Ranges : List_Id;
+ N : Node_Id;
+
+ begin
+ if (Id = Attribute_First or else Id = Attribute_Last)
+ and then Str (Str'First) = '$'
+ then
+ N := Associated_Node_For_Itype (Etype (Prefix (Expr)));
+
+ if Present (N) then
+ if Nkind (N) = N_Full_Type_Declaration then
+ N := Type_Definition (N);
+ end if;
+
+ if Nkind (N) = N_Subtype_Declaration then
+ Ranges := Constraints (Constraint
+ (Subtype_Indication (N)));
+
+ if List_Length (Ranges) = 1
+ and then Nkind_In
+ (First (Ranges),
+ N_Range,
+ N_Real_Range_Specification,
+ N_Signed_Integer_Type_Definition)
+ then
+ if Id = Attribute_First then
+ return Expression_Image
+ (Low_Bound (First (Ranges)), Str);
+ else
+ return Expression_Image
+ (High_Bound (First (Ranges)), Str);
+ end if;
+ end if;
+ end if;
+ end if;
+ end if;
+
+ return Str;
+ end;
+ else
+ return "'" & Get_Name_String (Attribute_Name (Expr));
+ end if;
+
+ when N_Explicit_Dereference =>
+ if Take_Prefix then
+ return Expr_Name (Prefix (Expr)) & ".all";
+ else
+ return ".all";
+ end if;
+
+ when N_Expanded_Name | N_Selected_Component =>
+ if Take_Prefix then
+ return Expr_Name (Prefix (Expr))
+ & "." & Expr_Name (Selector_Name (Expr));
+ else
+ return "." & Expr_Name (Selector_Name (Expr));
+ end if;
+
+ when N_Component_Association =>
+ return "("
+ & List_Name (First (Choices (Expr)),
+ Add_Space => False, Add_Paren => False)
+ & " => " & Expr_Name (Expression (Expr)) & ")";
+
+ when N_If_Expression =>
+ declare
+ N : constant Node_Id := First (Sinfo.Expressions (Expr));
+ begin
+ return "if " & Expr_Name (N) & " then " &
+ Expr_Name (Next (N)) & " else " &
+ Expr_Name (Next (Next (N)));
+ end;
+
+ when N_Qualified_Expression =>
+ declare
+ Mark : constant String :=
+ Expr_Name (Subtype_Mark (Expr), Expand_Type => False);
+ Str : constant String := Expr_Name (Expression (Expr));
+ begin
+ if Str (Str'First) = '(' and then Str (Str'Last) = ')' then
+ return Mark & "'" & Str;
+ else
+ return Mark & "'(" & Str & ")";
+ end if;
+ end;
+
+ when N_Unchecked_Expression | N_Expression_With_Actions =>
+ return Expr_Name (Expression (Expr));
+
+ when N_Raise_Constraint_Error =>
+ if Present (Condition (Expr)) then
+ return "[constraint_error when " &
+ Expr_Name (Condition (Expr)) & "]";
+ else
+ return "[constraint_error]";
+ end if;
+
+ when N_Raise_Program_Error =>
+ if Present (Condition (Expr)) then
+ return "[program_error when " &
+ Expr_Name (Condition (Expr)) & "]";
+ else
+ return "[program_error]";
+ end if;
+
+ when N_Range =>
+ return Expr_Name (Low_Bound (Expr)) & ".." &
+ Expr_Name (High_Bound (Expr));
+
+ when N_Slice =>
+ return Expr_Name (Prefix (Expr)) & " (" &
+ Expr_Name (Discrete_Range (Expr)) & ")";
+
+ when N_And_Then =>
+ return Expr_Name (Left_Opnd (Expr)) & " and then " &
+ Expr_Name (Right_Opnd (Expr));
+
+ when N_In =>
+ return Expr_Name (Left_Opnd (Expr)) & " in " &
+ Expr_Name (Right_Opnd (Expr));
+
+ when N_Not_In =>
+ return Expr_Name (Left_Opnd (Expr)) & " not in " &
+ Expr_Name (Right_Opnd (Expr));
+
+ when N_Or_Else =>
+ return Expr_Name (Left_Opnd (Expr)) & " or else " &
+ Expr_Name (Right_Opnd (Expr));
+
+ when N_Op_And =>
+ return Expr_Name (Left_Opnd (Expr)) & " and " &
+ Expr_Name (Right_Opnd (Expr));
+
+ when N_Op_Or =>
+ return Expr_Name (Left_Opnd (Expr)) & " or " &
+ Expr_Name (Right_Opnd (Expr));
+
+ when N_Op_Xor =>
+ return Expr_Name (Left_Opnd (Expr)) & " xor " &
+ Expr_Name (Right_Opnd (Expr));
+
+ when N_Op_Eq =>
+ return Expr_Name (Left_Opnd (Expr)) & " = " &
+ Expr_Name (Right_Opnd (Expr));
+
+ when N_Op_Ne =>
+ return Expr_Name (Left_Opnd (Expr)) & " /= " &
+ Expr_Name (Right_Opnd (Expr));
+
+ when N_Op_Lt =>
+ return Expr_Name (Left_Opnd (Expr)) & " < " &
+ Expr_Name (Right_Opnd (Expr));
+
+ when N_Op_Le =>
+ return Expr_Name (Left_Opnd (Expr)) & " <= " &
+ Expr_Name (Right_Opnd (Expr));
+
+ when N_Op_Gt =>
+ return Expr_Name (Left_Opnd (Expr)) & " > " &
+ Expr_Name (Right_Opnd (Expr));
+
+ when N_Op_Ge =>
+ return Expr_Name (Left_Opnd (Expr)) & " >= " &
+ Expr_Name (Right_Opnd (Expr));
+
+ when N_Op_Add =>
+ return Expr_Name (Left_Opnd (Expr)) & " + " &
+ Expr_Name (Right_Opnd (Expr));
+
+ when N_Op_Subtract =>
+ return Expr_Name (Left_Opnd (Expr)) & " - " &
+ Expr_Name (Right_Opnd (Expr));
+
+ when N_Op_Multiply =>
+ return Expr_Name (Left_Opnd (Expr)) & " * " &
+ Expr_Name (Right_Opnd (Expr));
+
+ when N_Op_Divide =>
+ return Expr_Name (Left_Opnd (Expr)) & " / " &
+ Expr_Name (Right_Opnd (Expr));
+
+ when N_Op_Mod =>
+ return Expr_Name (Left_Opnd (Expr)) & " mod " &
+ Expr_Name (Right_Opnd (Expr));
+
+ when N_Op_Rem =>
+ return Expr_Name (Left_Opnd (Expr)) & " rem " &
+ Expr_Name (Right_Opnd (Expr));
+
+ when N_Op_Expon =>
+ return Expr_Name (Left_Opnd (Expr)) & " ** " &
+ Expr_Name (Right_Opnd (Expr));
+
+ when N_Op_Shift_Left =>
+ return Expr_Name (Left_Opnd (Expr)) & " << " &
+ Expr_Name (Right_Opnd (Expr));
+
+ when N_Op_Shift_Right | N_Op_Shift_Right_Arithmetic =>
+ return Expr_Name (Left_Opnd (Expr)) & " >> " &
+ Expr_Name (Right_Opnd (Expr));
+
+ when N_Op_Concat =>
+ return Expr_Name (Left_Opnd (Expr)) & " & " &
+ Expr_Name (Right_Opnd (Expr));
+
+ when N_Op_Plus =>
+ return "+" & Expr_Name (Right_Opnd (Expr));
+
+ when N_Op_Minus =>
+ return "-" & Expr_Name (Right_Opnd (Expr));
+
+ when N_Op_Abs =>
+ return "abs " & Expr_Name (Right_Opnd (Expr));
+
+ when N_Op_Not =>
+ return "not (" & Expr_Name (Right_Opnd (Expr)) & ")";
+
+ when N_Parameter_Association =>
+ return Expr_Name (Explicit_Actual_Parameter (Expr));
+
+ when N_Type_Conversion | N_Unchecked_Type_Conversion =>
+
+ -- Most conversions are not very interesting (used inside
+ -- expanded checks to convert to larger ranges), so skip them.
+
+ return Expr_Name (Expression (Expr));
+
+ when N_Indexed_Component =>
+ if Take_Prefix then
+ return Expr_Name (Prefix (Expr)) &
+ List_Name (First (Sinfo.Expressions (Expr)));
+ else
+ return List_Name (First (Sinfo.Expressions (Expr)));
+ end if;
+
+ when N_Function_Call =>
+
+ -- If Default = "", it means we're expanding the name of
+ -- a gnat temporary (and not really a function call), so add
+ -- parentheses around function call to mark it specially.
+
+ if Default = "" then
+ return '(' & Expr_Name (Name (Expr)) &
+ List_Name (First (Sinfo.Parameter_Associations (Expr))) &
+ ')';
+ else
+ return Expr_Name (Name (Expr)) &
+ List_Name (First (Sinfo.Parameter_Associations (Expr)));
+ end if;
+
+ when N_Null =>
+ return "null";
+
+ when N_Others_Choice =>
+ return "others";
+
+ when others =>
+ return "...";
+ end case;
+ end Expr_Name;
+
+ -- Start of processing for Expression_Name
+
+ begin
+ if not From_Source then
+ declare
+ S : constant String := Expr_Name (Expr);
+ begin
+ if S = "..." then
+ return Default;
+ else
+ return S;
+ end if;
+ end;
+ end if;
+
+ -- Compute left (start) and right (end) slocs for the expression
+ -- Consider using Sinput.Sloc_Range instead, except that it does not
+ -- work properly currently???
+
+ loop
+ case Nkind (Left) is
+ when N_Binary_Op | N_Membership_Test |
+ N_And_Then | N_Or_Else =>
+ Left := Original_Node (Left_Opnd (Left));
+
+ when N_Attribute_Reference | N_Expanded_Name |
+ N_Explicit_Dereference | N_Indexed_Component |
+ N_Reference | N_Selected_Component |
+ N_Slice =>
+ Left := Original_Node (Prefix (Left));
+
+ when N_Designator | N_Defining_Program_Unit_Name |
+ N_Function_Call =>
+ Left := Original_Node (Name (Left));
+
+ when N_Range =>
+ Left := Original_Node (Low_Bound (Left));
+
+ when N_Type_Conversion =>
+ Left := Original_Node (Subtype_Mark (Left));
+
+ -- For any other item, quit loop
+
+ when others =>
+ exit;
+ end case;
+ end loop;
+
+ loop
+ case Nkind (Right) is
+ when N_Op | N_Membership_Test |
+ N_And_Then | N_Or_Else =>
+ Right := Original_Node (Right_Opnd (Right));
+
+ when N_Selected_Component | N_Expanded_Name =>
+ Right := Original_Node (Selector_Name (Right));
+
+ when N_Designator =>
+ Right := Original_Node (Identifier (Right));
+
+ when N_Defining_Program_Unit_Name =>
+ Right := Original_Node (Defining_Identifier (Right));
+
+ when N_Range =>
+ Right := Original_Node (High_Bound (Right));
+
+ when N_Parameter_Association =>
+ Right := Original_Node (Explicit_Actual_Parameter (Right));
+
+ when N_Indexed_Component =>
+ Right := Original_Node (Last (Sinfo.Expressions (Right)));
+ Append_Paren := True;
+
+ when N_Function_Call =>
+ if Present (Sinfo.Parameter_Associations (Right)) then
+ Right :=
+ Original_Node
+ (Last (Sinfo.Parameter_Associations (Right)));
+ Append_Paren := True;
+
+ -- Quit loop if no named associations
+
+ else
+ exit;
+ end if;
+
+ -- For all other items, quit the loop
+
+ when others =>
+ exit;
+ end case;
+ end loop;
+
+ declare
+ Scn : Source_Ptr := Original_Location (Sloc (Left));
+ Src : constant Source_Buffer_Ptr :=
+ Source_Text (Get_Source_File_Index (Scn));
+ End_Sloc : constant Source_Ptr :=
+ Original_Location (Sloc (Right));
+
+ begin
+ if Scn > End_Sloc then
+ return Default;
+ end if;
+
+ declare
+ Buffer : String (1 .. Natural (End_Sloc - Scn));
+ Skipping_Comment : Boolean := False;
+ Underscore : Boolean := False;
+ Index : Natural := 0;
+
+ begin
+ if Right /= Expr then
+ while Scn < End_Sloc loop
+ case Src (Scn) is
+ when ' ' | ASCII.HT =>
+ if not Skipping_Comment and then not Underscore then
+ Underscore := True;
+ Index := Index + 1;
+ Buffer (Index) := ' ';
+ end if;
+
+ -- CR/LF/FF is the end of any comment
+
+ when ASCII.LF | ASCII.CR | ASCII.FF =>
+ Skipping_Comment := False;
+
+ when others =>
+ Underscore := False;
+
+ if not Skipping_Comment then
+
+ -- Ignore comment
+
+ if Src (Scn) = '-' and then Src (Scn + 1) = '-' then
+ Skipping_Comment := True;
+
+ else
+ Index := Index + 1;
+ Buffer (Index) := Src (Scn);
+ end if;
+ end if;
+ end case;
+
+ Scn := Scn + 1;
+ end loop;
+ end if;
+
+ if Index < 1 then
+ declare
+ S : constant String := Expr_Name (Right);
+ begin
+ if S = "..." then
+ return Default;
+ else
+ return S;
+ end if;
+ end;
+
+ elsif Append_Paren then
+ return Buffer (1 .. Index) & Expr_Name (Right, False) & ')';
+
+ else
+ return Buffer (1 .. Index) & Expr_Name (Right, False);
+ end if;
+ end;
+ end;
+ end Expression_Image;
+
+end Pprint;
diff --git a/gcc/ada/pprint.ads b/gcc/ada/pprint.ads
new file mode 100644
index 00000000000..8fc1036b1e4
--- /dev/null
+++ b/gcc/ada/pprint.ads
@@ -0,0 +1,60 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- P P R I N T --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2008-2012, 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 (pretty print) contains a routine for printing an expression
+-- given its node in the syntax tree. Contrarily to the Sprint package, this
+-- routine tries to obtain "pretty" output that can be used for e.g. error
+-- messages.
+
+with Types; use Types;
+with Urealp; use Urealp;
+
+package Pprint is
+
+ generic
+
+ -- ??? The generic parameters should be removed.
+
+ with function Real_Image (U : Ureal) return String;
+ with function String_Image (S : String_Id) return String;
+ with function Ident_Image (Expr : Node_Id;
+ Orig_Expr : Node_Id;
+ Expand_Type : Boolean)
+ return String;
+ -- Will be called for printing N_Identifier and N_Defining_Identifier
+ -- nodes
+ -- ??? Expand_Type argument should be removed
+
+ function Expression_Image (Expr : Node_Id;
+ Default : String)
+ return String;
+ -- Given a Node for an expression, return a String that is meaningful for
+ -- the programmer. If the expression comes from source, it is copied from
+ -- there.
+ -- Subexpressions outside of the maximum depth (3), the maximal number of
+ -- accepted nodes (24), and the maximal number of list elements (3), are
+ -- replaced by the default string.
+
+end Pprint;
diff --git a/gcc/ada/prj-makr.adb b/gcc/ada/prj-makr.adb
index 29fe7b48cb0..e2b1ad1d9fd 100644
--- a/gcc/ada/prj-makr.adb
+++ b/gcc/ada/prj-makr.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2012, 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- --
@@ -120,7 +120,12 @@ package body Prj.Makr is
Non_Empty_Node : constant Project_Node_Id := 1;
-- Used for the With_Clause of the naming project
+ -- Turn off warnings for now around this redefinition of True and False,
+ -- but it really seems a bit horrible to do this redefinition ???
+
+ pragma Warnings (Off);
type Matched_Type is (True, False, Excluded);
+ pragma Warnings (On);
Naming_File_Suffix : constant String := "_naming";
Source_List_File_Suffix : constant String := "_source_list.txt";
diff --git a/gcc/ada/prj.ads b/gcc/ada/prj.ads
index b0d76661b06..f3ca31bdbf9 100644
--- a/gcc/ada/prj.ads
+++ b/gcc/ada/prj.ads
@@ -68,14 +68,21 @@ package Prj is
type Yes_No_Unknown is (Yes, No, Unknown);
-- Tri-state to decide if -lgnarl is needed when linking
+ pragma Warnings (Off);
type Project_Qualifier is
(Unspecified,
+
+ -- The following clash with Standard is OK, and justified by the context
+ -- which really wants to use the same set of qualifiers.
+
Standard,
+
Library,
Configuration,
Dry,
Aggregate,
Aggregate_Library);
+ pragma Warnings (On);
-- Qualifiers that can prefix the reserved word "project" in a project
-- file:
-- Standard: standard project ...
@@ -1188,7 +1195,17 @@ package Prj is
-- The following record describes a project file representation
- type Standalone is (No, Standard, Encapsulated);
+ pragma Warnings (Off);
+ type Standalone is
+ (No,
+
+ -- The following clash with Standard is OK, and justified by the context
+ -- which really wants to use the same set of qualifiers.
+
+ Standard,
+
+ Encapsulated);
+ pragma Warnings (On);
type Project_Data (Qualifier : Project_Qualifier := Unspecified) is record
diff --git a/gcc/ada/projects.texi b/gcc/ada/projects.texi
index fafb1d125de..ed42094df07 100644
--- a/gcc/ada/projects.texi
+++ b/gcc/ada/projects.texi
@@ -286,9 +286,14 @@ There are several ways of defining source directories:
It is often desirable to remove, from the source directories, directory
subtrees rooted at some subdirectories. An example is the subdirectories
created by a Version Control System such as Subversion that creates directory
- subtrees .svn/**. To do that, attribute @b{Ignore_Source_Sub_Dirs} can be
- used. It specifies the list of simple file names for the root of these
- undesirable directory subtrees.
+ subtrees rooted at subdirectories ".svn". To do that, attribute
+ @b{Ignore_Source_Sub_Dirs} can be used. It specifies the list of simple
+ file names for the roots of these undesirable directory subtrees.
+
+@smallexample
+ @b{for} Source_Dirs @b{use} ("./**");
+ @b{for} Ignore_Source_Sub_Dirs @b{use} (".svn");
+@end smallexample
@end itemize
diff --git a/gcc/ada/rtsfind.ads b/gcc/ada/rtsfind.ads
index ee9919a5fd4..5f9c9934ca4 100644
--- a/gcc/ada/rtsfind.ads
+++ b/gcc/ada/rtsfind.ads
@@ -1502,6 +1502,9 @@ package Rtsfind is
RE_Unspecified_Task_Info, -- System.Task_Info
RE_Task_Procedure_Access, -- System.Tasking
+ RE_Task_Entry_Names_Array, -- System.Tasking
+ RO_ST_Number_Of_Entries, -- System.Tasking
+ RO_ST_Set_Entry_Names, -- System.Tasking
RO_ST_Task_Id, -- System.Tasking
RO_ST_Null_Task, -- System.Tasking
@@ -1528,6 +1531,7 @@ package Rtsfind is
RE_Simple_Mode, -- System.Tasking
RE_Terminate_Mode, -- System.Tasking
RE_Delay_Mode, -- System.Tasking
+ RE_Entry_Index, -- System.Tasking
RE_Task_Entry_Index, -- System.Tasking
RE_Self, -- System.Tasking
@@ -1687,14 +1691,16 @@ package Rtsfind is
RE_Dispatching_Domain, -- Dispatching_Domains
RE_Protected_Entry_Body_Array, -- Tasking.Protected_Objects.Entries
+ RE_Protected_Entry_Names_Array, -- Tasking.Protected_Objects.Entries
RE_Protection_Entries, -- Tasking.Protected_Objects.Entries
RE_Protection_Entries_Access, -- Tasking.Protected_Objects.Entries
RE_Initialize_Protection_Entries, -- Tasking.Protected_Objects.Entries
RE_Lock_Entries, -- Tasking.Protected_Objects.Entries
+ RE_Unlock_Entries, -- Tasking.Protected_Objects.Entries
RO_PE_Get_Ceiling, -- Tasking.Protected_Objects.Entries
+ RO_PE_Number_Of_Entries, -- Tasking.Protected_Objects.Entries
RO_PE_Set_Ceiling, -- Tasking.Protected_Objects.Entries
- RO_PE_Set_Entry_Name, -- Tasking.Protected_Objects.Entries
- RE_Unlock_Entries, -- Tasking.Protected_Objects.Entries
+ RO_PE_Set_Entry_Names, -- Tasking.Protected_Objects.Entries
RE_Communication_Block, -- Protected_Objects.Operations
RE_Protected_Entry_Call, -- Protected_Objects.Operations
@@ -1756,7 +1762,6 @@ package Rtsfind is
RE_Timed_Task_Entry_Call, -- System.Tasking.Rendezvous
RE_Timed_Selective_Wait, -- System.Tasking.Rendezvous
- RE_Activate_Restricted_Tasks, -- System.Tasking.Restricted.Stages
RE_Complete_Restricted_Activation, -- System.Tasking.Restricted.Stages
RE_Create_Restricted_Task, -- System.Tasking.Restricted.Stages
RE_Complete_Restricted_Task, -- System.Tasking.Restricted.Stages
@@ -1770,7 +1775,6 @@ package Rtsfind is
RE_Free_Task, -- System.Tasking.Stages
RE_Expunge_Unactivated_Tasks, -- System.Tasking.Stages
RE_Move_Activation_Chain, -- System_Tasking_Stages
- RO_TS_Set_Entry_Name, -- System.Tasking.Stages
RE_Terminated); -- System.Tasking.Stages
-- The following declarations build a table that is indexed by the RTE
@@ -2750,6 +2754,9 @@ package Rtsfind is
RE_Unspecified_Task_Info => System_Task_Info,
RE_Task_Procedure_Access => System_Tasking,
+ RE_Task_Entry_Names_Array => System_Tasking,
+ RO_ST_Number_Of_Entries => System_Tasking,
+ RO_ST_Set_Entry_Names => System_Tasking,
RO_ST_Task_Id => System_Tasking,
RO_ST_Null_Task => System_Tasking,
@@ -2776,6 +2783,7 @@ package Rtsfind is
RE_Simple_Mode => System_Tasking,
RE_Terminate_Mode => System_Tasking,
RE_Delay_Mode => System_Tasking,
+ RE_Entry_Index => System_Tasking,
RE_Task_Entry_Index => System_Tasking,
RE_Self => System_Tasking,
@@ -2938,6 +2946,8 @@ package Rtsfind is
RE_Protected_Entry_Body_Array =>
System_Tasking_Protected_Objects_Entries,
+ RE_Protected_Entry_Names_Array =>
+ System_Tasking_Protected_Objects_Entries,
RE_Protection_Entries =>
System_Tasking_Protected_Objects_Entries,
RE_Protection_Entries_Access =>
@@ -2946,13 +2956,15 @@ package Rtsfind is
System_Tasking_Protected_Objects_Entries,
RE_Lock_Entries =>
System_Tasking_Protected_Objects_Entries,
+ RE_Unlock_Entries =>
+ System_Tasking_Protected_Objects_Entries,
RO_PE_Get_Ceiling =>
System_Tasking_Protected_Objects_Entries,
- RO_PE_Set_Ceiling =>
+ RO_PE_Number_Of_Entries =>
System_Tasking_Protected_Objects_Entries,
- RO_PE_Set_Entry_Name =>
+ RO_PE_Set_Ceiling =>
System_Tasking_Protected_Objects_Entries,
- RE_Unlock_Entries =>
+ RO_PE_Set_Entry_Names =>
System_Tasking_Protected_Objects_Entries,
RE_Communication_Block =>
@@ -3042,7 +3054,6 @@ package Rtsfind is
RE_Timed_Task_Entry_Call => System_Tasking_Rendezvous,
RE_Timed_Selective_Wait => System_Tasking_Rendezvous,
- RE_Activate_Restricted_Tasks => System_Tasking_Restricted_Stages,
RE_Complete_Restricted_Activation => System_Tasking_Restricted_Stages,
RE_Create_Restricted_Task => System_Tasking_Restricted_Stages,
RE_Complete_Restricted_Task => System_Tasking_Restricted_Stages,
@@ -3056,7 +3067,6 @@ package Rtsfind is
RE_Free_Task => System_Tasking_Stages,
RE_Expunge_Unactivated_Tasks => System_Tasking_Stages,
RE_Move_Activation_Chain => System_Tasking_Stages,
- RO_TS_Set_Entry_Name => System_Tasking_Stages,
RE_Terminated => System_Tasking_Stages);
--------------------------------
diff --git a/gcc/ada/s-bignum.adb b/gcc/ada/s-bignum.adb
index b3af4796136..cb7a4f6c1be 100644
--- a/gcc/ada/s-bignum.adb
+++ b/gcc/ada/s-bignum.adb
@@ -233,14 +233,27 @@ package body System.Bignums is
pragma Import (Ada, BD);
-- Expose a writable view of discriminant BD.Len so that we can
- -- initialize it.
+ -- initialize it. We need to use the exact layout of the record
+ -- to ensure that the Length field has 24 bits as expected.
- BL : Length;
- for BL'Address use BD.Len'Address;
- pragma Import (Ada, BL);
+ type Bignum_Data_Header is record
+ Len : Length;
+ Neg : Boolean;
+ end record;
+
+ for Bignum_Data_Header use record
+ Len at 0 range 0 .. 23;
+ Neg at 3 range 0 .. 7;
+ end record;
+
+ BDH : Bignum_Data_Header;
+ for BDH'Address use BD'Address;
+ pragma Import (Ada, BDH);
+
+ pragma Assert (BDH.Len'Size = BD.Len'Size);
begin
- BL := Len;
+ BDH.Len := Len;
return B;
end;
end if;
@@ -728,8 +741,9 @@ package body System.Bignums is
-- The complex full multi-precision case. We will employ algorithm
-- D defined in the section "The Classical Algorithms" (sec. 4.3.1)
- -- of Donald Knuth's "The Art of Computer Programming", Vol. 2. The
- -- terminology is adjusted for this section to match that reference.
+ -- of Donald Knuth's "The Art of Computer Programming", Vol. 2, 2nd
+ -- edition. The terminology is adjusted for this section to match that
+ -- reference.
-- We are dividing X.Len digits of X (called u here) by Y.Len digits
-- of Y (called v here), developing the quotient and remainder. The
@@ -775,12 +789,12 @@ package body System.Bignums is
v (J) := Y.D (J);
end loop;
- -- [Division of nonnegative integers]. Given nonnegative integers u
+ -- [Division of nonnegative integers.] Given nonnegative integers u
-- = (ul,u2..um+n) and v = (v1,v2..vn), where v1 /= 0 and n > 1, we
-- form the quotient u / v = (q0,ql..qm) and the remainder u mod v =
-- (r1,r2..rn).
- pragma Assert (v (1) /= 0);
+ pragma Assert (v1 /= 0);
pragma Assert (n > 1);
-- Dl. [Normalize.] Set d = b/(vl + 1). Then set (u0,u1,u2..um+n)
@@ -789,7 +803,7 @@ package body System.Bignums is
-- u0 at the left of u1; if d = 1 all we need to do in this step is
-- to set u0 = 0.
- d := b / DD (v1 + 1);
+ d := b / (DD (v1) + 1);
if d = 1 then
u0 := 0;
@@ -826,15 +840,15 @@ package body System.Bignums is
-- D2. [Initialize j.] Set j = 0. The loop on j, steps D2 through D7,
-- will be essentially a division of (uj, uj+1..uj+n) by (v1,v2..vn)
- -- to get a single quotient digit qj;
+ -- to get a single quotient digit qj.
j := 0;
-- Loop through digits
loop
- -- D3. [Calculate qhat] If uj = v1, set qhat to b-l; otherwise set
- -- qhat to (uj,uj+1)/v1.
+ -- D3. [Calculate qhat.] If uj = v1, set qhat to b-l; otherwise
+ -- set qhat to (uj,uj+1)/v1.
if u (j) = v1 then
qhat := -1;
diff --git a/gcc/ada/s-crtl.ads b/gcc/ada/s-crtl.ads
index c02d23023eb..a763d606b70 100644
--- a/gcc/ada/s-crtl.ads
+++ b/gcc/ada/s-crtl.ads
@@ -177,7 +177,7 @@ package System.CRTL is
size : size_t) return int;
pragma Import (C, setvbuf, "setvbuf");
- procedure tmpnam (string : chars);
+ procedure tmpnam (str : chars);
pragma Import (C, tmpnam, "tmpnam");
function tmpfile return FILEs;
diff --git a/gcc/ada/s-oscons-tmplt.c b/gcc/ada/s-oscons-tmplt.c
index 50a55e43d23..c386a1f0b0b 100644
--- a/gcc/ada/s-oscons-tmplt.c
+++ b/gcc/ada/s-oscons-tmplt.c
@@ -182,6 +182,9 @@ int counter = 0;
#define C(sname,type,value,comment)\
printf ("\n->C:$%d:" sname ":" #type ":" value ":" comment, __LINE__);
+#define SUB(sname)\
+ printf ("\n->SUB:$%d:" #sname ":" sname, __LINE__);
+
#define TXT(text) \
printf ("\n->TXT:$%d:" text, __LINE__);
@@ -209,6 +212,11 @@ int counter = 0;
: : "i" (__LINE__));
/* Typed constant */
+#define SUB(sname) \
+ asm volatile("\n->SUB:%0:" #sname ":" sname \
+ : : "i" (__LINE__));
+/* Subtype */
+
#define TXT(text) \
asm volatile("\n->TXT:%0:" text \
: : "i" (__LINE__));
@@ -217,6 +225,7 @@ int counter = 0;
#endif /* NATIVE */
#define CST(name,comment) C(#name,String,name,comment)
+/* String constant */
#define STR(x) STR1(x)
#define STR1(x) #x
@@ -370,15 +379,27 @@ CND(FNDELAY, "Nonblocking")
*/
+/* ioctl(2) requests are "int" in UNIX, but "unsigned long" on FreeBSD */
+
+#ifdef __FreeBSD__
+# define CNI CNU
+# define IOCTL_Req_T "unsigned"
+#else
+# define CNI CND
+# define IOCTL_Req_T "int"
+#endif
+
+SUB(IOCTL_Req_T)
+
#ifndef FIONBIO
# define FIONBIO -1
#endif
-CND(FIONBIO, "Set/clear non-blocking io")
+CNI(FIONBIO, "Set/clear non-blocking io")
#ifndef FIONREAD
# define FIONREAD -1
#endif
-CND(FIONREAD, "How many bytes to read")
+CNI(FIONREAD, "How many bytes to read")
/*
@@ -1318,18 +1339,19 @@ CND(SIZEOF_struct_servent, "struct servent");
#define SIZEOF_sigset (sizeof (sigset_t))
CND(SIZEOF_sigset, "sigset");
#endif
+
/*
-- Fields of struct msghdr
*/
#if defined (__sun__) || defined (__hpux__)
-# define msg_iovlen_t "int"
+# define Msg_Iovlen_T "int"
#else
-# define msg_iovlen_t "size_t"
+# define Msg_Iovlen_T "size_t"
#endif
-TXT(" subtype Msg_Iovlen_T is Interfaces.C." msg_iovlen_t ";")
+SUB(Msg_Iovlen_T)
/*
@@ -1399,7 +1421,7 @@ CND(CLOCK_THREAD_CPUTIME_ID, "Thread CPU clock")
/* There's no clock_gettime or clock_id's on Darwin, generate a dummy value */
# define CLOCK_RT_Ada "-1"
-#elif defined(FreeBSD) || defined(_AIX)
+#elif defined(__FreeBSD__) || defined(_AIX)
/** On these platforms use system provided monotonic clock instead of
** the default CLOCK_REALTIME. We then need to set up cond var attributes
** appropriately (see thread.c).
diff --git a/gcc/ada/s-stratt-xdr.adb b/gcc/ada/s-stratt-xdr.adb
index 86e190a98b5..d63c2514779 100644
--- a/gcc/ada/s-stratt-xdr.adb
+++ b/gcc/ada/s-stratt-xdr.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1996-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1996-2012, Free Software Foundation, Inc. --
-- --
-- GARLIC 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- --
@@ -374,12 +374,12 @@ package body System.Stream_Attributes is
F_Bytes : SEO renames Fields (I).F_Bytes;
F_Size : Integer renames Fields (I).F_Size;
- Positive : Boolean;
- Exponent : Long_Unsigned;
- Fraction : Long_Unsigned;
- Result : Float;
- S : SEA (1 .. F_L);
- L : SEO;
+ Is_Positive : Boolean;
+ Exponent : Long_Unsigned;
+ Fraction : Long_Unsigned;
+ Result : Float;
+ S : SEA (1 .. F_L);
+ L : SEO;
begin
Ada.Streams.Read (Stream.all, S, L);
@@ -397,10 +397,10 @@ package body System.Stream_Attributes is
Result := Float'Scaling (Float (Fraction), -F_Size);
if BS <= S (1) then
- Positive := False;
+ Is_Positive := False;
Exponent := Long_Unsigned (S (1) - BS);
else
- Positive := True;
+ Is_Positive := True;
Exponent := Long_Unsigned (S (1));
end if;
@@ -434,7 +434,7 @@ package body System.Stream_Attributes is
(1.0 + Result, Integer (Exponent) - E_Bias);
end if;
- if not Positive then
+ if not Is_Positive then
Result := -Result;
end if;
@@ -489,12 +489,12 @@ package body System.Stream_Attributes is
F_Bytes : SEO renames Fields (I).F_Bytes;
F_Size : Integer renames Fields (I).F_Size;
- Positive : Boolean;
- Exponent : Long_Unsigned;
- Fraction : Long_Long_Unsigned;
- Result : Long_Float;
- S : SEA (1 .. LF_L);
- L : SEO;
+ Is_Positive : Boolean;
+ Exponent : Long_Unsigned;
+ Fraction : Long_Long_Unsigned;
+ Result : Long_Float;
+ S : SEA (1 .. LF_L);
+ L : SEO;
begin
Ada.Streams.Read (Stream.all, S, L);
@@ -513,10 +513,10 @@ package body System.Stream_Attributes is
Result := Long_Float'Scaling (Long_Float (Fraction), -F_Size);
if BS <= S (1) then
- Positive := False;
+ Is_Positive := False;
Exponent := Long_Unsigned (S (1) - BS);
else
- Positive := True;
+ Is_Positive := True;
Exponent := Long_Unsigned (S (1));
end if;
@@ -551,7 +551,7 @@ package body System.Stream_Attributes is
(1.0 + Result, Integer (Exponent) - E_Bias);
end if;
- if not Positive then
+ if not Is_Positive then
Result := -Result;
end if;
@@ -617,7 +617,7 @@ package body System.Stream_Attributes is
F_Bytes : SEO renames Fields (I).F_Bytes;
F_Size : Integer renames Fields (I).F_Size;
- Positive : Boolean;
+ Is_Positive : Boolean;
Exponent : Long_Unsigned;
Fraction_1 : Long_Long_Unsigned := 0;
Fraction_2 : Long_Long_Unsigned := 0;
@@ -648,10 +648,10 @@ package body System.Stream_Attributes is
Result := Long_Long_Float'Scaling (Result, HF - F_Size);
if BS <= S (1) then
- Positive := False;
+ Is_Positive := False;
Exponent := Long_Unsigned (S (1) - BS);
else
- Positive := True;
+ Is_Positive := True;
Exponent := Long_Unsigned (S (1));
end if;
@@ -686,7 +686,7 @@ package body System.Stream_Attributes is
(1.0 + Result, Integer (Exponent) - E_Bias);
end if;
- if not Positive then
+ if not Is_Positive then
Result := -Result;
end if;
@@ -827,12 +827,12 @@ package body System.Stream_Attributes is
F_Bytes : SEO renames Fields (I).F_Bytes;
F_Size : Integer renames Fields (I).F_Size;
- Exponent : Long_Unsigned;
- Fraction : Long_Unsigned;
- Positive : Boolean;
- Result : Short_Float;
- S : SEA (1 .. SF_L);
- L : SEO;
+ Exponent : Long_Unsigned;
+ Fraction : Long_Unsigned;
+ Is_Positive : Boolean;
+ Result : Short_Float;
+ S : SEA (1 .. SF_L);
+ L : SEO;
begin
Ada.Streams.Read (Stream.all, S, L);
@@ -850,10 +850,10 @@ package body System.Stream_Attributes is
Result := Short_Float'Scaling (Short_Float (Fraction), -F_Size);
if BS <= S (1) then
- Positive := False;
+ Is_Positive := False;
Exponent := Long_Unsigned (S (1) - BS);
else
- Positive := True;
+ Is_Positive := True;
Exponent := Long_Unsigned (S (1));
end if;
@@ -887,7 +887,7 @@ package body System.Stream_Attributes is
(1.0 + Result, Integer (Exponent) - E_Bias);
end if;
- if not Positive then
+ if not Is_Positive then
Result := -Result;
end if;
@@ -1179,12 +1179,12 @@ package body System.Stream_Attributes is
F_Size : Integer renames Fields (I).F_Size;
F_Mask : SE renames Fields (I).F_Mask;
- Exponent : Long_Unsigned;
- Fraction : Long_Unsigned;
- Positive : Boolean;
- E : Integer;
- F : Float;
- S : SEA (1 .. F_L) := (others => 0);
+ Exponent : Long_Unsigned;
+ Fraction : Long_Unsigned;
+ Is_Positive : Boolean;
+ E : Integer;
+ F : Float;
+ S : SEA (1 .. F_L) := (others => 0);
begin
if not Item'Valid then
@@ -1193,7 +1193,7 @@ package body System.Stream_Attributes is
-- Compute Sign
- Positive := (0.0 <= Item);
+ Is_Positive := (0.0 <= Item);
F := abs (Item);
-- Signed zero
@@ -1241,7 +1241,7 @@ package body System.Stream_Attributes is
-- Store Sign
- if not Positive then
+ if not Is_Positive then
S (1) := S (1) + BS;
end if;
@@ -1293,12 +1293,12 @@ package body System.Stream_Attributes is
F_Size : Integer renames Fields (I).F_Size;
F_Mask : SE renames Fields (I).F_Mask;
- Exponent : Long_Unsigned;
- Fraction : Long_Long_Unsigned;
- Positive : Boolean;
- E : Integer;
- F : Long_Float;
- S : SEA (1 .. LF_L) := (others => 0);
+ Exponent : Long_Unsigned;
+ Fraction : Long_Long_Unsigned;
+ Is_Positive : Boolean;
+ E : Integer;
+ F : Long_Float;
+ S : SEA (1 .. LF_L) := (others => 0);
begin
if not Item'Valid then
@@ -1307,7 +1307,7 @@ package body System.Stream_Attributes is
-- Compute Sign
- Positive := (0.0 <= Item);
+ Is_Positive := (0.0 <= Item);
F := abs (Item);
-- Signed zero
@@ -1355,7 +1355,7 @@ package body System.Stream_Attributes is
-- Store Sign
- if not Positive then
+ if not Is_Positive then
S (1) := S (1) + BS;
end if;
@@ -1421,13 +1421,13 @@ package body System.Stream_Attributes is
HFS : constant Integer := F_Size / 2;
- Exponent : Long_Unsigned;
- Fraction_1 : Long_Long_Unsigned;
- Fraction_2 : Long_Long_Unsigned;
- Positive : Boolean;
- E : Integer;
- F : Long_Long_Float := Item;
- S : SEA (1 .. LLF_L) := (others => 0);
+ Exponent : Long_Unsigned;
+ Fraction_1 : Long_Long_Unsigned;
+ Fraction_2 : Long_Long_Unsigned;
+ Is_Positive : Boolean;
+ E : Integer;
+ F : Long_Long_Float := Item;
+ S : SEA (1 .. LLF_L) := (others => 0);
begin
if not Item'Valid then
@@ -1436,7 +1436,8 @@ package body System.Stream_Attributes is
-- Compute Sign
- Positive := (0.0 <= Item);
+ Is_Positive := (0.0 <= Item);
+
if F < 0.0 then
F := -Item;
end if;
@@ -1495,7 +1496,7 @@ package body System.Stream_Attributes is
-- Store Sign
- if not Positive then
+ if not Is_Positive then
S (1) := S (1) + BS;
end if;
@@ -1639,12 +1640,12 @@ package body System.Stream_Attributes is
F_Size : Integer renames Fields (I).F_Size;
F_Mask : SE renames Fields (I).F_Mask;
- Exponent : Long_Unsigned;
- Fraction : Long_Unsigned;
- Positive : Boolean;
- E : Integer;
- F : Short_Float;
- S : SEA (1 .. SF_L) := (others => 0);
+ Exponent : Long_Unsigned;
+ Fraction : Long_Unsigned;
+ Is_Positive : Boolean;
+ E : Integer;
+ F : Short_Float;
+ S : SEA (1 .. SF_L) := (others => 0);
begin
if not Item'Valid then
@@ -1653,7 +1654,7 @@ package body System.Stream_Attributes is
-- Compute Sign
- Positive := (0.0 <= Item);
+ Is_Positive := (0.0 <= Item);
F := abs (Item);
-- Signed zero
@@ -1701,7 +1702,7 @@ package body System.Stream_Attributes is
-- Store Sign
- if not Positive then
+ if not Is_Positive then
S (1) := S (1) + BS;
end if;
diff --git a/gcc/ada/s-tarest.adb b/gcc/ada/s-tarest.adb
index 9643a181b5b..bba83ab76a9 100644
--- a/gcc/ada/s-tarest.adb
+++ b/gcc/ada/s-tarest.adb
@@ -70,6 +70,9 @@ package body System.Tasking.Restricted.Stages is
use Task_Primitives.Operations;
use Task_Info;
+ Tasks_Activation_Chain : Task_Id;
+ -- Chain of all the tasks to activate
+
Global_Task_Lock : aliased System.Task_Primitives.RTS_Lock;
-- This is a global lock; it is used to execute in mutual exclusion
-- from all other tasks. It is only used by Task_Lock and Task_Unlock.
@@ -298,9 +301,9 @@ package body System.Tasking.Restricted.Stages is
-- Restricted GNARLI --
-----------------------
- -------------------------------
- -- Activate_Restricted_Tasks --
- -------------------------------
+ --------------------
+ -- Activate_Tasks --
+ --------------------
-- Note that locks of activator and activated task are both locked here.
-- This is necessary because C.State and Self.Wait_Count have to be
@@ -308,9 +311,7 @@ package body System.Tasking.Restricted.Stages is
-- created before the activated task. That satisfies our
-- in-order-of-creation ATCB locking policy.
- procedure Activate_Restricted_Tasks
- (Chain_Access : Activation_Chain_Access)
- is
+ procedure Activate_Tasks is
Self_ID : constant Task_Id := STPO.Self;
C : Task_Id;
Activate_Prio : System.Any_Priority;
@@ -332,8 +333,7 @@ package body System.Tasking.Restricted.Stages is
-- Activate all the tasks in the chain. Creation of the thread of
-- control was deferred until activation. So create it now.
- C := Chain_Access.T_ID;
-
+ C := Tasks_Activation_Chain;
while C /= null loop
if C.Common.State /= Terminated then
pragma Assert (C.Common.State = Unactivated);
@@ -384,8 +384,8 @@ package body System.Tasking.Restricted.Stages is
-- Remove the tasks from the chain
- Chain_Access.T_ID := null;
- end Activate_Restricted_Tasks;
+ Tasks_Activation_Chain := null;
+ end Activate_Tasks;
------------------------------------
-- Complete_Restricted_Activation --
@@ -462,7 +462,6 @@ package body System.Tasking.Restricted.Stages is
State : Task_Procedure_Access;
Discriminants : System.Address;
Elaborated : Access_Boolean;
- Chain : in out Activation_Chain;
Task_Image : String;
Created_Task : Task_Id)
is
@@ -558,8 +557,8 @@ package body System.Tasking.Restricted.Stages is
-- may be used by the operation of Ada code within the task.
SSL.Create_TSD (Created_Task.Common.Compiler_Data);
- Created_Task.Common.Activation_Link := Chain.T_ID;
- Chain.T_ID := Created_Task;
+ Created_Task.Common.Activation_Link := Tasks_Activation_Chain;
+ Tasks_Activation_Chain := Created_Task;
end Create_Restricted_Task;
---------------------------
diff --git a/gcc/ada/s-tarest.ads b/gcc/ada/s-tarest.ads
index 7b853914bff..c8769754707 100644
--- a/gcc/ada/s-tarest.ads
+++ b/gcc/ada/s-tarest.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
-- --
-- GNARL 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,10 @@
-- The restricted GNARLI is also composed of System.Protected_Objects and
-- System.Protected_Objects.Single_Entry
+pragma Partition_Elaboration_Policy (Sequential);
+-- This package only implements the sequential elaboration policy. This pragma
+-- will enforce it (and detect conflicts with user specified policy).
+
with System.Task_Info;
with System.Parameters;
@@ -89,7 +93,7 @@ package System.Tasking.Restricted.Stages is
-- create_restricted_task (unspecified_priority, tZ,
-- unspecified_task_info, unspecified_cpu,
-- task_procedure_access!(tB'address), _init'address,
- -- tE'unchecked_access, _chain, _task_name, _init._task_id);
+ -- tE'unchecked_access, _task_name, _init._task_id);
-- return;
-- end tVIP;
@@ -120,8 +124,6 @@ package System.Tasking.Restricted.Stages is
-- t1S : constant String := "t1";
-- tIP (t1, 3, _chain, t1S, 1);
- -- activate_restricted_tasks (_chain'unchecked_access);
-
procedure Create_Restricted_Task
(Priority : Integer;
Stack_Address : System.Address;
@@ -131,7 +133,6 @@ package System.Tasking.Restricted.Stages is
State : Task_Procedure_Access;
Discriminants : System.Address;
Elaborated : Access_Boolean;
- Chain : in out Activation_Chain;
Task_Image : String;
Created_Task : Task_Id);
-- Compiler interface only. Do not call from within the RTS.
@@ -164,31 +165,22 @@ package System.Tasking.Restricted.Stages is
-- Elaborated is a pointer to a Boolean that must be set to true on exit
-- if the task could be successfully elaborated.
--
- -- Chain is a linked list of task that needs to be created. On exit,
- -- Created_Task.Activation_Link will be Chain.T_ID, and Chain.T_ID will be
- -- Created_Task (the created task will be linked at the front of Chain).
- --
-- Task_Image is a string created by the compiler that the run time can
-- store to ease the debugging and the Ada.Task_Identification facility.
--
-- Created_Task is the resulting task.
--
-- This procedure can raise Storage_Error if the task creation fails
-
- procedure Activate_Restricted_Tasks
- (Chain_Access : Activation_Chain_Access);
- -- Compiler interface only. Do not call from within the RTS.
- -- This must be called by the creator of a chain of one or more new tasks,
- -- to activate them. The chain is a linked list that up to this point is
- -- only known to the task that created them, though the individual tasks
- -- are already in the All_Tasks_List.
--
- -- The compiler builds the chain in LIFO order (as a stack). Another
- -- version of this procedure had code to reverse the chain, so as to
- -- activate the tasks in the order of declaration. This might be nice, but
- -- it is not needed if priority-based scheduling is supported, since all
- -- the activated tasks synchronize on the activators lock before they start
- -- activating and so they should start activating in priority order.
+ -- Contrary to Create_Task, there is no Chain parameter (for the activation
+ -- chain), as there is only one global activation chain, which is declared
+ -- in the body of this package.
+
+ procedure Activate_Tasks;
+ pragma Export (C, Activate_Tasks, "__gnat_activate_tasks");
+ -- Binder interface only. Do not call from within the RTS. This must be
+ -- called an the end of the elaboration to activate all tasks, in order
+ -- to implement the sequential elaboration policy.
procedure Complete_Restricted_Activation;
-- Compiler interface only. Do not call from within the RTS. This should be
@@ -217,7 +209,7 @@ package System.Tasking.Restricted.Stages is
-- restricted_terminated (t1._task_id)
procedure Finalize_Global_Tasks;
- -- This is needed to support the compiler interface; it will only be called
+ -- This is needed to support the compiler interface. It will only be called
-- by the Environment task in the binder generated file (by adafinal).
-- Instead, it will cause the Environment to block forever, since none of
-- the dependent tasks are expected to terminate
diff --git a/gcc/ada/s-taskin.adb b/gcc/ada/s-taskin.adb
index 519626cb9c4..5baf1287655 100644
--- a/gcc/ada/s-taskin.adb
+++ b/gcc/ada/s-taskin.adb
@@ -33,8 +33,6 @@ pragma Polling (Off);
-- Turn off polling, we do not want ATC polling to take place during tasking
-- operations. It causes infinite loops and other problems.
-with Ada.Unchecked_Deallocation;
-
with System.Task_Primitives.Operations;
with System.Storage_Elements;
@@ -42,19 +40,6 @@ package body System.Tasking is
package STPO renames System.Task_Primitives.Operations;
- ----------------------------
- -- Free_Entry_Names_Array --
- ----------------------------
-
- procedure Free_Entry_Names_Array (Obj : in out Entry_Names_Array) is
- procedure Free_String is new
- Ada.Unchecked_Deallocation (String, String_Access);
- begin
- for Index in Obj'Range loop
- Free_String (Obj (Index));
- end loop;
- end Free_Entry_Names_Array;
-
---------------------
-- Detect_Blocking --
---------------------
@@ -70,6 +55,15 @@ package body System.Tasking is
return GL_Detect_Blocking = 1;
end Detect_Blocking;
+ -----------------------
+ -- Number_Of_Entries --
+ -----------------------
+
+ function Number_Of_Entries (Self_Id : Task_Id) return Entry_Index is
+ begin
+ return Entry_Index (Self_Id.Entry_Num);
+ end Number_Of_Entries;
+
----------
-- Self --
----------
@@ -257,4 +251,16 @@ package body System.Tasking is
T.Entry_Calls (1).Self := T;
end Initialize;
+ ---------------------
+ -- Set_Entry_Names --
+ ---------------------
+
+ procedure Set_Entry_Names
+ (Self_Id : Task_Id;
+ Names : Task_Entry_Names_Access)
+ is
+ begin
+ Self_Id.Entry_Names := Names;
+ end Set_Entry_Names;
+
end System.Tasking;
diff --git a/gcc/ada/s-taskin.ads b/gcc/ada/s-taskin.ads
index d31313708f7..26cfabb8aee 100644
--- a/gcc/ada/s-taskin.ads
+++ b/gcc/ada/s-taskin.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
-- --
-- GNARL 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,13 +252,10 @@ package System.Tasking is
type String_Access is access all String;
- type Entry_Names_Array is
+ type Task_Entry_Names_Array is
array (Entry_Index range <>) of String_Access;
- type Entry_Names_Array_Access is access all Entry_Names_Array;
-
- procedure Free_Entry_Names_Array (Obj : in out Entry_Names_Array);
- -- Deallocate all string names contained in an entry names array
+ type Task_Entry_Names_Access is access all Task_Entry_Names_Array;
----------------------------------
-- Entry_Call_Record definition --
@@ -968,10 +965,13 @@ package System.Tasking is
-- associated with protected objects or task entries, and are protected
-- by the protected object lock or Acceptor.L, respectively.
- Entry_Names : Entry_Names_Array_Access := null;
+ Entry_Names : Task_Entry_Names_Access := null;
-- An array of string names which denotes entry [family member] names.
-- The structure is indexed by task entry index and contains Entry_Num
-- components.
+ --
+ -- Protection: The array is populated during task initialization, before
+ -- the task has been activated. No protection is required in this case.
New_Base_Priority : System.Any_Priority;
-- New value for Base_Priority (for dynamic priorities package)
@@ -1203,4 +1203,12 @@ private
-- registered for removal (Expunge_Unactivated_Tasks). The "limited" forces
-- Activation_Chain to be a by-reference type; see RM-6.2(4).
+ function Number_Of_Entries (Self_Id : Task_Id) return Entry_Index;
+ -- Given a task, return the number of entries it contains
+
+ procedure Set_Entry_Names
+ (Self_Id : Task_Id;
+ Names : Task_Entry_Names_Access);
+ -- Associate an array of strings denotinge entry [family] names with a task
+
end System.Tasking;
diff --git a/gcc/ada/s-tassta.adb b/gcc/ada/s-tassta.adb
index 08886c157bb..cf63a304546 100644
--- a/gcc/ada/s-tassta.adb
+++ b/gcc/ada/s-tassta.adb
@@ -33,6 +33,10 @@ pragma Polling (Off);
-- Turn off polling, we do not want ATC polling to take place during tasking
-- operations. It causes infinite loops and other problems.
+pragma Partition_Elaboration_Policy (Concurrent);
+-- This package only implements the concurrent elaboration policy. This pragma
+-- will enforce it (and detect conflicts with user specified policy).
+
with Ada.Exceptions;
with Ada.Unchecked_Deallocation;
@@ -87,9 +91,6 @@ package body System.Tasking.Stages is
procedure Free is new
Ada.Unchecked_Deallocation (Ada_Task_Control_Block, Task_Id);
- procedure Free_Entry_Names (T : Task_Id);
- -- Deallocate all string names associated with task entries
-
procedure Trace_Unhandled_Exception_In_Task (Self_Id : Task_Id);
-- This procedure outputs the task specific message for exception
-- tracing purposes.
@@ -483,8 +484,7 @@ package body System.Tasking.Stages is
Elaborated : Access_Boolean;
Chain : in out Activation_Chain;
Task_Image : String;
- Created_Task : out Task_Id;
- Build_Entry_Names : Boolean)
+ Created_Task : out Task_Id)
is
T, P : Task_Id;
Self_ID : constant Task_Id := STPO.Self;
@@ -702,14 +702,6 @@ package body System.Tasking.Stages is
Dispatching_Domain_Tasks (Base_CPU) + 1;
end if;
- -- Note: we should not call 'new' while holding locks since new may use
- -- locks (e.g. RTS_Lock under Windows) itself and cause a deadlock.
-
- if Build_Entry_Names then
- T.Entry_Names :=
- new Entry_Names_Array (1 .. Entry_Index (Num_Entries));
- end if;
-
-- Create TSD as early as possible in the creation of a task, since it
-- may be used by the operation of Ada code within the task.
@@ -938,26 +930,6 @@ package body System.Tasking.Stages is
end Finalize_Global_Tasks;
- ----------------------
- -- Free_Entry_Names --
- ----------------------
-
- procedure Free_Entry_Names (T : Task_Id) is
- Names : Entry_Names_Array_Access := T.Entry_Names;
-
- procedure Free_Entry_Names_Array_Access is new
- Ada.Unchecked_Deallocation
- (Entry_Names_Array, Entry_Names_Array_Access);
-
- begin
- if Names = null then
- return;
- end if;
-
- Free_Entry_Names_Array (Names.all);
- Free_Entry_Names_Array_Access (Names);
- end Free_Entry_Names;
-
---------------
-- Free_Task --
---------------
@@ -979,7 +951,6 @@ package body System.Tasking.Stages is
Initialization.Task_Unlock (Self_Id);
- Free_Entry_Names (T);
System.Task_Primitives.Operations.Finalize_TCB (T);
else
@@ -1037,23 +1008,6 @@ package body System.Tasking.Stages is
Initialization.Undefer_Abort (Self_ID);
end Move_Activation_Chain;
- -- Compiler interface only. Do not call from within the RTS
-
- --------------------
- -- Set_Entry_Name --
- --------------------
-
- procedure Set_Entry_Name
- (T : Task_Id;
- Pos : Task_Entry_Index;
- Val : String_Access)
- is
- begin
- pragma Assert (T.Entry_Names /= null);
-
- T.Entry_Names (Entry_Index (Pos)) := Val;
- end Set_Entry_Name;
-
------------------
-- Task_Wrapper --
------------------
@@ -2115,7 +2069,6 @@ package body System.Tasking.Stages is
Unlock_RTS;
end if;
- Free_Entry_Names (T);
System.Task_Primitives.Operations.Finalize_TCB (T);
end Vulnerable_Free_Task;
diff --git a/gcc/ada/s-tassta.ads b/gcc/ada/s-tassta.ads
index 9058d068a4a..e37fd59b665 100644
--- a/gcc/ada/s-tassta.ads
+++ b/gcc/ada/s-tassta.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
-- --
-- GNARL 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- --
@@ -180,8 +180,7 @@ package System.Tasking.Stages is
Elaborated : Access_Boolean;
Chain : in out Activation_Chain;
Task_Image : String;
- Created_Task : out Task_Id;
- Build_Entry_Names : Boolean);
+ Created_Task : out Task_Id);
-- Compiler interface only. Do not call from within the RTS.
-- This must be called to create a new task.
--
@@ -212,8 +211,6 @@ package System.Tasking.Stages is
-- run time can store to ease the debugging and the
-- Ada.Task_Identification facility.
-- Created_Task is the resulting task.
- -- Build_Entry_Names is a flag which controls the allocation of the data
- -- structure which stores all entry names.
--
-- This procedure can raise Storage_Error if the task creation failed.
@@ -285,13 +282,6 @@ package System.Tasking.Stages is
-- that doesn't happen, they will never be activated, and will become
-- terminated on leaving the return statement.
- procedure Set_Entry_Name
- (T : Task_Id;
- Pos : Task_Entry_Index;
- Val : String_Access);
- -- This is called by the compiler to map a string which denotes an entry
- -- name to a task entry index.
-
function Terminated (T : Task_Id) return Boolean;
-- This is called by the compiler to implement the 'Terminated attribute.
-- Though is not required to be so by the ARM, we choose to synchronize
diff --git a/gcc/ada/s-tpoben.adb b/gcc/ada/s-tpoben.adb
index 88527315e42..3249122b386 100644
--- a/gcc/ada/s-tpoben.adb
+++ b/gcc/ada/s-tpoben.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2012, Free Software Foundation, Inc. --
-- --
-- GNARL 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,8 +41,6 @@
-- Note: the compiler generates direct calls to this interface, via Rtsfind
-with Ada.Unchecked_Deallocation;
-
with System.Task_Primitives.Operations;
with System.Restrictions;
with System.Parameters;
@@ -58,13 +56,6 @@ package body System.Tasking.Protected_Objects.Entries is
use Parameters;
use Task_Primitives.Operations;
- -----------------------
- -- Local Subprograms --
- -----------------------
-
- procedure Free_Entry_Names (Object : Protection_Entries);
- -- Deallocate all string names associated with protected entries
-
----------------
-- Local Data --
----------------
@@ -141,8 +132,6 @@ package body System.Tasking.Protected_Objects.Entries is
end loop;
end loop;
- Free_Entry_Names (Object);
-
Object.Finalized := True;
if Single_Lock then
@@ -154,26 +143,6 @@ package body System.Tasking.Protected_Objects.Entries is
STPO.Finalize_Lock (Object.L'Unrestricted_Access);
end Finalize;
- ----------------------
- -- Free_Entry_Names --
- ----------------------
-
- procedure Free_Entry_Names (Object : Protection_Entries) is
- Names : Entry_Names_Array_Access := Object.Entry_Names;
-
- procedure Free_Entry_Names_Array_Access is new
- Ada.Unchecked_Deallocation
- (Entry_Names_Array, Entry_Names_Array_Access);
-
- begin
- if Names = null then
- return;
- end if;
-
- Free_Entry_Names_Array (Names.all);
- Free_Entry_Names_Array_Access (Names);
- end Free_Entry_Names;
-
-----------------
-- Get_Ceiling --
-----------------
@@ -202,12 +171,11 @@ package body System.Tasking.Protected_Objects.Entries is
-----------------------------------
procedure Initialize_Protection_Entries
- (Object : Protection_Entries_Access;
- Ceiling_Priority : Integer;
- Compiler_Info : System.Address;
- Entry_Bodies : Protected_Entry_Body_Access;
- Find_Body_Index : Find_Body_Index_Access;
- Build_Entry_Names : Boolean)
+ (Object : Protection_Entries_Access;
+ Ceiling_Priority : Integer;
+ Compiler_Info : System.Address;
+ Entry_Bodies : Protected_Entry_Body_Access;
+ Find_Body_Index : Find_Body_Index_Access)
is
Init_Priority : Integer := Ceiling_Priority;
Self_ID : constant Task_Id := STPO.Self;
@@ -250,11 +218,6 @@ package body System.Tasking.Protected_Objects.Entries is
Object.Entry_Queues (E).Head := null;
Object.Entry_Queues (E).Tail := null;
end loop;
-
- if Build_Entry_Names then
- Object.Entry_Names :=
- new Entry_Names_Array (1 .. Entry_Index (Object.Num_Entries));
- end if;
end Initialize_Protection_Entries;
------------------
@@ -391,6 +354,17 @@ package body System.Tasking.Protected_Objects.Entries is
end if;
end Lock_Read_Only_Entries;
+ -----------------------
+ -- Number_Of_Entries --
+ -----------------------
+
+ function Number_Of_Entries
+ (Object : Protection_Entries_Access) return Entry_Index
+ is
+ begin
+ return Entry_Index (Object.Num_Entries);
+ end Number_Of_Entries;
+
-----------------
-- Set_Ceiling --
-----------------
@@ -402,20 +376,17 @@ package body System.Tasking.Protected_Objects.Entries is
Object.New_Ceiling := Prio;
end Set_Ceiling;
- --------------------
- -- Set_Entry_Name --
- --------------------
+ ---------------------
+ -- Set_Entry_Names --
+ ---------------------
- procedure Set_Entry_Name
- (Object : Protection_Entries'Class;
- Pos : Protected_Entry_Index;
- Val : String_Access)
+ procedure Set_Entry_Names
+ (Object : Protection_Entries_Access;
+ Names : Protected_Entry_Names_Access)
is
begin
- pragma Assert (Object.Entry_Names /= null);
-
- Object.Entry_Names (Entry_Index (Pos)) := Val;
- end Set_Entry_Name;
+ Object.Entry_Names := Names;
+ end Set_Entry_Names;
--------------------
-- Unlock_Entries --
diff --git a/gcc/ada/s-tpoben.ads b/gcc/ada/s-tpoben.ads
index ce7045cf56e..8a91bbb03e1 100644
--- a/gcc/ada/s-tpoben.ads
+++ b/gcc/ada/s-tpoben.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
-- --
-- GNARL 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,26 +59,34 @@ package System.Tasking.Protected_Objects.Entries is
type Protected_Entry_Body_Array is
array (Positive_Protected_Entry_Index range <>) of Entry_Body;
- -- This is an array of the executable code for all entry bodies of
- -- a protected type.
+ -- Contains executable code for all entry bodies of a protected type
type Protected_Entry_Body_Access is access all Protected_Entry_Body_Array;
type Protected_Entry_Queue_Array is
array (Protected_Entry_Index range <>) of Entry_Queue;
- -- This type contains the GNARL state of a protected object. The
- -- application-defined portion of the state (i.e. private objects)
- -- is maintained by the compiler-generated code.
- -- note that there is a simplified version of this type declared in
- -- System.Tasking.PO_Simple that handle the simple case (no entries).
+ -- The following declarations define an array that contains the string
+ -- names of entries and entry family members, together with an associated
+ -- access type.
+
+ type Protected_Entry_Names_Array is
+ array (Entry_Index range <>) of String_Access;
+
+ type Protected_Entry_Names_Access is access all Protected_Entry_Names_Array;
+
+ -- The following type contains the GNARL state of a protected object.
+ -- The application-defined portion of the state (i.e. private objects)
+ -- is maintained by the compiler-generated code. Note that there is a
+ -- simplified version of this type declared in System.Tasking.PO_Simple
+ -- that handle the simple case (no entries).
type Protection_Entries (Num_Entries : Protected_Entry_Index) is new
Ada.Finalization.Limited_Controlled
with record
- L : aliased Task_Primitives.Lock;
- -- The underlying lock associated with a Protection_Entries.
- -- Note that you should never (un)lock Object.L directly, but instead
+ L : aliased Task_Primitives.Lock;
+ -- The underlying lock associated with a Protection_Entries. Note
+ -- that you should never (un)lock Object.L directly, but instead
-- use Lock_Entries/Unlock_Entries.
Compiler_Info : System.Address;
@@ -136,14 +144,14 @@ package System.Tasking.Protected_Objects.Entries is
Entry_Queues : Protected_Entry_Queue_Array (1 .. Num_Entries);
- Entry_Names : Entry_Names_Array_Access := null;
+ Entry_Names : Protected_Entry_Names_Access := null;
-- An array of string names which denotes entry [family member] names.
-- The structure is indexed by protected entry index and contains Num_
-- Entries components.
end record;
- -- No default initial values for this type, since call records
- -- will need to be re-initialized before every use.
+ -- No default initial values for this type, since call records will need to
+ -- be re-initialized before every use.
type Protection_Entries_Access is access all Protection_Entries'Class;
-- See comments in s-tassta.adb about the implicit call to Current_Master
@@ -167,12 +175,11 @@ package System.Tasking.Protected_Objects.Entries is
-- System.Tasking.Protected_Objects.Initialize_Protection.
procedure Initialize_Protection_Entries
- (Object : Protection_Entries_Access;
- Ceiling_Priority : Integer;
- Compiler_Info : System.Address;
- Entry_Bodies : Protected_Entry_Body_Access;
- Find_Body_Index : Find_Body_Index_Access;
- Build_Entry_Names : Boolean);
+ (Object : Protection_Entries_Access;
+ Ceiling_Priority : Integer;
+ Compiler_Info : System.Address;
+ Entry_Bodies : Protected_Entry_Body_Access;
+ Find_Body_Index : Find_Body_Index_Access);
-- Initialize the Object parameter so that it can be used by the runtime
-- to keep track of the runtime state of a protected object.
@@ -201,17 +208,20 @@ package System.Tasking.Protected_Objects.Entries is
-- possible future use. At the current time, everyone uses Lock for both
-- read and write locks.
+ function Number_Of_Entries
+ (Object : Protection_Entries_Access) return Entry_Index;
+ -- Return the number of entries of a protected object
+
procedure Set_Ceiling
(Object : Protection_Entries_Access;
Prio : System.Any_Priority);
-- Sets the new ceiling priority of the protected object
- procedure Set_Entry_Name
- (Object : Protection_Entries'Class;
- Pos : Protected_Entry_Index;
- Val : String_Access);
- -- This is called by the compiler to map a string which denotes an entry
- -- name to a protected entry index.
+ procedure Set_Entry_Names
+ (Object : Protection_Entries_Access;
+ Names : Protected_Entry_Names_Access);
+ -- Associate an array of string that denote entry [family] names with a
+ -- protected object.
procedure Unlock_Entries (Object : Protection_Entries_Access);
-- Relinquish ownership of the lock for the object represented by the
diff --git a/gcc/ada/s-valboo.adb b/gcc/ada/s-valboo.adb
index bea2140656e..59c79ef15a9 100644
--- a/gcc/ada/s-valboo.adb
+++ b/gcc/ada/s-valboo.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, 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- --
@@ -52,7 +52,7 @@ package body System.Val_Bool is
return False;
else
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
end Value_Boolean;
diff --git a/gcc/ada/s-valcha.adb b/gcc/ada/s-valcha.adb
index 8dddcf58403..799145fa893 100644
--- a/gcc/ada/s-valcha.adb
+++ b/gcc/ada/s-valcha.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, 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- --
@@ -69,7 +69,7 @@ package body System.Val_Char is
return Character'Val (16#AD#);
end if;
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
end Value_Character;
diff --git a/gcc/ada/s-valenu.adb b/gcc/ada/s-valenu.adb
index 66a84ec8248..0de1a9520ee 100644
--- a/gcc/ada/s-valenu.adb
+++ b/gcc/ada/s-valenu.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, 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- --
@@ -30,6 +30,7 @@
------------------------------------------------------------------------------
with Ada.Unchecked_Conversion;
+
with System.Val_Util; use System.Val_Util;
package body System.Val_Enum is
@@ -70,7 +71,7 @@ package body System.Val_Enum is
end if;
end loop;
- raise Constraint_Error;
+ Bad_Value (Str);
end Value_Enumeration_8;
--------------------------
@@ -109,7 +110,7 @@ package body System.Val_Enum is
end if;
end loop;
- raise Constraint_Error;
+ Bad_Value (Str);
end Value_Enumeration_16;
--------------------------
@@ -148,7 +149,7 @@ package body System.Val_Enum is
end if;
end loop;
- raise Constraint_Error;
+ Bad_Value (Str);
end Value_Enumeration_32;
end System.Val_Enum;
diff --git a/gcc/ada/s-valint.adb b/gcc/ada/s-valint.adb
index c37b9dcf0f9..d77de09ef2f 100644
--- a/gcc/ada/s-valint.adb
+++ b/gcc/ada/s-valint.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, 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- --
@@ -58,7 +58,7 @@ package body System.Val_Int is
if Str (Ptr.all) not in '0' .. '9' then
Ptr.all := Start;
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
Uval := Scan_Raw_Unsigned (Str, Ptr, Max);
@@ -69,7 +69,7 @@ package body System.Val_Int is
if Minus and then Uval = Unsigned (-(Integer'First)) then
return Integer'First;
else
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
-- Negative values
diff --git a/gcc/ada/s-vallli.adb b/gcc/ada/s-vallli.adb
index 66f93f7a668..035a95d0c99 100644
--- a/gcc/ada/s-vallli.adb
+++ b/gcc/ada/s-vallli.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, 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- --
@@ -58,7 +58,7 @@ package body System.Val_LLI is
if Str (Ptr.all) not in '0' .. '9' then
Ptr.all := Start;
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
Uval := Scan_Raw_Long_Long_Unsigned (Str, Ptr, Max);
@@ -71,7 +71,7 @@ package body System.Val_LLI is
then
return Long_Long_Integer'First;
else
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
-- Negative values
diff --git a/gcc/ada/s-valllu.adb b/gcc/ada/s-valllu.adb
index f59bf2fe9cc..c37781fca2e 100644
--- a/gcc/ada/s-valllu.adb
+++ b/gcc/ada/s-valllu.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, 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- --
@@ -207,7 +207,7 @@ package body System.Val_LLU is
if P > Max then
Ptr.all := P;
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
-- If terminating base character, we are done with loop
@@ -257,7 +257,7 @@ package body System.Val_LLU is
-- Return result, dealing with sign and overflow
if Overflow then
- raise Constraint_Error;
+ Bad_Value (Str);
else
return Uval;
end if;
diff --git a/gcc/ada/s-valrea.adb b/gcc/ada/s-valrea.adb
index 00c6e43a3df..e8debff1e46 100644
--- a/gcc/ada/s-valrea.adb
+++ b/gcc/ada/s-valrea.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, 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,8 +29,8 @@
-- --
------------------------------------------------------------------------------
-with System.Powten_Table; use System.Powten_Table;
-with System.Val_Util; use System.Val_Util;
+with System.Powten_Table; use System.Powten_Table;
+with System.Val_Util; use System.Val_Util;
with System.Float_Control;
package body System.Val_Real is
@@ -82,10 +82,6 @@ package body System.Val_Real is
-- necessarily required in a case like this where the result is not
-- a machine number, but it is certainly a desirable behavior.
- procedure Bad_Based_Value;
- pragma No_Return (Bad_Based_Value);
- -- Raise exception for bad based value
-
procedure Scanf;
-- Scans integer literal value starting at current character position.
-- For each digit encountered, Uval is multiplied by 10.0, and the new
@@ -95,16 +91,6 @@ package body System.Val_Real is
-- return P points past the last character. On entry, the current
-- character is known to be a digit, so a numeral is definitely present.
- ---------------------
- -- Bad_Based_Value --
- ---------------------
-
- procedure Bad_Based_Value is
- begin
- raise Constraint_Error with
- "invalid based literal for 'Value";
- end Bad_Based_Value;
-
-----------
-- Scanf --
-----------
@@ -194,8 +180,7 @@ package body System.Val_Real is
-- Any other initial character is an error
else
- raise Constraint_Error with
- "invalid character in 'Value string";
+ Bad_Value (Str);
end if;
-- Deal with based case
@@ -233,7 +218,7 @@ package body System.Val_Real is
loop
if P > Max then
- Bad_Based_Value;
+ Bad_Value (Str);
elsif Str (P) in Digs then
Digit := Character'Pos (Str (P)) - Character'Pos ('0');
@@ -247,7 +232,7 @@ package body System.Val_Real is
Character'Pos (Str (P)) - (Character'Pos ('a') - 10);
else
- Bad_Based_Value;
+ Bad_Value (Str);
end if;
-- Save up trailing zeroes after the decimal point
@@ -281,7 +266,7 @@ package body System.Val_Real is
P := P + 1;
if P > Max then
- Bad_Based_Value;
+ Bad_Value (Str);
elsif Str (P) = '_' then
Scan_Underscore (Str, P, Ptr, Max, True);
@@ -296,7 +281,7 @@ package body System.Val_Real is
After_Point := 1;
if P > Max then
- Bad_Based_Value;
+ Bad_Value (Str);
end if;
end if;
@@ -372,7 +357,7 @@ package body System.Val_Real is
-- Here is where we check for a bad based number
if Bad_Base then
- Bad_Based_Value;
+ Bad_Value (Str);
-- If OK, then deal with initial minus sign, note that this processing
-- is done even if Uval is zero, so that -0.0 is correctly interpreted.
diff --git a/gcc/ada/s-valuns.adb b/gcc/ada/s-valuns.adb
index d2e0a91443f..84da2b16e08 100644
--- a/gcc/ada/s-valuns.adb
+++ b/gcc/ada/s-valuns.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, 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- --
@@ -205,7 +205,7 @@ package body System.Val_Uns is
if P > Max then
Ptr.all := P;
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
-- If terminating base character, we are done with loop
@@ -254,7 +254,7 @@ package body System.Val_Uns is
-- Return result, dealing with sign and overflow
if Overflow then
- raise Constraint_Error;
+ Bad_Value (Str);
else
return Uval;
end if;
@@ -277,7 +277,7 @@ package body System.Val_Uns is
if Str (Ptr.all) not in '0' .. '9' then
Ptr.all := Start;
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
return Scan_Raw_Unsigned (Str, Ptr, Max);
diff --git a/gcc/ada/s-valuti.adb b/gcc/ada/s-valuti.adb
index 86274e7bffa..e25f78c4501 100644
--- a/gcc/ada/s-valuti.adb
+++ b/gcc/ada/s-valuti.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, 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,6 +33,15 @@ with System.Case_Util; use System.Case_Util;
package body System.Val_Util is
+ ---------------
+ -- Bad_Value --
+ ---------------
+
+ procedure Bad_Value (S : String) is
+ begin
+ raise Constraint_Error with "bad input for 'Value: """ & S & '"';
+ end Bad_Value;
+
----------------------
-- Normalize_String --
----------------------
@@ -54,7 +63,7 @@ package body System.Val_Util is
-- Check for case when the string contained no characters
if F > L then
- raise Constraint_Error;
+ Bad_Value (S);
end if;
-- Scan for trailing spaces
@@ -169,7 +178,7 @@ package body System.Val_Util is
begin
if P > Max then
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
-- Scan past initial blanks
@@ -179,7 +188,7 @@ package body System.Val_Util is
if P > Max then
Ptr.all := P;
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
end loop;
@@ -192,7 +201,7 @@ package body System.Val_Util is
if P > Max then
Ptr.all := Start;
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
end if;
@@ -217,7 +226,7 @@ package body System.Val_Util is
-- raise constraint error, with Ptr unchanged, and thus > Max.
if P > Max then
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
-- Scan past initial blanks
@@ -227,7 +236,7 @@ package body System.Val_Util is
if P > Max then
Ptr.all := P;
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
end loop;
@@ -241,7 +250,7 @@ package body System.Val_Util is
if P > Max then
Ptr.all := Start;
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
-- Skip past an initial plus sign
@@ -252,7 +261,7 @@ package body System.Val_Util is
if P > Max then
Ptr.all := Start;
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
else
@@ -270,7 +279,7 @@ package body System.Val_Util is
begin
for J in P .. Str'Last loop
if Str (J) /= ' ' then
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
end loop;
end Scan_Trailing_Blanks;
@@ -304,7 +313,7 @@ package body System.Val_Util is
if P > Max then
Ptr.all := P;
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
-- Similarly, if no digit follows the underscore raise an error. This
@@ -313,13 +322,12 @@ package body System.Val_Util is
C := Str (P);
if C in '0' .. '9'
- or else
- (Ext and then (C in 'A' .. 'F' or else C in 'a' .. 'f'))
+ or else (Ext and then (C in 'A' .. 'F' or else C in 'a' .. 'f'))
then
return;
else
Ptr.all := P;
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
end Scan_Underscore;
diff --git a/gcc/ada/s-valuti.ads b/gcc/ada/s-valuti.ads
index 0a92352a3e3..ce9dc3b8ff1 100644
--- a/gcc/ada/s-valuti.ads
+++ b/gcc/ada/s-valuti.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, 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,6 +34,10 @@
package System.Val_Util is
pragma Pure;
+ procedure Bad_Value (S : String);
+ pragma No_Return (Bad_Value);
+ -- Raises constraint error with message: bad input for 'Value: "xxx"
+
procedure Normalize_String
(S : in out String;
F, L : out Integer);
diff --git a/gcc/ada/s-valwch.adb b/gcc/ada/s-valwch.adb
index b2db5005adc..87e85464301 100644
--- a/gcc/ada/s-valwch.adb
+++ b/gcc/ada/s-valwch.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, 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- --
@@ -48,8 +48,7 @@ package body System.Val_WChar is
WV : constant Unsigned_32 := Wide_Wide_Character'Pos (WC);
begin
if WV > 16#FFFF# then
- raise Constraint_Error with
- "out of range character for Value attribute";
+ Bad_Value (Str);
else
return Wide_Character'Val (WV);
end if;
@@ -77,7 +76,7 @@ package body System.Val_WChar is
-- Must be at least three characters
if L - F < 2 then
- raise Constraint_Error;
+ Bad_Value (Str);
-- If just three characters, simple character case
@@ -103,7 +102,7 @@ package body System.Val_WChar is
P := P + 1;
if P = Str'Last then
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
return Str (P);
@@ -124,7 +123,7 @@ package body System.Val_WChar is
end if;
if P /= L - 1 then
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
return W;
@@ -150,12 +149,12 @@ package body System.Val_WChar is
elsif Str (J) in 'a' .. 'f' then
W := W - Character'Pos ('a') + 10;
else
- raise Constraint_Error;
+ Bad_Value (Str);
end if;
end loop;
if W > 16#7FFF_FFFF# then
- raise Constraint_Error;
+ Bad_Value (Str);
else
return Wide_Wide_Character'Val (W);
end if;
@@ -170,7 +169,7 @@ package body System.Val_WChar is
exception
when Constraint_Error =>
- raise Constraint_Error with "invalid string for value attribute";
+ Bad_Value (Str);
end Value_Wide_Wide_Character;
end System.Val_WChar;
diff --git a/gcc/ada/s-win32.ads b/gcc/ada/s-win32.ads
index d3343252f16..ec07b820d45 100644
--- a/gcc/ada/s-win32.ads
+++ b/gcc/ada/s-win32.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2008-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2008-2012, 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- --
@@ -32,7 +32,7 @@
-- This package plus its child provide the low level interface to the Win32
-- API. The core part of the Win32 API (common to RTX and Win32) is in this
-- package, and an additional part of the Win32 API which is not supported by
--- RTX is in package System.Win33.Ext.
+-- RTX is in package System.Win32.Ext.
with Interfaces.C;
@@ -73,8 +73,13 @@ package System.Win32 is
for Bits2'Size use 2;
for Bits17'Size use 17;
+ -- Note that the following clashes with standard names are to stay
+ -- compatible with the historical choice of following the C names.
+
+ pragma Warnings (Off);
FALSE : constant := 0;
TRUE : constant := 1;
+ pragma Warnings (On);
function GetLastError return DWORD;
pragma Import (Stdcall, GetLastError, "GetLastError");
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index 5b1585a3982..4118087d5f6 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -646,8 +646,8 @@ 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.
+ -- Treat as call for elaboration purposes and we are all done.
+ -- Suppress this treatment under debug flag.
if not Debug_Flag_Dot_UU then
Check_Elab_Call (N);
diff --git a/gcc/ada/sem_aux.adb b/gcc/ada/sem_aux.adb
index bb24fc2e21a..490048e9a7c 100644
--- a/gcc/ada/sem_aux.adb
+++ b/gcc/ada/sem_aux.adb
@@ -431,11 +431,17 @@ package body Sem_Aux is
begin
N := First_Rep_Item (E);
while Present (N) loop
+
+ -- Only one of Priority / Interrupt_Priority can be specified, so
+ -- return whichever one is present to catch illegal duplication.
+
if Nkind (N) = N_Pragma
and then
(Pragma_Name (N) = Nam
or else (Nam = Name_Priority
- and then Pragma_Name (N) = Name_Interrupt_Priority))
+ and then Pragma_Name (N) = Name_Interrupt_Priority)
+ or else (Nam = Name_Interrupt_Priority
+ and then Pragma_Name (N) = Name_Priority))
then
if Check_Parents then
return N;
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 521eb80b174..51edb644c1d 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -253,9 +253,7 @@ package body Sem_Ch13 is
-- is important, since otherwise if there are record subtypes, we
-- could reverse the bits once for each subtype, which is wrong.
- if Present (CC)
- and then Ekind (R) = E_Record_Type
- then
+ if Present (CC) and then Ekind (R) = E_Record_Type then
declare
CFB : constant Uint := Component_Bit_Offset (Comp);
CSZ : constant Uint := Esize (Comp);
@@ -623,14 +621,12 @@ package body Sem_Ch13 is
for C in Start .. Stop loop
declare
Comp : constant Entity_Id := Comps (C);
- CC : constant Node_Id :=
- Component_Clause (Comp);
- LB : constant Uint :=
- Static_Integer (Last_Bit (CC));
+ CC : constant Node_Id := Component_Clause (Comp);
+
+ LB : constant Uint := Static_Integer (Last_Bit (CC));
NFB : constant Uint := MSS - Uint_1 - LB;
NLB : constant Uint := NFB + Esize (Comp) - 1;
- Pos : constant Uint :=
- Static_Integer (Position (CC));
+ Pos : constant Uint := Static_Integer (Position (CC));
begin
if Warn_On_Reverse_Bit_Order then
@@ -1012,9 +1008,7 @@ package body Sem_Ch13 is
procedure Analyze_Aspect_Implicit_Dereference is
begin
- if not Is_Type (E)
- or else not Has_Discriminants (E)
- then
+ if not Is_Type (E) or else not Has_Discriminants (E) then
Error_Msg_N
("Aspect must apply to a type with discriminants", N);
@@ -1306,7 +1300,8 @@ package body Sem_Ch13 is
A_Name := Chars (Identifier (A));
if A_Name = Name_Import
- or else A_Name = Name_Export
+ or else
+ A_Name = Name_Export
then
if Found then
Error_Msg_N ("conflicting", A);
@@ -1331,6 +1326,7 @@ package body Sem_Ch13 is
end loop;
Arg_List := New_List (Relocate_Node (Expr), Ent);
+
if Present (L_Assoc) then
Append_To (Arg_List, L_Assoc);
end if;
@@ -1769,9 +1765,7 @@ package body Sem_Ch13 is
-- For a Boolean aspect, create the corresponding pragma if
-- no expression or if the value is True.
- if Is_Boolean_Aspect (Aspect)
- and then No (Aitem)
- then
+ if Is_Boolean_Aspect (Aspect) and then No (Aitem) then
if Is_True (Static_Boolean (Expr)) then
Aitem :=
Make_Pragma (Loc,
@@ -2708,7 +2702,21 @@ package body Sem_Ch13 is
if Present (O_Ent)
and then Is_Object (O_Ent)
and then not Off
+
+ -- The following test is an expedient solution to what
+ -- is really a problem in CodePeer. Suppressing the
+ -- Set_Treat_As_Volatile call here prevents later
+ -- generation (in some cases) of trees that CodePeer
+ -- should, but currently does not, handle correctly.
+ -- This test should probably be removed when CodePeer
+ -- is improved, just because we want the tree CodePeer
+ -- analyzes to match the tree for which we generate code
+ -- as closely as is practical. ???
+
+ and then not CodePeer_Mode
then
+ -- ??? O_Ent might not be in current unit
+
Set_Treat_As_Volatile (O_Ent);
end if;
@@ -4738,11 +4746,13 @@ package body Sem_Ch13 is
or else Intval (Last_Bit (Rep1)) /=
Intval (Last_Bit (CC))
then
- Error_Msg_N ("component clause inconsistent "
- & "with representation of ancestor", CC);
+ Error_Msg_N
+ ("component clause inconsistent "
+ & "with representation of ancestor", CC);
elsif Warn_On_Redundant_Constructs then
- Error_Msg_N ("?redundant component clause "
- & "for inherited component!", CC);
+ Error_Msg_N
+ ("?redundant component clause "
+ & "for inherited component!", CC);
end if;
end;
end if;
@@ -5017,18 +5027,21 @@ package body Sem_Ch13 is
-- Replace_Type_Reference --
----------------------------
+ -- Note: See comments in Add_Predicates.Replace_Type_Reference
+ -- regarding handling of Sloc and Comes_From_Source.
+
procedure Replace_Type_Reference (N : Node_Id) is
begin
-- Invariant'Class, replace with T'Class (obj)
if Class_Present (Ritem) then
Rewrite (N,
- Make_Type_Conversion (Loc,
+ Make_Type_Conversion (Sloc (N),
Subtype_Mark =>
- Make_Attribute_Reference (Loc,
- Prefix => New_Occurrence_Of (T, Loc),
+ Make_Attribute_Reference (Sloc (N),
+ Prefix => New_Occurrence_Of (T, Sloc (N)),
Attribute_Name => Name_Class),
- Expression => Make_Identifier (Loc, Object_Name)));
+ Expression => Make_Identifier (Sloc (N), Object_Name)));
Set_Entity (Expression (N), Object_Entity);
Set_Etype (Expression (N), Typ);
@@ -5036,10 +5049,12 @@ package body Sem_Ch13 is
-- Invariant, replace with obj
else
- Rewrite (N, Make_Identifier (Loc, Object_Name));
+ Rewrite (N, Make_Identifier (Sloc (N), Object_Name));
Set_Entity (N, Object_Entity);
Set_Etype (N, Typ);
end if;
+
+ Set_Comes_From_Source (N, True);
end Replace_Type_Reference;
-- Start of processing for Add_Invariants
@@ -5127,7 +5142,8 @@ package body Sem_Ch13 is
Assoc := New_List (
Make_Pragma_Argument_Association (Loc,
Expression => Make_Identifier (Loc, Name_Invariant)),
- Make_Pragma_Argument_Association (Loc, Expression => Exp));
+ Make_Pragma_Argument_Association (Loc,
+ Expression => Exp));
-- Add message if present in Invariant pragma
@@ -5236,7 +5252,6 @@ package body Sem_Ch13 is
-- Build the procedure if we generated at least one Check pragma
if Stmts /= No_List then
-
Spec := Copy_Separate_Tree (Specification (PDecl));
PBody :=
@@ -5422,9 +5437,16 @@ package body Sem_Ch13 is
procedure Replace_Type_Reference (N : Node_Id) is
begin
- Rewrite (N, Make_Identifier (Loc, Object_Name));
+ 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);
+
+ -- We want to treat the node as if it comes from source, so that
+ -- ASIS will not ignore it
+
+ Set_Comes_From_Source (N, True);
end Replace_Type_Reference;
-- Start of processing for Add_Predicates
@@ -5462,7 +5484,6 @@ package body Sem_Ch13 is
if Entity (Arg1) = Typ
or else Full_View (Entity (Arg1)) = Typ
then
-
-- We have a match, this entry is for our subtype
-- We need to replace any occurrences of the name of the
@@ -6049,6 +6070,7 @@ package body Sem_Ch13 is
-- Comparisons of type with static value
when N_Op_Compare =>
+
-- Type is left operand
if Is_Type_Ref (Left_Opnd (Exp))
@@ -6311,9 +6333,7 @@ package body Sem_Ch13 is
begin
-- Not static if type does not have static predicates
- if not Has_Predicates (Typ)
- or else No (Static_Predicate (Typ))
- then
+ if not Has_Predicates (Typ) or else No (Static_Predicate (Typ)) then
raise Non_Static;
end if;
@@ -6622,7 +6642,7 @@ package body Sem_Ch13 is
-- containing that copy, but Expression (Ident) is a preanalyzed copy
-- of the expression, preanalyzed just after the freeze point.
- -- Make a copy of the expression to be preanalyed
+ -- Make a copy of the expression to be preanalyzed
Set_Expression (ASN, New_Copy_Tree (Entity (Ident)));
@@ -7410,9 +7430,7 @@ package body Sem_Ch13 is
-- Check parent overlap if component might overlap parent field
- if Present (Tagged_Parent)
- and then Fbit <= Parent_Last_Bit
- then
+ if Present (Tagged_Parent) and then Fbit <= Parent_Last_Bit then
Pcomp := First_Component_Or_Discriminant (Tagged_Parent);
while Present (Pcomp) loop
if not Is_Tag (Pcomp)
@@ -7574,7 +7592,7 @@ package body Sem_Ch13 is
-- Outer level of record definition, check discriminants
if Nkind_In (Clist, N_Full_Type_Declaration,
- N_Private_Type_Declaration)
+ N_Private_Type_Declaration)
then
if Has_Discriminants (Defining_Identifier (Clist)) then
C2_Ent :=
@@ -7926,6 +7944,7 @@ package body Sem_Ch13 is
if Asiz <= Siz then
return;
+
else
Error_Msg_Uint_1 := Asiz;
Error_Msg_NE
@@ -8256,11 +8275,12 @@ package body Sem_Ch13 is
begin
if Nkind (N) /= N_Attribute_Definition_Clause then
return False;
+
else
declare
- Id : constant Attribute_Id := Get_Attribute_Id (Chars (N));
+ Id : constant Attribute_Id := Get_Attribute_Id (Chars (N));
begin
- return Id = Attribute_Input
+ return Id = Attribute_Input
or else Id = Attribute_Output
or else Id = Attribute_Read
or else Id = Attribute_Write
@@ -8656,6 +8676,7 @@ package body Sem_Ch13 is
elsif Has_Private_Component (T) then
if Nkind (N) = N_Pragma then
return False;
+
else
Error_Msg_N
("representation item must appear after type is fully defined",
@@ -8750,9 +8771,7 @@ package body Sem_Ch13 is
-- but avoid chaining if we have an overloadable entity, and the pragma
-- is one that can apply to multiple overloaded entities.
- if Is_Overloadable (T)
- and then Nkind (N) = N_Pragma
- then
+ if Is_Overloadable (T) and then Nkind (N) = N_Pragma then
declare
Pname : constant Name_Id := Pragma_Name (N);
begin
@@ -9020,8 +9039,6 @@ package body Sem_Ch13 is
begin
if Has_Discriminants (T1) then
- CD1 := First_Discriminant (T1);
- CD2 := First_Discriminant (T2);
-- The number of discriminants may be different if the
-- derived type has fewer (constrained by values). The
@@ -9029,9 +9046,9 @@ package body Sem_Ch13 is
-- the original, so the discrepancy does not per se
-- indicate a different representation.
- while Present (CD1)
- and then Present (CD2)
- loop
+ CD1 := First_Discriminant (T1);
+ CD2 := First_Discriminant (T2);
+ while Present (CD1) and then Present (CD2) loop
if not Same_Rep then
return False;
else
@@ -9043,7 +9060,6 @@ package body Sem_Ch13 is
CD1 := First_Component (Underlying_Type (Base_Type (T1)));
CD2 := First_Component (Underlying_Type (Base_Type (T2)));
-
while Present (CD1) loop
if not Same_Rep then
return False;
@@ -9069,7 +9085,6 @@ package body Sem_Ch13 is
begin
L1 := First_Literal (T1);
L2 := First_Literal (T2);
-
while Present (L1) loop
if Enumeration_Rep (L1) /= Enumeration_Rep (L2) then
return False;
@@ -9080,7 +9095,6 @@ package body Sem_Ch13 is
end loop;
return True;
-
end Enumeration_Case;
-- Any other types have the same representation for these purposes
@@ -9194,7 +9208,6 @@ package body Sem_Ch13 is
-- Skip processing of this entry if warning already posted
if not Address_Warning_Posted (ACCR.N) then
-
Expr := Original_Node (Expression (ACCR.N));
-- Get alignments
@@ -9328,9 +9341,8 @@ package body Sem_Ch13 is
-- Bad component size, check reason
if Has_Component_Size_Clause (Atyp) then
- P :=
- Get_Attribute_Definition_Clause
- (Atyp, Attribute_Component_Size);
+ P := Get_Attribute_Definition_Clause
+ (Atyp, Attribute_Component_Size);
if Present (P) then
Error_Msg_Sloc := Sloc (P);
@@ -9402,7 +9414,8 @@ package body Sem_Ch13 is
-- cases where we cannot check static values.
if not (Known_Static_Esize (C)
- and then Known_Static_Esize (Ctyp))
+ and then
+ Known_Static_Esize (Ctyp))
then
return False;
end if;
@@ -9410,9 +9423,7 @@ package body Sem_Ch13 is
-- Size of component must be addressable or greater than 64 bits
-- and a multiple of bytes.
- if not Addressable (Esize (C))
- and then Esize (C) < Uint_64
- then
+ if not Addressable (Esize (C)) and then Esize (C) < Uint_64 then
return False;
end if;
@@ -9601,9 +9612,7 @@ package body Sem_Ch13 is
-- Source may be unconstrained array, but not target
- if Is_Array_Type (Target)
- and then not Is_Constrained (Target)
- then
+ if Is_Array_Type (Target) and then not Is_Constrained (Target) then
Error_Msg_N
("unchecked conversion to unconstrained array not allowed", N);
return;
@@ -9649,9 +9658,7 @@ package body Sem_Ch13 is
begin
pragma Assert (Present (Calendar_Time));
- if Source = Calendar_Time
- or else Target = Calendar_Time
- then
+ if Source = Calendar_Time or else Target = Calendar_Time then
Error_Msg_N
("?representation of 'Time values may change between " &
"'G'N'A'T versions", N);
@@ -9666,10 +9673,9 @@ package body Sem_Ch13 is
if Warn_On_Unchecked_Conversion then
Unchecked_Conversions.Append
- (New_Val => UC_Entry'
- (Eloc => Sloc (N),
- Source => Source,
- Target => Target));
+ (New_Val => UC_Entry'(Eloc => Sloc (N),
+ Source => Source,
+ Target => Target));
-- If both sizes are known statically now, then back end annotation
-- is not required to do a proper check but if either size is not
@@ -9767,7 +9773,8 @@ package body Sem_Ch13 is
Error_Msg_Uint_1 := UI_Abs (Source_Siz - Target_Siz);
if Is_Discrete_Type (Source)
- and then Is_Discrete_Type (Target)
+ and then
+ Is_Discrete_Type (Target)
then
if Source_Siz > Target_Siz then
Error_Msg
@@ -9831,7 +9838,8 @@ package body Sem_Ch13 is
begin
if Known_Alignment (D_Source)
- and then Known_Alignment (D_Target)
+ and then
+ Known_Alignment (D_Target)
then
declare
Source_Align : constant Uint := Alignment (D_Source);
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 7dd808c0d0d..a3b7f3ee2b9 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -10656,6 +10656,18 @@ package body Sem_Ch3 is
then
Check_Recursive_Declaration (Designated_Type (T));
end if;
+
+ -- A deferred constant is a visible entity. If type has invariants,
+ -- verify that the initial value satisfies them.
+
+ if Expander_Active and then Has_Invariants (T) then
+ declare
+ Call : constant Node_Id :=
+ Make_Invariant_Call (New_Occurrence_Of (Prev, Sloc (N)));
+ begin
+ Insert_After (N, Call);
+ end;
+ end if;
end if;
end Constant_Redeclaration;
@@ -12792,23 +12804,30 @@ package body Sem_Ch3 is
-- done here because interfaces must be visible in the partial and
-- private view (RM 7.3(7.3/2)).
- -- Small optimization: This work is only required if the parent is
- -- abstract. If the tagged type is not abstract, it cannot have
- -- abstract primitives (the only entities in the list of primitives of
+ -- Small optimization: This work is only required if the parent may
+ -- have entities whose Alias attribute reference an interface primitive.
+ -- Such a situation may occur if the parent is an abstract type and the
+ -- primitive has not been yet overridden or if the parent is a generic
+ -- formal type covering interfaces.
+
+ -- If the tagged type is not abstract, it cannot have abstract
+ -- primitives (the only entities in the list of primitives of
-- non-abstract tagged types that can reference abstract primitives
-- through its Alias attribute are the internal entities that have
-- attribute Interface_Alias, and these entities are generated later
-- by Add_Internal_Interface_Entities).
if In_Private_Part (Current_Scope)
- and then Is_Abstract_Type (Parent_Type)
+ and then (Is_Abstract_Type (Parent_Type)
+ or else
+ Is_Generic_Type (Parent_Type))
then
Elmt := First_Elmt (Primitive_Operations (Tagged_Type));
while Present (Elmt) loop
Subp := Node (Elmt);
-- At this stage it is not possible to have entities in the list
- -- of primitives that have attribute Interface_Alias
+ -- of primitives that have attribute Interface_Alias.
pragma Assert (No (Interface_Alias (Subp)));
@@ -12832,7 +12851,7 @@ package body Sem_Ch3 is
end if;
-- Step 2: Add primitives of progenitors that are not implemented by
- -- parents of Tagged_Type
+ -- parents of Tagged_Type.
if Present (Interfaces (Base_Type (Tagged_Type))) then
Iface_Elmt := First_Elmt (Interfaces (Base_Type (Tagged_Type)));
@@ -12859,7 +12878,7 @@ package body Sem_Ch3 is
Iface_Prim => Iface_Subp);
-- If not found we derive a new primitive leaving its alias
- -- attribute referencing the interface primitive
+ -- attribute referencing the interface primitive.
if No (E) then
Derive_Subprogram
@@ -12882,7 +12901,7 @@ package body Sem_Ch3 is
Is_Abstract_Subprogram (E));
-- Propagate to the full view interface entities associated
- -- with the partial view
+ -- with the partial view.
elsif In_Private_Part (Current_Scope)
and then Present (Alias (E))
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index f756dbcaf5d..b062be948a1 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -2626,6 +2626,56 @@ package body Sem_Ch5 is
Push_Scope (Ent);
Analyze_Iteration_Scheme (Iter);
+ -- Check for following case which merits a warning if the type E of is
+ -- a multi-dimensional array (and no explicit subscript ranges present).
+
+ -- for J in E'Range
+ -- for K in E'Range
+
+ if Present (Iter)
+ and then Present (Loop_Parameter_Specification (Iter))
+ then
+ declare
+ LPS : constant Node_Id := Loop_Parameter_Specification (Iter);
+ DSD : constant Node_Id :=
+ Original_Node (Discrete_Subtype_Definition (LPS));
+ begin
+ if Nkind (DSD) = N_Attribute_Reference
+ and then Attribute_Name (DSD) = Name_Range
+ and then No (Expressions (DSD))
+ then
+ declare
+ Typ : constant Entity_Id := Etype (Prefix (DSD));
+ begin
+ if Is_Array_Type (Typ)
+ and then Number_Dimensions (Typ) > 1
+ and then Nkind (Parent (N)) = N_Loop_Statement
+ and then Present (Iteration_Scheme (Parent (N)))
+ then
+ declare
+ OIter : constant Node_Id :=
+ Iteration_Scheme (Parent (N));
+ OLPS : constant Node_Id :=
+ Loop_Parameter_Specification (OIter);
+ ODSD : constant Node_Id :=
+ Original_Node (Discrete_Subtype_Definition (OLPS));
+ begin
+ if Nkind (ODSD) = N_Attribute_Reference
+ and then Attribute_Name (ODSD) = Name_Range
+ and then No (Expressions (ODSD))
+ and then Etype (Prefix (ODSD)) = Typ
+ then
+ Error_Msg_Sloc := Sloc (ODSD);
+ Error_Msg_N
+ ("inner range same as outer range#?", DSD);
+ end if;
+ end;
+ end if;
+ end;
+ end if;
+ end;
+ end if;
+
-- Analyze the statements of the body except in the case of an Ada 2012
-- iterator with the expander active. In this case the expander will do
-- a rewrite of the loop into a while loop. We will then analyze the
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index ea92eb93295..37dc5befbcf 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -33,6 +33,7 @@ with Expander; use Expander;
with Exp_Ch6; use Exp_Ch6;
with Exp_Ch7; use Exp_Ch7;
with Exp_Ch9; use Exp_Ch9;
+with Exp_Dbug; use Exp_Dbug;
with Exp_Disp; use Exp_Disp;
with Exp_Tss; use Exp_Tss;
with Exp_Util; use Exp_Util;
@@ -2723,6 +2724,20 @@ package body Sem_Ch6 is
Install_Formals (Spec_Id);
Last_Real_Spec_Entity := Last_Entity (Spec_Id);
+
+ -- Within an instance, add local renaming declarations so that
+ -- gdb can retrieve the values of actuals more easily. This is
+ -- only relevant if generating code (and indeed we definitely
+ -- do not want these definitions -gnatc mode, because that would
+ -- confuse ASIS).
+
+ if Is_Generic_Instance (Spec_Id)
+ and then Is_Wrapper_Package (Current_Scope)
+ and then Expander_Active
+ then
+ Build_Subprogram_Instance_Renamings (N, Current_Scope);
+ end if;
+
Push_Scope (Spec_Id);
-- Make sure that the subprogram is immediately visible. For
@@ -11457,10 +11472,19 @@ package body Sem_Ch6 is
-- public subprogram, since we do get initializations to deal with.
-- Other internally generated subprograms are not public.
- if not Is_List_Member (DD) and then Is_Init_Proc (DD) then
+ if not Is_List_Member (DD)
+ and then Is_Init_Proc (Defining_Entity (DD))
+ then
return True;
- elsif not Comes_From_Source (DD) then
+ -- The declaration may have been generated for an expression function
+ -- so check whether that function comes from source.
+
+ elsif not Comes_From_Source (DD)
+ and then
+ (Nkind (Original_Node (DD)) /= N_Expression_Function
+ or else not Comes_From_Source (Defining_Entity (DD)))
+ then
return False;
-- Otherwise we test whether the subprogram is declared in the
@@ -11786,7 +11810,7 @@ package body Sem_Ch6 is
end if;
-- If we had any postconditions and expansion is enabled, or if the
- -- procedure has invariants, then build the _Postconditions procedure.
+ -- subprogram has invariants, then build the _Postconditions procedure.
if (Present (Plist) or else Invariants_Or_Predicates_Present)
and then Expander_Active
@@ -11795,7 +11819,7 @@ package body Sem_Ch6 is
Plist := Empty_List;
end if;
- -- Special processing for function case
+ -- Special processing for function return
if Ekind (Designator) /= E_Procedure then
declare
diff --git a/gcc/ada/sem_disp.adb b/gcc/ada/sem_disp.adb
index 988a78f5781..50929365596 100644
--- a/gcc/ada/sem_disp.adb
+++ b/gcc/ada/sem_disp.adb
@@ -840,7 +840,7 @@ package body Sem_Disp is
Tagged_Type := Find_Dispatching_Type (Subp);
-- Ada 2005 (AI-345): Use the corresponding record (if available).
- -- Required because primitives of concurrent types are be attached
+ -- Required because primitives of concurrent types are attached
-- to the corresponding record (not to the concurrent type).
if Ada_Version >= Ada_2005
@@ -2382,6 +2382,12 @@ package body Sem_Disp is
Call_Node := Expression (Actual);
end if;
+ -- No action needed if the call has been already expanded
+
+ if Is_Expanded_Dispatching_Call (Call_Node) then
+ return;
+ end if;
+
-- Do not set the Controlling_Argument if already set. This happens in
-- the special case of _Input (see Exp_Attr, case Input).
diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb
index be3d7c5f98d..34aa69169d1 100644
--- a/gcc/ada/sem_elab.adb
+++ b/gcc/ada/sem_elab.adb
@@ -1137,15 +1137,13 @@ package body Sem_Elab is
-- Here we definitely have a bad instantiation
- Error_Msg_NE
- ("?cannot instantiate& before body seen", N, Ent);
+ Error_Msg_NE ("?cannot instantiate& before body seen", N, Ent);
if Present (Instance_Spec (N)) then
Supply_Bodies (Instance_Spec (N));
end if;
- Error_Msg_N
- ("\?Program_Error will be raised at run time", N);
+ Error_Msg_N ("\?Program_Error will be raised at run time", N);
Insert_Elab_Check (N);
Set_ABE_Is_Certain (N);
end Check_Bad_Instantiation;
@@ -1886,18 +1884,15 @@ package body Sem_Elab is
begin
-- If not function or procedure call or instantiation, then ignore
- -- call (this happens in some error case and rewriting cases)
+ -- call (this happens in some error cases and rewriting cases).
- if Nkind (N) /= N_Function_Call
- and then
- Nkind (N) /= N_Procedure_Call_Statement
- and then
- not Inst_Case
+ if not Nkind_In (N, N_Function_Call, N_Procedure_Call_Statement)
+ and then not Inst_Case
then
return;
- -- Nothing to do if this is a call or instantiation that has
- -- already been found to be a sure ABE
+ -- Nothing to do if this is a call or instantiation that has already
+ -- been found to be a sure ABE.
elsif ABE_Is_Certain (N) then
return;
@@ -1997,7 +1992,7 @@ package body Sem_Elab is
then
return Abandon;
- -- If we have a function call, check it
+ -- If we have a function call, check it
elsif Nkind (N) = N_Function_Call then
Check_Elab_Call (N, Outer_Scope);
@@ -2078,8 +2073,7 @@ package body Sem_Elab is
Elab_Visited.Append (E);
- -- If the call is to a function that renames a literal, no check
- -- is needed.
+ -- If the call is to a function that renames a literal, no check needed
if Ekind (E) = E_Enumeration_Literal then
return;
@@ -2188,12 +2182,10 @@ package body Sem_Elab is
Error_Msg_NE
("?cannot instantiate& before body seen", N, Orig_Ent);
else
- Error_Msg_NE
- ("?cannot call& before body seen", N, Orig_Ent);
+ Error_Msg_NE ("?cannot call& before body seen", N, Orig_Ent);
end if;
- Error_Msg_N
- ("\?Program_Error will be raised at run time", N);
+ Error_Msg_N ("\?Program_Error will be raised at run time", N);
Insert_Elab_Check (N);
-- Call is not at outer level
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 2c9d518f670..369376ad555 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -505,6 +505,10 @@ package body Sem_Prag is
-- Check the specified argument Arg to make sure that it is a valid
-- locking policy name. If not give error and raise Pragma_Exit.
+ procedure Check_Arg_Is_Partition_Elaboration_Policy (Arg : Node_Id);
+ -- Check the specified argument Arg to make sure that it is a valid
+ -- elaboration policy name. If not give error and raise Pragma_Exit.
+
procedure Check_Arg_Is_One_Of
(Arg : Node_Id;
N1, N2 : Name_Id);
@@ -778,6 +782,10 @@ package body Sem_Prag is
-- Called for all GNAT defined pragmas to check the relevant restriction
-- (No_Implementation_Pragmas).
+ procedure S14_Pragma;
+ -- Called for all pragmas defined for formal verification to check that
+ -- the S14_Extensions flag is set.
+
function Is_Before_First_Decl
(Pragma_Node : Node_Id;
Decls : List_Id) return Boolean;
@@ -1190,6 +1198,22 @@ package body Sem_Prag is
end if;
end Check_Arg_Is_Locking_Policy;
+ -----------------------------------------------
+ -- Check_Arg_Is_Partition_Elaboration_Policy --
+ -----------------------------------------------
+
+ procedure Check_Arg_Is_Partition_Elaboration_Policy (Arg : Node_Id) is
+ Argx : constant Node_Id := Get_Pragma_Arg (Arg);
+
+ begin
+ Check_Arg_Is_Identifier (Argx);
+
+ if not Is_Partition_Elaboration_Policy_Name (Chars (Argx)) then
+ Error_Pragma_Arg
+ ("& is not a valid partition elaboration policy name", Argx);
+ end if;
+ end Check_Arg_Is_Partition_Elaboration_Policy;
+
-------------------------
-- Check_Arg_Is_One_Of --
-------------------------
@@ -1260,6 +1284,7 @@ package body Sem_Prag is
Error_Pragma_Arg ("invalid argument for pragma%", Argx);
end if;
end Check_Arg_Is_One_Of;
+
---------------------------------
-- Check_Arg_Is_Queuing_Policy --
---------------------------------
@@ -6399,6 +6424,17 @@ package body Sem_Prag is
end if;
end Set_Ravenscar_Profile;
+ ----------------
+ -- S14_Pragma --
+ ----------------
+
+ procedure S14_Pragma is
+ begin
+ if not Formal_Extensions then
+ Error_Pragma ("pragma% requires the use of debug switch -gnatd.V");
+ end if;
+ end S14_Pragma;
+
-- Start of processing for Analyze_Pragma
begin
@@ -6759,19 +6795,30 @@ package body Sem_Prag is
end if;
end Annotate;
- ------------
- -- Assert --
- ------------
+ ---------------------------
+ -- Assert/Assert_And_Cut --
+ ---------------------------
+
+ -- pragma Assert
+ -- ( [Check => ] Boolean_EXPRESSION
+ -- [, [Message =>] Static_String_EXPRESSION]);
- -- pragma Assert ([Check =>] Boolean_EXPRESSION
- -- [, [Message =>] Static_String_EXPRESSION]);
+ -- pragma Assert_And_Cut
+ -- ( [Check => ] Boolean_EXPRESSION
+ -- [, [Message =>] Static_String_EXPRESSION]);
- when Pragma_Assert => Assert : declare
+ when Pragma_Assert | Pragma_Assert_And_Cut => Assert : declare
Expr : Node_Id;
Newa : List_Id;
begin
- Ada_2005_Pragma;
+ if Prag_Id = Pragma_Assert then
+ Ada_2005_Pragma;
+ else -- Pragma_Assert_And_Cut
+ GNAT_Pragma;
+ S14_Pragma;
+ end if;
+
Check_At_Least_N_Arguments (1);
Check_At_Most_N_Arguments (2);
Check_Arg_Order ((Name_Check, Name_Message));
@@ -6784,6 +6831,13 @@ package body Sem_Prag is
-- So rewrite pragma in this manner, transfer the message
-- argument if present, and analyze the result
+ -- Pragma Assert_And_Cut is treated exactly like pragma Assert by
+ -- the frontend. Formal verification tools may use it to "cut" the
+ -- paths through the code, to make verification tractable. When
+ -- dealing with a semantically analyzed tree, the information that
+ -- a Check node N corresponds to a source Assert_And_Cut pragma
+ -- can be retrieved from the pragma kind of Original_Node(N).
+
Expr := Get_Pragma_Arg (Arg1);
Newa := New_List (
Make_Pragma_Argument_Association (Loc,
@@ -6865,6 +6919,53 @@ package body Sem_Prag is
Assume_No_Invalid_Values := False;
end if;
+ --------------------------
+ -- Attribute_Definition --
+ --------------------------
+
+ -- pragma Attribute_Definition
+ -- ([Attribute =>] ATTRIBUTE_DESIGNATOR,
+ -- [Entity =>] LOCAL_NAME,
+ -- [Expression =>] EXPRESSION | NAME);
+
+ when Pragma_Attribute_Definition => Attribute_Definition : declare
+ Attribute_Designator : constant Node_Id := Get_Pragma_Arg (Arg1);
+ Aname : Name_Id;
+
+ begin
+ GNAT_Pragma;
+ Check_Arg_Count (3);
+ Check_Optional_Identifier (Arg1, "attribute");
+ Check_Optional_Identifier (Arg2, "entity");
+ Check_Optional_Identifier (Arg3, "expression");
+
+ if Nkind (Attribute_Designator) /= N_Identifier then
+ Error_Msg_N ("attribute name expected", Attribute_Designator);
+ return;
+ end if;
+
+ Check_Arg_Is_Local_Name (Arg2);
+
+ -- If the attribute is not recognized, then issue a warning (not
+ -- an error), and ignore the pragma.
+
+ Aname := Chars (Attribute_Designator);
+
+ if not Is_Attribute_Name (Aname) then
+ Bad_Attribute (Attribute_Designator, Aname, Warn => True);
+ return;
+ end if;
+
+ -- Otherwise, rewrite the pragma as an attribute definition clause
+
+ Rewrite (N,
+ Make_Attribute_Definition_Clause (Loc,
+ Name => Get_Pragma_Arg (Arg2),
+ Chars => Aname,
+ Expression => Get_Pragma_Arg (Arg3)));
+ Analyze (N);
+ end Attribute_Definition;
+
---------------
-- AST_Entry --
---------------
@@ -12022,6 +12123,53 @@ package body Sem_Prag is
when Pragma_Page =>
null;
+ ----------------------------------
+ -- Partition_Elaboration_Policy --
+ ----------------------------------
+
+ -- pragma Partition_Elaboration_Policy (policy_IDENTIFIER);
+
+ when Pragma_Partition_Elaboration_Policy => declare
+ subtype PEP_Range is Name_Id
+ range First_Partition_Elaboration_Policy_Name
+ .. Last_Partition_Elaboration_Policy_Name;
+ PEP_Val : PEP_Range;
+ PEP : Character;
+
+ begin
+ Ada_2005_Pragma;
+ Check_Arg_Count (1);
+ Check_No_Identifiers;
+ Check_Arg_Is_Partition_Elaboration_Policy (Arg1);
+ Check_Valid_Configuration_Pragma;
+ PEP_Val := Chars (Get_Pragma_Arg (Arg1));
+
+ case PEP_Val is
+ when Name_Concurrent =>
+ PEP := 'C';
+ when Name_Sequential =>
+ PEP := 'S';
+ end case;
+
+ if Partition_Elaboration_Policy /= ' '
+ and then Partition_Elaboration_Policy /= PEP
+ then
+ Error_Msg_Sloc := Partition_Elaboration_Policy_Sloc;
+ Error_Pragma
+ ("partition elaboration policy incompatible with policy#");
+
+ -- Set new policy, but always preserve System_Location since we
+ -- like the error message with the run time name.
+
+ else
+ Partition_Elaboration_Policy := PEP;
+
+ if Partition_Elaboration_Policy_Sloc /= System_Location then
+ Partition_Elaboration_Policy_Sloc := Loc;
+ end if;
+ end if;
+ end;
+
-------------
-- Passive --
-------------
@@ -13669,9 +13817,9 @@ package body Sem_Prag is
end;
end Stream_Convert;
- -------------------------
- -- Style_Checks (GNAT) --
- -------------------------
+ ------------------
+ -- Style_Checks --
+ ------------------
-- pragma Style_Checks (On | Off | ALL_CHECKS | STRING_LITERAL);
@@ -15185,8 +15333,10 @@ package body Sem_Prag is
Pragma_All_Calls_Remote => -1,
Pragma_Annotate => -1,
Pragma_Assert => -1,
+ Pragma_Assert_And_Cut => -1,
Pragma_Assertion_Policy => 0,
Pragma_Assume_No_Invalid_Values => 0,
+ Pragma_Attribute_Definition => +3,
Pragma_Asynchronous => -1,
Pragma_Atomic => 0,
Pragma_Atomic_Components => 0,
@@ -15294,6 +15444,7 @@ package body Sem_Prag is
Pragma_Ordered => 0,
Pragma_Pack => 0,
Pragma_Page => -1,
+ Pragma_Partition_Elaboration_Policy => -1,
Pragma_Passive => -1,
Pragma_Preelaborable_Initialization => -1,
Pragma_Polling => -1,
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 4383754fa31..defe37f3d4c 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -6115,9 +6115,7 @@ package body Sem_Res is
-- Check comparison on unordered enumeration
- if Comes_From_Source (N)
- and then Bad_Unordered_Enumeration_Reference (N, Etype (L))
- then
+ if Bad_Unordered_Enumeration_Reference (N, Etype (L)) then
Error_Msg_N ("comparison on unordered enumeration type?", N);
end if;
@@ -7157,12 +7155,13 @@ package body Sem_Res is
Resolve (Then_Expr, Typ);
Then_Typ := Etype (Then_Expr);
- -- When the "then" expression is of a scalar type different from the
- -- result type, then insert a conversion to ensure the generation of
- -- a constraint check.
+ -- When the "then" expression is of a scalar subtype different from the
+ -- result subtype, then insert a conversion to ensure the generation of
+ -- a constraint check. The same is done for the else part below, again
+ -- comparing subtypes rather than base types.
if Is_Scalar_Type (Then_Typ)
- and then Base_Type (Then_Typ) /= Base_Type (Typ)
+ and then Then_Typ /= Typ
then
Rewrite (Then_Expr, Convert_To (Typ, Then_Expr));
Analyze_And_Resolve (Then_Expr, Typ);
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 1c9eb645555..690e30fe5f4 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -36,6 +36,7 @@ with Fname; use Fname;
with Freeze; use Freeze;
with Lib; use Lib;
with Lib.Xref; use Lib.Xref;
+with Namet.Sp; use Namet.Sp;
with Nlists; use Nlists;
with Nmake; use Nmake;
with Output; use Output;
@@ -404,6 +405,33 @@ package body Sem_Util is
and then Scope_Depth (ST) >= Scope_Depth (SCT);
end Available_Full_View_Of_Component;
+ -------------------
+ -- Bad_Attribute --
+ -------------------
+
+ procedure Bad_Attribute
+ (N : Node_Id;
+ Nam : Name_Id;
+ Warn : Boolean := False)
+ is
+ begin
+ Error_Msg_Warn := Warn;
+ Error_Msg_N ("unrecognized attribute&<", N);
+
+ -- Check for possible misspelling
+
+ Error_Msg_Name_1 := First_Attribute_Name;
+ while Error_Msg_Name_1 <= Last_Attribute_Name loop
+ if Is_Bad_Spelling_Of (Nam, Error_Msg_Name_1) then
+ Error_Msg_N -- CODEFIX
+ ("\possible misspelling of %<", N);
+ exit;
+ end if;
+
+ Error_Msg_Name_1 := Error_Msg_Name_1 + 1;
+ end loop;
+ end Bad_Attribute;
+
--------------------------------
-- Bad_Predicated_Subtype_Use --
--------------------------------
diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads
index 1b089b85ee7..bf6486d464f 100644
--- a/gcc/ada/sem_util.ads
+++ b/gcc/ada/sem_util.ads
@@ -108,6 +108,14 @@ package Sem_Util is
-- are open, and the scope of the array is not outside the scope of the
-- component.
+ procedure Bad_Attribute
+ (N : Node_Id;
+ Nam : Name_Id;
+ Warn : Boolean := False);
+ -- Called when node N is expected to contain a valid attribute name, and
+ -- Nam is found instead. If Warn is set True this is a warning, else this
+ -- is an error.
+
procedure Bad_Predicated_Subtype_Use
(Msg : String;
N : Node_Id;
diff --git a/gcc/ada/sinfo-cn.adb b/gcc/ada/sinfo-cn.adb
index 69b4705ba25..f581eaaaa43 100644
--- a/gcc/ada/sinfo-cn.adb
+++ b/gcc/ada/sinfo-cn.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, 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- --
@@ -30,8 +30,8 @@
-- general manner, but in some specific cases, the fields of related nodes
-- have been deliberately layed out in a manner that permits such alteration.
-with Atree; use Atree;
-with Snames; use Snames;
+with Atree; use Atree;
+with Snames; use Snames;
package body Sinfo.CN is
diff --git a/gcc/ada/snames.adb-tmpl b/gcc/ada/snames.adb-tmpl
index 05d427743a8..9255395ffe4 100644
--- a/gcc/ada/snames.adb-tmpl
+++ b/gcc/ada/snames.adb-tmpl
@@ -419,6 +419,18 @@ package body Snames is
return N in First_Locking_Policy_Name .. Last_Locking_Policy_Name;
end Is_Locking_Policy_Name;
+ -------------------------------------
+ -- Is_Partition_Elaboration_Policy --
+ -------------------------------------
+
+ function Is_Partition_Elaboration_Policy_Name
+ (N : Name_Id) return Boolean
+ is
+ begin
+ return N in First_Partition_Elaboration_Policy_Name ..
+ Last_Partition_Elaboration_Policy_Name;
+ end Is_Partition_Elaboration_Policy_Name;
+
-----------------------------
-- Is_Operator_Symbol_Name --
-----------------------------
diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl
index 167d110749a..0fd39c34ef8 100644
--- a/gcc/ada/snames.ads-tmpl
+++ b/gcc/ada/snames.ads-tmpl
@@ -363,6 +363,7 @@ package Snames is
Name_Annotate : constant Name_Id := N + $; -- GNAT
Name_Assertion_Policy : constant Name_Id := N + $; -- Ada 05
Name_Assume_No_Invalid_Values : constant Name_Id := N + $; -- GNAT
+ Name_Attribute_Definition : constant Name_Id := N + $; -- GNAT
Name_C_Pass_By_Copy : constant Name_Id := N + $; -- GNAT
Name_Check_Name : constant Name_Id := N + $; -- GNAT
Name_Check_Policy : constant Name_Id := N + $; -- GNAT
@@ -409,6 +410,7 @@ package Snames is
Name_Normalize_Scalars : constant Name_Id := N + $;
Name_Optimize_Alignment : constant Name_Id := N + $; -- GNAT
Name_Overflow_Checks : constant Name_Id := N + $; -- GNAT
+ Name_Partition_Elaboration_Policy : constant Name_Id := N + $; -- Ada 05
Name_Persistent_BSS : constant Name_Id := N + $; -- GNAT
Name_Polling : constant Name_Id := N + $; -- GNAT
Name_Priority_Specific_Dispatching : constant Name_Id := N + $; -- Ada 05
@@ -448,6 +450,7 @@ package Snames is
-- correctly recognize and process Name_AST_Entry.
Name_Assert : constant Name_Id := N + $; -- Ada 05
+ Name_Assert_And_Cut : constant Name_Id := N + $; -- GNAT
Name_Asynchronous : constant Name_Id := N + $;
Name_Atomic : constant Name_Id := N + $;
Name_Atomic_Components : constant Name_Id := N + $;
@@ -1014,6 +1017,17 @@ package Snames is
Name_Round_Robin_Within_Priorities : constant Name_Id := N + $;
Last_Task_Dispatching_Policy_Name : constant Name_Id := N + $;
+ -- Names of recognized partition elaboration policy identifiers
+
+ -- Note: policies are identified by the first character of the name (e.g. S
+ -- for Sequential). If new policy names are added, the first character must
+ -- be distinct.
+
+ First_Partition_Elaboration_Policy_Name : constant Name_Id := N + $;
+ Name_Concurrent : constant Name_Id := N + $;
+ Name_Sequential : constant Name_Id := N + $;
+ Last_Partition_Elaboration_Policy_Name : constant Name_Id := N + $;
+
-- Names of recognized checks for pragma Suppress
-- Note: the name Atomic_Synchronization can only be specified internally
@@ -1633,6 +1647,7 @@ package Snames is
Pragma_Annotate,
Pragma_Assertion_Policy,
Pragma_Assume_No_Invalid_Values,
+ Pragma_Attribute_Definition,
Pragma_C_Pass_By_Copy,
Pragma_Check_Name,
Pragma_Check_Policy,
@@ -1665,6 +1680,7 @@ package Snames is
Pragma_Normalize_Scalars,
Pragma_Optimize_Alignment,
Pragma_Overflow_Checks,
+ Pragma_Partition_Elaboration_Policy,
Pragma_Persistent_BSS,
Pragma_Polling,
Pragma_Priority_Specific_Dispatching,
@@ -1697,6 +1713,7 @@ package Snames is
Pragma_Abort_Defer,
Pragma_All_Calls_Remote,
Pragma_Assert,
+ Pragma_Assert_And_Cut,
Pragma_Asynchronous,
Pragma_Atomic,
Pragma_Atomic_Components,
@@ -1900,6 +1917,11 @@ package Snames is
function Is_Locking_Policy_Name (N : Name_Id) return Boolean;
-- Test to see if the name N is the name of a recognized locking policy
+ function Is_Partition_Elaboration_Policy_Name
+ (N : Name_Id) return Boolean;
+ -- Test to see if the name N is the name of a recognized partition
+ -- elaboration policy.
+
function Is_Operator_Symbol_Name (N : Name_Id) return Boolean;
-- Test to see if the name N is the name of an operator symbol
@@ -1976,6 +1998,7 @@ private
pragma Inline (Is_Entity_Attribute_Name);
pragma Inline (Is_Type_Attribute_Name);
pragma Inline (Is_Locking_Policy_Name);
+ pragma Inline (Is_Partition_Elaboration_Policy_Name);
pragma Inline (Is_Operator_Symbol_Name);
pragma Inline (Is_Queuing_Policy_Name);
pragma Inline (Is_Pragma_Name);
diff --git a/gcc/ada/socket.c b/gcc/ada/socket.c
index ee1f760daab..18999b394ea 100644
--- a/gcc/ada/socket.c
+++ b/gcc/ada/socket.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 2003-2010, Free Software Foundation, Inc. *
+ * Copyright (C) 2003-2012, 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,7 +33,7 @@
#include "gsocket.h"
-#ifdef VMS
+#if defined(VMS)
/*
* For VMS, gsocket.h can't include sockets-related DEC C header files
* when building the runtime (because these files are in a DEC C text library
@@ -65,6 +65,10 @@ struct servent {
int s_port;
__netdb_char_ptr s_proto;
};
+#elif defined(__FreeBSD__)
+typedef unsigned int IOCTL_Req_T;
+#else
+typedef int IOCTL_Req_T;
#endif
#if defined(HAVE_SOCKETS)
@@ -98,7 +102,7 @@ extern fd_set *__gnat_new_socket_set (fd_set *);
extern void __gnat_remove_socket_from_set (fd_set *, int);
extern void __gnat_reset_socket_set (fd_set *);
extern int __gnat_get_h_errno (void);
-extern int __gnat_socket_ioctl (int, int, int *);
+extern int __gnat_socket_ioctl (int, IOCTL_Req_T, int *);
extern char * __gnat_servent_s_name (struct servent *);
extern char * __gnat_servent_s_alias (struct servent *, int index);
@@ -526,7 +530,7 @@ __gnat_get_h_errno (void) {
/* Wrapper for ioctl(2), which is a variadic function */
int
-__gnat_socket_ioctl (int fd, int req, int *arg) {
+__gnat_socket_ioctl (int fd, IOCTL_Req_T req, int *arg) {
#if defined (_WIN32)
return ioctlsocket (fd, req, arg);
#elif defined (__APPLE__)
diff --git a/gcc/ada/ug_words b/gcc/ada/ug_words
index a3ca962922a..b1b45c407cb 100644
--- a/gcc/ada/ug_words
+++ b/gcc/ada/ug_words
@@ -170,6 +170,8 @@ gcc -c ^ GNAT COMPILE
-gnatw.P ^ /WARNINGS=NO_PARAMETER_ORDER
-gnatw.h ^ /WARNINGS=OVERRIDING_SIZE
-gnatw.H ^ /WARNINGS=NOOVERRIDING_SIZE
+-gnatw.k ^ /WARNINGS=STANDARD_REDEFINITION
+-gnatw.K ^ /WARNINGS=NOSTANDARD_REDEFINITION
-gnatwq ^ /WARNINGS=MISSING_PARENS
-gnatwQ ^ /WARNINGS=NOMISSING_PARENS
-gnatwr ^ /WARNINGS=REDUNDANT
diff --git a/gcc/ada/usage.adb b/gcc/ada/usage.adb
index 2f858070340..7c9c4023bbe 100644
--- a/gcc/ada/usage.adb
+++ b/gcc/ada/usage.adb
@@ -435,6 +435,8 @@ begin
Write_Switch_Char ("wxx");
Write_Line ("Enable selected warning modes, xx = list of parameters:");
+ Write_Line (" * indicates default setting");
+ Write_Line (" + indicates warning flag included in -gnatwa");
Write_Line (" a turn on all info/warnings marked below with +");
Write_Line (" A turn off all optional info/warnings");
Write_Line (" .a*+ turn on warnings for failing assertion");
@@ -472,6 +474,8 @@ begin
"(annex J) feature");
Write_Line (" k+ turn on warnings on constant variable");
Write_Line (" K* turn off warnings on constant variable");
+ Write_Line (" .k turn on warnings for standard redefinition");
+ Write_Line (" .K* turn off warnings for standard redefinition");
Write_Line (" l turn on warnings for missing " &
"elaboration pragma");
Write_Line (" L* turn off warnings for missing " &
@@ -541,8 +545,6 @@ begin
"unchecked conversion");
Write_Line (" Z turn off warnings for suspicious " &
"unchecked conversion");
- Write_Line (" * indicates default in above list");
- Write_Line (" + indicates warning flag included in -gnatwa");
-- Line for -gnatW switch
diff --git a/gcc/ada/vms_data.ads b/gcc/ada/vms_data.ads
index c33bb8f71f6..8c1c1eb73ec 100644
--- a/gcc/ada/vms_data.ads
+++ b/gcc/ada/vms_data.ads
@@ -3070,6 +3070,10 @@ package VMS_Data is
"-gnatwk " &
"NOCONSTANT_VARIABLES " &
"-gnatwK " &
+ "STANDARD_REDEFINITION " &
+ "-gnatw.k " &
+ "NOSTANDARD_REDEFINITION " &
+ "-gnatw.K " &
"ELABORATION " &
"-gnatwl " &
"NOELABORATION " &
diff --git a/gcc/ada/warnsw.adb b/gcc/ada/warnsw.adb
index 8e2b1b6a879..7920ac90269 100644
--- a/gcc/ada/warnsw.adb
+++ b/gcc/ada/warnsw.adb
@@ -87,6 +87,7 @@ package body Warnsw is
Warn_On_Record_Holes := True;
Warn_On_Redundant_Constructs := True;
Warn_On_Reverse_Bit_Order := True;
+ Warn_On_Standard_Redefinition := True;
Warn_On_Suspicious_Contract := True;
Warn_On_Unchecked_Conversion := True;
Warn_On_Unordered_Enumeration_Type := True;
@@ -109,6 +110,12 @@ package body Warnsw is
when 'I' =>
Warn_On_Overlap := False;
+ when 'k' =>
+ Warn_On_Standard_Redefinition := True;
+
+ when 'K' =>
+ Warn_On_Standard_Redefinition := False;
+
when 'l' =>
List_Inherited_Aspects := True;
@@ -307,6 +314,7 @@ package body Warnsw is
Warn_On_Questionable_Missing_Parens := False;
Warn_On_Redundant_Constructs := False;
Warn_On_Reverse_Bit_Order := False;
+ Warn_On_Standard_Redefinition := False;
Warn_On_Suspicious_Contract := False;
Warn_On_Suspicious_Modulus_Value := False;
Warn_On_Unchecked_Conversion := False;
diff --git a/gcc/ada/warnsw.ads b/gcc/ada/warnsw.ads
index 9fd998bf457..f802bb7790a 100644
--- a/gcc/ada/warnsw.ads
+++ b/gcc/ada/warnsw.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1999-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1999-2012, 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,6 +47,10 @@ package Warnsw is
-- set with an explicit size clause. Off by default, set by -gnatw.s (but
-- not -gnatwa).
+ Warn_On_Standard_Redefinition : Boolean := False;
+ -- Warn when a program defines an identifier that matches a name in
+ -- Standard. Off by default, set by -gnatw.k (and also by -gnatwa).
+
-----------------
-- Subprograms --
-----------------
diff --git a/gcc/ada/xoscons.adb b/gcc/ada/xoscons.adb
index 90d1b2d4de7..ec452c34406 100644
--- a/gcc/ada/xoscons.adb
+++ b/gcc/ada/xoscons.adb
@@ -23,16 +23,18 @@
-- --
------------------------------------------------------------------------------
--- This program generates the spec of System.OS_Constants (s-oscons.ads)
+-- The base name of the template file is given by Argument (1). This program
+-- generates the spec for this specified unit (let's call it UNIT_NAME).
-- It works in conjunction with a C template file which must be pre-processed
-- and compiled using the cross compiler. Two input files are used:
--- - the preprocessed C file: s-oscons-tmplt.i
--- - the generated assembly file: s-oscons-tmplt.s
+-- - the preprocessed C file: UNIT_NAME-tmplt.i
+-- - the generated assembly file: UNIT_NAME-tmplt.s
--- The contents of s-oscons.ads is written on standard output
+-- The generated files are UNIT_NAME.ads and UNIT_NAME.h
with Ada.Characters.Handling; use Ada.Characters.Handling;
+with Ada.Command_Line; use Ada.Command_Line;
with Ada.Exceptions; use Ada.Exceptions;
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
with Ada.Text_IO; use Ada.Text_IO;
@@ -52,7 +54,7 @@ procedure XOSCons is
use ASCII;
use Ada.Strings;
- Unit_Name : constant String := "s-oscons";
+ Unit_Name : constant String := Argument (1);
Tmpl_Name : constant String := Unit_Name & "-tmplt";
-------------------------------------------------
@@ -76,6 +78,7 @@ procedure XOSCons is
CNU, -- Named number (decimal, unsigned)
CNS, -- Named number (freeform text)
C, -- Constant object
+ SUB, -- Subtype
TXT); -- Literal text
-- Recognized markers found in assembly file. These markers are produced by
-- the same-named macros from the C template.
@@ -181,65 +184,84 @@ procedure XOSCons is
-- Start of processing for Output_Info
begin
- -- Case of non-TXT case (TXT case handled by common code below)
+ case Info.Kind is
+ when TXT =>
- if Info.Kind /= TXT then
- case Lang is
- when Lang_Ada =>
- Put (" " & Info.Constant_Name.all);
- Put (Spaces (Max_Constant_Name_Len
- - Info.Constant_Name'Length));
+ -- Handled in the common code for comments below
- if Info.Kind in Named_Number then
- Put (" : constant := ");
- else
- Put (" : constant " & Info.Constant_Type.all);
- Put (Spaces (Max_Constant_Type_Len
- - Info.Constant_Type'Length));
- Put (" := ");
- end if;
+ null;
- when Lang_C =>
- Put ("#define " & Info.Constant_Name.all & " ");
- Put (Spaces (Max_Constant_Name_Len
- - Info.Constant_Name'Length));
- end case;
+ when SUB =>
+ case Lang is
+ when Lang_Ada =>
+ Put (" subtype " & Info.Constant_Name.all
+ & " is Interfaces.C."
+ & Info.Text_Value.all & ";");
+ when Lang_C =>
+ Put ("#define " & Info.Constant_Name.all & " "
+ & Info.Text_Value.all);
+ end case;
- if Info.Kind in Asm_Int_Kind then
- if not Info.Int_Value.Positive then
- Put ("-");
- end if;
+ when others =>
- Put (Trim (Info.Int_Value.Abs_Value'Img, Side => Left));
+ -- All named number cases
+
+ case Lang is
+ when Lang_Ada =>
+ Put (" " & Info.Constant_Name.all);
+ Put (Spaces (Max_Constant_Name_Len
+ - Info.Constant_Name'Length));
+
+ if Info.Kind in Named_Number then
+ Put (" : constant := ");
+ else
+ Put (" : constant " & Info.Constant_Type.all);
+ Put (Spaces (Max_Constant_Type_Len
+ - Info.Constant_Type'Length));
+ Put (" := ");
+ end if;
- else
- declare
- Is_String : constant Boolean :=
- Info.Kind = C
- and then Info.Constant_Type.all = "String";
-
- begin
- if Is_String then
- Put ("""");
+ when Lang_C =>
+ Put ("#define " & Info.Constant_Name.all & " ");
+ Put (Spaces (Max_Constant_Name_Len
+ - Info.Constant_Name'Length));
+ end case;
+
+ if Info.Kind in Asm_Int_Kind then
+ if not Info.Int_Value.Positive then
+ Put ("-");
end if;
- Put (Info.Text_Value.all);
+ Put (Trim (Info.Int_Value.Abs_Value'Img, Side => Left));
- if Is_String then
- Put ("""");
- end if;
- end;
- end if;
+ else
+ declare
+ Is_String : constant Boolean :=
+ Info.Kind = C
+ and then Info.Constant_Type.all = "String";
+
+ begin
+ if Is_String then
+ Put ("""");
+ end if;
- if Lang = Lang_Ada then
- Put (";");
+ Put (Info.Text_Value.all);
- if Info.Comment'Length > 0 then
- Put (Spaces (Max_Constant_Value_Len - Info.Value_Len));
- Put (" -- ");
+ if Is_String then
+ Put ("""");
+ end if;
+ end;
end if;
- end if;
- end if;
+
+ if Lang = Lang_Ada then
+ Put (";");
+
+ if Info.Comment'Length > 0 then
+ Put (Spaces (Max_Constant_Value_Len - Info.Value_Len));
+ Put (" -- ");
+ end if;
+ end if;
+ end case;
if Lang = Lang_Ada then
Put (Info.Comment.all);
@@ -294,8 +316,8 @@ procedure XOSCons is
(S : String;
K : Asm_Int_Kind) return Int_Value_Type
is
- First : Integer := S'First;
- Result : Int_Value_Type;
+ First : Integer := S'First;
+ Result : Int_Value_Type;
begin
-- On some platforms, immediate integer values are prefixed with
@@ -349,13 +371,16 @@ procedure XOSCons is
Integer (Parse_Int (Line (Index1 .. Index2 - 1), CNU).Abs_Value);
case Info.Kind is
- when CND | CNU | CNS | C =>
+ when CND | CNU | CNS | C | SUB =>
Index1 := Index2 + 1;
Find_Colon (Index2);
Info.Constant_Name := Field_Alloc;
- if Info.Constant_Name'Length > Max_Constant_Name_Len then
+ if Info.Kind /= SUB
+ and then
+ Info.Constant_Name'Length > Max_Constant_Name_Len
+ then
Max_Constant_Name_Len := Info.Constant_Name'Length;
end if;
@@ -536,4 +561,7 @@ begin
Close (Tmpl_File);
+exception
+ when others =>
+ Put_Line ("xoscons <base_name>");
end XOSCons;
diff --git a/gcc/ada/xr_tabls.adb b/gcc/ada/xr_tabls.adb
index eea7fcbc97f..61ac67523b0 100644
--- a/gcc/ada/xr_tabls.adb
+++ b/gcc/ada/xr_tabls.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2012, 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- --
@@ -223,6 +223,7 @@ package body Xr_Tabls is
Line : Natural;
Column : Natural;
Decl_Type : Character;
+ Is_Parameter : Boolean := False;
Remove_Only : Boolean := False;
Symbol_Match : Boolean := True)
return Declaration_Reference
@@ -235,7 +236,7 @@ package body Xr_Tabls is
New_Decl : Declaration_Reference :=
Entities_HTable.Get (Key'Unchecked_Access);
- Is_Parameter : Boolean := False;
+ Is_Param : Boolean := Is_Parameter;
begin
-- Insert the Declaration in the table. There might already be a
@@ -243,7 +244,7 @@ package body Xr_Tabls is
-- need to check that first.
if New_Decl /= null and then New_Decl.Symbol_Length = 0 then
- Is_Parameter := New_Decl.Is_Parameter;
+ Is_Param := Is_Parameter or else New_Decl.Is_Parameter;
Entities_HTable.Remove (Key'Unrestricted_Access);
Entities_Count := Entities_Count - 1;
Free (New_Decl.Key);
@@ -269,7 +270,7 @@ package body Xr_Tabls is
Column => Column,
Source_Line => null,
Next => null),
- Is_Parameter => Is_Parameter,
+ Is_Parameter => Is_Param,
Decl_Type => Decl_Type,
Body_Ref => null,
Ref_Ref => null,
@@ -294,6 +295,10 @@ package body Xr_Tabls is
then
New_Decl.Match := Default_Match
or else Match (File_Ref, Line, Column);
+ New_Decl.Is_Parameter := New_Decl.Is_Parameter or Is_Param;
+
+ elsif New_Decl /= null then
+ New_Decl.Is_Parameter := New_Decl.Is_Parameter or Is_Param;
end if;
return New_Decl;
@@ -392,6 +397,8 @@ package body Xr_Tabls is
Labels_As_Ref : Boolean)
is
New_Ref : Reference;
+ New_Decl : Declaration_Reference;
+ pragma Unreferenced (New_Decl);
begin
case Ref_Type is
@@ -406,37 +413,23 @@ package body Xr_Tabls is
when '=' | '<' | '>' | '^' =>
- -- Create a dummy declaration in the table to report it as a
- -- parameter. Note that the current declaration for the subprogram
- -- comes before the declaration of the parameter.
-
- declare
- Key : constant String :=
- Key_From_Ref (File_Ref, Line, Column);
- New_Decl : Declaration_Reference;
-
- begin
- New_Decl := new Declaration_Record'
- (Symbol_Length => 0,
- Symbol => "",
- Key => new String'(Key),
- Decl => new Reference_Record'
- (File => File_Ref,
- Line => Line,
- Column => Column,
- Source_Line => null,
- Next => null),
- Is_Parameter => True,
- Decl_Type => ' ',
- Body_Ref => null,
- Ref_Ref => null,
- Modif_Ref => null,
- Match => False,
- Par_Symbol => null,
- Next => null);
- Entities_HTable.Set (New_Decl);
- Entities_Count := Entities_Count + 1;
- end;
+ -- Create dummy declaration in table to report it as a parameter
+
+ -- In a given ALI file, the declaration of the subprogram comes
+ -- before the declaration of the parameter. However, it is
+ -- possible that another ALI file has been parsed that also
+ -- references the parameter (for instance a named parameter in
+ -- a call), so we need to check whether there already exists a
+ -- declaration for the parameter.
+
+ New_Decl :=
+ Add_Declaration
+ (File_Ref => File_Ref,
+ Symbol => "",
+ Line => Line,
+ Column => Column,
+ Decl_Type => ' ',
+ Is_Parameter => True);
when 'e' | 'z' | 't' | 'p' | 'P' | 'k' | 'd' =>
return;
diff --git a/gcc/ada/xr_tabls.ads b/gcc/ada/xr_tabls.ads
index d5e9c5ee67c..b328b82b903 100644
--- a/gcc/ada/xr_tabls.ads
+++ b/gcc/ada/xr_tabls.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1998-2008, Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2012, 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- --
@@ -78,6 +78,7 @@ package Xr_Tabls is
Line : Natural;
Column : Natural;
Decl_Type : Character;
+ Is_Parameter : Boolean := False;
Remove_Only : Boolean := False;
Symbol_Match : Boolean := True)
return Declaration_Reference;
@@ -87,8 +88,9 @@ package Xr_Tabls is
-- removed, but the new entity is never inserted. Symbol_Match should be
-- set to False if the name of the symbol doesn't match the pattern from
-- the command line. In that case, the entity will not be output by
- -- gnatfind. If Symbol_Match is True, the entity will only be output if the
- -- file name itself matches.
+ -- gnatfind. If Symbol_Match is True, the entity will only be output if
+ -- the file name itself matches. Is_Parameter should be set to True if
+ -- the entity is known to be a subprogram parameter.
procedure Add_Parent
(Declaration : in out Declaration_Reference;
diff --git a/gcc/alias.c b/gcc/alias.c
index c5e64176313..af482eecc66 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -2869,7 +2869,7 @@ init_alias_analysis (void)
memset (new_reg_base_value, 0, maxreg * sizeof (rtx));
/* Wipe the reg_seen array clean. */
- sbitmap_zero (reg_seen);
+ bitmap_clear (reg_seen);
/* Mark all hard registers which may contain an address.
The stack, frame and argument pointers may contain an address.
diff --git a/gcc/alloc-pool.c b/gcc/alloc-pool.c
index bedcf1f8bff..68d66ee1b93 100644
--- a/gcc/alloc-pool.c
+++ b/gcc/alloc-pool.c
@@ -22,7 +22,7 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#include "system.h"
#include "alloc-pool.h"
-#include "hashtab.h"
+#include "hash-table.h"
#define align_eight(x) (((x+7) >> 3) << 3)
@@ -83,38 +83,42 @@ struct alloc_pool_descriptor
int elt_size;
};
+struct alloc_pool_hasher : typed_noop_remove <alloc_pool_descriptor>
+{
+ typedef alloc_pool_descriptor value_type;
+ typedef char compare_type;
+ static inline hashval_t hash (const alloc_pool_descriptor *);
+ static inline bool equal (const value_type *, const compare_type *);
+};
+
/* Hashtable mapping alloc_pool names to descriptors. */
-static htab_t alloc_pool_hash;
+static hash_table <alloc_pool_hasher> alloc_pool_hash;
/* Hashtable helpers. */
-static hashval_t
-hash_descriptor (const void *p)
+inline hashval_t
+alloc_pool_hasher::hash (const value_type *d)
{
- const struct alloc_pool_descriptor *const d =
- (const struct alloc_pool_descriptor * )p;
return htab_hash_pointer (d->name);
}
-static int
-eq_descriptor (const void *p1, const void *p2)
+
+inline bool
+alloc_pool_hasher::equal (const value_type *d,
+ const compare_type *p2)
{
- const struct alloc_pool_descriptor *const d =
- (const struct alloc_pool_descriptor *) p1;
return d->name == p2;
}
/* For given name, return descriptor, create new if needed. */
static struct alloc_pool_descriptor *
-alloc_pool_descriptor (const char *name)
+allocate_pool_descriptor (const char *name)
{
struct alloc_pool_descriptor **slot;
- if (!alloc_pool_hash)
- alloc_pool_hash = htab_create (10, hash_descriptor, eq_descriptor, NULL);
+ if (!alloc_pool_hash.is_created ())
+ alloc_pool_hash.create (10);
- slot = (struct alloc_pool_descriptor **)
- htab_find_slot_with_hash (alloc_pool_hash, name,
- htab_hash_pointer (name),
- INSERT);
+ slot = alloc_pool_hash.find_slot_with_hash (name,
+ htab_hash_pointer (name), INSERT);
if (*slot)
return *slot;
*slot = XCNEW (struct alloc_pool_descriptor);
@@ -158,7 +162,7 @@ create_alloc_pool (const char *name, size_t size, size_t num)
if (GATHER_STATISTICS)
{
- struct alloc_pool_descriptor *desc = alloc_pool_descriptor (name);
+ struct alloc_pool_descriptor *desc = allocate_pool_descriptor (name);
desc->elt_size = size;
desc->created++;
}
@@ -205,7 +209,7 @@ empty_alloc_pool (alloc_pool pool)
if (GATHER_STATISTICS)
{
- struct alloc_pool_descriptor *desc = alloc_pool_descriptor (pool->name);
+ struct alloc_pool_descriptor *desc = allocate_pool_descriptor (pool->name);
desc->current -= (pool->elts_allocated - pool->elts_free) * pool->elt_size;
}
@@ -253,7 +257,7 @@ pool_alloc (alloc_pool pool)
if (GATHER_STATISTICS)
{
- struct alloc_pool_descriptor *desc = alloc_pool_descriptor (pool->name);
+ struct alloc_pool_descriptor *desc = allocate_pool_descriptor (pool->name);
desc->allocated += pool->elt_size;
desc->current += pool->elt_size;
@@ -357,7 +361,7 @@ pool_free (alloc_pool pool, void *ptr)
if (GATHER_STATISTICS)
{
- struct alloc_pool_descriptor *desc = alloc_pool_descriptor (pool->name);
+ struct alloc_pool_descriptor *desc = allocate_pool_descriptor (pool->name);
desc->current -= pool->elt_size;
}
}
@@ -371,19 +375,20 @@ struct output_info
unsigned long total_allocated;
};
-/* Called via htab_traverse. Output alloc_pool descriptor pointed out by SLOT
- and update statistics. */
-static int
-print_statistics (void **slot, void *b)
+/* Called via hash_table.traverse. Output alloc_pool descriptor pointed out by
+ SLOT and update statistics. */
+int
+print_alloc_pool_statistics (alloc_pool_descriptor **slot,
+ struct output_info *i)
{
- struct alloc_pool_descriptor *d = (struct alloc_pool_descriptor *) *slot;
- struct output_info *i = (struct output_info *) b;
+ struct alloc_pool_descriptor *d = *slot;
if (d->allocated)
{
- fprintf (stderr, "%-22s %6d %10lu %10lu(%10lu) %10lu(%10lu) %10lu(%10lu)\n", d->name,
- d->elt_size, d->created, d->allocated, d->allocated / d->elt_size,
- d->peak, d->peak / d->elt_size,
+ fprintf (stderr,
+ "%-22s %6d %10lu %10lu(%10lu) %10lu(%10lu) %10lu(%10lu)\n",
+ d->name, d->elt_size, d->created, d->allocated,
+ d->allocated / d->elt_size, d->peak, d->peak / d->elt_size,
d->current, d->current / d->elt_size);
i->total_allocated += d->allocated;
i->total_created += d->created;
@@ -400,14 +405,15 @@ dump_alloc_pool_statistics (void)
if (! GATHER_STATISTICS)
return;
- if (!alloc_pool_hash)
+ if (!alloc_pool_hash.is_created ())
return;
fprintf (stderr, "\nAlloc-pool Kind Elt size Pools Allocated (elts) Peak (elts) Leak (elts)\n");
fprintf (stderr, "--------------------------------------------------------------------------------------------------------------\n");
info.total_created = 0;
info.total_allocated = 0;
- htab_traverse (alloc_pool_hash, print_statistics, &info);
+ alloc_pool_hash.traverse <struct output_info *,
+ print_alloc_pool_statistics> (&info);
fprintf (stderr, "--------------------------------------------------------------------------------------------------------------\n");
fprintf (stderr, "%-22s %7lu %10lu\n",
"Total", info.total_created, info.total_allocated);
diff --git a/gcc/bitmap.h b/gcc/bitmap.h
index 3e369b077c6..7ed5d745d1e 100644
--- a/gcc/bitmap.h
+++ b/gcc/bitmap.h
@@ -211,7 +211,10 @@ extern bool bitmap_intersect_p (const_bitmap, const_bitmap);
extern bool bitmap_intersect_compl_p (const_bitmap, const_bitmap);
/* True if MAP is an empty bitmap. */
-#define bitmap_empty_p(MAP) (!(MAP)->first)
+inline bool bitmap_empty_p (const_bitmap map)
+{
+ return !map->first;
+}
/* True if the bitmap has only a single bit set. */
extern bool bitmap_single_bit_set_p (const_bitmap);
@@ -288,8 +291,11 @@ extern bitmap bitmap_gc_alloc_stat (ALONE_MEM_STAT_DECL);
extern void bitmap_obstack_free (bitmap);
/* A few compatibility/functions macros for compatibility with sbitmaps */
-#define dump_bitmap(file, bitmap) bitmap_print (file, bitmap, "", "\n")
-#define bitmap_zero(a) bitmap_clear (a)
+inline void dump_bitmap (FILE *file, const_bitmap map)
+{
+ bitmap_print (file, map, "", "\n");
+}
+
extern unsigned bitmap_first_set_bit (const_bitmap);
extern unsigned bitmap_last_set_bit (const_bitmap);
diff --git a/gcc/bt-load.c b/gcc/bt-load.c
index 385bc6c45ac..2aeb1c0f023 100644
--- a/gcc/bt-load.c
+++ b/gcc/bt-load.c
@@ -436,7 +436,7 @@ note_btr_set (rtx dest, const_rtx set ATTRIBUTE_UNUSED, void *data)
note_other_use_this_block (regno, info->users_this_bb);
SET_HARD_REG_BIT (info->btrs_written_in_block, regno);
SET_HARD_REG_BIT (info->btrs_live_in_block, regno);
- sbitmap_difference (info->bb_gen, info->bb_gen,
+ bitmap_and_compl (info->bb_gen, info->bb_gen,
info->btr_defset[regno - first_btr]);
}
}
@@ -457,7 +457,7 @@ compute_defs_uses_and_gen (fibheap_t all_btr_defs, btr_def *def_array,
btr_def_group all_btr_def_groups = NULL;
defs_uses_info info;
- sbitmap_vector_zero (bb_gen, last_basic_block);
+ bitmap_vector_clear (bb_gen, last_basic_block);
for (i = NUM_FIXED_BLOCKS; i < last_basic_block; i++)
{
basic_block bb = BASIC_BLOCK (i);
@@ -497,7 +497,7 @@ compute_defs_uses_and_gen (fibheap_t all_btr_defs, btr_def *def_array,
def_array[insn_uid] = def;
SET_HARD_REG_BIT (info.btrs_written_in_block, regno);
SET_HARD_REG_BIT (info.btrs_live_in_block, regno);
- sbitmap_difference (bb_gen[i], bb_gen[i],
+ bitmap_and_compl (bb_gen[i], bb_gen[i],
btr_defset[regno - first_btr]);
SET_BIT (bb_gen[i], insn_uid);
def->next_this_bb = defs_this_bb;
@@ -519,7 +519,7 @@ compute_defs_uses_and_gen (fibheap_t all_btr_defs, btr_def *def_array,
user->other_use_this_block = 1;
IOR_HARD_REG_SET (info.btrs_written_in_block, all_btrs);
IOR_HARD_REG_SET (info.btrs_live_in_block, all_btrs);
- sbitmap_zero (info.bb_gen);
+ bitmap_clear (info.bb_gen);
}
else
{
@@ -618,13 +618,13 @@ compute_kill (sbitmap *bb_kill, sbitmap *btr_defset,
/* For each basic block, form the set BB_KILL - the set
of definitions that the block kills. */
- sbitmap_vector_zero (bb_kill, last_basic_block);
+ bitmap_vector_clear (bb_kill, last_basic_block);
for (i = NUM_FIXED_BLOCKS; i < last_basic_block; i++)
{
for (regno = first_btr; regno <= last_btr; regno++)
if (TEST_HARD_REG_BIT (all_btrs, regno)
&& TEST_HARD_REG_BIT (btrs_written[i], regno))
- sbitmap_a_or_b (bb_kill[i], bb_kill[i],
+ bitmap_ior (bb_kill[i], bb_kill[i],
btr_defset[regno - first_btr]);
}
}
@@ -643,7 +643,7 @@ compute_out (sbitmap *bb_out, sbitmap *bb_gen, sbitmap *bb_kill, int max_uid)
sbitmap bb_in = sbitmap_alloc (max_uid);
for (i = NUM_FIXED_BLOCKS; i < last_basic_block; i++)
- sbitmap_copy (bb_out[i], bb_gen[i]);
+ bitmap_copy (bb_out[i], bb_gen[i]);
changed = 1;
while (changed)
@@ -652,7 +652,7 @@ compute_out (sbitmap *bb_out, sbitmap *bb_gen, sbitmap *bb_kill, int max_uid)
for (i = NUM_FIXED_BLOCKS; i < last_basic_block; i++)
{
sbitmap_union_of_preds (bb_in, bb_out, BASIC_BLOCK (i));
- changed |= sbitmap_union_of_diff_cg (bb_out[i], bb_gen[i],
+ changed |= bitmap_ior_and_compl (bb_out[i], bb_gen[i],
bb_in, bb_kill[i]);
}
}
@@ -689,7 +689,7 @@ link_btr_uses (btr_def *def_array, btr_user *use_array, sbitmap *bb_out,
{
/* Remove all reaching defs of regno except
for this one. */
- sbitmap_difference (reaching_defs, reaching_defs,
+ bitmap_and_compl (reaching_defs, reaching_defs,
btr_defset[def->btr - first_btr]);
SET_BIT(reaching_defs, insn_uid);
}
@@ -702,7 +702,7 @@ link_btr_uses (btr_def *def_array, btr_user *use_array, sbitmap *bb_out,
sbitmap_iterator sbi;
if (user->use)
- sbitmap_a_and_b (
+ bitmap_and (
reaching_defs_of_reg,
reaching_defs,
btr_defset[REGNO (user->use) - first_btr]);
@@ -710,12 +710,12 @@ link_btr_uses (btr_def *def_array, btr_user *use_array, sbitmap *bb_out,
{
int reg;
- sbitmap_zero (reaching_defs_of_reg);
+ bitmap_clear (reaching_defs_of_reg);
for (reg = first_btr; reg <= last_btr; reg++)
if (TEST_HARD_REG_BIT (all_btrs, reg)
&& refers_to_regno_p (reg, reg + 1, user->insn,
NULL))
- sbitmap_a_or_b_and_c (reaching_defs_of_reg,
+ bitmap_or_and (reaching_defs_of_reg,
reaching_defs_of_reg,
reaching_defs,
btr_defset[reg - first_btr]);
@@ -763,7 +763,7 @@ link_btr_uses (btr_def *def_array, btr_user *use_array, sbitmap *bb_out,
for (regno = first_btr; regno <= last_btr; regno++)
if (TEST_HARD_REG_BIT (all_btrs, regno)
&& TEST_HARD_REG_BIT (call_used_reg_set, regno))
- sbitmap_difference (reaching_defs, reaching_defs,
+ bitmap_and_compl (reaching_defs, reaching_defs,
btr_defset[regno - first_btr]);
}
}
@@ -785,7 +785,7 @@ build_btr_def_use_webs (fibheap_t all_btr_defs)
sbitmap *bb_kill;
sbitmap *bb_out;
- sbitmap_vector_zero (btr_defset, (last_btr - first_btr) + 1);
+ bitmap_vector_clear (btr_defset, (last_btr - first_btr) + 1);
compute_defs_uses_and_gen (all_btr_defs, def_array, use_array, btr_defset,
bb_gen, btrs_written);
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index cf43137f444..f7c942216bc 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,19 @@
+2012-10-29 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ PR c++/54930
+ * c.opt (Wreturn_local_addr): Define new option.
+
+2012-10-25 Jason Merrill <jason@redhat.com>
+
+ * c.opt (Wvirtual-move-assign): New.
+
+ * c.opt (Winherited-variadic-ctor): New.
+
+2012-10-25 Marc Glisse <marc.glisse@inria.fr>
+
+ PR c++/54427
+ * c-common.c (scalar_to_vector): Handle VEC_COND_EXPR.
+
2012-10-23 Joseph Myers <joseph@codesourcery.com>
* c-common.h (pch_cpp_save_state): Declare.
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 34cfb98f85b..840bc84c6d2 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -11474,6 +11474,8 @@ scalar_to_vector (location_t loc, enum tree_code code, tree op0, tree op1,
integer_only_op = true;
/* ... fall through ... */
+ case VEC_COND_EXPR:
+
case PLUS_EXPR:
case MINUS_EXPR:
case MULT_EXPR:
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index d2a97ab1019..06d6e363c98 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -426,6 +426,10 @@ Warn when a declaration does not specify a type
Wimport
C ObjC C++ ObjC++ Undocumented Ignore
+Winherited-variadic-ctor
+C++ ObjC++ Var(warn_inh_var_ctor) Init(1) Warning
+Warn about C++11 inheriting constructors when the base has a variadic constructor
+
Wint-to-pointer-cast
C ObjC C++ ObjC++ Var(warn_int_to_pointer_cast) Init(1) Warning
Warn when there is a cast to a pointer from an integer of a different size
@@ -609,6 +613,10 @@ Wreorder
C++ ObjC++ Var(warn_reorder) Warning LangEnabledBy(C++ ObjC++,Wall)
Warn when the compiler reorders code
+Wreturn-local-addr
+C ObjC C++ ObjC++ Var(warn_return_local_addr) Init(1) Warning
+Warn about returning a pointer/reference to a local or temporary variable.
+
Wreturn-type
C ObjC C++ ObjC++ Var(warn_return_type) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
Warn whenever a function's return type defaults to \"int\" (C), or about inconsistent return types (C++)
@@ -737,6 +745,10 @@ Wvolatile-register-var
C ObjC C++ ObjC++ Var(warn_volatile_register_var) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
Warn when a register variable is declared volatile
+Wvirtual-move-assign
+C++ ObjC++ Var(warn_virtual_move_assign) Warning Init(1)
+Warn if a virtual base has a non-trivial move assignment operator
+
Wwrite-strings
C ObjC C++ ObjC++ Var(warn_write_strings) Warning
In C++, nonzero means warn about deprecated conversion from string literals to 'char *'. In C, similar warning, except that the conversion is of course not deprecated by the ISO C standard.
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 89d89f7aca2..cd3a457d953 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,15 @@
+2012-10-29 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ PR c++/54930
+ * c-typeck.c (c_finish_return): Use OPT_Wreturn_local_addr.
+
+2012-10-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ PR c/53066
+ * c-decl.c (warn_if_shadowing): Do not warn if a variable
+ shadows a function, unless the variable is a function or a
+ pointer-to-function.
+
2012-10-12 Jakub Jelinek <jakub@redhat.com>
PR c/54381
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index 80867caa183..f03146690e1 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -2561,8 +2561,18 @@ warn_if_shadowing (tree new_decl)
warning (OPT_Wshadow, "declaration of %q+D shadows a parameter",
new_decl);
else if (DECL_FILE_SCOPE_P (old_decl))
- warning (OPT_Wshadow, "declaration of %q+D shadows a global "
- "declaration", new_decl);
+ {
+ /* Do not warn if a variable shadows a function, unless
+ the variable is a function or a pointer-to-function. */
+ if (TREE_CODE (old_decl) == FUNCTION_DECL
+ && TREE_CODE (new_decl) != FUNCTION_DECL
+ && !FUNCTION_POINTER_TYPE_P (TREE_TYPE (new_decl)))
+ continue;
+
+ warning_at (DECL_SOURCE_LOCATION (new_decl), OPT_Wshadow,
+ "declaration of %qD shadows a global declaration",
+ new_decl);
+ }
else if (TREE_CODE (old_decl) == FUNCTION_DECL
&& DECL_BUILT_IN (old_decl))
{
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 4855933c181..cf63355f614 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -8742,7 +8742,8 @@ c_finish_return (location_t loc, tree retval, tree origtype)
&& !TREE_STATIC (inner)
&& DECL_CONTEXT (inner) == current_function_decl)
warning_at (loc,
- 0, "function returns address of local variable");
+ OPT_Wreturn_local_addr, "function returns address "
+ "of local variable");
break;
default:
diff --git a/gcc/calls.c b/gcc/calls.c
index 01706c3e79a..fb520c6906c 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -1822,7 +1822,7 @@ mem_overlaps_already_clobbered_arg_p (rtx addr, unsigned HOST_WIDE_INT size)
HOST_WIDE_INT i;
rtx val;
- if (sbitmap_empty_p (stored_args_map))
+ if (bitmap_empty_p (stored_args_map))
return false;
val = internal_arg_pointer_based_exp (addr, true);
if (val == NULL_RTX)
@@ -2749,7 +2749,7 @@ expand_call (tree exp, rtx target, int ignore)
= plus_constant (Pmode, argblock, -crtl->args.pretend_args_size);
#endif
stored_args_map = sbitmap_alloc (args_size.constant);
- sbitmap_zero (stored_args_map);
+ bitmap_clear (stored_args_map);
}
/* If we have no actual push instructions, or shouldn't use them,
diff --git a/gcc/cfg.c b/gcc/cfg.c
index f0b91e09492..89c0d877034 100644
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -988,19 +988,21 @@ struct htab_bb_copy_original_entry
struct bb_copy_hasher : typed_noop_remove <htab_bb_copy_original_entry>
{
- typedef htab_bb_copy_original_entry T;
- static inline hashval_t hash (const T *);
- static inline bool equal (const T *existing, const T * candidate);
+ typedef htab_bb_copy_original_entry value_type;
+ typedef htab_bb_copy_original_entry compare_type;
+ static inline hashval_t hash (const value_type *);
+ static inline bool equal (const value_type *existing,
+ const compare_type * candidate);
};
inline hashval_t
-bb_copy_hasher::hash (const T *data)
+bb_copy_hasher::hash (const value_type *data)
{
return data->index1;
}
inline bool
-bb_copy_hasher::equal (const T *data, const T *data2)
+bb_copy_hasher::equal (const value_type *data, const compare_type *data2)
{
return data->index1 == data2->index1;
}
diff --git a/gcc/cfganal.c b/gcc/cfganal.c
index 7cf9ca85606..58c763f8454 100644
--- a/gcc/cfganal.c
+++ b/gcc/cfganal.c
@@ -84,7 +84,7 @@ mark_dfs_back_edges (void)
visited = sbitmap_alloc (last_basic_block);
/* None of the nodes in the CFG have been visited yet. */
- sbitmap_zero (visited);
+ bitmap_clear (visited);
/* Push the first edge on to the stack. */
stack[sp++] = ei_start (ENTRY_BLOCK_PTR->succs);
@@ -501,7 +501,7 @@ post_order_compute (int *post_order, bool include_entry_exit,
visited = sbitmap_alloc (last_basic_block);
/* None of the nodes in the CFG have been visited yet. */
- sbitmap_zero (visited);
+ bitmap_clear (visited);
/* Push the first edge on to the stack. */
stack[sp++] = ei_start (ENTRY_BLOCK_PTR->succs);
@@ -597,7 +597,7 @@ static basic_block
dfs_find_deadend (basic_block bb)
{
sbitmap visited = sbitmap_alloc (last_basic_block);
- sbitmap_zero (visited);
+ bitmap_clear (visited);
for (;;)
{
@@ -654,7 +654,7 @@ inverted_post_order_compute (int *post_order)
visited = sbitmap_alloc (last_basic_block);
/* None of the nodes in the CFG have been visited yet. */
- sbitmap_zero (visited);
+ bitmap_clear (visited);
/* Put all blocks that have no successor into the initial work list. */
FOR_ALL_BB (bb)
@@ -803,7 +803,7 @@ pre_and_rev_post_order_compute (int *pre_order, int *rev_post_order,
visited = sbitmap_alloc (last_basic_block);
/* None of the nodes in the CFG have been visited yet. */
- sbitmap_zero (visited);
+ bitmap_clear (visited);
/* Push the first edge on to the stack. */
stack[sp++] = ei_start (ENTRY_BLOCK_PTR->succs);
@@ -916,7 +916,7 @@ flow_dfs_compute_reverse_init (depth_first_search_ds data)
data->visited_blocks = sbitmap_alloc (last_basic_block);
/* None of the nodes in the CFG have been visited yet. */
- sbitmap_zero (data->visited_blocks);
+ bitmap_clear (data->visited_blocks);
return;
}
@@ -1006,7 +1006,7 @@ dfs_enumerate_from (basic_block bb, int reverse,
{
visited = sbitmap_alloc (size);
- sbitmap_zero (visited);
+ bitmap_clear (visited);
v_size = size;
}
else if (v_size < size)
@@ -1208,12 +1208,12 @@ sbitmap_intersection_of_succs (sbitmap dst, sbitmap *src,
if (e->dest == EXIT_BLOCK_PTR)
continue;
- sbitmap_copy (dst, src[e->dest->index]);
+ bitmap_copy (dst, src[e->dest->index]);
break;
}
if (e == 0)
- sbitmap_ones (dst);
+ bitmap_ones (dst);
else
for (++ix; ix < EDGE_COUNT (b->succs); ix++)
{
@@ -1250,12 +1250,12 @@ sbitmap_intersection_of_preds (sbitmap dst, sbitmap *src,
if (e->src == ENTRY_BLOCK_PTR)
continue;
- sbitmap_copy (dst, src[e->src->index]);
+ bitmap_copy (dst, src[e->src->index]);
break;
}
if (e == 0)
- sbitmap_ones (dst);
+ bitmap_ones (dst);
else
for (++ix; ix < EDGE_COUNT (b->preds); ix++)
{
@@ -1292,12 +1292,12 @@ sbitmap_union_of_succs (sbitmap dst, sbitmap *src,
if (e->dest == EXIT_BLOCK_PTR)
continue;
- sbitmap_copy (dst, src[e->dest->index]);
+ bitmap_copy (dst, src[e->dest->index]);
break;
}
if (ix == EDGE_COUNT (b->succs))
- sbitmap_zero (dst);
+ bitmap_clear (dst);
else
for (ix++; ix < EDGE_COUNT (b->succs); ix++)
{
@@ -1334,12 +1334,12 @@ sbitmap_union_of_preds (sbitmap dst, sbitmap *src,
if (e->src== ENTRY_BLOCK_PTR)
continue;
- sbitmap_copy (dst, src[e->src->index]);
+ bitmap_copy (dst, src[e->src->index]);
break;
}
if (ix == EDGE_COUNT (b->preds))
- sbitmap_zero (dst);
+ bitmap_clear (dst);
else
for (ix++; ix < EDGE_COUNT (b->preds); ix++)
{
diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c
index 6e5c6ef75a7..09dad6fa467 100644
--- a/gcc/cfgbuild.c
+++ b/gcc/cfgbuild.c
@@ -236,7 +236,7 @@ make_edges (basic_block min, basic_block max, int update_p)
/* If we have an edge cache, cache edges going out of BB. */
if (edge_cache)
{
- sbitmap_zero (edge_cache);
+ bitmap_clear (edge_cache);
if (update_p)
{
FOR_EACH_EDGE (e, ei, bb->succs)
@@ -385,7 +385,7 @@ make_edges (basic_block min, basic_block max, int update_p)
}
if (edge_cache)
- sbitmap_vector_free (edge_cache);
+ sbitmap_free (edge_cache);
}
static void
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 4ae1600d71c..5c06c1f2eff 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -3284,6 +3284,27 @@ expand_debug_expr (tree exp)
}
}
+ if (TREE_CODE (TREE_OPERAND (exp, 0)) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (TREE_OPERAND (exp, 0), 0))
+ == ADDR_EXPR)
+ {
+ op0 = expand_debug_expr (TREE_OPERAND (TREE_OPERAND (exp, 0),
+ 0));
+ if (op0 != NULL
+ && (GET_CODE (op0) == DEBUG_IMPLICIT_PTR
+ || (GET_CODE (op0) == PLUS
+ && GET_CODE (XEXP (op0, 0)) == DEBUG_IMPLICIT_PTR
+ && CONST_INT_P (XEXP (op0, 1)))))
+ {
+ op1 = expand_debug_expr (TREE_OPERAND (TREE_OPERAND (exp, 0),
+ 1));
+ if (!op1 || !CONST_INT_P (op1))
+ return NULL;
+
+ return plus_constant (mode, op0, INTVAL (op1));
+ }
+ }
+
return NULL;
}
@@ -4560,7 +4581,7 @@ gimple_expand_cfg (void)
}
blocks = sbitmap_alloc (last_basic_block);
- sbitmap_ones (blocks);
+ bitmap_ones (blocks);
find_many_sub_basic_blocks (blocks);
sbitmap_free (blocks);
purge_all_dead_edges ();
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c
index 44df99b8f33..83ac28d5713 100644
--- a/gcc/cfgloop.c
+++ b/gcc/cfgloop.c
@@ -393,7 +393,7 @@ flow_loops_find (struct loops *loops)
/* Count the number of loop headers. This should be the
same as the number of natural loops. */
headers = sbitmap_alloc (last_basic_block);
- sbitmap_zero (headers);
+ bitmap_clear (headers);
num_loops = 0;
FOR_EACH_BB (header)
@@ -1351,7 +1351,7 @@ verify_loop_structure (void)
}
free (bbs);
}
- sbitmap_zero (visited);
+ bitmap_clear (visited);
FOR_EACH_LOOP (li, loop, LI_FROM_INNERMOST)
{
bbs = get_loop_body (loop);
diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c
index eae68ca43c7..713a2ef5da7 100644
--- a/gcc/cfgloopmanip.c
+++ b/gcc/cfgloopmanip.c
@@ -190,7 +190,7 @@ fix_bb_placements (basic_block from,
return;
in_queue = sbitmap_alloc (last_basic_block);
- sbitmap_zero (in_queue);
+ bitmap_clear (in_queue);
SET_BIT (in_queue, from->index);
/* Prevent us from going out of the base_loop. */
SET_BIT (in_queue, base_loop->header->index);
@@ -327,7 +327,7 @@ remove_path (edge e)
n_bord_bbs = 0;
bord_bbs = XNEWVEC (basic_block, n_basic_blocks);
seen = sbitmap_alloc (last_basic_block);
- sbitmap_zero (seen);
+ bitmap_clear (seen);
/* Find "border" hexes -- i.e. those with predecessor in removed path. */
for (i = 0; i < nrem; i++)
@@ -365,7 +365,7 @@ remove_path (edge e)
free (rem_bbs);
/* Find blocks whose dominators may be affected. */
- sbitmap_zero (seen);
+ bitmap_clear (seen);
for (i = 0; i < n_bord_bbs; i++)
{
basic_block ldom;
@@ -594,7 +594,7 @@ update_dominators_in_loop (struct loop *loop)
unsigned i;
seen = sbitmap_alloc (last_basic_block);
- sbitmap_zero (seen);
+ bitmap_clear (seen);
body = get_loop_body (loop);
for (i = 0; i < loop->num_nodes; i++)
@@ -1586,6 +1586,7 @@ force_single_succ_latches (void)
continue;
e = find_edge (loop->latch, loop->header);
+ gcc_checking_assert (e != NULL);
split_edge (e);
}
@@ -1848,6 +1849,32 @@ fix_loop_structure (bitmap changed_bbs)
}
}
+ /* Then re-compute the single latch if there is one. */
+ FOR_EACH_LOOP (li, loop, 0)
+ {
+ edge_iterator ei;
+ edge e, latch = NULL;
+ FOR_EACH_EDGE (e, ei, loop->header->preds)
+ if (dominated_by_p (CDI_DOMINATORS, e->src, loop->header))
+ {
+ if (!latch)
+ latch = e;
+ else
+ {
+ latch = NULL;
+ break;
+ }
+ }
+ if (latch
+ && latch->src->loop_father == loop)
+ loop->latch = latch->src;
+ else
+ loop->latch = NULL;
+ }
+
+ if (!loops_state_satisfies_p (LOOPS_MAY_HAVE_MULTIPLE_LATCHES))
+ disambiguate_loops_with_multiple_latches ();
+
if (loops_state_satisfies_p (LOOPS_HAVE_PREHEADERS))
create_preheaders (CP_SIMPLE_PREHEADERS);
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index b58562fcc5f..5eec5e05f4b 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -3725,7 +3725,7 @@ break_superblocks (void)
basic_block bb;
superblocks = sbitmap_alloc (last_basic_block);
- sbitmap_zero (superblocks);
+ bitmap_clear (superblocks);
FOR_EACH_BB (bb)
if (bb->flags & BB_SUPERBLOCK)
diff --git a/gcc/combine.c b/gcc/combine.c
index bf06d4c118f..5bbf0bde937 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -7211,10 +7211,6 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos,
&& GET_MODE_SIZE (extraction_mode) < GET_MODE_SIZE (mode))
extraction_mode = mode;
- if (pos_rtx && GET_MODE (pos_rtx) != VOIDmode
- && GET_MODE_SIZE (pos_mode) < GET_MODE_SIZE (GET_MODE (pos_rtx)))
- pos_mode = GET_MODE (pos_rtx);
-
/* If this is not from memory, the desired mode is the preferred mode
for an extraction pattern's first input operand, or word_mode if there
is none. */
@@ -7231,14 +7227,6 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos,
wanted_inner_mode = GET_MODE_WIDER_MODE (wanted_inner_mode);
gcc_assert (wanted_inner_mode != VOIDmode);
}
-
- /* If we have to change the mode of memory and cannot, the desired mode
- is EXTRACTION_MODE. */
- if (inner_mode != wanted_inner_mode
- && (mode_dependent_address_p (XEXP (inner, 0), MEM_ADDR_SPACE (inner))
- || MEM_VOLATILE_P (inner)
- || pos_rtx))
- wanted_inner_mode = extraction_mode;
}
orig_pos = pos;
@@ -7359,9 +7347,6 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos,
}
pos_rtx = temp;
}
- else if (pos_rtx != 0
- && GET_MODE_SIZE (pos_mode) < GET_MODE_SIZE (GET_MODE (pos_rtx)))
- pos_rtx = gen_lowpart (pos_mode, pos_rtx);
/* Make POS_RTX unless we already have it and it is correct. If we don't
have a POS_RTX but we do have an ORIG_POS_RTX, the latter must
@@ -11169,17 +11154,7 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
&& (i = exact_log2 (UINTVAL (XEXP (op0, 0)))) >= 0)
{
if (BITS_BIG_ENDIAN)
- {
- enum machine_mode new_mode
- = mode_for_extraction (EP_extzv, 1);
- if (new_mode == MAX_MACHINE_MODE)
- i = BITS_PER_WORD - 1 - i;
- else
- {
- mode = new_mode;
- i = (GET_MODE_PRECISION (mode) - 1 - i);
- }
- }
+ i = BITS_PER_WORD - 1 - i;
op0 = XEXP (op0, 2);
op1 = GEN_INT (i);
diff --git a/gcc/common/config/i386/i386-common.c b/gcc/common/config/i386/i386-common.c
index e05cd562f44..da3967ea8c6 100644
--- a/gcc/common/config/i386/i386-common.c
+++ b/gcc/common/config/i386/i386-common.c
@@ -49,11 +49,16 @@ along with GCC; see the file COPYING3. If not see
#define OPTION_MASK_ISA_SSE4_2_SET \
(OPTION_MASK_ISA_SSE4_2 | OPTION_MASK_ISA_SSE4_1_SET)
#define OPTION_MASK_ISA_AVX_SET \
- (OPTION_MASK_ISA_AVX | OPTION_MASK_ISA_SSE4_2_SET)
+ (OPTION_MASK_ISA_AVX | OPTION_MASK_ISA_SSE4_2_SET \
+ | OPTION_MASK_ISA_XSAVE_SET)
#define OPTION_MASK_ISA_FMA_SET \
(OPTION_MASK_ISA_FMA | OPTION_MASK_ISA_AVX_SET)
#define OPTION_MASK_ISA_AVX2_SET \
(OPTION_MASK_ISA_AVX2 | OPTION_MASK_ISA_AVX_SET)
+#define OPTION_MASK_ISA_FXSR_SET OPTION_MASK_ISA_FXSR
+#define OPTION_MASK_ISA_XSAVE_SET OPTION_MASK_ISA_XSAVE
+#define OPTION_MASK_ISA_XSAVEOPT_SET \
+ (OPTION_MASK_ISA_XSAVEOPT | OPTION_MASK_ISA_XSAVE)
#define OPTION_MASK_ISA_RTM_SET OPTION_MASK_ISA_RTM
#define OPTION_MASK_ISA_PRFCHW_SET OPTION_MASK_ISA_PRFCHW
#define OPTION_MASK_ISA_RDSEED_SET OPTION_MASK_ISA_RDSEED
@@ -122,9 +127,13 @@ along with GCC; see the file COPYING3. If not see
#define OPTION_MASK_ISA_AVX_UNSET \
(OPTION_MASK_ISA_AVX | OPTION_MASK_ISA_FMA_UNSET \
| OPTION_MASK_ISA_FMA4_UNSET | OPTION_MASK_ISA_F16C_UNSET \
- | OPTION_MASK_ISA_AVX2_UNSET)
+ | OPTION_MASK_ISA_AVX2_UNSET | OPTION_MASK_ISA_XSAVE_UNSET)
#define OPTION_MASK_ISA_FMA_UNSET OPTION_MASK_ISA_FMA
#define OPTION_MASK_ISA_AVX2_UNSET OPTION_MASK_ISA_AVX2
+#define OPTION_MASK_ISA_FXSR_UNSET OPTION_MASK_ISA_FXSR
+#define OPTION_MASK_ISA_XSAVE_UNSET \
+ (OPTION_MASK_ISA_XSAVE | OPTION_MASK_ISA_XSAVEOPT_UNSET)
+#define OPTION_MASK_ISA_XSAVEOPT_UNSET OPTION_MASK_ISA_XSAVEOPT
#define OPTION_MASK_ISA_RTM_UNSET OPTION_MASK_ISA_RTM
#define OPTION_MASK_ISA_PRFCHW_UNSET OPTION_MASK_ISA_PRFCHW
#define OPTION_MASK_ISA_RDSEED_UNSET OPTION_MASK_ISA_RDSEED
@@ -574,6 +583,45 @@ ix86_handle_option (struct gcc_options *opts,
}
return true;
+ case OPT_mfxsr:
+ if (value)
+ {
+ opts->x_ix86_isa_flags |= OPTION_MASK_ISA_FXSR_SET;
+ opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_FXSR_SET;
+ }
+ else
+ {
+ opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_FXSR_UNSET;
+ opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_FXSR_UNSET;
+ }
+ return true;
+
+ case OPT_mxsave:
+ if (value)
+ {
+ opts->x_ix86_isa_flags |= OPTION_MASK_ISA_XSAVE_SET;
+ opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_XSAVE_SET;
+ }
+ else
+ {
+ opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_XSAVE_UNSET;
+ opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_XSAVE_UNSET;
+ }
+ return true;
+
+ case OPT_mxsaveopt:
+ if (value)
+ {
+ opts->x_ix86_isa_flags |= OPTION_MASK_ISA_XSAVEOPT_SET;
+ opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_XSAVEOPT_SET;
+ }
+ else
+ {
+ opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_XSAVEOPT_UNSET;
+ opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_XSAVEOPT_UNSET;
+ }
+ return true;
+
case OPT_mrdseed:
if (value)
{
diff --git a/gcc/common/config/m68k/m68k-common.c b/gcc/common/config/m68k/m68k-common.c
index 3a81b678a24..77c8f73dd3d 100644
--- a/gcc/common/config/m68k/m68k-common.c
+++ b/gcc/common/config/m68k/m68k-common.c
@@ -1,6 +1,6 @@
/* Common hooks for Motorola 68000 family.
Copyright (C) 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
This file is part of GCC.
@@ -33,7 +33,7 @@ along with GCC; see the file COPYING3. If not see
static bool
m68k_handle_option (struct gcc_options *opts,
- struct gcc_options *opts_set ATTRIBUTE_UNUSED,
+ struct gcc_options *opts_set,
const struct cl_decoded_option *decoded,
location_t loc)
{
@@ -45,12 +45,16 @@ m68k_handle_option (struct gcc_options *opts,
{
case OPT_m68020_40:
opts->x_m68k_tune_option = u68020_40;
+ opts_set->x_m68k_tune_option = (uarch_type) 1;
opts->x_m68k_cpu_option = m68020;
+ opts_set->x_m68k_cpu_option = (target_device) 1;
return true;
case OPT_m68020_60:
opts->x_m68k_tune_option = u68020_60;
+ opts_set->x_m68k_tune_option = (uarch_type) 1;
opts->x_m68k_cpu_option = m68020;
+ opts_set->x_m68k_cpu_option = (target_device) 1;
return true;
case OPT_mshared_library_id_:
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 58bbe5451cc..00372290579 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -368,7 +368,8 @@ i[34567]86-*-*)
ia32intrin.h cross-stdarg.h lwpintrin.h popcntintrin.h
lzcntintrin.h bmiintrin.h bmi2intrin.h tbmintrin.h
avx2intrin.h fmaintrin.h f16cintrin.h rtmintrin.h
- xtestintrin.h rdseedintrin.h prfchwintrin.h adxintrin.h"
+ xtestintrin.h rdseedintrin.h prfchwintrin.h adxintrin.h
+ fxsrintrin.h xsaveintrin.h xsaveoptintrin.h"
;;
x86_64-*-*)
cpu_type=i386
@@ -382,7 +383,8 @@ x86_64-*-*)
ia32intrin.h cross-stdarg.h lwpintrin.h popcntintrin.h
lzcntintrin.h bmiintrin.h tbmintrin.h bmi2intrin.h
avx2intrin.h fmaintrin.h f16cintrin.h rtmintrin.h
- xtestintrin.h rdseedintrin.h prfchwintrin.h adxintrin.h"
+ xtestintrin.h rdseedintrin.h prfchwintrin.h adxintrin.h
+ fxsrintrin.h xsaveintrin.h xsaveoptintrin.h"
need_64bit_hwint=yes
;;
ia64-*-*)
@@ -1727,6 +1729,14 @@ microblaze*-linux*)
c_target_objs="${c_target_objs} microblaze-c.o"
cxx_target_objs="${cxx_target_objs} microblaze-c.o"
;;
+microblaze*-*-rtems*)
+ tm_file="${tm_file} dbxelf.h"
+ tm_file="${tm_file} microblaze/rtems.h rtems.h newlib-stdint.h"
+ c_target_objs="${c_target_objs} microblaze-c.o"
+ cxx_target_objs="${cxx_target_objs} microblaze-c.o"
+ tmake_file="${tmake_file} microblaze/t-microblaze"
+ tmake_file="${tmake_file} t-rtems microblaze/t-rtems"
+ ;;
microblaze*-*-*)
tm_file="${tm_file} dbxelf.h"
c_target_objs="${c_target_objs} microblaze-c.o"
@@ -2391,7 +2401,7 @@ sparc-*-elf*)
;;
sparc-*-rtems*)
tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp-elf.h sparc/rtemself.h rtems.h newlib-stdint.h"
- tmake_file="sparc/t-sparc sparc/t-elf t-rtems"
+ tmake_file="sparc/t-sparc sparc/t-elf sparc/t-rtems t-rtems"
;;
sparc-*-linux*)
tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/tso.h"
@@ -2444,7 +2454,7 @@ sparc64-*-elf*)
sparc64-*-rtems*)
tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp64-elf.h sparc/rtemself.h rtems.h"
extra_options="${extra_options}"
- tmake_file="${tmake_file} sparc/t-sparc t-rtems"
+ tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems-64 t-rtems"
;;
sparc64-*-linux*)
tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/default-64.h sparc/linux64.h sparc/tso.h"
diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h
index 765d1920a73..ca4e3068925 100644
--- a/gcc/config/aarch64/aarch64-protos.h
+++ b/gcc/config/aarch64/aarch64-protos.h
@@ -254,6 +254,7 @@ bool aarch64_split_128bit_move_p (rtx, rtx);
bool aarch64_legitimate_address_p (enum machine_mode, rtx, RTX_CODE, bool);
enum machine_mode aarch64_select_cc_mode (RTX_CODE, rtx, rtx);
rtx aarch64_gen_compare_reg (RTX_CODE, rtx, rtx);
+rtx aarch64_load_tp (rtx);
#endif /* RTX_CODE */
diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md
index a7ddfb1c1d3..b3d01c19199 100644
--- a/gcc/config/aarch64/aarch64-simd.md
+++ b/gcc/config/aarch64/aarch64-simd.md
@@ -1467,6 +1467,150 @@
(set_attr "simd_mode" "V2SI")]
)
+;; vbsl_* intrinsics may compile to any of vbsl/vbif/vbit depending on register
+;; allocation. For an intrinsic of form:
+;; vD = bsl_* (vS, vN, vM)
+;; We can use any of:
+;; bsl vS, vN, vM (if D = S)
+;; bit vD, vN, vS (if D = M, so 1-bits in vS choose bits from vN, else vM)
+;; bif vD, vM, vS (if D = N, so 0-bits in vS choose bits from vM, else vN)
+
+(define_insn "aarch64_simd_bsl<mode>_internal"
+ [(set (match_operand:VDQ 0 "register_operand" "=w,w,w")
+ (unspec:VDQ [(match_operand:VDQ 1 "register_operand" " 0,w,w")
+ (match_operand:VDQ 2 "register_operand" " w,w,0")
+ (match_operand:VDQ 3 "register_operand" " w,0,w")]
+ UNSPEC_BSL))]
+ "TARGET_SIMD"
+ "@
+ bsl\\t%0.<Vbtype>, %2.<Vbtype>, %3.<Vbtype>
+ bit\\t%0.<Vbtype>, %2.<Vbtype>, %1.<Vbtype>
+ bif\\t%0.<Vbtype>, %3.<Vbtype>, %1.<Vbtype>"
+)
+
+(define_expand "aarch64_simd_bsl<mode>"
+ [(set (match_operand:VDQ 0 "register_operand")
+ (unspec:VDQ [(match_operand:<V_cmp_result> 1 "register_operand")
+ (match_operand:VDQ 2 "register_operand")
+ (match_operand:VDQ 3 "register_operand")]
+ UNSPEC_BSL))]
+ "TARGET_SIMD"
+{
+ /* We can't alias operands together if they have different modes. */
+ operands[1] = gen_lowpart (<MODE>mode, operands[1]);
+})
+
+(define_expand "aarch64_vcond_internal<mode>"
+ [(set (match_operand:VDQ 0 "register_operand")
+ (if_then_else:VDQ
+ (match_operator 3 "comparison_operator"
+ [(match_operand:VDQ 4 "register_operand")
+ (match_operand:VDQ 5 "nonmemory_operand")])
+ (match_operand:VDQ 1 "register_operand")
+ (match_operand:VDQ 2 "register_operand")))]
+ "TARGET_SIMD"
+{
+ int inverse = 0, has_zero_imm_form = 0;
+ rtx mask = gen_reg_rtx (<MODE>mode);
+
+ switch (GET_CODE (operands[3]))
+ {
+ case LE:
+ case LT:
+ case NE:
+ inverse = 1;
+ /* Fall through. */
+ case GE:
+ case GT:
+ case EQ:
+ has_zero_imm_form = 1;
+ break;
+ case LEU:
+ case LTU:
+ inverse = 1;
+ break;
+ default:
+ break;
+ }
+
+ if (!REG_P (operands[5])
+ && (operands[5] != CONST0_RTX (<MODE>mode) || !has_zero_imm_form))
+ operands[5] = force_reg (<MODE>mode, operands[5]);
+
+ switch (GET_CODE (operands[3]))
+ {
+ case LT:
+ case GE:
+ emit_insn (gen_aarch64_cmge<mode> (mask, operands[4], operands[5]));
+ break;
+
+ case LE:
+ case GT:
+ emit_insn (gen_aarch64_cmgt<mode> (mask, operands[4], operands[5]));
+ break;
+
+ case LTU:
+ case GEU:
+ emit_insn (gen_aarch64_cmhs<mode> (mask, operands[4], operands[5]));
+ break;
+
+ case LEU:
+ case GTU:
+ emit_insn (gen_aarch64_cmhi<mode> (mask, operands[4], operands[5]));
+ break;
+
+ case NE:
+ case EQ:
+ emit_insn (gen_aarch64_cmeq<mode> (mask, operands[4], operands[5]));
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+
+ if (inverse)
+ emit_insn (gen_aarch64_simd_bsl<mode> (operands[0], mask, operands[2],
+ operands[1]));
+ else
+ emit_insn (gen_aarch64_simd_bsl<mode> (operands[0], mask, operands[1],
+ operands[2]));
+
+ DONE;
+})
+
+(define_expand "vcond<mode><mode>"
+ [(set (match_operand:VDQ 0 "register_operand")
+ (if_then_else:VDQ
+ (match_operator 3 "comparison_operator"
+ [(match_operand:VDQ 4 "register_operand")
+ (match_operand:VDQ 5 "nonmemory_operand")])
+ (match_operand:VDQ 1 "register_operand")
+ (match_operand:VDQ 2 "register_operand")))]
+ "TARGET_SIMD"
+{
+ emit_insn (gen_aarch64_vcond_internal<mode> (operands[0], operands[1],
+ operands[2], operands[3],
+ operands[4], operands[5]));
+ DONE;
+})
+
+
+(define_expand "vcondu<mode><mode>"
+ [(set (match_operand:VDQ 0 "register_operand")
+ (if_then_else:VDQ
+ (match_operator 3 "comparison_operator"
+ [(match_operand:VDQ 4 "register_operand")
+ (match_operand:VDQ 5 "nonmemory_operand")])
+ (match_operand:VDQ 1 "register_operand")
+ (match_operand:VDQ 2 "register_operand")))]
+ "TARGET_SIMD"
+{
+ emit_insn (gen_aarch64_vcond_internal<mode> (operands[0], operands[1],
+ operands[2], operands[3],
+ operands[4], operands[5]));
+ DONE;
+})
+
;; Patterns for AArch64 SIMD Intrinsics.
(define_expand "aarch64_create<mode>"
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 1bc0c8a0b4e..aaebdf6ac77 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -102,7 +102,6 @@ static bool aarch64_vfp_is_call_or_return_candidate (enum machine_mode,
bool *);
static void aarch64_elf_asm_constructor (rtx, int) ATTRIBUTE_UNUSED;
static void aarch64_elf_asm_destructor (rtx, int) ATTRIBUTE_UNUSED;
-static rtx aarch64_load_tp (rtx);
static void aarch64_override_options_after_change (void);
static int aarch64_simd_valid_immediate (rtx, enum machine_mode, int, rtx *,
int *, unsigned char *, int *, int *);
@@ -4988,20 +4987,11 @@ aarch64_legitimate_constant_p (enum machine_mode mode, rtx x)
static void
aarch64_init_builtins (void)
{
- tree ftype, decl = NULL;
-
- ftype = build_function_type (ptr_type_node, void_list_node);
- decl = add_builtin_function ("__builtin_thread_pointer", ftype,
- AARCH64_BUILTIN_THREAD_POINTER, BUILT_IN_MD,
- NULL, NULL_TREE);
- TREE_NOTHROW (decl) = 1;
- TREE_READONLY (decl) = 1;
-
if (TARGET_SIMD)
init_aarch64_simd_builtins ();
}
-static rtx
+rtx
aarch64_load_tp (rtx target)
{
if (!target
@@ -5026,9 +5016,6 @@ aarch64_expand_builtin (tree exp,
tree fndecl = TREE_OPERAND (CALL_EXPR_FN (exp), 0);
int fcode = DECL_FUNCTION_CODE (fndecl);
- if (fcode == AARCH64_BUILTIN_THREAD_POINTER)
- return aarch64_load_tp (target);
-
if (fcode >= AARCH64_SIMD_BUILTIN_BASE)
return aarch64_simd_expand_builtin (fcode, exp, target);
diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h
index 3b8b033da0c..122a7a5f923 100644
--- a/gcc/config/aarch64/aarch64.h
+++ b/gcc/config/aarch64/aarch64.h
@@ -794,7 +794,6 @@ do { \
enum aarch64_builtins
{
AARCH64_BUILTIN_MIN,
- AARCH64_BUILTIN_THREAD_POINTER,
AARCH64_SIMD_BUILTIN_BASE
};
diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
index b80392298ac..804d7e746d2 100644
--- a/gcc/config/aarch64/aarch64.md
+++ b/gcc/config/aarch64/aarch64.md
@@ -2923,6 +2923,17 @@
[(set_attr "length" "0")]
)
+;; Named pattern for expanding thread pointer reference.
+(define_expand "get_thread_pointerdi"
+ [(match_operand:DI 0 "register_operand" "=r")]
+ ""
+{
+ rtx tmp = aarch64_load_tp (operands[0]);
+ if (tmp != operands[0])
+ emit_move_insn (operands[0], tmp);
+ DONE;
+})
+
;; AdvSIMD Stuff
(include "aarch64-simd.md")
diff --git a/gcc/config/aarch64/iterators.md b/gcc/config/aarch64/iterators.md
index bf2041e78e5..8d5d4b0d5ed 100644
--- a/gcc/config/aarch64/iterators.md
+++ b/gcc/config/aarch64/iterators.md
@@ -227,6 +227,7 @@
UNSPEC_CMTST ; Used in aarch64-simd.md.
UNSPEC_FMAX ; Used in aarch64-simd.md.
UNSPEC_FMIN ; Used in aarch64-simd.md.
+ UNSPEC_BSL ; Used in aarch64-simd.md.
])
;; -------------------------------------------------------------------
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 9ae52663668..3d1a599265f 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -2874,7 +2874,6 @@ avr_out_lpm (rtx insn, rtx *op, int *plen)
rtx src = SET_SRC (single_set (insn));
rtx addr;
int n_bytes = GET_MODE_SIZE (GET_MODE (dest));
- int regno_dest;
int segment;
RTX_CODE code;
addr_space_t as = MEM_ADDR_SPACE (src);
@@ -2903,8 +2902,6 @@ avr_out_lpm (rtx insn, rtx *op, int *plen)
xop[5] = tmp_reg_rtx;
xop[6] = XEXP (rampz_rtx, 0);
- regno_dest = REGNO (dest);
-
segment = avr_addrspace[as].segment;
/* Set RAMPZ as needed. */
diff --git a/gcc/config/avr/rtems.h b/gcc/config/avr/rtems.h
index efd8afacefa..4a9c1b4d67b 100644
--- a/gcc/config/avr/rtems.h
+++ b/gcc/config/avr/rtems.h
@@ -23,6 +23,5 @@ along with GCC; see the file COPYING3. If not see
#define TARGET_OS_CPP_BUILTINS() \
do { \
builtin_define ("__rtems__"); \
- builtin_define ("__USE_INIT_FINI__"); \
builtin_assert ("system=rtems"); \
} while (0)
diff --git a/gcc/config/epiphany/resolve-sw-modes.c b/gcc/config/epiphany/resolve-sw-modes.c
index 9564d752c4f..14c64d44cbe 100644
--- a/gcc/config/epiphany/resolve-sw-modes.c
+++ b/gcc/config/epiphany/resolve-sw-modes.c
@@ -63,7 +63,7 @@ resolve_sw_modes (void)
todo = VEC_alloc (basic_block, heap, last_basic_block);
pushed = sbitmap_alloc (last_basic_block);
- sbitmap_zero (pushed);
+ bitmap_clear (pushed);
if (!finalize_fp_sets)
{
df_note_add_problem ();
diff --git a/gcc/config/i386/cpuid.h b/gcc/config/i386/cpuid.h
index 5cd1eb1c736..1f76d3a5077 100644
--- a/gcc/config/i386/cpuid.h
+++ b/gcc/config/i386/cpuid.h
@@ -75,6 +75,9 @@
#define bit_RDSEED (1 << 18)
#define bit_ADX (1 << 19)
+/* Extended State Enumeration Sub-leaf (%eax == 13, %ecx == 1) */
+#define bit_XSAVEOPT (1 << 0)
+
/* Signatures for different CPU implementations as returned in uses
of cpuid with level 0. */
#define signature_AMD_ebx 0x68747541
diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c
index 36d80b1e621..940060a97f3 100644
--- a/gcc/config/i386/driver-i386.c
+++ b/gcc/config/i386/driver-i386.c
@@ -390,7 +390,7 @@ const char *host_detect_local_cpu (int argc, const char **argv)
unsigned int has_hle = 0, has_rtm = 0;
unsigned int has_rdrnd = 0, has_f16c = 0, has_fsgsbase = 0;
unsigned int has_rdseed = 0, has_prfchw = 0, has_adx = 0;
- unsigned int has_osxsave = 0;
+ unsigned int has_osxsave = 0, has_fxsr = 0, has_xsave = 0, has_xsaveopt = 0;
bool arch;
@@ -441,10 +441,12 @@ const char *host_detect_local_cpu (int argc, const char **argv)
has_fma = ecx & bit_FMA;
has_f16c = ecx & bit_F16C;
has_rdrnd = ecx & bit_RDRND;
+ has_xsave = ecx & bit_XSAVE;
has_cmpxchg8b = edx & bit_CMPXCHG8B;
has_cmov = edx & bit_CMOV;
has_mmx = edx & bit_MMX;
+ has_fxsr = edx & bit_FXSAVE;
has_sse = edx & bit_SSE;
has_sse2 = edx & bit_SSE2;
@@ -462,6 +464,13 @@ const char *host_detect_local_cpu (int argc, const char **argv)
has_adx = ebx & bit_ADX;
}
+ if (max_level >= 13)
+ {
+ __cpuid_count (13, 1, eax, ebx, ecx, edx);
+
+ has_xsaveopt = eax & bit_XSAVEOPT;
+ }
+
/* Get XCR_XFEATURE_ENABLED_MASK register with xgetbv. */
#define XCR_XFEATURE_ENABLED_MASK 0x0
#define XSTATE_FP 0x1
@@ -481,6 +490,8 @@ const char *host_detect_local_cpu (int argc, const char **argv)
has_fma = 0;
has_fma4 = 0;
has_xop = 0;
+ has_xsave = 0;
+ has_xsaveopt = 0;
}
/* Check cpuid level of extended features. */
@@ -763,11 +774,15 @@ const char *host_detect_local_cpu (int argc, const char **argv)
const char *rdseed = has_rdseed ? " -mrdseed" : " -mno-rdseed";
const char *prfchw = has_prfchw ? " -mprfchw" : " -mno-prfchw";
const char *adx = has_adx ? " -madx" : " -mno-adx";
+ const char *fxsr = has_fxsr ? " -mfxsr" : " -mno-fxsr";
+ const char *xsave = has_xsave ? " -mxsave" : " -mno-xsave";
+ const char *xsaveopt = has_xsaveopt ? " -mxsaveopt" : " -mno-xsaveopt";
options = concat (options, cx16, sahf, movbe, ase, pclmul,
popcnt, abm, lwp, fma, fma4, xop, bmi, bmi2,
tbm, avx, avx2, sse4_2, sse4_1, lzcnt, rtm,
- hle, rdrnd, f16c, fsgsbase, rdseed, prfchw, adx, NULL);
+ hle, rdrnd, f16c, fsgsbase, rdseed, prfchw, adx,
+ fxsr, xsave, xsaveopt, NULL);
}
done:
diff --git a/gcc/config/i386/fxsrintrin.h b/gcc/config/i386/fxsrintrin.h
new file mode 100644
index 00000000000..9f5e411ac32
--- /dev/null
+++ b/gcc/config/i386/fxsrintrin.h
@@ -0,0 +1,61 @@
+/* Copyright (C) 2012 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ 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/>. */
+
+/* #if !defined _X86INTRIN_H_INCLUDED && !defined _IMMINTRIN_H_INCLUDED */
+/* # error "Never use <fxsrintrin.h> directly; include <x86intrin.h> instead." */
+/* #endif */
+
+#ifndef _FXSRINTRIN_H_INCLUDED
+#define _FXSRINTRIN_H_INCLUDED
+
+extern __inline void
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_fxsave (void *__P)
+{
+ return __builtin_ia32_fxsave (__P);
+}
+
+extern __inline void
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_fxrstor (void *__P)
+{
+ return __builtin_ia32_fxrstor (__P);
+}
+
+#ifdef __x86_64__
+extern __inline void
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_fxsave64 (void *__P)
+{
+ return __builtin_ia32_fxsave64 (__P);
+}
+
+extern __inline void
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_fxrstor64 (void *__P)
+{
+ return __builtin_ia32_fxrstor64 (__P);
+}
+#endif
+
+#endif /* _FXSRINTRIN_H_INCLUDED */
diff --git a/gcc/config/i386/i386-builtin-types.def b/gcc/config/i386/i386-builtin-types.def
index 8a199c0a7f8..314f3e888d8 100644
--- a/gcc/config/i386/i386-builtin-types.def
+++ b/gcc/config/i386/i386-builtin-types.def
@@ -356,6 +356,7 @@ DEF_FUNCTION_TYPE (V4DI, V4DI, V2DI)
DEF_FUNCTION_TYPE (V4DI, PCV4DI, V4DI)
DEF_FUNCTION_TYPE (V4DI, V4DI, INT)
DEF_FUNCTION_TYPE (V2DI, V4DI, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, INT64)
DEF_FUNCTION_TYPE (VOID, PCHAR, V16QI)
DEF_FUNCTION_TYPE (VOID, PCHAR, V32QI)
DEF_FUNCTION_TYPE (VOID, PDOUBLE, V2DF)
diff --git a/gcc/config/i386/i386-c.c b/gcc/config/i386/i386-c.c
index edd64ff7ae3..bd02fbb1bfa 100644
--- a/gcc/config/i386/i386-c.c
+++ b/gcc/config/i386/i386-c.c
@@ -302,6 +302,12 @@ ix86_target_macros_internal (HOST_WIDE_INT isa_flag,
def_or_undef (parse_in, "__PRFCHW__");
if (isa_flag & OPTION_MASK_ISA_ADX)
def_or_undef (parse_in, "__ADX__");
+ if (isa_flag & OPTION_MASK_ISA_FXSR)
+ def_or_undef (parse_in, "__FXSR__");
+ if (isa_flag & OPTION_MASK_ISA_XSAVE)
+ def_or_undef (parse_in, "__XSAVE__");
+ if (isa_flag & OPTION_MASK_ISA_XSAVEOPT)
+ def_or_undef (parse_in, "__XSAVEOPT__");
if ((fpmath & FPMATH_SSE) && (isa_flag & OPTION_MASK_ISA_SSE))
def_or_undef (parse_in, "__SSE_MATH__");
if ((fpmath & FPMATH_SSE) && (isa_flag & OPTION_MASK_ISA_SSE2))
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index c98c6b7a52f..7fbf3a73ad2 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -401,10 +401,10 @@ move_or_delete_vzeroupper (void)
visited = sbitmap_alloc (last_basic_block);
in_worklist = sbitmap_alloc (last_basic_block);
in_pending = sbitmap_alloc (last_basic_block);
- sbitmap_zero (in_worklist);
+ bitmap_clear (in_worklist);
/* Don't check outgoing edges of entry point. */
- sbitmap_ones (in_pending);
+ bitmap_ones (in_pending);
FOR_EACH_BB (bb)
if (BLOCK_INFO (bb)->processed)
RESET_BIT (in_pending, bb->index);
@@ -426,7 +426,7 @@ move_or_delete_vzeroupper (void)
in_pending = in_worklist;
in_worklist = sbitmap_swap;
- sbitmap_zero (visited);
+ bitmap_clear (visited);
cfun->machine->rescan_vzeroupper_p = 0;
@@ -2752,7 +2752,7 @@ ix86_target_string (HOST_WIDE_INT isa, int flags, const char *arch,
preceding options while match those first. */
static struct ix86_target_opts isa_opts[] =
{
- { "-mfma4", OPTION_MASK_ISA_FMA4 },
+ { "-mfma4", OPTION_MASK_ISA_FMA4 },
{ "-mfma", OPTION_MASK_ISA_FMA },
{ "-mxop", OPTION_MASK_ISA_XOP },
{ "-mlwp", OPTION_MASK_ISA_LWP },
@@ -2760,17 +2760,18 @@ ix86_target_string (HOST_WIDE_INT isa, int flags, const char *arch,
{ "-msse4.2", OPTION_MASK_ISA_SSE4_2 },
{ "-msse4.1", OPTION_MASK_ISA_SSE4_1 },
{ "-mssse3", OPTION_MASK_ISA_SSSE3 },
- { "-msse3", OPTION_MASK_ISA_SSE3 },
- { "-msse2", OPTION_MASK_ISA_SSE2 },
+ { "-msse3", OPTION_MASK_ISA_SSE3 },
+ { "-msse2", OPTION_MASK_ISA_SSE2 },
{ "-msse", OPTION_MASK_ISA_SSE },
{ "-m3dnow", OPTION_MASK_ISA_3DNOW },
{ "-m3dnowa", OPTION_MASK_ISA_3DNOW_A },
{ "-mmmx", OPTION_MASK_ISA_MMX },
{ "-mabm", OPTION_MASK_ISA_ABM },
{ "-mbmi", OPTION_MASK_ISA_BMI },
- { "-mbmi2", OPTION_MASK_ISA_BMI2 },
+ { "-mbmi2", OPTION_MASK_ISA_BMI2 },
{ "-mlzcnt", OPTION_MASK_ISA_LZCNT },
{ "-mhle", OPTION_MASK_ISA_HLE },
+ { "-mfxsr", OPTION_MASK_ISA_FXSR },
{ "-mrdseed", OPTION_MASK_ISA_RDSEED },
{ "-mprfchw", OPTION_MASK_ISA_PRFCHW },
{ "-madx", OPTION_MASK_ISA_ADX },
@@ -2782,8 +2783,10 @@ ix86_target_string (HOST_WIDE_INT isa, int flags, const char *arch,
{ "-mpclmul", OPTION_MASK_ISA_PCLMUL },
{ "-mfsgsbase", OPTION_MASK_ISA_FSGSBASE },
{ "-mrdrnd", OPTION_MASK_ISA_RDRND },
- { "-mf16c", OPTION_MASK_ISA_F16C },
+ { "-mf16c", OPTION_MASK_ISA_F16C },
{ "-mrtm", OPTION_MASK_ISA_RTM },
+ { "-mxsave", OPTION_MASK_ISA_XSAVE },
+ { "-mxsaveopt", OPTION_MASK_ISA_XSAVEOPT },
};
/* Flag options. */
@@ -3054,6 +3057,10 @@ ix86_option_override_internal (bool main_args_p)
#define PTA_PRFCHW (HOST_WIDE_INT_1 << 34)
#define PTA_RDSEED (HOST_WIDE_INT_1 << 35)
#define PTA_ADX (HOST_WIDE_INT_1 << 36)
+#define PTA_FXSR (HOST_WIDE_INT_1 << 37)
+#define PTA_XSAVE (HOST_WIDE_INT_1 << 38)
+#define PTA_XSAVEOPT (HOST_WIDE_INT_1 << 39)
+
/* if this reaches 64, need to widen struct pta flags below */
static struct pta
@@ -3076,46 +3083,48 @@ ix86_option_override_internal (bool main_args_p)
{"c3-2", PROCESSOR_PENTIUMPRO, CPU_PENTIUMPRO, PTA_MMX | PTA_SSE},
{"i686", PROCESSOR_PENTIUMPRO, CPU_PENTIUMPRO, 0},
{"pentiumpro", PROCESSOR_PENTIUMPRO, CPU_PENTIUMPRO, 0},
- {"pentium2", PROCESSOR_PENTIUMPRO, CPU_PENTIUMPRO, PTA_MMX},
+ {"pentium2", PROCESSOR_PENTIUMPRO, CPU_PENTIUMPRO, PTA_MMX | PTA_FXSR},
{"pentium3", PROCESSOR_PENTIUMPRO, CPU_PENTIUMPRO,
- PTA_MMX | PTA_SSE},
+ PTA_MMX | PTA_SSE | PTA_FXSR},
{"pentium3m", PROCESSOR_PENTIUMPRO, CPU_PENTIUMPRO,
- PTA_MMX | PTA_SSE},
+ PTA_MMX | PTA_SSE | PTA_FXSR},
{"pentium-m", PROCESSOR_PENTIUMPRO, CPU_PENTIUMPRO,
- PTA_MMX | PTA_SSE | PTA_SSE2},
+ PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_FXSR},
{"pentium4", PROCESSOR_PENTIUM4, CPU_NONE,
- PTA_MMX |PTA_SSE | PTA_SSE2},
+ PTA_MMX |PTA_SSE | PTA_SSE2 | PTA_FXSR},
{"pentium4m", PROCESSOR_PENTIUM4, CPU_NONE,
- PTA_MMX | PTA_SSE | PTA_SSE2},
+ PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_FXSR},
{"prescott", PROCESSOR_NOCONA, CPU_NONE,
- PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3},
+ PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3 | PTA_FXSR},
{"nocona", PROCESSOR_NOCONA, CPU_NONE,
PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3
- | PTA_CX16 | PTA_NO_SAHF},
+ | PTA_CX16 | PTA_NO_SAHF | PTA_FXSR},
{"core2", PROCESSOR_CORE2_64, CPU_CORE2,
PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3
- | PTA_SSSE3 | PTA_CX16},
+ | PTA_SSSE3 | PTA_CX16 | PTA_FXSR},
{"corei7", PROCESSOR_COREI7_64, CPU_COREI7,
PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3
- | PTA_SSSE3 | PTA_SSE4_1 | PTA_SSE4_2 | PTA_CX16},
+ | PTA_SSSE3 | PTA_SSE4_1 | PTA_SSE4_2 | PTA_CX16 | PTA_FXSR},
{"corei7-avx", PROCESSOR_COREI7_64, CPU_COREI7,
PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3
| PTA_SSSE3 | PTA_SSE4_1 | PTA_SSE4_2 | PTA_AVX
- | PTA_CX16 | PTA_POPCNT | PTA_AES | PTA_PCLMUL},
+ | PTA_CX16 | PTA_POPCNT | PTA_AES | PTA_PCLMUL
+ | PTA_FXSR | PTA_XSAVE | PTA_XSAVEOPT},
{"core-avx-i", PROCESSOR_COREI7_64, CPU_COREI7,
PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3
| PTA_SSSE3 | PTA_SSE4_1 | PTA_SSE4_2 | PTA_AVX
| PTA_CX16 | PTA_POPCNT | PTA_AES | PTA_PCLMUL | PTA_FSGSBASE
- | PTA_RDRND | PTA_F16C},
+ | PTA_RDRND | PTA_F16C | PTA_FXSR | PTA_XSAVE | PTA_XSAVEOPT},
{"core-avx2", PROCESSOR_COREI7_64, CPU_COREI7,
PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3
| PTA_SSSE3 | PTA_SSE4_1 | PTA_SSE4_2 | PTA_AVX | PTA_AVX2
| PTA_CX16 | PTA_POPCNT | PTA_AES | PTA_PCLMUL | PTA_FSGSBASE
| PTA_RDRND | PTA_F16C | PTA_BMI | PTA_BMI2 | PTA_LZCNT
- | PTA_FMA | PTA_MOVBE | PTA_RTM | PTA_HLE},
+ | PTA_FMA | PTA_MOVBE | PTA_RTM | PTA_HLE | PTA_FXSR | PTA_XSAVE
+ | PTA_XSAVEOPT},
{"atom", PROCESSOR_ATOM, CPU_ATOM,
PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3
- | PTA_SSSE3 | PTA_CX16 | PTA_MOVBE},
+ | PTA_SSSE3 | PTA_CX16 | PTA_MOVBE | PTA_FXSR},
{"geode", PROCESSOR_GEODE, CPU_GEODE,
PTA_MMX | PTA_3DNOW | PTA_3DNOW_A | PTA_PREFETCH_SSE},
{"k6", PROCESSOR_K6, CPU_K6, PTA_MMX},
@@ -3156,7 +3165,7 @@ ix86_option_override_internal (bool main_args_p)
| PTA_SSE2 | PTA_NO_SAHF},
{"amdfam10", PROCESSOR_AMDFAM10, CPU_AMDFAM10,
PTA_64BIT | PTA_MMX | PTA_3DNOW | PTA_3DNOW_A | PTA_SSE
- | PTA_SSE2 | PTA_SSE3 | PTA_SSE4A | PTA_CX16 | PTA_ABM},
+ | PTA_SSE2 | PTA_SSE3 | PTA_SSE4A | PTA_CX16 | PTA_ABM},
{"barcelona", PROCESSOR_AMDFAM10, CPU_AMDFAM10,
PTA_64BIT | PTA_MMX | PTA_3DNOW | PTA_3DNOW_A | PTA_SSE
| PTA_SSE2 | PTA_SSE3 | PTA_SSE4A | PTA_CX16 | PTA_ABM},
@@ -3164,21 +3173,24 @@ ix86_option_override_internal (bool main_args_p)
PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3
| PTA_SSE4A | PTA_CX16 | PTA_ABM | PTA_SSSE3 | PTA_SSE4_1
| PTA_SSE4_2 | PTA_AES | PTA_PCLMUL | PTA_AVX | PTA_FMA4
- | PTA_XOP | PTA_LWP | PTA_PRFCHW},
+ | PTA_XOP | PTA_LWP | PTA_PRFCHW | PTA_FXSR | PTA_XSAVE
+ | PTA_XSAVEOPT},
{"bdver2", PROCESSOR_BDVER2, CPU_BDVER2,
PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3
| PTA_SSE4A | PTA_CX16 | PTA_ABM | PTA_SSSE3 | PTA_SSE4_1
| PTA_SSE4_2 | PTA_AES | PTA_PCLMUL | PTA_AVX | PTA_FMA4
| PTA_XOP | PTA_LWP | PTA_BMI | PTA_TBM | PTA_F16C
- | PTA_FMA | PTA_PRFCHW},
+ | PTA_FMA | PTA_PRFCHW | PTA_FXSR | PTA_XSAVE | PTA_XSAVEOPT},
{"btver1", PROCESSOR_BTVER1, CPU_GENERIC64,
PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3
- | PTA_SSSE3 | PTA_SSE4A |PTA_ABM | PTA_CX16 | PTA_PRFCHW},
+ | PTA_SSSE3 | PTA_SSE4A |PTA_ABM | PTA_CX16 | PTA_PRFCHW
+ | PTA_FXSR | PTA_XSAVE | PTA_XSAVEOPT},
{"btver2", PROCESSOR_BTVER2, CPU_GENERIC64,
PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3
| PTA_SSSE3 | PTA_SSE4A |PTA_ABM | PTA_CX16 | PTA_SSE4_1
| PTA_SSE4_2 | PTA_AES | PTA_PCLMUL | PTA_AVX
- | PTA_BMI | PTA_F16C | PTA_MOVBE | PTA_PRFCHW},
+ | PTA_BMI | PTA_F16C | PTA_MOVBE | PTA_PRFCHW
+ | PTA_FXSR | PTA_XSAVE | PTA_XSAVEOPT},
{"generic32", PROCESSOR_GENERIC32, CPU_PENTIUMPRO,
PTA_HLE /* flags are only used for -march switch. */ },
@@ -3549,6 +3561,15 @@ ix86_option_override_internal (bool main_args_p)
if (processor_alias_table[i].flags & PTA_ADX
&& !(ix86_isa_flags_explicit & OPTION_MASK_ISA_ADX))
ix86_isa_flags |= OPTION_MASK_ISA_ADX;
+ if (processor_alias_table[i].flags & PTA_FXSR
+ && !(ix86_isa_flags_explicit & OPTION_MASK_ISA_FXSR))
+ ix86_isa_flags |= OPTION_MASK_ISA_FXSR;
+ if (processor_alias_table[i].flags & PTA_XSAVE
+ && !(ix86_isa_flags_explicit & OPTION_MASK_ISA_XSAVE))
+ ix86_isa_flags |= OPTION_MASK_ISA_XSAVE;
+ if (processor_alias_table[i].flags & PTA_XSAVEOPT
+ && !(ix86_isa_flags_explicit & OPTION_MASK_ISA_XSAVEOPT))
+ ix86_isa_flags |= OPTION_MASK_ISA_XSAVEOPT;
if (processor_alias_table[i].flags & (PTA_PREFETCH_SSE | PTA_SSE))
x86_prefetch_sse = true;
@@ -4368,6 +4389,9 @@ ix86_valid_target_attribute_inner_p (tree args, char *p_strings[],
IX86_ATTR_ISA ("prfchw", OPT_mprfchw),
IX86_ATTR_ISA ("rdseed", OPT_mrdseed),
IX86_ATTR_ISA ("adx", OPT_madx),
+ IX86_ATTR_ISA ("fxsr", OPT_mfxsr),
+ IX86_ATTR_ISA ("xsave", OPT_mxsave),
+ IX86_ATTR_ISA ("xsaveopt", OPT_mxsaveopt),
/* enum options */
IX86_ATTR_ENUM ("fpmath=", OPT_mfpmath_),
@@ -11786,19 +11810,11 @@ ix86_decompose_address (rtx addr, struct ix86_address *out)
else if (GET_CODE (addr) == AND
&& const_32bit_mask (XEXP (addr, 1), DImode))
{
- addr = XEXP (addr, 0);
+ addr = simplify_gen_subreg (SImode, XEXP (addr, 0), DImode, 0);
+ if (addr == NULL_RTX)
+ return 0;
- /* Adjust SUBREGs. */
- if (GET_CODE (addr) == SUBREG
- && GET_MODE (SUBREG_REG (addr)) == SImode)
- {
- addr = SUBREG_REG (addr);
- if (CONST_INT_P (addr))
- return 0;
- }
- else if (GET_MODE (addr) == DImode)
- addr = gen_rtx_SUBREG (SImode, addr, 0);
- else if (GET_MODE (addr) != VOIDmode)
+ if (CONST_INT_P (addr))
return 0;
}
}
@@ -24430,6 +24446,9 @@ insn_is_function_arg (rtx insn, bool* is_spilled)
if (!NONDEBUG_INSN_P (insn))
return false;
+ /* Call instructions are not movable, ignore it. */
+ if (CALL_P (insn))
+ return false;
insn = PATTERN (insn);
if (GET_CODE (insn) == PARALLEL)
insn = XVECEXP (insn, 0, 0);
@@ -24459,6 +24478,8 @@ add_parameter_dependencies (rtx call, rtx head)
rtx first_arg = NULL;
bool is_spilled = false;
+ head = PREV_INSN (head);
+
/* Find nearest to call argument passing instruction. */
while (true)
{
@@ -24556,26 +24577,38 @@ ix86_dependencies_evaluation_hook (rtx head, rtx tail)
rtx first_arg = NULL;
if (reload_completed)
return;
+ while (head != tail && DEBUG_INSN_P (head))
+ head = NEXT_INSN (head);
for (insn = tail; insn != head; insn = PREV_INSN (insn))
if (INSN_P (insn) && CALL_P (insn))
{
first_arg = add_parameter_dependencies (insn, head);
if (first_arg)
{
- /* Check if first argument has dependee out of its home block. */
- sd_iterator_def sd_it1;
- dep_t dep1;
- FOR_EACH_DEP (first_arg, SD_LIST_BACK, sd_it1, dep1)
+ /* Add dependee for first argument to predecessors if only
+ region contains more than one block. */
+ basic_block bb = BLOCK_FOR_INSN (insn);
+ int rgn = CONTAINING_RGN (bb->index);
+ int nr_blks = RGN_NR_BLOCKS (rgn);
+ /* Skip trivial regions and region head blocks that can have
+ predecessors outside of region. */
+ if (nr_blks > 1 && BLOCK_TO_BB (bb->index) != 0)
{
- rtx dee;
- dee = DEP_PRO (dep1);
- if (!NONDEBUG_INSN_P (dee))
- continue;
- if (BLOCK_FOR_INSN (dee) != BLOCK_FOR_INSN (first_arg))
- /* Must add dependee for first argument in dee's block. */
- add_dependee_for_func_arg (first_arg, BLOCK_FOR_INSN (dee));
+ edge e;
+ edge_iterator ei;
+ /* Assume that region is SCC, i.e. all immediate predecessors
+ of non-head block are in the same region. */
+ FOR_EACH_EDGE (e, ei, bb->preds)
+ {
+ /* Avoid creating of loop-carried dependencies through
+ using topological odering in region. */
+ if (BLOCK_TO_BB (bb->index) > BLOCK_TO_BB (e->src->index))
+ add_dependee_for_func_arg (first_arg, e->src);
+ }
}
insn = first_arg;
+ if (insn == head)
+ break;
}
}
else if (first_arg)
@@ -24750,7 +24783,7 @@ core2i7_first_cycle_multipass_issue (void *_data, char *ready_try, int n_ready,
n_ready, 0);
data->ready_try_change_size = n_ready;
}
- sbitmap_zero (data->ready_try_change);
+ bitmap_clear (data->ready_try_change);
/* Filter out insns from ready_try that the core will not be able to issue
on current cycle due to decoder. */
@@ -24769,7 +24802,7 @@ core2i7_first_cycle_multipass_backtrack (const void *_data,
unsigned int i = 0;
sbitmap_iterator sbi;
- gcc_assert (sbitmap_last_set_bit (data->ready_try_change) < n_ready);
+ gcc_assert (bitmap_last_set_bit (data->ready_try_change) < n_ready);
EXECUTE_IF_SET_IN_SBITMAP (data->ready_try_change, 0, i, sbi)
{
ready_try[i] = 0;
@@ -25570,6 +25603,19 @@ enum ix86_builtins
IX86_BUILTIN_STMXCSR,
IX86_BUILTIN_SFENCE,
+ IX86_BUILTIN_FXSAVE,
+ IX86_BUILTIN_FXRSTOR,
+ IX86_BUILTIN_FXSAVE64,
+ IX86_BUILTIN_FXRSTOR64,
+
+ IX86_BUILTIN_XSAVE,
+ IX86_BUILTIN_XRSTOR,
+ IX86_BUILTIN_XSAVE64,
+ IX86_BUILTIN_XRSTOR64,
+
+ IX86_BUILTIN_XSAVEOPT,
+ IX86_BUILTIN_XSAVEOPT64,
+
/* 3DNow! Original */
IX86_BUILTIN_FEMMS,
IX86_BUILTIN_PAVGUSB,
@@ -26776,6 +26822,19 @@ static const struct builtin_description bdesc_special_args[] =
/* 3DNow! */
{ OPTION_MASK_ISA_3DNOW, CODE_FOR_mmx_femms, "__builtin_ia32_femms", IX86_BUILTIN_FEMMS, UNKNOWN, (int) VOID_FTYPE_VOID },
+ /* FXSR, XSAVE and XSAVEOPT */
+ { OPTION_MASK_ISA_FXSR, CODE_FOR_nothing, "__builtin_ia32_fxsave", IX86_BUILTIN_FXSAVE, UNKNOWN, (int) VOID_FTYPE_PVOID },
+ { OPTION_MASK_ISA_FXSR, CODE_FOR_nothing, "__builtin_ia32_fxrstor", IX86_BUILTIN_FXRSTOR, UNKNOWN, (int) VOID_FTYPE_PVOID },
+ { OPTION_MASK_ISA_XSAVE, CODE_FOR_nothing, "__builtin_ia32_xsave", IX86_BUILTIN_XSAVE, UNKNOWN, (int) VOID_FTYPE_PVOID_INT64 },
+ { OPTION_MASK_ISA_XSAVE, CODE_FOR_nothing, "__builtin_ia32_xrstor", IX86_BUILTIN_XRSTOR, UNKNOWN, (int) VOID_FTYPE_PVOID_INT64 },
+ { OPTION_MASK_ISA_XSAVEOPT, CODE_FOR_nothing, "__builtin_ia32_xsaveopt", IX86_BUILTIN_XSAVEOPT, UNKNOWN, (int) VOID_FTYPE_PVOID_INT64 },
+
+ { OPTION_MASK_ISA_FXSR | OPTION_MASK_ISA_64BIT, CODE_FOR_nothing, "__builtin_ia32_fxsave64", IX86_BUILTIN_FXSAVE64, UNKNOWN, (int) VOID_FTYPE_PVOID },
+ { OPTION_MASK_ISA_FXSR | OPTION_MASK_ISA_64BIT, CODE_FOR_nothing, "__builtin_ia32_fxrstor64", IX86_BUILTIN_FXRSTOR64, UNKNOWN, (int) VOID_FTYPE_PVOID },
+ { OPTION_MASK_ISA_XSAVE | OPTION_MASK_ISA_64BIT, CODE_FOR_nothing, "__builtin_ia32_xsave64", IX86_BUILTIN_XSAVE64, UNKNOWN, (int) VOID_FTYPE_PVOID_INT64 },
+ { OPTION_MASK_ISA_XSAVE | OPTION_MASK_ISA_64BIT, CODE_FOR_nothing, "__builtin_ia32_xrstor64", IX86_BUILTIN_XRSTOR64, UNKNOWN, (int) VOID_FTYPE_PVOID_INT64 },
+ { OPTION_MASK_ISA_XSAVEOPT | OPTION_MASK_ISA_64BIT, CODE_FOR_nothing, "__builtin_ia32_xsaveopt64", IX86_BUILTIN_XSAVEOPT64, UNKNOWN, (int) VOID_FTYPE_PVOID_INT64 },
+
/* SSE */
{ OPTION_MASK_ISA_SSE, CODE_FOR_sse_storeups, "__builtin_ia32_storeups", IX86_BUILTIN_STOREUPS, UNKNOWN, (int) VOID_FTYPE_PFLOAT_V4SF },
{ OPTION_MASK_ISA_SSE, CODE_FOR_sse_movntv4sf, "__builtin_ia32_movntps", IX86_BUILTIN_MOVNTPS, UNKNOWN, (int) VOID_FTYPE_PFLOAT_V4SF },
@@ -30690,6 +30749,118 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
emit_move_insn (target, op0);
return target;
+ case IX86_BUILTIN_FXSAVE:
+ case IX86_BUILTIN_FXRSTOR:
+ case IX86_BUILTIN_FXSAVE64:
+ case IX86_BUILTIN_FXRSTOR64:
+ switch (fcode)
+ {
+ case IX86_BUILTIN_FXSAVE:
+ icode = CODE_FOR_fxsave;
+ break;
+ case IX86_BUILTIN_FXRSTOR:
+ icode = CODE_FOR_fxrstor;
+ break;
+ case IX86_BUILTIN_FXSAVE64:
+ icode = CODE_FOR_fxsave64;
+ break;
+ case IX86_BUILTIN_FXRSTOR64:
+ icode = CODE_FOR_fxrstor64;
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
+ arg0 = CALL_EXPR_ARG (exp, 0);
+ op0 = expand_normal (arg0);
+
+ if (!address_operand (op0, VOIDmode))
+ {
+ op0 = convert_memory_address (Pmode, op0);
+ op0 = copy_addr_to_reg (op0);
+ }
+ op0 = gen_rtx_MEM (BLKmode, op0);
+
+ pat = GEN_FCN (icode) (op0);
+ if (pat)
+ emit_insn (pat);
+ return 0;
+
+ case IX86_BUILTIN_XSAVE:
+ case IX86_BUILTIN_XRSTOR:
+ case IX86_BUILTIN_XSAVE64:
+ case IX86_BUILTIN_XRSTOR64:
+ case IX86_BUILTIN_XSAVEOPT:
+ case IX86_BUILTIN_XSAVEOPT64:
+ arg0 = CALL_EXPR_ARG (exp, 0);
+ arg1 = CALL_EXPR_ARG (exp, 1);
+ op0 = expand_normal (arg0);
+ op1 = expand_normal (arg1);
+
+ if (!address_operand (op0, VOIDmode))
+ {
+ op0 = convert_memory_address (Pmode, op0);
+ op0 = copy_addr_to_reg (op0);
+ }
+ op0 = gen_rtx_MEM (BLKmode, op0);
+
+ op1 = force_reg (DImode, op1);
+
+ if (TARGET_64BIT)
+ {
+ op2 = expand_simple_binop (DImode, LSHIFTRT, op1, GEN_INT (32),
+ NULL, 1, OPTAB_DIRECT);
+ switch (fcode)
+ {
+ case IX86_BUILTIN_XSAVE:
+ icode = CODE_FOR_xsave_rex64;
+ break;
+ case IX86_BUILTIN_XRSTOR:
+ icode = CODE_FOR_xrstor_rex64;
+ break;
+ case IX86_BUILTIN_XSAVE64:
+ icode = CODE_FOR_xsave64;
+ break;
+ case IX86_BUILTIN_XRSTOR64:
+ icode = CODE_FOR_xrstor64;
+ break;
+ case IX86_BUILTIN_XSAVEOPT:
+ icode = CODE_FOR_xsaveopt_rex64;
+ break;
+ case IX86_BUILTIN_XSAVEOPT64:
+ icode = CODE_FOR_xsaveopt64;
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
+ op2 = gen_lowpart (SImode, op2);
+ op1 = gen_lowpart (SImode, op1);
+ pat = GEN_FCN (icode) (op0, op1, op2);
+ }
+ else
+ {
+ switch (fcode)
+ {
+ case IX86_BUILTIN_XSAVE:
+ icode = CODE_FOR_xsave;
+ break;
+ case IX86_BUILTIN_XRSTOR:
+ icode = CODE_FOR_xrstor;
+ break;
+ case IX86_BUILTIN_XSAVEOPT:
+ icode = CODE_FOR_xsaveopt;
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ pat = GEN_FCN (icode) (op0, op1);
+ }
+
+ if (pat)
+ emit_insn (pat);
+ return 0;
+
case IX86_BUILTIN_LLWPCB:
arg0 = CALL_EXPR_ARG (exp, 0);
op0 = expand_normal (arg0);
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index f923a973b64..712d00a5ed8 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -79,6 +79,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define TARGET_RDSEED TARGET_ISA_RDSEED
#define TARGET_PRFCHW TARGET_ISA_PRFCHW
#define TARGET_ADX TARGET_ISA_ADX
+#define TARGET_FXSR TARGET_ISA_FXSR
+#define TARGET_XSAVE TARGET_ISA_XSAVE
+#define TARGET_XSAVEOPT TARGET_ISA_XSAVEOPT
#define TARGET_LP64 TARGET_ABI_64
#define TARGET_X32 TARGET_ABI_X32
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 049d53494f9..538120c8f22 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -202,6 +202,16 @@
UNSPECV_RDGSBASE
UNSPECV_WRFSBASE
UNSPECV_WRGSBASE
+ UNSPECV_FXSAVE
+ UNSPECV_FXRSTOR
+ UNSPECV_FXSAVE64
+ UNSPECV_FXRSTOR64
+ UNSPECV_XSAVE
+ UNSPECV_XRSTOR
+ UNSPECV_XSAVE64
+ UNSPECV_XRSTOR64
+ UNSPECV_XSAVEOPT
+ UNSPECV_XSAVEOPT64
;; For RDRAND support
UNSPECV_RDRAND
@@ -5492,9 +5502,7 @@
(match_operand:SWI48 1 "lea_address_operand" "p"))]
""
{
- rtx addr = operands[1];
-
- if (SImode_address_operand (addr, VOIDmode))
+ if (SImode_address_operand (operands[1], VOIDmode))
{
gcc_assert (TARGET_64BIT);
return "lea{l}\t{%E1, %k0|%k0, %E1}";
@@ -9592,10 +9600,10 @@
"TARGET_64BIT && reload_completed
&& true_regnum (operands[0]) != true_regnum (operands[1])"
[(set (match_dup 0)
- (zero_extend:DI (subreg:SI (mult:DI (match_dup 1) (match_dup 2)) 0)))]
+ (zero_extend:DI (mult:SI (match_dup 1) (match_dup 2))))]
{
- operands[1] = gen_lowpart (DImode, operands[1]);
- operands[2] = gen_int_mode (1 << INTVAL (operands[2]), DImode);
+ operands[1] = gen_lowpart (SImode, operands[1]);
+ operands[2] = gen_int_mode (1 << INTVAL (operands[2]), SImode);
})
;; This pattern can't accept a variable shift count, since shifts by
@@ -17350,28 +17358,6 @@
(clobber (reg:CC FLAGS_REG))])])
(define_peephole2
- [(set (match_operand:SI 0 "register_operand")
- (subreg:SI (plus:DI (match_operand:DI 1 "register_operand")
- (match_operand:DI 2 "nonmemory_operand")) 0))]
- "TARGET_64BIT && !TARGET_OPT_AGU
- && REGNO (operands[0]) == REGNO (operands[1])
- && peep2_regno_dead_p (0, FLAGS_REG)"
- [(parallel [(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 2)))
- (clobber (reg:CC FLAGS_REG))])]
- "operands[2] = gen_lowpart (SImode, operands[2]);")
-
-(define_peephole2
- [(set (match_operand:SI 0 "register_operand")
- (subreg:SI (plus:DI (match_operand:DI 1 "nonmemory_operand")
- (match_operand:DI 2 "register_operand")) 0))]
- "TARGET_64BIT && !TARGET_OPT_AGU
- && REGNO (operands[0]) == REGNO (operands[2])
- && peep2_regno_dead_p (0, FLAGS_REG)"
- [(parallel [(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 1)))
- (clobber (reg:CC FLAGS_REG))])]
- "operands[1] = gen_lowpart (SImode, operands[1]);")
-
-(define_peephole2
[(set (match_operand:DI 0 "register_operand")
(zero_extend:DI
(plus:SI (match_operand:SI 1 "register_operand")
@@ -17396,36 +17382,6 @@
(clobber (reg:CC FLAGS_REG))])])
(define_peephole2
- [(set (match_operand:DI 0 "register_operand")
- (zero_extend:DI
- (subreg:SI (plus:DI (match_dup 0)
- (match_operand:DI 1 "nonmemory_operand")) 0)))]
- "TARGET_64BIT && !TARGET_OPT_AGU
- && peep2_regno_dead_p (0, FLAGS_REG)"
- [(parallel [(set (match_dup 0)
- (zero_extend:DI (plus:SI (match_dup 2) (match_dup 1))))
- (clobber (reg:CC FLAGS_REG))])]
-{
- operands[1] = gen_lowpart (SImode, operands[1]);
- operands[2] = gen_lowpart (SImode, operands[0]);
-})
-
-(define_peephole2
- [(set (match_operand:DI 0 "register_operand")
- (zero_extend:DI
- (subreg:SI (plus:DI (match_operand:DI 1 "nonmemory_operand")
- (match_dup 0)) 0)))]
- "TARGET_64BIT && !TARGET_OPT_AGU
- && peep2_regno_dead_p (0, FLAGS_REG)"
- [(parallel [(set (match_dup 0)
- (zero_extend:DI (plus:SI (match_dup 2) (match_dup 1))))
- (clobber (reg:CC FLAGS_REG))])]
-{
- operands[1] = gen_lowpart (SImode, operands[1]);
- operands[2] = gen_lowpart (SImode, operands[0]);
-})
-
-(define_peephole2
[(set (match_operand:SWI48 0 "register_operand")
(mult:SWI48 (match_dup 0)
(match_operand:SWI48 1 "const_int_operand")))]
@@ -17436,18 +17392,6 @@
"operands[1] = GEN_INT (exact_log2 (INTVAL (operands[1])));")
(define_peephole2
- [(set (match_operand:SI 0 "register_operand")
- (subreg:SI (mult:DI (match_operand:DI 1 "register_operand")
- (match_operand:DI 2 "const_int_operand")) 0))]
- "TARGET_64BIT
- && exact_log2 (INTVAL (operands[2])) >= 0
- && REGNO (operands[0]) == REGNO (operands[1])
- && peep2_regno_dead_p (0, FLAGS_REG)"
- [(parallel [(set (match_dup 0) (ashift:SI (match_dup 0) (match_dup 2)))
- (clobber (reg:CC FLAGS_REG))])]
- "operands[2] = GEN_INT (exact_log2 (INTVAL (operands[2])));")
-
-(define_peephole2
[(set (match_operand:DI 0 "register_operand")
(zero_extend:DI
(mult:SI (match_operand:SI 1 "register_operand")
@@ -17461,22 +17405,6 @@
(clobber (reg:CC FLAGS_REG))])]
"operands[2] = GEN_INT (exact_log2 (INTVAL (operands[2])));")
-(define_peephole2
- [(set (match_operand:DI 0 "register_operand")
- (zero_extend:DI
- (subreg:SI (mult:DI (match_dup 0)
- (match_operand:DI 1 "const_int_operand")) 0)))]
- "TARGET_64BIT
- && exact_log2 (INTVAL (operands[2])) >= 0
- && peep2_regno_dead_p (0, FLAGS_REG)"
- [(parallel [(set (match_dup 0)
- (zero_extend:DI (ashift:SI (match_dup 2) (match_dup 1))))
- (clobber (reg:CC FLAGS_REG))])]
-{
- operands[1] = GEN_INT (exact_log2 (INTVAL (operands[1])));
- operands[2] = gen_lowpart (SImode, operands[0]);
-})
-
;; The ESP adjustments can be done by the push and pop instructions. Resulting
;; code is shorter, since push is only 1 byte, while add imm, %esp is 3 bytes.
;; On many CPUs it is also faster, since special hardware to avoid esp
@@ -18031,6 +17959,142 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
+;; FXSR, XSAVE and XSAVEOPT instructions
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(define_insn "fxsave"
+ [(set (match_operand:BLK 0 "memory_operand" "=m")
+ (unspec_volatile:BLK [(const_int 0)] UNSPECV_FXSAVE))]
+ "TARGET_FXSR"
+ "fxsave\t%0"
+ [(set_attr "type" "other")
+ (set_attr "memory" "store")
+ (set (attr "length")
+ (symbol_ref "ix86_attr_length_address_default (insn) + 3"))])
+
+(define_insn "fxsave64"
+ [(set (match_operand:BLK 0 "memory_operand" "=m")
+ (unspec_volatile:BLK [(const_int 0)] UNSPECV_FXSAVE64))]
+ "TARGET_64BIT && TARGET_FXSR"
+ "fxsave64\t%0"
+ [(set_attr "type" "other")
+ (set_attr "memory" "store")
+ (set (attr "length")
+ (symbol_ref "ix86_attr_length_address_default (insn) + 4"))])
+
+(define_insn "fxrstor"
+ [(unspec_volatile [(match_operand:BLK 0 "memory_operand" "m")]
+ UNSPECV_FXRSTOR)]
+ "TARGET_FXSR"
+ "fxrstor\t%0"
+ [(set_attr "type" "other")
+ (set_attr "memory" "load")
+ (set (attr "length")
+ (symbol_ref "ix86_attr_length_address_default (insn) + 3"))])
+
+(define_insn "fxrstor64"
+ [(unspec_volatile [(match_operand:BLK 0 "memory_operand" "m")]
+ UNSPECV_FXRSTOR64)]
+ "TARGET_64BIT && TARGET_FXSR"
+ "fxrstor64\t%0"
+ [(set_attr "type" "other")
+ (set_attr "memory" "load")
+ (set (attr "length")
+ (symbol_ref "ix86_attr_length_address_default (insn) + 4"))])
+
+(define_int_iterator ANY_XSAVE
+ [UNSPECV_XSAVE
+ (UNSPECV_XSAVEOPT "TARGET_XSAVEOPT")])
+
+(define_int_iterator ANY_XSAVE64
+ [UNSPECV_XSAVE64
+ (UNSPECV_XSAVEOPT64 "TARGET_XSAVEOPT")])
+
+(define_int_attr xsave
+ [(UNSPECV_XSAVE "xsave")
+ (UNSPECV_XSAVE64 "xsave64")
+ (UNSPECV_XSAVEOPT "xsaveopt")
+ (UNSPECV_XSAVEOPT64 "xsaveopt64")])
+
+(define_insn "<xsave>"
+ [(set (match_operand:BLK 0 "memory_operand" "=m")
+ (unspec_volatile:BLK
+ [(match_operand:DI 1 "register_operand" "A")]
+ ANY_XSAVE))]
+ "!TARGET_64BIT && TARGET_XSAVE"
+ "<xsave>\t%0"
+ [(set_attr "type" "other")
+ (set_attr "memory" "store")
+ (set (attr "length")
+ (symbol_ref "ix86_attr_length_address_default (insn) + 3"))])
+
+(define_insn "<xsave>_rex64"
+ [(set (match_operand:BLK 0 "memory_operand" "=m")
+ (unspec_volatile:BLK
+ [(match_operand:SI 1 "register_operand" "a")
+ (match_operand:SI 2 "register_operand" "d")]
+ ANY_XSAVE))]
+ "TARGET_64BIT && TARGET_XSAVE"
+ "<xsave>\t%0"
+ [(set_attr "type" "other")
+ (set_attr "memory" "store")
+ (set (attr "length")
+ (symbol_ref "ix86_attr_length_address_default (insn) + 3"))])
+
+(define_insn "<xsave>"
+ [(set (match_operand:BLK 0 "memory_operand" "=m")
+ (unspec_volatile:BLK
+ [(match_operand:SI 1 "register_operand" "a")
+ (match_operand:SI 2 "register_operand" "d")]
+ ANY_XSAVE64))]
+ "TARGET_64BIT && TARGET_XSAVE"
+ "<xsave>\t%0"
+ [(set_attr "type" "other")
+ (set_attr "memory" "store")
+ (set (attr "length")
+ (symbol_ref "ix86_attr_length_address_default (insn) + 4"))])
+
+(define_insn "xrstor"
+ [(unspec_volatile:BLK
+ [(match_operand:BLK 0 "memory_operand" "m")
+ (match_operand:DI 1 "register_operand" "A")]
+ UNSPECV_XRSTOR)]
+ "!TARGET_64BIT && TARGET_XSAVE"
+ "xrstor\t%0"
+ [(set_attr "type" "other")
+ (set_attr "memory" "load")
+ (set (attr "length")
+ (symbol_ref "ix86_attr_length_address_default (insn) + 3"))])
+
+(define_insn "xrstor_rex64"
+ [(unspec_volatile:BLK
+ [(match_operand:BLK 0 "memory_operand" "m")
+ (match_operand:SI 1 "register_operand" "a")
+ (match_operand:SI 2 "register_operand" "d")]
+ UNSPECV_XRSTOR)]
+ "TARGET_64BIT && TARGET_XSAVE"
+ "xrstor\t%0"
+ [(set_attr "type" "other")
+ (set_attr "memory" "load")
+ (set (attr "length")
+ (symbol_ref "ix86_attr_length_address_default (insn) + 3"))])
+
+(define_insn "xrstor64"
+ [(unspec_volatile:BLK
+ [(match_operand:BLK 0 "memory_operand" "m")
+ (match_operand:SI 1 "register_operand" "a")
+ (match_operand:SI 2 "register_operand" "d")]
+ UNSPECV_XRSTOR64)]
+ "TARGET_64BIT && TARGET_XSAVE"
+ "xrstor64\t%0"
+ [(set_attr "type" "other")
+ (set_attr "memory" "load")
+ (set (attr "length")
+ (symbol_ref "ix86_attr_length_address_default (insn) + 4"))])
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
;; LWP instructions
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt
index 6a389947d90..dc59c479fe8 100644
--- a/gcc/config/i386/i386.opt
+++ b/gcc/config/i386/i386.opt
@@ -552,6 +552,18 @@ madx
Target Report Mask(ISA_ADX) Var(ix86_isa_flags) Save
Support flag-preserving add-carry instructions
+mfxsr
+Target Report Mask(ISA_FXSR) Var(ix86_isa_flags) Save
+Support FXSAVE and FXRSTOR instructions
+
+mxsave
+Target Report Mask(ISA_XSAVE) Var(ix86_isa_flags) Save
+Support XSAVE and XRSTOR instructions
+
+mxsaveopt
+Target Report Mask(ISA_XSAVEOPT) Var(ix86_isa_flags) Save
+Support XSAVEOPT instruction
+
mtbm
Target Report Mask(ISA_TBM) Var(ix86_isa_flags) Save
Support TBM built-in functions and code generation
diff --git a/gcc/config/i386/x86intrin.h b/gcc/config/i386/x86intrin.h
index fae6491c49f..8b6df7a0fd7 100644
--- a/gcc/config/i386/x86intrin.h
+++ b/gcc/config/i386/x86intrin.h
@@ -105,6 +105,18 @@
#include <prfchwintrin.h>
#endif
+#ifdef __FXSR__
+#include <fxsrintrin.h>
+#endif
+
+#ifdef __XSAVE__
+#include <xsaveintrin.h>
+#endif
+
+#ifdef __XSAVEOPT__
+#include <xsaveoptintrin.h>
+#endif
+
#include <adxintrin.h>
#endif /* _X86INTRIN_H_INCLUDED */
diff --git a/gcc/config/i386/xsaveintrin.h b/gcc/config/i386/xsaveintrin.h
new file mode 100644
index 00000000000..0acae2720b1
--- /dev/null
+++ b/gcc/config/i386/xsaveintrin.h
@@ -0,0 +1,61 @@
+/* Copyright (C) 2012 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ 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/>. */
+
+/* #if !defined _X86INTRIN_H_INCLUDED && !defined _IMMINTRIN_H_INCLUDED */
+/* # error "Never use <xsaveintrin.h> directly; include <x86intrin.h> instead." */
+/* #endif */
+
+#ifndef _XSAVEINTRIN_H_INCLUDED
+#define _XSAVEINTRIN_H_INCLUDED
+
+extern __inline void
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_xsave (void *__P, long long __M)
+{
+ return __builtin_ia32_xsave (__P, __M);
+}
+
+extern __inline void
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_xrstor (void *__P, long long __M)
+{
+ return __builtin_ia32_xrstor (__P, __M);
+}
+
+#ifdef __x86_64__
+extern __inline void
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_xsave64 (void *__P, long long __M)
+{
+ return __builtin_ia32_xsave64 (__P, __M);
+}
+
+extern __inline void
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_xrstor64 (void *__P, long long __M)
+{
+ return __builtin_ia32_xrstor64 (__P, __M);
+}
+#endif
+
+#endif /* _XSAVEINTRIN_H_INCLUDED */
diff --git a/gcc/config/i386/xsaveoptintrin.h b/gcc/config/i386/xsaveoptintrin.h
new file mode 100644
index 00000000000..cc962a16966
--- /dev/null
+++ b/gcc/config/i386/xsaveoptintrin.h
@@ -0,0 +1,47 @@
+/* Copyright (C) 2012 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ 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/>. */
+
+/* #if !defined _X86INTRIN_H_INCLUDED && !defined _IMMINTRIN_H_INCLUDED */
+/* # error "Never use <xsaveoptintrin.h> directly; include <x86intrin.h> instead." */
+/* #endif */
+
+#ifndef _XSAVEOPTINTRIN_H_INCLUDED
+#define _XSAVEOPTINTRIN_H_INCLUDED
+
+extern __inline void
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_xsaveopt (void *__P, long long __M)
+{
+ return __builtin_ia32_xsaveopt (__P, __M);
+}
+
+#ifdef __x86_64__
+extern __inline void
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_xsaveopt64 (void *__P, long long __M)
+{
+ return __builtin_ia32_xsaveopt64 (__P, __M);
+}
+#endif
+
+#endif /* _XSAVEOPTINTRIN_H_INCLUDED */
diff --git a/gcc/config/microblaze/rtems.h b/gcc/config/microblaze/rtems.h
new file mode 100644
index 00000000000..fecf7a295d5
--- /dev/null
+++ b/gcc/config/microblaze/rtems.h
@@ -0,0 +1,25 @@
+/* Definitions for rtems targeting a microblaze using ELF.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+/* Specify predefined symbols in preprocessor. */
+
+#define TARGET_OS_CPP_BUILTINS() do { \
+ builtin_define( "__rtems__" ); \
+ builtin_assert( "system=rtems" ); \
+} while (0)
diff --git a/gcc/config/microblaze/t-rtems b/gcc/config/microblaze/t-rtems
new file mode 100644
index 00000000000..d0c38261aaa
--- /dev/null
+++ b/gcc/config/microblaze/t-rtems
@@ -0,0 +1 @@
+# Custom multilibs for RTEMS
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index b8675927715..cc90e06b067 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -14828,7 +14828,7 @@ r10k_insert_cache_barriers (void)
/* Bit X of PROTECTED_BBS is set if the last operation in basic block
X is protected by a cache barrier. */
protected_bbs = sbitmap_alloc (last_basic_block);
- sbitmap_zero (protected_bbs);
+ bitmap_clear (protected_bbs);
/* Iterate over the basic blocks in reverse post-order. */
rev_post_order = XNEWVEC (int, last_basic_block);
diff --git a/gcc/config/mips/mti-linux.h b/gcc/config/mips/mti-linux.h
index 36c003c60cb..cda9bdc83c9 100644
--- a/gcc/config/mips/mti-linux.h
+++ b/gcc/config/mips/mti-linux.h
@@ -21,7 +21,7 @@ along with GCC; see the file COPYING3. If not see
/* This target is a multilib target, specify the sysroot paths. */
#undef SYSROOT_SUFFIX_SPEC
#define SYSROOT_SUFFIX_SPEC \
- "%{mips32:/mips32}%{mips64:/mips64}%{mips64r2:/mips64r2}%{msoft-float:/sof}%{mel|EL:/el}%{mabi=64:/64}%{mabi=n32:/n32}"
+ "%{mips32:/mips32}%{mips64:/mips64}%{mips64r2:/mips64r2}%{mabi=64:/64}%{mel|EL:/el}%{msoft-float:/sof}"
#undef DRIVER_SELF_SPECS
#define DRIVER_SELF_SPECS \
@@ -36,6 +36,10 @@ along with GCC; see the file COPYING3. If not see
/* Infer the -msynci setting from -march if not explicitly set. */ \
MIPS_ISA_SYNCI_SPEC, \
\
+ /* If no ABI option is specified, infer one from the ISA level \
+ or -mgp setting. */ \
+ "%{!mabi=*: %{" MIPS_32BIT_OPTION_SPEC ": -mabi=32;: -mabi=n32}}", \
+ \
/* Base SPECs. */ \
BASE_DRIVER_SELF_SPECS \
\
diff --git a/gcc/config/mips/t-mti-linux b/gcc/config/mips/t-mti-linux
index ba11706ffee..6d280cdbcfd 100644
--- a/gcc/config/mips/t-mti-linux
+++ b/gcc/config/mips/t-mti-linux
@@ -19,6 +19,15 @@
# The default build is mips32r2, hard-float big-endian. Add mips32,
# soft-float, and little-endian variations.
-MULTILIB_OPTIONS = mips32/mips64/mips64r2 msoft-float EL
-MULTILIB_DIRNAMES = mips32 mips64 mips64r2 sof el
+MULTILIB_OPTIONS = mips32/mips64/mips64r2 mabi=64 EL msoft-float
+MULTILIB_DIRNAMES = mips32 mips64 mips64r2 64 el sof
MULTILIB_MATCHES = EL=mel EB=meb
+
+# The 64 bit ABI is not supported on the mips32 architecture.
+MULTILIB_EXCEPTIONS += *mips32*/*mabi=64*
+
+# The 64 bit ABI is not supported on the mips32r2 architecture.
+# Because mips32r2 is the default we can't use that flag to trigger
+# the exception so we check for mabi=64 with no specific mips flag
+# instead.
+MULTILIB_EXCEPTIONS += mabi=64*
diff --git a/gcc/config/rl78/rl78.c b/gcc/config/rl78/rl78.c
index 990c1bb8139..5e5050bca13 100644
--- a/gcc/config/rl78/rl78.c
+++ b/gcc/config/rl78/rl78.c
@@ -686,6 +686,13 @@ rl78_as_legitimate_address (enum machine_mode mode ATTRIBUTE_UNUSED, rtx x,
if (! characterize_address (x, &base, &index, &addend))
return false;
+ /* We can't extract the high/low portions of a PLUS address
+ involving a register during devirtualization, so make sure all
+ such __far addresses do not have addends. This forces GCC to do
+ the sum separately. */
+ if (addend && base && as == ADDR_SPACE_FAR)
+ return false;
+
if (base && index)
{
int ir = REGNO (index);
diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md
index 7ca496f937a..5384d0297dc 100644
--- a/gcc/config/rs6000/altivec.md
+++ b/gcc/config/rs6000/altivec.md
@@ -165,8 +165,8 @@
;; Vector move instructions.
(define_insn "*altivec_mov<mode>"
- [(set (match_operand:VM2 0 "nonimmediate_operand" "=Z,v,v,*o,*r,*r,v,v")
- (match_operand:VM2 1 "input_operand" "v,Z,v,r,o,r,j,W"))]
+ [(set (match_operand:VM2 0 "nonimmediate_operand" "=Z,v,v,*Y,*r,*r,v,v")
+ (match_operand:VM2 1 "input_operand" "v,Z,v,r,Y,r,j,W"))]
"VECTOR_MEM_ALTIVEC_P (<MODE>mode)
&& (register_operand (operands[0], <MODE>mode)
|| register_operand (operands[1], <MODE>mode))"
@@ -190,8 +190,8 @@
;; is for unions. However for plain data movement, slightly favor the vector
;; loads
(define_insn "*altivec_movti"
- [(set (match_operand:TI 0 "nonimmediate_operand" "=Z,v,v,?o,?r,?r,v,v")
- (match_operand:TI 1 "input_operand" "v,Z,v,r,o,r,j,W"))]
+ [(set (match_operand:TI 0 "nonimmediate_operand" "=Z,v,v,?Y,?r,?r,v,v")
+ (match_operand:TI 1 "input_operand" "v,Z,v,r,Y,r,j,W"))]
"VECTOR_MEM_ALTIVEC_P (TImode)
&& (register_operand (operands[0], TImode)
|| register_operand (operands[1], TImode))"
diff --git a/gcc/config/rs6000/dfp.md b/gcc/config/rs6000/dfp.md
index 9dadf6fa4a5..7dd62b71736 100644
--- a/gcc/config/rs6000/dfp.md
+++ b/gcc/config/rs6000/dfp.md
@@ -426,12 +426,12 @@
"TARGET_HARD_FLOAT && TARGET_FPRS"
"{ rs6000_emit_move (operands[0], operands[1], TDmode); DONE; }")
-; It's important to list the o->f and f->o moves before f->f because
-; otherwise reload, given m->f, will try to pick f->f and reload it,
-; which doesn't make progress. Likewise r->Y must be before r->r.
+; It's important to list the Y->r and r->Y moves before r->r because
+; otherwise reload, given m->r, will try to pick r->r and reload it,
+; which doesn't make progress.
(define_insn_and_split "*movtd_internal"
- [(set (match_operand:TD 0 "nonimmediate_operand" "=o,d,d,r,Y,r")
- (match_operand:TD 1 "input_operand" "d,o,d,YGHF,r,r"))]
+ [(set (match_operand:TD 0 "nonimmediate_operand" "=m,d,d,Y,r,r")
+ (match_operand:TD 1 "input_operand" "d,m,d,r,YGHF,r"))]
"TARGET_HARD_FLOAT && TARGET_FPRS
&& (gpc_reg_operand (operands[0], TDmode)
|| gpc_reg_operand (operands[1], TDmode))"
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index 28ba8f8f6a8..4d2c36503fb 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -318,6 +318,8 @@ extern int dot_symbols;
builtin_define ("__PPC64__"); \
builtin_define ("__powerpc__"); \
builtin_define ("__powerpc64__"); \
+ if (!DOT_SYMBOLS) \
+ builtin_define ("_CALL_LINUX"); \
builtin_assert ("cpu=powerpc64"); \
builtin_assert ("machine=powerpc64"); \
} \
diff --git a/gcc/config/rs6000/paired.md b/gcc/config/rs6000/paired.md
index 9dce18d8149..cfce1992b4e 100644
--- a/gcc/config/rs6000/paired.md
+++ b/gcc/config/rs6000/paired.md
@@ -201,8 +201,8 @@
[(set_attr "type" "fp")])
(define_insn "*movv2sf_paired"
- [(set (match_operand:V2SF 0 "nonimmediate_operand" "=Z,f,f,o,r,r,f")
- (match_operand:V2SF 1 "input_operand" "f,Z,f,r,o,r,W"))]
+ [(set (match_operand:V2SF 0 "nonimmediate_operand" "=Z,f,f,Y,r,r,f")
+ (match_operand:V2SF 1 "input_operand" "f,Z,f,r,Y,r,W"))]
"TARGET_PAIRED_FLOAT
&& (register_operand (operands[0], V2SFmode)
|| register_operand (operands[1], V2SFmode))"
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 0c67411f7fa..3fa7b5166a9 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -6197,27 +6197,6 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode,
return x;
}
- /* Force ld/std non-word aligned offset into base register by wrapping
- in offset 0. */
- if (GET_CODE (x) == PLUS
- && GET_CODE (XEXP (x, 0)) == REG
- && REGNO (XEXP (x, 0)) < 32
- && INT_REG_OK_FOR_BASE_P (XEXP (x, 0), 1)
- && GET_CODE (XEXP (x, 1)) == CONST_INT
- && reg_offset_p
- && (INTVAL (XEXP (x, 1)) & 3) != 0
- && VECTOR_MEM_NONE_P (mode)
- && GET_MODE_SIZE (mode) >= UNITS_PER_WORD
- && TARGET_POWERPC64)
- {
- x = gen_rtx_PLUS (GET_MODE (x), x, GEN_INT (0));
- push_reload (XEXP (x, 0), NULL_RTX, &XEXP (x, 0), NULL,
- BASE_REG_CLASS, GET_MODE (x), VOIDmode, 0, 0,
- opnum, (enum reload_type) type);
- *win = 1;
- return x;
- }
-
if (GET_CODE (x) == PLUS
&& GET_CODE (XEXP (x, 0)) == REG
&& REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 2625bd72c07..25fed1ffa8f 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -3126,13 +3126,15 @@
FAIL;
if (TARGET_POWERPC64 && GET_MODE (operands[0]) == DImode)
- emit_insn (gen_insvdi (operands[0], operands[1], operands[2], operands[3]));
+ emit_insn (gen_insvdi_internal (operands[0], operands[1], operands[2],
+ operands[3]));
else
- emit_insn (gen_insvsi (operands[0], operands[1], operands[2], operands[3]));
+ emit_insn (gen_insvsi_internal (operands[0], operands[1], operands[2],
+ operands[3]));
DONE;
}")
-(define_insn "insvsi"
+(define_insn "insvsi_internal"
[(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
(match_operand:SI 1 "const_int_operand" "i")
(match_operand:SI 2 "const_int_operand" "i"))
@@ -3267,7 +3269,7 @@
}"
[(set_attr "type" "insert_word")])
-(define_insn "insvdi"
+(define_insn "insvdi_internal"
[(set (zero_extract:DI (match_operand:DI 0 "gpc_reg_operand" "+r")
(match_operand:SI 1 "const_int_operand" "i")
(match_operand:SI 2 "const_int_operand" "i"))
@@ -3339,13 +3341,15 @@
FAIL;
if (TARGET_POWERPC64 && GET_MODE (operands[1]) == DImode)
- emit_insn (gen_extzvdi (operands[0], operands[1], operands[2], operands[3]));
+ emit_insn (gen_extzvdi_internal (operands[0], operands[1], operands[2],
+ operands[3]));
else
- emit_insn (gen_extzvsi (operands[0], operands[1], operands[2], operands[3]));
+ emit_insn (gen_extzvsi_internal (operands[0], operands[1], operands[2],
+ operands[3]));
DONE;
}")
-(define_insn "extzvsi"
+(define_insn "extzvsi_internal"
[(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(zero_extract:SI (match_operand:SI 1 "gpc_reg_operand" "r")
(match_operand:SI 2 "const_int_operand" "i")
@@ -3472,7 +3476,7 @@
(const_int 0)))]
"")
-(define_insn "extzvdi"
+(define_insn "extzvdi_internal"
[(set (match_operand:DI 0 "gpc_reg_operand" "=r")
(zero_extract:DI (match_operand:DI 1 "gpc_reg_operand" "r")
(match_operand:SI 2 "const_int_operand" "i")
diff --git a/gcc/config/rs6000/sync.md b/gcc/config/rs6000/sync.md
index 42ac90373e5..ddf2ae74945 100644
--- a/gcc/config/rs6000/sync.md
+++ b/gcc/config/rs6000/sync.md
@@ -174,7 +174,7 @@
;; opcode that is "phased-in". Not implemented as of Power7, so not yet used,
;; but let's prepare the macros anyway.
-(define_mode_iterator ATOMIC [SI (DI "TARGET_64BIT")])
+(define_mode_iterator ATOMIC [SI (DI "TARGET_POWERPC64")])
(define_insn "load_locked<mode>"
[(set (match_operand:ATOMIC 0 "gpc_reg_operand" "=r")
diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md
index 58db3cfb9bf..39374b2c2ba 100644
--- a/gcc/config/rs6000/vsx.md
+++ b/gcc/config/rs6000/vsx.md
@@ -209,8 +209,8 @@
;; VSX moves
(define_insn "*vsx_mov<mode>"
- [(set (match_operand:VSX_M 0 "nonimmediate_operand" "=Z,<VSr>,<VSr>,?Z,?wa,?wa,*o,*r,*r,<VSr>,?wa,v,wZ,v")
- (match_operand:VSX_M 1 "input_operand" "<VSr>,Z,<VSr>,wa,Z,wa,r,o,r,j,j,W,v,wZ"))]
+ [(set (match_operand:VSX_M 0 "nonimmediate_operand" "=Z,<VSr>,<VSr>,?Z,?wa,?wa,*Y,*r,*r,<VSr>,?wa,v,wZ,v")
+ (match_operand:VSX_M 1 "input_operand" "<VSr>,Z,<VSr>,wa,Z,wa,r,Y,r,j,j,W,v,wZ"))]
"VECTOR_MEM_VSX_P (<MODE>mode)
&& (register_operand (operands[0], <MODE>mode)
|| register_operand (operands[1], <MODE>mode))"
@@ -272,8 +272,8 @@
;; Unlike other VSX moves, allow the GPRs, since a normal use of TImode is for
;; unions. However for plain data movement, slightly favor the vector loads
(define_insn "*vsx_movti"
- [(set (match_operand:TI 0 "nonimmediate_operand" "=Z,wa,wa,?o,?r,?r,wa,v,v,wZ")
- (match_operand:TI 1 "input_operand" "wa,Z,wa,r,o,r,j,W,wZ,v"))]
+ [(set (match_operand:TI 0 "nonimmediate_operand" "=Z,wa,wa,?Y,?r,?r,wa,v,v,wZ")
+ (match_operand:TI 1 "input_operand" "wa,Z,wa,r,Y,r,j,W,wZ,v"))]
"VECTOR_MEM_VSX_P (TImode)
&& (register_operand (operands[0], TImode)
|| register_operand (operands[1], TImode))"
diff --git a/gcc/config/sh/iterators.md b/gcc/config/sh/iterators.md
index e118c3ef1cd..ab6143f5386 100644
--- a/gcc/config/sh/iterators.md
+++ b/gcc/config/sh/iterators.md
@@ -22,6 +22,7 @@
(define_mode_iterator QIHISI [QI HI SI])
(define_mode_iterator QIHI [QI HI])
(define_mode_iterator HISI [HI SI])
+(define_mode_iterator SIDI [SI DI])
;; Mode attributes that can be used as the instruction suffix for mode
;; variant instructions.
@@ -38,3 +39,6 @@
;; Return codes.
(define_code_iterator any_return [return simple_return])
+;; Lowpart subreg byte position code attributes for big and little endian.
+(define_mode_attr lowpart_be [(QI "3") (HI "2")])
+(define_mode_attr lowpart_le [(QI "0") (HI "0")])
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 4d65685a857..40afdb43784 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -11582,11 +11582,14 @@ shmedia_builtin_p (void)
return TARGET_SHMEDIA;
}
+/* This function can be used if there are any built-ins that are not for
+ SHmedia. It's commented out to avoid the defined-but-unused warning.
static bool
sh1_builtin_p (void)
{
return TARGET_SH1;
}
+*/
/* describe number and signedness of arguments; arg[0] == result
(1: unsigned, 2: signed, 4: don't care, 8: pointer 0: no argument */
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index d875a63961a..bfb4fbf459a 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -633,13 +633,39 @@
;; Test low QI subreg against zero.
;; This avoids unnecessary zero extension before the test.
-(define_insn "tstqi_t_zero"
+(define_insn "*tstqi_t_zero"
[(set (reg:SI T_REG)
(eq:SI (match_operand:QI 0 "logical_operand" "z") (const_int 0)))]
"TARGET_SH1"
"tst #255,%0"
[(set_attr "type" "mt_group")])
+;; This pattern might be risky because it also tests the upper bits and not
+;; only the subreg. However, it seems that combine will get to this only
+;; when testing sign/zero extended values. In this case the extended upper
+;; bits do not matter.
+(define_insn "*tst<mode>_t_zero"
+ [(set (reg:SI T_REG)
+ (eq:SI
+ (subreg:QIHI
+ (and:SI (match_operand:SI 0 "arith_reg_operand" "%r")
+ (match_operand:SI 1 "arith_reg_operand" "r")) <lowpart_le>)
+ (const_int 0)))]
+ "TARGET_SH1 && TARGET_LITTLE_ENDIAN"
+ "tst %0,%1"
+ [(set_attr "type" "mt_group")])
+
+(define_insn "*tst<mode>_t_zero"
+ [(set (reg:SI T_REG)
+ (eq:SI
+ (subreg:QIHI
+ (and:SI (match_operand:SI 0 "arith_reg_operand" "%r")
+ (match_operand:SI 1 "arith_reg_operand" "r")) <lowpart_be>)
+ (const_int 0)))]
+ "TARGET_SH1 && !TARGET_LITTLE_ENDIAN"
+ "tst %0,%1"
+ [(set_attr "type" "mt_group")])
+
;; Extract LSB, negate and store in T bit.
(define_insn "tstsi_t_and_not"
@@ -3514,7 +3540,7 @@ label:
/* If it is possible to turn the and insn into a zero extension
already, redundant zero extensions will be folded, which results
in better code.
- Ideally the splitter of *andsi_compact would be enough, if reundant
+ Ideally the splitter of *andsi_compact would be enough, if redundant
zero extensions were detected after the combine pass, which does not
happen at the moment. */
if (TARGET_SH1)
@@ -5177,28 +5203,25 @@ label:
;; Don't expand immediately because otherwise neg:DI (abs:DI) will not be
;; combined.
(define_expand "negdi2"
- [(set (match_operand:DI 0 "arith_reg_dest" "")
- (neg:DI (match_operand:DI 1 "arith_reg_operand" "")))
- (clobber (reg:SI T_REG))]
- "TARGET_SH1"
- "")
+ [(parallel [(set (match_operand:DI 0 "arith_reg_dest")
+ (neg:DI (match_operand:DI 1 "arith_reg_operand")))
+ (clobber (reg:SI T_REG))])]
+ "TARGET_SH1")
(define_insn_and_split "*negdi2"
- [(set (match_operand:DI 0 "arith_reg_dest" "=r")
- (neg:DI (match_operand:DI 1 "arith_reg_operand" "r")))]
+ [(set (match_operand:DI 0 "arith_reg_dest" "=&r")
+ (neg:DI (match_operand:DI 1 "arith_reg_operand" "r")))
+ (clobber (reg:SI T_REG))]
"TARGET_SH1"
"#"
- "TARGET_SH1"
+ "&& reload_completed"
[(const_int 0)]
{
- rtx low_src = gen_lowpart (SImode, operands[1]);
- rtx high_src = gen_highpart (SImode, operands[1]);
- rtx low_dst = gen_lowpart (SImode, operands[0]);
- rtx high_dst = gen_highpart (SImode, operands[0]);
-
emit_insn (gen_clrt ());
- emit_insn (gen_negc (low_dst, low_src));
- emit_insn (gen_negc (high_dst, high_src));
+ emit_insn (gen_negc (gen_lowpart (SImode, operands[0]),
+ gen_lowpart (SImode, operands[1])));
+ emit_insn (gen_negc (gen_highpart (SImode, operands[0]),
+ gen_highpart (SImode, operands[1])));
DONE;
})
@@ -5272,38 +5295,53 @@ label:
(const_int -1)))]
"TARGET_SHMEDIA" "")
-(define_expand "abssi2"
- [(set (match_operand:SI 0 "arith_reg_dest" "")
- (abs:SI (match_operand:SI 1 "arith_reg_operand" "")))
- (clobber (reg:SI T_REG))]
- "TARGET_SH1"
- "")
+(define_expand "abs<mode>2"
+ [(parallel [(set (match_operand:SIDI 0 "arith_reg_dest")
+ (abs:SIDI (match_operand:SIDI 1 "arith_reg_operand")))
+ (clobber (reg:SI T_REG))])]
+ "TARGET_SH1")
-(define_insn_and_split "*abssi2"
- [(set (match_operand:SI 0 "arith_reg_dest" "=r")
- (abs:SI (match_operand:SI 1 "arith_reg_operand" "r")))]
+(define_insn_and_split "*abs<mode>2"
+ [(set (match_operand:SIDI 0 "arith_reg_dest")
+ (abs:SIDI (match_operand:SIDI 1 "arith_reg_operand")))
+ (clobber (reg:SI T_REG))]
"TARGET_SH1"
"#"
- "TARGET_SH1"
+ "&& can_create_pseudo_p ()"
[(const_int 0)]
{
- emit_insn (gen_cmpgesi_t (operands[1], const0_rtx));
- emit_insn (gen_negsi_cond (operands[0], operands[1], operands[1],
- const1_rtx));
+ if (<MODE>mode == SImode)
+ emit_insn (gen_cmpgesi_t (operands[1], const0_rtx));
+ else
+ {
+ rtx high_src = gen_highpart (SImode, operands[1]);
+ emit_insn (gen_cmpgesi_t (high_src, const0_rtx));
+ }
+
+ emit_insn (gen_neg<mode>_cond (operands[0], operands[1], operands[1],
+ const1_rtx));
DONE;
})
-(define_insn_and_split "*negabssi2"
- [(set (match_operand:SI 0 "arith_reg_dest" "=r")
- (neg:SI (abs:SI (match_operand:SI 1 "arith_reg_operand" "r"))))]
+(define_insn_and_split "*negabs<mode>2"
+ [(set (match_operand:SIDI 0 "arith_reg_dest")
+ (neg:SIDI (abs:SIDI (match_operand:SIDI 1 "arith_reg_operand"))))
+ (clobber (reg:SI T_REG))]
"TARGET_SH1"
"#"
- "TARGET_SH1"
+ "&& can_create_pseudo_p ()"
[(const_int 0)]
{
- emit_insn (gen_cmpgesi_t (operands[1], const0_rtx));
- emit_insn (gen_negsi_cond (operands[0], operands[1], operands[1],
- const0_rtx));
+ if (<MODE>mode == SImode)
+ emit_insn (gen_cmpgesi_t (operands[1], const0_rtx));
+ else
+ {
+ rtx high_src = gen_highpart (SImode, operands[1]);
+ emit_insn (gen_cmpgesi_t (high_src, const0_rtx));
+ }
+
+ emit_insn (gen_neg<mode>_cond (operands[0], operands[1], operands[1],
+ const0_rtx));
DONE;
})
@@ -5316,10 +5354,10 @@ label:
(define_insn_and_split "negsi_cond"
[(set (match_operand:SI 0 "arith_reg_dest" "=r,r")
- (if_then_else:SI (eq:SI (reg:SI T_REG)
- (match_operand:SI 3 "const_int_operand" "M,N"))
- (match_operand:SI 1 "arith_reg_operand" "0,0")
- (neg:SI (match_operand:SI 2 "arith_reg_operand" "r,r"))))]
+ (if_then_else
+ (eq:SI (reg:SI T_REG) (match_operand:SI 3 "const_int_operand" "M,N"))
+ (match_operand:SI 1 "arith_reg_operand" "0,0")
+ (neg:SI (match_operand:SI 2 "arith_reg_operand" "r,r"))))]
"TARGET_SH1 && TARGET_ZDCBRANCH"
{
static const char* alt[] =
@@ -5339,7 +5377,7 @@ label:
{
rtx skip_neg_label = gen_label_rtx ();
- emit_insn (gen_movsi (operands[0], operands[1]));
+ emit_move_insn (operands[0], operands[1]);
emit_jump_insn (INTVAL (operands[3])
? gen_branch_true (skip_neg_label)
@@ -5352,63 +5390,21 @@ label:
[(set_attr "type" "arith") ;; poor approximation
(set_attr "length" "4")])
-(define_expand "absdi2"
- [(set (match_operand:DI 0 "arith_reg_dest" "")
- (abs:DI (match_operand:DI 1 "arith_reg_operand" "")))
- (clobber (reg:SI T_REG))]
- "TARGET_SH1"
- "")
-
-(define_insn_and_split "*absdi2"
- [(set (match_operand:DI 0 "arith_reg_dest" "=r")
- (abs:DI (match_operand:DI 1 "arith_reg_operand" "r")))]
- "TARGET_SH1"
- "#"
- "&& reload_completed"
- [(const_int 0)]
-{
- rtx high_src = gen_highpart (SImode, operands[1]);
- emit_insn (gen_cmpgesi_t (high_src, const0_rtx));
- emit_insn (gen_negdi_cond (operands[0], operands[1], operands[1],
- const1_rtx));
- DONE;
-})
-
-(define_insn_and_split "*negabsdi2"
- [(set (match_operand:DI 0 "arith_reg_dest" "=r")
- (neg:DI (abs:DI (match_operand:DI 1 "arith_reg_operand" "r"))))]
- "TARGET_SH1"
- "#"
- "&& reload_completed"
- [(const_int 0)]
-{
- rtx high_src = gen_highpart (SImode, operands[1]);
- emit_insn (gen_cmpgesi_t (high_src, const0_rtx));
- emit_insn (gen_negdi_cond (operands[0], operands[1], operands[1],
- const0_rtx));
- DONE;
-})
-
(define_insn_and_split "negdi_cond"
- [(set (match_operand:DI 0 "arith_reg_dest" "=r,r")
- (if_then_else:DI (eq:SI (reg:SI T_REG)
- (match_operand:SI 3 "const_int_operand" "M,N"))
- (match_operand:DI 1 "arith_reg_operand" "r,r")
- (neg:DI (match_operand:DI 2 "arith_reg_operand" "1,1"))))]
+ [(set (match_operand:DI 0 "arith_reg_dest")
+ (if_then_else
+ (eq:SI (reg:SI T_REG) (match_operand:SI 3 "const_int_operand"))
+ (match_operand:DI 1 "arith_reg_operand")
+ (neg:DI (match_operand:DI 2 "arith_reg_operand"))))
+ (clobber (reg:SI T_REG))]
"TARGET_SH1"
"#"
- "TARGET_SH1"
+ "&& can_create_pseudo_p ()"
[(const_int 0)]
{
- rtx low_src = gen_lowpart (SImode, operands[1]);
- rtx high_src = gen_highpart (SImode, operands[1]);
- rtx low_dst = gen_lowpart (SImode, operands[0]);
- rtx high_dst = gen_highpart (SImode, operands[0]);
-
rtx skip_neg_label = gen_label_rtx ();
- emit_insn (gen_movsi (low_dst, low_src));
- emit_insn (gen_movsi (high_dst, high_src));
+ emit_move_insn (operands[0], operands[1]);
emit_jump_insn (INTVAL (operands[3])
? gen_branch_true (skip_neg_label)
@@ -5417,8 +5413,11 @@ label:
if (!INTVAL (operands[3]))
emit_insn (gen_clrt ());
- emit_insn (gen_negc (low_dst, low_src));
- emit_label_after (skip_neg_label, emit_insn (gen_negc (high_dst, high_src)));
+ emit_insn (gen_negc (gen_lowpart (SImode, operands[0]),
+ gen_lowpart (SImode, operands[1])));
+ emit_label_after (skip_neg_label,
+ emit_insn (gen_negc (gen_highpart (SImode, operands[0]),
+ gen_highpart (SImode, operands[1]))));
DONE;
})
diff --git a/gcc/config/sparc/constraints.md b/gcc/config/sparc/constraints.md
index ffe530447db..71670eedf53 100644
--- a/gcc/config/sparc/constraints.md
+++ b/gcc/config/sparc/constraints.md
@@ -18,7 +18,7 @@
;; <http://www.gnu.org/licenses/>.
;;; Unused letters:
-;;; AB
+;;; AB U
;;; a jkl q tuv xyz
@@ -44,10 +44,6 @@
(define_register_constraint "h" "(TARGET_V9 && TARGET_V8PLUS ? I64_REGS : NO_REGS)"
"64-bit global or out register in V8+ mode")
-(define_memory_constraint "w"
- "A memory with only a base register"
- (match_operand 0 "mem_noofs_operand"))
-
;; Floating-point constant constraints
(define_constraint "G"
@@ -107,10 +103,6 @@
(and (match_code "const_int")
(match_test "ival == -1")))
-;; Extra constraints
-;; Our memory extra constraints have to emulate the behavior of 'm' and 'o',
-;; i.e. accept pseudo-registers during reload.
-
(define_constraint "D"
"const_vector"
(and (match_code "const_vector")
@@ -138,21 +130,16 @@
(match_code "mem")
(match_test "memory_ok_for_ldd (op)")))
-;; Not needed in 64-bit mode
-(define_constraint "U"
- "Pseudo-register or hard even-numbered integer register"
- (and (match_test "TARGET_ARCH32")
- (match_code "reg")
- (ior (match_test "REGNO (op) < FIRST_PSEUDO_REGISTER")
- (not (match_test "reload_in_progress && reg_renumber [REGNO (op)] < 0")))
- (match_test "register_ok_for_ldd (op)")))
-
;; Equivalent to 'T' but available in 64-bit mode
(define_memory_constraint "W"
"Memory reference for 'e' constraint floating-point register"
(and (match_code "mem")
(match_test "memory_ok_for_ldd (op)")))
+(define_memory_constraint "w"
+ "A memory with only a base register"
+ (match_operand 0 "mem_noofs_operand"))
+
(define_constraint "Y"
"The vector zero constant"
(and (match_code "const_vector")
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index f604f46610e..4a44078a26c 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -1595,9 +1595,9 @@
(define_insn "*movdi_insn_sp32"
[(set (match_operand:DI 0 "nonimmediate_operand"
- "=T,o,T,U,o,r,r,r,?T,?*f,?*f,?o,?*e,?*e, r,?*f,?*e,?W,b,b")
+ "=T,o,T,r,o,r,r,r,?T,?*f,?*f,?o,?*e,?*e, r,?*f,?*e,?W,b,b")
(match_operand:DI 1 "input_operand"
- " J,J,U,T,r,o,i,r,*f, T, o,*f, *e, *e,?*f, r, W,*e,J,P"))]
+ " J,J,r,T,r,o,i,r,*f, T, o,*f, *e, *e,?*f, r, W,*e,J,P"))]
"! TARGET_ARCH64
&& (register_operand (operands[0], DImode)
|| register_or_zero_operand (operands[1], DImode))"
@@ -2302,8 +2302,8 @@
})
(define_insn "*movdf_insn_sp32"
- [(set (match_operand:DF 0 "nonimmediate_operand" "=b,b,e,e,*r, f, e,T,W,U,T, f, *r, o,o")
- (match_operand:DF 1 "input_operand" "G,C,e,e, f,*r,W#F,G,e,T,U,o#F,*roF,*rG,f"))]
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=b,b,e,e,*r, f, e,T,W,r,T, f, *r, o,o")
+ (match_operand:DF 1 "input_operand" "G,C,e,e, f,*r,W#F,G,e,T,r,o#F,*roF,*rG,f"))]
"! TARGET_ARCH64
&& (register_operand (operands[0], DFmode)
|| register_or_zero_or_all_ones_operand (operands[1], DFmode))"
@@ -2541,8 +2541,8 @@
})
(define_insn "*movtf_insn_sp32"
- [(set (match_operand:TF 0 "nonimmediate_operand" "=b, e,o, o,U, r")
- (match_operand:TF 1 "input_operand" " G,oe,e,rGU,o,roG"))]
+ [(set (match_operand:TF 0 "nonimmediate_operand" "=b, e,o, o,r, r")
+ (match_operand:TF 1 "input_operand" " G,oe,e,rG,o,roG"))]
"! TARGET_ARCH64
&& (register_operand (operands[0], TFmode)
|| register_or_zero_operand (operands[1], TFmode))"
@@ -7911,8 +7911,8 @@
(set_attr "cpu_feature" "vis,vis,vis,*,*,*,*,*,vis3,vis3,*")])
(define_insn "*mov<VM64:mode>_insn_sp32"
- [(set (match_operand:VM64 0 "nonimmediate_operand" "=e,e,e,*r, f,e,m,m,U,T, o,*r")
- (match_operand:VM64 1 "input_operand" "Y,C,e, f,*r,m,e,Y,T,U,*r,*r"))]
+ [(set (match_operand:VM64 0 "nonimmediate_operand" "=e,e,e,*r, f,e,m,m,r,T, o,*r")
+ (match_operand:VM64 1 "input_operand" "Y,C,e, f,*r,m,e,Y,T,r,*r,*r"))]
"TARGET_VIS
&& ! TARGET_ARCH64
&& (register_operand (operands[0], <VM64:MODE>mode)
diff --git a/gcc/config/sparc/sync.md b/gcc/config/sparc/sync.md
index d11f6636490..302cd749700 100644
--- a/gcc/config/sparc/sync.md
+++ b/gcc/config/sparc/sync.md
@@ -115,7 +115,7 @@
})
(define_insn "atomic_loaddi_1"
- [(set (match_operand:DI 0 "register_operand" "=U,?*f")
+ [(set (match_operand:DI 0 "register_operand" "=r,?*f")
(unspec:DI [(match_operand:DI 1 "memory_operand" "m,m")]
UNSPEC_ATOMIC))]
"!TARGET_ARCH64"
@@ -144,7 +144,7 @@
(define_insn "atomic_storedi_1"
[(set (match_operand:DI 0 "memory_operand" "=m,m,m")
(unspec:DI
- [(match_operand:DI 1 "register_or_v9_zero_operand" "J,U,?*f")]
+ [(match_operand:DI 1 "register_or_v9_zero_operand" "J,r,?*f")]
UNSPEC_ATOMIC))]
"!TARGET_ARCH64"
"@
diff --git a/gcc/config/sparc/t-rtems b/gcc/config/sparc/t-rtems
new file mode 100644
index 00000000000..4a01e1eaaf3
--- /dev/null
+++ b/gcc/config/sparc/t-rtems
@@ -0,0 +1,22 @@
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GCC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+#
+
+MULTILIB_OPTIONS = msoft-float mcpu=v8
+MULTILIB_DIRNAMES = soft v8
+MULTILIB_MATCHES = msoft-float=mno-fpu
diff --git a/gcc/config/sparc/t-rtems-64 b/gcc/config/sparc/t-rtems-64
new file mode 100644
index 00000000000..d6a6e3eea37
--- /dev/null
+++ b/gcc/config/sparc/t-rtems-64
@@ -0,0 +1,22 @@
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GCC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+#
+
+MULTILIB_OPTIONS = msoft-float
+MULTILIB_DIRNAMES = soft
+MULTILIB_MATCHES = msoft-float=mno-fpu
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index 831d2b08a61..720cc0299b9 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -2454,7 +2454,7 @@ spu_machine_dependent_reorg (void)
}
blocks = sbitmap_alloc (last_basic_block);
- sbitmap_zero (blocks);
+ bitmap_clear (blocks);
in_spu_reorg = 1;
compute_bb_for_insn ();
@@ -2625,7 +2625,7 @@ spu_machine_dependent_reorg (void)
}
free (spu_bb_info);
- if (!sbitmap_empty_p (blocks))
+ if (!bitmap_empty_p (blocks))
find_many_sub_basic_blocks (blocks);
/* We have to schedule to make sure alignment is ok. */
diff --git a/gcc/coverage.c b/gcc/coverage.c
index f9b12e8b6f6..b634c821396 100644
--- a/gcc/coverage.c
+++ b/gcc/coverage.c
@@ -79,10 +79,11 @@ typedef struct counts_entry
struct gcov_ctr_summary summary;
/* hash_table support. */
- typedef counts_entry T;
- static inline hashval_t hash (const counts_entry *);
- static int equal (const counts_entry *, const counts_entry *);
- static void remove (counts_entry *);
+ typedef counts_entry value_type;
+ typedef counts_entry compare_type;
+ static inline hashval_t hash (const value_type *);
+ static int equal (const value_type *, const compare_type *);
+ static void remove (value_type *);
} counts_entry_t;
static GTY(()) struct coverage_data *functions_head = 0;
@@ -150,20 +151,20 @@ get_gcov_unsigned_t (void)
}
inline hashval_t
-counts_entry::hash (const counts_entry_t *entry)
+counts_entry::hash (const value_type *entry)
{
return entry->ident * GCOV_COUNTERS + entry->ctr;
}
inline int
-counts_entry::equal (const counts_entry_t *entry1,
- const counts_entry_t *entry2)
+counts_entry::equal (const value_type *entry1,
+ const compare_type *entry2)
{
return entry1->ident == entry2->ident && entry1->ctr == entry2->ctr;
}
inline void
-counts_entry::remove (counts_entry_t *entry)
+counts_entry::remove (value_type *entry)
{
free (entry->counts);
free (entry);
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 9e8d933e745..a1abdde3f3d 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,66 @@
+2012-10-31 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/54955
+ * parser.c (cp_nth_tokens_can_be_std_attribute_p): Recognize the
+ 'Alignas' keyword as the beginning of a c++11 attribute specifier.
+ Update the comment of the function.
+ (cp_next_tokens_can_be_gnu_attribute_p): Update the comment of the
+ function.
+
+2012-10-29 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ PR c++/54930
+ * typeck.c (maybe_warn_about_returning_address_of_local): Use
+ OPT_Wreturn_local_addr.
+
+2012-10-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/55081
+ * typeck2.c (store_init_value): Call fold_non_dependent_expr
+ and maybe_constant_init even for C++98.
+
+2012-10-26 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/54984
+ * init.c (build_new): Don't turn a null *init into a pointer to
+ empty vector orig_init.
+
+2012-10-25 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/53761
+ * class.c (finish_struct_1): Reject aggregates decorated with
+ __transparent_union__ which cannot be made transparent because
+ the type of the first field has a different ABI from the class
+ overall.
+
+2012-10-25 Jason Merrill <jason@redhat.com>
+
+ Core 1402
+ * call.c (joust): An implicitly deleted move function is
+ worse than any non-deleted function.
+ * method.c (process_subob_fn): No special rules for move.
+ (synthesized_method_walk, implicitly_declare_fn): Likewise.
+ Warn about virtual base with non-trivial move assignment.
+ * cp-tree.h (struct lang_decl_fn): Remove suppress_implicit_decl.
+ (FNDECL_SUPPRESS_IMPLICIT_DECL): Remove.
+
+ * semantics.c (finish_omp_threadprivate): Call complete_type.
+
+ * class.c (one_inherited_ctor): Warn about variadic inherited ctor.
+
+2012-10-25 Marc Glisse <marc.glisse@inria.fr>
+
+ PR c++/54427
+ * typeck.c (build_x_conditional_expr): Handle VEC_COND_EXPR.
+ * call.c (build_conditional_expr_1): Likewise.
+
+2012-10-25 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/34892
+ * parser.c (cp_parser_template_parameter): When
+ cp_parser_parameter_declaration parsed a default argument don't
+ see if *is_parameter_pack needs setting.
+
2012-10-23 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/54922
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index e21049b8e64..fcc973505be 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -4373,18 +4373,90 @@ build_conditional_expr_1 (tree arg1, tree arg2, tree arg3,
arg2 = arg1 = save_expr (arg1);
}
+ /* If something has already gone wrong, just pass that fact up the
+ tree. */
+ if (error_operand_p (arg1)
+ || error_operand_p (arg2)
+ || error_operand_p (arg3))
+ return error_mark_node;
+
+ orig_arg2 = arg2;
+ orig_arg3 = arg3;
+
+ if (VECTOR_INTEGER_TYPE_P (TREE_TYPE (arg1)))
+ {
+ arg1 = force_rvalue (arg1, complain);
+ arg2 = force_rvalue (arg2, complain);
+ arg3 = force_rvalue (arg3, complain);
+
+ tree arg1_type = TREE_TYPE (arg1);
+ arg2_type = TREE_TYPE (arg2);
+ arg3_type = TREE_TYPE (arg3);
+
+ if (TREE_CODE (arg2_type) != VECTOR_TYPE
+ && TREE_CODE (arg3_type) != VECTOR_TYPE)
+ {
+ if (complain & tf_error)
+ error ("at least one operand of a vector conditional operator "
+ "must be a vector");
+ return error_mark_node;
+ }
+
+ if ((TREE_CODE (arg2_type) == VECTOR_TYPE)
+ != (TREE_CODE (arg3_type) == VECTOR_TYPE))
+ {
+ enum stv_conv convert_flag =
+ scalar_to_vector (input_location, VEC_COND_EXPR, arg2, arg3,
+ complain & tf_error);
+
+ switch (convert_flag)
+ {
+ case stv_error:
+ return error_mark_node;
+ case stv_firstarg:
+ {
+ arg2 = convert (TREE_TYPE (arg3_type), arg2);
+ arg2 = build_vector_from_val (arg3_type, arg2);
+ arg2_type = TREE_TYPE (arg2);
+ break;
+ }
+ case stv_secondarg:
+ {
+ arg3 = convert (TREE_TYPE (arg2_type), arg3);
+ arg3 = build_vector_from_val (arg2_type, arg3);
+ arg3_type = TREE_TYPE (arg3);
+ break;
+ }
+ default:
+ break;
+ }
+ }
+
+ if (!same_type_p (arg2_type, arg3_type)
+ || TYPE_VECTOR_SUBPARTS (arg1_type)
+ != TYPE_VECTOR_SUBPARTS (arg2_type)
+ || TYPE_SIZE (arg1_type) != TYPE_SIZE (arg2_type))
+ {
+ if (complain & tf_error)
+ error ("incompatible vector types in conditional expression: "
+ "%qT, %qT and %qT", TREE_TYPE (arg1), TREE_TYPE (orig_arg2),
+ TREE_TYPE (orig_arg3));
+ return error_mark_node;
+ }
+
+ if (!COMPARISON_CLASS_P (arg1))
+ arg1 = build2 (NE_EXPR, signed_type_for (arg1_type), arg1,
+ build_zero_cst (arg1_type));
+ return build3 (VEC_COND_EXPR, arg2_type, arg1, arg2, arg3);
+ }
+
/* [expr.cond]
The first expression is implicitly converted to bool (clause
_conv_). */
arg1 = perform_implicit_conversion_flags (boolean_type_node, arg1, complain,
LOOKUP_NORMAL);
-
- /* If something has already gone wrong, just pass that fact up the
- tree. */
- if (error_operand_p (arg1)
- || error_operand_p (arg2)
- || error_operand_p (arg3))
+ if (error_operand_p (arg1))
return error_mark_node;
/* [expr.cond]
@@ -4394,8 +4466,6 @@ build_conditional_expr_1 (tree arg1, tree arg2, tree arg3,
array-to-pointer (_conv.array_), and function-to-pointer
(_conv.func_) standard conversions are performed on the second
and third operands. */
- orig_arg2 = arg2;
- orig_arg3 = arg3;
arg2_type = unlowered_expr_type (arg2);
arg3_type = unlowered_expr_type (arg3);
if (VOID_TYPE_P (arg2_type) || VOID_TYPE_P (arg3_type))
@@ -8176,6 +8246,22 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn,
&& (IS_TYPE_OR_DECL_P (cand1->fn)))
return 1;
+ /* Prefer a non-deleted function over an implicitly deleted move
+ constructor or assignment operator. This differs slightly from the
+ wording for issue 1402 (which says the move op is ignored by overload
+ resolution), but this way produces better error messages. */
+ if (TREE_CODE (cand1->fn) == FUNCTION_DECL
+ && TREE_CODE (cand2->fn) == FUNCTION_DECL
+ && DECL_DELETED_FN (cand1->fn) != DECL_DELETED_FN (cand2->fn))
+ {
+ if (DECL_DELETED_FN (cand1->fn) && DECL_DEFAULTED_FN (cand1->fn)
+ && move_fn_p (cand1->fn))
+ return -1;
+ if (DECL_DELETED_FN (cand2->fn) && DECL_DEFAULTED_FN (cand2->fn)
+ && move_fn_p (cand2->fn))
+ return 1;
+ }
+
/* a viable function F1
is defined to be a better function than another viable function F2 if
for all arguments i, ICSi(F1) is not a worse conversion sequence than
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index a478de80563..e55f1f9c2b7 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -2807,6 +2807,12 @@ one_inherited_ctor (tree ctor, tree t)
new_parms[i++] = TREE_VALUE (parms);
}
one_inheriting_sig (t, ctor, new_parms, i);
+ if (parms == NULL_TREE)
+ {
+ warning (OPT_Winherited_variadic_ctor,
+ "the ellipsis in %qD is not inherited", ctor);
+ inform (DECL_SOURCE_LOCATION (ctor), "%qD declared here", ctor);
+ }
}
/* Create default constructors, assignment operators, and so forth for
@@ -6261,7 +6267,7 @@ finish_struct_1 (tree t)
tree field = first_field (t);
if (field == NULL_TREE || error_operand_p (field))
{
- error ("type transparent class %qT does not have any fields", t);
+ error ("type transparent %q#T does not have any fields", t);
TYPE_TRANSPARENT_AGGR (t) = 0;
}
else if (DECL_ARTIFICIAL (field))
@@ -6275,6 +6281,13 @@ finish_struct_1 (tree t)
}
TYPE_TRANSPARENT_AGGR (t) = 0;
}
+ else if (TYPE_MODE (t) != DECL_MODE (field))
+ {
+ error ("type transparent %q#T cannot be made transparent because "
+ "the type of the first field has a different ABI from the "
+ "class overall", t);
+ TYPE_TRANSPARENT_AGGR (t) = 0;
+ }
}
}
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 7b4277b05b7..77508a10cb7 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -1954,7 +1954,7 @@ struct GTY(()) lang_decl_fn {
unsigned thunk_p : 1;
unsigned this_thunk_p : 1;
unsigned hidden_friend_p : 1;
- unsigned suppress_implicit_decl : 1;
+ /* 1 spare bit. */
/* For a non-thunk function decl, this is a tree list of
friendly classes. For a thunk function decl, it is the
@@ -3144,12 +3144,6 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
#define DECL_HIDDEN_FRIEND_P(NODE) \
(LANG_DECL_FN_CHECK (DECL_COMMON_CHECK (NODE))->hidden_friend_p)
-/* Nonzero if NODE is a FUNCTION_DECL generated by implicitly_declare_fn
- that we shouldn't actually declare implicitly; it is only used for
- comparing to an =default declaration. */
-#define FNDECL_SUPPRESS_IMPLICIT_DECL(NODE) \
- (LANG_DECL_FN_CHECK (DECL_COMMON_CHECK (NODE))->suppress_implicit_decl)
-
/* Nonzero if DECL has been declared threadprivate by
#pragma omp threadprivate. */
#define CP_DECL_THREADPRIVATE_P(DECL) \
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 044603887e8..013b01eeb87 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -2911,7 +2911,8 @@ build_new (VEC(tree,gc) **placement, tree type, tree nelts,
orig_placement = make_tree_vector_copy (*placement);
orig_nelts = nelts;
- orig_init = make_tree_vector_copy (*init);
+ if (*init)
+ orig_init = make_tree_vector_copy (*init);
make_args_non_dependent (*placement);
if (nelts)
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 4da5cc9ebca..8a7d7cbaf3b 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -969,8 +969,8 @@ get_copy_assign (tree type)
DELETED_P or give an error message MSG with argument ARG. */
static void
-process_subob_fn (tree fn, bool move_p, tree *spec_p, bool *trivial_p,
- bool *deleted_p, bool *constexpr_p, bool *no_implicit_p,
+process_subob_fn (tree fn, tree *spec_p, bool *trivial_p,
+ bool *deleted_p, bool *constexpr_p,
bool diag, tree arg)
{
if (!fn || fn == error_mark_node)
@@ -996,12 +996,6 @@ process_subob_fn (tree fn, bool move_p, tree *spec_p, bool *trivial_p,
}
}
- /* Core 1402: A non-trivial non-move ctor suppresses the implicit
- declaration of the move ctor/op=. */
- if (no_implicit_p && move_p && !move_signature_fn_p (fn)
- && !trivial_fn_p (fn))
- *no_implicit_p = true;
-
if (constexpr_p && !DECL_DECLARED_CONSTEXPR_P (fn))
{
*constexpr_p = false;
@@ -1027,7 +1021,7 @@ static void
walk_field_subobs (tree fields, tree fnname, special_function_kind sfk,
int quals, bool copy_arg_p, bool move_p,
bool assign_p, tree *spec_p, bool *trivial_p,
- bool *deleted_p, bool *constexpr_p, bool *no_implicit_p,
+ bool *deleted_p, bool *constexpr_p,
bool diag, int flags, tsubst_flags_t complain)
{
tree field;
@@ -1126,7 +1120,7 @@ walk_field_subobs (tree fields, tree fnname, special_function_kind sfk,
{
walk_field_subobs (TYPE_FIELDS (mem_type), fnname, sfk, quals,
copy_arg_p, move_p, assign_p, spec_p, trivial_p,
- deleted_p, constexpr_p, no_implicit_p,
+ deleted_p, constexpr_p,
diag, flags, complain);
continue;
}
@@ -1143,8 +1137,8 @@ walk_field_subobs (tree fields, tree fnname, special_function_kind sfk,
rval = locate_fn_flags (mem_type, fnname, argtype, flags, complain);
- process_subob_fn (rval, move_p, spec_p, trivial_p, deleted_p,
- constexpr_p, no_implicit_p, diag, field);
+ process_subob_fn (rval, spec_p, trivial_p, deleted_p,
+ constexpr_p, diag, field);
}
}
@@ -1158,7 +1152,7 @@ walk_field_subobs (tree fields, tree fnname, special_function_kind sfk,
static void
synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
tree *spec_p, bool *trivial_p, bool *deleted_p,
- bool *constexpr_p, bool *no_implicit_p, bool diag,
+ bool *constexpr_p, bool diag,
tree inherited_base, tree inherited_parms)
{
tree binfo, base_binfo, scope, fnname, rval, argtype;
@@ -1171,9 +1165,6 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
if (spec_p)
*spec_p = (cxx_dialect >= cxx0x ? noexcept_true_spec : empty_except_spec);
- if (no_implicit_p)
- *no_implicit_p = false;
-
if (deleted_p)
{
/* "The closure type associated with a lambda-expression has a deleted
@@ -1314,8 +1305,8 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
if (inherited_base)
argtype = NULL_TREE;
- process_subob_fn (rval, move_p, spec_p, trivial_p, deleted_p,
- constexpr_p, no_implicit_p, diag, basetype);
+ process_subob_fn (rval, spec_p, trivial_p, deleted_p,
+ constexpr_p, diag, basetype);
if (ctor_p && TYPE_HAS_NONTRIVIAL_DESTRUCTOR (basetype))
{
/* In a constructor we also need to check the subobject
@@ -1327,8 +1318,8 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
do they affect constexpr-ness (a constant expression doesn't
throw) or exception-specification (a throw from one of the
dtors would be a double-fault). */
- process_subob_fn (rval, false, NULL, NULL,
- deleted_p, NULL, NULL, false,
+ process_subob_fn (rval, NULL, NULL,
+ deleted_p, NULL, false,
basetype);
}
@@ -1342,31 +1333,20 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
*deleted_p = true;
check_vdtor = false;
}
+
+ if (diag && assign_p && move_p
+ && BINFO_VIRTUAL_P (base_binfo)
+ && rval && TREE_CODE (rval) == FUNCTION_DECL
+ && move_fn_p (rval) && !trivial_fn_p (rval))
+ warning (OPT_Wvirtual_move_assign,
+ "defaulted move assignment for %qT calls a non-trivial "
+ "move assignment operator for virtual base %qT",
+ ctype, basetype);
}
vbases = CLASSTYPE_VBASECLASSES (ctype);
if (vbases == NULL)
/* No virtual bases to worry about. */;
- else if (assign_p && move_p && no_implicit_p)
- {
- /* Don't implicitly declare a defaulted move assignment if a virtual
- base has non-trivial move assignment, since moving the same base
- more than once is dangerous. */
- /* Should the spec be changed to allow vbases that only occur once? */
- FOR_EACH_VEC_ELT (tree, vbases, i, base_binfo)
- {
- tree basetype = BINFO_TYPE (base_binfo);
- if (copy_arg_p)
- argtype = build_stub_type (basetype, quals, move_p);
- rval = locate_fn_flags (base_binfo, fnname, argtype, flags, complain);
- if (rval && rval != error_mark_node
- && move_fn_p (rval) && !trivial_fn_p (rval))
- {
- *no_implicit_p = true;
- break;
- }
- }
- }
else if (!assign_p)
{
if (constexpr_p)
@@ -1378,14 +1358,14 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
argtype = build_stub_type (basetype, quals, move_p);
rval = locate_fn_flags (base_binfo, fnname, argtype, flags, complain);
- process_subob_fn (rval, move_p, spec_p, trivial_p, deleted_p,
- constexpr_p, no_implicit_p, diag, basetype);
+ process_subob_fn (rval, spec_p, trivial_p, deleted_p,
+ constexpr_p, diag, basetype);
if (ctor_p && TYPE_HAS_NONTRIVIAL_DESTRUCTOR (basetype))
{
rval = locate_fn_flags (base_binfo, complete_dtor_identifier,
NULL_TREE, flags, complain);
- process_subob_fn (rval, false, NULL, NULL,
- deleted_p, NULL, NULL, false,
+ process_subob_fn (rval, NULL, NULL,
+ deleted_p, NULL, false,
basetype);
}
}
@@ -1394,14 +1374,14 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
/* Now handle the non-static data members. */
walk_field_subobs (TYPE_FIELDS (ctype), fnname, sfk, quals,
copy_arg_p, move_p, assign_p, spec_p, trivial_p,
- deleted_p, constexpr_p, no_implicit_p,
+ deleted_p, constexpr_p,
diag, flags, complain);
if (ctor_p)
walk_field_subobs (TYPE_FIELDS (ctype), complete_dtor_identifier,
sfk_destructor, TYPE_UNQUALIFIED, false,
false, false, NULL, NULL,
deleted_p, NULL,
- NULL, false, flags, complain);
+ false, flags, complain);
pop_scope (scope);
@@ -1473,7 +1453,7 @@ maybe_explain_implicit_delete (tree decl)
"definition would be ill-formed:", decl);
pop_scope (scope);
synthesized_method_walk (ctype, sfk, const_p,
- NULL, NULL, NULL, NULL, NULL, true,
+ NULL, NULL, NULL, NULL, true,
DECL_INHERITED_CTOR_BASE (decl), parms);
}
@@ -1494,7 +1474,7 @@ explain_implicit_non_constexpr (tree decl)
bool dummy;
synthesized_method_walk (DECL_CLASS_CONTEXT (decl),
special_function_p (decl), const_p,
- NULL, NULL, NULL, &dummy, NULL, true,
+ NULL, NULL, NULL, &dummy, true,
NULL_TREE, NULL_TREE);
}
@@ -1507,10 +1487,10 @@ deduce_inheriting_ctor (tree decl)
{
gcc_assert (DECL_INHERITED_CTOR_BASE (decl));
tree spec;
- bool trivial, constexpr_, deleted, no_implicit;
+ bool trivial, constexpr_, deleted;
synthesized_method_walk (DECL_CONTEXT (decl), sfk_inheriting_constructor,
false, &spec, &trivial, &deleted, &constexpr_,
- &no_implicit, /*diag*/false,
+ /*diag*/false,
DECL_INHERITED_CTOR_BASE (decl),
FUNCTION_FIRST_USER_PARMTYPE (decl));
DECL_DELETED_FN (decl) = deleted;
@@ -1540,7 +1520,6 @@ implicitly_declare_fn (special_function_kind kind, tree type,
bool deleted_p;
bool trivial_p;
bool constexpr_p;
- bool no_implicit_p;
/* Because we create declarations for implicitly declared functions
lazily, we may be creating the declaration for a member of TYPE
@@ -1627,11 +1606,10 @@ implicitly_declare_fn (special_function_kind kind, tree type,
deleted_p = DECL_DELETED_FN (DECL_TEMPLATE_RESULT (inherited_ctor));
constexpr_p
= DECL_DECLARED_CONSTEXPR_P (DECL_TEMPLATE_RESULT (inherited_ctor));
- no_implicit_p = false;
}
else
synthesized_method_walk (type, kind, const_p, &raises, &trivial_p,
- &deleted_p, &constexpr_p, &no_implicit_p, false,
+ &deleted_p, &constexpr_p, false,
inherited_base, inherited_parms);
/* Don't bother marking a deleted constructor as constexpr. */
if (deleted_p)
@@ -1719,7 +1697,6 @@ implicitly_declare_fn (special_function_kind kind, tree type,
DECL_DELETED_FN (fn) = deleted_p;
DECL_DECLARED_CONSTEXPR_P (fn) = constexpr_p;
}
- FNDECL_SUPPRESS_IMPLICIT_DECL (fn) = no_implicit_p;
DECL_EXTERNAL (fn) = true;
DECL_NOT_REALLY_EXTERN (fn) = 1;
DECL_DECLARED_INLINE_P (fn) = 1;
@@ -1731,6 +1708,18 @@ implicitly_declare_fn (special_function_kind kind, tree type,
if (inherited_ctor && TREE_CODE (inherited_ctor) == TEMPLATE_DECL)
fn = add_inherited_template_parms (fn, inherited_ctor);
+ /* Warn about calling a non-trivial move assignment in a virtual base. */
+ if (kind == sfk_move_assignment && !deleted_p && !trivial_p
+ && CLASSTYPE_VBASECLASSES (type))
+ {
+ location_t loc = input_location;
+ input_location = DECL_SOURCE_LOCATION (fn);
+ synthesized_method_walk (type, kind, const_p,
+ NULL, NULL, NULL, NULL, true,
+ NULL_TREE, NULL_TREE);
+ input_location = loc;
+ }
+
return fn;
}
@@ -1909,17 +1898,6 @@ lazily_declare_fn (special_function_kind sfk, tree type)
|| type_has_user_declared_move_assign (type)))
DECL_DELETED_FN (fn) = true;
- /* For move variants, rather than declare them as deleted we just
- don't declare them at all. */
- if (DECL_DELETED_FN (fn)
- && (sfk == sfk_move_constructor
- || sfk == sfk_move_assignment))
- return NULL_TREE;
-
- /* We also suppress implicit move if it would call a non-trivial copy. */
- if (FNDECL_SUPPRESS_IMPLICIT_DECL (fn))
- return NULL_TREE;
-
/* A destructor may be virtual. */
if (sfk == sfk_destructor
|| sfk == sfk_move_assignment
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 853d789f987..f2642aba33a 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -12258,12 +12258,21 @@ cp_parser_template_parameter (cp_parser* parser, bool *is_non_type,
parameter_declarator->declarator->parameter_pack_p = false;
}
+ if (parameter_declarator
+ && parameter_declarator->default_argument)
+ {
+ /* Can happen in some cases of erroneous input (c++/34892). */
+ if (cp_lexer_next_token_is (parser->lexer, CPP_ELLIPSIS))
+ /* Consume the `...' for better error recovery. */
+ cp_lexer_consume_token (parser->lexer);
+ }
/* If the next token is an ellipsis, and we don't already have it
marked as a parameter pack, then we have a parameter pack (that
has no declarator). */
- if (!*is_parameter_pack
- && cp_lexer_next_token_is (parser->lexer, CPP_ELLIPSIS)
- && declarator_can_be_parameter_pack (parameter_declarator->declarator))
+ else if (!*is_parameter_pack
+ && cp_lexer_next_token_is (parser->lexer, CPP_ELLIPSIS)
+ && (declarator_can_be_parameter_pack
+ (parameter_declarator->declarator)))
{
/* Consume the `...'. */
cp_lexer_consume_token (parser->lexer);
@@ -20315,7 +20324,7 @@ cp_next_tokens_can_be_gnu_attribute_p (cp_parser *parser)
}
/* Return TRUE iff the next tokens in the stream are possibly the
- beginning of a standard C++-11 attribute. */
+ beginning of a standard C++-11 attribute specifier. */
static bool
cp_next_tokens_can_be_std_attribute_p (cp_parser *parser)
@@ -20324,7 +20333,7 @@ cp_next_tokens_can_be_std_attribute_p (cp_parser *parser)
}
/* Return TRUE iff the next Nth tokens in the stream are possibly the
- beginning of a standard C++-11 attribute. */
+ beginning of a standard C++-11 attribute specifier. */
static bool
cp_nth_tokens_can_be_std_attribute_p (cp_parser *parser, size_t n)
@@ -20332,9 +20341,10 @@ cp_nth_tokens_can_be_std_attribute_p (cp_parser *parser, size_t n)
cp_token *token = cp_lexer_peek_nth_token (parser->lexer, n);
return (cxx_dialect >= cxx0x
- && token->type == CPP_OPEN_SQUARE
- && (token = cp_lexer_peek_nth_token (parser->lexer, n + 1))
- && token->type == CPP_OPEN_SQUARE);
+ && ((token->type == CPP_KEYWORD && token->keyword == RID_ALIGNAS)
+ || (token->type == CPP_OPEN_SQUARE
+ && (token = cp_lexer_peek_nth_token (parser->lexer, n + 1))
+ && token->type == CPP_OPEN_SQUARE)));
}
/* Return TRUE iff the next Nth tokens in the stream are possibly the
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 63b364c37de..073ee97be9c 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -4360,7 +4360,7 @@ finish_omp_threadprivate (tree vars)
error ("%qE declared %<threadprivate%> after first use", v);
else if (! TREE_STATIC (v) && ! DECL_EXTERNAL (v))
error ("automatic variable %qE cannot be %<threadprivate%>", v);
- else if (! COMPLETE_TYPE_P (TREE_TYPE (v)))
+ else if (! COMPLETE_TYPE_P (complete_type (TREE_TYPE (v))))
error ("%<threadprivate%> %qE has incomplete type", v);
else if (TREE_STATIC (v) && TYPE_P (CP_DECL_CONTEXT (v))
&& CP_DECL_CONTEXT (v) != current_class_type)
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index eaa0935dc98..5d8c27d534c 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -5810,7 +5810,8 @@ build_x_conditional_expr (location_t loc, tree ifexp, tree op1, tree op2,
}
expr = build_conditional_expr (ifexp, op1, op2, complain);
- if (processing_template_decl && expr != error_mark_node)
+ if (processing_template_decl && expr != error_mark_node
+ && TREE_CODE (expr) != VEC_COND_EXPR)
{
tree min = build_min_non_dep (COND_EXPR, expr,
orig_ifexp, orig_op1, orig_op2);
@@ -8019,14 +8020,14 @@ maybe_warn_about_returning_address_of_local (tree retval)
if (TREE_CODE (whats_returned) == AGGR_INIT_EXPR
|| TREE_CODE (whats_returned) == TARGET_EXPR)
{
- warning (0, "returning reference to temporary");
+ warning (OPT_Wreturn_local_addr, "returning reference to temporary");
return;
}
if (TREE_CODE (whats_returned) == VAR_DECL
&& DECL_NAME (whats_returned)
&& TEMP_NAME_P (DECL_NAME (whats_returned)))
{
- warning (0, "reference to non-lvalue returned");
+ warning (OPT_Wreturn_local_addr, "reference to non-lvalue returned");
return;
}
}
@@ -8042,10 +8043,10 @@ maybe_warn_about_returning_address_of_local (tree retval)
|| TREE_PUBLIC (whats_returned)))
{
if (TREE_CODE (valtype) == REFERENCE_TYPE)
- warning (0, "reference to local variable %q+D returned",
+ warning (OPT_Wreturn_local_addr, "reference to local variable %q+D returned",
whats_returned);
else
- warning (0, "address of local variable %q+D returned",
+ warning (OPT_Wreturn_local_addr, "address of local variable %q+D returned",
whats_returned);
return;
}
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 3dbfcb6663a..3478886dea1 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -709,11 +709,9 @@ store_init_value (tree decl, tree init, VEC(tree,gc)** cleanups, int flags)
/* In C++0x constant expression is a semantic, not syntactic, property.
In C++98, make sure that what we thought was a constant expression at
- template definition time is still constant. */
- if ((cxx_dialect >= cxx0x
- || DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl))
- && (decl_maybe_constant_var_p (decl)
- || TREE_STATIC (decl)))
+ template definition time is still constant and otherwise perform this
+ as optimization, e.g. to fold SIZEOF_EXPRs in the initializer. */
+ if (decl_maybe_constant_var_p (decl) || TREE_STATIC (decl))
{
bool const_init;
value = fold_non_dependent_expr (value);
diff --git a/gcc/cprop.c b/gcc/cprop.c
index 0d3e1f9e09c..e90a13ca878 100644
--- a/gcc/cprop.c
+++ b/gcc/cprop.c
@@ -600,8 +600,8 @@ compute_local_properties (sbitmap *kill, sbitmap *comp,
unsigned int i;
/* Initialize the bitmaps that were passed in. */
- sbitmap_vector_zero (kill, last_basic_block);
- sbitmap_vector_zero (comp, last_basic_block);
+ bitmap_vector_clear (kill, last_basic_block);
+ bitmap_vector_clear (comp, last_basic_block);
for (i = 0; i < table->size; i++)
{
diff --git a/gcc/cse.c b/gcc/cse.c
index af66c370e13..b41d47a36a2 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -2547,7 +2547,7 @@ hash_rtx_cb (const_rtx x, enum machine_mode mode,
Store 1 in DO_NOT_RECORD_P if any subexpression is volatile.
If HASH_ARG_IN_MEMORY_P is not NULL, store 1 in it if X contains
- a MEM rtx which does not have the RTX_UNCHANGING_P bit set.
+ a MEM rtx which does not have the MEM_READONLY_P flag set.
Note that cse_insn knows that the hash code of a MEM expression
is just (int) MEM plus the hash code of the address. */
@@ -2563,7 +2563,7 @@ hash_rtx (const_rtx x, enum machine_mode mode, int *do_not_record_p,
/* Hash an rtx X for cse via hash_rtx.
Stores 1 in do_not_record if any subexpression is volatile.
Stores 1 in hash_arg_in_memory if X contains a mem rtx which
- does not have the RTX_UNCHANGING_P bit set. */
+ does not have the MEM_READONLY_P flag set. */
static inline unsigned
canon_hash (rtx x, enum machine_mode mode)
@@ -6546,7 +6546,7 @@ cse_main (rtx f ATTRIBUTE_UNUSED, int nregs)
/* Set up the table of already visited basic blocks. */
cse_visited_basic_blocks = sbitmap_alloc (last_basic_block);
- sbitmap_zero (cse_visited_basic_blocks);
+ bitmap_clear (cse_visited_basic_blocks);
/* Loop over basic blocks in reverse completion order (RPO),
excluding the ENTRY and EXIT blocks. */
diff --git a/gcc/dce.c b/gcc/dce.c
index 9a42da761c2..efc26222e7e 100644
--- a/gcc/dce.c
+++ b/gcc/dce.c
@@ -1,5 +1,5 @@
/* RTL dead code elimination.
- Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
This file is part of GCC.
@@ -724,7 +724,7 @@ init_dce (bool fast)
can_alter_cfg = true;
marked = sbitmap_alloc (get_max_uid () + 1);
- sbitmap_zero (marked);
+ bitmap_clear (marked);
}
@@ -880,7 +880,10 @@ word_dce_process_block (basic_block bb, bool redo_out,
for (def_rec = DF_INSN_DEFS (insn); *def_rec; def_rec++)
dead_debug_insert_temp (&debug, DF_REF_REGNO (*def_rec), insn,
- DEBUG_TEMP_BEFORE_WITH_VALUE);
+ marked_insn_p (insn)
+ && !control_flow_insn_p (insn)
+ ? DEBUG_TEMP_AFTER_WITH_REG_FORCE
+ : DEBUG_TEMP_BEFORE_WITH_VALUE);
}
if (dump_file)
@@ -981,7 +984,9 @@ dce_process_block (basic_block bb, bool redo_out, bitmap au,
if (debug.used && !bitmap_empty_p (debug.used))
for (def_rec = DF_INSN_DEFS (insn); *def_rec; def_rec++)
dead_debug_insert_temp (&debug, DF_REF_REGNO (*def_rec), insn,
- DEBUG_TEMP_BEFORE_WITH_VALUE);
+ needed && !control_flow_insn_p (insn)
+ ? DEBUG_TEMP_AFTER_WITH_REG_FORCE
+ : DEBUG_TEMP_BEFORE_WITH_VALUE);
}
dead_debug_local_finish (&debug, NULL);
@@ -1082,7 +1087,7 @@ fast_dce (bool word_level)
/* So something was deleted that requires a redo. Do it on
the cheap. */
delete_unmarked_insns ();
- sbitmap_zero (marked);
+ bitmap_clear (marked);
bitmap_clear (processed);
bitmap_clear (redo_out);
diff --git a/gcc/ddg.c b/gcc/ddg.c
index a7d3e665a85..8fcb98263bb 100644
--- a/gcc/ddg.c
+++ b/gcc/ddg.c
@@ -660,9 +660,9 @@ create_ddg (basic_block bb, int closing_branch_deps)
g->nodes[i].cuid = i;
g->nodes[i].successors = sbitmap_alloc (num_nodes);
- sbitmap_zero (g->nodes[i].successors);
+ bitmap_clear (g->nodes[i].successors);
g->nodes[i].predecessors = sbitmap_alloc (num_nodes);
- sbitmap_zero (g->nodes[i].predecessors);
+ bitmap_clear (g->nodes[i].predecessors);
g->nodes[i].first_note = (first_note ? first_note : insn);
g->nodes[i++].insn = insn;
first_note = NULL_RTX;
@@ -890,7 +890,7 @@ create_scc (ddg_ptr g, sbitmap nodes)
scc->backarcs = NULL;
scc->num_backarcs = 0;
scc->nodes = sbitmap_alloc (g->num_nodes);
- sbitmap_copy (scc->nodes, nodes);
+ bitmap_copy (scc->nodes, nodes);
/* Mark the backarcs that belong to this SCC. */
EXECUTE_IF_SET_IN_SBITMAP (nodes, 0, u, sbi)
@@ -980,11 +980,11 @@ find_successors (sbitmap succ, ddg_ptr g, sbitmap ops)
EXECUTE_IF_SET_IN_SBITMAP (ops, 0, i, sbi)
{
const sbitmap node_succ = NODE_SUCCESSORS (&g->nodes[i]);
- sbitmap_a_or_b (succ, succ, node_succ);
+ bitmap_ior (succ, succ, node_succ);
};
/* We want those that are not in ops. */
- sbitmap_difference (succ, succ, ops);
+ bitmap_and_compl (succ, succ, ops);
}
/* Given a set OPS of nodes in the DDG, find the set of their predecessors
@@ -999,11 +999,11 @@ find_predecessors (sbitmap preds, ddg_ptr g, sbitmap ops)
EXECUTE_IF_SET_IN_SBITMAP (ops, 0, i, sbi)
{
const sbitmap node_preds = NODE_PREDECESSORS (&g->nodes[i]);
- sbitmap_a_or_b (preds, preds, node_preds);
+ bitmap_ior (preds, preds, node_preds);
};
/* We want those that are not in ops. */
- sbitmap_difference (preds, preds, ops);
+ bitmap_and_compl (preds, preds, ops);
}
@@ -1035,14 +1035,14 @@ check_sccs (ddg_all_sccs_ptr sccs, int num_nodes)
int i = 0;
sbitmap tmp = sbitmap_alloc (num_nodes);
- sbitmap_zero (tmp);
+ bitmap_clear (tmp);
for (i = 0; i < sccs->num_sccs; i++)
{
- gcc_assert (!sbitmap_empty_p (sccs->sccs[i]->nodes));
+ gcc_assert (!bitmap_empty_p (sccs->sccs[i]->nodes));
/* Verify that every node in sccs is in exactly one strongly
connected component. */
- gcc_assert (!sbitmap_any_common_bits (tmp, sccs->sccs[i]->nodes));
- sbitmap_a_or_b (tmp, tmp, sccs->sccs[i]->nodes);
+ gcc_assert (!bitmap_intersect_p (tmp, sccs->sccs[i]->nodes));
+ bitmap_ior (tmp, tmp, sccs->sccs[i]->nodes);
}
sbitmap_free (tmp);
}
@@ -1076,9 +1076,9 @@ create_ddg_all_sccs (ddg_ptr g)
if (backarc->aux.count == IN_SCC)
continue;
- sbitmap_zero (scc_nodes);
- sbitmap_zero (from);
- sbitmap_zero (to);
+ bitmap_clear (scc_nodes);
+ bitmap_clear (from);
+ bitmap_clear (to);
SET_BIT (from, dest->cuid);
SET_BIT (to, src->cuid);
@@ -1132,15 +1132,15 @@ find_nodes_on_paths (sbitmap result, ddg_ptr g, sbitmap from, sbitmap to)
sbitmap reach_to = sbitmap_alloc (num_nodes);
sbitmap tmp = sbitmap_alloc (num_nodes);
- sbitmap_copy (reachable_from, from);
- sbitmap_copy (tmp, from);
+ bitmap_copy (reachable_from, from);
+ bitmap_copy (tmp, from);
change = 1;
while (change)
{
change = 0;
- sbitmap_copy (workset, tmp);
- sbitmap_zero (tmp);
+ bitmap_copy (workset, tmp);
+ bitmap_clear (tmp);
EXECUTE_IF_SET_IN_SBITMAP (workset, 0, u, sbi)
{
ddg_edge_ptr e;
@@ -1161,15 +1161,15 @@ find_nodes_on_paths (sbitmap result, ddg_ptr g, sbitmap from, sbitmap to)
}
}
- sbitmap_copy (reach_to, to);
- sbitmap_copy (tmp, to);
+ bitmap_copy (reach_to, to);
+ bitmap_copy (tmp, to);
change = 1;
while (change)
{
change = 0;
- sbitmap_copy (workset, tmp);
- sbitmap_zero (tmp);
+ bitmap_copy (workset, tmp);
+ bitmap_clear (tmp);
EXECUTE_IF_SET_IN_SBITMAP (workset, 0, u, sbi)
{
ddg_edge_ptr e;
@@ -1190,7 +1190,7 @@ find_nodes_on_paths (sbitmap result, ddg_ptr g, sbitmap from, sbitmap to)
}
}
- answer = sbitmap_a_and_b_cg (result, reachable_from, reach_to);
+ answer = bitmap_and (result, reachable_from, reach_to);
sbitmap_free (workset);
sbitmap_free (reachable_from);
sbitmap_free (reach_to);
@@ -1247,7 +1247,7 @@ longest_simple_path (struct ddg * g, int src, int dest, sbitmap nodes)
g->nodes[i].aux.count = -1;
g->nodes[src].aux.count = 0;
- sbitmap_zero (tmp);
+ bitmap_clear (tmp);
SET_BIT (tmp, src);
while (change)
@@ -1255,8 +1255,8 @@ longest_simple_path (struct ddg * g, int src, int dest, sbitmap nodes)
sbitmap_iterator sbi;
change = 0;
- sbitmap_copy (workset, tmp);
- sbitmap_zero (tmp);
+ bitmap_copy (workset, tmp);
+ bitmap_clear (tmp);
EXECUTE_IF_SET_IN_SBITMAP (workset, 0, u, sbi)
{
ddg_node_ptr u_node = &g->nodes[u];
diff --git a/gcc/defaults.h b/gcc/defaults.h
index 6eead33ba6c..76909ab2d7e 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -1218,6 +1218,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define ATTRIBUTE_ALIGNED_VALUE BIGGEST_ALIGNMENT
#endif
+#ifndef SLOW_UNALIGNED_ACCESS
+#define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) STRICT_ALIGNMENT
+#endif
+
/* For most ports anything that evaluates to a constant symbolic
or integer value is acceptable as a constant address. */
#ifndef CONSTANT_ADDRESS_P
diff --git a/gcc/df-core.c b/gcc/df-core.c
index 34f1ea351c1..2ac11e42e58 100644
--- a/gcc/df-core.c
+++ b/gcc/df-core.c
@@ -1080,7 +1080,7 @@ df_worklist_dataflow (struct dataflow *dataflow,
bbindex_to_postorder[i] = last_basic_block;
/* Initialize the considered map. */
- sbitmap_zero (considered);
+ bitmap_clear (considered);
EXECUTE_IF_SET_IN_BITMAP (blocks_to_consider, 0, index, bi)
{
SET_BIT (considered, index);
diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi
index fa5989e6bde..c463e7c2a82 100644
--- a/gcc/doc/cpp.texi
+++ b/gcc/doc/cpp.texi
@@ -856,7 +856,8 @@ requested with @code{@w{#include <@var{file}>}} in:
/usr/include
@end smallexample
-For C++ programs, it will also look in @file{/usr/include/g++-v3},
+For C++ programs, it will also look in
+@file{@var{libdir}/../include/c++/@var{version}},
first. In the above, @var{target} is the canonical name of the system
GCC was configured to compile code for; often but not always the same as
the canonical name of the system it runs on. @var{version} is the
diff --git a/gcc/doc/cppopts.texi b/gcc/doc/cppopts.texi
index 27b10952976..a2eb79d06f9 100644
--- a/gcc/doc/cppopts.texi
+++ b/gcc/doc/cppopts.texi
@@ -1,5 +1,5 @@
@c Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-@c 2010, Free Software Foundation, Inc.
+@c 2010, 2012, Free Software Foundation, Inc.
@c This is part of the CPP and GCC manuals.
@c For copying conditions, see the file gcc.texi.
@@ -805,7 +805,7 @@ Replacement: [ ] @{ @} # \ ^ | ~
Enable special code to work around file systems which only permit very
short file names, such as MS-DOS@.
-@itemx --help
+@item --help
@itemx --target-help
@opindex help
@opindex target-help
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index fb1becb9912..5c4f8fd6544 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -1251,10 +1251,10 @@ The @code{__flash} qualifier will locate data in the
instruction. Pointers to this address space are 16 bits wide.
@item __flash1
-@item __flash2
-@item __flash3
-@item __flash4
-@item __flash5
+@itemx __flash2
+@itemx __flash3
+@itemx __flash4
+@itemx __flash5
@cindex @code{__flash1} AVR Named Address Spaces
@cindex @code{__flash2} AVR Named Address Spaces
@cindex @code{__flash3} AVR Named Address Spaces
diff --git a/gcc/doc/generic.texi b/gcc/doc/generic.texi
index c739731de67..e87881176da 100644
--- a/gcc/doc/generic.texi
+++ b/gcc/doc/generic.texi
@@ -1,4 +1,4 @@
-@c Copyright (c) 2004, 2005, 2007, 2008, 2010 Free Software Foundation, Inc.
+@c Copyright (c) 2004, 2005, 2007, 2008, 2010, 2012 Free Software Foundation, Inc.
@c Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@@ -1417,13 +1417,13 @@ generate these expressions anyhow, if it can tell that strictness does
not matter. The type of the operands and that of the result are
always of @code{BOOLEAN_TYPE} or @code{INTEGER_TYPE}.
-@itemx POINTER_PLUS_EXPR
+@item POINTER_PLUS_EXPR
This node represents pointer arithmetic. The first operand is always
a pointer/reference type. The second operand is always an unsigned
integer type compatible with sizetype. This is the only binary
arithmetic operand that can operate on pointer types.
-@itemx PLUS_EXPR
+@item PLUS_EXPR
@itemx MINUS_EXPR
@itemx MULT_EXPR
These nodes represent various binary arithmetic operations.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index e59ef9914fe..fc87a369398 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -261,7 +261,7 @@ Objective-C and Objective-C++ Dialects}.
-Woverlength-strings -Wpacked -Wpacked-bitfield-compat -Wpadded @gol
-Wparentheses -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
-Wpointer-arith -Wno-pointer-to-int-cast @gol
--Wredundant-decls @gol
+-Wredundant-decls -Wno-return-local-addr @gol
-Wreturn-type -Wsequence-point -Wshadow @gol
-Wsign-compare -Wsign-conversion -Wsizeof-pointer-memaccess @gol
-Wstack-protector -Wstack-usage=@var{len} -Wstrict-aliasing @gol
@@ -1617,7 +1617,7 @@ GNU dialect of ISO C99. When ISO C99 is fully implemented in GCC,
this will become the default. The name @samp{gnu9x} is deprecated.
@item gnu11
-@item gnu1x
+@itemx gnu1x
GNU dialect of ISO C11. Support is incomplete and experimental. The
name @samp{gnu1x} is deprecated.
@@ -3539,6 +3539,12 @@ definitions, may be found on the GCC readings page, at
This warning is enabled by @option{-Wall} for C and C++.
+@item -Wno-return-local-addr
+@opindex Wno-return-local-addr
+@opindex Wreturn-local-addr
+Do not warn about returning a pointer (or in C++, a reference) to a
+variable that goes out of scope after the function returns.
+
@item -Wreturn-type
@opindex Wreturn-type
@opindex Wno-return-type
@@ -4636,6 +4642,13 @@ cases where multiple declaration is valid and changes nothing.
@opindex Wno-nested-externs
Warn if an @code{extern} declaration is encountered within a function.
+@item -Wno-inherited-variadic-ctor
+@opindex Winherited-variadic-ctor
+@opindex Wno-inherited-variadic-ctor
+Suppress warnings about use of C++11 inheriting constructors when the
+base class inherited from has a C variadic constructor; the warning is
+on by default because the ellipsis is not inherited.
+
@item -Winline
@opindex Winline
@opindex Wno-inline
@@ -4719,6 +4732,16 @@ using scalars of wider type, which normally is more performance efficient;
and @code{as a single scalar}, which means that vector fits into a
scalar type.
+@item -Wno-virtual-move-assign
+@opindex Wvirtual-move-assign
+@opindex Wno-virtual-move-assign
+Suppress warnings about inheriting from a virtual base with a
+non-trivial C++11 move assignment operator. This is dangerous because
+if the virtual base is reachable along more than one path, it will be
+moved multiple times, which can mean both objects end up in the
+moved-from state. If the move assignment operator is written to avoid
+moving from a moved-from object, this warning can be disabled.
+
@item -Wvla
@opindex Wvla
@opindex Wno-vla
@@ -5297,7 +5320,7 @@ is set by this option.
For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
@code{dbg_cnt(dce)} returns true only for first 10 invocations.
-@itemx -fenable-@var{kind}-@var{pass}
+@item -fenable-@var{kind}-@var{pass}
@itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
@opindex fdisable-
@opindex fenable-
@@ -5452,11 +5475,11 @@ Dump after duplicating the computed gotos.
@option{-fdump-rtl-ce3} enable dumping after the three
if conversion passes.
-@itemx -fdump-rtl-cprop_hardreg
+@item -fdump-rtl-cprop_hardreg
@opindex fdump-rtl-cprop_hardreg
Dump after hard register copy propagation.
-@itemx -fdump-rtl-csa
+@item -fdump-rtl-csa
@opindex fdump-rtl-csa
Dump after combining stack adjustments.
@@ -5467,11 +5490,11 @@ Dump after combining stack adjustments.
@option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
the two common subexpression elimination passes.
-@itemx -fdump-rtl-dce
+@item -fdump-rtl-dce
@opindex fdump-rtl-dce
Dump after the standalone dead code elimination passes.
-@itemx -fdump-rtl-dbr
+@item -fdump-rtl-dbr
@opindex fdump-rtl-dbr
Dump after delayed branch scheduling.
@@ -5516,7 +5539,7 @@ Dump after the initialization of the registers.
@opindex fdump-rtl-initvals
Dump after the computation of the initial value sets.
-@itemx -fdump-rtl-into_cfglayout
+@item -fdump-rtl-into_cfglayout
@opindex fdump-rtl-into_cfglayout
Dump after converting to cfglayout mode.
@@ -5546,7 +5569,7 @@ Dump after removing redundant mode switches.
@opindex fdump-rtl-rnreg
Dump after register renumbering.
-@itemx -fdump-rtl-outof_cfglayout
+@item -fdump-rtl-outof_cfglayout
@opindex fdump-rtl-outof_cfglayout
Dump after converting from cfglayout mode.
@@ -10803,10 +10826,10 @@ integer multiply, or integer multiply-and-accumulate.
The default is @option{-mfp-mode=caller}
@item -mnosplit-lohi
+@itemx -mno-postinc
+@itemx -mno-postmodify
@opindex mnosplit-lohi
-@item -mno-postinc
@opindex mno-postinc
-@item -mno-postmodify
@opindex mno-postmodify
Code generation tweaks that disable, respectively, splitting of 32-bit
loads, generation of post-increment addresses, and generation of
@@ -10889,7 +10912,7 @@ statically linked only.
Do not assume that unaligned memory references will be handled by the system.
@item -momit-leaf-frame-pointer
-@item -mno-omit-leaf-frame-pointer
+@itemx -mno-omit-leaf-frame-pointer
@opindex momit-leaf-frame-pointer
@opindex mno-omit-leaf-frame-pointer
Omit or keep the frame pointer in leaf functions. The former behaviour is the
@@ -11727,7 +11750,7 @@ This is the case for devices with at least 16@tie{}KiB of program
memory.
@item __AVR_HAVE_EIJMP_EICALL__
-@item __AVR_3_BYTE_PC__
+@itemx __AVR_3_BYTE_PC__
The device has the @code{EIJMP} and @code{EICALL} instructions.
This is the case for devices with more than 128@tie{}KiB of program memory.
This also means that the program counter
@@ -11738,13 +11761,13 @@ The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
with up to 128@tie{}KiB of program memory.
@item __AVR_HAVE_8BIT_SP__
-@item __AVR_HAVE_16BIT_SP__
+@itemx __AVR_HAVE_16BIT_SP__
The stack pointer (SP) register is treated as 8-bit respectively
16-bit register by the compiler.
The definition of these macros is affected by @code{-mtiny-stack}.
@item __AVR_HAVE_SPH__
-@item __AVR_SP8__
+@itemx __AVR_SP8__
The device has the SPH (high part of stack pointer) special function
register or has an 8-bit stack pointer, respectively.
The definition of these macros is affected by @code{-mmcu=} and
@@ -11752,9 +11775,9 @@ in the cases of @code{-mmcu=avr2} and @code{-mmcu=avr25} also
by @code{-msp8}.
@item __AVR_HAVE_RAMPD__
-@item __AVR_HAVE_RAMPX__
-@item __AVR_HAVE_RAMPY__
-@item __AVR_HAVE_RAMPZ__
+@itemx __AVR_HAVE_RAMPX__
+@itemx __AVR_HAVE_RAMPY__
+@itemx __AVR_HAVE_RAMPZ__
The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
@code{RAMPZ} special function register, respectively.
@@ -11762,7 +11785,7 @@ The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
This macro reflects the @code{-mno-interrupts} command line option.
@item __AVR_ERRATA_SKIP__
-@item __AVR_ERRATA_SKIP_JMP_CALL__
+@itemx __AVR_ERRATA_SKIP_JMP_CALL__
Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
instructions because of a hardware erratum. Skip instructions are
@code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
@@ -18445,7 +18468,7 @@ Mark the @code{MAC} register as call-clobbered, even if
@option{-mhitachi} is given.
@item -mieee
-@item -mno-ieee
+@itemx -mno-ieee
@opindex mieee
@opindex mnoieee
Control the IEEE compliance of floating-point comparisons, which affects the
diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi
index 88e1ca7c4f6..bca0d8fa656 100644
--- a/gcc/doc/md.texi
+++ b/gcc/doc/md.texi
@@ -3219,6 +3219,9 @@ when the Visual Instruction Set is available.
@item h
64-bit global or out register for the SPARC-V8+ architecture.
+@item C
+The constant all-ones, for floating-point.
+
@item D
A vector constant
@@ -3233,10 +3236,12 @@ Zero
loaded with the @code{sethi} instruction)
@item L
-A constant in the range supported by @code{movcc} instructions
+A constant in the range supported by @code{movcc} instructions (11-bit
+signed immediate)
@item M
-A constant in the range supported by @code{movrcc} instructions
+A constant in the range supported by @code{movrcc} instructions (10-bit
+signed immediate)
@item N
Same as @samp{K}, except that it verifies that bits that are not in the
@@ -3252,6 +3257,9 @@ Floating-point zero
@item H
Signed 13-bit constant, sign-extended to 32 or 64 bits
+@item P
+The constant -1
+
@item Q
Floating-point constant whose integral representation can
be moved into an integer register using a single sethi
@@ -3270,12 +3278,12 @@ instruction sequence
@item T
Memory address aligned to an 8-byte boundary
-@item U
-Even register
-
@item W
Memory address for @samp{e} constraint registers
+@item w
+Memory address with only a base register
+
@item Y
Vector zero
@@ -4475,8 +4483,8 @@ means of constraints requiring operands 1 and 0 to be the same location.
@cindex @code{ior@var{m}3} instruction pattern
@cindex @code{xor@var{m}3} instruction pattern
@item @samp{ssadd@var{m}3}, @samp{usadd@var{m}3}
-@item @samp{sub@var{m}3}, @samp{sssub@var{m}3}, @samp{ussub@var{m}3}
-@item @samp{mul@var{m}3}, @samp{ssmul@var{m}3}, @samp{usmul@var{m}3}
+@itemx @samp{sub@var{m}3}, @samp{sssub@var{m}3}, @samp{ussub@var{m}3}
+@itemx @samp{mul@var{m}3}, @samp{ssmul@var{m}3}, @samp{usmul@var{m}3}
@itemx @samp{div@var{m}3}, @samp{ssdiv@var{m}3}
@itemx @samp{udiv@var{m}3}, @samp{usdiv@var{m}3}
@itemx @samp{mod@var{m}3}, @samp{umod@var{m}3}
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 89e7712b8d4..ec8263f4087 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -691,7 +691,7 @@ standard rule in @file{gcc/Makefile.in} to the variable
@code{lang_checks}.
@table @code
-@itemx all.cross
+@item all.cross
@itemx start.encap
@itemx rest.encap
FIXME: exactly what goes in each of these targets?
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 68713f7bb2f..665c5b1edd6 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -11323,7 +11323,8 @@ accepted by immediate-add plus one. We currently assume that the
value of @code{TARGET_CONST_ANCHOR} is a power of 2. For example, on
MIPS, where add-immediate takes a 16-bit signed value,
@code{TARGET_CONST_ANCHOR} is set to @samp{0x8000}. The default value
-is zero, which disables this optimization. @end deftypevr
+is zero, which disables this optimization.
+@end deftypevr
@deftypefn {Target Hook} {unsigned HOST_WIDE_INT} TARGET_MEMMODEL_CHECK (unsigned HOST_WIDE_INT @var{val})
Validate target specific memory model mask bits. When NULL no target specific
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index c325cd4ae6e..289934be17e 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -11165,7 +11165,8 @@ accepted by immediate-add plus one. We currently assume that the
value of @code{TARGET_CONST_ANCHOR} is a power of 2. For example, on
MIPS, where add-immediate takes a 16-bit signed value,
@code{TARGET_CONST_ANCHOR} is set to @samp{0x8000}. The default value
-is zero, which disables this optimization. @end deftypevr
+is zero, which disables this optimization.
+@end deftypevr
@hook TARGET_MEMMODEL_CHECK
Validate target specific memory model mask bits. When NULL no target specific
diff --git a/gcc/domwalk.c b/gcc/domwalk.c
index 5f99436c26b..6e8c3968715 100644
--- a/gcc/domwalk.c
+++ b/gcc/domwalk.c
@@ -145,7 +145,7 @@ walk_dominator_tree (struct dom_walk_data *walk_data, basic_block bb)
basic_block *worklist = XNEWVEC (basic_block, n_basic_blocks * 2);
int sp = 0;
sbitmap visited = sbitmap_alloc (last_basic_block + 1);
- sbitmap_zero (visited);
+ bitmap_clear (visited);
SET_BIT (visited, ENTRY_BLOCK_PTR->index);
while (true)
diff --git a/gcc/dse.c b/gcc/dse.c
index 631a1f20ac7..a987f3cc38f 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -654,19 +654,21 @@ clear_alias_set_lookup (alias_set_type alias_set)
struct invariant_group_base_hasher : typed_noop_remove <group_info>
{
- typedef group_info T;
- static inline hashval_t hash (const T *);
- static inline bool equal (const T *, const T *);
+ typedef group_info value_type;
+ typedef group_info compare_type;
+ static inline hashval_t hash (const value_type *);
+ static inline bool equal (const value_type *, const compare_type *);
};
inline bool
-invariant_group_base_hasher::equal (const T *gi1, const T *gi2)
+invariant_group_base_hasher::equal (const value_type *gi1,
+ const compare_type *gi2)
{
return rtx_equal_p (gi1->rtx_base, gi2->rtx_base);
}
inline hashval_t
-invariant_group_base_hasher::hash (const T *gi)
+invariant_group_base_hasher::hash (const value_type *gi)
{
int do_not_record;
return hash_rtx (gi->rtx_base, Pmode, &do_not_record, NULL, false);
@@ -3382,7 +3384,7 @@ dse_step3 (bool for_spills)
bitmap all_ones = NULL;
unsigned int i;
- sbitmap_ones (unreachable_blocks);
+ bitmap_ones (unreachable_blocks);
FOR_ALL_BB (bb)
{
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index bed3d67353a..24c75065656 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -4622,7 +4622,10 @@ add_var_loc_to_decl (tree decl, rtx loc_note, const char *label)
if (DECL_DEBUG_EXPR_IS_FROM (decl))
{
tree realdecl = DECL_DEBUG_EXPR (decl);
- if (realdecl && handled_component_p (realdecl))
+ if (realdecl
+ && (handled_component_p (realdecl)
+ || (TREE_CODE (realdecl) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (realdecl, 0)) == ADDR_EXPR)))
{
HOST_WIDE_INT maxsize;
tree innerdecl;
@@ -21259,7 +21262,8 @@ prune_unused_types_prune (dw_die_ref die)
/* If we pruned children, and this is a class, mark it as a
declaration to inform debuggers that this is not a complete
class definition. */
- if (pruned && die->die_mark == 1 && class_scope_p (die))
+ if (pruned && die->die_mark == 1 && class_scope_p (die)
+ && ! is_declaration_die (die))
add_AT_flag (die, DW_AT_declaration, 1);
}
diff --git a/gcc/ebitmap.c b/gcc/ebitmap.c
index 977d4ef0f6d..7c7d58b96dc 100644
--- a/gcc/ebitmap.c
+++ b/gcc/ebitmap.c
@@ -79,7 +79,7 @@ along with GCC; see the file COPYING3. If not see
/* Find the last set bit in ebitmap MAP. */
int
-ebitmap_last_set_bit (ebitmap map)
+bitmap_last_set_bit (ebitmap map)
{
unsigned int i = 0;
ebitmap_iterator ebi;
@@ -183,10 +183,10 @@ ebitmap_array_clear (ebitmap map)
/* Clear ebitmap MAP. */
void
-ebitmap_clear (ebitmap map)
+bitmap_clear (ebitmap map)
{
ebitmap_array_clear (map);
- sbitmap_zero (map->wordmask);
+ bitmap_clear (map->wordmask);
map->wordmask = sbitmap_resize (map->wordmask, 1, 0);
map->numwords = 0;
map->cache = NULL;
@@ -203,7 +203,7 @@ ebitmap_alloc (unsigned int size)
size = EBITMAP_ELT_BITS;
ebitmap_array_init (ret, (size + EBITMAP_ELT_BITS - 1) / EBITMAP_ELT_BITS);
ret->wordmask = sbitmap_alloc_with_popcount (size);
- sbitmap_zero (ret->wordmask);
+ bitmap_clear (ret->wordmask);
ret->numwords = 0;
ret->cache = NULL;
ret->cacheindex = 0;
@@ -214,7 +214,7 @@ ebitmap_alloc (unsigned int size)
/* Clear BIT from ebitmap MAP. */
void
-ebitmap_clear_bit (ebitmap map, unsigned int bit)
+bitmap_clear_bit (ebitmap map, unsigned int bit)
{
unsigned int wordindex = bit / EBITMAP_ELT_BITS;
unsigned int eltwordindex = 0;
@@ -269,7 +269,7 @@ ebitmap_clear_bit (ebitmap map, unsigned int bit)
/* Set BIT in ebitmap MAP. */
void
-ebitmap_set_bit (ebitmap map, unsigned int bit)
+bitmap_set_bit (ebitmap map, unsigned int bit)
{
unsigned int wordindex = bit / EBITMAP_ELT_BITS;
unsigned int eltwordindex;
@@ -325,7 +325,7 @@ ebitmap_set_bit (ebitmap map, unsigned int bit)
/* Return true if MAP contains BIT. */
bool
-ebitmap_bit_p (ebitmap map, unsigned int bit)
+bitmap_bit_p (ebitmap map, unsigned int bit)
{
unsigned int wordindex = bit / EBITMAP_ELT_BITS;
unsigned int bitindex= bit % EBITMAP_ELT_BITS;
@@ -355,12 +355,12 @@ ebitmap_bit_p (ebitmap map, unsigned int bit)
/* Copy ebitmap SRC to DST. */
void
-ebitmap_copy (ebitmap dst, ebitmap src)
+bitmap_copy (ebitmap dst, ebitmap src)
{
/* Blow away any existing wordmask, and copy the new one. */
sbitmap_free (dst->wordmask);
dst->wordmask = sbitmap_alloc_with_popcount (src->wordmask->n_bits);
- sbitmap_copy (dst->wordmask, src->wordmask);
+ bitmap_copy (dst->wordmask, src->wordmask);
/* Make sure our destination array is big enough, and then copy the
actual words. */
@@ -374,14 +374,14 @@ ebitmap_copy (ebitmap dst, ebitmap src)
/* Dump ebitmap BMAP to FILE. */
void
-dump_ebitmap (FILE *file, ebitmap bmap)
+dump_bitmap (FILE *file, ebitmap bmap)
{
unsigned int pos;
unsigned int i;
int res;
unsigned int size;
- res = sbitmap_last_set_bit (bmap->wordmask);
+ res = bitmap_last_set_bit (bmap->wordmask);
if (res == -1)
size = 0;
else
@@ -390,7 +390,7 @@ dump_ebitmap (FILE *file, ebitmap bmap)
fprintf (file, "n_words = %d, set = {", bmap->numwords);
for (pos = 30, i = 0; i < size; i++)
- if (ebitmap_bit_p (bmap, i))
+ if (bitmap_bit_p (bmap, i))
{
if (pos > 70)
{
@@ -407,15 +407,15 @@ dump_ebitmap (FILE *file, ebitmap bmap)
/* Dump ebitmap BMAP to stderr. */
DEBUG_FUNCTION void
-debug_ebitmap (ebitmap bmap)
+debug_bitmap (ebitmap bmap)
{
- dump_ebitmap (stderr, bmap);
+ dump_bitmap (stderr, bmap);
}
/* Perform the operation DST &= SRC. */
void
-ebitmap_and_into (ebitmap dst, ebitmap src)
+bitmap_and_into (ebitmap dst, ebitmap src)
{
sbitmap_iterator sbi;
unsigned int i;
@@ -430,13 +430,13 @@ ebitmap_and_into (ebitmap dst, ebitmap src)
/* Short circuit the empty bitmap cases. */
if (src->numwords == 0 || dst->numwords == 0)
{
- ebitmap_clear (dst);
+ bitmap_clear (dst);
return;
}
/* AND the masks, then walk the words that may actually appear in
the result, AND'ing them. */
- sbitmap_a_and_b (dst->wordmask, dst->wordmask, src->wordmask);
+ bitmap_and (dst->wordmask, dst->wordmask, src->wordmask);
EXECUTE_IF_SET_IN_SBITMAP (dst->wordmask, 0, i, sbi)
{
@@ -469,7 +469,7 @@ ebitmap_and_into (ebitmap dst, ebitmap src)
/* Perform the operation DST = SRC1 & SRC2. */
void
-ebitmap_and (ebitmap dst, ebitmap src1, ebitmap src2)
+bitmap_and (ebitmap dst, ebitmap src1, ebitmap src2)
{
sbitmap_iterator sbi;
unsigned int i;
@@ -480,7 +480,7 @@ ebitmap_and (ebitmap dst, ebitmap src1, ebitmap src2)
dst->cache = NULL;
if (src1->numwords == 0 || src2->numwords == 0)
{
- ebitmap_clear (dst);
+ bitmap_clear (dst);
return;
}
@@ -488,7 +488,7 @@ ebitmap_and (ebitmap dst, ebitmap src1, ebitmap src2)
= sbitmap_resize (dst->wordmask,
MIN (src1->wordmask->n_bits, src2->wordmask->n_bits),
0);
- sbitmap_a_and_b (dst->wordmask, src1->wordmask, src2->wordmask);
+ bitmap_and (dst->wordmask, src1->wordmask, src2->wordmask);
EXECUTE_IF_SET_IN_SBITMAP (dst->wordmask, 0, i, sbi)
{
@@ -524,8 +524,8 @@ ebitmap_and (ebitmap dst, ebitmap src1, ebitmap src2)
gcc_assert (dst->elts[i] != 0);
EXECUTE_IF_SET_IN_EBITMAP (src1, 0, i, ebi)
- if (ebitmap_bit_p (src2, i))
- gcc_assert (ebitmap_bit_p (dst, i));
+ if (bitmap_bit_p (src2, i))
+ gcc_assert (bitmap_bit_p (dst, i));
for (i = 0; i < dst->numwords; i++)
gcc_assert (dst->elts[i] != 0);
@@ -542,7 +542,7 @@ ebitmap_and (ebitmap dst, ebitmap src1, ebitmap src2)
changed. */
bool
-ebitmap_ior_into (ebitmap dst, ebitmap src)
+bitmap_ior_into (ebitmap dst, ebitmap src)
{
unsigned int dstsize = dst->wordmask->n_bits;
unsigned int srcsize = src->wordmask->n_bits;
@@ -557,7 +557,7 @@ ebitmap_ior_into (ebitmap dst, ebitmap src)
unsigned int newarraysize;
#ifdef EBITMAP_DEBUGGING
ebitmap dstcopy = ebitmap_alloc (1);
- ebitmap_copy (dstcopy, dst);
+ bitmap_copy (dstcopy, dst);
#endif
dst->cache = NULL;
@@ -566,7 +566,7 @@ ebitmap_ior_into (ebitmap dst, ebitmap src)
if (dst->numwords == 0 && src->numwords != 0)
{
- ebitmap_copy (dst, src);
+ bitmap_copy (dst, src);
return true;
}
else if (src->numwords == 0)
@@ -575,10 +575,10 @@ ebitmap_ior_into (ebitmap dst, ebitmap src)
/* We can do without the temp mask if it's faster, but it would mean
touching more words in the actual dense vector. */
tempmask = sbitmap_alloc (MAX (srcsize, dstsize));
- sbitmap_zero (tempmask);
+ bitmap_clear (tempmask);
if (srcsize == dstsize)
{
- sbitmap_a_or_b (tempmask, dst->wordmask, src->wordmask);
+ bitmap_ior (tempmask, dst->wordmask, src->wordmask);
}
else
{
@@ -586,13 +586,13 @@ ebitmap_ior_into (ebitmap dst, ebitmap src)
0);
if (srcsize >= dstsize)
{
- sbitmap_copy_n (tempmask, dst->wordmask, dst->wordmask->size);
- sbitmap_a_or_b (tempmask, tempmask, src->wordmask);
+ bitmap_copy_n (tempmask, dst->wordmask, dst->wordmask->size);
+ bitmap_ior (tempmask, tempmask, src->wordmask);
}
else
{
- sbitmap_copy_n (tempmask, src->wordmask, src->wordmask->size);
- sbitmap_a_or_b (tempmask, tempmask, dst->wordmask);
+ bitmap_copy_n (tempmask, src->wordmask, src->wordmask->size);
+ bitmap_ior (tempmask, tempmask, dst->wordmask);
}
}
newarraysize = src->numwords + dst->numwords;
@@ -649,12 +649,12 @@ ebitmap_ior_into (ebitmap dst, ebitmap src)
gcc_assert (dst->elts[i] != 0);
EXECUTE_IF_SET_IN_EBITMAP (src, 0, i, ebi)
- gcc_assert (ebitmap_bit_p (dst, i));
+ gcc_assert (bitmap_bit_p (dst, i));
EXECUTE_IF_SET_IN_EBITMAP (dstcopy, 0, i, ebi)
- gcc_assert (ebitmap_bit_p (dst, i));
+ gcc_assert (bitmap_bit_p (dst, i));
sbitmap_verify_popcount (dst->wordmask);
- gcc_assert (changed == !ebitmap_equal_p (dst, dstcopy));
+ gcc_assert (changed == !bitmap_equal_p (dst, dstcopy));
gcc_assert (sbitmap_popcount (dst->wordmask,
dst->wordmask->n_bits) == dst->numwords);
}
@@ -666,7 +666,7 @@ ebitmap_ior_into (ebitmap dst, ebitmap src)
in DST has changed. */
bool
-ebitmap_ior (ebitmap dst, ebitmap src1, ebitmap src2)
+bitmap_ior (ebitmap dst, ebitmap src1, ebitmap src2)
{
unsigned int src1size = src1->wordmask->n_bits;
unsigned int src2size = src2->wordmask->n_bits;
@@ -681,27 +681,27 @@ ebitmap_ior (ebitmap dst, ebitmap src1, ebitmap src2)
unsigned int newarraysize;
#ifdef EBITMAP_DEBUGGING
ebitmap dstcopy = ebitmap_alloc (1);
- ebitmap_copy (dstcopy, dst);
+ bitmap_copy (dstcopy, dst);
#endif
dst->cache = NULL;
tempmask = sbitmap_alloc_with_popcount (MAX (src1size, src2size));
- sbitmap_zero (tempmask);
+ bitmap_clear (tempmask);
if (src1size == src2size)
{
- sbitmap_a_or_b (tempmask, src1->wordmask, src2->wordmask);
+ bitmap_ior (tempmask, src1->wordmask, src2->wordmask);
}
else
{
if (src1size >= src2size)
{
- sbitmap_copy_n (tempmask, src2->wordmask, src2->wordmask->size);
- sbitmap_a_or_b (tempmask, tempmask, src1->wordmask);
+ bitmap_copy_n (tempmask, src2->wordmask, src2->wordmask->size);
+ bitmap_ior (tempmask, tempmask, src1->wordmask);
}
else
{
- sbitmap_copy_n (tempmask, src1->wordmask, src1->wordmask->size);
- sbitmap_a_or_b (tempmask, tempmask, src2->wordmask);
+ bitmap_copy_n (tempmask, src1->wordmask, src1->wordmask->size);
+ bitmap_ior (tempmask, tempmask, src2->wordmask);
}
}
newarraysize = src1->numwords + src2->numwords;
@@ -768,13 +768,13 @@ ebitmap_ior (ebitmap dst, ebitmap src1, ebitmap src2)
gcc_assert (dst->elts[i] != 0);
EXECUTE_IF_SET_IN_EBITMAP (src1, 0, i, ebi)
- gcc_assert (ebitmap_bit_p (dst, i));
+ gcc_assert (bitmap_bit_p (dst, i));
EXECUTE_IF_SET_IN_EBITMAP (src2, 0, i, ebi)
- gcc_assert (ebitmap_bit_p (dst, i));
+ gcc_assert (bitmap_bit_p (dst, i));
}
sbitmap_verify_popcount (dst->wordmask);
- gcc_assert (changed == !ebitmap_equal_p (dst, dstcopy));
+ gcc_assert (changed == !bitmap_equal_p (dst, dstcopy));
gcc_assert (sbitmap_popcount (dst->wordmask,
dst->wordmask->n_bits) == dst->numwords);
#endif
@@ -786,7 +786,7 @@ ebitmap_ior (ebitmap dst, ebitmap src1, ebitmap src2)
has changed. */
bool
-ebitmap_and_compl_into (ebitmap dst, ebitmap src)
+bitmap_and_compl_into (ebitmap dst, ebitmap src)
{
bool changed = false;
unsigned int i;
@@ -795,7 +795,7 @@ ebitmap_and_compl_into (ebitmap dst, ebitmap src)
sbitmap_iterator sbi;
#ifdef EBITMAP_DEBUGGING
ebitmap dstcopy = ebitmap_alloc (1);
- ebitmap_copy (dstcopy, dst);
+ bitmap_copy (dstcopy, dst);
#endif
gcc_assert (dst != src);
@@ -840,8 +840,8 @@ ebitmap_and_compl_into (ebitmap dst, ebitmap src)
EXECUTE_IF_SET_IN_EBITMAP (dstcopy, 0, i, ebi)
{
- if (!ebitmap_bit_p (src, i))
- gcc_assert (ebitmap_bit_p (dst, i));
+ if (!bitmap_bit_p (src, i))
+ gcc_assert (bitmap_bit_p (dst, i));
}
for (i = 0; i < dst->numwords; i++)
@@ -850,7 +850,7 @@ ebitmap_and_compl_into (ebitmap dst, ebitmap src)
gcc_assert (sbitmap_popcount (dst->wordmask,
dst->wordmask->n_bits) == neweltindex);
sbitmap_verify_popcount (dst->wordmask);
- gcc_assert (changed == !ebitmap_equal_p (dst, dstcopy));
+ gcc_assert (changed == !bitmap_equal_p (dst, dstcopy));
gcc_assert (sbitmap_popcount (dst->wordmask,
dst->wordmask->n_bits) == dst->numwords);
}
@@ -865,7 +865,7 @@ ebitmap_and_compl_into (ebitmap dst, ebitmap src)
in DST has changed. */
bool
-ebitmap_and_compl (ebitmap dst, ebitmap src1, ebitmap src2)
+bitmap_and_compl (ebitmap dst, ebitmap src1, ebitmap src2)
{
unsigned int src1size = src1->wordmask->n_bits;
sbitmap_iterator sbi;
@@ -880,8 +880,8 @@ ebitmap_and_compl (ebitmap dst, ebitmap src1, ebitmap src2)
/* XXX: Optimize like the into version. */
dst->cache = NULL;
tempmask = sbitmap_alloc_with_popcount (src1size);
- sbitmap_zero (tempmask);
- sbitmap_copy (tempmask, src1->wordmask);
+ bitmap_clear (tempmask);
+ bitmap_copy (tempmask, src1->wordmask);
newarraysize = src1->numwords;
newarray = XNEWVEC (EBITMAP_ELT_TYPE, newarraysize);
@@ -945,8 +945,8 @@ ebitmap_and_compl (ebitmap dst, ebitmap src1, ebitmap src2)
EXECUTE_IF_SET_IN_EBITMAP (src1, 0, i, ebi)
{
- if (!ebitmap_bit_p (src2, i))
- gcc_assert (ebitmap_bit_p (dst, i));
+ if (!bitmap_bit_p (src2, i))
+ gcc_assert (bitmap_bit_p (dst, i));
}
for (i = 0; i < dst->numwords; i++)
gcc_assert (dst->elts[i] != 0);
@@ -962,30 +962,30 @@ ebitmap_and_compl (ebitmap dst, ebitmap src1, ebitmap src2)
/* Perform the operation DST = A | (B & ~C). */
bool
-ebitmap_ior_and_compl (ebitmap dst, ebitmap a, ebitmap b, ebitmap c)
+bitmap_ior_and_compl (ebitmap dst, ebitmap a, ebitmap b, ebitmap c)
{
bool changed;
ebitmap temp = ebitmap_alloc (1);
#ifdef EBITMAP_DEBUGGING
ebitmap dstcopy = ebitmap_alloc (1);
- ebitmap_copy (dstcopy, dst);
+ bitmap_copy (dstcopy, dst);
#endif
dst->cache = NULL;
- ebitmap_and_compl (temp, b, c);
- changed = ebitmap_ior (dst, a, temp);
+ bitmap_and_compl (temp, b, c);
+ changed = bitmap_ior (dst, a, temp);
#ifdef EBITMAP_DEBUGGING
{
ebitmap_iterator ebi;
unsigned int i;
EXECUTE_IF_SET_IN_EBITMAP (a, 0, i, ebi)
- gcc_assert (ebitmap_bit_p (dst, i));
+ gcc_assert (bitmap_bit_p (dst, i));
EXECUTE_IF_SET_IN_EBITMAP (b, 0, i, ebi)
- if (!ebitmap_bit_p (c, i))
- gcc_assert (ebitmap_bit_p (dst, i));
- gcc_assert (changed == !ebitmap_equal_p (dst, dstcopy));
+ if (!bitmap_bit_p (c, i))
+ gcc_assert (bitmap_bit_p (dst, i));
+ gcc_assert (changed == !bitmap_equal_p (dst, dstcopy));
}
#endif
ebitmap_free (temp);
@@ -996,21 +996,21 @@ ebitmap_ior_and_compl (ebitmap dst, ebitmap a, ebitmap b, ebitmap c)
/* Return true if ebitmap DST is equal to ebitmap SRC. */
bool
-ebitmap_equal_p (ebitmap dst, ebitmap src)
+bitmap_equal_p (ebitmap dst, ebitmap src)
{
unsigned int which = MIN (dst->wordmask->size, src->wordmask->size);
if (dst->numwords != src->numwords)
return false;
- /* sbitmap_equal compares up to the size of the first argument, so
+ /* bitmap_equal_p compares up to the size of the first argument, so
if the two sbitmaps are not equally sized, we need to pass the
smaller one as the first argument, or it will crash. */
if (which == dst->wordmask->size
- && !sbitmap_equal (dst->wordmask, src->wordmask))
+ && !bitmap_equal_p (dst->wordmask, src->wordmask))
return false;
else if (which == src->wordmask->size
- && !sbitmap_equal (src->wordmask, dst->wordmask))
+ && !bitmap_equal_p (src->wordmask, dst->wordmask))
return false;
return memcmp (dst->elts, src->elts,
diff --git a/gcc/ebitmap.h b/gcc/ebitmap.h
index b067ddb892a..a755312a025 100644
--- a/gcc/ebitmap.h
+++ b/gcc/ebitmap.h
@@ -37,34 +37,38 @@ typedef struct ebitmap_def
} *ebitmap;
-#define ebitmap_empty_p(MAP) ((MAP)->numwords == 0)
+inline bool bitmap_empty_p (ebitmap map)
+{
+ return map->numwords == 0;
+}
+
#define ebitmap_free(MAP) (free((MAP)->elts), \
sbitmap_free ((MAP)->wordmask), \
free((MAP)))
-extern void ebitmap_set_bit (ebitmap, unsigned int);
-extern void ebitmap_clear_bit (ebitmap, unsigned int);
-extern bool ebitmap_bit_p (ebitmap, unsigned int);
-extern void dump_ebitmap (FILE *, ebitmap);
-extern void dump_ebitmap_file (FILE *, ebitmap);
-extern void dump_ebitmap_vector (FILE *, const char *, const char *, ebitmap *,
- int);
+extern void bitmap_set_bit (ebitmap, unsigned int);
+extern void bitmap_clear_bit (ebitmap, unsigned int);
+extern bool bitmap_bit_p (ebitmap, unsigned int);
+extern void dump_bitmap (FILE *, ebitmap);
+extern void dump_bitmap_file (FILE *, ebitmap);
+extern void dump_bitmap_vector (FILE *, const char *, const char *, ebitmap *,
+ int);
extern ebitmap ebitmap_alloc (unsigned int);
extern ebitmap *ebitmap_vector_alloc (unsigned int, unsigned int);
-extern void ebitmap_copy (ebitmap, ebitmap);
-extern void ebitmap_and (ebitmap, ebitmap, ebitmap);
-extern void ebitmap_and_into (ebitmap, ebitmap);
-extern bool ebitmap_and_compl (ebitmap, ebitmap, ebitmap);
-extern bool ebitmap_and_compl_into (ebitmap, ebitmap);
-extern bool ebitmap_ior_into (ebitmap, ebitmap);
-extern bool ebitmap_ior (ebitmap, ebitmap, ebitmap);
-extern bool ebitmap_ior_and_compl (ebitmap, ebitmap, ebitmap, ebitmap);
-extern bool ebitmap_ior_and_compl_into (ebitmap, ebitmap, ebitmap);
-extern bool ebitmap_equal_p (ebitmap, ebitmap);
-extern void ebitmap_clear (ebitmap);
-extern int ebitmap_last_set_bit (ebitmap);
-extern void debug_ebitmap (ebitmap);
-extern unsigned long ebitmap_popcount(ebitmap, unsigned long);
+extern void bitmap_copy (ebitmap, ebitmap);
+extern void bitmap_and (ebitmap, ebitmap, ebitmap);
+extern void bitmap_and_into (ebitmap, ebitmap);
+extern bool bitmap_and_compl (ebitmap, ebitmap, ebitmap);
+extern bool bitmap_and_compl_into (ebitmap, ebitmap);
+extern bool bitmap_ior_into (ebitmap, ebitmap);
+extern bool bitmap_ior (ebitmap, ebitmap, ebitmap);
+extern bool bitmap_ior_and_compl (ebitmap, ebitmap, ebitmap, ebitmap);
+extern bool bitmap_ior_and_compl_into (ebitmap, ebitmap, ebitmap);
+extern bool bitmap_equal_p (ebitmap, ebitmap);
+extern void bitmap_clear (ebitmap);
+extern int bitmap_last_set_bit (ebitmap);
+extern void debug_bitmap (ebitmap);
+extern unsigned long bitmap_popcount(ebitmap, unsigned long);
/* The iterator for ebitmap. */
typedef struct {
diff --git a/gcc/except.c b/gcc/except.c
index a4673531995..7e18c19ec14 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -610,7 +610,7 @@ eh_region_outermost (struct function *ifun, eh_region region_a,
gcc_assert (ifun->eh->region_tree);
b_outer = sbitmap_alloc (VEC_length (eh_region, ifun->eh->region_array));
- sbitmap_zero (b_outer);
+ bitmap_clear (b_outer);
do
{
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 6d9b13354cb..5b697a1cd2d 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -69,11 +69,6 @@ static rtx expand_sdiv_pow2 (enum machine_mode, rtx, HOST_WIDE_INT);
/* Test whether a value is zero of a power of two. */
#define EXACT_POWER_OF_2_OR_ZERO_P(x) (((x) & ((x) - 1)) == 0)
-#ifndef SLOW_UNALIGNED_ACCESS
-#define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) STRICT_ALIGNMENT
-#endif
-
-
/* Reduce conditional compilation elsewhere. */
#ifndef HAVE_insv
#define HAVE_insv 0
@@ -409,6 +404,120 @@ lowpart_bit_field_p (unsigned HOST_WIDE_INT bitnum,
return bitnum % BITS_PER_WORD == 0;
}
+/* Try to use an insv pattern to store VALUE into a field of OP0.
+ OP_MODE is the mode of the insertion and BITSIZE and BITNUM are
+ as for store_bit_field. */
+
+static bool
+store_bit_field_using_insv (rtx op0, unsigned HOST_WIDE_INT bitsize,
+ unsigned HOST_WIDE_INT bitnum, rtx value,
+ enum machine_mode op_mode)
+{
+ struct expand_operand ops[4];
+ rtx value1;
+ rtx xop0 = op0;
+ rtx last = get_last_insn ();
+ bool copy_back = false;
+
+ unsigned int unit = GET_MODE_BITSIZE (op_mode);
+ if (bitsize == 0 || bitsize > unit)
+ return false;
+
+ if (MEM_P (xop0))
+ {
+ /* Get a reference to the first byte of the field. */
+ xop0 = adjust_bitfield_address (xop0, byte_mode, bitnum / BITS_PER_UNIT);
+ bitnum %= BITS_PER_UNIT;
+ }
+ else
+ {
+ /* Convert from counting within OP0 to counting in OP_MODE. */
+ if (BYTES_BIG_ENDIAN)
+ bitnum += unit - GET_MODE_BITSIZE (GET_MODE (op0));
+
+ /* If xop0 is a register, we need it in OP_MODE
+ to make it acceptable to the format of insv. */
+ if (GET_CODE (xop0) == SUBREG)
+ /* We can't just change the mode, because this might clobber op0,
+ and we will need the original value of op0 if insv fails. */
+ xop0 = gen_rtx_SUBREG (op_mode, SUBREG_REG (xop0), SUBREG_BYTE (xop0));
+ if (REG_P (xop0) && GET_MODE (xop0) != op_mode)
+ xop0 = gen_lowpart_SUBREG (op_mode, xop0);
+ }
+
+ /* If the destination is a paradoxical subreg such that we need a
+ truncate to the inner mode, perform the insertion on a temporary and
+ truncate the result to the original destination. Note that we can't
+ just truncate the paradoxical subreg as (truncate:N (subreg:W (reg:N
+ X) 0)) is (reg:N X). */
+ if (GET_CODE (xop0) == SUBREG
+ && REG_P (SUBREG_REG (xop0))
+ && !TRULY_NOOP_TRUNCATION_MODES_P (GET_MODE (SUBREG_REG (xop0)),
+ op_mode))
+ {
+ rtx tem = gen_reg_rtx (op_mode);
+ emit_move_insn (tem, xop0);
+ xop0 = tem;
+ copy_back = true;
+ }
+
+ /* If BITS_BIG_ENDIAN is zero on a BYTES_BIG_ENDIAN machine, we count
+ "backwards" from the size of the unit we are inserting into.
+ Otherwise, we count bits from the most significant on a
+ BYTES/BITS_BIG_ENDIAN machine. */
+
+ if (BITS_BIG_ENDIAN != BYTES_BIG_ENDIAN)
+ bitnum = unit - bitsize - bitnum;
+
+ /* Convert VALUE to op_mode (which insv insn wants) in VALUE1. */
+ value1 = value;
+ if (GET_MODE (value) != op_mode)
+ {
+ if (GET_MODE_BITSIZE (GET_MODE (value)) >= bitsize)
+ {
+ /* Optimization: Don't bother really extending VALUE
+ if it has all the bits we will actually use. However,
+ if we must narrow it, be sure we do it correctly. */
+
+ if (GET_MODE_SIZE (GET_MODE (value)) < GET_MODE_SIZE (op_mode))
+ {
+ rtx tmp;
+
+ tmp = simplify_subreg (op_mode, value1, GET_MODE (value), 0);
+ if (! tmp)
+ tmp = simplify_gen_subreg (op_mode,
+ force_reg (GET_MODE (value),
+ value1),
+ GET_MODE (value), 0);
+ value1 = tmp;
+ }
+ else
+ value1 = gen_lowpart (op_mode, value1);
+ }
+ else if (CONST_INT_P (value))
+ value1 = gen_int_mode (INTVAL (value), op_mode);
+ else
+ /* Parse phase is supposed to make VALUE's data type
+ match that of the component reference, which is a type
+ at least as wide as the field; so VALUE should have
+ a mode that corresponds to that type. */
+ gcc_assert (CONSTANT_P (value));
+ }
+
+ create_fixed_operand (&ops[0], xop0);
+ create_integer_operand (&ops[1], bitsize);
+ create_integer_operand (&ops[2], bitnum);
+ create_input_operand (&ops[3], value1, op_mode);
+ if (maybe_expand_insn (CODE_FOR_insv, 4, ops))
+ {
+ if (copy_back)
+ convert_move (op0, xop0, true);
+ return true;
+ }
+ delete_insns_since (last);
+ return false;
+}
+
/* A subroutine of store_bit_field, with the same arguments. Return true
if the operation could be implemented.
@@ -674,131 +783,30 @@ store_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
in a word. */
enum machine_mode op_mode = mode_for_extraction (EP_insv, 3);
- if (HAVE_insv
- && GET_MODE (value) != BLKmode
- && bitsize > 0
- && GET_MODE_BITSIZE (op_mode) >= bitsize
- /* Do not use insv for volatile bitfields when
- -fstrict-volatile-bitfields is in effect. */
- && !(MEM_P (op0) && MEM_VOLATILE_P (op0)
- && flag_strict_volatile_bitfields > 0)
- /* Do not use insv if the bit region is restricted and
- op_mode integer at offset doesn't fit into the
- restricted region. */
- && !(MEM_P (op0) && bitregion_end
- && bitnum - (bitnum % BITS_PER_UNIT) + GET_MODE_BITSIZE (op_mode)
- > bitregion_end + 1))
- {
- struct expand_operand ops[4];
- unsigned HOST_WIDE_INT bitpos = bitnum;
- rtx value1;
- rtx xop0 = op0;
- rtx last = get_last_insn ();
- bool copy_back = false;
-
- unsigned int unit = GET_MODE_BITSIZE (op_mode);
- if (MEM_P (xop0))
- {
- /* Get a reference to the first byte of the field. */
- xop0 = adjust_bitfield_address (xop0, byte_mode,
- bitpos / BITS_PER_UNIT);
- bitpos %= BITS_PER_UNIT;
- }
- else
- {
- /* Convert from counting within OP0 to counting in OP_MODE. */
- if (BYTES_BIG_ENDIAN)
- bitpos += unit - GET_MODE_BITSIZE (GET_MODE (op0));
- }
-
- /* If xop0 is a register, we need it in OP_MODE
- to make it acceptable to the format of insv. */
- if (GET_CODE (xop0) == SUBREG)
- /* We can't just change the mode, because this might clobber op0,
- and we will need the original value of op0 if insv fails. */
- xop0 = gen_rtx_SUBREG (op_mode, SUBREG_REG (xop0), SUBREG_BYTE (xop0));
- if (REG_P (xop0) && GET_MODE (xop0) != op_mode)
- xop0 = gen_lowpart_SUBREG (op_mode, xop0);
-
- /* If the destination is a paradoxical subreg such that we need a
- truncate to the inner mode, perform the insertion on a temporary and
- truncate the result to the original destination. Note that we can't
- just truncate the paradoxical subreg as (truncate:N (subreg:W (reg:N
- X) 0)) is (reg:N X). */
- if (GET_CODE (xop0) == SUBREG
- && REG_P (SUBREG_REG (xop0))
- && (!TRULY_NOOP_TRUNCATION_MODES_P (GET_MODE (SUBREG_REG (xop0)),
- op_mode)))
- {
- rtx tem = gen_reg_rtx (op_mode);
- emit_move_insn (tem, xop0);
- xop0 = tem;
- copy_back = true;
- }
-
- /* If BITS_BIG_ENDIAN is zero on a BYTES_BIG_ENDIAN machine, we count
- "backwards" from the size of the unit we are inserting into.
- Otherwise, we count bits from the most significant on a
- BYTES/BITS_BIG_ENDIAN machine. */
-
- if (BITS_BIG_ENDIAN != BYTES_BIG_ENDIAN)
- bitpos = unit - bitsize - bitpos;
-
- /* Convert VALUE to op_mode (which insv insn wants) in VALUE1. */
- value1 = value;
- if (GET_MODE (value) != op_mode)
- {
- if (GET_MODE_BITSIZE (GET_MODE (value)) >= bitsize)
- {
- /* Optimization: Don't bother really extending VALUE
- if it has all the bits we will actually use. However,
- if we must narrow it, be sure we do it correctly. */
-
- if (GET_MODE_SIZE (GET_MODE (value)) < GET_MODE_SIZE (op_mode))
- {
- rtx tmp;
-
- tmp = simplify_subreg (op_mode, value1, GET_MODE (value), 0);
- if (! tmp)
- tmp = simplify_gen_subreg (op_mode,
- force_reg (GET_MODE (value),
- value1),
- GET_MODE (value), 0);
- value1 = tmp;
- }
- else
- value1 = gen_lowpart (op_mode, value1);
- }
- else if (CONST_INT_P (value))
- value1 = gen_int_mode (INTVAL (value), op_mode);
- else
- /* Parse phase is supposed to make VALUE's data type
- match that of the component reference, which is a type
- at least as wide as the field; so VALUE should have
- a mode that corresponds to that type. */
- gcc_assert (CONSTANT_P (value));
- }
-
- create_fixed_operand (&ops[0], xop0);
- create_integer_operand (&ops[1], bitsize);
- create_integer_operand (&ops[2], bitpos);
- create_input_operand (&ops[3], value1, op_mode);
- if (maybe_expand_insn (CODE_FOR_insv, 4, ops))
- {
- if (copy_back)
- convert_move (op0, xop0, true);
- return true;
- }
- delete_insns_since (last);
- }
+ if (op_mode != MAX_MACHINE_MODE
+ && !MEM_P (op0)
+ && store_bit_field_using_insv (op0, bitsize, bitnum, value, op_mode))
+ return true;
/* If OP0 is a memory, try copying it to a register and seeing if a
cheap register alternative is available. */
- if (HAVE_insv && MEM_P (op0))
+ if (op_mode != MAX_MACHINE_MODE && MEM_P (op0))
{
enum machine_mode bestmode;
unsigned HOST_WIDE_INT maxbits = MAX_FIXED_MODE_SIZE;
+ /* Do not use insv for volatile bitfields when
+ -fstrict-volatile-bitfields is in effect. */
+ if (!(MEM_VOLATILE_P (op0) && flag_strict_volatile_bitfields > 0)
+ /* Do not use insv if the bit region is restricted and
+ an op_mode integer doesn't fit into the restricted region. */
+ && !(bitregion_end
+ && (bitnum - (bitnum % BITS_PER_UNIT)
+ + GET_MODE_BITSIZE (op_mode)
+ > bitregion_end + 1))
+ && store_bit_field_using_insv (op0, bitsize, bitnum, value, op_mode))
+ return true;
+
if (bitregion_end)
maxbits = bitregion_end - bitregion_start + 1;
@@ -809,13 +817,10 @@ store_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
if (GET_MODE (op0) == BLKmode
|| GET_MODE_BITSIZE (GET_MODE (op0)) > maxbits
- || (op_mode != MAX_MACHINE_MODE
- && GET_MODE_SIZE (GET_MODE (op0)) > GET_MODE_SIZE (op_mode)))
+ || GET_MODE_SIZE (GET_MODE (op0)) > GET_MODE_SIZE (op_mode))
bestmode = get_best_mode (bitsize, bitnum,
bitregion_start, bitregion_end,
- MEM_ALIGN (op0),
- (op_mode == MAX_MACHINE_MODE
- ? VOIDmode : op_mode),
+ MEM_ALIGN (op0), op_mode,
MEM_VOLATILE_P (op0));
else
bestmode = GET_MODE (op0);
@@ -1220,6 +1225,91 @@ convert_extracted_bit_field (rtx x, enum machine_mode mode,
return convert_to_mode (tmode, x, unsignedp);
}
+/* Try to use an ext(z)v pattern to extract a field from OP0.
+ Return the extracted value on success, otherwise return null.
+ EXT_MODE is the mode of the extraction and the other arguments
+ are as for extract_bit_field. */
+
+static rtx
+extract_bit_field_using_extv (rtx op0, unsigned HOST_WIDE_INT bitsize,
+ unsigned HOST_WIDE_INT bitnum,
+ int unsignedp, rtx target,
+ enum machine_mode mode, enum machine_mode tmode,
+ enum machine_mode ext_mode)
+{
+ struct expand_operand ops[4];
+ rtx spec_target = target;
+ rtx spec_target_subreg = 0;
+ unsigned unit = GET_MODE_BITSIZE (ext_mode);
+
+ if (bitsize == 0 || unit < bitsize)
+ return NULL_RTX;
+
+ if (MEM_P (op0))
+ {
+ /* Get a reference to the first byte of the field. */
+ op0 = adjust_bitfield_address (op0, byte_mode, bitnum / BITS_PER_UNIT);
+ bitnum %= BITS_PER_UNIT;
+ }
+ else
+ {
+ /* Convert from counting within OP0 to counting in EXT_MODE. */
+ if (BYTES_BIG_ENDIAN)
+ bitnum += unit - GET_MODE_BITSIZE (GET_MODE (op0));
+
+ /* If op0 is a register, we need it in EXT_MODE to make it
+ acceptable to the format of ext(z)v. */
+ if (GET_CODE (op0) == SUBREG && GET_MODE (op0) != ext_mode)
+ return NULL_RTX;
+ if (REG_P (op0) && GET_MODE (op0) != ext_mode)
+ op0 = gen_lowpart_SUBREG (ext_mode, op0);
+ }
+
+ /* If BITS_BIG_ENDIAN is zero on a BYTES_BIG_ENDIAN machine, we count
+ "backwards" from the size of the unit we are extracting from.
+ Otherwise, we count bits from the most significant on a
+ BYTES/BITS_BIG_ENDIAN machine. */
+
+ if (BITS_BIG_ENDIAN != BYTES_BIG_ENDIAN)
+ bitnum = unit - bitsize - bitnum;
+
+ if (target == 0)
+ target = spec_target = gen_reg_rtx (tmode);
+
+ if (GET_MODE (target) != ext_mode)
+ {
+ /* Don't use LHS paradoxical subreg if explicit truncation is needed
+ between the mode of the extraction (word_mode) and the target
+ mode. Instead, create a temporary and use convert_move to set
+ the target. */
+ if (REG_P (target)
+ && TRULY_NOOP_TRUNCATION_MODES_P (GET_MODE (target), ext_mode))
+ {
+ target = gen_lowpart (ext_mode, target);
+ if (GET_MODE_PRECISION (ext_mode)
+ > GET_MODE_PRECISION (GET_MODE (spec_target)))
+ spec_target_subreg = target;
+ }
+ else
+ target = gen_reg_rtx (ext_mode);
+ }
+
+ create_output_operand (&ops[0], target, ext_mode);
+ create_fixed_operand (&ops[1], op0);
+ create_integer_operand (&ops[2], bitsize);
+ create_integer_operand (&ops[3], bitnum);
+ if (maybe_expand_insn (unsignedp ? CODE_FOR_extzv : CODE_FOR_extv, 4, ops))
+ {
+ target = ops[0].value;
+ if (target == spec_target)
+ return target;
+ if (target == spec_target_subreg)
+ return spec_target;
+ return convert_extracted_bit_field (target, mode, tmode, unsignedp);
+ }
+ return NULL_RTX;
+}
+
/* A subroutine of extract_bit_field, with the same arguments.
If FALLBACK_P is true, fall back to extract_fixed_bit_field
if we can find no other means of implementing the operation.
@@ -1507,87 +1597,13 @@ extract_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
If OP0 is a register, it too fits within a word. */
ext_mode = mode_for_extraction (unsignedp ? EP_extzv : EP_extv, 0);
- if (ext_mode != MAX_MACHINE_MODE
- && bitsize > 0
- && GET_MODE_BITSIZE (ext_mode) >= bitsize
- /* Do not use extv/extzv for volatile bitfields when
- -fstrict-volatile-bitfields is in effect. */
- && !(MEM_P (op0) && MEM_VOLATILE_P (op0)
- && flag_strict_volatile_bitfields > 0)
- /* If op0 is a register, we need it in EXT_MODE to make it
- acceptable to the format of ext(z)v. */
- && !(GET_CODE (op0) == SUBREG && GET_MODE (op0) != ext_mode))
+ if (ext_mode != MAX_MACHINE_MODE && !MEM_P (op0))
{
- struct expand_operand ops[4];
- unsigned HOST_WIDE_INT bitpos = bitnum;
- rtx xop0 = op0;
- rtx xtarget = target;
- rtx xspec_target = target;
- rtx xspec_target_subreg = 0;
- unsigned unit = GET_MODE_BITSIZE (ext_mode);
-
- /* If op0 is a register, we need it in EXT_MODE to make it
- acceptable to the format of ext(z)v. */
- if (REG_P (xop0) && GET_MODE (xop0) != ext_mode)
- xop0 = gen_lowpart_SUBREG (ext_mode, xop0);
-
- if (MEM_P (xop0))
- {
- /* Get a reference to the first byte of the field. */
- xop0 = adjust_bitfield_address (xop0, byte_mode,
- bitpos / BITS_PER_UNIT);
- bitpos %= BITS_PER_UNIT;
- }
- else
- {
- /* Convert from counting within OP0 to counting in EXT_MODE. */
- if (BYTES_BIG_ENDIAN)
- bitpos += unit - GET_MODE_BITSIZE (GET_MODE (op0));
- }
-
- /* If BITS_BIG_ENDIAN is zero on a BYTES_BIG_ENDIAN machine, we count
- "backwards" from the size of the unit we are extracting from.
- Otherwise, we count bits from the most significant on a
- BYTES/BITS_BIG_ENDIAN machine. */
-
- if (BITS_BIG_ENDIAN != BYTES_BIG_ENDIAN)
- bitpos = unit - bitsize - bitpos;
-
- if (xtarget == 0)
- xtarget = xspec_target = gen_reg_rtx (tmode);
-
- if (GET_MODE (xtarget) != ext_mode)
- {
- /* Don't use LHS paradoxical subreg if explicit truncation is needed
- between the mode of the extraction (word_mode) and the target
- mode. Instead, create a temporary and use convert_move to set
- the target. */
- if (REG_P (xtarget)
- && TRULY_NOOP_TRUNCATION_MODES_P (GET_MODE (xtarget), ext_mode))
- {
- xtarget = gen_lowpart (ext_mode, xtarget);
- if (GET_MODE_PRECISION (ext_mode)
- > GET_MODE_PRECISION (GET_MODE (xspec_target)))
- xspec_target_subreg = xtarget;
- }
- else
- xtarget = gen_reg_rtx (ext_mode);
- }
-
- create_output_operand (&ops[0], xtarget, ext_mode);
- create_fixed_operand (&ops[1], xop0);
- create_integer_operand (&ops[2], bitsize);
- create_integer_operand (&ops[3], bitpos);
- if (maybe_expand_insn (unsignedp ? CODE_FOR_extzv : CODE_FOR_extv,
- 4, ops))
- {
- xtarget = ops[0].value;
- if (xtarget == xspec_target)
- return xtarget;
- if (xtarget == xspec_target_subreg)
- return xspec_target;
- return convert_extracted_bit_field (xtarget, mode, tmode, unsignedp);
- }
+ rtx result = extract_bit_field_using_extv (op0, bitsize, bitnum,
+ unsignedp, target, mode,
+ tmode, ext_mode);
+ if (result)
+ return result;
}
/* If OP0 is a memory, try copying it to a register and seeing if a
@@ -1596,6 +1612,17 @@ extract_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
{
enum machine_mode bestmode;
+ /* Do not use extv/extzv for volatile bitfields when
+ -fstrict-volatile-bitfields is in effect. */
+ if (!(MEM_VOLATILE_P (op0) && flag_strict_volatile_bitfields > 0))
+ {
+ rtx result = extract_bit_field_using_extv (op0, bitsize, bitnum,
+ unsignedp, target, mode,
+ tmode, ext_mode);
+ if (result)
+ return result;
+ }
+
/* Get the mode to use for inserting into this field. If
OP0 is BLKmode, get the smallest mode consistent with the
alignment. If OP0 is a non-BLKmode object that is no
@@ -1603,12 +1630,9 @@ extract_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
smallest mode containing the field. */
if (GET_MODE (op0) == BLKmode
- || (ext_mode != MAX_MACHINE_MODE
- && GET_MODE_SIZE (GET_MODE (op0)) > GET_MODE_SIZE (ext_mode)))
+ || GET_MODE_SIZE (GET_MODE (op0)) > GET_MODE_SIZE (ext_mode))
bestmode = get_best_mode (bitsize, bitnum, 0, 0, MEM_ALIGN (op0),
- (ext_mode == MAX_MACHINE_MODE
- ? VOIDmode : ext_mode),
- MEM_VOLATILE_P (op0));
+ ext_mode, MEM_VOLATILE_P (op0));
else
bestmode = GET_MODE (op0);
diff --git a/gcc/expr.c b/gcc/expr.c
index 448596c3396..699dae93d3d 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -189,12 +189,6 @@ static void write_complex_part (rtx, rtx, bool);
(move_by_pieces_ninsns (SIZE, ALIGN, STORE_MAX_PIECES + 1) \
< (unsigned int) MOVE_RATIO (optimize_insn_for_speed_p ()))
#endif
-
-/* SLOW_UNALIGNED_ACCESS is nonzero if unaligned accesses are very slow. */
-
-#ifndef SLOW_UNALIGNED_ACCESS
-#define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) STRICT_ALIGNMENT
-#endif
/* This is run to set up which modes can be used
directly in memory and to initialize the block move optab. It is run
@@ -1464,11 +1458,11 @@ emit_block_move_via_loop (rtx x, rtx y, rtx size,
emit_label (top_label);
tmp = convert_modes (x_addr_mode, iter_mode, iter, true);
- x_addr = gen_rtx_PLUS (x_addr_mode, x_addr, tmp);
+ x_addr = simplify_gen_binary (PLUS, x_addr_mode, x_addr, tmp);
if (x_addr_mode != y_addr_mode)
tmp = convert_modes (y_addr_mode, iter_mode, iter, true);
- y_addr = gen_rtx_PLUS (y_addr_mode, y_addr, tmp);
+ y_addr = simplify_gen_binary (PLUS, y_addr_mode, y_addr, tmp);
x = change_address (x, QImode, x_addr);
y = change_address (y, QImode, y_addr);
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index e3e4151ae60..0caca2e5794 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -5959,8 +5959,10 @@ fold_binary_op_with_conditional_arg (location_t loc,
tree test, true_value, false_value;
tree lhs = NULL_TREE;
tree rhs = NULL_TREE;
+ enum tree_code cond_code = COND_EXPR;
- if (TREE_CODE (cond) == COND_EXPR)
+ if (TREE_CODE (cond) == COND_EXPR
+ || TREE_CODE (cond) == VEC_COND_EXPR)
{
test = TREE_OPERAND (cond, 0);
true_value = TREE_OPERAND (cond, 1);
@@ -5981,6 +5983,9 @@ fold_binary_op_with_conditional_arg (location_t loc,
false_value = constant_boolean_node (false, testtype);
}
+ if (TREE_CODE (TREE_TYPE (test)) == VECTOR_TYPE)
+ cond_code = VEC_COND_EXPR;
+
/* This transformation is only worthwhile if we don't have to wrap ARG
in a SAVE_EXPR and the operation can be simplified on at least one
of the branches once its pushed inside the COND_EXPR. */
@@ -6011,7 +6016,7 @@ fold_binary_op_with_conditional_arg (location_t loc,
if (!TREE_CONSTANT (arg) && !TREE_CONSTANT (lhs) && !TREE_CONSTANT (rhs))
return NULL_TREE;
- return fold_build3_loc (loc, COND_EXPR, type, test, lhs, rhs);
+ return fold_build3_loc (loc, cond_code, type, test, lhs, rhs);
}
@@ -9871,7 +9876,9 @@ fold_binary_loc (location_t loc,
tem);
}
- if (TREE_CODE (arg0) == COND_EXPR || COMPARISON_CLASS_P (arg0))
+ if (TREE_CODE (arg0) == COND_EXPR
+ || TREE_CODE (arg0) == VEC_COND_EXPR
+ || COMPARISON_CLASS_P (arg0))
{
tem = fold_binary_op_with_conditional_arg (loc, code, type, op0, op1,
arg0, arg1,
@@ -9880,7 +9887,9 @@ fold_binary_loc (location_t loc,
return tem;
}
- if (TREE_CODE (arg1) == COND_EXPR || COMPARISON_CLASS_P (arg1))
+ if (TREE_CODE (arg1) == COND_EXPR
+ || TREE_CODE (arg1) == VEC_COND_EXPR
+ || COMPARISON_CLASS_P (arg1))
{
tem = fold_binary_op_with_conditional_arg (loc, code, type, op0, op1,
arg1, arg0,
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 25928e18c38..08cac6c9a99 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,26 @@
+2012-10-28 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/54958
+ * gfortran.h (gfc_resolve_iterator_expr,
+ gfc_check_vardef_context): Update prototype.
+ * expr.c (gfc_check_vardef_context): Add own_scope
+ argument and honour it.
+ * resolve.c (gfc_resolve_iterator_expr): Add own_scope
+ argument and honour it.
+ (resolve_deallocate_expr, resolve_allocate_expr,
+ resolve_data_variables, resolve_transfer
+ resolve_lock_unlock, resolve_code): Update calls.
+ * array.c (resolve_array_list): Ditto.
+ * check.c (gfc_check_atomic_def, gfc_check_atomic_ref): Ditto.
+ * interface.c (compare_actual_formal): Ditto.
+ * intrinsic.c (check_arglist): Ditto.
+ * io.c (resolve_tag, gfc_resolve_dt, gfc_resolve_inquire): Ditto.
+
+2012-10-27 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ * trans.c (gfc_allocate_allocatable): Revert accidental
+ commit.
+
2012-10-24 Janus Weil <janus@gcc.gnu.org>
PR fortran/55037
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c
index 066ac1ea902..349151755c0 100644
--- a/gcc/fortran/array.c
+++ b/gcc/fortran/array.c
@@ -1816,7 +1816,7 @@ resolve_array_list (gfc_constructor_base base)
gfc_symbol *iter_var;
locus iter_var_loc;
- if (gfc_resolve_iterator (iter, false) == FAILURE)
+ if (gfc_resolve_iterator (iter, false, true) == FAILURE)
t = FAILURE;
/* Check for bounds referencing the iterator variable. */
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 58c5856795d..a4902385070 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -1046,7 +1046,7 @@ gfc_check_atomic_def (gfc_expr *atom, gfc_expr *value)
if (scalar_check (atom, 0) == FAILURE || scalar_check (value, 1) == FAILURE)
return FAILURE;
- if (gfc_check_vardef_context (atom, false, false, NULL) == FAILURE)
+ if (gfc_check_vardef_context (atom, false, false, false, NULL) == FAILURE)
{
gfc_error ("ATOM argument of the %s intrinsic function at %L shall be "
"definable", gfc_current_intrinsic, &atom->where);
@@ -1063,7 +1063,7 @@ gfc_check_atomic_ref (gfc_expr *value, gfc_expr *atom)
if (scalar_check (value, 0) == FAILURE || scalar_check (atom, 1) == FAILURE)
return FAILURE;
- if (gfc_check_vardef_context (value, false, false, NULL) == FAILURE)
+ if (gfc_check_vardef_context (value, false, false, false, NULL) == FAILURE)
{
gfc_error ("VALUE argument of the %s intrinsic function at %L shall be "
"definable", gfc_current_intrinsic, &value->where);
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 9ac0fc6858f..211f304164c 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -4634,13 +4634,15 @@ gfc_build_intrinsic_call (const char* name, locus where, unsigned numarg, ...)
(F2008, 16.6.7) or pointer association context (F2008, 16.6.8).
This is called from the various places when resolving
the pieces that make up such a context.
+ If own_scope is true (applies to, e.g., ac-implied-do/data-implied-do
+ 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. */
gfc_try
gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
- const char* context)
+ bool own_scope, const char* context)
{
gfc_symbol* sym = NULL;
bool is_pointer;
@@ -4725,7 +4727,7 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
assignment to a pointer component from pointer-assignment to a pointer
component. Note that (normal) assignment to procedure pointers is not
possible. */
- check_intentin = true;
+ check_intentin = !own_scope;
ptr_component = (sym->ts.type == BT_CLASS && CLASS_DATA (sym))
? CLASS_DATA (sym)->attr.class_pointer : sym->attr.pointer;
for (ref = e->ref; ref && check_intentin; ref = ref->next)
@@ -4760,7 +4762,7 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
}
/* PROTECTED and use-associated. */
- if (sym->attr.is_protected && sym->attr.use_assoc && check_intentin)
+ if (sym->attr.is_protected && sym->attr.use_assoc && check_intentin)
{
if (pointer && is_pointer)
{
@@ -4782,7 +4784,7 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
/* Variable not assignable from a PURE procedure but appears in
variable definition context. */
- if (!pointer && gfc_pure (NULL) && gfc_impure_variable (sym))
+ if (!pointer && !own_scope && gfc_pure (NULL) && gfc_impure_variable (sym))
{
if (context)
gfc_error ("Variable '%s' can not appear in a variable definition"
@@ -4856,7 +4858,7 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
}
/* Target must be allowed to appear in a variable definition context. */
- if (gfc_check_vardef_context (assoc->target, pointer, false, NULL)
+ if (gfc_check_vardef_context (assoc->target, pointer, false, false, NULL)
== FAILURE)
{
if (context)
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index b3224aa526a..fabc16a85e0 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -2784,7 +2784,7 @@ bool gfc_has_ultimate_allocatable (gfc_expr *);
bool gfc_has_ultimate_pointer (gfc_expr *);
gfc_expr* gfc_build_intrinsic_call (const char*, locus, unsigned, ...);
-gfc_try gfc_check_vardef_context (gfc_expr*, bool, bool, const char*);
+gfc_try gfc_check_vardef_context (gfc_expr*, bool, bool, bool, const char*);
/* st.c */
@@ -2805,7 +2805,7 @@ 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);
+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 *);
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 2bdabfe806c..d90fc73e8dd 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -2713,10 +2713,10 @@ 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, context)
+ && gfc_check_vardef_context (a->expr, true, false, false, context)
== FAILURE)
return 0;
- if (gfc_check_vardef_context (a->expr, false, false, context)
+ if (gfc_check_vardef_context (a->expr, false, false, false, context)
== FAILURE)
return 0;
}
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c
index 6da131d8553..95a0f500bc2 100644
--- a/gcc/fortran/intrinsic.c
+++ b/gcc/fortran/intrinsic.c
@@ -3646,8 +3646,8 @@ 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, context)
- == FAILURE)
+ if (gfc_check_vardef_context (actual->expr, false, false, false,
+ context) == FAILURE)
return FAILURE;
}
}
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index 447d03f0d50..bd84f1fc48a 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -1534,7 +1534,7 @@ 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, context) == FAILURE)
+ if (gfc_check_vardef_context (e, false, false, false, context) == FAILURE)
return FAILURE;
}
@@ -2867,7 +2867,7 @@ gfc_resolve_dt (gfc_dt *dt, locus *loc)
/* 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,
+ && gfc_check_vardef_context (e, false, false, false,
_("internal unit in WRITE")) == FAILURE)
return FAILURE;
}
@@ -2897,7 +2897,7 @@ gfc_resolve_dt (gfc_dt *dt, locus *loc)
gfc_try t;
e = gfc_get_variable_expr (gfc_find_sym_in_symtree (n->sym));
- t = gfc_check_vardef_context (e, false, false, NULL);
+ t = gfc_check_vardef_context (e, false, false, false, NULL);
gfc_free_expr (e);
if (t == FAILURE)
@@ -4063,7 +4063,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, context) == FAILURE) \
+ if (gfc_check_vardef_context ((expr), false, false, false, \
+ context) == FAILURE) \
return FAILURE; \
}
INQUIRE_RESOLVE_TAG (&tag_iomsg, inquire->iomsg);
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index ac3021ea72c..e39a137fd4f 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -6683,16 +6683,19 @@ gfc_resolve_iterator_expr (gfc_expr *expr, bool real_ok,
/* Resolve the expressions in an iterator structure. If REAL_OK is
- false allow only INTEGER type iterators, otherwise allow REAL types. */
+ false allow only INTEGER type iterators, otherwise allow REAL types.
+ 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
-gfc_resolve_iterator (gfc_iterator *iter, bool real_ok)
+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_check_vardef_context (iter->var, false, false, _("iterator variable"))
+ if (gfc_check_vardef_context (iter->var, false, false, own_scope,
+ _("iterator variable"))
== FAILURE)
return FAILURE;
@@ -6961,10 +6964,10 @@ resolve_deallocate_expr (gfc_expr *e)
}
if (pointer
- && gfc_check_vardef_context (e, true, true, _("DEALLOCATE object"))
+ && gfc_check_vardef_context (e, true, true, false, _("DEALLOCATE object"))
== FAILURE)
return FAILURE;
- if (gfc_check_vardef_context (e, false, true, _("DEALLOCATE object"))
+ if (gfc_check_vardef_context (e, false, true, false, _("DEALLOCATE object"))
== FAILURE)
return FAILURE;
@@ -7307,9 +7310,9 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code)
e2 = remove_last_array_ref (e);
t = SUCCESS;
if (t == SUCCESS && pointer)
- t = gfc_check_vardef_context (e2, true, true, _("ALLOCATE object"));
+ t = gfc_check_vardef_context (e2, true, true, false, _("ALLOCATE object"));
if (t == SUCCESS)
- t = gfc_check_vardef_context (e2, false, true, _("ALLOCATE object"));
+ t = gfc_check_vardef_context (e2, false, true, false, _("ALLOCATE object"));
gfc_free_expr (e2);
if (t == FAILURE)
goto failure;
@@ -7489,7 +7492,7 @@ resolve_allocate_deallocate (gfc_code *code, const char *fcn)
/* Check the stat variable. */
if (stat)
{
- gfc_check_vardef_context (stat, 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
@@ -7532,7 +7535,8 @@ resolve_allocate_deallocate (gfc_code *code, const char *fcn)
gfc_warning ("ERRMSG at %L is useless without a STAT tag",
&errmsg->where);
- gfc_check_vardef_context (errmsg, false, false, _("ERRMSG variable"));
+ gfc_check_vardef_context (errmsg, false, false, false,
+ _("ERRMSG variable"));
if ((errmsg->ts.type != BT_CHARACTER
&& !(errmsg->ref
@@ -8618,7 +8622,7 @@ 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, _("item in READ"))
+ && gfc_check_vardef_context (exp, false, false, false, _("item in READ"))
== FAILURE)
return;
@@ -8739,7 +8743,7 @@ resolve_lock_unlock (gfc_code *code)
&code->expr2->where);
if (code->expr2
- && gfc_check_vardef_context (code->expr2, false, false,
+ && gfc_check_vardef_context (code->expr2, false, false, false,
_("STAT variable")) == FAILURE)
return;
@@ -8751,7 +8755,7 @@ resolve_lock_unlock (gfc_code *code)
&code->expr3->where);
if (code->expr3
- && gfc_check_vardef_context (code->expr3, false, false,
+ && gfc_check_vardef_context (code->expr3, false, false, false,
_("ERRMSG variable")) == FAILURE)
return;
@@ -8763,7 +8767,7 @@ resolve_lock_unlock (gfc_code *code)
"variable", &code->expr4->where);
if (code->expr4
- && gfc_check_vardef_context (code->expr4, false, false,
+ && gfc_check_vardef_context (code->expr4, false, false, false,
_("ACQUIRED_LOCK variable")) == FAILURE)
return;
}
@@ -9700,7 +9704,7 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
if (t == FAILURE)
break;
- if (gfc_check_vardef_context (code->expr1, false, false,
+ if (gfc_check_vardef_context (code->expr1, false, false, false,
_("assignment")) == FAILURE)
break;
@@ -9739,10 +9743,10 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
array ref may be present on the LHS and fool gfc_expr_attr
used in gfc_check_vardef_context. Remove it. */
e = remove_last_array_ref (code->expr1);
- t = gfc_check_vardef_context (e, true, false,
+ t = gfc_check_vardef_context (e, true, false, false,
_("pointer assignment"));
if (t == SUCCESS)
- t = gfc_check_vardef_context (e, false, false,
+ t = gfc_check_vardef_context (e, false, false, false,
_("pointer assignment"));
gfc_free_expr (e);
if (t == FAILURE)
@@ -9804,7 +9808,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) != FAILURE)
+ if (gfc_resolve_iterator (iter, true, false) != FAILURE)
gfc_resolve_do_iterator (code, iter->var->symtree->n.sym);
}
break;
@@ -13563,7 +13567,7 @@ resolve_data_variables (gfc_data_variable *d)
}
else
{
- if (gfc_resolve_iterator (&d->iter, false) == FAILURE)
+ if (gfc_resolve_iterator (&d->iter, false, true) == FAILURE)
return FAILURE;
if (resolve_data_variables (d->list) == FAILURE)
diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c
index 7c2d47250d4..6365213b8f0 100644
--- a/gcc/fortran/trans.c
+++ b/gcc/fortran/trans.c
@@ -814,23 +814,26 @@ gfc_allocate_allocatable (stmtblock_t * block, tree mem, tree size, tree token,
}
-/* Free a given variable. If it is NULL, free takes care of this
- automatically. */
+/* Free a given variable, if it's not NULL. */
tree
gfc_call_free (tree var)
{
stmtblock_t block;
- tree call;
+ tree tmp, cond, call;
if (TREE_TYPE (var) != TREE_TYPE (pvoid_type_node))
var = fold_convert (pvoid_type_node, var);
gfc_start_block (&block);
var = gfc_evaluate_now (var, &block);
+ cond = fold_build2_loc (input_location, NE_EXPR, boolean_type_node, var,
+ build_int_cst (pvoid_type_node, 0));
call = build_call_expr_loc (input_location,
builtin_decl_explicit (BUILT_IN_FREE),
1, var);
- gfc_add_expr_to_block (&block, call);
+ tmp = fold_build3_loc (input_location, COND_EXPR, void_type_node, cond, call,
+ build_empty_stmt (input_location));
+ gfc_add_expr_to_block (&block, tmp);
return gfc_finish_block (&block);
}
@@ -858,10 +861,11 @@ gfc_call_free (tree var)
}
}
- In this front-end version, status doesn't have to be GFC_INTEGER_4. If
- CAN_FAIL is true, no status variable is passed and we are not dealing with
- a coarray, we will simply call free(). This is used for unconditional
- deallocation generated by the front-end at end of each procedure.
+ In this front-end version, status doesn't have to be GFC_INTEGER_4.
+ Moreover, if CAN_FAIL is true, then we will not emit a runtime error,
+ even when no status variable is passed to us (this is used for
+ unconditional deallocation generated by the front-end at end of
+ each procedure).
If a runtime-message is possible, `expr' must point to the original
expression being deallocated for its locus and variable name.
@@ -886,14 +890,6 @@ gfc_deallocate_with_status (tree pointer, tree status, tree errmsg,
STRIP_NOPS (pointer);
}
- else if (can_fail && status == NULL_TREE)
- {
- tmp = build_call_expr_loc (input_location,
- builtin_decl_explicit (BUILT_IN_FREE), 1,
- fold_convert (pvoid_type_node, pointer));
- return tmp;
- }
-
cond = fold_build2_loc (input_location, EQ_EXPR, boolean_type_node, pointer,
build_int_cst (TREE_TYPE (pointer), 0));
diff --git a/gcc/function.c b/gcc/function.c
index 9efbc3ad270..8a3904b7aae 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -6176,8 +6176,7 @@ thread_prologue_and_epilogue_insns (void)
CLEAR_HARD_REG_BIT (prologue_clobbered, STACK_POINTER_REGNUM);
if (frame_pointer_needed)
CLEAR_HARD_REG_BIT (prologue_clobbered, HARD_FRAME_POINTER_REGNUM);
- CLEAR_HARD_REG_SET (live_on_edge);
- reg_set_to_hard_reg_set (&live_on_edge,
+ REG_SET_TO_HARD_REG_SET (live_on_edge,
df_get_live_in (entry_edge->dest));
if (hard_reg_set_intersect_p (live_on_edge, prologue_clobbered))
{
@@ -6490,7 +6489,7 @@ epilogue_done:
/* Look for basic blocks within the prologue insns. */
blocks = sbitmap_alloc (last_basic_block);
- sbitmap_zero (blocks);
+ bitmap_clear (blocks);
SET_BIT (blocks, entry_edge->dest->index);
SET_BIT (blocks, orig_entry_edge->dest->index);
find_many_sub_basic_blocks (blocks);
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 90b551bbc4d..6d0a47ef313 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -658,13 +658,13 @@ compute_local_properties (sbitmap *transp, sbitmap *comp, sbitmap *antloc,
/* Initialize any bitmaps that were passed in. */
if (transp)
{
- sbitmap_vector_ones (transp, last_basic_block);
+ bitmap_vector_ones (transp, last_basic_block);
}
if (comp)
- sbitmap_vector_zero (comp, last_basic_block);
+ bitmap_vector_clear (comp, last_basic_block);
if (antloc)
- sbitmap_vector_zero (antloc, last_basic_block);
+ bitmap_vector_clear (antloc, last_basic_block);
for (i = 0; i < table->size; i++)
{
@@ -1823,7 +1823,7 @@ prune_expressions (bool pre_p)
basic_block bb;
prune_exprs = sbitmap_alloc (expr_hash_table.n_elems);
- sbitmap_zero (prune_exprs);
+ bitmap_clear (prune_exprs);
for (ui = 0; ui < expr_hash_table.size; ui++)
{
for (expr = expr_hash_table.table[ui]; expr; expr = expr->next_same_hash)
@@ -1886,9 +1886,9 @@ prune_expressions (bool pre_p)
if ((e->flags & EDGE_ABNORMAL)
&& (pre_p || CALL_P (BB_END (e->src))))
{
- sbitmap_difference (antloc[bb->index],
+ bitmap_and_compl (antloc[bb->index],
antloc[bb->index], prune_exprs);
- sbitmap_difference (transp[bb->index],
+ bitmap_and_compl (transp[bb->index],
transp[bb->index], prune_exprs);
break;
}
@@ -1924,7 +1924,7 @@ prune_insertions_deletions (int n_elems)
the number of deletions achieved. We will prune these out of the
insertion/deletion sets. */
prune_exprs = sbitmap_alloc (n_elems);
- sbitmap_zero (prune_exprs);
+ bitmap_clear (prune_exprs);
/* Iterate over the edges counting the number of times each expression
needs to be inserted. */
@@ -1976,7 +1976,7 @@ compute_pre_data (void)
compute_local_properties (transp, comp, antloc, &expr_hash_table);
prune_expressions (true);
- sbitmap_vector_zero (ae_kill, last_basic_block);
+ bitmap_vector_clear (ae_kill, last_basic_block);
/* Compute ae_kill for each basic block using:
@@ -1985,8 +1985,8 @@ compute_pre_data (void)
FOR_EACH_BB (bb)
{
- sbitmap_a_or_b (ae_kill[bb->index], transp[bb->index], comp[bb->index]);
- sbitmap_not (ae_kill[bb->index], ae_kill[bb->index]);
+ bitmap_ior (ae_kill[bb->index], transp[bb->index], comp[bb->index]);
+ bitmap_not (ae_kill[bb->index], ae_kill[bb->index]);
}
edge_list = pre_edge_lcm (expr_hash_table.n_elems, transp, comp, antloc,
@@ -2235,7 +2235,7 @@ pre_edge_insert (struct edge_list *edge_list, struct expr **index_map)
set_size = pre_insert_map[0]->size;
num_edges = NUM_EDGES (edge_list);
inserted = sbitmap_vector_alloc (num_edges, expr_hash_table.n_elems);
- sbitmap_vector_zero (inserted, num_edges);
+ bitmap_vector_clear (inserted, num_edges);
for (e = 0; e < num_edges; e++)
{
@@ -2786,8 +2786,8 @@ compute_code_hoist_vbeinout (void)
int changed, passes;
basic_block bb;
- sbitmap_vector_zero (hoist_vbeout, last_basic_block);
- sbitmap_vector_zero (hoist_vbein, last_basic_block);
+ bitmap_vector_clear (hoist_vbeout, last_basic_block);
+ bitmap_vector_clear (hoist_vbein, last_basic_block);
passes = 0;
changed = 1;
@@ -2807,11 +2807,11 @@ compute_code_hoist_vbeinout (void)
/* Include expressions in VBEout that are calculated
in BB and available at its end. */
- sbitmap_a_or_b (hoist_vbeout[bb->index],
+ bitmap_ior (hoist_vbeout[bb->index],
hoist_vbeout[bb->index], comp[bb->index]);
}
- changed |= sbitmap_a_or_b_and_c_cg (hoist_vbein[bb->index],
+ changed |= bitmap_or_and (hoist_vbein[bb->index],
antloc[bb->index],
hoist_vbeout[bb->index],
transp[bb->index]);
@@ -2827,9 +2827,9 @@ compute_code_hoist_vbeinout (void)
FOR_EACH_BB (bb)
{
fprintf (dump_file, "vbein (%d): ", bb->index);
- dump_sbitmap_file (dump_file, hoist_vbein[bb->index]);
+ dump_bitmap_file (dump_file, hoist_vbein[bb->index]);
fprintf (dump_file, "vbeout(%d): ", bb->index);
- dump_sbitmap_file (dump_file, hoist_vbeout[bb->index]);
+ dump_bitmap_file (dump_file, hoist_vbeout[bb->index]);
}
}
}
@@ -2911,7 +2911,7 @@ should_hoist_expr_to_dom (basic_block expr_bb, struct expr *expr,
{
visited_allocated_locally = 1;
visited = sbitmap_alloc (last_basic_block);
- sbitmap_zero (visited);
+ bitmap_clear (visited);
}
FOR_EACH_EDGE (pred, ei, bb->preds)
diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c
index 4b3235edf56..a5a493a0888 100644
--- a/gcc/gimple-pretty-print.c
+++ b/gcc/gimple-pretty-print.c
@@ -2068,9 +2068,6 @@ dump_gimple_bb_header (FILE *outf, basic_block bb, int indent, int flags)
if (flags & TDF_LINENO)
{
gimple_stmt_iterator gsi;
- char *s_indent = (char *) alloca ((size_t) indent + 1);
- memset (s_indent, ' ', (size_t) indent);
- s_indent[indent] = '\0';
if (flags & TDF_COMMENT)
fputs (";; ", outf);
@@ -2079,8 +2076,8 @@ dump_gimple_bb_header (FILE *outf, basic_block bb, int indent, int flags)
if (!is_gimple_debug (gsi_stmt (gsi))
&& get_lineno (gsi_stmt (gsi)) != UNKNOWN_LOCATION)
{
- fprintf (outf, "%sstarting at line %d",
- s_indent, get_lineno (gsi_stmt (gsi)));
+ fprintf (outf, "%*sstarting at line %d",
+ indent, "", get_lineno (gsi_stmt (gsi)));
break;
}
if (bb->discriminator)
@@ -2092,12 +2089,7 @@ dump_gimple_bb_header (FILE *outf, basic_block bb, int indent, int flags)
{
gimple stmt = first_stmt (bb);
if (!stmt || gimple_code (stmt) != GIMPLE_LABEL)
- {
- char *s_indent = (char *) alloca ((size_t) indent - 2 + 1);
- memset (s_indent, ' ', (size_t) indent);
- s_indent[indent] = '\0';
- fprintf (outf, "%s<bb %d>:\n", s_indent, bb->index);
- }
+ fprintf (outf, "%*s<bb %d>:\n", indent, "", bb->index);
}
}
diff --git a/gcc/gimple.h b/gcc/gimple.h
index b34016aaac1..19d45d00e3e 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -2041,6 +2041,31 @@ gimple_assign_single_p (gimple gs)
&& gimple_assign_rhs_class (gs) == GIMPLE_SINGLE_RHS);
}
+/* Return true if GS performs a store to its lhs. */
+
+static inline bool
+gimple_store_p (gimple gs)
+{
+ tree lhs = gimple_get_lhs (gs);
+ return lhs && !is_gimple_reg (lhs);
+}
+
+/* Return true if GS is an assignment that loads from its rhs1. */
+
+static inline bool
+gimple_assign_load_p (gimple gs)
+{
+ tree rhs;
+ if (!gimple_assign_single_p (gs))
+ return false;
+ rhs = gimple_assign_rhs1 (gs);
+ if (TREE_CODE (rhs) == WITH_SIZE_EXPR)
+ return true;
+ rhs = get_base_address (rhs);
+ return (DECL_P (rhs)
+ || TREE_CODE (rhs) == MEM_REF || TREE_CODE (rhs) == TARGET_MEM_REF);
+}
+
/* Return true if S is a type-cast assignment. */
diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog
index 86ef0c9a9b3..73cc732a153 100644
--- a/gcc/go/ChangeLog
+++ b/gcc/go/ChangeLog
@@ -1,3 +1,14 @@
+2012-10-30 Ian Lance Taylor <iant@google.com>
+
+ * lang.opt (-fgo-relative-import-path): New option.
+ * go-lang.c (go_relative_import_path): New static variable.
+ (go_langhook_init): Pass go_relative_import_path to
+ go_create_gogo.
+ (go_langhook_handle_option): Handle -fgo-relative-import-path.
+ * go-c.h (go_create_gogo): Update declaration.
+ * gccgo.texi (Invoking gccgo): Document
+ -fgo-relative-import-path.
+
2012-09-17 Ian Lance Taylor <iant@google.com>
* config-lang.in (target_libs): Add target-libbacktrace.
diff --git a/gcc/go/gccgo.texi b/gcc/go/gccgo.texi
index a5e37e76e80..91930c812f6 100644
--- a/gcc/go/gccgo.texi
+++ b/gcc/go/gccgo.texi
@@ -184,6 +184,12 @@ Using either @option{-fgo-pkgpath} or @option{-fgo-prefix} disables
the special treatment of the @code{main} package and permits that
package to be imported like any other.
+@item -fgo-relative-import-path=@var{dir}
+@cindex @option{-fgo-relative-import-path}
+A relative import is an import that starts with @file{./} or
+@file{../}. If this option is used, @command{gccgo} will use
+@var{dir} as a prefix for the relative import when searching for it.
+
@item -frequire-return-statement
@itemx -fno-require-return-statement
@cindex @option{-frequire-return-statement}
diff --git a/gcc/go/go-c.h b/gcc/go/go-c.h
index a7f7b1fe2f2..8f21b6be76d 100644
--- a/gcc/go/go-c.h
+++ b/gcc/go/go-c.h
@@ -33,7 +33,8 @@ extern int go_enable_optimize (const char*);
extern void go_add_search_path (const char*);
extern void go_create_gogo (int int_type_size, int pointer_size,
- const char* pkgpath, const char *prefix);
+ const char* pkgpath, const char *prefix,
+ const char *relative_import_path);
extern void go_parse_input_files (const char**, unsigned int,
bool only_check_syntax,
diff --git a/gcc/go/go-lang.c b/gcc/go/go-lang.c
index 8aa056fc32f..f5229bbc451 100644
--- a/gcc/go/go-lang.c
+++ b/gcc/go/go-lang.c
@@ -85,6 +85,7 @@ struct GTY(()) language_function
static const char *go_pkgpath = NULL;
static const char *go_prefix = NULL;
+static const char *go_relative_import_path = NULL;
/* Language hooks. */
@@ -101,7 +102,8 @@ go_langhook_init (void)
to, e.g., unsigned_char_type_node) but before calling
build_common_builtin_nodes (because it calls, indirectly,
go_type_for_size). */
- go_create_gogo (INT_TYPE_SIZE, POINTER_SIZE, go_pkgpath, go_prefix);
+ go_create_gogo (INT_TYPE_SIZE, POINTER_SIZE, go_pkgpath, go_prefix,
+ go_relative_import_path);
build_common_builtin_nodes ();
@@ -240,6 +242,10 @@ go_langhook_handle_option (
go_prefix = arg;
break;
+ case OPT_fgo_relative_import_path_:
+ go_relative_import_path = arg;
+ break;
+
default:
/* Just return 1 to indicate that the option is valid. */
break;
diff --git a/gcc/go/gofrontend/go.cc b/gcc/go/gofrontend/go.cc
index 1f2ce8adcde..11692af8095 100644
--- a/gcc/go/gofrontend/go.cc
+++ b/gcc/go/gofrontend/go.cc
@@ -21,7 +21,7 @@ static Gogo* gogo;
GO_EXTERN_C
void
go_create_gogo(int int_type_size, int pointer_size, const char *pkgpath,
- const char *prefix)
+ const char *prefix, const char *relative_import_path)
{
go_assert(::gogo == NULL);
Linemap* linemap = go_get_linemap();
@@ -32,6 +32,9 @@ go_create_gogo(int int_type_size, int pointer_size, const char *pkgpath,
else if (prefix != NULL)
::gogo->set_prefix(prefix);
+ if (relative_import_path != NULL)
+ ::gogo->set_relative_import_path(relative_import_path);
+
// FIXME: This should be in the gcc dependent code.
::gogo->define_builtin_function_trees();
}
diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc
index defa208a582..3455a917f0a 100644
--- a/gcc/go/gofrontend/gogo.cc
+++ b/gcc/go/gofrontend/gogo.cc
@@ -44,6 +44,7 @@ Gogo::Gogo(Backend* backend, Linemap* linemap, int int_type_size,
pkgpath_set_(false),
pkgpath_from_option_(false),
prefix_from_option_(false),
+ relative_import_path_(),
verify_types_(),
interface_types_(),
specific_type_functions_(),
@@ -477,7 +478,8 @@ Gogo::import_package(const std::string& filename,
return;
}
- Import::Stream* stream = Import::open_package(filename, location);
+ Import::Stream* stream = Import::open_package(filename, location,
+ this->relative_import_path_);
if (stream == NULL)
{
error_at(location, "import file %qs not found", filename.c_str());
diff --git a/gcc/go/gofrontend/gogo.h b/gcc/go/gofrontend/gogo.h
index 36709f5b45b..cc707ad2dde 100644
--- a/gcc/go/gofrontend/gogo.h
+++ b/gcc/go/gofrontend/gogo.h
@@ -206,6 +206,17 @@ class Gogo
pkgpath_from_option() const
{ return this->pkgpath_from_option_; }
+ // Return the relative import path as set from the command line.
+ // Returns an empty string if it was not set.
+ const std::string&
+ relative_import_path() const
+ { return this->relative_import_path_; }
+
+ // Set the relative import path from a command line option.
+ void
+ set_relative_import_path(const std::string& s)
+ {this->relative_import_path_ = s; }
+
// Return the priority to use for the package we are compiling.
// This is two more than the largest priority of any package we
// import.
@@ -732,6 +743,9 @@ class Gogo
bool pkgpath_from_option_;
// Whether an explicit prefix was set by -fgo-prefix.
bool prefix_from_option_;
+ // The relative import path, from the -fgo-relative-import-path
+ // option.
+ std::string relative_import_path_;
// A list of types to verify.
std::vector<Type*> verify_types_;
// A list of interface types defined while parsing.
diff --git a/gcc/go/gofrontend/import.cc b/gcc/go/gofrontend/import.cc
index 9febf231897..4913100b5fd 100644
--- a/gcc/go/gofrontend/import.cc
+++ b/gcc/go/gofrontend/import.cc
@@ -41,6 +41,9 @@ go_add_search_path(const char* path)
// When FILENAME is not an absolute path and does not start with ./ or
// ../, we use the search path provided by -I and -L options.
+// When FILENAME does start with ./ or ../, we use
+// RELATIVE_IMPORT_PATH as a prefix.
+
// When FILENAME does not exist, we try modifying FILENAME to find the
// file. We use the first of these which exists:
// * We append ".gox".
@@ -55,19 +58,35 @@ go_add_search_path(const char* path)
// later in the search path.
Import::Stream*
-Import::open_package(const std::string& filename, Location location)
+Import::open_package(const std::string& filename, Location location,
+ const std::string& relative_import_path)
{
bool is_local;
if (IS_ABSOLUTE_PATH(filename))
is_local = true;
- else if (filename[0] == '.' && IS_DIR_SEPARATOR(filename[1]))
+ else if (filename[0] == '.'
+ && (filename[1] == '\0' || IS_DIR_SEPARATOR(filename[1])))
is_local = true;
else if (filename[0] == '.'
&& filename[1] == '.'
- && IS_DIR_SEPARATOR(filename[2]))
+ && (filename[2] == '\0' || IS_DIR_SEPARATOR(filename[2])))
is_local = true;
else
is_local = false;
+
+ std::string fn = filename;
+ if (is_local && !IS_ABSOLUTE_PATH(filename) && !relative_import_path.empty())
+ {
+ if (fn == ".")
+ {
+ // A special case.
+ fn = relative_import_path;
+ }
+ else
+ fn = relative_import_path + '/' + fn;
+ is_local = false;
+ }
+
if (!is_local)
{
for (std::vector<std::string>::const_iterator p = search_path.begin();
@@ -77,14 +96,14 @@ Import::open_package(const std::string& filename, Location location)
std::string indir = *p;
if (!indir.empty() && indir[indir.size() - 1] != '/')
indir += '/';
- indir += filename;
+ indir += fn;
Stream* s = Import::try_package_in_directory(indir, location);
if (s != NULL)
return s;
}
}
- Stream* s = Import::try_package_in_directory(filename, location);
+ Stream* s = Import::try_package_in_directory(fn, location);
if (s != NULL)
return s;
diff --git a/gcc/go/gofrontend/import.h b/gcc/go/gofrontend/import.h
index 67bdcb02d57..c6844cda8a5 100644
--- a/gcc/go/gofrontend/import.h
+++ b/gcc/go/gofrontend/import.h
@@ -124,8 +124,10 @@ class Import
// Find import data. This searches the file system for FILENAME and
// returns a pointer to a Stream object to read the data that it
// exports. LOCATION is the location of the import statement.
+ // RELATIVE_IMPORT_PATH is used as a prefix for a relative import.
static Stream*
- open_package(const std::string& filename, Location location);
+ open_package(const std::string& filename, Location location,
+ const std::string& relative_import_path);
// Constructor.
Import(Stream*, Location);
diff --git a/gcc/go/lang.opt b/gcc/go/lang.opt
index eb9ed9a63a0..22197a71e3d 100644
--- a/gcc/go/lang.opt
+++ b/gcc/go/lang.opt
@@ -61,6 +61,10 @@ fgo-prefix=
Go Joined RejectNegative
-fgo-prefix=<string> Set package-specific prefix for exported Go names
+fgo-relative-import-path=
+Go Joined RejectNegative
+-fgo-relative-import-path=<path> Treat a relative import as relative to path
+
frequire-return-statement
Go Var(go_require_return_statement) Init(1) Warning
Functions which return values must end with return statements
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 3a7b9101db9..228be811a75 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -405,7 +405,7 @@ build_scop_bbs (scop_p scop)
sbitmap visited = sbitmap_alloc (last_basic_block);
sese region = SCOP_REGION (scop);
- sbitmap_zero (visited);
+ bitmap_clear (visited);
build_scop_bbs_1 (scop, visited, SESE_ENTRY_BB (region));
sbitmap_free (visited);
}
diff --git a/gcc/hash-table.h b/gcc/hash-table.h
index 3aa66a797cf..a80100f1938 100644
--- a/gcc/hash-table.h
+++ b/gcc/hash-table.h
@@ -21,7 +21,142 @@ along with GCC; see the file COPYING3. If not see
/* This file implements a typed hash table.
- The implementation borrows from libiberty's hashtab. */
+ The implementation borrows from libiberty's htab_t in hashtab.h.
+
+
+ INTRODUCTION TO TYPES
+
+ Users of the hash table generally need to be aware of three types.
+
+ 1. The type being placed into the hash table. This type is called
+ the value type.
+
+ 2. The type used to describe how to handle the value type within
+ the hash table. This descriptor type provides the hash table with
+ several things.
+
+ - A typedef named 'value_type' to the value type (from above).
+
+ - A static member function named 'hash' that takes a value_type
+ pointer and returns a hashval_t value.
+
+ - A typedef named 'compare_type' that is used to test when an value
+ is found. This type is the comparison type. Usually, it will be the
+ same as value_type. If it is not the same type, you must generally
+ explicitly compute hash values and pass them to the hash table.
+
+ - A static member function named 'equal' that takes a value_type
+ pointer and a compare_type pointer, and returns a bool.
+
+ - A static function named 'remove' that takes an value_type pointer
+ and frees the memory allocated by it. This function is used when
+ individual elements of the table need to be disposed of (e.g.,
+ when deleting a hash table, removing elements from the table, etc).
+
+ 3. The type of the hash table itself. (More later.)
+
+ In very special circumstances, users may need to know about a fourth type.
+
+ 4. The template type used to describe how hash table memory
+ is allocated. This type is called the allocator type. It is
+ parameterized on the value type. It provides four functions.
+
+ - A static member function named 'control_alloc'. This function
+ allocates the control data blocks for the table.
+
+ - A static member function named 'control_free'. This function
+ frees the control data blocks for the table.
+
+ - A static member function named 'data_alloc'. This function
+ allocates the data elements in the table.
+
+ - A static member function named 'data_free'. This function
+ deallocates the data elements in the table.
+
+ Hash table are instantiated with two type arguments.
+
+ * The descriptor type, (2) above.
+
+ * The allocator type, (4) above. In general, you will not need to
+ provide your own allocator type. By default, hash tables will use
+ the class template xcallocator, which uses malloc/free for allocation.
+
+
+ DEFINING A DESCRIPTOR TYPE
+
+ The first task in using the hash table is to describe the element type.
+ We compose this into a few steps.
+
+ 1. Decide on a removal policy for values stored in the table.
+ This header provides class templates for the two most common
+ policies.
+
+ * typed_free_remove implements the static 'remove' member function
+ by calling free().
+
+ * typed_noop_remove implements the static 'remove' member function
+ by doing nothing.
+
+ You can use these policies by simply deriving the descriptor type
+ from one of those class template, with the appropriate argument.
+
+ Otherwise, you need to write the static 'remove' member function
+ in the descriptor class.
+
+ 2. Choose a hash function. Write the static 'hash' member function.
+
+ 3. Choose an equality testing function. In most cases, its two
+ arguments will be value_type pointers. If not, the first argument must
+ be a value_type pointer, and the second argument a compare_type pointer.
+
+
+ AN EXAMPLE DESCRIPTOR TYPE
+
+ Suppose you want to put some_type into the hash table. You could define
+ the descriptor type as follows.
+
+ struct some_type_hasher : typed_noop_remove <some_type>
+ // Deriving from typed_noop_remove means that we get a 'remove' that does
+ // nothing. This choice is good for raw values.
+ {
+ typedef some_type value_type;
+ typedef some_type compare_type;
+ static inline hashval_t hash (const value_type *);
+ static inline bool equal (const value_type *, const compare_type *);
+ };
+
+ inline hashval_t
+ some_type_hasher::hash (const value_type *e)
+ { ... compute and return a hash value for E ... }
+
+ inline bool
+ some_type_hasher::equal (const value_type *p1, const compare_type *p2)
+ { ... compare P1 vs P2. Return true if they are the 'same' ... }
+
+
+ AN EXAMPLE HASH_TABLE DECLARATION
+
+ To instantiate a hash table for some_type:
+
+ hash_table <some_type_hasher> some_type_hash_table;
+
+ There is no need to mention some_type directly, as the hash table will
+ obtain it using some_type_hasher::value_type.
+
+ You can then used any of the functions in hash_table's public interface.
+ See hash_table for details. The interface is very similar to libiberty's
+ htab_t.
+
+
+ EASY DESCRIPTORS FOR POINTERS
+
+ The class template pointer_hash provides everything you need to hash
+ pointers (as opposed to what they point to). So, to instantiate a hash
+ table over pointers to whatever_type,
+
+ hash_table <pointer_hash <whatever_type>> whatever_type_hash_table;
+
+*/
#ifndef TYPED_HASHTAB_H
@@ -53,7 +188,7 @@ xcallocator <Type>::control_alloc (size_t count)
}
-/* Allocate memory for COUNT data blocks. */
+/* Allocate memory for COUNT data blocks. */
template <typename Type>
inline Type *
@@ -71,7 +206,7 @@ xcallocator <Type>::control_free (Type *memory)
{
return ::free (memory);
}
-
+
/* Free memory for data blocks. */
@@ -83,50 +218,71 @@ xcallocator <Type>::data_free (Type *memory)
}
-/* Remove method dispatching to free. */
+/* Helpful type for removing with free. */
-template <typename Element>
+template <typename Type>
struct typed_free_remove
{
- static inline void remove (Element *p) { free (p); }
+ static inline void remove (Type *p);
};
-/* No-op remove method. */
-template <typename Element>
+/* Remove with free. */
+
+template <typename Type>
+inline void
+typed_free_remove <Type>::remove (Type *p)
+{
+ free (p);
+}
+
+
+/* Helpful type for a no-op remove. */
+
+template <typename Type>
struct typed_noop_remove
{
- static inline void remove (Element *) {}
+ static inline void remove (Type *p);
};
+/* Remove doing nothing. */
+
+template <typename Type>
+inline void
+typed_noop_remove <Type>::remove (Type *p ATTRIBUTE_UNUSED)
+{
+}
+
+
/* Pointer hash with a no-op remove method. */
-template <typename Element>
-struct pointer_hash : typed_noop_remove <Element>
+template <typename Type>
+struct pointer_hash : typed_noop_remove <Type>
{
- typedef Element T;
+ typedef Type value_type;
+ typedef Type compare_type;
static inline hashval_t
- hash (const T *);
+ hash (const value_type *);
static inline int
- equal (const T *existing, const T * candidate);
+ equal (const value_type *existing, const compare_type *candidate);
};
-template <typename Element>
+template <typename Type>
inline hashval_t
-pointer_hash<Element>::hash (const T *candidate)
+pointer_hash <Type>::hash (const value_type *candidate)
{
/* This is a really poor hash function, but it is what the current code uses,
so I am reusing it to avoid an additional axis in testing. */
return (hashval_t) ((intptr_t)candidate >> 3);
}
-template <typename Element>
+template <typename Type>
inline int
-pointer_hash<Element>::equal (const T *existing,
- const T *candidate)
+pointer_hash <Type>::equal (const value_type *existing,
+ const compare_type *candidate)
{
return existing == candidate;
}
@@ -185,37 +341,38 @@ struct hash_table_control
/* User-facing hash table type.
- The table stores elements of type Element.
+ The table stores elements of type Descriptor::value_type.
- It hashes elements with the hash function.
+ It hashes values with the hash member function.
The table currently works with relatively weak hash functions.
- Use typed_pointer_hash <Element> when hashing pointers instead of objects.
+ Use typed_pointer_hash <Value> when hashing pointers instead of objects.
- It compares elements with the equal function.
+ It compares elements with the equal member function.
Two elements with the same hash may not be equal.
- Use typed_pointer_equal <Element> when hashing pointers instead of objects.
+ Use typed_pointer_equal <Value> when hashing pointers instead of objects.
- It removes elements with the remove function.
+ It removes elements with the remove member function.
This feature is useful for freeing memory.
- Use typed_null_remove <Element> when not freeing objects.
- Use typed_free_remove <Element> when doing a simple object free.
+ Derive from typed_null_remove <Value> when not freeing objects.
+ Derive from typed_free_remove <Value> when doing a simple object free.
- Use the Allocator template to allocate and free memory.
+ Specify the template Allocator to allocate and free memory.
The default is xcallocator.
*/
-template <typename Descr,
+template <typename Descriptor,
template <typename Type> class Allocator = xcallocator>
class hash_table
{
public:
- typedef typename Descr::T T;
+ typedef typename Descriptor::value_type value_type;
+ typedef typename Descriptor::compare_type compare_type;
private:
- hash_table_control <T> *htab;
+ hash_table_control <value_type> *htab;
- T **find_empty_slot_for_expand (hashval_t hash);
+ value_type **find_empty_slot_for_expand (hashval_t hash);
void expand ();
public:
@@ -223,35 +380,36 @@ public:
void create (size_t initial_slots);
bool is_created ();
void dispose ();
- T *find (const T *comparable);
- T *find_with_hash (const T *comparable, hashval_t hash);
- T **find_slot (const T *comparable, enum insert_option insert);
- T **find_slot_with_hash (const T *comparable, hashval_t hash,
- enum insert_option insert);
+ value_type *find (const compare_type *comparable);
+ value_type *find_with_hash (const compare_type *comparable, hashval_t hash);
+ value_type **find_slot (const compare_type *comparable,
+ enum insert_option insert);
+ value_type **find_slot_with_hash (const compare_type *comparable,
+ hashval_t hash, enum insert_option insert);
void empty ();
- void clear_slot (T **slot);
- void remove_elt (const T *comparable);
- void remove_elt_with_hash (const T *comparable, hashval_t hash);
+ void clear_slot (value_type **slot);
+ void remove_elt (const compare_type *comparable);
+ void remove_elt_with_hash (const compare_type *comparable, hashval_t hash);
size_t size();
size_t elements();
double collisions();
template <typename Argument,
- int (*Callback) (T **slot, Argument argument)>
+ int (*Callback) (value_type **slot, Argument argument)>
void traverse_noresize (Argument argument);
template <typename Argument,
- int (*Callback) (T **slot, Argument argument)>
+ int (*Callback) (value_type **slot, Argument argument)>
void traverse (Argument argument);
};
/* Construct the hash table. The only useful operation next is create. */
-template <typename Descr,
+template <typename Descriptor,
template <typename Type> class Allocator>
inline
-hash_table <Descr, Allocator>::hash_table ()
+hash_table <Descriptor, Allocator>::hash_table ()
: htab (NULL)
{
}
@@ -259,10 +417,10 @@ hash_table <Descr, Allocator>::hash_table ()
/* See if the table has been created, as opposed to constructed. */
-template <typename Descr,
+template <typename Descriptor,
template <typename Type> class Allocator>
inline bool
-hash_table <Descr, Allocator>::is_created ()
+hash_table <Descriptor, Allocator>::is_created ()
{
return htab != NULL;
}
@@ -270,45 +428,44 @@ hash_table <Descr, Allocator>::is_created ()
/* Like find_with_hash, but compute the hash value from the element. */
-template <typename Descr,
+template <typename Descriptor,
template <typename Type> class Allocator>
-inline typename Descr::T *
-hash_table <Descr, Allocator>::find (const T *comparable)
+inline typename Descriptor::value_type *
+hash_table <Descriptor, Allocator>::find (const compare_type *comparable)
{
- return find_with_hash (comparable, Descr::hash (comparable));
+ return find_with_hash (comparable, Descriptor::hash (comparable));
}
/* Like find_slot_with_hash, but compute the hash value from the element. */
-template <typename Descr,
+template <typename Descriptor,
template <typename Type> class Allocator>
-inline typename Descr::T **
-hash_table <Descr, Allocator>
-::find_slot (const T *comparable, enum insert_option insert)
+inline typename Descriptor::value_type **
+hash_table <Descriptor, Allocator>
+::find_slot (const compare_type *comparable, enum insert_option insert)
{
- return find_slot_with_hash (comparable, Descr::hash (comparable), insert);
+ return find_slot_with_hash (comparable, Descriptor::hash (comparable), insert);
}
/* Like remove_elt_with_hash, but compute the hash value from the element. */
-template <typename Descr,
+template <typename Descriptor,
template <typename Type> class Allocator>
inline void
-hash_table <Descr, Allocator>
-::remove_elt (const T *comparable)
+hash_table <Descriptor, Allocator>::remove_elt (const compare_type *comparable)
{
- remove_elt_with_hash (comparable, Descr::hash (comparable));
+ remove_elt_with_hash (comparable, Descriptor::hash (comparable));
}
/* Return the current size of this hash table. */
-template <typename Descr,
+template <typename Descriptor,
template <typename Type> class Allocator>
inline size_t
-hash_table <Descr, Allocator>::size()
+hash_table <Descriptor, Allocator>::size()
{
return htab->size;
}
@@ -316,10 +473,10 @@ hash_table <Descr, Allocator>::size()
/* Return the current number of elements in this hash table. */
-template <typename Descr,
+template <typename Descriptor,
template <typename Type> class Allocator>
inline size_t
-hash_table <Descr, Allocator>::elements()
+hash_table <Descriptor, Allocator>::elements()
{
return htab->n_elements - htab->n_deleted;
}
@@ -328,10 +485,10 @@ hash_table <Descr, Allocator>::elements()
/* Return the fraction of fixed collisions during all work with given
hash table. */
-template <typename Descr,
+template <typename Descriptor,
template <typename Type> class Allocator>
inline double
-hash_table <Descr, Allocator>::collisions()
+hash_table <Descriptor, Allocator>::collisions()
{
if (htab->searches == 0)
return 0.0;
@@ -342,19 +499,19 @@ hash_table <Descr, Allocator>::collisions()
/* Create a hash table with at least the given number of INITIAL_SLOTS. */
-template <typename Descr,
+template <typename Descriptor,
template <typename Type> class Allocator>
void
-hash_table <Descr, Allocator>::create (size_t size)
+hash_table <Descriptor, Allocator>::create (size_t size)
{
unsigned int size_prime_index;
size_prime_index = hash_table_higher_prime_index (size);
size = prime_tab[size_prime_index].prime;
- htab = Allocator <hash_table_control <T> > ::control_alloc (1);
+ htab = Allocator <hash_table_control <value_type> > ::control_alloc (1);
gcc_assert (htab != NULL);
- htab->entries = Allocator <T*> ::data_alloc (size);
+ htab->entries = Allocator <value_type*> ::data_alloc (size);
gcc_assert (htab->entries != NULL);
htab->size = size;
htab->size_prime_index = size_prime_index;
@@ -364,20 +521,20 @@ hash_table <Descr, Allocator>::create (size_t size)
/* Dispose of a hash table. Free all memory and return this hash table to
the non-created state. Naturally the hash table must already exist. */
-template <typename Descr,
+template <typename Descriptor,
template <typename Type> class Allocator>
void
-hash_table <Descr, Allocator>::dispose ()
+hash_table <Descriptor, Allocator>::dispose ()
{
size_t size = htab->size;
- T **entries = htab->entries;
+ value_type **entries = htab->entries;
for (int i = size - 1; i >= 0; i--)
if (entries[i] != HTAB_EMPTY_ENTRY && entries[i] != HTAB_DELETED_ENTRY)
- Descr::remove (entries[i]);
+ Descriptor::remove (entries[i]);
- Allocator <T *> ::data_free (entries);
- Allocator <hash_table_control <T> > ::control_free (htab);
+ Allocator <value_type *> ::data_free (entries);
+ Allocator <hash_table_control <value_type> > ::control_free (htab);
htab = NULL;
}
@@ -389,15 +546,14 @@ hash_table <Descr, Allocator>::dispose ()
This function also assumes there are no deleted entries in the table.
HASH is the hash value for the element to be inserted. */
-template <typename Descr,
+template <typename Descriptor,
template <typename Type> class Allocator>
-typename Descr::T **
-hash_table <Descr, Allocator>
-::find_empty_slot_for_expand (hashval_t hash)
+typename Descriptor::value_type **
+hash_table <Descriptor, Allocator>::find_empty_slot_for_expand (hashval_t hash)
{
hashval_t index = hash_table_mod1 (hash, htab->size_prime_index);
size_t size = htab->size;
- T **slot = htab->entries + index;
+ value_type **slot = htab->entries + index;
hashval_t hash2;
if (*slot == HTAB_EMPTY_ENTRY)
@@ -428,15 +584,15 @@ hash_table <Descr, Allocator>
table entries is changed. If memory allocation fails, this function
will abort. */
-template <typename Descr,
+template <typename Descriptor,
template <typename Type> class Allocator>
void
-hash_table <Descr, Allocator>::expand ()
+hash_table <Descriptor, Allocator>::expand ()
{
- T **oentries;
- T **olimit;
- T **p;
- T **nentries;
+ value_type **oentries;
+ value_type **olimit;
+ value_type **p;
+ value_type **nentries;
size_t nsize, osize, elts;
unsigned int oindex, nindex;
@@ -459,7 +615,7 @@ hash_table <Descr, Allocator>::expand ()
nsize = osize;
}
- nentries = Allocator <T *> ::data_alloc (nsize);
+ nentries = Allocator <value_type *> ::data_alloc (nsize);
gcc_assert (nentries != NULL);
htab->entries = nentries;
htab->size = nsize;
@@ -470,11 +626,11 @@ hash_table <Descr, Allocator>::expand ()
p = oentries;
do
{
- T *x = *p;
+ value_type *x = *p;
if (x != HTAB_EMPTY_ENTRY && x != HTAB_DELETED_ENTRY)
{
- T **q = find_empty_slot_for_expand (Descr::hash (x));
+ value_type **q = find_empty_slot_for_expand (Descriptor::hash (x));
*q = x;
}
@@ -483,7 +639,7 @@ hash_table <Descr, Allocator>::expand ()
}
while (p < olimit);
- Allocator <T *> ::data_free (oentries);
+ Allocator <value_type *> ::data_free (oentries);
}
@@ -491,15 +647,15 @@ hash_table <Descr, Allocator>::expand ()
COMPARABLE element starting with the given HASH value. It cannot
be used to insert or delete an element. */
-template <typename Descr,
+template <typename Descriptor,
template <typename Type> class Allocator>
-typename Descr::T *
-hash_table <Descr, Allocator>
-::find_with_hash (const T *comparable, hashval_t hash)
+typename Descriptor::value_type *
+hash_table <Descriptor, Allocator>
+::find_with_hash (const compare_type *comparable, hashval_t hash)
{
hashval_t index, hash2;
size_t size;
- T *entry;
+ value_type *entry;
htab->searches++;
size = htab->size;
@@ -507,7 +663,7 @@ hash_table <Descr, Allocator>
entry = htab->entries[index];
if (entry == HTAB_EMPTY_ENTRY
- || (entry != HTAB_DELETED_ENTRY && Descr::equal (entry, comparable)))
+ || (entry != HTAB_DELETED_ENTRY && Descriptor::equal (entry, comparable)))
return entry;
hash2 = hash_table_mod2 (hash, htab->size_prime_index);
@@ -520,7 +676,8 @@ hash_table <Descr, Allocator>
entry = htab->entries[index];
if (entry == HTAB_EMPTY_ENTRY
- || (entry != HTAB_DELETED_ENTRY && Descr::equal (entry, comparable)))
+ || (entry != HTAB_DELETED_ENTRY
+ && Descriptor::equal (entry, comparable)))
return entry;
}
}
@@ -534,17 +691,17 @@ hash_table <Descr, Allocator>
write the value you want into the returned slot. When inserting an
entry, NULL may be returned if memory allocation fails. */
-template <typename Descr,
+template <typename Descriptor,
template <typename Type> class Allocator>
-typename Descr::T **
-hash_table <Descr, Allocator>
-::find_slot_with_hash (const T *comparable, hashval_t hash,
+typename Descriptor::value_type **
+hash_table <Descriptor, Allocator>
+::find_slot_with_hash (const compare_type *comparable, hashval_t hash,
enum insert_option insert)
{
- T **first_deleted_slot;
+ value_type **first_deleted_slot;
hashval_t index, hash2;
size_t size;
- T *entry;
+ value_type *entry;
size = htab->size;
if (insert == INSERT && size * 3 <= htab->n_elements * 4)
@@ -563,9 +720,9 @@ hash_table <Descr, Allocator>
goto empty_entry;
else if (entry == HTAB_DELETED_ENTRY)
first_deleted_slot = &htab->entries[index];
- else if (Descr::equal (entry, comparable))
+ else if (Descriptor::equal (entry, comparable))
return &htab->entries[index];
-
+
hash2 = hash_table_mod2 (hash, htab->size_prime_index);
for (;;)
{
@@ -573,7 +730,7 @@ hash_table <Descr, Allocator>
index += hash2;
if (index >= size)
index -= size;
-
+
entry = htab->entries[index];
if (entry == HTAB_EMPTY_ENTRY)
goto empty_entry;
@@ -582,7 +739,7 @@ hash_table <Descr, Allocator>
if (!first_deleted_slot)
first_deleted_slot = &htab->entries[index];
}
- else if (Descr::equal (entry, comparable))
+ else if (Descriptor::equal (entry, comparable))
return &htab->entries[index];
}
@@ -593,7 +750,7 @@ hash_table <Descr, Allocator>
if (first_deleted_slot)
{
htab->n_deleted--;
- *first_deleted_slot = static_cast <T *> (HTAB_EMPTY_ENTRY);
+ *first_deleted_slot = static_cast <value_type *> (HTAB_EMPTY_ENTRY);
return first_deleted_slot;
}
@@ -604,18 +761,18 @@ hash_table <Descr, Allocator>
/* This function clears all entries in the given hash table. */
-template <typename Descr,
+template <typename Descriptor,
template <typename Type> class Allocator>
void
-hash_table <Descr, Allocator>::empty ()
+hash_table <Descriptor, Allocator>::empty ()
{
size_t size = htab->size;
- T **entries = htab->entries;
+ value_type **entries = htab->entries;
int i;
for (i = size - 1; i >= 0; i--)
if (entries[i] != HTAB_EMPTY_ENTRY && entries[i] != HTAB_DELETED_ENTRY)
- Descr::remove (entries[i]);
+ Descriptor::remove (entries[i]);
/* Instead of clearing megabyte, downsize the table. */
if (size > 1024*1024 / sizeof (PTR))
@@ -623,13 +780,13 @@ hash_table <Descr, Allocator>::empty ()
int nindex = hash_table_higher_prime_index (1024 / sizeof (PTR));
int nsize = prime_tab[nindex].prime;
- Allocator <T *> ::data_free (htab->entries);
- htab->entries = Allocator <T *> ::data_alloc (nsize);
+ Allocator <value_type *> ::data_free (htab->entries);
+ htab->entries = Allocator <value_type *> ::data_alloc (nsize);
htab->size = nsize;
htab->size_prime_index = nindex;
}
else
- memset (entries, 0, size * sizeof (T *));
+ memset (entries, 0, size * sizeof (value_type *));
htab->n_deleted = 0;
htab->n_elements = 0;
}
@@ -639,19 +796,18 @@ hash_table <Descr, Allocator>::empty ()
useful when you've already done the lookup and don't want to do it
again. */
-template <typename Descr,
+template <typename Descriptor,
template <typename Type> class Allocator>
void
-hash_table <Descr, Allocator>
-::clear_slot (T **slot)
+hash_table <Descriptor, Allocator>::clear_slot (value_type **slot)
{
if (slot < htab->entries || slot >= htab->entries + htab->size
|| *slot == HTAB_EMPTY_ENTRY || *slot == HTAB_DELETED_ENTRY)
abort ();
- Descr::remove (*slot);
+ Descriptor::remove (*slot);
- *slot = static_cast <T *> (HTAB_DELETED_ENTRY);
+ *slot = static_cast <value_type *> (HTAB_DELETED_ENTRY);
htab->n_deleted++;
}
@@ -660,21 +816,21 @@ hash_table <Descr, Allocator>
from hash table starting with the given HASH. If there is no
matching element in the hash table, this function does nothing. */
-template <typename Descr,
+template <typename Descriptor,
template <typename Type> class Allocator>
void
-hash_table <Descr, Allocator>
-::remove_elt_with_hash (const T *comparable, hashval_t hash)
+hash_table <Descriptor, Allocator>
+::remove_elt_with_hash (const compare_type *comparable, hashval_t hash)
{
- T **slot;
+ value_type **slot;
slot = find_slot_with_hash (comparable, hash, NO_INSERT);
if (*slot == HTAB_EMPTY_ENTRY)
return;
- Descr::remove (*slot);
+ Descriptor::remove (*slot);
- *slot = static_cast <T *> (HTAB_DELETED_ENTRY);
+ *slot = static_cast <value_type *> (HTAB_DELETED_ENTRY);
htab->n_deleted++;
}
@@ -683,23 +839,22 @@ hash_table <Descr, Allocator>
each live entry. If CALLBACK returns false, the iteration stops.
ARGUMENT is passed as CALLBACK's second argument. */
-template <typename Descr,
+template <typename Descriptor,
template <typename Type> class Allocator>
template <typename Argument,
- int (*Callback) (typename Descr::T **slot, Argument argument)>
+ int (*Callback) (typename Descriptor::value_type **slot, Argument argument)>
void
-hash_table <Descr, Allocator>
-::traverse_noresize (Argument argument)
+hash_table <Descriptor, Allocator>::traverse_noresize (Argument argument)
{
- T **slot;
- T **limit;
+ value_type **slot;
+ value_type **limit;
slot = htab->entries;
limit = slot + htab->size;
do
{
- T *x = *slot;
+ value_type *x = *slot;
if (x != HTAB_EMPTY_ENTRY && x != HTAB_DELETED_ENTRY)
if (! Callback (slot, argument))
@@ -712,13 +867,13 @@ hash_table <Descr, Allocator>
/* Like traverse_noresize, but does resize the table when it is too empty
to improve effectivity of subsequent calls. */
-template <typename Descr,
+template <typename Descriptor,
template <typename Type> class Allocator>
template <typename Argument,
- int (*Callback) (typename Descr::T **slot, Argument argument)>
+ int (*Callback) (typename Descriptor::value_type **slot,
+ Argument argument)>
void
-hash_table <Descr, Allocator>
-::traverse (Argument argument)
+hash_table <Descriptor, Allocator>::traverse (Argument argument)
{
size_t size = htab->size;
if (elements () * 8 < size && size > 32)
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index ef9569e8009..8f8053fa480 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -1688,6 +1688,7 @@ ipcp_discover_new_direct_edges (struct cgraph_node *node,
VEC (tree, heap) *known_vals)
{
struct cgraph_edge *ie, *next_ie;
+ bool found = false;
for (ie = node->indirect_calls; ie; ie = next_ie)
{
@@ -1696,8 +1697,14 @@ ipcp_discover_new_direct_edges (struct cgraph_node *node,
next_ie = ie->next_callee;
target = ipa_get_indirect_edge_target (ie, known_vals, NULL, NULL);
if (target)
- ipa_make_edge_direct_to_target (ie, target);
+ {
+ ipa_make_edge_direct_to_target (ie, target);
+ found = true;
+ }
}
+ /* Turning calls to direct calls will improve overall summary. */
+ if (found)
+ inline_update_overall_summary (node);
}
/* Vector of pointers which for linked lists of clones of an original crgaph
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c
index 6cea94225b0..8baaced2bd9 100644
--- a/gcc/ipa-inline-analysis.c
+++ b/gcc/ipa-inline-analysis.c
@@ -639,6 +639,16 @@ dump_inline_hints (FILE *f, inline_hints hints)
hints &= ~INLINE_HINT_loop_stride;
fprintf (f, " loop_stride");
}
+ if (hints & INLINE_HINT_same_scc)
+ {
+ hints &= ~INLINE_HINT_same_scc;
+ fprintf (f, " same_scc");
+ }
+ if (hints & INLINE_HINT_in_scc)
+ {
+ hints &= ~INLINE_HINT_in_scc;
+ fprintf (f, " in_scc");
+ }
gcc_assert (!hints);
}
@@ -973,6 +983,7 @@ reset_inline_summary (struct cgraph_node *node)
info->stack_frame_offset = 0;
info->size = 0;
info->time = 0;
+ info->scc_no = 0;
if (info->loop_iterations)
{
pool_free (edge_predicate_pool, info->loop_iterations);
@@ -1081,7 +1092,6 @@ inline_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst,
struct predicate true_pred = true_predicate ();
size_time_entry *e;
int optimized_out_size = 0;
- gcov_type optimized_out_time = 0;
bool inlined_to_p = false;
struct cgraph_edge *edge;
@@ -1123,10 +1133,7 @@ inline_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst,
possible_truths,
info);
if (false_predicate_p (&new_predicate))
- {
- optimized_out_size += e->size;
- optimized_out_time += e->time;
- }
+ optimized_out_size += e->size;
else
account_size_time (info, e->size, e->time, &new_predicate);
}
@@ -1149,9 +1156,6 @@ inline_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst,
&& !false_predicate_p (es->predicate))
{
optimized_out_size += es->call_stmt_size * INLINE_SIZE_SCALE;
- optimized_out_time += (es->call_stmt_time
- * (INLINE_TIME_SCALE / CGRAPH_FREQ_BASE)
- * edge->frequency);
edge->frequency = 0;
}
edge_set_predicate (edge, &new_predicate);
@@ -1174,9 +1178,6 @@ inline_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst,
&& !false_predicate_p (es->predicate))
{
optimized_out_size += es->call_stmt_size * INLINE_SIZE_SCALE;
- optimized_out_time += (es->call_stmt_time
- * (INLINE_TIME_SCALE / CGRAPH_FREQ_BASE)
- * edge->frequency);
edge->frequency = 0;
}
edge_set_predicate (edge, &new_predicate);
@@ -1193,22 +1194,7 @@ inline_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst,
about updating self sizes, because size vectors already contains
sizes of the calees. */
gcc_assert (!inlined_to_p
- || (!optimized_out_size && !optimized_out_time));
-
- info->size -= optimized_out_size / INLINE_SIZE_SCALE;
- info->self_size -= optimized_out_size / INLINE_SIZE_SCALE;
- gcc_assert (info->size > 0);
- gcc_assert (info->self_size > 0);
-
- optimized_out_time /= INLINE_TIME_SCALE;
- if (optimized_out_time > MAX_TIME)
- optimized_out_time = MAX_TIME;
- info->time -= optimized_out_time;
- info->self_time -= optimized_out_time;
- if (info->time < 0)
- info->time = 0;
- if (info->self_time < 0)
- info->self_time = 0;
+ || !optimized_out_size);
}
else
{
@@ -1226,6 +1212,7 @@ inline_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst,
set_hint_predicate (&info->loop_stride, p);
}
}
+ inline_update_overall_summary (dst);
}
@@ -1388,6 +1375,9 @@ dump_inline_summary (FILE * f, struct cgraph_node *node)
(int) s->estimated_self_stack_size);
fprintf (f, " global stack: %i\n",
(int) s->estimated_stack_size);
+ if (s->scc_no)
+ fprintf (f, " In SCC: %i\n",
+ (int) s->scc_no);
for (i = 0;
VEC_iterate (size_time_entry, s->entry, i, e);
i++)
@@ -1558,6 +1548,7 @@ static int
eliminated_by_inlining_prob (gimple stmt)
{
enum gimple_code code = gimple_code (stmt);
+ enum tree_code rhs_code;
if (!optimize)
return 0;
@@ -1570,13 +1561,16 @@ eliminated_by_inlining_prob (gimple stmt)
if (gimple_num_ops (stmt) != 2)
return 0;
+ rhs_code = gimple_assign_rhs_code (stmt);
+
/* Casts of parameters, loads from parameters passed by reference
and stores to return value or parameters are often free after
inlining dua to SRA and further combining.
Assume that half of statements goes away. */
- if (gimple_assign_rhs_code (stmt) == CONVERT_EXPR
- || gimple_assign_rhs_code (stmt) == NOP_EXPR
- || gimple_assign_rhs_code (stmt) == VIEW_CONVERT_EXPR
+ if (rhs_code == CONVERT_EXPR
+ || rhs_code == NOP_EXPR
+ || rhs_code == VIEW_CONVERT_EXPR
+ || rhs_code == ADDR_EXPR
|| gimple_assign_rhs_class (stmt) == GIMPLE_SINGLE_RHS)
{
tree rhs = gimple_assign_rhs1 (stmt);
@@ -1594,6 +1588,17 @@ eliminated_by_inlining_prob (gimple stmt)
/* Reads of parameter are expected to be free. */
if (unmodified_parm (stmt, inner_rhs))
rhs_free = true;
+ /* Match expressions of form &this->field. Those will most likely
+ combine with something upstream after inlining. */
+ else if (TREE_CODE (inner_rhs) == ADDR_EXPR)
+ {
+ tree op = get_base_address (TREE_OPERAND (inner_rhs, 0));
+ if (TREE_CODE (op) == PARM_DECL)
+ rhs_free = true;
+ else if (TREE_CODE (op) == MEM_REF
+ && unmodified_parm (stmt, TREE_OPERAND (op, 0)))
+ rhs_free = true;
+ }
/* When parameter is not SSA register because its address is taken
and it is just copied into one, the statement will be completely
@@ -2405,8 +2410,6 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early)
struct predicate p;
this_time *= freq;
- time += this_time;
- size += this_size;
prob = eliminated_by_inlining_prob (stmt);
if (prob == 1 && dump_file && (dump_flags & TDF_DETAILS))
@@ -2420,6 +2423,12 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early)
else
p = true_predicate ();
+ if (!false_predicate_p (&p))
+ {
+ time += this_time;
+ size += this_size;
+ }
+
/* We account everything but the calls. Calls have their own
size/time info attached to cgraph edges. This is necessary
in order to make the cost disappear after inlining. */
@@ -2621,6 +2630,12 @@ compute_inline_parameters (struct cgraph_node *node, bool early)
info->size = info->self_size;
info->stack_frame_offset = 0;
info->estimated_stack_size = info->estimated_self_stack_size;
+#ifdef ENABLE_CHECKING
+ inline_update_overall_summary (node);
+ gcc_assert (info->time == info->self_time
+ && info->size == info->self_size);
+#endif
+
pop_cfun ();
}
@@ -2655,38 +2670,24 @@ struct gimple_opt_pass pass_inline_parameters =
};
-/* Increase SIZE and TIME for size and time needed to handle edge E. */
-
-static void
-estimate_edge_size_and_time (struct cgraph_edge *e, int *size, int *time,
- int prob)
-{
- struct inline_edge_summary *es = inline_edge_summary (e);
- *size += es->call_stmt_size * INLINE_SIZE_SCALE;
- *time += (es->call_stmt_time * prob / REG_BR_PROB_BASE
- * e->frequency * (INLINE_TIME_SCALE / CGRAPH_FREQ_BASE));
- if (*time > MAX_TIME * INLINE_TIME_SCALE)
- *time = MAX_TIME * INLINE_TIME_SCALE;
-}
-
-
/* Estimate benefit devirtualizing indirect edge IE, provided KNOWN_VALS and
KNOWN_BINFOS. */
static bool
estimate_edge_devirt_benefit (struct cgraph_edge *ie,
- int *size, int *time, int prob,
+ int *size, int *time,
VEC (tree, heap) *known_vals,
VEC (tree, heap) *known_binfos,
VEC (ipa_agg_jump_function_p, heap) *known_aggs)
{
tree target;
- int time_diff, size_diff;
struct cgraph_node *callee;
struct inline_summary *isummary;
if (!known_vals && !known_binfos)
return false;
+ if (!flag_indirect_inlining)
+ return false;
target = ipa_get_indirect_edge_target (ie, known_vals, known_binfos,
known_aggs);
@@ -2694,12 +2695,10 @@ estimate_edge_devirt_benefit (struct cgraph_edge *ie,
return false;
/* Account for difference in cost between indirect and direct calls. */
- size_diff = ((eni_size_weights.indirect_call_cost - eni_size_weights.call_cost)
- * INLINE_SIZE_SCALE);
- *size -= size_diff;
- time_diff = ((eni_time_weights.indirect_call_cost - eni_time_weights.call_cost)
- * INLINE_TIME_SCALE * prob / REG_BR_PROB_BASE);
- *time -= time_diff;
+ *size -= (eni_size_weights.indirect_call_cost - eni_size_weights.call_cost);
+ *time -= (eni_time_weights.indirect_call_cost - eni_time_weights.call_cost);
+ gcc_checking_assert (*time >= 0);
+ gcc_checking_assert (*size >= 0);
callee = cgraph_get_node (target);
if (!callee || !callee->analyzed)
@@ -2708,6 +2707,34 @@ estimate_edge_devirt_benefit (struct cgraph_edge *ie,
return isummary->inlinable;
}
+/* Increase SIZE and TIME for size and time needed to handle edge E. */
+
+static inline void
+estimate_edge_size_and_time (struct cgraph_edge *e, int *size, int *time,
+ int prob,
+ VEC (tree, heap) *known_vals,
+ VEC (tree, heap) *known_binfos,
+ VEC (ipa_agg_jump_function_p, heap) *known_aggs,
+ inline_hints *hints)
+
+{
+ struct inline_edge_summary *es = inline_edge_summary (e);
+ int call_size = es->call_stmt_size;
+ int call_time = es->call_stmt_time;
+ if (!e->callee
+ && estimate_edge_devirt_benefit (e, &call_size, &call_time,
+ known_vals, known_binfos, known_aggs)
+ && hints
+ && cgraph_maybe_hot_edge_p (e))
+ *hints |= INLINE_HINT_indirect_call;
+ *size += call_size * INLINE_SIZE_SCALE;
+ *time += call_time * prob / REG_BR_PROB_BASE
+ * e->frequency * (INLINE_TIME_SCALE / CGRAPH_FREQ_BASE);
+ if (*time > MAX_TIME * INLINE_TIME_SCALE)
+ *time = MAX_TIME * INLINE_TIME_SCALE;
+}
+
+
/* Increase SIZE and TIME for size and time needed to handle all calls in NODE.
POSSIBLE_TRUTHS, KNOWN_VALS and KNOWN_BINFOS describe context of the call
@@ -2731,7 +2758,9 @@ estimate_calls_size_and_time (struct cgraph_node *node, int *size, int *time,
{
/* Predicates of calls shall not use NOT_CHANGED codes,
sowe do not need to compute probabilities. */
- estimate_edge_size_and_time (e, size, time, REG_BR_PROB_BASE);
+ estimate_edge_size_and_time (e, size, time, REG_BR_PROB_BASE,
+ known_vals, known_binfos, known_aggs,
+ hints);
}
else
estimate_calls_size_and_time (e->callee, size, time, hints,
@@ -2743,14 +2772,9 @@ estimate_calls_size_and_time (struct cgraph_node *node, int *size, int *time,
{
struct inline_edge_summary *es = inline_edge_summary (e);
if (!es->predicate || evaluate_predicate (es->predicate, possible_truths))
- {
- estimate_edge_size_and_time (e, size, time, REG_BR_PROB_BASE);
- if (estimate_edge_devirt_benefit (e, size, time, REG_BR_PROB_BASE,
- known_vals, known_binfos, known_aggs)
- && hints
- && cgraph_maybe_hot_edge_p (e))
- *hints |= INLINE_HINT_indirect_call;
- }
+ estimate_edge_size_and_time (e, size, time, REG_BR_PROB_BASE,
+ known_vals, known_binfos, known_aggs,
+ hints);
}
}
@@ -2772,7 +2796,8 @@ estimate_node_size_and_time (struct cgraph_node *node,
{
struct inline_summary *info = inline_summary (node);
size_time_entry *e;
- int size = 0, time = 0;
+ int size = 0;
+ int time = 0;
inline_hints hints = 0;
int i;
@@ -2801,6 +2826,8 @@ estimate_node_size_and_time (struct cgraph_node *node,
if (evaluate_predicate (&e->predicate, possible_truths))
{
size += e->size;
+ gcc_checking_assert (e->time >= 0);
+ gcc_checking_assert (time >= 0);
if (!inline_param_summary)
time += e->time;
else
@@ -2809,10 +2836,17 @@ estimate_node_size_and_time (struct cgraph_node *node,
&e->predicate,
possible_truths,
inline_param_summary);
- time += e->time * prob / REG_BR_PROB_BASE;
+ gcc_checking_assert (prob >= 0);
+ gcc_checking_assert (prob <= REG_BR_PROB_BASE);
+ time += ((gcov_type)e->time * prob) / REG_BR_PROB_BASE;
}
+ if (time > MAX_TIME * INLINE_TIME_SCALE)
+ time = MAX_TIME * INLINE_TIME_SCALE;
+ gcc_checking_assert (time >= 0);
}
+ gcc_checking_assert (size >= 0);
+ gcc_checking_assert (time >= 0);
if (info->loop_iterations
&& !evaluate_predicate (info->loop_iterations, possible_truths))
@@ -2820,19 +2854,20 @@ estimate_node_size_and_time (struct cgraph_node *node,
if (info->loop_stride
&& !evaluate_predicate (info->loop_stride, possible_truths))
hints |=INLINE_HINT_loop_stride;
-
- if (time > MAX_TIME * INLINE_TIME_SCALE)
- time = MAX_TIME * INLINE_TIME_SCALE;
+ if (info->scc_no)
+ hints |= INLINE_HINT_in_scc;
estimate_calls_size_and_time (node, &size, &time, &hints, possible_truths,
known_vals, known_binfos, known_aggs);
- time = (time + INLINE_TIME_SCALE / 2) / INLINE_TIME_SCALE;
- size = (size + INLINE_SIZE_SCALE / 2) / INLINE_SIZE_SCALE;
+ gcc_checking_assert (size >= 0);
+ gcc_checking_assert (time >= 0);
+ time = RDIV (time, INLINE_TIME_SCALE);
+ size = RDIV (size, INLINE_SIZE_SCALE);
if (dump_file
&& (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "\n size:%i time:%i\n", size, time);
+ fprintf (dump_file, "\n size:%i time:%i\n", (int)size, (int)time);
if (ret_time)
*ret_time = time;
if (ret_size)
@@ -3224,7 +3259,7 @@ inline_merge_summary (struct cgraph_edge *edge)
int prob = predicate_probability (callee_info->conds,
&e->predicate,
clause, es->param);
- add_time = add_time * prob / REG_BR_PROB_BASE;
+ 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;
if (prob != REG_BR_PROB_BASE
@@ -3318,6 +3353,9 @@ do_estimate_edge_time (struct cgraph_edge *edge)
/* When caching, update the cache entry. */
if (edge_growth_cache)
{
+ struct cgraph_node *to = (edge->caller->global.inlined_to
+ ? edge->caller->global.inlined_to
+ : edge->caller);
if ((int)VEC_length (edge_growth_cache_entry, edge_growth_cache)
<= edge->uid)
VEC_safe_grow_cleared (edge_growth_cache_entry, heap, edge_growth_cache,
@@ -3327,6 +3365,10 @@ do_estimate_edge_time (struct cgraph_edge *edge)
VEC_index (edge_growth_cache_entry, edge_growth_cache, edge->uid).size
= size + (size >= 0);
+ if (inline_summary (to)->scc_no
+ && inline_summary (to)->scc_no == inline_summary (callee)->scc_no
+ && !cgraph_edge_recursive_p (edge))
+ hints |= INLINE_HINT_same_scc;
VEC_index (edge_growth_cache_entry, edge_growth_cache, edge->uid).hints
= hints + 1;
}
@@ -3387,6 +3429,9 @@ do_estimate_edge_hints (struct cgraph_edge *edge)
VEC (tree, heap) *known_vals;
VEC (tree, heap) *known_binfos;
VEC (ipa_agg_jump_function_p, heap) *known_aggs;
+ struct cgraph_node *to = (edge->caller->global.inlined_to
+ ? edge->caller->global.inlined_to
+ : edge->caller);
/* When we do caching, use do_estimate_edge_time to populate the entry. */
@@ -3412,6 +3457,10 @@ do_estimate_edge_hints (struct cgraph_edge *edge)
VEC_free (tree, heap, known_vals);
VEC_free (tree, heap, known_binfos);
VEC_free (ipa_agg_jump_function_p, heap, known_aggs);
+ if (inline_summary (to)->scc_no
+ && inline_summary (to)->scc_no == inline_summary (callee)->scc_no
+ && !cgraph_edge_recursive_p (edge))
+ hints |= INLINE_HINT_same_scc;
return hints;
}
diff --git a/gcc/ipa-inline-transform.c b/gcc/ipa-inline-transform.c
index 53c468717c7..7bb291c7d64 100644
--- a/gcc/ipa-inline-transform.c
+++ b/gcc/ipa-inline-transform.c
@@ -209,6 +209,12 @@ inline_call (struct cgraph_edge *e, bool update_original,
struct cgraph_node *to = NULL;
struct cgraph_edge *curr = e;
struct cgraph_node *callee = cgraph_function_or_thunk_node (e->callee, NULL);
+ bool new_edges_found = false;
+
+#ifdef ENABLE_CHECKING
+ int estimated_growth = estimate_edge_growth (e);
+ bool predicated = inline_edge_summary (e)->predicate != NULL;
+#endif
/* Don't inline inlined edges. */
gcc_assert (e->inline_failed);
@@ -248,19 +254,31 @@ inline_call (struct cgraph_edge *e, bool update_original,
old_size = inline_summary (to)->size;
inline_merge_summary (e);
+ if (optimize)
+ new_edges_found = ipa_propagate_indirect_call_infos (curr, new_edges);
if (update_overall_summary)
inline_update_overall_summary (to);
new_size = inline_summary (to)->size;
- if (overall_size)
+#ifdef ENABLE_CHECKING
+ /* Verify that estimated growth match real growth. Allow off-by-one
+ error due to INLINE_SIZE_SCALE roudoff errors. */
+ gcc_assert (!update_overall_summary || !overall_size
+ || abs (estimated_growth - (new_size - old_size)) <= 1
+ /* FIXME: a hack. Edges with false predicate are accounted
+ wrong, we should remove them from callgraph. */
+ || predicated);
+#endif
+
+ /* Account the change of overall unit size; external functions will be
+ removed and are thus not accounted. */
+ if (overall_size
+ && !DECL_EXTERNAL (to->symbol.decl))
*overall_size += new_size - old_size;
ncalls_inlined++;
/* This must happen after inline_merge_summary that rely on jump
functions of callee to not be updated. */
- if (optimize)
- return ipa_propagate_indirect_call_infos (curr, new_edges);
- else
- return false;
+ return new_edges_found;
}
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index f5c255ca0b7..773220b60cc 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -681,34 +681,41 @@ check_caller_edge (struct cgraph_node *node, void *edge)
}
-/* Decide if NODE is called once inlining it would eliminate need
- for the offline copy of function. */
+/* Decide if inlining NODE would reduce unit size by eliminating
+ the offline copy of function.
+ When COLD is true the cold calls are considered, too. */
static bool
-want_inline_function_called_once_p (struct cgraph_node *node)
+want_inline_function_to_all_callers_p (struct cgraph_node *node, bool cold)
{
struct cgraph_node *function = cgraph_function_or_thunk_node (node, NULL);
+ struct cgraph_edge *e;
+ bool has_hot_call = false;
+
+ /* Does it have callers? */
+ if (!node->callers)
+ return false;
/* Already inlined? */
if (function->global.inlined_to)
return false;
- /* Zero or more then one callers? */
- if (!node->callers
- || node->callers->next_caller)
+ if (cgraph_function_or_thunk_node (node, NULL) != node)
+ return false;
+ /* Inlining into all callers would increase size? */
+ if (estimate_growth (node) > 0)
return false;
/* Maybe other aliases has more direct calls. */
if (cgraph_for_node_and_aliases (node, check_caller_edge, node->callers, true))
return false;
- /* Recursive call makes no sense to inline. */
- if (cgraph_edge_recursive_p (node->callers))
- return false;
- /* External functions are not really in the unit, so inlining
- them when called once would just increase the program size. */
- if (DECL_EXTERNAL (function->symbol.decl))
- return false;
- /* Offline body must be optimized out. */
- if (!cgraph_will_be_removed_from_program_if_no_direct_calls (function))
- return false;
- if (!can_inline_edge_p (node->callers, true))
+ /* All inlines must be possible. */
+ for (e = node->callers; e; e = e->next_caller)
+ {
+ if (!can_inline_edge_p (e, true))
+ return false;
+ if (!has_hot_call && cgraph_maybe_hot_edge_p (e))
+ has_hot_call = 1;
+ }
+
+ if (!cold && !has_hot_call)
return false;
return true;
}
@@ -845,8 +852,8 @@ edge_badness (struct cgraph_edge *edge, bool dump)
precision for small bandesses (those are interesting) yet we don't
overflow for growths that are still in interesting range.
- Fixed point arithmetic with point at 8th bit. */
- badness = ((gcov_type)growth) * (1<<(19+8));
+ Fixed point arithmetic with point at 6th bit. */
+ badness = ((gcov_type)growth) * (1<<(19+6));
badness = (badness + div / 2) / div;
/* Overall growth of inlining all calls of function matters: we want to
@@ -861,9 +868,9 @@ edge_badness (struct cgraph_edge *edge, bool dump)
We might mix the valud into the fraction by taking into account
relative growth of the unit, but for now just add the number
into resulting fraction. */
- if (badness > INT_MAX / 2)
+ if (badness > INT_MAX / 8)
{
- badness = INT_MAX / 2;
+ badness = INT_MAX / 8;
if (dump)
fprintf (dump_file, "Badness overflow\n");
}
@@ -871,6 +878,10 @@ edge_badness (struct cgraph_edge *edge, bool dump)
| INLINE_HINT_loop_iterations
| INLINE_HINT_loop_stride))
badness /= 8;
+ if (hints & (INLINE_HINT_same_scc))
+ badness *= 4;
+ if (hints & (INLINE_HINT_in_scc))
+ badness *= 2;
if (dump)
{
fprintf (dump_file,
@@ -1190,14 +1201,28 @@ recursive_inlining (struct cgraph_edge *edge,
{
struct cgraph_edge *curr
= (struct cgraph_edge *) fibheap_extract_min (heap);
- struct cgraph_node *cnode;
-
- if (estimate_size_after_inlining (node, curr) > limit)
- break;
+ struct cgraph_node *cnode, *dest = curr->callee;
if (!can_inline_edge_p (curr, true))
continue;
+ /* MASTER_CLONE is produced in the case we already started modified
+ the function. Be sure to redirect edge to the original body before
+ estimating growths otherwise we will be seeing growths after inlining
+ the already modified body. */
+ if (master_clone)
+ {
+ cgraph_redirect_edge_callee (curr, master_clone);
+ reset_edge_growth_cache (curr);
+ }
+
+ if (estimate_size_after_inlining (node, curr) > limit)
+ {
+ cgraph_redirect_edge_callee (curr, dest);
+ reset_edge_growth_cache (curr);
+ break;
+ }
+
depth = 1;
for (cnode = curr->caller;
cnode->global.inlined_to; cnode = cnode->callers->caller)
@@ -1206,7 +1231,11 @@ recursive_inlining (struct cgraph_edge *edge,
depth++;
if (!want_inline_self_recursive_call_p (curr, node, false, depth))
- continue;
+ {
+ cgraph_redirect_edge_callee (curr, dest);
+ reset_edge_growth_cache (curr);
+ continue;
+ }
if (dump_file)
{
@@ -1228,9 +1257,10 @@ recursive_inlining (struct cgraph_edge *edge,
for (e = master_clone->callees; e; e = e->next_callee)
if (!e->inline_failed)
clone_inlined_nodes (e, true, false, NULL);
+ cgraph_redirect_edge_callee (curr, master_clone);
+ reset_edge_growth_cache (curr);
}
- cgraph_redirect_edge_callee (curr, master_clone);
inline_call (curr, false, new_edges, &overall_size, true);
lookup_recursive_calls (node, curr->callee, heap);
n++;
@@ -1314,20 +1344,17 @@ inline_small_functions (void)
int min_size, max_size;
VEC (cgraph_edge_p, heap) *new_indirect_edges = NULL;
int initial_size = 0;
+ struct cgraph_node **order = XCNEWVEC (struct cgraph_node *, cgraph_n_nodes);
if (flag_indirect_inlining)
new_indirect_edges = VEC_alloc (cgraph_edge_p, heap, 8);
- if (dump_file)
- fprintf (dump_file,
- "\nDeciding on inlining of small functions. Starting with size %i.\n",
- initial_size);
-
/* Compute overall unit size and other global parameters used by badness
metrics. */
max_count = 0;
- initialize_growth_caches ();
+ ipa_reduced_postorder (order, true, true, NULL);
+ free (order);
FOR_EACH_DEFINED_FUNCTION (node)
if (!node->global.inlined_to)
@@ -1336,15 +1363,36 @@ inline_small_functions (void)
|| node->thunk.thunk_p)
{
struct inline_summary *info = inline_summary (node);
+ struct ipa_dfs_info *dfs = (struct ipa_dfs_info *) node->symbol.aux;
if (!DECL_EXTERNAL (node->symbol.decl))
initial_size += info->size;
+ if (dfs && dfs->next_cycle)
+ {
+ struct cgraph_node *n2;
+ int id = dfs->scc_no + 1;
+ for (n2 = node; n2;
+ n2 = ((struct ipa_dfs_info *) node->symbol.aux)->next_cycle)
+ {
+ struct inline_summary *info2 = inline_summary (n2);
+ if (info2->scc_no)
+ break;
+ info2->scc_no = id;
+ }
+ }
}
for (edge = node->callers; edge; edge = edge->next_caller)
if (max_count < edge->count)
max_count = edge->count;
}
+ ipa_free_postorder_info ();
+ initialize_growth_caches ();
+
+ if (dump_file)
+ fprintf (dump_file,
+ "\nDeciding on inlining of small functions. Starting with size %i.\n",
+ initial_size);
overall_size = initial_size;
max_size = compute_max_insns (overall_size);
@@ -1509,7 +1557,7 @@ inline_small_functions (void)
reset_edge_caches (edge->callee);
reset_node_growth_cache (callee);
- update_callee_keys (edge_heap, edge->callee, updated_nodes);
+ update_callee_keys (edge_heap, where, updated_nodes);
}
where = edge->caller;
if (where->global.inlined_to)
@@ -1688,14 +1736,16 @@ ipa_inline (void)
symtab_remove_unreachable_nodes (true, dump_file);
free (order);
- /* We already perform some inlining of functions called once during
- inlining small functions above. After unreachable nodes are removed,
- we still might do a quick check that nothing new is found. */
+ /* Inline functions with a property that after inlining into all callers the
+ code size will shrink because the out-of-line copy is eliminated.
+ We do this regardless on the callee size as long as function growth limits
+ are met. */
if (flag_inline_functions_called_once)
{
int cold;
if (dump_file)
- fprintf (dump_file, "\nDeciding on functions called once:\n");
+ fprintf (dump_file,
+ "\nDeciding on functions to be inlined into all callers:\n");
/* Inlining one function called once has good chance of preventing
inlining other function into the same callee. Ideally we should
@@ -1716,31 +1766,30 @@ ipa_inline (void)
{
FOR_EACH_DEFINED_FUNCTION (node)
{
- if (want_inline_function_called_once_p (node)
- && (cold
- || cgraph_maybe_hot_edge_p (node->callers)))
- {
- struct cgraph_node *caller = node->callers->caller;
-
- if (dump_file)
- {
- fprintf (dump_file,
- "\nInlining %s size %i.\n",
- cgraph_node_name (node),
- inline_summary (node)->size);
+ if (want_inline_function_to_all_callers_p (node, cold))
+ while (node->callers && !node->global.inlined_to)
+ {
+ struct cgraph_node *caller = node->callers->caller;
+
+ if (dump_file)
+ {
+ fprintf (dump_file,
+ "\nInlining %s size %i.\n",
+ cgraph_node_name (node),
+ inline_summary (node)->size);
+ fprintf (dump_file,
+ " Called once from %s %i insns.\n",
+ cgraph_node_name (node->callers->caller),
+ inline_summary (node->callers->caller)->size);
+ }
+
+ inline_call (node->callers, true, NULL, NULL, true);
+ if (dump_file)
fprintf (dump_file,
- " Called once from %s %i insns.\n",
- cgraph_node_name (node->callers->caller),
- inline_summary (node->callers->caller)->size);
- }
-
- inline_call (node->callers, true, NULL, NULL, true);
- if (dump_file)
- fprintf (dump_file,
- " Inlined into %s which now has %i size\n",
- cgraph_node_name (caller),
- inline_summary (caller)->size);
- }
+ " Inlined into %s which now has %i size\n",
+ cgraph_node_name (caller),
+ inline_summary (caller)->size);
+ }
}
}
}
diff --git a/gcc/ipa-inline.h b/gcc/ipa-inline.h
index df8b3a7e202..ca59a7f7099 100644
--- a/gcc/ipa-inline.h
+++ b/gcc/ipa-inline.h
@@ -47,7 +47,9 @@ typedef struct GTY(()) condition
enum inline_hints_vals {
INLINE_HINT_indirect_call = 1,
INLINE_HINT_loop_iterations = 2,
- INLINE_HINT_loop_stride = 4
+ INLINE_HINT_loop_stride = 4,
+ INLINE_HINT_same_scc = 8,
+ INLINE_HINT_in_scc = 16
};
typedef int inline_hints;
@@ -127,6 +129,8 @@ struct GTY(()) inline_summary
/* Predicate on when some loop in the function becomes to have known
stride. */
struct predicate * GTY((skip)) loop_stride;
+ /* Number of SCC on the beggining of inlining process. */
+ int scc_no;
};
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 714dd8f7bcb..e9e4602e9a0 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-flow.h"
#include "tree-pass.h"
#include "tree-inline.h"
+#include "ipa-inline.h"
#include "gimple.h"
#include "flags.h"
#include "diagnostic.h"
@@ -2100,6 +2101,7 @@ struct cgraph_edge *
ipa_make_edge_direct_to_target (struct cgraph_edge *ie, tree target)
{
struct cgraph_node *callee;
+ struct inline_edge_summary *es = inline_edge_summary (ie);
if (TREE_CODE (target) == ADDR_EXPR)
target = TREE_OPERAND (target, 0);
@@ -2115,6 +2117,11 @@ ipa_make_edge_direct_to_target (struct cgraph_edge *ie, tree target)
gcc_assert (!callee->global.inlined_to);
cgraph_make_edge_direct (ie, callee);
+ es = inline_edge_summary (ie);
+ es->call_stmt_size -= (eni_size_weights.indirect_call_cost
+ - eni_size_weights.call_cost);
+ es->call_stmt_time -= (eni_time_weights.indirect_call_cost
+ - eni_time_weights.call_cost);
if (dump_file)
{
fprintf (dump_file, "ipa-prop: Discovered %s call to a known target "
diff --git a/gcc/ira-lives.c b/gcc/ira-lives.c
index 940cd681f2a..41fd07637bf 100644
--- a/gcc/ira-lives.c
+++ b/gcc/ira-lives.c
@@ -1465,8 +1465,8 @@ remove_some_program_points_and_update_live_ranges (void)
born = sbitmap_alloc (ira_max_point);
dead = sbitmap_alloc (ira_max_point);
- sbitmap_zero (born);
- sbitmap_zero (dead);
+ bitmap_clear (born);
+ bitmap_clear (dead);
FOR_EACH_OBJECT (obj, oi)
for (r = OBJECT_LIVE_RANGES (obj); r != NULL; r = r->next)
{
@@ -1476,7 +1476,7 @@ remove_some_program_points_and_update_live_ranges (void)
}
born_or_dead = sbitmap_alloc (ira_max_point);
- sbitmap_a_or_b (born_or_dead, born, dead);
+ bitmap_ior (born_or_dead, born, dead);
map = (int *) ira_allocate (sizeof (int) * ira_max_point);
n = -1;
prev_born_p = prev_dead_p = false;
diff --git a/gcc/ira.c b/gcc/ira.c
index 9a8b098cf48..aeef5c4b924 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -3492,9 +3492,9 @@ init_live_subregs (bool init_value, sbitmap *live_subregs,
/* If the entire reg was live before blasting into subregs, we need
to init all of the subregs to ones else init to 0. */
if (init_value)
- sbitmap_ones (live_subregs[allocnum]);
+ bitmap_ones (live_subregs[allocnum]);
else
- sbitmap_zero (live_subregs[allocnum]);
+ bitmap_clear (live_subregs[allocnum]);
bitmap_set_bit (live_subregs_used, allocnum);
}
@@ -3624,7 +3624,7 @@ build_insn_chain (void)
start++;
}
- if (sbitmap_empty_p (live_subregs[regno]))
+ if (bitmap_empty_p (live_subregs[regno]))
{
bitmap_clear_bit (live_subregs_used, regno);
bitmap_clear_bit (live_relevant_regs, regno);
@@ -4399,6 +4399,16 @@ ira (FILE *f)
setup_prohibited_mode_move_regs ();
df_note_add_problem ();
+
+ /* DF_LIVE can't be used in the register allocator, too many other
+ parts of the compiler depend on using the "classic" liveness
+ interpretation of the DF_LR problem. See PR38711.
+ Remove the problem, so that we don't spend time updating it in
+ any of the df_analyze() calls during IRA/LRA. */
+ if (optimize > 1)
+ df_remove_problem (df_live);
+ gcc_checking_assert (df_live == NULL);
+
#ifdef ENABLE_CHECKING
df->changeable_flags |= DF_VERIFY_SCHEDULED;
#endif
@@ -4678,6 +4688,12 @@ do_reload (void)
df_scan_alloc (NULL);
df_scan_blocks ();
+ if (optimize > 1)
+ {
+ df_live_add_problem ();
+ df_live_set_all_dirty ();
+ }
+
if (optimize)
df_analyze ();
diff --git a/gcc/java/jcf-io.c b/gcc/java/jcf-io.c
index 97a3c0fbc68..6a24f78ebd4 100644
--- a/gcc/java/jcf-io.c
+++ b/gcc/java/jcf-io.c
@@ -276,19 +276,21 @@ find_classfile (char *filename, JCF *jcf, const char *dep_name)
struct charstar_hash : typed_noop_remove <char>
{
- typedef const char T;
- static inline hashval_t hash (const T *candidate);
- static inline bool equal (const T *existing, const T *candidate);
+ typedef const char value_type;
+ typedef const char compare_type;
+ static inline hashval_t hash (const value_type *candidate);
+ static inline bool equal (const value_type *existing,
+ const compare_type *candidate);
};
inline hashval_t
-charstar_hash::hash (const T *candidate)
+charstar_hash::hash (const value_type *candidate)
{
return htab_hash_string (candidate);
}
inline bool
-charstar_hash::equal (const T *existing, const T *candidate)
+charstar_hash::equal (const value_type *existing, const compare_type *candidate)
{
return strcmp (existing, candidate) == 0;
}
diff --git a/gcc/lcm.c b/gcc/lcm.c
index fec2ba45d30..2a2b48f7edc 100644
--- a/gcc/lcm.c
+++ b/gcc/lcm.c
@@ -106,7 +106,7 @@ compute_antinout_edge (sbitmap *antloc, sbitmap *transp, sbitmap *antin,
/* We want a maximal solution, so make an optimistic initialization of
ANTIN. */
- sbitmap_vector_ones (antin, last_basic_block);
+ bitmap_vector_ones (antin, last_basic_block);
/* Put every block on the worklist; this is necessary because of the
optimistic initialization of ANTIN above. */
@@ -139,7 +139,7 @@ compute_antinout_edge (sbitmap *antloc, sbitmap *transp, sbitmap *antin,
/* Do not clear the aux field for blocks which are predecessors of
the EXIT block. That way we never add then to the worklist
again. */
- sbitmap_zero (antout[bb->index]);
+ bitmap_clear (antout[bb->index]);
else
{
/* Clear the aux field of this block so that it can be added to
@@ -148,7 +148,7 @@ compute_antinout_edge (sbitmap *antloc, sbitmap *transp, sbitmap *antin,
sbitmap_intersection_of_succs (antout[bb->index], antin, bb);
}
- if (sbitmap_a_or_b_and_c_cg (antin[bb->index], antloc[bb->index],
+ if (bitmap_or_and (antin[bb->index], antloc[bb->index],
transp[bb->index], antout[bb->index]))
/* If the in state of this block changed, then we need
to add the predecessors of this block to the worklist
@@ -190,17 +190,17 @@ compute_earliest (struct edge_list *edge_list, int n_exprs, sbitmap *antin,
pred = INDEX_EDGE_PRED_BB (edge_list, x);
succ = INDEX_EDGE_SUCC_BB (edge_list, x);
if (pred == ENTRY_BLOCK_PTR)
- sbitmap_copy (earliest[x], antin[succ->index]);
+ bitmap_copy (earliest[x], antin[succ->index]);
else
{
if (succ == EXIT_BLOCK_PTR)
- sbitmap_zero (earliest[x]);
+ bitmap_clear (earliest[x]);
else
{
- sbitmap_difference (difference, antin[succ->index],
+ bitmap_and_compl (difference, antin[succ->index],
avout[pred->index]);
- sbitmap_not (temp_bitmap, antout[pred->index]);
- sbitmap_a_and_b_or_c (earliest[x], difference,
+ bitmap_not (temp_bitmap, antout[pred->index]);
+ bitmap_and_or (earliest[x], difference,
kill[pred->index], temp_bitmap);
}
}
@@ -271,14 +271,14 @@ compute_laterin (struct edge_list *edge_list, sbitmap *earliest,
example the expression is ANTLOC in a block within the loop) then
this algorithm will detect it when we process the block at the head
of the optimistic edge. That will requeue the affected blocks. */
- sbitmap_vector_ones (later, num_edges);
+ bitmap_vector_ones (later, num_edges);
/* Note that even though we want an optimistic setting of LATER, we
do not want to be overly optimistic. Consider an outgoing edge from
the entry block. That edge should always have a LATER value the
same as EARLIEST for that edge. */
FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR->succs)
- sbitmap_copy (later[(size_t) e->aux], earliest[(size_t) e->aux]);
+ bitmap_copy (later[(size_t) e->aux], earliest[(size_t) e->aux]);
/* Add all the blocks to the worklist. This prevents an early exit from
the loop given our optimistic initialization of LATER above. */
@@ -305,14 +305,14 @@ compute_laterin (struct edge_list *edge_list, sbitmap *earliest,
qout = worklist;
/* Compute the intersection of LATERIN for each incoming edge to B. */
- sbitmap_ones (laterin[bb->index]);
+ bitmap_ones (laterin[bb->index]);
FOR_EACH_EDGE (e, ei, bb->preds)
- sbitmap_a_and_b (laterin[bb->index], laterin[bb->index],
+ bitmap_and (laterin[bb->index], laterin[bb->index],
later[(size_t)e->aux]);
/* Calculate LATER for all outgoing edges. */
FOR_EACH_EDGE (e, ei, bb->succs)
- if (sbitmap_union_of_diff_cg (later[(size_t) e->aux],
+ if (bitmap_ior_and_compl (later[(size_t) e->aux],
earliest[(size_t) e->aux],
laterin[e->src->index],
antloc[e->src->index])
@@ -331,9 +331,9 @@ compute_laterin (struct edge_list *edge_list, sbitmap *earliest,
/* Computation of insertion and deletion points requires computing LATERIN
for the EXIT block. We allocated an extra entry in the LATERIN array
for just this purpose. */
- sbitmap_ones (laterin[last_basic_block]);
+ bitmap_ones (laterin[last_basic_block]);
FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds)
- sbitmap_a_and_b (laterin[last_basic_block],
+ bitmap_and (laterin[last_basic_block],
laterin[last_basic_block],
later[(size_t) e->aux]);
@@ -352,7 +352,7 @@ compute_insert_delete (struct edge_list *edge_list, sbitmap *antloc,
basic_block bb;
FOR_EACH_BB (bb)
- sbitmap_difference (del[bb->index], antloc[bb->index],
+ bitmap_and_compl (del[bb->index], antloc[bb->index],
laterin[bb->index]);
for (x = 0; x < NUM_EDGES (edge_list); x++)
@@ -360,9 +360,9 @@ compute_insert_delete (struct edge_list *edge_list, sbitmap *antloc,
basic_block b = INDEX_EDGE_SUCC_BB (edge_list, x);
if (b == EXIT_BLOCK_PTR)
- sbitmap_difference (insert[x], later[x], laterin[last_basic_block]);
+ bitmap_and_compl (insert[x], later[x], laterin[last_basic_block]);
else
- sbitmap_difference (insert[x], later[x], laterin[b->index]);
+ bitmap_and_compl (insert[x], later[x], laterin[b->index]);
}
}
@@ -390,10 +390,10 @@ pre_edge_lcm (int n_exprs, sbitmap *transp,
fprintf (dump_file, "Edge List:\n");
verify_edge_list (dump_file, edge_list);
print_edge_list (dump_file, edge_list);
- dump_sbitmap_vector (dump_file, "transp", "", transp, last_basic_block);
- dump_sbitmap_vector (dump_file, "antloc", "", antloc, last_basic_block);
- dump_sbitmap_vector (dump_file, "avloc", "", avloc, last_basic_block);
- dump_sbitmap_vector (dump_file, "kill", "", kill, last_basic_block);
+ dump_bitmap_vector (dump_file, "transp", "", transp, last_basic_block);
+ dump_bitmap_vector (dump_file, "antloc", "", antloc, last_basic_block);
+ dump_bitmap_vector (dump_file, "avloc", "", avloc, last_basic_block);
+ dump_bitmap_vector (dump_file, "kill", "", kill, last_basic_block);
}
#endif
@@ -411,8 +411,8 @@ pre_edge_lcm (int n_exprs, sbitmap *transp,
#ifdef LCM_DEBUG_INFO
if (dump_file)
{
- dump_sbitmap_vector (dump_file, "antin", "", antin, last_basic_block);
- dump_sbitmap_vector (dump_file, "antout", "", antout, last_basic_block);
+ dump_bitmap_vector (dump_file, "antin", "", antin, last_basic_block);
+ dump_bitmap_vector (dump_file, "antout", "", antout, last_basic_block);
}
#endif
@@ -422,7 +422,7 @@ pre_edge_lcm (int n_exprs, sbitmap *transp,
#ifdef LCM_DEBUG_INFO
if (dump_file)
- dump_sbitmap_vector (dump_file, "earliest", "", earliest, num_edges);
+ dump_bitmap_vector (dump_file, "earliest", "", earliest, num_edges);
#endif
sbitmap_vector_free (antout);
@@ -438,8 +438,8 @@ pre_edge_lcm (int n_exprs, sbitmap *transp,
#ifdef LCM_DEBUG_INFO
if (dump_file)
{
- dump_sbitmap_vector (dump_file, "laterin", "", laterin, last_basic_block + 1);
- dump_sbitmap_vector (dump_file, "later", "", later, num_edges);
+ dump_bitmap_vector (dump_file, "laterin", "", laterin, last_basic_block + 1);
+ dump_bitmap_vector (dump_file, "later", "", later, num_edges);
}
#endif
@@ -447,8 +447,8 @@ pre_edge_lcm (int n_exprs, sbitmap *transp,
*insert = sbitmap_vector_alloc (num_edges, n_exprs);
*del = sbitmap_vector_alloc (last_basic_block, n_exprs);
- sbitmap_vector_zero (*insert, num_edges);
- sbitmap_vector_zero (*del, last_basic_block);
+ bitmap_vector_clear (*insert, num_edges);
+ bitmap_vector_clear (*del, last_basic_block);
compute_insert_delete (edge_list, antloc, later, laterin, *insert, *del);
sbitmap_vector_free (laterin);
@@ -457,8 +457,8 @@ pre_edge_lcm (int n_exprs, sbitmap *transp,
#ifdef LCM_DEBUG_INFO
if (dump_file)
{
- dump_sbitmap_vector (dump_file, "pre_insert_map", "", *insert, num_edges);
- dump_sbitmap_vector (dump_file, "pre_delete_map", "", *del,
+ dump_bitmap_vector (dump_file, "pre_insert_map", "", *insert, num_edges);
+ dump_bitmap_vector (dump_file, "pre_delete_map", "", *del,
last_basic_block);
}
#endif
@@ -485,7 +485,7 @@ compute_available (sbitmap *avloc, sbitmap *kill, sbitmap *avout,
XNEWVEC (basic_block, n_basic_blocks - NUM_FIXED_BLOCKS);
/* We want a maximal solution. */
- sbitmap_vector_ones (avout, last_basic_block);
+ bitmap_vector_ones (avout, last_basic_block);
/* Put every block on the worklist; this is necessary because of the
optimistic initialization of AVOUT above. */
@@ -520,7 +520,7 @@ compute_available (sbitmap *avloc, sbitmap *kill, sbitmap *avout,
if (bb->aux == ENTRY_BLOCK_PTR)
/* Do not clear the aux field for blocks which are successors of the
ENTRY block. That way we never add then to the worklist again. */
- sbitmap_zero (avin[bb->index]);
+ bitmap_clear (avin[bb->index]);
else
{
/* Clear the aux field of this block so that it can be added to
@@ -529,7 +529,7 @@ compute_available (sbitmap *avloc, sbitmap *kill, sbitmap *avout,
sbitmap_intersection_of_preds (avin[bb->index], avout, bb);
}
- if (sbitmap_union_of_diff_cg (avout[bb->index], avloc[bb->index],
+ if (bitmap_ior_and_compl (avout[bb->index], avloc[bb->index],
avin[bb->index], kill[bb->index]))
/* If the out state of this block changed, then we need
to add the successors of this block to the worklist
@@ -572,17 +572,17 @@ compute_farthest (struct edge_list *edge_list, int n_exprs,
pred = INDEX_EDGE_PRED_BB (edge_list, x);
succ = INDEX_EDGE_SUCC_BB (edge_list, x);
if (succ == EXIT_BLOCK_PTR)
- sbitmap_copy (farthest[x], st_avout[pred->index]);
+ bitmap_copy (farthest[x], st_avout[pred->index]);
else
{
if (pred == ENTRY_BLOCK_PTR)
- sbitmap_zero (farthest[x]);
+ bitmap_clear (farthest[x]);
else
{
- sbitmap_difference (difference, st_avout[pred->index],
+ bitmap_and_compl (difference, st_avout[pred->index],
st_antin[succ->index]);
- sbitmap_not (temp_bitmap, st_avin[succ->index]);
- sbitmap_a_and_b_or_c (farthest[x], difference,
+ bitmap_not (temp_bitmap, st_avin[succ->index]);
+ bitmap_and_or (farthest[x], difference,
kill[succ->index], temp_bitmap);
}
}
@@ -619,14 +619,14 @@ compute_nearerout (struct edge_list *edge_list, sbitmap *farthest,
INDEX_EDGE (edge_list, i)->aux = (void *) (size_t) i;
/* We want a maximal solution. */
- sbitmap_vector_ones (nearer, num_edges);
+ bitmap_vector_ones (nearer, num_edges);
/* Note that even though we want an optimistic setting of NEARER, we
do not want to be overly optimistic. Consider an incoming edge to
the exit block. That edge should always have a NEARER value the
same as FARTHEST for that edge. */
FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds)
- sbitmap_copy (nearer[(size_t)e->aux], farthest[(size_t)e->aux]);
+ bitmap_copy (nearer[(size_t)e->aux], farthest[(size_t)e->aux]);
/* Add all the blocks to the worklist. This prevents an early exit
from the loop given our optimistic initialization of NEARER. */
@@ -644,14 +644,14 @@ compute_nearerout (struct edge_list *edge_list, sbitmap *farthest,
bb->aux = NULL;
/* Compute the intersection of NEARER for each outgoing edge from B. */
- sbitmap_ones (nearerout[bb->index]);
+ bitmap_ones (nearerout[bb->index]);
FOR_EACH_EDGE (e, ei, bb->succs)
- sbitmap_a_and_b (nearerout[bb->index], nearerout[bb->index],
+ bitmap_and (nearerout[bb->index], nearerout[bb->index],
nearer[(size_t) e->aux]);
/* Calculate NEARER for all incoming edges. */
FOR_EACH_EDGE (e, ei, bb->preds)
- if (sbitmap_union_of_diff_cg (nearer[(size_t) e->aux],
+ if (bitmap_ior_and_compl (nearer[(size_t) e->aux],
farthest[(size_t) e->aux],
nearerout[e->dest->index],
st_avloc[e->dest->index])
@@ -667,9 +667,9 @@ compute_nearerout (struct edge_list *edge_list, sbitmap *farthest,
/* Computation of insertion and deletion points requires computing NEAREROUT
for the ENTRY block. We allocated an extra entry in the NEAREROUT array
for just this purpose. */
- sbitmap_ones (nearerout[last_basic_block]);
+ bitmap_ones (nearerout[last_basic_block]);
FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR->succs)
- sbitmap_a_and_b (nearerout[last_basic_block],
+ bitmap_and (nearerout[last_basic_block],
nearerout[last_basic_block],
nearer[(size_t) e->aux]);
@@ -688,16 +688,16 @@ compute_rev_insert_delete (struct edge_list *edge_list, sbitmap *st_avloc,
basic_block bb;
FOR_EACH_BB (bb)
- sbitmap_difference (del[bb->index], st_avloc[bb->index],
+ bitmap_and_compl (del[bb->index], st_avloc[bb->index],
nearerout[bb->index]);
for (x = 0; x < NUM_EDGES (edge_list); x++)
{
basic_block b = INDEX_EDGE_PRED_BB (edge_list, x);
if (b == ENTRY_BLOCK_PTR)
- sbitmap_difference (insert[x], nearer[x], nearerout[last_basic_block]);
+ bitmap_and_compl (insert[x], nearer[x], nearerout[last_basic_block]);
else
- sbitmap_difference (insert[x], nearer[x], nearerout[b->index]);
+ bitmap_and_compl (insert[x], nearer[x], nearerout[b->index]);
}
}
@@ -722,8 +722,8 @@ pre_edge_rev_lcm (int n_exprs, sbitmap *transp,
st_antin = sbitmap_vector_alloc (last_basic_block, n_exprs);
st_antout = sbitmap_vector_alloc (last_basic_block, n_exprs);
- sbitmap_vector_zero (st_antin, last_basic_block);
- sbitmap_vector_zero (st_antout, last_basic_block);
+ bitmap_vector_clear (st_antin, last_basic_block);
+ bitmap_vector_clear (st_antout, last_basic_block);
compute_antinout_edge (st_antloc, transp, st_antin, st_antout);
/* Compute global anticipatability. */
@@ -737,20 +737,20 @@ pre_edge_rev_lcm (int n_exprs, sbitmap *transp,
fprintf (dump_file, "Edge List:\n");
verify_edge_list (dump_file, edge_list);
print_edge_list (dump_file, edge_list);
- dump_sbitmap_vector (dump_file, "transp", "", transp, last_basic_block);
- dump_sbitmap_vector (dump_file, "st_avloc", "", st_avloc, last_basic_block);
- dump_sbitmap_vector (dump_file, "st_antloc", "", st_antloc, last_basic_block);
- dump_sbitmap_vector (dump_file, "st_antin", "", st_antin, last_basic_block);
- dump_sbitmap_vector (dump_file, "st_antout", "", st_antout, last_basic_block);
- dump_sbitmap_vector (dump_file, "st_kill", "", kill, last_basic_block);
+ dump_bitmap_vector (dump_file, "transp", "", transp, last_basic_block);
+ dump_bitmap_vector (dump_file, "st_avloc", "", st_avloc, last_basic_block);
+ dump_bitmap_vector (dump_file, "st_antloc", "", st_antloc, last_basic_block);
+ dump_bitmap_vector (dump_file, "st_antin", "", st_antin, last_basic_block);
+ dump_bitmap_vector (dump_file, "st_antout", "", st_antout, last_basic_block);
+ dump_bitmap_vector (dump_file, "st_kill", "", kill, last_basic_block);
}
#endif
#ifdef LCM_DEBUG_INFO
if (dump_file)
{
- dump_sbitmap_vector (dump_file, "st_avout", "", st_avout, last_basic_block);
- dump_sbitmap_vector (dump_file, "st_avin", "", st_avin, last_basic_block);
+ dump_bitmap_vector (dump_file, "st_avout", "", st_avout, last_basic_block);
+ dump_bitmap_vector (dump_file, "st_avin", "", st_avin, last_basic_block);
}
#endif
@@ -761,7 +761,7 @@ pre_edge_rev_lcm (int n_exprs, sbitmap *transp,
#ifdef LCM_DEBUG_INFO
if (dump_file)
- dump_sbitmap_vector (dump_file, "farthest", "", farthest, num_edges);
+ dump_bitmap_vector (dump_file, "farthest", "", farthest, num_edges);
#endif
sbitmap_vector_free (st_antin);
@@ -779,9 +779,9 @@ pre_edge_rev_lcm (int n_exprs, sbitmap *transp,
#ifdef LCM_DEBUG_INFO
if (dump_file)
{
- dump_sbitmap_vector (dump_file, "nearerout", "", nearerout,
+ dump_bitmap_vector (dump_file, "nearerout", "", nearerout,
last_basic_block + 1);
- dump_sbitmap_vector (dump_file, "nearer", "", nearer, num_edges);
+ dump_bitmap_vector (dump_file, "nearer", "", nearer, num_edges);
}
#endif
@@ -798,8 +798,8 @@ pre_edge_rev_lcm (int n_exprs, sbitmap *transp,
#ifdef LCM_DEBUG_INFO
if (dump_file)
{
- dump_sbitmap_vector (dump_file, "pre_insert_map", "", *insert, num_edges);
- dump_sbitmap_vector (dump_file, "pre_delete_map", "", *del,
+ dump_bitmap_vector (dump_file, "pre_insert_map", "", *insert, num_edges);
+ dump_bitmap_vector (dump_file, "pre_delete_map", "", *del,
last_basic_block);
}
#endif
diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c
index 92e3c1a127c..9506b3d6bbe 100644
--- a/gcc/loop-unroll.c
+++ b/gcc/loop-unroll.c
@@ -215,7 +215,7 @@ loop_exit_at_end_p (struct loop *loop)
/* Check that the latch is empty. */
FOR_BB_INSNS (loop->latch, insn)
{
- if (INSN_P (insn))
+ if (NONDEBUG_INSN_P (insn))
return false;
}
@@ -465,7 +465,7 @@ peel_loop_completely (struct loop *loop)
bool ok;
wont_exit = sbitmap_alloc (npeel + 1);
- sbitmap_ones (wont_exit);
+ bitmap_ones (wont_exit);
RESET_BIT (wont_exit, 0);
if (desc->noloop_assumptions)
RESET_BIT (wont_exit, 1);
@@ -655,7 +655,7 @@ unroll_loop_constant_iterations (struct loop *loop)
exit_mod = niter % (max_unroll + 1);
wont_exit = sbitmap_alloc (max_unroll + 1);
- sbitmap_ones (wont_exit);
+ bitmap_ones (wont_exit);
remove_edges = NULL;
if (flag_split_ivs_in_unroller
@@ -1066,7 +1066,7 @@ unroll_loop_runtime_iterations (struct loop *loop)
here; the only exception is when we have extra zero check and the number
of iterations is reliable. Also record the place of (possible) extra
zero check. */
- sbitmap_zero (wont_exit);
+ bitmap_clear (wont_exit);
if (extra_zero_check
&& !desc->noloop_assumptions)
SET_BIT (wont_exit, 1);
@@ -1083,7 +1083,7 @@ unroll_loop_runtime_iterations (struct loop *loop)
for (i = 0; i < n_peel; i++)
{
/* Peel the copy. */
- sbitmap_zero (wont_exit);
+ bitmap_clear (wont_exit);
if (i != n_peel - 1 || !last_may_exit)
SET_BIT (wont_exit, 1);
ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
@@ -1139,7 +1139,7 @@ unroll_loop_runtime_iterations (struct loop *loop)
/* And unroll loop. */
- sbitmap_ones (wont_exit);
+ bitmap_ones (wont_exit);
RESET_BIT (wont_exit, may_exit_copy);
opt_info_start_duplication (opt_info);
@@ -1340,7 +1340,7 @@ peel_loop_simple (struct loop *loop)
opt_info = analyze_insns_in_loop (loop);
wont_exit = sbitmap_alloc (npeel + 1);
- sbitmap_zero (wont_exit);
+ bitmap_clear (wont_exit);
opt_info_start_duplication (opt_info);
@@ -1498,7 +1498,7 @@ unroll_loop_stupid (struct loop *loop)
wont_exit = sbitmap_alloc (nunroll + 1);
- sbitmap_zero (wont_exit);
+ bitmap_clear (wont_exit);
opt_info_start_duplication (opt_info);
ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop),
diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c
index ab4ca36cdcb..06c0b577a02 100644
--- a/gcc/lower-subreg.c
+++ b/gcc/lower-subreg.c
@@ -1485,7 +1485,7 @@ decompose_multiword_subregs (bool decompose_copies)
propagate_pseudo_copies ();
sub_blocks = sbitmap_alloc (last_basic_block);
- sbitmap_zero (sub_blocks);
+ bitmap_clear (sub_blocks);
EXECUTE_IF_SET_IN_BITMAP (decomposable_context, 0, regno, iter)
decompose_register (regno);
diff --git a/gcc/lra-assigns.c b/gcc/lra-assigns.c
index b957563716f..c558a4d2ca3 100644
--- a/gcc/lra-assigns.c
+++ b/gcc/lra-assigns.c
@@ -149,7 +149,7 @@ init_regno_assign_info (void)
{
int i, regno1, regno2, max_regno = max_reg_num ();
lra_copy_t cp;
-
+
regno_assign_info = XNEWVEC (struct regno_assign_info, max_regno);
for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
{
@@ -185,10 +185,10 @@ reload_pseudo_compare_func (const void *v1p, const void *v2p)
enum reg_class cl1 = regno_allocno_class_array[r1];
enum reg_class cl2 = regno_allocno_class_array[r2];
int diff;
-
+
lra_assert (r1 >= lra_constraint_new_regno_start
&& r2 >= lra_constraint_new_regno_start);
-
+
/* Prefer to assign reload registers with smaller classes first to
guarantee assignment to all reload registers. */
if ((diff = (ira_class_hard_regs_num[cl1]
@@ -217,7 +217,7 @@ pseudo_compare_func (const void *v1p, const void *v2p)
/* Prefer to assign more frequently used registers first. */
if ((diff = lra_reg_info[r2].freq - lra_reg_info[r1].freq) != 0)
return diff;
-
+
/* If regs are equally good, sort by their numbers, so that the
results of qsort leave nothing to chance. */
return r1 - r2;
@@ -378,7 +378,7 @@ init_live_reload_and_inheritance_pseudos (void)
{
int i, p, max_regno = max_reg_num ();
lra_live_range_t r;
-
+
conflict_reload_and_inheritance_pseudos = sparseset_alloc (max_regno);
live_reload_and_inheritance_pseudos = XNEWVEC (bitmap_head, lra_live_max_point);
bitmap_obstack_initialize (&live_reload_and_inheritance_pseudos_bitmap_obstack);
@@ -470,7 +470,7 @@ find_hard_regno_for (int regno, int *cost, int try_only_hard_regno)
for (p = r->start + 1; p <= r->finish; p++)
{
lra_live_range_t r2;
-
+
for (r2 = start_point_ranges[p];
r2 != NULL;
r2 = r2->start_next)
@@ -511,7 +511,7 @@ find_hard_regno_for (int regno, int *cost, int try_only_hard_regno)
[lra_reg_info[conflict_regno].biggest_mode]);
/* Remember about multi-register pseudos. For example, 2 hard
register pseudos can start on the same hard register but can
- not start on HR and HR+1/HR-1. */
+ not start on HR and HR+1/HR-1. */
for (hr = conflict_hr + 1;
hr < FIRST_PSEUDO_REGISTER && hr < conflict_hr + nregs;
hr++)
@@ -571,15 +571,12 @@ find_hard_regno_for (int regno, int *cost, int try_only_hard_regno)
&& HARD_REGNO_MODE_OK (hard_regno, PSEUDO_REGNO_MODE (regno))
&& ! TEST_HARD_REG_BIT (impossible_start_hard_regs, hard_regno)
&& (nregs_diff == 0
-#ifdef WORDS_BIG_ENDIAN
- || (hard_regno - nregs_diff >= 0
- && TEST_HARD_REG_BIT (reg_class_contents[rclass],
- hard_regno - nregs_diff))
-#else
- || TEST_HARD_REG_BIT (reg_class_contents[rclass],
- hard_regno + nregs_diff)
-#endif
- ))
+ || (WORDS_BIG_ENDIAN
+ ? (hard_regno - nregs_diff >= 0
+ && TEST_HARD_REG_BIT (reg_class_contents[rclass],
+ hard_regno - nregs_diff))
+ : TEST_HARD_REG_BIT (reg_class_contents[rclass],
+ hard_regno + nregs_diff))))
{
if (hard_regno_costs_check[hard_regno]
!= curr_hard_regno_costs_check)
@@ -813,7 +810,7 @@ spill_for (int regno, bitmap spilled_pseudo_bitmap)
EXECUTE_IF_SET_IN_BITMAP (&lra_reg_info[regno].insn_bitmap, 0, uid, bi)
{
struct lra_insn_reg *ir;
-
+
for (ir = lra_get_insn_regs (uid); ir != NULL; ir = ir->next)
if (ir->regno >= FIRST_PSEUDO_REGISTER)
bitmap_set_bit (&insn_conflict_pseudos, ir->regno);
@@ -870,7 +867,7 @@ spill_for (int regno, bitmap spilled_pseudo_bitmap)
for (p = r->start; p <= r->finish; p++)
{
lra_live_range_t r2;
-
+
for (r2 = start_point_ranges[p];
r2 != NULL;
r2 = r2->start_next)
@@ -916,7 +913,7 @@ spill_for (int regno, bitmap spilled_pseudo_bitmap)
EXECUTE_IF_SET_IN_BITMAP (&spill_pseudos_bitmap, 0, spill_regno, bi)
{
rtx x;
-
+
cost += lra_reg_info[spill_regno].freq;
if (ira_reg_equiv[spill_regno].memory != NULL
|| ira_reg_equiv[spill_regno].constant != NULL)
@@ -1041,7 +1038,7 @@ setup_live_pseudos_and_spill_after_risky_transforms (bitmap
for (p = r->start + 1; p <= r->finish; p++)
{
lra_live_range_t r2;
-
+
for (r2 = start_point_ranges[p];
r2 != NULL;
r2 = r2->start_next)
@@ -1159,6 +1156,7 @@ assign_by_spills (void)
bitmap_head non_reload_pseudos;
unsigned int u;
bitmap_iterator bi;
+ bool reload_p;
int max_regno = max_reg_num ();
for (n = 0, i = lra_constraint_new_regno_start; i < max_regno; i++)
@@ -1193,12 +1191,12 @@ assign_by_spills (void)
lra_reg_info[regno].freq, regno_assign_info[regno].first,
regno_assign_info[regno_assign_info[regno].first].freq);
hard_regno = find_hard_regno_for (regno, &cost, -1);
- if (hard_regno < 0
- && ! bitmap_bit_p (&non_reload_pseudos, regno))
+ reload_p = ! bitmap_bit_p (&non_reload_pseudos, regno);
+ if (hard_regno < 0 && reload_p)
hard_regno = spill_for (regno, &all_spilled_pseudos);
if (hard_regno < 0)
{
- if (! bitmap_bit_p (&non_reload_pseudos, regno))
+ if (reload_p)
sorted_pseudos[nfails++] = regno;
}
else
@@ -1207,6 +1205,11 @@ assign_by_spills (void)
pass. Indicate that it is no longer spilled. */
bitmap_clear_bit (&all_spilled_pseudos, regno);
assign_hard_regno (hard_regno, regno);
+ if (! reload_p)
+ /* As non-reload pseudo assignment is changed we
+ should reconsider insns referring for the
+ pseudo. */
+ bitmap_set_bit (&changed_pseudo_bitmap, regno);
}
}
if (nfails == 0)
@@ -1236,7 +1239,7 @@ assign_by_spills (void)
{
lra_insn_recog_data_t data;
struct lra_insn_reg *r;
-
+
data = lra_get_insn_recog_data (insn);
for (r = data->regs; r != NULL; r = r->next)
{
@@ -1308,9 +1311,9 @@ assign_by_spills (void)
if (hard_regno >= 0)
{
assign_hard_regno (hard_regno, regno);
- /* We change allocation for non-reload pseudo on this
- iteration -- mark the pseudo for invalidation of used
- alternatives of insns containing the pseudo. */
+ /* We change allocation for non-reload pseudo on this
+ iteration -- mark the pseudo for invalidation of used
+ alternatives of insns containing the pseudo. */
bitmap_set_bit (&changed_pseudo_bitmap, regno);
}
}
diff --git a/gcc/lra-coalesce.c b/gcc/lra-coalesce.c
index 57c3111b922..6b5c3f0800c 100644
--- a/gcc/lra-coalesce.c
+++ b/gcc/lra-coalesce.c
@@ -79,7 +79,7 @@ move_freq_compare_func (const void *v1p, const void *v2p)
rtx mv1 = *(const rtx *) v1p;
rtx mv2 = *(const rtx *) v2p;
int pri1, pri2;
-
+
pri1 = BLOCK_FOR_INSN (mv1)->frequency;
pri2 = BLOCK_FOR_INSN (mv2)->frequency;
if (pri2 - pri1)
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index 4b357261bbe..7f19ad1f43c 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -87,7 +87,7 @@
r <- ... or ... <- r r <- ... or ... <- r
... s <- r (new insn -- save)
- ... =>
+ ... =>
... r <- s (new insn -- restore)
... <- r ... <- r
@@ -152,6 +152,13 @@ static enum machine_mode curr_operand_mode[MAX_RECOG_OPERANDS];
static int new_regno_start;
static int new_insn_uid_start;
+/* If LOC is nonnull, strip any outer subreg from it. */
+static inline rtx *
+strip_subreg (rtx *loc)
+{
+ return loc && GET_CODE (*loc) == SUBREG ? &SUBREG_REG (*loc) : loc;
+}
+
/* Return hard regno of REGNO or if it is was not assigned to a hard
register, use a hard register from its allocno class. */
static int
@@ -243,14 +250,14 @@ in_class_p (rtx reg, enum reg_class cl, enum reg_class *new_class)
enum machine_mode reg_mode;
int class_size, hard_regno, nregs, i, j;
int regno = REGNO (reg);
-
+
if (new_class != NULL)
*new_class = NO_REGS;
if (regno < FIRST_PSEUDO_REGISTER)
{
rtx final_reg = reg;
rtx *final_loc = &final_reg;
-
+
lra_eliminate_reg_if_possible (final_loc);
return TEST_HARD_REG_BIT (reg_class_contents[cl], REGNO (*final_loc));
}
@@ -435,34 +442,12 @@ get_reload_reg (enum op_type type, enum machine_mode mode, rtx original,
/* The page contains code to extract memory address parts. */
-/* Info about base and index regs of an address. In some rare cases,
- base/index register can be actually memory. In this case we will
- reload it. */
-struct address
-{
- /* NULL if there is no a base register. */
- rtx *base_reg_loc;
- /* Second location of {post/pre}_modify, NULL otherwise. */
- rtx *base_reg_loc2;
- /* NULL if there is no an index register. */
- rtx *index_reg_loc;
- /* Location of index reg * scale or index_reg_loc otherwise. */
- rtx *index_loc;
- /* NULL if there is no a displacement. */
- rtx *disp_loc;
- /* Defined if base_reg_loc is not NULL. */
- enum rtx_code base_outer_code, index_code;
- /* True if the base register is modified in the address, for
- example, in PRE_INC. */
- bool base_modify_p;
-};
-
/* Wrapper around REGNO_OK_FOR_INDEX_P, to allow pseudos. */
static inline bool
ok_for_index_p_nonstrict (rtx reg)
{
unsigned regno = REGNO (reg);
-
+
return regno >= FIRST_PSEUDO_REGISTER || REGNO_OK_FOR_INDEX_P (regno);
}
@@ -479,283 +464,6 @@ ok_for_base_p_nonstrict (rtx reg, enum machine_mode mode, addr_space_t as,
return ok_for_base_p_1 (regno, mode, as, outer_code, index_code);
}
-/* Process address part in space AS (or all address if TOP_P) with
- location *LOC to extract address characteristics.
-
- If CONTEXT_P is false, we are looking at the base part of an
- address, otherwise we are looking at the index part.
-
- MODE is the mode of the memory reference; OUTER_CODE and INDEX_CODE
- give the context that the rtx appears in; MODIFY_P if *LOC is
- modified. */
-static void
-extract_loc_address_regs (bool top_p, enum machine_mode mode, addr_space_t as,
- rtx *loc, bool context_p, enum rtx_code outer_code,
- enum rtx_code index_code,
- bool modify_p, struct address *ad)
-{
- rtx x = *loc;
- enum rtx_code code = GET_CODE (x);
- bool base_ok_p;
-
- switch (code)
- {
- case CONST_INT:
- case CONST:
- case SYMBOL_REF:
- case LABEL_REF:
- if (! context_p)
- {
- lra_assert (top_p);
- ad->disp_loc = loc;
- }
- return;
-
- case CC0:
- case PC:
- return;
-
- case ZERO_EXTEND:
- /* Pass TOP_P for displacement. */
- extract_loc_address_regs (top_p, mode, as, &XEXP (*loc, 0), context_p,
- code, index_code, modify_p, ad);
- return;
-
- case PLUS:
- case LO_SUM:
- /* When we have an address that is a sum, we must determine
- whether registers are "base" or "index" regs. If there is a
- sum of two registers, we must choose one to be the
- "base". */
- {
- rtx *arg0_loc = &XEXP (x, 0);
- rtx *arg1_loc = &XEXP (x, 1);
- rtx *tloc;
- rtx arg0 = *arg0_loc;
- rtx arg1 = *arg1_loc;
- enum rtx_code code0 = GET_CODE (arg0);
- enum rtx_code code1 = GET_CODE (arg1);
-
- /* Look inside subregs. */
- if (code0 == SUBREG)
- {
- arg0_loc = &SUBREG_REG (arg0);
- arg0 = *arg0_loc;
- code0 = GET_CODE (arg0);
- }
- if (code1 == SUBREG)
- {
- arg1_loc = &SUBREG_REG (arg1);
- arg1 = *arg1_loc;
- code1 = GET_CODE (arg1);
- }
-
- if (CONSTANT_P (arg0)
- || code1 == PLUS || code1 == MULT || code1 == ASHIFT)
- {
- tloc = arg1_loc;
- arg1_loc = arg0_loc;
- arg0_loc = tloc;
- arg0 = *arg0_loc;
- code0 = GET_CODE (arg0);
- arg1 = *arg1_loc;
- code1 = GET_CODE (arg1);
- }
- /* If this machine only allows one register per address, it
- must be in the first operand. */
- if (MAX_REGS_PER_ADDRESS == 1 || code == LO_SUM)
- {
- lra_assert (ad->disp_loc == NULL);
- ad->disp_loc = arg1_loc;
- extract_loc_address_regs (false, mode, as, arg0_loc, false, code,
- code1, modify_p, ad);
- }
- /* Base + disp addressing */
- else if (code0 != PLUS && code0 != MULT && code0 != ASHIFT
- && CONSTANT_P (arg1))
- {
- lra_assert (ad->disp_loc == NULL);
- ad->disp_loc = arg1_loc;
- extract_loc_address_regs (false, mode, as, arg0_loc, false, PLUS,
- code1, modify_p, ad);
- }
- /* If index and base registers are the same on this machine,
- just record registers in any non-constant operands. We
- assume here, as well as in the tests below, that all
- addresses are in canonical form. */
- else if (INDEX_REG_CLASS
- == base_reg_class (VOIDmode, as, PLUS, SCRATCH)
- && code0 != PLUS && code0 != MULT && code0 != ASHIFT)
- {
- extract_loc_address_regs (false, mode, as, arg0_loc, false, PLUS,
- code1, modify_p, ad);
- lra_assert (! CONSTANT_P (arg1));
- extract_loc_address_regs (false, mode, as, arg1_loc, true, PLUS,
- code0, modify_p, ad);
- }
- /* It might be [base + ]index * scale + disp. */
- else if (CONSTANT_P (arg1))
- {
- lra_assert (ad->disp_loc == NULL);
- ad->disp_loc = arg1_loc;
- extract_loc_address_regs (false, mode, as, arg0_loc, context_p,
- PLUS, code0, modify_p, ad);
- }
- /* If both operands are registers but one is already a hard
- register of index or reg-base class, give the other the
- class that the hard register is not. */
- else if (code0 == REG && code1 == REG
- && REGNO (arg0) < FIRST_PSEUDO_REGISTER
- && ((base_ok_p
- = ok_for_base_p_nonstrict (arg0, mode, as, PLUS, REG))
- || ok_for_index_p_nonstrict (arg0)))
- {
- extract_loc_address_regs (false, mode, as, arg0_loc, ! base_ok_p,
- PLUS, REG, modify_p, ad);
- extract_loc_address_regs (false, mode, as, arg1_loc, base_ok_p,
- PLUS, REG, modify_p, ad);
- }
- else if (code0 == REG && code1 == REG
- && REGNO (arg1) < FIRST_PSEUDO_REGISTER
- && ((base_ok_p
- = ok_for_base_p_nonstrict (arg1, mode, as, PLUS, REG))
- || ok_for_index_p_nonstrict (arg1)))
- {
- extract_loc_address_regs (false, mode, as, arg0_loc, base_ok_p,
- PLUS, REG, modify_p, ad);
- extract_loc_address_regs (false, mode, as, arg1_loc, ! base_ok_p,
- PLUS, REG, modify_p, ad);
- }
- /* Otherwise, count equal chances that each might be a base or
- index register. This case should be rare. */
- else
- {
- extract_loc_address_regs (false, mode, as, arg0_loc, false, PLUS,
- code1, modify_p, ad);
- extract_loc_address_regs (false, mode, as, arg1_loc,
- ad->base_reg_loc != NULL, PLUS,
- code0, modify_p, ad);
- }
- }
- break;
-
- case MULT:
- case ASHIFT:
- {
- rtx *arg0_loc = &XEXP (x, 0);
- enum rtx_code code0 = GET_CODE (*arg0_loc);
-
- if (code0 == CONST_INT)
- arg0_loc = &XEXP (x, 1);
- extract_loc_address_regs (false, mode, as, arg0_loc, true,
- outer_code, code, modify_p, ad);
- lra_assert (ad->index_loc == NULL);
- ad->index_loc = loc;
- break;
- }
-
- case POST_MODIFY:
- case PRE_MODIFY:
- extract_loc_address_regs (false, mode, as, &XEXP (x, 0), false,
- code, GET_CODE (XEXP (XEXP (x, 1), 1)),
- true, ad);
- lra_assert (rtx_equal_p (XEXP (XEXP (x, 1), 0), XEXP (x, 0)));
- ad->base_reg_loc2 = &XEXP (XEXP (x, 1), 0);
- if (REG_P (XEXP (XEXP (x, 1), 1)))
- extract_loc_address_regs (false, mode, as, &XEXP (XEXP (x, 1), 1),
- true, code, REG, modify_p, ad);
- break;
-
- case POST_INC:
- case PRE_INC:
- case POST_DEC:
- case PRE_DEC:
- extract_loc_address_regs (false, mode, as, &XEXP (x, 0), false, code,
- SCRATCH, true, ad);
- break;
-
- /* We process memory as a register. That means we flatten
- addresses. In other words, the final code will never
- contains memory in an address even if the target supports
- such addresses (it is too rare these days). Memory also can
- occur in address as a result some previous transformations
- like equivalence substitution. */
- case MEM:
- case REG:
- if (context_p)
- {
- lra_assert (ad->index_reg_loc == NULL);
- ad->index_reg_loc = loc;
- }
- else
- {
- lra_assert (ad->base_reg_loc == NULL);
- ad->base_reg_loc = loc;
- ad->base_outer_code = outer_code;
- ad->index_code = index_code;
- ad->base_modify_p = modify_p;
- }
- break;
- default:
- {
- const char *fmt = GET_RTX_FORMAT (code);
- int i;
-
- if (GET_RTX_LENGTH (code) != 1
- || fmt[0] != 'e' || GET_CODE (XEXP (x, 0)) != UNSPEC)
- {
- for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
- if (fmt[i] == 'e')
- extract_loc_address_regs (false, mode, as, &XEXP (x, i),
- context_p, code, SCRATCH,
- modify_p, ad);
- break;
- }
- /* fall through for case UNARY_OP (UNSPEC ...) */
- }
-
- case UNSPEC:
- if (ad->disp_loc == NULL)
- ad->disp_loc = loc;
- else if (ad->base_reg_loc == NULL)
- {
- ad->base_reg_loc = loc;
- ad->base_outer_code = outer_code;
- ad->index_code = index_code;
- ad->base_modify_p = modify_p;
- }
- else
- {
- lra_assert (ad->index_reg_loc == NULL);
- ad->index_reg_loc = loc;
- }
- break;
-
- }
-}
-
-
-/* Describe address *LOC in AD. There are two cases:
- - *LOC is the address in a (mem ...). In this case OUTER_CODE is MEM
- and AS is the mem's address space.
- - *LOC is matched to an address constraint such as 'p'. In this case
- OUTER_CODE is ADDRESS and AS is ADDR_SPACE_GENERIC. */
-static void
-extract_address_regs (enum machine_mode mem_mode, addr_space_t as,
- rtx *loc, enum rtx_code outer_code, struct address *ad)
-{
- ad->base_reg_loc = ad->base_reg_loc2
- = ad->index_reg_loc = ad->index_loc = ad->disp_loc = NULL;
- ad->base_outer_code = SCRATCH;
- ad->index_code = SCRATCH;
- ad->base_modify_p = false;
- extract_loc_address_regs (true, mem_mode, as, loc, false, outer_code,
- SCRATCH, false, ad);
- if (ad->index_loc == NULL)
- /* SUBREG ??? */
- ad->index_loc = ad->index_reg_loc;
-}
-
/* The page contains major code to choose the current insn alternative
@@ -802,7 +510,7 @@ operands_match_p (rtx x, rtx y, int y_hard_regno)
&& (REG_P (y) || (GET_CODE (y) == SUBREG && REG_P (SUBREG_REG (y)))))
{
int j;
-
+
i = get_hard_regno (x);
if (i < 0)
goto slow;
@@ -830,7 +538,7 @@ operands_match_p (rtx x, rtx y, int y_hard_regno)
if (GET_CODE (y) == PRE_DEC || GET_CODE (y) == PRE_INC
|| GET_CODE (y) == PRE_MODIFY)
return operands_match_p (x, XEXP (y, 0), -1);
-
+
slow:
if (code == REG && GET_CODE (y) == SUBREG && REG_P (SUBREG_REG (y))
@@ -955,7 +663,7 @@ match_reload (signed char out, signed char *ins, enum reg_class goal_class,
rtx *before, rtx *after)
{
int i, in;
- rtx new_in_reg, new_out_reg, reg;
+ rtx new_in_reg, new_out_reg, reg, clobber;
enum machine_mode inmode, outmode;
rtx in_rtx = *curr_id->operand_loc[ins[0]];
rtx out_rtx = *curr_id->operand_loc[out];
@@ -986,8 +694,10 @@ match_reload (signed char out, signed char *ins, enum reg_class goal_class,
new_in_reg = gen_rtx_SUBREG (inmode, reg, 0);
/* NEW_IN_REG is non-paradoxical subreg. We don't want
NEW_OUT_REG living above. We add clobber clause for
- this. */
- emit_clobber (new_out_reg);
+ this. This is just a temporary clobber. We can remove
+ it at the end of LRA work. */
+ clobber = emit_clobber (new_out_reg);
+ LRA_TEMP_CLOBBER_P (PATTERN (clobber)) = 1;
}
}
else
@@ -1001,13 +711,13 @@ match_reload (signed char out, signed char *ins, enum reg_class goal_class,
pseudo which is wrong when the input pseudo lives after the
insn and as the new pseudo value is changed by the insn
output. Therefore we create the new pseudo from the output.
-
+
We cannot reuse the current output register because we might
have a situation like "a <- a op b", where the constraints
force the second input operand ("b") to match the output
operand ("a"). "b" must then be copied into a new register
so that it doesn't clobber the current value of "a". */
-
+
new_in_reg = new_out_reg
= lra_create_new_reg_with_unique_value (outmode, out_rtx,
goal_class, "");
@@ -1063,12 +773,12 @@ reg_class_from_constraints (const char *p)
[op_class][base_reg_class (VOIDmode, ADDR_SPACE_GENERIC,
ADDRESS, SCRATCH)]);
break;
-
+
case 'g':
case 'r':
op_class = reg_class_subunion[op_class][GENERAL_REGS];
break;
-
+
default:
if (REG_CLASS_FROM_CONSTRAINT (c, p) == NO_REGS)
{
@@ -1081,7 +791,7 @@ reg_class_from_constraints (const char *p)
#endif
break;
}
-
+
op_class
= reg_class_subunion[op_class][REG_CLASS_FROM_CONSTRAINT (c, p)];
break;
@@ -1204,10 +914,8 @@ check_and_process_move (bool *change_p, bool *sec_mem_p)
|| ((secondary_class != NO_REGS || sri.icode != CODE_FOR_nothing)
&& dclass != NO_REGS))
{
-#if ENABLE_ASSERT_CHECKING
enum reg_class old_sclass = secondary_class;
secondary_reload_info old_sri = sri;
-#endif
sri.prev_sri = NULL;
sri.icode = CODE_FOR_nothing;
@@ -1334,11 +1042,13 @@ process_addr_reg (rtx *loc, rtx *before, rtx *after, enum reg_class cl)
{
int regno;
enum reg_class rclass, new_class;
- rtx reg = *loc;
+ rtx reg;
rtx new_reg;
enum machine_mode mode;
bool before_p = false;
+ loc = strip_subreg (loc);
+ reg = *loc;
mode = GET_MODE (reg);
if (! REG_P (reg))
{
@@ -1397,10 +1107,6 @@ process_addr_reg (rtx *loc, rtx *before, rtx *after, enum reg_class cl)
return true;
}
-#ifndef SLOW_UNALIGNED_ACCESS
-#define SLOW_UNALIGNED_ACCESS(mode, align) 0
-#endif
-
/* Make reloads for subreg in operand NOP with internal subreg mode
REG_MODE, add new reloads for further processing. Return true if
any reload was generated. */
@@ -1417,15 +1123,14 @@ simplify_operand_subreg (int nop, enum machine_mode reg_mode)
if (GET_CODE (operand) != SUBREG)
return false;
-
+
mode = GET_MODE (operand);
reg = SUBREG_REG (operand);
/* If we change address for paradoxical subreg of memory, the
address might violate the necessary alignment or the access might
be slow. So take this into consideration. */
if ((MEM_P (reg)
- && ((! STRICT_ALIGNMENT
- && ! SLOW_UNALIGNED_ACCESS (mode, MEM_ALIGN (reg)))
+ && (! SLOW_UNALIGNED_ACCESS (mode, MEM_ALIGN (reg))
|| MEM_ALIGN (reg) >= GET_MODE_ALIGNMENT (mode)))
|| (REG_P (reg) && REGNO (reg) < FIRST_PSEUDO_REGISTER))
{
@@ -1509,7 +1214,7 @@ uses_hard_regs_p (rtx x, HARD_REG_SET set)
if (GET_MODE_SIZE (GET_MODE (x)) > GET_MODE_SIZE (mode))
mode = GET_MODE (x);
}
-
+
if (REG_P (x))
{
x_hard_regno = get_hard_regno (x);
@@ -1518,21 +1223,13 @@ uses_hard_regs_p (rtx x, HARD_REG_SET set)
}
if (MEM_P (x))
{
- struct address ad;
- enum machine_mode mode = GET_MODE (x);
- rtx *addr_loc = &XEXP (x, 0);
+ struct address_info ad;
- extract_address_regs (mode, MEM_ADDR_SPACE (x), addr_loc, MEM, &ad);
- if (ad.base_reg_loc != NULL)
- {
- if (uses_hard_regs_p (*ad.base_reg_loc, set))
- return true;
- }
- if (ad.index_reg_loc != NULL)
- {
- if (uses_hard_regs_p (*ad.index_reg_loc, set))
- return true;
- }
+ decompose_mem_address (&ad, x);
+ if (ad.base_term != NULL && uses_hard_regs_p (*ad.base_term, set))
+ return true;
+ if (ad.index_term != NULL && uses_hard_regs_p (*ad.index_term, set))
+ return true;
}
fmt = GET_RTX_FORMAT (code);
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
@@ -1627,7 +1324,7 @@ process_alt_operands (int only_alternative)
op = no_subreg_reg_operand[nop] = *curr_id->operand_loc[nop];
/* The real hard regno of the operand after the allocation. */
hard_regno[nop] = get_hard_regno (op);
-
+
operand_reg[nop] = op;
biggest_mode[nop] = GET_MODE (operand_reg[nop]);
if (GET_CODE (operand_reg[nop]) == SUBREG)
@@ -1700,16 +1397,16 @@ process_alt_operands (int only_alternative)
curr_alt_matches[nop] = -1;
continue;
}
-
+
op = no_subreg_reg_operand[nop];
mode = curr_operand_mode[nop];
win = did_match = winreg = offmemok = constmemok = false;
badop = true;
-
+
early_clobber_p = false;
p = curr_static_id->operand_alternative[opalt_num].constraint;
-
+
this_costly_alternative = this_alternative = NO_REGS;
/* We update set of possible hard regs besides its class
because reg class might be inaccurate. For example,
@@ -1722,11 +1419,11 @@ process_alt_operands (int only_alternative)
this_alternative_match_win = false;
this_alternative_offmemok = false;
this_alternative_matches = -1;
-
+
/* An empty constraint should be excluded by the fast
track. */
lra_assert (*p != 0 && *p != ',');
-
+
/* Scan this alternative's specs for this operand; set WIN
if the operand fits any letter in this alternative.
Otherwise, clear BADOP if this operand could fit some
@@ -1744,36 +1441,36 @@ process_alt_operands (int only_alternative)
case ',':
c = '\0';
break;
-
+
case '=': case '+': case '?': case '*': case '!':
case ' ': case '\t':
break;
-
+
case '%':
/* We only support one commutative marker, the first
one. We already set commutative above. */
break;
-
+
case '&':
early_clobber_p = true;
break;
-
+
case '#':
/* Ignore rest of this alternative. */
c = '\0';
break;
-
+
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
{
int m_hregno;
bool match_p;
-
+
m = strtoul (p, &end, 10);
p = end;
len = 0;
lra_assert (nop > m);
-
+
this_alternative_matches = m;
m_hregno = get_hard_regno (*curr_id->operand_loc[m]);
/* We are supposed to match a previous operand.
@@ -1809,7 +1506,7 @@ process_alt_operands (int only_alternative)
&& MEM_P (*curr_id->operand_loc[m])
&& curr_alt[m] == NO_REGS && ! curr_alt_win[m])
continue;
-
+
}
else
{
@@ -1831,7 +1528,7 @@ process_alt_operands (int only_alternative)
+= (ira_reg_class_max_nregs[curr_alt[m]]
[GET_MODE (*curr_id->operand_loc[m])]);
}
-
+
/* We prefer no matching alternatives because
it gives more freedom in RA. */
if (operand_reg[nop] == NULL_RTX
@@ -1854,7 +1551,7 @@ process_alt_operands (int only_alternative)
}
else
did_match = true;
-
+
/* This can be fixed with reloads if the operand
we are supposed to match can be fixed with
reloads. */
@@ -1863,7 +1560,7 @@ process_alt_operands (int only_alternative)
COPY_HARD_REG_SET (this_alternative_set, curr_alt_set[m]);
break;
}
-
+
case 'p':
cl = base_reg_class (VOIDmode, ADDR_SPACE_GENERIC,
ADDRESS, SCRATCH);
@@ -1880,7 +1577,7 @@ process_alt_operands (int only_alternative)
win = true;
badop = false;
break;
-
+
case TARGET_MEM_CONSTRAINT:
if (MEM_P (op) || spilled_pseudo_p (op))
win = true;
@@ -1888,28 +1585,28 @@ process_alt_operands (int only_alternative)
badop = false;
constmemok = true;
break;
-
+
case '<':
if (MEM_P (op)
&& (GET_CODE (XEXP (op, 0)) == PRE_DEC
|| GET_CODE (XEXP (op, 0)) == POST_DEC))
win = true;
break;
-
+
case '>':
if (MEM_P (op)
&& (GET_CODE (XEXP (op, 0)) == PRE_INC
|| GET_CODE (XEXP (op, 0)) == POST_INC))
win = true;
break;
-
+
/* Memory op whose address is not offsettable. */
case 'V':
if (MEM_P (op)
&& ! offsettable_nonstrict_memref_p (op))
win = true;
break;
-
+
/* Memory operand whose address is offsettable. */
case 'o':
if ((MEM_P (op)
@@ -1921,7 +1618,7 @@ process_alt_operands (int only_alternative)
constmemok = true;
offmemok = true;
break;
-
+
case 'E':
case 'F':
if (GET_CODE (op) == CONST_DOUBLE
@@ -1929,14 +1626,14 @@ process_alt_operands (int only_alternative)
&& (GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT)))
win = true;
break;
-
+
case 'G':
case 'H':
if (GET_CODE (op) == CONST_DOUBLE
&& CONST_DOUBLE_OK_FOR_CONSTRAINT_P (op, c, p))
win = true;
break;
-
+
case 's':
if (CONST_INT_P (op)
|| (GET_CODE (op) == CONST_DOUBLE && mode == VOIDmode))
@@ -1945,13 +1642,13 @@ process_alt_operands (int only_alternative)
if (general_constant_p (op))
win = true;
break;
-
+
case 'n':
if (CONST_INT_P (op)
|| (GET_CODE (op) == CONST_DOUBLE && mode == VOIDmode))
win = true;
break;
-
+
case 'I':
case 'J':
case 'K':
@@ -1964,20 +1661,20 @@ process_alt_operands (int only_alternative)
&& CONST_OK_FOR_CONSTRAINT_P (INTVAL (op), c, p))
win = true;
break;
-
+
case 'X':
/* This constraint should be excluded by the fast
track. */
gcc_unreachable ();
break;
-
+
case 'g':
if (MEM_P (op)
|| general_constant_p (op)
|| spilled_pseudo_p (op))
win = true;
/* Drop through into 'r' case. */
-
+
case 'r':
this_alternative
= reg_class_subunion[this_alternative][GENERAL_REGS];
@@ -1992,7 +1689,7 @@ process_alt_operands (int only_alternative)
reg_class_contents[GENERAL_REGS]);
}
goto reg;
-
+
default:
if (REG_CLASS_FROM_CONSTRAINT (c, p) == NO_REGS)
{
@@ -2003,7 +1700,7 @@ process_alt_operands (int only_alternative)
win = true;
else if (spilled_pseudo_p (op))
win = true;
-
+
/* If we didn't already win, we can reload
constants via force_const_mem, and other
MEMs by reloading the address like for
@@ -2018,7 +1715,7 @@ process_alt_operands (int only_alternative)
{
if (EXTRA_CONSTRAINT_STR (op, c, p))
win = true;
-
+
/* If we didn't already win, we can reload
the address into a base register. */
cl = base_reg_class (VOIDmode, ADDR_SPACE_GENERIC,
@@ -2038,13 +1735,13 @@ process_alt_operands (int only_alternative)
badop = false;
break;
}
-
+
if (EXTRA_CONSTRAINT_STR (op, c, p))
win = true;
#endif
break;
}
-
+
cl = REG_CLASS_FROM_CONSTRAINT (c, p);
this_alternative = reg_class_subunion[this_alternative][cl];
IOR_HARD_REG_SET (this_alternative_set,
@@ -2076,7 +1773,7 @@ process_alt_operands (int only_alternative)
costly_p = c == '*';
}
while ((p += len), c);
-
+
/* Record which operands fit this alternative. */
if (win)
{
@@ -2125,7 +1822,7 @@ process_alt_operands (int only_alternative)
then this operand can be reloaded. */
if (winreg && !no_regs_p)
badop = false;
-
+
if (badop)
goto fail;
@@ -2178,7 +1875,7 @@ process_alt_operands (int only_alternative)
if (! no_regs_p)
losers++;
}
-
+
/* Alternative loses if it requires a type of reload not
permitted for this insn. We can always reload
objects with a REG_UNUSED note. */
@@ -2188,7 +1885,7 @@ process_alt_operands (int only_alternative)
|| (curr_static_id->operand[nop].type != OP_OUT
&& no_input_reloads_p && ! const_to_mem))
goto fail;
-
+
/* If we can't reload this value at all, reject this
alternative. Note that we could also lose due to
LIMIT_RELOAD_CLASS, but we don't check that here. */
@@ -2197,13 +1894,13 @@ process_alt_operands (int only_alternative)
if (targetm.preferred_reload_class
(op, this_alternative) == NO_REGS)
reject = MAX_OVERALL_COST_BOUND;
-
+
if (curr_static_id->operand[nop].type == OP_OUT
&& (targetm.preferred_output_reload_class
(op, this_alternative) == NO_REGS))
reject = MAX_OVERALL_COST_BOUND;
}
-
+
if (! ((const_to_mem && constmemok)
|| (MEM_P (op) && offmemok)))
{
@@ -2216,7 +1913,7 @@ process_alt_operands (int only_alternative)
match then. */
if (! (REG_P (op) && REGNO (op) >= FIRST_PSEUDO_REGISTER))
reject += 2;
-
+
if (! no_regs_p)
reload_nregs
+= ira_reg_class_max_nregs[this_alternative][mode];
@@ -2228,7 +1925,7 @@ process_alt_operands (int only_alternative)
if (!REG_P (op) || curr_static_id->operand[nop].type != OP_IN)
reject++;
}
-
+
if (early_clobber_p)
reject++;
/* ??? We check early clobbers after processing all operands
@@ -2246,11 +1943,11 @@ process_alt_operands (int only_alternative)
curr_alt_match_win[nop] = this_alternative_match_win;
curr_alt_offmemok[nop] = this_alternative_offmemok;
curr_alt_matches[nop] = this_alternative_matches;
-
+
if (this_alternative_matches >= 0
&& !did_match && !this_alternative_win)
curr_alt_win[this_alternative_matches] = false;
-
+
if (early_clobber_p && operand_reg[nop] != NULL_RTX)
early_clobbered_nops[early_clobbered_regs_num++] = nop;
}
@@ -2352,7 +2049,7 @@ process_alt_operands (int only_alternative)
}
if (losers == 0)
/* Everything is satisfied. Do not process alternatives
- anymore. */
+ anymore. */
break;
fail:
;
@@ -2371,7 +2068,7 @@ valid_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
lra_assert (ADDR_SPACE_GENERIC_P (as));
GO_IF_LEGITIMATE_ADDRESS (mode, addr, win);
return 0;
-
+
win:
return 1;
#else
@@ -2379,46 +2076,92 @@ valid_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
#endif
}
-/* Make reload base reg + disp from address AD in space AS of memory
- with MODE into a new pseudo. Return the new pseudo. */
+/* Return whether address AD is valid. */
+
+static bool
+valid_address_p (struct address_info *ad)
+{
+ /* Some ports do not check displacements for eliminable registers,
+ so we replace them temporarily with the elimination target. */
+ rtx saved_base_reg = NULL_RTX;
+ rtx saved_index_reg = NULL_RTX;
+ rtx *base_term = strip_subreg (ad->base_term);
+ rtx *index_term = strip_subreg (ad->index_term);
+ if (base_term != NULL)
+ {
+ saved_base_reg = *base_term;
+ lra_eliminate_reg_if_possible (base_term);
+ if (ad->base_term2 != NULL)
+ *ad->base_term2 = *ad->base_term;
+ }
+ if (index_term != NULL)
+ {
+ saved_index_reg = *index_term;
+ lra_eliminate_reg_if_possible (index_term);
+ }
+ bool ok_p = valid_address_p (ad->mode, *ad->outer, ad->as);
+ if (saved_base_reg != NULL_RTX)
+ {
+ *base_term = saved_base_reg;
+ if (ad->base_term2 != NULL)
+ *ad->base_term2 = *ad->base_term;
+ }
+ if (saved_index_reg != NULL_RTX)
+ *index_term = saved_index_reg;
+ return ok_p;
+}
+
+/* Make reload base reg + disp from address AD. Return the new pseudo. */
static rtx
-base_plus_disp_to_reg (enum machine_mode mode, addr_space_t as,
- struct address *ad)
+base_plus_disp_to_reg (struct address_info *ad)
{
enum reg_class cl;
rtx new_reg;
- lra_assert (ad->base_reg_loc != NULL && ad->disp_loc != NULL);
- cl = base_reg_class (mode, as, ad->base_outer_code, ad->index_code);
- new_reg = lra_create_new_reg (Pmode, NULL_RTX, cl, "base + disp");
- lra_emit_add (new_reg, *ad->base_reg_loc, *ad->disp_loc);
+ lra_assert (ad->base == ad->base_term && ad->disp == ad->disp_term);
+ cl = base_reg_class (ad->mode, ad->as, ad->base_outer_code,
+ get_index_code (ad));
+ new_reg = lra_create_new_reg (GET_MODE (*ad->base_term), NULL_RTX,
+ cl, "base + disp");
+ lra_emit_add (new_reg, *ad->base_term, *ad->disp_term);
return new_reg;
}
-/* Make substitution in address AD in space AS with location ADDR_LOC.
- Update AD and ADDR_LOC if it is necessary. Return true if a
- substitution was made. */
+/* Return true if we can add a displacement to address AD, even if that
+ makes the address invalid. The fix-up code requires any new address
+ to be the sum of the BASE_TERM, INDEX and DISP_TERM fields. */
static bool
-equiv_address_substitution (struct address *ad, rtx *addr_loc,
- enum machine_mode mode, addr_space_t as,
- enum rtx_code code)
+can_add_disp_p (struct address_info *ad)
{
- rtx base_reg, new_base_reg, index_reg, new_index_reg;
+ return (!ad->autoinc_p
+ && ad->segment == NULL
+ && ad->base == ad->base_term
+ && ad->disp == ad->disp_term);
+}
+
+/* Make equiv substitution in address AD. Return true if a substitution
+ was made. */
+static bool
+equiv_address_substitution (struct address_info *ad)
+{
+ rtx base_reg, new_base_reg, index_reg, new_index_reg, *base_term, *index_term;
HOST_WIDE_INT disp, scale;
bool change_p;
- if (ad->base_reg_loc == NULL)
+ base_term = strip_subreg (ad->base_term);
+ if (base_term == NULL)
base_reg = new_base_reg = NULL_RTX;
else
{
- base_reg = *ad->base_reg_loc;
+ base_reg = *base_term;
new_base_reg = get_equiv_substitution (base_reg);
}
- if (ad->index_reg_loc == NULL)
+ index_term = strip_subreg (ad->index_term);
+ if (index_term == NULL)
index_reg = new_index_reg = NULL_RTX;
else
{
- index_reg = *ad->index_reg_loc;
+ index_reg = *index_term;
new_index_reg = get_equiv_substitution (index_reg);
}
if (base_reg == new_base_reg && index_reg == new_index_reg)
@@ -2429,56 +2172,53 @@ equiv_address_substitution (struct address *ad, rtx *addr_loc,
{
fprintf (lra_dump_file, "Changing address in insn %d ",
INSN_UID (curr_insn));
- print_value_slim (lra_dump_file, *addr_loc, 1);
+ print_value_slim (lra_dump_file, *ad->outer, 1);
}
if (base_reg != new_base_reg)
{
if (REG_P (new_base_reg))
{
- *ad->base_reg_loc = new_base_reg;
+ *base_term = new_base_reg;
change_p = true;
}
else if (GET_CODE (new_base_reg) == PLUS
&& REG_P (XEXP (new_base_reg, 0))
- && CONST_INT_P (XEXP (new_base_reg, 1)))
+ && CONST_INT_P (XEXP (new_base_reg, 1))
+ && can_add_disp_p (ad))
{
disp += INTVAL (XEXP (new_base_reg, 1));
- *ad->base_reg_loc = XEXP (new_base_reg, 0);
+ *base_term = XEXP (new_base_reg, 0);
change_p = true;
}
- if (ad->base_reg_loc2 != NULL)
- *ad->base_reg_loc2 = *ad->base_reg_loc;
- }
- scale = 1;
- if (ad->index_loc != NULL && GET_CODE (*ad->index_loc) == MULT)
- {
- lra_assert (CONST_INT_P (XEXP (*ad->index_loc, 1)));
- scale = INTVAL (XEXP (*ad->index_loc, 1));
+ if (ad->base_term2 != NULL)
+ *ad->base_term2 = *ad->base_term;
}
if (index_reg != new_index_reg)
{
if (REG_P (new_index_reg))
{
- *ad->index_reg_loc = new_index_reg;
+ *index_term = new_index_reg;
change_p = true;
}
else if (GET_CODE (new_index_reg) == PLUS
&& REG_P (XEXP (new_index_reg, 0))
- && CONST_INT_P (XEXP (new_index_reg, 1)))
+ && CONST_INT_P (XEXP (new_index_reg, 1))
+ && can_add_disp_p (ad)
+ && (scale = get_index_scale (ad)))
{
disp += INTVAL (XEXP (new_index_reg, 1)) * scale;
- *ad->index_reg_loc = XEXP (new_index_reg, 0);
+ *index_term = XEXP (new_index_reg, 0);
change_p = true;
}
}
if (disp != 0)
{
- if (ad->disp_loc != NULL)
- *ad->disp_loc = plus_constant (Pmode, *ad->disp_loc, disp);
+ if (ad->disp != NULL)
+ *ad->disp = plus_constant (GET_MODE (*ad->inner), *ad->disp, disp);
else
{
- *addr_loc = gen_rtx_PLUS (Pmode, *addr_loc, GEN_INT (disp));
- extract_address_regs (mode, as, addr_loc, code, ad);
+ *ad->inner = plus_constant (GET_MODE (*ad->inner), *ad->inner, disp);
+ update_address (ad);
}
change_p = true;
}
@@ -2489,143 +2229,118 @@ equiv_address_substitution (struct address *ad, rtx *addr_loc,
else
{
fprintf (lra_dump_file, " on equiv ");
- print_value_slim (lra_dump_file, *addr_loc, 1);
+ print_value_slim (lra_dump_file, *ad->outer, 1);
fprintf (lra_dump_file, "\n");
}
}
return change_p;
}
-/* Major function to make reloads for address in operand NOP. Add to
- reloads to the list *BEFORE and *AFTER. We might need to add
+/* Major function to make reloads for an address in operand NOP.
+ The supported cases are:
+
+ 1) an address that existed before LRA started, at which point it must
+ have been valid. These addresses are subject to elimination and
+ may have become invalid due to the elimination offset being out
+ of range.
+
+ 2) an address created by forcing a constant to memory (force_const_to_mem).
+ The initial form of these addresses might not be valid, and it is this
+ function's job to make them valid.
+
+ 3) a frame address formed from a register and a (possibly zero)
+ constant offset. As above, these addresses might not be valid
+ and this function must make them so.
+
+ Add reloads to the lists *BEFORE and *AFTER. We might need to add
reloads to *AFTER because of inc/dec, {pre, post} modify in the
address. Return true for any RTL change. */
static bool
process_address (int nop, rtx *before, rtx *after)
{
- struct address ad;
- enum machine_mode mode;
- rtx new_reg, *addr_loc, saved_index_reg, saved_base_reg;
- bool ok_p;
- addr_space_t as;
+ struct address_info ad;
+ rtx new_reg;
rtx op = *curr_id->operand_loc[nop];
const char *constraint = curr_static_id->operand[nop].constraint;
bool change_p;
- enum rtx_code code;
if (constraint[0] == 'p'
|| EXTRA_ADDRESS_CONSTRAINT (constraint[0], constraint))
- {
- mode = VOIDmode;
- addr_loc = curr_id->operand_loc[nop];
- as = ADDR_SPACE_GENERIC;
- code = ADDRESS;
- }
+ decompose_lea_address (&ad, curr_id->operand_loc[nop]);
else if (MEM_P (op))
- {
- mode = GET_MODE (op);
- addr_loc = &XEXP (op, 0);
- as = MEM_ADDR_SPACE (op);
- code = MEM;
- }
+ decompose_mem_address (&ad, op);
else if (GET_CODE (op) == SUBREG
&& MEM_P (SUBREG_REG (op)))
- {
- mode = GET_MODE (SUBREG_REG (op));
- addr_loc = &XEXP (SUBREG_REG (op), 0);
- as = MEM_ADDR_SPACE (SUBREG_REG (op));
- code = MEM;
- }
+ decompose_mem_address (&ad, SUBREG_REG (op));
else
return false;
- if (GET_CODE (*addr_loc) == AND)
- addr_loc = &XEXP (*addr_loc, 0);
- extract_address_regs (mode, as, addr_loc, code, &ad);
- change_p = equiv_address_substitution (&ad, addr_loc, mode, as, code);
- if (ad.base_reg_loc != NULL
+ change_p = equiv_address_substitution (&ad);
+ if (ad.base_term != NULL
&& (process_addr_reg
- (ad.base_reg_loc, before,
- (ad.base_modify_p && REG_P (*ad.base_reg_loc)
- && find_regno_note (curr_insn, REG_DEAD,
- REGNO (*ad.base_reg_loc)) == NULL_RTX
+ (ad.base_term, before,
+ (ad.autoinc_p
+ && !(REG_P (*ad.base_term)
+ && find_regno_note (curr_insn, REG_DEAD,
+ REGNO (*ad.base_term)) != NULL_RTX)
? after : NULL),
- base_reg_class (mode, as, ad.base_outer_code, ad.index_code))))
+ base_reg_class (ad.mode, ad.as, ad.base_outer_code,
+ get_index_code (&ad)))))
{
change_p = true;
- if (ad.base_reg_loc2 != NULL)
- *ad.base_reg_loc2 = *ad.base_reg_loc;
+ if (ad.base_term2 != NULL)
+ *ad.base_term2 = *ad.base_term;
}
- if (ad.index_reg_loc != NULL
- && process_addr_reg (ad.index_reg_loc, before, NULL, INDEX_REG_CLASS))
+ if (ad.index_term != NULL
+ && process_addr_reg (ad.index_term, before, NULL, INDEX_REG_CLASS))
change_p = true;
- /* The address was valid before LRA. We only change its form if the
- address has a displacement, so if it has no displacement it must
- still be valid. */
- if (ad.disp_loc == NULL)
- return change_p;
+ /* There are three cases where the shape of *AD.INNER may now be invalid:
- /* See whether the address is still valid. Some ports do not check
- displacements for eliminable registers, so we replace them
- temporarily with the elimination target. */
- saved_base_reg = saved_index_reg = NULL_RTX;
- if (ad.base_reg_loc != NULL)
- {
- saved_base_reg = *ad.base_reg_loc;
- lra_eliminate_reg_if_possible (ad.base_reg_loc);
- if (ad.base_reg_loc2 != NULL)
- *ad.base_reg_loc2 = *ad.base_reg_loc;
- }
- if (ad.index_reg_loc != NULL)
- {
- saved_index_reg = *ad.index_reg_loc;
- lra_eliminate_reg_if_possible (ad.index_reg_loc);
- }
- /* Some ports do not check displacements for virtual registers -- so
- we substitute them temporarily by real registers. */
- ok_p = valid_address_p (mode, *addr_loc, as);
- if (saved_base_reg != NULL_RTX)
- {
- *ad.base_reg_loc = saved_base_reg;
- if (ad.base_reg_loc2 != NULL)
- *ad.base_reg_loc2 = saved_base_reg;
- }
- if (saved_index_reg != NULL_RTX)
- *ad.index_reg_loc = saved_index_reg;
+ 1) the original address was valid, but either elimination or
+ equiv_address_substitution applied a displacement that made
+ it invalid.
+
+ 2) the address is an invalid symbolic address created by
+ force_const_to_mem.
- if (ok_p)
+ 3) the address is a frame address with an invalid offset.
+
+ All these cases involve a displacement and a non-autoinc address,
+ so there is no point revalidating other types. */
+ if (ad.disp == NULL || ad.autoinc_p || valid_address_p (&ad))
return change_p;
- /* Addresses were legitimate before LRA. So if the address has
- two registers than it can have two of them. We should also
- not worry about scale for the same reason. */
+ /* Any index existed before LRA started, so we can assume that the
+ presence and shape of the index is valid. */
push_to_sequence (*before);
- if (ad.base_reg_loc == NULL)
+ gcc_assert (ad.segment == NULL);
+ gcc_assert (ad.disp == ad.disp_term);
+ if (ad.base == NULL)
{
- if (ad.index_reg_loc == NULL)
+ if (ad.index == NULL)
{
int code = -1;
- enum reg_class cl = base_reg_class (mode, as, SCRATCH, SCRATCH);
-
+ enum reg_class cl = base_reg_class (ad.mode, ad.as,
+ SCRATCH, SCRATCH);
+ rtx disp = *ad.disp;
+
new_reg = lra_create_new_reg (Pmode, NULL_RTX, cl, "disp");
#ifdef HAVE_lo_sum
{
rtx insn;
rtx last = get_last_insn ();
- /* disp => lo_sum (new_base, disp) */
+ /* disp => lo_sum (new_base, disp), case (2) above. */
insn = emit_insn (gen_rtx_SET
(VOIDmode, new_reg,
- gen_rtx_HIGH (Pmode, copy_rtx (*ad.disp_loc))));
+ gen_rtx_HIGH (Pmode, copy_rtx (disp))));
code = recog_memoized (insn);
if (code >= 0)
{
- rtx save = *ad.disp_loc;
-
- *ad.disp_loc = gen_rtx_LO_SUM (Pmode, new_reg, *ad.disp_loc);
- if (! valid_address_p (mode, *ad.disp_loc, as))
+ *ad.disp = gen_rtx_LO_SUM (Pmode, new_reg, disp);
+ if (! valid_address_p (ad.mode, *ad.outer, ad.as))
{
- *ad.disp_loc = save;
+ *ad.disp = disp;
code = -1;
}
}
@@ -2635,41 +2350,43 @@ process_address (int nop, rtx *before, rtx *after)
#endif
if (code < 0)
{
- /* disp => new_base */
- lra_emit_move (new_reg, *ad.disp_loc);
- *ad.disp_loc = new_reg;
+ /* disp => new_base, case (2) above. */
+ lra_emit_move (new_reg, disp);
+ *ad.disp = new_reg;
}
}
else
{
- /* index * scale + disp => new base + index * scale */
- enum reg_class cl = base_reg_class (mode, as, SCRATCH, SCRATCH);
+ /* index * scale + disp => new base + index * scale,
+ case (1) above. */
+ enum reg_class cl = base_reg_class (ad.mode, ad.as, PLUS,
+ GET_CODE (*ad.index));
lra_assert (INDEX_REG_CLASS != NO_REGS);
new_reg = lra_create_new_reg (Pmode, NULL_RTX, cl, "disp");
- lra_assert (GET_CODE (*addr_loc) == PLUS);
- lra_emit_move (new_reg, *ad.disp_loc);
- if (CONSTANT_P (XEXP (*addr_loc, 1)))
- XEXP (*addr_loc, 1) = XEXP (*addr_loc, 0);
- XEXP (*addr_loc, 0) = new_reg;
+ lra_emit_move (new_reg, *ad.disp);
+ *ad.inner = simplify_gen_binary (PLUS, GET_MODE (new_reg),
+ new_reg, *ad.index);
}
}
- else if (ad.index_reg_loc == NULL)
+ else if (ad.index == NULL)
{
- /* base + disp => new base */
+ /* base + disp => new base, cases (1) and (3) above. */
/* Another option would be to reload the displacement into an
index register. However, postreload has code to optimize
address reloads that have the same base and different
displacements, so reloading into an index register would
not necessarily be a win. */
- new_reg = base_plus_disp_to_reg (mode, as, &ad);
- *addr_loc = new_reg;
+ new_reg = base_plus_disp_to_reg (&ad);
+ *ad.inner = new_reg;
}
else
{
- /* base + scale * index + disp => new base + scale * index */
- new_reg = base_plus_disp_to_reg (mode, as, &ad);
- *addr_loc = gen_rtx_PLUS (Pmode, new_reg, *ad.index_loc);
+ /* base + scale * index + disp => new base + scale * index,
+ case (1) above. */
+ new_reg = base_plus_disp_to_reg (&ad);
+ *ad.inner = simplify_gen_binary (PLUS, GET_MODE (new_reg),
+ new_reg, *ad.index);
}
*before = get_insns ();
end_sequence ();
@@ -2938,7 +2655,7 @@ curr_insn_transform (void)
change_p = true;
lra_update_dup (curr_id, i);
}
-
+
if (change_p)
/* If we've changed the instruction then any alternative that
we chose previously may no longer be valid. */
@@ -3076,7 +2793,7 @@ curr_insn_transform (void)
/* Right now, for any pair of operands I and J that are required to
match, with J < I, goal_alt_matches[I] is J. Add I to
goal_alt_matched[J]. */
-
+
for (i = 0; i < n_operands; i++)
if ((j = goal_alt_matches[i]) >= 0)
{
@@ -3092,10 +2809,10 @@ curr_insn_transform (void)
goal_alt_matched[j][k] = i;
goal_alt_matched[j][k + 1] = -1;
}
-
+
for (i = 0; i < n_operands; i++)
goal_alt_win[i] |= goal_alt_match_win[i];
-
+
/* Any constants that aren't allowed and can't be reloaded into
registers are here changed into memory references. */
for (i = 0; i < n_operands; i++)
@@ -3107,7 +2824,7 @@ curr_insn_transform (void)
if (GET_CODE (reg) == SUBREG)
reg = SUBREG_REG (reg);
-
+
if (REG_P (reg) && (regno = REGNO (reg)) >= FIRST_PSEUDO_REGISTER)
{
bool ok_p = in_class_p (reg, goal_alt[i], &new_class);
@@ -3126,29 +2843,29 @@ curr_insn_transform (void)
rtx op = *curr_id->operand_loc[i];
rtx subreg = NULL_RTX;
enum machine_mode mode = curr_operand_mode[i];
-
+
if (GET_CODE (op) == SUBREG)
{
subreg = op;
op = SUBREG_REG (op);
mode = GET_MODE (op);
}
-
+
if (CONST_POOL_OK_P (mode, op)
&& ((targetm.preferred_reload_class
(op, (enum reg_class) goal_alt[i]) == NO_REGS)
|| no_input_reloads_p))
{
rtx tem = force_const_mem (mode, op);
-
+
change_p = true;
if (subreg != NULL_RTX)
tem = gen_rtx_SUBREG (mode, tem, SUBREG_BYTE (subreg));
-
+
*curr_id->operand_loc[i] = tem;
lra_update_dup (curr_id, i);
process_address (i, &before, &after);
-
+
/* If the alternative accepts constant pool refs directly
there will be no reload needed at all. */
if (subreg != NULL_RTX)
@@ -3170,11 +2887,11 @@ curr_insn_transform (void)
}
if (c == '\0' || c == ',' || c == '#')
continue;
-
+
goal_alt_win[i] = true;
}
}
-
+
for (i = 0; i < n_operands; i++)
{
rtx old, new_reg;
@@ -3193,7 +2910,7 @@ curr_insn_transform (void)
change_class (REGNO (op), NO_REGS, " Change", true);
continue;
}
-
+
/* Operands that match previous ones have already been handled. */
if (goal_alt_matches[i] >= 0)
continue;
@@ -3450,10 +3167,10 @@ multi_block_pseudo_p (int regno)
basic_block bb = NULL;
unsigned int uid;
bitmap_iterator bi;
-
+
if (regno < FIRST_PSEUDO_REGISTER)
return false;
-
+
EXECUTE_IF_SET_IN_BITMAP (&lra_reg_info[regno].insn_bitmap, 0, uid, bi)
if (bb == NULL)
bb = BLOCK_FOR_INSN (lra_insn_recog_data[uid]->insn);
@@ -3551,7 +3268,7 @@ lra_constraints (bool first_p)
if ((hard_regno = lra_get_regno_hard_regno (i)) >= 0)
{
int j, nregs = hard_regno_nregs[hard_regno][PSEUDO_REGNO_MODE (i)];
-
+
for (j = 0; j < nregs; j++)
df_set_regs_ever_live (hard_regno + j, true);
}
@@ -3604,7 +3321,7 @@ lra_constraints (bool first_p)
{
curr_insn = lra_pop_insn ();
--new_min_len;
- curr_bb = BLOCK_FOR_INSN (curr_insn);
+ curr_bb = BLOCK_FOR_INSN (curr_insn);
if (curr_bb != last_bb)
{
last_bb = curr_bb;
@@ -3644,7 +3361,7 @@ lra_constraints (bool first_p)
can not be changed. Such insns might be not in
init_insns because we don't update equiv data
during insn transformations.
-
+
As an example, let suppose that a pseudo got
hard register and on the 1st pass was not
changed to equivalent constant. We generate an
@@ -3698,7 +3415,7 @@ lra_constraints (bool first_p)
&& (hard_regno = lra_get_regno_hard_regno (i)) >= 0)
{
int j, nregs = hard_regno_nregs[hard_regno][PSEUDO_REGNO_MODE (i)];
-
+
for (j = 0; j < nregs; j++)
lra_assert (df_regs_ever_live_p (hard_regno + j));
}
@@ -3782,7 +3499,7 @@ static void
add_next_usage_insn (int regno, rtx insn, int reloads_num)
{
rtx next_usage_insns;
-
+
if (usage_insns[regno].check == curr_usage_insns_check
&& (next_usage_insns = usage_insns[regno].insns) != NULL_RTX
&& DEBUG_INSN_P (insn))
@@ -3799,7 +3516,7 @@ add_next_usage_insn (int regno, rtx insn, int reloads_num)
else
usage_insns[regno].check = 0;
}
-
+
/* Replace all references to register OLD_REGNO in *LOC with pseudo
register NEW_REG. Return true if any change was made. */
static bool
@@ -3851,6 +3568,49 @@ substitute_pseudo (rtx *loc, int old_regno, rtx new_reg)
return result;
}
+/* Return first non-debug insn in list USAGE_INSNS. */
+static rtx
+skip_usage_debug_insns (rtx usage_insns)
+{
+ rtx insn;
+
+ /* Skip debug insns. */
+ for (insn = usage_insns;
+ insn != NULL_RTX && GET_CODE (insn) == INSN_LIST;
+ insn = XEXP (insn, 1))
+ ;
+ return insn;
+}
+
+/* Return true if we need secondary memory moves for insn in
+ USAGE_INSNS after inserting inherited pseudo of class INHER_CL
+ into the insn. */
+static bool
+check_secondary_memory_needed_p (enum reg_class inher_cl ATTRIBUTE_UNUSED,
+ rtx usage_insns ATTRIBUTE_UNUSED)
+{
+#ifndef SECONDARY_MEMORY_NEEDED
+ return false;
+#else
+ rtx insn, set, dest;
+ enum reg_class cl;
+
+ if (inher_cl == ALL_REGS
+ || (insn = skip_usage_debug_insns (usage_insns)) == NULL_RTX)
+ return false;
+ lra_assert (INSN_P (insn));
+ if ((set = single_set (insn)) == NULL_RTX || ! REG_P (SET_DEST (set)))
+ return false;
+ dest = SET_DEST (set);
+ if (! REG_P (dest))
+ return false;
+ lra_assert (inher_cl != NO_REGS);
+ cl = get_reg_class (REGNO (dest));
+ return (cl != NO_REGS && cl != ALL_REGS
+ && SECONDARY_MEMORY_NEEDED (inher_cl, cl, GET_MODE (dest)));
+#endif
+}
+
/* Registers involved in inheritance/split in the current EBB
(inheritance/split pseudos and original registers). */
static bitmap_head check_only_regs;
@@ -3873,8 +3633,8 @@ static bitmap_head check_only_regs;
... =>
<- ... p ... <- ... i ...
where p is a spilled original pseudo and i is a new inheritance pseudo.
-
-
+
+
The inheritance pseudo has the smallest class of two classes CL and
class of ORIGINAL REGNO. */
static bool
@@ -3888,18 +3648,18 @@ inherit_reload_reg (bool def_p, int original_regno,
lra_assert (! usage_insns[original_regno].after_p);
if (lra_dump_file != NULL)
fprintf (lra_dump_file,
- " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
+ " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
if (! ira_reg_classes_intersect_p[cl][rclass])
{
if (lra_dump_file != NULL)
{
fprintf (lra_dump_file,
- " Rejecting inheritance for %d "
+ " Rejecting inheritance for %d "
"because of disjoint classes %s and %s\n",
original_regno, reg_class_names[cl],
reg_class_names[rclass]);
fprintf (lra_dump_file,
- " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
+ " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
}
return false;
}
@@ -3913,9 +3673,34 @@ inherit_reload_reg (bool def_p, int original_regno,
if (lra_dump_file != NULL)
fprintf (lra_dump_file, " Use smallest class of %s and %s\n",
reg_class_names[cl], reg_class_names[rclass]);
-
+
rclass = cl;
}
+ if (check_secondary_memory_needed_p (cl, next_usage_insns))
+ {
+ /* Reject inheritance resulting in secondary memory moves.
+ Otherwise, there is a danger in LRA cycling. Also such
+ transformation will be unprofitable. */
+ if (lra_dump_file != NULL)
+ {
+ rtx insn = skip_usage_debug_insns (next_usage_insns);
+ rtx set = single_set (insn);
+
+ lra_assert (set != NULL_RTX);
+
+ rtx dest = SET_DEST (set);
+
+ lra_assert (REG_P (dest));
+ fprintf (lra_dump_file,
+ " Rejecting inheritance for insn %d(%s)<-%d(%s) "
+ "as secondary mem is needed\n",
+ REGNO (dest), reg_class_names[get_reg_class (REGNO (dest))],
+ original_regno, reg_class_names[cl]);
+ fprintf (lra_dump_file,
+ " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
+ }
+ return false;
+ }
new_reg = lra_create_new_reg (GET_MODE (original_reg), original_reg,
rclass, "inheritance");
start_sequence ();
@@ -3930,7 +3715,7 @@ inherit_reload_reg (bool def_p, int original_regno,
if (lra_dump_file != NULL)
{
fprintf (lra_dump_file,
- " Rejecting inheritance %d->%d "
+ " Rejecting inheritance %d->%d "
"as it results in 2 or more insns:\n",
original_regno, REGNO (new_reg));
debug_rtl_slim (lra_dump_file, new_insns, NULL_RTX, -1, 0);
@@ -3945,7 +3730,7 @@ inherit_reload_reg (bool def_p, int original_regno,
/* We now have a new usage insn for original regno. */
setup_next_usage_insn (original_regno, new_insns, reloads_num, false);
if (lra_dump_file != NULL)
- fprintf (lra_dump_file, " Original reg change %d->%d (bb%d):\n",
+ fprintf (lra_dump_file, " Original reg change %d->%d (bb%d):\n",
original_regno, REGNO (new_reg), BLOCK_FOR_INSN (insn)->index);
lra_reg_info[REGNO (new_reg)].restore_regno = original_regno;
bitmap_set_bit (&check_only_regs, REGNO (new_reg));
@@ -4067,8 +3852,9 @@ choose_split_class (enum reg_class allocno_class,
#else
int i;
enum reg_class cl, best_cl = NO_REGS;
- enum reg_class hard_reg_class = REGNO_REG_CLASS (hard_regno);
-
+ enum reg_class hard_reg_class ATTRIBUTE_UNUSED
+ = REGNO_REG_CLASS (hard_regno);
+
if (! SECONDARY_MEMORY_NEEDED (allocno_class, allocno_class, mode)
&& TEST_HARD_REG_BIT (reg_class_contents[allocno_class], hard_regno))
return allocno_class;
@@ -4139,7 +3925,7 @@ split_reg (bool before_p, int original_regno, rtx insn, rtx next_usage_insns)
if (call_save_p)
{
enum machine_mode sec_mode;
-
+
#ifdef SECONDARY_MEMORY_NEEDED_MODE
sec_mode = SECONDARY_MEMORY_NEEDED_MODE (GET_MODE (original_reg));
#else
@@ -4299,7 +4085,7 @@ update_ebb_live_info (rtx head, rtx tail)
edge e;
edge_iterator ei;
- last_bb = BLOCK_FOR_INSN (tail);
+ last_bb = BLOCK_FOR_INSN (tail);
prev_bb = NULL;
for (curr_insn = tail;
curr_insn != PREV_INSN (head);
@@ -4447,7 +4233,7 @@ get_live_on_other_edges (basic_block from, basic_block to, bitmap res)
if (reg->type != OP_IN)
bitmap_set_bit (res, reg->regno);
}
-
+
/* Used as a temporary results of some bitmap calculations. */
static bitmap_head temp_bitmap;
@@ -4498,7 +4284,7 @@ inherit_in_ebb (rtx head, rtx tail)
pseudos for potential splitting. */
to_process = df_get_live_out (curr_bb);
if (last_processed_bb != NULL)
- {
+ {
/* We are somewhere in the middle of EBB. */
get_live_on_other_edges (curr_bb, last_processed_bb,
&temp_bitmap);
@@ -4599,7 +4385,7 @@ inherit_in_ebb (rtx head, rtx tail)
= usage_insns[dst_regno].insns) != NULL_RTX)
{
struct lra_insn_reg *r;
-
+
for (r = curr_id->regs; r != NULL; r = r->next)
if (r->type != OP_OUT && r->regno == dst_regno)
break;
@@ -4618,7 +4404,7 @@ inherit_in_ebb (rtx head, rtx tail)
&& ! reg->subreg_p && reg->type == OP_OUT)
{
HARD_REG_SET s;
-
+
if (split_if_necessary (dst_regno, reg->biggest_mode,
potential_reload_hard_regs,
false, curr_insn, max_uid))
@@ -4765,7 +4551,7 @@ inherit_in_ebb (rtx head, rtx tail)
rest of spliting in the current BB. */
to_process = df_get_live_in (curr_bb);
if (BLOCK_FOR_INSN (head) != curr_bb)
- {
+ {
/* We are somewhere in the middle of EBB. */
get_live_on_other_edges (EDGE_PRED (curr_bb, 0)->src,
curr_bb, &temp_bitmap);
@@ -4802,7 +4588,7 @@ inherit_in_ebb (rtx head, rtx tail)
/* This value affects EBB forming. If probability of edge from EBB to
a BB is not greater than the following value, we don't add the BB
- to EBB. */
+ to EBB. */
#define EBB_PROBABILITY_CUTOFF (REG_BR_PROB_BASE / 2)
/* Current number of inheritance/split iteration. */
@@ -4945,7 +4731,7 @@ remove_inheritance_pseudos (bitmap remove_pseudos)
dregno = get_regno (SET_DEST (set));
sregno = get_regno (SET_SRC (set));
}
-
+
if (sregno >= 0 && dregno >= 0)
{
if ((bitmap_bit_p (remove_pseudos, sregno)
diff --git a/gcc/lra-eliminations.c b/gcc/lra-eliminations.c
index 2222d805f1b..24c58f699c9 100644
--- a/gcc/lra-eliminations.c
+++ b/gcc/lra-eliminations.c
@@ -81,25 +81,25 @@ along with GCC; see the file COPYING3. If not see
struct elim_table
{
/* Hard register number to be eliminated. */
- int from;
+ int from;
/* Hard register number used as replacement. */
- int to;
+ int to;
/* Difference between values of the two hard registers above on
previous iteration. */
HOST_WIDE_INT previous_offset;
/* Difference between the values on the current iteration. */
- HOST_WIDE_INT offset;
+ HOST_WIDE_INT offset;
/* Nonzero if this elimination can be done. */
- bool can_eliminate;
+ bool can_eliminate;
/* CAN_ELIMINATE since the last check. */
bool prev_can_eliminate;
/* REG rtx for the register to be eliminated. We cannot simply
compare the number since we might then spuriously replace a hard
register corresponding to a pseudo assigned to the reg to be
eliminated. */
- rtx from_rtx;
+ rtx from_rtx;
/* REG rtx for the replacement. */
- rtx to_rtx;
+ rtx to_rtx;
};
/* The elimination table. Each array entry describes one possible way
@@ -335,7 +335,7 @@ lra_eliminate_regs_1 (rtx x, enum machine_mode mem_mode,
if ((ep = get_elimination (x)) != NULL)
{
rtx to = subst_p ? ep->to_rtx : ep->from_rtx;
-
+
if (update_p)
return plus_constant (Pmode, to, ep->offset - ep->previous_offset);
else if (full_p)
@@ -354,10 +354,10 @@ lra_eliminate_regs_1 (rtx x, enum machine_mode mem_mode,
{
HOST_WIDE_INT offset;
rtx to = subst_p ? ep->to_rtx : ep->from_rtx;
-
+
if (! update_p && ! full_p)
return gen_rtx_PLUS (Pmode, to, XEXP (x, 1));
-
+
offset = (update_p
? ep->offset - ep->previous_offset : ep->offset);
if (CONST_INT_P (XEXP (x, 1))
@@ -405,7 +405,7 @@ lra_eliminate_regs_1 (rtx x, enum machine_mode mem_mode,
&& (ep = get_elimination (XEXP (x, 0))) != NULL)
{
rtx to = subst_p ? ep->to_rtx : ep->from_rtx;
-
+
if (update_p)
return
plus_constant (Pmode,
@@ -420,7 +420,7 @@ lra_eliminate_regs_1 (rtx x, enum machine_mode mem_mode,
else
return gen_rtx_MULT (Pmode, to, XEXP (x, 1));
}
-
+
/* ... fall through ... */
case CALL:
@@ -550,7 +550,8 @@ lra_eliminate_regs_1 (rtx x, enum machine_mode mem_mode,
return x;
}
else
- return gen_rtx_SUBREG (GET_MODE (x), new_rtx, SUBREG_BYTE (x));
+ return simplify_gen_subreg (GET_MODE (x), new_rtx,
+ GET_MODE (new_rtx), SUBREG_BYTE (x));
}
return x;
@@ -777,7 +778,7 @@ eliminate_regs_in_insn (rtx insn, bool replace_p)
&& (ep = get_elimination (SET_DEST (old_set))) != NULL)
{
bool delete_p = replace_p;
-
+
#ifdef HARD_FRAME_POINTER_REGNUM
/* If this is setting the frame pointer register to the hardware
frame pointer register and this is an elimination that will
@@ -798,11 +799,11 @@ eliminate_regs_in_insn (rtx insn, bool replace_p)
rtx base = SET_SRC (old_set);
HOST_WIDE_INT offset = 0;
rtx base_insn = insn;
-
+
while (base != ep->to_rtx)
{
rtx prev_insn, prev_set;
-
+
if (GET_CODE (base) == PLUS && CONST_INT_P (XEXP (base, 1)))
{
offset += INTVAL (XEXP (base, 1));
@@ -818,14 +819,14 @@ eliminate_regs_in_insn (rtx insn, bool replace_p)
else
break;
}
-
+
if (base == ep->to_rtx)
{
rtx src;
-
+
offset -= (ep->offset - ep->previous_offset);
src = plus_constant (Pmode, ep->to_rtx, offset);
-
+
/* First see if this insn remains valid when we make
the change. If not, keep the INSN_CODE the same
and let the constraint pass fit it up. */
@@ -841,14 +842,14 @@ eliminate_regs_in_insn (rtx insn, bool replace_p)
return;
}
}
-
-
+
+
/* We can't delete this insn, but needn't process it
since it won't be used unless something changes. */
delete_p = false;
}
#endif
-
+
/* This insn isn't serving a useful purpose. We delete it
when REPLACE is set. */
if (delete_p)
@@ -892,13 +893,13 @@ eliminate_regs_in_insn (rtx insn, bool replace_p)
if (REG_P (reg) && (ep = get_elimination (reg)) != NULL)
{
rtx to_rtx = replace_p ? ep->to_rtx : ep->from_rtx;
-
+
if (! replace_p)
{
offset += (ep->offset - ep->previous_offset);
offset = trunc_int_for_mode (offset, GET_MODE (plus_cst_src));
}
-
+
if (GET_CODE (XEXP (plus_cst_src, 0)) == SUBREG)
to_rtx = gen_lowpart (GET_MODE (XEXP (plus_cst_src, 0)), to_rtx);
/* If we have a nonzero offset, and the source is already a
@@ -909,7 +910,7 @@ eliminate_regs_in_insn (rtx insn, bool replace_p)
if (offset == 0 || plus_src)
{
rtx new_src = plus_constant (GET_MODE (to_rtx), to_rtx, offset);
-
+
old_set = single_set (insn);
/* First see if this insn remains valid when we make the
@@ -923,7 +924,7 @@ eliminate_regs_in_insn (rtx insn, bool replace_p)
{
rtx new_pat = gen_rtx_SET (VOIDmode,
SET_DEST (old_set), new_src);
-
+
if (! validate_change (insn, &PATTERN (insn), new_pat, 0))
SET_SRC (old_set) = new_src;
}
@@ -1153,7 +1154,7 @@ init_elim_table (void)
ep->to = ep1->to;
value_p = (targetm.can_eliminate (ep->from, ep->to)
&& ! (ep->to == STACK_POINTER_REGNUM
- && frame_pointer_needed
+ && frame_pointer_needed
&& (! SUPPORTS_STACK_ALIGNMENT
|| ! stack_realign_fp)));
setup_can_eliminate (ep, value_p);
diff --git a/gcc/lra-int.h b/gcc/lra-int.h
index d00cc12feff..ffb56bb824b 100644
--- a/gcc/lra-int.h
+++ b/gcc/lra-int.h
@@ -25,13 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "insn-attr.h"
#include "insn-codes.h"
-#ifdef ENABLE_CHECKING
-#define lra_assert(c) gcc_assert (c)
-#else
-/* Always define and include C, so that warnings for empty body in an
- ‘if’ statement and unused variable do not occur. */
-#define lra_assert(c) ((void)(0 && (c)))
-#endif
+#define lra_assert(c) gcc_checking_assert (c)
/* The parameter used to prevent infinite reloading for an insn. Each
insn operands might require a reload and, if it is a memory, its
@@ -247,6 +241,10 @@ struct lra_insn_recog_data
typedef struct lra_insn_recog_data *lra_insn_recog_data_t;
+/* Whether the clobber is used temporary in LRA. */
+#define LRA_TEMP_CLOBBER_P(x) \
+ (RTL_FLAG_CHECK1 ("TEMP_CLOBBER_P", (x), CLOBBER)->unchanging)
+
/* lra.c: */
extern FILE *lra_dump_file;
@@ -352,7 +350,7 @@ extern bool lra_coalesce (void);
extern bool lra_need_for_spills_p (void);
extern void lra_spill (void);
-extern void lra_hard_reg_substitution (void);
+extern void lra_final_code_change (void);
/* lra-elimination.c: */
@@ -392,7 +390,7 @@ lra_update_operator_dups (lra_insn_recog_data_t id)
for (i = 0; i < static_id->n_dups; i++)
{
int ndup = static_id->dup_num[i];
-
+
if (static_id->operand[ndup].is_operator)
*id->dup_loc[i] = *id->operand_loc[ndup];
}
diff --git a/gcc/lra-lives.c b/gcc/lra-lives.c
index 6e00250c7ed..501e205ffd5 100644
--- a/gcc/lra-lives.c
+++ b/gcc/lra-lives.c
@@ -772,8 +772,8 @@ remove_some_program_points_and_update_live_ranges (void)
born = sbitmap_alloc (lra_live_max_point);
dead = sbitmap_alloc (lra_live_max_point);
- sbitmap_zero (born);
- sbitmap_zero (dead);
+ bitmap_clear (born);
+ bitmap_clear (dead);
max_regno = max_reg_num ();
for (i = FIRST_PSEUDO_REGISTER; i < (unsigned) max_regno; i++)
{
@@ -785,7 +785,7 @@ remove_some_program_points_and_update_live_ranges (void)
}
}
born_or_dead = sbitmap_alloc (lra_live_max_point);
- sbitmap_a_or_b (born_or_dead, born, dead);
+ bitmap_ior (born_or_dead, born, dead);
map = XCNEWVEC (int, lra_live_max_point);
n = -1;
prev_born_p = prev_dead_p = false;
diff --git a/gcc/lra-spills.c b/gcc/lra-spills.c
index 8ff91d81139..8b666499fe9 100644
--- a/gcc/lra-spills.c
+++ b/gcc/lra-spills.c
@@ -34,7 +34,7 @@ along with GCC; see the file COPYING3. If not see
end
create new stack slot S and assign P to S
end
-
+
The actual algorithm is bit more complicated because of different
pseudo sizes.
@@ -143,9 +143,9 @@ assign_mem_slot (int i)
lra_assert (regno_reg_rtx[i] != NULL_RTX && REG_P (regno_reg_rtx[i])
&& lra_reg_info[i].nrefs != 0 && reg_renumber[i] < 0);
-
+
x = slots[pseudo_slots[i].slot_num].mem;
-
+
/* We can use a slot already allocated because it is guaranteed the
slot provides both enough inherent space and enough total
space. */
@@ -181,14 +181,14 @@ assign_mem_slot (int i)
}
slots[pseudo_slots[i].slot_num].mem = stack_slot;
}
-
+
/* On a big endian machine, the "address" of the slot is the address
of the low part that fits its inherent mode. */
if (BYTES_BIG_ENDIAN && inherent_size < total_size)
adjust += (total_size - inherent_size);
-
+
x = adjust_address_nv (x, GET_MODE (regno_reg_rtx[i]), adjust);
-
+
/* Set all of the memory attributes as appropriate for a spill. */
set_mem_attrs_for_spill (x);
pseudo_slots[i].mem = x;
@@ -265,7 +265,7 @@ assign_spill_hard_regs (int *pseudo_regnos, int n)
bitmap setjump_crosses = regstat_get_setjmp_crosses ();
/* Hard registers which can not be used for any purpose at given
program point because they are unallocatable or already allocated
- for other pseudos. */
+ for other pseudos. */
HARD_REG_SET *reserved_hard_regs;
if (! lra_reg_spill_p)
@@ -604,7 +604,7 @@ alter_subregs (rtx *loc, bool final_p)
else if (fmt[i] == 'E')
{
int j;
-
+
for (j = XVECLEN (x, i) - 1; j >= 0; j--)
if (alter_subregs (&XVECEXP (x, i, j), final_p))
res = true;
@@ -614,13 +614,13 @@ alter_subregs (rtx *loc, bool final_p)
}
/* Final change of pseudos got hard registers into the corresponding
- hard registers. */
+ hard registers and removing temporary clobbers. */
void
-lra_hard_reg_substitution (void)
+lra_final_code_change (void)
{
int i, hard_regno;
basic_block bb;
- rtx insn;
+ rtx insn, curr;
int max_regno = max_reg_num ();
for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
@@ -628,9 +628,21 @@ lra_hard_reg_substitution (void)
&& (hard_regno = lra_get_regno_hard_regno (i)) >= 0)
SET_REGNO (regno_reg_rtx[i], hard_regno);
FOR_EACH_BB (bb)
- FOR_BB_INSNS (bb, insn)
+ FOR_BB_INSNS_SAFE (bb, insn, curr)
if (INSN_P (insn))
{
+ rtx pat = PATTERN (insn);
+
+ if (GET_CODE (pat) == CLOBBER && LRA_TEMP_CLOBBER_P (pat))
+ {
+ /* Remove clobbers temporarily created in LRA. We don't
+ 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);
+ continue;
+ }
+
lra_insn_recog_data_t id = lra_get_insn_recog_data (insn);
bool insn_change_p = false;
diff --git a/gcc/lra.c b/gcc/lra.c
index a56da78380b..c1cc64e8fed 100644
--- a/gcc/lra.c
+++ b/gcc/lra.c
@@ -44,12 +44,12 @@ along with GCC; see the file COPYING3. If not see
Here is block diagram of LRA passes:
- ---------------------
- | Undo inheritance | --------------- ---------------
+ ---------------------
+ | Undo inheritance | --------------- ---------------
| for spilled pseudos)| | Memory-memory | | New (and old) |
| and splits (for |<----| move coalesce |<-----| pseudos |
| pseudos got the | --------------- | assignment |
- Start | same hard regs) | ---------------
+ Start | same hard regs) | ---------------
| --------------------- ^
V | ---------------- |
----------- V | Update virtual | |
@@ -63,7 +63,7 @@ along with GCC; see the file COPYING3. If not see
| to memory |<-------| RTL |--------->| transformations |
| substitution | | transfor- | | in EBB scope |
---------------- | mations | -------------------
- | ------------
+ | ------------
V
-------------------------
| Hard regs substitution, |
@@ -958,7 +958,7 @@ collect_non_operand_hard_regs (rtx *x, lra_insn_recog_data_t data,
break;
case CLOBBER:
/* We treat clobber of non-operand hard registers as early
- clobber (the behavior is expected from asm). */
+ clobber (the behavior is expected from asm). */
list = collect_non_operand_hard_regs (&XEXP (op, 0), data,
list, OP_OUT, true);
break;
@@ -1055,7 +1055,7 @@ lra_set_insn_recog_data (rtx insn)
if (nop > 0)
{
const char *p = recog_data.constraints[0];
-
+
for (p = constraints[0]; *p; p++)
n += *p == ',';
}
@@ -1241,7 +1241,7 @@ lra_update_insn_recog_data (rtx insn)
int n;
unsigned int uid = INSN_UID (insn);
struct lra_static_insn_data *insn_static_data;
-
+
check_and_expand_insn_recog_data (uid);
if ((data = lra_insn_recog_data[uid]) != NULL
&& data->icode != INSN_CODE (insn))
@@ -1310,7 +1310,7 @@ lra_update_insn_recog_data (rtx insn)
{
int i;
bool *bp;
-
+
n = insn_static_data->n_alternatives;
bp = data->alternative_enabled_p;
lra_assert (n >= 0 && bp != NULL);
@@ -1578,7 +1578,7 @@ add_regs_to_insn_regno_info (lra_insn_recog_data_t data, rtx x, int uid,
break;
case CLOBBER:
/* We treat clobber of non-operand hard registers as early
- clobber (the behavior is expected from asm). */
+ clobber (the behavior is expected from asm). */
add_regs_to_insn_regno_info (data, XEXP (x, 0), uid, OP_OUT, true);
break;
case PRE_INC: case PRE_DEC: case POST_INC: case POST_DEC:
@@ -2026,7 +2026,7 @@ check_rtl (bool final_p)
for (i = 0; i < id->insn_static_data->n_operands; i++)
{
rtx op = *id->operand_loc[i];
-
+
if (MEM_P (op)
&& (GET_MODE (op) != BLKmode
|| GET_CODE (XEXP (op, 0)) != SCRATCH)
@@ -2055,7 +2055,7 @@ has_nonexceptional_receiver (void)
/* If we're not optimizing, then just err on the safe side. */
if (!optimize)
return true;
-
+
/* First determine which blocks can reach exit via normal paths. */
tos = worklist = XNEWVEC (basic_block, n_basic_blocks + 1);
@@ -2065,7 +2065,7 @@ has_nonexceptional_receiver (void)
/* Place the exit block on our worklist. */
EXIT_BLOCK_PTR->flags |= BB_REACHABLE;
*tos++ = EXIT_BLOCK_PTR;
-
+
/* Iterate: find everything reachable from what we've already seen. */
while (tos != worklist)
{
@@ -2155,17 +2155,17 @@ update_inc_notes (void)
/* Set to 1 while in lra. */
int lra_in_progress;
-/* Start of reload pseudo regnos before the new spill pass. */
+/* Start of reload pseudo regnos before the new spill pass. */
int lra_constraint_new_regno_start;
-/* Inheritance pseudo regnos before the new spill pass. */
+/* Inheritance pseudo regnos before the new spill pass. */
bitmap_head lra_inheritance_pseudos;
-/* Split regnos before the new spill pass. */
+/* Split regnos before the new spill pass. */
bitmap_head lra_split_regs;
/* Reload pseudo regnos before the new assign pass which still can be
- spilled after the assinment pass. */
+ spilled after the assinment pass. */
bitmap_head lra_optional_reload_pseudos;
/* First UID of insns generated before a new spill pass. */
@@ -2259,7 +2259,7 @@ lra (FILE *f)
df_set_flags (DF_NO_INSN_RESCAN);
lra_constraint_insn_stack = VEC_alloc (rtx, heap, get_max_uid ());
lra_constraint_insn_stack_bitmap = sbitmap_alloc (get_max_uid ());
- sbitmap_zero (lra_constraint_insn_stack_bitmap);
+ bitmap_clear (lra_constraint_insn_stack_bitmap);
lra_live_ranges_init ();
lra_constraints_init ();
lra_curr_reload_num = 0;
@@ -2307,7 +2307,7 @@ lra (FILE *f)
else
{
/* Do coalescing only for regular algorithms. */
- if (! lra_assign () && lra_coalesce ())
+ if (! lra_assign () && lra_coalesce ())
live_p = false;
if (lra_undo_inheritance ())
live_p = false;
@@ -2334,7 +2334,7 @@ lra (FILE *f)
}
restore_scratches ();
lra_eliminate (true);
- lra_hard_reg_substitution ();
+ lra_final_code_change ();
lra_in_progress = 0;
lra_clear_live_ranges ();
lra_live_ranges_finish ();
@@ -2355,7 +2355,7 @@ lra (FILE *f)
{
sbitmap blocks;
blocks = sbitmap_alloc (last_basic_block);
- sbitmap_ones (blocks);
+ bitmap_ones (blocks);
find_many_sub_basic_blocks (blocks);
sbitmap_free (blocks);
}
diff --git a/gcc/mode-switching.c b/gcc/mode-switching.c
index 1984a694c89..61afdc87835 100644
--- a/gcc/mode-switching.c
+++ b/gcc/mode-switching.c
@@ -482,7 +482,7 @@ optimize_mode_switching (void)
transp = sbitmap_vector_alloc (last_basic_block, n_entities);
comp = sbitmap_vector_alloc (last_basic_block, n_entities);
- sbitmap_vector_ones (transp, last_basic_block);
+ bitmap_vector_ones (transp, last_basic_block);
for (j = n_entities - 1; j >= 0; j--)
{
@@ -591,8 +591,8 @@ optimize_mode_switching (void)
sbitmap *insert;
/* Set the anticipatable and computing arrays. */
- sbitmap_vector_zero (antic, last_basic_block);
- sbitmap_vector_zero (comp, last_basic_block);
+ bitmap_vector_clear (antic, last_basic_block);
+ bitmap_vector_clear (comp, last_basic_block);
for (j = n_entities - 1; j >= 0; j--)
{
int m = current_mode[j] = MODE_PRIORITY_TO_MODE (entity_map[j], i);
@@ -612,7 +612,7 @@ optimize_mode_switching (void)
placement mode switches to modes with priority I. */
FOR_EACH_BB (bb)
- sbitmap_not (kill[bb->index], transp[bb->index]);
+ bitmap_not (kill[bb->index], transp[bb->index]);
edge_list = pre_edge_lcm (n_entities, transp, comp, antic,
kill, &insert, &del);
diff --git a/gcc/modulo-sched.c b/gcc/modulo-sched.c
index 34d2e830225..88ac28d5907 100644
--- a/gcc/modulo-sched.c
+++ b/gcc/modulo-sched.c
@@ -643,7 +643,7 @@ schedule_reg_move (partial_schedule_ptr ps, int i_reg_move,
fprintf (dump_file, "%11d %11d %5s %s\n", start, end, "", "(max, min)");
}
- sbitmap_zero (must_follow);
+ bitmap_clear (must_follow);
SET_BIT (must_follow, move->def);
start = MAX (start, end - (ii - 1));
@@ -767,7 +767,7 @@ schedule_reg_moves (partial_schedule_ptr ps)
move->new_reg = gen_reg_rtx (GET_MODE (prev_reg));
move->num_consecutive_stages = distances[0] && distances[1] ? 2 : 1;
move->insn = gen_move_insn (move->new_reg, copy_rtx (prev_reg));
- sbitmap_zero (move->uses);
+ bitmap_clear (move->uses);
prev_reg = move->new_reg;
}
@@ -982,7 +982,7 @@ optimize_sc (partial_schedule_ptr ps, ddg_ptr g)
goto clear;
}
- sbitmap_ones (sched_nodes);
+ bitmap_ones (sched_nodes);
/* Calculate the new placement of the branch. It should be in row
ii-1 and fall into it's scheduling window. */
@@ -1880,10 +1880,10 @@ get_sched_window (partial_schedule_ptr ps, ddg_node_ptr u_node,
int count_succs;
/* 1. compute sched window for u (start, end, step). */
- sbitmap_zero (psp);
- sbitmap_zero (pss);
- psp_not_empty = sbitmap_a_and_b_cg (psp, u_node_preds, sched_nodes);
- pss_not_empty = sbitmap_a_and_b_cg (pss, u_node_succs, sched_nodes);
+ bitmap_clear (psp);
+ bitmap_clear (pss);
+ psp_not_empty = bitmap_and (psp, u_node_preds, sched_nodes);
+ pss_not_empty = bitmap_and (pss, u_node_succs, sched_nodes);
/* We first compute a forward range (start <= end), then decide whether
to reverse it. */
@@ -2050,8 +2050,8 @@ calculate_must_precede_follow (ddg_node_ptr u_node, int start, int end,
first_cycle_in_window = (step == 1) ? start : end - step;
last_cycle_in_window = (step == 1) ? end - step : start;
- sbitmap_zero (must_precede);
- sbitmap_zero (must_follow);
+ bitmap_clear (must_precede);
+ bitmap_clear (must_follow);
if (dump_file)
fprintf (dump_file, "\nmust_precede: ");
@@ -2159,8 +2159,8 @@ sms_schedule_by_order (ddg_ptr g, int mii, int maxii, int *nodes_order)
partial_schedule_ptr ps = create_partial_schedule (ii, g, DFA_HISTORY);
- sbitmap_ones (tobe_scheduled);
- sbitmap_zero (sched_nodes);
+ bitmap_ones (tobe_scheduled);
+ bitmap_clear (sched_nodes);
while (flush_and_start_over && (ii < maxii))
{
@@ -2168,7 +2168,7 @@ sms_schedule_by_order (ddg_ptr g, int mii, int maxii, int *nodes_order)
if (dump_file)
fprintf (dump_file, "Starting with ii=%d\n", ii);
flush_and_start_over = false;
- sbitmap_zero (sched_nodes);
+ bitmap_clear (sched_nodes);
for (i = 0; i < num_nodes; i++)
{
@@ -2264,7 +2264,7 @@ sms_schedule_by_order (ddg_ptr g, int mii, int maxii, int *nodes_order)
ps = NULL;
}
else
- gcc_assert (sbitmap_equal (tobe_scheduled, sched_nodes));
+ gcc_assert (bitmap_equal_p (tobe_scheduled, sched_nodes));
sbitmap_free (sched_nodes);
sbitmap_free (must_precede);
@@ -2482,7 +2482,7 @@ check_nodes_order (int *node_order, int num_nodes)
int i;
sbitmap tmp = sbitmap_alloc (num_nodes);
- sbitmap_zero (tmp);
+ bitmap_clear (tmp);
if (dump_file)
fprintf (dump_file, "SMS final nodes order: \n");
@@ -2550,8 +2550,8 @@ order_nodes_of_sccs (ddg_all_sccs_ptr all_sccs, int * node_order)
sbitmap tmp = sbitmap_alloc (num_nodes);
sbitmap ones = sbitmap_alloc (num_nodes);
- sbitmap_zero (prev_sccs);
- sbitmap_ones (ones);
+ bitmap_clear (prev_sccs);
+ bitmap_ones (ones);
/* Perform the node ordering starting from the SCC with the highest recMII.
For each SCC order the nodes according to their ASAP/ALAP/HEIGHT etc. */
@@ -2561,14 +2561,14 @@ order_nodes_of_sccs (ddg_all_sccs_ptr all_sccs, int * node_order)
/* Add nodes on paths from previous SCCs to the current SCC. */
find_nodes_on_paths (on_path, g, prev_sccs, scc->nodes);
- sbitmap_a_or_b (tmp, scc->nodes, on_path);
+ bitmap_ior (tmp, scc->nodes, on_path);
/* Add nodes on paths from the current SCC to previous SCCs. */
find_nodes_on_paths (on_path, g, scc->nodes, prev_sccs);
- sbitmap_a_or_b (tmp, tmp, on_path);
+ bitmap_ior (tmp, tmp, on_path);
/* Remove nodes of previous SCCs from current extended SCC. */
- sbitmap_difference (tmp, tmp, prev_sccs);
+ bitmap_and_compl (tmp, tmp, prev_sccs);
pos = order_nodes_in_scc (g, prev_sccs, tmp, node_order, pos);
/* Above call to order_nodes_in_scc updated prev_sccs |= tmp. */
@@ -2578,7 +2578,7 @@ order_nodes_of_sccs (ddg_all_sccs_ptr all_sccs, int * node_order)
to order_nodes_in_scc handles a single connected component. */
while (pos < g->num_nodes)
{
- sbitmap_difference (tmp, ones, prev_sccs);
+ bitmap_and_compl (tmp, ones, prev_sccs);
pos = order_nodes_in_scc (g, prev_sccs, tmp, node_order, pos);
}
sbitmap_free (prev_sccs);
@@ -2751,35 +2751,35 @@ order_nodes_in_scc (ddg_ptr g, sbitmap nodes_ordered, sbitmap scc,
sbitmap predecessors = sbitmap_alloc (num_nodes);
sbitmap successors = sbitmap_alloc (num_nodes);
- sbitmap_zero (predecessors);
+ bitmap_clear (predecessors);
find_predecessors (predecessors, g, nodes_ordered);
- sbitmap_zero (successors);
+ bitmap_clear (successors);
find_successors (successors, g, nodes_ordered);
- sbitmap_zero (tmp);
- if (sbitmap_a_and_b_cg (tmp, predecessors, scc))
+ bitmap_clear (tmp);
+ if (bitmap_and (tmp, predecessors, scc))
{
- sbitmap_copy (workset, tmp);
+ bitmap_copy (workset, tmp);
dir = BOTTOMUP;
}
- else if (sbitmap_a_and_b_cg (tmp, successors, scc))
+ else if (bitmap_and (tmp, successors, scc))
{
- sbitmap_copy (workset, tmp);
+ bitmap_copy (workset, tmp);
dir = TOPDOWN;
}
else
{
int u;
- sbitmap_zero (workset);
+ bitmap_clear (workset);
if ((u = find_max_asap (g, scc)) >= 0)
SET_BIT (workset, u);
dir = BOTTOMUP;
}
- sbitmap_zero (zero_bitmap);
- while (!sbitmap_equal (workset, zero_bitmap))
+ bitmap_clear (zero_bitmap);
+ while (!bitmap_equal_p (workset, zero_bitmap))
{
int v;
ddg_node_ptr v_node;
@@ -2788,45 +2788,45 @@ order_nodes_in_scc (ddg_ptr g, sbitmap nodes_ordered, sbitmap scc,
if (dir == TOPDOWN)
{
- while (!sbitmap_equal (workset, zero_bitmap))
+ while (!bitmap_equal_p (workset, zero_bitmap))
{
v = find_max_hv_min_mob (g, workset);
v_node = &g->nodes[v];
node_order[pos++] = v;
v_node_succs = NODE_SUCCESSORS (v_node);
- sbitmap_a_and_b (tmp, v_node_succs, scc);
+ bitmap_and (tmp, v_node_succs, scc);
/* Don't consider the already ordered successors again. */
- sbitmap_difference (tmp, tmp, nodes_ordered);
- sbitmap_a_or_b (workset, workset, tmp);
+ bitmap_and_compl (tmp, tmp, nodes_ordered);
+ bitmap_ior (workset, workset, tmp);
RESET_BIT (workset, v);
SET_BIT (nodes_ordered, v);
}
dir = BOTTOMUP;
- sbitmap_zero (predecessors);
+ bitmap_clear (predecessors);
find_predecessors (predecessors, g, nodes_ordered);
- sbitmap_a_and_b (workset, predecessors, scc);
+ bitmap_and (workset, predecessors, scc);
}
else
{
- while (!sbitmap_equal (workset, zero_bitmap))
+ while (!bitmap_equal_p (workset, zero_bitmap))
{
v = find_max_dv_min_mob (g, workset);
v_node = &g->nodes[v];
node_order[pos++] = v;
v_node_preds = NODE_PREDECESSORS (v_node);
- sbitmap_a_and_b (tmp, v_node_preds, scc);
+ bitmap_and (tmp, v_node_preds, scc);
/* Don't consider the already ordered predecessors again. */
- sbitmap_difference (tmp, tmp, nodes_ordered);
- sbitmap_a_or_b (workset, workset, tmp);
+ bitmap_and_compl (tmp, tmp, nodes_ordered);
+ bitmap_ior (workset, workset, tmp);
RESET_BIT (workset, v);
SET_BIT (nodes_ordered, v);
}
dir = TOPDOWN;
- sbitmap_zero (successors);
+ bitmap_clear (successors);
find_successors (successors, g, nodes_ordered);
- sbitmap_a_and_b (workset, successors, scc);
+ bitmap_and (workset, successors, scc);
}
}
sbitmap_free (tmp);
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index cf0cc845369..ed1a28f63c4 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -3827,19 +3827,20 @@ objc_get_class_ivars (tree class_name)
struct decl_name_hash : typed_noop_remove <tree_node>
{
- typedef tree_node T;
- static inline hashval_t hash (const T *);
- static inline bool equal (const T *, const T *);
+ typedef tree_node value_type;
+ typedef tree_node compare_type;
+ static inline hashval_t hash (const value_type *);
+ static inline bool equal (const value_type *, const compare_type *);
};
inline hashval_t
-decl_name_hash::hash (const T *q)
+decl_name_hash::hash (const value_type *q)
{
return (hashval_t) ((intptr_t)(DECL_NAME (q)) >> 3);
}
inline bool
-decl_name_hash::equal (const T *a, const T *b)
+decl_name_hash::equal (const value_type *a, const compare_type *b)
{
return DECL_NAME (a) == DECL_NAME (b);
}
diff --git a/gcc/recog.c b/gcc/recog.c
index 466ac6c3e2a..4186183ee54 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -2874,7 +2874,7 @@ split_all_insns (void)
basic_block bb;
blocks = sbitmap_alloc (last_basic_block);
- sbitmap_zero (blocks);
+ bitmap_clear (blocks);
changed = false;
FOR_EACH_BB_REVERSE (bb)
diff --git a/gcc/ree.c b/gcc/ree.c
index 167efa3fe1d..a2ede97b72e 100644
--- a/gcc/ree.c
+++ b/gcc/ree.c
@@ -803,7 +803,7 @@ add_removable_extension (const_rtx expr, rtx insn,
for (def = defs; def; def = def->next)
if ((idx = def_map[INSN_UID(DF_REF_INSN (def->ref))])
&& (cand = &VEC_index (ext_cand, *insn_list, idx - 1))
- && (cand->code != code || cand->mode != mode))
+ && cand->code != code)
{
if (dump_file)
{
diff --git a/gcc/regcprop.c b/gcc/regcprop.c
index 3cda1a7c24e..c2fc79dbfdb 100644
--- a/gcc/regcprop.c
+++ b/gcc/regcprop.c
@@ -1045,7 +1045,7 @@ copyprop_hardreg_forward (void)
all_vd = XNEWVEC (struct value_data, last_basic_block);
visited = sbitmap_alloc (last_basic_block);
- sbitmap_zero (visited);
+ bitmap_clear (visited);
if (MAY_HAVE_DEBUG_INSNS)
debug_insn_changes_pool
diff --git a/gcc/reload1.c b/gcc/reload1.c
index c4c1426b43a..03bd7247795 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -1302,7 +1302,7 @@ reload (rtx first, int global)
{
sbitmap blocks;
blocks = sbitmap_alloc (last_basic_block);
- sbitmap_ones (blocks);
+ bitmap_ones (blocks);
find_many_sub_basic_blocks (blocks);
sbitmap_free (blocks);
}
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 361669ac191..4ee27d99cfe 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -283,7 +283,8 @@ struct GTY((chain_next ("RTX_NEXT (&%h)"),
1 in a NOTE, or EXPR_LIST for a const call.
1 in a JUMP_INSN of an annulling branch.
1 in a CONCAT is VAL_EXPR_IS_CLOBBERED in var-tracking.c.
- 1 in a preserved VALUE is PRESERVED_VALUE_P in cselib.c. */
+ 1 in a preserved VALUE is PRESERVED_VALUE_P in cselib.c.
+ 1 in a clobber temporarily created for LRA. */
unsigned int unchanging : 1;
/* 1 in a MEM or ASM_OPERANDS expression if the memory reference is volatile.
1 in an INSN, CALL_INSN, JUMP_INSN, CODE_LABEL, BARRIER, or NOTE
@@ -1237,6 +1238,77 @@ costs_add_n_insns (struct full_rtx_costs *c, int n)
c->size += COSTS_N_INSNS (n);
}
+/* Information about an address. This structure is supposed to be able
+ to represent all supported target addresses. Please extend it if it
+ is not yet general enough. */
+struct address_info {
+ /* The mode of the value being addressed, or VOIDmode if this is
+ a load-address operation with no known address mode. */
+ enum machine_mode mode;
+
+ /* The address space. */
+ addr_space_t as;
+
+ /* A pointer to the top-level address. */
+ rtx *outer;
+
+ /* A pointer to the inner address, after all address mutations
+ have been stripped from the top-level address. It can be one
+ of the following:
+
+ - A {PRE,POST}_{INC,DEC} of *BASE. SEGMENT, INDEX and DISP are null.
+
+ - A {PRE,POST}_MODIFY of *BASE. In this case either INDEX or DISP
+ points to the step value, depending on whether the step is variable
+ or constant respectively. SEGMENT is null.
+
+ - A plain sum of the form SEGMENT + BASE + INDEX + DISP,
+ with null fields evaluating to 0. */
+ rtx *inner;
+
+ /* Components that make up *INNER. Each one may be null or nonnull.
+ When nonnull, their meanings are as follows:
+
+ - *SEGMENT is the "segment" of memory to which the address refers.
+ This value is entirely target-specific and is only called a "segment"
+ because that's its most typical use. It contains exactly one UNSPEC,
+ pointed to by SEGMENT_TERM. The contents of *SEGMENT do not need
+ reloading.
+
+ - *BASE is a variable expression representing a base address.
+ It contains exactly one REG, SUBREG or MEM, pointed to by BASE_TERM.
+
+ - *INDEX is a variable expression representing an index value.
+ It may be a scaled expression, such as a MULT. It has exactly
+ one REG, SUBREG or MEM, pointed to by INDEX_TERM.
+
+ - *DISP is a constant, possibly mutated. DISP_TERM points to the
+ unmutated RTX_CONST_OBJ. */
+ rtx *segment;
+ rtx *base;
+ rtx *index;
+ rtx *disp;
+
+ rtx *segment_term;
+ rtx *base_term;
+ rtx *index_term;
+ rtx *disp_term;
+
+ /* In a {PRE,POST}_MODIFY address, this points to a second copy
+ of BASE_TERM, otherwise it is null. */
+ rtx *base_term2;
+
+ /* ADDRESS if this structure describes an address operand, MEM if
+ it describes a MEM address. */
+ enum rtx_code addr_outer_code;
+
+ /* If BASE is nonnull, this is the code of the rtx that contains it. */
+ enum rtx_code base_outer_code;
+
+ /* True if this is an RTX_AUTOINC address. */
+ bool autoinc_p;
+};
+
extern void init_rtlanal (void);
extern int rtx_cost (rtx, enum rtx_code, int, bool);
extern int address_cost (rtx, enum machine_mode, addr_space_t, bool);
@@ -1260,6 +1332,14 @@ extern bool constant_pool_constant_p (rtx);
extern bool truncated_to_mode (enum machine_mode, const_rtx);
extern int low_bitmask_len (enum machine_mode, unsigned HOST_WIDE_INT);
extern void split_double (rtx, rtx *, rtx *);
+extern rtx *strip_address_mutations (rtx *, enum rtx_code * = 0);
+extern void decompose_address (struct address_info *, rtx *,
+ enum machine_mode, addr_space_t, enum rtx_code);
+extern void decompose_lea_address (struct address_info *, rtx *);
+extern void decompose_mem_address (struct address_info *, rtx);
+extern void update_address (struct address_info *);
+extern HOST_WIDE_INT get_index_scale (const struct address_info *);
+extern enum rtx_code get_index_code (const struct address_info *);
#ifndef GENERATOR_FILE
/* Return the cost of SET X. SPEED_P is true if optimizing for speed
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index a101a292039..33be5487386 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -38,6 +38,7 @@ along with GCC; see the file COPYING3. If not see
#include "df.h"
#include "tree.h"
#include "emit-rtl.h" /* FIXME: Can go away once crtl is moved to rtl.h. */
+#include "addresses.h"
/* Forward declarations */
static void set_of_1 (rtx, const_rtx, void *);
@@ -3493,10 +3494,7 @@ simplify_subreg_regno (unsigned int xregno, enum machine_mode xmode,
return -1;
if (FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
- /* We should convert arg register in LRA after the elimination
- if it is possible. */
- && xregno == ARG_POINTER_REGNUM
- && ! lra_in_progress)
+ && xregno == ARG_POINTER_REGNUM)
return -1;
if (xregno == STACK_POINTER_REGNUM
@@ -5438,3 +5436,377 @@ split_double (rtx value, rtx *first, rtx *second)
}
}
+/* Strip outer address "mutations" from LOC and return a pointer to the
+ inner value. If OUTER_CODE is nonnull, store the code of the innermost
+ stripped expression there.
+
+ "Mutations" either convert between modes or apply some kind of
+ alignment. */
+
+rtx *
+strip_address_mutations (rtx *loc, enum rtx_code *outer_code)
+{
+ for (;;)
+ {
+ enum rtx_code code = GET_CODE (*loc);
+ if (GET_RTX_CLASS (code) == RTX_UNARY)
+ /* Things like SIGN_EXTEND, ZERO_EXTEND and TRUNCATE can be
+ used to convert between pointer sizes. */
+ loc = &XEXP (*loc, 0);
+ else if (code == AND && CONST_INT_P (XEXP (*loc, 1)))
+ /* (and ... (const_int -X)) is used to align to X bytes. */
+ loc = &XEXP (*loc, 0);
+ else if (code == SUBREG
+ && !OBJECT_P (SUBREG_REG (*loc))
+ && subreg_lowpart_p (*loc))
+ /* (subreg (operator ...) ...) inside and is used for mode
+ conversion too. */
+ loc = &SUBREG_REG (*loc);
+ else
+ return loc;
+ if (outer_code)
+ *outer_code = code;
+ }
+}
+
+/* Return true if X must be a base rather than an index. */
+
+static bool
+must_be_base_p (rtx x)
+{
+ return GET_CODE (x) == LO_SUM;
+}
+
+/* Return true if X must be an index rather than a base. */
+
+static bool
+must_be_index_p (rtx x)
+{
+ return GET_CODE (x) == MULT || GET_CODE (x) == ASHIFT;
+}
+
+/* Set the segment part of address INFO to LOC, given that INNER is the
+ unmutated value. */
+
+static void
+set_address_segment (struct address_info *info, rtx *loc, rtx *inner)
+{
+ gcc_checking_assert (GET_CODE (*inner) == UNSPEC);
+
+ gcc_assert (!info->segment);
+ info->segment = loc;
+ info->segment_term = inner;
+}
+
+/* Set the base part of address INFO to LOC, given that INNER is the
+ unmutated value. */
+
+static void
+set_address_base (struct address_info *info, rtx *loc, rtx *inner)
+{
+ if (GET_CODE (*inner) == LO_SUM)
+ inner = strip_address_mutations (&XEXP (*inner, 0));
+ gcc_checking_assert (REG_P (*inner)
+ || MEM_P (*inner)
+ || GET_CODE (*inner) == SUBREG);
+
+ gcc_assert (!info->base);
+ info->base = loc;
+ info->base_term = inner;
+}
+
+/* Set the index part of address INFO to LOC, given that INNER is the
+ unmutated value. */
+
+static void
+set_address_index (struct address_info *info, rtx *loc, rtx *inner)
+{
+ if ((GET_CODE (*inner) == MULT || GET_CODE (*inner) == ASHIFT)
+ && CONSTANT_P (XEXP (*inner, 1)))
+ inner = strip_address_mutations (&XEXP (*inner, 0));
+ gcc_checking_assert (REG_P (*inner)
+ || MEM_P (*inner)
+ || GET_CODE (*inner) == SUBREG);
+
+ gcc_assert (!info->index);
+ info->index = loc;
+ info->index_term = inner;
+}
+
+/* Set the displacement part of address INFO to LOC, given that INNER
+ is the constant term. */
+
+static void
+set_address_disp (struct address_info *info, rtx *loc, rtx *inner)
+{
+ gcc_checking_assert (CONSTANT_P (*inner));
+
+ gcc_assert (!info->disp);
+ info->disp = loc;
+ info->disp_term = inner;
+}
+
+/* INFO->INNER describes a {PRE,POST}_{INC,DEC} address. Set up the
+ rest of INFO accordingly. */
+
+static void
+decompose_incdec_address (struct address_info *info)
+{
+ info->autoinc_p = true;
+
+ rtx *base = &XEXP (*info->inner, 0);
+ set_address_base (info, base, base);
+ gcc_checking_assert (info->base == info->base_term);
+
+ /* These addresses are only valid when the size of the addressed
+ value is known. */
+ gcc_checking_assert (info->mode != VOIDmode);
+}
+
+/* INFO->INNER describes a {PRE,POST}_MODIFY address. Set up the rest
+ of INFO accordingly. */
+
+static void
+decompose_automod_address (struct address_info *info)
+{
+ info->autoinc_p = true;
+
+ rtx *base = &XEXP (*info->inner, 0);
+ set_address_base (info, base, base);
+ gcc_checking_assert (info->base == info->base_term);
+
+ rtx plus = XEXP (*info->inner, 1);
+ gcc_assert (GET_CODE (plus) == PLUS);
+
+ info->base_term2 = &XEXP (plus, 0);
+ gcc_checking_assert (rtx_equal_p (*info->base_term, *info->base_term2));
+
+ rtx *step = &XEXP (plus, 1);
+ rtx *inner_step = strip_address_mutations (step);
+ if (CONSTANT_P (*inner_step))
+ set_address_disp (info, step, inner_step);
+ else
+ set_address_index (info, step, inner_step);
+}
+
+/* Treat *LOC as a tree of PLUS operands and store pointers to the summed
+ values in [PTR, END). Return a pointer to the end of the used array. */
+
+static rtx **
+extract_plus_operands (rtx *loc, rtx **ptr, rtx **end)
+{
+ rtx x = *loc;
+ if (GET_CODE (x) == PLUS)
+ {
+ ptr = extract_plus_operands (&XEXP (x, 0), ptr, end);
+ ptr = extract_plus_operands (&XEXP (x, 1), ptr, end);
+ }
+ else
+ {
+ gcc_assert (ptr != end);
+ *ptr++ = loc;
+ }
+ return ptr;
+}
+
+/* Evaluate the likelihood of X being a base or index value, returning
+ positive if it is likely to be a base, negative if it is likely to be
+ an index, and 0 if we can't tell. Make the magnitude of the return
+ value reflect the amount of confidence we have in the answer.
+
+ MODE, AS, OUTER_CODE and INDEX_CODE are as for ok_for_base_p_1. */
+
+static int
+baseness (rtx x, enum machine_mode mode, addr_space_t as,
+ enum rtx_code outer_code, enum rtx_code index_code)
+{
+ /* See whether we can be certain. */
+ if (must_be_base_p (x))
+ return 3;
+ if (must_be_index_p (x))
+ return -3;
+
+ /* Believe *_POINTER unless the address shape requires otherwise. */
+ if (REG_P (x) && REG_POINTER (x))
+ return 2;
+ if (MEM_P (x) && MEM_POINTER (x))
+ return 2;
+
+ if (REG_P (x) && HARD_REGISTER_P (x))
+ {
+ /* X is a hard register. If it only fits one of the base
+ or index classes, choose that interpretation. */
+ int regno = REGNO (x);
+ bool base_p = ok_for_base_p_1 (regno, mode, as, outer_code, index_code);
+ bool index_p = REGNO_OK_FOR_INDEX_P (regno);
+ if (base_p != index_p)
+ return base_p ? 1 : -1;
+ }
+ return 0;
+}
+
+/* INFO->INNER describes a normal, non-automodified address.
+ Fill in the rest of INFO accordingly. */
+
+static void
+decompose_normal_address (struct address_info *info)
+{
+ /* Treat the address as the sum of up to four values. */
+ rtx *ops[4];
+ size_t n_ops = extract_plus_operands (info->inner, ops,
+ ops + ARRAY_SIZE (ops)) - ops;
+
+ /* If there is more than one component, any base component is in a PLUS. */
+ if (n_ops > 1)
+ info->base_outer_code = PLUS;
+
+ /* Separate the parts that contain a REG or MEM from those that don't.
+ Record the latter in INFO and leave the former in OPS. */
+ rtx *inner_ops[4];
+ size_t out = 0;
+ for (size_t in = 0; in < n_ops; ++in)
+ {
+ rtx *loc = ops[in];
+ rtx *inner = strip_address_mutations (loc);
+ if (CONSTANT_P (*inner))
+ set_address_disp (info, loc, inner);
+ else if (GET_CODE (*inner) == UNSPEC)
+ set_address_segment (info, loc, inner);
+ else
+ {
+ ops[out] = loc;
+ inner_ops[out] = inner;
+ ++out;
+ }
+ }
+
+ /* Classify the remaining OPS members as bases and indexes. */
+ if (out == 1)
+ {
+ /* Assume that the remaining value is a base unless the shape
+ requires otherwise. */
+ if (!must_be_index_p (*inner_ops[0]))
+ set_address_base (info, ops[0], inner_ops[0]);
+ else
+ set_address_index (info, ops[0], inner_ops[0]);
+ }
+ else if (out == 2)
+ {
+ /* In the event of a tie, assume the base comes first. */
+ if (baseness (*inner_ops[0], info->mode, info->as, PLUS,
+ GET_CODE (*ops[1]))
+ >= baseness (*inner_ops[1], info->mode, info->as, PLUS,
+ GET_CODE (*ops[0])))
+ {
+ set_address_base (info, ops[0], inner_ops[0]);
+ set_address_index (info, ops[1], inner_ops[1]);
+ }
+ else
+ {
+ set_address_base (info, ops[1], inner_ops[1]);
+ set_address_index (info, ops[0], inner_ops[0]);
+ }
+ }
+ else
+ gcc_assert (out == 0);
+}
+
+/* Describe address *LOC in *INFO. MODE is the mode of the addressed value,
+ or VOIDmode if not known. AS is the address space associated with LOC.
+ OUTER_CODE is MEM if *LOC is a MEM address and ADDRESS otherwise. */
+
+void
+decompose_address (struct address_info *info, rtx *loc, enum machine_mode mode,
+ addr_space_t as, enum rtx_code outer_code)
+{
+ memset (info, 0, sizeof (*info));
+ info->mode = mode;
+ info->as = as;
+ info->addr_outer_code = outer_code;
+ info->outer = loc;
+ info->inner = strip_address_mutations (loc, &outer_code);
+ info->base_outer_code = outer_code;
+ switch (GET_CODE (*info->inner))
+ {
+ case PRE_DEC:
+ case PRE_INC:
+ case POST_DEC:
+ case POST_INC:
+ decompose_incdec_address (info);
+ break;
+
+ case PRE_MODIFY:
+ case POST_MODIFY:
+ decompose_automod_address (info);
+ break;
+
+ default:
+ decompose_normal_address (info);
+ break;
+ }
+}
+
+/* Describe address operand LOC in INFO. */
+
+void
+decompose_lea_address (struct address_info *info, rtx *loc)
+{
+ decompose_address (info, loc, VOIDmode, ADDR_SPACE_GENERIC, ADDRESS);
+}
+
+/* Describe the address of MEM X in INFO. */
+
+void
+decompose_mem_address (struct address_info *info, rtx x)
+{
+ gcc_assert (MEM_P (x));
+ decompose_address (info, &XEXP (x, 0), GET_MODE (x),
+ MEM_ADDR_SPACE (x), MEM);
+}
+
+/* Update INFO after a change to the address it describes. */
+
+void
+update_address (struct address_info *info)
+{
+ decompose_address (info, info->outer, info->mode, info->as,
+ info->addr_outer_code);
+}
+
+/* Return the scale applied to *INFO->INDEX_TERM, or 0 if the index is
+ more complicated than that. */
+
+HOST_WIDE_INT
+get_index_scale (const struct address_info *info)
+{
+ rtx index = *info->index;
+ if (GET_CODE (index) == MULT
+ && CONST_INT_P (XEXP (index, 1))
+ && info->index_term == &XEXP (index, 0))
+ return INTVAL (XEXP (index, 1));
+
+ if (GET_CODE (index) == ASHIFT
+ && CONST_INT_P (XEXP (index, 1))
+ && info->index_term == &XEXP (index, 0))
+ return (HOST_WIDE_INT) 1 << INTVAL (XEXP (index, 1));
+
+ if (info->index == info->index_term)
+ return 1;
+
+ return 0;
+}
+
+/* Return the "index code" of INFO, in the form required by
+ ok_for_base_p_1. */
+
+enum rtx_code
+get_index_code (const struct address_info *info)
+{
+ if (info->index)
+ return GET_CODE (*info->index);
+
+ if (info->disp)
+ return GET_CODE (*info->disp);
+
+ return SCRATCH;
+}
diff --git a/gcc/sbitmap.c b/gcc/sbitmap.c
index 6aac459f826..737b0cd7fa7 100644
--- a/gcc/sbitmap.c
+++ b/gcc/sbitmap.c
@@ -238,7 +238,7 @@ sbitmap_vector_alloc (unsigned int n_vecs, unsigned int n_elms)
/* Copy sbitmap SRC to DST. */
void
-sbitmap_copy (sbitmap dst, const_sbitmap src)
+bitmap_copy (sbitmap dst, const_sbitmap src)
{
memcpy (dst->elms, src->elms, sizeof (SBITMAP_ELT_TYPE) * dst->size);
if (dst->popcount)
@@ -248,7 +248,7 @@ sbitmap_copy (sbitmap dst, const_sbitmap src)
/* Copy the first N elements of sbitmap SRC to DST. */
void
-sbitmap_copy_n (sbitmap dst, const_sbitmap src, unsigned int n)
+bitmap_copy_n (sbitmap dst, const_sbitmap src, unsigned int n)
{
memcpy (dst->elms, src->elms, sizeof (SBITMAP_ELT_TYPE) * n);
if (dst->popcount)
@@ -257,7 +257,7 @@ sbitmap_copy_n (sbitmap dst, const_sbitmap src, unsigned int n)
/* Determine if a == b. */
int
-sbitmap_equal (const_sbitmap a, const_sbitmap b)
+bitmap_equal_p (const_sbitmap a, const_sbitmap b)
{
return !memcmp (a->elms, b->elms, sizeof (SBITMAP_ELT_TYPE) * a->size);
}
@@ -265,7 +265,7 @@ sbitmap_equal (const_sbitmap a, const_sbitmap b)
/* Return true if the bitmap is empty. */
bool
-sbitmap_empty_p (const_sbitmap bmap)
+bitmap_empty_p (const_sbitmap bmap)
{
unsigned int i;
for (i=0; i<bmap->size; i++)
@@ -279,7 +279,7 @@ sbitmap_empty_p (const_sbitmap bmap)
START. */
bool
-sbitmap_range_empty_p (const_sbitmap bmap, unsigned int start, unsigned int n)
+bitmap_range_empty_p (const_sbitmap bmap, unsigned int start, unsigned int n)
{
unsigned int i = start / SBITMAP_ELT_BITS;
SBITMAP_ELT_TYPE elm;
@@ -329,7 +329,7 @@ sbitmap_range_empty_p (const_sbitmap bmap, unsigned int start, unsigned int n)
/* Zero all elements in a bitmap. */
void
-sbitmap_zero (sbitmap bmap)
+bitmap_clear (sbitmap bmap)
{
memset (bmap->elms, 0, SBITMAP_SIZE_BYTES (bmap));
if (bmap->popcount)
@@ -339,7 +339,7 @@ sbitmap_zero (sbitmap bmap)
/* Set all elements in a bitmap to ones. */
void
-sbitmap_ones (sbitmap bmap)
+bitmap_ones (sbitmap bmap)
{
unsigned int last_bit;
@@ -361,23 +361,23 @@ sbitmap_ones (sbitmap bmap)
/* Zero a vector of N_VECS bitmaps. */
void
-sbitmap_vector_zero (sbitmap *bmap, unsigned int n_vecs)
+bitmap_vector_clear (sbitmap *bmap, unsigned int n_vecs)
{
unsigned int i;
for (i = 0; i < n_vecs; i++)
- sbitmap_zero (bmap[i]);
+ bitmap_clear (bmap[i]);
}
/* Set a vector of N_VECS bitmaps to ones. */
void
-sbitmap_vector_ones (sbitmap *bmap, unsigned int n_vecs)
+bitmap_vector_ones (sbitmap *bmap, unsigned int n_vecs)
{
unsigned int i;
for (i = 0; i < n_vecs; i++)
- sbitmap_ones (bmap[i]);
+ bitmap_ones (bmap[i]);
}
/* Set DST to be A union (B - C).
@@ -385,7 +385,7 @@ sbitmap_vector_ones (sbitmap *bmap, unsigned int n_vecs)
Returns true if any change is made. */
bool
-sbitmap_union_of_diff_cg (sbitmap dst, const_sbitmap a, const_sbitmap b, const_sbitmap c)
+bitmap_ior_and_compl (sbitmap dst, const_sbitmap a, const_sbitmap b, const_sbitmap c)
{
unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms;
@@ -406,26 +406,10 @@ sbitmap_union_of_diff_cg (sbitmap dst, const_sbitmap a, const_sbitmap b, const_s
return changed != 0;
}
-void
-sbitmap_union_of_diff (sbitmap dst, const_sbitmap a, const_sbitmap b, const_sbitmap c)
-{
- unsigned int i, n = dst->size;
- sbitmap_ptr dstp = dst->elms;
- const_sbitmap_ptr ap = a->elms;
- const_sbitmap_ptr bp = b->elms;
- const_sbitmap_ptr cp = c->elms;
-
- gcc_assert (!dst->popcount && !a->popcount
- && !b->popcount && !c->popcount);
-
- for (i = 0; i < n; i++)
- *dstp++ = *ap++ | (*bp++ & ~*cp++);
-}
-
/* Set bitmap DST to the bitwise negation of the bitmap SRC. */
void
-sbitmap_not (sbitmap dst, const_sbitmap src)
+bitmap_not (sbitmap dst, const_sbitmap src)
{
unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms;
@@ -437,7 +421,7 @@ sbitmap_not (sbitmap dst, const_sbitmap src)
for (i = 0; i < n; i++)
*dstp++ = ~*srcp++;
- /* Zero all bits past n_bits, by ANDing dst with sbitmap_ones. */
+ /* Zero all bits past n_bits, by ANDing dst with bitmap_ones. */
last_bit = src->n_bits % SBITMAP_ELT_BITS;
if (last_bit)
dst->elms[n-1] = dst->elms[n-1]
@@ -448,7 +432,7 @@ sbitmap_not (sbitmap dst, const_sbitmap src)
in A and the bits in B. i.e. dst = a & (~b). */
void
-sbitmap_difference (sbitmap dst, const_sbitmap a, const_sbitmap b)
+bitmap_and_compl (sbitmap dst, const_sbitmap a, const_sbitmap b)
{
unsigned int i, dst_size = dst->size;
unsigned int min_size = dst->size;
@@ -477,7 +461,7 @@ sbitmap_difference (sbitmap dst, const_sbitmap a, const_sbitmap b)
Return false otherwise. */
bool
-sbitmap_any_common_bits (const_sbitmap a, const_sbitmap b)
+bitmap_intersect_p (const_sbitmap a, const_sbitmap b)
{
const_sbitmap_ptr ap = a->elms;
const_sbitmap_ptr bp = b->elms;
@@ -495,28 +479,7 @@ sbitmap_any_common_bits (const_sbitmap a, const_sbitmap b)
Return nonzero if any change is made. */
bool
-sbitmap_a_and_b_cg (sbitmap dst, const_sbitmap a, const_sbitmap b)
-{
- unsigned int i, n = dst->size;
- sbitmap_ptr dstp = dst->elms;
- const_sbitmap_ptr ap = a->elms;
- const_sbitmap_ptr bp = b->elms;
- SBITMAP_ELT_TYPE changed = 0;
-
- gcc_assert (!dst->popcount);
-
- for (i = 0; i < n; i++)
- {
- const SBITMAP_ELT_TYPE tmp = *ap++ & *bp++;
- changed |= *dstp ^ tmp;
- *dstp++ = tmp;
- }
-
- return changed != 0;
-}
-
-void
-sbitmap_a_and_b (sbitmap dst, const_sbitmap a, const_sbitmap b)
+bitmap_and (sbitmap dst, const_sbitmap a, const_sbitmap b)
{
unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms;
@@ -524,6 +487,7 @@ sbitmap_a_and_b (sbitmap dst, const_sbitmap a, const_sbitmap b)
const_sbitmap_ptr bp = b->elms;
bool has_popcount = dst->popcount != NULL;
unsigned char *popcountp = dst->popcount;
+ bool anychange = false;
for (i = 0; i < n; i++)
{
@@ -532,7 +496,10 @@ sbitmap_a_and_b (sbitmap dst, const_sbitmap a, const_sbitmap b)
{
bool wordchanged = (*dstp ^ tmp) != 0;
if (wordchanged)
- *popcountp = do_popcount (tmp);
+ {
+ *popcountp = do_popcount (tmp);
+ anychange = true;
+ }
popcountp++;
}
*dstp++ = tmp;
@@ -541,34 +508,14 @@ sbitmap_a_and_b (sbitmap dst, const_sbitmap a, const_sbitmap b)
if (has_popcount)
sbitmap_verify_popcount (dst);
#endif
+ return anychange;
}
/* Set DST to be (A xor B)).
Return nonzero if any change is made. */
bool
-sbitmap_a_xor_b_cg (sbitmap dst, const_sbitmap a, const_sbitmap b)
-{
- unsigned int i, n = dst->size;
- sbitmap_ptr dstp = dst->elms;
- const_sbitmap_ptr ap = a->elms;
- const_sbitmap_ptr bp = b->elms;
- SBITMAP_ELT_TYPE changed = 0;
-
- gcc_assert (!dst->popcount);
-
- for (i = 0; i < n; i++)
- {
- const SBITMAP_ELT_TYPE tmp = *ap++ ^ *bp++;
- changed |= *dstp ^ tmp;
- *dstp++ = tmp;
- }
-
- return changed != 0;
-}
-
-void
-sbitmap_a_xor_b (sbitmap dst, const_sbitmap a, const_sbitmap b)
+bitmap_xor (sbitmap dst, const_sbitmap a, const_sbitmap b)
{
unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms;
@@ -576,6 +523,7 @@ sbitmap_a_xor_b (sbitmap dst, const_sbitmap a, const_sbitmap b)
const_sbitmap_ptr bp = b->elms;
bool has_popcount = dst->popcount != NULL;
unsigned char *popcountp = dst->popcount;
+ bool anychange = false;
for (i = 0; i < n; i++)
{
@@ -584,7 +532,10 @@ sbitmap_a_xor_b (sbitmap dst, const_sbitmap a, const_sbitmap b)
{
bool wordchanged = (*dstp ^ tmp) != 0;
if (wordchanged)
- *popcountp = do_popcount (tmp);
+ {
+ *popcountp = do_popcount (tmp);
+ anychange = true;
+ }
popcountp++;
}
*dstp++ = tmp;
@@ -593,34 +544,14 @@ sbitmap_a_xor_b (sbitmap dst, const_sbitmap a, const_sbitmap b)
if (has_popcount)
sbitmap_verify_popcount (dst);
#endif
+ return anychange;
}
/* Set DST to be (A or B)).
Return nonzero if any change is made. */
bool
-sbitmap_a_or_b_cg (sbitmap dst, const_sbitmap a, const_sbitmap b)
-{
- unsigned int i, n = dst->size;
- sbitmap_ptr dstp = dst->elms;
- const_sbitmap_ptr ap = a->elms;
- const_sbitmap_ptr bp = b->elms;
- SBITMAP_ELT_TYPE changed = 0;
-
- gcc_assert (!dst->popcount);
-
- for (i = 0; i < n; i++)
- {
- const SBITMAP_ELT_TYPE tmp = *ap++ | *bp++;
- changed |= *dstp ^ tmp;
- *dstp++ = tmp;
- }
-
- return changed != 0;
-}
-
-void
-sbitmap_a_or_b (sbitmap dst, const_sbitmap a, const_sbitmap b)
+bitmap_ior (sbitmap dst, const_sbitmap a, const_sbitmap b)
{
unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms;
@@ -628,6 +559,7 @@ sbitmap_a_or_b (sbitmap dst, const_sbitmap a, const_sbitmap b)
const_sbitmap_ptr bp = b->elms;
bool has_popcount = dst->popcount != NULL;
unsigned char *popcountp = dst->popcount;
+ bool anychange = false;
for (i = 0; i < n; i++)
{
@@ -636,7 +568,10 @@ sbitmap_a_or_b (sbitmap dst, const_sbitmap a, const_sbitmap b)
{
bool wordchanged = (*dstp ^ tmp) != 0;
if (wordchanged)
- *popcountp = do_popcount (tmp);
+ {
+ *popcountp = do_popcount (tmp);
+ anychange = true;
+ }
popcountp++;
}
*dstp++ = tmp;
@@ -645,12 +580,13 @@ sbitmap_a_or_b (sbitmap dst, const_sbitmap a, const_sbitmap b)
if (has_popcount)
sbitmap_verify_popcount (dst);
#endif
+ return anychange;
}
/* Return nonzero if A is a subset of B. */
bool
-sbitmap_a_subset_b_p (const_sbitmap a, const_sbitmap b)
+bitmap_subset_p (const_sbitmap a, const_sbitmap b)
{
unsigned int i, n = a->size;
const_sbitmap_ptr ap, bp;
@@ -666,7 +602,7 @@ sbitmap_a_subset_b_p (const_sbitmap a, const_sbitmap b)
Return nonzero if any change is made. */
bool
-sbitmap_a_or_b_and_c_cg (sbitmap dst, const_sbitmap a, const_sbitmap b, const_sbitmap c)
+bitmap_or_and (sbitmap dst, const_sbitmap a, const_sbitmap b, const_sbitmap c)
{
unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms;
@@ -687,26 +623,11 @@ sbitmap_a_or_b_and_c_cg (sbitmap dst, const_sbitmap a, const_sbitmap b, const_sb
return changed != 0;
}
-void
-sbitmap_a_or_b_and_c (sbitmap dst, const_sbitmap a, const_sbitmap b, const_sbitmap c)
-{
- unsigned int i, n = dst->size;
- sbitmap_ptr dstp = dst->elms;
- const_sbitmap_ptr ap = a->elms;
- const_sbitmap_ptr bp = b->elms;
- const_sbitmap_ptr cp = c->elms;
-
- gcc_assert (!dst->popcount);
-
- for (i = 0; i < n; i++)
- *dstp++ = *ap++ | (*bp++ & *cp++);
-}
-
/* Set DST to be (A and (B or C)).
Return nonzero if any change is made. */
bool
-sbitmap_a_and_b_or_c_cg (sbitmap dst, const_sbitmap a, const_sbitmap b, const_sbitmap c)
+bitmap_and_or (sbitmap dst, const_sbitmap a, const_sbitmap b, const_sbitmap c)
{
unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms;
@@ -727,23 +648,10 @@ sbitmap_a_and_b_or_c_cg (sbitmap dst, const_sbitmap a, const_sbitmap b, const_sb
return changed != 0;
}
-void
-sbitmap_a_and_b_or_c (sbitmap dst, const_sbitmap a, const_sbitmap b, const_sbitmap c)
-{
- unsigned int i, n = dst->size;
- sbitmap_ptr dstp = dst->elms;
- const_sbitmap_ptr ap = a->elms;
- const_sbitmap_ptr bp = b->elms;
- const_sbitmap_ptr cp = c->elms;
-
- for (i = 0; i < n; i++)
- *dstp++ = *ap++ & (*bp++ | *cp++);
-}
-
/* Return number of first bit set in the bitmap, -1 if none. */
int
-sbitmap_first_set_bit (const_sbitmap bmap)
+bitmap_first_set_bit (const_sbitmap bmap)
{
unsigned int n = 0;
sbitmap_iterator sbi;
@@ -756,7 +664,7 @@ sbitmap_first_set_bit (const_sbitmap bmap)
/* Return number of last bit set in the bitmap, -1 if none. */
int
-sbitmap_last_set_bit (const_sbitmap bmap)
+bitmap_last_set_bit (const_sbitmap bmap)
{
int i;
const SBITMAP_ELT_TYPE *const ptr = bmap->elms;
@@ -786,7 +694,7 @@ sbitmap_last_set_bit (const_sbitmap bmap)
}
void
-dump_sbitmap (FILE *file, const_sbitmap bmap)
+dump_bitmap (FILE *file, const_sbitmap bmap)
{
unsigned int i, n, j;
unsigned int set_size = bmap->size;
@@ -807,7 +715,7 @@ dump_sbitmap (FILE *file, const_sbitmap bmap)
}
void
-dump_sbitmap_file (FILE *file, const_sbitmap bmap)
+dump_bitmap_file (FILE *file, const_sbitmap bmap)
{
unsigned int i, pos;
@@ -830,13 +738,13 @@ dump_sbitmap_file (FILE *file, const_sbitmap bmap)
}
DEBUG_FUNCTION void
-debug_sbitmap (const_sbitmap bmap)
+debug_bitmap (const_sbitmap bmap)
{
- dump_sbitmap_file (stderr, bmap);
+ dump_bitmap_file (stderr, bmap);
}
void
-dump_sbitmap_vector (FILE *file, const char *title, const char *subtitle,
+dump_bitmap_vector (FILE *file, const char *title, const char *subtitle,
sbitmap *bmaps, int n_maps)
{
int i;
@@ -845,7 +753,7 @@ dump_sbitmap_vector (FILE *file, const char *title, const char *subtitle,
for (i = 0; i < n_maps; i++)
{
fprintf (file, "%s %d\n", subtitle, i);
- dump_sbitmap (file, bmaps[i]);
+ dump_bitmap (file, bmaps[i]);
}
fprintf (file, "\n");
diff --git a/gcc/sbitmap.h b/gcc/sbitmap.h
index 84aeb8718bc..f7fa7706d0a 100644
--- a/gcc/sbitmap.h
+++ b/gcc/sbitmap.h
@@ -41,24 +41,24 @@ along with GCC; see the file COPYING3. If not see
Most other operations on this set representation are O(U) where U is
the size of the set universe:
- * clear : sbitmap_zero
+ * clear : bitmap_clear
* cardinality : sbitmap_popcount
- * choose_one : sbitmap_first_set_bit /
- sbitmap_last_set_bit
+ * choose_one : bitmap_first_set_bit /
+ bitmap_last_set_bit
* forall : EXECUTE_IF_SET_IN_SBITMAP
- * set_copy : sbitmap_copy / sbitmap_copy_n
- * set_intersection : sbitmap_a_and_b
- * set_union : sbitmap_a_or_b
- * set_difference : sbitmap_difference
+ * set_copy : bitmap_copy / bitmap_copy_n
+ * set_intersection : bitmap_and
+ * set_union : bitmap_ior
+ * set_difference : bitmap_and_compl
* set_disjuction : (not implemented)
- * set_compare : sbitmap_equal
+ * set_compare : bitmap_equal_p
Some operations on 3 sets that occur frequently in in data flow problems
are also implemented:
- * A | (B & C) : sbitmap_a_or_b_and_c
- * A | (B & ~C) : sbitmap_union_of_diff
- * A & (B | C) : sbitmap_a_and_b_or_c
+ * A | (B & C) : bitmap_or_and
+ * A | (B & ~C) : bitmap_ior_and_compl
+ * A & (B | C) : bitmap_and_or
Most of the set functions have two variants: One that returns non-zero
if members were added or removed from the target set, and one that just
@@ -265,54 +265,53 @@ do { \
} \
} while (0)
-#define sbitmap_free(MAP) (free((MAP)->popcount), free((MAP)))
-#define sbitmap_vector_free(VEC) free(VEC)
+inline void sbitmap_free (sbitmap map)
+{
+ free (map->popcount);
+ free (map);
+}
-extern void dump_sbitmap (FILE *, const_sbitmap);
-extern void dump_sbitmap_file (FILE *, const_sbitmap);
-extern void dump_sbitmap_vector (FILE *, const char *, const char *, sbitmap *,
+inline void sbitmap_vector_free (sbitmap * vec)
+{
+ free (vec);
+}
+
+extern void dump_bitmap (FILE *, const_sbitmap);
+extern void dump_bitmap_file (FILE *, const_sbitmap);
+extern void dump_bitmap_vector (FILE *, const char *, const char *, sbitmap *,
int);
extern sbitmap sbitmap_alloc (unsigned int);
extern sbitmap sbitmap_alloc_with_popcount (unsigned int);
extern sbitmap *sbitmap_vector_alloc (unsigned int, unsigned int);
extern sbitmap sbitmap_resize (sbitmap, unsigned int, int);
-extern void sbitmap_copy (sbitmap, const_sbitmap);
-extern void sbitmap_copy_n (sbitmap, const_sbitmap, unsigned int);
-extern int sbitmap_equal (const_sbitmap, const_sbitmap);
-extern bool sbitmap_empty_p (const_sbitmap);
-extern bool sbitmap_range_empty_p (const_sbitmap, unsigned int, unsigned int);
-extern void sbitmap_zero (sbitmap);
-extern void sbitmap_ones (sbitmap);
-extern void sbitmap_vector_zero (sbitmap *, unsigned int);
-extern void sbitmap_vector_ones (sbitmap *, unsigned int);
-
-extern void sbitmap_union_of_diff (sbitmap, const_sbitmap,
- const_sbitmap, const_sbitmap);
-extern bool sbitmap_union_of_diff_cg (sbitmap, const_sbitmap,
+extern void bitmap_copy (sbitmap, const_sbitmap);
+extern void bitmap_copy_n (sbitmap, const_sbitmap, unsigned int);
+extern int bitmap_equal_p (const_sbitmap, const_sbitmap);
+extern bool bitmap_empty_p (const_sbitmap);
+extern bool bitmap_range_empty_p (const_sbitmap, unsigned int, unsigned int);
+extern void bitmap_clear (sbitmap);
+extern void bitmap_ones (sbitmap);
+extern void bitmap_vector_clear (sbitmap *, unsigned int);
+extern void bitmap_vector_ones (sbitmap *, unsigned int);
+
+extern bool bitmap_ior_and_compl (sbitmap, const_sbitmap,
const_sbitmap, const_sbitmap);
-extern void sbitmap_difference (sbitmap, const_sbitmap, const_sbitmap);
-extern void sbitmap_not (sbitmap, const_sbitmap);
-extern void sbitmap_a_or_b_and_c (sbitmap, const_sbitmap,
- const_sbitmap, const_sbitmap);
-extern bool sbitmap_a_or_b_and_c_cg (sbitmap, const_sbitmap,
+extern void bitmap_and_compl (sbitmap, const_sbitmap, const_sbitmap);
+extern void bitmap_not (sbitmap, const_sbitmap);
+extern bool bitmap_or_and (sbitmap, const_sbitmap,
const_sbitmap, const_sbitmap);
-extern void sbitmap_a_and_b_or_c (sbitmap, const_sbitmap,
- const_sbitmap, const_sbitmap);
-extern bool sbitmap_a_and_b_or_c_cg (sbitmap, const_sbitmap,
+extern bool bitmap_and_or (sbitmap, const_sbitmap,
const_sbitmap, const_sbitmap);
-extern bool sbitmap_any_common_bits (const_sbitmap, const_sbitmap);
-extern void sbitmap_a_and_b (sbitmap, const_sbitmap, const_sbitmap);
-extern bool sbitmap_a_and_b_cg (sbitmap, const_sbitmap, const_sbitmap);
-extern void sbitmap_a_or_b (sbitmap, const_sbitmap, const_sbitmap);
-extern bool sbitmap_a_or_b_cg (sbitmap, const_sbitmap, const_sbitmap);
-extern void sbitmap_a_xor_b (sbitmap, const_sbitmap, const_sbitmap);
-extern bool sbitmap_a_xor_b_cg (sbitmap, const_sbitmap, const_sbitmap);
-extern bool sbitmap_a_subset_b_p (const_sbitmap, const_sbitmap);
-
-extern int sbitmap_first_set_bit (const_sbitmap);
-extern int sbitmap_last_set_bit (const_sbitmap);
-
-extern void debug_sbitmap (const_sbitmap);
+extern bool bitmap_intersect_p (const_sbitmap, const_sbitmap);
+extern bool bitmap_and (sbitmap, const_sbitmap, const_sbitmap);
+extern bool bitmap_ior (sbitmap, const_sbitmap, const_sbitmap);
+extern bool bitmap_xor (sbitmap, const_sbitmap, const_sbitmap);
+extern bool bitmap_subset_p (const_sbitmap, const_sbitmap);
+
+extern int bitmap_first_set_bit (const_sbitmap);
+extern int bitmap_last_set_bit (const_sbitmap);
+
+extern void debug_bitmap (const_sbitmap);
extern sbitmap sbitmap_realloc (sbitmap, unsigned int);
extern unsigned long sbitmap_popcount (const_sbitmap, unsigned long);
extern void sbitmap_verify_popcount (const_sbitmap);
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index ba85238e6fd..a0e62b6cc4b 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -644,16 +644,16 @@ haifa_find_rgns (void)
stack = XNEWVEC (edge_iterator, n_edges);
inner = sbitmap_alloc (last_basic_block);
- sbitmap_ones (inner);
+ bitmap_ones (inner);
header = sbitmap_alloc (last_basic_block);
- sbitmap_zero (header);
+ bitmap_clear (header);
in_queue = sbitmap_alloc (last_basic_block);
- sbitmap_zero (in_queue);
+ bitmap_clear (in_queue);
in_stack = sbitmap_alloc (last_basic_block);
- sbitmap_zero (in_stack);
+ bitmap_clear (in_stack);
for (i = 0; i < last_basic_block; i++)
max_hdr[i] = -1;
@@ -798,7 +798,7 @@ haifa_find_rgns (void)
{
degree1 = XNEWVEC (int, last_basic_block);
extended_rgn_header = sbitmap_alloc (last_basic_block);
- sbitmap_zero (extended_rgn_header);
+ bitmap_clear (extended_rgn_header);
}
/* Find blocks which are inner loop headers. We still have non-reducible
@@ -1035,7 +1035,7 @@ haifa_find_rgns (void)
{
free (degree1);
- sbitmap_a_or_b (header, header, extended_rgn_header);
+ bitmap_ior (header, header, extended_rgn_header);
sbitmap_free (extended_rgn_header);
extend_rgns (degree, &idx, header, max_hdr);
@@ -1416,7 +1416,7 @@ compute_dom_prob_ps (int bb)
prob[bb] = 0;
/* Initialize dom[bb] to '111..1'. */
- sbitmap_ones (dom[bb]);
+ bitmap_ones (dom[bb]);
FOR_EACH_EDGE (in_edge, in_ei, BASIC_BLOCK (BB_TO_BLOCK (bb))->preds)
{
@@ -1428,13 +1428,13 @@ compute_dom_prob_ps (int bb)
continue;
pred_bb = BLOCK_TO_BB (in_edge->src->index);
- sbitmap_a_and_b (dom[bb], dom[bb], dom[pred_bb]);
- sbitmap_a_or_b (ancestor_edges[bb],
+ bitmap_and (dom[bb], dom[bb], dom[pred_bb]);
+ bitmap_ior (ancestor_edges[bb],
ancestor_edges[bb], ancestor_edges[pred_bb]);
SET_BIT (ancestor_edges[bb], EDGE_TO_BIT (in_edge));
- sbitmap_a_or_b (pot_split[bb], pot_split[bb], pot_split[pred_bb]);
+ bitmap_ior (pot_split[bb], pot_split[bb], pot_split[pred_bb]);
FOR_EACH_EDGE (out_edge, out_ei, in_edge->src->succs)
SET_BIT (pot_split[bb], EDGE_TO_BIT (out_edge));
@@ -1443,7 +1443,7 @@ compute_dom_prob_ps (int bb)
}
SET_BIT (dom[bb], bb);
- sbitmap_difference (pot_split[bb], pot_split[bb], ancestor_edges[bb]);
+ bitmap_and_compl (pot_split[bb], pot_split[bb], ancestor_edges[bb]);
if (sched_verbose >= 2)
fprintf (sched_dump, ";; bb_prob(%d, %d) = %3d\n", bb, BB_TO_BLOCK (bb),
@@ -1459,9 +1459,9 @@ static void
split_edges (int bb_src, int bb_trg, edgelst *bl)
{
sbitmap src = sbitmap_alloc (SBITMAP_SIZE (pot_split[bb_src]));
- sbitmap_copy (src, pot_split[bb_src]);
+ bitmap_copy (src, pot_split[bb_src]);
- sbitmap_difference (src, src, pot_split[bb_trg]);
+ bitmap_and_compl (src, src, pot_split[bb_trg]);
extract_edgelst (src, bl);
sbitmap_free (src);
}
@@ -1542,7 +1542,7 @@ compute_trg_info (int trg)
overrunning the end of the bblst_table. */
update_idx = 0;
- sbitmap_zero (visited);
+ bitmap_clear (visited);
for (j = 0; j < el.nr_members; j++)
{
block = el.first_member[j]->src;
@@ -3177,7 +3177,7 @@ sched_rgn_compute_dependencies (int rgn)
/* Initialize bitmap used in add_branch_dependences. */
insn_referenced = sbitmap_alloc (sched_max_luid);
- sbitmap_zero (insn_referenced);
+ bitmap_clear (insn_referenced);
/* Compute backward dependencies. */
for (bb = 0; bb < current_nr_blocks; bb++)
@@ -3217,7 +3217,7 @@ sched_rgn_local_init (int rgn)
prob = XNEWVEC (int, current_nr_blocks);
dom = sbitmap_vector_alloc (current_nr_blocks, current_nr_blocks);
- sbitmap_vector_zero (dom, current_nr_blocks);
+ bitmap_vector_clear (dom, current_nr_blocks);
/* Use ->aux to implement EDGE_TO_BIT mapping. */
rgn_nr_edges = 0;
@@ -3241,9 +3241,9 @@ sched_rgn_local_init (int rgn)
/* Split edges. */
pot_split = sbitmap_vector_alloc (current_nr_blocks, rgn_nr_edges);
- sbitmap_vector_zero (pot_split, current_nr_blocks);
+ bitmap_vector_clear (pot_split, current_nr_blocks);
ancestor_edges = sbitmap_vector_alloc (current_nr_blocks, rgn_nr_edges);
- sbitmap_vector_zero (ancestor_edges, current_nr_blocks);
+ bitmap_vector_clear (ancestor_edges, current_nr_blocks);
/* Compute probabilities, dominators, split_edges. */
for (bb = 0; bb < current_nr_blocks; bb++)
diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index 2a7a17066f6..01fc2c42537 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -6094,7 +6094,7 @@ sel_init_pipelining (void)
current_loop_nest = NULL;
bbs_in_loop_rgns = sbitmap_alloc (last_basic_block);
- sbitmap_zero (bbs_in_loop_rgns);
+ bitmap_clear (bbs_in_loop_rgns);
recompute_rev_top_order ();
}
diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index b5bffa11978..f51e8b94371 100644
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -6775,7 +6775,7 @@ init_seqno (bitmap blocks_to_reschedule, basic_block from)
if (blocks_to_reschedule)
{
- sbitmap_ones (visited_bbs);
+ bitmap_ones (visited_bbs);
EXECUTE_IF_SET_IN_BITMAP (blocks_to_reschedule, 0, bbi, bi)
{
gcc_assert (BLOCK_TO_BB (bbi) < current_nr_blocks);
@@ -6784,7 +6784,7 @@ init_seqno (bitmap blocks_to_reschedule, basic_block from)
}
else
{
- sbitmap_zero (visited_bbs);
+ bitmap_clear (visited_bbs);
from = EBB_FIRST_BB (0);
}
diff --git a/gcc/store-motion.c b/gcc/store-motion.c
index 1cda4045b7c..f6712f49bc3 100644
--- a/gcc/store-motion.c
+++ b/gcc/store-motion.c
@@ -849,7 +849,7 @@ remove_reachable_equiv_notes (basic_block bb, struct st_expr *smexpr)
sp = 0;
ei = ei_start (bb->succs);
- sbitmap_zero (visited);
+ bitmap_clear (visited);
act = (EDGE_COUNT (ei_container (ei)) > 0 ? EDGE_I (ei_container (ei), 0) : NULL);
while (1)
@@ -1014,10 +1014,10 @@ build_store_vectors (void)
/* Build the gen_vector. This is any store in the table which is not killed
by aliasing later in its block. */
st_avloc = sbitmap_vector_alloc (last_basic_block, num_stores);
- sbitmap_vector_zero (st_avloc, last_basic_block);
+ bitmap_vector_clear (st_avloc, last_basic_block);
st_antloc = sbitmap_vector_alloc (last_basic_block, num_stores);
- sbitmap_vector_zero (st_antloc, last_basic_block);
+ bitmap_vector_clear (st_antloc, last_basic_block);
for (ptr = first_st_expr (); ptr != NULL; ptr = next_st_expr (ptr))
{
@@ -1050,10 +1050,10 @@ build_store_vectors (void)
}
st_kill = sbitmap_vector_alloc (last_basic_block, num_stores);
- sbitmap_vector_zero (st_kill, last_basic_block);
+ bitmap_vector_clear (st_kill, last_basic_block);
st_transp = sbitmap_vector_alloc (last_basic_block, num_stores);
- sbitmap_vector_zero (st_transp, last_basic_block);
+ bitmap_vector_clear (st_transp, last_basic_block);
regs_set_in_block = XNEWVEC (int, max_gcse_regno);
FOR_EACH_BB (bb)
@@ -1092,10 +1092,10 @@ build_store_vectors (void)
if (dump_file)
{
- dump_sbitmap_vector (dump_file, "st_antloc", "", st_antloc, last_basic_block);
- dump_sbitmap_vector (dump_file, "st_kill", "", st_kill, last_basic_block);
- dump_sbitmap_vector (dump_file, "st_transp", "", st_transp, last_basic_block);
- dump_sbitmap_vector (dump_file, "st_avloc", "", st_avloc, last_basic_block);
+ dump_bitmap_vector (dump_file, "st_antloc", "", st_antloc, last_basic_block);
+ dump_bitmap_vector (dump_file, "st_kill", "", st_kill, last_basic_block);
+ dump_bitmap_vector (dump_file, "st_transp", "", st_transp, last_basic_block);
+ dump_bitmap_vector (dump_file, "st_avloc", "", st_avloc, last_basic_block);
}
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b41a4dce82d..10f98bc76c0 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,7 +1,192 @@
+2012-10-31 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/54955
+ * g++.dg/cpp0x/gen-attrs-48-2.C: New test.
+
+2012-10-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/19105
+ PR tree-optimization/21643
+ PR tree-optimization/46309
+ * gcc.dg/pr19105.c: New test.
+ * gcc.dg/pr21643.c: New test.
+ * gcc.dg/pr46309-2.c: New test.
+ * gcc.c-torture/execute/pr46309.c: New test.
+
+2012-10-31 Alan Modra <amodra@gmail.com>
+
+ * gcc.target/powerpc/dimode_off.c: New.
+ * gcc.target/powerpc/timode_off.c: New.
+ * gcc.target/powerpc/dfmode_off.c: New.
+ * gcc.target/powerpc/tfmode_off.c: New.
+
+2012-10-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR rtl-optimization/55093
+ * gcc.target/i386/pr55093.c: New file.
+
+2012-10-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ * gcc.target/i386/pr55116.c: Renamed to ...
+ * gcc.target/i386/pr55116-1.c: This.
+
+2012-10-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ * gcc.target/i386/pr55116-2.c: New file.
+
+2012-10-30 Richard Biener <rguenther@suse.de>
+
+ * gcc.dg/vect/slp-perm-2.c: Adjust.
+
+2012-10-30 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/55111
+ * gcc.dg/torture/pr55111.c: New testcase.
+
+2012-10-30 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/54988
+ * gcc.target/sh/pr53988.c: New.
+
+2012-10-30 Bin Cheng <bin.cheng@arm.com>
+
+ PR target/54989
+ * gcc.dg/hoist-register-pressure-1.c: Rename from
+ hoist-register-pressure.c. Add nonpic condition.
+ * gcc.dg/hoist-register-pressure-2.c: New testcase.
+
+2012-10-29 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ PR c++/54930
+ * gcc.dg/Wreturn-local-addr.c: New.
+ * g++.dg/warn/Wno-return-local-addr.C: New.
+ * g++.dg/warn/Wreturn-local-addr.C: New.
+
+2012-10-29 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/55116
+ * gcc.target/i386/pr55116.c: New file.
+
+2012-10-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ PR c/53066
+ * gcc.dg/Wshadow-4.c: New.
+ * gcc.dg/Wshadow-4.h: New.
+
+2012-10-29 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/54693
+ * gcc.dg/guality/pr54693.c: New.
+
+2012-10-29 Marc Glisse <marc.glisse@inria.fr>
+
+ PR middle-end/55027
+ * gcc.dg/pr55027.c: New testcase.
+
+2012-10-29 Jan Hubicka <jh@suse.cz>
+
+ * gcc.dg/ipa/inline-6.c: New testcase.
+
+2012-10-29 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR rtl-optimization/55106
+ * g++.dg/pr55106.C: New.
+
+2012-10-29 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/53695
+ * gcc.dg/torture/pr53695.c: New testcase.
+
+2012-10-28 Jan Hubicka <jh@suse.cz>
+
+ * gcc.dg/ipa/inlinehint-3.c: New testcase.
+
+2012-10-28 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/54958
+ * gfortran.dg/do_check_6.f90: New.
+
+2012-10-27 Dominique Dhumieres <dominiq@lps.ens.fr>
+ Jack Howarth <howarth@bromo.med.uc.edu>
+
+ PR target/54404
+ * g++.dg/other/darwin-cfstring1.C: Add -ftrack-macro-expansion=0
+ to dg-options.
+ * obj-c++.dg/strings/const-cfstring-2.mm: Likewise.
+
+2012-10-27 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/34283
+ * gcc.target/i386/pr34283.c: New test.
+
+2012-10-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/55081
+ * g++.dg/opt/pr55081.C: New test.
+
+ PR debug/54970
+ PR debug/54971
+ * gcc.dg/guality/pr54970.c: New test.
+
+2012-10-26 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/54984
+ * g++.dg/template/new11.C: New.
+
+2012-10-26 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/54824
+ * gcc.dg/torture/pr54824.c: New testcase.
+
+2012-10-26 Alexander Ivchenko <alexander.ivchenko@intel.com>
+
+ * gcc.target/i386/fxsave-1.c: New.
+ * gcc.target/i386/fxsave64-1.c: Ditto.
+ * gcc.target/i386/fxrstor-1.c: Ditto.
+ * gcc.target/i386/fxrstor64-1.c: Ditto.
+ * gcc.target/i386/xsave-1.c: Ditto.
+ * gcc.target/i386/xsave64-1.c: Ditto.
+ * gcc.target/i386/xrstor-1.c: Ditto.
+ * gcc.target/i386/xrstor64-1.c: Ditto.
+ * gcc.target/i386/xsaveopt-1.c: Ditto.
+ * gcc.target/i386/xsaveopt64-1.c: Ditto.
+ * gcc.target/i386/sse-12.c: Add -mfxsr, -mxsaveopt.
+ * gcc.target/i386/sse-13.c: Ditto.
+ * gcc.target/i386/sse-14.c: Ditto.
+ * gcc.target/i386/sse-22.c: Ditto.
+ * gcc.target/i386/sse-23.c: Ditto.
+ * g++.dg/other/i386-2.C: Ditto.
+ * g++.dg/other/i386-3.C: Ditto.
+
+2012-10-25 Jan Hubicka <jh@suse.cz>
+
+ * gcc.dg/tree-ssa/cunroll-4.c: Update; we now remove the loop
+ at ivcanon time.
+
+2012-10-25 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/53761
+ * g++.dg/ext/transparent-union.C: New.
+
+2012-10-25 Marc Glisse <marc.glisse@inria.fr>
+
+ PR c++/54427
+ * g++.dg/ext/vector19.C: New testcase.
+
+2012-10-25 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/54902
+ * g++.dg/torture/pr54902.C: New testcase.
+
+2012-10-25 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/34892
+ * g++.dg/template/crash114.C: New.
+
2012-10-24 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/55049
- * gcc.target/i386/pr55049-1.c: New test.
+ * gcc.target/i386/pr55049-1.c: New test.
2012-10-24 Janus Weil <janus@gcc.gnu.org>
@@ -254,8 +439,7 @@
gcc.dg/cpp/cmdlne-dU-17.c, gcc.dg/cpp/cmdlne-dU-18.c,
gcc.dg/cpp/cmdlne-dU-19.c, gcc.dg/cpp/cmdlne-dU-20.c,
gcc.dg/cpp/cmdlne-dU-21.c, gcc.dg/cpp/cmdlne-dU-22.c,
- gcc.dg/cpp/mi5.c, gcc.dg/cpp/multiline.c: Add -nostdinc to
- dg-options.
+ gcc.dg/cpp/mi5.c, gcc.dg/cpp/multiline.c: Add -nostdinc to dg-options.
2012-10-23 Marc Glisse <marc.glisse@inria.fr>
@@ -328,8 +512,8 @@
2012-10-19 Greta Yorsh <Greta.Yorsh@arm.com>
- * lib/target-supports.exp (check_effective_target_arm_prefer_ldrd_strd):
- New procedure.
+ * lib/target-supports.exp
+ (check_effective_target_arm_prefer_ldrd_strd): New procedure.
2012-10-19 Richard Guenther <rguenther@suse.de>
@@ -377,10 +561,8 @@
* gcc.target/arm/ftest-armv8a-arm.c: New testcase.
* gcc.target/arm/ftest-armv8a-thumb.c: Likewise.
- * gcc.target/arm/ftest-support-arm.h (feature_matrix): Add
- ARMv8-A row.
- * gcc.target/arm/ftest-support-thumb.h (feature_matrix):
- Likewise.
+ * gcc.target/arm/ftest-support-arm.h (feature_matrix): Add ARMv8-A row.
+ * gcc.target/arm/ftest-support-thumb.h (feature_matrix): Likewise.
* gcc.target/arm/ftest-support.h (architecture): Add ARMv8-A.
* lib/target-supports.exp: Add ARMv8-A architecture expectation.
@@ -582,8 +764,7 @@
* gcc.dg/vect/pr48765.c: Skip for conflicting options, don't
specify -m64.
- * gcc.target/arm/div64-unwinding.c: Skip, don't xfail, for
- GNU/Linux.
+ * gcc.target/arm/div64-unwinding.c: Skip, don't xfail, for GNU/Linux.
* lib/target-supports.exp (check_effective_target_arm_hard_vfp_ok):
Return 0 if already specifying -mfloat-abi other than hard.
diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted37.C b/gcc/testsuite/g++.dg/cpp0x/defaulted37.C
index 69105cc3146..1926f2eb4cc 100644
--- a/gcc/testsuite/g++.dg/cpp0x/defaulted37.C
+++ b/gcc/testsuite/g++.dg/cpp0x/defaulted37.C
@@ -3,13 +3,11 @@
struct A
{
- int moved = 0;
- A& operator=(A&&) { ++moved; }
- ~A() { if (moved > 1) __builtin_abort(); }
+ A& operator=(A&&);
};
-struct B: virtual A { B& operator=(B&&) = default; };
-struct C: virtual A { }; // { dg-error "operator=.const A&" }
+struct B: virtual A { B& operator=(B&&) = default; }; // { dg-warning "virtual base" }
+struct C: virtual A { }; // { dg-warning "virtual base" }
int main()
{
@@ -17,5 +15,5 @@ int main()
b2 = static_cast<B&&>(b1);
C c1, c2;
- c2 = static_cast<C&&>(c1); // { dg-error "operator=.const C&" }
+ c2 = static_cast<C&&>(c1);
}
diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted39.C b/gcc/testsuite/g++.dg/cpp0x/defaulted39.C
new file mode 100644
index 00000000000..fe847d4e8a9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/defaulted39.C
@@ -0,0 +1,23 @@
+// DR 1402
+// { dg-options -std=c++11 }
+
+template <class T> T&& move(T& t);
+
+struct A
+{
+ A(const A&);
+};
+
+struct B
+{
+ B(B&&);
+};
+
+struct C
+{
+ A a;
+ B b;
+};
+
+extern C c1;
+C c2(move(c1));
diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted40.C b/gcc/testsuite/g++.dg/cpp0x/defaulted40.C
new file mode 100644
index 00000000000..c160b397bd0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/defaulted40.C
@@ -0,0 +1,23 @@
+// DR 1402
+// { dg-options -std=c++11 }
+
+template <class T> T&& move(T& t);
+
+struct A
+{
+ A(const A&);
+};
+
+struct B
+{
+ B(B&&) = delete; // { dg-prune-output "declared" }
+};
+
+struct C // { dg-error "deleted" }
+{
+ A a;
+ B b;
+};
+
+extern C c1;
+C c2(move(c1)); // { dg-error "deleted" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/gen-attrs-48-2.C b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-48-2.C
new file mode 100644
index 00000000000..3cc58976b03
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-48-2.C
@@ -0,0 +1,4 @@
+// Origin: PR c++/54955
+// { dg-do compile { target c++11 } }
+
+alignas(double) int f;
diff --git a/gcc/testsuite/g++.dg/cpp0x/inh-ctor11.C b/gcc/testsuite/g++.dg/cpp0x/inh-ctor11.C
index 8e8ff010ffe..282402ba22d 100644
--- a/gcc/testsuite/g++.dg/cpp0x/inh-ctor11.C
+++ b/gcc/testsuite/g++.dg/cpp0x/inh-ctor11.C
@@ -2,12 +2,12 @@
struct A
{
- A(int, ...);
+ A(int, ...); // { dg-message "declared here" }
};
struct B: A
{
- using A::A;
+ using A::A; // { dg-warning "ellipsis" }
};
B b1(42);
diff --git a/gcc/testsuite/g++.dg/ext/transparent-union.C b/gcc/testsuite/g++.dg/ext/transparent-union.C
new file mode 100644
index 00000000000..12315636100
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/transparent-union.C
@@ -0,0 +1,5 @@
+// PR c++/53761
+
+typedef union { // { dg-error "type transparent" }
+ double x;
+} __attribute__(( __transparent_union__ )) example_t;
diff --git a/gcc/testsuite/g++.dg/ext/vector19.C b/gcc/testsuite/g++.dg/ext/vector19.C
new file mode 100644
index 00000000000..ec08e7cd2b6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/vector19.C
@@ -0,0 +1,56 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-std=c++11 -mavx2" } */
+
+// The target restrictions and the -mavx2 flag are meant to disappear
+// once vector lowering is in place.
+
+typedef double vec __attribute__((vector_size(2*sizeof(double))));
+typedef signed char vec2 __attribute__((vector_size(16)));
+typedef unsigned char vec2u __attribute__((vector_size(16)));
+
+void f (vec *x, vec *y, vec *z)
+{
+ *x = (*y < *z) ? *x : *y;
+}
+
+void g (vec *x, vec *y, vec *z)
+{
+ *x = (*y < *z) ? *x : 42;
+}
+
+void h (vec *x, vec *y, vec *z)
+{
+ *x = (*y < *z) ? 3. : *y;
+}
+
+void i1 (vec *x, vec *y, vec *z)
+{
+ auto c = *y < *z;
+ *x = c ? *x : *y;
+}
+
+void i2 (vec2 *x, vec2 *y, vec2u *z)
+{
+ *x = *y ? *x : *y;
+ *y = *z ? *x : *y;
+}
+
+void j (vec2 *x, vec2 *y, vec2 *z, vec *t)
+{
+ *x = (*y < *z) ? *x : 4.2; /* { dg-error "" } */
+ *y = (*x < *z) ? 2.5 : *y; /* { dg-error "" } */
+ *t = *t ? *t : *t; /* { dg-error "" } */
+ *z = (*x < *z) ? '1' : '0'; /* { dg-error "" } */
+ // The last one may eventually be accepted.
+}
+
+template <class A, class B>
+auto k (A *a, B b) -> decltype (*a ? *a : b);
+
+void k (...) {}
+
+void l (vec2 *v, double x)
+{
+ k (v, x);
+}
+
diff --git a/gcc/testsuite/g++.dg/gomp/tls-template1.C b/gcc/testsuite/g++.dg/gomp/tls-template1.C
new file mode 100644
index 00000000000..5865ce3d98e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/tls-template1.C
@@ -0,0 +1,13 @@
+// { dg-require-effective-target tls }
+
+template <class T> struct B
+{
+ T t;
+};
+
+class A {
+ static B<int> b;
+#pragma omp threadprivate(b)
+};
+
+B<int> A::b;
diff --git a/gcc/testsuite/g++.dg/opt/pr55081.C b/gcc/testsuite/g++.dg/opt/pr55081.C
new file mode 100644
index 00000000000..b4f533e5a73
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr55081.C
@@ -0,0 +1,17 @@
+// PR c++/55081
+// { dg-do compile }
+
+struct R { int field; } r;
+
+__UINTPTR_TYPE__ *
+foo ()
+{
+ static __UINTPTR_TYPE__ array[] = {
+ sizeof (char),
+ (reinterpret_cast <__UINTPTR_TYPE__>(&r.field)
+ - reinterpret_cast <__UINTPTR_TYPE__>(&r)) + 1
+ };
+ return array;
+}
+
+// { dg-final { scan-assembler-not "_ZGVZ3foovE5array" } }
diff --git a/gcc/testsuite/g++.dg/other/darwin-cfstring1.C b/gcc/testsuite/g++.dg/other/darwin-cfstring1.C
index b30ba9bef91..b2def1e8584 100644
--- a/gcc/testsuite/g++.dg/other/darwin-cfstring1.C
+++ b/gcc/testsuite/g++.dg/other/darwin-cfstring1.C
@@ -4,7 +4,7 @@
/* Developed by Ziemowit Laski <zlaski@apple.com>. */
/* { dg-do compile { target *-*-darwin* } } */
-/* { dg-options "-mconstant-cfstrings" } */
+/* { dg-options "-ftrack-macro-expansion=0 -mconstant-cfstrings" } */
#include <CoreFoundation/CFString.h>
diff --git a/gcc/testsuite/g++.dg/other/i386-2.C b/gcc/testsuite/g++.dg/other/i386-2.C
index 197497fcfe9..67dea2aa804 100644
--- a/gcc/testsuite/g++.dg/other/i386-2.C
+++ b/gcc/testsuite/g++.dg/other/i386-2.C
@@ -1,5 +1,5 @@
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
-/* { dg-options "-O -pedantic-errors -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx" } */
+/* { dg-options "-O -pedantic-errors -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt" } */
/* Test that {,x,e,p,t,s,w,a,b,i}mmintrin.h, mm3dnow.h, fma4intrin.h,
xopintrin.h, abmintrin.h, bmiintrin.h, tbmintrin.h, lwpintrin.h,
diff --git a/gcc/testsuite/g++.dg/other/i386-3.C b/gcc/testsuite/g++.dg/other/i386-3.C
index 780731e0358..8b86785e8c2 100644
--- a/gcc/testsuite/g++.dg/other/i386-3.C
+++ b/gcc/testsuite/g++.dg/other/i386-3.C
@@ -1,5 +1,5 @@
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
-/* { dg-options "-O -fkeep-inline-functions -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx" } */
+/* { dg-options "-O -fkeep-inline-functions -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt" } */
/* Test that {,x,e,p,t,s,w,a,b,i}mmintrin.h, mm3dnow.h, fma4intrin.h,
xopintrin.h, abmintrin.h, bmiintrin.h, tbmintrin.h, lwpintrin.h,
diff --git a/gcc/testsuite/g++.dg/pr55106.C b/gcc/testsuite/g++.dg/pr55106.C
new file mode 100644
index 00000000000..4727822f0dd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr55106.C
@@ -0,0 +1,67 @@
+/* { dg-do compile } */
+/* { dg-options "-c -O3" } */
+template<typename _Tp> struct A {
+ typedef _Tp *pointer;
+ typedef _Tp& reference;
+ typedef _Tp& const_reference;
+ template<typename>struct rebind
+ {
+ typedef A other;
+ };
+};
+
+template<typename _Alloc>struct __alloc_traits
+{
+ typedef typename _Alloc::pointer pointer;
+ typedef typename _Alloc::reference reference;
+ typedef typename _Alloc::const_reference const_reference;
+ template<typename _Tp>struct rebind
+ {
+ typedef typename _Alloc::template rebind<_Tp>::other other;
+ };
+};
+template<typename _Tp, typename _Alloc>struct B
+{
+ typedef typename __alloc_traits<_Alloc>::template rebind<
+ _Tp>::other _Tp_alloc_type;
+ typedef typename __alloc_traits<_Tp_alloc_type>::pointer pointer;
+ struct F
+ {
+ pointer _M_start;
+ };
+ F _M_impl;
+};
+template<typename _Tp, typename _Alloc = A<_Tp> >class vec : B<_Tp, _Alloc>{
+ typedef B<_Tp, _Alloc> _Base;
+ typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
+ typedef __alloc_traits<_Tp_alloc_type> _Alloc_traits;
+
+public:
+ typedef _Tp value_type;
+ typedef typename _Alloc_traits::reference reference;
+ typedef typename _Alloc_traits::const_reference const_reference;
+ reference operator[](int p1)
+ {
+ return *(this->_M_impl._M_start + p1);
+ }
+
+ const_reference operator[](long) const;
+};
+
+int a[17];
+class C {
+ vec<int> m_value;
+ void opModDivGuts(const C&);
+ int mostSetBitP1() const;
+};
+void C::opModDivGuts(const C& p1)
+{
+ int b = p1.mostSetBitP1(), c = b + 1;
+ int d[16];
+
+ for (int i = c; i; i--)
+ a[i] = p1.m_value[i] << b;
+
+ for (int i = 0; i < c; i++)
+ m_value[i] = d[i] >> b << -b;
+}
diff --git a/gcc/testsuite/g++.dg/template/crash114.C b/gcc/testsuite/g++.dg/template/crash114.C
new file mode 100644
index 00000000000..cf894ba6967
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/crash114.C
@@ -0,0 +1,5 @@
+// PR c++/34892
+
+template<int=..., int=0> struct A {}; // { dg-error "expected primary" }
+
+A<0> a;
diff --git a/gcc/testsuite/g++.dg/template/new11.C b/gcc/testsuite/g++.dg/template/new11.C
new file mode 100644
index 00000000000..76f6c66997f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/new11.C
@@ -0,0 +1,28 @@
+// PR c++/54984
+// { dg-do run }
+
+int n = 1;
+
+void* operator new(__SIZE_TYPE__)
+{
+ n = -1;
+ return &n;
+}
+
+template <class T>
+struct Foo
+{
+ Foo()
+ : x(new int)
+ {
+ if (*x != -1)
+ __builtin_abort();
+ }
+
+ int* x;
+};
+
+int main()
+{
+ Foo<float> foo;
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr54902.C b/gcc/testsuite/g++.dg/torture/pr54902.C
new file mode 100644
index 00000000000..790ffe5fcb5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr54902.C
@@ -0,0 +1,131 @@
+// { dg-do compile }
+
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Iterator> struct iterator_traits {
+ };
+ template<typename _Tp> struct iterator_traits<_Tp*> {
+ typedef _Tp& reference;
+ };
+}
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
+ using std::iterator_traits;
+ template<typename _Iterator, typename _Container> class __normal_iterator {
+ _Iterator _M_current;
+ typedef iterator_traits<_Iterator> __traits_type;
+ public:
+ typedef typename __traits_type::reference reference;
+ explicit __normal_iterator(const _Iterator& __i) : _M_current(__i) {
+ }
+ reference operator*() const {
+ return *_M_current;
+ }
+ __normal_iterator operator++(int) {
+ return __normal_iterator(_M_current++);
+ }
+ };
+ template<typename _Tp> class new_allocator {
+ public:
+ typedef _Tp* pointer;
+ template<typename _Tp1> struct rebind {
+ typedef new_allocator<_Tp1> other;
+ };
+ };
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Tp> class allocator: public __gnu_cxx::new_allocator<_Tp> {
+ };
+}
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Alloc> struct __alloc_traits {
+ typedef typename _Alloc::pointer pointer;
+ template<typename _Tp> struct rebind {
+ typedef typename _Alloc::template rebind<_Tp>::other other;
+ };
+ };
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Tp, typename _Alloc> struct _Vector_base {
+ typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template rebind<_Tp>::other _Tp_alloc_type;
+ typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>::pointer pointer;
+ struct _Vector_impl : public _Tp_alloc_type {
+ pointer _M_start;
+ };
+ _Vector_impl _M_impl;
+ };
+ template<typename _Tp, typename _Alloc = std::allocator<_Tp> > class vector : protected _Vector_base<_Tp, _Alloc> {
+ typedef _Vector_base<_Tp, _Alloc> _Base;
+ public:
+ typedef typename _Base::pointer pointer;
+ typedef __gnu_cxx::__normal_iterator<pointer, vector> iterator;
+ iterator begin() {
+ return iterator(this->_M_impl._M_start);
+ }
+ };
+}
+class myServer {
+ static std::vector<myServer *> server_list;
+ class Callback;
+ class myFolder *currentFolder;
+ static bool eventloop(Callback *);
+};
+extern "C" {
+ typedef unsigned int uint32_t;
+ typedef uint32_t unicode_char;
+ extern int strcmp (__const char *__s1, __const char *__s2) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+};
+class CursesObj {
+};
+class Curses : public CursesObj {
+public:
+ class Key {
+ public:
+ unicode_char ukey;
+ const char *keycode;
+ Key(unicode_char ch) : ukey(ch), keycode(0) {
+ }
+ bool plain() const {
+ }
+ bool nokey() const {
+ }
+ bool operator==(const Key &k) const {
+ return strcmp(keycode ? keycode:
+ "", k.keycode ? k.keycode:
+ "") == 0 && ukey == k.ukey;
+ }
+ };
+ static bool processKey(const Key &k);
+};
+class CursesContainer : public Curses {
+};
+class myFolder {
+public:
+ void checkExpunged();
+};
+class Typeahead {
+public:
+ static Typeahead *typeahead;
+ bool empty() {
+ }
+ Curses::Key pop() {
+ }
+};
+class CursesScreen : public CursesContainer {
+public:
+ Key getKey();
+};
+using namespace std;
+extern CursesScreen *cursesScreen;
+bool myServer::eventloop(myServer::Callback *callback) {
+ Curses::Key k1= (callback == __null && !Typeahead::typeahead->empty() ? Typeahead::typeahead->pop() : cursesScreen->getKey());
+ if (callback == __null || (k1.plain() && k1.ukey == '\x03')) {
+ if (!k1.nokey()) {
+ bool rc=Curses::processKey(k1);
+ if (rc) { while (k1.plain() && k1 == '\x03' && !Typeahead::typeahead->empty()) Typeahead::typeahead->pop(); }
+ }
+ }
+ vector<myServer *>::iterator b=server_list.begin();
+ while (1) {
+ myServer *p= *b++;
+ if (p->currentFolder) p->currentFolder->checkExpunged();
+ }
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wno-return-local-addr.C b/gcc/testsuite/g++.dg/warn/Wno-return-local-addr.C
new file mode 100644
index 00000000000..e15bfa24f54
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wno-return-local-addr.C
@@ -0,0 +1,26 @@
+// { dg-do assemble }
+// { dg-options "-Wno-return-local-addr" }
+
+int& bad1()
+{
+ int x = 0;
+ return x;
+}
+
+int* bad2()
+{
+ int x = 0;
+ return &x;
+}
+
+int f();
+
+const int& bad3()
+{
+ return f();
+}
+
+const int& bad4()
+{
+ return int();
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wreturn-local-addr.C b/gcc/testsuite/g++.dg/warn/Wreturn-local-addr.C
new file mode 100644
index 00000000000..faa3a345440
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wreturn-local-addr.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// { dg-options "-Werror=return-local-addr" }
+// { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 }
+
+int& bad1()
+{
+ int x = 0; // { dg-error "reference to local variable" }
+ return x;
+}
+
+int* bad2()
+{
+ int x = 0; // { dg-error "address of local variable" }
+ return &x;
+}
+
+const int& bad4()
+{
+ return int(); // { dg-error "returning reference to temporary" }
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20111227-2.c b/gcc/testsuite/gcc.c-torture/execute/20111227-2.c
new file mode 100644
index 00000000000..692c947e9a8
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20111227-2.c
@@ -0,0 +1,44 @@
+/* Testcase derived from 20111227-1.c to ensure that REE is combining
+ redundant zero extends with zero extend to wider mode. */
+/* { dg-options "-fdump-rtl-ree -O" } */
+extern void abort (void);
+
+unsigned short s;
+unsigned int i;
+unsigned long l;
+unsigned char v = -1;
+
+void __attribute__((noinline,noclone))
+bar (int t)
+{
+ if (t == 2 && s != 0xff)
+ abort ();
+ if (t == 1 && i != 0xff)
+ abort ();
+ if (t == 0 && l != 0xff)
+ abort ();
+}
+
+void __attribute__((noinline,noclone))
+foo (unsigned char *a, int t)
+{
+ unsigned char r = v;
+
+ if (t == 2)
+ s = (unsigned short) r;
+ else if (t == 1)
+ i = (unsigned int) r;
+ else if (t == 0)
+ l = (unsigned long) r;
+ bar (t);
+}
+
+int main(void)
+{
+ foo (&v, 0);
+ foo (&v, 1);
+ foo (&v, 2);
+ return 0;
+}
+/* { dg-final { scan-rtl-dump "Elimination opportunities = 3 realized = 3" "ree" } } */
+/* { dg-final { cleanup-rtl-dump "ree" } } */
diff --git a/gcc/testsuite/gcc.c-torture/execute/20111227-3.c b/gcc/testsuite/gcc.c-torture/execute/20111227-3.c
new file mode 100644
index 00000000000..d6726c47355
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20111227-3.c
@@ -0,0 +1,45 @@
+/* Testcase derived from 20111227-1.c to ensure that REE is combining
+ redundant sign extends with sign extend to wider mode. */
+/* { dg-options "-fdump-rtl-ree -O" } */
+
+extern void abort (void);
+
+signed short s;
+signed int i;
+signed long l;
+signed char v = -1;
+
+void __attribute__((noinline,noclone))
+bar (int t)
+{
+ if (t == 2 && s != -1)
+ abort ();
+ if (t == 1 && i != -1)
+ abort ();
+ if (t == 0 && l != -1)
+ abort ();
+}
+
+void __attribute__((noinline,noclone))
+foo (signed char *a, int t)
+{
+ signed char r = v;
+
+ if (t == 2)
+ s = (signed short) r;
+ else if (t == 1)
+ i = (signed int) r;
+ else if (t == 0)
+ l = (signed long) r;
+ bar (t);
+}
+
+int main(void)
+{
+ foo (&v, 0);
+ foo (&v, 1);
+ foo (&v, 2);
+ return 0;
+}
+/* { dg-final { scan-rtl-dump "Elimination opportunities = 3 realized = 3" "ree" } } */
+/* { dg-final { cleanup-rtl-dump "ree" } } */
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr46309.c b/gcc/testsuite/gcc.c-torture/execute/pr46309.c
new file mode 100644
index 00000000000..46e10ab4bf4
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr46309.c
@@ -0,0 +1,31 @@
+/* PR tree-optimization/46309 */
+
+extern void abort (void);
+
+unsigned int *q;
+
+__attribute__((noinline, noclone)) void
+bar (unsigned int *p)
+{
+ if (*p != 2 && *p != 3)
+ (!(!(*q & 263) || *p != 1)) ? abort () : 0;
+}
+
+int
+main ()
+{
+ unsigned int x, y;
+ asm volatile ("" : : : "memory");
+ x = 2;
+ bar (&x);
+ x = 3;
+ bar (&x);
+ y = 1;
+ x = 0;
+ q = &y;
+ bar (&x);
+ y = 0;
+ x = 1;
+ bar (&x);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/Wreturn-local-addr.c b/gcc/testsuite/gcc.dg/Wreturn-local-addr.c
new file mode 100644
index 00000000000..d496d205e89
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wreturn-local-addr.c
@@ -0,0 +1,9 @@
+/* { dg-do assemble } */
+/* { dg-options "-Werror=return-local-addr" } */
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
+
+int* bad()
+{
+ int x = 0;
+ return &x; /* { dg-error "address of local variable" } */
+}
diff --git a/gcc/testsuite/gcc.dg/Wshadow-4.c b/gcc/testsuite/gcc.dg/Wshadow-4.c
new file mode 100644
index 00000000000..f3b986fa603
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wshadow-4.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-options "-Wshadow -Wsystem-headers" } */
+
+#include "Wshadow-4.h"
+extern void index2 (void); /* { dg-message "declaration is here" } */
+
+void foo (double index1,
+ double index2)
+{
+}
+
+void foo1 (void)
+{
+ double index1;
+ double index2;
+}
+
+void foo2 (void)
+{
+ {
+ double index1;
+ double index2;
+ }
+}
+
+void foo3 (void)
+{
+ void (*index1)(void); /* { dg-warning "shadows" } */
+ void (*index2)(void); /* { dg-warning "shadows" } */
+}
+
+void foo4 (void)
+{
+ void index1(void) {}; /* { dg-warning "shadows" } */
+ void index2(void) {}; /* { dg-warning "shadows" } */
+}
+
+/* { dg-message "declaration is here" "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/Wshadow-4.h b/gcc/testsuite/gcc.dg/Wshadow-4.h
new file mode 100644
index 00000000000..5a44ca452ce
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wshadow-4.h
@@ -0,0 +1,3 @@
+#pragma GCC system_header
+extern void index1 (void);
+
diff --git a/gcc/testsuite/gcc.dg/guality/pr54693.c b/gcc/testsuite/gcc.dg/guality/pr54693.c
new file mode 100644
index 00000000000..adc2dfd0326
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/guality/pr54693.c
@@ -0,0 +1,28 @@
+/* PR debug/54693 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+__attribute__((noinline, noclone)) void
+foo (char *str, char c)
+{
+ asm volatile ("" : : "r" (str), "r" (c) : "memory");
+ *str = c;
+}
+
+int
+main ()
+{
+ int i;
+ char c;
+ char arr[11];
+
+ for (i = 0; i < 10; i++)
+ {
+ c = 0x30 + i;
+ foo (&arr[i], c); /* { dg-final { gdb-test 22 "i" "c - 48" } } */
+ }
+
+ __builtin_printf ("arr = %s\n", arr);
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/guality/pr54970.c b/gcc/testsuite/gcc.dg/guality/pr54970.c
new file mode 100644
index 00000000000..bd940e33df9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/guality/pr54970.c
@@ -0,0 +1,47 @@
+/* PR debug/54970 */
+/* PR debug/54971 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+#include "../nop.h"
+
+int
+main ()
+{
+ int a[] = { 1, 2, 3 }; /* { dg-final { gdb-test 15 "a\[0\]" "1" } } */
+ int *p = a + 2; /* { dg-final { gdb-test 15 "a\[1\]" "2" } } */
+ int *q = a + 1; /* { dg-final { gdb-test 15 "a\[2\]" "3" } } */
+ /* { dg-final { gdb-test 15 "*p" "3" } } */
+ asm volatile ("NOP"); /* { dg-final { gdb-test 15 "*q" "2" } } */
+ *p += 10; /* { dg-final { gdb-test 20 "a\[0\]" "1" } } */
+ /* { dg-final { gdb-test 20 "a\[1\]" "2" } } */
+ /* { dg-final { gdb-test 20 "a\[2\]" "13" } } */
+ /* { dg-final { gdb-test 20 "*p" "13" } } */
+ asm volatile ("NOP"); /* { dg-final { gdb-test 20 "*q" "2" } } */
+ *q += 10; /* { dg-final { gdb-test 25 "a\[0\]" "1" } } */
+ /* { dg-final { gdb-test 25 "a\[1\]" "12" } } */
+ /* { dg-final { gdb-test 25 "a\[2\]" "13" } } */
+ /* { dg-final { gdb-test 25 "*p" "13" } } */
+ asm volatile ("NOP"); /* { dg-final { gdb-test 25 "*q" "12" } } */
+ __builtin_memcpy (&a, (int [3]) { 4, 5, 6 }, sizeof (a));
+ /* { dg-final { gdb-test 31 "a\[0\]" "4" } } */
+ /* { dg-final { gdb-test 31 "a\[1\]" "5" } } */
+ /* { dg-final { gdb-test 31 "a\[2\]" "6" } } */
+ /* { dg-final { gdb-test 31 "*p" "6" } } */
+ asm volatile ("NOP"); /* { dg-final { gdb-test 31 "*q" "5" } } */
+ *p += 20; /* { dg-final { gdb-test 36 "a\[0\]" "4" } } */
+ /* { dg-final { gdb-test 36 "a\[1\]" "5" } } */
+ /* { dg-final { gdb-test 36 "a\[2\]" "26" } } */
+ /* { dg-final { gdb-test 36 "*p" "26" } } */
+ asm volatile ("NOP"); /* { dg-final { gdb-test 36 "*q" "5" } } */
+ *q += 20; /* { dg-final { gdb-test 45 "a\[0\]" "4" } } */
+ /* { dg-final { gdb-test 45 "a\[1\]" "25" } } */
+ /* { dg-final { gdb-test 45 "a\[2\]" "26" } } */
+ /* { dg-final { gdb-test 45 "*p" "26" } } */
+ /* { dg-final { gdb-test 45 "p\[-1\]" "25" } } */
+ /* { dg-final { gdb-test 45 "p\[-2\]" "4" } } */
+ /* { dg-final { gdb-test 45 "q\[-1\]" "4" } } */
+ /* { dg-final { gdb-test 45 "q\[1\]" "26" } } */
+ asm volatile ("NOP"); /* { dg-final { gdb-test 45 "*q" "25" } } */
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/hoist-register-pressure.c b/gcc/testsuite/gcc.dg/hoist-register-pressure-1.c
index 6077f1e5782..01e5ed4fbb5 100644
--- a/gcc/testsuite/gcc.dg/hoist-register-pressure.c
+++ b/gcc/testsuite/gcc.dg/hoist-register-pressure-1.c
@@ -1,5 +1,5 @@
/* { dg-options "-Os -fdump-rtl-hoist" } */
-/* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" } } */
+/* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" { target { nonpic } } } } */
#define BUF 100
int a[BUF];
diff --git a/gcc/testsuite/gcc.dg/hoist-register-pressure-2.c b/gcc/testsuite/gcc.dg/hoist-register-pressure-2.c
new file mode 100644
index 00000000000..7f973fec575
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/hoist-register-pressure-2.c
@@ -0,0 +1,32 @@
+/* { dg-options "-Os -fdump-rtl-hoist" } */
+/* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" } } */
+
+#define BUF 100
+int a[BUF];
+
+void com (int);
+void bar (int);
+
+int foo (int x, int y, int z)
+{
+ /* "x+y" won't be hoisted if "-fira-hoist-pressure" is disabled,
+ because its rtx_cost is too small. */
+ if (z)
+ {
+ a[1] = a[0];
+ a[2] = a[1];
+ a[3] = a[3];
+ a[4] = a[5];
+ a[5] = a[7];
+ a[6] = a[11];
+ a[7] = a[13];
+ a[8] = a[17];
+ com (x+y);
+ }
+ else
+ {
+ bar (x+y);
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/ipa/inline-6.c b/gcc/testsuite/gcc.dg/ipa/inline-6.c
new file mode 100644
index 00000000000..d981bb0064e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/inline-6.c
@@ -0,0 +1,42 @@
+/* Check statements that are eliminated by inlining. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-ipa-inline-details -fno-early-inlining -fno-partial-inlining -fno-ipa-cp" } */
+static t(int a)
+{
+ if (a==1)
+ {
+ foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo();
+ foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo();
+ foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo();
+ foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo();
+ foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo();
+ foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo();
+ foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo();
+ }
+ else if (a==2)
+ {
+ bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar();
+ bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar();
+ bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar();
+ bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar();
+ bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar();
+ bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar();
+ }
+ else
+ {
+ bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr();
+ bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr();
+ bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr();
+ bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr();
+ bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr();
+ bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr();
+ }
+}
+main()
+{
+ t(1);
+ t(2);
+}
+/* Even if function is huge, inlining it will save code. */
+/* { dg-final { scan-ipa-dump-times "Inlined into" 2 "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/inlinehint-3.c b/gcc/testsuite/gcc.dg/ipa/inlinehint-3.c
new file mode 100644
index 00000000000..110ae443c67
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/inlinehint-3.c
@@ -0,0 +1,37 @@
+/* { dg-options "-O3 -c -fdump-ipa-inline-details -fno-early-inlining -fno-ipa-cp" } */
+void abort (void);
+int sum;
+int a[10];
+int
+scc_next (int c)
+{
+ int i;
+ for (i=0;i<c;i++)
+ a[i]=c;
+ scc_entry (c);
+}
+int
+scc_entry (int c)
+{
+ int i;
+ for (i=0;i<c;i++)
+ sum+=a[i];
+ if (c--)
+ scc_next (c);
+ return sum;
+}
+main()
+{
+ int sum;
+ int i;
+ for (i=0;i<10;i++)
+ scc_entry (i);
+ if (sum < 0)
+ abort ();
+ return 0;
+}
+/* { dg-final { scan-ipa-dump "in_scc" "inline" } } */
+/* { dg-final { scan-ipa-dump "same_scc" "inline" } } */
+/* Main is not in scc, the two functions are. */
+/* { dg-final { scan-ipa-dump-times "In SCC" 2 "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc/testsuite/gcc.dg/pr19105.c b/gcc/testsuite/gcc.dg/pr19105.c
new file mode 100644
index 00000000000..1267bbf17a7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr19105.c
@@ -0,0 +1,22 @@
+/* PR tree-optimization/19105 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-reassoc1-details" } */
+
+enum e
+{
+ a, b, c, d, e, f, g, h
+};
+
+int range1 (enum e v, int x)
+{
+ return x && v != c && v != d && v != e;
+}
+
+int range2 (enum e v, int x)
+{
+ return x && (v != c && v != d && v != e);
+}
+
+/* { dg-final { scan-tree-dump-times "Optimizing range tests v_\[0-9\]*.D. -.2, 2. and -.3, 4.\[\n\r\]* into" 1 "reassoc1" } } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
+
diff --git a/gcc/testsuite/gcc.dg/pr21643.c b/gcc/testsuite/gcc.dg/pr21643.c
new file mode 100644
index 00000000000..be5a15e98d2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr21643.c
@@ -0,0 +1,90 @@
+/* PR tree-optimization/21643 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-reassoc1-details" } */
+
+int
+f1 (unsigned char c)
+{
+ if (c == 0x22 || c == 0x20 || c < 0x20)
+ return 1;
+ return 0;
+}
+
+int
+f2 (unsigned char c)
+{
+ if (c == 0x22 || c <= 0x20)
+ return 1;
+ return 0;
+}
+
+int
+f3 (unsigned char c)
+{
+ if (c == 0x22)
+ return 1;
+ if (c == 0x20)
+ return 1;
+ if (c < 0x20)
+ return 1;
+ return 0;
+}
+
+int
+f4 (unsigned char c)
+{
+ if (c == 0x22 || c == 0x20 || c < 0x20)
+ return 2;
+ return 0;
+}
+
+int
+f5 (unsigned char c)
+{
+ if (c == 0x22 || c <= 0x20)
+ return 2;
+ return 0;
+}
+
+int
+f6 (unsigned char c)
+{
+ if (c == 0x22)
+ return 2;
+ if (c == 0x20)
+ return 2;
+ if (c < 0x20)
+ return 2;
+ return 0;
+}
+
+int
+f7 (unsigned char c)
+{
+ if (c != 0x22 && c != 0x20 && c >= 0x20)
+ return 0;
+ return 1;
+}
+
+int
+f8 (unsigned char c)
+{
+ if (c == 0x22 && c <= 0x20)
+ return 0;
+ return 1;
+}
+
+int
+f9 (unsigned char c)
+{
+ if (c == 0x22)
+ return 0;
+ if (c == 0x20)
+ return 0;
+ if (c < 0x20)
+ return 0;
+ return 1;
+}
+
+/* { dg-final { scan-tree-dump-times "Optimizing range tests c_\[0-9\]*.D. -.0, 31. and -.32, 32.\[\n\r\]* into" 6 "reassoc1" } } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc/testsuite/gcc.dg/pr46309-2.c b/gcc/testsuite/gcc.dg/pr46309-2.c
new file mode 100644
index 00000000000..f407e660705
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr46309-2.c
@@ -0,0 +1,147 @@
+/* PR tree-optimization/46309 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-reassoc-details" } */
+
+int foo (void);
+
+void
+f1 (int a)
+{
+ _Bool v1 = (a == 3);
+ _Bool v2 = (a == 1);
+ _Bool v3 = (a == 4);
+ _Bool v4 = (a == 2);
+ if (v1 || v2 || v3 || v4)
+ foo ();
+}
+
+void
+f2 (int a)
+{
+ _Bool v1 = (a == 1);
+ _Bool v2 = (a == 2);
+ _Bool v3 = (a == 3);
+ _Bool v4 = (a == 4);
+ if (v1 || v2 || v3 || v4)
+ foo ();
+}
+
+void
+f3 (unsigned int a)
+{
+ _Bool v1 = (a <= 31);
+ _Bool v2 = (a >= 64 && a <= 95);
+ _Bool v3 = (a >= 128 && a <= 159);
+ _Bool v4 = (a >= 192 && a <= 223);
+ if (v1 || v2 || v3 || v4)
+ foo ();
+}
+
+void
+f4 (int a)
+{
+ _Bool v1 = (a == 3);
+ _Bool v2 = (a == 1);
+ _Bool v3 = (a == 4);
+ _Bool v4 = (a == 2);
+ _Bool v5 = (a == 7);
+ _Bool v6 = (a == 5);
+ _Bool v7 = (a == 8);
+ _Bool v8 = (a == 6);
+ if (v1 || v2 || v3 || v4 || v5 || v6 || v7 || v8)
+ foo ();
+}
+
+void
+f5 (int a)
+{
+ _Bool v1 = (a != 3);
+ _Bool v2 = (a != 1);
+ _Bool v3 = (a != 4);
+ _Bool v4 = (a != 2);
+ _Bool v5 = (a != 7);
+ _Bool v6 = (a != 5);
+ _Bool v7 = (a != 8);
+ _Bool v8 = (a != 6);
+ if (v1 && v2 && v3 && v4 && v5 && v6 && v7 && v8)
+ foo ();
+}
+
+void
+f6 (int a)
+{
+ _Bool v1 = (a != 3);
+ _Bool v2 = (a != 1);
+ _Bool v3 = (a != 4);
+ _Bool v4 = (a != 2);
+ _Bool v5 = (a != 7);
+ _Bool v6 = (a != 5);
+ _Bool v7 = (a != 8);
+ _Bool v8 = (a != 6);
+ if ((v1 && v2 && v3 && v4) && (v5 && v6 && v7 && v8))
+ foo ();
+}
+
+int
+f7 (int a)
+{
+ _Bool v1 = (a == 3);
+ _Bool v2 = (a == 1);
+ _Bool v3 = (a == 4);
+ _Bool v4 = (a == 2);
+ _Bool v5 = (a == 7);
+ _Bool v6 = (a == 5);
+ _Bool v7 = (a == 8);
+ _Bool v8 = (a == 6);
+ return v1 || v2 || v3 || v4 || v5 || v6 || v7 || v8;
+}
+
+_Bool
+f8 (int a)
+{
+ _Bool v1 = (a == 3);
+ _Bool v2 = (a == 1);
+ _Bool v3 = (a == 4);
+ _Bool v4 = (a == 2);
+ _Bool v5 = (a == 7);
+ _Bool v6 = (a == 5);
+ _Bool v7 = (a == 8);
+ _Bool v8 = (a == 6);
+ return v1 || v2 || v3 || v4 || v5 || v6 || v7 || v8;
+}
+
+int
+f9 (int a)
+{
+ _Bool v1 = (a != 3);
+ _Bool v2 = (a != 1);
+ _Bool v3 = (a != 4);
+ _Bool v4 = (a != 2);
+ _Bool v5 = (a != 7);
+ _Bool v6 = (a != 5);
+ _Bool v7 = (a != 8);
+ _Bool v8 = (a != 6);
+ return v1 && v2 && v3 && v4 && v5 && v6 && v7 && v8;
+}
+
+_Bool
+f10 (int a)
+{
+ _Bool v1 = (a != 3);
+ _Bool v2 = (a != 1);
+ _Bool v3 = (a != 4);
+ _Bool v4 = (a != 2);
+ _Bool v5 = (a != 7);
+ _Bool v6 = (a != 5);
+ _Bool v7 = (a != 8);
+ _Bool v8 = (a != 6);
+ return v1 && v2 && v3 && v4 && v5 && v6 && v7 && v8;
+}
+
+/* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.1, 1. and -.2, 2. and -.3, 3. and -.4, 4.\[\n\r\]* into" 2 "reassoc1" } } */
+/* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.0, 31. and -.64, 95.\[\n\r\]* into" 1 "reassoc1" } } */
+/* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.128, 159. and -.192, 223.\[\n\r\]* into" 1 "reassoc1" } } */
+/* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.1, 1. and -.2, 2. and -.3, 3. and -.4, 4. and -.5, 5. and -.6, 6. and -.7, 7. and -.8, 8.\[\n\r\]* into" 7 "reassoc1" } } */
+/* { dg-final { scan-tree-dump-times "Optimizing range tests \[^\r\n\]*_\[0-9\]* -.0, 31. and -.128, 159.\[\n\r\]* into" 1 "reassoc2" } } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
+/* { dg-final { cleanup-tree-dump "reassoc2" } } */
diff --git a/gcc/testsuite/gcc.dg/pr55027.c b/gcc/testsuite/gcc.dg/pr55027.c
new file mode 100644
index 00000000000..e72b8fc03dc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr55027.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-Ofast -fdump-tree-optimized-raw" } */
+
+typedef double v2df __attribute__ ((__vector_size__ (2 * sizeof (double))));
+
+void f (v2df *x)
+{
+ *x = 0 + 1 * *x;
+}
+
+/* { dg-final { scan-tree-dump-not "gimple_assign" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/sms-4.c b/gcc/testsuite/gcc.dg/sms-4.c
index 83b32d05a4b..98132e0d0c3 100644
--- a/gcc/testsuite/gcc.dg/sms-4.c
+++ b/gcc/testsuite/gcc.dg/sms-4.c
@@ -1,4 +1,4 @@
-/* Inspired from sbitmap_a_or_b_and_c_cg function in sbitmap.c. */
+/* Inspired from bitmap_or_and function in sbitmap.c. */
/* { dg-do run } */
/* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves -fdump-rtl-sms" } */
/* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves -fdump-rtl-sms --param sms-min-sc=1" { target powerpc*-*-* } } */
diff --git a/gcc/testsuite/gcc.dg/torture/pr53695.c b/gcc/testsuite/gcc.dg/torture/pr53695.c
new file mode 100644
index 00000000000..eba0843c4a2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr53695.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-ftracer" } */
+
+void
+foo (const void **p)
+{
+ void *labs[] = { &&l1, &&l2, &&l3 };
+l1:
+ goto *p++;
+l2:
+ goto *p;
+l3:
+ ;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr54824.c b/gcc/testsuite/gcc.dg/torture/pr54824.c
new file mode 100644
index 00000000000..82b822b0993
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr54824.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+void __attribute__((noreturn)) bar(void)
+{
+}
+
+void foo(int i, char *p, char *q)
+{
+ while (*p++) {
+ if (i)
+ p++;
+ if (!*q++)
+ bar();
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr55111.c b/gcc/testsuite/gcc.dg/torture/pr55111.c
new file mode 100644
index 00000000000..f5b0692c8e0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr55111.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+
+int a, b, c;
+long d;
+unsigned long *e;
+
+int f(void)
+{
+ for(;; a++)
+ {
+ if(c)
+ {
+ for(b = d = 0; b < 1; b++)
+ e = &d;
+
+ --*e;
+
+ if(d > 0)
+ a = 0;
+
+ return d;
+ }
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/cunroll-4.c b/gcc/testsuite/gcc.dg/tree-ssa/cunroll-4.c
index 02c94260a32..e42919c342f 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/cunroll-4.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/cunroll-4.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O3 -fdump-tree-cunroll-details" } */
+/* { dg-options "-O3 -fdump-tree-ivcanon-details" } */
int a[1];
test(int c)
{
@@ -16,6 +16,6 @@ test(int c)
/* We should do this as part of cunrolli, but our cost model do not take into account early exit
from the last iteration. */
-/* { dg-final { scan-tree-dump "Turned loop 1 to non-loop; it never loops." "cunrolli"} } */
-/* { dg-final { scan-tree-dump "Last iteration exit edge was proved true." "cunrolli"} } */
-/* { dg-final { cleanup-tree-dump "cunroll" } } */
+/* { dg-final { scan-tree-dump "Turned loop 1 to non-loop; it never loops." "ivcanon"} } */
+/* { dg-final { scan-tree-dump "Last iteration exit edge was proved true." "ivcanon"} } */
+/* { dg-final { cleanup-tree-dump "ivcanon" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-2.c b/gcc/testsuite/gcc.dg/vect/slp-perm-2.c
index 1bc95e2e98b..27156f4829e 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-perm-2.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-perm-2.c
@@ -12,7 +12,8 @@
#define N 16
-void foo (unsigned int *__restrict__ pInput, unsigned int *__restrict__ pOutput)
+void __attribute__((noinline))
+foo (unsigned int *__restrict__ pInput, unsigned int *__restrict__ pOutput)
{
unsigned int i, a, b;
diff --git a/gcc/testsuite/gcc.target/i386/fxrstor-1.c b/gcc/testsuite/gcc.target/i386/fxrstor-1.c
new file mode 100644
index 00000000000..0e1ca191f5e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/fxrstor-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-mfxsr -O2" } */
+/* { dg-final { scan-assembler "fxrstor\[ \\t\]" } } */
+
+#include <x86intrin.h>
+
+void extern
+fxsave_test (void)
+{
+ char fxsave_region [512] __attribute__((aligned(16)));
+ _fxrstor (fxsave_region);
+}
diff --git a/gcc/testsuite/gcc.target/i386/fxrstor64-1.c b/gcc/testsuite/gcc.target/i386/fxrstor64-1.c
new file mode 100644
index 00000000000..fbdb1f6fef8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/fxrstor64-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-mfxsr -O2" } */
+/* { dg-final { scan-assembler "fxrstor64\[ \\t\]" } } */
+
+#include <x86intrin.h>
+
+void extern
+fxsave_test (void)
+{
+ char fxsave_region [512] __attribute__((aligned(16)));
+ _fxrstor64 (fxsave_region);
+}
diff --git a/gcc/testsuite/gcc.target/i386/fxsave-1.c b/gcc/testsuite/gcc.target/i386/fxsave-1.c
new file mode 100644
index 00000000000..567af8d0e44
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/fxsave-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-mfxsr -O2" } */
+/* { dg-final { scan-assembler "fxsave\[ \\t\]" } } */
+
+#include <x86intrin.h>
+
+void extern
+fxsave_test (void)
+{
+ char fxsave_region [512] __attribute__((aligned(16)));
+ _fxsave (fxsave_region);
+}
diff --git a/gcc/testsuite/gcc.target/i386/fxsave64-1.c b/gcc/testsuite/gcc.target/i386/fxsave64-1.c
new file mode 100644
index 00000000000..317548ad674
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/fxsave64-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-mfxsr -O2" } */
+/* { dg-final { scan-assembler "fxsave64\[ \\t\]" } } */
+
+#include <x86intrin.h>
+
+void extern
+fxsave_test (void)
+{
+ char fxsave_region [512] __attribute__((aligned(16)));
+ _fxsave64 (fxsave_region);
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr34283.c b/gcc/testsuite/gcc.target/i386/pr34283.c
new file mode 100644
index 00000000000..60e11a5097e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr34283.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -msse4" } */
+
+typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
+typedef long long __v2di __attribute__ ((__vector_size__ (16)));
+
+__m128i _mm_set_epi64x (long long __q1, long long __q0)
+{
+ return __extension__ (__m128i)(__v2di){ __q0, __q1 };
+}
+
+/* { dg-final { scan-assembler-not "movdqa" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr55093.c b/gcc/testsuite/gcc.target/i386/pr55093.c
new file mode 100644
index 00000000000..76b4042302f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr55093.c
@@ -0,0 +1,80 @@
+/* { dg-do compile { target { ! { ia32 } } } } */
+/* { dg-options "-O2 -mx32 -maddress-mode=long" } */
+
+typedef union tree_node *tree;
+typedef const union tree_node *const_tree;
+typedef struct {
+ unsigned long long low;
+ long long high;
+} double_int;
+struct real_value {
+};
+struct real_format {
+ int has_signed_zero;
+};
+extern const struct real_format * real_format_for_mode[];
+extern int real_isnegzero (const struct real_value *);
+enum tree_code { REAL_CST, SSA_NAME };
+struct tree_base {
+ enum tree_code code : 16;
+ union {
+ unsigned int version;
+ }
+ u;
+};
+extern void tree_check_failed (const_tree, const char *, int, const char *, ...) __attribute__ ((__noreturn__));
+union tree_node {
+ struct tree_base base;
+};
+inline tree tree_check (tree __t, const char *__f, int __l, const char *__g, enum tree_code __c) {
+ if (((enum tree_code) (__t)->base.code) != __c)
+ tree_check_failed (__t, __f, __l, __g, __c, 0);
+ return __t;
+}
+struct prop_value_d {
+ int lattice_val;
+ tree value;
+ double_int mask;
+};
+typedef struct prop_value_d prop_value_t;
+static prop_value_t *const_val;
+static void canonicalize_float_value (prop_value_t *);
+typedef void (*ssa_prop_visit_stmt_fn) (prop_value_t);
+typedef void (*ssa_prop_visit_phi_fn) (void);
+typedef void (*ssa_prop_fold_stmt_fn) (void *gsi);
+typedef void (*ssa_prop_get_value_fn) ( prop_value_t *val);
+void ssa_propagate (ssa_prop_visit_stmt_fn, ssa_prop_visit_phi_fn);
+int substitute_and_fold (ssa_prop_get_value_fn, ssa_prop_fold_stmt_fn);
+void ccp_fold_stmt (void *);
+static void get_constant_value (prop_value_t *val) {
+ canonicalize_float_value (val);
+}
+static void canonicalize_float_value (prop_value_t *val) {
+ int mode;
+ struct real_value d;
+ if (val->lattice_val != 1
+ || ((enum tree_code) (val->value)->base.code) != REAL_CST)
+ return;
+ mode = val->lattice_val;
+ if (real_format_for_mode[mode]->has_signed_zero && real_isnegzero (&d))
+ ccp_fold_stmt (0);
+}
+static void set_lattice_value (tree var, prop_value_t new_val) {
+ prop_value_t *old_val = &const_val[(tree_check ((var), "",
+ 0, "",
+ (SSA_NAME)))->base.u.version];
+ canonicalize_float_value (&new_val);
+ canonicalize_float_value (old_val);
+}
+static void ccp_visit_phi_node (void) {
+ prop_value_t new_val;
+ set_lattice_value (0, new_val);
+}
+static void ccp_visit_stmt (prop_value_t v) {
+ set_lattice_value (0, v);
+}
+unsigned int do_ssa_ccp (void) {
+ ssa_propagate (ccp_visit_stmt, ccp_visit_phi_node);
+ substitute_and_fold (get_constant_value, ccp_fold_stmt);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr55116-1.c b/gcc/testsuite/gcc.target/i386/pr55116-1.c
new file mode 100644
index 00000000000..de272445aa2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr55116-1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile { target { ! { ia32 } } } } */
+/* { dg-options "-O2 -mx32 -maddress-mode=long" } */
+
+int glob_int_arr[100];
+int glob_int = 4;
+
+void
+expr_global (void)
+{
+ __builtin_prefetch (glob_int_arr + glob_int, 0, 0);
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr55116-2.c b/gcc/testsuite/gcc.target/i386/pr55116-2.c
new file mode 100644
index 00000000000..7ef8eade06b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr55116-2.c
@@ -0,0 +1,86 @@
+/* { dg-do compile { target { ! { ia32 } } } } */
+/* { dg-options "-O2 -mx32 -maddress-mode=long" } */
+
+typedef struct rtx_def *rtx;
+enum rtx_code { MINUS };
+union rtunion_def {
+ rtx rt_rtx;
+};
+typedef union rtunion_def rtunion;
+struct rtx_def {
+ enum rtx_code code: 16;
+ union u {
+ rtunion fld[1];
+ }
+ u;
+};
+rtx simplify_binary_operation (enum rtx_code code, int mode,
+ rtx op0, rtx op1);
+struct simplify_plus_minus_op_data {
+ rtx op;
+ short neg;
+};
+void simplify_plus_minus (enum rtx_code code, int mode, rtx op0, rtx op1)
+{
+ struct simplify_plus_minus_op_data ops[8];
+ rtx tem = (rtx) 0;
+ int n_ops = 2, input_ops = 2;
+ int changed, canonicalized = 0;
+ int i, j;
+ __builtin_memset (ops, 0, sizeof (ops));
+ do
+ {
+ changed = 0;
+ for (i = 0; i < n_ops; i++)
+ {
+ rtx this_op = ops[i].op;
+ int this_neg = ops[i].neg;
+ enum rtx_code this_code = ((enum rtx_code) (this_op)->code);
+ switch (this_code)
+ {
+ case MINUS:
+ if (n_ops == 7)
+ return;
+ n_ops++;
+ input_ops++;
+ changed = 1;
+ canonicalized |= this_neg;
+ break;
+ }
+ }
+ }
+ while (changed);
+ do
+ {
+ j = n_ops - 1;
+ for (i = n_ops - 1; j >= 0; j--)
+ {
+ rtx lhs = ops[j].op, rhs = ops[i].op;
+ int lneg = ops[j].neg, rneg = ops[i].neg;
+ if (lhs != 0 && rhs != 0)
+ {
+ enum rtx_code ncode = MINUS;
+ if (((enum rtx_code) (lhs)->code) == MINUS)
+ tem = simplify_binary_operation (ncode, mode, lhs, rhs);
+ if (tem && ! (((enum rtx_code) (tem)->code) == MINUS
+ && ((((((tem)->u.fld[0]).rt_rtx))->u.fld[0]).rt_rtx) == lhs
+ && ((((((tem)->u.fld[0]).rt_rtx))->u.fld[1]).rt_rtx) == rhs))
+ {
+ lneg &= rneg;
+ ops[i].op = tem;
+ ops[i].neg = lneg;
+ ops[j].op = (rtx) 0;
+ changed = 1;
+ canonicalized = 1;
+ }
+ }
+ }
+ for (i = 0, j = 0; j < n_ops; j++)
+ if (ops[j].op)
+ {
+ ops[i] = ops[j];
+ i++;
+ }
+ }
+ while (changed);
+}
diff --git a/gcc/testsuite/gcc.target/i386/sse-12.c b/gcc/testsuite/gcc.target/i386/sse-12.c
index 0d78a0c84dc..c1c5745ef0b 100644
--- a/gcc/testsuite/gcc.target/i386/sse-12.c
+++ b/gcc/testsuite/gcc.target/i386/sse-12.c
@@ -3,7 +3,7 @@
popcntintrin.h and mm_malloc.h are usable
with -O -std=c89 -pedantic-errors. */
/* { dg-do compile } */
-/* { dg-options "-O -std=c89 -pedantic-errors -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx" } */
+/* { dg-options "-O -std=c89 -pedantic-errors -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt" } */
#include <x86intrin.h>
diff --git a/gcc/testsuite/gcc.target/i386/sse-13.c b/gcc/testsuite/gcc.target/i386/sse-13.c
index 4c575baaf78..1d777d12e4f 100644
--- a/gcc/testsuite/gcc.target/i386/sse-13.c
+++ b/gcc/testsuite/gcc.target/i386/sse-13.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx" } */
+/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt" } */
#include <mm_malloc.h>
diff --git a/gcc/testsuite/gcc.target/i386/sse-14.c b/gcc/testsuite/gcc.target/i386/sse-14.c
index c8c13cecb53..331be0e1987 100644
--- a/gcc/testsuite/gcc.target/i386/sse-14.c
+++ b/gcc/testsuite/gcc.target/i386/sse-14.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O0 -Werror-implicit-function-declaration -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx" } */
+/* { dg-options "-O0 -Werror-implicit-function-declaration -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt" } */
#include <mm_malloc.h>
diff --git a/gcc/testsuite/gcc.target/i386/sse-22.c b/gcc/testsuite/gcc.target/i386/sse-22.c
index ec832552874..8e4c4bd3ebd 100644
--- a/gcc/testsuite/gcc.target/i386/sse-22.c
+++ b/gcc/testsuite/gcc.target/i386/sse-22.c
@@ -50,7 +50,7 @@
#ifndef DIFFERENT_PRAGMAS
-#pragma GCC target ("sse4a,3dnow,avx,avx2,fma4,xop,aes,pclmul,popcnt,abm,lzcnt,bmi,bmi2,tbm,lwp,fsgsbase,rdrnd,f16c,rtm,rdseed,prfchw,adx")
+#pragma GCC target ("sse4a,3dnow,avx,avx2,fma4,xop,aes,pclmul,popcnt,abm,lzcnt,bmi,bmi2,tbm,lwp,fsgsbase,rdrnd,f16c,rtm,rdseed,prfchw,adx,fxsr,xsaveopt")
#endif
/* Following intrinsics require immediate arguments. They
@@ -264,7 +264,7 @@ test_2 (_mm_clmulepi64_si128, __m128i, __m128i, __m128i, 1)
/* x86intrin.h (FMA4/XOP/LWP/BMI/BMI2/TBM/LZCNT/FMA). */
#ifdef DIFFERENT_PRAGMAS
-#pragma GCC target ("fma4,xop,lwp,bmi,bmi2,tbm,lzcnt,fma,rdseed,prfchw,adx")
+#pragma GCC target ("fma4,xop,lwp,bmi,bmi2,tbm,lzcnt,fma,rdseed,prfchw,adx,fxsr,xsaveopt")
#endif
#include <x86intrin.h>
/* xopintrin.h */
diff --git a/gcc/testsuite/gcc.target/i386/sse-23.c b/gcc/testsuite/gcc.target/i386/sse-23.c
index f046ef643b5..069f8e7cb80 100644
--- a/gcc/testsuite/gcc.target/i386/sse-23.c
+++ b/gcc/testsuite/gcc.target/i386/sse-23.c
@@ -183,7 +183,7 @@
/* rtmintrin.h */
#define __builtin_ia32_xabort(M) __builtin_ia32_xabort(1)
-#pragma GCC target ("sse4a,3dnow,avx,avx2,fma4,xop,aes,pclmul,popcnt,abm,lzcnt,bmi,bmi2,tbm,lwp,fsgsbase,rdrnd,f16c,fma,rtm,rdseed,prfchw,adx")
+#pragma GCC target ("sse4a,3dnow,avx,avx2,fma4,xop,aes,pclmul,popcnt,abm,lzcnt,bmi,bmi2,tbm,lwp,fsgsbase,rdrnd,f16c,fma,rtm,rdseed,prfchw,adx,fxsr,xsaveopt")
#include <wmmintrin.h>
#include <smmintrin.h>
#include <mm3dnow.h>
diff --git a/gcc/testsuite/gcc.target/i386/xrstor-1.c b/gcc/testsuite/gcc.target/i386/xrstor-1.c
new file mode 100644
index 00000000000..3e701394890
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/xrstor-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-mavx -O2" } */
+/* { dg-final { scan-assembler "xrstor\[ \\t\]" } } */
+
+#include <x86intrin.h>
+
+void extern
+xsave_test (void)
+{
+ char xsave_region [512] __attribute__((aligned(64)));
+ _xrstor (xsave_region, ((long long) 0xA0000000F));
+}
diff --git a/gcc/testsuite/gcc.target/i386/xrstor64-1.c b/gcc/testsuite/gcc.target/i386/xrstor64-1.c
new file mode 100644
index 00000000000..3cf2a66cc95
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/xrstor64-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-mxsave -O2" } */
+/* { dg-final { scan-assembler "xrstor64\[ \\t\]" } } */
+
+#include <x86intrin.h>
+
+void extern
+xsave_test (void)
+{
+ char xsave_region [512] __attribute__((aligned(64)));
+ _xrstor64 (xsave_region, ((long long) 0xA0000000F));
+}
diff --git a/gcc/testsuite/gcc.target/i386/xsave-1.c b/gcc/testsuite/gcc.target/i386/xsave-1.c
new file mode 100644
index 00000000000..9eee5973921
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/xsave-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-mxsave -O2" } */
+/* { dg-final { scan-assembler "xsave\[ \\t\]" } } */
+
+#include <x86intrin.h>
+
+void extern
+xsave_test (void)
+{
+ char xsave_region [512] __attribute__((aligned(64)));
+ _xsave (xsave_region, ((long long) 0xA0000000F));
+}
diff --git a/gcc/testsuite/gcc.target/i386/xsave64-1.c b/gcc/testsuite/gcc.target/i386/xsave64-1.c
new file mode 100644
index 00000000000..661da9171c4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/xsave64-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-mxsave -O2" } */
+/* { dg-final { scan-assembler "xsave64\[ \\t\]" } } */
+
+#include <x86intrin.h>
+
+void extern
+xsave_test (void)
+{
+ char xsave_region [512] __attribute__((aligned(64)));
+ _xsave64 (xsave_region, ((long long) 0xA0000000F));
+}
diff --git a/gcc/testsuite/gcc.target/i386/xsaveopt-1.c b/gcc/testsuite/gcc.target/i386/xsaveopt-1.c
new file mode 100644
index 00000000000..b08a50a2340
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/xsaveopt-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-mxsaveopt -O2" } */
+/* { dg-final { scan-assembler "xsaveopt\[ \\t\]" } } */
+
+#include <x86intrin.h>
+
+void extern
+xsave_test (void)
+{
+ char xsaveopt_region [512] __attribute__((aligned(64)));
+ _xsaveopt (xsaveopt_region, ((long long) 0xA0000000F));
+}
diff --git a/gcc/testsuite/gcc.target/i386/xsaveopt64-1.c b/gcc/testsuite/gcc.target/i386/xsaveopt64-1.c
new file mode 100644
index 00000000000..f7864fe3999
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/xsaveopt64-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-mxsaveopt -O2" } */
+/* { dg-final { scan-assembler "xsaveopt64\[ \\t\]" } } */
+
+#include <x86intrin.h>
+
+void extern
+xsave_test (void)
+{
+ char xsaveopt_region [512] __attribute__((aligned(64)));
+ _xsaveopt64 (xsaveopt_region, ((long long) 0xA0000000F));
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/dfmode_off.c b/gcc/testsuite/gcc.target/powerpc/dfmode_off.c
new file mode 100644
index 00000000000..ab711195fac
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/dfmode_off.c
@@ -0,0 +1,47 @@
+/* { dg-do assemble } */
+/* { dg-options "-O2 -fno-align-functions -mtraceback=no -save-temps" } */
+
+void w1 (void *x, double y) { *(double *) (x + 32767) = y; }
+void w2 (void *x, double y) { *(double *) (x + 32766) = y; }
+void w3 (void *x, double y) { *(double *) (x + 32765) = y; }
+void w4 (void *x, double y) { *(double *) (x + 32764) = y; }
+void w5 (void *x, double y) { *(double *) (x + 32763) = y; }
+void w6 (void *x, double y) { *(double *) (x + 32762) = y; }
+void w7 (void *x, double y) { *(double *) (x + 32761) = y; }
+void w8 (void *x, double y) { *(double *) (x + 32760) = y; }
+void w9 (void *x, double y) { *(double *) (x + 32759) = y; }
+void w10 (void *x, double y) { *(double *) (x + 32758) = y; }
+void w11 (void *x, double y) { *(double *) (x + 32757) = y; }
+void w12 (void *x, double y) { *(double *) (x + 32756) = y; }
+void w13 (void *x, double y) { *(double *) (x + 32755) = y; }
+void w14 (void *x, double y) { *(double *) (x + 32754) = y; }
+void w15 (void *x, double y) { *(double *) (x + 32753) = y; }
+void w16 (void *x, double y) { *(double *) (x + 32752) = y; }
+void w17 (void *x, double y) { *(double *) (x + 32751) = y; }
+void w18 (void *x, double y) { *(double *) (x + 32750) = y; }
+void w19 (void *x, double y) { *(double *) (x + 32749) = y; }
+void w20 (void *x, double y) { *(double *) (x + 32748) = y; }
+
+double r1 (void *x) { return *(double *) (x + 32767); }
+double r2 (void *x) { return *(double *) (x + 32766); }
+double r3 (void *x) { return *(double *) (x + 32765); }
+double r4 (void *x) { return *(double *) (x + 32764); }
+double r5 (void *x) { return *(double *) (x + 32763); }
+double r6 (void *x) { return *(double *) (x + 32762); }
+double r7 (void *x) { return *(double *) (x + 32761); }
+double r8 (void *x) { return *(double *) (x + 32760); }
+double r9 (void *x) { return *(double *) (x + 32759); }
+double r10 (void *x) { return *(double *) (x + 32758); }
+double r11 (void *x) { return *(double *) (x + 32757); }
+double r12 (void *x) { return *(double *) (x + 32756); }
+double r13 (void *x) { return *(double *) (x + 32755); }
+double r14 (void *x) { return *(double *) (x + 32754); }
+double r15 (void *x) { return *(double *) (x + 32753); }
+double r16 (void *x) { return *(double *) (x + 32752); }
+double r17 (void *x) { return *(double *) (x + 32751); }
+double r18 (void *x) { return *(double *) (x + 32750); }
+double r19 (void *x) { return *(double *) (x + 32749); }
+double r20 (void *x) { return *(double *) (x + 32748); }
+
+/* { dg-final { object-size text == 320 } } */
+/* { dg-final { cleanup-saved-temps "dfmode_off" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/dimode_off.c b/gcc/testsuite/gcc.target/powerpc/dimode_off.c
new file mode 100644
index 00000000000..3d7489b59bc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/dimode_off.c
@@ -0,0 +1,50 @@
+/* { dg-do assemble } */
+/* { dg-options "-O2 -fno-align-functions -mtraceback=no -save-temps" } */
+
+void w1 (void *x, long long y) { *(long long *) (x + 32767) = y; }
+void w2 (void *x, long long y) { *(long long *) (x + 32766) = y; }
+void w3 (void *x, long long y) { *(long long *) (x + 32765) = y; }
+void w4 (void *x, long long y) { *(long long *) (x + 32764) = y; }
+void w5 (void *x, long long y) { *(long long *) (x + 32763) = y; }
+void w6 (void *x, long long y) { *(long long *) (x + 32762) = y; }
+void w7 (void *x, long long y) { *(long long *) (x + 32761) = y; }
+void w8 (void *x, long long y) { *(long long *) (x + 32760) = y; }
+void w9 (void *x, long long y) { *(long long *) (x + 32759) = y; }
+void w10 (void *x, long long y) { *(long long *) (x + 32758) = y; }
+void w11 (void *x, long long y) { *(long long *) (x + 32757) = y; }
+void w12 (void *x, long long y) { *(long long *) (x + 32756) = y; }
+void w13 (void *x, long long y) { *(long long *) (x + 32755) = y; }
+void w14 (void *x, long long y) { *(long long *) (x + 32754) = y; }
+void w15 (void *x, long long y) { *(long long *) (x + 32753) = y; }
+void w16 (void *x, long long y) { *(long long *) (x + 32752) = y; }
+void w17 (void *x, long long y) { *(long long *) (x + 32751) = y; }
+void w18 (void *x, long long y) { *(long long *) (x + 32750) = y; }
+void w19 (void *x, long long y) { *(long long *) (x + 32749) = y; }
+void w20 (void *x, long long y) { *(long long *) (x + 32748) = y; }
+
+long long r1 (void *x) { return *(long long *) (x + 32767); }
+long long r2 (void *x) { return *(long long *) (x + 32766); }
+long long r3 (void *x) { return *(long long *) (x + 32765); }
+long long r4 (void *x) { return *(long long *) (x + 32764); }
+long long r5 (void *x) { return *(long long *) (x + 32763); }
+long long r6 (void *x) { return *(long long *) (x + 32762); }
+long long r7 (void *x) { return *(long long *) (x + 32761); }
+long long r8 (void *x) { return *(long long *) (x + 32760); }
+long long r9 (void *x) { return *(long long *) (x + 32759); }
+long long r10 (void *x) { return *(long long *) (x + 32758); }
+long long r11 (void *x) { return *(long long *) (x + 32757); }
+long long r12 (void *x) { return *(long long *) (x + 32756); }
+long long r13 (void *x) { return *(long long *) (x + 32755); }
+long long r14 (void *x) { return *(long long *) (x + 32754); }
+long long r15 (void *x) { return *(long long *) (x + 32753); }
+long long r16 (void *x) { return *(long long *) (x + 32752); }
+long long r17 (void *x) { return *(long long *) (x + 32751); }
+long long r18 (void *x) { return *(long long *) (x + 32750); }
+long long r19 (void *x) { return *(long long *) (x + 32749); }
+long long r20 (void *x) { return *(long long *) (x + 32748); }
+
+/* { dg-final { object-size text == 440 { target { lp64 } } } } */
+/* 32-bit test should really be == 512 bytes, see pr54110 */
+/* { dg-final { object-size text <= 640 { target { ilp32 } } } } */
+/* { dg-final { scan-assembler-not "(st|l)fd" } } */
+/* { dg-final { cleanup-saved-temps "dimode_off" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/tfmode_off.c b/gcc/testsuite/gcc.target/powerpc/tfmode_off.c
new file mode 100644
index 00000000000..17d31413f15
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/tfmode_off.c
@@ -0,0 +1,49 @@
+/* { dg-do assemble } */
+/* { dg-options "-O2 -fno-align-functions -mtraceback=no -save-temps" } */
+
+typedef float TFmode __attribute__ ((mode (TF)));
+
+void w1 (void *x, TFmode y) { *(TFmode *) (x + 32767) = y; }
+void w2 (void *x, TFmode y) { *(TFmode *) (x + 32766) = y; }
+void w3 (void *x, TFmode y) { *(TFmode *) (x + 32765) = y; }
+void w4 (void *x, TFmode y) { *(TFmode *) (x + 32764) = y; }
+void w5 (void *x, TFmode y) { *(TFmode *) (x + 32763) = y; }
+void w6 (void *x, TFmode y) { *(TFmode *) (x + 32762) = y; }
+void w7 (void *x, TFmode y) { *(TFmode *) (x + 32761) = y; }
+void w8 (void *x, TFmode y) { *(TFmode *) (x + 32760) = y; }
+void w9 (void *x, TFmode y) { *(TFmode *) (x + 32759) = y; }
+void w10 (void *x, TFmode y) { *(TFmode *) (x + 32758) = y; }
+void w11 (void *x, TFmode y) { *(TFmode *) (x + 32757) = y; }
+void w12 (void *x, TFmode y) { *(TFmode *) (x + 32756) = y; }
+void w13 (void *x, TFmode y) { *(TFmode *) (x + 32755) = y; }
+void w14 (void *x, TFmode y) { *(TFmode *) (x + 32754) = y; }
+void w15 (void *x, TFmode y) { *(TFmode *) (x + 32753) = y; }
+void w16 (void *x, TFmode y) { *(TFmode *) (x + 32752) = y; }
+void w17 (void *x, TFmode y) { *(TFmode *) (x + 32751) = y; }
+void w18 (void *x, TFmode y) { *(TFmode *) (x + 32750) = y; }
+void w19 (void *x, TFmode y) { *(TFmode *) (x + 32749) = y; }
+void w20 (void *x, TFmode y) { *(TFmode *) (x + 32748) = y; }
+
+TFmode r1 (void *x) { return *(TFmode *) (x + 32767); }
+TFmode r2 (void *x) { return *(TFmode *) (x + 32766); }
+TFmode r3 (void *x) { return *(TFmode *) (x + 32765); }
+TFmode r4 (void *x) { return *(TFmode *) (x + 32764); }
+TFmode r5 (void *x) { return *(TFmode *) (x + 32763); }
+TFmode r6 (void *x) { return *(TFmode *) (x + 32762); }
+TFmode r7 (void *x) { return *(TFmode *) (x + 32761); }
+TFmode r8 (void *x) { return *(TFmode *) (x + 32760); }
+TFmode r9 (void *x) { return *(TFmode *) (x + 32759); }
+TFmode r10 (void *x) { return *(TFmode *) (x + 32758); }
+TFmode r11 (void *x) { return *(TFmode *) (x + 32757); }
+TFmode r12 (void *x) { return *(TFmode *) (x + 32756); }
+TFmode r13 (void *x) { return *(TFmode *) (x + 32755); }
+TFmode r14 (void *x) { return *(TFmode *) (x + 32754); }
+TFmode r15 (void *x) { return *(TFmode *) (x + 32753); }
+TFmode r16 (void *x) { return *(TFmode *) (x + 32752); }
+TFmode r17 (void *x) { return *(TFmode *) (x + 32751); }
+TFmode r18 (void *x) { return *(TFmode *) (x + 32750); }
+TFmode r19 (void *x) { return *(TFmode *) (x + 32749); }
+TFmode r20 (void *x) { return *(TFmode *) (x + 32748); }
+
+/* { dg-final { object-size text == 544 } } */
+/* { dg-final { cleanup-saved-temps "tfmode_off" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/timode_off.c b/gcc/testsuite/gcc.target/powerpc/timode_off.c
new file mode 100644
index 00000000000..a8ca68e8e35
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/timode_off.c
@@ -0,0 +1,51 @@
+/* { dg-do assemble { target { lp64 } } } */
+/* { dg-options "-O2 -fno-align-functions -mtraceback=no -save-temps" } */
+
+typedef int TImode __attribute__ ((mode (TI)));
+
+void w1 (void *x, TImode y) { *(TImode *) (x + 32767) = y; }
+void w2 (void *x, TImode y) { *(TImode *) (x + 32766) = y; }
+void w3 (void *x, TImode y) { *(TImode *) (x + 32765) = y; }
+void w4 (void *x, TImode y) { *(TImode *) (x + 32764) = y; }
+void w5 (void *x, TImode y) { *(TImode *) (x + 32763) = y; }
+void w6 (void *x, TImode y) { *(TImode *) (x + 32762) = y; }
+void w7 (void *x, TImode y) { *(TImode *) (x + 32761) = y; }
+void w8 (void *x, TImode y) { *(TImode *) (x + 32760) = y; }
+void w9 (void *x, TImode y) { *(TImode *) (x + 32759) = y; }
+void w10 (void *x, TImode y) { *(TImode *) (x + 32758) = y; }
+void w11 (void *x, TImode y) { *(TImode *) (x + 32757) = y; }
+void w12 (void *x, TImode y) { *(TImode *) (x + 32756) = y; }
+void w13 (void *x, TImode y) { *(TImode *) (x + 32755) = y; }
+void w14 (void *x, TImode y) { *(TImode *) (x + 32754) = y; }
+void w15 (void *x, TImode y) { *(TImode *) (x + 32753) = y; }
+void w16 (void *x, TImode y) { *(TImode *) (x + 32752) = y; }
+void w17 (void *x, TImode y) { *(TImode *) (x + 32751) = y; }
+void w18 (void *x, TImode y) { *(TImode *) (x + 32750) = y; }
+void w19 (void *x, TImode y) { *(TImode *) (x + 32749) = y; }
+void w20 (void *x, TImode y) { *(TImode *) (x + 32748) = y; }
+
+TImode r1 (void *x) { return *(TImode *) (x + 32767); }
+TImode r2 (void *x) { return *(TImode *) (x + 32766); }
+TImode r3 (void *x) { return *(TImode *) (x + 32765); }
+TImode r4 (void *x) { return *(TImode *) (x + 32764); }
+TImode r5 (void *x) { return *(TImode *) (x + 32763); }
+TImode r6 (void *x) { return *(TImode *) (x + 32762); }
+TImode r7 (void *x) { return *(TImode *) (x + 32761); }
+TImode r8 (void *x) { return *(TImode *) (x + 32760); }
+TImode r9 (void *x) { return *(TImode *) (x + 32759); }
+TImode r10 (void *x) { return *(TImode *) (x + 32758); }
+TImode r11 (void *x) { return *(TImode *) (x + 32757); }
+TImode r12 (void *x) { return *(TImode *) (x + 32756); }
+TImode r13 (void *x) { return *(TImode *) (x + 32755); }
+TImode r14 (void *x) { return *(TImode *) (x + 32754); }
+TImode r15 (void *x) { return *(TImode *) (x + 32753); }
+TImode r16 (void *x) { return *(TImode *) (x + 32752); }
+TImode r17 (void *x) { return *(TImode *) (x + 32751); }
+TImode r18 (void *x) { return *(TImode *) (x + 32750); }
+TImode r19 (void *x) { return *(TImode *) (x + 32749); }
+TImode r20 (void *x) { return *(TImode *) (x + 32748); }
+
+/* test should really be == 616, see pr54110 */
+/* { dg-final { object-size text <= 700 } } */
+/* { dg-final { scan-assembler-not "(st|l)fd" } } */
+/* { dg-final { cleanup-saved-temps "timode_off" } } */
diff --git a/gcc/testsuite/gcc.target/sh/pr53988.c b/gcc/testsuite/gcc.target/sh/pr53988.c
new file mode 100644
index 00000000000..4bade1efb73
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sh/pr53988.c
@@ -0,0 +1,74 @@
+/* Check that the tst Rm,Rn instruction is generated for QImode and HImode
+ values loaded from memory. If everything goes as expected we won't see
+ any sign/zero extensions or and ops. On SH2A we don't expect to see the
+ movu insn. */
+/* { dg-do compile { target "sh*-*-*" } } */
+/* { dg-options "-O1" } */
+/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */
+/* { dg-final { scan-assembler-times "tst\tr" 8 } } */
+/* { dg-final { scan-assembler-not "tst\t#255" } } */
+/* { dg-final { scan-assembler-not "exts|extu|and|movu" } } */
+
+int
+test00 (char* a, char* b, int c, int d)
+{
+ if (*a & *b)
+ return c;
+ return d;
+}
+
+int
+test01 (unsigned char* a, unsigned char* b, int c, int d)
+{
+ if (*a & *b)
+ return c;
+ return d;
+}
+
+int
+test02 (short* a, short* b, int c, int d)
+{
+ if (*a & *b)
+ return c;
+ return d;
+}
+
+int
+test03 (unsigned short* a, unsigned short* b, int c, int d)
+{
+ if (*a & *b)
+ return c;
+ return d;
+}
+
+int
+test04 (char* a, short* b, int c, int d)
+{
+ if (*a & *b)
+ return c;
+ return d;
+}
+
+int
+test05 (short* a, char* b, int c, int d)
+{
+ if (*a & *b)
+ return c;
+ return d;
+}
+
+int
+test06 (int* a, char* b, int c, int d)
+{
+ if (*a & *b)
+ return c;
+ return d;
+}
+
+int
+test07 (int* a, short* b, int c, int d)
+{
+ if (*a & *b)
+ return c;
+ return d;
+}
diff --git a/gcc/testsuite/gfortran.dg/do_check_6.f90 b/gcc/testsuite/gfortran.dg/do_check_6.f90
new file mode 100644
index 00000000000..2e18f219f83
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/do_check_6.f90
@@ -0,0 +1,84 @@
+! { dg-do compile }
+!
+! PR fortran/54958
+!
+module m
+ integer, protected :: i
+ integer :: j
+end module m
+
+subroutine test1()
+ use m
+ implicit none
+ integer :: A(5)
+ ! Valid: data-implied-do (has a scope of the statement or construct)
+ DATA (A(i), i=1,5)/5*42/ ! OK
+
+ ! Valid: ac-implied-do (has a scope of the statement or construct)
+ print *, [(i, i=1,5 )] ! OK
+
+ ! Valid: index-name (has a scope of the statement or construct)
+ forall (i = 1:5) ! OK
+ end forall
+
+ ! Valid: index-name (has a scope of the statement or construct)
+ do concurrent (i = 1:5) ! OK
+ end do
+
+ ! Invalid: io-implied-do
+ print *, (i, i=1,5 ) ! { dg-error "PROTECTED and can not appear in a variable definition context .iterator variable." }
+
+ ! Invalid: do-variable in a do-stmt
+ do i = 1, 5 ! { dg-error "PROTECTED and can not appear in a variable definition context .iterator variable." }
+ end do
+end subroutine test1
+
+subroutine test2(i)
+ implicit none
+ integer, intent(in) :: i
+ integer :: A(5)
+ ! Valid: data-implied-do (has a scope of the statement or construct)
+ DATA (A(i), i=1,5)/5*42/ ! OK
+
+ ! Valid: ac-implied-do (has a scope of the statement or construct)
+ print *, [(i, i=1,5 )] ! OK
+
+ ! Valid: index-name (has a scope of the statement or construct)
+ forall (i = 1:5) ! OK
+ end forall
+
+ ! Valid: index-name (has a scope of the statement or construct)
+ do concurrent (i = 1:5) ! OK
+ end do
+
+ ! Invalid: io-implied-do
+ print *, (i, i=1,5 ) ! { dg-error "INTENT.IN. in variable definition context .iterator variable." }
+
+ ! Invalid: do-variable in a do-stmt
+ do i = 1, 5 ! { dg-error "INTENT.IN. in variable definition context .iterator variable." }
+ end do
+end subroutine test2
+
+pure subroutine test3()
+ use m
+ implicit none
+ integer :: A(5)
+ !DATA (A(j), j=1,5)/5*42/ ! Not allowed in pure
+
+ ! Valid: ac-implied-do (has a scope of the statement or construct)
+ A = [(j, j=1,5 )] ! OK
+
+ ! Valid: index-name (has a scope of the statement or construct)
+ forall (j = 1:5) ! OK
+ end forall
+
+ ! Valid: index-name (has a scope of the statement or construct)
+ do concurrent (j = 1:5) ! OK
+ end do
+
+ ! print *, (j, j=1,5 ) ! I/O not allowed in PURE
+
+ ! Invalid: do-variable in a do-stmt
+ do j = 1, 5 ! { dg-error "variable definition context .iterator variable. at .1. in PURE procedure" }
+ end do
+end subroutine test3
diff --git a/gcc/testsuite/gfortran.dg/pr54967.f90 b/gcc/testsuite/gfortran.dg/pr54967.f90
index f674e3ec19c..bc6f2de95a5 100644
--- a/gcc/testsuite/gfortran.dg/pr54967.f90
+++ b/gcc/testsuite/gfortran.dg/pr54967.f90
@@ -16,21 +16,3 @@
END DO
END DO
END SUBROUTINE calc_S_derivs
- SUBROUTINE calc_S_derivs()
- INTEGER, DIMENSION(6, 2) :: c_map_mat
- INTEGER, DIMENSION(:), POINTER:: C_mat
- DO j=1,3
- DO m=j,3
- n=n+1
- c_map_mat(n,1)=j
- IF(m==j)CYCLE
- c_map_mat(n,2)=m
- END DO
- END DO
- DO m=1,6
- DO j=1,2
- IF(c_map_mat(m,j)==0)CYCLE
- CALL foo(C_mat(c_map_mat(m,j)))
- END DO
- END DO
- END SUBROUTINE calc_S_derivs
diff --git a/gcc/testsuite/obj-c++.dg/strings/const-cfstring-2.mm b/gcc/testsuite/obj-c++.dg/strings/const-cfstring-2.mm
index 14ae68c6c50..b4fc9e6ed4f 100644
--- a/gcc/testsuite/obj-c++.dg/strings/const-cfstring-2.mm
+++ b/gcc/testsuite/obj-c++.dg/strings/const-cfstring-2.mm
@@ -6,7 +6,7 @@
/* So far, CFString is darwin-only. */
/* { dg-do compile { target *-*-darwin* } } */
/* { dg-skip-if "NeXT only" { *-*-* } { "-fgnu-runtime" } { "" } } */
-/* { dg-options "-mconstant-cfstrings -Wnonportable-cfstrings" } */
+/* { dg-options "-ftrack-macro-expansion=0 -mconstant-cfstrings -Wnonportable-cfstrings" } */
#import <Foundation/NSString.h>
#import <CoreFoundation/CFString.h>
diff --git a/gcc/tracer.c b/gcc/tracer.c
index 9b1d724085c..cbd5aacf55a 100644
--- a/gcc/tracer.c
+++ b/gcc/tracer.c
@@ -238,7 +238,7 @@ tail_duplicate (void)
/* Create an oversized sbitmap to reduce the chance that we need to
resize it. */
bb_seen = sbitmap_alloc (last_basic_block * 2);
- sbitmap_zero (bb_seen);
+ bitmap_clear (bb_seen);
initialize_original_copy_tables ();
if (profile_info && flag_branch_probabilities)
@@ -379,7 +379,12 @@ tracer (void)
/* Trace formation is done on the fly inside tail_duplicate */
changed = tail_duplicate ();
if (changed)
- free_dominance_info (CDI_DOMINATORS);
+ {
+ free_dominance_info (CDI_DOMINATORS);
+ calculate_dominance_info (CDI_DOMINATORS);
+ if (current_loops)
+ fix_loop_structure (NULL);
+ }
if (dump_file)
brief_dump_cfg (dump_file, dump_flags);
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index b4be50c6fd3..9042f068835 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -3525,8 +3525,8 @@ remove_unreachable_handlers (void)
r_reachable = sbitmap_alloc (VEC_length (eh_region, cfun->eh->region_array));
lp_reachable
= sbitmap_alloc (VEC_length (eh_landing_pad, cfun->eh->lp_array));
- sbitmap_zero (r_reachable);
- sbitmap_zero (lp_reachable);
+ bitmap_clear (r_reachable);
+ bitmap_clear (lp_reachable);
FOR_EACH_BB (bb)
{
@@ -3571,9 +3571,9 @@ remove_unreachable_handlers (void)
fprintf (dump_file, "Before removal of unreachable regions:\n");
dump_eh_tree (dump_file, cfun);
fprintf (dump_file, "Reachable regions: ");
- dump_sbitmap_file (dump_file, r_reachable);
+ dump_bitmap_file (dump_file, r_reachable);
fprintf (dump_file, "Reachable landing pads: ");
- dump_sbitmap_file (dump_file, lp_reachable);
+ dump_bitmap_file (dump_file, lp_reachable);
}
for (r_nr = 1;
@@ -3645,7 +3645,7 @@ remove_unreachable_handlers_no_lp (void)
basic_block bb;
r_reachable = sbitmap_alloc (VEC_length (eh_region, cfun->eh->region_array));
- sbitmap_zero (r_reachable);
+ bitmap_clear (r_reachable);
FOR_EACH_BB (bb)
{
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index 15c14654b22..0d9edad6f75 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -627,7 +627,8 @@ bool parallelize_loops (void);
bool loop_only_exit_p (const struct loop *, const_edge);
bool number_of_iterations_exit (struct loop *, edge,
- struct tree_niter_desc *niter, bool);
+ struct tree_niter_desc *niter, bool,
+ bool every_iteration = true);
tree find_loop_niter (struct loop *, edge *);
tree loop_niter_by_eval (struct loop *, edge);
tree find_loop_niter_by_eval (struct loop *, edge *);
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 2c8071e8c99..69a664dbfcc 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -3512,12 +3512,12 @@ estimate_num_insns (gimple stmt, eni_weights *weights)
lhs = gimple_assign_lhs (stmt);
rhs = gimple_assign_rhs1 (stmt);
- if (is_gimple_reg (lhs))
- cost = 0;
- else
- cost = estimate_move_cost (TREE_TYPE (lhs));
+ cost = 0;
- if (!is_gimple_reg (rhs) && !is_gimple_min_invariant (rhs))
+ /* Account for the cost of moving to / from memory. */
+ if (gimple_store_p (stmt))
+ cost += estimate_move_cost (TREE_TYPE (lhs));
+ if (gimple_assign_load_p (stmt))
cost += estimate_move_cost (TREE_TYPE (rhs));
cost += estimate_operator_cost (gimple_assign_rhs_code (stmt), weights,
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index 73692b912f3..b3e887b258f 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -2347,7 +2347,7 @@ rewrite_into_ssa (void)
mark_def_sites will add to this set those blocks that the renamer
should process. */
interesting_blocks = sbitmap_alloc (last_basic_block);
- sbitmap_zero (interesting_blocks);
+ bitmap_clear (interesting_blocks);
/* Initialize dominance frontier. */
dfs = XNEWVEC (bitmap_head, last_basic_block);
@@ -2729,7 +2729,7 @@ dump_update_ssa (FILE *file)
if (!need_ssa_update_p (cfun))
return;
- if (new_ssa_names && sbitmap_first_set_bit (new_ssa_names) >= 0)
+ if (new_ssa_names && bitmap_first_set_bit (new_ssa_names) >= 0)
{
sbitmap_iterator sbi;
@@ -2779,10 +2779,10 @@ init_update_ssa (struct function *fn)
add_new_name_mapping are typically done after creating new SSA
names, so we'll need to reallocate these arrays. */
old_ssa_names = sbitmap_alloc (num_ssa_names + NAME_SETS_GROWTH_FACTOR);
- sbitmap_zero (old_ssa_names);
+ bitmap_clear (old_ssa_names);
new_ssa_names = sbitmap_alloc (num_ssa_names + NAME_SETS_GROWTH_FACTOR);
- sbitmap_zero (new_ssa_names);
+ bitmap_clear (new_ssa_names);
bitmap_obstack_initialize (&update_ssa_obstack);
@@ -3133,8 +3133,8 @@ update_ssa (unsigned update_flags)
/* If we only need to update virtuals, remove all the mappings for
real names before proceeding. The caller is responsible for
having dealt with the name mappings before calling update_ssa. */
- sbitmap_zero (old_ssa_names);
- sbitmap_zero (new_ssa_names);
+ bitmap_clear (old_ssa_names);
+ bitmap_clear (new_ssa_names);
}
gcc_assert (update_ssa_initialized_fn == cfun);
@@ -3152,14 +3152,14 @@ update_ssa (unsigned update_flags)
/* If there are names defined in the replacement table, prepare
definition and use sites for all the names in NEW_SSA_NAMES and
OLD_SSA_NAMES. */
- if (sbitmap_first_set_bit (new_ssa_names) >= 0)
+ if (bitmap_first_set_bit (new_ssa_names) >= 0)
{
prepare_names_to_update (insert_phi_p);
/* If all the names in NEW_SSA_NAMES had been marked for
removal, and there are no symbols to rename, then there's
nothing else to do. */
- if (sbitmap_first_set_bit (new_ssa_names) < 0
+ if (bitmap_first_set_bit (new_ssa_names) < 0
&& !cfun->gimple_df->ssa_renaming_needed)
goto done;
}
@@ -3230,7 +3230,7 @@ update_ssa (unsigned update_flags)
bitmap_initialize (&dfs[bb->index], &bitmap_default_obstack);
compute_dominance_frontiers (dfs);
- if (sbitmap_first_set_bit (old_ssa_names) >= 0)
+ if (bitmap_first_set_bit (old_ssa_names) >= 0)
{
sbitmap_iterator sbi;
@@ -3240,7 +3240,7 @@ update_ssa (unsigned update_flags)
gain any new members). Copy OLD_SSA_NAMES to a temporary
for traversal. */
sbitmap tmp = sbitmap_alloc (SBITMAP_SIZE (old_ssa_names));
- sbitmap_copy (tmp, old_ssa_names);
+ bitmap_copy (tmp, old_ssa_names);
EXECUTE_IF_SET_IN_SBITMAP (tmp, 0, i, sbi)
insert_updated_phi_nodes_for (ssa_name (i), dfs, blocks_to_update,
update_flags);
@@ -3273,7 +3273,7 @@ update_ssa (unsigned update_flags)
/* Now start the renaming process at START_BB. */
interesting_blocks = sbitmap_alloc (last_basic_block);
- sbitmap_zero (interesting_blocks);
+ bitmap_clear (interesting_blocks);
EXECUTE_IF_SET_IN_BITMAP (blocks_to_update, 0, i, bi)
SET_BIT (interesting_blocks, i);
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c
index d13c04f783c..3e7ca89e94d 100644
--- a/gcc/tree-optimize.c
+++ b/gcc/tree-optimize.c
@@ -180,6 +180,25 @@ 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;
+
+ /* If we have a basic block with no successors that does not
+ end with a control statement or a noreturn call end it with
+ a call to __builtin_unreachable. This situation can occur
+ when inlining a noreturn call that does in fact return. */
+ if (EDGE_COUNT (bb->succs) == 0)
+ {
+ gimple stmt = last_stmt (bb);
+ if (!stmt
+ || (!is_ctrl_stmt (stmt)
+ && (!is_gimple_call (stmt)
+ || (gimple_call_flags (stmt) & ECF_NORETURN) == 0)))
+ {
+ stmt = gimple_build_call
+ (builtin_decl_implicit (BUILT_IN_UNREACHABLE), 0);
+ gimple_stmt_iterator gsi = gsi_last_bb (bb);
+ gsi_insert_after (&gsi, stmt, GSI_NEW_STMT);
+ }
+ }
}
if (count_scale != REG_BR_PROB_BASE)
compute_function_frequency ();
diff --git a/gcc/tree-outof-ssa.c b/gcc/tree-outof-ssa.c
index 4d0f3208320..5c8e43edb74 100644
--- a/gcc/tree-outof-ssa.c
+++ b/gcc/tree-outof-ssa.c
@@ -670,7 +670,7 @@ eliminate_phi (edge e, elim_graph g)
{
int part;
- sbitmap_zero (g->visited);
+ bitmap_clear (g->visited);
VEC_truncate (int, g->stack, 0);
FOR_EACH_VEC_ELT (int, g->nodes, x, part)
@@ -679,7 +679,7 @@ eliminate_phi (edge e, elim_graph g)
elim_forward (g, part);
}
- sbitmap_zero (g->visited);
+ bitmap_clear (g->visited);
while (VEC_length (int, g->stack) > 0)
{
x = VEC_pop (int, g->stack);
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 5acb6125079..bf1a0f209f6 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -1,7 +1,7 @@
/* Scalar Replacement of Aggregates (SRA) converts some structure
references into scalar references, exposing them to the scalar
optimizers.
- Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
Contributed by Martin Jambor <mjambor@suse.cz>
This file is part of GCC.
@@ -227,6 +227,10 @@ struct access
/* Set when a scalar replacement should be created for this variable. */
unsigned grp_to_be_replaced : 1;
+ /* Set when we want a replacement for the sole purpose of having it in
+ generated debug statements. */
+ unsigned grp_to_be_debug_replaced : 1;
+
/* Should TREE_NO_WARNING of a replacement be set? */
unsigned grp_no_warning : 1;
@@ -390,7 +394,7 @@ dump_access (FILE *f, struct access *access, bool grp)
"grp_hint = %d, grp_covered = %d, "
"grp_unscalarizable_region = %d, grp_unscalarized_data = %d, "
"grp_partial_lhs = %d, grp_to_be_replaced = %d, "
- "grp_maybe_modified = %d, "
+ "grp_to_be_debug_replaced = %d, grp_maybe_modified = %d, "
"grp_not_necessarilly_dereferenced = %d\n",
access->grp_read, access->grp_write, access->grp_assignment_read,
access->grp_assignment_write, access->grp_scalar_read,
@@ -398,7 +402,7 @@ dump_access (FILE *f, struct access *access, bool grp)
access->grp_hint, access->grp_covered,
access->grp_unscalarizable_region, access->grp_unscalarized_data,
access->grp_partial_lhs, access->grp_to_be_replaced,
- access->grp_maybe_modified,
+ access->grp_to_be_debug_replaced, access->grp_maybe_modified,
access->grp_not_necessarilly_dereferenced);
else
fprintf (f, ", write = %d, grp_total_scalarization = %d, "
@@ -1528,6 +1532,43 @@ build_ref_for_model (location_t loc, tree base, HOST_WIDE_INT offset,
gsi, insert_after);
}
+/* Attempt to build a memory reference that we could but into a gimple
+ debug_bind statement. Similar to build_ref_for_model but punts if it has to
+ create statements and return s NULL instead. This function also ignores
+ alignment issues and so its results should never end up in non-debug
+ statements. */
+
+static tree
+build_debug_ref_for_model (location_t loc, tree base, HOST_WIDE_INT offset,
+ struct access *model)
+{
+ HOST_WIDE_INT base_offset;
+ tree off;
+
+ if (TREE_CODE (model->expr) == COMPONENT_REF
+ && DECL_BIT_FIELD (TREE_OPERAND (model->expr, 1)))
+ return NULL_TREE;
+
+ base = get_addr_base_and_unit_offset (base, &base_offset);
+ if (!base)
+ return NULL_TREE;
+ if (TREE_CODE (base) == MEM_REF)
+ {
+ off = build_int_cst (TREE_TYPE (TREE_OPERAND (base, 1)),
+ base_offset + offset / BITS_PER_UNIT);
+ off = int_const_binop (PLUS_EXPR, TREE_OPERAND (base, 1), off);
+ base = unshare_expr (TREE_OPERAND (base, 0));
+ }
+ else
+ {
+ off = build_int_cst (reference_alias_ptr_type (base),
+ base_offset + offset / BITS_PER_UNIT);
+ base = build_fold_addr_expr (unshare_expr (base));
+ }
+
+ return fold_build2_loc (loc, MEM_REF, model->type, base, off);
+}
+
/* Construct a memory reference consisting of component_refs and array_refs to
a part of an aggregate *RES (which is of type TYPE). The requested part
should have type EXP_TYPE at be the given OFFSET. This function might not
@@ -1861,7 +1902,13 @@ create_access_replacement (struct access *access)
{
tree repl;
- repl = create_tmp_var (access->type, "SR");
+ if (access->grp_to_be_debug_replaced)
+ {
+ repl = create_tmp_var_raw (access->type, NULL);
+ DECL_CONTEXT (repl) = current_function_decl;
+ }
+ else
+ repl = create_tmp_var (access->type, "SR");
if (TREE_CODE (access->type) == COMPLEX_TYPE
|| TREE_CODE (access->type) == VECTOR_TYPE)
{
@@ -1894,7 +1941,8 @@ create_access_replacement (struct access *access)
and that get_ref_base_and_extent works properly on the
expression. It cannot handle accesses at a non-constant offset
though, so just give up in those cases. */
- for (d = debug_expr; !fail && handled_component_p (d);
+ for (d = debug_expr;
+ !fail && (handled_component_p (d) || TREE_CODE (d) == MEM_REF);
d = TREE_OPERAND (d, 0))
switch (TREE_CODE (d))
{
@@ -1912,6 +1960,12 @@ create_access_replacement (struct access *access)
&& TREE_CODE (TREE_OPERAND (d, 2)) != INTEGER_CST)
fail = true;
break;
+ case MEM_REF:
+ if (TREE_CODE (TREE_OPERAND (d, 0)) != ADDR_EXPR)
+ fail = true;
+ else
+ d = TREE_OPERAND (d, 0);
+ break;
default:
break;
}
@@ -1930,12 +1984,22 @@ create_access_replacement (struct access *access)
if (dump_file)
{
- fprintf (dump_file, "Created a replacement for ");
- print_generic_expr (dump_file, access->base, 0);
- fprintf (dump_file, " offset: %u, size: %u: ",
- (unsigned) access->offset, (unsigned) access->size);
- print_generic_expr (dump_file, repl, 0);
- fprintf (dump_file, "\n");
+ if (access->grp_to_be_debug_replaced)
+ {
+ fprintf (dump_file, "Created a debug-only replacement for ");
+ print_generic_expr (dump_file, access->base, 0);
+ fprintf (dump_file, " offset: %u, size: %u\n",
+ (unsigned) access->offset, (unsigned) access->size);
+ }
+ else
+ {
+ fprintf (dump_file, "Created a replacement for ");
+ print_generic_expr (dump_file, access->base, 0);
+ fprintf (dump_file, " offset: %u, size: %u: ",
+ (unsigned) access->offset, (unsigned) access->size);
+ print_generic_expr (dump_file, repl, 0);
+ fprintf (dump_file, "\n");
+ }
}
sra_stats.replacements++;
@@ -2144,6 +2208,23 @@ analyze_access_subtree (struct access *root, struct access *parent,
}
else
{
+ if (MAY_HAVE_DEBUG_STMTS && allow_replacements
+ && scalar && !root->first_child
+ && (root->grp_scalar_write || root->grp_assignment_write))
+ {
+ gcc_checking_assert (!root->grp_scalar_read
+ && !root->grp_assignment_read);
+ root->grp_to_be_debug_replaced = 1;
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "Marking ");
+ print_generic_expr (dump_file, root->base, 0);
+ fprintf (dump_file, " offset: %u, size: %u ",
+ (unsigned) root->offset, (unsigned) root->size);
+ fprintf (dump_file, " to be replaced with debug statements.\n");
+ }
+ }
+
if (covered_to < limit)
hole = true;
if (scalar)
@@ -2504,6 +2585,22 @@ generate_subtree_copies (struct access *access, tree agg,
update_stmt (stmt);
sra_stats.subtree_copies++;
}
+ else if (write
+ && access->grp_to_be_debug_replaced
+ && (chunk_size == 0
+ || access->offset + access->size > start_offset))
+ {
+ gimple ds;
+ tree drhs = build_debug_ref_for_model (loc, agg,
+ access->offset - top_offset,
+ access);
+ ds = gimple_build_debug_bind (get_access_replacement (access),
+ drhs, gsi_stmt (*gsi));
+ if (insert_after)
+ gsi_insert_after (gsi, ds, GSI_NEW_STMT);
+ else
+ gsi_insert_before (gsi, ds, GSI_SAME_STMT);
+ }
if (access->first_child)
generate_subtree_copies (access->first_child, agg, top_offset,
@@ -2540,6 +2637,16 @@ init_subtree_with_zero (struct access *access, gimple_stmt_iterator *gsi,
update_stmt (stmt);
gimple_set_location (stmt, loc);
}
+ else if (access->grp_to_be_debug_replaced)
+ {
+ gimple ds = gimple_build_debug_bind (get_access_replacement (access),
+ build_zero_cst (access->type),
+ gsi_stmt (*gsi));
+ if (insert_after)
+ gsi_insert_after (gsi, ds, GSI_NEW_STMT);
+ else
+ gsi_insert_before (gsi, ds, GSI_SAME_STMT);
+ }
for (child = access->first_child; child; child = child->next_sibling)
init_subtree_with_zero (child, gsi, insert_after, loc);
@@ -2646,6 +2753,13 @@ sra_modify_expr (tree *expr, gimple_stmt_iterator *gsi, bool write)
*expr = repl;
sra_stats.exprs++;
}
+ else if (write && access->grp_to_be_debug_replaced)
+ {
+ gimple ds = gimple_build_debug_bind (get_access_replacement (access),
+ NULL_TREE,
+ gsi_stmt (*gsi));
+ gsi_insert_after (gsi, ds, GSI_NEW_STMT);
+ }
if (access->first_child)
{
@@ -2721,10 +2835,11 @@ load_assign_lhs_subreplacements (struct access *lacc, struct access *top_racc,
location_t loc = gimple_location (gsi_stmt (*old_gsi));
for (lacc = lacc->first_child; lacc; lacc = lacc->next_sibling)
{
+ HOST_WIDE_INT offset = lacc->offset - left_offset + top_racc->offset;
+
if (lacc->grp_to_be_replaced)
{
struct access *racc;
- HOST_WIDE_INT offset = lacc->offset - left_offset + top_racc->offset;
gimple stmt;
tree rhs;
@@ -2764,10 +2879,34 @@ load_assign_lhs_subreplacements (struct access *lacc, struct access *top_racc,
update_stmt (stmt);
sra_stats.subreplacements++;
}
- else if (*refreshed == SRA_UDH_NONE
- && lacc->grp_read && !lacc->grp_covered)
- *refreshed = handle_unscalarized_data_in_subtree (top_racc,
- old_gsi);
+ else
+ {
+ if (*refreshed == SRA_UDH_NONE
+ && lacc->grp_read && !lacc->grp_covered)
+ *refreshed = handle_unscalarized_data_in_subtree (top_racc,
+ old_gsi);
+ if (lacc && lacc->grp_to_be_debug_replaced)
+ {
+ gimple ds;
+ tree drhs;
+ struct access *racc = find_access_in_subtree (top_racc, offset,
+ lacc->size);
+
+ if (racc && racc->grp_to_be_replaced)
+ drhs = get_access_replacement (racc);
+ else if (*refreshed == SRA_UDH_LEFT)
+ drhs = build_debug_ref_for_model (loc, lacc->base, lacc->offset,
+ lacc);
+ else if (*refreshed == SRA_UDH_RIGHT)
+ drhs = build_debug_ref_for_model (loc, top_racc->base, offset,
+ lacc);
+ else
+ drhs = NULL_TREE;
+ ds = gimple_build_debug_bind (get_access_replacement (lacc),
+ drhs, gsi_stmt (*old_gsi));
+ gsi_insert_after (new_gsi, ds, GSI_NEW_STMT);
+ }
+ }
if (lacc->first_child)
load_assign_lhs_subreplacements (lacc, top_racc, left_offset,
@@ -2982,6 +3121,13 @@ sra_modify_assign (gimple *stmt, gimple_stmt_iterator *gsi)
}
}
+ if (lacc && lacc->grp_to_be_debug_replaced)
+ {
+ gimple ds = gimple_build_debug_bind (get_access_replacement (lacc),
+ unshare_expr (rhs), *stmt);
+ gsi_insert_before (gsi, ds, GSI_SAME_STMT);
+ }
+
/* From this point on, the function deals with assignments in between
aggregates when at least one has scalar reductions of some of its
components. There are three possible scenarios: Both the LHS and RHS have
diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c
index 6217825d1a6..f0d66ccb5f1 100644
--- a/gcc/tree-ssa-coalesce.c
+++ b/gcc/tree-ssa-coalesce.c
@@ -1261,9 +1261,10 @@ coalesce_partitions (var_map map, ssa_conflicts_p graph, coalesce_list_p cl,
struct ssa_name_var_hash : typed_noop_remove <union tree_node>
{
- typedef union tree_node T;
- static inline hashval_t hash (const_tree);
- static inline int equal (const_tree, const_tree);
+ typedef union tree_node value_type;
+ typedef union tree_node compare_type;
+ static inline hashval_t hash (const value_type *);
+ static inline int equal (const value_type *, const compare_type *);
};
inline hashval_t
@@ -1273,7 +1274,7 @@ ssa_name_var_hash::hash (const_tree n)
}
inline int
-ssa_name_var_hash::equal (const_tree n1, const_tree n2)
+ssa_name_var_hash::equal (const value_type *n1, const compare_type *n2)
{
return SSA_NAME_VAR (n1) == SSA_NAME_VAR (n2);
}
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index 0112fc4c1c3..0a98d52edc9 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -1489,13 +1489,13 @@ tree_dce_init (bool aggressive)
control_dependence_map[i] = BITMAP_ALLOC (NULL);
last_stmt_necessary = sbitmap_alloc (last_basic_block);
- sbitmap_zero (last_stmt_necessary);
+ bitmap_clear (last_stmt_necessary);
bb_contains_live_stmts = sbitmap_alloc (last_basic_block);
- sbitmap_zero (bb_contains_live_stmts);
+ bitmap_clear (bb_contains_live_stmts);
}
processed = sbitmap_alloc (num_ssa_names + 1);
- sbitmap_zero (processed);
+ bitmap_clear (processed);
worklist = VEC_alloc (gimple, heap, 64);
cfg_altered = false;
@@ -1566,7 +1566,7 @@ perform_tree_ssa_dce (bool aggressive)
timevar_pop (TV_CONTROL_DEPENDENCES);
visited_control_parents = sbitmap_alloc (last_basic_block);
- sbitmap_zero (visited_control_parents);
+ bitmap_clear (visited_control_parents);
mark_dfs_back_edges ();
}
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 9065006c55e..19eca425775 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -815,7 +815,7 @@ tree_ssa_dominator_optimize (void)
}
gimple_purge_all_dead_eh_edges (need_eh_cleanup);
- bitmap_zero (need_eh_cleanup);
+ bitmap_clear (need_eh_cleanup);
}
statistics_counter_event (cfun, "Redundant expressions eliminated",
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index b63dc7e8170..d6b8fbda664 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -1008,7 +1008,7 @@ live_worklist (tree_live_info_p live)
sbitmap visited = sbitmap_alloc (last_basic_block + 1);
bitmap tmp = BITMAP_ALLOC (&liveness_bitmap_obstack);
- sbitmap_zero (visited);
+ bitmap_clear (visited);
/* Visit all the blocks in reverse order and propagate live on entry values
into the predecessors blocks. */
diff --git a/gcc/tree-ssa-live.h b/gcc/tree-ssa-live.h
index 70a3aa60fd3..3d39cb6d443 100644
--- a/gcc/tree-ssa-live.h
+++ b/gcc/tree-ssa-live.h
@@ -308,7 +308,7 @@ live_merge_and_clear (tree_live_info_p live, int p1, int p2)
{
gcc_checking_assert (&live->livein[p1] && &live->livein[p2]);
bitmap_ior_into (&live->livein[p1], &live->livein[p2]);
- bitmap_zero (&live->livein[p2]);
+ bitmap_clear (&live->livein[p2]);
}
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index ac5353905df..178e2eeb783 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -2578,7 +2578,7 @@ tree_ssa_lim_initialize (void)
bitmap_obstack_initialize (&lim_bitmap_obstack);
- sbitmap_zero (contains_call);
+ bitmap_clear (contains_call);
FOR_EACH_BB (bb)
{
for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c
index 323045f32eb..6cf6c6de95a 100644
--- a/gcc/tree-ssa-loop-ivcanon.c
+++ b/gcc/tree-ssa-loop-ivcanon.c
@@ -160,7 +160,7 @@ constant_after_peeling (tree op, gimple stmt, struct loop *loop)
/* First make fast look if we see constant array inside. */
while (handled_component_p (base))
base = TREE_OPERAND (base, 0);
- if ((DECL_P (base) == VAR_DECL
+ if ((DECL_P (base)
&& const_value_known_p (base))
|| CONSTANT_CLASS_P (base))
{
@@ -364,6 +364,10 @@ loop_edge_to_cancel (struct loop *loop)
else
edge_to_cancel = EDGE_SUCC (edge_to_cancel->src, 0);
+ /* We only can handle conditionals. */
+ if (!(edge_to_cancel->flags & (EDGE_TRUE_VALUE | EDGE_FALSE_VALUE)))
+ continue;
+
/* We should never have conditionals in the loop latch. */
gcc_assert (edge_to_cancel->dest != loop->header);
@@ -516,7 +520,7 @@ try_unroll_loop_completely (struct loop *loop,
initialize_original_copy_tables ();
wont_exit = sbitmap_alloc (n_unroll + 1);
- sbitmap_ones (wont_exit);
+ bitmap_ones (wont_exit);
RESET_BIT (wont_exit, 0);
if (!gimple_duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 74097f8cccf..9bca5e35e24 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -3076,7 +3076,7 @@ multiplier_allowed_in_address_p (HOST_WIDE_INT ratio, enum machine_mode mode,
HOST_WIDE_INT i;
valid_mult = sbitmap_alloc (2 * MAX_RATIO + 1);
- sbitmap_zero (valid_mult);
+ bitmap_clear (valid_mult);
addr = gen_rtx_fmt_ee (MULT, address_mode, reg1, NULL_RTX);
for (i = -MAX_RATIO; i <= MAX_RATIO; i++)
{
diff --git a/gcc/tree-ssa-loop-manip.c b/gcc/tree-ssa-loop-manip.c
index 9732fbe484a..2b723cac972 100644
--- a/gcc/tree-ssa-loop-manip.c
+++ b/gcc/tree-ssa-loop-manip.c
@@ -1172,7 +1172,7 @@ tree_transform_and_unroll_loop (struct loop *loop, unsigned factor,
/* Unroll the loop and remove the exits in all iterations except for the
last one. */
wont_exit = sbitmap_alloc (factor);
- sbitmap_ones (wont_exit);
+ bitmap_ones (wont_exit);
RESET_BIT (wont_exit, factor - 1);
ok = gimple_duplicate_loop_to_header_edge
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index 054aff30954..20681a9140a 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -1793,12 +1793,15 @@ loop_only_exit_p (const struct loop *loop, const_edge exit)
meaning described in comments at struct tree_niter_desc
declaration), false otherwise. If WARN is true and
-Wunsafe-loop-optimizations was given, warn if the optimizer is going to use
- potentially unsafe assumptions. */
+ potentially unsafe assumptions.
+ When EVERY_ITERATION is true, only tests that are known to be executed
+ every iteration are considered (i.e. only test that alone bounds the loop).
+ */
bool
number_of_iterations_exit (struct loop *loop, edge exit,
struct tree_niter_desc *niter,
- bool warn)
+ bool warn, bool every_iteration)
{
gimple stmt;
tree type;
@@ -1806,7 +1809,8 @@ number_of_iterations_exit (struct loop *loop, edge exit,
enum tree_code code;
affine_iv iv0, iv1;
- if (!dominated_by_p (CDI_DOMINATORS, loop->latch, exit->src))
+ if (every_iteration
+ && !dominated_by_p (CDI_DOMINATORS, loop->latch, exit->src))
return false;
niter->assumptions = boolean_false_node;
@@ -2568,6 +2572,11 @@ record_estimate (struct loop *loop, tree bound, double_int i_bound,
loop->bounds = elt;
}
+ /* If statement is executed on every path to the loop latch, we can directly
+ infer the upper bound on the # of iterations of the loop. */
+ if (!dominated_by_p (CDI_DOMINATORS, loop->latch, gimple_bb (at_stmt)))
+ return;
+
/* Update the number of iteration estimates according to the bound.
If at_stmt is an exit then the loop latch is executed at most BOUND times,
otherwise it can be executed BOUND + 1 times. We will lower the estimate
@@ -2651,7 +2660,6 @@ struct ilb_data
{
struct loop *loop;
gimple stmt;
- bool reliable;
};
static bool
@@ -2660,7 +2668,7 @@ idx_infer_loop_bounds (tree base, tree *idx, void *dta)
struct ilb_data *data = (struct ilb_data *) dta;
tree ev, init, step;
tree low, high, type, next;
- bool sign, upper = data->reliable, at_end = false;
+ bool sign, upper = true, at_end = false;
struct loop *loop = data->loop;
if (TREE_CODE (base) != ARRAY_REF)
@@ -2737,14 +2745,12 @@ idx_infer_loop_bounds (tree base, tree *idx, void *dta)
STMT is guaranteed to be executed in every iteration of LOOP.*/
static void
-infer_loop_bounds_from_ref (struct loop *loop, gimple stmt, tree ref,
- bool reliable)
+infer_loop_bounds_from_ref (struct loop *loop, gimple stmt, tree ref)
{
struct ilb_data data;
data.loop = loop;
data.stmt = stmt;
- data.reliable = reliable;
for_each_index (&ref, idx_infer_loop_bounds, &data);
}
@@ -2753,7 +2759,7 @@ infer_loop_bounds_from_ref (struct loop *loop, gimple stmt, tree ref,
executed in every iteration of LOOP. */
static void
-infer_loop_bounds_from_array (struct loop *loop, gimple stmt, bool reliable)
+infer_loop_bounds_from_array (struct loop *loop, gimple stmt)
{
if (is_gimple_assign (stmt))
{
@@ -2763,10 +2769,10 @@ infer_loop_bounds_from_array (struct loop *loop, gimple stmt, bool reliable)
/* For each memory access, analyze its access function
and record a bound on the loop iteration domain. */
if (REFERENCE_CLASS_P (op0))
- infer_loop_bounds_from_ref (loop, stmt, op0, reliable);
+ infer_loop_bounds_from_ref (loop, stmt, op0);
if (REFERENCE_CLASS_P (op1))
- infer_loop_bounds_from_ref (loop, stmt, op1, reliable);
+ infer_loop_bounds_from_ref (loop, stmt, op1);
}
else if (is_gimple_call (stmt))
{
@@ -2775,13 +2781,13 @@ infer_loop_bounds_from_array (struct loop *loop, gimple stmt, bool reliable)
lhs = gimple_call_lhs (stmt);
if (lhs && REFERENCE_CLASS_P (lhs))
- infer_loop_bounds_from_ref (loop, stmt, lhs, reliable);
+ infer_loop_bounds_from_ref (loop, stmt, lhs);
for (i = 0; i < n; i++)
{
arg = gimple_call_arg (stmt, i);
if (REFERENCE_CLASS_P (arg))
- infer_loop_bounds_from_ref (loop, stmt, arg, reliable);
+ infer_loop_bounds_from_ref (loop, stmt, arg);
}
}
}
@@ -2910,14 +2916,15 @@ infer_loop_bounds_from_undefined (struct loop *loop)
/* If BB is not executed in each iteration of the loop, we cannot
use the operations in it to infer reliable upper bound on the
- # of iterations of the loop. However, we can use it as a guess. */
+ # of iterations of the loop. However, we can use it as a guess.
+ Reliable guesses come only from array bounds. */
reliable = dominated_by_p (CDI_DOMINATORS, loop->latch, bb);
for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
{
gimple stmt = gsi_stmt (bsi);
- infer_loop_bounds_from_array (loop, stmt, reliable);
+ infer_loop_bounds_from_array (loop, stmt);
if (reliable)
{
@@ -3078,7 +3085,7 @@ estimate_numbers_of_iterations_loop (struct loop *loop)
likely_exit = single_likely_exit (loop);
FOR_EACH_VEC_ELT (edge, exits, i, ex)
{
- if (!number_of_iterations_exit (loop, ex, &niter_desc, false))
+ if (!number_of_iterations_exit (loop, ex, &niter_desc, false, false))
continue;
niter = niter_desc.niter;
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index 948620fa8cd..5864d68689a 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -482,7 +482,7 @@ blocks_in_phiopt_order (void)
#define MARK_VISITED(BB) (SET_BIT (visited, (BB)->index))
#define VISITED_P(BB) (TEST_BIT (visited, (BB)->index))
- sbitmap_zero (visited);
+ bitmap_clear (visited);
MARK_VISITED (ENTRY_BLOCK_PTR);
FOR_EACH_BB (x)
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index 548c110f6d2..13b3433bb04 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -173,7 +173,8 @@ typedef struct pre_expr_d : typed_noop_remove <pre_expr_d>
pre_expr_union u;
/* hash_table support. */
- typedef pre_expr_d T;
+ typedef pre_expr_d value_type;
+ typedef pre_expr_d compare_type;
static inline hashval_t hash (const pre_expr_d *);
static inline int equal (const pre_expr_d *, const pre_expr_d *);
} *pre_expr;
@@ -186,7 +187,7 @@ typedef struct pre_expr_d : typed_noop_remove <pre_expr_d>
/* Compare E1 and E1 for equality. */
inline int
-pre_expr_d::equal (const struct pre_expr_d *e1, const struct pre_expr_d *e2)
+pre_expr_d::equal (const value_type *e1, const compare_type *e2)
{
if (e1->kind != e2->kind)
return false;
@@ -211,7 +212,7 @@ pre_expr_d::equal (const struct pre_expr_d *e1, const struct pre_expr_d *e2)
/* Hash E. */
inline hashval_t
-pre_expr_d::hash (const struct pre_expr_d *e)
+pre_expr_d::hash (const value_type *e)
{
switch (e->kind)
{
@@ -499,9 +500,10 @@ typedef struct expr_pred_trans_d : typed_free_remove<expr_pred_trans_d>
hashval_t hashcode;
/* hash_table support. */
- typedef expr_pred_trans_d T;
- static inline hashval_t hash (const expr_pred_trans_d *);
- static inline int equal (const expr_pred_trans_d *, const expr_pred_trans_d *);
+ typedef expr_pred_trans_d value_type;
+ typedef expr_pred_trans_d compare_type;
+ static inline hashval_t hash (const value_type *);
+ static inline int equal (const value_type *, const compare_type *);
} *expr_pred_trans_t;
typedef const struct expr_pred_trans_d *const_expr_pred_trans_t;
@@ -512,8 +514,8 @@ expr_pred_trans_d::hash (const expr_pred_trans_d *e)
}
inline int
-expr_pred_trans_d::equal (const expr_pred_trans_d *ve1,
- const expr_pred_trans_d *ve2)
+expr_pred_trans_d::equal (const value_type *ve1,
+ const compare_type *ve2)
{
basic_block b1 = ve1->pred;
basic_block b2 = ve2->pred;
@@ -2455,7 +2457,7 @@ compute_antic (void)
/* If any predecessor edges are abnormal, we punt, so antic_in is empty.
We pre-build the map of blocks with incoming abnormal edges here. */
has_abnormal_preds = sbitmap_alloc (last_basic_block);
- sbitmap_zero (has_abnormal_preds);
+ bitmap_clear (has_abnormal_preds);
FOR_ALL_BB (block)
{
@@ -2484,7 +2486,7 @@ compute_antic (void)
BB_VISITED (EXIT_BLOCK_PTR) = 1;
changed_blocks = sbitmap_alloc (last_basic_block + 1);
- sbitmap_ones (changed_blocks);
+ bitmap_ones (changed_blocks);
while (changed)
{
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -2514,7 +2516,7 @@ compute_antic (void)
if (do_partial_partial)
{
- sbitmap_ones (changed_blocks);
+ bitmap_ones (changed_blocks);
mark_dfs_back_edges ();
num_iterations = 0;
changed = true;
@@ -3994,8 +3996,8 @@ eliminate_insert (gimple_stmt_iterator *gsi, tree val)
tree res = make_temp_ssa_name (TREE_TYPE (val), NULL, "pretmp");
gimple tem = gimple_build_assign (res,
- build1 (TREE_CODE (expr),
- TREE_TYPE (expr), leader));
+ fold_build1 (TREE_CODE (expr),
+ TREE_TYPE (expr), leader));
gsi_insert_before (gsi, tem, GSI_SAME_STMT);
VN_INFO_GET (res)->valnum = val;
@@ -4448,7 +4450,7 @@ eliminate (void)
/* Perform CFG cleanups made necessary by elimination. */
-static void
+static unsigned
fini_eliminate (void)
{
bool do_eh_cleanup = !bitmap_empty_p (need_eh_cleanup);
@@ -4464,7 +4466,8 @@ fini_eliminate (void)
BITMAP_FREE (need_ab_cleanup);
if (do_eh_cleanup || do_ab_cleanup)
- cleanup_tree_cfg ();
+ return TODO_cleanup_cfg;
+ return 0;
}
/* Borrow a bit of tree-ssa-dce.c for the moment.
@@ -4728,7 +4731,7 @@ do_pre (void)
scev_finalize ();
fini_pre ();
- fini_eliminate ();
+ todo |= fini_eliminate ();
loop_optimizer_finalize ();
/* TODO: tail_merge_optimize may merge all predecessors of a block, in which
@@ -4794,7 +4797,7 @@ execute_fre (void)
/* Remove all the redundant expressions. */
todo |= eliminate ();
- fini_eliminate ();
+ todo |= fini_eliminate ();
free_scc_vn ();
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c
index e56b012cd61..380cda39787 100644
--- a/gcc/tree-ssa-propagate.c
+++ b/gcc/tree-ssa-propagate.c
@@ -487,10 +487,10 @@ ssa_prop_init (void)
varying_ssa_edges = VEC_alloc (gimple, gc, 20);
executable_blocks = sbitmap_alloc (last_basic_block);
- sbitmap_zero (executable_blocks);
+ bitmap_clear (executable_blocks);
bb_in_list = sbitmap_alloc (last_basic_block);
- sbitmap_zero (bb_in_list);
+ bitmap_clear (bb_in_list);
if (dump_file && (dump_flags & TDF_DETAILS))
dump_immediate_uses (dump_file);
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 960e2c3c389..67c5c12e13c 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -1,5 +1,5 @@
/* Reassociation for trees.
- Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011
+ Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Contributed by Daniel Berlin <dan@dberlin.org>
@@ -1282,7 +1282,7 @@ undistribute_ops_list (enum tree_code opcode,
/* Build a list of candidates to process. */
candidates = sbitmap_alloc (length);
- sbitmap_zero (candidates);
+ bitmap_clear (candidates);
nr_candidates = 0;
FOR_EACH_VEC_ELT (operand_entry_t, *ops, i, oe1)
{
@@ -1315,7 +1315,7 @@ undistribute_ops_list (enum tree_code opcode,
fprintf (dump_file, "searching for un-distribute opportunities ");
print_generic_expr (dump_file,
VEC_index (operand_entry_t, *ops,
- sbitmap_first_set_bit (candidates))->op, 0);
+ bitmap_first_set_bit (candidates))->op, 0);
fprintf (dump_file, " %d\n", nr_candidates);
}
@@ -1387,7 +1387,7 @@ undistribute_ops_list (enum tree_code opcode,
/* Now collect the operands in the outer chain that contain
the common operand in their inner chain. */
- sbitmap_zero (candidates2);
+ bitmap_clear (candidates2);
nr_candidates2 = 0;
EXECUTE_IF_SET_IN_SBITMAP (candidates, 0, i, sbi0)
{
@@ -1421,7 +1421,7 @@ undistribute_ops_list (enum tree_code opcode,
{
operand_entry_t oe1, oe2;
gimple prod;
- int first = sbitmap_first_set_bit (candidates2);
+ int first = bitmap_first_set_bit (candidates2);
/* Build the new addition chain. */
oe1 = VEC_index (operand_entry_t, *ops, first);
@@ -1713,10 +1713,12 @@ struct range_entry
};
/* This is similar to make_range in fold-const.c, but on top of
- GIMPLE instead of trees. */
+ GIMPLE instead of trees. If EXP is non-NULL, it should be
+ an SSA_NAME and STMT argument is ignored, otherwise STMT
+ argument should be a GIMPLE_COND. */
static void
-init_range_entry (struct range_entry *r, tree exp)
+init_range_entry (struct range_entry *r, tree exp, gimple stmt)
{
int in_p;
tree low, high;
@@ -1727,7 +1729,8 @@ init_range_entry (struct range_entry *r, tree exp)
r->strict_overflow_p = false;
r->low = NULL_TREE;
r->high = NULL_TREE;
- if (TREE_CODE (exp) != SSA_NAME || !INTEGRAL_TYPE_P (TREE_TYPE (exp)))
+ if (exp != NULL_TREE
+ && (TREE_CODE (exp) != SSA_NAME || !INTEGRAL_TYPE_P (TREE_TYPE (exp))))
return;
/* Start with simply saying "EXP != 0" and then look at the code of EXP
@@ -1735,12 +1738,14 @@ init_range_entry (struct range_entry *r, tree exp)
happen, but it doesn't seem worth worrying about this. We "continue"
the outer loop when we've changed something; otherwise we "break"
the switch, which will "break" the while. */
- low = build_int_cst (TREE_TYPE (exp), 0);
+ low = exp ? build_int_cst (TREE_TYPE (exp), 0) : boolean_false_node;
high = low;
in_p = 0;
strict_overflow_p = false;
is_bool = false;
- if (TYPE_PRECISION (TREE_TYPE (exp)) == 1)
+ if (exp == NULL_TREE)
+ is_bool = true;
+ else if (TYPE_PRECISION (TREE_TYPE (exp)) == 1)
{
if (TYPE_UNSIGNED (TREE_TYPE (exp)))
is_bool = true;
@@ -1752,25 +1757,35 @@ init_range_entry (struct range_entry *r, tree exp)
while (1)
{
- gimple stmt;
enum tree_code code;
tree arg0, arg1, exp_type;
tree nexp;
location_t loc;
- if (TREE_CODE (exp) != SSA_NAME)
- break;
+ if (exp != NULL_TREE)
+ {
+ if (TREE_CODE (exp) != SSA_NAME)
+ break;
- stmt = SSA_NAME_DEF_STMT (exp);
- if (!is_gimple_assign (stmt))
- break;
+ stmt = SSA_NAME_DEF_STMT (exp);
+ if (!is_gimple_assign (stmt))
+ break;
+
+ code = gimple_assign_rhs_code (stmt);
+ arg0 = gimple_assign_rhs1 (stmt);
+ arg1 = gimple_assign_rhs2 (stmt);
+ exp_type = TREE_TYPE (exp);
+ }
+ else
+ {
+ code = gimple_cond_code (stmt);
+ arg0 = gimple_cond_lhs (stmt);
+ arg1 = gimple_cond_rhs (stmt);
+ exp_type = boolean_type_node;
+ }
- code = gimple_assign_rhs_code (stmt);
- arg0 = gimple_assign_rhs1 (stmt);
if (TREE_CODE (arg0) != SSA_NAME)
break;
- arg1 = gimple_assign_rhs2 (stmt);
- exp_type = TREE_TYPE (exp);
loc = gimple_location (stmt);
switch (code)
{
@@ -1916,7 +1931,11 @@ range_entry_cmp (const void *a, const void *b)
[EXP, IN_P, LOW, HIGH, STRICT_OVERFLOW_P] is a merged range for
RANGE and OTHERRANGE through OTHERRANGE + COUNT - 1 ranges,
OPCODE and OPS are arguments of optimize_range_tests. Return
- true if the range merge has been successful. */
+ true if the range merge has been successful.
+ If OPCODE is ERROR_MARK, this is called from within
+ maybe_optimize_range_tests and is performing inter-bb range optimization.
+ Changes should be then performed right away, and whether an op is
+ BIT_AND_EXPR or BIT_IOR_EXPR is found in oe->rank. */
static bool
update_range_test (struct range_entry *range, struct range_entry *otherrange,
@@ -1924,9 +1943,12 @@ update_range_test (struct range_entry *range, struct range_entry *otherrange,
VEC (operand_entry_t, heap) **ops, tree exp, bool in_p,
tree low, tree high, bool strict_overflow_p)
{
- tree op = VEC_index (operand_entry_t, *ops, range->idx)->op;
- location_t loc = gimple_location (SSA_NAME_DEF_STMT (op));
- tree tem = build_range_check (loc, TREE_TYPE (op), exp, in_p, low, high);
+ operand_entry_t oe = VEC_index (oeprand_entry_t, *ops, range->idx);
+ tree op = oe->op;
+ gimple stmt = op ? SSA_NAME_DEF_STMT (op) : last_stmt (BASIC_BLOCK (oe->id));
+ location_t loc = gimple_location (stmt);
+ tree optype = op ? TREE_TYPE (op) : boolean_type_node;
+ tree tem = build_range_check (loc, optype, exp, in_p, low, high);
enum warn_strict_overflow_code wc = WARN_STRICT_OVERFLOW_COMPARISON;
gimple_stmt_iterator gsi;
@@ -1961,15 +1983,45 @@ update_range_test (struct range_entry *range, struct range_entry *otherrange,
fprintf (dump_file, "\n");
}
- if (opcode == BIT_IOR_EXPR)
+ if (opcode == BIT_IOR_EXPR
+ || (opcode == ERROR_MARK && oe->rank == BIT_IOR_EXPR))
tem = invert_truthvalue_loc (loc, tem);
- tem = fold_convert_loc (loc, TREE_TYPE (op), tem);
- gsi = gsi_for_stmt (SSA_NAME_DEF_STMT (op));
+ tem = fold_convert_loc (loc, optype, tem);
+ gsi = gsi_for_stmt (stmt);
tem = force_gimple_operand_gsi (&gsi, tem, true, NULL_TREE, true,
GSI_SAME_STMT);
- VEC_index (operand_entry_t, *ops, range->idx)->op = tem;
+ /* If doing inter-bb range test optimization, update the
+ stmts immediately. Start with changing the first range test
+ immediate use to the new value (TEM), or, if the first range
+ test is a GIMPLE_COND stmt, change that condition. */
+ if (opcode == ERROR_MARK)
+ {
+ if (op)
+ {
+ imm_use_iterator iter;
+ use_operand_p use_p;
+ gimple use_stmt;
+
+ FOR_EACH_IMM_USE_STMT (use_stmt, iter, op)
+ {
+ if (is_gimple_debug (use_stmt))
+ continue;
+ FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
+ SET_USE (use_p, tem);
+ update_stmt (use_stmt);
+ }
+ }
+ else
+ {
+ gimple_cond_set_code (stmt, NE_EXPR);
+ gimple_cond_set_lhs (stmt, tem);
+ gimple_cond_set_rhs (stmt, boolean_false_node);
+ update_stmt (stmt);
+ }
+ }
+ oe->op = tem;
range->exp = exp;
range->low = low;
range->high = high;
@@ -1978,7 +2030,84 @@ update_range_test (struct range_entry *range, struct range_entry *otherrange,
for (range = otherrange; range < otherrange + count; range++)
{
- VEC_index (operand_entry_t, *ops, range->idx)->op = error_mark_node;
+ oe = VEC_index (oeprand_entry_t, *ops, range->idx);
+ /* Now change all the other range test immediate uses, so that
+ those tests will be optimized away. */
+ if (opcode == ERROR_MARK)
+ {
+ if (oe->op)
+ {
+ imm_use_iterator iter;
+ use_operand_p use_p;
+ gimple use_stmt;
+
+ FOR_EACH_IMM_USE_STMT (use_stmt, iter, oe->op)
+ {
+ if (is_gimple_debug (use_stmt))
+ continue;
+ /* If imm use of _8 is a statement like _7 = _8 | _9;,
+ adjust it into _7 = _9;. */
+ if (is_gimple_assign (use_stmt)
+ && gimple_assign_rhs_code (use_stmt) == oe->rank)
+ {
+ tree expr = NULL_TREE;
+ if (oe->op == gimple_assign_rhs1 (use_stmt))
+ expr = gimple_assign_rhs2 (use_stmt);
+ else if (oe->op == gimple_assign_rhs2 (use_stmt))
+ expr = gimple_assign_rhs1 (use_stmt);
+ if (expr
+ && expr != oe->op
+ && TREE_CODE (expr) == SSA_NAME)
+ {
+ gimple_stmt_iterator gsi2 = gsi_for_stmt (use_stmt);
+ gimple_assign_set_rhs_with_ops (&gsi2, SSA_NAME,
+ expr, NULL_TREE);
+ update_stmt (use_stmt);
+ continue;
+ }
+ }
+ /* If imm use of _8 is a statement like _7 = (int) _8;,
+ adjust it into _7 = 0; or _7 = 1;. */
+ if (gimple_assign_cast_p (use_stmt)
+ && oe->op == gimple_assign_rhs1 (use_stmt))
+ {
+ tree lhs = gimple_assign_lhs (use_stmt);
+ if (INTEGRAL_TYPE_P (TREE_TYPE (lhs)))
+ {
+ gimple_stmt_iterator gsi2
+ = gsi_for_stmt (use_stmt);
+ tree expr = build_int_cst (TREE_TYPE (lhs),
+ oe->rank == BIT_IOR_EXPR
+ ? 0 : 1);
+ gimple_assign_set_rhs_with_ops (&gsi2,
+ INTEGER_CST,
+ expr, NULL_TREE);
+ update_stmt (use_stmt);
+ continue;
+ }
+ }
+ /* Otherwise replace the use with 0 or 1. */
+ FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
+ SET_USE (use_p,
+ build_int_cst (TREE_TYPE (oe->op),
+ oe->rank == BIT_IOR_EXPR
+ ? 0 : 1));
+ update_stmt (use_stmt);
+ }
+ }
+ else
+ {
+ /* If range test was a GIMPLE_COND, simply change it
+ into an always false or always true condition. */
+ stmt = last_stmt (BASIC_BLOCK (oe->id));
+ if (oe->rank == BIT_IOR_EXPR)
+ gimple_cond_make_false (stmt);
+ else
+ gimple_cond_make_true (stmt);
+ update_stmt (stmt);
+ }
+ }
+ oe->op = error_mark_node;
range->exp = NULL_TREE;
}
return true;
@@ -1986,7 +2115,12 @@ update_range_test (struct range_entry *range, struct range_entry *otherrange,
/* Optimize range tests, similarly how fold_range_test optimizes
it on trees. The tree code for the binary
- operation between all the operands is OPCODE. */
+ operation between all the operands is OPCODE.
+ If OPCODE is ERROR_MARK, optimize_range_tests is called from within
+ maybe_optimize_range_tests for inter-bb range optimization.
+ In that case if oe->op is NULL, oe->id is bb->index whose
+ GIMPLE_COND is && or ||ed into the test, and oe->rank says
+ the actual opcode. */
static void
optimize_range_tests (enum tree_code opcode,
@@ -2003,11 +2137,14 @@ optimize_range_tests (enum tree_code opcode,
ranges = XNEWVEC (struct range_entry, length);
for (i = 0; i < length; i++)
{
+ oe = VEC_index (operand_entry_t, *ops, i);
ranges[i].idx = i;
- init_range_entry (ranges + i, VEC_index (operand_entry_t, *ops, i)->op);
+ init_range_entry (ranges + i, oe->op,
+ oe->op ? NULL : last_stmt (BASIC_BLOCK (oe->id)));
/* For | invert it now, we will invert it again before emitting
the optimized expression. */
- if (opcode == BIT_IOR_EXPR)
+ if (opcode == BIT_IOR_EXPR
+ || (opcode == ERROR_MARK && oe->rank == BIT_IOR_EXPR))
ranges[i].in_p = !ranges[i].in_p;
}
@@ -2124,7 +2261,7 @@ optimize_range_tests (enum tree_code opcode,
}
}
- if (any_changes)
+ if (any_changes && opcode != ERROR_MARK)
{
j = 0;
FOR_EACH_VEC_ELT (operand_entry_t, *ops, i, oe)
@@ -2141,6 +2278,462 @@ optimize_range_tests (enum tree_code opcode,
XDELETEVEC (ranges);
}
+/* Return true if STMT is a cast like:
+ <bb N>:
+ ...
+ _123 = (int) _234;
+
+ <bb M>:
+ # _345 = PHI <_123(N), 1(...), 1(...)>
+ where _234 has bool type, _123 has single use and
+ bb N has a single successor M. This is commonly used in
+ the last block of a range test. */
+
+static bool
+final_range_test_p (gimple stmt)
+{
+ basic_block bb, rhs_bb;
+ edge e;
+ tree lhs, rhs;
+ use_operand_p use_p;
+ gimple use_stmt;
+
+ if (!gimple_assign_cast_p (stmt))
+ return false;
+ bb = gimple_bb (stmt);
+ if (!single_succ_p (bb))
+ return false;
+ e = single_succ_edge (bb);
+ if (e->flags & EDGE_COMPLEX)
+ return false;
+
+ lhs = gimple_assign_lhs (stmt);
+ rhs = gimple_assign_rhs1 (stmt);
+ if (!INTEGRAL_TYPE_P (TREE_TYPE (lhs))
+ || TREE_CODE (rhs) != SSA_NAME
+ || TREE_CODE (TREE_TYPE (rhs)) != BOOLEAN_TYPE)
+ return false;
+
+ /* Test whether lhs is consumed only by a PHI in the only successor bb. */
+ if (!single_imm_use (lhs, &use_p, &use_stmt))
+ return false;
+
+ if (gimple_code (use_stmt) != GIMPLE_PHI
+ || gimple_bb (use_stmt) != e->dest)
+ return false;
+
+ /* And that the rhs is defined in the same loop. */
+ rhs_bb = gimple_bb (SSA_NAME_DEF_STMT (rhs));
+ if (rhs_bb == NULL
+ || !flow_bb_inside_loop_p (loop_containing_stmt (stmt), rhs_bb))
+ return false;
+
+ return true;
+}
+
+/* Return true if BB is suitable basic block for inter-bb range test
+ optimization. If BACKWARD is true, BB should be the only predecessor
+ of TEST_BB, and *OTHER_BB is either NULL and filled by the routine,
+ or compared with to find a common basic block to which all conditions
+ branch to if true resp. false. If BACKWARD is false, TEST_BB should
+ be the only predecessor of BB. */
+
+static bool
+suitable_cond_bb (basic_block bb, basic_block test_bb, basic_block *other_bb,
+ bool backward)
+{
+ edge_iterator ei, ei2;
+ edge e, e2;
+ gimple stmt;
+ gimple_stmt_iterator gsi;
+ bool other_edge_seen = false;
+ bool is_cond;
+
+ if (test_bb == bb)
+ return false;
+ /* Check last stmt first. */
+ stmt = last_stmt (bb);
+ if (stmt == NULL
+ || (gimple_code (stmt) != GIMPLE_COND
+ && (backward || !final_range_test_p (stmt)))
+ || gimple_visited_p (stmt)
+ || stmt_could_throw_p (stmt)
+ || *other_bb == bb)
+ return false;
+ is_cond = gimple_code (stmt) == GIMPLE_COND;
+ if (is_cond)
+ {
+ /* If last stmt is GIMPLE_COND, verify that one of the succ edges
+ goes to the next bb (if BACKWARD, it is TEST_BB), and the other
+ to *OTHER_BB (if not set yet, try to find it out). */
+ if (EDGE_COUNT (bb->succs) != 2)
+ return false;
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ {
+ if (!(e->flags & (EDGE_TRUE_VALUE | EDGE_FALSE_VALUE)))
+ return false;
+ if (e->dest == test_bb)
+ {
+ if (backward)
+ continue;
+ else
+ return false;
+ }
+ if (e->dest == bb)
+ return false;
+ if (*other_bb == NULL)
+ {
+ FOR_EACH_EDGE (e2, ei2, test_bb->succs)
+ if (!(e2->flags & (EDGE_TRUE_VALUE | EDGE_FALSE_VALUE)))
+ return false;
+ else if (e->dest == e2->dest)
+ *other_bb = e->dest;
+ if (*other_bb == NULL)
+ return false;
+ }
+ if (e->dest == *other_bb)
+ other_edge_seen = true;
+ else if (backward)
+ return false;
+ }
+ if (*other_bb == NULL || !other_edge_seen)
+ return false;
+ }
+ else if (single_succ (bb) != *other_bb)
+ return false;
+
+ /* Now check all PHIs of *OTHER_BB. */
+ e = find_edge (bb, *other_bb);
+ e2 = find_edge (test_bb, *other_bb);
+ for (gsi = gsi_start_phis (e->dest); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple phi = gsi_stmt (gsi);
+ /* If both BB and TEST_BB end with GIMPLE_COND, all PHI arguments
+ corresponding to BB and TEST_BB predecessor must be the same. */
+ if (!operand_equal_p (gimple_phi_arg_def (phi, e->dest_idx),
+ gimple_phi_arg_def (phi, e2->dest_idx), 0))
+ {
+ /* Otherwise, if one of the blocks doesn't end with GIMPLE_COND,
+ one of the PHIs should have the lhs of the last stmt in
+ that block as PHI arg and that PHI should have 0 or 1
+ corresponding to it in all other range test basic blocks
+ considered. */
+ if (!is_cond)
+ {
+ if (gimple_phi_arg_def (phi, e->dest_idx)
+ == gimple_assign_lhs (stmt)
+ && (integer_zerop (gimple_phi_arg_def (phi, e2->dest_idx))
+ || integer_onep (gimple_phi_arg_def (phi,
+ e2->dest_idx))))
+ continue;
+ }
+ else
+ {
+ gimple test_last = last_stmt (test_bb);
+ if (gimple_code (test_last) != GIMPLE_COND
+ && gimple_phi_arg_def (phi, e2->dest_idx)
+ == gimple_assign_lhs (test_last)
+ && (integer_zerop (gimple_phi_arg_def (phi, e->dest_idx))
+ || integer_onep (gimple_phi_arg_def (phi, e->dest_idx))))
+ continue;
+ }
+
+ return false;
+ }
+ }
+ return true;
+}
+
+/* Return true if BB doesn't have side-effects that would disallow
+ range test optimization, all SSA_NAMEs set in the bb are consumed
+ in the bb and there are no PHIs. */
+
+static bool
+no_side_effect_bb (basic_block bb)
+{
+ gimple_stmt_iterator gsi;
+ gimple last;
+
+ if (!gimple_seq_empty_p (phi_nodes (bb)))
+ return false;
+ last = last_stmt (bb);
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple stmt = gsi_stmt (gsi);
+ tree lhs;
+ imm_use_iterator imm_iter;
+ use_operand_p use_p;
+
+ if (is_gimple_debug (stmt))
+ continue;
+ if (gimple_has_side_effects (stmt))
+ return false;
+ if (stmt == last)
+ return true;
+ if (!is_gimple_assign (stmt))
+ return false;
+ lhs = gimple_assign_lhs (stmt);
+ if (TREE_CODE (lhs) != SSA_NAME)
+ return false;
+ if (gimple_assign_rhs_could_trap_p (stmt))
+ return false;
+ FOR_EACH_IMM_USE_FAST (use_p, imm_iter, lhs)
+ {
+ gimple use_stmt = USE_STMT (use_p);
+ if (is_gimple_debug (use_stmt))
+ continue;
+ if (gimple_bb (use_stmt) != bb)
+ return false;
+ }
+ }
+ return false;
+}
+
+/* If VAR is set by CODE (BIT_{AND,IOR}_EXPR) which is reassociable,
+ return true and fill in *OPS recursively. */
+
+static bool
+get_ops (tree var, enum tree_code code, VEC(operand_entry_t, heap) **ops,
+ struct loop *loop)
+{
+ gimple stmt = SSA_NAME_DEF_STMT (var);
+ tree rhs[2];
+ int i;
+
+ if (!is_reassociable_op (stmt, code, loop))
+ return false;
+
+ rhs[0] = gimple_assign_rhs1 (stmt);
+ rhs[1] = gimple_assign_rhs2 (stmt);
+ gimple_set_visited (stmt, true);
+ for (i = 0; i < 2; i++)
+ if (TREE_CODE (rhs[i]) == SSA_NAME
+ && !get_ops (rhs[i], code, ops, loop)
+ && has_single_use (rhs[i]))
+ {
+ operand_entry_t oe = (operand_entry_t) pool_alloc (operand_entry_pool);
+
+ oe->op = rhs[i];
+ oe->rank = code;
+ oe->id = 0;
+ oe->count = 1;
+ VEC_safe_push (operand_entry_t, heap, *ops, oe);
+ }
+ return true;
+}
+
+/* Inter-bb range test optimization. */
+
+static void
+maybe_optimize_range_tests (gimple stmt)
+{
+ basic_block first_bb = gimple_bb (stmt);
+ basic_block last_bb = first_bb;
+ basic_block other_bb = NULL;
+ basic_block bb;
+ edge_iterator ei;
+ edge e;
+ VEC(operand_entry_t, heap) *ops = NULL;
+
+ /* Consider only basic blocks that end with GIMPLE_COND or
+ a cast statement satisfying final_range_test_p. All
+ but the last bb in the first_bb .. last_bb range
+ should end with GIMPLE_COND. */
+ if (gimple_code (stmt) == GIMPLE_COND)
+ {
+ if (EDGE_COUNT (first_bb->succs) != 2)
+ return;
+ }
+ else if (final_range_test_p (stmt))
+ other_bb = single_succ (first_bb);
+ else
+ return;
+
+ if (stmt_could_throw_p (stmt))
+ return;
+
+ /* As relative ordering of post-dominator sons isn't fixed,
+ maybe_optimize_range_tests can be called first on any
+ bb in the range we want to optimize. So, start searching
+ backwards, if first_bb can be set to a predecessor. */
+ while (single_pred_p (first_bb))
+ {
+ basic_block pred_bb = single_pred (first_bb);
+ if (!suitable_cond_bb (pred_bb, first_bb, &other_bb, true))
+ break;
+ if (!no_side_effect_bb (first_bb))
+ break;
+ first_bb = pred_bb;
+ }
+ /* If first_bb is last_bb, other_bb hasn't been computed yet.
+ Before starting forward search in last_bb successors, find
+ out the other_bb. */
+ if (first_bb == last_bb)
+ {
+ other_bb = NULL;
+ /* As non-GIMPLE_COND last stmt always terminates the range,
+ if forward search didn't discover anything, just give up. */
+ if (gimple_code (stmt) != GIMPLE_COND)
+ return;
+ /* Look at both successors. Either it ends with a GIMPLE_COND
+ and satisfies suitable_cond_bb, or ends with a cast and
+ other_bb is that cast's successor. */
+ FOR_EACH_EDGE (e, ei, first_bb->succs)
+ if (!(e->flags & (EDGE_TRUE_VALUE | EDGE_FALSE_VALUE))
+ || e->dest == first_bb)
+ return;
+ else if (single_pred_p (e->dest))
+ {
+ stmt = last_stmt (e->dest);
+ if (stmt
+ && gimple_code (stmt) == GIMPLE_COND
+ && EDGE_COUNT (e->dest->succs) == 2)
+ {
+ if (suitable_cond_bb (first_bb, e->dest, &other_bb, true))
+ break;
+ else
+ other_bb = NULL;
+ }
+ else if (stmt
+ && final_range_test_p (stmt)
+ && find_edge (first_bb, single_succ (e->dest)))
+ {
+ other_bb = single_succ (e->dest);
+ if (other_bb == first_bb)
+ other_bb = NULL;
+ }
+ }
+ if (other_bb == NULL)
+ return;
+ }
+ /* Now do the forward search, moving last_bb to successor bbs
+ that aren't other_bb. */
+ while (EDGE_COUNT (last_bb->succs) == 2)
+ {
+ FOR_EACH_EDGE (e, ei, last_bb->succs)
+ if (e->dest != other_bb)
+ break;
+ if (e == NULL)
+ break;
+ if (!single_pred_p (e->dest))
+ break;
+ if (!suitable_cond_bb (e->dest, last_bb, &other_bb, false))
+ break;
+ if (!no_side_effect_bb (e->dest))
+ break;
+ last_bb = e->dest;
+ }
+ if (first_bb == last_bb)
+ return;
+ /* Here basic blocks first_bb through last_bb's predecessor
+ end with GIMPLE_COND, all of them have one of the edges to
+ other_bb and another to another block in the range,
+ all blocks except first_bb don't have side-effects and
+ last_bb ends with either GIMPLE_COND, or cast satisfying
+ final_range_test_p. */
+ for (bb = last_bb; ; bb = single_pred (bb))
+ {
+ enum tree_code code;
+ tree lhs, rhs;
+
+ e = find_edge (bb, other_bb);
+ stmt = last_stmt (bb);
+ gimple_set_visited (stmt, true);
+ if (gimple_code (stmt) != GIMPLE_COND)
+ {
+ use_operand_p use_p;
+ gimple phi;
+ edge e2;
+ unsigned int d;
+
+ lhs = gimple_assign_lhs (stmt);
+ rhs = gimple_assign_rhs1 (stmt);
+ gcc_assert (bb == last_bb);
+
+ /* stmt is
+ _123 = (int) _234;
+
+ followed by:
+ <bb M>:
+ # _345 = PHI <_123(N), 1(...), 1(...)>
+
+ or 0 instead of 1. If it is 0, the _234
+ range test is anded together with all the
+ other range tests, if it is 1, it is ored with
+ them. */
+ single_imm_use (lhs, &use_p, &phi);
+ gcc_assert (gimple_code (phi) == GIMPLE_PHI);
+ e2 = find_edge (first_bb, other_bb);
+ d = e2->dest_idx;
+ gcc_assert (gimple_phi_arg_def (phi, e->dest_idx) == lhs);
+ if (integer_zerop (gimple_phi_arg_def (phi, d)))
+ code = BIT_AND_EXPR;
+ else
+ {
+ gcc_checking_assert (integer_onep (gimple_phi_arg_def (phi, d)));
+ code = BIT_IOR_EXPR;
+ }
+
+ /* If _234 SSA_NAME_DEF_STMT is
+ _234 = _567 | _789;
+ (or &, corresponding to 1/0 in the phi arguments,
+ push into ops the individual range test arguments
+ of the bitwise or resp. and, recursively. */
+ if (!get_ops (rhs, code, &ops,
+ loop_containing_stmt (stmt))
+ && has_single_use (rhs))
+ {
+ /* Otherwise, push the _234 range test itself. */
+ operand_entry_t oe
+ = (operand_entry_t) pool_alloc (operand_entry_pool);
+
+ oe->op = rhs;
+ oe->rank = code;
+ oe->id = 0;
+ oe->count = 1;
+ VEC_safe_push (operand_entry_t, heap, ops, oe);
+ }
+ continue;
+ }
+ /* Otherwise stmt is GIMPLE_COND. */
+ code = gimple_cond_code (stmt);
+ lhs = gimple_cond_lhs (stmt);
+ rhs = gimple_cond_rhs (stmt);
+ if (TREE_CODE (lhs) == SSA_NAME
+ && INTEGRAL_TYPE_P (TREE_TYPE (lhs))
+ && ((code != EQ_EXPR && code != NE_EXPR)
+ || rhs != boolean_false_node
+ /* Either push into ops the individual bitwise
+ or resp. and operands, depending on which
+ edge is other_bb. */
+ || !get_ops (lhs, (((e->flags & EDGE_TRUE_VALUE) == 0)
+ ^ (code == EQ_EXPR))
+ ? BIT_AND_EXPR : BIT_IOR_EXPR, &ops,
+ loop_containing_stmt (stmt))))
+ {
+ /* Or push the GIMPLE_COND stmt itself. */
+ operand_entry_t oe
+ = (operand_entry_t) pool_alloc (operand_entry_pool);
+
+ oe->op = NULL;
+ oe->rank = (e->flags & EDGE_TRUE_VALUE)
+ ? BIT_IOR_EXPR : BIT_AND_EXPR;
+ /* oe->op = NULL signs that there is no SSA_NAME
+ for the range test, and oe->id instead is the
+ basic block number, at which's end the GIMPLE_COND
+ is. */
+ oe->id = bb->index;
+ oe->count = 1;
+ VEC_safe_push (operand_entry_t, heap, ops, oe);
+ }
+ if (bb == first_bb)
+ break;
+ }
+ if (VEC_length (operand_entry_t, ops) > 1)
+ optimize_range_tests (ERROR_MARK, &ops);
+ VEC_free (operand_entry_t, heap, ops);
+}
+
/* Return true if OPERAND is defined by a PHI node which uses the LHS
of STMT in it's operands. This is also known as a "destructive
update" operation. */
@@ -3427,10 +4020,14 @@ reassociate_bb (basic_block bb)
{
gimple_stmt_iterator gsi;
basic_block son;
+ gimple stmt = last_stmt (bb);
+
+ if (stmt && !gimple_visited_p (stmt))
+ maybe_optimize_range_tests (stmt);
for (gsi = gsi_last_bb (bb); !gsi_end_p (gsi); gsi_prev (&gsi))
{
- gimple stmt = gsi_stmt (gsi);
+ stmt = gsi_stmt (gsi);
if (is_gimple_assign (stmt)
&& !stmt_could_throw_p (stmt))
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 711fbef2a64..8bfceb6ce87 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -1203,7 +1203,7 @@ build_pred_graph (void)
graph->eq_rep = XNEWVEC (int, graph->size);
graph->direct_nodes = sbitmap_alloc (graph->size);
graph->address_taken = BITMAP_ALLOC (&predbitmap_obstack);
- sbitmap_zero (graph->direct_nodes);
+ bitmap_clear (graph->direct_nodes);
for (j = 0; j < FIRST_REF_NODE; j++)
{
@@ -1533,7 +1533,7 @@ init_topo_info (void)
size_t size = graph->size;
struct topo_info *ti = XNEW (struct topo_info);
ti->visited = sbitmap_alloc (size);
- sbitmap_zero (ti->visited);
+ bitmap_clear (ti->visited);
ti->topo_order = VEC_alloc (unsigned, heap, 1);
return ti;
}
@@ -1811,9 +1811,9 @@ init_scc_info (size_t size)
si->current_index = 0;
si->visited = sbitmap_alloc (size);
- sbitmap_zero (si->visited);
+ bitmap_clear (si->visited);
si->deleted = sbitmap_alloc (size);
- sbitmap_zero (si->deleted);
+ bitmap_clear (si->deleted);
si->node_mapping = XNEWVEC (unsigned int, size);
si->dfs = XCNEWVEC (unsigned int, size);
@@ -2166,7 +2166,7 @@ perform_var_substitution (constraint_graph_t graph)
if (!TEST_BIT (si->visited, si->node_mapping[i]))
condense_visit (graph, si, si->node_mapping[i]);
- sbitmap_zero (si->visited);
+ bitmap_clear (si->visited);
/* Actually the label the nodes for pointer equivalences */
for (i = 0; i < FIRST_REF_NODE; i++)
if (!TEST_BIT (si->visited, si->node_mapping[i]))
diff --git a/gcc/tree-ssa-tail-merge.c b/gcc/tree-ssa-tail-merge.c
index 372096c344c..f9dc8806439 100644
--- a/gcc/tree-ssa-tail-merge.c
+++ b/gcc/tree-ssa-tail-merge.c
@@ -226,10 +226,11 @@ struct same_succ_def
hashval_t hashval;
/* hash_table support. */
- typedef same_succ_def T;
- static inline hashval_t hash (const same_succ_def *);
- static int equal (const same_succ_def *, const same_succ_def *);
- static void remove (same_succ_def *);
+ typedef same_succ_def value_type;
+ typedef same_succ_def compare_type;
+ static inline hashval_t hash (const value_type *);
+ static int equal (const value_type *, const compare_type *);
+ static void remove (value_type *);
};
typedef struct same_succ_def *same_succ;
typedef const struct same_succ_def *const_same_succ;
@@ -237,7 +238,7 @@ typedef const struct same_succ_def *const_same_succ;
/* hash routine for hash_table support, returns hashval of E. */
inline hashval_t
-same_succ_def::hash (const same_succ_def *e)
+same_succ_def::hash (const value_type *e)
{
return e->hashval;
}
@@ -528,7 +529,7 @@ inverse_flags (const_same_succ e1, const_same_succ e2)
/* Compares SAME_SUCCs E1 and E2. */
int
-same_succ_def::equal (const_same_succ e1, const_same_succ e2)
+same_succ_def::equal (const value_type *e1, const compare_type *e2)
{
unsigned int i, first1, first2;
gimple_stmt_iterator gsi1, gsi2;
@@ -1600,7 +1601,12 @@ tail_merge_optimize (unsigned int todo)
timevar_push (TV_TREE_TAIL_MERGE);
- calculate_dominance_info (CDI_DOMINATORS);
+ if (!dom_info_available_p (CDI_DOMINATORS))
+ {
+ /* PRE can leave us with unreachable blocks, remove them now. */
+ delete_unreachable_blocks ();
+ calculate_dominance_info (CDI_DOMINATORS);
+ }
init_worklist ();
while (!VEC_empty (same_succ, worklist))
diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c
index 6249e2f54c6..f43a564d786 100644
--- a/gcc/tree-ssa-threadedge.c
+++ b/gcc/tree-ssa-threadedge.c
@@ -584,7 +584,7 @@ cond_arg_set_in_bb (edge e, basic_block bb)
{
ssa_op_iter iter;
use_operand_p use_p;
- gimple last = gsi_stmt (gsi_last_bb (e->dest));
+ gimple last = last_stmt (e->dest);
/* E->dest does not have to end with a control transferring
instruction. This can occurr when we try to extend a jump
@@ -637,6 +637,24 @@ thread_around_empty_block (edge taken_edge,
if (!single_pred_p (bb))
return NULL;
+ /* Before threading, copy DEBUG stmts from the predecessor, so that
+ we don't lose the bindings as we redirect the edges. */
+ if (MAY_HAVE_DEBUG_STMTS)
+ {
+ gsi = gsi_after_labels (bb);
+ for (gimple_stmt_iterator si = gsi_last_bb (taken_edge->src);
+ !gsi_end_p (si); gsi_prev (&si))
+ {
+ stmt = gsi_stmt (si);
+ if (!is_gimple_debug (stmt))
+ continue;
+
+ stmt = gimple_copy (stmt);
+ /* ??? Should we drop the location of the copy? */
+ gsi_insert_before (&gsi, stmt, GSI_NEW_STMT);
+ }
+ }
+
/* This block must have more than one successor. */
if (single_succ_p (bb))
return NULL;
diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c
index ad64876c339..eca88a910c1 100644
--- a/gcc/tree-ssa-threadupdate.c
+++ b/gcc/tree-ssa-threadupdate.c
@@ -127,20 +127,21 @@ struct redirection_data : typed_free_remove<redirection_data>
struct el *incoming_edges;
/* hash_table support. */
- typedef redirection_data T;
- static inline hashval_t hash (const redirection_data *);
- static inline int equal (const redirection_data *, const redirection_data *);
+ typedef redirection_data value_type;
+ typedef redirection_data compare_type;
+ static inline hashval_t hash (const value_type *);
+ static inline int equal (const value_type *, const compare_type *);
};
inline hashval_t
-redirection_data::hash (const redirection_data *p)
+redirection_data::hash (const value_type *p)
{
edge e = p->outgoing_edge;
return e->dest->index;
}
inline int
-redirection_data::equal (const redirection_data *p1, const redirection_data *p2)
+redirection_data::equal (const value_type *p1, const compare_type *p2)
{
edge e1 = p1->outgoing_edge;
edge e2 = p2->outgoing_edge;
diff --git a/gcc/tree-stdarg.c b/gcc/tree-stdarg.c
index 8965ca3790c..fca2e8e368f 100644
--- a/gcc/tree-stdarg.c
+++ b/gcc/tree-stdarg.c
@@ -60,7 +60,7 @@ reachable_at_most_once (basic_block va_arg_bb, basic_block va_start_bb)
return false;
visited = sbitmap_alloc (last_basic_block);
- sbitmap_zero (visited);
+ bitmap_clear (visited);
ret = true;
FOR_EACH_EDGE (e, ei, va_arg_bb->preds)
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 58603188747..4f1966d5fff 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -1289,7 +1289,7 @@ vect_supported_load_permutation_p (slp_instance slp_instn, int group_size,
/* Check that the loads in the first sequence are different and there
are no gaps between them. */
load_index = sbitmap_alloc (group_size);
- sbitmap_zero (load_index);
+ bitmap_clear (load_index);
for (k = 0; k < group_size; k++)
{
first_group_load_index = VEC_index (int, load_permutation, k);
@@ -1407,7 +1407,7 @@ vect_supported_load_permutation_p (slp_instance slp_instn, int group_size,
supported = true;
load_index = sbitmap_alloc (group_size);
- sbitmap_zero (load_index);
+ bitmap_clear (load_index);
for (j = 0; j < group_size; j++)
{
for (i = j * group_size, k = 0;
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 379914cfad6..6547ed6235a 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -5661,7 +5661,7 @@ find_assert_locations (void)
if (!live[rpo[i]])
{
live[rpo[i]] = sbitmap_alloc (num_ssa_names);
- sbitmap_zero (live[rpo[i]]);
+ bitmap_clear (live[rpo[i]]);
}
/* Process BB and update the live information with uses in
@@ -5669,7 +5669,7 @@ find_assert_locations (void)
need_asserts |= find_assert_locations_1 (bb, live[rpo[i]]);
/* Merge liveness into the predecessor blocks and free it. */
- if (!sbitmap_empty_p (live[rpo[i]]))
+ if (!bitmap_empty_p (live[rpo[i]]))
{
int pred_rpo = i;
FOR_EACH_EDGE (e, ei, bb->preds)
@@ -5681,9 +5681,9 @@ find_assert_locations (void)
if (!live[pred])
{
live[pred] = sbitmap_alloc (num_ssa_names);
- sbitmap_zero (live[pred]);
+ bitmap_clear (live[pred]);
}
- sbitmap_a_or_b (live[pred], live[pred], live[rpo[i]]);
+ bitmap_ior (live[pred], live[pred], live[rpo[i]]);
if (bb_rpo[pred] < pred_rpo)
pred_rpo = bb_rpo[pred];
diff --git a/gcc/tree.c b/gcc/tree.c
index 7cb1ea14d1d..a671aed236e 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -1992,12 +1992,25 @@ real_zerop (const_tree expr)
{
STRIP_NOPS (expr);
- return ((TREE_CODE (expr) == REAL_CST
- && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst0)
- && !(DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (expr)))))
- || (TREE_CODE (expr) == COMPLEX_CST
- && real_zerop (TREE_REALPART (expr))
- && real_zerop (TREE_IMAGPART (expr))));
+ switch (TREE_CODE (expr))
+ {
+ case REAL_CST:
+ return REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst0)
+ && !(DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (expr))));
+ case COMPLEX_CST:
+ return real_zerop (TREE_REALPART (expr))
+ && real_zerop (TREE_IMAGPART (expr));
+ case VECTOR_CST:
+ {
+ unsigned i;
+ for (i = 0; i < VECTOR_CST_NELTS (expr); ++i)
+ if (!real_zerop (VECTOR_CST_ELT (expr, i)))
+ return false;
+ return true;
+ }
+ default:
+ return false;
+ }
}
/* Return 1 if EXPR is the real constant one in real or complex form.
@@ -2009,12 +2022,25 @@ real_onep (const_tree expr)
{
STRIP_NOPS (expr);
- return ((TREE_CODE (expr) == REAL_CST
- && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst1)
- && !(DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (expr)))))
- || (TREE_CODE (expr) == COMPLEX_CST
- && real_onep (TREE_REALPART (expr))
- && real_zerop (TREE_IMAGPART (expr))));
+ switch (TREE_CODE (expr))
+ {
+ case REAL_CST:
+ return REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst1)
+ && !(DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (expr))));
+ case COMPLEX_CST:
+ return real_onep (TREE_REALPART (expr))
+ && real_zerop (TREE_IMAGPART (expr));
+ case VECTOR_CST:
+ {
+ unsigned i;
+ for (i = 0; i < VECTOR_CST_NELTS (expr); ++i)
+ if (!real_onep (VECTOR_CST_ELT (expr, i)))
+ return false;
+ return true;
+ }
+ default:
+ return false;
+ }
}
/* Return 1 if EXPR is the real constant two. Trailing zeroes matter
@@ -2025,12 +2051,25 @@ real_twop (const_tree expr)
{
STRIP_NOPS (expr);
- return ((TREE_CODE (expr) == REAL_CST
- && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst2)
- && !(DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (expr)))))
- || (TREE_CODE (expr) == COMPLEX_CST
- && real_twop (TREE_REALPART (expr))
- && real_zerop (TREE_IMAGPART (expr))));
+ switch (TREE_CODE (expr))
+ {
+ case REAL_CST:
+ return REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst2)
+ && !(DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (expr))));
+ case COMPLEX_CST:
+ return real_twop (TREE_REALPART (expr))
+ && real_zerop (TREE_IMAGPART (expr));
+ case VECTOR_CST:
+ {
+ unsigned i;
+ for (i = 0; i < VECTOR_CST_NELTS (expr); ++i)
+ if (!real_twop (VECTOR_CST_ELT (expr, i)))
+ return false;
+ return true;
+ }
+ default:
+ return false;
+ }
}
/* Return 1 if EXPR is the real constant minus one. Trailing zeroes
@@ -2041,12 +2080,25 @@ real_minus_onep (const_tree expr)
{
STRIP_NOPS (expr);
- return ((TREE_CODE (expr) == REAL_CST
- && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconstm1)
- && !(DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (expr)))))
- || (TREE_CODE (expr) == COMPLEX_CST
- && real_minus_onep (TREE_REALPART (expr))
- && real_zerop (TREE_IMAGPART (expr))));
+ switch (TREE_CODE (expr))
+ {
+ case REAL_CST:
+ return REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconstm1)
+ && !(DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (expr))));
+ case COMPLEX_CST:
+ return real_minus_onep (TREE_REALPART (expr))
+ && real_zerop (TREE_IMAGPART (expr));
+ case VECTOR_CST:
+ {
+ unsigned i;
+ for (i = 0; i < VECTOR_CST_NELTS (expr); ++i)
+ if (!real_minus_onep (VECTOR_CST_ELT (expr, i)))
+ return false;
+ return true;
+ }
+ default:
+ return false;
+ }
}
/* Nonzero if EXP is a constant or a cast of a constant. */
@@ -10241,6 +10293,17 @@ signed_or_unsigned_type_for (int unsignedp, tree type)
if (TREE_CODE (type) == INTEGER_TYPE && TYPE_UNSIGNED (type) == unsignedp)
return type;
+ if (TREE_CODE (type) == VECTOR_TYPE)
+ {
+ tree inner = TREE_TYPE (type);
+ tree inner2 = signed_or_unsigned_type_for (unsignedp, inner);
+ if (!inner2)
+ return NULL_TREE;
+ if (inner == inner2)
+ return type;
+ return build_vector_type (inner2, TYPE_VECTOR_SUBPARTS (type));
+ }
+
if (!INTEGRAL_TYPE_P (type)
&& !POINTER_TYPE_P (type))
return NULL_TREE;
diff --git a/gcc/tree.h b/gcc/tree.h
index c6a5eab5024..d921886c2ea 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -1066,6 +1066,10 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
#define POINTER_TYPE_P(TYPE) \
(TREE_CODE (TYPE) == POINTER_TYPE || TREE_CODE (TYPE) == REFERENCE_TYPE)
+/* Nonzero if TYPE represents a pointer to function. */
+#define FUNCTION_POINTER_TYPE_P(TYPE) \
+ (POINTER_TYPE_P (TYPE) && TREE_CODE (TREE_TYPE (TYPE)) == FUNCTION_TYPE)
+
/* Nonzero if this type is a complete type. */
#define COMPLETE_TYPE_P(NODE) (TYPE_SIZE (NODE) != NULL_TREE)
diff --git a/gcc/valtrack.c b/gcc/valtrack.c
index 52f5ed65313..5eefabd2aed 100644
--- a/gcc/valtrack.c
+++ b/gcc/valtrack.c
@@ -225,14 +225,13 @@ dead_debug_global_find (struct dead_debug_global *global, rtx reg)
dead_debug_global_entry *entry = global->htab.find (&temp_entry);
gcc_checking_assert (entry && entry->reg == temp_entry.reg);
- gcc_checking_assert (entry->dtemp);
return entry;
}
/* Insert an entry mapping REG to DTEMP in GLOBAL->htab. */
-static void
+static dead_debug_global_entry *
dead_debug_global_insert (struct dead_debug_global *global, rtx reg, rtx dtemp)
{
dead_debug_global_entry temp_entry;
@@ -246,6 +245,7 @@ dead_debug_global_insert (struct dead_debug_global *global, rtx reg, rtx dtemp)
gcc_checking_assert (!*slot);
*slot = XNEW (dead_debug_global_entry);
**slot = temp_entry;
+ return *slot;
}
/* If UREGNO, referenced by USE, is a pseudo marked as used in GLOBAL,
@@ -263,16 +263,19 @@ dead_debug_global_replace_temp (struct dead_debug_global *global,
{
if (!global || uregno < FIRST_PSEUDO_REGISTER
|| !global->used
+ || !REG_P (*DF_REF_REAL_LOC (use))
+ || REGNO (*DF_REF_REAL_LOC (use)) != uregno
|| !bitmap_bit_p (global->used, uregno))
return false;
- gcc_checking_assert (REGNO (*DF_REF_REAL_LOC (use)) == uregno);
-
dead_debug_global_entry *entry
= dead_debug_global_find (global, *DF_REF_REAL_LOC (use));
gcc_checking_assert (GET_CODE (entry->reg) == REG
&& REGNO (entry->reg) == uregno);
+ if (!entry->dtemp)
+ return true;
+
*DF_REF_REAL_LOC (use) = entry->dtemp;
if (!pto_rescan)
df_insn_rescan (DF_REF_INSN (use));
@@ -364,6 +367,8 @@ dead_debug_promote_uses (struct dead_debug_local *debug)
head; head = *headp)
{
rtx reg = *DF_REF_REAL_LOC (head->use);
+ df_ref ref;
+ dead_debug_global_entry *entry;
if (GET_CODE (reg) != REG
|| REGNO (reg) < FIRST_PSEUDO_REGISTER)
@@ -375,18 +380,49 @@ dead_debug_promote_uses (struct dead_debug_local *debug)
if (!debug->global->used)
debug->global->used = BITMAP_ALLOC (NULL);
- if (bitmap_set_bit (debug->global->used, REGNO (reg)))
- dead_debug_global_insert (debug->global, reg,
- make_debug_expr_from_rtl (reg));
+ bool added = bitmap_set_bit (debug->global->used, REGNO (reg));
+ gcc_checking_assert (added);
- if (!dead_debug_global_replace_temp (debug->global, head->use,
- REGNO (reg), &debug->to_rescan))
- {
- headp = &head->next;
- continue;
- }
-
+ entry = dead_debug_global_insert (debug->global, reg,
+ make_debug_expr_from_rtl (reg));
+
+ gcc_checking_assert (entry->dtemp);
+
+ /* Tentatively remove the USE from the list. */
*headp = head->next;
+
+ if (!debug->to_rescan)
+ debug->to_rescan = BITMAP_ALLOC (NULL);
+
+ for (ref = DF_REG_USE_CHAIN (REGNO (reg)); ref;
+ ref = DF_REF_NEXT_REG (ref))
+ if (DEBUG_INSN_P (DF_REF_INSN (ref)))
+ {
+ if (!dead_debug_global_replace_temp (debug->global, ref,
+ REGNO (reg),
+ &debug->to_rescan))
+ {
+ rtx insn = DF_REF_INSN (ref);
+ INSN_VAR_LOCATION_LOC (insn) = gen_rtx_UNKNOWN_VAR_LOC ();
+ bitmap_set_bit (debug->to_rescan, INSN_UID (insn));
+ }
+ }
+
+ for (ref = DF_REG_DEF_CHAIN (REGNO (reg)); ref;
+ ref = DF_REF_NEXT_REG (ref))
+ if (!dead_debug_insert_temp (debug, REGNO (reg), DF_REF_INSN (ref),
+ DEBUG_TEMP_BEFORE_WITH_VALUE))
+ {
+ rtx bind;
+ bind = gen_rtx_VAR_LOCATION (GET_MODE (reg),
+ DEBUG_EXPR_TREE_DECL (entry->dtemp),
+ gen_rtx_UNKNOWN_VAR_LOC (),
+ VAR_INIT_STATUS_INITIALIZED);
+ rtx insn = emit_debug_insn_before (bind, DF_REF_INSN (ref));
+ bitmap_set_bit (debug->to_rescan, INSN_UID (insn));
+ }
+
+ entry->dtemp = NULL;
XDELETE (head);
}
}
@@ -398,12 +434,12 @@ dead_debug_promote_uses (struct dead_debug_local *debug)
void
dead_debug_local_finish (struct dead_debug_local *debug, bitmap used)
{
- if (debug->used != used)
- BITMAP_FREE (debug->used);
-
if (debug->global)
dead_debug_promote_uses (debug);
+ if (debug->used != used)
+ BITMAP_FREE (debug->used);
+
dead_debug_reset_uses (debug, debug->head);
if (debug->to_rescan)
@@ -535,6 +571,8 @@ dead_debug_insert_temp (struct dead_debug_local *debug, unsigned int uregno,
= dead_debug_global_find (debug->global, reg);
gcc_checking_assert (entry->reg == reg);
dval = entry->dtemp;
+ if (!dval)
+ return 0;
}
gcc_checking_assert (uses || global);
@@ -648,11 +686,14 @@ dead_debug_insert_temp (struct dead_debug_local *debug, unsigned int uregno,
DEBUG_EXPR_TREE_DECL (dval), breg,
VAR_INIT_STATUS_INITIALIZED);
- if (where == DEBUG_TEMP_AFTER_WITH_REG)
+ if (where == DEBUG_TEMP_AFTER_WITH_REG
+ || where == DEBUG_TEMP_AFTER_WITH_REG_FORCE)
bind = emit_debug_insn_after (bind, insn);
else
bind = emit_debug_insn_before (bind, insn);
- df_insn_rescan (bind);
+ if (debug->to_rescan == NULL)
+ debug->to_rescan = BITMAP_ALLOC (NULL);
+ bitmap_set_bit (debug->to_rescan, INSN_UID (bind));
/* Adjust all uses. */
while ((cur = uses))
@@ -663,8 +704,6 @@ dead_debug_insert_temp (struct dead_debug_local *debug, unsigned int uregno,
*DF_REF_REAL_LOC (cur->use)
= gen_lowpart_SUBREG (GET_MODE (*DF_REF_REAL_LOC (cur->use)), dval);
/* ??? Should we simplify subreg of subreg? */
- if (debug->to_rescan == NULL)
- debug->to_rescan = BITMAP_ALLOC (NULL);
bitmap_set_bit (debug->to_rescan, INSN_UID (DF_REF_INSN (cur->use)));
uses = cur->next;
XDELETE (cur);
diff --git a/gcc/valtrack.h b/gcc/valtrack.h
index 303ffa43a8f..a925e27a509 100644
--- a/gcc/valtrack.h
+++ b/gcc/valtrack.h
@@ -46,32 +46,33 @@ struct dead_debug_global_entry
struct dead_debug_hash_descr
{
/* The hash table contains pointers to entries of this type. */
- typedef struct dead_debug_global_entry T;
+ typedef struct dead_debug_global_entry value_type;
+ typedef struct dead_debug_global_entry compare_type;
/* Hash on the pseudo number. */
- static inline hashval_t hash (T const *my);
+ static inline hashval_t hash (const value_type *my);
/* Entries are identical if they refer to the same pseudo. */
- static inline bool equal (T const *my, T const *other);
+ static inline bool equal (const value_type *my, const compare_type *other);
/* Release entries when they're removed. */
- static inline void remove (T *p);
+ static inline void remove (value_type *p);
};
/* Hash on the pseudo number. */
inline hashval_t
-dead_debug_hash_descr::hash (T const *my)
+dead_debug_hash_descr::hash (const value_type *my)
{
return REGNO (my->reg);
}
/* Entries are identical if they refer to the same pseudo. */
inline bool
-dead_debug_hash_descr::equal (T const *my, T const *other)
+dead_debug_hash_descr::equal (const value_type *my, const compare_type *other)
{
return my->reg == other->reg;
}
/* Release entries when they're removed. */
inline void
-dead_debug_hash_descr::remove (T *p)
+dead_debug_hash_descr::remove (value_type *p)
{
XDELETE (p);
}
@@ -130,7 +131,12 @@ enum debug_temp_where
/* Bind a newly-created debug temporary to a REG for UREGNO, and
insert the debug insn after INSN. REG is expected to be set at
INSN. */
- DEBUG_TEMP_AFTER_WITH_REG = 1
+ DEBUG_TEMP_AFTER_WITH_REG = 1,
+ /* Like DEBUG_TEMP_AFTER_WITH_REG, but force addition of a debug
+ temporary even if there is just a single debug use. This is used
+ on regs that are becoming REG_DEAD on INSN and so uses of the
+ reg later on are invalid. */
+ DEBUG_TEMP_AFTER_WITH_REG_FORCE = 2
};
extern void dead_debug_global_init (struct dead_debug_global *, bitmap);
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index 25973a9776e..d5ab1d1e554 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -4921,7 +4921,9 @@ track_expr_p (tree expr, bool need_rtl)
realdecl = expr;
else if (!DECL_P (realdecl))
{
- if (handled_component_p (realdecl))
+ if (handled_component_p (realdecl)
+ || (TREE_CODE (realdecl) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (realdecl, 0)) == ADDR_EXPR))
{
HOST_WIDE_INT bitsize, bitpos, maxsize;
tree innerdecl
@@ -6746,11 +6748,11 @@ vt_find_locations (void)
visited = sbitmap_alloc (last_basic_block);
in_worklist = sbitmap_alloc (last_basic_block);
in_pending = sbitmap_alloc (last_basic_block);
- sbitmap_zero (in_worklist);
+ bitmap_clear (in_worklist);
FOR_EACH_BB (bb)
fibheap_insert (pending, bb_order[bb->index], bb);
- sbitmap_ones (in_pending);
+ bitmap_ones (in_pending);
while (success && !fibheap_empty (pending))
{
@@ -6761,7 +6763,7 @@ vt_find_locations (void)
in_pending = in_worklist;
in_worklist = sbitmap_swap;
- sbitmap_zero (visited);
+ bitmap_clear (visited);
while (!fibheap_empty (worklist))
{
diff --git a/gcc/vmsdbgout.c b/gcc/vmsdbgout.c
index 29eaf50df26..5472ac54ee9 100644
--- a/gcc/vmsdbgout.c
+++ b/gcc/vmsdbgout.c
@@ -1371,7 +1371,7 @@ lookup_filename (const char *file_name)
static void
vmsdbgout_write_source_line (unsigned line, const char *filename,
- int discriminator, bool is_stmt)
+ int /* discriminator */, bool /* is_stmt */)
{
dst_line_info_ref line_info;
diff --git a/libbacktrace/ChangeLog b/libbacktrace/ChangeLog
index 729123d8bb0..91e1c9eccd4 100644
--- a/libbacktrace/ChangeLog
+++ b/libbacktrace/ChangeLog
@@ -1,3 +1,29 @@
+2012-10-29 Ian Lance Taylor <iant@google.com>
+
+ * mmap.c (backtrace_vector_release): Correct last patch: add
+ aligned, not size.
+
+2012-10-29 Ian Lance Taylor <iant@google.com>
+
+ * mmap.c (backtrace_vector_release): Make sure freed block is
+ aligned on 8-byte boundary.
+
+2012-10-26 Ian Lance Taylor <iant@google.com>
+
+ PR other/55087
+ * posix.c (backtrace_open): Add does_not_exist parameter.
+ * elf.c (phdr_callback): Do not warn if shared library could not
+ be opened.
+ * fileline.c (fileline_initialize): Update calls to
+ backtrace_open.
+ * internal.h (backtrace_open): Update declaration.
+
+2012-10-26 Jack Howarth <howarth@bromo.med.uc.edu>
+
+ PR target/55061
+ * configure.ac: Check for _Unwind_GetIPInfo function declaration.
+ * configure: Regenerate.
+
2012-10-24 Ian Lance Taylor <iant@google.com>
PR target/55061
diff --git a/libbacktrace/configure b/libbacktrace/configure
index f4608d1fa1d..36b6b8dff8c 100755
--- a/libbacktrace/configure
+++ b/libbacktrace/configure
@@ -11619,13 +11619,32 @@ $as_echo "#define HAVE_GETIPINFO 1" >>confdefs.h
fi
else
- ac_fn_c_check_func "$LINENO" "_Unwind_GetIPInfo" "ac_cv_func__Unwind_GetIPInfo"
-if test "x$ac_cv_func__Unwind_GetIPInfo" = x""yes; then :
+ ac_save_CFFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Werror-implicit-function-declaration"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _Unwind_GetIPInfo" >&5
+$as_echo_n "checking for _Unwind_GetIPInfo... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include "unwind.h"
+ struct _Unwind_Context *context;
+ int ip_before_insn = 0;
+int
+main ()
+{
+return _Unwind_GetIPInfo (context, &ip_before_insn);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
have_unwind_getipinfo=yes
else
have_unwind_getipinfo=no
fi
-
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$ac_save_CFLAGS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_unwind_getipinfo" >&5
+$as_echo "$have_unwind_getipinfo" >&6; }
if test "$have_unwind_getipinfo" = "yes"; then
$as_echo "#define HAVE_GETIPINFO 1" >>confdefs.h
diff --git a/libbacktrace/configure.ac b/libbacktrace/configure.ac
index 6867ecffb89..534f9276cdb 100644
--- a/libbacktrace/configure.ac
+++ b/libbacktrace/configure.ac
@@ -129,8 +129,18 @@ AC_SUBST(WARN_FLAGS)
if test -n "${with_target_subdir}"; then
GCC_CHECK_UNWIND_GETIPINFO
else
- AC_CHECK_FUNC(_Unwind_GetIPInfo, [have_unwind_getipinfo=yes],
- [have_unwind_getipinfo=no])
+ ac_save_CFFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Werror-implicit-function-declaration"
+ AC_MSG_CHECKING([for _Unwind_GetIPInfo])
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [#include "unwind.h"
+ struct _Unwind_Context *context;
+ int ip_before_insn = 0;],
+ [return _Unwind_GetIPInfo (context, &ip_before_insn);])],
+ [have_unwind_getipinfo=yes], [have_unwind_getipinfo=no])
+ CFLAGS="$ac_save_CFLAGS"
+ AC_MSG_RESULT([$have_unwind_getipinfo])
if test "$have_unwind_getipinfo" = "yes"; then
AC_DEFINE(HAVE_GETIPINFO, 1, [Define if _Unwind_GetIPInfo is available.])
fi
diff --git a/libbacktrace/elf.c b/libbacktrace/elf.c
index b396c47ef29..8433a72fcd6 100644
--- a/libbacktrace/elf.c
+++ b/libbacktrace/elf.c
@@ -810,6 +810,7 @@ phdr_callback (struct dl_phdr_info *info, size_t size ATTRIBUTE_UNUSED,
{
struct phdr_data *pd = (struct phdr_data *) pdata;
int descriptor;
+ int does_not_exist;
fileline elf_fileline_fn;
int found_dwarf;
@@ -821,7 +822,8 @@ phdr_callback (struct dl_phdr_info *info, size_t size ATTRIBUTE_UNUSED,
|| info->dlpi_addr == 0)
return 0;
- descriptor = backtrace_open (info->dlpi_name, pd->error_callback, pd->data);
+ descriptor = backtrace_open (info->dlpi_name, pd->error_callback, pd->data,
+ &does_not_exist);
if (descriptor < 0)
return 0;
diff --git a/libbacktrace/fileline.c b/libbacktrace/fileline.c
index 4efd19b0595..e577ecc9061 100644
--- a/libbacktrace/fileline.c
+++ b/libbacktrace/fileline.c
@@ -80,9 +80,9 @@ fileline_initialize (struct backtrace_state *state,
/* We have not initialized the information. Do it now. */
if (state->filename != NULL)
- descriptor = backtrace_open (state->filename, error_callback, data);
+ descriptor = backtrace_open (state->filename, error_callback, data, NULL);
else
- descriptor = backtrace_open ("/proc/self/exe", error_callback, data);
+ descriptor = backtrace_open ("/proc/self/exe", error_callback, data, NULL);
if (descriptor < 0)
failed = 1;
diff --git a/libbacktrace/internal.h b/libbacktrace/internal.h
index b1afca0a2d9..5e0dba44a85 100644
--- a/libbacktrace/internal.h
+++ b/libbacktrace/internal.h
@@ -109,10 +109,16 @@ struct backtrace_state
struct backtrace_freelist_struct *freelist;
};
-/* Open a file for reading. Returns -1 on error. */
+/* Open a file for reading. Returns -1 on error. If DOES_NOT_EXIST
+ is not NULL, *DOES_NOT_EXIST will be set to 0 normally and set to 1
+ if the file does not exist. If the file does not exist and
+ DOES_NOT_EXIST is not NULL, the function will return -1 and will
+ not call ERROR_CALLBACK. On other errors, or if DOES_NOT_EXIST is
+ NULL, the function will call ERROR_CALLBACK before returning. */
extern int backtrace_open (const char *filename,
backtrace_error_callback error_callback,
- void *data);
+ void *data,
+ int *does_not_exist);
/* A view of the contents of a file. This supports mmap when
available. A view will remain in memory even after backtrace_close
diff --git a/libbacktrace/mmap.c b/libbacktrace/mmap.c
index e07810d4575..d3313c7cf1e 100644
--- a/libbacktrace/mmap.c
+++ b/libbacktrace/mmap.c
@@ -229,7 +229,18 @@ backtrace_vector_release (struct backtrace_state *state,
backtrace_error_callback error_callback,
void *data)
{
- backtrace_free (state, (char *) vec->base + vec->size, vec->alc,
+ size_t size;
+ size_t alc;
+ size_t aligned;
+
+ /* Make sure that the block that we free is aligned on an 8-byte
+ boundary. */
+ size = vec->size;
+ alc = vec->alc;
+ aligned = (size + 7) & ~ (size_t) 7;
+ alc -= aligned - size;
+
+ backtrace_free (state, (char *) vec->base + aligned, alc,
error_callback, data);
vec->alc = 0;
return 1;
diff --git a/libbacktrace/posix.c b/libbacktrace/posix.c
index 01afc42b08e..4d6c852b781 100644
--- a/libbacktrace/posix.c
+++ b/libbacktrace/posix.c
@@ -57,14 +57,20 @@ POSSIBILITY OF SUCH DAMAGE. */
int
backtrace_open (const char *filename, backtrace_error_callback error_callback,
- void *data)
+ void *data, int *does_not_exist)
{
int descriptor;
+ if (does_not_exist != NULL)
+ *does_not_exist = 0;
+
descriptor = open (filename, O_RDONLY | O_BINARY | O_CLOEXEC);
if (descriptor < 0)
{
- error_callback (data, filename, errno);
+ if (does_not_exist != NULL && errno == ENOENT)
+ *does_not_exist = 1;
+ else
+ error_callback (data, filename, errno);
return -1;
}
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index 9d31a064930..56d77254299 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,8 @@
+2012-10-31 Alan Modra <amodra@gmail.com>
+
+ * src/powerpc/linux64_closure.S: Add new ABI support.
+ * src/powerpc/linux64.S: Likewise.
+
2012-09-14 David Edelsohn <dje.gcc@gmail.com>
* configure: Regenerated.
diff --git a/libffi/src/powerpc/linux64.S b/libffi/src/powerpc/linux64.S
index 57b56cbb266..f28da8120b7 100644
--- a/libffi/src/powerpc/linux64.S
+++ b/libffi/src/powerpc/linux64.S
@@ -30,16 +30,25 @@
#include <ffi.h>
#ifdef __powerpc64__
- .hidden ffi_call_LINUX64, .ffi_call_LINUX64
- .globl ffi_call_LINUX64, .ffi_call_LINUX64
+ .hidden ffi_call_LINUX64
+ .globl ffi_call_LINUX64
.section ".opd","aw"
.align 3
ffi_call_LINUX64:
+#ifdef _CALL_LINUX
+ .quad .L.ffi_call_LINUX64,.TOC.@tocbase,0
+ .type ffi_call_LINUX64,@function
+ .text
+.L.ffi_call_LINUX64:
+#else
+ .hidden .ffi_call_LINUX64
+ .globl .ffi_call_LINUX64
.quad .ffi_call_LINUX64,.TOC.@tocbase,0
.size ffi_call_LINUX64,24
.type .ffi_call_LINUX64,@function
.text
.ffi_call_LINUX64:
+#endif
.LFB1:
mflr %r0
std %r28, -32(%r1)
@@ -58,7 +67,11 @@ ffi_call_LINUX64:
/* Call ffi_prep_args64. */
mr %r4, %r1
+#ifdef _CALL_LINUX
+ bl ffi_prep_args64
+#else
bl .ffi_prep_args64
+#endif
ld %r0, 0(%r29)
ld %r2, 8(%r29)
@@ -137,7 +150,11 @@ ffi_call_LINUX64:
.LFE1:
.long 0
.byte 0,12,0,1,128,4,0,0
+#ifdef _CALL_LINUX
+ .size ffi_call_LINUX64,.-.L.ffi_call_LINUX64
+#else
.size .ffi_call_LINUX64,.-.ffi_call_LINUX64
+#endif
.section .eh_frame,EH_FRAME_FLAGS,@progbits
.Lframe1:
diff --git a/libffi/src/powerpc/linux64_closure.S b/libffi/src/powerpc/linux64_closure.S
index f7aa2c98efc..b1e12197a2b 100644
--- a/libffi/src/powerpc/linux64_closure.S
+++ b/libffi/src/powerpc/linux64_closure.S
@@ -32,16 +32,24 @@
#ifdef __powerpc64__
FFI_HIDDEN (ffi_closure_LINUX64)
- FFI_HIDDEN (.ffi_closure_LINUX64)
- .globl ffi_closure_LINUX64, .ffi_closure_LINUX64
+ .globl ffi_closure_LINUX64
.section ".opd","aw"
.align 3
ffi_closure_LINUX64:
+#ifdef _CALL_LINUX
+ .quad .L.ffi_closure_LINUX64,.TOC.@tocbase,0
+ .type ffi_closure_LINUX64,@function
+ .text
+.L.ffi_closure_LINUX64:
+#else
+ FFI_HIDDEN (.ffi_closure_LINUX64)
+ .globl .ffi_closure_LINUX64
.quad .ffi_closure_LINUX64,.TOC.@tocbase,0
.size ffi_closure_LINUX64,24
.type .ffi_closure_LINUX64,@function
.text
.ffi_closure_LINUX64:
+#endif
.LFB1:
# save general regs into parm save area
std %r3, 48(%r1)
@@ -91,7 +99,11 @@ ffi_closure_LINUX64:
addi %r6, %r1, 128
# make the call
+#ifdef _CALL_LINUX
+ bl ffi_closure_helper_LINUX64
+#else
bl .ffi_closure_helper_LINUX64
+#endif
.Lret:
# now r3 contains the return type
@@ -194,7 +206,11 @@ ffi_closure_LINUX64:
.LFE1:
.long 0
.byte 0,12,0,1,128,0,0,0
+#ifdef _CALL_LINUX
+ .size ffi_closure_LINUX64,.-.L.ffi_closure_LINUX64
+#else
.size .ffi_closure_LINUX64,.-.ffi_closure_LINUX64
+#endif
.section .eh_frame,EH_FRAME_FLAGS,@progbits
.Lframe1:
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index fd4b9346e2b..6be90f579f2 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,24 @@
+2012-10-31 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * config.host (m32r-*-rtems*): Include crtinit.o and crtfinit.o
+ as extra_parts.
+
+2012-10-26 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/crtfastmath.c (set_fast_math): Use __builtin_ia32_fxsave.
+ Clear only fxsave.mxcsr_mask. Use saved mxcsr from fxsave structure
+ when appropriate. Correct structure element types.
+ * config/i386/t-crtfm (crtfastmath.o): Compile with -mfxsr, remove
+ -minline-all-stringops from compile flags.
+
+2012-10-25 Ralf Corsépius <ralf.corsepius@rtems.org>
+
+ * config.host (sparc64-*-rtems*): Remove sparc/t-elf.
+
+2012-10-25 Ralf Corsépius <ralf.corsepius@rtems.org>
+
+ * config.host (sh*-*-rtems*): Add sh*-*-elf*'s extra_parts.
+
2012-10-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
* config.host (powerpc-*-rtems*): Add rs6000/t-savresfgpr to
diff --git a/libgcc/config.host b/libgcc/config.host
index 81f7a36f158..f391334ed6a 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -696,6 +696,7 @@ m32r-*-elf*)
;;
m32r-*-rtems*)
tmake_file="$tmake_file m32r/t-m32r t-fdpbit"
+ extra_parts="$extra_parts crtinit.o crtfini.o"
;;
m32rle-*-elf*)
tmake_file=t-fdpbit
@@ -991,7 +992,10 @@ sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
sh-*-rtems*)
tmake_file="$tmake_file sh/t-sh t-crtstuff-pic t-fdpbit"
extra_parts="$extra_parts crt1.o crti.o crtn.o crtbeginS.o crtendS.o \
- $sh_ic_extra_parts $sh_opt_extra_parts"
+ libic_invalidate_array_4-100.a \
+ libic_invalidate_array_4-200.a \
+ libic_invalidate_array_4a.a \
+ libgcc-Os-4-200.a libgcc-4-300.a"
;;
sh-wrs-vxworks)
tmake_file="$tmake_file sh/t-sh t-crtstuff-pic t-fdpbit"
@@ -1050,7 +1054,7 @@ sparc64-*-elf*)
extra_parts="$extra_parts crti.o crtn.o crtfastmath.o"
;;
sparc64-*-rtems*)
- tmake_file="$tmake_file sparc/t-elf t-crtfm"
+ tmake_file="$tmake_file t-crtfm"
extra_parts="$extra_parts crti.o crtn.o crtfastmath.o"
;;
sparc-wrs-vxworks)
diff --git a/libgcc/config/i386/crtfastmath.c b/libgcc/config/i386/crtfastmath.c
index 7abe500e981..e923d8f4669 100644
--- a/libgcc/config/i386/crtfastmath.c
+++ b/libgcc/config/i386/crtfastmath.c
@@ -91,36 +91,41 @@ set_fast_math (void)
return;
#endif /* __sun__ && __svr4__ */
- mxcsr = __builtin_ia32_stmxcsr () | MXCSR_FTZ;
-
if (edx & bit_FXSAVE)
{
/* Check if DAZ is available. */
struct
{
- unsigned short int cwd;
- unsigned short int swd;
- unsigned short int twd;
- unsigned short int fop;
- long int fip;
- long int fcs;
- long int foo;
- long int fos;
- long int mxcsr;
- long int mxcsr_mask;
- long int st_space[32];
- long int xmm_space[32];
- long int padding[56];
+ unsigned short cwd;
+ unsigned short swd;
+ unsigned short twd;
+ unsigned short fop;
+ unsigned int fip;
+ unsigned int fcs;
+ unsigned int foo;
+ unsigned int fos;
+ unsigned int mxcsr;
+ unsigned int mxcsr_mask;
+ unsigned int st_space[32];
+ unsigned int xmm_space[32];
+ unsigned int padding[56];
} __attribute__ ((aligned (16))) fxsave;
- __builtin_memset (&fxsave, 0, sizeof (fxsave));
+ /* This is necessary since some implementations of FXSAVE
+ do not modify reserved areas within the image. */
+ fxsave.mxcsr_mask = 0;
+
+ __builtin_ia32_fxsave (&fxsave);
- asm volatile ("fxsave %0" : "=m" (fxsave) : "m" (fxsave));
+ mxcsr = fxsave.mxcsr;
if (fxsave.mxcsr_mask & MXCSR_DAZ)
mxcsr |= MXCSR_DAZ;
}
+ else
+ mxcsr = __builtin_ia32_stmxcsr ();
+ mxcsr |= MXCSR_FTZ;
__builtin_ia32_ldmxcsr (mxcsr);
}
#else
diff --git a/libgcc/config/i386/t-crtfm b/libgcc/config/i386/t-crtfm
index 46ce70bbb21..b9da06bfd20 100644
--- a/libgcc/config/i386/t-crtfm
+++ b/libgcc/config/i386/t-crtfm
@@ -1,4 +1,4 @@
# This is an endfile, Use -minline-all-stringops to ensure
# that __builtin_memset doesn't refer to the lib function memset().
crtfastmath.o: $(srcdir)/config/i386/crtfastmath.c
- $(gcc_compile) -msse -minline-all-stringops -c $<
+ $(gcc_compile) -mfxsr -msse -c $<
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index d52648688f7..5e59dceb6e6 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,125 @@
+2012-10-28 Tobias Burnus <burnus@net-b.de>
+
+ * m4/bessel.m4: Remove useless statement.
+ * m4/ifunction.m4: Remove unreachable code.
+ * generated/bessel_r10.c: Regenerated.
+ * generated/bessel_r16.c: Regenerated.
+ * generated/bessel_r4.c: Regenerated.
+ * generated/bessel_r8.c: Regenerated.
+ * generated/iall_i1.c: Regenerated.
+ * generated/iall_i16.c: Regenerated.
+ * generated/iall_i2.c: Regenerated.
+ * generated/iall_i4.c: Regenerated.
+ * generated/iall_i8.c: Regenerated.
+ * generated/iany_i1.c: Regenerated.
+ * generated/iany_i16.c: Regenerated.
+ * generated/iany_i2.c: Regenerated.
+ * generated/iany_i4.c: Regenerated.
+ * generated/iany_i8.c: Regenerated.
+ * generated/iparity_i1.c: Regenerated.
+ * generated/iparity_i16.c: Regenerated.
+ * generated/iparity_i2.c: Regenerated.
+ * generated/iparity_i4.c: Regenerated.
+ * generated/iparity_i8.c: Regenerated.
+ * generated/maxloc1_16_i1.c: Regenerated.
+ * generated/maxloc1_16_i16.c: Regenerated.
+ * generated/maxloc1_16_i2.c: Regenerated.
+ * generated/maxloc1_16_i4.c: Regenerated.
+ * generated/maxloc1_16_i8.c: Regenerated.
+ * generated/maxloc1_16_r10.c: Regenerated.
+ * generated/maxloc1_16_r16.c: Regenerated.
+ * generated/maxloc1_16_r4.c: Regenerated.
+ * generated/maxloc1_16_r8.c: Regenerated.
+ * generated/maxloc1_4_i1.c: Regenerated.
+ * generated/maxloc1_4_i16.c: Regenerated.
+ * generated/maxloc1_4_i2.c: Regenerated.
+ * generated/maxloc1_4_i4.c: Regenerated.
+ * generated/maxloc1_4_i8.c: Regenerated.
+ * generated/maxloc1_4_r10.c: Regenerated.
+ * generated/maxloc1_4_r16.c: Regenerated.
+ * generated/maxloc1_4_r4.c: Regenerated.
+ * generated/maxloc1_4_r8.c: Regenerated.
+ * generated/maxloc1_8_i1.c: Regenerated.
+ * generated/maxloc1_8_i16.c: Regenerated.
+ * generated/maxloc1_8_i2.c: Regenerated.
+ * generated/maxloc1_8_i4.c: Regenerated.
+ * generated/maxloc1_8_i8.c: Regenerated.
+ * generated/maxloc1_8_r10.c: Regenerated.
+ * generated/maxloc1_8_r16.c: Regenerated.
+ * generated/maxloc1_8_r4.c: Regenerated.
+ * generated/maxloc1_8_r8.c: Regenerated.
+ * generated/maxval_i1.c: Regenerated.
+ * generated/maxval_i16.c: Regenerated.
+ * generated/maxval_i2.c: Regenerated.
+ * generated/maxval_i4.c: Regenerated.
+ * generated/maxval_i8.c: Regenerated.
+ * generated/maxval_r10.c: Regenerated.
+ * generated/maxval_r16.c: Regenerated.
+ * generated/maxval_r4.c: Regenerated.
+ * generated/maxval_r8.c: Regenerated.
+ * generated/minloc1_16_i1.c: Regenerated.
+ * generated/minloc1_16_i16.c: Regenerated.
+ * generated/minloc1_16_i2.c: Regenerated.
+ * generated/minloc1_16_i4.c: Regenerated.
+ * generated/minloc1_16_i8.c: Regenerated.
+ * generated/minloc1_16_r10.c: Regenerated.
+ * generated/minloc1_16_r16.c: Regenerated.
+ * generated/minloc1_16_r4.c: Regenerated.
+ * generated/minloc1_16_r8.c: Regenerated.
+ * generated/minloc1_4_i1.c: Regenerated.
+ * generated/minloc1_4_i16.c: Regenerated.
+ * generated/minloc1_4_i2.c: Regenerated.
+ * generated/minloc1_4_i4.c: Regenerated.
+ * generated/minloc1_4_i8.c: Regenerated.
+ * generated/minloc1_4_r10.c: Regenerated.
+ * generated/minloc1_4_r16.c: Regenerated.
+ * generated/minloc1_4_r4.c: Regenerated.
+ * generated/minloc1_4_r8.c: Regenerated.
+ * generated/minloc1_8_i1.c: Regenerated.
+ * generated/minloc1_8_i16.c: Regenerated.
+ * generated/minloc1_8_i2.c: Regenerated.
+ * generated/minloc1_8_i4.c: Regenerated.
+ * generated/minloc1_8_i8.c: Regenerated.
+ * generated/minloc1_8_r10.c: Regenerated.
+ * generated/minloc1_8_r16.c: Regenerated.
+ * generated/minloc1_8_r4.c: Regenerated.
+ * generated/minloc1_8_r8.c: Regenerated.
+ * generated/minval_i1.c: Regenerated.
+ * generated/minval_i16.c: Regenerated.
+ * generated/minval_i2.c: Regenerated.
+ * generated/minval_i4.c: Regenerated.
+ * generated/minval_i8.c: Regenerated.
+ * generated/minval_r10.c: Regenerated.
+ * generated/minval_r16.c: Regenerated.
+ * generated/minval_r4.c: Regenerated.
+ * generated/minval_r8.c: Regenerated.
+ * generated/product_c10.c: Regenerated.
+ * generated/product_c16.c: Regenerated.
+ * generated/product_c4.c: Regenerated.
+ * generated/product_c8.c: Regenerated.
+ * generated/product_i1.c: Regenerated.
+ * generated/product_i16.c: Regenerated.
+ * generated/product_i2.c: Regenerated.
+ * generated/product_i4.c: Regenerated.
+ * generated/product_i8.c: Regenerated.
+ * generated/product_r10.c: Regenerated.
+ * generated/product_r16.c: Regenerated.
+ * generated/product_r4.c: Regenerated.
+ * generated/product_r8.c: Regenerated.
+ * generated/sum_c10.c: Regenerated.
+ * generated/sum_c16.c: Regenerated.
+ * generated/sum_c4.c: Regenerated.
+ * generated/sum_c8.c: Regenerated.
+ * generated/sum_i1.c: Regenerated.
+ * generated/sum_i16.c: Regenerated.
+ * generated/sum_i2.c: Regenerated.
+ * generated/sum_i4.c: Regenerated.
+ * generated/sum_i8.c: Regenerated.
+ * generated/sum_r10.c: Regenerated.
+ * generated/sum_r16.c: Regenerated.
+ * generated/sum_r4.c: Regenerated.
+ * generated/sum_r8.c: Regenerated.
+
2012-10-10 Tobias Burnus <burnus@net-b.de>
PR fortran/54878
diff --git a/libgfortran/generated/bessel_r10.c b/libgfortran/generated/bessel_r10.c
index 6a3a139fdb7..cdfdac92b3f 100644
--- a/libgfortran/generated/bessel_r10.c
+++ b/libgfortran/generated/bessel_r10.c
@@ -148,7 +148,6 @@ bessel_yn_r10 (gfc_array_r10 * const restrict ret, int n1, int n2,
return;
}
- ret->base_addr = ret->base_addr;
last1 = MATHFUNC(yn) (n1, x);
ret->base_addr[0] = last1;
diff --git a/libgfortran/generated/bessel_r16.c b/libgfortran/generated/bessel_r16.c
index c1aa5e25570..65a7bfbebbd 100644
--- a/libgfortran/generated/bessel_r16.c
+++ b/libgfortran/generated/bessel_r16.c
@@ -152,7 +152,6 @@ bessel_yn_r16 (gfc_array_r16 * const restrict ret, int n1, int n2,
return;
}
- ret->base_addr = ret->base_addr;
last1 = MATHFUNC(yn) (n1, x);
ret->base_addr[0] = last1;
diff --git a/libgfortran/generated/bessel_r4.c b/libgfortran/generated/bessel_r4.c
index 0f7c4cc4233..7dc967ca7e2 100644
--- a/libgfortran/generated/bessel_r4.c
+++ b/libgfortran/generated/bessel_r4.c
@@ -148,7 +148,6 @@ bessel_yn_r4 (gfc_array_r4 * const restrict ret, int n1, int n2,
return;
}
- ret->base_addr = ret->base_addr;
last1 = MATHFUNC(yn) (n1, x);
ret->base_addr[0] = last1;
diff --git a/libgfortran/generated/bessel_r8.c b/libgfortran/generated/bessel_r8.c
index cc61300057a..031726d3ff7 100644
--- a/libgfortran/generated/bessel_r8.c
+++ b/libgfortran/generated/bessel_r8.c
@@ -148,7 +148,6 @@ bessel_yn_r8 (gfc_array_r8 * const restrict ret, int n1, int n2,
return;
}
- ret->base_addr = ret->base_addr;
last1 = MATHFUNC(yn) (n1, x);
ret->base_addr[0] = last1;
diff --git a/libgfortran/generated/iall_i1.c b/libgfortran/generated/iall_i1.c
index dbe0fa74d70..039cfda6045 100644
--- a/libgfortran/generated/iall_i1.c
+++ b/libgfortran/generated/iall_i1.c
@@ -323,18 +323,13 @@ miall_i1 (gfc_array_i1 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result &= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/iall_i16.c b/libgfortran/generated/iall_i16.c
index 02e61fdc4a6..e41493d69af 100644
--- a/libgfortran/generated/iall_i16.c
+++ b/libgfortran/generated/iall_i16.c
@@ -323,18 +323,13 @@ miall_i16 (gfc_array_i16 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result &= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/iall_i2.c b/libgfortran/generated/iall_i2.c
index e9c181c5309..7d8e9ee001f 100644
--- a/libgfortran/generated/iall_i2.c
+++ b/libgfortran/generated/iall_i2.c
@@ -323,18 +323,13 @@ miall_i2 (gfc_array_i2 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result &= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/iall_i4.c b/libgfortran/generated/iall_i4.c
index 8cd3b3e9acf..1ecc9661cb5 100644
--- a/libgfortran/generated/iall_i4.c
+++ b/libgfortran/generated/iall_i4.c
@@ -323,18 +323,13 @@ miall_i4 (gfc_array_i4 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result &= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/iall_i8.c b/libgfortran/generated/iall_i8.c
index 8e2bb1ad46d..87ba710d4f3 100644
--- a/libgfortran/generated/iall_i8.c
+++ b/libgfortran/generated/iall_i8.c
@@ -323,18 +323,13 @@ miall_i8 (gfc_array_i8 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result &= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/iany_i1.c b/libgfortran/generated/iany_i1.c
index 52b6f923fec..2c8b85fab31 100644
--- a/libgfortran/generated/iany_i1.c
+++ b/libgfortran/generated/iany_i1.c
@@ -323,18 +323,13 @@ miany_i1 (gfc_array_i1 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result |= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/iany_i16.c b/libgfortran/generated/iany_i16.c
index 9194aa57315..1ad55dd0a18 100644
--- a/libgfortran/generated/iany_i16.c
+++ b/libgfortran/generated/iany_i16.c
@@ -323,18 +323,13 @@ miany_i16 (gfc_array_i16 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result |= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/iany_i2.c b/libgfortran/generated/iany_i2.c
index dcad9910490..f9b3380afb8 100644
--- a/libgfortran/generated/iany_i2.c
+++ b/libgfortran/generated/iany_i2.c
@@ -323,18 +323,13 @@ miany_i2 (gfc_array_i2 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result |= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/iany_i4.c b/libgfortran/generated/iany_i4.c
index 46a5d83062e..12aa4f0c385 100644
--- a/libgfortran/generated/iany_i4.c
+++ b/libgfortran/generated/iany_i4.c
@@ -323,18 +323,13 @@ miany_i4 (gfc_array_i4 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result |= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/iany_i8.c b/libgfortran/generated/iany_i8.c
index f0a2e904dd9..ed5704f85c4 100644
--- a/libgfortran/generated/iany_i8.c
+++ b/libgfortran/generated/iany_i8.c
@@ -323,18 +323,13 @@ miany_i8 (gfc_array_i8 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result |= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/iparity_i1.c b/libgfortran/generated/iparity_i1.c
index 00eb4bcac9f..e7faa525212 100644
--- a/libgfortran/generated/iparity_i1.c
+++ b/libgfortran/generated/iparity_i1.c
@@ -323,18 +323,13 @@ miparity_i1 (gfc_array_i1 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result ^= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/iparity_i16.c b/libgfortran/generated/iparity_i16.c
index 6caad71db79..48b26d9b630 100644
--- a/libgfortran/generated/iparity_i16.c
+++ b/libgfortran/generated/iparity_i16.c
@@ -323,18 +323,13 @@ miparity_i16 (gfc_array_i16 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result ^= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/iparity_i2.c b/libgfortran/generated/iparity_i2.c
index c44f908035a..6711a2c1a0a 100644
--- a/libgfortran/generated/iparity_i2.c
+++ b/libgfortran/generated/iparity_i2.c
@@ -323,18 +323,13 @@ miparity_i2 (gfc_array_i2 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result ^= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/iparity_i4.c b/libgfortran/generated/iparity_i4.c
index a7f76c8268d..242f6c73d43 100644
--- a/libgfortran/generated/iparity_i4.c
+++ b/libgfortran/generated/iparity_i4.c
@@ -323,18 +323,13 @@ miparity_i4 (gfc_array_i4 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result ^= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/iparity_i8.c b/libgfortran/generated/iparity_i8.c
index e93389df0fe..aa15b9176fd 100644
--- a/libgfortran/generated/iparity_i8.c
+++ b/libgfortran/generated/iparity_i8.c
@@ -323,18 +323,13 @@ miparity_i8 (gfc_array_i8 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result ^= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_16_i1.c b/libgfortran/generated/maxloc1_16_i1.c
index e2eb8e0a7b0..bec651f3957 100644
--- a/libgfortran/generated/maxloc1_16_i1.c
+++ b/libgfortran/generated/maxloc1_16_i1.c
@@ -354,12 +354,8 @@ mmaxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_16)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_16_i16.c b/libgfortran/generated/maxloc1_16_i16.c
index 9b3563f9677..24d3de908c4 100644
--- a/libgfortran/generated/maxloc1_16_i16.c
+++ b/libgfortran/generated/maxloc1_16_i16.c
@@ -354,12 +354,8 @@ mmaxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_16)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_16_i2.c b/libgfortran/generated/maxloc1_16_i2.c
index 0278e99dc8b..4236ab46200 100644
--- a/libgfortran/generated/maxloc1_16_i2.c
+++ b/libgfortran/generated/maxloc1_16_i2.c
@@ -354,12 +354,8 @@ mmaxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_16)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_16_i4.c b/libgfortran/generated/maxloc1_16_i4.c
index 9751c2afec2..133690ee06d 100644
--- a/libgfortran/generated/maxloc1_16_i4.c
+++ b/libgfortran/generated/maxloc1_16_i4.c
@@ -354,12 +354,8 @@ mmaxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_16)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_16_i8.c b/libgfortran/generated/maxloc1_16_i8.c
index e9140e5f868..7922dfd3055 100644
--- a/libgfortran/generated/maxloc1_16_i8.c
+++ b/libgfortran/generated/maxloc1_16_i8.c
@@ -354,12 +354,8 @@ mmaxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_16)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_16_r10.c b/libgfortran/generated/maxloc1_16_r10.c
index f88d254b295..73ff493fd0b 100644
--- a/libgfortran/generated/maxloc1_16_r10.c
+++ b/libgfortran/generated/maxloc1_16_r10.c
@@ -354,12 +354,8 @@ mmaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_16)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_16_r16.c b/libgfortran/generated/maxloc1_16_r16.c
index b1188a2c795..952872a10d0 100644
--- a/libgfortran/generated/maxloc1_16_r16.c
+++ b/libgfortran/generated/maxloc1_16_r16.c
@@ -354,12 +354,8 @@ mmaxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_16)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_16_r4.c b/libgfortran/generated/maxloc1_16_r4.c
index 70611027985..32c704a8be6 100644
--- a/libgfortran/generated/maxloc1_16_r4.c
+++ b/libgfortran/generated/maxloc1_16_r4.c
@@ -354,12 +354,8 @@ mmaxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_16)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_16_r8.c b/libgfortran/generated/maxloc1_16_r8.c
index 5d4d9c27c9f..714591ee6b3 100644
--- a/libgfortran/generated/maxloc1_16_r8.c
+++ b/libgfortran/generated/maxloc1_16_r8.c
@@ -354,12 +354,8 @@ mmaxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_16)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_4_i1.c b/libgfortran/generated/maxloc1_4_i1.c
index 0ee6ed54898..9e8e8f0c1b5 100644
--- a/libgfortran/generated/maxloc1_4_i1.c
+++ b/libgfortran/generated/maxloc1_4_i1.c
@@ -354,12 +354,8 @@ mmaxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_4)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_4_i16.c b/libgfortran/generated/maxloc1_4_i16.c
index c79f0ca0717..8987a552bcd 100644
--- a/libgfortran/generated/maxloc1_4_i16.c
+++ b/libgfortran/generated/maxloc1_4_i16.c
@@ -354,12 +354,8 @@ mmaxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_4)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_4_i2.c b/libgfortran/generated/maxloc1_4_i2.c
index 4eff28acb14..42c51c9149b 100644
--- a/libgfortran/generated/maxloc1_4_i2.c
+++ b/libgfortran/generated/maxloc1_4_i2.c
@@ -354,12 +354,8 @@ mmaxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_4)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_4_i4.c b/libgfortran/generated/maxloc1_4_i4.c
index 7c8f5e6e534..49183407c97 100644
--- a/libgfortran/generated/maxloc1_4_i4.c
+++ b/libgfortran/generated/maxloc1_4_i4.c
@@ -354,12 +354,8 @@ mmaxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_4)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_4_i8.c b/libgfortran/generated/maxloc1_4_i8.c
index ae63e1b1b38..47b204dc27a 100644
--- a/libgfortran/generated/maxloc1_4_i8.c
+++ b/libgfortran/generated/maxloc1_4_i8.c
@@ -354,12 +354,8 @@ mmaxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_4)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_4_r10.c b/libgfortran/generated/maxloc1_4_r10.c
index afd935b39ab..82de89ca9e3 100644
--- a/libgfortran/generated/maxloc1_4_r10.c
+++ b/libgfortran/generated/maxloc1_4_r10.c
@@ -354,12 +354,8 @@ mmaxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_4)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_4_r16.c b/libgfortran/generated/maxloc1_4_r16.c
index fdd48172234..4a4c54fd999 100644
--- a/libgfortran/generated/maxloc1_4_r16.c
+++ b/libgfortran/generated/maxloc1_4_r16.c
@@ -354,12 +354,8 @@ mmaxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_4)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_4_r4.c b/libgfortran/generated/maxloc1_4_r4.c
index 8360dfcdbca..5b1bf25689b 100644
--- a/libgfortran/generated/maxloc1_4_r4.c
+++ b/libgfortran/generated/maxloc1_4_r4.c
@@ -354,12 +354,8 @@ mmaxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_4)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_4_r8.c b/libgfortran/generated/maxloc1_4_r8.c
index 96f36511dc0..eafacb35d3c 100644
--- a/libgfortran/generated/maxloc1_4_r8.c
+++ b/libgfortran/generated/maxloc1_4_r8.c
@@ -354,12 +354,8 @@ mmaxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_4)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_8_i1.c b/libgfortran/generated/maxloc1_8_i1.c
index a5911718942..1483c7e8a66 100644
--- a/libgfortran/generated/maxloc1_8_i1.c
+++ b/libgfortran/generated/maxloc1_8_i1.c
@@ -354,12 +354,8 @@ mmaxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_8)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_8_i16.c b/libgfortran/generated/maxloc1_8_i16.c
index 30b946ae36b..22806ba5eb9 100644
--- a/libgfortran/generated/maxloc1_8_i16.c
+++ b/libgfortran/generated/maxloc1_8_i16.c
@@ -354,12 +354,8 @@ mmaxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_8)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_8_i2.c b/libgfortran/generated/maxloc1_8_i2.c
index af32584ccf8..04eadbf5b2c 100644
--- a/libgfortran/generated/maxloc1_8_i2.c
+++ b/libgfortran/generated/maxloc1_8_i2.c
@@ -354,12 +354,8 @@ mmaxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_8)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_8_i4.c b/libgfortran/generated/maxloc1_8_i4.c
index dc63f1e71a2..f6866614109 100644
--- a/libgfortran/generated/maxloc1_8_i4.c
+++ b/libgfortran/generated/maxloc1_8_i4.c
@@ -354,12 +354,8 @@ mmaxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_8)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_8_i8.c b/libgfortran/generated/maxloc1_8_i8.c
index c50965edae4..714d3a7cb40 100644
--- a/libgfortran/generated/maxloc1_8_i8.c
+++ b/libgfortran/generated/maxloc1_8_i8.c
@@ -354,12 +354,8 @@ mmaxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_8)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_8_r10.c b/libgfortran/generated/maxloc1_8_r10.c
index c088686b564..0a07af582b6 100644
--- a/libgfortran/generated/maxloc1_8_r10.c
+++ b/libgfortran/generated/maxloc1_8_r10.c
@@ -354,12 +354,8 @@ mmaxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_8)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_8_r16.c b/libgfortran/generated/maxloc1_8_r16.c
index 35f68071ca3..8da4dd46936 100644
--- a/libgfortran/generated/maxloc1_8_r16.c
+++ b/libgfortran/generated/maxloc1_8_r16.c
@@ -354,12 +354,8 @@ mmaxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_8)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_8_r4.c b/libgfortran/generated/maxloc1_8_r4.c
index 5d84bd077e0..5c71e4242c5 100644
--- a/libgfortran/generated/maxloc1_8_r4.c
+++ b/libgfortran/generated/maxloc1_8_r4.c
@@ -354,12 +354,8 @@ mmaxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_8)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxloc1_8_r8.c b/libgfortran/generated/maxloc1_8_r8.c
index e1e80d3298d..3bdcdabba59 100644
--- a/libgfortran/generated/maxloc1_8_r8.c
+++ b/libgfortran/generated/maxloc1_8_r8.c
@@ -354,12 +354,8 @@ mmaxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mmaxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
maxval = *src;
result = (GFC_INTEGER_8)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxval_i1.c b/libgfortran/generated/maxval_i1.c
index a94eecae000..6e77368cc4f 100644
--- a/libgfortran/generated/maxval_i1.c
+++ b/libgfortran/generated/maxval_i1.c
@@ -344,12 +344,8 @@ mmaxval_i1 (gfc_array_i1 * const restrict retarray,
#if defined (GFC_INTEGER_1_QUIET_NAN)
int non_empty_p = 0;
#endif
- if (len <= 0)
- *dest = (-GFC_INTEGER_1_HUGE-1);
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
#if defined (GFC_INTEGER_1_INFINITY) || defined (GFC_INTEGER_1_QUIET_NAN)
if (*msrc)
@@ -374,9 +370,8 @@ mmaxval_i1 (gfc_array_i1 * const restrict retarray,
#endif
if (*msrc && *src > result)
result = *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxval_i16.c b/libgfortran/generated/maxval_i16.c
index 94059cb1a02..e1cafc2adc8 100644
--- a/libgfortran/generated/maxval_i16.c
+++ b/libgfortran/generated/maxval_i16.c
@@ -344,12 +344,8 @@ mmaxval_i16 (gfc_array_i16 * const restrict retarray,
#if defined (GFC_INTEGER_16_QUIET_NAN)
int non_empty_p = 0;
#endif
- if (len <= 0)
- *dest = (-GFC_INTEGER_16_HUGE-1);
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
#if defined (GFC_INTEGER_16_INFINITY) || defined (GFC_INTEGER_16_QUIET_NAN)
if (*msrc)
@@ -374,9 +370,8 @@ mmaxval_i16 (gfc_array_i16 * const restrict retarray,
#endif
if (*msrc && *src > result)
result = *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxval_i2.c b/libgfortran/generated/maxval_i2.c
index eb3d767e31a..959ad434261 100644
--- a/libgfortran/generated/maxval_i2.c
+++ b/libgfortran/generated/maxval_i2.c
@@ -344,12 +344,8 @@ mmaxval_i2 (gfc_array_i2 * const restrict retarray,
#if defined (GFC_INTEGER_2_QUIET_NAN)
int non_empty_p = 0;
#endif
- if (len <= 0)
- *dest = (-GFC_INTEGER_2_HUGE-1);
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
#if defined (GFC_INTEGER_2_INFINITY) || defined (GFC_INTEGER_2_QUIET_NAN)
if (*msrc)
@@ -374,9 +370,8 @@ mmaxval_i2 (gfc_array_i2 * const restrict retarray,
#endif
if (*msrc && *src > result)
result = *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxval_i4.c b/libgfortran/generated/maxval_i4.c
index ef9e6c91826..698653b65bb 100644
--- a/libgfortran/generated/maxval_i4.c
+++ b/libgfortran/generated/maxval_i4.c
@@ -344,12 +344,8 @@ mmaxval_i4 (gfc_array_i4 * const restrict retarray,
#if defined (GFC_INTEGER_4_QUIET_NAN)
int non_empty_p = 0;
#endif
- if (len <= 0)
- *dest = (-GFC_INTEGER_4_HUGE-1);
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
#if defined (GFC_INTEGER_4_INFINITY) || defined (GFC_INTEGER_4_QUIET_NAN)
if (*msrc)
@@ -374,9 +370,8 @@ mmaxval_i4 (gfc_array_i4 * const restrict retarray,
#endif
if (*msrc && *src > result)
result = *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxval_i8.c b/libgfortran/generated/maxval_i8.c
index a6cd6829a3f..9b4a0330177 100644
--- a/libgfortran/generated/maxval_i8.c
+++ b/libgfortran/generated/maxval_i8.c
@@ -344,12 +344,8 @@ mmaxval_i8 (gfc_array_i8 * const restrict retarray,
#if defined (GFC_INTEGER_8_QUIET_NAN)
int non_empty_p = 0;
#endif
- if (len <= 0)
- *dest = (-GFC_INTEGER_8_HUGE-1);
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
#if defined (GFC_INTEGER_8_INFINITY) || defined (GFC_INTEGER_8_QUIET_NAN)
if (*msrc)
@@ -374,9 +370,8 @@ mmaxval_i8 (gfc_array_i8 * const restrict retarray,
#endif
if (*msrc && *src > result)
result = *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxval_r10.c b/libgfortran/generated/maxval_r10.c
index 1be75f1fe2f..434096d8d44 100644
--- a/libgfortran/generated/maxval_r10.c
+++ b/libgfortran/generated/maxval_r10.c
@@ -344,12 +344,8 @@ mmaxval_r10 (gfc_array_r10 * const restrict retarray,
#if defined (GFC_REAL_10_QUIET_NAN)
int non_empty_p = 0;
#endif
- if (len <= 0)
- *dest = -GFC_REAL_10_HUGE;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
#if defined (GFC_REAL_10_INFINITY) || defined (GFC_REAL_10_QUIET_NAN)
if (*msrc)
@@ -374,9 +370,8 @@ mmaxval_r10 (gfc_array_r10 * const restrict retarray,
#endif
if (*msrc && *src > result)
result = *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxval_r16.c b/libgfortran/generated/maxval_r16.c
index 059896daf6b..0246e926744 100644
--- a/libgfortran/generated/maxval_r16.c
+++ b/libgfortran/generated/maxval_r16.c
@@ -344,12 +344,8 @@ mmaxval_r16 (gfc_array_r16 * const restrict retarray,
#if defined (GFC_REAL_16_QUIET_NAN)
int non_empty_p = 0;
#endif
- if (len <= 0)
- *dest = -GFC_REAL_16_HUGE;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
#if defined (GFC_REAL_16_INFINITY) || defined (GFC_REAL_16_QUIET_NAN)
if (*msrc)
@@ -374,9 +370,8 @@ mmaxval_r16 (gfc_array_r16 * const restrict retarray,
#endif
if (*msrc && *src > result)
result = *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxval_r4.c b/libgfortran/generated/maxval_r4.c
index f306f181f52..d3e0c30a1d5 100644
--- a/libgfortran/generated/maxval_r4.c
+++ b/libgfortran/generated/maxval_r4.c
@@ -344,12 +344,8 @@ mmaxval_r4 (gfc_array_r4 * const restrict retarray,
#if defined (GFC_REAL_4_QUIET_NAN)
int non_empty_p = 0;
#endif
- if (len <= 0)
- *dest = -GFC_REAL_4_HUGE;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
#if defined (GFC_REAL_4_INFINITY) || defined (GFC_REAL_4_QUIET_NAN)
if (*msrc)
@@ -374,9 +370,8 @@ mmaxval_r4 (gfc_array_r4 * const restrict retarray,
#endif
if (*msrc && *src > result)
result = *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/maxval_r8.c b/libgfortran/generated/maxval_r8.c
index ca70ca5a9e5..b849baf5a82 100644
--- a/libgfortran/generated/maxval_r8.c
+++ b/libgfortran/generated/maxval_r8.c
@@ -344,12 +344,8 @@ mmaxval_r8 (gfc_array_r8 * const restrict retarray,
#if defined (GFC_REAL_8_QUIET_NAN)
int non_empty_p = 0;
#endif
- if (len <= 0)
- *dest = -GFC_REAL_8_HUGE;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
#if defined (GFC_REAL_8_INFINITY) || defined (GFC_REAL_8_QUIET_NAN)
if (*msrc)
@@ -374,9 +370,8 @@ mmaxval_r8 (gfc_array_r8 * const restrict retarray,
#endif
if (*msrc && *src > result)
result = *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_16_i1.c b/libgfortran/generated/minloc1_16_i1.c
index 949fa434c1e..a019c28f84b 100644
--- a/libgfortran/generated/minloc1_16_i1.c
+++ b/libgfortran/generated/minloc1_16_i1.c
@@ -354,12 +354,8 @@ mminloc1_16_i1 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_16_i1 (gfc_array_i16 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_16)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_16_i16.c b/libgfortran/generated/minloc1_16_i16.c
index b5a16818365..54b250f34d4 100644
--- a/libgfortran/generated/minloc1_16_i16.c
+++ b/libgfortran/generated/minloc1_16_i16.c
@@ -354,12 +354,8 @@ mminloc1_16_i16 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_16_i16 (gfc_array_i16 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_16)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_16_i2.c b/libgfortran/generated/minloc1_16_i2.c
index 887907995d7..ef86efb1b43 100644
--- a/libgfortran/generated/minloc1_16_i2.c
+++ b/libgfortran/generated/minloc1_16_i2.c
@@ -354,12 +354,8 @@ mminloc1_16_i2 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_16_i2 (gfc_array_i16 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_16)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_16_i4.c b/libgfortran/generated/minloc1_16_i4.c
index 6a5553fd405..099b79da333 100644
--- a/libgfortran/generated/minloc1_16_i4.c
+++ b/libgfortran/generated/minloc1_16_i4.c
@@ -354,12 +354,8 @@ mminloc1_16_i4 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_16_i4 (gfc_array_i16 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_16)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_16_i8.c b/libgfortran/generated/minloc1_16_i8.c
index 04be9c60b95..db625d28957 100644
--- a/libgfortran/generated/minloc1_16_i8.c
+++ b/libgfortran/generated/minloc1_16_i8.c
@@ -354,12 +354,8 @@ mminloc1_16_i8 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_16_i8 (gfc_array_i16 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_16)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_16_r10.c b/libgfortran/generated/minloc1_16_r10.c
index a66feda39d5..44f1679390a 100644
--- a/libgfortran/generated/minloc1_16_r10.c
+++ b/libgfortran/generated/minloc1_16_r10.c
@@ -354,12 +354,8 @@ mminloc1_16_r10 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_16_r10 (gfc_array_i16 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_16)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_16_r16.c b/libgfortran/generated/minloc1_16_r16.c
index 2e75ecf46d2..f62311ecb83 100644
--- a/libgfortran/generated/minloc1_16_r16.c
+++ b/libgfortran/generated/minloc1_16_r16.c
@@ -354,12 +354,8 @@ mminloc1_16_r16 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_16_r16 (gfc_array_i16 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_16)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_16_r4.c b/libgfortran/generated/minloc1_16_r4.c
index b8e9337e8e2..4aa3bf82cb0 100644
--- a/libgfortran/generated/minloc1_16_r4.c
+++ b/libgfortran/generated/minloc1_16_r4.c
@@ -354,12 +354,8 @@ mminloc1_16_r4 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_16_r4 (gfc_array_i16 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_16)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_16_r8.c b/libgfortran/generated/minloc1_16_r8.c
index 42519eb3380..ee07deefa5d 100644
--- a/libgfortran/generated/minloc1_16_r8.c
+++ b/libgfortran/generated/minloc1_16_r8.c
@@ -354,12 +354,8 @@ mminloc1_16_r8 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_16_r8 (gfc_array_i16 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_16)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_4_i1.c b/libgfortran/generated/minloc1_4_i1.c
index 07f0dceb55e..9d266787d5f 100644
--- a/libgfortran/generated/minloc1_4_i1.c
+++ b/libgfortran/generated/minloc1_4_i1.c
@@ -354,12 +354,8 @@ mminloc1_4_i1 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_4_i1 (gfc_array_i4 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_4)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_4_i16.c b/libgfortran/generated/minloc1_4_i16.c
index 0c2041115d5..2659a257ca9 100644
--- a/libgfortran/generated/minloc1_4_i16.c
+++ b/libgfortran/generated/minloc1_4_i16.c
@@ -354,12 +354,8 @@ mminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_4)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_4_i2.c b/libgfortran/generated/minloc1_4_i2.c
index 389b1dbddfd..27cb56af2d9 100644
--- a/libgfortran/generated/minloc1_4_i2.c
+++ b/libgfortran/generated/minloc1_4_i2.c
@@ -354,12 +354,8 @@ mminloc1_4_i2 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_4_i2 (gfc_array_i4 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_4)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_4_i4.c b/libgfortran/generated/minloc1_4_i4.c
index 5d66fe9afcb..67f90842bc5 100644
--- a/libgfortran/generated/minloc1_4_i4.c
+++ b/libgfortran/generated/minloc1_4_i4.c
@@ -354,12 +354,8 @@ mminloc1_4_i4 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_4_i4 (gfc_array_i4 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_4)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_4_i8.c b/libgfortran/generated/minloc1_4_i8.c
index 28cd536fa4a..a5a66ee90a1 100644
--- a/libgfortran/generated/minloc1_4_i8.c
+++ b/libgfortran/generated/minloc1_4_i8.c
@@ -354,12 +354,8 @@ mminloc1_4_i8 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_4_i8 (gfc_array_i4 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_4)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_4_r10.c b/libgfortran/generated/minloc1_4_r10.c
index 39196711e32..7351db066ed 100644
--- a/libgfortran/generated/minloc1_4_r10.c
+++ b/libgfortran/generated/minloc1_4_r10.c
@@ -354,12 +354,8 @@ mminloc1_4_r10 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_4_r10 (gfc_array_i4 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_4)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_4_r16.c b/libgfortran/generated/minloc1_4_r16.c
index f7966123128..2917650402d 100644
--- a/libgfortran/generated/minloc1_4_r16.c
+++ b/libgfortran/generated/minloc1_4_r16.c
@@ -354,12 +354,8 @@ mminloc1_4_r16 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_4_r16 (gfc_array_i4 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_4)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_4_r4.c b/libgfortran/generated/minloc1_4_r4.c
index 7f34b913813..d80c89a5189 100644
--- a/libgfortran/generated/minloc1_4_r4.c
+++ b/libgfortran/generated/minloc1_4_r4.c
@@ -354,12 +354,8 @@ mminloc1_4_r4 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_4_r4 (gfc_array_i4 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_4)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_4_r8.c b/libgfortran/generated/minloc1_4_r8.c
index 21bb4cbcc77..79dfbb3f756 100644
--- a/libgfortran/generated/minloc1_4_r8.c
+++ b/libgfortran/generated/minloc1_4_r8.c
@@ -354,12 +354,8 @@ mminloc1_4_r8 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_4_r8 (gfc_array_i4 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_4)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_8_i1.c b/libgfortran/generated/minloc1_8_i1.c
index 81d6f8e42e1..62e300b80eb 100644
--- a/libgfortran/generated/minloc1_8_i1.c
+++ b/libgfortran/generated/minloc1_8_i1.c
@@ -354,12 +354,8 @@ mminloc1_8_i1 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_8_i1 (gfc_array_i8 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_8)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_8_i16.c b/libgfortran/generated/minloc1_8_i16.c
index 0a41d170062..56682c7a2fb 100644
--- a/libgfortran/generated/minloc1_8_i16.c
+++ b/libgfortran/generated/minloc1_8_i16.c
@@ -354,12 +354,8 @@ mminloc1_8_i16 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_8_i16 (gfc_array_i8 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_8)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_8_i2.c b/libgfortran/generated/minloc1_8_i2.c
index b0dac3e0404..819da19a319 100644
--- a/libgfortran/generated/minloc1_8_i2.c
+++ b/libgfortran/generated/minloc1_8_i2.c
@@ -354,12 +354,8 @@ mminloc1_8_i2 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_8_i2 (gfc_array_i8 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_8)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_8_i4.c b/libgfortran/generated/minloc1_8_i4.c
index c8b42cac5e2..b59bc3339a3 100644
--- a/libgfortran/generated/minloc1_8_i4.c
+++ b/libgfortran/generated/minloc1_8_i4.c
@@ -354,12 +354,8 @@ mminloc1_8_i4 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_8_i4 (gfc_array_i8 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_8)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_8_i8.c b/libgfortran/generated/minloc1_8_i8.c
index 186fe5ceacf..5caf88a1049 100644
--- a/libgfortran/generated/minloc1_8_i8.c
+++ b/libgfortran/generated/minloc1_8_i8.c
@@ -354,12 +354,8 @@ mminloc1_8_i8 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_8_i8 (gfc_array_i8 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_8)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_8_r10.c b/libgfortran/generated/minloc1_8_r10.c
index 582f88e1034..068efbb4e67 100644
--- a/libgfortran/generated/minloc1_8_r10.c
+++ b/libgfortran/generated/minloc1_8_r10.c
@@ -354,12 +354,8 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_8)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_8_r16.c b/libgfortran/generated/minloc1_8_r16.c
index 0471c2750fb..09a3bed09f8 100644
--- a/libgfortran/generated/minloc1_8_r16.c
+++ b/libgfortran/generated/minloc1_8_r16.c
@@ -354,12 +354,8 @@ mminloc1_8_r16 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_8_r16 (gfc_array_i8 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_8)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_8_r4.c b/libgfortran/generated/minloc1_8_r4.c
index b144115c0bc..41b5b722781 100644
--- a/libgfortran/generated/minloc1_8_r4.c
+++ b/libgfortran/generated/minloc1_8_r4.c
@@ -354,12 +354,8 @@ mminloc1_8_r4 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_8_r4 (gfc_array_i8 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_8)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minloc1_8_r8.c b/libgfortran/generated/minloc1_8_r8.c
index 81916e2890a..4eb97b4f622 100644
--- a/libgfortran/generated/minloc1_8_r8.c
+++ b/libgfortran/generated/minloc1_8_r8.c
@@ -354,12 +354,8 @@ mminloc1_8_r8 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 result2 = 0;
#endif
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
{
@@ -387,9 +383,8 @@ mminloc1_8_r8 (gfc_array_i8 * const restrict retarray,
minval = *src;
result = (GFC_INTEGER_8)n + 1;
}
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minval_i1.c b/libgfortran/generated/minval_i1.c
index e2abc9587f0..461236e8992 100644
--- a/libgfortran/generated/minval_i1.c
+++ b/libgfortran/generated/minval_i1.c
@@ -344,12 +344,8 @@ mminval_i1 (gfc_array_i1 * const restrict retarray,
#if defined (GFC_INTEGER_1_QUIET_NAN)
int non_empty_p = 0;
#endif
- if (len <= 0)
- *dest = GFC_INTEGER_1_HUGE;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
#if defined (GFC_INTEGER_1_INFINITY) || defined (GFC_INTEGER_1_QUIET_NAN)
if (*msrc)
@@ -374,9 +370,8 @@ mminval_i1 (gfc_array_i1 * const restrict retarray,
#endif
if (*msrc && *src < result)
result = *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minval_i16.c b/libgfortran/generated/minval_i16.c
index f2c72e3e9de..f32316d8970 100644
--- a/libgfortran/generated/minval_i16.c
+++ b/libgfortran/generated/minval_i16.c
@@ -344,12 +344,8 @@ mminval_i16 (gfc_array_i16 * const restrict retarray,
#if defined (GFC_INTEGER_16_QUIET_NAN)
int non_empty_p = 0;
#endif
- if (len <= 0)
- *dest = GFC_INTEGER_16_HUGE;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
#if defined (GFC_INTEGER_16_INFINITY) || defined (GFC_INTEGER_16_QUIET_NAN)
if (*msrc)
@@ -374,9 +370,8 @@ mminval_i16 (gfc_array_i16 * const restrict retarray,
#endif
if (*msrc && *src < result)
result = *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minval_i2.c b/libgfortran/generated/minval_i2.c
index b87a0722744..dd7bc2159fb 100644
--- a/libgfortran/generated/minval_i2.c
+++ b/libgfortran/generated/minval_i2.c
@@ -344,12 +344,8 @@ mminval_i2 (gfc_array_i2 * const restrict retarray,
#if defined (GFC_INTEGER_2_QUIET_NAN)
int non_empty_p = 0;
#endif
- if (len <= 0)
- *dest = GFC_INTEGER_2_HUGE;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
#if defined (GFC_INTEGER_2_INFINITY) || defined (GFC_INTEGER_2_QUIET_NAN)
if (*msrc)
@@ -374,9 +370,8 @@ mminval_i2 (gfc_array_i2 * const restrict retarray,
#endif
if (*msrc && *src < result)
result = *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minval_i4.c b/libgfortran/generated/minval_i4.c
index 20766fa62b1..33e9016e502 100644
--- a/libgfortran/generated/minval_i4.c
+++ b/libgfortran/generated/minval_i4.c
@@ -344,12 +344,8 @@ mminval_i4 (gfc_array_i4 * const restrict retarray,
#if defined (GFC_INTEGER_4_QUIET_NAN)
int non_empty_p = 0;
#endif
- if (len <= 0)
- *dest = GFC_INTEGER_4_HUGE;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
#if defined (GFC_INTEGER_4_INFINITY) || defined (GFC_INTEGER_4_QUIET_NAN)
if (*msrc)
@@ -374,9 +370,8 @@ mminval_i4 (gfc_array_i4 * const restrict retarray,
#endif
if (*msrc && *src < result)
result = *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minval_i8.c b/libgfortran/generated/minval_i8.c
index 73e3d9bba8f..165600cc1e6 100644
--- a/libgfortran/generated/minval_i8.c
+++ b/libgfortran/generated/minval_i8.c
@@ -344,12 +344,8 @@ mminval_i8 (gfc_array_i8 * const restrict retarray,
#if defined (GFC_INTEGER_8_QUIET_NAN)
int non_empty_p = 0;
#endif
- if (len <= 0)
- *dest = GFC_INTEGER_8_HUGE;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
#if defined (GFC_INTEGER_8_INFINITY) || defined (GFC_INTEGER_8_QUIET_NAN)
if (*msrc)
@@ -374,9 +370,8 @@ mminval_i8 (gfc_array_i8 * const restrict retarray,
#endif
if (*msrc && *src < result)
result = *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minval_r10.c b/libgfortran/generated/minval_r10.c
index 72134fe7013..9c77f085d0b 100644
--- a/libgfortran/generated/minval_r10.c
+++ b/libgfortran/generated/minval_r10.c
@@ -344,12 +344,8 @@ mminval_r10 (gfc_array_r10 * const restrict retarray,
#if defined (GFC_REAL_10_QUIET_NAN)
int non_empty_p = 0;
#endif
- if (len <= 0)
- *dest = GFC_REAL_10_HUGE;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
#if defined (GFC_REAL_10_INFINITY) || defined (GFC_REAL_10_QUIET_NAN)
if (*msrc)
@@ -374,9 +370,8 @@ mminval_r10 (gfc_array_r10 * const restrict retarray,
#endif
if (*msrc && *src < result)
result = *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minval_r16.c b/libgfortran/generated/minval_r16.c
index 47c703ccc85..dcfeab19942 100644
--- a/libgfortran/generated/minval_r16.c
+++ b/libgfortran/generated/minval_r16.c
@@ -344,12 +344,8 @@ mminval_r16 (gfc_array_r16 * const restrict retarray,
#if defined (GFC_REAL_16_QUIET_NAN)
int non_empty_p = 0;
#endif
- if (len <= 0)
- *dest = GFC_REAL_16_HUGE;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
#if defined (GFC_REAL_16_INFINITY) || defined (GFC_REAL_16_QUIET_NAN)
if (*msrc)
@@ -374,9 +370,8 @@ mminval_r16 (gfc_array_r16 * const restrict retarray,
#endif
if (*msrc && *src < result)
result = *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minval_r4.c b/libgfortran/generated/minval_r4.c
index 58c8854a537..014471a87cd 100644
--- a/libgfortran/generated/minval_r4.c
+++ b/libgfortran/generated/minval_r4.c
@@ -344,12 +344,8 @@ mminval_r4 (gfc_array_r4 * const restrict retarray,
#if defined (GFC_REAL_4_QUIET_NAN)
int non_empty_p = 0;
#endif
- if (len <= 0)
- *dest = GFC_REAL_4_HUGE;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
#if defined (GFC_REAL_4_INFINITY) || defined (GFC_REAL_4_QUIET_NAN)
if (*msrc)
@@ -374,9 +370,8 @@ mminval_r4 (gfc_array_r4 * const restrict retarray,
#endif
if (*msrc && *src < result)
result = *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/minval_r8.c b/libgfortran/generated/minval_r8.c
index c8426bd905a..5a93248eafc 100644
--- a/libgfortran/generated/minval_r8.c
+++ b/libgfortran/generated/minval_r8.c
@@ -344,12 +344,8 @@ mminval_r8 (gfc_array_r8 * const restrict retarray,
#if defined (GFC_REAL_8_QUIET_NAN)
int non_empty_p = 0;
#endif
- if (len <= 0)
- *dest = GFC_REAL_8_HUGE;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
#if defined (GFC_REAL_8_INFINITY) || defined (GFC_REAL_8_QUIET_NAN)
if (*msrc)
@@ -374,9 +370,8 @@ mminval_r8 (gfc_array_r8 * const restrict retarray,
#endif
if (*msrc && *src < result)
result = *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/product_c10.c b/libgfortran/generated/product_c10.c
index 379f3892be6..ede6ce8a704 100644
--- a/libgfortran/generated/product_c10.c
+++ b/libgfortran/generated/product_c10.c
@@ -323,18 +323,13 @@ mproduct_c10 (gfc_array_c10 * const restrict retarray,
{
result = 1;
- if (len <= 0)
- *dest = 1;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result *= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/product_c16.c b/libgfortran/generated/product_c16.c
index 2e91c5e9cdd..f6ebf43f5ea 100644
--- a/libgfortran/generated/product_c16.c
+++ b/libgfortran/generated/product_c16.c
@@ -323,18 +323,13 @@ mproduct_c16 (gfc_array_c16 * const restrict retarray,
{
result = 1;
- if (len <= 0)
- *dest = 1;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result *= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/product_c4.c b/libgfortran/generated/product_c4.c
index c1a9534cb41..4bf17c3670b 100644
--- a/libgfortran/generated/product_c4.c
+++ b/libgfortran/generated/product_c4.c
@@ -323,18 +323,13 @@ mproduct_c4 (gfc_array_c4 * const restrict retarray,
{
result = 1;
- if (len <= 0)
- *dest = 1;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result *= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/product_c8.c b/libgfortran/generated/product_c8.c
index 80a6ac62789..0fe8ff194c6 100644
--- a/libgfortran/generated/product_c8.c
+++ b/libgfortran/generated/product_c8.c
@@ -323,18 +323,13 @@ mproduct_c8 (gfc_array_c8 * const restrict retarray,
{
result = 1;
- if (len <= 0)
- *dest = 1;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result *= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/product_i1.c b/libgfortran/generated/product_i1.c
index ff8e76a7b07..9ea168741aa 100644
--- a/libgfortran/generated/product_i1.c
+++ b/libgfortran/generated/product_i1.c
@@ -323,18 +323,13 @@ mproduct_i1 (gfc_array_i1 * const restrict retarray,
{
result = 1;
- if (len <= 0)
- *dest = 1;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result *= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/product_i16.c b/libgfortran/generated/product_i16.c
index 652e766b508..62be1e47cdb 100644
--- a/libgfortran/generated/product_i16.c
+++ b/libgfortran/generated/product_i16.c
@@ -323,18 +323,13 @@ mproduct_i16 (gfc_array_i16 * const restrict retarray,
{
result = 1;
- if (len <= 0)
- *dest = 1;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result *= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/product_i2.c b/libgfortran/generated/product_i2.c
index 1063d6acf98..1785cbdb580 100644
--- a/libgfortran/generated/product_i2.c
+++ b/libgfortran/generated/product_i2.c
@@ -323,18 +323,13 @@ mproduct_i2 (gfc_array_i2 * const restrict retarray,
{
result = 1;
- if (len <= 0)
- *dest = 1;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result *= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/product_i4.c b/libgfortran/generated/product_i4.c
index 97eab9e4766..9c52a12b096 100644
--- a/libgfortran/generated/product_i4.c
+++ b/libgfortran/generated/product_i4.c
@@ -323,18 +323,13 @@ mproduct_i4 (gfc_array_i4 * const restrict retarray,
{
result = 1;
- if (len <= 0)
- *dest = 1;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result *= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/product_i8.c b/libgfortran/generated/product_i8.c
index 89454971dd8..81840207a03 100644
--- a/libgfortran/generated/product_i8.c
+++ b/libgfortran/generated/product_i8.c
@@ -323,18 +323,13 @@ mproduct_i8 (gfc_array_i8 * const restrict retarray,
{
result = 1;
- if (len <= 0)
- *dest = 1;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result *= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/product_r10.c b/libgfortran/generated/product_r10.c
index 4259f7acb0c..324ce450bf3 100644
--- a/libgfortran/generated/product_r10.c
+++ b/libgfortran/generated/product_r10.c
@@ -323,18 +323,13 @@ mproduct_r10 (gfc_array_r10 * const restrict retarray,
{
result = 1;
- if (len <= 0)
- *dest = 1;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result *= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/product_r16.c b/libgfortran/generated/product_r16.c
index e4ec5b27268..16cbaa13aa3 100644
--- a/libgfortran/generated/product_r16.c
+++ b/libgfortran/generated/product_r16.c
@@ -323,18 +323,13 @@ mproduct_r16 (gfc_array_r16 * const restrict retarray,
{
result = 1;
- if (len <= 0)
- *dest = 1;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result *= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/product_r4.c b/libgfortran/generated/product_r4.c
index dc3fe513e90..38febae0171 100644
--- a/libgfortran/generated/product_r4.c
+++ b/libgfortran/generated/product_r4.c
@@ -323,18 +323,13 @@ mproduct_r4 (gfc_array_r4 * const restrict retarray,
{
result = 1;
- if (len <= 0)
- *dest = 1;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result *= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/product_r8.c b/libgfortran/generated/product_r8.c
index 5e03477710c..ee61b640801 100644
--- a/libgfortran/generated/product_r8.c
+++ b/libgfortran/generated/product_r8.c
@@ -323,18 +323,13 @@ mproduct_r8 (gfc_array_r8 * const restrict retarray,
{
result = 1;
- if (len <= 0)
- *dest = 1;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result *= *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/sum_c10.c b/libgfortran/generated/sum_c10.c
index 50567b3a270..cbe6de5a39a 100644
--- a/libgfortran/generated/sum_c10.c
+++ b/libgfortran/generated/sum_c10.c
@@ -323,18 +323,13 @@ msum_c10 (gfc_array_c10 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result += *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/sum_c16.c b/libgfortran/generated/sum_c16.c
index 285b4449e77..37a080e51ea 100644
--- a/libgfortran/generated/sum_c16.c
+++ b/libgfortran/generated/sum_c16.c
@@ -323,18 +323,13 @@ msum_c16 (gfc_array_c16 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result += *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/sum_c4.c b/libgfortran/generated/sum_c4.c
index bdaa1adc727..bc08e2cba79 100644
--- a/libgfortran/generated/sum_c4.c
+++ b/libgfortran/generated/sum_c4.c
@@ -323,18 +323,13 @@ msum_c4 (gfc_array_c4 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result += *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/sum_c8.c b/libgfortran/generated/sum_c8.c
index e7a4a45aa03..5f0f544036c 100644
--- a/libgfortran/generated/sum_c8.c
+++ b/libgfortran/generated/sum_c8.c
@@ -323,18 +323,13 @@ msum_c8 (gfc_array_c8 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result += *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/sum_i1.c b/libgfortran/generated/sum_i1.c
index 7b03bd05965..737dc2d231f 100644
--- a/libgfortran/generated/sum_i1.c
+++ b/libgfortran/generated/sum_i1.c
@@ -323,18 +323,13 @@ msum_i1 (gfc_array_i1 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result += *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/sum_i16.c b/libgfortran/generated/sum_i16.c
index 71bf01a209c..34f0dadc530 100644
--- a/libgfortran/generated/sum_i16.c
+++ b/libgfortran/generated/sum_i16.c
@@ -323,18 +323,13 @@ msum_i16 (gfc_array_i16 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result += *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/sum_i2.c b/libgfortran/generated/sum_i2.c
index 1d82782bef1..8c748994e69 100644
--- a/libgfortran/generated/sum_i2.c
+++ b/libgfortran/generated/sum_i2.c
@@ -323,18 +323,13 @@ msum_i2 (gfc_array_i2 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result += *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/sum_i4.c b/libgfortran/generated/sum_i4.c
index 3e29bfa498a..d9e1b378716 100644
--- a/libgfortran/generated/sum_i4.c
+++ b/libgfortran/generated/sum_i4.c
@@ -323,18 +323,13 @@ msum_i4 (gfc_array_i4 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result += *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/sum_i8.c b/libgfortran/generated/sum_i8.c
index 05767bc59c7..b0d38c68b04 100644
--- a/libgfortran/generated/sum_i8.c
+++ b/libgfortran/generated/sum_i8.c
@@ -323,18 +323,13 @@ msum_i8 (gfc_array_i8 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result += *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/sum_r10.c b/libgfortran/generated/sum_r10.c
index 16ff425a617..bd2574dadaa 100644
--- a/libgfortran/generated/sum_r10.c
+++ b/libgfortran/generated/sum_r10.c
@@ -323,18 +323,13 @@ msum_r10 (gfc_array_r10 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result += *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/sum_r16.c b/libgfortran/generated/sum_r16.c
index 3b2d8a60729..805e49e03d7 100644
--- a/libgfortran/generated/sum_r16.c
+++ b/libgfortran/generated/sum_r16.c
@@ -323,18 +323,13 @@ msum_r16 (gfc_array_r16 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result += *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/sum_r4.c b/libgfortran/generated/sum_r4.c
index 5136dae2c80..ec918c2587d 100644
--- a/libgfortran/generated/sum_r4.c
+++ b/libgfortran/generated/sum_r4.c
@@ -323,18 +323,13 @@ msum_r4 (gfc_array_r4 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result += *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/generated/sum_r8.c b/libgfortran/generated/sum_r8.c
index 8634637434d..3bf49fec4a5 100644
--- a/libgfortran/generated/sum_r8.c
+++ b/libgfortran/generated/sum_r8.c
@@ -323,18 +323,13 @@ msum_r8 (gfc_array_r8 * const restrict retarray,
{
result = 0;
- if (len <= 0)
- *dest = 0;
- else
+ for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
if (*msrc)
result += *src;
- }
- *dest = result;
}
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
diff --git a/libgfortran/m4/bessel.m4 b/libgfortran/m4/bessel.m4
index d5c602dbf4c..145ca0d59ac 100644
--- a/libgfortran/m4/bessel.m4
+++ b/libgfortran/m4/bessel.m4
@@ -149,7 +149,6 @@ bessel_yn_r'rtype_kind` ('rtype` * const restrict ret, int n1, int n2,
return;
}
- ret->base_addr = ret->base_addr;
last1 = MATHFUNC(yn) (n1, x);
ret->base_addr[0] = last1;
diff --git a/libgfortran/m4/ifunction.m4 b/libgfortran/m4/ifunction.m4
index 613fbf5dad5..1555aebbc4a 100644
--- a/libgfortran/m4/ifunction.m4
+++ b/libgfortran/m4/ifunction.m4
@@ -311,17 +311,12 @@ void
{
')dnl
define(START_MASKED_ARRAY_BLOCK,
-` if (len <= 0)
- *dest = '$1`;
- else
+` for (n = 0; n < len; n++, src += delta, msrc += mdelta)
{
- for (n = 0; n < len; n++, src += delta, msrc += mdelta)
- {
')dnl
define(FINISH_MASKED_ARRAY_FUNCTION,
-` }
- *dest = result;
- }
+` }
+ *dest = result;
}
/* Advance to the next element. */
count[0]++;
@@ -500,6 +495,6 @@ FINISH_ARRAY_FUNCTION($4)')dnl
define(MASKED_ARRAY_FUNCTION,
`START_MASKED_ARRAY_FUNCTION
$2
-START_MASKED_ARRAY_BLOCK($1)
+START_MASKED_ARRAY_BLOCK
$3
FINISH_MASKED_ARRAY_FUNCTION')dnl
diff --git a/libgo/Makefile.am b/libgo/Makefile.am
index ad9f254d7e6..f470c054860 100644
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -704,7 +704,7 @@ if LIBGO_IS_SOLARIS
go_net_cgo_file = go/net/cgo_linux.go
go_net_sock_file = go/net/sock_solaris.go
go_net_sockopt_file = go/net/sockopt_bsd.go
-go_net_sockoptip_file = go/net/sockoptip_bsd.go go/net/sockoptip_solaris.go
+go_net_sockoptip_file = go/net/sockoptip_bsd.go go/net/sockoptip_posix.go
else
if LIBGO_IS_FREEBSD
go_net_cgo_file = go/net/cgo_bsd.go
@@ -968,6 +968,9 @@ endif
if LIBGO_IS_OPENBSD
archive_tar_atim_file = go/archive/tar/stat_atim.go
endif
+if LIBGO_IS_SOLARIS
+archive_tar_atim_file = go/archive/tar/stat_atim.go
+endif
if LIBGO_IS_DARWIN
archive_tar_atim_file = go/archive/tar/stat_atimespec.go
endif
diff --git a/libgo/Makefile.in b/libgo/Makefile.in
index e5004fc671b..43581bb500b 100644
--- a/libgo/Makefile.in
+++ b/libgo/Makefile.in
@@ -1021,7 +1021,7 @@ go_mime_files = \
@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@go_net_sockoptip_file = go/net/sockoptip_bsd.go go/net/sockoptip_posix.go
@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_TRUE@@LIBGO_IS_SOLARIS_FALSE@go_net_sockoptip_file = go/net/sockoptip_bsd.go go/net/sockoptip_posix.go
@LIBGO_IS_FREEBSD_TRUE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_SOLARIS_FALSE@go_net_sockoptip_file = go/net/sockoptip_bsd.go go/net/sockoptip_posix.go
-@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_SOLARIS_TRUE@go_net_sockoptip_file = go/net/sockoptip_bsd.go go/net/sockoptip_solaris.go
+@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_SOLARIS_TRUE@go_net_sockoptip_file = go/net/sockoptip_bsd.go go/net/sockoptip_posix.go
@LIBGO_IS_IRIX_TRUE@@LIBGO_IS_LINUX_FALSE@go_net_sockoptip_file = go/net/sockoptip_linux.go go/net/sockoptip_posix.go
@LIBGO_IS_LINUX_TRUE@go_net_sockoptip_file = go/net/sockoptip_linux.go go/net/sockoptip_posix.go
@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_LINUX_FALSE@go_net_sendfile_file = go/net/sendfile_stub.go
@@ -1202,6 +1202,7 @@ go_unicode_files = \
@LIBGO_IS_LINUX_TRUE@archive_tar_atim_file = go/archive/tar/stat_atim.go
@LIBGO_IS_NETBSD_TRUE@archive_tar_atim_file = go/archive/tar/stat_atimespec.go
@LIBGO_IS_OPENBSD_TRUE@archive_tar_atim_file = go/archive/tar/stat_atim.go
+@LIBGO_IS_SOLARIS_TRUE@archive_tar_atim_file = go/archive/tar/stat_atim.go
go_archive_tar_files = \
go/archive/tar/common.go \
go/archive/tar/reader.go \
diff --git a/libgo/go/net/sockoptip_solaris.go b/libgo/go/net/sockoptip_solaris.go
deleted file mode 100644
index 538ef0d1179..00000000000
--- a/libgo/go/net/sockoptip_solaris.go
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// IP-level socket options for Solaris
-
-package net
-
-import (
- "os"
- "syscall"
-)
-
-func ipv4MulticastInterface(fd *netFD) (*Interface, error) {
- if err := fd.incref(false); err != nil {
- return nil, err
- }
- defer fd.decref()
- a, err := syscall.GetsockoptInet4Addr(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_IF)
- if err != nil {
- return nil, os.NewSyscallError("getsockopt", err)
- }
- return ipv4AddrToInterface(IPv4(a[0], a[1], a[2], a[3]))
-}
-
-func setIPv4MulticastInterface(fd *netFD, ifi *Interface) error {
- ip, err := interfaceToIPv4Addr(ifi)
- if err != nil {
- return os.NewSyscallError("setsockopt", err)
- }
- var x [4]byte
- copy(x[:], ip.To4())
- if err := fd.incref(false); err != nil {
- return err
- }
- defer fd.decref()
- err = syscall.SetsockoptInet4Addr(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_IF, x)
- if err != nil {
- return os.NewSyscallError("setsockopt", err)
- }
- return nil
-}
-
-func ipv4MulticastLoopback(fd *netFD) (bool, error) {
- if err := fd.incref(false); err != nil {
- return false, err
- }
- defer fd.decref()
- v, err := syscall.GetsockoptByte(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP)
- if err != nil {
- return false, os.NewSyscallError("getsockopt", err)
- }
- return v == 1, nil
-}
-
-func setIPv4MulticastLoopback(fd *netFD, v bool) error {
- if err := fd.incref(false); err != nil {
- return err
- }
- defer fd.decref()
- err := syscall.SetsockoptByte(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP, byte(boolint(v)))
- if err != nil {
- return os.NewSyscallError("setsockopt", err)
- }
- return nil
-}
-
-func ipv4ReceiveInterface(fd *netFD) (bool, error) {
- if err := fd.incref(false); err != nil {
- return false, err
- }
- defer fd.decref()
- v, err := syscall.GetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_RECVIF)
- if err != nil {
- return false, os.NewSyscallError("getsockopt", err)
- }
- return v == 1, nil
-}
-
-func setIPv4ReceiveInterface(fd *netFD, v bool) error {
- if err := fd.incref(false); err != nil {
- return err
- }
- defer fd.decref()
- err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_RECVIF, boolint(v))
- if err != nil {
- return os.NewSyscallError("setsockopt", err)
- }
- return nil
-}
diff --git a/libgo/go/syscall/creds_test.go b/libgo/go/syscall/creds_test.go
index 6eaa97e57b8..b1894c66b07 100644
--- a/libgo/go/syscall/creds_test.go
+++ b/libgo/go/syscall/creds_test.go
@@ -31,14 +31,18 @@ func TestSCMCredentials(t *testing.T) {
t.Fatalf("SetsockoptInt: %v", err)
}
- srv, err := net.FileConn(os.NewFile(uintptr(fds[0]), ""))
+ srvFile := os.NewFile(uintptr(fds[0]), "server")
+ defer srvFile.Close()
+ srv, err := net.FileConn(srvFile)
if err != nil {
t.Errorf("FileConn: %v", err)
return
}
defer srv.Close()
- cli, err := net.FileConn(os.NewFile(uintptr(fds[1]), ""))
+ cliFile := os.NewFile(uintptr(fds[1]), "client")
+ defer cliFile.Close()
+ cli, err := net.FileConn(cliFile)
if err != nil {
t.Errorf("FileConn: %v", err)
return
diff --git a/libgo/go/syscall/syscall_solaris.go b/libgo/go/syscall/syscall_solaris.go
new file mode 100644
index 00000000000..c1919171b7d
--- /dev/null
+++ b/libgo/go/syscall/syscall_solaris.go
@@ -0,0 +1,13 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package syscall
+
+func (ts *Timestruc) Unix() (sec int64, nsec int64) {
+ return int64(ts.Sec), int64(ts.Nsec)
+}
+
+func (ts *Timestruc) Nano() int64 {
+ return int64(ts.Sec)*1e9 + int64(ts.Nsec)
+}
diff --git a/libgomp/testsuite/libgomp.c++/tls-init1.C b/libgomp/testsuite/libgomp.c++/tls-init1.C
index 4cbaccb9851..d62e96b95bf 100644
--- a/libgomp/testsuite/libgomp.c++/tls-init1.C
+++ b/libgomp/testsuite/libgomp.c++/tls-init1.C
@@ -1,3 +1,5 @@
+// { dg-require-alias }
+
extern "C" void abort();
struct A
diff --git a/libitm/ChangeLog b/libitm/ChangeLog
index 8f55f4eb327..d98ce071586 100644
--- a/libitm/ChangeLog
+++ b/libitm/ChangeLog
@@ -1,3 +1,10 @@
+2012-10-31 Richard Henderson <rth@redhat.com>
+
+ * acinclude.m4 (LIBITM_CHECK_AS_RTM): New.
+ * configure.ac: Use it.
+ * config.h.in, configure: Rebuild.
+ * testsuite/Makefile.in: Rebuild.
+
2012-10-24 Torvald Riegel <triegel@redhat.com>
* libitm.texi: Clarify ABI requirements for data-logging functions.
diff --git a/libitm/acinclude.m4 b/libitm/acinclude.m4
index 1031f1f12c8..fe32fe3e4a0 100644
--- a/libitm/acinclude.m4
+++ b/libitm/acinclude.m4
@@ -109,6 +109,20 @@ i[[34567]]86 | x86_64)
;;
esac])
+dnl Check if as supports RTM instructions.
+AC_DEFUN([LIBITM_CHECK_AS_RTM], [
+case "${target_cpu}" in
+i[[34567]]86 | x86_64)
+ AC_CACHE_CHECK([if the assembler supports RTM], libitm_cv_as_rtm, [
+ AC_TRY_COMPILE([], [asm("1: xbegin 1b; xend");],
+ [libitm_cv_as_rtm=yes], [libitm_cv_as_rtm=no])
+ ])
+ if test x$libitm_cv_as_rtm = xyes; then
+ AC_DEFINE(HAVE_AS_RTM, 1, [Define to 1 if the assembler supports RTM.])
+ fi
+ ;;
+esac])
+
sinclude(../libtool.m4)
dnl The lines below arrange for aclocal not to bring an installed
dnl libtool.m4 into aclocal.m4, while still arranging for automake to
diff --git a/libitm/config.h.in b/libitm/config.h.in
index 1c3469cd5f9..10de95ba02a 100644
--- a/libitm/config.h.in
+++ b/libitm/config.h.in
@@ -12,6 +12,9 @@
/* Define if your assembler supports .cfi_* directives. */
#undef HAVE_AS_CFI_PSEUDO_OP
+/* Define to 1 if the assembler supports RTM. */
+#undef HAVE_AS_RTM
+
/* Define to 1 if the target supports __attribute__((alias(...))). */
#undef HAVE_ATTRIBUTE_ALIAS
diff --git a/libitm/configure b/libitm/configure
index 9daf30c3836..d985cf7b918 100644
--- a/libitm/configure
+++ b/libitm/configure
@@ -2845,6 +2845,7 @@ target_alias=${target_alias-$host_alias}
# no-define: PACKAGE and VERSION will not be #define'd in config.h (a bunch
# of other PACKAGE_* variables will, however, and there's nothing
# we can do about that; they come from AC_INIT).
+# no-dist: we don't want 'dist' and related rules.
# foreign: we don't follow the normal rules for GNU packages (no COPYING
# file in the top srcdir, etc, etc), so stop complaining.
# -Wall: turns on all automake warnings...
@@ -11783,7 +11784,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11786 "configure"
+#line 11787 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11889,7 +11890,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11892 "configure"
+#line 11893 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -17331,6 +17332,43 @@ $as_echo "#define HAVE_AS_AVX 1" >>confdefs.h
;;
esac
+case "${target_cpu}" in
+i[34567]86 | x86_64)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the assembler supports RTM" >&5
+$as_echo_n "checking if the assembler supports RTM... " >&6; }
+if test "${libitm_cv_as_rtm+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+asm("1: xbegin 1b; xend");
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ libitm_cv_as_rtm=yes
+else
+ libitm_cv_as_rtm=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libitm_cv_as_rtm" >&5
+$as_echo "$libitm_cv_as_rtm" >&6; }
+ if test x$libitm_cv_as_rtm = xyes; then
+
+$as_echo "#define HAVE_AS_RTM 1" >>confdefs.h
+
+ fi
+ ;;
+esac
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether weak refs work like ELF" >&5
$as_echo_n "checking whether weak refs work like ELF... " >&6; }
diff --git a/libitm/configure.ac b/libitm/configure.ac
index 198ca3277a5..8544686d8a2 100644
--- a/libitm/configure.ac
+++ b/libitm/configure.ac
@@ -244,6 +244,7 @@ CFLAGS="$save_CFLAGS $XCFLAGS"
LIBITM_CHECK_SYNC_BUILTINS
LIBITM_CHECK_64BIT_SYNC_BUILTINS
LIBITM_CHECK_AS_AVX
+LIBITM_CHECK_AS_RTM
GCC_CHECK_ELF_STYLE_WEAKREF
diff --git a/libitm/testsuite/Makefile.in b/libitm/testsuite/Makefile.in
index 7e9278d4881..4d797813caa 100644
--- a/libitm/testsuite/Makefile.in
+++ b/libitm/testsuite/Makefile.in
@@ -52,7 +52,7 @@ build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = testsuite
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
$(top_srcdir)/../config/asmcfi.m4 \
@@ -77,7 +77,6 @@ CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
-DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -85,7 +84,6 @@ am__can_run_installinfo = \
esac
DEJATOOL = $(PACKAGE)
RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
@@ -324,37 +322,6 @@ distclean-DEJAGNU:
-l='$(DEJATOOL)'; for tool in $$l; do \
rm -f $$tool.sum $$tool.log; \
done
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
check: check-am
@@ -460,8 +427,8 @@ uninstall-am:
.PHONY: all all-am check check-DEJAGNU check-am clean clean-generic \
clean-libtool distclean distclean-DEJAGNU distclean-generic \
- distclean-libtool distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-dvi \
+ distclean-libtool dvi dvi-am html html-am info info-am install \
+ install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index d0a915dea6d..3b2cb0d29ff 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,50 @@
+2012-10-31 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * include/bits/forward_list.h (forward_list): Adjust comments.
+ (forward_list(const forward_list&, const _Alloc&)): Use
+ _M_range_initialize to copy elements.
+ (forward_list(forward_list&&, const _Alloc&)): Add exception
+ specification.
+ (_Fwd_list_base(const _Fwd_list_base&, const _Node_alloc_type&)):
+ Remove.
+ * include/bits/forward_list.tcc (_Fwd_list_base(const _Fwd_list_base&,
+ const _Node_alloc_type&)): Remove.
+ (_Fwd_list_base(_Fwd_list_base&&, const _Node_alloc_type&)): Fix
+ memory leak when allocators are not equal.
+
+2012-10-29 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ PR libstdc++/55123
+ * include/bits/shared_ptr_base.h (__shared_count::_S_create_from_up):
+ Do not instantiate allocator with element_type.
+ * testsuite/20_util/shared_ptr/cons/55123.cc: New.
+
+2012-10-28 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ PR libstdc++/55041
+ * python/libstdcxx/v6/printers.py (Tr1UnorderedMapPrinter): Update
+ to handle hashtable as member of unordered_map not base class.
+ (Tr1UnorderedSetPrinter): Likewise.
+
+2012-10-27 François Dumont <fdumont@gcc.gnu.org>
+
+ * include/bits/unordered_map.h (unordered_map<>): Prefer
+ aggregation to inheritance with _Hashtable.
+ (unordered_multimap<>): Likewise.
+ * include/bits/unordered_set.h
+ (unordered_set<>(const unordered_set&)): Use default
+ implementation.
+ (unordered_set<>(unordered_set&&)): Likewise.
+ (unordered_set<>::operator=(const unordered_set&)): Likewise.
+ (unordered_set<>::operator=(unordered_set&&)): Likewise.
+ (unordered_multiset<>(const unordered_multiset&)): Likewise.
+ (unordered_multiset<>(unordered_multiset&&)): Likewise.
+ (unordered_multiset<>::operator=(const unordered_multiset&)):
+ Likewise.
+ (unordered_multiset<>::operator=(unordered_multiset&&)): Likewise.
+ * include/debug/unordered_map (operator==): Adapt.
+ * include/profile/unordered_map (operator==): Adapt.
+
2012-10-24 Daniel Krugler <daniel.kruegler@gmail.com>
* include/std/type_traits (common_type): Implement LWG 2141.
@@ -303,7 +350,7 @@
2012-10-09 Daniel Krugler <daniel.kruegler@gmail.com>
- * include/std/type_traits (common_time): Provide "SFINAE-friendly"
+ * include/std/type_traits (common_type): Provide "SFINAE-friendly"
implementation.
(__success_type, __failure_type): Fix.
* include/std/chrono (common_type): Likewise for the chrono::time_point
diff --git a/libstdc++-v3/include/bits/forward_list.h b/libstdc++-v3/include/bits/forward_list.h
index a5c9f434b35..8d4915d0e4d 100644
--- a/libstdc++-v3/include/bits/forward_list.h
+++ b/libstdc++-v3/include/bits/forward_list.h
@@ -314,8 +314,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_Fwd_list_base(const _Node_alloc_type& __a)
: _M_impl(__a) { }
- _Fwd_list_base(const _Fwd_list_base& __lst, const _Node_alloc_type& __a);
-
_Fwd_list_base(_Fwd_list_base&& __lst, const _Node_alloc_type& __a);
_Fwd_list_base(_Fwd_list_base&& __lst)
@@ -394,14 +392,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* Also unlike the other standard containers, std::forward_list provides
* specialized algorithms %unique to linked lists, such as
* splicing, sorting, and in-place reversal.
- *
- * A couple points on memory allocation for forward_list<Tp>:
- *
- * First, we never actually allocate a Tp, we allocate
- * Fwd_list_node<Tp>'s and trust [20.1.5]/4 to DTRT. This is to ensure
- * that after elements from %forward_list<X,Alloc1> are spliced into
- * %forward_list<X,Alloc2>, destroying the memory of the second %list is a
- * valid operation, i.e., Alloc1 giveth and Alloc2 taketh away.
*/
template<typename _Tp, typename _Alloc = allocator<_Tp> >
class forward_list : private _Fwd_list_base<_Tp, _Alloc>
@@ -429,7 +419,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
typedef std::ptrdiff_t difference_type;
typedef _Alloc allocator_type;
- // 23.2.3.1 construct/copy/destroy:
+ // 23.3.4.2 construct/copy/destroy:
/**
* @brief Creates a %forward_list with no elements.
@@ -446,8 +436,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* @param __al An allocator object.
*/
forward_list(const forward_list& __list, const _Alloc& __al)
- : _Base(__list, _Node_alloc_type(__al))
- { }
+ : _Base(_Node_alloc_type(__al))
+ { _M_range_initialize(__list.begin(), __list.end()); }
/**
* @brief Move constructor with allocator argument.
@@ -455,6 +445,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* @param __al An allocator object.
*/
forward_list(forward_list&& __list, const _Alloc& __al)
+ noexcept(_Node_alloc_traits::_S_always_equal())
: _Base(std::move(__list), _Node_alloc_type(__al))
{ }
@@ -504,7 +495,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/**
* @brief The %forward_list copy constructor.
* @param __list A %forward_list of identical element and allocator
- * types.
+ * types.
*/
forward_list(const forward_list& __list)
: _Base(_Node_alloc_traits::_S_select_on_copy(
@@ -514,10 +505,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/**
* @brief The %forward_list move constructor.
* @param __list A %forward_list of identical element and allocator
- * types.
+ * types.
*
* The newly-created %forward_list contains the exact contents of @a
- * forward_list. The contents of @a __list are a valid, but unspecified
+ * __list. The contents of @a __list are a valid, but unspecified
* %forward_list.
*/
forward_list(forward_list&& __list) noexcept
@@ -647,7 +638,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
get_allocator() const noexcept
{ return allocator_type(this->_M_get_Node_allocator()); }
- // 23.2.3.2 iterators:
+ // 23.3.4.3 iterators:
/**
* Returns a read/write iterator that points before the first element
@@ -743,7 +734,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
max_size() const noexcept
{ return _Node_alloc_traits::max_size(this->_M_get_Node_allocator()); }
- // 23.2.3.3 element access:
+ // 23.3.4.4 element access:
/**
* Returns a read/write reference to the data at the first
@@ -767,7 +758,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
return __front->_M_value;
}
- // 23.2.3.4 modifiers:
+ // 23.3.4.5 modifiers:
/**
* @brief Constructs object in %forward_list at the front of the
@@ -1031,7 +1022,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
clear() noexcept
{ this->_M_erase_after(&this->_M_impl._M_head, 0); }
- // 23.2.3.5 forward_list operations:
+ // 23.3.4.6 forward_list operations:
/**
* @brief Insert contents of another %forward_list.
@@ -1223,7 +1214,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
{ this->_M_impl._M_head._M_reverse_after(); }
private:
- // Called by the range constructor to implement [23.1.1]/9
+ // Called by the range constructor to implement [23.3.4.2]/9
template<typename _InputIterator>
void
_M_range_initialize(_InputIterator __first, _InputIterator __last);
diff --git a/libstdc++-v3/include/bits/forward_list.tcc b/libstdc++-v3/include/bits/forward_list.tcc
index 5d18a6ebf44..4f9a7fad4eb 100644
--- a/libstdc++-v3/include/bits/forward_list.tcc
+++ b/libstdc++-v3/include/bits/forward_list.tcc
@@ -36,28 +36,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Tp, typename _Alloc>
_Fwd_list_base<_Tp, _Alloc>::
- _Fwd_list_base(const _Fwd_list_base& __lst, const _Node_alloc_type& __a)
- : _M_impl(__a)
- {
- this->_M_impl._M_head._M_next = 0;
- _Fwd_list_node_base* __to = &this->_M_impl._M_head;
- _Node* __curr = static_cast<_Node*>(__lst._M_impl._M_head._M_next);
-
- while (__curr)
- {
- __to->_M_next = _M_create_node(__curr->_M_value);
- __to = __to->_M_next;
- __curr = static_cast<_Node*>(__curr->_M_next);
- }
- }
-
- template<typename _Tp, typename _Alloc>
- _Fwd_list_base<_Tp, _Alloc>::
_Fwd_list_base(_Fwd_list_base&& __lst, const _Node_alloc_type& __a)
: _M_impl(__a)
{
if (__lst._M_get_Node_allocator() == __a)
- this->_M_impl._M_head._M_next = __lst._M_impl._M_head._M_next;
+ {
+ this->_M_impl._M_head._M_next = __lst._M_impl._M_head._M_next;
+ __lst._M_impl._M_head._M_next = 0;
+ }
else
{
this->_M_impl._M_head._M_next = 0;
@@ -72,7 +58,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
__curr = static_cast<_Node*>(__curr->_M_next);
}
}
- __lst._M_impl._M_head._M_next = 0;
}
template<typename _Tp, typename _Alloc>
@@ -119,7 +104,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
return __last;
}
- // Called by the range constructor to implement [23.1.1]/9
+ // Called by the range constructor to implement [23.3.4.2]/9
template<typename _Tp, typename _Alloc>
template<typename _InputIterator>
void
diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h
index 07ac000d90b..e48a8fb9ced 100644
--- a/libstdc++-v3/include/bits/shared_ptr_base.h
+++ b/libstdc++-v3/include/bits/shared_ptr_base.h
@@ -622,7 +622,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_S_create_from_up(std::unique_ptr<_Tp, _Del>&& __r,
typename std::enable_if<!std::is_reference<_Del>::value>::type* = 0)
{
- return new _Sp_counted_deleter<_Tp*, _Del, std::allocator<_Tp>,
+ return new _Sp_counted_deleter<_Tp*, _Del, std::allocator<void>,
_Lp>(__r.get(), __r.get_deleter());
}
@@ -633,7 +633,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
typedef typename std::remove_reference<_Del>::type _Del1;
typedef std::reference_wrapper<_Del1> _Del2;
- return new _Sp_counted_deleter<_Tp*, _Del2, std::allocator<_Tp>,
+ return new _Sp_counted_deleter<_Tp*, _Del2, std::allocator<void>,
_Lp>(__r.get(), std::ref(__r.get_deleter()));
}
diff --git a/libstdc++-v3/include/bits/unordered_map.h b/libstdc++-v3/include/bits/unordered_map.h
index 27703b6b9c0..973467e3b7d 100644
--- a/libstdc++-v3/include/bits/unordered_map.h
+++ b/libstdc++-v3/include/bits/unordered_map.h
@@ -95,41 +95,654 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
class _Pred = std::equal_to<_Key>,
class _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
class unordered_map
- : public __umap_hashtable<_Key, _Tp, _Hash, _Pred, _Alloc>
{
- typedef __umap_hashtable<_Key, _Tp, _Hash, _Pred, _Alloc> _Base;
+ typedef __umap_hashtable<_Key, _Tp, _Hash, _Pred, _Alloc> _Hashtable;
+ _Hashtable _M_h;
public:
- typedef typename _Base::value_type value_type;
- typedef typename _Base::size_type size_type;
- typedef typename _Base::hasher hasher;
- typedef typename _Base::key_equal key_equal;
- typedef typename _Base::allocator_type allocator_type;
+ // typedefs:
+ //@{
+ /// Public typedefs.
+ typedef typename _Hashtable::key_type key_type;
+ typedef typename _Hashtable::value_type value_type;
+ typedef typename _Hashtable::mapped_type mapped_type;
+ typedef typename _Hashtable::hasher hasher;
+ typedef typename _Hashtable::key_equal key_equal;
+ typedef typename _Hashtable::allocator_type allocator_type;
+ //@}
+ //@{
+ /// Iterator-related typedefs.
+ typedef typename allocator_type::pointer pointer;
+ typedef typename allocator_type::const_pointer const_pointer;
+ typedef typename allocator_type::reference reference;
+ typedef typename allocator_type::const_reference const_reference;
+ typedef typename _Hashtable::iterator iterator;
+ typedef typename _Hashtable::const_iterator const_iterator;
+ typedef typename _Hashtable::local_iterator local_iterator;
+ typedef typename _Hashtable::const_local_iterator const_local_iterator;
+ typedef typename _Hashtable::size_type size_type;
+ typedef typename _Hashtable::difference_type difference_type;
+ //@}
+
+ //construct/destroy/copy
+
+ /**
+ * @brief Default constructor creates no elements.
+ * @param __n Initial number of buckets.
+ * @param __hf A hash functor.
+ * @param __eql A key equality functor.
+ * @param __a An allocator object.
+ */
explicit
unordered_map(size_type __n = 10,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
- : _Base(__n, __hf, __eql, __a)
+ : _M_h(__n, __hf, __eql, __a)
{ }
+ /**
+ * @brief Builds an %unordered_map from a range.
+ * @param __first An input iterator.
+ * @param __last An input iterator.
+ * @param __n Minimal initial number of buckets.
+ * @param __hf A hash functor.
+ * @param __eql A key equality functor.
+ * @param __a An allocator object.
+ *
+ * Create an %unordered_map consisting of copies of the elements from
+ * [__first,__last). This is linear in N (where N is
+ * distance(__first,__last)).
+ */
template<typename _InputIterator>
unordered_map(_InputIterator __f, _InputIterator __l,
size_type __n = 0,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
- : _Base(__f, __l, __n, __hf, __eql, __a)
+ : _M_h(__f, __l, __n, __hf, __eql, __a)
{ }
+ /// Copy constructor.
+ unordered_map(const unordered_map&) = default;
+
+ /// Move constrcutor.
+ unordered_map(unordered_map&&) = default;
+
+ /**
+ * @brief Builds an %unordered_map from an initializer_list.
+ * @param __l An initializer_list.
+ * @param __n Minimal initial number of buckets.
+ * @param __hf A hash functor.
+ * @param __eql A key equality functor.
+ * @param __a An allocator object.
+ *
+ * Create an %unordered_map consisting of copies of the elements in the
+ * list. This is linear in N (where N is @a __l.size()).
+ */
unordered_map(initializer_list<value_type> __l,
size_type __n = 0,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
- : _Base(__l.begin(), __l.end(), __n, __hf, __eql, __a)
+ : _M_h(__l, __n, __hf, __eql, __a)
{ }
+
+ /// Copy assignment operator.
+ unordered_map&
+ operator=(const unordered_map&) = default;
+
+ /// Move assignment operator.
+ unordered_map&
+ operator=(unordered_map&&) = default;
+
+ /**
+ * @brief %Unordered_map list assignment operator.
+ * @param __l An initializer_list.
+ *
+ * This function fills an %unordered_map with copies of the elements in
+ * the initializer list @a __l.
+ *
+ * Note that the assignment completely changes the %unordered_map and
+ * that the resulting %unordered_map's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ unordered_map&
+ operator=(initializer_list<value_type> __l)
+ {
+ _M_h = __l;
+ return *this;
+ }
+
+ /// Returns the allocator object with which the %unordered_map was
+ /// constructed.
+ allocator_type
+ get_allocator() const noexcept
+ { return _M_h.get_allocator(); }
+
+ // size and capacity:
+
+ /// Returns true if the %unordered_map is empty.
+ bool
+ empty() const noexcept
+ { return _M_h.empty(); }
+
+ /// Returns the size of the %unordered_map.
+ size_type
+ size() const noexcept
+ { return _M_h.size(); }
+
+ /// Returns the maximum size of the %unordered_map.
+ size_type
+ max_size() const noexcept
+ { return _M_h.max_size(); }
+
+ // iterators.
+
+ /**
+ * Returns a read/write iterator that points to the first element in the
+ * %unordered_map.
+ */
+ iterator
+ begin() noexcept
+ { return _M_h.begin(); }
+
+ //@{
+ /**
+ * Returns a read-only (constant) iterator that points to the first
+ * element in the %unordered_map.
+ */
+ const_iterator
+ begin() const noexcept
+ { return _M_h.begin(); }
+
+ const_iterator
+ cbegin() const noexcept
+ { return _M_h.begin(); }
+ //@}
+
+ /**
+ * Returns a read/write iterator that points one past the last element in
+ * the %unordered_map.
+ */
+ iterator
+ end() noexcept
+ { return _M_h.end(); }
+
+ //@{
+ /**
+ * Returns a read-only (constant) iterator that points one past the last
+ * element in the %unordered_map.
+ */
+ const_iterator
+ end() const noexcept
+ { return _M_h.end(); }
+
+ const_iterator
+ cend() const noexcept
+ { return _M_h.end(); }
+ //@}
+
+ // modifiers.
+
+ /**
+ * @brief Attempts to build and insert a std::pair into the %unordered_map.
+ *
+ * @param __args Arguments used to generate a new pair instance (see
+ * std::piecewise_contruct for passing arguments to each
+ * part of the pair constructor).
+ *
+ * @return A pair, of which the first element is an iterator that points
+ * to the possibly inserted pair, and the second is a bool that
+ * is true if the pair was actually inserted.
+ *
+ * This function attempts to build and insert a (key, value) %pair into
+ * the %unordered_map.
+ * An %unordered_map relies on unique keys and thus a %pair is only
+ * inserted if its first element (the key) is not already present in the
+ * %unordered_map.
+ *
+ * Insertion requires amortized constant time.
+ */
+ template<typename... _Args>
+ std::pair<iterator, bool>
+ emplace(_Args&&... __args)
+ { return _M_h.emplace(std::forward<_Args>(__args)...); }
+
+ /**
+ * @brief Attempts to build and insert a std::pair into the %unordered_map.
+ *
+ * @param __pos An iterator that serves as a hint as to where the pair
+ * should be inserted.
+ * @param __args Arguments used to generate a new pair instance (see
+ * std::piecewise_contruct for passing arguments to each
+ * part of the pair constructor).
+ * @return An iterator that points to the element with key of the
+ * std::pair built from @a __args (may or may not be that
+ * std::pair).
+ *
+ * This function is not concerned about whether the insertion took place,
+ * and thus does not return a boolean like the single-argument emplace()
+ * does.
+ * Note that the first parameter is only a hint and can potentially
+ * improve the performance of the insertion process. A bad hint would
+ * cause no gains in efficiency.
+ *
+ * See
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt07ch17.html
+ * for more on @a hinting.
+ *
+ * Insertion requires amortized constant time.
+ */
+ template<typename... _Args>
+ iterator
+ emplace_hint(const_iterator __pos, _Args&&... __args)
+ { return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); }
+
+ //@{
+ /**
+ * @brief Attempts to insert a std::pair into the %unordered_map.
+
+ * @param __x Pair to be inserted (see std::make_pair for easy
+ * creation of pairs).
+ *
+ * @return A pair, of which the first element is an iterator that
+ * points to the possibly inserted pair, and the second is
+ * a bool that is true if the pair was actually inserted.
+ *
+ * This function attempts to insert a (key, value) %pair into the
+ * %unordered_map. An %unordered_map relies on unique keys and thus a
+ * %pair is only inserted if its first element (the key) is not already
+ * present in the %unordered_map.
+ *
+ * Insertion requires amortized constant time.
+ */
+ std::pair<iterator, bool>
+ insert(const value_type& __x)
+ { return _M_h.insert(__x); }
+
+ template<typename _Pair>
+ std::pair<iterator, bool>
+ insert(_Pair&& __x)
+ { return _M_h.insert(std::move(__x)); }
+ //@}
+
+ //@{
+ /**
+ * @brief Attempts to insert a std::pair into the %unordered_map.
+ * @param __hint An iterator that serves as a hint as to where the
+ * pair should be inserted.
+ * @param __x Pair to be inserted (see std::make_pair for easy creation
+ * of pairs).
+ * @return An iterator that points to the element with key of
+ * @a __x (may or may not be the %pair passed in).
+ *
+ * This function is not concerned about whether the insertion took place,
+ * and thus does not return a boolean like the single-argument insert()
+ * does. Note that the first parameter is only a hint and can
+ * potentially improve the performance of the insertion process. A bad
+ * hint would cause no gains in efficiency.
+ *
+ * See
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt07ch17.html
+ * for more on @a hinting.
+ *
+ * Insertion requires amortized constant time.
+ */
+ iterator
+ insert(const_iterator __hint, const value_type& __x)
+ { return _M_h.insert(__hint, __x); }
+
+ template<typename _Pair>
+ iterator
+ insert(const_iterator __hint, _Pair&& __x)
+ { return _M_h.insert(__hint, std::move(__x)); }
+ //@}
+
+ /**
+ * @brief A template function that attempts to insert a range of
+ * elements.
+ * @param __first Iterator pointing to the start of the range to be
+ * inserted.
+ * @param __last Iterator pointing to the end of the range.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ { _M_h.insert(__first, __last); }
+
+ /**
+ * @brief Attempts to insert a list of elements into the %unordered_map.
+ * @param __l A std::initializer_list<value_type> of elements
+ * to be inserted.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ void
+ insert(initializer_list<value_type> __l)
+ { _M_h.insert(__l); }
+
+ //@{
+ /**
+ * @brief Erases an element from an %unordered_map.
+ * @param __position An iterator pointing to the element to be erased.
+ * @return An iterator pointing to the element immediately following
+ * @a __position prior to the element being erased. If no such
+ * element exists, end() is returned.
+ *
+ * This function erases an element, pointed to by the given iterator,
+ * from an %unordered_map.
+ * Note that this function only erases the element, and that if the
+ * element is itself a pointer, the pointed-to memory is not touched in
+ * any way. Managing the pointer is the user's responsibility.
+ */
+ iterator
+ erase(const_iterator __position)
+ { return _M_h.erase(__position); }
+
+ // LWG 2059.
+ iterator
+ erase(iterator __it)
+ { return _M_h.erase(__it); }
+ //@}
+
+ /**
+ * @brief Erases elements according to the provided key.
+ * @param __x Key of element to be erased.
+ * @return The number of elements erased.
+ *
+ * This function erases all the elements located by the given key from
+ * an %unordered_map. For an %unordered_map the result of this function
+ * can only be 0 (not present) or 1 (present).
+ * Note that this function only erases the element, and that if the
+ * element is itself a pointer, the pointed-to memory is not touched in
+ * any way. Managing the pointer is the user's responsibility.
+ */
+ size_type
+ erase(const key_type& __x)
+ { return _M_h.erase(__x); }
+
+ /**
+ * @brief Erases a [__first,__last) range of elements from an
+ * %unordered_map.
+ * @param __first Iterator pointing to the start of the range to be
+ * erased.
+ * @param __last Iterator pointing to the end of the range to
+ * be erased.
+ * @return The iterator @a __last.
+ *
+ * This function erases a sequence of elements from an %unordered_map.
+ * Note that this function only erases the elements, and that if
+ * the element is itself a pointer, the pointed-to memory is not touched
+ * in any way. Managing the pointer is the user's responsibility.
+ */
+ iterator
+ erase(const_iterator __first, const_iterator __last)
+ { return _M_h.erase(__first, __last); }
+
+ /**
+ * Erases all elements in an %unordered_map.
+ * Note that this function only erases the elements, and that if the
+ * elements themselves are pointers, the pointed-to memory is not touched
+ * in any way. Managing the pointer is the user's responsibility.
+ */
+ void
+ clear() noexcept
+ { _M_h.clear(); }
+
+ /**
+ * @brief Swaps data with another %unordered_map.
+ * @param __x An %unordered_map of the same element and allocator
+ * types.
+ *
+ * This exchanges the elements between two %unordered_map in constant time.
+ * Note that the global std::swap() function is specialized such that
+ * std::swap(m1,m2) will feed to this function.
+ */
+ void
+ swap(unordered_map& __x)
+ { _M_h.swap(__x._M_h); }
+
+ // observers.
+
+ /// Returns the hash functor object with which the %unordered_map was
+ /// constructed.
+ hasher
+ hash_function() const
+ { return _M_h.hash_function(); }
+
+ /// Returns the key comparison object with which the %unordered_map was
+ /// constructed.
+ key_equal
+ key_eq() const
+ { return _M_h.key_eq(); }
+
+ // lookup.
+
+ //@{
+ /**
+ * @brief Tries to locate an element in an %unordered_map.
+ * @param __x Key to be located.
+ * @return Iterator pointing to sought-after element, or end() if not
+ * found.
+ *
+ * This function takes a key and tries to locate the element with which
+ * the key matches. If successful the function returns an iterator
+ * pointing to the sought after element. If unsuccessful it returns the
+ * past-the-end ( @c end() ) iterator.
+ */
+ iterator
+ find(const key_type& __x)
+ { return _M_h.find(__x); }
+
+ const_iterator
+ find(const key_type& __x) const
+ { return _M_h.find(__x); }
+ //@}
+
+ /**
+ * @brief Finds the number of elements.
+ * @param __x Key to count.
+ * @return Number of elements with specified key.
+ *
+ * This function only makes sense for %unordered_multimap; for
+ * %unordered_map the result will either be 0 (not present) or 1
+ * (present).
+ */
+ size_type
+ count(const key_type& __x) const
+ { return _M_h.count(__x); }
+
+ //@{
+ /**
+ * @brief Finds a subsequence matching given key.
+ * @param __x Key to be located.
+ * @return Pair of iterators that possibly points to the subsequence
+ * matching given key.
+ *
+ * This function probably only makes sense for %unordered_multimap.
+ */
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __x)
+ { return _M_h.equal_range(__x); }
+
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& __x) const
+ { return _M_h.equal_range(__x); }
+ //@}
+
+ //@{
+ /**
+ * @brief Subscript ( @c [] ) access to %unordered_map data.
+ * @param __k The key for which data should be retrieved.
+ * @return A reference to the data of the (key,data) %pair.
+ *
+ * Allows for easy lookup with the subscript ( @c [] )operator. Returns
+ * data associated with the key specified in subscript. If the key does
+ * not exist, a pair with that key is created using default values, which
+ * is then returned.
+ *
+ * Lookup requires constant time.
+ */
+ mapped_type&
+ operator[](const key_type& __k)
+ { return _M_h[__k]; }
+
+ mapped_type&
+ operator[](key_type&& __k)
+ { return _M_h[std::move(__k)]; }
+ //@}
+
+ //@{
+ /**
+ * @brief Access to %unordered_map data.
+ * @param __k The key for which data should be retrieved.
+ * @return A reference to the data whose key is equal to @a __k, if
+ * such a data is present in the %unordered_map.
+ * @throw std::out_of_range If no such data is present.
+ */
+ mapped_type&
+ at(const key_type& __k)
+ { return _M_h.at(__k); }
+
+ const mapped_type&
+ at(const key_type& __k) const
+ { return _M_h.at(__k); }
+ //@}
+
+ // bucket interface.
+
+ /// Returns the number of buckets of the %unordered_map.
+ size_type
+ bucket_count() const noexcept
+ { return _M_h.bucket_count(); }
+
+ /// Returns the maximum number of buckets of the %unordered_map.
+ size_type
+ max_bucket_count() const noexcept
+ { return _M_h.max_bucket_count(); }
+
+ /*
+ * @brief Returns the number of elements in a given bucket.
+ * @param __n A bucket index.
+ * @return The number of elements in the bucket.
+ */
+ size_type
+ bucket_size(size_type __n) const
+ { return _M_h.bucket_size(__n); }
+
+ /*
+ * @brief Returns the bucket index of a given element.
+ * @param __key A key instance.
+ * @return The key bucket index.
+ */
+ size_type
+ bucket(const key_type& __key) const
+ { return _M_h.bucket(__key); }
+
+ /**
+ * @brief Returns a read/write iterator pointing to the first bucket
+ * element.
+ * @param __n The bucket index.
+ * @return A read/write local iterator.
+ */
+ local_iterator
+ begin(size_type __n)
+ { return _M_h.begin(__n); }
+
+ //@{
+ /**
+ * @brief Returns a read-only (constant) iterator pointing to the first
+ * bucket element.
+ * @param __n The bucket index.
+ * @return A read-only local iterator.
+ */
+ const_local_iterator
+ begin(size_type __n) const
+ { return _M_h.begin(__n); }
+
+ const_local_iterator
+ cbegin(size_type __n) const
+ { return _M_h.cbegin(__n); }
+ //@}
+
+ /**
+ * @brief Returns a read/write iterator pointing to one past the last
+ * bucket elements.
+ * @param __n The bucket index.
+ * @return A read/write local iterator.
+ */
+ local_iterator
+ end(size_type __n)
+ { return _M_h.end(__n); }
+
+ //@{
+ /**
+ * @brief Returns a read-only (constant) iterator pointing to one past
+ * the last bucket elements.
+ * @param __n The bucket index.
+ * @return A read-only local iterator.
+ */
+ const_local_iterator
+ end(size_type __n) const
+ { return _M_h.end(__n); }
+
+ const_local_iterator
+ cend(size_type __n) const
+ { return _M_h.cend(__n); }
+ //@}
+
+ // hash policy.
+
+ /// Returns the average number of elements per bucket.
+ float
+ load_factor() const noexcept
+ { return _M_h.load_factor(); }
+
+ /// Returns a positive number that the %unordered_map tries to keep the
+ /// load factor less than or equal to.
+ float
+ max_load_factor() const noexcept
+ { return _M_h.max_load_factor(); }
+
+ /**
+ * @brief Change the %unordered_map maximum load factor.
+ * @param __z The new maximum load factor.
+ */
+ void
+ max_load_factor(float __z)
+ { _M_h.max_load_factor(__z); }
+
+ /**
+ * @brief May rehash the %unordered_map.
+ * @param __n The new number of buckets.
+ *
+ * Rehash will occur only if the new number of buckets respect the
+ * %unordered_map maximum load factor.
+ */
+ void
+ rehash(size_type __n)
+ { _M_h.rehash(__n); }
+
+ /**
+ * @brief Prepare the %unordered_map for a specified number of
+ * elements.
+ * @param __n Number of elements required.
+ *
+ * Same as rehash(ceil(n / max_load_factor())).
+ */
+ void
+ reserve(size_type __n)
+ { _M_h.reserve(__n); }
+
+ template<typename _Key1, typename _Tp1, typename _Hash1, typename _Pred1,
+ typename _Alloc1>
+ friend bool
+ operator==(const unordered_map<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>&,
+ const unordered_map<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>&);
};
/**
@@ -159,41 +772,595 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
class _Pred = std::equal_to<_Key>,
class _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
class unordered_multimap
- : public __ummap_hashtable<_Key, _Tp, _Hash, _Pred, _Alloc>
{
- typedef __ummap_hashtable<_Key, _Tp, _Hash, _Pred, _Alloc> _Base;
+ typedef __ummap_hashtable<_Key, _Tp, _Hash, _Pred, _Alloc> _Hashtable;
+ _Hashtable _M_h;
public:
- typedef typename _Base::value_type value_type;
- typedef typename _Base::size_type size_type;
- typedef typename _Base::hasher hasher;
- typedef typename _Base::key_equal key_equal;
- typedef typename _Base::allocator_type allocator_type;
+ // typedefs:
+ //@{
+ /// Public typedefs.
+ typedef typename _Hashtable::key_type key_type;
+ typedef typename _Hashtable::value_type value_type;
+ typedef typename _Hashtable::mapped_type mapped_type;
+ typedef typename _Hashtable::hasher hasher;
+ typedef typename _Hashtable::key_equal key_equal;
+ typedef typename _Hashtable::allocator_type allocator_type;
+ //@}
+
+ //@{
+ /// Iterator-related typedefs.
+ typedef typename allocator_type::pointer pointer;
+ typedef typename allocator_type::const_pointer const_pointer;
+ typedef typename allocator_type::reference reference;
+ typedef typename allocator_type::const_reference const_reference;
+ typedef typename _Hashtable::iterator iterator;
+ typedef typename _Hashtable::const_iterator const_iterator;
+ typedef typename _Hashtable::local_iterator local_iterator;
+ typedef typename _Hashtable::const_local_iterator const_local_iterator;
+ typedef typename _Hashtable::size_type size_type;
+ typedef typename _Hashtable::difference_type difference_type;
+ //@}
+
+ //construct/destroy/copy
+ /**
+ * @brief Default constructor creates no elements.
+ * @param __n Initial number of buckets.
+ * @param __hf A hash functor.
+ * @param __eql A key equality functor.
+ * @param __a An allocator object.
+ */
explicit
unordered_multimap(size_type __n = 10,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
- : _Base(__n, __hf, __eql, __a)
+ : _M_h(__n, __hf, __eql, __a)
{ }
+ /**
+ * @brief Builds an %unordered_multimap from a range.
+ * @param __first An input iterator.
+ * @param __last An input iterator.
+ * @param __n Minimal initial number of buckets.
+ * @param __hf A hash functor.
+ * @param __eql A key equality functor.
+ * @param __a An allocator object.
+ *
+ * Create an %unordered_multimap consisting of copies of the elements
+ * from [__first,__last). This is linear in N (where N is
+ * distance(__first,__last)).
+ */
template<typename _InputIterator>
unordered_multimap(_InputIterator __f, _InputIterator __l,
size_type __n = 0,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
- : _Base(__f, __l, __n, __hf, __eql, __a)
+ : _M_h(__f, __l, __n, __hf, __eql, __a)
{ }
+ /// Copy constructor.
+ unordered_multimap(const unordered_multimap&) = default;
+
+ /// Move constrcutor.
+ unordered_multimap(unordered_multimap&&) = default;
+
+ /**
+ * @brief Builds an %unordered_multimap from an initializer_list.
+ * @param __l An initializer_list.
+ * @param __n Minimal initial number of buckets.
+ * @param __hf A hash functor.
+ * @param __eql A key equality functor.
+ * @param __a An allocator object.
+ *
+ * Create an %unordered_multimap consisting of copies of the elements in
+ * the list. This is linear in N (where N is @a __l.size()).
+ */
unordered_multimap(initializer_list<value_type> __l,
size_type __n = 0,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
- : _Base(__l.begin(), __l.end(), __n, __hf, __eql, __a)
+ : _M_h(__l, __n, __hf, __eql, __a)
{ }
+
+ /// Copy assignment operator.
+ unordered_multimap&
+ operator=(const unordered_multimap&) = default;
+
+ /// Move assignment operator.
+ unordered_multimap&
+ operator=(unordered_multimap&&) = default;
+
+ /**
+ * @brief %Unordered_multimap list assignment operator.
+ * @param __l An initializer_list.
+ *
+ * This function fills an %unordered_multimap with copies of the elements
+ * in the initializer list @a __l.
+ *
+ * Note that the assignment completely changes the %unordered_multimap
+ * and that the resulting %unordered_multimap's size is the same as the
+ * number of elements assigned. Old data may be lost.
+ */
+ unordered_multimap&
+ operator=(initializer_list<value_type> __l)
+ {
+ _M_h = __l;
+ return *this;
+ }
+
+ /// Returns the allocator object with which the %unordered_multimap was
+ /// constructed.
+ allocator_type
+ get_allocator() const noexcept
+ { return _M_h.get_allocator(); }
+
+ // size and capacity:
+
+ /// Returns true if the %unordered_multimap is empty.
+ bool
+ empty() const noexcept
+ { return _M_h.empty(); }
+
+ /// Returns the size of the %unordered_multimap.
+ size_type
+ size() const noexcept
+ { return _M_h.size(); }
+
+ /// Returns the maximum size of the %unordered_multimap.
+ size_type
+ max_size() const noexcept
+ { return _M_h.max_size(); }
+
+ // iterators.
+
+ /**
+ * Returns a read/write iterator that points to the first element in the
+ * %unordered_multimap.
+ */
+ iterator
+ begin() noexcept
+ { return _M_h.begin(); }
+
+ //@{
+ /**
+ * Returns a read-only (constant) iterator that points to the first
+ * element in the %unordered_multimap.
+ */
+ const_iterator
+ begin() const noexcept
+ { return _M_h.begin(); }
+
+ const_iterator
+ cbegin() const noexcept
+ { return _M_h.begin(); }
+ //@}
+
+ /**
+ * Returns a read/write iterator that points one past the last element in
+ * the %unordered_multimap.
+ */
+ iterator
+ end() noexcept
+ { return _M_h.end(); }
+
+ //@{
+ /**
+ * Returns a read-only (constant) iterator that points one past the last
+ * element in the %unordered_multimap.
+ */
+ const_iterator
+ end() const noexcept
+ { return _M_h.end(); }
+
+ const_iterator
+ cend() const noexcept
+ { return _M_h.end(); }
+ //@}
+
+ // modifiers.
+
+ /**
+ * @brief Attempts to build and insert a std::pair into the
+ * %unordered_multimap.
+ *
+ * @param __args Arguments used to generate a new pair instance (see
+ * std::piecewise_contruct for passing arguments to each
+ * part of the pair constructor).
+ *
+ * @return An iterator that points to the inserted pair.
+ *
+ * This function attempts to build and insert a (key, value) %pair into
+ * the %unordered_multimap.
+ *
+ * Insertion requires amortized constant time.
+ */
+ template<typename... _Args>
+ iterator
+ emplace(_Args&&... __args)
+ { return _M_h.emplace(std::forward<_Args>(__args)...); }
+
+ /**
+ * @brief Attempts to build and insert a std::pair into the %unordered_multimap.
+ *
+ * @param __pos An iterator that serves as a hint as to where the pair
+ * should be inserted.
+ * @param __args Arguments used to generate a new pair instance (see
+ * std::piecewise_contruct for passing arguments to each
+ * part of the pair constructor).
+ * @return An iterator that points to the element with key of the
+ * std::pair built from @a __args.
+ *
+ * Note that the first parameter is only a hint and can potentially
+ * improve the performance of the insertion process. A bad hint would
+ * cause no gains in efficiency.
+ *
+ * See
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt07ch17.html
+ * for more on @a hinting.
+ *
+ * Insertion requires amortized constant time.
+ */
+ template<typename... _Args>
+ iterator
+ emplace_hint(const_iterator __pos, _Args&&... __args)
+ { return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); }
+
+ //@{
+ /**
+ * @brief Inserts a std::pair into the %unordered_multimap.
+ * @param __x Pair to be inserted (see std::make_pair for easy
+ * creation of pairs).
+ *
+ * @return An iterator that points to the inserted pair.
+ *
+ * Insertion requires amortized constant time.
+ */
+ iterator
+ insert(const value_type& __x)
+ { return _M_h.insert(__x); }
+
+ template<typename _Pair>
+ iterator
+ insert(_Pair&& __x)
+ { return _M_h.insert(std::move(__x)); }
+ //@}
+
+ //@{
+ /**
+ * @brief Inserts a std::pair into the %unordered_multimap.
+ * @param __hint An iterator that serves as a hint as to where the
+ * pair should be inserted.
+ * @param __x Pair to be inserted (see std::make_pair for easy creation
+ * of pairs).
+ * @return An iterator that points to the element with key of
+ * @a __x (may or may not be the %pair passed in).
+ *
+ * Note that the first parameter is only a hint and can potentially
+ * improve the performance of the insertion process. A bad hint would
+ * cause no gains in efficiency.
+ *
+ * See
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt07ch17.html
+ * for more on @a hinting.
+ *
+ * Insertion requires amortized constant time.
+ */
+ iterator
+ insert(const_iterator __hint, const value_type& __x)
+ { return _M_h.insert(__hint, __x); }
+
+ template<typename _Pair>
+ iterator
+ insert(const_iterator __hint, _Pair&& __x)
+ { return _M_h.insert(__hint, std::move(__x)); }
+ //@}
+
+ /**
+ * @brief A template function that attempts to insert a range of
+ * elements.
+ * @param __first Iterator pointing to the start of the range to be
+ * inserted.
+ * @param __last Iterator pointing to the end of the range.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ { _M_h.insert(__first, __last); }
+
+ /**
+ * @brief Attempts to insert a list of elements into the
+ * %unordered_multimap.
+ * @param __l A std::initializer_list<value_type> of elements
+ * to be inserted.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ void
+ insert(initializer_list<value_type> __l)
+ { _M_h.insert(__l); }
+
+ //@{
+ /**
+ * @brief Erases an element from an %unordered_multimap.
+ * @param __position An iterator pointing to the element to be erased.
+ * @return An iterator pointing to the element immediately following
+ * @a __position prior to the element being erased. If no such
+ * element exists, end() is returned.
+ *
+ * This function erases an element, pointed to by the given iterator,
+ * from an %unordered_multimap.
+ * Note that this function only erases the element, and that if the
+ * element is itself a pointer, the pointed-to memory is not touched in
+ * any way. Managing the pointer is the user's responsibility.
+ */
+ iterator
+ erase(const_iterator __position)
+ { return _M_h.erase(__position); }
+
+ // LWG 2059.
+ iterator
+ erase(iterator __it)
+ { return _M_h.erase(__it); }
+ //@}
+
+ /**
+ * @brief Erases elements according to the provided key.
+ * @param __x Key of elements to be erased.
+ * @return The number of elements erased.
+ *
+ * This function erases all the elements located by the given key from
+ * an %unordered_multimap.
+ * Note that this function only erases the element, and that if the
+ * element is itself a pointer, the pointed-to memory is not touched in
+ * any way. Managing the pointer is the user's responsibility.
+ */
+ size_type
+ erase(const key_type& __x)
+ { return _M_h.erase(__x); }
+
+ /**
+ * @brief Erases a [__first,__last) range of elements from an
+ * %unordered_multimap.
+ * @param __first Iterator pointing to the start of the range to be
+ * erased.
+ * @param __last Iterator pointing to the end of the range to
+ * be erased.
+ * @return The iterator @a __last.
+ *
+ * This function erases a sequence of elements from an
+ * %unordered_multimap.
+ * Note that this function only erases the elements, and that if
+ * the element is itself a pointer, the pointed-to memory is not touched
+ * in any way. Managing the pointer is the user's responsibility.
+ */
+ iterator
+ erase(const_iterator __first, const_iterator __last)
+ { return _M_h.erase(__first, __last); }
+
+ /**
+ * Erases all elements in an %unordered_multimap.
+ * Note that this function only erases the elements, and that if the
+ * elements themselves are pointers, the pointed-to memory is not touched
+ * in any way. Managing the pointer is the user's responsibility.
+ */
+ void
+ clear() noexcept
+ { _M_h.clear(); }
+
+ /**
+ * @brief Swaps data with another %unordered_multimap.
+ * @param __x An %unordered_multimap of the same element and allocator
+ * types.
+ *
+ * This exchanges the elements between two %unordered_multimap in
+ * constant time.
+ * Note that the global std::swap() function is specialized such that
+ * std::swap(m1,m2) will feed to this function.
+ */
+ void
+ swap(unordered_multimap& __x)
+ { _M_h.swap(__x._M_h); }
+
+ // observers.
+
+ /// Returns the hash functor object with which the %unordered_multimap
+ /// was constructed.
+ hasher
+ hash_function() const
+ { return _M_h.hash_function(); }
+
+ /// Returns the key comparison object with which the %unordered_multimap
+ /// was constructed.
+ key_equal
+ key_eq() const
+ { return _M_h.key_eq(); }
+
+ // lookup.
+
+ //@{
+ /**
+ * @brief Tries to locate an element in an %unordered_multimap.
+ * @param __x Key to be located.
+ * @return Iterator pointing to sought-after element, or end() if not
+ * found.
+ *
+ * This function takes a key and tries to locate the element with which
+ * the key matches. If successful the function returns an iterator
+ * pointing to the sought after element. If unsuccessful it returns the
+ * past-the-end ( @c end() ) iterator.
+ */
+ iterator
+ find(const key_type& __x)
+ { return _M_h.find(__x); }
+
+ const_iterator
+ find(const key_type& __x) const
+ { return _M_h.find(__x); }
+ //@}
+
+ /**
+ * @brief Finds the number of elements.
+ * @param __x Key to count.
+ * @return Number of elements with specified key.
+ */
+ size_type
+ count(const key_type& __x) const
+ { return _M_h.count(__x); }
+
+ //@{
+ /**
+ * @brief Finds a subsequence matching given key.
+ * @param __x Key to be located.
+ * @return Pair of iterators that possibly points to the subsequence
+ * matching given key.
+ */
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __x)
+ { return _M_h.equal_range(__x); }
+
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& __x) const
+ { return _M_h.equal_range(__x); }
+ //@}
+
+ // bucket interface.
+
+ /// Returns the number of buckets of the %unordered_multimap.
+ size_type
+ bucket_count() const noexcept
+ { return _M_h.bucket_count(); }
+
+ /// Returns the maximum number of buckets of the %unordered_multimap.
+ size_type
+ max_bucket_count() const noexcept
+ { return _M_h.max_bucket_count(); }
+
+ /*
+ * @brief Returns the number of elements in a given bucket.
+ * @param __n A bucket index.
+ * @return The number of elements in the bucket.
+ */
+ size_type
+ bucket_size(size_type __n) const
+ { return _M_h.bucket_size(__n); }
+
+ /*
+ * @brief Returns the bucket index of a given element.
+ * @param __key A key instance.
+ * @return The key bucket index.
+ */
+ size_type
+ bucket(const key_type& __key) const
+ { return _M_h.bucket(__key); }
+
+ /**
+ * @brief Returns a read/write iterator pointing to the first bucket
+ * element.
+ * @param __n The bucket index.
+ * @return A read/write local iterator.
+ */
+ local_iterator
+ begin(size_type __n)
+ { return _M_h.begin(__n); }
+
+ //@{
+ /**
+ * @brief Returns a read-only (constant) iterator pointing to the first
+ * bucket element.
+ * @param __n The bucket index.
+ * @return A read-only local iterator.
+ */
+ const_local_iterator
+ begin(size_type __n) const
+ { return _M_h.begin(__n); }
+
+ const_local_iterator
+ cbegin(size_type __n) const
+ { return _M_h.cbegin(__n); }
+ //@}
+
+ /**
+ * @brief Returns a read/write iterator pointing to one past the last
+ * bucket elements.
+ * @param __n The bucket index.
+ * @return A read/write local iterator.
+ */
+ local_iterator
+ end(size_type __n)
+ { return _M_h.end(__n); }
+
+ //@{
+ /**
+ * @brief Returns a read-only (constant) iterator pointing to one past
+ * the last bucket elements.
+ * @param __n The bucket index.
+ * @return A read-only local iterator.
+ */
+ const_local_iterator
+ end(size_type __n) const
+ { return _M_h.end(__n); }
+
+ const_local_iterator
+ cend(size_type __n) const
+ { return _M_h.cend(__n); }
+ //@}
+
+ // hash policy.
+
+ /// Returns the average number of elements per bucket.
+ float
+ load_factor() const noexcept
+ { return _M_h.load_factor(); }
+
+ /// Returns a positive number that the %unordered_multimap tries to keep
+ /// the load factor less than or equal to.
+ float
+ max_load_factor() const noexcept
+ { return _M_h.max_load_factor(); }
+
+ /**
+ * @brief Change the %unordered_multimap maximum load factor.
+ * @param __z The new maximum load factor.
+ */
+ void
+ max_load_factor(float __z)
+ { _M_h.max_load_factor(__z); }
+
+ /**
+ * @brief May rehash the %unordered_multimap.
+ * @param __n The new number of buckets.
+ *
+ * Rehash will occur only if the new number of buckets respect the
+ * %unordered_multimap maximum load factor.
+ */
+ void
+ rehash(size_type __n)
+ { _M_h.rehash(__n); }
+
+ /**
+ * @brief Prepare the %unordered_multimap for a specified number of
+ * elements.
+ * @param __n Number of elements required.
+ *
+ * Same as rehash(ceil(n / max_load_factor())).
+ */
+ void
+ reserve(size_type __n)
+ { _M_h.reserve(__n); }
+
+ template<typename _Key1, typename _Tp1, typename _Hash1, typename _Pred1,
+ typename _Alloc1>
+ friend bool
+ operator==(const unordered_multimap<_Key1, _Tp1,
+ _Hash1, _Pred1, _Alloc1>&,
+ const unordered_multimap<_Key1, _Tp1,
+ _Hash1, _Pred1, _Alloc1>&);
};
template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
@@ -212,7 +1379,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
inline bool
operator==(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
- { return __x._M_equal(__y); }
+ { return __x._M_h._M_equal(__y._M_h); }
template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
inline bool
@@ -224,7 +1391,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
inline bool
operator==(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
- { return __x._M_equal(__y); }
+ { return __x._M_h._M_equal(__y._M_h); }
template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
inline bool
diff --git a/libstdc++-v3/include/bits/unordered_set.h b/libstdc++-v3/include/bits/unordered_set.h
index a822a886ff7..c3eaa48f5da 100644
--- a/libstdc++-v3/include/bits/unordered_set.h
+++ b/libstdc++-v3/include/bits/unordered_set.h
@@ -158,29 +158,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: _M_h(__f, __l, __n, __hf, __eql, __a)
{ }
- /**
- * @brief %Unordered_set copy constructor.
- * @param __x An %unordered_set of identical element and allocator
- * types.
- *
- * The newly-created %unordered_set uses a copy of the allocation object
- * used by @a __x.
- */
- unordered_set(const unordered_set& __x)
- : _M_h(__x._M_h) { }
+ /// Copy constructor.
+ unordered_set(const unordered_set&) = default;
- /**
- * @brief %Unordered_set move constructor
- * @param __x An %unordered_set of identical element and allocator
- * types.
- *
- * The newly-created %unordered_set contains the exact contents of @a
- * __x. The contents of @a __x are a valid, but unspecified
- * %unordered_set.
- */
- unordered_set(unordered_set&& __x)
- : _M_h(std::move(__x._M_h))
- { }
+ /// Move constructor.
+ unordered_set(unordered_set&&) = default;
/**
* @brief Builds an %unordered_set from an initializer_list.
@@ -201,35 +183,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: _M_h(__l, __n, __hf, __eql, __a)
{ }
- /**
- * @brief %Unordered_set assignment operator.
- * @param __x An %unordered_set of identical element and allocator
- * types.
- *
- * All the elements of @a __x are copied, but unlike the copy
- * constructor, the allocator object is not copied.
- */
+ /// Copy assignment operator.
unordered_set&
- operator=(const unordered_set& __x)
- {
- _M_h = __x._M_h;
- return *this;
- }
+ operator=(const unordered_set&) = default;
- /**
- * @brief %Unordered_set move assignment operator.
- * @param __x An %unordered_set of identical element and allocator
- * types.
- *
- * The contents of @a __x are moved into this %unordered_set (without
- * copying). @a __x is a valid, but unspecified %unordered_set.
- */
+ /// Move assignment operator.
unordered_set&
- operator=(unordered_set&& __x)
- {
- _M_h = std::move(__x._M_h);
- return *this;
- }
+ operator=(unordered_set&&) = default;
/**
* @brief %Unordered_set list assignment operator.
@@ -330,7 +290,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
*
* This function attempts to build and insert an element into the
* %unordered_set. An %unordered_set relies on unique keys and thus an
- * element is only inserted if it is not already present in the %set.
+ * element is only inserted if it is not already present in the
+ * %unordered_set.
*
* Insertion requires amortized constant time.
*/
@@ -802,29 +763,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: _M_h(__f, __l, __n, __hf, __eql, __a)
{ }
- /**
- * @brief %Unordered_multiset copy constructor.
- * @param __x An %unordered_multiset of identical element and allocator
- * types.
- *
- * The newly-created %unordered_multiset uses a copy of the allocation object
- * used by @a __x.
- */
- unordered_multiset(const unordered_multiset& __x)
- : _M_h(__x._M_h) { }
+ /// Copy constructor.
+ unordered_multiset(const unordered_multiset&) = default;
- /**
- * @brief %Unordered_multiset move constructor
- * @param __x An %unordered_multiset of identical element and allocator
- * types.
- *
- * The newly-created %unordered_multiset contains the exact contents of
- * @a __x. The contents of @a __x are a valid, but unspecified
- * %unordered_multiset.
- */
- unordered_multiset(unordered_multiset&& __x)
- : _M_h(std::move(__x._M_h))
- { }
+ /// Move constructor.
+ unordered_multiset(unordered_multiset&&) = default;
/**
* @brief Builds an %unordered_multiset from an initializer_list.
@@ -845,36 +788,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: _M_h(__l, __n, __hf, __eql, __a)
{ }
- /**
- * @brief %Unordered_multiset assignment operator.
- * @param __x An %unordered_multiset of identical element and allocator
- * types.
- *
- * All the elements of @a __x are copied, but unlike the copy
- * constructor, the allocator object is not copied.
- */
+ /// Copy assignment operator.
unordered_multiset&
- operator=(const unordered_multiset& __x)
- {
- _M_h = __x._M_h;
- return *this;
- }
+ operator=(const unordered_multiset&) = default;
- /**
- * @brief %Unordered_multiset move assignment operator.
- * @param __x An %unordered_multiset of identical element and allocator
- * types.
- *
- * The contents of @a __x are moved into this %unordered_multiset
- * (without copying). @a __x is a valid, but unspecified
- * %unordered_multiset.
- */
+ /// Move assignment operator.
unordered_multiset&
- operator=(unordered_multiset&& __x)
- {
- _M_h = std::move(__x._M_h);
- return *this;
- }
+ operator=(unordered_multiset&& __x) = default;
/**
* @brief %Unordered_multiset list assignment operator.
diff --git a/libstdc++-v3/include/debug/unordered_map b/libstdc++-v3/include/debug/unordered_map
index b03772d4cae..16cf1768e42 100644
--- a/libstdc++-v3/include/debug/unordered_map
+++ b/libstdc++-v3/include/debug/unordered_map
@@ -482,7 +482,7 @@ namespace __debug
inline bool
operator==(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
- { return __x._M_equal(__y); }
+ { return __x._M_base() == __y._M_base(); }
template<typename _Key, typename _Tp, typename _Hash,
typename _Pred, typename _Alloc>
@@ -929,7 +929,7 @@ namespace __debug
inline bool
operator==(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
- { return __x._M_equal(__y); }
+ { return __x._M_base() == __y._M_base(); }
template<typename _Key, typename _Tp, typename _Hash,
typename _Pred, typename _Alloc>
diff --git a/libstdc++-v3/include/profile/unordered_map b/libstdc++-v3/include/profile/unordered_map
index 266e804fe36..3663ab58aa9 100644
--- a/libstdc++-v3/include/profile/unordered_map
+++ b/libstdc++-v3/include/profile/unordered_map
@@ -330,7 +330,7 @@ namespace __profile
inline bool
operator==(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
- { return __x._M_equal(__y); }
+ { return static_cast<const _GLIBCXX_STD_BASE&>(__x) == __y; }
template<typename _Key, typename _Tp, typename _Hash,
typename _Pred, typename _Alloc>
@@ -599,7 +599,7 @@ namespace __profile
inline bool
operator==(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
- { return __x._M_equal(__y); }
+ { return static_cast<const _GLIBCXX_STD_BASE&>(__x) == __y; }
template<typename _Key, typename _Tp, typename _Hash,
typename _Pred, typename _Alloc>
diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py
index 0eac413bf4a..07a5ee62f35 100644
--- a/libstdc++-v3/python/libstdcxx/v6/printers.py
+++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -633,8 +633,13 @@ class Tr1UnorderedSetPrinter:
self.typename = typename
self.val = val
+ def hashtable (self):
+ if self.typename.startswith('std::tr1'):
+ return self.val
+ return self.val['_M_h']
+
def to_string (self):
- return '%s with %d elements' % (self.typename, self.val['_M_element_count'])
+ return '%s with %d elements' % (self.typename, self.hashtable()['_M_element_count'])
@staticmethod
def format_count (i):
@@ -642,7 +647,7 @@ class Tr1UnorderedSetPrinter:
def children (self):
counter = itertools.imap (self.format_count, itertools.count())
- return itertools.izip (counter, Tr1HashtableIterator (self.val))
+ return itertools.izip (counter, Tr1HashtableIterator (self.hashtable()))
class Tr1UnorderedMapPrinter:
"Print a tr1::unordered_map"
@@ -651,8 +656,13 @@ class Tr1UnorderedMapPrinter:
self.typename = typename
self.val = val
+ def hashtable (self):
+ if self.typename.startswith('std::tr1'):
+ return self.val
+ return self.val['_M_h']
+
def to_string (self):
- return '%s with %d elements' % (self.typename, self.val['_M_element_count'])
+ return '%s with %d elements' % (self.typename, self.hashtable()['_M_element_count'])
@staticmethod
def flatten (list):
@@ -671,7 +681,7 @@ class Tr1UnorderedMapPrinter:
def children (self):
counter = itertools.imap (self.format_count, itertools.count())
# Map over the hash table and flatten the result.
- data = self.flatten (itertools.imap (self.format_one, Tr1HashtableIterator (self.val)))
+ data = self.flatten (itertools.imap (self.format_one, Tr1HashtableIterator (self.hashtable())))
# Zip the two iterators together.
return itertools.izip (counter, data)
diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/cons/55123.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/cons/55123.cc
new file mode 100644
index 00000000000..35b517e8863
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/shared_ptr/cons/55123.cc
@@ -0,0 +1,30 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2012 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/>.
+
+#include <memory>
+
+// libstdc++/55123
+
+#include <memory>
+
+void f() {
+ std::unique_ptr<const int> y;
+ std::shared_ptr<const int> x = std::move(y);
+}