summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrus <rus@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-09 20:58:24 +0000
committerrus <rus@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-09 20:58:24 +0000
commit7f4db7c80779ecbc57d1146654daf0acfe18de66 (patch)
tree3af522a3b5e149c3fd498ecb1255994daae2129a
parent611349f0ec42a37591db2cd02974a11a48d10edb (diff)
downloadgcc-profile-stdlib.tar.gz
merge from trunkprofile-stdlib
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/profile-stdlib@154052 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog112
-rw-r--r--MAINTAINERS17
-rw-r--r--Makefile.def7
-rw-r--r--Makefile.in1006
-rw-r--r--Makefile.tpl6
-rw-r--r--README10
-rwxr-xr-xconfig.sub7
-rw-r--r--config/ChangeLog4
-rw-r--r--config/acx.m42
-rwxr-xr-xconfigure933
-rw-r--r--configure.ac211
-rw-r--r--contrib/ChangeLog6
-rwxr-xr-xcontrib/gcc_update3
-rw-r--r--fixincludes/ChangeLog6
-rw-r--r--fixincludes/fixincl.x10
-rw-r--r--fixincludes/inclhack.def13
-rw-r--r--fixincludes/tests/base/stdint.h13
-rw-r--r--gcc/ChangeLog3971
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in135
-rw-r--r--gcc/ada/ChangeLog475
-rw-r--r--gcc/ada/Makefile.rtl3
-rw-r--r--gcc/ada/a-direct.adb7
-rw-r--r--gcc/ada/a-ngelfu.adb19
-rw-r--r--gcc/ada/a-ngrear.adb6
-rw-r--r--gcc/ada/a-reatim.adb15
-rw-r--r--gcc/ada/a-rttiev.adb8
-rw-r--r--gcc/ada/a-ststio.adb6
-rw-r--r--gcc/ada/a-textio.adb156
-rw-r--r--gcc/ada/a-textio.ads50
-rw-r--r--gcc/ada/a-tideau.adb7
-rw-r--r--gcc/ada/a-tideio.adb1
-rwxr-xr-xgcc/ada/a-tirsfi.adb39
-rwxr-xr-xgcc/ada/a-tirsfi.ads40
-rw-r--r--[-rwxr-xr-x]gcc/ada/a-wichun.adb0
-rw-r--r--[-rwxr-xr-x]gcc/ada/a-wichun.ads0
-rw-r--r--[-rwxr-xr-x]gcc/ada/a-widcha.ads0
-rw-r--r--gcc/ada/a-witeio.adb153
-rw-r--r--gcc/ada/a-witeio.ads53
-rw-r--r--gcc/ada/a-wrstfi.adb39
-rw-r--r--gcc/ada/a-wrstfi.ads41
-rw-r--r--gcc/ada/a-wtdeio.adb10
-rw-r--r--gcc/ada/a-wtedit.adb34
-rwxr-xr-xgcc/ada/a-zrstfi.adb39
-rwxr-xr-xgcc/ada/a-zrstfi.ads41
-rw-r--r--gcc/ada/a-ztdeau.adb7
-rw-r--r--gcc/ada/a-ztdeio.adb10
-rw-r--r--gcc/ada/a-ztedit.adb19
-rw-r--r--gcc/ada/a-ztexio.adb147
-rw-r--r--gcc/ada/a-ztexio.ads68
-rw-r--r--gcc/ada/adaint.c565
-rw-r--r--gcc/ada/adaint.h51
-rw-r--r--gcc/ada/ali.adb2
-rw-r--r--gcc/ada/bcheck.adb2
-rw-r--r--gcc/ada/checks.adb9
-rw-r--r--gcc/ada/env.c5
-rw-r--r--gcc/ada/exp_aggr.adb10
-rw-r--r--gcc/ada/exp_attr.adb22
-rw-r--r--gcc/ada/exp_ch3.adb134
-rw-r--r--gcc/ada/exp_ch4.adb142
-rw-r--r--gcc/ada/exp_ch4.ads9
-rw-r--r--gcc/ada/exp_ch9.adb35
-rw-r--r--gcc/ada/exp_ch9.ads4
-rw-r--r--gcc/ada/exp_dbug.ads8
-rw-r--r--gcc/ada/gcc-interface/Make-lang.in451
-rw-r--r--gcc/ada/gcc-interface/Makefile.in17
-rw-r--r--gcc/ada/gcc-interface/ada-tree.h18
-rw-r--r--gcc/ada/gcc-interface/decl.c272
-rw-r--r--gcc/ada/gcc-interface/gigi.h34
-rw-r--r--gcc/ada/gcc-interface/misc.c5
-rw-r--r--gcc/ada/gcc-interface/trans.c164
-rw-r--r--gcc/ada/gcc-interface/utils.c136
-rw-r--r--gcc/ada/gcc-interface/utils2.c50
-rw-r--r--gcc/ada/gnat_rm.texi42
-rw-r--r--gcc/ada/gnat_ugn.texi40
-rw-r--r--gcc/ada/gnatbind.adb24
-rw-r--r--gcc/ada/gnatcmd.adb1
-rw-r--r--gcc/ada/gnatlink.adb19
-rw-r--r--gcc/ada/gnatname.adb1
-rw-r--r--gcc/ada/init.c16
-rw-r--r--gcc/ada/link.c15
-rw-r--r--gcc/ada/make.adb1272
-rw-r--r--gcc/ada/makeutl.adb35
-rw-r--r--gcc/ada/opt.ads7
-rw-r--r--gcc/ada/osint.adb448
-rw-r--r--gcc/ada/osint.ads83
-rw-r--r--gcc/ada/par-ch4.adb84
-rw-r--r--gcc/ada/prj-err.adb13
-rw-r--r--gcc/ada/prj-ext.adb5
-rw-r--r--gcc/ada/prj-nmsc.adb318
-rw-r--r--gcc/ada/prj-part.adb34
-rw-r--r--gcc/ada/prj-tree.adb5
-rw-r--r--gcc/ada/raise-gcc.c34
-rw-r--r--gcc/ada/s-crtl.ads3
-rw-r--r--gcc/ada/s-fileio.adb300
-rw-r--r--gcc/ada/s-fileio.ads74
-rwxr-xr-xgcc/ada/s-os_lib.adb68
-rwxr-xr-xgcc/ada/s-os_lib.ads23
-rw-r--r--gcc/ada/s-osinte-rtems.ads1
-rw-r--r--gcc/ada/s-stchop-rtems.adb5
-rw-r--r--gcc/ada/sem_aggr.adb141
-rw-r--r--gcc/ada/sem_attr.adb11
-rw-r--r--gcc/ada/sem_case.adb151
-rw-r--r--gcc/ada/sem_ch12.adb38
-rw-r--r--gcc/ada/sem_ch3.adb12
-rw-r--r--gcc/ada/sem_eval.adb2
-rw-r--r--gcc/ada/sem_prag.adb9
-rw-r--r--gcc/ada/sem_res.adb33
-rw-r--r--gcc/ada/sem_scil.adb9
-rw-r--r--gcc/ada/sem_type.adb53
-rw-r--r--gcc/ada/sem_util.adb175
-rw-r--r--gcc/ada/sem_util.ads9
-rw-r--r--gcc/ada/sem_warn.adb138
-rw-r--r--gcc/ada/sem_warn.ads5
-rw-r--r--gcc/ada/styleg.adb7
-rw-r--r--gcc/ada/switch-m.adb1
-rw-r--r--gcc/ada/tbuild.adb53
-rw-r--r--gcc/ada/tbuild.ads7
-rw-r--r--gcc/ada/types.ads2
-rw-r--r--gcc/ada/usage.adb2
-rw-r--r--gcc/ada/xsnamest.adb10
-rw-r--r--gcc/alias.c70
-rw-r--r--gcc/alloc-pool.c4
-rw-r--r--gcc/auto-inc-dec.c34
-rw-r--r--gcc/bb-reorder.c6
-rw-r--r--gcc/builtins.c110
-rw-r--r--gcc/c-common.c171
-rw-r--r--gcc/c-common.h32
-rw-r--r--gcc/c-decl.c135
-rw-r--r--gcc/c-lex.c18
-rw-r--r--gcc/c-parser.c44
-rw-r--r--gcc/c-ppoutput.c65
-rw-r--r--gcc/c-pragma.c44
-rw-r--r--gcc/c-pragma.h10
-rw-r--r--gcc/c-pretty-print.c12
-rw-r--r--gcc/c-tree.h4
-rw-r--r--gcc/c-typeck.c311
-rw-r--r--gcc/c.opt6
-rw-r--r--gcc/calls.c11
-rw-r--r--gcc/cfgcleanup.c26
-rw-r--r--gcc/cfgexpand.c176
-rw-r--r--gcc/cfgloop.h1
-rw-r--r--gcc/cfgloopmanip.c3
-rw-r--r--gcc/cgraph.c37
-rw-r--r--gcc/cgraph.h58
-rw-r--r--gcc/cgraphbuild.c40
-rw-r--r--gcc/cgraphunit.c102
-rw-r--r--gcc/collect2.c409
-rw-r--r--gcc/collect2.h2
-rw-r--r--gcc/combine.c218
-rw-r--r--gcc/common.opt29
-rw-r--r--gcc/config.gcc30
-rw-r--r--gcc/config.host2
-rw-r--r--gcc/config.in24
-rw-r--r--gcc/config/alpha/osf.h4
-rw-r--r--gcc/config/arm/arm.c427
-rw-r--r--gcc/config/arm/arm.h73
-rw-r--r--gcc/config/arm/arm.md120
-rw-r--r--gcc/config/arm/arm_neon.h100
-rw-r--r--gcc/config/arm/bpabi.h6
-rw-r--r--gcc/config/arm/cortex-a9.md186
-rw-r--r--gcc/config/arm/fpa.md4
-rw-r--r--gcc/config/arm/linux-eabi.h2
-rw-r--r--gcc/config/arm/linux-elf.h2
-rw-r--r--gcc/config/arm/neon-gen.ml3
-rw-r--r--gcc/config/arm/neon.md3
-rw-r--r--gcc/config/arm/neon.ml3
-rw-r--r--gcc/config/arm/netbsd-elf.h2
-rw-r--r--gcc/config/arm/thumb2.md10
-rw-r--r--gcc/config/arm/unwind-arm.c1
-rw-r--r--gcc/config/arm/vxworks.h2
-rw-r--r--gcc/config/avr/avr.c27
-rw-r--r--gcc/config/avr/avr.h2
-rw-r--r--gcc/config/avr/avr.md52
-rw-r--r--gcc/config/avr/avr.opt4
-rw-r--r--gcc/config/bfin/bfin.h3
-rw-r--r--gcc/config/cris/cris-protos.h2
-rw-r--r--gcc/config/cris/cris.c41
-rw-r--r--gcc/config/cris/cris.h27
-rw-r--r--gcc/config/cris/cris.md6
-rw-r--r--gcc/config/darwin.c11
-rw-r--r--gcc/config/darwin10.h5
-rw-r--r--gcc/config/fr30/fr30.h10
-rw-r--r--gcc/config/frv/frv-protos.h1
-rw-r--r--gcc/config/frv/frv.c38
-rw-r--r--gcc/config/frv/frv.h53
-rw-r--r--gcc/config/h8300/h8300.c60
-rw-r--r--gcc/config/h8300/h8300.h11
-rw-r--r--gcc/config/i386/cpuid.h4
-rw-r--r--gcc/config/i386/cygming.h5
-rw-r--r--gcc/config/i386/fma4intrin.h9
-rw-r--r--gcc/config/i386/i386-c.c4
-rw-r--r--gcc/config/i386/i386.c1082
-rw-r--r--gcc/config/i386/i386.h11
-rw-r--r--gcc/config/i386/i386.md3458
-rw-r--r--gcc/config/i386/i386.opt8
-rw-r--r--gcc/config/i386/ia32intrin.h2
-rw-r--r--gcc/config/i386/linux.h5
-rw-r--r--gcc/config/i386/linux64.h3
-rw-r--r--gcc/config/i386/lwpintrin.h109
-rw-r--r--gcc/config/i386/mingw.opt4
-rw-r--r--gcc/config/i386/mingw32.h2
-rw-r--r--gcc/config/i386/predicates.md4
-rw-r--r--gcc/config/i386/sol2-unwind.h208
-rw-r--r--gcc/config/i386/sol2.h2
-rw-r--r--gcc/config/i386/sse.md1541
-rw-r--r--gcc/config/i386/winnt-cxx.c160
-rw-r--r--gcc/config/i386/winnt.c37
-rw-r--r--gcc/config/i386/x86intrin.h16
-rw-r--r--gcc/config/i386/xopintrin.h771
-rw-r--r--gcc/config/ia64/ia64.c43
-rw-r--r--gcc/config/m32c/m32c-protos.h3
-rw-r--r--gcc/config/m32c/m32c.c35
-rw-r--r--gcc/config/m32c/m32c.h6
-rw-r--r--gcc/config/m68hc11/m68hc11.h3
-rw-r--r--gcc/config/m68k/m68k.c47
-rw-r--r--gcc/config/mep/mep.h2
-rw-r--r--gcc/config/mips/iris.h3
-rw-r--r--gcc/config/mips/mips-protos.h2
-rw-r--r--gcc/config/mips/mips.c415
-rw-r--r--gcc/config/mips/mips.h54
-rw-r--r--gcc/config/mips/mips.md89
-rw-r--r--gcc/config/mips/mips.opt4
-rw-r--r--gcc/config/mips/predicates.md4
-rw-r--r--gcc/config/mips/sdemtk.h4
-rw-r--r--gcc/config/mn10300/mn10300-protos.h3
-rw-r--r--gcc/config/mn10300/mn10300.c30
-rw-r--r--gcc/config/mn10300/mn10300.h24
-rw-r--r--gcc/config/moxie/moxie.h4
-rw-r--r--gcc/config/pa/pa.md25
-rw-r--r--gcc/config/pdp11/pdp11.h4
-rw-r--r--gcc/config/picochip/picochip.h2
-rw-r--r--gcc/config/rs6000/40x.md4
-rw-r--r--gcc/config/rs6000/440.md4
-rw-r--r--gcc/config/rs6000/476.md142
-rw-r--r--gcc/config/rs6000/603.md4
-rw-r--r--gcc/config/rs6000/6xx.md4
-rw-r--r--gcc/config/rs6000/7450.md4
-rw-r--r--gcc/config/rs6000/7xx.md4
-rw-r--r--gcc/config/rs6000/8540.md4
-rw-r--r--gcc/config/rs6000/a2.md134
-rw-r--r--gcc/config/rs6000/altivec.md2
-rw-r--r--gcc/config/rs6000/cell.md4
-rw-r--r--gcc/config/rs6000/e300c2c3.md4
-rw-r--r--gcc/config/rs6000/e500mc.md2
-rw-r--r--gcc/config/rs6000/mpc.md4
-rw-r--r--gcc/config/rs6000/option-defaults.h12
-rw-r--r--gcc/config/rs6000/power4.md4
-rw-r--r--gcc/config/rs6000/power5.md4
-rw-r--r--gcc/config/rs6000/power6.md7
-rw-r--r--gcc/config/rs6000/power7.md2
-rw-r--r--gcc/config/rs6000/predicates.md2
-rw-r--r--gcc/config/rs6000/rios1.md4
-rw-r--r--gcc/config/rs6000/rios2.md4
-rw-r--r--gcc/config/rs6000/rs6000-builtin.def990
-rw-r--r--gcc/config/rs6000/rs6000.c253
-rw-r--r--gcc/config/rs6000/rs6000.h999
-rw-r--r--gcc/config/rs6000/rs6000.md16
-rw-r--r--gcc/config/rs6000/rs6000.opt6
-rw-r--r--gcc/config/rs6000/rs64.md4
-rw-r--r--gcc/config/rs6000/t-fprules1
-rw-r--r--gcc/config/rs6000/t-rs60003
-rw-r--r--gcc/config/rs6000/vxworks.h4
-rw-r--r--gcc/config/rx/constraints.md81
-rw-r--r--gcc/config/rx/predicates.md288
-rw-r--r--gcc/config/rx/rx-protos.h52
-rw-r--r--gcc/config/rx/rx.c2517
-rw-r--r--gcc/config/rx/rx.h659
-rw-r--r--gcc/config/rx/rx.md1766
-rw-r--r--gcc/config/rx/rx.opt98
-rw-r--r--gcc/config/rx/t-rx32
-rw-r--r--gcc/config/s390/2097.md34
-rw-r--r--gcc/config/s390/fixdfdi.h462
-rw-r--r--gcc/config/s390/s390.c8
-rw-r--r--gcc/config/s390/s390.h6
-rw-r--r--gcc/config/s390/s390.md21
-rw-r--r--gcc/config/s390/t-linux3
-rw-r--r--gcc/config/s390/t-linux645
-rw-r--r--gcc/config/s390/t-tpf9
-rw-r--r--gcc/config/s390/tpf.h2
-rw-r--r--gcc/config/score/score.h3
-rw-r--r--gcc/config/sh/sh.c207
-rw-r--r--gcc/config/sh/sh.md13
-rw-r--r--gcc/config/sparc/sol2-unwind.h458
-rw-r--r--gcc/config/sparc/sol2.h2
-rw-r--r--gcc/config/spu/cache.S43
-rw-r--r--gcc/config/spu/cachemgr.c438
-rw-r--r--gcc/config/spu/spu-c.c11
-rw-r--r--gcc/config/spu/spu-elf.h10
-rw-r--r--gcc/config/spu/spu.c508
-rw-r--r--gcc/config/spu/spu.h20
-rw-r--r--gcc/config/spu/spu.opt21
-rw-r--r--gcc/config/spu/spu_cache.h39
-rw-r--r--gcc/config/spu/t-spu-elf33
-rw-r--r--gcc/config/stormy16/stormy16.h2
-rw-r--r--gcc/config/vax/linux.h12
-rwxr-xr-xgcc/configure205
-rw-r--r--gcc/configure.ac47
-rw-r--r--gcc/convert.c12
-rw-r--r--gcc/coretypes.h7
-rw-r--r--gcc/cp/ChangeLog393
-rw-r--r--gcc/cp/call.c89
-rw-r--r--gcc/cp/class.c70
-rw-r--r--gcc/cp/cp-lang.c3
-rw-r--r--gcc/cp/cp-tree.def2
-rw-r--r--gcc/cp/cp-tree.h51
-rw-r--r--gcc/cp/cvt.c1
-rw-r--r--gcc/cp/cxx-pretty-print.c6
-rw-r--r--gcc/cp/decl.c138
-rw-r--r--gcc/cp/decl2.c22
-rw-r--r--gcc/cp/error.c22
-rw-r--r--gcc/cp/mangle.c153
-rw-r--r--gcc/cp/method.c85
-rw-r--r--gcc/cp/name-lookup.c217
-rw-r--r--gcc/cp/optimize.c2
-rw-r--r--gcc/cp/parser.c159
-rw-r--r--gcc/cp/pt.c406
-rw-r--r--gcc/cp/rtti.c34
-rw-r--r--gcc/cp/search.c7
-rw-r--r--gcc/cp/semantics.c167
-rw-r--r--gcc/cp/tree.c34
-rw-r--r--gcc/cp/typeck.c18
-rw-r--r--gcc/cse.c4
-rw-r--r--gcc/cselib.c77
-rw-r--r--gcc/dbxout.c13
-rw-r--r--gcc/ddg.c4
-rw-r--r--gcc/debug.c16
-rw-r--r--gcc/debug.h31
-rw-r--r--gcc/defaults.h6
-rw-r--r--gcc/df-problems.c23
-rw-r--r--gcc/df-scan.c21
-rw-r--r--gcc/doc/contrib.texi4
-rw-r--r--gcc/doc/cpp.texi2
-rw-r--r--gcc/doc/extend.texi316
-rw-r--r--gcc/doc/install.texi52
-rw-r--r--gcc/doc/invoke.texi545
-rw-r--r--gcc/doc/md.texi78
-rw-r--r--gcc/doc/plugins.texi12
-rw-r--r--gcc/doc/rtl.texi10
-rw-r--r--gcc/doc/sourcebuild.texi56
-rw-r--r--gcc/doc/tm.texi203
-rw-r--r--gcc/dse.c23
-rw-r--r--gcc/dwarf2out.c682
-rw-r--r--gcc/emit-rtl.c89
-rw-r--r--gcc/emit-rtl.h3
-rw-r--r--gcc/except.c16
-rw-r--r--gcc/explow.c408
-rw-r--r--gcc/expmed.c31
-rw-r--r--gcc/expr.c218
-rw-r--r--gcc/expr.h32
-rw-r--r--gcc/final.c43
-rw-r--r--gcc/flags.h11
-rw-r--r--gcc/fold-const.c31
-rw-r--r--gcc/fortran/ChangeLog347
-rw-r--r--gcc/fortran/arith.c5
-rw-r--r--gcc/fortran/check.c12
-rw-r--r--gcc/fortran/decl.c121
-rw-r--r--gcc/fortran/expr.c3
-rw-r--r--gcc/fortran/gfortran.h30
-rw-r--r--gcc/fortran/interface.c10
-rw-r--r--gcc/fortran/intrinsic.texi14
-rw-r--r--gcc/fortran/io.c6
-rw-r--r--gcc/fortran/match.c169
-rw-r--r--gcc/fortran/module.c115
-rw-r--r--gcc/fortran/options.c4
-rw-r--r--gcc/fortran/parse.c59
-rw-r--r--gcc/fortran/parse.h1
-rw-r--r--gcc/fortran/resolve.c632
-rw-r--r--gcc/fortran/symbol.c39
-rw-r--r--gcc/fortran/trans-array.c51
-rw-r--r--gcc/fortran/trans-common.c5
-rw-r--r--gcc/fortran/trans-decl.c71
-rw-r--r--gcc/fortran/trans-expr.c312
-rw-r--r--gcc/fortran/trans-intrinsic.c2
-rw-r--r--gcc/fortran/trans-openmp.c5
-rw-r--r--gcc/fortran/trans-stmt.c157
-rw-r--r--gcc/fortran/trans-stmt.h1
-rw-r--r--gcc/fortran/trans.c14
-rw-r--r--gcc/fwprop.c9
-rw-r--r--gcc/gcc-plugin.h1
-rw-r--r--gcc/gcc.c144
-rw-r--r--gcc/gcse.c11
-rw-r--r--gcc/gengtype.c54
-rw-r--r--gcc/ggc-page.c60
-rw-r--r--gcc/gimple-iterator.c8
-rw-r--r--gcc/gimple-low.c75
-rw-r--r--gcc/gimple-pretty-print.c1
-rw-r--r--gcc/gimple.c1238
-rw-r--r--gcc/gimple.h19
-rw-r--r--gcc/gimplify.c50
-rw-r--r--gcc/graphite-sese-to-poly.c2
-rw-r--r--gcc/haifa-sched.c45
-rw-r--r--gcc/ifcvt.c22
-rw-r--r--gcc/input.h9
-rw-r--r--gcc/ipa-cp.c51
-rw-r--r--gcc/ipa-inline.c89
-rw-r--r--gcc/ipa-prop.c325
-rw-r--r--gcc/ipa-prop.h49
-rw-r--r--gcc/ipa-pure-const.c210
-rw-r--r--gcc/ipa-reference.c381
-rw-r--r--gcc/ipa-struct-reorg.c22
-rw-r--r--gcc/ipa.c126
-rw-r--r--gcc/ira-costs.c1
-rw-r--r--gcc/ira-lives.c15
-rw-r--r--gcc/ira.c9
-rw-r--r--gcc/java/ChangeLog11
-rw-r--r--gcc/java/config-lang.in2
-rw-r--r--gcc/java/mangle_name.c10
-rw-r--r--gcc/jump.c4
-rw-r--r--gcc/langhooks-def.h18
-rw-r--r--gcc/langhooks.c52
-rw-r--r--gcc/langhooks.h19
-rw-r--r--gcc/loop-invariant.c621
-rw-r--r--gcc/lto-cgraph.c687
-rw-r--r--gcc/lto-compress.c314
-rw-r--r--gcc/lto-compress.h42
-rw-r--r--gcc/lto-opts.c397
-rw-r--r--gcc/lto-section-in.c489
-rw-r--r--gcc/lto-section-out.c652
-rw-r--r--gcc/lto-streamer-in.c2741
-rw-r--r--gcc/lto-streamer-out.c2551
-rw-r--r--gcc/lto-streamer.c863
-rw-r--r--gcc/lto-streamer.h1046
-rw-r--r--gcc/lto-symtab.c676
-rw-r--r--gcc/lto-wpa-fixup.c281
-rw-r--r--gcc/lto-wrapper.c396
-rw-r--r--gcc/lto/ChangeLog2628
-rw-r--r--gcc/lto/Make-lang.in89
-rw-r--r--gcc/lto/common.c46
-rw-r--r--gcc/lto/common.h34
-rw-r--r--gcc/lto/config-lang.in32
-rw-r--r--gcc/lto/lang-specs.h24
-rw-r--r--gcc/lto/lang.opt43
-rw-r--r--gcc/lto/lto-elf.c729
-rw-r--r--gcc/lto/lto-lang.c1188
-rw-r--r--gcc/lto/lto-tree.h61
-rw-r--r--gcc/lto/lto.c2021
-rw-r--r--gcc/lto/lto.h60
-rw-r--r--gcc/optabs.c6
-rw-r--r--gcc/optc-gen.awk1
-rw-r--r--gcc/opts.c129
-rw-r--r--gcc/opts.h1
-rw-r--r--gcc/output.h1
-rw-r--r--gcc/params.def5
-rw-r--r--gcc/params.h2
-rw-r--r--gcc/passes.c324
-rw-r--r--gcc/plugin.c10
-rw-r--r--gcc/po/ChangeLog4
-rw-r--r--gcc/po/gcc.pot15570
-rw-r--r--gcc/print-rtl.c26
-rw-r--r--gcc/print-tree.c7
-rw-r--r--gcc/real.c2
-rw-r--r--gcc/real.h3
-rw-r--r--gcc/recog.c110
-rw-r--r--gcc/recog.h15
-rw-r--r--gcc/regcprop.c2
-rw-r--r--gcc/reginfo.c69
-rw-r--r--gcc/regmove.c33
-rw-r--r--gcc/reload.c108
-rw-r--r--gcc/reload.h2
-rw-r--r--gcc/reload1.c34
-rw-r--r--gcc/rtl.c26
-rw-r--r--gcc/rtl.def4
-rw-r--r--gcc/rtl.h25
-rw-r--r--gcc/rtlanal.c47
-rw-r--r--gcc/rtlhooks.c3
-rw-r--r--gcc/sched-deps.c143
-rw-r--r--gcc/sched-rgn.c6
-rw-r--r--gcc/sched-vis.c13
-rw-r--r--gcc/sdbout.c10
-rw-r--r--gcc/sel-sched-dump.c6
-rw-r--r--gcc/sel-sched-ir.h3
-rw-r--r--gcc/simplify-rtx.c127
-rw-r--r--gcc/stor-layout.c32
-rw-r--r--gcc/system.h2
-rw-r--r--gcc/target-def.h52
-rw-r--r--gcc/target.h52
-rw-r--r--gcc/targhooks.c120
-rw-r--r--gcc/targhooks.h14
-rw-r--r--gcc/testsuite/ChangeLog1793
-rw-r--r--gcc/testsuite/ada/acats/norun.lst8
-rwxr-xr-xgcc/testsuite/ada/acats/run_acats3
-rw-r--r--gcc/testsuite/c-c++-common/builtin-offsetof.c29
-rw-r--r--gcc/testsuite/c-c++-common/dfp/pr35620.c2
-rw-r--r--gcc/testsuite/c-c++-common/pr41935.c70
-rw-r--r--gcc/testsuite/c-c++-common/restrict-1.c (renamed from gcc/testsuite/gcc.dg/tree-ssa/restrict-1.c)0
-rw-r--r--gcc/testsuite/c-c++-common/restrict-2.c (renamed from gcc/testsuite/gcc.dg/tree-ssa/restrict-2.c)0
-rw-r--r--gcc/testsuite/c-c++-common/restrict-4.c (renamed from gcc/testsuite/gcc.dg/tree-ssa/restrict-4.c)0
-rw-r--r--gcc/testsuite/g++.dg/20090107-1.C12
-rw-r--r--gcc/testsuite/g++.dg/20090121-1.C19
-rw-r--r--gcc/testsuite/g++.dg/README1
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle32.C44
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle33.C19
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle34.C41
-rw-r--r--gcc/testsuite/g++.dg/abi/pragma-pack1.C37
-rw-r--r--gcc/testsuite/g++.dg/abi/regparm1.C40
-rw-r--r--gcc/testsuite/g++.dg/abi/rtti3.C1
-rw-r--r--gcc/testsuite/g++.dg/abi/thunk4.C1
-rw-r--r--gcc/testsuite/g++.dg/abi/thunk5.C13
-rw-r--r--gcc/testsuite/g++.dg/cpp/ucn-1.C13
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/auto3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype18.C5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/deduce.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/defaulted14.C18
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/defaulted15.C43
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/defaulted16.C13
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/explicit4.C17
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/fntmpdefarg1.C7
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/initlist25.C17
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/inline-ns1.C12
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/inline-ns2.C25
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/inline-ns3.C24
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const-neg.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv.C6
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-direct-init.C14
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-init.C8
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C18
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested2.C31
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-non-const.C1
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/linkage2.C (renamed from gcc/testsuite/g++.dg/other/linkage2.C)2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nolinkage1.C1
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/rv-deduce.C8
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/rv-reinterpret.C11
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/rv-return.C18
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/trailing1.C (renamed from gcc/testsuite/g++.dg/cpp0x/auto6.C)0
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/trailing2.C (renamed from gcc/testsuite/g++.dg/cpp0x/auto8.C)0
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/trailing3.C (renamed from gcc/testsuite/g++.dg/cpp0x/auto12.C)0
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/trailing4.C (renamed from gcc/testsuite/g++.dg/cpp0x/auto13.C)0
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/trailing5.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic-throw.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic95.C17
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic96.C26
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/vt-40092.C21
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/anonname1.C18
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/icf.C50
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/template-params-7.C21
-rw-r--r--gcc/testsuite/g++.dg/dg.exp1
-rw-r--r--gcc/testsuite/g++.dg/eh/pr41819.C21
-rw-r--r--gcc/testsuite/g++.dg/ext/altivec-2.C4
-rw-r--r--gcc/testsuite/g++.dg/ext/always_inline-5.C28
-rw-r--r--gcc/testsuite/g++.dg/ext/anon-struct4.C1
-rw-r--r--gcc/testsuite/g++.dg/ext/raw-string-1.C96
-rw-r--r--gcc/testsuite/g++.dg/ext/raw-string-2.C104
-rw-r--r--gcc/testsuite/g++.dg/ext/raw-string-3.C58
-rw-r--r--gcc/testsuite/g++.dg/ext/raw-string-4.C28
-rw-r--r--gcc/testsuite/g++.dg/ext/raw-string-5.C23
-rw-r--r--gcc/testsuite/g++.dg/ext/raw-string-6.C5
-rw-r--r--gcc/testsuite/g++.dg/ext/raw-string-7.C23
-rw-r--r--gcc/testsuite/g++.dg/ext/sync-3.C21
-rw-r--r--gcc/testsuite/g++.dg/ext/utf-badconcat2.C15
-rw-r--r--gcc/testsuite/g++.dg/ext/utf-dflt2.C12
-rw-r--r--gcc/testsuite/g++.dg/ext/utf8-1.C45
-rw-r--r--gcc/testsuite/g++.dg/ext/utf8-2.C21
-rw-r--r--gcc/testsuite/g++.dg/ext/visibility/namespace3.C6
-rw-r--r--gcc/testsuite/g++.dg/gomp/pr41967.C17
-rw-r--r--gcc/testsuite/g++.dg/init/static-init2.C3
-rw-r--r--gcc/testsuite/g++.dg/init/synth2.C17
-rw-r--r--gcc/testsuite/g++.dg/ipa/20090113-1.C25
-rw-r--r--gcc/testsuite/g++.dg/ipa/iinline-1.C2
-rw-r--r--gcc/testsuite/g++.dg/lookup/anon2.C6
-rw-r--r--gcc/testsuite/g++.dg/lookup/extern-c-redecl2.C21
-rw-r--r--gcc/testsuite/g++.dg/lookup/extern-c-redecl3.C23
-rw-r--r--gcc/testsuite/g++.dg/lookup/extern-c-redecl4.C18
-rw-r--r--gcc/testsuite/g++.dg/lookup/extern-c-redecl5.C18
-rw-r--r--gcc/testsuite/g++.dg/lookup/koenig5.C32
-rw-r--r--gcc/testsuite/g++.dg/lookup/koenig6.C18
-rw-r--r--gcc/testsuite/g++.dg/lookup/koenig7.C12
-rw-r--r--gcc/testsuite/g++.dg/lookup/using16.C2
-rw-r--r--gcc/testsuite/g++.dg/lookup/using22.C17
-rw-r--r--gcc/testsuite/g++.dg/lto/20080709_0.C11
-rw-r--r--gcc/testsuite/g++.dg/lto/20080829_0.C9
-rw-r--r--gcc/testsuite/g++.dg/lto/20080904_0.C37
-rw-r--r--gcc/testsuite/g++.dg/lto/20080907_0.C3
-rw-r--r--gcc/testsuite/g++.dg/lto/20080908-1_0.C36
-rw-r--r--gcc/testsuite/g++.dg/lto/20080908-2_0.C3
-rw-r--r--gcc/testsuite/g++.dg/lto/20080908-3_0.C14
-rw-r--r--gcc/testsuite/g++.dg/lto/20080909-1_0.C3
-rw-r--r--gcc/testsuite/g++.dg/lto/20080910-1_0.C2
-rw-r--r--gcc/testsuite/g++.dg/lto/20080912-1_0.C3
-rw-r--r--gcc/testsuite/g++.dg/lto/20080912_0.C4
-rw-r--r--gcc/testsuite/g++.dg/lto/20080915_0.C29
-rw-r--r--gcc/testsuite/g++.dg/lto/20080916_0.C12
-rw-r--r--gcc/testsuite/g++.dg/lto/20080917_0.C29
-rw-r--r--gcc/testsuite/g++.dg/lto/20080924_0.C16
-rw-r--r--gcc/testsuite/g++.dg/lto/20080926_0.C4
-rw-r--r--gcc/testsuite/g++.dg/lto/20081008_0.C36
-rw-r--r--gcc/testsuite/g++.dg/lto/20081022.h8
-rw-r--r--gcc/testsuite/g++.dg/lto/20081022_0.C11
-rw-r--r--gcc/testsuite/g++.dg/lto/20081022_1.C7
-rw-r--r--gcc/testsuite/g++.dg/lto/20081023_0.C14
-rw-r--r--gcc/testsuite/g++.dg/lto/20081109-1_0.C5
-rw-r--r--gcc/testsuite/g++.dg/lto/20081109-2_0.C15
-rw-r--r--gcc/testsuite/g++.dg/lto/20081109_0.C28
-rw-r--r--gcc/testsuite/g++.dg/lto/20081109_1.C4
-rw-r--r--gcc/testsuite/g++.dg/lto/20081118-1_0.C27
-rw-r--r--gcc/testsuite/g++.dg/lto/20081118-1_1.C12
-rw-r--r--gcc/testsuite/g++.dg/lto/20081118_0.C20
-rw-r--r--gcc/testsuite/g++.dg/lto/20081118_1.C20
-rw-r--r--gcc/testsuite/g++.dg/lto/20081119-1.h8
-rw-r--r--gcc/testsuite/g++.dg/lto/20081119-1_0.C12
-rw-r--r--gcc/testsuite/g++.dg/lto/20081119-1_1.C9
-rw-r--r--gcc/testsuite/g++.dg/lto/20081119_0.C24
-rw-r--r--gcc/testsuite/g++.dg/lto/20081119_1.C18
-rw-r--r--gcc/testsuite/g++.dg/lto/20081120-1_0.C10
-rw-r--r--gcc/testsuite/g++.dg/lto/20081120-1_1.C8
-rw-r--r--gcc/testsuite/g++.dg/lto/20081120-2_0.C13
-rw-r--r--gcc/testsuite/g++.dg/lto/20081120-2_1.C11
-rw-r--r--gcc/testsuite/g++.dg/lto/20081123_0.C8
-rw-r--r--gcc/testsuite/g++.dg/lto/20081123_1.C16
-rw-r--r--gcc/testsuite/g++.dg/lto/20081125.h15
-rw-r--r--gcc/testsuite/g++.dg/lto/20081125_0.C18
-rw-r--r--gcc/testsuite/g++.dg/lto/20081125_1.C7
-rw-r--r--gcc/testsuite/g++.dg/lto/20081127_0.C2
-rw-r--r--gcc/testsuite/g++.dg/lto/20081127_1.C3
-rw-r--r--gcc/testsuite/g++.dg/lto/20081203_0.C5
-rw-r--r--gcc/testsuite/g++.dg/lto/20081203_1.C4
-rw-r--r--gcc/testsuite/g++.dg/lto/20081204-1_0.C14
-rw-r--r--gcc/testsuite/g++.dg/lto/20081204-1_1.C3
-rw-r--r--gcc/testsuite/g++.dg/lto/20081204-2_0.C10
-rw-r--r--gcc/testsuite/g++.dg/lto/20081204-2_1.C14
-rw-r--r--gcc/testsuite/g++.dg/lto/20081209_0.C18
-rw-r--r--gcc/testsuite/g++.dg/lto/20081209_1.C9
-rw-r--r--gcc/testsuite/g++.dg/lto/20081211-1.h6
-rw-r--r--gcc/testsuite/g++.dg/lto/20081211-1_0.C19
-rw-r--r--gcc/testsuite/g++.dg/lto/20081211-1_1.C6
-rw-r--r--gcc/testsuite/g++.dg/lto/20081217-1_0.C28
-rw-r--r--gcc/testsuite/g++.dg/lto/20081217-2_0.C20
-rw-r--r--gcc/testsuite/g++.dg/lto/20081219_0.C72
-rw-r--r--gcc/testsuite/g++.dg/lto/20081219_1.C42
-rw-r--r--gcc/testsuite/g++.dg/lto/20090106_0.C203
-rw-r--r--gcc/testsuite/g++.dg/lto/20090112_0.C11
-rw-r--r--gcc/testsuite/g++.dg/lto/20090128_0.C88
-rw-r--r--gcc/testsuite/g++.dg/lto/20090221_0.C53
-rw-r--r--gcc/testsuite/g++.dg/lto/20090302_0.C9
-rw-r--r--gcc/testsuite/g++.dg/lto/20090302_1.C7
-rw-r--r--gcc/testsuite/g++.dg/lto/20090303_0.C22
-rw-r--r--gcc/testsuite/g++.dg/lto/20090311-1.h22
-rw-r--r--gcc/testsuite/g++.dg/lto/20090311-1_0.C34
-rw-r--r--gcc/testsuite/g++.dg/lto/20090311-1_1.C28
-rw-r--r--gcc/testsuite/g++.dg/lto/20090311_0.C13
-rw-r--r--gcc/testsuite/g++.dg/lto/20090311_1.C13
-rw-r--r--gcc/testsuite/g++.dg/lto/20090312.h2
-rw-r--r--gcc/testsuite/g++.dg/lto/20090312_0.C14
-rw-r--r--gcc/testsuite/g++.dg/lto/20090312_1.C21
-rw-r--r--gcc/testsuite/g++.dg/lto/20090313_0.C5
-rw-r--r--gcc/testsuite/g++.dg/lto/20090313_1.C12
-rw-r--r--gcc/testsuite/g++.dg/lto/20090315_0.C9
-rw-r--r--gcc/testsuite/g++.dg/lto/20090315_1.C7
-rw-r--r--gcc/testsuite/g++.dg/lto/20091002-1_0.C58
-rw-r--r--gcc/testsuite/g++.dg/lto/20091002-2_0.C20
-rw-r--r--gcc/testsuite/g++.dg/lto/20091002-3_0.C15
-rw-r--r--gcc/testsuite/g++.dg/lto/20091004-1_0.C35
-rw-r--r--gcc/testsuite/g++.dg/lto/20091004-1_1.C26
-rw-r--r--gcc/testsuite/g++.dg/lto/20091004-2_0.C29
-rw-r--r--gcc/testsuite/g++.dg/lto/20091004-2_1.C32
-rw-r--r--gcc/testsuite/g++.dg/lto/20091004-3_0.C18
-rw-r--r--gcc/testsuite/g++.dg/lto/20091004-3_1.C16
-rw-r--r--gcc/testsuite/g++.dg/lto/20091022-1_0.C13
-rw-r--r--gcc/testsuite/g++.dg/lto/20091022-2_0.C12
-rw-r--r--gcc/testsuite/g++.dg/lto/20091026-1_0.C11
-rw-r--r--gcc/testsuite/g++.dg/lto/20091026-1_1.C14
-rw-r--r--gcc/testsuite/g++.dg/lto/20091026-1_a.h9
-rw-r--r--gcc/testsuite/g++.dg/lto/README35
-rw-r--r--gcc/testsuite/g++.dg/lto/lto.exp58
-rw-r--r--gcc/testsuite/g++.dg/lto/pr40818_0.C11
-rw-r--r--gcc/testsuite/g++.dg/opt/eh5.C43
-rw-r--r--gcc/testsuite/g++.dg/opt/inline16.C19
-rw-r--r--gcc/testsuite/g++.dg/opt/thunk3-1.C6
-rw-r--r--gcc/testsuite/g++.dg/opt/thunk4.C63
-rw-r--r--gcc/testsuite/g++.dg/opt/vt1.C1
-rw-r--r--gcc/testsuite/g++.dg/other/anon3.C2
-rw-r--r--gcc/testsuite/g++.dg/other/first-global.C2
-rw-r--r--gcc/testsuite/g++.dg/other/i386-2.C5
-rw-r--r--gcc/testsuite/g++.dg/other/i386-3.C4
-rw-r--r--gcc/testsuite/g++.dg/other/i386-5.C4
-rw-r--r--gcc/testsuite/g++.dg/other/i386-6.C4
-rw-r--r--gcc/testsuite/g++.dg/other/i386-7.C8
-rw-r--r--gcc/testsuite/g++.dg/other/offsetof6.C26
-rw-r--r--gcc/testsuite/g++.dg/other/ptrmem10.C29
-rw-r--r--gcc/testsuite/g++.dg/other/ptrmem11.C21
-rw-r--r--gcc/testsuite/g++.dg/parse/attr-externally-visible-1.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/eh-decl.C8
-rw-r--r--gcc/testsuite/g++.dg/parse/error36.C17
-rw-r--r--gcc/testsuite/g++.dg/plugin/attribute_plugin-test-1.C2
-rw-r--r--gcc/testsuite/g++.dg/plugin/dumb_plugin.c2
-rw-r--r--gcc/testsuite/g++.dg/plugin/plugin.exp1
-rw-r--r--gcc/testsuite/g++.dg/plugin/pragma_plugin-test-1.C18
-rw-r--r--gcc/testsuite/g++.dg/plugin/pragma_plugin.c60
-rw-r--r--gcc/testsuite/g++.dg/plugin/selfassign.c2
-rw-r--r--gcc/testsuite/g++.dg/rtti/typeid9.C21
-rw-r--r--gcc/testsuite/g++.dg/template/arg2.C2
-rw-r--r--gcc/testsuite/g++.dg/template/crash56.C4
-rw-r--r--gcc/testsuite/g++.dg/template/error26.C2
-rw-r--r--gcc/testsuite/g++.dg/template/explicit-args2.C38
-rw-r--r--gcc/testsuite/g++.dg/template/explicit-args3.C12
-rw-r--r--gcc/testsuite/g++.dg/template/local4.C2
-rw-r--r--gcc/testsuite/g++.dg/template/nested3.C7
-rw-r--r--gcc/testsuite/g++.dg/template/overload11.C27
-rw-r--r--gcc/testsuite/g++.dg/template/partial6.C31
-rw-r--r--gcc/testsuite/g++.dg/template/scope3.C15
-rw-r--r--gcc/testsuite/g++.dg/template/sfinae15.C23
-rw-r--r--gcc/testsuite/g++.dg/template/sfinae16.C34
-rw-r--r--gcc/testsuite/g++.dg/template/sizeof12.C19
-rw-r--r--gcc/testsuite/g++.dg/template/spec35.C2
-rw-r--r--gcc/testsuite/g++.dg/torture/pr36191.C1
-rw-r--r--gcc/testsuite/g++.dg/torture/pr40323.C2
-rw-r--r--gcc/testsuite/g++.dg/torture/pr41680.C23
-rw-r--r--gcc/testsuite/g++.dg/torture/pr41775.C284
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/copyprop.C2
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/nothrow-1.C3
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/restrict1.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/operators32.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ns/koenig5.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/anon9.C5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/linkage1.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/linkage2.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/typename1.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/crash58.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/enum6.C2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr40556.c11
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr41182-1.c6
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr41634.c19
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr41646.c28
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr41661.c20
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr41728.c12
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/abs.c4
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/bfill.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/bzero.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/fprintf.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/memchr.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/memcmp.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/memmove.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/mempcpy.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/memset.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/printf.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/sprintf.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/stpcpy.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcat.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/strchr.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcmp.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcpy.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcspn.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/strlen.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/strncat.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/strncmp.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/strncpy.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/strpbrk.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/strrchr.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/strspn.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/strstr.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/execute.exp2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr40668.c9
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr41750.c68
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr41917.c21
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr41919.c39
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr41935.c25
-rw-r--r--gcc/testsuite/gcc.c-torture/unsorted/unsorted.exp2
-rw-r--r--gcc/testsuite/gcc.dg/20081223-1.c5
-rw-r--r--gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-vla-1.c10
-rw-r--r--gcc/testsuite/gcc.dg/autopar/outer-1.c33
-rw-r--r--gcc/testsuite/gcc.dg/autopar/outer-2.c33
-rw-r--r--gcc/testsuite/gcc.dg/autopar/outer-3.c33
-rw-r--r--gcc/testsuite/gcc.dg/autopar/outer-4.c37
-rw-r--r--gcc/testsuite/gcc.dg/autopar/outer-5.c50
-rw-r--r--gcc/testsuite/gcc.dg/autopar/outer-6.c51
-rw-r--r--gcc/testsuite/gcc.dg/cleanup-13.c319
-rw-r--r--gcc/testsuite/gcc.dg/cpp/include6.c14
-rw-r--r--gcc/testsuite/gcc.dg/cpp/separate-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/cpp/spacing1.c1
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/inline3.c22
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-1.c18
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-2.c9
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-3.c18
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-4.c9
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c14
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-6.c8
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr41543.c14
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr41695.c18
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr41264-1.c36
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr41343-1.c20
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr41717.c10
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr41893-1.c13
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr41893-2.c10
-rw-r--r--gcc/testsuite/gcc.dg/debug/vta-1.c34
-rw-r--r--gcc/testsuite/gcc.dg/debug/vta-2.c21
-rw-r--r--gcc/testsuite/gcc.dg/debug/vta-3.c17
-rw-r--r--gcc/testsuite/gcc.dg/guality/guality.exp77
-rw-r--r--gcc/testsuite/gcc.dg/guality/pr41447-1.c26
-rw-r--r--gcc/testsuite/gcc.dg/guality/pr41616-1.c20
-rw-r--r--gcc/testsuite/gcc.dg/inline-33.c2
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-5.c2
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-7.c2
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipacost-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/lto/20080908_0.c16
-rw-r--r--gcc/testsuite/gcc.dg/lto/20080917_0.c29
-rw-r--r--gcc/testsuite/gcc.dg/lto/20080924_0.c9
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081024_0.c26
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081109_0.c3
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081111_0.c11
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081111_1.c7
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081112_0.c14
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081112_1.c13
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081115_0.c32
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081115_1.c11
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081115_2.c5
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081118_0.c28
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081118_1.c13
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081118_2.c11
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081120-1_0.c5
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081120-1_1.c3
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081120-2_0.c3
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081120-2_1.c2
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081125_0.c6
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081125_1.c4
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081126_0.c8
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081201-1_0.c33
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081201-1_1.c13
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081201-1_2.c7
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081201-2_0.c16
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081201-2_1.c5
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081202-1_0.c11
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081202-1_1.c10
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081202-2_0.c13
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081202-2_1.c16
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081204-1_0.c7
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081204-1_1.c5
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081204-2_0.c5
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081210-1_0.c21
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081212-1_0.c4
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081222_0.c11
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081222_0.h1
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081222_1.c16
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081224_0.c9
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081224_0.h3
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081224_1.c2
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090116_0.c12
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090120_0.c14
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090126-1_0.c7
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090126-2_0.c7
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090206-1_0.c10
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090206-2_0.c18
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090210_0.c6
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090210_1.c22
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090213_0.c11
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090213_1.c6
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090218-1_0.c4
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090218-1_1.c9
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090218-2_0.c3
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090218-2_1.c19
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090218_0.c7
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090218_1.c6
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090218_2.c6
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090218_3.c3
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090219_0.c28
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090312_0.c43
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090312_1.c9
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090313_0.c9
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090706-1_0.c42
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090706-2_0.c16
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090717_0.c4
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090717_1.c11
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090729_0.c4
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090729_1.c4
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090812_0.c11
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090812_1.c26
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090914-1_0.c13
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090914-2_0.c12
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091005-1_0.c3
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091005-1_1.c2
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091005-2_0.c11
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091006-1_0.c14
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091006-1_1.c2
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091006-2_0.c4
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091006-2_1.c1
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091006-2_2.c1
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091013-1_0.c21
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091013-1_1.c111
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091013-1_2.c220
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091014-1_0.c4
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091015-1_0.c5
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091015-1_1.c4
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091015-1_2.c5
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091015-1_a.h2
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091015-1_b.h2
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091016-1_0.c13
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091016-1_1.c18
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091016-1_a.h6
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091017-1_0.c15
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091017-1_1.c6
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091020-1_0.c8
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091020-1_1.c15
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091020-2_0.c18
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091020-2_1.c5
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091020-3_0.c20
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091027-1_0.c11
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091027-1_1.c9
-rw-r--r--gcc/testsuite/gcc.dg/lto/README35
-rw-r--r--gcc/testsuite/gcc.dg/lto/lto.exp57
-rw-r--r--gcc/testsuite/gcc.dg/noncompile/pr40033-1.c7
-rw-r--r--gcc/testsuite/gcc.dg/plugin/one_time_plugin.c6
-rw-r--r--gcc/testsuite/gcc.dg/plugin/selfassign.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr41340.c68
-rw-r--r--gcc/testsuite/gcc.dg/pr41345.c14
-rw-r--r--gcc/testsuite/gcc.dg/pr41573.c15
-rw-r--r--gcc/testsuite/gcc.dg/pr41574.c15
-rw-r--r--gcc/testsuite/gcc.dg/pr41762.c31
-rw-r--r--gcc/testsuite/gcc.dg/pr41783.c20
-rw-r--r--gcc/testsuite/gcc.dg/pr41837.c38
-rw-r--r--gcc/testsuite/gcc.dg/pr41841.c22
-rw-r--r--gcc/testsuite/gcc.dg/pr41842.c8
-rw-r--r--gcc/testsuite/gcc.dg/pr41935.c25
-rw-r--r--gcc/testsuite/gcc.dg/pr41963.c36
-rw-r--r--gcc/testsuite/gcc.dg/raw-string-1.c101
-rw-r--r--gcc/testsuite/gcc.dg/raw-string-2.c109
-rw-r--r--gcc/testsuite/gcc.dg/raw-string-3.c53
-rw-r--r--gcc/testsuite/gcc.dg/raw-string-4.c28
-rw-r--r--gcc/testsuite/gcc.dg/raw-string-5.c23
-rw-r--r--gcc/testsuite/gcc.dg/raw-string-6.c5
-rw-r--r--gcc/testsuite/gcc.dg/raw-string-7.c23
-rw-r--r--gcc/testsuite/gcc.dg/tls/pie-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/torture/builtin-math-6.c49
-rw-r--r--gcc/testsuite/gcc.dg/torture/ipa-pta-1.c26
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr23821.c29
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr26515.c27
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr38948.c101
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr41555.c119
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/foldstring-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/inline-3.c3
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c30
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c3
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr41497.c27
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-23.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-24.c9
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c27
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/useless-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/utf-badconcat2.c15
-rw-r--r--gcc/testsuite/gcc.dg/utf-dflt2.c12
-rw-r--r--gcc/testsuite/gcc.dg/utf8-1.c45
-rw-r--r--gcc/testsuite/gcc.dg/utf8-2.c26
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-25.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-109.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-26.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-28.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-33.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-42.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-44.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-50.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-54.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-56.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-58.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-60.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-70.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-87.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-88.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-89.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-91.c3
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-92.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-93.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-95.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-96.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c8
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-thumb2-move.c98
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vfp-shift-a2t2.c27
-rw-r--r--gcc/testsuite/gcc.target/arm/pr40835.c55
-rw-r--r--gcc/testsuite/gcc.target/arm/thumb-bitfld1.c19
-rw-r--r--gcc/testsuite/gcc.target/arm/thumb-branch1.c11
-rw-r--r--gcc/testsuite/gcc.target/arm/thumb-ltu.c12
-rw-r--r--gcc/testsuite/gcc.target/avr/torture/pr41885.c123
-rw-r--r--gcc/testsuite/gcc.target/i386/brokensqrt.c29
-rw-r--r--gcc/testsuite/gcc.target/i386/cold-attribute-4.s41
-rw-r--r--gcc/testsuite/gcc.target/i386/i386.exp26
-rw-r--r--gcc/testsuite/gcc.target/i386/incoming-10.c19
-rw-r--r--gcc/testsuite/gcc.target/i386/incoming-11.c18
-rw-r--r--gcc/testsuite/gcc.target/i386/incoming-12.c20
-rw-r--r--gcc/testsuite/gcc.target/i386/incoming-13.c15
-rw-r--r--gcc/testsuite/gcc.target/i386/incoming-14.c15
-rw-r--r--gcc/testsuite/gcc.target/i386/incoming-15.c15
-rw-r--r--gcc/testsuite/gcc.target/i386/incoming-6.c17
-rw-r--r--gcc/testsuite/gcc.target/i386/incoming-7.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/incoming-8.c18
-rw-r--r--gcc/testsuite/gcc.target/i386/incoming-9.c18
-rw-r--r--gcc/testsuite/gcc.target/i386/math-torture/math-torture.exp2
-rw-r--r--gcc/testsuite/gcc.target/i386/ms_hook_prologue.c29
-rw-r--r--gcc/testsuite/gcc.target/i386/pic-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr37843-4.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/pr41900.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-12.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-13.c10
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-14.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-22.c14
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-23.c15
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-recip-vec.c3
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-recip.c3
-rw-r--r--gcc/testsuite/gcc.target/i386/xop-check.h20
-rw-r--r--gcc/testsuite/gcc.target/i386/xop-haddX.c206
-rw-r--r--gcc/testsuite/gcc.target/i386/xop-hadduX.c207
-rw-r--r--gcc/testsuite/gcc.target/i386/xop-hsubX.c128
-rw-r--r--gcc/testsuite/gcc.target/i386/xop-imul32widen-vector.c36
-rw-r--r--gcc/testsuite/gcc.target/i386/xop-imul64-vector.c36
-rw-r--r--gcc/testsuite/gcc.target/i386/xop-pcmov.c23
-rw-r--r--gcc/testsuite/gcc.target/i386/xop-pcmov2.c23
-rw-r--r--gcc/testsuite/gcc.target/i386/xop-rotate1-vector.c35
-rw-r--r--gcc/testsuite/gcc.target/i386/xop-rotate2-vector.c35
-rw-r--r--gcc/testsuite/gcc.target/i386/xop-rotate3-vector.c34
-rw-r--r--gcc/testsuite/gcc.target/i386/xop-shift1-vector.c35
-rw-r--r--gcc/testsuite/gcc.target/i386/xop-shift2-vector.c35
-rw-r--r--gcc/testsuite/gcc.target/i386/xop-shift3-vector.c35
-rw-r--r--gcc/testsuite/gcc.target/m68k/pr41302.c14
-rw-r--r--gcc/testsuite/gcc.target/mips/mips.exp1
-rw-r--r--gcc/testsuite/gcc.target/mips/mmcount-ra-address-1.c7
-rw-r--r--gcc/testsuite/gcc.target/mips/mmcount-ra-address-2.c8
-rw-r--r--gcc/testsuite/gcc.target/mips/mmcount-ra-address-3.c9
-rw-r--r--gcc/testsuite/gcc.target/mips/mult-1.c14
-rw-r--r--gcc/testsuite/gcc.target/mips/truncate-6.c12
-rw-r--r--gcc/testsuite/gcc.target/powerpc/altivec-33.c16
-rw-r--r--gcc/testsuite/gcc.target/powerpc/altivec-4.c4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vectorize-1.c (renamed from gcc/testsuite/gcc.target/vsx-vectorize-1.c)0
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vectorize-2.c (renamed from gcc/testsuite/gcc.target/vsx-vectorize-2.c)4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vectorize-3.c (renamed from gcc/testsuite/gcc.target/vsx-vectorize-3.c)0
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vectorize-4.c (renamed from gcc/testsuite/gcc.target/vsx-vectorize-4.c)4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vectorize-5.c (renamed from gcc/testsuite/gcc.target/vsx-vectorize-5.c)0
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vectorize-6.c (renamed from gcc/testsuite/gcc.target/vsx-vectorize-6.c)4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vectorize-7.c (renamed from gcc/testsuite/gcc.target/vsx-vectorize-7.c)4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vectorize-8.c (renamed from gcc/testsuite/gcc.target/vsx-vectorize-8.c)0
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vrsave.c20
-rw-r--r--gcc/testsuite/gcc.target/rx/builtins.c171
-rw-r--r--gcc/testsuite/gcc.target/rx/i272091.c27
-rw-r--r--gcc/testsuite/gcc.target/rx/interrupts.c58
-rw-r--r--gcc/testsuite/gcc.target/rx/packed-struct.c55
-rw-r--r--gcc/testsuite/gcc.target/rx/rx-abi-function-tests.c159
-rw-r--r--gcc/testsuite/gcc.target/rx/rx.exp43
-rw-r--r--gcc/testsuite/gcc.target/rx/zero-width-bitfield.c32
-rw-r--r--gcc/testsuite/gcc.target/spu/ea/cache1.c195
-rw-r--r--gcc/testsuite/gcc.target/spu/ea/cast1.c43
-rw-r--r--gcc/testsuite/gcc.target/spu/ea/cast2.c74
-rw-r--r--gcc/testsuite/gcc.target/spu/ea/compile1.c109
-rw-r--r--gcc/testsuite/gcc.target/spu/ea/compile2.c43
-rw-r--r--gcc/testsuite/gcc.target/spu/ea/cppdefine.c36
-rw-r--r--gcc/testsuite/gcc.target/spu/ea/ea.exp54
-rw-r--r--gcc/testsuite/gcc.target/spu/ea/errors1.c67
-rw-r--r--gcc/testsuite/gcc.target/spu/ea/errors2.c107
-rw-r--r--gcc/testsuite/gcc.target/spu/ea/execute1.c41
-rw-r--r--gcc/testsuite/gcc.target/spu/ea/execute2.c41
-rw-r--r--gcc/testsuite/gcc.target/spu/ea/execute3.c39
-rw-r--r--gcc/testsuite/gcc.target/spu/ea/ops1.c94
-rw-r--r--gcc/testsuite/gcc.target/spu/ea/ops2.c94
-rw-r--r--gcc/testsuite/gcc.target/spu/ea/options1.c22
-rw-r--r--gcc/testsuite/gcc.target/spu/ea/pr41857.c29
-rw-r--r--gcc/testsuite/gcc.target/spu/ea/test-sizes.c608
-rw-r--r--gcc/testsuite/gfortran.dg/allocatable_scalar_4.f9095
-rw-r--r--gcc/testsuite/gfortran.dg/associated_target_3.f9035
-rw-r--r--gcc/testsuite/gfortran.dg/assumed_charlen_function_6.f9037
-rw-r--r--gcc/testsuite/gfortran.dg/auto_dealloc_1.f9059
-rw-r--r--gcc/testsuite/gfortran.dg/block_2.f081
-rw-r--r--gcc/testsuite/gfortran.dg/class_10.f0332
-rw-r--r--gcc/testsuite/gfortran.dg/class_11.f0337
-rw-r--r--gcc/testsuite/gfortran.dg/class_12.f0345
-rw-r--r--gcc/testsuite/gfortran.dg/class_2.f035
-rw-r--r--gcc/testsuite/gfortran.dg/class_4a.f0314
-rw-r--r--gcc/testsuite/gfortran.dg/class_4b.f0315
-rw-r--r--gcc/testsuite/gfortran.dg/class_4c.f0328
-rw-r--r--gcc/testsuite/gfortran.dg/class_4d.f0315
-rw-r--r--gcc/testsuite/gfortran.dg/class_5.f0331
-rw-r--r--gcc/testsuite/gfortran.dg/class_6.f0321
-rw-r--r--gcc/testsuite/gfortran.dg/class_7.f0321
-rw-r--r--gcc/testsuite/gfortran.dg/class_8.f0316
-rw-r--r--gcc/testsuite/gfortran.dg/class_9.f0368
-rw-r--r--gcc/testsuite/gfortran.dg/class_allocate_1.f035
-rw-r--r--gcc/testsuite/gfortran.dg/class_allocate_2.f0323
-rw-r--r--gcc/testsuite/gfortran.dg/class_allocate_3.f0339
-rw-r--r--gcc/testsuite/gfortran.dg/class_allocate_4.f0323
-rw-r--r--gcc/testsuite/gfortran.dg/complex_intrinsic_8.f9050
-rw-r--r--gcc/testsuite/gfortran.dg/dynamic_dispatch_1.f0384
-rw-r--r--gcc/testsuite/gfortran.dg/dynamic_dispatch_2.f03105
-rw-r--r--gcc/testsuite/gfortran.dg/dynamic_dispatch_3.f0391
-rw-r--r--gcc/testsuite/gfortran.dg/dynamic_dispatch_4.f0396
-rw-r--r--gcc/testsuite/gfortran.dg/dynamic_dispatch_5.f03185
-rw-r--r--gcc/testsuite/gfortran.dg/equiv_8.f907
-rw-r--r--gcc/testsuite/gfortran.dg/extends_8.f0317
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_error_10.f29
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_error_9.f29
-rw-r--r--gcc/testsuite/gfortran.dg/goto_6.f24
-rw-r--r--gcc/testsuite/gfortran.dg/goto_7.f14
-rw-r--r--gcc/testsuite/gfortran.dg/goto_8.f9031
-rw-r--r--gcc/testsuite/gfortran.dg/guality/arg1.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/guality/guality.exp29
-rw-r--r--gcc/testsuite/gfortran.dg/guality/pr41558.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/intent_out_6.f9039
-rw-r--r--gcc/testsuite/gfortran.dg/interface_abstract_4.f9035
-rw-r--r--gcc/testsuite/gfortran.dg/lto/20091015-1_0.f8
-rw-r--r--gcc/testsuite/gfortran.dg/lto/20091015-1_1.f4
-rw-r--r--gcc/testsuite/gfortran.dg/lto/20091015-1_2.f5
-rw-r--r--gcc/testsuite/gfortran.dg/lto/20091016-1_0.f9012
-rw-r--r--gcc/testsuite/gfortran.dg/lto/20091028-1_0.f909
-rw-r--r--gcc/testsuite/gfortran.dg/lto/20091028-1_1.c11
-rw-r--r--gcc/testsuite/gfortran.dg/lto/20091028-2_0.f909
-rw-r--r--gcc/testsuite/gfortran.dg/lto/20091028-2_1.c11
-rw-r--r--gcc/testsuite/gfortran.dg/lto/lto.exp57
-rw-r--r--gcc/testsuite/gfortran.dg/lto/pr40724_0.f3
-rw-r--r--gcc/testsuite/gfortran.dg/lto/pr40724_1.f3
-rw-r--r--gcc/testsuite/gfortran.dg/lto/pr40725_0.f0316
-rw-r--r--gcc/testsuite/gfortran.dg/lto/pr40725_1.c12
-rw-r--r--gcc/testsuite/gfortran.dg/lto/pr41069_0.f907
-rw-r--r--gcc/testsuite/gfortran.dg/lto/pr41069_1.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/lto/pr41069_2.f909
-rw-r--r--gcc/testsuite/gfortran.dg/lto/pr41521_0.f909
-rw-r--r--gcc/testsuite/gfortran.dg/lto/pr41521_1.f909
-rw-r--r--gcc/testsuite/gfortran.dg/lto/pr41764_0.f13
-rw-r--r--gcc/testsuite/gfortran.dg/missing_optional_dummy_6.f9060
-rw-r--r--gcc/testsuite/gfortran.dg/module_md5_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/round_2.f0324
-rw-r--r--gcc/testsuite/gfortran.dg/same_type_as_2.f035
-rw-r--r--gcc/testsuite/gfortran.dg/select_type_1.f034
-rw-r--r--gcc/testsuite/gfortran.dg/select_type_5.f0347
-rw-r--r--gcc/testsuite/gfortran.dg/select_type_6.f0338
-rw-r--r--gcc/testsuite/gfortran.dg/select_type_7.f0340
-rw-r--r--gcc/testsuite/gfortran.dg/transfer_intrinsic_3.f9038
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_operator_2.f031
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_operator_4.f034
-rw-r--r--gcc/testsuite/gfortran.dg/vect/fast-math-pr38968.f901
-rw-r--r--gcc/testsuite/gfortran.dg/vect/vect-2.f909
-rw-r--r--gcc/testsuite/gfortran.dg/vect/vect-3.f906
-rw-r--r--gcc/testsuite/gfortran.dg/vect/vect-4.f905
-rw-r--r--gcc/testsuite/gfortran.dg/vect/vect-5.f905
-rw-r--r--gcc/testsuite/gfortran.dg/whole_file_5.f902
-rw-r--r--gcc/testsuite/gfortran.dg/whole_file_6.f902
-rw-r--r--gcc/testsuite/gfortran.fortran-torture/compile/pr41654.f9015
-rw-r--r--gcc/testsuite/gnat.dg/aggr11.adb17
-rw-r--r--gcc/testsuite/gnat.dg/aggr11_pkg.ads14
-rw-r--r--gcc/testsuite/gnat.dg/discr21.adb34
-rw-r--r--gcc/testsuite/gnat.dg/discr21.ads5
-rw-r--r--gcc/testsuite/gnat.dg/discr21_pkg.ads19
-rw-r--r--gcc/testsuite/gnat.dg/discr22.adb23
-rw-r--r--gcc/testsuite/gnat.dg/loop_optimization7.adb16
-rw-r--r--gcc/testsuite/gnat.dg/loop_optimization7.ads9
-rw-r--r--gcc/testsuite/gnat.dg/loop_optimization7_pkg.ads10
-rw-r--r--gcc/testsuite/gnat.dg/nested_proc1.adb (renamed from gcc/testsuite/gnat.dg/nested_proc.adb)2
-rw-r--r--gcc/testsuite/gnat.dg/nested_proc2.adb30
-rw-r--r--gcc/testsuite/gnat.dg/noreturn1.adb15
-rw-r--r--gcc/testsuite/gnat.dg/noreturn1.ads8
-rw-r--r--gcc/testsuite/gnat.dg/noreturn2.adb23
-rw-r--r--gcc/testsuite/gnat.dg/noreturn2.ads8
-rw-r--r--gcc/testsuite/gnat.dg/null_pointer_deref1.adb21
-rw-r--r--gcc/testsuite/gnat.dg/null_pointer_deref2.adb28
-rw-r--r--gcc/testsuite/gnat.dg/opt3.adb11
-rw-r--r--gcc/testsuite/gnat.dg/opt3_pkg.ads5
-rw-r--r--gcc/testsuite/gnat.dg/opt4.adb22
-rw-r--r--gcc/testsuite/gnat.dg/opt5.adb21
-rw-r--r--gcc/testsuite/gnat.dg/pack14.adb16
-rw-r--r--gcc/testsuite/gnat.dg/slice8.adb13
-rw-r--r--gcc/testsuite/gnat.dg/slice8_pkg1.ads3
-rw-r--r--gcc/testsuite/gnat.dg/slice8_pkg2.ads23
-rw-r--r--gcc/testsuite/gnat.dg/slice8_pkg3.adb17
-rw-r--r--gcc/testsuite/gnat.dg/slice8_pkg3.ads11
-rw-r--r--gcc/testsuite/gnat.dg/specs/import_abstract.ads6
-rw-r--r--gcc/testsuite/gnat.dg/specs/pack4.ads12
-rw-r--r--gcc/testsuite/gnat.dg/specs/pack5.ads13
-rw-r--r--gcc/testsuite/gnat.dg/specs/rep_clause4.ads42
-rw-r--r--gcc/testsuite/gnat.dg/stack_check1.adb38
-rw-r--r--gcc/testsuite/gnat.dg/stack_check2.adb43
-rw-r--r--gcc/testsuite/gnat.dg/timer_cancel.adb38
-rw-r--r--gcc/testsuite/gnat.dg/unchecked_convert4.adb24
-rw-r--r--gcc/testsuite/lib/c-torture.exp9
-rw-r--r--gcc/testsuite/lib/gcc-dg.exp13
-rw-r--r--gcc/testsuite/lib/gcc-gdb-test.exp91
-rw-r--r--gcc/testsuite/lib/lto.exp511
-rw-r--r--gcc/testsuite/lib/target-supports.exp73
-rw-r--r--gcc/testsuite/lib/torture-options.exp10
-rw-r--r--gcc/testsuite/obj-c++.dg/bitfield-1.mm2
-rw-r--r--gcc/testsuite/obj-c++.dg/bitfield-4.mm2
-rw-r--r--gcc/testsuite/obj-c++.dg/layout-1.mm2
-rw-r--r--gcc/timevar.def9
-rw-r--r--gcc/tlink.c2
-rw-r--r--gcc/toplev.c21
-rw-r--r--gcc/toplev.h1
-rw-r--r--gcc/tree-cfg.c753
-rw-r--r--gcc/tree-chrec.h1
-rw-r--r--gcc/tree-complex.c4
-rw-r--r--gcc/tree-dump.c4
-rw-r--r--gcc/tree-eh.c204
-rw-r--r--gcc/tree-flow.h14
-rw-r--r--gcc/tree-inline.c9
-rw-r--r--gcc/tree-into-ssa.c29
-rw-r--r--gcc/tree-nested.c12
-rw-r--r--gcc/tree-optimize.c5
-rw-r--r--gcc/tree-parloops.c68
-rw-r--r--gcc/tree-pass.h31
-rw-r--r--gcc/tree-pretty-print.c18
-rw-r--r--gcc/tree-scalar-evolution.c15
-rw-r--r--gcc/tree-sra.c102
-rw-r--r--gcc/tree-ssa-address.c171
-rw-r--r--gcc/tree-ssa-alias.c93
-rw-r--r--gcc/tree-ssa-alias.h1
-rw-r--r--gcc/tree-ssa-dce.c29
-rw-r--r--gcc/tree-ssa-dom.c26
-rw-r--r--gcc/tree-ssa-forwprop.c8
-rw-r--r--gcc/tree-ssa-ifcombine.c6
-rw-r--r--gcc/tree-ssa-loop-im.c20
-rw-r--r--gcc/tree-ssa-loop-ivopts.c215
-rw-r--r--gcc/tree-ssa-math-opts.c126
-rw-r--r--gcc/tree-ssa-operands.c4
-rw-r--r--gcc/tree-ssa-pre.c104
-rw-r--r--gcc/tree-ssa-reassoc.c2
-rw-r--r--gcc/tree-ssa-sccvn.c4
-rw-r--r--gcc/tree-ssa-sink.c7
-rw-r--r--gcc/tree-ssa-structalias.c251
-rw-r--r--gcc/tree-ssa.c250
-rw-r--r--gcc/tree-ssanames.c2
-rw-r--r--gcc/tree-vect-data-refs.c36
-rw-r--r--gcc/tree-vect-stmts.c10
-rw-r--r--gcc/tree-vrp.c13
-rw-r--r--gcc/tree.c363
-rw-r--r--gcc/tree.def12
-rw-r--r--gcc/tree.h45
-rw-r--r--gcc/unwind-dw2.c20
-rw-r--r--gcc/var-tracking.c102
-rw-r--r--gcc/varasm.c59
-rw-r--r--gcc/varpool.c35
-rw-r--r--gcc/vmsdbgout.c15
-rw-r--r--include/ChangeLog48
-rw-r--r--include/dwarf2.h4
-rw-r--r--include/lto-symtab.h41
-rw-r--r--include/plugin-api.h298
-rw-r--r--include/splay-tree.h6
-rw-r--r--intl/ChangeLog6
-rw-r--r--intl/libgnuintl.h45
-rw-r--r--libada/ChangeLog8
-rw-r--r--libada/Makefile.in3
-rwxr-xr-xlibada/configure46
-rw-r--r--libada/configure.ac9
-rw-r--r--libcpp/ChangeLog34
-rw-r--r--libcpp/charset.c73
-rw-r--r--libcpp/directives.c10
-rw-r--r--libcpp/include/cpplib.h5
-rw-r--r--libcpp/include/line-map.h5
-rw-r--r--libcpp/internal.h4
-rw-r--r--libcpp/lex.c223
-rw-r--r--libcpp/line-map.c4
-rw-r--r--libcpp/macro.c3
-rw-r--r--libcpp/po/ChangeLog4
-rw-r--r--libcpp/po/cpplib.pot303
-rw-r--r--libffi/ChangeLog5
-rw-r--r--libffi/testsuite/libffi.call/testclosure.c70
-rw-r--r--libgcc/ChangeLog45
-rw-r--r--libgcc/config.host7
-rw-r--r--libgcc/config/i386/32/sfp-machine.h5
-rw-r--r--libgcc/config/rx/rx-abi-functions.c90
-rw-r--r--libgcc/config/rx/rx-abi.h235
-rw-r--r--libgcc/config/rx/t-rx44
-rw-r--r--libgcc/config/s390/32/_fixdfdi.c97
-rw-r--r--libgcc/config/s390/32/_fixsfdi.c93
-rw-r--r--libgcc/config/s390/32/_fixtfdi.c102
-rw-r--r--libgcc/config/s390/32/_fixunsdfdi.c94
-rw-r--r--libgcc/config/s390/32/_fixunssfdi.c90
-rw-r--r--libgcc/config/s390/32/_fixunstfdi.c97
-rw-r--r--libgcc/config/s390/32/t-floattodi5
-rw-r--r--libgcc/config/s390/libgcc-glibc.ver (renamed from gcc/config/s390/libgcc-glibc.ver)0
-rw-r--r--libgcc/config/s390/t-crtstuff (renamed from gcc/config/s390/t-crtstuff)5
-rw-r--r--libgcc/config/s390/t-linux7
-rw-r--r--libgcc/config/s390/t-tpf8
-rw-r--r--libgfortran/ChangeLog131
-rw-r--r--libgfortran/Makefile.am5
-rw-r--r--libgfortran/Makefile.in9
-rw-r--r--libgfortran/intrinsics/iso_c_binding.c13
-rw-r--r--libgfortran/intrinsics/unpack_generic.c20
-rw-r--r--libgfortran/io/close.c1
-rw-r--r--libgfortran/io/fbuf.c4
-rw-r--r--libgfortran/io/fbuf.h81
-rw-r--r--libgfortran/io/file_pos.c2
-rw-r--r--libgfortran/io/format.c39
-rw-r--r--libgfortran/io/format.h118
-rw-r--r--libgfortran/io/inquire.c1
-rw-r--r--libgfortran/io/intrinsics.c2
-rw-r--r--libgfortran/io/io.h288
-rw-r--r--libgfortran/io/list_read.c2
-rw-r--r--libgfortran/io/open.c2
-rw-r--r--libgfortran/io/read.c1
-rw-r--r--libgfortran/io/transfer.c3
-rw-r--r--libgfortran/io/unit.c3
-rw-r--r--libgfortran/io/unix.c1
-rw-r--r--libgfortran/io/unix.h169
-rw-r--r--libgfortran/io/write.c265
-rw-r--r--libgfortran/io/write_float.def19
-rw-r--r--libgfortran/libgfortran.h14
-rw-r--r--libgomp/ChangeLog17
-rw-r--r--libgomp/acinclude.m42
-rwxr-xr-xlibgomp/configure21
-rw-r--r--libgomp/configure.ac7
-rw-r--r--libgomp/testsuite/libgomp.graphite/force-parallel-2.c2
-rw-r--r--libiberty/ChangeLog14
-rw-r--r--libiberty/argv.c44
-rw-r--r--libiberty/testsuite/test-expandargv.c34
-rw-r--r--libjava/ChangeLog13
-rw-r--r--libjava/classpath/ChangeLog7
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jar/Creator.classbin7259 -> 6001 bytes
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/jar/Creator.java11
-rwxr-xr-xlibjava/configure95
-rw-r--r--libjava/configure.ac31
-rw-r--r--libstdc++-v3/ChangeLog692
-rw-r--r--libstdc++-v3/acinclude.m440
-rw-r--r--libstdc++-v3/config.h.in4
-rw-r--r--libstdc++-v3/config/abi/pre/gnu.ver29
-rwxr-xr-xlibstdc++-v3/configure58
-rw-r--r--libstdc++-v3/configure.ac1
-rw-r--r--libstdc++-v3/doc/Makefile.am2
-rw-r--r--libstdc++-v3/doc/Makefile.in2
-rw-r--r--libstdc++-v3/doc/doxygen/doxygroups.cc7
-rw-r--r--libstdc++-v3/doc/doxygen/user.cfg.in15
-rw-r--r--libstdc++-v3/doc/html/api.html2
-rw-r--r--libstdc++-v3/doc/html/index.html2
-rw-r--r--libstdc++-v3/doc/html/manual/abi.html24
-rw-r--r--libstdc++-v3/doc/html/manual/algorithms.html2
-rw-r--r--libstdc++-v3/doc/html/manual/api.html4
-rw-r--r--libstdc++-v3/doc/html/manual/appendix_contributing.html8
-rw-r--r--libstdc++-v3/doc/html/manual/appendix_free.html2
-rw-r--r--libstdc++-v3/doc/html/manual/appendix_gpl.html4
-rw-r--r--libstdc++-v3/doc/html/manual/appendix_porting.html10
-rw-r--r--libstdc++-v3/doc/html/manual/backwards.html48
-rw-r--r--libstdc++-v3/doc/html/manual/bitmap_allocator.html6
-rw-r--r--libstdc++-v3/doc/html/manual/bitset.html2
-rw-r--r--libstdc++-v3/doc/html/manual/bk01ix01.html2
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt02pr01.html2
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch07s02.html4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch08.html4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt09pr02.html2
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt11ch27s03.html22
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt12ch30s03.html4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt12ch31s03.html8
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt12ch31s05.html4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt12ch32s02.html122
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt12ch32s03.html10
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt12ch32s04.html18
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt12ch32s05.html51
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt12ch32s06.html68
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt12ch32s07.html528
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt12ch34s02.html (renamed from libstdc++-v3/doc/html/manual/bk01pt12ch33s02.html)4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt12ch34s03.html (renamed from libstdc++-v3/doc/html/manual/bk01pt12ch33s03.html)4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt12ch41s02.html (renamed from libstdc++-v3/doc/html/manual/bk01pt12ch40s02.html)4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt12ch41s03.html (renamed from libstdc++-v3/doc/html/manual/bk01pt12ch40s03.html)4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt12pr03.html2
-rw-r--r--libstdc++-v3/doc/html/manual/bugs.html5
-rw-r--r--libstdc++-v3/doc/html/manual/codecvt.html24
-rw-r--r--libstdc++-v3/doc/html/manual/containers.html2
-rw-r--r--libstdc++-v3/doc/html/manual/debug.html42
-rw-r--r--libstdc++-v3/doc/html/manual/diagnostics.html4
-rw-r--r--libstdc++-v3/doc/html/manual/documentation_style.html6
-rw-r--r--libstdc++-v3/doc/html/manual/exceptions.html2
-rw-r--r--libstdc++-v3/doc/html/manual/ext_algorithms.html6
-rw-r--r--libstdc++-v3/doc/html/manual/ext_allocators.html6
-rw-r--r--libstdc++-v3/doc/html/manual/ext_concurrency.html6
-rw-r--r--libstdc++-v3/doc/html/manual/ext_containers.html6
-rw-r--r--libstdc++-v3/doc/html/manual/ext_demangling.html6
-rw-r--r--libstdc++-v3/doc/html/manual/ext_io.html6
-rw-r--r--libstdc++-v3/doc/html/manual/ext_iterators.html6
-rw-r--r--libstdc++-v3/doc/html/manual/ext_numerics.html6
-rw-r--r--libstdc++-v3/doc/html/manual/ext_utilities.html6
-rw-r--r--libstdc++-v3/doc/html/manual/extensions.html4
-rw-r--r--libstdc++-v3/doc/html/manual/facets.html20
-rw-r--r--libstdc++-v3/doc/html/manual/internals.html8
-rw-r--r--libstdc++-v3/doc/html/manual/intro.html4
-rw-r--r--libstdc++-v3/doc/html/manual/io.html2
-rw-r--r--libstdc++-v3/doc/html/manual/io_and_c.html2
-rw-r--r--libstdc++-v3/doc/html/manual/iterators.html2
-rw-r--r--libstdc++-v3/doc/html/manual/locales.html18
-rw-r--r--libstdc++-v3/doc/html/manual/localization.html2
-rw-r--r--libstdc++-v3/doc/html/manual/make.html4
-rw-r--r--libstdc++-v3/doc/html/manual/memory.html20
-rw-r--r--libstdc++-v3/doc/html/manual/messages.html20
-rw-r--r--libstdc++-v3/doc/html/manual/numerics.html2
-rw-r--r--libstdc++-v3/doc/html/manual/parallel_mode.html4
-rw-r--r--libstdc++-v3/doc/html/manual/profile_mode.html143
-rw-r--r--libstdc++-v3/doc/html/manual/setup.html2
-rw-r--r--libstdc++-v3/doc/html/manual/shared_ptr.html22
-rw-r--r--libstdc++-v3/doc/html/manual/spine.html12
-rw-r--r--libstdc++-v3/doc/html/manual/status.html40
-rw-r--r--libstdc++-v3/doc/html/manual/strings.html2
-rw-r--r--libstdc++-v3/doc/html/manual/support.html2
-rw-r--r--libstdc++-v3/doc/html/manual/test.html7
-rw-r--r--libstdc++-v3/doc/html/manual/using.html6
-rw-r--r--libstdc++-v3/doc/html/manual/using_exceptions.html321
-rw-r--r--libstdc++-v3/doc/html/manual/using_headers.html13
-rw-r--r--libstdc++-v3/doc/html/manual/utilities.html8
-rw-r--r--libstdc++-v3/doc/html/spine.html10
-rw-r--r--libstdc++-v3/doc/xml/authors.xml13
-rw-r--r--libstdc++-v3/doc/xml/manual/appendix_porting.xml5
-rw-r--r--libstdc++-v3/doc/xml/manual/codecvt.xml4
-rw-r--r--libstdc++-v3/doc/xml/manual/ctype.xml4
-rw-r--r--libstdc++-v3/doc/xml/manual/debug.xml50
-rw-r--r--libstdc++-v3/doc/xml/manual/diagnostics.xml5
-rw-r--r--libstdc++-v3/doc/xml/manual/intro.xml17
-rw-r--r--libstdc++-v3/doc/xml/manual/locale.xml4
-rw-r--r--libstdc++-v3/doc/xml/manual/messages.xml2
-rw-r--r--libstdc++-v3/doc/xml/manual/status_cxxtr24733.xml299
-rw-r--r--libstdc++-v3/doc/xml/manual/using.xml81
-rw-r--r--libstdc++-v3/doc/xml/manual/using_exceptions.xml579
-rw-r--r--libstdc++-v3/include/Makefile.am21
-rw-r--r--libstdc++-v3/include/Makefile.in57
-rw-r--r--libstdc++-v3/include/bits/atomic_0.h5
-rw-r--r--libstdc++-v3/include/bits/atomic_2.h5
-rw-r--r--libstdc++-v3/include/bits/basic_string.h13
-rw-r--r--libstdc++-v3/include/bits/c++config6
-rw-r--r--libstdc++-v3/include/bits/random.h144
-rw-r--r--libstdc++-v3/include/bits/shared_ptr.h1366
-rw-r--r--libstdc++-v3/include/bits/shared_ptr_base.h1114
-rw-r--r--libstdc++-v3/include/bits/stl_algo.h158
-rw-r--r--libstdc++-v3/include/bits/stl_algobase.h6
-rw-r--r--libstdc++-v3/include/bits/stl_iterator.h63
-rw-r--r--libstdc++-v3/include/bits/stl_iterator_base_funcs.h8
-rw-r--r--libstdc++-v3/include/bits/stl_iterator_base_types.h12
-rw-r--r--libstdc++-v3/include/bits/stl_pair.h28
-rw-r--r--libstdc++-v3/include/bits/stl_tempbuf.h4
-rw-r--r--libstdc++-v3/include/bits/stream_iterator.h7
-rw-r--r--libstdc++-v3/include/bits/streambuf_iterator.h7
-rw-r--r--libstdc++-v3/include/bits/valarray_array.h31
-rw-r--r--libstdc++-v3/include/c_compatibility/stdatomic.h7
-rw-r--r--libstdc++-v3/include/c_global/cassert2
-rw-r--r--libstdc++-v3/include/c_global/cctype2
-rw-r--r--libstdc++-v3/include/c_global/cerrno2
-rw-r--r--libstdc++-v3/include/c_global/cfloat2
-rw-r--r--libstdc++-v3/include/c_global/ciso6462
-rw-r--r--libstdc++-v3/include/c_global/climits2
-rw-r--r--libstdc++-v3/include/c_global/clocale2
-rw-r--r--libstdc++-v3/include/c_global/cmath2
-rw-r--r--libstdc++-v3/include/c_global/csetjmp2
-rw-r--r--libstdc++-v3/include/c_global/csignal2
-rw-r--r--libstdc++-v3/include/c_global/cstdarg2
-rw-r--r--libstdc++-v3/include/c_global/cstdatomic2
-rw-r--r--libstdc++-v3/include/c_global/cstddef2
-rw-r--r--libstdc++-v3/include/c_global/cstdio2
-rw-r--r--libstdc++-v3/include/c_global/cstdlib2
-rw-r--r--libstdc++-v3/include/c_global/cstring2
-rw-r--r--libstdc++-v3/include/c_global/ctime2
-rw-r--r--libstdc++-v3/include/c_global/cwchar2
-rw-r--r--libstdc++-v3/include/c_global/cwctype2
-rw-r--r--libstdc++-v3/include/decimal/decimal482
-rw-r--r--libstdc++-v3/include/decimal/decimal.h466
-rw-r--r--libstdc++-v3/include/ext/bitmap_allocator.h122
-rw-r--r--libstdc++-v3/include/parallel/balanced_quicksort.h753
-rw-r--r--libstdc++-v3/include/parallel/base.h650
-rw-r--r--libstdc++-v3/include/parallel/checkers.h7
-rw-r--r--libstdc++-v3/include/parallel/compatibility.h12
-rw-r--r--libstdc++-v3/include/parallel/equally_split.h99
-rw-r--r--libstdc++-v3/include/parallel/find.h633
-rw-r--r--libstdc++-v3/include/parallel/find_selectors.h97
-rw-r--r--libstdc++-v3/include/parallel/for_each.h36
-rw-r--r--libstdc++-v3/include/parallel/for_each_selectors.h52
-rw-r--r--libstdc++-v3/include/parallel/list_partition.h25
-rw-r--r--libstdc++-v3/include/parallel/losertree.h1728
-rw-r--r--libstdc++-v3/include/parallel/merge.h102
-rw-r--r--libstdc++-v3/include/parallel/multiseq_selection.h52
-rw-r--r--libstdc++-v3/include/parallel/multiway_merge.h3811
-rw-r--r--libstdc++-v3/include/parallel/multiway_mergesort.h747
-rw-r--r--libstdc++-v3/include/parallel/numeric4
-rw-r--r--libstdc++-v3/include/parallel/omp_loop.h100
-rw-r--r--libstdc++-v3/include/parallel/omp_loop_static.h74
-rw-r--r--libstdc++-v3/include/parallel/par_loop.h160
-rw-r--r--libstdc++-v3/include/parallel/partial_sum.h283
-rw-r--r--libstdc++-v3/include/parallel/partition.h726
-rw-r--r--libstdc++-v3/include/parallel/queue.h32
-rw-r--r--libstdc++-v3/include/parallel/quicksort.h56
-rw-r--r--libstdc++-v3/include/parallel/random_number.h4
-rw-r--r--libstdc++-v3/include/parallel/random_shuffle.h844
-rw-r--r--libstdc++-v3/include/parallel/search.h194
-rw-r--r--libstdc++-v3/include/parallel/set_operations.h841
-rw-r--r--libstdc++-v3/include/parallel/sort.h120
-rw-r--r--libstdc++-v3/include/parallel/tags.h64
-rw-r--r--libstdc++-v3/include/parallel/unique_copy.h279
-rw-r--r--libstdc++-v3/include/parallel/workstealing.h435
-rw-r--r--libstdc++-v3/include/precompiled/stdc++.h1
-rw-r--r--libstdc++-v3/include/profile/impl/profiler_hashtable_size.h2
-rw-r--r--libstdc++-v3/include/profile/impl/profiler_state.h2
-rw-r--r--libstdc++-v3/include/std/chrono70
-rw-r--r--libstdc++-v3/include/std/future700
-rw-r--r--libstdc++-v3/include/std/iosfwd59
-rw-r--r--libstdc++-v3/include/std/limits16
-rw-r--r--libstdc++-v3/include/std/memory28
-rw-r--r--libstdc++-v3/include/std/ostream4
-rw-r--r--libstdc++-v3/include/std/random1
-rw-r--r--libstdc++-v3/include/std/sstream4
-rw-r--r--libstdc++-v3/include/std/streambuf28
-rw-r--r--libstdc++-v3/include/std/system_error4
-rw-r--r--libstdc++-v3/include/std/tuple3
-rw-r--r--libstdc++-v3/include/std/type_traits51
-rw-r--r--libstdc++-v3/include/std/utility16
-rw-r--r--libstdc++-v3/include/tr1/shared_ptr.h82
-rw-r--r--libstdc++-v3/include/tr1_impl/boost_sp_counted_base.h4
-rw-r--r--libstdc++-v3/include/tr1_impl/regex18
-rw-r--r--libstdc++-v3/include/tr1_impl/type_traits1
-rw-r--r--libstdc++-v3/libsupc++/cxxabi.h6
-rw-r--r--libstdc++-v3/libsupc++/exception25
-rw-r--r--libstdc++-v3/libsupc++/nested_exception.h4
-rw-r--r--libstdc++-v3/libsupc++/tinfo.cc3
-rw-r--r--libstdc++-v3/libsupc++/tinfo2.cc3
-rw-r--r--libstdc++-v3/libsupc++/typeinfo9
-rw-r--r--libstdc++-v3/python/libstdcxx/v6/printers.py59
-rwxr-xr-xlibstdc++-v3/scripts/create_testsuite_files2
-rw-r--r--libstdc++-v3/src/atomic.cc8
-rw-r--r--libstdc++-v3/testsuite/20_util/duration/cons/1_neg.cc10
-rw-r--r--libstdc++-v3/testsuite/20_util/duration/cons/dr974.cc33
-rw-r--r--libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/is_convertible/requirements/explicit_instantiation.cc31
-rw-r--r--libstdc++-v3/testsuite/20_util/is_convertible/requirements/typedefs.cc36
-rw-r--r--libstdc++-v3/testsuite/20_util/is_convertible/value.cc102
-rw-r--r--libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc6
-rw-r--r--libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc6
-rw-r--r--libstdc++-v3/testsuite/20_util/pair/40925.cc67
-rw-r--r--libstdc++-v3/testsuite/20_util/tuple/cons/41530.cc34
-rw-r--r--libstdc++-v3/testsuite/20_util/unique_ptr/assign/assign_neg.cc11
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/fill_n/1.cc (renamed from libstdc++-v3/testsuite/25_algorithms/fill/5.cc)0
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/inplace_merge/moveable.cc52
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/inplace_merge/moveable2.cc56
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/rotate/moveable2.cc79
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/stable_partition/moveable.cc64
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/stable_sort/moveable.cc59
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/stable_sort/moveable2.cc62
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_copy.cc2
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_move.cc2
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/default.cc2
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed1.cc2
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed2.cc2
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed_seq.cc2
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/equal.cc2
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/serialize.cc2
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/requirements/typedefs.cc2
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/non_uint_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/29_atomics/atomic_flag/clear/1.c34
-rw-r--r--libstdc++-v3/testsuite/29_atomics/atomic_flag/clear/1.cc33
-rw-r--r--libstdc++-v3/testsuite/29_atomics/atomic_flag/cons/1.cc27
-rw-r--r--libstdc++-v3/testsuite/30_threads/packaged_task/cons/assign_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/30_threads/packaged_task/cons/copy_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/30_threads/promise/cons/assign_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/30_threads/promise/cons/copy_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_future/cons/assign_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/30_threads/unique_future/cons/assign_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/30_threads/unique_future/cons/copy_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/Makefile.in4
-rw-r--r--libstdc++-v3/testsuite/decimal/binary-arith.cc372
-rw-r--r--libstdc++-v3/testsuite/decimal/cast_neg.cc62
-rw-r--r--libstdc++-v3/testsuite/decimal/comparison.cc546
-rw-r--r--libstdc++-v3/testsuite/decimal/compound-assignment-memfunc.cc250
-rw-r--r--libstdc++-v3/testsuite/decimal/compound-assignment.cc248
-rw-r--r--libstdc++-v3/testsuite/decimal/conversion-from-float.cc101
-rw-r--r--libstdc++-v3/testsuite/decimal/conversion-from-integral.cc193
-rw-r--r--libstdc++-v3/testsuite/decimal/conversion-to-generic-float.cc105
-rw-r--r--libstdc++-v3/testsuite/decimal/conversion-to-integral.cc85
-rw-r--r--libstdc++-v3/testsuite/decimal/ctor.cc65
-rw-r--r--libstdc++-v3/testsuite/decimal/incdec-memfunc.cc181
-rw-r--r--libstdc++-v3/testsuite/decimal/incdec.cc179
-rw-r--r--libstdc++-v3/testsuite/decimal/make-decimal.cc132
-rw-r--r--libstdc++-v3/testsuite/decimal/mixed-mode_neg.cc206
-rw-r--r--libstdc++-v3/testsuite/decimal/operator_neg.cc160
-rw-r--r--libstdc++-v3/testsuite/decimal/unary-arith.cc93
-rw-r--r--libstdc++-v3/testsuite/ext/profile/mh.cc9
-rw-r--r--libstdc++-v3/testsuite/ext/profile/mutex_extensions.cc2
-rw-r--r--libstdc++-v3/testsuite/lib/dg-options.exp9
-rw-r--r--libstdc++-v3/testsuite/lib/libstdc++.exp55
-rw-r--r--libstdc++-v3/testsuite/libstdc++-dg/conformance.exp1
-rw-r--r--lto-plugin/ChangeLog433
-rw-r--r--lto-plugin/Makefile.am19
-rw-r--r--lto-plugin/Makefile.in682
-rw-r--r--lto-plugin/aclocal.m4979
-rwxr-xr-xlto-plugin/configure12814
-rw-r--r--lto-plugin/configure.ac14
-rw-r--r--lto-plugin/lto-plugin.c709
-rw-r--r--lto-plugin/lto-symtab.c359
-rw-r--r--maintainer-scripts/ChangeLog8
-rwxr-xr-xmaintainer-scripts/gcc_release2
-rwxr-xr-xmaintainer-scripts/update_web_docs_svn2
1588 files changed, 120625 insertions, 29178 deletions
diff --git a/ChangeLog b/ChangeLog
index 3fc53057096..600e9149f73 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,115 @@
+2009-11-06 Ozkan Sezer <sezeroz@gmail.com>
+
+ * configure.ac (FLAGS_FOR_TARGET): Add -L and -isystem
+ paths for *-w64-mingw* and x86_64-*mingw*.
+ * configure: Regenerated.
+
+2009-11-05 Joern Rennecke <amylaar@spamcop.net>
+
+ * MAINTAINERS (Write After Approval): Add entry for my INRIA work.
+
+2009-11-02 Benjamin Kosnik <bkoz@redhat.com>
+
+ * MAINTAINERS: Add Jonathan Wakely under Various Maintainers, move
+ Phil Edwards to Write-After Approval.
+
+2009-10-30 Kai Tietz <kai.tietz@onevision.com>
+
+ * configure.ac: Disable target-winsup & co for
+ x86_64-*-mingw* and *-w64-mingw* targets.
+ * configure: Regenerated.
+
+2009-10-16 Nick Clifton <nickc@redhat.com>
+
+ * MAINTAINERS: Add myself as a maintainer for the RX port.
+
+2009-10-26 Johannes Singler <singler@kit.edu>
+
+ * MAINTAINERS (Write After Approval): Update my e-mail address.
+
+2009-10-23 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.ac (CLooG test): Use = with test.
+ * configure: Regenerate.
+
+2009-10-22 Richard Guenther <rguenther@suse.de>
+
+ * configure.ac: Do not set LIBS for ppl/cloog checks. Disable
+ cloog if the ppl version check failed. Move flags saving
+ before setting in libelf check.
+ * configure: Regenerate.
+
+2009-10-21 Richard Guenther <rguenther@suse.de>
+
+ * configure.ac: Adjust the ppl and cloog configure to work as
+ documented. Disable cloog if ppl was disabled. Omit the version
+ checks if they were disabled.
+ * configure: Re-generate.
+
+2009-10-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * configure.ac: Add 'lto' to enable_languages, not
+ new_enable_languages, and only if not already present.
+ * configure: Regenerate.
+
+2009-10-10 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * README: Refer to the various COPYING* files instead of just
+ COPYING.
+ Refer to http://gcc.gnu.org/bugs/ for bug reporting instructions.
+
+2009-10-07 Rafael Avila de Espindola <espindola@google.com>
+
+ * MAINTAINERS: Change my email address. Change plugi-in to plugin.
+
+2009-10-07 Richard Guenther <rguenther@suse.de>
+
+ * MAINTAINERS (LTO): List Diego Novillo, Rafael Avila de Espindola,
+ and Richard Guenther as reviewers.
+ (LTO plugin): List Rafael Avila de Espindola and Cary Coutant
+ as reviewers.
+
+2009-10-07 Hariharan Sandanagobalane <hariharan@picochip.com>
+
+ * config.sub: Update from upstream sources.
+
+2009-10-06 Ian Lance Taylor <iant@google.com>
+
+ * Makefile.def: check-gold depends upon all-gas.
+ * Makefile.in: Rebuild.
+
+2009-10-05 Phil Muldoon <pmuldoon@redhat.com>
+
+ * MAINTAINERS (Write After Approval): Add myself.
+
+2009-10-03 2009-02-05 Rafael Avila de Espindola <espindola@google.com>
+
+ * Makefile.def: all-lto-plugin depends on all-libiberty.
+ set bootstrap=true for lto-plugin.
+ Add lto-plugin.
+ * Makefile.in: Regenerate.
+ * configure.ac (host_libs): Add lto-plugin.
+ * configure: Regenerate.
+
+2009-10-03 Diego Novillo <dnovillo@google.com>
+
+ * Makefile.tpl (HOST_EXPORTS): Add LIBELFLIBS and LIBELFINC.
+ (HOST_LIBELFLIBS): Define.
+ (HOST_LIBELFINC): Define.
+ * Makefile.in: Regenerate.
+ * configure.ac: Add --enable-lto.
+ Add --with-libelf, --with-libelf-include and --with-libelf-lib.
+ If --enable-lto is used, add 'lto' to new_enable_languages.
+ If --enable-lto is used and gold is enabled, add
+ lto-plugin to configdirs.
+ * configure: Regenerate.
+
+2009-10-03 Simon Baldwin <simonb@google.com>
+
+ * configure.ac: If --with-system-zlib, suppress local zlib and
+ pass --with-system-zlib to subdir configure scripts.
+ * configure: Regenerate.
+
2009-10-01 Loren J. Rittle <ljrittle@acm.org>
Paolo Bonzini <bonzini@gnu.org>
diff --git a/MAINTAINERS b/MAINTAINERS
index 483ca638e6c..033eb896c23 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -82,6 +82,7 @@ picochip port Daniel Towner dant@picochip.com
rs6000 port Geoff Keating geoffk@geoffk.org
rs6000 port David Edelsohn edelsohn@gnu.org
rs6000 vector extns Aldy Hernandez aldyh@redhat.com
+rx port Nick Clifton nickc@redhat.com
s390 port Hartmut Penner hpenner@de.ibm.com
s390 port Ulrich Weigand uweigand@de.ibm.com
s390 port Andreas Krebbel Andreas.Krebbel@de.ibm.com
@@ -170,9 +171,9 @@ dwarf debugging code Jason Merrill jason@redhat.com
c++ runtime libs Paolo Carlini paolo.carlini@oracle.com
c++ runtime libs Gabriel Dos Reis gdr@integrable-solutions.net
c++ runtime libs Ulrich Drepper drepper@redhat.com
-c++ runtime libs Phil Edwards pme@gcc.gnu.org
c++ runtime libs Benjamin Kosnik bkoz@redhat.com
c++ runtime libs Loren J. Rittle ljrittle@acm.org
+c++ runtime libs Jonathan Wakely redi@gcc.gnu.org
*synthetic multiply Torbjorn Granlund tege@swox.com
*c-torture Torbjorn Granlund tege@swox.com
fixincludes Bruce Korb bkorb@gnu.org
@@ -263,11 +264,16 @@ Fortran Janus Weil janus@gcc.gnu.org
Graphite Daniel Berlin dberlin@dberlin.org
Graphite Tobias Grosser grosser@fim.uni-passau.de
Graphite Sebastian Pop sebastian.pop@amd.com
-Plug-in Rafael Espíndola rafael.espindola@gmail.com
+Plugin Rafael Espíndola espindola@google.com
register allocation Peter Bergner bergner@vnet.ibm.com
register allocation Vladimir Makarov vmakarov@redhat.com
register allocation Kenneth Zadeck zadeck@naturalbridge.com
register allocation Seongbae Park seongbae.park@gmail.com
+LTO Diego Novillo dnovillo@google.com
+LTO Richard Guenther rguenther@suse.de
+LTO Rafael Espíndola espindola@google.com
+LTO plugin Rafael Espíndola espindola@google.com
+LTO plugin Cary Coutant ccoutant@google.com
Note that while reviewers can approve changes to parts of the compiler
that they maintain, they still need approval for their own patches
@@ -318,6 +324,7 @@ Bud Davis jmdavis@link.com
Chris Demetriou cgd@google.com
Benoit Dupont de Dinechin benoit.dupont-de-dinechin@st.com
Michael Eager eager@eagercon.com
+Phil Edwards pme@gcc.gnu.org
Mohan Embar gnustuff@thisiscool.com
Revital Eres eres@il.ibm.com
Marc Espie espie@cvs.openbsd.org
@@ -410,6 +417,7 @@ Alexander Monakov amonakov@ispras.ru
Catherine Moore clm@codesourcery.com
James A. Morrison phython@gcc.gnu.org
Dirk Mueller dmueller@suse.de
+Phil Muldoon pmuldoon@redhat.com
Adam Nemet anemet@caviumnetworks.com
Thomas Neumann tneumann@users.sourceforge.net
Dan Nicolaescu dann@ics.uci.edu
@@ -430,6 +438,7 @@ Dwarakanath Rajagopal dwarak.rajagopal@amd.com
Ramana Radhakrishnan ramana.r@gmail.com
Rolf Rasmussen rolfwr@gcc.gnu.org
Volker Reichelt v.reichelt@netcologne.de
+Joern Rennecke amylaar@spamcop.net
Bernhard Reutner-Fischer rep.dot.nop@gmail.com
Tom Rix trix@redhat.com
Craig Rodrigues rodrigc@gcc.gnu.org
@@ -445,9 +454,10 @@ Svein Seldal svein@dev.seldal.com
Thiemo Seufer ths@networkno.de
Mark Shinwell shinwell@codesourcery.com
Ghassan Shobaki ghassan.shobaki@amd.com
-Johannes Singler singler@ira.uka.de
+Johannes Singler singler@kit.edu
Franz Sirl franz.sirl-kernel@lauterbach.com
Jan Sjodin jan.sjodin@amd.com
+Edward Smith-Rowland 3dw4rd@verizon.net
Michael Sokolov msokolov@ivan.Harhan.ORG
Richard Stallman rms@gnu.org
Basile Starynkevitch basile@starynkevitch.net
@@ -463,7 +473,6 @@ Caroline Tice ctice@apple.com
David Ung davidu@mips.com
Neil Vachharajani nvachhar@gmail.com
Kris Van Hees kris.van.hees@oracle.com
-Jonathan Wakely redi@gcc.gnu.org
Feng Wang fengwang@nudt.edu.cn
Stephen M. Webb stephen.webb@bregmasoft.com
John Wehle john@feith.com
diff --git a/Makefile.def b/Makefile.def
index 5834232f133..5541a67433e 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -97,7 +97,8 @@ host_modules= { module= ld; bootstrap=true; };
host_modules= { module= libcpp; bootstrap=true; };
host_modules= { module= libdecnumber; bootstrap=true; };
host_modules= { module= libgui; };
-host_modules= { module= libiberty; bootstrap=true; };
+host_modules= { module= libiberty; bootstrap=true;
+ extra_configure_flags='@extra_host_libiberty_configure_flags@';};
// We abuse missing to avoid installing anything for libiconv.
host_modules= { module= libiconv;
extra_configure_flags='--disable-shared';
@@ -141,6 +142,7 @@ host_modules= { module= libtermcap; no_check=true;
missing=maintainer-clean; };
host_modules= { module= utils; no_check=true; };
host_modules= { module= gnattools; };
+host_modules= { module= lto-plugin; bootstrap=true; };
target_modules = { module= libstdc++-v3;
bootstrap=true;
@@ -346,6 +348,8 @@ dependencies = { module=all-fixincludes; on=all-libiberty; };
dependencies = { module=all-gnattools; on=all-target-libada; };
+dependencies = { module=all-lto-plugin; on=all-libiberty; };
+
dependencies = { module=configure-mpfr; on=all-gmp; };
dependencies = { module=configure-mpc; on=all-mpfr; };
dependencies = { module=configure-ppl; on=all-gmp; };
@@ -424,6 +428,7 @@ dependencies = { module=all-gold; on=all-bfd; };
dependencies = { module=all-gold; on=all-build-bison; };
dependencies = { module=all-gold; on=all-build-byacc; };
dependencies = { module=check-gold; on=all-binutils; };
+dependencies = { module=check-gold; on=all-gas; };
dependencies = { module=configure-opcodes; on=configure-intl; };
dependencies = { module=all-opcodes; on=all-bfd; };
diff --git a/Makefile.in b/Makefile.in
index 4f8691113e3..afff42e2601 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -219,6 +219,8 @@ HOST_EXPORTS = \
PPLINC="$(HOST_PPLINC)"; export PPLINC; \
CLOOGLIBS="$(HOST_CLOOGLIBS)"; export CLOOGLIBS; \
CLOOGINC="$(HOST_CLOOGINC)"; export CLOOGINC; \
+ LIBELFLIBS="$(HOST_LIBELFLIBS)" ; export LIBELFLIBS; \
+ LIBELFINC="$(HOST_LIBELFINC)" ; export LIBELFINC; \
@if gcc-bootstrap
$(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
@endif gcc-bootstrap
@@ -293,6 +295,10 @@ HOST_PPLINC = @pplinc@
HOST_CLOOGLIBS = @clooglibs@
HOST_CLOOGINC = @clooginc@
+# Where to find libelf
+HOST_LIBELFLIBS = @libelflibs@
+HOST_LIBELFINC = @libelfinc@
+
# ----------------------------------------------
# Programs producing files for the BUILD machine
# ----------------------------------------------
@@ -854,7 +860,8 @@ configure-host: \
maybe-configure-tk \
maybe-configure-libtermcap \
maybe-configure-utils \
- maybe-configure-gnattools
+ maybe-configure-gnattools \
+ maybe-configure-lto-plugin
.PHONY: configure-target
configure-target: \
maybe-configure-target-libstdc++-v3 \
@@ -1026,6 +1033,9 @@ all-host: maybe-all-tk
all-host: maybe-all-libtermcap
all-host: maybe-all-utils
all-host: maybe-all-gnattools
+@if lto-plugin-no-bootstrap
+all-host: maybe-all-lto-plugin
+@endif lto-plugin-no-bootstrap
.PHONY: all-target
@@ -1147,6 +1157,7 @@ info-host: maybe-info-tk
info-host: maybe-info-libtermcap
info-host: maybe-info-utils
info-host: maybe-info-gnattools
+info-host: maybe-info-lto-plugin
.PHONY: info-target
@@ -1259,6 +1270,7 @@ dvi-host: maybe-dvi-tk
dvi-host: maybe-dvi-libtermcap
dvi-host: maybe-dvi-utils
dvi-host: maybe-dvi-gnattools
+dvi-host: maybe-dvi-lto-plugin
.PHONY: dvi-target
@@ -1371,6 +1383,7 @@ pdf-host: maybe-pdf-tk
pdf-host: maybe-pdf-libtermcap
pdf-host: maybe-pdf-utils
pdf-host: maybe-pdf-gnattools
+pdf-host: maybe-pdf-lto-plugin
.PHONY: pdf-target
@@ -1483,6 +1496,7 @@ html-host: maybe-html-tk
html-host: maybe-html-libtermcap
html-host: maybe-html-utils
html-host: maybe-html-gnattools
+html-host: maybe-html-lto-plugin
.PHONY: html-target
@@ -1595,6 +1609,7 @@ TAGS-host: maybe-TAGS-tk
TAGS-host: maybe-TAGS-libtermcap
TAGS-host: maybe-TAGS-utils
TAGS-host: maybe-TAGS-gnattools
+TAGS-host: maybe-TAGS-lto-plugin
.PHONY: TAGS-target
@@ -1707,6 +1722,7 @@ install-info-host: maybe-install-info-tk
install-info-host: maybe-install-info-libtermcap
install-info-host: maybe-install-info-utils
install-info-host: maybe-install-info-gnattools
+install-info-host: maybe-install-info-lto-plugin
.PHONY: install-info-target
@@ -1819,6 +1835,7 @@ install-pdf-host: maybe-install-pdf-tk
install-pdf-host: maybe-install-pdf-libtermcap
install-pdf-host: maybe-install-pdf-utils
install-pdf-host: maybe-install-pdf-gnattools
+install-pdf-host: maybe-install-pdf-lto-plugin
.PHONY: install-pdf-target
@@ -1931,6 +1948,7 @@ install-html-host: maybe-install-html-tk
install-html-host: maybe-install-html-libtermcap
install-html-host: maybe-install-html-utils
install-html-host: maybe-install-html-gnattools
+install-html-host: maybe-install-html-lto-plugin
.PHONY: install-html-target
@@ -2043,6 +2061,7 @@ installcheck-host: maybe-installcheck-tk
installcheck-host: maybe-installcheck-libtermcap
installcheck-host: maybe-installcheck-utils
installcheck-host: maybe-installcheck-gnattools
+installcheck-host: maybe-installcheck-lto-plugin
.PHONY: installcheck-target
@@ -2155,6 +2174,7 @@ mostlyclean-host: maybe-mostlyclean-tk
mostlyclean-host: maybe-mostlyclean-libtermcap
mostlyclean-host: maybe-mostlyclean-utils
mostlyclean-host: maybe-mostlyclean-gnattools
+mostlyclean-host: maybe-mostlyclean-lto-plugin
.PHONY: mostlyclean-target
@@ -2267,6 +2287,7 @@ clean-host: maybe-clean-tk
clean-host: maybe-clean-libtermcap
clean-host: maybe-clean-utils
clean-host: maybe-clean-gnattools
+clean-host: maybe-clean-lto-plugin
.PHONY: clean-target
@@ -2379,6 +2400,7 @@ distclean-host: maybe-distclean-tk
distclean-host: maybe-distclean-libtermcap
distclean-host: maybe-distclean-utils
distclean-host: maybe-distclean-gnattools
+distclean-host: maybe-distclean-lto-plugin
.PHONY: distclean-target
@@ -2491,6 +2513,7 @@ maintainer-clean-host: maybe-maintainer-clean-tk
maintainer-clean-host: maybe-maintainer-clean-libtermcap
maintainer-clean-host: maybe-maintainer-clean-utils
maintainer-clean-host: maybe-maintainer-clean-gnattools
+maintainer-clean-host: maybe-maintainer-clean-lto-plugin
.PHONY: maintainer-clean-target
@@ -2656,7 +2679,8 @@ check-host: \
maybe-check-tk \
maybe-check-libtermcap \
maybe-check-utils \
- maybe-check-gnattools
+ maybe-check-gnattools \
+ maybe-check-lto-plugin
.PHONY: check-target
check-target: \
@@ -2794,7 +2818,8 @@ install-host-nogcc: \
maybe-install-tk \
maybe-install-libtermcap \
maybe-install-utils \
- maybe-install-gnattools
+ maybe-install-gnattools \
+ maybe-install-lto-plugin
.PHONY: install-host
install-host: \
@@ -2873,7 +2898,8 @@ install-host: \
maybe-install-tk \
maybe-install-libtermcap \
maybe-install-utils \
- maybe-install-gnattools
+ maybe-install-gnattools \
+ maybe-install-lto-plugin
.PHONY: install-target
install-target: \
@@ -28249,7 +28275,7 @@ configure-libiberty:
libsrcdir="$$s/libiberty"; \
$(SHELL) $${libsrcdir}/configure \
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
- --target=${target_alias} $${srcdiroption} \
+ --target=${target_alias} $${srcdiroption} @extra_host_libiberty_configure_flags@ \
|| exit 1
@endif libiberty
@@ -28283,7 +28309,8 @@ configure-stage1-libiberty:
$(SHELL) $${libsrcdir}/configure \
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} $${srcdiroption} \
- $(STAGE1_CONFIGURE_FLAGS)
+ $(STAGE1_CONFIGURE_FLAGS) \
+ @extra_host_libiberty_configure_flags@
@endif libiberty-bootstrap
.PHONY: configure-stage2-libiberty maybe-configure-stage2-libiberty
@@ -28316,7 +28343,8 @@ configure-stage2-libiberty:
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} $${srcdiroption} \
--with-build-libsubdir=$(HOST_SUBDIR) \
- $(STAGE2_CONFIGURE_FLAGS)
+ $(STAGE2_CONFIGURE_FLAGS) \
+ @extra_host_libiberty_configure_flags@
@endif libiberty-bootstrap
.PHONY: configure-stage3-libiberty maybe-configure-stage3-libiberty
@@ -28349,7 +28377,8 @@ configure-stage3-libiberty:
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} $${srcdiroption} \
--with-build-libsubdir=$(HOST_SUBDIR) \
- $(STAGE3_CONFIGURE_FLAGS)
+ $(STAGE3_CONFIGURE_FLAGS) \
+ @extra_host_libiberty_configure_flags@
@endif libiberty-bootstrap
.PHONY: configure-stage4-libiberty maybe-configure-stage4-libiberty
@@ -28382,7 +28411,8 @@ configure-stage4-libiberty:
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} $${srcdiroption} \
--with-build-libsubdir=$(HOST_SUBDIR) \
- $(STAGE4_CONFIGURE_FLAGS)
+ $(STAGE4_CONFIGURE_FLAGS) \
+ @extra_host_libiberty_configure_flags@
@endif libiberty-bootstrap
.PHONY: configure-stageprofile-libiberty maybe-configure-stageprofile-libiberty
@@ -28415,7 +28445,8 @@ configure-stageprofile-libiberty:
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} $${srcdiroption} \
--with-build-libsubdir=$(HOST_SUBDIR) \
- $(STAGEprofile_CONFIGURE_FLAGS)
+ $(STAGEprofile_CONFIGURE_FLAGS) \
+ @extra_host_libiberty_configure_flags@
@endif libiberty-bootstrap
.PHONY: configure-stagefeedback-libiberty maybe-configure-stagefeedback-libiberty
@@ -28448,7 +28479,8 @@ configure-stagefeedback-libiberty:
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} $${srcdiroption} \
--with-build-libsubdir=$(HOST_SUBDIR) \
- $(STAGEfeedback_CONFIGURE_FLAGS)
+ $(STAGEfeedback_CONFIGURE_FLAGS) \
+ @extra_host_libiberty_configure_flags@
@endif libiberty-bootstrap
@@ -42970,6 +43002,872 @@ maintainer-clean-gnattools:
+.PHONY: configure-lto-plugin maybe-configure-lto-plugin
+maybe-configure-lto-plugin:
+@if gcc-bootstrap
+configure-lto-plugin: stage_current
+@endif gcc-bootstrap
+@if lto-plugin
+maybe-configure-lto-plugin: configure-lto-plugin
+configure-lto-plugin:
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ test ! -f $(HOST_SUBDIR)/lto-plugin/Makefile || exit 0; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin ; \
+ $(HOST_EXPORTS) \
+ echo Configuring in $(HOST_SUBDIR)/lto-plugin; \
+ cd "$(HOST_SUBDIR)/lto-plugin" || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+ *) topdir=`echo $(HOST_SUBDIR)/lto-plugin/ | \
+ sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+ esac; \
+ srcdiroption="--srcdir=$${topdir}/lto-plugin"; \
+ libsrcdir="$$s/lto-plugin"; \
+ $(SHELL) $${libsrcdir}/configure \
+ $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+ --target=${target_alias} $${srcdiroption} \
+ || exit 1
+@endif lto-plugin
+
+
+
+.PHONY: configure-stage1-lto-plugin maybe-configure-stage1-lto-plugin
+maybe-configure-stage1-lto-plugin:
+@if lto-plugin-bootstrap
+maybe-configure-stage1-lto-plugin: configure-stage1-lto-plugin
+configure-stage1-lto-plugin:
+ @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start
+ @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ TFLAGS="$(STAGE1_TFLAGS)"; \
+ test ! -f $(HOST_SUBDIR)/lto-plugin/Makefile || exit 0; \
+ $(HOST_EXPORTS) \
+ CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \
+ CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \
+ LIBCFLAGS="$(LIBCFLAGS)"; export LIBCFLAGS; \
+ echo Configuring stage 1 in $(HOST_SUBDIR)/lto-plugin ; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin ; \
+ cd $(HOST_SUBDIR)/lto-plugin || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+ *) topdir=`echo $(HOST_SUBDIR)/lto-plugin/ | \
+ sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+ esac; \
+ srcdiroption="--srcdir=$${topdir}/lto-plugin"; \
+ libsrcdir="$$s/lto-plugin"; \
+ $(SHELL) $${libsrcdir}/configure \
+ $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+ --target=${target_alias} $${srcdiroption} \
+ $(STAGE1_CONFIGURE_FLAGS)
+@endif lto-plugin-bootstrap
+
+.PHONY: configure-stage2-lto-plugin maybe-configure-stage2-lto-plugin
+maybe-configure-stage2-lto-plugin:
+@if lto-plugin-bootstrap
+maybe-configure-stage2-lto-plugin: configure-stage2-lto-plugin
+configure-stage2-lto-plugin:
+ @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start
+ @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ TFLAGS="$(STAGE2_TFLAGS)"; \
+ test ! -f $(HOST_SUBDIR)/lto-plugin/Makefile || exit 0; \
+ $(HOST_EXPORTS) \
+ $(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \
+ CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \
+ LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \
+ echo Configuring stage 2 in $(HOST_SUBDIR)/lto-plugin ; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin ; \
+ cd $(HOST_SUBDIR)/lto-plugin || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+ *) topdir=`echo $(HOST_SUBDIR)/lto-plugin/ | \
+ sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+ esac; \
+ srcdiroption="--srcdir=$${topdir}/lto-plugin"; \
+ libsrcdir="$$s/lto-plugin"; \
+ $(SHELL) $${libsrcdir}/configure \
+ $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+ --target=${target_alias} $${srcdiroption} \
+ --with-build-libsubdir=$(HOST_SUBDIR) \
+ $(STAGE2_CONFIGURE_FLAGS)
+@endif lto-plugin-bootstrap
+
+.PHONY: configure-stage3-lto-plugin maybe-configure-stage3-lto-plugin
+maybe-configure-stage3-lto-plugin:
+@if lto-plugin-bootstrap
+maybe-configure-stage3-lto-plugin: configure-stage3-lto-plugin
+configure-stage3-lto-plugin:
+ @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start
+ @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ TFLAGS="$(STAGE3_TFLAGS)"; \
+ test ! -f $(HOST_SUBDIR)/lto-plugin/Makefile || exit 0; \
+ $(HOST_EXPORTS) \
+ $(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \
+ CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \
+ LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \
+ echo Configuring stage 3 in $(HOST_SUBDIR)/lto-plugin ; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin ; \
+ cd $(HOST_SUBDIR)/lto-plugin || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+ *) topdir=`echo $(HOST_SUBDIR)/lto-plugin/ | \
+ sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+ esac; \
+ srcdiroption="--srcdir=$${topdir}/lto-plugin"; \
+ libsrcdir="$$s/lto-plugin"; \
+ $(SHELL) $${libsrcdir}/configure \
+ $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+ --target=${target_alias} $${srcdiroption} \
+ --with-build-libsubdir=$(HOST_SUBDIR) \
+ $(STAGE3_CONFIGURE_FLAGS)
+@endif lto-plugin-bootstrap
+
+.PHONY: configure-stage4-lto-plugin maybe-configure-stage4-lto-plugin
+maybe-configure-stage4-lto-plugin:
+@if lto-plugin-bootstrap
+maybe-configure-stage4-lto-plugin: configure-stage4-lto-plugin
+configure-stage4-lto-plugin:
+ @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start
+ @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ TFLAGS="$(STAGE4_TFLAGS)"; \
+ test ! -f $(HOST_SUBDIR)/lto-plugin/Makefile || exit 0; \
+ $(HOST_EXPORTS) \
+ $(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \
+ CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \
+ LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \
+ echo Configuring stage 4 in $(HOST_SUBDIR)/lto-plugin ; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin ; \
+ cd $(HOST_SUBDIR)/lto-plugin || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+ *) topdir=`echo $(HOST_SUBDIR)/lto-plugin/ | \
+ sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+ esac; \
+ srcdiroption="--srcdir=$${topdir}/lto-plugin"; \
+ libsrcdir="$$s/lto-plugin"; \
+ $(SHELL) $${libsrcdir}/configure \
+ $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+ --target=${target_alias} $${srcdiroption} \
+ --with-build-libsubdir=$(HOST_SUBDIR) \
+ $(STAGE4_CONFIGURE_FLAGS)
+@endif lto-plugin-bootstrap
+
+.PHONY: configure-stageprofile-lto-plugin maybe-configure-stageprofile-lto-plugin
+maybe-configure-stageprofile-lto-plugin:
+@if lto-plugin-bootstrap
+maybe-configure-stageprofile-lto-plugin: configure-stageprofile-lto-plugin
+configure-stageprofile-lto-plugin:
+ @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start
+ @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ TFLAGS="$(STAGEprofile_TFLAGS)"; \
+ test ! -f $(HOST_SUBDIR)/lto-plugin/Makefile || exit 0; \
+ $(HOST_EXPORTS) \
+ $(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(STAGEprofile_CFLAGS)"; export CFLAGS; \
+ CXXFLAGS="$(STAGEprofile_CFLAGS)"; export CXXFLAGS; \
+ LIBCFLAGS="$(STAGEprofile_CFLAGS)"; export LIBCFLAGS; \
+ echo Configuring stage profile in $(HOST_SUBDIR)/lto-plugin ; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin ; \
+ cd $(HOST_SUBDIR)/lto-plugin || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+ *) topdir=`echo $(HOST_SUBDIR)/lto-plugin/ | \
+ sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+ esac; \
+ srcdiroption="--srcdir=$${topdir}/lto-plugin"; \
+ libsrcdir="$$s/lto-plugin"; \
+ $(SHELL) $${libsrcdir}/configure \
+ $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+ --target=${target_alias} $${srcdiroption} \
+ --with-build-libsubdir=$(HOST_SUBDIR) \
+ $(STAGEprofile_CONFIGURE_FLAGS)
+@endif lto-plugin-bootstrap
+
+.PHONY: configure-stagefeedback-lto-plugin maybe-configure-stagefeedback-lto-plugin
+maybe-configure-stagefeedback-lto-plugin:
+@if lto-plugin-bootstrap
+maybe-configure-stagefeedback-lto-plugin: configure-stagefeedback-lto-plugin
+configure-stagefeedback-lto-plugin:
+ @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start
+ @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ TFLAGS="$(STAGEfeedback_TFLAGS)"; \
+ test ! -f $(HOST_SUBDIR)/lto-plugin/Makefile || exit 0; \
+ $(HOST_EXPORTS) \
+ $(POSTSTAGE1_HOST_EXPORTS) \
+ CFLAGS="$(STAGEfeedback_CFLAGS)"; export CFLAGS; \
+ CXXFLAGS="$(STAGEfeedback_CFLAGS)"; export CXXFLAGS; \
+ LIBCFLAGS="$(STAGEfeedback_CFLAGS)"; export LIBCFLAGS; \
+ echo Configuring stage feedback in $(HOST_SUBDIR)/lto-plugin ; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin ; \
+ cd $(HOST_SUBDIR)/lto-plugin || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+ *) topdir=`echo $(HOST_SUBDIR)/lto-plugin/ | \
+ sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+ esac; \
+ srcdiroption="--srcdir=$${topdir}/lto-plugin"; \
+ libsrcdir="$$s/lto-plugin"; \
+ $(SHELL) $${libsrcdir}/configure \
+ $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+ --target=${target_alias} $${srcdiroption} \
+ --with-build-libsubdir=$(HOST_SUBDIR) \
+ $(STAGEfeedback_CONFIGURE_FLAGS)
+@endif lto-plugin-bootstrap
+
+
+
+
+
+.PHONY: all-lto-plugin maybe-all-lto-plugin
+maybe-all-lto-plugin:
+@if gcc-bootstrap
+all-lto-plugin: stage_current
+@endif gcc-bootstrap
+@if lto-plugin
+TARGET-lto-plugin=all
+maybe-all-lto-plugin: all-lto-plugin
+all-lto-plugin: configure-lto-plugin
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(HOST_EXPORTS) \
+ (cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \
+ $(TARGET-lto-plugin))
+@endif lto-plugin
+
+
+
+.PHONY: all-stage1-lto-plugin maybe-all-stage1-lto-plugin
+.PHONY: clean-stage1-lto-plugin maybe-clean-stage1-lto-plugin
+maybe-all-stage1-lto-plugin:
+maybe-clean-stage1-lto-plugin:
+@if lto-plugin-bootstrap
+maybe-all-stage1-lto-plugin: all-stage1-lto-plugin
+all-stage1: all-stage1-lto-plugin
+TARGET-stage1-lto-plugin = $(TARGET-lto-plugin)
+all-stage1-lto-plugin: configure-stage1-lto-plugin
+ @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ TFLAGS="$(STAGE1_TFLAGS)"; \
+ $(HOST_EXPORTS) \
+ cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) \
+ CFLAGS="$(STAGE1_CFLAGS)" \
+ CXXFLAGS="$(STAGE1_CFLAGS)" \
+ LIBCFLAGS="$(LIBCFLAGS)" \
+ CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+ CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+ LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+ $(EXTRA_HOST_FLAGS) \
+ TFLAGS="$(STAGE1_TFLAGS)" \
+ $(TARGET-stage1-lto-plugin)
+
+maybe-clean-stage1-lto-plugin: clean-stage1-lto-plugin
+clean-stage1: clean-stage1-lto-plugin
+clean-stage1-lto-plugin:
+ @if [ $(current_stage) = stage1 ]; then \
+ [ -f $(HOST_SUBDIR)/lto-plugin/Makefile ] || exit 0; \
+ else \
+ [ -f $(HOST_SUBDIR)/stage1-lto-plugin/Makefile ] || exit 0; \
+ $(MAKE) stage1-start; \
+ fi; \
+ cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(EXTRA_HOST_FLAGS) \
+ clean
+@endif lto-plugin-bootstrap
+
+
+.PHONY: all-stage2-lto-plugin maybe-all-stage2-lto-plugin
+.PHONY: clean-stage2-lto-plugin maybe-clean-stage2-lto-plugin
+maybe-all-stage2-lto-plugin:
+maybe-clean-stage2-lto-plugin:
+@if lto-plugin-bootstrap
+maybe-all-stage2-lto-plugin: all-stage2-lto-plugin
+all-stage2: all-stage2-lto-plugin
+TARGET-stage2-lto-plugin = $(TARGET-lto-plugin)
+all-stage2-lto-plugin: configure-stage2-lto-plugin
+ @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ TFLAGS="$(STAGE2_TFLAGS)"; \
+ $(HOST_EXPORTS) \
+ $(POSTSTAGE1_HOST_EXPORTS) \
+ cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) \
+ CFLAGS="$(STAGE2_CFLAGS)" \
+ CXXFLAGS="$(STAGE2_CFLAGS)" \
+ LIBCFLAGS="$(STAGE2_CFLAGS)" \
+ CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+ CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+ LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+ $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ TFLAGS="$(STAGE2_TFLAGS)" \
+ $(TARGET-stage2-lto-plugin)
+
+maybe-clean-stage2-lto-plugin: clean-stage2-lto-plugin
+clean-stage2: clean-stage2-lto-plugin
+clean-stage2-lto-plugin:
+ @if [ $(current_stage) = stage2 ]; then \
+ [ -f $(HOST_SUBDIR)/lto-plugin/Makefile ] || exit 0; \
+ else \
+ [ -f $(HOST_SUBDIR)/stage2-lto-plugin/Makefile ] || exit 0; \
+ $(MAKE) stage2-start; \
+ fi; \
+ cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(EXTRA_HOST_FLAGS) \
+ $(POSTSTAGE1_FLAGS_TO_PASS) \
+ clean
+@endif lto-plugin-bootstrap
+
+
+.PHONY: all-stage3-lto-plugin maybe-all-stage3-lto-plugin
+.PHONY: clean-stage3-lto-plugin maybe-clean-stage3-lto-plugin
+maybe-all-stage3-lto-plugin:
+maybe-clean-stage3-lto-plugin:
+@if lto-plugin-bootstrap
+maybe-all-stage3-lto-plugin: all-stage3-lto-plugin
+all-stage3: all-stage3-lto-plugin
+TARGET-stage3-lto-plugin = $(TARGET-lto-plugin)
+all-stage3-lto-plugin: configure-stage3-lto-plugin
+ @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ TFLAGS="$(STAGE3_TFLAGS)"; \
+ $(HOST_EXPORTS) \
+ $(POSTSTAGE1_HOST_EXPORTS) \
+ cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) \
+ CFLAGS="$(STAGE3_CFLAGS)" \
+ CXXFLAGS="$(STAGE3_CFLAGS)" \
+ LIBCFLAGS="$(STAGE3_CFLAGS)" \
+ CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+ CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+ LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+ $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ TFLAGS="$(STAGE3_TFLAGS)" \
+ $(TARGET-stage3-lto-plugin)
+
+maybe-clean-stage3-lto-plugin: clean-stage3-lto-plugin
+clean-stage3: clean-stage3-lto-plugin
+clean-stage3-lto-plugin:
+ @if [ $(current_stage) = stage3 ]; then \
+ [ -f $(HOST_SUBDIR)/lto-plugin/Makefile ] || exit 0; \
+ else \
+ [ -f $(HOST_SUBDIR)/stage3-lto-plugin/Makefile ] || exit 0; \
+ $(MAKE) stage3-start; \
+ fi; \
+ cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(EXTRA_HOST_FLAGS) \
+ $(POSTSTAGE1_FLAGS_TO_PASS) \
+ clean
+@endif lto-plugin-bootstrap
+
+
+.PHONY: all-stage4-lto-plugin maybe-all-stage4-lto-plugin
+.PHONY: clean-stage4-lto-plugin maybe-clean-stage4-lto-plugin
+maybe-all-stage4-lto-plugin:
+maybe-clean-stage4-lto-plugin:
+@if lto-plugin-bootstrap
+maybe-all-stage4-lto-plugin: all-stage4-lto-plugin
+all-stage4: all-stage4-lto-plugin
+TARGET-stage4-lto-plugin = $(TARGET-lto-plugin)
+all-stage4-lto-plugin: configure-stage4-lto-plugin
+ @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ TFLAGS="$(STAGE4_TFLAGS)"; \
+ $(HOST_EXPORTS) \
+ $(POSTSTAGE1_HOST_EXPORTS) \
+ cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) \
+ CFLAGS="$(STAGE4_CFLAGS)" \
+ CXXFLAGS="$(STAGE4_CFLAGS)" \
+ LIBCFLAGS="$(STAGE4_CFLAGS)" \
+ CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+ CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+ LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+ $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ TFLAGS="$(STAGE4_TFLAGS)" \
+ $(TARGET-stage4-lto-plugin)
+
+maybe-clean-stage4-lto-plugin: clean-stage4-lto-plugin
+clean-stage4: clean-stage4-lto-plugin
+clean-stage4-lto-plugin:
+ @if [ $(current_stage) = stage4 ]; then \
+ [ -f $(HOST_SUBDIR)/lto-plugin/Makefile ] || exit 0; \
+ else \
+ [ -f $(HOST_SUBDIR)/stage4-lto-plugin/Makefile ] || exit 0; \
+ $(MAKE) stage4-start; \
+ fi; \
+ cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(EXTRA_HOST_FLAGS) \
+ $(POSTSTAGE1_FLAGS_TO_PASS) \
+ clean
+@endif lto-plugin-bootstrap
+
+
+.PHONY: all-stageprofile-lto-plugin maybe-all-stageprofile-lto-plugin
+.PHONY: clean-stageprofile-lto-plugin maybe-clean-stageprofile-lto-plugin
+maybe-all-stageprofile-lto-plugin:
+maybe-clean-stageprofile-lto-plugin:
+@if lto-plugin-bootstrap
+maybe-all-stageprofile-lto-plugin: all-stageprofile-lto-plugin
+all-stageprofile: all-stageprofile-lto-plugin
+TARGET-stageprofile-lto-plugin = $(TARGET-lto-plugin)
+all-stageprofile-lto-plugin: configure-stageprofile-lto-plugin
+ @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ TFLAGS="$(STAGEprofile_TFLAGS)"; \
+ $(HOST_EXPORTS) \
+ $(POSTSTAGE1_HOST_EXPORTS) \
+ cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) \
+ CFLAGS="$(STAGEprofile_CFLAGS)" \
+ CXXFLAGS="$(STAGEprofile_CFLAGS)" \
+ LIBCFLAGS="$(STAGEprofile_CFLAGS)" \
+ CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+ CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+ LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+ $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ TFLAGS="$(STAGEprofile_TFLAGS)" \
+ $(TARGET-stageprofile-lto-plugin)
+
+maybe-clean-stageprofile-lto-plugin: clean-stageprofile-lto-plugin
+clean-stageprofile: clean-stageprofile-lto-plugin
+clean-stageprofile-lto-plugin:
+ @if [ $(current_stage) = stageprofile ]; then \
+ [ -f $(HOST_SUBDIR)/lto-plugin/Makefile ] || exit 0; \
+ else \
+ [ -f $(HOST_SUBDIR)/stageprofile-lto-plugin/Makefile ] || exit 0; \
+ $(MAKE) stageprofile-start; \
+ fi; \
+ cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(EXTRA_HOST_FLAGS) \
+ $(POSTSTAGE1_FLAGS_TO_PASS) \
+ clean
+@endif lto-plugin-bootstrap
+
+
+.PHONY: all-stagefeedback-lto-plugin maybe-all-stagefeedback-lto-plugin
+.PHONY: clean-stagefeedback-lto-plugin maybe-clean-stagefeedback-lto-plugin
+maybe-all-stagefeedback-lto-plugin:
+maybe-clean-stagefeedback-lto-plugin:
+@if lto-plugin-bootstrap
+maybe-all-stagefeedback-lto-plugin: all-stagefeedback-lto-plugin
+all-stagefeedback: all-stagefeedback-lto-plugin
+TARGET-stagefeedback-lto-plugin = $(TARGET-lto-plugin)
+all-stagefeedback-lto-plugin: configure-stagefeedback-lto-plugin
+ @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ TFLAGS="$(STAGEfeedback_TFLAGS)"; \
+ $(HOST_EXPORTS) \
+ $(POSTSTAGE1_HOST_EXPORTS) \
+ cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) \
+ CFLAGS="$(STAGEfeedback_CFLAGS)" \
+ CXXFLAGS="$(STAGEfeedback_CFLAGS)" \
+ LIBCFLAGS="$(STAGEfeedback_CFLAGS)" \
+ CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+ CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+ LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+ $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \
+ TFLAGS="$(STAGEfeedback_TFLAGS)" \
+ $(TARGET-stagefeedback-lto-plugin)
+
+maybe-clean-stagefeedback-lto-plugin: clean-stagefeedback-lto-plugin
+clean-stagefeedback: clean-stagefeedback-lto-plugin
+clean-stagefeedback-lto-plugin:
+ @if [ $(current_stage) = stagefeedback ]; then \
+ [ -f $(HOST_SUBDIR)/lto-plugin/Makefile ] || exit 0; \
+ else \
+ [ -f $(HOST_SUBDIR)/stagefeedback-lto-plugin/Makefile ] || exit 0; \
+ $(MAKE) stagefeedback-start; \
+ fi; \
+ cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(EXTRA_HOST_FLAGS) \
+ $(POSTSTAGE1_FLAGS_TO_PASS) \
+ clean
+@endif lto-plugin-bootstrap
+
+
+
+
+
+.PHONY: check-lto-plugin maybe-check-lto-plugin
+maybe-check-lto-plugin:
+@if lto-plugin
+maybe-check-lto-plugin: check-lto-plugin
+
+check-lto-plugin:
+ @: $(MAKE); $(unstage)
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(HOST_EXPORTS) \
+ (cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(FLAGS_TO_PASS) check)
+
+@endif lto-plugin
+
+.PHONY: install-lto-plugin maybe-install-lto-plugin
+maybe-install-lto-plugin:
+@if lto-plugin
+maybe-install-lto-plugin: install-lto-plugin
+
+install-lto-plugin: installdirs
+ @: $(MAKE); $(unstage)
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(HOST_EXPORTS) \
+ (cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(FLAGS_TO_PASS) install)
+
+@endif lto-plugin
+
+# Other targets (info, dvi, pdf, etc.)
+
+.PHONY: maybe-info-lto-plugin info-lto-plugin
+maybe-info-lto-plugin:
+@if lto-plugin
+maybe-info-lto-plugin: info-lto-plugin
+
+info-lto-plugin: \
+ configure-lto-plugin
+ @[ -f ./lto-plugin/Makefile ] || exit 0; \
+ r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(HOST_EXPORTS) \
+ for flag in $(EXTRA_HOST_FLAGS) ; do \
+ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+ done; \
+ echo "Doing info in lto-plugin" ; \
+ (cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+ "RANLIB=$${RANLIB}" \
+ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+ info) \
+ || exit 1
+
+@endif lto-plugin
+
+.PHONY: maybe-dvi-lto-plugin dvi-lto-plugin
+maybe-dvi-lto-plugin:
+@if lto-plugin
+maybe-dvi-lto-plugin: dvi-lto-plugin
+
+dvi-lto-plugin: \
+ configure-lto-plugin
+ @[ -f ./lto-plugin/Makefile ] || exit 0; \
+ r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(HOST_EXPORTS) \
+ for flag in $(EXTRA_HOST_FLAGS) ; do \
+ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+ done; \
+ echo "Doing dvi in lto-plugin" ; \
+ (cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+ "RANLIB=$${RANLIB}" \
+ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+ dvi) \
+ || exit 1
+
+@endif lto-plugin
+
+.PHONY: maybe-pdf-lto-plugin pdf-lto-plugin
+maybe-pdf-lto-plugin:
+@if lto-plugin
+maybe-pdf-lto-plugin: pdf-lto-plugin
+
+pdf-lto-plugin: \
+ configure-lto-plugin
+ @[ -f ./lto-plugin/Makefile ] || exit 0; \
+ r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(HOST_EXPORTS) \
+ for flag in $(EXTRA_HOST_FLAGS) ; do \
+ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+ done; \
+ echo "Doing pdf in lto-plugin" ; \
+ (cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+ "RANLIB=$${RANLIB}" \
+ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+ pdf) \
+ || exit 1
+
+@endif lto-plugin
+
+.PHONY: maybe-html-lto-plugin html-lto-plugin
+maybe-html-lto-plugin:
+@if lto-plugin
+maybe-html-lto-plugin: html-lto-plugin
+
+html-lto-plugin: \
+ configure-lto-plugin
+ @[ -f ./lto-plugin/Makefile ] || exit 0; \
+ r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(HOST_EXPORTS) \
+ for flag in $(EXTRA_HOST_FLAGS) ; do \
+ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+ done; \
+ echo "Doing html in lto-plugin" ; \
+ (cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+ "RANLIB=$${RANLIB}" \
+ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+ html) \
+ || exit 1
+
+@endif lto-plugin
+
+.PHONY: maybe-TAGS-lto-plugin TAGS-lto-plugin
+maybe-TAGS-lto-plugin:
+@if lto-plugin
+maybe-TAGS-lto-plugin: TAGS-lto-plugin
+
+TAGS-lto-plugin: \
+ configure-lto-plugin
+ @[ -f ./lto-plugin/Makefile ] || exit 0; \
+ r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(HOST_EXPORTS) \
+ for flag in $(EXTRA_HOST_FLAGS) ; do \
+ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+ done; \
+ echo "Doing TAGS in lto-plugin" ; \
+ (cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+ "RANLIB=$${RANLIB}" \
+ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+ TAGS) \
+ || exit 1
+
+@endif lto-plugin
+
+.PHONY: maybe-install-info-lto-plugin install-info-lto-plugin
+maybe-install-info-lto-plugin:
+@if lto-plugin
+maybe-install-info-lto-plugin: install-info-lto-plugin
+
+install-info-lto-plugin: \
+ configure-lto-plugin \
+ info-lto-plugin
+ @[ -f ./lto-plugin/Makefile ] || exit 0; \
+ r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(HOST_EXPORTS) \
+ for flag in $(EXTRA_HOST_FLAGS) ; do \
+ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+ done; \
+ echo "Doing install-info in lto-plugin" ; \
+ (cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+ "RANLIB=$${RANLIB}" \
+ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+ install-info) \
+ || exit 1
+
+@endif lto-plugin
+
+.PHONY: maybe-install-pdf-lto-plugin install-pdf-lto-plugin
+maybe-install-pdf-lto-plugin:
+@if lto-plugin
+maybe-install-pdf-lto-plugin: install-pdf-lto-plugin
+
+install-pdf-lto-plugin: \
+ configure-lto-plugin \
+ pdf-lto-plugin
+ @[ -f ./lto-plugin/Makefile ] || exit 0; \
+ r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(HOST_EXPORTS) \
+ for flag in $(EXTRA_HOST_FLAGS) ; do \
+ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+ done; \
+ echo "Doing install-pdf in lto-plugin" ; \
+ (cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+ "RANLIB=$${RANLIB}" \
+ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+ install-pdf) \
+ || exit 1
+
+@endif lto-plugin
+
+.PHONY: maybe-install-html-lto-plugin install-html-lto-plugin
+maybe-install-html-lto-plugin:
+@if lto-plugin
+maybe-install-html-lto-plugin: install-html-lto-plugin
+
+install-html-lto-plugin: \
+ configure-lto-plugin \
+ html-lto-plugin
+ @[ -f ./lto-plugin/Makefile ] || exit 0; \
+ r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(HOST_EXPORTS) \
+ for flag in $(EXTRA_HOST_FLAGS) ; do \
+ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+ done; \
+ echo "Doing install-html in lto-plugin" ; \
+ (cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+ "RANLIB=$${RANLIB}" \
+ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+ install-html) \
+ || exit 1
+
+@endif lto-plugin
+
+.PHONY: maybe-installcheck-lto-plugin installcheck-lto-plugin
+maybe-installcheck-lto-plugin:
+@if lto-plugin
+maybe-installcheck-lto-plugin: installcheck-lto-plugin
+
+installcheck-lto-plugin: \
+ configure-lto-plugin
+ @[ -f ./lto-plugin/Makefile ] || exit 0; \
+ r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(HOST_EXPORTS) \
+ for flag in $(EXTRA_HOST_FLAGS) ; do \
+ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+ done; \
+ echo "Doing installcheck in lto-plugin" ; \
+ (cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+ "RANLIB=$${RANLIB}" \
+ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+ installcheck) \
+ || exit 1
+
+@endif lto-plugin
+
+.PHONY: maybe-mostlyclean-lto-plugin mostlyclean-lto-plugin
+maybe-mostlyclean-lto-plugin:
+@if lto-plugin
+maybe-mostlyclean-lto-plugin: mostlyclean-lto-plugin
+
+mostlyclean-lto-plugin:
+ @[ -f ./lto-plugin/Makefile ] || exit 0; \
+ r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(HOST_EXPORTS) \
+ for flag in $(EXTRA_HOST_FLAGS) ; do \
+ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+ done; \
+ echo "Doing mostlyclean in lto-plugin" ; \
+ (cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+ "RANLIB=$${RANLIB}" \
+ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+ mostlyclean) \
+ || exit 1
+
+@endif lto-plugin
+
+.PHONY: maybe-clean-lto-plugin clean-lto-plugin
+maybe-clean-lto-plugin:
+@if lto-plugin
+maybe-clean-lto-plugin: clean-lto-plugin
+
+clean-lto-plugin:
+ @[ -f ./lto-plugin/Makefile ] || exit 0; \
+ r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(HOST_EXPORTS) \
+ for flag in $(EXTRA_HOST_FLAGS) ; do \
+ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+ done; \
+ echo "Doing clean in lto-plugin" ; \
+ (cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+ "RANLIB=$${RANLIB}" \
+ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+ clean) \
+ || exit 1
+
+@endif lto-plugin
+
+.PHONY: maybe-distclean-lto-plugin distclean-lto-plugin
+maybe-distclean-lto-plugin:
+@if lto-plugin
+maybe-distclean-lto-plugin: distclean-lto-plugin
+
+distclean-lto-plugin:
+ @[ -f ./lto-plugin/Makefile ] || exit 0; \
+ r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(HOST_EXPORTS) \
+ for flag in $(EXTRA_HOST_FLAGS) ; do \
+ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+ done; \
+ echo "Doing distclean in lto-plugin" ; \
+ (cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+ "RANLIB=$${RANLIB}" \
+ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+ distclean) \
+ || exit 1
+
+@endif lto-plugin
+
+.PHONY: maybe-maintainer-clean-lto-plugin maintainer-clean-lto-plugin
+maybe-maintainer-clean-lto-plugin:
+@if lto-plugin
+maybe-maintainer-clean-lto-plugin: maintainer-clean-lto-plugin
+
+maintainer-clean-lto-plugin:
+ @[ -f ./lto-plugin/Makefile ] || exit 0; \
+ r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(HOST_EXPORTS) \
+ for flag in $(EXTRA_HOST_FLAGS) ; do \
+ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+ done; \
+ echo "Doing maintainer-clean in lto-plugin" ; \
+ (cd $(HOST_SUBDIR)/lto-plugin && \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+ "RANLIB=$${RANLIB}" \
+ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+ maintainer-clean) \
+ || exit 1
+
+@endif lto-plugin
+
+
+
# ---------------------------------------
# Modules which run on the target machine
# ---------------------------------------
@@ -53466,6 +54364,11 @@ stage1-start::
mkdir stage1-zlib; \
mv stage1-zlib zlib
@endif zlib
+@if lto-plugin
+ @cd $(HOST_SUBDIR); [ -d stage1-lto-plugin ] || \
+ mkdir stage1-lto-plugin; \
+ mv stage1-lto-plugin lto-plugin
+@endif lto-plugin
@[ -d stage1-$(TARGET_SUBDIR) ] || \
mkdir stage1-$(TARGET_SUBDIR); \
mv stage1-$(TARGET_SUBDIR) $(TARGET_SUBDIR)
@@ -53556,6 +54459,11 @@ stage1-end::
cd $(HOST_SUBDIR); mv zlib stage1-zlib ; \
fi
@endif zlib
+@if lto-plugin
+ @if test -d $(HOST_SUBDIR)/lto-plugin ; then \
+ cd $(HOST_SUBDIR); mv lto-plugin stage1-lto-plugin ; \
+ fi
+@endif lto-plugin
@if test -d $(TARGET_SUBDIR) ; then \
mv $(TARGET_SUBDIR) stage1-$(TARGET_SUBDIR) ; \
fi
@@ -53706,6 +54614,12 @@ stage2-start::
mv stage2-zlib zlib ; \
mv stage1-zlib prev-zlib || test -f stage1-lean
@endif zlib
+@if lto-plugin
+ @cd $(HOST_SUBDIR); [ -d stage2-lto-plugin ] || \
+ mkdir stage2-lto-plugin; \
+ mv stage2-lto-plugin lto-plugin ; \
+ mv stage1-lto-plugin prev-lto-plugin || test -f stage1-lean
+@endif lto-plugin
@[ -d stage2-$(TARGET_SUBDIR) ] || \
mkdir stage2-$(TARGET_SUBDIR); \
mv stage2-$(TARGET_SUBDIR) $(TARGET_SUBDIR) ; \
@@ -53814,6 +54728,12 @@ stage2-end::
mv prev-zlib stage1-zlib ; : ; \
fi
@endif zlib
+@if lto-plugin
+ @if test -d $(HOST_SUBDIR)/lto-plugin ; then \
+ cd $(HOST_SUBDIR); mv lto-plugin stage2-lto-plugin ; \
+ mv prev-lto-plugin stage1-lto-plugin ; : ; \
+ fi
+@endif lto-plugin
@if test -d $(TARGET_SUBDIR) ; then \
mv $(TARGET_SUBDIR) stage2-$(TARGET_SUBDIR) ; \
mv prev-$(TARGET_SUBDIR) stage1-$(TARGET_SUBDIR) ; : ; \
@@ -53988,6 +54908,12 @@ stage3-start::
mv stage3-zlib zlib ; \
mv stage2-zlib prev-zlib || test -f stage2-lean
@endif zlib
+@if lto-plugin
+ @cd $(HOST_SUBDIR); [ -d stage3-lto-plugin ] || \
+ mkdir stage3-lto-plugin; \
+ mv stage3-lto-plugin lto-plugin ; \
+ mv stage2-lto-plugin prev-lto-plugin || test -f stage2-lean
+@endif lto-plugin
@[ -d stage3-$(TARGET_SUBDIR) ] || \
mkdir stage3-$(TARGET_SUBDIR); \
mv stage3-$(TARGET_SUBDIR) $(TARGET_SUBDIR) ; \
@@ -54096,6 +55022,12 @@ stage3-end::
mv prev-zlib stage2-zlib ; : ; \
fi
@endif zlib
+@if lto-plugin
+ @if test -d $(HOST_SUBDIR)/lto-plugin ; then \
+ cd $(HOST_SUBDIR); mv lto-plugin stage3-lto-plugin ; \
+ mv prev-lto-plugin stage2-lto-plugin ; : ; \
+ fi
+@endif lto-plugin
@if test -d $(TARGET_SUBDIR) ; then \
mv $(TARGET_SUBDIR) stage3-$(TARGET_SUBDIR) ; \
mv prev-$(TARGET_SUBDIR) stage2-$(TARGET_SUBDIR) ; : ; \
@@ -54326,6 +55258,12 @@ stage4-start::
mv stage4-zlib zlib ; \
mv stage3-zlib prev-zlib || test -f stage3-lean
@endif zlib
+@if lto-plugin
+ @cd $(HOST_SUBDIR); [ -d stage4-lto-plugin ] || \
+ mkdir stage4-lto-plugin; \
+ mv stage4-lto-plugin lto-plugin ; \
+ mv stage3-lto-plugin prev-lto-plugin || test -f stage3-lean
+@endif lto-plugin
@[ -d stage4-$(TARGET_SUBDIR) ] || \
mkdir stage4-$(TARGET_SUBDIR); \
mv stage4-$(TARGET_SUBDIR) $(TARGET_SUBDIR) ; \
@@ -54434,6 +55372,12 @@ stage4-end::
mv prev-zlib stage3-zlib ; : ; \
fi
@endif zlib
+@if lto-plugin
+ @if test -d $(HOST_SUBDIR)/lto-plugin ; then \
+ cd $(HOST_SUBDIR); mv lto-plugin stage4-lto-plugin ; \
+ mv prev-lto-plugin stage3-lto-plugin ; : ; \
+ fi
+@endif lto-plugin
@if test -d $(TARGET_SUBDIR) ; then \
mv $(TARGET_SUBDIR) stage4-$(TARGET_SUBDIR) ; \
mv prev-$(TARGET_SUBDIR) stage3-$(TARGET_SUBDIR) ; : ; \
@@ -54652,6 +55596,12 @@ stageprofile-start::
mv stageprofile-zlib zlib ; \
mv stage1-zlib prev-zlib || test -f stage1-lean
@endif zlib
+@if lto-plugin
+ @cd $(HOST_SUBDIR); [ -d stageprofile-lto-plugin ] || \
+ mkdir stageprofile-lto-plugin; \
+ mv stageprofile-lto-plugin lto-plugin ; \
+ mv stage1-lto-plugin prev-lto-plugin || test -f stage1-lean
+@endif lto-plugin
@[ -d stageprofile-$(TARGET_SUBDIR) ] || \
mkdir stageprofile-$(TARGET_SUBDIR); \
mv stageprofile-$(TARGET_SUBDIR) $(TARGET_SUBDIR) ; \
@@ -54760,6 +55710,12 @@ stageprofile-end::
mv prev-zlib stage1-zlib ; : ; \
fi
@endif zlib
+@if lto-plugin
+ @if test -d $(HOST_SUBDIR)/lto-plugin ; then \
+ cd $(HOST_SUBDIR); mv lto-plugin stageprofile-lto-plugin ; \
+ mv prev-lto-plugin stage1-lto-plugin ; : ; \
+ fi
+@endif lto-plugin
@if test -d $(TARGET_SUBDIR) ; then \
mv $(TARGET_SUBDIR) stageprofile-$(TARGET_SUBDIR) ; \
mv prev-$(TARGET_SUBDIR) stage1-$(TARGET_SUBDIR) ; : ; \
@@ -54911,6 +55867,12 @@ stagefeedback-start::
mv stagefeedback-zlib zlib ; \
mv stageprofile-zlib prev-zlib || test -f stageprofile-lean
@endif zlib
+@if lto-plugin
+ @cd $(HOST_SUBDIR); [ -d stagefeedback-lto-plugin ] || \
+ mkdir stagefeedback-lto-plugin; \
+ mv stagefeedback-lto-plugin lto-plugin ; \
+ mv stageprofile-lto-plugin prev-lto-plugin || test -f stageprofile-lean
+@endif lto-plugin
@[ -d stagefeedback-$(TARGET_SUBDIR) ] || \
mkdir stagefeedback-$(TARGET_SUBDIR); \
mv stagefeedback-$(TARGET_SUBDIR) $(TARGET_SUBDIR) ; \
@@ -55019,6 +55981,12 @@ stagefeedback-end::
mv prev-zlib stageprofile-zlib ; : ; \
fi
@endif zlib
+@if lto-plugin
+ @if test -d $(HOST_SUBDIR)/lto-plugin ; then \
+ cd $(HOST_SUBDIR); mv lto-plugin stagefeedback-lto-plugin ; \
+ mv prev-lto-plugin stageprofile-lto-plugin ; : ; \
+ fi
+@endif lto-plugin
@if test -d $(TARGET_SUBDIR) ; then \
mv $(TARGET_SUBDIR) stagefeedback-$(TARGET_SUBDIR) ; \
mv prev-$(TARGET_SUBDIR) stageprofile-$(TARGET_SUBDIR) ; : ; \
@@ -55422,6 +56390,14 @@ all-stageprofile-libcpp: maybe-all-stageprofile-intl
all-stagefeedback-libcpp: maybe-all-stagefeedback-intl
all-fixincludes: maybe-all-libiberty
all-gnattools: maybe-all-target-libada
+all-lto-plugin: maybe-all-libiberty
+
+all-stage1-lto-plugin: maybe-all-stage1-libiberty
+all-stage2-lto-plugin: maybe-all-stage2-libiberty
+all-stage3-lto-plugin: maybe-all-stage3-libiberty
+all-stage4-lto-plugin: maybe-all-stage4-libiberty
+all-stageprofile-lto-plugin: maybe-all-stageprofile-libiberty
+all-stagefeedback-lto-plugin: maybe-all-stagefeedback-libiberty
configure-mpfr: maybe-all-gmp
configure-stage1-mpfr: maybe-all-stage1-gmp
@@ -55758,6 +56734,14 @@ check-stage3-gold: maybe-all-stage3-binutils
check-stage4-gold: maybe-all-stage4-binutils
check-stageprofile-gold: maybe-all-stageprofile-binutils
check-stagefeedback-gold: maybe-all-stagefeedback-binutils
+check-gold: maybe-all-gas
+
+check-stage1-gold: maybe-all-stage1-gas
+check-stage2-gold: maybe-all-stage2-gas
+check-stage3-gold: maybe-all-stage3-gas
+check-stage4-gold: maybe-all-stage4-gas
+check-stageprofile-gold: maybe-all-stageprofile-gas
+check-stagefeedback-gold: maybe-all-stagefeedback-gas
configure-opcodes: maybe-configure-intl
configure-stage1-opcodes: maybe-configure-stage1-intl
diff --git a/Makefile.tpl b/Makefile.tpl
index 476cd5d291b..45a58c56a40 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -222,6 +222,8 @@ HOST_EXPORTS = \
PPLINC="$(HOST_PPLINC)"; export PPLINC; \
CLOOGLIBS="$(HOST_CLOOGLIBS)"; export CLOOGLIBS; \
CLOOGINC="$(HOST_CLOOGINC)"; export CLOOGINC; \
+ LIBELFLIBS="$(HOST_LIBELFLIBS)" ; export LIBELFLIBS; \
+ LIBELFINC="$(HOST_LIBELFINC)" ; export LIBELFINC; \
@if gcc-bootstrap
$(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
@endif gcc-bootstrap
@@ -296,6 +298,10 @@ HOST_PPLINC = @pplinc@
HOST_CLOOGLIBS = @clooglibs@
HOST_CLOOGINC = @clooginc@
+# Where to find libelf
+HOST_LIBELFLIBS = @libelflibs@
+HOST_LIBELFINC = @libelfinc@
+
# ----------------------------------------------
# Programs producing files for the BUILD machine
# ----------------------------------------------
diff --git a/README b/README
index 3a495133bee..7b1097f55c1 100644
--- a/README
+++ b/README
@@ -1,9 +1,9 @@
This directory contains the GNU Compiler Collection (GCC).
-The GNU Compiler Collection is free software. See the file COPYING
-for copying permission. The manuals, and some of the runtime
-libraries, are under different terms; see the individual source files
-for details.
+The GNU Compiler Collection is free software. See the files whose
+names start with COPYING for copying permission. The manuals, and
+some of the runtime libraries, are under different terms; see the
+individual source files for details.
The directory INSTALL contains copies of the installation information
as HTML and plain text. The source of this information is
@@ -14,4 +14,4 @@ See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information. An online readable
version of the manual is in the files gcc/doc/gcc.info*.
-See http://gcc.gnu.org/bugs.html for how to report bugs usefully.
+See http://gcc.gnu.org/bugs/ for how to report bugs usefully.
diff --git a/config.sub b/config.sub
index b26b47a0e0a..eec93662070 100755
--- a/config.sub
+++ b/config.sub
@@ -4,7 +4,7 @@
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
# Free Software Foundation, Inc.
-timestamp='2009-09-23'
+timestamp='2009-10-07'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -301,7 +301,7 @@ case $basic_machine in
| z8k | z80)
basic_machine=$basic_machine-unknown
;;
- m6811 | m68hc11 | m6812 | m68hc12)
+ m6811 | m68hc11 | m6812 | m68hc12 | picochip)
# Motorola 68HC11/12.
basic_machine=$basic_machine-unknown
os=-none
@@ -1297,7 +1297,7 @@ case $os in
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1698,3 +1698,4 @@ exit
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
+
diff --git a/config/ChangeLog b/config/ChangeLog
index ceea52ed782..4d50df66bbe 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,7 @@
+2009-10-23 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * acx.m4 (ACX_CHECK_CYGWIN_CAT_WORKS): Use = with test.
+
2009-09-09 Paolo Bonzini <bonzini@gnu.org>
* stdint.m4 (GCC_HEADER_STDINT): Revert changes to this macro in
diff --git a/config/acx.m4 b/config/acx.m4
index cea08b7204f..b559c03ebdf 100644
--- a/config/acx.m4
+++ b/config/acx.m4
@@ -605,7 +605,7 @@ dnl # See binutils PR 4334 for more details.
AC_DEFUN([ACX_CHECK_CYGWIN_CAT_WORKS],[
AC_MSG_CHECKING([to see if cat works as expected])
echo a >cygwin-cat-check
-if test `cat cygwin-cat-check` == a ; then
+if test `cat cygwin-cat-check` = a ; then
rm cygwin-cat-check
AC_MSG_RESULT(yes)
else
diff --git a/configure b/configure
index 263b934c931..c6a848bc6a7 100755
--- a/configure
+++ b/configure
@@ -553,6 +553,42 @@ PACKAGE_URL=
ac_unique_file="move-if-change"
enable_option_checking=no
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
ac_subst_vars='LTLIBOBJS
LIBOBJS
compare_exclusions
@@ -637,6 +673,12 @@ CFLAGS_FOR_TARGET
DEBUG_PREFIX_CFLAGS_FOR_TARGET
SYSROOT_CFLAGS_FOR_TARGET
stage1_languages
+extra_host_libiberty_configure_flags
+libelfinc
+libelflibs
+EGREP
+GREP
+CPP
clooginc
clooglibs
pplinc
@@ -764,6 +806,10 @@ with_cloog
with_cloog_include
with_cloog_lib
enable_cloog_version_check
+enable_lto
+with_libelf
+with_libelf_include
+with_libelf_lib
enable_stage1_languages
enable_objc_gc
with_build_sysroot
@@ -787,6 +833,7 @@ CPPFLAGS
CXX
CXXFLAGS
CCC
+CPP
AR
AS
DLLTOOL
@@ -1441,6 +1488,7 @@ Optional Features:
--enable-build-with-cxx build with C++ compiler instead of C compiler
--disable-ppl-version-check disable check for PPL version
--disable-cloog-version-check disable check for CLooG version
+ --enable-lto enable link time optimization support
--enable-stage1-languages[=all] choose additional languages to build during
stage1. Mostly useful for compiler development.
--enable-objc-gc enable use of Boehm's garbage collector with the
@@ -1495,6 +1543,11 @@ Optional Packages:
plus --with-cloog-lib=PATH/lib
--with-cloog-include=PATH Specify directory for installed CLooG include files
--with-cloog-lib=PATH Specify the directory for the installed CLooG library
+ --with-libelf=PATH Specify prefix directory for the installed libelf package
+ Equivalent to --with-libelf-include=PATH/include
+ plus --with-libelf-lib=PATH/lib
+ --with-libelf-include=PATH Specify directory for installed libelf include files
+ --with-libelf-lib=PATH Specify the directory for the installed libelf library
--with-build-sysroot=SYSROOT
use sysroot as the system root during the build
--with-debug-prefix-map='A=B C=D ...'
@@ -1514,6 +1567,7 @@ Some influential environment variables:
you have headers in a nonstandard directory <include dir>
CXX C++ compiler command
CXXFLAGS C++ compiler flags
+ CPP C preprocessor
AR AR for the host
AS AS for the host
DLLTOOL DLLTOOL for the host
@@ -1760,6 +1814,203 @@ fi
return $ac_retval
} # ac_fn_c_try_link
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ return $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_header_compiler=yes
+else
+ ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ac_header_preproc=yes
+else
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+ yes:no: )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ return $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_compile
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
@@ -2768,6 +3019,13 @@ if test x$with_gnu_as = xno ; then
noconfigdirs="$noconfigdirs gas"
fi
+use_included_zlib=
+# Make sure we don't let ZLIB be added if we didn't want it.
+if test x$with_system_zlib = xyes ; then
+ use_included_zlib=no
+ noconfigdirs="$noconfigdirs zlib"
+fi
+
# some tools are so dependent upon X11 that if we're not building with X,
# it's not even worth trying to configure, much less build, that tool.
@@ -3251,12 +3509,14 @@ case "${target}" in
# if the --with-newlib option has been given, because otherwise
# 'target-newlib' will appear in skipdirs.
;;
- i[3456789]86-*-mingw32*)
+ i[3456789]86-w64-mingw*)
+ noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}"
+ ;;
+ i[3456789]86-*-mingw*)
target_configdirs="$target_configdirs target-winsup"
noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}"
;;
x86_64-*-mingw*)
- target_configdirs="$target_configdirs target-winsup"
noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}"
;;
*-*-cygwin*)
@@ -3597,7 +3857,7 @@ case "${host}" in
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if cat works as expected" >&5
$as_echo_n "checking to see if cat works as expected... " >&6; }
echo a >cygwin-cat-check
-if test `cat cygwin-cat-check` == a ; then
+if test `cat cygwin-cat-check` = a ; then
rm cygwin-cat-check
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
@@ -5492,7 +5752,7 @@ pplinc=
if test "${with_ppl+set}" = set; then :
withval=$with_ppl;
else
- with_ppl=no
+ with_ppl=yes
fi
@@ -5512,10 +5772,11 @@ case $with_ppl in
no)
ppllibs=
;;
+ yes)
+ ;;
*)
ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
pplinc="-I$with_ppl/include $pplinc"
- LIBS="$ppllibs $LIBS"
;;
esac
if test "x$with_ppl_include" != x; then
@@ -5523,12 +5784,10 @@ if test "x$with_ppl_include" != x; then
fi
if test "x$with_ppl_lib" != x; then
ppllibs="-L$with_ppl_lib -lppl_c -lppl -lgmpxx"
- LIBS="$ppllibs $LIBS"
fi
if test "x$with_ppl$with_ppl_include$with_ppl_lib" = x && test -d ${srcdir}/ppl; then
ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/.libs -L$$r/$(HOST_SUBDIR)/ppl/_libs -lppl_c -lppl -lgmpxx '
pplinc='-I$$r/$(HOST_SUBDIR)/ppl/include -I$$s/ppl/include '
- LIBS="$ppllibs $LIBS"
fi
# Check whether --enable-ppl-version-check was given.
@@ -5539,7 +5798,7 @@ else
fi
-if test "${ENABLE_PPL_CHECK}" = "yes"; then
+if test "x$with_ppl" != "xno" -a "${ENABLE_PPL_CHECK}" = "yes"; then
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $pplinc $gmpinc"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for version $ppl_major_version.$ppl_minor_version of PPL" >&5
@@ -5564,7 +5823,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }; ppllibs= ; pplinc=
+$as_echo "no" >&6; }; ppllibs= ; pplinc= ; with_ppl=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS="$saved_CFLAGS"
@@ -5584,7 +5843,7 @@ clooginc=" -DCLOOG_PPL_BACKEND "
if test "${with_cloog+set}" = set; then :
withval=$with_cloog;
else
- with_cloog=no
+ with_cloog=yes
fi
@@ -5600,15 +5859,20 @@ if test "${with_cloog_lib+set}" = set; then :
fi
+if test "x$with_ppl" = "xno"; then
+ with_cloog=no
+fi
+
case $with_cloog in
no)
clooglibs=
clooginc=
;;
+ yes)
+ ;;
*)
clooglibs="-L$with_cloog/lib -lcloog"
clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
- LIBS="$clooglibs $LIBS"
;;
esac
if test "x$with_cloog_include" != x; then
@@ -5616,12 +5880,10 @@ if test "x$with_cloog_include" != x; then
fi
if test "x$with_cloog_lib" != x; then
clooglibs="-L$with_cloog_lib -lcloog"
- LIBS="$clooglibs $LIBS"
fi
if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/.libs -L$$r/$(HOST_SUBDIR)/cloog/_libs -lcloog '
clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
- LIBS="$clooglibs $LIBS"
fi
# Check whether --enable-cloog-version-check was given.
@@ -5632,7 +5894,7 @@ else
fi
-if test "${ENABLE_CLOOG_CHECK}" = "yes"; then
+if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for correct version of CLooG" >&5
@@ -5667,6 +5929,602 @@ fi
+# Check for LTO support.
+# Check whether --enable-lto was given.
+if test "${enable_lto+set}" = set; then :
+ enableval=$enable_lto; enable_lto=$enableval
+else
+ enable_lto=yes; default_enable_lto=yes
+fi
+
+
+if test x"$enable_lto" = x"yes" ; then
+ # Make sure that libelf.h and gelf.h are available.
+
+# Check whether --with-libelf was given.
+if test "${with_libelf+set}" = set; then :
+ withval=$with_libelf;
+fi
+
+
+
+# Check whether --with-libelf_include was given.
+if test "${with_libelf_include+set}" = set; then :
+ withval=$with_libelf_include;
+fi
+
+
+
+# Check whether --with-libelf_lib was given.
+if test "${with_libelf_lib+set}" = set; then :
+ withval=$with_libelf_lib;
+fi
+
+
+ saved_CFLAGS="$CFLAGS"
+ saved_CPPFLAGS="$CPPFLAGS"
+ saved_LIBS="$LIBS"
+
+ case $with_libelf in
+ "")
+ libelflibs="-lelf"
+ libelfinc="-I/usr/include/libelf"
+ ;;
+ *)
+ libelflibs="-L$with_libelf/lib -lelf"
+ libelfinc="-I$with_libelf/include -I$with_libelf/include/libelf"
+ LIBS="$libelflibs $LIBS"
+ ;;
+ esac
+
+ if test "x$with_libelf_include" != x; then
+ libelfinc="-I$with_libelf_include"
+ fi
+
+ if test "x$with_libelf_lib" != x; then
+ libelflibs="-L$with_libelf_lib -lelf"
+ LIBS="$libelflibs $LIBS"
+ fi
+
+ if test "x$with_libelf$with_libelf_include$with_libelf_lib" = x \
+ && test -d ${srcdir}/libelf; then
+ libelflibs='-L$$r/$(HOST_SUBDIR)/libelf/.libs -L$$r/$(HOST_SUBDIR)/libelf/_libs -lelf '
+ libelfinc='-I$$r/$(HOST_SUBDIR)/libelf/include -I$$s/libelf/include'
+ LIBS="$libelflibs $LIBS"
+ fi
+
+ CFLAGS="$CFLAGS $libelfinc"
+ CPPFLAGS="$CPPFLAGS $libelfinc"
+ LIBS="$LIBS $libelflibs"
+
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+eval as_val=\$$as_ac_Header
+ if test "x$as_val" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in libelf.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "libelf.h" "ac_cv_header_libelf_h" "$ac_includes_default"
+if test "x$ac_cv_header_libelf_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBELF_H 1
+_ACEOF
+ have_libelf_h=yes
+fi
+
+done
+
+ for ac_header in gelf.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "gelf.h" "ac_cv_header_gelf_h" "$ac_includes_default"
+if test "x$ac_cv_header_gelf_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GELF_H 1
+_ACEOF
+ have_gelf_h=yes
+fi
+
+done
+
+
+ for ac_header in libelf/libelf.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "libelf/libelf.h" "ac_cv_header_libelf_libelf_h" "$ac_includes_default"
+if test "x$ac_cv_header_libelf_libelf_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBELF_LIBELF_H 1
+_ACEOF
+ have_libelf_libelf_h=yes
+fi
+
+done
+
+ for ac_header in libelf/gelf.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "libelf/gelf.h" "ac_cv_header_libelf_gelf_h" "$ac_includes_default"
+if test "x$ac_cv_header_libelf_gelf_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBELF_GELF_H 1
+_ACEOF
+ have_libelf_gelf_h=yes
+fi
+
+done
+
+
+ # If we couldn't find libelf.h and the user forced it, emit an error.
+ if test x"$have_libelf_h" != x"yes" \
+ && test x"$have_libelf_libelf_h" != x"yes" ; then
+ if test x"$default_enable_lto" != x"yes" ; then
+ as_fn_error "LTO support requires libelf.h or libelf/libelf.h." "$LINENO" 5
+ else
+ enable_lto=no
+ libelflibs=
+ libelfinc=
+ fi
+ fi
+
+ # If we couldn't find gelf.h and the user forced it, emit an error.
+ if test x"$have_gelf_h" != x"yes" \
+ && test x"$have_libelf_gelf_h" != x"yes" ; then
+ if test x"$default_enable_lto" != x"yes" ; then
+ as_fn_error "LTO support requires gelf.h or libelf/gelf.h." "$LINENO" 5
+ else
+ enable_lto=no
+ libelflibs=
+ libelfinc=
+ fi
+ fi
+
+ # Check that the detected libelf has the functions we need. We cannot
+ # rely on just detecting the headers since they do not include
+ # versioning information. Add functions, if needed.
+ if test x"$enable_lto" = x"yes" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the correct version of libelf" >&5
+$as_echo_n "checking for the correct version of libelf... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <libelf.h>
+int
+main ()
+{
+
+ elf_errmsg (0);
+ elf_getscn (0, 0);
+ elf_nextscn (0, 0);
+ elf_strptr (0, 0, 0);
+ elf_getident (0, 0);
+ elf_getshdrstrndx (0, 0);
+ elf_begin (0, 0, 0);
+ elf_ndxscn (0);
+ elf_end (0);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }; enable_lto=no; libelflibs= ; libelfinc=
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+ # If we couldn't enable LTO and the user forced it, emit an error.
+ if test x"$enable_lto" = x"no" \
+ && test x"$default_enable_lto" != x"yes" ; then
+ as_fn_error "To enable LTO, GCC requires libelf v0.8.12+.
+Try the --with-libelf, --with-libelf-include and --with-libelf-lib options
+to specify its location." "$LINENO" 5
+ fi
+ fi
+
+ CFLAGS="$saved_CFLAGS"
+ CPPFLAGS="$saved_CPPFLAGS"
+ LIBS="$saved_LIBS"
+
+ # Flags needed for libelf.
+
+
+fi
+
# By default, C is the only stage 1 language.
stage1_languages=,c,
@@ -5735,6 +6593,21 @@ if test -d ${srcdir}/gcc; then
done
new_enable_languages=,c,
+
+ # If LTO is enabled, add the LTO front end.
+ extra_host_libiberty_configure_flags=
+ if test "$enable_lto" = "yes" ; then
+ case ,${enable_languages}, in
+ *,lto,*) ;;
+ *) enable_languages="${enable_languages},lto" ;;
+ esac
+ if test "${ENABLE_GOLD}" = "yes" ; then
+ configdirs="$configdirs lto-plugin"
+ extra_host_libiberty_configure_flags=--enable-shared
+ fi
+ fi
+
+
missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ `
potential_languages=,c,
@@ -6197,7 +7070,7 @@ if test x"${with_libs}" != x && test x"${with_libs}" != xno ; then
fi
fi
-# Set with_gnu_as and with_gnu_ld as appropriate.
+# Set with_gnu_as, with_gnu_ld, and with_system_zlib as appropriate.
#
# This is done by determining whether or not the appropriate directory
# is available, and by checking whether or not specific configurations
@@ -6208,7 +7081,9 @@ fi
#
# If the default for a toolchain is to use GNU as and ld, and you don't
# want to do that, then you should use the --without-gnu-as and
-# --without-gnu-ld options for the configure script.
+# --without-gnu-ld options for the configure script. Similarly, if
+# the default is to use the included zlib and you don't want to do that,
+# you should use the --with-system-zlib option for the configure script.
if test x${use_gnu_as} = x &&
echo " ${configdirs} " | grep " gas " > /dev/null 2>&1 ; then
@@ -6222,6 +7097,14 @@ if test x${use_gnu_ld} = x &&
extra_host_args="$extra_host_args --with-gnu-ld"
fi
+if test x${use_included_zlib} = x &&
+ echo " ${configdirs} " | grep " zlib " > /dev/null 2>&1 ; then
+ :
+else
+ with_system_zlib=yes
+ extra_host_args="$extra_host_args --with-system-zlib"
+fi
+
# If using newlib, add --with-newlib to the extra_host_args so that gcc/configure
# can detect this case.
@@ -6920,8 +7803,9 @@ case " $target_configdirs " in
case " $target_configargs " in
*" --with-newlib "*)
case "$target" in
- *-cygwin*)
- FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/include -isystem $$s/winsup/cygwin/include -isystem $$s/winsup/w32api/include' ;;
+ *-cygwin*)
+ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/include -isystem $$s/winsup/cygwin/include -isystem $$s/winsup/w32api/include'
+ ;;
esac
# If we're not building GCC, don't discard standard headers.
@@ -6977,10 +7861,17 @@ case " $target_configdirs " in
esac
;;
esac
+
case "$target" in
-*-mingw*)
- # Can't be handled as Cygwin above since Mingw does not use newlib.
- FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup/mingw -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/mingw/include -isystem $$s/winsup/w32api/include' ;;
+ x86_64-*mingw* | *-w64-mingw*)
+ # MinGW-w64 does not use newlib, nor does it use winsup. It may,
+ # however, use a symlink named 'mingw' in ${prefix} .
+ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L${prefix}/${target}/lib -L${prefix}/mingw/lib -isystem ${prefix}/${target}/include -isystem ${prefix}/mingw/include'
+ ;;
+ *-mingw*)
+ # MinGW can't be handled as Cygwin above since it does not use newlib.
+ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup/mingw -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/mingw/include -isystem $$s/winsup/w32api/include'
+ ;;
esac
# Allow the user to override the flags for
diff --git a/configure.ac b/configure.ac
index 0e68f43a765..5f7f9d1d33f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -260,6 +260,13 @@ if test x$with_gnu_as = xno ; then
noconfigdirs="$noconfigdirs gas"
fi
+use_included_zlib=
+# Make sure we don't let ZLIB be added if we didn't want it.
+if test x$with_system_zlib = xyes ; then
+ use_included_zlib=no
+ noconfigdirs="$noconfigdirs zlib"
+fi
+
# some tools are so dependent upon X11 that if we're not building with X,
# it's not even worth trying to configure, much less build, that tool.
@@ -734,14 +741,16 @@ case "${target}" in
# if the --with-newlib option has been given, because otherwise
# 'target-newlib' will appear in skipdirs.
;;
- i[[3456789]]86-*-mingw32*)
+ i[[3456789]]86-w64-mingw*)
+ noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}"
+ ;;
+ i[[3456789]]86-*-mingw*)
target_configdirs="$target_configdirs target-winsup"
noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}"
- ;;
+ ;;
x86_64-*-mingw*)
- target_configdirs="$target_configdirs target-winsup"
noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}"
- ;;
+ ;;
*-*-cygwin*)
target_configdirs="$target_configdirs target-libtermcap target-winsup"
noconfigdirs="$noconfigdirs target-gperf target-libgloss"
@@ -751,7 +760,7 @@ case "${target}" in
elif test -d "$srcdir/newlib"; then
echo "Warning: winsup/cygwin is missing so newlib can't be built."
fi
- ;;
+ ;;
i[[3456789]]86-moss-msdos | i[[3456789]]86-*-moss* | \
i[[3456789]]86-*-uwin* | i[[3456789]]86-*-interix* )
;;
@@ -1507,7 +1516,7 @@ pplinc=
AC_ARG_WITH(ppl, [ --with-ppl=PATH Specify prefix directory for the installed PPL package
Equivalent to --with-ppl-include=PATH/include
- plus --with-ppl-lib=PATH/lib],, with_ppl=no)
+ plus --with-ppl-lib=PATH/lib],, with_ppl=yes)
AC_ARG_WITH(ppl_include, [ --with-ppl-include=PATH Specify directory for installed PPL include files])
AC_ARG_WITH(ppl_lib, [ --with-ppl-lib=PATH Specify the directory for the installed PPL library])
@@ -1515,10 +1524,11 @@ case $with_ppl in
no)
ppllibs=
;;
+ yes)
+ ;;
*)
ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
pplinc="-I$with_ppl/include $pplinc"
- LIBS="$ppllibs $LIBS"
;;
esac
if test "x$with_ppl_include" != x; then
@@ -1526,12 +1536,10 @@ if test "x$with_ppl_include" != x; then
fi
if test "x$with_ppl_lib" != x; then
ppllibs="-L$with_ppl_lib -lppl_c -lppl -lgmpxx"
- LIBS="$ppllibs $LIBS"
fi
if test "x$with_ppl$with_ppl_include$with_ppl_lib" = x && test -d ${srcdir}/ppl; then
ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/.libs -L$$r/$(HOST_SUBDIR)/ppl/_libs -lppl_c -lppl -lgmpxx '
pplinc='-I$$r/$(HOST_SUBDIR)/ppl/include -I$$s/ppl/include '
- LIBS="$ppllibs $LIBS"
fi
AC_ARG_ENABLE(ppl-version-check,
@@ -1539,7 +1547,7 @@ AC_ARG_ENABLE(ppl-version-check,
ENABLE_PPL_CHECK=$enableval,
ENABLE_PPL_CHECK=yes)
-if test "${ENABLE_PPL_CHECK}" = "yes"; then
+if test "x$with_ppl" != "xno" -a "${ENABLE_PPL_CHECK}" = "yes"; then
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $pplinc $gmpinc"
AC_MSG_CHECKING([for version $ppl_major_version.$ppl_minor_version of PPL])
@@ -1547,7 +1555,7 @@ if test "${ENABLE_PPL_CHECK}" = "yes"; then
#if PPL_VERSION_MAJOR != $ppl_major_version || PPL_VERSION_MINOR != $ppl_minor_version
choke me
#endif
- ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); ppllibs= ; pplinc= ])
+ ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); ppllibs= ; pplinc= ; with_ppl=no ])
CFLAGS="$saved_CFLAGS"
fi
@@ -1562,19 +1570,24 @@ clooginc=" -DCLOOG_PPL_BACKEND "
AC_ARG_WITH(cloog, [ --with-cloog=PATH Specify prefix directory for the installed CLooG-PPL package
Equivalent to --with-cloog-include=PATH/include
- plus --with-cloog-lib=PATH/lib],, with_cloog=no)
+ plus --with-cloog-lib=PATH/lib],, with_cloog=yes)
AC_ARG_WITH(cloog_include, [ --with-cloog-include=PATH Specify directory for installed CLooG include files])
AC_ARG_WITH(cloog_lib, [ --with-cloog-lib=PATH Specify the directory for the installed CLooG library])
+if test "x$with_ppl" = "xno"; then
+ with_cloog=no
+fi
+
case $with_cloog in
no)
clooglibs=
clooginc=
;;
+ yes)
+ ;;
*)
clooglibs="-L$with_cloog/lib -lcloog"
clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
- LIBS="$clooglibs $LIBS"
;;
esac
if test "x$with_cloog_include" != x; then
@@ -1582,12 +1595,10 @@ if test "x$with_cloog_include" != x; then
fi
if test "x$with_cloog_lib" != x; then
clooglibs="-L$with_cloog_lib -lcloog"
- LIBS="$clooglibs $LIBS"
fi
if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/.libs -L$$r/$(HOST_SUBDIR)/cloog/_libs -lcloog '
clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
- LIBS="$clooglibs $LIBS"
fi
AC_ARG_ENABLE(cloog-version-check,
@@ -1595,7 +1606,7 @@ AC_ARG_ENABLE(cloog-version-check,
ENABLE_CLOOG_CHECK=$enableval,
ENABLE_CLOOG_CHECK=yes)
-if test "${ENABLE_CLOOG_CHECK}" = "yes"; then
+if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
AC_MSG_CHECKING([for correct version of CLooG])
@@ -1611,6 +1622,127 @@ fi
AC_SUBST(clooglibs)
AC_SUBST(clooginc)
+# Check for LTO support.
+AC_ARG_ENABLE(lto,
+[ --enable-lto enable link time optimization support],
+enable_lto=$enableval,
+enable_lto=yes; default_enable_lto=yes)
+
+if test x"$enable_lto" = x"yes" ; then
+ # Make sure that libelf.h and gelf.h are available.
+ AC_ARG_WITH(libelf, [ --with-libelf=PATH Specify prefix directory for the installed libelf package
+ Equivalent to --with-libelf-include=PATH/include
+ plus --with-libelf-lib=PATH/lib])
+
+ AC_ARG_WITH(libelf_include, [ --with-libelf-include=PATH Specify directory for installed libelf include files])
+
+ AC_ARG_WITH(libelf_lib, [ --with-libelf-lib=PATH Specify the directory for the installed libelf library])
+
+ saved_CFLAGS="$CFLAGS"
+ saved_CPPFLAGS="$CPPFLAGS"
+ saved_LIBS="$LIBS"
+
+ case $with_libelf in
+ "")
+ libelflibs="-lelf"
+ libelfinc="-I/usr/include/libelf"
+ ;;
+ *)
+ libelflibs="-L$with_libelf/lib -lelf"
+ libelfinc="-I$with_libelf/include -I$with_libelf/include/libelf"
+ LIBS="$libelflibs $LIBS"
+ ;;
+ esac
+
+ if test "x$with_libelf_include" != x; then
+ libelfinc="-I$with_libelf_include"
+ fi
+
+ if test "x$with_libelf_lib" != x; then
+ libelflibs="-L$with_libelf_lib -lelf"
+ LIBS="$libelflibs $LIBS"
+ fi
+
+ if test "x$with_libelf$with_libelf_include$with_libelf_lib" = x \
+ && test -d ${srcdir}/libelf; then
+ libelflibs='-L$$r/$(HOST_SUBDIR)/libelf/.libs -L$$r/$(HOST_SUBDIR)/libelf/_libs -lelf '
+ libelfinc='-I$$r/$(HOST_SUBDIR)/libelf/include -I$$s/libelf/include'
+ LIBS="$libelflibs $LIBS"
+ fi
+
+ CFLAGS="$CFLAGS $libelfinc"
+ CPPFLAGS="$CPPFLAGS $libelfinc"
+ LIBS="$LIBS $libelflibs"
+
+ AC_CHECK_HEADERS(libelf.h, [have_libelf_h=yes])
+ AC_CHECK_HEADERS(gelf.h, [have_gelf_h=yes])
+
+ AC_CHECK_HEADERS(libelf/libelf.h, [have_libelf_libelf_h=yes])
+ AC_CHECK_HEADERS(libelf/gelf.h, [have_libelf_gelf_h=yes])
+
+ # If we couldn't find libelf.h and the user forced it, emit an error.
+ if test x"$have_libelf_h" != x"yes" \
+ && test x"$have_libelf_libelf_h" != x"yes" ; then
+ if test x"$default_enable_lto" != x"yes" ; then
+ AC_MSG_ERROR([LTO support requires libelf.h or libelf/libelf.h.])
+ else
+ enable_lto=no
+ libelflibs=
+ libelfinc=
+ fi
+ fi
+
+ # If we couldn't find gelf.h and the user forced it, emit an error.
+ if test x"$have_gelf_h" != x"yes" \
+ && test x"$have_libelf_gelf_h" != x"yes" ; then
+ if test x"$default_enable_lto" != x"yes" ; then
+ AC_MSG_ERROR([LTO support requires gelf.h or libelf/gelf.h.])
+ else
+ enable_lto=no
+ libelflibs=
+ libelfinc=
+ fi
+ fi
+
+ # Check that the detected libelf has the functions we need. We cannot
+ # rely on just detecting the headers since they do not include
+ # versioning information. Add functions, if needed.
+ if test x"$enable_lto" = x"yes" ; then
+ AC_MSG_CHECKING([for the correct version of libelf])
+ AC_TRY_LINK(
+ [#include <libelf.h>],[
+ elf_errmsg (0);
+ elf_getscn (0, 0);
+ elf_nextscn (0, 0);
+ elf_strptr (0, 0, 0);
+ elf_getident (0, 0);
+ elf_getshdrstrndx (0, 0);
+ elf_begin (0, 0, 0);
+ elf_ndxscn (0);
+ elf_end (0);
+ ],
+ [AC_MSG_RESULT([yes]);],
+ [AC_MSG_RESULT([no]); enable_lto=no; libelflibs= ; libelfinc= ]
+ )
+
+ # If we couldn't enable LTO and the user forced it, emit an error.
+ if test x"$enable_lto" = x"no" \
+ && test x"$default_enable_lto" != x"yes" ; then
+ AC_MSG_ERROR([To enable LTO, GCC requires libelf v0.8.12+.
+Try the --with-libelf, --with-libelf-include and --with-libelf-lib options
+to specify its location.])
+ fi
+ fi
+
+ CFLAGS="$saved_CFLAGS"
+ CPPFLAGS="$saved_CPPFLAGS"
+ LIBS="$saved_LIBS"
+
+ # Flags needed for libelf.
+ AC_SUBST(libelflibs)
+ AC_SUBST(libelfinc)
+fi
+
# By default, C is the only stage 1 language.
stage1_languages=,c,
@@ -1679,6 +1811,21 @@ if test -d ${srcdir}/gcc; then
done
new_enable_languages=,c,
+
+ # If LTO is enabled, add the LTO front end.
+ extra_host_libiberty_configure_flags=
+ if test "$enable_lto" = "yes" ; then
+ case ,${enable_languages}, in
+ *,lto,*) ;;
+ *) enable_languages="${enable_languages},lto" ;;
+ esac
+ if test "${ENABLE_GOLD}" = "yes" ; then
+ configdirs="$configdirs lto-plugin"
+ extra_host_libiberty_configure_flags=--enable-shared
+ fi
+ fi
+ AC_SUBST(extra_host_libiberty_configure_flags)
+
missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ `
potential_languages=,c,
@@ -2088,7 +2235,7 @@ if test x"${with_libs}" != x && test x"${with_libs}" != xno ; then
fi
fi
-# Set with_gnu_as and with_gnu_ld as appropriate.
+# Set with_gnu_as, with_gnu_ld, and with_system_zlib as appropriate.
#
# This is done by determining whether or not the appropriate directory
# is available, and by checking whether or not specific configurations
@@ -2099,7 +2246,9 @@ fi
#
# If the default for a toolchain is to use GNU as and ld, and you don't
# want to do that, then you should use the --without-gnu-as and
-# --without-gnu-ld options for the configure script.
+# --without-gnu-ld options for the configure script. Similarly, if
+# the default is to use the included zlib and you don't want to do that,
+# you should use the --with-system-zlib option for the configure script.
if test x${use_gnu_as} = x &&
echo " ${configdirs} " | grep " gas " > /dev/null 2>&1 ; then
@@ -2113,6 +2262,14 @@ if test x${use_gnu_ld} = x &&
extra_host_args="$extra_host_args --with-gnu-ld"
fi
+if test x${use_included_zlib} = x &&
+ echo " ${configdirs} " | grep " zlib " > /dev/null 2>&1 ; then
+ :
+else
+ with_system_zlib=yes
+ extra_host_args="$extra_host_args --with-system-zlib"
+fi
+
# If using newlib, add --with-newlib to the extra_host_args so that gcc/configure
# can detect this case.
@@ -2802,8 +2959,9 @@ case " $target_configdirs " in
case " $target_configargs " in
*" --with-newlib "*)
case "$target" in
- *-cygwin*)
- FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/include -isystem $$s/winsup/cygwin/include -isystem $$s/winsup/w32api/include' ;;
+ *-cygwin*)
+ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/include -isystem $$s/winsup/cygwin/include -isystem $$s/winsup/w32api/include'
+ ;;
esac
# If we're not building GCC, don't discard standard headers.
@@ -2859,10 +3017,17 @@ case " $target_configdirs " in
esac
;;
esac
+
case "$target" in
-*-mingw*)
- # Can't be handled as Cygwin above since Mingw does not use newlib.
- FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup/mingw -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/mingw/include -isystem $$s/winsup/w32api/include' ;;
+ x86_64-*mingw* | *-w64-mingw*)
+ # MinGW-w64 does not use newlib, nor does it use winsup. It may,
+ # however, use a symlink named 'mingw' in ${prefix} .
+ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L${prefix}/${target}/lib -L${prefix}/mingw/lib -isystem ${prefix}/${target}/include -isystem ${prefix}/mingw/include'
+ ;;
+ *-mingw*)
+ # MinGW can't be handled as Cygwin above since it does not use newlib.
+ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup/mingw -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/mingw/include -isystem $$s/winsup/w32api/include'
+ ;;
esac
# Allow the user to override the flags for
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index b4627d293b6..2dc5d3af5ad 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,9 @@
+2009-10-03 H.J. Lu <hongjiu.lu@intel.com>
+ Richard Guenther <rguenther@suse.de>
+
+ PR lto/39216
+ * gcc_update: Adjust file timestamps for lto-plugin.
+
2009-09-10 Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk>
PR bootstrap/41245
diff --git a/contrib/gcc_update b/contrib/gcc_update
index f29dcb60927..3e5a842338c 100755
--- a/contrib/gcc_update
+++ b/contrib/gcc_update
@@ -84,6 +84,9 @@ gcc/testsuite/gcc.dg/cpp/_Pragma3.c: gcc/testsuite/gcc.dg/cpp/mi1c.h
# Similarly, without this, you will see:
# direct2s.c:35: warning: current file is older than direct2.c
gcc/testsuite/gcc.dg/cpp/direct2s.c: gcc/testsuite/gcc.dg/cpp/direct2.c
+# lto-plugin
+lto-plugin/configure: lto-plugin/configure.ac lto-plugin/aclocal.m4
+lto-plugin/Makefile.in: lto-plugin/Makefile.am lto-plugin/aclocal.m4
# And libraries, at last
libbanshee/configure: libbanshee/configure.ac
libmudflap/configure: libmudflap/configure.ac
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog
index 37258669eed..5ba356d40f6 100644
--- a/fixincludes/ChangeLog
+++ b/fixincludes/ChangeLog
@@ -1,3 +1,9 @@
+2009-10-21 Steve Ellcey <sje@cup.hp.com>
+
+ * inclhack.def (hpux_stdint_least_fast): Simplify.
+ * fixincl.x: Regenerate.
+ * tests/base/stdint.h: Update.
+
2009-09-15 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* inclhack.def (isc_fmod, isc_omits_with_stdc)
diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
index b9b9b040f4d..2d6e1fcd9cf 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 Tuesday September 15, 2009 at 06:55:13 AM CEST
+ * It has been AutoGen-ed Tuesday October 20, 2009 at 04:21:49 PM PDT
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT SVN-MERGE THIS FILE, EITHER Di 15. Sep 06:55:13 CEST 2009
+/* DO NOT SVN-MERGE THIS FILE, EITHER Tue Oct 20 16:21:49 PDT 2009
*
* You must regenerate it. Use the ./genfixes script.
*
@@ -4082,11 +4082,7 @@ static tTestDesc aHpux_Stdint_Least_FastTests[] = {
*/
static const char* apzHpux_Stdint_Least_FastPatch[] = {
"format",
- "#ifdef __LP64__\n\
-# define\tUINT_%164_MAX\tULONG_MAX\n\
-#else\n\
-%0\n\
-#endif",
+ "# define\tUINT_%164_MAX\t__UINT64_MAX__",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index 72841b31f7a..da4a94ce9f9 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -2213,16 +2213,9 @@ fix = {
select =
"^[ \t]*#[ \t]*define[ \t]+UINT_(LEAST|FAST)64_MAX[ \t]+ULLONG_MAX";
c_fix = format;
- c-fix-arg = <<- _EOFix_
- #ifdef __LP64__
- # define UINT_%164_MAX ULONG_MAX
- #else
- %0
- #endif
- _EOFix_;
- test-text = <<- _EOFix_
- # define UINT_FAST64_MAX ULLONG_MAX
- # define UINT_LEAST64_MAX ULLONG_MAX
+ c-fix-arg = "# define UINT_%164_MAX __UINT64_MAX__";
+ test-text = "# define UINT_FAST64_MAX ULLONG_MAX\n"
+ "# define UINT_LEAST64_MAX ULLONG_MAX\n";
_EOFix_;
};
diff --git a/fixincludes/tests/base/stdint.h b/fixincludes/tests/base/stdint.h
index 1c59442182f..3159505f3c3 100644
--- a/fixincludes/tests/base/stdint.h
+++ b/fixincludes/tests/base/stdint.h
@@ -146,16 +146,9 @@
#if defined( HPUX_STDINT_LEAST_FAST_CHECK )
-#ifdef __LP64__
-# define UINT_FAST64_MAX ULONG_MAX
-#else
-# define UINT_FAST64_MAX ULLONG_MAX
-#endif
-#ifdef __LP64__
-# define UINT_LEAST64_MAX ULONG_MAX
-#else
-# define UINT_LEAST64_MAX ULLONG_MAX
-#endif
+# define UINT_FAST64_MAX __UINT64_MAX__
+# define UINT_LEAST64_MAX __UINT64_MAX__
+
#endif /* HPUX_STDINT_LEAST_FAST_CHECK */
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7263e90833f..d0df7de35ed 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,7 +1,3893 @@
+2009-11-06 Michael Matz <matz@suse.de>
+
+ PR middle-end/41963
+ * tree-ssa-math-opts.c (execute_cse_reciprocals): Check all uses
+ of a potential reciprocal to really be reciprocals.
+
+2009-11-06 Jakub Jelinek <jakub@redhat.com>
+
+ * config/i386/x86intrin.h: Include fma4intrin.h, xopintrin.h and
+ lwpintrin.h after immintrin.h.
+ * config/i386/fma4intrin.h (__v8sf, __v4df, __m256, __m256d): Remove
+ typedefs.
+
+ PR middle-end/41935
+ * c-common.c (fold_offsetof_1) <case ARRAY_REF>: Don't crash for VLAs
+ or non-constant index, allow index one past the last element and
+ allow exceeding array bound in arrays that might be used as flexible
+ array members.
+
+2009-11-05 Richard Henderson <rth@redhat.com>
+
+ * config/i386/ia32intrin.h: Protect CRC32 builtins with __SSE4_2__.
+
+2009-11-05 Paul Brook <paul@codesourcery.com>
+
+ * config/arm/arm.c (arm_fp_model, arm_fpu_arch, arm_fpu_tune): Remove.
+ (arm_fpu_desc): New.
+ (all_fpus): Add FPU details.
+ (fp_model_for_fpu): Remove.
+ (arm_override_options): Set and use arm_fpu_desc and arm_fpu_attr.
+ (arm_output_epilogue, arm_save_coproc_regs): Use TARGET_FPA_EMU2.
+ (arm_file_start): Use arm_fpu_desc.
+ * config/arm/arm.h (TARGET_FPA, TARGET_MAVERICK, TARGET_VFP,
+ TARGET_VFPD32, TARGET_VFP3, TARGET_NEON_FP16, TARGET_NEON): Use
+ arm_fpu_desc.
+ (TARGET_FPA_EMU2): Define.
+ (arm_fp_model, fputype, arm_fpu_tune): Remove.
+ (vfp_reg_type, arm_fpu_desc): New.
+ * config/arm/arm.md (attr fpu): Simplify.
+ * config/arm/fpa.md (movxf_fpa): Use TARGET_FPA_EMU2.
+ * config/arm/linux-elf.h (FPUTYPE_DEFAULT): Use string value.
+ * config/arm/bpabi.h (FPUTYPE_DEFAULT): Use string value.
+ * config/arm/netbsd-elf.h (FPUTYPE_DEFAULT): Use string value.
+ * config/arm/vxworks.h (FPUTYPE_DEFAULT): Use string value.
+
+2009-11-05 Michael Matz <matz@suse.de>
+
+ * config/i386/i386.c (ix86_builtin_reciprocal): Remove dependency
+ on TARGET_RECIP.
+ * doc/invoke.texi (-mrecip): Clarify that we don't need -mrecip
+ for 1/sqrtf.
+
+2009-11-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/36912
+ * varasm.c (initializer_constant_valid_p): A PLUS_EXPR
+ or MINUS_EXPR of REAL_TYPE is not a valid constant initializer.
+ (output_constant): Avoid crash after error.
+
+2009-11-05 Martin Jambor <mjambor@suse.cz>
+
+ * tree-sra.c (struct access): Changed comment of next_sibling field.
+ (analyze_modified_params): Loop over accesses of a group rather than
+ over all with the ame base, pass a common bitmap to
+ walk_aliased_vdefs.
+ (unmodified_by_ref_scalar_representative): Build link lists of
+ accesses of a group.
+ (splice_param_accesses): Likewise.
+
+2009-11-04 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * df-scan.c (df-uses-record): Add case zero_extract of mem.
+
+2009-11-04 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/10127
+ PR ada/20548
+ * config/i386/i386.md (probe_stack): New expander.
+ (logical operation peepholes): Do not split stack checking probes.
+
+2009-11-04 Harsha Jagasia <harsha.jagasia@amd.com>
+ Dwarakanath Rajagopal <dwarak.rajagopal@amd.com>
+
+ * doc/invoke.texi (-mlwp): Add documentation.
+ * doc/extend.texi (x86 intrinsics): Add LWP intrinsics.
+ * config.gcc (i[34567]86-*-*): Include lwpintrin.h.
+ (x86_64-*-*): Ditto.
+ * config/i386/lwpintrin.h: New file, provide x86 compiler
+ intrinisics for LWP.
+ * config/i386/cpuid.h (bit_LWP): Define LWP bit.
+ * config/i386/x86intrin.h: Add LWP check and lwpintrin.h.
+ * config/i386/i386-c.c (ix86_target_macros_internal): Check
+ ISA_FLAG for LWP.
+ * config/i386/i386.h (TARGET_LWP): New macro for LWP.
+ * config/i386/i386.opt (-mlwp): New switch for LWP support.
+ * config/i386/i386.c (OPTION_MASK_ISA_LWP_SET): New.
+ (OPTION_MASK_ISA_LWP_UNSET): New.
+ (ix86_handle_option): Handle -mlwp.
+ (isa_opts): Handle -mlwp.
+ (enum pta_flags): Add PTA_LWP.
+ (override_options): Add LWP support.
+ (IX86_BUILTIN_LLWPCB16): New for LWP intrinsic.
+ (IX86_BUILTIN_LLWPCB32): Ditto.
+ (IX86_BUILTIN_LLWPCB64): Ditto.
+ (IX86_BUILTIN_SLWPCB16): Ditto.
+ (IX86_BUILTIN_SLWPCB32): Ditto.
+ (IX86_BUILTIN_SLWPCB64): Ditto.
+ (IX86_BUILTIN_LWPVAL16): Ditto.
+ (IX86_BUILTIN_LWPVAL32): Ditto.
+ (IX86_BUILTIN_LWPVAL64): Ditto.
+ (IX86_BUILTIN_LWPINS16): Ditto.
+ (IX86_BUILTIN_LWPINS32): Ditto.
+ (IX86_BUILTIN_LWPINS64): Ditto.
+ (enum ix86_special_builtin_type): Add LWP intrinsic support.
+ (builtin_description): Ditto.
+ (ix86_init_mmx_sse_builtins): Ditto.
+ (ix86_expand_special_args_builtin): Ditto.
+ * config/i386/i386.md (UNSPEC_LLWP_INTRINSIC): Add new UNSPEC for
+ LWP support.
+ (UNSPEC_SLWP_INTRINSIC): Ditto.
+ (UNSPECV_LWPVAL_INTRINSIC): Ditto.
+ (UNSPECV_LWPINS_INTRINSIC): Ditto.
+ (lwp_llwpcbhi1): New lwp pattern.
+ (lwp_llwpcbsi1): Ditto.
+ (lwp_llwpcbdi1): Ditto.
+ (lwp_slwpcbhi1): Ditto.
+ (lwp_slwpcbsi1): Ditto.
+ (lwp_slwpcbdi1): Ditto.
+ (lwp_lwpvalhi3): Ditto.
+ (lwp_lwpvalsi3): Ditto.
+ (lwp_lwpvaldi3): Ditto.
+ (lwp_lwpinshi3): Ditto.
+ (lwp_lwpinssi3): Ditto.
+ (lwp_lwpinsdi3): Ditto.
+
+2009-11-04 Andrew Pinski <andrew_pinski@playstation.sony.com>
+ Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
+
+ PR rtl-opt/41833
+ * simplify-rtx.c (simplify_binary_operation_1): Simplify vec_select of
+ a vec_duplicate.
+
+2009-11-04 Richard Guenther <rguenther@suse.de>
+ Rafael Avila de Espindola <espindola@google.com>
+
+ * gcc.c (process_command): Handle arguments name@offset.
+
+2009-11-04 Harsha Jagasia <harsha.jagasia@amd.com>
+ Dwarakanath Rajagopal <dwarak.rajagopal@amd.com>
+
+ * config.gcc (i[34567]86-*-*): Include xopintrin.h.
+ (x86_64-*-*): Ditto.
+ * config/i386/xopintrin.h: New file, provide common x86 compiler
+ intrinisics for XOP.
+ * config/i386/cpuid.h (bit_XOP): Define XOP bit.
+ * config/i386/x86intrin.h: Add XOP check and xopintrin.h.
+ * config/i386/i386-c.c(ix86_target_macros_internal): Check
+ ISA_FLAG for XOP.
+ * config/i386/i386.h(TARGET_XOP): New macro for XOP.
+ * config/i386/i386.opt (-mxop): New switch for XOP support.
+ * config/i386/i386.md (UNSPEC_XOP_UNSIGNED_CMP)
+ (UNSPEC_XOP_TRUEFALSE)
+ (UNSPEC_XOP_PERMUTE)
+ (UNSPEC_FRCZ): Add new UNSPEC for XOP support.
+ (PPERM_*): New constants for vpperm instruction.
+ (xop_pcmov_<mode>): Add XOP conditional mov instructions.
+ * config/i386/i386.c (OPTION_MASK_ISA_XOP_SET): New.
+ (OPTION_MASK_ISA_XOP_UNSET): New.
+ (OPTION_MASK_ISA_XOP_UNSET): Change definition to
+ depend on XOP.
+ (ix86_handle_option): Handle -mxop.
+ (isa_opts): Handle -mxop.
+ (enum pta_flags): Add PTA_XOP.
+ (override_options): Add XOP support.
+ (print_operand): Add code for XOP compare instructions.
+ (ix86_expand_sse_movcc): Extend for XOP conditional move instruction.
+ (ix86_expand_int_vcond): Extend for XOP compare instruction.
+
+ (IX86_BUILTIN_VPCMOV): New for XOP intrinsic.
+ (IX86_BUILTIN_VPCMOV_V2DI): Ditto.
+ (IX86_BUILTIN_VPCMOV_V4SI): Ditto.
+ (IX86_BUILTIN_VPCMOV_V8HI): Ditto.
+ (IX86_BUILTIN_VPCMOV_V16QI): Ditto.
+ (IX86_BUILTIN_VPCMOV_V4SF): Ditto.
+ (IX86_BUILTIN_VPCMOV_V2DF): Ditto.
+
+ (IX86_BUILTIN_VPCMOV256): Ditto.
+ (IX86_BUILTIN_VPCMOV_V4DI256): Ditto.
+ (IX86_BUILTIN_VPCMOV_V8SI256): Ditto.
+ (IX86_BUILTIN_VPCMOV_V16HI256): Ditto.
+ (IX86_BUILTIN_VPCMOV_V32QI256): Ditto.
+ (IX86_BUILTIN_VPCMOV_V8SF256): Ditto.
+ (IX86_BUILTIN_VPCMOV_V4DF256): Ditto.
+
+ (IX86_BUILTIN_VPPERM): Ditto.
+
+ (IX86_BUILTIN_VPMACSSWW): Ditto.
+ (IX86_BUILTIN_VPMACSWW): Ditto.
+ (IX86_BUILTIN_VPMACSSWD): Ditto.
+ (IX86_BUILTIN_VPMACSWD): Ditto.
+ (IX86_BUILTIN_VPMACSSDD): Ditto.
+ (IX86_BUILTIN_VPMACSDD): Ditto.
+ (IX86_BUILTIN_VPMACSSDQL): Ditto.
+ (IX86_BUILTIN_VPMACSSDQH): Ditto.
+ (IX86_BUILTIN_VPMACSDQL): Ditto.
+ (IX86_BUILTIN_VPMACSDQH): Ditto.
+ (IX86_BUILTIN_VPMADCSSWD): Ditto.
+ (IX86_BUILTIN_VPMADCSWD): Ditto.
+
+ (IX86_BUILTIN_VPHADDBW): Ditto.
+ (IX86_BUILTIN_VPHADDBD): Ditto.
+ (IX86_BUILTIN_VPHADDBQ): Ditto.
+ (IX86_BUILTIN_VPHADDWD): Ditto.
+ (IX86_BUILTIN_VPHADDWQ): Ditto.
+ (IX86_BUILTIN_VPHADDDQ): Ditto.
+ (IX86_BUILTIN_VPHADDUBW): Ditto.
+ (IX86_BUILTIN_VPHADDUBD): Ditto.
+ (IX86_BUILTIN_VPHADDUBQ): Ditto.
+ (IX86_BUILTIN_VPHADDUWD): Ditto.
+ (IX86_BUILTIN_VPHADDUWQ): Ditto.
+ (IX86_BUILTIN_VPHADDUDQ): Ditto.
+ (IX86_BUILTIN_VPHSUBBW): Ditto.
+ (IX86_BUILTIN_VPHSUBWD): Ditto.
+ (IX86_BUILTIN_VPHSUBDQ): Ditto.
+
+ (IX86_BUILTIN_VPROTB): Ditto.
+ (IX86_BUILTIN_VPROTW): Ditto.
+ (IX86_BUILTIN_VPROTD): Ditto.
+ (IX86_BUILTIN_VPROTQ): Ditto.
+ (IX86_BUILTIN_VPROTB_IMM): Ditto.
+ (IX86_BUILTIN_VPROTW_IMM): Ditto.
+ (IX86_BUILTIN_VPROTD_IMM): Ditto.
+ (IX86_BUILTIN_VPROTQ_IMM): Ditto.
+
+ (IX86_BUILTIN_VPSHLB): Ditto.
+ (IX86_BUILTIN_VPSHLW): Ditto.
+ (IX86_BUILTIN_VPSHLD): Ditto.
+ (IX86_BUILTIN_VPSHLQ): Ditto.
+ (IX86_BUILTIN_VPSHAB): Ditto.
+ (IX86_BUILTIN_VPSHAW): Ditto.
+ (IX86_BUILTIN_VPSHAD): Ditto.
+ (IX86_BUILTIN_VPSHAQ): Ditto.
+
+ (IX86_BUILTIN_VFRCZSS): Ditto.
+ (IX86_BUILTIN_VFRCZSD): Ditto.
+ (IX86_BUILTIN_VFRCZPS): Ditto.
+ (IX86_BUILTIN_VFRCZPD): Ditto.
+ (IX86_BUILTIN_VFRCZPS256): Ditto.
+ (IX86_BUILTIN_VFRCZPD256): Ditto.
+
+ (IX86_BUILTIN_VPCOMEQUB): Ditto.
+ (IX86_BUILTIN_VPCOMNEUB): Ditto.
+ (IX86_BUILTIN_VPCOMLTUB): Ditto.
+ (IX86_BUILTIN_VPCOMLEUB): Ditto.
+ (IX86_BUILTIN_VPCOMGTUB): Ditto.
+ (IX86_BUILTIN_VPCOMGEUB): Ditto.
+ (IX86_BUILTIN_VPCOMFALSEUB): Ditto.
+ (IX86_BUILTIN_VPCOMTRUEUB): Ditto.
+
+ (IX86_BUILTIN_VPCOMEQUW): Ditto.
+ (IX86_BUILTIN_VPCOMNEUW): Ditto.
+ (IX86_BUILTIN_VPCOMLTUW): Ditto.
+ (IX86_BUILTIN_VPCOMLEUW): Ditto.
+ (IX86_BUILTIN_VPCOMGTUW): Ditto.
+ (IX86_BUILTIN_VPCOMGEUW): Ditto.
+ (IX86_BUILTIN_VPCOMFALSEUW): Ditto.
+ (IX86_BUILTIN_VPCOMTRUEUW): Ditto.
+
+ (IX86_BUILTIN_VPCOMEQUD): Ditto.
+ (IX86_BUILTIN_VPCOMNEUD): Ditto.
+ (IX86_BUILTIN_VPCOMLTUD): Ditto.
+ (IX86_BUILTIN_VPCOMLEUD): Ditto.
+ (IX86_BUILTIN_VPCOMGTUD): Ditto.
+ (IX86_BUILTIN_VPCOMGEUD): Ditto.
+ (IX86_BUILTIN_VPCOMFALSEUD): Ditto.
+ (IX86_BUILTIN_VPCOMTRUEUD): Ditto.
+
+ (IX86_BUILTIN_VPCOMEQUQ): Ditto.
+ (IX86_BUILTIN_VPCOMNEUQ): Ditto.
+ (IX86_BUILTIN_VPCOMLTUQ): Ditto.
+ (IX86_BUILTIN_VPCOMLEUQ): Ditto.
+ (IX86_BUILTIN_VPCOMGTUQ): Ditto.
+ (IX86_BUILTIN_VPCOMGEUQ): Ditto.
+ (IX86_BUILTIN_VPCOMFALSEUQ): Ditto.
+ (IX86_BUILTIN_VPCOMTRUEUQ): Ditto.
+
+ (IX86_BUILTIN_VPCOMEQB): Ditto.
+ (IX86_BUILTIN_VPCOMNEB): Ditto.
+ (IX86_BUILTIN_VPCOMLTB): Ditto.
+ (IX86_BUILTIN_VPCOMLEB): Ditto.
+ (IX86_BUILTIN_VPCOMGTB): Ditto.
+ (IX86_BUILTIN_VPCOMGEB): Ditto.
+ (IX86_BUILTIN_VPCOMFALSEB): Ditto.
+ (IX86_BUILTIN_VPCOMTRUEB): Ditto.
+
+ (IX86_BUILTIN_VPCOMEQW): Ditto.
+ (IX86_BUILTIN_VPCOMNEW): Ditto.
+ (IX86_BUILTIN_VPCOMLTW): Ditto.
+ (IX86_BUILTIN_VPCOMLEW): Ditto.
+ (IX86_BUILTIN_VPCOMGTW): Ditto.
+ (IX86_BUILTIN_VPCOMGEW): Ditto.
+ (IX86_BUILTIN_VPCOMFALSEW): Ditto.
+ (IX86_BUILTIN_VPCOMTRUEW): Ditto.
+
+ (IX86_BUILTIN_VPCOMEQD): Ditto.
+ (IX86_BUILTIN_VPCOMNED): Ditto.
+ (IX86_BUILTIN_VPCOMLTD): Ditto.
+ (IX86_BUILTIN_VPCOMLED): Ditto.
+ (IX86_BUILTIN_VPCOMGTD): Ditto.
+ (IX86_BUILTIN_VPCOMGED): Ditto.
+ (IX86_BUILTIN_VPCOMFALSED): Ditto.
+ (IX86_BUILTIN_VPCOMTRUED): Ditto.
+
+ (IX86_BUILTIN_VPCOMEQQ): Ditto.
+ (IX86_BUILTIN_VPCOMNEQ): Ditto.
+ (IX86_BUILTIN_VPCOMLTQ): Ditto.
+ (IX86_BUILTIN_VPCOMLEQ): Ditto.
+ (IX86_BUILTIN_VPCOMGTQ): Ditto.
+ (IX86_BUILTIN_VPCOMGEQ): Ditto.
+ (IX86_BUILTIN_VPCOMFALSEQ): Ditto.
+ (IX86_BUILTIN_VPCOMTRUEQ): Ditto.
+
+ (enum multi_arg_type): New enum for describing the various XOP
+ intrinsic argument types.
+ (bdesc_multi_arg): New table for XOP intrinsics.
+ (ix86_init_mmx_sse_builtins): Add XOP intrinsic support.
+ (ix86_expand_multi_arg_builtin): New function for creating XOP
+ intrinsics.
+
+ * config/i386/sse.md (sserotatemax): New mode attribute for XOP.
+ (xop_pmacsww): Ditto.
+ (xop_pmacssww): Ditto.
+ (xop_pmacsdd): Ditto.
+ (xop_pmacssdd): Ditto.
+ (xop_pmacssdql): Ditto.
+ (xop_pmacssdqh): Ditto.
+ (xop_pmacsdql): Ditto.
+ (xop_pmacsdql_mem): Ditto.
+ (xop_mulv2div2di3_low): Ditto.
+ (xop_pmacsdqh): Ditto.
+ (xop_pmacsdqh_mem): Ditto.
+ (xop_mulv2div2di3_high): Ditto.
+ (xop_pmacsswd): Ditto.
+ (xop_pmacswd): Ditto.
+ (xop_pmadcsswd): Ditto.
+ (xop_pmadcswd): Ditto.
+ (xop_pcmov_<mode>): Ditto.
+ (xop_pcmov_<mode>)256: Ditto.
+ (xop_phaddbw): Ditto.
+ (xop_phaddbd): Ditto.
+ (xop_phaddbq): Ditto.
+ (xop_phaddwd): Ditto.
+ (xop_phaddwq): Ditto.
+ (xop_phadddq): Ditto.
+ (xop_phaddubw): Ditto.
+ (xop_phaddubd): Ditto.
+ (xop_phaddubq): Ditto.
+ (xop_phadduwd): Ditto.
+ (xop_phadduwq): Ditto.
+ (xop_phaddudq): Ditto.
+ (xop_phsubbw): Ditto.
+ (xop_phsubwd): Ditto.
+ (xop_phsubdq): Ditto.
+ (xop_pperm): Ditto.
+ (rotl<mode>3): Ditto.
+ (rotr<mode>3): Ditto.
+ (xop_rotl<mode>3): Ditto.
+ (xop_rotr<mode>3): Ditto.
+ (vrotr<mode>3): Ditto.
+ (vrotl<mode>3): Ditto.
+ (xop_vrotl<mode>3): Ditto.
+ (vlshr<mode>3): Ditto.
+ (vashr<mode>3): Ditto.
+ (vashl<mode>3
+ (xop_ashl<mode>3): Ditto.
+ (xop_lshl<mode>3): Ditto.
+ (ashlv16qi3): Ditto.
+ (lshlv16qi3): Ditto.
+ (ashrv16qi3): Ditto.
+ (ashrv2di3): Ditto.
+ (xop_frcz<mode>2): Ditto.
+ (xop_vmfrcz<mode>2): Ditto.
+ (xop_frcz<mode>2256): Ditto.
+ (xop_maskcmp<mode>3): Ditto.
+ (xop_maskcmp_uns<mode>3): Ditto.
+ (xop_maskcmp_uns2<mode>3): Ditto.
+ (xop_pcom_tf<mode>3): Ditto.
+
+ * doc/invoke.texi (-mxop): Add documentation.
+ * doc/extend.texi (x86 intrinsics): Add XOP intrinsics.
+
+2009-11-03 Mark Mitchell <mark@codesourcery.com>
+
+ PR driver/11810
+ * gcc.c (SWITCHES_NEED_SPACES): Define to "o".
+ * config/alpha/osf.h (SWITCHES_NEED_SPACES): Remove here.
+ * config/mips/iris.h (SWITCHES_NEED_SPACES): Remove here.
+
+2009-11-04 Richard Earnshaw <rearnsha@arm.com>
+
+ PR target/40835
+ * arm.md (peephole2 patterns for move and compare): New.
+
+2009-11-04 Nick Clifton <nickc@redhat.com>
+
+ * defaults.h (CONSTANT_ADDRESS_P): Provide a default definition.
+ Make sure that it does not allow CONST_DOUBLEs.
+ * doc/tm.texi (CONSTANT_ADDRESS_P): Update description.
+ * config/avr/avr.h (CONSTANT_ADDRESS_P): Delete.
+ * config/bfin/bfin.h (CONSTANT_ADDRESS_P): Delete.
+ * config/cris/cris.h (CONSTANT_ADDRESS_P): Delete.
+ * config/fr30/fr30.h (CONSTANT_ADDRESS_P): Delete.
+ * config/frv/frv.h (CONSTANT_ADDRESS_P): Delete.
+ * config/m32c/m32c.h (CONSTANT_ADDRESS_P): Delete.
+ * config/m68hc11/m68hc11.h (CONSTANT_ADDRESS_P): Delete.
+ * config/mep/mep.h (CONSTANT_ADDRESS_P): Delete.
+ * config/mn10300/mn10300.h (CONSTANT_ADDRESS_P): Delete.
+ * config/moxie/moxie.h (CONSTANT_ADDRESS_P): Delete.
+ * config/pdp11/pdp11.h (CONSTANT_ADDRESS_P): Delete.
+ * config/picochip/picochip.h (CONSTANT_ADDRESS_P): Delete.
+ * config/score/score.h (CONSTANT_ADDRESS_P): Delete.
+ * config/stormy16/stormy16.h (CONSTANT_ADDRESS_P): Delete.
+
+2009-11-04 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/41919
+ * tree-vrp.c (test_for_singularity): Properly compare values.
+
+2009-11-04 Revital Eres <eres@il.ibm.com>
+
+ * tree-vect-data-refs.c (vect_enhance_data_refs_alignment):
+ Consider peeling for alignment only for stores and remove
+ redundant assignment.
+
+2009-11-04 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ PR target/41302
+ * config/m68k/m68k.c (m68k_reg_present_p): New static function.
+ (m68k_ok_for_sibcall_p): Handle different result return locations.
+
+2009-11-04 Richard Guenther <rguenther@suse.de>
+
+ * c-opts.c (c_common_post_options): Move LTO option processing
+ code ...
+ * opts.c (decode_options): ... here.
+
+2009-11-04 Jakub Jelinek <jakub@redhat.com>
+
+ * c-common.c (fold_offsetof_1): Use %wd instead of
+ HOST_WIDE_INT_PRINT_DEC.
+
+2009-11-04 Maciej W. Rozycki <macro@linux-mips.org>
+
+ * config/vax/linux.h (TARGET_OS_CPP_BUILTINS): Don't define
+ __pic__ or __PIC__.
+
+2009-11-04 Maciej W. Rozycki <macro@linux-mips.org>
+
+ * config.gcc (vax-*-linux*): Keep the original contents of
+ tmake_file while adding vax/t-linux.
+
+2009-11-03 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/10127
+ PR ada/20548
+ * expr.h (STACK_CHECK_PROBE_INTERVAL): Delete.
+ (STACK_CHECK_PROBE_INTERVAL_EXP): New macro.
+ (STACK_CHECK_MOVING_SP): Likewise.
+ * system.h (STACK_CHECK_PROBE_INTERVAL): Poison it.
+ * doc/tm.texi (Stack Checking): Delete STACK_CHECK_PROBE_INTERVAL.
+ Document STACK_CHECK_PROBE_INTERVAL_EXP and STACK_CHECK_MOVING_SP.
+ * doc/md.texi (Standard Pattern Names): Tweak entry of CHECK_STACK.
+ Document PROBE_STACK.
+ * explow.c (anti_adjust_stack_and_probe): New function.
+ (allocate_dynamic_stack_space): Do not directly allocate space if
+ STACK_CHECK_MOVING_SP, instead invoke above function.
+ (emit_stack_probe): Handle probe_stack insn.
+ (PROBE_INTERVAL): New macro.
+ (STACK_GROW_OPTAB): Likewise.
+ (STACK_GROW_OFF): Likewise.
+ (probe_stack_range): Use Pmode and memory_address consistently. Fix
+ loop condition in the small constant case. Rewrite in the general
+ case to be immune to wraparounds. Make sure the address of probes
+ is valid. Try to use [base + disp] addressing mode if possible.
+ * ira.c (setup_eliminable_regset): Set frame_pointer_needed if stack
+ checking is enabled and STACK_CHECK_MOVING_SP.
+ * rtlanal.c (may_trap_p_1) <MEM>: If stack checking is enabled,
+ return 1 for volatile references to the stack pointer.
+ * tree.c (build_common_builtin_nodes): Do not set ECF_NOTHROW on
+ __builtin_alloca if stack checking is enabled.
+ * unwind-dw2.c (uw_identify_context): Take into account whether the
+ context is that of a signal frame or not.
+ * config/i386/linux.h (STACK_CHECK_MOVING_SP): Define to 1.
+ * config/i386/linux64.h (STACK_CHECK_MOVING_SP): Likewise.
+
+2009-11-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/41917
+ * rtlanal.c (num_sign_bit_copies1) <case UMOD>: If sign bit of second
+ operand isn't known to be 0, return 1.
+
+2009-11-03 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * config/mips/mips.md: Fix typos.
+
+2009-11-03 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * doc/invoke.texi: Fix typo.
+
+2009-11-03 Paul Brook <paul@codesourcery.com>
+
+ * config/arm/neon.ml (vectype): Add T_floatSF.
+ (string_of_vectype): Ditto.
+ * config/arm/neon-gen.ml (signed_ctype): Add T_floatSF.
+ (deftypes): Use float for float32_t.
+ * config/arm/arm_neon.h: Regenerate.
+
+2009-11-03 Nick Clifton <nickc@redhat.com>
+ Kevin Buettner <kevinb@redhat.com>
+
+ * config/rx/predicates.md (rx_store_multiple_vector): Reverse
+ order of expected registers.
+ (rx_load_multiple_vector): Likewise.
+ (rx_rtsd_vector): Likewise.
+ * config/rx/rx.c (rx_cpu_type): New variable.
+ (rx_print_operand): Fix bug printing 64-bit constant values.
+ (rx_emit_stack_pushm): Reverse order of pushed registers.
+ (gen_rx_store_vector): Likewise.
+ (is_fast_interrupt_func): Only accept "fast_interrupt" as the
+ attribute name.
+ (is_exception_func): Rename to is_interrupt_func and only accept
+ "interrupt" as the attribute name.
+ (rx_get_stack_layout): Use new function name.
+ (rx_func_attr_inlinable): Likewise.
+ (rx_attribute_table): Remove "exception".
+ (rx_expand_prologue): If necessary push the accumulator register
+ in the prologue of interrupt functions.
+ (rx_expand_epilogue): If necessary pop the accumulator.
+ (rx_builtins): Add RX_BUILTIN_MVTIPL.
+ (rx_expand_builtin_stz): Remove.
+ (rx_expand_builtin_mvtipl): New function.
+ (rx_init_builtins): Handle RX_BUILTIN_MVTIPL.
+ (rx_expand_builtin): Likewise.
+ (rx_enable_fpu): New variable.
+ (rx_handle_option): Handle -fpu, -nofpu, -mcpu and -patch.
+ * config/rx/rx.h (TARGET_CPU_CPP_BUILTINS): Assert machine based
+ on rx_cpu_type. Define __RX_FPU_INSNS__ if FPU insns are allowed.
+ (enum rx_cpu_types): Define.
+ (ASM_SPEC): Pass -m32bit-doubles on to assembler.
+ (INCOMING_FRAME_SP_OFFSET): Define.
+ (ARG_POINTER_CFA_OFFSET): Define.
+ (FRAME_POINTER_CFA_OFFSET): Define.
+ (OVERRIDE_OPTIONS): Enable fast math if RX FPU insns are enabled.
+ (ALLOW_RX_FPU_INSNS): Define.
+ * config/rx/rx.md: Test ALLOW_RX_FPU_INSNS instead of
+ fast_math_flags_set_p.
+ (UNSPEC_BUILTIN_MVTIPL): Define.
+ (revl): Rename to bswapsi2.
+ (bswaphi2): New pattern.
+ (mvtachi): Mark as volatile because it uses a register unknown to GCC.
+ (mvtaclo): Likewise.
+ (racw): Likewise.
+ (mvtc): Remove clobber of cc0.
+ (mvtcp): Delete.
+ (opecp): Delete.
+ * config/rx/rx.opt (mieee): Remove.
+ (fpu): Add.
+ (nofpu): Add.
+ (mcpu=): Add.
+ (patch=): Add.
+ (msave-acc-in-interrupts): Add.
+ * config/rx/t-rx (MULTILIB_OPTIONS): Change default to 64bit doubles.
+ (MULTILIB_DIRS): Likewise.
+ (MULTILIB_MATCHES): Treat -fpu as an alias for -m32bit-doubles.
+ * doc/extend.texi: Remove description of "exception" function
+ attribute.
+ * doc/invoke.texi: Document -fpu, -nofpu, -mcpu=, -patch= and
+ -msave-acc-in-interrupts options.
+
+2009-11-03 Richard Guenther <rguenther@suse.de>
+
+ * c-common.c (fold_offsetof_1): Use HOST_WIDE_INT_PRINT_DEC.
+
+2009-11-03 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/38699
+ * c-common.c (fold_offsetof_1): Issue errors when the member designator
+ of the offsetof expression is not legitimate.
+
+2009-11-03 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (*call_value_1_rex64_ms_sysv): Use register
+ names instead of numerical constants.
+ (sse_prologue_save): Ditto.
+ (*sse_prologue_save_insn): Ditto.
+
+2009-11-03 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/41900
+ * config/i386/i386.h (ix86_arch_indices) <X86_ARCH_CALL_ESP>: New.
+ (TARGET_CALL_ESP): New define.
+ * config/i386/i386.c (initial_ix86_tune_features): Initialize
+ X86_ARCH_CALL_ESP.
+ * config/i386/i386.md (*call_pop_1_esp, *call_1_esp,
+ *call_value_pop_1_esp, *call_value_1_esp): Rename from *call_pop_1,
+ *call_1, *call_value_pop_1 and *call_value_1. Depend on
+ TARGET_CALL_ESP.
+ (*call_pop_1, *call_1, *call_value_pop_1, *call_value_1):
+ New patterns, use "lsm" as operand 1 constraint.
+ * config/i386/predicates.md (call_insn_operand): Depend on
+ index_register_operand for !TARGET_CALL_ESP to avoid %esp register.
+
+2009-11-02 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ PR tree-optimization/41857
+ * tree-flow.h (rewrite_use_address): Add BASE_HINT argument.
+ * tree-ssa-loop-ivopts.c (rewrite_use_address): Pass base hint
+ to create_mem_ref.
+ * tree-ssa-address.c (move_hint_to_base): New function.
+ (most_expensive_mult_to_index): Add TYPE argument. Use mode and
+ address space associated with TYPE.
+ (addr_to_parts): Add TYPE and BASE_HINT arguments. Pass TYPE to
+ most_expensive_mult_to_index. Call move_hint_to_base.
+ (create_mem_ref): Add BASE_HINT argument. Pass BASE_HINT and
+ TYPE to addr_to_parts.
+
+2009-11-02 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/41750
+ * tree-sra.c (analyze_modified_params): Loop over all
+ representatives of components of a parameter.
+
+2009-11-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/41841
+ * ipa-struct-reorg.c (build_data_structure): Don't attempt to look at
+ local variables of not yet materialized clones.
+
+ PR debug/41893
+ * cfgexpand.c (expand_debug_expr): Don't attempt to create DECL_RTL
+ for a VOIDmode variable.
+
+ PR c++/41774
+ * c-pragma.c (visstack): Change into vector of ints rather than
+ enum symbol_visibility.
+ (push_visibility): Add kind argument, push default_visibility together
+ with kind.
+ (pop_visibility): Add kind argument, return true if successful, fail
+ if visibility stack is empty or if stack top is of different kind.
+ (handle_pragma_visibility): Don't check length of visstack, instead
+ call pop_visibility and issue diagnostics if it failed. Pass 0
+ as last argument to push_visibility and pop_visibility.
+ * c-pragma.h (push_visibility): Add kind argument.
+ (pop_visibility): Likewise. Return bool instead of void.
+
+2009-11-01 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree.def (TARGET_MEM_REF): Update comment.
+ * alias.c (get_alias_set): Retrieve the original memory reference for
+ a TARGET_MEM_REF before proceeding.
+
+2009-10-31 Anatoly Sokolov <aesok@post.ru>
+
+ * config/frv/frv.c (frv_function_value, frv_libcall_value,
+ frv_function_value_regno_p): New functions.
+ (TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE): Declare.
+ * config/frv/frv.h: (FUNCTION_VALUE, LIBCALL_VALUE): Remove.
+ (FUNCTION_VALUE_REGNO_P): Redefine, use frv_function_value_regno_p.
+ * config/frv/frv-protos.h (frv_function_value_regno_p): Declare.
+
+2009-10-31 Anatoly Sokolov <aesok@post.ru>
+
+ * config/mn10300/mn10300.c (mn10300_function_value): Make static, add
+ new 'outgoing' argument.
+ (mn10300_libcall_value, mn10300_function_value_regno_p): New functions.
+ (TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE): Declare.
+ * config/mn10300/mn10300.h: (FUNCTION_VALUE, FUNCTION_OUTGOING_VALUE,
+ LIBCALL_VALUE): Remove.
+ (FUNCTION_VALUE_REGNO_P): Redefine, use mn10300_function_value_regno_p.
+ * config/mn10300/mn10300-protos.h (mn10300_function_value): Remove.
+ (mh10300_function_value_regno_p): Declare.
+
+2009-10-31 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+
+ * config/arm/cortex-a9.md: New - integer pipeline description.
+
+2009-10-31 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree-ssa-sccvn.c (vn_reference_lookup_3): Bail out instead of
+ aborting if the sizes of the two references don't match.
+
+2009-10-31 Toon Moene <toon@moene.org>
+
+ * ipa-inline.c (cgraph_decide_inlining):
+ Include reason for not inlining called-once functions in dump file.
+
+2009-10-30 Daniel Gutson <dgutson@codesourcery.com>
+
+ * config/arm/linux-eabi.h (LINK_SPEC): BE8_LINK_SPEC added.
+ * config/arm/bpapi.h (BE8_LINK_SPEC): New define.
+ (LINK_SPEC): BE_LINK_SPEC added.
+
+2009-10-30 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41858
+ * lto-streamer.h (struct lto_file_decl_data): Remove fd member.
+
+2009-10-30 Nathan Sidwell <nathan@codesourcery.com>
+
+ * target-def.h (TARGET_ASM_TTYPE): Correct typo of TARGET_ARM_TTYPE.
+ * config/arm/unwind-arm.c (__gnu_Unwind_Backtrace): Remove unused
+ label.
+
+2009-10-30 Martin Jambor <mjambor@suse.cz>
+
+ * tree-sra.c (build_ref_for_offset_1): Remove a comment.
+
+2009-10-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/40838
+ * cfgexpand.c (expand_stack_alignment): Call update_stack_boundary
+ first. Move assert on stack_alignment_estimated just before
+ setting stack_realign_needed.
+ (gimple_expand_cfg): Initialize stack_alignment_estimated to 0.
+ Don't call update_stack_boundary.
+
+ * config/i386/i386.c (ix86_minimum_incoming_stack_boundary): New.
+ (verride_options): Don't check ix86_force_align_arg_pointer here.
+ (ix86_function_ok_for_sibcall): Use it.
+ (ix86_update_stack_boundary): Likewise.
+
+ * config/i386/i386.h (STACK_REALIGN_DEFAULT): Update comments.
+
+2009-10-30 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.md (QHSI): New mode iterator.
+ (movqi): If generating for thumb, then truncate any immediate to
+ 8 bits.
+ * thumb2.md (thumb2_movsi_shortim and peephole2 generator): Replace
+ with...
+ (thumb2_mov<mode>_shortim and peephole2 generator): ... iterator based
+ version.
+
+2009-10-29 Cary Coutant <ccoutant@google.com>
+
+ PR debug/41700
+ * dwarf2out.c (dwarf2_debug_hooks): Add entries for new hook (two
+ locations in the source).
+ (store_vcall_insn): New function.
+ (lookup_vcall_insn): New function.
+ (dwarf2out_virtual_call_token): Use store_vcall_insn.
+ (dwarf2out_copy_call_info): New function.
+ (dwarf2out_virtual_call): Use lookup_vcall_insn.
+ * emit-rtl.c (try_split): Call copy_call_info debug hook.
+ * debug.h (struct gcc_debug_hooks): Add copy_call_info hook.
+ * debug.c (do_nothing_debug_hooks): Add dummy entry for new hook.
+ (debug_nothing_rtx_rtx): New dummy hook.
+ * dbxout.c (dbx_debug_hooks): Add dummy entry for new hook.
+ (xcoff_debug_hooks): Likewise.
+ * sdbout.c (sdb_debug_hooks): Likewise.
+ * vmsdbgout.c (vmsdbg_debug_hooks): Likewise.
+
+2009-10-29 David Daney <ddaney@caviumnetworks.com>
+
+ * doc/invoke.texi (mmcount-ra-address): Document new command line
+ option.
+ * config/mips/mips.opt (mmcount-ra-address): New option.
+ * config/mips/mips-protos.h (mips_function_profiler): Declare new
+ function.
+ * config/mips/mips.c (struct mips_frame_info): Add ra_fp_offset
+ member.
+ (mips_for_each_saved_gpr_and_fpr): Set ra_fp_offset.
+ (mips_function_profiler): Moved from FUNCTION_PROFILER, and
+ rewritten.
+ * config/mips/mips.h (FUNCTION_PROFILER): Body of macro moved to
+ mips_function_profiler.
+
+2009-10-29 Steve Ellcey <sje@cup.hp.com>
+
+ PR middle-end/37565
+ PR target/38018
+ * doc/tm.texi (OVERRIDE_OPTIONS): Update.
+ (TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE): New.
+ * optc-gen.awk (cl_target_option_restore): Include call to
+ targetm.override_options_after_change.
+ * target-def.h (TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE): New.
+ * target.h (override_options_after_change): New.
+ * c-common.c (parse_optimize_options): Call
+ targetm.override_options_after_change.
+ * config/ia64/ia64.c (TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE): New.
+ (ia64_override_options_after_change): New.
+ (ia64_override_options) Add call to above.
+
+2009-10-29 Michael Matz <matz@suse.de>
+
+ * tree-ssa-math-opts.c (execute_convert_to_rsqrt): Remove.
+ (gate_convert_to_rsqrt): Ditto.
+ (pass_convert_to_rsqrt): Ditto.
+ * tree-pass.h (pass_convert_to_rsqrt): Don't declare.
+ * passes.c (init_optimization_passes): Don't add pass_convert_to_rsqrt
+ to pass list.
+
+ * config/i386/i386.c (ix86_emit_swdivsf): Change evaluation order.
+
+2009-10-29 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+
+ * config/arm/arm.c (find_best_start): Fix type of remainder to be
+ unsigned.
+
+2009-10-29 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/41775
+ * tree-sra.c (build_ref_for_offset): Unshare *expr if not NULL.
+ (generate_subtree_copies): Do not unshare agg.
+ (load_assign_lhs_subreplacements): Do not unshare rhs.
+ (sra_modify_assign): Do not unshare exprs.
+ (propagate_subacesses_accross_link): Renamed to
+ propagate_subaccesses_across_link.
+
+2009-10-29 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.c (count_insns_for_constant): Rework to support counting for
+ thumb2 immediates as well.
+ (find_best_start): Split out from arm_gen_constant.
+ (arm_gen_constant): Rework to support XOR with immediate.
+
+2009-10-29 Chao-ying Fu <fu@mips.com>
+
+ * config/mips/mips.c (mips_emit_unary, mips_force_unary): New
+ functions.
+ (mips_expand_synci_loop): Use the length rtx to control the
+ synci loop from the begin rtx that points to the first byte of
+ the cache line.
+
+2009-10-28 Rafael Avila de Espindola <espindola@google.com>
+
+ * doc/invoke.texi: Rename -use-linker-plugin -fuse-linker-plugin.
+
+2009-10-28 Rafael Avila de Espindola <espindola@google.com>
+
+ * dbxout.c (dbxout_common_check): Accept non public trees.
+ * dwarf2out.c (fortran_common): Accept non public trees.
+
+2009-10-28 Rafael Avila de Espindola <espindola@google.com>
+
+ * common.opt (fuse-linker-plugin): New option.
+ * gcc.c (LINK_COMMAND_SPEC, main): Rename use-linker-plugin to
+ fuse-linker-plugin.
+ * opts.c (common_handle_option): Ignore OPT_fuse_linker_plugin.
+
+2009-10-28 Paolo Bonzini <bonzini@gnu.org>
+
+ PR rtl-optimization/39715
+ * config/arm/arm.md (cstoresi4): Use gen_cstoresi_ltu_thumb1.
+ (gen_cstoresi_ltu_thumb1): New splitter.
+
+2009-10-28 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41808
+ PR lto/41839
+ * tree-ssa.c (useless_type_conversion_p): Do not treat
+ conversions to pointers to incomplete types as useless.
+ * gimple.c (gimple_types_compatible_p): Compare struct tags,
+ not typedef names.
+
+2009-10-28 Jakub Jelinek <jakub@redhat.com>
+
+ * var-tracking.c (emit_note_insn_var_location): Don't call the second
+ vt_expand_loc unnecessarily when location is not a register nor
+ memory.
+
+ PR middle-end/41837
+ * ipa-struct-reorg.c (find_field_in_struct_1): Return NULL if
+ fields don't have DECL_NAME.
+
+ PR debug/41801
+ * builtins.c (get_builtin_sync_mem): Expand loc in ptr_mode,
+ call convert_memory_address on addr.
+
+ PR target/41762
+ * config/i386/i386.c (ix86_pic_register_p): Don't call
+ rtx_equal_for_cselib_p for VALUEs discarded as useless.
+
+2009-10-28 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * var-tracking.c (emit_note_insn_var_location): Get the mode of
+ a variable part from its REG, MEM or VALUE.
+
+2009-10-28 Richard Guenther <rguenther@suse.de>
+
+ * gimple.c (gimple_get_alias_set): Fix comment typo.
+
+2009-10-28 Richard Guenther <rguenther@suse.de>
+
+ * tree.c (free_lang_data_in_type): Do not call get_alias_set.
+ (free_lang_data): Unconditionally compute alias sets for all
+ standard integer types. Bail out if gate bailed out previously.
+ Do not reset the types_compatible_p langhook.
+ (gate_free_lang_data): Remove.
+ (struct pass_ipa_free_lang_data): Enable unconditionally.
+ * gimple.c (gimple_get_alias_set): Use the same alias-set for
+ all pointer types.
+
+2009-10-28 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/41855
+ * tree-ssa-alias.c (refs_may_alias_p_1): Deal with CONST_DECLs
+ (ref_maybe_used_by_call_p_1): Fix bcopy handling.
+ (call_may_clobber_ref_p_1): Likewise.
+ * tree-ssa-structalias.c (find_func_aliases): Likewise.
+ * alias.c (nonoverlapping_memrefs_p): Deal with CONST_DECLs.
+
+2009-10-28 Paolo Bonzini <bonzini@gnu.org>
+
+ PR rtl-optimization/41812
+
+ Revert:
+ 2009-06-27 Paolo Bonzini <bonzini@gnu.org>
+
+ * df-problems.c (df_md_scratch): New.
+ (df_md_alloc, df_md_free): Allocate/free it.
+ (df_md_local_compute): Only include live registers in init.
+ (df_md_transfer_function): Prune the in-set computed by
+ the confluence function, and the gen-set too.
+
+2009-10-28 Paolo Bonzini <bonzini@gnu.org>
+
+ PR rtl-optimization/39715
+ * combine.c (simplify_comparison): Use extensions to
+ widen comparisons. Try an ANDing first.
+
+2009-10-28 Paolo Bonzini <bonzini@gnu.org>
+
+ PR rtl-optimization/40741
+ * config/arm/arm.c (thumb1_rtx_costs): IOR or XOR with
+ a small constant is cheap.
+ * config/arm/arm.md (andsi3, iorsi3): Try to place the result of
+ force_reg on the LHS.
+ (xorsi3): Likewise, and split the XOR if the constant is complex
+ and not in Thumb mode.
+
+2009-10-28 Paolo Bonzini <bonzini@gnu.org>
+
+ * expmed.c (emit_store_flag): Check costs before
+ transforming to the opposite representation.
+
+2009-10-28 Paolo Bonzini <bonzini@gnu.org>
+
+ * config/sh/sh.md (cbranchfp4_media): Remove hack extending
+ cstore result to DImode.
+
+2009-10-28 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * config/sh/sh.md (stuff_delay_slot): Move const_int pattern
+ inside the unspec vector.
+
+2009-10-27 Richard Henderson <rth@redhat.com>
+
+ * cgraphunit.c (cgraph_optimize): Maintain timevar stack properly.
+
+2009-10-27 Richard Henderson <rth@redhat.com>
+
+ PR c++/41819
+ * tree-eh.c (eh_region_may_contain_throw_map): Rename from
+ eh_region_may_contain_throw; update users.
+ (eh_region_may_contain_throw): New function.
+ (lower_catch): Check flag_exceptions before creating exception region.
+ (lower_eh_filter, lower_eh_must_not_throw): Likewise.
+ (lower_cleanup): Tidy existing flag_exceptions check to match.
+
+2009-10-27 Kai Tietz <kai.tietz@onevision.com>
+
+ PR/41799
+ * config/i386/mingw32.h (CHECK_EXECUTE_STACK_ENABLED): New macro.
+ * config/i386/mingw.opt: Add fset-stack-executable.
+ * config/i386/i386.c (ix86_trampoline_init): Make call to
+ emit_library_call conditional, if CHECK_EXECUTE_STACK_ENABLED is
+ defined and its value is not zero.
+ * doc/invoke.texi
+
+2009-10-27 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-structalias.c (find_func_aliases): In IPA mode
+ handle calls to externally visible functions like in regular mode.
+ (create_variable_info_for): Do not create function infos here.
+ (have_alias_info): Remove write-only variable.
+ (solve_constraints): New function split out from common code
+ in compute_points_to_sets and ipa_pta_execute.
+ (compute_points_to_sets): Adjust.
+ (ipa_pta_execute): Likewise. Handle clones and externally visible
+ functions like in non-IPA mode.
+
+2009-10-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/41842
+ * c-typeck.c (convert_arguments): Return -1 if any of the arguments is
+ error_mark_node.
+
+2009-10-27 Richard Guenther <rguenther@suse.de>
+
+ * tree-complex.c (expand_complex_div_wide): Check for
+ INTEGER_CST, not TREE_CONSTANT on comparison folding result.
+
+2009-10-27 Revital Eres <eres@il.ibm.com>
+
+ PR tree-optimization/40648
+ * tree-vect-data-refs.c (vect_enhance_data_refs_alignment):
+ Change decision of when to peel for alignment.
+
+2009-10-27 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41821
+ * gimple.c (gimple_types_compatible_p): Handle OFFSET_TYPE.
+
+2009-10-27 Aldy Hernandez <aldyh@redhat.com>
+
+ PR bootstrap/41451
+ * fold-const.c (fold_binary_loc): Do not call
+ protected_set_expr_location.
+
+2009-10-27 Wei Guozhi <carrot@google.com>
+
+ PR target/41705
+ * target.h (have_conditional_execution): Add a new target hook
+ function.
+ * target-def.h (TARGET_HAVE_CONDITIONAL_EXECUTION): Likewise.
+ * targhooks.h (default_have_conditional_execution): Likewise.
+ * targhooks.c (default_have_conditional_execution): Likewise.
+ * doc/tm.texi (TARGET_HAVE_CONDITIONAL_EXECUTION): Document it.
+ * config/arm/arm.c (TARGET_HAVE_CONDITIONAL_EXECUTION): Define it.
+ (arm_have_conditional_execution): New function.
+ * ifcvt.c (noce_process_if_block, find_if_header,
+ cond_exec_find_if_block, dead_or_predicable): Change the usage of
+ macro HAVE_conditional_execution to a target hook call.
+ * recog.c (peephole2_optimize): Likewise.
+ * sched-rgn.c (add_branch_dependences): Likewise.
+ * final.c (asm_insn_count, final_scan_insn): Likewise.
+ * bb-reorder.c (HAVE_conditional_execution): Remove it.
+
+2009-10-26 Ben Elliston <bje@au.ibm.com>
+ Michael Meissner <meissner@linux.vnet.ibm.com>
+ Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config.gcc (spu-*-elf*): Add spu_cache.h to extra_headers.
+ * config/spu/spu_cache.h: New file.
+
+ * config/spu/cachemgr.c: New file.
+ * config/spu/cache.S: New file.
+
+ * config/spu/spu.h (ASM_OUTPUT_SYMBOL_REF): Define.
+ (ADDR_SPACE_EA): Define.
+ (TARGET_ADDR_SPACE_KEYWORDS): Define.
+ * config/spu/spu.c (EAmode): New macro.
+ (TARGET_ADDR_SPACE_POINTER_MODE): Define.
+ (TARGET_ADDR_SPACE_ADDRESS_MODE): Likewise.
+ (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Likewise.
+ (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Likewise.
+ (TARGET_ADDR_SPACE_SUBSET_P): Likewise.
+ (TARGET_ADDR_SPACE_CONVERT): Likewise.
+ (TARGET_ASM_SELECT_SECTION): Likewise.
+ (TARGET_ASM_UNIQUE_SECTION): Likewise.
+ (TARGET_ASM_UNALIGNED_SI_OP): Likewise.
+ (TARGET_ASM_ALIGNED_DI_OP): Likewise.
+ (ea_symbol_ref): New function.
+ (spu_legitimate_constant_p): Handle __ea qualified addresses.
+ (spu_addr_space_legitimate_address_p): New function.
+ (spu_addr_space_legitimize_address): Likewise.
+ (cache_fetch): New global.
+ (cache_fetch_dirty): Likewise.
+ (ea_alias_set): Likewise.
+ (ea_load_store): New function.
+ (ea_load_store_inline): Likewise.
+ (expand_ea_mem): Likewise.
+ (spu_expand_mov): Handle __ea qualified memory references.
+ (spu_addr_space_pointer_mode): New function.
+ (spu_addr_space_address_mode): Likewise.
+ (spu_addr_space_subset_p): Likewise.
+ (spu_addr_space_convert): Likewise.
+ (spu_section_type_flags): Handle "._ea" section.
+ (spu_select_section): New function.
+ (spu_unique_section): Likewise.
+ * config/spu/spu-c.c (spu_cpu_cpp_builtins): Support __EA32__
+ and __EA64__ predefined macros.
+ * config/spu/spu-elf.h (LIB_SPEC): Handle -mcache-size= and
+ -matomic-updates switches.
+
+ * config/spu/t-spu-elf (MULTILIB_OPTIONS): Define.
+ (EXTRA_MULTILIB_PARTS): Add libgcc_cachemgr.a,
+ libgcc_cachemgr_nonatomic.a, libgcc_cache8k.a, libgcc_cache16k.a,
+ libgcc_cache32k.a, libgcc_cache64k.a, libgcc_cache128k.a.
+ ($(T)cachemgr.o, $(T)cachemgr_nonatomic.o): New target.
+ ($(T)cache8k.o, $(T)cache16k.o, $(T)cache32k.o, $(T)cache64k.o,
+ $(T)cache128k.o): Likewise.
+ ($(T)libgcc_%.a): Likewise.
+
+ * config/spu/spu.h (TARGET_DEFAULT): Add MASK_ADDRESS_SPACE_CONVERSION.
+ * config/spu/spu.opt (-mea32/-mea64): Add switches.
+ (-maddress-space-conversion): Likewise.
+ (-mcache-size=): Likewise.
+ (-matomic-updates): Likewise.
+ * doc/invoke.texi (-mea32/-mea64): Document.
+ (-maddress-space-conversion): Likewise.
+ (-mcache-size=): Likewise.
+ (-matomic-updates): Likewise.
+
+2009-10-26 Ben Elliston <bje@au.ibm.com>
+ Michael Meissner <meissner@linux.vnet.ibm.com>
+ Ulrich Weigand <uweigand@de.ibm.com>
+
+ * doc/tm.texi (TARGET_ADDR_SPACE_KEYWORDS): Document.
+
+ * c-common.c (c_common_reswords): If TARGET_ADDR_SPACE_KEYWORDS is
+ defined, add the named address space keywords.
+ (c_addr_space_name): New function.
+ (complete_array_type): Preserve named address space.
+ (handle_mode_attribute): Use targetm.addr_space.valid_pointer_mode
+ instead of targetm.valid_pointer_mode.
+
+ * c-common.h (enum rid): Add RID_ADDR_SPACE_0 .. RID_ADDR_SPACE_15,
+ RID_FIRST_ADDR_SPACE and RID_LAST_ADDR_SPACE.
+ (ADDR_SPACE_KEYWORD): New macro.
+ (c_addr_space_name): Add prototype.
+
+ * c-tree.h (struct c_declspecs): Add address_space member.
+ (declspecs_add_addrspace): Add prototype.
+
+ * c-pretty-print.c (pp_c_type_qualifier_list): Handle address spaces.
+
+ * c-parser.c (c_parse_init): Add assertion.
+ (typedef enum c_id_kind): Add C_ID_ADDRSPACE.
+ (c_lex_one_token): Handle address space keywords.
+ (c_token_starts_typename): Likewise.
+ (c_token_starts_declspecs): Likewise.
+ (c_parser_declspecs): Likewise.
+ (c_parser_postfix_expression_after_paren_type): Diagnose compound
+ literal within function qualified with named address space.
+
+ * c-decl.c (diagnose_mismatched_decls): Diagnose conflicting named
+ address space qualifiers.
+ (shadow_tag_warned): Warn about useless address space qualifiers.
+ (quals_from_declspecs): Handle address space qualifiers.
+ (grokdeclarator): Likewise.
+ (build_null_declspecs): Likewise.
+ (declspecs_add_addrspace): New function.
+
+ * c-typeck.c (addr_space_superset): New function.
+ (qualify_type): Handle named address spaces.
+ (composite_type): Likewise.
+ (common_pointer_type): Likewise.
+ (comp_target_types): Likewise.
+ (build_conditional_expr): Likewise.
+ (handle_warn_cast_qual): Likewise.
+ (build_c_cast): Likewise.
+ (convert_for_assignment): Likewise.
+ (build_binary_op): Likewise.
+ (pointer_diff): Handle named address spaces. Use intermediate
+ integer type of sufficient size if required.
+
+2009-10-26 Ben Elliston <bje@au.ibm.com>
+ Michael Meissner <meissner@linux.vnet.ibm.com>
+ Ulrich Weigand <uweigand@de.ibm.com>
+
+ * doc/tm.texi (TARGET_ADDR_SPACE_POINTER_MODE): Document.
+ (TARGET_ADDR_SPACE_ADDRESS_MODE): Likewise.
+ (TARGET_ADDR_SPACE_VALID_POINTER_MODE): Likewise.
+
+ * target.h (struct target_def): Add pointer_mode, address_mode,
+ and valid_pointer_mode to addr_space substructure.
+ * target-def.h (TARGET_ADDR_SPACE_POINTER_MODE): Define.
+ (TARGET_ADDR_SPACE_ADDRESS_MODE): Likewise.
+ (TARGET_ADDR_SPACE_VALID_POINTER_MODE): Likewise.
+ (TARGET_ADDR_SPACE_HOOKS): Add them.
+ * targhooks.c (target_default_pointer_address_modes_p): New function.
+ * target.h (target_default_pointer_address_modes_p): Add prototype.
+ * targhooks.c (default_addr_space_pointer_mode): New function.
+ (default_addr_space_address_mode): Likewise.
+ (default_addr_space_valid_pointer_mode): Likewise.
+ * targhooks.h (default_addr_space_pointer_mode): Add prototype.
+ (default_addr_space_address_mode): Likewise.
+ (default_addr_space_valid_pointer_mode): Likewise.
+ * output.h (default_valid_pointer_mode): Move to ...
+ * targhooks.h (default_valid_pointer_mode): ... here.
+ * varasm.c (default_valid_pointer_mode): Move to ...
+ * targhooks.c (default_valid_pointer_mode): ... here.
+
+ * varasm.c (output_constant): Use targetm.addr_space.valid_pointer_mode
+ instead of targetm.valid_pointer_mode.
+
+ * fold-const.c (fit_double_type): Use int_or_pointer_precision.
+ * tree.c (integer_pow2p): Likewise.
+ (tree_log2): Likewise.
+ (tree_floor_log2): Likewise.
+ (signed_or_unsigned_type_for): Support pointer type of different size.
+ (int_or_pointer_precision): New function.
+ * tree.h (int_or_pointer_precision): Add prototype.
+ * stor-layout.c (layout_type): Set TYPE_PRECISION for offset types.
+ * varasm.c (initializer_constant_valid_p): Use TYPE_PRECISION of
+ incoming pointer type instead of POINTER_SIZE.
+
+ * tree.c (build_pointer_type): Use appropriate pointer mode
+ instead of ptr_mode.
+ (build_reference_type): Likewise.
+ * expr.c (store_expr): Likewise.
+ (expand_expr_addr_expr): Likewise.
+ * tree-vect-data-refs.c (vect_create_data_ref_ptr): Likewise.
+ * cfgexpand.c (expand_debug_expr): Likewise.
+
+ * auto-inc-dec.c: Include "target.h".
+ (try_merge): Use appropriate address mode instead of Pmode.
+ (find_inc): Likewise.
+ * combine.c (find_split_point): Likewise.
+ * cselib.c (cselib_record_sets): Likewise.
+ * dse.c (replace_inc_dec): Likewise.
+ (canon_address): Likewise.
+ * var-tracking.c (replace_expr_with_values): Likewise.
+ (count_uses): Likewise.
+ (add_uses): Likewise.
+ (add_stores): Likewise.
+ * emit-rtl.c: Include "target.h".
+ (adjust_address_1): Use appropriate address mode instead of Pmode.
+ (offset_address): Likewise.
+ * explow.c (break_out_memory_refs): Likewise.
+ (memory_address_addr_space): Likewise.
+ (promote_mode): Likewise.
+ * expr.c (move_by_pieces): Likewise.
+ (emit_block_move_via_loop): Likewise.
+ (store_by_pieces): Likewise.
+ (store_by_pieces_1): Likewise.
+ (expand_assignment): Likewise.
+ (store_constructor): Likewise.
+ (expand_expr_addr_expr): Likewise.
+ (expand_expr_real_1): Likewise.
+ * cfgexpand.c (expand_debug_expr): Likewise.
+ * ifcvt.c (noce_try_cmove_arith): Likewise.
+ * regcprop.c (kill_autoinc_value): Likewise.
+ * regmove.c (try_auto_increment): Likewise.
+ * reload.c (find_reloads): Likewise.
+ (find_reloads_address): Likewise.
+ (find_reloads_address_1): Likewise.
+ * sched-deps.c: Include "target.h".
+ (sched_analyze_1): Use appropriate address mode instead of Pmode.
+ (sched_analyze_2): Likewise.
+ * sel-sched-dump.c: Include "target.h".
+ (debug_mem_addr_value): Use appropriate address mode instead of Pmode.
+ * stor-layout.c (layout_type): Likewise.
+ * tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise.
+ (multiplier_allowed_in_address_p): Likewise.
+ (get_address_cost): Likewise.
+ * varasm.c (make_decl_rtl): Likewise.
+
+ * expr.c (expand_assignment): Always convert offsets to appropriate
+ address mode.
+ (store_expr): Likewise.
+ (store_constructor): Likewise.
+ (expand_expr_real_1): Likewise.
+
+ * reload.h (form_sum): Add MODE argument.
+ * reload.c (form_sum): Add MODE argument, use it instead of Pmode.
+ Update recursive calls.
+ (subst_indexed_address): Update calls to form_sum.
+
+ * tree-flow.h (addr_for_mem_ref): Add ADDRSPACE argument.
+ * tree-ssa-address.c: Include "target.h".
+ (templates): Replace by ...
+ (mem_addr_template_list): ... this new vector.
+ (TEMPL_IDX): Handle address space numbers.
+ (gen_addr_rtx): Add address mode argument, use it instead of Pmode.
+ (addr_for_mem_ref): Add ADDRSPACE argument. Use per-address-space
+ instead of global cache. Update call to gen_addr_rtx.
+ (valid_mem_ref_p): Update call to addr_for_mem_ref.
+ * expr.c (expand_expr_real_1): Update call to addr_for_mem_ref.
+
+ * rtl.h (convert_memory_address_addr_space): Add prototype.
+ (convert_memory_address): Define as macro.
+ * explow.c (convert_memory_address): Rename to ...
+ (convert_memory_address_addr_space): ... this. Add ADDRSPACE argument.
+ Use appropriate pointer and address modes instead of ptr_mode / Pmode.
+ Update recursive calls.
+ (memory_address_addr_space): Call convert_memory_address_addr_space.
+ * expmed.c (make_tree): Likewise.
+ * expr.c (expand_assignment): Likewise.
+ (expand_expr_addr_expr_1): Likewise. Also, add ADDRSPACE argument.
+ (expand_expr_addr_expr): Likewise. Also, update call.
+
+ * alias.c (find_base_value): Guard pointer size optimizations.
+ (find_base_term): Likewise.
+ * rtlanal.c (nonzero_bits1): Likewise.
+ (num_sign_bit_copies1): Likewise.
+ * simplify-rtx.c (simplify_unary_operation_1): Likewise.
+
+ * Makefile.in (tree-ssa-address.o): Add $(TARGET_H) dependency.
+ (emit-rtl.o): Likewise.
+ (auto-inc-dec.o): Likewise.
+ (sched-deps.o): Likewise.
+
+2009-10-26 Ben Elliston <bje@au.ibm.com>
+ Michael Meissner <meissner@linux.vnet.ibm.com>
+ Ulrich Weigand <uweigand@de.ibm.com>
+
+ * doc/extend.texi (Named Address Spaces): New section.
+ * coretypes.h (addr_space_t): New type.
+ (ADDR_SPACE_GENERIC): New define.
+ (ADDR_SPACE_GENERIC_P): New macro.
+
+ * doc/tm.texi (Named Address Spaces): New section.
+ (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Document.
+ (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Document.
+ (TARGET_ADDR_SPACE_SUBSET_P): Document.
+ (TARGET_ADDR_SPACE_CONVERT): Document.
+ * target.h (struct gcc_target): Add addr_space substructure.
+ * target-def.h (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Define.
+ (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Likewise.
+ (TARGET_ADDR_SPACE_SUBSET_P): Likewise.
+ (TARGET_ADDR_SPACE_CONVERT): Likewise.
+ (TARGET_ADDR_SPACE_HOOKS): Likewise.
+ (TARGET_INITIALIZER): Initialize addr_space hooks.
+ * targhooks.c (default_addr_space_legitimate_address_p): New function.
+ (default_addr_space_legitimize_address): Likewise.
+ (default_addr_space_subset_p): Likewise.
+ (default_addr_space_convert): Likewise.
+ * targhooks.h (default_addr_space_legitimate_address_p): Add prototype.
+ (default_addr_space_legitimize_address): Likewise.
+ (default_addr_space_subset_p): Likewise.
+ (default_addr_space_convert): Likewise.
+
+ * doc/rtl.texi (MEM_ADDR_SPACE): Document.
+ * rtl.h (mem_attrs): Add ADDRSPACE memory attribute.
+ (MEM_ADDR_SPACE): New macro.
+ * emit-rtl.c (get_mem_attrs): Add ADDRSPACE argument and set
+ address space memory attribute.
+ (mem_attrs_htab_hash): Handle address space memory attribute.
+ (mem_attrs_htab_eq): Likewise.
+ (set_mem_attributes_minus_bitpos): Likewise.
+ (set_mem_alias_set): Likewise.
+ (set_mem_align): Likewise.
+ (set_mem_expr): Likewise.
+ (set_mem_offset): Likewise.
+ (set_mem_size): Likewise.
+ (adjust_address_1): Likewise.
+ (offset_address): Likewise.
+ (widen_memoy_address): Likewise.
+ (get_spill_slot_decl): Likewise.
+ (set_mem_attrs_for_spill): Likewise.
+ (set_mem_addr_space): New function.
+ * emit-rtl.h (set_mem_addr_space): Add prototype.
+ * print-rtl.c (print_rtx): Print address space memory attribute.
+ * expr.c (expand_assignment): Set address space memory attribute
+ of generated MEM RTXes as appropriate.
+ (expand_expr_real_1): Likewise.
+ * cfgexpand.c (expand_debug_expr): Likewise.
+ * tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise.
+
+ * tree.h (struct tree_base): Add address_space bitfield. Reduce
+ size of "spare" bitfield.
+ (TYPE_ADDR_SPACE): New macro.
+ (ENCODE_QUAL_ADDR_SPACE): Likewise.
+ (DECODE_QUAL_ADDR_SPACE): Likewise.
+ (CLEAR_QUAL_ADDR_SPACE): Likewise.
+ (KEEP_QUAL_ADDR_SPACE): Likewise.
+ (TYPE_QUALS): Encode type address space.
+ (TYPE_QUALS_NO_ADDR_SPACE): New macro.
+ * tree.c (set_type_quals): Set type address space.
+ (build_array_type): Inherit array address space from element type.
+ * print-tree.c (print_node_brief): Print type address space.
+ (print_node): Likewise.
+ * tree-pretty-print.c (dump_generic_node): Likewise.
+
+ * explow.c (memory_address): Rename to ...
+ (memory_address_addr_space): ... this. Add ADDRSPACE argument.
+ Use address-space aware variants of memory address routines.
+ * recog.c (memory_address_p): Rename to ...
+ (memory_address_addr_space_p): ... this. Add ADDSPACE argument.
+ Use address-space aware variants of memory address routines.
+ (offsettable_address_p): Rename to ...
+ (offsettable_address_addr_space_p): ... this. Add ADDRSPACE argument.
+ Use address-space aware variants of memory address routines.
+ * reload.c (strict_memory_address_p): Rename to ...
+ (strict_memory_address_addr_space_p): ... this. Add ADDSPACE argument.
+ Use address-space aware variants of memory address routines.
+ (maybe_memory_address_p): Rename to ...
+ (maybe_memory_address_addr_space_p): ... this. Add ADDSPACE argument.
+ Use address-space aware variants of memory address routines.
+ * expr.h (memory_address_addr_space): Add prototype.
+ (memory_address): Define as macro.
+ * recog.h (memory_address_addr_space_p): Add prototype.
+ (memory_address_p): Define as macro.
+ (offsettable_address_addr_space_p): Add prototype.
+ (offsettable_address_p): Define as macro.
+ (strict_memory_address_addr_space_p): Add prototype.
+ (strict_memory_address_p): Define as macro.
+
+ * combine.c (find_split_point): Use address-space aware variants
+ of memory address routines.
+ * emit-rtl.c (operand_subword): Likewise.
+ (change_address_1): Likewise.
+ (adjust_address_1): Likewise.
+ (offset_address): Likewise.
+ * expr.c (emit_move_insn): Likewise.
+ (expand_assignment): Likewise.
+ (expand_expr_real_1): Likewise.
+ * recog.c (verify_changes): Likewise.
+ (general_operand): Likewise.
+ (offsettable_memref_p): Likewise.
+ (offsettable_nonstrict_memref_p): Likewise.
+ (constrain_operands): Likewise.
+ * reload.c (get_secondary_mem): Likewise.
+ (find_reloads_toplev): Likewise.
+ (find_reloads_address): Likewise.
+ (find_reloads_subreg_address): Likewise.
+ * reload1.c (reload): Likewise.
+ * rtlhooks.c (gen_lowpart_if_possible): Likewise.
+ * rtl.h (address_cost): Add ADDRSPACE argument.
+ * rtlanal.c (address_cost): Add ADDRSPACE argument. Use address-space
+ aware variant of memory address routines.
+ * loop-invariant.c (create_new_invariant): Update address_cost call.
+ * tree-ssa-loop-ivopts.c (computation_cost): Likewise.
+ * fwprop.c (should_replace_address): Add ADDRSPACE argument.
+ Use address-space aware variant of memory address routines.
+ (propagate_rtx_1): Update call to should_replace_address.
+ * tree-flow.h (multiplier_allowed_in_address_p): Add ADDRSPACE
+ argument.
+ * tree-ssa-loop-ivopts.c (multiplier_allowed_in_address_p): Add
+ ADDRSPACE argument. Use per-address-space instead of global cache.
+ Use address-space aware variant of memory address routines.
+ (get_address_cost): Likewise.
+ (get_computation_cost_at): Update calls.
+ * tree-ssa-address.c (valid_mem_ref_p): Add ADDRSPACE argument.
+ Use address-space aware variant of memory address routines.
+ (create_mem_ref_raw): Update call to valid_mem_ref_p.
+ (most_expensive_mult_to_index): Update call to
+ multiplier_allowed_in_address_p.
+
+ * dwarf2out.c (modified_type_die): Output DW_AT_address_class
+ attribute to indicate named address spaces.
+
+ * varasm.c (get_variable_section): DECLs in named address spaces
+ cannot be "common".
+
+ * reload.c (find_reloads_address): Do not use LEGITIMIZE_RELOAD_ADDRESS
+ for addresses in a non-generic address space.
+
+ * expr.c (emit_block_move_hints): Do not use libcalls for
+ memory in non-generic address spaces.
+ (clear_storage_hints): Likewise.
+ (expand_assignment): Likewise.
+
+ * fold-const.c (operand_equal_p): Expressions refering to different
+ address spaces are not equivalent.
+
+ * rtl.c (rtx_equal_p_cb): MEMs refering to different address
+ spaces are not equivalent.
+ (rtx_equal_p): Likewise.
+ * cse.c (exp_equiv_p): Likewise.
+ * jump.c (rtx_renumbered_equal_p): Likewise.
+ * reload.c (operands_match_p): Likewise.
+
+ * alias.c (nonoverlapping_memrefs_p): MEMs refering to different
+ address spaces may alias.
+ (true_dependence): Likewise.
+ (canon_true_dependence): Likewise.
+ (write_dependence_p): Likewise.
+
+ * dse.c (canon_address): Handle named address spaces.
+ * ifcvt.c (noce_try_cmove_arith): Likewise.
+
+ * tree.def (ADDR_SPACE_CONVERT_EXPR): New tree code.
+ * expr.c (expand_expr_real_2): Expand ADDR_SPACE_CONVERT_EXPR.
+ * convert.c (convert_to_pointer): Generate ADDR_SPACE_CONVERT_EXPR
+ to handle conversions between different address spaces.
+ * fold-const.c (fold_convert_loc): Likewise.
+ (fold_unary_loc): Handle ADDR_SPACE_CONVERT_EXPR.
+ * tree-pretty-print.c (dump_generic_node): Likewise.
+ * gimple-pretty-print.c (dump_unary_rhs): Likewise.
+ * tree-cfg.c (verify_gimple_assign_unary): Likewise.
+ * tree-inline.c (estimate_operator_cost): Likewise.
+ * tree-ssa.c (useless_type_conversion_p): Conversions between pointers
+ to different address spaces are not useless.
+
+2009-10-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR bootstrap/41345
+ * cfgcleanup.c (trivially_empty_bb_p): New function.
+ (try_optimize_bb): Use it instead of checking BB_HEAD == BB_END.
+
+ PR debug/41828
+ * dwarf2out.c (add_pubname, add_pubtype, generic_parameter_die,
+ add_name_and_src_coords_attributes, gen_namespace_die,
+ dwarf2out_set_name): Handle dwarf2_name returning NULL.
+
+2009-10-26 Nick Clifton <nickc@redhat.com>
+
+ * config.gcc: Add support for RX target.
+ * config/rx: New directory.
+ * config/rx/constraints.md: New file.
+ * config/rx/predicates.md: New file.
+ * config/rx/rx.c: New file.
+ * config/rx/rx.h: New file.
+ * config/rx/rx.md: New file.
+ * config/rx/rx.opt: New file.
+ * config/rx/rx-protos.h: New file.
+ * config/rx/t-rx: New file.
+ * doc/extend.texi: Document RX function attributes.
+ * doc/invoke.texi: Document RX specific command line options.
+ * doc/contrib.texi: Document RX contribution.
+ * doc/md.texi: Document RX constraints.
+ * doc/install.texi: Document RX support.
+
+2009-10-26 Michael Matz <matz@suse.de>
+
+ PR tree-optimization/41783
+ * tree-ssa-alias.c (get_continuation_for_phi): Export, add a special
+ case for simple diamonds.
+ * tree-ssa-alias.h (get_continuation_for_phi): Declare.
+ * tree-ssa-pre.c (translate_vuse_through_block): Add same_valid
+ argument, use alias oracle to skip some vdefs.
+ (phi_translate_1): Change call to above, don't allocate new
+ value ids if they can stay the same.
+ (compute_avail): Allow vuse walking when looking up references.
+
+2009-10-26 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/41826
+ * tree-ssa-structalias.c (get_constraint_for_ptr_offset): Avoid
+ access to re-allocated vector fields.
+
+2009-10-26 Richard Guenther <rguenther@suse.de>
+
+ * graphite-sese-to-poly.c (check_poly_representation): Fix
+ compile without checking.
+
+2009-10-26 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41714
+ * gimple.h (tree_annotate_all_with_location): Remove prototype.
+ * gimplify.c (tree_should_carry_location_p,
+ tree_annotate_one_with_location,tree_annotate_all_with_location):
+ Remove obsolete functions.
+
+2009-10-25 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ PR target/41813
+ * config/sh/sh.md (stuff_delay_slot): Don't set T_REG in pattern.
+
+2009-10-25 Richard Guenther <rguenther@suse.de>
+
+ * lto-streamer-in.c (unpack_ts_decl_common_value_fields):
+ Stream DECL_RESTRICTED_P.
+ * lto-streamer-out.c (pack_ts_decl_common_value_fields): Likewise.
+
+2009-10-25 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * config/mips/mips.c (mips_restore_gp_from_cprestore_slot): Emit
+ a note when expanding to nothing.
+
+2009-10-25 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/41814
+ * tree.c (find_decls_types_r): Deal with Java overloading
+ BINFO_VIRTUALS for its own purpose.
+
+2009-10-24 Adam Nemet <anemet@caviumnetworks.com>
+
+ * config/mips/predicates.md (hilo_operand): New predicate.
+ * config/mips/mips.md (<u>mulsidi3_64bit): Change it to a
+ define_insn. Correct !ISA_HAS_EXT_INS length from 24 to 28. Move
+ splitter part from here ...:
+ (<u>mulsidi3_64bit splitter for !ISA_HAS_EXT_INS): ... to here. Swap
+ op0 and op4 to match the DINS case.
+ (<u>mulsidi3_64bit splitter for ISA_HAS_EXT_INS): New splitter.
+
+2009-10-24 Andy Hutchinson <hutchinsonandy@gcc.gnu.org>
+
+ PR middle-end/19154
+ * avr.md (QIDI): Add new mode iterator.
+ (sbrx_branch<mode>): Create new zero extract bit, test and jump
+ patterns for all QI thru DI modes combinations.
+ (sbrx_and_branch<mode>): Create new and based bit test and jump
+ patterns for QI thru SI modes.
+ avr.c (avr_out_sbxx_branch): Use only bit number.
+
+2009-10-24 Jan Hubicka <jh@suse.cz>
+
+ * ipa-reference.c (check_call): Noreturn notrhow calls do not write
+ to memory.
+ (analyze_function): When analyzing noreturn nothrow call, do not
+ compute written stats; free bitmaps of vars early if possible.
+ (generate_summary): Only update bitmaps if computed.
+ (propagate): Only dump bitmaps if computed.
+ (ipa_reference_read_summary): Fix pasto.
+
+2009-10-24 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree-ssa-alias.c (nonaliasing_component_refs_p): Rename into...
+ (aliasing_component_refs_p): ...this. Return true if there is no
+ common base and the base access types have the same alias set.
+ (indirect_ref_may_alias_decl_p): Adjust for above renaming.
+ (indirect_refs_may_alias_p): Likewise.
+
+2009-10-23 Joseph Myers <joseph@codesourcery.com>
+
+ PR c/40033
+ * c-typeck.c (c_finish_stmt_expr): Do not wrap error_mark_node in
+ a C_MAYBE_CONST_EXPR.
+
+2009-10-23 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/41787
+ * config/rs6000/rs6000.c (struct machine_function): Add
+ vsx_or_altivec_used_p to record if vector types are used.
+ (rs6000_expand_to_rtl_hook): Rename from
+ rs6000_alloc_sdmode_stack_slot. If VSX, check to see if there are
+ any vector operations, so if there are, we can set VRSAVE to
+ non-zero when only floating point vector registers are used.
+ (TARGET_EXPAND_TO_RTL_HOOK): Use rs6000_expand_to_rtl_hook.
+ (rs6000_check_vector_mode): Inner function to check if vector
+ types are used in the code.
+ (compute_vrsave_mask): If VSX, make sure VRSAVE is non-zero if
+ vector instructions are used.
+
+ * config/rs6000/rs6000.h (HARD_REGNO_CALL_PART_CLOBBERED):
+ Indicate that VSX registers which overlap floating point
+ registers, can't be used across a call, since the ABI only states
+ the scalar part of the register will be saved and restored.
+
+2009-10-23 Joseph Myers <joseph@codesourcery.com>
+
+ PR c/41673
+ * alias.c (get_alias_set): Call langhook before returning 0 for
+ types with structural equality.
+ * c-common.c (c_common_get_alias_set): Use alias set of element
+ type for arrays with structural comparison.
+
+2009-10-23 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/41805
+ * cfgexpand.c (expand_call_stmt): Use gimple_has_side_effects and
+ gimple_call_nothrow_p.
+
+2009-10-23 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/41778
+ * tree-ssa-pre.c (do_regular_insertion): Only insert if a
+ redundancy along a path in the CFG we want to optimize for speed
+ is going to be removed.
+ (execute_pre): Do partial-PRE only if the function is to be
+ optimized for speed.
+ (gate_pre): Do not turn off all of PRE when not optimizing a
+ function for speed.
+
+2009-10-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtins.c (fold_builtin_cabs): Use validate_arg().
+ (fold_builtin_cexp): Fix if-logic.
+ (fold_builtin_1): Check subtype for BUILT_IN_CIMAG.
+
+2009-10-22 Jeff Law <law@redhat.com>
+
+ * ira-lives.c (process_single_reg_class_operands): Update the
+ hard reg costs for all the hard registers desired by the
+ single reg class operand.
+
+2009-10-22 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * simplify-rtx.c (simplify_replace_fn_rtx): Add a fallback case
+ for rtxes that aren't handled specially.
+
+2009-10-22 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * rtl.h (shallow_copy_rtvec): Declare.
+ * rtl.c (shallow_copy_rtvec): New function.
+ * cselib.c (cselib_subst_to_values): Use it. Only modify an
+ rtx field if the subrtx has changed.
+
+2009-10-22 Anatoly Sokolov <aesok@post.ru>
+
+ * config/m32c/m32c.c (m32c_function_value_regno_p): New function.
+ (m32c_function_value): Make static, add new 'outgoing' argument.
+ (m32c_libcall_value): Make static, add new 'fun' argument.
+ (TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE): Declare.
+ * config/m32c/m32c.h (FUNCTION_VALUE, LIBCALL_VALUE): Remove.
+ (FUNCTION_VALUE_REGNO_P): Redefine, use m32c_function_value_regno_p.
+ * config/m32c/m32c-protos.h (m32c_function_value_regno_p): Declare.
+ (m32c_function_value, m32c_libcall_value): Delete declaration.
+
+2009-10-22 Diego Novillo <dnovillo@google.com>
+
+ * Makefile.in (PLUGIN_HEADERS): Add output.h and IPA_UTILS_H.
+
+2009-10-22 Razya Ladelsky <razya@il.ibm.com>
+
+ * tree-cfg.c (gimple_duplicate_sese_tail): Fix typos/indentation/white
+ space.
+
+2009-10-22 Richard Guenther <rguenther@suse.de>
+
+ * lto-streamer.h (lto_symtab_merge_cgraph_nodes): Declare.
+ * lto-symtab.c (struct lto_symtab_entry_def): Add node member.
+ (lto_symtab_merge): Do not merge cgraph nodes here.
+ (lto_symtab_resolve_can_prevail_p): Simplify.
+ (lto_symtab_resolve_symbols): Store cgraph node.
+ (lto_symtab_merge_decls_1): Simplify. Do not drop non-prevailing
+ functions from the symtab.
+ (lto_symtab_merge_cgraph_nodes_1): New function.
+ (lto_symtab_merge_cgraph_nodes): Likewise.
+
+2009-10-22 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41791
+ * lto-streamer-out.c (lto_output_location): Stream the
+ system header flag.
+ * lto-streamer-in.c (lto_input_location): Likewise.
+
+2009-10-22 Razya Ladelsky <razya@il.ibm.com>
+
+ * cfgloopmanip.c (duplicate_subloops): Export.
+ * tree-parloops.c (loop_parallel_p): Dump if loop is innermost.
+ (transform_to_exit_first_loop): Duplicate bbs starting from
+ header up to loop->latch instead of exit->src.
+ Initialize control variable to the correct number of iterations.
+ (gather_scalar_reductions): Do not register double reductions.
+ (parallelize_loops): Dump which loop is tested.
+ Indicate whether the parallelized loop is inner or not.
+ Remove the innermost-loop requirement.
+ * cfgloop.h (duplicate_subloops): Export.
+ * tree-cfg.c (add_phi_args_after_redirect): New function.
+ (gimple_duplicate_sese_tail): Remove the no-subloops constraint.
+ Call duplicate_subloops.
+ Update number of iterations at the exit condition.
+ Don't redirect nexits always to the loop exit.
+ Redirect copied edges from latch to the loop exit.
+
+2009-10-22 Jan Hubicka <jh@suse.cz>
+
+ * ipa-cp.c (ipcp_read_summary): Remove now invalid FIXME and
+ flag_ltrans check.
+ * ipa-inline.c (cgraph_mark_inline_edge,
+ cgraph_decide_inlining_of_small_function,
+ cgraph_decide_inlining, inline_read_summary): Disable indirect
+ inlining for WPA for time being.
+
+ PR tree-optimize/40556
+ * ipa-inline.c (cgraph_early_inlining): Fix iterations condition.
+
+2009-10-22 Richard Guenther <rguenther@suse.de>
+
+ * lto-streamer.h (lto_symtab_clear_resolution): Remove.
+ * lto-symtab.c (lto_symtab_clear_resolution): Likewise.
+
+2009-10-22 Jan Hubicka <jh@suse.cz>
+
+ PR lto/41730
+ * ipa-reference.c (has_proper_scope_for_analysis): Add fixme about
+ global vars.
+ (check_call): Handle only indirect calls.
+ (propagate_bits): Update comment.
+ (write_node_summary_p): Turn bogus check to assert.
+ (ipa_reference_write_summary): Stream calls_read_all properly.
+ (ipa_reference_read_summary): Stream in calls_read_all properly.
+ (read_write_all_from_decl): New function.
+ (propagate): Handle OVERWRITABLE nodes and external calls here.
+ * ipa-pre-const.c (check_call): In IPA mode handle indirect
+ calls only.
+ (analyze_function): Do not check visibility here.
+ (add_new_function): We summary OVERWRITABLE too.
+ (generate_summary): Stream OVERWRITABLE nodes too.
+ (propagate): Handle external calls and OVERWRITABLE nodes here.
+ (local_pure_const): Check visibility here.
+
+2009-10-22 Jan Hubicka <jh@suse.cz>
+
+ * ipa-cp.c (ipcp_write_summary, ipcp_read_summary): New functions.
+ (pass_ipa_cp): Register them.
+ (ipcp_init_stage): Analyze all functions for whopr/lto.
+ (ipcp_propagate_stage): Skip external calls.
+ (ipcp_iterate_stage): Call ipa_update_after_lto_read if needed.
+ * ipa-reference.c (write_node_summary_p): Fix thinko about
+ availability.
+ * cgraphunit.c (ipa_passes): When in lto, ne er produce new summaries;
+ when in ltrans, skip executing of ipa passes since everything
+ should've been done.
+ * ipa-inline.c (cgraph_decide_inlining): Remove FIXMEs.
+ (inline_generate_summary): Likewise.
+ (inline_read_summary): New function.
+ (inline_write_summary): New function.
+ (pass_ipa_inline): Register new hooks.
+ * ipa-prop.c: Inlcude lto-streamer.h
+ (ipa_edge_args_vector): Update declaration.
+ (ipa_count_arguments, ipa_compute_jump_functions,
+ ipa_free_edge_args_substructures): Move ipa_edge_args_vector into ggc.
+ (ipa_write_jump_function, ipa_read_jump_function, ipa_write_node_info,
+ ipa_read_node_info): New static functions.
+ (ipa_prop_write_jump_functions, ipa_prop_read_jump_functions): Update.
+ (duplicate_array): Use xmalloc.
+ (duplicate_ggc_array): New.
+ (ipa_edge_duplication_hook): Use it.
+ (ipa_update_after_lto_read): New function.
+ * ipa-prop.h (ipa_prop_write_jump_functions,
+ ipa_prop_read_jump_functions): Declare.
+ (ipa_pass_through_data, ipa_ancestor_jf_data, ipa_member_ptr_cst,
+ jump_func_value, ipa_member_ptr_cst, ipa_edge_args): Add GTY markers.
+ (ipa_edge_args_vector): Move into GGC.
+ (ipa_check_create_edge_args): Update.
+ (ipa_update_after_lto_read): New.
+ * passes.c (ipa_write_summaries_1): When in wpa, do not write
+ summaries.
+ (ipa_read_summaries): When in ltrans, so not read summaries.
+ * lto-streamer.c (lto_get_section_name): Add
+ LTO_section_jump_functions.
+ * lto-streamer.h (LTO_section_jump_functions): New section.
+ (produce_asm): Declare.
+ * lto-cgraph.c (output_cgraph): Output edges in reverse order.
+ * lto-streamer-out.c (produce_asm): Export.
+ * lto-streamer-in.c: Include tree-pass.h
+ (input_function): Free dominance info when done.
+ (lto_read_body): Push ipa_inline in ltrans stage.
+ * gengtype.c (open_base_files): Add ipa-prop.h into includes.
+ * Makefile.in (GTFILES): Add ipa-prop.h
+
+2009-10-22 Matthias Klose <doko@ubuntu.com>
+
+ * doc/install.texi: Document --enable-browser-plugin.
+
+2009-10-21 Vladimir Makarov <vmakarov@redhat.com>
+
+ * doc/invoke.texi (fira-loop-pressure): Update default value.
+ * opts.c (decode_options): Remove default value setting for
+ flag_ira_loop_pressure.
+ * config/ia64/ia64.c (ia64_override_options): Set
+ flag_ira_loop_pressure up for -O3.
+ * config/rs6000/rs6000.c (rs6000_override_options): Ditto.
+
+2009-10-21 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/41497
+ * tree-scalar-evolution.c (analyze_evolution_in_loop): Return
+ chrec_dont_know if the evolution function returned by follow_ssa_edge
+ is constant in the analyzed loop and is not compatible with the
+ initial value before the loop.
+ * tree-chrec.h (no_evolution_in_loop_p): Call STRIP_NOPS.
+
+2009-10-21 Joseph Myers <joseph@codesourcery.com>
+
+ * config/sh/sh.c (nonpic_symbol_mentioned_p): Allow UNSPEC_TPOFF.
+
+2009-10-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR other/25507
+ * doc/invoke.texi: Document -print-multi-os-directory.
+
+2009-10-21 Jack Howarth <howarth@bromo.med.uc.edu>
+
+ PR c++/41313
+ * gcc/config/darwin10.h: Use default_emit_unwind_label.
+ * gcc/config/darwin.c: Disable -freorder-blocks-and-partition
+ when darwin_emit_unwind_label is used.
+
+2009-10-21 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree-vect-stmts.c (exist_non_indexing_operands_for_use_p): Tweak
+ order of checks.
+
+2009-10-20 Richard Henderson <rth@redhat.com>
+
+ * tree-eh.c (lower_try_finally_copy): Do lower_eh_constructs_1
+ before emit_post_landing_pad.
+
+2009-10-20 Adam Nemet <anemet@caviumnetworks.com>
+
+ * config/mips/mips.c (mips_binary_cost): Add new argument speed.
+ Use when calling rtx_costs.
+ (mips_rtx_costs): Fix formatting. Use argument speed rather than the
+ global optimize_size. Pass speed to mips_binary_cost.
+
+2009-10-20 Jakub Jelinek <jakub@redhat.com>
+
+ * config/rs6000/rs6000.c (def_builtin): Set TREE_READONLY instead
+ of TREE_CONSTANT.
+
+2009-10-20 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * rtl.h (simplify_replace_fn_rtx): Declare.
+ (wrap_constant, unwrap_constant): Delete.
+ * cfgexpand.c (unwrap_constant, wrap_constant): Delete.
+ (expand_debug_expr): Don't call wrap_constant.
+ * combine.c (rtx_subst_pair): Only define for AUTO_INC_DEC.
+ (auto_adjust_pair): Fold into...
+ (propagate_for_debug_subst): ...here. Only define for AUTO_INC_DEC.
+ Just return a new value.
+ (propagate_for_debug): Use simplify_replace_fn_rtx for AUTO_INC_DEC,
+ otherwise use simplify_replace_rtx.
+ * cselib.c (wrap_constant): Reinstate old definition.
+ (cselib_expand_value_rtx_1): Don't wrap constants.
+ * gcse.c (try_replace_reg): Don't use copy_rtx in the call to
+ simplify_replace_rtx.
+ (bypass_block): Fix formatting in calls to simplify_replace_rtx.
+ * reload1.c (reload): Skip all uses for an insn before adjusting it.
+ Use simplify_replace_rtx.
+ * simplify-rtx.c (simplify_replace_fn_rtx): New function,
+ adapted from...
+ (simplify_replace_rtx): ...here. Turn into a wrapper for
+ simplify_replace_fn_rtx.
+ (simplify_unary_operation): Don't unwrap CONSTs.
+ * var-tracking.c (check_wrap_constant): Delete.
+ (vt_expand_loc_callback): Don't call it.
+ (vt_expand_loc): Likewise.
+
+2009-10-20 Pascal Obry <obry@adacore.com>
+ Eric Botcazou <ebotcazou@adacore.com>
+
+ * config/i386/cygming.h (DWARF_FRAME_REGNUM): Add enclosing parens.
+
+2009-10-20 Michael Matz <matz@suse.de>
+
+ * loop-invariant.c (create_new_invariant): Use different magic number.
+
+2009-10-20 Richard Earnshaw <rearnsha@arm.com>
+
+ PR target/39247
+ * arm.c (arm_override_options): Forcibly disable hot/cold block
+ partitioning.
+
+2009-10-20 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/41739
+ * haifa-sched.c (try_ready): Skip debug deps updating speculation
+ status.
+
+2009-10-20 Richard Guenther <rguenther@suse.de>
+
+ * ggc-page.c: Include cfgloop.h.
+ (struct max_alignment): Drop long double, add void *.
+ (extra_order_size_table): Add low non-power-of-two multiples
+ of MAX_ALIGNMENT. Drop small type-based entries, add
+ tree_type, cgraph_node and loop.
+ * alloc-pool.c (struct allocation_object_def): Drop long double
+ aligning element.
+
+2009-10-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/41340
+ * loop-invariant.c (calculate_loop_reg_pressure): Don't count regs
+ referenced just in DEBUG_INSNs.
+
+2009-10-20 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41761
+ * gimple.c (gimple_register_type): Make sure we register
+ the types main variant first.
+
+2009-10-20 Richard Guenther <rguenther@suse.de>
+
+ * gimple.c (gimple_types_compatible_p): Simplify. Move
+ cheap checks before hashtable queries. Add checks for
+ TYPE_NONALIASED_COMPONENT and DECL_NONADDRESSABLE_P.
+
+2009-10-20 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree-sra.c (build_ref_for_offset_1) <RECORD_TYPE>: Skip fields
+ without size or with size that can't be represented as a host integer.
+
+2009-10-20 Alexandre Oliva <aoliva@redhat.com>
+
+ * tree-ssa-dce.c (eliminate_unnecessary_stmts): Don't regard
+ the removal of a debug stmt as a significant change.
+
+2009-10-20 Wolfgang Gellerich <gellerich@de.ibm.com>
+
+ * config/s390/s390.md: Added agen condition to operand
+ forwarding bypasses. Added bypass for early address generation
+ use of int results. Updated comments.
+
+2009-10-20 Stefan Dösinger <stefan@codeweavers.com>
+
+ * config/i386/i386.c: Remove signal.h #include.
+
+2009-10-20 Jie Zhang <jie.zhang@analog.com>
+
+ * simplify-rtx.c (simplify_const_unary_operation): Handle SS_ABS.
+ * doc/rtl.texi: Document ss_abs.
+
+2009-10-19 Jakub Jelinek <jakub@redhat.com>
+
+ * c-common.c (c_parse_error): Handle CPP_UTF8STRING.
+ * c-lex.c (c_lex_with_flags): Likewise. Test C_LEX_STRING_NO_JOIN
+ instead of C_LEX_RAW_STRINGS.
+ (lex_string): Handle CPP_UTF8STRING.
+ * c-parser.c (c_parser_postfix_expression): Likewise.
+ * c-pragma.h (C_LEX_RAW_STRINGS): Rename to ...
+ (C_LEX_STRING_NO_JOIN): ... this.
+
+2009-10-19 Anatoly Sokolov <aesok@post.ru>
+
+ * config/cris/cris.c (cris_function_value, cris_libcall_value,
+ cris_function_value_regno_p): New functions.
+ (cris_promote_function_mode): Update comment.
+ (TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE): Declare.
+ * config/cris/cris.h (FUNCTION_VALUE, LIBCALL_VALUE): Remove.
+ (FUNCTION_VALUE_REGNO_P): Redefine, use cris_function_value_regno_p.
+ * config/cris/cris-protos.h (cris_function_value_regno_p): Declare.
+
+2009-10-19 Jakub Jelinek <jakub@redhat.com>
+
+ * unwind-dw2.c (execute_stack_op): Fix operand order for
+ DW_OP_le, DW_OP_ge, DW_OP_lt and DW_OP_gt.
+
+2009-10-19 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gimple-low.c (struct lower_data): Add cannot_fallthru field.
+ (lower_stmt) <GIMPLE_BIND>: Add comment.
+ <GIMPLE_COND, GIMPLE_GOTO, GIMPLE_SWITCH>: Set cannot_fallthru to true
+ and return.
+ <GIMPLE_RETURN>: Remove the statement if cannot_fallthru is set.
+ Otherwise lower it and set cannot_fallthru to true.
+ <GIMPLE_TRY>: Update cannot_fallthru for GIMPLE_TRY_FINALLY and return.
+ <GIMPLE_CATCH, GIMPLE_EH_FILTER>: Set cannot_fallthru to false.
+ <GIMPLE_CALL>: Set cannot_fallthru to false for BUILT_IN_SETJMP and
+ to true for a noreturn call. Do not remove statements.
+ <GIMPLE_OMP_PARALLEL, GIMPLE_OMP_TASK>: Set cannot_fallthru to false.
+ Set cannot_fallthru to false on function exit.
+ (gimple_stmt_may_fallthru) <GIMPLE_SWITCH>: Really return false.
+ <GIMPLE_ASSIGN>: Remove.
+
+2009-10-19 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * config/s390/s390.c (s390_z10_optimize_cmp): Don't touch FP compares.
+
+2009-10-19 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * config/s390/s390.c (s390_z10_optimize_cmp): Use
+ next/prev_active_insn to skip DEBUG_INSNs as well.
+
+2009-10-19 Joseph Myers <joseph@codesourcery.com>
+
+ * config/arm/arm.c (output_move_neon): Use DImode in call to
+ adjust_address.
+
+2009-10-19 Matthias Klose <doko@ubuntu.com>
+
+ PR target/40134
+ * config.gcc (arm*-*-linux-*eabi): Use config/t-slibgcc-libgcc.
+
+2009-10-19 Jakub Jelinek <jakub@redhat.com>
+
+ * cfgexpand.c (expand_debug_expr): Fail if bitpos < 0 for non-MEM op0.
+
+2009-10-17 Andy Hutchinson <hutchinsonandy@gcc.gnu.org>
+
+ PR middle-end/41738
+ * optabs.c (expand_binop): Make mode of shift count expression mode
+ of shift count not target.
+ Remove indent nit.
+
+2009-10-17 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree-nested.c (convert_nonlocal_reference_stmt) <GIMPLE_COND>: New
+ case. Force using values to replace references within the statement.
+ (convert_local_reference_stmt): Likewise.
+
+2009-10-17 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gimple-low.c (lower_stmt) <GIMPLE_CALL>: If the call is noreturn,
+ remove a subsequent GOTO or RETURN statement.
+
+2009-10-17 Andy Hutchinson <hutchinsonandy@aim.com>
+
+ * config/avr.md (*movqi): Add zero as equally preferable constraint
+ as general register.
+ (*movhi): Ditto.
+
+2009-10-17 Eric Botcazou <ebotcazou@adacore.com>
+
+ * print-tree.c (print_node): Fix string for DECL_STRUCT_FUNCTION.
+
+2009-10-17 Richard Guenther <rguenther@suse.de>
+
+ * lto-streamer-in.c (lto_input_location): Try to reuse previous maps.
+
+2009-10-17 Richard Guenther <rguenther@suse.de>
+
+ * lto-streamer-in.c (input_gimple_stmt): Fixup FIELD_DECL
+ operands in COMPONENT_REFs.
+
+2009-10-17 Anatoly Sokolov <aesok@post.ru>
+
+ * targhooks.c (default_libcall_value): Don't use LIBCALL_VALUE macro
+ if not defined. Change type of second argument to const_rtx.
+ (default_function_value): Call gcc_unreachable if FUNCTION_VALUE
+ macro not defined.
+ * targhooks.h (default_libcall_value): Update prototype.
+ * target.h (struct gcc_target): Change type of second argument of
+ libcall_value to const_rtx.
+ * config/arm/arm.c (arm_libcall_value): Change type of second argument
+ to const_rtx.
+ (arm_libcall_uses_aapcs_base): Change type of argument to const_rtx.
+ * doc/tm.texi (TARGET_LIBCALL_VALUE): Revise documentation.
+
+2009-10-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/40521
+ * debug.h (struct gcc_debug_hooks): Add assembly_start hook.
+ * cgraphunit.c (cgraph_optimize): Call it.
+ * dwarf2out.c (dwarf2out_init): Move .cfi_sections printing into...
+ (dwarf2out_assembly_start): ... here. New hook.
+ (dwarf2out_debug_hooks): Add dwarf2out_assembly_start.
+ * debug.c (do_nothing_debug_hooks): Do nothing for assembly_start
+ hook.
+ * dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Likewise.
+ * sdbout.c (sdb_debug_hooks): Likewise.
+ * vmsdbgout.c (vmsdbg_debug_hooks): Add vmsdbgout_assembly_start.
+ (vmsdbgout_assembly_start): New hook.
+
+2009-10-17 Alexandre Oliva <aoliva@redhat.com>
+
+ * rtl.h (RTL_LOCATION): Fix typo.
+
+2009-10-17 Alexandre Oliva <aoliva@redhat.com>
+
+ * print-rtl.c (print_rtx): Print locators in asm_operands
+ and asm_input.
+
+2009-10-17 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/41535
+ * sched-deps.c (depl_on_debug_p): New.
+ (attach_dep_link): Reject debug deps before nondebug deps.
+ (add_to_deps_list): Insert debug deps after nondebug deps.
+ (sd_lists_empty_p): Stop at first nonempty list. Disregard debug
+ deps.
+ (sd_add_dep): Do not reject debug deps.
+ (add_insn_mem_dependence): Don't count debug deps.
+ (remove_from_deps): Likewise.
+ (sched_analyze_2): Set up mem deps on debug insns.
+ (sched_analyze_insn): Record reg uses for deps on debug insns.
+ * haifa-sched.c (schedule_insn): Reset deferred debug insn. Don't
+ try_ready nondebug insn after debug insn.
+ * ddg.c (create_ddg_dep_from_intra_loop_link,
+ create_ddg_dep_no_link): Don't reject debug deps.
+
+2009-10-16 Richard Guenther <rguenther@suse.de>
+
+ * lto-symtab.c (merge_incomplete_and_complete_type): Remove.
+ (maybe_merge_incomplete_and_complete_type): Likewise.
+ (lto_symtab_merge): Do not call them. Do not warn for
+ complete vs. incomplete compatible types.
+ (lto_symtab_merge_decls_2): Simplify.
+ * gimple.c (gimple_force_type_merge): Remove.
+ (gimple_types_compatible_p): Make it static.
+ * gimple.h (gimple_force_type_merge): Remove.
+ (gimple_types_compatible_p): Likewise.
+
+2009-10-16 Jakub Jelinek <jakub@redhat.com>
+
+ * dwarf2out.c (mem_loc_descriptor) <case ZERO_EXTRACT>: Cast
+ DWARF2_ADDR_SIZE to int to avoid signed vs. unsigned warnings.
+
+2009-10-16 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/41728
+ * tree-ssa-dom.c (optimize_stmt): Mark the stmt modified
+ if fold_stmt did anything.
+
+2009-10-16 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41715
+ * lto-streamer-in.c (lto_input_tree_ref): Revert last change.
+ (maybe_fixup_handled_component): New function.
+ (input_gimple_stmt): Fixup mismatched decl replacements.
+
+2009-10-16 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41713
+ * lto-streamer-out.c (lto_output_tree_ref): Handle DEBUG_EXPR_DECL
+ the same as VAR_DECL.
+
+2009-10-16 Richard Guenther <rguenther@suse.de>
+
+ * gimple.c (iterative_hash_gimple_type): For integer types
+ also hash their minimum and maximum values and the string flag.
+ For array types hash their domain and the string flag.
+
+2009-10-16 Richard Guenther <rguenther@suse.de>
+
+ * gimple.c (gimple_types_compatible_p): Restrict completing
+ types to record or unions. Simplify completion.
+ Do not merge records or unions with different
+ TYPE_STRUCTURAL_EQUALITY_P tag.
+ (iterative_hash_gimple_type): Restrict non-recursing into
+ pointer targets for records and unions.
+
+2009-10-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/41717
+ * cfgexpand.c (expand_debug_expr): Handle CONJ_EXPR.
+ * dwarf2out.c (mem_loc_descriptor): Don't handle
+ POST_INT/POST_DEC/POST_MODIFY like SUBREG. For SUBREG
+ punt if it is not lowpart subreg or if inner mode isn't
+ MODE_INT.
+
+2009-10-16 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * config/s390/s390.c (s390_z10_optimize_cmp): Skip notes when
+ investigating previous or next insns.
+
+2009-10-16 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree-sra.c (build_ref_for_offset_1): Update comment.
+
+2009-10-16 Wolfgang Gellerich <gellerich@de.ibm.com>
+
+ * config/s390/s390.md (atype): Added missing values.
+
+2009-10-15 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR target/41702
+ * pa.md (casesi): Use sign extended index in call to gen_casesi64p.
+ (casesi64p): Update pattern to reflect above.
+
+2009-10-15 Steve Ellcey <sje@cup.hp.com>
+
+ PR rtl-optimization/41697
+ * sel-sched-ir.h (_eligible_successor_edge_p): Check successor count.
+
+2009-10-15 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/23983
+ * config/rs6000/predicates.md: Update copyright year.
+ * config/rs6000/altivec.md: Ditto.
+
+ * config/rs6000/t-rs6000 (TM_H): Add rs6000-builtin.def.
+ (MD_INCLUDES): Add a2.md.
+
+ * config/rs6000/rs6000.c (rs6000_builtin_decls): Change
+ RS6000_BUILTIN_COUNT to MAX_RS6000_BUILTINS.
+ (builtin_classify): New static vector to classify various builtins
+ to get the tree attributes correct.
+ (def_builtin): Set the attributes of builtins based on what the
+ builtin does (i.e. memory operation, floating point, saturation
+ need special attributes, others are pure functions).
+
+ * config/rs6000/rs6000.h (enum rs6000_btc): New enum to classify
+ the builtins.
+ (enum rs6000_builtins): Include rs6000-builtin.def to define the
+ builtins. Change the end marker to MAX_RS6000_BUILTINS from
+ RS6000_BUILTIN_COUNT.
+ (rs6000_builtin_decls): Change RS6000_BUILTIN_COUNT to
+ MAX_RS6000_BUILTINS.
+
+ * config/rs6000/rs6000-builtin.def: New file that combines the
+ builtin enumeration name and attributes.
+
+2009-10-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/linux.h (ASM_SPEC): Add --32.
+
+2009-10-15 Jakub Jelinek <jakub@redhat.com>
+
+ * dwarf2out.c (dwarf_tag_name): Handle DW_TAG_rvalue_reference_type
+ and DW_TAG_template_alias.
+ (dwarf_attr_name): Handle DW_AT_main_subprogram,
+ DW_AT_data_bit_offset, DW_AT_const_expr, DW_AT_enum_class,
+ DW_AT_linkage_name, DW_AT_GNU_guarded_by, DW_AT_GNU_pt_guarded_by,
+ DW_AT_GNU_guarded, DW_AT_GNU_pt_guarded, DW_AT_GNU_locks_excluded,
+ DW_AT_GNU_exclusive_locks_required, DW_AT_GNU_shared_locks_required
+ and DW_AT_GNU_odr_signature.
+ (dwarf_form_name): Handle DW_FORM_sec_offset, DW_FORM_exprloc,
+ DW_FORM_flag_present and DW_FORM_ref_sig8.
+ (output_signature): Only print name on the first byte.
+ (output_die): Likewise for dw_val_class_data8.
+
+2009-10-15 Alexander Monakov <amonakov@ispras.ru>
+
+ * doc/invoke.texi: Clarify that most optimizations are not enabled
+ without -O.
+
+2009-10-15 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41668
+ * gimple.c (compare_type_names_p): Handle anonymous names
+ differently based on new mode argument.
+ (gimple_types_compatible_p): For structs also compare the tags.
+ (iterative_hash_type_name): Rename to ...
+ (iterative_hash_name): ... this. Hash all names.
+ (iterative_hash_gimple_type): Fix hashing the struct tag of
+ pointer targets. Hash field decl names.
+
+2009-10-15 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41669
+ * gimple.c (gimple_get_alias_set): Avoid recursing on
+ invalid type topology.
+
+2009-10-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ * config/spu/spu.c (get_branch_target): Use extract_asm_operands.
+
+2009-10-15 Richard Guenther <rguenther@suse.de>
+
+ * tree.c (free_lang_data_in_decl): Free DECL_FCONTEXT.
+
+2009-10-15 Jakub Jelinek <jakub@redhat.com>
+
+ * config/rs6000/option-defaults.h (OPTION_DEFAULT_SPECS): Don't
+ add --with-tune{,-32,-64} configured default for -mtune if explicit
+ -mcpu is used.
+
+2009-10-14 Daniel Gutson <dgutson@codesourcery.com>
+
+ * config/arm/neon.md (neon_vshll_n<mode>): Checking Bounds fixed.
+
+2009-10-14 DJ Delorie <dj@redhat.com>
+
+ * config/h8300/h8300.c (F): New.
+ (Fpa): New.
+ (h8300_emit_stack_adjustment): Call them.
+ (push): Likewise.
+ (h8300_push_pop): Likewise.
+ (h8300_expand_prologue): Likewise.
+ * config/h8300/h8300.h (DWARF2_DEBUGGING_INFO): Define.
+ (MUST_USE_SJLJ_EXCEPTIONS): Define.
+ (INCOMING_RETURN_ADDR_RTX): Define.
+ (INCOMING_FRAME_SP_OFFSET): Define.
+ (DWARF_CIE_DATA_ALIGNMENT): Define.
+
+2009-10-14 Jakub Jelinek <jakub@redhat.com>
+
+ * stor-layout.c (place_field): Don't emit -Wpadded warnings for
+ fields in builtin structs.
+ (finalize_record_size): Likewise.
+
+2009-10-14 Richard Guenther <rguenther@suse.de>
+
+ * gimple.c (gtc_ob): New global.
+ (struct type_pair_d): Replace pointers with type UIDs.
+ (type_pair_hash): Adjust.
+ (type_pair_eq): Likewise.
+ (lookup_type_pair): Likewise. Allocate from an obstack.
+ (gimple_force_type_merge): Adjust.
+ (gimple_types_compatible_p): Likewise.
+ (free_gimple_type_tables): Free the obstack.
+
+2009-10-14 Jakub Jelinek <jakub@redhat.com>
+
+ * tree-parloops.c (separate_decls_in_region_debug_bind): Drop debug
+ stmts setting DEBUG_EXPR_DECLs.
+
+ * cfgexpand.c (expand_debug_expr): Ignore zero-length bitfields.
+ Don't crash if mode1 is VOIDmode.
+
+2009-09-26 Vladimir Makarov <vmakarov@redhat.com>
+
+ * params.def (PARAM_IRA_LOOP_RESERVED_REGS): New.
+ * params.h (IRA_LOOP_RESERVED_REGS): New.
+ * tree-pass.h (pass_subregs_of_mode_init,
+ pass_subregs_of_mode_finish): Remove.
+ * passes.c (pass_subregs_of_mode_init,
+ pass_subregs_of_mode_finish): Remove.
+ (pass_reginfo_init): Move before loop optimizations.
+ * config/i386/i386.h (STACK_REG_COVER_CLASS): Define.
+ * common.opt (fira-loop-pressure): New.
+ * toplev.h (flag_ira_loop_pressure): New.
+ * rtl.h (init_subregs_of_mode, finish_subregs_of_mode): New externals.
+ * reginfo.c (init_subregs_of_mode, finish_subregs_of_mode):
+ Make external and void type functions.
+ (gate_subregs_of_mode_init, pass_subregs_of_mode_init,
+ pass_subregs_of_mode_finish): Remove.
+ * ira-costs.c (init_costs): Call init_subregs_of_mode.
+ * regmove.c: Include ira.h.
+ (regmove_optimize): Call ira_set_pseudo_classes after IRA based
+ register pressure calculation in loops.
+ * loop-invariant.c: Include REGS_H and ira.h.
+ (struct loop_data): New members max_reg_pressure, regs_ref, and
+ regs_live.
+ (struct invariant): New member orig_regno.
+ (curr_loop): New variable.
+ (find_exits): Initialize regs_ref and regs_live.
+ (create_new_invariant): Initialize orig_regno.
+ (get_cover_class_and_nregs): New.
+ (get_inv_cost): Make aregs_needed an array. Use regs_needed as an
+ array. Add code for flag_ira_loop_pressure.
+ (gain_for_invariant): Make new_regs an array. Add code for
+ flag_ira_loop_pressure.
+ (best_gain_for_invariant): Ditto.
+ (set_move_mark): New parameter gain. Use it for debugging output.
+ (find_invariants_to_move): Make regs_needed and new_regs an array.
+ Add code for flag_ira_loop_pressure.
+ (move_invariant_reg): Set up orig_regno.
+ (move_invariants): Set up reg classes for pseudos for
+ flag_ira_loop_pressure.
+ (free_loop_data): Clear regs_ref and regs_live.
+ (curr_regs_live, curr_reg_pressure, regs_set, n_regs_set,
+ get_regno_cover_class, change_pressure, mark_regno_live,
+ mark_regno_death, mark_reg_store, mark_reg_clobber,
+ mark_reg_death, mark_ref_regs, calculate_loop_reg_pressure): New.
+ (move_loop_invariants): Calculate pressure. Initialize curr_loop.
+ * ira.c (ira): Call ira_set_pseudo_classes after IRA based
+ register pressure calculation in loops if new regs were added.
+ Call finish_subregs_of_mode.
+ * opts.c (decode_options): Set up flag_ira_loop_pressure.
+ * Makefile.in (loop-invariant.o): Add ira.h.
+ (regmove.o): Ditto.
+ * doc/invoke.texi (-fira-loop-pressure, ira-loop-reserved-regs):
+ Describe.
+ * doc/tm.texi (STACK_REG_COVER_CLASS): Describe.
+
+2009-10-14 Richard Guenther <rguenther@suse.de>
+
+ * lto-symtab.c (lto_symtab_compatible): Fold in ...
+ (lto_symtab_merge): ... here. Rewrite both to take the
+ prevailing and a to-be-merged entry and to queue diagnostics properly.
+ (lto_symtab_resolve_replaceable_p): New predicate for
+ symbol resolution.
+ (lto_symtab_resolve_can_prevail_p): Likewise.
+ (lto_symtab_resolve_symbols): Rewrite. Fold in code that
+ handles merging commons by choosing the largest decl. Fold
+ in code that gives ODR errors.
+ (lto_symtab_merge_decls_2): Simplify a lot. Emit queued
+ diagnostics here.
+ (lto_symtab_merge_decls_1): Re-structure. Deal with the
+ case of no prevailing decl here. Diagnose mismatches
+ in object types here. Drop all but the prevailing decls.
+ (lto_symtab_prevailing_decl): Return the single prevailing decl.
+ * lto-streamer-in.c (lto_input_tree_ref): Deal with
+ VIEW_CONVERT_EXPRs in decl slots. Unshare the tree in this case.
+
+2009-10-14 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41521
+ * lto-streamer-in.c (input_bb): Replace debug stmts with
+ nops instead of dropping them.
+
+2009-10-14 Nick Clifton <nickc@redhat.com>
+
+ * gcc/doc/extended.texi: Replace the dash character with @minus{}
+ in situations where it is being used as a minus symbol.
+ * gcc/doc/tm.texi: Likewise.
+ * gcc/doc/md.texi: Likewise.
+
+2009-10-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/41543
+ * input.h (BUILTINS_LOCATION): Change to 1 from 2.
+ Assert BUILTINS_LOCATION < RESERVED_LOCATION_COUNT.
+ * tree.c: Include intl.h.
+ (expand_location): Handle BUILTINS_LOCATION.
+ * Makefile.in (tree.o): Depend on intl.h.
+
+ PR debug/41695
+ * dwarf2out.c (dwarf2out_var_location): Always clear
+ last_postcall_label when changing last_label.
+
+2009-10-14 Pascal Obry <obry@adacore.com>
+
+ * gcc.c (DEFAULT_SWITCH_CURTAILS_COMPILATION): Add -E.
+ (process_command): Handle -E as done with -c and -S. Do not add
+ the target executable suffix to the output file when -E is used.
+ (main): Adjust error message accordingly.
+
+2009-10-14 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/41343
+ PR debug/41447
+ PR debug/41264
+ PR debug/41338
+ * tree.c (tree_node_structure_for_code): DEBUG_EXPR_DECL uses
+ decl with rtl.
+ (tree_code_size): Likewise.
+
+2009-10-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtins.c (fold_builtin_1): Support complex "arc" functions.
+ * real.h (HAVE_mpc_arc): Define.
+
+2009-10-14 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * config/sh/sh.c (TARGET_BUILTIN_DECL): Define.
+ (struct builtin_description): Add fndecl field.
+ (bdesc): Remove const qualifier. Update initializer.
+ (sh_media_init_builtins): Remove const qualifier for d. Record
+ the result of add_builtin_function to the fndecl field.
+ (sh_builtin_decl): New.
+ (sh_media_builtin_decl): New.
+
+2009-10-14 Hans-Peter Nilsson <hp@axis.com>
+
+ PR target/38948
+ * config/cris/cris.h (SECONDARY_RELOAD_CLASS): Handle reload
+ requests between special registers.
+
+2009-10-13 Eric Botcazou <ebotcazou@adacore.com>
+
+ * dwarf2out.c (mem_loc_descriptor): Accept UNGT as well.
+
+2009-10-13 Richard Henderson <rth@redhat.com>
+
+ PR tree-optimization/41377
+ * tree-eh.c (unsplit_eh): Propagate degenerate PHIs.
+ (cleanup_empty_eh_merge_phis): New change_region parameter;
+ pass it on to redirect_eh_edge_1. Update callers.
+ (cleanup_empty_eh_unsplit): Don't require an existing EH label
+ at the destination block.
+
+2009-10-13 Basile Starynkevitch <basile@starynkevitch.net>
+
+ * passes.c (register_pass): Replaced gcc_unreachable by
+ fatal_error on failure. Mentions plugins in comments & messages.
+
+2009-10-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/41693
+ * rtl.h (DEBUG_EXPR_TREE_DECL): Define.
+ * sched-vis.c (print_value): Use it.
+ * cselib.c (cselib_hash_rtx): Likewise.
+ * print-rtl.c (print_rtx): Likewise.
+ * cfgexpand.c (expand_debug_rtx): Likewise.
+ * var-tracking.c (vt_expand_loc_callback): Likewise.
+
+2009-10-13 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41565
+ * opts.c (handle_option): Split out code to handle setting
+ the options flag var ...
+ (set_option): ... here.
+ * opts.h (set_option): Declare.
+ * lto-opts.c (register_user_option_p): Include -fexceptions
+ and all position independent code variants.
+ (handle_common_option): Remove.
+ (lto_reissue_options): Use set_option.
+
+2009-10-13 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/41661
+ * ipa-prop.c (compute_complex_pass_through): Allow only operations
+ that are tcc_comparisons or do not change the type in any
+ un-usleless way.
+ * ipa-cp.c (ipcp_lattice_from_jfunc): Request boolean type when
+ folding tcc_comparison operations.
+
+2009-10-13 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * config/s390/s390.c (s390_encode_section_info): Handle BLKmode
+ properly.
+
+2009-10-12 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/41343
+ PR debug/41447
+ PR debug/41264
+ PR debug/41338
+ * tree.def (DEBUG_EXPR_DECL): New.
+ * rtl.def (DEBUG_EXPR): New.
+ * gengtype.c (adjust_field_rtx_def): Handle it.
+ * tree-ssa.c (propagate_var_def_into_debug_stmts): Rename to...
+ (insert_debug_temp_for_var_def): ... this. Drop support for
+ moving. Take iterator for def stmt; insert debug stmt before it.
+ Scan early for use count and kind in debug stmts.
+ (propagate_defs_into_debug_stmts): Rename to...
+ (insert_debug_temps_for_defs): ... this. Likewise.
+ * tree.h (DEBUG_TEMP_UID): New.
+ * tree.c (next_debug_decl_uid): New.
+ (make_node_stat): Count debug decls separately.
+ (copy_node_stat): Likewise.
+ * cfgexpand.c (expand_debug_expr): Handle DEBUG_EXPR_DECL.
+ * var-tracking.c (dv_is_decl_p): Recognize it.
+ (VALUE_RECURSED_INTO): Apply to DEBUG_EXPRs too.
+ (track_expr_p): Track expanded DEBUG_EXPR_DECLs.
+ (vt_expand_loc_callback): Expand DEBUG_EXPRs.
+ (emit_note_insn_var_location): Don't emit notes for DEBUG_EXPR_DECLs.
+ * cselib.c (rtx_equal_for_cselib_p): Handle DEBUG_EXPR.
+ (cselib_hash_rtx): Likewise.
+ (cselib_expand_value_rtx_1): Use callback for DEBUG_EXPR.
+ * tree-ssa-operands.c (get_expr_operands): Skip DEBUG_EXPR_DECLs in
+ debug bind stmts.
+ * emit-rtl.c (verify_rtx_sharing): Handle DEBUG_EXPR and VALUE.
+ (copy_rtx_if_shared_1, reset_used_flags, set_used_flags): Likewise.
+ * rtl.c (copy_rtx): Likewise.
+ (rtx_equal_p_cb, rtx_equal_p): Handle DEBUG_EXPR.
+ * print-rtl.c (print_rtx): Likewise.
+ * sched-vis.c (print_value): Likewise.
+ (print_insn): Handle DEBUG_EXPR_DECL.
+ * tree-dump.c (dequeue_and_dump): Likewise.
+ * tree-pretty-print.c (dump_decl_name, dump_generic_node): Likewise.
+ * gimple-iterator (gsi_replace): Check for same lhs.
+ (gsi_remove): Insert debug temps.
+ * tree-ssa-loop-im.c (rewrite_reciprocal): Replace with same lhs.
+ (move_computations_stmt): Drop explicit propagation into debug stmts.
+ (rewrite_bittest): Likewise. Use gsi_remove for propagation.
+ * tree-ssa-reassoc.c (rewrite_expr_tree, linearize_expr): Likewise.
+ * tree-ssa-sink.c (statement_sink_location): Likewise.
+ * tree-ssa-forwprop (forward_propagate_addr_expr): Likewise.
+ * tree-ssanames.c (release_ssa_name): Adjust for rename.
+ * tree-flow.h: Likewise.
+ * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Don't mark
+ debug temps without values.
+ (eliminate_unnecessary_stmts): Don't discard just-inserted
+ debug stmts.
+
+2009-10-12 Hans-Peter Nilsson <hp@axis.com>
+
+ PR target/26515
+ * config/cris/cris.md (andu): Check that operand 1 is one of the
+ general registers. Fix typo in head comment.
+
+2009-10-12 Stefan Dösinger <stefan@codeweavers.com>
+
+ * config/i386/i386.md (vswapmov): New.
+ * config/i386/i386.c (ix86_handle_fndecl_attribute): New.
+ (ix86_function_ms_hook_prologue): New.
+ (ix86_expand_prologue): Handle ms_hook_prologue attribute.
+ * configure.ac: Test for swap suffix support in as.
+ * configure: Rebuild.
+
+2009-10-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/41680
+ * config/i386/i386.md (split after *testqi_ext_3_rex64): Only narrow
+ paradoxical subregs to prevent partial register stalls if the inner
+ mode is integer mode.
+
+2009-10-12 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (*setcc_<mode>_2): Remove insn pattern.
+
+2009-10-12 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/41570
+ * gcc/dwarf2out.c (template_parameter_pack_die,
+ gen_formal_parameter_pack_die): Use add_name_and_src_coords_attributes.
+
+2009-10-12 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/41616
+ * tree-into-ssa.c (insert_phi_nodes_for): Build debug bind stmts
+ on updates too.
+ (maybe_register_def): Likewise. Take stmt iterator.
+ (rewrite_update_stmt): Take stmt iterator and pass it on.
+ (rewrite_update_enter_block): Pass stmt iterator.
+
+2009-10-11 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ * config/spu/spu.c (TARGET_BUILTIN_DECL): Define.
+ (spu_builtin_decl): New function.
+
+2009-10-12 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (SWIM): New mode iterator.
+ (mov<mode>cc): Macroize expander from mov{qi,hi,si,di}cc patterns
+ using SWIM mode iterator.
+ (x86_mov<mode>cc_0_m1): Macroize insn from x86_mov{si,di}cc_0_m1
+ patterns using SWI48 mode iterator.
+ (*x86_mov<mode>cc_0_m1_se): Macroize insn from
+ *x86_mov{si,di}cc_0_m1_se patterns using SWI48 mode iterator.
+ (*x86_mov<mode>cc_0_m1_neg): New insn pattern.
+ (*mov<mode>cc_noc): Macroize insn from *mov{hi,si,di}cc_noc
+ patterns using SWI248 mode iterator.
+ * config/i386/i386.c (ix86_expand_int_movcc): Update the call to
+ gen_x86_movdicc_0_m1_rex64 for renamed function
+
+2009-10-11 Jose Ruiz <ruiz@adacore.com>
+ Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/33743
+ * config/sparc/sol2.h (MD_UNWIND_SUPPORT): Define.
+ * config/sparc/sol2-unwind.h: New file.
+
+2009-10-11 Olivier Hainque <hainque@adacore.com>
+ Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/33743
+ * config/i386/sol2.h (MD_UNWIND_SUPPORT): Define.
+ * config/i386/sol2-unwind.h: New file.
+
+2009-10-11 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/41665
+ * config/i386/i386.md (addsi_1_zext): Get the proper second
+ operand for lea.
+
+2009-10-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * simplify-rtx.c (simplify_replace_rtx): Use rtx_equal_p for
+ all OLD_RTXes, not just REGs. Use copy_rtx to create the
+ replacement value.
+
+2009-10-11 Richard Guenther <rguenther@suse.de>
+
+ * gimple.c (iterative_hash_type_name): Do not handle special
+ anonymous names.
+
+2009-10-11 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (*setcc_di_1): New insn_and_split pattern.
+ (*setcc_si_1_and): Ditto.
+ (*setcc_si_1_movzbl): Ditto.
+ (*setcc_<mode>_2): Ditto.
+ (*setcc_qi): Rename from *setcc_1.
+ (*setcc_qi_slp): Rename from *setcc_2.
+
+ (*zero_extendqihi2_movzbw_and splitter): Use ix86_expand_clear.
+ (*zero_extendqisi2_movzbw_and splitter): Ditto.
+
+ * config/i386/i386.c (ix86_expand_clear): Remove reload_completed from
+ "if" condition, there is already assert with reload_completed present.
+
+2009-10-11 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * plugin.c (try_init_one_plugin): Improve constness of variable err.
+
+2009-10-10 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * doc/install.texi (Final install): Refer to
+ http://gcc.gnu.org/bugs/ for bug reporting.
+
+2009-10-10 Peter Bergner <bergner@vnet.ibm.com>
+
+ * configure.ac: Add test for dci instruction.
+ * configure: Regenerate.
+ * config.in: Likewise.
+ * config.gcc: Handle --with-cpu=476 and --with-cpu=476fp.
+ * doc/invoke.texi: Add cpu_type 476 and 476fp.
+ (-mmulhw): Add 476 to description.
+ (-mdlmzb): Likewise.
+ * config/rs6000/t-fprules (MULTILIB_MATCHES_FLOAT): Include -mcpu=476.
+ * config/rs6000/rs6000.c (processor_costs): Add ppc476_cost.
+ (processor_target_table): Add 476 and 476fp entries.
+ (rs6000_override_options): Use ppc476_cost for PROCESSOR_PPC476.
+ (rs6000_issue_rate): Add CPU_PPC476.
+ * config/rs6000/rs6000.h (ASM_CPU_476_SPEC): Define.
+ (ASM_CPU_SPEC): Pass %(asm_cpu_476) for -mcpu=476 and -mcpu=476fp.
+ (processor_type): Add PROCESSOR_PPC476.
+ (EXTRA_SPECS): Add asm_cpu_476 string.
+ * config/rs6000/rs6000.md (define_attr "type"): Add isel attribute.
+ (define_attr "cpu"): Add ppc476.
+ Include 476.md.
+ Update comments for 476.
+ (isel_signed, isel_unsigned): Change to use "isel" type attribute.
+ * config/rs6000/vxworks.h (CPP_SPEC): Handle 464 and 476.
+ Update copyright year.
+ * config/rs6000/476.md: New file.
+ * config/rs6000/40x.md: Add description for "isel" attribute.
+ Update copyright year.
+ * config/rs6000/440.md: Likewise.
+ * config/rs6000/603.md: Likewise.
+ * config/rs6000/6xx.md: Likewise.
+ * config/rs6000/7450.md: Likewise.
+ * config/rs6000/7xx.md: Likewise.
+ * config/rs6000/8540.md: Likewise.
+ * config/rs6000/cell.md: Likewise.
+ * config/rs6000/e300c2c3.md: Likewise.
+ * config/rs6000/e500mc.md: Likewise.
+ * config/rs6000/mpc.md: Likewise.
+ * config/rs6000/power4.md: Likewise.
+ * config/rs6000/power5.md: Likewise.
+ * config/rs6000/power6.md: Likewise.
+ * config/rs6000/power7.md: Likewise.
+ * config/rs6000/rios1.md: Likewise.
+ * config/rs6000/rios2.md: Likewise.
+ * config/rs6000/rs64.md: Likewise.
+
+2009-10-10 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/41654
+ * tree-ssa-ifcombine.c (ifcombine_ifandif): Properly canonicalize
+ a cond expr before calling gimple_cond_set_condition_from_tree.
+ (ifcombine_iforif): Likewise.
+
+2009-10-09 Ian Lance Taylor <iant@google.com>
+
+ * configure.ac: Use AC_SEARCH_LIBS to find dlopen.
+ * configure: Rebuild.
+
+2009-10-09 Neil Vachharajani <nvachhar@google.com>
+
+ * doc/cpp.texi (Other Directives): Do not list #ident and #sccs as
+ deprecated.
+
+2009-10-09 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41638
+ * target-def.h (TARGET_BUILTIN_DECL): Define.
+ (TARGET_INITIALIZER): Add TARGET_BUILTIN_DECL.
+ * target.h (struct gcc_target): Add builtin_decl target hook.
+ * doc/tm.texi (TARGET_BUILTIN_DECL): Document.
+ * lto-streamer-in.c (lto_get_builtin_tree): Fix handling of
+ target builtins.
+ * lto-streamer-out.c (lto_output_tree_pointers): Use sorry,
+ not gcc_unreachable.
+ (lto_output_builtin_tree): Sorry if the target does not support
+ streaming target builtins.
+ * config/rs6000/rs6000.c (TARGET_BUILTIN_DECL): Define.
+ (rs6000_builtin_decl): New function.
+ * config/i386/i386.c (TARGET_BUILTIN_DECL): Define.
+ (ix86_builtin_decl): New function.
+
+2009-10-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/41445
+ * c-ppoutput.c (do_line_change): New function.
+ (cb_line_change): Use it.
+ (scan_translation_unit): Call do_line_change if
+ avoid_paste or PREV_WHITE and token location is on a different line
+ than print.src_line.
+
+ PR debug/40521
+ * dwarf2out.c (dwarf2out_init): Test whether
+ HAVE_GAS_CFI_SECTIONS_DIRECTIVE is non-zero instead of checking
+ it is defined.
+
+ PR rtl-optimization/41646
+ * calls.c (expand_call): For BLKmode types returned in registers
+ avoid likely spilled hard regs in copy_blkmode_from_reg generated
+ insns.
+
+2009-10-09 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/41634
+ * tree-ssa-dom.c (remove_local_expressions_from_table): Assert
+ we remove the correct elements.
+ (optimize_stmt): Make sure to update stmt operands before
+ optimizing redundancies.
+
+2009-10-09 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * config/s390/s390.md ("prefetch"): Remove stcmh for prefetching.
+
+2009-10-09 Richard Guenther <rguenther@suse.de>
+
+ PR driver/41637
+ * lto-wrapper.c (ltrans_output_file, flto_out, args_name): New
+ globals.
+ (lto_wrapper_exit): New function.
+ (fatal): Use it.
+ (fatal_perror): Likewise.
+ (fork_execute): Use global args_name, do not free it.
+ (run_gcc): Use global ltrans_output_file, flto_out, do not free them.
+ * lto-streamer.h: Remove duplicate prototypes.
+
+2009-10-09 Richard Guenther <rguenther@suse.de>
+
+ * cgraph.c (cgraph_create_edge): Check for NULL call_stmt
+ before calling stmt_can_throw_external.
+
+2009-10-09 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR tree-optimization/40071
+ * tree-vect-data-refs.c (vect_create_data_ref_ptr): Build a ref-all
+ pointer if the original data reference doesn't conflict with the
+ created vector data reference. Fix long line.
+
+2009-10-09 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (any_div): New code iterator.
+ (u): Handle div and udiv.
+ (sgnprefix): Ditto.
+ (<u>divqi3): Macroize insn from {,u}divqi3 using any_div
+ code iterator.
+ (lfloor<MODEF:mode><SWI48:mode>2): Macroize insn from
+ lfloor<mode>{si,di}2 patterns using SWI48 mode iterator.
+ (lceil<MODEF:mode><SWI48:mode>2): Macroize insn from
+ lceil<mode>{si,di}2 patterns using SWI48 mode iterator.
+
+2009-10-08 Joseph Myers <joseph@codesourcery.com>
+
+ * gcc.c (main): Remove trailing "." from diagnostics.
+
+2009-10-08 Cary Coutant <ccoutant@google.com>
+
+ Add support for debugging with ICF (Identical Code Folding).
+ * calls.c (debug.h): New #include.
+ (emit_call_1): Call virtual_call_token debug hook.
+ * common.opt (-fenable-icf-debug): New option.
+ * dwarf2out.c (dwarf2_debug_hooks): Add entries for new hooks (two
+ locations in the source).
+ (poc_label_num): New variable.
+ (dcall_entry, vcall_entry): New typedefs.
+ (dcall_table, vcall_table): New variables.
+ (struct vcall_insn): New type.
+ (vcall_insn_table): New variable.
+ (DEBUG_DCALL_SECTION, DEBUG_VCALL_SECTION): New macros.
+ (size_of_dcall_table): New function.
+ (output_dcall_table): New function.
+ (size_of_vcall_table): New function.
+ (output_vcall_table): New function.
+ (dwarf2out_direct_call): New function.
+ (vcall_insn_table_hash): New function.
+ (vcall_insn_table_eq): New function.
+ (dwarf2out_virtual_call_token): New function.
+ (dwarf2out_virtual_call): New function.
+ (dwarf2out_init): Allocate new tables and sections.
+ (prune_unused_types): Mark DIEs referenced from direct call table.
+ (dwarf2out_finish): Output direct and virtual call tables.
+ * final.c (final_scan_insn): Call direct_call and virtual_call
+ debug hooks.
+ * debug.h (struct gcc_debug_hooks): Add direct_call,
+ virtual_call_token, virtual_call hooks.
+ (debug_nothing_uid): New function.
+ * debug.c (do_nothing_debug_hooks): Add dummy entries for new hooks.
+ (debug_nothing_uid): New function.
+ * dbxout.c (dbx_debug_hooks): Add dummy entries for new hooks.
+ (xcoff_debug_hooks): Likewise.
+ * sdbout.c (sdb_debug_hooks): Likewise.
+ * vmsdbgout.c (vmsdbg_debug_hooks): Likewise.
+ * doc/invoke.texi (-fenable-icf-debug): New option.
+
+2009-10-08 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/41353
+ * regmove.c (regmove_backward_pass): Replace src with dst in the
+ debug insn, and check for dst before rather than after.
+
+2009-10-08 Janis Johnson <janis187@us.ibm.com>
+
+ * config/rs6000/rs6000.c (rs6000_delegitimize_address): Remove.
+ (TARGET_DELEGITIMIZE_ADDRESS): Likewise.
+
+2009-10-08 Jan Hubicka <jh@suse.cz>
+
+ PR middle-end/41626
+ * cgraphbuild.c (record_reference): When parameter DATA is NULL,
+ do not mark cgraph nodes as needed.
+ (record_references_in_initializer): Add new only_vars parameter.
+ * cgraph.h (record_references_in_initializer): New parameter.
+ * varasm.c (assemble_variable): Update call.
+ * varpool.c (varpool_analyze_pending_decls): Always look for
+ referenced vars.
+
+2009-10-08 Anatoly Sokolov <aesok@post.ru>
+
+ * config/avr/avr.c (last_insn_address) Remove variable.
+ (expand_prologue): Don't initialise last_insn_address variable.
+ (final_prescan_insn): Don't output insn size.
+ * config/avr/avr.opt (msize): Remove switch.
+ * doc/invoke.texi (AVR Options): Remove documentation of -msize
+ switch.
+
+2009-10-08 Adam Nemet <anemet@caviumnetworks.com>
+
+ * combine.c (label_tick_ebb_start): Fix comment.
+ (combine_instructions): Set label_tick and label_tick_ebb_start before
+ calling setup_incoming_promotions. Start them from 1. Increment
+ label_tick instead of deriving it from the BB index. Rather than
+ comparing ticks use the block from the previous iteration to decide
+ whether to start a new EBB. Remove empty lines before function.
+
+2009-10-08 Michael Matz <matz@suse.de>
+
+ PR middle-end/41573
+ * builtins.c (fold_builtin_isascii): Use fold_build2.
+ (fold_builtin_isdigit): Ditto.
+ * except.c (duplicate_eh_regions_1): Tolerate NULL labels.
+ * tree-cfg.c (struct rus_data, remove_useless_stmts_warn_notreached,
+ remove_useless_stmts_cond, remove_useless_stmts_tf,
+ remove_useless_stmts_tc, remove_useless_stmts_bind,
+ remove_useless_stmts_goto, remove_useless_stmts_label,
+ remove_useless_stmts_1, remove_useless_stmts,
+ pass_remove_useless_stmts): Remove.
+ * tree-pass.h (pass_remove_useless_stmts): Don't declare.
+ * passes.c (init_optimization_passes): Don't add
+ pass_remove_useless_stmts.
+ * tree-eh.c (lower_eh_constructs_2): Handle empty cleanups.
+ * tree.c (free_lang_data_in_decl): Don't clear DECL_INITIAL of
+ static constants.
+ * lto-symtab.c (lto_symtab_register_decl): Accepts DECL_INITIAL
+ for static constants.
+ * lto-streamer-out.c (output_gimple_stmt): Handle GIMPLE_NOP.
+ * lto-streamer-in.c (input_gimple_stmt): Handle GIMPLE_NOP.
+
+2009-10-08 Richard Guenther <rguenther@suse.de>
+
+ * gimple.c (free_gimple_type_tables): New function.
+ * gimple.h (free_gimple_type_tables): Declare.
+
+2009-10-07 Mark Heffernan <meheff@google.com>
+
+ * ipa-prop.c (ipa_print_node_params) Only print
+ names of named arguments.
+
+2009-10-08 Rafael Avila de Espindola <espindola@google.com>
+
+ * gcc.c (LINK_COMMAND_SPEC): Pass libc with -pass-through if it is
+ being statically linked.
+
+2009-10-08 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * collect2.c (add_lto_object): Only define if OBJECT_FORMAT_NONE.
+
+2009-10-08 Jan Hubicka <jh@suse.cz>
+
+ PR bootstrap/41620
+ * ipa.c (cgraph_externally_visible_p,
+ function_and_variable_visibility,
+ whole_program_function_and_variable_visibility): Skip non-finalized
+ nodes.
+
+2009-10-08 Nick Clifton <nickc@redhat.com>
+
+ * config/mn10300/mn10300.h (CONSTANT_ADDRESS_P): Do not allow
+ CONST_DOUBLEs.
+
+2009-10-08 Andreas Tobler <a.tobler@schweiz.org>
+
+ PR bootstrap/37739
+ * config.host: Use config/x-cflags-O1 for powerpc FreeBSD.
+
+2009-10-07 Joseph Myers <joseph@codesourcery.com>
+
+ PR c/41182
+ * c-common.c (c_fully_fold_internal): Strip nops from the result
+ of recursive calls to c_fully_fold_internal.
+ (c_wrap_maybe_const): New.
+ (c_save_expr): Use c_wrap_maybe_const.
+ * c-common.h (c_wrap_maybe_const): Declare.
+ * c-typeck.c (build_conditional_expr, c_finish_stmt_expr,
+ build_binary_op): Use c_wrap_maybe_const.
+
+2009-10-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * real.c: Fix comment to reflect actual exponent size.
+
+2009-10-08 Ben Elliston <bje@au.ibm.com>
+
+ * config/rs6000/a2.md: Add FSF comment header.
+
+2009-10-07 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (any_extend): New code iterator.
+ (u, s): New code attributes.
+ (sgnprefix): Ditto.
+ (DWIH): Rewrite as code iterator for SI and DI modes.
+ (DWI): Rewrite as mode attribute.
+ (dwi): New mode attribute.
+ (di): Depend on SI mode and DI mode.
+ (doubleint_general_operand): Remove mode attribute.
+
+ (*lea_1): Macroize insn from *lea_1_rex64 and *lea_1 patterns using
+ DWIH mode iterator.
+
+ (*add<mode>3_doubleword): Use DWIH as the base mode iterator.
+ (*sub<mode>3_doubleword): Ditto.
+
+ (mul<mode>3): Macroize expander from mul{hi,si,di}3 patterns
+ using SWIM248 mode iterator.
+ (*mul<mode>3_1): Macroize insn from mul{si,di}3_1 patterns
+ using SWI48 mode iterator.
+ (<u>mul<mode><dwi>3): Macroize expander from {,u}mul{sidi,diti}3
+ patterns using DWIH mode iterator and any_extend code iterator.
+ (<u>mulqihi3): Macroize expander from {,u}mulqihi3 patterns
+ using any_extend code iterator.
+ (*<u>mul<mode><dwi>3_1): Macroize insn from {,u}mul{sidi,diti}3_1
+ patterns using DWIH mode iterator and any_extend code iterator.
+ (*<u>mulqihi3_1): Macroize insn from {,u}mulqihi3_1 patterns
+ using any_extend code iterator.
+ (<s>mul<mode>3_highpart): Macroize expander from
+ {s,u}mul{si,di}3_highpart patterns using DWIH mode iterator
+ and any_extend code iterator.
+ (*<s>muldi3_highpart_1): Macroize insn from
+ *{s,u}muldi3_highpart_rex64 patterns using any_extend code iterator.
+ (*<s>mulsi3_highpart_1): Macroize insn from *{s,u}mulsi3_highpart_1
+ patterns using any_extend code iterator.
+ (*<s>mulsi3_highpart_zext): Macroize insn from
+ *{s,u}mulsi3_highpart_zext patterns using any_extend code iterator.
+
+2009-10-07 Jakub Jelinek <jakub@redhat.com>
+
+ * dwarf2out.c (tree_add_const_value_attribute_for_decl): Don't add
+ DW_AT_const_value if VAR_DIE already has DW_AT_abstract_origin
+ refering to a DIE with DW_AT_const_value.
+
+2009-10-07 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR middle-end/22072
+ * ira-lives.c (check_and_make_def_conflict): Process all operands.
+
+2009-10-06 Jan Hubicka <jh@suse.cz>
+
+ * cgraph.c (cgraph_node_can_be_local): Handle externally visible nodes
+ correctly.
+
+2009-10-06 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (*lea_1_rex64, *lea_1, *lea_1_zext,
+ *lea_2_rex64): Move before *add<mode>_1 pattern.
+
+2009-10-07 Jan Hubicka <jh@suse.cz>
+
+ * collect2.c (main): Add -fno-whole-program.
+ * gcc.c (set_collect_gcc_options): Do not remove whole program here.
+
+2009-10-07 Jan Hubicka <jh@suse.cz>
+
+ * lto-symtab.c (lto_cgraph_replace_node): Assert that inline clones
+ has no address taken.
+ * cgraph.c (cgraph_mark_needed_node): Assert that inline clones are
+ never needed.
+ (cgraph_clone_node): Clear externally_visible flag for clones.
+ * cgraph.h (cgraph_only_called_directly_p,
+ cgraph_can_remove_if_no_direct_calls_p): New predicates.
+ * tree-pass.h (pass_ipa_whole_program_visibility): Declare.
+ * ipa-cp.c (ipcp_cloning_candidate_p): Use new predicate.
+ (ipcp_initialize_node_lattices, ipcp_estimate_growth,
+ ipcp_insert_stage): Likwise.
+ * cgraphunit.c (cgraph_decide_is_function_needed): Do not compute
+ externally_visible flag.
+ (verify_cgraph_node): Verify that inline clones look right.
+ (process_function_and_variable_attributes): Do not set
+ externally_visible flags.
+ (ipa_passes): Avoid executing small_ipa_passes at LTO stage; they've
+ been already run.
+ * lto-cgraph.c (lto_output_node): Assert that inline clones are not
+ boundaries.
+ * ipa-inline.c (cgraph_clone_inlined_nodes): Use new predicates;
+ clear externally_visible when turning into inline clones
+ (cgraph_mark_inline_edge): Use new predicates.
+ (cgraph_estimate_growth): Likewise.
+ (cgraph_decide_inlining): Likewise.
+ * ipa.c (cgraph_postorder): Likewise.
+ (cgraph_remove_unreachable_nodes): Likewise; sanity check
+ that inline clones are not needed.
+ (cgraph_externally_visible_p): New predicate.
+ (function_and_variable_visibility): Add whole_program parameter;
+ always set externally_visible flag; handle COMDAT function
+ privatization.
+ (local_function_and_variable_visibility): New function.
+ (gate_whole_program_function_and_variable_visibility): New function.
+ (whole_program_function_and_variable_visibility): New function.
+ (pass_ipa_whole_program_visibility): New function.
+ * passes.c (init_optimization_passes): Add whole program visibility
+ pass.
+ (do_per_function_toporder, function_called_by_processed_nodes_p): Do
+ not care about needed/reachable flags.
+ * varpool.c: Include flags.h
+ (decide_is_variable_needed): When doing LTO assume whole-program mode.
+ (varpool_finalize_decl): When we are in LTO read-back, all variables
+ are analyzed.
+ (varpool_analyze_pending_decls): Skip analyzis of analyzed vars.
+
+2009-10-07 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * config/s390/tpf.h (TARGET_DEFAULT): Remove MASK_HARD_FLOAT and
+ add MASK_HARD_DFP.
+
+2009-10-07 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * config.gcc: Don't include the makefile fragments intended for
+ libgcc.
+ * config/s390/fixdfdi.h: File removed.
+ * config/s390/libgcc-glibc.ver: File removed.
+ * config/s390/s390.h: Remove the fixdfdi.h hack.
+ * config/s390/t-crtstuff: File moved to libgcc dir.
+ * config/s390/t-linux: Likewise.
+ * config/s390/t-tpf: libgcc specific parts removed.
+ * config/s390/t-linux64: Likewise.
+
+2009-10-06 Jerry Quinn <jlquinn@optonline.net>
+
+ * Makefile.in (lto-wrapper): Use COMPILER and ALL_COMPILERFLAGS.
+ (lto-compress.o): Likewise.
+
+2009-10-07 Danny Smith <dannysmith@users.sourceforge.net>
+
+ PR target/41512
+ * config/i386/winnt.c (i386_pe_determine_dllexport_p): Don't propagate
+ dllexport to class members here.
+ (i386_pe_determine_dllimport_p): Only check static class data for
+ definition.
+ (i386_pe_encode_section_info): Don't recheck DECL_DLLIMPORT_P.
+ * config/i386/winnt-cxx.c (i386_pe_type_dllimport_p): Only check
+ functions for vague linkage.
+ (i386_pe_type_dllexport_p): Fix formatting.
+ (maybe_add_dllexport) New function.
+ (i386_pe_adjust_class_at_definition): Use it to propagate dllexport
+ to class members.
+
+2009-10-07 Ben Elliston <bje@au.ibm.com>
+
+ * config/rs6000/a2.md: Remove duplicated lines.
+
+2009-10-07 Ben Elliston <bje@au.ibm.com>
+
+ * config.gcc (powerpc*-*-*): Handle a2.
+ * config/rs6000/rs6000.md (cpu): Add ppca2. Include "a2.md".
+ * config/rs6000/a2.md: New file.
+ * config/rs6000/rs6000.opt (mno-update): New.
+ (mupdate): Return to using a mask, not a var.
+ * config/rs6000/rs6000.h (ASM_CPU_SPEC): Add support for a2.
+ (enum processor_type): Add PROCESSOR_PPCA2.
+ * config/rs6000/rs6000.c (ppca2_cost): New costs.
+ (rs6000_override_options): Add "a2" to processor_target_table.
+ Update rs6000_always_hint logic. Correctly set rs6000_cost for a2.
+ * doc/invoke.texi (RS/6000 and PowerPC Options): Document -mcpu=a2.
+
+2009-10-06 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (float<SSEMODEI24:mode><X87MODEF:mode>2):
+ Use explicit gen_truncxfsf2 and gen_truncxfdf2 references to avoid
+ reference to nonexistent gen_truncxfxf2 function.
+
+2009-10-06 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (SWI48, SDWIM, DWI): New mode iterators.
+ (DWIH, g, di, doubleint_general_operand): New mode attributes.
+ (general_operand): Handle TI mode.
+ (add<mode>3): Macroize expander from add{qi,hi,si,di,ti}3 patterns
+ using SDWIM mode iterator.
+ (*add<mode>3_doubleword): New insn_and_split pattern. Macroize
+ pattern from *add{di,ti}3_1 patterns and corresponding splitters
+ using DWI mode iterator.
+ (add<mode>3_carry): Macroize insn from add{qi,hi,si,di}3_carry
+ patterns using SWI mode iterator.
+ (*add<mode>3_cc): Macroize insn from add{si,di}3_cc patterns
+ using SWI48 mode iterator.
+ (*add<mode>_1): Ditto from add{si,di}_1 patterns.
+ (*add<mode>_2): Ditto from add{si,di}_2 patterns.
+ (*add<mode>_3): Ditto from add{si,di}_3 patterns.
+ (*add<mode>_5): Ditto from add{si,di}_5 patterns.
+ (sub<mode>3): Macroize expander from sub{qi,hi,si,di,ti}3 patterns
+ using SDWIM mode iterator.
+ (*sub<mode>3_doubleword): New insn_and_split pattern. Macroize
+ pattern from *sub{di,ti}3_1 patterns and corresponding splitters
+ using DWI mode iterator.
+ (sub<mode>3_carry): Macroize insn from sub{qi,hi,si,di}3_carry
+ patterns using SWI mode iterator.
+ (*sub<mode>_1): Ditto from from sub{qi,hi,si,di}_1 patterns.
+ (*sub<mode>_2): Ditto from sub{qi,hi,si,di}_2 patterns.
+ (*sub<mode>_3): Ditto from sub{qi,hi,si,di}_3 patterns.
+ (<plusminus_insn>xf3): Macroize expander from addxf3 and subxf3
+ patterns using plusminus code iterator.
+ (<plusminus_insn><mode>3): Macroize expander from add<mode>3 and
+ sub<mode>3 patterns using plusminus code iterator.
+ * config/i386/i386.c (override_options): Update the call to
+ gen_subdi_carry_rex64 for renamed function.
+ (ix86_expand_int_addcc): Update calls to gen_subdi3_carry_rex64
+ and gen_adddi3_carry_rex64 for renamed functions. Use indirect
+ calls to instruction expanders.
+
+2009-10-06 Martin Jambor <mjambor@suse.cz>
+
+ PR bootstrap/41395
+ * opts.c (decode_options): Run IPA-SRA at -O2.
+
+2009-10-06 Richard Guenther <rguenther@suse.de>
+
+ * lto-symtab.c (lto_symtab_entry_hash): Hash strings, not pointers.
+
+2009-10-06 Tobias Burnus <burnus@net-b.de>
+
+ PR lto/41591
+ * doc/invoke.texi (-flto,-fwhole-program): Make clear that the
+ -flto and -fwhole-program flags can be combined.
+
+2009-10-06 Ryan Mansfield <rmansfield@qnx.com>
+
+ PR driver/41217
+ * gcc.c (process_command): Check that -o argument was specified.
+
+2009-10-06 Jerry Quinn <jlquinn@optonline.net>
+
+ * gimple.c (gimple_type_hash): Use CONST_CAST_TREE to fix compilation.
+
+2009-10-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * c.opt (Wjump-misses-init): Fix typo to enable for ObjC.
+ * doc/invoke.texi (Warning Options): Annotate allowed languages
+ for -Wunsuffixed-float-constants.
+
+2009-10-05 Jakub Jelinek <jakub@redhat.com>
+
+ * dwarf2out.c (modified_type_die): Don't add DW_AT_name to
+ DW_TAG_{const,volatile}_type if its DW_AT_type already has the
+ same name and isn't the main variant.
+
+ PR debug/41558
+ * dwarf2out.c (loc_by_reference): Removed.
+ (dw_loc_list_1): New function.
+ (dw_loc_list): Remove toplev argument, add want_address argument.
+ Don't look at decl_by_reference_p at all. Use dw_loc_list_1.
+ (loc_list_from_tree) <case VAR_DECL>: Pass want_address rather than
+ want_address == 2 to dw_loc_list. For successful dw_loc_list
+ set have_address to 1 only if want_address is not 0.
+
+2009-10-05 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * config/mips/mips-protos.h (mips_trampoline_code_size): Declare.
+ * config/mips/mips.h (TRAMPOLINE_SIZE): Redefine as the size of
+ a code block followed by two pointers.
+ (TRAMPOLINE_ALIGNMENT): Define to 64 for 32-bit targets too.
+ * config/mips/mips.c (MIPS_LOAD_PTR): New macro.
+ (MIPS_MOVE): Likewise.
+ (MIPS_LUI): Likewise.
+ (MIPS_JR): Likewise.
+ (MIPS_BAL): Likewise.
+ (MIPS_NOP): Likewise.
+ (mips_asm_trampoline_template): Delete.
+ (mips_trampoline_code_size): New function.
+ (mips_trampoline_init): Add shorter sequences for all cases
+ except Pmode == DImoe && !TARGET_USE_PIC_FN_ADDR_REG.
+ Calculate the opcodes directly, rather than copying from a template.
+ Only flush the code part of the trampoline.
+ (TARGET_ASM_TRAMPOLINE_TEMPLATE): Delete.
+
+2009-10-05 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * config/mips/mips.h (DWARF_FRAME_RETURN_COLUMN): Replace
+ GP_REG_FIRST + 31 with RETURN_ADDR_REGNUM.
+ (INCOMING_RETURN_ADDR_RTX): Likewise.
+ (FUNCTION_PROFILER): Likewise. Replace GP_REG_FIRST + 1
+ with AT_REGNUM.
+ * config/mips/sdemtk.h (FUNCTION_PROFILER): Replace GP_REG_FIRST + 31
+ with RETURN_ADDR_REGNUM.
+ (MIPS_SAVE_REG_FOR_PROFILING_P): Likewise.
+ * config/mips/mips.c (mips16_build_call_stub): Replace
+ GP_REG_FIRST + 31 with RETURN_ADDR_REGNUM, GP_REG_FIRST + 1
+ with AT_REGNUM and 31 with RETURN_ADDR_REGNUM.
+ (mips_print_operand_punctuation): Likewise.
+ (mips_frame_set): Likewise.
+ (mips16e_output_save_restore): Likewise.
+ (mips_cfun_might_clobber_call_saved_reg_p): Likewise.
+ (mips_save_reg_p): Likewise.
+ (mips_return_addr): Likewise.
+ (mips_set_return_address): Likewise.
+ (mips_direct_save_slot_move_p): Likewise.
+ (mips_output_function_prologue): Likewise.
+ (mips_restore_reg): Likewise.
+ (mips_expand_epilogue): Likewise.
+ (mips_epilogue_uses): Likewise.
+ * config/mips/mips.md (RETURN_ADD_REGNUM): Define.
+ (*mov<mode>_ra): Use it instead of a hard-coded 31.
+ (clear_hazard_<mode>): Likewise.
+ (call_internal): Likewise.
+ (call_internal_direct): Likewise.
+ (call_direct_split): Likewise.
+ (call_value_internal): Likewise.
+ (call_value_split): Likewise.
+ (call_value_internal_direct): Likewise.
+ (call_value_direct_split): Likewise.
+ (call_value_multiple_internal): Likewise.
+ (call_value_multiple_split): Likewise.
+
+2009-10-05 Eric Botcazou <ebotcazou@adacore.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/41511
+ * combine.c (record_value_for_reg): Pass explicit values as argument
+ to get_last_value_validate.
+ (get_last_value_validate): Document INSN parameter.
+ For non-readonly MEMs, assume they might have been modified if INSN
+ was in another basic block.
+ (get_last_value): Minor reformatting.
+
+2009-10-05 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR tree-opt/40992
+ * final.c (asm_str_count): Split out from asm_insn_count.
+ * rtl.h (asm_str_count): New prototype.
+ * tree-inline (estimate_num_insns) <case GIMPLE_ASM>: Call
+ asm_str_count.
+
+2009-10-05 Sriraman Tallam <tmsriram@google.com>
+
+ * doc/plugins.texi: Change plugin_pass to register_pass_info.
+
+2009-10-05 Basile Starynkevitch <basile@starynkevitch.net>
+ Rafael Espindola <espindola@google.com>
+
+ * gengtype.c (write_types): Moved call to write_func_for_structure
+ into seperate loops.
+
+2009-10-05 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41281
+ * lto-cgraph.c (output_cgraph): Output toplevel asms.
+ (input_cgraph_1): Input toplevel asms.
+
+2009-10-05 Richard Guenther <rguenther@suse.de>
+
+ PR lto/40902
+ * lto-symtab.c (lto_compatible_attributes_p): Remove.
+ (external_aggregate_decl_p): Likewise.
+ (lto_symtab_compatible): Re-structure. Remove dead code.
+ For variables ignore toplevel qualifiers when comparing types.
+ Issue warnings, not errors for mismatched user-alignment.
+
+2009-10-05 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41552
+ PR lto/41487
+ * lto-symtab.c (struct lto_symtab_base_def): Remove.
+ (struct lto_symtab_identifier_def): Likewise.
+ (struct lto_symtab_decl_def): Likewise.
+ (struct lto_symtab_entry_def): New.
+ (lto_symtab_identifier_t): Rename to ...
+ (lto_symtab_entry_t): ... this.
+ (lto_symtab_decls): Remove.
+ (lto_symtab_base_hash): Rename to ...
+ (lto_symtab_entry_hash): ... this.
+ (lto_symtab_base_eq): Rename to ...
+ (lto_symtab_entry_eq): ... this.
+ (lto_symtab_base_marked_p): Rename to ...
+ (lto_symtab_entry_marked_p): ... this.
+ (lto_symtab_identifier_marked_p): Remove.
+ (lto_symtab_decl_marked_p): Likewise.
+ (lto_symtab_maybe_init_hash_tables): Rename to ...
+ (lto_symtab_maybe_init_hash_table): ... this.
+ (lto_symtab_set_resolution_and_file_data): Remove.
+ (lto_symtab_register_decl): New function.
+ (lto_symtab_get_identifier): Remove.
+ (lto_symtab_get): New function.
+ (lto_symtab_get_resolution): Adjust.
+ (lto_symtab_get_identifier_decl): Remove.
+ (lto_symtab_set_identifier_decl): Likewise.
+ (lto_symtab_merge_decl): Rename to ...
+ (lto_symtab_merge): ... this. Rewrite.
+ (lto_symtab_merge_var): Remove.
+ (lto_symtab_merge_fn): Likewise.
+ (lto_symtab_prevailing_decl): Adjust.
+ (lto_cgraph_replace_node): New function.
+ (lto_symtab_merge_decls_2): Likewise.
+ (lto_symtab_merge_decls_1): Likewise.
+ (lto_symtab_fixup_var_decls): Likewise.
+ (lto_symtab_resolve_symbols): Likewise.
+ (lto_symtab_merge_decls): Likewise.
+ (lto_symtab_prevailing_decl): Adjust.
+ (lto_symtab_get_symtab_def): Remove.
+ (lto_symtab_get_file_data): Likewise.
+ (lto_symtab_clear_resolution): Adjust.
+ (lto_symtab_clear_resolution): Likewise.
+ * lto-cgraph.c (input_edge): Do not merge cgraph nodes here.
+ (input_cgraph_1): Likewise.
+ * lto-streamer-in.c (get_resolution): Do not provide fake
+ symbol resolutions here.
+ (deferred_global_decls): Remove.
+ (lto_register_deferred_decls_in_symtab): Likewise.
+ (lto_register_var_decl_in_symtab): Change signature, register
+ variable via lto_symtab_register_decl.
+ (lto_register_function_decl_in_symtab): Likewise.
+ (lto_read_tree): Adjust.
+ * lto-streamer.h (lto_register_deferred_decls_in_symtab): Remove.
+ (lto_symtab_merge_var): Likewise.
+ (lto_symtab_merge_fn): Likewise.
+ (lto_symtab_register_decl): Declare.
+ (lto_symtab_merge_decls): Likewise.
+
+2009-10-05 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/23821
+ * tree-vrp.c (vrp_finalize): Do not perform copy propagation.
+ * tree-ssa-dom.c (cprop_operand): Do not propagate copies into
+ simple IV increments.
+
+2009-10-05 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+
+ * config/arm/arm.c (arm_override_options): Really initialize
+ flag_dwarf2_cfi_asm to 0.
+
+2009-10-05 Doug Kwan <dougkwan@google.com>
+
+ PR rtl-optimization/41574
+ * combine.c (distribute_and_simplify_rtx): Quit if RTX mode is
+ floating point and we are not doing unsafe math optimizations.
+
+2009-10-03 Simon Baldwin <simonb@google.com>
+ Cary Coutant <ccoutant@google.com>
+ Rafael Espindola <espindola@google.com>
+ Richard Guenther <rguenther@suse.de>
+ Jan Hubicka <jh@suse.cz>
+ Doug Kwan <dougkwan@google.com>
+ H.J. Lu <hongjiu.lu@intel.com>
+ Bill Maddox <maddox@google.com>
+ Ryan Mansfield <rmansfield@qnx.com>
+ Diego Novillo <dnovillo@google.com>
+ Ollie Wild <aaw@google.com>
+ Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-cgraph.c: New file.
+ * lto-compress.c: New file.
+ * lto-compress.h: New file.
+ * lto-opts.c: New file.
+ * lto-section-in.c: New file.
+ * lto-section-out.c: New file.
+ * lto-streamer-in.c: New file.
+ * lto-streamer-out.c: New file.
+ * lto-streamer.c: New file.
+ * lto-streamer.h: New file.
+ * lto-symtab.c: New file.
+ * lto-wpa-fixup.c: New file.
+ * lto-wrapper.c: New file.
+
+2009-10-03 Simon Baldwin <baldwin@google.com>
+ Ben Elliston <bje@au.ibm.com>
+ Rafael Espindola <espindola@google.com>
+ Nathan Froyd <froydnj@codesourcery.com>
+ Jan Hubicka <jh@suse.cz>
+ Doug Kwan <dougkwan@google.com>
+ Diego Novillo <dnovillo@google.com>
+ Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * Makefile.in (enable_lto): New.
+ (site.exp): If @enable_lto@ is set to 'yes' define ENABLE_LTO.
+ (LINKER_PLUGIN_API_H): Define.
+ (LTO_SYMTAB_H): Define.
+ (LTO_STREAMER_H): Define.
+ (TREE_VECTORIZER_H): Define.
+ (INCLUDES): Add LIBELFINC.
+ (OBJS-common): Add lto-cgraph.o, lto-streamer-in.o,
+ lto-streamer-out.o, lto-section-in.o, lto-section-out.o, lto-symtab.o,
+ lto-opts.o, lto-streamer.o, lto-wpa-fixup.o, lto-compress.o.
+ (MOSTLYCLEANFILES): Add lto-wrapper$(exeext)
+ (native): Add lto-wrapper$(exeext)
+ (lto-compress.o, lto-cgraph.o, lto-streamer-in.o,
+ lto-streamer-out.o, lto-section-in.o, lto-section-out.o,
+ lto-symtab.o, lto-opts.o, lto-streamer.o, lto-wpa-fixup.o): New rules.
+ (gimple.o): Add dependency on LTO_HEADER_H and LTO_SECTION_OUT_H.
+ (varasm.o): Add dependency on tree-iterator.h.
+ (cgraph.o): Add dependency on cif-code.def.
+ (ipa-reference.o): Add dependency on LTO_STREAMER_H.
+ (ipa-pure-const.o): Likewise.
+ (GTFILES): Add lto-symtab.c.
+ (install-lto-wrapper): New.
+ * configure.ac: If 'lto' is in enable_languages, define ENABLE_LTO
+ and enable_lto. If LIBELFLIBS is set, define HAVE_libelf.
+ * config.in: Regenerate.
+
+2009-10-03 Rafael Espindola <espindola@google.com>
+ Diego Novillo <dnovillo@google.com>
+
+ * cgraphunit.c (ipa_passes): Prevent lto1 from calling
+ ipa_write_summaries.
+ Call execute_ipa_summary_passes for all_regular_ipa_passes and
+ all_lto_gen_passes.
+ (cgraph_optimize): Make extern.
+
+2009-10-03 Nathan Froyd <froydnj@codesourcery.com>
+ Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * toplev.c (in_lto_p): Declare.
+ * collect2.c (scan_prog_file): Read all the output when reading
+ information for LTO.
+ (enum lto_mode_d): Declare.
+
+2009-10-03 Richard Guenther <rguenther@suse.de>
+ Diego Novillo <dnovillo@google.com>
+
+ * gimple.c: Include target.h and alias.h.
+ (gimple_types): Declare.
+ (type_hash_cache): Declare.
+ (gimple_alloc_stat): Make extern.
+ (gimple_build_eh_must_not_throw): Call
+ gimple_eh_must_not_throw_set_fndecl.
+ (struct type_pair_d): Declare.
+ (type_pair_t): Declare.
+ (type_pair_hash): New.
+ (type_pair_eq): New.
+ (lookup_type_pair): New.
+ (gimple_force_type_merge): New.
+ (compare_type_names_p): New.
+ (compare_field_offset): New.
+ (gimple_types_compatible_p): New.
+ (struct sccs): Declare.
+ (next_dfs_num): Declare.
+ (iterative_hash_gimple_type): New.
+ (visit): New.
+ (iterative_hash_type_name): New.
+ (iterative_hash_gimple_type): New.
+ (gimple_type_hash): New.
+ (gimple_type_eq): New.
+ (gimple_register_type): New.
+ (print_gimple_types_stats): New.
+ (gimple_signed_or_unsigned_type): New.
+ (gimple_unsigned_type): New.
+ (gimple_signed_type): New.
+ (gimple_get_alias_set): New.
+ (gimple_decl_printable_name): Do not use DMGL_TYPES.
+ * gimple.h (gimple_alloc, gimple_alloc_stat): Declare.
+ (gimple_force_type_merge): Declare.
+ (gimple_types_compatible_p): Declare.
+ (gimple_register_type): Declare.
+ (print_gimple_types_stats): Declare.
+ (gimple_unsigned_type): Declare.
+ (gimple_signed_type): Declare.
+ (gimple_get_alias_set): Declare.
+ (gimple_eh_must_not_throw_set_fndecl): New.
+
+2009-10-03 Jan Hubicka <jh@suse.cz>
+ Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * ipa-pure-const.c: Include lto-streamer.h.
+ (register_hooks): Factor out of ...
+ (generate_summary): ... here.
+ (pure_const_write_summary): New.
+ (pure_const_read_summary): New.
+ (pass_ipa_pure_const): Add pure_const_write_summary and
+ pure_const_read_summary.
+ * ipa-reference.c: Include lto-streamer.h.
+ (add_new_function): New.
+ (remove_node_data): New.
+ (duplicate_node_data): New.
+ (ipa_init): Guard against multiple calls.
+ Move hook setup from analyze_function.
+ (write_node_summary_p): New.
+ (ipa_reference_write_summary): New.
+ (ipa_reference_read_summary): New.
+ (pass_ipa_reference): Add ipa_reference_write_summary and
+ ipa_reference_read_summary.
+ * cgraph.h (cgraph_local_info): Add field lto_file_data.
+ (struct cgraph_edge): Add fields lto_stmt_uid and
+ call_stmt_cannot_inline_p.
+ (cgraph_optimize): Declare.
+ (cgraph_decide_is_function_needed): Declare.
+ (reset_inline_failed): Declare.
+ (enum LTO_cgraph_tags): Declare.
+ (LTO_cgraph_tag_names): Declare.
+ (LCC_NOT_FOUND): Define.
+
+2009-10-03 Doug Kwan <dougkwan@google.com>
+ Rafael Espindola <espindola@google.com>
+ Jan Hubicka <jh@suse.cz>
+ Diego Novillo <dnovillo@google.com>
+ Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * passes.c (all_regular_ipa_passes): New.
+ (all_ipa_passes): Rename to all_small_ipa_passes.
+ (init_optimization_passes): Init all_regular_ipa_passes.
+ * tree-pass.h (all_regular_ipa_passes): New.
+ (all_ipa_passes): Rename to all_small_ipa_passes.
+ * passes.c (all_lto_gen_passes): New.
+ (init_optimization_passes): Initialize all_lto_gen_passes.
+ (execute_ipa_summary_passes): Make non-static.
+ (ipa_write_summaries_1): New.
+ (ipa_write_summaries_2): New.
+ (ipa_write_summaries): New.
+ (ipa_write_summaries_of_cgraph_node_set): New.
+ (ipa_read_summaries_1): New.
+ (ipa_read_summaries): New.
+ (execute_ipa_pass_list): Call cgraph_process_new_functions.
+ (execute_regular_ipa_pass_list): Remove.
+ (init_optimization_passes): Schedule
+ pass_rebuild_cgraph_edges and pass_early_inline outside
+ of pass_all_early_optimizations. Document reason.
+ (pass_ipa_lto_gimple_out, pass_ipa_lto_wpa_fixup,
+ pass_ipa_lto_finish_out): New pass.
+ (pass_ipa_summary_passes): Start and stop timers if the pass has them.
+ (execute_all_ipa_transforms): New.
+ (execute_one_pass): Don't call execute_one_ipa_transform_pass.
+ (dump_properties, debug_properties): New.
+ * tree-optimize.c (gate_all_early_local_passes): Return
+ false if we are in lto1.
+ (tree_rest_of_compilation): Call execute_all_ipa_transforms.
+ * tree-pass.h (execute_all_ipa_transforms): Declare.
+ (pass_ipa_function_and_variable_visibility): Declare.
+ (pass_ipa_early_inline): Declare.
+ (pass_ipa_lto_gimple_out): Declare.
+ (pass_ipa_lto_wpa_fixup): Declare.
+ (pass_ipa_lto_finish_out): Declare.
+ (all_small_ipa_passes, all_regular_ipa_passes,
+ all_lto_gen_passes): Declare.
+ (execute_ipa_summary_passes): Declare.
+ (execute_all_ipa_transforms): Declare.
+ (ipa_write_summaries): Declare
+ (ipa_write_summaries_of_cgraph_node_set): Declare.
+ (ipa_read_summaries): Declare.
+
+2009-10-03 Doug Kwan <dougkwan@google.com>
+ Ollie Wild <aaw@google.com>
+
+ * ipa-prop.c (ipa_propagate_indirect_call_infos): Do nothing in WPA.
+
+ * collect2.c (LTO_MODE_NONE, LTO_MODE_LTO, LTO_MODE_WPA): New enums.
+ (lto_mode): New variable.
+ (maybe_run_lto_and_relink): Handle the -fwpa option.
+ (main): Handle the -fwpa option.
+ (maybe_unlink_list): New function.
+ * gcc.c (link_lto_options): Replace -flto with -fwpa.
+ * common.opt (flto): New flag.
+ * toplev.c (flag_generate_lto): Declare.
+
+2009-10-03 Simon Baldwin <simonb@google.com>
+
+ * common.opt (flto-compression-level): New flag.
+
+ * opts.c: Include lto-opts.h.
+ (handle_option): Call lto_register_user_option for each
+ valid option handled.
+ (decode_options): Clear registered options before the options
+ handling loop.
+
+2009-10-03 Cary Coutant <ccoutant@google.com>
+
+ * collect2.c (is_elf): New function.
+ (scan_prog_file): Require LTO object to be in ELF format.
+
+2009-10-03 Rafael Espindola <espindola@google.com>
+
+ * gcc.c (LINK_COMMAND_SPEC): Use the -pass-through option to pass
+ libgcc to the linker.
+
+ * ipa-cp.c (cgraph_gate_cp): Return false if LTRANS is running.
+
+ * collect2.c (maybe_run_lto_and_relink): Execute lto-wrapper.
+ (collect_execute): Add flags argument. Pass flags to pex_run. Update
+ all callers.
+ * collect2.h (collect_execute): Add flags argument.
+ * tlink.c (tlink_execute): Update call to collect_execute.
+ * gcc.c (main): Set the COLLECT_LTO_WRAPPER environment variable.
+ (use_linker_plugin): New.
+ (use_linker_plugin_spec_function): New.
+ (LINK_COMMAND_SPEC): Pass plugin options to the linker.
+ (linker_plugin_file_spec): New.
+ (lto_wrapper_spec): New.
+ (lto_gcc_spec): New.
+ (static_specs): Add linker_plugin_file, lto_wrapper and lto_gcc.
+ (static_spec_functions): Add use-linker-plugin.
+ (process_command): Handle -use-linker-plugin.
+ (main): Use lto_wrapper_spec instead of lto_wrapper. Set
+ linker_plugin_file_spec and lto_gcc_spec.
+ (use_linker_plugin_spec_function): New.
+
+2009-10-03 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41547
+ PR lto/41548
+ * tree.h (is_lang_specific): Include LANG_TYPE.
+ * tree.c (find_decls_types_r): Manually add interesting parts
+ of TYPE_FIELDS. Walk BINFO_VIRTUALS. Do not walk TYPE_METHODS.
+
+ * gimple.c (type_pair_hash): Make symmetric.
+ (type_pair_eq): Likewise.
+ (lookup_type_pair): Increase initial hashtable size.
+ (gimple_force_type_merge): Rely on type-pair symmetry.
+ (visit): Remove excessive checking code.
+ (iterative_hash_type_name): Do not hash TYPE_NAME of anonymous unions.
+ (gimple_register_type): Remove getenv calls, shrink initial
+ hashtable size.
+
+ PR middle-end/41502
+ * cgraphunit.c (ipa_passes): Do not remove bodies of extern
+ inline functions if not generating lto output.
+
+ PR lto/41379
+ * toplev.c (finalize): In WPA mode remove the asm file.
+
+2009-10-03 Doug Kwan <dougkwan@google.com>
+
+ * ipa-inline.c (cgraph_mark_inline): Check
+ edge->call_stmt_cannot_inline_p instead of calling
+ gimple_call_cannot_inline_p.
+ (cgraph_decide_inlining): Do nothing in WPA and LTRANS.
+ (cgraph_gate_ipa_early_inlining): Return false if in_lto_p is set.
+ (inline_generate_summary): Do nothing in LTRANS.
+ * cgraph.c (initialize_inline_failed): Make sure e->call_stmt
+ exists before calling gimple_call_cannot_inline_p.
+ (cgraph_create_edge): Set edge->call_stmt_cannot_inline_p.
+ (cgraph_clone_edge): Add argument STMT_UID. Modify all callers.
+ Update new_edge->lto_stmt_uid.
+ * cgraphbuild.c (reset_inline_failed): New.
+
+ * common.opt (fwpa): New flag.
+ (fltrans): New option.
+ * gcc.c (gcc_lto_option_t): New type.
+ (current_lto_option): New variable.
+ (lto_single_spec_function): Remove and is replaced by ..
+ (lto_option_spec_function): New function.
+ (LINK_COMMAND_SPEC): Use link_lto_option spec instead of just
+ passing the -flto flag.
+ (cc1_options): Separate non-LTO related parts into ..
+ (cc1_non_lto_options): Non-LTO related options shared by all FEs.
+ (lto1_options): New spec for lto FE.
+ (link_lto_options): New spec for handling LTO flags in linker.
+ (invoke_lto_single): Re-format to fit in 80 column. Replace
+ lto-single with lto-option.
+ (static_specs): Add cc1_non_lto_options, lto1_options and
+ link_lto_options.
+ (static_spec_function): Replace lto-single with lto-option.
+ (process_command): Handle -flto, -fwpa and -fltran by setting
+ current_lto_option and not passing it to subprocess unconditionally.
+
+2009-10-03 Bill Maddox <maddox@google.com>
+
+ Add `gcc' driver support for link-time code generation (LTO).
+
+ * collect2.c (enum pass): Add new literal PASS_LTOINFO.
+ (lto_flag, lto_objects, lto_o_file): New variables.
+ (struct lto_object, struct lto_object_list): New structures.
+ (collect_exit, handler): Remove LTO temporary output file on exit.
+ (add_lto_object): New function.
+ (maybe_run_lto_and_relink): New function. Perform link time code
+ generation and relinking for object files containing LTO information.
+ (main): Invoke maybe_run_lto_and_relink().
+ (dump_argv): New function. For debugging, currently disabled.
+ (scan_prog_file): Add LTO information pass.
+ * gcc.c (LINK_COMMAND_SPEC): Pass `-flto' switch to linker, i.e.,
+ collect2.
+ * toplev.c (compile_file): Emit assembler directive to create
+ the `gnu_lto_v1' marker symbol when compiling with `-flto'.
+
+2009-10-03 Diego Novillo <dnovillo@google.com>
+
+ * c.opt: Add LTO to warn_abi and warn_psabi.
+
+ * tree.c (fld_worklist_push): Rename from PUSH. Convert to static
+ inline function. Ignore language-specific nodes. Update all users.
+ (find_decls_types_r): Do not traverse the subtrees of
+ language-specific nodes. Do not traverse DECL_INITIAL for TYPE_DECLs.
+ * tree.h (is_lang_specific): New.
+ * langhooks.h (struct lang_hooks_for_decls): Remove
+ may_need_assembler_name_p. Update all users.
+
+ * c-common.c (set_builtin_user_assembler_name): Move ...
+ * builtins.c (set_builtin_user_assembler_name): ... here.
+ (is_builtin_name): Add comment
+ (is_builtin_fn): New.
+ * except.c (output_ttype): Only call
+ lookup_type_for_runtime if TYPE is not a runtime type.
+
+ * passes.c (register_pass): Call position_pass on
+ all_small_ipa_passes, all_regular_ipa_passes and all_lto_gen_passes.
+ * timevar.def (TV_IPA_LTO_GIMPLE_IO): Define.
+ (TV_IPA_LTO_DECL_IO): Define.
+ (TV_IPA_LTO_CGRAPH_IO): Define.
+ (TV_LTO): Define.
+ (TV_WHOPR_WPA): Define.
+ (TV_WHOPR_WPA_IO): Define.
+ (TV_WHOPR_LTRANS): Define.
+ (TV_WHOPR_WPA_FIXUP): Define.
+ (TV_WHOPR_WPA_LTRANS_EXEC): Define.
+ * tree-cfg.c (tree_node_can_be_shared): Make extern.
+ * tree-flow.h (tree_node_can_be_shared): Declare.
+ * tree-inline.c (tree_can_inline_p): Check that E has a
+ statement associated with it.
+ * tree.c (free_lang_data_in_binf): Factor out of ...
+ (free_lang_data_in_type): ... here.
+ Call RECORD_OR_UNION_TYPE_P.
+ (need_assembler_name_p): Ignore DECL if it does not have TREE_PUBLIC
+ set. Call lang_hooks.decls.may_need_assembler_name_p if set.
+ (free_lang_data_in_decl): Do not clear DECL_CONTEXT for CONST_DECLs.
+ (free_lang_data): Set debug_info_level to DINFO_LEVEL_NONE. Set
+ write_symbols to NO_DEBUG. Set debug_hooks to do_nothing_debug_hooks.
+ (gate_free_lang_data): Return true if flag_generate_lto is set.
+ (walk_tree_1): Call RECORD_OR_UNION_TYPE_P.
+ * c-common.h (set_builtin_user_assembler_name): Move ...
+ * tree.h (set_builtin_user_assembler_name): ... here.
+
+ * common.opt (flto-report): New flag.
+ * opts.c (complain_wrong_lang): Do not complain if running lto1.
+ * collect2.c (scan_prog_file): Send the error output of
+ 'nm' to HOST_BIT_BUCKET.
+
+2009-10-03 Ollie Wild <aaw@google.com>
+
+ * langhooks-def.h (lhd_begin_section): New function declaration.
+ (lhd_write_section): New function declaration.
+ (lhd_end_section): New function declaration.
+ (LANG_HOOKS_BEGIN_SECTION): New macro.
+ (LANG_HOOKS_WRITE_SECTION_DATA): New macro.
+ (LANG_HOOKS_END_SECTION): New macro.
+ (LANG_HOOKS_LTO): New macro.
+ (LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_LTO.
+ * langhooks.c (output.h): Add include.
+ (saved_section): New static variable.
+ (lhd_begin_section): New function.
+ (lhd_write_section_data): New function.
+ (lhd_end_section): New function.
+ * langhooks.h (struct lang_hooks_for_lto): New structure.
+ (struct lang_hooks): Add member lto.
+ * Makefile.in (langhooks.o): Add dependency on output.h.
+
+ * c-opts.c (c_common_post_options): Handle -flto and -fwhopr.
+
+2009-10-03 Richard Guenther <rguenther@suse.de>
+
+ * config/rs6000/rs6000.c (rs6000_output_function_epilogue):
+ Handle LTO.
+
+2009-10-03 Simon Baldwin <simonb@google.com>
+ Richard Guenther <rguenther@suse.de>
+ Janis Johnson <janis187@us.ibm.com>
+ Doug Kwan <dougkwan@google.com>
+ Diego Novillo <dnovillo@google.com>
+ Ramana Radhakrishnan <ramana.r@gmail.com>
+ Ollie Wild <aaw@google.com>
+
+ * doc/install.texi: Add documentation for libelf and --enable-lto.
+ * doc/invoke.texi: Document -fwpa, -flto, -fwhopr, -fltrans,
+ -flto-report, -flto-compression-level and -use-linker-plugin.
+ * doc/sourcebuild.texi: Document use of zlib. Document lto-plugin.
+ Add section for LTO Testing.
+
2009-10-02 Cary Coutant <ccoutant@google.com>
- Add support for comdat type sections for DWARF v4. Merge from dwarf4
- branch.
+ Add support for comdat type sections for DWARF v4.
+ Merge from dwarf4 branch.
+
* dwarf2out.c (DWARF_TYPE_SIGNATURE_SIZE): New constant.
(dw_die_ref): Define vector type.
(enum dw_val_class): Add dw_val_class_data8.
@@ -21,8 +3907,7 @@
(print_signature): New function.
(print_die): Print signature information; add dw_val_class_data8.
(attr_checksum): Support dw_val_class_data8.
- (CHECKSUM_STRING): Redefine for DWARF-4 to include
- trailing NULL byte.
+ (CHECKSUM_STRING): Redefine for DWARF-4 to include trailing NULL byte.
(CHECKSUM_SLEB128, CHECKSUM_ULEB128): New macros.
(checksum_sleb128, checksum_uleb128): New functions.
(checksum_die_context): New function.
@@ -54,7 +3939,7 @@
(copy_decls_for_unworthy_types): New function.
(build_abbrev_table): Don't assert on missing die_symbol when doing
comdat type sections.
- (size_of_die): Use DW_FORM_sig8 for external references; Add
+ (size_of_die): Use DW_FORM_sig8 for external references. Add
dw_val_class_data8.
(unmark_dies): Don't assert for unmarked dies when doing comdat
type sections.
@@ -85,27 +3970,28 @@
2009-10-02 Neil Vachharajani <nvachhar@google.com>
- * gcov-io.c (gcov_open): Open files read-only when MODE < 0
+ * gcov-io.c (gcov_open): Open files read-only when MODE < 0.
2009-10-02 Uros Bizjak <ubizjak@gmail.com>
- * config/i386/i386.md (divmod<mode>4) Macroize expander from
- divmoddi4, divmodsi4 and divmodhi4 patterns using SWI248 macro.
+ * config/i386/i386.md (SWIM248): New mode iterator.
+ (divmod<mode>4) Macroize expander from divmoddi4, divmodsi4 and
+ divmodhi4 patterns using SWIM248 macro.
(*divmod<mode>4): Macroize insn_and_split pattern from
*divmoddi4_cltd_rex64, *divmodsi4_cltd and divmodhi4 insn patterns
- and their corresponding splitters usign SWI248 macro. Split SImode
+ and their corresponding splitters usign SWIM248 macro. Split SImode
insn to generate cltd and DImode insn to generate cqto instead of
move+shift when optimizing for size or TARGET_USE_CLTD is in effect.
(*divmoddi4_nocltd_rex64, *divmodsi4_nocltd): Remove insn patterns.
(*divmod<mode>4_noext): Macroize insn from *divmoddi_noext_rex64 and
- *divmodsi_noext patterns using SWI248 macro.
+ *divmodsi_noext patterns using SWIM248 macro.
(udivmod<mode>4): Macroize expander from udivmoddi4, udivmodsi4 and
- udivmodhi4 patterns using SWI248 macro.
+ udivmodhi4 patterns using SWIM248 macro.
(*udivmod<mode>4): Macroize insn_and_split pattern from
*udivmoddi4, udivmodsi4 and udivmodhi4 patterns and their
- corresponding splitters using SWI248 macro.
+ corresponding splitters using SWIM248 macro.
(*udivmod<mode>4_noext): Macroize insn from *udivmoddi4_noext,
- *udivmodsi4_noext and *udivmodhi_noext patterns using SWI248 macro.
+ *udivmodsi4_noext and *udivmodhi_noext patterns using SWIM248 macro.
2009-10-02 Eric Botcazou <ebotcazou@adacore.com>
@@ -127,8 +4013,8 @@
PR debug/41404
PR debug/41353
* cfgexpand.c (expand_debug_expr) <case STRING_CST>: Don't create
- CONST_STRING if STRING_CST contains embedded '\0's or doesn't end with
- '\0'.
+ CONST_STRING if STRING_CST contains embedded '\0's or doesn't end
+ with '\0'.
(expand_debug_expr) <case VAR_DECL>: For TREE_STATIC !DECL_EXTERNAL
vars use DECL_RTL with resetting it back to NULL afterwards.
* dwarf2out.c (same_dw_val_p): For dw_val_class_addr compare with
@@ -394,7 +4280,7 @@
pressure.
2009-09-29 Basile Starynkevitch <basile@starynkevitch.net>
- Rafael Avila de Espindola <espindola@google.com>
+ Rafael Avila de Espindola <espindola@google.com>
* gengtype.c (plugin_output): New.
(get_output_file_with_visibility): Return plugin_output for plugins.
@@ -419,7 +4305,7 @@
(x86_64-*-*): Ditto.
* config/i386/smmintrin.h: Move instructions in mmintrin-common.h
back to smmintrin.h.
- * config/i386/cpuid.h: (bit_SSE5): Remove SSE5 bit.
+ * config/i386/cpuid.h (bit_SSE5): Remove SSE5 bit.
* config/i386/x86intrin.h: Remove SSE5.
* config/i386/mmintrin-common.h: Delete file.
* doc/extend.texi (x86 intrinsics): Remove SSE5 flags and builtins.
@@ -548,8 +4434,7 @@
2009-09-28 Nick Clifton <nickc@redhat.com>
- * config/m32r/m32r.c (m32r_is_insn): Return false for debugging
- insns.
+ * config/m32r/m32r.c (m32r_is_insn): Return false for debugging insns.
2009-09-28 Duncan Sands <baldrick@free.fr>
@@ -618,7 +4503,7 @@
2009-09-27 Peter O'Gorman <pogma@thewrittenword.com>
- collect2.c (main): Look for -brtl before adding libraries.
+ * collect2.c (main): Look for -brtl before adding libraries.
2009-09-27 Jonathan Gray <jsg@openbsd.org>
@@ -698,9 +4583,10 @@
* dwarf2out.c (dwarf_tag_name, gen_generic_params_dies,
generic_parameter_die, template_parameter_pack_die,
- gen_formal_parameter_die, gen_subprogram_die): Adjust after renaming
- DW_TAG_formal_parameter_pack and DW_TAG_template_parameter_pack into
- DW_TAG_GNU_formal_parameter_pack and DW_TAG_GNU_template_parameter_pack.
+ gen_formal_parameter_die, gen_subprogram_die): Adjust after
+ renaming DW_TAG_formal_parameter_pack and
+ DW_TAG_template_parameter_pack into DW_TAG_GNU_formal_parameter_pack
+ and DW_TAG_GNU_template_parameter_pack.
2009-09-25 Anatoly Sokolov <aesok@post.ru>
@@ -748,9 +4634,7 @@
(reg_class): Likewise.
(REG_CLASS_NAMES): Likewise.
* config/m32c/m32c.c (m32c_reg_class_from_constraint): Likewise.
-
- * config/m32c/m32c.c (m32c_override_options): Disable -fivopts for
- M32C.
+ (m32c_override_options): Disable -fivopts for M32C.
2009-09-24 Michael Meissner <meissner@linux.vnet.ibm.com>
@@ -871,7 +4755,8 @@
* config/xtensa/xtensa.c (TARGET_STATIC_CHAIN): New.
(xtensa_static_chain): New.
- * config/xtensa/xtensa.h (STATIC_CHAIN, STATIC_CHAIN_INCOMING): Remove.
+ * config/xtensa/xtensa.h (STATIC_CHAIN): Remove.
+ (STATIC_CHAIN_INCOMING): Remove.
2009-09-23 Anatoly Sokolov <aesok@post.ru>
@@ -6488,7 +10373,7 @@
(function_value): Adjust for above modification.
(alpha_va_start) <TARGET_ABI_OPEN_VMS>: Use
virtual_incoming_args_rtx as base object, not next_arg.
- * config/alpha/vms.h: (DEFAULT_PCC_STRUCT_RETURN): Define as 0.
+ * config/alpha/vms.h (DEFAULT_PCC_STRUCT_RETURN): Define as 0.
2009-08-11 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
@@ -6581,7 +10466,7 @@
* config/alpha/vms.h (ASM_OUTPUT_EXTERNAL): Define.
(DO_CRTL_NAMES): Define.
(LIB_SPEC): Remove.
- * config/alpha/vms64.h: (POINTERS_EXTEND_UNSIGNED): Remove undef.
+ * config/alpha/vms64.h (POINTERS_EXTEND_UNSIGNED): Remove undef.
(LONG_TYPE_SIZE): Define.
(TARGET_OS_CPP_BUILTINS): Define with __LONG_POINTERS=1
(SUBTARGET_SWITCHES): Define malloc64 switch.
@@ -6974,11 +10859,6 @@
* calls.c (emit_library_call_value_1): Update call to
hard_libcall_value.
* explow.c (hard_libcall_value): Use new target hook.
- * testsuite/lib/target-supports.exp
- (check_effective_target_arm_hard_vfp_ok): New hook.
- (check_effective_target_arm_neon_ok): Improve test for neon
- availability.
- * testsuite/gcc.target/arm/eabi1.c: Only run test in base variant.
* config/arm/arm.c: Include cgraph.h
(TARGET_FUNCTION_VALUE): Override default hook.
(arm_pcs_default): New variable.
@@ -8473,7 +12353,7 @@
combined_args_to_skip and args_to_skip.
* tree-inline.c (update_clone_info): New function.
(tree_function_versioning): Call update_clone_info.
- * cgraphunit.c: (cgraph_materialize_clone): Dump materialized
+ * cgraphunit.c (cgraph_materialize_clone): Dump materialized
functions.
(cgraph_materialize_all_clones): More extensive dumping, working
with combined_args_to_skip rather than args_to_skip.
@@ -8803,7 +12683,7 @@
* doc/sourcebuild.texi: Document install-plugin target.
* configure.ac: Added install-plugin target to language makefiles.
* configure: Regenerate.
- * Makefile.in: (install-plugin): Install more headers,
+ * Makefile.in (install-plugin): Install more headers,
depend on lang.install-plugin.
2009-07-15 Manuel López-Ibáñez <manu@gcc.gnu.org>
@@ -9132,7 +13012,7 @@
2009-07-08 DJ Delorie <dj@redhat.com>
- * config/mep/mep.c: (mep_option_can_inline_p): New.
+ * config/mep/mep.c (mep_option_can_inline_p): New.
(TARGET_OPTION_CAN_INLINE_P): Define.
2009-07-08 Mark Wielaard <mjw@redhat.com>
@@ -11356,10 +15236,10 @@
(LARGEST_EXPONENT_IS_NORMAL): Define.
* config/arm/arm-protos.h (arm_emit_fp16_const): Declare.
* config/arm/arm-modes.def (HFmode): Define.
- * config/arm/vfp.md: (*movhf_vfp): New.
+ * config/arm/vfp.md (*movhf_vfp): New.
(extendhfsf2): New.
(truncsfhf2): New.
- * config/arm/arm.md: (fpu): Add neon_fp16.
+ * config/arm/arm.md (fpu): Add neon_fp16.
(floatsihf2, floatdihf2): New.
(fix_trunchfsi2, fix_trunchfdi2): New.
(truncdfhf2): New.
@@ -12073,7 +15953,7 @@
(c_parser_expr_list): Same.
(c_parser_omp_atomic): Same.
(c_parser_omp_for_loop): Same.
- * c-tree.h: (struct c_declarator): Add comment to id_loc.
+ * c-tree.h (struct c_declarator): Add comment to id_loc.
(build_array_declarator): New argument.
* c-decl.c (build_array_declarator): Add location argument.
(grokdeclarator): Set id_loc for cdk_array.
@@ -12084,7 +15964,6 @@
(OMP_CLAUSE_LOCATION): New macro.
(struct tree_omp_clause): Add location field.
(build_omp_clause): Add argument.
- * testsuite/gcc.dg/gomp/for-1.c: Fix column.
* cp/pt.c (tsubst_omp_for_iterator): Pass location to
build_omp_clause.
* cp/parser.c (cp_parser_omp_var_list_no_open): Same.
@@ -14789,7 +18668,7 @@
* hooks.h (hook_tree_const_tree_null): Declare.
* target.h (struct gcc_target): Add invalid_parameter_type,
invalid_return_type, promoted_type, and convert_to_type fields.
- * target-def.h: (TARGET_INVALID_PARAMETER_TYPE): Define.
+ * target-def.h (TARGET_INVALID_PARAMETER_TYPE): Define.
(TARGET_INVALID_RETURN_TYPE): Define.
(TARGET_PROMOTED_TYPE): Define.
(TARGET_CONVERT_TO_TYPE): Define.
@@ -17206,7 +21085,7 @@
2009-05-04 Michael Eager <eager@eagercon.com>
- * gcc/config.gcc: (powerpc-xilinx-eabi*): Add tm t-xilinx
+ * gcc/config.gcc (powerpc-xilinx-eabi*): Add tm t-xilinx
* config/rs6000/t-xilinx: New
2009-05-04 Paolo Bonzini <bonzini@gnu.org>
@@ -18234,7 +22113,7 @@
* ssaexpand.h (struct ssaexpand): Member 'values' is a bitmap.
(get_gimple_for_ssa_name): Adjust, lookup using SSA_NAME_DEF_STMT.
- * tree-ssa-live.h: (find_replaceable_exprs): Return a bitmap.
+ * tree-ssa-live.h (find_replaceable_exprs): Return a bitmap.
(dump_replaceable_exprs): Take a bitmap.
* cfgexpand.c (gimple_cond_pred_to_tree): Handle bitmap instead of
array.
@@ -19238,7 +23117,7 @@
* cfghooks.c (tidy_fallthru_edges): Remove find_basic_blocks
references from comments.
- * cfgbuild.c: (count_basic_blocks): Delete.
+ * cfgbuild.c (count_basic_blocks): Delete.
(find_basic_blocks_1): Delete.
(find_basic_blocks): Delete.
* except.c (finish_eh_generation): Make static. Move comment from
@@ -22477,7 +26356,7 @@
* config/vax/builtins.md (jbbssiqi, jbbssihi, jbbssisi, jbbcciqi,
jbbccihi, jbbccisi): Remova trailing whitespace.
* config/vax/constraints.md: Likewise.
- * config/vax/elf.h: (ASM_PREFERRED_EH_DATA_FORMAT): Likewise.
+ * config/vax/elf.h (ASM_PREFERRED_EH_DATA_FORMAT): Likewise.
* config/vax/openbsd1.h (OBSD_OLD_GAS): Likewise.
* config/vax/predicates.md: Likewise.
* config/vax/vax.c (print_operand_address, vax_output_int_move,
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index c090cdcd4e2..459615d7a95 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20091002
+20091106
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 40fe3ba80fd..f66f9ef0bf4 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -309,6 +309,13 @@ PPLINC = @PPLINC@
CLOOGLIBS = @CLOOGLIBS@
CLOOGINC = @CLOOGINC@
+# How to find libelf
+LIBELFLIBS = @LIBELFLIBS@
+LIBELFINC = @LIBELFINC@
+
+# Set to 'yes' if the LTO front end is enabled.
+enable_lto = @enable_lto@
+
# Libs and linker option needed for plugin support
PLUGINLIBS = @pluginlibs@
@@ -407,6 +414,10 @@ PARTITION_H = $(srcdir)/../include/partition.h
MD5_H = $(srcdir)/../include/md5.h
DWARF2_H = $(srcdir)/../include/dwarf2.h
+# Linker plugin API headers
+LINKER_PLUGIN_API_H = $(srcdir)/../include/plugin-api.h
+LTO_SYMTAB_H = $(srcdir)/../include/lto-symtab.h
+
# Default native SYSTEM_HEADER_DIR, to be overridden by targets.
NATIVE_SYSTEM_HEADER_DIR = /usr/include
# Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
@@ -917,6 +928,9 @@ REAL_H = real.h $(MACHMODE_H)
IRA_INT_H = ira.h ira-int.h $(CFGLOOP_H) alloc-pool.h
DBGCNT_H = dbgcnt.h dbgcnt.def
EBITMAP_H = ebitmap.h sbitmap.h
+LTO_STREAMER_H = lto-streamer.h $(LINKER_PLUGIN_API_H) $(TARGET_H) \
+ $(CGRAPH_H) vec.h vecprim.h $(TREE_H) $(GIMPLE_H)
+TREE_VECTORIZER_H = tree-vectorizer.h $(TREE_DATA_REF_H)
IPA_PROP_H = ipa-prop.h $(TREE_H) vec.h $(CGRAPH_H)
GSTAB_H = gstab.h stab.def
BITMAP_H = bitmap.h $(HASHTAB_H) statistics.h
@@ -976,7 +990,8 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
# and the system's installed libraries.
LIBS = @LIBS@ $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) $(LIBDECNUMBER) \
$(HOST_LIBS)
-BACKENDLIBS = $(CLOOGLIBS) $(PPLLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS)
+BACKENDLIBS = $(CLOOGLIBS) $(PPLLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \
+ $(ZLIB) $(LIBELFLIBS)
# Any system libraries needed just for GNAT.
SYSLIBS = @GNAT_LIBEXC@
@@ -1005,7 +1020,7 @@ BUILD_ERRORS = build/errors.o
INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
-I$(srcdir)/../include @INCINTL@ \
$(CPPINC) $(GMPINC) $(DECNUMINC) \
- $(PPLINC) $(CLOOGINC)
+ $(PPLINC) $(CLOOGINC) $(LIBELFINC)
.c.o:
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $< $(OUTPUT_OPTION)
@@ -1215,6 +1230,16 @@ OBJS-common = \
loop-unroll.o \
loop-unswitch.o \
lower-subreg.o \
+ lto-cgraph.o \
+ lto-streamer-in.o \
+ lto-streamer-out.o \
+ lto-section-in.o \
+ lto-section-out.o \
+ lto-symtab.o \
+ lto-opts.o \
+ lto-streamer.o \
+ lto-wpa-fixup.o \
+ lto-compress.o \
mcf.o \
mode-switching.o \
modulo-sched.o \
@@ -1411,7 +1436,7 @@ MOSTLYCLEANFILES = insn-flags.h insn-config.h insn-codes.h \
genrtl.c genrtl.h gt-*.h gtype-*.h gtype-desc.c gtyp-input.list \
xgcc$(exeext) cpp$(exeext) cc1$(exeext) cc1*-dummy$(exeext) $(EXTRA_PASSES) \
$(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) \
- $(SPECS) collect2$(exeext) \
+ $(SPECS) collect2$(exeext) lto-wrapper$(exeext) \
gcov-iov$(build_exeext) gcov$(exeext) gcov-dump$(exeext) \
*.[0-9][0-9].* *.[si] *-checksum.c libbackend.a libgcc.mk
@@ -1692,7 +1717,7 @@ rest.encap: lang.rest.encap
# This is what is made with the host's compiler
# whether making a cross compiler or not.
native: config.status auto-host.h build-@POSUB@ $(LANGUAGES) \
- $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(COLLECT2)
+ $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(COLLECT2) lto-wrapper$(exeext)
# Define the names for selecting languages in LANGUAGES.
c: cc1$(exeext)
@@ -1957,7 +1982,7 @@ c-convert.o : c-convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
c-pragma.o: c-pragma.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FUNCTION_H) $(C_PRAGMA_H) $(TOPLEV_H) output.h $(GGC_H) $(TM_P_H) \
$(C_COMMON_H) $(TARGET_H) gt-c-pragma.h $(CPPLIB_H) $(FLAGS_H) $(DIAGNOSTIC_H) \
- opts.h
+ opts.h $(PLUGINS_H)
graph.o: graph.c $(SYSTEM_H) coretypes.h $(TM_H) $(TOPLEV_H) $(FLAGS_H) output.h \
$(RTL_H) $(FUNCTION_H) hard-reg-set.h $(BASIC_BLOCK_H) graph.h $(OBSTACK_H) \
$(CONFIG_H)
@@ -1987,6 +2012,12 @@ collect2-aix.o : collect2-aix.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
tlink.o: tlink.c $(DEMANGLE_H) $(HASHTAB_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(OBSTACK_H) collect2.h intl.h
+lto-wrapper$(exeext): lto-wrapper.o intl.o $(LIBDEPS)
+ $(COMPILER) $(ALL_COMPILERFLAGS) $(LDFLAGS) -o T$@ lto-wrapper.o intl.o $(LIBS)
+ mv -f T$@ $@
+
+lto-wrapper.o: lto-wrapper.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) intl.h
+
# A file used by all variants of C.
c-common.o : c-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
@@ -2158,17 +2189,61 @@ convert.o: convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
double-int.o: double-int.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H)
+# lto-compress.o needs $(ZLIBINC) added to the include flags.
+lto-compress.o: lto-compress.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TREE_H) langhooks.h $(LTO_HEADER_H) $(LTO_SECTION_H) \
+ lto-compress.h $(DIAGNOSTIC_H) errors.h
+ $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(ZLIBINC) $< $(OUTPUT_OPTION)
+
+lto-cgraph.o: lto-cgraph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) $(TOPLEV_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) input.h \
+ $(VARRAY_H) $(HASHTAB_H) langhooks.h $(BASIC_BLOCK_H) \
+ $(TREE_FLOW_H) $(CGRAPH_H) $(FUNCTION_H) $(GGC_H) $(DIAGNOSTIC_H) \
+ except.h $(TIMEVAR_H) output.h pointer-set.h $(LTO_STREAMER_H)
+lto-streamer-in.o: lto-streamer-in.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) $(TOPLEV_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) input.h $(VARRAY_H) \
+ $(HASHTAB_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) $(TREE_PASS_H) $(CGRAPH_H) \
+ $(FUNCTION_H) $(GGC_H) $(DIAGNOSTIC_H) libfuncs.h $(EXCEPT_H) debug.h \
+ $(TIMEVAR_H) output.h $(IPA_UTILS_H) $(LTO_STREAMER_H)
+lto-streamer-out.o : lto-streamer-out.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) $(TOPLEV_H) $(TREE_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) input.h \
+ $(VARRAY_H) $(HASHTAB_H) $(BASIC_BLOCK_H) tree-iterator.h \
+ $(TREE_FLOW_H) $(TREE_PASS_H) $(CGRAPH_H) $(FUNCTION_H) $(GGC_H) \
+ $(DIAGNOSTIC_H) except.h $(LTO_STREAMER_H) errors.h
+lto-section-in.o: lto-section-in.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(TOPLEV_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) input.h $(VARRAY_H) \
+ $(HASHTAB_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) $(CGRAPH_H) $(FUNCTION_H) \
+ $(GGC_H) $(DIAGNOSTIC_H) except.h $(TIMEVAR_H) output.h \
+ $(LTO_STREAMER_H) lto-compress.h
+lto-section-out.o : lto-section-out.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) $(TOPLEV_H) $(TREE_H) $(EXPR_H) $(PARAMS_H) input.h \
+ $(VARRAY_H) $(HASHTAB_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) $(TREE_PASS_H) \
+ $(CGRAPH_H) $(FUNCTION_H) $(GGC_H) except.h pointer-set.h \
+ $(BITMAP_H) langhooks.h $(LTO_STREAMER_H) lto-compress.h
+lto-symtab.o: lto-symtab.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ toplev.h $(TREE_H) $(GIMPLE_H) $(GGC_H) $(LAMBDA_H) $(HASHTAB_H) \
+ $(LTO_STREAMER_H) $(LINKER_PLUGIN_API_H) gt-lto-symtab.h
+lto-opts.o: lto-opts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \
+ $(HASHTAB_H) $(GGC_H) $(BITMAP_H) $(FLAGS_H) opts.h options.h \
+ $(TARGET_H) $(TOPLEV_H) $(LTO_STREAMER_H)
+lto-streamer.o: lto-streamer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) $(TREE_H) $(GIMPLE_H) $(BITMAP_H) $(LTO_STREAMER_H) $(FLAGS_H) \
+ $(TREE_FLOW_H) $(DIAGNOSTIC_H) $(LTO_SYMTAB_H) $(TOPLEV_H)
+lto-wpa-fixup.o: lto-wpa-fixup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) $(TOPLEV_H) $(TREE_H) $(EXPR_H) $(FLAGS_H) $(CGRAPH_H) \
+ $(FUNCTION_H) $(DIAGNOSTIC_H) $(BITMAP_H) $(TIMEVAR_H) \
+ $(TREE_FLOW_H) $(TREE_PASS_H) $(LTO_STREAMER_H)
langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(TOPLEV_H) $(TREE_INLINE_H) $(RTL_H) insn-config.h $(INTEGRATE_H) \
langhooks.h $(TARGET_H) $(LANGHOOKS_DEF_H) $(FLAGS_H) $(GGC_H) $(DIAGNOSTIC_H) \
- intl.h $(GIMPLE_H) $(CGRAPH_H)
+ intl.h $(GIMPLE_H) $(CGRAPH_H) output.h
tree.o : tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
all-tree.def $(FLAGS_H) $(FUNCTION_H) $(PARAMS_H) \
$(TOPLEV_H) $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) \
langhooks.h $(REAL_H) gt-tree.h $(TREE_INLINE_H) tree-iterator.h \
$(BASIC_BLOCK_H) $(TREE_FLOW_H) $(OBSTACK_H) pointer-set.h fixed-value.h \
tree-pass.h $(LANGHOOKS_DEF_H) $(DIAGNOSTIC_H) $(CGRAPH_H) $(TIMEVAR_H) \
- $(EXCEPT_H) debug.h
+ $(EXCEPT_H) debug.h intl.h
tree-dump.o: tree-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) langhooks.h $(TOPLEV_H) $(SPLAY_TREE_H) $(TREE_DUMP_H) \
tree-iterator.h $(TREE_PASS_H) $(DIAGNOSTIC_H) $(REAL_H) fixed-value.h
@@ -2357,7 +2432,7 @@ tree-ssa-address.o : tree-ssa-address.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) \
output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
$(TREE_PASS_H) $(FLAGS_H) $(TREE_INLINE_H) $(RECOG_H) insn-config.h \
- $(EXPR_H) gt-tree-ssa-address.h $(GGC_H) tree-affine.h
+ $(EXPR_H) gt-tree-ssa-address.h $(GGC_H) tree-affine.h $(TARGET_H)
tree-ssa-loop-niter.o : tree-ssa-loop-niter.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) $(PARAMS_H) \
$(TREE_INLINE_H) output.h $(DIAGNOSTIC_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
@@ -2572,7 +2647,8 @@ tree-object-size.o: tree-object-size.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TREE_PASS_H) tree-ssa-propagate.h
gimple.o : gimple.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \
$(GGC_H) $(GIMPLE_H) $(TOPLEV_H) $(DIAGNOSTIC_H) gt-gimple.h \
- $(TREE_FLOW_H) value-prof.h $(FLAGS_H) $(DEMANGLE_H)
+ $(TREE_FLOW_H) value-prof.h $(FLAGS_H) $(DEMANGLE_H) \
+ $(TARGET_H) $(ALIAS_H)
gimple-pretty-print.o : gimple-pretty-print.c $(CONFIG_H) $(SYSTEM_H) \
$(TREE_H) $(DIAGNOSTIC_H) $(REAL_H) $(HASHTAB_H) $(TREE_FLOW_H) \
$(TM_H) coretypes.h $(TREE_PASS_H) $(GIMPLE_H) value-prof.h
@@ -2640,7 +2716,7 @@ passes.o : passes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
langhooks.h insn-flags.h $(CFGLAYOUT_H) $(REAL_H) $(CFGLOOP_H) \
hosthooks.h $(CGRAPH_H) $(COVERAGE_H) $(TREE_PASS_H) $(TREE_DUMP_H) \
$(GGC_H) $(INTEGRATE_H) $(CPPLIB_H) opts.h $(TREE_FLOW_H) $(TREE_INLINE_H) \
- gt-passes.h $(DF_H) $(PREDICT_H)
+ gt-passes.h $(DF_H) $(PREDICT_H) $(LTO_HEADER_H) $(LTO_SECTION_OUT_H)
plugin.o : plugin.c $(PLUGIN_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TOPLEV_H) $(TREE_H) $(TREE_PASS_H) intl.h $(PLUGIN_VERSION_H) $(GGC_H)
@@ -2669,7 +2745,8 @@ varasm.o : varasm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(RTL_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) hard-reg-set.h $(REGS_H) \
output.h $(TOPLEV_H) xcoffout.h debug.h $(GGC_H) $(TM_P_H) \
$(HASHTAB_H) $(TARGET_H) langhooks.h gt-varasm.h $(BASIC_BLOCK_H) \
- $(CFGLAYOUT_H) $(CGRAPH_H) targhooks.h tree-mudflap.h $(REAL_H) tree-iterator.h
+ $(CFGLAYOUT_H) $(CGRAPH_H) targhooks.h tree-mudflap.h $(REAL_H) \
+ tree-iterator.h
function.o : function.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(CFGLAYOUT_H) $(GIMPLE_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) \
$(OPTABS_H) libfuncs.h $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \
@@ -2747,7 +2824,7 @@ emit-rtl.o : emit-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) $(FUNCTION_H) $(REGS_H) insn-config.h $(RECOG_H) \
$(GGC_H) $(EXPR_H) hard-reg-set.h $(BITMAP_H) $(TOPLEV_H) $(BASIC_BLOCK_H) \
$(HASHTAB_H) $(TM_P_H) debug.h langhooks.h $(TREE_PASS_H) gt-emit-rtl.h \
- $(REAL_H) $(DF_H) $(PARAMS_H)
+ $(REAL_H) $(DF_H) $(PARAMS_H) $(TARGET_H)
real.o : real.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(TOPLEV_H) $(TM_P_H) $(REAL_H) dfp.h
dfp.o : dfp.c dfp.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
@@ -2771,7 +2848,8 @@ simplify-rtx.o : simplify-rtx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
cgraph.o : cgraph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
langhooks.h $(TOPLEV_H) $(FLAGS_H) $(GGC_H) $(TARGET_H) $(CGRAPH_H) \
gt-cgraph.h output.h intl.h $(BASIC_BLOCK_H) debug.h $(HASHTAB_H) \
- $(TREE_INLINE_H) $(TREE_DUMP_H) $(TREE_FLOW_H) value-prof.h $(EXCEPT_H)
+ $(TREE_INLINE_H) $(TREE_DUMP_H) $(TREE_FLOW_H) cif-code.def \
+ value-prof.h $(EXCEPT_H)
cgraphunit.o : cgraphunit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) langhooks.h $(TREE_INLINE_H) $(TOPLEV_H) $(FLAGS_H) $(GGC_H) \
$(TARGET_H) $(CGRAPH_H) intl.h pointer-set.h $(FUNCTION_H) $(GIMPLE_H) \
@@ -2813,12 +2891,13 @@ ipa-reference.o : ipa-reference.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \
pointer-set.h $(GGC_H) $(IPA_REFERENCE_H) $(IPA_UTILS_H) $(SPLAY_TREE_H) \
$(GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) $(TREE_PASS_H) \
- $(TIMEVAR_H) $(DIAGNOSTIC_H) $(FUNCTION_H) gt-ipa-reference.h
+ $(TIMEVAR_H) $(DIAGNOSTIC_H) $(FUNCTION_H) gt-ipa-reference.h \
+ $(LTO_STREAMER_H)
ipa-pure-const.o : ipa-pure-const.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \
pointer-set.h $(GGC_H) $(IPA_UTILS_H) $(TARGET_H) \
$(GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) $(TREE_PASS_H) $(TIMEVAR_H) \
- $(DIAGNOSTIC_H) $(CFGLOOP_H) $(SCEV_H)
+ $(DIAGNOSTIC_H) $(CFGLOOP_H) $(SCEV_H) $(LTO_STREAMER_H)
ipa-type-escape.o : ipa-type-escape.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \
pointer-set.h $(GGC_H) $(IPA_TYPE_ESCAPE_H) $(IPA_UTILS_H) $(SPLAY_TREE_H) \
@@ -2955,7 +3034,7 @@ alloc-pool.o : alloc-pool.c $(CONFIG_H) $(SYSTEM_H) alloc-pool.h $(HASHTAB_H)
auto-inc-dec.o : auto-inc-dec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(RTL_H) $(TM_P_H) hard-reg-set.h $(BASIC_BLOCK_H) insn-config.h \
$(REGS_H) $(FLAGS_H) output.h $(FUNCTION_H) $(EXCEPT_H) $(TOPLEV_H) $(RECOG_H) \
- $(EXPR_H) $(TIMEVAR_H) $(TREE_PASS_H) $(DF_H) $(DBGCNT_H)
+ $(EXPR_H) $(TIMEVAR_H) $(TREE_PASS_H) $(DF_H) $(DBGCNT_H) $(TARGET_H)
cfg.o : cfg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(FLAGS_H) \
$(REGS_H) hard-reg-set.h output.h $(TOPLEV_H) $(FUNCTION_H) $(EXCEPT_H) $(GGC_H) \
$(TM_P_H) $(TIMEVAR_H) $(OBSTACK_H) $(TREE_H) alloc-pool.h \
@@ -2997,9 +3076,9 @@ loop-iv.o : loop-iv.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(BASIC_BLOCK_H) \
hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) coretypes.h $(TM_H) $(OBSTACK_H) \
output.h intl.h $(TOPLEV_H) $(DF_H) $(HASHTAB_H)
loop-invariant.o : loop-invariant.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
- $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) $(RECOG_H) coretypes.h \
- $(TM_H) $(TM_P_H) $(FUNCTION_H) $(FLAGS_H) $(DF_H) $(OBSTACK_H) output.h \
- $(HASHTAB_H) $(EXCEPT_H) $(PARAMS_H)
+ $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) $(RECOG_H) \
+ coretypes.h $(TM_H) $(TM_P_H) $(FUNCTION_H) $(FLAGS_H) $(DF_H) \
+ $(OBSTACK_H) output.h $(HASHTAB_H) $(EXCEPT_H) $(PARAMS_H) $(REGS_H) ira.h
cfgloopmanip.o : cfgloopmanip.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
$(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) output.h \
coretypes.h $(TM_H) cfghooks.h $(OBSTACK_H) $(TREE_FLOW_H)
@@ -3113,7 +3192,7 @@ ira.o: ira.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
regmove.o : regmove.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
insn-config.h $(TIMEVAR_H) $(TREE_PASS_H) $(DF_H)\
$(RECOG_H) output.h $(REGS_H) hard-reg-set.h $(FLAGS_H) $(FUNCTION_H) \
- $(EXPR_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(TM_P_H) $(EXCEPT_H) reload.h
+ $(EXPR_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(TM_P_H) $(EXCEPT_H) ira.h reload.h
combine-stack-adj.o : combine-stack-adj.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) insn-config.h $(TIMEVAR_H) $(TREE_PASS_H) \
$(RECOG_H) output.h $(REGS_H) hard-reg-set.h $(FLAGS_H) $(FUNCTION_H) \
@@ -3136,7 +3215,7 @@ haifa-sched.o : haifa-sched.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_
sched-deps.o : sched-deps.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \
$(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) $(EXCEPT_H) cselib.h \
- ira.h $(PARAMS_H) $(TM_P_H) ira.h
+ ira.h $(PARAMS_H) $(TM_P_H) ira.h $(TARGET_H)
sched-rgn.o : sched-rgn.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \
$(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) $(EXCEPT_H) $(PARAMS_H) \
@@ -3504,7 +3583,9 @@ GTFILES = $(CPP_ID_DATA_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
$(srcdir)/tree-phinodes.c \
$(srcdir)/ipa-reference.c \
$(srcdir)/tree-ssa-structalias.c \
+ $(srcdir)/lto-symtab.c \
$(srcdir)/tree-ssa-alias.h \
+ $(srcdir)/ipa-prop.h \
@all_gtfiles@
# Compute the list of GT header files from the corresponding C sources,
@@ -4145,7 +4226,7 @@ maintainer-clean:
# broken is small.
install: install-common $(INSTALL_HEADERS) \
install-cpp install-man install-info install-@POSUB@ \
- install-driver
+ install-driver install-lto-wrapper
ifeq ($(enable_plugin),yes)
install: install-plugin
@@ -4179,7 +4260,8 @@ PLUGIN_HEADERS = $(TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(host_xm_file_list) $(host_xm_include_list) $(xm_include_list) \
intl.h $(PLUGIN_VERSION_H) $(DIAGNOSTIC_H) $(C_COMMON_H) $(C_PRETTY_PRINT_H) \
tree-iterator.h $(PLUGIN_H) $(TREE_FLOW_H) langhooks.h incpath.h \
- tree-ssa-sccvn.h real.h
+ tree-ssa-sccvn.h real.h output.h $(IPA_UTILS_H) \
+ $(C_PRAGMA_H) $(CPPLIB_H) $(FUNCTION_H)
# Install the headers needed to build a plugin.
install-plugin: installdirs lang.install-plugin
@@ -4440,6 +4522,10 @@ install-collect2: collect2 installdirs
# Install the driver program as $(libsubdir)/gcc for collect2.
$(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(libexecsubdir)/gcc$(exeext)
+# Install lto-wrapper.
+install-lto-wrapper: lto-wrapper$(exeext)
+ $(INSTALL_PROGRAM) lto-wrapper$(exeext) $(DESTDIR)$(libexecsubdir)/lto-wrapper$(exeext)
+
# Cancel installation by deleting the installed files.
uninstall: lang.uninstall
-rm -rf $(DESTDIR)$(libsubdir)
@@ -4491,6 +4577,9 @@ site.exp: ./config.status Makefile
echo "set ENABLE_PLUGIN 1" >> ./tmp0; \
echo "set GMPINC \"$(GMPINC)\"" >> ./tmp0; \
fi
+ @if test "@enable_lto@" = "yes" ; then \
+ echo "set ENABLE_LTO 1" >> ./tmp0; \
+ fi
# If newlib has been configured, we need to pass -B to gcc so it can find
# newlib's crt0.o if it exists. This will cause a "path prefix not used"
# message if it doesn't, but the testsuite is supposed to ignore the message -
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 6520a7f4681..8c98429a2f3 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,478 @@
+2009-11-05 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/utils.c (gnat_type_for_mode): Handle vector modes.
+
+2009-11-05 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/trans.c (lvalue_required_p) <N_Unchecked_Conversion>:
+ New case.
+
+2009-10-30 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/utils.c (MAX_FIXED_MODE_SIZE): Delete.
+ (create_field_decl): Update description. In a packed record, round
+ the size up to a byte boundary only if the field's type has BLKmode.
+ * gcc-interface/gigi.h (create_field_decl): Update description.
+
+2009-10-30 Emmanuel Briot <briot@adacore.com>
+
+ * make.adb (Start_Compile_If_Possible): Compute location of resulting
+ ALI file in this procedure instead of after the compilation itself,
+ since the current directory might have changed in between when using
+ -j<n>.
+
+ * osint.ads: Addded missing alignment clause.
+
+ * adaint.c, adaint.h, osint.adb (__gnat_reset_attributes,
+ __gnat_size_of_file_attributes): Rename reset_attributes and
+ size_of_file_attributes.
+
+2009-10-30 Javier Miranda <miranda@adacore.com>
+
+ * sem_scil.adb (Adjust_SCIL_Node): Add missing management of sequences
+ of statements when searching for SCIL nodes.
+
+2009-10-30 Tristan Gingold <gingold@adacore.com>
+
+ * gnatlink.adb, link.c: By default use shared libgcc on darwin.
+
+2009-10-30 Emmanuel Briot <briot@adacore.com>
+
+ * make.adb, osint.adb (Add_Lib_Search_Dir): Do not add if dir is
+ already in the list.
+ This saves system calls when looking for ALI files
+ (Scan_Make_Args): The parameter to gnatmake's -D is now converted to an
+ absolute PATH (so that the above improvement properly occurs if both
+ -D<dir> and -aO<dir> are specified).
+
+2009-10-30 Thomas Quinot <quinot@adacore.com>
+
+ * a-direct.adb: Minor reformatting
+
+2009-10-30 Emmanuel Briot <briot@adacore.com>
+
+ * make.adb, adaint.c, adaint.h, osint.adb, osint.ads, bcheck.adb
+ (*_attr): new subprograms.
+ (File_Length, File_Time_Stamp, Is_Writable_File): new subprograms
+ (Read_Library_Info_From_Full, Full_Library_Info_Name,
+ Full_Source_Name): Now benefit from a previous cache of the file
+ attributes, to further save on system calls.
+ (Smart_Find_File): now also cache the file attributes. This makes the
+ package File_Stamp_Hash_Table useless, and it was removed.
+ (Compile_Sources): create subprograms for the various steps of the main
+ loop, for readibility and to avoid sharing variables between the
+ various steps.
+
+2009-10-30 Emmanuel Briot <briot@adacore.com>
+
+ * make.adb, osint.adb, osint.ads (Library_File_Stamp): Removed, since
+ unused.
+ (Read_Library_Info_From_Full): New subprogram.
+
+2009-10-30 Robert Dewar <dewar@adacore.com>
+
+ * a-tideio.adb: Minor reformatting
+ * a-wtdeio.adb, a-ztdeio.adb: Update comments, code clean up.
+
+ * a-reatim.adb, a-tideau.adb, a-ngelfu.adb, a-ztdeau.adb, a-ngrear.adb,
+ a-wtedit.adb, a-ststio.adb, a-ztedit.adb: Minor code reorganization
+ (use conditional expressions).
+
+2009-10-30 Ed Schonberg <schonberg@adacore.com>
+
+ * gnat_ugn.texi: Additional info on gnatw.i and gnatw.I
+
+ * sem_case.adb: Improved error message.
+
+2009-10-30 Emmanuel Briot <briot@adacore.com>
+
+ * a-direct.adb, gnatcmd.adb, gnatname.adb, makeutl.adb, opt.ads,
+ osint.adb, prj-ext.adb, switch-m.adb (Follow_Links_For_Dirs): Now
+ defaults to False, and controlled by -eL.
+ * a-direct.adb: Add comments.
+ * osint.adb (File_Stamp): Avoid unneeded duplicate system call
+
+2009-10-30 Robert Dewar <dewar@adacore.com>
+
+ * sem_res.adb (Resolve_Type_Conversion): Avoid false positive when
+ converting non-static subtype to "identical" static subtype.
+
+2009-10-30 Ed Schonberg <schonberg@adacore.com>
+
+ * usage.adb: Add -gnatw.i switch.
+
+2009-10-30 Vincent Celier <celier@adacore.com>
+
+ * xsnamest.adb: Update comments with regards to the template files
+ snames.*.tmpl
+
+2009-10-30 Bob Duff <duff@adacore.com>
+
+ * s-fileio.adb (Errno_Message): Suppress VMS-specific warning.
+
+2009-10-30 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_case.adb (Check_Choices): Add explanatory message when there are
+ missing alternatives when the required range of alternatives is given
+ by the base type of the case expression or discriminant in a variant
+ part.
+
+ * opt.ads: New flag Warn_On_Overlap, to enable warnings on potentially
+ dangerous overlap between actuals in a call, activated by -gnatw.i
+ * sem_warn.adb (Set_Dot_Warning_Switch): set flag.
+ (Warn_On_Overlapping_Actuals): use new flag.
+
+ * gnat_ugn.texi: Document -gnatw.i, warning on overlapping actuals
+
+2009-10-30 Robert Dewar <dewar@adacore.com>
+
+ * exp_aggr.adb, exp_ch9.adb: Minor reformatting
+
+2009-10-29 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (make_type_from_size) <INTEGER_TYPE>: Do not
+ create integer types with precision 0.
+
+2009-10-29 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/41870
+ * gcc-interface/decl.c (array_type_has_nonaliased_component): Swap
+ parameters and rewrite comments. For a derived type, return the
+ setting of its parent type.
+ (gnat_to_gnu_entity): Do an alias set copy for derived types if they
+ are composite. Adjust calls to above function.
+
+2009-10-29 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/trans.c (Attribute_to_gnu) <Attr_Object_Size>: Do not
+ return the RM size for padded types.
+
+2009-10-28 Robert Dewar <dewar@adacore.com>
+
+ * sem_type.adb: Minor reformatting
+
+2009-10-28 Arnaud Charlet <charlet@adacore.com>
+
+ * exp_ch9.adb (Build_Task_Proc_Specification): Generate a different
+ suffix for task type bodies.
+
+2009-10-28 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_aggr.adb (Convert_Aggr_In_Allocator): Do not look for a
+ finalization list if the designated type requires no control actions,
+ to prevent a useless semantic dependence on ada.tags.
+
+2009-10-28 Bob Duff <duff@adacore.com>
+
+ * s-fileio.adb: Give more information in exception messages.
+
+2009-10-28 Robert Dewar <dewar@adacore.com>
+
+ * gnat_ugn.texi: Document new -gnatyt requirement for space after right
+ paren if next token starts with digit or letter.
+ * styleg.adb (Check_Right_Paren): New rule for space after if next
+ character is a letter or digit.
+
+2009-10-28 Thomas Quinot <quinot@adacore.com>
+
+ * s-crtl.ads (System.CRTL.strerror): New function.
+
+2009-10-28 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_type.adb: Add guard to recover some type errors.
+
+2009-10-28 Vincent Celier <celier@adacore.com>
+
+ * prj-nmsc.adb (Add_To_Or_Remove_From_List): New name of procedure
+ Add_If_Not_In_List to account to the fact that a directory may be
+ removed from the list. Only remove directory if Removed is True.
+
+2009-10-28 Gary Dismukes <dismukes@adacore.com>
+
+ * a-textio.ads, a-textio.ads: Put back function EOF_Char in private
+ part. Put back body of function EOF_Char.
+ * a-tienau.adb: Remove with of Interfaces.C_Streams and change EOF back
+ to EOF_Char.
+
+2009-10-28 Emmanuel Briot <briot@adacore.com>
+
+ * prj-tree.adb (Free): Fix memory leak.
+
+2009-10-28 Thomas Quinot <quinot@adacore.com>
+
+ * s-fileio.adb: Minor reformatting
+
+2009-10-28 Arnaud Charlet <charlet@adacore.com>
+
+ * gcc-interface/Make-lang.in: Update dependencies.
+
+2009-10-28 Robert Dewar <dewar@adacore.com>
+
+ * exp_attr.adb, exp_ch9.adb, prj-nmsc.adb, tbuild.adb, ali.adb,
+ types.ads: Minor reformatting
+
+2009-10-28 Tristan Gingold <gingold@adacore.com>
+
+ * init.c: Fix __gnat_error_handler for Darwin10 (Snow Leopard)
+
+2009-10-28 Thomas Quinot <quinot@adacore.com>
+
+ * exp_ch4.adb (Expand_N_Type_Conversion): Perform Integer promotion for
+ the operand of the unary minus and ABS operators.
+
+ * sem_type.adb (Covers): A concurrent type and its corresponding record
+ type are compatible.
+ * exp_attr.adb (Expand_N_Attribute_Reference): Do not rewrite a 'Access
+ attribute reference for the current instance of a protected type while
+ analyzing an access discriminant constraint in a component definition.
+ Such a reference is handled in the corresponding record's init proc,
+ while initializing the constrained component.
+ * exp_ch9.adb (Expand_N_Protected_Type_Declaration): When creating the
+ corresponding record type, propagate components'
+ Has_Per_Object_Constraint flag.
+ * exp_ch3.adb (Build_Init_Procedure.Build_Init_Statements):
+ For a concurrent type, set up concurrent aspects before initializing
+ components with a per object constrain, because they may be controlled,
+ and their initialization may call entries or protected subprograms of
+ the enclosing concurrent object.
+
+2009-10-28 Emmanuel Briot <briot@adacore.com>
+
+ * prj-nmsc.adb (Add_If_Not_In_List): New subprogram, for better sharing
+ of code.
+ (Find_Source_Dirs): resolve links if Opt.Follow_Links_For_Dirs when
+ processing the directories specified explicitly in the project file.
+
+2009-10-28 Robert Dewar <dewar@adacore.com>
+
+ * a-ztexio.adb, a-ztexio.ads, a-witeio.ads, a-witeio.adb,
+ a-textio.ads, a-textio.adb: Reorganize (moving specs from private part
+ to body).
+ (Initialize_Standard_Files): New procedure.
+ * a-tienau.adb: Minor change to make EOF directly visible
+ * a-tirsfi.ads, a-wrstfi.adb, a-wrstfi.ads, a-zrstfi.adb,
+ a-zrstfi.ads, a-tirsfi.adb: New unit, initial version.
+ * gnat_rm.texi: Add documentation for
+ Ada.[Wide_[Wide_]]Text_IO.Reset_Standard_Files.
+ * Makefile.rtl: Add entries for
+ Ada.[Wide_[Wide_]]Text_IO.Reset_Standard_Files
+
+2009-10-28 Thomas Quinot <quinot@adacore.com>
+
+ * exp_ch9.ads: Minor reformatting
+ * sem_ch3.adb: Minor reformatting
+ * sem_aggr.adb: Minor reformatting.
+ * sem_attr.adb: Minor reformatting
+ * tbuild.adb, tbuild.ads, par-ch4.adb, exp_ch4.adb (Tbuild.New_Op_Node):
+ New subprogram.
+ Minor code reorganization/factoring.
+
+2009-10-27 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (purpose_member_field): New static function.
+ (annotate_rep): Use it instead of purpose_member.
+
+2009-10-27 Eric Botcazou <ebotcazou@adacore.com>
+
+ * raise-gcc (db_region_for): Use _Unwind_GetIPInfo instead of
+ _Unwind_GetIP if HAVE_GETIPINFO is defined.
+ (db_action_for): Likewise.
+
+2009-10-27 Robert Dewar <dewar@adacore.com>
+
+ * s-fileio.adb, s-fileio.ads, sem_util.adb, sem_warn.adb,
+ sem_warn.ads: Minor reformatting
+
+2009-10-27 Robert Dewar <dewar@adacore.com>
+
+ * sem_warn.adb, sem_util.adb, sem_util.ads: Minor reformatting. Add
+ comments.
+
+2009-10-27 Robert Dewar <dewar@adacore.com>
+
+ * s-os_lib.ads, s-os_lib.adb, prj-err.adb, makeutl.adb: Minor
+ reformatting.
+
+2009-10-27 Ed Schonberg <schonberg@adacore.com>
+
+ * sem.util.ads, sem_util.adb (Denotes_Same_Object,
+ Denotes_Same_Prefix): New functions to detect overlap between actuals
+ that are not by-copy in a call, when one of them is in-out.
+ * sem_warn.ads, sem_warn.adb (Warn_On_Overlapping_Actuals): New
+ procedure, called on a subprogram call to warn when an in-out actual
+ that is not by-copy overlaps with another actual, thus leadind to
+ potentially dangerous aliasing in the body of the called subprogram.
+ Currently the warning is under control of the -gnatX switch.
+ * sem_res.adb (resolve_call): call Warn_On_Overlapping_Actuals.
+
+2009-10-27 Thomas Quinot <quinot@adacore.com>
+
+ * sem_ch12.adb (Install_Formal_Packages): Do not omit installation of
+ visible entities when the formal package doesn't have a box.
+
+ * checks.adb: Minor reformatting.
+
+2009-10-27 Vincent Celier <celier@adacore.com>
+
+ * prj-part.adb (Parse): Catch exception Types.Unrecoverable_Error and
+ set Project to Empty_Node.
+
+2009-10-27 Robert Dewar <dewar@adacore.com>
+
+ * gnatbind.adb: Minor reformatting
+
+2009-10-27 Arnaud Charlet <charlet@adacore.com>
+
+ * exp_aggr.adb: Fix comment.
+
+2009-10-27 Emmanuel Briot <briot@adacore.com>
+
+ * prj-err.adb (Error_Msg): take into account continuation lines when
+ computing whether we have a warning.
+
+2009-10-27 Vasiliy Fofanov <fofanov@adacore.com>
+
+ * make.adb, s-os_lib.adb, s-os_lib.ads (Create_Temp_Output_File): New
+ routine that is designed to create temp file descriptor specifically
+ for redirecting an output stream.
+
+2009-10-24 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: When
+ processing the parent type, build the COMPONENT_REF for a discriminant
+ with the proper type.
+
+2009-10-24 Eric Botcazou <ebotcazou@adacore.com>
+
+ * init.c (__gnat_adjust_context_for_raise): Mention _Unwind_GetIPInfo.
+ * gcc-interface/Makefile.in (GNATLIBCFLAGS_FOR_C): Add HAVE_GETIPINFO.
+ Pass GNATLIBCFLAGS_FOR_C to recursive invocations.
+
+2009-10-21 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interfaces/decl.c (build_subst_list): Convert the expression of
+ the constraint to the type of the discriminant.
+
+2009-10-21 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interfaces/decl.c (gnat_to_gnu_entity): Do not create a new
+ TYPE_DECL when a type is padded if there is already one and reset
+ TYPE_STUB_DECL in this case.
+
+2009-10-21 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interfaces/utils.c (create_subprog_decl): Do not redefine
+ main_identifier_node.
+
+2009-10-17 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/utils.c (convert): When converting to a padded type
+ with an inner type of self-referential size, pad the expression before
+ doing the unchecked conversion.
+
+2009-10-17 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/utils2.c (build_binary_op) <ARRAY_RANGE_REF>: Make
+ sure the element type is consistent.
+
+2009-10-17 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/trans.c (addressable_p): Handle bitwise operations.
+
+2009-10-16 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/ada-tree.h (TYPE_FAT_POINTER_P): Swap with...
+ (TYPE_IS_FAT_POINTER_P): ...this.
+ (TYPE_THIN_POINTER_P): Rename into...
+ (TYPE_IS_THIN_POINTER_P): ...this.
+ (TYPE_FAT_OR_THIN_POINTER_P): Rename into...
+ (TYPE_IS_FAT_OR_THIN_POINTER_P): ...this.
+ (TYPE_IS_PADDING_P): Change definition, move old one to...
+ (TYPE_PADDING_P): ...this.
+ * gcc-interface/decl.c (gnat_to_gnu_entity): Adjust for above changes.
+ (get_unpadded_type): Likewise.
+ (gnat_to_gnu_component_type): Likewise.
+ (gnat_to_gnu_param): Likewise.
+ (relate_alias_sets): Likewise.
+ (make_packable_type): Likewise.
+ (maybe_pad_type): Likewise.
+ (gnat_to_gnu_field): Likewise.
+ (is_variable_size): Likewise.
+ (annotate_object): Likewise.
+ (validate_size): Likewise.
+ (set_rm_size): Likewise.
+ (make_type_from_size): Likewise.
+ (rm_size): Likewise.
+ * gcc-interface/misc.c (gnat_print_type): Likewise.
+ (gnat_get_alias_set): Likewise.
+ * gcc-interface/trans.c (Identifier_to_gnu): Likewise.
+ (Attribute_to_gnu): Likewise.
+ (call_to_gnu): Likewise.
+ (gnat_to_gnu): Likewise.
+ (add_decl_expr): Likewise.
+ (convert_with_check): Likewise.
+ (addressable_p): Likewise.
+ (maybe_implicit_deref): Likewise.
+ (protect_multiple_eval): Likewise.
+ (gnat_stabilize_reference_1): Likewise.
+ * gcc-interface/utils.c (gnat_pushdecl): Likewise.
+ (finish_record_type): Likewise.
+ (rest_of_record_type_compilation): Likewise.
+ (create_type_decl): Likewise.
+ (gnat_types_compatible_p): Likewise.
+ (build_template): Likewise.
+ (convert_vms_descriptor64): Likewise.
+ (convert_vms_descriptor32): Likewise.
+ (build_unc_object_type_from_ptr): Likewise.
+ (update_pointer_to): Likewise.
+ (convert_to_fat_pointer): Likewise.
+ (convert_to_fat_pointer): Likewise.
+ (convert): Likewise.
+ (remove_conversions): Likewise.
+ (maybe_unconstrained_array): Likewise.
+ (unchecked_convert): Likewise.
+ (handle_vector_type_attribute): Likewise.
+ * gcc-interface/utils2.c (build_binary_op): Likewise.
+ (build_unary_op): Likewise.
+ (build_allocator): Likewise.
+
+2009-10-16 Eric Botcazou <ebotcazou@adacore.com>
+
+ * exp_dbug.ads: Adjust type names in comments.
+ * gcc-interface/decl.c (maybe_pad_type): Remove NAME_TRAILER parameter,
+ add new IS_COMPONENT_TYPE parameter. Adjust. Remove dead code.
+ (gnat_to_gnu_entity): Adjust for above change.
+ (gnat_to_gnu_component_type): Likewise.
+ (gnat_to_gnu_field): Likewise.
+ * gcc-interface/trans.c (call_to_gnu): Likewise. Do not unnecessarily
+ call max_size.
+ * gcc-interface/utils.c (finish_record_type): Remove obsolete code.
+ * gcc-interface/gigi.h (maybe_pad_type): Adjust prototype.
+
+2009-10-16 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * s-osinte-rtems.ads: Add mutex type to pthread_mutexattr_t
+ * s-stchop-rtems.adb: Correct binding to rtems_stack_checker_is_blown.
+
+2009-10-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * env.c [__alpha__ && __osf__] (AES_SOURCE): Define.
+
+2009-10-10 Samuel Tardieu <sam@rfc1149.net>
+
+ * sem_eval.adb: Give a more precise error message.
+
+2009-10-06 Samuel Tardieu <sam@rfc1149.net>
+
+ PR ada/41383
+ * a-rttiev.adb (Time_Of_Event): Return Time_First for unset event.
+
+2009-10-06 Samuel Tardieu <sam@rfc1149.net>
+
+ PR ada/38333
+ * sem_prag.adb (Process_Import_Or_Interface): Forbid an abstract
+ subprogram to be completed with a "pragma Import".
+
2009-10-02 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Subtype>:
diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl
index 5f06d1cf2e8..4f26f1569b5 100644
--- a/gcc/ada/Makefile.rtl
+++ b/gcc/ada/Makefile.rtl
@@ -258,6 +258,7 @@ GNATRTL_NONTASKING_OBJS= \
a-timoau$(objext) \
a-timoio$(objext) \
a-tiocst$(objext) \
+ a-tirsfi$(objext) \
a-titest$(objext) \
a-tiunio$(objext) \
a-unccon$(objext) \
@@ -265,6 +266,7 @@ GNATRTL_NONTASKING_OBJS= \
a-wichun$(objext) \
a-widcha$(objext) \
a-witeio$(objext) \
+ a-wrstfi$(objext) \
a-wtcoau$(objext) \
a-wtcoio$(objext) \
a-wtcstr$(objext) \
@@ -286,6 +288,7 @@ GNATRTL_NONTASKING_OBJS= \
a-wwunio$(objext) \
a-zchara$(objext) \
a-zchuni$(objext) \
+ a-zrstfi$(objext) \
a-ztcoau$(objext) \
a-ztcoio$(objext) \
a-ztcstr$(objext) \
diff --git a/gcc/ada/a-direct.adb b/gcc/ada/a-direct.adb
index f0182c68e7a..1013b1514db 100644
--- a/gcc/ada/a-direct.adb
+++ b/gcc/ada/a-direct.adb
@@ -210,6 +210,9 @@ package body Ada.Directories is
else
declare
+ -- We need to resolve links because of A.16(47), since we must not
+ -- return alternative names for files.
+
Norm : constant String := Normalize_Pathname (Name);
Last_DS : constant Natural :=
Strings.Fixed.Index
@@ -441,6 +444,8 @@ package body Ada.Directories is
Local_Get_Current_Dir (Buffer'Address, Path_Len'Address);
declare
+ -- We need to resolve links because of A.16(47), since we must not
+ -- return alternative names for files
Cur : constant String := Normalize_Pathname (Buffer (1 .. Path_Len));
begin
@@ -781,6 +786,8 @@ package body Ada.Directories is
-- Use System.OS_Lib.Normalize_Pathname
declare
+ -- We need to resolve links because of A.16(47), since we must not
+ -- return alternative names for files
Value : constant String := Normalize_Pathname (Name);
subtype Result is String (1 .. Value'Length);
begin
diff --git a/gcc/ada/a-ngelfu.adb b/gcc/ada/a-ngelfu.adb
index ef9aadd4306..55d14e7db53 100644
--- a/gcc/ada/a-ngelfu.adb
+++ b/gcc/ada/a-ngelfu.adb
@@ -729,21 +729,12 @@ package body Ada.Numerics.Generic_Elementary_Functions is
Raw_Atan : Float_Type'Base;
begin
- if abs Y > abs X then
- Z := abs (X / Y);
- else
- Z := abs (Y / X);
- end if;
-
- if Z < Sqrt_Epsilon then
- Raw_Atan := Z;
+ Z := (if abs Y > abs X then abs (X / Y) else abs (Y / X));
- elsif Z = 1.0 then
- Raw_Atan := Pi / 4.0;
-
- else
- Raw_Atan := Float_Type'Base (Aux.Atan (Double (Z)));
- end if;
+ Raw_Atan :=
+ (if Z < Sqrt_Epsilon then Z
+ elsif Z = 1.0 then Pi / 4.0
+ else Float_Type'Base (Aux.Atan (Double (Z))));
if abs Y > abs X then
Raw_Atan := Half_Pi - Raw_Atan;
diff --git a/gcc/ada/a-ngrear.adb b/gcc/ada/a-ngrear.adb
index b0cf3e1fd72..5c8a0092477 100644
--- a/gcc/ada/a-ngrear.adb
+++ b/gcc/ada/a-ngrear.adb
@@ -433,11 +433,7 @@ package body Ada.Numerics.Generic_Real_Arrays is
end if;
for J in 1 .. N loop
- if Piv (J) /= J then
- Det := -Det * LU (J, J);
- else
- Det := Det * LU (J, J);
- end if;
+ Det := (if Piv (J) /= J then -Det * LU (J, J) else Det * LU (J, J));
end loop;
return Det;
diff --git a/gcc/ada/a-reatim.adb b/gcc/ada/a-reatim.adb
index 2ca4472a5ea..c3cbec69ddc 100644
--- a/gcc/ada/a-reatim.adb
+++ b/gcc/ada/a-reatim.adb
@@ -7,7 +7,7 @@
-- B o d y --
-- --
-- Copyright (C) 1991-1994, Florida State University --
--- Copyright (C) 1995-2006, AdaCore --
+-- Copyright (C) 1995-2009, AdaCore --
-- --
-- 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- --
@@ -189,19 +189,12 @@ package body Ada.Real_Time is
-- Special-case for Time_First, whose absolute value is anomalous,
-- courtesy of two's complement.
- if T = Time_First then
- T_Val := abs (Time_Last);
- else
- T_Val := abs (T);
- end if;
+ T_Val := (if T = Time_First then abs (Time_Last) else abs (T));
-- Extract the integer part of T, truncating towards zero
- if T_Val < 0.5 then
- SC := 0;
- else
- SC := Seconds_Count (Time_Span'(T_Val - 0.5));
- end if;
+ SC :=
+ (if T_Val < 0.5 then 0 else Seconds_Count (Time_Span'(T_Val - 0.5)));
if T < 0.0 then
SC := -SC;
diff --git a/gcc/ada/a-rttiev.adb b/gcc/ada/a-rttiev.adb
index 2068c786850..55687ec8f6b 100644
--- a/gcc/ada/a-rttiev.adb
+++ b/gcc/ada/a-rttiev.adb
@@ -332,7 +332,13 @@ package body Ada.Real_Time.Timing_Events is
function Time_Of_Event (Event : Timing_Event) return Time is
begin
- return Event.Timeout;
+ -- RM D.15(18/2): Time_First must be returned if the event is not set
+
+ if Event.Handler = null then
+ return Time_First;
+ else
+ return Event.Timeout;
+ end if;
end Time_Of_Event;
--------------
diff --git a/gcc/ada/a-ststio.adb b/gcc/ada/a-ststio.adb
index cf2f4ea2ee2..79ee6cdfd5a 100644
--- a/gcc/ada/a-ststio.adb
+++ b/gcc/ada/a-ststio.adb
@@ -241,11 +241,7 @@ package body Ada.Streams.Stream_IO is
-- (and furthermore there are situations (such as the case of writing
-- a sequential Posix FIFO file) where the lseek would cause problems.
- if Mode = Out_File then
- File.Last_Op := Op_Write;
- else
- File.Last_Op := Op_Read;
- end if;
+ File.Last_Op := (if Mode = Out_File then Op_Write else Op_Read);
end Open;
----------
diff --git a/gcc/ada/a-textio.adb b/gcc/ada/a-textio.adb
index b3a98fcb3ec..ceacfe5b127 100644
--- a/gcc/ada/a-textio.adb
+++ b/gcc/ada/a-textio.adb
@@ -57,15 +57,30 @@ package body Ada.Text_IO is
WC_Encoding : Character;
pragma Import (C, WC_Encoding, "__gl_wc_encoding");
+ -- Default wide character encoding
+
+ Err_Name : aliased String := "*stderr" & ASCII.NUL;
+ In_Name : aliased String := "*stdin" & ASCII.NUL;
+ Out_Name : aliased String := "*stdout" & ASCII.NUL;
+ -- Names of standard files
+ --
+ -- Use "preallocated" strings to avoid calling "new" during the elaboration
+ -- of the run time. This is needed in the tasking case to avoid calling
+ -- Task_Lock too early. A filename is expected to end with a null character
+ -- in the runtime, here the null characters are added just to have a
+ -- correct filename length.
+ --
+ -- Note: the names for these files are bogus, and probably it would be
+ -- better for these files to have no names, but the ACVC tests insist!
+ -- We use names that are bound to fail in open etc.
+
+ Null_Str : aliased constant String := "";
+ -- Used as form string for standard files
-----------------------
-- Local Subprograms --
-----------------------
- function Getc_Immed (File : File_Type) return int;
- -- This routine is identical to Getc, except that the read is done in
- -- Get_Immediate mode (i.e. without waiting for a line return).
-
function Get_Upper_Half_Char
(C : Character;
File : File_Type) return Character;
@@ -82,18 +97,48 @@ package body Ada.Text_IO is
-- This routine is identical to Get_Upper_Half_Char, except that the reads
-- are done in Get_Immediate mode (i.e. without waiting for a line return).
+ function Getc (File : File_Type) return int;
+ -- Gets next character from file, which has already been checked for being
+ -- in read status, and returns the character read if no error occurs. The
+ -- result is EOF if the end of file was read.
+
+ function Getc_Immed (File : File_Type) return int;
+ -- This routine is identical to Getc, except that the read is done in
+ -- Get_Immediate mode (i.e. without waiting for a line return).
+
function Has_Upper_Half_Character (Item : String) return Boolean;
-- Returns True if any of the characters is in the range 16#80#-16#FF#
+ function Nextc (File : File_Type) return int;
+ -- Returns next character from file without skipping past it (i.e. it is a
+ -- combination of Getc followed by an Ungetc).
+
procedure Put_Encoded (File : File_Type; Char : Character);
-- Called to output a character Char to the given File, when the encoding
-- method for the file is other than brackets, and Char is upper half.
+ procedure Putc (ch : int; File : File_Type);
+ -- Outputs the given character to the file, which has already been checked
+ -- for being in output status. Device_Error is raised if the character
+ -- cannot be written.
+
procedure Set_WCEM (File : in out File_Type);
-- Called by Open and Create to set the wide character encoding method for
-- the file, processing a WCEM form parameter if one is present. File is
-- IN OUT because it may be closed in case of an error.
+ procedure Terminate_Line (File : File_Type);
+ -- If the file is in Write_File or Append_File mode, and the current line
+ -- is not terminated, then a line terminator is written using New_Line.
+ -- Note that there is no Terminate_Page routine, because the page mark at
+ -- the end of the file is implied if necessary.
+
+ procedure Ungetc (ch : int; File : File_Type);
+ -- Pushes back character into stream, using ungetc. The caller has checked
+ -- that the file is in read status. Device_Error is raised if the character
+ -- cannot be pushed back. An attempt to push back and end of file character
+ -- (EOF) is ignored.
+
-------------------
-- AFCB_Allocate --
-------------------
@@ -965,6 +1010,52 @@ package body Ada.Text_IO is
return False;
end Has_Upper_Half_Character;
+ -------------------------------
+ -- Initialize_Standard_Files --
+ -------------------------------
+
+ procedure Initialize_Standard_Files is
+ begin
+ Standard_Err.Stream := stderr;
+ Standard_Err.Name := Err_Name'Access;
+ Standard_Err.Form := Null_Str'Unrestricted_Access;
+ Standard_Err.Mode := FCB.Out_File;
+ Standard_Err.Is_Regular_File := is_regular_file (fileno (stderr)) /= 0;
+ Standard_Err.Is_Temporary_File := False;
+ Standard_Err.Is_System_File := True;
+ Standard_Err.Is_Text_File := True;
+ Standard_Err.Access_Method := 'T';
+ Standard_Err.Self := Standard_Err;
+ Standard_Err.WC_Method := Default_WCEM;
+
+ Standard_In.Stream := stdin;
+ Standard_In.Name := In_Name'Access;
+ Standard_In.Form := Null_Str'Unrestricted_Access;
+ Standard_In.Mode := FCB.In_File;
+ Standard_In.Is_Regular_File := is_regular_file (fileno (stdin)) /= 0;
+ Standard_In.Is_Temporary_File := False;
+ Standard_In.Is_System_File := True;
+ Standard_In.Is_Text_File := True;
+ Standard_In.Access_Method := 'T';
+ Standard_In.Self := Standard_In;
+ Standard_In.WC_Method := Default_WCEM;
+
+ Standard_Out.Stream := stdout;
+ Standard_Out.Name := Out_Name'Access;
+ Standard_Out.Form := Null_Str'Unrestricted_Access;
+ Standard_Out.Mode := FCB.Out_File;
+ Standard_Out.Is_Regular_File := is_regular_file (fileno (stdout)) /= 0;
+ Standard_Out.Is_Temporary_File := False;
+ Standard_Out.Is_System_File := True;
+ Standard_Out.Is_Text_File := True;
+ Standard_Out.Access_Method := 'T';
+ Standard_Out.Self := Standard_Out;
+ Standard_Out.WC_Method := Default_WCEM;
+
+ FIO.Make_Unbuffered (AP (Standard_Out));
+ FIO.Make_Unbuffered (AP (Standard_Err));
+ end Initialize_Standard_Files;
+
-------------
-- Is_Open --
-------------
@@ -2198,20 +2289,8 @@ package body Ada.Text_IO is
end if;
end Write;
- -- Use "preallocated" strings to avoid calling "new" during the
- -- elaboration of the run time. This is needed in the tasking case to
- -- avoid calling Task_Lock too early. A filename is expected to end with a
- -- null character in the runtime, here the null characters are added just
- -- to have a correct filename length.
-
- Err_Name : aliased String := "*stderr" & ASCII.NUL;
- In_Name : aliased String := "*stdin" & ASCII.NUL;
- Out_Name : aliased String := "*stdout" & ASCII.NUL;
-
begin
- -------------------------------
- -- Initialize Standard Files --
- -------------------------------
+ -- Initialize Standard Files
for J in WC_Encoding_Method loop
if WC_Encoding = WC_Encoding_Letters (J) then
@@ -2219,51 +2298,10 @@ begin
end if;
end loop;
- -- Note: the names in these files are bogus, and probably it would be
- -- better for these files to have no names, but the ACVC test insist!
- -- We use names that are bound to fail in open etc.
-
- Standard_Err.Stream := stderr;
- Standard_Err.Name := Err_Name'Access;
- Standard_Err.Form := Null_Str'Unrestricted_Access;
- Standard_Err.Mode := FCB.Out_File;
- Standard_Err.Is_Regular_File := is_regular_file (fileno (stderr)) /= 0;
- Standard_Err.Is_Temporary_File := False;
- Standard_Err.Is_System_File := True;
- Standard_Err.Is_Text_File := True;
- Standard_Err.Access_Method := 'T';
- Standard_Err.Self := Standard_Err;
- Standard_Err.WC_Method := Default_WCEM;
-
- Standard_In.Stream := stdin;
- Standard_In.Name := In_Name'Access;
- Standard_In.Form := Null_Str'Unrestricted_Access;
- Standard_In.Mode := FCB.In_File;
- Standard_In.Is_Regular_File := is_regular_file (fileno (stdin)) /= 0;
- Standard_In.Is_Temporary_File := False;
- Standard_In.Is_System_File := True;
- Standard_In.Is_Text_File := True;
- Standard_In.Access_Method := 'T';
- Standard_In.Self := Standard_In;
- Standard_In.WC_Method := Default_WCEM;
-
- Standard_Out.Stream := stdout;
- Standard_Out.Name := Out_Name'Access;
- Standard_Out.Form := Null_Str'Unrestricted_Access;
- Standard_Out.Mode := FCB.Out_File;
- Standard_Out.Is_Regular_File := is_regular_file (fileno (stdout)) /= 0;
- Standard_Out.Is_Temporary_File := False;
- Standard_Out.Is_System_File := True;
- Standard_Out.Is_Text_File := True;
- Standard_Out.Access_Method := 'T';
- Standard_Out.Self := Standard_Out;
- Standard_Out.WC_Method := Default_WCEM;
+ Initialize_Standard_Files;
FIO.Chain_File (AP (Standard_In));
FIO.Chain_File (AP (Standard_Out));
FIO.Chain_File (AP (Standard_Err));
- FIO.Make_Unbuffered (AP (Standard_Out));
- FIO.Make_Unbuffered (AP (Standard_Err));
-
end Ada.Text_IO;
diff --git a/gcc/ada/a-textio.ads b/gcc/ada/a-textio.ads
index 9277ccbbae5..d22b2f9c635 100644
--- a/gcc/ada/a-textio.ads
+++ b/gcc/ada/a-textio.ads
@@ -41,6 +41,7 @@
with Ada.IO_Exceptions;
with Ada.Streams;
+
with System;
with System.File_Control_Block;
with System.WCh_Con;
@@ -443,9 +444,6 @@ private
-- The Standard Files --
------------------------
- Null_Str : aliased constant String := "";
- -- Used as name and form of standard files
-
Standard_In_AFCB : aliased Text_AFCB;
Standard_Out_AFCB : aliased Text_AFCB;
Standard_Err_AFCB : aliased Text_AFCB;
@@ -460,47 +458,15 @@ private
Current_Err : aliased File_Type := Standard_Err;
-- Current files
- -----------------------
- -- Local Subprograms --
- -----------------------
-
- -- These subprograms are in the private part of the spec so that they can
- -- be shared by the routines in the body of Ada.Text_IO.Wide_Text_IO.
-
- -- Note: we use Integer in these declarations instead of the more accurate
- -- Interfaces.C_Streams.int, because we do not want to drag in the spec of
- -- this interfaces package with the spec of Ada.Text_IO, and we know that
- -- in fact these types are identical
-
function EOF_Char return Integer;
-- Returns the system-specific character indicating the end of a text file.
-- This is exported for use by child packages such as Enumeration_Aux to
- -- eliminate their needing to depend directly on Interfaces.C_Streams.
-
- function Getc (File : File_Type) return Integer;
- -- Gets next character from file, which has already been checked for
- -- being in read status, and returns the character read if no error
- -- occurs. The result is EOF if the end of file was read.
-
- function Nextc (File : File_Type) return Integer;
- -- Returns next character from file without skipping past it (i.e. it
- -- is a combination of Getc followed by an Ungetc).
-
- procedure Putc (ch : Integer; File : File_Type);
- -- Outputs the given character to the file, which has already been
- -- checked for being in output status. Device_Error is raised if the
- -- character cannot be written.
-
- procedure Terminate_Line (File : File_Type);
- -- If the file is in Write_File or Append_File mode, and the current
- -- line is not terminated, then a line terminator is written using
- -- New_Line. Note that there is no Terminate_Page routine, because
- -- the page mark at the end of the file is implied if necessary.
-
- procedure Ungetc (ch : Integer; File : File_Type);
- -- Pushes back character into stream, using ungetc. The caller has
- -- checked that the file is in read status. Device_Error is raised
- -- if the character cannot be pushed back. An attempt to push back
- -- and end of file character (EOF) is ignored.
+ -- eliminate their needing to depend directly on Interfaces.C_Streams,
+ -- which is not available in certain target environments (such as AAMP).
+
+ procedure Initialize_Standard_Files;
+ -- Initializes the file control blocks for the standard files. Called from
+ -- the elaboration routine for this package, and from Reset_Standard_Files
+ -- in package Ada.Text_IO.Reset_Standard_Files.
end Ada.Text_IO;
diff --git a/gcc/ada/a-tideau.adb b/gcc/ada/a-tideau.adb
index 298507a5c2c..2790bed68d7 100644
--- a/gcc/ada/a-tideau.adb
+++ b/gcc/ada/a-tideau.adb
@@ -242,11 +242,8 @@ package body Ada.Text_IO.Decimal_Aux is
Ptr : Natural := 0;
begin
- if Exp = 0 then
- Fore := To'Length - 1 - Aft;
- else
- Fore := To'Length - 2 - Aft - Exp;
- end if;
+ Fore :=
+ (if Exp = 0 then To'Length - 1 - Aft else To'Length - 2 - Aft - Exp);
if Fore < 1 then
raise Layout_Error;
diff --git a/gcc/ada/a-tideio.adb b/gcc/ada/a-tideio.adb
index 9db04784b95..5dceb128f90 100644
--- a/gcc/ada/a-tideio.adb
+++ b/gcc/ada/a-tideio.adb
@@ -51,7 +51,6 @@ package body Ada.Text_IO.Decimal_IO is
begin
if Num'Size > Integer'Size then
Item := Num'Fixed_Value (Aux.Get_LLD (File, Width, Scale));
-
else
Item := Num'Fixed_Value (Aux.Get_Dec (File, Width, Scale));
end if;
diff --git a/gcc/ada/a-tirsfi.adb b/gcc/ada/a-tirsfi.adb
new file mode 100755
index 00000000000..791c066bab3
--- /dev/null
+++ b/gcc/ada/a-tirsfi.adb
@@ -0,0 +1,39 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT RUN-TIME COMPONENTS --
+-- --
+-- A D A . T E X T _ I O . R E S E T _ S T A N D A R D _ F I L E S --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2009, 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. --
+-- --
+-- As a special exception 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/>. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+--------------------------------------
+-- Ada.Text_IO.Reset_Standard_Files --
+--------------------------------------
+
+procedure Ada.Text_IO.Reset_Standard_Files is
+begin
+ Ada.Text_IO.Initialize_Standard_Files;
+end Ada.Text_IO.Reset_Standard_Files;
diff --git a/gcc/ada/a-tirsfi.ads b/gcc/ada/a-tirsfi.ads
new file mode 100755
index 00000000000..b3d4ab0afb9
--- /dev/null
+++ b/gcc/ada/a-tirsfi.ads
@@ -0,0 +1,40 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT RUN-TIME COMPONENTS --
+-- --
+-- A D A . T E X T _ I O . R E S E T _ S T A N D A R D _ F I L E S --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2009, 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. --
+-- --
+-- As a special exception 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/>. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This package provides a reset routine that resets the standard files used
+-- by Text_IO. This is useful in systems such as VxWorks where Ada.Text_IO is
+-- elaborated at the program start, but a system restart may alter the status
+-- of these files, resulting in incorrect operation of Text_IO (in particular
+-- if the standard input file is changed to be interactive, then Get_Line may
+-- hang looking for an extra character after the end of the line.
+
+procedure Ada.Text_IO.Reset_Standard_Files;
+-- Reset standard Text_IO files as described above
diff --git a/gcc/ada/a-wichun.adb b/gcc/ada/a-wichun.adb
index 65df45119cc..65df45119cc 100755..100644
--- a/gcc/ada/a-wichun.adb
+++ b/gcc/ada/a-wichun.adb
diff --git a/gcc/ada/a-wichun.ads b/gcc/ada/a-wichun.ads
index af614538067..af614538067 100755..100644
--- a/gcc/ada/a-wichun.ads
+++ b/gcc/ada/a-wichun.ads
diff --git a/gcc/ada/a-widcha.ads b/gcc/ada/a-widcha.ads
index a5dde73f43c..a5dde73f43c 100755..100644
--- a/gcc/ada/a-widcha.ads
+++ b/gcc/ada/a-widcha.ads
diff --git a/gcc/ada/a-witeio.adb b/gcc/ada/a-witeio.adb
index e877405820f..efd5021849d 100644
--- a/gcc/ada/a-witeio.adb
+++ b/gcc/ada/a-witeio.adb
@@ -57,26 +57,62 @@ package body Ada.Wide_Text_IO is
WC_Encoding : Character;
pragma Import (C, WC_Encoding, "__gl_wc_encoding");
+ -- Default wide character encoding
+
+ Err_Name : aliased String := "*stderr" & ASCII.NUL;
+ In_Name : aliased String := "*stdin" & ASCII.NUL;
+ Out_Name : aliased String := "*stdout" & ASCII.NUL;
+ -- Names of standard files
+ --
+ -- Use "preallocated" strings to avoid calling "new" during the elaboration
+ -- of the run time. This is needed in the tasking case to avoid calling
+ -- Task_Lock too early. A filename is expected to end with a null character
+ -- in the runtime, here the null characters are added just to have a
+ -- correct filename length.
+ --
+ -- Note: the names for these files are bogus, and probably it would be
+ -- better for these files to have no names, but the ACVC tests insist!
+ -- We use names that are bound to fail in open etc.
+
+ Null_Str : aliased constant String := "";
+ -- Used as form string for standard files
-----------------------
-- Local Subprograms --
-----------------------
- function Getc_Immed (File : File_Type) return int;
- -- This routine is identical to Getc, except that the read is done in
- -- Get_Immediate mode (i.e. without waiting for a line return).
-
function Get_Wide_Char_Immed
(C : Character;
File : File_Type) return Wide_Character;
-- This routine is identical to Get_Wide_Char, except that the reads are
-- done in Get_Immediate mode (i.e. without waiting for a line return).
+ function Getc_Immed (File : File_Type) return int;
+ -- This routine is identical to Getc, except that the read is done in
+ -- Get_Immediate mode (i.e. without waiting for a line return).
+
+ procedure Putc (ch : int; File : File_Type);
+ -- Outputs the given character to the file, which has already been checked
+ -- for being in output status. Device_Error is raised if the character
+ -- cannot be written.
+
procedure Set_WCEM (File : in out File_Type);
-- Called by Open and Create to set the wide character encoding method for
-- the file, processing a WCEM form parameter if one is present. File is
-- IN OUT because it may be closed in case of an error.
+ procedure Terminate_Line (File : File_Type);
+ -- If the file is in Write_File or Append_File mode, and the current line
+ -- is not terminated, then a line terminator is written using New_Line.
+ -- Note that there is no Terminate_Page routine, because the page mark at
+ -- the end of the file is implied if necessary.
+
+ procedure Ungetc (ch : int; File : File_Type);
+ -- Pushes back character into stream, using ungetc. The caller has checked
+ -- that the file is in read status. Device_Error is raised if the character
+ -- cannot be pushed back. An attempt to push back and end of file character
+ -- (EOF) is ignored.
+
-------------------
-- AFCB_Allocate --
-------------------
@@ -843,6 +879,52 @@ package body Ada.Wide_Text_IO is
return ch;
end Getc_Immed;
+ -------------------------------
+ -- Initialize_Standard_Files --
+ -------------------------------
+
+ procedure Initialize_Standard_Files is
+ begin
+ Standard_Err.Stream := stderr;
+ Standard_Err.Name := Err_Name'Access;
+ Standard_Err.Form := Null_Str'Unrestricted_Access;
+ Standard_Err.Mode := FCB.Out_File;
+ Standard_Err.Is_Regular_File := is_regular_file (fileno (stderr)) /= 0;
+ Standard_Err.Is_Temporary_File := False;
+ Standard_Err.Is_System_File := True;
+ Standard_Err.Is_Text_File := True;
+ Standard_Err.Access_Method := 'T';
+ Standard_Err.Self := Standard_Err;
+ Standard_Err.WC_Method := Default_WCEM;
+
+ Standard_In.Stream := stdin;
+ Standard_In.Name := In_Name'Access;
+ Standard_In.Form := Null_Str'Unrestricted_Access;
+ Standard_In.Mode := FCB.In_File;
+ Standard_In.Is_Regular_File := is_regular_file (fileno (stdin)) /= 0;
+ Standard_In.Is_Temporary_File := False;
+ Standard_In.Is_System_File := True;
+ Standard_In.Is_Text_File := True;
+ Standard_In.Access_Method := 'T';
+ Standard_In.Self := Standard_In;
+ Standard_In.WC_Method := Default_WCEM;
+
+ Standard_Out.Stream := stdout;
+ Standard_Out.Name := Out_Name'Access;
+ Standard_Out.Form := Null_Str'Unrestricted_Access;
+ Standard_Out.Mode := FCB.Out_File;
+ Standard_Out.Is_Regular_File := is_regular_file (fileno (stdout)) /= 0;
+ Standard_Out.Is_Temporary_File := False;
+ Standard_Out.Is_System_File := True;
+ Standard_Out.Is_Text_File := True;
+ Standard_Out.Access_Method := 'T';
+ Standard_Out.Self := Standard_Out;
+ Standard_Out.WC_Method := Default_WCEM;
+
+ FIO.Make_Unbuffered (AP (Standard_Out));
+ FIO.Make_Unbuffered (AP (Standard_Err));
+ end Initialize_Standard_Files;
+
-------------
-- Is_Open --
-------------
@@ -856,9 +938,9 @@ package body Ada.Wide_Text_IO is
-- Line --
----------
- -- Note: we assume that it is impossible in practice for the line
- -- to exceed the value of Count'Last, i.e. no check is required for
- -- overflow raising layout error.
+ -- Note: we assume that it is impossible in practice for the line to exceed
+ -- the value of Count'Last, i.e. no check is required for overflow raising
+ -- layout error.
function Line (File : File_Type) return Positive_Count is
begin
@@ -1840,20 +1922,8 @@ package body Ada.Wide_Text_IO is
set_text_mode (fileno (File.Stream));
end Write;
- -- Use "preallocated" strings to avoid calling "new" during the
- -- elaboration of the run time. This is needed in the tasking case to
- -- avoid calling Task_Lock too early. A filename is expected to end with
- -- a null character in the runtime, here the null characters are added
- -- just to have a correct filename length.
-
- Err_Name : aliased String := "*stderr" & ASCII.NUL;
- In_Name : aliased String := "*stdin" & ASCII.NUL;
- Out_Name : aliased String := "*stdout" & ASCII.NUL;
-
begin
- -------------------------------
- -- Initialize Standard Files --
- -------------------------------
+ -- Initialize Standard Files
for J in WC_Encoding_Method loop
if WC_Encoding = WC_Encoding_Letters (J) then
@@ -1861,51 +1931,10 @@ begin
end if;
end loop;
- -- Note: the names in these files are bogus, and probably it would be
- -- better for these files to have no names, but the ACVC test insist!
- -- We use names that are bound to fail in open etc.
-
- Standard_Err.Stream := stderr;
- Standard_Err.Name := Err_Name'Access;
- Standard_Err.Form := Null_Str'Unrestricted_Access;
- Standard_Err.Mode := FCB.Out_File;
- Standard_Err.Is_Regular_File := is_regular_file (fileno (stderr)) /= 0;
- Standard_Err.Is_Temporary_File := False;
- Standard_Err.Is_System_File := True;
- Standard_Err.Is_Text_File := True;
- Standard_Err.Access_Method := 'T';
- Standard_Err.Self := Standard_Err;
- Standard_Err.WC_Method := Default_WCEM;
-
- Standard_In.Stream := stdin;
- Standard_In.Name := In_Name'Access;
- Standard_In.Form := Null_Str'Unrestricted_Access;
- Standard_In.Mode := FCB.In_File;
- Standard_In.Is_Regular_File := is_regular_file (fileno (stdin)) /= 0;
- Standard_In.Is_Temporary_File := False;
- Standard_In.Is_System_File := True;
- Standard_In.Is_Text_File := True;
- Standard_In.Access_Method := 'T';
- Standard_In.Self := Standard_In;
- Standard_In.WC_Method := Default_WCEM;
-
- Standard_Out.Stream := stdout;
- Standard_Out.Name := Out_Name'Access;
- Standard_Out.Form := Null_Str'Unrestricted_Access;
- Standard_Out.Mode := FCB.Out_File;
- Standard_Out.Is_Regular_File := is_regular_file (fileno (stdout)) /= 0;
- Standard_Out.Is_Temporary_File := False;
- Standard_Out.Is_System_File := True;
- Standard_Out.Is_Text_File := True;
- Standard_Out.Access_Method := 'T';
- Standard_Out.Self := Standard_Out;
- Standard_Out.WC_Method := Default_WCEM;
+ Initialize_Standard_Files;
FIO.Chain_File (AP (Standard_In));
FIO.Chain_File (AP (Standard_Out));
FIO.Chain_File (AP (Standard_Err));
- FIO.Make_Unbuffered (AP (Standard_Out));
- FIO.Make_Unbuffered (AP (Standard_Err));
-
end Ada.Wide_Text_IO;
diff --git a/gcc/ada/a-witeio.ads b/gcc/ada/a-witeio.ads
index 0af805eb980..2cf02b69b05 100644
--- a/gcc/ada/a-witeio.ads
+++ b/gcc/ada/a-witeio.ads
@@ -42,6 +42,9 @@
with Ada.IO_Exceptions;
with Ada.Streams;
+
+with Interfaces.C_Streams;
+
with System;
with System.File_Control_Block;
with System.WCh_Con;
@@ -441,9 +444,6 @@ private
-- The Standard Files --
------------------------
- Null_Str : aliased constant String := "";
- -- Used as name and form of standard files
-
Standard_Err_AFCB : aliased Wide_Text_AFCB;
Standard_In_AFCB : aliased Wide_Text_AFCB;
Standard_Out_AFCB : aliased Wide_Text_AFCB;
@@ -458,26 +458,24 @@ private
Current_Err : aliased File_Type := Standard_Err;
-- Current files
+ procedure Initialize_Standard_Files;
+ -- Initializes the file control blocks for the standard files. Called from
+ -- the elaboration routine for this package, and from Reset_Standard_Files
+ -- in package Ada.Wide_Text_IO.Reset_Standard_Files.
+
-----------------------
-- Local Subprograms --
-----------------------
-- These subprograms are in the private part of the spec so that they can
- -- be shared by the routines in the body of Ada.Text_IO.Wide_Text_IO.
-
- -- Note: we use Integer in these declarations instead of the more accurate
- -- Interfaces.C_Streams.int, because we do not want to drag in the spec of
- -- this interfaces package with the spec of Ada.Text_IO, and we know that
- -- in fact these types are identical
+ -- be shared by the children of Ada.Wide_Text_IO.
- function Getc (File : File_Type) return Integer;
- -- Gets next character from file, which has already been checked for
- -- being in read status, and returns the character read if no error
- -- occurs. The result is EOF if the end of file was read.
+ function Getc (File : File_Type) return Interfaces.C_Streams.int;
+ -- Gets next character from file, which has already been checked for being
+ -- in read status, and returns the character read if no error occurs. The
+ -- result is EOF if the end of file was read.
- procedure Get_Character
- (File : File_Type;
- Item : out Character);
+ procedure Get_Character (File : File_Type; Item : out Character);
-- This is essentially a copy of the normal Get routine from Text_IO. It
-- obtains a single character from the input file File, and places it in
-- Item. This character may be the leading character of a Wide_Character
@@ -491,25 +489,8 @@ private
-- read and is passed in C. The wide character value is returned as the
-- result, and the file pointer is bumped past the character.
- function Nextc (File : File_Type) return Integer;
- -- Returns next character from file without skipping past it (i.e. it
- -- is a combination of Getc followed by an Ungetc).
-
- procedure Putc (ch : Integer; File : File_Type);
- -- Outputs the given character to the file, which has already been
- -- checked for being in output status. Device_Error is raised if the
- -- character cannot be written.
-
- procedure Terminate_Line (File : File_Type);
- -- If the file is in Write_File or Append_File mode, and the current
- -- line is not terminated, then a line terminator is written using
- -- New_Line. Note that there is no Terminate_Page routine, because
- -- the page mark at the end of the file is implied if necessary.
-
- procedure Ungetc (ch : Integer; File : File_Type);
- -- Pushes back character into stream, using ungetc. The caller has
- -- checked that the file is in read status. Device_Error is raised
- -- if the character cannot be pushed back. An attempt to push back
- -- and end of file character (EOF) is ignored.
+ function Nextc (File : File_Type) return Interfaces.C_Streams.int;
+ -- Returns next character from file without skipping past it (i.e. it is a
+ -- combination of Getc followed by an Ungetc).
end Ada.Wide_Text_IO;
diff --git a/gcc/ada/a-wrstfi.adb b/gcc/ada/a-wrstfi.adb
new file mode 100644
index 00000000000..6b3f656b670
--- /dev/null
+++ b/gcc/ada/a-wrstfi.adb
@@ -0,0 +1,39 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT RUN-TIME COMPONENTS --
+-- --
+-- ADA.WIDE_TEXT_IO.RESET_STANDARD_FILES --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2009, 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. --
+-- --
+-- As a special exception 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/>. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-------------------------------------------
+-- Ada.Wide_Text_IO.Reset_Standard_Files --
+-------------------------------------------
+
+procedure Ada.Wide_Text_IO.Reset_Standard_Files is
+begin
+ Ada.Wide_Text_IO.Initialize_Standard_Files;
+end Ada.Wide_Text_IO.Reset_Standard_Files;
diff --git a/gcc/ada/a-wrstfi.ads b/gcc/ada/a-wrstfi.ads
new file mode 100644
index 00000000000..5d6548eadc5
--- /dev/null
+++ b/gcc/ada/a-wrstfi.ads
@@ -0,0 +1,41 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT RUN-TIME COMPONENTS --
+-- --
+-- ADA.WIDE_TEXT_IO.RESET_STANDARD_FILES --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2009, 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. --
+-- --
+-- As a special exception 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/>. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This package provides a reset routine that resets the standard files used
+-- by Ada.Wide_Text_IO. This is useful in systems such as VxWorks where
+-- Ada.Wide_Text_IO is elaborated at the program start, but a system restart
+-- may alter the status of these files, resulting in incorrect operation of
+-- Wide_Text_IO (in particular if the standard input file is changed to be
+-- interactive, then Get_Line may hang looking for an extra character after
+-- the end of the line.
+
+procedure Ada.Wide_Text_IO.Reset_Standard_Files;
+-- Reset standard Wide_Text_IO files as described above
diff --git a/gcc/ada/a-wtdeio.adb b/gcc/ada/a-wtdeio.adb
index 8d42e85d54e..598b72a941e 100644
--- a/gcc/ada/a-wtdeio.adb
+++ b/gcc/ada/a-wtdeio.adb
@@ -54,16 +54,10 @@ package body Ada.Wide_Text_IO.Decimal_IO is
is
begin
if Num'Size > Integer'Size then
- Item := Num (Aux.Get_LLD (TFT (File), Width, Scale));
- -- Item := Num'Fixed_Value (Aux.Get_LLD (TFT (File), Width, Scale));
- -- above is what we should write, but gets assert error ???
-
+ Item := Num'Fixed_Value (Aux.Get_LLD (TFT (File), Width, Scale));
else
- Item := Num (Aux.Get_Dec (TFT (File), Width, Scale));
- -- Item := Num'Fixed_Value (Aux.Get_Dec (TFT (File), Width, Scale));
- -- above is what we should write, but gets assert error ???
+ Item := Num'Fixed_Value (Aux.Get_Dec (TFT (File), Width, Scale));
end if;
-
exception
when Constraint_Error => raise Data_Error;
end Get;
diff --git a/gcc/ada/a-wtedit.adb b/gcc/ada/a-wtedit.adb
index dbe09a9df15..cc41dc1cd86 100644
--- a/gcc/ada/a-wtedit.adb
+++ b/gcc/ada/a-wtedit.adb
@@ -477,21 +477,17 @@ package body Ada.Wide_Text_IO.Editing is
raise Layout_Error;
end if;
- if Pic.Radix_Position = Invalid_Position then
- Position := Answer'Last;
- else
- Position := Pic.Radix_Position - 1;
- end if;
+ Position :=
+ (if Pic.Radix_Position = Invalid_Position then Answer'Last
+ else Pic.Radix_Position - 1);
for J in reverse Attrs.Start_Of_Int .. Attrs.End_Of_Int loop
-
while Answer (Position) /= '9'
and then
Answer (Position) /= Pic.Floater
loop
if Answer (Position) = '_' then
Answer (Position) := Separator_Character;
-
elsif Answer (Position) = 'b' then
Answer (Position) := ' ';
end if;
@@ -790,25 +786,22 @@ package body Ada.Wide_Text_IO.Editing is
-- No trailing digits, but now J may need to stick in a currency
-- symbol or sign.
- if Pic.Start_Currency = Invalid_Position then
- Position := Answer'Last + 1;
- else
- Position := Pic.Start_Currency;
- end if;
+ Position :=
+ (if Pic.Start_Currency = Invalid_Position then Answer'Last + 1
+ else Pic.Start_Currency);
end if;
for J in Position .. Answer'Last loop
-
if Pic.Start_Currency /= Invalid_Position and then
Answer (Pic.Start_Currency) = '#' then
Currency_Pos := 1;
end if;
- -- Note: There are some weird cases J can imagine with 'b' or '#'
- -- in currency strings where the following code will cause
- -- glitches. The trick is to tell when the character in the
- -- answer should be checked, and when to look at the original
- -- string. Some other time. RIE 11/26/96 ???
+ -- Note: There are some weird cases J can imagine with 'b' or '#' in
+ -- currency strings where the following code will cause glitches. The
+ -- trick is to tell when the character in the answer should be
+ -- checked, and when to look at the original string. Some other time.
+ -- RIE 11/26/96 ???
case Answer (J) is
when '*' =>
@@ -942,8 +935,9 @@ package body Ada.Wide_Text_IO.Editing is
-- 1) Expand $, replace '.' with Radix_Point
- return Answer (1 .. Currency_Pos - 1) & Currency_Symbol &
- Answer (Currency_Pos + 1 .. Answer'Last);
+ return
+ Answer (1 .. Currency_Pos - 1) & Currency_Symbol &
+ Answer (Currency_Pos + 1 .. Answer'Last);
else
-- 2) No currency expansion, replace '.' with Radix_Point
diff --git a/gcc/ada/a-zrstfi.adb b/gcc/ada/a-zrstfi.adb
new file mode 100755
index 00000000000..e0a7f64b662
--- /dev/null
+++ b/gcc/ada/a-zrstfi.adb
@@ -0,0 +1,39 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT RUN-TIME COMPONENTS --
+-- --
+-- ADA.WIDE_WIDE_TEXT_IO.RESET_STANDARD_FILES --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2009, 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. --
+-- --
+-- As a special exception 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/>. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+------------------------------------------------
+-- Ada.Wide_Wide_Text_IO.Reset_Standard_Files --
+------------------------------------------------
+
+procedure Ada.Wide_Wide_Text_IO.Reset_Standard_Files is
+begin
+ Ada.Wide_Wide_Text_IO.Initialize_Standard_Files;
+end Ada.Wide_Wide_Text_IO.Reset_Standard_Files;
diff --git a/gcc/ada/a-zrstfi.ads b/gcc/ada/a-zrstfi.ads
new file mode 100755
index 00000000000..80f2b1f2cdf
--- /dev/null
+++ b/gcc/ada/a-zrstfi.ads
@@ -0,0 +1,41 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT RUN-TIME COMPONENTS --
+-- --
+-- ADA.WIDE_WIDE_TEXT_IO.RESET_STANDARD_FILES --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2009, 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. --
+-- --
+-- As a special exception 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/>. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This package provides a reset routine that resets the standard files used
+-- by Ada.Wide_Wide_Text_IO. This is useful in systems such as VxWorks where
+-- Ada.Wide_Wide_Text_IO is elaborated at the program start, but a system
+-- restart may alter the status of these files, resulting in incorrect
+-- operation of Wide_Wide_Text_IO (in particular if the standard input file
+-- is changed to be interactive, then Get_Line may hang looking for an extra
+-- character after the end of the line.
+
+procedure Ada.Wide_Wide_Text_IO.Reset_Standard_Files;
+-- Reset standard Wide_Wide_Text_IO files as described above
diff --git a/gcc/ada/a-ztdeau.adb b/gcc/ada/a-ztdeau.adb
index b9feb4c1723..38450fcb011 100644
--- a/gcc/ada/a-ztdeau.adb
+++ b/gcc/ada/a-ztdeau.adb
@@ -244,11 +244,8 @@ package body Ada.Wide_Wide_Text_IO.Decimal_Aux is
Ptr : Natural := 0;
begin
- if Exp = 0 then
- Fore := To'Length - 1 - Aft;
- else
- Fore := To'Length - 2 - Aft - Exp;
- end if;
+ Fore :=
+ (if Exp = 0 then To'Length - 1 - Aft else To'Length - 2 - Aft - Exp);
if Fore < 1 then
raise Layout_Error;
diff --git a/gcc/ada/a-ztdeio.adb b/gcc/ada/a-ztdeio.adb
index cc61e8cbff9..52f8820a787 100644
--- a/gcc/ada/a-ztdeio.adb
+++ b/gcc/ada/a-ztdeio.adb
@@ -54,16 +54,10 @@ package body Ada.Wide_Wide_Text_IO.Decimal_IO is
is
begin
if Num'Size > Integer'Size then
- Item := Num (Aux.Get_LLD (TFT (File), Width, Scale));
- -- Item := Num'Fixed_Value (Aux.Get_LLD (TFT (File), Width, Scale));
- -- above is what we should write, but gets assert error ???
-
+ Item := Num'Fixed_Value (Aux.Get_LLD (TFT (File), Width, Scale));
else
- Item := Num (Aux.Get_Dec (TFT (File), Width, Scale));
- -- Item := Num'Fixed_Value (Aux.Get_Dec (TFT (File), Width, Scale));
- -- above is what we should write, but gets assert error ???
+ Item := Num'Fixed_Value (Aux.Get_Dec (TFT (File), Width, Scale));
end if;
-
exception
when Constraint_Error => raise Data_Error;
end Get;
diff --git a/gcc/ada/a-ztedit.adb b/gcc/ada/a-ztedit.adb
index 555e66491ef..9b5036a4d08 100644
--- a/gcc/ada/a-ztedit.adb
+++ b/gcc/ada/a-ztedit.adb
@@ -478,21 +478,17 @@ package body Ada.Wide_Wide_Text_IO.Editing is
raise Layout_Error;
end if;
- if Pic.Radix_Position = Invalid_Position then
- Position := Answer'Last;
- else
- Position := Pic.Radix_Position - 1;
- end if;
+ Position :=
+ (if Pic.Radix_Position = Invalid_Position then Answer'Last
+ else Pic.Radix_Position - 1);
for J in reverse Attrs.Start_Of_Int .. Attrs.End_Of_Int loop
-
while Answer (Position) /= '9'
and then
Answer (Position) /= Pic.Floater
loop
if Answer (Position) = '_' then
Answer (Position) := Separator_Character;
-
elsif Answer (Position) = 'b' then
Answer (Position) := ' ';
end if;
@@ -791,15 +787,12 @@ package body Ada.Wide_Wide_Text_IO.Editing is
-- No trailing digits, but now J may need to stick in a currency
-- symbol or sign.
- if Pic.Start_Currency = Invalid_Position then
- Position := Answer'Last + 1;
- else
- Position := Pic.Start_Currency;
- end if;
+ Position :=
+ (if Pic.Start_Currency = Invalid_Position then Answer'Last + 1
+ else Pic.Start_Currency);
end if;
for J in Position .. Answer'Last loop
-
if Pic.Start_Currency /= Invalid_Position and then
Answer (Pic.Start_Currency) = '#' then
Currency_Pos := 1;
diff --git a/gcc/ada/a-ztexio.adb b/gcc/ada/a-ztexio.adb
index 64ad87215db..8be8a91d9e2 100644
--- a/gcc/ada/a-ztexio.adb
+++ b/gcc/ada/a-ztexio.adb
@@ -57,26 +57,62 @@ package body Ada.Wide_Wide_Text_IO is
WC_Encoding : Character;
pragma Import (C, WC_Encoding, "__gl_wc_encoding");
+ -- Default wide character encoding
+
+ Err_Name : aliased String := "*stderr" & ASCII.NUL;
+ In_Name : aliased String := "*stdin" & ASCII.NUL;
+ Out_Name : aliased String := "*stdout" & ASCII.NUL;
+ -- Names of standard files
+ --
+ -- Use "preallocated" strings to avoid calling "new" during the elaboration
+ -- of the run time. This is needed in the tasking case to avoid calling
+ -- Task_Lock too early. A filename is expected to end with a null character
+ -- in the runtime, here the null characters are added just to have a
+ -- correct filename length.
+ --
+ -- Note: the names for these files are bogus, and probably it would be
+ -- better for these files to have no names, but the ACVC tests insist!
+ -- We use names that are bound to fail in open etc.
+
+ Null_Str : aliased constant String := "";
+ -- Used as form string for standard files
-----------------------
-- Local Subprograms --
-----------------------
- function Getc_Immed (File : File_Type) return int;
- -- This routine is identical to Getc, except that the read is done in
- -- Get_Immediate mode (i.e. without waiting for a line return).
-
function Get_Wide_Wide_Char_Immed
(C : Character;
File : File_Type) return Wide_Wide_Character;
-- This routine is identical to Get_Wide_Wide_Char, except that the reads
-- are done in Get_Immediate mode (i.e. without waiting for a line return).
+ function Getc_Immed (File : File_Type) return int;
+ -- This routine is identical to Getc, except that the read is done in
+ -- Get_Immediate mode (i.e. without waiting for a line return).
+
+ procedure Putc (ch : int; File : File_Type);
+ -- Outputs the given character to the file, which has already been checked
+ -- for being in output status. Device_Error is raised if the character
+ -- cannot be written.
+
procedure Set_WCEM (File : in out File_Type);
-- Called by Open and Create to set the wide character encoding method for
-- the file, processing a WCEM form parameter if one is present. File is
-- IN OUT because it may be closed in case of an error.
+ procedure Terminate_Line (File : File_Type);
+ -- If the file is in Write_File or Append_File mode, and the current line
+ -- is not terminated, then a line terminator is written using New_Line.
+ -- Note that there is no Terminate_Page routine, because the page mark at
+ -- the end of the file is implied if necessary.
+
+ procedure Ungetc (ch : int; File : File_Type);
+ -- Pushes back character into stream, using ungetc. The caller has checked
+ -- that the file is in read status. Device_Error is raised if the character
+ -- cannot be pushed back. An attempt to push back and end of file character
+ -- (EOF) is ignored.
+
-------------------
-- AFCB_Allocate --
-------------------
@@ -843,6 +879,52 @@ package body Ada.Wide_Wide_Text_IO is
return ch;
end Getc_Immed;
+ -------------------------------
+ -- Initialize_Standard_Files --
+ -------------------------------
+
+ procedure Initialize_Standard_Files is
+ begin
+ Standard_Err.Stream := stderr;
+ Standard_Err.Name := Err_Name'Access;
+ Standard_Err.Form := Null_Str'Unrestricted_Access;
+ Standard_Err.Mode := FCB.Out_File;
+ Standard_Err.Is_Regular_File := is_regular_file (fileno (stderr)) /= 0;
+ Standard_Err.Is_Temporary_File := False;
+ Standard_Err.Is_System_File := True;
+ Standard_Err.Is_Text_File := True;
+ Standard_Err.Access_Method := 'T';
+ Standard_Err.Self := Standard_Err;
+ Standard_Err.WC_Method := Default_WCEM;
+
+ Standard_In.Stream := stdin;
+ Standard_In.Name := In_Name'Access;
+ Standard_In.Form := Null_Str'Unrestricted_Access;
+ Standard_In.Mode := FCB.In_File;
+ Standard_In.Is_Regular_File := is_regular_file (fileno (stdin)) /= 0;
+ Standard_In.Is_Temporary_File := False;
+ Standard_In.Is_System_File := True;
+ Standard_In.Is_Text_File := True;
+ Standard_In.Access_Method := 'T';
+ Standard_In.Self := Standard_In;
+ Standard_In.WC_Method := Default_WCEM;
+
+ Standard_Out.Stream := stdout;
+ Standard_Out.Name := Out_Name'Access;
+ Standard_Out.Form := Null_Str'Unrestricted_Access;
+ Standard_Out.Mode := FCB.Out_File;
+ Standard_Out.Is_Regular_File := is_regular_file (fileno (stdout)) /= 0;
+ Standard_Out.Is_Temporary_File := False;
+ Standard_Out.Is_System_File := True;
+ Standard_Out.Is_Text_File := True;
+ Standard_Out.Access_Method := 'T';
+ Standard_Out.Self := Standard_Out;
+ Standard_Out.WC_Method := Default_WCEM;
+
+ FIO.Make_Unbuffered (AP (Standard_Out));
+ FIO.Make_Unbuffered (AP (Standard_Err));
+ end Initialize_Standard_Files;
+
-------------
-- Is_Open --
-------------
@@ -1840,20 +1922,8 @@ package body Ada.Wide_Wide_Text_IO is
set_text_mode (fileno (File.Stream));
end Write;
- -- Use "preallocated" strings to avoid calling "new" during the
- -- elaboration of the run time. This is needed in the tasking case to
- -- avoid calling Task_Lock too early. A filename is expected to end with
- -- a null character in the runtime, here the null characters are added
- -- just to have a correct filename length.
-
- Err_Name : aliased String := "*stderr" & ASCII.NUL;
- In_Name : aliased String := "*stdin" & ASCII.NUL;
- Out_Name : aliased String := "*stdout" & ASCII.NUL;
-
begin
- -------------------------------
- -- Initialize Standard Files --
- -------------------------------
+ -- Initialize Standard Files
for J in WC_Encoding_Method loop
if WC_Encoding = WC_Encoding_Letters (J) then
@@ -1861,51 +1931,10 @@ begin
end if;
end loop;
- -- Note: the names in these files are bogus, and probably it would be
- -- better for these files to have no names, but the ACVC test insist!
- -- We use names that are bound to fail in open etc.
-
- Standard_Err.Stream := stderr;
- Standard_Err.Name := Err_Name'Access;
- Standard_Err.Form := Null_Str'Unrestricted_Access;
- Standard_Err.Mode := FCB.Out_File;
- Standard_Err.Is_Regular_File := is_regular_file (fileno (stderr)) /= 0;
- Standard_Err.Is_Temporary_File := False;
- Standard_Err.Is_System_File := True;
- Standard_Err.Is_Text_File := True;
- Standard_Err.Access_Method := 'T';
- Standard_Err.Self := Standard_Err;
- Standard_Err.WC_Method := Default_WCEM;
-
- Standard_In.Stream := stdin;
- Standard_In.Name := In_Name'Access;
- Standard_In.Form := Null_Str'Unrestricted_Access;
- Standard_In.Mode := FCB.In_File;
- Standard_In.Is_Regular_File := is_regular_file (fileno (stdin)) /= 0;
- Standard_In.Is_Temporary_File := False;
- Standard_In.Is_System_File := True;
- Standard_In.Is_Text_File := True;
- Standard_In.Access_Method := 'T';
- Standard_In.Self := Standard_In;
- Standard_In.WC_Method := Default_WCEM;
-
- Standard_Out.Stream := stdout;
- Standard_Out.Name := Out_Name'Access;
- Standard_Out.Form := Null_Str'Unrestricted_Access;
- Standard_Out.Mode := FCB.Out_File;
- Standard_Out.Is_Regular_File := is_regular_file (fileno (stdout)) /= 0;
- Standard_Out.Is_Temporary_File := False;
- Standard_Out.Is_System_File := True;
- Standard_Out.Is_Text_File := True;
- Standard_Out.Access_Method := 'T';
- Standard_Out.Self := Standard_Out;
- Standard_Out.WC_Method := Default_WCEM;
+ Initialize_Standard_Files;
FIO.Chain_File (AP (Standard_In));
FIO.Chain_File (AP (Standard_Out));
FIO.Chain_File (AP (Standard_Err));
- FIO.Make_Unbuffered (AP (Standard_Out));
- FIO.Make_Unbuffered (AP (Standard_Err));
-
end Ada.Wide_Wide_Text_IO;
diff --git a/gcc/ada/a-ztexio.ads b/gcc/ada/a-ztexio.ads
index 81ab9924775..6c75acd1936 100644
--- a/gcc/ada/a-ztexio.ads
+++ b/gcc/ada/a-ztexio.ads
@@ -42,6 +42,9 @@
with Ada.IO_Exceptions;
with Ada.Streams;
+
+with Interfaces.C_Streams;
+
with System;
with System.File_Control_Block;
with System.WCh_Con;
@@ -357,13 +360,13 @@ private
PM : constant := Character'Pos (ASCII.FF);
-- Used as page mark, except at end of file where it is implied
- -------------------------------------
+ ------------------------------------------
-- Wide_Wide_Text_IO File Control Block --
- -------------------------------------
+ ------------------------------------------
Default_WCEM : WCh_Con.WC_Encoding_Method := WCh_Con.WCEM_UTF8;
- -- This gets modified during initialization (see body) using
- -- the default value established in the call to Set_Globals.
+ -- This gets modified during initialization (see body) using the default
+ -- value established in the call to Set_Globals.
package FCB renames System.File_Control_Block;
@@ -443,9 +446,6 @@ private
-- The Standard Files --
------------------------
- Null_Str : aliased constant String := "";
- -- Used as name and form of standard files
-
Standard_Err_AFCB : aliased Wide_Wide_Text_AFCB;
Standard_In_AFCB : aliased Wide_Wide_Text_AFCB;
Standard_Out_AFCB : aliased Wide_Wide_Text_AFCB;
@@ -460,31 +460,28 @@ private
Current_Err : aliased File_Type := Standard_Err;
-- Current files
+ procedure Initialize_Standard_Files;
+ -- Initializes the file control blocks for the standard files. Called from
+ -- the elaboration routine for this package, and from Reset_Standard_Files
+ -- in package Ada.Wide_Wide_Text_IO.Reset_Standard_Files.
+
-----------------------
-- Local Subprograms --
-----------------------
-- These subprograms are in the private part of the spec so that they can
- -- be shared by the routines in the body of Ada.Text_IO.Wide_Wide_Text_IO.
-
- -- Note: we use Integer in these declarations instead of the more accurate
- -- Interfaces.C_Streams.int, because we do not want to drag in the spec of
- -- this interfaces package with the spec of Ada.Text_IO, and we know that
- -- in fact these types are identical
+ -- be shared by the children of Ada.Text_IO.Wide_Wide_Text_IO.
- function Getc (File : File_Type) return Integer;
- -- Gets next character from file, which has already been checked for
- -- being in read status, and returns the character read if no error
- -- occurs. The result is EOF if the end of file was read.
+ function Getc (File : File_Type) return Interfaces.C_Streams.int;
+ -- Gets next character from file, which has already been checked for being
+ -- in read status, and returns the character read if no error occurs. The
+ -- result is EOF if the end of file was read.
- procedure Get_Character
- (File : File_Type;
- Item : out Character);
- -- This is essentially a copy of the normal Get routine from Text_IO. It
+ procedure Get_Character (File : File_Type; Item : out Character);
+ -- This is essentially copy of Wide_Wide_Text_IO.Get. It obtains a single
-- obtains a single character from the input file File, and places it in
- -- Item. This character may be the leading character of a
- -- Wide_Wide_Character sequence, but that is up to the caller to deal
- -- with.
+ -- Item. This result may be the leading character of a Wide_Wide_Character
+ -- sequence, but that is up to the caller to deal with.
function Get_Wide_Wide_Char
(C : Character;
@@ -494,25 +491,8 @@ private
-- read and is passed in C. The wide character value is returned as the
-- result, and the file pointer is bumped past the character.
- function Nextc (File : File_Type) return Integer;
- -- Returns next character from file without skipping past it (i.e. it
- -- is a combination of Getc followed by an Ungetc).
-
- procedure Putc (ch : Integer; File : File_Type);
- -- Outputs the given character to the file, which has already been
- -- checked for being in output status. Device_Error is raised if the
- -- character cannot be written.
-
- procedure Terminate_Line (File : File_Type);
- -- If the file is in Write_File or Append_File mode, and the current
- -- line is not terminated, then a line terminator is written using
- -- New_Line. Note that there is no Terminate_Page routine, because
- -- the page mark at the end of the file is implied if necessary.
-
- procedure Ungetc (ch : Integer; File : File_Type);
- -- Pushes back character into stream, using ungetc. The caller has
- -- checked that the file is in read status. Device_Error is raised
- -- if the character cannot be pushed back. An attempt to push back
- -- and end of file character (EOF) is ignored.
+ function Nextc (File : File_Type) return Interfaces.C_Streams.int;
+ -- Returns next character from file without skipping past it (i.e. it is a
+ -- combination of Getc followed by an Ungetc).
end Ada.Wide_Wide_Text_IO;
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index c3405daaf44..5bce387d2bb 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -324,6 +324,12 @@ const int __gnat_vmsp = 0;
#endif
+/* Used for Ada bindings */
+const int __gnat_size_of_file_attributes = sizeof (struct file_attributes);
+
+/* Reset the file attributes as if no system call had been performed */
+void __gnat_stat_to_attr (int fd, char* name, struct file_attributes* attr);
+
/* The __gnat_max_path_len variable is used to export the maximum
length of a path name to Ada code. max_path_len is also provided
for compatibility with older GNAT versions, please do not use
@@ -371,6 +377,24 @@ to_ptr32 (char **ptr64)
#define MAYBE_TO_PTR32(argv) argv
#endif
+void
+__gnat_reset_attributes
+ (struct file_attributes* attr)
+{
+ attr->exists = -1;
+
+ attr->writable = -1;
+ attr->readable = -1;
+ attr->executable = -1;
+
+ attr->regular = -1;
+ attr->symbolic_link = -1;
+ attr->directory = -1;
+
+ attr->timestamp = (OS_Time)-2;
+ attr->file_length = -1;
+}
+
OS_Time
__gnat_current_time
(void)
@@ -923,6 +947,28 @@ __gnat_create_output_file (char *path)
}
int
+__gnat_create_output_file_new (char *path)
+{
+ int fd;
+#if defined (VMS)
+ fd = open (path, O_WRONLY | O_CREAT | O_TRUNC | O_TEXT | O_EXCL, PERM,
+ "rfm=stmlf", "ctx=rec", "rat=none", "rop=nlk",
+ "shr=del,get,put,upd");
+#elif defined (__MINGW32__)
+ {
+ TCHAR wpath[GNAT_MAX_PATH_LEN];
+
+ S2WSC (wpath, path, GNAT_MAX_PATH_LEN);
+ fd = _topen (wpath, O_WRONLY | O_CREAT | O_TRUNC | O_TEXT | O_EXCL, PERM);
+ }
+#else
+ fd = open (path, O_WRONLY | O_CREAT | O_TRUNC | O_TEXT | O_EXCL, PERM);
+#endif
+
+ return fd < 0 ? -1 : fd;
+}
+
+int
__gnat_open_append (char *path, int fmode)
{
int fd;
@@ -1014,42 +1060,89 @@ __gnat_open_new_temp (char *path, int fmode)
return fd < 0 ? -1 : fd;
}
-/* Return the number of bytes in the specified file. */
+/****************************************************************
+ ** Perform a call to GNAT_STAT or GNAT_FSTAT, and extract as much information
+ ** as possible from it, storing the result in a cache for later reuse
+ ****************************************************************/
-long
-__gnat_file_length (int fd)
+void
+__gnat_stat_to_attr (int fd, char* name, struct file_attributes* attr)
{
- int ret;
GNAT_STRUCT_STAT statbuf;
+ int ret;
- ret = GNAT_FSTAT (fd, &statbuf);
- if (ret || !S_ISREG (statbuf.st_mode))
- return 0;
+ if (fd != -1)
+ ret = GNAT_FSTAT (fd, &statbuf);
+ else
+ ret = __gnat_stat (name, &statbuf);
+
+ attr->regular = (!ret && S_ISREG (statbuf.st_mode));
+ attr->directory = (!ret && S_ISDIR (statbuf.st_mode));
+
+ if (!attr->regular)
+ attr->file_length = 0;
+ else
+ /* st_size may be 32 bits, or 64 bits which is converted to long. We
+ don't return a useful value for files larger than 2 gigabytes in
+ either case. */
+ attr->file_length = statbuf.st_size; /* all systems */
+
+#ifndef __MINGW32__
+ /* on Windows requires extra system call, see comment in __gnat_file_exists_attr */
+ attr->exists = !ret;
+#endif
- /* st_size may be 32 bits, or 64 bits which is converted to long. We
- don't return a useful value for files larger than 2 gigabytes in
- either case. */
+#if !defined (_WIN32) || defined (RTX)
+ /* on Windows requires extra system call, see __gnat_is_readable_file_attr */
+ attr->readable = (!ret && (statbuf.st_mode & S_IRUSR));
+ attr->writable = (!ret && (statbuf.st_mode & S_IWUSR));
+ attr->executable = (!ret && (statbuf.st_mode & S_IXUSR));
+#endif
+
+#if !defined (__EMX__) && !defined (MSDOS) && (!defined (_WIN32) || defined (RTX))
+ /* on Windows requires extra system call, see __gnat_file_time_name_attr */
+ if (ret != 0) {
+ attr->timestamp = (OS_Time)-1;
+ } else {
+#ifdef VMS
+ /* VMS has file versioning. */
+ attr->timestamp = (OS_Time)statbuf.st_ctime;
+#else
+ attr->timestamp = (OS_Time)statbuf.st_mtime;
+#endif
+ }
+#endif
- return (statbuf.st_size);
}
-/* Return the number of bytes in the specified named file. */
+/****************************************************************
+ ** Return the number of bytes in the specified file
+ ****************************************************************/
long
-__gnat_named_file_length (char *name)
+__gnat_file_length_attr (int fd, char* name, struct file_attributes* attr)
{
- int ret;
- GNAT_STRUCT_STAT statbuf;
+ if (attr->file_length == -1) {
+ __gnat_stat_to_attr (fd, name, attr);
+ }
- ret = __gnat_stat (name, &statbuf);
- if (ret || !S_ISREG (statbuf.st_mode))
- return 0;
+ return attr->file_length;
+}
- /* st_size may be 32 bits, or 64 bits which is converted to long. We
- don't return a useful value for files larger than 2 gigabytes in
- either case. */
+long
+__gnat_file_length (int fd)
+{
+ struct file_attributes attr;
+ __gnat_reset_attributes (&attr);
+ return __gnat_file_length_attr (fd, NULL, &attr);
+}
- return (statbuf.st_size);
+long
+__gnat_named_file_length (char *name)
+{
+ struct file_attributes attr;
+ __gnat_reset_attributes (&attr);
+ return __gnat_file_length_attr (-1, name, &attr);
}
/* Create a temporary filename and put it in string pointed to by
@@ -1244,137 +1337,136 @@ win32_filetime (HANDLE h)
/* Return a GNAT time stamp given a file name. */
OS_Time
-__gnat_file_time_name (char *name)
+__gnat_file_time_name_attr (char* name, struct file_attributes* attr)
{
-
+ if (attr->timestamp == (OS_Time)-2) {
#if defined (__EMX__) || defined (MSDOS)
- int fd = open (name, O_RDONLY | O_BINARY);
- time_t ret = __gnat_file_time_fd (fd);
- close (fd);
- return (OS_Time)ret;
+ int fd = open (name, O_RDONLY | O_BINARY);
+ time_t ret = __gnat_file_time_fd (fd);
+ close (fd);
+ attr->timestamp = (OS_Time)ret;
#elif defined (_WIN32) && !defined (RTX)
- time_t ret = -1;
- TCHAR wname[GNAT_MAX_PATH_LEN];
-
- S2WSC (wname, name, GNAT_MAX_PATH_LEN);
+ time_t ret = -1;
+ TCHAR wname[GNAT_MAX_PATH_LEN];
+ S2WSC (wname, name, GNAT_MAX_PATH_LEN);
- HANDLE h = CreateFile
- (wname, GENERIC_READ, FILE_SHARE_READ, 0,
- OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
+ HANDLE h = CreateFile
+ (wname, GENERIC_READ, FILE_SHARE_READ, 0,
+ OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
- if (h != INVALID_HANDLE_VALUE)
- {
- ret = win32_filetime (h);
- CloseHandle (h);
- }
- return (OS_Time) ret;
-#else
- GNAT_STRUCT_STAT statbuf;
- if (__gnat_stat (name, &statbuf) != 0) {
- return (OS_Time)-1;
- } else {
-#ifdef VMS
- /* VMS has file versioning. */
- return (OS_Time)statbuf.st_ctime;
+ if (h != INVALID_HANDLE_VALUE) {
+ ret = win32_filetime (h);
+ CloseHandle (h);
+ }
+ attr->timestamp = (OS_Time) ret;
#else
- return (OS_Time)statbuf.st_mtime;
+ __gnat_stat_to_attr (-1, name, attr);
#endif
}
-#endif
+ return attr->timestamp;
+}
+
+OS_Time
+__gnat_file_time_name (char *name)
+{
+ struct file_attributes attr;
+ __gnat_reset_attributes (&attr);
+ return __gnat_file_time_name_attr (name, &attr);
}
/* Return a GNAT time stamp given a file descriptor. */
OS_Time
-__gnat_file_time_fd (int fd)
+__gnat_file_time_fd_attr (int fd, struct file_attributes* attr)
{
- /* The following workaround code is due to the fact that under EMX and
- DJGPP fstat attempts to convert time values to GMT rather than keep the
- actual OS timestamp of the file. By using the OS2/DOS functions directly
- the GNAT timestamp are independent of this behavior, which is desired to
- facilitate the distribution of GNAT compiled libraries. */
+ if (attr->timestamp == (OS_Time)-2) {
+ /* The following workaround code is due to the fact that under EMX and
+ DJGPP fstat attempts to convert time values to GMT rather than keep the
+ actual OS timestamp of the file. By using the OS2/DOS functions directly
+ the GNAT timestamp are independent of this behavior, which is desired to
+ facilitate the distribution of GNAT compiled libraries. */
#if defined (__EMX__) || defined (MSDOS)
#ifdef __EMX__
- FILESTATUS fs;
- int ret = DosQueryFileInfo (fd, 1, (unsigned char *) &fs,
- sizeof (FILESTATUS));
+ FILESTATUS fs;
+ int ret = DosQueryFileInfo (fd, 1, (unsigned char *) &fs,
+ sizeof (FILESTATUS));
- unsigned file_year = fs.fdateLastWrite.year;
- unsigned file_month = fs.fdateLastWrite.month;
- unsigned file_day = fs.fdateLastWrite.day;
- unsigned file_hour = fs.ftimeLastWrite.hours;
- unsigned file_min = fs.ftimeLastWrite.minutes;
- unsigned file_tsec = fs.ftimeLastWrite.twosecs;
+ unsigned file_year = fs.fdateLastWrite.year;
+ unsigned file_month = fs.fdateLastWrite.month;
+ unsigned file_day = fs.fdateLastWrite.day;
+ unsigned file_hour = fs.ftimeLastWrite.hours;
+ unsigned file_min = fs.ftimeLastWrite.minutes;
+ unsigned file_tsec = fs.ftimeLastWrite.twosecs;
#else
- struct ftime fs;
- int ret = getftime (fd, &fs);
+ struct ftime fs;
+ int ret = getftime (fd, &fs);
- unsigned file_year = fs.ft_year;
- unsigned file_month = fs.ft_month;
- unsigned file_day = fs.ft_day;
- unsigned file_hour = fs.ft_hour;
- unsigned file_min = fs.ft_min;
- unsigned file_tsec = fs.ft_tsec;
+ unsigned file_year = fs.ft_year;
+ unsigned file_month = fs.ft_month;
+ unsigned file_day = fs.ft_day;
+ unsigned file_hour = fs.ft_hour;
+ unsigned file_min = fs.ft_min;
+ unsigned file_tsec = fs.ft_tsec;
#endif
- /* Calculate the seconds since epoch from the time components. First count
- the whole days passed. The value for years returned by the DOS and OS2
- functions count years from 1980, so to compensate for the UNIX epoch which
- begins in 1970 start with 10 years worth of days and add days for each
- four year period since then. */
+ /* Calculate the seconds since epoch from the time components. First count
+ the whole days passed. The value for years returned by the DOS and OS2
+ functions count years from 1980, so to compensate for the UNIX epoch which
+ begins in 1970 start with 10 years worth of days and add days for each
+ four year period since then. */
- time_t tot_secs;
- int cum_days[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
- int days_passed = 3652 + (file_year / 4) * 1461;
- int years_since_leap = file_year % 4;
+ time_t tot_secs;
+ int cum_days[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
+ int days_passed = 3652 + (file_year / 4) * 1461;
+ int years_since_leap = file_year % 4;
- if (years_since_leap == 1)
- days_passed += 366;
- else if (years_since_leap == 2)
- days_passed += 731;
- else if (years_since_leap == 3)
- days_passed += 1096;
+ if (years_since_leap == 1)
+ days_passed += 366;
+ else if (years_since_leap == 2)
+ days_passed += 731;
+ else if (years_since_leap == 3)
+ days_passed += 1096;
- if (file_year > 20)
- days_passed -= 1;
+ if (file_year > 20)
+ days_passed -= 1;
- days_passed += cum_days[file_month - 1];
- if (years_since_leap == 0 && file_year != 20 && file_month > 2)
- days_passed++;
+ days_passed += cum_days[file_month - 1];
+ if (years_since_leap == 0 && file_year != 20 && file_month > 2)
+ days_passed++;
- days_passed += file_day - 1;
+ days_passed += file_day - 1;
- /* OK - have whole days. Multiply -- then add in other parts. */
+ /* OK - have whole days. Multiply -- then add in other parts. */
- tot_secs = days_passed * 86400;
- tot_secs += file_hour * 3600;
- tot_secs += file_min * 60;
- tot_secs += file_tsec * 2;
- return (OS_Time) tot_secs;
+ tot_secs = days_passed * 86400;
+ tot_secs += file_hour * 3600;
+ tot_secs += file_min * 60;
+ tot_secs += file_tsec * 2;
+ attr->timestamp = (OS_Time) tot_secs;
#elif defined (_WIN32) && !defined (RTX)
- HANDLE h = (HANDLE) _get_osfhandle (fd);
- time_t ret = win32_filetime (h);
- return (OS_Time) ret;
+ HANDLE h = (HANDLE) _get_osfhandle (fd);
+ time_t ret = win32_filetime (h);
+ attr->timestamp = (OS_Time) ret;
#else
- GNAT_STRUCT_STAT statbuf;
-
- if (GNAT_FSTAT (fd, &statbuf) != 0) {
- return (OS_Time) -1;
- } else {
-#ifdef VMS
- /* VMS has file versioning. */
- return (OS_Time) statbuf.st_ctime;
-#else
- return (OS_Time) statbuf.st_mtime;
-#endif
- }
+ __gnat_stat_to_attr (fd, NULL, attr);
#endif
+ }
+
+ return attr->timestamp;
+}
+
+OS_Time
+__gnat_file_time_fd (int fd)
+{
+ struct file_attributes attr;
+ __gnat_reset_attributes (&attr);
+ return __gnat_file_time_fd_attr (fd, &attr);
}
/* Set the file time stamp. */
@@ -1700,24 +1792,41 @@ __gnat_stat (char *name, GNAT_STRUCT_STAT *statbuf)
#endif
}
+/*************************************************************************
+ ** Check whether a file exists
+ *************************************************************************/
+
int
-__gnat_file_exists (char *name)
+__gnat_file_exists_attr (char* name, struct file_attributes* attr)
{
+ if (attr->exists == -1) {
#ifdef __MINGW32__
- /* On Windows do not use __gnat_stat() because a bug in Microsoft
- _stat() routine. When the system time-zone is set with a negative
- offset the _stat() routine fails on specific files like CON: */
- TCHAR wname [GNAT_MAX_PATH_LEN + 2];
-
- S2WSC (wname, name, GNAT_MAX_PATH_LEN + 2);
- return GetFileAttributes (wname) != INVALID_FILE_ATTRIBUTES;
+ /* On Windows do not use __gnat_stat() because of a bug in Microsoft
+ _stat() routine. When the system time-zone is set with a negative
+ offset the _stat() routine fails on specific files like CON: */
+ TCHAR wname [GNAT_MAX_PATH_LEN + 2];
+ S2WSC (wname, name, GNAT_MAX_PATH_LEN + 2);
+ attr->exists = GetFileAttributes (wname) != INVALID_FILE_ATTRIBUTES;
#else
- GNAT_STRUCT_STAT statbuf;
-
- return !__gnat_stat (name, &statbuf);
+ __gnat_stat_to_attr (-1, name, attr);
#endif
+ }
+
+ return attr->exists;
+}
+
+int
+__gnat_file_exists (char *name)
+{
+ struct file_attributes attr;
+ __gnat_reset_attributes (&attr);
+ return __gnat_file_exists_attr (name, &attr);
}
+/**********************************************************************
+ ** Whether name is an absolute path
+ **********************************************************************/
+
int
__gnat_is_absolute_path (char *name, int length)
{
@@ -1754,23 +1863,39 @@ __gnat_is_absolute_path (char *name, int length)
}
int
+__gnat_is_regular_file_attr (char* name, struct file_attributes* attr)
+{
+ if (attr->regular == -1) {
+ __gnat_stat_to_attr (-1, name, attr);
+ }
+
+ return attr->regular;
+}
+
+int
__gnat_is_regular_file (char *name)
{
- int ret;
- GNAT_STRUCT_STAT statbuf;
+ struct file_attributes attr;
+ __gnat_reset_attributes (&attr);
+ return __gnat_is_regular_file_attr (name, &attr);
+}
- ret = __gnat_stat (name, &statbuf);
- return (!ret && S_ISREG (statbuf.st_mode));
+int
+__gnat_is_directory_attr (char* name, struct file_attributes* attr)
+{
+ if (attr->directory == -1) {
+ __gnat_stat_to_attr (-1, name, attr);
+ }
+
+ return attr->directory;
}
int
__gnat_is_directory (char *name)
{
- int ret;
- GNAT_STRUCT_STAT statbuf;
-
- ret = __gnat_stat (name, &statbuf);
- return (!ret && S_ISDIR (statbuf.st_mode));
+ struct file_attributes attr;
+ __gnat_reset_attributes (&attr);
+ return __gnat_is_directory_attr (name, &attr);
}
#if defined (_WIN32) && !defined (RTX)
@@ -1964,95 +2089,111 @@ __gnat_can_use_acl (TCHAR *wname)
#endif /* defined (_WIN32) && !defined (RTX) */
int
-__gnat_is_readable_file (char *name)
+__gnat_is_readable_file_attr (char* name, struct file_attributes* attr)
{
+ if (attr->readable == -1) {
#if defined (_WIN32) && !defined (RTX)
- TCHAR wname [GNAT_MAX_PATH_LEN + 2];
- GENERIC_MAPPING GenericMapping;
-
- S2WSC (wname, name, GNAT_MAX_PATH_LEN + 2);
-
- if (__gnat_can_use_acl (wname))
- {
- ZeroMemory (&GenericMapping, sizeof (GENERIC_MAPPING));
- GenericMapping.GenericRead = GENERIC_READ;
+ TCHAR wname [GNAT_MAX_PATH_LEN + 2];
+ GENERIC_MAPPING GenericMapping;
- return __gnat_check_OWNER_ACL (wname, FILE_READ_DATA, GenericMapping);
- }
- else
- return GetFileAttributes (wname) != INVALID_FILE_ATTRIBUTES;
+ S2WSC (wname, name, GNAT_MAX_PATH_LEN + 2);
+ if (__gnat_can_use_acl (wname))
+ {
+ ZeroMemory (&GenericMapping, sizeof (GENERIC_MAPPING));
+ GenericMapping.GenericRead = GENERIC_READ;
+ attr->readable = __gnat_check_OWNER_ACL (wname, FILE_READ_DATA, GenericMapping);
+ }
+ else
+ attr->readable = GetFileAttributes (wname) != INVALID_FILE_ATTRIBUTES;
#else
- int ret;
- int mode;
- GNAT_STRUCT_STAT statbuf;
-
- ret = GNAT_STAT (name, &statbuf);
- mode = statbuf.st_mode & S_IRUSR;
- return (!ret && mode);
+ __gnat_stat_to_attr (-1, name, attr);
#endif
+ }
+
+ return attr->readable;
}
int
-__gnat_is_writable_file (char *name)
+__gnat_is_readable_file (char *name)
{
+ struct file_attributes attr;
+ __gnat_reset_attributes (&attr);
+ return __gnat_is_readable_file_attr (name, &attr);
+}
+
+int
+__gnat_is_writable_file_attr (char* name, struct file_attributes* attr)
+{
+ if (attr->writable == -1) {
#if defined (_WIN32) && !defined (RTX)
- TCHAR wname [GNAT_MAX_PATH_LEN + 2];
- GENERIC_MAPPING GenericMapping;
+ TCHAR wname [GNAT_MAX_PATH_LEN + 2];
+ GENERIC_MAPPING GenericMapping;
- S2WSC (wname, name, GNAT_MAX_PATH_LEN + 2);
+ S2WSC (wname, name, GNAT_MAX_PATH_LEN + 2);
- if (__gnat_can_use_acl (wname))
- {
- ZeroMemory (&GenericMapping, sizeof (GENERIC_MAPPING));
- GenericMapping.GenericWrite = GENERIC_WRITE;
+ if (__gnat_can_use_acl (wname))
+ {
+ ZeroMemory (&GenericMapping, sizeof (GENERIC_MAPPING));
+ GenericMapping.GenericWrite = GENERIC_WRITE;
- return __gnat_check_OWNER_ACL
- (wname, FILE_WRITE_DATA | FILE_APPEND_DATA, GenericMapping)
- && !(GetFileAttributes (wname) & FILE_ATTRIBUTE_READONLY);
- }
- else
- return !(GetFileAttributes (wname) & FILE_ATTRIBUTE_READONLY);
+ attr->writable = __gnat_check_OWNER_ACL
+ (wname, FILE_WRITE_DATA | FILE_APPEND_DATA, GenericMapping)
+ && !(GetFileAttributes (wname) & FILE_ATTRIBUTE_READONLY);
+ }
+ else
+ attr->writable = !(GetFileAttributes (wname) & FILE_ATTRIBUTE_READONLY);
#else
- int ret;
- int mode;
- GNAT_STRUCT_STAT statbuf;
-
- ret = GNAT_STAT (name, &statbuf);
- mode = statbuf.st_mode & S_IWUSR;
- return (!ret && mode);
+ __gnat_stat_to_attr (-1, name, attr);
#endif
+ }
+
+ return attr->writable;
}
int
-__gnat_is_executable_file (char *name)
+__gnat_is_writable_file (char *name)
+{
+ struct file_attributes attr;
+ __gnat_reset_attributes (&attr);
+ return __gnat_is_writable_file_attr (name, &attr);
+}
+
+int
+__gnat_is_executable_file_attr (char* name, struct file_attributes* attr)
{
+ if (attr->executable == -1) {
#if defined (_WIN32) && !defined (RTX)
- TCHAR wname [GNAT_MAX_PATH_LEN + 2];
- GENERIC_MAPPING GenericMapping;
+ TCHAR wname [GNAT_MAX_PATH_LEN + 2];
+ GENERIC_MAPPING GenericMapping;
- S2WSC (wname, name, GNAT_MAX_PATH_LEN + 2);
+ S2WSC (wname, name, GNAT_MAX_PATH_LEN + 2);
- if (__gnat_can_use_acl (wname))
- {
- ZeroMemory (&GenericMapping, sizeof (GENERIC_MAPPING));
- GenericMapping.GenericExecute = GENERIC_EXECUTE;
+ if (__gnat_can_use_acl (wname))
+ {
+ ZeroMemory (&GenericMapping, sizeof (GENERIC_MAPPING));
+ GenericMapping.GenericExecute = GENERIC_EXECUTE;
- return __gnat_check_OWNER_ACL (wname, FILE_EXECUTE, GenericMapping);
- }
- else
- return GetFileAttributes (wname) != INVALID_FILE_ATTRIBUTES
- && _tcsstr (wname, _T(".exe")) - wname == (int) (_tcslen (wname) - 4);
+ attr->executable = __gnat_check_OWNER_ACL (wname, FILE_EXECUTE, GenericMapping);
+ }
+ else
+ attr->executable = GetFileAttributes (wname) != INVALID_FILE_ATTRIBUTES
+ && _tcsstr (wname, _T(".exe")) - wname == (int) (_tcslen (wname) - 4);
#else
- int ret;
- int mode;
- GNAT_STRUCT_STAT statbuf;
-
- ret = GNAT_STAT (name, &statbuf);
- mode = statbuf.st_mode & S_IXUSR;
- return (!ret && mode);
+ __gnat_stat_to_attr (-1, name, attr);
#endif
+ }
+
+ return attr->executable;
+}
+
+int
+__gnat_is_executable_file (char *name)
+{
+ struct file_attributes attr;
+ __gnat_reset_attributes (&attr);
+ return __gnat_is_executable_file_attr (name, &attr);
}
void
@@ -2171,21 +2312,31 @@ __gnat_set_non_readable (char *name)
}
int
-__gnat_is_symbolic_link (char *name ATTRIBUTE_UNUSED)
+__gnat_is_symbolic_link_attr (char* name, struct file_attributes* attr)
{
+ if (attr->symbolic_link == -1) {
#if defined (__vxworks) || defined (__nucleus__)
- return 0;
+ attr->symbolic_link = 0;
#elif defined (_AIX) || defined (__APPLE__) || defined (__unix__)
- int ret;
- GNAT_STRUCT_STAT statbuf;
-
- ret = GNAT_LSTAT (name, &statbuf);
- return (!ret && S_ISLNK (statbuf.st_mode));
-
+ int ret;
+ GNAT_STRUCT_STAT statbuf;
+ ret = GNAT_LSTAT (name, &statbuf);
+ attr->symbolic_link = (!ret && S_ISLNK (statbuf.st_mode));
#else
- return 0;
+ attr->symbolic_link = 0;
#endif
+ }
+ return attr->symbolic_link;
+}
+
+int
+__gnat_is_symbolic_link (char *name ATTRIBUTE_UNUSED)
+{
+ struct file_attributes attr;
+ __gnat_reset_attributes (&attr);
+ return __gnat_is_symbolic_link_attr (name, &attr);
+
}
#if defined (sun) && defined (__SVR4)
diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h
index 79a1e4eb4bd..76a181a001c 100644
--- a/gcc/ada/adaint.h
+++ b/gcc/ada/adaint.h
@@ -68,6 +68,30 @@ typedef long long OS_Time;
typedef long OS_Time;
#endif
+/* A lazy cache for the attributes of a file. On some systems, a single call to
+ stat() will give all this information, so it is better than doing a system
+ call every time. On other systems this require several system calls.
+*/
+
+struct file_attributes {
+ short exists;
+
+ short writable;
+ short readable;
+ short executable;
+
+ short symbolic_link;
+ short regular;
+ short directory;
+
+ OS_Time timestamp;
+ long file_length;
+};
+/* WARNING: changing the size here might require changing the constant
+ * File_Attributes_Size in osint.ads (which should be big enough to
+ * fit the above struct on any system)
+ */
+
extern int __gnat_max_path_len;
extern OS_Time __gnat_current_time (void);
extern void __gnat_current_time_string (char *);
@@ -121,15 +145,28 @@ extern OS_Time __gnat_file_time_fd (int);
extern void __gnat_set_file_time_name (char *, time_t);
-extern int __gnat_dup (int);
-extern int __gnat_dup2 (int, int);
-extern int __gnat_file_exists (char *);
-extern int __gnat_is_regular_file (char *);
-extern int __gnat_is_absolute_path (char *,int);
-extern int __gnat_is_directory (char *);
+extern int __gnat_dup (int);
+extern int __gnat_dup2 (int, int);
+extern int __gnat_file_exists (char *);
+extern int __gnat_is_regular_file (char *);
+extern int __gnat_is_absolute_path (char *,int);
+extern int __gnat_is_directory (char *);
extern int __gnat_is_writable_file (char *);
extern int __gnat_is_readable_file (char *name);
-extern int __gnat_is_executable_file (char *name);
+extern int __gnat_is_executable_file (char *name);
+
+extern void __gnat_reset_attributes (struct file_attributes* attr);
+extern long __gnat_file_length_attr (int, char *, struct file_attributes *);
+extern OS_Time __gnat_file_time_name_attr (char *, struct file_attributes *);
+extern OS_Time __gnat_file_time_fd_attr (int, struct file_attributes *);
+extern int __gnat_file_exists_attr (char *, struct file_attributes *);
+extern int __gnat_is_regular_file_attr (char *, struct file_attributes *);
+extern int __gnat_is_directory_attr (char *, struct file_attributes *);
+extern int __gnat_is_readable_file_attr (char *, struct file_attributes *);
+extern int __gnat_is_writable_file_attr (char *, struct file_attributes *);
+extern int __gnat_is_executable_file_attr (char *, struct file_attributes *);
+extern int __gnat_is_symbolic_link_attr (char *, struct file_attributes *);
+
extern void __gnat_set_non_writable (char *name);
extern void __gnat_set_writable (char *name);
extern void __gnat_set_executable (char *name);
diff --git a/gcc/ada/ali.adb b/gcc/ada/ali.adb
index b2357eae970..20438cf66e6 100644
--- a/gcc/ada/ali.adb
+++ b/gcc/ada/ali.adb
@@ -190,7 +190,7 @@ package body ALI is
function Get_Name
(Ignore_Spaces : Boolean := False;
- Ignore_Special : Boolean := False)return Name_Id;
+ Ignore_Special : Boolean := False) return Name_Id;
-- Skip blanks, then scan out a name (name is left in Name_Buffer with
-- length in Name_Len, as well as being returned in Name_Id form).
-- If Lower is set to True then the Name_Buffer will be converted to
diff --git a/gcc/ada/bcheck.adb b/gcc/ada/bcheck.adb
index 8119a6d7a43..18739e878ed 100644
--- a/gcc/ada/bcheck.adb
+++ b/gcc/ada/bcheck.adb
@@ -190,7 +190,7 @@ package body Bcheck is
else
ALI_Path_Id :=
- Osint.Find_File ((ALIs.Table (A).Afile), Osint.Library);
+ Osint.Full_Lib_File_Name (ALIs.Table (A).Afile);
if Osint.Is_Readonly_Library (ALI_Path_Id) then
if Tolerate_Consistency_Errors then
Error_Msg ("?{ should be recompiled");
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index d1a2b460c90..ff511665b73 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -28,6 +28,7 @@ with Debug; use Debug;
with Einfo; use Einfo;
with Errout; use Errout;
with Exp_Ch2; use Exp_Ch2;
+with Exp_Ch4; use Exp_Ch4;
with Exp_Ch11; use Exp_Ch11;
with Exp_Pakd; use Exp_Pakd;
with Exp_Util; use Exp_Util;
@@ -844,7 +845,10 @@ package body Checks is
begin
-- Skip check if back end does overflow checks, or the overflow flag
- -- is not set anyway, or we are not doing code expansion.
+ -- is not set anyway, or we are not doing code expansion, or the
+ -- parent node is a type conversion whose operand is an arithmetic
+ -- operation on signed integers on which the expander can promote
+ -- later the operands to type Integer (see Expand_N_Type_Conversion).
-- Special case CLI target, where arithmetic overflow checks can be
-- performed for integer and long_integer
@@ -852,6 +856,9 @@ package body Checks is
if Backend_Overflow_Checks_On_Target
or else not Do_Overflow_Check (N)
or else not Expander_Active
+ or else (Present (Parent (N))
+ and then Nkind (Parent (N)) = N_Type_Conversion
+ and then Integer_Promotion_Possible (Parent (N)))
or else
(VM_Target = CLI_Target and then Siz >= Standard_Integer_Size)
then
diff --git a/gcc/ada/env.c b/gcc/ada/env.c
index ac6e835df9f..d9486977433 100644
--- a/gcc/ada/env.c
+++ b/gcc/ada/env.c
@@ -29,8 +29,11 @@
* *
****************************************************************************/
-/* Tru64 UNIX <stdlib.h> declares unsetenv() only if _BSD. */
+/* Tru64 UNIX V4.0F <stdlib.h> declares unsetenv() only if AES_SOURCE (which
+ is plain broken, this should be _AES_SOURCE instead as everywhere else;
+ Tru64 UNIX V5.1B declares it only if _BSD. */
#if defined (__alpha__) && defined (__osf__)
+#define AES_SOURCE
#define _BSD
#endif
diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb
index 913e46df374..0e29af2c64e 100644
--- a/gcc/ada/exp_aggr.adb
+++ b/gcc/ada/exp_aggr.adb
@@ -509,7 +509,7 @@ package body Exp_Aggr is
-- 10. No controlled actions need to be generated for components
- -- 11. The backend is a No_VM backend and the array has aliased components
+ -- 11. For a VM back end, the array should have no aliased components
function Backend_Processing_Possible (N : Node_Id) return Boolean is
Typ : constant Entity_Id := Etype (N);
@@ -3298,8 +3298,14 @@ package body Exp_Aggr is
N_Discriminant_Specification
then
Flist := Empty;
- else
+
+ elsif Needs_Finalization (Typ) then
Flist := Find_Final_List (Access_Type);
+
+ -- Otherwise there are no controlled actions to be performed.
+
+ else
+ Flist := Empty;
end if;
if Is_Array_Type (Typ) then
diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb
index d5cce9b43ee..48bd566b38b 100644
--- a/gcc/ada/exp_attr.adb
+++ b/gcc/ada/exp_attr.adb
@@ -654,10 +654,18 @@ package body Exp_Attr is
Make_Build_In_Place_Call_In_Anonymous_Context (Pref);
end if;
- -- If prefix is a protected type name, this is a reference to
- -- the current instance of the type.
-
- if Is_Protected_Self_Reference (Pref) then
+ -- If prefix is a protected type name, this is a reference to the
+ -- current instance of the type. For a component definition, nothing
+ -- to do (expansion will occur in the init proc). In other contexts,
+ -- rewrite into reference to current instance.
+
+ if Is_Protected_Self_Reference (Pref)
+ and then not
+ (Nkind_In (Parent (N), N_Index_Or_Discriminant_Constraint,
+ N_Discriminant_Association)
+ and then Nkind (Parent (Parent (Parent (Parent (N))))) =
+ N_Component_Definition)
+ then
Rewrite (Pref, Concurrent_Ref (Pref));
Analyze (Pref);
end if;
@@ -680,9 +688,9 @@ package body Exp_Attr is
function Enclosing_Object (N : Node_Id) return Node_Id;
-- If N denotes a compound name (selected component, indexed
- -- component, or slice), returns the name of the outermost
- -- such enclosing object. Otherwise returns N. If the object
- -- is a renaming, then the renamed object is returned.
+ -- component, or slice), returns the name of the outermost such
+ -- enclosing object. Otherwise returns N. If the object is a
+ -- renaming, then the renamed object is returned.
----------------------
-- Enclosing_Object --
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index 414e5670115..9a91e2aa9bb 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -2733,70 +2733,11 @@ package body Exp_Ch3 is
Next_Non_Pragma (Decl);
end loop;
- if Per_Object_Constraint_Components then
-
- -- Second pass: components with per-object constraints
-
- Decl := First_Non_Pragma (Component_Items (Comp_List));
- while Present (Decl) loop
- Loc := Sloc (Decl);
- Id := Defining_Identifier (Decl);
- Typ := Etype (Id);
-
- if Has_Access_Constraint (Id)
- and then No (Expression (Decl))
- then
- if Has_Non_Null_Base_Init_Proc (Typ) then
- Append_List_To (Statement_List,
- Build_Initialization_Call (Loc,
- Make_Selected_Component (Loc,
- Prefix => Make_Identifier (Loc, Name_uInit),
- Selector_Name => New_Occurrence_Of (Id, Loc)),
- Typ,
- In_Init_Proc => True,
- Enclos_Type => Rec_Type,
- Discr_Map => Discr_Map));
-
- Clean_Task_Names (Typ, Proc_Id);
-
- elsif Component_Needs_Simple_Initialization (Typ) then
- Append_List_To (Statement_List,
- Build_Assignment
- (Id, Get_Simple_Init_Val (Typ, N, Esize (Id))));
- end if;
- end if;
-
- Next_Non_Pragma (Decl);
- end loop;
- end if;
-
- -- Process the variant part
-
- if Present (Variant_Part (Comp_List)) then
- Alt_List := New_List;
- Variant := First_Non_Pragma (Variants (Variant_Part (Comp_List)));
- while Present (Variant) loop
- Loc := Sloc (Variant);
- Append_To (Alt_List,
- Make_Case_Statement_Alternative (Loc,
- Discrete_Choices =>
- New_Copy_List (Discrete_Choices (Variant)),
- Statements =>
- Build_Init_Statements (Component_List (Variant))));
- Next_Non_Pragma (Variant);
- end loop;
-
- -- The expression of the case statement which is a reference
- -- to one of the discriminants is replaced by the appropriate
- -- formal parameter of the initialization procedure.
-
- Append_To (Statement_List,
- Make_Case_Statement (Loc,
- Expression =>
- New_Reference_To (Discriminal (
- Entity (Name (Variant_Part (Comp_List)))), Loc),
- Alternatives => Alt_List));
- end if;
+ -- Set up tasks and protected object support. This needs to be done
+ -- before any component with a per-object access discriminant
+ -- constraint, or any variant part (which may contain such
+ -- components) is initialized, because the initialization of these
+ -- components may reference the enclosing concurrent object.
-- For a task record type, add the task create call and calls
-- to bind any interrupt (signal) entries.
@@ -2898,6 +2839,71 @@ package body Exp_Ch3 is
end if;
end if;
+ if Per_Object_Constraint_Components then
+
+ -- Second pass: components with per-object constraints
+
+ Decl := First_Non_Pragma (Component_Items (Comp_List));
+ while Present (Decl) loop
+ Loc := Sloc (Decl);
+ Id := Defining_Identifier (Decl);
+ Typ := Etype (Id);
+
+ if Has_Access_Constraint (Id)
+ and then No (Expression (Decl))
+ then
+ if Has_Non_Null_Base_Init_Proc (Typ) then
+ Append_List_To (Statement_List,
+ Build_Initialization_Call (Loc,
+ Make_Selected_Component (Loc,
+ Prefix => Make_Identifier (Loc, Name_uInit),
+ Selector_Name => New_Occurrence_Of (Id, Loc)),
+ Typ,
+ In_Init_Proc => True,
+ Enclos_Type => Rec_Type,
+ Discr_Map => Discr_Map));
+
+ Clean_Task_Names (Typ, Proc_Id);
+
+ elsif Component_Needs_Simple_Initialization (Typ) then
+ Append_List_To (Statement_List,
+ Build_Assignment
+ (Id, Get_Simple_Init_Val (Typ, N, Esize (Id))));
+ end if;
+ end if;
+
+ Next_Non_Pragma (Decl);
+ end loop;
+ end if;
+
+ -- Process the variant part
+
+ if Present (Variant_Part (Comp_List)) then
+ Alt_List := New_List;
+ Variant := First_Non_Pragma (Variants (Variant_Part (Comp_List)));
+ while Present (Variant) loop
+ Loc := Sloc (Variant);
+ Append_To (Alt_List,
+ Make_Case_Statement_Alternative (Loc,
+ Discrete_Choices =>
+ New_Copy_List (Discrete_Choices (Variant)),
+ Statements =>
+ Build_Init_Statements (Component_List (Variant))));
+ Next_Non_Pragma (Variant);
+ end loop;
+
+ -- The expression of the case statement which is a reference
+ -- to one of the discriminants is replaced by the appropriate
+ -- formal parameter of the initialization procedure.
+
+ Append_To (Statement_List,
+ Make_Case_Statement (Loc,
+ Expression =>
+ New_Reference_To (Discriminal (
+ Entity (Name (Variant_Part (Comp_List)))), Loc),
+ Alternatives => Alt_List));
+ end if;
+
-- If no initializations when generated for component declarations
-- corresponding to this Statement_List, append a null statement
-- to the Statement_List to make it a valid Ada tree.
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index 6a65e10a167..6a7ea4fdb1b 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -8042,88 +8042,41 @@ package body Exp_Ch4 is
-- have to be sure not to generate junk overflow checks in the first
-- place, since it would be trick to remove them here!
- declare
- Root_Operand_Type : constant Entity_Id := Root_Type (Operand_Type);
-
- begin
- -- Enable transformation if all conditions are met
-
- if
- -- We only do this transformation for source constructs. We assume
- -- that the expander knows what it is doing when it generates code.
+ if Integer_Promotion_Possible (N) then
- Comes_From_Source (N)
+ -- All conditions met, go ahead with transformation
- -- If the operand type is Short_Integer or Short_Short_Integer,
- -- then we will promote to Integer, which is available on all
- -- targets, and is sufficient to ensure no intermediate overflow.
- -- Furthermore it is likely to be as efficient or more efficient
- -- than using the smaller type for the computation so we do this
- -- unconditionally.
-
- and then
- (Root_Operand_Type = Base_Type (Standard_Short_Integer)
- or else
- Root_Operand_Type = Base_Type (Standard_Short_Short_Integer))
-
- -- Test for interesting operation, which includes addition,
- -- division, exponentiation, multiplication, subtraction, and
- -- unary negation.
+ declare
+ Opnd : Node_Id;
+ L, R : Node_Id;
- and then Nkind_In (Operand, N_Op_Add,
- N_Op_Divide,
- N_Op_Expon,
- N_Op_Minus,
- N_Op_Multiply,
- N_Op_Subtract)
- then
- -- All conditions met, go ahead with transformation
+ begin
+ R :=
+ Make_Type_Conversion (Loc,
+ Subtype_Mark => New_Reference_To (Standard_Integer, Loc),
+ Expression => Relocate_Node (Right_Opnd (Operand)));
- declare
- Opnd : Node_Id;
- L, R : Node_Id;
+ Opnd := New_Op_Node (Nkind (Operand), Loc);
+ Set_Right_Opnd (Opnd, R);
- begin
- R :=
+ if Nkind (Operand) in N_Binary_Op then
+ L :=
Make_Type_Conversion (Loc,
Subtype_Mark => New_Reference_To (Standard_Integer, Loc),
- Expression => Relocate_Node (Right_Opnd (Operand)));
-
- if Nkind (Operand) = N_Op_Minus then
- Opnd := Make_Op_Minus (Loc, Right_Opnd => R);
+ Expression => Relocate_Node (Left_Opnd (Operand)));
- else
- L :=
- Make_Type_Conversion (Loc,
- Subtype_Mark => New_Reference_To (Standard_Integer, Loc),
- Expression => Relocate_Node (Left_Opnd (Operand)));
-
- case Nkind (Operand) is
- when N_Op_Add =>
- Opnd := Make_Op_Add (Loc, L, R);
- when N_Op_Divide =>
- Opnd := Make_Op_Divide (Loc, L, R);
- when N_Op_Expon =>
- Opnd := Make_Op_Expon (Loc, L, R);
- when N_Op_Multiply =>
- Opnd := Make_Op_Multiply (Loc, L, R);
- when N_Op_Subtract =>
- Opnd := Make_Op_Subtract (Loc, L, R);
- when others =>
- raise Program_Error;
- end case;
+ Set_Left_Opnd (Opnd, L);
+ end if;
- Rewrite (N,
- Make_Type_Conversion (Loc,
- Subtype_Mark => Relocate_Node (Subtype_Mark (N)),
- Expression => Opnd));
+ Rewrite (N,
+ Make_Type_Conversion (Loc,
+ Subtype_Mark => Relocate_Node (Subtype_Mark (N)),
+ Expression => Opnd));
- Analyze_And_Resolve (N, Target_Type);
- return;
- end if;
- end;
- end if;
- end;
+ Analyze_And_Resolve (N, Target_Type);
+ return;
+ end;
+ end if;
-- Do validity check if validity checking operands
@@ -9187,6 +9140,51 @@ package body Exp_Ch4 is
return;
end Insert_Dereference_Action;
+ --------------------------------
+ -- Integer_Promotion_Possible --
+ --------------------------------
+
+ function Integer_Promotion_Possible (N : Node_Id) return Boolean is
+ Operand : constant Node_Id := Expression (N);
+ Operand_Type : constant Entity_Id := Etype (Operand);
+ Root_Operand_Type : constant Entity_Id := Root_Type (Operand_Type);
+
+ begin
+ pragma Assert (Nkind (N) = N_Type_Conversion);
+
+ return
+
+ -- We only do the transformation for source constructs. We assume
+ -- that the expander knows what it is doing when it generates code.
+
+ Comes_From_Source (N)
+
+ -- If the operand type is Short_Integer or Short_Short_Integer,
+ -- then we will promote to Integer, which is available on all
+ -- targets, and is sufficient to ensure no intermediate overflow.
+ -- Furthermore it is likely to be as efficient or more efficient
+ -- than using the smaller type for the computation so we do this
+ -- unconditionally.
+
+ and then
+ (Root_Operand_Type = Base_Type (Standard_Short_Integer)
+ or else
+ Root_Operand_Type = Base_Type (Standard_Short_Short_Integer))
+
+ -- Test for interesting operation, which includes addition,
+ -- division, exponentiation, multiplication, subtraction, absolute
+ -- value and unary negation. Unary "+" is omitted since it is a
+ -- no-op and thus can't overflow.
+
+ and then Nkind_In (Operand, N_Op_Abs,
+ N_Op_Add,
+ N_Op_Divide,
+ N_Op_Expon,
+ N_Op_Minus,
+ N_Op_Multiply,
+ N_Op_Subtract);
+ end Integer_Promotion_Possible;
+
------------------------------
-- Make_Array_Comparison_Op --
------------------------------
diff --git a/gcc/ada/exp_ch4.ads b/gcc/ada/exp_ch4.ads
index d1ed208f1b3..fad8c15eea1 100644
--- a/gcc/ada/exp_ch4.ads
+++ b/gcc/ada/exp_ch4.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -88,4 +88,11 @@ package Exp_Ch4 is
-- to insert those bodies at the right place. Nod provides the Sloc
-- value for generated code.
+ function Integer_Promotion_Possible (N : Node_Id) return Boolean;
+ -- Returns true if the node is a type conversion whose operand is an
+ -- arithmetic operation on signed integers, and the base type of the
+ -- signed integer type is smaller than Standard.Integer. In such case we
+ -- have special circuitry in Expand_N_Type_Conversion to promote both of
+ -- the operands to type Integer.
+
end Exp_Ch4;
diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb
index db22726bb64..7fe20b37cad 100644
--- a/gcc/ada/exp_ch9.adb
+++ b/gcc/ada/exp_ch9.adb
@@ -3983,9 +3983,21 @@ package body Exp_Ch9 is
Spec_Id : Entity_Id;
begin
- Spec_Id :=
- Make_Defining_Identifier (Loc,
- Chars => New_External_Name (Chars (T), 'B'));
+ -- Case of explicit task type, suffix TB
+
+ if Comes_From_Source (T) then
+ Spec_Id :=
+ Make_Defining_Identifier (Loc,
+ Chars => New_External_Name (Chars (T), "TB"));
+
+ -- Case of anonymous task type, suffix B
+
+ else
+ Spec_Id :=
+ Make_Defining_Identifier (Loc,
+ Chars => New_External_Name (Chars (T), 'B'));
+ end if;
+
Set_Is_Internal (Spec_Id);
-- Associate the procedure with the task, if this is the declaration
@@ -7821,20 +7833,23 @@ package body Exp_Ch9 is
declare
Old_Comp : constant Node_Id := Component_Definition (Priv);
- Pent : constant Entity_Id := Defining_Identifier (Priv);
+ Oent : constant Entity_Id := Defining_Identifier (Priv);
New_Comp : Node_Id;
+ Nent : constant Entity_Id :=
+ Make_Defining_Identifier (Sloc (Oent),
+ Chars => Chars (Oent));
begin
if Present (Subtype_Indication (Old_Comp)) then
New_Comp :=
- Make_Component_Definition (Sloc (Pent),
+ Make_Component_Definition (Sloc (Oent),
Aliased_Present => False,
Subtype_Indication =>
New_Copy_Tree (Subtype_Indication (Old_Comp),
Discr_Map));
else
New_Comp :=
- Make_Component_Definition (Sloc (Pent),
+ Make_Component_Definition (Sloc (Oent),
Aliased_Present => False,
Access_Definition =>
New_Copy_Tree (Access_Definition (Old_Comp),
@@ -7843,10 +7858,12 @@ package body Exp_Ch9 is
New_Priv :=
Make_Component_Declaration (Loc,
- Defining_Identifier =>
- Make_Defining_Identifier (Sloc (Pent), Chars (Pent)),
+ Defining_Identifier => Nent,
Component_Definition => New_Comp,
- Expression => Expression (Priv));
+ Expression => Expression (Priv));
+
+ Set_Has_Per_Object_Constraint (Nent,
+ Has_Per_Object_Constraint (Oent));
Append_To (Cdecls, New_Priv);
end;
diff --git a/gcc/ada/exp_ch9.ads b/gcc/ada/exp_ch9.ads
index 8e795e12c0f..61279d4eac5 100644
--- a/gcc/ada/exp_ch9.ads
+++ b/gcc/ada/exp_ch9.ads
@@ -173,8 +173,8 @@ package Exp_Ch9 is
-- meaning is to get the Task_Id for the currently executing task.
function Convert_Concurrent
- (N : Node_Id;
- Typ : Entity_Id) return Node_Id;
+ (N : Node_Id;
+ Typ : Entity_Id) return Node_Id;
-- N is an expression of type Typ. If the type is not a concurrent type
-- then it is returned unchanged. If it is a task or protected reference,
-- Convert_Concurrent creates an unchecked conversion node from this
diff --git a/gcc/ada/exp_dbug.ads b/gcc/ada/exp_dbug.ads
index 3c3144641d8..1d26bb3ef75 100644
--- a/gcc/ada/exp_dbug.ads
+++ b/gcc/ada/exp_dbug.ads
@@ -873,12 +873,12 @@ package Exp_Dbug is
-- the element type for AT1 might have a type defined as if it had
-- been written:
--
- -- type at1___C_PAD is record null; end record;
- -- for at1___C_PAD'Size use 16 * 8;
+ -- type at1___PAD is record null; end record;
+ -- for at1___PAD'Size use 16 * 8;
--
-- and there would also be
--
- -- type at1___C_PAD___XVS is record t1: Integer; end record;
+ -- type at1___PAD___XVS is record t1: Integer; end record;
-- type t1 is ...
--
-- Had the subtype Int been dynamic:
@@ -888,7 +888,7 @@ package Exp_Dbug is
-- Then the compiler would also generate a declaration whose effect
-- would be
--
- -- at1___C_PAD___XVZ: constant Integer := 32 + M * 8 + padding term;
+ -- at1___PAD___XVZ: constant Integer := 32 + M * 8 + padding term;
--
-- Not all unconstrained types are so encoded; the XVS convention may be
-- unnecessary for unconstrained types of fixed size. However, this
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index 163274c4332..02887029b22 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -1295,29 +1295,30 @@ ada/checks.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/casing.ads ada/checks.ads ada/checks.adb ada/csets.ads \
ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \
ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/eval_fat.ads \
- ada/exp_aggr.ads ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch6.ads \
- ada/exp_ch7.ads ada/exp_dist.ads ada/exp_pakd.ads ada/exp_tss.ads \
- ada/exp_util.ads ada/exp_util.adb 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/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/namet.ads ada/nlists.ads ada/nlists.adb \
- ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \
- ada/restrict.adb ada/rident.ads ada/rtsfind.ads ada/rtsfind.adb \
- ada/sem.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_dist.ads \
- ada/sem_eval.ads ada/sem_eval.adb ada/sem_res.ads ada/sem_scil.ads \
- ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \
- ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/sprint.ads \
- ada/stand.ads ada/stringt.ads ada/stringt.adb 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-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/exp_aggr.ads ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch4.ads \
+ ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_dist.ads ada/exp_pakd.ads \
+ ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb 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/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/namet.ads ada/nlists.ads \
+ ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
+ ada/restrict.ads ada/restrict.adb ada/rident.ads ada/rtsfind.ads \
+ ada/rtsfind.adb ada/sem.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_dist.ads ada/sem_eval.ads ada/sem_eval.adb ada/sem_res.ads \
+ ada/sem_scil.ads ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads \
+ ada/sprint.ads ada/stand.ads ada/stringt.ads ada/stringt.adb \
+ 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-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/comperr.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \
@@ -1467,12 +1468,12 @@ ada/exp_aggr.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \
ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/eval_fat.ads \
ada/exp_aggr.ads ada/exp_aggr.adb ada/exp_ch11.ads ada/exp_ch2.ads \
- ada/exp_ch3.ads ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_ch9.ads \
- ada/exp_disp.ads ada/exp_dist.ads ada/exp_pakd.ads ada/exp_tss.ads \
- ada/exp_util.ads ada/exp_util.adb 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/hostparm.ads ada/inline.ads \
- ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib.adb \
+ ada/exp_ch3.ads ada/exp_ch4.ads ada/exp_ch6.ads ada/exp_ch7.ads \
+ ada/exp_ch9.ads ada/exp_disp.ads ada/exp_dist.ads ada/exp_pakd.ads \
+ ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb 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/hostparm.ads \
+ ada/inline.ads ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib.adb \
ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb 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/restrict.ads \
@@ -1691,31 +1692,32 @@ ada/exp_ch5.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \
ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/eval_fat.ads \
ada/exp_aggr.ads ada/exp_atag.ads ada/exp_ch11.ads ada/exp_ch2.ads \
- ada/exp_ch5.ads ada/exp_ch5.adb ada/exp_ch6.ads ada/exp_ch7.ads \
- ada/exp_dbug.ads ada/exp_disp.ads ada/exp_pakd.ads ada/exp_tss.ads \
- ada/exp_util.ads ada/exp_util.adb ada/fname.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/interfac.ads ada/itypes.ads \
- ada/lib.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/restrict.ads ada/restrict.adb 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_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_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/stringt.adb \
- 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/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_ch4.ads ada/exp_ch5.ads ada/exp_ch5.adb ada/exp_ch6.ads \
+ ada/exp_ch7.ads ada/exp_dbug.ads ada/exp_disp.ads ada/exp_pakd.ads \
+ ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb ada/fname.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/interfac.ads \
+ ada/itypes.ads ada/lib.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/restrict.ads ada/restrict.adb 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_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_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/stringt.adb 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/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_ch6.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \
@@ -1723,34 +1725,35 @@ ada/exp_ch6.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \
ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/eval_fat.ads \
ada/exp_aggr.ads ada/exp_atag.ads ada/exp_ch11.ads ada/exp_ch2.ads \
- ada/exp_ch3.ads ada/exp_ch6.ads ada/exp_ch6.adb ada/exp_ch7.ads \
- ada/exp_ch9.ads ada/exp_dbug.ads ada/exp_disp.ads ada/exp_dist.ads \
- ada/exp_intr.ads ada/exp_pakd.ads ada/exp_tss.ads ada/exp_util.ads \
- ada/exp_util.adb ada/exp_vfpt.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/hostparm.ads ada/inline.ads ada/interfac.ads \
- ada/itypes.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
- ada/lib-load.ads ada/lib-sort.adb 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/restrict.ads ada/restrict.adb \
- ada/rident.ads ada/rtsfind.ads ada/rtsfind.adb 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_ch12.ads ada/sem_ch13.ads ada/sem_ch3.ads \
- ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_disp.ads \
- ada/sem_dist.ads ada/sem_eval.ads ada/sem_mech.ads ada/sem_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-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/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_ch3.ads ada/exp_ch4.ads ada/exp_ch6.ads ada/exp_ch6.adb \
+ ada/exp_ch7.ads ada/exp_ch9.ads ada/exp_dbug.ads ada/exp_disp.ads \
+ ada/exp_dist.ads ada/exp_intr.ads ada/exp_pakd.ads ada/exp_tss.ads \
+ ada/exp_util.ads ada/exp_util.adb ada/exp_vfpt.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/hostparm.ads ada/inline.ads \
+ ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib.adb \
+ ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb 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/restrict.ads \
+ ada/restrict.adb ada/rident.ads ada/rtsfind.ads ada/rtsfind.adb \
+ 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_ch12.ads ada/sem_ch13.ads \
+ ada/sem_ch3.ads ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads \
+ ada/sem_disp.ads ada/sem_dist.ads ada/sem_eval.ads ada/sem_mech.ads \
+ ada/sem_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-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/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/atree.ads ada/atree.adb \
@@ -2006,25 +2009,26 @@ ada/exp_pakd.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/casing.ads ada/checks.ads ada/checks.adb ada/debug.ads \
ada/einfo.ads ada/einfo.adb ada/elists.ads ada/err_vars.ads \
ada/errout.ads ada/erroutc.ads ada/eval_fat.ads ada/exp_aggr.ads \
- ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch6.ads ada/exp_ch7.ads \
- ada/exp_dbug.ads ada/exp_pakd.ads ada/exp_pakd.adb ada/exp_tss.ads \
- ada/exp_util.ads ada/exp_util.adb ada/freeze.ads ada/get_targ.ads \
- ada/gnat.ads ada/g-htable.ads ada/hostparm.ads ada/inline.ads \
- ada/itypes.ads ada/layout.ads ada/lib.ads ada/namet.ads ada/nlists.ads \
- ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
- ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \
- ada/sem_aux.ads ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch8.ads \
- ada/sem_eval.ads ada/sem_res.ads ada/sem_scil.ads ada/sem_type.ads \
- ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \
- ada/sinput.ads ada/snames.ads ada/sprint.ads ada/stand.ads \
- ada/stringt.ads ada/system.ads ada/s-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-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
- ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads
+ ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch4.ads ada/exp_ch6.ads \
+ ada/exp_ch7.ads ada/exp_dbug.ads ada/exp_pakd.ads ada/exp_pakd.adb \
+ ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb ada/freeze.ads \
+ ada/get_targ.ads ada/gnat.ads ada/g-htable.ads ada/hostparm.ads \
+ ada/inline.ads ada/itypes.ads ada/layout.ads ada/lib.ads ada/namet.ads \
+ ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
+ ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \
+ ada/sem.ads ada/sem_aux.ads ada/sem_ch13.ads ada/sem_ch3.ads \
+ ada/sem_ch8.ads ada/sem_eval.ads ada/sem_res.ads ada/sem_scil.ads \
+ ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/sprint.ads \
+ ada/stand.ads ada/stringt.ads ada/system.ads ada/s-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-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \
+ ada/validsw.ads
ada/exp_prag.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \
@@ -3022,12 +3026,12 @@ ada/sem_aggr.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/casing.ads ada/checks.ads ada/checks.adb ada/csets.ads \
ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \
ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/eval_fat.ads \
- ada/exp_aggr.ads ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch6.ads \
- ada/exp_ch7.ads ada/exp_disp.ads ada/exp_pakd.ads ada/exp_tss.ads \
- ada/exp_util.ads ada/exp_util.adb ada/expander.ads ada/fname.ads \
- ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \
- ada/hostparm.ads ada/inline.ads ada/interfac.ads ada/itypes.ads \
- ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/namet.adb \
+ ada/exp_aggr.ads ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch4.ads \
+ ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_disp.ads ada/exp_pakd.ads \
+ ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb ada/expander.ads \
+ ada/fname.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \
+ ada/g-htable.ads ada/hostparm.ads ada/inline.ads ada/interfac.ads \
+ ada/itypes.ads ada/lib.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/restrict.ads \
ada/rident.ads ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads \
@@ -3055,32 +3059,32 @@ ada/sem_attr.o : ada/ada.ads ada/a-charac.ads ada/a-chlat1.ads \
ada/checks.adb ada/csets.ads ada/debug.ads ada/debug_a.ads \
ada/einfo.ads ada/einfo.adb ada/elists.ads ada/err_vars.ads \
ada/errout.ads ada/erroutc.ads ada/eval_fat.ads ada/exp_aggr.ads \
- ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch6.ads ada/exp_ch7.ads \
- ada/exp_disp.ads ada/exp_dist.ads ada/exp_pakd.ads ada/exp_tss.ads \
- ada/exp_util.ads ada/exp_util.adb ada/expander.ads ada/fname.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/lib.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/restrict.ads ada/rident.ads ada/rtsfind.ads ada/scans.ads \
- ada/sdefault.ads ada/sem.ads ada/sem_aggr.ads ada/sem_attr.ads \
- ada/sem_attr.adb ada/sem_aux.ads ada/sem_cat.ads ada/sem_ch10.ads \
- ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch6.ads \
- ada/sem_ch8.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_scil.ads ada/sem_type.ads \
- ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \
- ada/sinput.ads ada/sinput.adb ada/snames.ads ada/snames.adb \
- ada/sprint.ads ada/stand.ads ada/stringt.ads ada/stringt.adb \
- ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
- ada/system.ads ada/s-carun8.ads ada/s-exctab.ads ada/s-exctab.adb \
- ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
- ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
- ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
- ada/tbuild.adb ada/tree_io.ads ada/ttypef.ads ada/ttypes.ads \
- ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb \
+ ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch4.ads ada/exp_ch6.ads \
+ ada/exp_ch7.ads ada/exp_disp.ads ada/exp_dist.ads ada/exp_pakd.ads \
+ ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb ada/expander.ads \
+ ada/fname.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/lib.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/restrict.ads ada/rident.ads ada/rtsfind.ads \
+ ada/scans.ads ada/sdefault.ads ada/sem.ads ada/sem_aggr.ads \
+ ada/sem_attr.ads ada/sem_attr.adb ada/sem_aux.ads ada/sem_cat.ads \
+ ada/sem_ch10.ads ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch4.ads \
+ ada/sem_ch6.ads ada/sem_ch8.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_scil.ads \
+ ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/snames.ads \
+ ada/snames.adb ada/sprint.ads ada/stand.ads ada/stringt.ads \
+ ada/stringt.adb ada/style.ads ada/styleg.ads ada/styleg.adb \
+ ada/stylesw.ads ada/system.ads ada/s-carun8.ads ada/s-exctab.ads \
+ ada/s-exctab.adb ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
+ ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypef.ads \
+ ada/ttypes.ads ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb \
ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \
ada/validsw.ads ada/widechar.ads
@@ -3271,35 +3275,35 @@ ada/sem_ch3.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \
ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/eval_fat.ads \
ada/exp_aggr.ads ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch3.ads \
- ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_ch9.ads ada/exp_disp.ads \
- ada/exp_dist.ads ada/exp_pakd.ads ada/exp_tss.ads ada/exp_util.ads \
- ada/exp_util.adb ada/fname.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/interfac.ads ada/itypes.ads ada/layout.ads \
- ada/lib.ads ada/lib.adb ada/lib-list.adb ada/lib-sort.adb \
- 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/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_case.ads ada/sem_case.adb ada/sem_cat.ads \
- ada/sem_cat.adb ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch3.adb \
- ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.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_res.ads ada/sem_scil.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/stringt.adb \
- 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/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_ch4.ads ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_ch9.ads \
+ ada/exp_disp.ads ada/exp_dist.ads ada/exp_pakd.ads ada/exp_tss.ads \
+ ada/exp_util.ads ada/exp_util.adb ada/fname.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/interfac.ads ada/itypes.ads \
+ ada/layout.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
+ ada/lib-sort.adb 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/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_case.ads ada/sem_case.adb \
+ ada/sem_cat.ads ada/sem_cat.adb ada/sem_ch13.ads ada/sem_ch3.ads \
+ ada/sem_ch3.adb ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.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_res.ads ada/sem_scil.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/stringt.adb 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/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/atree.ads ada/atree.adb \
@@ -3338,34 +3342,34 @@ ada/sem_ch5.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/casing.ads ada/checks.ads ada/checks.adb ada/csets.ads \
ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/einfo.adb \
ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
- ada/eval_fat.ads ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch6.ads \
- ada/exp_ch7.ads ada/exp_code.ads ada/exp_disp.ads ada/exp_pakd.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-hesorg.ads \
- ada/g-htable.ads ada/hostparm.ads ada/interfac.ads ada/itypes.ads \
- ada/lib.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/par_sco.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_aggr.ads ada/sem_attr.ads ada/sem_aux.ads ada/sem_case.ads \
- ada/sem_case.adb ada/sem_cat.ads ada/sem_ch13.ads ada/sem_ch3.ads \
- ada/sem_ch4.ads ada/sem_ch5.ads ada/sem_ch5.adb ada/sem_ch6.ads \
- ada/sem_ch8.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_scil.ads ada/sem_type.ads \
- ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads ada/sem_warn.adb \
- ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/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-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/validsw.ads ada/widechar.ads
+ ada/eval_fat.ads ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch4.ads \
+ ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_code.ads ada/exp_disp.ads \
+ ada/exp_pakd.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-hesorg.ads ada/g-htable.ads ada/hostparm.ads ada/interfac.ads \
+ ada/itypes.ads ada/lib.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/par_sco.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_aggr.ads ada/sem_attr.ads ada/sem_aux.ads \
+ ada/sem_case.ads ada/sem_case.adb ada/sem_cat.ads ada/sem_ch13.ads \
+ ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch5.ads ada/sem_ch5.adb \
+ ada/sem_ch6.ads ada/sem_ch8.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_scil.ads \
+ ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads \
+ ada/sem_warn.adb ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/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-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/validsw.ads ada/widechar.ads
ada/sem_ch6.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \
@@ -3469,33 +3473,34 @@ ada/sem_ch9.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/casing.ads ada/checks.ads ada/checks.adb ada/csets.ads \
ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/einfo.adb \
ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
- ada/eval_fat.ads ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch6.ads \
- ada/exp_ch7.ads ada/exp_ch9.ads ada/exp_disp.ads ada/exp_pakd.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-htable.ads ada/hostparm.ads ada/interfac.ads ada/itypes.ads \
- ada/lib.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/restrict.ads ada/restrict.adb ada/rident.ads ada/rtsfind.ads \
- ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads \
- ada/sem_aggr.ads ada/sem_attr.ads ada/sem_aux.ads ada/sem_cat.ads \
- ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch4.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_dist.ads ada/sem_elab.ads ada/sem_elim.ads \
- ada/sem_eval.ads ada/sem_intr.ads ada/sem_res.ads ada/sem_res.adb \
- 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/sinput.adb 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-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/validsw.ads ada/widechar.ads
+ ada/eval_fat.ads ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch4.ads \
+ ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_ch9.ads ada/exp_disp.ads \
+ ada/exp_pakd.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-htable.ads ada/hostparm.ads ada/interfac.ads \
+ ada/itypes.ads ada/lib.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/restrict.ads ada/restrict.adb ada/rident.ads \
+ ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb \
+ ada/sem.ads ada/sem_aggr.ads ada/sem_attr.ads ada/sem_aux.ads \
+ ada/sem_cat.ads ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch4.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_dist.ads ada/sem_elab.ads \
+ ada/sem_elim.ads ada/sem_eval.ads ada/sem_intr.ads ada/sem_res.ads \
+ ada/sem_res.adb 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/sinput.adb 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-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/validsw.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/atree.ads ada/atree.adb \
@@ -3699,12 +3704,12 @@ ada/sem_res.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/debug.ads ada/debug_a.ads ada/debug_a.adb 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_aggr.ads \
- ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch6.ads ada/exp_ch7.ads \
- ada/exp_disp.ads ada/exp_dist.ads ada/exp_pakd.ads ada/exp_tss.ads \
- ada/exp_util.ads ada/exp_util.adb 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/hostparm.ads ada/inline.ads \
- ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib.adb \
+ ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch4.ads ada/exp_ch6.ads \
+ ada/exp_ch7.ads ada/exp_disp.ads ada/exp_dist.ads ada/exp_pakd.ads \
+ ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb 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/hostparm.ads \
+ ada/inline.ads ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib.adb \
ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb 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/restrict.ads \
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
index cf717ac39cd..c9221fb5022 100644
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -109,8 +109,11 @@ SOME_ADAFLAGS =-gnata
FORCE_DEBUG_ADAFLAGS = -g
GNATLIBFLAGS = -gnatpg -nostdinc
GNATLIBCFLAGS = -g -O2
+# Pretend that _Unwind_GetIPInfo is available for the target by default. This
+# should be autodetected during the configuration of libada and passed down to
+# here, but we need something for --disable-libada and hope for the best.
GNATLIBCFLAGS_FOR_C = $(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) -fexceptions \
- -DIN_RTS
+ -DIN_RTS -DHAVE_GETIPINFO
ALL_ADAFLAGS = $(CFLAGS) $(ADA_CFLAGS) $(ADAFLAGS)
MOST_ADAFLAGS = $(CFLAGS) $(ADA_CFLAGS) $(SOME_ADAFLAGS)
THREAD_KIND = native
@@ -2422,6 +2425,7 @@ gnatlib-shared-default:
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
+ GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
gnatlib
@@ -2447,6 +2451,7 @@ gnatlib-shared-dual:
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
gnatlib-shared-default
@@ -2455,6 +2460,7 @@ gnatlib-shared-dual:
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
gnatlib
@@ -2464,6 +2470,7 @@ gnatlib-shared-dual-win32:
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
+ GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
gnatlib-shared-win32
@@ -2472,6 +2479,7 @@ gnatlib-shared-dual-win32:
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
gnatlib
@@ -2485,6 +2493,7 @@ gnatlib-shared-win32:
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
+ GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
gnatlib
@@ -2503,7 +2512,7 @@ gnatlib-shared-darwin:
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) \
- -fno-common" \
+ GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C) -fno-common" \
MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
gnatlib
@@ -2531,6 +2540,7 @@ gnatlib-shared-vms:
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
gnatlib
@@ -2559,6 +2569,7 @@ gnatlib-shared:
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
@@ -2572,6 +2583,7 @@ gnatlib-sjlj:
EH_MECHANISM="" \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
@@ -2584,6 +2596,7 @@ gnatlib-zcx:
EH_MECHANISM="-gcc" \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
diff --git a/gcc/ada/gcc-interface/ada-tree.h b/gcc/ada/gcc-interface/ada-tree.h
index 94b18bde6b5..67a16ef0eb8 100644
--- a/gcc/ada/gcc-interface/ada-tree.h
+++ b/gcc/ada/gcc-interface/ada-tree.h
@@ -65,11 +65,11 @@ do { \
/* For RECORD_TYPE, UNION_TYPE, and QUAL_UNION_TYPE, nonzero if this is a
record being used as a fat pointer (only true for RECORD_TYPE). */
-#define TYPE_IS_FAT_POINTER_P(NODE) \
+#define TYPE_FAT_POINTER_P(NODE) \
TYPE_LANG_FLAG_0 (RECORD_OR_UNION_CHECK (NODE))
-#define TYPE_FAT_POINTER_P(NODE) \
- (TREE_CODE (NODE) == RECORD_TYPE && TYPE_IS_FAT_POINTER_P (NODE))
+#define TYPE_IS_FAT_POINTER_P(NODE) \
+ (TREE_CODE (NODE) == RECORD_TYPE && TYPE_FAT_POINTER_P (NODE))
/* For integral types and array types, nonzero if this is a packed array type
used for bit-packed types. Such types should not be extended to a larger
@@ -117,15 +117,15 @@ do { \
TYPE_LANG_FLAG_3 (INTEGER_TYPE_CHECK (NODE))
/* True if NODE is a thin pointer. */
-#define TYPE_THIN_POINTER_P(NODE) \
+#define TYPE_IS_THIN_POINTER_P(NODE) \
(POINTER_TYPE_P (NODE) \
&& TREE_CODE (TREE_TYPE (NODE)) == RECORD_TYPE \
&& TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (NODE)))
/* True if TYPE is either a fat or thin pointer to an unconstrained
array. */
-#define TYPE_FAT_OR_THIN_POINTER_P(NODE) \
- (TYPE_FAT_POINTER_P (NODE) || TYPE_THIN_POINTER_P (NODE))
+#define TYPE_IS_FAT_OR_THIN_POINTER_P(NODE) \
+ (TYPE_IS_FAT_POINTER_P (NODE) || TYPE_IS_THIN_POINTER_P (NODE))
/* For INTEGER_TYPEs, nonzero if the type has a biased representation. */
#define TYPE_BIASED_REPRESENTATION_P(NODE) \
@@ -143,7 +143,6 @@ do { \
is a dummy type, made to correspond to a private or incomplete type. */
#define TYPE_DUMMY_P(NODE) TYPE_LANG_FLAG_4 (NODE)
-/* True if TYPE is such a dummy type. */
#define TYPE_IS_DUMMY_P(NODE) \
((TREE_CODE (NODE) == VOID_TYPE || TREE_CODE (NODE) == RECORD_TYPE \
|| TREE_CODE (NODE) == UNION_TYPE || TREE_CODE (NODE) == ENUMERAL_TYPE) \
@@ -160,7 +159,10 @@ do { \
/* For a RECORD_TYPE, nonzero if this was made just to supply needed
padding or alignment. */
-#define TYPE_IS_PADDING_P(NODE) TYPE_LANG_FLAG_5 (RECORD_TYPE_CHECK (NODE))
+#define TYPE_PADDING_P(NODE) TYPE_LANG_FLAG_5 (RECORD_TYPE_CHECK (NODE))
+
+#define TYPE_IS_PADDING_P(NODE) \
+ (TREE_CODE (NODE) == RECORD_TYPE && TYPE_PADDING_P (NODE))
/* True if TYPE can alias any other types. */
#define TYPE_UNIVERSAL_ALIASING_P(NODE) TYPE_LANG_FLAG_6 (NODE)
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index f2f0f159abd..c4d5e26582a 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -135,7 +135,7 @@ static tree gnat_to_gnu_param (Entity_Id, Mechanism_Type, Entity_Id, bool,
bool *);
static tree gnat_to_gnu_field (Entity_Id, tree, int, bool, bool);
static bool same_discriminant_p (Entity_Id, Entity_Id);
-static bool array_type_has_nonaliased_component (Entity_Id, tree);
+static bool array_type_has_nonaliased_component (tree, Entity_Id);
static bool compile_time_known_address_p (Node_Id);
static bool cannot_be_superflat_p (Node_Id);
static void components_to_record (tree, Node_Id, tree, int, bool, tree *,
@@ -633,7 +633,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
else
gnu_type
= maybe_pad_type (gnu_type, NULL_TREE, align, gnat_entity,
- "PAD", false, definition, true);
+ false, false, definition, true);
}
/* If we are defining the object, see if it has a Size value and
@@ -676,8 +676,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
despite having a nominal type with self-referential
size, we can get the size directly from it. */
if (TREE_CODE (gnu_expr) == COMPONENT_REF
- && TREE_CODE (TREE_TYPE (TREE_OPERAND (gnu_expr, 0)))
- == RECORD_TYPE
&& TYPE_IS_PADDING_P
(TREE_TYPE (TREE_OPERAND (gnu_expr, 0)))
&& TREE_CODE (TREE_OPERAND (gnu_expr, 0)) == VAR_DECL
@@ -838,7 +836,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
gnu_object_size = gnu_size ? gnu_size : TYPE_SIZE (gnu_type);
if (gnu_size || align > 0)
gnu_type = maybe_pad_type (gnu_type, gnu_size, align, gnat_entity,
- "PAD", false, definition,
+ false, false, definition,
gnu_size ? true : false);
/* If this is a renaming, avoid as much as possible to create a new
@@ -852,8 +850,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* If the renamed object had padding, strip off the reference
to the inner object and reset our type. */
if ((TREE_CODE (gnu_expr) == COMPONENT_REF
- && TREE_CODE (TREE_TYPE (TREE_OPERAND (gnu_expr, 0)))
- == RECORD_TYPE
&& TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_expr, 0))))
/* Strip useless conversions around the object. */
|| (TREE_CODE (gnu_expr) == NOP_EXPR
@@ -1017,16 +1013,15 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
&& !gnu_expr
&& TREE_CODE (gnu_type) == RECORD_TYPE
&& (TYPE_CONTAINS_TEMPLATE_P (gnu_type)
- /* Beware that padding might have been introduced
- via maybe_pad_type above. */
- || (TYPE_IS_PADDING_P (gnu_type)
+ /* Beware that padding might have been introduced above. */
+ || (TYPE_PADDING_P (gnu_type)
&& TREE_CODE (TREE_TYPE (TYPE_FIELDS (gnu_type)))
== RECORD_TYPE
&& TYPE_CONTAINS_TEMPLATE_P
(TREE_TYPE (TYPE_FIELDS (gnu_type))))))
{
tree template_field
- = TYPE_IS_PADDING_P (gnu_type)
+ = TYPE_PADDING_P (gnu_type)
? TYPE_FIELDS (TREE_TYPE (TYPE_FIELDS (gnu_type)))
: TYPE_FIELDS (gnu_type);
@@ -1050,17 +1045,16 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
if (gnu_expr
&& TREE_CODE (gnu_type) != UNCONSTRAINED_ARRAY_TYPE
&& !CONTAINS_PLACEHOLDER_P (TYPE_SIZE (gnu_type))
- && !(TREE_CODE (gnu_type) == RECORD_TYPE
- && TYPE_IS_PADDING_P (gnu_type)
- && (CONTAINS_PLACEHOLDER_P
- (TYPE_SIZE (TREE_TYPE (TYPE_FIELDS (gnu_type)))))))
+ && !(TYPE_IS_PADDING_P (gnu_type)
+ && CONTAINS_PLACEHOLDER_P
+ (TYPE_SIZE (TREE_TYPE (TYPE_FIELDS (gnu_type))))))
gnu_expr = convert (gnu_type, gnu_expr);
/* If this is a pointer and it does not have an initializing
expression, initialize it to NULL, unless the object is
imported. */
if (definition
- && (POINTER_TYPE_P (gnu_type) || TYPE_FAT_POINTER_P (gnu_type))
+ && (POINTER_TYPE_P (gnu_type) || TYPE_IS_FAT_POINTER_P (gnu_type))
&& !Is_Imported (gnat_entity) && !gnu_expr)
gnu_expr = integer_zero_node;
@@ -1279,10 +1273,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
if (gnu_expr
&& TREE_CODE (gnu_type) != UNCONSTRAINED_ARRAY_TYPE
&& !CONTAINS_PLACEHOLDER_P (TYPE_SIZE (gnu_type))
- && !(TREE_CODE (gnu_type) == RECORD_TYPE
- && TYPE_IS_PADDING_P (gnu_type)
- && (CONTAINS_PLACEHOLDER_P
- (TYPE_SIZE (TREE_TYPE (TYPE_FIELDS (gnu_type)))))))
+ && !(TYPE_IS_PADDING_P (gnu_type)
+ && CONTAINS_PLACEHOLDER_P
+ (TYPE_SIZE (TREE_TYPE (TYPE_FIELDS (gnu_type))))))
gnu_expr = convert (gnu_type, gnu_expr);
/* If this name is external or there was a name specified, use it,
@@ -1304,8 +1297,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
&& gnu_expr && TREE_CONSTANT (gnu_expr)
&& AGGREGATE_TYPE_P (gnu_type)
&& host_integerp (TYPE_SIZE_UNIT (gnu_type), 1)
- && !(TREE_CODE (gnu_type) == RECORD_TYPE
- && TYPE_IS_PADDING_P (gnu_type)
+ && !(TYPE_IS_PADDING_P (gnu_type)
&& !host_integerp (TYPE_SIZE_UNIT
(TREE_TYPE (TYPE_FIELDS (gnu_type))), 1)))
static_p = true;
@@ -1687,7 +1679,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
gnu_field_type, gnu_type, 1, 0, 0, 0);
finish_record_type (gnu_type, gnu_field, 0, false);
- TYPE_IS_PADDING_P (gnu_type) = 1;
+ TYPE_PADDING_P (gnu_type) = 1;
relate_alias_sets (gnu_type, gnu_field_type, ALIAS_SET_COPY);
}
@@ -1835,7 +1827,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* Do not finalize this record type since the types of its fields
are still incomplete at this point. */
finish_record_type (gnu_fat_type, tem, 0, true);
- TYPE_IS_FAT_POINTER_P (gnu_fat_type) = 1;
+ TYPE_FAT_POINTER_P (gnu_fat_type) = 1;
/* Build a reference to the template from a PLACEHOLDER_EXPR that
is the fat pointer. This will be used to access the individual
@@ -1971,7 +1963,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
{
tem = build_array_type (tem, gnu_index_types[index]);
TYPE_MULTI_ARRAY_P (tem) = (index > 0);
- if (array_type_has_nonaliased_component (gnat_entity, tem))
+ if (array_type_has_nonaliased_component (tem, gnat_entity))
TYPE_NONALIASED_COMPONENT (tem) = 1;
}
@@ -2320,7 +2312,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
{
gnu_type = build_array_type (gnu_type, gnu_index_types[index]);
TYPE_MULTI_ARRAY_P (gnu_type) = (index > 0);
- if (array_type_has_nonaliased_component (gnat_entity, gnu_type))
+ if (array_type_has_nonaliased_component (gnu_type, gnat_entity))
TYPE_NONALIASED_COMPONENT (gnu_type) = 1;
}
@@ -2477,7 +2469,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
gnu_inner = gnu_type;
while (TREE_CODE (gnu_inner) == RECORD_TYPE
&& (TYPE_JUSTIFIED_MODULAR_P (gnu_inner)
- || TYPE_IS_PADDING_P (gnu_inner)))
+ || TYPE_PADDING_P (gnu_inner)))
gnu_inner = TREE_TYPE (TYPE_FIELDS (gnu_inner));
/* We need to attach the index type to the type we just made so
@@ -2571,7 +2563,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
gnu_type
= build_array_type (gnat_to_gnu_type (Component_Type (gnat_entity)),
gnu_index_type);
- if (array_type_has_nonaliased_component (gnat_entity, gnu_type))
+ if (array_type_has_nonaliased_component (gnu_type, gnat_entity))
TYPE_NONALIASED_COMPONENT (gnu_type) = 1;
relate_alias_sets (gnu_type, gnu_string_type, ALIAS_SET_COPY);
}
@@ -2737,15 +2729,16 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
Present (gnat_field);
gnat_field = Next_Stored_Discriminant (gnat_field))
if (Present (Corresponding_Discriminant (gnat_field)))
- save_gnu_tree
- (gnat_field,
- build3 (COMPONENT_REF,
- get_unpadded_type (Etype (gnat_field)),
- gnu_get_parent,
- gnat_to_gnu_field_decl (Corresponding_Discriminant
- (gnat_field)),
- NULL_TREE),
- true);
+ {
+ tree gnu_field
+ = gnat_to_gnu_field_decl (Corresponding_Discriminant
+ (gnat_field));
+ save_gnu_tree
+ (gnat_field,
+ build3 (COMPONENT_REF, TREE_TYPE (gnu_field),
+ gnu_get_parent, gnu_field, NULL_TREE),
+ true);
+ }
/* Then we build the parent subtype. If it has discriminants but
the type itself has unknown discriminants, this means that it
@@ -2986,8 +2979,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
copy_and_substitute_in_size (gnu_type, gnu_base_type,
gnu_subst_list);
- if (TREE_CODE (gnu_base_type) == RECORD_TYPE
- && TYPE_IS_PADDING_P (gnu_base_type))
+ if (TYPE_IS_PADDING_P (gnu_base_type))
gnu_unpad_base_type = TREE_TYPE (TYPE_FIELDS (gnu_base_type));
else
gnu_unpad_base_type = gnu_base_type;
@@ -3097,7 +3089,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
{
gnu_size = DECL_SIZE (gnu_old_field);
if (TREE_CODE (gnu_field_type) == RECORD_TYPE
- && !TYPE_IS_FAT_POINTER_P (gnu_field_type)
+ && !TYPE_FAT_POINTER_P (gnu_field_type)
&& host_integerp (TYPE_SIZE (gnu_field_type), 1))
gnu_field_type
= make_packable_type (gnu_field_type, true);
@@ -3465,7 +3457,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* Make sure we can place this into a register. */
TYPE_ALIGN (gnu_type)
= MIN (BIGGEST_ALIGNMENT, 2 * POINTER_SIZE);
- TYPE_IS_FAT_POINTER_P (gnu_type) = 1;
+ TYPE_FAT_POINTER_P (gnu_type) = 1;
/* Do not finalize this record type since the types of
its fields are incomplete. */
@@ -3599,11 +3591,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
if ((! in_main_unit || is_from_limited_with) && made_dummy)
{
tree gnu_old_type
- = TYPE_FAT_POINTER_P (gnu_type)
+ = TYPE_IS_FAT_POINTER_P (gnu_type)
? TYPE_UNCONSTRAINED_ARRAY (gnu_type) : TREE_TYPE (gnu_type);
if (esize == POINTER_SIZE
- && (got_fat_p || TYPE_FAT_POINTER_P (gnu_type)))
+ && (got_fat_p || TYPE_IS_FAT_POINTER_P (gnu_type)))
gnu_type
= build_pointer_type
(TYPE_OBJECT_RECORD_TYPE
@@ -3915,8 +3907,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* If the type is a padded type and the underlying type would not
be passed by reference or this function has a foreign convention,
return the underlying type. */
- else if (TREE_CODE (gnu_return_type) == RECORD_TYPE
- && TYPE_IS_PADDING_P (gnu_return_type)
+ else if (TYPE_IS_PADDING_P (gnu_return_type)
&& (!default_pass_by_ref (TREE_TYPE
(TYPE_FIELDS (gnu_return_type)))
|| Has_Foreign_Convention (gnat_entity)))
@@ -4054,7 +4045,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
between two calls, so they can't be CSE'ed. The latter
case also handles by-ref parameters. */
if (POINTER_TYPE_P (gnu_param_type)
- || TYPE_FAT_POINTER_P (gnu_param_type))
+ || TYPE_IS_FAT_POINTER_P (gnu_param_type))
const_flag = false;
}
@@ -4417,7 +4408,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
else if ((TREE_CODE (gnu_type) == RECORD_TYPE
|| TREE_CODE (gnu_type) == UNION_TYPE
|| TREE_CODE (gnu_type) == QUAL_UNION_TYPE)
- && !TYPE_IS_FAT_POINTER_P (gnu_type))
+ && !TYPE_FAT_POINTER_P (gnu_type))
size = rm_size (gnu_type);
else
size = TYPE_SIZE (gnu_type);
@@ -4446,10 +4437,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
us when we make the new TYPE_DECL below. */
if (gnu_size || align > 0)
gnu_type = maybe_pad_type (gnu_type, gnu_size, align, gnat_entity,
- "PAD", true, definition, false);
+ false, !gnu_decl, definition, false);
- if (TREE_CODE (gnu_type) == RECORD_TYPE
- && TYPE_IS_PADDING_P (gnu_type))
+ if (TYPE_IS_PADDING_P (gnu_type))
{
gnu_entity_name = TYPE_NAME (gnu_type);
if (TREE_CODE (gnu_entity_name) == TYPE_DECL)
@@ -4566,7 +4556,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
!Comes_From_Source (gnat_entity),
debug_info_p, gnat_entity);
else
- TREE_TYPE (gnu_decl) = gnu_type;
+ {
+ TREE_TYPE (gnu_decl) = gnu_type;
+ TYPE_STUB_DECL (gnu_type) = gnu_decl;
+ }
}
if (is_type && !TYPE_IS_DUMMY_P (TREE_TYPE (gnu_decl)))
@@ -4609,11 +4602,38 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
superset superset
R ----------> D ----------> T
+ However, for composite types, conversions between derived types are
+ translated into VIEW_CONVERT_EXPRs so a sequence like:
+
+ type Comp1 is new Comp;
+ type Comp2 is new Comp;
+ procedure Proc (C : Comp1);
+
+ C : Comp2;
+ Proc (Comp1 (C));
+
+ is translated into:
+
+ C : Comp2;
+ Proc ((Comp1 &) &VIEW_CONVERT_EXPR <Comp1> (C));
+
+ and gimplified into:
+
+ C : Comp2;
+ Comp1 *C.0;
+ C.0 = (Comp1 *) &C;
+ Proc (C.0);
+
+ i.e. generates code involving type punning. Therefore, Comp1 needs
+ to conflict with Comp2 and an alias set copy is required.
+
The language rules ensure the parent type is already frozen here. */
if (Is_Derived_Type (gnat_entity))
{
tree gnu_parent_type = gnat_to_gnu_type (Etype (gnat_entity));
- relate_alias_sets (gnu_type, gnu_parent_type, ALIAS_SET_SUPERSET);
+ relate_alias_sets (gnu_type, gnu_parent_type,
+ Is_Composite_Type (gnat_entity)
+ ? ALIAS_SET_COPY : ALIAS_SET_SUPERSET);
}
/* Back-annotate the Alignment of the type if not already in the
@@ -4705,8 +4725,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
tree gnu_low_bound, gnu_high_bound;
/* If this is a padded type, we need to use the underlying type. */
- if (TREE_CODE (gnu_scalar_type) == RECORD_TYPE
- && TYPE_IS_PADDING_P (gnu_scalar_type))
+ if (TYPE_IS_PADDING_P (gnu_scalar_type))
gnu_scalar_type = TREE_TYPE (TYPE_FIELDS (gnu_scalar_type));
/* If this is a floating point type and we haven't set a floating
@@ -4852,7 +4871,7 @@ get_unpadded_type (Entity_Id gnat_entity)
{
tree type = gnat_to_gnu_type (gnat_entity);
- if (TREE_CODE (type) == RECORD_TYPE && TYPE_IS_PADDING_P (type))
+ if (TYPE_IS_PADDING_P (type))
type = TREE_TYPE (TYPE_FIELDS (type));
return type;
@@ -4985,7 +5004,7 @@ gnat_to_gnu_component_type (Entity_Id gnat_array, bool definition,
&& !Has_Aliased_Components (gnat_array)
&& !Strict_Alignment (Component_Type (gnat_array))
&& TREE_CODE (gnu_type) == RECORD_TYPE
- && !TYPE_IS_FAT_POINTER_P (gnu_type)
+ && !TYPE_FAT_POINTER_P (gnu_type)
&& host_integerp (TYPE_SIZE (gnu_type), 1))
gnu_type = make_packable_type (gnu_type, false);
@@ -5037,7 +5056,7 @@ gnat_to_gnu_component_type (Entity_Id gnat_array, bool definition,
orig_type = gnu_type;
gnu_type = maybe_pad_type (gnu_type, gnu_comp_size, 0, gnat_array,
- "C_PAD", false, definition, true);
+ true, false, definition, true);
/* If a padding record was made, declare it now since it will never be
declared otherwise. This is necessary to ensure that its subtrees
@@ -5089,8 +5108,7 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech,
/* If this is either a foreign function or if the underlying type won't
be passed by reference, strip off possible padding type. */
- if (TREE_CODE (gnu_param_type) == RECORD_TYPE
- && TYPE_IS_PADDING_P (gnu_param_type))
+ if (TYPE_IS_PADDING_P (gnu_param_type))
{
tree unpadded_type = TREE_TYPE (TYPE_FIELDS (gnu_param_type));
@@ -5162,7 +5180,7 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech,
}
/* Fat pointers are passed as thin pointers for foreign conventions. */
- else if (foreign && TYPE_FAT_POINTER_P (gnu_param_type))
+ else if (foreign && TYPE_IS_FAT_POINTER_P (gnu_param_type))
gnu_param_type
= make_type_from_size (gnu_param_type, size_int (POINTER_SIZE), 0);
@@ -5263,21 +5281,38 @@ same_discriminant_p (Entity_Id discr1, Entity_Id discr2)
Original_Record_Component (discr1) == Original_Record_Component (discr2);
}
-/* Return true if the array type specified by GNAT_TYPE and GNU_TYPE has
- a non-aliased component in the back-end sense. */
+/* Return true if the array type GNU_TYPE, which represents a dimension of
+ GNAT_TYPE, has a non-aliased component in the back-end sense. */
static bool
-array_type_has_nonaliased_component (Entity_Id gnat_type, tree gnu_type)
+array_type_has_nonaliased_component (tree gnu_type, Entity_Id gnat_type)
{
- /* If the type below this is a multi-array type, then
- this does not have aliased components. */
+ /* If the array type is not the innermost dimension of the GNAT type,
+ then it has a non-aliased component. */
if (TREE_CODE (TREE_TYPE (gnu_type)) == ARRAY_TYPE
&& TYPE_MULTI_ARRAY_P (TREE_TYPE (gnu_type)))
return true;
+ /* If the array type has an aliased component in the front-end sense,
+ then it also has an aliased component in the back-end sense. */
if (Has_Aliased_Components (gnat_type))
return false;
+ /* If this is a derived type, then it has a non-aliased component if
+ and only if its parent type also has one. */
+ if (Is_Derived_Type (gnat_type))
+ {
+ tree gnu_parent_type = gnat_to_gnu_type (Etype (gnat_type));
+ int index;
+ if (TREE_CODE (gnu_parent_type) == UNCONSTRAINED_ARRAY_TYPE)
+ gnu_parent_type
+ = TREE_TYPE (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (gnu_parent_type))));
+ for (index = Number_Dimensions (gnat_type) - 1; index > 0; index--)
+ gnu_parent_type = TREE_TYPE (gnu_parent_type);
+ return TYPE_NONALIASED_COMPONENT (gnu_parent_type);
+ }
+
+ /* Otherwise, rely exclusively on properties of the element type. */
return type_for_nonaliased_component_p (TREE_TYPE (gnu_type));
}
@@ -5463,7 +5498,7 @@ relate_alias_sets (tree gnu_new_type, tree gnu_old_type, enum alias_set_op op)
see the inner types. */
while (TREE_CODE (gnu_old_type) == RECORD_TYPE
&& (TYPE_JUSTIFIED_MODULAR_P (gnu_old_type)
- || TYPE_IS_PADDING_P (gnu_old_type)))
+ || TYPE_PADDING_P (gnu_old_type)))
gnu_old_type = TREE_TYPE (TYPE_FIELDS (gnu_old_type));
/* Unconstrained array types are deemed incomplete and would thus be given
@@ -5929,7 +5964,7 @@ make_packable_type (tree type, bool in_record)
TYPE_JUSTIFIED_MODULAR_P (new_type) = TYPE_JUSTIFIED_MODULAR_P (type);
TYPE_CONTAINS_TEMPLATE_P (new_type) = TYPE_CONTAINS_TEMPLATE_P (type);
if (TREE_CODE (type) == RECORD_TYPE)
- TYPE_IS_PADDING_P (new_type) = TYPE_IS_PADDING_P (type);
+ TYPE_PADDING_P (new_type) = TYPE_PADDING_P (type);
/* If we are in a record and have a small size, set the alignment to
try for an integral mode. Otherwise set it to try for a smaller
@@ -5972,7 +6007,7 @@ make_packable_type (tree type, bool in_record)
if ((TREE_CODE (new_field_type) == RECORD_TYPE
|| TREE_CODE (new_field_type) == UNION_TYPE
|| TREE_CODE (new_field_type) == QUAL_UNION_TYPE)
- && !TYPE_IS_FAT_POINTER_P (new_field_type)
+ && !TYPE_FAT_POINTER_P (new_field_type)
&& host_integerp (TYPE_SIZE (new_field_type), 1))
new_field_type = make_packable_type (new_field_type, true);
@@ -5984,7 +6019,7 @@ make_packable_type (tree type, bool in_record)
&& (TREE_CODE (new_field_type) == RECORD_TYPE
|| TREE_CODE (new_field_type) == UNION_TYPE
|| TREE_CODE (new_field_type) == QUAL_UNION_TYPE)
- && !TYPE_IS_FAT_POINTER_P (new_field_type)
+ && !TYPE_FAT_POINTER_P (new_field_type)
&& !TYPE_CONTAINS_TEMPLATE_P (new_field_type)
&& TYPE_ADA_SIZE (new_field_type))
new_size = TYPE_ADA_SIZE (new_field_type);
@@ -6013,8 +6048,7 @@ make_packable_type (tree type, bool in_record)
/* If this is a padding record, we never want to make the size smaller
than what was specified. For QUAL_UNION_TYPE, also copy the size. */
- if ((TREE_CODE (type) == RECORD_TYPE && TYPE_IS_PADDING_P (type))
- || TREE_CODE (type) == QUAL_UNION_TYPE)
+ if (TYPE_IS_PADDING_P (type) || TREE_CODE (type) == QUAL_UNION_TYPE)
{
TYPE_SIZE (new_type) = TYPE_SIZE (type);
TYPE_SIZE_UNIT (new_type) = TYPE_SIZE_UNIT (type);
@@ -6046,25 +6080,20 @@ make_packable_type (tree type, bool in_record)
/* Ensure that TYPE has SIZE and ALIGN. Make and return a new padded type
if needed. We have already verified that SIZE and TYPE are large enough.
-
- GNAT_ENTITY and NAME_TRAILER are used to name the resulting record and
- to issue a warning.
-
- IS_USER_TYPE is true if we must complete the original type.
-
- DEFINITION is true if this type is being defined.
-
- SAME_RM_SIZE is true if the RM size of the resulting type is to be set
- to SIZE too; otherwise, it's set to the RM size of the original type. */
+ GNAT_ENTITY is used to name the resulting record and to issue a warning.
+ IS_COMPONENT_TYPE is true if this is being done for the component type
+ of an array. IS_USER_TYPE is true if we must complete the original type.
+ DEFINITION is true if this type is being defined. SAME_RM_SIZE is true
+ if the RM size of the resulting type is to be set to SIZE too; otherwise,
+ it's set to the RM size of the original type. */
tree
maybe_pad_type (tree type, tree size, unsigned int align,
- Entity_Id gnat_entity, const char *name_trailer,
+ Entity_Id gnat_entity, bool is_component_type,
bool is_user_type, bool definition, bool same_rm_size)
{
tree orig_rm_size = same_rm_size ? NULL_TREE : rm_size (type);
tree orig_size = TYPE_SIZE (type);
- unsigned int orig_align = align;
tree record, field;
/* If TYPE is a padded type, see if it agrees with any size and alignment
@@ -6072,7 +6101,7 @@ maybe_pad_type (tree type, tree size, unsigned int align,
off the padding, since we will either be returning the inner type
or repadding it. If no size or alignment is specified, use that of
the original padded type. */
- if (TREE_CODE (type) == RECORD_TYPE && TYPE_IS_PADDING_P (type))
+ if (TYPE_IS_PADDING_P (type))
{
if ((!size
|| operand_equal_p (round_up (size,
@@ -6121,18 +6150,15 @@ maybe_pad_type (tree type, tree size, unsigned int align,
generate incorrect debugging information. So make a new record
type and name. */
record = make_node (RECORD_TYPE);
- TYPE_IS_PADDING_P (record) = 1;
+ TYPE_PADDING_P (record) = 1;
if (Present (gnat_entity))
- TYPE_NAME (record) = create_concat_name (gnat_entity, name_trailer);
+ TYPE_NAME (record) = create_concat_name (gnat_entity, "PAD");
TYPE_VOLATILE (record)
= Present (gnat_entity) && Treat_As_Volatile (gnat_entity);
TYPE_ALIGN (record) = align;
- if (orig_align)
- TYPE_USER_ALIGN (record) = align;
-
TYPE_SIZE (record) = size ? size : orig_size;
TYPE_SIZE_UNIT (record)
= convert (sizetype,
@@ -6256,7 +6282,7 @@ maybe_pad_type (tree type, tree size, unsigned int align,
post_error_ne_tree ("{^ }bits of & unused?",
gnat_error_node, gnat_entity,
size_diffop (size, orig_size));
- else if (name_trailer[0] == 'C')
+ else if (is_component_type)
post_error_ne_tree ("component of& padded{ by ^ bits}?",
gnat_entity, gnat_entity,
size_diffop (size, orig_size));
@@ -6447,7 +6473,7 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed,
from a component clause. */
if (TREE_CODE (gnu_field_type) == RECORD_TYPE
- && !TYPE_IS_FAT_POINTER_P (gnu_field_type)
+ && !TYPE_FAT_POINTER_P (gnu_field_type)
&& host_integerp (TYPE_SIZE (gnu_field_type), 1)
&& (packed == 1
|| (gnu_size
@@ -6634,7 +6660,7 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed,
orig_field_type = gnu_field_type;
gnu_field_type = maybe_pad_type (gnu_field_type, gnu_size, 0, gnat_field,
- "PAD", false, definition, true);
+ false, false, definition, true);
/* If a padding record was made, declare it now since it will never be
declared otherwise. This is necessary to ensure that its subtrees
@@ -6677,8 +6703,7 @@ is_variable_size (tree type)
if (!TREE_CONSTANT (TYPE_SIZE (type)))
return true;
- if (TREE_CODE (type) == RECORD_TYPE
- && TYPE_IS_PADDING_P (type)
+ if (TYPE_IS_PADDING_P (type)
&& !TREE_CONSTANT (DECL_SIZE (TYPE_FIELDS (type))))
return true;
@@ -7227,7 +7252,7 @@ annotate_object (Entity_Id gnat_entity, tree gnu_type, tree size, bool by_ref)
{
if (by_ref)
{
- if (TYPE_FAT_POINTER_P (gnu_type))
+ if (TYPE_IS_FAT_POINTER_P (gnu_type))
gnu_type = TYPE_UNCONSTRAINED_ARRAY (gnu_type);
else
gnu_type = TREE_TYPE (gnu_type);
@@ -7250,6 +7275,23 @@ annotate_object (Entity_Id gnat_entity, tree gnu_type, tree size, bool by_ref)
UI_From_Int (TYPE_ALIGN (gnu_type) / BITS_PER_UNIT));
}
+/* Return first element of field list whose TREE_PURPOSE is ELEM or whose
+ DECL_ORIGINAL_FIELD of TREE_PURPOSE is ELEM. Return NULL_TREE if there
+ is no such element in the list. */
+
+static tree
+purpose_member_field (const_tree elem, tree list)
+{
+ while (list)
+ {
+ tree field = TREE_PURPOSE (list);
+ if (elem == field || elem == DECL_ORIGINAL_FIELD (field))
+ return list;
+ list = TREE_CHAIN (list);
+ }
+ return NULL_TREE;
+}
+
/* Given GNAT_ENTITY, a record type, and GNU_TYPE, its corresponding GCC type,
set Component_Bit_Offset and Esize of the components to the position and
size used by Gigi. */
@@ -7273,11 +7315,12 @@ annotate_rep (Entity_Id gnat_entity, tree gnu_type)
|| (Ekind (gnat_field) == E_Discriminant
&& !Is_Unchecked_Union (Scope (gnat_field))))
{
- tree parent_offset, t;
-
- t = purpose_member (gnat_to_gnu_field_decl (gnat_field), gnu_list);
+ tree t = purpose_member_field (gnat_to_gnu_field_decl (gnat_field),
+ gnu_list);
if (t)
{
+ tree parent_offset;
+
if (type_annotate_only && Is_Tagged_Type (gnat_entity))
{
/* In this mode the tag and parent components are not
@@ -7394,12 +7437,16 @@ build_subst_list (Entity_Id gnat_subtype, Entity_Id gnat_type, bool definition)
gnat_value = Next_Elmt (gnat_value))
/* Ignore access discriminants. */
if (!Is_Access_Type (Etype (Node (gnat_value))))
- gnu_list = tree_cons (gnat_to_gnu_field_decl (gnat_discrim),
- elaborate_expression
- (Node (gnat_value), gnat_subtype,
- get_entity_name (gnat_discrim), definition,
- true, false),
- gnu_list);
+ {
+ tree gnu_field = gnat_to_gnu_field_decl (gnat_discrim);
+ gnu_list = tree_cons (gnu_field,
+ convert (TREE_TYPE (gnu_field),
+ elaborate_expression
+ (Node (gnat_value), gnat_subtype,
+ get_entity_name (gnat_discrim),
+ definition, true, false)),
+ gnu_list);
+ }
return gnu_list;
}
@@ -7542,7 +7589,7 @@ validate_size (Uint uint_size, tree gnu_type, Entity_Id gnat_object,
/* If this is an access type or a fat pointer, the minimum size is that given
by the smallest integral mode that's valid for pointers. */
- if ((TREE_CODE (gnu_type) == POINTER_TYPE) || TYPE_FAT_POINTER_P (gnu_type))
+ if (TREE_CODE (gnu_type) == POINTER_TYPE || TYPE_IS_FAT_POINTER_P (gnu_type))
{
enum machine_mode p_mode;
@@ -7636,8 +7683,7 @@ set_rm_size (Uint uint_size, tree gnu_type, Entity_Id gnat_entity)
|| (AGGREGATE_TYPE_P (gnu_type)
&& !(TREE_CODE (gnu_type) == ARRAY_TYPE
&& TYPE_PACKED_ARRAY_TYPE_P (gnu_type))
- && !(TREE_CODE (gnu_type) == RECORD_TYPE
- && TYPE_IS_PADDING_P (gnu_type)
+ && !(TYPE_IS_PADDING_P (gnu_type)
&& TREE_CODE (TREE_TYPE (TYPE_FIELDS (gnu_type))) == ARRAY_TYPE
&& TYPE_PACKED_ARRAY_TYPE_P (TREE_TYPE (TYPE_FIELDS (gnu_type))))
&& tree_int_cst_lt (size, old_size)))
@@ -7660,7 +7706,7 @@ set_rm_size (Uint uint_size, tree gnu_type, Entity_Id gnat_entity)
else if ((TREE_CODE (gnu_type) == RECORD_TYPE
|| TREE_CODE (gnu_type) == UNION_TYPE
|| TREE_CODE (gnu_type) == QUAL_UNION_TYPE)
- && !TYPE_IS_FAT_POINTER_P (gnu_type))
+ && !TYPE_FAT_POINTER_P (gnu_type))
SET_TYPE_ADA_SIZE (gnu_type, size);
}
@@ -7691,6 +7737,10 @@ make_type_from_size (tree type, tree size_tree, bool for_biased)
biased_p = (TREE_CODE (type) == INTEGER_TYPE
&& TYPE_BIASED_REPRESENTATION_P (type));
+ /* Integer types with precision 0 are forbidden. */
+ if (size == 0)
+ size = 1;
+
/* Only do something if the type is not a packed array type and
doesn't already have the proper size. */
if (TYPE_PACKED_ARRAY_TYPE_P (type)
@@ -7727,7 +7777,7 @@ make_type_from_size (tree type, tree size_tree, bool for_biased)
case RECORD_TYPE:
/* Do something if this is a fat pointer, in which case we
may need to return the thin pointer. */
- if (TYPE_IS_FAT_POINTER_P (type) && size < POINTER_SIZE * 2)
+ if (TYPE_FAT_POINTER_P (type) && size < POINTER_SIZE * 2)
{
enum machine_mode p_mode = mode_for_size (size, MODE_INT, 0);
if (!targetm.valid_pointer_mode (p_mode))
@@ -7742,7 +7792,7 @@ make_type_from_size (tree type, tree size_tree, bool for_biased)
case POINTER_TYPE:
/* Only do something if this is a thin pointer, in which case we
may need to return the fat pointer. */
- if (TYPE_THIN_POINTER_P (type) && size >= POINTER_SIZE * 2)
+ if (TYPE_IS_THIN_POINTER_P (type) && size >= POINTER_SIZE * 2)
return
build_pointer_type (TYPE_UNCONSTRAINED_ARRAY (TREE_TYPE (type)));
break;
@@ -8393,7 +8443,7 @@ rm_size (tree gnu_type)
if ((TREE_CODE (gnu_type) == RECORD_TYPE
|| TREE_CODE (gnu_type) == UNION_TYPE
|| TREE_CODE (gnu_type) == QUAL_UNION_TYPE)
- && !TYPE_IS_FAT_POINTER_P (gnu_type)
+ && !TYPE_FAT_POINTER_P (gnu_type)
&& TYPE_ADA_SIZE (gnu_type))
return TYPE_ADA_SIZE (gnu_type);
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h
index ea1a65d485b..82d193bfc5c 100644
--- a/gcc/ada/gcc-interface/gigi.h
+++ b/gcc/ada/gcc-interface/gigi.h
@@ -124,21 +124,16 @@ extern tree make_aligning_type (tree type, unsigned int align, tree size,
/* Ensure that TYPE has SIZE and ALIGN. Make and return a new padded type
if needed. We have already verified that SIZE and TYPE are large enough.
-
- GNAT_ENTITY and NAME_TRAILER are used to name the resulting record and
- to issue a warning.
-
- IS_USER_TYPE is true if we must be sure we complete the original type.
-
- DEFINITION is true if this type is being defined.
-
- SAME_RM_SIZE is true if the RM_Size of the resulting type is to be
- set to its TYPE_SIZE; otherwise, it's set to the RM_Size of the original
- type. */
+ GNAT_ENTITY is used to name the resulting record and to issue a warning.
+ IS_COMPONENT_TYPE is true if this is being done for the component type
+ of an array. IS_USER_TYPE is true if we must complete the original type.
+ DEFINITION is true if this type is being defined. SAME_RM_SIZE is true
+ if the RM size of the resulting type is to be set to SIZE too; otherwise,
+ it's set to the RM size of the original type. */
extern tree maybe_pad_type (tree type, tree size, unsigned int align,
- Entity_Id gnat_entity, const char *name_trailer,
+ Entity_Id gnat_entity, bool is_component_type,
bool is_user_type, bool definition,
- bool same_rm_size);
+ bool same_rm_size);
/* Given a GNU tree and a GNAT list of choices, generate an expression to test
the value passed against the list of choices. */
@@ -648,12 +643,13 @@ extern void record_global_renaming_pointer (tree decl);
/* Invalidate the global renaming pointers. */
extern void invalidate_global_renaming_pointers (void);
-/* Returns a FIELD_DECL node. FIELD_NAME the field name, FIELD_TYPE is its
- type, and RECORD_TYPE is the type of the parent. PACKED is nonzero if
- this field is in a record type with a "pragma pack". If SIZE is nonzero
- it is the specified size for this field. If POS is nonzero, it is the bit
- position. If ADDRESSABLE is nonzero, it means we are allowed to take
- the address of this field for aliasing purposes. */
+/* Return a FIELD_DECL node. FIELD_NAME is the field's name, FIELD_TYPE is
+ its type and RECORD_TYPE is the type of the enclosing record. PACKED is
+ 1 if the enclosing record is packed, -1 if it has Component_Alignment of
+ Storage_Unit. If SIZE is nonzero, it is the specified size of the field.
+ If POS is nonzero, it is the bit position. If ADDRESSABLE is nonzero, it
+ means we are allowed to take the address of the field; if it is negative,
+ we should not make a bitfield, which is used by make_aligning_type. */
extern tree create_field_decl (tree field_name, tree field_type,
tree record_type, int packed, tree size,
tree pos, int addressable);
diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c
index 67823789ab3..570bd111a95 100644
--- a/gcc/ada/gcc-interface/misc.c
+++ b/gcc/ada/gcc-interface/misc.c
@@ -527,7 +527,7 @@ gnat_print_type (FILE *file, tree node, int indent)
break;
case RECORD_TYPE:
- if (TYPE_IS_FAT_POINTER_P (node) || TYPE_CONTAINS_TEMPLATE_P (node))
+ if (TYPE_FAT_POINTER_P (node) || TYPE_CONTAINS_TEMPLATE_P (node))
print_node (file, "unconstrained array",
TYPE_UNCONSTRAINED_ARRAY (node), indent + 4);
else
@@ -600,8 +600,7 @@ static alias_set_type
gnat_get_alias_set (tree type)
{
/* If this is a padding type, use the type of the first field. */
- if (TREE_CODE (type) == RECORD_TYPE
- && TYPE_IS_PADDING_P (type))
+ if (TYPE_IS_PADDING_P (type))
return get_alias_set (TREE_TYPE (TYPE_FIELDS (type)));
/* If the type is an unconstrained array, use the type of the
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index d94d1f45bfc..41be8bb77af 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -657,17 +657,16 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name,
error_gnat_node = Empty;
}
-/* Return a positive value if an lvalue is required for GNAT_NODE.
- GNU_TYPE is the type that will be used for GNAT_NODE in the
- translated GNU tree. CONSTANT indicates whether the underlying
- object represented by GNAT_NODE is constant in the Ada sense,
- ALIASED whether it is aliased (but the latter doesn't affect
- the outcome if CONSTANT is not true).
-
- The function climbs up the GNAT tree starting from the node and
- returns 1 upon encountering a node that effectively requires an
- lvalue downstream. It returns int instead of bool to facilitate
- usage in non purely binary logic contexts. */
+/* Return a positive value if an lvalue is required for GNAT_NODE. GNU_TYPE
+ is the type that will be used for GNAT_NODE in the translated GNU tree.
+ CONSTANT indicates whether the underlying object represented by GNAT_NODE
+ is constant in the Ada sense, ALIASED whether it is aliased (but the latter
+ doesn't affect the outcome if CONSTANT is not true).
+
+ The function climbs up the GNAT tree starting from the node and returns 1
+ upon encountering a node that effectively requires an lvalue downstream.
+ It returns int instead of bool to facilitate usage in non-purely binary
+ logic contexts. */
static int
lvalue_required_p (Node_Id gnat_node, tree gnu_type, bool constant,
@@ -754,6 +753,13 @@ lvalue_required_p (Node_Id gnat_node, tree gnu_type, bool constant,
|| (Is_Composite_Type (Underlying_Type (Etype (gnat_node)))
&& Is_Atomic (Entity (Name (gnat_parent)))));
+ case N_Unchecked_Type_Conversion:
+ /* Returning 0 is very likely correct but we get better code if we
+ go through the conversion. */
+ return lvalue_required_p (gnat_parent,
+ get_unpadded_type (Etype (gnat_parent)),
+ constant, aliased);
+
default:
return 0;
}
@@ -946,8 +952,7 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p)
|| Is_Constr_Subt_For_UN_Aliased (gnat_temp_type))
{
gnu_result_type = TREE_TYPE (gnu_result);
- if (TREE_CODE (gnu_result_type) == RECORD_TYPE
- && TYPE_IS_PADDING_P (gnu_result_type))
+ if (TYPE_IS_PADDING_P (gnu_result_type))
gnu_result_type = TREE_TYPE (TYPE_FIELDS (gnu_result_type));
}
@@ -1256,7 +1261,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
/* If this is an unconstrained array, we know the object has been
allocated with the template in front of the object. So compute
the template address. */
- if (TYPE_FAT_POINTER_P (TREE_TYPE (gnu_ptr)))
+ if (TYPE_IS_FAT_POINTER_P (TREE_TYPE (gnu_ptr)))
gnu_ptr
= convert (build_pointer_type
(TYPE_OBJECT_RECORD_TYPE
@@ -1318,29 +1323,28 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
}
/* If we're looking for the size of a field, return the field size.
- Otherwise, if the prefix is an object, or if 'Object_Size or
- 'Max_Size_In_Storage_Elements has been specified, the result is the
- GCC size of the type. Otherwise, the result is the RM size of the
- type. */
+ Otherwise, if the prefix is an object, or if we're looking for
+ 'Object_Size or 'Max_Size_In_Storage_Elements, the result is the
+ GCC size of the type. Otherwise, it is the RM size of the type. */
if (TREE_CODE (gnu_prefix) == COMPONENT_REF)
gnu_result = DECL_SIZE (TREE_OPERAND (gnu_prefix, 1));
else if (TREE_CODE (gnu_prefix) != TYPE_DECL
|| attribute == Attr_Object_Size
|| attribute == Attr_Max_Size_In_Storage_Elements)
{
- /* If this is a padded type, the GCC size isn't relevant to the
- programmer. Normally, what we want is the RM size, which was set
- from the specified size, but if it was not set, we want the size
- of the relevant field. Using the MAX of those two produces the
- right result in all case. Don't use the size of the field if it's
- a self-referential type, since that's never what's wanted. */
- if (TREE_CODE (gnu_type) == RECORD_TYPE
+ /* If the prefix is an object of a padded type, the GCC size isn't
+ relevant to the programmer. Normally what we want is the RM size,
+ which was set from the specified size, but if it was not set, we
+ want the size of the field. Using the MAX of those two produces
+ the right result in all cases. Don't use the size of the field
+ if it's self-referential, since that's never what's wanted. */
+ if (TREE_CODE (gnu_prefix) != TYPE_DECL
&& TYPE_IS_PADDING_P (gnu_type)
&& TREE_CODE (gnu_expr) == COMPONENT_REF)
{
gnu_result = rm_size (gnu_type);
- if (!(CONTAINS_PLACEHOLDER_P
- (DECL_SIZE (TREE_OPERAND (gnu_expr, 1)))))
+ if (!CONTAINS_PLACEHOLDER_P
+ (DECL_SIZE (TREE_OPERAND (gnu_expr, 1))))
gnu_result
= size_binop (MAX_EXPR, gnu_result,
DECL_SIZE (TREE_OPERAND (gnu_expr, 1)));
@@ -1353,7 +1357,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
tree gnu_ptr_type
= TREE_TYPE (gnat_to_gnu (Prefix (gnat_deref)));
- if (TYPE_FAT_OR_THIN_POINTER_P (gnu_ptr_type)
+ if (TYPE_IS_FAT_OR_THIN_POINTER_P (gnu_ptr_type)
&& Present (gnat_actual_subtype))
{
tree gnu_actual_obj_type
@@ -1403,9 +1407,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
unsigned int align;
if (TREE_CODE (gnu_prefix) == COMPONENT_REF
- && (TREE_CODE (TREE_TYPE (TREE_OPERAND (gnu_prefix, 0)))
- == RECORD_TYPE)
- && (TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_prefix, 0)))))
+ && TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_prefix, 0))))
gnu_prefix = TREE_OPERAND (gnu_prefix, 0);
gnu_type = TREE_TYPE (gnu_prefix);
@@ -1742,9 +1744,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
case Attr_Component_Size:
if (TREE_CODE (gnu_prefix) == COMPONENT_REF
- && (TREE_CODE (TREE_TYPE (TREE_OPERAND (gnu_prefix, 0)))
- == RECORD_TYPE)
- && (TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_prefix, 0)))))
+ && TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_prefix, 0))))
gnu_prefix = TREE_OPERAND (gnu_prefix, 0);
gnu_prefix = maybe_implicit_deref (gnu_prefix);
@@ -2423,22 +2423,27 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
}
}
- /* If we are calling by supplying a pointer to a target, set up that
- pointer as the first argument. Use GNU_TARGET if one was passed;
- otherwise, make a target by building a variable of the maximum size
- of the type. */
+ /* If we are calling by supplying a pointer to a target, set up that pointer
+ as the first argument. Use GNU_TARGET if one was passed; otherwise, make
+ a target by building a variable and use the maximum size of the type if
+ it has self-referential size. */
if (TYPE_RETURNS_BY_TARGET_PTR_P (gnu_subprog_type))
{
- tree gnu_real_ret_type
+ tree gnu_ret_type
= TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (gnu_subprog_type)));
if (!gnu_target)
{
- tree gnu_obj_type
- = maybe_pad_type (gnu_real_ret_type,
- max_size (TYPE_SIZE (gnu_real_ret_type), true),
- 0, Etype (Name (gnat_node)), "PAD", false,
- false, false);
+ tree gnu_obj_type;
+
+ if (CONTAINS_PLACEHOLDER_P (TYPE_SIZE (gnu_ret_type)))
+ gnu_obj_type
+ = maybe_pad_type (gnu_ret_type,
+ max_size (TYPE_SIZE (gnu_ret_type), true),
+ 0, Etype (Name (gnat_node)), false, false,
+ false, true);
+ else
+ gnu_obj_type = gnu_ret_type;
/* ??? We may be about to create a static temporary if we happen to
be at the global binding level. That's a regression from what
@@ -2454,7 +2459,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
gnu_actual_list
= tree_cons (NULL_TREE,
build_unary_op (ADDR_EXPR, NULL_TREE,
- unchecked_convert (gnu_real_ret_type,
+ unchecked_convert (gnu_ret_type,
gnu_target,
false)),
NULL_TREE);
@@ -2557,10 +2562,8 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
/* Otherwise remove unpadding from the object and reset the copy. */
else if (TREE_CODE (gnu_name) == COMPONENT_REF
- && ((TREE_CODE (TREE_TYPE (TREE_OPERAND (gnu_name, 0)))
- == RECORD_TYPE)
- && (TYPE_IS_PADDING_P
- (TREE_TYPE (TREE_OPERAND (gnu_name, 0))))))
+ && TYPE_IS_PADDING_P
+ (TREE_TYPE (TREE_OPERAND (gnu_name, 0))))
gnu_name = gnu_copy = TREE_OPERAND (gnu_name, 0);
/* Otherwise convert to the nominal type of the object if it's
@@ -2599,7 +2602,6 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
/* If this was a procedure call, we may not have removed any padding.
So do it here for the part we will use as an input, if any. */
if (Ekind (gnat_formal) != E_Out_Parameter
- && TREE_CODE (TREE_TYPE (gnu_actual)) == RECORD_TYPE
&& TYPE_IS_PADDING_P (TREE_TYPE (gnu_actual)))
gnu_actual = convert (get_unpadded_type (Etype (gnat_actual)),
gnu_actual);
@@ -2669,8 +2671,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
gnu_actual = gnu_name;
/* If we have a padded type, be sure we've removed padding. */
- if (TREE_CODE (TREE_TYPE (gnu_actual)) == RECORD_TYPE
- && TYPE_IS_PADDING_P (TREE_TYPE (gnu_actual))
+ if (TYPE_IS_PADDING_P (TREE_TYPE (gnu_actual))
&& TREE_CODE (gnu_actual) != SAVE_EXPR)
gnu_actual = convert (get_unpadded_type (Etype (gnat_actual)),
gnu_actual);
@@ -2703,8 +2704,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
gnu_actual = maybe_implicit_deref (gnu_actual);
gnu_actual = maybe_unconstrained_array (gnu_actual);
- if (TREE_CODE (gnu_formal_type) == RECORD_TYPE
- && TYPE_IS_PADDING_P (gnu_formal_type))
+ if (TYPE_IS_PADDING_P (gnu_formal_type))
{
gnu_formal_type = TREE_TYPE (TYPE_FIELDS (gnu_formal_type));
gnu_actual = convert (gnu_formal_type, gnu_actual);
@@ -2896,8 +2896,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
= maybe_unconstrained_array (TREE_VALUE (gnu_name_list));
/* If the result is a padded type, remove the padding. */
- if (TREE_CODE (TREE_TYPE (gnu_result)) == RECORD_TYPE
- && TYPE_IS_PADDING_P (TREE_TYPE (gnu_result)))
+ if (TYPE_IS_PADDING_P (TREE_TYPE (gnu_result)))
gnu_result = convert (TREE_TYPE (TYPE_FIELDS
(TREE_TYPE (gnu_result))),
gnu_result);
@@ -3856,8 +3855,7 @@ gnat_to_gnu (Node_Id gnat_node)
gnu_array_object = maybe_unconstrained_array (gnu_array_object);
/* If we got a padded type, remove it too. */
- if (TREE_CODE (TREE_TYPE (gnu_array_object)) == RECORD_TYPE
- && TYPE_IS_PADDING_P (TREE_TYPE (gnu_array_object)))
+ if (TYPE_IS_PADDING_P (TREE_TYPE (gnu_array_object)))
gnu_array_object
= convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (gnu_array_object))),
gnu_array_object);
@@ -4713,12 +4711,10 @@ gnat_to_gnu (Node_Id gnat_node)
type is self-referential since we want to allocate the fixed
size in that case. */
if (TREE_CODE (gnu_ret_val) == COMPONENT_REF
- && (TREE_CODE (TREE_TYPE (TREE_OPERAND (gnu_ret_val, 0)))
- == RECORD_TYPE)
- && (TYPE_IS_PADDING_P
- (TREE_TYPE (TREE_OPERAND (gnu_ret_val, 0))))
- && (CONTAINS_PLACEHOLDER_P
- (TYPE_SIZE (TREE_TYPE (gnu_ret_val)))))
+ && TYPE_IS_PADDING_P
+ (TREE_TYPE (TREE_OPERAND (gnu_ret_val, 0)))
+ && CONTAINS_PLACEHOLDER_P
+ (TYPE_SIZE (TREE_TYPE (gnu_ret_val))))
gnu_ret_val = TREE_OPERAND (gnu_ret_val, 0);
if (TYPE_RETURNS_BY_REF_P (gnu_subprog_type)
@@ -5151,7 +5147,7 @@ gnat_to_gnu (Node_Id gnat_node)
a fat pointer, then go back below to a thin pointer. The
reason for this is that we need a fat pointer someplace in
order to properly compute the size. */
- if (TYPE_THIN_POINTER_P (TREE_TYPE (gnu_ptr)))
+ if (TYPE_IS_THIN_POINTER_P (TREE_TYPE (gnu_ptr)))
gnu_ptr = build_unary_op (ADDR_EXPR, NULL_TREE,
build_unary_op (INDIRECT_REF, NULL_TREE,
gnu_ptr));
@@ -5160,7 +5156,7 @@ gnat_to_gnu (Node_Id gnat_node)
have been allocated with the template in front of the object.
So pass the template address, but get the total size. Do this
by converting to a thin pointer. */
- if (TYPE_FAT_POINTER_P (TREE_TYPE (gnu_ptr)))
+ if (TYPE_IS_FAT_POINTER_P (TREE_TYPE (gnu_ptr)))
gnu_ptr
= convert (build_pointer_type
(TYPE_OBJECT_RECORD_TYPE
@@ -5174,7 +5170,7 @@ gnat_to_gnu (Node_Id gnat_node)
gnu_actual_obj_type
= gnat_to_gnu_type (Actual_Designated_Subtype (gnat_node));
- if (TYPE_FAT_OR_THIN_POINTER_P (gnu_ptr_type))
+ if (TYPE_IS_FAT_OR_THIN_POINTER_P (gnu_ptr_type))
gnu_actual_obj_type
= build_unc_object_type_from_ptr (gnu_ptr_type,
gnu_actual_obj_type,
@@ -5286,10 +5282,10 @@ gnat_to_gnu (Node_Id gnat_node)
/* But if the result is a fat pointer type, we have no mechanism to
do that, so we unconditionally warn in problematic cases. */
- else if (TYPE_FAT_POINTER_P (gnu_target_type))
+ else if (TYPE_IS_FAT_POINTER_P (gnu_target_type))
{
tree gnu_source_array_type
- = TYPE_FAT_POINTER_P (gnu_source_type)
+ = TYPE_IS_FAT_POINTER_P (gnu_source_type)
? TREE_TYPE (TREE_TYPE (TYPE_FIELDS (gnu_source_type)))
: NULL_TREE;
tree gnu_target_array_type
@@ -5297,7 +5293,7 @@ gnat_to_gnu (Node_Id gnat_node)
if ((TYPE_DUMMY_P (gnu_target_array_type)
|| get_alias_set (gnu_target_array_type) != 0)
- && (!TYPE_FAT_POINTER_P (gnu_source_type)
+ && (!TYPE_IS_FAT_POINTER_P (gnu_source_type)
|| (TYPE_DUMMY_P (gnu_source_array_type)
!= TYPE_DUMMY_P (gnu_target_array_type))
|| (TYPE_DUMMY_P (gnu_source_array_type)
@@ -5438,8 +5434,7 @@ gnat_to_gnu (Node_Id gnat_node)
size: in that case it must be an object of unconstrained type
with a default discriminant and we want to avoid copying too
much data. */
- if (TREE_CODE (TREE_TYPE (gnu_result)) == RECORD_TYPE
- && TYPE_IS_PADDING_P (TREE_TYPE (gnu_result))
+ if (TYPE_IS_PADDING_P (TREE_TYPE (gnu_result))
&& CONTAINS_PLACEHOLDER_P (TYPE_SIZE (TREE_TYPE (TYPE_FIELDS
(TREE_TYPE (gnu_result))))))
gnu_result = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (gnu_result))),
@@ -5459,8 +5454,7 @@ gnat_to_gnu (Node_Id gnat_node)
&& TREE_CODE (TREE_TYPE (gnu_result)) == RECORD_TYPE))
{
/* Remove any padding. */
- if (TREE_CODE (TREE_TYPE (gnu_result)) == RECORD_TYPE
- && TYPE_IS_PADDING_P (TREE_TYPE (gnu_result)))
+ if (TYPE_IS_PADDING_P (TREE_TYPE (gnu_result)))
gnu_result = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (gnu_result))),
gnu_result);
}
@@ -5602,7 +5596,7 @@ add_decl_expr (tree gnu_decl, Entity_Id gnat_entity)
{
/* If GNU_DECL has a padded type, convert it to the unpadded
type so the assignment is done properly. */
- if (TREE_CODE (type) == RECORD_TYPE && TYPE_IS_PADDING_P (type))
+ if (TYPE_IS_PADDING_P (type))
t = convert (TREE_TYPE (TYPE_FIELDS (type)), gnu_decl);
else
t = gnu_decl;
@@ -6786,8 +6780,7 @@ convert_with_check (Entity_Id gnat_type, tree gnu_expr, bool overflowp,
= FP_ARITH_MAY_WIDEN ? longest_float_type_node : gnu_in_basetype;
/* FIXME: Should not have padding in the first place. */
- if (TREE_CODE (calc_type) == RECORD_TYPE
- && TYPE_IS_PADDING_P (calc_type))
+ if (TYPE_IS_PADDING_P (calc_type))
calc_type = TREE_TYPE (TYPE_FIELDS (calc_type));
/* Compute the exact value calc_type'Pred (0.5) at compile time. */
@@ -6962,6 +6955,10 @@ addressable_p (tree gnu_expr, tree gnu_type)
case CALL_EXPR:
case PLUS_EXPR:
case MINUS_EXPR:
+ case BIT_IOR_EXPR:
+ case BIT_XOR_EXPR:
+ case BIT_AND_EXPR:
+ case BIT_NOT_EXPR:
/* All rvalues are deemed addressable since taking their address will
force a temporary to be created by the middle-end. */
return true;
@@ -6984,7 +6981,7 @@ addressable_p (tree gnu_expr, tree gnu_type)
|| DECL_ALIGN (TREE_OPERAND (gnu_expr, 1))
>= TYPE_ALIGN (TREE_TYPE (gnu_expr))))
/* The field of a padding record is always addressable. */
- || TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_expr, 0))))
+ || TYPE_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_expr, 0))))
&& addressable_p (TREE_OPERAND (gnu_expr, 0), NULL_TREE));
case ARRAY_REF: case ARRAY_RANGE_REF:
@@ -7264,13 +7261,12 @@ static tree
maybe_implicit_deref (tree exp)
{
/* If the type is a pointer, dereference it. */
-
- if (POINTER_TYPE_P (TREE_TYPE (exp)) || TYPE_FAT_POINTER_P (TREE_TYPE (exp)))
+ if (POINTER_TYPE_P (TREE_TYPE (exp))
+ || TYPE_IS_FAT_POINTER_P (TREE_TYPE (exp)))
exp = build_unary_op (INDIRECT_REF, NULL_TREE, exp);
/* If we got a padded type, remove it too. */
- if (TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE
- && TYPE_IS_PADDING_P (TREE_TYPE (exp)))
+ if (TYPE_IS_PADDING_P (TREE_TYPE (exp)))
exp = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (exp))), exp);
return exp;
@@ -7308,7 +7304,7 @@ protect_multiple_eval (tree exp)
/* If this is a fat pointer or something that can be placed into a
register, just make a SAVE_EXPR. */
- if (TYPE_FAT_POINTER_P (type) || TYPE_MODE (type) != BLKmode)
+ if (TYPE_IS_FAT_POINTER_P (type) || TYPE_MODE (type) != BLKmode)
return save_expr (exp);
/* Otherwise, reference, protect the address and dereference. */
@@ -7493,7 +7489,7 @@ gnat_stabilize_reference_1 (tree e, bool force)
fat pointer. This may be more efficient, but will also allow
us to more easily find the match for the PLACEHOLDER_EXPR. */
if (code == COMPONENT_REF
- && TYPE_FAT_POINTER_P (TREE_TYPE (TREE_OPERAND (e, 0))))
+ && TYPE_IS_FAT_POINTER_P (TREE_TYPE (TREE_OPERAND (e, 0))))
result = build3 (COMPONENT_REF, type,
gnat_stabilize_reference_1 (TREE_OPERAND (e, 0),
force),
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 7acb2ce2de4..c79dd4e7a65 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -59,10 +59,6 @@
#include "ada-tree.h"
#include "gigi.h"
-#ifndef MAX_FIXED_MODE_SIZE
-#define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (DImode)
-#endif
-
#ifndef MAX_BITS_PER_WORD
#define MAX_BITS_PER_WORD BITS_PER_WORD
#endif
@@ -490,7 +486,7 @@ gnat_pushdecl (tree decl, Node_Id gnat_node)
if (!(TYPE_NAME (t) && TREE_CODE (TYPE_NAME (t)) == TYPE_DECL))
;
- else if (TYPE_FAT_POINTER_P (t))
+ else if (TYPE_IS_FAT_POINTER_P (t))
{
tree tt = build_variant_type_copy (t);
TYPE_NAME (tt) = decl;
@@ -643,7 +639,7 @@ finish_record_type (tree record_type, tree fieldlist, int rep_level,
if ((TREE_CODE (type) == RECORD_TYPE
|| TREE_CODE (type) == UNION_TYPE
|| TREE_CODE (type) == QUAL_UNION_TYPE)
- && !TYPE_IS_FAT_POINTER_P (type)
+ && !TYPE_FAT_POINTER_P (type)
&& !TYPE_CONTAINS_TEMPLATE_P (type)
&& TYPE_ADA_SIZE (type))
this_ada_size = TYPE_ADA_SIZE (type);
@@ -739,21 +735,15 @@ finish_record_type (tree record_type, tree fieldlist, int rep_level,
if (code == QUAL_UNION_TYPE)
nreverse (fieldlist);
- /* If the type is discriminated, it can be used to access all its
- constrained subtypes, so force structural equality checks. */
- if (CONTAINS_PLACEHOLDER_P (size))
- SET_TYPE_STRUCTURAL_EQUALITY (record_type);
-
if (rep_level < 2)
{
/* If this is a padding record, we never want to make the size smaller
than what was specified in it, if any. */
- if (TREE_CODE (record_type) == RECORD_TYPE
- && TYPE_IS_PADDING_P (record_type) && TYPE_SIZE (record_type))
+ if (TYPE_IS_PADDING_P (record_type) && TYPE_SIZE (record_type))
size = TYPE_SIZE (record_type);
/* Now set any of the values we've just computed that apply. */
- if (!TYPE_IS_FAT_POINTER_P (record_type)
+ if (!TYPE_FAT_POINTER_P (record_type)
&& !TYPE_CONTAINS_TEMPLATE_P (record_type))
SET_TYPE_ADA_SIZE (record_type, ada_size);
@@ -815,9 +805,7 @@ rest_of_record_type_compilation (tree record_type)
that tells the debugger how the record is laid out. See
exp_dbug.ads. But don't do this for records that are padding
since they confuse GDB. */
- if (var_size
- && !(TREE_CODE (record_type) == RECORD_TYPE
- && TYPE_IS_PADDING_P (record_type)))
+ if (var_size && !TYPE_IS_PADDING_P (record_type))
{
tree new_record_type
= make_node (TREE_CODE (record_type) == QUAL_UNION_TYPE
@@ -1306,7 +1294,7 @@ create_type_decl (tree type_name, tree type, struct attrib *attr_list,
if (code == UNCONSTRAINED_ARRAY_TYPE || !debug_info_p)
DECL_IGNORED_P (type_decl) = 1;
else if (code != ENUMERAL_TYPE
- && (code != RECORD_TYPE || TYPE_IS_FAT_POINTER_P (type))
+ && (code != RECORD_TYPE || TYPE_FAT_POINTER_P (type))
&& !((code == POINTER_TYPE || code == REFERENCE_TYPE)
&& TYPE_IS_DUMMY_P (TREE_TYPE (type)))
&& !(code == RECORD_TYPE
@@ -1465,13 +1453,13 @@ aggregate_type_contains_array_p (tree type)
}
}
-/* Return a FIELD_DECL node. FIELD_NAME the field name, FIELD_TYPE is its
- type, and RECORD_TYPE is the type of the parent. PACKED is nonzero if
- this field is in a record type with a "pragma pack". If SIZE is nonzero
- it is the specified size for this field. If POS is nonzero, it is the bit
- position. If ADDRESSABLE is nonzero, it means we are allowed to take
- the address of this field for aliasing purposes. If it is negative, we
- should not make a bitfield, which is used by make_aligning_type. */
+/* Return a FIELD_DECL node. FIELD_NAME is the field's name, FIELD_TYPE is
+ its type and RECORD_TYPE is the type of the enclosing record. PACKED is
+ 1 if the enclosing record is packed, -1 if it has Component_Alignment of
+ Storage_Unit. If SIZE is nonzero, it is the specified size of the field.
+ If POS is nonzero, it is the bit position. If ADDRESSABLE is nonzero, it
+ means we are allowed to take the address of the field; if it is negative,
+ we should not make a bitfield, which is used by make_aligning_type. */
tree
create_field_decl (tree field_name, tree field_type, tree record_type,
@@ -1505,12 +1493,8 @@ create_field_decl (tree field_name, tree field_type, tree record_type,
else if (packed == 1)
{
size = rm_size (field_type);
-
- /* For a constant size larger than MAX_FIXED_MODE_SIZE, round up to
- byte. */
- if (TREE_CODE (size) == INTEGER_CST
- && compare_tree_int (size, MAX_FIXED_MODE_SIZE) > 0)
- size = round_up (size, BITS_PER_UNIT);
+ if (TYPE_MODE (field_type) == BLKmode)
+ size = round_up (size, BITS_PER_UNIT);
}
/* If we may, according to ADDRESSABLE, make a bitfield if a size is
@@ -1874,9 +1858,9 @@ create_subprog_decl (tree subprog_name, tree asm_name,
to be declared as the "main" function literally by default. Ada
program entry points are typically declared with a different name
within the binder generated file, exported as 'main' to satisfy the
- system expectations. Redirect main_identifier_node in this case. */
+ system expectations. Force main_identifier_node in this case. */
if (asm_name == main_identifier_node)
- main_identifier_node = DECL_NAME (subprog_decl);
+ DECL_NAME (subprog_decl) = main_identifier_node;
}
process_attributes (subprog_decl, attr_list);
@@ -2193,16 +2177,28 @@ gnat_type_for_mode (enum machine_mode mode, int unsignedp)
{
if (mode == BLKmode)
return NULL_TREE;
- else if (mode == VOIDmode)
+
+ if (mode == VOIDmode)
return void_type_node;
- else if (COMPLEX_MODE_P (mode))
+
+ if (COMPLEX_MODE_P (mode))
return NULL_TREE;
- else if (SCALAR_FLOAT_MODE_P (mode))
+
+ if (SCALAR_FLOAT_MODE_P (mode))
return float_type_for_precision (GET_MODE_PRECISION (mode), mode);
- else if (SCALAR_INT_MODE_P (mode))
+
+ if (SCALAR_INT_MODE_P (mode))
return gnat_type_for_size (GET_MODE_BITSIZE (mode), unsignedp);
- else
- return NULL_TREE;
+
+ if (VECTOR_MODE_P (mode))
+ {
+ enum machine_mode inner_mode = GET_MODE_INNER (mode);
+ tree inner_type = gnat_type_for_mode (inner_mode, unsignedp);
+ if (inner_type)
+ return build_vector_type_for_mode (inner_type, mode);
+ }
+
+ return NULL_TREE;
}
/* Return the unsigned version of a TYPE_NODE, a scalar type. */
@@ -2291,7 +2287,7 @@ gnat_types_compatible_p (tree t1, tree t2)
/* Padding record types are also compatible if they pad the same
type and have the same constant size. */
if (code == RECORD_TYPE
- && TYPE_IS_PADDING_P (t1) && TYPE_IS_PADDING_P (t2)
+ && TYPE_PADDING_P (t1) && TYPE_PADDING_P (t2)
&& TREE_TYPE (TYPE_FIELDS (t1)) == TREE_TYPE (TYPE_FIELDS (t2))
&& tree_int_cst_equal (TYPE_SIZE (t1), TYPE_SIZE (t2)))
return 1;
@@ -2441,7 +2437,7 @@ build_template (tree template_type, tree array_type, tree expr)
tree field;
while (TREE_CODE (array_type) == RECORD_TYPE
- && (TYPE_IS_PADDING_P (array_type)
+ && (TYPE_PADDING_P (array_type)
|| TYPE_JUSTIFIED_MODULAR_P (array_type)))
array_type = TREE_TYPE (TYPE_FIELDS (array_type));
@@ -3155,7 +3151,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
if (POINTER_TYPE_P (gnu_type))
return convert (gnu_type, gnu_expr64);
- else if (TYPE_FAT_POINTER_P (gnu_type))
+ else if (TYPE_IS_FAT_POINTER_P (gnu_type))
{
tree p_array_type = TREE_TYPE (TYPE_FIELDS (gnu_type));
tree p_bounds_type = TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (gnu_type)));
@@ -3304,7 +3300,7 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
if (POINTER_TYPE_P (gnu_type))
return convert (gnu_type, gnu_expr32);
- else if (TYPE_FAT_POINTER_P (gnu_type))
+ else if (TYPE_IS_FAT_POINTER_P (gnu_type))
{
tree p_array_type = TREE_TYPE (TYPE_FIELDS (gnu_type));
tree p_bounds_type = TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (gnu_type)));
@@ -3542,10 +3538,10 @@ build_unc_object_type_from_ptr (tree thin_fat_ptr_type, tree object_type,
{
tree template_type;
- gcc_assert (TYPE_FAT_OR_THIN_POINTER_P (thin_fat_ptr_type));
+ gcc_assert (TYPE_IS_FAT_OR_THIN_POINTER_P (thin_fat_ptr_type));
template_type
- = (TYPE_FAT_POINTER_P (thin_fat_ptr_type)
+ = (TYPE_IS_FAT_POINTER_P (thin_fat_ptr_type)
? TREE_TYPE (TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (thin_fat_ptr_type))))
: TREE_TYPE (TYPE_FIELDS (TREE_TYPE (thin_fat_ptr_type))));
return build_unc_object_type (template_type, object_type, name);
@@ -3641,7 +3637,7 @@ update_pointer_to (tree old_type, tree new_type)
/* Now deal with the unconstrained array case. In this case the "pointer"
is actually a RECORD_TYPE where both fields are pointers to dummy nodes.
Turn them into pointers to the correct types using update_pointer_to. */
- else if (!TYPE_FAT_POINTER_P (ptr))
+ else if (!TYPE_IS_FAT_POINTER_P (ptr))
gcc_unreachable ();
else
@@ -3742,7 +3738,7 @@ convert_to_fat_pointer (tree type, tree expr)
NULL_TREE)));
/* If EXPR is a thin pointer, make template and data from the record.. */
- else if (TYPE_THIN_POINTER_P (etype))
+ else if (TYPE_IS_THIN_POINTER_P (etype))
{
tree fields = TYPE_FIELDS (TREE_TYPE (etype));
@@ -3792,7 +3788,7 @@ convert_to_fat_pointer (tree type, tree expr)
static tree
convert_to_thin_pointer (tree type, tree expr)
{
- if (!TYPE_FAT_POINTER_P (TREE_TYPE (expr)))
+ if (!TYPE_IS_FAT_POINTER_P (TREE_TYPE (expr)))
expr
= convert_to_fat_pointer
(TREE_TYPE (TYPE_UNCONSTRAINED_ARRAY (TREE_TYPE (type))), expr);
@@ -3827,7 +3823,7 @@ convert (tree type, tree expr)
as an unchecked conversion. Likewise if one is a mere variant of the
other, so we avoid a pointless unpad/repad sequence. */
else if (code == RECORD_TYPE && ecode == RECORD_TYPE
- && TYPE_IS_PADDING_P (type) && TYPE_IS_PADDING_P (etype)
+ && TYPE_PADDING_P (type) && TYPE_PADDING_P (etype)
&& (!TREE_CONSTANT (TYPE_SIZE (type))
|| !TREE_CONSTANT (TYPE_SIZE (etype))
|| gnat_types_compatible_p (type, etype)
@@ -3837,7 +3833,7 @@ convert (tree type, tree expr)
/* If the output type has padding, convert to the inner type and make a
constructor to build the record, unless a variable size is involved. */
- else if (code == RECORD_TYPE && TYPE_IS_PADDING_P (type))
+ else if (code == RECORD_TYPE && TYPE_PADDING_P (type))
{
/* If we previously converted from another type and our type is
of variable size, remove the conversion to avoid the need for
@@ -3855,7 +3851,6 @@ convert (tree type, tree expr)
variable-sized temporaries. Likewise if the padding is a variant
of the other, so we avoid a pointless unpad/repad sequence. */
if (TREE_CODE (expr) == COMPONENT_REF
- && TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0))) == RECORD_TYPE
&& TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (expr, 0)))
&& (!TREE_CONSTANT (TYPE_SIZE (type))
|| gnat_types_compatible_p (type,
@@ -3865,12 +3860,17 @@ convert (tree type, tree expr)
== TYPE_NAME (TREE_TYPE (TYPE_FIELDS (type))))))
return convert (type, TREE_OPERAND (expr, 0));
- /* If the result type is a padded type with a self-referentially-sized
- field and the expression type is a record, do this as an unchecked
- conversion. */
+ /* If the inner type is of self-referential size and the expression type
+ is a record, do this as an unchecked conversion. But first pad the
+ expression if possible to have the same size on both sides. */
if (TREE_CODE (etype) == RECORD_TYPE
&& CONTAINS_PLACEHOLDER_P (DECL_SIZE (TYPE_FIELDS (type))))
- return unchecked_convert (type, expr, false);
+ {
+ if (TREE_CONSTANT (TYPE_SIZE (etype)))
+ expr = convert (maybe_pad_type (etype, TYPE_SIZE (type), 0, Empty,
+ false, false, false, true), expr);
+ return unchecked_convert (type, expr, false);
+ }
/* If we are converting between array types with variable size, do the
final conversion as an unchecked conversion, again to avoid the need
@@ -3898,7 +3898,7 @@ convert (tree type, tree expr)
The conditions ordering is arranged to ensure that the output type is not
a padding type here, as it is not clear whether the conversion would
always be correct if this was to happen. */
- else if (ecode == RECORD_TYPE && TYPE_IS_PADDING_P (etype))
+ else if (ecode == RECORD_TYPE && TYPE_PADDING_P (etype))
{
tree unpadded;
@@ -4147,7 +4147,8 @@ convert (tree type, tree expr)
/* Otherwise, we may just bypass the input view conversion unless
one of the types is a fat pointer, which is handled by
specialized code below which relies on exact type matching. */
- else if (!TYPE_FAT_POINTER_P (type) && !TYPE_FAT_POINTER_P (etype))
+ else if (!TYPE_IS_FAT_POINTER_P (type)
+ && !TYPE_IS_FAT_POINTER_P (etype))
return convert (type, op0);
}
}
@@ -4166,7 +4167,7 @@ convert (tree type, tree expr)
|| TREE_CODE (type) == UNION_TYPE)
&& (TREE_CODE (etype) == RECORD_TYPE
|| TREE_CODE (etype) == UNION_TYPE)
- && !TYPE_FAT_POINTER_P (type) && !TYPE_FAT_POINTER_P (etype))
+ && !TYPE_IS_FAT_POINTER_P (type) && !TYPE_IS_FAT_POINTER_P (etype))
return build_unary_op (INDIRECT_REF, NULL_TREE,
convert (build_pointer_type (type),
TREE_OPERAND (expr, 0)));
@@ -4177,7 +4178,7 @@ convert (tree type, tree expr)
}
/* Check for converting to a pointer to an unconstrained array. */
- if (TYPE_FAT_POINTER_P (type) && !TYPE_FAT_POINTER_P (etype))
+ if (TYPE_IS_FAT_POINTER_P (type) && !TYPE_IS_FAT_POINTER_P (etype))
return convert_to_fat_pointer (type, expr);
/* If we are converting between two aggregate or vector types that are mere
@@ -4249,7 +4250,7 @@ convert (tree type, tree expr)
/* If converting between two pointers to records denoting
both a template and type, adjust if needed to account
for any differing offsets, since one might be negative. */
- if (TYPE_THIN_POINTER_P (etype) && TYPE_THIN_POINTER_P (type))
+ if (TYPE_IS_THIN_POINTER_P (etype) && TYPE_IS_THIN_POINTER_P (type))
{
tree bit_diff
= size_diffop (bit_position (TYPE_FIELDS (TREE_TYPE (etype))),
@@ -4267,13 +4268,13 @@ convert (tree type, tree expr)
}
/* If converting to a thin pointer, handle specially. */
- if (TYPE_THIN_POINTER_P (type)
+ if (TYPE_IS_THIN_POINTER_P (type)
&& TYPE_UNCONSTRAINED_ARRAY (TREE_TYPE (type)))
return convert_to_thin_pointer (type, expr);
/* If converting fat pointer to normal pointer, get the pointer to the
array and then convert it. */
- else if (TYPE_FAT_POINTER_P (etype))
+ else if (TYPE_IS_FAT_POINTER_P (etype))
expr = build_component_ref (expr, get_identifier ("P_ARRAY"),
NULL_TREE, false);
@@ -4370,8 +4371,7 @@ remove_conversions (tree exp, bool true_address)
break;
case COMPONENT_REF:
- if (TREE_CODE (TREE_TYPE (TREE_OPERAND (exp, 0))) == RECORD_TYPE
- && TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (exp, 0))))
+ if (TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (exp, 0))))
return remove_conversions (TREE_OPERAND (exp, 0), true_address);
break;
@@ -4420,7 +4420,7 @@ maybe_unconstrained_array (tree exp)
case RECORD_TYPE:
/* If this is a padded type, convert to the unpadded type and see if
it contains a template. */
- if (TYPE_IS_PADDING_P (TREE_TYPE (exp)))
+ if (TYPE_PADDING_P (TREE_TYPE (exp)))
{
new_exp = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (exp))), exp);
if (TREE_CODE (TREE_TYPE (new_exp)) == RECORD_TYPE
@@ -4523,13 +4523,13 @@ unchecked_convert (tree type, tree expr, bool notrunc_p)
if ((((INTEGRAL_TYPE_P (type)
&& !(TREE_CODE (type) == INTEGER_TYPE
&& TYPE_VAX_FLOATING_POINT_P (type)))
- || (POINTER_TYPE_P (type) && ! TYPE_THIN_POINTER_P (type))
+ || (POINTER_TYPE_P (type) && ! TYPE_IS_THIN_POINTER_P (type))
|| (TREE_CODE (type) == RECORD_TYPE
&& TYPE_JUSTIFIED_MODULAR_P (type)))
&& ((INTEGRAL_TYPE_P (etype)
&& !(TREE_CODE (etype) == INTEGER_TYPE
&& TYPE_VAX_FLOATING_POINT_P (etype)))
- || (POINTER_TYPE_P (etype) && !TYPE_THIN_POINTER_P (etype))
+ || (POINTER_TYPE_P (etype) && !TYPE_IS_THIN_POINTER_P (etype))
|| (TREE_CODE (etype) == RECORD_TYPE
&& TYPE_JUSTIFIED_MODULAR_P (etype))))
|| TREE_CODE (type) == UNCONSTRAINED_ARRAY_TYPE)
@@ -5509,7 +5509,7 @@ handle_vector_type_attribute (tree *node, tree name, tree ARG_UNUSED (args),
/* Get the representative array type, possibly nested within a
padding record e.g. for alignment purposes. */
- if (TREE_CODE (rep_type) == RECORD_TYPE && TYPE_IS_PADDING_P (rep_type))
+ if (TYPE_IS_PADDING_P (rep_type))
rep_type = TREE_TYPE (TYPE_FIELDS (rep_type));
if (TREE_CODE (rep_type) != ARRAY_TYPE)
diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c
index f8a3dfbd525..7176740f453 100644
--- a/gcc/ada/gcc-interface/utils2.c
+++ b/gcc/ada/gcc-interface/utils2.c
@@ -654,12 +654,9 @@ build_binary_op (enum tree_code op_code, tree result_type,
can convert the constructor to the inner type, to avoid putting a
VIEW_CONVERT_EXPR on the LHS. But don't do so if we wouldn't have
actually copied anything. */
- else if (TREE_CODE (left_type) == RECORD_TYPE
- && TYPE_IS_PADDING_P (left_type)
+ else if (TYPE_IS_PADDING_P (left_type)
&& TREE_CONSTANT (TYPE_SIZE (left_type))
&& ((TREE_CODE (right_operand) == COMPONENT_REF
- && TREE_CODE (TREE_TYPE (TREE_OPERAND (right_operand, 0)))
- == RECORD_TYPE
&& TYPE_IS_PADDING_P
(TREE_TYPE (TREE_OPERAND (right_operand, 0)))
&& gnat_types_compatible_p
@@ -758,6 +755,12 @@ build_binary_op (enum tree_code op_code, tree result_type,
left_type = TREE_TYPE (left_operand);
}
+ /* For a range, make sure the element type is consistent. */
+ if (op_code == ARRAY_RANGE_REF
+ && TREE_TYPE (operation_type) != TREE_TYPE (left_type))
+ operation_type = build_array_type (TREE_TYPE (left_type),
+ TYPE_DOMAIN (operation_type));
+
/* Then convert the right operand to its base type. This will prevent
unneeded sign conversions when sizetype is wider than integer. */
right_operand = convert (right_base_type, right_operand);
@@ -836,8 +839,8 @@ build_binary_op (enum tree_code op_code, tree result_type,
convert both operands to that type. */
if (left_base_type != right_base_type)
{
- if (TYPE_FAT_POINTER_P (left_base_type)
- && TYPE_FAT_POINTER_P (right_base_type)
+ if (TYPE_IS_FAT_POINTER_P (left_base_type)
+ && TYPE_IS_FAT_POINTER_P (right_base_type)
&& TYPE_MAIN_VARIANT (left_base_type)
== TYPE_MAIN_VARIANT (right_base_type))
best_type = left_base_type;
@@ -872,7 +875,7 @@ build_binary_op (enum tree_code op_code, tree result_type,
/* If we are comparing a fat pointer against zero, we need to
just compare the data pointer. */
- else if (TYPE_FAT_POINTER_P (left_base_type)
+ else if (TYPE_IS_FAT_POINTER_P (left_base_type)
&& TREE_CODE (right_operand) == CONSTRUCTOR
&& integer_zerop (VEC_index (constructor_elt,
CONSTRUCTOR_ELTS (right_operand),
@@ -1117,11 +1120,10 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
/* If INNER is a padding type whose field has a self-referential
size, convert to that inner type. We know the offset is zero
and we need to have that type visible. */
- if (TREE_CODE (TREE_TYPE (inner)) == RECORD_TYPE
- && TYPE_IS_PADDING_P (TREE_TYPE (inner))
- && (CONTAINS_PLACEHOLDER_P
- (TYPE_SIZE (TREE_TYPE (TYPE_FIELDS
- (TREE_TYPE (inner)))))))
+ if (TYPE_IS_PADDING_P (TREE_TYPE (inner))
+ && CONTAINS_PLACEHOLDER_P
+ (TYPE_SIZE (TREE_TYPE (TYPE_FIELDS
+ (TREE_TYPE (inner))))))
inner = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (inner))),
inner);
@@ -1154,13 +1156,11 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
/* If this is just a constructor for a padded record, we can
just take the address of the single field and convert it to
a pointer to our type. */
- if (TREE_CODE (type) == RECORD_TYPE && TYPE_IS_PADDING_P (type))
+ if (TYPE_IS_PADDING_P (type))
{
- result = (VEC_index (constructor_elt,
- CONSTRUCTOR_ELTS (operand),
- 0)
- ->value);
-
+ result = VEC_index (constructor_elt,
+ CONSTRUCTOR_ELTS (operand),
+ 0)->value;
result = convert (build_pointer_type (TREE_TYPE (operand)),
build_unary_op (ADDR_EXPR, NULL_TREE, result));
break;
@@ -1202,8 +1202,7 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
/* If we are taking the address of a padded record whose field is
contains a template, take the address of the template. */
- if (TREE_CODE (type) == RECORD_TYPE
- && TYPE_IS_PADDING_P (type)
+ if (TYPE_IS_PADDING_P (type)
&& TREE_CODE (TREE_TYPE (TYPE_FIELDS (type))) == RECORD_TYPE
&& TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (TYPE_FIELDS (type))))
{
@@ -1226,7 +1225,7 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
make up an expression to do so. This will never survive to
the backend. If TYPE is a thin pointer, first convert the
operand to a fat pointer. */
- if (TYPE_THIN_POINTER_P (type)
+ if (TYPE_IS_THIN_POINTER_P (type)
&& TYPE_UNCONSTRAINED_ARRAY (TREE_TYPE (type)))
{
operand
@@ -1235,7 +1234,7 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
type = TREE_TYPE (operand);
}
- if (TYPE_FAT_POINTER_P (type))
+ if (TYPE_IS_FAT_POINTER_P (type))
{
result = build1 (UNCONSTRAINED_ARRAY_REF,
TYPE_UNCONSTRAINED_ARRAY (type), operand);
@@ -1252,7 +1251,7 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
}
side_effects
- = (!TYPE_FAT_POINTER_P (type) && TYPE_VOLATILE (TREE_TYPE (type)));
+ = (!TYPE_IS_FAT_POINTER_P (type) && TYPE_VOLATILE (TREE_TYPE (type)));
break;
case NEGATE_EXPR:
@@ -2027,7 +2026,7 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc,
/* If RESULT_TYPE is a fat or thin pointer, set SIZE to be the sum of the
sizes of the object and its template. Allocate the whole thing and
fill in the parts that are known. */
- else if (TYPE_FAT_OR_THIN_POINTER_P (result_type))
+ else if (TYPE_IS_FAT_OR_THIN_POINTER_P (result_type))
{
tree storage_type
= build_unc_object_type_from_ptr (result_type, type,
@@ -2049,10 +2048,9 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc,
gnat_proc, gnat_pool, gnat_node);
storage = convert (storage_ptr_type, protect_multiple_eval (storage));
- if (TREE_CODE (type) == RECORD_TYPE && TYPE_IS_PADDING_P (type))
+ if (TYPE_IS_PADDING_P (type))
{
type = TREE_TYPE (TYPE_FIELDS (type));
-
if (init)
init = convert (type, init);
}
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index e25400d09fc..4b906fe91e9 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -307,10 +307,13 @@ The GNAT Library
* Ada.Strings.Wide_Unbounded.Wide_Text_IO (a-swuwti.ads)::
* Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO (a-szuzti.ads)::
* Ada.Text_IO.C_Streams (a-tiocst.ads)::
+* Ada.Text_IO.Reset_Standard_Files (a-tirsfi.ads)::
* Ada.Wide_Characters.Unicode (a-wichun.ads)::
* Ada.Wide_Text_IO.C_Streams (a-wtcstr.ads)::
+* Ada.Wide_Text_IO.Reset_Standard_Files (a-wrstfi.ads)::
* Ada.Wide_Wide_Characters.Unicode (a-zchuni.ads)::
* Ada.Wide_Wide_Text_IO.C_Streams (a-ztcstr.ads)::
+* Ada.Wide_Wide_Text_IO.Reset_Standard_Files (a-zrstfi.ads)::
* GNAT.Altivec (g-altive.ads)::
* GNAT.Altivec.Conversions (g-altcon.ads)::
* GNAT.Altivec.Vector_Operations (g-alveop.ads)::
@@ -13496,10 +13499,13 @@ of GNAT, and will generate a warning message.
* Ada.Strings.Wide_Unbounded.Wide_Text_IO (a-swuwti.ads)::
* Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO (a-szuzti.ads)::
* Ada.Text_IO.C_Streams (a-tiocst.ads)::
+* Ada.Text_IO.Reset_Standard_Files (a-tirsfi.ads)::
* Ada.Wide_Characters.Unicode (a-wichun.ads)::
* Ada.Wide_Text_IO.C_Streams (a-wtcstr.ads)::
+* Ada.Wide_Text_IO.Reset_Standard_Files (a-wrstfi.ads)::
* Ada.Wide_Wide_Characters.Unicode (a-zchuni.ads)::
* Ada.Wide_Wide_Text_IO.C_Streams (a-ztcstr.ads)::
+* Ada.Wide_Wide_Text_IO.Reset_Standard_Files (a-zrstfi.ads)::
* GNAT.Altivec (g-altive.ads)::
* GNAT.Altivec.Conversions (g-altcon.ads)::
* GNAT.Altivec.Vector_Operations (g-alveop.ads)::
@@ -13819,6 +13825,18 @@ C streams and @code{Text_IO}. The stream identifier can be
extracted from a file opened on the Ada side, and an Ada file
can be constructed from a stream opened on the C side.
+@node Ada.Text_IO.Reset_Standard_Files (a-tirsfi.ads)
+@section @code{Ada.Text_IO.Reset_Standard_Files} (@file{a-tirsfi.ads})
+@cindex @code{Ada.Text_IO.Reset_Standard_Files} (@file{a-tirsfi.ads})
+@cindex @code{Text_IO} resetting standard files
+
+@noindent
+This procedure is used to reset the status of the standard files used
+by Ada.Text_IO. This is useful in a situation (such as a restart in an
+embedded application) where the status of the files may change during
+execution (for example a standard input file may be redefined to be
+interactive).
+
@node Ada.Wide_Characters.Unicode (a-wichun.ads)
@section @code{Ada.Wide_Characters.Unicode} (@file{a-wichun.ads})
@cindex @code{Ada.Wide_Characters.Unicode} (@file{a-wichun.ads})
@@ -13839,6 +13857,18 @@ C streams and @code{Wide_Text_IO}. The stream identifier can be
extracted from a file opened on the Ada side, and an Ada file
can be constructed from a stream opened on the C side.
+@node Ada.Wide_Text_IO.Reset_Standard_Files (a-wrstfi.ads)
+@section @code{Ada.Wide_Text_IO.Reset_Standard_Files} (@file{a-wrstfi.ads})
+@cindex @code{Ada.Wide_Text_IO.Reset_Standard_Files} (@file{a-wrstfi.ads})
+@cindex @code{Wide_Text_IO} resetting standard files
+
+@noindent
+This procedure is used to reset the status of the standard files used
+by Ada.Wide_Text_IO. This is useful in a situation (such as a restart in an
+embedded application) where the status of the files may change during
+execution (for example a standard input file may be redefined to be
+interactive).
+
@node Ada.Wide_Wide_Characters.Unicode (a-zchuni.ads)
@section @code{Ada.Wide_Wide_Characters.Unicode} (@file{a-zchuni.ads})
@cindex @code{Ada.Wide_Wide_Characters.Unicode} (@file{a-zchuni.ads})
@@ -13859,6 +13889,18 @@ C streams and @code{Wide_Wide_Text_IO}. The stream identifier can be
extracted from a file opened on the Ada side, and an Ada file
can be constructed from a stream opened on the C side.
+@node Ada.Wide_Wide_Text_IO.Reset_Standard_Files (a-zrstfi.ads)
+@section @code{Ada.Wide_Wide_Text_IO.Reset_Standard_Files} (@file{a-zrstfi.ads})
+@cindex @code{Ada.Wide_Wide_Text_IO.Reset_Standard_Files} (@file{a-zrstfi.ads})
+@cindex @code{Wide_Wide_Text_IO} resetting standard files
+
+@noindent
+This procedure is used to reset the status of the standard files used
+by Ada.Wide_Wide_Text_IO. This is useful in a situation (such as a
+restart in an embedded application) where the status of the files may
+change during execution (for example a standard input file may be
+redefined to be interactive).
+
@node GNAT.Altivec (g-altive.ads)
@section @code{GNAT.Altivec} (@file{g-altive.ads})
@cindex @code{GNAT.Altivec} (@file{g-altive.ads})
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index d777f6dd099..19304a75f40 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -5268,6 +5268,19 @@ This warning can also be turned on using @option{-gnatwa}.
This switch disables warnings for a @code{with} of an internal GNAT
implementation unit.
+@item -gnatw.i
+@emph{Activate warnings on overlapping actuals.}
+@cindex @option{-gnatw.i} (@command{gcc})
+This switch enables a warning on statically detectable overlapping actuals in
+a subprogram call, when one of the actuals is an in-out parameter, and the
+types of the actuals are not by-copy types. The warning is off by default,
+and is not included under -gnatwa.
+
+@item -gnatw.I
+@emph{Disable warnings on overlapping actuals.}
+@cindex @option{-gnatw.I} (@command{gcc})
+This switch disables warnings on overlapping actuals in a call..
+
@item -gnatwj
@emph{Activate warnings on obsolescent features (Annex J).}
@cindex @option{-gnatwj} (@command{gcc})
@@ -6434,6 +6447,10 @@ If the token preceding a left parenthesis ends with a letter or digit, then
a space must separate the two tokens.
@item
+if the token following a right parenthesis starts with a letter or digit, then
+a space must separate the two tokens.
+
+@item
A right parenthesis must either be the first non-blank character on
a line, or it must be preceded by a non-blank character.
@@ -6524,8 +6541,6 @@ the exception of ORDERED_SUBPROGRAMS, UNNECESSARY_BLANK_LINES,
XTRA_PARENS, and DOS_LINE_ENDINGS. In addition
@end ifset
-
-
The switch
@ifclear vms
@option{-gnatyN}
@@ -20659,7 +20674,7 @@ Invoking @command{gnatcheck} on the command line has the form:
@smallexample
$ gnatcheck @ovar{switches} @{@var{filename}@}
@r{[}^-files^/FILES^=@{@var{arg_list_filename}@}@r{]}
- @r{[}-cargs @var{gcc_switches}@r{]} @r{[}-rules @var{rule_options}@r{]}
+ @r{[}-cargs @var{gcc_switches}@r{]} -rules @var{rule_options}
@end smallexample
@noindent
@@ -20785,18 +20800,9 @@ Quiet mode. All the diagnostics about rule violations are placed in the
Short format of the report file (no version information, no list of applied
rules, no list of checked sources is included)
-@cindex @option{^-s1^/COMPILER_STYLE^} (@command{gnatcheck})
-@item ^-s1^/COMPILER_STYLE^
-Include the compiler-style section in the report file
-
-@cindex @option{^-s2^/BY_RULES^} (@command{gnatcheck})
-@item ^-s2^/BY_RULES^
-Include the section containing diagnostics ordered by rules in the report file
-
-@cindex @option{^-s3^/BY_FILES_BY_RULES^} (@command{gnatcheck})
-@item ^-s3^/BY_FILES_BY_RULES^
-Include the section containing diagnostics ordered by files and then by rules
-in the report file
+@cindex @option{^--include-file=@var{file}^/INCLUDE_FILE=@var{file}^} (@command{gnatcheck})
+@item ^--include-file^/INCLUDE_FILE^
+Append the content of the specified text file to the report file
@cindex @option{^-t^/TIME^} (@command{gnatcheck})
@item ^-t^/TIME^
@@ -21226,7 +21232,9 @@ This rule has no parameters.
@cindex @code{Anonymous_Subtypes} rule (for @command{gnatcheck})
@noindent
-Flag all uses of anonymous subtypes. A use of an anonymous subtype is
+Flag all uses of anonymous subtypes (except cases when subtype indication
+is a part of a record component definition, and this subtype indication
+depends on a discriminant). A use of an anonymous subtype is
any instance of a subtype indication with a constraint, other than one
that occurs immediately within a subtype declaration. Any use of a range
other than as a constraint used immediately within a subtype declaration
diff --git a/gcc/ada/gnatbind.adb b/gcc/ada/gnatbind.adb
index 48eceb0ff77..fb3dc3d74ba 100644
--- a/gcc/ada/gnatbind.adb
+++ b/gcc/ada/gnatbind.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -838,6 +838,28 @@ begin
end if;
end loop;
+ -- Subunits do not appear in the elaboration table because they
+ -- are subsumed by their parent units, but we need to list them
+ -- for other tools. For now they are listed after other files,
+ -- rather than right after their parent, since there is no easy
+ -- link between the elaboration table and the ALIs table ???
+ -- Note also that subunits may appear repeatedly in the list,
+ -- if the parent unit appears in the context of several units
+ -- in the closure.
+
+ for J in Sdep.First .. Sdep.Last loop
+ if Sdep.Table (J).Subunit_Name /= No_Name
+ and then not Is_Internal_File_Name (Sdep.Table (J).Sfile)
+ then
+ if not Zero_Formatting then
+ Write_Str (" ");
+ end if;
+
+ Write_Str (Get_Name_String (Sdep.Table (J).Sfile));
+ Write_Eol;
+ end if;
+ end loop;
+
if not Zero_Formatting then
Write_Eol;
end if;
diff --git a/gcc/ada/gnatcmd.adb b/gcc/ada/gnatcmd.adb
index 563b92d150e..e0ccc228473 100644
--- a/gcc/ada/gnatcmd.adb
+++ b/gcc/ada/gnatcmd.adb
@@ -1612,6 +1612,7 @@ begin
elsif Argv.all = "-eL" then
Follow_Links_For_Files := True;
+ Follow_Links_For_Dirs := True;
Remove_Switch (Arg_Num);
diff --git a/gcc/ada/gnatlink.adb b/gcc/ada/gnatlink.adb
index eb255d9fc08..5347269be00 100644
--- a/gcc/ada/gnatlink.adb
+++ b/gcc/ada/gnatlink.adb
@@ -189,6 +189,13 @@ procedure Gnatlink is
Object_List_File_Required : Boolean := False;
-- Set to True to force generation of a response file
+ Shared_Libgcc_Default : Character;
+ for Shared_Libgcc_Default'Size use Character'Size;
+ pragma Import
+ (C, Shared_Libgcc_Default, "__gnat_shared_libgcc_default");
+ -- Indicates wether libgcc should be statically linked (use 'T') or
+ -- dynamically linked (use 'H') by default.
+
function Base_Name (File_Name : String) return String;
-- Return just the file name part without the extension (if present)
@@ -2141,11 +2148,15 @@ begin
if Linker_Path = Gcc_Path and then VM_Target = No_VM then
- -- If gcc is not called with -shared-libgcc, call it with
- -- -static-libgcc, as there are some platforms where one of
- -- these two switches is compulsory to link.
+ -- For systems where the default is to link statically
+ -- with libgcc, if gcc is not called with
+ -- -shared-libgcc, call it with -static-libgcc, as
+ -- there are some platforms where one of these two
+ -- switches is compulsory to link.
- if not Shared_Libgcc_Seen then
+ if Shared_Libgcc_Default = 'T'
+ and then not Shared_Libgcc_Seen
+ then
Linker_Options.Increment_Last;
Linker_Options.Table (Linker_Options.Last) := Static_Libgcc;
Num_Args := Num_Args + 1;
diff --git a/gcc/ada/gnatname.adb b/gcc/ada/gnatname.adb
index 4c6d00bd99e..4c935bebbc7 100644
--- a/gcc/ada/gnatname.adb
+++ b/gcc/ada/gnatname.adb
@@ -385,6 +385,7 @@ procedure Gnatname is
elsif Arg = "-eL" then
Opt.Follow_Links_For_Files := True;
+ Opt.Follow_Links_For_Dirs := True;
-- -f
diff --git a/gcc/ada/init.c b/gcc/ada/init.c
index 5fe46cd0ff2..f9bcf634e53 100644
--- a/gcc/ada/init.c
+++ b/gcc/ada/init.c
@@ -2114,6 +2114,7 @@ __gnat_install_handler(void)
#elif defined(__APPLE__)
#include <signal.h>
+#include <sys/syscall.h>
#include <mach/mach_vm.h>
#include <mach/mach_init.h>
#include <mach/vm_statistics.h>
@@ -2123,9 +2124,9 @@ char __gnat_alternate_stack[32 * 1024]; /* 1 * MINSIGSTKSZ */
static void __gnat_error_handler (int sig, siginfo_t * si, void * uc);
-/* Defined in xnu unix_signal.c */
+/* Defined in xnu unix_signal.c.
+ Tell the kernel to re-use alt stack when delivering a signal. */
#define UC_RESET_ALT_STACK 0x80000000
-extern int sigreturn (void *uc, int flavour);
/* Return true if ADDR is within a stack guard area. */
static int
@@ -2173,8 +2174,9 @@ __gnat_error_handler (int sig, siginfo_t * si, void * uc ATTRIBUTE_UNUSED)
msg = "erroneous memory access";
}
/* Reset the use of alt stack, so that the alt stack will be used
- for the next signal delivery. */
- sigreturn (NULL, UC_RESET_ALT_STACK);
+ for the next signal delivery.
+ The stack can't be used in case of stack checking. */
+ syscall (SYS_sigreturn, NULL, UC_RESET_ALT_STACK);
break;
case SIGFPE:
@@ -2301,8 +2303,10 @@ __gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED,
{
/* We used to compensate here for the raised from call vs raised from signal
exception discrepancy with the GCC ZCX scheme, but this now can be dealt
- with generically in the unwinder (see GCC PR other/26208). Only the VMS
- ports still do the compensation described in the few lines below.
+ with generically in the unwinder (see GCC PR other/26208). This however
+ requires the use of the _Unwind_GetIPInfo routine in raise-gcc.c, which
+ is predicated on the definition of HAVE_GETIPINFO at compile time. Only
+ the VMS ports still do the compensation described in the few lines below.
*** Call vs signal exception discrepancy with GCC ZCX scheme ***
diff --git a/gcc/ada/link.c b/gcc/ada/link.c
index c36d8e78a42..6ebd329612f 100644
--- a/gcc/ada/link.c
+++ b/gcc/ada/link.c
@@ -62,6 +62,9 @@
/* shared_libgnat_default gives the system dependent link method that */
/* be used by default for linking libgnat (shared or static) */
+/* shared_libgcc_default gives the system dependent link method that */
+/* be used by default for linking libgcc (shared or statis) */
+
/* using_gnu_linker is set to 1 when the GNU linker is used under this */
/* target. */
@@ -89,6 +92,7 @@ const char *__gnat_run_path_option = "-Wl,-rpath,";
int __gnat_link_max = 10000;
unsigned char __gnat_objlist_file_supported = 1;
char __gnat_shared_libgnat_default = STATIC;
+char __gnat_shared_libgcc_default = STATIC;
unsigned char __gnat_using_gnu_linker = 0;
const char *__gnat_object_library_extension = ".a";
unsigned char __gnat_separate_run_path_options = 0;
@@ -99,6 +103,7 @@ const char *__gnat_run_path_option = "-Wl,-rpath,";
int __gnat_link_max = 5000;
unsigned char __gnat_objlist_file_supported = 1;
char __gnat_shared_libgnat_default = STATIC;
+char __gnat_shared_libgcc_default = STATIC;
unsigned char __gnat_using_gnu_linker = 0;
const char *__gnat_object_library_extension = ".a";
unsigned char __gnat_separate_run_path_options = 0;
@@ -109,6 +114,7 @@ const char *__gnat_run_path_option = "";
int __gnat_link_max = 30000;
unsigned char __gnat_objlist_file_supported = 1;
char __gnat_shared_libgnat_default = STATIC;
+char __gnat_shared_libgcc_default = STATIC;
unsigned char __gnat_using_gnu_linker = 1;
const char *__gnat_object_library_extension = ".a";
unsigned char __gnat_separate_run_path_options = 0;
@@ -119,6 +125,7 @@ const char *__gnat_run_path_option = "-Wl,+b,";
int __gnat_link_max = 5000;
unsigned char __gnat_objlist_file_supported = 1;
char __gnat_shared_libgnat_default = STATIC;
+char __gnat_shared_libgcc_default = STATIC;
unsigned char __gnat_using_gnu_linker = 0;
const char *__gnat_object_library_extension = ".a";
unsigned char __gnat_separate_run_path_options = 0;
@@ -129,6 +136,7 @@ const char *__gnat_run_path_option = "";
int __gnat_link_max = 15000;
const unsigned char __gnat_objlist_file_supported = 1;
char __gnat_shared_libgnat_default = STATIC;
+char __gnat_shared_libgcc_default = STATIC;
unsigned char __gnat_using_gnu_linker = 0;
const char *__gnat_object_library_extension = ".a";
unsigned char __gnat_separate_run_path_options = 0;
@@ -137,6 +145,7 @@ unsigned char __gnat_separate_run_path_options = 0;
const char *__gnat_object_file_option = "";
const char *__gnat_run_path_option = "";
char __gnat_shared_libgnat_default = STATIC;
+char __gnat_shared_libgcc_default = STATIC;
int __gnat_link_max = 2147483647;
unsigned char __gnat_objlist_file_supported = 0;
unsigned char __gnat_using_gnu_linker = 0;
@@ -147,6 +156,7 @@ unsigned char __gnat_separate_run_path_options = 0;
const char *__gnat_object_file_option = "";
const char *__gnat_run_path_option = "-Wl,-R";
char __gnat_shared_libgnat_default = STATIC;
+char __gnat_shared_libgcc_default = STATIC;
int __gnat_link_max = 2147483647;
unsigned char __gnat_objlist_file_supported = 0;
unsigned char __gnat_using_gnu_linker = 0;
@@ -157,6 +167,7 @@ unsigned char __gnat_separate_run_path_options = 0;
const char *__gnat_object_file_option = "";
const char *__gnat_run_path_option = "-Wl,-rpath,";
char __gnat_shared_libgnat_default = STATIC;
+char __gnat_shared_libgcc_default = STATIC;
int __gnat_link_max = 8192;
unsigned char __gnat_objlist_file_supported = 1;
unsigned char __gnat_using_gnu_linker = 1;
@@ -167,6 +178,7 @@ unsigned char __gnat_separate_run_path_options = 0;
const char *__gnat_object_file_option = "-Wl,-filelist,";
const char *__gnat_run_path_option = "-Wl,-rpath,";
char __gnat_shared_libgnat_default = STATIC;
+char __gnat_shared_libgcc_default = SHARED;
int __gnat_link_max = 262144;
unsigned char __gnat_objlist_file_supported = 1;
unsigned char __gnat_using_gnu_linker = 0;
@@ -177,6 +189,7 @@ unsigned char __gnat_separate_run_path_options = 1;
const char *__gnat_object_file_option = "";
const char *__gnat_run_path_option = "-Wl,-rpath,";
char __gnat_shared_libgnat_default = STATIC;
+char __gnat_shared_libgcc_default = STATIC;
int __gnat_link_max = 8192;
unsigned char __gnat_objlist_file_supported = 1;
unsigned char __gnat_using_gnu_linker = 1;
@@ -187,6 +200,7 @@ unsigned char __gnat_separate_run_path_options = 0;
const char *__gnat_object_file_option = "";
const char *__gnat_run_path_option = "";
char __gnat_shared_libgnat_default = STATIC;
+char __gnat_shared_libgcc_default = STATIC;
int __gnat_link_max = 2147483647;
unsigned char __gnat_objlist_file_supported = 0;
unsigned char __gnat_using_gnu_linker = 0;
@@ -200,6 +214,7 @@ unsigned char __gnat_separate_run_path_options = 0;
const char *__gnat_run_path_option = "";
const char *__gnat_object_file_option = "";
char __gnat_shared_libgnat_default = STATIC;
+char __gnat_shared_libgcc_default = STATIC;
int __gnat_link_max = 2147483647;
unsigned char __gnat_objlist_file_supported = 0;
unsigned char __gnat_using_gnu_linker = 0;
diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb
index dacf290c273..12e6386d045 100644
--- a/gcc/ada/make.adb
+++ b/gcc/ada/make.adb
@@ -106,13 +106,17 @@ package body Make is
Full_Source_File : File_Name_Type;
Lib_File : File_Name_Type;
Source_Unit : Unit_Name_Type;
+ Full_Lib_File : File_Name_Type;
+ Lib_File_Attr : aliased File_Attributes;
Mapping_File : Natural := No_Mapping_File;
Project : Project_Id := No_Project;
- Syntax_Only : Boolean := False;
- Output_Is_Object : Boolean := True;
end record;
-- Data recorded for each compilation process spawned
+ No_Compilation_Data : constant Compilation_Data :=
+ (Invalid_Pid, No_File, No_File, No_Unit_Name, No_File, Unknown_Attributes,
+ No_Mapping_File, No_Project);
+
type Comp_Data_Arr is array (Positive range <>) of Compilation_Data;
type Comp_Data_Ptr is access Comp_Data_Arr;
Running_Compile : Comp_Data_Ptr;
@@ -356,7 +360,7 @@ package body Make is
Project_Of_Current_Object_Directory : Project_Id := No_Project;
-- The object directory of the project for the last compilation. Avoid
-- calling Change_Dir if the current working directory is already this
- -- directory
+ -- directory.
-- Packages of project files where unknown attributes are errors
@@ -740,6 +744,8 @@ package body Make is
Is_Main_Source : Boolean;
The_Args : Argument_List;
Lib_File : File_Name_Type;
+ Full_Lib_File : File_Name_Type;
+ Lib_File_Attr : access File_Attributes;
Read_Only : Boolean;
ALI : out ALI_Id;
O_File : out File_Name_Type;
@@ -750,6 +756,10 @@ package body Make is
-- ALI is the ALI_Id corresponding to Lib_File. If Lib_File in not
-- up-to-date, then the corresponding source file needs to be recompiled.
-- In this case ALI = No_ALI_Id.
+ -- Full_Lib_File must be the result of calling Osint.Full_Lib_File_Name on
+ -- Lib_File. Precomputing it saves system calls. Lib_File_Attr is the
+ -- initialized attributes of that file, which is also used to save on
+ -- system calls (it can safely be initialized to Unknown_Attributes).
procedure Check_Linker_Options
(E_Stamp : Time_Stamp_Type;
@@ -1414,6 +1424,8 @@ package body Make is
Is_Main_Source : Boolean;
The_Args : Argument_List;
Lib_File : File_Name_Type;
+ Full_Lib_File : File_Name_Type;
+ Lib_File_Attr : access File_Attributes;
Read_Only : Boolean;
ALI : out ALI_Id;
O_File : out File_Name_Type;
@@ -1523,9 +1535,6 @@ package body Make is
-- Data declarations for Check --
---------------------------------
- Full_Lib_File : File_Name_Type;
- -- Full name of current library file
-
Full_Obj_File : File_Name_Type;
-- Full name of the object file corresponding to Lib_File
@@ -1576,15 +1585,14 @@ package body Make is
Check_Object_Consistency;
begin
Check_Object_Consistency := False;
- Text := Read_Library_Info (Lib_File);
+ Text := Read_Library_Info_From_Full (Full_Lib_File, Lib_File_Attr);
Check_Object_Consistency := Saved_Check_Object_Consistency;
end;
else
- Text := Read_Library_Info (Lib_File);
+ Text := Read_Library_Info_From_Full (Full_Lib_File, Lib_File_Attr);
end if;
- Full_Lib_File := Full_Library_Info_Name;
Full_Obj_File := Full_Object_File_Name;
Lib_Stamp := Current_Library_File_Stamp;
Obj_Stamp := Current_Object_File_Stamp;
@@ -1858,7 +1866,8 @@ package body Make is
Normalize_Pathname
(Dir_Name
(Get_Name_String (Full_Lib_File)),
- Resolve_Links => True,
+ Resolve_Links =>
+ Opt.Follow_Links_For_Dirs,
Case_Sensitive => False);
begin
@@ -2418,62 +2427,22 @@ package body Make is
Initialize_ALI_Data : Boolean := True;
Max_Process : Positive := 1)
is
- Source_Unit : Unit_Name_Type;
- -- Current source unit
-
- Source_File : File_Name_Type;
- -- Current source file
-
- Full_Source_File : File_Name_Type;
- -- Full name of the current source file
-
- Lib_File : File_Name_Type;
- -- Current library file
-
- Full_Lib_File : File_Name_Type;
- -- Full name of the current library file
-
- Obj_File : File_Name_Type;
- -- Full name of the object file corresponding to Lib_File
-
- Obj_Stamp : Time_Stamp_Type;
- -- Time stamp of the current object file
-
- Sfile : File_Name_Type;
- -- Contains the source file of the units withed by Source_File
-
- Uname : Unit_Name_Type;
- -- Contains the unit name of the units withed by Source_File
-
- ALI : ALI_Id;
- -- ALI Id of the current ALI file
-
- -- Comment following declarations ???
-
- Read_Only : Boolean := False;
-
- Compilation_OK : Boolean;
- Need_To_Compile : Boolean;
-
- Pid : Process_Id;
- Text : Text_Buffer_Ptr;
-
- Mfile : Natural := No_Mapping_File;
+ Mfile : Natural := No_Mapping_File;
+ Mapping_File_Arg : String_Access;
+ -- Info on the mapping file
Need_To_Check_Standard_Library : Boolean :=
Check_Readonly_Files
and not Unique_Compile;
- Mapping_File_Arg : String_Access;
-
- Process_Created : Boolean := False;
-
procedure Add_Process
- (Pid : Process_Id;
- Sfile : File_Name_Type;
- Afile : File_Name_Type;
- Uname : Unit_Name_Type;
- Mfile : Natural := No_Mapping_File);
+ (Pid : Process_Id;
+ Sfile : File_Name_Type;
+ Afile : File_Name_Type;
+ Uname : Unit_Name_Type;
+ Full_Lib_File : File_Name_Type;
+ Lib_File_Attr : File_Attributes;
+ Mfile : Natural := No_Mapping_File);
-- Adds process Pid to the current list of outstanding compilation
-- processes and record the full name of the source file Sfile that
-- we are compiling, the name of its library file Afile and the
@@ -2482,18 +2451,16 @@ package body Make is
-- array The_Mapping_File_Names.
procedure Await_Compile
- (Sfile : out File_Name_Type;
- Afile : out File_Name_Type;
- Uname : out Unit_Name_Type;
+ (Data : out Compilation_Data;
OK : out Boolean);
-- Awaits that an outstanding compilation process terminates. When
- -- it does set Sfile to the name of the source file that was compiled
- -- Afile to the name of its library file and Uname to the name of its
- -- unit. Note that this time stamp can be used to check whether the
+ -- it does set Data to the information registered for the corresponding
+ -- call to Add_Process.
+ -- Note that this time stamp can be used to check whether the
-- compilation did generate an object file. OK is set to True if the
- -- compilation succeeded. Note that Sfile, Afile and Uname could be
- -- resp. No_File, No_File and No_Name if there were no compilations
- -- to wait for.
+ -- compilation succeeded.
+ -- Data could be No_Compilation_Data if there was no compilation to wait
+ -- for.
function Bad_Compilation_Count return Natural;
-- Returns the number of compilation failures
@@ -2501,8 +2468,15 @@ package body Make is
procedure Check_Standard_Library;
-- Check if s-stalib.adb needs to be compiled
- procedure Collect_Arguments_And_Compile (Source_Index : Int);
- -- Collect arguments from project file (if any) and compile
+ procedure Collect_Arguments_And_Compile
+ (Full_Source_File : File_Name_Type;
+ Lib_File : File_Name_Type;
+ Source_Index : Int;
+ Pid : out Process_Id;
+ Process_Created : out Boolean);
+ -- Collect arguments from project file (if any) and compile.
+ -- If no compilation was attempted, Processed_Created is set to False,
+ -- and the value of Pid is unknown.
function Compile
(Project : Project_Id;
@@ -2545,16 +2519,41 @@ package body Make is
procedure Record_Good_ALI (A : ALI_Id);
-- Records in the previous set the Id of an ALI file
+ function Must_Exit_Because_Of_Error return Boolean;
+ -- Return True if there were errors and the user decided to exit in such
+ -- a case. This waits for any outstanding compilation.
+
+ function Start_Compile_If_Possible (Args : Argument_List) return Boolean;
+ -- Check if there is more work that we can do (i.e. the Queue is non
+ -- empty). If there is, do it only if we have not yet used up all the
+ -- available processes.
+ -- Returns True if we should exit the main loop
+
+ procedure Wait_For_Available_Slot;
+ -- Check if we should wait for a compilation to finish. This is the case
+ -- if all the available processes are busy compiling sources or there is
+ -- nothing else to do (that is the Q is empty and there are no good ALIs
+ -- to process).
+
+ procedure Fill_Queue_From_ALI_Files;
+ -- Check if we recorded good ALI files. If yes process them now in the
+ -- order in which they have been recorded. There are two occasions in
+ -- which we record good ali files. The first is in phase 1 when, after
+ -- scanning an existing ALI file we realize it is up-to-date, the second
+ -- instance is after a successful compilation.
+
-----------------
-- Add_Process --
-----------------
procedure Add_Process
- (Pid : Process_Id;
- Sfile : File_Name_Type;
- Afile : File_Name_Type;
- Uname : Unit_Name_Type;
- Mfile : Natural := No_Mapping_File)
+ (Pid : Process_Id;
+ Sfile : File_Name_Type;
+ Afile : File_Name_Type;
+ Uname : Unit_Name_Type;
+ Full_Lib_File : File_Name_Type;
+ Lib_File_Attr : File_Attributes;
+ Mfile : Natural := No_Mapping_File)
is
OC1 : constant Positive := Outstanding_Compiles + 1;
@@ -2562,14 +2561,15 @@ package body Make is
pragma Assert (OC1 <= Max_Process);
pragma Assert (Pid /= Invalid_Pid);
- Running_Compile (OC1).Pid := Pid;
- Running_Compile (OC1).Full_Source_File := Sfile;
- Running_Compile (OC1).Lib_File := Afile;
- Running_Compile (OC1).Source_Unit := Uname;
- Running_Compile (OC1).Mapping_File := Mfile;
- Running_Compile (OC1).Project := Arguments_Project;
- Running_Compile (OC1).Syntax_Only := Syntax_Only;
- Running_Compile (OC1).Output_Is_Object := Output_Is_Object;
+ Running_Compile (OC1) :=
+ (Pid => Pid,
+ Full_Source_File => Sfile,
+ Lib_File => Afile,
+ Full_Lib_File => Full_Lib_File,
+ Lib_File_Attr => Lib_File_Attr,
+ Source_Unit => Uname,
+ Mapping_File => Mfile,
+ Project => Arguments_Project);
Outstanding_Compiles := OC1;
end Add_Process;
@@ -2579,21 +2579,17 @@ package body Make is
-------------------
procedure Await_Compile
- (Sfile : out File_Name_Type;
- Afile : out File_Name_Type;
- Uname : out Unit_Name_Type;
- OK : out Boolean)
+ (Data : out Compilation_Data;
+ OK : out Boolean)
is
Pid : Process_Id;
Project : Project_Id;
- Data : Project_Compilation_Access;
+ Comp_Data : Project_Compilation_Access;
begin
pragma Assert (Outstanding_Compiles > 0);
- Sfile := No_File;
- Afile := No_File;
- Uname := No_Unit_Name;
+ Data := No_Compilation_Data;
OK := False;
-- The loop here is a work-around for a problem on VMS; in some
@@ -2611,21 +2607,19 @@ package body Make is
for J in Running_Compile'First .. Outstanding_Compiles loop
if Pid = Running_Compile (J).Pid then
- Sfile := Running_Compile (J).Full_Source_File;
- Afile := Running_Compile (J).Lib_File;
- Uname := Running_Compile (J).Source_Unit;
- Syntax_Only := Running_Compile (J).Syntax_Only;
- Output_Is_Object := Running_Compile (J).Output_Is_Object;
+ Data := Running_Compile (J);
Project := Running_Compile (J).Project;
- -- If a mapping file was used by this compilation,
- -- get its file name for reuse by a subsequent compilation
+ -- If a mapping file was used by this compilation, get its
+ -- file name for reuse by a subsequent compilation.
if Running_Compile (J).Mapping_File /= No_Mapping_File then
- Data := Project_Compilation_Htable.Get
+ Comp_Data := Project_Compilation_Htable.Get
(Project_Compilation, Project);
- Data.Last_Free_Indices := Data.Last_Free_Indices + 1;
- Data.Free_Mapping_File_Indices (Data.Last_Free_Indices) :=
+ Comp_Data.Last_Free_Indices :=
+ Comp_Data.Last_Free_Indices + 1;
+ Comp_Data.Free_Mapping_File_Indices
+ (Comp_Data.Last_Free_Indices) :=
Running_Compile (J).Mapping_File;
end if;
@@ -2707,11 +2701,13 @@ package body Make is
-- Collect_Arguments_And_Compile --
-----------------------------------
- procedure Collect_Arguments_And_Compile (Source_Index : Int) is
+ procedure Collect_Arguments_And_Compile
+ (Full_Source_File : File_Name_Type;
+ Lib_File : File_Name_Type;
+ Source_Index : Int;
+ Pid : out Process_Id;
+ Process_Created : out Boolean) is
begin
- -- Process_Created will be set True if an attempt is made to compile
- -- the source, that is if it is not in an externally built project.
-
Process_Created := False;
-- If we use mapping file (-P or -C switches), then get one
@@ -2759,11 +2755,11 @@ package body Make is
Pid :=
Compile
- (Arguments_Project,
- File_Name_Type (Arguments_Path_Name),
- Lib_File,
- Source_Index,
- Arguments (1 .. Last_Argument));
+ (Project => Arguments_Project,
+ S => File_Name_Type (Arguments_Path_Name),
+ L => Lib_File,
+ Source_Index => Source_Index,
+ Args => Arguments (1 .. Last_Argument));
Process_Created := True;
end if;
@@ -2773,11 +2769,11 @@ package body Make is
Pid :=
Compile
- (Main_Project,
- Full_Source_File,
- Lib_File,
- Source_Index,
- Arguments (1 .. Last_Argument));
+ (Project => Main_Project,
+ S => Full_Source_File,
+ L => Lib_File,
+ Source_Index => Source_Index,
+ Args => Arguments (1 .. Last_Argument));
Process_Created := True;
end if;
end Collect_Arguments_And_Compile;
@@ -2994,6 +2990,119 @@ package body Make is
(Gcc_Path.all, Comp_Args (Args'First .. Comp_Last));
end Compile;
+ -------------------------------
+ -- Fill_Queue_From_ALI_Files --
+ -------------------------------
+
+ procedure Fill_Queue_From_ALI_Files is
+ ALI : ALI_Id;
+ Source_Index : Int;
+ Sfile : File_Name_Type;
+ Uname : Unit_Name_Type;
+ Unit_Name : Name_Id;
+ Uid : Prj.Unit_Index;
+ begin
+ while Good_ALI_Present loop
+ ALI := Get_Next_Good_ALI;
+ Source_Index := Unit_Index_Of (ALIs.Table (ALI).Afile);
+
+ -- If we are processing the library file corresponding to the
+ -- main source file check if this source can be a main unit.
+
+ if ALIs.Table (ALI).Sfile = Main_Source
+ and then Source_Index = Main_Index
+ then
+ Main_Unit := ALIs.Table (ALI).Main_Program /= None;
+ end if;
+
+ -- The following adds the standard library (s-stalib) to the
+ -- list of files to be handled by gnatmake: this file and any
+ -- files it depends on are always included in every bind,
+ -- even if they are not in the explicit dependency list.
+ -- Of course, it is not added if Suppress_Standard_Library
+ -- is True.
+
+ -- However, to avoid annoying output about s-stalib.ali being
+ -- read only, when "-v" is used, we add the standard library
+ -- only when "-a" is used.
+
+ if Need_To_Check_Standard_Library then
+ Check_Standard_Library;
+ end if;
+
+ -- Now insert in the Q the unmarked source files (i.e. those
+ -- which have never been inserted in the Q and hence never
+ -- considered). Only do that if Unique_Compile is False.
+
+ if not Unique_Compile then
+ for J in
+ ALIs.Table (ALI).First_Unit .. ALIs.Table (ALI).Last_Unit
+ loop
+ for K in
+ Units.Table (J).First_With .. Units.Table (J).Last_With
+ loop
+ Sfile := Withs.Table (K).Sfile;
+ Uname := Withs.Table (K).Uname;
+
+ -- If project files are used, find the proper source
+ -- to compile, in case Sfile is the spec, but there
+ -- is a body.
+
+ if Main_Project /= No_Project then
+ Get_Name_String (Uname);
+ Name_Len := Name_Len - 2;
+ Unit_Name := Name_Find;
+ Uid :=
+ Units_Htable.Get (Project_Tree.Units_HT, Unit_Name);
+
+ if Uid /= Prj.No_Unit_Index then
+ if Uid.File_Names (Impl) /= null
+ and then not Uid.File_Names (Impl).Locally_Removed
+ then
+ Sfile := Uid.File_Names (Impl).File;
+ Source_Index := Uid.File_Names (Impl).Index;
+
+ elsif Uid.File_Names (Spec) /= null
+ and then not Uid.File_Names (Spec).Locally_Removed
+ then
+ Sfile := Uid.File_Names (Spec).File;
+ Source_Index := Uid.File_Names (Spec).Index;
+ end if;
+ end if;
+ end if;
+
+ Dependencies.Append ((ALIs.Table (ALI).Sfile, Sfile));
+
+ if Is_In_Obsoleted (Sfile) then
+ Executable_Obsolete := True;
+ end if;
+
+ if Sfile = No_File then
+ Debug_Msg ("Skipping generic:", Withs.Table (K).Uname);
+
+ else
+ Source_Index := Unit_Index_Of (Withs.Table (K).Afile);
+
+ if Is_Marked (Sfile, Source_Index) then
+ Debug_Msg ("Skipping marked file:", Sfile);
+
+ elsif not Check_Readonly_Files
+ and then Is_Internal_File_Name (Sfile, False)
+ then
+ Debug_Msg ("Skipping internal file:", Sfile);
+
+ else
+ Insert_Q
+ (Sfile, Withs.Table (K).Uname, Source_Index);
+ Mark (Sfile, Source_Index);
+ end if;
+ end if;
+ end loop;
+ end loop;
+ end if;
+ end loop;
+ end Fill_Queue_From_ALI_Files;
+
----------------------
-- Get_Mapping_File --
----------------------
@@ -3049,6 +3158,29 @@ package body Make is
return Good_ALI.First <= Good_ALI.Last;
end Good_ALI_Present;
+ --------------------------------
+ -- Must_Exit_Because_Of_Error --
+ --------------------------------
+
+ function Must_Exit_Because_Of_Error return Boolean is
+ Data : Compilation_Data;
+ Success : Boolean;
+ begin
+ if Bad_Compilation_Count > 0 and then not Keep_Going then
+ while Outstanding_Compiles > 0 loop
+ Await_Compile (Data, Success);
+
+ if not Success then
+ Record_Failure (Data.Full_Source_File, Data.Source_Unit);
+ end if;
+ end loop;
+
+ return True;
+ end if;
+
+ return False;
+ end Must_Exit_Because_Of_Error;
+
--------------------
-- Record_Failure --
--------------------
@@ -3073,276 +3205,320 @@ package body Make is
Good_ALI.Table (Good_ALI.Last) := A;
end Record_Good_ALI;
- -- Start of processing for Compile_Sources
-
- begin
- pragma Assert (Args'First = 1);
-
- Outstanding_Compiles := 0;
- Running_Compile := new Comp_Data_Arr (1 .. Max_Process);
-
- -- Package and Queue initializations
-
- Good_ALI.Init;
-
- if First_Q_Initialization then
- Init_Q;
- end if;
+ -------------------------------
+ -- Start_Compile_If_Possible --
+ -------------------------------
- if Initialize_ALI_Data then
- Initialize_ALI;
- Initialize_ALI_Source;
- end if;
+ function Start_Compile_If_Possible
+ (Args : Argument_List) return Boolean
+ is
+ In_Lib_Dir : Boolean;
+ Need_To_Compile : Boolean;
+ Pid : Process_Id;
+ Process_Created : Boolean;
+
+ Source_File : File_Name_Type;
+ Full_Source_File : File_Name_Type;
+ Source_File_Attr : aliased File_Attributes;
+ -- The full name of the source file and its attributes (size, ...)
+
+ Source_Unit : Unit_Name_Type;
+ Source_Index : Int;
+ -- Index of the current unit in the current source file
+
+ Lib_File : File_Name_Type;
+ Full_Lib_File : File_Name_Type;
+ Lib_File_Attr : aliased File_Attributes;
+ Read_Only : Boolean := False;
+ ALI : ALI_Id;
+ -- The ALI file and its attributes (size, stamp, ...)
+
+ Obj_File : File_Name_Type;
+ Obj_Stamp : Time_Stamp_Type;
+ -- The object file
- -- The following two flags affect the behavior of ALI.Set_Source_Table.
- -- We set Check_Source_Files to True to ensure that source file
- -- time stamps are checked, and we set All_Sources to False to
- -- avoid checking the presence of the source files listed in the
- -- source dependency section of an ali file (which would be a mistake
- -- since the ali file may be obsolete).
+ begin
+ if not Empty_Q and then Outstanding_Compiles < Max_Process then
+ Extract_From_Q (Source_File, Source_Unit, Source_Index);
- Check_Source_Files := True;
- All_Sources := False;
+ Osint.Full_Source_Name
+ (Source_File,
+ Full_File => Full_Source_File,
+ Attr => Source_File_Attr'Access);
- -- Only insert in the Q if it is not already done, to avoid simultaneous
- -- compilations if -jnnn is used.
+ Lib_File := Osint.Lib_File_Name (Source_File, Source_Index);
+ Osint.Full_Lib_File_Name
+ (Lib_File,
+ Lib_File => Full_Lib_File,
+ Attr => Lib_File_Attr);
- if not Is_Marked (Main_Source, Main_Index) then
- Insert_Q (Main_Source, Index => Main_Index);
- Mark (Main_Source, Main_Index);
- end if;
+ -- If this source has already been compiled, the executable is
+ -- obsolete.
- First_Compiled_File := No_File;
- Most_Recent_Obj_File := No_File;
- Most_Recent_Obj_Stamp := Empty_Time_Stamp;
- Main_Unit := False;
+ if Is_In_Obsoleted (Source_File) then
+ Executable_Obsolete := True;
+ end if;
- -- Keep looping until there is no more work to do (the Q is empty)
- -- and all the outstanding compilations have terminated
+ In_Lib_Dir := Full_Lib_File /= No_File
+ and then In_Ada_Lib_Dir (Full_Lib_File);
- Make_Loop : while not Empty_Q or else Outstanding_Compiles > 0 loop
+ -- Since the following requires a system call, we precompute it
+ -- when needed.
- -- If the user does not want to keep going in case of errors then
- -- wait for the remaining outstanding compiles and then exit.
+ if not In_Lib_Dir then
+ if Full_Lib_File /= No_File
+ and then not Check_Readonly_Files
+ then
+ Get_Name_String (Full_Lib_File);
+ Name_Buffer (Name_Len + 1) := ASCII.NUL;
+ Read_Only := not Is_Writable_File
+ (Name_Buffer'Address, Lib_File_Attr'Access);
+ else
+ Read_Only := False;
+ end if;
+ end if;
- if Bad_Compilation_Count > 0 and then not Keep_Going then
- while Outstanding_Compiles > 0 loop
- Await_Compile
- (Full_Source_File, Lib_File, Source_Unit, Compilation_OK);
+ -- If the library file is an Ada library skip it
- if not Compilation_OK then
- Record_Failure (Full_Source_File, Source_Unit);
- end if;
- end loop;
+ if In_Lib_Dir then
+ Verbose_Msg
+ (Lib_File,
+ "is in an Ada library",
+ Prefix => " ",
+ Minimum_Verbosity => Opt.High);
- exit Make_Loop;
- end if;
+ -- If the library file is a read-only library skip it, but only
+ -- if, when using project files, this library file is in the
+ -- right object directory (a read-only ALI file in the object
+ -- directory of a project being extended must not be skipped).
- -- PHASE 1: Check if there is more work that we can do (i.e. the Q
- -- is non empty). If there is, do it only if we have not yet used
- -- up all the available processes.
+ elsif Read_Only
+ and then Is_In_Object_Directory (Source_File, Full_Lib_File)
+ then
+ Verbose_Msg
+ (Lib_File,
+ "is a read-only library",
+ Prefix => " ",
+ Minimum_Verbosity => Opt.High);
- if not Empty_Q and then Outstanding_Compiles < Max_Process then
- declare
- Source_Index : Int;
- -- Index of the current unit in the current source file
+ -- The source file that we are checking cannot be located
- begin
- Extract_From_Q (Source_File, Source_Unit, Source_Index);
- Full_Source_File := Osint.Full_Source_Name (Source_File);
- Lib_File := Osint.Lib_File_Name
- (Source_File, Source_Index);
- Full_Lib_File := Osint.Full_Lib_File_Name (Lib_File);
+ elsif Full_Source_File = No_File then
+ Record_Failure (Source_File, Source_Unit, False);
- -- If this source has already been compiled, the executable is
- -- obsolete.
+ -- Source and library files can be located but are internal
+ -- files.
- if Is_In_Obsoleted (Source_File) then
- Executable_Obsolete := True;
+ elsif not Check_Readonly_Files
+ and then Full_Lib_File /= No_File
+ and then Is_Internal_File_Name (Source_File, False)
+ then
+ if Force_Compilations then
+ Fail
+ ("not allowed to compile """ &
+ Get_Name_String (Source_File) &
+ """; use -a switch, or compile file with " &
+ """-gnatg"" switch");
end if;
- -- If the library file is an Ada library skip it
-
- if Full_Lib_File /= No_File
- and then In_Ada_Lib_Dir (Full_Lib_File)
- then
- Verbose_Msg
- (Lib_File,
- "is in an Ada library",
- Prefix => " ",
- Minimum_Verbosity => Opt.High);
-
- -- If the library file is a read-only library skip it, but
- -- only if, when using project files, this library file is
- -- in the right object directory (a read-only ALI file
- -- in the object directory of a project being extended
- -- should not be skipped).
-
- elsif Full_Lib_File /= No_File
- and then not Check_Readonly_Files
- and then Is_Readonly_Library (Full_Lib_File)
- and then Is_In_Object_Directory (Source_File, Full_Lib_File)
- then
- Verbose_Msg
- (Lib_File,
- "is a read-only library",
- Prefix => " ",
- Minimum_Verbosity => Opt.High);
+ Verbose_Msg
+ (Lib_File,
+ "is an internal library",
+ Prefix => " ",
+ Minimum_Verbosity => Opt.High);
- -- The source file that we are checking cannot be located
+ -- The source file that we are checking can be located
- elsif Full_Source_File = No_File then
- Record_Failure (Source_File, Source_Unit, False);
+ else
+ Collect_Arguments (Source_File, Source_Index,
+ Source_File = Main_Source, Args);
- -- Source and library files can be located but are internal
- -- files
+ -- Do nothing if project of source is externally built
- elsif not Check_Readonly_Files
- and then Full_Lib_File /= No_File
- and then Is_Internal_File_Name (Source_File, False)
+ if Arguments_Project = No_Project
+ or else not Arguments_Project.Externally_Built
then
- if Force_Compilations then
- Fail
- ("not allowed to compile """ &
- Get_Name_String (Source_File) &
- """; use -a switch, or compile file with " &
- """-gnatg"" switch");
+ -- Don't waste any time if we have to recompile anyway
+
+ Obj_Stamp := Empty_Time_Stamp;
+ Need_To_Compile := Force_Compilations;
+
+ if not Force_Compilations then
+ Check (Source_File => Source_File,
+ Source_Index => Source_Index,
+ Is_Main_Source => Source_File = Main_Source,
+ The_Args => Args,
+ Lib_File => Lib_File,
+ Full_Lib_File => Full_Lib_File,
+ Lib_File_Attr => Lib_File_Attr'Access,
+ Read_Only => Read_Only,
+ ALI => ALI,
+ O_File => Obj_File,
+ O_Stamp => Obj_Stamp);
+ Need_To_Compile := (ALI = No_ALI_Id);
end if;
- Verbose_Msg
- (Lib_File,
- "is an internal library",
- Prefix => " ",
- Minimum_Verbosity => Opt.High);
+ if not Need_To_Compile then
+ -- The ALI file is up-to-date. Record its Id
- -- The source file that we are checking can be located
-
- else
- Collect_Arguments (Source_File, Source_Index,
- Source_File = Main_Source, Args);
+ Record_Good_ALI (ALI);
- -- Do nothing if project of source is externally built
+ -- Record the time stamp of the most recent object
+ -- file as long as no (re)compilations are needed.
- if Arguments_Project = No_Project
- or else not Arguments_Project.Externally_Built
- then
- -- Don't waste any time if we have to recompile anyway
-
- Obj_Stamp := Empty_Time_Stamp;
- Need_To_Compile := Force_Compilations;
-
- if not Force_Compilations then
- Read_Only :=
- Full_Lib_File /= No_File
- and then not Check_Readonly_Files
- and then Is_Readonly_Library (Full_Lib_File);
- Check (Source_File, Source_Index,
- Source_File = Main_Source, Args, Lib_File,
- Read_Only, ALI, Obj_File, Obj_Stamp);
- Need_To_Compile := (ALI = No_ALI_Id);
+ if First_Compiled_File = No_File
+ and then (Most_Recent_Obj_File = No_File
+ or else Obj_Stamp > Most_Recent_Obj_Stamp)
+ then
+ Most_Recent_Obj_File := Obj_File;
+ Most_Recent_Obj_Stamp := Obj_Stamp;
end if;
- if not Need_To_Compile then
- -- The ALI file is up-to-date. Record its Id
-
- Record_Good_ALI (ALI);
-
- -- Record the time stamp of the most recent object
- -- file as long as no (re)compilations are needed.
-
- if First_Compiled_File = No_File
- and then (Most_Recent_Obj_File = No_File
- or else Obj_Stamp > Most_Recent_Obj_Stamp)
- then
- Most_Recent_Obj_File := Obj_File;
- Most_Recent_Obj_Stamp := Obj_Stamp;
- end if;
+ else
+ -- Check that switch -x has been used if a source
+ -- outside of project files need to be compiled.
- else
- -- Check that switch -x has been used if a source
- -- outside of project files need to be compiled.
+ if Main_Project /= No_Project
+ and then Arguments_Project = No_Project
+ and then not External_Unit_Compilation_Allowed
+ then
+ Make_Failed ("external source ("
+ & Get_Name_String (Source_File)
+ & ") is not part of any project;"
+ & " cannot be compiled without"
+ & " gnatmake switch -x");
+ end if;
- if Main_Project /= No_Project
- and then Arguments_Project = No_Project
- and then not External_Unit_Compilation_Allowed
- then
- Make_Failed ("external source ("
- & Get_Name_String (Source_File)
- & ") is not part of any project;"
- & " cannot be compiled without"
- & " gnatmake switch -x");
- end if;
+ -- Is this the first file we have to compile?
- -- Is this the first file we have to compile?
+ if First_Compiled_File = No_File then
+ First_Compiled_File := Full_Source_File;
+ Most_Recent_Obj_File := No_File;
- if First_Compiled_File = No_File then
- First_Compiled_File := Full_Source_File;
- Most_Recent_Obj_File := No_File;
+ if Do_Not_Execute then
+ -- Exit the main loop
- if Do_Not_Execute then
- exit Make_Loop;
- end if;
+ return True;
end if;
+ end if;
- if In_Place_Mode then
+ -- Compute where the ALI file must be generated in
+ -- In_Place_Mode (this does not require to know the
+ -- location of the object directory)
+ if In_Place_Mode then
+ if Full_Lib_File = No_File then
-- If the library file was not found, then save
-- the library file near the source file.
- if Full_Lib_File = No_File then
- Lib_File := Osint.Lib_File_Name
- (Full_Source_File, Source_Index);
+ Lib_File := Osint.Lib_File_Name
+ (Full_Source_File, Source_Index);
+ Full_Lib_File := Lib_File;
- -- If the library file was found, then save the
- -- library file in the same place.
+ else
+ -- If the library file was found, then save the
+ -- library file in the same place.
+
+ Lib_File := Full_Lib_File;
+ end if;
+ end if;
+ -- Start the compilation and record it. We can do
+ -- this because there is at least one free process.
+ -- This might change the current directory
+
+ Collect_Arguments_And_Compile
+ (Full_Source_File => Full_Source_File,
+ Lib_File => Lib_File,
+ Source_Index => Source_Index,
+ Pid => Pid,
+ Process_Created => Process_Created);
+
+ -- Compute where the ALI file will be generated (for
+ -- cases that might require to know the current
+ -- directory). The current directory might be changed
+ -- when compiling other files so we cannot rely on it
+ -- being the same to find the resulting ALI file.
+
+ if not In_Place_Mode then
+ -- Compute the expected location of the ALI file. This
+ -- can be from several places:
+ -- -i => in place mode. In such a case,
+ -- Full_Lib_File has already been set above
+ -- -D => if specified
+ -- or defaults in current dir
+ -- We could simply use a call similar to
+ -- Osint.Full_Lib_File_Name (Lib_File)
+ -- but that involves system calls and is thus slower
+
+ if Object_Directory_Path /= null then
+ Name_Len := 0;
+ Add_Str_To_Name_Buffer (Object_Directory_Path.all);
+ Add_Str_To_Name_Buffer (Get_Name_String (Lib_File));
+ Full_Lib_File := Name_Find;
+ else
+ if Project_Of_Current_Object_Directory /=
+ No_Project
+ then
+ Get_Name_String
+ (Project_Of_Current_Object_Directory
+ .Object_Directory.Name);
+ Add_Str_To_Name_Buffer
+ (Get_Name_String (Lib_File));
+ Full_Lib_File := Name_Find;
else
- Lib_File := Full_Lib_File;
+ Full_Lib_File := Lib_File;
end if;
-
end if;
- -- Start the compilation and record it. We can do
- -- this because there is at least one free process.
+ end if;
- Collect_Arguments_And_Compile (Source_Index);
+ Lib_File_Attr := Unknown_Attributes;
- -- Make sure we could successfully start
- -- the Compilation.
+ -- Make sure we could successfully start
+ -- the Compilation.
- if Process_Created then
- if Pid = Invalid_Pid then
- Record_Failure (Full_Source_File, Source_Unit);
- else
- Add_Process
- (Pid,
- Full_Source_File,
- Lib_File,
- Source_Unit,
- Mfile);
- end if;
+ if Process_Created then
+ if Pid = Invalid_Pid then
+ Record_Failure (Full_Source_File, Source_Unit);
+ else
+ Add_Process
+ (Pid => Pid,
+ Sfile => Full_Source_File,
+ Afile => Lib_File,
+ Uname => Source_Unit,
+ Mfile => Mfile,
+ Full_Lib_File => Full_Lib_File,
+ Lib_File_Attr => Lib_File_Attr);
end if;
end if;
end if;
end if;
- end;
+ end if;
end if;
+ return False;
+ end Start_Compile_If_Possible;
+
+ -----------------------------
+ -- Wait_For_Available_Slot --
+ -----------------------------
- -- PHASE 2: Now check if we should wait for a compilation to
- -- finish. This is the case if all the available processes are
- -- busy compiling sources or there is nothing else to do
- -- (that is the Q is empty and there are no good ALIs to process).
+ procedure Wait_For_Available_Slot is
+ Compilation_OK : Boolean;
+ Text : Text_Buffer_Ptr;
+ ALI : ALI_Id;
+ Data : Compilation_Data;
+ begin
if Outstanding_Compiles = Max_Process
or else (Empty_Q
- and then not Good_ALI_Present
- and then Outstanding_Compiles > 0)
+ and then not Good_ALI_Present
+ and then Outstanding_Compiles > 0)
then
- Await_Compile
- (Full_Source_File, Lib_File, Source_Unit, Compilation_OK);
+ Await_Compile (Data, Compilation_OK);
if not Compilation_OK then
- Record_Failure (Full_Source_File, Source_Unit);
+ Record_Failure (Data.Full_Source_File, Data.Source_Unit);
end if;
if Compilation_OK or else Keep_Going then
@@ -3354,15 +3530,17 @@ package body Make is
Check_Object_Consistency;
begin
- -- If compilation was not OK, or if output is not an
- -- object file and we don't do the bind step, don't check
- -- for object consistency.
+ -- If compilation was not OK, or if output is not an object
+ -- file and we don't do the bind step, don't check for
+ -- object consistency.
Check_Object_Consistency :=
Check_Object_Consistency
and Compilation_OK
and (Output_Is_Object or Do_Bind_Step);
- Text := Read_Library_Info (Lib_File);
+
+ Text := Read_Library_Info_From_Full
+ (Data.Full_Lib_File, Data.Lib_File_Attr'Access);
-- Restore Check_Object_Consistency to its initial value
@@ -3376,8 +3554,8 @@ package body Make is
-- the unit just compiled.
if Text /= null then
- ALI :=
- Scan_ALI (Lib_File, Text, Ignore_ED => False, Err => True);
+ ALI := Scan_ALI
+ (Data.Lib_File, Text, Ignore_ED => False, Err => True);
if ALI = No_ALI_Id then
@@ -3385,15 +3563,18 @@ package body Make is
if Compilation_OK then
Inform
- (Lib_File,
+ (Data.Lib_File,
"incompatible ALI file, please recompile");
- Record_Failure (Full_Source_File, Source_Unit);
+ Record_Failure
+ (Data.Full_Source_File, Data.Source_Unit);
end if;
+
else
- Free (Text);
Record_Good_ALI (ALI);
end if;
+ Free (Text);
+
-- If we could not read the ALI file that was just generated
-- then there could be a problem reading either the ALI or the
-- corresponding object file (if Check_Object_Consistency is
@@ -3404,137 +3585,72 @@ package body Make is
else
if Compilation_OK and not Syntax_Only then
Inform
- (Lib_File,
+ (Data.Lib_File,
"WARNING: ALI or object file not found after compile");
- Record_Failure (Full_Source_File, Source_Unit);
+ Record_Failure (Data.Full_Source_File, Data.Source_Unit);
end if;
end if;
end if;
end if;
+ end Wait_For_Available_Slot;
- -- PHASE 3: Check if we recorded good ALI files. If yes process
- -- them now in the order in which they have been recorded. There
- -- are two occasions in which we record good ali files. The first is
- -- in phase 1 when, after scanning an existing ALI file we realize
- -- it is up-to-date, the second instance is after a successful
- -- compilation.
-
- while Good_ALI_Present loop
- ALI := Get_Next_Good_ALI;
-
- declare
- Source_Index : Int := Unit_Index_Of (ALIs.Table (ALI).Afile);
-
- begin
- -- If we are processing the library file corresponding to the
- -- main source file check if this source can be a main unit.
+ -- Start of processing for Compile_Sources
- if ALIs.Table (ALI).Sfile = Main_Source and then
- Source_Index = Main_Index
- then
- Main_Unit := ALIs.Table (ALI).Main_Program /= None;
- end if;
+ begin
+ pragma Assert (Args'First = 1);
- -- The following adds the standard library (s-stalib) to the
- -- list of files to be handled by gnatmake: this file and any
- -- files it depends on are always included in every bind,
- -- even if they are not in the explicit dependency list.
- -- Of course, it is not added if Suppress_Standard_Library
- -- is True.
+ Outstanding_Compiles := 0;
+ Running_Compile := new Comp_Data_Arr (1 .. Max_Process);
- -- However, to avoid annoying output about s-stalib.ali being
- -- read only, when "-v" is used, we add the standard library
- -- only when "-a" is used.
+ -- Package and Queue initializations
- if Need_To_Check_Standard_Library then
- Check_Standard_Library;
- end if;
+ Good_ALI.Init;
- -- Now insert in the Q the unmarked source files (i.e. those
- -- which have never been inserted in the Q and hence never
- -- considered). Only do that if Unique_Compile is False.
+ if First_Q_Initialization then
+ Init_Q;
+ end if;
- if not Unique_Compile then
- for J in
- ALIs.Table (ALI).First_Unit .. ALIs.Table (ALI).Last_Unit
- loop
- for K in
- Units.Table (J).First_With .. Units.Table (J).Last_With
- loop
- Sfile := Withs.Table (K).Sfile;
- Uname := Withs.Table (K).Uname;
+ if Initialize_ALI_Data then
+ Initialize_ALI;
+ Initialize_ALI_Source;
+ end if;
- -- If project files are used, find the proper source
- -- to compile, in case Sfile is the spec, but there
- -- is a body.
+ -- The following two flags affect the behavior of ALI.Set_Source_Table.
+ -- We set Check_Source_Files to True to ensure that source file
+ -- time stamps are checked, and we set All_Sources to False to
+ -- avoid checking the presence of the source files listed in the
+ -- source dependency section of an ali file (which would be a mistake
+ -- since the ali file may be obsolete).
- if Main_Project /= No_Project then
- declare
- Unit_Name : Name_Id;
- Uid : Prj.Unit_Index;
+ Check_Source_Files := True;
+ All_Sources := False;
- begin
- Get_Name_String (Uname);
- Name_Len := Name_Len - 2;
- Unit_Name := Name_Find;
- Uid :=
- Units_Htable.Get
- (Project_Tree.Units_HT, Unit_Name);
-
- if Uid /= Prj.No_Unit_Index then
- if Uid.File_Names (Impl) /= null
- and then
- not Uid.File_Names (Impl).Locally_Removed
- then
- Sfile := Uid.File_Names (Impl).File;
- Source_Index :=
- Uid.File_Names (Impl).Index;
-
- elsif Uid.File_Names (Spec) /= null
- and then
- not Uid.File_Names (Spec).Locally_Removed
- then
- Sfile := Uid.File_Names (Spec).File;
- Source_Index :=
- Uid.File_Names (Spec).Index;
- end if;
- end if;
- end;
- end if;
+ -- Only insert in the Q if it is not already done, to avoid simultaneous
+ -- compilations if -jnnn is used.
- Dependencies.Append ((ALIs.Table (ALI).Sfile, Sfile));
+ if not Is_Marked (Main_Source, Main_Index) then
+ Insert_Q (Main_Source, Index => Main_Index);
+ Mark (Main_Source, Main_Index);
+ end if;
- if Is_In_Obsoleted (Sfile) then
- Executable_Obsolete := True;
- end if;
+ First_Compiled_File := No_File;
+ Most_Recent_Obj_File := No_File;
+ Most_Recent_Obj_Stamp := Empty_Time_Stamp;
+ Main_Unit := False;
- if Sfile = No_File then
- Debug_Msg
- ("Skipping generic:", Withs.Table (K).Uname);
+ -- Keep looping until there is no more work to do (the Q is empty)
+ -- and all the outstanding compilations have terminated.
- else
- Source_Index :=
- Unit_Index_Of (Withs.Table (K).Afile);
+ Make_Loop : while not Empty_Q or else Outstanding_Compiles > 0 loop
+ exit Make_Loop when Must_Exit_Because_Of_Error;
+ exit Make_Loop when Start_Compile_If_Possible (Args);
- if Is_Marked (Sfile, Source_Index) then
- Debug_Msg ("Skipping marked file:", Sfile);
+ Wait_For_Available_Slot;
- elsif not Check_Readonly_Files
- and then Is_Internal_File_Name (Sfile, False)
- then
- Debug_Msg ("Skipping internal file:", Sfile);
+ -- ??? Should be done as soon as we add a Good_ALI, wouldn't it avoid
+ -- the need for a list of good ALI?
- else
- Insert_Q
- (Sfile, Withs.Table (K).Uname, Source_Index);
- Mark (Sfile, Source_Index);
- end if;
- end if;
- end loop;
- end loop;
- end if;
- end;
- end loop;
+ Fill_Queue_From_ALI_Files;
if Display_Compilation_Progress then
Write_Str ("completed ");
@@ -3791,7 +3907,7 @@ package body Make is
-- recreate another config file: we cannot reuse the one that
-- we just deleted!
- Proj.Project.Config_Checked := False;
+ Proj.Project.Config_Checked := False;
Proj.Project.Config_File_Name := No_Path;
Proj.Project.Config_File_Temp := False;
end if;
@@ -3842,8 +3958,8 @@ package body Make is
then
Temporary_Config_File := False;
- -- Do not display the -F=mapping_file switch for
- -- gnatbind, if -dn is not specified.
+ -- Do not display the -F=mapping_file switch for gnatbind
+ -- if -dn is not specified.
elsif Debug.Debug_Flag_N
or else Args (J)'Length < 4
@@ -4003,8 +4119,7 @@ package body Make is
Total_Compilation_Failures : Natural := 0;
Is_Main_Unit : Boolean;
- -- Set to True by Compile_Sources if the Main_Source_File can be a
- -- main unit.
+ -- Set True by Compile_Sources if Main_Source_File can be a main unit
Main_ALI_File : File_Name_Type;
-- The ali file corresponding to Main_Source_File
@@ -4013,8 +4128,8 @@ package body Make is
-- The file name of an executable
Non_Std_Executable : Boolean := False;
- -- Non_Std_Executable is set to True when there is a possibility
- -- that the linker will not choose the correct executable file name.
+ -- Non_Std_Executable is set to True when there is a possibility that
+ -- the linker will not choose the correct executable file name.
Current_Work_Dir : constant String_Access :=
new String'(Get_Current_Dir);
@@ -4065,8 +4180,8 @@ package body Make is
loop
declare
Main : constant String := Mains.Next_Main;
- -- The name specified on the command line may include
- -- directory information.
+ -- The name specified on the command line may include directory
+ -- information.
File_Name : constant String := Base_Name (Main);
-- The simple file name of the current main
@@ -4081,17 +4196,16 @@ package body Make is
Proj := Prj.Env.Project_Of
(File_Name, Main_Project, Project_Tree);
- -- Fail if the current main is not a source of a
- -- project.
+ -- Fail if the current main is not a source of a project
if Proj = No_Project then
Make_Failed
("""" & Main & """ is not a source of any project");
else
- -- If there is directory information, check that
- -- the source exists and, if it does, that the path
- -- is the actual path of a source of a project.
+ -- If there is directory information, check that the source
+ -- exists and, if it does, that the path is the actual path
+ -- of a source of a project.
if Main /= File_Name then
Lang := Get_Language_From_Name (Main_Project, "ada");
@@ -4165,8 +4279,8 @@ package body Make is
elsif Proj /= Real_Main_Project then
- -- Fail, as the current main is not a source
- -- of the same project as the first main.
+ -- Fail, as the current main is not a source of the
+ -- same project as the first main.
Make_Failed
("""" & Main &
@@ -4176,9 +4290,9 @@ package body Make is
end if;
end if;
- -- If -u and -U are not used, we may have mains that
- -- are sources of a project that is not the one
- -- specified with switch -P.
+ -- If -u and -U are not used, we may have mains that are
+ -- sources of a project that is not the one specified with
+ -- switch -P.
if not Unique_Compile then
Main_Project := Real_Main_Project;
@@ -4240,8 +4354,7 @@ package body Make is
(Unit.File_Names (Impl).Display_File);
ALI_Project := Unit.File_Names (Impl).Project;
- -- Otherwise, if there is a spec, put it in the
- -- mapping.
+ -- Otherwise, if there is a spec, put it in the mapping
elsif Unit.File_Names (Spec) /= No_Source
and then Unit.File_Names (Spec).Project /=
@@ -4262,8 +4375,9 @@ package body Make is
-- If we have something to put in the mapping then do it
-- now. However, if the project is extended, we don't put
-- anything in the mapping file, because we don't know where
- -- the ALI file is: it might be in the extended project obj
- -- dir as well as in the extending project obj dir.
+ -- the ALI file is: it might be in the extended project
+ -- object directory as well as in the extending project
+ -- object directory.
if ALI_Name /= No_File
and then ALI_Project.Extended_By = No_Project
@@ -4356,8 +4470,8 @@ package body Make is
OK := OK and Status;
- -- If the creation of the mapping file was successful,
- -- we add the switch to the arguments of gnatbind.
+ -- If the creation of the mapping file was successful, we add the
+ -- switch to the arguments of gnatbind.
if OK then
Last_Arg := Last_Arg + 1;
@@ -4369,7 +4483,7 @@ package body Make is
-- Start of processing for Gnatmake
- -- This body is very long, should be broken down ???
+ -- This body is very long, should be broken down???
begin
Install_Int_Handler (Sigint_Intercepted'Access);
@@ -4422,10 +4536,10 @@ package body Make is
end if;
-- Specify -n for gnatbind and add the ALI files of all the
- -- sources, except the one which is a fake main subprogram:
- -- this is the one for the binder generated file and it will be
- -- transmitted to gnatlink. These sources are those that are
- -- in the queue.
+ -- sources, except the one which is a fake main subprogram: this
+ -- is the one for the binder generated file and it will be
+ -- transmitted to gnatlink. These sources are those that are in
+ -- the queue.
Add_Switch ("-n", Binder, And_Save => True);
@@ -4442,8 +4556,8 @@ package body Make is
elsif Main_Project /= No_Project then
- -- If the main project file is a library project file, main(s)
- -- cannot be specified on the command line.
+ -- If the main project file is a library project file, main(s) cannot
+ -- be specified on the command line.
if Osint.Number_Of_Files /= 0 then
if Main_Project.Library
@@ -4461,10 +4575,10 @@ package body Make is
Check_Mains;
end if;
- -- If no mains have been specified on the command line,
- -- and we are using a project file, we either find the main(s)
- -- in the attribute Main of the main project, or we put all
- -- the sources of the project file as mains.
+ -- If no mains have been specified on the command line, and we are
+ -- using a project file, we either find the main(s) in attribute
+ -- Main of the main project, or we put all the sources of the project
+ -- file as mains.
else
if Main_Index /= 0 then
@@ -4476,16 +4590,16 @@ package body Make is
Value : String_List_Id := Main_Project.Mains;
begin
- -- The attribute Main is an empty list or not specified,
- -- or else gnatmake was invoked with the switch "-u".
+ -- The attribute Main is an empty list or not specified, or
+ -- else gnatmake was invoked with the switch "-u".
if Value = Prj.Nil_String or else Unique_Compile then
if (not Make_Steps) or else Compile_Only
or else not Main_Project.Library
then
- -- First make sure that the binder and the linker
- -- will not be invoked.
+ -- First make sure that the binder and the linker will
+ -- not be invoked.
Do_Bind_Step := False;
Do_Link_Step := False;
@@ -4513,8 +4627,8 @@ package body Make is
else
-- The attribute Main is not an empty list.
- -- Put all the main subprograms in the list as if there
- -- were specified on the command line. However, if attribute
+ -- Put all the main subprograms in the list as if they were
+ -- specified on the command line. However, if attribute
-- Languages includes a language other than Ada, only
-- include the Ada mains; if there is no Ada main, compile
-- all the sources of the project.
@@ -4778,8 +4892,8 @@ package body Make is
& """ is not a unit of project "
& Project_File_Name.all & ".");
else
- -- Remove any directory information from the main
- -- source file name.
+ -- Remove any directory information from the main source file
+ -- file name.
declare
Pos : Natural := Main_Unit_File_Name'Last;
@@ -5051,8 +5165,8 @@ package body Make is
end if;
-- Get the target parameters, which are only needed for a couple of
- -- cases in gnatmake. Protect against an exception, such as the case
- -- of system.ads missing from the library, and fail gracefully.
+ -- cases in gnatmake. Protect against an exception, such as the case of
+ -- system.ads missing from the library, and fail gracefully.
begin
Targparm.Get_Target_Parameters;
@@ -5145,8 +5259,8 @@ package body Make is
end;
end if;
- -- If a relative path output file has been specified, we add
- -- the exec directory.
+ -- If a relative path output file has been specified, we add the
+ -- exec directory.
for J in reverse 1 .. Saved_Linker_Switches.Last - 1 loop
if Saved_Linker_Switches.Table (J).all = Output_Flag.all then
@@ -5267,9 +5381,9 @@ package body Make is
The_Saved_Gcc_Switches (The_Saved_Gcc_Switches'Last) := No_gnat_adc;
end if;
- -- If there was a --GCC, --GNATBIND or --GNATLINK switch on
- -- the command line, then we have to use it, even if there was
- -- another switch in the project file.
+ -- If there was a --GCC, --GNATBIND or --GNATLINK switch on the command
+ -- line, then we have to use it, even if there was another switch in
+ -- the project file.
if Saved_Gcc /= null then
Gcc := Saved_Gcc;
@@ -6586,8 +6700,8 @@ package body Make is
Mains.Delete;
- -- Add the directory where gnatmake is invoked in front of the
- -- path, if gnatmake is invoked from a bin directory or with directory
+ -- Add the directory where gnatmake is invoked in front of the path,
+ -- if gnatmake is invoked from a bin directory or with directory
-- information. Only do this if the platform is not VMS, where the
-- notion of path does not really exist.
@@ -6755,8 +6869,8 @@ package body Make is
Write_Eol;
end if;
- -- We add the source directories and the object directories
- -- to the search paths.
+ -- We add the source directories and the object directories to the
+ -- search paths.
Add_Source_Directories (Main_Project, Project_Tree);
Add_Object_Directories (Main_Project);
@@ -6917,9 +7031,8 @@ package body Make is
and then not Unit.File_Names (Spec).Locally_Removed
and then Check_Project (Unit.File_Names (Spec).Project)
then
- -- If there is no source for the body, but there is a source
- -- for the spec which has not been locally removed, then we take
- -- this one.
+ -- If there is no source for the body, but there is one for the
+ -- spec which has not been locally removed, then we take this one.
Sfile := Unit.File_Names (Spec).Display_File;
Index := Unit.File_Names (Spec).Index;
@@ -7263,9 +7376,9 @@ package body Make is
B : Byte;
function Base_Directory return String;
- -- If Dir comes from the command line, empty string (relative paths
- -- are resolved with respect to the current directory), else return
- -- the main project's directory.
+ -- If Dir comes from the command line, empty string (relative paths are
+ -- resolved with respect to the current directory), else return the main
+ -- project's directory.
--------------------
-- Base_Directory --
@@ -7372,7 +7485,7 @@ package body Make is
Multilib_Gcc_Path := GNAT.OS_Lib.Locate_Exec_On_Path (Multilib_Gcc.all);
- Create_Temp_File (Output_FD, Output_Name);
+ Create_Temp_Output_File (Output_FD, Output_Name);
if Output_FD = Invalid_FD then
return;
@@ -7566,7 +7679,7 @@ package body Make is
-- If the previous switch has set the Object_Directory_Present flag
-- (that is we have seen a -D), then the next argument is the path name
- -- of the object directory..
+ -- of the object directory.
elsif Object_Directory_Present
and then not Object_Directory_Seen
@@ -7580,21 +7693,26 @@ package body Make is
Make_Failed ("cannot find object directory """ & Argv & """");
else
- Add_Lib_Search_Dir (Argv);
+ -- Record the object directory. Make sure it ends with a directory
+ -- separator.
- -- Specify the object directory to the binder
+ declare
+ Norm : constant String := Normalize_Pathname (Argv);
+ begin
+ if Norm (Norm'Last) = Directory_Separator then
+ Object_Directory_Path := new String'(Norm);
+ else
+ Object_Directory_Path :=
+ new String'(Norm & Directory_Separator);
+ end if;
- Add_Switch ("-aO" & Argv, Binder, And_Save => And_Save);
+ Add_Lib_Search_Dir (Norm);
- -- Record the object directory. Make sure it ends with a directory
- -- separator.
+ -- Specify the object directory to the binder
+
+ Add_Switch ("-aO" & Norm, Binder, And_Save => And_Save);
+ end;
- if Argv (Argv'Last) = Directory_Separator then
- Object_Directory_Path := new String'(Argv);
- else
- Object_Directory_Path :=
- new String'(Argv & Directory_Separator);
- end if;
end if;
-- Then check if we are dealing with -cargs/-bargs/-largs/-margs
@@ -7617,9 +7735,8 @@ package body Make is
raise Program_Error;
end case;
- -- A special test is needed for the -o switch within a -largs
- -- since that is another way to specify the name of the final
- -- executable.
+ -- A special test is needed for the -o switch within a -largs since that
+ -- is another way to specify the name of the final executable.
elsif Program_Args = Linker
and then Argv = "-o"
@@ -7627,8 +7744,8 @@ package body Make is
Make_Failed ("switch -o not allowed within a -largs. " &
"Use -o directly.");
- -- Check to see if we are reading switches after a -cargs,
- -- -bargs or -largs switch. If yes save it.
+ -- Check to see if we are reading switches after a -cargs, -bargs or
+ -- -largs switch. If so, save it.
elsif Program_Args /= None then
@@ -7671,9 +7788,7 @@ package body Make is
for J in 2 .. Program_Args.all'Last loop
Add_Switch
- (Program_Args.all (J).all,
- Compiler,
- And_Save => And_Save);
+ (Program_Args.all (J).all, Compiler, And_Save => And_Save);
end loop;
end;
@@ -7721,7 +7836,7 @@ package body Make is
Argv (1 .. 5) = "--RTS"
then
Add_Switch (Argv, Compiler, And_Save => And_Save);
- Add_Switch (Argv, Binder, And_Save => And_Save);
+ Add_Switch (Argv, Binder, And_Save => And_Save);
if Argv'Length <= 6 or else Argv (6) /= '=' then
Make_Failed ("missing path for --RTS");
@@ -7784,7 +7899,7 @@ package body Make is
Argv (1 .. 8) = "--param="
then
Add_Switch (Argv, Compiler, And_Save => And_Save);
- Add_Switch (Argv, Linker, And_Save => And_Save);
+ Add_Switch (Argv, Linker, And_Save => And_Save);
else
Scan_Make_Switches (Project_Node_Tree, Argv, Success);
@@ -7822,18 +7937,17 @@ package body Make is
-- -Idir
elsif Argv (2) = 'I' then
- Add_Source_Search_Dir (Argv (3 .. Argv'Last), And_Save);
+ Add_Source_Search_Dir (Argv (3 .. Argv'Last), And_Save);
Add_Library_Search_Dir (Argv (3 .. Argv'Last), And_Save);
Add_Switch (Argv, Compiler, And_Save => And_Save);
- Add_Switch (Argv, Binder, And_Save => And_Save);
+ Add_Switch (Argv, Binder, And_Save => And_Save);
-- -aIdir (to gcc this is like a -I switch)
elsif Argv'Length >= 3 and then Argv (2 .. 3) = "aI" then
Add_Source_Search_Dir (Argv (4 .. Argv'Last), And_Save);
- Add_Switch ("-I" & Argv (4 .. Argv'Last),
- Compiler,
- And_Save => And_Save);
+ Add_Switch
+ ("-I" & Argv (4 .. Argv'Last), Compiler, And_Save => And_Save);
Add_Switch (Argv, Binder, And_Save => And_Save);
-- -aOdir
@@ -7847,9 +7961,8 @@ package body Make is
elsif Argv'Length >= 3 and then Argv (2 .. 3) = "aL" then
Mark_Directory (Argv (4 .. Argv'Last), Ada_Lib_Dir, And_Save);
Add_Library_Search_Dir (Argv (4 .. Argv'Last), And_Save);
- Add_Switch ("-aO" & Argv (4 .. Argv'Last),
- Binder,
- And_Save => And_Save);
+ Add_Switch
+ ("-aO" & Argv (4 .. Argv'Last), Binder, And_Save => And_Save);
-- -aamp_target=...
@@ -7867,14 +7980,12 @@ package body Make is
elsif Argv (2) = 'A' then
Mark_Directory (Argv (3 .. Argv'Last), Ada_Lib_Dir, And_Save);
- Add_Source_Search_Dir (Argv (3 .. Argv'Last), And_Save);
+ Add_Source_Search_Dir (Argv (3 .. Argv'Last), And_Save);
Add_Library_Search_Dir (Argv (3 .. Argv'Last), And_Save);
- Add_Switch ("-I" & Argv (3 .. Argv'Last),
- Compiler,
- And_Save => And_Save);
- Add_Switch ("-aO" & Argv (3 .. Argv'Last),
- Binder,
- And_Save => And_Save);
+ Add_Switch
+ ("-I" & Argv (3 .. Argv'Last), Compiler, And_Save => And_Save);
+ Add_Switch
+ ("-aO" & Argv (3 .. Argv'Last), Binder, And_Save => And_Save);
-- -Ldir
@@ -7882,11 +7993,11 @@ package body Make is
Add_Switch (Argv, Linker, And_Save => And_Save);
-- For -gxxxxx, -pg, -mxxx, -fxxx: give the switch to both the
- -- compiler and the linker (except for -gnatxxx which is only for
- -- the compiler). Some of the -mxxx (for example -m64) and -fxxx
- -- (for example -ftest-coverage for gcov) need to be used when
- -- compiling the binder generated files, and using all these gcc
- -- switches for the binder generated files should not be a problem.
+ -- compiler and the linker (except for -gnatxxx which is only for the
+ -- compiler). Some of the -mxxx (for example -m64) and -fxxx (for
+ -- example -ftest-coverage for gcov) need to be used when compiling
+ -- the binder generated files, and using all these gcc switches for
+ -- the binder generated files should not be a problem.
elsif
(Argv (2) = 'g' and then (Argv'Last < 5
@@ -7896,7 +8007,7 @@ package body Make is
or else (Argv (2) = 'f' and then Argv'Last > 2)
then
Add_Switch (Argv, Compiler, And_Save => And_Save);
- Add_Switch (Argv, Linker, And_Save => And_Save);
+ Add_Switch (Argv, Linker, And_Save => And_Save);
-- The following condition has to be kept synchronized with
-- the Process_Multilib one.
@@ -7922,8 +8033,8 @@ package body Make is
elsif Argv'Last = 2 and then Argv (2) = 'D' then
if Project_File_Name /= null then
- Make_Failed ("-D cannot be used in conjunction with a " &
- "project file");
+ Make_Failed
+ ("-D cannot be used in conjunction with a project file");
else
Scan_Make_Switches (Project_Node_Tree, Argv, Success);
@@ -7931,17 +8042,15 @@ package body Make is
-- -d
- elsif Argv (2) = 'd'
- and then Argv'Last = 2
- then
+ elsif Argv (2) = 'd' and then Argv'Last = 2 then
Display_Compilation_Progress := True;
-- -i
elsif Argv'Last = 2 and then Argv (2) = 'i' then
if Project_File_Name /= null then
- Make_Failed ("-i cannot be used in conjunction with a " &
- "project file");
+ Make_Failed
+ ("-i cannot be used in conjunction with a project file");
else
Scan_Make_Switches (Project_Node_Tree, Argv, Success);
end if;
@@ -7957,20 +8066,16 @@ package body Make is
-- -m
- elsif Argv (2) = 'm'
- and then Argv'Last = 2
- then
+ elsif Argv (2) = 'm' and then Argv'Last = 2 then
Minimal_Recompilation := True;
-- -u
- elsif Argv (2) = 'u'
- and then Argv'Last = 2
- then
- Unique_Compile := True;
- Compile_Only := True;
- Do_Bind_Step := False;
- Do_Link_Step := False;
+ elsif Argv (2) = 'u' and then Argv'Last = 2 then
+ Unique_Compile := True;
+ Compile_Only := True;
+ Do_Bind_Step := False;
+ Do_Link_Step := False;
-- -U
@@ -7978,10 +8083,10 @@ package body Make is
and then Argv'Last = 2
then
Unique_Compile_All_Projects := True;
- Unique_Compile := True;
- Compile_Only := True;
- Do_Bind_Step := False;
- Do_Link_Step := False;
+ Unique_Compile := True;
+ Compile_Only := True;
+ Do_Bind_Step := False;
+ Do_Link_Step := False;
-- -Pprj or -P prj (only once, and only on the command line)
@@ -7990,16 +8095,16 @@ package body Make is
Make_Failed ("cannot have several project files specified");
elsif Object_Directory_Path /= null then
- Make_Failed ("-D cannot be used in conjunction with a " &
- "project file");
+ Make_Failed
+ ("-D cannot be used in conjunction with a project file");
elsif In_Place_Mode then
- Make_Failed ("-i cannot be used in conjunction with a " &
- "project file");
+ Make_Failed
+ ("-i cannot be used in conjunction with a project file");
elsif not And_Save then
- -- It could be a tool other than gnatmake (i.e, gnatdist)
+ -- It could be a tool other than gnatmake (e.g. gnatdist)
-- or a -P switch inside a project file.
Fail
@@ -8040,31 +8145,30 @@ package body Make is
elsif Argv (2) = 'X'
and then Is_External_Assignment (Project_Node_Tree, Argv)
then
- -- Is_External_Assignment has side effects
- -- when it returns True;
+ -- Is_External_Assignment has side effects when it returns True
null;
- -- If -gnath is present, then generate the usage information
- -- right now and do not pass this option on to the compiler calls.
+ -- If -gnath is present, then generate the usage information right
+ -- now and do not pass this option on to the compiler calls.
elsif Argv = "-gnath" then
Usage;
- -- If -gnatc is specified, make sure the bind step and the link
- -- step are not executed.
+ -- If -gnatc is specified, make sure the bind and link steps are not
+ -- executed.
elsif Argv'Length >= 6 and then Argv (2 .. 6) = "gnatc" then
- -- If -gnatc is specified, make sure the bind step and the link
- -- step are not executed.
+ -- If -gnatc is specified, make sure the bind and link steps are
+ -- not executed.
Add_Switch (Argv, Compiler, And_Save => And_Save);
- Operating_Mode := Check_Semantics;
+ Operating_Mode := Check_Semantics;
Check_Object_Consistency := False;
Compile_Only := True;
- Do_Bind_Step := False;
- Do_Link_Step := False;
+ Do_Bind_Step := False;
+ Do_Link_Step := False;
elsif Argv (2 .. Argv'Last) = "nostdlib" then
@@ -8082,7 +8186,7 @@ package body Make is
No_Stdinc := True;
Add_Switch (Argv, Compiler, And_Save => And_Save);
- Add_Switch (Argv, Binder, And_Save => And_Save);
+ Add_Switch (Argv, Binder, And_Save => And_Save);
-- All other switches are processed by Scan_Make_Switches. If the
-- call returns with Gnatmake_Switch_Found = False, then the switch
diff --git a/gcc/ada/makeutl.adb b/gcc/ada/makeutl.adb
index a570737d711..307ec6ffccc 100644
--- a/gcc/ada/makeutl.adb
+++ b/gcc/ada/makeutl.adb
@@ -25,6 +25,7 @@
with ALI; use ALI;
with Debug;
+with Fname;
with Osint; use Osint;
with Output; use Output;
with Opt; use Opt;
@@ -213,31 +214,35 @@ package body Makeutl is
if Unit_Name /= No_Name then
-- For separates, the file is no longer associated with the
- -- unit ("proc-sep.adb" is not associated with unit "proc.sep".
- -- So we need to check whether the source file still exists in
+ -- unit ("proc-sep.adb" is not associated with unit "proc.sep")
+ -- so we need to check whether the source file still exists in
-- the source tree: it will if it matches the naming scheme
-- (and then will be for the same unit).
if Find_Source
- (In_Tree => Project_Tree,
- Project => No_Project,
- Base_Name => SD.Sfile) = No_Source
+ (In_Tree => Project_Tree,
+ Project => No_Project,
+ Base_Name => SD.Sfile) = No_Source
then
- -- If this is not a runtime file (when using -a) ? Otherwise
- -- we get complaints about a-except.adb, which uses
- -- separates.
-
- if not Check_Readonly_Files
- or else Find_File (SD.Sfile, Osint.Source) = No_File
+ -- If this is not a runtime file or if, when gnatmake switch
+ -- -a is used, we are not able to find this subunit in the
+ -- source directories, then recompilation is needed.
+
+ if not Fname.Is_Internal_File_Name (SD.Sfile)
+ or else
+ (Check_Readonly_Files
+ and then Find_File (SD.Sfile, Osint.Source) = No_File)
then
if Verbose_Mode then
Write_Line
- ("While parsing ALI file: Sdep associates "
+ ("While parsing ALI file, file "
& Get_Name_String (SD.Sfile)
- & " with unit " & Get_Name_String (Unit_Name)
+ & " is indicated as containing subunit "
+ & Get_Name_String (Unit_Name)
& " but this does not match what was found while"
& " parsing the project. Will recompile");
end if;
+
return False;
end if;
end if;
@@ -323,7 +328,9 @@ package body Makeutl is
return "";
end if;
- return Normalize_Pathname (Exec (Exec'First .. Path_Last - 4))
+ return Normalize_Pathname
+ (Exec (Exec'First .. Path_Last - 4),
+ Resolve_Links => Opt.Follow_Links_For_Dirs)
& Directory_Separator;
end Get_Install_Dir;
diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads
index d184da9aa54..542b1f02551 100644
--- a/gcc/ada/opt.ads
+++ b/gcc/ada/opt.ads
@@ -663,7 +663,7 @@ package Opt is
-- still valid if they point to a file which is outside of the project),
-- and that no directory has a name which is a valid source name.
- Follow_Links_For_Dirs : Boolean := True;
+ Follow_Links_For_Dirs : Boolean := False;
-- PROJECT MANAGER
-- Set to True if directories can be links in this project, and therefore
-- additional system calls must be performed to ensure that we always see
@@ -1361,6 +1361,11 @@ package Opt is
-- Set to True to generate warnings on use of any feature in Annex or if a
-- subprogram is called for which a pragma Obsolescent applies.
+ Warn_On_Overlap : Boolean := False;
+ -- GNAT
+ -- Set to True to generate warnings when a writable actual which is not
+ -- a by-copy type overlaps with another actual in a subprogram call.
+
Warn_On_Questionable_Missing_Parens : Boolean := True;
-- GNAT
-- Set to True to generate warnings for cases where parentheses are missing
diff --git a/gcc/ada/osint.adb b/gcc/ada/osint.adb
index a02e1eefe7e..1b1f5085984 100644
--- a/gcc/ada/osint.adb
+++ b/gcc/ada/osint.adb
@@ -80,7 +80,8 @@ package body Osint is
-- Appends Suffix to Name and returns the new name
function OS_Time_To_GNAT_Time (T : OS_Time) return Time_Stamp_Type;
- -- Convert OS format time to GNAT format time stamp
+ -- Convert OS format time to GNAT format time stamp.
+ -- Returns Empty_Time_Stamp if T is Invalid_Time
function Executable_Prefix return String_Ptr;
-- Returns the name of the root directory where the executable is stored.
@@ -93,16 +94,39 @@ package body Osint is
-- Update the specified path to replace the prefix with the location
-- where GNAT is installed. See the file prefix.c in GCC for details.
- function Locate_File
- (N : File_Name_Type;
- T : File_Type;
- Dir : Natural;
- Name : String) return File_Name_Type;
+ procedure Locate_File
+ (N : File_Name_Type;
+ T : File_Type;
+ Dir : Natural;
+ Name : String;
+ Found : out File_Name_Type;
+ Attr : access File_Attributes);
-- See if the file N whose name is Name exists in directory Dir. Dir is an
-- index into the Lib_Search_Directories table if T = Library. Otherwise
-- if T = Source, Dir is an index into the Src_Search_Directories table.
-- Returns the File_Name_Type of the full file name if file found, or
-- No_File if not found.
+ -- On exit, Found is set to the file that was found, and Attr to a cache of
+ -- its attributes (at least those that have been computed so far). Reusing
+ -- the cache will save some system calls.
+ -- Attr is always reset in this call to Unknown_Attributes, even in case of
+ -- failure
+
+ procedure Find_File
+ (N : File_Name_Type;
+ T : File_Type;
+ Found : out File_Name_Type;
+ Attr : access File_Attributes);
+ -- A version of Find_File that also returns a cache of the file attributes
+ -- for later reuse
+
+ procedure Smart_Find_File
+ (N : File_Name_Type;
+ T : File_Type;
+ Found : out File_Name_Type;
+ Attr : out File_Attributes);
+ -- A version of Smart_Find_File that also returns a cache of the file
+ -- attributes for later reuse
function C_String_Length (S : Address) return Integer;
-- Returns length of a C string (zero for a null address)
@@ -211,18 +235,17 @@ package body Osint is
function File_Hash (F : File_Name_Type) return File_Hash_Num;
-- Compute hash index for use by Simple_HTable
- package File_Name_Hash_Table is new GNAT.HTable.Simple_HTable (
- Header_Num => File_Hash_Num,
- Element => File_Name_Type,
- No_Element => No_File,
- Key => File_Name_Type,
- Hash => File_Hash,
- Equal => "=");
+ type File_Info_Cache is record
+ File : File_Name_Type;
+ Attr : aliased File_Attributes;
+ end record;
+ No_File_Info_Cache : constant File_Info_Cache :=
+ (No_File, Unknown_Attributes);
- package File_Stamp_Hash_Table is new GNAT.HTable.Simple_HTable (
+ package File_Name_Hash_Table is new GNAT.HTable.Simple_HTable (
Header_Num => File_Hash_Num,
- Element => Time_Stamp_Type,
- No_Element => Empty_Time_Stamp,
+ Element => File_Info_Cache,
+ No_Element => No_File_Info_Cache,
Key => File_Name_Type,
Hash => File_Hash,
Equal => "=");
@@ -559,9 +582,25 @@ package body Osint is
Fail ("missing library directory name");
end if;
- Lib_Search_Directories.Increment_Last;
- Lib_Search_Directories.Table (Lib_Search_Directories.Last) :=
- Normalize_Directory_Name (Dir);
+ declare
+ Norm : String_Ptr := Normalize_Directory_Name (Dir);
+ begin
+
+ -- Do nothing if the directory is already in the list. This saves
+ -- system calls and avoid unneeded work
+
+ for D in Lib_Search_Directories.First ..
+ Lib_Search_Directories.Last
+ loop
+ if Lib_Search_Directories.Table (D).all = Norm.all then
+ Free (Norm);
+ return;
+ end if;
+ end loop;
+
+ Lib_Search_Directories.Increment_Last;
+ Lib_Search_Directories.Table (Lib_Search_Directories.Last) := Norm;
+ end;
end Add_Lib_Search_Dir;
---------------------
@@ -958,6 +997,33 @@ package body Osint is
return File_Hash_Num (Int (F) rem File_Hash_Num'Range_Length);
end File_Hash;
+ -----------------
+ -- File_Length --
+ -----------------
+
+ function File_Length
+ (Name : C_File_Name; Attr : access File_Attributes) return Long_Integer
+ is
+ function Internal
+ (F : Integer; N : C_File_Name; A : System.Address) return Long_Integer;
+ pragma Import (C, Internal, "__gnat_file_length_attr");
+ begin
+ return Internal (-1, Name, Attr.all'Address);
+ end File_Length;
+
+ ---------------------
+ -- File_Time_Stamp --
+ ---------------------
+
+ function File_Time_Stamp
+ (Name : C_File_Name; Attr : access File_Attributes) return OS_Time
+ is
+ function Internal (N : C_File_Name; A : System.Address) return OS_Time;
+ pragma Import (C, Internal, "__gnat_file_time_name_attr");
+ begin
+ return Internal (Name, Attr.all'Address);
+ end File_Time_Stamp;
+
----------------
-- File_Stamp --
----------------
@@ -970,12 +1036,13 @@ package body Osint is
Get_Name_String (Name);
- if not Is_Regular_File (Name_Buffer (1 .. Name_Len)) then
- return Empty_Time_Stamp;
- else
- Name_Buffer (Name_Len + 1) := ASCII.NUL;
- return OS_Time_To_GNAT_Time (File_Time_Stamp (Name_Buffer));
- end if;
+ -- File_Time_Stamp will always return Invalid_Time if the file does not
+ -- exist, and OS_Time_To_GNAT_Time will convert this value to
+ -- Empty_Time_Stamp. Therefore we do not need to first test whether the
+ -- file actually exists, which saves a system call.
+
+ return OS_Time_To_GNAT_Time
+ (File_Time_Stamp (Name_Buffer (1 .. Name_Len)));
end File_Stamp;
function File_Stamp (Name : Path_Name_Type) return Time_Stamp_Type is
@@ -991,6 +1058,22 @@ package body Osint is
(N : File_Name_Type;
T : File_Type) return File_Name_Type
is
+ Attr : aliased File_Attributes;
+ Found : File_Name_Type;
+ begin
+ Find_File (N, T, Found, Attr'Access);
+ return Found;
+ end Find_File;
+
+ ---------------
+ -- Find_File --
+ ---------------
+
+ procedure Find_File
+ (N : File_Name_Type;
+ T : File_Type;
+ Found : out File_Name_Type;
+ Attr : access File_Attributes) is
begin
Get_Name_String (N);
@@ -1014,7 +1097,9 @@ package body Osint is
(Hostparm.OpenVMS and then
Name_Buffer (Name_Len - 2 .. Name_Len) = "_dg")))
then
- return N;
+ Found := N;
+ Attr.all := Unknown_Attributes;
+ return;
-- If we are trying to find the current main file just look in the
-- directory where the user said it was.
@@ -1022,7 +1107,8 @@ package body Osint is
elsif Look_In_Primary_Directory_For_Current_Main
and then Current_Main = N
then
- return Locate_File (N, T, Primary_Directory, File_Name);
+ Locate_File (N, T, Primary_Directory, File_Name, Found, Attr);
+ return;
-- Otherwise do standard search for source file
@@ -1040,21 +1126,23 @@ package body Osint is
-- return No_File, indicating the file is not a source.
if File = Error_File_Name then
- return No_File;
-
+ Found := No_File;
else
- return File;
+ Found := File;
end if;
+
+ Attr.all := Unknown_Attributes;
+ return;
end if;
-- First place to look is in the primary directory (i.e. the same
-- directory as the source) unless this has been disabled with -I-
if Opt.Look_In_Primary_Dir then
- File := Locate_File (N, T, Primary_Directory, File_Name);
+ Locate_File (N, T, Primary_Directory, File_Name, Found, Attr);
- if File /= No_File then
- return File;
+ if Found /= No_File then
+ return;
end if;
end if;
@@ -1067,14 +1155,15 @@ package body Osint is
end if;
for D in Primary_Directory + 1 .. Last_Dir loop
- File := Locate_File (N, T, D, File_Name);
+ Locate_File (N, T, D, File_Name, Found, Attr);
- if File /= No_File then
- return File;
+ if Found /= No_File then
+ return;
end if;
end loop;
- return No_File;
+ Attr.all := Unknown_Attributes;
+ Found := No_File;
end if;
end;
end Find_File;
@@ -1146,9 +1235,28 @@ package body Osint is
-- Full_Lib_File_Name --
------------------------
+ procedure Full_Lib_File_Name
+ (N : File_Name_Type;
+ Lib_File : out File_Name_Type;
+ Attr : out File_Attributes)
+ is
+ A : aliased File_Attributes;
+ begin
+ -- ??? seems we could use Smart_Find_File here
+ Find_File (N, Library, Lib_File, A'Access);
+ Attr := A;
+ end Full_Lib_File_Name;
+
+ ------------------------
+ -- Full_Lib_File_Name --
+ ------------------------
+
function Full_Lib_File_Name (N : File_Name_Type) return File_Name_Type is
+ Attr : File_Attributes;
+ File : File_Name_Type;
begin
- return Find_File (N, Library);
+ Full_Lib_File_Name (N, File, Attr);
+ return File;
end Full_Lib_File_Name;
----------------------------
@@ -1187,6 +1295,18 @@ package body Osint is
return Smart_Find_File (N, Source);
end Full_Source_Name;
+ ----------------------
+ -- Full_Source_Name --
+ ----------------------
+
+ procedure Full_Source_Name
+ (N : File_Name_Type;
+ Full_File : out File_Name_Type;
+ Attr : access File_Attributes) is
+ begin
+ Smart_Find_File (N, Source, Full_File, Attr.all);
+ end Full_Source_Name;
+
-------------------
-- Get_Directory --
-------------------
@@ -1468,6 +1588,19 @@ package body Osint is
Lib_Search_Directories.Table (Primary_Directory) := new String'("");
end Initialize;
+ ------------------
+ -- Is_Directory --
+ ------------------
+
+ function Is_Directory
+ (Name : C_File_Name; Attr : access File_Attributes) return Boolean
+ is
+ function Internal (N : C_File_Name; A : System.Address) return Integer;
+ pragma Import (C, Internal, "__gnat_is_directory_attr");
+ begin
+ return Internal (Name, Attr.all'Address) /= 0;
+ end Is_Directory;
+
----------------------------
-- Is_Directory_Separator --
----------------------------
@@ -1499,6 +1632,71 @@ package body Osint is
return not Is_Writable_File (Name_Buffer (1 .. Name_Len));
end Is_Readonly_Library;
+ ------------------------
+ -- Is_Executable_File --
+ ------------------------
+
+ function Is_Executable_File
+ (Name : C_File_Name; Attr : access File_Attributes) return Boolean
+ is
+ function Internal (N : C_File_Name; A : System.Address) return Integer;
+ pragma Import (C, Internal, "__gnat_is_executable_file_attr");
+ begin
+ return Internal (Name, Attr.all'Address) /= 0;
+ end Is_Executable_File;
+
+ ----------------------
+ -- Is_Readable_File --
+ ----------------------
+
+ function Is_Readable_File
+ (Name : C_File_Name; Attr : access File_Attributes) return Boolean
+ is
+ function Internal (N : C_File_Name; A : System.Address) return Integer;
+ pragma Import (C, Internal, "__gnat_is_readable_file_attr");
+ begin
+ return Internal (Name, Attr.all'Address) /= 0;
+ end Is_Readable_File;
+
+ ---------------------
+ -- Is_Regular_File --
+ ---------------------
+
+ function Is_Regular_File
+ (Name : C_File_Name; Attr : access File_Attributes) return Boolean
+ is
+ function Internal (N : C_File_Name; A : System.Address) return Integer;
+ pragma Import (C, Internal, "__gnat_is_regular_file_attr");
+ begin
+ return Internal (Name, Attr.all'Address) /= 0;
+ end Is_Regular_File;
+
+ ----------------------
+ -- Is_Symbolic_Link --
+ ----------------------
+
+ function Is_Symbolic_Link
+ (Name : C_File_Name; Attr : access File_Attributes) return Boolean
+ is
+ function Internal (N : C_File_Name; A : System.Address) return Integer;
+ pragma Import (C, Internal, "__gnat_is_symbolic_link_attr");
+ begin
+ return Internal (Name, Attr.all'Address) /= 0;
+ end Is_Symbolic_Link;
+
+ ----------------------
+ -- Is_Writable_File --
+ ----------------------
+
+ function Is_Writable_File
+ (Name : C_File_Name; Attr : access File_Attributes) return Boolean
+ is
+ function Internal (N : C_File_Name; A : System.Address) return Integer;
+ pragma Import (C, Internal, "__gnat_is_writable_file_attr");
+ begin
+ return Internal (Name, Attr.all'Address) /= 0;
+ end Is_Writable_File;
+
-------------------
-- Lib_File_Name --
-------------------
@@ -1527,24 +1725,17 @@ package body Osint is
return Name_Find;
end Lib_File_Name;
- ------------------------
- -- Library_File_Stamp --
- ------------------------
-
- function Library_File_Stamp (N : File_Name_Type) return Time_Stamp_Type is
- begin
- return File_Stamp (Find_File (N, Library));
- end Library_File_Stamp;
-
-----------------
-- Locate_File --
-----------------
- function Locate_File
- (N : File_Name_Type;
- T : File_Type;
- Dir : Natural;
- Name : String) return File_Name_Type
+ procedure Locate_File
+ (N : File_Name_Type;
+ T : File_Type;
+ Dir : Natural;
+ Name : String;
+ Found : out File_Name_Type;
+ Attr : access File_Attributes)
is
Dir_Name : String_Ptr;
@@ -1557,29 +1748,34 @@ package body Osint is
elsif T = Library then
Dir_Name := Lib_Search_Directories.Table (Dir);
- else pragma Assert (T /= Config);
+ else
+ pragma Assert (T /= Config);
Dir_Name := Src_Search_Directories.Table (Dir);
end if;
declare
- Full_Name : String (1 .. Dir_Name'Length + Name'Length);
+ Full_Name : String (1 .. Dir_Name'Length + Name'Length + 1);
begin
Full_Name (1 .. Dir_Name'Length) := Dir_Name.all;
- Full_Name (Dir_Name'Length + 1 .. Full_Name'Length) := Name;
+ Full_Name (Dir_Name'Length + 1 .. Full_Name'Last - 1) := Name;
+ Full_Name (Full_Name'Last) := ASCII.NUL;
+
+ Attr.all := Unknown_Attributes;
- if not Is_Regular_File (Full_Name) then
- return No_File;
+ if not Is_Regular_File (Full_Name'Address, Attr) then
+ Found := No_File;
else
-- If the file is in the current directory then return N itself
if Dir_Name'Length = 0 then
- return N;
+ Found := N;
else
- Name_Len := Full_Name'Length;
- Name_Buffer (1 .. Name_Len) := Full_Name;
- return Name_Enter;
+ Name_Len := Full_Name'Length - 1;
+ Name_Buffer (1 .. Name_Len) :=
+ Full_Name (1 .. Full_Name'Last - 1);
+ Found := Name_Find; -- ??? Was Name_Enter, no obvious reason
end if;
end if;
end;
@@ -1599,11 +1795,13 @@ package body Osint is
declare
File_Name : constant String := Name_Buffer (1 .. Name_Len);
File : File_Name_Type := No_File;
+ Attr : aliased File_Attributes;
Last_Dir : Natural;
begin
if Opt.Look_In_Primary_Dir then
- File := Locate_File (N, Source, Primary_Directory, File_Name);
+ Locate_File
+ (N, Source, Primary_Directory, File_Name, File, Attr'Access);
if File /= No_File and then T = File_Stamp (N) then
return File;
@@ -1613,7 +1811,7 @@ package body Osint is
Last_Dir := Src_Search_Directories.Last;
for D in Primary_Directory + 1 .. Last_Dir loop
- File := Locate_File (N, Source, D, File_Name);
+ Locate_File (N, Source, D, File_Name, File, Attr'Access);
if File /= No_File and then T = File_Stamp (File) then
return File;
@@ -1887,6 +2085,10 @@ package body Osint is
S : Second_Type;
begin
+ if T = Invalid_Time then
+ return Empty_Time_Stamp;
+ end if;
+
GM_Split (T, Y, Mo, D, H, Mn, S);
Make_Time_Stamp
(Year => Nat (Y),
@@ -2115,10 +2317,33 @@ package body Osint is
(Lib_File : File_Name_Type;
Fatal_Err : Boolean := False) return Text_Buffer_Ptr
is
+ File : File_Name_Type;
+ Attr : aliased File_Attributes;
+ begin
+ Find_File (Lib_File, Library, File, Attr'Access);
+ return Read_Library_Info_From_Full
+ (Full_Lib_File => File,
+ Lib_File_Attr => Attr'Access,
+ Fatal_Err => Fatal_Err);
+ end Read_Library_Info;
+
+ ---------------------------------
+ -- Read_Library_Info_From_Full --
+ ---------------------------------
+
+ function Read_Library_Info_From_Full
+ (Full_Lib_File : File_Name_Type;
+ Lib_File_Attr : access File_Attributes;
+ Fatal_Err : Boolean := False) return Text_Buffer_Ptr
+ is
Lib_FD : File_Descriptor;
-- The file descriptor for the current library file. A negative value
-- indicates failure to open the specified source file.
+ Len : Integer;
+ -- Length of source file text (ALI). If it doesn't fit in an integer
+ -- we're probably stuck anyway (>2 gigs of source seems a lot!)
+
Text : Text_Buffer_Ptr;
-- Allocated text buffer
@@ -2127,7 +2352,7 @@ package body Osint is
-- For the calls to Close
begin
- Current_Full_Lib_Name := Find_File (Lib_File, Library);
+ Current_Full_Lib_Name := Full_Lib_File;
Current_Full_Obj_Name := Object_File_Name (Current_Full_Lib_Name);
if Current_Full_Lib_Name = No_File then
@@ -2158,17 +2383,32 @@ package body Osint is
end if;
end if;
+ -- Compute the length of the file (potentially also preparing other data
+ -- like the timestamp and whether the file is read-only, for future use)
+
+ Len := Integer (File_Length (Name_Buffer'Address, Lib_File_Attr));
+
-- Check for object file consistency if requested
if Opt.Check_Object_Consistency then
- Current_Full_Lib_Stamp := File_Stamp (Current_Full_Lib_Name);
+ -- On most systems, this does not result in an extra system call
+ Current_Full_Lib_Stamp := OS_Time_To_GNAT_Time
+ (File_Time_Stamp (Name_Buffer'Address, Lib_File_Attr));
+
+ -- ??? One system call here
Current_Full_Obj_Stamp := File_Stamp (Current_Full_Obj_Name);
if Current_Full_Obj_Stamp (1) = ' ' then
-- When the library is readonly always assume object is consistent
+ -- The call to Is_Writable_File only results in a system call on
+ -- some systems, but in most cases it has already been computed as
+ -- part of the call to File_Length above.
+
+ Get_Name_String (Current_Full_Lib_Name);
+ Name_Buffer (Name_Len + 1) := ASCII.NUL;
- if Is_Readonly_Library (Current_Full_Lib_Name) then
+ if not Is_Writable_File (Name_Buffer'Address, Lib_File_Attr) then
Current_Full_Obj_Stamp := Current_Full_Lib_Stamp;
elsif Fatal_Err then
@@ -2193,10 +2433,6 @@ package body Osint is
-- Read data from the file
declare
- Len : constant Integer := Integer (File_Length (Lib_FD));
- -- Length of source file text. If it doesn't fit in an integer
- -- we're probably stuck anyway (>2 gigs of source seems a lot!)
-
Actual_Len : Integer := 0;
Lo : constant Text_Ptr := 0;
@@ -2233,7 +2469,7 @@ package body Osint is
return Text;
- end Read_Library_Info;
+ end Read_Library_Info_From_Full;
----------------------
-- Read_Source_File --
@@ -2472,21 +2708,23 @@ package body Osint is
(N : File_Name_Type;
T : File_Type) return Time_Stamp_Type
is
- Time_Stamp : Time_Stamp_Type;
-
+ File : File_Name_Type;
+ Attr : aliased File_Attributes;
begin
if not File_Cache_Enabled then
- return File_Stamp (Find_File (N, T));
+ Find_File (N, T, File, Attr'Access);
+ else
+ Smart_Find_File (N, T, File, Attr);
end if;
- Time_Stamp := File_Stamp_Hash_Table.Get (N);
-
- if Time_Stamp (1) = ' ' then
- Time_Stamp := File_Stamp (Smart_Find_File (N, T));
- File_Stamp_Hash_Table.Set (N, Time_Stamp);
+ if File = No_File then
+ return Empty_Time_Stamp;
+ else
+ Get_Name_String (File);
+ Name_Buffer (Name_Len + 1) := ASCII.NUL;
+ return OS_Time_To_GNAT_Time
+ (File_Time_Stamp (Name_Buffer'Address, Attr'Access));
end if;
-
- return Time_Stamp;
end Smart_File_Stamp;
---------------------
@@ -2497,21 +2735,38 @@ package body Osint is
(N : File_Name_Type;
T : File_Type) return File_Name_Type
is
- Full_File_Name : File_Name_Type;
-
+ File : File_Name_Type;
+ Attr : File_Attributes;
begin
- if not File_Cache_Enabled then
- return Find_File (N, T);
- end if;
+ Smart_Find_File (N, T, File, Attr);
+ return File;
+ end Smart_Find_File;
- Full_File_Name := File_Name_Hash_Table.Get (N);
+ ---------------------
+ -- Smart_Find_File --
+ ---------------------
+
+ procedure Smart_Find_File
+ (N : File_Name_Type;
+ T : File_Type;
+ Found : out File_Name_Type;
+ Attr : out File_Attributes)
+ is
+ Info : File_Info_Cache;
- if Full_File_Name = No_File then
- Full_File_Name := Find_File (N, T);
- File_Name_Hash_Table.Set (N, Full_File_Name);
+ begin
+ if not File_Cache_Enabled then
+ Find_File (N, T, Info.File, Info.Attr'Access);
+ else
+ Info := File_Name_Hash_Table.Get (N);
+ if Info.File = No_File then
+ Find_File (N, T, Info.File, Info.Attr'Access);
+ File_Name_Hash_Table.Set (N, Info);
+ end if;
end if;
- return Full_File_Name;
+ Found := Info.File;
+ Attr := Info.Attr;
end Smart_Find_File;
----------------------
@@ -2941,6 +3196,9 @@ package body Osint is
-- Package Initialization --
----------------------------
+ procedure Reset_File_Attributes (Attr : System.Address);
+ pragma Import (C, Reset_File_Attributes, "__gnat_reset_attributes");
+
begin
Initialization : declare
@@ -2956,7 +3214,15 @@ begin
"__gnat_get_maximum_file_name_length");
-- Function to get maximum file name length for system
+ Sizeof_File_Attributes : Integer;
+ pragma Import (C, Sizeof_File_Attributes,
+ "__gnat_size_of_file_attributes");
+
begin
+ pragma Assert (Sizeof_File_Attributes <= File_Attributes_Size);
+
+ Reset_File_Attributes (Unknown_Attributes'Address);
+
Identifier_Character_Set := Get_Default_Identifier_Character_Set;
Maximum_File_Name_Length := Get_Maximum_File_Name_Length;
diff --git a/gcc/ada/osint.ads b/gcc/ada/osint.ads
index a44d4e24b3c..34b3f642fee 100644
--- a/gcc/ada/osint.ads
+++ b/gcc/ada/osint.ads
@@ -29,6 +29,7 @@
with Namet; use Namet;
with Types; use Types;
+with System.Storage_Elements;
with System.OS_Lib; use System.OS_Lib;
with System; use System;
@@ -230,6 +231,47 @@ package Osint is
-- this routine called with Name set to "gnat" will return "-lgnat-5.02"
-- on UNIX and Windows and -lgnat_5_02 on VMS.
+ ---------------------
+ -- File attributes --
+ ---------------------
+ -- The following subprograms offer services similar to those found in
+ -- System.OS_Lib, but with the ability to extra multiple information from
+ -- a single system call, depending on the system. This can result in fewer
+ -- system calls when reused.
+ -- In all these subprograms, the requested value is either read from the
+ -- File_Attributes parameter (resulting in no system call), or computed
+ -- from the disk and then cached in the File_Attributes parameter (possibly
+ -- along with other values).
+
+ type File_Attributes is private;
+ Unknown_Attributes : constant File_Attributes;
+ -- A cache for various attributes for a file (length, accessibility,...)
+ -- This must be initialized to Unknown_Attributes prior to the first call.
+
+ function Is_Directory
+ (Name : C_File_Name; Attr : access File_Attributes) return Boolean;
+ function Is_Regular_File
+ (Name : C_File_Name; Attr : access File_Attributes) return Boolean;
+ function Is_Symbolic_Link
+ (Name : C_File_Name; Attr : access File_Attributes) return Boolean;
+ -- Return the type of the file,
+
+ function File_Length
+ (Name : C_File_Name; Attr : access File_Attributes) return Long_Integer;
+ -- Return the length (number of bytes) of the file
+
+ function File_Time_Stamp
+ (Name : C_File_Name; Attr : access File_Attributes) return OS_Time;
+ -- Return the time stamp of the file
+
+ function Is_Readable_File
+ (Name : C_File_Name; Attr : access File_Attributes) return Boolean;
+ function Is_Executable_File
+ (Name : C_File_Name; Attr : access File_Attributes) return Boolean;
+ function Is_Writable_File
+ (Name : C_File_Name; Attr : access File_Attributes) return Boolean;
+ -- Return the access rights for the file
+
-------------------------
-- Search Dir Routines --
-------------------------
@@ -380,6 +422,10 @@ package Osint is
-- using Read_Source_File. Calling this routine entails no source file
-- directory lookup penalty.
+ procedure Full_Source_Name
+ (N : File_Name_Type;
+ Full_File : out File_Name_Type;
+ Attr : access File_Attributes);
function Full_Source_Name (N : File_Name_Type) return File_Name_Type;
function Source_File_Stamp (N : File_Name_Type) return Time_Stamp_Type;
-- Returns the full name/time stamp of the source file whose simple name
@@ -390,6 +436,8 @@ package Osint is
-- The source file directory lookup penalty is incurred every single time
-- the routines are called unless you have previously called
-- Source_File_Data (Cache => True). See below.
+ -- The procedural version also returns some file attributes for the ALI
+ -- file (to save on system calls later on).
function Current_File_Index return Int;
-- Return the index in its source file of the current main unit
@@ -486,6 +534,17 @@ package Osint is
-- behaves as if it did not find Lib_File (namely if Fatal_Err is
-- False, null is returned).
+ function Read_Library_Info_From_Full
+ (Full_Lib_File : File_Name_Type;
+ Lib_File_Attr : access File_Attributes;
+ Fatal_Err : Boolean := False) return Text_Buffer_Ptr;
+ -- Same as Read_Library_Info, except Full_Lib_File must contains the full
+ -- path to the library file (instead of having Read_Library_Info recompute
+ -- it).
+ -- Lib_File_Attr should be an initialized set of attributes for the
+ -- library file (it can be initialized to Unknown_Attributes, but in
+ -- general will have been initialized by a previous call to Find_File).
+
function Full_Library_Info_Name return File_Name_Type;
function Full_Object_File_Name return File_Name_Type;
-- Returns the full name of the library/object file most recently read
@@ -501,14 +560,19 @@ package Osint is
-- It is an error to call Current_Object_File_Stamp if
-- Opt.Check_Object_Consistency is set to False.
+ procedure Full_Lib_File_Name
+ (N : File_Name_Type;
+ Lib_File : out File_Name_Type;
+ Attr : out File_Attributes);
function Full_Lib_File_Name (N : File_Name_Type) return File_Name_Type;
- function Library_File_Stamp (N : File_Name_Type) return Time_Stamp_Type;
- -- Returns the full name/time stamp of library file N. N should not include
+ -- Returns the full name of library file N. N should not include
-- path information. Note that if the file cannot be located No_File is
-- returned for the first routine and an all blank time stamp is returned
-- for the second (this is not an error situation). The full name includes
-- the appropriate directory information. The library file directory lookup
-- penalty is incurred every single time this routine is called.
+ -- The procedural version also returns some file attributes for the ALI
+ -- file (to save on system calls later on).
function Lib_File_Name
(Source_File : File_Name_Type;
@@ -654,4 +718,19 @@ private
-- detected, the file being written is deleted, and a fatal error is
-- signalled.
+ File_Attributes_Size : constant Integer := 50;
+ -- This should be big enough to fit a "struct file_attributes" on any
+ -- system. It doesn't matter if it is too big (which avoids the need for
+ -- either mapping the struct exactly or importing the sizeof from C, which
+ -- would result in dynamic code)
+
+ type File_Attributes is
+ array (1 .. File_Attributes_Size)
+ of System.Storage_Elements.Storage_Element;
+ for File_Attributes'Alignment use Standard'Maximum_Alignment;
+
+ Unknown_Attributes : constant File_Attributes := (others => 0);
+ -- Will be initialized properly at elaboration (for efficiency later on,
+ -- avoid function calls every time we want to reset the attributes).
+
end Osint;
diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb
index f07f54e5098..2bb9d25fcc1 100644
--- a/gcc/ada/par-ch4.adb
+++ b/gcc/ada/par-ch4.adb
@@ -89,9 +89,6 @@ package body Ch4 is
-- prefix. The current token is known to be an apostrophe and the
-- following token is known to be RANGE.
- procedure Set_Op_Name (Node : Node_Id);
- -- Procedure to set name field (Chars) in operator node
-
-------------------------
-- Bad_Range_Attribute --
-------------------------
@@ -102,51 +99,6 @@ package body Ch4 is
Resync_Expression;
end Bad_Range_Attribute;
- ------------------
- -- Set_Op_Name --
- ------------------
-
- procedure Set_Op_Name (Node : Node_Id) is
- type Name_Of_Type is array (N_Op) of Name_Id;
- Name_Of : constant Name_Of_Type := Name_Of_Type'(
- N_Op_And => Name_Op_And,
- N_Op_Or => Name_Op_Or,
- N_Op_Xor => Name_Op_Xor,
- N_Op_Eq => Name_Op_Eq,
- N_Op_Ne => Name_Op_Ne,
- N_Op_Lt => Name_Op_Lt,
- N_Op_Le => Name_Op_Le,
- N_Op_Gt => Name_Op_Gt,
- N_Op_Ge => Name_Op_Ge,
- N_Op_Add => Name_Op_Add,
- N_Op_Subtract => Name_Op_Subtract,
- N_Op_Concat => Name_Op_Concat,
- N_Op_Multiply => Name_Op_Multiply,
- N_Op_Divide => Name_Op_Divide,
- N_Op_Mod => Name_Op_Mod,
- N_Op_Rem => Name_Op_Rem,
- N_Op_Expon => Name_Op_Expon,
- N_Op_Plus => Name_Op_Add,
- N_Op_Minus => Name_Op_Subtract,
- N_Op_Abs => Name_Op_Abs,
- N_Op_Not => Name_Op_Not,
-
- -- We don't really need these shift operators, since they never
- -- appear as operators in the source, but the path of least
- -- resistance is to put them in (the aggregate must be complete)
-
- N_Op_Rotate_Left => Name_Rotate_Left,
- N_Op_Rotate_Right => Name_Rotate_Right,
- N_Op_Shift_Left => Name_Shift_Left,
- N_Op_Shift_Right => Name_Shift_Right,
- N_Op_Shift_Right_Arithmetic => Name_Shift_Right_Arithmetic);
-
- begin
- if Nkind (Node) in N_Op then
- Set_Chars (Node, Name_Of (Nkind (Node)));
- end if;
- end Set_Op_Name;
-
--------------------------
-- 4.1 Name (also 6.4) --
--------------------------
@@ -1600,10 +1552,9 @@ package body Ch4 is
end if;
Node2 := Node1;
- Node1 := New_Node (Logical_Op, Op_Location);
+ Node1 := New_Op_Node (Logical_Op, Op_Location);
Set_Left_Opnd (Node1, Node2);
Set_Right_Opnd (Node1, P_Relation);
- Set_Op_Name (Node1);
exit when Token not in Token_Class_Logop;
end loop;
@@ -1704,10 +1655,9 @@ package body Ch4 is
end if;
Node2 := Node1;
- Node1 := New_Node (Logical_Op, Op_Location);
+ Node1 := New_Op_Node (Logical_Op, Op_Location);
Set_Left_Opnd (Node1, Node2);
Set_Right_Opnd (Node1, P_Relation);
- Set_Op_Name (Node1);
exit when Token not in Token_Class_Logop;
end loop;
@@ -1768,9 +1718,8 @@ package body Ch4 is
-- P_Relational_Operator also parses the IN and NOT IN operations.
Optok := Token_Ptr;
- Node2 := New_Node (P_Relational_Operator, Optok);
+ Node2 := New_Op_Node (P_Relational_Operator, Optok);
Set_Left_Opnd (Node2, Node1);
- Set_Op_Name (Node2);
-- Case of IN or NOT IN
@@ -1881,18 +1830,17 @@ package body Ch4 is
Style.Check_Exponentiation_Operator;
end if;
- Node2 := New_Node (N_Op_Expon, Token_Ptr);
+ Node2 := New_Op_Node (N_Op_Expon, Token_Ptr);
Scan; -- past **
Set_Left_Opnd (Node2, Node1);
Set_Right_Opnd (Node2, P_Primary);
- Set_Op_Name (Node2);
Node1 := Node2;
end if;
loop
exit when Token not in Token_Class_Mulop;
Tokptr := Token_Ptr;
- Node2 := New_Node (P_Multiplying_Operator, Tokptr);
+ Node2 := New_Op_Node (P_Multiplying_Operator, Tokptr);
if Style_Check then
Style.Check_Binary_Operator;
@@ -1901,14 +1849,13 @@ package body Ch4 is
Scan; -- past operator
Set_Left_Opnd (Node2, Node1);
Set_Right_Opnd (Node2, P_Factor);
- Set_Op_Name (Node2);
Node1 := Node2;
end loop;
loop
exit when Token not in Token_Class_Binary_Addop;
Tokptr := Token_Ptr;
- Node2 := New_Node (P_Binary_Adding_Operator, Tokptr);
+ Node2 := New_Op_Node (P_Binary_Adding_Operator, Tokptr);
if Style_Check then
Style.Check_Binary_Operator;
@@ -1917,7 +1864,6 @@ package body Ch4 is
Scan; -- past operator
Set_Left_Opnd (Node2, Node1);
Set_Right_Opnd (Node2, P_Term);
- Set_Op_Name (Node2);
Node1 := Node2;
end loop;
@@ -1931,7 +1877,7 @@ package body Ch4 is
if Token in Token_Class_Unary_Addop then
Tokptr := Token_Ptr;
- Node1 := New_Node (P_Unary_Adding_Operator, Tokptr);
+ Node1 := New_Op_Node (P_Unary_Adding_Operator, Tokptr);
if Style_Check then
Style.Check_Unary_Plus_Or_Minus;
@@ -1939,7 +1885,6 @@ package body Ch4 is
Scan; -- past operator
Set_Right_Opnd (Node1, P_Term);
- Set_Op_Name (Node1);
else
Node1 := P_Term;
end if;
@@ -1981,12 +1926,11 @@ package body Ch4 is
loop
exit when Token not in Token_Class_Binary_Addop;
Tokptr := Token_Ptr;
- Node2 := New_Node (P_Binary_Adding_Operator, Tokptr);
+ Node2 := New_Op_Node (P_Binary_Adding_Operator, Tokptr);
Scan; -- past operator
Set_Left_Opnd (Node2, Node1);
Node1 := P_Term;
Set_Right_Opnd (Node2, Node1);
- Set_Op_Name (Node2);
-- Check if we're still concatenating string literals
@@ -2214,11 +2158,10 @@ package body Ch4 is
loop
exit when Token not in Token_Class_Mulop;
Tokptr := Token_Ptr;
- Node2 := New_Node (P_Multiplying_Operator, Tokptr);
+ Node2 := New_Op_Node (P_Multiplying_Operator, Tokptr);
Scan; -- past operator
Set_Left_Opnd (Node2, Node1);
Set_Right_Opnd (Node2, P_Factor);
- Set_Op_Name (Node2);
Node1 := Node2;
end loop;
@@ -2239,7 +2182,7 @@ package body Ch4 is
begin
if Token = Tok_Abs then
- Node1 := New_Node (N_Op_Abs, Token_Ptr);
+ Node1 := New_Op_Node (N_Op_Abs, Token_Ptr);
if Style_Check then
Style.Check_Abs_Not;
@@ -2247,11 +2190,10 @@ package body Ch4 is
Scan; -- past ABS
Set_Right_Opnd (Node1, P_Primary);
- Set_Op_Name (Node1);
return Node1;
elsif Token = Tok_Not then
- Node1 := New_Node (N_Op_Not, Token_Ptr);
+ Node1 := New_Op_Node (N_Op_Not, Token_Ptr);
if Style_Check then
Style.Check_Abs_Not;
@@ -2259,18 +2201,16 @@ package body Ch4 is
Scan; -- past NOT
Set_Right_Opnd (Node1, P_Primary);
- Set_Op_Name (Node1);
return Node1;
else
Node1 := P_Primary;
if Token = Tok_Double_Asterisk then
- Node2 := New_Node (N_Op_Expon, Token_Ptr);
+ Node2 := New_Op_Node (N_Op_Expon, Token_Ptr);
Scan; -- past **
Set_Left_Opnd (Node2, Node1);
Set_Right_Opnd (Node2, P_Primary);
- Set_Op_Name (Node2);
return Node2;
else
return Node1;
diff --git a/gcc/ada/prj-err.adb b/gcc/ada/prj-err.adb
index 8e0d5627a67..3728c9e44b0 100644
--- a/gcc/ada/prj-err.adb
+++ b/gcc/ada/prj-err.adb
@@ -23,8 +23,9 @@
-- --
------------------------------------------------------------------------------
-with Output; use Output;
-with Stringt; use Stringt;
+with Err_Vars;
+with Output; use Output;
+with Stringt; use Stringt;
package body Prj.Err is
@@ -117,7 +118,13 @@ package body Prj.Err is
if Flags.Report_Error /= null then
Flags.Report_Error
(Project,
- Is_Warning => Msg (Msg'First) = '?' or else Msg (Msg'First) = '<');
+ Is_Warning =>
+ Msg (Msg'First) = '?'
+ or else (Msg (Msg'First) = '<'
+ and then Err_Vars.Error_Msg_Warn)
+ or else (Msg (Msg'First) = '\'
+ and then Msg (Msg'First + 1) = '<'
+ and then Err_Vars.Error_Msg_Warn));
end if;
end Error_Msg;
diff --git a/gcc/ada/prj-ext.adb b/gcc/ada/prj-ext.adb
index 9c9707c1cfa..8c7a5d95d96 100644
--- a/gcc/ada/prj-ext.adb
+++ b/gcc/ada/prj-ext.adb
@@ -26,6 +26,7 @@
with System.OS_Lib; use System.OS_Lib;
with Hostparm;
with Makeutl; use Makeutl;
+with Opt;
with Osint; use Osint;
with Prj.Tree; use Prj.Tree;
with Sdefault;
@@ -212,7 +213,9 @@ package body Prj.Ext is
declare
New_Dir : constant String :=
- Normalize_Pathname (Name_Buffer (First .. Last));
+ Normalize_Pathname
+ (Name_Buffer (First .. Last),
+ Resolve_Links => Opt.Follow_Links_For_Dirs);
begin
-- If the absolute path was resolved and is different from
diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb
index cec5e6b0a59..5e76bce58ac 100644
--- a/gcc/ada/prj-nmsc.adb
+++ b/gcc/ada/prj-nmsc.adb
@@ -4707,121 +4707,82 @@ package body Prj.Nmsc is
Removed : Boolean := False)
is
Directory : constant String := Get_Name_String (From);
- Element : String_Element;
+
+ procedure Add_To_Or_Remove_From_List
+ (Path_Id : Name_Id;
+ Display_Path_Id : Name_Id);
+ -- When Removed = False, the directory Path_Id to the list of
+ -- source_dirs if not already in the list. When Removed = True,
+ -- removed directory Path_Id if in the list.
procedure Recursive_Find_Dirs (Path : Name_Id);
-- Find all the subdirectories (recursively) of Path and add them
-- to the list of source directories of the project.
- -------------------------
- -- Recursive_Find_Dirs --
- -------------------------
-
- procedure Recursive_Find_Dirs (Path : Name_Id) is
- Dir : Dir_Type;
- Name : String (1 .. 250);
- Last : Natural;
- List : String_List_Id;
- Prev : String_List_Id;
- Rank_List : Number_List_Index;
- Prev_Rank : Number_List_Index;
- Element : String_Element;
- Found : Boolean := False;
-
- Non_Canonical_Path : Name_Id := No_Name;
- Canonical_Path : Name_Id := No_Name;
-
- The_Path : constant String :=
- Normalize_Pathname
- (Get_Name_String (Path),
- Directory =>
- Get_Name_String (Project.Directory.Display_Name),
- Resolve_Links => Opt.Follow_Links_For_Dirs) &
- Directory_Separator;
-
- The_Path_Last : constant Natural :=
- Compute_Directory_Last (The_Path);
+ --------------------------------
+ -- Add_To_Or_Remove_From_List --
+ --------------------------------
+
+ procedure Add_To_Or_Remove_From_List
+ (Path_Id : Name_Id;
+ Display_Path_Id : Name_Id)
+ is
+ List : String_List_Id;
+ Prev : String_List_Id;
+ Rank_List : Number_List_Index;
+ Prev_Rank : Number_List_Index;
+ Element : String_Element;
begin
- Name_Len := The_Path_Last - The_Path'First + 1;
- Name_Buffer (1 .. Name_Len) :=
- The_Path (The_Path'First .. The_Path_Last);
- Non_Canonical_Path := Name_Find;
- Canonical_Path :=
- Name_Id (Canonical_Case_File_Name (Non_Canonical_Path));
-
- -- To avoid processing the same directory several times, check
- -- if the directory is already in Recursive_Dirs. If it is, then
- -- there is nothing to do, just return. If it is not, put it there
- -- and continue recursive processing.
-
- if not Removed then
- if Recursive_Dirs.Get (Visited, Canonical_Path) then
- return;
- else
- Recursive_Dirs.Set (Visited, Canonical_Path, True);
- end if;
- end if;
-
- -- Check if directory is already in list
-
- List := Project.Source_Dirs;
- Prev := Nil_String;
- Rank_List := Project.Source_Dir_Ranks;
+ Prev := Nil_String;
Prev_Rank := No_Number_List;
+ List := Project.Source_Dirs;
+ Rank_List := Project.Source_Dir_Ranks;
while List /= Nil_String loop
Element := Data.Tree.String_Elements.Table (List);
-
- if Element.Value /= No_Name then
- Found := Element.Value = Canonical_Path;
- exit when Found;
- end if;
-
+ exit when Element.Value = Path_Id;
Prev := List;
List := Element.Next;
Prev_Rank := Rank_List;
- Rank_List := Data.Tree.Number_Lists.Table (Rank_List).Next;
+ Rank_List := Data.Tree.Number_Lists.Table (Prev_Rank).Next;
end loop;
- -- If directory is not already in list, put it there
+ -- The directory is in the list if List is not Nil_String
- if (not Removed) and (not Found) then
+ if not Removed and then List = Nil_String then
if Current_Verbosity = High then
- Write_Str (" ");
- Write_Line (The_Path (The_Path'First .. The_Path_Last));
+ Write_Str (" Adding Source Dir=");
+ Write_Line (Get_Name_String (Path_Id));
end if;
String_Element_Table.Increment_Last (Data.Tree.String_Elements);
Element :=
- (Value => Canonical_Path,
- Display_Value => Non_Canonical_Path,
+ (Value => Path_Id,
+ Index => 0,
+ Display_Value => Display_Path_Id,
Location => No_Location,
Flag => False,
- Next => Nil_String,
- Index => 0);
+ Next => Nil_String);
Number_List_Table.Increment_Last (Data.Tree.Number_Lists);
- -- Case of first source directory
-
if Last_Source_Dir = Nil_String then
+
+ -- This is the first source directory
+
Project.Source_Dirs :=
String_Element_Table.Last (Data.Tree.String_Elements);
Project.Source_Dir_Ranks :=
Number_List_Table.Last (Data.Tree.Number_Lists);
- -- Here we already have source directories
-
else
- -- Link the previous last to the new one
+ -- We already have source directories, link the previous
+ -- last to the new one.
- Data.Tree.String_Elements.Table
- (Last_Source_Dir).Next :=
+ Data.Tree.String_Elements.Table (Last_Source_Dir).Next :=
String_Element_Table.Last (Data.Tree.String_Elements);
- Data.Tree.Number_Lists.Table
- (Last_Src_Dir_Rank).Next :=
+ Data.Tree.Number_Lists.Table (Last_Src_Dir_Rank).Next :=
Number_List_Table.Last (Data.Tree.Number_Lists);
-
end if;
-- And register this source directory as the new last
@@ -4834,12 +4795,16 @@ package body Prj.Nmsc is
Data.Tree.Number_Lists.Table (Last_Src_Dir_Rank) :=
(Number => Rank, Next => No_Number_List);
- elsif Removed and Found then
+ elsif Removed and then List /= Nil_String then
+
+ -- Remove source dir, if present
+
if Prev = Nil_String then
Project.Source_Dirs :=
Data.Tree.String_Elements.Table (List).Next;
Project.Source_Dir_Ranks :=
Data.Tree.Number_Lists.Table (Rank_List).Next;
+
else
Data.Tree.String_Elements.Table (Prev).Next :=
Data.Tree.String_Elements.Table (List).Next;
@@ -4847,10 +4812,59 @@ package body Prj.Nmsc is
Data.Tree.Number_Lists.Table (Rank_List).Next;
end if;
end if;
+ end Add_To_Or_Remove_From_List;
+
+ -------------------------
+ -- Recursive_Find_Dirs --
+ -------------------------
+
+ procedure Recursive_Find_Dirs (Path : Name_Id) is
+ Dir : Dir_Type;
+ Name : String (1 .. 250);
+ Last : Natural;
- -- Now look for subdirectories. We do that even when this
- -- directory is already in the list, because some of its
- -- subdirectories may not be in the list yet.
+ Non_Canonical_Path : Name_Id := No_Name;
+ Canonical_Path : Name_Id := No_Name;
+
+ The_Path : constant String :=
+ Normalize_Pathname
+ (Get_Name_String (Path),
+ Directory =>
+ Get_Name_String (Project.Directory.Display_Name),
+ Resolve_Links => Opt.Follow_Links_For_Dirs) &
+ Directory_Separator;
+
+ The_Path_Last : constant Natural :=
+ Compute_Directory_Last (The_Path);
+
+ begin
+ Name_Len := The_Path_Last - The_Path'First + 1;
+ Name_Buffer (1 .. Name_Len) :=
+ The_Path (The_Path'First .. The_Path_Last);
+ Non_Canonical_Path := Name_Find;
+ Canonical_Path :=
+ Name_Id (Canonical_Case_File_Name (Non_Canonical_Path));
+
+ -- To avoid processing the same directory several times, check
+ -- if the directory is already in Recursive_Dirs. If it is, then
+ -- there is nothing to do, just return. If it is not, put it there
+ -- and continue recursive processing.
+
+ if not Removed then
+ if Recursive_Dirs.Get (Visited, Canonical_Path) then
+ return;
+ else
+ Recursive_Dirs.Set (Visited, Canonical_Path, True);
+ end if;
+ end if;
+
+ Add_To_Or_Remove_From_List
+ (Path_Id => Canonical_Path,
+ Display_Path_Id => Non_Canonical_Path);
+
+ -- Now look for subdirectories. Do that even when this directory
+ -- is already in the list, because some of its subdirectories may
+ -- not be in the list yet.
Open (Dir, The_Path (The_Path'First .. The_Path_Last));
@@ -4870,12 +4884,14 @@ package body Prj.Nmsc is
declare
Path_Name : constant String :=
- Normalize_Pathname
- (Name => Name (1 .. Last),
- Directory =>
- The_Path (The_Path'First .. The_Path_Last),
- Resolve_Links => Opt.Follow_Links_For_Dirs,
- Case_Sensitive => True);
+ Normalize_Pathname
+ (Name => Name (1 .. Last),
+ Directory =>
+ The_Path
+ (The_Path'First .. The_Path_Last),
+ Resolve_Links =>
+ Opt.Follow_Links_For_Dirs,
+ Case_Sensitive => True);
begin
if Is_Directory (Path_Name) then
@@ -4945,7 +4961,8 @@ package body Prj.Nmsc is
Directory =>
Get_Name_String
(Project.Directory.Display_Name),
- Resolve_Links => False,
+ Resolve_Links =>
+ Opt.Follow_Links_For_Dirs,
Case_Sensitive => True);
begin
@@ -4987,10 +5004,6 @@ package body Prj.Nmsc is
else
declare
Path_Name : Path_Information;
- List : String_List_Id;
- Prev : String_List_Id;
- Rank_List : Number_List_Index;
- Prev_Rank : Number_List_Index;
Dir_Exists : Boolean;
begin
@@ -5019,8 +5032,16 @@ package body Prj.Nmsc is
else
declare
- Path : constant String :=
- Get_Name_String (Path_Name.Name);
+ Path : constant String :=
+ Normalize_Pathname
+ (Name =>
+ Get_Name_String (Path_Name.Name),
+ Directory =>
+ Get_Name_String (Project.Directory.Name),
+ Resolve_Links => Opt.Follow_Links_For_Dirs,
+ Case_Sensitive => True) &
+ Directory_Separator;
+
Last_Path : constant Natural :=
Compute_Directory_Last (Path);
Path_Id : Name_Id;
@@ -5036,113 +5057,16 @@ package body Prj.Nmsc is
Name_Len := 0;
Add_Str_To_Name_Buffer (Path (Path'First .. Last_Path));
Path_Id := Name_Find;
+
Name_Len := 0;
Add_Str_To_Name_Buffer
(Display_Path
(Display_Path'First .. Last_Display_Path));
Display_Path_Id := Name_Find;
- -- Check if the directory is already in the list
-
- Prev := Nil_String;
- Prev_Rank := No_Number_List;
-
- -- Look for source dir in current list
-
- List := Project.Source_Dirs;
- Rank_List := Project.Source_Dir_Ranks;
- while List /= Nil_String loop
- Element := Data.Tree.String_Elements.Table (List);
- exit when Element.Value = Path_Id;
- Prev := List;
- List := Element.Next;
- Prev_Rank := Rank_List;
- Rank_List :=
- Data.Tree.Number_Lists.Table (Prev_Rank).Next;
- end loop;
-
- -- The directory is in the list if List is not Nil_String
-
- if not Removed then
-
- -- As it is an existing directory, we add it to the
- -- list of directories, if not already in the list.
-
- if List = Nil_String then
- String_Element_Table.Increment_Last
- (Data.Tree.String_Elements);
- Element :=
- (Value => Path_Id,
- Index => 0,
- Display_Value => Display_Path_Id,
- Location => No_Location,
- Flag => False,
- Next => Nil_String);
- Number_List_Table.Increment_Last
- (Data.Tree.Number_Lists);
-
- if Last_Source_Dir = Nil_String then
-
- -- This is the first source directory
-
- Project.Source_Dirs :=
- String_Element_Table.Last
- (Data.Tree.String_Elements);
- Project.Source_Dir_Ranks :=
- Number_List_Table.Last
- (Data.Tree.Number_Lists);
-
- else
- -- We already have source directories, link the
- -- previous last to the new one.
-
- Data.Tree.String_Elements.Table
- (Last_Source_Dir).Next :=
- String_Element_Table.Last
- (Data.Tree.String_Elements);
- Data.Tree.Number_Lists.Table
- (Last_Src_Dir_Rank).Next :=
- Number_List_Table.Last
- (Data.Tree.Number_Lists);
-
- end if;
-
- -- And register this source directory as the new
- -- last.
-
- Last_Source_Dir :=
- String_Element_Table.Last
- (Data.Tree.String_Elements);
- Data.Tree.String_Elements.Table
- (Last_Source_Dir) := Element;
- Last_Src_Dir_Rank :=
- Number_List_Table.Last
- (Data.Tree.Number_Lists);
- Data.Tree.Number_Lists.Table
- (Last_Src_Dir_Rank) :=
- (Number => Rank, Next => No_Number_List);
- end if;
-
- else
- -- Remove source dir, if present
-
- if List /= Nil_String then
- -- Source dir was found, remove it from the list
-
- if Prev = Nil_String then
- Project.Source_Dirs :=
- Data.Tree.String_Elements.Table (List).Next;
- Project.Source_Dir_Ranks :=
- Data.Tree.Number_Lists.Table (Rank_List).Next;
-
- else
- Data.Tree.String_Elements.Table (Prev).Next :=
- Data.Tree.String_Elements.Table (List).Next;
- Data.Tree.Number_Lists.Table (Prev_Rank).Next :=
- Data.Tree.Number_Lists.Table (Rank_List).Next;
- end if;
- end if;
- end if;
+ Add_To_Or_Remove_From_List
+ (Path_Id => Path_Id,
+ Display_Path_Id => Display_Path_Id);
end;
end if;
end;
diff --git a/gcc/ada/prj-part.adb b/gcc/ada/prj-part.adb
index 1ed78ab227b..7702f540930 100644
--- a/gcc/ada/prj-part.adb
+++ b/gcc/ada/prj-part.adb
@@ -485,19 +485,27 @@ package body Prj.Part is
return;
end if;
- Parse_Single_Project
- (In_Tree => In_Tree,
- Project => Project,
- Extends_All => Dummy,
- Path_Name => Path_Name,
- Extended => False,
- From_Extended => None,
- In_Limited => False,
- Packages_To_Check => Packages_To_Check,
- Depth => 0,
- Current_Dir => Current_Directory,
- Is_Config_File => Is_Config_File,
- Flags => Flags);
+ begin
+ Parse_Single_Project
+ (In_Tree => In_Tree,
+ Project => Project,
+ Extends_All => Dummy,
+ Path_Name => Path_Name,
+ Extended => False,
+ From_Extended => None,
+ In_Limited => False,
+ Packages_To_Check => Packages_To_Check,
+ Depth => 0,
+ Current_Dir => Current_Directory,
+ Is_Config_File => Is_Config_File,
+ Flags => Flags);
+
+ exception
+ when Types.Unrecoverable_Error =>
+ -- Unrecoverable_Error is raised when a line is too long.
+ -- A meaningful error message will be displayed later.
+ Project := Empty_Node;
+ end;
-- If Project is an extending-all project, create the eventual
-- virtual extending projects and check that there are no illegally
diff --git a/gcc/ada/prj-tree.adb b/gcc/ada/prj-tree.adb
index 4823a988d6c..df6e5acb6cf 100644
--- a/gcc/ada/prj-tree.adb
+++ b/gcc/ada/prj-tree.adb
@@ -23,10 +23,11 @@
-- --
------------------------------------------------------------------------------
-with Ada.Unchecked_Deallocation;
with Osint; use Osint;
with Prj.Err;
+with Ada.Unchecked_Deallocation;
+
package body Prj.Tree is
Node_With_Comments : constant array (Project_Node_Kind) of Boolean :=
@@ -1000,6 +1001,8 @@ package body Prj.Tree is
if Proj /= null then
Project_Node_Table.Free (Proj.Project_Nodes);
Projects_Htable.Reset (Proj.Projects_HT);
+ Name_To_Name_HTable.Reset (Proj.External_References);
+ Free (Proj.Project_Path);
Unchecked_Free (Proj);
end if;
end Free;
diff --git a/gcc/ada/raise-gcc.c b/gcc/ada/raise-gcc.c
index 1d9efb93b7f..3589bc5dfd1 100644
--- a/gcc/ada/raise-gcc.c
+++ b/gcc/ada/raise-gcc.c
@@ -56,6 +56,14 @@ typedef char bool;
#include "adaint.h"
#include "raise.h"
+#ifdef __APPLE__
+/* On MacOS X, versions older than 10.5 don't export _Unwind_GetIPInfo. */
+#undef HAVE_GETIPINFO
+#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
+#define HAVE_GETIPINFO 1
+#endif
+#endif
+
/* The names of a couple of "standard" routines for unwinding/propagation
actually vary depending on the underlying GCC scheme for exception handling
(SJLJ or DWARF). We need a consistently named interface to import from
@@ -501,7 +509,14 @@ typedef struct
static void
db_region_for (region_descriptor *region, _Unwind_Context *uw_context)
{
- _Unwind_Ptr ip = _Unwind_GetIP (uw_context) - 1;
+ int ip_before_insn = 0;
+#ifdef HAVE_GETIPINFO
+ _Unwind_Ptr ip = _Unwind_GetIPInfo (uw_context, &ip_before_insn);
+#else
+ _Unwind_Ptr ip = _Unwind_GetIP (uw_context);
+#endif
+ if (!ip_before_insn)
+ ip--;
if (! (db_accepted_codes () & DB_REGIONS))
return;
@@ -631,7 +646,14 @@ typedef struct
static void
db_action_for (action_descriptor *action, _Unwind_Context *uw_context)
{
- _Unwind_Ptr ip = _Unwind_GetIP (uw_context) - 1;
+ int ip_before_insn = 0;
+#ifdef HAVE_GETIPINFO
+ _Unwind_Ptr ip = _Unwind_GetIPInfo (uw_context, &ip_before_insn);
+#else
+ _Unwind_Ptr ip = _Unwind_GetIP (uw_context);
+#endif
+ if (!ip_before_insn)
+ ip--;
db (DB_ACTIONS, "For ip @ 0x%08x => ", ip);
@@ -670,14 +692,6 @@ db_action_for (action_descriptor *action, _Unwind_Context *uw_context)
There are two variants of this routine, depending on the underlying
mechanism (DWARF/SJLJ), which account for differences in the tables. */
-#ifdef __APPLE__
-/* On MacOS X, versions older than 10.5 don't export _Unwind_GetIPInfo. */
-#undef HAVE_GETIPINFO
-#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
-#define HAVE_GETIPINFO 1
-#endif
-#endif
-
#ifdef __USING_SJLJ_EXCEPTIONS__
#define __builtin_eh_return_data_regno(x) x
diff --git a/gcc/ada/s-crtl.ads b/gcc/ada/s-crtl.ads
index 5a9902dd657..f013a418fcb 100644
--- a/gcc/ada/s-crtl.ads
+++ b/gcc/ada/s-crtl.ads
@@ -202,4 +202,7 @@ package System.CRTL is
function write (fd : int; buffer : chars; nbytes : int) return int;
pragma Import (C, write, "write");
+ function strerror (errno : int) return chars;
+ pragma Import (C, strerror, "strerror");
+
end System.CRTL;
diff --git a/gcc/ada/s-fileio.adb b/gcc/ada/s-fileio.adb
index df45003cd1a..f93fee25e33 100644
--- a/gcc/ada/s-fileio.adb
+++ b/gcc/ada/s-fileio.adb
@@ -31,7 +31,10 @@
with Ada.Finalization; use Ada.Finalization;
with Ada.IO_Exceptions; use Ada.IO_Exceptions;
+with Ada.Unchecked_Conversion;
+
with Interfaces.C;
+with Interfaces.C.Strings; use Interfaces.C.Strings;
with Interfaces.C_Streams; use Interfaces.C_Streams;
with System.CRTL;
@@ -48,7 +51,7 @@ package body System.File_IO is
package SSL renames System.Soft_Links;
use type Interfaces.C.int;
- use type System.CRTL.size_t;
+ use type CRTL.size_t;
----------------------
-- Global Variables --
@@ -126,6 +129,23 @@ package body System.File_IO is
-- call to fopen or freopen. Amethod is the character designating
-- the access method from the Access_Method field of the FCB.
+ function Errno_Message
+ (Errno : Integer := OS_Lib.Errno) return String;
+ function Errno_Message
+ (Name : String;
+ Errno : Integer := OS_Lib.Errno) return String;
+ -- Return a message suitable for "raise ... with Errno_Message (...)".
+ -- Errno defaults to the current errno, but should be passed explicitly if
+ -- there is significant code in between the call that sets errno and the
+ -- call to Errno_Message, in case that code also sets errno. The version
+ -- with Name includes that file name in the message.
+
+ procedure Raise_Device_Error
+ (File : AFCB_Ptr; Errno : Integer := OS_Lib.Errno);
+ pragma No_Return (Raise_Device_Error);
+ -- Clear error indication on File and raise Device_Error with an exception
+ -- message providing errno information.
+
----------------
-- Append_Set --
----------------
@@ -134,7 +154,7 @@ package body System.File_IO is
begin
if File.Mode = Append_File then
if fseek (File.Stream, 0, SEEK_END) /= 0 then
- raise Device_Error;
+ Raise_Device_Error (File);
end if;
end if;
end Append_Set;
@@ -174,7 +194,7 @@ package body System.File_IO is
procedure Check_File_Open (File : AFCB_Ptr) is
begin
if File = null then
- raise Status_Error;
+ raise Status_Error with "file not open";
end if;
end Check_File_Open;
@@ -185,9 +205,9 @@ package body System.File_IO is
procedure Check_Read_Status (File : AFCB_Ptr) is
begin
if File = null then
- raise Status_Error;
+ raise Status_Error with "file not open";
elsif File.Mode > Inout_File then
- raise Mode_Error;
+ raise Mode_Error with "file not readable";
end if;
end Check_Read_Status;
@@ -198,9 +218,9 @@ package body System.File_IO is
procedure Check_Write_Status (File : AFCB_Ptr) is
begin
if File = null then
- raise Status_Error;
+ raise Status_Error with "file not open";
elsif File.Mode = In_File then
- raise Mode_Error;
+ raise Mode_Error with "file not writable";
end if;
end Check_Write_Status;
@@ -212,6 +232,7 @@ package body System.File_IO is
Close_Status : int := 0;
Dup_Strm : Boolean := False;
File : AFCB_Ptr renames File_Ptr.all;
+ Errno : Integer;
begin
-- Take a task lock, to protect the global data value Open_Files
@@ -223,15 +244,14 @@ package body System.File_IO is
-- Sever the association between the given file and its associated
-- external file. The given file is left closed. Do not perform system
- -- closes on the standard input, output and error files and also do
- -- not attempt to close a stream that does not exist (signalled by a
- -- null stream value -- happens in some error situations).
+ -- closes on the standard input, output and error files and also do not
+ -- attempt to close a stream that does not exist (signalled by a null
+ -- stream value -- happens in some error situations).
- if not File.Is_System_File
- and then File.Stream /= NULL_Stream
- then
- -- Do not do an fclose if this is a shared file and there is
- -- at least one other instance of the stream that is open.
+ if not File.Is_System_File and then File.Stream /= NULL_Stream then
+
+ -- Do not do an fclose if this is a shared file and there is at least
+ -- one other instance of the stream that is open.
if File.Shared_Status = Yes then
declare
@@ -240,9 +260,7 @@ package body System.File_IO is
begin
P := Open_Files;
while P /= null loop
- if P /= File
- and then File.Stream = P.Stream
- then
+ if P /= File and then File.Stream = P.Stream then
Dup_Strm := True;
exit;
end if;
@@ -256,6 +274,10 @@ package body System.File_IO is
if not Dup_Strm then
Close_Status := fclose (File.Stream);
+
+ if Close_Status /= 0 then
+ Errno := OS_Lib.Errno;
+ end if;
end if;
end if;
@@ -284,7 +306,7 @@ package body System.File_IO is
File := null;
if Close_Status /= 0 then
- raise Device_Error;
+ Raise_Device_Error (null, Errno);
end if;
SSL.Unlock_Task.all;
@@ -301,11 +323,12 @@ package body System.File_IO is
procedure Delete (File_Ptr : access AFCB_Ptr) is
File : AFCB_Ptr renames File_Ptr.all;
+
begin
Check_File_Open (File);
if not File.Is_Regular_File then
- raise Use_Error;
+ raise Use_Error with "cannot delete non-regular file";
end if;
declare
@@ -314,12 +337,12 @@ package body System.File_IO is
begin
Close (File_Ptr);
- -- Now unlink the external file. Note that we use the full name
- -- in this unlink, because the working directory may have changed
- -- since we did the open, and we want to unlink the right file!
+ -- Now unlink the external file. Note that we use the full name in
+ -- this unlink, because the working directory may have changed since
+ -- we did the open, and we want to unlink the right file!
if unlink (Filename'Address) = -1 then
- raise Use_Error;
+ raise Use_Error with Errno_Message;
end if;
end;
end Delete;
@@ -347,13 +370,45 @@ package body System.File_IO is
end if;
end End_Of_File;
+ -------------------
+ -- Errno_Message --
+ -------------------
+
+ function Errno_Message (Errno : Integer := OS_Lib.Errno) return String is
+ pragma Warnings (Off);
+ function To_Chars_Ptr is
+ new Ada.Unchecked_Conversion (System.Address, chars_ptr);
+ -- On VMS, the compiler warns because System.Address is 64 bits, but
+ -- chars_ptr is 32 bits. It should be safe, though, because strerror
+ -- will return a 32-bit pointer.
+ pragma Warnings (On);
+
+ Message : constant chars_ptr :=
+ To_Chars_Ptr (CRTL.strerror (Errno));
+
+ begin
+ if Message = Null_Ptr then
+ return "errno =" & Errno'Img;
+ else
+ return Value (Message);
+ end if;
+ end Errno_Message;
+
+ function Errno_Message
+ (Name : String;
+ Errno : Integer := OS_Lib.Errno) return String
+ is
+ begin
+ return Name & ": " & String'(Errno_Message (Errno));
+ end Errno_Message;
+
--------------
-- Finalize --
--------------
- -- Note: we do not need to worry about locking against multiple task
- -- access in this routine, since it is called only from the environment
- -- task just before terminating execution.
+ -- Note: we do not need to worry about locking against multiple task access
+ -- in this routine, since it is called only from the environment task just
+ -- before terminating execution.
procedure Finalize (V : in out File_IO_Clean_Up_Type) is
pragma Warnings (Off, V);
@@ -369,8 +424,8 @@ package body System.File_IO is
SSL.Lock_Task.all;
- -- First close all open files (the slightly complex form of this loop
- -- is required because Close as a side effect nulls out its argument)
+ -- First close all open files (the slightly complex form of this loop is
+ -- required because Close as a side effect nulls out its argument).
Fptr1 := Open_Files;
while Fptr1 /= null loop
@@ -379,9 +434,9 @@ package body System.File_IO is
Fptr1 := Fptr2;
end loop;
- -- Now unlink all temporary files. We do not bother to free the
- -- blocks because we are just about to terminate the program. We
- -- also ignore any errors while attempting these unlink operations.
+ -- Now unlink all temporary files. We do not bother to free the blocks
+ -- because we are just about to terminate the program. We also ignore
+ -- any errors while attempting these unlink operations.
while Temp_Files /= null loop
Discard := unlink (Temp_Files.Name'Address);
@@ -404,10 +459,8 @@ package body System.File_IO is
begin
Check_Write_Status (File);
- if fflush (File.Stream) = 0 then
- return;
- else
- raise Device_Error;
+ if fflush (File.Stream) /= 0 then
+ Raise_Device_Error (File);
end if;
end Flush;
@@ -429,20 +482,20 @@ package body System.File_IO is
-- you can reset to earlier points in the file. The caller must use the
-- Append_Set routine to deal with the necessary positioning.
- -- Note: in several cases, the fopen mode used allows reading and
- -- writing, but the setting of the Ada mode is more restrictive. For
- -- instance, Create in In_File mode uses "w+" which allows writing,
- -- but the Ada mode In_File will cause any write operations to be
- -- rejected with Mode_Error in any case.
+ -- Note: in several cases, the fopen mode used allows reading and writing,
+ -- but the setting of the Ada mode is more restrictive. For instance,
+ -- Create in In_File mode uses "w+" which allows writing, but the Ada mode
+ -- In_File will cause any write operations to be rejected with Mode_Error
+ -- in any case.
- -- Note: for the Out_File/Open cases for other than the Direct_IO case,
- -- an initial call will be made by the caller to first open the file in
- -- "r" mode to be sure that it exists. The real open, in "w" mode, will
- -- then destroy this file. This is peculiar, but that's what Ada semantics
- -- require and the ACVT tests insist on!
+ -- Note: for the Out_File/Open cases for other than the Direct_IO case, an
+ -- initial call will be made by the caller to first open the file in "r"
+ -- mode to be sure that it exists. The real open, in "w" mode, will then
+ -- destroy this file. This is peculiar, but that's what Ada semantics
+ -- require and the ACATS tests insist on!
- -- If text file translation is required, then either b or t is
- -- added to the mode, depending on the setting of Text.
+ -- If text file translation is required, then either "b" or "t" is appended
+ -- to the mode, depending on the setting of Text.
procedure Fopen_Mode
(Mode : File_Mode;
@@ -510,7 +563,7 @@ package body System.File_IO is
function Form (File : AFCB_Ptr) return String is
begin
if File = null then
- raise Status_Error;
+ raise Status_Error with "Form: file not open";
else
return File.Form.all (1 .. File.Form'Length - 1);
end if;
@@ -523,8 +576,7 @@ package body System.File_IO is
function Form_Boolean
(Form : String;
Keyword : String;
- Default : Boolean)
- return Boolean
+ Default : Boolean) return Boolean
is
V1, V2 : Natural;
pragma Unreferenced (V2);
@@ -542,7 +594,7 @@ package body System.File_IO is
return False;
else
- raise Use_Error;
+ raise Use_Error with "invalid Form";
end if;
end Form_Boolean;
@@ -553,8 +605,7 @@ package body System.File_IO is
function Form_Integer
(Form : String;
Keyword : String;
- Default : Integer)
- return Integer
+ Default : Integer) return Integer
is
V1, V2 : Natural;
V : Integer;
@@ -570,13 +621,13 @@ package body System.File_IO is
for J in V1 .. V2 loop
if Form (J) not in '0' .. '9' then
- raise Use_Error;
+ raise Use_Error with "invalid Form";
else
V := V * 10 + Character'Pos (Form (J)) - Character'Pos ('0');
end if;
if V > 999_999 then
- raise Use_Error;
+ raise Use_Error with "invalid Form";
end if;
end loop;
@@ -593,11 +644,9 @@ package body System.File_IO is
Keyword : String;
Start : out Natural;
Stop : out Natural)
- is
+ is
Klen : constant Integer := Keyword'Length;
- -- Start of processing for Form_Parameter
-
begin
for J in Form'First + Klen .. Form'Last - 1 loop
if Form (J) = '='
@@ -663,6 +712,7 @@ package body System.File_IO is
begin
status := setvbuf (File.Stream, Null_Address, IOLBF, Line_Siz);
+ -- No error checking???
end Make_Line_Buffered;
---------------------
@@ -675,6 +725,7 @@ package body System.File_IO is
begin
status := setvbuf (File.Stream, Null_Address, IONBF, 0);
+ -- No error checking???
end Make_Unbuffered;
----------
@@ -684,7 +735,7 @@ package body System.File_IO is
function Mode (File : AFCB_Ptr) return File_Mode is
begin
if File = null then
- raise Status_Error;
+ raise Status_Error with "Mode: file not open";
else
return File.Mode;
end if;
@@ -697,7 +748,7 @@ package body System.File_IO is
function Name (File : AFCB_Ptr) return String is
begin
if File = null then
- raise Status_Error;
+ raise Status_Error with "Name: file not open";
else
return File.Name.all (1 .. File.Name'Length - 1);
end if;
@@ -724,7 +775,7 @@ package body System.File_IO is
procedure Tmp_Name (Buffer : Address);
pragma Import (C, Tmp_Name, "__gnat_tmp_name");
- -- set buffer (a String address) with a temporary filename
+ -- Set buffer (a String address) with a temporary filename
Stream : FILEs := C_Stream;
-- Stream which we open in response to this request
@@ -744,9 +795,9 @@ package body System.File_IO is
-- Indicates temporary file case
Namelen : constant Integer := max_path_len;
- -- Length required for file name, not including final ASCII.NUL
- -- Note that we used to reference L_tmpnam here, which is not
- -- reliable since __gnat_tmp_name does not always use tmpnam.
+ -- Length required for file name, not including final ASCII.NUL.
+ -- Note that we used to reference L_tmpnam here, which is not reliable
+ -- since __gnat_tmp_name does not always use tmpnam.
Namestr : aliased String (1 .. Namelen + 1);
-- Name as given or temporary file name with ASCII.NUL appended
@@ -758,12 +809,12 @@ package body System.File_IO is
Full_Name_Len : Integer;
-- Length of name actually stored in Fullname
- Encoding : System.CRTL.Filename_Encoding;
+ Encoding : CRTL.Filename_Encoding;
-- Filename encoding specified into the form parameter
begin
if File_Ptr /= null then
- raise Status_Error;
+ raise Status_Error with "file already open";
end if;
-- Acquire form string, setting required NUL terminator
@@ -797,7 +848,7 @@ package body System.File_IO is
Shared := No;
else
- raise Use_Error;
+ raise Use_Error with "invalid Form";
end if;
end;
@@ -810,16 +861,16 @@ package body System.File_IO is
Form_Parameter (Formstr, "encoding", V1, V2);
if V1 = 0 then
- Encoding := System.CRTL.Unspecified;
+ Encoding := CRTL.Unspecified;
elsif Formstr (V1 .. V2) = "utf8" then
- Encoding := System.CRTL.UTF8;
+ Encoding := CRTL.UTF8;
elsif Formstr (V1 .. V2) = "8bits" then
- Encoding := System.CRTL.ASCII_8bits;
+ Encoding := CRTL.ASCII_8bits;
else
- raise Use_Error;
+ raise Use_Error with "invalid Form";
end if;
end;
@@ -851,13 +902,13 @@ package body System.File_IO is
if Tempfile then
if not Creat then
- raise Name_Error;
+ raise Name_Error with "opening temp file without creating it";
end if;
Tmp_Name (Namestr'Address);
if Namestr (1) = ASCII.NUL then
- raise Use_Error;
+ raise Use_Error with "invalid temp file name";
end if;
-- Chain to temp file list, ensuring thread safety with a lock
@@ -878,7 +929,7 @@ package body System.File_IO is
else
if Name'Length > Namelen then
- raise Name_Error;
+ raise Name_Error with "file name too long";
end if;
Namestr (1 .. Name'Length) := Name;
@@ -890,7 +941,7 @@ package body System.File_IO is
full_name (Namestr'Address, Fullname'Address);
if Fullname (1) = ASCII.NUL then
- raise Use_Error;
+ raise Use_Error with Errno_Message (Name);
end if;
Full_Name_Len := 1;
@@ -902,7 +953,7 @@ package body System.File_IO is
-- Fullname is generated by calling system's full_name. The problem
-- is, full_name does nothing about the casing, so a file name
- -- comparison may generally speaking not be valid on non-case
+ -- comparison may generally speaking not be valid on non-case-
-- sensitive systems, and in particular we get unexpected failures
-- on Windows/Vista because of this. So we use s-casuti to force
-- the name to lower case.
@@ -911,8 +962,8 @@ package body System.File_IO is
To_Lower (Fullname (1 .. Full_Name_Len));
end if;
- -- If Shared=None or Shared=Yes, then check for the existence
- -- of another file with exactly the same full name.
+ -- If Shared=None or Shared=Yes, then check for the existence of
+ -- another file with exactly the same full name.
if Shared /= No then
declare
@@ -937,7 +988,7 @@ package body System.File_IO is
if Shared = None
or else P.Shared_Status = None
then
- raise Use_Error;
+ raise Use_Error with "reopening shared file";
-- If both files have Shared=Yes, then we acquire the
-- stream from the located file to use as our stream.
@@ -983,7 +1034,7 @@ package body System.File_IO is
if not Creat and then Fopstr (1) /= 'r' then
if file_exists (Namestr'Address) = 0 then
- raise Name_Error;
+ raise Name_Error with Errno_Message (Name);
end if;
end if;
@@ -1007,10 +1058,8 @@ package body System.File_IO is
-- Should we raise Device_Error for ENOSPC???
declare
- subtype Cint is Interfaces.C.int;
-
function Is_File_Not_Found_Error
- (Errno_Value : Cint) return Cint;
+ (Errno_Value : Integer) return Integer;
-- Non-zero when the given errno value indicates a non-
-- existing file.
@@ -1018,13 +1067,13 @@ package body System.File_IO is
(C, Is_File_Not_Found_Error,
"__gnat_is_file_not_found_error");
+ Errno : constant Integer := OS_Lib.Errno;
+ Message : constant String := Errno_Message (Name, Errno);
begin
- if
- Is_File_Not_Found_Error (Cint (System.OS_Lib.Errno)) /= 0
- then
- raise Name_Error;
+ if Is_File_Not_Found_Error (Errno) /= 0 then
+ raise Name_Error with Message;
else
- raise Use_Error;
+ raise Use_Error with Message;
end if;
end;
end if;
@@ -1032,8 +1081,8 @@ package body System.File_IO is
end if;
-- Stream has been successfully located or opened, so now we are
- -- committed to completing the opening of the file. Allocate block
- -- on heap and fill in its fields.
+ -- committed to completing the opening of the file. Allocate block on
+ -- heap and fill in its fields.
File_Ptr := AFCB_Allocate (Dummy_FCB);
@@ -1053,6 +1102,23 @@ package body System.File_IO is
Append_Set (File_Ptr);
end Open;
+ ------------------------
+ -- Raise_Device_Error --
+ ------------------------
+
+ procedure Raise_Device_Error
+ (File : AFCB_Ptr; Errno : Integer := OS_Lib.Errno)
+ is
+ begin
+ -- Clear error status so that the same error is not reported twice
+
+ if File /= null then
+ clearerr (File.Stream);
+ end if;
+
+ raise Device_Error with Errno_Message (Errno);
+ end Raise_Device_Error;
+
--------------
-- Read_Buf --
--------------
@@ -1067,13 +1133,13 @@ package body System.File_IO is
return;
elsif ferror (File.Stream) /= 0 then
- raise Device_Error;
+ Raise_Device_Error (File);
elsif Nread = 0 then
raise End_Error;
else -- 0 < Nread < Siz
- raise Data_Error;
+ raise Data_Error with "not enough data read";
end if;
end Read_Buf;
@@ -1088,7 +1154,7 @@ package body System.File_IO is
Count := fread (Buf, 1, Siz, File.Stream);
if Count = 0 and then ferror (File.Stream) /= 0 then
- raise Device_Error;
+ Raise_Device_Error (File);
end if;
end Read_Buf;
@@ -1105,9 +1171,9 @@ package body System.File_IO is
Reset (File_Ptr, File.Mode);
end Reset;
- -- The reset with a change in mode is done using freopen, and is
- -- not permitted except for regular files (since otherwise there
- -- is no name for the freopen, and in any case it seems meaningless)
+ -- The reset with a change in mode is done using freopen, and is not
+ -- permitted except for regular files (since otherwise there is no name for
+ -- the freopen, and in any case it seems meaningless).
procedure Reset (File_Ptr : access AFCB_Ptr; Mode : File_Mode) is
File : AFCB_Ptr renames File_Ptr.all;
@@ -1120,25 +1186,29 @@ package body System.File_IO is
-- file that is not a regular file, or for a system file. Note that we
-- allow the "change" of mode if it is not in fact doing a change.
- if Mode /= File.Mode
- and then (File.Shared_Status = Yes
- or else File.Name'Length <= 1
- or else File.Is_System_File
- or else not File.Is_Regular_File)
- then
- raise Use_Error;
+ if Mode /= File.Mode then
+ if File.Shared_Status = Yes then
+ raise Use_Error with "cannot change mode of shared file";
+ elsif File.Name'Length <= 1 then
+ raise Use_Error with "cannot change mode of temp file";
+ elsif File.Is_System_File then
+ raise Use_Error with "cannot change mode of system file";
+ elsif not File.Is_Regular_File then
+ raise Use_Error with "cannot change mode of non-regular file";
+ end if;
+ end if;
- -- For In_File or Inout_File for a regular file, we can just do a
- -- rewind if the mode is unchanged, which is more efficient than
- -- doing a full reopen.
+ -- For In_File or Inout_File for a regular file, we can just do a rewind
+ -- if the mode is unchanged, which is more efficient than doing a full
+ -- reopen.
- elsif Mode = File.Mode
+ if Mode = File.Mode
and then Mode <= Inout_File
then
rewind (File.Stream);
- -- Here the change of mode is permitted, we do it by reopening the
- -- file in the new mode and replacing the stream with a new stream.
+ -- Here the change of mode is permitted, we do it by reopening the file
+ -- in the new mode and replacing the stream with a new stream.
else
Fopen_Mode
@@ -1164,17 +1234,17 @@ package body System.File_IO is
procedure Write_Buf (File : AFCB_Ptr; Buf : Address; Siz : size_t) is
begin
- -- Note: for most purposes, the Siz and 1 parameters in the fwrite
- -- call could be reversed, but on VMS, this is a better choice, since
- -- for some file formats, reversing the parameters results in records
- -- of one byte each.
+ -- Note: for most purposes, the Siz and 1 parameters in the fwrite call
+ -- could be reversed, but on VMS, this is a better choice, since for
+ -- some file formats, reversing the parameters results in records of one
+ -- byte each.
SSL.Abort_Defer.all;
if fwrite (Buf, Siz, 1, File.Stream) /= 1 then
if Siz /= 0 then
SSL.Abort_Undefer.all;
- raise Device_Error;
+ Raise_Device_Error (File);
end if;
end if;
diff --git a/gcc/ada/s-fileio.ads b/gcc/ada/s-fileio.ads
index e3a9abe0980..5ee0c5b99d9 100644
--- a/gcc/ada/s-fileio.ads
+++ b/gcc/ada/s-fileio.ads
@@ -125,8 +125,8 @@ package System.File_IO is
-- if used with temporary files or standard files.
function Form (File : FCB.AFCB_Ptr) return String;
- -- Returns the form as supplied by create, open or reset
- -- The string is normalized to all lower case letters.
+ -- Returns the form as supplied by create, open or reset The string is
+ -- normalized to all lower case letters.
function Is_Open (File : FCB.AFCB_Ptr) return Boolean;
-- Determines if file is open or not
@@ -145,25 +145,25 @@ package System.File_IO is
-- not opened in the normal manner. Note that the caller is responsible
-- for task lock out to protect the global data structures if this is
-- necessary (it is needed for the calls from within this unit itself,
- -- but not required for the calls from Text_IO and Wide_Text_IO that
- -- are made during elaboration of the environment task).
+ -- but not required for the calls from Text_IO and [Wide_]Wide_Text_IO
+ -- that are made during elaboration of the environment task).
procedure Check_File_Open (File : FCB.AFCB_Ptr);
- -- If the current file is not open, then Status_Error is raised.
- -- Otherwise control returns normally (with File pointing to the
- -- control block for the open file.
+ -- If the current file is not open, then Status_Error is raised. Otherwise
+ -- control returns normally (with File pointing to the control block for
+ -- the open file.
procedure Check_Read_Status (File : FCB.AFCB_Ptr);
- -- If the current file is not open, then Status_Error is raised. If
- -- the file is open, then the mode is checked to ensure that reading
- -- is permitted, and if not Mode_Error is raised, otherwise control
- -- returns normally.
+ -- If the current file is not open, then Status_Error is raised. If the
+ -- file is open, then the mode is checked to make sure that reading is
+ -- permitted, and if not Mode_Error is raised, otherwise control returns
+ -- normally.
procedure Check_Write_Status (File : FCB.AFCB_Ptr);
- -- If the current file is not open, then Status_Error is raised. If
- -- the file is open, then the mode is checked to ensure that writing
- -- is permitted, and if not Mode_Error is raised, otherwise control
- -- returns normally.
+ -- If the current file is not open, then Status_Error is raised. If the
+ -- file is open, then the mode is checked to ensure that writing is
+ -- permitted, and if not Mode_Error is raised, otherwise control returns
+ -- normally.
function End_Of_File (File : FCB.AFCB_Ptr) return Boolean;
-- File must be opened in read mode. True is returned if the stream is
@@ -171,30 +171,28 @@ package System.File_IO is
-- The position of the stream is not affected.
procedure Flush (File : FCB.AFCB_Ptr);
- -- Flushes the stream associated with the given file. The file must be
- -- open and in write mode (if not, an appropriate exception is raised)
+ -- Flushes the stream associated with the given file. The file must be open
+ -- and in write mode (if not, an appropriate exception is raised)
function Form_Boolean
(Form : String;
Keyword : String;
- Default : Boolean)
- return Boolean;
- -- Searches form string for an entry of the form Keyword=xx where xx is
- -- either Yes/No or y/n. Returns True if Yes or Y is found, False if No
- -- or N is found. If the keyword parameter is not found, returns the
- -- value given as Default. May raise Use_Error if a form string syntax
- -- error is detected. Keyword and Form must be in lower case.
+ Default : Boolean) return Boolean;
+ -- Searches form string for an entry of the form keyword=xx where xx is
+ -- either yes/no or y/n. Returns True if yes or y is found, False if no or
+ -- n is found. If the keyword parameter is not found, returns the value
+ -- given as Default. May raise Use_Error if a form string syntax error is
+ -- detected. Keyword and Form must be in lower case.
function Form_Integer
(Form : String;
Keyword : String;
- Default : Integer)
- return Integer;
- -- Searches form string for an entry of the form Keyword=xx where xx is
- -- an unsigned decimal integer in the range 0 to 999_999. Returns this
- -- integer value if it is found. If the keyword parameter is not found,
- -- returns the value given as Default. Raise Use_Error if a form string
- -- syntax error is detected. Keyword and Form must be in lower case.
+ Default : Integer) return Integer;
+ -- Searches form string for an entry of the form Keyword=xx where xx is an
+ -- unsigned decimal integer in the range 0 to 999_999. Returns this integer
+ -- value if it is found. If the keyword parameter is not found, returns the
+ -- value given as Default. Raise Use_Error if a form string syntax error is
+ -- detected. Keyword and Form must be in lower case.
procedure Form_Parameter
(Form : String;
@@ -221,22 +219,22 @@ package System.File_IO is
Buf : Address;
Siz : Interfaces.C_Streams.size_t;
Count : out Interfaces.C_Streams.size_t);
- -- Reads Siz bytes from File.Stream into Buf. The caller has checked
- -- that the file is open in read mode. Device Error is raised if an error
+ -- Reads Siz bytes from File.Stream into Buf. The caller has checked that
+ -- the file is open in read mode. Device Error is raised if an error
-- occurs. Count is the actual number of bytes read, which may be less
-- than Siz if the end of file is encountered.
procedure Append_Set (File : FCB.AFCB_Ptr);
- -- If the mode of the file is Append_File, then the file is positioned
- -- at the end of file using fseek, otherwise this call has no effect.
+ -- If the mode of the file is Append_File, then the file is positioned at
+ -- the end of file using fseek, otherwise this call has no effect.
procedure Write_Buf
(File : FCB.AFCB_Ptr;
Buf : Address;
Siz : Interfaces.C_Streams.size_t);
- -- Writes size_t bytes to File.Stream from Buf. The caller has checked
- -- that the file is open in write mode. Raises Device_Error if the
- -- complete buffer cannot be written.
+ -- Writes size_t bytes to File.Stream from Buf. The caller has checked that
+ -- the file is open in write mode. Raises Device_Error if the complete
+ -- buffer cannot be written.
procedure Make_Unbuffered (File : FCB.AFCB_Ptr);
diff --git a/gcc/ada/s-os_lib.adb b/gcc/ada/s-os_lib.adb
index 0f2081a0e87..f7341367688 100755
--- a/gcc/ada/s-os_lib.adb
+++ b/gcc/ada/s-os_lib.adb
@@ -77,8 +77,17 @@ package body System.OS_Lib is
-----------------------
function Args_Length (Args : Argument_List) return Natural;
- -- Returns total number of characters needed to create a string
- -- of all Args terminated by ASCII.NUL characters
+ -- Returns total number of characters needed to create a string of all Args
+ -- terminated by ASCII.NUL characters.
+
+ procedure Create_Temp_File_Internal
+ (FD : out File_Descriptor;
+ Name : out String_Access;
+ Stdout : Boolean);
+ -- Internal routine to implement two Create_Temp_File routines. If Stdout
+ -- is set to True the created descriptor is stdout-compatible, otherwise
+ -- it might not be depending on the OS (VMS is one example). The first two
+ -- parameters are as in Create_Temp_File.
function C_String_Length (S : Address) return Integer;
-- Returns the length of a C string. Does check for null address
@@ -749,10 +758,57 @@ package body System.OS_Lib is
(FD : out File_Descriptor;
Name : out String_Access)
is
+ begin
+ Create_Temp_File_Internal (FD, Name, Stdout => False);
+ end Create_Temp_File;
+
+ procedure Create_Temp_Output_File
+ (FD : out File_Descriptor;
+ Name : out String_Access)
+ is
+ begin
+ Create_Temp_File_Internal (FD, Name, Stdout => True);
+ end Create_Temp_Output_File;
+
+ -------------------------------
+ -- Create_Temp_File_Internal --
+ -------------------------------
+
+ procedure Create_Temp_File_Internal
+ (FD : out File_Descriptor;
+ Name : out String_Access;
+ Stdout : Boolean)
+ is
Pos : Positive;
Attempts : Natural := 0;
Current : String (Current_Temp_File_Name'Range);
+ ---------------------------------
+ -- Create_New_Output_Text_File --
+ ---------------------------------
+
+ function Create_New_Output_Text_File
+ (Name : String) return File_Descriptor;
+ -- Similar to Create_Output_Text_File, except it fails if the file
+ -- already exists. We need this behavior to ensure we don't accidentally
+ -- open a temp file that has just been created by a concurrently running
+ -- process. There is no point exposing this function, as it's generally
+ -- not particularly useful.
+
+ function Create_New_Output_Text_File
+ (Name : String) return File_Descriptor is
+ function C_Create_File
+ (Name : C_File_Name) return File_Descriptor;
+ pragma Import (C, C_Create_File, "__gnat_create_output_file_new");
+
+ C_Name : String (1 .. Name'Length + 1);
+
+ begin
+ C_Name (1 .. Name'Length) := Name;
+ C_Name (C_Name'Last) := ASCII.NUL;
+ return C_Create_File (C_Name (C_Name'First)'Address);
+ end Create_New_Output_Text_File;
+
begin
-- Loop until a new temp file can be created
@@ -814,7 +870,11 @@ package body System.OS_Lib is
-- Attempt to create the file
- FD := Create_New_File (Current, Binary);
+ if Stdout then
+ FD := Create_New_Output_Text_File (Current);
+ else
+ FD := Create_New_File (Current, Binary);
+ end if;
if FD /= Invalid_FD then
Name := new String'(Current);
@@ -836,7 +896,7 @@ package body System.OS_Lib is
end if;
end if;
end loop File_Loop;
- end Create_Temp_File;
+ end Create_Temp_File_Internal;
-----------------
-- Delete_File --
diff --git a/gcc/ada/s-os_lib.ads b/gcc/ada/s-os_lib.ads
index b77b3f01266..341a27953ab 100755
--- a/gcc/ada/s-os_lib.ads
+++ b/gcc/ada/s-os_lib.ads
@@ -245,9 +245,26 @@ package System.OS_Lib is
Name : out String_Access);
-- Create and open for writing a temporary file in the current working
-- directory. The name of the file and the File Descriptor are returned.
- -- No mode parameter is provided. Since this is a temporary file, there is
- -- no point in doing text translation on it. It is the responsibility of
- -- the caller to deallocate the access value returned in Name.
+ -- It is the responsibility of the caller to deallocate the access value
+ -- returned in Name.
+ --
+ -- The file is opened in binary mode (no text translation).
+ --
+ -- This procedure will always succeed if the current working directory is
+ -- writable. If the current working directory is not writable, then
+ -- Invalid_FD is returned for the file descriptor and null for the Name.
+ -- There is no race condition problem between processes trying to create
+ -- temp files at the same time in the same directory.
+
+ procedure Create_Temp_Output_File
+ (FD : out File_Descriptor;
+ Name : out String_Access);
+ -- Create and open for writing a temporary file in the current working
+ -- directory suitable to redirect standard output. The name of the file and
+ -- the File Descriptor are returned. It is the responsibility of the caller
+ -- to deallocate the access value returned in Name.
+ --
+ -- The file is opened in text mode
--
-- This procedure will always succeed if the current working directory is
-- writable. If the current working directory is not writable, then
diff --git a/gcc/ada/s-osinte-rtems.ads b/gcc/ada/s-osinte-rtems.ads
index 5e3d9192014..70e4a27e0a4 100644
--- a/gcc/ada/s-osinte-rtems.ads
+++ b/gcc/ada/s-osinte-rtems.ads
@@ -625,6 +625,7 @@ private
process_shared : int;
prio_ceiling : int;
protocol : int;
+ mutex_type : int;
recursive : int;
end record;
pragma Convention (C, pthread_mutexattr_t);
diff --git a/gcc/ada/s-stchop-rtems.adb b/gcc/ada/s-stchop-rtems.adb
index 615950e7fee..ac0cfd0f489 100644
--- a/gcc/ada/s-stchop-rtems.adb
+++ b/gcc/ada/s-stchop-rtems.adb
@@ -80,8 +80,9 @@ package body System.Stack_Checking.Operations is
is
pragma Unreferenced (Stack_Address);
- -- RTEMS has a routine to check this. So use it.
- function rtems_stack_checker_is_blown return Interfaces.C.int;
+ -- RTEMS has a routine to check if the stack is blown.
+ -- It returns a C99 bool.
+ function rtems_stack_checker_is_blown return Interfaces.C.unsigned_char;
pragma Import (C,
rtems_stack_checker_is_blown, "rtems_stack_checker_is_blown");
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index af29d9a3fdc..ad01bd18117 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -509,9 +509,8 @@ package body Sem_Aggr is
------------------------
function Array_Aggr_Subtype
- (N : Node_Id;
- Typ : Entity_Id)
- return Entity_Id
+ (N : Node_Id;
+ Typ : Entity_Id) return Entity_Id
is
Aggr_Dimension : constant Pos := Number_Dimensions (Typ);
-- Number of aggregate index dimensions
@@ -618,7 +617,7 @@ package body Sem_Aggr is
-- Array_Aggr_Subtype variables
Itype : Entity_Id;
- -- the final itype of the overall aggregate
+ -- The final itype of the overall aggregate
Index_Constraints : constant List_Id := New_List;
-- The list of index constraints of the aggregate itype
@@ -626,8 +625,8 @@ package body Sem_Aggr is
-- Start of processing for Array_Aggr_Subtype
begin
- -- Make sure that the list of index constraints is properly attached
- -- to the tree, and then collect the aggregate bounds.
+ -- Make sure that the list of index constraints is properly attached to
+ -- the tree, and then collect the aggregate bounds.
Set_Parent (Index_Constraints, N);
Collect_Aggr_Bounds (N, 1);
@@ -672,13 +671,13 @@ package body Sem_Aggr is
Itype := Create_Itype (E_Array_Subtype, N);
- Set_First_Rep_Item (Itype, First_Rep_Item (Typ));
- Set_Convention (Itype, Convention (Typ));
- Set_Depends_On_Private (Itype, Has_Private_Component (Typ));
- Set_Etype (Itype, Base_Type (Typ));
- Set_Has_Alignment_Clause (Itype, Has_Alignment_Clause (Typ));
- Set_Is_Aliased (Itype, Is_Aliased (Typ));
- Set_Depends_On_Private (Itype, Depends_On_Private (Typ));
+ Set_First_Rep_Item (Itype, First_Rep_Item (Typ));
+ Set_Convention (Itype, Convention (Typ));
+ Set_Depends_On_Private (Itype, Has_Private_Component (Typ));
+ Set_Etype (Itype, Base_Type (Typ));
+ Set_Has_Alignment_Clause (Itype, Has_Alignment_Clause (Typ));
+ Set_Is_Aliased (Itype, Is_Aliased (Typ));
+ Set_Depends_On_Private (Itype, Depends_On_Private (Typ));
Copy_Suppress_Status (Index_Check, Typ, Itype);
Copy_Suppress_Status (Length_Check, Typ, Itype);
@@ -688,22 +687,23 @@ package body Sem_Aggr is
Set_Is_Internal (Itype, True);
-- A simple optimization: purely positional aggregates of static
- -- components should be passed to gigi unexpanded whenever possible,
- -- and regardless of the staticness of the bounds themselves. Subse-
- -- quent checks in exp_aggr verify that type is not packed, etc.
+ -- components should be passed to gigi unexpanded whenever possible, and
+ -- regardless of the staticness of the bounds themselves. Subsequent
+ -- checks in exp_aggr verify that type is not packed, etc.
Set_Size_Known_At_Compile_Time (Itype,
Is_Fully_Positional
and then Comes_From_Source (N)
and then Size_Known_At_Compile_Time (Component_Type (Typ)));
- -- We always need a freeze node for a packed array subtype, so that
- -- we can build the Packed_Array_Type corresponding to the subtype.
- -- If expansion is disabled, the packed array subtype is not built,
- -- and we must not generate a freeze node for the type, or else it
- -- will appear incomplete to gigi.
+ -- We always need a freeze node for a packed array subtype, so that we
+ -- can build the Packed_Array_Type corresponding to the subtype. If
+ -- expansion is disabled, the packed array subtype is not built, and we
+ -- must not generate a freeze node for the type, or else it will appear
+ -- incomplete to gigi.
- if Is_Packed (Itype) and then not In_Spec_Expression
+ if Is_Packed (Itype)
+ and then not In_Spec_Expression
and then Expander_Active
then
Freeze_Itype (Itype, N);
@@ -728,11 +728,10 @@ package body Sem_Aggr is
Component_Elmt : Elmt_Id;
begin
- -- All the components of List are matched against Component and
- -- a count is maintained of possible misspellings. When at the
- -- end of the analysis there are one or two (not more!) possible
- -- misspellings, these misspellings will be suggested as
- -- possible correction.
+ -- All the components of List are matched against Component and a count
+ -- is maintained of possible misspellings. When at the end of the
+ -- the analysis there are one or two (not more!) possible misspellings,
+ -- these misspellings will be suggested as possible correction.
Component_Elmt := First_Elmt (Elements);
while Nr_Of_Suggestions <= Max_Suggestions
@@ -872,7 +871,7 @@ package body Sem_Aggr is
Append_To (Exprs, C_Node);
P := P + 1;
- -- something special for wide strings ???
+ -- Something special for wide strings???
end loop;
New_N := Make_Aggregate (Loc, Expressions => Exprs);
@@ -904,9 +903,9 @@ package body Sem_Aggr is
end if;
-- Check for aggregates not allowed in configurable run-time mode.
- -- We allow all cases of aggregates that do not come from source,
- -- since these are all assumed to be small (e.g. bounds of a string
- -- literal). We also allow aggregates of types we know to be small.
+ -- We allow all cases of aggregates that do not come from source, since
+ -- these are all assumed to be small (e.g. bounds of a string literal).
+ -- We also allow aggregates of types we know to be small.
if not Support_Aggregates_On_Target
and then Comes_From_Source (N)
@@ -941,10 +940,10 @@ package body Sem_Aggr is
-- First a special test, for the case of a positional aggregate
-- of characters which can be replaced by a string literal.
- -- Do not perform this transformation if this was a string literal
- -- to start with, whose components needed constraint checks, or if
- -- the component type is non-static, because it will require those
- -- checks and be transformed back into an aggregate.
+ -- Do not perform this transformation if this was a string literal to
+ -- start with, whose components needed constraint checks, or if the
+ -- component type is non-static, because it will require those checks
+ -- and be transformed back into an aggregate.
if Number_Dimensions (Typ) = 1
and then Is_Standard_Character_Type (Component_Type (Typ))
@@ -989,10 +988,10 @@ package body Sem_Aggr is
Aggr_Resolved : Boolean;
Aggr_Typ : constant Entity_Id := Etype (Typ);
- -- This is the unconstrained array type, which is the type
- -- against which the aggregate is to be resolved. Typ itself
- -- is the array type of the context which may not be the same
- -- subtype as the subtype for the final aggregate.
+ -- This is the unconstrained array type, which is the type against
+ -- which the aggregate is to be resolved. Typ itself is the array
+ -- type of the context which may not be the same subtype as the
+ -- subtype for the final aggregate.
begin
-- In the following we determine whether an others choice is
@@ -1002,11 +1001,11 @@ package body Sem_Aggr is
-- choice is not allowed.
-- If expansion is disabled (generic context, or semantics-only
- -- mode) actual subtypes cannot be constructed, and the type of
- -- an object may be its unconstrained nominal type. However, if
- -- the context is an assignment, we assume that "others" is
- -- allowed, because the target of the assignment will have a
- -- constrained subtype when fully compiled.
+ -- mode) actual subtypes cannot be constructed, and the type of an
+ -- object may be its unconstrained nominal type. However, if the
+ -- context is an assignment, we assume that "others" is allowed,
+ -- because the target of the assignment will have a constrained
+ -- subtype when fully compiled.
-- Note that there is no node for Explicit_Actual_Parameter.
-- To test for this context we therefore have to test for node
@@ -1014,7 +1013,7 @@ package body Sem_Aggr is
-- formal parameter. Consequently we also need to test for
-- N_Procedure_Call_Statement or N_Function_Call.
- Set_Etype (N, Aggr_Typ); -- may be overridden later on
+ Set_Etype (N, Aggr_Typ); -- May be overridden later on
if Is_Constrained (Typ) and then
(Pkind = N_Assignment_Statement or else
@@ -1080,10 +1079,10 @@ package body Sem_Aggr is
Error_Msg_N ("illegal context for aggregate", N);
end if;
- -- If we can determine statically that the evaluation of the
- -- aggregate raises Constraint_Error, then replace the
- -- aggregate with an N_Raise_Constraint_Error node, but set the
- -- Etype to the right aggregate subtype. Gigi needs this.
+ -- If we can determine statically that the evaluation of the aggregate
+ -- raises Constraint_Error, then replace the aggregate with an
+ -- N_Raise_Constraint_Error node, but set the Etype to the right
+ -- aggregate subtype. Gigi needs this.
if Raises_Constraint_Error (N) then
Aggr_Subtyp := Etype (N);
@@ -1115,13 +1114,13 @@ package body Sem_Aggr is
Index_Typ : constant Entity_Id := Etype (Index);
Index_Typ_Low : constant Node_Id := Type_Low_Bound (Index_Typ);
Index_Typ_High : constant Node_Id := Type_High_Bound (Index_Typ);
- -- The type of the index corresponding to the array sub-aggregate
- -- along with its low and upper bounds
+ -- The type of the index corresponding to the array sub-aggregate along
+ -- with its low and upper bounds.
Index_Base : constant Entity_Id := Base_Type (Index_Typ);
Index_Base_Low : constant Node_Id := Type_Low_Bound (Index_Base);
Index_Base_High : constant Node_Id := Type_High_Bound (Index_Base);
- -- ditto for the base type
+ -- Ditto for the base type
function Add (Val : Uint; To : Node_Id) return Node_Id;
-- Creates a new expression node where Val is added to expression To.
@@ -1131,16 +1130,16 @@ package body Sem_Aggr is
procedure Check_Bound (BH : Node_Id; AH : in out Node_Id);
-- Checks that AH (the upper bound of an array aggregate) is <= BH
-- (the upper bound of the index base type). If the check fails a
- -- warning is emitted, the Raises_Constraint_Error Flag of N is set,
+ -- warning is emitted, the Raises_Constraint_Error flag of N is set,
-- and AH is replaced with a duplicate of BH.
procedure Check_Bounds (L, H : Node_Id; AL, AH : Node_Id);
-- Checks that range AL .. AH is compatible with range L .. H. Emits a
- -- warning if not and sets the Raises_Constraint_Error Flag in N.
+ -- warning if not and sets the Raises_Constraint_Error flag in N.
procedure Check_Length (L, H : Node_Id; Len : Uint);
-- Checks that range L .. H contains at least Len elements. Emits a
- -- warning if not and sets the Raises_Constraint_Error Flag in N.
+ -- warning if not and sets the Raises_Constraint_Error flag in N.
function Dynamic_Or_Null_Range (L, H : Node_Id) return Boolean;
-- Returns True if range L .. H is dynamic or null
@@ -1155,11 +1154,10 @@ package body Sem_Aggr is
Single_Elmt : Boolean) return Boolean;
-- Resolves aggregate expression Expr. Returns False if resolution
-- fails. If Single_Elmt is set to False, the expression Expr may be
- -- used to initialize several array aggregate elements (this can
- -- happen for discrete choices such as "L .. H => Expr" or the others
- -- choice). In this event we do not resolve Expr unless expansion is
- -- disabled. To know why, see the DELAYED COMPONENT RESOLUTION
- -- note above.
+ -- used to initialize several array aggregate elements (this can happen
+ -- for discrete choices such as "L .. H => Expr" or the others choice).
+ -- In this event we do not resolve Expr unless expansion is disabled.
+ -- To know why, see the DELAYED COMPONENT RESOLUTION note above.
---------
-- Add --
@@ -1642,8 +1640,8 @@ package body Sem_Aggr is
-- discrete association
Prev_Nb_Discrete_Choices : Nat;
- -- Used to keep track of the number of discrete choices
- -- in the current association.
+ -- Used to keep track of the number of discrete choices in the
+ -- current association.
begin
-- STEP 2 (A): Check discrete choices validity
@@ -1690,9 +1688,8 @@ package body Sem_Aggr is
Check_Non_Static_Context (Choice);
-- Do not range check a choice. This check is redundant
- -- since this test is already performed when we check
- -- that the bounds of the array aggregate are within
- -- range.
+ -- since this test is already done when we check that the
+ -- bounds of the array aggregate are within range.
Set_Do_Range_Check (Choice, False);
end if;
@@ -1754,13 +1751,13 @@ package body Sem_Aggr is
end if;
-- Ada 2005 (AI-287): In case of default initialized component
- -- we delay the resolution to the expansion phase
+ -- we delay the resolution to the expansion phase.
if Box_Present (Assoc) then
- -- Ada 2005 (AI-287): In case of default initialization
- -- of a component the expander will generate calls to
- -- the corresponding initialization subprogram.
+ -- Ada 2005 (AI-287): In case of default initialization of a
+ -- component the expander will generate calls to the
+ -- corresponding initialization subprogram.
null;
@@ -1773,8 +1770,8 @@ package body Sem_Aggr is
-- We differentiate here two cases because the expression may
-- not be decorated. For example, the analysis and resolution
- -- of the expression associated with the others choice will
- -- be done later with the full aggregate. In such case we
+ -- of the expression associated with the others choice will be
+ -- done later with the full aggregate. In such case we
-- duplicate the expression tree to analyze the copy and
-- perform the required check.
@@ -1810,7 +1807,7 @@ package body Sem_Aggr is
end loop;
-- If aggregate contains more than one choice then these must be
- -- static. Sort them and check that they are contiguous
+ -- static. Sort them and check that they are contiguous.
if Nb_Discrete_Choices > 1 then
Sort_Case_Table (Table);
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index d4f4f51dc33..e37b216ca45 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -667,8 +667,8 @@ package body Sem_Attr is
end loop;
if Present (Q) then
- Set_Has_Per_Object_Constraint (
- Defining_Identifier (Q), True);
+ Set_Has_Per_Object_Constraint
+ (Defining_Identifier (Q), True);
end if;
end;
@@ -1991,9 +1991,10 @@ package body Sem_Attr is
-- entry wrappers, the attributes Count, Caller and AST_Entry require
-- a context check
- if Aname = Name_Count
- or else Aname = Name_Caller
- or else Aname = Name_AST_Entry
+ if Ada_Version >= Ada_05
+ and then (Aname = Name_Count
+ or else Aname = Name_Caller
+ or else Aname = Name_AST_Entry)
then
declare
Count : Natural := 0;
diff --git a/gcc/ada/sem_case.adb b/gcc/ada/sem_case.adb
index 5de995d984b..840214d2c64 100644
--- a/gcc/ada/sem_case.adb
+++ b/gcc/ada/sem_case.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1996-2008, Free Software Foundation, Inc. --
+-- Copyright (C) 1996-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -61,17 +61,24 @@ package body Sem_Case is
procedure Check_Choices
(Choice_Table : in out Sort_Choice_Table_Type;
Bounds_Type : Entity_Id;
+ Subtyp : Entity_Id;
Others_Present : Boolean;
- Msg_Sloc : Source_Ptr);
+ Case_Node : Node_Id);
-- This is the procedure which verifies that a set of case alternatives
-- or record variant choices has no duplicates, and covers the range
-- specified by Bounds_Type. Choice_Table contains the discrete choices
-- to check. These must start at position 1.
+ --
-- Furthermore Choice_Table (0) must exist. This element is used by
-- the sorting algorithm as a temporary. Others_Present is a flag
-- indicating whether or not an Others choice is present. Finally
-- Msg_Sloc gives the source location of the construct containing the
-- choices in the Choice_Table.
+ --
+ -- Bounds_Type is the type whose range must be covered by the alternatives
+ --
+ -- Subtyp is the subtype of the expression. If its bounds are non-static
+ -- the alternatives must cover its base type.
function Choice_Image (Value : Uint; Ctype : Entity_Id) return Name_Id;
-- Given a Pos value of enumeration type Ctype, returns the name
@@ -94,11 +101,17 @@ package body Sem_Case is
-------------------
procedure Check_Choices
- (Choice_Table : in out Sort_Choice_Table_Type;
+ (Choice_Table : in out Sort_Choice_Table_Type;
Bounds_Type : Entity_Id;
+ Subtyp : Entity_Id;
Others_Present : Boolean;
- Msg_Sloc : Source_Ptr)
+ Case_Node : Node_Id)
is
+ procedure Explain_Non_Static_Bound;
+ -- Called when we find a non-static bound, requiring the base type to
+ -- be covered. Provides where possible a helpful explanation of why the
+ -- bounds are non-static, since this is not always obvious.
+
function Lt_Choice (C1, C2 : Natural) return Boolean;
-- Comparison routine for comparing Choice_Table entries. Use the lower
-- bound of each Choice as the key.
@@ -136,6 +149,8 @@ package body Sem_Case is
end Issue_Msg;
procedure Issue_Msg (Value1 : Uint; Value2 : Uint) is
+ Msg_Sloc : constant Source_Ptr := Sloc (Case_Node);
+
begin
-- In some situations, we call this with a null range, and
-- obviously we don't want to complain in this case!
@@ -191,17 +206,65 @@ package body Sem_Case is
Choice_Table (Nat (To)) := Choice_Table (Nat (From));
end Move_Choice;
+ ------------------------------
+ -- Explain_Non_Static_Bound --
+ ------------------------------
+
+ procedure Explain_Non_Static_Bound is
+ Expr : Node_Id;
+
+ begin
+ if Nkind (Case_Node) = N_Variant_Part then
+ Expr := Name (Case_Node);
+ else
+ Expr := Expression (Case_Node);
+ end if;
+
+ if Bounds_Type /= Subtyp then
+
+ -- If the case is a variant part, the expression is given by
+ -- the discriminant itself, and the bounds are the culprits.
+
+ if Nkind (Case_Node) = N_Variant_Part then
+ Error_Msg_NE
+ ("bounds of & are not static," &
+ " alternatives must cover base type", Expr, Expr);
+
+ -- If this is a case statement, the expression may be
+ -- non-static or else the subtype may be at fault.
+
+ elsif Is_Entity_Name (Expr) then
+ Error_Msg_NE
+ ("bounds of & are not static," &
+ " alternatives must cover base type", Expr, Expr);
+
+ else
+ Error_Msg_N ("subtype of expression is not static," &
+ " alternatives must cover base type!", Expr);
+ end if;
+
+ -- Otherwise the expression is not static, even if the bounds of the
+ -- type are, or else there are missing alternatives. If both, the
+ -- additional information may be redundant but harmless.
+
+ elsif not Is_Entity_Name (Expr) then
+ Error_Msg_N
+ ("subtype of expression is not static, " &
+ "alternatives must cover base type!", Expr);
+ end if;
+ end Explain_Non_Static_Bound;
+
-- Variables local to Check_Choices
- Choice : Node_Id;
- Bounds_Lo : constant Node_Id := Type_Low_Bound (Bounds_Type);
- Bounds_Hi : constant Node_Id := Type_High_Bound (Bounds_Type);
+ Choice : Node_Id;
+ Bounds_Lo : constant Node_Id := Type_Low_Bound (Bounds_Type);
+ Bounds_Hi : constant Node_Id := Type_High_Bound (Bounds_Type);
Prev_Choice : Node_Id;
- Hi : Uint;
- Lo : Uint;
- Prev_Hi : Uint;
+ Hi : Uint;
+ Lo : Uint;
+ Prev_Hi : Uint;
-- Start of processing for Check_Choices
@@ -216,6 +279,7 @@ package body Sem_Case is
if not Others_Present then
Issue_Msg (Bounds_Lo, Bounds_Hi);
end if;
+
return;
end if;
@@ -227,6 +291,13 @@ package body Sem_Case is
if not Others_Present and then Expr_Value (Bounds_Lo) < Lo then
Issue_Msg (Bounds_Lo, Lo - 1);
+
+ -- If values are missing outside of the subtype, add explanation.
+ -- No additional message if only one value is missing.
+
+ if Expr_Value (Bounds_Lo) < Lo - 1 then
+ Explain_Non_Static_Bound;
+ end if;
end if;
for J in 2 .. Choice_Table'Last loop
@@ -254,6 +325,10 @@ package body Sem_Case is
if not Others_Present and then Expr_Value (Bounds_Hi) > Hi then
Issue_Msg (Hi + 1, Bounds_Hi);
+
+ if Expr_Value (Bounds_Hi) > Hi + 1 then
+ Explain_Non_Static_Bound;
+ end if;
end if;
end Check_Choices;
@@ -546,27 +621,27 @@ package body Sem_Case is
Sort_Choice_Table : Sort_Choice_Table_Type (0 .. Nb_Choices);
Choice_Type : constant Entity_Id := Base_Type (Subtyp);
- -- The actual type against which the discrete choices are
- -- resolved. Note that this type is always the base type not the
- -- subtype of the ruling expression, index or discriminant.
+ -- The actual type against which the discrete choices are resolved.
+ -- Note that this type is always the base type not the subtype of the
+ -- ruling expression, index or discriminant.
Bounds_Type : Entity_Id;
- -- The type from which are derived the bounds of the values
- -- covered by the discrete choices (see 3.8.1 (4)). If a discrete
- -- choice specifies a value outside of these bounds we have an error.
+ -- The type from which are derived the bounds of the values covered
+ -- by the discrete choices (see 3.8.1 (4)). If a discrete choice
+ -- specifies a value outside of these bounds we have an error.
Bounds_Lo : Uint;
Bounds_Hi : Uint;
-- The actual bounds of the above type
Expected_Type : Entity_Id;
- -- The expected type of each choice. Equal to Choice_Type, except
- -- if the expression is universal, in which case the choices can
- -- be of any integer type.
+ -- The expected type of each choice. Equal to Choice_Type, except if
+ -- the expression is universal, in which case the choices can be of
+ -- any integer type.
Alt : Node_Id;
-- A case statement alternative or a variant in a record type
- -- declaration
+ -- declaration.
Choice : Node_Id;
Kind : Node_Kind;
@@ -576,9 +651,9 @@ package body Sem_Case is
-- Remember others choice if it is present (empty otherwise)
procedure Check (Choice : Node_Id; Lo, Hi : Node_Id);
- -- Checks the validity of the bounds of a choice. When the bounds
- -- are static and no error occurred the bounds are entered into
- -- the choices table so that they can be sorted later on.
+ -- Checks the validity of the bounds of a choice. When the bounds
+ -- are static and no error occurred the bounds are entered into the
+ -- choices table so that they can be sorted later on.
-----------
-- Check --
@@ -628,10 +703,10 @@ package body Sem_Case is
if Lo_Val < Bounds_Lo then
- -- If the choice is an entity name, then it is a type, and
- -- we want to post the message on the reference to this
- -- entity. Otherwise we want to post it on the lower bound
- -- of the range.
+ -- If the choice is an entity name, then it is a type, and we
+ -- want to post the message on the reference to this entity.
+ -- Otherwise we want to post it on the lower bound of the
+ -- range.
if Is_Entity_Name (Choice) then
Enode := Choice;
@@ -654,10 +729,9 @@ package body Sem_Case is
if Hi_Val > Bounds_Hi then
- -- If the choice is an entity name, then it is a type, and
- -- we want to post the message on the reference to this
- -- entity. Otherwise we want to post it on the upper bound
- -- of the range.
+ -- If the choice is an entity name, then it is a type, and we
+ -- want to post the message on the reference to this entity.
+ -- Otherwise post it on the upper bound of the range.
if Is_Entity_Name (Choice) then
Enode := Choice;
@@ -678,9 +752,9 @@ package body Sem_Case is
-- Store bounds in the table
- -- Note: we still store the bounds, even if they are out of
- -- range, since this may prevent unnecessary cascaded errors
- -- for values that are covered by such an excessive range.
+ -- Note: we still store the bounds, even if they are out of range,
+ -- since this may prevent unnecessary cascaded errors for values
+ -- that are covered by such an excessive range.
Last_Choice := Last_Choice + 1;
Sort_Choice_Table (Last_Choice).Lo := Lo;
@@ -695,9 +769,9 @@ package body Sem_Case is
Raises_CE := False;
Others_Present := False;
- -- If Subtyp is not a static subtype Ada 95 requires then we use
- -- the bounds of its base type to determine the values covered by
- -- the discrete choices.
+ -- If Subtyp is not a static subtype Ada 95 requires then we use the
+ -- bounds of its base type to determine the values covered by the
+ -- discrete choices.
if Is_OK_Static_Subtype (Subtyp) then
Bounds_Type := Subtyp;
@@ -848,8 +922,9 @@ package body Sem_Case is
Check_Choices
(Sort_Choice_Table (0 .. Last_Choice),
Bounds_Type,
+ Subtyp,
Others_Present or else (Choice_Type = Universal_Integer),
- Sloc (N));
+ N);
-- Now copy the sorted discrete choices
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 75b24952200..174811bb81a 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -540,12 +540,9 @@ package body Sem_Ch12 is
-- initialized before call to Check_Generic_Child_Unit.
procedure Install_Formal_Packages (Par : Entity_Id);
- -- If any of the formals of the parent are formal packages with box,
- -- their formal parts are visible in the parent and thus in the child
- -- unit as well. Analogous to what is done in Check_Generic_Actuals
- -- for the unit itself. This procedure is also used in an instance, to
- -- make visible the proper entities of the actual for a formal package
- -- declared with a box.
+ -- Install the visible part of any formal of the parent that is a formal
+ -- package. Note that for the case of a formal package with a box, this
+ -- includes the formal part of the formal package (12.7(10/2)).
procedure Install_Parent (P : Entity_Id; In_Body : Boolean := False);
-- When compiling an instance of a child unit the parent (which is
@@ -1701,18 +1698,18 @@ package body Sem_Ch12 is
Lo :=
Make_Attribute_Reference (Loc,
Attribute_Name => Name_First,
- Prefix => New_Reference_To (T, Loc));
+ Prefix => New_Reference_To (T, Loc));
Set_Etype (Lo, T);
Hi :=
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Last,
- Prefix => New_Reference_To (T, Loc));
+ Prefix => New_Reference_To (T, Loc));
Set_Etype (Hi, T);
Set_Scalar_Range (T,
Make_Range (Loc,
- Low_Bound => Lo,
+ Low_Bound => Lo,
High_Bound => Hi));
Set_Ekind (Base, E_Enumeration_Type);
@@ -5217,11 +5214,10 @@ package body Sem_Ch12 is
elsif In_Open_Scopes (Inst_Par) then
- -- If the parent is already installed verify that the
- -- actuals for its formal packages declared with a box
- -- are already installed. This is necessary when the
- -- child instance is a child of the parent instance.
- -- In this case the parent is placed on the scope stack
+ -- If the parent is already installed, install the actuals
+ -- for its formal packages. This is necessary when the
+ -- child instance is a child of the parent instance:
+ -- in this case, the parent is placed on the scope stack
-- but the formal packages are not made visible.
Install_Formal_Packages (Inst_Par);
@@ -7191,24 +7187,20 @@ package body Sem_Ch12 is
if Renamed_Object (E) = Par then
exit;
- -- The visibility of a formal of an enclosing generic is
- -- already correct.
+ -- The visibility of a formal of an enclosing generic is already
+ -- correct.
elsif Denotes_Formal_Package (E) then
null;
- elsif Present (Associated_Formal_Package (E))
- and then Box_Present (Parent (Associated_Formal_Package (E)))
- then
+ elsif Present (Associated_Formal_Package (E)) then
Check_Generic_Actuals (Renamed_Object (E), True);
Set_Is_Hidden (E, False);
-- Find formal package in generic unit that corresponds to
-- (instance of) formal package in instance.
- while Present (Gen_E)
- and then Chars (Gen_E) /= Chars (E)
- loop
+ while Present (Gen_E) and then Chars (Gen_E) /= Chars (E) loop
Next_Entity (Gen_E);
end loop;
@@ -8365,7 +8357,7 @@ package body Sem_Ch12 is
"with volatile actual", Actual);
end if;
- -- formal in-parameter
+ -- Formal in-parameter
else
-- The instantiation of a generic formal in-parameter is constant
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index c514206c00d..7dd9629da6a 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -784,7 +784,7 @@ package body Sem_Ch3 is
Anon_Type :=
Create_Itype
- (E_Anonymous_Access_Type, Related_Nod, Scope_Id => Anon_Scope);
+ (E_Anonymous_Access_Type, Related_Nod, Scope_Id => Anon_Scope);
if All_Present (N)
and then Ada_Version >= Ada_05
@@ -825,8 +825,7 @@ package body Sem_Ch3 is
Find_Type (Subtype_Mark (N));
Desig_Type := Entity (Subtype_Mark (N));
- Set_Directly_Designated_Type
- (Anon_Type, Desig_Type);
+ Set_Directly_Designated_Type (Anon_Type, Desig_Type);
Set_Etype (Anon_Type, Anon_Type);
-- Make sure the anonymous access type has size and alignment fields
@@ -2883,12 +2882,11 @@ package body Sem_Ch3 is
Apply_Length_Check (E, T);
end if;
- -- If the type is limited unconstrained with defaulted discriminants
- -- and there is no expression, then the object is constrained by the
+ -- If the type is limited unconstrained with defaulted discriminants and
+ -- there is no expression, then the object is constrained by the
-- defaults, so it is worthwhile building the corresponding subtype.
- elsif (Is_Limited_Record (T)
- or else Is_Concurrent_Type (T))
+ elsif (Is_Limited_Record (T) or else Is_Concurrent_Type (T))
and then not Is_Constrained (T)
and then Has_Discriminants (T)
then
diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb
index 18853d72729..6e06e8353ae 100644
--- a/gcc/ada/sem_eval.adb
+++ b/gcc/ada/sem_eval.adb
@@ -5018,7 +5018,7 @@ package body Sem_Eval is
if Attribute_Name (N) = Name_Size then
Error_Msg_N
- ("size attribute is only static for scalar type " &
+ ("size attribute is only static for static scalar type " &
"(RM 4.9(7,8))", N);
-- Flag array cases
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 902cb30e825..4d56d36ee39 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -3459,6 +3459,15 @@ package body Sem_Prag is
else
Set_Imported (Def_Id);
+ if Is_Subprogram (Def_Id)
+ and then Is_Abstract_Subprogram (Def_Id)
+ then
+ Error_Msg_Sloc := Sloc (Def_Id);
+ Error_Msg_NE
+ ("cannot import abstract subprogram& declared#",
+ Arg2, Def_Id);
+ end if;
+
-- Special processing for Convention_Intrinsic
if C = Convention_Intrinsic then
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index c6a5a5ace59..96a295cd218 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -2935,10 +2935,8 @@ package body Sem_Res is
-- anomalies: the subtype was first built in the subprogram
-- declaration, and the current call may be nested.
- if Nkind (Actval) = N_Aggregate
- and then Has_Discriminants (Etype (Actval))
- then
- Analyze_And_Resolve (Actval, Base_Type (Etype (Actval)));
+ if Nkind (Actval) = N_Aggregate then
+ Analyze_And_Resolve (Actval, Etype (F));
else
Analyze_And_Resolve (Actval, Etype (Actval));
end if;
@@ -5390,6 +5388,7 @@ package body Sem_Res is
Eval_Call (N);
Check_Elab_Call (N);
+ Warn_On_Overlapping_Actuals (Nam, N);
end Resolve_Call;
-------------------------------
@@ -8255,8 +8254,8 @@ package body Sem_Res is
-----------------------------
procedure Resolve_Type_Conversion (N : Node_Id; Typ : Entity_Id) is
- Conv_OK : constant Boolean := Conversion_OK (N);
- Operand : constant Node_Id := Expression (N);
+ Conv_OK : constant Boolean := Conversion_OK (N);
+ Operand : constant Node_Id := Expression (N);
Operand_Typ : constant Entity_Id := Etype (Operand);
Target_Typ : constant Entity_Id := Etype (N);
Rop : Node_Id;
@@ -8401,9 +8400,25 @@ package body Sem_Res is
(Ekind (Entity (Orig_N)) = E_Loop_Parameter
and then Covers (Orig_T, Etype (Entity (Orig_N)))))
then
- Error_Msg_Node_2 := Orig_T;
- Error_Msg_NE -- CODEFIX
- ("?redundant conversion, & is of type &!", N, Entity (Orig_N));
+ -- One more check, do not give warning if the analyzed conversion
+ -- has an expression with non-static bounds, and the bounds of the
+ -- target are static. This avoids junk warnings in cases where the
+ -- conversion is necessary to establish staticness, for example in
+ -- a case statement.
+
+ if not Is_OK_Static_Subtype (Operand_Typ)
+ and then Is_OK_Static_Subtype (Target_Typ)
+ then
+ null;
+
+ -- Here we give the redundant conversion warning
+
+ else
+ Error_Msg_Node_2 := Orig_T;
+ Error_Msg_NE -- CODEFIX
+ ("?redundant conversion, & is of type &!",
+ N, Entity (Orig_N));
+ end if;
end if;
end if;
diff --git a/gcc/ada/sem_scil.adb b/gcc/ada/sem_scil.adb
index f47d1288f81..cd4e66be554 100644
--- a/gcc/ada/sem_scil.adb
+++ b/gcc/ada/sem_scil.adb
@@ -285,6 +285,14 @@ package body Sem_SCIL is
return Found_Node;
end if;
+ -- Actions in handled sequence of statements
+
+ when
+ N_Handled_Sequence_Of_Statements =>
+ if Find_SCIL_Node (Statements (P)) then
+ return Found_Node;
+ end if;
+
-- Conditions of while expression or elsif.
when N_Iteration_Scheme |
@@ -505,7 +513,6 @@ package body Sem_SCIL is
N_Function_Call |
N_Function_Specification |
N_Generic_Association |
- N_Handled_Sequence_Of_Statements |
N_Identifier |
N_In |
N_Index_Or_Discriminant_Constraint |
diff --git a/gcc/ada/sem_type.adb b/gcc/ada/sem_type.adb
index 931112c472d..d35326e1a50 100644
--- a/gcc/ada/sem_type.adb
+++ b/gcc/ada/sem_type.adb
@@ -732,7 +732,7 @@ package body Sem_Type is
begin
-- If either operand missing, then this is an error, but ignore it (and
-- pretend we have a cover) if errors already detected, since this may
- -- simply mean we have malformed trees.
+ -- simply mean we have malformed trees or a semantic error upstream.
if No (T1) or else No (T2) then
if Total_Errors_Detected /= 0 then
@@ -791,7 +791,7 @@ package body Sem_Type is
or else Scope (T1) /= Scope (T2));
end if;
- -- Literals are compatible with types in a given "class"
+ -- Literals are compatible with types in a given "class"
elsif (T2 = Universal_Integer and then Is_Integer_Type (T1))
or else (T2 = Universal_Real and then Is_Real_Type (T1))
@@ -803,7 +803,8 @@ package body Sem_Type is
then
return True;
- -- The context may be class wide
+ -- The context may be class wide, and a class-wide type is
+ -- compatible with any member of the class.
elsif Is_Class_Wide_Type (T1)
and then Is_Ancestor (Root_Type (T1), T2)
@@ -816,8 +817,8 @@ package body Sem_Type is
then
return True;
- -- Ada 2005 (AI-345): A class-wide abstract interface type T1 covers a
- -- task_type or protected_type implementing T1
+ -- Ada 2005 (AI-345): A class-wide abstract interface type covers a
+ -- task_type or protected_type that implements the interface.
elsif Ada_Version >= Ada_05
and then Is_Class_Wide_Type (T1)
@@ -884,7 +885,10 @@ package body Sem_Type is
then
return True;
- -- Some contexts require a class of types rather than a specific type
+ -- Some contexts require a class of types rather than a specific type.
+ -- For example, conditions require any boolean type, fixed point
+ -- attributes require some real type, etc. The built-in types Any_XXX
+ -- represent these classes.
elsif (T1 = Any_Integer and then Is_Integer_Type (T2))
or else (T1 = Any_Boolean and then Is_Boolean_Type (T2))
@@ -963,6 +967,8 @@ package body Sem_Type is
then
return Covers (Corresponding_Remote_Type (T1), T2);
+ -- and conversely.
+
elsif Is_Record_Type (T2)
and then (Is_Remote_Call_Interface (T2)
or else Is_Remote_Types (T2))
@@ -970,9 +976,30 @@ package body Sem_Type is
then
return Covers (Corresponding_Remote_Type (T2), T1);
+ -- Synchronized types are represented at run time by their corresponding
+ -- record type. During expansion one is replaced with the other, but
+ -- they are compatible views of the same type.
+
+ elsif Is_Record_Type (T1)
+ and then Is_Concurrent_Type (T2)
+ and then Present (Corresponding_Record_Type (T2))
+ then
+ return Covers (T1, Corresponding_Record_Type (T2));
+
+ elsif Is_Concurrent_Type (T1)
+ and then Present (Corresponding_Record_Type (T1))
+ and then Is_Record_Type (T2)
+ then
+ return Covers (Corresponding_Record_Type (T1), T2);
+
+ -- During analysis, an attribute reference 'Access has a special type
+ -- kind: Access_Attribute_Type, to be replaced eventually with the type
+ -- imposed by context.
+
elsif Ekind (T2) = E_Access_Attribute_Type
and then (Ekind (BT1) = E_General_Access_Type
- or else Ekind (BT1) = E_Access_Type)
+ or else
+ Ekind (BT1) = E_Access_Type)
and then Covers (Designated_Type (T1), Designated_Type (T2))
then
-- If the target type is a RACW type while the source is an access
@@ -984,6 +1011,8 @@ package body Sem_Type is
return True;
+ -- Ditto for allocators, which eventually resolve to the context type
+
elsif Ekind (T2) = E_Allocator_Type
and then Is_Access_Type (T1)
then
@@ -1008,7 +1037,7 @@ package body Sem_Type is
-- A packed array type covers its corresponding non-packed type. This is
-- not legitimate Ada, but allows the omission of a number of otherwise
-- useless unchecked conversions, and since this can only arise in
- -- (known correct) expanded code, no harm is done
+ -- (known correct) expanded code, no harm is done.
elsif Is_Array_Type (T2)
and then Is_Packed (T2)
@@ -1065,7 +1094,7 @@ package body Sem_Type is
return True;
-- Ada 2005 (AI-50217): Additional branches to make the shadow entity
- -- compatible with its real entity.
+ -- obtained through a limited_with compatible with its real entity.
elsif From_With_Type (T1) then
@@ -1087,7 +1116,7 @@ package body Sem_Type is
-- If units in the context have Limited_With clauses on each other,
-- either type might have a limited view. Checks performed elsewhere
- -- verify that the context type is the non-limited view.
+ -- verify that the context type is the nonlimited view.
if Is_Incomplete_Type (T2) then
return Covers (T1, Get_Full_View (Non_Limited_View (T2)));
@@ -1111,7 +1140,7 @@ package body Sem_Type is
-- Ada 2005 (AI-423): Coverage of formal anonymous access types
-- and actual anonymous access types in the context of generic
- -- instantiation. We have the following situation:
+ -- instantiations. We have the following situation:
-- generic
-- type Formal is private;
@@ -1133,7 +1162,7 @@ package body Sem_Type is
then
return True;
- -- Otherwise it doesn't cover!
+ -- Otherwise, types are not compatible!
else
return False;
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 37965afb69a..5baf60c8dea 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -2137,6 +2137,181 @@ package body Sem_Util is
end Denotes_Discriminant;
+ -------------------------
+ -- Denotes_Same_Object --
+ -------------------------
+
+ function Denotes_Same_Object (A1, A2 : Node_Id) return Boolean is
+ begin
+ -- If we have entity names, then must be same entity
+
+ if Is_Entity_Name (A1) then
+ if Is_Entity_Name (A2) then
+ return Entity (A1) = Entity (A2);
+ else
+ return False;
+ end if;
+
+ -- No match if not same node kind
+
+ elsif Nkind (A1) /= Nkind (A2) then
+ return False;
+
+ -- For selected components, must have same prefix and selector
+
+ elsif Nkind (A1) = N_Selected_Component then
+ return Denotes_Same_Object (Prefix (A1), Prefix (A2))
+ and then
+ Entity (Selector_Name (A1)) = Entity (Selector_Name (A2));
+
+ -- For explicit dereferences, prefixes must be same
+
+ elsif Nkind (A1) = N_Explicit_Dereference then
+ return Denotes_Same_Object (Prefix (A1), Prefix (A2));
+
+ -- For indexed components, prefixes and all subscripts must be the same
+
+ elsif Nkind (A1) = N_Indexed_Component then
+ if Denotes_Same_Object (Prefix (A1), Prefix (A2)) then
+ declare
+ Indx1 : Node_Id;
+ Indx2 : Node_Id;
+
+ begin
+ Indx1 := First (Expressions (A1));
+ Indx2 := First (Expressions (A2));
+ while Present (Indx1) loop
+
+ -- Shouldn't we be checking that values are the same???
+
+ if not Denotes_Same_Object (Indx1, Indx2) then
+ return False;
+ end if;
+
+ Next (Indx1);
+ Next (Indx2);
+ end loop;
+
+ return True;
+ end;
+ else
+ return False;
+ end if;
+
+ -- For slices, prefixes must match and bounds must match
+
+ elsif Nkind (A1) = N_Slice
+ and then Denotes_Same_Object (Prefix (A1), Prefix (A2))
+ then
+ declare
+ Lo1, Lo2, Hi1, Hi2 : Node_Id;
+
+ begin
+ Get_Index_Bounds (Etype (A1), Lo1, Hi1);
+ Get_Index_Bounds (Etype (A2), Lo2, Hi2);
+
+ -- Check whether bounds are statically identical. There is no
+ -- attempt to detect partial overlap of slices.
+
+ -- What about an array and a slice of an array???
+
+ return Denotes_Same_Object (Lo1, Lo2)
+ and then Denotes_Same_Object (Hi1, Hi2);
+ end;
+
+ -- Literals will appear as indices. Isn't this where we should check
+ -- Known_At_Compile_Time at least if we are generating warnings ???
+
+ elsif Nkind (A1) = N_Integer_Literal then
+ return Intval (A1) = Intval (A2);
+
+ else
+ return False;
+ end if;
+ end Denotes_Same_Object;
+
+ -------------------------
+ -- Denotes_Same_Prefix --
+ -------------------------
+
+ function Denotes_Same_Prefix (A1, A2 : Node_Id) return Boolean is
+
+ begin
+ if Is_Entity_Name (A1) then
+ if Nkind_In (A2, N_Selected_Component, N_Indexed_Component) then
+ return Denotes_Same_Object (A1, Prefix (A2))
+ or else Denotes_Same_Prefix (A1, Prefix (A2));
+ else
+ return False;
+ end if;
+
+ elsif Is_Entity_Name (A2) then
+ return Denotes_Same_Prefix (A2, A1);
+
+ elsif Nkind_In (A1, N_Selected_Component, N_Indexed_Component, N_Slice)
+ and then
+ Nkind_In (A2, N_Selected_Component, N_Indexed_Component, N_Slice)
+ then
+ declare
+ Root1, Root2 : Node_Id;
+ Depth1, Depth2 : Int := 0;
+
+ begin
+ Root1 := Prefix (A1);
+ while not Is_Entity_Name (Root1) loop
+ if not Nkind_In
+ (Root1, N_Selected_Component, N_Indexed_Component)
+ then
+ return False;
+ else
+ Root1 := Prefix (Root1);
+ end if;
+
+ Depth1 := Depth1 + 1;
+ end loop;
+
+ Root2 := Prefix (A2);
+ while not Is_Entity_Name (Root2) loop
+ if not Nkind_In
+ (Root2, N_Selected_Component, N_Indexed_Component)
+ then
+ return False;
+ else
+ Root2 := Prefix (Root2);
+ end if;
+
+ Depth2 := Depth2 + 1;
+ end loop;
+
+ -- If both have the same depth and they do not denote the same
+ -- object, they are disjoint and not warning is needed.
+
+ if Depth1 = Depth2 then
+ return False;
+
+ elsif Depth1 > Depth2 then
+ Root1 := Prefix (A1);
+ for I in 1 .. Depth1 - Depth2 - 1 loop
+ Root1 := Prefix (Root1);
+ end loop;
+
+ return Denotes_Same_Object (Root1, A2);
+
+ else
+ Root2 := Prefix (A2);
+ for I in 1 .. Depth2 - Depth1 - 1 loop
+ Root2 := Prefix (Root2);
+ end loop;
+
+ return Denotes_Same_Object (A1, Root2);
+ end if;
+ end;
+
+ else
+ return False;
+ end if;
+ end Denotes_Same_Prefix;
+
----------------------
-- Denotes_Variable --
----------------------
diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads
index 0e3dde668e6..623a72b2782 100644
--- a/gcc/ada/sem_util.ads
+++ b/gcc/ada/sem_util.ads
@@ -251,6 +251,15 @@ package Sem_Util is
-- components of protected types, and constraint checks on entry
-- families constrained by discriminants.
+ function Denotes_Same_Object (A1, A2 : Node_Id) return Boolean;
+ function Denotes_Same_Prefix (A1, A2 : Node_Id) return Boolean;
+ -- Functions to detect suspicious overlapping between actuals in a call,
+ -- when one of them is writable. The predicates are those proposed in
+ -- AI05-0144, to detect dangerous order dependence in complex calls.
+ -- I would add a parameter Warn which enables more extensive testing of
+ -- cases as we find appropriate when we are only warning ??? Or perhaps
+ -- return an indication of (Error, Warn, OK) ???
+
function Denotes_Variable (N : Node_Id) return Boolean;
-- Returns True if node N denotes a single variable without parentheses
diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb
index 407171f1d7b..abfdf1ff668 100644
--- a/gcc/ada/sem_warn.adb
+++ b/gcc/ada/sem_warn.adb
@@ -2991,6 +2991,7 @@ package body Sem_Warn is
Warn_On_Non_Local_Exception := True;
Warn_On_Object_Renames_Function := True;
Warn_On_Obsolescent_Feature := True;
+ Warn_On_Overlap := True;
Warn_On_Questionable_Missing_Parens := True;
Warn_On_Redundant_Constructs := True;
Warn_On_Unchecked_Conversion := True;
@@ -3001,6 +3002,12 @@ package body Sem_Warn is
when 'g' =>
Set_GNAT_Mode_Warnings;
+ when 'i' =>
+ Warn_On_Overlap := True;
+
+ when 'I' =>
+ Warn_On_Overlap := False;
+
when 'm' =>
Warn_On_Suspicious_Modulus_Value := True;
@@ -3139,6 +3146,7 @@ package body Sem_Warn is
Warn_On_No_Value_Assigned := False;
Warn_On_Non_Local_Exception := False;
Warn_On_Obsolescent_Feature := False;
+ Warn_On_Overlap := False;
Warn_On_All_Unread_Out_Parameters := False;
Warn_On_Parameter_Order := False;
Warn_On_Questionable_Missing_Parens := False;
@@ -3535,6 +3543,136 @@ package body Sem_Warn is
or else Warn_On_All_Unread_Out_Parameters;
end Warn_On_Modified_As_Out_Parameter;
+ ---------------------------------
+ -- Warn_On_Overlapping_Actuals --
+ ---------------------------------
+
+ procedure Warn_On_Overlapping_Actuals (Subp : Entity_Id; N : Node_Id) is
+ Act1, Act2 : Node_Id;
+ Form1, Form2 : Entity_Id;
+
+ begin
+ if not Warn_On_Overlap then
+ return;
+ end if;
+
+ -- Exclude calls rewritten as enumeration literals
+
+ if not Nkind_In (N, N_Function_Call, N_Procedure_Call_Statement) then
+ return;
+ end if;
+
+ -- Exclude calls to library subprograms. Container operations specify
+ -- safe behavior when source and target coincide.
+
+ if Is_Predefined_File_Name
+ (Unit_File_Name (Get_Source_Unit (Sloc (Subp))))
+ then
+ return;
+ end if;
+
+ Form1 := First_Formal (Subp);
+ Act1 := First_Actual (N);
+ while Present (Form1) and then Present (Act1) loop
+ if Ekind (Form1) = E_In_Out_Parameter then
+ Form2 := First_Formal (Subp);
+ Act2 := First_Actual (N);
+ while Present (Form2) and then Present (Act2) loop
+ if Form1 /= Form2
+ and then Ekind (Form2) /= E_Out_Parameter
+ and then
+ (Denotes_Same_Object (Act1, Act2)
+ or else
+ Denotes_Same_Prefix (Act1, Act2))
+ then
+ -- Exclude generic types and guard against previous errors.
+
+ if Error_Posted (N)
+ or else No (Etype (Act1))
+ or else No (Etype (Act2))
+ then
+ null;
+
+ elsif Is_Generic_Type (Etype (Act1))
+ or else
+ Is_Generic_Type (Etype (Act2))
+ then
+ null;
+
+ -- If the actual is a function call in prefix notation,
+ -- there is no real overlap.
+
+ elsif Nkind (Act2) = N_Function_Call then
+ null;
+
+ -- If either type is elementary the aliasing is harmless.
+
+ elsif Is_Elementary_Type (Underlying_Type (Etype (Form1)))
+ or else
+ Is_Elementary_Type (Underlying_Type (Etype (Form2)))
+ then
+ null;
+
+ else
+ declare
+ Act : Node_Id;
+ Form : Entity_Id;
+
+ begin
+ -- Find matching actual
+
+ Act := First_Actual (N);
+ Form := First_Formal (Subp);
+ while Act /= Act2 loop
+ Next_Formal (Form);
+ Next_Actual (Act);
+ end loop;
+
+ -- If the call was written in prefix notation, and
+ -- thus its prefix before rewriting was a selected
+ -- component, count only visible actuals in the call.
+
+ if Is_Entity_Name (First_Actual (N))
+ and then Nkind (Original_Node (N)) = Nkind (N)
+ and then Nkind (Name (Original_Node (N))) =
+ N_Selected_Component
+ and then
+ Is_Entity_Name (Prefix (Name (Original_Node (N))))
+ and then
+ Entity (Prefix (Name (Original_Node (N)))) =
+ Entity (First_Actual (N))
+ then
+ if Act1 = First_Actual (N) then
+ Error_Msg_FE
+ ("`IN OUT` prefix overlaps with actual for&?",
+ Act1, Form);
+ else
+ Error_Msg_FE
+ ("writable actual overlaps with actual for&?",
+ Act1, Form);
+ end if;
+
+ else
+ Error_Msg_FE
+ ("writable actual overlaps with actual for&?",
+ Act1, Form);
+ end if;
+ end;
+ end if;
+
+ return;
+ end if;
+
+ Next_Formal (Form2);
+ Next_Actual (Act2);
+ end loop;
+ end if;
+
+ Next_Formal (Form1);
+ Next_Actual (Act1);
+ end loop;
+ end Warn_On_Overlapping_Actuals;
+
------------------------------
-- Warn_On_Suspicious_Index --
------------------------------
diff --git a/gcc/ada/sem_warn.ads b/gcc/ada/sem_warn.ads
index 4ab97be7d67..365ad397d1b 100644
--- a/gcc/ada/sem_warn.ads
+++ b/gcc/ada/sem_warn.ads
@@ -210,6 +210,11 @@ package Sem_Warn is
-- as an out parameter. True if either Warn_On_Modified_Unread is set for
-- an only OUT parameter, or if Warn_On_All_Unread_Out_Parameters is set.
+ procedure Warn_On_Overlapping_Actuals (Subp : Entity_Id; N : Node_Id);
+ -- Called on a subprogram call. Checks whether an IN OUT actual that is
+ -- not by-copy may overlap with another actual, thus leading to aliasing
+ -- in the body of the called subprogram.
+
procedure Warn_On_Suspicious_Index (Name : Entity_Id; X : Node_Id);
-- This is called after resolving an indexed component or a slice. Name
-- is the entity for the name of the indexed array, and X is the subscript
diff --git a/gcc/ada/styleg.adb b/gcc/ada/styleg.adb
index 8bd9f2ee2bd..bf72722cc88 100644
--- a/gcc/ada/styleg.adb
+++ b/gcc/ada/styleg.adb
@@ -813,12 +813,17 @@ package body Styleg is
-- Check_Right_Paren --
-----------------------
- -- In check tokens mode (-gnatyt), right paren must never be preceded by
+ -- In check tokens mode (-gnatyt), right paren must not be immediately
+ -- followed by an identifier character, and must never be preceded by
-- a space unless it is the initial non-blank character on the line.
procedure Check_Right_Paren is
begin
if Style_Check_Tokens then
+ if Identifier_Char (Source (Token_Ptr + 1)) then
+ Error_Space_Required (Token_Ptr + 1);
+ end if;
+
Check_No_Space_Before;
end if;
end Check_Right_Paren;
diff --git a/gcc/ada/switch-m.adb b/gcc/ada/switch-m.adb
index 316b77e702b..a7a8d192626 100644
--- a/gcc/ada/switch-m.adb
+++ b/gcc/ada/switch-m.adb
@@ -656,6 +656,7 @@ package body Switch.M is
else
Follow_Links_For_Files := True;
+ Follow_Links_For_Dirs := True;
end if;
-- Processing for eS switch
diff --git a/gcc/ada/tbuild.adb b/gcc/ada/tbuild.adb
index 7273fde6703..3da3c611198 100644
--- a/gcc/ada/tbuild.adb
+++ b/gcc/ada/tbuild.adb
@@ -33,7 +33,6 @@ with Opt; use Opt;
with Restrict; use Restrict;
with Rident; use Rident;
with Sem_Aux; use Sem_Aux;
-with Sinfo; use Sinfo;
with Snames; use Snames;
with Stand; use Stand;
with Stringt; use Stringt;
@@ -626,6 +625,58 @@ package body Tbuild is
return Occurrence;
end New_Occurrence_Of;
+ -----------------
+ -- New_Op_Node --
+ -----------------
+
+ function New_Op_Node
+ (New_Node_Kind : Node_Kind;
+ New_Sloc : Source_Ptr) return Node_Id
+ is
+ type Name_Of_Type is array (N_Op) of Name_Id;
+ Name_Of : constant Name_Of_Type := Name_Of_Type'(
+ N_Op_And => Name_Op_And,
+ N_Op_Or => Name_Op_Or,
+ N_Op_Xor => Name_Op_Xor,
+ N_Op_Eq => Name_Op_Eq,
+ N_Op_Ne => Name_Op_Ne,
+ N_Op_Lt => Name_Op_Lt,
+ N_Op_Le => Name_Op_Le,
+ N_Op_Gt => Name_Op_Gt,
+ N_Op_Ge => Name_Op_Ge,
+ N_Op_Add => Name_Op_Add,
+ N_Op_Subtract => Name_Op_Subtract,
+ N_Op_Concat => Name_Op_Concat,
+ N_Op_Multiply => Name_Op_Multiply,
+ N_Op_Divide => Name_Op_Divide,
+ N_Op_Mod => Name_Op_Mod,
+ N_Op_Rem => Name_Op_Rem,
+ N_Op_Expon => Name_Op_Expon,
+ N_Op_Plus => Name_Op_Add,
+ N_Op_Minus => Name_Op_Subtract,
+ N_Op_Abs => Name_Op_Abs,
+ N_Op_Not => Name_Op_Not,
+
+ -- We don't really need these shift operators, since they never
+ -- appear as operators in the source, but the path of least
+ -- resistance is to put them in (the aggregate must be complete)
+
+ N_Op_Rotate_Left => Name_Rotate_Left,
+ N_Op_Rotate_Right => Name_Rotate_Right,
+ N_Op_Shift_Left => Name_Shift_Left,
+ N_Op_Shift_Right => Name_Shift_Right,
+ N_Op_Shift_Right_Arithmetic => Name_Shift_Right_Arithmetic);
+
+ Nod : constant Node_Id := New_Node (New_Node_Kind, New_Sloc);
+
+ begin
+ if New_Node_Kind in Name_Of'Range then
+ Set_Chars (Nod, Name_Of (New_Node_Kind));
+ end if;
+
+ return Nod;
+ end New_Op_Node;
+
----------------------
-- New_Reference_To --
----------------------
diff --git a/gcc/ada/tbuild.ads b/gcc/ada/tbuild.ads
index 261776df78f..0b73a53d220 100644
--- a/gcc/ada/tbuild.ads
+++ b/gcc/ada/tbuild.ads
@@ -27,6 +27,7 @@
-- building specific types of tree nodes.
with Namet; use Namet;
+with Sinfo; use Sinfo;
with Types; use Types;
package Tbuild is
@@ -196,6 +197,12 @@ package Tbuild is
-- "raise Constraint_Error" and returns the root of this tree,
-- the N_Raise_Statement node.
+ function New_Op_Node
+ (New_Node_Kind : Node_Kind;
+ New_Sloc : Source_Ptr) return Node_Id;
+ -- Create node using New_Node and, if its kind is in N_Op, set its Chars
+ -- field accordingly.
+
function New_External_Name
(Related_Id : Name_Id;
Suffix : Character := ' ';
diff --git a/gcc/ada/types.ads b/gcc/ada/types.ads
index 7340f64129e..cc3603aafa0 100644
--- a/gcc/ada/types.ads
+++ b/gcc/ada/types.ads
@@ -31,7 +31,7 @@
-- This package contains host independent type definitions which are used
-- in more than one unit in the compiler. They are gathered here for easy
--- reference, though in some cases the full description is found in the
+-- reference, although in some cases the full description is found in the
-- relevant module which implements the definition. The main reason that they
-- are not in their "natural" specs is that this would cause a lot of inter-
-- spec dependencies, and in particular some awkward circular dependencies
diff --git a/gcc/ada/usage.adb b/gcc/ada/usage.adb
index 6d704403da9..541496c5df8 100644
--- a/gcc/ada/usage.adb
+++ b/gcc/ada/usage.adb
@@ -424,6 +424,8 @@ begin
Write_Line (" H* turn off warnings for hiding variable");
Write_Line (" i* turn on warnings for implementation unit");
Write_Line (" I turn off warnings for implementation unit");
+ Write_Line (" .i turn on warnings for overlapping actuals");
+ Write_Line (" .I* turn off warnings for overlapping actuals");
Write_Line (" j turn on warnings for obsolescent " &
"(annex J) feature");
Write_Line (" J* turn off warnings for obsolescent " &
diff --git a/gcc/ada/xsnamest.adb b/gcc/ada/xsnamest.adb
index c4c386bd6c8..7dd3ca29883 100644
--- a/gcc/ada/xsnamest.adb
+++ b/gcc/ada/xsnamest.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -24,10 +24,10 @@
------------------------------------------------------------------------------
-- This utility is used to make a new version of the Snames package when new
--- names are added. This version reads a template file from snames.adt in
--- which the numbers are all written as $, and generates a new version of
--- the spec file snames.ads (written to snames.ns). It also reads snames.adb
--- and generates an updated body (written to snames.nb), and snames.h and
+-- names are added. This version reads a template file from snames.ads-tmpl in
+-- which the numbers are all written as $, and generates a new version of the
+-- spec file snames.ads (written to snames.ns). It also reads snames.adb-tmpl
+-- and generates an updated body (written to snames.nb), and snames.h-tmpl and
-- generates an updated C header file (written to snames.nh).
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
diff --git a/gcc/alias.c b/gcc/alias.c
index 694498ab55a..cdfa6d2d3ac 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -640,7 +640,7 @@ get_alias_set (tree t)
aren't types. */
if (! TYPE_P (t))
{
- tree inner = t;
+ tree inner;
/* Remove any nops, then give the language a chance to do
something with this tree before we look at it. */
@@ -649,8 +649,13 @@ get_alias_set (tree t)
if (set != -1)
return set;
+ /* Retrieve the original memory reference if needed. */
+ if (TREE_CODE (t) == TARGET_MEM_REF)
+ t = TMR_ORIGINAL (t);
+
/* First see if the actual object referenced is an INDIRECT_REF from a
restrict-qualified pointer or a "void *". */
+ inner = t;
while (handled_component_p (inner))
{
inner = TREE_OPERAND (inner, 0);
@@ -691,7 +696,14 @@ get_alias_set (tree t)
requires structural comparisons to identify compatible types
use alias set zero. */
if (TYPE_STRUCTURAL_EQUALITY_P (t))
- return 0;
+ {
+ /* Allow the language to specify another alias set for this
+ type. */
+ set = lang_hooks.get_alias_set (t);
+ if (set != -1)
+ return set;
+ return 0;
+ }
t = TYPE_CANONICAL (t);
/* Canonical types shouldn't form a tree nor should the canonical
type require structural equality checks. */
@@ -1053,6 +1065,11 @@ find_base_value (rtx src)
return 0;
case TRUNCATE:
+ /* As we do not know which address space the pointer is refering to, we can
+ handle this only if the target does not support different pointer or
+ address modes depending on the address space. */
+ if (!target_default_pointer_address_modes_p ())
+ break;
if (GET_MODE_SIZE (GET_MODE (src)) < GET_MODE_SIZE (Pmode))
break;
/* Fall through. */
@@ -1067,6 +1084,12 @@ find_base_value (rtx src)
case ZERO_EXTEND:
case SIGN_EXTEND: /* used for NT/Alpha pointers */
+ /* As we do not know which address space the pointer is refering to, we can
+ handle this only if the target does not support different pointer or
+ address modes depending on the address space. */
+ if (!target_default_pointer_address_modes_p ())
+ break;
+
{
rtx temp = find_base_value (XEXP (src, 0));
@@ -1459,6 +1482,11 @@ find_base_term (rtx x)
return REG_BASE_VALUE (x);
case TRUNCATE:
+ /* As we do not know which address space the pointer is refering to, we can
+ handle this only if the target does not support different pointer or
+ address modes depending on the address space. */
+ if (!target_default_pointer_address_modes_p ())
+ return 0;
if (GET_MODE_SIZE (GET_MODE (x)) < GET_MODE_SIZE (Pmode))
return 0;
/* Fall through. */
@@ -1473,6 +1501,12 @@ find_base_term (rtx x)
case ZERO_EXTEND:
case SIGN_EXTEND: /* Used for Alpha/NT pointers */
+ /* As we do not know which address space the pointer is refering to, we can
+ handle this only if the target does not support different pointer or
+ address modes depending on the address space. */
+ if (!target_default_pointer_address_modes_p ())
+ return 0;
+
{
rtx temp = find_base_term (XEXP (x, 0));
@@ -2171,6 +2205,13 @@ nonoverlapping_memrefs_p (const_rtx x, const_rtx y)
if (! DECL_P (exprx) || ! DECL_P (expry))
return 0;
+ /* With invalid code we can end up storing into the constant pool.
+ Bail out to avoid ICEing when creating RTL for this.
+ See gfortran.dg/lto/20091028-2_0.f90. */
+ if (TREE_CODE (exprx) == CONST_DECL
+ || TREE_CODE (expry) == CONST_DECL)
+ return 1;
+
rtlx = DECL_RTL (exprx);
rtly = DECL_RTL (expry);
@@ -2181,6 +2222,13 @@ nonoverlapping_memrefs_p (const_rtx x, const_rtx y)
&& ! rtx_equal_p (rtlx, rtly))
return 1;
+ /* If we have MEMs refering to different address spaces (which can
+ potentially overlap), we cannot easily tell from the addresses
+ whether the references overlap. */
+ if (MEM_P (rtlx) && MEM_P (rtly)
+ && MEM_ADDR_SPACE (rtlx) != MEM_ADDR_SPACE (rtly))
+ return 0;
+
/* Get the base and offsets of both decls. If either is a register, we
know both are and are the same, so use that as the base. The only
we can avoid overlap is if we can deduce that they are nonoverlapping
@@ -2272,6 +2320,12 @@ true_dependence (const_rtx mem, enum machine_mode mem_mode, const_rtx x,
if (nonoverlapping_memrefs_p (mem, x))
return 0;
+ /* If we have MEMs refering to different address spaces (which can
+ potentially overlap), we cannot easily tell from the addresses
+ whether the references overlap. */
+ if (MEM_ADDR_SPACE (mem) != MEM_ADDR_SPACE (x))
+ return 1;
+
if (mem_mode == VOIDmode)
mem_mode = GET_MODE (mem);
@@ -2349,6 +2403,12 @@ canon_true_dependence (const_rtx mem, enum machine_mode mem_mode, rtx mem_addr,
if (nonoverlapping_memrefs_p (x, mem))
return 0;
+ /* If we have MEMs refering to different address spaces (which can
+ potentially overlap), we cannot easily tell from the addresses
+ whether the references overlap. */
+ if (MEM_ADDR_SPACE (mem) != MEM_ADDR_SPACE (x))
+ return 1;
+
if (! x_addr)
x_addr = get_addr (XEXP (x, 0));
@@ -2409,6 +2469,12 @@ write_dependence_p (const_rtx mem, const_rtx x, int writep)
if (nonoverlapping_memrefs_p (x, mem))
return 0;
+ /* If we have MEMs refering to different address spaces (which can
+ potentially overlap), we cannot easily tell from the addresses
+ whether the references overlap. */
+ if (MEM_ADDR_SPACE (mem) != MEM_ADDR_SPACE (x))
+ return 1;
+
x_addr = get_addr (XEXP (x, 0));
mem_addr = get_addr (XEXP (mem, 0));
diff --git a/gcc/alloc-pool.c b/gcc/alloc-pool.c
index c9d990464ad..cb5d83d23ee 100644
--- a/gcc/alloc-pool.c
+++ b/gcc/alloc-pool.c
@@ -41,10 +41,10 @@ typedef struct allocation_object_def
/* Because we want any type of data to be well aligned after the ID,
the following elements are here. They are never accessed so
- the allocated object may be even smaller than this structure. */
+ the allocated object may be even smaller than this structure.
+ We do not care about alignment for floating-point types. */
char *align_p;
HOST_WIDEST_INT align_i;
- long double align_ld;
} u;
} allocation_object;
diff --git a/gcc/auto-inc-dec.c b/gcc/auto-inc-dec.c
index 929a2dcade8..3b3006c985f 100644
--- a/gcc/auto-inc-dec.c
+++ b/gcc/auto-inc-dec.c
@@ -40,6 +40,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-pass.h"
#include "df.h"
#include "dbgcnt.h"
+#include "target.h"
/* This pass was originally removed from flow.c. However there is
almost nothing that remains of that code.
@@ -613,6 +614,7 @@ try_merge (void)
/* The width of the mem being accessed. */
int size = GET_MODE_SIZE (GET_MODE (mem));
rtx last_insn = NULL;
+ enum machine_mode reg_mode = GET_MODE (inc_reg);
switch (inc_insn.form)
{
@@ -667,33 +669,33 @@ try_merge (void)
case SIMPLE_PRE_INC: /* ++size */
if (dump_file)
fprintf (dump_file, "trying SIMPLE_PRE_INC\n");
- return attempt_change (gen_rtx_PRE_INC (Pmode, inc_reg), inc_reg);
+ return attempt_change (gen_rtx_PRE_INC (reg_mode, inc_reg), inc_reg);
break;
case SIMPLE_POST_INC: /* size++ */
if (dump_file)
fprintf (dump_file, "trying SIMPLE_POST_INC\n");
- return attempt_change (gen_rtx_POST_INC (Pmode, inc_reg), inc_reg);
+ return attempt_change (gen_rtx_POST_INC (reg_mode, inc_reg), inc_reg);
break;
case SIMPLE_PRE_DEC: /* --size */
if (dump_file)
fprintf (dump_file, "trying SIMPLE_PRE_DEC\n");
- return attempt_change (gen_rtx_PRE_DEC (Pmode, inc_reg), inc_reg);
+ return attempt_change (gen_rtx_PRE_DEC (reg_mode, inc_reg), inc_reg);
break;
case SIMPLE_POST_DEC: /* size-- */
if (dump_file)
fprintf (dump_file, "trying SIMPLE_POST_DEC\n");
- return attempt_change (gen_rtx_POST_DEC (Pmode, inc_reg), inc_reg);
+ return attempt_change (gen_rtx_POST_DEC (reg_mode, inc_reg), inc_reg);
break;
case DISP_PRE: /* ++con */
if (dump_file)
fprintf (dump_file, "trying DISP_PRE\n");
- return attempt_change (gen_rtx_PRE_MODIFY (Pmode,
+ return attempt_change (gen_rtx_PRE_MODIFY (reg_mode,
inc_reg,
- gen_rtx_PLUS (Pmode,
+ gen_rtx_PLUS (reg_mode,
inc_reg,
inc_insn.reg1)),
inc_reg);
@@ -702,9 +704,9 @@ try_merge (void)
case DISP_POST: /* con++ */
if (dump_file)
fprintf (dump_file, "trying POST_DISP\n");
- return attempt_change (gen_rtx_POST_MODIFY (Pmode,
+ return attempt_change (gen_rtx_POST_MODIFY (reg_mode,
inc_reg,
- gen_rtx_PLUS (Pmode,
+ gen_rtx_PLUS (reg_mode,
inc_reg,
inc_insn.reg1)),
inc_reg);
@@ -713,9 +715,9 @@ try_merge (void)
case REG_PRE: /* ++reg */
if (dump_file)
fprintf (dump_file, "trying PRE_REG\n");
- return attempt_change (gen_rtx_PRE_MODIFY (Pmode,
+ return attempt_change (gen_rtx_PRE_MODIFY (reg_mode,
inc_reg,
- gen_rtx_PLUS (Pmode,
+ gen_rtx_PLUS (reg_mode,
inc_reg,
inc_insn.reg1)),
inc_reg);
@@ -724,9 +726,9 @@ try_merge (void)
case REG_POST: /* reg++ */
if (dump_file)
fprintf (dump_file, "trying POST_REG\n");
- return attempt_change (gen_rtx_POST_MODIFY (Pmode,
+ return attempt_change (gen_rtx_POST_MODIFY (reg_mode,
inc_reg,
- gen_rtx_PLUS (Pmode,
+ gen_rtx_PLUS (reg_mode,
inc_reg,
inc_insn.reg1)),
inc_reg);
@@ -1089,7 +1091,9 @@ find_inc (bool first_try)
we are going to increment the result of the add insn.
For this trick to be correct, the result reg of
the inc must be a valid addressing reg. */
- if (GET_MODE (inc_insn.reg_res) != Pmode)
+ addr_space_t as = MEM_ADDR_SPACE (*mem_insn.mem_loc);
+ if (GET_MODE (inc_insn.reg_res)
+ != targetm.addr_space.address_mode (as))
{
if (dump_file)
fprintf (dump_file, "base reg mode failure.\n");
@@ -1138,7 +1142,9 @@ find_inc (bool first_try)
{
/* For this trick to be correct, the result reg of the inc
must be a valid addressing reg. */
- if (GET_MODE (inc_insn.reg_res) != Pmode)
+ addr_space_t as = MEM_ADDR_SPACE (*mem_insn.mem_loc);
+ if (GET_MODE (inc_insn.reg_res)
+ != targetm.addr_space.address_mode (as))
{
if (dump_file)
fprintf (dump_file, "base reg mode failure.\n");
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index 35b4f1724e4..47828bf28c1 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -86,10 +86,6 @@
#include "tree-pass.h"
#include "df.h"
-#ifndef HAVE_conditional_execution
-#define HAVE_conditional_execution 0
-#endif
-
/* The number of rounds. In most cases there will only be 4 rounds, but
when partitioning hot and cold basic blocks into separate sections of
the .o file there will be an extra round.*/
@@ -2297,5 +2293,3 @@ struct rtl_opt_pass pass_partition_blocks =
TODO_dump_func | TODO_verify_rtl_sharing/* todo_flags_finish */
}
};
-
-
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 64840e1f620..0cb2bd7fb4e 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -230,6 +230,8 @@ static tree do_mpfr_bessel_n (tree, tree, tree,
static tree do_mpfr_remquo (tree, tree, tree);
static tree do_mpfr_lgamma_r (tree, tree, tree);
+/* Return true if NAME starts with __builtin_ or __sync_. */
+
bool
is_builtin_name (const char *name)
{
@@ -240,6 +242,16 @@ is_builtin_name (const char *name)
return false;
}
+
+/* Return true if DECL is a function symbol representing a built-in. */
+
+bool
+is_builtin_fn (tree decl)
+{
+ return TREE_CODE (decl) == FUNCTION_DECL && DECL_BUILT_IN (decl);
+}
+
+
/* Return true if NODE should be considered for inline expansion regardless
of the optimization level. This means whenever a function is invoked with
its "internal" name, which normally contains the prefix "__builtin". */
@@ -5644,7 +5656,8 @@ get_builtin_sync_mem (tree loc, enum machine_mode mode)
{
rtx addr, mem;
- addr = expand_expr (loc, NULL_RTX, Pmode, EXPAND_SUM);
+ addr = expand_expr (loc, NULL_RTX, ptr_mode, EXPAND_SUM);
+ addr = convert_memory_address (Pmode, addr);
/* Note that we explicitly do not want any alias information for this
memory, so that we kill all other live memories. Otherwise we don't
@@ -7182,7 +7195,7 @@ fold_builtin_cabs (location_t loc, tree arg, tree type, tree fndecl)
{
tree res;
- if (TREE_CODE (TREE_TYPE (arg)) != COMPLEX_TYPE
+ if (!validate_arg (arg, COMPLEX_TYPE)
|| TREE_CODE (TREE_TYPE (TREE_TYPE (arg))) != REAL_TYPE)
return NULL_TREE;
@@ -7571,7 +7584,7 @@ fold_builtin_cexp (location_t loc, tree arg0, tree type)
#endif
if (!validate_arg (arg0, COMPLEX_TYPE)
- && TREE_CODE (TREE_TYPE (TREE_TYPE (arg0))) == REAL_TYPE)
+ || TREE_CODE (TREE_TYPE (TREE_TYPE (arg0))) != REAL_TYPE)
return NULL_TREE;
#ifdef HAVE_mpc
@@ -9226,9 +9239,9 @@ fold_builtin_isascii (location_t loc, tree arg)
else
{
/* Transform isascii(c) -> ((c & ~0x7f) == 0). */
- arg = build2 (BIT_AND_EXPR, integer_type_node, arg,
- build_int_cst (NULL_TREE,
- ~ (unsigned HOST_WIDE_INT) 0x7f));
+ arg = fold_build2 (BIT_AND_EXPR, integer_type_node, arg,
+ build_int_cst (NULL_TREE,
+ ~ (unsigned HOST_WIDE_INT) 0x7f));
return fold_build2_loc (loc, EQ_EXPR, integer_type_node,
arg, integer_zero_node);
}
@@ -9266,8 +9279,8 @@ fold_builtin_isdigit (location_t loc, tree arg)
return NULL_TREE;
arg = fold_convert_loc (loc, unsigned_type_node, arg);
- arg = build2 (MINUS_EXPR, unsigned_type_node, arg,
- build_int_cst (unsigned_type_node, target_digit0));
+ arg = fold_build2 (MINUS_EXPR, unsigned_type_node, arg,
+ build_int_cst (unsigned_type_node, target_digit0));
return fold_build2_loc (loc, LE_EXPR, integer_type_node, arg,
build_int_cst (unsigned_type_node, 9));
}
@@ -10005,7 +10018,8 @@ fold_builtin_1 (location_t loc, tree fndecl, tree arg0, bool ignore)
break;
CASE_FLT_FN (BUILT_IN_CIMAG):
- if (validate_arg (arg0, COMPLEX_TYPE))
+ if (validate_arg (arg0, COMPLEX_TYPE)
+ && TREE_CODE (TREE_TYPE (TREE_TYPE (arg0))) == REAL_TYPE)
return non_lvalue_loc (loc, fold_build1_loc (loc, IMAGPART_EXPR, type, arg0));
break;
@@ -10051,7 +10065,45 @@ fold_builtin_1 (location_t loc, tree fndecl, tree arg0, bool ignore)
&& TREE_CODE (TREE_TYPE (TREE_TYPE (arg0))) == REAL_TYPE)
return do_mpc_arg1 (arg0, type, mpc_sqrt);
break;
-#endif
+
+#ifdef HAVE_mpc_arc
+ CASE_FLT_FN (BUILT_IN_CASIN):
+ if (validate_arg (arg0, COMPLEX_TYPE)
+ && TREE_CODE (TREE_TYPE (TREE_TYPE (arg0))) == REAL_TYPE)
+ return do_mpc_arg1 (arg0, type, mpc_asin);
+ break;
+
+ CASE_FLT_FN (BUILT_IN_CACOS):
+ if (validate_arg (arg0, COMPLEX_TYPE)
+ && TREE_CODE (TREE_TYPE (TREE_TYPE (arg0))) == REAL_TYPE)
+ return do_mpc_arg1 (arg0, type, mpc_acos);
+ break;
+
+ CASE_FLT_FN (BUILT_IN_CATAN):
+ if (validate_arg (arg0, COMPLEX_TYPE)
+ && TREE_CODE (TREE_TYPE (TREE_TYPE (arg0))) == REAL_TYPE)
+ return do_mpc_arg1 (arg0, type, mpc_atan);
+ break;
+
+ CASE_FLT_FN (BUILT_IN_CASINH):
+ if (validate_arg (arg0, COMPLEX_TYPE)
+ && TREE_CODE (TREE_TYPE (TREE_TYPE (arg0))) == REAL_TYPE)
+ return do_mpc_arg1 (arg0, type, mpc_asinh);
+ break;
+
+ CASE_FLT_FN (BUILT_IN_CACOSH):
+ if (validate_arg (arg0, COMPLEX_TYPE)
+ && TREE_CODE (TREE_TYPE (TREE_TYPE (arg0))) == REAL_TYPE)
+ return do_mpc_arg1 (arg0, type, mpc_acosh);
+ break;
+
+ CASE_FLT_FN (BUILT_IN_CATANH):
+ if (validate_arg (arg0, COMPLEX_TYPE)
+ && TREE_CODE (TREE_TYPE (TREE_TYPE (arg0))) == REAL_TYPE)
+ return do_mpc_arg1 (arg0, type, mpc_atanh);
+ break;
+#endif /* HAVE_mpc_arc */
+#endif /* HAVE_mpc */
CASE_FLT_FN (BUILT_IN_CABS):
return fold_builtin_cabs (loc, arg0, type, fndecl);
@@ -13856,3 +13908,41 @@ fold_call_stmt (gimple stmt, bool ignore)
}
return NULL_TREE;
}
+
+/* Look up the function in built_in_decls that corresponds to DECL
+ and set ASMSPEC as its user assembler name. DECL must be a
+ function decl that declares a builtin. */
+
+void
+set_builtin_user_assembler_name (tree decl, const char *asmspec)
+{
+ tree builtin;
+ gcc_assert (TREE_CODE (decl) == FUNCTION_DECL
+ && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL
+ && asmspec != 0);
+
+ builtin = built_in_decls [DECL_FUNCTION_CODE (decl)];
+ set_user_assembler_name (builtin, asmspec);
+ switch (DECL_FUNCTION_CODE (decl))
+ {
+ case BUILT_IN_MEMCPY:
+ init_block_move_fn (asmspec);
+ memcpy_libfunc = set_user_assembler_libfunc ("memcpy", asmspec);
+ break;
+ case BUILT_IN_MEMSET:
+ init_block_clear_fn (asmspec);
+ memset_libfunc = set_user_assembler_libfunc ("memset", asmspec);
+ break;
+ case BUILT_IN_MEMMOVE:
+ memmove_libfunc = set_user_assembler_libfunc ("memmove", asmspec);
+ break;
+ case BUILT_IN_MEMCMP:
+ memcmp_libfunc = set_user_assembler_libfunc ("memcmp", asmspec);
+ break;
+ case BUILT_IN_ABORT:
+ abort_libfunc = set_user_assembler_libfunc ("abort", asmspec);
+ break;
+ default:
+ break;
+ }
+}
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 4de92d0de95..20b24f0c3c2 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -710,6 +710,11 @@ const struct c_common_resword c_common_reswords[] =
{ "inout", RID_INOUT, D_OBJC },
{ "oneway", RID_ONEWAY, D_OBJC },
{ "out", RID_OUT, D_OBJC },
+
+#ifdef TARGET_ADDR_SPACE_KEYWORDS
+ /* Any address space keywords recognized by the target. */
+ TARGET_ADDR_SPACE_KEYWORDS,
+#endif
};
const unsigned int num_c_common_reswords =
@@ -840,6 +845,19 @@ const struct attribute_spec c_common_format_attribute_table[] =
{ NULL, 0, 0, false, false, false, NULL }
};
+/* Return identifier for address space AS. */
+const char *
+c_addr_space_name (addr_space_t as)
+{
+ unsigned int i;
+
+ for (i = 0; i < num_c_common_reswords; i++)
+ if (c_common_reswords[i].rid == RID_FIRST_ADDR_SPACE + as)
+ return c_common_reswords[i].word;
+
+ gcc_unreachable ();
+}
+
/* Push current bindings for the function name VAR_DECLS. */
void
@@ -1219,6 +1237,7 @@ c_fully_fold_internal (tree expr, bool in_init, bool *maybe_const_operands,
op2 = TREE_OPERAND (expr, 2);
op0 = c_fully_fold_internal (op0, in_init, maybe_const_operands,
maybe_const_itself);
+ STRIP_TYPE_NOPS (op0);
if (op0 != orig_op0)
ret = build3 (COMPONENT_REF, TREE_TYPE (expr), op0, op1, op2);
if (ret != expr)
@@ -1235,8 +1254,10 @@ c_fully_fold_internal (tree expr, bool in_init, bool *maybe_const_operands,
op3 = TREE_OPERAND (expr, 3);
op0 = c_fully_fold_internal (op0, in_init, maybe_const_operands,
maybe_const_itself);
+ STRIP_TYPE_NOPS (op0);
op1 = c_fully_fold_internal (op1, in_init, maybe_const_operands,
maybe_const_itself);
+ STRIP_TYPE_NOPS (op1);
op1 = decl_constant_value_for_optimization (op1);
if (op0 != orig_op0 || op1 != orig_op1)
ret = build4 (ARRAY_REF, TREE_TYPE (expr), op0, op1, op2, op3);
@@ -1293,6 +1314,7 @@ c_fully_fold_internal (tree expr, bool in_init, bool *maybe_const_operands,
orig_op1 = op1 = TREE_OPERAND (expr, 1);
op0 = c_fully_fold_internal (op0, in_init, maybe_const_operands,
maybe_const_itself);
+ STRIP_TYPE_NOPS (op0);
if (code != MODIFY_EXPR
&& code != PREDECREMENT_EXPR
&& code != PREINCREMENT_EXPR
@@ -1304,6 +1326,7 @@ c_fully_fold_internal (tree expr, bool in_init, bool *maybe_const_operands,
if (code != MODIFY_EXPR)
op1 = c_fully_fold_internal (op1, in_init, maybe_const_operands,
maybe_const_itself);
+ STRIP_TYPE_NOPS (op1);
op1 = decl_constant_value_for_optimization (op1);
if (op0 != orig_op0 || op1 != orig_op1 || in_init)
ret = in_init
@@ -1333,6 +1356,7 @@ c_fully_fold_internal (tree expr, bool in_init, bool *maybe_const_operands,
orig_op0 = op0 = TREE_OPERAND (expr, 0);
op0 = c_fully_fold_internal (op0, in_init, maybe_const_operands,
maybe_const_itself);
+ STRIP_TYPE_NOPS (op0);
if (code != ADDR_EXPR && code != REALPART_EXPR && code != IMAGPART_EXPR)
op0 = decl_constant_value_for_optimization (op0);
if (op0 != orig_op0 || in_init)
@@ -1372,12 +1396,14 @@ c_fully_fold_internal (tree expr, bool in_init, bool *maybe_const_operands,
orig_op0 = op0 = TREE_OPERAND (expr, 0);
orig_op1 = op1 = TREE_OPERAND (expr, 1);
op0 = c_fully_fold_internal (op0, in_init, &op0_const, &op0_const_self);
+ STRIP_TYPE_NOPS (op0);
unused_p = (op0 == (code == TRUTH_ANDIF_EXPR
? truthvalue_false_node
: truthvalue_true_node));
c_inhibit_evaluation_warnings += unused_p;
op1 = c_fully_fold_internal (op1, in_init, &op1_const, &op1_const_self);
+ STRIP_TYPE_NOPS (op1);
c_inhibit_evaluation_warnings -= unused_p;
if (op0 != orig_op0 || op1 != orig_op1 || in_init)
@@ -1409,12 +1435,15 @@ c_fully_fold_internal (tree expr, bool in_init, bool *maybe_const_operands,
orig_op2 = op2 = TREE_OPERAND (expr, 2);
op0 = c_fully_fold_internal (op0, in_init, &op0_const, &op0_const_self);
+ STRIP_TYPE_NOPS (op0);
c_inhibit_evaluation_warnings += (op0 == truthvalue_false_node);
op1 = c_fully_fold_internal (op1, in_init, &op1_const, &op1_const_self);
+ STRIP_TYPE_NOPS (op1);
c_inhibit_evaluation_warnings -= (op0 == truthvalue_false_node);
c_inhibit_evaluation_warnings += (op0 == truthvalue_true_node);
op2 = c_fully_fold_internal (op2, in_init, &op2_const, &op2_const_self);
+ STRIP_TYPE_NOPS (op2);
c_inhibit_evaluation_warnings -= (op0 == truthvalue_true_node);
if (op0 != orig_op0 || op1 != orig_op1 || op2 != orig_op2)
@@ -3790,6 +3819,31 @@ pointer_int_sum (location_t loc, enum tree_code resultcode,
return ret;
}
+/* Wrap a C_MAYBE_CONST_EXPR around an expression that is fully folded
+ and if NON_CONST is known not to be permitted in an evaluated part
+ of a constant expression. */
+
+tree
+c_wrap_maybe_const (tree expr, bool non_const)
+{
+ bool nowarning = TREE_NO_WARNING (expr);
+ location_t loc = EXPR_LOCATION (expr);
+
+ /* This should never be called for C++. */
+ if (c_dialect_cxx ())
+ gcc_unreachable ();
+
+ /* The result of folding may have a NOP_EXPR to set TREE_NO_WARNING. */
+ STRIP_TYPE_NOPS (expr);
+ expr = build2 (C_MAYBE_CONST_EXPR, TREE_TYPE (expr), NULL, expr);
+ C_MAYBE_CONST_EXPR_NON_CONST (expr) = non_const;
+ if (nowarning)
+ TREE_NO_WARNING (expr) = 1;
+ protected_set_expr_location (expr, loc);
+
+ return expr;
+}
+
/* Wrap a SAVE_EXPR around EXPR, if appropriate. Like save_expr, but
for C folds the inside expression and wraps a C_MAYBE_CONST_EXPR
around the SAVE_EXPR if needed so that c_fully_fold does not need
@@ -3804,10 +3858,7 @@ c_save_expr (tree expr)
expr = c_fully_fold (expr, false, &maybe_const);
expr = save_expr (expr);
if (!maybe_const)
- {
- expr = build2 (C_MAYBE_CONST_EXPR, TREE_TYPE (expr), NULL, expr);
- C_MAYBE_CONST_EXPR_NON_CONST (expr) = 1;
- }
+ expr = c_wrap_maybe_const (expr, true);
return expr;
}
@@ -4150,6 +4201,15 @@ c_common_get_alias_set (tree t)
tree u;
PTR *slot;
+ /* For VLAs, use the alias set of the element type rather than the
+ default of alias set 0 for types compared structurally. */
+ if (TYPE_P (t) && TYPE_STRUCTURAL_EQUALITY_P (t))
+ {
+ if (TREE_CODE (t) == ARRAY_TYPE)
+ return get_alias_set (TREE_TYPE (t));
+ return -1;
+ }
+
/* Permit type-punning when accessing a union, provided the access
is directly through the union. For example, this code does not
permit taking the address of a union member and then storing
@@ -5032,44 +5092,6 @@ c_common_nodes_and_builtins (void)
memset (builtin_types, 0, sizeof (builtin_types));
}
-/* Look up the function in built_in_decls that corresponds to DECL
- and set ASMSPEC as its user assembler name. DECL must be a
- function decl that declares a builtin. */
-
-void
-set_builtin_user_assembler_name (tree decl, const char *asmspec)
-{
- tree builtin;
- gcc_assert (TREE_CODE (decl) == FUNCTION_DECL
- && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL
- && asmspec != 0);
-
- builtin = built_in_decls [DECL_FUNCTION_CODE (decl)];
- set_user_assembler_name (builtin, asmspec);
- switch (DECL_FUNCTION_CODE (decl))
- {
- case BUILT_IN_MEMCPY:
- init_block_move_fn (asmspec);
- memcpy_libfunc = set_user_assembler_libfunc ("memcpy", asmspec);
- break;
- case BUILT_IN_MEMSET:
- init_block_clear_fn (asmspec);
- memset_libfunc = set_user_assembler_libfunc ("memset", asmspec);
- break;
- case BUILT_IN_MEMMOVE:
- memmove_libfunc = set_user_assembler_libfunc ("memmove", asmspec);
- break;
- case BUILT_IN_MEMCMP:
- memcmp_libfunc = set_user_assembler_libfunc ("memcmp", asmspec);
- break;
- case BUILT_IN_ABORT:
- abort_libfunc = set_user_assembler_libfunc ("abort", asmspec);
- break;
- default:
- break;
- }
-}
-
/* The number of named compound-literals generated thus far. */
static GTY(()) int compound_literal_number;
@@ -6455,9 +6477,10 @@ handle_mode_attribute (tree *node, tree name, tree args,
if (POINTER_TYPE_P (type))
{
+ addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (type));
tree (*fn)(tree, enum machine_mode, bool);
- if (!targetm.valid_pointer_mode (mode))
+ if (!targetm.addr_space.valid_pointer_mode (mode, as))
{
error ("invalid pointer mode %qs", p);
return NULL_TREE;
@@ -7802,6 +7825,8 @@ parse_optimize_options (tree args, bool attr_p)
/* Now parse the options. */
decode_options (opt_argc, opt_argv);
+ targetm.override_options_after_change();
+
/* Don't allow changing -fstrict-aliasing. */
flag_strict_aliasing = saved_flag_strict_aliasing;
@@ -8186,7 +8211,8 @@ c_parse_error (const char *gmsgid, enum cpp_ttype token_type,
else if (token_type == CPP_STRING
|| token_type == CPP_WSTRING
|| token_type == CPP_STRING16
- || token_type == CPP_STRING32)
+ || token_type == CPP_STRING32
+ || token_type == CPP_UTF8STRING)
message = catenate_messages (gmsgid, " before string constant");
else if (token_type == CPP_NUMBER)
message = catenate_messages (gmsgid, " before numeric constant");
@@ -8330,15 +8356,14 @@ fold_offsetof_1 (tree expr, tree stop_ref)
error ("cannot apply %<offsetof%> when %<operator[]%> is overloaded");
return error_mark_node;
- case INTEGER_CST:
- gcc_assert (integer_zerop (expr));
- return size_zero_node;
-
case NOP_EXPR:
case INDIRECT_REF:
- base = fold_offsetof_1 (TREE_OPERAND (expr, 0), stop_ref);
- gcc_assert (base == error_mark_node || base == size_zero_node);
- return base;
+ if (!integer_zerop (TREE_OPERAND (expr, 0)))
+ {
+ error ("cannot apply %<offsetof%> to a non constant address");
+ return error_mark_node;
+ }
+ return size_zero_node;
case COMPONENT_REF:
base = fold_offsetof_1 (TREE_OPERAND (expr, 0), stop_ref);
@@ -8371,6 +8396,48 @@ fold_offsetof_1 (tree expr, tree stop_ref)
}
t = convert (sizetype, t);
off = size_binop (MULT_EXPR, TYPE_SIZE_UNIT (TREE_TYPE (expr)), t);
+
+ /* Check if the offset goes beyond the upper bound of the array. */
+ if (code == PLUS_EXPR && TREE_CODE (t) == INTEGER_CST)
+ {
+ tree upbound = array_ref_up_bound (expr);
+ if (upbound != NULL_TREE
+ && TREE_CODE (upbound) == INTEGER_CST
+ && !tree_int_cst_equal (upbound,
+ TYPE_MAX_VALUE (TREE_TYPE (upbound))))
+ {
+ upbound = size_binop (PLUS_EXPR, upbound,
+ build_int_cst (TREE_TYPE (upbound), 1));
+ if (tree_int_cst_lt (upbound, t))
+ {
+ tree v;
+
+ for (v = TREE_OPERAND (expr, 0);
+ TREE_CODE (v) == COMPONENT_REF;
+ v = TREE_OPERAND (v, 0))
+ if (TREE_CODE (TREE_TYPE (TREE_OPERAND (v, 0)))
+ == RECORD_TYPE)
+ {
+ tree fld_chain = TREE_CHAIN (TREE_OPERAND (v, 1));
+ for (; fld_chain; fld_chain = TREE_CHAIN (fld_chain))
+ if (TREE_CODE (fld_chain) == FIELD_DECL)
+ break;
+
+ if (fld_chain)
+ break;
+ }
+ /* Don't warn if the array might be considered a poor
+ man's flexible array member with a very permissive
+ definition thereof. */
+ if (TREE_CODE (v) == ARRAY_REF
+ || TREE_CODE (v) == COMPONENT_REF)
+ warning (OPT_Warray_bounds,
+ "index %E denotes an offset "
+ "greater than size of %qT",
+ t, TREE_TYPE (TREE_OPERAND (expr, 0)));
+ }
+ }
+ }
break;
case COMPOUND_EXPR:
@@ -8506,7 +8573,7 @@ complete_array_type (tree *ptype, tree initial_value, bool do_default)
if (quals == 0)
unqual_elt = elt;
else
- unqual_elt = c_build_qualified_type (elt, TYPE_UNQUALIFIED);
+ unqual_elt = c_build_qualified_type (elt, KEEP_QUAL_ADDR_SPACE (quals));
/* Using build_distinct_type_copy and modifying things afterward instead
of using build_array_type to create a new type preserves all of the
diff --git a/gcc/c-common.h b/gcc/c-common.h
index c1655ae69ff..d91546ff239 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -126,6 +126,30 @@ enum rid
RID_AT_INTERFACE,
RID_AT_IMPLEMENTATION,
+ /* Named address support, mapping the keyword to a particular named address
+ number. Named address space 0 is reserved for the generic address. If
+ there are more than 254 named addresses, the addr_space_t type will need
+ to be grown from an unsigned char to unsigned short. */
+ RID_ADDR_SPACE_0, /* generic address */
+ RID_ADDR_SPACE_1,
+ RID_ADDR_SPACE_2,
+ RID_ADDR_SPACE_3,
+ RID_ADDR_SPACE_4,
+ RID_ADDR_SPACE_5,
+ RID_ADDR_SPACE_6,
+ RID_ADDR_SPACE_7,
+ RID_ADDR_SPACE_8,
+ RID_ADDR_SPACE_9,
+ RID_ADDR_SPACE_10,
+ RID_ADDR_SPACE_11,
+ RID_ADDR_SPACE_12,
+ RID_ADDR_SPACE_13,
+ RID_ADDR_SPACE_14,
+ RID_ADDR_SPACE_15,
+
+ RID_FIRST_ADDR_SPACE = RID_ADDR_SPACE_0,
+ RID_LAST_ADDR_SPACE = RID_ADDR_SPACE_15,
+
RID_MAX,
RID_FIRST_MODIFIER = RID_STATIC,
@@ -263,6 +287,10 @@ struct c_common_resword
#define D_CXX_OBJC 0x100 /* In Objective C, and C++, but not C. */
#define D_CXXWARN 0x200 /* In C warn with -Wcxx-compat. */
+/* Macro for backends to define named address keywords. */
+#define ADDR_SPACE_KEYWORD(STRING, VALUE) \
+ { STRING, RID_FIRST_ADDR_SPACE + (VALUE), D_CONLY | D_EXT }
+
/* The reserved keyword table. */
extern const struct c_common_resword c_common_reswords[];
@@ -760,6 +788,7 @@ extern const struct attribute_spec c_common_format_attribute_table[];
extern tree (*make_fname_decl) (location_t, tree, int);
+extern const char *c_addr_space_name (addr_space_t as);
extern tree identifier_global_value (tree);
extern void record_builtin_type (enum rid, const char *, tree);
extern tree build_void_list_node (void);
@@ -792,6 +821,7 @@ extern tree c_build_bitfield_integer_type (unsigned HOST_WIDE_INT, int);
extern bool decl_with_nonnull_addr_p (const_tree);
extern tree c_fully_fold (tree, bool, bool *);
extern tree decl_constant_value_for_optimization (tree);
+extern tree c_wrap_maybe_const (tree, bool);
extern tree c_save_expr (tree);
extern tree c_common_truthvalue_conversion (location_t, tree);
extern void c_apply_type_quals_to_decl (int, tree);
@@ -839,8 +869,6 @@ extern tree c_build_qualified_type (tree, int);
frontends. */
extern void c_common_nodes_and_builtins (void);
-extern void set_builtin_user_assembler_name (tree decl, const char *asmspec);
-
extern void disable_builtin_function (const char *);
extern void set_compound_literal_name (tree decl);
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index e237332f174..492d2e673b7 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -1746,8 +1746,35 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
}
else
{
- if (TYPE_QUALS (newtype) != TYPE_QUALS (oldtype))
- error ("conflicting type qualifiers for %q+D", newdecl);
+ int new_quals = TYPE_QUALS (newtype);
+ int old_quals = TYPE_QUALS (oldtype);
+
+ if (new_quals != old_quals)
+ {
+ addr_space_t new_addr = DECODE_QUAL_ADDR_SPACE (new_quals);
+ addr_space_t old_addr = DECODE_QUAL_ADDR_SPACE (old_quals);
+ if (new_addr != old_addr)
+ {
+ if (ADDR_SPACE_GENERIC_P (new_addr))
+ error ("conflicting named address spaces (generic vs %s) "
+ "for %q+D",
+ c_addr_space_name (old_addr), newdecl);
+ else if (ADDR_SPACE_GENERIC_P (old_addr))
+ error ("conflicting named address spaces (%s vs generic) "
+ "for %q+D",
+ c_addr_space_name (new_addr), newdecl);
+ else
+ error ("conflicting named address spaces (%s vs %s) "
+ "for %q+D",
+ c_addr_space_name (new_addr),
+ c_addr_space_name (old_addr),
+ newdecl);
+ }
+
+ if (CLEAR_QUAL_ADDR_SPACE (new_quals)
+ != CLEAR_QUAL_ADDR_SPACE (old_quals))
+ error ("conflicting type qualifiers for %q+D", newdecl);
+ }
else
error ("conflicting types for %q+D", newdecl);
diagnose_arglist_conflict (newdecl, olddecl, newtype, oldtype);
@@ -3605,7 +3632,8 @@ shadow_tag_warned (const struct c_declspecs *declspecs, int warned)
else if (!declspecs->tag_defined_p
&& (declspecs->const_p
|| declspecs->volatile_p
- || declspecs->restrict_p))
+ || declspecs->restrict_p
+ || declspecs->address_space))
{
if (warned != 1)
pedwarn (input_location, 0,
@@ -3676,7 +3704,8 @@ shadow_tag_warned (const struct c_declspecs *declspecs, int warned)
if (!warned && !in_system_header && (declspecs->const_p
|| declspecs->volatile_p
- || declspecs->restrict_p))
+ || declspecs->restrict_p
+ || declspecs->address_space))
{
warning (0, "useless type qualifier in empty declaration");
warned = 2;
@@ -3699,7 +3728,8 @@ quals_from_declspecs (const struct c_declspecs *specs)
{
int quals = ((specs->const_p ? TYPE_QUAL_CONST : 0)
| (specs->volatile_p ? TYPE_QUAL_VOLATILE : 0)
- | (specs->restrict_p ? TYPE_QUAL_RESTRICT : 0));
+ | (specs->restrict_p ? TYPE_QUAL_RESTRICT : 0)
+ | (ENCODE_QUAL_ADDR_SPACE (specs->address_space)));
gcc_assert (!specs->type
&& !specs->decl_attr
&& specs->typespec_word == cts_none
@@ -4750,6 +4780,7 @@ grokdeclarator (const struct c_declarator *declarator,
bool bitfield = width != NULL;
tree element_type;
struct c_arg_info *arg_info = 0;
+ addr_space_t as1, as2, address_space;
location_t loc = UNKNOWN_LOCATION;
const char *errmsg;
tree expr_dummy;
@@ -4880,6 +4911,10 @@ grokdeclarator (const struct c_declarator *declarator,
constp = declspecs->const_p + TYPE_READONLY (element_type);
restrictp = declspecs->restrict_p + TYPE_RESTRICT (element_type);
volatilep = declspecs->volatile_p + TYPE_VOLATILE (element_type);
+ as1 = declspecs->address_space;
+ as2 = TYPE_ADDR_SPACE (element_type);
+ address_space = ADDR_SPACE_GENERIC_P (as1)? as2 : as1;
+
if (pedantic && !flag_isoc99)
{
if (constp > 1)
@@ -4889,11 +4924,17 @@ grokdeclarator (const struct c_declarator *declarator,
if (volatilep > 1)
pedwarn (loc, OPT_pedantic, "duplicate %<volatile%>");
}
+
+ if (!ADDR_SPACE_GENERIC_P (as1) && !ADDR_SPACE_GENERIC_P (as2) && as1 != as2)
+ error_at (loc, "conflicting named address spaces (%s vs %s)",
+ c_addr_space_name (as1), c_addr_space_name (as2));
+
if (!flag_gen_aux_info && (TYPE_QUALS (element_type)))
type = TYPE_MAIN_VARIANT (type);
type_quals = ((constp ? TYPE_QUAL_CONST : 0)
| (restrictp ? TYPE_QUAL_RESTRICT : 0)
- | (volatilep ? TYPE_QUAL_VOLATILE : 0));
+ | (volatilep ? TYPE_QUAL_VOLATILE : 0)
+ | ENCODE_QUAL_ADDR_SPACE (address_space));
/* Warn about storage classes that are invalid for certain
kinds of declarations (parameters, typenames, etc.). */
@@ -5309,7 +5350,14 @@ grokdeclarator (const struct c_declarator *declarator,
it, but here we want to make sure we don't ever
modify the shared type, so we gcc_assert (itype)
below. */
- type = build_array_type (type, itype);
+ {
+ addr_space_t as = DECODE_QUAL_ADDR_SPACE (type_quals);
+ if (!ADDR_SPACE_GENERIC_P (as) && as != TYPE_ADDR_SPACE (type))
+ type = build_qualified_type (type,
+ ENCODE_QUAL_ADDR_SPACE (as));
+
+ type = build_array_type (type, itype);
+ }
if (type != error_mark_node)
{
@@ -5515,6 +5563,59 @@ grokdeclarator (const struct c_declarator *declarator,
/* Now TYPE has the actual type, apart from any qualifiers in
TYPE_QUALS. */
+ /* Warn about address space used for things other than static memory or
+ pointers. */
+ address_space = DECODE_QUAL_ADDR_SPACE (type_quals);
+ if (!ADDR_SPACE_GENERIC_P (address_space))
+ {
+ if (decl_context == NORMAL)
+ {
+ switch (storage_class)
+ {
+ case csc_auto:
+ error ("%qs combined with %<auto%> qualifier for %qE",
+ c_addr_space_name (address_space), name);
+ break;
+ case csc_register:
+ error ("%qs combined with %<register%> qualifier for %qE",
+ c_addr_space_name (address_space), name);
+ break;
+ case csc_none:
+ if (current_function_scope)
+ {
+ error ("%qs specified for auto variable %qE",
+ c_addr_space_name (address_space), name);
+ break;
+ }
+ break;
+ case csc_static:
+ case csc_extern:
+ case csc_typedef:
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ }
+ else if (decl_context == PARM && TREE_CODE (type) != ARRAY_TYPE)
+ {
+ if (name)
+ error ("%qs specified for parameter %qE",
+ c_addr_space_name (address_space), name);
+ else
+ error ("%qs specified for unnamed parameter",
+ c_addr_space_name (address_space));
+ }
+ else if (decl_context == FIELD)
+ {
+ if (name)
+ error ("%qs specified for structure field %qE",
+ c_addr_space_name (address_space), name);
+ else
+ error ("%qs specified for structure field",
+ c_addr_space_name (address_space));
+ }
+ }
+
/* Check the type and width of a bit-field. */
if (bitfield)
check_bitfield_type_and_width (&type, width, name);
@@ -8297,9 +8398,29 @@ build_null_declspecs (void)
ret->volatile_p = false;
ret->restrict_p = false;
ret->saturating_p = false;
+ ret->address_space = ADDR_SPACE_GENERIC;
return ret;
}
+/* Add the address space ADDRSPACE to the declaration specifiers
+ SPECS, returning SPECS. */
+
+struct c_declspecs *
+declspecs_add_addrspace (struct c_declspecs *specs, addr_space_t as)
+{
+ specs->non_sc_seen_p = true;
+ specs->declspecs_seen_p = true;
+
+ if (!ADDR_SPACE_GENERIC_P (specs->address_space)
+ && specs->address_space != as)
+ error ("incompatible address space qualifiers %qs and %qs",
+ c_addr_space_name (as),
+ c_addr_space_name (specs->address_space));
+ else
+ specs->address_space = as;
+ return specs;
+}
+
/* Add the type qualifier QUAL to the declaration specifiers SPECS,
returning SPECS. */
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index 0c6cdab9dff..fd3df8c0a48 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -365,6 +365,7 @@ c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags,
case CPP_WSTRING:
case CPP_STRING16:
case CPP_STRING32:
+ case CPP_UTF8STRING:
type = lex_string (tok, value, true, true);
break;
@@ -423,7 +424,8 @@ c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags,
case CPP_WSTRING:
case CPP_STRING16:
case CPP_STRING32:
- if ((lex_flags & C_LEX_RAW_STRINGS) == 0)
+ case CPP_UTF8STRING:
+ if ((lex_flags & C_LEX_STRING_NO_JOIN) == 0)
{
type = lex_string (tok, value, false,
(lex_flags & C_LEX_STRING_NO_TRANSLATE) == 0);
@@ -871,12 +873,13 @@ interpret_fixed (const cpp_token *token, unsigned int flags)
return value;
}
-/* Convert a series of STRING, WSTRING, STRING16 and/or STRING32 tokens
- into a tree, performing string constant concatenation. TOK is the
- first of these. VALP is the location to write the string into.
- OBJC_STRING indicates whether an '@' token preceded the incoming token.
+/* Convert a series of STRING, WSTRING, STRING16, STRING32 and/or
+ UTF8STRING tokens into a tree, performing string constant
+ concatenation. TOK is the first of these. VALP is the location
+ to write the string into. OBJC_STRING indicates whether an '@' token
+ preceded the incoming token.
Returns the CPP token type of the result (CPP_STRING, CPP_WSTRING,
- CPP_STRING32, CPP_STRING16, or CPP_OBJC_STRING).
+ CPP_STRING32, CPP_STRING16, CPP_UTF8STRING, or CPP_OBJC_STRING).
This is unfortunately more work than it should be. If any of the
strings in the series has an L prefix, the result is a wide string
@@ -921,6 +924,7 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string, bool translate)
case CPP_WSTRING:
case CPP_STRING16:
case CPP_STRING32:
+ case CPP_UTF8STRING:
if (type != tok->type)
{
if (type == CPP_STRING)
@@ -966,6 +970,7 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string, bool translate)
{
default:
case CPP_STRING:
+ case CPP_UTF8STRING:
value = build_string (1, "");
break;
case CPP_STRING16:
@@ -991,6 +996,7 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string, bool translate)
{
default:
case CPP_STRING:
+ case CPP_UTF8STRING:
TREE_TYPE (value) = char_array_type_node;
break;
case CPP_STRING16:
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index 3f6e949fe8e..1a6012e9128 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -72,6 +72,10 @@ c_parse_init (void)
tree id;
int mask = 0;
+ /* Make sure RID_MAX hasn't grown past the 8 bits used to hold the keyword in
+ the c_token structure. */
+ gcc_assert (RID_MAX <= 255);
+
mask |= D_CXXONLY;
if (!flag_isoc99)
mask |= D_C99;
@@ -132,6 +136,8 @@ typedef enum c_id_kind {
C_ID_TYPENAME,
/* An identifier declared as an Objective-C class name. */
C_ID_CLASSNAME,
+ /* An address space identifier. */
+ C_ID_ADDRSPACE,
/* Not an identifier. */
C_ID_NONE
} c_id_kind;
@@ -226,6 +232,13 @@ c_lex_one_token (c_parser *parser, c_token *token)
"identifier %qE conflicts with C++ keyword",
token->value);
}
+ else if (rid_code >= RID_FIRST_ADDR_SPACE
+ && rid_code <= RID_LAST_ADDR_SPACE)
+ {
+ token->id_kind = C_ID_ADDRSPACE;
+ token->keyword = rid_code;
+ break;
+ }
else if (c_dialect_objc ())
{
if (!objc_is_reserved_word (token->value)
@@ -352,6 +365,8 @@ c_token_starts_typename (c_token *token)
{
case C_ID_ID:
return false;
+ case C_ID_ADDRSPACE:
+ return true;
case C_ID_TYPENAME:
return true;
case C_ID_CLASSNAME:
@@ -422,6 +437,8 @@ c_token_starts_declspecs (c_token *token)
{
case C_ID_ID:
return false;
+ case C_ID_ADDRSPACE:
+ return true;
case C_ID_TYPENAME:
return true;
case C_ID_CLASSNAME:
@@ -1411,6 +1428,7 @@ c_parser_asm_definition (c_parser *parser)
const
restrict
volatile
+ address-space-qualifier
(restrict is new in C99.)
@@ -1419,6 +1437,12 @@ c_parser_asm_definition (c_parser *parser)
declaration-specifiers:
attributes declaration-specifiers[opt]
+ type-qualifier:
+ address-space
+
+ address-space:
+ identifier recognized by the target
+
storage-class-specifier:
__thread
@@ -1459,6 +1483,17 @@ c_parser_declspecs (c_parser *parser, struct c_declspecs *specs,
{
tree value = c_parser_peek_token (parser)->value;
c_id_kind kind = c_parser_peek_token (parser)->id_kind;
+
+ if (kind == C_ID_ADDRSPACE)
+ {
+ addr_space_t as
+ = c_parser_peek_token (parser)->keyword - RID_FIRST_ADDR_SPACE;
+ declspecs_add_addrspace (specs, as);
+ c_parser_consume_token (parser);
+ attrs_ok = true;
+ continue;
+ }
+
/* This finishes the specifiers unless a type name is OK, it
is declared as a type name and a type name hasn't yet
been seen. */
@@ -5349,6 +5384,7 @@ c_parser_postfix_expression (c_parser *parser)
case CPP_STRING16:
case CPP_STRING32:
case CPP_WSTRING:
+ case CPP_UTF8STRING:
expr.value = c_parser_peek_token (parser)->value;
expr.original_code = STRING_CST;
c_parser_consume_token (parser);
@@ -5774,6 +5810,14 @@ c_parser_postfix_expression_after_paren_type (c_parser *parser,
finish_init ();
maybe_warn_string_init (type, init);
+ if (type != error_mark_node
+ && !ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (type))
+ && current_function_decl)
+ {
+ error ("compound literal qualified by address-space qualifier");
+ type = error_mark_node;
+ }
+
if (!flag_isoc99)
pedwarn (start_loc, OPT_pedantic, "ISO C90 forbids compound literals");
non_const = ((init.value && TREE_CODE (init.value) == CONSTRUCTOR)
diff --git a/gcc/c-ppoutput.c b/gcc/c-ppoutput.c
index ff3e6b6c843..bd9af2aa0f6 100644
--- a/gcc/c-ppoutput.c
+++ b/gcc/c-ppoutput.c
@@ -61,6 +61,8 @@ static void dump_queued_macros (cpp_reader *);
static void print_line (source_location, const char *);
static void maybe_print_line (source_location);
+static void do_line_change (cpp_reader *, const cpp_token *,
+ source_location, int);
/* Callback routines for the parser. Most of these are active only
in specific modes. */
@@ -160,11 +162,16 @@ static void
scan_translation_unit (cpp_reader *pfile)
{
bool avoid_paste = false;
+ bool do_line_adjustments
+ = cpp_get_options (parse_in)->lang != CLK_ASM
+ && !flag_no_line_commands;
+ bool in_pragma = false;
print.source = NULL;
for (;;)
{
- const cpp_token *token = cpp_get_token (pfile);
+ source_location loc;
+ const cpp_token *token = cpp_get_token_with_location (pfile, &loc);
if (token->type == CPP_PADDING)
{
@@ -182,16 +189,38 @@ scan_translation_unit (cpp_reader *pfile)
/* Subtle logic to output a space if and only if necessary. */
if (avoid_paste)
{
+ const struct line_map *map
+ = linemap_lookup (line_table, loc);
+ int src_line = SOURCE_LINE (map, loc);
+
if (print.source == NULL)
print.source = token;
- if (print.source->flags & PREV_WHITE
- || (print.prev
- && cpp_avoid_paste (pfile, print.prev, token))
- || (print.prev == NULL && token->type == CPP_HASH))
+
+ if (src_line != print.src_line
+ && do_line_adjustments
+ && !in_pragma)
+ {
+ do_line_change (pfile, token, loc, false);
+ putc (' ', print.outf);
+ }
+ else if (print.source->flags & PREV_WHITE
+ || (print.prev
+ && cpp_avoid_paste (pfile, print.prev, token))
+ || (print.prev == NULL && token->type == CPP_HASH))
putc (' ', print.outf);
}
else if (token->flags & PREV_WHITE)
- putc (' ', print.outf);
+ {
+ const struct line_map *map
+ = linemap_lookup (line_table, loc);
+ int src_line = SOURCE_LINE (map, loc);
+
+ if (src_line != print.src_line
+ && do_line_adjustments
+ && !in_pragma)
+ do_line_change (pfile, token, loc, false);
+ putc (' ', print.outf);
+ }
avoid_paste = false;
print.source = NULL;
@@ -209,9 +238,13 @@ scan_translation_unit (cpp_reader *pfile)
else
fprintf (print.outf, "%s", name);
print.printed = 1;
+ in_pragma = true;
}
else if (token->type == CPP_PRAGMA_EOL)
- maybe_print_line (token->src_loc);
+ {
+ maybe_print_line (token->src_loc);
+ in_pragma = false;
+ }
else
cpp_output_token (token, print.outf);
@@ -331,14 +364,11 @@ print_line (source_location src_loc, const char *special_flags)
}
}
-/* Called when a line of output is started. TOKEN is the first token
- of the line, and at end of file will be CPP_EOF. */
+/* Helper function for cb_line_change and scan_translation_unit. */
static void
-cb_line_change (cpp_reader *pfile, const cpp_token *token,
- int parsing_args)
+do_line_change (cpp_reader *pfile, const cpp_token *token,
+ source_location src_loc, int parsing_args)
{
- source_location src_loc = token->src_loc;
-
if (define_queue || undef_queue)
dump_queued_macros (pfile);
@@ -365,6 +395,15 @@ cb_line_change (cpp_reader *pfile, const cpp_token *token,
}
}
+/* Called when a line of output is started. TOKEN is the first token
+ of the line, and at end of file will be CPP_EOF. */
+static void
+cb_line_change (cpp_reader *pfile, const cpp_token *token,
+ int parsing_args)
+{
+ do_line_change (pfile, token, token->src_loc, parsing_args);
+}
+
static void
cb_ident (cpp_reader *pfile ATTRIBUTE_UNUSED, source_location line,
const cpp_string *str)
diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c
index b707d165944..f71399fa93e 100644
--- a/gcc/c-pragma.c
+++ b/gcc/c-pragma.c
@@ -37,6 +37,7 @@ along with GCC; see the file COPYING3. If not see
#include "target.h"
#include "diagnostic.h"
#include "opts.h"
+#include "plugin.h"
#define GCC_BAD(gmsgid) \
do { warning (OPT_Wpragmas, gmsgid); return; } while (0)
@@ -723,19 +724,20 @@ maybe_apply_renaming_pragma (tree decl, tree asmname)
#ifdef HANDLE_PRAGMA_VISIBILITY
static void handle_pragma_visibility (cpp_reader *);
-typedef enum symbol_visibility visibility;
-DEF_VEC_I (visibility);
-DEF_VEC_ALLOC_I (visibility, heap);
-static VEC (visibility, heap) *visstack;
+static VEC (int, heap) *visstack;
/* Push the visibility indicated by STR onto the top of the #pragma
- visibility stack. */
+ visibility stack. KIND is 0 for #pragma GCC visibility, 1 for
+ C++ namespace with visibility attribute and 2 for C++ builtin
+ ABI namespace. push_visibility/pop_visibility calls must have
+ matching KIND, it is not allowed to push visibility using one
+ KIND and pop using a different one. */
void
-push_visibility (const char *str)
+push_visibility (const char *str, int kind)
{
- VEC_safe_push (visibility, heap, visstack,
- default_visibility);
+ VEC_safe_push (int, heap, visstack,
+ ((int) default_visibility) | (kind << 8));
if (!strcmp (str, "default"))
default_visibility = VISIBILITY_DEFAULT;
else if (!strcmp (str, "internal"))
@@ -749,14 +751,21 @@ push_visibility (const char *str)
visibility_options.inpragma = 1;
}
-/* Pop a level of the #pragma visibility stack. */
+/* Pop a level of the #pragma visibility stack. Return true if
+ successful. */
-void
-pop_visibility (void)
+bool
+pop_visibility (int kind)
{
- default_visibility = VEC_pop (visibility, visstack);
+ if (!VEC_length (int, visstack))
+ return false;
+ if ((VEC_last (int, visstack) >> 8) != kind)
+ return false;
+ default_visibility
+ = (enum symbol_visibility) (VEC_pop (int, visstack) & 0xff);
visibility_options.inpragma
- = VEC_length (visibility, visstack) != 0;
+ = VEC_length (int, visstack) != 0;
+ return true;
}
/* Sets the default visibility for symbols to something other than that
@@ -785,10 +794,8 @@ handle_pragma_visibility (cpp_reader *dummy ATTRIBUTE_UNUSED)
{
if (pop == action)
{
- if (!VEC_length (visibility, visstack))
+ if (! pop_visibility (0))
GCC_BAD ("no matching push for %<#pragma GCC visibility pop%>");
- else
- pop_visibility ();
}
else
{
@@ -798,7 +805,7 @@ handle_pragma_visibility (cpp_reader *dummy ATTRIBUTE_UNUSED)
if (token != CPP_NAME)
GCC_BAD ("malformed #pragma GCC visibility push");
else
- push_visibility (IDENTIFIER_POINTER (x));
+ push_visibility (IDENTIFIER_POINTER (x), 0);
if (pragma_lex (&x) != CPP_CLOSE_PAREN)
GCC_BAD ("missing %<(%> after %<#pragma GCC visibility push%> - ignored");
}
@@ -1444,6 +1451,9 @@ init_pragma (void)
#ifdef REGISTER_TARGET_PRAGMAS
REGISTER_TARGET_PRAGMAS ();
#endif
+
+ /* Allow plugins to register their own pragmas. */
+ invoke_plugin_callbacks (PLUGIN_PRAGMAS, NULL);
}
#include "gt-c-pragma.h"
diff --git a/gcc/c-pragma.h b/gcc/c-pragma.h
index 188afb8dbaa..eab23db6cd9 100644
--- a/gcc/c-pragma.h
+++ b/gcc/c-pragma.h
@@ -95,8 +95,8 @@ extern struct cpp_reader* parse_in;
visibility is not supported on the host OS platform the
statements are ignored. */
#define HANDLE_PRAGMA_VISIBILITY 1
-extern void push_visibility (const char *);
-extern void pop_visibility (void);
+extern void push_visibility (const char *, int);
+extern bool pop_visibility (int);
extern void init_pragma (void);
@@ -118,9 +118,9 @@ extern enum cpp_ttype pragma_lex (tree *);
so that 0 means to translate and join strings. */
#define C_LEX_STRING_NO_TRANSLATE 1 /* Do not lex strings into
execution character set. */
-#define C_LEX_RAW_STRINGS 2 /* Return raw strings -- no
- concatenation, no
- translation. */
+#define C_LEX_STRING_NO_JOIN 2 /* Do not concatenate strings
+ nor translate them into execution
+ character set. */
/* This is not actually available to pragma parsers. It's merely a
convenient location to declare this function for c-lex, after
diff --git a/gcc/c-pretty-print.c b/gcc/c-pretty-print.c
index c4e6e96c296..01770014c21 100644
--- a/gcc/c-pretty-print.c
+++ b/gcc/c-pretty-print.c
@@ -225,7 +225,11 @@ pp_c_space_for_pointer_operator (c_pretty_printer *pp, tree t)
const
restrict -- C99
__restrict__ -- GNU C
- volatile */
+ address-space-qualifier -- GNU C
+ volatile
+
+ address-space-qualifier:
+ identifier -- GNU C */
void
pp_c_type_qualifier_list (c_pretty_printer *pp, tree t)
@@ -245,6 +249,12 @@ pp_c_type_qualifier_list (c_pretty_printer *pp, tree t)
pp_c_cv_qualifier (pp, "volatile");
if (qualifiers & TYPE_QUAL_RESTRICT)
pp_c_cv_qualifier (pp, flag_isoc99 ? "restrict" : "__restrict__");
+
+ if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (t)))
+ {
+ const char *as = c_addr_space_name (TYPE_ADDR_SPACE (t));
+ pp_c_identifier (pp, as);
+ }
}
/* pointer:
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index c7490e461a3..e71771ae840 100644
--- a/gcc/c-tree.h
+++ b/gcc/c-tree.h
@@ -277,6 +277,8 @@ struct c_declspecs {
BOOL_BITFIELD restrict_p : 1;
/* Whether "_Sat" was specified. */
BOOL_BITFIELD saturating_p : 1;
+ /* The address space that the declaration belongs to. */
+ addr_space_t address_space;
};
/* The various kinds of declarators in C. */
@@ -476,6 +478,8 @@ extern struct c_declspecs *declspecs_add_type (location_t,
struct c_typespec);
extern struct c_declspecs *declspecs_add_scspec (struct c_declspecs *, tree);
extern struct c_declspecs *declspecs_add_attrs (struct c_declspecs *, tree);
+extern struct c_declspecs *declspecs_add_addrspace (struct c_declspecs *,
+ addr_space_t);
extern struct c_declspecs *finish_declspecs (struct c_declspecs *);
/* in c-objc-common.c */
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 4c55e587de3..9b1f09c4593 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -284,14 +284,55 @@ c_type_promotes_to (tree type)
return type;
}
+/* Return true if between two named address spaces, whether there is a superset
+ named address space that encompasses both address spaces. If there is a
+ superset, return which address space is the superset. */
+
+static bool
+addr_space_superset (addr_space_t as1, addr_space_t as2, addr_space_t *common)
+{
+ if (as1 == as2)
+ {
+ *common = as1;
+ return true;
+ }
+ else if (targetm.addr_space.subset_p (as1, as2))
+ {
+ *common = as2;
+ return true;
+ }
+ else if (targetm.addr_space.subset_p (as2, as1))
+ {
+ *common = as1;
+ return true;
+ }
+ else
+ return false;
+}
+
/* Return a variant of TYPE which has all the type qualifiers of LIKE
as well as those of TYPE. */
static tree
qualify_type (tree type, tree like)
{
+ addr_space_t as_type = TYPE_ADDR_SPACE (type);
+ addr_space_t as_like = TYPE_ADDR_SPACE (like);
+ addr_space_t as_common;
+
+ /* If the two named address spaces are different, determine the common
+ superset address space. If there isn't one, raise an error. */
+ if (!addr_space_superset (as_type, as_like, &as_common))
+ {
+ as_common = as_type;
+ error ("%qT and %qT are in disjoint named address spaces",
+ type, like);
+ }
+
return c_build_qualified_type (type,
- TYPE_QUALS (type) | TYPE_QUALS (like));
+ TYPE_QUALS_NO_ADDR_SPACE (type)
+ | TYPE_QUALS_NO_ADDR_SPACE (like)
+ | ENCODE_QUAL_ADDR_SPACE (as_common));
}
/* Return true iff the given tree T is a variable length array. */
@@ -371,7 +412,8 @@ composite_type (tree t1, tree t2)
bool t1_complete, t2_complete;
/* We should not have any type quals on arrays at all. */
- gcc_assert (!TYPE_QUALS (t1) && !TYPE_QUALS (t2));
+ gcc_assert (!TYPE_QUALS_NO_ADDR_SPACE (t1)
+ && !TYPE_QUALS_NO_ADDR_SPACE (t2));
t1_complete = COMPLETE_TYPE_P (t1);
t2_complete = COMPLETE_TYPE_P (t2);
@@ -585,6 +627,8 @@ common_pointer_type (tree t1, tree t2)
tree pointed_to_2, mv2;
tree target;
unsigned target_quals;
+ addr_space_t as1, as2, as_common;
+ int quals1, quals2;
/* Save time if the two types are the same. */
@@ -616,10 +660,24 @@ common_pointer_type (tree t1, tree t2)
/* For function types do not merge const qualifiers, but drop them
if used inconsistently. The middle-end uses these to mark const
and noreturn functions. */
+ quals1 = TYPE_QUALS_NO_ADDR_SPACE (pointed_to_1);
+ quals2 = TYPE_QUALS_NO_ADDR_SPACE (pointed_to_2);
+
if (TREE_CODE (pointed_to_1) == FUNCTION_TYPE)
- target_quals = TYPE_QUALS (pointed_to_1) & TYPE_QUALS (pointed_to_2);
+ target_quals = (quals1 & quals2);
else
- target_quals = TYPE_QUALS (pointed_to_1) | TYPE_QUALS (pointed_to_2);
+ target_quals = (quals1 | quals2);
+
+ /* If the two named address spaces are different, determine the common
+ superset address space. This is guaranteed to exist due to the
+ assumption that comp_target_type returned non-zero. */
+ as1 = TYPE_ADDR_SPACE (pointed_to_1);
+ as2 = TYPE_ADDR_SPACE (pointed_to_2);
+ if (!addr_space_superset (as1, as2, &as_common))
+ gcc_unreachable ();
+
+ target_quals |= ENCODE_QUAL_ADDR_SPACE (as_common);
+
t1 = build_pointer_type (c_build_qualified_type (target, target_quals));
return build_type_attribute_variant (t1, attributes);
}
@@ -1103,20 +1161,28 @@ comptypes_internal (const_tree type1, const_tree type2, bool *enum_and_int_p)
return attrval == 2 && val == 1 ? 2 : val;
}
-/* Return 1 if TTL and TTR are pointers to types that are equivalent,
- ignoring their qualifiers. */
+/* Return 1 if TTL and TTR are pointers to types that are equivalent, ignoring
+ their qualifiers, except for named address spaces. If the pointers point to
+ different named addresses, then we must determine if one address space is a
+ subset of the other. */
static int
comp_target_types (location_t location, tree ttl, tree ttr)
{
int val;
- tree mvl, mvr;
+ tree mvl = TREE_TYPE (ttl);
+ tree mvr = TREE_TYPE (ttr);
+ addr_space_t asl = TYPE_ADDR_SPACE (mvl);
+ addr_space_t asr = TYPE_ADDR_SPACE (mvr);
+ addr_space_t as_common;
bool enum_and_int_p;
+ /* Fail if pointers point to incompatible address spaces. */
+ if (!addr_space_superset (asl, asr, &as_common))
+ return 0;
+
/* Do not lose qualifiers on element types of array types that are
pointer targets by taking their TYPE_MAIN_VARIANT. */
- mvl = TREE_TYPE (ttl);
- mvr = TREE_TYPE (ttr);
if (TREE_CODE (mvl) != ARRAY_TYPE)
mvl = TYPE_MAIN_VARIANT (mvl);
if (TREE_CODE (mvr) != ARRAY_TYPE)
@@ -2673,6 +2739,7 @@ convert_arguments (tree typelist, VEC(tree,gc) *values,
{
tree typetail, val;
unsigned int parmnum;
+ bool error_args = false;
const bool type_generic = fundecl
&& lookup_attribute ("type generic", TYPE_ATTRIBUTES(TREE_TYPE (fundecl)));
bool type_generic_remove_excess_precision = false;
@@ -2942,6 +3009,8 @@ convert_arguments (tree typelist, VEC(tree,gc) *values,
parmval = default_conversion (val);
VEC_replace (tree, values, parmnum, parmval);
+ if (parmval == error_mark_node)
+ error_args = true;
if (typetail)
typetail = TREE_CHAIN (typetail);
@@ -2955,7 +3024,7 @@ convert_arguments (tree typelist, VEC(tree,gc) *values,
return -1;
}
- return parmnum;
+ return error_args ? -1 : (int) parmnum;
}
/* This is the entry point used by the parser to build unary operators
@@ -3063,11 +3132,43 @@ static tree
pointer_diff (location_t loc, tree op0, tree op1)
{
tree restype = ptrdiff_type_node;
+ tree result, inttype;
+ addr_space_t as0 = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (op0)));
+ addr_space_t as1 = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (op1)));
tree target_type = TREE_TYPE (TREE_TYPE (op0));
tree con0, con1, lit0, lit1;
tree orig_op1 = op1;
+ /* If the operands point into different address spaces, we need to
+ explicitly convert them to pointers into the common address space
+ before we can subtract the numerical address values. */
+ if (as0 != as1)
+ {
+ addr_space_t as_common;
+ tree common_type;
+
+ /* Determine the common superset address space. This is guaranteed
+ to exist because the caller verified that comp_target_types
+ returned non-zero. */
+ if (!addr_space_superset (as0, as1, &as_common))
+ gcc_unreachable ();
+
+ common_type = common_pointer_type (TREE_TYPE (op0), TREE_TYPE (op1));
+ op0 = convert (common_type, op0);
+ op1 = convert (common_type, op1);
+ }
+
+ /* Determine integer type to perform computations in. This will usually
+ be the same as the result type (ptrdiff_t), but may need to be a wider
+ type if pointers for the address space are wider than ptrdiff_t. */
+ if (TYPE_PRECISION (restype) < TYPE_PRECISION (TREE_TYPE (op0)))
+ inttype = lang_hooks.types.type_for_size
+ (TYPE_PRECISION (TREE_TYPE (op0)), 0);
+ else
+ inttype = restype;
+
+
if (TREE_CODE (target_type) == VOID_TYPE)
pedwarn (loc, pedantic ? OPT_pedantic : OPT_Wpointer_arith,
"pointer of type %<void *%> used in subtraction");
@@ -3125,8 +3226,8 @@ pointer_diff (location_t loc, tree op0, tree op1)
in case restype is a short type. */
op0 = build_binary_op (loc,
- MINUS_EXPR, convert (restype, op0),
- convert (restype, op1), 0);
+ MINUS_EXPR, convert (inttype, op0),
+ convert (inttype, op1), 0);
/* This generates an error if op1 is pointer to incomplete type. */
if (!COMPLETE_OR_VOID_TYPE_P (TREE_TYPE (TREE_TYPE (orig_op1))))
error_at (loc, "arithmetic on pointer to an incomplete type");
@@ -3135,8 +3236,11 @@ pointer_diff (location_t loc, tree op0, tree op1)
op1 = c_size_in_bytes (target_type);
/* Divide by the size, in easiest possible way. */
- return fold_build2_loc (loc, EXACT_DIV_EXPR, restype,
- op0, convert (restype, op1));
+ result = fold_build2_loc (loc, EXACT_DIV_EXPR, inttype,
+ op0, convert (inttype, op1));
+
+ /* Convert to final result type if necessary. */
+ return convert (restype, result);
}
/* Construct and perhaps optimize a tree representation
@@ -3940,17 +4044,9 @@ build_conditional_expr (location_t colon_loc, tree ifexp, bool ifexp_bcp,
"conditional expression"));
}
if (!op1_maybe_const || TREE_CODE (op1) != INTEGER_CST)
- {
- op1 = build2 (C_MAYBE_CONST_EXPR, TREE_TYPE (op1),
- NULL, op1);
- C_MAYBE_CONST_EXPR_NON_CONST (op1) = !op1_maybe_const;
- }
+ op1 = c_wrap_maybe_const (op1, !op1_maybe_const);
if (!op2_maybe_const || TREE_CODE (op2) != INTEGER_CST)
- {
- op2 = build2 (C_MAYBE_CONST_EXPR, TREE_TYPE (op2),
- NULL, op2);
- C_MAYBE_CONST_EXPR_NON_CONST (op2) = !op2_maybe_const;
- }
+ op2 = c_wrap_maybe_const (op2, !op2_maybe_const);
}
}
}
@@ -3964,12 +4060,22 @@ build_conditional_expr (location_t colon_loc, tree ifexp, bool ifexp_bcp,
}
else if (code1 == POINTER_TYPE && code2 == POINTER_TYPE)
{
+ addr_space_t as1 = TYPE_ADDR_SPACE (TREE_TYPE (type1));
+ addr_space_t as2 = TYPE_ADDR_SPACE (TREE_TYPE (type2));
+ addr_space_t as_common;
+
if (comp_target_types (colon_loc, type1, type2))
result_type = common_pointer_type (type1, type2);
else if (null_pointer_constant_p (orig_op1))
- result_type = qualify_type (type2, type1);
+ result_type = type2;
else if (null_pointer_constant_p (orig_op2))
- result_type = qualify_type (type1, type2);
+ result_type = type1;
+ else if (!addr_space_superset (as1, as2, &as_common))
+ {
+ error_at (colon_loc, "pointers to disjoint address spaces "
+ "used in conditional expression");
+ return error_mark_node;
+ }
else if (VOID_TYPE_P (TREE_TYPE (type1)))
{
if (TREE_CODE (TREE_TYPE (type2)) == FUNCTION_TYPE)
@@ -3990,10 +4096,13 @@ build_conditional_expr (location_t colon_loc, tree ifexp, bool ifexp_bcp,
}
else
{
+ int qual = ENCODE_QUAL_ADDR_SPACE (as_common);
+
if (!objc_ok)
pedwarn (colon_loc, 0,
"pointer type mismatch in conditional expression");
- result_type = build_pointer_type (void_type_node);
+ result_type = build_pointer_type
+ (build_qualified_type (void_type_node, qual));
}
}
else if (code1 == POINTER_TYPE && code2 == INTEGER_TYPE)
@@ -4152,7 +4261,8 @@ build_compound_expr (location_t loc, tree expr1, tree expr2)
/* Issue -Wcast-qual warnings when appropriate. TYPE is the type to
which we are casting. OTYPE is the type of the expression being
cast. Both TYPE and OTYPE are pointer types. -Wcast-qual appeared
- on the command line. */
+ on the command line. Named address space qualifiers are not handled
+ here, because they result in different warnings. */
static void
handle_warn_cast_qual (tree type, tree otype)
@@ -4178,9 +4288,11 @@ handle_warn_cast_qual (tree type, tree otype)
taken away. */
if (TREE_CODE (in_otype) == FUNCTION_TYPE
&& TREE_CODE (in_type) == FUNCTION_TYPE)
- added |= (TYPE_QUALS (in_type) & ~TYPE_QUALS (in_otype));
+ added |= (TYPE_QUALS_NO_ADDR_SPACE (in_type)
+ & ~TYPE_QUALS_NO_ADDR_SPACE (in_otype));
else
- discarded |= (TYPE_QUALS (in_otype) & ~TYPE_QUALS (in_type));
+ discarded |= (TYPE_QUALS_NO_ADDR_SPACE (in_otype)
+ & ~TYPE_QUALS_NO_ADDR_SPACE (in_type));
}
while (TREE_CODE (in_type) == POINTER_TYPE
&& TREE_CODE (in_otype) == POINTER_TYPE);
@@ -4329,6 +4441,36 @@ build_c_cast (location_t loc, tree type, tree expr)
&& TREE_CODE (otype) == POINTER_TYPE)
handle_warn_cast_qual (type, otype);
+ /* Warn about conversions between pointers to disjoint
+ address spaces. */
+ if (TREE_CODE (type) == POINTER_TYPE
+ && TREE_CODE (otype) == POINTER_TYPE
+ && !null_pointer_constant_p (value))
+ {
+ addr_space_t as_to = TYPE_ADDR_SPACE (TREE_TYPE (type));
+ addr_space_t as_from = TYPE_ADDR_SPACE (TREE_TYPE (otype));
+ addr_space_t as_common;
+
+ if (!addr_space_superset (as_to, as_from, &as_common))
+ {
+ if (ADDR_SPACE_GENERIC_P (as_from))
+ warning_at (loc, 0, "cast to %s address space pointer "
+ "from disjoint generic address space pointer",
+ c_addr_space_name (as_to));
+
+ else if (ADDR_SPACE_GENERIC_P (as_to))
+ warning_at (loc, 0, "cast to generic address space pointer "
+ "from disjoint %s address space pointer",
+ c_addr_space_name (as_from));
+
+ else
+ warning_at (loc, 0, "cast to %s address space pointer "
+ "from disjoint %s address space pointer",
+ c_addr_space_name (as_to),
+ c_addr_space_name (as_from));
+ }
+ }
+
/* Warn about possible alignment problems. */
if (STRICT_ALIGNMENT
&& TREE_CODE (type) == POINTER_TYPE
@@ -4923,7 +5065,8 @@ convert_for_assignment (location_t location, tree type, tree rhs,
certain things, it is okay to use a const or volatile
function where an ordinary one is wanted, but not
vice-versa. */
- if (TYPE_QUALS (ttl) & ~TYPE_QUALS (ttr))
+ if (TYPE_QUALS_NO_ADDR_SPACE (ttl)
+ & ~TYPE_QUALS_NO_ADDR_SPACE (ttr))
WARN_FOR_ASSIGNMENT (location, 0,
G_("passing argument %d of %qE "
"makes qualified function "
@@ -4937,7 +5080,8 @@ convert_for_assignment (location_t location, tree type, tree rhs,
G_("return makes qualified function "
"pointer from unqualified"));
}
- else if (TYPE_QUALS (ttr) & ~TYPE_QUALS (ttl))
+ else if (TYPE_QUALS_NO_ADDR_SPACE (ttr)
+ & ~TYPE_QUALS_NO_ADDR_SPACE (ttl))
WARN_FOR_ASSIGNMENT (location, 0,
G_("passing argument %d of %qE discards "
"qualifiers from pointer target type"),
@@ -4970,6 +5114,8 @@ convert_for_assignment (location_t location, tree type, tree rhs,
tree mvr = ttr;
bool is_opaque_pointer;
int target_cmp = 0; /* Cache comp_target_types () result. */
+ addr_space_t asl;
+ addr_space_t asr;
if (TREE_CODE (mvl) != ARRAY_TYPE)
mvl = TYPE_MAIN_VARIANT (mvl);
@@ -4990,6 +5136,36 @@ convert_for_assignment (location_t location, tree type, tree rhs,
"request for implicit conversion "
"from %qT to %qT not permitted in C++", rhstype, type);
+ /* See if the pointers point to incompatible address spaces. */
+ asl = TYPE_ADDR_SPACE (ttl);
+ asr = TYPE_ADDR_SPACE (ttr);
+ if (!null_pointer_constant_p (rhs)
+ && asr != asl && !targetm.addr_space.subset_p (asr, asl))
+ {
+ switch (errtype)
+ {
+ case ic_argpass:
+ error_at (location, "passing argument %d of %qE from pointer to "
+ "non-enclosed address space", parmnum, rname);
+ break;
+ case ic_assign:
+ error_at (location, "assignment from pointer to "
+ "non-enclosed address space");
+ break;
+ case ic_init:
+ error_at (location, "initialization from pointer to "
+ "non-enclosed address space");
+ break;
+ case ic_return:
+ error_at (location, "return from pointer to "
+ "non-enclosed address space");
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ return error_mark_node;
+ }
+
/* Check if the right-hand side has a format attribute but the
left-hand side doesn't. */
if (warn_missing_format_attribute
@@ -5053,7 +5229,8 @@ convert_for_assignment (location_t location, tree type, tree rhs,
else if (TREE_CODE (ttr) != FUNCTION_TYPE
&& TREE_CODE (ttl) != FUNCTION_TYPE)
{
- if (TYPE_QUALS (ttr) & ~TYPE_QUALS (ttl))
+ if (TYPE_QUALS_NO_ADDR_SPACE (ttr)
+ & ~TYPE_QUALS_NO_ADDR_SPACE (ttl))
{
/* Types differing only by the presence of the 'volatile'
qualifier are acceptable if the 'volatile' has been added
@@ -5093,7 +5270,8 @@ convert_for_assignment (location_t location, tree type, tree rhs,
that say the function will not do certain things,
it is okay to use a const or volatile function
where an ordinary one is wanted, but not vice-versa. */
- if (TYPE_QUALS (ttl) & ~TYPE_QUALS (ttr))
+ if (TYPE_QUALS_NO_ADDR_SPACE (ttl)
+ & ~TYPE_QUALS_NO_ADDR_SPACE (ttr))
WARN_FOR_ASSIGNMENT (location, 0,
G_("passing argument %d of %qE makes "
"qualified function pointer "
@@ -8661,16 +8839,17 @@ c_finish_stmt_expr (location_t loc, tree body)
goto continue_searching;
}
+ if (last == error_mark_node)
+ return last;
+
/* In the case that the BIND_EXPR is not necessary, return the
expression out from inside it. */
- if (last == error_mark_node
- || (last == BIND_EXPR_BODY (body)
- && BIND_EXPR_VARS (body) == NULL))
+ if (last == BIND_EXPR_BODY (body)
+ && BIND_EXPR_VARS (body) == NULL)
{
/* Even if this looks constant, do not allow it in a constant
expression. */
- last = build2 (C_MAYBE_CONST_EXPR, TREE_TYPE (last), NULL_TREE, last);
- C_MAYBE_CONST_EXPR_NON_CONST (last) = 1;
+ last = c_wrap_maybe_const (last, true);
/* Do not warn if the return value of a statement expression is
unused. */
TREE_NO_WARNING (last) = 1;
@@ -9200,24 +9379,34 @@ build_binary_op (location_t location, enum tree_code code,
{
tree tt0 = TREE_TYPE (type0);
tree tt1 = TREE_TYPE (type1);
+ addr_space_t as0 = TYPE_ADDR_SPACE (tt0);
+ addr_space_t as1 = TYPE_ADDR_SPACE (tt1);
+ addr_space_t as_common = ADDR_SPACE_GENERIC;
+
/* Anything compares with void *. void * compares with anything.
Otherwise, the targets must be compatible
and both must be object or both incomplete. */
if (comp_target_types (location, type0, type1))
result_type = common_pointer_type (type0, type1);
+ else if (null_pointer_constant_p (orig_op0))
+ result_type = type1;
+ else if (null_pointer_constant_p (orig_op1))
+ result_type = type0;
+ else if (!addr_space_superset (as0, as1, &as_common))
+ {
+ error_at (location, "comparison of pointers to "
+ "disjoint address spaces");
+ return error_mark_node;
+ }
else if (VOID_TYPE_P (tt0))
{
- /* op0 != orig_op0 detects the case of something
- whose value is 0 but which isn't a valid null ptr const. */
- if (pedantic && !null_pointer_constant_p (orig_op0)
- && TREE_CODE (tt1) == FUNCTION_TYPE)
+ if (pedantic && TREE_CODE (tt1) == FUNCTION_TYPE)
pedwarn (location, OPT_pedantic, "ISO C forbids "
"comparison of %<void *%> with function pointer");
}
else if (VOID_TYPE_P (tt1))
{
- if (pedantic && !null_pointer_constant_p (orig_op1)
- && TREE_CODE (tt0) == FUNCTION_TYPE)
+ if (pedantic && TREE_CODE (tt0) == FUNCTION_TYPE)
pedwarn (location, OPT_pedantic, "ISO C forbids "
"comparison of %<void *%> with function pointer");
}
@@ -9228,7 +9417,11 @@ build_binary_op (location_t location, enum tree_code code,
"comparison of distinct pointer types lacks a cast");
if (result_type == NULL_TREE)
- result_type = ptr_type_node;
+ {
+ int qual = ENCODE_QUAL_ADDR_SPACE (as_common);
+ result_type = build_pointer_type
+ (build_qualified_type (void_type_node, qual));
+ }
}
else if (code0 == POINTER_TYPE && null_pointer_constant_p (orig_op1))
{
@@ -9272,6 +9465,10 @@ build_binary_op (location_t location, enum tree_code code,
short_compare = 1;
else if (code0 == POINTER_TYPE && code1 == POINTER_TYPE)
{
+ addr_space_t as0 = TYPE_ADDR_SPACE (TREE_TYPE (type0));
+ addr_space_t as1 = TYPE_ADDR_SPACE (TREE_TYPE (type1));
+ addr_space_t as_common;
+
if (comp_target_types (location, type0, type1))
{
result_type = common_pointer_type (type0, type1);
@@ -9283,9 +9480,17 @@ build_binary_op (location_t location, enum tree_code code,
pedwarn (location, OPT_pedantic, "ISO C forbids "
"ordered comparisons of pointers to functions");
}
+ else if (!addr_space_superset (as0, as1, &as_common))
+ {
+ error_at (location, "comparison of pointers to "
+ "disjoint address spaces");
+ return error_mark_node;
+ }
else
{
- result_type = ptr_type_node;
+ int qual = ENCODE_QUAL_ADDR_SPACE (as_common);
+ result_type = build_pointer_type
+ (build_qualified_type (void_type_node, qual));
pedwarn (location, 0,
"comparison of distinct pointer types lacks a cast");
}
@@ -9545,17 +9750,9 @@ build_binary_op (location_t location, enum tree_code code,
if (!in_late_binary_op)
{
if (!op0_maybe_const || TREE_CODE (op0) != INTEGER_CST)
- {
- op0 = build2 (C_MAYBE_CONST_EXPR, TREE_TYPE (op0),
- NULL, op0);
- C_MAYBE_CONST_EXPR_NON_CONST (op0) = !op0_maybe_const;
- }
+ op0 = c_wrap_maybe_const (op0, !op0_maybe_const);
if (!op1_maybe_const || TREE_CODE (op1) != INTEGER_CST)
- {
- op1 = build2 (C_MAYBE_CONST_EXPR, TREE_TYPE (op1),
- NULL, op1);
- C_MAYBE_CONST_EXPR_NON_CONST (op1) = !op1_maybe_const;
- }
+ op1 = c_wrap_maybe_const (op1, !op1_maybe_const);
}
}
}
diff --git a/gcc/c.opt b/gcc/c.opt
index 21f7ab71246..429c035f38f 100644
--- a/gcc/c.opt
+++ b/gcc/c.opt
@@ -113,11 +113,11 @@ C ObjC C++ ObjC++ Joined Separate
-U<macro> Undefine <macro>
Wabi
-C ObjC C++ ObjC++ Var(warn_abi) Warning
+C ObjC C++ ObjC++ LTO Var(warn_abi) Warning
Warn about things that will change when compiling with an ABI-compliant compiler
Wpsabi
-C ObjC C++ ObjC++ Var(warn_psabi) Init(1) Undocumented
+C ObjC C++ ObjC++ LTO Var(warn_psabi) Init(1) Undocumented
Waddress
C ObjC C++ ObjC++ Var(warn_address) Warning
@@ -285,7 +285,7 @@ C ObjC C++ ObjC++ Warning
Warn about PCH files that are found but not used
Wjump-misses-init
-C Objc Var(warn_jump_misses_init) Init(-1) Warning
+C ObjC Var(warn_jump_misses_init) Init(-1) Warning
Warn when a jump misses a variable initialization
Wlogical-op
diff --git a/gcc/calls.c b/gcc/calls.c
index f28fb513ce2..13167a620a4 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -39,6 +39,7 @@ along with GCC; see the file COPYING3. If not see
#include "sbitmap.h"
#include "langhooks.h"
#include "target.h"
+#include "debug.h"
#include "cgraph.h"
#include "except.h"
#include "dbgcnt.h"
@@ -394,6 +395,11 @@ emit_call_1 (rtx funexp, tree fntree ATTRIBUTE_UNUSED, tree fndecl ATTRIBUTE_UNU
SIBLING_CALL_P (call_insn) = ((ecf_flags & ECF_SIBCALL) != 0);
+ /* Record debug information for virtual calls. */
+ if (flag_enable_icf_debug && fndecl == NULL)
+ (*debug_hooks->virtual_call_token) (CALL_EXPR_FN (fntree),
+ INSN_UID (call_insn));
+
/* Restore this now, so that we do defer pops for this call's args
if the context of the call as a whole permits. */
inhibit_defer_pop = old_inhibit_defer_pop;
@@ -3014,7 +3020,10 @@ expand_call (tree exp, rtx target, int ignore)
}
else if (TYPE_MODE (rettype) == BLKmode)
{
- target = copy_blkmode_from_reg (target, valreg, rettype);
+ rtx val = valreg;
+ if (GET_MODE (val) != BLKmode)
+ val = avoid_likely_spilled_reg (val);
+ target = copy_blkmode_from_reg (target, val, rettype);
/* We can not support sibling calls for this case. */
sibcall_failure = 1;
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index cfb19b60275..ffe36e45a9e 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -958,7 +958,7 @@ old_insns_match_p (int mode ATTRIBUTE_UNUSED, rtx i1, rtx i2)
if (NOTE_INSN_BASIC_BLOCK_P (i1) && NOTE_INSN_BASIC_BLOCK_P (i2))
return true;
- p1 = PATTERN (i1);
+ p1 = PATTERN (i1);
p2 = PATTERN (i2);
if (GET_CODE (p1) != GET_CODE (p2))
@@ -1814,6 +1814,24 @@ try_crossjump_bb (int mode, basic_block bb)
return changed;
}
+/* Return true if BB contains just bb note, or bb note followed
+ by only DEBUG_INSNs. */
+
+static bool
+trivially_empty_bb_p (basic_block bb)
+{
+ rtx insn = BB_END (bb);
+
+ while (1)
+ {
+ if (insn == BB_HEAD (bb))
+ return true;
+ if (!DEBUG_INSN_P (insn))
+ return false;
+ insn = PREV_INSN (insn);
+ }
+}
+
/* Do simple CFG optimizations - basic block merging, simplifying of jump
instructions etc. Return nonzero if changes were made. */
@@ -1865,14 +1883,10 @@ try_optimize_cfg (int mode)
__builtin_unreachable (). */
if (EDGE_COUNT (b->preds) == 0
|| (EDGE_COUNT (b->succs) == 0
- && BB_HEAD (b) == BB_END (b)
+ && trivially_empty_bb_p (b)
&& single_succ_edge (ENTRY_BLOCK_PTR)->dest != b))
{
c = b->prev_bb;
- if (dump_file)
- fprintf (dump_file, "Deleting block %i.\n",
- b->index);
-
delete_basic_block (b);
if (!(mode & CLEANUP_CFGLAYOUT))
changed = true;
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 2117ee3bc52..cfb4d17dc20 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -1768,10 +1768,10 @@ expand_call_stmt (gimple stmt)
for (i = 0; i < gimple_call_num_args (stmt); i++)
CALL_EXPR_ARG (exp, i) = gimple_call_arg (stmt, i);
- if (!(gimple_call_flags (stmt) & (ECF_CONST | ECF_PURE)))
+ if (gimple_has_side_effects (stmt))
TREE_SIDE_EFFECTS (exp) = 1;
- if (gimple_call_flags (stmt) & ECF_NOTHROW)
+ if (gimple_call_nothrow_p (stmt))
TREE_NOTHROW (exp) = 1;
CALL_EXPR_TAILCALL (exp) = gimple_call_tail_p (stmt);
@@ -2194,46 +2194,6 @@ round_udiv_adjust (enum machine_mode mode, rtx mod, rtx op1)
const1_rtx, const0_rtx);
}
-/* Wrap modeless constants in CONST:MODE. */
-rtx
-wrap_constant (enum machine_mode mode, rtx x)
-{
- if (GET_MODE (x) != VOIDmode)
- return x;
-
- if (CONST_INT_P (x)
- || GET_CODE (x) == CONST_FIXED
- || GET_CODE (x) == CONST_DOUBLE
- || GET_CODE (x) == LABEL_REF)
- {
- gcc_assert (mode != VOIDmode);
-
- x = gen_rtx_CONST (mode, x);
- }
-
- return x;
-}
-
-/* Remove CONST wrapper added by wrap_constant(). */
-rtx
-unwrap_constant (rtx x)
-{
- rtx ret = x;
-
- if (GET_CODE (x) != CONST)
- return x;
-
- x = XEXP (x, 0);
-
- if (CONST_INT_P (x)
- || GET_CODE (x) == CONST_FIXED
- || GET_CODE (x) == CONST_DOUBLE
- || GET_CODE (x) == LABEL_REF)
- ret = x;
-
- return ret;
-}
-
/* Convert X to MODE, that must be Pmode or ptr_mode, without emitting
any rtl. */
@@ -2275,6 +2235,9 @@ expand_debug_expr (tree exp)
rtx op0 = NULL_RTX, op1 = NULL_RTX, op2 = NULL_RTX;
enum machine_mode mode = TYPE_MODE (TREE_TYPE (exp));
int unsignedp = TYPE_UNSIGNED (TREE_TYPE (exp));
+ addr_space_t as;
+ enum machine_mode address_mode;
+ enum machine_mode pointer_mode;
switch (TREE_CODE_CLASS (TREE_CODE (exp)))
{
@@ -2356,11 +2319,21 @@ expand_debug_expr (tree exp)
case COMPLEX_CST:
gcc_assert (COMPLEX_MODE_P (mode));
op0 = expand_debug_expr (TREE_REALPART (exp));
- op0 = wrap_constant (GET_MODE_INNER (mode), op0);
op1 = expand_debug_expr (TREE_IMAGPART (exp));
- op1 = wrap_constant (GET_MODE_INNER (mode), op1);
return gen_rtx_CONCAT (mode, op0, op1);
+ case DEBUG_EXPR_DECL:
+ op0 = DECL_RTL_IF_SET (exp);
+
+ if (op0)
+ return op0;
+
+ op0 = gen_rtx_DEBUG_EXPR (mode);
+ DEBUG_EXPR_TREE_DECL (op0) = exp;
+ SET_DECL_RTL (exp, op0);
+
+ return op0;
+
case VAR_DECL:
case PARM_DECL:
case FUNCTION_DECL:
@@ -2376,7 +2349,8 @@ expand_debug_expr (tree exp)
|| DECL_EXTERNAL (exp)
|| !TREE_STATIC (exp)
|| !DECL_NAME (exp)
- || DECL_HARD_REGISTER (exp))
+ || DECL_HARD_REGISTER (exp)
+ || mode == VOIDmode)
return NULL;
op0 = DECL_RTL (exp);
@@ -2458,20 +2432,29 @@ expand_debug_expr (tree exp)
if (!op0)
return NULL;
- gcc_assert (GET_MODE (op0) == Pmode
- || GET_MODE (op0) == ptr_mode
+ if (POINTER_TYPE_P (TREE_TYPE (exp)))
+ as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp)));
+ else
+ as = ADDR_SPACE_GENERIC;
+
+ address_mode = targetm.addr_space.address_mode (as);
+ pointer_mode = targetm.addr_space.pointer_mode (as);
+
+ gcc_assert (GET_MODE (op0) == address_mode
+ || GET_MODE (op0) == pointer_mode
|| GET_CODE (op0) == CONST_INT
|| GET_CODE (op0) == CONST_DOUBLE);
if (TREE_CODE (exp) == ALIGN_INDIRECT_REF)
{
int align = TYPE_ALIGN_UNIT (TREE_TYPE (exp));
- op0 = gen_rtx_AND (Pmode, op0, GEN_INT (-align));
+ op0 = gen_rtx_AND (address_mode, op0, GEN_INT (-align));
}
op0 = gen_rtx_MEM (mode, op0);
set_mem_attributes (op0, exp, 0);
+ set_mem_addr_space (op0, as);
return op0;
@@ -2485,14 +2468,19 @@ expand_debug_expr (tree exp)
if (!op0)
return NULL;
- gcc_assert (GET_MODE (op0) == Pmode
- || GET_MODE (op0) == ptr_mode
+ as = TYPE_ADDR_SPACE (TREE_TYPE (exp));
+ address_mode = targetm.addr_space.address_mode (as);
+ pointer_mode = targetm.addr_space.pointer_mode (as);
+
+ gcc_assert (GET_MODE (op0) == address_mode
+ || GET_MODE (op0) == pointer_mode
|| GET_CODE (op0) == CONST_INT
|| GET_CODE (op0) == CONST_DOUBLE);
op0 = gen_rtx_MEM (mode, op0);
set_mem_attributes (op0, exp, 0);
+ set_mem_addr_space (op0, as);
return op0;
@@ -2512,6 +2500,9 @@ expand_debug_expr (tree exp)
&mode1, &unsignedp, &volatilep, false);
rtx orig_op0;
+ if (bitsize == 0)
+ return NULL;
+
orig_op0 = op0 = expand_debug_expr (tem);
if (!op0)
@@ -2549,6 +2540,9 @@ expand_debug_expr (tree exp)
if (MEM_P (op0))
{
+ if (mode1 == VOIDmode)
+ /* Bitfield. */
+ mode1 = smallest_mode_for_size (bitsize, MODE_INT);
if (bitpos >= BITS_PER_UNIT)
{
op0 = adjust_address_nv (op0, mode1, bitpos / BITS_PER_UNIT);
@@ -2556,7 +2550,8 @@ expand_debug_expr (tree exp)
}
else if (bitpos < 0)
{
- int units = (-bitpos + BITS_PER_UNIT - 1) / BITS_PER_UNIT;
+ HOST_WIDE_INT units
+ = (-bitpos + BITS_PER_UNIT - 1) / BITS_PER_UNIT;
op0 = adjust_address_nv (op0, mode1, units);
bitpos += units * BITS_PER_UNIT;
}
@@ -2574,6 +2569,9 @@ expand_debug_expr (tree exp)
if (bitpos == 0 && mode == GET_MODE (op0))
return op0;
+ if (bitpos < 0)
+ return NULL;
+
if ((bitpos % BITS_PER_UNIT) == 0
&& bitsize == GET_MODE_BITSIZE (mode1))
{
@@ -2850,6 +2848,46 @@ expand_debug_expr (tree exp)
op1 = gen_rtx_CONST (GET_MODE_INNER (mode), op1);
return gen_rtx_CONCAT (mode, op0, op1);
+ case CONJ_EXPR:
+ if (GET_CODE (op0) == CONCAT)
+ return gen_rtx_CONCAT (mode, XEXP (op0, 0),
+ gen_rtx_NEG (GET_MODE_INNER (mode),
+ XEXP (op0, 1)));
+ else
+ {
+ enum machine_mode imode = GET_MODE_INNER (mode);
+ rtx re, im;
+
+ if (MEM_P (op0))
+ {
+ re = adjust_address_nv (op0, imode, 0);
+ im = adjust_address_nv (op0, imode, GET_MODE_SIZE (imode));
+ }
+ else
+ {
+ enum machine_mode ifmode = int_mode_for_mode (mode);
+ enum machine_mode ihmode = int_mode_for_mode (imode);
+ rtx halfsize;
+ if (ifmode == BLKmode || ihmode == BLKmode)
+ return NULL;
+ halfsize = GEN_INT (GET_MODE_BITSIZE (ihmode));
+ re = op0;
+ if (mode != ifmode)
+ re = gen_rtx_SUBREG (ifmode, re, 0);
+ re = gen_rtx_ZERO_EXTRACT (ihmode, re, halfsize, const0_rtx);
+ if (imode != ihmode)
+ re = gen_rtx_SUBREG (imode, re, 0);
+ im = copy_rtx (op0);
+ if (mode != ifmode)
+ im = gen_rtx_SUBREG (ifmode, im, 0);
+ im = gen_rtx_ZERO_EXTRACT (ihmode, im, halfsize, halfsize);
+ if (imode != ihmode)
+ im = gen_rtx_SUBREG (imode, im, 0);
+ }
+ im = gen_rtx_NEG (imode, im);
+ return gen_rtx_CONCAT (mode, re, im);
+ }
+
case ADDR_EXPR:
op0 = expand_debug_expr (TREE_OPERAND (exp, 0));
if (!op0 || !MEM_P (op0))
@@ -3410,8 +3448,18 @@ expand_stack_alignment (void)
|| crtl->has_nonlocal_goto)
crtl->need_drap = true;
- gcc_assert (crtl->stack_alignment_needed
- <= crtl->stack_alignment_estimated);
+ /* Call update_stack_boundary here again to update incoming stack
+ boundary. It may set incoming stack alignment to a different
+ value after RTL expansion. TARGET_FUNCTION_OK_FOR_SIBCALL may
+ use the minimum incoming stack alignment to check if it is OK
+ to perform sibcall optimization since sibcall optimization will
+ only align the outgoing stack to incoming stack boundary. */
+ if (targetm.calls.update_stack_boundary)
+ targetm.calls.update_stack_boundary ();
+
+ /* The incoming stack frame has to be aligned at least at
+ parm_stack_boundary. */
+ gcc_assert (crtl->parm_stack_boundary <= INCOMING_STACK_BOUNDARY);
/* Update crtl->stack_alignment_estimated and use it later to align
stack. We check PREFERRED_STACK_BOUNDARY if there may be non-call
@@ -3427,6 +3475,9 @@ expand_stack_alignment (void)
if (preferred_stack_boundary > crtl->stack_alignment_needed)
crtl->stack_alignment_needed = preferred_stack_boundary;
+ gcc_assert (crtl->stack_alignment_needed
+ <= crtl->stack_alignment_estimated);
+
crtl->stack_realign_needed
= INCOMING_STACK_BOUNDARY < crtl->stack_alignment_estimated;
crtl->stack_realign_tried = crtl->stack_realign_needed;
@@ -3503,7 +3554,7 @@ gimple_expand_cfg (void)
targetm.expand_to_rtl_hook ();
crtl->stack_alignment_needed = STACK_BOUNDARY;
crtl->max_used_stack_slot_alignment = STACK_BOUNDARY;
- crtl->stack_alignment_estimated = STACK_BOUNDARY;
+ crtl->stack_alignment_estimated = 0;
crtl->preferred_stack_boundary = STACK_BOUNDARY;
cfun->cfg->max_jumptable_ents = 0;
@@ -3567,23 +3618,6 @@ gimple_expand_cfg (void)
if (crtl->stack_protect_guard)
stack_protect_prologue ();
- /* Update stack boundary if needed. */
- if (SUPPORTS_STACK_ALIGNMENT)
- {
- /* Call update_stack_boundary here to update incoming stack
- boundary before TARGET_FUNCTION_OK_FOR_SIBCALL is called.
- TARGET_FUNCTION_OK_FOR_SIBCALL needs to know the accurate
- incoming stack alignment to check if it is OK to perform
- sibcall optimization since sibcall optimization will only
- align the outgoing stack to incoming stack boundary. */
- if (targetm.calls.update_stack_boundary)
- targetm.calls.update_stack_boundary ();
-
- /* The incoming stack frame has to be aligned at least at
- parm_stack_boundary. */
- gcc_assert (crtl->parm_stack_boundary <= INCOMING_STACK_BOUNDARY);
- }
-
expand_phi_nodes (&SA);
/* Register rtl specific functions for cfg. */
diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h
index d6c26bf0ba0..4abdf8bfe15 100644
--- a/gcc/cfgloop.h
+++ b/gcc/cfgloop.h
@@ -288,6 +288,7 @@ extern edge create_empty_if_region_on_edge (edge, tree);
extern struct loop *create_empty_loop_on_edge (edge, tree, tree, tree, tree,
tree *, tree *, struct loop *);
extern struct loop * duplicate_loop (struct loop *, struct loop *);
+extern void duplicate_subloops (struct loop *, struct loop *);
extern bool duplicate_loop_to_header_edge (struct loop *, edge,
unsigned, sbitmap, edge,
VEC (edge, heap) **, int);
diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c
index a357a2fd77a..6f24415a72d 100644
--- a/gcc/cfgloopmanip.c
+++ b/gcc/cfgloopmanip.c
@@ -32,7 +32,6 @@ along with GCC; see the file COPYING3. If not see
#include "output.h"
#include "tree-flow.h"
-static void duplicate_subloops (struct loop *, struct loop *);
static void copy_loops_to (struct loop **, int,
struct loop *);
static void loop_redirect_edge (edge, basic_block);
@@ -886,7 +885,7 @@ duplicate_loop (struct loop *loop, struct loop *target)
/* Copies structure of subloops of LOOP into TARGET loop, placing
newly created loops into loop tree. */
-static void
+void
duplicate_subloops (struct loop *loop, struct loop *target)
{
struct loop *aloop, *cloop;
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 15dd60a7ee4..167e8a8e7b4 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -802,7 +802,7 @@ initialize_inline_failed (struct cgraph_edge *e)
e->inline_failed = CIF_REDEFINED_EXTERN_INLINE;
else if (!callee->local.inlinable)
e->inline_failed = CIF_FUNCTION_NOT_INLINABLE;
- else if (gimple_call_cannot_inline_p (e->call_stmt))
+ else if (e->call_stmt && gimple_call_cannot_inline_p (e->call_stmt))
e->inline_failed = CIF_MISMATCHED_ARGUMENTS;
else
e->inline_failed = CIF_FUNCTION_NOT_CONSIDERED;
@@ -816,13 +816,19 @@ cgraph_create_edge (struct cgraph_node *caller, struct cgraph_node *callee,
{
struct cgraph_edge *edge;
+
+ /* LTO does not actually have access to the call_stmt since these
+ have not been loaded yet. */
+ if (call_stmt)
+ {
#ifdef ENABLE_CHECKING
- /* This is rather pricely check possibly trigerring construction of call stmt
- hashtable. */
- gcc_assert (!cgraph_edge (caller, call_stmt));
+ /* This is rather pricely check possibly trigerring construction of
+ call stmt hashtable. */
+ gcc_assert (!cgraph_edge (caller, call_stmt));
#endif
- gcc_assert (is_gimple_call (call_stmt));
+ gcc_assert (is_gimple_call (call_stmt));
+ }
if (free_edges)
{
@@ -841,7 +847,8 @@ cgraph_create_edge (struct cgraph_node *caller, struct cgraph_node *callee,
edge->callee = callee;
edge->call_stmt = call_stmt;
push_cfun (DECL_STRUCT_FUNCTION (caller->decl));
- edge->can_throw_external = stmt_can_throw_external (call_stmt);
+ edge->can_throw_external
+ = call_stmt ? stmt_can_throw_external (call_stmt) : false;
pop_cfun ();
edge->prev_caller = NULL;
edge->next_caller = callee->callers;
@@ -860,7 +867,9 @@ cgraph_create_edge (struct cgraph_node *caller, struct cgraph_node *callee,
gcc_assert (freq <= CGRAPH_FREQ_MAX);
edge->loop_nest = nest;
edge->indirect_call = 0;
- if (caller->call_site_hash)
+ edge->call_stmt_cannot_inline_p =
+ (call_stmt ? gimple_call_cannot_inline_p (call_stmt) : false);
+ if (call_stmt && caller->call_site_hash)
{
void **slot;
slot = htab_find_slot_with_hash (caller->call_site_hash,
@@ -1351,6 +1360,7 @@ void
cgraph_mark_needed_node (struct cgraph_node *node)
{
node->needed = 1;
+ gcc_assert (!node->global.inlined_to);
cgraph_mark_reachable_node (node);
}
@@ -1624,8 +1634,8 @@ cgraph_function_possibly_inlined_p (tree decl)
/* Create clone of E in the node N represented by CALL_EXPR the callgraph. */
struct cgraph_edge *
cgraph_clone_edge (struct cgraph_edge *e, struct cgraph_node *n,
- gimple call_stmt, gcov_type count_scale, int freq_scale,
- int loop_nest, bool update_original)
+ gimple call_stmt, unsigned stmt_uid, gcov_type count_scale,
+ int freq_scale, int loop_nest, bool update_original)
{
struct cgraph_edge *new_edge;
gcov_type count = e->count * count_scale / REG_BR_PROB_BASE;
@@ -1638,6 +1648,7 @@ cgraph_clone_edge (struct cgraph_edge *e, struct cgraph_node *n,
new_edge->inline_failed = e->inline_failed;
new_edge->indirect_call = e->indirect_call;
+ new_edge->lto_stmt_uid = stmt_uid;
if (update_original)
{
e->count -= new_edge->count;
@@ -1673,6 +1684,7 @@ cgraph_clone_node (struct cgraph_node *n, gcov_type count, int freq,
}
new_node->analyzed = n->analyzed;
new_node->local = n->local;
+ new_node->local.externally_visible = false;
new_node->global = n->global;
new_node->rtl = n->rtl;
new_node->count = count;
@@ -1702,8 +1714,8 @@ cgraph_clone_node (struct cgraph_node *n, gcov_type count, int freq,
for (e = n->callees;e; e=e->next_callee)
- cgraph_clone_edge (e, new_node, e->call_stmt, count_scale, freq, loop_nest,
- update_original);
+ cgraph_clone_edge (e, new_node, e->call_stmt, e->lto_stmt_uid,
+ count_scale, freq, loop_nest, update_original);
new_node->next_sibling_clone = n->clones;
if (n->clones)
@@ -1972,7 +1984,8 @@ cgraph_add_new_function (tree fndecl, bool lowered)
bool
cgraph_node_can_be_local_p (struct cgraph_node *node)
{
- return !node->needed;
+ return (!node->needed
+ && (DECL_COMDAT (node->decl) || !node->local.externally_visible));
}
/* Bring NODE local. */
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 292eccd0284..016ce9de14c 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -46,6 +46,10 @@ enum availability
AVAIL_LOCAL
};
+/* This is the information that is put into the cgraph local structure
+ to recover a function. */
+struct lto_file_decl_data;
+
extern const char * const cgraph_availability_names[];
/* Function inlining information. */
@@ -69,6 +73,9 @@ struct GTY(()) inline_summary
Available after function is analyzed. */
struct GTY(()) cgraph_local_info {
+ /* File stream where this node is being written to. */
+ struct lto_file_decl_data * GTY ((skip)) lto_file_data;
+
struct inline_summary inline_summary;
/* Set when function function is visible in current compilation unit only
@@ -277,6 +284,9 @@ struct GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller"))) cgrap
struct cgraph_edge *prev_callee;
struct cgraph_edge *next_callee;
gimple call_stmt;
+ /* The stmt_uid of this call stmt. This is used by LTO to recover
+ the call_stmt when the function is serialized in. */
+ unsigned int lto_stmt_uid;
PTR GTY ((skip (""))) aux;
/* When equal to CIF_OK, inline this call. Otherwise, points to the
explanation why function was not inlined. */
@@ -291,6 +301,8 @@ struct GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller"))) cgrap
unsigned int loop_nest : 30;
/* Whether this edge describes a call that was originally indirect. */
unsigned int indirect_call : 1;
+ /* True if the corresponding CALL stmt cannot be inlined. */
+ unsigned int call_stmt_cannot_inline_p : 1;
/* Can this call throw externally? */
unsigned int can_throw_external : 1;
/* Unique id of the edge. */
@@ -406,8 +418,8 @@ struct cgraph_global_info *cgraph_global_info (tree);
struct cgraph_rtl_info *cgraph_rtl_info (tree);
const char * cgraph_node_name (struct cgraph_node *);
struct cgraph_edge * cgraph_clone_edge (struct cgraph_edge *,
- struct cgraph_node *,
- gimple, gcov_type, int, int, bool);
+ struct cgraph_node *, gimple,
+ unsigned, gcov_type, int, int, bool);
struct cgraph_node * cgraph_clone_node (struct cgraph_node *, gcov_type, int,
int, bool, VEC(cgraph_edge_p,heap) *);
@@ -430,6 +442,7 @@ struct cgraph_node * cgraph_create_virtual_clone (struct cgraph_node *old_node,
void cgraph_finalize_function (tree, bool);
void cgraph_mark_if_needed (tree);
void cgraph_finalize_compilation_unit (void);
+void cgraph_optimize (void);
void cgraph_mark_needed_node (struct cgraph_node *);
void cgraph_mark_address_taken_node (struct cgraph_node *);
void cgraph_mark_reachable_node (struct cgraph_node *);
@@ -446,9 +459,11 @@ struct cgraph_node *cgraph_function_versioning (struct cgraph_node *,
bitmap);
void tree_function_versioning (tree, tree, VEC (ipa_replace_map_p,gc)*, bool, bitmap);
struct cgraph_node *save_inline_function_body (struct cgraph_node *);
-void record_references_in_initializer (tree);
+void record_references_in_initializer (tree, bool);
bool cgraph_process_new_functions (void);
+bool cgraph_decide_is_function_needed (struct cgraph_node *, tree);
+
typedef void (*cgraph_edge_hook)(struct cgraph_edge *, void *);
typedef void (*cgraph_node_hook)(struct cgraph_node *, void *);
typedef void (*cgraph_2edge_hook)(struct cgraph_edge *, struct cgraph_edge *,
@@ -476,6 +491,7 @@ void cgraph_materialize_all_clones (void);
/* In cgraphbuild.c */
unsigned int rebuild_cgraph_edges (void);
+void reset_inline_failed (struct cgraph_node *);
int compute_call_stmt_bb_frequency (tree, basic_block bb);
/* In ipa.c */
@@ -560,6 +576,22 @@ unsigned int compute_inline_parameters (struct cgraph_node *);
/* Create a new static variable of type TYPE. */
tree add_new_static_var (tree type);
+/* lto-cgraph.c */
+
+enum LTO_cgraph_tags
+{
+ /* Must leave 0 for the stopper. */
+ LTO_cgraph_avail_node = 1,
+ LTO_cgraph_overwritable_node,
+ LTO_cgraph_unavail_node,
+ LTO_cgraph_edge,
+ LTO_cgraph_last_tag
+};
+
+extern const char * LTO_cgraph_tag_names[LTO_cgraph_last_tag];
+
+#define LCC_NOT_FOUND (-1)
+
/* Return true if iterator CSI points to nothing. */
static inline bool
@@ -626,6 +658,26 @@ struct GTY(()) constant_descriptor_tree {
hashval_t hash;
};
+/* Return true when function NODE is only called directly.
+ i.e. it is not externally visible, address was not taken and
+ it is not used in any other non-standard way. */
+
+static inline bool
+cgraph_only_called_directly_p (struct cgraph_node *node)
+{
+ return !node->needed && !node->local.externally_visible;
+}
+
+/* Return true when function NODE can be removed from callgraph
+ if all direct calls are eliminated. */
+
+static inline bool
+cgraph_can_remove_if_no_direct_calls_p (struct cgraph_node *node)
+{
+ return (!node->needed
+ && (DECL_COMDAT (node->decl) || !node->local.externally_visible));
+}
+
/* Constant pool accessor function. */
htab_t constant_pool_htab (void);
diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c
index a7a8bd2b314..65e3d67e14c 100644
--- a/gcc/cgraphbuild.c
+++ b/gcc/cgraphbuild.c
@@ -33,13 +33,16 @@ along with GCC; see the file COPYING3. If not see
#include "tree-pass.h"
/* Walk tree and record all calls and references to functions/variables.
- Called via walk_tree: TP is pointer to tree to be examined. */
+ Called via walk_tree: TP is pointer to tree to be examined.
+ When DATA is non-null, record references to callgraph.
+ */
static tree
-record_reference (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
+record_reference (tree *tp, int *walk_subtrees, void *data)
{
tree t = *tp;
tree decl;
+ bool do_callgraph = data != NULL;
switch (TREE_CODE (t))
{
@@ -57,7 +60,7 @@ record_reference (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
/* Record dereferences to the functions. This makes the
functions reachable unconditionally. */
decl = TREE_OPERAND (*tp, 0);
- if (TREE_CODE (decl) == FUNCTION_DECL)
+ if (TREE_CODE (decl) == FUNCTION_DECL && do_callgraph)
cgraph_mark_address_taken_node (cgraph_node (decl));
break;
@@ -78,6 +81,29 @@ record_reference (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
return NULL_TREE;
}
+/* Reset inlining information of all incoming call edges of NODE. */
+
+void
+reset_inline_failed (struct cgraph_node *node)
+{
+ struct cgraph_edge *e;
+
+ for (e = node->callers; e; e = e->next_caller)
+ {
+ e->callee->global.inlined_to = NULL;
+ if (!node->analyzed)
+ e->inline_failed = CIF_BODY_NOT_AVAILABLE;
+ else if (node->local.redefined_extern_inline)
+ e->inline_failed = CIF_REDEFINED_EXTERN_INLINE;
+ else if (!node->local.inlinable)
+ e->inline_failed = CIF_FUNCTION_NOT_INLINABLE;
+ else if (e->call_stmt_cannot_inline_p)
+ e->inline_failed = CIF_MISMATCHED_ARGUMENTS;
+ else
+ e->inline_failed = CIF_FUNCTION_NOT_CONSIDERED;
+ }
+}
+
/* Computes the frequency of the call statement so that it can be stored in
cgraph_edge. BB is the basic block of the call statement. */
int
@@ -195,13 +221,15 @@ struct gimple_opt_pass pass_build_cgraph_edges =
};
/* Record references to functions and other variables present in the
- initial value of DECL, a variable. */
+ initial value of DECL, a variable.
+ When ONLY_VARS is true, we mark needed only variables, not functions. */
void
-record_references_in_initializer (tree decl)
+record_references_in_initializer (tree decl, bool only_vars)
{
struct pointer_set_t *visited_nodes = pointer_set_create ();
- walk_tree (&DECL_INITIAL (decl), record_reference, NULL, visited_nodes);
+ walk_tree (&DECL_INITIAL (decl), record_reference,
+ only_vars ? NULL : decl, visited_nodes);
pointer_set_destroy (visited_nodes);
}
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 2ad07187e04..7105e59c5ec 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -140,7 +140,6 @@ static void cgraph_expand_all_functions (void);
static void cgraph_mark_functions_to_output (void);
static void cgraph_expand_function (struct cgraph_node *);
static void cgraph_output_pending_asms (void);
-static void cgraph_optimize (void);
static void cgraph_analyze_function (struct cgraph_node *);
static FILE *cgraph_dump_file;
@@ -314,16 +313,9 @@ cgraph_build_cdtor_fns (void)
either outside this translation unit, something magic in the system
configury. */
-static bool
-decide_is_function_needed (struct cgraph_node *node, tree decl)
+bool
+cgraph_decide_is_function_needed (struct cgraph_node *node, tree decl)
{
- if (MAIN_NAME_P (DECL_NAME (decl))
- && TREE_PUBLIC (decl))
- {
- node->local.externally_visible = true;
- return true;
- }
-
/* If the user told us it is used, then it must be so. */
if (node->local.externally_visible)
return true;
@@ -361,7 +353,9 @@ decide_is_function_needed (struct cgraph_node *node, tree decl)
|| (!optimize && !node->local.disregard_inline_limits
&& !DECL_DECLARED_INLINE_P (decl)
&& !node->origin))
- && !flag_whole_program)
+ && !flag_whole_program
+ && !flag_lto
+ && !flag_whopr)
&& !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl))
return true;
@@ -522,7 +516,7 @@ cgraph_finalize_function (tree decl, bool nested)
node->finalized_by_frontend = true;
record_cdtor_fn (node->decl);
- if (decide_is_function_needed (node, decl))
+ if (cgraph_decide_is_function_needed (node, decl))
cgraph_mark_needed_node (node);
/* Since we reclaim unreachable nodes at the end of every language
@@ -551,7 +545,7 @@ void
cgraph_mark_if_needed (tree decl)
{
struct cgraph_node *node = cgraph_node (decl);
- if (node->local.finalized && decide_is_function_needed (node, decl))
+ if (node->local.finalized && cgraph_decide_is_function_needed (node, decl))
cgraph_mark_needed_node (node);
}
@@ -594,6 +588,21 @@ verify_cgraph_node (struct cgraph_node *node)
error ("Execution count is negative");
error_found = true;
}
+ if (node->global.inlined_to && node->local.externally_visible)
+ {
+ error ("Externally visible inline clone");
+ error_found = true;
+ }
+ if (node->global.inlined_to && node->address_taken)
+ {
+ error ("Inline clone with address taken");
+ error_found = true;
+ }
+ if (node->global.inlined_to && node->needed)
+ {
+ error ("Inline clone is needed");
+ error_found = true;
+ }
for (e = node->callers; e; e = e->next_caller)
{
if (e->count < 0)
@@ -692,7 +701,8 @@ verify_cgraph_node (struct cgraph_node *node)
if (node->analyzed && gimple_has_body_p (node->decl)
&& !TREE_ASM_WRITTEN (node->decl)
- && (!DECL_EXTERNAL (node->decl) || node->global.inlined_to))
+ && (!DECL_EXTERNAL (node->decl) || node->global.inlined_to)
+ && !flag_wpa)
{
if (this_cfun->cfg)
{
@@ -864,12 +874,8 @@ process_function_and_variable_attributes (struct cgraph_node *first,
warning_at (DECL_SOURCE_LOCATION (node->decl), OPT_Wattributes,
"%<externally_visible%>"
" attribute have effect only on public objects");
- else
- {
- if (node->local.finalized)
- cgraph_mark_needed_node (node);
- node->local.externally_visible = true;
- }
+ else if (node->local.finalized)
+ cgraph_mark_needed_node (node);
}
}
for (vnode = varpool_nodes; vnode != first_var; vnode = vnode->next)
@@ -887,12 +893,8 @@ process_function_and_variable_attributes (struct cgraph_node *first,
warning_at (DECL_SOURCE_LOCATION (vnode->decl), OPT_Wattributes,
"%<externally_visible%>"
" attribute have effect only on public objects");
- else
- {
- if (vnode->finalized)
- varpool_mark_needed_node (vnode);
- vnode->externally_visible = true;
- }
+ else if (vnode->finalized)
+ varpool_mark_needed_node (vnode);
}
}
}
@@ -949,8 +951,8 @@ cgraph_analyze_functions (void)
continue;
}
- gcc_assert (!node->analyzed && node->reachable);
- cgraph_analyze_function (node);
+ if (!node->analyzed)
+ cgraph_analyze_function (node);
for (edge = node->callees; edge; edge = edge->next_callee)
if (!edge->callee->reachable)
@@ -1355,15 +1357,34 @@ ipa_passes (void)
current_function_decl = NULL;
gimple_register_cfg_hooks ();
bitmap_obstack_initialize (NULL);
- execute_ipa_pass_list (all_ipa_passes);
- /* Generate coverage variables and constructors. */
- coverage_finish ();
+ if (!in_lto_p)
+ execute_ipa_pass_list (all_small_ipa_passes);
- /* Process new functions added. */
- set_cfun (NULL);
- current_function_decl = NULL;
- cgraph_process_new_functions ();
+ /* If pass_all_early_optimizations was not scheduled, the state of
+ the cgraph will not be properly updated. Update it now. */
+ if (cgraph_state < CGRAPH_STATE_IPA_SSA)
+ cgraph_state = CGRAPH_STATE_IPA_SSA;
+
+ if (!in_lto_p)
+ {
+ /* Generate coverage variables and constructors. */
+ coverage_finish ();
+
+ /* Process new functions added. */
+ set_cfun (NULL);
+ current_function_decl = NULL;
+ cgraph_process_new_functions ();
+
+ execute_ipa_summary_passes ((struct ipa_opt_pass_d *) all_regular_ipa_passes);
+ }
+ execute_ipa_summary_passes ((struct ipa_opt_pass_d *) all_lto_gen_passes);
+
+ if (!in_lto_p)
+ ipa_write_summaries ();
+
+ if (!flag_ltrans)
+ execute_ipa_pass_list (all_regular_ipa_passes);
bitmap_obstack_release (NULL);
}
@@ -1371,7 +1392,7 @@ ipa_passes (void)
/* Perform simple optimizations based on callgraph. */
-static void
+void
cgraph_optimize (void)
{
if (errorcount || sorrycount)
@@ -1401,7 +1422,10 @@ cgraph_optimize (void)
/* Do nothing else if any IPA pass found errors. */
if (errorcount || sorrycount)
- return;
+ {
+ timevar_pop (TV_CGRAPHOPT);
+ return;
+ }
/* This pass remove bodies of extern inline functions we never inlined.
Do this later so other IPA passes see what is really going on. */
@@ -1421,6 +1445,7 @@ cgraph_optimize (void)
timevar_pop (TV_CGRAPHOPT);
/* Output everything. */
+ (*debug_hooks->assembly_start) ();
if (!quiet_flag)
fprintf (stderr, "Assembling functions:\n");
#ifdef ENABLE_CHECKING
@@ -1598,7 +1623,8 @@ cgraph_copy_node_for_versioning (struct cgraph_node *old_version,
also cloned. */
for (e = old_version->callees;e; e=e->next_callee)
{
- new_e = cgraph_clone_edge (e, new_version, e->call_stmt, 0, e->frequency,
+ new_e = cgraph_clone_edge (e, new_version, e->call_stmt,
+ e->lto_stmt_uid, 0, e->frequency,
e->loop_nest, true);
new_e->count = e->count;
}
diff --git a/gcc/collect2.c b/gcc/collect2.c
index 82c400bbaaf..03300f3c79b 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -184,6 +184,15 @@ static int aix64_flag; /* true if -b64 */
static int aixrtl_flag; /* true if -brtl */
#endif
+enum lto_mode_d {
+ LTO_MODE_NONE, /* Not doing LTO. */
+ LTO_MODE_LTO, /* Normal LTO. */
+ LTO_MODE_WHOPR /* WHOPR. */
+};
+
+/* Current LTO mode. */
+static enum lto_mode_d lto_mode = LTO_MODE_NONE;
+
int debug; /* true if -debug */
static int shared_obj; /* true if -shared */
@@ -193,6 +202,7 @@ static const char *o_file; /* <xxx>.o for constructor/destructor list. */
#ifdef COLLECT_EXPORT_LIST
static const char *export_file; /* <xxx>.x for AIX export list. */
#endif
+static char **lto_o_files; /* Output files for LTO. */
const char *ldout; /* File for ld stdout. */
const char *lderrout; /* File for ld stderr. */
static const char *output_file; /* Output file for ld. */
@@ -250,6 +260,25 @@ static struct path_prefix *libpaths[3] = {&cmdline_lib_dirs,
&libpath_lib_dirs, NULL};
#endif
+/* List of names of object files containing LTO information.
+ These are a subset of the object file names appearing on the
+ command line, and must be identical, in the sense of pointer
+ equality, with the names passed to maybe_run_lto_and_relink(). */
+
+struct lto_object
+{
+ const char *name; /* Name of object file. */
+ struct lto_object *next; /* Next in linked list. */
+};
+
+struct lto_object_list
+{
+ struct lto_object *first; /* First list element. */
+ struct lto_object *last; /* Last list element. */
+};
+
+static struct lto_object_list lto_objects;
+
/* Special kinds of symbols that a name may denote. */
typedef enum {
@@ -272,6 +301,7 @@ static void prefix_from_string (const char *, struct path_prefix *);
static void do_wait (const char *, struct pex_obj *);
static void fork_execute (const char *, char **);
static void maybe_unlink (const char *);
+static void maybe_unlink_list (char **);
static void add_to_list (struct head *, const char *);
static int extract_init_priority (const char *);
static void sort_ids (struct head *);
@@ -310,7 +340,8 @@ typedef enum {
PASS_FIRST, /* without constructors */
PASS_OBJ, /* individual objects */
PASS_LIB, /* looking for shared libraries */
- PASS_SECOND /* with constructors linked in */
+ PASS_SECOND, /* with constructors linked in */
+ PASS_LTOINFO /* looking for objects with LTO info */
} scanpass;
/* ... and which kinds of symbols are to be considered. */
@@ -363,6 +394,9 @@ collect_exit (int status)
maybe_unlink (export_file);
#endif
+ if (lto_o_files)
+ maybe_unlink_list (lto_o_files);
+
if (ldout != 0 && ldout[0])
{
dump_file (ldout, stdout);
@@ -472,6 +506,9 @@ handler (int signo)
maybe_unlink (export_file);
#endif
+ if (lto_o_files)
+ maybe_unlink_list (lto_o_files);
+
if (response_file)
maybe_unlink (response_file);
@@ -815,6 +852,247 @@ prefix_from_string (const char *p, struct path_prefix *pprefix)
}
free (nstore);
}
+
+#ifdef OBJECT_FORMAT_NONE
+
+/* Add an entry for the object file NAME to object file list LIST.
+ New entries are added at the end of the list. The original pointer
+ value of NAME is preserved, i.e., no string copy is performed. */
+
+static void
+add_lto_object (struct lto_object_list *list, const char *name)
+{
+ struct lto_object *n = XNEW (struct lto_object);
+ n->name = name;
+ n->next = NULL;
+
+ if (list->last)
+ list->last->next = n;
+ else
+ list->first = n;
+
+ list->last = n;
+}
+#endif /* OBJECT_FORMAT_NONE */
+
+
+/* Perform a link-time recompilation and relink if any of the object
+ files contain LTO info. The linker command line LTO_LD_ARGV
+ represents the linker command that would produce a final executable
+ without the use of LTO. OBJECT_LST is a vector of object file names
+ appearing in LTO_LD_ARGV that are to be considerd for link-time
+ recompilation, where OBJECT is a pointer to the last valid element.
+ (This awkward convention avoids an impedance mismatch with the
+ usage of similarly-named variables in main().) The elements of
+ OBJECT_LST must be identical, i.e., pointer equal, to the
+ corresponding arguments in LTO_LD_ARGV.
+
+ Upon entry, at least one linker run has been performed without the
+ use of any LTO info that might be present. Any recompilations
+ necessary for template instantiations have been performed, and
+ initializer/finalizer tables have been created if needed and
+ included in the linker command line LTO_LD_ARGV. If any of the
+ object files contain LTO info, we run the LTO back end on all such
+ files, and perform the final link with the LTO back end output
+ substituted for the LTO-optimized files. In some cases, a final
+ link with all link-time generated code has already been performed,
+ so there is no need to relink if no LTO info is found. In other
+ cases, our caller has not produced the final executable, and is
+ relying on us to perform the required link whether LTO info is
+ present or not. In that case, the FORCE argument should be true.
+ Note that the linker command line argument LTO_LD_ARGV passed into
+ this function may be modified in place. */
+
+static void
+maybe_run_lto_and_relink (char **lto_ld_argv, char **object_lst,
+ const char **object, bool force)
+{
+ const char **object_file = CONST_CAST2 (const char **, char **, object_lst);
+
+ int num_lto_c_args = 1; /* Allow space for the terminating NULL. */
+
+ while (object_file < object)
+ {
+ /* If file contains LTO info, add it to the list of LTO objects. */
+ scan_prog_file (*object_file++, PASS_LTOINFO, SCAN_ALL);
+
+ /* Increment the argument count by the number of object file arguments
+ we will add. An upper bound suffices, so just count all of the
+ object files regardless of whether they contain LTO info. */
+ num_lto_c_args++;
+ }
+
+ if (lto_objects.first)
+ {
+ const char *opts;
+ char **lto_c_argv;
+ const char **lto_c_ptr;
+ const char *cp;
+ const char **p, **q, **r;
+ const char **lto_o_ptr;
+ struct lto_object *list;
+ char *lto_wrapper = getenv ("COLLECT_LTO_WRAPPER");
+ struct pex_obj *pex;
+ const char *prog = "lto-wrapper";
+
+ if (!lto_wrapper)
+ fatal ("COLLECT_LTO_WRAPPER must be set.");
+
+ /* There is at least one object file containing LTO info,
+ so we need to run the LTO back end and relink. */
+
+ /* Get compiler options passed down from the parent `gcc' command.
+ These must be passed to the LTO back end. */
+ opts = getenv ("COLLECT_GCC_OPTIONS");
+
+ /* Increment the argument count by the number of inherited options.
+ Some arguments may be filtered out later. Again, an upper bound
+ suffices. */
+
+ cp = opts;
+
+ while (cp && *cp)
+ {
+ extract_string (&cp);
+ num_lto_c_args++;
+ }
+ obstack_free (&temporary_obstack, temporary_firstobj);
+
+ if (debug)
+ num_lto_c_args++;
+
+ /* Increment the argument count by the number of initial
+ arguments added below. */
+ num_lto_c_args += 9;
+
+ lto_c_argv = (char **) xcalloc (sizeof (char *), num_lto_c_args);
+ lto_c_ptr = CONST_CAST2 (const char **, char **, lto_c_argv);
+
+ *lto_c_ptr++ = lto_wrapper;
+ *lto_c_ptr++ = c_file_name;
+
+ cp = opts;
+
+ while (cp && *cp)
+ {
+ const char *s = extract_string (&cp);
+
+ /* Pass the option or argument to the wrapper. */
+ *lto_c_ptr++ = xstrdup (s);
+ }
+ obstack_free (&temporary_obstack, temporary_firstobj);
+
+ if (debug)
+ *lto_c_ptr++ = xstrdup ("-debug");
+
+ /* Add LTO objects to the wrapper command line. */
+ for (list = lto_objects.first; list; list = list->next)
+ *lto_c_ptr++ = list->name;
+
+ *lto_c_ptr = NULL;
+
+ /* Save intermediate WPA files in lto1 if debug. */
+ if (debug)
+ putenv (xstrdup ("WPA_SAVE_LTRANS=1"));
+
+ /* Run the LTO back end. */
+ pex = collect_execute (prog, lto_c_argv, NULL, NULL, PEX_SEARCH);
+ {
+ int c;
+ FILE *stream;
+ size_t i, num_files;
+ char *start, *end;
+
+ stream = pex_read_output (pex, 0);
+ gcc_assert (stream);
+
+ num_files = 0;
+ while ((c = getc (stream)) != EOF)
+ {
+ obstack_1grow (&temporary_obstack, c);
+ if (c == '\n')
+ ++num_files;
+ }
+
+ lto_o_files = XNEWVEC (char *, num_files + 1);
+ lto_o_files[num_files] = NULL;
+ start = XOBFINISH (&temporary_obstack, char *);
+ for (i = 0; i < num_files; ++i)
+ {
+ end = start;
+ while (*end != '\n')
+ ++end;
+ *end = '\0';
+
+ lto_o_files[i] = xstrdup (start);
+
+ start = end + 1;
+ }
+
+ obstack_free (&temporary_obstack, temporary_firstobj);
+ }
+ do_wait (prog, pex);
+ pex = NULL;
+
+ /* After running the LTO back end, we will relink, substituting
+ the LTO output for the object files that we submitted to the
+ LTO. Here, we modify the linker command line for the relink. */
+ p = CONST_CAST2 (const char **, char **, lto_ld_argv);
+ lto_o_ptr = CONST_CAST2 (const char **, char **, lto_o_files);
+
+ while (*p != NULL)
+ {
+ for (list = lto_objects.first; list; list = list->next)
+ {
+ if (*p == list->name) /* Note test for pointer equality! */
+ {
+ /* Excise argument from linker command line. */
+ if (*lto_o_ptr)
+ {
+ /* Replace first argument with LTO output file. */
+ *p++ = *lto_o_ptr++;
+ }
+ else
+ {
+ /* Move following arguments one position earlier,
+ overwriting the current argument. */
+ q = p;
+ r = p + 1;
+ while (*r != NULL)
+ *q++ = *r++;
+ *q = NULL;
+ }
+
+ /* No need to continue searching the LTO object list. */
+ break;
+ }
+ }
+
+ /* If we didn't find a match, move on to the next argument.
+ Otherwise, P has been set to the correct argument position
+ at which to continue. */
+ if (!list) ++p;
+ }
+
+ /* The code above assumes we will never have more lto output files than
+ input files. Otherwise, we need to resize lto_ld_argv. Check this
+ assumption. */
+ if (*lto_o_ptr)
+ fatal ("too many lto output files");
+
+ /* Run the linker again, this time replacing the object files
+ optimized by the LTO with the temporary file generated by the LTO. */
+ fork_execute ("ld", lto_ld_argv);
+
+ maybe_unlink_list (lto_o_files);
+ }
+ else if (force)
+ {
+ /* Our caller is relying on us to do the link
+ even though there is no LTO back end work to be done. */
+ fork_execute ("ld", lto_ld_argv);
+ }
+}
/* Main program. */
@@ -935,14 +1213,25 @@ main (int argc, char **argv)
/* Parse command line early for instances of -debug. This allows
the debug flag to be set before functions like find_a_file()
- are called. */
+ are called. We also look for the -flto or -fwhopr flag to know
+ what LTO mode we are in. */
{
int i;
+ bool use_plugin = false;
for (i = 1; argv[i] != NULL; i ++)
{
if (! strcmp (argv[i], "-debug"))
debug = 1;
+ else if (! strcmp (argv[i], "-flto") && ! use_plugin)
+ lto_mode = LTO_MODE_LTO;
+ else if (! strcmp (argv[i], "-fwhopr") && ! use_plugin)
+ lto_mode = LTO_MODE_WHOPR;
+ else if (! strcmp (argv[i], "-plugin"))
+ {
+ use_plugin = true;
+ lto_mode = LTO_MODE_NONE;
+ }
#ifdef COLLECT_EXPORT_LIST
/* since -brtl, -bexport, -b64 are not position dependent
also check for them here */
@@ -985,8 +1274,8 @@ main (int argc, char **argv)
obstack_free (&temporary_obstack, temporary_firstobj);
/* -fno-profile-arcs -fno-test-coverage -fno-branch-probabilities
- -fno-exceptions -w */
- num_c_args += 5;
+ -fno-exceptions -w -fno-whole-program */
+ num_c_args += 6;
c_argv = XCNEWVEC (char *, num_c_args);
c_ptr = CONST_CAST2 (const char **, char **, c_argv);
@@ -1154,6 +1443,7 @@ main (int argc, char **argv)
*c_ptr++ = "-fno-branch-probabilities";
*c_ptr++ = "-fno-exceptions";
*c_ptr++ = "-w";
+ *c_ptr++ = "-fno-whole-program";
/* !!! When GCC calls collect2,
it does not know whether it is calling collect2 or ld.
@@ -1194,6 +1484,20 @@ main (int argc, char **argv)
}
break;
+ case 'f':
+ if (strcmp (arg, "-flto") == 0 || strcmp (arg, "-fwhopr") == 0)
+ {
+#ifdef ENABLE_LTO
+ /* Do not pass LTO flag to the linker. */
+ ld1--;
+ ld2--;
+#else
+ error ("LTO support has not been enabled in this "
+ "configuration");
+#endif
+ }
+ break;
+
case 'l':
if (first_file)
{
@@ -1456,6 +1760,9 @@ main (int argc, char **argv)
if (export_file != 0 && export_file[0])
maybe_unlink (export_file);
#endif
+ if (lto_mode)
+ maybe_run_lto_and_relink (ld1_argv, object_lst, object, false);
+
maybe_unlink (c_file);
maybe_unlink (o_file);
return 0;
@@ -1498,6 +1805,9 @@ main (int argc, char **argv)
if (ld1_filter == SCAN_NOTHING)
do_tlink (ld1_argv, object_lst);
+ if (lto_mode)
+ maybe_run_lto_and_relink (ld1_argv, object_lst, object, false);
+
/* Strip now if it was requested on the command line. */
if (strip_flag)
{
@@ -1591,9 +1901,15 @@ main (int argc, char **argv)
#ifdef COLLECT_EXPORT_LIST
/* On AIX we must call tlink because of possible templates resolution. */
do_tlink (ld2_argv, object_lst);
+
+ if (lto_mode)
+ maybe_run_lto_and_relink (ld2_argv, object_lst, object, false);
#else
/* Otherwise, simply call ld because tlink is already done. */
- fork_execute ("ld", ld2_argv);
+ if (lto_mode)
+ maybe_run_lto_and_relink (ld2_argv, object_lst, object, true);
+ else
+ fork_execute ("ld", ld2_argv);
/* Let scan_prog_file do any final mods (OSF/rose needs this for
constructors/destructors in shared libraries. */
@@ -1661,7 +1977,7 @@ do_wait (const char *prog, struct pex_obj *pex)
struct pex_obj *
collect_execute (const char *prog, char **argv, const char *outname,
- const char *errname)
+ const char *errname, int flags)
{
struct pex_obj *pex;
const char *errmsg;
@@ -1737,7 +2053,7 @@ collect_execute (const char *prog, char **argv, const char *outname,
if (pex == NULL)
fatal_perror ("pex_init failed");
- errmsg = pex_run (pex, PEX_LAST | PEX_SEARCH, argv[0], argv, outname,
+ errmsg = pex_run (pex, flags, argv[0], argv, outname,
errname, &err);
if (errmsg != NULL)
{
@@ -1761,7 +2077,7 @@ fork_execute (const char *prog, char **argv)
{
struct pex_obj *pex;
- pex = collect_execute (prog, argv, NULL, NULL);
+ pex = collect_execute (prog, argv, NULL, NULL, PEX_LAST | PEX_SEARCH);
do_wait (prog, pex);
}
@@ -1776,6 +2092,17 @@ maybe_unlink (const char *file)
notice ("[Leaving %s]\n", file);
}
+/* Call maybe_unlink on the NULL-terminated list, FILE_LIST. */
+
+static void
+maybe_unlink_list (char **file_list)
+{
+ char **tmp = file_list;
+
+ while (*tmp)
+ maybe_unlink (*(tmp++));
+}
+
static long sequence_number = 0;
@@ -2170,6 +2497,25 @@ write_aix_file (FILE *stream, struct id *list)
#ifdef OBJECT_FORMAT_NONE
+/* Check to make sure the file is an ELF file. LTO objects must
+ be in ELF format. */
+
+static bool
+is_elf (const char *prog_name)
+{
+ FILE *f;
+ char buf[4];
+ static char magic[4] = { 0x7f, 'E', 'L', 'F' };
+
+ f = fopen (prog_name, "r");
+ if (f == NULL)
+ return false;
+ if (fread (buf, sizeof (buf), 1, f) != 1)
+ buf[0] = 0;
+ fclose (f);
+ return memcmp (buf, magic, sizeof (magic)) == 0;
+}
+
/* Generic version to scan the name list of the loaded program for
the symbols g++ uses for static constructors and destructors. */
@@ -2189,10 +2535,17 @@ scan_prog_file (const char *prog_name, scanpass which_pass,
int err;
char *p, buf[1024];
FILE *inf;
+ int found_lto = 0;
if (which_pass == PASS_SECOND)
return;
+ /* LTO objects must be in ELF format. This check prevents
+ us from accepting an archive containing LTO objects, which
+ gcc cannnot currently handle. */
+ if (which_pass == PASS_LTOINFO && !is_elf (prog_name))
+ return;
+
/* If we do not have an `nm', complain. */
if (nm_file_name == 0)
fatal ("cannot find 'nm'");
@@ -2223,7 +2576,8 @@ scan_prog_file (const char *prog_name, scanpass which_pass,
if (pex == NULL)
fatal_perror ("pex_init failed");
- errmsg = pex_run (pex, 0, nm_file_name, real_nm_argv, NULL, NULL, &err);
+ errmsg = pex_run (pex, 0, nm_file_name, real_nm_argv, NULL, HOST_BIT_BUCKET,
+ &err);
if (errmsg != NULL)
{
if (err != 0)
@@ -2245,7 +2599,12 @@ scan_prog_file (const char *prog_name, scanpass which_pass,
fatal_perror ("can't open nm output");
if (debug)
- fprintf (stderr, "\nnm output with constructors/destructors.\n");
+ {
+ if (which_pass == PASS_LTOINFO)
+ fprintf (stderr, "\nnm output with LTO info marker symbol.\n");
+ else
+ fprintf (stderr, "\nnm output with constructors/destructors.\n");
+ }
/* Read each line of nm output. */
while (fgets (buf, sizeof buf, inf) != (char *) 0)
@@ -2253,6 +2612,33 @@ scan_prog_file (const char *prog_name, scanpass which_pass,
int ch, ch2;
char *name, *end;
+ if (debug)
+ fprintf (stderr, "\t%s\n", buf);
+
+ if (which_pass == PASS_LTOINFO)
+ {
+ if (found_lto)
+ continue;
+
+ /* Look for the LTO info marker symbol, and add filename to
+ the LTO objects list if found. */
+ for (p = buf; (ch = *p) != '\0' && ch != '\n'; p++)
+ if (ch == ' '
+ && (strncmp (p +1 , "gnu_lto_v1", 10) == 0)
+ && ISSPACE( p[11]))
+ {
+ add_lto_object (&lto_objects, prog_name);
+
+ /* We need to read all the input, so we can't just
+ return here. But we can avoid useless work. */
+ found_lto = 1;
+
+ break;
+ }
+
+ continue;
+ }
+
/* If it contains a constructor or destructor name, add the name
to the appropriate list unless this is a kind of symbol we're
not supposed to even consider. */
@@ -2319,9 +2705,6 @@ scan_prog_file (const char *prog_name, scanpass which_pass,
default: /* not a constructor or destructor */
continue;
}
-
- if (debug)
- fprintf (stderr, "\t%s\n", buf);
}
if (debug)
diff --git a/gcc/collect2.h b/gcc/collect2.h
index 3990b4ffec6..81113cfb68b 100644
--- a/gcc/collect2.h
+++ b/gcc/collect2.h
@@ -23,7 +23,7 @@ along with GCC; see the file COPYING3. If not see
extern void do_tlink (char **, char **);
extern struct pex_obj *collect_execute (const char *, char **, const char *,
- const char *);
+ const char *, int flags);
extern void collect_exit (int) ATTRIBUTE_NORETURN;
diff --git a/gcc/combine.c b/gcc/combine.c
index 35ab576d612..80c538ec490 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -321,7 +321,7 @@ static rtx *uid_log_links;
static int label_tick;
-/* Reset to label_tick for each label. */
+/* Reset to label_tick for each extended basic block in scanning order. */
static int label_tick_ebb_start;
@@ -1010,9 +1010,6 @@ clear_log_links (void)
if (INSN_P (insn))
free_INSN_LIST_list (&LOG_LINKS (insn));
}
-
-
-
/* Main entry point for combiner. F is the first insn of the function.
NREGS is the first unused pseudo-reg number.
@@ -1028,6 +1025,7 @@ combine_instructions (rtx f, unsigned int nregs)
#endif
rtx links, nextlinks;
rtx first;
+ basic_block last_bb;
int new_direct_jump_p = 0;
@@ -1058,6 +1056,7 @@ combine_instructions (rtx f, unsigned int nregs)
problems when, for example, we have j <<= 1 in a loop. */
nonzero_sign_valid = 0;
+ label_tick = label_tick_ebb_start = 1;
/* Scan all SETs and see if we can deduce anything about what
bits are known to be zero for some registers and how many copies
@@ -1067,18 +1066,23 @@ combine_instructions (rtx f, unsigned int nregs)
for what bits are known to be set. */
setup_incoming_promotions (first);
+ /* Allow the entry block and the first block to fall into the same EBB.
+ Conceptually the incoming promotions are assigned to the entry block. */
+ last_bb = ENTRY_BLOCK_PTR;
create_log_links ();
- label_tick_ebb_start = ENTRY_BLOCK_PTR->index;
FOR_EACH_BB (this_basic_block)
{
optimize_this_for_speed_p = optimize_bb_for_speed_p (this_basic_block);
last_call_luid = 0;
mem_last_set = -1;
- label_tick = this_basic_block->index;
+
+ label_tick++;
if (!single_pred_p (this_basic_block)
- || single_pred (this_basic_block)->index != label_tick - 1)
+ || single_pred (this_basic_block) != last_bb)
label_tick_ebb_start = label_tick;
+ last_bb = this_basic_block;
+
FOR_BB_INSNS (this_basic_block, insn)
if (INSN_P (insn) && BLOCK_FOR_INSN (insn))
{
@@ -1109,20 +1113,23 @@ combine_instructions (rtx f, unsigned int nregs)
nonzero_sign_valid = 1;
/* Now scan all the insns in forward order. */
-
- label_tick_ebb_start = ENTRY_BLOCK_PTR->index;
+ label_tick = label_tick_ebb_start = 1;
init_reg_last ();
setup_incoming_promotions (first);
+ last_bb = ENTRY_BLOCK_PTR;
FOR_EACH_BB (this_basic_block)
{
optimize_this_for_speed_p = optimize_bb_for_speed_p (this_basic_block);
last_call_luid = 0;
mem_last_set = -1;
- label_tick = this_basic_block->index;
+
+ label_tick++;
if (!single_pred_p (this_basic_block)
- || single_pred (this_basic_block)->index != label_tick - 1)
+ || single_pred (this_basic_block) != last_bb)
label_tick_ebb_start = label_tick;
+ last_bb = this_basic_block;
+
rtl_profile_for_bb (this_basic_block);
for (insn = BB_HEAD (this_basic_block);
insn != NEXT_INSN (BB_END (this_basic_block));
@@ -2257,68 +2264,33 @@ cleanup_auto_inc_dec (rtx src, bool after, enum machine_mode mem_mode)
return x;
}
-#endif
/* Auxiliary data structure for propagate_for_debug_stmt. */
struct rtx_subst_pair
{
- rtx from, to;
- bool changed;
-#ifdef AUTO_INC_DEC
+ rtx to;
bool adjusted;
bool after;
-#endif
};
-/* Clean up any auto-updates in PAIR->to the first time it is called
- for a PAIR. PAIR->adjusted is used to tell whether we've cleaned
- up before. */
+/* DATA points to an rtx_subst_pair. Return the value that should be
+ substituted. */
-static void
-auto_adjust_pair (struct rtx_subst_pair *pair ATTRIBUTE_UNUSED)
+static rtx
+propagate_for_debug_subst (rtx from ATTRIBUTE_UNUSED, void *data)
{
-#ifdef AUTO_INC_DEC
+ struct rtx_subst_pair *pair = (struct rtx_subst_pair *)data;
+
if (!pair->adjusted)
{
pair->adjusted = true;
pair->to = cleanup_auto_inc_dec (pair->to, pair->after, VOIDmode);
+ return pair->to;
}
-#endif
-}
-
-/* If *LOC is the same as FROM in the struct rtx_subst_pair passed as
- DATA, replace it with a copy of TO. Handle SUBREGs of *LOC as
- well. */
-
-static int
-propagate_for_debug_subst (rtx *loc, void *data)
-{
- struct rtx_subst_pair *pair = (struct rtx_subst_pair *)data;
- rtx from = pair->from, to = pair->to;
- rtx x = *loc, s = x;
-
- if (rtx_equal_p (x, from)
- || (GET_CODE (x) == SUBREG && rtx_equal_p ((s = SUBREG_REG (x)), from)))
- {
- auto_adjust_pair (pair);
- if (pair->to != to)
- to = pair->to;
- else
- to = copy_rtx (to);
- if (s != x)
- {
- gcc_assert (GET_CODE (x) == SUBREG && SUBREG_REG (x) == s);
- to = simplify_gen_subreg (GET_MODE (x), to,
- GET_MODE (from), SUBREG_BYTE (x));
- }
- *loc = wrap_constant (GET_MODE (x), to);
- pair->changed = true;
- return -1;
- }
-
- return 0;
+ return copy_rtx (pair->to);
}
+#endif
/* Replace occurrences of DEST with SRC in DEBUG_INSNs between INSN
and LAST. If MOVE holds, debug insns must also be moved past
@@ -2327,14 +2299,11 @@ propagate_for_debug_subst (rtx *loc, void *data)
static void
propagate_for_debug (rtx insn, rtx last, rtx dest, rtx src, bool move)
{
- struct rtx_subst_pair p;
- rtx next, move_pos = move ? last : NULL_RTX;
-
- p.from = dest;
- p.to = src;
- p.changed = false;
+ rtx next, move_pos = move ? last : NULL_RTX, loc;
#ifdef AUTO_INC_DEC
+ struct rtx_subst_pair p;
+ p.to = src;
p.adjusted = false;
p.after = move;
#endif
@@ -2346,11 +2315,15 @@ propagate_for_debug (rtx insn, rtx last, rtx dest, rtx src, bool move)
next = NEXT_INSN (insn);
if (DEBUG_INSN_P (insn))
{
- for_each_rtx (&INSN_VAR_LOCATION_LOC (insn),
- propagate_for_debug_subst, &p);
- if (!p.changed)
+#ifdef AUTO_INC_DEC
+ loc = simplify_replace_fn_rtx (INSN_VAR_LOCATION_LOC (insn),
+ dest, propagate_for_debug_subst, &p);
+#else
+ loc = simplify_replace_rtx (INSN_VAR_LOCATION_LOC (insn), dest, src);
+#endif
+ if (loc == INSN_VAR_LOCATION_LOC (insn))
continue;
- p.changed = false;
+ INSN_VAR_LOCATION_LOC (insn) = loc;
if (move_pos)
{
remove_insn (insn);
@@ -4186,9 +4159,12 @@ find_split_point (rtx *loc, rtx insn)
if (GET_CODE (XEXP (x, 0)) == CONST
|| GET_CODE (XEXP (x, 0)) == SYMBOL_REF)
{
+ enum machine_mode address_mode
+ = targetm.addr_space.address_mode (MEM_ADDR_SPACE (x));
+
SUBST (XEXP (x, 0),
- gen_rtx_LO_SUM (Pmode,
- gen_rtx_HIGH (Pmode, XEXP (x, 0)),
+ gen_rtx_LO_SUM (address_mode,
+ gen_rtx_HIGH (address_mode, XEXP (x, 0)),
XEXP (x, 0)));
return &XEXP (XEXP (x, 0), 0);
}
@@ -4201,7 +4177,8 @@ find_split_point (rtx *loc, rtx insn)
it will not remain in the result. */
if (GET_CODE (XEXP (x, 0)) == PLUS
&& CONST_INT_P (XEXP (XEXP (x, 0), 1))
- && ! memory_address_p (GET_MODE (x), XEXP (x, 0)))
+ && ! memory_address_addr_space_p (GET_MODE (x), XEXP (x, 0),
+ MEM_ADDR_SPACE (x)))
{
rtx reg = regno_reg_rtx[FIRST_PSEUDO_REGISTER];
rtx seq = combine_split_insns (gen_rtx_SET (VOIDmode, reg,
@@ -4224,8 +4201,9 @@ find_split_point (rtx *loc, rtx insn)
&& NONJUMP_INSN_P (NEXT_INSN (seq))
&& GET_CODE (PATTERN (NEXT_INSN (seq))) == SET
&& SET_DEST (PATTERN (NEXT_INSN (seq))) == reg
- && memory_address_p (GET_MODE (x),
- SET_SRC (PATTERN (NEXT_INSN (seq)))))
+ && memory_address_addr_space_p
+ (GET_MODE (x), SET_SRC (PATTERN (NEXT_INSN (seq))),
+ MEM_ADDR_SPACE (x)))
{
rtx src1 = SET_SRC (PATTERN (seq));
rtx src2 = SET_SRC (PATTERN (NEXT_INSN (seq)));
@@ -4264,7 +4242,8 @@ find_split_point (rtx *loc, rtx insn)
/* If we have a PLUS whose first operand is complex, try computing it
separately by making a split there. */
if (GET_CODE (XEXP (x, 0)) == PLUS
- && ! memory_address_p (GET_MODE (x), XEXP (x, 0))
+ && ! memory_address_addr_space_p (GET_MODE (x), XEXP (x, 0),
+ MEM_ADDR_SPACE (x))
&& ! OBJECT_P (XEXP (XEXP (x, 0), 0))
&& ! (GET_CODE (XEXP (XEXP (x, 0), 0)) == SUBREG
&& OBJECT_P (SUBREG_REG (XEXP (XEXP (x, 0), 0)))))
@@ -8811,6 +8790,12 @@ distribute_and_simplify_rtx (rtx x, int n)
enum rtx_code outer_code, inner_code;
rtx decomposed, distributed, inner_op0, inner_op1, new_op0, new_op1, tmp;
+ /* Distributivity is not true for floating point as it can change the
+ value. So we don't do it unless -funsafe-math-optimizations. */
+ if (FLOAT_MODE_P (GET_MODE (x))
+ && ! flag_unsafe_math_optimizations)
+ return NULL_RTX;
+
decomposed = XEXP (x, n);
if (!ARITHMETIC_P (decomposed))
return NULL_RTX;
@@ -11482,6 +11467,22 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
{
int zero_extended;
+ /* If this is a test for negative, we can make an explicit
+ test of the sign bit. Test this first so we can use
+ a paradoxical subreg to extend OP0. */
+
+ if (op1 == const0_rtx && (code == LT || code == GE)
+ && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT)
+ {
+ op0 = simplify_gen_binary (AND, tmode,
+ gen_lowpart (tmode, op0),
+ GEN_INT ((HOST_WIDE_INT) 1
+ << (GET_MODE_BITSIZE (mode)
+ - 1)));
+ code = (code == LT) ? NE : EQ;
+ break;
+ }
+
/* If the only nonzero bits in OP0 and OP1 are those in the
narrower mode and this is an equality or unsigned comparison,
we can use the wider mode. Similarly for sign-extended
@@ -11512,27 +11513,20 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
XEXP (op0, 0)),
gen_lowpart (tmode,
XEXP (op0, 1)));
-
- op0 = gen_lowpart (tmode, op0);
- if (zero_extended && CONST_INT_P (op1))
- op1 = GEN_INT (INTVAL (op1) & GET_MODE_MASK (mode));
- op1 = gen_lowpart (tmode, op1);
- break;
- }
-
- /* If this is a test for negative, we can make an explicit
- test of the sign bit. */
-
- if (op1 == const0_rtx && (code == LT || code == GE)
- && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT)
- {
- op0 = simplify_gen_binary (AND, tmode,
- gen_lowpart (tmode, op0),
- GEN_INT ((HOST_WIDE_INT) 1
- << (GET_MODE_BITSIZE (mode)
- - 1)));
- code = (code == LT) ? NE : EQ;
- break;
+ else
+ {
+ if (zero_extended)
+ {
+ op0 = simplify_gen_unary (ZERO_EXTEND, tmode, op0, mode);
+ op1 = simplify_gen_unary (ZERO_EXTEND, tmode, op1, mode);
+ }
+ else
+ {
+ op0 = simplify_gen_unary (SIGN_EXTEND, tmode, op0, mode);
+ op1 = simplify_gen_unary (SIGN_EXTEND, tmode, op1, mode);
+ }
+ break;
+ }
}
}
@@ -11752,12 +11746,10 @@ record_value_for_reg (rtx reg, rtx insn, rtx value)
case, we must replace it with (clobber (const_int 0)) to prevent
infinite loops. */
rsp = VEC_index (reg_stat_type, reg_stat, regno);
- if (value && ! get_last_value_validate (&value, insn,
- rsp->last_set_label, 0))
+ if (value && !get_last_value_validate (&value, insn, label_tick, 0))
{
value = copy_rtx (value);
- if (! get_last_value_validate (&value, insn,
- rsp->last_set_label, 1))
+ if (!get_last_value_validate (&value, insn, label_tick, 1))
value = 0;
}
@@ -12049,15 +12041,14 @@ check_promoted_subreg (rtx insn, rtx x)
}
}
-/* Utility routine for the following function. Verify that all the registers
- mentioned in *LOC are valid when *LOC was part of a value set when
- label_tick == TICK. Return 0 if some are not.
-
- If REPLACE is nonzero, replace the invalid reference with
- (clobber (const_int 0)) and return 1. This replacement is useful because
- we often can get useful information about the form of a value (e.g., if
- it was produced by a shift that always produces -1 or 0) even though
- we don't know exactly what registers it was produced from. */
+/* Verify that all the registers and memory references mentioned in *LOC are
+ still valid. *LOC was part of a value set in INSN when label_tick was
+ equal to TICK. Return 0 if some are not. If REPLACE is nonzero, replace
+ the invalid references with (clobber (const_int 0)) and return 1. This
+ replacement is useful because we often can get useful information about
+ the form of a value (e.g., if it was produced by a shift that always
+ produces -1 or 0) even though we don't know exactly what registers it
+ was produced from. */
static int
get_last_value_validate (rtx *loc, rtx insn, int tick, int replace)
@@ -12093,11 +12084,12 @@ get_last_value_validate (rtx *loc, rtx insn, int tick, int replace)
return 1;
}
- /* If this is a memory reference, make sure that there were
- no stores after it that might have clobbered the value. We don't
- have alias info, so we assume any store invalidates it. */
+ /* If this is a memory reference, make sure that there were no stores after
+ it that might have clobbered the value. We don't have alias info, so we
+ assume any store invalidates it. Moreover, we only have local UIDs, so
+ we also assume that there were stores in the intervening basic blocks. */
else if (MEM_P (x) && !MEM_READONLY_P (x)
- && DF_INSN_LUID (insn) <= mem_last_set)
+ && (tick != label_tick || DF_INSN_LUID (insn) <= mem_last_set))
{
if (replace)
*loc = gen_rtx_CLOBBER (GET_MODE (x), const0_rtx);
@@ -12207,16 +12199,14 @@ get_last_value (const_rtx x)
return 0;
/* If the value has all its registers valid, return it. */
- if (get_last_value_validate (&value, rsp->last_set,
- rsp->last_set_label, 0))
+ if (get_last_value_validate (&value, rsp->last_set, rsp->last_set_label, 0))
return value;
/* Otherwise, make a copy and replace any invalid register with
(clobber (const_int 0)). If that fails for some reason, return 0. */
value = copy_rtx (value);
- if (get_last_value_validate (&value, rsp->last_set,
- rsp->last_set_label, 1))
+ if (get_last_value_validate (&value, rsp->last_set, rsp->last_set_label, 1))
return value;
return 0;
diff --git a/gcc/common.opt b/gcc/common.opt
index 189f476a09e..77967f89dfd 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -502,6 +502,10 @@ femit-class-debug-always
Common Report Var(flag_emit_class_debug_always) Init(0)
Do not suppress C++ class debug information.
+fenable-icf-debug
+Common Report Var(flag_enable_icf_debug)
+Generate debug information to support Identical Code Folding (ICF)
+
fexceptions
Common Report Var(flag_exceptions) Optimization
Enable exception handling
@@ -713,6 +717,11 @@ fira-coalesce
Common Report Var(flag_ira_coalesce) Init(0)
Do optimistic coalescing.
+fira-loop-pressure
+Common Report Var(flag_ira_loop_pressure)
+Use IRA based register pressure calculation
+in RTL loop optimizations.
+
fira-share-save-slots
Common Report Var(flag_ira_share_save_slots) Init(1)
Share slots for saving different hard registers.
@@ -749,6 +758,19 @@ floop-optimize
Common
Does nothing. Preserved for backward compatibility.
+flto
+Common Var(flag_lto)
+Enable link-time optimization.
+
+; The initial value of -1 comes from Z_DEFAULT_COMPRESSION in zlib.h.
+flto-compression-level=
+Common Joined UInteger Var(flag_lto_compression_level) Init(-1)
+-flto-compression-level=<number> Use zlib compression level <number> for IL
+
+flto-report
+Common Report Var(flag_lto_report) Init(0) Optimization
+Report various link-time optimization statistics
+
fmath-errno
Common Report Var(flag_errno_math) Init(1) Optimization
Set errno after built-in math functions
@@ -1369,6 +1391,9 @@ funwind-tables
Common Report Var(flag_unwind_tables) Optimization
Just generate unwind tables for exception handling
+fuse-linker-plugin
+Common Undocumented
+
fvar-tracking
Common Report Var(flag_var_tracking) VarExists Optimization
Perform variable tracking
@@ -1432,6 +1457,10 @@ fweb
Common Report Var(flag_web) Init(2) Optimization
Construct webs and split unrelated uses of single variable
+fwhopr
+Common Var(flag_whopr)
+Enable partitioned link-time optimization.
+
ftree-builtin-call-dce
Common Report Var(flag_tree_builtin_call_dce) Init(0) Optimization
Enable conditional dead code elimination for builtin calls
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 1b0194b0589..1d3c3fc84f8 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -287,8 +287,8 @@ i[34567]86-*-*)
extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h
pmmintrin.h tmmintrin.h ammintrin.h smmintrin.h
nmmintrin.h bmmintrin.h fma4intrin.h wmmintrin.h
- immintrin.h x86intrin.h avxintrin.h
- ia32intrin.h cross-stdarg.h"
+ immintrin.h x86intrin.h avxintrin.h xopintrin.h
+ ia32intrin.h cross-stdarg.h lwpintrin.h"
;;
x86_64-*-*)
cpu_type=i386
@@ -297,8 +297,8 @@ x86_64-*-*)
extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h
pmmintrin.h tmmintrin.h ammintrin.h smmintrin.h
nmmintrin.h bmmintrin.h fma4intrin.h wmmintrin.h
- immintrin.h x86intrin.h avxintrin.h
- ia32intrin.h cross-stdarg.h"
+ immintrin.h x86intrin.h avxintrin.h xopintrin.h
+ ia32intrin.h cross-stdarg.h lwpintrin.h"
need_64bit_hwint=yes
;;
ia64-*-*)
@@ -327,7 +327,7 @@ powerpc*-*-*)
extra_headers="ppc-asm.h altivec.h spe.h ppu_intrinsics.h paired.h spu2vmx.h vec_types.h si2vmx.h"
need_64bit_hwint=yes
case x$with_cpu in
- xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[34567]|xpower6x|xrs64a|xcell)
+ xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[34567]|xpower6x|xrs64a|xcell|xa2)
cpu_is_64bit=yes
;;
esac
@@ -722,7 +722,7 @@ arm*-*-linux*) # ARM GNU/Linux with ELF
case ${target} in
arm*-*-linux-*eabi)
tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
- tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
+ tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc"
# The BPABI long long divmod functions return a 128-bit value in
# registers r0-r3. Correctly modeling that requires the use of
# TImode.
@@ -2077,9 +2077,12 @@ rs6000-ibm-aix[6789].* | powerpc-ibm-aix[6789].*)
use_gcc_stdint=wrap
extra_headers=altivec.h
;;
+rx-*-elf*)
+ tm_file="dbxelf.h elfos.h svr4.h newlib-stdint.h ${tm_file} ../../libgcc/config/rx/rx-abi.h"
+ tmake_file="${tmake_file} rx/t-rx"
+ ;;
s390-*-linux*)
tm_file="s390/s390.h dbxelf.h elfos.h svr4.h linux.h glibc-stdint.h s390/linux.h"
- tmake_file="${tmake_file} t-dfprules s390/t-crtstuff s390/t-linux"
;;
s390x-*-linux*)
tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h svr4.h linux.h glibc-stdint.h s390/linux.h"
@@ -2087,7 +2090,7 @@ s390x-*-linux*)
md_file=s390/s390.md
extra_modes=s390/s390-modes.def
out_file=s390/s390.c
- tmake_file="${tmake_file} t-dfprules s390/t-crtstuff s390/t-linux s390/t-linux64"
+ tmake_file="${tmake_file} s390/t-linux64"
;;
s390x-ibm-tpf*)
tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h svr4.h s390/tpf.h"
@@ -2096,7 +2099,6 @@ s390x-ibm-tpf*)
extra_modes=s390/s390-modes.def
out_file=s390/s390.c
extra_parts="crtbeginS.o crtendS.o"
- tmake_file="s390/t-crtstuff s390/t-tpf"
thread_file='tpf'
extra_options="${extra_options} s390/tpf.opt"
;;
@@ -2447,7 +2449,7 @@ sparc64-*-netbsd*)
spu-*-elf*)
tm_file="dbxelf.h elfos.h spu/spu-elf.h spu/spu.h newlib-stdint.h"
tmake_file="spu/t-spu-elf"
- extra_headers="spu_intrinsics.h spu_internals.h vmx2spu.h spu_mfcio.h vec_types.h"
+ extra_headers="spu_intrinsics.h spu_internals.h vmx2spu.h spu_mfcio.h vec_types.h spu_cache.h"
extra_modes=spu/spu-modes.def
c_target_objs="${c_target_objs} spu-c.o"
cxx_target_objs="${cxx_target_objs} spu-c.o"
@@ -2501,7 +2503,7 @@ v850-*-*)
;;
vax-*-linux*)
tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h vax/elf.h vax/linux.h"
- tmake_file=vax/t-linux
+ tmake_file="${tmake_file} vax/t-linux"
;;
vax-*-netbsdelf*)
tm_file="${tm_file} elfos.h netbsd.h netbsd-elf.h vax/elf.h vax/netbsd-elf.h"
@@ -3068,9 +3070,9 @@ case "${target}" in
| power | power[234567] | power6x | powerpc | powerpc64 \
| rios | rios1 | rios2 | rsc | rsc1 | rs64a \
| 401 | 403 | 405 | 405fp | 440 | 440fp | 464 | 464fp \
- | 505 | 601 | 602 | 603 | 603e | ec603e | 604 \
- | 604e | 620 | 630 | 740 | 750 | 7400 | 7450 \
- | e300c[23] | 854[08] | e500mc \
+ | 476 | 476fp | 505 | 601 | 602 | 603 | 603e | ec603e \
+ | 604 | 604e | 620 | 630 | 740 | 750 | 7400 | 7450 \
+ | a2 | e300c[23] | 854[08] | e500mc \
| 801 | 821 | 823 | 860 | 970 | G3 | G4 | G5 | cell)
# OK
;;
diff --git a/gcc/config.host b/gcc/config.host
index 4affcb06b17..9738345c8a2 100644
--- a/gcc/config.host
+++ b/gcc/config.host
@@ -130,7 +130,7 @@ case ${host} in
;;
esac
case ${host} in
- *-*-linux* )
+ *-*-linux* | *-*-freebsd*)
if test "${GCC}:${ac_cv_sizeof_long}" = yes:4; then
# On powerpc*-*-linux* use -Wl,--relax to link cc1,
# if ld is new enough, otherwise force -O1 in CFLAGS.
diff --git a/gcc/config.in b/gcc/config.in
index 12573fd1579..a3e9069e129 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -113,6 +113,12 @@
#endif
+/* Define to enable LTO support. */
+#ifndef USED_FOR_TARGET
+#undef ENABLE_LTO
+#endif
+
+
/* Define to 1 if translation of program messages to the user's native
language is requested. */
#ifndef USED_FOR_TARGET
@@ -205,6 +211,12 @@
#endif
+/* Define if your assembler supports the DCI/ICI instructions. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_AS_DCI
+#endif
+
+
/* Define if your assembler supports the --debug-prefix-map option. */
#ifndef USED_FOR_TARGET
#undef HAVE_AS_DEBUG_PREFIX_MAP
@@ -303,6 +315,12 @@
#endif
+/* Define if your assembler supports the swap suffix. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_AS_IX86_SWAP
+#endif
+
+
/* Define if your assembler supports the lituse_jsrdirect relocation. */
#ifndef USED_FOR_TARGET
#undef HAVE_AS_JSRDIRECT_RELOCS
@@ -1453,6 +1471,12 @@
#endif
+/* Define if libelf is in use. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_libelf
+#endif
+
+
/* Define if mpc is in use. */
#ifndef USED_FOR_TARGET
#undef HAVE_mpc
diff --git a/gcc/config/alpha/osf.h b/gcc/config/alpha/osf.h
index 2b5165c0754..81c12aa14fc 100644
--- a/gcc/config/alpha/osf.h
+++ b/gcc/config/alpha/osf.h
@@ -167,10 +167,6 @@ __enable_execute_stack (void *addr) \
#define LD_INIT_SWITCH "-init"
#define LD_FINI_SWITCH "-fini"
-/* The linker needs a space after "-o". This allows -oldstyle_liblookup to
- be passed to ld. */
-#define SWITCHES_NEED_SPACES "o"
-
/* Select a format to encode pointers in exception handling data. CODE
is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
true if the symbol may be affected by dynamic relocations.
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index cd5a0ed1403..4c7fcb65854 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -133,11 +133,12 @@ static enum machine_mode arm_promote_function_mode (const_tree,
const_tree, int);
static bool arm_return_in_memory (const_tree, const_tree);
static rtx arm_function_value (const_tree, const_tree, bool);
-static rtx arm_libcall_value (enum machine_mode, rtx);
+static rtx arm_libcall_value (enum machine_mode, const_rtx);
static void arm_internal_label (FILE *, const char *, unsigned long);
static void arm_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT,
tree);
+static bool arm_have_conditional_execution (void);
static bool arm_rtx_costs_1 (rtx, enum rtx_code, int*, bool);
static bool arm_size_rtx_costs (rtx, enum rtx_code, enum rtx_code, int *);
static bool arm_slowmul_rtx_costs (rtx, enum rtx_code, enum rtx_code, int *, bool);
@@ -445,6 +446,9 @@ static const struct attribute_spec arm_attribute_table[] =
#define TARGET_HAVE_TLS true
#endif
+#undef TARGET_HAVE_CONDITIONAL_EXECUTION
+#define TARGET_HAVE_CONDITIONAL_EXECUTION arm_have_conditional_execution
+
#undef TARGET_CANNOT_FORCE_CONST_MEM
#define TARGET_CANNOT_FORCE_CONST_MEM arm_cannot_force_const_mem
@@ -520,14 +524,11 @@ enum processor_type arm_tune = arm_none;
/* The default processor used if not overridden by commandline. */
static enum processor_type arm_default_cpu = arm_none;
-/* Which floating point model to use. */
-enum arm_fp_model arm_fp_model;
-
-/* Which floating point hardware is available. */
-enum fputype arm_fpu_arch;
-
/* Which floating point hardware to schedule for. */
-enum fputype arm_fpu_tune;
+int arm_fpu_attr;
+
+/* Which floating popint hardware to use. */
+const struct arm_fpu_desc *arm_fpu_desc;
/* Whether to use floating point hardware. */
enum float_abi_type arm_float_abi;
@@ -805,46 +806,21 @@ static struct arm_cpu_select arm_select[] =
char arm_arch_name[] = "__ARM_ARCH_0UNK__";
-struct fpu_desc
-{
- const char * name;
- enum fputype fpu;
-};
-
-
/* Available values for -mfpu=. */
-static const struct fpu_desc all_fpus[] =
-{
- {"fpa", FPUTYPE_FPA},
- {"fpe2", FPUTYPE_FPA_EMU2},
- {"fpe3", FPUTYPE_FPA_EMU2},
- {"maverick", FPUTYPE_MAVERICK},
- {"vfp", FPUTYPE_VFP},
- {"vfp3", FPUTYPE_VFP3},
- {"vfpv3", FPUTYPE_VFP3},
- {"vfpv3-d16", FPUTYPE_VFP3D16},
- {"neon", FPUTYPE_NEON},
- {"neon-fp16", FPUTYPE_NEON_FP16}
-};
-
-
-/* Floating point models used by the different hardware.
- See fputype in arm.h. */
-
-static const enum arm_fp_model fp_model_for_fpu[] =
-{
- /* No FP hardware. */
- ARM_FP_MODEL_UNKNOWN, /* FPUTYPE_NONE */
- ARM_FP_MODEL_FPA, /* FPUTYPE_FPA */
- ARM_FP_MODEL_FPA, /* FPUTYPE_FPA_EMU2 */
- ARM_FP_MODEL_FPA, /* FPUTYPE_FPA_EMU3 */
- ARM_FP_MODEL_MAVERICK, /* FPUTYPE_MAVERICK */
- ARM_FP_MODEL_VFP, /* FPUTYPE_VFP */
- ARM_FP_MODEL_VFP, /* FPUTYPE_VFP3D16 */
- ARM_FP_MODEL_VFP, /* FPUTYPE_VFP3 */
- ARM_FP_MODEL_VFP, /* FPUTYPE_NEON */
- ARM_FP_MODEL_VFP /* FPUTYPE_NEON_FP16 */
+static const struct arm_fpu_desc all_fpus[] =
+{
+ {"fpa", ARM_FP_MODEL_FPA, 0, 0, false, false},
+ {"fpe2", ARM_FP_MODEL_FPA, 2, 0, false, false},
+ {"fpe3", ARM_FP_MODEL_FPA, 3, 0, false, false},
+ {"maverick", ARM_FP_MODEL_MAVERICK, 0, 0, false, false},
+ {"vfp", ARM_FP_MODEL_VFP, 2, VFP_REG_D16, false, false},
+ {"vfpv3", ARM_FP_MODEL_VFP, 3, VFP_REG_D32, false, false},
+ {"vfpv3-d16", ARM_FP_MODEL_VFP, 3, VFP_REG_D16, false, false},
+ {"neon", ARM_FP_MODEL_VFP, 3, VFP_REG_D32, true , false},
+ {"neon-fp16", ARM_FP_MODEL_VFP, 3, VFP_REG_D32, true , true },
+ /* Compatibility aliases. */
+ {"vfp3", ARM_FP_MODEL_VFP, 3, VFP_REG_D32, false, false},
};
@@ -1298,13 +1274,6 @@ arm_override_options (void)
enum processor_type target_arch_cpu = arm_none;
enum processor_type selected_cpu = arm_none;
- /* Ideally we would want to use CFI directives to generate
- debug info. However this also creates the .eh_frame
- section, so disable them until GAS can handle
- this properly. See PR40521. */
- if (TARGET_AAPCS_BASED)
- flag_dwarf2_cfi_asm = 0;
-
/* Set up the flags based on the cpu/architecture selected by the user. */
for (i = ARRAY_SIZE (arm_select); i--;)
{
@@ -1618,7 +1587,6 @@ arm_override_options (void)
if (TARGET_IWMMXT_ABI && !TARGET_IWMMXT)
error ("iwmmxt abi requires an iwmmxt capable cpu");
- arm_fp_model = ARM_FP_MODEL_UNKNOWN;
if (target_fpu_name == NULL && target_fpe_name != NULL)
{
if (streq (target_fpe_name, "2"))
@@ -1629,46 +1597,52 @@ arm_override_options (void)
error ("invalid floating point emulation option: -mfpe=%s",
target_fpe_name);
}
- if (target_fpu_name != NULL)
- {
- /* The user specified a FPU. */
- for (i = 0; i < ARRAY_SIZE (all_fpus); i++)
- {
- if (streq (all_fpus[i].name, target_fpu_name))
- {
- arm_fpu_arch = all_fpus[i].fpu;
- arm_fpu_tune = arm_fpu_arch;
- arm_fp_model = fp_model_for_fpu[arm_fpu_arch];
- break;
- }
- }
- if (arm_fp_model == ARM_FP_MODEL_UNKNOWN)
- error ("invalid floating point option: -mfpu=%s", target_fpu_name);
- }
- else
+
+ if (target_fpu_name == NULL)
{
#ifdef FPUTYPE_DEFAULT
- /* Use the default if it is specified for this platform. */
- arm_fpu_arch = FPUTYPE_DEFAULT;
- arm_fpu_tune = FPUTYPE_DEFAULT;
+ target_fpu_name = FPUTYPE_DEFAULT;
#else
- /* Pick one based on CPU type. */
- /* ??? Some targets assume FPA is the default.
- if ((insn_flags & FL_VFP) != 0)
- arm_fpu_arch = FPUTYPE_VFP;
- else
- */
if (arm_arch_cirrus)
- arm_fpu_arch = FPUTYPE_MAVERICK;
+ target_fpu_name = "maverick";
else
- arm_fpu_arch = FPUTYPE_FPA_EMU2;
+ target_fpu_name = "fpe2";
#endif
- if (tune_flags & FL_CO_PROC && arm_fpu_arch == FPUTYPE_FPA_EMU2)
- arm_fpu_tune = FPUTYPE_FPA;
+ }
+
+ arm_fpu_desc = NULL;
+ for (i = 0; i < ARRAY_SIZE (all_fpus); i++)
+ {
+ if (streq (all_fpus[i].name, target_fpu_name))
+ {
+ arm_fpu_desc = &all_fpus[i];
+ break;
+ }
+ }
+ if (!arm_fpu_desc)
+ error ("invalid floating point option: -mfpu=%s", target_fpu_name);
+
+ switch (arm_fpu_desc->model)
+ {
+ case ARM_FP_MODEL_FPA:
+ if (arm_fpu_desc->rev == 2)
+ arm_fpu_attr = FPU_FPE2;
+ else if (arm_fpu_desc->rev == 3)
+ arm_fpu_attr = FPU_FPE3;
else
- arm_fpu_tune = arm_fpu_arch;
- arm_fp_model = fp_model_for_fpu[arm_fpu_arch];
- gcc_assert (arm_fp_model != ARM_FP_MODEL_UNKNOWN);
+ arm_fpu_attr = FPU_FPA;
+ break;
+
+ case ARM_FP_MODEL_MAVERICK:
+ arm_fpu_attr = FPU_MAVERICK;
+ break;
+
+ case ARM_FP_MODEL_VFP:
+ arm_fpu_attr = FPU_VFP;
+ break;
+
+ default:
+ gcc_unreachable();
}
if (target_float_abi_name != NULL)
@@ -1690,7 +1664,7 @@ arm_override_options (void)
arm_float_abi = TARGET_DEFAULT_FLOAT_ABI;
if (TARGET_AAPCS_BASED
- && (arm_fp_model == ARM_FP_MODEL_FPA))
+ && (arm_fpu_desc->model == ARM_FP_MODEL_FPA))
error ("FPA is unsupported in the AAPCS");
if (TARGET_AAPCS_BASED)
@@ -1718,7 +1692,7 @@ arm_override_options (void)
/* If soft-float is specified then don't use FPU. */
if (TARGET_SOFT_FLOAT)
- arm_fpu_arch = FPUTYPE_NONE;
+ arm_fpu_attr = FPU_NONE;
if (TARGET_AAPCS_BASED)
{
@@ -1745,8 +1719,7 @@ arm_override_options (void)
/* For arm2/3 there is no need to do any scheduling if there is only
a floating point emulator, or we are doing software floating-point. */
if ((TARGET_SOFT_FLOAT
- || arm_fpu_tune == FPUTYPE_FPA_EMU2
- || arm_fpu_tune == FPUTYPE_FPA_EMU3)
+ || (TARGET_FPA && arm_fpu_desc->rev))
&& (tune_flags & FL_MODE32) == 0)
flag_schedule_insns = flag_schedule_insns_after_reload = 0;
@@ -1871,6 +1844,23 @@ arm_override_options (void)
max_insns_skipped = 3;
}
+ /* Hot/Cold partitioning is not currently supported, since we can't
+ handle literal pool placement in that case. */
+ if (flag_reorder_blocks_and_partition)
+ {
+ inform (input_location,
+ "-freorder-blocks-and-partition not supported on this architecture");
+ flag_reorder_blocks_and_partition = 0;
+ flag_reorder_blocks = 1;
+ }
+
+ /* Ideally we would want to use CFI directives to generate
+ debug info. However this also creates the .eh_frame
+ section, so disable them until GAS can handle
+ this properly. See PR40521. */
+ if (TARGET_AAPCS_BASED)
+ flag_dwarf2_cfi_asm = 0;
+
/* Register global variables with the garbage collector. */
arm_add_gc_roots ();
}
@@ -2393,20 +2383,24 @@ arm_split_constant (enum rtx_code code, enum machine_mode mode, rtx insn,
1);
}
-/* Return the number of ARM instructions required to synthesize the given
- constant. */
+/* Return the number of instructions required to synthesize the given
+ constant, if we start emitting them from bit-position I. */
static int
count_insns_for_constant (HOST_WIDE_INT remainder, int i)
{
HOST_WIDE_INT temp1;
+ int step_size = TARGET_ARM ? 2 : 1;
int num_insns = 0;
+
+ gcc_assert (TARGET_ARM || i == 0);
+
do
{
int end;
if (i <= 0)
i += 32;
- if (remainder & (3 << (i - 2)))
+ if (remainder & (((1 << step_size) - 1) << (i - step_size)))
{
end = i - 8;
if (end < 0)
@@ -2415,13 +2409,77 @@ count_insns_for_constant (HOST_WIDE_INT remainder, int i)
| ((i < end) ? (0xff >> (32 - end)) : 0));
remainder &= ~temp1;
num_insns++;
- i -= 6;
+ i -= 8 - step_size;
}
- i -= 2;
+ i -= step_size;
} while (remainder);
return num_insns;
}
+static int
+find_best_start (unsigned HOST_WIDE_INT remainder)
+{
+ int best_consecutive_zeros = 0;
+ int i;
+ int best_start = 0;
+
+ /* If we aren't targetting ARM, the best place to start is always at
+ the bottom. */
+ if (! TARGET_ARM)
+ return 0;
+
+ for (i = 0; i < 32; i += 2)
+ {
+ int consecutive_zeros = 0;
+
+ if (!(remainder & (3 << i)))
+ {
+ while ((i < 32) && !(remainder & (3 << i)))
+ {
+ consecutive_zeros += 2;
+ i += 2;
+ }
+ if (consecutive_zeros > best_consecutive_zeros)
+ {
+ best_consecutive_zeros = consecutive_zeros;
+ best_start = i - consecutive_zeros;
+ }
+ i -= 2;
+ }
+ }
+
+ /* So long as it won't require any more insns to do so, it's
+ desirable to emit a small constant (in bits 0...9) in the last
+ insn. This way there is more chance that it can be combined with
+ a later addressing insn to form a pre-indexed load or store
+ operation. Consider:
+
+ *((volatile int *)0xe0000100) = 1;
+ *((volatile int *)0xe0000110) = 2;
+
+ We want this to wind up as:
+
+ mov rA, #0xe0000000
+ mov rB, #1
+ str rB, [rA, #0x100]
+ mov rB, #2
+ str rB, [rA, #0x110]
+
+ rather than having to synthesize both large constants from scratch.
+
+ Therefore, we calculate how many insns would be required to emit
+ the constant starting from `best_start', and also starting from
+ zero (i.e. with bit 31 first to be output). If `best_start' doesn't
+ yield a shorter sequence, we may as well use zero. */
+ if (best_start != 0
+ && ((((unsigned HOST_WIDE_INT) 1) << best_start) < remainder)
+ && (count_insns_for_constant (remainder, 0) <=
+ count_insns_for_constant (remainder, best_start)))
+ best_start = 0;
+
+ return best_start;
+}
+
/* Emit an instruction with the indicated PATTERN. If COND is
non-NULL, conditionalize the execution of the instruction on COND
being true. */
@@ -2445,6 +2503,7 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, rtx cond,
{
int can_invert = 0;
int can_negate = 0;
+ int final_invert = 0;
int can_negate_initial = 0;
int can_shift = 0;
int i;
@@ -2456,6 +2515,7 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, rtx cond,
int insns = 0;
unsigned HOST_WIDE_INT temp1, temp2;
unsigned HOST_WIDE_INT remainder = val & 0xffffffff;
+ int step_size = TARGET_ARM ? 2 : 1;
/* Find out which operations are safe for a given CODE. Also do a quick
check for degenerate cases; these can occur when DImode operations
@@ -2529,14 +2589,15 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, rtx cond,
return 1;
}
- /* We don't know how to handle other cases yet. */
- gcc_assert (remainder == 0xffffffff);
-
- if (generate)
- emit_constant_insn (cond,
- gen_rtx_SET (VOIDmode, target,
- gen_rtx_NOT (mode, source)));
- return 1;
+ if (remainder == 0xffffffff)
+ {
+ if (generate)
+ emit_constant_insn (cond,
+ gen_rtx_SET (VOIDmode, target,
+ gen_rtx_NOT (mode, source)));
+ return 1;
+ }
+ break;
case MINUS:
/* We treat MINUS as (val - source), since (source - val) is always
@@ -2987,9 +3048,25 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, rtx cond,
if ((code == AND)
|| (code != IOR && can_invert && num_bits_set > 16))
- remainder = (~remainder) & 0xffffffff;
+ remainder ^= 0xffffffff;
else if (code == PLUS && num_bits_set > 16)
remainder = (-remainder) & 0xffffffff;
+
+ /* For XOR, if more than half the bits are set and there's a sequence
+ of more than 8 consecutive ones in the pattern then we can XOR by the
+ inverted constant and then invert the final result; this may save an
+ instruction and might also lead to the final mvn being merged with
+ some other operation. */
+ else if (code == XOR && num_bits_set > 16
+ && (count_insns_for_constant (remainder ^ 0xffffffff,
+ find_best_start
+ (remainder ^ 0xffffffff))
+ < count_insns_for_constant (remainder,
+ find_best_start (remainder))))
+ {
+ remainder ^= 0xffffffff;
+ final_invert = 1;
+ }
else
{
can_invert = 0;
@@ -3008,63 +3085,8 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, rtx cond,
/* ??? Use thumb2 replicated constants when the high and low halfwords are
the same. */
{
- int best_start = 0;
- if (!TARGET_THUMB2)
- {
- int best_consecutive_zeros = 0;
-
- for (i = 0; i < 32; i += 2)
- {
- int consecutive_zeros = 0;
-
- if (!(remainder & (3 << i)))
- {
- while ((i < 32) && !(remainder & (3 << i)))
- {
- consecutive_zeros += 2;
- i += 2;
- }
- if (consecutive_zeros > best_consecutive_zeros)
- {
- best_consecutive_zeros = consecutive_zeros;
- best_start = i - consecutive_zeros;
- }
- i -= 2;
- }
- }
-
- /* So long as it won't require any more insns to do so, it's
- desirable to emit a small constant (in bits 0...9) in the last
- insn. This way there is more chance that it can be combined with
- a later addressing insn to form a pre-indexed load or store
- operation. Consider:
-
- *((volatile int *)0xe0000100) = 1;
- *((volatile int *)0xe0000110) = 2;
-
- We want this to wind up as:
-
- mov rA, #0xe0000000
- mov rB, #1
- str rB, [rA, #0x100]
- mov rB, #2
- str rB, [rA, #0x110]
-
- rather than having to synthesize both large constants from scratch.
-
- Therefore, we calculate how many insns would be required to emit
- the constant starting from `best_start', and also starting from
- zero (i.e. with bit 31 first to be output). If `best_start' doesn't
- yield a shorter sequence, we may as well use zero. */
- if (best_start != 0
- && ((((unsigned HOST_WIDE_INT) 1) << best_start) < remainder)
- && (count_insns_for_constant (remainder, 0) <=
- count_insns_for_constant (remainder, best_start)))
- best_start = 0;
- }
-
/* Now start emitting the insns. */
- i = best_start;
+ i = find_best_start (remainder);
do
{
int end;
@@ -3092,7 +3114,7 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, rtx cond,
}
else
{
- if (remainder && subtargets)
+ if ((final_invert || remainder) && subtargets)
new_src = gen_reg_rtx (mode);
else
new_src = target;
@@ -3127,21 +3149,23 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, rtx cond,
code = PLUS;
insns++;
- if (TARGET_ARM)
- i -= 6;
- else
- i -= 7;
+ i -= 8 - step_size;
}
/* Arm allows rotates by a multiple of two. Thumb-2 allows arbitrary
shifts. */
- if (TARGET_ARM)
- i -= 2;
- else
- i--;
+ i -= step_size;
}
while (remainder);
}
+ if (final_invert)
+ {
+ if (generate)
+ emit_constant_insn (cond, gen_rtx_SET (VOIDmode, target,
+ gen_rtx_NOT (mode, source)));
+ insns++;
+ }
+
return insns;
}
@@ -3264,7 +3288,7 @@ add_libcall (htab_t htab, rtx libcall)
}
static bool
-arm_libcall_uses_aapcs_base (rtx libcall)
+arm_libcall_uses_aapcs_base (const_rtx libcall)
{
static bool init_done = false;
static htab_t libcall_htab;
@@ -3311,7 +3335,7 @@ arm_libcall_uses_aapcs_base (rtx libcall)
}
rtx
-arm_libcall_value (enum machine_mode mode, rtx libcall)
+arm_libcall_value (enum machine_mode mode, const_rtx libcall)
{
if (TARGET_AAPCS_BASED && arm_pcs_default != ARM_PCS_AAPCS
&& GET_MODE_CLASS (mode) == MODE_FLOAT)
@@ -6201,7 +6225,7 @@ thumb1_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer)
else if ((outer == PLUS || outer == COMPARE)
&& INTVAL (x) < 256 && INTVAL (x) > -256)
return 0;
- else if (outer == AND
+ else if ((outer == IOR || outer == XOR || outer == AND)
&& INTVAL (x) < 256 && INTVAL (x) >= -256)
return COSTS_N_INSNS (1);
else if (outer == ASHIFT || outer == ASHIFTRT
@@ -12269,7 +12293,7 @@ output_move_neon (rtx *operands)
{
/* We're only using DImode here because it's a convenient size. */
ops[0] = gen_rtx_REG (DImode, REGNO (reg) + 2 * i);
- ops[1] = adjust_address (mem, SImode, 8 * i);
+ ops[1] = adjust_address (mem, DImode, 8 * i);
if (reg_overlap_mentioned_p (ops[0], mem))
{
gcc_assert (overlap == -1);
@@ -13257,7 +13281,7 @@ arm_output_epilogue (rtx sibling)
/* This variable is for the Virtual Frame Pointer, not VFP regs. */
int vfp_offset = offsets->frame;
- if (arm_fpu_arch == FPUTYPE_FPA_EMU2)
+ if (TARGET_FPA_EMU2)
{
for (reg = LAST_FPA_REGNUM; reg >= FIRST_FPA_REGNUM; reg--)
if (df_regs_ever_live_p (reg) && !call_used_regs[reg])
@@ -13480,7 +13504,7 @@ arm_output_epilogue (rtx sibling)
SP_REGNUM, HARD_FRAME_POINTER_REGNUM);
}
- if (arm_fpu_arch == FPUTYPE_FPA_EMU2)
+ if (TARGET_FPA_EMU2)
{
for (reg = FIRST_FPA_REGNUM; reg <= LAST_FPA_REGNUM; reg++)
if (df_regs_ever_live_p (reg) && !call_used_regs[reg])
@@ -14206,7 +14230,7 @@ arm_save_coproc_regs(void)
/* Save any floating point call-saved registers used by this
function. */
- if (arm_fpu_arch == FPUTYPE_FPA_EMU2)
+ if (TARGET_FPA_EMU2)
{
for (reg = LAST_FPA_REGNUM; reg >= FIRST_FPA_REGNUM; reg--)
if (df_regs_ever_live_p (reg) && !call_used_regs[reg])
@@ -19688,45 +19712,8 @@ arm_file_start (void)
}
else
{
- int set_float_abi_attributes = 0;
- switch (arm_fpu_arch)
- {
- case FPUTYPE_FPA:
- fpu_name = "fpa";
- break;
- case FPUTYPE_FPA_EMU2:
- fpu_name = "fpe2";
- break;
- case FPUTYPE_FPA_EMU3:
- fpu_name = "fpe3";
- break;
- case FPUTYPE_MAVERICK:
- fpu_name = "maverick";
- break;
- case FPUTYPE_VFP:
- fpu_name = "vfp";
- set_float_abi_attributes = 1;
- break;
- case FPUTYPE_VFP3D16:
- fpu_name = "vfpv3-d16";
- set_float_abi_attributes = 1;
- break;
- case FPUTYPE_VFP3:
- fpu_name = "vfpv3";
- set_float_abi_attributes = 1;
- break;
- case FPUTYPE_NEON:
- fpu_name = "neon";
- set_float_abi_attributes = 1;
- break;
- case FPUTYPE_NEON_FP16:
- fpu_name = "neon-fp16";
- set_float_abi_attributes = 1;
- break;
- default:
- abort();
- }
- if (set_float_abi_attributes)
+ fpu_name = arm_fpu_desc->name;
+ if (arm_fpu_desc->model == ARM_FP_MODEL_VFP)
{
if (TARGET_HARD_FLOAT)
asm_fprintf (asm_out_file, "\t.eabi_attribute 27, 3\n");
@@ -21173,4 +21160,12 @@ arm_frame_pointer_required (void)
|| (TARGET_ARM && TARGET_APCS_FRAME && ! leaf_function_p ()));
}
+/* Only thumb1 can't support conditional execution, so return true if
+ the target is not thumb1. */
+static bool
+arm_have_conditional_execution (void)
+{
+ return !TARGET_THUMB1;
+}
+
#include "gt-arm.h"
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 9272ca51cba..2dfd22df45c 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -190,9 +190,9 @@ extern void (*arm_lang_output_object_attributes_hook)(void);
#define TARGET_HARD_FLOAT (arm_float_abi != ARM_FLOAT_ABI_SOFT)
/* Use hardware floating point calling convention. */
#define TARGET_HARD_FLOAT_ABI (arm_float_abi == ARM_FLOAT_ABI_HARD)
-#define TARGET_FPA (arm_fp_model == ARM_FP_MODEL_FPA)
-#define TARGET_MAVERICK (arm_fp_model == ARM_FP_MODEL_MAVERICK)
-#define TARGET_VFP (arm_fp_model == ARM_FP_MODEL_VFP)
+#define TARGET_FPA (arm_fpu_desc->model == ARM_FP_MODEL_FPA)
+#define TARGET_MAVERICK (arm_fpu_desc->model == ARM_FP_MODEL_MAVERICK)
+#define TARGET_VFP (arm_fpu_desc->model == ARM_FP_MODEL_VFP)
#define TARGET_IWMMXT (arm_arch_iwmmxt)
#define TARGET_REALLY_IWMMXT (TARGET_IWMMXT && TARGET_32BIT)
#define TARGET_IWMMXT_ABI (TARGET_32BIT && arm_abi == ARM_ABI_IWMMXT)
@@ -216,6 +216,8 @@ extern void (*arm_lang_output_object_attributes_hook)(void);
#define TARGET_THUMB2 (TARGET_THUMB && arm_arch_thumb2)
/* Thumb-1 only. */
#define TARGET_THUMB1_ONLY (TARGET_THUMB1 && !arm_arch_notm)
+/* FPA emulator without LFM. */
+#define TARGET_FPA_EMU2 (TARGET_FPA && arm_fpu_desc->rev == 2)
/* The following two macros concern the ability to execute coprocessor
instructions for VFPv3 or NEON. TARGET_VFP3/TARGET_VFPD32 are currently
@@ -223,27 +225,21 @@ extern void (*arm_lang_output_object_attributes_hook)(void);
to be more careful with TARGET_NEON as noted below. */
/* FPU is has the full VFPv3/NEON register file of 32 D registers. */
-#define TARGET_VFPD32 (arm_fp_model == ARM_FP_MODEL_VFP \
- && (arm_fpu_arch == FPUTYPE_VFP3 \
- || arm_fpu_arch == FPUTYPE_NEON \
- || arm_fpu_arch == FPUTYPE_NEON_FP16))
+#define TARGET_VFPD32 (TARGET_VFP && arm_fpu_desc->regs == VFP_REG_D32)
/* FPU supports VFPv3 instructions. */
-#define TARGET_VFP3 (arm_fp_model == ARM_FP_MODEL_VFP \
- && (arm_fpu_arch == FPUTYPE_VFP3D16 \
- || TARGET_VFPD32))
+#define TARGET_VFP3 (TARGET_VFP && arm_fpu_desc->rev >= 3)
/* FPU supports NEON/VFP half-precision floating-point. */
-#define TARGET_NEON_FP16 (arm_fpu_arch == FPUTYPE_NEON_FP16)
+#define TARGET_NEON_FP16 \
+ (TARGET_VFP && arm_fpu_desc->neon && arm_fpu_desc->fp16)
/* FPU supports Neon instructions. The setting of this macro gets
revealed via __ARM_NEON__ so we add extra guards upon TARGET_32BIT
and TARGET_HARD_FLOAT to ensure that NEON instructions are
available. */
#define TARGET_NEON (TARGET_32BIT && TARGET_HARD_FLOAT \
- && arm_fp_model == ARM_FP_MODEL_VFP \
- && (arm_fpu_arch == FPUTYPE_NEON \
- || arm_fpu_arch == FPUTYPE_NEON_FP16))
+ && TARGET_VFP && arm_fpu_desc->neon)
/* "DSP" multiply instructions, eg. SMULxy. */
#define TARGET_DSP_MULTIPLY \
@@ -300,42 +296,25 @@ enum arm_fp_model
ARM_FP_MODEL_VFP
};
-extern enum arm_fp_model arm_fp_model;
-
-/* Which floating point hardware is available. Also update
- fp_model_for_fpu in arm.c when adding entries to this list. */
-enum fputype
+enum vfp_reg_type
{
- /* No FP hardware. */
- FPUTYPE_NONE,
- /* Full FPA support. */
- FPUTYPE_FPA,
- /* Emulated FPA hardware, Issue 2 emulator (no LFM/SFM). */
- FPUTYPE_FPA_EMU2,
- /* Emulated FPA hardware, Issue 3 emulator. */
- FPUTYPE_FPA_EMU3,
- /* Cirrus Maverick floating point co-processor. */
- FPUTYPE_MAVERICK,
- /* VFP. */
- FPUTYPE_VFP,
- /* VFPv3-D16. */
- FPUTYPE_VFP3D16,
- /* VFPv3. */
- FPUTYPE_VFP3,
- /* Neon. */
- FPUTYPE_NEON,
- /* Neon with half-precision float extensions. */
- FPUTYPE_NEON_FP16
+ VFP_REG_D16,
+ VFP_REG_D32,
+ VFP_REG_SINGLE
};
-/* Recast the floating point class to be the floating point attribute. */
-#define arm_fpu_attr ((enum attr_fpu) arm_fpu_tune)
-
-/* What type of floating point to tune for */
-extern enum fputype arm_fpu_tune;
-
-/* What type of floating point instructions are available */
-extern enum fputype arm_fpu_arch;
+extern const struct arm_fpu_desc
+{
+ const char *name;
+ enum arm_fp_model model;
+ int rev;
+ enum vfp_reg_type regs;
+ int neon;
+ int fp16;
+} *arm_fpu_desc;
+
+/* Which floating point hardware to schedule for. */
+extern int arm_fpu_attr;
enum float_abi_type
{
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index e180c2f08f1..52edcbaa17b 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -160,7 +160,7 @@
; Floating Point Unit. If we only have floating point emulation, then there
; is no point in scheduling the floating point insns. (Well, for best
; performance we should try and group them together).
-(define_attr "fpu" "none,fpa,fpe2,fpe3,maverick,vfp,vfpv3d16,vfpv3,neon,neon_fp16"
+(define_attr "fpu" "none,fpa,fpe2,fpe3,maverick,vfp"
(const (symbol_ref "arm_fpu_attr")))
; LENGTH of an instruction (in bytes)
@@ -392,6 +392,9 @@
; registers.
(define_mode_iterator ANY64 [DI DF V8QI V4HI V2SI V2SF])
+;; The integer modes up to word size
+(define_mode_iterator QHSI [QI HI SI])
+
;;---------------------------------------------------------------------------
;; Predicates
@@ -1914,7 +1917,16 @@
else /* TARGET_THUMB1 */
{
if (GET_CODE (operands[2]) != CONST_INT)
- operands[2] = force_reg (SImode, operands[2]);
+ {
+ rtx tmp = force_reg (SImode, operands[2]);
+ if (rtx_equal_p (operands[0], operands[1]))
+ operands[2] = tmp;
+ else
+ {
+ operands[2] = operands[1];
+ operands[1] = tmp;
+ }
+ }
else
{
int i;
@@ -2623,7 +2635,16 @@
DONE;
}
else /* TARGET_THUMB1 */
- operands [2] = force_reg (SImode, operands [2]);
+ {
+ rtx tmp = force_reg (SImode, operands[2]);
+ if (rtx_equal_p (operands[0], operands[1]))
+ operands[2] = tmp;
+ else
+ {
+ operands[2] = operands[1];
+ operands[1] = tmp;
+ }
+ }
}
"
)
@@ -2731,12 +2752,29 @@
(define_expand "xorsi3"
[(set (match_operand:SI 0 "s_register_operand" "")
(xor:SI (match_operand:SI 1 "s_register_operand" "")
- (match_operand:SI 2 "arm_rhs_operand" "")))]
+ (match_operand:SI 2 "reg_or_int_operand" "")))]
"TARGET_EITHER"
- "if (TARGET_THUMB1)
- if (GET_CODE (operands[2]) == CONST_INT)
- operands[2] = force_reg (SImode, operands[2]);
- "
+ "if (GET_CODE (operands[2]) == CONST_INT)
+ {
+ if (TARGET_32BIT)
+ {
+ arm_split_constant (XOR, SImode, NULL_RTX,
+ INTVAL (operands[2]), operands[0], operands[1],
+ optimize && can_create_pseudo_p ());
+ DONE;
+ }
+ else /* TARGET_THUMB1 */
+ {
+ rtx tmp = force_reg (SImode, operands[2]);
+ if (rtx_equal_p (operands[0], operands[1]))
+ operands[2] = tmp;
+ else
+ {
+ operands[2] = operands[1];
+ operands[1] = tmp;
+ }
+ }
+ }"
)
(define_insn "*arm_xorsi3"
@@ -5813,6 +5851,11 @@
{
rtx reg = gen_reg_rtx (SImode);
+ /* For thumb we want an unsigned immediate, then we are more likely
+ to be able to use a movs insn. */
+ if (TARGET_THUMB)
+ operands[1] = GEN_INT (INTVAL (operands[1]) & 255);
+
emit_insn (gen_movsi (reg, operands[1]));
operands[1] = gen_lowpart (QImode, reg);
}
@@ -6727,6 +6770,7 @@
(const_int 6)
(const_int 8))))]
)
+
(define_insn "*movsi_cbranchsi4"
[(set (pc)
(if_then_else
@@ -6790,6 +6834,45 @@
(const_int 10)))))]
)
+(define_peephole2
+ [(set (match_operand:SI 0 "low_register_operand" "")
+ (match_operand:SI 1 "low_register_operand" ""))
+ (set (pc)
+ (if_then_else (match_operator 2 "arm_comparison_operator"
+ [(match_dup 1) (const_int 0)])
+ (label_ref (match_operand 3 "" ""))
+ (pc)))]
+ "TARGET_THUMB1"
+ [(parallel
+ [(set (pc)
+ (if_then_else (match_op_dup 2 [(match_dup 1) (const_int 0)])
+ (label_ref (match_dup 3))
+ (pc)))
+ (set (match_dup 0) (match_dup 1))])]
+ ""
+)
+
+;; Sigh! This variant shouldn't be needed, but combine often fails to
+;; merge cases like this because the op1 is a hard register in
+;; CLASS_LIKELY_SPILLED_P.
+(define_peephole2
+ [(set (match_operand:SI 0 "low_register_operand" "")
+ (match_operand:SI 1 "low_register_operand" ""))
+ (set (pc)
+ (if_then_else (match_operator 2 "arm_comparison_operator"
+ [(match_dup 0) (const_int 0)])
+ (label_ref (match_operand 3 "" ""))
+ (pc)))]
+ "TARGET_THUMB1"
+ [(parallel
+ [(set (pc)
+ (if_then_else (match_op_dup 2 [(match_dup 1) (const_int 0)])
+ (label_ref (match_dup 3))
+ (pc)))
+ (set (match_dup 0) (match_dup 1))])]
+ ""
+)
+
(define_insn "*negated_cbranchsi4"
[(set (pc)
(if_then_else
@@ -8033,15 +8116,13 @@
if (!thumb1_cmp_operand (op3, SImode))
op3 = force_reg (SImode, op3);
scratch = gen_reg_rtx (SImode);
- emit_insn (gen_cstoresi_nltu_thumb1 (scratch, operands[2], op3));
- emit_insn (gen_negsi2 (operands[0], scratch));
+ emit_insn (gen_cstoresi_ltu_thumb1 (operands[0], operands[2], op3));
break;
case GTU:
op3 = force_reg (SImode, operands[3]);
scratch = gen_reg_rtx (SImode);
- emit_insn (gen_cstoresi_nltu_thumb1 (scratch, op3, operands[2]));
- emit_insn (gen_negsi2 (operands[0], scratch));
+ emit_insn (gen_cstoresi_ltu_thumb1 (operands[0], op3, operands[2]));
break;
/* No good sequences for GT, LT. */
@@ -8125,6 +8206,7 @@
[(set_attr "length" "4")]
)
+;; Used as part of the expansion of thumb ltu and gtu sequences
(define_insn "cstoresi_nltu_thumb1"
[(set (match_operand:SI 0 "s_register_operand" "=l,l")
(neg:SI (ltu:SI (match_operand:SI 1 "s_register_operand" "l,*h")
@@ -8134,6 +8216,20 @@
[(set_attr "length" "4")]
)
+(define_insn_and_split "cstoresi_ltu_thumb1"
+ [(set (match_operand:SI 0 "s_register_operand" "=l,l")
+ (ltu:SI (match_operand:SI 1 "s_register_operand" "l,*h")
+ (match_operand:SI 2 "thumb1_cmp_operand" "lI*h,*r")))]
+ "TARGET_THUMB1"
+ "#"
+ "TARGET_THUMB1"
+ [(set (match_dup 3)
+ (neg:SI (ltu:SI (match_dup 1) (match_dup 2))))
+ (set (match_dup 0) (neg:SI (match_dup 3)))]
+ "operands[3] = gen_reg_rtx (SImode);"
+ [(set_attr "length" "4")]
+)
+
;; Used as part of the expansion of thumb les sequence.
(define_insn "thumb1_addsi3_addgeu"
[(set (match_operand:SI 0 "s_register_operand" "=l")
diff --git a/gcc/config/arm/arm_neon.h b/gcc/config/arm/arm_neon.h
index faaaf7bca39..ccfc7426077 100644
--- a/gcc/config/arm/arm_neon.h
+++ b/gcc/config/arm/arm_neon.h
@@ -61,7 +61,7 @@ typedef __builtin_neon_uhi uint16x8_t __attribute__ ((__vector_size__ (16)));
typedef __builtin_neon_usi uint32x4_t __attribute__ ((__vector_size__ (16)));
typedef __builtin_neon_udi uint64x2_t __attribute__ ((__vector_size__ (16)));
-typedef __builtin_neon_sf float32_t;
+typedef float float32_t;
typedef __builtin_neon_poly8 poly8_t;
typedef __builtin_neon_poly16 poly16_t;
@@ -5085,7 +5085,7 @@ vset_lane_s32 (int32_t __a, int32x2_t __b, const int __c)
__extension__ static __inline float32x2_t __attribute__ ((__always_inline__))
vset_lane_f32 (float32_t __a, float32x2_t __b, const int __c)
{
- return (float32x2_t)__builtin_neon_vset_lanev2sf (__a, __b, __c);
+ return (float32x2_t)__builtin_neon_vset_lanev2sf ((__builtin_neon_sf) __a, __b, __c);
}
__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
@@ -5151,7 +5151,7 @@ vsetq_lane_s32 (int32_t __a, int32x4_t __b, const int __c)
__extension__ static __inline float32x4_t __attribute__ ((__always_inline__))
vsetq_lane_f32 (float32_t __a, float32x4_t __b, const int __c)
{
- return (float32x4_t)__builtin_neon_vset_lanev4sf (__a, __b, __c);
+ return (float32x4_t)__builtin_neon_vset_lanev4sf ((__builtin_neon_sf) __a, __b, __c);
}
__extension__ static __inline uint8x16_t __attribute__ ((__always_inline__))
@@ -5283,7 +5283,7 @@ vdup_n_s32 (int32_t __a)
__extension__ static __inline float32x2_t __attribute__ ((__always_inline__))
vdup_n_f32 (float32_t __a)
{
- return (float32x2_t)__builtin_neon_vdup_nv2sf (__a);
+ return (float32x2_t)__builtin_neon_vdup_nv2sf ((__builtin_neon_sf) __a);
}
__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
@@ -5349,7 +5349,7 @@ vdupq_n_s32 (int32_t __a)
__extension__ static __inline float32x4_t __attribute__ ((__always_inline__))
vdupq_n_f32 (float32_t __a)
{
- return (float32x4_t)__builtin_neon_vdup_nv4sf (__a);
+ return (float32x4_t)__builtin_neon_vdup_nv4sf ((__builtin_neon_sf) __a);
}
__extension__ static __inline uint8x16_t __attribute__ ((__always_inline__))
@@ -5415,7 +5415,7 @@ vmov_n_s32 (int32_t __a)
__extension__ static __inline float32x2_t __attribute__ ((__always_inline__))
vmov_n_f32 (float32_t __a)
{
- return (float32x2_t)__builtin_neon_vdup_nv2sf (__a);
+ return (float32x2_t)__builtin_neon_vdup_nv2sf ((__builtin_neon_sf) __a);
}
__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
@@ -5481,7 +5481,7 @@ vmovq_n_s32 (int32_t __a)
__extension__ static __inline float32x4_t __attribute__ ((__always_inline__))
vmovq_n_f32 (float32_t __a)
{
- return (float32x4_t)__builtin_neon_vdup_nv4sf (__a);
+ return (float32x4_t)__builtin_neon_vdup_nv4sf ((__builtin_neon_sf) __a);
}
__extension__ static __inline uint8x16_t __attribute__ ((__always_inline__))
@@ -6591,7 +6591,7 @@ vmul_n_s32 (int32x2_t __a, int32_t __b)
__extension__ static __inline float32x2_t __attribute__ ((__always_inline__))
vmul_n_f32 (float32x2_t __a, float32_t __b)
{
- return (float32x2_t)__builtin_neon_vmul_nv2sf (__a, __b, 3);
+ return (float32x2_t)__builtin_neon_vmul_nv2sf (__a, (__builtin_neon_sf) __b, 3);
}
__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
@@ -6621,7 +6621,7 @@ vmulq_n_s32 (int32x4_t __a, int32_t __b)
__extension__ static __inline float32x4_t __attribute__ ((__always_inline__))
vmulq_n_f32 (float32x4_t __a, float32_t __b)
{
- return (float32x4_t)__builtin_neon_vmul_nv4sf (__a, __b, 3);
+ return (float32x4_t)__builtin_neon_vmul_nv4sf (__a, (__builtin_neon_sf) __b, 3);
}
__extension__ static __inline uint16x8_t __attribute__ ((__always_inline__))
@@ -6735,7 +6735,7 @@ vmla_n_s32 (int32x2_t __a, int32x2_t __b, int32_t __c)
__extension__ static __inline float32x2_t __attribute__ ((__always_inline__))
vmla_n_f32 (float32x2_t __a, float32x2_t __b, float32_t __c)
{
- return (float32x2_t)__builtin_neon_vmla_nv2sf (__a, __b, __c, 3);
+ return (float32x2_t)__builtin_neon_vmla_nv2sf (__a, __b, (__builtin_neon_sf) __c, 3);
}
__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
@@ -6765,7 +6765,7 @@ vmlaq_n_s32 (int32x4_t __a, int32x4_t __b, int32_t __c)
__extension__ static __inline float32x4_t __attribute__ ((__always_inline__))
vmlaq_n_f32 (float32x4_t __a, float32x4_t __b, float32_t __c)
{
- return (float32x4_t)__builtin_neon_vmla_nv4sf (__a, __b, __c, 3);
+ return (float32x4_t)__builtin_neon_vmla_nv4sf (__a, __b, (__builtin_neon_sf) __c, 3);
}
__extension__ static __inline uint16x8_t __attribute__ ((__always_inline__))
@@ -6831,7 +6831,7 @@ vmls_n_s32 (int32x2_t __a, int32x2_t __b, int32_t __c)
__extension__ static __inline float32x2_t __attribute__ ((__always_inline__))
vmls_n_f32 (float32x2_t __a, float32x2_t __b, float32_t __c)
{
- return (float32x2_t)__builtin_neon_vmls_nv2sf (__a, __b, __c, 3);
+ return (float32x2_t)__builtin_neon_vmls_nv2sf (__a, __b, (__builtin_neon_sf) __c, 3);
}
__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
@@ -6861,7 +6861,7 @@ vmlsq_n_s32 (int32x4_t __a, int32x4_t __b, int32_t __c)
__extension__ static __inline float32x4_t __attribute__ ((__always_inline__))
vmlsq_n_f32 (float32x4_t __a, float32x4_t __b, float32_t __c)
{
- return (float32x4_t)__builtin_neon_vmls_nv4sf (__a, __b, __c, 3);
+ return (float32x4_t)__builtin_neon_vmls_nv4sf (__a, __b, (__builtin_neon_sf) __c, 3);
}
__extension__ static __inline uint16x8_t __attribute__ ((__always_inline__))
@@ -7851,7 +7851,7 @@ vld1_s64 (const int64_t * __a)
__extension__ static __inline float32x2_t __attribute__ ((__always_inline__))
vld1_f32 (const float32_t * __a)
{
- return (float32x2_t)__builtin_neon_vld1v2sf (__a);
+ return (float32x2_t)__builtin_neon_vld1v2sf ((const __builtin_neon_sf *) __a);
}
__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
@@ -7917,7 +7917,7 @@ vld1q_s64 (const int64_t * __a)
__extension__ static __inline float32x4_t __attribute__ ((__always_inline__))
vld1q_f32 (const float32_t * __a)
{
- return (float32x4_t)__builtin_neon_vld1v4sf (__a);
+ return (float32x4_t)__builtin_neon_vld1v4sf ((const __builtin_neon_sf *) __a);
}
__extension__ static __inline uint8x16_t __attribute__ ((__always_inline__))
@@ -7977,7 +7977,7 @@ vld1_lane_s32 (const int32_t * __a, int32x2_t __b, const int __c)
__extension__ static __inline float32x2_t __attribute__ ((__always_inline__))
vld1_lane_f32 (const float32_t * __a, float32x2_t __b, const int __c)
{
- return (float32x2_t)__builtin_neon_vld1_lanev2sf (__a, __b, __c);
+ return (float32x2_t)__builtin_neon_vld1_lanev2sf ((const __builtin_neon_sf *) __a, __b, __c);
}
__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
@@ -8043,7 +8043,7 @@ vld1q_lane_s32 (const int32_t * __a, int32x4_t __b, const int __c)
__extension__ static __inline float32x4_t __attribute__ ((__always_inline__))
vld1q_lane_f32 (const float32_t * __a, float32x4_t __b, const int __c)
{
- return (float32x4_t)__builtin_neon_vld1_lanev4sf (__a, __b, __c);
+ return (float32x4_t)__builtin_neon_vld1_lanev4sf ((const __builtin_neon_sf *) __a, __b, __c);
}
__extension__ static __inline uint8x16_t __attribute__ ((__always_inline__))
@@ -8109,7 +8109,7 @@ vld1_dup_s32 (const int32_t * __a)
__extension__ static __inline float32x2_t __attribute__ ((__always_inline__))
vld1_dup_f32 (const float32_t * __a)
{
- return (float32x2_t)__builtin_neon_vld1_dupv2sf (__a);
+ return (float32x2_t)__builtin_neon_vld1_dupv2sf ((const __builtin_neon_sf *) __a);
}
__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
@@ -8175,7 +8175,7 @@ vld1q_dup_s32 (const int32_t * __a)
__extension__ static __inline float32x4_t __attribute__ ((__always_inline__))
vld1q_dup_f32 (const float32_t * __a)
{
- return (float32x4_t)__builtin_neon_vld1_dupv4sf (__a);
+ return (float32x4_t)__builtin_neon_vld1_dupv4sf ((const __builtin_neon_sf *) __a);
}
__extension__ static __inline uint8x16_t __attribute__ ((__always_inline__))
@@ -8247,7 +8247,7 @@ vst1_s64 (int64_t * __a, int64x1_t __b)
__extension__ static __inline void __attribute__ ((__always_inline__))
vst1_f32 (float32_t * __a, float32x2_t __b)
{
- __builtin_neon_vst1v2sf (__a, __b);
+ __builtin_neon_vst1v2sf ((__builtin_neon_sf *) __a, __b);
}
__extension__ static __inline void __attribute__ ((__always_inline__))
@@ -8313,7 +8313,7 @@ vst1q_s64 (int64_t * __a, int64x2_t __b)
__extension__ static __inline void __attribute__ ((__always_inline__))
vst1q_f32 (float32_t * __a, float32x4_t __b)
{
- __builtin_neon_vst1v4sf (__a, __b);
+ __builtin_neon_vst1v4sf ((__builtin_neon_sf *) __a, __b);
}
__extension__ static __inline void __attribute__ ((__always_inline__))
@@ -8373,7 +8373,7 @@ vst1_lane_s32 (int32_t * __a, int32x2_t __b, const int __c)
__extension__ static __inline void __attribute__ ((__always_inline__))
vst1_lane_f32 (float32_t * __a, float32x2_t __b, const int __c)
{
- __builtin_neon_vst1_lanev2sf (__a, __b, __c);
+ __builtin_neon_vst1_lanev2sf ((__builtin_neon_sf *) __a, __b, __c);
}
__extension__ static __inline void __attribute__ ((__always_inline__))
@@ -8439,7 +8439,7 @@ vst1q_lane_s32 (int32_t * __a, int32x4_t __b, const int __c)
__extension__ static __inline void __attribute__ ((__always_inline__))
vst1q_lane_f32 (float32_t * __a, float32x4_t __b, const int __c)
{
- __builtin_neon_vst1_lanev4sf (__a, __b, __c);
+ __builtin_neon_vst1_lanev4sf ((__builtin_neon_sf *) __a, __b, __c);
}
__extension__ static __inline void __attribute__ ((__always_inline__))
@@ -8512,7 +8512,7 @@ __extension__ static __inline float32x2x2_t __attribute__ ((__always_inline__))
vld2_f32 (const float32_t * __a)
{
union { float32x2x2_t __i; __builtin_neon_ti __o; } __rv;
- __rv.__o = __builtin_neon_vld2v2sf (__a);
+ __rv.__o = __builtin_neon_vld2v2sf ((const __builtin_neon_sf *) __a);
return __rv.__i;
}
@@ -8600,7 +8600,7 @@ __extension__ static __inline float32x4x2_t __attribute__ ((__always_inline__))
vld2q_f32 (const float32_t * __a)
{
union { float32x4x2_t __i; __builtin_neon_oi __o; } __rv;
- __rv.__o = __builtin_neon_vld2v4sf (__a);
+ __rv.__o = __builtin_neon_vld2v4sf ((const __builtin_neon_sf *) __a);
return __rv.__i;
}
@@ -8676,7 +8676,7 @@ vld2_lane_f32 (const float32_t * __a, float32x2x2_t __b, const int __c)
{
union { float32x2x2_t __i; __builtin_neon_ti __o; } __bu = { __b };
union { float32x2x2_t __i; __builtin_neon_ti __o; } __rv;
- __rv.__o = __builtin_neon_vld2_lanev2sf (__a, __bu.__o, __c);
+ __rv.__o = __builtin_neon_vld2_lanev2sf ((const __builtin_neon_sf *) __a, __bu.__o, __c);
return __rv.__i;
}
@@ -8748,7 +8748,7 @@ vld2q_lane_f32 (const float32_t * __a, float32x4x2_t __b, const int __c)
{
union { float32x4x2_t __i; __builtin_neon_oi __o; } __bu = { __b };
union { float32x4x2_t __i; __builtin_neon_oi __o; } __rv;
- __rv.__o = __builtin_neon_vld2_lanev4sf (__a, __bu.__o, __c);
+ __rv.__o = __builtin_neon_vld2_lanev4sf ((const __builtin_neon_sf *) __a, __bu.__o, __c);
return __rv.__i;
}
@@ -8807,7 +8807,7 @@ __extension__ static __inline float32x2x2_t __attribute__ ((__always_inline__))
vld2_dup_f32 (const float32_t * __a)
{
union { float32x2x2_t __i; __builtin_neon_ti __o; } __rv;
- __rv.__o = __builtin_neon_vld2_dupv2sf (__a);
+ __rv.__o = __builtin_neon_vld2_dupv2sf ((const __builtin_neon_sf *) __a);
return __rv.__i;
}
@@ -8892,7 +8892,7 @@ __extension__ static __inline void __attribute__ ((__always_inline__))
vst2_f32 (float32_t * __a, float32x2x2_t __b)
{
union { float32x2x2_t __i; __builtin_neon_ti __o; } __bu = { __b };
- __builtin_neon_vst2v2sf (__a, __bu.__o);
+ __builtin_neon_vst2v2sf ((__builtin_neon_sf *) __a, __bu.__o);
}
__extension__ static __inline void __attribute__ ((__always_inline__))
@@ -8969,7 +8969,7 @@ __extension__ static __inline void __attribute__ ((__always_inline__))
vst2q_f32 (float32_t * __a, float32x4x2_t __b)
{
union { float32x4x2_t __i; __builtin_neon_oi __o; } __bu = { __b };
- __builtin_neon_vst2v4sf (__a, __bu.__o);
+ __builtin_neon_vst2v4sf ((__builtin_neon_sf *) __a, __bu.__o);
}
__extension__ static __inline void __attribute__ ((__always_inline__))
@@ -9032,7 +9032,7 @@ __extension__ static __inline void __attribute__ ((__always_inline__))
vst2_lane_f32 (float32_t * __a, float32x2x2_t __b, const int __c)
{
union { float32x2x2_t __i; __builtin_neon_ti __o; } __bu = { __b };
- __builtin_neon_vst2_lanev2sf (__a, __bu.__o, __c);
+ __builtin_neon_vst2_lanev2sf ((__builtin_neon_sf *) __a, __bu.__o, __c);
}
__extension__ static __inline void __attribute__ ((__always_inline__))
@@ -9088,7 +9088,7 @@ __extension__ static __inline void __attribute__ ((__always_inline__))
vst2q_lane_f32 (float32_t * __a, float32x4x2_t __b, const int __c)
{
union { float32x4x2_t __i; __builtin_neon_oi __o; } __bu = { __b };
- __builtin_neon_vst2_lanev4sf (__a, __bu.__o, __c);
+ __builtin_neon_vst2_lanev4sf ((__builtin_neon_sf *) __a, __bu.__o, __c);
}
__extension__ static __inline void __attribute__ ((__always_inline__))
@@ -9140,7 +9140,7 @@ __extension__ static __inline float32x2x3_t __attribute__ ((__always_inline__))
vld3_f32 (const float32_t * __a)
{
union { float32x2x3_t __i; __builtin_neon_ei __o; } __rv;
- __rv.__o = __builtin_neon_vld3v2sf (__a);
+ __rv.__o = __builtin_neon_vld3v2sf ((const __builtin_neon_sf *) __a);
return __rv.__i;
}
@@ -9228,7 +9228,7 @@ __extension__ static __inline float32x4x3_t __attribute__ ((__always_inline__))
vld3q_f32 (const float32_t * __a)
{
union { float32x4x3_t __i; __builtin_neon_ci __o; } __rv;
- __rv.__o = __builtin_neon_vld3v4sf (__a);
+ __rv.__o = __builtin_neon_vld3v4sf ((const __builtin_neon_sf *) __a);
return __rv.__i;
}
@@ -9304,7 +9304,7 @@ vld3_lane_f32 (const float32_t * __a, float32x2x3_t __b, const int __c)
{
union { float32x2x3_t __i; __builtin_neon_ei __o; } __bu = { __b };
union { float32x2x3_t __i; __builtin_neon_ei __o; } __rv;
- __rv.__o = __builtin_neon_vld3_lanev2sf (__a, __bu.__o, __c);
+ __rv.__o = __builtin_neon_vld3_lanev2sf ((const __builtin_neon_sf *) __a, __bu.__o, __c);
return __rv.__i;
}
@@ -9376,7 +9376,7 @@ vld3q_lane_f32 (const float32_t * __a, float32x4x3_t __b, const int __c)
{
union { float32x4x3_t __i; __builtin_neon_ci __o; } __bu = { __b };
union { float32x4x3_t __i; __builtin_neon_ci __o; } __rv;
- __rv.__o = __builtin_neon_vld3_lanev4sf (__a, __bu.__o, __c);
+ __rv.__o = __builtin_neon_vld3_lanev4sf ((const __builtin_neon_sf *) __a, __bu.__o, __c);
return __rv.__i;
}
@@ -9435,7 +9435,7 @@ __extension__ static __inline float32x2x3_t __attribute__ ((__always_inline__))
vld3_dup_f32 (const float32_t * __a)
{
union { float32x2x3_t __i; __builtin_neon_ei __o; } __rv;
- __rv.__o = __builtin_neon_vld3_dupv2sf (__a);
+ __rv.__o = __builtin_neon_vld3_dupv2sf ((const __builtin_neon_sf *) __a);
return __rv.__i;
}
@@ -9520,7 +9520,7 @@ __extension__ static __inline void __attribute__ ((__always_inline__))
vst3_f32 (float32_t * __a, float32x2x3_t __b)
{
union { float32x2x3_t __i; __builtin_neon_ei __o; } __bu = { __b };
- __builtin_neon_vst3v2sf (__a, __bu.__o);
+ __builtin_neon_vst3v2sf ((__builtin_neon_sf *) __a, __bu.__o);
}
__extension__ static __inline void __attribute__ ((__always_inline__))
@@ -9597,7 +9597,7 @@ __extension__ static __inline void __attribute__ ((__always_inline__))
vst3q_f32 (float32_t * __a, float32x4x3_t __b)
{
union { float32x4x3_t __i; __builtin_neon_ci __o; } __bu = { __b };
- __builtin_neon_vst3v4sf (__a, __bu.__o);
+ __builtin_neon_vst3v4sf ((__builtin_neon_sf *) __a, __bu.__o);
}
__extension__ static __inline void __attribute__ ((__always_inline__))
@@ -9660,7 +9660,7 @@ __extension__ static __inline void __attribute__ ((__always_inline__))
vst3_lane_f32 (float32_t * __a, float32x2x3_t __b, const int __c)
{
union { float32x2x3_t __i; __builtin_neon_ei __o; } __bu = { __b };
- __builtin_neon_vst3_lanev2sf (__a, __bu.__o, __c);
+ __builtin_neon_vst3_lanev2sf ((__builtin_neon_sf *) __a, __bu.__o, __c);
}
__extension__ static __inline void __attribute__ ((__always_inline__))
@@ -9716,7 +9716,7 @@ __extension__ static __inline void __attribute__ ((__always_inline__))
vst3q_lane_f32 (float32_t * __a, float32x4x3_t __b, const int __c)
{
union { float32x4x3_t __i; __builtin_neon_ci __o; } __bu = { __b };
- __builtin_neon_vst3_lanev4sf (__a, __bu.__o, __c);
+ __builtin_neon_vst3_lanev4sf ((__builtin_neon_sf *) __a, __bu.__o, __c);
}
__extension__ static __inline void __attribute__ ((__always_inline__))
@@ -9768,7 +9768,7 @@ __extension__ static __inline float32x2x4_t __attribute__ ((__always_inline__))
vld4_f32 (const float32_t * __a)
{
union { float32x2x4_t __i; __builtin_neon_oi __o; } __rv;
- __rv.__o = __builtin_neon_vld4v2sf (__a);
+ __rv.__o = __builtin_neon_vld4v2sf ((const __builtin_neon_sf *) __a);
return __rv.__i;
}
@@ -9856,7 +9856,7 @@ __extension__ static __inline float32x4x4_t __attribute__ ((__always_inline__))
vld4q_f32 (const float32_t * __a)
{
union { float32x4x4_t __i; __builtin_neon_xi __o; } __rv;
- __rv.__o = __builtin_neon_vld4v4sf (__a);
+ __rv.__o = __builtin_neon_vld4v4sf ((const __builtin_neon_sf *) __a);
return __rv.__i;
}
@@ -9932,7 +9932,7 @@ vld4_lane_f32 (const float32_t * __a, float32x2x4_t __b, const int __c)
{
union { float32x2x4_t __i; __builtin_neon_oi __o; } __bu = { __b };
union { float32x2x4_t __i; __builtin_neon_oi __o; } __rv;
- __rv.__o = __builtin_neon_vld4_lanev2sf (__a, __bu.__o, __c);
+ __rv.__o = __builtin_neon_vld4_lanev2sf ((const __builtin_neon_sf *) __a, __bu.__o, __c);
return __rv.__i;
}
@@ -10004,7 +10004,7 @@ vld4q_lane_f32 (const float32_t * __a, float32x4x4_t __b, const int __c)
{
union { float32x4x4_t __i; __builtin_neon_xi __o; } __bu = { __b };
union { float32x4x4_t __i; __builtin_neon_xi __o; } __rv;
- __rv.__o = __builtin_neon_vld4_lanev4sf (__a, __bu.__o, __c);
+ __rv.__o = __builtin_neon_vld4_lanev4sf ((const __builtin_neon_sf *) __a, __bu.__o, __c);
return __rv.__i;
}
@@ -10063,7 +10063,7 @@ __extension__ static __inline float32x2x4_t __attribute__ ((__always_inline__))
vld4_dup_f32 (const float32_t * __a)
{
union { float32x2x4_t __i; __builtin_neon_oi __o; } __rv;
- __rv.__o = __builtin_neon_vld4_dupv2sf (__a);
+ __rv.__o = __builtin_neon_vld4_dupv2sf ((const __builtin_neon_sf *) __a);
return __rv.__i;
}
@@ -10148,7 +10148,7 @@ __extension__ static __inline void __attribute__ ((__always_inline__))
vst4_f32 (float32_t * __a, float32x2x4_t __b)
{
union { float32x2x4_t __i; __builtin_neon_oi __o; } __bu = { __b };
- __builtin_neon_vst4v2sf (__a, __bu.__o);
+ __builtin_neon_vst4v2sf ((__builtin_neon_sf *) __a, __bu.__o);
}
__extension__ static __inline void __attribute__ ((__always_inline__))
@@ -10225,7 +10225,7 @@ __extension__ static __inline void __attribute__ ((__always_inline__))
vst4q_f32 (float32_t * __a, float32x4x4_t __b)
{
union { float32x4x4_t __i; __builtin_neon_xi __o; } __bu = { __b };
- __builtin_neon_vst4v4sf (__a, __bu.__o);
+ __builtin_neon_vst4v4sf ((__builtin_neon_sf *) __a, __bu.__o);
}
__extension__ static __inline void __attribute__ ((__always_inline__))
@@ -10288,7 +10288,7 @@ __extension__ static __inline void __attribute__ ((__always_inline__))
vst4_lane_f32 (float32_t * __a, float32x2x4_t __b, const int __c)
{
union { float32x2x4_t __i; __builtin_neon_oi __o; } __bu = { __b };
- __builtin_neon_vst4_lanev2sf (__a, __bu.__o, __c);
+ __builtin_neon_vst4_lanev2sf ((__builtin_neon_sf *) __a, __bu.__o, __c);
}
__extension__ static __inline void __attribute__ ((__always_inline__))
@@ -10344,7 +10344,7 @@ __extension__ static __inline void __attribute__ ((__always_inline__))
vst4q_lane_f32 (float32_t * __a, float32x4x4_t __b, const int __c)
{
union { float32x4x4_t __i; __builtin_neon_xi __o; } __bu = { __b };
- __builtin_neon_vst4_lanev4sf (__a, __bu.__o, __c);
+ __builtin_neon_vst4_lanev4sf ((__builtin_neon_sf *) __a, __bu.__o, __c);
}
__extension__ static __inline void __attribute__ ((__always_inline__))
diff --git a/gcc/config/arm/bpabi.h b/gcc/config/arm/bpabi.h
index bc0c62f401e..ba206022b75 100644
--- a/gcc/config/arm/bpabi.h
+++ b/gcc/config/arm/bpabi.h
@@ -30,7 +30,7 @@
/* Section 4.1 of the AAPCS requires the use of VFP format. */
#undef FPUTYPE_DEFAULT
-#define FPUTYPE_DEFAULT FPUTYPE_VFP
+#define FPUTYPE_DEFAULT "vfp"
/* TARGET_BIG_ENDIAN_DEFAULT is set in
config.gcc for big endian configurations. */
@@ -53,6 +53,8 @@
#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*|march=armv4:--fix-v4bx}"
+#define BE8_LINK_SPEC " %{mbig-endian:%{march=armv7-a|mcpu=cortex-a8|mcpu=cortex-a9:%{!r:--be8}}}"
+
/* Tell the assembler to build BPABI binaries. */
#undef SUBTARGET_EXTRA_ASM_SPEC
#define SUBTARGET_EXTRA_ASM_SPEC "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=5}" TARGET_FIX_V4BX_SPEC
@@ -65,7 +67,7 @@
#define BPABI_LINK_SPEC \
"%{mbig-endian:-EB} %{mlittle-endian:-EL} " \
"%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} " \
- "-X" SUBTARGET_EXTRA_LINK_SPEC TARGET_FIX_V4BX_SPEC
+ "-X" SUBTARGET_EXTRA_LINK_SPEC TARGET_FIX_V4BX_SPEC BE8_LINK_SPEC
#undef LINK_SPEC
#define LINK_SPEC BPABI_LINK_SPEC
diff --git a/gcc/config/arm/cortex-a9.md b/gcc/config/arm/cortex-a9.md
index 121fd2da747..d1ad7cba767 100644
--- a/gcc/config/arm/cortex-a9.md
+++ b/gcc/config/arm/cortex-a9.md
@@ -1,6 +1,8 @@
-;; ARM Cortex-A9 VFP pipeline description
-;; Copyright (C) 2008 Free Software Foundation, Inc.
-;; Written by CodeSourcery.
+;; ARM Cortex-A9 pipeline description
+;; Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+;; Originally written by CodeSourcery for VFP.
+;;
+;; Integer core pipeline description contributed by ARM Ltd.
;;
;; This file is part of GCC.
;;
@@ -20,9 +22,181 @@
(define_automaton "cortex_a9")
-;; FIXME: We model a single pipeline for all instructions.
-;; Is dual-issue possible, and do we have other pipelines?
-(define_cpu_unit "cortex_a9_vfp" "cortex_a9")
+;; The Cortex-A9 integer core is modelled as a dual issue pipeline that has
+;; the following components.
+;; 1. 1 Load Store Pipeline.
+;; 2. P0 / main pipeline for data processing instructions.
+;; 3. P1 / Dual pipeline for Data processing instructions.
+;; 4. MAC pipeline for multiply as well as multiply
+;; and accumulate instructions.
+;; 5. 1 VFP / Neon pipeline.
+;; The Load/Store and VFP/Neon pipeline are multiplexed.
+;; The P0 / main pipeline and M1 stage of the MAC pipeline are
+;; multiplexed.
+;; The P1 / dual pipeline and M2 stage of the MAC pipeline are
+;; multiplexed.
+;; There are only 4 register read ports and hence at any point of
+;; time we can't have issue down the E1 and the E2 ports unless
+;; of course there are bypass paths that get exercised.
+;; Both P0 and P1 have 2 stages E1 and E2.
+;; Data processing instructions issue to E1 or E2 depending on
+;; whether they have an early shift or not.
+
+
+(define_cpu_unit "cortex_a9_vfp, cortex_a9_ls" "cortex_a9")
+(define_cpu_unit "cortex_a9_p0_e1, cortex_a9_p0_e2" "cortex_a9")
+(define_cpu_unit "cortex_a9_p1_e1, cortex_a9_p1_e2" "cortex_a9")
+(define_cpu_unit "cortex_a9_p0_wb, cortex_a9_p1_wb" "cortex_a9")
+(define_cpu_unit "cortex_a9_mac_m1, cortex_a9_mac_m2" "cortex_a9")
+(define_cpu_unit "cortex_a9_branch, cortex_a9_issue_branch" "cortex_a9")
+
+(define_reservation "cortex_a9_p0_default" "cortex_a9_p0_e2, cortex_a9_p0_wb")
+(define_reservation "cortex_a9_p1_default" "cortex_a9_p1_e2, cortex_a9_p1_wb")
+(define_reservation "cortex_a9_p0_shift" "cortex_a9_p0_e1, cortex_a9_p0_default")
+(define_reservation "cortex_a9_p1_shift" "cortex_a9_p1_e1, cortex_a9_p1_default")
+
+(define_reservation "cortex_a9_multcycle1"
+ "cortex_a9_p0_e2 + cortex_a9_mac_m1 + cortex_a9_mac_m2 + \
+cortex_a9_p1_e2 + cortex_a9_p0_e1 + cortex_a9_p1_e1")
+
+(define_reservation "cortex_a9_mult16"
+ "cortex_a9_mac_m1, cortex_a9_mac_m2, cortex_a9_p0_wb")
+(define_reservation "cortex_a9_mac16"
+ "cortex_a9_multcycle1, cortex_a9_mac_m2, cortex_a9_p0_wb")
+(define_reservation "cortex_a9_mult"
+ "cortex_a9_mac_m1*2, cortex_a9_mac_m2, cortex_a9_p0_wb")
+(define_reservation "cortex_a9_mac"
+ "cortex_a9_multcycle1*2 ,cortex_a9_mac_m2, cortex_a9_p0_wb")
+
+
+;; Issue at the same time along the load store pipeline and
+;; the VFP / Neon pipeline is not possible.
+;; FIXME:: At some point we need to model the issue
+;; of the load store and the vfp being shared rather than anything else.
+
+(exclusion_set "cortex_a9_ls" "cortex_a9_vfp")
+
+
+;; Default data processing instruction without any shift
+;; The only exception to this is the mov instruction
+;; which can go down E2 without any problem.
+(define_insn_reservation "cortex_a9_dp" 2
+ (and (eq_attr "tune" "cortexa9")
+ (ior (eq_attr "type" "alu")
+ (and (eq_attr "type" "alu_shift_reg, alu_shift")
+ (eq_attr "insn" "mov"))))
+ "cortex_a9_p0_default|cortex_a9_p1_default")
+
+;; An instruction using the shifter will go down E1.
+(define_insn_reservation "cortex_a9_dp_shift" 3
+ (and (eq_attr "tune" "cortexa9")
+ (and (eq_attr "type" "alu_shift_reg, alu_shift")
+ (not (eq_attr "insn" "mov"))))
+ "cortex_a9_p0_shift | cortex_a9_p1_shift")
+
+;; Loads have a latency of 4 cycles.
+;; We don't model autoincrement instructions. These
+;; instructions use the load store pipeline and 1 of
+;; the E2 units to write back the result of the increment.
+
+(define_insn_reservation "cortex_a9_load1_2" 4
+ (and (eq_attr "tune" "cortexa9")
+ (eq_attr "type" "load1, load2, load_byte"))
+ "cortex_a9_ls")
+
+;; Loads multiples and store multiples can't be issued for 2 cycles in a
+;; row. The description below assumes that addresses are 64 bit aligned.
+;; If not, there is an extra cycle latency which is not modelled.
+
+;; FIXME:: This bit might need to be reworked when we get to
+;; tuning for the VFP because strictly speaking the ldm
+;; is sent to the LSU unit as is and there is only an
+;; issue restriction between the LSU and the VFP/ Neon unit.
+
+(define_insn_reservation "cortex_a9_load3_4" 5
+ (and (eq_attr "tune" "cortexa9")
+ (eq_attr "type" "load3, load4"))
+ "cortex_a9_ls, cortex_a9_ls")
+
+(define_insn_reservation "cortex_a9_store1_2" 0
+ (and (eq_attr "tune" "cortexa9")
+ (eq_attr "type" "store1, store2"))
+ "cortex_a9_ls")
+
+;; Almost all our store multiples use an auto-increment
+;; form. Don't issue back to back load and store multiples
+;; because the load store unit will stall.
+(define_insn_reservation "cortex_a9_store3_4" 0
+ (and (eq_attr "tune" "cortexa9")
+ (eq_attr "type" "store3, store4"))
+ "cortex_a9_ls+(cortex_a9_p0_default | cortex_a9_p1_default), cortex_a9_ls")
+
+;; We get 16*16 multiply / mac results in 3 cycles.
+(define_insn_reservation "cortex_a9_mult16" 3
+ (and (eq_attr "tune" "cortexa9")
+ (eq_attr "insn" "smulxy"))
+ "cortex_a9_mult16")
+
+;; The 16*16 mac is slightly different that it
+;; reserves M1 and M2 in the same cycle.
+(define_insn_reservation "cortex_a9_mac16" 3
+ (and (eq_attr "tune" "cortexa9")
+ (eq_attr "insn" "smlaxy"))
+ "cortex_a9_mac16")
+
+
+(define_insn_reservation "cortex_a9_multiply" 4
+ (and (eq_attr "tune" "cortexa9")
+ (eq_attr "insn" "mul"))
+ "cortex_a9_mult")
+
+(define_insn_reservation "cortex_a9_mac" 4
+ (and (eq_attr "tune" "cortexa9")
+ (eq_attr "insn" "mla"))
+ "cortex_a9_mac")
+
+;; An instruction with a result in E2 can be forwarded
+;; to E2 or E1 or M1 or the load store unit in the next cycle.
+
+(define_bypass 1 "cortex_a9_dp"
+ "cortex_a9_dp_shift, cortex_a9_multiply,
+ cortex_a9_load1_2, cortex_a9_dp, cortex_a9_store1_2,
+ cortex_a9_mult16, cortex_a9_mac16, cortex_a9_mac, cortex_a9_store3_4, cortex_a9_load3_4")
+
+(define_bypass 2 "cortex_a9_dp_shift"
+ "cortex_a9_dp_shift, cortex_a9_multiply,
+ cortex_a9_load1_2, cortex_a9_dp, cortex_a9_store1_2,
+ cortex_a9_mult16, cortex_a9_mac16, cortex_a9_mac, cortex_a9_store3_4, cortex_a9_load3_4")
+
+;; An instruction in the load store pipeline can provide
+;; read access to a DP instruction in the P0 default pipeline
+;; before the writeback stage.
+
+(define_bypass 3 "cortex_a9_load1_2" "cortex_a9_dp, cortex_a9_load1_2,
+cortex_a9_store3_4, cortex_a9_store1_2")
+
+(define_bypass 4 "cortex_a9_load3_4" "cortex_a9_dp, cortex_a9_load1_2,
+cortex_a9_store3_4, cortex_a9_store1_2, cortex_a9_load3_4")
+
+;; Calls and branches.
+
+;; Branch instructions
+
+(define_insn_reservation "cortex_a9_branch" 0
+ (and (eq_attr "tune" "cortexa9")
+ (eq_attr "type" "branch"))
+ "cortex_a9_branch")
+
+;; Call latencies are essentially 0 but make sure
+;; dual issue doesn't happen i.e the next instruction
+;; starts at the next cycle.
+(define_insn_reservation "cortex_a9_call" 0
+ (and (eq_attr "tune" "cortexa9")
+ (eq_attr "type" "call"))
+ "cortex_a9_issue_branch + cortex_a9_multcycle1 + cortex_a9_ls + cortex_a9_vfp")
+
+
+;; Pipelining for VFP instructions.
(define_insn_reservation "cortex_a9_ffarith" 1
(and (eq_attr "tune" "cortexa9")
diff --git a/gcc/config/arm/fpa.md b/gcc/config/arm/fpa.md
index fcd92b002d7..515de43d28b 100644
--- a/gcc/config/arm/fpa.md
+++ b/gcc/config/arm/fpa.md
@@ -599,10 +599,10 @@
{
default:
case 0: return \"mvf%?e\\t%0, %1\";
- case 1: if (arm_fpu_arch == FPUTYPE_FPA_EMU2)
+ case 1: if (TARGET_FPA_EMU2)
return \"ldf%?e\\t%0, %1\";
return \"lfm%?\\t%0, 1, %1\";
- case 2: if (arm_fpu_arch == FPUTYPE_FPA_EMU2)
+ case 2: if (TARGET_FPA_EMU2)
return \"stf%?e\\t%1, %0\";
return \"sfm%?\\t%1, 1, %0\";
}
diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
index 780a504add2..fce1ed165d3 100644
--- a/gcc/config/arm/linux-eabi.h
+++ b/gcc/config/arm/linux-eabi.h
@@ -66,7 +66,7 @@
/* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
use the GNU/Linux version, not the generic BPABI version. */
#undef LINK_SPEC
-#define LINK_SPEC LINUX_TARGET_LINK_SPEC
+#define LINK_SPEC LINUX_TARGET_LINK_SPEC BE8_LINK_SPEC
/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we
do not use -lfloat. */
diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
index 07455ee87fd..9fdca414e8e 100644
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -98,7 +98,7 @@
/* NWFPE always understands FPA instructions. */
#undef FPUTYPE_DEFAULT
-#define FPUTYPE_DEFAULT FPUTYPE_FPA_EMU3
+#define FPUTYPE_DEFAULT "fpe3"
/* Call the function profiler with a given profile label. */
#undef ARM_FUNCTION_PROFILER
diff --git a/gcc/config/arm/neon-gen.ml b/gcc/config/arm/neon-gen.ml
index 9c8e2a89b86..112c8be6e3b 100644
--- a/gcc/config/arm/neon-gen.ml
+++ b/gcc/config/arm/neon-gen.ml
@@ -122,6 +122,7 @@ let rec signed_ctype = function
| T_uint16 | T_int16 -> T_intHI
| T_uint32 | T_int32 -> T_intSI
| T_uint64 | T_int64 -> T_intDI
+ | T_float32 -> T_floatSF
| T_poly8 -> T_intQI
| T_poly16 -> T_intHI
| T_arrayof (n, elt) -> T_arrayof (n, signed_ctype elt)
@@ -320,7 +321,7 @@ let deftypes () =
typeinfo;
Format.print_newline ();
(* Extra types not in <stdint.h>. *)
- Format.printf "typedef __builtin_neon_sf float32_t;\n";
+ Format.printf "typedef float float32_t;\n";
Format.printf "typedef __builtin_neon_poly8 poly8_t;\n";
Format.printf "typedef __builtin_neon_poly16 poly16_t;\n"
diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md
index 85bc3eed100..7d1ef111339 100644
--- a/gcc/config/arm/neon.md
+++ b/gcc/config/arm/neon.md
@@ -3655,7 +3655,8 @@
UNSPEC_VSHLL_N))]
"TARGET_NEON"
{
- neon_const_bounds (operands[2], 0, neon_element_bits (<MODE>mode));
+ /* The boundaries are: 0 < imm <= size. */
+ neon_const_bounds (operands[2], 0, neon_element_bits (<MODE>mode) + 1);
return "vshll.%T3%#<V_sz_elem>\t%q0, %P1, %2";
}
[(set_attr "neon_type" "neon_shift_1")]
diff --git a/gcc/config/arm/neon.ml b/gcc/config/arm/neon.ml
index 10393b33ebc..114097d22a7 100644
--- a/gcc/config/arm/neon.ml
+++ b/gcc/config/arm/neon.ml
@@ -50,7 +50,7 @@ type vectype = T_int8x8 | T_int8x16
| T_ptrto of vectype | T_const of vectype
| T_void | T_intQI
| T_intHI | T_intSI
- | T_intDI
+ | T_intDI | T_floatSF
(* The meanings of the following are:
TImode : "Tetra", two registers (four words).
@@ -1693,6 +1693,7 @@ let string_of_vectype vt =
| T_intHI -> "__builtin_neon_hi"
| T_intSI -> "__builtin_neon_si"
| T_intDI -> "__builtin_neon_di"
+ | T_floatSF -> "__builtin_neon_sf"
| T_arrayof (num, base) ->
let basename = name (fun x -> x) base in
affix (Printf.sprintf "%sx%d" basename num)
diff --git a/gcc/config/arm/netbsd-elf.h b/gcc/config/arm/netbsd-elf.h
index 4c06fa1cb3b..9cf186b338d 100644
--- a/gcc/config/arm/netbsd-elf.h
+++ b/gcc/config/arm/netbsd-elf.h
@@ -153,5 +153,5 @@ do \
while (0)
#undef FPUTYPE_DEFAULT
-#define FPUTYPE_DEFAULT FPUTYPE_VFP
+#define FPUTYPE_DEFAULT "vfp"
diff --git a/gcc/config/arm/thumb2.md b/gcc/config/arm/thumb2.md
index 884d58c7677..82f75f9b733 100644
--- a/gcc/config/arm/thumb2.md
+++ b/gcc/config/arm/thumb2.md
@@ -1156,8 +1156,8 @@
;; 16-bit load immediate
(define_peephole2
- [(set (match_operand:SI 0 "low_register_operand" "")
- (match_operand:SI 1 "const_int_operand" ""))]
+ [(set (match_operand:QHSI 0 "low_register_operand" "")
+ (match_operand:QHSI 1 "const_int_operand" ""))]
"TARGET_THUMB2
&& peep2_regno_dead_p(0, CC_REGNUM)
&& (unsigned HOST_WIDE_INT) INTVAL(operands[1]) < 256"
@@ -1168,9 +1168,9 @@
""
)
-(define_insn "*thumb2_movsi_shortim"
- [(set (match_operand:SI 0 "low_register_operand" "=l")
- (match_operand:SI 1 "const_int_operand" "I"))
+(define_insn "*thumb2_mov<mode>_shortim"
+ [(set (match_operand:QHSI 0 "low_register_operand" "=l")
+ (match_operand:QHSI 1 "const_int_operand" "I"))
(clobber (reg:CC CC_REGNUM))]
"TARGET_THUMB2 && reload_completed"
"mov%!\t%0, %1"
diff --git a/gcc/config/arm/unwind-arm.c b/gcc/config/arm/unwind-arm.c
index 4eb18215f17..2c6e004890e 100644
--- a/gcc/config/arm/unwind-arm.c
+++ b/gcc/config/arm/unwind-arm.c
@@ -1000,7 +1000,6 @@ __gnu_Unwind_Backtrace(_Unwind_Trace_Fn trace, void * trace_argument,
while (code != _URC_END_OF_STACK
&& code != _URC_FAILURE);
- finish:
restore_non_core_regs (&saved_vrs);
return code;
}
diff --git a/gcc/config/arm/vxworks.h b/gcc/config/arm/vxworks.h
index 8879fedb7d7..aa7e197bc5d 100644
--- a/gcc/config/arm/vxworks.h
+++ b/gcc/config/arm/vxworks.h
@@ -97,7 +97,7 @@ along with GCC; see the file COPYING3. If not see
/* There is no default multilib. */
#undef MULTILIB_DEFAULTS
-#define FPUTYPE_DEFAULT FPUTYPE_VFP
+#define FPUTYPE_DEFAULT "vfp"
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER VXWORKS_FUNCTION_PROFILER
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 76df476f4c4..cb2d709c89a 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -104,9 +104,6 @@ static GTY(()) rtx zero_reg_rtx;
/* AVR register names {"r0", "r1", ..., "r31"} */
static const char *const avr_regnames[] = REGISTER_NAMES;
-/* This holds the last insn address. */
-static int last_insn_address = 0;
-
/* Preprocessor macros to define depending on MCU type. */
static const char *avr_extra_arch_macro;
@@ -556,8 +553,6 @@ expand_prologue (void)
rtx pushword = gen_rtx_MEM (HImode,
gen_rtx_POST_DEC (HImode, stack_pointer_rtx));
rtx insn;
-
- last_insn_address = 0;
/* Init cfun->machine. */
cfun->machine->is_naked = avr_naked_function_p (current_function_decl);
@@ -1459,25 +1454,17 @@ byte_immediate_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
&& INTVAL (op) <= 0xff && INTVAL (op) >= 0);
}
-/* Output all insn addresses and their sizes into the assembly language
- output file. This is helpful for debugging whether the length attributes
- in the md file are correct.
- Output insn cost for next insn. */
+/* Output insn cost for next insn. */
void
final_prescan_insn (rtx insn, rtx *operand ATTRIBUTE_UNUSED,
int num_operands ATTRIBUTE_UNUSED)
{
- int uid = INSN_UID (insn);
-
- if (TARGET_INSN_SIZE_DUMP || TARGET_ALL_DEBUG)
+ if (TARGET_ALL_DEBUG)
{
- fprintf (asm_out_file, "/*DEBUG: 0x%x\t\t%d\t%d */\n",
- INSN_ADDRESSES (uid),
- INSN_ADDRESSES (uid) - last_insn_address,
+ fprintf (asm_out_file, "/* DEBUG: cost = %d. */\n",
rtx_cost (PATTERN (insn), INSN, !optimize_size));
}
- last_insn_address = INSN_ADDRESSES (uid);
}
/* Return 0 if undefined, 1 if always true or always false. */
@@ -5890,12 +5877,12 @@ avr_hard_regno_rename_ok (unsigned int old_reg ATTRIBUTE_UNUSED,
return 1;
}
-/* Output a branch that tests a single bit of a register (QI, HI or SImode)
+/* Output a branch that tests a single bit of a register (QI, HI, SI or DImode)
or memory location in the I/O space (QImode only).
Operand 0: comparison operator (must be EQ or NE, compare bit to zero).
Operand 1: register operand to test, or CONST_INT memory address.
- Operand 2: bit number (for QImode operand) or mask (HImode, SImode).
+ Operand 2: bit number.
Operand 3: label to jump to if the test is true. */
const char *
@@ -5943,9 +5930,7 @@ avr_out_sbxx_branch (rtx insn, rtx operands[])
else /* HImode or SImode */
{
static char buf[] = "sbrc %A1,0";
- int bit_nr = exact_log2 (INTVAL (operands[2])
- & GET_MODE_MASK (GET_MODE (operands[1])));
-
+ int bit_nr = INTVAL (operands[2]);
buf[3] = (comp == EQ) ? 's' : 'c';
buf[6] = 'A' + (bit_nr >> 3);
buf[9] = '0' + (bit_nr & 7);
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index 0927e3928c1..782ad11627b 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -406,8 +406,6 @@ extern int avr_reg_order[];
#define HAVE_POST_INCREMENT 1
#define HAVE_PRE_DECREMENT 1
-#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
-
#define MAX_REGS_PER_ADDRESS 1
#define REG_OK_FOR_BASE_NOSTRICT_P(X) \
diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md
index 5a15200ffe3..51fc1f99b8b 100644
--- a/gcc/config/avr/avr.md
+++ b/gcc/config/avr/avr.md
@@ -118,6 +118,7 @@
;; Define mode iterator
(define_mode_iterator QISI [(QI "") (HI "") (SI "")])
+(define_mode_iterator QIDI [(QI "") (HI "") (SI "") (DI "")])
;;========================================================================
;; The following is used by nonlocal_goto and setjmp.
@@ -235,7 +236,7 @@
(define_insn "*movqi"
[(set (match_operand:QI 0 "nonimmediate_operand" "=r,d,Qm,r,q,r,*r")
- (match_operand:QI 1 "general_operand" "r,i,rL,Qm,r,q,i"))]
+ (match_operand:QI 1 "general_operand" "rL,i,rL,Qm,r,q,i"))]
"(register_operand (operands[0],QImode)
|| register_operand (operands[1], QImode) || const0_rtx == operands[1])"
"* return output_movqi (insn, operands, NULL);"
@@ -336,7 +337,7 @@
(define_insn "*movhi"
[(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,m,d,*r,q,r")
- (match_operand:HI 1 "general_operand" "r,m,rL,i,i,r,q"))]
+ (match_operand:HI 1 "general_operand" "rL,m,rL,i,i,r,q"))]
"(register_operand (operands[0],HImode)
|| register_operand (operands[1],HImode) || const0_rtx == operands[1])"
"* return output_movhi (insn, operands, NULL);"
@@ -2448,12 +2449,15 @@
;; Test a single bit in a QI/HI/SImode register.
-(define_insn "*sbrx_branch"
+;; Combine will create zero extract patterns for single bit tests.
+;; permit any mode in source pattern by using VOIDmode.
+
+(define_insn "*sbrx_branch<mode>"
[(set (pc)
(if_then_else
(match_operator 0 "eqne_operator"
- [(zero_extract:HI
- (match_operand:QI 1 "register_operand" "r")
+ [(zero_extract:QIDI
+ (match_operand:VOID 1 "register_operand" "r")
(const_int 1)
(match_operand 2 "const_int_operand" "n"))
(const_int 0)])
@@ -2470,39 +2474,27 @@
(const_int 4))))
(set_attr "cc" "clobber")])
-(define_insn "*sbrx_and_branchhi"
- [(set (pc)
- (if_then_else
- (match_operator 0 "eqne_operator"
- [(and:HI
- (match_operand:HI 1 "register_operand" "r")
- (match_operand:HI 2 "single_one_operand" "n"))
- (const_int 0)])
- (label_ref (match_operand 3 "" ""))
- (pc)))]
- ""
- "* return avr_out_sbxx_branch (insn, operands);"
- [(set (attr "length")
- (if_then_else (and (ge (minus (pc) (match_dup 3)) (const_int -2046))
- (le (minus (pc) (match_dup 3)) (const_int 2046)))
- (const_int 2)
- (if_then_else (eq_attr "mcu_mega" "no")
- (const_int 2)
- (const_int 4))))
- (set_attr "cc" "clobber")])
+;; Same test based on Bitwise AND RTL. Keep this incase gcc changes patterns.
+;; or for old peepholes.
+;; Fixme - bitwise Mask will not work for DImode
-(define_insn "*sbrx_and_branchsi"
+(define_insn "*sbrx_and_branch<mode>"
[(set (pc)
(if_then_else
(match_operator 0 "eqne_operator"
- [(and:SI
- (match_operand:SI 1 "register_operand" "r")
- (match_operand:SI 2 "single_one_operand" "n"))
+ [(and:QISI
+ (match_operand:QISI 1 "register_operand" "r")
+ (match_operand:QISI 2 "single_one_operand" "n"))
(const_int 0)])
(label_ref (match_operand 3 "" ""))
(pc)))]
""
- "* return avr_out_sbxx_branch (insn, operands);"
+{
+ HOST_WIDE_INT bitnumber;
+ bitnumber = exact_log2 (GET_MODE_MASK (<MODE>mode) & INTVAL (operands[2]));
+ operands[2] = GEN_INT (bitnumber);
+ return avr_out_sbxx_branch (insn, operands);
+}
[(set (attr "length")
(if_then_else (and (ge (minus (pc) (match_dup 3)) (const_int -2046))
(le (minus (pc) (match_dup 3)) (const_int 2046)))
diff --git a/gcc/config/avr/avr.opt b/gcc/config/avr/avr.opt
index f94d6a3c2ac..f8013e53a18 100644
--- a/gcc/config/avr/avr.opt
+++ b/gcc/config/avr/avr.opt
@@ -47,10 +47,6 @@ mshort-calls
Target Report Mask(SHORT_CALLS)
Use rjmp/rcall (limited range) on >8K devices
-msize
-Target Report Mask(INSN_SIZE_DUMP)
-Output instruction sizes to the asm file
-
mtiny-stack
Target Report Mask(TINY_STACK)
Change only the low 8 bits of the stack pointer
diff --git a/gcc/config/bfin/bfin.h b/gcc/config/bfin/bfin.h
index 03a279036f3..365680ee9fa 100644
--- a/gcc/config/bfin/bfin.h
+++ b/gcc/config/bfin/bfin.h
@@ -911,9 +911,6 @@ typedef struct {
/* Addressing Modes */
-/* Recognize any constant value that is a valid address. */
-#define CONSTANT_ADDRESS_P(X) (CONSTANT_P (X))
-
/* Nonzero if the constant value X is a legitimate general operand.
symbol_ref are not legitimate and will be put into constant pool.
See force_const_mem().
diff --git a/gcc/config/cris/cris-protos.h b/gcc/config/cris/cris-protos.h
index db6aa9fe9ce..721c90ff887 100644
--- a/gcc/config/cris/cris-protos.h
+++ b/gcc/config/cris/cris-protos.h
@@ -71,3 +71,5 @@ extern void cris_override_options (void);
extern int cris_initial_elimination_offset (int, int);
extern void cris_init_expanders (void);
+
+extern bool cris_function_value_regno_p (const unsigned int);
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index bf00a57a3b6..225ad403dda 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -130,6 +130,9 @@ static bool cris_frame_pointer_required (void);
static void cris_asm_trampoline_template (FILE *);
static void cris_trampoline_init (rtx, tree, rtx);
+static rtx cris_function_value(const_tree, const_tree, bool);
+static rtx cris_libcall_value (enum machine_mode, const_rtx);
+
/* This is the parsed result of the "-max-stack-stackframe=" option. If
it (still) is zero, then there was no such option given. */
int cris_max_stackframe = 0;
@@ -197,6 +200,11 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION;
#undef TARGET_TRAMPOLINE_INIT
#define TARGET_TRAMPOLINE_INIT cris_trampoline_init
+#undef TARGET_FUNCTION_VALUE
+#define TARGET_FUNCTION_VALUE cris_function_value
+#undef TARGET_LIBCALL_VALUE
+#define TARGET_LIBCALL_VALUE cris_libcall_value
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Helper for cris_load_multiple_op and cris_ret_movem_op. */
@@ -3777,13 +3785,42 @@ cris_promote_function_mode (const_tree type ATTRIBUTE_UNUSED,
int for_return)
{
/* Defining PROMOTE_FUNCTION_RETURN in gcc-2.7.2 uncovered bug 981110 (even
- when modifying FUNCTION_VALUE to return the promoted mode). Maybe
- pointless as of now, but let's keep the old behavior. */
+ when modifying TARGET_FUNCTION_VALUE to return the promoted mode).
+ Maybe pointless as of now, but let's keep the old behavior. */
if (for_return == 1)
return mode;
return CRIS_PROMOTED_MODE (mode, *punsignedp, type);
}
+/* Let's assume all functions return in r[CRIS_FIRST_ARG_REG] for the
+ time being. */
+
+static rtx
+cris_function_value(const_tree type,
+ const_tree func ATTRIBUTE_UNUSED,
+ bool outgoing ATTRIBUTE_UNUSED)
+{
+ return gen_rtx_REG (TYPE_MODE (type), CRIS_FIRST_ARG_REG);
+}
+
+/* Let's assume all functions return in r[CRIS_FIRST_ARG_REG] for the
+ time being. */
+
+static rtx
+cris_libcall_value (enum machine_mode mode,
+ const_rtx fun ATTRIBUTE_UNUSED)
+{
+ return gen_rtx_REG (mode, CRIS_FIRST_ARG_REG);
+}
+
+/* Let's assume all functions return in r[CRIS_FIRST_ARG_REG] for the
+ time being. */
+
+bool
+cris_function_value_regno_p (const unsigned int regno)
+{
+ return (regno == CRIS_FIRST_ARG_REG);
+}
static int
cris_arg_partial_bytes (CUMULATIVE_ARGS *ca, enum machine_mode mode,
diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h
index 586f7ff2077..3c426b74ae5 100644
--- a/gcc/config/cris/cris.h
+++ b/gcc/config/cris/cris.h
@@ -630,12 +630,17 @@ enum reg_class
? GENERAL_REGS : (CLASS))
/* We can't move special registers to and from memory in smaller than
- word_mode. */
-#define SECONDARY_RELOAD_CLASS(CLASS, MODE, X) \
- (((CLASS) != SPECIAL_REGS && (CLASS) != MOF_REGS) \
- || GET_MODE_SIZE (MODE) == 4 \
- || !MEM_P (X) \
- ? NO_REGS : GENERAL_REGS)
+ word_mode. We also can't move between special registers. Luckily,
+ -1, as returned by true_regnum for non-sub/registers, is valid as a
+ parameter to our REGNO_REG_CLASS, returning GENERAL_REGS, so we get
+ the effect that any X that isn't a special-register is treated as
+ a non-empty intersection with GENERAL_REGS. */
+#define SECONDARY_RELOAD_CLASS(CLASS, MODE, X) \
+ ((((CLASS) == SPECIAL_REGS || (CLASS) == MOF_REGS) \
+ && ((GET_MODE_SIZE (MODE) < 4 && MEM_P (X)) \
+ || !reg_classes_intersect_p (REGNO_REG_CLASS (true_regnum (X)), \
+ GENERAL_REGS))) \
+ ? GENERAL_REGS : NO_REGS)
/* FIXME: Fix regrename.c; it should check validity of replacements,
not just with a silly pass-specific macro. We may miss some
@@ -901,14 +906,8 @@ struct cum_args {int regs;};
/* Node: Scalar Return */
-/* Let's assume all functions return in r[CRIS_FIRST_ARG_REG] for the
- time being. */
-#define FUNCTION_VALUE(VALTYPE, FUNC) \
- gen_rtx_REG (TYPE_MODE (VALTYPE), CRIS_FIRST_ARG_REG)
+#define FUNCTION_VALUE_REGNO_P(N) cris_function_value_regno_p (N)
-#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, CRIS_FIRST_ARG_REG)
-
-#define FUNCTION_VALUE_REGNO_P(N) ((N) == CRIS_FIRST_ARG_REG)
/* Node: Aggregate Return */
@@ -951,8 +950,6 @@ struct cum_args {int regs;};
#define HAVE_POST_INCREMENT 1
-#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
-
/* Must be a compile-time constant, so we go with the highest value
among all CRIS variants. */
#define MAX_REGS_PER_ADDRESS 2
diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md
index 79eb8da3b0d..bd14a16337e 100644
--- a/gcc/config/cris/cris.md
+++ b/gcc/config/cris/cris.md
@@ -4936,7 +4936,7 @@
;; It should be:
;; movu.b some_byte,reg_32
;; and.b const,reg_32
-;; but is turns into:
+;; but it turns into:
;; move.b some_byte,reg_32
;; and.d const,reg_32
;; Fix it here.
@@ -4953,7 +4953,9 @@
"REGNO (operands[2]) == REGNO (operands[0])
&& INTVAL (operands[3]) <= 65535 && INTVAL (operands[3]) >= 0
&& !CRIS_CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'I')
- && !side_effects_p (operands[1])"
+ && !side_effects_p (operands[1])
+ && (!REG_P (operands[1])
+ || REGNO (operands[1]) <= CRIS_LAST_GENERAL_REGISTER)"
;; FIXME: CC0 valid except for M (i.e. CC_NOT_NEGATIVE).
[(set (match_dup 0) (match_dup 4))
(set (match_dup 5) (match_dup 6))]
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index a8933e66348..b5c4fb8e0d9 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -1697,6 +1697,17 @@ darwin_override_options (void)
if (dwarf_strict < 0)
dwarf_strict = 1;
+ /* Disable -freorder-blocks-and-partition for darwin_emit_unwind_label. */
+ if (flag_reorder_blocks_and_partition
+ && (targetm.asm_out.unwind_label == darwin_emit_unwind_label))
+ {
+ inform (input_location,
+ "-freorder-blocks-and-partition does not work with exceptions "
+ "on this architecture");
+ flag_reorder_blocks_and_partition = 0;
+ flag_reorder_blocks = 1;
+ }
+
if (flag_mkernel || flag_apple_kext)
{
/* -mkernel implies -fapple-kext for C++ */
diff --git a/gcc/config/darwin10.h b/gcc/config/darwin10.h
index 65ba2632a8f..b1edf36ce3d 100644
--- a/gcc/config/darwin10.h
+++ b/gcc/config/darwin10.h
@@ -23,3 +23,8 @@ unwinder in libSystem is fixed to digest new epilog unwinding notes. */
#undef LIB_SPEC
#define LIB_SPEC "%{!static:-no_compact_unwind -lSystem}"
+
+/* Unwind labels are no longer required in darwin10. */
+
+#undef TARGET_ASM_EMIT_UNWIND_LABEL
+#define TARGET_ASM_EMIT_UNWIND_LABEL default_emit_unwind_label
diff --git a/gcc/config/fr30/fr30.h b/gcc/config/fr30/fr30.h
index 20e157173d8..5e6237895b5 100644
--- a/gcc/config/fr30/fr30.h
+++ b/gcc/config/fr30/fr30.h
@@ -741,16 +741,6 @@ enum reg_class
/*}}}*/
/*{{{ Addressing Modes. */
-/* A C expression that is 1 if the RTX X is a constant which is a valid
- address. On most machines, this can be defined as `CONSTANT_P (X)', but a
- few machines are more restrictive in which constant addresses are supported.
-
- `CONSTANT_P' accepts integer-values expressions whose values are not
- explicitly known, such as `symbol_ref', `label_ref', and `high' expressions
- and `const' arithmetic expressions, in addition to `const_int' and
- `const_double' expressions. */
-#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
-
/* A number, the maximum number of registers that can appear in a valid memory
address. Note that it is up to you to specify a value equal to the maximum
number that `GO_IF_LEGITIMATE_ADDRESS' would ever accept. */
diff --git a/gcc/config/frv/frv-protos.h b/gcc/config/frv/frv-protos.h
index 2bfdc65f654..3c9950d740b 100644
--- a/gcc/config/frv/frv-protos.h
+++ b/gcc/config/frv/frv-protos.h
@@ -62,6 +62,7 @@ extern rtx frv_function_arg (CUMULATIVE_ARGS *,
extern void frv_function_arg_advance (CUMULATIVE_ARGS *,
enum machine_mode,
tree, int);
+extern bool frv_function_value_regno_p (const unsigned int);
#endif /* TREE_CODE */
extern int frv_expand_block_move (rtx *);
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index d8901e9a68e..a757472f37b 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -273,6 +273,10 @@ static void frv_print_operand_memory_reference_reg
static void frv_print_operand_memory_reference (FILE *, rtx, int);
static int frv_print_operand_jump_hint (rtx);
static const char *comparison_string (enum rtx_code, rtx);
+static rtx frv_function_value (const_tree, const_tree,
+ bool);
+static rtx frv_libcall_value (enum machine_mode,
+ const_rtx);
static FRV_INLINE int frv_regno_ok_for_base_p (int, int);
static rtx single_set_pattern (rtx);
static int frv_function_contains_far_jump (void);
@@ -483,6 +487,11 @@ static void frv_trampoline_init (rtx, tree, rtx);
#undef TARGET_TRAMPOLINE_INIT
#define TARGET_TRAMPOLINE_INIT frv_trampoline_init
+#undef TARGET_FUNCTION_VALUE
+#define TARGET_FUNCTION_VALUE frv_function_value
+#undef TARGET_LIBCALL_VALUE
+#define TARGET_LIBCALL_VALUE frv_libcall_value
+
struct gcc_target targetm = TARGET_INITIALIZER;
#define FRV_SYMBOL_REF_TLS_P(RTX) \
@@ -3291,6 +3300,35 @@ frv_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode,
}
+/* Implements TARGET_FUNCTION_VALUE. */
+
+static rtx
+frv_function_value (const_tree valtype,
+ const_tree fn_decl_or_type ATTRIBUTE_UNUSED,
+ bool outgoing ATTRIBUTE_UNUSED)
+{
+ return gen_rtx_REG (TYPE_MODE (valtype), RETURN_VALUE_REGNUM);
+}
+
+
+/* Implements TARGET_LIBCALL_VALUE. */
+
+static rtx
+frv_libcall_value (enum machine_mode mode,
+ const_rtx fun ATTRIBUTE_UNUSED)
+{
+ return gen_rtx_REG (mode, RETURN_VALUE_REGNUM);
+}
+
+
+/* Implements FUNCTION_VALUE_REGNO_P. */
+
+bool
+frv_function_value_regno_p (const unsigned int regno)
+{
+ return (regno == RETURN_VALUE_REGNUM);
+}
+
/* Return true if a register is ok to use as a base or index register. */
static FRV_INLINE int
diff --git a/gcc/config/frv/frv.h b/gcc/config/frv/frv.h
index 53966de50b7..d5a7a4a6670 100644
--- a/gcc/config/frv/frv.h
+++ b/gcc/config/frv/frv.h
@@ -1746,48 +1746,7 @@ typedef struct frv_stack {
function call. */
#define RETURN_VALUE_REGNUM (GPR_FIRST + 8)
-/* A C expression to create an RTX representing the place where a function
- returns a value of data type VALTYPE. VALTYPE is a tree node representing a
- data type. Write `TYPE_MODE (VALTYPE)' to get the machine mode used to
- represent that type. On many machines, only the mode is relevant.
- (Actually, on most machines, scalar values are returned in the same place
- regardless of mode).
-
- If the precise function being called is known, FUNC is a tree node
- (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This makes it
- possible to use a different value-returning convention for specific
- functions when all their calls are known.
-
- `FUNCTION_VALUE' is not used for return vales with aggregate data types,
- because these are returned in another way. See
- `TARGET_STRUCT_VALUE_RTX' and related macros, below. */
-#define FUNCTION_VALUE(VALTYPE, FUNC) \
- gen_rtx_REG (TYPE_MODE (VALTYPE), RETURN_VALUE_REGNUM)
-
-/* A C expression to create an RTX representing the place where a library
- function returns a value of mode MODE.
-
- Note that "library function" in this context means a compiler support
- routine, used to perform arithmetic, whose name is known specially by the
- compiler and was not mentioned in the C code being compiled.
-
- The definition of `LIBRARY_VALUE' need not be concerned aggregate data
- types, because none of the library functions returns such types. */
-#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, RETURN_VALUE_REGNUM)
-
-/* A C expression that is nonzero if REGNO is the number of a hard register in
- which the values of called function may come back.
-
- A register whose use for returning values is limited to serving as the
- second of a pair (for a value of type `double', say) need not be recognized
- by this macro. So for most machines, this definition suffices:
-
- #define FUNCTION_VALUE_REGNO_P(N) ((N) == RETURN)
-
- If the machine has register windows, so that the caller and the called
- function use different registers for the return value, this macro should
- recognize only the caller's register numbers. */
-#define FUNCTION_VALUE_REGNO_P(REGNO) ((REGNO) == RETURN_VALUE_REGNUM)
+#define FUNCTION_VALUE_REGNO_P(REGNO) frv_function_value_regno_p (REGNO)
/* How Large Values are Returned. */
@@ -1968,16 +1927,6 @@ __asm__("\n" \
/* Addressing Modes. */
-/* A C expression that is 1 if the RTX X is a constant which is a valid
- address. On most machines, this can be defined as `CONSTANT_P (X)', but a
- few machines are more restrictive in which constant addresses are supported.
-
- `CONSTANT_P' accepts integer-values expressions whose values are not
- explicitly known, such as `symbol_ref', `label_ref', and `high' expressions
- and `const' arithmetic expressions, in addition to `const_int' and
- `const_double' expressions. */
-#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
-
/* A number, the maximum number of registers that can appear in a valid memory
address. Note that it is up to you to specify a value equal to the maximum
number that `TARGET_LEGITIMATE_ADDRESS_P' would ever accept. */
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 404595405f3..7bb1e7a6c5c 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -507,6 +507,32 @@ byte_reg (rtx x, int b)
&& call_used_regs[regno] \
&& !current_function_is_leaf)))
+/* We use this to wrap all emitted insns in the prologue. */
+static rtx
+F (rtx x)
+{
+ RTX_FRAME_RELATED_P (x) = 1;
+ return x;
+}
+
+/* Mark all the subexpressions of the PARALLEL rtx PAR as
+ frame-related. Return PAR.
+
+ dwarf2out.c:dwarf2out_frame_debug_expr ignores sub-expressions of a
+ PARALLEL rtx other than the first if they do not have the
+ FRAME_RELATED flag set on them. */
+static rtx
+Fpa (rtx par)
+{
+ int len = XVECLEN (par, 0);
+ int i;
+
+ for (i = 0; i < len; i++)
+ F (XVECEXP (par, 0, i));
+
+ return par;
+}
+
/* Output assembly language to FILE for the operation OP with operand size
SIZE to adjust the stack pointer. */
@@ -526,22 +552,27 @@ h8300_emit_stack_adjustment (int sign, HOST_WIDE_INT size)
&& !(cfun->static_chain_decl != NULL && sign < 0))
{
rtx r3 = gen_rtx_REG (Pmode, 3);
- emit_insn (gen_movhi (r3, GEN_INT (sign * size)));
- emit_insn (gen_addhi3 (stack_pointer_rtx,
- stack_pointer_rtx, r3));
+ F (emit_insn (gen_movhi (r3, GEN_INT (sign * size))));
+ F (emit_insn (gen_addhi3 (stack_pointer_rtx,
+ stack_pointer_rtx, r3)));
}
else
{
/* The stack adjustment made here is further optimized by the
splitter. In case of H8/300, the splitter always splits the
- addition emitted here to make the adjustment
- interrupt-safe. */
+ addition emitted here to make the adjustment interrupt-safe.
+ FIXME: We don't always tag those, because we don't know what
+ the splitter will do. */
if (Pmode == HImode)
- emit_insn (gen_addhi3 (stack_pointer_rtx,
- stack_pointer_rtx, GEN_INT (sign * size)));
+ {
+ rtx x = emit_insn (gen_addhi3 (stack_pointer_rtx,
+ stack_pointer_rtx, GEN_INT (sign * size)));
+ if (size < 4)
+ F (x);
+ }
else
- emit_insn (gen_addsi3 (stack_pointer_rtx,
- stack_pointer_rtx, GEN_INT (sign * size)));
+ F (emit_insn (gen_addsi3 (stack_pointer_rtx,
+ stack_pointer_rtx, GEN_INT (sign * size))));
}
}
@@ -591,7 +622,7 @@ push (int rn)
x = gen_push_h8300hs_advanced (reg);
else
x = gen_push_h8300hs_normal (reg);
- x = emit_insn (x);
+ x = F (emit_insn (x));
REG_NOTES (x) = gen_rtx_EXPR_LIST (REG_INC, stack_pointer_rtx, 0);
}
@@ -634,7 +665,7 @@ h8300_push_pop (int regno, int nregs, int pop_p, int return_p)
{
int i, j;
rtvec vec;
- rtx sp, offset;
+ rtx sp, offset, x;
/* See whether we can use a simple push or pop. */
if (!return_p && nregs == 1)
@@ -685,7 +716,10 @@ h8300_push_pop (int regno, int nregs, int pop_p, int return_p)
RTVEC_ELT (vec, i + j) = gen_rtx_SET (VOIDmode, sp,
gen_rtx_PLUS (Pmode, sp, offset));
- emit_insn (gen_rtx_PARALLEL (VOIDmode, vec));
+ x = gen_rtx_PARALLEL (VOIDmode, vec);
+ if (!pop_p)
+ x = Fpa (x);
+ emit_insn (x);
}
/* Return true if X has the value sp + OFFSET. */
@@ -820,7 +854,7 @@ h8300_expand_prologue (void)
{
/* Push fp. */
push (HARD_FRAME_POINTER_REGNUM);
- emit_move_insn (hard_frame_pointer_rtx, stack_pointer_rtx);
+ F (emit_move_insn (hard_frame_pointer_rtx, stack_pointer_rtx));
}
/* Push the rest of the registers in ascending order. */
diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h
index e0f0ea62f4e..9757afc2de3 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -147,6 +147,17 @@ extern const char * const *h8_reg_names;
/* Show we can debug even without a frame pointer. */
/* #define CAN_DEBUG_WITHOUT_FP */
+/* We want dwarf2 info available to gdb... */
+#define DWARF2_DEBUGGING_INFO 1
+/* ... but we don't actually support full dwarf2 EH. */
+#define MUST_USE_SJLJ_EXCEPTIONS 1
+
+/* The return address is pushed on the stack. */
+#define INCOMING_RETURN_ADDR_RTX gen_rtx_MEM (Pmode, gen_rtx_REG (Pmode, STACK_POINTER_REGNUM))
+#define INCOMING_FRAME_SP_OFFSET (POINTER_SIZE / 8)
+
+#define DWARF_CIE_DATA_ALIGNMENT 2
+
/* Define this if addresses of constant functions
shouldn't be put through pseudo regs where they can be cse'd.
Desirable on machines where ordinary constants are expensive
diff --git a/gcc/config/i386/cpuid.h b/gcc/config/i386/cpuid.h
index 49acfa780e4..21f0e3184ef 100644
--- a/gcc/config/i386/cpuid.h
+++ b/gcc/config/i386/cpuid.h
@@ -46,9 +46,11 @@
/* Extended Features */
/* %ecx */
+#define bit_FMA4 (1 << 16)
#define bit_LAHF_LM (1 << 0)
+#define bit_LWP (1 << 15)
#define bit_SSE4a (1 << 6)
-#define bit_FMA4 (1 << 16)
+#define bit_XOP (1 << 11)
/* %edx */
#define bit_LM (1 << 29)
diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h
index 43003cc5cad..cdab21c91a2 100644
--- a/gcc/config/i386/cygming.h
+++ b/gcc/config/i386/cygming.h
@@ -49,8 +49,9 @@ along with GCC; see the file COPYING3. If not see
target, always use the svr4_dbx_register_map for DWARF .eh_frame
even if we don't use DWARF .debug_frame. */
#undef DWARF_FRAME_REGNUM
-#define DWARF_FRAME_REGNUM(n) TARGET_64BIT \
- ? dbx64_register_map[(n)] : svr4_dbx_register_map[(n)]
+#define DWARF_FRAME_REGNUM(n) \
+ (TARGET_64BIT ? dbx64_register_map[(n)] \
+ : svr4_dbx_register_map[(n)])
#ifdef HAVE_GAS_PE_SECREL32_RELOC
/* Use section relative relocations for debugging offsets. Unlike
diff --git a/gcc/config/i386/fma4intrin.h b/gcc/config/i386/fma4intrin.h
index 42782ade0ed..2bd411a0f05 100644
--- a/gcc/config/i386/fma4intrin.h
+++ b/gcc/config/i386/fma4intrin.h
@@ -35,15 +35,6 @@
/* We need definitions from the SSE4A, SSE3, SSE2 and SSE header files. */
#include <ammintrin.h>
-/* Internal data types for implementing the intrinsics. */
-typedef float __v8sf __attribute__ ((__vector_size__ (32)));
-typedef double __v4df __attribute__ ((__vector_size__ (32)));
-
-typedef float __m256 __attribute__ ((__vector_size__ (32),
- __may_alias__));
-typedef double __m256d __attribute__ ((__vector_size__ (32),
- __may_alias__));
-
/* 128b Floating point multiply/add type instructions. */
extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_macc_ps (__m128 __A, __m128 __B, __m128 __C)
diff --git a/gcc/config/i386/i386-c.c b/gcc/config/i386/i386-c.c
index 12a3f1759a8..5a5311fba0f 100644
--- a/gcc/config/i386/i386-c.c
+++ b/gcc/config/i386/i386-c.c
@@ -232,6 +232,10 @@ ix86_target_macros_internal (int isa_flag,
def_or_undef (parse_in, "__SSE4A__");
if (isa_flag & OPTION_MASK_ISA_FMA4)
def_or_undef (parse_in, "__FMA4__");
+ if (isa_flag & OPTION_MASK_ISA_XOP)
+ def_or_undef (parse_in, "__XOP__");
+ if (isa_flag & OPTION_MASK_ISA_LWP)
+ def_or_undef (parse_in, "__LWP__");
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 9df01ba23dc..2031dfb6e98 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -1553,6 +1553,11 @@ static unsigned int initial_ix86_arch_features[X86_ARCH_LAST] = {
/* X86_ARCH_BSWAP: Byteswap was added for 80486. */
~m_386,
+
+ /* X86_ARCH_CALL_ESP: P6 processors will jump to the address after
+ the decrement (so they will execute return address as code). See
+ Pentium Pro errata 70, Pentium 2 errata A33, Pentium 3 errata E17. */
+ ~(m_386 | m_486 | m_PENT | m_PPRO),
};
static const unsigned int x86_accumulate_outgoing_args
@@ -1905,6 +1910,7 @@ static bool ix86_valid_target_attribute_p (tree, tree, tree, int);
static bool ix86_valid_target_attribute_inner_p (tree, char *[]);
static bool ix86_can_inline_p (tree, tree);
static void ix86_set_current_function (tree);
+static unsigned int ix86_minimum_incoming_stack_boundary (bool);
static enum calling_abi ix86_function_abi (const_tree);
@@ -1958,6 +1964,10 @@ static int ix86_isa_flags_explicit;
#define OPTION_MASK_ISA_FMA4_SET \
(OPTION_MASK_ISA_FMA4 | OPTION_MASK_ISA_SSE4A_SET \
| OPTION_MASK_ISA_AVX_SET)
+#define OPTION_MASK_ISA_XOP_SET \
+ (OPTION_MASK_ISA_XOP | OPTION_MASK_ISA_FMA4_SET)
+#define OPTION_MASK_ISA_LWP_SET \
+ OPTION_MASK_ISA_LWP
/* AES and PCLMUL need SSE2 because they use xmm registers */
#define OPTION_MASK_ISA_AES_SET \
@@ -2009,7 +2019,10 @@ static int ix86_isa_flags_explicit;
#define OPTION_MASK_ISA_SSE4A_UNSET \
(OPTION_MASK_ISA_SSE4A | OPTION_MASK_ISA_FMA4_UNSET)
-#define OPTION_MASK_ISA_FMA4_UNSET OPTION_MASK_ISA_FMA4
+#define OPTION_MASK_ISA_FMA4_UNSET \
+ (OPTION_MASK_ISA_FMA4 | OPTION_MASK_ISA_XOP_UNSET)
+#define OPTION_MASK_ISA_XOP_UNSET OPTION_MASK_ISA_XOP
+#define OPTION_MASK_ISA_LWP_UNSET OPTION_MASK_ISA_LWP
#define OPTION_MASK_ISA_AES_UNSET OPTION_MASK_ISA_AES
#define OPTION_MASK_ISA_PCLMUL_UNSET OPTION_MASK_ISA_PCLMUL
@@ -2257,6 +2270,32 @@ ix86_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED, int value)
}
return true;
+ case OPT_mxop:
+ if (value)
+ {
+ ix86_isa_flags |= OPTION_MASK_ISA_XOP_SET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_XOP_SET;
+ }
+ else
+ {
+ ix86_isa_flags &= ~OPTION_MASK_ISA_XOP_UNSET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_XOP_UNSET;
+ }
+ return true;
+
+ case OPT_mlwp:
+ if (value)
+ {
+ ix86_isa_flags |= OPTION_MASK_ISA_LWP_SET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_LWP_SET;
+ }
+ else
+ {
+ ix86_isa_flags &= ~OPTION_MASK_ISA_LWP_UNSET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_LWP_UNSET;
+ }
+ return true;
+
case OPT_mabm:
if (value)
{
@@ -2385,6 +2424,8 @@ ix86_target_string (int isa, int flags, const char *arch, const char *tune,
{
{ "-m64", OPTION_MASK_ISA_64BIT },
{ "-mfma4", OPTION_MASK_ISA_FMA4 },
+ { "-mxop", OPTION_MASK_ISA_XOP },
+ { "-mlwp", OPTION_MASK_ISA_LWP },
{ "-msse4a", OPTION_MASK_ISA_SSE4A },
{ "-msse4.2", OPTION_MASK_ISA_SSE4_2 },
{ "-msse4.1", OPTION_MASK_ISA_SSE4_1 },
@@ -2615,7 +2656,9 @@ override_options (bool main_args_p)
PTA_AVX = 1 << 18,
PTA_FMA = 1 << 19,
PTA_MOVBE = 1 << 20,
- PTA_FMA4 = 1 << 21
+ PTA_FMA4 = 1 << 21,
+ PTA_XOP = 1 << 22,
+ PTA_LWP = 1 << 23
};
static struct pta
@@ -2961,6 +3004,12 @@ override_options (bool main_args_p)
if (processor_alias_table[i].flags & PTA_FMA4
&& !(ix86_isa_flags_explicit & OPTION_MASK_ISA_FMA4))
ix86_isa_flags |= OPTION_MASK_ISA_FMA4;
+ if (processor_alias_table[i].flags & PTA_XOP
+ && !(ix86_isa_flags_explicit & OPTION_MASK_ISA_XOP))
+ ix86_isa_flags |= OPTION_MASK_ISA_XOP;
+ if (processor_alias_table[i].flags & PTA_LWP
+ && !(ix86_isa_flags_explicit & OPTION_MASK_ISA_LWP))
+ ix86_isa_flags |= OPTION_MASK_ISA_LWP;
if (processor_alias_table[i].flags & PTA_ABM
&& !(ix86_isa_flags_explicit & OPTION_MASK_ISA_ABM))
ix86_isa_flags |= OPTION_MASK_ISA_ABM;
@@ -3239,12 +3288,10 @@ override_options (bool main_args_p)
if (ix86_force_align_arg_pointer == -1)
ix86_force_align_arg_pointer = STACK_REALIGN_DEFAULT;
+ ix86_default_incoming_stack_boundary = PREFERRED_STACK_BOUNDARY;
+
/* Validate -mincoming-stack-boundary= value or default it to
MIN_STACK_BOUNDARY/PREFERRED_STACK_BOUNDARY. */
- if (ix86_force_align_arg_pointer)
- ix86_default_incoming_stack_boundary = MIN_STACK_BOUNDARY;
- else
- ix86_default_incoming_stack_boundary = PREFERRED_STACK_BOUNDARY;
ix86_incoming_stack_boundary = ix86_default_incoming_stack_boundary;
if (ix86_incoming_stack_boundary_string)
{
@@ -3394,7 +3441,7 @@ override_options (bool main_args_p)
ix86_gen_pop1 = gen_popdi1;
ix86_gen_add3 = gen_adddi3;
ix86_gen_sub3 = gen_subdi3;
- ix86_gen_sub3_carry = gen_subdi3_carry_rex64;
+ ix86_gen_sub3_carry = gen_subdi3_carry;
ix86_gen_one_cmpl2 = gen_one_cmpldi2;
ix86_gen_monitor = gen_sse3_monitor64;
ix86_gen_andsp = gen_anddi3;
@@ -3645,6 +3692,8 @@ ix86_valid_target_attribute_inner_p (tree args, char *p_strings[])
IX86_ATTR_ISA ("sse4a", OPT_msse4a),
IX86_ATTR_ISA ("ssse3", OPT_mssse3),
IX86_ATTR_ISA ("fma4", OPT_mfma4),
+ IX86_ATTR_ISA ("xop", OPT_mxop),
+ IX86_ATTR_ISA ("lwp", OPT_mlwp),
/* string options */
IX86_ATTR_STR ("arch=", IX86_FUNCTION_SPECIFIC_ARCH),
@@ -4277,7 +4326,8 @@ ix86_function_ok_for_sibcall (tree decl, tree exp)
/* If we need to align the outgoing stack, then sibcalling would
unalign the stack, which may break the called function. */
- if (ix86_incoming_stack_boundary < PREFERRED_STACK_BOUNDARY)
+ if (ix86_minimum_incoming_stack_boundary (true)
+ < PREFERRED_STACK_BOUNDARY)
return false;
if (decl)
@@ -4774,6 +4824,25 @@ ix86_function_type_abi (const_tree fntype)
return ix86_abi;
}
+static bool
+ix86_function_ms_hook_prologue (const_tree fntype)
+{
+ if (!TARGET_64BIT)
+ {
+ if (lookup_attribute ("ms_hook_prologue", DECL_ATTRIBUTES (fntype)))
+ {
+ if (decl_function_context (fntype) != NULL_TREE)
+ {
+ error_at (DECL_SOURCE_LOCATION (fntype),
+ "ms_hook_prologue is not compatible with nested function");
+ }
+
+ return true;
+ }
+ }
+ return false;
+}
+
static enum calling_abi
ix86_function_abi (const_tree fndecl)
{
@@ -8177,37 +8246,58 @@ find_drap_reg (void)
}
}
-/* Update incoming stack boundary and estimated stack alignment. */
+/* Return minimum incoming stack alignment. */
-static void
-ix86_update_stack_boundary (void)
+static unsigned int
+ix86_minimum_incoming_stack_boundary (bool sibcall)
{
+ unsigned int incoming_stack_boundary;
+
/* Prefer the one specified at command line. */
- ix86_incoming_stack_boundary
- = (ix86_user_incoming_stack_boundary
- ? ix86_user_incoming_stack_boundary
- : ix86_default_incoming_stack_boundary);
+ if (ix86_user_incoming_stack_boundary)
+ incoming_stack_boundary = ix86_user_incoming_stack_boundary;
+ /* In 32bit, use MIN_STACK_BOUNDARY for incoming stack boundary
+ if -mstackrealign is used, it isn't used for sibcall check and
+ estimated stack alignment is 128bit. */
+ else if (!sibcall
+ && !TARGET_64BIT
+ && ix86_force_align_arg_pointer
+ && crtl->stack_alignment_estimated == 128)
+ incoming_stack_boundary = MIN_STACK_BOUNDARY;
+ else
+ incoming_stack_boundary = ix86_default_incoming_stack_boundary;
/* Incoming stack alignment can be changed on individual functions
via force_align_arg_pointer attribute. We use the smallest
incoming stack boundary. */
- if (ix86_incoming_stack_boundary > MIN_STACK_BOUNDARY
+ if (incoming_stack_boundary > MIN_STACK_BOUNDARY
&& lookup_attribute (ix86_force_align_arg_pointer_string,
TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl))))
- ix86_incoming_stack_boundary = MIN_STACK_BOUNDARY;
+ incoming_stack_boundary = MIN_STACK_BOUNDARY;
/* The incoming stack frame has to be aligned at least at
parm_stack_boundary. */
- if (ix86_incoming_stack_boundary < crtl->parm_stack_boundary)
- ix86_incoming_stack_boundary = crtl->parm_stack_boundary;
+ if (incoming_stack_boundary < crtl->parm_stack_boundary)
+ incoming_stack_boundary = crtl->parm_stack_boundary;
/* Stack at entrance of main is aligned by runtime. We use the
smallest incoming stack boundary. */
- if (ix86_incoming_stack_boundary > MAIN_STACK_BOUNDARY
+ if (incoming_stack_boundary > MAIN_STACK_BOUNDARY
&& DECL_NAME (current_function_decl)
&& MAIN_NAME_P (DECL_NAME (current_function_decl))
&& DECL_FILE_SCOPE_P (current_function_decl))
- ix86_incoming_stack_boundary = MAIN_STACK_BOUNDARY;
+ incoming_stack_boundary = MAIN_STACK_BOUNDARY;
+
+ return incoming_stack_boundary;
+}
+
+/* Update incoming stack boundary and estimated stack alignment. */
+
+static void
+ix86_update_stack_boundary (void)
+{
+ ix86_incoming_stack_boundary
+ = ix86_minimum_incoming_stack_boundary (false);
/* x86_64 vararg needs 16byte stack alignment for register save
area. */
@@ -8295,6 +8385,7 @@ ix86_expand_prologue (void)
bool pic_reg_used;
struct ix86_frame frame;
HOST_WIDE_INT allocate;
+ int gen_frame_pointer = frame_pointer_needed;
ix86_finalize_stack_realign_flags ();
@@ -8307,6 +8398,46 @@ ix86_expand_prologue (void)
ix86_compute_frame_layout (&frame);
+ if (ix86_function_ms_hook_prologue (current_function_decl))
+ {
+ rtx push, mov;
+
+ /* Make sure the function starts with
+ 8b ff movl.s %edi,%edi
+ 55 push %ebp
+ 8b ec movl.s %esp,%ebp
+
+ This matches the hookable function prologue in Win32 API
+ functions in Microsoft Windows XP Service Pack 2 and newer.
+ Wine uses this to enable Windows apps to hook the Win32 API
+ functions provided by Wine. */
+ insn = emit_insn (gen_vswapmov (gen_rtx_REG (SImode, DI_REG),
+ gen_rtx_REG (SImode, DI_REG)));
+ push = emit_insn (gen_push (hard_frame_pointer_rtx));
+ mov = emit_insn (gen_vswapmov (hard_frame_pointer_rtx,
+ stack_pointer_rtx));
+
+ if (frame_pointer_needed && !(crtl->drap_reg
+ && crtl->stack_realign_needed))
+ {
+ /* The push %ebp and movl.s %esp, %ebp already set up
+ the frame pointer. No need to do this again. */
+ gen_frame_pointer = 0;
+ RTX_FRAME_RELATED_P (push) = 1;
+ RTX_FRAME_RELATED_P (mov) = 1;
+ if (ix86_cfa_state->reg == stack_pointer_rtx)
+ ix86_cfa_state->reg = hard_frame_pointer_rtx;
+ }
+ else
+ /* If the frame pointer is not needed, pop %ebp again. This
+ could be optimized for cases where ebp needs to be backed up
+ for some other reason. If stack realignment is needed, pop
+ the base pointer again, align the stack, and later regenerate
+ the frame pointer setup. The frame pointer generated by the
+ hook prologue is not aligned, so it can't be used. */
+ insn = emit_insn ((*ix86_gen_pop1) (hard_frame_pointer_rtx));
+ }
+
/* The first insn of a function that accepts its static chain on the
stack is to push the register that would be filled in by a direct
call. This insn will be skipped by the trampoline. */
@@ -8378,7 +8509,7 @@ ix86_expand_prologue (void)
/* Note: AT&T enter does NOT have reversed args. Enter is probably
slower on all targets. Also sdb doesn't like it. */
- if (frame_pointer_needed)
+ if (gen_frame_pointer)
{
insn = emit_insn (gen_push (hard_frame_pointer_rtx));
RTX_FRAME_RELATED_P (insn) = 1;
@@ -8962,7 +9093,8 @@ ix86_expand_epilogue (int style)
0, red_offset,
style == 2);
pro_epilogue_adjust_stack (stack_pointer_rtx, stack_pointer_rtx,
- GEN_INT (frame.nsseregs * 16 + frame.padding0),
+ GEN_INT (frame.nsseregs * 16
+ + frame.padding0),
style, false);
}
else if (frame.to_allocate || frame.padding0 || frame.nsseregs)
@@ -10733,7 +10865,7 @@ i386_output_dwarf_dtprel (FILE *file, int size, rtx x)
static bool
ix86_pic_register_p (rtx x)
{
- if (GET_CODE (x) == VALUE)
+ if (GET_CODE (x) == VALUE && CSELIB_VAL_PTR (x))
return (pic_offset_table_rtx
&& rtx_equal_for_cselib_p (x, pic_offset_table_rtx));
else
@@ -11203,6 +11335,7 @@ get_some_local_dynamic_name (void)
X -- don't print any sort of PIC '@' suffix for a symbol.
& -- print some in-use local-dynamic symbol name.
H -- print a memory address offset by 8; used for sse high-parts
+ Y -- print condition for XOP pcom* instruction.
+ -- print a branch hint as 'cs' or 'ds' prefix
; -- print a semicolon (after prefixes due to bug in older gas).
*/
@@ -11620,6 +11753,61 @@ print_operand (FILE *file, rtx x, int code)
return;
}
+ case 'Y':
+ switch (GET_CODE (x))
+ {
+ case NE:
+ fputs ("neq", file);
+ break;
+ case EQ:
+ fputs ("eq", file);
+ break;
+ case GE:
+ case GEU:
+ fputs (INTEGRAL_MODE_P (GET_MODE (x)) ? "ge" : "unlt", file);
+ break;
+ case GT:
+ case GTU:
+ fputs (INTEGRAL_MODE_P (GET_MODE (x)) ? "gt" : "unle", file);
+ break;
+ case LE:
+ case LEU:
+ fputs ("le", file);
+ break;
+ case LT:
+ case LTU:
+ fputs ("lt", file);
+ break;
+ case UNORDERED:
+ fputs ("unord", file);
+ break;
+ case ORDERED:
+ fputs ("ord", file);
+ break;
+ case UNEQ:
+ fputs ("ueq", file);
+ break;
+ case UNGE:
+ fputs ("nlt", file);
+ break;
+ case UNGT:
+ fputs ("nle", file);
+ break;
+ case UNLE:
+ fputs ("ule", file);
+ break;
+ case UNLT:
+ fputs ("ult", file);
+ break;
+ case LTGT:
+ fputs ("une", file);
+ break;
+ default:
+ output_operand_lossage ("operand is not a condition code, invalid operand code 'D'");
+ return;
+ }
+ return;
+
case ';':
#if TARGET_MACHO
fputs (" ; ", file);
@@ -12637,7 +12825,7 @@ ix86_expand_clear (rtx dest)
tmp = gen_rtx_SET (VOIDmode, dest, const0_rtx);
/* This predicate should match that for movsi_xor and movdi_xor_rex64. */
- if (reload_completed && (!TARGET_USE_MOV0 || optimize_insn_for_speed_p ()))
+ if (!TARGET_USE_MOV0 || optimize_insn_for_speed_p ())
{
rtx clob = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (CCmode, FLAGS_REG));
tmp = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, tmp, clob));
@@ -15247,9 +15435,10 @@ ix86_expand_int_movcc (rtx operands[])
tmp = gen_reg_rtx (mode);
if (mode == DImode)
- emit_insn (gen_x86_movdicc_0_m1_rex64 (tmp, compare_op));
+ emit_insn (gen_x86_movdicc_0_m1 (tmp, compare_op));
else
- emit_insn (gen_x86_movsicc_0_m1 (gen_lowpart (SImode, tmp), compare_op));
+ emit_insn (gen_x86_movsicc_0_m1 (gen_lowpart (SImode, tmp),
+ compare_op));
}
else
{
@@ -15828,6 +16017,14 @@ ix86_expand_sse_movcc (rtx dest, rtx cmp, rtx op_true, rtx op_false)
x = gen_rtx_AND (mode, x, op_false);
emit_insn (gen_rtx_SET (VOIDmode, dest, x));
}
+ else if (TARGET_XOP)
+ {
+ rtx pcmov = gen_rtx_SET (mode, dest,
+ gen_rtx_IF_THEN_ELSE (mode, cmp,
+ op_true,
+ op_false));
+ emit_insn (pcmov);
+ }
else
{
op_true = force_reg (mode, op_true);
@@ -15950,6 +16147,9 @@ ix86_expand_int_vcond (rtx operands[])
cop0 = operands[4];
cop1 = operands[5];
+ /* XOP supports all of the comparisons on all vector int types. */
+ if (!TARGET_XOP)
+ {
/* Canonicalize the comparison to EQ, GT, GTU. */
switch (code)
{
@@ -16060,6 +16260,7 @@ ix86_expand_int_vcond (rtx operands[])
cop0 = x;
cop1 = CONST0_RTX (mode);
}
+ }
x = ix86_expand_sse_cmp (operands[0], code, cop0, cop1,
operands[1+negate], operands[2-negate]);
@@ -16171,6 +16372,7 @@ int
ix86_expand_int_addcc (rtx operands[])
{
enum rtx_code code = GET_CODE (operands[1]);
+ rtx (*insn)(rtx, rtx, rtx, rtx);
rtx compare_op;
rtx val = const0_rtx;
bool fpcmp = false;
@@ -16211,16 +16413,16 @@ ix86_expand_int_addcc (rtx operands[])
switch (GET_MODE (operands[0]))
{
case QImode:
- emit_insn (gen_subqi3_carry (operands[0], operands[2], val, compare_op));
+ insn = gen_subqi3_carry;
break;
case HImode:
- emit_insn (gen_subhi3_carry (operands[0], operands[2], val, compare_op));
+ insn = gen_subhi3_carry;
break;
case SImode:
- emit_insn (gen_subsi3_carry (operands[0], operands[2], val, compare_op));
+ insn = gen_subsi3_carry;
break;
case DImode:
- emit_insn (gen_subdi3_carry_rex64 (operands[0], operands[2], val, compare_op));
+ insn = gen_subdi3_carry;
break;
default:
gcc_unreachable ();
@@ -16231,21 +16433,23 @@ ix86_expand_int_addcc (rtx operands[])
switch (GET_MODE (operands[0]))
{
case QImode:
- emit_insn (gen_addqi3_carry (operands[0], operands[2], val, compare_op));
+ insn = gen_addqi3_carry;
break;
case HImode:
- emit_insn (gen_addhi3_carry (operands[0], operands[2], val, compare_op));
+ insn = gen_addhi3_carry;
break;
case SImode:
- emit_insn (gen_addsi3_carry (operands[0], operands[2], val, compare_op));
+ insn = gen_addsi3_carry;
break;
case DImode:
- emit_insn (gen_adddi3_carry_rex64 (operands[0], operands[2], val, compare_op));
+ insn = gen_adddi3_carry;
break;
default:
gcc_unreachable ();
}
}
+ emit_insn (insn (operands[0], operands[2], val, compare_op));
+
return 1; /* DONE */
}
@@ -19977,6 +20181,9 @@ ix86_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
}
#ifdef ENABLE_EXECUTE_STACK
+#ifdef CHECK_EXECUTE_STACK_ENABLED
+ if (CHECK_EXECUTE_STACK_ENABLED)
+#endif
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"),
LCT_NORMAL, VOIDmode, 1, XEXP (m_tramp, 0), Pmode);
#endif
@@ -20712,7 +20919,7 @@ enum ix86_builtins
IX86_BUILTIN_CVTUDQ2PS,
- /* FMA4 instructions. */
+ /* FMA4 and XOP instructions. */
IX86_BUILTIN_VFMADDSS,
IX86_BUILTIN_VFMADDSD,
IX86_BUILTIN_VFMADDPS,
@@ -20745,6 +20952,164 @@ enum ix86_builtins
IX86_BUILTIN_VFNMADDPD256,
IX86_BUILTIN_VFNMSUBPS256,
IX86_BUILTIN_VFNMSUBPD256,
+
+ IX86_BUILTIN_VPCMOV,
+ IX86_BUILTIN_VPCMOV_V2DI,
+ IX86_BUILTIN_VPCMOV_V4SI,
+ IX86_BUILTIN_VPCMOV_V8HI,
+ IX86_BUILTIN_VPCMOV_V16QI,
+ IX86_BUILTIN_VPCMOV_V4SF,
+ IX86_BUILTIN_VPCMOV_V2DF,
+ IX86_BUILTIN_VPCMOV256,
+ IX86_BUILTIN_VPCMOV_V4DI256,
+ IX86_BUILTIN_VPCMOV_V8SI256,
+ IX86_BUILTIN_VPCMOV_V16HI256,
+ IX86_BUILTIN_VPCMOV_V32QI256,
+ IX86_BUILTIN_VPCMOV_V8SF256,
+ IX86_BUILTIN_VPCMOV_V4DF256,
+
+ IX86_BUILTIN_VPPERM,
+
+ IX86_BUILTIN_VPMACSSWW,
+ IX86_BUILTIN_VPMACSWW,
+ IX86_BUILTIN_VPMACSSWD,
+ IX86_BUILTIN_VPMACSWD,
+ IX86_BUILTIN_VPMACSSDD,
+ IX86_BUILTIN_VPMACSDD,
+ IX86_BUILTIN_VPMACSSDQL,
+ IX86_BUILTIN_VPMACSSDQH,
+ IX86_BUILTIN_VPMACSDQL,
+ IX86_BUILTIN_VPMACSDQH,
+ IX86_BUILTIN_VPMADCSSWD,
+ IX86_BUILTIN_VPMADCSWD,
+
+ IX86_BUILTIN_VPHADDBW,
+ IX86_BUILTIN_VPHADDBD,
+ IX86_BUILTIN_VPHADDBQ,
+ IX86_BUILTIN_VPHADDWD,
+ IX86_BUILTIN_VPHADDWQ,
+ IX86_BUILTIN_VPHADDDQ,
+ IX86_BUILTIN_VPHADDUBW,
+ IX86_BUILTIN_VPHADDUBD,
+ IX86_BUILTIN_VPHADDUBQ,
+ IX86_BUILTIN_VPHADDUWD,
+ IX86_BUILTIN_VPHADDUWQ,
+ IX86_BUILTIN_VPHADDUDQ,
+ IX86_BUILTIN_VPHSUBBW,
+ IX86_BUILTIN_VPHSUBWD,
+ IX86_BUILTIN_VPHSUBDQ,
+
+ IX86_BUILTIN_VPROTB,
+ IX86_BUILTIN_VPROTW,
+ IX86_BUILTIN_VPROTD,
+ IX86_BUILTIN_VPROTQ,
+ IX86_BUILTIN_VPROTB_IMM,
+ IX86_BUILTIN_VPROTW_IMM,
+ IX86_BUILTIN_VPROTD_IMM,
+ IX86_BUILTIN_VPROTQ_IMM,
+
+ IX86_BUILTIN_VPSHLB,
+ IX86_BUILTIN_VPSHLW,
+ IX86_BUILTIN_VPSHLD,
+ IX86_BUILTIN_VPSHLQ,
+ IX86_BUILTIN_VPSHAB,
+ IX86_BUILTIN_VPSHAW,
+ IX86_BUILTIN_VPSHAD,
+ IX86_BUILTIN_VPSHAQ,
+
+ IX86_BUILTIN_VFRCZSS,
+ IX86_BUILTIN_VFRCZSD,
+ IX86_BUILTIN_VFRCZPS,
+ IX86_BUILTIN_VFRCZPD,
+ IX86_BUILTIN_VFRCZPS256,
+ IX86_BUILTIN_VFRCZPD256,
+
+ IX86_BUILTIN_VPCOMEQUB,
+ IX86_BUILTIN_VPCOMNEUB,
+ IX86_BUILTIN_VPCOMLTUB,
+ IX86_BUILTIN_VPCOMLEUB,
+ IX86_BUILTIN_VPCOMGTUB,
+ IX86_BUILTIN_VPCOMGEUB,
+ IX86_BUILTIN_VPCOMFALSEUB,
+ IX86_BUILTIN_VPCOMTRUEUB,
+
+ IX86_BUILTIN_VPCOMEQUW,
+ IX86_BUILTIN_VPCOMNEUW,
+ IX86_BUILTIN_VPCOMLTUW,
+ IX86_BUILTIN_VPCOMLEUW,
+ IX86_BUILTIN_VPCOMGTUW,
+ IX86_BUILTIN_VPCOMGEUW,
+ IX86_BUILTIN_VPCOMFALSEUW,
+ IX86_BUILTIN_VPCOMTRUEUW,
+
+ IX86_BUILTIN_VPCOMEQUD,
+ IX86_BUILTIN_VPCOMNEUD,
+ IX86_BUILTIN_VPCOMLTUD,
+ IX86_BUILTIN_VPCOMLEUD,
+ IX86_BUILTIN_VPCOMGTUD,
+ IX86_BUILTIN_VPCOMGEUD,
+ IX86_BUILTIN_VPCOMFALSEUD,
+ IX86_BUILTIN_VPCOMTRUEUD,
+
+ IX86_BUILTIN_VPCOMEQUQ,
+ IX86_BUILTIN_VPCOMNEUQ,
+ IX86_BUILTIN_VPCOMLTUQ,
+ IX86_BUILTIN_VPCOMLEUQ,
+ IX86_BUILTIN_VPCOMGTUQ,
+ IX86_BUILTIN_VPCOMGEUQ,
+ IX86_BUILTIN_VPCOMFALSEUQ,
+ IX86_BUILTIN_VPCOMTRUEUQ,
+
+ IX86_BUILTIN_VPCOMEQB,
+ IX86_BUILTIN_VPCOMNEB,
+ IX86_BUILTIN_VPCOMLTB,
+ IX86_BUILTIN_VPCOMLEB,
+ IX86_BUILTIN_VPCOMGTB,
+ IX86_BUILTIN_VPCOMGEB,
+ IX86_BUILTIN_VPCOMFALSEB,
+ IX86_BUILTIN_VPCOMTRUEB,
+
+ IX86_BUILTIN_VPCOMEQW,
+ IX86_BUILTIN_VPCOMNEW,
+ IX86_BUILTIN_VPCOMLTW,
+ IX86_BUILTIN_VPCOMLEW,
+ IX86_BUILTIN_VPCOMGTW,
+ IX86_BUILTIN_VPCOMGEW,
+ IX86_BUILTIN_VPCOMFALSEW,
+ IX86_BUILTIN_VPCOMTRUEW,
+
+ IX86_BUILTIN_VPCOMEQD,
+ IX86_BUILTIN_VPCOMNED,
+ IX86_BUILTIN_VPCOMLTD,
+ IX86_BUILTIN_VPCOMLED,
+ IX86_BUILTIN_VPCOMGTD,
+ IX86_BUILTIN_VPCOMGED,
+ IX86_BUILTIN_VPCOMFALSED,
+ IX86_BUILTIN_VPCOMTRUED,
+
+ IX86_BUILTIN_VPCOMEQQ,
+ IX86_BUILTIN_VPCOMNEQ,
+ IX86_BUILTIN_VPCOMLTQ,
+ IX86_BUILTIN_VPCOMLEQ,
+ IX86_BUILTIN_VPCOMGTQ,
+ IX86_BUILTIN_VPCOMGEQ,
+ IX86_BUILTIN_VPCOMFALSEQ,
+ IX86_BUILTIN_VPCOMTRUEQ,
+
+ /* LWP instructions. */
+ IX86_BUILTIN_LLWPCB16,
+ IX86_BUILTIN_LLWPCB32,
+ IX86_BUILTIN_LLWPCB64,
+ IX86_BUILTIN_SLWPCB16,
+ IX86_BUILTIN_SLWPCB32,
+ IX86_BUILTIN_SLWPCB64,
+ IX86_BUILTIN_LWPVAL16,
+ IX86_BUILTIN_LWPVAL32,
+ IX86_BUILTIN_LWPVAL64,
+ IX86_BUILTIN_LWPINS16,
+ IX86_BUILTIN_LWPINS32,
+ IX86_BUILTIN_LWPINS64,
+
IX86_BUILTIN_MAX
};
@@ -20958,7 +21323,13 @@ enum ix86_special_builtin_type
VOID_FTYPE_PV8SF_V8SF_V8SF,
VOID_FTYPE_PV4DF_V4DF_V4DF,
VOID_FTYPE_PV4SF_V4SF_V4SF,
- VOID_FTYPE_PV2DF_V2DF_V2DF
+ VOID_FTYPE_PV2DF_V2DF_V2DF,
+ VOID_FTYPE_USHORT_UINT_USHORT,
+ VOID_FTYPE_UINT_UINT_UINT,
+ VOID_FTYPE_UINT64_UINT_UINT,
+ UCHAR_FTYPE_USHORT_UINT_USHORT,
+ UCHAR_FTYPE_UINT_UINT_UINT,
+ UCHAR_FTYPE_UINT64_UINT_UINT
};
/* Builtin types */
@@ -21205,6 +21576,22 @@ static const struct builtin_description bdesc_special_args[] =
{ OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskstoreps, "__builtin_ia32_maskstoreps", IX86_BUILTIN_MASKSTOREPS, UNKNOWN, (int) VOID_FTYPE_PV4SF_V4SF_V4SF },
{ OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskstorepd256, "__builtin_ia32_maskstorepd256", IX86_BUILTIN_MASKSTOREPD256, UNKNOWN, (int) VOID_FTYPE_PV4DF_V4DF_V4DF },
{ OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskstoreps256, "__builtin_ia32_maskstoreps256", IX86_BUILTIN_MASKSTOREPS256, UNKNOWN, (int) VOID_FTYPE_PV8SF_V8SF_V8SF },
+
+ { OPTION_MASK_ISA_LWP, CODE_FOR_lwp_llwpcbhi1, "__builtin_ia32_llwpcb16", IX86_BUILTIN_LLWPCB16, UNKNOWN, (int) VOID_FTYPE_VOID },
+ { OPTION_MASK_ISA_LWP, CODE_FOR_lwp_llwpcbsi1, "__builtin_ia32_llwpcb32", IX86_BUILTIN_LLWPCB32, UNKNOWN, (int) VOID_FTYPE_VOID },
+ { OPTION_MASK_ISA_LWP, CODE_FOR_lwp_llwpcbdi1, "__builtin_ia32_llwpcb64", IX86_BUILTIN_LLWPCB64, UNKNOWN, (int) VOID_FTYPE_VOID },
+
+ { OPTION_MASK_ISA_LWP, CODE_FOR_lwp_slwpcbhi1, "__builtin_ia32_slwpcb16", IX86_BUILTIN_SLWPCB16, UNKNOWN, (int) VOID_FTYPE_VOID },
+ { OPTION_MASK_ISA_LWP, CODE_FOR_lwp_slwpcbsi1, "__builtin_ia32_slwpcb32", IX86_BUILTIN_SLWPCB32, UNKNOWN, (int) VOID_FTYPE_VOID },
+ { OPTION_MASK_ISA_LWP, CODE_FOR_lwp_slwpcbdi1, "__builtin_ia32_slwpcb64", IX86_BUILTIN_SLWPCB64, UNKNOWN, (int) VOID_FTYPE_VOID },
+
+ { OPTION_MASK_ISA_LWP, CODE_FOR_lwp_lwpvalhi3, "__builtin_ia32_lwpval16", IX86_BUILTIN_LWPVAL16, UNKNOWN, (int) VOID_FTYPE_USHORT_UINT_USHORT },
+ { OPTION_MASK_ISA_LWP, CODE_FOR_lwp_lwpvalsi3, "__builtin_ia32_lwpval32", IX86_BUILTIN_LWPVAL64, UNKNOWN, (int) VOID_FTYPE_UINT_UINT_UINT },
+ { OPTION_MASK_ISA_LWP, CODE_FOR_lwp_lwpvaldi3, "__builtin_ia32_lwpval64", IX86_BUILTIN_LWPVAL64, UNKNOWN, (int) VOID_FTYPE_UINT64_UINT_UINT },
+ { OPTION_MASK_ISA_LWP, CODE_FOR_lwp_lwpinshi3, "__builtin_ia32_lwpins16", IX86_BUILTIN_LWPINS16, UNKNOWN, (int) UCHAR_FTYPE_USHORT_UINT_USHORT },
+ { OPTION_MASK_ISA_LWP, CODE_FOR_lwp_lwpinssi3, "__builtin_ia32_lwpins32", IX86_BUILTIN_LWPINS64, UNKNOWN, (int) UCHAR_FTYPE_UINT_UINT_UINT },
+ { OPTION_MASK_ISA_LWP, CODE_FOR_lwp_lwpinsdi3, "__builtin_ia32_lwpins64", IX86_BUILTIN_LWPINS64, UNKNOWN, (int) UCHAR_FTYPE_UINT64_UINT_UINT },
+
};
/* Builtins with variable number of arguments. */
@@ -21818,13 +22205,58 @@ static const struct builtin_description bdesc_args[] =
{ OPTION_MASK_ISA_AVX, CODE_FOR_avx_movmskps256, "__builtin_ia32_movmskps256", IX86_BUILTIN_MOVMSKPS256, UNKNOWN, (int) INT_FTYPE_V8SF },
};
-/* FMA4. */
+/* FMA4 and XOP. */
enum multi_arg_type {
MULTI_ARG_UNKNOWN,
MULTI_ARG_3_SF,
MULTI_ARG_3_DF,
MULTI_ARG_3_SF2,
- MULTI_ARG_3_DF2
+ MULTI_ARG_3_DF2,
+ MULTI_ARG_3_DI,
+ MULTI_ARG_3_SI,
+ MULTI_ARG_3_SI_DI,
+ MULTI_ARG_3_HI,
+ MULTI_ARG_3_HI_SI,
+ MULTI_ARG_3_QI,
+ MULTI_ARG_3_DI2,
+ MULTI_ARG_3_SI2,
+ MULTI_ARG_3_HI2,
+ MULTI_ARG_3_QI2,
+ MULTI_ARG_2_SF,
+ MULTI_ARG_2_DF,
+ MULTI_ARG_2_DI,
+ MULTI_ARG_2_SI,
+ MULTI_ARG_2_HI,
+ MULTI_ARG_2_QI,
+ MULTI_ARG_2_DI_IMM,
+ MULTI_ARG_2_SI_IMM,
+ MULTI_ARG_2_HI_IMM,
+ MULTI_ARG_2_QI_IMM,
+ MULTI_ARG_2_DI_CMP,
+ MULTI_ARG_2_SI_CMP,
+ MULTI_ARG_2_HI_CMP,
+ MULTI_ARG_2_QI_CMP,
+ MULTI_ARG_2_DI_TF,
+ MULTI_ARG_2_SI_TF,
+ MULTI_ARG_2_HI_TF,
+ MULTI_ARG_2_QI_TF,
+ MULTI_ARG_2_SF_TF,
+ MULTI_ARG_2_DF_TF,
+ MULTI_ARG_1_SF,
+ MULTI_ARG_1_DF,
+ MULTI_ARG_1_SF2,
+ MULTI_ARG_1_DF2,
+ MULTI_ARG_1_DI,
+ MULTI_ARG_1_SI,
+ MULTI_ARG_1_HI,
+ MULTI_ARG_1_QI,
+ MULTI_ARG_1_SI_DI,
+ MULTI_ARG_1_HI_DI,
+ MULTI_ARG_1_HI_SI,
+ MULTI_ARG_1_QI_DI,
+ MULTI_ARG_1_QI_SI,
+ MULTI_ARG_1_QI_HI
+
};
static const struct builtin_description bdesc_multi_arg[] =
@@ -21865,7 +22297,160 @@ static const struct builtin_description bdesc_multi_arg[] =
{ OPTION_MASK_ISA_FMA4, CODE_FOR_fma4i_fmaddsubv8sf4, "__builtin_ia32_vfmaddsubps256", IX86_BUILTIN_VFMADDSUBPS256, UNKNOWN, (int)MULTI_ARG_3_SF2 },
{ OPTION_MASK_ISA_FMA4, CODE_FOR_fma4i_fmaddsubv4df4, "__builtin_ia32_vfmaddsubpd256", IX86_BUILTIN_VFMADDSUBPD256, UNKNOWN, (int)MULTI_ARG_3_DF2 },
{ OPTION_MASK_ISA_FMA4, CODE_FOR_fma4i_fmsubaddv8sf4, "__builtin_ia32_vfmsubaddps256", IX86_BUILTIN_VFMSUBADDPS256, UNKNOWN, (int)MULTI_ARG_3_SF2 },
- { OPTION_MASK_ISA_FMA4, CODE_FOR_fma4i_fmsubaddv4df4, "__builtin_ia32_vfmsubaddpd256", IX86_BUILTIN_VFMSUBADDPD256, UNKNOWN, (int)MULTI_ARG_3_DF2 }
+ { OPTION_MASK_ISA_FMA4, CODE_FOR_fma4i_fmsubaddv4df4, "__builtin_ia32_vfmsubaddpd256", IX86_BUILTIN_VFMSUBADDPD256, UNKNOWN, (int)MULTI_ARG_3_DF2 },
+
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcmov_v2di, "__builtin_ia32_vpcmov", IX86_BUILTIN_VPCMOV, UNKNOWN, (int)MULTI_ARG_3_DI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcmov_v2di, "__builtin_ia32_vpcmov_v2di", IX86_BUILTIN_VPCMOV_V2DI, UNKNOWN, (int)MULTI_ARG_3_DI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcmov_v4si, "__builtin_ia32_vpcmov_v4si", IX86_BUILTIN_VPCMOV_V4SI, UNKNOWN, (int)MULTI_ARG_3_SI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcmov_v8hi, "__builtin_ia32_vpcmov_v8hi", IX86_BUILTIN_VPCMOV_V8HI, UNKNOWN, (int)MULTI_ARG_3_HI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcmov_v16qi, "__builtin_ia32_vpcmov_v16qi",IX86_BUILTIN_VPCMOV_V16QI,UNKNOWN, (int)MULTI_ARG_3_QI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcmov_v2df, "__builtin_ia32_vpcmov_v2df", IX86_BUILTIN_VPCMOV_V2DF, UNKNOWN, (int)MULTI_ARG_3_DF },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcmov_v4sf, "__builtin_ia32_vpcmov_v4sf", IX86_BUILTIN_VPCMOV_V4SF, UNKNOWN, (int)MULTI_ARG_3_SF },
+
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcmov_v4di256, "__builtin_ia32_vpcmov256", IX86_BUILTIN_VPCMOV256, UNKNOWN, (int)MULTI_ARG_3_DI2 },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcmov_v4di256, "__builtin_ia32_vpcmov_v4di256", IX86_BUILTIN_VPCMOV_V4DI256, UNKNOWN, (int)MULTI_ARG_3_DI2 },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcmov_v8si256, "__builtin_ia32_vpcmov_v8si256", IX86_BUILTIN_VPCMOV_V8SI256, UNKNOWN, (int)MULTI_ARG_3_SI2 },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcmov_v16hi256, "__builtin_ia32_vpcmov_v16hi256", IX86_BUILTIN_VPCMOV_V16HI256, UNKNOWN, (int)MULTI_ARG_3_HI2 },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcmov_v32qi256, "__builtin_ia32_vpcmov_v32qi256", IX86_BUILTIN_VPCMOV_V32QI256, UNKNOWN, (int)MULTI_ARG_3_QI2 },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcmov_v4df256, "__builtin_ia32_vpcmov_v4df256", IX86_BUILTIN_VPCMOV_V4DF256, UNKNOWN, (int)MULTI_ARG_3_DF2 },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcmov_v8sf256, "__builtin_ia32_vpcmov_v8sf256", IX86_BUILTIN_VPCMOV_V8SF256, UNKNOWN, (int)MULTI_ARG_3_SF2 },
+
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pperm, "__builtin_ia32_vpperm", IX86_BUILTIN_VPPERM, UNKNOWN, (int)MULTI_ARG_3_QI },
+
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pmacssww, "__builtin_ia32_vpmacssww", IX86_BUILTIN_VPMACSSWW, UNKNOWN, (int)MULTI_ARG_3_HI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pmacsww, "__builtin_ia32_vpmacsww", IX86_BUILTIN_VPMACSWW, UNKNOWN, (int)MULTI_ARG_3_HI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pmacsswd, "__builtin_ia32_vpmacsswd", IX86_BUILTIN_VPMACSSWD, UNKNOWN, (int)MULTI_ARG_3_HI_SI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pmacswd, "__builtin_ia32_vpmacswd", IX86_BUILTIN_VPMACSWD, UNKNOWN, (int)MULTI_ARG_3_HI_SI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pmacssdd, "__builtin_ia32_vpmacssdd", IX86_BUILTIN_VPMACSSDD, UNKNOWN, (int)MULTI_ARG_3_SI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pmacsdd, "__builtin_ia32_vpmacsdd", IX86_BUILTIN_VPMACSDD, UNKNOWN, (int)MULTI_ARG_3_SI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pmacssdql, "__builtin_ia32_vpmacssdql", IX86_BUILTIN_VPMACSSDQL, UNKNOWN, (int)MULTI_ARG_3_SI_DI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pmacssdqh, "__builtin_ia32_vpmacssdqh", IX86_BUILTIN_VPMACSSDQH, UNKNOWN, (int)MULTI_ARG_3_SI_DI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pmacsdql, "__builtin_ia32_vpmacsdql", IX86_BUILTIN_VPMACSDQL, UNKNOWN, (int)MULTI_ARG_3_SI_DI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pmacsdqh, "__builtin_ia32_vpmacsdqh", IX86_BUILTIN_VPMACSDQH, UNKNOWN, (int)MULTI_ARG_3_SI_DI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pmadcsswd, "__builtin_ia32_vpmadcsswd", IX86_BUILTIN_VPMADCSSWD, UNKNOWN, (int)MULTI_ARG_3_HI_SI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pmadcswd, "__builtin_ia32_vpmadcswd", IX86_BUILTIN_VPMADCSWD, UNKNOWN, (int)MULTI_ARG_3_HI_SI },
+
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_vrotlv2di3, "__builtin_ia32_vprotq", IX86_BUILTIN_VPROTQ, UNKNOWN, (int)MULTI_ARG_2_DI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_vrotlv4si3, "__builtin_ia32_vprotd", IX86_BUILTIN_VPROTD, UNKNOWN, (int)MULTI_ARG_2_SI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_vrotlv8hi3, "__builtin_ia32_vprotw", IX86_BUILTIN_VPROTW, UNKNOWN, (int)MULTI_ARG_2_HI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_vrotlv16qi3, "__builtin_ia32_vprotb", IX86_BUILTIN_VPROTB, UNKNOWN, (int)MULTI_ARG_2_QI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_rotlv2di3, "__builtin_ia32_vprotqi", IX86_BUILTIN_VPROTQ_IMM, UNKNOWN, (int)MULTI_ARG_2_DI_IMM },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_rotlv4si3, "__builtin_ia32_vprotdi", IX86_BUILTIN_VPROTD_IMM, UNKNOWN, (int)MULTI_ARG_2_SI_IMM },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_rotlv8hi3, "__builtin_ia32_vprotwi", IX86_BUILTIN_VPROTW_IMM, UNKNOWN, (int)MULTI_ARG_2_HI_IMM },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_rotlv16qi3, "__builtin_ia32_vprotbi", IX86_BUILTIN_VPROTB_IMM, UNKNOWN, (int)MULTI_ARG_2_QI_IMM },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_ashlv2di3, "__builtin_ia32_vpshaq", IX86_BUILTIN_VPSHAQ, UNKNOWN, (int)MULTI_ARG_2_DI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_ashlv4si3, "__builtin_ia32_vpshad", IX86_BUILTIN_VPSHAD, UNKNOWN, (int)MULTI_ARG_2_SI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_ashlv8hi3, "__builtin_ia32_vpshaw", IX86_BUILTIN_VPSHAW, UNKNOWN, (int)MULTI_ARG_2_HI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_ashlv16qi3, "__builtin_ia32_vpshab", IX86_BUILTIN_VPSHAB, UNKNOWN, (int)MULTI_ARG_2_QI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_lshlv2di3, "__builtin_ia32_vpshlq", IX86_BUILTIN_VPSHLQ, UNKNOWN, (int)MULTI_ARG_2_DI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_lshlv4si3, "__builtin_ia32_vpshld", IX86_BUILTIN_VPSHLD, UNKNOWN, (int)MULTI_ARG_2_SI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_lshlv8hi3, "__builtin_ia32_vpshlw", IX86_BUILTIN_VPSHLW, UNKNOWN, (int)MULTI_ARG_2_HI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_lshlv16qi3, "__builtin_ia32_vpshlb", IX86_BUILTIN_VPSHLB, UNKNOWN, (int)MULTI_ARG_2_QI },
+
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_vmfrczv4sf2, "__builtin_ia32_vfrczss", IX86_BUILTIN_VFRCZSS, UNKNOWN, (int)MULTI_ARG_2_SF },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_vmfrczv2df2, "__builtin_ia32_vfrczsd", IX86_BUILTIN_VFRCZSD, UNKNOWN, (int)MULTI_ARG_2_DF },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_frczv4sf2, "__builtin_ia32_vfrczps", IX86_BUILTIN_VFRCZPS, UNKNOWN, (int)MULTI_ARG_1_SF },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_frczv2df2, "__builtin_ia32_vfrczpd", IX86_BUILTIN_VFRCZPD, UNKNOWN, (int)MULTI_ARG_1_DF },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_frczv8sf2256, "__builtin_ia32_vfrczps256", IX86_BUILTIN_VFRCZPS256, UNKNOWN, (int)MULTI_ARG_1_SF2 },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_frczv4df2256, "__builtin_ia32_vfrczpd256", IX86_BUILTIN_VFRCZPD256, UNKNOWN, (int)MULTI_ARG_1_DF2 },
+
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_phaddbw, "__builtin_ia32_vphaddbw", IX86_BUILTIN_VPHADDBW, UNKNOWN, (int)MULTI_ARG_1_QI_HI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_phaddbd, "__builtin_ia32_vphaddbd", IX86_BUILTIN_VPHADDBD, UNKNOWN, (int)MULTI_ARG_1_QI_SI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_phaddbq, "__builtin_ia32_vphaddbq", IX86_BUILTIN_VPHADDBQ, UNKNOWN, (int)MULTI_ARG_1_QI_DI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_phaddwd, "__builtin_ia32_vphaddwd", IX86_BUILTIN_VPHADDWD, UNKNOWN, (int)MULTI_ARG_1_HI_SI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_phaddwq, "__builtin_ia32_vphaddwq", IX86_BUILTIN_VPHADDWQ, UNKNOWN, (int)MULTI_ARG_1_HI_DI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_phadddq, "__builtin_ia32_vphadddq", IX86_BUILTIN_VPHADDDQ, UNKNOWN, (int)MULTI_ARG_1_SI_DI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_phaddubw, "__builtin_ia32_vphaddubw", IX86_BUILTIN_VPHADDUBW, UNKNOWN, (int)MULTI_ARG_1_QI_HI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_phaddubd, "__builtin_ia32_vphaddubd", IX86_BUILTIN_VPHADDUBD, UNKNOWN, (int)MULTI_ARG_1_QI_SI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_phaddubq, "__builtin_ia32_vphaddubq", IX86_BUILTIN_VPHADDUBQ, UNKNOWN, (int)MULTI_ARG_1_QI_DI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_phadduwd, "__builtin_ia32_vphadduwd", IX86_BUILTIN_VPHADDUWD, UNKNOWN, (int)MULTI_ARG_1_HI_SI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_phadduwq, "__builtin_ia32_vphadduwq", IX86_BUILTIN_VPHADDUWQ, UNKNOWN, (int)MULTI_ARG_1_HI_DI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_phaddudq, "__builtin_ia32_vphaddudq", IX86_BUILTIN_VPHADDUDQ, UNKNOWN, (int)MULTI_ARG_1_SI_DI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_phsubbw, "__builtin_ia32_vphsubbw", IX86_BUILTIN_VPHSUBBW, UNKNOWN, (int)MULTI_ARG_1_QI_HI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_phsubwd, "__builtin_ia32_vphsubwd", IX86_BUILTIN_VPHSUBWD, UNKNOWN, (int)MULTI_ARG_1_HI_SI },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_phsubdq, "__builtin_ia32_vphsubdq", IX86_BUILTIN_VPHSUBDQ, UNKNOWN, (int)MULTI_ARG_1_SI_DI },
+
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv16qi3, "__builtin_ia32_vpcomeqb", IX86_BUILTIN_VPCOMEQB, EQ, (int)MULTI_ARG_2_QI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv16qi3, "__builtin_ia32_vpcomneb", IX86_BUILTIN_VPCOMNEB, NE, (int)MULTI_ARG_2_QI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv16qi3, "__builtin_ia32_vpcomneqb", IX86_BUILTIN_VPCOMNEB, NE, (int)MULTI_ARG_2_QI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv16qi3, "__builtin_ia32_vpcomltb", IX86_BUILTIN_VPCOMLTB, LT, (int)MULTI_ARG_2_QI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv16qi3, "__builtin_ia32_vpcomleb", IX86_BUILTIN_VPCOMLEB, LE, (int)MULTI_ARG_2_QI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv16qi3, "__builtin_ia32_vpcomgtb", IX86_BUILTIN_VPCOMGTB, GT, (int)MULTI_ARG_2_QI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv16qi3, "__builtin_ia32_vpcomgeb", IX86_BUILTIN_VPCOMGEB, GE, (int)MULTI_ARG_2_QI_CMP },
+
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv8hi3, "__builtin_ia32_vpcomeqw", IX86_BUILTIN_VPCOMEQW, EQ, (int)MULTI_ARG_2_HI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv8hi3, "__builtin_ia32_vpcomnew", IX86_BUILTIN_VPCOMNEW, NE, (int)MULTI_ARG_2_HI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv8hi3, "__builtin_ia32_vpcomneqw", IX86_BUILTIN_VPCOMNEW, NE, (int)MULTI_ARG_2_HI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv8hi3, "__builtin_ia32_vpcomltw", IX86_BUILTIN_VPCOMLTW, LT, (int)MULTI_ARG_2_HI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv8hi3, "__builtin_ia32_vpcomlew", IX86_BUILTIN_VPCOMLEW, LE, (int)MULTI_ARG_2_HI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv8hi3, "__builtin_ia32_vpcomgtw", IX86_BUILTIN_VPCOMGTW, GT, (int)MULTI_ARG_2_HI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv8hi3, "__builtin_ia32_vpcomgew", IX86_BUILTIN_VPCOMGEW, GE, (int)MULTI_ARG_2_HI_CMP },
+
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv4si3, "__builtin_ia32_vpcomeqd", IX86_BUILTIN_VPCOMEQD, EQ, (int)MULTI_ARG_2_SI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv4si3, "__builtin_ia32_vpcomned", IX86_BUILTIN_VPCOMNED, NE, (int)MULTI_ARG_2_SI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv4si3, "__builtin_ia32_vpcomneqd", IX86_BUILTIN_VPCOMNED, NE, (int)MULTI_ARG_2_SI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv4si3, "__builtin_ia32_vpcomltd", IX86_BUILTIN_VPCOMLTD, LT, (int)MULTI_ARG_2_SI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv4si3, "__builtin_ia32_vpcomled", IX86_BUILTIN_VPCOMLED, LE, (int)MULTI_ARG_2_SI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv4si3, "__builtin_ia32_vpcomgtd", IX86_BUILTIN_VPCOMGTD, GT, (int)MULTI_ARG_2_SI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv4si3, "__builtin_ia32_vpcomged", IX86_BUILTIN_VPCOMGED, GE, (int)MULTI_ARG_2_SI_CMP },
+
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv2di3, "__builtin_ia32_vpcomeqq", IX86_BUILTIN_VPCOMEQQ, EQ, (int)MULTI_ARG_2_DI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv2di3, "__builtin_ia32_vpcomneq", IX86_BUILTIN_VPCOMNEQ, NE, (int)MULTI_ARG_2_DI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv2di3, "__builtin_ia32_vpcomneqq", IX86_BUILTIN_VPCOMNEQ, NE, (int)MULTI_ARG_2_DI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv2di3, "__builtin_ia32_vpcomltq", IX86_BUILTIN_VPCOMLTQ, LT, (int)MULTI_ARG_2_DI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv2di3, "__builtin_ia32_vpcomleq", IX86_BUILTIN_VPCOMLEQ, LE, (int)MULTI_ARG_2_DI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv2di3, "__builtin_ia32_vpcomgtq", IX86_BUILTIN_VPCOMGTQ, GT, (int)MULTI_ARG_2_DI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmpv2di3, "__builtin_ia32_vpcomgeq", IX86_BUILTIN_VPCOMGEQ, GE, (int)MULTI_ARG_2_DI_CMP },
+
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_uns2v16qi3,"__builtin_ia32_vpcomequb", IX86_BUILTIN_VPCOMEQUB, EQ, (int)MULTI_ARG_2_QI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_uns2v16qi3,"__builtin_ia32_vpcomneub", IX86_BUILTIN_VPCOMNEUB, NE, (int)MULTI_ARG_2_QI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_uns2v16qi3,"__builtin_ia32_vpcomnequb", IX86_BUILTIN_VPCOMNEUB, NE, (int)MULTI_ARG_2_QI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_unsv16qi3, "__builtin_ia32_vpcomltub", IX86_BUILTIN_VPCOMLTUB, LTU, (int)MULTI_ARG_2_QI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_unsv16qi3, "__builtin_ia32_vpcomleub", IX86_BUILTIN_VPCOMLEUB, LEU, (int)MULTI_ARG_2_QI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_unsv16qi3, "__builtin_ia32_vpcomgtub", IX86_BUILTIN_VPCOMGTUB, GTU, (int)MULTI_ARG_2_QI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_unsv16qi3, "__builtin_ia32_vpcomgeub", IX86_BUILTIN_VPCOMGEUB, GEU, (int)MULTI_ARG_2_QI_CMP },
+
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_uns2v8hi3, "__builtin_ia32_vpcomequw", IX86_BUILTIN_VPCOMEQUW, EQ, (int)MULTI_ARG_2_HI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_uns2v8hi3, "__builtin_ia32_vpcomneuw", IX86_BUILTIN_VPCOMNEUW, NE, (int)MULTI_ARG_2_HI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_uns2v8hi3, "__builtin_ia32_vpcomnequw", IX86_BUILTIN_VPCOMNEUW, NE, (int)MULTI_ARG_2_HI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_unsv8hi3, "__builtin_ia32_vpcomltuw", IX86_BUILTIN_VPCOMLTUW, LTU, (int)MULTI_ARG_2_HI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_unsv8hi3, "__builtin_ia32_vpcomleuw", IX86_BUILTIN_VPCOMLEUW, LEU, (int)MULTI_ARG_2_HI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_unsv8hi3, "__builtin_ia32_vpcomgtuw", IX86_BUILTIN_VPCOMGTUW, GTU, (int)MULTI_ARG_2_HI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_unsv8hi3, "__builtin_ia32_vpcomgeuw", IX86_BUILTIN_VPCOMGEUW, GEU, (int)MULTI_ARG_2_HI_CMP },
+
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_uns2v4si3, "__builtin_ia32_vpcomequd", IX86_BUILTIN_VPCOMEQUD, EQ, (int)MULTI_ARG_2_SI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_uns2v4si3, "__builtin_ia32_vpcomneud", IX86_BUILTIN_VPCOMNEUD, NE, (int)MULTI_ARG_2_SI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_uns2v4si3, "__builtin_ia32_vpcomnequd", IX86_BUILTIN_VPCOMNEUD, NE, (int)MULTI_ARG_2_SI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_unsv4si3, "__builtin_ia32_vpcomltud", IX86_BUILTIN_VPCOMLTUD, LTU, (int)MULTI_ARG_2_SI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_unsv4si3, "__builtin_ia32_vpcomleud", IX86_BUILTIN_VPCOMLEUD, LEU, (int)MULTI_ARG_2_SI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_unsv4si3, "__builtin_ia32_vpcomgtud", IX86_BUILTIN_VPCOMGTUD, GTU, (int)MULTI_ARG_2_SI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_unsv4si3, "__builtin_ia32_vpcomgeud", IX86_BUILTIN_VPCOMGEUD, GEU, (int)MULTI_ARG_2_SI_CMP },
+
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_uns2v2di3, "__builtin_ia32_vpcomequq", IX86_BUILTIN_VPCOMEQUQ, EQ, (int)MULTI_ARG_2_DI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_uns2v2di3, "__builtin_ia32_vpcomneuq", IX86_BUILTIN_VPCOMNEUQ, NE, (int)MULTI_ARG_2_DI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_uns2v2di3, "__builtin_ia32_vpcomnequq", IX86_BUILTIN_VPCOMNEUQ, NE, (int)MULTI_ARG_2_DI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_unsv2di3, "__builtin_ia32_vpcomltuq", IX86_BUILTIN_VPCOMLTUQ, LTU, (int)MULTI_ARG_2_DI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_unsv2di3, "__builtin_ia32_vpcomleuq", IX86_BUILTIN_VPCOMLEUQ, LEU, (int)MULTI_ARG_2_DI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_unsv2di3, "__builtin_ia32_vpcomgtuq", IX86_BUILTIN_VPCOMGTUQ, GTU, (int)MULTI_ARG_2_DI_CMP },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_maskcmp_unsv2di3, "__builtin_ia32_vpcomgeuq", IX86_BUILTIN_VPCOMGEUQ, GEU, (int)MULTI_ARG_2_DI_CMP },
+
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcom_tfv16qi3, "__builtin_ia32_vpcomfalseb", IX86_BUILTIN_VPCOMFALSEB, (enum rtx_code) PCOM_FALSE, (int)MULTI_ARG_2_QI_TF },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcom_tfv8hi3, "__builtin_ia32_vpcomfalsew", IX86_BUILTIN_VPCOMFALSEW, (enum rtx_code) PCOM_FALSE, (int)MULTI_ARG_2_HI_TF },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcom_tfv4si3, "__builtin_ia32_vpcomfalsed", IX86_BUILTIN_VPCOMFALSED, (enum rtx_code) PCOM_FALSE, (int)MULTI_ARG_2_SI_TF },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcom_tfv2di3, "__builtin_ia32_vpcomfalseq", IX86_BUILTIN_VPCOMFALSEQ, (enum rtx_code) PCOM_FALSE, (int)MULTI_ARG_2_DI_TF },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcom_tfv16qi3, "__builtin_ia32_vpcomfalseub",IX86_BUILTIN_VPCOMFALSEUB,(enum rtx_code) PCOM_FALSE, (int)MULTI_ARG_2_QI_TF },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcom_tfv8hi3, "__builtin_ia32_vpcomfalseuw",IX86_BUILTIN_VPCOMFALSEUW,(enum rtx_code) PCOM_FALSE, (int)MULTI_ARG_2_HI_TF },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcom_tfv4si3, "__builtin_ia32_vpcomfalseud",IX86_BUILTIN_VPCOMFALSEUD,(enum rtx_code) PCOM_FALSE, (int)MULTI_ARG_2_SI_TF },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcom_tfv2di3, "__builtin_ia32_vpcomfalseuq",IX86_BUILTIN_VPCOMFALSEUQ,(enum rtx_code) PCOM_FALSE, (int)MULTI_ARG_2_DI_TF },
+
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcom_tfv16qi3, "__builtin_ia32_vpcomtrueb", IX86_BUILTIN_VPCOMTRUEB, (enum rtx_code) PCOM_TRUE, (int)MULTI_ARG_2_QI_TF },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcom_tfv8hi3, "__builtin_ia32_vpcomtruew", IX86_BUILTIN_VPCOMTRUEW, (enum rtx_code) PCOM_TRUE, (int)MULTI_ARG_2_HI_TF },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcom_tfv4si3, "__builtin_ia32_vpcomtrued", IX86_BUILTIN_VPCOMTRUED, (enum rtx_code) PCOM_TRUE, (int)MULTI_ARG_2_SI_TF },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcom_tfv2di3, "__builtin_ia32_vpcomtrueq", IX86_BUILTIN_VPCOMTRUEQ, (enum rtx_code) PCOM_TRUE, (int)MULTI_ARG_2_DI_TF },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcom_tfv16qi3, "__builtin_ia32_vpcomtrueub", IX86_BUILTIN_VPCOMTRUEUB, (enum rtx_code) PCOM_TRUE, (int)MULTI_ARG_2_QI_TF },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcom_tfv8hi3, "__builtin_ia32_vpcomtrueuw", IX86_BUILTIN_VPCOMTRUEUW, (enum rtx_code) PCOM_TRUE, (int)MULTI_ARG_2_HI_TF },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcom_tfv4si3, "__builtin_ia32_vpcomtrueud", IX86_BUILTIN_VPCOMTRUEUD, (enum rtx_code) PCOM_TRUE, (int)MULTI_ARG_2_SI_TF },
+ { OPTION_MASK_ISA_XOP, CODE_FOR_xop_pcom_tfv2di3, "__builtin_ia32_vpcomtrueuq", IX86_BUILTIN_VPCOMTRUEUQ, (enum rtx_code) PCOM_TRUE, (int)MULTI_ARG_2_DI_TF },
};
@@ -22247,51 +22832,6 @@ ix86_init_mmx_sse_builtins (void)
integer_type_node,
NULL_TREE);
-
- tree v2di_ftype_v2di
- = build_function_type_list (V2DI_type_node, V2DI_type_node, NULL_TREE);
-
- tree v16qi_ftype_v8hi_v8hi
- = build_function_type_list (V16QI_type_node,
- V8HI_type_node, V8HI_type_node,
- NULL_TREE);
- tree v8hi_ftype_v4si_v4si
- = build_function_type_list (V8HI_type_node,
- V4SI_type_node, V4SI_type_node,
- NULL_TREE);
- tree v8hi_ftype_v16qi_v16qi
- = build_function_type_list (V8HI_type_node,
- V16QI_type_node, V16QI_type_node,
- NULL_TREE);
- tree v4hi_ftype_v8qi_v8qi
- = build_function_type_list (V4HI_type_node,
- V8QI_type_node, V8QI_type_node,
- NULL_TREE);
- tree unsigned_ftype_unsigned_uchar
- = build_function_type_list (unsigned_type_node,
- unsigned_type_node,
- unsigned_char_type_node,
- NULL_TREE);
- tree unsigned_ftype_unsigned_ushort
- = build_function_type_list (unsigned_type_node,
- unsigned_type_node,
- short_unsigned_type_node,
- NULL_TREE);
- tree unsigned_ftype_unsigned_unsigned
- = build_function_type_list (unsigned_type_node,
- unsigned_type_node,
- unsigned_type_node,
- NULL_TREE);
- tree uint64_ftype_uint64_uint64
- = build_function_type_list (long_long_unsigned_type_node,
- long_long_unsigned_type_node,
- long_long_unsigned_type_node,
- NULL_TREE);
- tree float_ftype_float
- = build_function_type_list (float_type_node,
- float_type_node,
- NULL_TREE);
-
/* AVX builtins */
tree V32QI_type_node = build_vector_type_for_mode (char_type_node,
V32QImode);
@@ -22303,6 +22843,8 @@ ix86_init_mmx_sse_builtins (void)
V4DImode);
tree V4DF_type_node = build_vector_type_for_mode (double_type_node,
V4DFmode);
+ tree V16HI_type_node = build_vector_type_for_mode (intHI_type_node,
+ V16HImode);
tree v8sf_ftype_v8sf
= build_function_type_list (V8SF_type_node,
V8SF_type_node,
@@ -22547,6 +23089,138 @@ ix86_init_mmx_sse_builtins (void)
= build_function_type_list (V2DF_type_node,
V2DF_type_node, V2DI_type_node, NULL_TREE);
+ /* XOP instructions */
+ tree v2di_ftype_v2di_v2di_v2di
+ = build_function_type_list (V2DI_type_node,
+ V2DI_type_node,
+ V2DI_type_node,
+ V2DI_type_node,
+ NULL_TREE);
+
+ tree v4di_ftype_v4di_v4di_v4di
+ = build_function_type_list (V4DI_type_node,
+ V4DI_type_node,
+ V4DI_type_node,
+ V4DI_type_node,
+ NULL_TREE);
+
+ tree v4si_ftype_v4si_v4si_v4si
+ = build_function_type_list (V4SI_type_node,
+ V4SI_type_node,
+ V4SI_type_node,
+ V4SI_type_node,
+ NULL_TREE);
+
+ tree v8si_ftype_v8si_v8si_v8si
+ = build_function_type_list (V8SI_type_node,
+ V8SI_type_node,
+ V8SI_type_node,
+ V8SI_type_node,
+ NULL_TREE);
+
+ tree v32qi_ftype_v32qi_v32qi_v32qi
+ = build_function_type_list (V32QI_type_node,
+ V32QI_type_node,
+ V32QI_type_node,
+ V32QI_type_node,
+ NULL_TREE);
+
+ tree v4si_ftype_v4si_v4si_v2di
+ = build_function_type_list (V4SI_type_node,
+ V4SI_type_node,
+ V4SI_type_node,
+ V2DI_type_node,
+ NULL_TREE);
+
+ tree v8hi_ftype_v8hi_v8hi_v8hi
+ = build_function_type_list (V8HI_type_node,
+ V8HI_type_node,
+ V8HI_type_node,
+ V8HI_type_node,
+ NULL_TREE);
+
+ tree v16hi_ftype_v16hi_v16hi_v16hi
+ = build_function_type_list (V16HI_type_node,
+ V16HI_type_node,
+ V16HI_type_node,
+ V16HI_type_node,
+ NULL_TREE);
+
+ tree v8hi_ftype_v8hi_v8hi_v4si
+ = build_function_type_list (V8HI_type_node,
+ V8HI_type_node,
+ V8HI_type_node,
+ V4SI_type_node,
+ NULL_TREE);
+
+ tree v2di_ftype_v2di_si
+ = build_function_type_list (V2DI_type_node,
+ V2DI_type_node,
+ integer_type_node,
+ NULL_TREE);
+
+ tree v4si_ftype_v4si_si
+ = build_function_type_list (V4SI_type_node,
+ V4SI_type_node,
+ integer_type_node,
+ NULL_TREE);
+
+ tree v8hi_ftype_v8hi_si
+ = build_function_type_list (V8HI_type_node,
+ V8HI_type_node,
+ integer_type_node,
+ NULL_TREE);
+
+ tree v16qi_ftype_v16qi_si
+ = build_function_type_list (V16QI_type_node,
+ V16QI_type_node,
+ integer_type_node,
+ NULL_TREE);
+
+ tree v2di_ftype_v2di
+ = build_function_type_list (V2DI_type_node, V2DI_type_node, NULL_TREE);
+
+ tree v16qi_ftype_v8hi_v8hi
+ = build_function_type_list (V16QI_type_node,
+ V8HI_type_node, V8HI_type_node,
+ NULL_TREE);
+ tree v8hi_ftype_v4si_v4si
+ = build_function_type_list (V8HI_type_node,
+ V4SI_type_node, V4SI_type_node,
+ NULL_TREE);
+ tree v8hi_ftype_v16qi_v16qi
+ = build_function_type_list (V8HI_type_node,
+ V16QI_type_node, V16QI_type_node,
+ NULL_TREE);
+ tree v4hi_ftype_v8qi_v8qi
+ = build_function_type_list (V4HI_type_node,
+ V8QI_type_node, V8QI_type_node,
+ NULL_TREE);
+ tree unsigned_ftype_unsigned_uchar
+ = build_function_type_list (unsigned_type_node,
+ unsigned_type_node,
+ unsigned_char_type_node,
+ NULL_TREE);
+ tree unsigned_ftype_unsigned_ushort
+ = build_function_type_list (unsigned_type_node,
+ unsigned_type_node,
+ short_unsigned_type_node,
+ NULL_TREE);
+ tree unsigned_ftype_unsigned_unsigned
+ = build_function_type_list (unsigned_type_node,
+ unsigned_type_node,
+ unsigned_type_node,
+ NULL_TREE);
+ tree uint64_ftype_uint64_uint64
+ = build_function_type_list (long_long_unsigned_type_node,
+ long_long_unsigned_type_node,
+ long_long_unsigned_type_node,
+ NULL_TREE);
+ tree float_ftype_float
+ = build_function_type_list (float_type_node,
+ float_type_node,
+ NULL_TREE);
+
/* Integer intrinsics. */
tree uint64_ftype_void
= build_function_type (long_long_unsigned_type_node,
@@ -22576,6 +23250,50 @@ ix86_init_mmx_sse_builtins (void)
integer_type_node,
NULL_TREE);
+ /* LWP instructions. */
+
+ tree void_ftype_ushort_unsigned_ushort
+ = build_function_type_list (void_type_node,
+ short_unsigned_type_node,
+ unsigned_type_node,
+ short_unsigned_type_node,
+ NULL_TREE);
+
+ tree void_ftype_unsigned_unsigned_unsigned
+ = build_function_type_list (void_type_node,
+ unsigned_type_node,
+ unsigned_type_node,
+ unsigned_type_node,
+ NULL_TREE);
+
+ tree void_ftype_uint64_unsigned_unsigned
+ = build_function_type_list (void_type_node,
+ long_long_unsigned_type_node,
+ unsigned_type_node,
+ unsigned_type_node,
+ NULL_TREE);
+
+ tree uchar_ftype_ushort_unsigned_ushort
+ = build_function_type_list (unsigned_char_type_node,
+ short_unsigned_type_node,
+ unsigned_type_node,
+ short_unsigned_type_node,
+ NULL_TREE);
+
+ tree uchar_ftype_unsigned_unsigned_unsigned
+ = build_function_type_list (unsigned_char_type_node,
+ unsigned_type_node,
+ unsigned_type_node,
+ unsigned_type_node,
+ NULL_TREE);
+
+ tree uchar_ftype_uint64_unsigned_unsigned
+ = build_function_type_list (unsigned_char_type_node,
+ long_long_unsigned_type_node,
+ unsigned_type_node,
+ unsigned_type_node,
+ NULL_TREE);
+
tree ftype;
/* Add all special builtins with variable number of operands. */
@@ -22689,6 +23407,25 @@ ix86_init_mmx_sse_builtins (void)
case VOID_FTYPE_PV2DF_V2DF_V2DF:
type = void_ftype_pv2df_v2df_v2df;
break;
+ case VOID_FTYPE_USHORT_UINT_USHORT:
+ type = void_ftype_ushort_unsigned_ushort;
+ break;
+ case VOID_FTYPE_UINT_UINT_UINT:
+ type = void_ftype_unsigned_unsigned_unsigned;
+ break;
+ case VOID_FTYPE_UINT64_UINT_UINT:
+ type = void_ftype_uint64_unsigned_unsigned;
+ break;
+ case UCHAR_FTYPE_USHORT_UINT_USHORT:
+ type = uchar_ftype_ushort_unsigned_ushort;
+ break;
+ case UCHAR_FTYPE_UINT_UINT_UINT:
+ type = uchar_ftype_unsigned_unsigned_unsigned;
+ break;
+ case UCHAR_FTYPE_UINT64_UINT_UINT:
+ type = uchar_ftype_uint64_unsigned_unsigned;
+ break;
+
default:
gcc_unreachable ();
}
@@ -23315,6 +24052,50 @@ ix86_init_mmx_sse_builtins (void)
case MULTI_ARG_3_DF: mtype = v2df_ftype_v2df_v2df_v2df; break;
case MULTI_ARG_3_SF2: mtype = v8sf_ftype_v8sf_v8sf_v8sf; break;
case MULTI_ARG_3_DF2: mtype = v4df_ftype_v4df_v4df_v4df; break;
+ case MULTI_ARG_3_DI: mtype = v2di_ftype_v2di_v2di_v2di; break;
+ case MULTI_ARG_3_SI: mtype = v4si_ftype_v4si_v4si_v4si; break;
+ case MULTI_ARG_3_SI_DI: mtype = v4si_ftype_v4si_v4si_v2di; break;
+ case MULTI_ARG_3_HI: mtype = v8hi_ftype_v8hi_v8hi_v8hi; break;
+ case MULTI_ARG_3_HI_SI: mtype = v8hi_ftype_v8hi_v8hi_v4si; break;
+ case MULTI_ARG_3_QI: mtype = v16qi_ftype_v16qi_v16qi_v16qi; break;
+ case MULTI_ARG_3_DI2: mtype = v4di_ftype_v4di_v4di_v4di; break;
+ case MULTI_ARG_3_SI2: mtype = v8si_ftype_v8si_v8si_v8si; break;
+ case MULTI_ARG_3_HI2: mtype = v16hi_ftype_v16hi_v16hi_v16hi; break;
+ case MULTI_ARG_3_QI2: mtype = v32qi_ftype_v32qi_v32qi_v32qi; break;
+ case MULTI_ARG_2_SF: mtype = v4sf_ftype_v4sf_v4sf; break;
+ case MULTI_ARG_2_DF: mtype = v2df_ftype_v2df_v2df; break;
+ case MULTI_ARG_2_DI: mtype = v2di_ftype_v2di_v2di; break;
+ case MULTI_ARG_2_SI: mtype = v4si_ftype_v4si_v4si; break;
+ case MULTI_ARG_2_HI: mtype = v8hi_ftype_v8hi_v8hi; break;
+ case MULTI_ARG_2_QI: mtype = v16qi_ftype_v16qi_v16qi; break;
+ case MULTI_ARG_2_DI_IMM: mtype = v2di_ftype_v2di_si; break;
+ case MULTI_ARG_2_SI_IMM: mtype = v4si_ftype_v4si_si; break;
+ case MULTI_ARG_2_HI_IMM: mtype = v8hi_ftype_v8hi_si; break;
+ case MULTI_ARG_2_QI_IMM: mtype = v16qi_ftype_v16qi_si; break;
+ case MULTI_ARG_2_DI_CMP: mtype = v2di_ftype_v2di_v2di; break;
+ case MULTI_ARG_2_SI_CMP: mtype = v4si_ftype_v4si_v4si; break;
+ case MULTI_ARG_2_HI_CMP: mtype = v8hi_ftype_v8hi_v8hi; break;
+ case MULTI_ARG_2_QI_CMP: mtype = v16qi_ftype_v16qi_v16qi; break;
+ case MULTI_ARG_2_SF_TF: mtype = v4sf_ftype_v4sf_v4sf; break;
+ case MULTI_ARG_2_DF_TF: mtype = v2df_ftype_v2df_v2df; break;
+ case MULTI_ARG_2_DI_TF: mtype = v2di_ftype_v2di_v2di; break;
+ case MULTI_ARG_2_SI_TF: mtype = v4si_ftype_v4si_v4si; break;
+ case MULTI_ARG_2_HI_TF: mtype = v8hi_ftype_v8hi_v8hi; break;
+ case MULTI_ARG_2_QI_TF: mtype = v16qi_ftype_v16qi_v16qi; break;
+ case MULTI_ARG_1_SF: mtype = v4sf_ftype_v4sf; break;
+ case MULTI_ARG_1_DF: mtype = v2df_ftype_v2df; break;
+ case MULTI_ARG_1_SF2: mtype = v8sf_ftype_v8sf; break;
+ case MULTI_ARG_1_DF2: mtype = v4df_ftype_v4df; break;
+ case MULTI_ARG_1_DI: mtype = v2di_ftype_v2di; break;
+ case MULTI_ARG_1_SI: mtype = v4si_ftype_v4si; break;
+ case MULTI_ARG_1_HI: mtype = v8hi_ftype_v8hi; break;
+ case MULTI_ARG_1_QI: mtype = v16qi_ftype_v16qi; break;
+ case MULTI_ARG_1_SI_DI: mtype = v2di_ftype_v4si; break;
+ case MULTI_ARG_1_HI_DI: mtype = v2di_ftype_v8hi; break;
+ case MULTI_ARG_1_HI_SI: mtype = v4si_ftype_v8hi; break;
+ case MULTI_ARG_1_QI_DI: mtype = v2di_ftype_v16qi; break;
+ case MULTI_ARG_1_QI_SI: mtype = v4si_ftype_v16qi; break;
+ case MULTI_ARG_1_QI_HI: mtype = v8hi_ftype_v16qi; break;
case MULTI_ARG_UNKNOWN:
default:
@@ -23440,6 +24221,17 @@ ix86_init_builtins (void)
ix86_init_builtins_va_builtins_abi ();
}
+/* Return the ix86 builtin for CODE. */
+
+static tree
+ix86_builtin_decl (unsigned code, bool initialize_p ATTRIBUTE_UNUSED)
+{
+ if (code >= IX86_BUILTIN_MAX)
+ return error_mark_node;
+
+ return ix86_builtins[code];
+}
+
/* Errors in the source file can cause expand_expr to return const0_rtx
where we expect a vector. To avoid crashing, use one of the vector
clear instructions. */
@@ -23523,9 +24315,71 @@ ix86_expand_multi_arg_builtin (enum insn_code icode, tree exp, rtx target,
case MULTI_ARG_3_DF:
case MULTI_ARG_3_SF2:
case MULTI_ARG_3_DF2:
+ case MULTI_ARG_3_DI:
+ case MULTI_ARG_3_SI:
+ case MULTI_ARG_3_SI_DI:
+ case MULTI_ARG_3_HI:
+ case MULTI_ARG_3_HI_SI:
+ case MULTI_ARG_3_QI:
+ case MULTI_ARG_3_DI2:
+ case MULTI_ARG_3_SI2:
+ case MULTI_ARG_3_HI2:
+ case MULTI_ARG_3_QI2:
nargs = 3;
break;
+ case MULTI_ARG_2_SF:
+ case MULTI_ARG_2_DF:
+ case MULTI_ARG_2_DI:
+ case MULTI_ARG_2_SI:
+ case MULTI_ARG_2_HI:
+ case MULTI_ARG_2_QI:
+ nargs = 2;
+ break;
+
+ case MULTI_ARG_2_DI_IMM:
+ case MULTI_ARG_2_SI_IMM:
+ case MULTI_ARG_2_HI_IMM:
+ case MULTI_ARG_2_QI_IMM:
+ nargs = 2;
+ last_arg_constant = true;
+ break;
+
+ case MULTI_ARG_1_SF:
+ case MULTI_ARG_1_DF:
+ case MULTI_ARG_1_SF2:
+ case MULTI_ARG_1_DF2:
+ case MULTI_ARG_1_DI:
+ case MULTI_ARG_1_SI:
+ case MULTI_ARG_1_HI:
+ case MULTI_ARG_1_QI:
+ case MULTI_ARG_1_SI_DI:
+ case MULTI_ARG_1_HI_DI:
+ case MULTI_ARG_1_HI_SI:
+ case MULTI_ARG_1_QI_DI:
+ case MULTI_ARG_1_QI_SI:
+ case MULTI_ARG_1_QI_HI:
+ nargs = 1;
+ break;
+
+ case MULTI_ARG_2_DI_CMP:
+ case MULTI_ARG_2_SI_CMP:
+ case MULTI_ARG_2_HI_CMP:
+ case MULTI_ARG_2_QI_CMP:
+ nargs = 2;
+ comparison_p = true;
+ break;
+
+ case MULTI_ARG_2_SF_TF:
+ case MULTI_ARG_2_DF_TF:
+ case MULTI_ARG_2_DI_TF:
+ case MULTI_ARG_2_SI_TF:
+ case MULTI_ARG_2_HI_TF:
+ case MULTI_ARG_2_QI_TF:
+ nargs = 2;
+ tf_p = true;
+ break;
+
case MULTI_ARG_UNKNOWN:
default:
gcc_unreachable ();
@@ -24463,6 +25317,16 @@ ix86_expand_special_args_builtin (const struct builtin_description *d,
/* Reserve memory operand for target. */
memory = ARRAY_SIZE (args);
break;
+ case VOID_FTYPE_USHORT_UINT_USHORT:
+ case VOID_FTYPE_UINT_UINT_UINT:
+ case VOID_FTYPE_UINT64_UINT_UINT:
+ case UCHAR_FTYPE_USHORT_UINT_USHORT:
+ case UCHAR_FTYPE_UINT_UINT_UINT:
+ case UCHAR_FTYPE_UINT64_UINT_UINT:
+ nargs = 3;
+ klass = store;
+ memory = 0;
+ break;
default:
gcc_unreachable ();
}
@@ -25206,7 +26070,7 @@ static tree
ix86_builtin_reciprocal (unsigned int fn, bool md_fn,
bool sqrt ATTRIBUTE_UNUSED)
{
- if (! (TARGET_SSE_MATH && TARGET_RECIP && !optimize_insn_for_size_p ()
+ if (! (TARGET_SSE_MATH && !optimize_insn_for_size_p ()
&& flag_finite_math_only && !flag_trapping_math
&& flag_unsafe_math_optimizations))
return NULL_TREE;
@@ -26455,6 +27319,33 @@ ix86_handle_struct_attribute (tree *node, tree name,
return NULL_TREE;
}
+static tree
+ix86_handle_fndecl_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
+{
+ if (TREE_CODE (*node) != FUNCTION_DECL)
+ {
+ warning (OPT_Wattributes, "%qE attribute only applies to functions",
+ name);
+ *no_add_attrs = true;
+ return NULL_TREE;
+ }
+
+ if (TARGET_64BIT)
+ {
+ warning (OPT_Wattributes, "%qE attribute only available for 32-bit",
+ name);
+ return NULL_TREE;
+ }
+
+#ifndef HAVE_AS_IX86_SWAP
+ sorry ("ms_hook_prologue attribute needs assembler swap suffix support");
+#endif
+
+ return NULL_TREE;
+}
+
static bool
ix86_ms_bitfield_layout_p (const_tree record_type)
{
@@ -28520,18 +29411,18 @@ void ix86_emit_swdivsf (rtx res, rtx a, rtx b, enum machine_mode mode)
emit_insn (gen_rtx_SET (VOIDmode, x0,
gen_rtx_UNSPEC (mode, gen_rtvec (1, b),
UNSPEC_RCP)));
- /* e0 = x0 * b */
+ /* e0 = x0 * a */
emit_insn (gen_rtx_SET (VOIDmode, e0,
- gen_rtx_MULT (mode, x0, b)));
- /* e1 = 2. - e0 */
+ gen_rtx_MULT (mode, x0, a)));
+ /* e1 = x0 * b */
emit_insn (gen_rtx_SET (VOIDmode, e1,
- gen_rtx_MINUS (mode, two, e0)));
- /* x1 = x0 * e1 */
+ gen_rtx_MULT (mode, x0, b)));
+ /* x1 = 2. - e1 */
emit_insn (gen_rtx_SET (VOIDmode, x1,
- gen_rtx_MULT (mode, x0, e1)));
- /* res = a * x1 */
+ gen_rtx_MINUS (mode, two, e1)));
+ /* res = e0 * x1 */
emit_insn (gen_rtx_SET (VOIDmode, res,
- gen_rtx_MULT (mode, a, x1)));
+ gen_rtx_MULT (mode, e0, x1)));
}
/* Output code to perform a Newton-Rhapson approximation of a
@@ -29497,6 +30388,7 @@ static const struct attribute_spec ix86_attribute_table[] =
/* ms_abi and sysv_abi calling convention function attributes. */
{ "ms_abi", 0, 0, false, true, true, ix86_handle_abi_attribute },
{ "sysv_abi", 0, 0, false, true, true, ix86_handle_abi_attribute },
+ { "ms_hook_prologue", 0, 0, true, false, false, ix86_handle_fndecl_attribute },
/* End element. */
{ NULL, 0, 0, false, false, false, NULL }
};
@@ -29663,6 +30555,8 @@ ix86_enum_va_list (int idx, const char **pname, tree *ptree)
#undef TARGET_INIT_BUILTINS
#define TARGET_INIT_BUILTINS ix86_init_builtins
+#undef TARGET_BUILTIN_DECL
+#define TARGET_BUILTIN_DECL ix86_builtin_decl
#undef TARGET_EXPAND_BUILTIN
#define TARGET_EXPAND_BUILTIN ix86_expand_builtin
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 8d525727eec..4bc8ef18500 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -55,6 +55,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define TARGET_FMA OPTION_ISA_FMA
#define TARGET_SSE4A OPTION_ISA_SSE4A
#define TARGET_FMA4 OPTION_ISA_FMA4
+#define TARGET_XOP OPTION_ISA_XOP
+#define TARGET_LWP OPTION_ISA_LWP
#define TARGET_ROUND OPTION_ISA_ROUND
#define TARGET_ABM OPTION_ISA_ABM
#define TARGET_POPCNT OPTION_ISA_POPCNT
@@ -400,6 +402,7 @@ enum ix86_arch_indices {
X86_ARCH_CMPXCHG8B,
X86_ARCH_XADD,
X86_ARCH_BSWAP,
+ X86_ARCH_CALL_ESP,
X86_ARCH_LAST
};
@@ -411,6 +414,7 @@ extern unsigned char ix86_arch_features[X86_ARCH_LAST];
#define TARGET_CMPXCHG8B ix86_arch_features[X86_ARCH_CMPXCHG8B]
#define TARGET_XADD ix86_arch_features[X86_ARCH_XADD]
#define TARGET_BSWAP ix86_arch_features[X86_ARCH_BSWAP]
+#define TARGET_CALL_ESP ix86_arch_features[X86_ARCH_CALL_ESP]
#define TARGET_FISTTP (TARGET_SSE3 && TARGET_80387)
@@ -706,9 +710,7 @@ enum target_cpu_default
generate an alternate prologue and epilogue that realigns the
runtime stack if nessary. This supports mixing codes that keep a
4-byte aligned stack, as specified by i386 psABI, with codes that
- need a 16-byte aligned stack, as required by SSE instructions. If
- STACK_REALIGN_DEFAULT is 1 and PREFERRED_STACK_BOUNDARY_DEFAULT is
- 128, stacks for all functions may be realigned. */
+ need a 16-byte aligned stack, as required by SSE instructions. */
#define STACK_REALIGN_DEFAULT 0
/* Boundary (in *bits*) on which the incoming stack is aligned. */
@@ -873,6 +875,9 @@ enum target_cpu_default
|| ((MODE) == DFmode && (!TARGET_SSE2 || !TARGET_SSE_MATH)) \
|| (MODE) == XFmode)
+/* Cover class containing the stack registers. */
+#define STACK_REG_COVER_CLASS FLOAT_REGS
+
/* Number of actual hardware registers.
The hardware registers are assigned numbers for the compiler
from 0 to just below FIRST_PSEUDO_REGISTER.
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 27800804eca..82f5352597c 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -57,6 +57,7 @@
;; X -- don't print any sort of PIC '@' suffix for a symbol.
;; & -- print some in-use local-dynamic symbol name.
;; H -- print a memory address offset by 8; used for sse high-parts
+;; Y -- print condition for XOP pcom* instruction.
;; + -- print a branch hint as 'cs' or 'ds' prefix
;; ; -- print a semicolon (after prefixes due to bug in older gas).
@@ -199,6 +200,15 @@
(UNSPEC_FMA4_INTRINSIC 150)
(UNSPEC_FMA4_FMADDSUB 151)
(UNSPEC_FMA4_FMSUBADD 152)
+ (UNSPEC_XOP_UNSIGNED_CMP 151)
+ (UNSPEC_XOP_TRUEFALSE 152)
+ (UNSPEC_XOP_PERMUTE 153)
+ (UNSPEC_FRCZ 154)
+ (UNSPEC_LLWP_INTRINSIC 155)
+ (UNSPEC_SLWP_INTRINSIC 156)
+ (UNSPECV_LWPVAL_INTRINSIC 157)
+ (UNSPECV_LWPINS_INTRINSIC 158)
+
; For AES support
(UNSPEC_AESENC 159)
(UNSPEC_AESENCLAST 160)
@@ -241,6 +251,7 @@
(UNSPECV_RDTSC 18)
(UNSPECV_RDTSCP 19)
(UNSPECV_RDPMC 20)
+ (UNSPECV_VSWAPMOV 21)
])
;; Constants to represent pcomtrue/pcomfalse variants
@@ -253,6 +264,20 @@
(COM_TRUE_P 5)
])
+;; Constants used in the XOP pperm instruction
+(define_constants
+ [(PPERM_SRC 0x00) /* copy source */
+ (PPERM_INVERT 0x20) /* invert source */
+ (PPERM_REVERSE 0x40) /* bit reverse source */
+ (PPERM_REV_INV 0x60) /* bit reverse & invert src */
+ (PPERM_ZERO 0x80) /* all 0's */
+ (PPERM_ONES 0xa0) /* all 1's */
+ (PPERM_SIGN 0xc0) /* propagate sign bit */
+ (PPERM_INV_SIGN 0xe0) /* invert & propagate sign */
+ (PPERM_SRC1 0x00) /* use first source byte */
+ (PPERM_SRC2 0x10) /* use second source byte */
+ ])
+
;; Registers by name.
(define_constants
[(AX_REG 0)
@@ -332,7 +357,7 @@
fmov,fop,fsgn,fmul,fdiv,fpspc,fcmov,fcmp,fxch,fistp,fisttp,frndint,
sselog,sselog1,sseiadd,sseiadd1,sseishft,sseimul,
sse,ssemov,sseadd,ssemul,ssecmp,ssecomi,ssecvt,ssecvt1,sseicvt,ssediv,sseins,
- ssemuladd,sse4arg,
+ ssemuladd,sse4arg,lwp,
mmx,mmxmov,mmxadd,mmxmul,mmxcmp,mmxcvt,mmxshft"
(const_string "other"))
@@ -702,12 +727,52 @@
;; Base name for x87 insn mnemonic.
(define_code_attr absnegprefix [(abs "abs") (neg "chs")])
+;; Used in signed and unsigned widening multiplications.
+(define_code_iterator any_extend [sign_extend zero_extend])
+
+;; Used in signed and unsigned divisions.
+(define_code_iterator any_div [div udiv])
+
+;; Various insn prefixes for signed and unsigned operations.
+(define_code_attr u [(sign_extend "") (zero_extend "u")
+ (div "") (udiv "u")])
+(define_code_attr s [(sign_extend "s") (zero_extend "u")])
+
+;; Instruction prefix for signed and unsigned operations.
+(define_code_attr sgnprefix [(sign_extend "i") (zero_extend "")
+ (div "i") (udiv "")])
+
;; All single word integer modes.
(define_mode_iterator SWI [QI HI SI (DI "TARGET_64BIT")])
;; Single word integer modes without QImode.
(define_mode_iterator SWI248 [HI SI (DI "TARGET_64BIT")])
+;; Single word integer modes without QImode and HImode.
+(define_mode_iterator SWI48 [SI (DI "TARGET_64BIT")])
+
+;; All math-dependant single and double word integer modes.
+(define_mode_iterator SDWIM [(QI "TARGET_QIMODE_MATH")
+ (HI "TARGET_HIMODE_MATH")
+ SI DI (TI "TARGET_64BIT")])
+
+;; Math-dependant single word integer modes.
+(define_mode_iterator SWIM [(QI "TARGET_QIMODE_MATH")
+ (HI "TARGET_HIMODE_MATH")
+ SI (DI "TARGET_64BIT")])
+
+;; Math-dependant single word integer modes without QImode.
+(define_mode_iterator SWIM248 [(HI "TARGET_HIMODE_MATH")
+ SI (DI "TARGET_64BIT")])
+
+;; Half mode for double word integer modes.
+(define_mode_iterator DWIH [(SI "!TARGET_64BIT")
+ (DI "TARGET_64BIT")])
+
+;; Double word integer modes.
+(define_mode_attr DWI [(SI "DI") (DI "TI")])
+(define_mode_attr dwi [(SI "di") (DI "ti")])
+
;; Instruction suffix for integer modes.
(define_mode_attr imodesuffix [(QI "b") (HI "w") (SI "l") (DI "q")])
@@ -717,12 +782,19 @@
;; Immediate operand constraint for integer modes.
(define_mode_attr i [(QI "n") (HI "n") (SI "i") (DI "e")])
+;; General operand constraint for word modes.
+(define_mode_attr g [(SI "g") (DI "rme")])
+
+;; Immediate operand constraint for double integer modes.
+(define_mode_attr di [(SI "iF") (DI "e")])
+
;; General operand predicate for integer modes.
(define_mode_attr general_operand
[(QI "general_operand")
(HI "general_operand")
(SI "general_operand")
- (DI "x86_64_general_operand")])
+ (DI "x86_64_general_operand")
+ (TI "x86_64_general_operand")])
;; SSE and x87 SFmode and DFmode floating point modes
(define_mode_iterator MODEF [SF DF])
@@ -752,7 +824,6 @@
;; This mode iterator allows :P to be used for patterns that operate on
;; pointer-sized quantities. Exactly one of the two alternatives will match.
(define_mode_iterator P [(SI "Pmode == SImode") (DI "Pmode == DImode")])
-
;; Scheduling descriptions
@@ -2994,7 +3065,6 @@
[(set (match_dup 0)
(match_dup 2))])
-
;; %%% Kill this when call knows how to work this out.
(define_split
[(set (match_operand:SF 0 "push_operand" "")
@@ -4040,9 +4110,11 @@
&& (TARGET_ZERO_EXTEND_WITH_AND
&& optimize_function_for_speed_p (cfun))
&& !reg_overlap_mentioned_p (operands[0], operands[1])"
- [(set (match_dup 0) (const_int 0))
- (set (strict_low_part (match_dup 2)) (match_dup 1))]
- "operands[2] = gen_lowpart (QImode, operands[0]);")
+ [(set (strict_low_part (match_dup 2)) (match_dup 1))]
+{
+ operands[2] = gen_lowpart (QImode, operands[0]);
+ ix86_expand_clear (operands[0]);
+})
;; Rest is handled by single and.
(define_split
@@ -4072,7 +4144,7 @@
[(set_attr "type" "alu1")
(set_attr "mode" "SI")])
-(define_insn "*zero_extendqisi2_movzbw_and"
+(define_insn "*zero_extendqisi2_movzbl_and"
[(set (match_operand:SI 0 "register_operand" "=r,r")
(zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "qm,0")))
(clobber (reg:CC FLAGS_REG))]
@@ -4081,7 +4153,7 @@
[(set_attr "type" "imovx,alu1")
(set_attr "mode" "SI")])
-(define_insn "*zero_extendqisi2_movzbw"
+(define_insn "*zero_extendqisi2_movzbl"
[(set (match_operand:SI 0 "register_operand" "=r")
(zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "qm")))]
"(!TARGET_ZERO_EXTEND_WITH_AND || optimize_function_for_size_p (cfun))
@@ -4112,9 +4184,11 @@
&& (ANY_QI_REG_P (operands[1]) || MEM_P (operands[1]))
&& (TARGET_ZERO_EXTEND_WITH_AND && optimize_function_for_speed_p (cfun))
&& !reg_overlap_mentioned_p (operands[0], operands[1])"
- [(set (match_dup 0) (const_int 0))
- (set (strict_low_part (match_dup 2)) (match_dup 1))]
- "operands[2] = gen_lowpart (QImode, operands[0]);")
+ [(set (strict_low_part (match_dup 2)) (match_dup 1))]
+{
+ operands[2] = gen_lowpart (QImode, operands[0]);
+ ix86_expand_clear (operands[0]);
+})
;; Rest is handled by single and.
(define_split
@@ -5426,11 +5500,18 @@
&& !X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, <SSEMODEI24:MODE>mode))
{
rtx reg = gen_reg_rtx (XFmode);
+ rtx insn;
+
emit_insn (gen_float<SSEMODEI24:mode>xf2 (reg, operands[1]));
-/* Avoid references to nonexistent function in dead code in XFmode case. */
-#define gen_truncxfxf2 gen_truncxfdf2
- emit_insn (gen_truncxf<X87MODEF:mode>2 (operands[0], reg));
-#undef gen_truncxfxf2
+
+ if (<X87MODEF:MODE>mode == SFmode)
+ insn = gen_truncxfsf2 (operands[0], reg);
+ else if (<X87MODEF:MODE>mode == DFmode)
+ insn = gen_truncxfdf2 (operands[0], reg);
+ else
+ gcc_unreachable ();
+
+ emit_insn (insn);
DONE;
}
}")
@@ -6046,195 +6127,57 @@
;; Add instructions
-;; %%% splits for addditi3
-
-(define_expand "addti3"
- [(set (match_operand:TI 0 "nonimmediate_operand" "")
- (plus:TI (match_operand:TI 1 "nonimmediate_operand" "")
- (match_operand:TI 2 "x86_64_general_operand" "")))]
- "TARGET_64BIT"
- "ix86_expand_binary_operator (PLUS, TImode, operands); DONE;")
-
-(define_insn "*addti3_1"
- [(set (match_operand:TI 0 "nonimmediate_operand" "=r,o")
- (plus:TI (match_operand:TI 1 "nonimmediate_operand" "%0,0")
- (match_operand:TI 2 "x86_64_general_operand" "roe,re")))
- (clobber (reg:CC FLAGS_REG))]
- "TARGET_64BIT && ix86_binary_operator_ok (PLUS, TImode, operands)"
- "#")
-
-(define_split
- [(set (match_operand:TI 0 "nonimmediate_operand" "")
- (plus:TI (match_operand:TI 1 "nonimmediate_operand" "")
- (match_operand:TI 2 "x86_64_general_operand" "")))
- (clobber (reg:CC FLAGS_REG))]
- "TARGET_64BIT && reload_completed"
- [(parallel [(set (reg:CC FLAGS_REG) (unspec:CC [(match_dup 1) (match_dup 2)]
- UNSPEC_ADD_CARRY))
- (set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))])
- (parallel [(set (match_dup 3)
- (plus:DI (plus:DI (ltu:DI (reg:CC FLAGS_REG) (const_int 0))
- (match_dup 4))
- (match_dup 5)))
- (clobber (reg:CC FLAGS_REG))])]
- "split_ti (&operands[0], 3, &operands[0], &operands[3]);")
-
-;; %%% splits for addsidi3
-; [(set (match_operand:DI 0 "nonimmediate_operand" "")
-; (plus:DI (match_operand:DI 1 "general_operand" "")
-; (zero_extend:DI (match_operand:SI 2 "general_operand" ""))))]
-
-(define_expand "adddi3"
- [(set (match_operand:DI 0 "nonimmediate_operand" "")
- (plus:DI (match_operand:DI 1 "nonimmediate_operand" "")
- (match_operand:DI 2 "x86_64_general_operand" "")))]
+(define_expand "add<mode>3"
+ [(set (match_operand:SDWIM 0 "nonimmediate_operand" "")
+ (plus:SDWIM (match_operand:SDWIM 1 "nonimmediate_operand" "")
+ (match_operand:SDWIM 2 "<general_operand>" "")))]
""
- "ix86_expand_binary_operator (PLUS, DImode, operands); DONE;")
+ "ix86_expand_binary_operator (PLUS, <MODE>mode, operands); DONE;")
-(define_insn "*adddi3_1"
- [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o")
- (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
- (match_operand:DI 2 "general_operand" "roiF,riF")))
+(define_insn_and_split "*add<dwi>3_doubleword"
+ [(set (match_operand:<DWI> 0 "nonimmediate_operand" "=r,o")
+ (plus:<DWI>
+ (match_operand:<DWI> 1 "nonimmediate_operand" "%0,0")
+ (match_operand:<DWI> 2 "<general_operand>" "ro<di>,r<di>")))
(clobber (reg:CC FLAGS_REG))]
- "!TARGET_64BIT && ix86_binary_operator_ok (PLUS, DImode, operands)"
- "#")
-
-(define_split
- [(set (match_operand:DI 0 "nonimmediate_operand" "")
- (plus:DI (match_operand:DI 1 "nonimmediate_operand" "")
- (match_operand:DI 2 "general_operand" "")))
- (clobber (reg:CC FLAGS_REG))]
- "!TARGET_64BIT && reload_completed"
- [(parallel [(set (reg:CC FLAGS_REG) (unspec:CC [(match_dup 1) (match_dup 2)]
- UNSPEC_ADD_CARRY))
- (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))])
+ "ix86_binary_operator_ok (PLUS, <DWI>mode, operands)"
+ "#"
+ "reload_completed"
+ [(parallel [(set (reg:CC FLAGS_REG)
+ (unspec:CC [(match_dup 1) (match_dup 2)]
+ UNSPEC_ADD_CARRY))
+ (set (match_dup 0)
+ (plus:DWIH (match_dup 1) (match_dup 2)))])
(parallel [(set (match_dup 3)
- (plus:SI (plus:SI (ltu:SI (reg:CC FLAGS_REG) (const_int 0))
- (match_dup 4))
- (match_dup 5)))
+ (plus:DWIH
+ (plus:DWIH
+ (ltu:DWIH (reg:CC FLAGS_REG) (const_int 0))
+ (match_dup 4))
+ (match_dup 5)))
(clobber (reg:CC FLAGS_REG))])]
- "split_di (&operands[0], 3, &operands[0], &operands[3]);")
+ "split_<dwi> (&operands[0], 3, &operands[0], &operands[3]);")
-(define_insn "adddi3_carry_rex64"
- [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,r")
- (plus:DI (plus:DI (match_operand:DI 3 "ix86_carry_flag_operator" "")
- (match_operand:DI 1 "nonimmediate_operand" "%0,0"))
- (match_operand:DI 2 "x86_64_general_operand" "re,rm")))
+(define_insn "add<mode>3_carry"
+ [(set (match_operand:SWI 0 "nonimmediate_operand" "=<r>m,<r>")
+ (plus:SWI
+ (plus:SWI (match_operand:SWI 3 "ix86_carry_flag_operator" "")
+ (match_operand:SWI 1 "nonimmediate_operand" "%0,0"))
+ (match_operand:SWI 2 "<general_operand>" "<r><i>,<r>m")))
(clobber (reg:CC FLAGS_REG))]
- "TARGET_64BIT && ix86_binary_operator_ok (PLUS, DImode, operands)"
- "adc{q}\t{%2, %0|%0, %2}"
- [(set_attr "type" "alu")
- (set_attr "use_carry" "1")
- (set_attr "pent_pair" "pu")
- (set_attr "mode" "DI")])
-
-(define_insn "*adddi3_cc_rex64"
- [(set (reg:CC FLAGS_REG)
- (unspec:CC [(match_operand:DI 1 "nonimmediate_operand" "%0,0")
- (match_operand:DI 2 "x86_64_general_operand" "re,rm")]
- UNSPEC_ADD_CARRY))
- (set (match_operand:DI 0 "nonimmediate_operand" "=rm,r")
- (plus:DI (match_dup 1) (match_dup 2)))]
- "TARGET_64BIT && ix86_binary_operator_ok (PLUS, DImode, operands)"
- "add{q}\t{%2, %0|%0, %2}"
- [(set_attr "type" "alu")
- (set_attr "mode" "DI")])
-
-(define_insn "*<plusminus_insn><mode>3_cc_overflow"
- [(set (reg:CCC FLAGS_REG)
- (compare:CCC
- (plusminus:SWI
- (match_operand:SWI 1 "nonimmediate_operand" "<comm>0,0")
- (match_operand:SWI 2 "<general_operand>" "<r><i>,<r>m"))
- (match_dup 1)))
- (set (match_operand:SWI 0 "nonimmediate_operand" "=<r>m,<r>")
- (plusminus:SWI (match_dup 1) (match_dup 2)))]
- "ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
- "<plusminus_mnemonic>{<imodesuffix>}\t{%2, %0|%0, %2}"
- [(set_attr "type" "alu")
- (set_attr "mode" "<MODE>")])
-
-(define_insn "*add<mode>3_cconly_overflow"
- [(set (reg:CCC FLAGS_REG)
- (compare:CCC
- (plus:SWI (match_operand:SWI 1 "nonimmediate_operand" "%0")
- (match_operand:SWI 2 "<general_operand>" "<r><i>m"))
- (match_dup 1)))
- (clobber (match_scratch:SWI 0 "=<r>"))]
"ix86_binary_operator_ok (PLUS, <MODE>mode, operands)"
- "add{<imodesuffix>}\t{%2, %0|%0, %2}"
- [(set_attr "type" "alu")
- (set_attr "mode" "<MODE>")])
-
-(define_insn "*sub<mode>3_cconly_overflow"
- [(set (reg:CCC FLAGS_REG)
- (compare:CCC
- (minus:SWI (match_operand:SWI 0 "nonimmediate_operand" "<r>m,<r>")
- (match_operand:SWI 1 "<general_operand>" "<r><i>,<r>m"))
- (match_dup 0)))]
- ""
- "cmp{<imodesuffix>}\t{%1, %0|%0, %1}"
- [(set_attr "type" "icmp")
- (set_attr "mode" "<MODE>")])
-
-(define_insn "*<plusminus_insn>si3_zext_cc_overflow"
- [(set (reg:CCC FLAGS_REG)
- (compare:CCC
- (plusminus:SI (match_operand:SI 1 "nonimmediate_operand" "<comm>0")
- (match_operand:SI 2 "general_operand" "g"))
- (match_dup 1)))
- (set (match_operand:DI 0 "register_operand" "=r")
- (zero_extend:DI (plusminus:SI (match_dup 1) (match_dup 2))))]
- "TARGET_64BIT && ix86_binary_operator_ok (<CODE>, SImode, operands)"
- "<plusminus_mnemonic>{l}\t{%2, %k0|%k0, %2}"
- [(set_attr "type" "alu")
- (set_attr "mode" "SI")])
-
-(define_insn "addqi3_carry"
- [(set (match_operand:QI 0 "nonimmediate_operand" "=qm,q")
- (plus:QI (plus:QI (match_operand:QI 3 "ix86_carry_flag_operator" "")
- (match_operand:QI 1 "nonimmediate_operand" "%0,0"))
- (match_operand:QI 2 "general_operand" "qn,qm")))
- (clobber (reg:CC FLAGS_REG))]
- "ix86_binary_operator_ok (PLUS, QImode, operands)"
- "adc{b}\t{%2, %0|%0, %2}"
- [(set_attr "type" "alu")
- (set_attr "use_carry" "1")
- (set_attr "pent_pair" "pu")
- (set_attr "mode" "QI")])
-
-(define_insn "addhi3_carry"
- [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,r")
- (plus:HI (plus:HI (match_operand:HI 3 "ix86_carry_flag_operator" "")
- (match_operand:HI 1 "nonimmediate_operand" "%0,0"))
- (match_operand:HI 2 "general_operand" "rn,rm")))
- (clobber (reg:CC FLAGS_REG))]
- "ix86_binary_operator_ok (PLUS, HImode, operands)"
- "adc{w}\t{%2, %0|%0, %2}"
+ "adc{<imodesuffix>}\t{%2, %0|%0, %2}"
[(set_attr "type" "alu")
(set_attr "use_carry" "1")
(set_attr "pent_pair" "pu")
- (set_attr "mode" "HI")])
-
-(define_insn "addsi3_carry"
- [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,r")
- (plus:SI (plus:SI (match_operand:SI 3 "ix86_carry_flag_operator" "")
- (match_operand:SI 1 "nonimmediate_operand" "%0,0"))
- (match_operand:SI 2 "general_operand" "ri,rm")))
- (clobber (reg:CC FLAGS_REG))]
- "ix86_binary_operator_ok (PLUS, SImode, operands)"
- "adc{l}\t{%2, %0|%0, %2}"
- [(set_attr "type" "alu")
- (set_attr "use_carry" "1")
- (set_attr "pent_pair" "pu")
- (set_attr "mode" "SI")])
+ (set_attr "mode" "<MODE>")])
(define_insn "*addsi3_carry_zext"
[(set (match_operand:DI 0 "register_operand" "=r")
- (zero_extend:DI
- (plus:SI (plus:SI (match_operand:SI 3 "ix86_carry_flag_operator" "")
- (match_operand:SI 1 "nonimmediate_operand" "%0"))
- (match_operand:SI 2 "general_operand" "g"))))
+ (zero_extend:DI
+ (plus:SI
+ (plus:SI (match_operand:SI 3 "ix86_carry_flag_operator" "")
+ (match_operand:SI 1 "nonimmediate_operand" "%0"))
+ (match_operand:SI 2 "general_operand" "g"))))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT && ix86_binary_operator_ok (PLUS, SImode, operands)"
"adc{l}\t{%2, %k0|%k0, %2}"
@@ -6243,23 +6186,25 @@
(set_attr "pent_pair" "pu")
(set_attr "mode" "SI")])
-(define_insn "*addsi3_cc"
+(define_insn "*add<mode>3_cc"
[(set (reg:CC FLAGS_REG)
- (unspec:CC [(match_operand:SI 1 "nonimmediate_operand" "%0,0")
- (match_operand:SI 2 "general_operand" "ri,rm")]
- UNSPEC_ADD_CARRY))
- (set (match_operand:SI 0 "nonimmediate_operand" "=rm,r")
- (plus:SI (match_dup 1) (match_dup 2)))]
- "ix86_binary_operator_ok (PLUS, SImode, operands)"
- "add{l}\t{%2, %0|%0, %2}"
+ (unspec:CC
+ [(match_operand:SWI48 1 "nonimmediate_operand" "%0,0")
+ (match_operand:SWI48 2 "<general_operand>" "r<i>,rm")]
+ UNSPEC_ADD_CARRY))
+ (set (match_operand:SWI48 0 "nonimmediate_operand" "=rm,r")
+ (plus:SWI48 (match_dup 1) (match_dup 2)))]
+ "ix86_binary_operator_ok (PLUS, <MODE>mode, operands)"
+ "add{<imodesuffix>}\t{%2, %0|%0, %2}"
[(set_attr "type" "alu")
- (set_attr "mode" "SI")])
+ (set_attr "mode" "<MODE>")])
(define_insn "addqi3_cc"
[(set (reg:CC FLAGS_REG)
- (unspec:CC [(match_operand:QI 1 "nonimmediate_operand" "%0,0")
- (match_operand:QI 2 "general_operand" "qn,qm")]
- UNSPEC_ADD_CARRY))
+ (unspec:CC
+ [(match_operand:QI 1 "nonimmediate_operand" "%0,0")
+ (match_operand:QI 2 "general_operand" "qn,qm")]
+ UNSPEC_ADD_CARRY))
(set (match_operand:QI 0 "nonimmediate_operand" "=qm,q")
(plus:QI (match_dup 1) (match_dup 2)))]
"ix86_binary_operator_ok (PLUS, QImode, operands)"
@@ -6267,22 +6212,28 @@
[(set_attr "type" "alu")
(set_attr "mode" "QI")])
-(define_expand "addsi3"
- [(set (match_operand:SI 0 "nonimmediate_operand" "")
- (plus:SI (match_operand:SI 1 "nonimmediate_operand" "")
- (match_operand:SI 2 "general_operand" "")))]
- ""
- "ix86_expand_binary_operator (PLUS, SImode, operands); DONE;")
+(define_insn "*add<mode>3_cconly_overflow"
+ [(set (reg:CCC FLAGS_REG)
+ (compare:CCC
+ (plus:SWI
+ (match_operand:SWI 1 "nonimmediate_operand" "%0")
+ (match_operand:SWI 2 "<general_operand>" "<r><i>m"))
+ (match_dup 1)))
+ (clobber (match_scratch:SWI 0 "=<r>"))]
+ "ix86_binary_operator_ok (PLUS, <MODE>mode, operands)"
+ "add{<imodesuffix>}\t{%2, %0|%0, %2}"
+ [(set_attr "type" "alu")
+ (set_attr "mode" "<MODE>")])
(define_insn "*lea_1"
- [(set (match_operand:SI 0 "register_operand" "=r")
- (match_operand:SI 1 "no_seg_address_operand" "p"))]
- "!TARGET_64BIT"
- "lea{l}\t{%a1, %0|%0, %a1}"
+ [(set (match_operand:DWIH 0 "register_operand" "=r")
+ (match_operand:DWIH 1 "no_seg_address_operand" "p"))]
+ ""
+ "lea{<imodesuffix>}\t{%a1, %0|%0, %a1}"
[(set_attr "type" "lea")
- (set_attr "mode" "SI")])
+ (set_attr "mode" "<MODE>")])
-(define_insn "*lea_1_rex64"
+(define_insn "*lea_2"
[(set (match_operand:SI 0 "register_operand" "=r")
(subreg:SI (match_operand:DI 1 "no_seg_address_operand" "p") 0))]
"TARGET_64BIT"
@@ -6290,227 +6241,60 @@
[(set_attr "type" "lea")
(set_attr "mode" "SI")])
-(define_insn "*lea_1_zext"
+(define_insn "*lea_2_zext"
[(set (match_operand:DI 0 "register_operand" "=r")
(zero_extend:DI
- (subreg:SI (match_operand:DI 1 "no_seg_address_operand" "p") 0)))]
+ (subreg:SI (match_operand:DI 1 "no_seg_address_operand" "p") 0)))]
"TARGET_64BIT"
"lea{l}\t{%a1, %k0|%k0, %a1}"
[(set_attr "type" "lea")
(set_attr "mode" "SI")])
-(define_insn "*lea_2_rex64"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (match_operand:DI 1 "no_seg_address_operand" "p"))]
- "TARGET_64BIT"
- "lea{q}\t{%a1, %0|%0, %a1}"
- [(set_attr "type" "lea")
- (set_attr "mode" "DI")])
-
-;; The lea patterns for non-Pmodes needs to be matched by several
-;; insns converted to real lea by splitters.
-
-(define_insn_and_split "*lea_general_1"
- [(set (match_operand 0 "register_operand" "=r")
- (plus (plus (match_operand 1 "index_register_operand" "l")
- (match_operand 2 "register_operand" "r"))
- (match_operand 3 "immediate_operand" "i")))]
- "(GET_MODE (operands[0]) == QImode || GET_MODE (operands[0]) == HImode
- || (TARGET_64BIT && GET_MODE (operands[0]) == SImode))
- && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
- && GET_MODE (operands[0]) == GET_MODE (operands[1])
- && GET_MODE (operands[0]) == GET_MODE (operands[2])
- && (GET_MODE (operands[0]) == GET_MODE (operands[3])
- || GET_MODE (operands[3]) == VOIDmode)"
- "#"
- "&& reload_completed"
- [(const_int 0)]
-{
- rtx pat;
- operands[0] = gen_lowpart (SImode, operands[0]);
- operands[1] = gen_lowpart (Pmode, operands[1]);
- operands[2] = gen_lowpart (Pmode, operands[2]);
- operands[3] = gen_lowpart (Pmode, operands[3]);
- pat = gen_rtx_PLUS (Pmode, gen_rtx_PLUS (Pmode, operands[1], operands[2]),
- operands[3]);
- if (Pmode != SImode)
- pat = gen_rtx_SUBREG (SImode, pat, 0);
- emit_insn (gen_rtx_SET (VOIDmode, operands[0], pat));
- DONE;
-}
- [(set_attr "type" "lea")
- (set_attr "mode" "SI")])
-
-(define_insn_and_split "*lea_general_1_zext"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (zero_extend:DI
- (plus:SI (plus:SI (match_operand:SI 1 "index_register_operand" "l")
- (match_operand:SI 2 "register_operand" "r"))
- (match_operand:SI 3 "immediate_operand" "i"))))]
- "TARGET_64BIT"
- "#"
- "&& reload_completed"
- [(set (match_dup 0)
- (zero_extend:DI (subreg:SI (plus:DI (plus:DI (match_dup 1)
- (match_dup 2))
- (match_dup 3)) 0)))]
-{
- operands[1] = gen_lowpart (Pmode, operands[1]);
- operands[2] = gen_lowpart (Pmode, operands[2]);
- operands[3] = gen_lowpart (Pmode, operands[3]);
-}
- [(set_attr "type" "lea")
- (set_attr "mode" "SI")])
-
-(define_insn_and_split "*lea_general_2"
- [(set (match_operand 0 "register_operand" "=r")
- (plus (mult (match_operand 1 "index_register_operand" "l")
- (match_operand 2 "const248_operand" "i"))
- (match_operand 3 "nonmemory_operand" "ri")))]
- "(GET_MODE (operands[0]) == QImode || GET_MODE (operands[0]) == HImode
- || (TARGET_64BIT && GET_MODE (operands[0]) == SImode))
- && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
- && GET_MODE (operands[0]) == GET_MODE (operands[1])
- && (GET_MODE (operands[0]) == GET_MODE (operands[3])
- || GET_MODE (operands[3]) == VOIDmode)"
- "#"
- "&& reload_completed"
- [(const_int 0)]
-{
- rtx pat;
- operands[0] = gen_lowpart (SImode, operands[0]);
- operands[1] = gen_lowpart (Pmode, operands[1]);
- operands[3] = gen_lowpart (Pmode, operands[3]);
- pat = gen_rtx_PLUS (Pmode, gen_rtx_MULT (Pmode, operands[1], operands[2]),
- operands[3]);
- if (Pmode != SImode)
- pat = gen_rtx_SUBREG (SImode, pat, 0);
- emit_insn (gen_rtx_SET (VOIDmode, operands[0], pat));
- DONE;
-}
- [(set_attr "type" "lea")
- (set_attr "mode" "SI")])
-
-(define_insn_and_split "*lea_general_2_zext"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (zero_extend:DI
- (plus:SI (mult:SI (match_operand:SI 1 "index_register_operand" "l")
- (match_operand:SI 2 "const248_operand" "n"))
- (match_operand:SI 3 "nonmemory_operand" "ri"))))]
- "TARGET_64BIT"
- "#"
- "&& reload_completed"
- [(set (match_dup 0)
- (zero_extend:DI (subreg:SI (plus:DI (mult:DI (match_dup 1)
- (match_dup 2))
- (match_dup 3)) 0)))]
-{
- operands[1] = gen_lowpart (Pmode, operands[1]);
- operands[3] = gen_lowpart (Pmode, operands[3]);
-}
- [(set_attr "type" "lea")
- (set_attr "mode" "SI")])
-
-(define_insn_and_split "*lea_general_3"
- [(set (match_operand 0 "register_operand" "=r")
- (plus (plus (mult (match_operand 1 "index_register_operand" "l")
- (match_operand 2 "const248_operand" "i"))
- (match_operand 3 "register_operand" "r"))
- (match_operand 4 "immediate_operand" "i")))]
- "(GET_MODE (operands[0]) == QImode || GET_MODE (operands[0]) == HImode
- || (TARGET_64BIT && GET_MODE (operands[0]) == SImode))
- && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
- && GET_MODE (operands[0]) == GET_MODE (operands[1])
- && GET_MODE (operands[0]) == GET_MODE (operands[3])"
- "#"
- "&& reload_completed"
- [(const_int 0)]
-{
- rtx pat;
- operands[0] = gen_lowpart (SImode, operands[0]);
- operands[1] = gen_lowpart (Pmode, operands[1]);
- operands[3] = gen_lowpart (Pmode, operands[3]);
- operands[4] = gen_lowpart (Pmode, operands[4]);
- pat = gen_rtx_PLUS (Pmode,
- gen_rtx_PLUS (Pmode, gen_rtx_MULT (Pmode, operands[1],
- operands[2]),
- operands[3]),
- operands[4]);
- if (Pmode != SImode)
- pat = gen_rtx_SUBREG (SImode, pat, 0);
- emit_insn (gen_rtx_SET (VOIDmode, operands[0], pat));
- DONE;
-}
- [(set_attr "type" "lea")
- (set_attr "mode" "SI")])
-
-(define_insn_and_split "*lea_general_3_zext"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (zero_extend:DI
- (plus:SI (plus:SI (mult:SI
- (match_operand:SI 1 "index_register_operand" "l")
- (match_operand:SI 2 "const248_operand" "n"))
- (match_operand:SI 3 "register_operand" "r"))
- (match_operand:SI 4 "immediate_operand" "i"))))]
- "TARGET_64BIT"
- "#"
- "&& reload_completed"
- [(set (match_dup 0)
- (zero_extend:DI (subreg:SI (plus:DI (plus:DI (mult:DI (match_dup 1)
- (match_dup 2))
- (match_dup 3))
- (match_dup 4)) 0)))]
-{
- operands[1] = gen_lowpart (Pmode, operands[1]);
- operands[3] = gen_lowpart (Pmode, operands[3]);
- operands[4] = gen_lowpart (Pmode, operands[4]);
-}
- [(set_attr "type" "lea")
- (set_attr "mode" "SI")])
-
-(define_insn "*adddi_1_rex64"
- [(set (match_operand:DI 0 "nonimmediate_operand" "=r,rm,r,r")
- (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,r,r")
- (match_operand:DI 2 "x86_64_general_operand" "rme,re,0,le")))
+(define_insn "*add<mode>_1"
+ [(set (match_operand:SWI48 0 "nonimmediate_operand" "=r,rm,r,r")
+ (plus:SWI48
+ (match_operand:SWI48 1 "nonimmediate_operand" "%0,0,r,r")
+ (match_operand:SWI48 2 "<general_operand>" "<g>,r<i>,0,l<i>")))
(clobber (reg:CC FLAGS_REG))]
- "TARGET_64BIT && ix86_binary_operator_ok (PLUS, DImode, operands)"
+ "ix86_binary_operator_ok (PLUS, <MODE>mode, operands)"
{
switch (get_attr_type (insn))
{
case TYPE_LEA:
operands[2] = SET_SRC (XVECEXP (PATTERN (insn), 0, 0));
- return "lea{q}\t{%a2, %0|%0, %a2}";
+ return "lea{<imodesuffix>}\t{%a2, %0|%0, %a2}";
case TYPE_INCDEC:
gcc_assert (rtx_equal_p (operands[0], operands[1]));
if (operands[2] == const1_rtx)
- return "inc{q}\t%0";
+ return "inc{<imodesuffix>}\t%0";
else
{
gcc_assert (operands[2] == constm1_rtx);
- return "dec{q}\t%0";
+ return "dec{<imodesuffix>}\t%0";
}
default:
/* Use add as much as possible to replace lea for AGU optimization. */
if (which_alternative == 2 && TARGET_OPT_AGU)
- return "add{q}\t{%1, %0|%0, %1}";
+ return "add{<imodesuffix>}\t{%1, %0|%0, %1}";
gcc_assert (rtx_equal_p (operands[0], operands[1]));
- /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
+ /* Make things pretty and `subl $4,%eax' rather than `addl $-4,%eax'.
Exceptions: -128 encodes smaller than 128, so swap sign and op. */
if (CONST_INT_P (operands[2])
/* Avoid overflows. */
- && ((INTVAL (operands[2]) & ((((unsigned int) 1) << 31) - 1)))
+ && (<MODE>mode != DImode
+ || ((INTVAL (operands[2]) & ((((unsigned int) 1) << 31) - 1))))
&& (INTVAL (operands[2]) == 128
|| (INTVAL (operands[2]) < 0
&& INTVAL (operands[2]) != -128)))
{
operands[2] = GEN_INT (-INTVAL (operands[2]));
- return "sub{q}\t{%2, %0|%0, %2}";
+ return "sub{<imodesuffix>}\t{%2, %0|%0, %2}";
}
- return "add{q}\t{%2, %0|%0, %2}";
+ return "add{<imodesuffix>}\t{%2, %0|%0, %2}";
}
}
[(set (attr "type")
@@ -6521,9 +6305,9 @@
(const_string "lea")
; Current assemblers are broken and do not allow @GOTOFF in
; ought but a memory context.
- (match_operand:DI 2 "pic_symbolic_operand" "")
+ (match_operand:SWI48 2 "pic_symbolic_operand" "")
(const_string "lea")
- (match_operand:DI 2 "incdec_operand" "")
+ (match_operand:SWI48 2 "incdec_operand" "")
(const_string "incdec")
]
(const_string "alu")))
@@ -6532,122 +6316,104 @@
(and (eq_attr "type" "alu") (match_operand 2 "const128_operand" ""))
(const_string "1")
(const_string "*")))
- (set_attr "mode" "DI")])
+ (set_attr "mode" "<MODE>")])
-;; Convert lea to the lea pattern to avoid flags dependency.
-(define_split
- [(set (match_operand:DI 0 "register_operand" "")
- (plus:DI (match_operand:DI 1 "register_operand" "")
- (match_operand:DI 2 "x86_64_nonmemory_operand" "")))
- (clobber (reg:CC FLAGS_REG))]
- "TARGET_64BIT && reload_completed
- && ix86_lea_for_add_ok (PLUS, insn, operands)"
- [(set (match_dup 0)
- (plus:DI (match_dup 1)
- (match_dup 2)))]
- "")
+;; It may seem that nonimmediate operand is proper one for operand 1.
+;; The addsi_1 pattern allows nonimmediate operand at that place and
+;; we take care in ix86_binary_operator_ok to not allow two memory
+;; operands so proper swapping will be done in reload. This allow
+;; patterns constructed from addsi_1 to match.
-(define_insn "*adddi_2_rex64"
- [(set (reg FLAGS_REG)
- (compare
- (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
- (match_operand:DI 2 "x86_64_general_operand" "rme,re"))
- (const_int 0)))
- (set (match_operand:DI 0 "nonimmediate_operand" "=r,rm")
- (plus:DI (match_dup 1) (match_dup 2)))]
- "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode)
- && ix86_binary_operator_ok (PLUS, DImode, operands)
- /* Current assemblers are broken and do not allow @GOTOFF in
- ought but a memory context. */
- && ! pic_symbolic_operand (operands[2], VOIDmode)"
+(define_insn "*addsi_1_zext"
+ [(set (match_operand:DI 0 "register_operand" "=r,r")
+ (zero_extend:DI
+ (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,r")
+ (match_operand:SI 2 "general_operand" "g,li"))))
+ (clobber (reg:CC FLAGS_REG))]
+ "TARGET_64BIT && ix86_binary_operator_ok (PLUS, SImode, operands)"
{
switch (get_attr_type (insn))
{
+ case TYPE_LEA:
+ operands[2] = XEXP (SET_SRC (XVECEXP (PATTERN (insn), 0, 0)), 0);
+ return "lea{l}\t{%a2, %k0|%k0, %a2}";
+
case TYPE_INCDEC:
- gcc_assert (rtx_equal_p (operands[0], operands[1]));
if (operands[2] == const1_rtx)
- return "inc{q}\t%0";
+ return "inc{l}\t%k0";
else
{
gcc_assert (operands[2] == constm1_rtx);
- return "dec{q}\t%0";
+ return "dec{l}\t%k0";
}
default:
- gcc_assert (rtx_equal_p (operands[0], operands[1]));
- /* ???? We ought to handle there the 32bit case too
- - do we need new constraint? */
- /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
+ /* Make things pretty and `subl $4,%eax' rather than `addl $-4,%eax'.
Exceptions: -128 encodes smaller than 128, so swap sign and op. */
if (CONST_INT_P (operands[2])
- /* Avoid overflows. */
- && ((INTVAL (operands[2]) & ((((unsigned int) 1) << 31) - 1)))
&& (INTVAL (operands[2]) == 128
|| (INTVAL (operands[2]) < 0
&& INTVAL (operands[2]) != -128)))
{
operands[2] = GEN_INT (-INTVAL (operands[2]));
- return "sub{q}\t{%2, %0|%0, %2}";
+ return "sub{l}\t{%2, %k0|%k0, %2}";
}
- return "add{q}\t{%2, %0|%0, %2}";
+ return "add{l}\t{%2, %k0|%k0, %2}";
}
}
[(set (attr "type")
- (if_then_else (match_operand:DI 2 "incdec_operand" "")
- (const_string "incdec")
- (const_string "alu")))
+ (cond [(eq_attr "alternative" "1")
+ (const_string "lea")
+ ; Current assemblers are broken and do not allow @GOTOFF in
+ ; ought but a memory context.
+ (match_operand:SI 2 "pic_symbolic_operand" "")
+ (const_string "lea")
+ (match_operand:SI 2 "incdec_operand" "")
+ (const_string "incdec")
+ ]
+ (const_string "alu")))
(set (attr "length_immediate")
(if_then_else
(and (eq_attr "type" "alu") (match_operand 2 "const128_operand" ""))
(const_string "1")
(const_string "*")))
- (set_attr "mode" "DI")])
+ (set_attr "mode" "SI")])
-(define_insn "*adddi_3_rex64"
- [(set (reg FLAGS_REG)
- (compare (neg:DI (match_operand:DI 2 "x86_64_general_operand" "rme"))
- (match_operand:DI 1 "x86_64_general_operand" "%0")))
- (clobber (match_scratch:DI 0 "=r"))]
- "TARGET_64BIT
- && ix86_match_ccmode (insn, CCZmode)
- && !(MEM_P (operands[1]) && MEM_P (operands[2]))
- /* Current assemblers are broken and do not allow @GOTOFF in
- ought but a memory context. */
- && ! pic_symbolic_operand (operands[2], VOIDmode)"
+(define_insn "*addhi_1"
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,r")
+ (plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0")
+ (match_operand:HI 2 "general_operand" "rn,rm")))
+ (clobber (reg:CC FLAGS_REG))]
+ "TARGET_PARTIAL_REG_STALL
+ && ix86_binary_operator_ok (PLUS, HImode, operands)"
{
switch (get_attr_type (insn))
{
case TYPE_INCDEC:
- gcc_assert (rtx_equal_p (operands[0], operands[1]));
if (operands[2] == const1_rtx)
- return "inc{q}\t%0";
+ return "inc{w}\t%0";
else
{
gcc_assert (operands[2] == constm1_rtx);
- return "dec{q}\t%0";
+ return "dec{w}\t%0";
}
default:
- gcc_assert (rtx_equal_p (operands[0], operands[1]));
- /* ???? We ought to handle there the 32bit case too
- - do we need new constraint? */
- /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
+ /* Make things pretty and `subw $4,%ax' rather than `addw $-4,%ax'.
Exceptions: -128 encodes smaller than 128, so swap sign and op. */
if (CONST_INT_P (operands[2])
- /* Avoid overflows. */
- && ((INTVAL (operands[2]) & ((((unsigned int) 1) << 31) - 1)))
&& (INTVAL (operands[2]) == 128
|| (INTVAL (operands[2]) < 0
&& INTVAL (operands[2]) != -128)))
- {
- operands[2] = GEN_INT (-INTVAL (operands[2]));
- return "sub{q}\t{%2, %0|%0, %2}";
- }
- return "add{q}\t{%2, %0|%0, %2}";
+ {
+ operands[2] = GEN_INT (-INTVAL (operands[2]));
+ return "sub{w}\t{%2, %0|%0, %2}";
+ }
+ return "add{w}\t{%2, %0|%0, %2}";
}
}
[(set (attr "type")
- (if_then_else (match_operand:DI 2 "incdec_operand" "")
+ (if_then_else (match_operand:HI 2 "incdec_operand" "")
(const_string "incdec")
(const_string "alu")))
(set (attr "length_immediate")
@@ -6655,105 +6421,102 @@
(and (eq_attr "type" "alu") (match_operand 2 "const128_operand" ""))
(const_string "1")
(const_string "*")))
- (set_attr "mode" "DI")])
+ (set_attr "mode" "HI")])
-; For comparisons against 1, -1 and 128, we may generate better code
-; by converting cmp to add, inc or dec as done by peephole2. This pattern
-; is matched then. We can't accept general immediate, because for
-; case of overflows, the result is messed up.
-; This pattern also don't hold of 0x8000000000000000, since the value overflows
-; when negated.
-; Also carry flag is reversed compared to cmp, so this conversion is valid
-; only for comparisons not depending on it.
-(define_insn "*adddi_4_rex64"
- [(set (reg FLAGS_REG)
- (compare (match_operand:DI 1 "nonimmediate_operand" "0")
- (match_operand:DI 2 "x86_64_immediate_operand" "e")))
- (clobber (match_scratch:DI 0 "=rm"))]
- "TARGET_64BIT
- && ix86_match_ccmode (insn, CCGCmode)"
+;; %%% After Dave's SUBREG_BYTE stuff goes in, re-enable incb %ah
+;; type optimizations enabled by define-splits. This is not important
+;; for PII, and in fact harmful because of partial register stalls.
+
+(define_insn "*addhi_1_lea"
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,r,r")
+ (plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,r")
+ (match_operand:HI 2 "general_operand" "rn,rm,ln")))
+ (clobber (reg:CC FLAGS_REG))]
+ "!TARGET_PARTIAL_REG_STALL
+ && ix86_binary_operator_ok (PLUS, HImode, operands)"
{
switch (get_attr_type (insn))
{
+ case TYPE_LEA:
+ return "#";
case TYPE_INCDEC:
- if (operands[2] == constm1_rtx)
- return "inc{q}\t%0";
+ if (operands[2] == const1_rtx)
+ return "inc{w}\t%0";
else
- {
- gcc_assert (operands[2] == const1_rtx);
- return "dec{q}\t%0";
+ {
+ gcc_assert (operands[2] == constm1_rtx);
+ return "dec{w}\t%0";
}
default:
- gcc_assert (rtx_equal_p (operands[0], operands[1]));
- /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
+ /* Make things pretty and `subw $4,%ax' rather than `addw $-4,%ax'.
Exceptions: -128 encodes smaller than 128, so swap sign and op. */
- if ((INTVAL (operands[2]) == -128
- || (INTVAL (operands[2]) > 0
- && INTVAL (operands[2]) != 128))
- /* Avoid overflows. */
- && ((INTVAL (operands[2]) & ((((unsigned int) 1) << 31) - 1))))
- return "sub{q}\t{%2, %0|%0, %2}";
- operands[2] = GEN_INT (-INTVAL (operands[2]));
- return "add{q}\t{%2, %0|%0, %2}";
+ if (CONST_INT_P (operands[2])
+ && (INTVAL (operands[2]) == 128
+ || (INTVAL (operands[2]) < 0
+ && INTVAL (operands[2]) != -128)))
+ {
+ operands[2] = GEN_INT (-INTVAL (operands[2]));
+ return "sub{w}\t{%2, %0|%0, %2}";
+ }
+ return "add{w}\t{%2, %0|%0, %2}";
}
}
[(set (attr "type")
- (if_then_else (match_operand:DI 2 "incdec_operand" "")
- (const_string "incdec")
- (const_string "alu")))
+ (if_then_else (eq_attr "alternative" "2")
+ (const_string "lea")
+ (if_then_else (match_operand:HI 2 "incdec_operand" "")
+ (const_string "incdec")
+ (const_string "alu"))))
(set (attr "length_immediate")
(if_then_else
(and (eq_attr "type" "alu") (match_operand 2 "const128_operand" ""))
(const_string "1")
(const_string "*")))
- (set_attr "mode" "DI")])
+ (set_attr "mode" "HI,HI,SI")])
-(define_insn "*adddi_5_rex64"
- [(set (reg FLAGS_REG)
- (compare
- (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0")
- (match_operand:DI 2 "x86_64_general_operand" "rme"))
- (const_int 0)))
- (clobber (match_scratch:DI 0 "=r"))]
- "TARGET_64BIT
- && ix86_match_ccmode (insn, CCGOCmode)
- && !(MEM_P (operands[1]) && MEM_P (operands[2]))
- /* Current assemblers are broken and do not allow @GOTOFF in
- ought but a memory context. */
- && ! pic_symbolic_operand (operands[2], VOIDmode)"
+(define_insn "*addqi_1"
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=qm,q,r")
+ (plus:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0")
+ (match_operand:QI 2 "general_operand" "qn,qmn,rn")))
+ (clobber (reg:CC FLAGS_REG))]
+ "TARGET_PARTIAL_REG_STALL
+ && ix86_binary_operator_ok (PLUS, QImode, operands)"
{
+ int widen = (which_alternative == 2);
switch (get_attr_type (insn))
{
case TYPE_INCDEC:
- gcc_assert (rtx_equal_p (operands[0], operands[1]));
if (operands[2] == const1_rtx)
- return "inc{q}\t%0";
+ return widen ? "inc{l}\t%k0" : "inc{b}\t%0";
else
- {
- gcc_assert (operands[2] == constm1_rtx);
- return "dec{q}\t%0";
+ {
+ gcc_assert (operands[2] == constm1_rtx);
+ return widen ? "dec{l}\t%k0" : "dec{b}\t%0";
}
default:
- gcc_assert (rtx_equal_p (operands[0], operands[1]));
- /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
+ /* Make things pretty and `subb $4,%al' rather than `addb $-4,%al'.
Exceptions: -128 encodes smaller than 128, so swap sign and op. */
if (CONST_INT_P (operands[2])
- /* Avoid overflows. */
- && ((INTVAL (operands[2]) & ((((unsigned int) 1) << 31) - 1)))
&& (INTVAL (operands[2]) == 128
|| (INTVAL (operands[2]) < 0
&& INTVAL (operands[2]) != -128)))
- {
- operands[2] = GEN_INT (-INTVAL (operands[2]));
- return "sub{q}\t{%2, %0|%0, %2}";
- }
- return "add{q}\t{%2, %0|%0, %2}";
+ {
+ operands[2] = GEN_INT (-INTVAL (operands[2]));
+ if (widen)
+ return "sub{l}\t{%2, %k0|%k0, %2}";
+ else
+ return "sub{b}\t{%2, %0|%0, %2}";
+ }
+ if (widen)
+ return "add{l}\t{%k2, %k0|%k0, %k2}";
+ else
+ return "add{b}\t{%2, %0|%0, %2}";
}
}
[(set (attr "type")
- (if_then_else (match_operand:DI 2 "incdec_operand" "")
+ (if_then_else (match_operand:QI 2 "incdec_operand" "")
(const_string "incdec")
(const_string "alu")))
(set (attr "length_immediate")
@@ -6761,184 +6524,115 @@
(and (eq_attr "type" "alu") (match_operand 2 "const128_operand" ""))
(const_string "1")
(const_string "*")))
- (set_attr "mode" "DI")])
-
+ (set_attr "mode" "QI,QI,SI")])
-(define_insn "*addsi_1"
- [(set (match_operand:SI 0 "nonimmediate_operand" "=r,rm,r,r")
- (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,r,r")
- (match_operand:SI 2 "general_operand" "g,ri,0,li")))
+;; %%% Potential partial reg stall on alternative 2. What to do?
+(define_insn "*addqi_1_lea"
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=qm,q,r,r")
+ (plus:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0,r")
+ (match_operand:QI 2 "general_operand" "qn,qmn,rn,ln")))
(clobber (reg:CC FLAGS_REG))]
- "ix86_binary_operator_ok (PLUS, SImode, operands)"
+ "!TARGET_PARTIAL_REG_STALL
+ && ix86_binary_operator_ok (PLUS, QImode, operands)"
{
+ int widen = (which_alternative == 2);
switch (get_attr_type (insn))
{
case TYPE_LEA:
- operands[2] = SET_SRC (XVECEXP (PATTERN (insn), 0, 0));
- return "lea{l}\t{%a2, %0|%0, %a2}";
-
+ return "#";
case TYPE_INCDEC:
- gcc_assert (rtx_equal_p (operands[0], operands[1]));
if (operands[2] == const1_rtx)
- return "inc{l}\t%0";
+ return widen ? "inc{l}\t%k0" : "inc{b}\t%0";
else
{
- gcc_assert (operands[2] == constm1_rtx);
- return "dec{l}\t%0";
+ gcc_assert (operands[2] == constm1_rtx);
+ return widen ? "dec{l}\t%k0" : "dec{b}\t%0";
}
default:
- /* Use add as much as possible to replace lea for AGU optimization. */
- if (which_alternative == 2 && TARGET_OPT_AGU)
- return "add{l}\t{%1, %0|%0, %1}";
-
- gcc_assert (rtx_equal_p (operands[0], operands[1]));
-
- /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
+ /* Make things pretty and `subb $4,%al' rather than `addb $-4,%al'.
Exceptions: -128 encodes smaller than 128, so swap sign and op. */
if (CONST_INT_P (operands[2])
&& (INTVAL (operands[2]) == 128
|| (INTVAL (operands[2]) < 0
&& INTVAL (operands[2]) != -128)))
- {
- operands[2] = GEN_INT (-INTVAL (operands[2]));
- return "sub{l}\t{%2, %0|%0, %2}";
- }
- return "add{l}\t{%2, %0|%0, %2}";
+ {
+ operands[2] = GEN_INT (-INTVAL (operands[2]));
+ if (widen)
+ return "sub{l}\t{%2, %k0|%k0, %2}";
+ else
+ return "sub{b}\t{%2, %0|%0, %2}";
+ }
+ if (widen)
+ return "add{l}\t{%k2, %k0|%k0, %k2}";
+ else
+ return "add{b}\t{%2, %0|%0, %2}";
}
}
[(set (attr "type")
- (cond [(and (eq_attr "alternative" "2")
- (eq (symbol_ref "TARGET_OPT_AGU") (const_int 0)))
- (const_string "lea")
- (eq_attr "alternative" "3")
- (const_string "lea")
- ; Current assemblers are broken and do not allow @GOTOFF in
- ; ought but a memory context.
- (match_operand:SI 2 "pic_symbolic_operand" "")
- (const_string "lea")
- (match_operand:SI 2 "incdec_operand" "")
- (const_string "incdec")
- ]
- (const_string "alu")))
+ (if_then_else (eq_attr "alternative" "3")
+ (const_string "lea")
+ (if_then_else (match_operand:QI 2 "incdec_operand" "")
+ (const_string "incdec")
+ (const_string "alu"))))
(set (attr "length_immediate")
(if_then_else
(and (eq_attr "type" "alu") (match_operand 2 "const128_operand" ""))
(const_string "1")
(const_string "*")))
- (set_attr "mode" "SI")])
-
-;; Convert lea to the lea pattern to avoid flags dependency.
-(define_split
- [(set (match_operand 0 "register_operand" "")
- (plus (match_operand 1 "register_operand" "")
- (match_operand 2 "nonmemory_operand" "")))
- (clobber (reg:CC FLAGS_REG))]
- "reload_completed && ix86_lea_for_add_ok (PLUS, insn, operands)"
- [(const_int 0)]
-{
- rtx pat;
- /* In -fPIC mode the constructs like (const (unspec [symbol_ref]))
- may confuse gen_lowpart. */
- if (GET_MODE (operands[0]) != Pmode)
- {
- operands[1] = gen_lowpart (Pmode, operands[1]);
- operands[2] = gen_lowpart (Pmode, operands[2]);
- }
- operands[0] = gen_lowpart (SImode, operands[0]);
- pat = gen_rtx_PLUS (Pmode, operands[1], operands[2]);
- if (Pmode != SImode)
- pat = gen_rtx_SUBREG (SImode, pat, 0);
- emit_insn (gen_rtx_SET (VOIDmode, operands[0], pat));
- DONE;
-})
+ (set_attr "mode" "QI,QI,SI,SI")])
-;; It may seem that nonimmediate operand is proper one for operand 1.
-;; The addsi_1 pattern allows nonimmediate operand at that place and
-;; we take care in ix86_binary_operator_ok to not allow two memory
-;; operands so proper swapping will be done in reload. This allow
-;; patterns constructed from addsi_1 to match.
-(define_insn "addsi_1_zext"
- [(set (match_operand:DI 0 "register_operand" "=r,r")
- (zero_extend:DI
- (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,r")
- (match_operand:SI 2 "general_operand" "g,li"))))
+(define_insn "*addqi_1_slp"
+ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm,q"))
+ (plus:QI (match_dup 0)
+ (match_operand:QI 1 "general_operand" "qn,qnm")))
(clobber (reg:CC FLAGS_REG))]
- "TARGET_64BIT && ix86_binary_operator_ok (PLUS, SImode, operands)"
+ "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
+ && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
{
switch (get_attr_type (insn))
{
- case TYPE_LEA:
- operands[2] = SET_SRC (XVECEXP (PATTERN (insn), 0, 0));
- return "lea{l}\t{%a2, %k0|%k0, %a2}";
-
case TYPE_INCDEC:
- if (operands[2] == const1_rtx)
- return "inc{l}\t%k0";
+ if (operands[1] == const1_rtx)
+ return "inc{b}\t%0";
else
- {
- gcc_assert (operands[2] == constm1_rtx);
- return "dec{l}\t%k0";
+ {
+ gcc_assert (operands[1] == constm1_rtx);
+ return "dec{b}\t%0";
}
default:
- /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
- Exceptions: -128 encodes smaller than 128, so swap sign and op. */
- if (CONST_INT_P (operands[2])
- && (INTVAL (operands[2]) == 128
- || (INTVAL (operands[2]) < 0
- && INTVAL (operands[2]) != -128)))
- {
- operands[2] = GEN_INT (-INTVAL (operands[2]));
- return "sub{l}\t{%2, %k0|%k0, %2}";
- }
- return "add{l}\t{%2, %k0|%k0, %2}";
+ /* Make things pretty and `subb $4,%al' rather than `addb $-4,%al'. */
+ if (CONST_INT_P (operands[1])
+ && INTVAL (operands[1]) < 0)
+ {
+ operands[1] = GEN_INT (-INTVAL (operands[1]));
+ return "sub{b}\t{%1, %0|%0, %1}";
+ }
+ return "add{b}\t{%1, %0|%0, %1}";
}
}
[(set (attr "type")
- (cond [(eq_attr "alternative" "1")
- (const_string "lea")
- ; Current assemblers are broken and do not allow @GOTOFF in
- ; ought but a memory context.
- (match_operand:SI 2 "pic_symbolic_operand" "")
- (const_string "lea")
- (match_operand:SI 2 "incdec_operand" "")
- (const_string "incdec")
- ]
- (const_string "alu")))
- (set (attr "length_immediate")
- (if_then_else
- (and (eq_attr "type" "alu") (match_operand 2 "const128_operand" ""))
- (const_string "1")
- (const_string "*")))
- (set_attr "mode" "SI")])
-
-;; Convert lea to the lea pattern to avoid flags dependency.
-(define_split
- [(set (match_operand:DI 0 "register_operand" "")
- (zero_extend:DI
- (plus:SI (match_operand:SI 1 "register_operand" "")
- (match_operand:SI 2 "nonmemory_operand" ""))))
- (clobber (reg:CC FLAGS_REG))]
- "TARGET_64BIT && reload_completed
- && true_regnum (operands[0]) != true_regnum (operands[1])"
- [(set (match_dup 0)
- (zero_extend:DI (subreg:SI (plus:DI (match_dup 1) (match_dup 2)) 0)))]
-{
- operands[1] = gen_lowpart (Pmode, operands[1]);
- operands[2] = gen_lowpart (Pmode, operands[2]);
-})
+ (if_then_else (match_operand:QI 1 "incdec_operand" "")
+ (const_string "incdec")
+ (const_string "alu1")))
+ (set (attr "memory")
+ (if_then_else (match_operand 1 "memory_operand" "")
+ (const_string "load")
+ (const_string "none")))
+ (set_attr "mode" "QI")])
-(define_insn "*addsi_2"
+(define_insn "*add<mode>_2"
[(set (reg FLAGS_REG)
(compare
- (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0")
- (match_operand:SI 2 "general_operand" "g,ri"))
+ (plus:SWI48
+ (match_operand:SWI48 1 "nonimmediate_operand" "%0,0")
+ (match_operand:SWI48 2 "<general_operand>" "<g>,r<i>"))
(const_int 0)))
- (set (match_operand:SI 0 "nonimmediate_operand" "=r,rm")
- (plus:SI (match_dup 1) (match_dup 2)))]
+ (set (match_operand:SWI48 0 "nonimmediate_operand" "=r,rm")
+ (plus:SWI48 (match_dup 1) (match_dup 2)))]
"ix86_match_ccmode (insn, CCGOCmode)
- && ix86_binary_operator_ok (PLUS, SImode, operands)
+ && ix86_binary_operator_ok (PLUS, <MODE>mode, operands)
/* Current assemblers are broken and do not allow @GOTOFF in
ought but a memory context. */
&& ! pic_symbolic_operand (operands[2], VOIDmode)"
@@ -6948,30 +6642,35 @@
case TYPE_INCDEC:
gcc_assert (rtx_equal_p (operands[0], operands[1]));
if (operands[2] == const1_rtx)
- return "inc{l}\t%0";
+ return "inc{<imodesuffix>}\t%0";
else
{
gcc_assert (operands[2] == constm1_rtx);
- return "dec{l}\t%0";
+ return "dec{<imodesuffix>}\t%0";
}
default:
gcc_assert (rtx_equal_p (operands[0], operands[1]));
- /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
+ /* ???? In DImode, we ought to handle there the 32bit case too
+ - do we need new constraint? */
+ /* Make things pretty and `subl $4,%eax' rather than `addl $-4,%eax'.
Exceptions: -128 encodes smaller than 128, so swap sign and op. */
if (CONST_INT_P (operands[2])
+ /* Avoid overflows. */
+ && (<MODE>mode != DImode
+ || ((INTVAL (operands[2]) & ((((unsigned int) 1) << 31) - 1))))
&& (INTVAL (operands[2]) == 128
|| (INTVAL (operands[2]) < 0
&& INTVAL (operands[2]) != -128)))
{
operands[2] = GEN_INT (-INTVAL (operands[2]));
- return "sub{l}\t{%2, %0|%0, %2}";
+ return "sub{<imodesuffix>}\t{%2, %0|%0, %2}";
}
- return "add{l}\t{%2, %0|%0, %2}";
+ return "add{<imodesuffix>}\t{%2, %0|%0, %2}";
}
}
[(set (attr "type")
- (if_then_else (match_operand:SI 2 "incdec_operand" "")
+ (if_then_else (match_operand:SWI48 2 "incdec_operand" "")
(const_string "incdec")
(const_string "alu")))
(set (attr "length_immediate")
@@ -6979,7 +6678,7 @@
(and (eq_attr "type" "alu") (match_operand 2 "const128_operand" ""))
(const_string "1")
(const_string "*")))
- (set_attr "mode" "SI")])
+ (set_attr "mode" "<MODE>")])
;; See comment for addsi_1_zext why we do use nonimmediate_operand
(define_insn "*addsi_2_zext"
@@ -7008,7 +6707,7 @@
}
default:
- /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
+ /* Make things pretty and `subl $4,%eax' rather than `addl $-4,%eax'.
Exceptions: -128 encodes smaller than 128, so swap sign and op. */
if (CONST_INT_P (operands[2])
&& (INTVAL (operands[2]) == 128
@@ -7032,46 +6731,44 @@
(const_string "*")))
(set_attr "mode" "SI")])
-(define_insn "*addsi_3"
+(define_insn "*addhi_2"
[(set (reg FLAGS_REG)
- (compare (neg:SI (match_operand:SI 2 "general_operand" "g"))
- (match_operand:SI 1 "nonimmediate_operand" "%0")))
- (clobber (match_scratch:SI 0 "=r"))]
- "ix86_match_ccmode (insn, CCZmode)
- && !(MEM_P (operands[1]) && MEM_P (operands[2]))
- /* Current assemblers are broken and do not allow @GOTOFF in
- ought but a memory context. */
- && ! pic_symbolic_operand (operands[2], VOIDmode)"
+ (compare
+ (plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0")
+ (match_operand:HI 2 "general_operand" "rmn,rn"))
+ (const_int 0)))
+ (set (match_operand:HI 0 "nonimmediate_operand" "=r,rm")
+ (plus:HI (match_dup 1) (match_dup 2)))]
+ "ix86_match_ccmode (insn, CCGOCmode)
+ && ix86_binary_operator_ok (PLUS, HImode, operands)"
{
switch (get_attr_type (insn))
{
case TYPE_INCDEC:
- gcc_assert (rtx_equal_p (operands[0], operands[1]));
if (operands[2] == const1_rtx)
- return "inc{l}\t%0";
+ return "inc{w}\t%0";
else
{
gcc_assert (operands[2] == constm1_rtx);
- return "dec{l}\t%0";
+ return "dec{w}\t%0";
}
default:
- gcc_assert (rtx_equal_p (operands[0], operands[1]));
- /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
+ /* Make things pretty and `subw $4,%ax' rather than `addw $-4,%ax'.
Exceptions: -128 encodes smaller than 128, so swap sign and op. */
if (CONST_INT_P (operands[2])
&& (INTVAL (operands[2]) == 128
|| (INTVAL (operands[2]) < 0
&& INTVAL (operands[2]) != -128)))
- {
- operands[2] = GEN_INT (-INTVAL (operands[2]));
- return "sub{l}\t{%2, %0|%0, %2}";
- }
- return "add{l}\t{%2, %0|%0, %2}";
+ {
+ operands[2] = GEN_INT (-INTVAL (operands[2]));
+ return "sub{w}\t{%2, %0|%0, %2}";
+ }
+ return "add{w}\t{%2, %0|%0, %2}";
}
}
[(set (attr "type")
- (if_then_else (match_operand:SI 2 "incdec_operand" "")
+ (if_then_else (match_operand:HI 2 "incdec_operand" "")
(const_string "incdec")
(const_string "alu")))
(set (attr "length_immediate")
@@ -7079,98 +6776,95 @@
(and (eq_attr "type" "alu") (match_operand 2 "const128_operand" ""))
(const_string "1")
(const_string "*")))
- (set_attr "mode" "SI")])
+ (set_attr "mode" "HI")])
-;; See comment for addsi_1_zext why we do use nonimmediate_operand
-(define_insn "*addsi_3_zext"
+(define_insn "*addqi_2"
[(set (reg FLAGS_REG)
- (compare (neg:SI (match_operand:SI 2 "general_operand" "g"))
- (match_operand:SI 1 "nonimmediate_operand" "%0")))
- (set (match_operand:DI 0 "register_operand" "=r")
- (zero_extend:DI (plus:SI (match_dup 1) (match_dup 2))))]
- "TARGET_64BIT && ix86_match_ccmode (insn, CCZmode)
- && ix86_binary_operator_ok (PLUS, SImode, operands)
- /* Current assemblers are broken and do not allow @GOTOFF in
- ought but a memory context. */
- && ! pic_symbolic_operand (operands[2], VOIDmode)"
+ (compare
+ (plus:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0")
+ (match_operand:QI 2 "general_operand" "qmn,qn"))
+ (const_int 0)))
+ (set (match_operand:QI 0 "nonimmediate_operand" "=q,qm")
+ (plus:QI (match_dup 1) (match_dup 2)))]
+ "ix86_match_ccmode (insn, CCGOCmode)
+ && ix86_binary_operator_ok (PLUS, QImode, operands)"
{
switch (get_attr_type (insn))
{
case TYPE_INCDEC:
if (operands[2] == const1_rtx)
- return "inc{l}\t%k0";
+ return "inc{b}\t%0";
else
{
- gcc_assert (operands[2] == constm1_rtx);
- return "dec{l}\t%k0";
+ gcc_assert (operands[2] == constm1_rtx
+ || (CONST_INT_P (operands[2])
+ && INTVAL (operands[2]) == 255));
+ return "dec{b}\t%0";
}
default:
- /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
- Exceptions: -128 encodes smaller than 128, so swap sign and op. */
+ /* Make things pretty and `subb $4,%al' rather than `addb $-4,%al'. */
if (CONST_INT_P (operands[2])
- && (INTVAL (operands[2]) == 128
- || (INTVAL (operands[2]) < 0
- && INTVAL (operands[2]) != -128)))
- {
- operands[2] = GEN_INT (-INTVAL (operands[2]));
- return "sub{l}\t{%2, %k0|%k0, %2}";
- }
- return "add{l}\t{%2, %k0|%k0, %2}";
+ && INTVAL (operands[2]) < 0)
+ {
+ operands[2] = GEN_INT (-INTVAL (operands[2]));
+ return "sub{b}\t{%2, %0|%0, %2}";
+ }
+ return "add{b}\t{%2, %0|%0, %2}";
}
}
[(set (attr "type")
- (if_then_else (match_operand:SI 2 "incdec_operand" "")
+ (if_then_else (match_operand:QI 2 "incdec_operand" "")
(const_string "incdec")
(const_string "alu")))
- (set (attr "length_immediate")
- (if_then_else
- (and (eq_attr "type" "alu") (match_operand 2 "const128_operand" ""))
- (const_string "1")
- (const_string "*")))
- (set_attr "mode" "SI")])
+ (set_attr "mode" "QI")])
-; For comparisons against 1, -1 and 128, we may generate better code
-; by converting cmp to add, inc or dec as done by peephole2. This pattern
-; is matched then. We can't accept general immediate, because for
-; case of overflows, the result is messed up.
-; This pattern also don't hold of 0x80000000, since the value overflows
-; when negated.
-; Also carry flag is reversed compared to cmp, so this conversion is valid
-; only for comparisons not depending on it.
-(define_insn "*addsi_4"
+(define_insn "*add<mode>_3"
[(set (reg FLAGS_REG)
- (compare (match_operand:SI 1 "nonimmediate_operand" "0")
- (match_operand:SI 2 "const_int_operand" "n")))
- (clobber (match_scratch:SI 0 "=rm"))]
- "ix86_match_ccmode (insn, CCGCmode)
- && (INTVAL (operands[2]) & 0xffffffff) != 0x80000000"
+ (compare
+ (neg:SWI48 (match_operand:SWI48 2 "<general_operand>" "<g>"))
+ (match_operand:SWI48 1 "nonimmediate_operand" "%0")))
+ (clobber (match_scratch:SWI48 0 "=r"))]
+ "ix86_match_ccmode (insn, CCZmode)
+ && !(MEM_P (operands[1]) && MEM_P (operands[2]))
+ /* Current assemblers are broken and do not allow @GOTOFF in
+ ought but a memory context. */
+ && ! pic_symbolic_operand (operands[2], VOIDmode)"
{
switch (get_attr_type (insn))
{
case TYPE_INCDEC:
- if (operands[2] == constm1_rtx)
- return "inc{l}\t%0";
+ gcc_assert (rtx_equal_p (operands[0], operands[1]));
+ if (operands[2] == const1_rtx)
+ return "inc{<imodesuffix>}\t%0";
else
{
- gcc_assert (operands[2] == const1_rtx);
- return "dec{l}\t%0";
+ gcc_assert (operands[2] == constm1_rtx);
+ return "dec{<imodesuffix>}\t%0";
}
default:
gcc_assert (rtx_equal_p (operands[0], operands[1]));
+ /* ???? In DImode, we ought to handle there the 32bit case too
+ - do we need new constraint? */
/* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
Exceptions: -128 encodes smaller than 128, so swap sign and op. */
- if ((INTVAL (operands[2]) == -128
- || (INTVAL (operands[2]) > 0
- && INTVAL (operands[2]) != 128)))
- return "sub{l}\t{%2, %0|%0, %2}";
- operands[2] = GEN_INT (-INTVAL (operands[2]));
- return "add{l}\t{%2, %0|%0, %2}";
+ if (CONST_INT_P (operands[2])
+ /* Avoid overflows. */
+ && (<MODE>mode != DImode
+ || ((INTVAL (operands[2]) & ((((unsigned int) 1) << 31) - 1))))
+ && (INTVAL (operands[2]) == 128
+ || (INTVAL (operands[2]) < 0
+ && INTVAL (operands[2]) != -128)))
+ {
+ operands[2] = GEN_INT (-INTVAL (operands[2]));
+ return "sub{<imodesuffix>}\t{%2, %0|%0, %2}";
+ }
+ return "add{<imodesuffix>}\t{%2, %0|%0, %2}";
}
}
[(set (attr "type")
- (if_then_else (match_operand:SI 2 "incdec_operand" "")
+ (if_then_else (match_operand:SWI48 2 "incdec_operand" "")
(const_string "incdec")
(const_string "alu")))
(set (attr "length_immediate")
@@ -7178,17 +6872,18 @@
(and (eq_attr "type" "alu") (match_operand 2 "const128_operand" ""))
(const_string "1")
(const_string "*")))
- (set_attr "mode" "SI")])
+ (set_attr "mode" "<MODE>")])
-(define_insn "*addsi_5"
+;; See comment for addsi_1_zext why we do use nonimmediate_operand
+(define_insn "*addsi_3_zext"
[(set (reg FLAGS_REG)
(compare
- (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0")
- (match_operand:SI 2 "general_operand" "g"))
- (const_int 0)))
- (clobber (match_scratch:SI 0 "=r"))]
- "ix86_match_ccmode (insn, CCGOCmode)
- && !(MEM_P (operands[1]) && MEM_P (operands[2]))
+ (neg:SI (match_operand:SI 2 "general_operand" "g"))
+ (match_operand:SI 1 "nonimmediate_operand" "%0")))
+ (set (match_operand:DI 0 "register_operand" "=r")
+ (zero_extend:DI (plus:SI (match_dup 1) (match_dup 2))))]
+ "TARGET_64BIT && ix86_match_ccmode (insn, CCZmode)
+ && ix86_binary_operator_ok (PLUS, SImode, operands)
/* Current assemblers are broken and do not allow @GOTOFF in
ought but a memory context. */
&& ! pic_symbolic_operand (operands[2], VOIDmode)"
@@ -7196,18 +6891,16 @@
switch (get_attr_type (insn))
{
case TYPE_INCDEC:
- gcc_assert (rtx_equal_p (operands[0], operands[1]));
if (operands[2] == const1_rtx)
- return "inc{l}\t%0";
+ return "inc{l}\t%k0";
else
{
gcc_assert (operands[2] == constm1_rtx);
- return "dec{l}\t%0";
+ return "dec{l}\t%k0";
}
default:
- gcc_assert (rtx_equal_p (operands[0], operands[1]));
- /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
+ /* Make things pretty and `subl $4,%eax' rather than `addl $-4,%eax'.
Exceptions: -128 encodes smaller than 128, so swap sign and op. */
if (CONST_INT_P (operands[2])
&& (INTVAL (operands[2]) == 128
@@ -7215,9 +6908,9 @@
&& INTVAL (operands[2]) != -128)))
{
operands[2] = GEN_INT (-INTVAL (operands[2]));
- return "sub{l}\t{%2, %0|%0, %2}";
+ return "sub{l}\t{%2, %k0|%k0, %2}";
}
- return "add{l}\t{%2, %0|%0, %2}";
+ return "add{l}\t{%2, %k0|%k0, %2}";
}
}
[(set (attr "type")
@@ -7231,40 +6924,28 @@
(const_string "*")))
(set_attr "mode" "SI")])
-(define_expand "addhi3"
- [(set (match_operand:HI 0 "nonimmediate_operand" "")
- (plus:HI (match_operand:HI 1 "nonimmediate_operand" "")
- (match_operand:HI 2 "general_operand" "")))]
- "TARGET_HIMODE_MATH"
- "ix86_expand_binary_operator (PLUS, HImode, operands); DONE;")
-
-;; %%% After Dave's SUBREG_BYTE stuff goes in, re-enable incb %ah
-;; type optimizations enabled by define-splits. This is not important
-;; for PII, and in fact harmful because of partial register stalls.
-
-(define_insn "*addhi_1_lea"
- [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,r,r")
- (plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,r")
- (match_operand:HI 2 "general_operand" "rn,rm,ln")))
- (clobber (reg:CC FLAGS_REG))]
- "!TARGET_PARTIAL_REG_STALL
- && ix86_binary_operator_ok (PLUS, HImode, operands)"
+(define_insn "*addhi_3"
+ [(set (reg FLAGS_REG)
+ (compare
+ (neg:HI (match_operand:HI 2 "general_operand" "rmn"))
+ (match_operand:HI 1 "nonimmediate_operand" "%0")))
+ (clobber (match_scratch:HI 0 "=r"))]
+ "ix86_match_ccmode (insn, CCZmode)
+ && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
{
switch (get_attr_type (insn))
{
- case TYPE_LEA:
- return "#";
case TYPE_INCDEC:
if (operands[2] == const1_rtx)
return "inc{w}\t%0";
else
- {
+ {
gcc_assert (operands[2] == constm1_rtx);
return "dec{w}\t%0";
}
default:
- /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
+ /* Make things pretty and `subw $4,%ax' rather than `addw $-4,%ax'.
Exceptions: -128 encodes smaller than 128, so swap sign and op. */
if (CONST_INT_P (operands[2])
&& (INTVAL (operands[2]) == 128
@@ -7278,100 +6959,100 @@
}
}
[(set (attr "type")
- (if_then_else (eq_attr "alternative" "2")
- (const_string "lea")
- (if_then_else (match_operand:HI 2 "incdec_operand" "")
- (const_string "incdec")
- (const_string "alu"))))
+ (if_then_else (match_operand:HI 2 "incdec_operand" "")
+ (const_string "incdec")
+ (const_string "alu")))
(set (attr "length_immediate")
(if_then_else
(and (eq_attr "type" "alu") (match_operand 2 "const128_operand" ""))
(const_string "1")
(const_string "*")))
- (set_attr "mode" "HI,HI,SI")])
+ (set_attr "mode" "HI")])
-(define_insn "*addhi_1"
- [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,r")
- (plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0")
- (match_operand:HI 2 "general_operand" "rn,rm")))
- (clobber (reg:CC FLAGS_REG))]
- "TARGET_PARTIAL_REG_STALL
- && ix86_binary_operator_ok (PLUS, HImode, operands)"
+(define_insn "*addqi_3"
+ [(set (reg FLAGS_REG)
+ (compare
+ (neg:QI (match_operand:QI 2 "general_operand" "qmn"))
+ (match_operand:QI 1 "nonimmediate_operand" "%0")))
+ (clobber (match_scratch:QI 0 "=q"))]
+ "ix86_match_ccmode (insn, CCZmode)
+ && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
{
switch (get_attr_type (insn))
{
case TYPE_INCDEC:
if (operands[2] == const1_rtx)
- return "inc{w}\t%0";
+ return "inc{b}\t%0";
else
{
- gcc_assert (operands[2] == constm1_rtx);
- return "dec{w}\t%0";
+ gcc_assert (operands[2] == constm1_rtx
+ || (CONST_INT_P (operands[2])
+ && INTVAL (operands[2]) == 255));
+ return "dec{b}\t%0";
}
default:
- /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
- Exceptions: -128 encodes smaller than 128, so swap sign and op. */
+ /* Make things pretty and `subb $4,%al' rather than `addb $-4,%al'. */
if (CONST_INT_P (operands[2])
- && (INTVAL (operands[2]) == 128
- || (INTVAL (operands[2]) < 0
- && INTVAL (operands[2]) != -128)))
+ && INTVAL (operands[2]) < 0)
{
operands[2] = GEN_INT (-INTVAL (operands[2]));
- return "sub{w}\t{%2, %0|%0, %2}";
+ return "sub{b}\t{%2, %0|%0, %2}";
}
- return "add{w}\t{%2, %0|%0, %2}";
+ return "add{b}\t{%2, %0|%0, %2}";
}
}
[(set (attr "type")
- (if_then_else (match_operand:HI 2 "incdec_operand" "")
+ (if_then_else (match_operand:QI 2 "incdec_operand" "")
(const_string "incdec")
(const_string "alu")))
- (set (attr "length_immediate")
- (if_then_else
- (and (eq_attr "type" "alu") (match_operand 2 "const128_operand" ""))
- (const_string "1")
- (const_string "*")))
- (set_attr "mode" "HI")])
+ (set_attr "mode" "QI")])
-(define_insn "*addhi_2"
+; For comparisons against 1, -1 and 128, we may generate better code
+; by converting cmp to add, inc or dec as done by peephole2. This pattern
+; is matched then. We can't accept general immediate, because for
+; case of overflows, the result is messed up.
+; This pattern also don't hold of 0x8000000000000000, since the value
+; overflows when negated.
+; Also carry flag is reversed compared to cmp, so this conversion is valid
+; only for comparisons not depending on it.
+
+(define_insn "*adddi_4"
[(set (reg FLAGS_REG)
(compare
- (plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0")
- (match_operand:HI 2 "general_operand" "rmn,rn"))
- (const_int 0)))
- (set (match_operand:HI 0 "nonimmediate_operand" "=r,rm")
- (plus:HI (match_dup 1) (match_dup 2)))]
- "ix86_match_ccmode (insn, CCGOCmode)
- && ix86_binary_operator_ok (PLUS, HImode, operands)"
+ (match_operand:DI 1 "nonimmediate_operand" "0")
+ (match_operand:DI 2 "x86_64_immediate_operand" "e")))
+ (clobber (match_scratch:DI 0 "=rm"))]
+ "TARGET_64BIT
+ && ix86_match_ccmode (insn, CCGCmode)"
{
switch (get_attr_type (insn))
{
case TYPE_INCDEC:
- if (operands[2] == const1_rtx)
- return "inc{w}\t%0";
+ if (operands[2] == constm1_rtx)
+ return "inc{q}\t%0";
else
{
- gcc_assert (operands[2] == constm1_rtx);
- return "dec{w}\t%0";
+ gcc_assert (operands[2] == const1_rtx);
+ return "dec{q}\t%0";
}
default:
- /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
+ gcc_assert (rtx_equal_p (operands[0], operands[1]));
+ /* Make things pretty and `subl $4,%eax' rather than `addl $-4,%eax'.
Exceptions: -128 encodes smaller than 128, so swap sign and op. */
- if (CONST_INT_P (operands[2])
- && (INTVAL (operands[2]) == 128
- || (INTVAL (operands[2]) < 0
- && INTVAL (operands[2]) != -128)))
- {
- operands[2] = GEN_INT (-INTVAL (operands[2]));
- return "sub{w}\t{%2, %0|%0, %2}";
- }
- return "add{w}\t{%2, %0|%0, %2}";
+ if ((INTVAL (operands[2]) == -128
+ || (INTVAL (operands[2]) > 0
+ && INTVAL (operands[2]) != 128))
+ /* Avoid overflows. */
+ && ((INTVAL (operands[2]) & ((((unsigned int) 1) << 31) - 1))))
+ return "sub{q}\t{%2, %0|%0, %2}";
+ operands[2] = GEN_INT (-INTVAL (operands[2]));
+ return "add{q}\t{%2, %0|%0, %2}";
}
}
[(set (attr "type")
- (if_then_else (match_operand:HI 2 "incdec_operand" "")
+ (if_then_else (match_operand:DI 2 "incdec_operand" "")
(const_string "incdec")
(const_string "alu")))
(set (attr "length_immediate")
@@ -7379,43 +7060,51 @@
(and (eq_attr "type" "alu") (match_operand 2 "const128_operand" ""))
(const_string "1")
(const_string "*")))
- (set_attr "mode" "HI")])
+ (set_attr "mode" "DI")])
-(define_insn "*addhi_3"
+; For comparisons against 1, -1 and 128, we may generate better code
+; by converting cmp to add, inc or dec as done by peephole2. This pattern
+; is matched then. We can't accept general immediate, because for
+; case of overflows, the result is messed up.
+; This pattern also don't hold of 0x80000000, since the value overflows
+; when negated.
+; Also carry flag is reversed compared to cmp, so this conversion is valid
+; only for comparisons not depending on it.
+
+(define_insn "*addsi_4"
[(set (reg FLAGS_REG)
- (compare (neg:HI (match_operand:HI 2 "general_operand" "rmn"))
- (match_operand:HI 1 "nonimmediate_operand" "%0")))
- (clobber (match_scratch:HI 0 "=r"))]
- "ix86_match_ccmode (insn, CCZmode)
- && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
+ (compare
+ (match_operand:SI 1 "nonimmediate_operand" "0")
+ (match_operand:SI 2 "const_int_operand" "n")))
+ (clobber (match_scratch:SI 0 "=rm"))]
+ "ix86_match_ccmode (insn, CCGCmode)
+ && (INTVAL (operands[2]) & 0xffffffff) != 0x80000000"
{
switch (get_attr_type (insn))
{
case TYPE_INCDEC:
- if (operands[2] == const1_rtx)
- return "inc{w}\t%0";
+ if (operands[2] == constm1_rtx)
+ return "inc{l}\t%0";
else
{
- gcc_assert (operands[2] == constm1_rtx);
- return "dec{w}\t%0";
+ gcc_assert (operands[2] == const1_rtx);
+ return "dec{l}\t%0";
}
default:
- /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
+ gcc_assert (rtx_equal_p (operands[0], operands[1]));
+ /* Make things pretty and `subl $4,%eax' rather than `addl $-4,%eax'.
Exceptions: -128 encodes smaller than 128, so swap sign and op. */
- if (CONST_INT_P (operands[2])
- && (INTVAL (operands[2]) == 128
- || (INTVAL (operands[2]) < 0
- && INTVAL (operands[2]) != -128)))
- {
- operands[2] = GEN_INT (-INTVAL (operands[2]));
- return "sub{w}\t{%2, %0|%0, %2}";
- }
- return "add{w}\t{%2, %0|%0, %2}";
+ if ((INTVAL (operands[2]) == -128
+ || (INTVAL (operands[2]) > 0
+ && INTVAL (operands[2]) != 128)))
+ return "sub{l}\t{%2, %0|%0, %2}";
+ operands[2] = GEN_INT (-INTVAL (operands[2]));
+ return "add{l}\t{%2, %0|%0, %2}";
}
}
[(set (attr "type")
- (if_then_else (match_operand:HI 2 "incdec_operand" "")
+ (if_then_else (match_operand:SI 2 "incdec_operand" "")
(const_string "incdec")
(const_string "alu")))
(set (attr "length_immediate")
@@ -7423,13 +7112,15 @@
(and (eq_attr "type" "alu") (match_operand 2 "const128_operand" ""))
(const_string "1")
(const_string "*")))
- (set_attr "mode" "HI")])
+ (set_attr "mode" "SI")])
; See comments above addsi_4 for details.
+
(define_insn "*addhi_4"
[(set (reg FLAGS_REG)
- (compare (match_operand:HI 1 "nonimmediate_operand" "0")
- (match_operand:HI 2 "const_int_operand" "n")))
+ (compare
+ (match_operand:HI 1 "nonimmediate_operand" "0")
+ (match_operand:HI 2 "const_int_operand" "n")))
(clobber (match_scratch:HI 0 "=rm"))]
"ix86_match_ccmode (insn, CCGCmode)
&& (INTVAL (operands[2]) & 0xffff) != 0x8000"
@@ -7447,7 +7138,7 @@
default:
gcc_assert (rtx_equal_p (operands[0], operands[1]));
- /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
+ /* Make things pretty and `subw $4,%ax' rather than `addw $-4,%ax'.
Exceptions: -128 encodes smaller than 128, so swap sign and op. */
if ((INTVAL (operands[2]) == -128
|| (INTVAL (operands[2]) > 0
@@ -7468,138 +7159,124 @@
(const_string "*")))
(set_attr "mode" "HI")])
+; See comments above addsi_4 for details.
-(define_insn "*addhi_5"
+(define_insn "*addqi_4"
[(set (reg FLAGS_REG)
(compare
- (plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0")
- (match_operand:HI 2 "general_operand" "rmn"))
- (const_int 0)))
- (clobber (match_scratch:HI 0 "=r"))]
- "ix86_match_ccmode (insn, CCGOCmode)
- && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
+ (match_operand:QI 1 "nonimmediate_operand" "0")
+ (match_operand:QI 2 "const_int_operand" "n")))
+ (clobber (match_scratch:QI 0 "=qm"))]
+ "ix86_match_ccmode (insn, CCGCmode)
+ && (INTVAL (operands[2]) & 0xff) != 0x80"
{
switch (get_attr_type (insn))
{
case TYPE_INCDEC:
- if (operands[2] == const1_rtx)
- return "inc{w}\t%0";
+ if (operands[2] == constm1_rtx
+ || (CONST_INT_P (operands[2])
+ && INTVAL (operands[2]) == 255))
+ return "inc{b}\t%0";
else
{
- gcc_assert (operands[2] == constm1_rtx);
- return "dec{w}\t%0";
+ gcc_assert (operands[2] == const1_rtx);
+ return "dec{b}\t%0";
}
default:
- /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
- Exceptions: -128 encodes smaller than 128, so swap sign and op. */
- if (CONST_INT_P (operands[2])
- && (INTVAL (operands[2]) == 128
- || (INTVAL (operands[2]) < 0
- && INTVAL (operands[2]) != -128)))
- {
- operands[2] = GEN_INT (-INTVAL (operands[2]));
- return "sub{w}\t{%2, %0|%0, %2}";
- }
- return "add{w}\t{%2, %0|%0, %2}";
+ gcc_assert (rtx_equal_p (operands[0], operands[1]));
+ if (INTVAL (operands[2]) < 0)
+ {
+ operands[2] = GEN_INT (-INTVAL (operands[2]));
+ return "add{b}\t{%2, %0|%0, %2}";
+ }
+ return "sub{b}\t{%2, %0|%0, %2}";
}
}
[(set (attr "type")
(if_then_else (match_operand:HI 2 "incdec_operand" "")
(const_string "incdec")
(const_string "alu")))
- (set (attr "length_immediate")
- (if_then_else
- (and (eq_attr "type" "alu") (match_operand 2 "const128_operand" ""))
- (const_string "1")
- (const_string "*")))
- (set_attr "mode" "HI")])
-
-(define_expand "addqi3"
- [(set (match_operand:QI 0 "nonimmediate_operand" "")
- (plus:QI (match_operand:QI 1 "nonimmediate_operand" "")
- (match_operand:QI 2 "general_operand" "")))]
- "TARGET_QIMODE_MATH"
- "ix86_expand_binary_operator (PLUS, QImode, operands); DONE;")
+ (set_attr "mode" "QI")])
-;; %%% Potential partial reg stall on alternative 2. What to do?
-(define_insn "*addqi_1_lea"
- [(set (match_operand:QI 0 "nonimmediate_operand" "=qm,q,r,r")
- (plus:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0,r")
- (match_operand:QI 2 "general_operand" "qn,qmn,rn,ln")))
- (clobber (reg:CC FLAGS_REG))]
- "!TARGET_PARTIAL_REG_STALL
- && ix86_binary_operator_ok (PLUS, QImode, operands)"
+(define_insn "*add<mode>_5"
+ [(set (reg FLAGS_REG)
+ (compare
+ (plus:SWI48
+ (match_operand:SWI48 1 "nonimmediate_operand" "%0")
+ (match_operand:SWI48 2 "<general_operand>" "<g>"))
+ (const_int 0)))
+ (clobber (match_scratch:SWI48 0 "=r"))]
+ "ix86_match_ccmode (insn, CCGOCmode)
+ && !(MEM_P (operands[1]) && MEM_P (operands[2]))
+ /* Current assemblers are broken and do not allow @GOTOFF in
+ ought but a memory context. */
+ && ! pic_symbolic_operand (operands[2], VOIDmode)"
{
- int widen = (which_alternative == 2);
switch (get_attr_type (insn))
{
- case TYPE_LEA:
- return "#";
case TYPE_INCDEC:
+ gcc_assert (rtx_equal_p (operands[0], operands[1]));
if (operands[2] == const1_rtx)
- return widen ? "inc{l}\t%k0" : "inc{b}\t%0";
+ return "inc{<imodesuffix>}\t%0";
else
- {
- gcc_assert (operands[2] == constm1_rtx);
- return widen ? "dec{l}\t%k0" : "dec{b}\t%0";
+ {
+ gcc_assert (operands[2] == constm1_rtx);
+ return "dec{<imodesuffix>}\t%0";
}
default:
- /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
+ gcc_assert (rtx_equal_p (operands[0], operands[1]));
+ /* Make things pretty and `subl $4,%eax' rather than `addl $-4,%eax'.
Exceptions: -128 encodes smaller than 128, so swap sign and op. */
if (CONST_INT_P (operands[2])
+ /* Avoid overflows. */
+ && (<MODE>mode != DImode
+ || ((INTVAL (operands[2]) & ((((unsigned int) 1) << 31) - 1))))
&& (INTVAL (operands[2]) == 128
|| (INTVAL (operands[2]) < 0
&& INTVAL (operands[2]) != -128)))
- {
- operands[2] = GEN_INT (-INTVAL (operands[2]));
- if (widen)
- return "sub{l}\t{%2, %k0|%k0, %2}";
- else
- return "sub{b}\t{%2, %0|%0, %2}";
- }
- if (widen)
- return "add{l}\t{%k2, %k0|%k0, %k2}";
- else
- return "add{b}\t{%2, %0|%0, %2}";
+ {
+ operands[2] = GEN_INT (-INTVAL (operands[2]));
+ return "sub{<imodesuffix>}\t{%2, %0|%0, %2}";
+ }
+ return "add{<imodesuffix>}\t{%2, %0|%0, %2}";
}
}
[(set (attr "type")
- (if_then_else (eq_attr "alternative" "3")
- (const_string "lea")
- (if_then_else (match_operand:QI 2 "incdec_operand" "")
- (const_string "incdec")
- (const_string "alu"))))
+ (if_then_else (match_operand:SWI48 2 "incdec_operand" "")
+ (const_string "incdec")
+ (const_string "alu")))
(set (attr "length_immediate")
(if_then_else
(and (eq_attr "type" "alu") (match_operand 2 "const128_operand" ""))
(const_string "1")
(const_string "*")))
- (set_attr "mode" "QI,QI,SI,SI")])
+ (set_attr "mode" "<MODE>")])
-(define_insn "*addqi_1"
- [(set (match_operand:QI 0 "nonimmediate_operand" "=qm,q,r")
- (plus:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0")
- (match_operand:QI 2 "general_operand" "qn,qmn,rn")))
- (clobber (reg:CC FLAGS_REG))]
- "TARGET_PARTIAL_REG_STALL
- && ix86_binary_operator_ok (PLUS, QImode, operands)"
+(define_insn "*addhi_5"
+ [(set (reg FLAGS_REG)
+ (compare
+ (plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0")
+ (match_operand:HI 2 "general_operand" "rmn"))
+ (const_int 0)))
+ (clobber (match_scratch:HI 0 "=r"))]
+ "ix86_match_ccmode (insn, CCGOCmode)
+ && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
{
- int widen = (which_alternative == 2);
switch (get_attr_type (insn))
{
case TYPE_INCDEC:
if (operands[2] == const1_rtx)
- return widen ? "inc{l}\t%k0" : "inc{b}\t%0";
+ return "inc{w}\t%0";
else
{
gcc_assert (operands[2] == constm1_rtx);
- return widen ? "dec{l}\t%k0" : "dec{b}\t%0";
+ return "dec{w}\t%0";
}
default:
- /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
+ /* Make things pretty and `subw $4,%ax' rather than `addw $-4,%ax'.
Exceptions: -128 encodes smaller than 128, so swap sign and op. */
if (CONST_INT_P (operands[2])
&& (INTVAL (operands[2]) == 128
@@ -7607,19 +7284,13 @@
&& INTVAL (operands[2]) != -128)))
{
operands[2] = GEN_INT (-INTVAL (operands[2]));
- if (widen)
- return "sub{l}\t{%2, %k0|%k0, %2}";
- else
- return "sub{b}\t{%2, %0|%0, %2}";
+ return "sub{w}\t{%2, %0|%0, %2}";
}
- if (widen)
- return "add{l}\t{%k2, %k0|%k0, %k2}";
- else
- return "add{b}\t{%2, %0|%0, %2}";
+ return "add{w}\t{%2, %0|%0, %2}";
}
}
[(set (attr "type")
- (if_then_else (match_operand:QI 2 "incdec_operand" "")
+ (if_then_else (match_operand:HI 2 "incdec_operand" "")
(const_string "incdec")
(const_string "alu")))
(set (attr "length_immediate")
@@ -7627,165 +7298,7 @@
(and (eq_attr "type" "alu") (match_operand 2 "const128_operand" ""))
(const_string "1")
(const_string "*")))
- (set_attr "mode" "QI,QI,SI")])
-
-(define_insn "*addqi_1_slp"
- [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm,q"))
- (plus:QI (match_dup 0)
- (match_operand:QI 1 "general_operand" "qn,qnm")))
- (clobber (reg:CC FLAGS_REG))]
- "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
- && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
-{
- switch (get_attr_type (insn))
- {
- case TYPE_INCDEC:
- if (operands[1] == const1_rtx)
- return "inc{b}\t%0";
- else
- {
- gcc_assert (operands[1] == constm1_rtx);
- return "dec{b}\t%0";
- }
-
- default:
- /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. */
- if (CONST_INT_P (operands[1])
- && INTVAL (operands[1]) < 0)
- {
- operands[1] = GEN_INT (-INTVAL (operands[1]));
- return "sub{b}\t{%1, %0|%0, %1}";
- }
- return "add{b}\t{%1, %0|%0, %1}";
- }
-}
- [(set (attr "type")
- (if_then_else (match_operand:QI 1 "incdec_operand" "")
- (const_string "incdec")
- (const_string "alu1")))
- (set (attr "memory")
- (if_then_else (match_operand 1 "memory_operand" "")
- (const_string "load")
- (const_string "none")))
- (set_attr "mode" "QI")])
-
-(define_insn "*addqi_2"
- [(set (reg FLAGS_REG)
- (compare
- (plus:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0")
- (match_operand:QI 2 "general_operand" "qmn,qn"))
- (const_int 0)))
- (set (match_operand:QI 0 "nonimmediate_operand" "=q,qm")
- (plus:QI (match_dup 1) (match_dup 2)))]
- "ix86_match_ccmode (insn, CCGOCmode)
- && ix86_binary_operator_ok (PLUS, QImode, operands)"
-{
- switch (get_attr_type (insn))
- {
- case TYPE_INCDEC:
- if (operands[2] == const1_rtx)
- return "inc{b}\t%0";
- else
- {
- gcc_assert (operands[2] == constm1_rtx
- || (CONST_INT_P (operands[2])
- && INTVAL (operands[2]) == 255));
- return "dec{b}\t%0";
- }
-
- default:
- /* Make things pretty and `subb $4,%al' rather than `addb $-4, %al'. */
- if (CONST_INT_P (operands[2])
- && INTVAL (operands[2]) < 0)
- {
- operands[2] = GEN_INT (-INTVAL (operands[2]));
- return "sub{b}\t{%2, %0|%0, %2}";
- }
- return "add{b}\t{%2, %0|%0, %2}";
- }
-}
- [(set (attr "type")
- (if_then_else (match_operand:QI 2 "incdec_operand" "")
- (const_string "incdec")
- (const_string "alu")))
- (set_attr "mode" "QI")])
-
-(define_insn "*addqi_3"
- [(set (reg FLAGS_REG)
- (compare (neg:QI (match_operand:QI 2 "general_operand" "qmn"))
- (match_operand:QI 1 "nonimmediate_operand" "%0")))
- (clobber (match_scratch:QI 0 "=q"))]
- "ix86_match_ccmode (insn, CCZmode)
- && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
-{
- switch (get_attr_type (insn))
- {
- case TYPE_INCDEC:
- if (operands[2] == const1_rtx)
- return "inc{b}\t%0";
- else
- {
- gcc_assert (operands[2] == constm1_rtx
- || (CONST_INT_P (operands[2])
- && INTVAL (operands[2]) == 255));
- return "dec{b}\t%0";
- }
-
- default:
- /* Make things pretty and `subb $4,%al' rather than `addb $-4, %al'. */
- if (CONST_INT_P (operands[2])
- && INTVAL (operands[2]) < 0)
- {
- operands[2] = GEN_INT (-INTVAL (operands[2]));
- return "sub{b}\t{%2, %0|%0, %2}";
- }
- return "add{b}\t{%2, %0|%0, %2}";
- }
-}
- [(set (attr "type")
- (if_then_else (match_operand:QI 2 "incdec_operand" "")
- (const_string "incdec")
- (const_string "alu")))
- (set_attr "mode" "QI")])
-
-; See comments above addsi_4 for details.
-(define_insn "*addqi_4"
- [(set (reg FLAGS_REG)
- (compare (match_operand:QI 1 "nonimmediate_operand" "0")
- (match_operand:QI 2 "const_int_operand" "n")))
- (clobber (match_scratch:QI 0 "=qm"))]
- "ix86_match_ccmode (insn, CCGCmode)
- && (INTVAL (operands[2]) & 0xff) != 0x80"
-{
- switch (get_attr_type (insn))
- {
- case TYPE_INCDEC:
- if (operands[2] == constm1_rtx
- || (CONST_INT_P (operands[2])
- && INTVAL (operands[2]) == 255))
- return "inc{b}\t%0";
- else
- {
- gcc_assert (operands[2] == const1_rtx);
- return "dec{b}\t%0";
- }
-
- default:
- gcc_assert (rtx_equal_p (operands[0], operands[1]));
- if (INTVAL (operands[2]) < 0)
- {
- operands[2] = GEN_INT (-INTVAL (operands[2]));
- return "add{b}\t{%2, %0|%0, %2}";
- }
- return "sub{b}\t{%2, %0|%0, %2}";
- }
-}
- [(set (attr "type")
- (if_then_else (match_operand:HI 2 "incdec_operand" "")
- (const_string "incdec")
- (const_string "alu")))
- (set_attr "mode" "QI")])
-
+ (set_attr "mode" "HI")])
(define_insn "*addqi_5"
[(set (reg FLAGS_REG)
@@ -7811,7 +7324,7 @@
}
default:
- /* Make things pretty and `subb $4,%al' rather than `addb $-4, %al'. */
+ /* Make things pretty and `subb $4,%al' rather than `addb $-4,%al'. */
if (CONST_INT_P (operands[2])
&& INTVAL (operands[2]) < 0)
{
@@ -7827,8 +7340,7 @@
(const_string "alu")))
(set_attr "mode" "QI")])
-
-(define_insn "addqi_ext_1"
+(define_insn "*addqi_ext_1_rex64"
[(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
(const_int 8)
(const_int 8))
@@ -7837,9 +7349,9 @@
(match_operand 1 "ext_register_operand" "0")
(const_int 8)
(const_int 8))
- (match_operand:QI 2 "general_operand" "Qmn")))
+ (match_operand:QI 2 "nonmemory_operand" "Qn")))
(clobber (reg:CC FLAGS_REG))]
- "!TARGET_64BIT"
+ "TARGET_64BIT"
{
switch (get_attr_type (insn))
{
@@ -7852,7 +7364,7 @@
|| (CONST_INT_P (operands[2])
&& INTVAL (operands[2]) == 255));
return "dec{b}\t%h0";
- }
+ }
default:
return "add{b}\t{%2, %h0|%h0, %2}";
@@ -7865,7 +7377,7 @@
(set_attr "modrm" "1")
(set_attr "mode" "QI")])
-(define_insn "*addqi_ext_1_rex64"
+(define_insn "addqi_ext_1"
[(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
(const_int 8)
(const_int 8))
@@ -7874,9 +7386,9 @@
(match_operand 1 "ext_register_operand" "0")
(const_int 8)
(const_int 8))
- (match_operand:QI 2 "nonmemory_operand" "Qn")))
+ (match_operand:QI 2 "general_operand" "Qmn")))
(clobber (reg:CC FLAGS_REG))]
- "TARGET_64BIT"
+ "!TARGET_64BIT"
{
switch (get_attr_type (insn))
{
@@ -7889,7 +7401,7 @@
|| (CONST_INT_P (operands[2])
&& INTVAL (operands[2]) == 255));
return "dec{b}\t%h0";
- }
+ }
default:
return "add{b}\t{%2, %h0|%h0, %2}";
@@ -7921,178 +7433,271 @@
[(set_attr "type" "alu")
(set_attr "mode" "QI")])
-;; The patterns that match these are at the end of this file.
-
-(define_expand "addxf3"
- [(set (match_operand:XF 0 "register_operand" "")
- (plus:XF (match_operand:XF 1 "register_operand" "")
- (match_operand:XF 2 "register_operand" "")))]
- "TARGET_80387"
- "")
-
-(define_expand "add<mode>3"
- [(set (match_operand:MODEF 0 "register_operand" "")
- (plus:MODEF (match_operand:MODEF 1 "register_operand" "")
- (match_operand:MODEF 2 "nonimmediate_operand" "")))]
- "(TARGET_80387 && X87_ENABLE_ARITH (<MODE>mode))
- || (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)"
- "")
-
-;; Subtract instructions
+;; The lea patterns for non-Pmodes needs to be matched by
+;; several insns converted to real lea by splitters.
-;; %%% splits for subditi3
+(define_insn_and_split "*lea_general_1"
+ [(set (match_operand 0 "register_operand" "=r")
+ (plus (plus (match_operand 1 "index_register_operand" "l")
+ (match_operand 2 "register_operand" "r"))
+ (match_operand 3 "immediate_operand" "i")))]
+ "(GET_MODE (operands[0]) == QImode || GET_MODE (operands[0]) == HImode
+ || (TARGET_64BIT && GET_MODE (operands[0]) == SImode))
+ && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
+ && GET_MODE (operands[0]) == GET_MODE (operands[1])
+ && GET_MODE (operands[0]) == GET_MODE (operands[2])
+ && (GET_MODE (operands[0]) == GET_MODE (operands[3])
+ || GET_MODE (operands[3]) == VOIDmode)"
+ "#"
+ "&& reload_completed"
+ [(const_int 0)]
+{
+ rtx pat;
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ operands[1] = gen_lowpart (Pmode, operands[1]);
+ operands[2] = gen_lowpart (Pmode, operands[2]);
+ operands[3] = gen_lowpart (Pmode, operands[3]);
+ pat = gen_rtx_PLUS (Pmode, gen_rtx_PLUS (Pmode, operands[1], operands[2]),
+ operands[3]);
+ if (Pmode != SImode)
+ pat = gen_rtx_SUBREG (SImode, pat, 0);
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], pat));
+ DONE;
+}
+ [(set_attr "type" "lea")
+ (set_attr "mode" "SI")])
-(define_expand "subti3"
- [(set (match_operand:TI 0 "nonimmediate_operand" "")
- (minus:TI (match_operand:TI 1 "nonimmediate_operand" "")
- (match_operand:TI 2 "x86_64_general_operand" "")))]
+(define_insn_and_split "*lea_general_1_zext"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (zero_extend:DI
+ (plus:SI (plus:SI
+ (match_operand:SI 1 "index_register_operand" "l")
+ (match_operand:SI 2 "register_operand" "r"))
+ (match_operand:SI 3 "immediate_operand" "i"))))]
"TARGET_64BIT"
- "ix86_expand_binary_operator (MINUS, TImode, operands); DONE;")
-
-(define_insn "*subti3_1"
- [(set (match_operand:TI 0 "nonimmediate_operand" "=r,o")
- (minus:TI (match_operand:TI 1 "nonimmediate_operand" "0,0")
- (match_operand:TI 2 "x86_64_general_operand" "roe,re")))
- (clobber (reg:CC FLAGS_REG))]
- "TARGET_64BIT && ix86_binary_operator_ok (MINUS, TImode, operands)"
- "#")
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 0)
+ (zero_extend:DI (subreg:SI (plus:DI (plus:DI (match_dup 1)
+ (match_dup 2))
+ (match_dup 3)) 0)))]
+{
+ operands[1] = gen_lowpart (Pmode, operands[1]);
+ operands[2] = gen_lowpart (Pmode, operands[2]);
+ operands[3] = gen_lowpart (Pmode, operands[3]);
+}
+ [(set_attr "type" "lea")
+ (set_attr "mode" "SI")])
-(define_split
- [(set (match_operand:TI 0 "nonimmediate_operand" "")
- (minus:TI (match_operand:TI 1 "nonimmediate_operand" "")
- (match_operand:TI 2 "x86_64_general_operand" "")))
- (clobber (reg:CC FLAGS_REG))]
- "TARGET_64BIT && reload_completed"
- [(parallel [(set (reg:CC FLAGS_REG) (compare:CC (match_dup 1) (match_dup 2)))
- (set (match_dup 0) (minus:DI (match_dup 1) (match_dup 2)))])
- (parallel [(set (match_dup 3)
- (minus:DI (match_dup 4)
- (plus:DI (ltu:DI (reg:CC FLAGS_REG) (const_int 0))
- (match_dup 5))))
- (clobber (reg:CC FLAGS_REG))])]
- "split_ti (&operands[0], 3, &operands[0], &operands[3]);")
+(define_insn_and_split "*lea_general_2"
+ [(set (match_operand 0 "register_operand" "=r")
+ (plus (mult (match_operand 1 "index_register_operand" "l")
+ (match_operand 2 "const248_operand" "i"))
+ (match_operand 3 "nonmemory_operand" "ri")))]
+ "(GET_MODE (operands[0]) == QImode || GET_MODE (operands[0]) == HImode
+ || (TARGET_64BIT && GET_MODE (operands[0]) == SImode))
+ && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
+ && GET_MODE (operands[0]) == GET_MODE (operands[1])
+ && (GET_MODE (operands[0]) == GET_MODE (operands[3])
+ || GET_MODE (operands[3]) == VOIDmode)"
+ "#"
+ "&& reload_completed"
+ [(const_int 0)]
+{
+ rtx pat;
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ operands[1] = gen_lowpart (Pmode, operands[1]);
+ operands[3] = gen_lowpart (Pmode, operands[3]);
+ pat = gen_rtx_PLUS (Pmode, gen_rtx_MULT (Pmode, operands[1], operands[2]),
+ operands[3]);
+ if (Pmode != SImode)
+ pat = gen_rtx_SUBREG (SImode, pat, 0);
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], pat));
+ DONE;
+}
+ [(set_attr "type" "lea")
+ (set_attr "mode" "SI")])
-;; %%% splits for subsidi3
+(define_insn_and_split "*lea_general_2_zext"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (zero_extend:DI
+ (plus:SI (mult:SI
+ (match_operand:SI 1 "index_register_operand" "l")
+ (match_operand:SI 2 "const248_operand" "n"))
+ (match_operand:SI 3 "nonmemory_operand" "ri"))))]
+ "TARGET_64BIT"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 0)
+ (zero_extend:DI (subreg:SI (plus:DI (mult:DI (match_dup 1)
+ (match_dup 2))
+ (match_dup 3)) 0)))]
+{
+ operands[1] = gen_lowpart (Pmode, operands[1]);
+ operands[3] = gen_lowpart (Pmode, operands[3]);
+}
+ [(set_attr "type" "lea")
+ (set_attr "mode" "SI")])
-(define_expand "subdi3"
- [(set (match_operand:DI 0 "nonimmediate_operand" "")
- (minus:DI (match_operand:DI 1 "nonimmediate_operand" "")
- (match_operand:DI 2 "x86_64_general_operand" "")))]
- ""
- "ix86_expand_binary_operator (MINUS, DImode, operands); DONE;")
+(define_insn_and_split "*lea_general_3"
+ [(set (match_operand 0 "register_operand" "=r")
+ (plus (plus (mult (match_operand 1 "index_register_operand" "l")
+ (match_operand 2 "const248_operand" "i"))
+ (match_operand 3 "register_operand" "r"))
+ (match_operand 4 "immediate_operand" "i")))]
+ "(GET_MODE (operands[0]) == QImode || GET_MODE (operands[0]) == HImode
+ || (TARGET_64BIT && GET_MODE (operands[0]) == SImode))
+ && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
+ && GET_MODE (operands[0]) == GET_MODE (operands[1])
+ && GET_MODE (operands[0]) == GET_MODE (operands[3])"
+ "#"
+ "&& reload_completed"
+ [(const_int 0)]
+{
+ rtx pat;
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ operands[1] = gen_lowpart (Pmode, operands[1]);
+ operands[3] = gen_lowpart (Pmode, operands[3]);
+ operands[4] = gen_lowpart (Pmode, operands[4]);
+ pat = gen_rtx_PLUS (Pmode,
+ gen_rtx_PLUS (Pmode, gen_rtx_MULT (Pmode, operands[1],
+ operands[2]),
+ operands[3]),
+ operands[4]);
+ if (Pmode != SImode)
+ pat = gen_rtx_SUBREG (SImode, pat, 0);
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], pat));
+ DONE;
+}
+ [(set_attr "type" "lea")
+ (set_attr "mode" "SI")])
-(define_insn "*subdi3_1"
- [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o")
- (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0")
- (match_operand:DI 2 "general_operand" "roiF,riF")))
- (clobber (reg:CC FLAGS_REG))]
- "!TARGET_64BIT && ix86_binary_operator_ok (MINUS, DImode, operands)"
- "#")
+(define_insn_and_split "*lea_general_3_zext"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (zero_extend:DI
+ (plus:SI (plus:SI
+ (mult:SI
+ (match_operand:SI 1 "index_register_operand" "l")
+ (match_operand:SI 2 "const248_operand" "n"))
+ (match_operand:SI 3 "register_operand" "r"))
+ (match_operand:SI 4 "immediate_operand" "i"))))]
+ "TARGET_64BIT"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 0)
+ (zero_extend:DI (subreg:SI (plus:DI (plus:DI (mult:DI (match_dup 1)
+ (match_dup 2))
+ (match_dup 3))
+ (match_dup 4)) 0)))]
+{
+ operands[1] = gen_lowpart (Pmode, operands[1]);
+ operands[3] = gen_lowpart (Pmode, operands[3]);
+ operands[4] = gen_lowpart (Pmode, operands[4]);
+}
+ [(set_attr "type" "lea")
+ (set_attr "mode" "SI")])
+;; Convert lea to the lea pattern to avoid flags dependency.
(define_split
- [(set (match_operand:DI 0 "nonimmediate_operand" "")
- (minus:DI (match_operand:DI 1 "nonimmediate_operand" "")
- (match_operand:DI 2 "general_operand" "")))
- (clobber (reg:CC FLAGS_REG))]
- "!TARGET_64BIT && reload_completed"
- [(parallel [(set (reg:CC FLAGS_REG) (compare:CC (match_dup 1) (match_dup 2)))
- (set (match_dup 0) (minus:SI (match_dup 1) (match_dup 2)))])
- (parallel [(set (match_dup 3)
- (minus:SI (match_dup 4)
- (plus:SI (ltu:SI (reg:CC FLAGS_REG) (const_int 0))
- (match_dup 5))))
- (clobber (reg:CC FLAGS_REG))])]
- "split_di (&operands[0], 3, &operands[0], &operands[3]);")
-
-(define_insn "subdi3_carry_rex64"
- [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,r")
- (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0")
- (plus:DI (match_operand:DI 3 "ix86_carry_flag_operator" "")
- (match_operand:DI 2 "x86_64_general_operand" "re,rm"))))
+ [(set (match_operand:DI 0 "register_operand" "")
+ (plus:DI (match_operand:DI 1 "register_operand" "")
+ (match_operand:DI 2 "x86_64_nonmemory_operand" "")))
(clobber (reg:CC FLAGS_REG))]
- "TARGET_64BIT && ix86_binary_operator_ok (MINUS, DImode, operands)"
- "sbb{q}\t{%2, %0|%0, %2}"
- [(set_attr "type" "alu")
- (set_attr "use_carry" "1")
- (set_attr "pent_pair" "pu")
- (set_attr "mode" "DI")])
+ "TARGET_64BIT && reload_completed
+ && ix86_lea_for_add_ok (PLUS, insn, operands)"
+ [(set (match_dup 0)
+ (plus:DI (match_dup 1)
+ (match_dup 2)))]
+ "")
-(define_insn "*subdi_1_rex64"
- [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,r")
- (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0")
- (match_operand:DI 2 "x86_64_general_operand" "re,rm")))
+;; Convert lea to the lea pattern to avoid flags dependency.
+(define_split
+ [(set (match_operand 0 "register_operand" "")
+ (plus (match_operand 1 "register_operand" "")
+ (match_operand 2 "nonmemory_operand" "")))
(clobber (reg:CC FLAGS_REG))]
- "TARGET_64BIT && ix86_binary_operator_ok (MINUS, DImode, operands)"
- "sub{q}\t{%2, %0|%0, %2}"
- [(set_attr "type" "alu")
- (set_attr "mode" "DI")])
-
-(define_insn "*subdi_2_rex64"
- [(set (reg FLAGS_REG)
- (compare
- (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0")
- (match_operand:DI 2 "x86_64_general_operand" "re,rm"))
- (const_int 0)))
- (set (match_operand:DI 0 "nonimmediate_operand" "=rm,r")
- (minus:DI (match_dup 1) (match_dup 2)))]
- "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode)
- && ix86_binary_operator_ok (MINUS, DImode, operands)"
- "sub{q}\t{%2, %0|%0, %2}"
- [(set_attr "type" "alu")
- (set_attr "mode" "DI")])
-
-(define_insn "*subdi_3_rex63"
- [(set (reg FLAGS_REG)
- (compare (match_operand:DI 1 "nonimmediate_operand" "0,0")
- (match_operand:DI 2 "x86_64_general_operand" "re,rm")))
- (set (match_operand:DI 0 "nonimmediate_operand" "=rm,r")
- (minus:DI (match_dup 1) (match_dup 2)))]
- "TARGET_64BIT && ix86_match_ccmode (insn, CCmode)
- && ix86_binary_operator_ok (MINUS, SImode, operands)"
- "sub{q}\t{%2, %0|%0, %2}"
- [(set_attr "type" "alu")
- (set_attr "mode" "DI")])
+ "reload_completed && ix86_lea_for_add_ok (PLUS, insn, operands)"
+ [(const_int 0)]
+{
+ rtx pat;
+ /* In -fPIC mode the constructs like (const (unspec [symbol_ref]))
+ may confuse gen_lowpart. */
+ if (GET_MODE (operands[0]) != Pmode)
+ {
+ operands[1] = gen_lowpart (Pmode, operands[1]);
+ operands[2] = gen_lowpart (Pmode, operands[2]);
+ }
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ pat = gen_rtx_PLUS (Pmode, operands[1], operands[2]);
+ if (Pmode != SImode)
+ pat = gen_rtx_SUBREG (SImode, pat, 0);
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], pat));
+ DONE;
+})
-(define_insn "subqi3_carry"
- [(set (match_operand:QI 0 "nonimmediate_operand" "=qm,q")
- (minus:QI (match_operand:QI 1 "nonimmediate_operand" "0,0")
- (plus:QI (match_operand:QI 3 "ix86_carry_flag_operator" "")
- (match_operand:QI 2 "general_operand" "qn,qm"))))
+;; Convert lea to the lea pattern to avoid flags dependency.
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (zero_extend:DI
+ (plus:SI (match_operand:SI 1 "register_operand" "")
+ (match_operand:SI 2 "nonmemory_operand" ""))))
(clobber (reg:CC FLAGS_REG))]
- "ix86_binary_operator_ok (MINUS, QImode, operands)"
- "sbb{b}\t{%2, %0|%0, %2}"
- [(set_attr "type" "alu")
- (set_attr "use_carry" "1")
- (set_attr "pent_pair" "pu")
- (set_attr "mode" "QI")])
+ "TARGET_64BIT && reload_completed
+ && true_regnum (operands[0]) != true_regnum (operands[1])"
+ [(set (match_dup 0)
+ (zero_extend:DI (subreg:SI (plus:DI (match_dup 1) (match_dup 2)) 0)))]
+{
+ operands[1] = gen_lowpart (Pmode, operands[1]);
+ operands[2] = gen_lowpart (Pmode, operands[2]);
+})
+
+;; Subtract instructions
-(define_insn "subhi3_carry"
- [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,r")
- (minus:HI (match_operand:HI 1 "nonimmediate_operand" "0,0")
- (plus:HI (match_operand:HI 3 "ix86_carry_flag_operator" "")
- (match_operand:HI 2 "general_operand" "rn,rm"))))
- (clobber (reg:CC FLAGS_REG))]
- "ix86_binary_operator_ok (MINUS, HImode, operands)"
- "sbb{w}\t{%2, %0|%0, %2}"
- [(set_attr "type" "alu")
- (set_attr "use_carry" "1")
- (set_attr "pent_pair" "pu")
- (set_attr "mode" "HI")])
+(define_expand "sub<mode>3"
+ [(set (match_operand:SDWIM 0 "nonimmediate_operand" "")
+ (minus:SDWIM (match_operand:SDWIM 1 "nonimmediate_operand" "")
+ (match_operand:SDWIM 2 "<general_operand>" "")))]
+ ""
+ "ix86_expand_binary_operator (MINUS, <MODE>mode, operands); DONE;")
-(define_insn "subsi3_carry"
- [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,r")
- (minus:SI (match_operand:SI 1 "nonimmediate_operand" "0,0")
- (plus:SI (match_operand:SI 3 "ix86_carry_flag_operator" "")
- (match_operand:SI 2 "general_operand" "ri,rm"))))
+(define_insn_and_split "*sub<dwi>3_doubleword"
+ [(set (match_operand:<DWI> 0 "nonimmediate_operand" "=r,o")
+ (minus:<DWI>
+ (match_operand:<DWI> 1 "nonimmediate_operand" "0,0")
+ (match_operand:<DWI> 2 "<general_operand>" "ro<di>,r<di>")))
(clobber (reg:CC FLAGS_REG))]
- "ix86_binary_operator_ok (MINUS, SImode, operands)"
- "sbb{l}\t{%2, %0|%0, %2}"
+ "ix86_binary_operator_ok (MINUS, <MODE>mode, operands)"
+ "#"
+ "reload_completed"
+ [(parallel [(set (reg:CC FLAGS_REG)
+ (compare:CC (match_dup 1) (match_dup 2)))
+ (set (match_dup 0)
+ (minus:DWIH (match_dup 1) (match_dup 2)))])
+ (parallel [(set (match_dup 3)
+ (minus:DWIH
+ (match_dup 4)
+ (plus:DWIH
+ (ltu:DWIH (reg:CC FLAGS_REG) (const_int 0))
+ (match_dup 5))))
+ (clobber (reg:CC FLAGS_REG))])]
+ "split_<dwi> (&operands[0], 3, &operands[0], &operands[3]);")
+
+(define_insn "sub<mode>3_carry"
+ [(set (match_operand:SWI 0 "nonimmediate_operand" "=<r>m,<r>")
+ (minus:SWI
+ (match_operand:SWI 1 "nonimmediate_operand" "0,0")
+ (plus:SWI
+ (match_operand:SWI 3 "ix86_carry_flag_operator" "")
+ (match_operand:SWI 2 "<general_operand>" "<r><i>,<r>m"))))
+ (clobber (reg:CC FLAGS_REG))]
+ "ix86_binary_operator_ok (MINUS, <MODE>mode, operands)"
+ "sbb{<imodesuffix>}\t{%2, %0|%0, %2}"
[(set_attr "type" "alu")
(set_attr "use_carry" "1")
(set_attr "pent_pair" "pu")
- (set_attr "mode" "SI")])
+ (set_attr "mode" "<MODE>")])
-(define_insn "subsi3_carry_zext"
+(define_insn "*subsi3_carry_zext"
[(set (match_operand:DI 0 "register_operand" "=r")
(zero_extend:DI
(minus:SI (match_operand:SI 1 "register_operand" "0")
@@ -8105,22 +7710,28 @@
(set_attr "pent_pair" "pu")
(set_attr "mode" "SI")])
-(define_expand "subsi3"
- [(set (match_operand:SI 0 "nonimmediate_operand" "")
- (minus:SI (match_operand:SI 1 "nonimmediate_operand" "")
- (match_operand:SI 2 "general_operand" "")))]
+(define_insn "*sub<mode>3_cconly_overflow"
+ [(set (reg:CCC FLAGS_REG)
+ (compare:CCC
+ (minus:SWI
+ (match_operand:SWI 0 "nonimmediate_operand" "<r>m,<r>")
+ (match_operand:SWI 1 "<general_operand>" "<r><i>,<r>m"))
+ (match_dup 0)))]
""
- "ix86_expand_binary_operator (MINUS, SImode, operands); DONE;")
+ "cmp{<imodesuffix>}\t{%1, %0|%0, %1}"
+ [(set_attr "type" "icmp")
+ (set_attr "mode" "<MODE>")])
-(define_insn "*subsi_1"
- [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,r")
- (minus:SI (match_operand:SI 1 "nonimmediate_operand" "0,0")
- (match_operand:SI 2 "general_operand" "ri,rm")))
+(define_insn "*sub<mode>_1"
+ [(set (match_operand:SWI 0 "nonimmediate_operand" "=<r>m,<r>")
+ (minus:SWI
+ (match_operand:SWI 1 "nonimmediate_operand" "0,0")
+ (match_operand:SWI 2 "<general_operand>" "<r><i>,<r>m")))
(clobber (reg:CC FLAGS_REG))]
- "ix86_binary_operator_ok (MINUS, SImode, operands)"
- "sub{l}\t{%2, %0|%0, %2}"
+ "ix86_binary_operator_ok (MINUS, <MODE>mode, operands)"
+ "sub{<imodesuffix>}\t{%2, %0|%0, %2}"
[(set_attr "type" "alu")
- (set_attr "mode" "SI")])
+ (set_attr "mode" "<MODE>")])
(define_insn "*subsi_1_zext"
[(set (match_operand:DI 0 "register_operand" "=r")
@@ -8133,19 +7744,31 @@
[(set_attr "type" "alu")
(set_attr "mode" "SI")])
-(define_insn "*subsi_2"
+(define_insn "*subqi_1_slp"
+ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm,q"))
+ (minus:QI (match_dup 0)
+ (match_operand:QI 1 "general_operand" "qn,qm")))
+ (clobber (reg:CC FLAGS_REG))]
+ "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
+ && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
+ "sub{b}\t{%1, %0|%0, %1}"
+ [(set_attr "type" "alu1")
+ (set_attr "mode" "QI")])
+
+(define_insn "*sub<mode>_2"
[(set (reg FLAGS_REG)
(compare
- (minus:SI (match_operand:SI 1 "nonimmediate_operand" "0,0")
- (match_operand:SI 2 "general_operand" "ri,rm"))
+ (minus:SWI
+ (match_operand:SWI 1 "nonimmediate_operand" "0,0")
+ (match_operand:SWI 2 "<general_operand>" "<r><i>,<r>m"))
(const_int 0)))
- (set (match_operand:SI 0 "nonimmediate_operand" "=rm,r")
- (minus:SI (match_dup 1) (match_dup 2)))]
+ (set (match_operand:SWI 0 "nonimmediate_operand" "=<r>m,<r>")
+ (minus:SWI (match_dup 1) (match_dup 2)))]
"ix86_match_ccmode (insn, CCGOCmode)
- && ix86_binary_operator_ok (MINUS, SImode, operands)"
- "sub{l}\t{%2, %0|%0, %2}"
+ && ix86_binary_operator_ok (MINUS, <MODE>mode, operands)"
+ "sub{<imodesuffix>}\t{%2, %0|%0, %2}"
[(set_attr "type" "alu")
- (set_attr "mode" "SI")])
+ (set_attr "mode" "<MODE>")])
(define_insn "*subsi_2_zext"
[(set (reg FLAGS_REG)
@@ -8163,17 +7786,17 @@
[(set_attr "type" "alu")
(set_attr "mode" "SI")])
-(define_insn "*subsi_3"
+(define_insn "*sub<mode>_3"
[(set (reg FLAGS_REG)
- (compare (match_operand:SI 1 "nonimmediate_operand" "0,0")
- (match_operand:SI 2 "general_operand" "ri,rm")))
- (set (match_operand:SI 0 "nonimmediate_operand" "=rm,r")
- (minus:SI (match_dup 1) (match_dup 2)))]
+ (compare (match_operand:SWI 1 "nonimmediate_operand" "0,0")
+ (match_operand:SWI 2 "<general_operand>" "<r><i>,<r>m")))
+ (set (match_operand:SWI 0 "nonimmediate_operand" "=<r>m,<r>")
+ (minus:SWI (match_dup 1) (match_dup 2)))]
"ix86_match_ccmode (insn, CCmode)
- && ix86_binary_operator_ok (MINUS, SImode, operands)"
- "sub{l}\t{%2, %0|%0, %2}"
+ && ix86_binary_operator_ok (MINUS, <MODE>mode, operands)"
+ "sub{<imodesuffix>}\t{%2, %0|%0, %2}"
[(set_attr "type" "alu")
- (set_attr "mode" "SI")])
+ (set_attr "mode" "<MODE>")])
(define_insn "*subsi_3_zext"
[(set (reg FLAGS_REG)
@@ -8187,195 +7810,95 @@
&& ix86_binary_operator_ok (MINUS, SImode, operands)"
"sub{l}\t{%2, %1|%1, %2}"
[(set_attr "type" "alu")
- (set_attr "mode" "DI")])
-
-(define_expand "subhi3"
- [(set (match_operand:HI 0 "nonimmediate_operand" "")
- (minus:HI (match_operand:HI 1 "nonimmediate_operand" "")
- (match_operand:HI 2 "general_operand" "")))]
- "TARGET_HIMODE_MATH"
- "ix86_expand_binary_operator (MINUS, HImode, operands); DONE;")
-
-(define_insn "*subhi_1"
- [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,r")
- (minus:HI (match_operand:HI 1 "nonimmediate_operand" "0,0")
- (match_operand:HI 2 "general_operand" "rn,rm")))
- (clobber (reg:CC FLAGS_REG))]
- "ix86_binary_operator_ok (MINUS, HImode, operands)"
- "sub{w}\t{%2, %0|%0, %2}"
- [(set_attr "type" "alu")
- (set_attr "mode" "HI")])
-
-(define_insn "*subhi_2"
- [(set (reg FLAGS_REG)
- (compare
- (minus:HI (match_operand:HI 1 "nonimmediate_operand" "0,0")
- (match_operand:HI 2 "general_operand" "rn,rm"))
- (const_int 0)))
- (set (match_operand:HI 0 "nonimmediate_operand" "=rm,r")
- (minus:HI (match_dup 1) (match_dup 2)))]
- "ix86_match_ccmode (insn, CCGOCmode)
- && ix86_binary_operator_ok (MINUS, HImode, operands)"
- "sub{w}\t{%2, %0|%0, %2}"
- [(set_attr "type" "alu")
- (set_attr "mode" "HI")])
-
-(define_insn "*subhi_3"
- [(set (reg FLAGS_REG)
- (compare (match_operand:HI 1 "nonimmediate_operand" "0,0")
- (match_operand:HI 2 "general_operand" "rn,rm")))
- (set (match_operand:HI 0 "nonimmediate_operand" "=rm,r")
- (minus:HI (match_dup 1) (match_dup 2)))]
- "ix86_match_ccmode (insn, CCmode)
- && ix86_binary_operator_ok (MINUS, HImode, operands)"
- "sub{w}\t{%2, %0|%0, %2}"
- [(set_attr "type" "alu")
- (set_attr "mode" "HI")])
-
-(define_expand "subqi3"
- [(set (match_operand:QI 0 "nonimmediate_operand" "")
- (minus:QI (match_operand:QI 1 "nonimmediate_operand" "")
- (match_operand:QI 2 "general_operand" "")))]
- "TARGET_QIMODE_MATH"
- "ix86_expand_binary_operator (MINUS, QImode, operands); DONE;")
-
-(define_insn "*subqi_1"
- [(set (match_operand:QI 0 "nonimmediate_operand" "=qm,q")
- (minus:QI (match_operand:QI 1 "nonimmediate_operand" "0,0")
- (match_operand:QI 2 "general_operand" "qn,qm")))
- (clobber (reg:CC FLAGS_REG))]
- "ix86_binary_operator_ok (MINUS, QImode, operands)"
- "sub{b}\t{%2, %0|%0, %2}"
- [(set_attr "type" "alu")
- (set_attr "mode" "QI")])
+ (set_attr "mode" "SI")])
-(define_insn "*subqi_1_slp"
- [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm,q"))
- (minus:QI (match_dup 0)
- (match_operand:QI 1 "general_operand" "qn,qm")))
- (clobber (reg:CC FLAGS_REG))]
- "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
- && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
- "sub{b}\t{%1, %0|%0, %1}"
- [(set_attr "type" "alu1")
- (set_attr "mode" "QI")])
-(define_insn "*subqi_2"
- [(set (reg FLAGS_REG)
- (compare
- (minus:QI (match_operand:QI 1 "nonimmediate_operand" "0,0")
- (match_operand:QI 2 "general_operand" "qn,qm"))
- (const_int 0)))
- (set (match_operand:QI 0 "nonimmediate_operand" "=qm,q")
- (minus:QI (match_dup 1) (match_dup 2)))]
- "ix86_match_ccmode (insn, CCGOCmode)
- && ix86_binary_operator_ok (MINUS, QImode, operands)"
- "sub{b}\t{%2, %0|%0, %2}"
+(define_insn "*<plusminus_insn><mode>3_cc_overflow"
+ [(set (reg:CCC FLAGS_REG)
+ (compare:CCC
+ (plusminus:SWI
+ (match_operand:SWI 1 "nonimmediate_operand" "<comm>0,0")
+ (match_operand:SWI 2 "<general_operand>" "<r><i>,<r>m"))
+ (match_dup 1)))
+ (set (match_operand:SWI 0 "nonimmediate_operand" "=<r>m,<r>")
+ (plusminus:SWI (match_dup 1) (match_dup 2)))]
+ "ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
+ "<plusminus_mnemonic>{<imodesuffix>}\t{%2, %0|%0, %2}"
[(set_attr "type" "alu")
- (set_attr "mode" "QI")])
+ (set_attr "mode" "<MODE>")])
-(define_insn "*subqi_3"
- [(set (reg FLAGS_REG)
- (compare (match_operand:QI 1 "nonimmediate_operand" "0,0")
- (match_operand:QI 2 "general_operand" "qn,qm")))
- (set (match_operand:QI 0 "nonimmediate_operand" "=qm,q")
- (minus:QI (match_dup 1) (match_dup 2)))]
- "ix86_match_ccmode (insn, CCmode)
- && ix86_binary_operator_ok (MINUS, QImode, operands)"
- "sub{b}\t{%2, %0|%0, %2}"
+(define_insn "*<plusminus_insn>si3_zext_cc_overflow"
+ [(set (reg:CCC FLAGS_REG)
+ (compare:CCC
+ (plusminus:SI
+ (match_operand:SI 1 "nonimmediate_operand" "<comm>0")
+ (match_operand:SI 2 "general_operand" "g"))
+ (match_dup 1)))
+ (set (match_operand:DI 0 "register_operand" "=r")
+ (zero_extend:DI (plusminus:SI (match_dup 1) (match_dup 2))))]
+ "TARGET_64BIT && ix86_binary_operator_ok (<CODE>, SImode, operands)"
+ "<plusminus_mnemonic>{l}\t{%2, %k0|%k0, %2}"
[(set_attr "type" "alu")
- (set_attr "mode" "QI")])
+ (set_attr "mode" "SI")])
;; The patterns that match these are at the end of this file.
-(define_expand "subxf3"
+(define_expand "<plusminus_insn>xf3"
[(set (match_operand:XF 0 "register_operand" "")
- (minus:XF (match_operand:XF 1 "register_operand" "")
- (match_operand:XF 2 "register_operand" "")))]
+ (plusminus:XF
+ (match_operand:XF 1 "register_operand" "")
+ (match_operand:XF 2 "register_operand" "")))]
"TARGET_80387"
"")
-(define_expand "sub<mode>3"
+(define_expand "<plusminus_insn><mode>3"
[(set (match_operand:MODEF 0 "register_operand" "")
- (minus:MODEF (match_operand:MODEF 1 "register_operand" "")
- (match_operand:MODEF 2 "nonimmediate_operand" "")))]
+ (plusminus:MODEF
+ (match_operand:MODEF 1 "register_operand" "")
+ (match_operand:MODEF 2 "nonimmediate_operand" "")))]
"(TARGET_80387 && X87_ENABLE_ARITH (<MODE>mode))
|| (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)"
"")
;; Multiply instructions
-(define_expand "muldi3"
- [(parallel [(set (match_operand:DI 0 "register_operand" "")
- (mult:DI (match_operand:DI 1 "register_operand" "")
- (match_operand:DI 2 "x86_64_general_operand" "")))
+(define_expand "mul<mode>3"
+ [(parallel [(set (match_operand:SWIM248 0 "register_operand" "")
+ (mult:SWIM248
+ (match_operand:SWIM248 1 "register_operand" "")
+ (match_operand:SWIM248 2 "<general_operand>" "")))
(clobber (reg:CC FLAGS_REG))])]
- "TARGET_64BIT"
+ ""
"")
-;; On AMDFAM10
-;; IMUL reg64, reg64, imm8 Direct
-;; IMUL reg64, mem64, imm8 VectorPath
-;; IMUL reg64, reg64, imm32 Direct
-;; IMUL reg64, mem64, imm32 VectorPath
-;; IMUL reg64, reg64 Direct
-;; IMUL reg64, mem64 Direct
-
-(define_insn "*muldi3_1_rex64"
- [(set (match_operand:DI 0 "register_operand" "=r,r,r")
- (mult:DI (match_operand:DI 1 "nonimmediate_operand" "%rm,rm,0")
- (match_operand:DI 2 "x86_64_general_operand" "K,e,mr")))
- (clobber (reg:CC FLAGS_REG))]
- "TARGET_64BIT
- && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
- "@
- imul{q}\t{%2, %1, %0|%0, %1, %2}
- imul{q}\t{%2, %1, %0|%0, %1, %2}
- imul{q}\t{%2, %0|%0, %2}"
- [(set_attr "type" "imul")
- (set_attr "prefix_0f" "0,0,1")
- (set (attr "athlon_decode")
- (cond [(eq_attr "cpu" "athlon")
- (const_string "vector")
- (eq_attr "alternative" "1")
- (const_string "vector")
- (and (eq_attr "alternative" "2")
- (match_operand 1 "memory_operand" ""))
- (const_string "vector")]
- (const_string "direct")))
- (set (attr "amdfam10_decode")
- (cond [(and (eq_attr "alternative" "0,1")
- (match_operand 1 "memory_operand" ""))
- (const_string "vector")]
- (const_string "direct")))
- (set_attr "mode" "DI")])
-
-(define_expand "mulsi3"
- [(parallel [(set (match_operand:SI 0 "register_operand" "")
- (mult:SI (match_operand:SI 1 "register_operand" "")
- (match_operand:SI 2 "general_operand" "")))
+(define_expand "mulqi3"
+ [(parallel [(set (match_operand:QI 0 "register_operand" "")
+ (mult:QI
+ (match_operand:QI 1 "register_operand" "")
+ (match_operand:QI 2 "nonimmediate_operand" "")))
(clobber (reg:CC FLAGS_REG))])]
- ""
+ "TARGET_QIMODE_MATH"
"")
;; On AMDFAM10
-;; IMUL reg32, reg32, imm8 Direct
-;; IMUL reg32, mem32, imm8 VectorPath
-;; IMUL reg32, reg32, imm32 Direct
-;; IMUL reg32, mem32, imm32 VectorPath
-;; IMUL reg32, reg32 Direct
-;; IMUL reg32, mem32 Direct
-
-(define_insn "*mulsi3_1"
- [(set (match_operand:SI 0 "register_operand" "=r,r,r")
- (mult:SI (match_operand:SI 1 "nonimmediate_operand" "%rm,rm,0")
- (match_operand:SI 2 "general_operand" "K,i,mr")))
+;; IMUL reg32/64, reg32/64, imm8 Direct
+;; IMUL reg32/64, mem32/64, imm8 VectorPath
+;; IMUL reg32/64, reg32/64, imm32 Direct
+;; IMUL reg32/64, mem32/64, imm32 VectorPath
+;; IMUL reg32/64, reg32/64 Direct
+;; IMUL reg32/64, mem32/64 Direct
+
+(define_insn "*mul<mode>3_1"
+ [(set (match_operand:SWI48 0 "register_operand" "=r,r,r")
+ (mult:SWI48
+ (match_operand:SWI48 1 "nonimmediate_operand" "%rm,rm,0")
+ (match_operand:SWI48 2 "<general_operand>" "K,<i>,mr")))
(clobber (reg:CC FLAGS_REG))]
"!(MEM_P (operands[1]) && MEM_P (operands[2]))"
"@
- imul{l}\t{%2, %1, %0|%0, %1, %2}
- imul{l}\t{%2, %1, %0|%0, %1, %2}
- imul{l}\t{%2, %0|%0, %2}"
+ imul{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}
+ imul{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}
+ imul{<imodesuffix>}\t{%2, %0|%0, %2}"
[(set_attr "type" "imul")
(set_attr "prefix_0f" "0,0,1")
(set (attr "athlon_decode")
@@ -8392,7 +7915,7 @@
(match_operand 1 "memory_operand" ""))
(const_string "vector")]
(const_string "direct")))
- (set_attr "mode" "SI")])
+ (set_attr "mode" "<MODE>")])
(define_insn "*mulsi3_1_zext"
[(set (match_operand:DI 0 "register_operand" "=r,r,r")
@@ -8424,14 +7947,6 @@
(const_string "direct")))
(set_attr "mode" "SI")])
-(define_expand "mulhi3"
- [(parallel [(set (match_operand:HI 0 "register_operand" "")
- (mult:HI (match_operand:HI 1 "register_operand" "")
- (match_operand:HI 2 "general_operand" "")))
- (clobber (reg:CC FLAGS_REG))])]
- "TARGET_HIMODE_MATH"
- "")
-
;; On AMDFAM10
;; IMUL reg16, reg16, imm8 VectorPath
;; IMUL reg16, mem16, imm8 VectorPath
@@ -8439,12 +7954,14 @@
;; IMUL reg16, mem16, imm16 VectorPath
;; IMUL reg16, reg16 Direct
;; IMUL reg16, mem16 Direct
+
(define_insn "*mulhi3_1"
[(set (match_operand:HI 0 "register_operand" "=r,r,r")
(mult:HI (match_operand:HI 1 "nonimmediate_operand" "%rm,rm,0")
(match_operand:HI 2 "general_operand" "K,n,mr")))
(clobber (reg:CC FLAGS_REG))]
- "!(MEM_P (operands[1]) && MEM_P (operands[2]))"
+ "TARGET_HIMODE_MATH
+ && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
"@
imul{w}\t{%2, %1, %0|%0, %1, %2}
imul{w}\t{%2, %1, %0|%0, %1, %2}
@@ -8463,14 +7980,6 @@
(const_string "direct")))
(set_attr "mode" "HI")])
-(define_expand "mulqi3"
- [(parallel [(set (match_operand:QI 0 "register_operand" "")
- (mult:QI (match_operand:QI 1 "nonimmediate_operand" "")
- (match_operand:QI 2 "register_operand" "")))
- (clobber (reg:CC FLAGS_REG))])]
- "TARGET_QIMODE_MATH"
- "")
-
;;On AMDFAM10
;; MUL reg8 Direct
;; MUL mem8 Direct
@@ -8492,131 +8001,38 @@
(set_attr "amdfam10_decode" "direct")
(set_attr "mode" "QI")])
-(define_expand "umulqihi3"
- [(parallel [(set (match_operand:HI 0 "register_operand" "")
- (mult:HI (zero_extend:HI
- (match_operand:QI 1 "nonimmediate_operand" ""))
- (zero_extend:HI
- (match_operand:QI 2 "register_operand" ""))))
+(define_expand "<u>mul<mode><dwi>3"
+ [(parallel [(set (match_operand:<DWI> 0 "register_operand" "")
+ (mult:<DWI>
+ (any_extend:<DWI>
+ (match_operand:DWIH 1 "nonimmediate_operand" ""))
+ (any_extend:<DWI>
+ (match_operand:DWIH 2 "register_operand" ""))))
(clobber (reg:CC FLAGS_REG))])]
- "TARGET_QIMODE_MATH"
+ ""
"")
-(define_insn "*umulqihi3_1"
- [(set (match_operand:HI 0 "register_operand" "=a")
- (mult:HI (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "%0"))
- (zero_extend:HI (match_operand:QI 2 "nonimmediate_operand" "qm"))))
- (clobber (reg:CC FLAGS_REG))]
- "TARGET_QIMODE_MATH
- && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
- "mul{b}\t%2"
- [(set_attr "type" "imul")
- (set_attr "length_immediate" "0")
- (set (attr "athlon_decode")
- (if_then_else (eq_attr "cpu" "athlon")
- (const_string "vector")
- (const_string "direct")))
- (set_attr "amdfam10_decode" "direct")
- (set_attr "mode" "QI")])
-
-(define_expand "mulqihi3"
+(define_expand "<u>mulqihi3"
[(parallel [(set (match_operand:HI 0 "register_operand" "")
- (mult:HI (sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" ""))
- (sign_extend:HI (match_operand:QI 2 "register_operand" ""))))
+ (mult:HI
+ (any_extend:HI
+ (match_operand:QI 1 "nonimmediate_operand" ""))
+ (any_extend:HI
+ (match_operand:QI 2 "register_operand" ""))))
(clobber (reg:CC FLAGS_REG))])]
"TARGET_QIMODE_MATH"
"")
-(define_insn "*mulqihi3_insn"
- [(set (match_operand:HI 0 "register_operand" "=a")
- (mult:HI (sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" "%0"))
- (sign_extend:HI (match_operand:QI 2 "nonimmediate_operand" "qm"))))
- (clobber (reg:CC FLAGS_REG))]
- "TARGET_QIMODE_MATH
- && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
- "imul{b}\t%2"
- [(set_attr "type" "imul")
- (set_attr "length_immediate" "0")
- (set (attr "athlon_decode")
- (if_then_else (eq_attr "cpu" "athlon")
- (const_string "vector")
- (const_string "direct")))
- (set_attr "amdfam10_decode" "direct")
- (set_attr "mode" "QI")])
-
-(define_expand "umulditi3"
- [(parallel [(set (match_operand:TI 0 "register_operand" "")
- (mult:TI (zero_extend:TI
- (match_operand:DI 1 "nonimmediate_operand" ""))
- (zero_extend:TI
- (match_operand:DI 2 "register_operand" ""))))
- (clobber (reg:CC FLAGS_REG))])]
- "TARGET_64BIT"
- "")
-
-(define_insn "*umulditi3_insn"
- [(set (match_operand:TI 0 "register_operand" "=A")
- (mult:TI (zero_extend:TI (match_operand:DI 1 "nonimmediate_operand" "%0"))
- (zero_extend:TI (match_operand:DI 2 "nonimmediate_operand" "rm"))))
- (clobber (reg:CC FLAGS_REG))]
- "TARGET_64BIT
- && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
- "mul{q}\t%2"
- [(set_attr "type" "imul")
- (set_attr "length_immediate" "0")
- (set (attr "athlon_decode")
- (if_then_else (eq_attr "cpu" "athlon")
- (const_string "vector")
- (const_string "double")))
- (set_attr "amdfam10_decode" "double")
- (set_attr "mode" "DI")])
-
-;; We can't use this pattern in 64bit mode, since it results in two separate 32bit registers
-(define_expand "umulsidi3"
- [(parallel [(set (match_operand:DI 0 "register_operand" "")
- (mult:DI (zero_extend:DI
- (match_operand:SI 1 "nonimmediate_operand" ""))
- (zero_extend:DI
- (match_operand:SI 2 "register_operand" ""))))
- (clobber (reg:CC FLAGS_REG))])]
- "!TARGET_64BIT"
- "")
-
-(define_insn "*umulsidi3_insn"
- [(set (match_operand:DI 0 "register_operand" "=A")
- (mult:DI (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "%0"))
- (zero_extend:DI (match_operand:SI 2 "nonimmediate_operand" "rm"))))
- (clobber (reg:CC FLAGS_REG))]
- "!TARGET_64BIT
- && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
- "mul{l}\t%2"
- [(set_attr "type" "imul")
- (set_attr "length_immediate" "0")
- (set (attr "athlon_decode")
- (if_then_else (eq_attr "cpu" "athlon")
- (const_string "vector")
- (const_string "double")))
- (set_attr "amdfam10_decode" "double")
- (set_attr "mode" "SI")])
-
-(define_expand "mulditi3"
- [(parallel [(set (match_operand:TI 0 "register_operand" "")
- (mult:TI (sign_extend:TI
- (match_operand:DI 1 "nonimmediate_operand" ""))
- (sign_extend:TI
- (match_operand:DI 2 "register_operand" ""))))
- (clobber (reg:CC FLAGS_REG))])]
- "TARGET_64BIT"
- "")
-
-(define_insn "*mulditi3_insn"
- [(set (match_operand:TI 0 "register_operand" "=A")
- (mult:TI (sign_extend:TI (match_operand:DI 1 "nonimmediate_operand" "%0"))
- (sign_extend:TI (match_operand:DI 2 "nonimmediate_operand" "rm"))))
+(define_insn "*<u>mul<mode><dwi>3_1"
+ [(set (match_operand:<DWI> 0 "register_operand" "=A")
+ (mult:<DWI>
+ (any_extend:<DWI>
+ (match_operand:DWIH 1 "nonimmediate_operand" "%0"))
+ (any_extend:<DWI>
+ (match_operand:DWIH 2 "nonimmediate_operand" "rm"))))
(clobber (reg:CC FLAGS_REG))]
- "TARGET_64BIT
- && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
- "imul{q}\t%2"
+ "!(MEM_P (operands[1]) && MEM_P (operands[2]))"
+ "<sgnprefix>mul{<imodesuffix>}\t%2"
[(set_attr "type" "imul")
(set_attr "length_immediate" "0")
(set (attr "athlon_decode")
@@ -8624,63 +8040,58 @@
(const_string "vector")
(const_string "double")))
(set_attr "amdfam10_decode" "double")
- (set_attr "mode" "DI")])
-
-(define_expand "mulsidi3"
- [(parallel [(set (match_operand:DI 0 "register_operand" "")
- (mult:DI (sign_extend:DI
- (match_operand:SI 1 "nonimmediate_operand" ""))
- (sign_extend:DI
- (match_operand:SI 2 "register_operand" ""))))
- (clobber (reg:CC FLAGS_REG))])]
- "!TARGET_64BIT"
- "")
+ (set_attr "mode" "<MODE>")])
-(define_insn "*mulsidi3_insn"
- [(set (match_operand:DI 0 "register_operand" "=A")
- (mult:DI (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "%0"))
- (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "rm"))))
+(define_insn "*<u>mulqihi3_1"
+ [(set (match_operand:HI 0 "register_operand" "=a")
+ (mult:HI
+ (any_extend:HI
+ (match_operand:QI 1 "nonimmediate_operand" "%0"))
+ (any_extend:HI
+ (match_operand:QI 2 "nonimmediate_operand" "qm"))))
(clobber (reg:CC FLAGS_REG))]
- "!TARGET_64BIT
+ "TARGET_QIMODE_MATH
&& !(MEM_P (operands[1]) && MEM_P (operands[2]))"
- "imul{l}\t%2"
+ "<sgnprefix>mul{b}\t%2"
[(set_attr "type" "imul")
(set_attr "length_immediate" "0")
(set (attr "athlon_decode")
(if_then_else (eq_attr "cpu" "athlon")
(const_string "vector")
- (const_string "double")))
- (set_attr "amdfam10_decode" "double")
- (set_attr "mode" "SI")])
+ (const_string "direct")))
+ (set_attr "amdfam10_decode" "direct")
+ (set_attr "mode" "QI")])
-(define_expand "umuldi3_highpart"
- [(parallel [(set (match_operand:DI 0 "register_operand" "")
- (truncate:DI
- (lshiftrt:TI
- (mult:TI (zero_extend:TI
- (match_operand:DI 1 "nonimmediate_operand" ""))
- (zero_extend:TI
- (match_operand:DI 2 "register_operand" "")))
- (const_int 64))))
- (clobber (match_scratch:DI 3 ""))
+(define_expand "<s>mul<mode>3_highpart"
+ [(parallel [(set (match_operand:SWI48 0 "register_operand" "")
+ (truncate:SWI48
+ (lshiftrt:<DWI>
+ (mult:<DWI>
+ (any_extend:<DWI>
+ (match_operand:SWI48 1 "nonimmediate_operand" ""))
+ (any_extend:<DWI>
+ (match_operand:SWI48 2 "register_operand" "")))
+ (match_dup 4))))
+ (clobber (match_scratch:SWI48 3 ""))
(clobber (reg:CC FLAGS_REG))])]
- "TARGET_64BIT"
- "")
+ ""
+ "operands[4] = GEN_INT (GET_MODE_BITSIZE (<MODE>mode));")
-(define_insn "*umuldi3_highpart_rex64"
+(define_insn "*<s>muldi3_highpart_1"
[(set (match_operand:DI 0 "register_operand" "=d")
(truncate:DI
(lshiftrt:TI
- (mult:TI (zero_extend:TI
- (match_operand:DI 1 "nonimmediate_operand" "%a"))
- (zero_extend:TI
- (match_operand:DI 2 "nonimmediate_operand" "rm")))
+ (mult:TI
+ (any_extend:TI
+ (match_operand:DI 1 "nonimmediate_operand" "%a"))
+ (any_extend:TI
+ (match_operand:DI 2 "nonimmediate_operand" "rm")))
(const_int 64))))
(clobber (match_scratch:DI 3 "=1"))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT
&& !(MEM_P (operands[1]) && MEM_P (operands[2]))"
- "mul{q}\t%2"
+ "<sgnprefix>mul{q}\t%2"
[(set_attr "type" "imul")
(set_attr "length_immediate" "0")
(set (attr "athlon_decode")
@@ -8690,33 +8101,20 @@
(set_attr "amdfam10_decode" "double")
(set_attr "mode" "DI")])
-(define_expand "umulsi3_highpart"
- [(parallel [(set (match_operand:SI 0 "register_operand" "")
- (truncate:SI
- (lshiftrt:DI
- (mult:DI (zero_extend:DI
- (match_operand:SI 1 "nonimmediate_operand" ""))
- (zero_extend:DI
- (match_operand:SI 2 "register_operand" "")))
- (const_int 32))))
- (clobber (match_scratch:SI 3 ""))
- (clobber (reg:CC FLAGS_REG))])]
- ""
- "")
-
-(define_insn "*umulsi3_highpart_insn"
+(define_insn "*<s>mulsi3_highpart_1"
[(set (match_operand:SI 0 "register_operand" "=d")
(truncate:SI
(lshiftrt:DI
- (mult:DI (zero_extend:DI
- (match_operand:SI 1 "nonimmediate_operand" "%a"))
- (zero_extend:DI
- (match_operand:SI 2 "nonimmediate_operand" "rm")))
+ (mult:DI
+ (any_extend:DI
+ (match_operand:SI 1 "nonimmediate_operand" "%a"))
+ (any_extend:DI
+ (match_operand:SI 2 "nonimmediate_operand" "rm")))
(const_int 32))))
(clobber (match_scratch:SI 3 "=1"))
(clobber (reg:CC FLAGS_REG))]
"!(MEM_P (operands[1]) && MEM_P (operands[2]))"
- "mul{l}\t%2"
+ "<sgnprefix>mul{l}\t%2"
[(set_attr "type" "imul")
(set_attr "length_immediate" "0")
(set (attr "athlon_decode")
@@ -8726,20 +8124,20 @@
(set_attr "amdfam10_decode" "double")
(set_attr "mode" "SI")])
-(define_insn "*umulsi3_highpart_zext"
+(define_insn "*<s>mulsi3_highpart_zext"
[(set (match_operand:DI 0 "register_operand" "=d")
(zero_extend:DI (truncate:SI
(lshiftrt:DI
- (mult:DI (zero_extend:DI
+ (mult:DI (any_extend:DI
(match_operand:SI 1 "nonimmediate_operand" "%a"))
- (zero_extend:DI
+ (any_extend:DI
(match_operand:SI 2 "nonimmediate_operand" "rm")))
(const_int 32)))))
(clobber (match_scratch:SI 3 "=1"))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT
&& !(MEM_P (operands[1]) && MEM_P (operands[2]))"
- "mul{l}\t%2"
+ "<sgnprefix>mul{l}\t%2"
[(set_attr "type" "imul")
(set_attr "length_immediate" "0")
(set (attr "athlon_decode")
@@ -8749,99 +8147,6 @@
(set_attr "amdfam10_decode" "double")
(set_attr "mode" "SI")])
-(define_expand "smuldi3_highpart"
- [(parallel [(set (match_operand:DI 0 "register_operand" "")
- (truncate:DI
- (lshiftrt:TI
- (mult:TI (sign_extend:TI
- (match_operand:DI 1 "nonimmediate_operand" ""))
- (sign_extend:TI
- (match_operand:DI 2 "register_operand" "")))
- (const_int 64))))
- (clobber (match_scratch:DI 3 ""))
- (clobber (reg:CC FLAGS_REG))])]
- "TARGET_64BIT"
- "")
-
-(define_insn "*smuldi3_highpart_rex64"
- [(set (match_operand:DI 0 "register_operand" "=d")
- (truncate:DI
- (lshiftrt:TI
- (mult:TI (sign_extend:TI
- (match_operand:DI 1 "nonimmediate_operand" "%a"))
- (sign_extend:TI
- (match_operand:DI 2 "nonimmediate_operand" "rm")))
- (const_int 64))))
- (clobber (match_scratch:DI 3 "=1"))
- (clobber (reg:CC FLAGS_REG))]
- "TARGET_64BIT
- && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
- "imul{q}\t%2"
- [(set_attr "type" "imul")
- (set (attr "athlon_decode")
- (if_then_else (eq_attr "cpu" "athlon")
- (const_string "vector")
- (const_string "double")))
- (set_attr "amdfam10_decode" "double")
- (set_attr "mode" "DI")])
-
-(define_expand "smulsi3_highpart"
- [(parallel [(set (match_operand:SI 0 "register_operand" "")
- (truncate:SI
- (lshiftrt:DI
- (mult:DI (sign_extend:DI
- (match_operand:SI 1 "nonimmediate_operand" ""))
- (sign_extend:DI
- (match_operand:SI 2 "register_operand" "")))
- (const_int 32))))
- (clobber (match_scratch:SI 3 ""))
- (clobber (reg:CC FLAGS_REG))])]
- ""
- "")
-
-(define_insn "*smulsi3_highpart_insn"
- [(set (match_operand:SI 0 "register_operand" "=d")
- (truncate:SI
- (lshiftrt:DI
- (mult:DI (sign_extend:DI
- (match_operand:SI 1 "nonimmediate_operand" "%a"))
- (sign_extend:DI
- (match_operand:SI 2 "nonimmediate_operand" "rm")))
- (const_int 32))))
- (clobber (match_scratch:SI 3 "=1"))
- (clobber (reg:CC FLAGS_REG))]
- "!(MEM_P (operands[1]) && MEM_P (operands[2]))"
- "imul{l}\t%2"
- [(set_attr "type" "imul")
- (set (attr "athlon_decode")
- (if_then_else (eq_attr "cpu" "athlon")
- (const_string "vector")
- (const_string "double")))
- (set_attr "amdfam10_decode" "double")
- (set_attr "mode" "SI")])
-
-(define_insn "*smulsi3_highpart_zext"
- [(set (match_operand:DI 0 "register_operand" "=d")
- (zero_extend:DI (truncate:SI
- (lshiftrt:DI
- (mult:DI (sign_extend:DI
- (match_operand:SI 1 "nonimmediate_operand" "%a"))
- (sign_extend:DI
- (match_operand:SI 2 "nonimmediate_operand" "rm")))
- (const_int 32)))))
- (clobber (match_scratch:SI 3 "=1"))
- (clobber (reg:CC FLAGS_REG))]
- "TARGET_64BIT
- && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
- "imul{l}\t%2"
- [(set_attr "type" "imul")
- (set (attr "athlon_decode")
- (if_then_else (eq_attr "cpu" "athlon")
- (const_string "vector")
- (const_string "double")))
- (set_attr "amdfam10_decode" "double")
- (set_attr "mode" "SI")])
-
;; The patterns that match these are at the end of this file.
(define_expand "mulxf3"
@@ -8858,27 +8163,17 @@
"(TARGET_80387 && X87_ENABLE_ARITH (<MODE>mode))
|| (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)"
"")
-
;; Divide instructions
-(define_insn "divqi3"
+(define_insn "<u>divqi3"
[(set (match_operand:QI 0 "register_operand" "=a")
- (div:QI (match_operand:HI 1 "register_operand" "0")
- (match_operand:QI 2 "nonimmediate_operand" "qm")))
+ (any_div:QI
+ (match_operand:HI 1 "register_operand" "0")
+ (match_operand:QI 2 "nonimmediate_operand" "qm")))
(clobber (reg:CC FLAGS_REG))]
"TARGET_QIMODE_MATH"
- "idiv{b}\t%2"
- [(set_attr "type" "idiv")
- (set_attr "mode" "QI")])
-
-(define_insn "udivqi3"
- [(set (match_operand:QI 0 "register_operand" "=a")
- (udiv:QI (match_operand:HI 1 "register_operand" "0")
- (match_operand:QI 2 "nonimmediate_operand" "qm")))
- (clobber (reg:CC FLAGS_REG))]
- "TARGET_QIMODE_MATH"
- "div{b}\t%2"
+ "<sgnprefix>div{b}\t%2"
[(set_attr "type" "idiv")
(set_attr "mode" "QI")])
@@ -8919,33 +8214,33 @@
;; Divmod instructions.
(define_expand "divmod<mode>4"
- [(parallel [(set (match_operand:SWI248 0 "register_operand" "")
- (div:SWI248
- (match_operand:SWI248 1 "register_operand" "")
- (match_operand:SWI248 2 "nonimmediate_operand" "")))
- (set (match_operand:SWI248 3 "register_operand" "")
- (mod:SWI248 (match_dup 1) (match_dup 2)))
+ [(parallel [(set (match_operand:SWIM248 0 "register_operand" "")
+ (div:SWIM248
+ (match_operand:SWIM248 1 "register_operand" "")
+ (match_operand:SWIM248 2 "nonimmediate_operand" "")))
+ (set (match_operand:SWIM248 3 "register_operand" "")
+ (mod:SWIM248 (match_dup 1) (match_dup 2)))
(clobber (reg:CC FLAGS_REG))])]
- "(<MODE>mode != HImode) || TARGET_HIMODE_MATH"
+ ""
"")
(define_insn_and_split "*divmod<mode>4"
- [(set (match_operand:SWI248 0 "register_operand" "=a")
- (div:SWI248 (match_operand:SWI248 2 "register_operand" "0")
- (match_operand:SWI248 3 "nonimmediate_operand" "rm")))
- (set (match_operand:SWI248 1 "register_operand" "=&d")
- (mod:SWI248 (match_dup 2) (match_dup 3)))
+ [(set (match_operand:SWIM248 0 "register_operand" "=a")
+ (div:SWIM248 (match_operand:SWIM248 2 "register_operand" "0")
+ (match_operand:SWIM248 3 "nonimmediate_operand" "rm")))
+ (set (match_operand:SWIM248 1 "register_operand" "=&d")
+ (mod:SWIM248 (match_dup 2) (match_dup 3)))
(clobber (reg:CC FLAGS_REG))]
- "(<MODE>mode != HImode) || TARGET_HIMODE_MATH"
+ ""
"#"
"&& reload_completed"
[(parallel [(set (match_dup 1)
- (ashiftrt:SWI248 (match_dup 4) (match_dup 5)))
+ (ashiftrt:SWIM248 (match_dup 4) (match_dup 5)))
(clobber (reg:CC FLAGS_REG))])
(parallel [(set (match_dup 0)
- (div:SWI248 (match_dup 2) (match_dup 3)))
+ (div:SWIM248 (match_dup 2) (match_dup 3)))
(set (match_dup 1)
- (mod:SWI248 (match_dup 2) (match_dup 3)))
+ (mod:SWIM248 (match_dup 2) (match_dup 3)))
(use (match_dup 1))
(clobber (reg:CC FLAGS_REG))])]
{
@@ -8965,12 +8260,12 @@
(set_attr "mode" "<MODE>")])
(define_insn "*divmod<mode>4_noext"
- [(set (match_operand:SWI248 0 "register_operand" "=a")
- (div:SWI248 (match_operand:SWI248 2 "register_operand" "0")
- (match_operand:SWI248 3 "nonimmediate_operand" "rm")))
- (set (match_operand:SWI248 1 "register_operand" "=d")
- (mod:SWI248 (match_dup 2) (match_dup 3)))
- (use (match_operand:SWI248 4 "register_operand" "1"))
+ [(set (match_operand:SWIM248 0 "register_operand" "=a")
+ (div:SWIM248 (match_operand:SWIM248 2 "register_operand" "0")
+ (match_operand:SWIM248 3 "nonimmediate_operand" "rm")))
+ (set (match_operand:SWIM248 1 "register_operand" "=d")
+ (mod:SWIM248 (match_dup 2) (match_dup 3)))
+ (use (match_operand:SWIM248 4 "register_operand" "1"))
(clobber (reg:CC FLAGS_REG))]
""
"idiv{<imodesuffix>}\t%3"
@@ -8978,31 +8273,31 @@
(set_attr "mode" "<MODE>")])
(define_expand "udivmod<mode>4"
- [(parallel [(set (match_operand:SWI248 0 "register_operand" "")
- (udiv:SWI248
- (match_operand:SWI248 1 "register_operand" "")
- (match_operand:SWI248 2 "nonimmediate_operand" "")))
- (set (match_operand:SWI248 3 "register_operand" "")
- (umod:SWI248 (match_dup 1) (match_dup 2)))
+ [(parallel [(set (match_operand:SWIM248 0 "register_operand" "")
+ (udiv:SWIM248
+ (match_operand:SWIM248 1 "register_operand" "")
+ (match_operand:SWIM248 2 "nonimmediate_operand" "")))
+ (set (match_operand:SWIM248 3 "register_operand" "")
+ (umod:SWIM248 (match_dup 1) (match_dup 2)))
(clobber (reg:CC FLAGS_REG))])]
- "(<MODE>mode != HImode) || TARGET_HIMODE_MATH"
+ ""
"")
(define_insn_and_split "*udivmod<mode>4"
- [(set (match_operand:SWI248 0 "register_operand" "=a")
- (udiv:SWI248 (match_operand:SWI248 2 "register_operand" "0")
- (match_operand:SWI248 3 "nonimmediate_operand" "rm")))
- (set (match_operand:SWI248 1 "register_operand" "=&d")
- (umod:SWI248 (match_dup 2) (match_dup 3)))
+ [(set (match_operand:SWIM248 0 "register_operand" "=a")
+ (udiv:SWIM248 (match_operand:SWIM248 2 "register_operand" "0")
+ (match_operand:SWIM248 3 "nonimmediate_operand" "rm")))
+ (set (match_operand:SWIM248 1 "register_operand" "=&d")
+ (umod:SWIM248 (match_dup 2) (match_dup 3)))
(clobber (reg:CC FLAGS_REG))]
- "(<MODE>mode != HImode) || TARGET_HIMODE_MATH"
+ ""
"#"
"&& reload_completed"
[(set (match_dup 1) (const_int 0))
(parallel [(set (match_dup 0)
- (udiv:SWI248 (match_dup 2) (match_dup 3)))
+ (udiv:SWIM248 (match_dup 2) (match_dup 3)))
(set (match_dup 1)
- (umod:SWI248 (match_dup 2) (match_dup 3)))
+ (umod:SWIM248 (match_dup 2) (match_dup 3)))
(use (match_dup 1))
(clobber (reg:CC FLAGS_REG))])]
""
@@ -9010,14 +8305,14 @@
(set_attr "mode" "<MODE>")])
(define_insn "*udivmod<mode>4_noext"
- [(set (match_operand:SWI248 0 "register_operand" "=a")
- (udiv:SWI248 (match_operand:SWI248 2 "register_operand" "0")
- (match_operand:SWI248 3 "nonimmediate_operand" "rm")))
- (set (match_operand:SWI248 1 "register_operand" "=d")
- (umod:SWI248 (match_dup 2) (match_dup 3)))
- (use (match_operand:SWI248 4 "register_operand" "1"))
+ [(set (match_operand:SWIM248 0 "register_operand" "=a")
+ (udiv:SWIM248 (match_operand:SWIM248 2 "register_operand" "0")
+ (match_operand:SWIM248 3 "nonimmediate_operand" "rm")))
+ (set (match_operand:SWIM248 1 "register_operand" "=d")
+ (umod:SWIM248 (match_dup 2) (match_dup 3)))
+ (use (match_operand:SWIM248 4 "register_operand" "1"))
(clobber (reg:CC FLAGS_REG))]
- "(<MODE>mode != HImode) || TARGET_HIMODE_MATH"
+ ""
"div{<imodesuffix>}\t%3"
[(set_attr "type" "idiv")
(set_attr "mode" "<MODE>")])
@@ -9301,7 +8596,8 @@
else if (GET_CODE (val) == SUBREG
&& (submode = GET_MODE (SUBREG_REG (val)),
GET_MODE_BITSIZE (mode) > GET_MODE_BITSIZE (submode))
- && pos + len <= GET_MODE_BITSIZE (submode))
+ && pos + len <= GET_MODE_BITSIZE (submode)
+ && GET_MODE_CLASS (submode) == MODE_INT)
{
/* Narrow a paradoxical subreg to prevent partial register stalls. */
mode = submode;
@@ -14505,11 +13801,53 @@
;; For all sCOND expanders, also expand the compare or test insn that
;; generates cc0. Generate an equality comparison if `seq' or `sne'.
-;; %%% Do the expansion to SImode. If PII, do things the xor+setcc way
-;; to avoid partial register stalls. Otherwise do things the setcc+movzx
-;; way, which can later delete the movzx if only QImode is needed.
+(define_insn_and_split "*setcc_di_1"
+ [(set (match_operand:DI 0 "register_operand" "=q")
+ (match_operator:DI 1 "ix86_comparison_operator"
+ [(reg FLAGS_REG) (const_int 0)]))]
+ "TARGET_64BIT && !TARGET_PARTIAL_REG_STALL"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 2) (match_dup 1))
+ (set (match_dup 0) (zero_extend:DI (match_dup 2)))]
+{
+ PUT_MODE (operands[1], QImode);
+ operands[2] = gen_lowpart (QImode, operands[0]);
+})
+
+(define_insn_and_split "*setcc_si_1_and"
+ [(set (match_operand:SI 0 "register_operand" "=q")
+ (match_operator:SI 1 "ix86_comparison_operator"
+ [(reg FLAGS_REG) (const_int 0)]))
+ (clobber (reg:CC FLAGS_REG))]
+ "!TARGET_PARTIAL_REG_STALL
+ && TARGET_ZERO_EXTEND_WITH_AND && optimize_function_for_speed_p (cfun)"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 2) (match_dup 1))
+ (parallel [(set (match_dup 0) (zero_extend:SI (match_dup 2)))
+ (clobber (reg:CC FLAGS_REG))])]
+{
+ PUT_MODE (operands[1], QImode);
+ operands[2] = gen_lowpart (QImode, operands[0]);
+})
+
+(define_insn_and_split "*setcc_si_1_movzbl"
+ [(set (match_operand:SI 0 "register_operand" "=q")
+ (match_operator:SI 1 "ix86_comparison_operator"
+ [(reg FLAGS_REG) (const_int 0)]))]
+ "!TARGET_PARTIAL_REG_STALL
+ && (!TARGET_ZERO_EXTEND_WITH_AND || optimize_function_for_size_p (cfun))"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 2) (match_dup 1))
+ (set (match_dup 0) (zero_extend:SI (match_dup 2)))]
+{
+ PUT_MODE (operands[1], QImode);
+ operands[2] = gen_lowpart (QImode, operands[0]);
+})
-(define_insn "*setcc_1"
+(define_insn "*setcc_qi"
[(set (match_operand:QI 0 "nonimmediate_operand" "=qm")
(match_operator:QI 1 "ix86_comparison_operator"
[(reg FLAGS_REG) (const_int 0)]))]
@@ -14518,7 +13856,7 @@
[(set_attr "type" "setcc")
(set_attr "mode" "QI")])
-(define_insn "*setcc_2"
+(define_insn "*setcc_qi_slp"
[(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm"))
(match_operator:QI 1 "ix86_comparison_operator"
[(reg FLAGS_REG) (const_int 0)]))]
@@ -15252,12 +14590,25 @@
}
[(set_attr "type" "call")])
-(define_insn "*call_pop_1"
+(define_insn "*call_pop_1_esp"
[(call (mem:QI (match_operand:SI 0 "call_insn_operand" "rsm"))
(match_operand:SI 1 "" ""))
(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG)
(match_operand:SI 2 "immediate_operand" "i")))]
- "!SIBLING_CALL_P (insn) && !TARGET_64BIT"
+ "!TARGET_64BIT && TARGET_CALL_ESP && !SIBLING_CALL_P (insn)"
+{
+ if (constant_call_address_operand (operands[0], Pmode))
+ return "call\t%P0";
+ return "call\t%A0";
+}
+ [(set_attr "type" "call")])
+
+(define_insn "*call_pop_1"
+ [(call (mem:QI (match_operand:SI 0 "call_insn_operand" "lsm"))
+ (match_operand:SI 1 "" ""))
+ (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG)
+ (match_operand:SI 2 "immediate_operand" "i")))]
+ "!TARGET_64BIT && !TARGET_CALL_ESP && !SIBLING_CALL_P (insn)"
{
if (constant_call_address_operand (operands[0], Pmode))
return "call\t%P0";
@@ -15270,7 +14621,7 @@
(match_operand:SI 1 "" ""))
(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG)
(match_operand:SI 2 "immediate_operand" "i,i")))]
- "SIBLING_CALL_P (insn) && !TARGET_64BIT"
+ "!TARGET_64BIT && SIBLING_CALL_P (insn)"
"@
jmp\t%P0
jmp\t%A0"
@@ -15308,10 +14659,21 @@
}
[(set_attr "type" "call")])
-(define_insn "*call_1"
+(define_insn "*call_1_esp"
[(call (mem:QI (match_operand:SI 0 "call_insn_operand" "rsm"))
(match_operand 1 "" ""))]
- "!SIBLING_CALL_P (insn) && !TARGET_64BIT"
+ "!TARGET_64BIT && TARGET_CALL_ESP && !SIBLING_CALL_P (insn)"
+{
+ if (constant_call_address_operand (operands[0], Pmode))
+ return "call\t%P0";
+ return "call\t%A0";
+}
+ [(set_attr "type" "call")])
+
+(define_insn "*call_1"
+ [(call (mem:QI (match_operand:SI 0 "call_insn_operand" "lsm"))
+ (match_operand 1 "" ""))]
+ "!TARGET_64BIT && !TARGET_CALL_ESP && !SIBLING_CALL_P (insn)"
{
if (constant_call_address_operand (operands[0], Pmode))
return "call\t%P0";
@@ -15322,7 +14684,7 @@
(define_insn "*sibcall_1"
[(call (mem:QI (match_operand:SI 0 "sibcall_insn_operand" "s,U"))
(match_operand 1 "" ""))]
- "SIBLING_CALL_P (insn) && !TARGET_64BIT"
+ "!TARGET_64BIT && SIBLING_CALL_P (insn)"
"@
jmp\t%P0
jmp\t%A0"
@@ -15331,7 +14693,7 @@
(define_insn "*call_1_rex64"
[(call (mem:QI (match_operand:DI 0 "call_insn_operand" "rsm"))
(match_operand 1 "" ""))]
- "!SIBLING_CALL_P (insn) && TARGET_64BIT
+ "TARGET_64BIT && !SIBLING_CALL_P (insn)
&& ix86_cmodel != CM_LARGE && ix86_cmodel != CM_LARGE_PIC"
{
if (constant_call_address_operand (operands[0], Pmode))
@@ -15356,7 +14718,7 @@
(clobber (reg:TI XMM15_REG))
(clobber (reg:DI SI_REG))
(clobber (reg:DI DI_REG))]
- "!SIBLING_CALL_P (insn) && TARGET_64BIT"
+ "TARGET_64BIT && !SIBLING_CALL_P (insn)"
{
if (constant_call_address_operand (operands[0], Pmode))
return "call\t%P0";
@@ -15367,14 +14729,14 @@
(define_insn "*call_1_rex64_large"
[(call (mem:QI (match_operand:DI 0 "call_insn_operand" "rm"))
(match_operand 1 "" ""))]
- "!SIBLING_CALL_P (insn) && TARGET_64BIT"
+ "TARGET_64BIT && !SIBLING_CALL_P (insn)"
"call\t%A0"
[(set_attr "type" "call")])
(define_insn "*sibcall_1_rex64"
[(call (mem:QI (match_operand:DI 0 "sibcall_insn_operand" "s,U"))
(match_operand 1 "" ""))]
- "SIBLING_CALL_P (insn) && TARGET_64BIT"
+ "TARGET_64BIT && SIBLING_CALL_P (insn)"
"@
jmp\t%P0
jmp\t%A0"
@@ -15566,6 +14928,16 @@
(set_attr "length_immediate" "0")
(set_attr "modrm" "0")])
+(define_insn "vswapmov"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (match_operand:SI 1 "register_operand" "r"))
+ (unspec_volatile [(const_int 0)] UNSPECV_VSWAPMOV)]
+ ""
+ "movl.s\t{%1, %0|%0, %1}"
+ [(set_attr "length" "2")
+ (set_attr "length_immediate" "0")
+ (set_attr "modrm" "0")])
+
;; Pad to 16-byte boundary, max skip in op0. Used to avoid
;; branch prediction penalty for the third jump in a 16-byte
;; block on K8.
@@ -18734,25 +18106,13 @@
&& flag_unsafe_math_optimizations"
"")
-(define_expand "lfloor<mode>di2"
- [(match_operand:DI 0 "nonimmediate_operand" "")
+(define_expand "lfloor<MODEF:mode><SWI48:mode>2"
+ [(match_operand:SWI48 0 "nonimmediate_operand" "")
(match_operand:MODEF 1 "register_operand" "")]
- "SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH && TARGET_64BIT
- && !flag_trapping_math"
-{
- if (optimize_insn_for_size_p ())
- FAIL;
- ix86_expand_lfloorceil (operand0, operand1, true);
- DONE;
-})
-
-(define_expand "lfloor<mode>si2"
- [(match_operand:SI 0 "nonimmediate_operand" "")
- (match_operand:MODEF 1 "register_operand" "")]
- "SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH
+ "SSE_FLOAT_MODE_P (<MODEF:MODE>mode) && TARGET_SSE_MATH
&& !flag_trapping_math"
{
- if (optimize_insn_for_size_p () && TARGET_64BIT)
+ if (TARGET_64BIT && optimize_insn_for_size_p ())
FAIL;
ix86_expand_lfloorceil (operand0, operand1, true);
DONE;
@@ -19008,20 +18368,10 @@
&& flag_unsafe_math_optimizations"
"")
-(define_expand "lceil<mode>di2"
- [(match_operand:DI 0 "nonimmediate_operand" "")
- (match_operand:MODEF 1 "register_operand" "")]
- "SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH && TARGET_64BIT
- && !flag_trapping_math"
-{
- ix86_expand_lfloorceil (operand0, operand1, false);
- DONE;
-})
-
-(define_expand "lceil<mode>si2"
- [(match_operand:SI 0 "nonimmediate_operand" "")
+(define_expand "lceil<MODEF:mode><SWI48:mode>2"
+ [(match_operand:SWI48 0 "nonimmediate_operand" "")
(match_operand:MODEF 1 "register_operand" "")]
- "SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH
+ "SSE_FLOAT_MODE_P (<MODEF:MODE>mode) && TARGET_SSE_MATH
&& !flag_trapping_math"
{
ix86_expand_lfloorceil (operand0, operand1, false);
@@ -20168,22 +19518,26 @@
;; Conditional move instructions.
-(define_expand "movdicc"
- [(set (match_operand:DI 0 "register_operand" "")
- (if_then_else:DI (match_operand 1 "comparison_operator" "")
- (match_operand:DI 2 "general_operand" "")
- (match_operand:DI 3 "general_operand" "")))]
- "TARGET_64BIT"
+(define_expand "mov<mode>cc"
+ [(set (match_operand:SWIM 0 "register_operand" "")
+ (if_then_else:SWIM (match_operand 1 "comparison_operator" "")
+ (match_operand:SWIM 2 "general_operand" "")
+ (match_operand:SWIM 3 "general_operand" "")))]
+ ""
"if (ix86_expand_int_movcc (operands)) DONE; else FAIL;")
-(define_insn "x86_movdicc_0_m1_rex64"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (if_then_else:DI (match_operand 1 "ix86_carry_flag_operator" "")
+;; Data flow gets confused by our desire for `sbbl reg,reg', and clearing
+;; the register first winds up with `sbbl $0,reg', which is also weird.
+;; So just document what we're doing explicitly.
+
+(define_insn "x86_mov<mode>cc_0_m1"
+ [(set (match_operand:SWI48 0 "register_operand" "=r")
+ (if_then_else:SWI48 (match_operand 1 "ix86_carry_flag_operator" "")
(const_int -1)
(const_int 0)))
(clobber (reg:CC FLAGS_REG))]
- "TARGET_64BIT"
- "sbb{q}\t%0, %0"
+ ""
+ "sbb{<imodesuffix>}\t%0, %0"
; Since we don't have the proper number of operands for an alu insn,
; fill in all the blanks.
[(set_attr "type" "alu")
@@ -20191,134 +19545,56 @@
(set_attr "pent_pair" "pu")
(set_attr "memory" "none")
(set_attr "imm_disp" "false")
- (set_attr "mode" "DI")
- (set_attr "length_immediate" "0")])
-
-(define_insn "*x86_movdicc_0_m1_se"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (sign_extract:DI (match_operand 1 "ix86_carry_flag_operator" "")
- (const_int 1)
- (const_int 0)))
- (clobber (reg:CC FLAGS_REG))]
- ""
- "sbb{q}\t%0, %0"
- [(set_attr "type" "alu")
- (set_attr "use_carry" "1")
- (set_attr "pent_pair" "pu")
- (set_attr "memory" "none")
- (set_attr "imm_disp" "false")
- (set_attr "mode" "DI")
+ (set_attr "mode" "<MODE>")
(set_attr "length_immediate" "0")])
-(define_insn "*movdicc_c_rex64"
- [(set (match_operand:DI 0 "register_operand" "=r,r")
- (if_then_else:DI (match_operator 1 "ix86_comparison_operator"
- [(reg FLAGS_REG) (const_int 0)])
- (match_operand:DI 2 "nonimmediate_operand" "rm,0")
- (match_operand:DI 3 "nonimmediate_operand" "0,rm")))]
- "TARGET_64BIT && TARGET_CMOVE
- && !(MEM_P (operands[2]) && MEM_P (operands[3]))"
- "@
- cmov%O2%C1\t{%2, %0|%0, %2}
- cmov%O2%c1\t{%3, %0|%0, %3}"
- [(set_attr "type" "icmov")
- (set_attr "mode" "DI")])
-
-(define_expand "movsicc"
- [(set (match_operand:SI 0 "register_operand" "")
- (if_then_else:SI (match_operand 1 "comparison_operator" "")
- (match_operand:SI 2 "general_operand" "")
- (match_operand:SI 3 "general_operand" "")))]
- ""
- "if (ix86_expand_int_movcc (operands)) DONE; else FAIL;")
-
-;; Data flow gets confused by our desire for `sbbl reg,reg', and clearing
-;; the register first winds up with `sbbl $0,reg', which is also weird.
-;; So just document what we're doing explicitly.
-
-(define_insn "x86_movsicc_0_m1"
- [(set (match_operand:SI 0 "register_operand" "=r")
- (if_then_else:SI (match_operand 1 "ix86_carry_flag_operator" "")
- (const_int -1)
- (const_int 0)))
+(define_insn "*x86_mov<mode>cc_0_m1_se"
+ [(set (match_operand:SWI48 0 "register_operand" "=r")
+ (sign_extract:SWI48 (match_operand 1 "ix86_carry_flag_operator" "")
+ (const_int 1)
+ (const_int 0)))
(clobber (reg:CC FLAGS_REG))]
""
- "sbb{l}\t%0, %0"
- ; Since we don't have the proper number of operands for an alu insn,
- ; fill in all the blanks.
+ "sbb{<imodesuffix>}\t%0, %0"
[(set_attr "type" "alu")
(set_attr "use_carry" "1")
(set_attr "pent_pair" "pu")
(set_attr "memory" "none")
(set_attr "imm_disp" "false")
- (set_attr "mode" "SI")
+ (set_attr "mode" "<MODE>")
(set_attr "length_immediate" "0")])
-(define_insn "*x86_movsicc_0_m1_se"
- [(set (match_operand:SI 0 "register_operand" "=r")
- (sign_extract:SI (match_operand 1 "ix86_carry_flag_operator" "")
- (const_int 1)
- (const_int 0)))
- (clobber (reg:CC FLAGS_REG))]
+(define_insn "*x86_mov<mode>cc_0_m1_neg"
+ [(set (match_operand:SWI48 0 "register_operand" "=r")
+ (neg:SWI48 (match_operand 1 "ix86_carry_flag_operator" "")))]
""
- "sbb{l}\t%0, %0"
+ "sbb{<imodesuffix>}\t%0, %0"
[(set_attr "type" "alu")
(set_attr "use_carry" "1")
(set_attr "pent_pair" "pu")
(set_attr "memory" "none")
(set_attr "imm_disp" "false")
- (set_attr "mode" "SI")
+ (set_attr "mode" "<MODE>")
(set_attr "length_immediate" "0")])
-(define_insn "*movsicc_noc"
- [(set (match_operand:SI 0 "register_operand" "=r,r")
- (if_then_else:SI (match_operator 1 "ix86_comparison_operator"
- [(reg FLAGS_REG) (const_int 0)])
- (match_operand:SI 2 "nonimmediate_operand" "rm,0")
- (match_operand:SI 3 "nonimmediate_operand" "0,rm")))]
- "TARGET_CMOVE
- && !(MEM_P (operands[2]) && MEM_P (operands[3]))"
+(define_insn "*mov<mode>cc_noc"
+ [(set (match_operand:SWI248 0 "register_operand" "=r,r")
+ (if_then_else:SWI248 (match_operator 1 "ix86_comparison_operator"
+ [(reg FLAGS_REG) (const_int 0)])
+ (match_operand:SWI248 2 "nonimmediate_operand" "rm,0")
+ (match_operand:SWI248 3 "nonimmediate_operand" "0,rm")))]
+ "TARGET_CMOVE && !(MEM_P (operands[2]) && MEM_P (operands[3]))"
"@
cmov%O2%C1\t{%2, %0|%0, %2}
cmov%O2%c1\t{%3, %0|%0, %3}"
[(set_attr "type" "icmov")
- (set_attr "mode" "SI")])
-
-(define_expand "movhicc"
- [(set (match_operand:HI 0 "register_operand" "")
- (if_then_else:HI (match_operand 1 "comparison_operator" "")
- (match_operand:HI 2 "general_operand" "")
- (match_operand:HI 3 "general_operand" "")))]
- "TARGET_HIMODE_MATH"
- "if (ix86_expand_int_movcc (operands)) DONE; else FAIL;")
-
-(define_insn "*movhicc_noc"
- [(set (match_operand:HI 0 "register_operand" "=r,r")
- (if_then_else:HI (match_operator 1 "ix86_comparison_operator"
- [(reg FLAGS_REG) (const_int 0)])
- (match_operand:HI 2 "nonimmediate_operand" "rm,0")
- (match_operand:HI 3 "nonimmediate_operand" "0,rm")))]
- "TARGET_CMOVE
- && !(MEM_P (operands[2]) && MEM_P (operands[3]))"
- "@
- cmov%O2%C1\t{%2, %0|%0, %2}
- cmov%O2%c1\t{%3, %0|%0, %3}"
- [(set_attr "type" "icmov")
- (set_attr "mode" "HI")])
-
-(define_expand "movqicc"
- [(set (match_operand:QI 0 "register_operand" "")
- (if_then_else:QI (match_operand 1 "comparison_operator" "")
- (match_operand:QI 2 "general_operand" "")
- (match_operand:QI 3 "general_operand" "")))]
- "TARGET_QIMODE_MATH"
- "if (ix86_expand_int_movcc (operands)) DONE; else FAIL;")
+ (set_attr "mode" "<MODE>")])
(define_insn_and_split "*movqicc_noc"
[(set (match_operand:QI 0 "register_operand" "=r,r")
(if_then_else:QI (match_operator 1 "ix86_comparison_operator"
- [(match_operand 4 "flags_reg_operand" "")
- (const_int 0)])
+ [(match_operand 4 "flags_reg_operand" "")
+ (const_int 0)])
(match_operand:QI 2 "register_operand" "r,0")
(match_operand:QI 3 "register_operand" "0,r")))]
"TARGET_CMOVE && !TARGET_PARTIAL_REG_STALL"
@@ -20424,6 +19700,20 @@
[(set_attr "type" "fcmov")
(set_attr "mode" "XF")])
+;; All moves in XOP pcmov instructions are 128 bits and hence we restrict
+;; the scalar versions to have only XMM registers as operands.
+
+;; XOP conditional move
+(define_insn "*xop_pcmov_<mode>"
+ [(set (match_operand:MODEF 0 "register_operand" "=x")
+ (if_then_else:MODEF
+ (match_operand:MODEF 1 "register_operand" "x")
+ (match_operand:MODEF 2 "register_operand" "x")
+ (match_operand:MODEF 3 "register_operand" "x")))]
+ "TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 4, true, 1, false)"
+ "vpcmov\t{%1, %3, %2, %0|%0, %2, %3, %1}"
+ [(set_attr "type" "sse4arg")])
+
;; These versions of the min/max patterns are intentionally ignorant of
;; their behavior wrt -0.0 and NaN (via the commutative operand mark).
;; Since both the tree-level MAX_EXPR and the rtl-level SMAX operator
@@ -20733,6 +20023,18 @@
DONE;
})
+;; Use IOR for stack probes, this is shorter.
+(define_expand "probe_stack"
+ [(match_operand 0 "memory_operand" "")]
+ ""
+{
+ if (GET_MODE (operands[0]) == DImode)
+ emit_insn (gen_iordi3 (operands[0], operands[0], const0_rtx));
+ else
+ emit_insn (gen_iorsi3 (operands[0], operands[0], const0_rtx));
+ DONE;
+})
+
(define_expand "builtin_setjmp_receiver"
[(label_ref (match_operand 0 "" ""))]
"!TARGET_64BIT && flag_pic"
@@ -21236,7 +20538,9 @@
[(match_dup 0)
(match_operand:SI 1 "nonmemory_operand" "")]))
(clobber (reg:CC FLAGS_REG))])]
- "optimize_insn_for_speed_p () && ! TARGET_READ_MODIFY_WRITE"
+ "optimize_insn_for_speed_p () && ! TARGET_READ_MODIFY_WRITE
+ /* Do not split stack checking probes. */
+ && GET_CODE (operands[3]) != IOR && operands[1] != const0_rtx"
[(set (match_dup 2) (match_dup 0))
(parallel [(set (match_dup 2)
(match_op_dup 3 [(match_dup 2) (match_dup 1)]))
@@ -21251,7 +20555,9 @@
[(match_operand:SI 1 "nonmemory_operand" "")
(match_dup 0)]))
(clobber (reg:CC FLAGS_REG))])]
- "optimize_insn_for_speed_p () && ! TARGET_READ_MODIFY_WRITE"
+ "optimize_insn_for_speed_p () && ! TARGET_READ_MODIFY_WRITE
+ /* Do not split stack checking probes. */
+ && GET_CODE (operands[3]) != IOR && operands[1] != const0_rtx"
[(set (match_dup 2) (match_dup 0))
(parallel [(set (match_dup 2)
(match_op_dup 3 [(match_dup 1) (match_dup 2)]))
@@ -21856,13 +21162,27 @@
}
[(set_attr "type" "callv")])
-(define_insn "*call_value_pop_1"
+(define_insn "*call_value_pop_1_esp"
[(set (match_operand 0 "" "")
(call (mem:QI (match_operand:SI 1 "call_insn_operand" "rsm"))
(match_operand:SI 2 "" "")))
(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG)
(match_operand:SI 3 "immediate_operand" "i")))]
- "!SIBLING_CALL_P (insn) && !TARGET_64BIT"
+ "!TARGET_64BIT && TARGET_CALL_ESP && !SIBLING_CALL_P (insn)"
+{
+ if (constant_call_address_operand (operands[1], Pmode))
+ return "call\t%P1";
+ return "call\t%A1";
+}
+ [(set_attr "type" "callv")])
+
+(define_insn "*call_value_pop_1"
+ [(set (match_operand 0 "" "")
+ (call (mem:QI (match_operand:SI 1 "call_insn_operand" "lsm"))
+ (match_operand:SI 2 "" "")))
+ (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG)
+ (match_operand:SI 3 "immediate_operand" "i")))]
+ "!TARGET_64BIT && !TARGET_CALL_ESP && !SIBLING_CALL_P (insn)"
{
if (constant_call_address_operand (operands[1], Pmode))
return "call\t%P1";
@@ -21876,7 +21196,7 @@
(match_operand:SI 2 "" "")))
(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG)
(match_operand:SI 3 "immediate_operand" "i,i")))]
- "SIBLING_CALL_P (insn) && !TARGET_64BIT"
+ "!TARGET_64BIT && SIBLING_CALL_P (insn)"
"@
jmp\t%P1
jmp\t%A1"
@@ -21925,7 +21245,7 @@
(clobber (reg:TI XMM15_REG))
(clobber (reg:DI SI_REG))
(clobber (reg:DI DI_REG))]
- "!SIBLING_CALL_P (insn) && TARGET_64BIT"
+ "TARGET_64BIT && !SIBLING_CALL_P (insn)"
{
if (SIBLING_CALL_P (insn))
return "jmp\t%P1";
@@ -21934,11 +21254,23 @@
}
[(set_attr "type" "callv")])
-(define_insn "*call_value_1"
+(define_insn "*call_value_1_esp"
[(set (match_operand 0 "" "")
(call (mem:QI (match_operand:SI 1 "call_insn_operand" "rsm"))
(match_operand:SI 2 "" "")))]
- "!SIBLING_CALL_P (insn) && !TARGET_64BIT"
+ "!TARGET_64BIT && TARGET_CALL_ESP && !SIBLING_CALL_P (insn)"
+{
+ if (constant_call_address_operand (operands[1], Pmode))
+ return "call\t%P1";
+ return "call\t%A1";
+}
+ [(set_attr "type" "callv")])
+
+(define_insn "*call_value_1"
+ [(set (match_operand 0 "" "")
+ (call (mem:QI (match_operand:SI 1 "call_insn_operand" "lsm"))
+ (match_operand:SI 2 "" "")))]
+ "!TARGET_64BIT && !TARGET_CALL_ESP && !SIBLING_CALL_P (insn)"
{
if (constant_call_address_operand (operands[1], Pmode))
return "call\t%P1";
@@ -21950,7 +21282,7 @@
[(set (match_operand 0 "" "")
(call (mem:QI (match_operand:SI 1 "sibcall_insn_operand" "s,U"))
(match_operand:SI 2 "" "")))]
- "SIBLING_CALL_P (insn) && !TARGET_64BIT"
+ "!TARGET_64BIT && SIBLING_CALL_P (insn)"
"@
jmp\t%P1
jmp\t%A1"
@@ -21960,7 +21292,7 @@
[(set (match_operand 0 "" "")
(call (mem:QI (match_operand:DI 1 "call_insn_operand" "rsm"))
(match_operand:DI 2 "" "")))]
- "!SIBLING_CALL_P (insn) && TARGET_64BIT
+ "TARGET_64BIT && !SIBLING_CALL_P (insn)
&& ix86_cmodel != CM_LARGE && ix86_cmodel != CM_LARGE_PIC"
{
if (constant_call_address_operand (operands[1], Pmode))
@@ -21974,19 +21306,19 @@
(call (mem:QI (match_operand:DI 1 "call_insn_operand" "rsm"))
(match_operand:DI 2 "" "")))
(unspec [(const_int 0)] UNSPEC_MS_TO_SYSV_CALL)
- (clobber (reg:TI 27))
- (clobber (reg:TI 28))
- (clobber (reg:TI 45))
- (clobber (reg:TI 46))
- (clobber (reg:TI 47))
- (clobber (reg:TI 48))
- (clobber (reg:TI 49))
- (clobber (reg:TI 50))
- (clobber (reg:TI 51))
- (clobber (reg:TI 52))
+ (clobber (reg:TI XMM6_REG))
+ (clobber (reg:TI XMM7_REG))
+ (clobber (reg:TI XMM8_REG))
+ (clobber (reg:TI XMM9_REG))
+ (clobber (reg:TI XMM10_REG))
+ (clobber (reg:TI XMM11_REG))
+ (clobber (reg:TI XMM12_REG))
+ (clobber (reg:TI XMM13_REG))
+ (clobber (reg:TI XMM14_REG))
+ (clobber (reg:TI XMM15_REG))
(clobber (reg:DI SI_REG))
(clobber (reg:DI DI_REG))]
- "!SIBLING_CALL_P (insn) && TARGET_64BIT"
+ "TARGET_64BIT && !SIBLING_CALL_P (insn)"
{
if (constant_call_address_operand (operands[1], Pmode))
return "call\t%P1";
@@ -21998,7 +21330,7 @@
[(set (match_operand 0 "" "")
(call (mem:QI (match_operand:DI 1 "call_insn_operand" "rm"))
(match_operand:DI 2 "" "")))]
- "!SIBLING_CALL_P (insn) && TARGET_64BIT"
+ "TARGET_64BIT && !SIBLING_CALL_P (insn)"
"call\t%A1"
[(set_attr "type" "callv")])
@@ -22006,7 +21338,7 @@
[(set (match_operand 0 "" "")
(call (mem:QI (match_operand:DI 1 "sibcall_insn_operand" "s,U"))
(match_operand:DI 2 "" "")))]
- "SIBLING_CALL_P (insn) && TARGET_64BIT"
+ "TARGET_64BIT && SIBLING_CALL_P (insn)"
"@
jmp\t%P1
jmp\t%A1"
@@ -22025,14 +21357,14 @@
(define_expand "sse_prologue_save"
[(parallel [(set (match_operand:BLK 0 "" "")
- (unspec:BLK [(reg:DI 21)
- (reg:DI 22)
- (reg:DI 23)
- (reg:DI 24)
- (reg:DI 25)
- (reg:DI 26)
- (reg:DI 27)
- (reg:DI 28)] UNSPEC_SSE_PROLOGUE_SAVE))
+ (unspec:BLK [(reg:DI XMM0_REG)
+ (reg:DI XMM1_REG)
+ (reg:DI XMM2_REG)
+ (reg:DI XMM3_REG)
+ (reg:DI XMM4_REG)
+ (reg:DI XMM5_REG)
+ (reg:DI XMM6_REG)
+ (reg:DI XMM7_REG)] UNSPEC_SSE_PROLOGUE_SAVE))
(use (match_operand:DI 1 "register_operand" ""))
(use (match_operand:DI 2 "immediate_operand" ""))
(use (label_ref:DI (match_operand 3 "" "")))])]
@@ -22042,14 +21374,14 @@
(define_insn "*sse_prologue_save_insn"
[(set (mem:BLK (plus:DI (match_operand:DI 0 "register_operand" "R")
(match_operand:DI 4 "const_int_operand" "n")))
- (unspec:BLK [(reg:DI 21)
- (reg:DI 22)
- (reg:DI 23)
- (reg:DI 24)
- (reg:DI 25)
- (reg:DI 26)
- (reg:DI 27)
- (reg:DI 28)] UNSPEC_SSE_PROLOGUE_SAVE))
+ (unspec:BLK [(reg:DI XMM0_REG)
+ (reg:DI XMM1_REG)
+ (reg:DI XMM2_REG)
+ (reg:DI XMM3_REG)
+ (reg:DI XMM4_REG)
+ (reg:DI XMM5_REG)
+ (reg:DI XMM6_REG)
+ (reg:DI XMM7_REG)] UNSPEC_SSE_PROLOGUE_SAVE))
(use (match_operand:DI 1 "register_operand" "r"))
(use (match_operand:DI 2 "const_int_operand" "i"))
(use (label_ref:DI (match_operand 3 "" "X")))]
@@ -22526,6 +21858,120 @@
[(set_attr "type" "other")
(set_attr "length" "3")])
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; LWP instructions
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(define_insn "lwp_llwpcbhi1"
+ [(unspec [(match_operand:HI 0 "register_operand" "r")]
+ UNSPEC_LLWP_INTRINSIC)]
+ "TARGET_LWP"
+ "llwpcb\t%0"
+ [(set_attr "type" "lwp")
+ (set_attr "mode" "HI")])
+
+(define_insn "lwp_llwpcbsi1"
+ [(unspec [(match_operand:SI 0 "register_operand" "r")]
+ UNSPEC_LLWP_INTRINSIC)]
+ "TARGET_LWP"
+ "llwpcb\t%0"
+ [(set_attr "type" "lwp")
+ (set_attr "mode" "SI")])
+
+(define_insn "lwp_llwpcbdi1"
+ [(unspec [(match_operand:DI 0 "register_operand" "r")]
+ UNSPEC_LLWP_INTRINSIC)]
+ "TARGET_LWP"
+ "llwpcb\t%0"
+ [(set_attr "type" "lwp")
+ (set_attr "mode" "DI")])
+
+(define_insn "lwp_slwpcbhi1"
+ [(unspec [(match_operand:HI 0 "register_operand" "r")]
+ UNSPEC_SLWP_INTRINSIC)]
+ "TARGET_LWP"
+ "slwpcb\t%0"
+ [(set_attr "type" "lwp")
+ (set_attr "mode" "HI")])
+
+(define_insn "lwp_slwpcbsi1"
+ [(unspec [(match_operand:SI 0 "register_operand" "r")]
+ UNSPEC_SLWP_INTRINSIC)]
+ "TARGET_LWP"
+ "slwpcb\t%0"
+ [(set_attr "type" "lwp")
+ (set_attr "mode" "SI")])
+
+(define_insn "lwp_slwpcbdi1"
+ [(unspec [(match_operand:DI 0 "register_operand" "r")]
+ UNSPEC_SLWP_INTRINSIC)]
+ "TARGET_LWP"
+ "slwpcb\t%0"
+ [(set_attr "type" "lwp")
+ (set_attr "mode" "DI")])
+
+(define_insn "lwp_lwpvalhi3"
+ [(unspec_volatile [(match_operand:HI 0 "register_operand" "r")
+ (match_operand:SI 1 "nonimmediate_operand" "rm")
+ (match_operand:HI 2 "const_int_operand" "")]
+ UNSPECV_LWPVAL_INTRINSIC)]
+ "TARGET_LWP"
+ "lwpval\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "lwp")
+ (set_attr "mode" "HI")])
+
+(define_insn "lwp_lwpvalsi3"
+ [(unspec_volatile [(match_operand:SI 0 "register_operand" "r")
+ (match_operand:SI 1 "nonimmediate_operand" "rm")
+ (match_operand:SI 2 "const_int_operand" "")]
+ UNSPECV_LWPVAL_INTRINSIC)]
+ "TARGET_LWP"
+ "lwpval\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "lwp")
+ (set_attr "mode" "SI")])
+
+(define_insn "lwp_lwpvaldi3"
+ [(unspec_volatile [(match_operand:DI 0 "register_operand" "r")
+ (match_operand:SI 1 "nonimmediate_operand" "rm")
+ (match_operand:SI 2 "const_int_operand" "")]
+ UNSPECV_LWPVAL_INTRINSIC)]
+ "TARGET_LWP"
+ "lwpval\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "lwp")
+ (set_attr "mode" "DI")])
+
+(define_insn "lwp_lwpinshi3"
+ [(unspec_volatile [(match_operand:HI 0 "register_operand" "r")
+ (match_operand:SI 1 "nonimmediate_operand" "rm")
+ (match_operand:HI 2 "const_int_operand" "")]
+ UNSPECV_LWPINS_INTRINSIC)]
+ "TARGET_LWP"
+ "lwpins\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "lwp")
+ (set_attr "mode" "HI")])
+
+(define_insn "lwp_lwpinssi3"
+ [(unspec_volatile [(match_operand:SI 0 "register_operand" "r")
+ (match_operand:SI 1 "nonimmediate_operand" "rm")
+ (match_operand:SI 2 "const_int_operand" "")]
+ UNSPECV_LWPINS_INTRINSIC)]
+ "TARGET_LWP"
+ "lwpins\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "lwp")
+ (set_attr "mode" "SI")])
+
+(define_insn "lwp_lwpinsdi3"
+ [(unspec_volatile [(match_operand:DI 0 "register_operand" "r")
+ (match_operand:SI 1 "nonimmediate_operand" "rm")
+ (match_operand:SI 2 "const_int_operand" "")]
+ UNSPECV_LWPINS_INTRINSIC)]
+ "TARGET_LWP"
+ "lwpins\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "lwp")
+ (set_attr "mode" "DI")])
+
(include "mmx.md")
(include "sse.md")
(include "sync.md")
diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt
index 9668ff6504d..dd47b7d1dc5 100644
--- a/gcc/config/i386/i386.opt
+++ b/gcc/config/i386/i386.opt
@@ -314,6 +314,14 @@ mfma4
Target Report Mask(ISA_FMA4) Var(ix86_isa_flags) VarExists Save
Support FMA4 built-in functions and code generation
+mxop
+Target Report Mask(ISA_XOP) Var(ix86_isa_flags) VarExists Save
+Support XOP built-in functions and code generation
+
+mlwp
+Target Report Mask(ISA_LWP) Var(ix86_isa_flags) VarExists Save
+Support LWP built-in functions and code generation
+
mabm
Target Report Mask(ISA_ABM) Var(ix86_isa_flags) VarExists Save
Support code generation of Advanced Bit Manipulation (ABM) instructions.
diff --git a/gcc/config/i386/ia32intrin.h b/gcc/config/i386/ia32intrin.h
index e701b19e2a8..540bc3f09ee 100644
--- a/gcc/config/i386/ia32intrin.h
+++ b/gcc/config/i386/ia32intrin.h
@@ -49,6 +49,7 @@ __bswapd (int __X)
return __builtin_bswap32 (__X);
}
+#ifdef __SSE4_2__
/* 32bit accumulate CRC32 (polynomial 0x11EDC6F41) value. */
extern __inline unsigned int
__attribute__((__gnu_inline__, __always_inline__, __artificial__))
@@ -70,6 +71,7 @@ __crc32d (unsigned int __C, unsigned int __V)
{
return __builtin_ia32_crc32si (__C, __V);
}
+#endif /* SSE4.2 */
/* 32bit popcnt */
extern __inline int
diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
index 9b51496a864..5d8e5ad2cbe 100644
--- a/gcc/config/i386/linux.h
+++ b/gcc/config/i386/linux.h
@@ -104,7 +104,7 @@ along with GCC; see the file COPYING3. If not see
#undef ASM_SPEC
#define ASM_SPEC \
- "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
+ "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} --32 \
%{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}"
#undef SUBTARGET_EXTRA_SPECS
@@ -207,6 +207,9 @@ along with GCC; see the file COPYING3. If not see
#define MD_UNWIND_SUPPORT "config/i386/linux-unwind.h"
+/* The stack pointer needs to be moved while checking the stack. */
+#define STACK_CHECK_MOVING_SP 1
+
/* This macro may be overridden in i386/k*bsd-gnu.h. */
#define REG_NAME(reg) reg
diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
index cfa3f49e870..d07547a804f 100644
--- a/gcc/config/i386/linux64.h
+++ b/gcc/config/i386/linux64.h
@@ -110,6 +110,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define MD_UNWIND_SUPPORT "config/i386/linux-unwind.h"
+/* The stack pointer needs to be moved while checking the stack. */
+#define STACK_CHECK_MOVING_SP 1
+
/* This macro may be overridden in i386/k*bsd-gnu.h. */
#define REG_NAME(reg) reg
diff --git a/gcc/config/i386/lwpintrin.h b/gcc/config/i386/lwpintrin.h
new file mode 100644
index 00000000000..e5137ec24f4
--- /dev/null
+++ b/gcc/config/i386/lwpintrin.h
@@ -0,0 +1,109 @@
+/* Copyright (C) 2007, 2008, 2009 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/>. */
+
+#ifndef _X86INTRIN_H_INCLUDED
+# error "Never use <lwpintrin.h> directly; include <x86intrin.h> instead."
+#endif
+
+#ifndef _LWPINTRIN_H_INCLUDED
+#define _LWPINTRIN_H_INCLUDED
+
+#ifndef __LWP__
+# error "LWP instruction set not enabled"
+#else
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__llwpcb16 (void *pcbAddress)
+{
+ __builtin_ia32_llwpcb16 (pcbAddress);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__llwpcb32 (void *pcbAddress)
+{
+ __builtin_ia32_llwpcb32 (pcbAddress);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__llwpcb64 (void *pcbAddress)
+{
+ __builtin_ia32_llwpcb64 (pcbAddress);
+}
+
+extern __inline void * __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__slwpcb16 (void)
+{
+ return __builtin_ia32_slwpcb16 ();
+}
+
+extern __inline void * __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__slwpcb32 (void)
+{
+ return __builtin_ia32_slwpcb32 ();
+}
+
+extern __inline void * __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__slwpcb64 (void)
+{
+ return __builtin_ia32_slwpcb64 ();
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__lwpval16 (unsigned short data2, unsigned int data1, unsigned short flags)
+{
+ __builtin_ia32_lwpval16 (data2, data1, flags);
+}
+/*
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__lwpval32 (unsigned int data2, unsigned int data1, unsigned int flags)
+{
+ __builtin_ia32_lwpval32 (data2, data1, flags);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__lwpval64 (unsigned __int64 data2, unsigned int data1, unsigned int flags)
+{
+ __builtin_ia32_lwpval64 (data2, data1, flags);
+}
+
+extern __inline unsigned char __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__lwpins16 (unsigned short data2, unsigned int data1, unsigned short flags)
+{
+ return __builtin_ia32_lwpins16 (data2, data1, flags);
+}
+
+extern __inline unsigned char __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__lwpins32 (unsigned int data2, unsigned int data1, unsigned int flags)
+{
+ return __builtin_ia32_lwpins32 (data2, data1, flags);
+}
+
+extern __inline unsigned char __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__lwpins64 (unsigned __int64 data2, unsigned int data1, unsigned int flags)
+{
+ return __builtin_ia32_lwpins64 (data2, data1, flags);
+}
+*/
+#endif /* __LWP__ */
+
+#endif /* _LWPINTRIN_H_INCLUDED */
diff --git a/gcc/config/i386/mingw.opt b/gcc/config/i386/mingw.opt
index 6be904e968a..bd9a4b63035 100644
--- a/gcc/config/i386/mingw.opt
+++ b/gcc/config/i386/mingw.opt
@@ -21,3 +21,7 @@
Wpedantic-ms-format
C ObjC C++ ObjC++ Var(warn_pedantic_ms_format) Init(1) Warning
Warn about none ISO msvcrt scanf/printf width extensions
+
+fset-stack-executable
+Common Report Var(flag_setstackexecutable) Init(1) Optimization
+For nested functions on stack executable permission is set.
diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h
index 9dcc5ba1f67..4f8b101a7ba 100644
--- a/gcc/config/i386/mingw32.h
+++ b/gcc/config/i386/mingw32.h
@@ -202,6 +202,8 @@ __enable_execute_stack (void *addr) \
#undef ENABLE_EXECUTE_STACK
#define ENABLE_EXECUTE_STACK MINGW_ENABLE_EXECUTE_STACK
+#undef CHECK_EXECUTE_STACK_ENABLED
+#define CHECK_EXECUTE_STACK_ENABLED flag_setstackexecutable
#ifdef IN_LIBGCC2
#include <windows.h>
diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md
index f9a4744d1de..dee6df9fa01 100644
--- a/gcc/config/i386/predicates.md
+++ b/gcc/config/i386/predicates.md
@@ -561,7 +561,9 @@
;; Test for a valid operand for a call instruction.
(define_predicate "call_insn_operand"
(ior (match_operand 0 "constant_call_address_operand")
- (ior (match_operand 0 "register_no_elim_operand")
+ (ior (and (match_operand 0 "register_no_elim_operand")
+ (ior (match_test "TARGET_CALL_ESP")
+ (match_operand 0 "index_register_operand")))
(match_operand 0 "memory_operand"))))
;; Similarly, but for tail calls, in which we cannot allow memory references.
diff --git a/gcc/config/i386/sol2-unwind.h b/gcc/config/i386/sol2-unwind.h
new file mode 100644
index 00000000000..41ffb03b6cd
--- /dev/null
+++ b/gcc/config/i386/sol2-unwind.h
@@ -0,0 +1,208 @@
+/* DWARF2 EH unwinding support for AMD x86-64 and x86.
+ Copyright (C) 2009 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/>. */
+
+/* Do code reading to identify a signal frame, and set the frame
+ state data appropriately. See unwind-dw2.c for the structs. */
+
+#include <ucontext.h>
+
+#ifdef __x86_64__
+
+#define MD_FALLBACK_FRAME_STATE_FOR x86_64_fallback_frame_state
+
+static _Unwind_Reason_Code
+x86_64_fallback_frame_state (struct _Unwind_Context *context,
+ _Unwind_FrameState *fs)
+{
+ unsigned char *pc = context->ra;
+ mcontext_t *mctx;
+ long new_cfa;
+
+ if (/* Solaris 2.10
+ ------------
+ <__sighndlr+0>: push %rbp
+ <__sighndlr+1>: mov %rsp,%rbp
+ <__sighndlr+4>: callq *%rcx
+ <__sighndlr+6>: leaveq <--- PC
+ <__sighndlr+7>: retq */
+ *(unsigned long *)(pc - 6) == 0xc3c9d1ffe5894855)
+ /* We need to move up four frames (the kernel frame, the signal frame,
+ the call_user_handler frame and the __sighndlr frame). Two of them
+ have the minimum stack frame size (kernel and __sighndlr frames),
+ the signal frame has a stack frame size of 32 and there is another
+ with a stack frame size of 112 bytes (the call_user_handler frame).
+ The ucontext_t structure is after this offset. */
+ {
+ int off = 16 + 16 + 32 + 112;
+ mctx = &((ucontext_t *) (context->cfa + off))->uc_mcontext;
+ }
+ else
+ return _URC_END_OF_STACK;
+
+ new_cfa = mctx->gregs[REG_RSP];
+
+ fs->regs.cfa_how = CFA_REG_OFFSET;
+ fs->regs.cfa_reg = 7;
+ fs->regs.cfa_offset = new_cfa - (long) context->cfa;
+
+ /* The SVR4 register numbering macros aren't usable in libgcc. */
+ fs->regs.reg[0].how = REG_SAVED_OFFSET;
+ fs->regs.reg[0].loc.offset = (long)&mctx->gregs[REG_RAX] - new_cfa;
+ fs->regs.reg[1].how = REG_SAVED_OFFSET;
+ fs->regs.reg[1].loc.offset = (long)&mctx->gregs[REG_RDX] - new_cfa;
+ fs->regs.reg[2].how = REG_SAVED_OFFSET;
+ fs->regs.reg[2].loc.offset = (long)&mctx->gregs[REG_RCX] - new_cfa;
+ fs->regs.reg[3].how = REG_SAVED_OFFSET;
+ fs->regs.reg[3].loc.offset = (long)&mctx->gregs[REG_RBX] - new_cfa;
+ fs->regs.reg[4].how = REG_SAVED_OFFSET;
+ fs->regs.reg[4].loc.offset = (long)&mctx->gregs[REG_RSI] - new_cfa;
+ fs->regs.reg[5].how = REG_SAVED_OFFSET;
+ fs->regs.reg[5].loc.offset = (long)&mctx->gregs[REG_RDI] - new_cfa;
+ fs->regs.reg[6].how = REG_SAVED_OFFSET;
+ fs->regs.reg[6].loc.offset = (long)&mctx->gregs[REG_RBP] - new_cfa;
+ fs->regs.reg[8].how = REG_SAVED_OFFSET;
+ fs->regs.reg[8].loc.offset = (long)&mctx->gregs[REG_R8] - new_cfa;
+ fs->regs.reg[9].how = REG_SAVED_OFFSET;
+ fs->regs.reg[9].loc.offset = (long)&mctx->gregs[REG_R9] - new_cfa;
+ fs->regs.reg[10].how = REG_SAVED_OFFSET;
+ fs->regs.reg[10].loc.offset = (long)&mctx->gregs[REG_R10] - new_cfa;
+ fs->regs.reg[11].how = REG_SAVED_OFFSET;
+ fs->regs.reg[11].loc.offset = (long)&mctx->gregs[REG_R11] - new_cfa;
+ fs->regs.reg[12].how = REG_SAVED_OFFSET;
+ fs->regs.reg[12].loc.offset = (long)&mctx->gregs[REG_R12] - new_cfa;
+ fs->regs.reg[13].how = REG_SAVED_OFFSET;
+ fs->regs.reg[13].loc.offset = (long)&mctx->gregs[REG_R13] - new_cfa;
+ fs->regs.reg[14].how = REG_SAVED_OFFSET;
+ fs->regs.reg[14].loc.offset = (long)&mctx->gregs[REG_R14] - new_cfa;
+ fs->regs.reg[15].how = REG_SAVED_OFFSET;
+ fs->regs.reg[15].loc.offset = (long)&mctx->gregs[REG_R15] - new_cfa;
+ fs->regs.reg[16].how = REG_SAVED_OFFSET;
+ fs->regs.reg[16].loc.offset = (long)&mctx->gregs[REG_RIP] - new_cfa;
+ fs->retaddr_column = 16;
+ fs->signal_frame = 1;
+
+ return _URC_NO_REASON;
+}
+
+#else
+
+#define MD_FALLBACK_FRAME_STATE_FOR x86_fallback_frame_state
+
+static _Unwind_Reason_Code
+x86_fallback_frame_state (struct _Unwind_Context *context,
+ _Unwind_FrameState *fs)
+{
+ unsigned char *pc = context->ra;
+ mcontext_t *mctx;
+ long new_cfa;
+
+ if (/* Solaris 2.8 - single thread
+ -------------------------
+ <sigacthandler+17>: mov 0x10(%ebp),%esi
+ <sigacthandler+20>: push %esi
+ <sigacthandler+21>: pushl 0xc(%ebp)
+ <sigacthandler+24>: mov 0x8(%ebp),%ecx
+ <sigacthandler+27>: push %ecx
+ <sigacthandler+28>: mov offset(%ebx),%eax
+ <sigacthandler+34>: call *(%eax,%ecx,4)
+ <sigacthandler+37>: add $0xc,%esp <--- PC
+ <sigacthandler+40>: push %esi ... */
+ (*(unsigned long *)(pc - 20) == 0x5610758b
+ && *(unsigned long *)(pc - 16) == 0x8b0c75ff
+ && *(unsigned long *)(pc - 12) == 0x8b51084d
+ && *(unsigned char *)(pc - 8) == 0x83
+ && *(unsigned long *)(pc - 4) == 0x8814ff00
+ && *(unsigned long *)(pc - 0) == 0x560cc483)
+
+ || /* Solaris 2.8 - multi thread
+ ---------------------------
+ <__sighndlr+0>: push %ebp
+ <__sighndlr+1>: mov %esp,%ebp
+ <__sighndlr+3>: pushl 0x10(%ebp)
+ <__sighndlr+6>: pushl 0xc(%ebp)
+ <__sighndlr+9>: pushl 0x8(%ebp)
+ <__sighndlr+12>: call *0x14(%ebp)
+ <__sighndlr+15>: leave <--- PC */
+ (*(unsigned long *)(pc - 15) == 0xffec8b55
+ && *(unsigned long *)(pc - 11) == 0x75ff1075
+ && *(unsigned long *)(pc - 7) == 0x0875ff0c
+ && *(unsigned long *)(pc - 3) == 0xc91455ff)
+
+ || /* Solaris 2.10
+ ------------
+ <__sighndlr+0>: push %ebp
+ <__sighndlr+1>: mov %esp,%ebp
+ <__sighndlr+3>: pushl 0x10(%ebp)
+ <__sighndlr+6>: pushl 0xc(%ebp)
+ <__sighndlr+9>: pushl 0x8(%ebp)
+ <__sighndlr+12>: call *0x14(%ebp)
+ <__sighndlr+15>: add $0xc,%esp <--- PC
+ <__sighndlr+18>: leave
+ <__sighndlr+19>: ret */
+ (*(unsigned long *)(pc - 15) == 0xffec8b55
+ && *(unsigned long *)(pc - 11) == 0x75ff1075
+ && *(unsigned long *)(pc - 7) == 0x0875ff0c
+ && *(unsigned long *)(pc - 3) == 0x831455ff
+ && *(unsigned long *)(pc + 1) == 0xc3c90cc4))
+ {
+ struct handler_args {
+ int signo;
+ siginfo_t *sip;
+ ucontext_t *ucontext;
+ } *handler_args = context->cfa;
+ mctx = &handler_args->ucontext->uc_mcontext;
+ }
+ else
+ return _URC_END_OF_STACK;
+
+ new_cfa = mctx->gregs[UESP];
+
+ fs->regs.cfa_how = CFA_REG_OFFSET;
+ fs->regs.cfa_reg = 4;
+ fs->regs.cfa_offset = new_cfa - (long) context->cfa;
+
+ /* The SVR4 register numbering macros aren't usable in libgcc. */
+ fs->regs.reg[0].how = REG_SAVED_OFFSET;
+ fs->regs.reg[0].loc.offset = (long)&mctx->gregs[EAX] - new_cfa;
+ fs->regs.reg[3].how = REG_SAVED_OFFSET;
+ fs->regs.reg[3].loc.offset = (long)&mctx->gregs[EBX] - new_cfa;
+ fs->regs.reg[1].how = REG_SAVED_OFFSET;
+ fs->regs.reg[1].loc.offset = (long)&mctx->gregs[ECX] - new_cfa;
+ fs->regs.reg[2].how = REG_SAVED_OFFSET;
+ fs->regs.reg[2].loc.offset = (long)&mctx->gregs[EDX] - new_cfa;
+ fs->regs.reg[6].how = REG_SAVED_OFFSET;
+ fs->regs.reg[6].loc.offset = (long)&mctx->gregs[ESI] - new_cfa;
+ fs->regs.reg[7].how = REG_SAVED_OFFSET;
+ fs->regs.reg[7].loc.offset = (long)&mctx->gregs[EDI] - new_cfa;
+ fs->regs.reg[5].how = REG_SAVED_OFFSET;
+ fs->regs.reg[5].loc.offset = (long)&mctx->gregs[EBP] - new_cfa;
+ fs->regs.reg[8].how = REG_SAVED_OFFSET;
+ fs->regs.reg[8].loc.offset = (long)&mctx->gregs[EIP] - new_cfa;
+ fs->retaddr_column = 8;
+ fs->signal_frame = 1;
+
+ return _URC_NO_REASON;
+}
+
+#endif
diff --git a/gcc/config/i386/sol2.h b/gcc/config/i386/sol2.h
index 4c2dfe975cf..f062280fd18 100644
--- a/gcc/config/i386/sol2.h
+++ b/gcc/config/i386/sol2.h
@@ -118,3 +118,5 @@ along with GCC; see the file COPYING3. If not see
#ifndef TARGET_GNU_LD
#define USE_HIDDEN_LINKONCE 0
#endif
+
+#define MD_UNWIND_SUPPORT "config/i386/sol2-unwind.h"
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index e90296512ad..bad39bb69c8 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -86,6 +86,9 @@
(define_mode_attr ssemodesuffixf2c [(V4SF "s") (V2DF "d")])
+;; Mapping of the max integer size for xop rotate immediate constraint
+(define_mode_attr sserotatemax [(V16QI "7") (V8HI "15") (V4SI "31") (V2DI "63")])
+
;; Mapping of vector modes back to the scalar modes
(define_mode_attr ssescalarmode [(V4SF "SF") (V2DF "DF")
(V16QI "QI") (V8HI "HI")
@@ -1455,7 +1458,8 @@
(match_operator:SSEMODEF4 3 "sse_comparison_operator"
[(match_operand:SSEMODEF4 1 "register_operand" "0")
(match_operand:SSEMODEF4 2 "nonimmediate_operand" "xm")]))]
- "(SSE_FLOAT_MODE_P (<MODE>mode) || SSE_VEC_FLOAT_MODE_P (<MODE>mode))"
+ "!TARGET_XOP
+ && (SSE_FLOAT_MODE_P (<MODE>mode) || SSE_VEC_FLOAT_MODE_P (<MODE>mode))"
"cmp%D3<ssemodesuffixf4>\t{%2, %0|%0, %2}"
[(set_attr "type" "ssecmp")
(set_attr "length_immediate" "1")
@@ -5614,7 +5618,7 @@
(match_operand:V4SI 2 "register_operand" "")))]
"TARGET_SSE2"
{
- if (TARGET_SSE4_1)
+ if (TARGET_SSE4_1 || TARGET_XOP)
ix86_fixup_binary_operands_no_copy (MULT, V4SImode, operands);
})
@@ -5643,7 +5647,7 @@
[(set (match_operand:V4SI 0 "register_operand" "")
(mult:V4SI (match_operand:V4SI 1 "register_operand" "")
(match_operand:V4SI 2 "register_operand" "")))]
- "TARGET_SSE2 && !TARGET_SSE4_1
+ "TARGET_SSE2 && !TARGET_SSE4_1 && !TARGET_XOP
&& can_create_pseudo_p ()"
"#"
"&& 1"
@@ -5705,6 +5709,42 @@
rtx t1, t2, t3, t4, t5, t6, thirtytwo;
rtx op0, op1, op2;
+ if (TARGET_XOP)
+ {
+ /* op1: A,B,C,D, op2: E,F,G,H */
+ op0 = operands[0];
+ op1 = gen_lowpart (V4SImode, operands[1]);
+ op2 = gen_lowpart (V4SImode, operands[2]);
+ t1 = gen_reg_rtx (V4SImode);
+ t2 = gen_reg_rtx (V4SImode);
+ t3 = gen_reg_rtx (V4SImode);
+ t4 = gen_reg_rtx (V2DImode);
+ t5 = gen_reg_rtx (V2DImode);
+
+ /* t1: B,A,D,C */
+ emit_insn (gen_sse2_pshufd_1 (t1, op1,
+ GEN_INT (1),
+ GEN_INT (0),
+ GEN_INT (3),
+ GEN_INT (2)));
+
+ /* t2: 0 */
+ emit_move_insn (t2, CONST0_RTX (V4SImode));
+
+ /* t3: (B*E),(A*F),(D*G),(C*H) */
+ emit_insn (gen_xop_pmacsdd (t3, t1, op2, t2));
+
+ /* t4: (B*E)+(A*F), (D*G)+(C*H) */
+ emit_insn (gen_xop_phadddq (t4, t3));
+
+ /* t5: ((B*E)+(A*F))<<32, ((D*G)+(C*H))<<32 */
+ emit_insn (gen_ashlv2di3 (t5, t4, GEN_INT (32)));
+
+ /* op0: (((B*E)+(A*F))<<32)+(B*F), (((D*G)+(C*H))<<32)+(D*H) */
+ emit_insn (gen_xop_pmacsdql (op0, op1, op2, t5));
+ DONE;
+ }
+
op0 = operands[0];
op1 = operands[1];
op2 = operands[2];
@@ -5820,6 +5860,56 @@
DONE;
})
+(define_expand "vec_widen_smult_hi_v4si"
+ [(match_operand:V2DI 0 "register_operand" "")
+ (match_operand:V4SI 1 "register_operand" "")
+ (match_operand:V4SI 2 "register_operand" "")]
+ "TARGET_XOP"
+{
+ rtx t1, t2;
+
+ t1 = gen_reg_rtx (V4SImode);
+ t2 = gen_reg_rtx (V4SImode);
+
+ emit_insn (gen_sse2_pshufd_1 (t1, operands[1],
+ GEN_INT (0),
+ GEN_INT (2),
+ GEN_INT (1),
+ GEN_INT (3)));
+ emit_insn (gen_sse2_pshufd_1 (t2, operands[2],
+ GEN_INT (0),
+ GEN_INT (2),
+ GEN_INT (1),
+ GEN_INT (3)));
+ emit_insn (gen_xop_mulv2div2di3_high (operands[0], t1, t2));
+ DONE;
+})
+
+(define_expand "vec_widen_smult_lo_v4si"
+ [(match_operand:V2DI 0 "register_operand" "")
+ (match_operand:V4SI 1 "register_operand" "")
+ (match_operand:V4SI 2 "register_operand" "")]
+ "TARGET_XOP"
+{
+ rtx t1, t2;
+
+ t1 = gen_reg_rtx (V4SImode);
+ t2 = gen_reg_rtx (V4SImode);
+
+ emit_insn (gen_sse2_pshufd_1 (t1, operands[1],
+ GEN_INT (0),
+ GEN_INT (2),
+ GEN_INT (1),
+ GEN_INT (3)));
+ emit_insn (gen_sse2_pshufd_1 (t2, operands[2],
+ GEN_INT (0),
+ GEN_INT (2),
+ GEN_INT (1),
+ GEN_INT (3)));
+ emit_insn (gen_xop_mulv2div2di3_low (operands[0], t1, t2));
+ DONE;
+})
+
(define_expand "vec_widen_umult_hi_v4si"
[(match_operand:V2DI 0 "register_operand" "")
(match_operand:V4SI 1 "register_operand" "")
@@ -6217,7 +6307,7 @@
(eq:SSEMODE124
(match_operand:SSEMODE124 1 "nonimmediate_operand" "")
(match_operand:SSEMODE124 2 "nonimmediate_operand" "")))]
- "TARGET_SSE2"
+ "TARGET_SSE2 && !TARGET_XOP "
"ix86_fixup_binary_operands_no_copy (EQ, <MODE>mode, operands);")
(define_insn "*avx_eq<mode>3"
@@ -6240,7 +6330,7 @@
(eq:SSEMODE124
(match_operand:SSEMODE124 1 "nonimmediate_operand" "%0")
(match_operand:SSEMODE124 2 "nonimmediate_operand" "xm")))]
- "TARGET_SSE2
+ "TARGET_SSE2 && !TARGET_XOP
&& ix86_binary_operator_ok (EQ, <MODE>mode, operands)"
"pcmpeq<ssevecsize>\t{%2, %0|%0, %2}"
[(set_attr "type" "ssecmp")
@@ -6286,7 +6376,7 @@
(gt:SSEMODE124
(match_operand:SSEMODE124 1 "register_operand" "0")
(match_operand:SSEMODE124 2 "nonimmediate_operand" "xm")))]
- "TARGET_SSE2"
+ "TARGET_SSE2 && !TARGET_XOP"
"pcmpgt<ssevecsize>\t{%2, %0|%0, %2}"
[(set_attr "type" "ssecmp")
(set_attr "prefix_data16" "1")
@@ -10364,6 +10454,1445 @@
(set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; XOP instructions
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; XOP parallel integer multiply/add instructions.
+;; Note the instruction does not allow the value being added to be a memory
+;; operation. However by pretending via the nonimmediate_operand predicate
+;; that it does and splitting it later allows the following to be recognized:
+;; a[i] = b[i] * c[i] + d[i];
+(define_insn "xop_pmacsww"
+ [(set (match_operand:V8HI 0 "register_operand" "=x,x,x")
+ (plus:V8HI
+ (mult:V8HI
+ (match_operand:V8HI 1 "nonimmediate_operand" "%x,x,xm")
+ (match_operand:V8HI 2 "nonimmediate_operand" "x,xm,x"))
+ (match_operand:V8HI 3 "register_operand" "x,x,x")))]
+ "TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 4, false, 2, true)"
+ "@
+ vpmacsww\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpmacsww\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpmacsww\t{%3, %1, %2, %0|%0, %2, %1, %3}"
+ [(set_attr "type" "ssemuladd")
+ (set_attr "mode" "TI")])
+
+;; Split pmacsww with two memory operands into a load and the pmacsww.
+(define_split
+ [(set (match_operand:V8HI 0 "register_operand" "")
+ (plus:V8HI
+ (mult:V8HI (match_operand:V8HI 1 "nonimmediate_operand" "")
+ (match_operand:V8HI 2 "nonimmediate_operand" ""))
+ (match_operand:V8HI 3 "nonimmediate_operand" "")))]
+ "TARGET_XOP
+ && !ix86_fma4_valid_op_p (operands, insn, 4, false, 1, true)
+ && ix86_fma4_valid_op_p (operands, insn, 4, false, 2, true)
+ && !reg_mentioned_p (operands[0], operands[1])
+ && !reg_mentioned_p (operands[0], operands[2])
+ && !reg_mentioned_p (operands[0], operands[3])"
+ [(const_int 0)]
+{
+ ix86_expand_fma4_multiple_memory (operands, 4, V8HImode);
+ emit_insn (gen_xop_pmacsww (operands[0], operands[1], operands[2],
+ operands[3]));
+ DONE;
+})
+
+(define_insn "xop_pmacssww"
+ [(set (match_operand:V8HI 0 "register_operand" "=x,x,x")
+ (ss_plus:V8HI
+ (mult:V8HI (match_operand:V8HI 1 "nonimmediate_operand" "%x,x,m")
+ (match_operand:V8HI 2 "nonimmediate_operand" "x,m,x"))
+ (match_operand:V8HI 3 "register_operand" "x,x,x")))]
+ "TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 4, false, 1, true)"
+ "@
+ vpmacssww\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpmacssww\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpmacssww\t{%3, %1, %2, %0|%0, %2, %1, %3}"
+ [(set_attr "type" "ssemuladd")
+ (set_attr "mode" "TI")])
+
+;; Note the instruction does not allow the value being added to be a memory
+;; operation. However by pretending via the nonimmediate_operand predicate
+;; that it does and splitting it later allows the following to be recognized:
+;; a[i] = b[i] * c[i] + d[i];
+(define_insn "xop_pmacsdd"
+ [(set (match_operand:V4SI 0 "register_operand" "=x,x,x")
+ (plus:V4SI
+ (mult:V4SI
+ (match_operand:V4SI 1 "nonimmediate_operand" "%x,x,m")
+ (match_operand:V4SI 2 "nonimmediate_operand" "x,m,x"))
+ (match_operand:V4SI 3 "register_operand" "x,x,x")))]
+ "TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 4, false, 2, true)"
+ "@
+ vpmacsdd\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpmacsdd\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpmacsdd\t{%3, %1, %2, %0|%0, %2, %1, %3}"
+ [(set_attr "type" "ssemuladd")
+ (set_attr "mode" "TI")])
+
+;; Split pmacsdd with two memory operands into a load and the pmacsdd.
+(define_split
+ [(set (match_operand:V4SI 0 "register_operand" "")
+ (plus:V4SI
+ (mult:V4SI (match_operand:V4SI 1 "nonimmediate_operand" "")
+ (match_operand:V4SI 2 "nonimmediate_operand" ""))
+ (match_operand:V4SI 3 "nonimmediate_operand" "")))]
+ "TARGET_XOP
+ && !ix86_fma4_valid_op_p (operands, insn, 4, false, 1, true)
+ && ix86_fma4_valid_op_p (operands, insn, 4, false, 2, true)
+ && !reg_mentioned_p (operands[0], operands[1])
+ && !reg_mentioned_p (operands[0], operands[2])
+ && !reg_mentioned_p (operands[0], operands[3])"
+ [(const_int 0)]
+{
+ ix86_expand_fma4_multiple_memory (operands, 4, V4SImode);
+ emit_insn (gen_xop_pmacsdd (operands[0], operands[1], operands[2],
+ operands[3]));
+ DONE;
+})
+
+(define_insn "xop_pmacssdd"
+ [(set (match_operand:V4SI 0 "register_operand" "=x,x,x")
+ (ss_plus:V4SI
+ (mult:V4SI (match_operand:V4SI 1 "nonimmediate_operand" "%x,x,m")
+ (match_operand:V4SI 2 "nonimmediate_operand" "x,m,x"))
+ (match_operand:V4SI 3 "register_operand" "x,x,x")))]
+ "TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 4, false, 1, true)"
+ "@
+ vpmacssdd\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpmacssdd\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpmacssdd\t{%3, %1, %2, %0|%0, %2, %1, %3}"
+ [(set_attr "type" "ssemuladd")
+ (set_attr "mode" "TI")])
+
+(define_insn "xop_pmacssdql"
+ [(set (match_operand:V2DI 0 "register_operand" "=x,x,x")
+ (ss_plus:V2DI
+ (mult:V2DI
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_operand:V4SI 1 "nonimmediate_operand" "%x,x,m")
+ (parallel [(const_int 1)
+ (const_int 3)])))
+ (vec_select:V2SI
+ (match_operand:V4SI 2 "nonimmediate_operand" "x,m,x")
+ (parallel [(const_int 1)
+ (const_int 3)])))
+ (match_operand:V2DI 3 "register_operand" "x,x,x")))]
+ "TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 4, false, 1, true)"
+ "@
+ vpmacssdql\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpmacssdql\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpmacssdql\t{%3, %1, %2, %0|%0, %2, %1, %3}"
+ [(set_attr "type" "ssemuladd")
+ (set_attr "mode" "TI")])
+
+(define_insn "xop_pmacssdqh"
+ [(set (match_operand:V2DI 0 "register_operand" "=x,x,x")
+ (ss_plus:V2DI
+ (mult:V2DI
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_operand:V4SI 1 "nonimmediate_operand" "%x,x,m")
+ (parallel [(const_int 0)
+ (const_int 2)])))
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_operand:V4SI 2 "nonimmediate_operand" "x,m,x")
+ (parallel [(const_int 0)
+ (const_int 2)]))))
+ (match_operand:V2DI 3 "register_operand" "x,x,x")))]
+ "TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 4, false, 1, true)"
+ "@
+ vpmacssdqh\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpmacssdqh\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpmacssdqh\t{%3, %1, %2, %0|%0, %2, %1, %3}"
+ [(set_attr "type" "ssemuladd")
+ (set_attr "mode" "TI")])
+
+(define_insn "xop_pmacsdql"
+ [(set (match_operand:V2DI 0 "register_operand" "=x,x,x")
+ (plus:V2DI
+ (mult:V2DI
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_operand:V4SI 1 "nonimmediate_operand" "%x,x,m")
+ (parallel [(const_int 1)
+ (const_int 3)])))
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_operand:V4SI 2 "nonimmediate_operand" "x,m,x")
+ (parallel [(const_int 1)
+ (const_int 3)]))))
+ (match_operand:V2DI 3 "register_operand" "x,x,x")))]
+ "TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 4, false, 1, true)"
+ "@
+ vpmacsdql\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpmacsdql\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpmacsdql\t{%3, %1, %2, %0|%0, %2, %1, %3}"
+ [(set_attr "type" "ssemuladd")
+ (set_attr "mode" "TI")])
+
+(define_insn_and_split "*xop_pmacsdql_mem"
+ [(set (match_operand:V2DI 0 "register_operand" "=&x,&x,&x")
+ (plus:V2DI
+ (mult:V2DI
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_operand:V4SI 1 "nonimmediate_operand" "%x,x,m")
+ (parallel [(const_int 1)
+ (const_int 3)])))
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_operand:V4SI 2 "nonimmediate_operand" "x,m,x")
+ (parallel [(const_int 1)
+ (const_int 3)]))))
+ (match_operand:V2DI 3 "memory_operand" "m,m,m")))]
+ "TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 4, false, -1, true)"
+ "#"
+ "&& (reload_completed
+ || (!reg_mentioned_p (operands[0], operands[1])
+ && !reg_mentioned_p (operands[0], operands[2])))"
+ [(set (match_dup 0)
+ (match_dup 3))
+ (set (match_dup 0)
+ (plus:V2DI
+ (mult:V2DI
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_dup 1)
+ (parallel [(const_int 1)
+ (const_int 3)])))
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_dup 2)
+ (parallel [(const_int 1)
+ (const_int 3)]))))
+ (match_dup 0)))])
+
+;; We don't have a straight 32-bit parallel multiply and extend on XOP, so
+;; fake it with a multiply/add. In general, we expect the define_split to
+;; occur before register allocation, so we have to handle the corner case where
+;; the target is the same as operands 1/2
+(define_insn_and_split "xop_mulv2div2di3_low"
+ [(set (match_operand:V2DI 0 "register_operand" "=&x")
+ (mult:V2DI
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_operand:V4SI 1 "nonimmediate_operand" "%x")
+ (parallel [(const_int 1)
+ (const_int 3)])))
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_operand:V4SI 2 "nonimmediate_operand" "xm")
+ (parallel [(const_int 1)
+ (const_int 3)])))))]
+ "TARGET_XOP"
+ "#"
+ "&& (reload_completed
+ || (!reg_mentioned_p (operands[0], operands[1])
+ && !reg_mentioned_p (operands[0], operands[2])))"
+ [(set (match_dup 0)
+ (match_dup 3))
+ (set (match_dup 0)
+ (plus:V2DI
+ (mult:V2DI
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_dup 1)
+ (parallel [(const_int 1)
+ (const_int 3)])))
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_dup 2)
+ (parallel [(const_int 1)
+ (const_int 3)]))))
+ (match_dup 0)))]
+{
+ operands[3] = CONST0_RTX (V2DImode);
+}
+ [(set_attr "type" "ssemuladd")
+ (set_attr "mode" "TI")])
+
+(define_insn "xop_pmacsdqh"
+ [(set (match_operand:V2DI 0 "register_operand" "=x,x,x")
+ (plus:V2DI
+ (mult:V2DI
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_operand:V4SI 1 "nonimmediate_operand" "%x,x,m")
+ (parallel [(const_int 0)
+ (const_int 2)])))
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_operand:V4SI 2 "nonimmediate_operand" "x,m,x")
+ (parallel [(const_int 0)
+ (const_int 2)]))))
+ (match_operand:V2DI 3 "register_operand" "x,x,x")))]
+ "TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 4, false, 1, true)"
+ "@
+ vpmacsdqh\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpmacsdqh\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpmacsdqh\t{%3, %1, %2, %0|%0, %2, %1, %3}"
+ [(set_attr "type" "ssemuladd")
+ (set_attr "mode" "TI")])
+
+(define_insn_and_split "*xop_pmacsdqh_mem"
+ [(set (match_operand:V2DI 0 "register_operand" "=&x,&x,&x")
+ (plus:V2DI
+ (mult:V2DI
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_operand:V4SI 1 "nonimmediate_operand" "%x,x,m")
+ (parallel [(const_int 0)
+ (const_int 2)])))
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_operand:V4SI 2 "nonimmediate_operand" "x,m,x")
+ (parallel [(const_int 0)
+ (const_int 2)]))))
+ (match_operand:V2DI 3 "memory_operand" "m,m,m")))]
+ "TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 4, false, -1, true)"
+ "#"
+ "&& (reload_completed
+ || (!reg_mentioned_p (operands[0], operands[1])
+ && !reg_mentioned_p (operands[0], operands[2])))"
+ [(set (match_dup 0)
+ (match_dup 3))
+ (set (match_dup 0)
+ (plus:V2DI
+ (mult:V2DI
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_dup 1)
+ (parallel [(const_int 0)
+ (const_int 2)])))
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_dup 2)
+ (parallel [(const_int 0)
+ (const_int 2)]))))
+ (match_dup 0)))])
+
+;; We don't have a straight 32-bit parallel multiply and extend on XOP, so
+;; fake it with a multiply/add. In general, we expect the define_split to
+;; occur before register allocation, so we have to handle the corner case where
+;; the target is the same as either operands[1] or operands[2]
+(define_insn_and_split "xop_mulv2div2di3_high"
+ [(set (match_operand:V2DI 0 "register_operand" "=&x")
+ (mult:V2DI
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_operand:V4SI 1 "nonimmediate_operand" "%x")
+ (parallel [(const_int 0)
+ (const_int 2)])))
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_operand:V4SI 2 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)
+ (const_int 2)])))))]
+ "TARGET_XOP"
+ "#"
+ "&& (reload_completed
+ || (!reg_mentioned_p (operands[0], operands[1])
+ && !reg_mentioned_p (operands[0], operands[2])))"
+ [(set (match_dup 0)
+ (match_dup 3))
+ (set (match_dup 0)
+ (plus:V2DI
+ (mult:V2DI
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_dup 1)
+ (parallel [(const_int 0)
+ (const_int 2)])))
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_dup 2)
+ (parallel [(const_int 0)
+ (const_int 2)]))))
+ (match_dup 0)))]
+{
+ operands[3] = CONST0_RTX (V2DImode);
+}
+ [(set_attr "type" "ssemuladd")
+ (set_attr "mode" "TI")])
+
+;; XOP parallel integer multiply/add instructions for the intrinisics
+(define_insn "xop_pmacsswd"
+ [(set (match_operand:V4SI 0 "register_operand" "=x,x,x")
+ (ss_plus:V4SI
+ (mult:V4SI
+ (sign_extend:V4SI
+ (vec_select:V4HI
+ (match_operand:V8HI 1 "nonimmediate_operand" "%x,x,m")
+ (parallel [(const_int 1)
+ (const_int 3)
+ (const_int 5)
+ (const_int 7)])))
+ (sign_extend:V4SI
+ (vec_select:V4HI
+ (match_operand:V8HI 2 "nonimmediate_operand" "x,m,x")
+ (parallel [(const_int 1)
+ (const_int 3)
+ (const_int 5)
+ (const_int 7)]))))
+ (match_operand:V4SI 3 "register_operand" "x,x,x")))]
+ "TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 4, false, 1, true)"
+ "@
+ vpmacsswd\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpmacsswd\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpmacsswd\t{%3, %1, %2, %0|%0, %2, %1, %3}"
+ [(set_attr "type" "ssemuladd")
+ (set_attr "mode" "TI")])
+
+(define_insn "xop_pmacswd"
+ [(set (match_operand:V4SI 0 "register_operand" "=x,x,x")
+ (plus:V4SI
+ (mult:V4SI
+ (sign_extend:V4SI
+ (vec_select:V4HI
+ (match_operand:V8HI 1 "nonimmediate_operand" "%x,x,m")
+ (parallel [(const_int 1)
+ (const_int 3)
+ (const_int 5)
+ (const_int 7)])))
+ (sign_extend:V4SI
+ (vec_select:V4HI
+ (match_operand:V8HI 2 "nonimmediate_operand" "x,m,x")
+ (parallel [(const_int 1)
+ (const_int 3)
+ (const_int 5)
+ (const_int 7)]))))
+ (match_operand:V4SI 3 "register_operand" "x,x,x")))]
+ "TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 4, false, 1, true)"
+ "@
+ vpmacswd\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpmacswd\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpmacswd\t{%3, %1, %2, %0|%0, %2, %1, %3}"
+ [(set_attr "type" "ssemuladd")
+ (set_attr "mode" "TI")])
+
+(define_insn "xop_pmadcsswd"
+ [(set (match_operand:V4SI 0 "register_operand" "=x,x,x")
+ (ss_plus:V4SI
+ (plus:V4SI
+ (mult:V4SI
+ (sign_extend:V4SI
+ (vec_select:V4HI
+ (match_operand:V8HI 1 "nonimmediate_operand" "%x,x,m")
+ (parallel [(const_int 0)
+ (const_int 2)
+ (const_int 4)
+ (const_int 6)])))
+ (sign_extend:V4SI
+ (vec_select:V4HI
+ (match_operand:V8HI 2 "nonimmediate_operand" "x,m,x")
+ (parallel [(const_int 0)
+ (const_int 2)
+ (const_int 4)
+ (const_int 6)]))))
+ (mult:V4SI
+ (sign_extend:V4SI
+ (vec_select:V4HI
+ (match_dup 1)
+ (parallel [(const_int 1)
+ (const_int 3)
+ (const_int 5)
+ (const_int 7)])))
+ (sign_extend:V4SI
+ (vec_select:V4HI
+ (match_dup 2)
+ (parallel [(const_int 1)
+ (const_int 3)
+ (const_int 5)
+ (const_int 7)])))))
+ (match_operand:V4SI 3 "register_operand" "x,x,x")))]
+ "TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 4, false, 1, true)"
+ "@
+ vpmadcsswd\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpmadcsswd\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpmadcsswd\t{%3, %1, %2, %0|%0, %2, %1, %3}"
+ [(set_attr "type" "ssemuladd")
+ (set_attr "mode" "TI")])
+
+(define_insn "xop_pmadcswd"
+ [(set (match_operand:V4SI 0 "register_operand" "=x,x,x")
+ (plus:V4SI
+ (plus:V4SI
+ (mult:V4SI
+ (sign_extend:V4SI
+ (vec_select:V4HI
+ (match_operand:V8HI 1 "nonimmediate_operand" "%x,x,m")
+ (parallel [(const_int 0)
+ (const_int 2)
+ (const_int 4)
+ (const_int 6)])))
+ (sign_extend:V4SI
+ (vec_select:V4HI
+ (match_operand:V8HI 2 "nonimmediate_operand" "x,m,x")
+ (parallel [(const_int 0)
+ (const_int 2)
+ (const_int 4)
+ (const_int 6)]))))
+ (mult:V4SI
+ (sign_extend:V4SI
+ (vec_select:V4HI
+ (match_dup 1)
+ (parallel [(const_int 1)
+ (const_int 3)
+ (const_int 5)
+ (const_int 7)])))
+ (sign_extend:V4SI
+ (vec_select:V4HI
+ (match_dup 2)
+ (parallel [(const_int 1)
+ (const_int 3)
+ (const_int 5)
+ (const_int 7)])))))
+ (match_operand:V4SI 3 "register_operand" "x,x,x")))]
+ "TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 4, false, 1, true)"
+ "@
+ vpmadcswd\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpmadcswd\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpmadcswd\t{%3, %1, %2, %0|%0, %2, %1, %3}"
+ [(set_attr "type" "ssemuladd")
+ (set_attr "mode" "TI")])
+
+;; XOP parallel XMM conditional moves
+(define_insn "xop_pcmov_<mode>"
+ [(set (match_operand:SSEMODE 0 "register_operand" "=x,x,x")
+ (if_then_else:SSEMODE
+ (match_operand:SSEMODE 3 "nonimmediate_operand" "x,x,xm")
+ (match_operand:SSEMODE 1 "vector_move_operand" "x,xm,x")
+ (match_operand:SSEMODE 2 "vector_move_operand" "xm,x,x")))]
+ "TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 4, true, 1, false)"
+ "@
+ vpcmov\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpcmov\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpcmov\t{%3, %2, %1, %0|%0, %1, %2, %3}"
+ [(set_attr "type" "sse4arg")])
+
+(define_insn "xop_pcmov_<mode>256"
+ [(set (match_operand:AVX256MODE 0 "register_operand" "=x,x,x")
+ (if_then_else:AVX256MODE
+ (match_operand:AVX256MODE 3 "nonimmediate_operand" "x,x,xm")
+ (match_operand:AVX256MODE 1 "vector_move_operand" "x,xm,x")
+ (match_operand:AVX256MODE 2 "vector_move_operand" "xm,x,x")))]
+ "TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 4, true, 1, false)"
+ "@
+ vpcmov\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpcmov\t{%3, %2, %1, %0|%0, %1, %2, %3}
+ vpcmov\t{%3, %2, %1, %0|%0, %1, %2, %3}"
+ [(set_attr "type" "sse4arg")])
+
+;; XOP horizontal add/subtract instructions
+(define_insn "xop_phaddbw"
+ [(set (match_operand:V8HI 0 "register_operand" "=x")
+ (plus:V8HI
+ (sign_extend:V8HI
+ (vec_select:V8QI
+ (match_operand:V16QI 1 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)
+ (const_int 2)
+ (const_int 4)
+ (const_int 6)
+ (const_int 8)
+ (const_int 10)
+ (const_int 12)
+ (const_int 14)])))
+ (sign_extend:V8HI
+ (vec_select:V8QI
+ (match_dup 1)
+ (parallel [(const_int 1)
+ (const_int 3)
+ (const_int 5)
+ (const_int 7)
+ (const_int 9)
+ (const_int 11)
+ (const_int 13)
+ (const_int 15)])))))]
+ "TARGET_XOP"
+ "vphaddbw\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sseiadd1")])
+
+(define_insn "xop_phaddbd"
+ [(set (match_operand:V4SI 0 "register_operand" "=x")
+ (plus:V4SI
+ (plus:V4SI
+ (sign_extend:V4SI
+ (vec_select:V4QI
+ (match_operand:V16QI 1 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)
+ (const_int 4)
+ (const_int 8)
+ (const_int 12)])))
+ (sign_extend:V4SI
+ (vec_select:V4QI
+ (match_dup 1)
+ (parallel [(const_int 1)
+ (const_int 5)
+ (const_int 9)
+ (const_int 13)]))))
+ (plus:V4SI
+ (sign_extend:V4SI
+ (vec_select:V4QI
+ (match_dup 1)
+ (parallel [(const_int 2)
+ (const_int 6)
+ (const_int 10)
+ (const_int 14)])))
+ (sign_extend:V4SI
+ (vec_select:V4QI
+ (match_dup 1)
+ (parallel [(const_int 3)
+ (const_int 7)
+ (const_int 11)
+ (const_int 15)]))))))]
+ "TARGET_XOP"
+ "vphaddbd\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sseiadd1")])
+
+(define_insn "xop_phaddbq"
+ [(set (match_operand:V2DI 0 "register_operand" "=x")
+ (plus:V2DI
+ (plus:V2DI
+ (plus:V2DI
+ (sign_extend:V2DI
+ (vec_select:V2QI
+ (match_operand:V16QI 1 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)
+ (const_int 4)])))
+ (sign_extend:V2DI
+ (vec_select:V2QI
+ (match_dup 1)
+ (parallel [(const_int 1)
+ (const_int 5)]))))
+ (plus:V2DI
+ (sign_extend:V2DI
+ (vec_select:V2QI
+ (match_dup 1)
+ (parallel [(const_int 2)
+ (const_int 6)])))
+ (sign_extend:V2DI
+ (vec_select:V2QI
+ (match_dup 1)
+ (parallel [(const_int 3)
+ (const_int 7)])))))
+ (plus:V2DI
+ (plus:V2DI
+ (sign_extend:V2DI
+ (vec_select:V2QI
+ (match_dup 1)
+ (parallel [(const_int 8)
+ (const_int 12)])))
+ (sign_extend:V2DI
+ (vec_select:V2QI
+ (match_dup 1)
+ (parallel [(const_int 9)
+ (const_int 13)]))))
+ (plus:V2DI
+ (sign_extend:V2DI
+ (vec_select:V2QI
+ (match_dup 1)
+ (parallel [(const_int 10)
+ (const_int 14)])))
+ (sign_extend:V2DI
+ (vec_select:V2QI
+ (match_dup 1)
+ (parallel [(const_int 11)
+ (const_int 15)])))))))]
+ "TARGET_XOP"
+ "vphaddbq\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sseiadd1")])
+
+(define_insn "xop_phaddwd"
+ [(set (match_operand:V4SI 0 "register_operand" "=x")
+ (plus:V4SI
+ (sign_extend:V4SI
+ (vec_select:V4HI
+ (match_operand:V8HI 1 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)
+ (const_int 2)
+ (const_int 4)
+ (const_int 6)])))
+ (sign_extend:V4SI
+ (vec_select:V4HI
+ (match_dup 1)
+ (parallel [(const_int 1)
+ (const_int 3)
+ (const_int 5)
+ (const_int 7)])))))]
+ "TARGET_XOP"
+ "vphaddwd\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sseiadd1")])
+
+(define_insn "xop_phaddwq"
+ [(set (match_operand:V2DI 0 "register_operand" "=x")
+ (plus:V2DI
+ (plus:V2DI
+ (sign_extend:V2DI
+ (vec_select:V2HI
+ (match_operand:V8HI 1 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)
+ (const_int 4)])))
+ (sign_extend:V2DI
+ (vec_select:V2HI
+ (match_dup 1)
+ (parallel [(const_int 1)
+ (const_int 5)]))))
+ (plus:V2DI
+ (sign_extend:V2DI
+ (vec_select:V2HI
+ (match_dup 1)
+ (parallel [(const_int 2)
+ (const_int 6)])))
+ (sign_extend:V2DI
+ (vec_select:V2HI
+ (match_dup 1)
+ (parallel [(const_int 3)
+ (const_int 7)]))))))]
+ "TARGET_XOP"
+ "vphaddwq\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sseiadd1")])
+
+(define_insn "xop_phadddq"
+ [(set (match_operand:V2DI 0 "register_operand" "=x")
+ (plus:V2DI
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_operand:V4SI 1 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)
+ (const_int 2)])))
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_dup 1)
+ (parallel [(const_int 1)
+ (const_int 3)])))))]
+ "TARGET_XOP"
+ "vphadddq\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sseiadd1")])
+
+(define_insn "xop_phaddubw"
+ [(set (match_operand:V8HI 0 "register_operand" "=x")
+ (plus:V8HI
+ (zero_extend:V8HI
+ (vec_select:V8QI
+ (match_operand:V16QI 1 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)
+ (const_int 2)
+ (const_int 4)
+ (const_int 6)
+ (const_int 8)
+ (const_int 10)
+ (const_int 12)
+ (const_int 14)])))
+ (zero_extend:V8HI
+ (vec_select:V8QI
+ (match_dup 1)
+ (parallel [(const_int 1)
+ (const_int 3)
+ (const_int 5)
+ (const_int 7)
+ (const_int 9)
+ (const_int 11)
+ (const_int 13)
+ (const_int 15)])))))]
+ "TARGET_XOP"
+ "vphaddubw\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sseiadd1")])
+
+(define_insn "xop_phaddubd"
+ [(set (match_operand:V4SI 0 "register_operand" "=x")
+ (plus:V4SI
+ (plus:V4SI
+ (zero_extend:V4SI
+ (vec_select:V4QI
+ (match_operand:V16QI 1 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)
+ (const_int 4)
+ (const_int 8)
+ (const_int 12)])))
+ (zero_extend:V4SI
+ (vec_select:V4QI
+ (match_dup 1)
+ (parallel [(const_int 1)
+ (const_int 5)
+ (const_int 9)
+ (const_int 13)]))))
+ (plus:V4SI
+ (zero_extend:V4SI
+ (vec_select:V4QI
+ (match_dup 1)
+ (parallel [(const_int 2)
+ (const_int 6)
+ (const_int 10)
+ (const_int 14)])))
+ (zero_extend:V4SI
+ (vec_select:V4QI
+ (match_dup 1)
+ (parallel [(const_int 3)
+ (const_int 7)
+ (const_int 11)
+ (const_int 15)]))))))]
+ "TARGET_XOP"
+ "vphaddubd\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sseiadd1")])
+
+(define_insn "xop_phaddubq"
+ [(set (match_operand:V2DI 0 "register_operand" "=x")
+ (plus:V2DI
+ (plus:V2DI
+ (plus:V2DI
+ (zero_extend:V2DI
+ (vec_select:V2QI
+ (match_operand:V16QI 1 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)
+ (const_int 4)])))
+ (sign_extend:V2DI
+ (vec_select:V2QI
+ (match_dup 1)
+ (parallel [(const_int 1)
+ (const_int 5)]))))
+ (plus:V2DI
+ (zero_extend:V2DI
+ (vec_select:V2QI
+ (match_dup 1)
+ (parallel [(const_int 2)
+ (const_int 6)])))
+ (zero_extend:V2DI
+ (vec_select:V2QI
+ (match_dup 1)
+ (parallel [(const_int 3)
+ (const_int 7)])))))
+ (plus:V2DI
+ (plus:V2DI
+ (zero_extend:V2DI
+ (vec_select:V2QI
+ (match_dup 1)
+ (parallel [(const_int 8)
+ (const_int 12)])))
+ (sign_extend:V2DI
+ (vec_select:V2QI
+ (match_dup 1)
+ (parallel [(const_int 9)
+ (const_int 13)]))))
+ (plus:V2DI
+ (zero_extend:V2DI
+ (vec_select:V2QI
+ (match_dup 1)
+ (parallel [(const_int 10)
+ (const_int 14)])))
+ (zero_extend:V2DI
+ (vec_select:V2QI
+ (match_dup 1)
+ (parallel [(const_int 11)
+ (const_int 15)])))))))]
+ "TARGET_XOP"
+ "vphaddubq\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sseiadd1")])
+
+(define_insn "xop_phadduwd"
+ [(set (match_operand:V4SI 0 "register_operand" "=x")
+ (plus:V4SI
+ (zero_extend:V4SI
+ (vec_select:V4HI
+ (match_operand:V8HI 1 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)
+ (const_int 2)
+ (const_int 4)
+ (const_int 6)])))
+ (zero_extend:V4SI
+ (vec_select:V4HI
+ (match_dup 1)
+ (parallel [(const_int 1)
+ (const_int 3)
+ (const_int 5)
+ (const_int 7)])))))]
+ "TARGET_XOP"
+ "vphadduwd\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sseiadd1")])
+
+(define_insn "xop_phadduwq"
+ [(set (match_operand:V2DI 0 "register_operand" "=x")
+ (plus:V2DI
+ (plus:V2DI
+ (zero_extend:V2DI
+ (vec_select:V2HI
+ (match_operand:V8HI 1 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)
+ (const_int 4)])))
+ (zero_extend:V2DI
+ (vec_select:V2HI
+ (match_dup 1)
+ (parallel [(const_int 1)
+ (const_int 5)]))))
+ (plus:V2DI
+ (zero_extend:V2DI
+ (vec_select:V2HI
+ (match_dup 1)
+ (parallel [(const_int 2)
+ (const_int 6)])))
+ (zero_extend:V2DI
+ (vec_select:V2HI
+ (match_dup 1)
+ (parallel [(const_int 3)
+ (const_int 7)]))))))]
+ "TARGET_XOP"
+ "vphadduwq\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sseiadd1")])
+
+(define_insn "xop_phaddudq"
+ [(set (match_operand:V2DI 0 "register_operand" "=x")
+ (plus:V2DI
+ (zero_extend:V2DI
+ (vec_select:V2SI
+ (match_operand:V4SI 1 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)
+ (const_int 2)])))
+ (zero_extend:V2DI
+ (vec_select:V2SI
+ (match_dup 1)
+ (parallel [(const_int 1)
+ (const_int 3)])))))]
+ "TARGET_XOP"
+ "vphaddudq\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sseiadd1")])
+
+(define_insn "xop_phsubbw"
+ [(set (match_operand:V8HI 0 "register_operand" "=x")
+ (minus:V8HI
+ (sign_extend:V8HI
+ (vec_select:V8QI
+ (match_operand:V16QI 1 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)
+ (const_int 2)
+ (const_int 4)
+ (const_int 6)
+ (const_int 8)
+ (const_int 10)
+ (const_int 12)
+ (const_int 14)])))
+ (sign_extend:V8HI
+ (vec_select:V8QI
+ (match_dup 1)
+ (parallel [(const_int 1)
+ (const_int 3)
+ (const_int 5)
+ (const_int 7)
+ (const_int 9)
+ (const_int 11)
+ (const_int 13)
+ (const_int 15)])))))]
+ "TARGET_XOP"
+ "vphsubbw\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sseiadd1")])
+
+(define_insn "xop_phsubwd"
+ [(set (match_operand:V4SI 0 "register_operand" "=x")
+ (minus:V4SI
+ (sign_extend:V4SI
+ (vec_select:V4HI
+ (match_operand:V8HI 1 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)
+ (const_int 2)
+ (const_int 4)
+ (const_int 6)])))
+ (sign_extend:V4SI
+ (vec_select:V4HI
+ (match_dup 1)
+ (parallel [(const_int 1)
+ (const_int 3)
+ (const_int 5)
+ (const_int 7)])))))]
+ "TARGET_XOP"
+ "vphsubwd\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sseiadd1")])
+
+(define_insn "xop_phsubdq"
+ [(set (match_operand:V2DI 0 "register_operand" "=x")
+ (minus:V2DI
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_operand:V4SI 1 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)
+ (const_int 2)])))
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_dup 1)
+ (parallel [(const_int 1)
+ (const_int 3)])))))]
+ "TARGET_XOP"
+ "vphsubdq\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sseiadd1")])
+
+;; XOP permute instructions
+(define_insn "xop_pperm"
+ [(set (match_operand:V16QI 0 "register_operand" "=x,x,x")
+ (unspec:V16QI
+ [(match_operand:V16QI 1 "nonimmediate_operand" "x,x,xm")
+ (match_operand:V16QI 2 "nonimmediate_operand" "x,xm,x")
+ (match_operand:V16QI 3 "nonimmediate_operand" "xm,x,x")]
+ UNSPEC_XOP_PERMUTE))]
+ "TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 4, true, 1, false)"
+ "vpperm\t{%3, %2, %1, %0|%0, %1, %2, %3}"
+ [(set_attr "type" "sse4arg")
+ (set_attr "mode" "TI")])
+
+;; XOP pack instructions that combine two vectors into a smaller vector
+(define_insn "xop_pperm_pack_v2di_v4si"
+ [(set (match_operand:V4SI 0 "register_operand" "=x,x,x")
+ (vec_concat:V4SI
+ (truncate:V2SI
+ (match_operand:V2DI 1 "nonimmediate_operand" "x,x,xm"))
+ (truncate:V2SI
+ (match_operand:V2DI 2 "nonimmediate_operand" "x,xm,x"))))
+ (use (match_operand:V16QI 3 "nonimmediate_operand" "xm,x,x"))]
+ "TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 4, true, 1, false)"
+ "vpperm\t{%3, %2, %1, %0|%0, %1, %2, %3}"
+ [(set_attr "type" "sse4arg")
+ (set_attr "mode" "TI")])
+
+(define_insn "xop_pperm_pack_v4si_v8hi"
+ [(set (match_operand:V8HI 0 "register_operand" "=x,x,x")
+ (vec_concat:V8HI
+ (truncate:V4HI
+ (match_operand:V4SI 1 "nonimmediate_operand" "x,x,xm"))
+ (truncate:V4HI
+ (match_operand:V4SI 2 "nonimmediate_operand" "x,xm,x"))))
+ (use (match_operand:V16QI 3 "nonimmediate_operand" "xm,x,x"))]
+ "TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 4, true, 1, false)"
+ "vpperm\t{%3, %2, %1, %0|%0, %1, %2, %3}"
+ [(set_attr "type" "sse4arg")
+ (set_attr "mode" "TI")])
+
+(define_insn "xop_pperm_pack_v8hi_v16qi"
+ [(set (match_operand:V16QI 0 "register_operand" "=x,x,x")
+ (vec_concat:V16QI
+ (truncate:V8QI
+ (match_operand:V8HI 1 "nonimmediate_operand" "x,x,xm"))
+ (truncate:V8QI
+ (match_operand:V8HI 2 "nonimmediate_operand" "x,xm,x"))))
+ (use (match_operand:V16QI 3 "nonimmediate_operand" "xm,x,x"))]
+ "TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 4, true, 1, false)"
+ "vpperm\t{%3, %2, %1, %0|%0, %1, %2, %3}"
+ [(set_attr "type" "sse4arg")
+ (set_attr "mode" "TI")])
+
+;; XOP packed rotate instructions
+(define_expand "rotl<mode>3"
+ [(set (match_operand:SSEMODE1248 0 "register_operand" "")
+ (rotate:SSEMODE1248
+ (match_operand:SSEMODE1248 1 "nonimmediate_operand" "")
+ (match_operand:SI 2 "general_operand")))]
+ "TARGET_XOP"
+{
+ /* If we were given a scalar, convert it to parallel */
+ if (! const_0_to_<sserotatemax>_operand (operands[2], SImode))
+ {
+ rtvec vs = rtvec_alloc (<ssescalarnum>);
+ rtx par = gen_rtx_PARALLEL (<MODE>mode, vs);
+ rtx reg = gen_reg_rtx (<MODE>mode);
+ rtx op2 = operands[2];
+ int i;
+
+ if (GET_MODE (op2) != <ssescalarmode>mode)
+ {
+ op2 = gen_reg_rtx (<ssescalarmode>mode);
+ convert_move (op2, operands[2], false);
+ }
+
+ for (i = 0; i < <ssescalarnum>; i++)
+ RTVEC_ELT (vs, i) = op2;
+
+ emit_insn (gen_vec_init<mode> (reg, par));
+ emit_insn (gen_xop_vrotl<mode>3 (operands[0], operands[1], reg));
+ DONE;
+ }
+})
+
+(define_expand "rotr<mode>3"
+ [(set (match_operand:SSEMODE1248 0 "register_operand" "")
+ (rotatert:SSEMODE1248
+ (match_operand:SSEMODE1248 1 "nonimmediate_operand" "")
+ (match_operand:SI 2 "general_operand")))]
+ "TARGET_XOP"
+{
+ /* If we were given a scalar, convert it to parallel */
+ if (! const_0_to_<sserotatemax>_operand (operands[2], SImode))
+ {
+ rtvec vs = rtvec_alloc (<ssescalarnum>);
+ rtx par = gen_rtx_PARALLEL (<MODE>mode, vs);
+ rtx neg = gen_reg_rtx (<MODE>mode);
+ rtx reg = gen_reg_rtx (<MODE>mode);
+ rtx op2 = operands[2];
+ int i;
+
+ if (GET_MODE (op2) != <ssescalarmode>mode)
+ {
+ op2 = gen_reg_rtx (<ssescalarmode>mode);
+ convert_move (op2, operands[2], false);
+ }
+
+ for (i = 0; i < <ssescalarnum>; i++)
+ RTVEC_ELT (vs, i) = op2;
+
+ emit_insn (gen_vec_init<mode> (reg, par));
+ emit_insn (gen_neg<mode>2 (neg, reg));
+ emit_insn (gen_xop_vrotl<mode>3 (operands[0], operands[1], neg));
+ DONE;
+ }
+})
+
+(define_insn "xop_rotl<mode>3"
+ [(set (match_operand:SSEMODE1248 0 "register_operand" "=x")
+ (rotate:SSEMODE1248
+ (match_operand:SSEMODE1248 1 "nonimmediate_operand" "xm")
+ (match_operand:SI 2 "const_0_to_<sserotatemax>_operand" "n")))]
+ "TARGET_XOP"
+ "vprot<ssevecsize>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseishft")
+ (set_attr "length_immediate" "1")
+ (set_attr "mode" "TI")])
+
+(define_insn "xop_rotr<mode>3"
+ [(set (match_operand:SSEMODE1248 0 "register_operand" "=x")
+ (rotatert:SSEMODE1248
+ (match_operand:SSEMODE1248 1 "nonimmediate_operand" "xm")
+ (match_operand:SI 2 "const_0_to_<sserotatemax>_operand" "n")))]
+ "TARGET_XOP"
+{
+ operands[3] = GEN_INT ((<ssescalarnum> * 8) - INTVAL (operands[2]));
+ return \"vprot<ssevecsize>\t{%3, %1, %0|%0, %1, %3}\";
+}
+ [(set_attr "type" "sseishft")
+ (set_attr "length_immediate" "1")
+ (set_attr "mode" "TI")])
+
+(define_expand "vrotr<mode>3"
+ [(match_operand:SSEMODE1248 0 "register_operand" "")
+ (match_operand:SSEMODE1248 1 "register_operand" "")
+ (match_operand:SSEMODE1248 2 "register_operand" "")]
+ "TARGET_XOP"
+{
+ rtx reg = gen_reg_rtx (<MODE>mode);
+ emit_insn (gen_neg<mode>2 (reg, operands[2]));
+ emit_insn (gen_xop_vrotl<mode>3 (operands[0], operands[1], reg));
+ DONE;
+})
+
+(define_expand "vrotl<mode>3"
+ [(match_operand:SSEMODE1248 0 "register_operand" "")
+ (match_operand:SSEMODE1248 1 "register_operand" "")
+ (match_operand:SSEMODE1248 2 "register_operand" "")]
+ "TARGET_XOP"
+{
+ emit_insn (gen_xop_vrotl<mode>3 (operands[0], operands[1], operands[2]));
+ DONE;
+})
+
+(define_insn "xop_vrotl<mode>3"
+ [(set (match_operand:SSEMODE1248 0 "register_operand" "=x,x")
+ (if_then_else:SSEMODE1248
+ (ge:SSEMODE1248
+ (match_operand:SSEMODE1248 2 "nonimmediate_operand" "xm,x")
+ (const_int 0))
+ (rotate:SSEMODE1248
+ (match_operand:SSEMODE1248 1 "nonimmediate_operand" "x,xm")
+ (match_dup 2))
+ (rotatert:SSEMODE1248
+ (match_dup 1)
+ (neg:SSEMODE1248 (match_dup 2)))))]
+ "TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 3, true, 1, false)"
+ "vprot<ssevecsize>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseishft")
+ (set_attr "prefix_data16" "0")
+ (set_attr "prefix_extra" "2")
+ (set_attr "mode" "TI")])
+
+;; XOP packed shift instructions.
+;; FIXME: add V2DI back in
+(define_expand "vlshr<mode>3"
+ [(match_operand:SSEMODE124 0 "register_operand" "")
+ (match_operand:SSEMODE124 1 "register_operand" "")
+ (match_operand:SSEMODE124 2 "register_operand" "")]
+ "TARGET_XOP"
+{
+ rtx neg = gen_reg_rtx (<MODE>mode);
+ emit_insn (gen_neg<mode>2 (neg, operands[2]));
+ emit_insn (gen_xop_lshl<mode>3 (operands[0], operands[1], neg));
+ DONE;
+})
+
+(define_expand "vashr<mode>3"
+ [(match_operand:SSEMODE124 0 "register_operand" "")
+ (match_operand:SSEMODE124 1 "register_operand" "")
+ (match_operand:SSEMODE124 2 "register_operand" "")]
+ "TARGET_XOP"
+{
+ rtx neg = gen_reg_rtx (<MODE>mode);
+ emit_insn (gen_neg<mode>2 (neg, operands[2]));
+ emit_insn (gen_xop_ashl<mode>3 (operands[0], operands[1], neg));
+ DONE;
+})
+
+(define_expand "vashl<mode>3"
+ [(match_operand:SSEMODE124 0 "register_operand" "")
+ (match_operand:SSEMODE124 1 "register_operand" "")
+ (match_operand:SSEMODE124 2 "register_operand" "")]
+ "TARGET_XOP"
+{
+ emit_insn (gen_xop_ashl<mode>3 (operands[0], operands[1], operands[2]));
+ DONE;
+})
+
+(define_insn "xop_ashl<mode>3"
+ [(set (match_operand:SSEMODE1248 0 "register_operand" "=x,x")
+ (if_then_else:SSEMODE1248
+ (ge:SSEMODE1248
+ (match_operand:SSEMODE1248 2 "nonimmediate_operand" "xm,x")
+ (const_int 0))
+ (ashift:SSEMODE1248
+ (match_operand:SSEMODE1248 1 "nonimmediate_operand" "x,xm")
+ (match_dup 2))
+ (ashiftrt:SSEMODE1248
+ (match_dup 1)
+ (neg:SSEMODE1248 (match_dup 2)))))]
+ "TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 3, true, 1, false)"
+ "vpsha<ssevecsize>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseishft")
+ (set_attr "prefix_data16" "0")
+ (set_attr "prefix_extra" "2")
+ (set_attr "mode" "TI")])
+
+(define_insn "xop_lshl<mode>3"
+ [(set (match_operand:SSEMODE1248 0 "register_operand" "=x,x")
+ (if_then_else:SSEMODE1248
+ (ge:SSEMODE1248
+ (match_operand:SSEMODE1248 2 "nonimmediate_operand" "xm,x")
+ (const_int 0))
+ (ashift:SSEMODE1248
+ (match_operand:SSEMODE1248 1 "nonimmediate_operand" "x,xm")
+ (match_dup 2))
+ (lshiftrt:SSEMODE1248
+ (match_dup 1)
+ (neg:SSEMODE1248 (match_dup 2)))))]
+ "TARGET_XOP && ix86_fma4_valid_op_p (operands, insn, 3, true, 1, false)"
+ "vpshl<ssevecsize>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseishft")
+ (set_attr "prefix_data16" "0")
+ (set_attr "prefix_extra" "2")
+ (set_attr "mode" "TI")])
+
+;; SSE2 doesn't have some shift varients, so define versions for XOP
+(define_expand "ashlv16qi3"
+ [(match_operand:V16QI 0 "register_operand" "")
+ (match_operand:V16QI 1 "register_operand" "")
+ (match_operand:SI 2 "nonmemory_operand" "")]
+ "TARGET_XOP"
+{
+ rtvec vs = rtvec_alloc (16);
+ rtx par = gen_rtx_PARALLEL (V16QImode, vs);
+ rtx reg = gen_reg_rtx (V16QImode);
+ int i;
+ for (i = 0; i < 16; i++)
+ RTVEC_ELT (vs, i) = operands[2];
+
+ emit_insn (gen_vec_initv16qi (reg, par));
+ emit_insn (gen_xop_ashlv16qi3 (operands[0], operands[1], reg));
+ DONE;
+})
+
+(define_expand "lshlv16qi3"
+ [(match_operand:V16QI 0 "register_operand" "")
+ (match_operand:V16QI 1 "register_operand" "")
+ (match_operand:SI 2 "nonmemory_operand" "")]
+ "TARGET_XOP"
+{
+ rtvec vs = rtvec_alloc (16);
+ rtx par = gen_rtx_PARALLEL (V16QImode, vs);
+ rtx reg = gen_reg_rtx (V16QImode);
+ int i;
+ for (i = 0; i < 16; i++)
+ RTVEC_ELT (vs, i) = operands[2];
+
+ emit_insn (gen_vec_initv16qi (reg, par));
+ emit_insn (gen_xop_lshlv16qi3 (operands[0], operands[1], reg));
+ DONE;
+})
+
+(define_expand "ashrv16qi3"
+ [(match_operand:V16QI 0 "register_operand" "")
+ (match_operand:V16QI 1 "register_operand" "")
+ (match_operand:SI 2 "nonmemory_operand" "")]
+ "TARGET_XOP"
+{
+ rtvec vs = rtvec_alloc (16);
+ rtx par = gen_rtx_PARALLEL (V16QImode, vs);
+ rtx reg = gen_reg_rtx (V16QImode);
+ int i;
+ rtx ele = ((CONST_INT_P (operands[2]))
+ ? GEN_INT (- INTVAL (operands[2]))
+ : operands[2]);
+
+ for (i = 0; i < 16; i++)
+ RTVEC_ELT (vs, i) = ele;
+
+ emit_insn (gen_vec_initv16qi (reg, par));
+
+ if (!CONST_INT_P (operands[2]))
+ {
+ rtx neg = gen_reg_rtx (V16QImode);
+ emit_insn (gen_negv16qi2 (neg, reg));
+ emit_insn (gen_xop_ashlv16qi3 (operands[0], operands[1], neg));
+ }
+ else
+ emit_insn (gen_xop_ashlv16qi3 (operands[0], operands[1], reg));
+
+ DONE;
+})
+
+(define_expand "ashrv2di3"
+ [(match_operand:V2DI 0 "register_operand" "")
+ (match_operand:V2DI 1 "register_operand" "")
+ (match_operand:DI 2 "nonmemory_operand" "")]
+ "TARGET_XOP"
+{
+ rtvec vs = rtvec_alloc (2);
+ rtx par = gen_rtx_PARALLEL (V2DImode, vs);
+ rtx reg = gen_reg_rtx (V2DImode);
+ rtx ele;
+
+ if (CONST_INT_P (operands[2]))
+ ele = GEN_INT (- INTVAL (operands[2]));
+ else if (GET_MODE (operands[2]) != DImode)
+ {
+ rtx move = gen_reg_rtx (DImode);
+ ele = gen_reg_rtx (DImode);
+ convert_move (move, operands[2], false);
+ emit_insn (gen_negdi2 (ele, move));
+ }
+ else
+ {
+ ele = gen_reg_rtx (DImode);
+ emit_insn (gen_negdi2 (ele, operands[2]));
+ }
+
+ RTVEC_ELT (vs, 0) = ele;
+ RTVEC_ELT (vs, 1) = ele;
+ emit_insn (gen_vec_initv2di (reg, par));
+ emit_insn (gen_xop_ashlv2di3 (operands[0], operands[1], reg));
+ DONE;
+})
+
+;; XOP FRCZ support
+;; parallel insns
+(define_insn "xop_frcz<mode>2"
+ [(set (match_operand:SSEMODEF2P 0 "register_operand" "=x")
+ (unspec:SSEMODEF2P
+ [(match_operand:SSEMODEF2P 1 "nonimmediate_operand" "xm")]
+ UNSPEC_FRCZ))]
+ "TARGET_XOP"
+ "vfrcz<ssemodesuffixf4>\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssecvt1")
+ (set_attr "mode" "<MODE>")])
+
+;; scalar insns
+(define_insn "xop_vmfrcz<mode>2"
+ [(set (match_operand:SSEMODEF2P 0 "register_operand" "=x")
+ (vec_merge:SSEMODEF2P
+ (unspec:SSEMODEF2P
+ [(match_operand:SSEMODEF2P 2 "nonimmediate_operand" "xm")]
+ UNSPEC_FRCZ)
+ (match_operand:SSEMODEF2P 1 "register_operand" "0")
+ (const_int 1)))]
+ "TARGET_XOP"
+ "vfrcz<ssemodesuffixf2s>\t{%2, %0|%0, %2}"
+ [(set_attr "type" "ssecvt1")
+ (set_attr "mode" "<MODE>")])
+
+(define_insn "xop_frcz<mode>2256"
+ [(set (match_operand:FMA4MODEF4 0 "register_operand" "=x")
+ (unspec:FMA4MODEF4
+ [(match_operand:FMA4MODEF4 1 "nonimmediate_operand" "xm")]
+ UNSPEC_FRCZ))]
+ "TARGET_XOP"
+ "vfrcz<fma4modesuffixf4>\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssecvt1")
+ (set_attr "mode" "<MODE>")])
+
+(define_insn "xop_maskcmp<mode>3"
+ [(set (match_operand:SSEMODE1248 0 "register_operand" "=x")
+ (match_operator:SSEMODE1248 1 "ix86_comparison_int_operator"
+ [(match_operand:SSEMODE1248 2 "register_operand" "x")
+ (match_operand:SSEMODE1248 3 "nonimmediate_operand" "xm")]))]
+ "TARGET_XOP"
+ "vpcom%Y1<ssevecsize>\t{%3, %2, %0|%0, %2, %3}"
+ [(set_attr "type" "sse4arg")
+ (set_attr "prefix_data16" "0")
+ (set_attr "prefix_rep" "0")
+ (set_attr "prefix_extra" "2")
+ (set_attr "length_immediate" "1")
+ (set_attr "mode" "TI")])
+
+(define_insn "xop_maskcmp_uns<mode>3"
+ [(set (match_operand:SSEMODE1248 0 "register_operand" "=x")
+ (match_operator:SSEMODE1248 1 "ix86_comparison_uns_operator"
+ [(match_operand:SSEMODE1248 2 "register_operand" "x")
+ (match_operand:SSEMODE1248 3 "nonimmediate_operand" "xm")]))]
+ "TARGET_XOP"
+ "vpcom%Y1u<ssevecsize>\t{%3, %2, %0|%0, %2, %3}"
+ [(set_attr "type" "ssecmp")
+ (set_attr "prefix_data16" "0")
+ (set_attr "prefix_rep" "0")
+ (set_attr "prefix_extra" "2")
+ (set_attr "length_immediate" "1")
+ (set_attr "mode" "TI")])
+
+;; Version of pcom*u* that is called from the intrinsics that allows pcomequ*
+;; and pcomneu* not to be converted to the signed ones in case somebody needs
+;; the exact instruction generated for the intrinsic.
+(define_insn "xop_maskcmp_uns2<mode>3"
+ [(set (match_operand:SSEMODE1248 0 "register_operand" "=x")
+ (unspec:SSEMODE1248
+ [(match_operator:SSEMODE1248 1 "ix86_comparison_uns_operator"
+ [(match_operand:SSEMODE1248 2 "register_operand" "x")
+ (match_operand:SSEMODE1248 3 "nonimmediate_operand" "xm")])]
+ UNSPEC_XOP_UNSIGNED_CMP))]
+ "TARGET_XOP"
+ "vpcom%Y1u<ssevecsize>\t{%3, %2, %0|%0, %2, %3}"
+ [(set_attr "type" "ssecmp")
+ (set_attr "prefix_data16" "0")
+ (set_attr "prefix_extra" "2")
+ (set_attr "length_immediate" "1")
+ (set_attr "mode" "TI")])
+
+;; Pcomtrue and pcomfalse support. These are useless instructions, but are
+;; being added here to be complete.
+(define_insn "xop_pcom_tf<mode>3"
+ [(set (match_operand:SSEMODE1248 0 "register_operand" "=x")
+ (unspec:SSEMODE1248
+ [(match_operand:SSEMODE1248 1 "register_operand" "x")
+ (match_operand:SSEMODE1248 2 "nonimmediate_operand" "xm")
+ (match_operand:SI 3 "const_int_operand" "n")]
+ UNSPEC_XOP_TRUEFALSE))]
+ "TARGET_XOP"
+{
+ return ((INTVAL (operands[3]) != 0)
+ ? "vpcomtrue<ssevecsize>\t{%2, %1, %0|%0, %1, %2}"
+ : "vpcomfalse<ssevecsize>\t{%2, %1, %0|%0, %1, %2}");
+}
+ [(set_attr "type" "ssecmp")
+ (set_attr "prefix_data16" "0")
+ (set_attr "prefix_extra" "2")
+ (set_attr "length_immediate" "1")
+ (set_attr "mode" "TI")])
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define_insn "*avx_aesenc"
[(set (match_operand:V2DI 0 "register_operand" "=x")
(unspec:V2DI [(match_operand:V2DI 1 "register_operand" "x")
diff --git a/gcc/config/i386/winnt-cxx.c b/gcc/config/i386/winnt-cxx.c
index 9df7cf645bb..48518adc765 100644
--- a/gcc/config/i386/winnt-cxx.c
+++ b/gcc/config/i386/winnt-cxx.c
@@ -1,7 +1,6 @@
/* Target support for C++ classes on Windows.
Contributed by Danny Smith (dannysmith@users.sourceforge.net)
- Copyright (C) 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc.
This file is part of GCC.
@@ -28,7 +27,7 @@ along with GCC; see the file COPYING3. If not see
#include "hard-reg-set.h"
#include "output.h"
#include "tree.h"
-#include "cp/cp-tree.h" /* this is why we're a separate module */
+#include "cp/cp-tree.h" /* This is why we're a separate module. */
#include "flags.h"
#include "tm_p.h"
#include "toplev.h"
@@ -52,49 +51,44 @@ i386_pe_type_dllimport_p (tree decl)
|| DECL_TEMPLATE_INSTANTIATION (decl)
|| DECL_ARTIFICIAL (decl)))
return false;
-
-
- /* Don't mark defined functions as dllimport. This code will only be
- reached if we see a non-inline function defined out-of-class. */
- else if (TREE_CODE (decl) == FUNCTION_DECL
- && (DECL_INITIAL (decl)))
- return false;
-
- /* Don't allow definitions of static data members in dllimport class,
- If vtable data is marked as DECL_EXTERNAL, import it; otherwise just
- ignore the class attribute. */
- else if (TREE_CODE (decl) == VAR_DECL
- && TREE_STATIC (decl) && TREE_PUBLIC (decl)
- && !DECL_EXTERNAL (decl))
- {
- if (!DECL_VIRTUAL_P (decl))
- error ("definition of static data member %q+D of "
- "dllimport'd class", decl);
- return false;
- }
-
+
+ /* Overrides of the class dllimport decls by out-of-class definitions are
+ handled by tree.c:merge_dllimport_decl_attributes. */
return true;
}
-
bool
i386_pe_type_dllexport_p (tree decl)
{
- gcc_assert (TREE_CODE (decl) == VAR_DECL
- || TREE_CODE (decl) == FUNCTION_DECL);
- /* Avoid exporting compiler-generated default dtors and copy ctors.
- The only artificial methods that need to be exported are virtual
- and non-virtual thunks. */
- if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE
- && DECL_ARTIFICIAL (decl) && !DECL_THUNK_P (decl))
- return false;
- return true;
+ gcc_assert (TREE_CODE (decl) == VAR_DECL
+ || TREE_CODE (decl) == FUNCTION_DECL);
+
+ /* Avoid exporting compiler-generated default dtors and copy ctors.
+ The only artificial methods that need to be exported are virtual
+ and non-virtual thunks. */
+ if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE
+ && DECL_ARTIFICIAL (decl) && !DECL_THUNK_P (decl))
+ return false;
+ return true;
}
static inline void maybe_add_dllimport (tree decl)
{
if (i386_pe_type_dllimport_p (decl))
- DECL_DLLIMPORT_P (decl) = 1;
+ DECL_DLLIMPORT_P (decl) = 1;
+}
+
+static inline void maybe_add_dllexport (tree decl)
+{
+ if (i386_pe_type_dllexport_p (decl))
+ {
+ tree decl_attrs = DECL_ATTRIBUTES (decl);
+ if (lookup_attribute ("dllexport", decl_attrs) != NULL_TREE)
+ /* Already done. */
+ return;
+ DECL_ATTRIBUTES (decl) = tree_cons (get_identifier ("dllexport"),
+ NULL_TREE, decl_attrs);
+ }
}
void
@@ -103,41 +97,69 @@ i386_pe_adjust_class_at_definition (tree t)
tree member;
gcc_assert (CLASS_TYPE_P (t));
+
+
+ if (lookup_attribute ("dllexport", TYPE_ATTRIBUTES (t)) != NULL_TREE)
+ {
+ /* Check static VAR_DECL's. */
+ for (member = TYPE_FIELDS (t); member; member = TREE_CHAIN (member))
+ if (TREE_CODE (member) == VAR_DECL)
+ maybe_add_dllexport (member);
+
+ /* Check FUNCTION_DECL's. */
+ for (member = TYPE_METHODS (t); member; member = TREE_CHAIN (member))
+ if (TREE_CODE (member) == FUNCTION_DECL)
+ {
+ tree thunk;
+ maybe_add_dllexport (member);
+
+ /* Also add the attribute to its thunks. */
+ for (thunk = DECL_THUNKS (member); thunk;
+ thunk = TREE_CHAIN (thunk))
+ maybe_add_dllexport (thunk);
+ }
+ /* Check vtables */
+ for (member = CLASSTYPE_VTABLES (t); member; member = TREE_CHAIN (member))
+ if (TREE_CODE (member) == VAR_DECL)
+ maybe_add_dllexport (member);
+ }
- /* We only look at dllimport. The only thing that dllexport does is
- add stuff to a '.drectiv' section at end-of-file, so no need to do
- anything for dllexport'd classes until we generate RTL. */
- if (lookup_attribute ("dllimport", TYPE_ATTRIBUTES (t)) == NULL_TREE)
- return;
-
- /* We don't actually add the attribute to the decl, just set the flag
- that signals that the address of this symbol is not a compile-time
- constant. Any subsequent out-of-class declaration of members wil
- cause the DECL_DLLIMPORT_P flag to be unset.
- (See tree.c: merge_dllimport_decl_attributes).
- That is just right since out-of class declarations can only be a
- definition. We recheck the class members at RTL generation to
- emit warnings if this has happened. Definition of static data member
- of dllimport'd class always causes an error (as per MS compiler).
- */
-
- /* Check static VAR_DECL's. */
- for (member = TYPE_FIELDS (t); member; member = TREE_CHAIN (member))
- if (TREE_CODE (member) == VAR_DECL)
- maybe_add_dllimport (member);
+ else if (lookup_attribute ("dllimport", TYPE_ATTRIBUTES (t)) != NULL_TREE)
+ {
+ /* We don't actually add the attribute to the decl, just set the flag
+ that signals that the address of this symbol is not a compile-time
+ constant. Any subsequent out-of-class declaration of members wil
+ cause the DECL_DLLIMPORT_P flag to be unset.
+ (See tree.c: merge_dllimport_decl_attributes).
+ That is just right since out-of class declarations can only be a
+ definition. */
+
+ /* Check static VAR_DECL's. */
+ for (member = TYPE_FIELDS (t); member; member = TREE_CHAIN (member))
+ if (TREE_CODE (member) == VAR_DECL)
+ maybe_add_dllimport (member);
- /* Check FUNCTION_DECL's. */
- for (member = TYPE_METHODS (t); member; member = TREE_CHAIN (member))
- if (TREE_CODE (member) == FUNCTION_DECL)
- maybe_add_dllimport (member);
+ /* Check FUNCTION_DECL's. */
+ for (member = TYPE_METHODS (t); member; member = TREE_CHAIN (member))
+ if (TREE_CODE (member) == FUNCTION_DECL)
+ {
+ tree thunk;
+ maybe_add_dllimport (member);
+
+ /* Also add the attribute to its thunks. */
+ for (thunk = DECL_THUNKS (member); thunk;
+ thunk = TREE_CHAIN (thunk))
+ maybe_add_dllimport (thunk);
+ }
- /* Check vtables */
- for (member = CLASSTYPE_VTABLES (t); member; member = TREE_CHAIN (member))
- if (TREE_CODE (member) == VAR_DECL)
- maybe_add_dllimport (member);
-
-/* We leave typeinfo tables alone. We can't mark TI objects as
- dllimport, since the address of a secondary VTT may be needed
- for static initialization of a primary VTT. VTT's of
- dllimport'd classes should always be link-once COMDAT. */
+ /* Check vtables */
+ for (member = CLASSTYPE_VTABLES (t); member; member = TREE_CHAIN (member))
+ if (TREE_CODE (member) == VAR_DECL)
+ maybe_add_dllimport (member);
+
+ /* We leave typeinfo tables alone. We can't mark TI objects as
+ dllimport, since the address of a secondary VTT may be needed
+ for static initialization of a primary VTT. VTT's of
+ dllimport'd classes should always be link-once COMDAT. */
+ }
}
diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c
index 7069c40846f..f8dcaa9673a 100644
--- a/gcc/config/i386/winnt.c
+++ b/gcc/config/i386/winnt.c
@@ -102,8 +102,6 @@ associated_type (tree decl)
static bool
i386_pe_determine_dllexport_p (tree decl)
{
- tree assoc;
-
if (TREE_CODE (decl) != VAR_DECL && TREE_CODE (decl) != FUNCTION_DECL)
return false;
@@ -114,11 +112,6 @@ i386_pe_determine_dllexport_p (tree decl)
if (lookup_attribute ("dllexport", DECL_ATTRIBUTES (decl)))
return true;
- /* Also mark class members of exported classes with dllexport. */
- assoc = associated_type (decl);
- if (assoc && lookup_attribute ("dllexport", TYPE_ATTRIBUTES (assoc)))
- return i386_pe_type_dllexport_p (decl);
-
return false;
}
@@ -132,18 +125,23 @@ i386_pe_determine_dllimport_p (tree decl)
if (TREE_CODE (decl) != VAR_DECL && TREE_CODE (decl) != FUNCTION_DECL)
return false;
- /* Lookup the attribute in addition to checking the DECL_DLLIMPORT_P flag.
- We may need to override an earlier decision. */
if (DECL_DLLIMPORT_P (decl))
return true;
/* The DECL_DLLIMPORT_P flag was set for decls in the class definition
by targetm.cxx.adjust_class_at_definition. Check again to emit
- warnings if the class attribute has been overridden by an
- out-of-class definition. */
+ error message if the class attribute has been overridden by an
+ out-of-class definition of static data. */
assoc = associated_type (decl);
- if (assoc && lookup_attribute ("dllimport", TYPE_ATTRIBUTES (assoc)))
- return i386_pe_type_dllimport_p (decl);
+ if (assoc && lookup_attribute ("dllimport", TYPE_ATTRIBUTES (assoc))
+ && TREE_CODE (decl) == VAR_DECL
+ && TREE_STATIC (decl) && TREE_PUBLIC (decl)
+ && !DECL_EXTERNAL (decl)
+ /* vtable's are linkonce constants, so defining a vtable is not
+ an error as long as we don't try to import it too. */
+ && !DECL_VIRTUAL_P (decl))
+ error ("definition of static data member %q+D of "
+ "dllimport'd class", decl);
return false;
}
@@ -308,17 +306,8 @@ i386_pe_encode_section_info (tree decl, rtx rtl, int first)
if (i386_pe_determine_dllexport_p (decl))
flags |= SYMBOL_FLAG_DLLEXPORT;
else if (i386_pe_determine_dllimport_p (decl))
- {
- flags |= SYMBOL_FLAG_DLLIMPORT;
- /* If we went through the associated_type path, this won't already
- be set. Though, frankly, this seems wrong, and should be fixed
- elsewhere. */
- if (!DECL_DLLIMPORT_P (decl))
- {
- DECL_DLLIMPORT_P (decl) = 1;
- flags &= ~SYMBOL_FLAG_LOCAL;
- }
- }
+ flags |= SYMBOL_FLAG_DLLIMPORT;
+
SYMBOL_REF_FLAGS (symbol) = flags;
}
diff --git a/gcc/config/i386/x86intrin.h b/gcc/config/i386/x86intrin.h
index 7bc47f8f15d..ac7e21fd6f7 100644
--- a/gcc/config/i386/x86intrin.h
+++ b/gcc/config/i386/x86intrin.h
@@ -54,10 +54,6 @@
#include <smmintrin.h>
#endif
-#ifdef __FMA4__
-#include <fma4intrin.h>
-#endif
-
#if defined (__AES__) || defined (__PCLMUL__)
#include <wmmintrin.h>
#endif
@@ -69,4 +65,16 @@
#include <mm3dnow.h>
#endif
+#ifdef __FMA4__
+#include <fma4intrin.h>
+#endif
+
+#ifdef __XOP__
+#include <xopintrin.h>
+#endif
+
+#ifdef __LWP__
+#include <lwpintrin.h>
+#endif
+
#endif /* _X86INTRIN_H_INCLUDED */
diff --git a/gcc/config/i386/xopintrin.h b/gcc/config/i386/xopintrin.h
new file mode 100644
index 00000000000..803417a6a45
--- /dev/null
+++ b/gcc/config/i386/xopintrin.h
@@ -0,0 +1,771 @@
+/* Copyright (C) 2007, 2008, 2009 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/>. */
+
+#ifndef _X86INTRIN_H_INCLUDED
+# error "Never use <xopintrin.h> directly; include <x86intrin.h> instead."
+#endif
+
+#ifndef _XOPMMINTRIN_H_INCLUDED
+#define _XOPMMINTRIN_H_INCLUDED
+
+#ifndef __XOP__
+# error "XOP instruction set not enabled"
+#else
+
+#include <fma4intrin.h>
+
+/* Integer multiply/add intructions. */
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maccs_epi16(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_vpmacssww ((__v8hi)__A,(__v8hi)__B, (__v8hi)__C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_macc_epi16(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_vpmacsww ((__v8hi)__A, (__v8hi)__B, (__v8hi)__C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maccsd_epi16(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_vpmacsswd ((__v8hi)__A, (__v8hi)__B, (__v4si)__C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maccd_epi16(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_vpmacswd ((__v8hi)__A, (__v8hi)__B, (__v4si)__C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maccs_epi32(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_vpmacssdd ((__v4si)__A, (__v4si)__B, (__v4si)__C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_macc_epi32(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_vpmacsdd ((__v4si)__A, (__v4si)__B, (__v4si)__C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maccslo_epi32(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_vpmacssdql ((__v4si)__A, (__v4si)__B, (__v2di)__C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_macclo_epi32(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_vpmacsdql ((__v4si)__A, (__v4si)__B, (__v2di)__C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maccshi_epi32(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_vpmacssdqh ((__v4si)__A, (__v4si)__B, (__v2di)__C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_macchi_epi32(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_vpmacsdqh ((__v4si)__A, (__v4si)__B, (__v2di)__C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maddsd_epi16(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_vpmadcsswd ((__v8hi)__A,(__v8hi)__B,(__v4si)__C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maddd_epi16(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_vpmadcswd ((__v8hi)__A,(__v8hi)__B,(__v4si)__C);
+}
+
+/* Packed Integer Horizontal Add and Subtract */
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_haddw_epi8(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_vphaddbw ((__v16qi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_haddd_epi8(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_vphaddbd ((__v16qi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_haddq_epi8(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_vphaddbq ((__v16qi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_haddd_epi16(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_vphaddwd ((__v8hi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_haddq_epi16(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_vphaddwq ((__v8hi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_haddq_epi32(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_vphadddq ((__v4si)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_haddw_epu8(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_vphaddubw ((__v16qi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_haddd_epu8(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_vphaddubd ((__v16qi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_haddq_epu8(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_vphaddubq ((__v16qi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_haddd_epu16(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_vphadduwd ((__v8hi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_haddq_epu16(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_vphadduwq ((__v8hi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_haddq_epu32(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_vphaddudq ((__v4si)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_hsubw_epi8(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_vphsubbw ((__v16qi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_hsubd_epi16(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_vphsubwd ((__v8hi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_hsubq_epi32(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_vphsubdq ((__v4si)__A);
+}
+
+/* Vector conditional move and permute */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmov_si128(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_vpcmov (__A, __B, __C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_perm_epi8(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_vpperm ((__v16qi)__A, (__v16qi)__B, (__v16qi)__C);
+}
+
+/* Packed Integer Rotates and Shifts
+ Rotates - Non-Immediate form */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_rot_epi8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vprotb ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_rot_epi16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vprotw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_rot_epi32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vprotd ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_rot_epi64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vprotq ((__v2di)__A, (__v2di)__B);
+}
+
+/* Rotates - Immediate form */
+
+#ifdef __OPTIMIZE__
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_roti_epi8(__m128i __A, const int __B)
+{
+ return (__m128i) __builtin_ia32_vprotbi ((__v16qi)__A, __B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_roti_epi16(__m128i __A, const int __B)
+{
+ return (__m128i) __builtin_ia32_vprotwi ((__v8hi)__A, __B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_roti_epi32(__m128i __A, const int __B)
+{
+ return (__m128i) __builtin_ia32_vprotdi ((__v4si)__A, __B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_roti_epi64(__m128i __A, const int __B)
+{
+ return (__m128i) __builtin_ia32_vprotqi ((__v2di)__A, __B);
+}
+#else
+#define _mm_roti_epi8(A, N) \
+ ((__m128i) __builtin_ia32_vprotbi ((__v16qi)(__m128i)(A), (int)(N)))
+#define _mm_roti_epi16(A, N) \
+ ((__m128i) __builtin_ia32_vprotwi ((__v8hi)(__m128i)(A), (int)(N)))
+#define _mm_roti_epi32(A, N) \
+ ((__m128i) __builtin_ia32_vprotdi ((__v4si)(__m128i)(A), (int)(N)))
+#define _mm_roti_epi64(A, N) \
+ ((__m128i) __builtin_ia32_vprotqi ((__v2di)(__m128i)(A), (int)(N)))
+#endif
+
+/* Shifts */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_shl_epi8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpshlb ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_shl_epi16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpshlw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_shl_epi32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpshld ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_shl_epi64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpshlq ((__v2di)__A, (__v2di)__B);
+}
+
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sha_epi8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpshab ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sha_epi16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpshaw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sha_epi32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpshad ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sha_epi64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpshaq ((__v2di)__A, (__v2di)__B);
+}
+
+/* Compare and Predicate Generation
+ pcom (integer, unsinged bytes) */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comlt_epu8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomltub ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comle_epu8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomleub ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comgt_epu8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomgtub ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comge_epu8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomgeub ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comeq_epu8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomequb ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comneq_epu8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomnequb ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comfalse_epu8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomfalseub ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comtrue_epu8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomtrueub ((__v16qi)__A, (__v16qi)__B);
+}
+
+/*pcom (integer, unsinged words) */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comlt_epu16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomltuw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comle_epu16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomleuw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comgt_epu16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomgtuw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comge_epu16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomgeuw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comeq_epu16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomequw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comneq_epu16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomnequw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comfalse_epu16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomfalseuw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comtrue_epu16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomtrueuw ((__v8hi)__A, (__v8hi)__B);
+}
+
+/*pcom (integer, unsinged double words) */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comlt_epu32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomltud ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comle_epu32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomleud ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comgt_epu32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomgtud ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comge_epu32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomgeud ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comeq_epu32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomequd ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comneq_epu32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomnequd ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comfalse_epu32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomfalseud ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comtrue_epu32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomtrueud ((__v4si)__A, (__v4si)__B);
+}
+
+/*pcom (integer, unsinged quad words) */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comlt_epu64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomltuq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comle_epu64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomleuq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comgt_epu64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomgtuq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comge_epu64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomgeuq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comeq_epu64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomequq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comneq_epu64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomnequq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comfalse_epu64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomfalseuq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comtrue_epu64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomtrueuq ((__v2di)__A, (__v2di)__B);
+}
+
+/*pcom (integer, signed bytes) */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comlt_epi8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomltb ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comle_epi8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomleb ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comgt_epi8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomgtb ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comge_epi8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomgeb ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comeq_epi8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomeqb ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comneq_epi8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomneqb ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comfalse_epi8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomfalseb ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comtrue_epi8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomtrueb ((__v16qi)__A, (__v16qi)__B);
+}
+
+/*pcom (integer, signed words) */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comlt_epi16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomltw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comle_epi16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomlew ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comgt_epi16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomgtw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comge_epi16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomgew ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comeq_epi16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomeqw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comneq_epi16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomneqw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comfalse_epi16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomfalsew ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comtrue_epi16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomtruew ((__v8hi)__A, (__v8hi)__B);
+}
+
+/*pcom (integer, signed double words) */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comlt_epi32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomltd ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comle_epi32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomled ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comgt_epi32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomgtd ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comge_epi32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomged ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comeq_epi32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomeqd ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comneq_epi32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomneqd ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comfalse_epi32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomfalsed ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comtrue_epi32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomtrued ((__v4si)__A, (__v4si)__B);
+}
+
+/*pcom (integer, signed quad words) */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comlt_epi64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomltq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comle_epi64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomleq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comgt_epi64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomgtq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comge_epi64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomgeq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comeq_epi64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomeqq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comneq_epi64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomneqq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comfalse_epi64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomfalseq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comtrue_epi64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_vpcomtrueq ((__v2di)__A, (__v2di)__B);
+}
+
+/* FRCZ */
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_frcz_ps (__m128 __A)
+{
+ return (__m128) __builtin_ia32_vfrczps ((__v4sf)__A);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_frcz_pd (__m128d __A)
+{
+ return (__m128d) __builtin_ia32_vfrczpd ((__v2df)__A);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_frcz_ss (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_vfrczss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_frcz_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_vfrczsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_frcz_ps (__m256 __A)
+{
+ return (__m256) __builtin_ia32_vfrczps256 ((__v8sf)__A);
+}
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_frcz_pd (__m256d __A)
+{
+ return (__m256d) __builtin_ia32_vfrczpd256 ((__v4df)__A);
+}
+
+#endif /* __XOP__ */
+
+#endif /* _XOPMMINTRIN_H_INCLUDED */
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 75c8f0ee6c4..8460475bddb 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -303,6 +303,7 @@ static enum machine_mode ia64_promote_function_mode (const_tree,
const_tree,
int);
static void ia64_trampoline_init (rtx, tree, rtx);
+static void ia64_override_options_after_change (void);
/* Table of valid machine attributes. */
static const struct attribute_spec ia64_attribute_table[] =
@@ -536,6 +537,9 @@ static const struct attribute_spec ia64_attribute_table[] =
#undef TARGET_TRAMPOLINE_INIT
#define TARGET_TRAMPOLINE_INIT ia64_trampoline_init
+#undef TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE
+#define TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE ia64_override_options_after_change
+
struct gcc_target targetm = TARGET_INITIALIZER;
typedef enum
@@ -5496,6 +5500,33 @@ ia64_override_options (void)
if (TARGET_AUTO_PIC)
target_flags |= MASK_CONST_GP;
+ /* Numerous experiment shows that IRA based loop pressure
+ calculation works better for RTL loop invariant motion on targets
+ with enough (>= 32) registers. It is an expensive optimization.
+ So it is on only for peak performance. */
+ if (optimize >= 3)
+ flag_ira_loop_pressure = 1;
+
+
+ ia64_section_threshold = g_switch_set ? g_switch_value : IA64_DEFAULT_GVALUE;
+
+ init_machine_status = ia64_init_machine_status;
+
+ if (align_functions <= 0)
+ align_functions = 64;
+ if (align_loops <= 0)
+ align_loops = 32;
+ if (TARGET_ABI_OPEN_VMS)
+ flag_no_common = 1;
+
+ ia64_override_options_after_change();
+}
+
+/* Implement targetm.override_options_after_change. */
+
+static void
+ia64_override_options_after_change (void)
+{
ia64_flag_schedule_insns2 = flag_schedule_insns_after_reload;
flag_schedule_insns_after_reload = 0;
@@ -5517,18 +5548,6 @@ ia64_override_options (void)
a transformation. */
flag_auto_inc_dec = 0;
}
-
- ia64_section_threshold = g_switch_set ? g_switch_value : IA64_DEFAULT_GVALUE;
-
- init_machine_status = ia64_init_machine_status;
-
- if (align_functions <= 0)
- align_functions = 64;
- if (align_loops <= 0)
- align_loops = 32;
-
- if (TARGET_ABI_OPEN_VMS)
- flag_no_common = 1;
}
/* Initialize the record of emitted frame related registers. */
diff --git a/gcc/config/m32c/m32c-protos.h b/gcc/config/m32c/m32c-protos.h
index e571fe9d25e..42b92feb506 100644
--- a/gcc/config/m32c/m32c-protos.h
+++ b/gcc/config/m32c/m32c-protos.h
@@ -49,7 +49,6 @@ int m32c_trampoline_size (void);
#if defined(RTX_CODE) && defined(TREE_CODE)
rtx m32c_function_arg (CUMULATIVE_ARGS *, MM, tree, int);
-rtx m32c_function_value (const_tree, const_tree);
#endif
@@ -75,7 +74,7 @@ bool m32c_immd_dbl_mov (rtx *, MM);
rtx m32c_incoming_return_addr_rtx (void);
int m32c_legitimate_constant_p (rtx);
int m32c_legitimize_reload_address (rtx *, MM, int, int, int);
-rtx m32c_libcall_value (MM);
+bool m32c_function_value_regno_p (const unsigned int);
int m32c_limit_reload_class (MM, int);
int m32c_memory_move_cost (MM, int, int);
int m32c_modes_tieable_p (MM, MM);
diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c
index 4eeedb183e7..1085aa7c25a 100644
--- a/gcc/config/m32c/m32c.c
+++ b/gcc/config/m32c/m32c.c
@@ -81,6 +81,9 @@ static bool m32c_strict_argument_naming (CUMULATIVE_ARGS *);
static rtx m32c_struct_value_rtx (tree, int);
static rtx m32c_subreg (enum machine_mode, rtx, enum machine_mode, int);
static int need_to_save (int);
+static rtx m32c_function_value (const_tree, const_tree, bool);
+static rtx m32c_libcall_value (enum machine_mode, const_rtx);
+
int current_function_special_page_vector (rtx);
#define SYMBOL_FLAG_FUNCVEC_FUNCTION (SYMBOL_FLAG_MACH_DEP << 0)
@@ -1591,15 +1594,19 @@ m32c_valid_pointer_mode (enum machine_mode mode)
/* How Scalar Function Values Are Returned */
-/* Implements LIBCALL_VALUE. Most values are returned in $r0, or some
+/* Implements TARGET_LIBCALL_VALUE. Most values are returned in $r0, or some
combination of registers starting there (r2r0 for longs, r3r1r2r0
for long long, r3r2r1r0 for doubles), except that that ABI
currently doesn't work because it ends up using all available
general registers and gcc often can't compile it. So, instead, we
return anything bigger than 16 bits in "mem0" (effectively, a
memory location). */
-rtx
-m32c_libcall_value (enum machine_mode mode)
+
+#undef TARGET_LIBCALL_VALUE
+#define TARGET_LIBCALL_VALUE m32c_libcall_value
+
+static rtx
+m32c_libcall_value (enum machine_mode mode, const_rtx fun ATTRIBUTE_UNUSED)
{
/* return reg or parallel */
#if 0
@@ -1649,14 +1656,28 @@ m32c_libcall_value (enum machine_mode mode)
return gen_rtx_REG (mode, R0_REGNO);
}
-/* Implements FUNCTION_VALUE. Functions and libcalls have the same
+/* Implements TARGET_FUNCTION_VALUE. Functions and libcalls have the same
conventions. */
-rtx
-m32c_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED)
+
+#undef TARGET_FUNCTION_VALUE
+#define TARGET_FUNCTION_VALUE m32c_function_value
+
+static rtx
+m32c_function_value (const_tree valtype,
+ const_tree fn_decl_or_type ATTRIBUTE_UNUSED,
+ bool outgoing ATTRIBUTE_UNUSED)
{
/* return reg or parallel */
const enum machine_mode mode = TYPE_MODE (valtype);
- return m32c_libcall_value (mode);
+ return m32c_libcall_value (mode, NULL_RTX);
+}
+
+/* Implements FUNCTION_VALUE_REGNO_P. */
+
+bool
+m32c_function_value_regno_p (const unsigned int regno)
+{
+ return (regno == R0_REGNO || regno == MEM0_REGNO);
}
/* How Large Values Are Returned */
diff --git a/gcc/config/m32c/m32c.h b/gcc/config/m32c/m32c.h
index 0f12158c0e4..78e3115c291 100644
--- a/gcc/config/m32c/m32c.h
+++ b/gcc/config/m32c/m32c.h
@@ -533,10 +533,7 @@ typedef struct m32c_cumulative_args
/* How Scalar Function Values Are Returned */
-#define FUNCTION_VALUE(VT,F) m32c_function_value (VT, F)
-#define LIBCALL_VALUE(MODE) m32c_libcall_value (MODE)
-
-#define FUNCTION_VALUE_REGNO_P(r) ((r) == R0_REGNO || (r) == MEM0_REGNO)
+#define FUNCTION_VALUE_REGNO_P(r) m32c_function_value_regno_p (r)
/* How Large Values Are Returned */
@@ -563,7 +560,6 @@ typedef struct m32c_cumulative_args
#define HAVE_PRE_DECREMENT 1
#define HAVE_POST_INCREMENT 1
-#define CONSTANT_ADDRESS_P(X) CONSTANT_P(X)
#define MAX_REGS_PER_ADDRESS 1
/* This is passed to the macros below, so that they can be implemented
diff --git a/gcc/config/m68hc11/m68hc11.h b/gcc/config/m68hc11/m68hc11.h
index ee0f9f67fca..278ba15c4fa 100644
--- a/gcc/config/m68hc11/m68hc11.h
+++ b/gcc/config/m68hc11/m68hc11.h
@@ -1108,9 +1108,6 @@ extern unsigned char m68hc11_reg_valid_for_index[FIRST_PSEUDO_REGISTER];
&& (GET_CODE (XEXP (operand, 0)) == POST_INC) \
&& (SP_REG_P (XEXP (XEXP (operand, 0), 0))))
-/* 1 if X is an rtx for a constant that is a valid address. */
-#define CONSTANT_ADDRESS_P(X) (CONSTANT_P (X))
-
/* Maximum number of registers that can appear in a valid memory address */
#define MAX_REGS_PER_ADDRESS 2
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index 0862936b1b4..8db98fc4f46 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -1399,6 +1399,30 @@ flags_in_68881 (void)
return cc_status.flags & CC_IN_68881;
}
+/* Return true if PARALLEL contains register REGNO. */
+static bool
+m68k_reg_present_p (const_rtx parallel, unsigned int regno)
+{
+ int i;
+
+ if (REG_P (parallel) && REGNO (parallel) == regno)
+ return true;
+
+ if (GET_CODE (parallel) != PARALLEL)
+ return false;
+
+ for (i = 0; i < XVECLEN (parallel, 0); ++i)
+ {
+ const_rtx x;
+
+ x = XEXP (XVECEXP (parallel, 0, i), 0);
+ if (REG_P (x) && REGNO (x) == regno)
+ return true;
+ }
+
+ return false;
+}
+
/* Implement TARGET_FUNCTION_OK_FOR_SIBCALL_P. */
static bool
@@ -1411,6 +1435,26 @@ m68k_ok_for_sibcall_p (tree decl, tree exp)
if (CALL_EXPR_STATIC_CHAIN (exp))
return false;
+ if (!VOID_TYPE_P (TREE_TYPE (DECL_RESULT (cfun->decl))))
+ {
+ /* Check that the return value locations are the same. For
+ example that we aren't returning a value from the sibling in
+ a D0 register but then need to transfer it to a A0 register. */
+ rtx cfun_value;
+ rtx call_value;
+
+ cfun_value = FUNCTION_VALUE (TREE_TYPE (DECL_RESULT (cfun->decl)),
+ cfun->decl);
+ call_value = FUNCTION_VALUE (TREE_TYPE (exp), decl);
+
+ /* Check that the values are equal or that the result the callee
+ function returns is superset of what the current function returns. */
+ if (!(rtx_equal_p (cfun_value, call_value)
+ || (REG_P (cfun_value)
+ && m68k_reg_present_p (call_value, REGNO (cfun_value)))))
+ return false;
+ }
+
kind = m68k_get_function_kind (current_function_decl);
if (kind == m68k_fk_normal_function)
/* We can always sibcall from a normal function, because it's
@@ -5188,6 +5232,9 @@ m68k_libcall_value (enum machine_mode mode)
return gen_rtx_REG (mode, m68k_libcall_value_in_a0_p ? A0_REG : D0_REG);
}
+/* Location in which function value is returned.
+ NOTE: Due to differences in ABIs, don't call this function directly,
+ use FUNCTION_VALUE instead. */
rtx
m68k_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED)
{
diff --git a/gcc/config/mep/mep.h b/gcc/config/mep/mep.h
index 8b00a444ce2..9d286e33b94 100644
--- a/gcc/config/mep/mep.h
+++ b/gcc/config/mep/mep.h
@@ -567,8 +567,6 @@ typedef struct
#define TRAMPOLINE_SIZE 20
-#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
-
#define MAX_REGS_PER_ADDRESS 1
#ifdef REG_OK_STRICT
diff --git a/gcc/config/mips/iris.h b/gcc/config/mips/iris.h
index fce82174e66..373691ee6e1 100644
--- a/gcc/config/mips/iris.h
+++ b/gcc/config/mips/iris.h
@@ -63,9 +63,6 @@ along with GCC; see the file COPYING3. If not see
#undef ASM_FINISH_DECLARE_OBJECT
#define ASM_FINISH_DECLARE_OBJECT mips_finish_declare_object
-/* The linker needs a space after "-o". */
-#define SWITCHES_NEED_SPACES "o"
-
/* Specify wchar_t types. */
#undef WCHAR_TYPE
#define WCHAR_TYPE (Pmode == DImode ? "int" : "long int")
diff --git a/gcc/config/mips/mips-protos.h b/gcc/config/mips/mips-protos.h
index abcc2d421ef..716b7acad82 100644
--- a/gcc/config/mips/mips-protos.h
+++ b/gcc/config/mips/mips-protos.h
@@ -343,5 +343,7 @@ extern void mips_expand_vector_init (rtx, rtx);
extern bool mips_eh_uses (unsigned int);
extern bool mips_epilogue_uses (unsigned int);
extern void mips_final_prescan_insn (rtx, rtx *, int);
+extern int mips_trampoline_code_size (void);
+extern void mips_function_profiler (FILE *);
#endif /* ! GCC_MIPS_PROTOS_H */
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 1bead599411..c8c1dca25ce 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -126,6 +126,40 @@ along with GCC; see the file COPYING3. If not see
/* True if bit BIT is set in VALUE. */
#define BITSET_P(VALUE, BIT) (((VALUE) & (1 << (BIT))) != 0)
+/* Return the opcode for a ptr_mode load of the form:
+
+ l[wd] DEST, OFFSET(BASE). */
+#define MIPS_LOAD_PTR(DEST, OFFSET, BASE) \
+ (((ptr_mode == DImode ? 0x37 : 0x23) << 26) \
+ | ((BASE) << 21) \
+ | ((DEST) << 16) \
+ | (OFFSET))
+
+/* Return the opcode to move register SRC into register DEST. */
+#define MIPS_MOVE(DEST, SRC) \
+ ((TARGET_64BIT ? 0x2d : 0x21) \
+ | ((DEST) << 11) \
+ | ((SRC) << 21))
+
+/* Return the opcode for:
+
+ lui DEST, VALUE. */
+#define MIPS_LUI(DEST, VALUE) \
+ ((0xf << 26) | ((DEST) << 16) | (VALUE))
+
+/* Return the opcode to jump to register DEST. */
+#define MIPS_JR(DEST) \
+ (((DEST) << 21) | 0x8)
+
+/* Return the opcode for:
+
+ bal . + (1 + OFFSET) * 4. */
+#define MIPS_BAL(OFFSET) \
+ ((0x1 << 26) | (0x11 << 16) | (OFFSET))
+
+/* Return the usual opcode for a nop. */
+#define MIPS_NOP 0
+
/* Classifies an address.
ADDRESS_REG
@@ -285,6 +319,9 @@ struct GTY(()) mips_frame_info {
HOST_WIDE_INT acc_sp_offset;
HOST_WIDE_INT cop0_sp_offset;
+ /* Similar, but the value passed to _mcount. */
+ HOST_WIDE_INT ra_fp_offset;
+
/* The offset of arg_pointer_rtx from the bottom of the frame. */
HOST_WIDE_INT arg_pointer_offset;
@@ -2410,6 +2447,28 @@ mips_emit_move (rtx dest, rtx src)
: emit_move_insn_1 (dest, src));
}
+/* Emit an instruction of the form (set TARGET (CODE OP0)). */
+
+static void
+mips_emit_unary (enum rtx_code code, rtx target, rtx op0)
+{
+ emit_insn (gen_rtx_SET (VOIDmode, target,
+ gen_rtx_fmt_e (code, GET_MODE (op0), op0)));
+}
+
+/* Compute (CODE OP0) and store the result in a new register of mode MODE.
+ Return that new register. */
+
+static rtx
+mips_force_unary (enum machine_mode mode, enum rtx_code code, rtx op0)
+{
+ rtx reg;
+
+ reg = gen_reg_rtx (mode);
+ mips_emit_unary (code, reg, op0);
+ return reg;
+}
+
/* Emit an instruction of the form (set TARGET (CODE OP0 OP1)). */
static void
@@ -3353,10 +3412,11 @@ mips_immediate_operand_p (int code, HOST_WIDE_INT x)
/* Return the cost of binary operation X, given that the instruction
sequence for a word-sized or smaller operation has cost SINGLE_COST
- and that the sequence of a double-word operation has cost DOUBLE_COST. */
+ and that the sequence of a double-word operation has cost DOUBLE_COST.
+ If SPEED is true, optimize for speed otherwise optimize for size. */
static int
-mips_binary_cost (rtx x, int single_cost, int double_cost)
+mips_binary_cost (rtx x, int single_cost, int double_cost, bool speed)
{
int cost;
@@ -3365,8 +3425,8 @@ mips_binary_cost (rtx x, int single_cost, int double_cost)
else
cost = single_cost;
return (cost
- + rtx_cost (XEXP (x, 0), SET, !optimize_size)
- + rtx_cost (XEXP (x, 1), GET_CODE (x), !optimize_size));
+ + rtx_cost (XEXP (x, 0), SET, speed)
+ + rtx_cost (XEXP (x, 1), GET_CODE (x), speed));
}
/* Return the cost of floating-point multiplications of mode MODE. */
@@ -3436,8 +3496,7 @@ mips_zero_extend_cost (enum machine_mode mode, rtx op)
/* Implement TARGET_RTX_COSTS. */
static bool
-mips_rtx_costs (rtx x, int code, int outer_code, int *total,
- bool speed)
+mips_rtx_costs (rtx x, int code, int outer_code, int *total, bool speed)
{
enum machine_mode mode = GET_MODE (x);
bool float_mode_p = FLOAT_MODE_P (mode);
@@ -3493,8 +3552,7 @@ mips_rtx_costs (rtx x, int code, int outer_code, int *total,
operand needs to be forced into a register, we will often be
able to hoist the constant load out of the loop, so the load
should not contribute to the cost. */
- if (!optimize_size
- || mips_immediate_operand_p (outer_code, INTVAL (x)))
+ if (speed || mips_immediate_operand_p (outer_code, INTVAL (x)))
{
*total = 0;
return true;
@@ -3592,7 +3650,8 @@ mips_rtx_costs (rtx x, int code, int outer_code, int *total,
case IOR:
case XOR:
/* Double-word operations use two single-word operations. */
- *total = mips_binary_cost (x, COSTS_N_INSNS (1), COSTS_N_INSNS (2));
+ *total = mips_binary_cost (x, COSTS_N_INSNS (1), COSTS_N_INSNS (2),
+ speed);
return true;
case ASHIFT:
@@ -3601,9 +3660,11 @@ mips_rtx_costs (rtx x, int code, int outer_code, int *total,
case ROTATE:
case ROTATERT:
if (CONSTANT_P (XEXP (x, 1)))
- *total = mips_binary_cost (x, COSTS_N_INSNS (1), COSTS_N_INSNS (4));
+ *total = mips_binary_cost (x, COSTS_N_INSNS (1), COSTS_N_INSNS (4),
+ speed);
else
- *total = mips_binary_cost (x, COSTS_N_INSNS (1), COSTS_N_INSNS (12));
+ *total = mips_binary_cost (x, COSTS_N_INSNS (1), COSTS_N_INSNS (12),
+ speed);
return true;
case ABS:
@@ -3639,7 +3700,8 @@ mips_rtx_costs (rtx x, int code, int outer_code, int *total,
*total = mips_cost->fp_add;
return false;
}
- *total = mips_binary_cost (x, COSTS_N_INSNS (1), COSTS_N_INSNS (4));
+ *total = mips_binary_cost (x, COSTS_N_INSNS (1), COSTS_N_INSNS (4),
+ speed);
return true;
case MINUS:
@@ -3690,7 +3752,8 @@ mips_rtx_costs (rtx x, int code, int outer_code, int *total,
an SLTU. The MIPS16 version then needs to move the result of
the SLTU from $24 to a MIPS16 register. */
*total = mips_binary_cost (x, COSTS_N_INSNS (1),
- COSTS_N_INSNS (TARGET_MIPS16 ? 5 : 4));
+ COSTS_N_INSNS (TARGET_MIPS16 ? 5 : 4),
+ speed);
return true;
case NEG:
@@ -3726,10 +3789,10 @@ mips_rtx_costs (rtx x, int code, int outer_code, int *total,
else if (mode == DImode && !TARGET_64BIT)
/* Synthesized from 2 mulsi3s, 1 mulsidi3 and two additions,
where the mulsidi3 always includes an MFHI and an MFLO. */
- *total = (optimize_size
- ? COSTS_N_INSNS (ISA_HAS_MUL3 ? 7 : 9)
- : mips_cost->int_mult_si * 3 + 6);
- else if (optimize_size)
+ *total = (speed
+ ? mips_cost->int_mult_si * 3 + 6
+ : COSTS_N_INSNS (ISA_HAS_MUL3 ? 7 : 9));
+ else if (!speed)
*total = (ISA_HAS_MUL3 ? 1 : 2);
else if (mode == DImode)
*total = mips_cost->int_mult_di;
@@ -3766,7 +3829,7 @@ mips_rtx_costs (rtx x, int code, int outer_code, int *total,
case UDIV:
case UMOD:
- if (optimize_size)
+ if (!speed)
{
/* It is our responsibility to make division by a power of 2
as cheap as 2 register additions if we want the division
@@ -6243,7 +6306,7 @@ mips16_build_call_stub (rtx retval, rtx *fn_ptr, rtx args_size, int fp_code)
The stub's caller knows that $18 might be clobbered, even though
$18 is usually a call-saved register. */
fprintf (asm_out_file, "\tmove\t%s,%s\n",
- reg_names[GP_REG_FIRST + 18], reg_names[GP_REG_FIRST + 31]);
+ reg_names[GP_REG_FIRST + 18], reg_names[RETURN_ADDR_REGNUM]);
output_asm_insn (MIPS_CALL ("jal", &fn, 0, -1), &fn);
/* Move the result from floating-point registers to
@@ -6651,7 +6714,14 @@ mips_expand_block_move (rtx dest, rtx src, rtx length)
void
mips_expand_synci_loop (rtx begin, rtx end)
{
- rtx inc, label, cmp, cmp_result;
+ rtx inc, label, end_label, cmp_result, mask, length;
+
+ /* Create end_label. */
+ end_label = gen_label_rtx ();
+
+ /* Check if begin equals end. */
+ cmp_result = gen_rtx_EQ (VOIDmode, begin, end);
+ emit_jump_insn (gen_condjump (cmp_result, end_label));
/* Load INC with the cache line size (rdhwr INC,$1). */
inc = gen_reg_rtx (Pmode);
@@ -6659,18 +6729,36 @@ mips_expand_synci_loop (rtx begin, rtx end)
? gen_rdhwr_synci_step_si (inc)
: gen_rdhwr_synci_step_di (inc));
+ /* Check if inc is 0. */
+ cmp_result = gen_rtx_EQ (VOIDmode, inc, const0_rtx);
+ emit_jump_insn (gen_condjump (cmp_result, end_label));
+
+ /* Calculate mask. */
+ mask = mips_force_unary (Pmode, NEG, inc);
+
+ /* Mask out begin by mask. */
+ begin = mips_force_binary (Pmode, AND, begin, mask);
+
+ /* Calculate length. */
+ length = mips_force_binary (Pmode, MINUS, end, begin);
+
/* Loop back to here. */
label = gen_label_rtx ();
emit_label (label);
emit_insn (gen_synci (begin));
- cmp = mips_force_binary (Pmode, GTU, begin, end);
+ /* Update length. */
+ mips_emit_binary (MINUS, length, length, inc);
+ /* Update begin. */
mips_emit_binary (PLUS, begin, begin, inc);
- cmp_result = gen_rtx_EQ (VOIDmode, cmp, const0_rtx);
+ /* Check if length is greater than 0. */
+ cmp_result = gen_rtx_GT (VOIDmode, length, const0_rtx);
emit_jump_insn (gen_condjump (cmp_result, label));
+
+ emit_label (end_label);
}
/* Expand a QI or HI mode atomic memory operation.
@@ -7276,7 +7364,7 @@ mips_print_operand_punctuation (FILE *file, int ch)
break;
case '@':
- fputs (reg_names[GP_REG_FIRST + 1], file);
+ fputs (reg_names[AT_REGNUM], file);
break;
case '^':
@@ -8144,8 +8232,8 @@ mips_frame_set (rtx mem, rtx reg)
/* If we're saving the return address register and the DWARF return
address column differs from the hard register number, adjust the
note reg to refer to the former. */
- if (REGNO (reg) == GP_REG_FIRST + 31
- && DWARF_FRAME_RETURN_COLUMN != GP_REG_FIRST + 31)
+ if (REGNO (reg) == RETURN_ADDR_REGNUM
+ && DWARF_FRAME_RETURN_COLUMN != RETURN_ADDR_REGNUM)
reg = gen_rtx_REG (GET_MODE (reg), DWARF_FRAME_RETURN_COLUMN);
set = gen_rtx_SET (VOIDmode, mem, reg);
@@ -8595,8 +8683,8 @@ mips16e_output_save_restore (rtx pattern, HOST_WIDE_INT adjust)
mips16e_a0_a3_regs[end - 1]);
/* Save or restore $31. */
- if (BITSET_P (info.mask, 31))
- s += sprintf (s, ",%s", reg_names[GP_REG_FIRST + 31]);
+ if (BITSET_P (info.mask, RETURN_ADDR_REGNUM))
+ s += sprintf (s, ",%s", reg_names[RETURN_ADDR_REGNUM]);
return buffer;
}
@@ -8764,7 +8852,7 @@ mips_global_pointer (void)
return GLOBAL_POINTER_REGNUM;
}
-/* Return true if current function's prologue must load the global
+/* Return true if the current function's prologue must load the global
pointer value into pic_offset_table_rtx and store the same value in
the function's cprestore slot (if any).
@@ -8969,7 +9057,7 @@ mips_cfun_might_clobber_call_saved_reg_p (unsigned int regno)
/* If a MIPS16 function returns a value in FPRs, its epilogue
will need to call an external libgcc routine. This yet-to-be
generated call_insn will clobber $31. */
- if (regno == GP_REG_FIRST + 31 && mips16_cfun_returns_in_fpr_p ())
+ if (regno == RETURN_ADDR_REGNUM && mips16_cfun_returns_in_fpr_p ())
return true;
/* If REGNO is ordinarily call-clobbered, we must assume that any
@@ -9003,7 +9091,7 @@ mips_save_reg_p (unsigned int regno)
/* We need to save the incoming return address if __builtin_eh_return
is being used to set a different return address. */
- if (regno == GP_REG_FIRST + 31 && crtl->calls_eh_return)
+ if (regno == RETURN_ADDR_REGNUM && crtl->calls_eh_return)
return true;
return false;
@@ -9378,7 +9466,7 @@ mips_return_addr (int count, rtx frame ATTRIBUTE_UNUSED)
if (count != 0)
return const0_rtx;
- return get_hard_reg_initial_val (Pmode, GP_REG_FIRST + 31);
+ return get_hard_reg_initial_val (Pmode, RETURN_ADDR_REGNUM);
}
/* Emit code to change the current function's return address to
@@ -9390,7 +9478,7 @@ mips_set_return_address (rtx address, rtx scratch)
{
rtx slot_address;
- gcc_assert (BITSET_P (cfun->machine->frame.mask, 31));
+ gcc_assert (BITSET_P (cfun->machine->frame.mask, RETURN_ADDR_REGNUM));
slot_address = mips_add_offset (scratch, stack_pointer_rtx,
cfun->machine->frame.gp_sp_offset);
mips_emit_move (gen_frame_mem (GET_MODE (address), slot_address), address);
@@ -9499,7 +9587,10 @@ mips_restore_gp_from_cprestore_slot (rtx temp)
gcc_assert (TARGET_ABICALLS && TARGET_OLDABI && epilogue_completed);
if (!cfun->machine->must_restore_gp_when_clobbered_p)
- return;
+ {
+ emit_note (NOTE_INSN_DELETED);
+ return;
+ }
if (TARGET_MIPS16)
{
@@ -9578,6 +9669,9 @@ mips_for_each_saved_gpr_and_fpr (HOST_WIDE_INT sp_offset,
for (regno = GP_REG_LAST; regno >= GP_REG_FIRST; regno--)
if (BITSET_P (cfun->machine->frame.mask, regno - GP_REG_FIRST))
{
+ /* Record the ra offset for use by mips_function_profiler. */
+ if (regno == RETURN_ADDR_REGNUM)
+ cfun->machine->frame.ra_fp_offset = offset + sp_offset;
mips_save_restore_reg (word_mode, regno, offset, fn);
offset -= UNITS_PER_WORD;
}
@@ -9604,7 +9698,7 @@ static bool
mips_direct_save_slot_move_p (unsigned int regno, rtx mem, bool load_p)
{
/* There is a specific MIPS16 instruction for saving $31 to the stack. */
- if (TARGET_MIPS16 && !load_p && regno == GP_REG_FIRST + 31)
+ if (TARGET_MIPS16 && !load_p && regno == RETURN_ADDR_REGNUM)
return false;
return mips_secondary_reload_class (REGNO_REG_CLASS (regno),
@@ -9741,7 +9835,7 @@ mips_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
(frame_pointer_needed
? frame->total_size - frame->hard_frame_pointer_offset
: frame->total_size),
- reg_names[GP_REG_FIRST + 31],
+ reg_names[RETURN_ADDR_REGNUM],
frame->var_size,
frame->num_gp, frame->num_fp,
frame->args_size,
@@ -10184,7 +10278,7 @@ mips_restore_reg (rtx reg, rtx mem)
{
/* There's no MIPS16 instruction to load $31 directly. Load into
$7 instead and adjust the return insn appropriately. */
- if (TARGET_MIPS16 && REGNO (reg) == GP_REG_FIRST + 31)
+ if (TARGET_MIPS16 && REGNO (reg) == RETURN_ADDR_REGNUM)
reg = gen_rtx_REG (GET_MODE (reg), GP_REG_FIRST + 7);
mips_emit_save_slot_move (reg, mem, MIPS_EPILOGUE_TEMP (GET_MODE (reg)));
@@ -10399,10 +10493,10 @@ mips_expand_epilogue (bool sibcall_p)
address into $7 rather than $31. */
if (TARGET_MIPS16
&& !GENERATE_MIPS16E_SAVE_RESTORE
- && BITSET_P (frame->mask, 31))
+ && BITSET_P (frame->mask, RETURN_ADDR_REGNUM))
regno = GP_REG_FIRST + 7;
else
- regno = GP_REG_FIRST + 31;
+ regno = RETURN_ADDR_REGNUM;
emit_jump_insn (gen_return_internal (gen_rtx_REG (Pmode, regno)));
}
}
@@ -15830,7 +15924,7 @@ mips_epilogue_uses (unsigned int regno)
/* Say that the epilogue uses the return address register. Note that
in the case of sibcalls, the values "used by the epilogue" are
considered live at the start of the called function. */
- if (regno == 31)
+ if (regno == RETURN_ADDR_REGNUM)
return true;
/* If using a GOT, say that the epilogue also uses GOT_VERSION_REGNUM.
@@ -15889,41 +15983,21 @@ mips_final_postscan_insn (FILE *file ATTRIBUTE_UNUSED, rtx insn,
mips_pop_asm_switch (&mips_noat);
}
-/* Implement TARGET_ASM_TRAMPOLINE_TEMPLATE. */
+/* Return the size in bytes of the trampoline code, padded to
+ TRAMPOLINE_ALIGNMENT bits. The static chain pointer and target
+ function address immediately follow. */
-static void
-mips_asm_trampoline_template (FILE *f)
-{
- if (ptr_mode == DImode)
- fprintf (f, "\t.word\t0x03e0082d\t\t# dmove $1,$31\n");
- else
- fprintf (f, "\t.word\t0x03e00821\t\t# move $1,$31\n");
- fprintf (f, "\t.word\t0x04110001\t\t# bgezal $0,.+8\n");
- fprintf (f, "\t.word\t0x00000000\t\t# nop\n");
- if (ptr_mode == DImode)
- {
- fprintf (f, "\t.word\t0xdff90014\t\t# ld $25,20($31)\n");
- fprintf (f, "\t.word\t0xdfef001c\t\t# ld $15,28($31)\n");
- }
- else
- {
- fprintf (f, "\t.word\t0x8ff90010\t\t# lw $25,16($31)\n");
- fprintf (f, "\t.word\t0x8fef0014\t\t# lw $15,20($31)\n");
- }
- fprintf (f, "\t.word\t0x03200008\t\t# jr $25\n");
- if (ptr_mode == DImode)
- {
- fprintf (f, "\t.word\t0x0020f82d\t\t# dmove $31,$1\n");
- fprintf (f, "\t.word\t0x00000000\t\t# <padding>\n");
- fprintf (f, "\t.dword\t0x00000000\t\t# <function address>\n");
- fprintf (f, "\t.dword\t0x00000000\t\t# <static chain value>\n");
- }
+int
+mips_trampoline_code_size (void)
+{
+ if (TARGET_USE_PIC_FN_ADDR_REG)
+ return 4 * 4;
+ else if (ptr_mode == DImode)
+ return 8 * 4;
+ else if (ISA_HAS_LOAD_DELAY)
+ return 6 * 4;
else
- {
- fprintf (f, "\t.word\t0x0020f821\t\t# move $31,$1\n");
- fprintf (f, "\t.word\t0x00000000\t\t# <function address>\n");
- fprintf (f, "\t.word\t0x00000000\t\t# <static chain value>\n");
- }
+ return 4 * 4;
}
/* Implement TARGET_TRAMPOLINE_INIT. */
@@ -15931,23 +16005,198 @@ mips_asm_trampoline_template (FILE *f)
static void
mips_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
{
- rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
- rtx mem, addr, end_addr;
+ rtx addr, end_addr, high, low, opcode, mem;
+ rtx trampoline[8];
+ unsigned int i, j;
+ HOST_WIDE_INT end_addr_offset, static_chain_offset, target_function_offset;
+
+ /* Work out the offsets of the pointers from the start of the
+ trampoline code. */
+ end_addr_offset = mips_trampoline_code_size ();
+ static_chain_offset = end_addr_offset;
+ target_function_offset = static_chain_offset + GET_MODE_SIZE (ptr_mode);
- emit_block_move (m_tramp, assemble_trampoline_template (),
- GEN_INT (TRAMPOLINE_SIZE), BLOCK_OP_NORMAL);
+ /* Get pointers to the beginning and end of the code block. */
+ addr = force_reg (Pmode, XEXP (m_tramp, 0));
+ end_addr = mips_force_binary (Pmode, PLUS, addr, GEN_INT (end_addr_offset));
+
+#define OP(X) gen_int_mode (X, SImode)
+
+ /* Build up the code in TRAMPOLINE. */
+ i = 0;
+ if (TARGET_USE_PIC_FN_ADDR_REG)
+ {
+ /* $25 contains the address of the trampoline. Emit code of the form:
+
+ l[wd] $1, target_function_offset($25)
+ l[wd] $static_chain, static_chain_offset($25)
+ jr $1
+ move $25,$1. */
+ trampoline[i++] = OP (MIPS_LOAD_PTR (AT_REGNUM,
+ target_function_offset,
+ PIC_FUNCTION_ADDR_REGNUM));
+ trampoline[i++] = OP (MIPS_LOAD_PTR (STATIC_CHAIN_REGNUM,
+ static_chain_offset,
+ PIC_FUNCTION_ADDR_REGNUM));
+ trampoline[i++] = OP (MIPS_JR (AT_REGNUM));
+ trampoline[i++] = OP (MIPS_MOVE (PIC_FUNCTION_ADDR_REGNUM, AT_REGNUM));
+ }
+ else if (ptr_mode == DImode)
+ {
+ /* It's too cumbersome to create the full 64-bit address, so let's
+ instead use:
+
+ move $1, $31
+ bal 1f
+ nop
+ 1: l[wd] $25, target_function_offset - 12($31)
+ l[wd] $static_chain, static_chain_offset - 12($31)
+ jr $25
+ move $31, $1
+
+ where 12 is the offset of "1:" from the start of the code block. */
+ trampoline[i++] = OP (MIPS_MOVE (AT_REGNUM, RETURN_ADDR_REGNUM));
+ trampoline[i++] = OP (MIPS_BAL (1));
+ trampoline[i++] = OP (MIPS_NOP);
+ trampoline[i++] = OP (MIPS_LOAD_PTR (PIC_FUNCTION_ADDR_REGNUM,
+ target_function_offset - 12,
+ RETURN_ADDR_REGNUM));
+ trampoline[i++] = OP (MIPS_LOAD_PTR (STATIC_CHAIN_REGNUM,
+ static_chain_offset - 12,
+ RETURN_ADDR_REGNUM));
+ trampoline[i++] = OP (MIPS_JR (PIC_FUNCTION_ADDR_REGNUM));
+ trampoline[i++] = OP (MIPS_MOVE (RETURN_ADDR_REGNUM, AT_REGNUM));
+ }
+ else
+ {
+ /* If the target has load delays, emit:
+
+ lui $1, %hi(end_addr)
+ lw $25, %lo(end_addr + ...)($1)
+ lw $static_chain, %lo(end_addr + ...)($1)
+ jr $25
+ nop
+
+ Otherwise emit:
+
+ lui $1, %hi(end_addr)
+ lw $25, %lo(end_addr + ...)($1)
+ jr $25
+ lw $static_chain, %lo(end_addr + ...)($1). */
+
+ /* Split END_ADDR into %hi and %lo values. Trampolines are aligned
+ to 64 bits, so the %lo value will have the bottom 3 bits clear. */
+ high = expand_simple_binop (SImode, PLUS, end_addr, GEN_INT (0x8000),
+ NULL, false, OPTAB_WIDEN);
+ high = expand_simple_binop (SImode, LSHIFTRT, high, GEN_INT (16),
+ NULL, false, OPTAB_WIDEN);
+ low = convert_to_mode (SImode, gen_lowpart (HImode, end_addr), true);
+
+ /* Emit the LUI. */
+ opcode = OP (MIPS_LUI (AT_REGNUM, 0));
+ trampoline[i++] = expand_simple_binop (SImode, IOR, opcode, high,
+ NULL, false, OPTAB_WIDEN);
+
+ /* Emit the load of the target function. */
+ opcode = OP (MIPS_LOAD_PTR (PIC_FUNCTION_ADDR_REGNUM,
+ target_function_offset - end_addr_offset,
+ AT_REGNUM));
+ trampoline[i++] = expand_simple_binop (SImode, IOR, opcode, low,
+ NULL, false, OPTAB_WIDEN);
+
+ /* Emit the JR here, if we can. */
+ if (!ISA_HAS_LOAD_DELAY)
+ trampoline[i++] = OP (MIPS_JR (PIC_FUNCTION_ADDR_REGNUM));
+
+ /* Emit the load of the static chain register. */
+ opcode = OP (MIPS_LOAD_PTR (STATIC_CHAIN_REGNUM,
+ static_chain_offset - end_addr_offset,
+ AT_REGNUM));
+ trampoline[i++] = expand_simple_binop (SImode, IOR, opcode, low,
+ NULL, false, OPTAB_WIDEN);
+
+ /* Emit the JR, if we couldn't above. */
+ if (ISA_HAS_LOAD_DELAY)
+ {
+ trampoline[i++] = OP (MIPS_JR (PIC_FUNCTION_ADDR_REGNUM));
+ trampoline[i++] = OP (MIPS_NOP);
+ }
+ }
- mem = adjust_address (m_tramp, ptr_mode, ptr_mode == DImode ? 32 : 28);
- mips_emit_move (mem, force_reg (ptr_mode, fnaddr));
- mem = adjust_address (mem, ptr_mode, GET_MODE_SIZE (ptr_mode));
- mips_emit_move (mem, force_reg (ptr_mode, chain_value));
+#undef OP
- addr = force_reg (ptr_mode, XEXP (m_tramp, 0));
- end_addr = gen_reg_rtx (ptr_mode);
+ /* Copy the trampoline code. Leave any padding uninitialized. */
+ for (j = 0; j < i; j++)
+ {
+ mem = adjust_address (m_tramp, SImode, j * GET_MODE_SIZE (SImode));
+ mips_emit_move (mem, trampoline[j]);
+ }
+
+ /* Set up the static chain pointer field. */
+ mem = adjust_address (m_tramp, ptr_mode, static_chain_offset);
+ mips_emit_move (mem, chain_value);
+
+ /* Set up the target function field. */
+ mem = adjust_address (m_tramp, ptr_mode, target_function_offset);
+ mips_emit_move (mem, XEXP (DECL_RTL (fndecl), 0));
+
+ /* Flush the code part of the trampoline. */
emit_insn (gen_add3_insn (end_addr, addr, GEN_INT (TRAMPOLINE_SIZE)));
emit_insn (gen_clear_cache (addr, end_addr));
}
+/* Implement FUNCTION_PROFILER. */
+
+void mips_function_profiler (FILE *file)
+{
+ if (TARGET_MIPS16)
+ sorry ("mips16 function profiling");
+ if (TARGET_LONG_CALLS)
+ {
+ /* For TARGET_LONG_CALLS use $3 for the address of _mcount. */
+ if (Pmode == DImode)
+ fprintf (file, "\tdla\t%s,_mcount\n", reg_names[3]);
+ else
+ fprintf (file, "\tla\t%s,_mcount\n", reg_names[3]);
+ }
+ mips_push_asm_switch (&mips_noat);
+ fprintf (file, "\tmove\t%s,%s\t\t# save current return address\n",
+ reg_names[AT_REGNUM], reg_names[RETURN_ADDR_REGNUM]);
+ /* _mcount treats $2 as the static chain register. */
+ if (cfun->static_chain_decl != NULL)
+ fprintf (file, "\tmove\t%s,%s\n", reg_names[2],
+ reg_names[STATIC_CHAIN_REGNUM]);
+ if (TARGET_MCOUNT_RA_ADDRESS)
+ {
+ /* If TARGET_MCOUNT_RA_ADDRESS load $12 with the address of the
+ ra save location. */
+ if (cfun->machine->frame.ra_fp_offset == 0)
+ /* ra not saved, pass zero. */
+ fprintf (file, "\tmove\t%s,%s\n", reg_names[12], reg_names[0]);
+ else
+ fprintf (file, "\t%s\t%s," HOST_WIDE_INT_PRINT_DEC "(%s)\n",
+ Pmode == DImode ? "dla" : "la", reg_names[12],
+ cfun->machine->frame.ra_fp_offset,
+ reg_names[STACK_POINTER_REGNUM]);
+ }
+ if (!TARGET_NEWABI)
+ fprintf (file,
+ "\t%s\t%s,%s,%d\t\t# _mcount pops 2 words from stack\n",
+ TARGET_64BIT ? "dsubu" : "subu",
+ reg_names[STACK_POINTER_REGNUM],
+ reg_names[STACK_POINTER_REGNUM],
+ Pmode == DImode ? 16 : 8);
+
+ if (TARGET_LONG_CALLS)
+ fprintf (file, "\tjalr\t%s\n", reg_names[3]);
+ else
+ fprintf (file, "\tjal\t_mcount\n");
+ mips_pop_asm_switch (&mips_noat);
+ /* _mcount treats $2 as the static chain register. */
+ if (cfun->static_chain_decl != NULL)
+ fprintf (file, "\tmove\t%s,%s\n", reg_names[STATIC_CHAIN_REGNUM],
+ reg_names[2]);
+}
/* Initialize the GCC target structure. */
#undef TARGET_ASM_ALIGNED_HI_OP
@@ -16129,8 +16378,6 @@ mips_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
#undef TARGET_CAN_ELIMINATE
#define TARGET_CAN_ELIMINATE mips_can_eliminate
-#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
-#define TARGET_ASM_TRAMPOLINE_TEMPLATE mips_asm_trampoline_template
#undef TARGET_TRAMPOLINE_INIT
#define TARGET_TRAMPOLINE_INIT mips_trampoline_init
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 934e0fafa90..282970890f8 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -1311,10 +1311,10 @@ enum mips_code_readable_setting {
#define DWARF_FRAME_REGNUM(REGNO) mips_dwarf_regno[REGNO]
/* The DWARF 2 CFA column which tracks the return address. */
-#define DWARF_FRAME_RETURN_COLUMN (GP_REG_FIRST + 31)
+#define DWARF_FRAME_RETURN_COLUMN RETURN_ADDR_REGNUM
/* Before the prologue, RA lives in r31. */
-#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (VOIDmode, GP_REG_FIRST + 31)
+#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (VOIDmode, RETURN_ADDR_REGNUM)
/* Describe how we implement __builtin_eh_return. */
#define EH_RETURN_DATA_REGNO(N) \
@@ -2372,44 +2372,7 @@ typedef struct mips_args {
/* Output assembler code to FILE to increment profiler label # LABELNO
for profiling a function entry. */
-#define FUNCTION_PROFILER(FILE, LABELNO) \
-{ \
- if (TARGET_MIPS16) \
- sorry ("mips16 function profiling"); \
- if (TARGET_LONG_CALLS) \
- { \
- /* For TARGET_LONG_CALLS use $3 for the address of _mcount. */ \
- if (Pmode == DImode) \
- fprintf (FILE, "\tdla\t%s,_mcount\n", reg_names[GP_REG_FIRST + 3]); \
- else \
- fprintf (FILE, "\tla\t%s,_mcount\n", reg_names[GP_REG_FIRST + 3]); \
- } \
- mips_push_asm_switch (&mips_noat); \
- fprintf (FILE, "\tmove\t%s,%s\t\t# save current return address\n", \
- reg_names[GP_REG_FIRST + 1], reg_names[GP_REG_FIRST + 31]); \
- /* _mcount treats $2 as the static chain register. */ \
- if (cfun->static_chain_decl != NULL) \
- fprintf (FILE, "\tmove\t%s,%s\n", reg_names[2], \
- reg_names[STATIC_CHAIN_REGNUM]); \
- if (!TARGET_NEWABI) \
- { \
- fprintf (FILE, \
- "\t%s\t%s,%s,%d\t\t# _mcount pops 2 words from stack\n", \
- TARGET_64BIT ? "dsubu" : "subu", \
- reg_names[STACK_POINTER_REGNUM], \
- reg_names[STACK_POINTER_REGNUM], \
- Pmode == DImode ? 16 : 8); \
- } \
- if (TARGET_LONG_CALLS) \
- fprintf (FILE, "\tjalr\t%s\n", reg_names[GP_REG_FIRST + 3]); \
- else \
- fprintf (FILE, "\tjal\t_mcount\n"); \
- mips_pop_asm_switch (&mips_noat); \
- /* _mcount treats $2 as the static chain register. */ \
- if (cfun->static_chain_decl != NULL) \
- fprintf (FILE, "\tmove\t%s,%s\n", reg_names[STATIC_CHAIN_REGNUM], \
- reg_names[2]); \
-}
+#define FUNCTION_PROFILER(FILE, LABELNO) mips_function_profiler ((FILE))
/* The profiler preserves all interesting registers, including $31. */
#define MIPS_SAVE_REG_FOR_PROFILING_P(REGNO) false
@@ -2433,14 +2396,15 @@ typedef struct mips_args {
#define EXIT_IGNORE_STACK 1
-/* A C expression for the size in bytes of the trampoline, as an
- integer. */
+/* Trampolines are a block of code followed by two pointers. */
-#define TRAMPOLINE_SIZE (ptr_mode == DImode ? 48 : 36)
+#define TRAMPOLINE_SIZE \
+ (mips_trampoline_code_size () + GET_MODE_SIZE (ptr_mode) * 2)
-/* Alignment required for trampolines, in bits. */
+/* Forcing a 64-bit alignment for 32-bit targets allows us to load two
+ pointers from a single LUI base. */
-#define TRAMPOLINE_ALIGNMENT GET_MODE_BITSIZE (ptr_mode)
+#define TRAMPOLINE_ALIGNMENT 64
/* mips_trampoline_init calls this library function to flush
program and data caches. */
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index 19f3ffc7a06..76fc37bd479 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -82,6 +82,7 @@
(UNSPEC_ADDRESS_FIRST 100)
(TLS_GET_TP_REGNUM 3)
+ (RETURN_ADDR_REGNUM 31)
(CPRESTORE_SLOT_REGNUM 76)
(GOT_VERSION_REGNUM 79)
@@ -1878,7 +1879,7 @@
(set_attr "mode" "SI")
(set_attr "length" "12")])
-(define_insn_and_split "<u>mulsidi3_64bit"
+(define_insn "<u>mulsidi3_64bit"
[(set (match_operand:DI 0 "register_operand" "=d")
(mult:DI (any_extend:DI (match_operand:SI 1 "register_operand" "d"))
(any_extend:DI (match_operand:SI 2 "register_operand" "d"))))
@@ -1886,37 +1887,67 @@
(clobber (match_scratch:DI 4 "=d"))]
"TARGET_64BIT && !TARGET_FIX_R4000"
"#"
- "&& reload_completed"
+ [(set_attr "type" "imul")
+ (set_attr "mode" "SI")
+ (set (attr "length")
+ (if_then_else (ne (symbol_ref "ISA_HAS_EXT_INS") (const_int 0))
+ (const_int 16)
+ (const_int 28)))])
+
+(define_split
+ [(set (match_operand:DI 0 "d_operand")
+ (mult:DI (any_extend:DI (match_operand:SI 1 "d_operand"))
+ (any_extend:DI (match_operand:SI 2 "d_operand"))))
+ (clobber (match_operand:TI 3 "hilo_operand"))
+ (clobber (match_operand:DI 4 "d_operand"))]
+ "TARGET_64BIT && !TARGET_FIX_R4000 && ISA_HAS_EXT_INS && reload_completed"
[(set (match_dup 3)
(unspec:TI [(mult:DI (any_extend:DI (match_dup 1))
(any_extend:DI (match_dup 2)))]
UNSPEC_SET_HILO))
- ;; OP4 <- LO, OP0 <- HI
- (set (match_dup 4) (match_dup 5))
- (set (match_dup 0) (unspec:DI [(match_dup 3)] UNSPEC_MFHI))
+ ;; OP0 <- LO, OP4 <- HI
+ (set (match_dup 0) (match_dup 5))
+ (set (match_dup 4) (unspec:DI [(match_dup 3)] UNSPEC_MFHI))
- ;; Zero-extend OP4.
- (set (match_dup 4)
- (ashift:DI (match_dup 4)
- (const_int 32)))
- (set (match_dup 4)
- (lshiftrt:DI (match_dup 4)
- (const_int 32)))
+ (set (zero_extract:DI (match_dup 0) (const_int 32) (const_int 32))
+ (match_dup 4))]
+ { operands[5] = gen_rtx_REG (DImode, LO_REGNUM); })
+
+(define_split
+ [(set (match_operand:DI 0 "d_operand")
+ (mult:DI (any_extend:DI (match_operand:SI 1 "d_operand"))
+ (any_extend:DI (match_operand:SI 2 "d_operand"))))
+ (clobber (match_operand:TI 3 "hilo_operand"))
+ (clobber (match_operand:DI 4 "d_operand"))]
+ "TARGET_64BIT && !TARGET_FIX_R4000 && !ISA_HAS_EXT_INS && reload_completed"
+ [(set (match_dup 3)
+ (unspec:TI [(mult:DI (any_extend:DI (match_dup 1))
+ (any_extend:DI (match_dup 2)))]
+ UNSPEC_SET_HILO))
+
+ ;; OP0 <- LO, OP4 <- HI
+ (set (match_dup 0) (match_dup 5))
+ (set (match_dup 4) (unspec:DI [(match_dup 3)] UNSPEC_MFHI))
- ;; Shift OP0 into place.
+ ;; Zero-extend OP0.
(set (match_dup 0)
(ashift:DI (match_dup 0)
(const_int 32)))
+ (set (match_dup 0)
+ (lshiftrt:DI (match_dup 0)
+ (const_int 32)))
+
+ ;; Shift OP4 into place.
+ (set (match_dup 4)
+ (ashift:DI (match_dup 4)
+ (const_int 32)))
;; OR the two halves together
(set (match_dup 0)
(ior:DI (match_dup 0)
(match_dup 4)))]
- { operands[5] = gen_rtx_REG (DImode, LO_REGNUM); }
- [(set_attr "type" "imul")
- (set_attr "mode" "SI")
- (set_attr "length" "24")])
+ { operands[5] = gen_rtx_REG (DImode, LO_REGNUM); })
(define_insn "<u>mulsidi3_64bit_hilo"
[(set (match_operand:TI 0 "register_operand" "=x")
@@ -4011,7 +4042,7 @@
(define_insn "*mov<mode>_ra"
[(set (match_operand:GPR 0 "stack_operand" "=m")
- (reg:GPR 31))]
+ (reg:GPR RETURN_ADDR_REGNUM))]
"TARGET_MIPS16"
"<store>\t$31,%0"
[(set_attr "move_type" "store")
@@ -4938,7 +4969,7 @@
(define_insn "clear_hazard_<mode>"
[(unspec_volatile [(const_int 0)] UNSPEC_CLEAR_HAZARD)
- (clobber (reg:P 31))]
+ (clobber (reg:P RETURN_ADDR_REGNUM))]
"ISA_HAS_SYNCI"
{
return "%(%<bal\t1f\n"
@@ -6123,7 +6154,7 @@
(define_insn_and_split "call_internal"
[(call (mem:SI (match_operand 0 "call_insn_operand" "c,S"))
(match_operand 1 "" ""))
- (clobber (reg:SI 31))]
+ (clobber (reg:SI RETURN_ADDR_REGNUM))]
""
{ return TARGET_SPLIT_CALLS ? "#" : MIPS_CALL ("jal", operands, 0, 1); }
"reload_completed && TARGET_SPLIT_CALLS && (operands[2] = insn)"
@@ -6137,7 +6168,7 @@
(define_insn "call_split"
[(call (mem:SI (match_operand 0 "call_insn_operand" "cS"))
(match_operand 1 "" ""))
- (clobber (reg:SI 31))
+ (clobber (reg:SI RETURN_ADDR_REGNUM))
(clobber (reg:SI 28))]
"TARGET_SPLIT_CALLS"
{ return MIPS_CALL ("jal", operands, 0, 1); }
@@ -6151,7 +6182,7 @@
[(call (mem:SI (match_operand 0 "const_call_insn_operand"))
(match_operand 1))
(const_int 1)
- (clobber (reg:SI 31))]
+ (clobber (reg:SI RETURN_ADDR_REGNUM))]
""
{ return TARGET_SPLIT_CALLS ? "#" : MIPS_CALL ("jal", operands, 0, -1); }
"reload_completed && TARGET_SPLIT_CALLS && (operands[2] = insn)"
@@ -6167,7 +6198,7 @@
[(call (mem:SI (match_operand 0 "const_call_insn_operand"))
(match_operand 1))
(const_int 1)
- (clobber (reg:SI 31))
+ (clobber (reg:SI RETURN_ADDR_REGNUM))
(clobber (reg:SI 28))]
"TARGET_SPLIT_CALLS"
{ return MIPS_CALL ("jal", operands, 0, -1); }
@@ -6190,7 +6221,7 @@
[(set (match_operand 0 "register_operand" "")
(call (mem:SI (match_operand 1 "call_insn_operand" "c,S"))
(match_operand 2 "" "")))
- (clobber (reg:SI 31))]
+ (clobber (reg:SI RETURN_ADDR_REGNUM))]
""
{ return TARGET_SPLIT_CALLS ? "#" : MIPS_CALL ("jal", operands, 1, 2); }
"reload_completed && TARGET_SPLIT_CALLS && (operands[3] = insn)"
@@ -6207,7 +6238,7 @@
[(set (match_operand 0 "register_operand" "")
(call (mem:SI (match_operand 1 "call_insn_operand" "cS"))
(match_operand 2 "" "")))
- (clobber (reg:SI 31))
+ (clobber (reg:SI RETURN_ADDR_REGNUM))
(clobber (reg:SI 28))]
"TARGET_SPLIT_CALLS"
{ return MIPS_CALL ("jal", operands, 1, 2); }
@@ -6219,7 +6250,7 @@
(call (mem:SI (match_operand 1 "const_call_insn_operand"))
(match_operand 2)))
(const_int 1)
- (clobber (reg:SI 31))]
+ (clobber (reg:SI RETURN_ADDR_REGNUM))]
""
{ return TARGET_SPLIT_CALLS ? "#" : MIPS_CALL ("jal", operands, 1, -1); }
"reload_completed && TARGET_SPLIT_CALLS && (operands[3] = insn)"
@@ -6237,7 +6268,7 @@
(call (mem:SI (match_operand 1 "const_call_insn_operand"))
(match_operand 2)))
(const_int 1)
- (clobber (reg:SI 31))
+ (clobber (reg:SI RETURN_ADDR_REGNUM))
(clobber (reg:SI 28))]
"TARGET_SPLIT_CALLS"
{ return MIPS_CALL ("jal", operands, 1, -1); }
@@ -6251,7 +6282,7 @@
(set (match_operand 3 "register_operand" "")
(call (mem:SI (match_dup 1))
(match_dup 2)))
- (clobber (reg:SI 31))]
+ (clobber (reg:SI RETURN_ADDR_REGNUM))]
""
{ return TARGET_SPLIT_CALLS ? "#" : MIPS_CALL ("jal", operands, 1, 2); }
"reload_completed && TARGET_SPLIT_CALLS && (operands[4] = insn)"
@@ -6271,7 +6302,7 @@
(set (match_operand 3 "register_operand" "")
(call (mem:SI (match_dup 1))
(match_dup 2)))
- (clobber (reg:SI 31))
+ (clobber (reg:SI RETURN_ADDR_REGNUM))
(clobber (reg:SI 28))]
"TARGET_SPLIT_CALLS"
{ return MIPS_CALL ("jal", operands, 1, 2); }
diff --git a/gcc/config/mips/mips.opt b/gcc/config/mips/mips.opt
index 8462e4646d6..188d5e17006 100644
--- a/gcc/config/mips/mips.opt
+++ b/gcc/config/mips/mips.opt
@@ -208,6 +208,10 @@ mlong64
Target Report RejectNegative Mask(LONG64)
Use a 64-bit long type
+mmcount-ra-address
+Target Report Var(TARGET_MCOUNT_RA_ADDRESS)
+Pass the address of the ra save location to _mcount in $12
+
mmemcpy
Target Report Mask(MEMCPY)
Don't optimize block moves
diff --git a/gcc/config/mips/predicates.md b/gcc/config/mips/predicates.md
index e1cb4573688..7430dd32b78 100644
--- a/gcc/config/mips/predicates.md
+++ b/gcc/config/mips/predicates.md
@@ -119,6 +119,10 @@
(and (match_code "reg")
(match_test "REGNO (op) == LO_REGNUM")))
+(define_predicate "hilo_operand"
+ (and (match_code "reg")
+ (match_test "MD_REG_P (REGNO (op))")))
+
(define_predicate "fcc_reload_operand"
(and (match_code "reg,subreg")
(match_test "ST_REG_P (true_regnum (op))")))
diff --git a/gcc/config/mips/sdemtk.h b/gcc/config/mips/sdemtk.h
index 27dab06f298..a9bb85e82b6 100644
--- a/gcc/config/mips/sdemtk.h
+++ b/gcc/config/mips/sdemtk.h
@@ -101,7 +101,7 @@ extern void mips_sync_icache (void *beg, unsigned long len);
/* MIPS16 code passes saved $ra in $v1 instead of $at. */ \
fprintf (FILE, "\tmove\t%s,%s\n", \
reg_names[GP_REG_FIRST + (TARGET_MIPS16 ? 3 : 1)], \
- reg_names[GP_REG_FIRST + 31]); \
+ reg_names[RETURN_ADDR_REGNUM]); \
fprintf (FILE, "\tjal\t_mcount\n"); \
mips_pop_asm_switch (&mips_noat); \
/* _mcount treats $2 as the static chain register. */ \
@@ -112,4 +112,4 @@ extern void mips_sync_icache (void *beg, unsigned long len);
/* ...nor does the call sequence preserve $31. */
#undef MIPS_SAVE_REG_FOR_PROFILING_P
-#define MIPS_SAVE_REG_FOR_PROFILING_P(REGNO) ((REGNO) == GP_REG_FIRST + 31)
+#define MIPS_SAVE_REG_FOR_PROFILING_P(REGNO) ((REGNO) == RETURN_ADDR_REGNUM)
diff --git a/gcc/config/mn10300/mn10300-protos.h b/gcc/config/mn10300/mn10300-protos.h
index ae4728ae0cb..47488c9b0ba 100644
--- a/gcc/config/mn10300/mn10300-protos.h
+++ b/gcc/config/mn10300/mn10300-protos.h
@@ -37,12 +37,13 @@ extern int symbolic_operand (rtx, enum machine_mode);
extern int impossible_plus_operand (rtx, enum machine_mode);
extern bool mn10300_wide_const_load_uses_clr (rtx operands[2]);
+
+extern bool mn10300_function_value_regno_p (const unsigned int);
#endif /* RTX_CODE */
#ifdef TREE_CODE
extern struct rtx_def *function_arg (CUMULATIVE_ARGS *,
enum machine_mode, tree, int);
-extern rtx mn10300_function_value (const_tree, const_tree, int);
#endif /* TREE_CODE */
extern void expand_prologue (void);
diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c
index 1a0eb37bbde..8f69dd0d995 100644
--- a/gcc/config/mn10300/mn10300.c
+++ b/gcc/config/mn10300/mn10300.c
@@ -86,6 +86,8 @@ static unsigned int mn10300_case_values_threshold (void);
static void mn10300_encode_section_info (tree, rtx, int);
static void mn10300_asm_trampoline_template (FILE *);
static void mn10300_trampoline_init (rtx, tree, rtx);
+static rtx mn10300_function_value (const_tree, const_tree, bool);
+static rtx mn10300_libcall_value (enum machine_mode, const_rtx);
/* Initialize the GCC target structure. */
#undef TARGET_ASM_ALIGNED_HI_OP
@@ -139,6 +141,11 @@ static void mn10300_trampoline_init (rtx, tree, rtx);
#undef TARGET_TRAMPOLINE_INIT
#define TARGET_TRAMPOLINE_INIT mn10300_trampoline_init
+#undef TARGET_FUNCTION_VALUE
+#define TARGET_FUNCTION_VALUE mn10300_function_value
+#undef TARGET_LIBCALL_VALUE
+#define TARGET_LIBCALL_VALUE mn10300_libcall_value
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Implement TARGET_HANDLE_OPTION. */
@@ -1624,8 +1631,10 @@ mn10300_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode,
we only return the PARALLEL for outgoing values; we do not want
callers relying on this extra copy. */
-rtx
-mn10300_function_value (const_tree valtype, const_tree func, int outgoing)
+static rtx
+mn10300_function_value (const_tree valtype,
+ const_tree fn_decl_or_type ATTRIBUTE_UNUSED,
+ bool outgoing)
{
rtx rv;
enum machine_mode mode = TYPE_MODE (valtype);
@@ -1649,6 +1658,23 @@ mn10300_function_value (const_tree valtype, const_tree func, int outgoing)
return rv;
}
+/* Implements TARGET_LIBCALL_VALUE. */
+
+static rtx
+mn10300_libcall_value (enum machine_mode mode,
+ const_rtx fun ATTRIBUTE_UNUSED)
+{
+ return gen_rtx_REG (mode, FIRST_DATA_REGNUM);
+}
+
+/* Implements FUNCTION_VALUE_REGNO_P. */
+
+bool
+mn10300_function_value_regno_p (const unsigned int regno)
+{
+ return (regno == FIRST_DATA_REGNUM || regno == FIRST_ADDRESS_REGNUM);
+}
+
/* Output a tst insn. */
const char *
output_tst (rtx operand, rtx insn)
diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h
index d459387edfc..c732aa07180 100644
--- a/gcc/config/mn10300/mn10300.h
+++ b/gcc/config/mn10300/mn10300.h
@@ -564,25 +564,7 @@ struct cum_arg {int nbytes; };
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
function_arg (&CUM, MODE, TYPE, NAMED)
-/* Define how to find the value returned by a function.
- VALTYPE is the data type of the value (as a tree).
- If the precise function being called is known, FUNC is its FUNCTION_DECL;
- otherwise, FUNC is 0. */
-
-#define FUNCTION_VALUE(VALTYPE, FUNC) \
- mn10300_function_value (VALTYPE, FUNC, 0)
-#define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC) \
- mn10300_function_value (VALTYPE, FUNC, 1)
-
-/* Define how to find the value returned by a library function
- assuming the value has mode MODE. */
-
-#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, FIRST_DATA_REGNUM)
-
-/* 1 if N is a possible register number for a function value. */
-
-#define FUNCTION_VALUE_REGNO_P(N) \
- ((N) == FIRST_DATA_REGNUM || (N) == FIRST_ADDRESS_REGNUM)
+#define FUNCTION_VALUE_REGNO_P(N) mn10300_function_value_regno_p (N)
#define DEFAULT_PCC_STRUCT_RETURN 0
@@ -618,10 +600,6 @@ struct cum_arg {int nbytes; };
? gen_rtx_MEM (Pmode, arg_pointer_rtx) \
: (rtx) 0)
-/* 1 if X is an rtx for a constant that is a valid address. */
-
-#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
-
/* Maximum number of registers that can appear in a valid memory address. */
#define MAX_REGS_PER_ADDRESS 2
diff --git a/gcc/config/moxie/moxie.h b/gcc/config/moxie/moxie.h
index f1b77eaf0c2..384bce4a986 100644
--- a/gcc/config/moxie/moxie.h
+++ b/gcc/config/moxie/moxie.h
@@ -475,10 +475,6 @@ enum reg_class
an immediate operand on the target machine. */
#define LEGITIMATE_CONSTANT_P(X) 1
-/* A C expression that is 1 if the RTX X is a constant which is a
- valid address. */
-#define CONSTANT_ADDRESS_P(X) CONSTANT_P(X)
-
/* A number, the maximum number of registers that can appear in a
valid memory address. */
#define MAX_REGS_PER_ADDRESS 1
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index 20f64449097..d10a40d55e1 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -7120,17 +7120,6 @@
operands[0] = index;
}
- /* In 64bit mode we must make sure to wipe the upper bits of the register
- just in case the addition overflowed or we had random bits in the
- high part of the register. */
- if (TARGET_64BIT)
- {
- rtx index = gen_reg_rtx (DImode);
-
- emit_insn (gen_extendsidi2 (index, operands[0]));
- operands[0] = gen_rtx_SUBREG (SImode, index, 4);
- }
-
if (!INT_5_BITS (operands[2]))
operands[2] = force_reg (SImode, operands[2]);
@@ -7149,6 +7138,17 @@
emit_jump_insn (gen_cbranchsi4 (test, operands[0], operands[2], operands[4]));
}
+ /* In 64bit mode we must make sure to wipe the upper bits of the register
+ just in case the addition overflowed or we had random bits in the
+ high part of the register. */
+ if (TARGET_64BIT)
+ {
+ rtx index = gen_reg_rtx (DImode);
+
+ emit_insn (gen_extendsidi2 (index, operands[0]));
+ operands[0] = index;
+ }
+
if (TARGET_BIG_SWITCH)
{
if (TARGET_64BIT)
@@ -7209,8 +7209,7 @@
;;; 64-bit code, 32-bit relative branch table.
(define_insn "casesi64p"
[(set (pc) (mem:DI (plus:DI
- (mult:DI (sign_extend:DI
- (match_operand:SI 0 "register_operand" "r"))
+ (mult:DI (match_operand:DI 0 "register_operand" "r")
(const_int 8))
(label_ref (match_operand 1 "" "")))))
(clobber (match_scratch:DI 2 "=&r"))
diff --git a/gcc/config/pdp11/pdp11.h b/gcc/config/pdp11/pdp11.h
index 8997612ba5a..fe8c9e8aed3 100644
--- a/gcc/config/pdp11/pdp11.h
+++ b/gcc/config/pdp11/pdp11.h
@@ -594,10 +594,6 @@ extern int may_call_alloca;
#define MAX_REGS_PER_ADDRESS 1
-/* Recognize any constant value that is a valid address. */
-
-#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
-
/* Nonzero if the constant value X is a legitimate general operand.
It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
diff --git a/gcc/config/picochip/picochip.h b/gcc/config/picochip/picochip.h
index 44559f22333..4d0c96278e0 100644
--- a/gcc/config/picochip/picochip.h
+++ b/gcc/config/picochip/picochip.h
@@ -471,8 +471,6 @@ extern const enum reg_class picochip_regno_reg_class[FIRST_PSEUDO_REGISTER];
/* Addressing Modes */
-#define CONSTANT_ADDRESS_P(X) CONSTANT_P(X)
-
#define MAX_REGS_PER_ADDRESS 1
/* Legitimize reload address tries machine dependent means of
diff --git a/gcc/config/rs6000/40x.md b/gcc/config/rs6000/40x.md
index e11c6539f68..eaf1222eca4 100644
--- a/gcc/config/rs6000/40x.md
+++ b/gcc/config/rs6000/40x.md
@@ -1,5 +1,5 @@
;; Scheduling description for IBM PowerPC 403 and PowerPC 405 processors.
-;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2007, 2009 Free Software Foundation, Inc.
;;
;; This file is part of GCC.
@@ -38,7 +38,7 @@
(define_insn_reservation "ppc403-integer" 1
(and (eq_attr "type" "integer,insert_word,insert_dword,shift,trap,\
- var_shift_rotate,cntlz,exts")
+ var_shift_rotate,cntlz,exts,isel")
(eq_attr "cpu" "ppc403,ppc405"))
"iu_40x")
diff --git a/gcc/config/rs6000/440.md b/gcc/config/rs6000/440.md
index b146222ac50..b329e7897cd 100644
--- a/gcc/config/rs6000/440.md
+++ b/gcc/config/rs6000/440.md
@@ -1,5 +1,5 @@
;; Scheduling description for IBM PowerPC 440 processor.
-;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2007, 2009 Free Software Foundation, Inc.
;;
;; This file is part of GCC.
;;
@@ -55,7 +55,7 @@
(define_insn_reservation "ppc440-integer" 1
(and (eq_attr "type" "integer,insert_word,insert_dword,shift,\
- trap,var_shift_rotate,cntlz,exts")
+ trap,var_shift_rotate,cntlz,exts,isel")
(eq_attr "cpu" "ppc440"))
"ppc440_issue,ppc440_i_pipe|ppc440_j_pipe")
diff --git a/gcc/config/rs6000/476.md b/gcc/config/rs6000/476.md
new file mode 100644
index 00000000000..3f50bafa03c
--- /dev/null
+++ b/gcc/config/rs6000/476.md
@@ -0,0 +1,142 @@
+;; Scheduling description for IBM PowerPC 476 processor.
+;; Copyright (C) 2009
+;; Free Software Foundation, Inc.
+;; Contributed by Peter Bergner (bergner@vnet.ibm.com).
+;;
+;; This file is part of GCC.
+;;
+;; GCC is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+;;
+;; GCC is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with GCC; see the file COPYING3. If not see
+;; <http://www.gnu.org/licenses/>.
+
+;; PPC476 Embedded PowerPC controller
+;; 3 issue (476) / 4 issue (476fp)
+;;
+;; i_pipe - complex integer / compare
+;; lj_pipe - load-store / simple integer arithmetic
+;; b_pipe - branch pipe
+;; f_pipe - floating point arithmetic
+
+(define_automaton "ppc476_core,ppc476_apu")
+
+(define_cpu_unit "ppc476_i_pipe,ppc476_lj_pipe,ppc476_b_pipe" "ppc476_core")
+(define_cpu_unit "ppc476_issue_fp,ppc476_f_pipe" "ppc476_apu")
+(define_cpu_unit "ppc476_issue_0,ppc476_issue_1,ppc476_issue_2" "ppc476_core")
+
+(define_reservation "ppc476_issue" "ppc476_issue_0|ppc476_issue_1|ppc476_issue_2")
+(define_reservation "ppc476_issue2" "ppc476_issue_0+ppc476_issue_1\
+ |ppc476_issue_0+ppc476_issue_2\
+ |ppc476_issue_1+ppc476_issue_2")
+(define_reservation "ppc476_issue3" "ppc476_issue_0+ppc476_issue_1+ppc476_issue_2")
+
+(define_insn_reservation "ppc476-load" 4
+ (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u,\
+ load_l,store_c,sync")
+ (eq_attr "cpu" "ppc476"))
+ "ppc476_issue,\
+ ppc476_lj_pipe")
+
+(define_insn_reservation "ppc476-store" 4
+ (and (eq_attr "type" "store,store_ux,store_u")
+ (eq_attr "cpu" "ppc476"))
+ "ppc476_issue,\
+ ppc476_lj_pipe")
+
+(define_insn_reservation "ppc476-fpload" 4
+ (and (eq_attr "type" "fpload,fpload_ux,fpload_u")
+ (eq_attr "cpu" "ppc476"))
+ "ppc476_issue,\
+ ppc476_lj_pipe")
+
+(define_insn_reservation "ppc476-fpstore" 4
+ (and (eq_attr "type" "fpstore,fpstore_ux,fpstore_u")
+ (eq_attr "cpu" "ppc476"))
+ "ppc476_issue,\
+ ppc476_lj_pipe")
+
+(define_insn_reservation "ppc476-simple-integer" 1
+ (and (eq_attr "type" "integer,insert_word,var_shift_rotate,exts,shift")
+ (eq_attr "cpu" "ppc476"))
+ "ppc476_issue,\
+ ppc476_i_pipe|ppc476_lj_pipe")
+
+(define_insn_reservation "ppc476-complex-integer" 1
+ (and (eq_attr "type" "cmp,cr_logical,delayed_cr,cntlz,isel,isync,sync,trap")
+ (eq_attr "cpu" "ppc476"))
+ "ppc476_issue,\
+ ppc476_i_pipe")
+
+(define_insn_reservation "ppc476-compare" 4
+ (and (eq_attr "type" "compare,delayed_compare,fast_compare,mfcr,mfcrf,\
+ mtcr,mfjmpr,mtjmpr,var_delayed_compare")
+ (eq_attr "cpu" "ppc476"))
+ "ppc476_issue,\
+ ppc476_i_pipe")
+
+(define_insn_reservation "ppc476-imul" 4
+ (and (eq_attr "type" "imul,imul_compare,imul2,imul3")
+ (eq_attr "cpu" "ppc476"))
+ "ppc476_issue,\
+ ppc476_i_pipe")
+
+(define_insn_reservation "ppc476-idiv" 11
+ (and (eq_attr "type" "idiv")
+ (eq_attr "cpu" "ppc476"))
+ "ppc476_issue,\
+ ppc476_i_pipe*11")
+
+(define_insn_reservation "ppc476-branch" 1
+ (and (eq_attr "type" "branch,jmpreg")
+ (eq_attr "cpu" "ppc476"))
+ "ppc476_issue,\
+ ppc476_b_pipe")
+
+(define_insn_reservation "ppc476-two" 2
+ (and (eq_attr "type" "two")
+ (eq_attr "cpu" "ppc476"))
+ "ppc476_issue2,\
+ ppc476_i_pipe|ppc476_lj_pipe,\
+ ppc476_i_pipe|ppc476_lj_pipe")
+
+(define_insn_reservation "ppc476-three" 3
+ (and (eq_attr "type" "three")
+ (eq_attr "cpu" "ppc476"))
+ "ppc476_issue3,\
+ ppc476_i_pipe|ppc476_lj_pipe,\
+ ppc476_i_pipe|ppc476_lj_pipe,\
+ ppc476_i_pipe|ppc476_lj_pipe")
+
+(define_insn_reservation "ppc476-fpcompare" 6
+ (and (eq_attr "type" "fpcompare")
+ (eq_attr "cpu" "ppc476"))
+ "ppc476_issue+ppc476_issue_fp,\
+ ppc476_f_pipe+ppc476_i_pipe")
+
+(define_insn_reservation "ppc476-fp" 6
+ (and (eq_attr "type" "fp,dmul")
+ (eq_attr "cpu" "ppc476"))
+ "ppc476_issue_fp,\
+ ppc476_f_pipe")
+
+(define_insn_reservation "ppc476-sdiv" 19
+ (and (eq_attr "type" "sdiv")
+ (eq_attr "cpu" "ppc476"))
+ "ppc476_issue_fp,
+ ppc476_f_pipe*19")
+
+(define_insn_reservation "ppc476-ddiv" 33
+ (and (eq_attr "type" "ddiv")
+ (eq_attr "cpu" "ppc476"))
+ "ppc476_issue_fp,\
+ ppc476_f_pipe*33")
+
diff --git a/gcc/config/rs6000/603.md b/gcc/config/rs6000/603.md
index c5fea314819..a042729a1da 100644
--- a/gcc/config/rs6000/603.md
+++ b/gcc/config/rs6000/603.md
@@ -1,5 +1,5 @@
;; Scheduling description for PowerPC 603 processor.
-;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2007, 2009 Free Software Foundation, Inc.
;;
;; This file is part of GCC.
@@ -59,7 +59,7 @@
(define_insn_reservation "ppc603-integer" 1
(and (eq_attr "type" "integer,insert_word,insert_dword,shift,trap,\
- var_shift_rotate,cntlz,exts")
+ var_shift_rotate,cntlz,exts,isel")
(eq_attr "cpu" "ppc603"))
"iu_603")
diff --git a/gcc/config/rs6000/6xx.md b/gcc/config/rs6000/6xx.md
index 88c15ae39ec..b0de9731525 100644
--- a/gcc/config/rs6000/6xx.md
+++ b/gcc/config/rs6000/6xx.md
@@ -1,6 +1,6 @@
;; Scheduling description for PowerPC 604, PowerPC 604e, PowerPC 620,
;; and PowerPC 630 processors.
-;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2007, 2009 Free Software Foundation, Inc.
;;
;; This file is part of GCC.
@@ -74,7 +74,7 @@
(define_insn_reservation "ppc604-integer" 1
(and (eq_attr "type" "integer,insert_word,insert_dword,shift,trap,\
- var_shift_rotate,cntlz,exts")
+ var_shift_rotate,cntlz,exts,isel")
(eq_attr "cpu" "ppc604,ppc604e,ppc620,ppc630"))
"iu1_6xx|iu2_6xx")
diff --git a/gcc/config/rs6000/7450.md b/gcc/config/rs6000/7450.md
index 6f2775744d4..ccaa3b20da3 100644
--- a/gcc/config/rs6000/7450.md
+++ b/gcc/config/rs6000/7450.md
@@ -1,5 +1,5 @@
;; Scheduling description for Motorola PowerPC 7450 processor.
-;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2007, 2009 Free Software Foundation, Inc.
;;
;; This file is part of GCC.
@@ -75,7 +75,7 @@
(define_insn_reservation "ppc7450-integer" 1
(and (eq_attr "type" "integer,insert_word,insert_dword,shift,\
- trap,var_shift_rotate,cntlz,exts")
+ trap,var_shift_rotate,cntlz,exts,isel")
(eq_attr "cpu" "ppc7450"))
"ppc7450_du,iu1_7450|iu2_7450|iu3_7450")
diff --git a/gcc/config/rs6000/7xx.md b/gcc/config/rs6000/7xx.md
index 0129048c07c..edbde75c22a 100644
--- a/gcc/config/rs6000/7xx.md
+++ b/gcc/config/rs6000/7xx.md
@@ -1,5 +1,5 @@
;; Scheduling description for Motorola PowerPC 750 and PowerPC 7400 processors.
-;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2007, 2009 Free Software Foundation, Inc.
;;
;; This file is part of GCC.
@@ -65,7 +65,7 @@
(define_insn_reservation "ppc750-integer" 1
(and (eq_attr "type" "integer,insert_word,insert_dword,shift,\
- trap,var_shift_rotate,cntlz,exts")
+ trap,var_shift_rotate,cntlz,exts,isel")
(eq_attr "cpu" "ppc750,ppc7400"))
"ppc750_du,iu1_7xx|iu2_7xx")
diff --git a/gcc/config/rs6000/8540.md b/gcc/config/rs6000/8540.md
index 2d44b3af94b..4096dff432c 100644
--- a/gcc/config/rs6000/8540.md
+++ b/gcc/config/rs6000/8540.md
@@ -1,5 +1,5 @@
;; Pipeline description for Motorola PowerPC 8540 processor.
-;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2007, 2009 Free Software Foundation, Inc.
;;
;; This file is part of GCC.
@@ -86,7 +86,7 @@
(define_insn_reservation "ppc8540_su" 1
(and (eq_attr "type" "integer,insert_word,insert_dword,cmp,compare,\
delayed_compare,var_delayed_compare,fast_compare,\
- shift,trap,var_shift_rotate,cntlz,exts")
+ shift,trap,var_shift_rotate,cntlz,exts,isel")
(eq_attr "cpu" "ppc8540"))
"ppc8540_decode,ppc8540_issue+ppc8540_su_stage0+ppc8540_retire")
diff --git a/gcc/config/rs6000/a2.md b/gcc/config/rs6000/a2.md
new file mode 100644
index 00000000000..851d8949ff7
--- /dev/null
+++ b/gcc/config/rs6000/a2.md
@@ -0,0 +1,134 @@
+;; Scheduling description for PowerPC A2 processors.
+;; Copyright (C) 2009 Free Software Foundation, Inc.
+;; Contributed by Ben Elliston (bje@au.ibm.com)
+
+;; This file is part of GCC.
+
+;; GCC is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published
+;; by the Free Software Foundation; either version 3, or (at your
+;; option) any later version.
+
+;; GCC is distributed in the hope that it will be useful, but WITHOUT
+;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+;; License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GCC; see the file COPYING3. If not see
+;; <http://www.gnu.org/licenses/>.
+
+(define_automaton "ppca2")
+
+;; CPU units
+
+;; The multiplier pipeline.
+(define_cpu_unit "mult" "ppca2")
+
+;; The auxillary processor unit (FP/vector unit).
+(define_cpu_unit "axu" "ppca2")
+
+;; D.4.6
+;; Some peculiarities for certain SPRs
+
+(define_insn_reservation "ppca2-mfcr" 1
+ (and (eq_attr "type" "mfcr")
+ (eq_attr "cpu" "ppca2"))
+ "nothing")
+
+(define_insn_reservation "ppca2-mfjmpr" 5
+ (and (eq_attr "type" "mfjmpr")
+ (eq_attr "cpu" "ppca2"))
+ "nothing")
+
+(define_insn_reservation "ppca2-mtjmpr" 5
+ (and (eq_attr "type" "mtjmpr")
+ (eq_attr "cpu" "ppca2"))
+ "nothing")
+
+;; D.4.8
+(define_insn_reservation "ppca2-imul" 1
+ (and (eq_attr "type" "imul,imul2,imul3,imul_compare")
+ (eq_attr "cpu" "ppca2"))
+ "nothing")
+
+;; FIXME: latency and multiplier reservation for 64-bit multiply?
+(define_insn_reservation "ppca2-lmul" 6
+ (and (eq_attr "type" "lmul,lmul_compare")
+ (eq_attr "cpu" "ppca2"))
+ "mult*3")
+
+;; D.4.9
+(define_insn_reservation "ppca2-idiv" 32
+ (and (eq_attr "type" "idiv")
+ (eq_attr "cpu" "ppca2"))
+ "mult*32")
+
+(define_insn_reservation "ppca2-ldiv" 65
+ (and (eq_attr "type" "ldiv")
+ (eq_attr "cpu" "ppca2"))
+ "mult*65")
+
+;; D.4.13
+(define_insn_reservation "ppca2-load" 5
+ (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u")
+ (eq_attr "cpu" "ppca2"))
+ "nothing")
+
+;; D.8.1
+(define_insn_reservation "ppca2-fp" 6
+ (and (eq_attr "type" "fp") ;; Ignore fpsimple insn types (SPE only).
+ (eq_attr "cpu" "ppca2"))
+ "axu")
+
+;; D.8.4
+(define_insn_reservation "ppca2-fp-load" 6
+ (and (eq_attr "type" "fpload,fpload_u,fpload_ux")
+ (eq_attr "cpu" "ppca2"))
+ "axu")
+
+;; D.8.5
+(define_insn_reservation "ppca2-fp-store" 2
+ (and (eq_attr "type" "fpstore,fpstore_u,fpstore_ux")
+ (eq_attr "cpu" "ppca2"))
+ "axu")
+
+;; D.8.6
+(define_insn_reservation "ppca2-fpcompare" 5
+ (and (eq_attr "type" "fpcompare")
+ (eq_attr "cpu" "ppca2"))
+ "axu")
+
+;; D.8.7
+;;
+;; Instructions from the same thread succeeding the floating-point
+;; divide cannot be executed until the floating-point divide has
+;; completed. Since there is nothing else we can do, this thread will
+;; just have to stall.
+
+(define_insn_reservation "ppca2-ddiv" 72
+ (and (eq_attr "type" "ddiv")
+ (eq_attr "cpu" "ppca2"))
+ "axu")
+
+(define_insn_reservation "ppca2-sdiv" 59
+ (and (eq_attr "type" "sdiv")
+ (eq_attr "cpu" "ppca2"))
+ "axu")
+
+;; D.8.8
+;;
+;; Instructions from the same thread succeeding the floating-point
+;; divide cannot be executed until the floating-point divide has
+;; completed. Since there is nothing else we can do, this thread will
+;; just have to stall.
+
+(define_insn_reservation "ppca2-dsqrt" 69
+ (and (eq_attr "type" "dsqrt")
+ (eq_attr "cpu" "ppca2"))
+ "axu")
+
+(define_insn_reservation "ppca2-ssqrt" 65
+ (and (eq_attr "type" "ssqrt")
+ (eq_attr "cpu" "ppca2"))
+ "axu")
diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md
index 53b1054d200..6fbb7cdcdac 100644
--- a/gcc/config/rs6000/altivec.md
+++ b/gcc/config/rs6000/altivec.md
@@ -1,5 +1,5 @@
;; AltiVec patterns.
-;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
+;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
;; Free Software Foundation, Inc.
;; Contributed by Aldy Hernandez (aldy@quesejoda.com)
diff --git a/gcc/config/rs6000/cell.md b/gcc/config/rs6000/cell.md
index 3fffd2740f9..dac9da94320 100644
--- a/gcc/config/rs6000/cell.md
+++ b/gcc/config/rs6000/cell.md
@@ -1,5 +1,5 @@
;; Scheduling description for cell processor.
-;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
;; Free Software Foundation, Inc.
;; Contributed by Sony Computer Entertainment, Inc.,
@@ -157,7 +157,7 @@
;; Integer latency is 2 cycles
(define_insn_reservation "cell-integer" 2
(and (eq_attr "type" "integer,insert_dword,shift,trap,\
- var_shift_rotate,cntlz,exts")
+ var_shift_rotate,cntlz,exts,isel")
(eq_attr "cpu" "cell"))
"slot01,fxu_cell")
diff --git a/gcc/config/rs6000/e300c2c3.md b/gcc/config/rs6000/e300c2c3.md
index 31bf14ce314..3462a209f74 100644
--- a/gcc/config/rs6000/e300c2c3.md
+++ b/gcc/config/rs6000/e300c2c3.md
@@ -1,5 +1,5 @@
;; Pipeline description for Motorola PowerPC e300c3 core.
-;; Copyright (C) 2008 Free Software Foundation, Inc.
+;; Copyright (C) 2008, 2009 Free Software Foundation, Inc.
;; Contributed by Edmar Wienskoski (edmar@freescale.com)
;;
;; This file is part of GCC.
@@ -90,7 +90,7 @@
;; Other one cycle IU insns
(define_insn_reservation "ppce300c3_iu" 1
- (and (eq_attr "type" "integer,insert_word")
+ (and (eq_attr "type" "integer,insert_word,isel")
(ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3")))
"ppce300c3_decode,ppce300c3_issue+ppce300c3_iu_stage0+ppce300c3_retire")
diff --git a/gcc/config/rs6000/e500mc.md b/gcc/config/rs6000/e500mc.md
index 86434f95fe1..99a4b80ecf6 100644
--- a/gcc/config/rs6000/e500mc.md
+++ b/gcc/config/rs6000/e500mc.md
@@ -72,7 +72,7 @@
(define_insn_reservation "e500mc_su" 1
(and (eq_attr "type" "integer,insert_word,insert_dword,cmp,compare,\
delayed_compare,var_delayed_compare,fast_compare,\
- shift,trap,var_shift_rotate,cntlz,exts")
+ shift,trap,var_shift_rotate,cntlz,exts,isel")
(eq_attr "cpu" "ppce500mc"))
"e500mc_decode,e500mc_issue+e500mc_su_stage0+e500mc_retire")
diff --git a/gcc/config/rs6000/mpc.md b/gcc/config/rs6000/mpc.md
index a839f936648..415c6887232 100644
--- a/gcc/config/rs6000/mpc.md
+++ b/gcc/config/rs6000/mpc.md
@@ -1,5 +1,5 @@
;; Scheduling description for Motorola PowerPC processor cores.
-;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2007, 2009 Free Software Foundation, Inc.
;;
;; This file is part of GCC.
;;
@@ -43,7 +43,7 @@
(define_insn_reservation "mpccore-integer" 1
(and (eq_attr "type" "integer,insert_word,insert_dword,shift,trap,\
- var_shift_rotate,cntlz,exts")
+ var_shift_rotate,cntlz,exts,isel")
(eq_attr "cpu" "mpccore"))
"iu_mpc")
diff --git a/gcc/config/rs6000/option-defaults.h b/gcc/config/rs6000/option-defaults.h
index 682add7605d..7e117d731da 100644
--- a/gcc/config/rs6000/option-defaults.h
+++ b/gcc/config/rs6000/option-defaults.h
@@ -50,15 +50,15 @@
/* Support for a compile-time default CPU, et cetera. The rules are:
--with-cpu is ignored if -mcpu is specified; likewise --with-cpu-32
and --with-cpu-64.
- --with-tune is ignored if -mtune is specified; likewise --with-tune-32
- and --with-tune-64.
+ --with-tune is ignored if -mtune or -mcpu is specified; likewise
+ --with-tune-32 and --with-tune-64.
--with-float is ignored if -mhard-float or -msoft-float are
- specified. */
+ specified. */
#define OPTION_DEFAULT_SPECS \
+ {"tune", "%{!mtune=*:%{!mcpu=*:-mtune=%(VALUE)}}" }, \
+ {"tune_32", "%{" OPT_ARCH32 ":%{!mtune=*:%{!mcpu=*:-mtune=%(VALUE)}}}" }, \
+ {"tune_64", "%{" OPT_ARCH64 ":%{!mtune=*:%{!mcpu=*:-mtune=%(VALUE)}}}" }, \
{"cpu", "%{!mcpu=*:-mcpu=%(VALUE)}" }, \
{"cpu_32", "%{" OPT_ARCH32 ":%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
{"cpu_64", "%{" OPT_ARCH64 ":%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
- {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \
- {"tune_32", "%{" OPT_ARCH32 ":%{!mtune=*:-mtune=%(VALUE)}}" }, \
- {"tune_64", "%{" OPT_ARCH64 ":%{!mtune=*:-mtune=%(VALUE)}}" }, \
{"float", "%{!msoft-float:%{!mhard-float:-m%(VALUE)-float}}" }
diff --git a/gcc/config/rs6000/power4.md b/gcc/config/rs6000/power4.md
index 0214c98b139..60dbffd58c9 100644
--- a/gcc/config/rs6000/power4.md
+++ b/gcc/config/rs6000/power4.md
@@ -1,5 +1,5 @@
;; Scheduling description for IBM Power4 and PowerPC 970 processors.
-;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2007, 2009 Free Software Foundation, Inc.
;;
;; This file is part of GCC.
;;
@@ -188,7 +188,7 @@
; Integer latency is 2 cycles
(define_insn_reservation "power4-integer" 2
(and (eq_attr "type" "integer,insert_dword,shift,trap,\
- var_shift_rotate,cntlz,exts")
+ var_shift_rotate,cntlz,exts,isel")
(eq_attr "cpu" "power4"))
"iq_power4")
diff --git a/gcc/config/rs6000/power5.md b/gcc/config/rs6000/power5.md
index 83ffabcfb3a..b6db0931219 100644
--- a/gcc/config/rs6000/power5.md
+++ b/gcc/config/rs6000/power5.md
@@ -1,5 +1,5 @@
;; Scheduling description for IBM POWER5 processor.
-;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2007, 2009 Free Software Foundation, Inc.
;;
;; This file is part of GCC.
;;
@@ -142,7 +142,7 @@
; Integer latency is 2 cycles
(define_insn_reservation "power5-integer" 2
(and (eq_attr "type" "integer,insert_dword,shift,trap,\
- var_shift_rotate,cntlz,exts")
+ var_shift_rotate,cntlz,exts,isel")
(eq_attr "cpu" "power5"))
"iq_power5")
diff --git a/gcc/config/rs6000/power6.md b/gcc/config/rs6000/power6.md
index ba6524cfa65..8d54c812963 100644
--- a/gcc/config/rs6000/power6.md
+++ b/gcc/config/rs6000/power6.md
@@ -1,5 +1,5 @@
;; Scheduling description for IBM POWER6 processor.
-;; Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
;; Contributed by Peter Steinmetz (steinmtz@us.ibm.com)
;;
;; This file is part of GCC.
@@ -201,6 +201,11 @@
(eq_attr "cpu" "power6"))
"FXU_power6")
+(define_insn_reservation "power6-isel" 1
+ (and (eq_attr "type" "isel")
+ (eq_attr "cpu" "power6"))
+ "FXU_power6")
+
(define_insn_reservation "power6-exts" 1
(and (eq_attr "type" "exts")
(eq_attr "cpu" "power6"))
diff --git a/gcc/config/rs6000/power7.md b/gcc/config/rs6000/power7.md
index 3b6a95e284e..148a7a52a8a 100644
--- a/gcc/config/rs6000/power7.md
+++ b/gcc/config/rs6000/power7.md
@@ -150,7 +150,7 @@
; FX Unit
(define_insn_reservation "power7-integer" 1
(and (eq_attr "type" "integer,insert_word,insert_dword,shift,trap,\
- var_shift_rotate,exts")
+ var_shift_rotate,exts,isel")
(eq_attr "cpu" "power7"))
"DU_power7,FXU_power7")
diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md
index d03cce6f8a2..2d8a2a8d5d1 100644
--- a/gcc/config/rs6000/predicates.md
+++ b/gcc/config/rs6000/predicates.md
@@ -1,5 +1,5 @@
;; Predicate definitions for POWER and PowerPC.
-;; Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
;;
;; This file is part of GCC.
;;
diff --git a/gcc/config/rs6000/rios1.md b/gcc/config/rs6000/rios1.md
index be2262d1281..9ad9ce3e161 100644
--- a/gcc/config/rs6000/rios1.md
+++ b/gcc/config/rs6000/rios1.md
@@ -1,5 +1,5 @@
;; Scheduling description for IBM POWER processor.
-;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2007, 2009 Free Software Foundation, Inc.
;;
;; This file is part of GCC.
@@ -52,7 +52,7 @@
(define_insn_reservation "rios1-integer" 1
(and (eq_attr "type" "integer,insert_word,insert_dword,shift,\
- trap,var_shift_rotate,cntlz,exts")
+ trap,var_shift_rotate,cntlz,exts,isel")
(eq_attr "cpu" "rios1,ppc601"))
"iu_rios1")
diff --git a/gcc/config/rs6000/rios2.md b/gcc/config/rs6000/rios2.md
index 24fbc15b9ad..96633af2f8e 100644
--- a/gcc/config/rs6000/rios2.md
+++ b/gcc/config/rs6000/rios2.md
@@ -1,5 +1,5 @@
;; Scheduling description for IBM Power2 processor.
-;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2007, 2009 Free Software Foundation, Inc.
;;
;; This file is part of GCC.
@@ -40,7 +40,7 @@
(define_insn_reservation "rios2-integer" 1
(and (eq_attr "type" "integer,insert_word,insert_dword,shift,trap,\
- var_shift_rotate,cntlz,exts")
+ var_shift_rotate,cntlz,exts,isel")
(eq_attr "cpu" "rios2"))
"iu1_rios2|iu2_rios2")
diff --git a/gcc/config/rs6000/rs6000-builtin.def b/gcc/config/rs6000/rs6000-builtin.def
new file mode 100644
index 00000000000..f5ad34882d4
--- /dev/null
+++ b/gcc/config/rs6000/rs6000-builtin.def
@@ -0,0 +1,990 @@
+/* Builtin functions for rs6000/powerpc.
+ Copyright (C) 2009
+ Free Software Foundation, Inc.
+ Contributed by Michael Meissner (meissner@linux.vnet.ibm.com)
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+
+ GCC is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ License for more details.
+
+ 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/>. */
+
+/* Before including this file, two macros must be defined:
+ RS6000_BUILTIN -- 2 arguments, the enum name, and classification
+ RS6000_BUILTIN_EQUATE -- 2 arguments, enum name and value */
+
+/* AltiVec builtins. */
+RS6000_BUILTIN(ALTIVEC_BUILTIN_ST_INTERNAL_4si, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_LD_INTERNAL_4si, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_ST_INTERNAL_8hi, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_LD_INTERNAL_8hi, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_ST_INTERNAL_16qi, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_LD_INTERNAL_16qi, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_ST_INTERNAL_4sf, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_LD_INTERNAL_4sf, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VADDUBM, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VADDUHM, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VADDUWM, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VADDFP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VADDCUW, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VADDUBS, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VADDSBS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VADDUHS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VADDSHS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VADDUWS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VADDSWS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VAND, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VANDC, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VAVGUB, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VAVGSB, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VAVGUH, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VAVGSH, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VAVGUW, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VAVGSW, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCFUX, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCFSX, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCTSXS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCTUXS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPBFP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPEQUB, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPEQUH, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPEQUW, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPEQFP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPGEFP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPGTUB, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPGTSB, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPGTUH, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPGTSH, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPGTUW, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPGTSW, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPGTFP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEXPTEFP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VLOGEFP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMADDFP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMAXUB, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMAXSB, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMAXUH, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMAXSH, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMAXUW, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMAXSW, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMAXFP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMHADDSHS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMHRADDSHS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMLADDUHM, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMRGHB, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMRGHH, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMRGHW, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMRGLB, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMRGLH, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMRGLW, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMSUMUBM, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMSUMMBM, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMSUMUHM, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMSUMSHM, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMSUMUHS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMSUMSHS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMINUB, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMINSB, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMINUH, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMINSH, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMINUW, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMINSW, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMINFP, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMULEUB, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMULEUB_UNS, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMULESB, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMULEUH, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMULEUH_UNS, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMULESH, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMULOUB, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMULOUB_UNS, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMULOSB, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMULOUH, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMULOUH_UNS, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VMULOSH, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VNMSUBFP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VNOR, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VOR, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSEL_2DF, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSEL_2DI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSEL_4SI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSEL_4SF, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSEL_8HI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSEL_16QI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSEL_2DI_UNS, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSEL_4SI_UNS, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSEL_8HI_UNS, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSEL_16QI_UNS, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VPERM_2DF, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VPERM_2DI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VPERM_4SI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VPERM_4SF, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VPERM_8HI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VPERM_16QI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VPERM_2DI_UNS, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VPERM_4SI_UNS, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VPERM_8HI_UNS, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VPERM_16QI_UNS, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VPKUHUM, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VPKUWUM, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VPKPX, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VPKUHSS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VPKSHSS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VPKUWSS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VPKSWSS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VPKUHUS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VPKSHUS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VPKUWUS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VPKSWUS, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VREFP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VRFIM, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VRFIN, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VRFIP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VRFIZ, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VRLB, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VRLH, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VRLW, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VRSQRTEFP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSLB, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSLH, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSLW, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSL, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSLO, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSPLTB, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSPLTH, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSPLTW, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSPLTISB, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSPLTISH, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSPLTISW, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSRB, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSRH, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSRW, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSRAB, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSRAH, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSRAW, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSR, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSRO, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSUBUBM, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSUBUHM, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSUBUWM, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSUBFP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSUBCUW, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSUBUBS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSUBSBS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSUBUHS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSUBSHS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSUBUWS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSUBSWS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSUM4UBS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSUM4SBS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSUM4SHS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSUM2SWS, RS6000_BTC_SAT)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSUMSWS, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VXOR, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSLDOI_16QI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSLDOI_8HI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSLDOI_4SI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VSLDOI_4SF, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VUPKHSB, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VUPKHPX, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VUPKHSH, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VUPKLSB, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VUPKLPX, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VUPKLSH, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_MTVSCR, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_MFVSCR, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_DSSALL, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_DSS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_LVSL, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_LVSR, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_DSTT, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_DSTST, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_DSTSTT, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_DST, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_LVEBX, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_LVEHX, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_LVEWX, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_LVXL, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_LVX, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_STVX, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_LVLX, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_LVLXL, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_LVRX, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_LVRXL, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_STVEBX, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_STVEHX, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_STVEWX, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_STVXL, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_STVLX, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_STVLXL, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_STVRX, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_STVRXL, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPBFP_P, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPEQFP_P, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPEQUB_P, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPEQUH_P, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPEQUW_P, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPGEFP_P, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPGTFP_P, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPGTSB_P, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPGTSH_P, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPGTSW_P, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPGTUB_P, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPGTUH_P, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPGTUW_P, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_ABSS_V4SI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_ABSS_V8HI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_ABSS_V16QI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_ABS_V4SI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_ABS_V4SF, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_ABS_V8HI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_ABS_V16QI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_MASK_FOR_LOAD, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_MASK_FOR_STORE, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_INIT_V4SI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_INIT_V8HI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_INIT_V16QI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_INIT_V4SF, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SET_V4SI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SET_V8HI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SET_V16QI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SET_V4SF, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_EXT_V4SI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_EXT_V8HI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_EXT_V16QI, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_EXT_V4SF, RS6000_BTC_CONST)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_COPYSIGN_V4SF, RS6000_BTC_CONST)
+
+/* Altivec overloaded builtins. */
+/* For now, don't set the classification for overloaded functions.
+ The function should be converted to the type specific instruction
+ before we get to the point about classifying the builtin type. */
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPEQ_P, RS6000_BTC_MISC)
+RS6000_BUILTIN_EQUATE(ALTIVEC_BUILTIN_OVERLOADED_FIRST,
+ ALTIVEC_BUILTIN_VCMPEQ_P)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPGT_P, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VCMPGE_P, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_ABS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_ABSS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_ADD, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_ADDC, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_ADDS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_AND, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_ANDC, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_AVG, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_EXTRACT, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_CEIL, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_CMPB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_CMPEQ, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_CMPEQUB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_CMPEQUH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_CMPEQUW, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_CMPGE, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_CMPGT, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_CMPLE, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_CMPLT, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_COPYSIGN, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_CTF, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_CTS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_CTU, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_DST, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_DSTST, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_DSTSTT, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_DSTT, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_EXPTE, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_FLOOR, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_LD, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_LDE, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_LDL, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_LOGE, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_LVEBX, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_LVEHX, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_LVEWX, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_LVLX, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_LVLXL, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_LVRX, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_LVRXL, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_LVSL, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_LVSR, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_MADD, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_MADDS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_MAX, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_MERGEH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_MERGEL, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_MIN, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_MLADD, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_MPERM, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_MRADDS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_MRGHB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_MRGHH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_MRGHW, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_MRGLB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_MRGLH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_MRGLW, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_MSUM, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_MSUMS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_MTVSCR, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_MULE, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_MULO, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_NEARBYINT, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_NMSUB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_NOR, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_OR, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_PACK, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_PACKPX, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_PACKS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_PACKSU, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_PERM, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_RE, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_RL, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_RINT, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_ROUND, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_RSQRTE, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SEL, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SL, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SLD, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SLL, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SLO, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SPLAT, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SPLAT_S16, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SPLAT_S32, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SPLAT_S8, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SPLAT_U16, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SPLAT_U32, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SPLAT_U8, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SPLTB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SPLTH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SPLTW, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SQRT, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SR, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SRA, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SRL, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SRO, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_ST, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_STE, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_STL, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_STVEBX, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_STVEHX, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_STVEWX, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_STVLX, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_STVLXL, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_STVRX, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_STVRXL, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SUB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SUBC, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SUBS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SUM2S, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SUM4S, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SUMS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_TRUNC, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_UNPACKH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_UNPACKL, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VADDFP, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VADDSBS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VADDSHS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VADDSWS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VADDUBM, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VADDUBS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VADDUHM, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VADDUHS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VADDUWM, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VADDUWS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VAVGSB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VAVGSH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VAVGSW, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VAVGUB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VAVGUH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VAVGUW, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VCFSX, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VCFUX, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VCMPEQFP, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VCMPEQUB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VCMPEQUH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VCMPEQUW, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VCMPGTFP, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VCMPGTSB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VCMPGTSH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VCMPGTSW, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VCMPGTUB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VCMPGTUH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VCMPGTUW, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMAXFP, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMAXSB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMAXSH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMAXSW, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMAXUB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMAXUH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMAXUW, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMINFP, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMINSB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMINSH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMINSW, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMINUB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMINUH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMINUW, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMRGHB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMRGHH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMRGHW, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMRGLB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMRGLH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMRGLW, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMSUMMBM, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMSUMSHM, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMSUMSHS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMSUMUBM, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMSUMUHM, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMSUMUHS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMULESB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMULESH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMULEUB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMULEUH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMULOSB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMULOSH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMULOUB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VMULOUH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VPKSHSS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VPKSHUS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VPKSWSS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VPKSWUS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VPKUHUM, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VPKUHUS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VPKUWUM, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VPKUWUS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VRLB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VRLH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VRLW, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSLB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSLH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSLW, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSPLTB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSPLTH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSPLTW, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSRAB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSRAH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSRAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSRB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSRH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSRW, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSUBFP, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSUBSBS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSUBSHS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSUBSWS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSUBUBM, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSUBUBS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSUBUHM, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSUBUHS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSUBUWM, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSUBUWS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSUM4SBS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSUM4SHS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VSUM4UBS, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VUPKHPX, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VUPKHSB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VUPKHSH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VUPKLPX, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VUPKLSB, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_VUPKLSH, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_XOR, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_STEP, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_PROMOTE, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_INSERT, RS6000_BTC_MISC)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_VEC_SPLATS, RS6000_BTC_MISC)
+RS6000_BUILTIN_EQUATE(ALTIVEC_BUILTIN_OVERLOADED_LAST,
+ ALTIVEC_BUILTIN_VEC_SPLATS)
+
+/* SPE builtins. */
+RS6000_BUILTIN(SPE_BUILTIN_EVADDW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVAND, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVANDC, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVDIVWS, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVDIVWU, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVEQV, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVFSADD, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVFSDIV, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVFSMUL, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVFSSUB, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVLDDX, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVLDHX, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVLDWX, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVLHHESPLATX, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVLHHOSSPLATX, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVLHHOUSPLATX, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVLWHEX, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVLWHOSX, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVLWHOUX, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVLWHSPLATX, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVLWWSPLATX, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMERGEHI, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMERGEHILO, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMERGELO, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMERGELOHI, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHEGSMFAA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHEGSMFAN, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHEGSMIAA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHEGSMIAN, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHEGUMIAA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHEGUMIAN, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHESMF, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHESMFA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHESMFAAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHESMFANW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHESMI, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHESMIA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHESMIAAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHESMIANW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHESSF, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHESSFA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHESSFAAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHESSFANW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHESSIAAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHESSIANW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHEUMI, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHEUMIA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHEUMIAAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHEUMIANW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHEUSIAAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHEUSIANW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOGSMFAA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOGSMFAN, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOGSMIAA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOGSMIAN, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOGUMIAA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOGUMIAN, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOSMF, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOSMFA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOSMFAAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOSMFANW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOSMI, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOSMIA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOSMIAAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOSMIANW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOSSF, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOSSFA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOSSFAAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOSSFANW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOSSIAAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOSSIANW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOUMI, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOUMIA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOUMIAAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOUMIANW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOUSIAAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMHOUSIANW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHSMF, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHSMFA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHSMI, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHSMIA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHSSF, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHSSFA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHUMI, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHUMIA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWLSMIAAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWLSMIANW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWLSSIAAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWLSSIANW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWLUMI, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWLUMIA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWLUMIAAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWLUMIANW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWLUSIAAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWLUSIANW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWSMF, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWSMFA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWSMFAA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWSMFAN, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWSMI, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWSMIA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWSMIAA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWSMIAN, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHSSFAA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWSSF, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWSSFA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWSSFAA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWSSFAN, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWUMI, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWUMIA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWUMIAA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWUMIAN, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVNAND, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVNOR, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVOR, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVORC, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVRLW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSLW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSRWS, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSRWU, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSTDDX, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSTDHX, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSTDWX, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSTWHEX, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSTWHOX, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSTWWEX, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSTWWOX, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSUBFW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVXOR, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVABS, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVADDSMIAAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVADDSSIAAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVADDUMIAAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVADDUSIAAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVCNTLSW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVCNTLZW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVEXTSB, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVEXTSH, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVFSABS, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVFSCFSF, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVFSCFSI, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVFSCFUF, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVFSCFUI, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVFSCTSF, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVFSCTSI, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVFSCTSIZ, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVFSCTUF, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVFSCTUI, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVFSCTUIZ, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVFSNABS, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVFSNEG, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMRA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVNEG, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVRNDW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSUBFSMIAAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSUBFSSIAAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSUBFUMIAAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSUBFUSIAAW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVADDIW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVLDD, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVLDH, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVLDW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVLHHESPLAT, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVLHHOSSPLAT, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVLHHOUSPLAT, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVLWHE, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVLWHOS, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVLWHOU, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVLWHSPLAT, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVLWWSPLAT, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVRLWI, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSLWI, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSRWIS, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSRWIU, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSTDD, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSTDH, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSTDW, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSTWHE, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSTWHO, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSTWWE, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSTWWO, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSUBIFW, RS6000_BTC_MISC)
+
+ /* Compares. */
+RS6000_BUILTIN(SPE_BUILTIN_EVCMPEQ, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVCMPGTS, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVCMPGTU, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVCMPLTS, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVCMPLTU, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVFSCMPEQ, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVFSCMPGT, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVFSCMPLT, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVFSTSTEQ, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVFSTSTGT, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVFSTSTLT, RS6000_BTC_MISC)
+
+/* EVSEL compares. */
+RS6000_BUILTIN(SPE_BUILTIN_EVSEL_CMPEQ, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSEL_CMPGTS, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSEL_CMPGTU, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSEL_CMPLTS, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSEL_CMPLTU, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSEL_FSCMPEQ, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSEL_FSCMPGT, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSEL_FSCMPLT, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSEL_FSTSTEQ, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSEL_FSTSTGT, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSEL_FSTSTLT, RS6000_BTC_MISC)
+
+RS6000_BUILTIN(SPE_BUILTIN_EVSPLATFI, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVSPLATI, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHSSMAA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHSMFAA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHSMIAA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHUSIAA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHUMIAA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHSSFAN, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHSSIAN, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHSMFAN, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHSMIAN, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHUSIAN, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHUMIAN, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHGSSFAA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHGSMFAA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHGSMIAA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHGUMIAA, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHGSSFAN, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHGSMFAN, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHGSMIAN, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_EVMWHGUMIAN, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_MTSPEFSCR, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_MFSPEFSCR, RS6000_BTC_MISC)
+RS6000_BUILTIN(SPE_BUILTIN_BRINC, RS6000_BTC_MISC)
+
+/* PAIRED builtins. */
+RS6000_BUILTIN(PAIRED_BUILTIN_DIVV2SF3, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_ABSV2SF2, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_NEGV2SF2, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_SQRTV2SF2, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_ADDV2SF3, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_SUBV2SF3, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_RESV2SF2, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_MULV2SF3, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_MSUB, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_MADD, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_NMSUB, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_NMADD, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_NABSV2SF2, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_SUM0, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_SUM1, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_MULS0, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_MULS1, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_MERGE00, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_MERGE01, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_MERGE10, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_MERGE11, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_MADDS0, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_MADDS1, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_STX, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_LX, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_SELV2SF4, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_CMPU0, RS6000_BTC_MISC)
+RS6000_BUILTIN(PAIRED_BUILTIN_CMPU1, RS6000_BTC_MISC)
+
+ /* VSX builtins. */
+RS6000_BUILTIN(VSX_BUILTIN_LXSDX, RS6000_BTC_MEM)
+RS6000_BUILTIN(VSX_BUILTIN_LXVD2X, RS6000_BTC_MEM)
+RS6000_BUILTIN(VSX_BUILTIN_LXVDSX, RS6000_BTC_MEM)
+RS6000_BUILTIN(VSX_BUILTIN_LXVW4X, RS6000_BTC_MEM)
+RS6000_BUILTIN(VSX_BUILTIN_STXSDX, RS6000_BTC_MEM)
+RS6000_BUILTIN(VSX_BUILTIN_STXVD2X, RS6000_BTC_MEM)
+RS6000_BUILTIN(VSX_BUILTIN_STXVW4X, RS6000_BTC_MEM)
+RS6000_BUILTIN(VSX_BUILTIN_XSABSDP, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XSADDDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSCMPODP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSCMPUDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSCPSGNDP, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XSCVDPSP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSCVDPSXDS, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSCVDPSXWS, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSCVDPUXDS, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSCVDPUXWS, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSCVSPDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSCVSXDDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSCVUXDDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSDIVDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSMADDADP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSMADDMDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSMAXDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSMINDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSMOVDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSMSUBADP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSMSUBMDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSMULDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSNABSDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSNEGDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSNMADDADP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSNMADDMDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSNMSUBADP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSNMSUBMDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSRDPI, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSRDPIC, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSRDPIM, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSRDPIP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSRDPIZ, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSREDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSRSQRTEDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSSQRTDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSSUBDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_CPSGNDP, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_CPSGNSP, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XSTDIVDP_FE, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSTDIVDP_FG, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSTSQRTDP_FE, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XSTSQRTDP_FG, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVABSDP, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XVABSSP, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XVADDDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVADDSP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCMPEQDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCMPEQSP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCMPGEDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCMPGESP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCMPGTDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCMPGTSP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCMPEQDP_P, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCMPEQSP_P, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCMPGEDP_P, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCMPGESP_P, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCMPGTDP_P, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCMPGTSP_P, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCPSGNDP, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XVCPSGNSP, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XVCVDPSP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCVDPSXDS, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCVDPSXWS, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCVDPUXDS, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCVDPUXDS_UNS, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCVDPUXWS, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCVSPDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCVSPSXDS, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCVSPSXWS, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCVSPUXDS, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCVSPUXWS, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCVSXDDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCVSXDSP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCVSXWDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCVSXWSP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCVUXDDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCVUXDDP_UNS, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCVUXDSP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCVUXWDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVCVUXWSP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVDIVDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVDIVSP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVMADDDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVMADDSP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVMAXDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVMAXSP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVMINDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVMINSP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVMSUBDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVMSUBSP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVMULDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVMULSP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVNABSDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVNABSSP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVNEGDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVNEGSP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVNMADDDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVNMADDSP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVNMSUBDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVNMSUBSP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVRDPI, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVRDPIC, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVRDPIM, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVRDPIP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVRDPIZ, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVREDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVRESP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVRSPI, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVRSPIC, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVRSPIM, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVRSPIP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVRSPIZ, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVRSQRTEDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVRSQRTESP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVSQRTDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVSQRTSP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVSUBDP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVSUBSP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVTDIVDP_FE, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVTDIVDP_FG, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVTDIVSP_FE, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVTDIVSP_FG, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVTSQRTDP_FE, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVTSQRTDP_FG, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVTSQRTSP_FE, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XVTSQRTSP_FG, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XXSEL_2DI, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XXSEL_2DF, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XXSEL_4SI, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XXSEL_4SF, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XXSEL_8HI, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XXSEL_16QI, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XXSEL_2DI_UNS, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XXSEL_4SI_UNS, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XXSEL_8HI_UNS, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XXSEL_16QI_UNS, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_VPERM_2DI, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_VPERM_2DF, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_VPERM_4SI, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_VPERM_4SF, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_VPERM_8HI, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_VPERM_16QI, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_VPERM_2DI_UNS, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_VPERM_4SI_UNS, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_VPERM_8HI_UNS, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_VPERM_16QI_UNS, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XXPERMDI_2DF, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XXPERMDI_2DI, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XXPERMDI_4SF, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XXPERMDI_4SI, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XXPERMDI_8HI, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XXPERMDI_16QI, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_CONCAT_2DF, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_CONCAT_2DI, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_SET_2DF, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_SET_2DI, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_SPLAT_2DF, RS6000_BTC_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_SPLAT_2DI, RS6000_BTC_PURE)
+RS6000_BUILTIN(VSX_BUILTIN_XXMRGHW_4SF, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XXMRGHW_4SI, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XXMRGLW_4SF, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XXMRGLW_4SI, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XXSLDWI_16QI, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XXSLDWI_8HI, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XXSLDWI_4SI, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XXSLDWI_4SF, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XXSLDWI_2DI, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_XXSLDWI_2DF, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_VEC_INIT_V2DF, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_VEC_INIT_V2DI, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_VEC_SET_V2DF, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_VEC_SET_V2DI, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_VEC_EXT_V2DF, RS6000_BTC_CONST)
+RS6000_BUILTIN(VSX_BUILTIN_VEC_EXT_V2DI, RS6000_BTC_CONST)
+
+/* VSX overloaded builtins, add the overloaded functions not present in
+ Altivec. */
+RS6000_BUILTIN(VSX_BUILTIN_VEC_MUL, RS6000_BTC_MISC)
+RS6000_BUILTIN_EQUATE(VSX_BUILTIN_OVERLOADED_FIRST,
+ VSX_BUILTIN_VEC_MUL)
+RS6000_BUILTIN(VSX_BUILTIN_VEC_MSUB, RS6000_BTC_MISC)
+RS6000_BUILTIN(VSX_BUILTIN_VEC_NMADD, RS6000_BTC_MISC)
+RS6000_BUILTIN(VSX_BUITLIN_VEC_NMSUB, RS6000_BTC_MISC)
+RS6000_BUILTIN(VSX_BUILTIN_VEC_DIV, RS6000_BTC_MISC)
+RS6000_BUILTIN(VSX_BUILTIN_VEC_XXMRGHW, RS6000_BTC_MISC)
+RS6000_BUILTIN(VSX_BUILTIN_VEC_XXMRGLW, RS6000_BTC_MISC)
+RS6000_BUILTIN(VSX_BUILTIN_VEC_XXPERMDI, RS6000_BTC_MISC)
+RS6000_BUILTIN(VSX_BUILTIN_VEC_XXSLDWI, RS6000_BTC_MISC)
+RS6000_BUILTIN(VSX_BUILTIN_VEC_XXSPLTD, RS6000_BTC_MISC)
+RS6000_BUILTIN(VSX_BUILTIN_VEC_XXSPLTW, RS6000_BTC_MISC)
+RS6000_BUILTIN_EQUATE(VSX_BUILTIN_OVERLOADED_LAST,
+ VSX_BUILTIN_VEC_XXSPLTW)
+
+/* Combined VSX/Altivec builtins. */
+RS6000_BUILTIN(VECTOR_BUILTIN_FLOAT_V4SI_V4SF, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VECTOR_BUILTIN_UNSFLOAT_V4SI_V4SF, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VECTOR_BUILTIN_FIX_V4SF_V4SI, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(VECTOR_BUILTIN_FIXUNS_V4SF_V4SI, RS6000_BTC_FP_PURE)
+
+/* Power7 builtins, that aren't VSX instructions. */
+RS6000_BUILTIN(POWER7_BUILTIN_BPERMD, RS6000_BTC_CONST)
+
+/* Miscellaneous builtins. */
+RS6000_BUILTIN(RS6000_BUILTIN_RECIP, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(RS6000_BUILTIN_RECIPF, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(RS6000_BUILTIN_RSQRTF, RS6000_BTC_FP_PURE)
+RS6000_BUILTIN(RS6000_BUILTIN_BSWAP_HI, RS6000_BTC_CONST)
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index cafe2b318aa..88649ea0735 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -130,6 +130,8 @@ typedef struct GTY(()) machine_function
64-bits wide and is allocated early enough so that the offset
does not overflow the 16-bit load/store offset field. */
rtx sdmode_stack_slot;
+ /* True if any VSX or ALTIVEC vector type was used. */
+ bool vsx_or_altivec_used_p;
} machine_function;
/* Target cpu type */
@@ -511,6 +513,25 @@ struct processor_costs ppc440_cost = {
1, /* streams */
};
+/* Instruction costs on PPC476 processors. */
+static const
+struct processor_costs ppc476_cost = {
+ COSTS_N_INSNS (4), /* mulsi */
+ COSTS_N_INSNS (4), /* mulsi_const */
+ COSTS_N_INSNS (4), /* mulsi_const9 */
+ COSTS_N_INSNS (4), /* muldi */
+ COSTS_N_INSNS (11), /* divsi */
+ COSTS_N_INSNS (11), /* divdi */
+ COSTS_N_INSNS (6), /* fp */
+ COSTS_N_INSNS (6), /* dmul */
+ COSTS_N_INSNS (19), /* sdiv */
+ COSTS_N_INSNS (33), /* ddiv */
+ 32, /* l1 cache line size */
+ 32, /* l1 cache */
+ 512, /* l2 cache */
+ 1, /* streams */
+};
+
/* Instruction costs on PPC601 processors. */
static const
struct processor_costs ppc601_cost = {
@@ -797,6 +818,40 @@ struct processor_costs power7_cost = {
12, /* prefetch streams */
};
+/* Instruction costs on POWER A2 processors. */
+static const
+struct processor_costs ppca2_cost = {
+ COSTS_N_INSNS (16), /* mulsi */
+ COSTS_N_INSNS (16), /* mulsi_const */
+ COSTS_N_INSNS (16), /* mulsi_const9 */
+ COSTS_N_INSNS (16), /* muldi */
+ COSTS_N_INSNS (22), /* divsi */
+ COSTS_N_INSNS (28), /* divdi */
+ COSTS_N_INSNS (3), /* fp */
+ COSTS_N_INSNS (3), /* dmul */
+ COSTS_N_INSNS (59), /* sdiv */
+ COSTS_N_INSNS (72), /* ddiv */
+ 64,
+ 16, /* l1 cache */
+ 2048, /* l2 cache */
+ 16, /* prefetch streams */
+};
+
+
+/* Table that classifies rs6000 builtin functions (pure, const, etc.). */
+#undef RS6000_BUILTIN
+#undef RS6000_BUILTIN_EQUATE
+#define RS6000_BUILTIN(NAME, TYPE) TYPE,
+#define RS6000_BUILTIN_EQUATE(NAME, VALUE)
+
+static const enum rs6000_btc builtin_classify[(int)RS6000_BUILTIN_COUNT] =
+{
+#include "rs6000-builtin.def"
+};
+
+#undef RS6000_BUILTIN
+#undef RS6000_BUILTIN_EQUATE
+
static bool rs6000_function_ok_for_sibcall (tree, tree);
static const char *rs6000_invalid_within_doloop (const_rtx);
@@ -860,7 +915,7 @@ static void rs6000_elf_encode_section_info (tree, rtx, int)
ATTRIBUTE_UNUSED;
#endif
static bool rs6000_use_blocks_for_constant_p (enum machine_mode, const_rtx);
-static void rs6000_alloc_sdmode_stack_slot (void);
+static void rs6000_expand_to_rtl_hook (void);
static void rs6000_instantiate_decls (void);
#if TARGET_XCOFF
static void rs6000_xcoff_asm_output_anchor (rtx);
@@ -928,6 +983,8 @@ static bool rs6000_builtin_support_vector_misalignment (enum
static void def_builtin (int, const char *, tree, int);
static bool rs6000_vector_alignment_reachable (const_tree, bool);
static void rs6000_init_builtins (void);
+static tree rs6000_builtin_decl (unsigned, bool);
+
static rtx rs6000_expand_unop_builtin (enum insn_code, tree, rtx);
static rtx rs6000_expand_binop_builtin (enum insn_code, tree, rtx);
static rtx rs6000_expand_ternop_builtin (enum insn_code, tree, rtx);
@@ -984,7 +1041,6 @@ static void rs6000_init_dwarf_reg_sizes_extra (tree);
static rtx rs6000_legitimize_address (rtx, rtx, enum machine_mode);
static rtx rs6000_debug_legitimize_address (rtx, rtx, enum machine_mode);
static rtx rs6000_legitimize_tls_address (rtx, enum tls_model);
-static rtx rs6000_delegitimize_address (rtx);
static void rs6000_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED;
static rtx rs6000_tls_get_addr (void);
static rtx rs6000_got_sym (void);
@@ -1314,6 +1370,8 @@ static const struct attribute_spec rs6000_attribute_table[] =
#undef TARGET_INIT_BUILTINS
#define TARGET_INIT_BUILTINS rs6000_init_builtins
+#undef TARGET_BUILTIN_DECL
+#define TARGET_BUILTIN_DECL rs6000_builtin_decl
#undef TARGET_EXPAND_BUILTIN
#define TARGET_EXPAND_BUILTIN rs6000_expand_builtin
@@ -1445,14 +1503,11 @@ static const struct attribute_spec rs6000_attribute_table[] =
#undef TARGET_USE_BLOCKS_FOR_CONSTANT_P
#define TARGET_USE_BLOCKS_FOR_CONSTANT_P rs6000_use_blocks_for_constant_p
-#undef TARGET_DELEGITIMIZE_ADDRESS
-#define TARGET_DELEGITIMIZE_ADDRESS rs6000_delegitimize_address
-
#undef TARGET_BUILTIN_RECIPROCAL
#define TARGET_BUILTIN_RECIPROCAL rs6000_builtin_reciprocal
#undef TARGET_EXPAND_TO_RTL_HOOK
-#define TARGET_EXPAND_TO_RTL_HOOK rs6000_alloc_sdmode_stack_slot
+#define TARGET_EXPAND_TO_RTL_HOOK rs6000_expand_to_rtl_hook
#undef TARGET_INSTANTIATE_DECLS
#define TARGET_INSTANTIATE_DECLS rs6000_instantiate_decls
@@ -2125,6 +2180,12 @@ rs6000_override_options (const char *default_cpu)
POWERPC_BASE_MASK | MASK_SOFT_FLOAT | MASK_MULHW | MASK_DLMZB},
{"464fp", PROCESSOR_PPC440,
POWERPC_BASE_MASK | MASK_MULHW | MASK_DLMZB},
+ {"476", PROCESSOR_PPC476,
+ POWERPC_BASE_MASK | MASK_SOFT_FLOAT | MASK_PPC_GFXOPT | MASK_MFCRF
+ | MASK_POPCNTB | MASK_FPRND | MASK_CMPB | MASK_MULHW | MASK_DLMZB},
+ {"476fp", PROCESSOR_PPC476,
+ POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_MFCRF | MASK_POPCNTB
+ | MASK_FPRND | MASK_CMPB | MASK_MULHW | MASK_DLMZB},
{"505", PROCESSOR_MPCCORE, POWERPC_BASE_MASK},
{"601", PROCESSOR_PPC601,
MASK_POWER | POWERPC_BASE_MASK | MASK_MULTIPLE | MASK_STRING},
@@ -2149,6 +2210,9 @@ rs6000_override_options (const char *default_cpu)
/* 8548 has a dummy entry for now. */
{"8548", PROCESSOR_PPC8540, POWERPC_BASE_MASK | MASK_STRICT_ALIGN
| MASK_ISEL},
+ {"a2", PROCESSOR_PPCA2,
+ POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_POWERPC64 | MASK_POPCNTB
+ | MASK_CMPB | MASK_NO_UPDATE },
{"e300c2", PROCESSOR_PPCE300C2, POWERPC_BASE_MASK | MASK_SOFT_FLOAT},
{"e300c3", PROCESSOR_PPCE300C3, POWERPC_BASE_MASK},
{"e500mc", PROCESSOR_PPCE500MC, POWERPC_BASE_MASK | MASK_PPC_GFXOPT
@@ -2216,9 +2280,16 @@ rs6000_override_options (const char *default_cpu)
| MASK_PPC_GFXOPT | MASK_POWERPC64 | MASK_ALTIVEC
| MASK_MFCRF | MASK_POPCNTB | MASK_FPRND | MASK_MULHW
| MASK_DLMZB | MASK_CMPB | MASK_MFPGPR | MASK_DFP
- | MASK_POPCNTD | MASK_VSX | MASK_ISEL)
+ | MASK_POPCNTD | MASK_VSX | MASK_ISEL | MASK_NO_UPDATE)
};
+ /* Numerous experiment shows that IRA based loop pressure
+ calculation works better for RTL loop invariant motion on targets
+ with enough (>= 32) registers. It is an expensive optimization.
+ So it is on only for peak performance. */
+ if (optimize >= 3)
+ flag_ira_loop_pressure = 1;
+
/* Set the pointer size. */
if (TARGET_64BIT)
{
@@ -2495,6 +2566,7 @@ rs6000_override_options (const char *default_cpu)
&& rs6000_cpu != PROCESSOR_POWER5
&& rs6000_cpu != PROCESSOR_POWER6
&& rs6000_cpu != PROCESSOR_POWER7
+ && rs6000_cpu != PROCESSOR_PPCA2
&& rs6000_cpu != PROCESSOR_CELL);
rs6000_sched_groups = (rs6000_cpu == PROCESSOR_POWER4
|| rs6000_cpu == PROCESSOR_POWER5
@@ -2650,6 +2722,10 @@ rs6000_override_options (const char *default_cpu)
rs6000_cost = &ppc440_cost;
break;
+ case PROCESSOR_PPC476:
+ rs6000_cost = &ppc476_cost;
+ break;
+
case PROCESSOR_PPC601:
rs6000_cost = &ppc601_cost;
break;
@@ -2713,6 +2789,10 @@ rs6000_override_options (const char *default_cpu)
rs6000_cost = &power7_cost;
break;
+ case PROCESSOR_PPCA2:
+ rs6000_cost = &ppca2_cost;
+ break;
+
default:
gcc_unreachable ();
}
@@ -5128,33 +5208,6 @@ rs6000_debug_legitimize_address (rtx x, rtx oldx, enum machine_mode mode)
return ret;
}
-/* If ORIG_X is a constant pool reference, return its known value,
- otherwise ORIG_X. */
-
-static rtx
-rs6000_delegitimize_address (rtx x)
-{
- rtx orig_x = delegitimize_mem_from_attrs (x);
-
- x = orig_x;
-
- if (!MEM_P (x))
- return orig_x;
-
- x = XEXP (x, 0);
-
- if (legitimate_constant_pool_address_p (x)
- && GET_CODE (XEXP (x, 1)) == CONST
- && GET_CODE (XEXP (XEXP (x, 1), 0)) == MINUS
- && GET_CODE (XEXP (XEXP (XEXP (x, 1), 0), 0)) == SYMBOL_REF
- && constant_pool_expr_p (XEXP (XEXP (XEXP (x, 1), 0), 0))
- && GET_CODE (XEXP (XEXP (XEXP (x, 1), 0), 1)) == SYMBOL_REF
- && toc_relative_expr_p (XEXP (XEXP (XEXP (x, 1), 0), 1)))
- return get_pool_constant (XEXP (XEXP (XEXP (x, 1), 0), 0));
-
- return orig_x;
-}
-
/* This is called from dwarf2out.c via TARGET_ASM_OUTPUT_DWARF_DTPREL.
We need to emit DTP-relative relocations. */
@@ -8465,13 +8518,54 @@ def_builtin (int mask, const char *name, tree type, int code)
{
if ((mask & target_flags) || TARGET_PAIRED_FLOAT)
{
+ tree t;
if (rs6000_builtin_decls[code])
fatal_error ("internal error: builtin function to %s already processed.",
name);
- rs6000_builtin_decls[code] =
+ rs6000_builtin_decls[code] = t =
add_builtin_function (name, type, code, BUILT_IN_MD,
NULL, NULL_TREE);
+
+ gcc_assert (code >= 0 && code < (int)RS6000_BUILTIN_COUNT);
+ switch (builtin_classify[code])
+ {
+ default:
+ gcc_unreachable ();
+
+ /* assume builtin can do anything. */
+ case RS6000_BTC_MISC:
+ break;
+
+ /* const function, function only depends on the inputs. */
+ case RS6000_BTC_CONST:
+ TREE_READONLY (t) = 1;
+ TREE_NOTHROW (t) = 1;
+ break;
+
+ /* pure function, function can read global memory. */
+ case RS6000_BTC_PURE:
+ DECL_PURE_P (t) = 1;
+ TREE_NOTHROW (t) = 1;
+ break;
+
+ /* Function is a math function. If rounding mode is on, then treat
+ the function as not reading global memory, but it can have
+ arbitrary side effects. If it is off, then assume the function is
+ a const function. This mimics the ATTR_MATHFN_FPROUNDING
+ attribute in builtin-attribute.def that is used for the math
+ functions. */
+ case RS6000_BTC_FP_PURE:
+ TREE_NOTHROW (t) = 1;
+ if (flag_rounding_math)
+ {
+ DECL_PURE_P (t) = 1;
+ DECL_IS_NOVOPS (t) = 1;
+ }
+ else
+ TREE_READONLY (t) = 1;
+ break;
+ }
}
}
@@ -11148,6 +11242,17 @@ rs6000_init_builtins (void)
#endif
}
+/* Returns the rs6000 builtin decl for CODE. */
+
+static tree
+rs6000_builtin_decl (unsigned code, bool initialize_p ATTRIBUTE_UNUSED)
+{
+ if (code >= RS6000_BUILTIN_COUNT)
+ return error_mark_node;
+
+ return rs6000_builtin_decls[code];
+}
+
/* Search through a set of builtins and enable the mask bits.
DESC is an array of builtins.
SIZE is the total number of builtins.
@@ -13087,6 +13192,38 @@ rs6000_check_sdmode (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
return NULL_TREE;
}
+static tree
+rs6000_check_vector_mode (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
+{
+ /* Don't walk into types. */
+ if (*tp == NULL_TREE || *tp == error_mark_node || TYPE_P (*tp))
+ {
+ *walk_subtrees = 0;
+ return NULL_TREE;
+ }
+
+ switch (TREE_CODE (*tp))
+ {
+ case VAR_DECL:
+ case PARM_DECL:
+ case FIELD_DECL:
+ case RESULT_DECL:
+ case SSA_NAME:
+ case REAL_CST:
+ case INDIRECT_REF:
+ case ALIGN_INDIRECT_REF:
+ case MISALIGNED_INDIRECT_REF:
+ case VIEW_CONVERT_EXPR:
+ if (VECTOR_MODE_P (TYPE_MODE (TREE_TYPE (*tp))))
+ return *tp;
+ break;
+ default:
+ break;
+ }
+
+ return NULL_TREE;
+}
+
enum reload_reg_type {
GPR_REGISTER_TYPE,
VECTOR_REGISTER_TYPE,
@@ -13527,11 +13664,17 @@ rs6000_ira_cover_classes (void)
return (TARGET_VSX) ? cover_vsx : cover_pre_vsx;
}
-/* Allocate a 64-bit stack slot to be used for copying SDmode
- values through if this function has any SDmode references. */
+/* Scan the trees looking for certain types.
+
+ Allocate a 64-bit stack slot to be used for copying SDmode values through if
+ this function has any SDmode references.
+
+ If VSX, note whether any vector operation was done so we can set VRSAVE to
+ non-zero, even if we just use the floating point registers to tell the
+ kernel to save the vector registers. */
static void
-rs6000_alloc_sdmode_stack_slot (void)
+rs6000_expand_to_rtl_hook (void)
{
tree t;
basic_block bb;
@@ -13539,6 +13682,24 @@ rs6000_alloc_sdmode_stack_slot (void)
gcc_assert (cfun->machine->sdmode_stack_slot == NULL_RTX);
+ /* Check for vectors. */
+ if (TARGET_VSX)
+ {
+ FOR_EACH_BB (bb)
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ if (walk_gimple_op (gsi_stmt (gsi), rs6000_check_vector_mode,
+ NULL))
+ {
+ cfun->machine->vsx_or_altivec_used_p = true;
+ goto found_vector;
+ }
+ }
+ found_vector:
+ ;
+ }
+
+ /* Check for SDmode being used. */
FOR_EACH_BB (bb)
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
@@ -16680,6 +16841,15 @@ compute_vrsave_mask (void)
if (df_regs_ever_live_p (i))
mask |= ALTIVEC_REG_BIT (i);
+ /* If VSX is used, we might have used a traditional floating point register
+ in a vector mode without using any altivec registers. However the VRSAVE
+ register does not have room to indicate the floating point registers.
+ Modern kernels only look to see if the value is non-zero to determine if
+ they need to save the vector registers, so we just set an arbitrary
+ value if any vector type was used. */
+ if (mask == 0 && TARGET_VSX && cfun->machine->vsx_or_altivec_used_p)
+ mask = 0xFFF;
+
if (mask == 0)
return mask;
@@ -20052,8 +20222,10 @@ rs6000_output_function_epilogue (FILE *file,
use language_string.
C is 0. Fortran is 1. Pascal is 2. Ada is 3. C++ is 9.
Java is 13. Objective-C is 14. Objective-C++ isn't assigned
- a number, so for now use 9. */
- if (! strcmp (language_string, "GNU C"))
+ a number, so for now use 9. LTO isn't assigned a number either,
+ so for now use 0. */
+ if (! strcmp (language_string, "GNU C")
+ || ! strcmp (language_string, "GNU GIMPLE"))
i = 0;
else if (! strcmp (language_string, "GNU F77")
|| ! strcmp (language_string, "GNU Fortran"))
@@ -21782,6 +21954,7 @@ rs6000_issue_rate (void)
case CPU_PPCE500MC:
return 2;
case CPU_RIOS2:
+ case CPU_PPC476:
case CPU_PPC604:
case CPU_PPC604E:
case CPU_PPC620:
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 52d9a594be2..4b1ca3d635a 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -83,6 +83,12 @@
#define ASM_CPU_POWER7_SPEC "-mpower4 -maltivec"
#endif
+#ifdef HAVE_AS_DCI
+#define ASM_CPU_476_SPEC "-m476"
+#else
+#define ASM_CPU_476_SPEC "-mpower4"
+#endif
+
/* Common ASM definitions used by ASM_SPEC among the various targets for
handling -mcpu=xxx switches. There is a parallel list in driver-rs6000.c to
provide the default assembler options if the user uses -mcpu=native, so if
@@ -107,6 +113,7 @@
%{mcpu=power6: %(asm_cpu_power6) -maltivec} \
%{mcpu=power6x: %(asm_cpu_power6) -maltivec} \
%{mcpu=power7: %(asm_cpu_power7)} \
+%{mcpu=a2: -ma2} \
%{mcpu=powerpc: -mppc} \
%{mcpu=rios: -mpwr} \
%{mcpu=rios1: -mpwr} \
@@ -122,6 +129,8 @@
%{mcpu=440fp: -m440} \
%{mcpu=464: -m440} \
%{mcpu=464fp: -m440} \
+%{mcpu=476: %(asm_cpu_476)} \
+%{mcpu=476fp: %(asm_cpu_476)} \
%{mcpu=505: -mppc} \
%{mcpu=601: -m601} \
%{mcpu=602: -mppc} \
@@ -177,6 +186,7 @@
{ "asm_cpu_power5", ASM_CPU_POWER5_SPEC }, \
{ "asm_cpu_power6", ASM_CPU_POWER6_SPEC }, \
{ "asm_cpu_power7", ASM_CPU_POWER7_SPEC }, \
+ { "asm_cpu_476", ASM_CPU_476_SPEC }, \
SUBTARGET_EXTRA_SPECS
/* -mcpu=native handling only makes sense with compiler running on
@@ -317,6 +327,7 @@ enum processor_type
PROCESSOR_PPC403,
PROCESSOR_PPC405,
PROCESSOR_PPC440,
+ PROCESSOR_PPC476,
PROCESSOR_PPC601,
PROCESSOR_PPC603,
PROCESSOR_PPC604,
@@ -334,7 +345,8 @@ enum processor_type
PROCESSOR_POWER5,
PROCESSOR_POWER6,
PROCESSOR_POWER7,
- PROCESSOR_CELL
+ PROCESSOR_CELL,
+ PROCESSOR_PPCA2
};
/* FPU operations supported.
@@ -1021,10 +1033,12 @@ extern unsigned rs6000_pointer_size;
#define HARD_REGNO_NREGS(REGNO, MODE) rs6000_hard_regno_nregs[(MODE)][(REGNO)]
-#define HARD_REGNO_CALL_PART_CLOBBERED(REGNO, MODE) \
- ((TARGET_32BIT && TARGET_POWERPC64 \
- && (GET_MODE_SIZE (MODE) > 4) \
- && INT_REGNO_P (REGNO)) ? 1 : 0)
+#define HARD_REGNO_CALL_PART_CLOBBERED(REGNO, MODE) \
+ (((TARGET_32BIT && TARGET_POWERPC64 \
+ && (GET_MODE_SIZE (MODE) > 4) \
+ && INT_REGNO_P (REGNO)) ? 1 : 0) \
+ || (TARGET_VSX && FP_REGNO_P (REGNO) \
+ && GET_MODE_SIZE (MODE) > 8))
#define VSX_VECTOR_MODE(MODE) \
((MODE) == V4SFmode \
@@ -2412,964 +2426,35 @@ extern int optimize;
extern int flag_expensive_optimizations;
extern int frame_pointer_needed;
+/* Classification of the builtin functions to properly set the declaration tree
+ flags. */
+enum rs6000_btc
+{
+ RS6000_BTC_MISC, /* assume builtin can do anything */
+ RS6000_BTC_CONST, /* builtin is a 'const' function. */
+ RS6000_BTC_PURE, /* builtin is a 'pure' function. */
+ RS6000_BTC_FP_PURE /* builtin is 'pure' if rounding math. */
+};
+
+/* Convenience macros to document the instruction type. */
+#define RS6000_BTC_MEM RS6000_BTC_MISC /* load/store touches memory */
+#define RS6000_BTC_SAT RS6000_BTC_MISC /* VMX saturate sets VSCR register */
+
+#undef RS6000_BUILTIN
+#undef RS6000_BUILTIN_EQUATE
+#define RS6000_BUILTIN(NAME, TYPE) NAME,
+#define RS6000_BUILTIN_EQUATE(NAME, VALUE) NAME = VALUE,
+
enum rs6000_builtins
{
- /* AltiVec builtins. */
- ALTIVEC_BUILTIN_ST_INTERNAL_4si,
- ALTIVEC_BUILTIN_LD_INTERNAL_4si,
- ALTIVEC_BUILTIN_ST_INTERNAL_8hi,
- ALTIVEC_BUILTIN_LD_INTERNAL_8hi,
- ALTIVEC_BUILTIN_ST_INTERNAL_16qi,
- ALTIVEC_BUILTIN_LD_INTERNAL_16qi,
- ALTIVEC_BUILTIN_ST_INTERNAL_4sf,
- ALTIVEC_BUILTIN_LD_INTERNAL_4sf,
- ALTIVEC_BUILTIN_VADDUBM,
- ALTIVEC_BUILTIN_VADDUHM,
- ALTIVEC_BUILTIN_VADDUWM,
- ALTIVEC_BUILTIN_VADDFP,
- ALTIVEC_BUILTIN_VADDCUW,
- ALTIVEC_BUILTIN_VADDUBS,
- ALTIVEC_BUILTIN_VADDSBS,
- ALTIVEC_BUILTIN_VADDUHS,
- ALTIVEC_BUILTIN_VADDSHS,
- ALTIVEC_BUILTIN_VADDUWS,
- ALTIVEC_BUILTIN_VADDSWS,
- ALTIVEC_BUILTIN_VAND,
- ALTIVEC_BUILTIN_VANDC,
- ALTIVEC_BUILTIN_VAVGUB,
- ALTIVEC_BUILTIN_VAVGSB,
- ALTIVEC_BUILTIN_VAVGUH,
- ALTIVEC_BUILTIN_VAVGSH,
- ALTIVEC_BUILTIN_VAVGUW,
- ALTIVEC_BUILTIN_VAVGSW,
- ALTIVEC_BUILTIN_VCFUX,
- ALTIVEC_BUILTIN_VCFSX,
- ALTIVEC_BUILTIN_VCTSXS,
- ALTIVEC_BUILTIN_VCTUXS,
- ALTIVEC_BUILTIN_VCMPBFP,
- ALTIVEC_BUILTIN_VCMPEQUB,
- ALTIVEC_BUILTIN_VCMPEQUH,
- ALTIVEC_BUILTIN_VCMPEQUW,
- ALTIVEC_BUILTIN_VCMPEQFP,
- ALTIVEC_BUILTIN_VCMPGEFP,
- ALTIVEC_BUILTIN_VCMPGTUB,
- ALTIVEC_BUILTIN_VCMPGTSB,
- ALTIVEC_BUILTIN_VCMPGTUH,
- ALTIVEC_BUILTIN_VCMPGTSH,
- ALTIVEC_BUILTIN_VCMPGTUW,
- ALTIVEC_BUILTIN_VCMPGTSW,
- ALTIVEC_BUILTIN_VCMPGTFP,
- ALTIVEC_BUILTIN_VEXPTEFP,
- ALTIVEC_BUILTIN_VLOGEFP,
- ALTIVEC_BUILTIN_VMADDFP,
- ALTIVEC_BUILTIN_VMAXUB,
- ALTIVEC_BUILTIN_VMAXSB,
- ALTIVEC_BUILTIN_VMAXUH,
- ALTIVEC_BUILTIN_VMAXSH,
- ALTIVEC_BUILTIN_VMAXUW,
- ALTIVEC_BUILTIN_VMAXSW,
- ALTIVEC_BUILTIN_VMAXFP,
- ALTIVEC_BUILTIN_VMHADDSHS,
- ALTIVEC_BUILTIN_VMHRADDSHS,
- ALTIVEC_BUILTIN_VMLADDUHM,
- ALTIVEC_BUILTIN_VMRGHB,
- ALTIVEC_BUILTIN_VMRGHH,
- ALTIVEC_BUILTIN_VMRGHW,
- ALTIVEC_BUILTIN_VMRGLB,
- ALTIVEC_BUILTIN_VMRGLH,
- ALTIVEC_BUILTIN_VMRGLW,
- ALTIVEC_BUILTIN_VMSUMUBM,
- ALTIVEC_BUILTIN_VMSUMMBM,
- ALTIVEC_BUILTIN_VMSUMUHM,
- ALTIVEC_BUILTIN_VMSUMSHM,
- ALTIVEC_BUILTIN_VMSUMUHS,
- ALTIVEC_BUILTIN_VMSUMSHS,
- ALTIVEC_BUILTIN_VMINUB,
- ALTIVEC_BUILTIN_VMINSB,
- ALTIVEC_BUILTIN_VMINUH,
- ALTIVEC_BUILTIN_VMINSH,
- ALTIVEC_BUILTIN_VMINUW,
- ALTIVEC_BUILTIN_VMINSW,
- ALTIVEC_BUILTIN_VMINFP,
- ALTIVEC_BUILTIN_VMULEUB,
- ALTIVEC_BUILTIN_VMULEUB_UNS,
- ALTIVEC_BUILTIN_VMULESB,
- ALTIVEC_BUILTIN_VMULEUH,
- ALTIVEC_BUILTIN_VMULEUH_UNS,
- ALTIVEC_BUILTIN_VMULESH,
- ALTIVEC_BUILTIN_VMULOUB,
- ALTIVEC_BUILTIN_VMULOUB_UNS,
- ALTIVEC_BUILTIN_VMULOSB,
- ALTIVEC_BUILTIN_VMULOUH,
- ALTIVEC_BUILTIN_VMULOUH_UNS,
- ALTIVEC_BUILTIN_VMULOSH,
- ALTIVEC_BUILTIN_VNMSUBFP,
- ALTIVEC_BUILTIN_VNOR,
- ALTIVEC_BUILTIN_VOR,
- ALTIVEC_BUILTIN_VSEL_2DF, /* needed for VSX */
- ALTIVEC_BUILTIN_VSEL_2DI, /* needed for VSX */
- ALTIVEC_BUILTIN_VSEL_4SI,
- ALTIVEC_BUILTIN_VSEL_4SF,
- ALTIVEC_BUILTIN_VSEL_8HI,
- ALTIVEC_BUILTIN_VSEL_16QI,
- ALTIVEC_BUILTIN_VSEL_2DI_UNS,
- ALTIVEC_BUILTIN_VSEL_4SI_UNS,
- ALTIVEC_BUILTIN_VSEL_8HI_UNS,
- ALTIVEC_BUILTIN_VSEL_16QI_UNS,
- ALTIVEC_BUILTIN_VPERM_2DF, /* needed for VSX */
- ALTIVEC_BUILTIN_VPERM_2DI, /* needed for VSX */
- ALTIVEC_BUILTIN_VPERM_4SI,
- ALTIVEC_BUILTIN_VPERM_4SF,
- ALTIVEC_BUILTIN_VPERM_8HI,
- ALTIVEC_BUILTIN_VPERM_16QI,
- ALTIVEC_BUILTIN_VPERM_2DI_UNS,
- ALTIVEC_BUILTIN_VPERM_4SI_UNS,
- ALTIVEC_BUILTIN_VPERM_8HI_UNS,
- ALTIVEC_BUILTIN_VPERM_16QI_UNS,
- ALTIVEC_BUILTIN_VPKUHUM,
- ALTIVEC_BUILTIN_VPKUWUM,
- ALTIVEC_BUILTIN_VPKPX,
- ALTIVEC_BUILTIN_VPKUHSS,
- ALTIVEC_BUILTIN_VPKSHSS,
- ALTIVEC_BUILTIN_VPKUWSS,
- ALTIVEC_BUILTIN_VPKSWSS,
- ALTIVEC_BUILTIN_VPKUHUS,
- ALTIVEC_BUILTIN_VPKSHUS,
- ALTIVEC_BUILTIN_VPKUWUS,
- ALTIVEC_BUILTIN_VPKSWUS,
- ALTIVEC_BUILTIN_VREFP,
- ALTIVEC_BUILTIN_VRFIM,
- ALTIVEC_BUILTIN_VRFIN,
- ALTIVEC_BUILTIN_VRFIP,
- ALTIVEC_BUILTIN_VRFIZ,
- ALTIVEC_BUILTIN_VRLB,
- ALTIVEC_BUILTIN_VRLH,
- ALTIVEC_BUILTIN_VRLW,
- ALTIVEC_BUILTIN_VRSQRTEFP,
- ALTIVEC_BUILTIN_VSLB,
- ALTIVEC_BUILTIN_VSLH,
- ALTIVEC_BUILTIN_VSLW,
- ALTIVEC_BUILTIN_VSL,
- ALTIVEC_BUILTIN_VSLO,
- ALTIVEC_BUILTIN_VSPLTB,
- ALTIVEC_BUILTIN_VSPLTH,
- ALTIVEC_BUILTIN_VSPLTW,
- ALTIVEC_BUILTIN_VSPLTISB,
- ALTIVEC_BUILTIN_VSPLTISH,
- ALTIVEC_BUILTIN_VSPLTISW,
- ALTIVEC_BUILTIN_VSRB,
- ALTIVEC_BUILTIN_VSRH,
- ALTIVEC_BUILTIN_VSRW,
- ALTIVEC_BUILTIN_VSRAB,
- ALTIVEC_BUILTIN_VSRAH,
- ALTIVEC_BUILTIN_VSRAW,
- ALTIVEC_BUILTIN_VSR,
- ALTIVEC_BUILTIN_VSRO,
- ALTIVEC_BUILTIN_VSUBUBM,
- ALTIVEC_BUILTIN_VSUBUHM,
- ALTIVEC_BUILTIN_VSUBUWM,
- ALTIVEC_BUILTIN_VSUBFP,
- ALTIVEC_BUILTIN_VSUBCUW,
- ALTIVEC_BUILTIN_VSUBUBS,
- ALTIVEC_BUILTIN_VSUBSBS,
- ALTIVEC_BUILTIN_VSUBUHS,
- ALTIVEC_BUILTIN_VSUBSHS,
- ALTIVEC_BUILTIN_VSUBUWS,
- ALTIVEC_BUILTIN_VSUBSWS,
- ALTIVEC_BUILTIN_VSUM4UBS,
- ALTIVEC_BUILTIN_VSUM4SBS,
- ALTIVEC_BUILTIN_VSUM4SHS,
- ALTIVEC_BUILTIN_VSUM2SWS,
- ALTIVEC_BUILTIN_VSUMSWS,
- ALTIVEC_BUILTIN_VXOR,
- ALTIVEC_BUILTIN_VSLDOI_16QI,
- ALTIVEC_BUILTIN_VSLDOI_8HI,
- ALTIVEC_BUILTIN_VSLDOI_4SI,
- ALTIVEC_BUILTIN_VSLDOI_4SF,
- ALTIVEC_BUILTIN_VUPKHSB,
- ALTIVEC_BUILTIN_VUPKHPX,
- ALTIVEC_BUILTIN_VUPKHSH,
- ALTIVEC_BUILTIN_VUPKLSB,
- ALTIVEC_BUILTIN_VUPKLPX,
- ALTIVEC_BUILTIN_VUPKLSH,
- ALTIVEC_BUILTIN_MTVSCR,
- ALTIVEC_BUILTIN_MFVSCR,
- ALTIVEC_BUILTIN_DSSALL,
- ALTIVEC_BUILTIN_DSS,
- ALTIVEC_BUILTIN_LVSL,
- ALTIVEC_BUILTIN_LVSR,
- ALTIVEC_BUILTIN_DSTT,
- ALTIVEC_BUILTIN_DSTST,
- ALTIVEC_BUILTIN_DSTSTT,
- ALTIVEC_BUILTIN_DST,
- ALTIVEC_BUILTIN_LVEBX,
- ALTIVEC_BUILTIN_LVEHX,
- ALTIVEC_BUILTIN_LVEWX,
- ALTIVEC_BUILTIN_LVXL,
- ALTIVEC_BUILTIN_LVX,
- ALTIVEC_BUILTIN_STVX,
- ALTIVEC_BUILTIN_LVLX,
- ALTIVEC_BUILTIN_LVLXL,
- ALTIVEC_BUILTIN_LVRX,
- ALTIVEC_BUILTIN_LVRXL,
- ALTIVEC_BUILTIN_STVEBX,
- ALTIVEC_BUILTIN_STVEHX,
- ALTIVEC_BUILTIN_STVEWX,
- ALTIVEC_BUILTIN_STVXL,
- ALTIVEC_BUILTIN_STVLX,
- ALTIVEC_BUILTIN_STVLXL,
- ALTIVEC_BUILTIN_STVRX,
- ALTIVEC_BUILTIN_STVRXL,
- ALTIVEC_BUILTIN_VCMPBFP_P,
- ALTIVEC_BUILTIN_VCMPEQFP_P,
- ALTIVEC_BUILTIN_VCMPEQUB_P,
- ALTIVEC_BUILTIN_VCMPEQUH_P,
- ALTIVEC_BUILTIN_VCMPEQUW_P,
- ALTIVEC_BUILTIN_VCMPGEFP_P,
- ALTIVEC_BUILTIN_VCMPGTFP_P,
- ALTIVEC_BUILTIN_VCMPGTSB_P,
- ALTIVEC_BUILTIN_VCMPGTSH_P,
- ALTIVEC_BUILTIN_VCMPGTSW_P,
- ALTIVEC_BUILTIN_VCMPGTUB_P,
- ALTIVEC_BUILTIN_VCMPGTUH_P,
- ALTIVEC_BUILTIN_VCMPGTUW_P,
- ALTIVEC_BUILTIN_ABSS_V4SI,
- ALTIVEC_BUILTIN_ABSS_V8HI,
- ALTIVEC_BUILTIN_ABSS_V16QI,
- ALTIVEC_BUILTIN_ABS_V4SI,
- ALTIVEC_BUILTIN_ABS_V4SF,
- ALTIVEC_BUILTIN_ABS_V8HI,
- ALTIVEC_BUILTIN_ABS_V16QI,
- ALTIVEC_BUILTIN_MASK_FOR_LOAD,
- ALTIVEC_BUILTIN_MASK_FOR_STORE,
- ALTIVEC_BUILTIN_VEC_INIT_V4SI,
- ALTIVEC_BUILTIN_VEC_INIT_V8HI,
- ALTIVEC_BUILTIN_VEC_INIT_V16QI,
- ALTIVEC_BUILTIN_VEC_INIT_V4SF,
- ALTIVEC_BUILTIN_VEC_SET_V4SI,
- ALTIVEC_BUILTIN_VEC_SET_V8HI,
- ALTIVEC_BUILTIN_VEC_SET_V16QI,
- ALTIVEC_BUILTIN_VEC_SET_V4SF,
- ALTIVEC_BUILTIN_VEC_EXT_V4SI,
- ALTIVEC_BUILTIN_VEC_EXT_V8HI,
- ALTIVEC_BUILTIN_VEC_EXT_V16QI,
- ALTIVEC_BUILTIN_VEC_EXT_V4SF,
- ALTIVEC_BUILTIN_COPYSIGN_V4SF,
-
- /* Altivec overloaded builtins. */
- ALTIVEC_BUILTIN_VCMPEQ_P,
- ALTIVEC_BUILTIN_OVERLOADED_FIRST = ALTIVEC_BUILTIN_VCMPEQ_P,
- ALTIVEC_BUILTIN_VCMPGT_P,
- ALTIVEC_BUILTIN_VCMPGE_P,
- ALTIVEC_BUILTIN_VEC_ABS,
- ALTIVEC_BUILTIN_VEC_ABSS,
- ALTIVEC_BUILTIN_VEC_ADD,
- ALTIVEC_BUILTIN_VEC_ADDC,
- ALTIVEC_BUILTIN_VEC_ADDS,
- ALTIVEC_BUILTIN_VEC_AND,
- ALTIVEC_BUILTIN_VEC_ANDC,
- ALTIVEC_BUILTIN_VEC_AVG,
- ALTIVEC_BUILTIN_VEC_EXTRACT,
- ALTIVEC_BUILTIN_VEC_CEIL,
- ALTIVEC_BUILTIN_VEC_CMPB,
- ALTIVEC_BUILTIN_VEC_CMPEQ,
- ALTIVEC_BUILTIN_VEC_CMPEQUB,
- ALTIVEC_BUILTIN_VEC_CMPEQUH,
- ALTIVEC_BUILTIN_VEC_CMPEQUW,
- ALTIVEC_BUILTIN_VEC_CMPGE,
- ALTIVEC_BUILTIN_VEC_CMPGT,
- ALTIVEC_BUILTIN_VEC_CMPLE,
- ALTIVEC_BUILTIN_VEC_CMPLT,
- ALTIVEC_BUILTIN_VEC_COPYSIGN,
- ALTIVEC_BUILTIN_VEC_CTF,
- ALTIVEC_BUILTIN_VEC_CTS,
- ALTIVEC_BUILTIN_VEC_CTU,
- ALTIVEC_BUILTIN_VEC_DST,
- ALTIVEC_BUILTIN_VEC_DSTST,
- ALTIVEC_BUILTIN_VEC_DSTSTT,
- ALTIVEC_BUILTIN_VEC_DSTT,
- ALTIVEC_BUILTIN_VEC_EXPTE,
- ALTIVEC_BUILTIN_VEC_FLOOR,
- ALTIVEC_BUILTIN_VEC_LD,
- ALTIVEC_BUILTIN_VEC_LDE,
- ALTIVEC_BUILTIN_VEC_LDL,
- ALTIVEC_BUILTIN_VEC_LOGE,
- ALTIVEC_BUILTIN_VEC_LVEBX,
- ALTIVEC_BUILTIN_VEC_LVEHX,
- ALTIVEC_BUILTIN_VEC_LVEWX,
- ALTIVEC_BUILTIN_VEC_LVLX,
- ALTIVEC_BUILTIN_VEC_LVLXL,
- ALTIVEC_BUILTIN_VEC_LVRX,
- ALTIVEC_BUILTIN_VEC_LVRXL,
- ALTIVEC_BUILTIN_VEC_LVSL,
- ALTIVEC_BUILTIN_VEC_LVSR,
- ALTIVEC_BUILTIN_VEC_MADD,
- ALTIVEC_BUILTIN_VEC_MADDS,
- ALTIVEC_BUILTIN_VEC_MAX,
- ALTIVEC_BUILTIN_VEC_MERGEH,
- ALTIVEC_BUILTIN_VEC_MERGEL,
- ALTIVEC_BUILTIN_VEC_MIN,
- ALTIVEC_BUILTIN_VEC_MLADD,
- ALTIVEC_BUILTIN_VEC_MPERM,
- ALTIVEC_BUILTIN_VEC_MRADDS,
- ALTIVEC_BUILTIN_VEC_MRGHB,
- ALTIVEC_BUILTIN_VEC_MRGHH,
- ALTIVEC_BUILTIN_VEC_MRGHW,
- ALTIVEC_BUILTIN_VEC_MRGLB,
- ALTIVEC_BUILTIN_VEC_MRGLH,
- ALTIVEC_BUILTIN_VEC_MRGLW,
- ALTIVEC_BUILTIN_VEC_MSUM,
- ALTIVEC_BUILTIN_VEC_MSUMS,
- ALTIVEC_BUILTIN_VEC_MTVSCR,
- ALTIVEC_BUILTIN_VEC_MULE,
- ALTIVEC_BUILTIN_VEC_MULO,
- ALTIVEC_BUILTIN_VEC_NEARBYINT,
- ALTIVEC_BUILTIN_VEC_NMSUB,
- ALTIVEC_BUILTIN_VEC_NOR,
- ALTIVEC_BUILTIN_VEC_OR,
- ALTIVEC_BUILTIN_VEC_PACK,
- ALTIVEC_BUILTIN_VEC_PACKPX,
- ALTIVEC_BUILTIN_VEC_PACKS,
- ALTIVEC_BUILTIN_VEC_PACKSU,
- ALTIVEC_BUILTIN_VEC_PERM,
- ALTIVEC_BUILTIN_VEC_RE,
- ALTIVEC_BUILTIN_VEC_RL,
- ALTIVEC_BUILTIN_VEC_RINT,
- ALTIVEC_BUILTIN_VEC_ROUND,
- ALTIVEC_BUILTIN_VEC_RSQRTE,
- ALTIVEC_BUILTIN_VEC_SEL,
- ALTIVEC_BUILTIN_VEC_SL,
- ALTIVEC_BUILTIN_VEC_SLD,
- ALTIVEC_BUILTIN_VEC_SLL,
- ALTIVEC_BUILTIN_VEC_SLO,
- ALTIVEC_BUILTIN_VEC_SPLAT,
- ALTIVEC_BUILTIN_VEC_SPLAT_S16,
- ALTIVEC_BUILTIN_VEC_SPLAT_S32,
- ALTIVEC_BUILTIN_VEC_SPLAT_S8,
- ALTIVEC_BUILTIN_VEC_SPLAT_U16,
- ALTIVEC_BUILTIN_VEC_SPLAT_U32,
- ALTIVEC_BUILTIN_VEC_SPLAT_U8,
- ALTIVEC_BUILTIN_VEC_SPLTB,
- ALTIVEC_BUILTIN_VEC_SPLTH,
- ALTIVEC_BUILTIN_VEC_SPLTW,
- ALTIVEC_BUILTIN_VEC_SQRT,
- ALTIVEC_BUILTIN_VEC_SR,
- ALTIVEC_BUILTIN_VEC_SRA,
- ALTIVEC_BUILTIN_VEC_SRL,
- ALTIVEC_BUILTIN_VEC_SRO,
- ALTIVEC_BUILTIN_VEC_ST,
- ALTIVEC_BUILTIN_VEC_STE,
- ALTIVEC_BUILTIN_VEC_STL,
- ALTIVEC_BUILTIN_VEC_STVEBX,
- ALTIVEC_BUILTIN_VEC_STVEHX,
- ALTIVEC_BUILTIN_VEC_STVEWX,
- ALTIVEC_BUILTIN_VEC_STVLX,
- ALTIVEC_BUILTIN_VEC_STVLXL,
- ALTIVEC_BUILTIN_VEC_STVRX,
- ALTIVEC_BUILTIN_VEC_STVRXL,
- ALTIVEC_BUILTIN_VEC_SUB,
- ALTIVEC_BUILTIN_VEC_SUBC,
- ALTIVEC_BUILTIN_VEC_SUBS,
- ALTIVEC_BUILTIN_VEC_SUM2S,
- ALTIVEC_BUILTIN_VEC_SUM4S,
- ALTIVEC_BUILTIN_VEC_SUMS,
- ALTIVEC_BUILTIN_VEC_TRUNC,
- ALTIVEC_BUILTIN_VEC_UNPACKH,
- ALTIVEC_BUILTIN_VEC_UNPACKL,
- ALTIVEC_BUILTIN_VEC_VADDFP,
- ALTIVEC_BUILTIN_VEC_VADDSBS,
- ALTIVEC_BUILTIN_VEC_VADDSHS,
- ALTIVEC_BUILTIN_VEC_VADDSWS,
- ALTIVEC_BUILTIN_VEC_VADDUBM,
- ALTIVEC_BUILTIN_VEC_VADDUBS,
- ALTIVEC_BUILTIN_VEC_VADDUHM,
- ALTIVEC_BUILTIN_VEC_VADDUHS,
- ALTIVEC_BUILTIN_VEC_VADDUWM,
- ALTIVEC_BUILTIN_VEC_VADDUWS,
- ALTIVEC_BUILTIN_VEC_VAVGSB,
- ALTIVEC_BUILTIN_VEC_VAVGSH,
- ALTIVEC_BUILTIN_VEC_VAVGSW,
- ALTIVEC_BUILTIN_VEC_VAVGUB,
- ALTIVEC_BUILTIN_VEC_VAVGUH,
- ALTIVEC_BUILTIN_VEC_VAVGUW,
- ALTIVEC_BUILTIN_VEC_VCFSX,
- ALTIVEC_BUILTIN_VEC_VCFUX,
- ALTIVEC_BUILTIN_VEC_VCMPEQFP,
- ALTIVEC_BUILTIN_VEC_VCMPEQUB,
- ALTIVEC_BUILTIN_VEC_VCMPEQUH,
- ALTIVEC_BUILTIN_VEC_VCMPEQUW,
- ALTIVEC_BUILTIN_VEC_VCMPGTFP,
- ALTIVEC_BUILTIN_VEC_VCMPGTSB,
- ALTIVEC_BUILTIN_VEC_VCMPGTSH,
- ALTIVEC_BUILTIN_VEC_VCMPGTSW,
- ALTIVEC_BUILTIN_VEC_VCMPGTUB,
- ALTIVEC_BUILTIN_VEC_VCMPGTUH,
- ALTIVEC_BUILTIN_VEC_VCMPGTUW,
- ALTIVEC_BUILTIN_VEC_VMAXFP,
- ALTIVEC_BUILTIN_VEC_VMAXSB,
- ALTIVEC_BUILTIN_VEC_VMAXSH,
- ALTIVEC_BUILTIN_VEC_VMAXSW,
- ALTIVEC_BUILTIN_VEC_VMAXUB,
- ALTIVEC_BUILTIN_VEC_VMAXUH,
- ALTIVEC_BUILTIN_VEC_VMAXUW,
- ALTIVEC_BUILTIN_VEC_VMINFP,
- ALTIVEC_BUILTIN_VEC_VMINSB,
- ALTIVEC_BUILTIN_VEC_VMINSH,
- ALTIVEC_BUILTIN_VEC_VMINSW,
- ALTIVEC_BUILTIN_VEC_VMINUB,
- ALTIVEC_BUILTIN_VEC_VMINUH,
- ALTIVEC_BUILTIN_VEC_VMINUW,
- ALTIVEC_BUILTIN_VEC_VMRGHB,
- ALTIVEC_BUILTIN_VEC_VMRGHH,
- ALTIVEC_BUILTIN_VEC_VMRGHW,
- ALTIVEC_BUILTIN_VEC_VMRGLB,
- ALTIVEC_BUILTIN_VEC_VMRGLH,
- ALTIVEC_BUILTIN_VEC_VMRGLW,
- ALTIVEC_BUILTIN_VEC_VMSUMMBM,
- ALTIVEC_BUILTIN_VEC_VMSUMSHM,
- ALTIVEC_BUILTIN_VEC_VMSUMSHS,
- ALTIVEC_BUILTIN_VEC_VMSUMUBM,
- ALTIVEC_BUILTIN_VEC_VMSUMUHM,
- ALTIVEC_BUILTIN_VEC_VMSUMUHS,
- ALTIVEC_BUILTIN_VEC_VMULESB,
- ALTIVEC_BUILTIN_VEC_VMULESH,
- ALTIVEC_BUILTIN_VEC_VMULEUB,
- ALTIVEC_BUILTIN_VEC_VMULEUH,
- ALTIVEC_BUILTIN_VEC_VMULOSB,
- ALTIVEC_BUILTIN_VEC_VMULOSH,
- ALTIVEC_BUILTIN_VEC_VMULOUB,
- ALTIVEC_BUILTIN_VEC_VMULOUH,
- ALTIVEC_BUILTIN_VEC_VPKSHSS,
- ALTIVEC_BUILTIN_VEC_VPKSHUS,
- ALTIVEC_BUILTIN_VEC_VPKSWSS,
- ALTIVEC_BUILTIN_VEC_VPKSWUS,
- ALTIVEC_BUILTIN_VEC_VPKUHUM,
- ALTIVEC_BUILTIN_VEC_VPKUHUS,
- ALTIVEC_BUILTIN_VEC_VPKUWUM,
- ALTIVEC_BUILTIN_VEC_VPKUWUS,
- ALTIVEC_BUILTIN_VEC_VRLB,
- ALTIVEC_BUILTIN_VEC_VRLH,
- ALTIVEC_BUILTIN_VEC_VRLW,
- ALTIVEC_BUILTIN_VEC_VSLB,
- ALTIVEC_BUILTIN_VEC_VSLH,
- ALTIVEC_BUILTIN_VEC_VSLW,
- ALTIVEC_BUILTIN_VEC_VSPLTB,
- ALTIVEC_BUILTIN_VEC_VSPLTH,
- ALTIVEC_BUILTIN_VEC_VSPLTW,
- ALTIVEC_BUILTIN_VEC_VSRAB,
- ALTIVEC_BUILTIN_VEC_VSRAH,
- ALTIVEC_BUILTIN_VEC_VSRAW,
- ALTIVEC_BUILTIN_VEC_VSRB,
- ALTIVEC_BUILTIN_VEC_VSRH,
- ALTIVEC_BUILTIN_VEC_VSRW,
- ALTIVEC_BUILTIN_VEC_VSUBFP,
- ALTIVEC_BUILTIN_VEC_VSUBSBS,
- ALTIVEC_BUILTIN_VEC_VSUBSHS,
- ALTIVEC_BUILTIN_VEC_VSUBSWS,
- ALTIVEC_BUILTIN_VEC_VSUBUBM,
- ALTIVEC_BUILTIN_VEC_VSUBUBS,
- ALTIVEC_BUILTIN_VEC_VSUBUHM,
- ALTIVEC_BUILTIN_VEC_VSUBUHS,
- ALTIVEC_BUILTIN_VEC_VSUBUWM,
- ALTIVEC_BUILTIN_VEC_VSUBUWS,
- ALTIVEC_BUILTIN_VEC_VSUM4SBS,
- ALTIVEC_BUILTIN_VEC_VSUM4SHS,
- ALTIVEC_BUILTIN_VEC_VSUM4UBS,
- ALTIVEC_BUILTIN_VEC_VUPKHPX,
- ALTIVEC_BUILTIN_VEC_VUPKHSB,
- ALTIVEC_BUILTIN_VEC_VUPKHSH,
- ALTIVEC_BUILTIN_VEC_VUPKLPX,
- ALTIVEC_BUILTIN_VEC_VUPKLSB,
- ALTIVEC_BUILTIN_VEC_VUPKLSH,
- ALTIVEC_BUILTIN_VEC_XOR,
- ALTIVEC_BUILTIN_VEC_STEP,
- ALTIVEC_BUILTIN_VEC_PROMOTE,
- ALTIVEC_BUILTIN_VEC_INSERT,
- ALTIVEC_BUILTIN_VEC_SPLATS,
- ALTIVEC_BUILTIN_OVERLOADED_LAST = ALTIVEC_BUILTIN_VEC_SPLATS,
-
- /* SPE builtins. */
- SPE_BUILTIN_EVADDW,
- SPE_BUILTIN_EVAND,
- SPE_BUILTIN_EVANDC,
- SPE_BUILTIN_EVDIVWS,
- SPE_BUILTIN_EVDIVWU,
- SPE_BUILTIN_EVEQV,
- SPE_BUILTIN_EVFSADD,
- SPE_BUILTIN_EVFSDIV,
- SPE_BUILTIN_EVFSMUL,
- SPE_BUILTIN_EVFSSUB,
- SPE_BUILTIN_EVLDDX,
- SPE_BUILTIN_EVLDHX,
- SPE_BUILTIN_EVLDWX,
- SPE_BUILTIN_EVLHHESPLATX,
- SPE_BUILTIN_EVLHHOSSPLATX,
- SPE_BUILTIN_EVLHHOUSPLATX,
- SPE_BUILTIN_EVLWHEX,
- SPE_BUILTIN_EVLWHOSX,
- SPE_BUILTIN_EVLWHOUX,
- SPE_BUILTIN_EVLWHSPLATX,
- SPE_BUILTIN_EVLWWSPLATX,
- SPE_BUILTIN_EVMERGEHI,
- SPE_BUILTIN_EVMERGEHILO,
- SPE_BUILTIN_EVMERGELO,
- SPE_BUILTIN_EVMERGELOHI,
- SPE_BUILTIN_EVMHEGSMFAA,
- SPE_BUILTIN_EVMHEGSMFAN,
- SPE_BUILTIN_EVMHEGSMIAA,
- SPE_BUILTIN_EVMHEGSMIAN,
- SPE_BUILTIN_EVMHEGUMIAA,
- SPE_BUILTIN_EVMHEGUMIAN,
- SPE_BUILTIN_EVMHESMF,
- SPE_BUILTIN_EVMHESMFA,
- SPE_BUILTIN_EVMHESMFAAW,
- SPE_BUILTIN_EVMHESMFANW,
- SPE_BUILTIN_EVMHESMI,
- SPE_BUILTIN_EVMHESMIA,
- SPE_BUILTIN_EVMHESMIAAW,
- SPE_BUILTIN_EVMHESMIANW,
- SPE_BUILTIN_EVMHESSF,
- SPE_BUILTIN_EVMHESSFA,
- SPE_BUILTIN_EVMHESSFAAW,
- SPE_BUILTIN_EVMHESSFANW,
- SPE_BUILTIN_EVMHESSIAAW,
- SPE_BUILTIN_EVMHESSIANW,
- SPE_BUILTIN_EVMHEUMI,
- SPE_BUILTIN_EVMHEUMIA,
- SPE_BUILTIN_EVMHEUMIAAW,
- SPE_BUILTIN_EVMHEUMIANW,
- SPE_BUILTIN_EVMHEUSIAAW,
- SPE_BUILTIN_EVMHEUSIANW,
- SPE_BUILTIN_EVMHOGSMFAA,
- SPE_BUILTIN_EVMHOGSMFAN,
- SPE_BUILTIN_EVMHOGSMIAA,
- SPE_BUILTIN_EVMHOGSMIAN,
- SPE_BUILTIN_EVMHOGUMIAA,
- SPE_BUILTIN_EVMHOGUMIAN,
- SPE_BUILTIN_EVMHOSMF,
- SPE_BUILTIN_EVMHOSMFA,
- SPE_BUILTIN_EVMHOSMFAAW,
- SPE_BUILTIN_EVMHOSMFANW,
- SPE_BUILTIN_EVMHOSMI,
- SPE_BUILTIN_EVMHOSMIA,
- SPE_BUILTIN_EVMHOSMIAAW,
- SPE_BUILTIN_EVMHOSMIANW,
- SPE_BUILTIN_EVMHOSSF,
- SPE_BUILTIN_EVMHOSSFA,
- SPE_BUILTIN_EVMHOSSFAAW,
- SPE_BUILTIN_EVMHOSSFANW,
- SPE_BUILTIN_EVMHOSSIAAW,
- SPE_BUILTIN_EVMHOSSIANW,
- SPE_BUILTIN_EVMHOUMI,
- SPE_BUILTIN_EVMHOUMIA,
- SPE_BUILTIN_EVMHOUMIAAW,
- SPE_BUILTIN_EVMHOUMIANW,
- SPE_BUILTIN_EVMHOUSIAAW,
- SPE_BUILTIN_EVMHOUSIANW,
- SPE_BUILTIN_EVMWHSMF,
- SPE_BUILTIN_EVMWHSMFA,
- SPE_BUILTIN_EVMWHSMI,
- SPE_BUILTIN_EVMWHSMIA,
- SPE_BUILTIN_EVMWHSSF,
- SPE_BUILTIN_EVMWHSSFA,
- SPE_BUILTIN_EVMWHUMI,
- SPE_BUILTIN_EVMWHUMIA,
- SPE_BUILTIN_EVMWLSMIAAW,
- SPE_BUILTIN_EVMWLSMIANW,
- SPE_BUILTIN_EVMWLSSIAAW,
- SPE_BUILTIN_EVMWLSSIANW,
- SPE_BUILTIN_EVMWLUMI,
- SPE_BUILTIN_EVMWLUMIA,
- SPE_BUILTIN_EVMWLUMIAAW,
- SPE_BUILTIN_EVMWLUMIANW,
- SPE_BUILTIN_EVMWLUSIAAW,
- SPE_BUILTIN_EVMWLUSIANW,
- SPE_BUILTIN_EVMWSMF,
- SPE_BUILTIN_EVMWSMFA,
- SPE_BUILTIN_EVMWSMFAA,
- SPE_BUILTIN_EVMWSMFAN,
- SPE_BUILTIN_EVMWSMI,
- SPE_BUILTIN_EVMWSMIA,
- SPE_BUILTIN_EVMWSMIAA,
- SPE_BUILTIN_EVMWSMIAN,
- SPE_BUILTIN_EVMWHSSFAA,
- SPE_BUILTIN_EVMWSSF,
- SPE_BUILTIN_EVMWSSFA,
- SPE_BUILTIN_EVMWSSFAA,
- SPE_BUILTIN_EVMWSSFAN,
- SPE_BUILTIN_EVMWUMI,
- SPE_BUILTIN_EVMWUMIA,
- SPE_BUILTIN_EVMWUMIAA,
- SPE_BUILTIN_EVMWUMIAN,
- SPE_BUILTIN_EVNAND,
- SPE_BUILTIN_EVNOR,
- SPE_BUILTIN_EVOR,
- SPE_BUILTIN_EVORC,
- SPE_BUILTIN_EVRLW,
- SPE_BUILTIN_EVSLW,
- SPE_BUILTIN_EVSRWS,
- SPE_BUILTIN_EVSRWU,
- SPE_BUILTIN_EVSTDDX,
- SPE_BUILTIN_EVSTDHX,
- SPE_BUILTIN_EVSTDWX,
- SPE_BUILTIN_EVSTWHEX,
- SPE_BUILTIN_EVSTWHOX,
- SPE_BUILTIN_EVSTWWEX,
- SPE_BUILTIN_EVSTWWOX,
- SPE_BUILTIN_EVSUBFW,
- SPE_BUILTIN_EVXOR,
- SPE_BUILTIN_EVABS,
- SPE_BUILTIN_EVADDSMIAAW,
- SPE_BUILTIN_EVADDSSIAAW,
- SPE_BUILTIN_EVADDUMIAAW,
- SPE_BUILTIN_EVADDUSIAAW,
- SPE_BUILTIN_EVCNTLSW,
- SPE_BUILTIN_EVCNTLZW,
- SPE_BUILTIN_EVEXTSB,
- SPE_BUILTIN_EVEXTSH,
- SPE_BUILTIN_EVFSABS,
- SPE_BUILTIN_EVFSCFSF,
- SPE_BUILTIN_EVFSCFSI,
- SPE_BUILTIN_EVFSCFUF,
- SPE_BUILTIN_EVFSCFUI,
- SPE_BUILTIN_EVFSCTSF,
- SPE_BUILTIN_EVFSCTSI,
- SPE_BUILTIN_EVFSCTSIZ,
- SPE_BUILTIN_EVFSCTUF,
- SPE_BUILTIN_EVFSCTUI,
- SPE_BUILTIN_EVFSCTUIZ,
- SPE_BUILTIN_EVFSNABS,
- SPE_BUILTIN_EVFSNEG,
- SPE_BUILTIN_EVMRA,
- SPE_BUILTIN_EVNEG,
- SPE_BUILTIN_EVRNDW,
- SPE_BUILTIN_EVSUBFSMIAAW,
- SPE_BUILTIN_EVSUBFSSIAAW,
- SPE_BUILTIN_EVSUBFUMIAAW,
- SPE_BUILTIN_EVSUBFUSIAAW,
- SPE_BUILTIN_EVADDIW,
- SPE_BUILTIN_EVLDD,
- SPE_BUILTIN_EVLDH,
- SPE_BUILTIN_EVLDW,
- SPE_BUILTIN_EVLHHESPLAT,
- SPE_BUILTIN_EVLHHOSSPLAT,
- SPE_BUILTIN_EVLHHOUSPLAT,
- SPE_BUILTIN_EVLWHE,
- SPE_BUILTIN_EVLWHOS,
- SPE_BUILTIN_EVLWHOU,
- SPE_BUILTIN_EVLWHSPLAT,
- SPE_BUILTIN_EVLWWSPLAT,
- SPE_BUILTIN_EVRLWI,
- SPE_BUILTIN_EVSLWI,
- SPE_BUILTIN_EVSRWIS,
- SPE_BUILTIN_EVSRWIU,
- SPE_BUILTIN_EVSTDD,
- SPE_BUILTIN_EVSTDH,
- SPE_BUILTIN_EVSTDW,
- SPE_BUILTIN_EVSTWHE,
- SPE_BUILTIN_EVSTWHO,
- SPE_BUILTIN_EVSTWWE,
- SPE_BUILTIN_EVSTWWO,
- SPE_BUILTIN_EVSUBIFW,
-
- /* Compares. */
- SPE_BUILTIN_EVCMPEQ,
- SPE_BUILTIN_EVCMPGTS,
- SPE_BUILTIN_EVCMPGTU,
- SPE_BUILTIN_EVCMPLTS,
- SPE_BUILTIN_EVCMPLTU,
- SPE_BUILTIN_EVFSCMPEQ,
- SPE_BUILTIN_EVFSCMPGT,
- SPE_BUILTIN_EVFSCMPLT,
- SPE_BUILTIN_EVFSTSTEQ,
- SPE_BUILTIN_EVFSTSTGT,
- SPE_BUILTIN_EVFSTSTLT,
-
- /* EVSEL compares. */
- SPE_BUILTIN_EVSEL_CMPEQ,
- SPE_BUILTIN_EVSEL_CMPGTS,
- SPE_BUILTIN_EVSEL_CMPGTU,
- SPE_BUILTIN_EVSEL_CMPLTS,
- SPE_BUILTIN_EVSEL_CMPLTU,
- SPE_BUILTIN_EVSEL_FSCMPEQ,
- SPE_BUILTIN_EVSEL_FSCMPGT,
- SPE_BUILTIN_EVSEL_FSCMPLT,
- SPE_BUILTIN_EVSEL_FSTSTEQ,
- SPE_BUILTIN_EVSEL_FSTSTGT,
- SPE_BUILTIN_EVSEL_FSTSTLT,
-
- SPE_BUILTIN_EVSPLATFI,
- SPE_BUILTIN_EVSPLATI,
- SPE_BUILTIN_EVMWHSSMAA,
- SPE_BUILTIN_EVMWHSMFAA,
- SPE_BUILTIN_EVMWHSMIAA,
- SPE_BUILTIN_EVMWHUSIAA,
- SPE_BUILTIN_EVMWHUMIAA,
- SPE_BUILTIN_EVMWHSSFAN,
- SPE_BUILTIN_EVMWHSSIAN,
- SPE_BUILTIN_EVMWHSMFAN,
- SPE_BUILTIN_EVMWHSMIAN,
- SPE_BUILTIN_EVMWHUSIAN,
- SPE_BUILTIN_EVMWHUMIAN,
- SPE_BUILTIN_EVMWHGSSFAA,
- SPE_BUILTIN_EVMWHGSMFAA,
- SPE_BUILTIN_EVMWHGSMIAA,
- SPE_BUILTIN_EVMWHGUMIAA,
- SPE_BUILTIN_EVMWHGSSFAN,
- SPE_BUILTIN_EVMWHGSMFAN,
- SPE_BUILTIN_EVMWHGSMIAN,
- SPE_BUILTIN_EVMWHGUMIAN,
- SPE_BUILTIN_MTSPEFSCR,
- SPE_BUILTIN_MFSPEFSCR,
- SPE_BUILTIN_BRINC,
-
- /* PAIRED builtins. */
- PAIRED_BUILTIN_DIVV2SF3,
- PAIRED_BUILTIN_ABSV2SF2,
- PAIRED_BUILTIN_NEGV2SF2,
- PAIRED_BUILTIN_SQRTV2SF2,
- PAIRED_BUILTIN_ADDV2SF3,
- PAIRED_BUILTIN_SUBV2SF3,
- PAIRED_BUILTIN_RESV2SF2,
- PAIRED_BUILTIN_MULV2SF3,
- PAIRED_BUILTIN_MSUB,
- PAIRED_BUILTIN_MADD,
- PAIRED_BUILTIN_NMSUB,
- PAIRED_BUILTIN_NMADD,
- PAIRED_BUILTIN_NABSV2SF2,
- PAIRED_BUILTIN_SUM0,
- PAIRED_BUILTIN_SUM1,
- PAIRED_BUILTIN_MULS0,
- PAIRED_BUILTIN_MULS1,
- PAIRED_BUILTIN_MERGE00,
- PAIRED_BUILTIN_MERGE01,
- PAIRED_BUILTIN_MERGE10,
- PAIRED_BUILTIN_MERGE11,
- PAIRED_BUILTIN_MADDS0,
- PAIRED_BUILTIN_MADDS1,
- PAIRED_BUILTIN_STX,
- PAIRED_BUILTIN_LX,
- PAIRED_BUILTIN_SELV2SF4,
- PAIRED_BUILTIN_CMPU0,
- PAIRED_BUILTIN_CMPU1,
-
- RS6000_BUILTIN_RECIP,
- RS6000_BUILTIN_RECIPF,
- RS6000_BUILTIN_RSQRTF,
- RS6000_BUILTIN_BSWAP_HI,
-
- /* VSX builtins. */
- VSX_BUILTIN_LXSDX,
- VSX_BUILTIN_LXVD2X,
- VSX_BUILTIN_LXVDSX,
- VSX_BUILTIN_LXVW4X,
- VSX_BUILTIN_STXSDX,
- VSX_BUILTIN_STXVD2X,
- VSX_BUILTIN_STXVW4X,
- VSX_BUILTIN_XSABSDP,
- VSX_BUILTIN_XSADDDP,
- VSX_BUILTIN_XSCMPODP,
- VSX_BUILTIN_XSCMPUDP,
- VSX_BUILTIN_XSCPSGNDP,
- VSX_BUILTIN_XSCVDPSP,
- VSX_BUILTIN_XSCVDPSXDS,
- VSX_BUILTIN_XSCVDPSXWS,
- VSX_BUILTIN_XSCVDPUXDS,
- VSX_BUILTIN_XSCVDPUXWS,
- VSX_BUILTIN_XSCVSPDP,
- VSX_BUILTIN_XSCVSXDDP,
- VSX_BUILTIN_XSCVUXDDP,
- VSX_BUILTIN_XSDIVDP,
- VSX_BUILTIN_XSMADDADP,
- VSX_BUILTIN_XSMADDMDP,
- VSX_BUILTIN_XSMAXDP,
- VSX_BUILTIN_XSMINDP,
- VSX_BUILTIN_XSMOVDP,
- VSX_BUILTIN_XSMSUBADP,
- VSX_BUILTIN_XSMSUBMDP,
- VSX_BUILTIN_XSMULDP,
- VSX_BUILTIN_XSNABSDP,
- VSX_BUILTIN_XSNEGDP,
- VSX_BUILTIN_XSNMADDADP,
- VSX_BUILTIN_XSNMADDMDP,
- VSX_BUILTIN_XSNMSUBADP,
- VSX_BUILTIN_XSNMSUBMDP,
- VSX_BUILTIN_XSRDPI,
- VSX_BUILTIN_XSRDPIC,
- VSX_BUILTIN_XSRDPIM,
- VSX_BUILTIN_XSRDPIP,
- VSX_BUILTIN_XSRDPIZ,
- VSX_BUILTIN_XSREDP,
- VSX_BUILTIN_XSRSQRTEDP,
- VSX_BUILTIN_XSSQRTDP,
- VSX_BUILTIN_XSSUBDP,
- VSX_BUILTIN_CPSGNDP,
- VSX_BUILTIN_CPSGNSP,
- VSX_BUILTIN_XSTDIVDP_FE,
- VSX_BUILTIN_XSTDIVDP_FG,
- VSX_BUILTIN_XSTSQRTDP_FE,
- VSX_BUILTIN_XSTSQRTDP_FG,
- VSX_BUILTIN_XVABSDP,
- VSX_BUILTIN_XVABSSP,
- VSX_BUILTIN_XVADDDP,
- VSX_BUILTIN_XVADDSP,
- VSX_BUILTIN_XVCMPEQDP,
- VSX_BUILTIN_XVCMPEQSP,
- VSX_BUILTIN_XVCMPGEDP,
- VSX_BUILTIN_XVCMPGESP,
- VSX_BUILTIN_XVCMPGTDP,
- VSX_BUILTIN_XVCMPGTSP,
- VSX_BUILTIN_XVCMPEQDP_P,
- VSX_BUILTIN_XVCMPEQSP_P,
- VSX_BUILTIN_XVCMPGEDP_P,
- VSX_BUILTIN_XVCMPGESP_P,
- VSX_BUILTIN_XVCMPGTDP_P,
- VSX_BUILTIN_XVCMPGTSP_P,
- VSX_BUILTIN_XVCPSGNDP,
- VSX_BUILTIN_XVCPSGNSP,
- VSX_BUILTIN_XVCVDPSP,
- VSX_BUILTIN_XVCVDPSXDS,
- VSX_BUILTIN_XVCVDPSXWS,
- VSX_BUILTIN_XVCVDPUXDS,
- VSX_BUILTIN_XVCVDPUXDS_UNS,
- VSX_BUILTIN_XVCVDPUXWS,
- VSX_BUILTIN_XVCVSPDP,
- VSX_BUILTIN_XVCVSPSXDS,
- VSX_BUILTIN_XVCVSPSXWS,
- VSX_BUILTIN_XVCVSPUXDS,
- VSX_BUILTIN_XVCVSPUXWS,
- VSX_BUILTIN_XVCVSXDDP,
- VSX_BUILTIN_XVCVSXDSP,
- VSX_BUILTIN_XVCVSXWDP,
- VSX_BUILTIN_XVCVSXWSP,
- VSX_BUILTIN_XVCVUXDDP,
- VSX_BUILTIN_XVCVUXDDP_UNS,
- VSX_BUILTIN_XVCVUXDSP,
- VSX_BUILTIN_XVCVUXWDP,
- VSX_BUILTIN_XVCVUXWSP,
- VSX_BUILTIN_XVDIVDP,
- VSX_BUILTIN_XVDIVSP,
- VSX_BUILTIN_XVMADDDP,
- VSX_BUILTIN_XVMADDSP,
- VSX_BUILTIN_XVMAXDP,
- VSX_BUILTIN_XVMAXSP,
- VSX_BUILTIN_XVMINDP,
- VSX_BUILTIN_XVMINSP,
- VSX_BUILTIN_XVMSUBDP,
- VSX_BUILTIN_XVMSUBSP,
- VSX_BUILTIN_XVMULDP,
- VSX_BUILTIN_XVMULSP,
- VSX_BUILTIN_XVNABSDP,
- VSX_BUILTIN_XVNABSSP,
- VSX_BUILTIN_XVNEGDP,
- VSX_BUILTIN_XVNEGSP,
- VSX_BUILTIN_XVNMADDDP,
- VSX_BUILTIN_XVNMADDSP,
- VSX_BUILTIN_XVNMSUBDP,
- VSX_BUILTIN_XVNMSUBSP,
- VSX_BUILTIN_XVRDPI,
- VSX_BUILTIN_XVRDPIC,
- VSX_BUILTIN_XVRDPIM,
- VSX_BUILTIN_XVRDPIP,
- VSX_BUILTIN_XVRDPIZ,
- VSX_BUILTIN_XVREDP,
- VSX_BUILTIN_XVRESP,
- VSX_BUILTIN_XVRSPI,
- VSX_BUILTIN_XVRSPIC,
- VSX_BUILTIN_XVRSPIM,
- VSX_BUILTIN_XVRSPIP,
- VSX_BUILTIN_XVRSPIZ,
- VSX_BUILTIN_XVRSQRTEDP,
- VSX_BUILTIN_XVRSQRTESP,
- VSX_BUILTIN_XVSQRTDP,
- VSX_BUILTIN_XVSQRTSP,
- VSX_BUILTIN_XVSUBDP,
- VSX_BUILTIN_XVSUBSP,
- VSX_BUILTIN_XVTDIVDP_FE,
- VSX_BUILTIN_XVTDIVDP_FG,
- VSX_BUILTIN_XVTDIVSP_FE,
- VSX_BUILTIN_XVTDIVSP_FG,
- VSX_BUILTIN_XVTSQRTDP_FE,
- VSX_BUILTIN_XVTSQRTDP_FG,
- VSX_BUILTIN_XVTSQRTSP_FE,
- VSX_BUILTIN_XVTSQRTSP_FG,
- VSX_BUILTIN_XXSEL_2DI,
- VSX_BUILTIN_XXSEL_2DF,
- VSX_BUILTIN_XXSEL_4SI,
- VSX_BUILTIN_XXSEL_4SF,
- VSX_BUILTIN_XXSEL_8HI,
- VSX_BUILTIN_XXSEL_16QI,
- VSX_BUILTIN_XXSEL_2DI_UNS,
- VSX_BUILTIN_XXSEL_4SI_UNS,
- VSX_BUILTIN_XXSEL_8HI_UNS,
- VSX_BUILTIN_XXSEL_16QI_UNS,
- VSX_BUILTIN_VPERM_2DI,
- VSX_BUILTIN_VPERM_2DF,
- VSX_BUILTIN_VPERM_4SI,
- VSX_BUILTIN_VPERM_4SF,
- VSX_BUILTIN_VPERM_8HI,
- VSX_BUILTIN_VPERM_16QI,
- VSX_BUILTIN_VPERM_2DI_UNS,
- VSX_BUILTIN_VPERM_4SI_UNS,
- VSX_BUILTIN_VPERM_8HI_UNS,
- VSX_BUILTIN_VPERM_16QI_UNS,
- VSX_BUILTIN_XXPERMDI_2DF,
- VSX_BUILTIN_XXPERMDI_2DI,
- VSX_BUILTIN_XXPERMDI_4SF,
- VSX_BUILTIN_XXPERMDI_4SI,
- VSX_BUILTIN_XXPERMDI_8HI,
- VSX_BUILTIN_XXPERMDI_16QI,
- VSX_BUILTIN_CONCAT_2DF,
- VSX_BUILTIN_CONCAT_2DI,
- VSX_BUILTIN_SET_2DF,
- VSX_BUILTIN_SET_2DI,
- VSX_BUILTIN_SPLAT_2DF,
- VSX_BUILTIN_SPLAT_2DI,
- VSX_BUILTIN_XXMRGHW_4SF,
- VSX_BUILTIN_XXMRGHW_4SI,
- VSX_BUILTIN_XXMRGLW_4SF,
- VSX_BUILTIN_XXMRGLW_4SI,
- VSX_BUILTIN_XXSLDWI_16QI,
- VSX_BUILTIN_XXSLDWI_8HI,
- VSX_BUILTIN_XXSLDWI_4SI,
- VSX_BUILTIN_XXSLDWI_4SF,
- VSX_BUILTIN_XXSLDWI_2DI,
- VSX_BUILTIN_XXSLDWI_2DF,
- VSX_BUILTIN_VEC_INIT_V2DF,
- VSX_BUILTIN_VEC_INIT_V2DI,
- VSX_BUILTIN_VEC_SET_V2DF,
- VSX_BUILTIN_VEC_SET_V2DI,
- VSX_BUILTIN_VEC_EXT_V2DF,
- VSX_BUILTIN_VEC_EXT_V2DI,
-
- /* VSX overloaded builtins, add the overloaded functions not present in
- Altivec. */
- VSX_BUILTIN_VEC_MUL,
- VSX_BUILTIN_OVERLOADED_FIRST = VSX_BUILTIN_VEC_MUL,
- VSX_BUILTIN_VEC_MSUB,
- VSX_BUILTIN_VEC_NMADD,
- VSX_BUITLIN_VEC_NMSUB,
- VSX_BUILTIN_VEC_DIV,
- VSX_BUILTIN_VEC_XXMRGHW,
- VSX_BUILTIN_VEC_XXMRGLW,
- VSX_BUILTIN_VEC_XXPERMDI,
- VSX_BUILTIN_VEC_XXSLDWI,
- VSX_BUILTIN_VEC_XXSPLTD,
- VSX_BUILTIN_VEC_XXSPLTW,
- VSX_BUILTIN_OVERLOADED_LAST = VSX_BUILTIN_VEC_XXSPLTW,
-
- /* Combined VSX/Altivec builtins. */
- VECTOR_BUILTIN_FLOAT_V4SI_V4SF,
- VECTOR_BUILTIN_UNSFLOAT_V4SI_V4SF,
- VECTOR_BUILTIN_FIX_V4SF_V4SI,
- VECTOR_BUILTIN_FIXUNS_V4SF_V4SI,
-
- /* Power7 builtins, that aren't VSX instructions. */
- POWER7_BUILTIN_BPERMD,
+#include "rs6000-builtin.def"
RS6000_BUILTIN_COUNT
};
+#undef RS6000_BUILTIN
+#undef RS6000_BUILTIN_EQUATE
+
enum rs6000_builtin_type_index
{
RS6000_BTI_NOT_OPAQUE,
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index ba51f1cebc7..7ff1b3c1a47 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -117,7 +117,7 @@
;; Define an insn type attribute. This is used in function unit delay
;; computations.
-(define_attr "type" "integer,two,three,load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u,store,store_ux,store_u,fpload,fpload_ux,fpload_u,fpstore,fpstore_ux,fpstore_u,vecload,vecstore,imul,imul2,imul3,lmul,idiv,ldiv,insert_word,branch,cmp,fast_compare,compare,var_delayed_compare,delayed_compare,imul_compare,lmul_compare,fpcompare,cr_logical,delayed_cr,mfcr,mfcrf,mtcr,mfjmpr,mtjmpr,fp,fpsimple,dmul,sdiv,ddiv,ssqrt,dsqrt,jmpreg,brinc,vecsimple,veccomplex,vecdiv,veccmp,veccmpsimple,vecperm,vecfloat,vecfdiv,isync,sync,load_l,store_c,shift,trap,insert_dword,var_shift_rotate,cntlz,exts,mffgpr,mftgpr"
+(define_attr "type" "integer,two,three,load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u,store,store_ux,store_u,fpload,fpload_ux,fpload_u,fpstore,fpstore_ux,fpstore_u,vecload,vecstore,imul,imul2,imul3,lmul,idiv,ldiv,insert_word,branch,cmp,fast_compare,compare,var_delayed_compare,delayed_compare,imul_compare,lmul_compare,fpcompare,cr_logical,delayed_cr,mfcr,mfcrf,mtcr,mfjmpr,mtjmpr,fp,fpsimple,dmul,sdiv,ddiv,ssqrt,dsqrt,jmpreg,brinc,vecsimple,veccomplex,vecdiv,veccmp,veccmpsimple,vecperm,vecfloat,vecfdiv,isync,sync,load_l,store_c,shift,trap,insert_dword,var_shift_rotate,cntlz,exts,mffgpr,mftgpr,isel"
(const_string "integer"))
;; Define floating point instruction sub-types for use with Xfpu.md
@@ -139,7 +139,7 @@
;; Processor type -- this attribute must exactly match the processor_type
;; enumeration in rs6000.h.
-(define_attr "cpu" "rios1,rios2,rs64a,mpccore,ppc403,ppc405,ppc440,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400,ppc7450,ppc8540,ppce300c2,ppce300c3,ppce500mc,power4,power5,power6,power7,cell"
+(define_attr "cpu" "rios1,rios2,rs64a,mpccore,ppc403,ppc405,ppc440,ppc476,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400,ppc7450,ppc8540,ppce300c2,ppce300c3,ppce500mc,power4,power5,power6,power7,cell,ppca2"
(const (symbol_ref "rs6000_cpu_attr")))
@@ -158,6 +158,7 @@
(include "mpc.md")
(include "40x.md")
(include "440.md")
+(include "476.md")
(include "603.md")
(include "6xx.md")
(include "7xx.md")
@@ -171,6 +172,7 @@
(include "power7.md")
(include "cell.md")
(include "xfpu.md")
+(include "a2.md")
(include "predicates.md")
(include "constraints.md")
@@ -974,7 +976,7 @@
[(set_attr "type" "compare")
(set_attr "length" "4,8")])
-;; IBM 405, 440 and 464 half-word multiplication operations.
+;; IBM 405, 440, 464 and 476 half-word multiplication operations.
(define_insn "*macchwc"
[(set (match_operand:CC 3 "cc_reg_operand" "=x")
@@ -1438,7 +1440,7 @@
"mullhwu %0, %1, %2"
[(set_attr "type" "imul3")])
-;; IBM 405, 440 and 464 string-search dlmzb instruction support.
+;; IBM 405, 440, 464 and 476 string-search dlmzb instruction support.
(define_insn "dlmzb"
[(set (match_operand:CC 3 "cc_reg_operand" "=x")
(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
@@ -6040,7 +6042,8 @@
"TARGET_ISEL<sel>"
"*
{ return output_isel (operands); }"
- [(set_attr "length" "4")])
+ [(set_attr "type" "isel")
+ (set_attr "length" "4")])
(define_insn "isel_unsigned_<mode>"
[(set (match_operand:GPR 0 "gpc_reg_operand" "=r")
@@ -6053,7 +6056,8 @@
"TARGET_ISEL<sel>"
"*
{ return output_isel (operands); }"
- [(set_attr "length" "4")])
+ [(set_attr "type" "isel")
+ (set_attr "length" "4")])
(define_expand "movsfcc"
[(set (match_operand:SF 0 "gpc_reg_operand" "")
diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt
index 90af9dce47b..63f0f8c1582 100644
--- a/gcc/config/rs6000/rs6000.opt
+++ b/gcc/config/rs6000/rs6000.opt
@@ -155,8 +155,12 @@ mvectorize-builtins
Target Undocumented Report Var(TARGET_VECTORIZE_BUILTINS) Init(-1)
; Explicitly control whether we vectorize the builtins or not.
+mno-update
+Target Report RejectNegative Mask(NO_UPDATE)
+Do not generate load/store with update instructions
+
mupdate
-Target Report Var(TARGET_UPDATE) Init(1)
+Target Report RejectNegative InverseMask(NO_UPDATE, UPDATE)
Generate load/store with update instructions
mavoid-indexed-addresses
diff --git a/gcc/config/rs6000/rs64.md b/gcc/config/rs6000/rs64.md
index f7234408ade..e221b52a370 100644
--- a/gcc/config/rs6000/rs64.md
+++ b/gcc/config/rs6000/rs64.md
@@ -1,5 +1,5 @@
;; Scheduling description for IBM RS64 processors.
-;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2007, 2009 Free Software Foundation, Inc.
;;
;; This file is part of GCC.
@@ -47,7 +47,7 @@
(define_insn_reservation "rs64a-integer" 1
(and (eq_attr "type" "integer,insert_word,insert_dword,shift,trap,\
- var_shift_rotate,cntlz,exts")
+ var_shift_rotate,cntlz,exts,isel")
(eq_attr "cpu" "rs64a"))
"iu_rs64")
diff --git a/gcc/config/rs6000/t-fprules b/gcc/config/rs6000/t-fprules
index 272e00c1ada..42d8fd77b5b 100644
--- a/gcc/config/rs6000/t-fprules
+++ b/gcc/config/rs6000/t-fprules
@@ -21,6 +21,7 @@ MULTILIB_MATCHES_FLOAT = msoft-float=mcpu?401 \
msoft-float=mcpu?405 \
msoft-float=mcpu?440 \
msoft-float=mcpu?464 \
+ msoft-float=mcpu?476 \
msoft-float=mcpu?ec603e \
msoft-float=mcpu?801 \
msoft-float=mcpu?821 \
diff --git a/gcc/config/rs6000/t-rs6000 b/gcc/config/rs6000/t-rs6000
index 66a367a7b62..773d710fa3f 100644
--- a/gcc/config/rs6000/t-rs6000
+++ b/gcc/config/rs6000/t-rs6000
@@ -19,6 +19,8 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
+TM_H += $(srcdir)/config/rs6000/rs6000-builtin.def
+
rs6000.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(REGS_H) hard-reg-set.h \
real.h insn-config.h conditions.h insn-attr.h flags.h $(RECOG_H) \
@@ -56,6 +58,7 @@ MD_INCLUDES = $(srcdir)/config/rs6000/rios1.md \
$(srcdir)/config/rs6000/power7.md \
$(srcdir)/config/rs6000/cell.md \
$(srcdir)/config/rs6000/xfpu.md \
+ $(srcdir)/config/rs6000/a2.md \
$(srcdir)/config/rs6000/predicates.md \
$(srcdir)/config/rs6000/constraints.md \
$(srcdir)/config/rs6000/darwin.md \
diff --git a/gcc/config/rs6000/vxworks.h b/gcc/config/rs6000/vxworks.h
index cfd11eb6d79..c302ad2015d 100644
--- a/gcc/config/rs6000/vxworks.h
+++ b/gcc/config/rs6000/vxworks.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler. Vxworks PowerPC version.
- Copyright (C) 1996, 2000, 2002, 2003, 2004, 2005, 2007
+ Copyright (C) 1996, 2000, 2002, 2003, 2004, 2005, 2007, 2009
Free Software Foundation, Inc.
Contributed by CodeSourcery, LLC.
@@ -68,6 +68,8 @@ along with GCC; see the file COPYING3. If not see
%{mcpu=403 : -DCPU=PPC403 ; \
mcpu=405 : -DCPU=PPC405 ; \
mcpu=440 : -DCPU=PPC440 ; \
+ mcpu=464 : -DCPU=PPC464 ; \
+ mcpu=476 : -DCPU=PPC476 ; \
mcpu=603 : -DCPU=PPC603 ; \
mcpu=604 : -DCPU=PPC604 ; \
mcpu=860 : -DCPU=PPC860 ; \
diff --git a/gcc/config/rx/constraints.md b/gcc/config/rx/constraints.md
new file mode 100644
index 00000000000..52bf7df3621
--- /dev/null
+++ b/gcc/config/rx/constraints.md
@@ -0,0 +1,81 @@
+;; Constraint definitions for Renesas RX.
+;; Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+;; Contributed by Red Hat.
+;;
+;; This file is part of GCC.
+;;
+;; GCC is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+;;
+;; GCC is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with GCC; see the file COPYING3. If not see
+;; <http://www.gnu.org/licenses/>.
+
+
+(define_constraint "Symbol"
+ "@internal Constraint on the type of rtx allowed in call insns"
+ (match_test "GET_CODE (op) == SYMBOL_REF")
+)
+
+
+(define_constraint "Int08"
+ "@internal A signed or unsigned 8-bit immediate value"
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, (-1 << 8), (1 << 8) - 1)")
+ )
+)
+
+(define_constraint "Sint08"
+ "@internal A signed 8-bit immediate value"
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, (-1 << 7), (1 << 7) - 1)")
+ )
+)
+
+(define_constraint "Sint16"
+ "@internal A signed 16-bit immediate value"
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, (-1 << 15), (1 << 15) - 1)")
+ )
+)
+
+(define_constraint "Sint24"
+ "@internal A signed 24-bit immediate value"
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, (-1 << 23), (1 << 23) - 1)")
+ )
+)
+
+;; This constraint is used by the SUBSI3 pattern because the
+;; RX SUB instruction can only take a 4-bit unsigned integer
+;; value. Also used by the MVTIPL instruction.
+(define_constraint "Uint04"
+ "@internal An unsigned 4-bit immediate value"
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, 0, 15)")
+ )
+)
+
+;; This is used in arithmetic and logic instructions for
+;; a source operand that lies in memory and which satisfies
+;; rx_restricted_memory_address().
+
+(define_memory_constraint "Q"
+ "A MEM which only uses REG or REG+INT addressing."
+ (and (match_code "mem")
+ (ior (match_code "reg" "0")
+ (and (match_code "plus" "0")
+ (and (match_code "reg,subreg" "00")
+ (match_code "const_int" "01")
+ )
+ )
+ )
+ )
+)
diff --git a/gcc/config/rx/predicates.md b/gcc/config/rx/predicates.md
new file mode 100644
index 00000000000..d7a363ebb88
--- /dev/null
+++ b/gcc/config/rx/predicates.md
@@ -0,0 +1,288 @@
+;; Predicate definitions for Renesas RX.
+;; Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+;; Contributed by Red Hat.
+;;
+;; 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/>.
+
+
+
+;; Check that the operand is suitable for a call insn.
+;; Only registers and symbol refs are allowed.
+
+(define_predicate "rx_call_operand"
+ (match_code "symbol_ref,reg")
+)
+
+;; For sibcall operations we can only use a symbolic address.
+
+(define_predicate "rx_symbolic_call_operand"
+ (match_code "symbol_ref")
+)
+
+;; Check that the operand is suitable for a shift insn
+;; Only small integers or a value in a register are permitted.
+
+(define_predicate "rx_shift_operand"
+ (match_code "const_int,reg")
+ {
+ if (CONST_INT_P (op))
+ return IN_RANGE (INTVAL (op), 0, 31);
+ return true;
+ }
+)
+
+;; Check that the operand is suitable as the source operand
+;; for a logic or arithmeitc instruction. Registers, integers
+;; and a restricted subset of memory addresses are allowed.
+
+(define_predicate "rx_source_operand"
+ (match_code "const_int,reg,mem")
+ {
+ if (CONST_INT_P (op))
+ return rx_is_legitimate_constant (op);
+
+ if (! MEM_P (op))
+ return true;
+
+ /* Do not allow size conversions whilst accessing memory. */
+ if (GET_MODE (op) != mode)
+ return false;
+
+ return rx_is_restricted_memory_address (XEXP (op, 0), mode);
+ }
+)
+
+;; Check that the operand is suitable as the source operand
+;; for a comparison instruction. This is the same as
+;; rx_source_operand except that SUBREGs are allowed but
+;; CONST_INTs are not.
+
+(define_predicate "rx_compare_operand"
+ (match_code "subreg,reg,mem")
+ {
+ if (GET_CODE (op) == SUBREG)
+ return REG_P (XEXP (op, 0));
+
+ if (! MEM_P (op))
+ return true;
+
+ return rx_is_restricted_memory_address (XEXP (op, 0), mode);
+ }
+)
+
+;; Return true if OP is a store multiple operation. This looks like:
+;;
+;; [(set (SP) (MINUS (SP) (INT)))
+;; (set (MEM (SP)) (REG))
+;; (set (MEM (MINUS (SP) (INT))) (REG)) {optionally repeated}
+;; ]
+
+(define_special_predicate "rx_store_multiple_vector"
+ (match_code "parallel")
+{
+ int count = XVECLEN (op, 0);
+ unsigned int src_regno;
+ rtx element;
+ int i;
+
+ /* Perform a quick check so we don't blow up below. */
+ if (count <= 2)
+ return false;
+
+ /* Check that the first element of the vector is the stack adjust. */
+ element = XVECEXP (op, 0, 0);
+ if ( ! SET_P (element)
+ || ! REG_P (SET_DEST (element))
+ || REGNO (SET_DEST (element)) != SP_REG
+ || GET_CODE (SET_SRC (element)) != MINUS
+ || ! REG_P (XEXP (SET_SRC (element), 0))
+ || REGNO (XEXP (SET_SRC (element), 0)) != SP_REG
+ || ! CONST_INT_P (XEXP (SET_SRC (element), 1)))
+ return false;
+
+ /* Check that the next element is the first push. */
+ element = XVECEXP (op, 0, 1);
+ if ( ! SET_P (element)
+ || ! REG_P (SET_SRC (element))
+ || GET_MODE (SET_SRC (element)) != SImode
+ || ! MEM_P (SET_DEST (element))
+ || GET_MODE (SET_DEST (element)) != SImode
+ || GET_CODE (XEXP (SET_DEST (element), 0)) != MINUS
+ || ! REG_P (XEXP (XEXP (SET_DEST (element), 0), 0))
+ || REGNO (XEXP (XEXP (SET_DEST (element), 0), 0)) != SP_REG
+ || ! CONST_INT_P (XEXP (XEXP (SET_DEST (element), 0), 1))
+ || INTVAL (XEXP (XEXP (SET_DEST (element), 0), 1))
+ != GET_MODE_SIZE (SImode))
+ return false;
+
+ src_regno = REGNO (SET_SRC (element));
+
+ /* Check that the remaining elements use SP-<disp>
+ addressing and decreasing register numbers. */
+ for (i = 2; i < count; i++)
+ {
+ element = XVECEXP (op, 0, i);
+
+ if ( ! SET_P (element)
+ || ! REG_P (SET_SRC (element))
+ || GET_MODE (SET_SRC (element)) != SImode
+ || REGNO (SET_SRC (element)) != src_regno - (i - 1)
+ || ! MEM_P (SET_DEST (element))
+ || GET_MODE (SET_DEST (element)) != SImode
+ || GET_CODE (XEXP (SET_DEST (element), 0)) != MINUS
+ || ! REG_P (XEXP (XEXP (SET_DEST (element), 0), 0))
+ || REGNO (XEXP (XEXP (SET_DEST (element), 0), 0)) != SP_REG
+ || ! CONST_INT_P (XEXP (XEXP (SET_DEST (element), 0), 1))
+ || INTVAL (XEXP (XEXP (SET_DEST (element), 0), 1))
+ != i * GET_MODE_SIZE (SImode))
+ return false;
+ }
+ return true;
+})
+
+;; Return true if OP is a load multiple operation.
+;; This looks like:
+;; [(set (SP) (PLUS (SP) (INT)))
+;; (set (REG) (MEM (SP)))
+;; (set (REG) (MEM (PLUS (SP) (INT)))) {optionally repeated}
+;; ]
+
+(define_special_predicate "rx_load_multiple_vector"
+ (match_code "parallel")
+{
+ int count = XVECLEN (op, 0);
+ unsigned int dest_regno;
+ rtx element;
+ int i;
+
+ /* Perform a quick check so we don't blow up below. */
+ if (count <= 2)
+ return false;
+
+ /* Check that the first element of the vector is the stack adjust. */
+ element = XVECEXP (op, 0, 0);
+ if ( ! SET_P (element)
+ || ! REG_P (SET_DEST (element))
+ || REGNO (SET_DEST (element)) != SP_REG
+ || GET_CODE (SET_SRC (element)) != PLUS
+ || ! REG_P (XEXP (SET_SRC (element), 0))
+ || REGNO (XEXP (SET_SRC (element), 0)) != SP_REG
+ || ! CONST_INT_P (XEXP (SET_SRC (element), 1)))
+ return false;
+
+ /* Check that the next element is the first push. */
+ element = XVECEXP (op, 0, 1);
+ if ( ! SET_P (element)
+ || ! REG_P (SET_DEST (element))
+ || ! MEM_P (SET_SRC (element))
+ || ! REG_P (XEXP (SET_SRC (element), 0))
+ || REGNO (XEXP (SET_SRC (element), 0)) != SP_REG)
+ return false;
+
+ dest_regno = REGNO (SET_DEST (element));
+
+ /* Check that the remaining elements use SP+<disp>
+ addressing and incremental register numbers. */
+ for (i = 2; i < count; i++)
+ {
+ element = XVECEXP (op, 0, i);
+
+ if ( ! SET_P (element)
+ || ! REG_P (SET_DEST (element))
+ || GET_MODE (SET_DEST (element)) != SImode
+ || REGNO (SET_DEST (element)) != dest_regno + (i - 1)
+ || ! MEM_P (SET_SRC (element))
+ || GET_MODE (SET_SRC (element)) != SImode
+ || GET_CODE (XEXP (SET_SRC (element), 0)) != PLUS
+ || ! REG_P (XEXP (XEXP (SET_SRC (element), 0), 0))
+ || REGNO (XEXP (XEXP (SET_SRC (element), 0), 0)) != SP_REG
+ || ! CONST_INT_P (XEXP (XEXP (SET_SRC (element), 0), 1))
+ || INTVAL (XEXP (XEXP (SET_SRC (element), 0), 1))
+ != (i - 1) * GET_MODE_SIZE (SImode))
+ return false;
+ }
+ return true;
+})
+
+;; Return true if OP is a pop-and-return load multiple operation.
+;; This looks like:
+;; [(set (SP) (PLUS (SP) (INT)))
+;; (set (REG) (MEM (SP)))
+;; (set (REG) (MEM (PLUS (SP) (INT)))) {optional and possibly repeated}
+;; (return)
+;; ]
+
+(define_special_predicate "rx_rtsd_vector"
+ (match_code "parallel")
+{
+ int count = XVECLEN (op, 0);
+ unsigned int dest_regno;
+ rtx element;
+ int i;
+
+ /* Perform a quick check so we don't blow up below. */
+ if (count <= 2)
+ return false;
+
+ /* Check that the first element of the vector is the stack adjust. */
+ element = XVECEXP (op, 0, 0);
+ if ( ! SET_P (element)
+ || ! REG_P (SET_DEST (element))
+ || REGNO (SET_DEST (element)) != SP_REG
+ || GET_CODE (SET_SRC (element)) != PLUS
+ || ! REG_P (XEXP (SET_SRC (element), 0))
+ || REGNO (XEXP (SET_SRC (element), 0)) != SP_REG
+ || ! CONST_INT_P (XEXP (SET_SRC (element), 1)))
+ return false;
+
+ /* Check that the next element is the first push. */
+ element = XVECEXP (op, 0, 1);
+ if ( ! SET_P (element)
+ || ! REG_P (SET_DEST (element))
+ || ! MEM_P (SET_SRC (element))
+ || ! REG_P (XEXP (SET_SRC (element), 0))
+ || REGNO (XEXP (SET_SRC (element), 0)) != SP_REG)
+ return false;
+
+ dest_regno = REGNO (SET_DEST (element));
+
+ /* Check that the remaining elements, if any, and except
+ for the last one, use SP+<disp> addressing and incremental
+ register numbers. */
+ for (i = 2; i < count - 1; i++)
+ {
+ element = XVECEXP (op, 0, i);
+
+ if ( ! SET_P (element)
+ || ! REG_P (SET_DEST (element))
+ || GET_MODE (SET_DEST (element)) != SImode
+ || REGNO (SET_DEST (element)) != dest_regno + (i - 1)
+ || ! MEM_P (SET_SRC (element))
+ || GET_MODE (SET_SRC (element)) != SImode
+ || GET_CODE (XEXP (SET_SRC (element), 0)) != PLUS
+ || ! REG_P (XEXP (XEXP (SET_SRC (element), 0), 0))
+ || REGNO (XEXP (XEXP (SET_SRC (element), 0), 0)) != SP_REG
+ || ! CONST_INT_P (XEXP (XEXP (SET_SRC (element), 0), 1))
+ || INTVAL (XEXP (XEXP (SET_SRC (element), 0), 1))
+ != (i - 1) * GET_MODE_SIZE (SImode))
+ return false;
+ }
+
+ /* The last element must be a RETURN. */
+ element = XVECEXP (op, 0, count - 1);
+ return GET_CODE (element) == RETURN;
+})
diff --git a/gcc/config/rx/rx-protos.h b/gcc/config/rx/rx-protos.h
new file mode 100644
index 00000000000..5c37fe0a83c
--- /dev/null
+++ b/gcc/config/rx/rx-protos.h
@@ -0,0 +1,52 @@
+/* Exported function prototypes from the Renesas RX backend.
+ Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+ Contributed by Red Hat.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef GCC_RX_PROTOS_H
+#define GCC_RX_PROTOS_H
+
+/* A few abbreviations to make the prototypes shorter. */
+#define Mmode enum machine_mode
+#define Fargs CUMULATIVE_ARGS
+
+extern void rx_conditional_register_usage (void);
+extern void rx_expand_prologue (void);
+extern int rx_initial_elimination_offset (int, int);
+
+#ifdef RTX_CODE
+extern void rx_emit_stack_popm (rtx *, bool);
+extern void rx_emit_stack_pushm (rtx *);
+extern void rx_expand_epilogue (bool);
+extern bool rx_expand_insv (rtx *);
+extern const char * rx_gen_cond_branch_template (rtx, bool);
+extern char * rx_gen_move_template (rtx *, bool);
+extern bool rx_is_legitimate_constant (rtx);
+extern bool rx_is_mode_dependent_addr (rtx);
+extern bool rx_is_restricted_memory_address (rtx, Mmode);
+extern void rx_notice_update_cc (rtx body, rtx insn);
+extern void rx_print_operand (FILE *, rtx, int);
+extern void rx_print_operand_address (FILE *, rtx);
+#endif
+
+#ifdef TREE_CODE
+extern unsigned int rx_function_arg_size (Mmode, const_tree);
+extern struct rtx_def * rx_function_arg (Fargs *, Mmode, const_tree, bool);
+#endif
+
+#endif /* GCC_RX_PROTOS_H */
diff --git a/gcc/config/rx/rx.c b/gcc/config/rx/rx.c
new file mode 100644
index 00000000000..885f52581de
--- /dev/null
+++ b/gcc/config/rx/rx.c
@@ -0,0 +1,2517 @@
+/* Subroutines used for code generation on Renesas RX processors.
+ Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+ Contributed by Red Hat.
+
+ 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/>. */
+
+/* To Do:
+
+ * Re-enable memory-to-memory copies and fix up reload. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "tree.h"
+#include "rtl.h"
+#include "regs.h"
+#include "hard-reg-set.h"
+#include "real.h"
+#include "insn-config.h"
+#include "conditions.h"
+#include "output.h"
+#include "insn-attr.h"
+#include "flags.h"
+#include "function.h"
+#include "expr.h"
+#include "optabs.h"
+#include "libfuncs.h"
+#include "recog.h"
+#include "toplev.h"
+#include "reload.h"
+#include "df.h"
+#include "ggc.h"
+#include "tm_p.h"
+#include "debug.h"
+#include "target.h"
+#include "target-def.h"
+#include "langhooks.h"
+
+enum rx_cpu_types rx_cpu_type = RX600;
+
+/* Return true if OP is a reference to an object in a small data area. */
+
+static bool
+rx_small_data_operand (rtx op)
+{
+ if (rx_small_data_limit == 0)
+ return false;
+
+ if (GET_CODE (op) == SYMBOL_REF)
+ return SYMBOL_REF_SMALL_P (op);
+
+ return false;
+}
+
+static bool
+rx_is_legitimate_address (Mmode mode, rtx x, bool strict ATTRIBUTE_UNUSED)
+{
+ if (RTX_OK_FOR_BASE (x, strict))
+ /* Register Indirect. */
+ return true;
+
+ if (GET_MODE_SIZE (mode) == 4
+ && (GET_CODE (x) == PRE_DEC || GET_CODE (x) == POST_INC))
+ /* Pre-decrement Register Indirect or
+ Post-increment Register Indirect. */
+ return RTX_OK_FOR_BASE (XEXP (x, 0), strict);
+
+ if (GET_CODE (x) == PLUS)
+ {
+ rtx arg1 = XEXP (x, 0);
+ rtx arg2 = XEXP (x, 1);
+ rtx index = NULL_RTX;
+
+ if (REG_P (arg1) && RTX_OK_FOR_BASE (arg1, strict))
+ index = arg2;
+ else if (REG_P (arg2) && RTX_OK_FOR_BASE (arg2, strict))
+ index = arg1;
+ else
+ return false;
+
+ switch (GET_CODE (index))
+ {
+ case CONST_INT:
+ {
+ /* Register Relative: REG + INT.
+ Only positive, mode-aligned, mode-sized
+ displacements are allowed. */
+ HOST_WIDE_INT val = INTVAL (index);
+ int factor;
+
+ if (val < 0)
+ return false;
+
+ switch (GET_MODE_SIZE (mode))
+ {
+ default:
+ case 4: factor = 4; break;
+ case 2: factor = 2; break;
+ case 1: factor = 1; break;
+ }
+
+ if (val > (65535 * factor))
+ return false;
+ return (val % factor) == 0;
+ }
+
+ case REG:
+ /* Unscaled Indexed Register Indirect: REG + REG
+ Size has to be "QI", REG has to be valid. */
+ return GET_MODE_SIZE (mode) == 1 && RTX_OK_FOR_BASE (index, strict);
+
+ case MULT:
+ {
+ /* Scaled Indexed Register Indirect: REG + (REG * FACTOR)
+ Factor has to equal the mode size, REG has to be valid. */
+ rtx factor;
+
+ factor = XEXP (index, 1);
+ index = XEXP (index, 0);
+
+ return REG_P (index)
+ && RTX_OK_FOR_BASE (index, strict)
+ && CONST_INT_P (factor)
+ && GET_MODE_SIZE (mode) == INTVAL (factor);
+ }
+
+ default:
+ return false;
+ }
+ }
+
+ /* Small data area accesses turn into register relative offsets. */
+ return rx_small_data_operand (x);
+}
+
+/* Returns TRUE for simple memory addreses, ie ones
+ that do not involve register indirect addressing
+ or pre/post increment/decrement. */
+
+bool
+rx_is_restricted_memory_address (rtx mem, enum machine_mode mode)
+{
+ rtx base, index;
+
+ if (! rx_is_legitimate_address
+ (mode, mem, reload_in_progress || reload_completed))
+ return false;
+
+ switch (GET_CODE (mem))
+ {
+ case REG:
+ /* Simple memory addresses are OK. */
+ return true;
+
+ case PRE_DEC:
+ case POST_INC:
+ return false;
+
+ case PLUS:
+ /* Only allow REG+INT addressing. */
+ base = XEXP (mem, 0);
+ index = XEXP (mem, 1);
+
+ return RX_REG_P (base) && CONST_INT_P (index);
+
+ case SYMBOL_REF:
+ /* Can happen when small data is being supported.
+ Assume that it will be resolved into GP+INT. */
+ return true;
+
+ default:
+ gcc_unreachable ();
+ }
+}
+
+bool
+rx_is_mode_dependent_addr (rtx addr)
+{
+ if (GET_CODE (addr) == CONST)
+ addr = XEXP (addr, 0);
+
+ switch (GET_CODE (addr))
+ {
+ /* --REG and REG++ only work in SImode. */
+ case PRE_DEC:
+ case POST_INC:
+ return true;
+
+ case MINUS:
+ case PLUS:
+ if (! REG_P (XEXP (addr, 0)))
+ return true;
+
+ addr = XEXP (addr, 1);
+
+ switch (GET_CODE (addr))
+ {
+ case REG:
+ /* REG+REG only works in SImode. */
+ return true;
+
+ case CONST_INT:
+ /* REG+INT is only mode independent if INT is a
+ multiple of 4, positive and will fit into 8-bits. */
+ if (((INTVAL (addr) & 3) == 0)
+ && IN_RANGE (INTVAL (addr), 4, 252))
+ return false;
+ return true;
+
+ case SYMBOL_REF:
+ case LABEL_REF:
+ return true;
+
+ case MULT:
+ gcc_assert (REG_P (XEXP (addr, 0)));
+ gcc_assert (CONST_INT_P (XEXP (addr, 1)));
+ /* REG+REG*SCALE is always mode dependent. */
+ return true;
+
+ default:
+ /* Not recognized, so treat as mode dependent. */
+ return true;
+ }
+
+ case CONST_INT:
+ case SYMBOL_REF:
+ case LABEL_REF:
+ case REG:
+ /* These are all mode independent. */
+ return false;
+
+ default:
+ /* Everything else is unrecognized,
+ so treat as mode dependent. */
+ return true;
+ }
+}
+
+/* A C compound statement to output to stdio stream FILE the
+ assembler syntax for an instruction operand that is a memory
+ reference whose address is ADDR. */
+
+void
+rx_print_operand_address (FILE * file, rtx addr)
+{
+ switch (GET_CODE (addr))
+ {
+ case REG:
+ fprintf (file, "[");
+ rx_print_operand (file, addr, 0);
+ fprintf (file, "]");
+ break;
+
+ case PRE_DEC:
+ fprintf (file, "[-");
+ rx_print_operand (file, XEXP (addr, 0), 0);
+ fprintf (file, "]");
+ break;
+
+ case POST_INC:
+ fprintf (file, "[");
+ rx_print_operand (file, XEXP (addr, 0), 0);
+ fprintf (file, "+]");
+ break;
+
+ case PLUS:
+ {
+ rtx arg1 = XEXP (addr, 0);
+ rtx arg2 = XEXP (addr, 1);
+ rtx base, index;
+
+ if (REG_P (arg1) && RTX_OK_FOR_BASE (arg1, true))
+ base = arg1, index = arg2;
+ else if (REG_P (arg2) && RTX_OK_FOR_BASE (arg2, true))
+ base = arg2, index = arg1;
+ else
+ {
+ rx_print_operand (file, arg1, 0);
+ fprintf (file, " + ");
+ rx_print_operand (file, arg2, 0);
+ break;
+ }
+
+ if (REG_P (index) || GET_CODE (index) == MULT)
+ {
+ fprintf (file, "[");
+ rx_print_operand (file, index, 'A');
+ fprintf (file, ",");
+ }
+ else /* GET_CODE (index) == CONST_INT */
+ {
+ rx_print_operand (file, index, 'A');
+ fprintf (file, "[");
+ }
+ rx_print_operand (file, base, 0);
+ fprintf (file, "]");
+ break;
+ }
+
+ case LABEL_REF:
+ case SYMBOL_REF:
+ case CONST:
+ fprintf (file, "#");
+ default:
+ output_addr_const (file, addr);
+ break;
+ }
+}
+
+static void
+rx_print_integer (FILE * file, HOST_WIDE_INT val)
+{
+ if (IN_RANGE (val, -64, 64))
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, val);
+ else
+ fprintf (file,
+ TARGET_AS100_SYNTAX
+ ? "0%" HOST_WIDE_INT_PRINT "xH" : HOST_WIDE_INT_PRINT_HEX,
+ val);
+}
+
+static bool
+rx_assemble_integer (rtx x, unsigned int size, int is_aligned)
+{
+ const char * op = integer_asm_op (size, is_aligned);
+
+ if (! CONST_INT_P (x))
+ return default_assemble_integer (x, size, is_aligned);
+
+ if (op == NULL)
+ return false;
+ fputs (op, asm_out_file);
+
+ rx_print_integer (asm_out_file, INTVAL (x));
+ fputc ('\n', asm_out_file);
+ return true;
+}
+
+
+int rx_float_compare_mode;
+
+/* Handles the insertion of a single operand into the assembler output.
+ The %<letter> directives supported are:
+
+ %A Print an operand without a leading # character.
+ %B Print an integer comparison name.
+ %C Print a control register name.
+ %F Print a condition code flag name.
+ %H Print high part of a DImode register, integer or address.
+ %L Print low part of a DImode register, integer or address.
+ %Q If the operand is a MEM, then correctly generate
+ register indirect or register relative addressing. */
+
+void
+rx_print_operand (FILE * file, rtx op, int letter)
+{
+ switch (letter)
+ {
+ case 'A':
+ /* Print an operand without a leading #. */
+ if (MEM_P (op))
+ op = XEXP (op, 0);
+
+ switch (GET_CODE (op))
+ {
+ case LABEL_REF:
+ case SYMBOL_REF:
+ output_addr_const (file, op);
+ break;
+ case CONST_INT:
+ fprintf (file, "%ld", (long) INTVAL (op));
+ break;
+ default:
+ rx_print_operand (file, op, 0);
+ break;
+ }
+ break;
+
+ case 'B':
+ switch (GET_CODE (op))
+ {
+ case LT: fprintf (file, "lt"); break;
+ case GE: fprintf (file, "ge"); break;
+ case GT: fprintf (file, "gt"); break;
+ case LE: fprintf (file, "le"); break;
+ case GEU: fprintf (file, "geu"); break;
+ case LTU: fprintf (file, "ltu"); break;
+ case GTU: fprintf (file, "gtu"); break;
+ case LEU: fprintf (file, "leu"); break;
+ case EQ: fprintf (file, "eq"); break;
+ case NE: fprintf (file, "ne"); break;
+ default: debug_rtx (op); gcc_unreachable ();
+ }
+ break;
+
+ case 'C':
+ gcc_assert (CONST_INT_P (op));
+ switch (INTVAL (op))
+ {
+ case 0: fprintf (file, "psw"); break;
+ case 2: fprintf (file, "usp"); break;
+ case 3: fprintf (file, "fpsw"); break;
+ case 4: fprintf (file, "cpen"); break;
+ case 8: fprintf (file, "bpsw"); break;
+ case 9: fprintf (file, "bpc"); break;
+ case 0xa: fprintf (file, "isp"); break;
+ case 0xb: fprintf (file, "fintv"); break;
+ case 0xc: fprintf (file, "intb"); break;
+ default:
+ gcc_unreachable ();
+ }
+ break;
+
+ case 'F':
+ gcc_assert (CONST_INT_P (op));
+ switch (INTVAL (op))
+ {
+ case 0: case 'c': case 'C': fprintf (file, "C"); break;
+ case 1: case 'z': case 'Z': fprintf (file, "Z"); break;
+ case 2: case 's': case 'S': fprintf (file, "S"); break;
+ case 3: case 'o': case 'O': fprintf (file, "O"); break;
+ case 8: case 'i': case 'I': fprintf (file, "I"); break;
+ case 9: case 'u': case 'U': fprintf (file, "U"); break;
+ default:
+ gcc_unreachable ();
+ }
+ break;
+
+ case 'H':
+ if (REG_P (op))
+ fprintf (file, "%s", reg_names [REGNO (op) + (WORDS_BIG_ENDIAN ? 0 : 1)]);
+ else if (CONST_INT_P (op))
+ {
+ HOST_WIDE_INT v = INTVAL (op);
+
+ fprintf (file, "#");
+ /* Trickery to avoid problems with shifting 32 bits at a time. */
+ v = v >> 16;
+ v = v >> 16;
+ rx_print_integer (file, v);
+ }
+ else
+ {
+ gcc_assert (MEM_P (op));
+
+ if (! WORDS_BIG_ENDIAN)
+ op = adjust_address (op, SImode, 4);
+ output_address (XEXP (op, 0));
+ }
+ break;
+
+ case 'L':
+ if (REG_P (op))
+ fprintf (file, "%s", reg_names [REGNO (op) + (WORDS_BIG_ENDIAN ? 1 : 0)]);
+ else if (CONST_INT_P (op))
+ {
+ fprintf (file, "#");
+ rx_print_integer (file, INTVAL (op) & 0xffffffff);
+ }
+ else
+ {
+ gcc_assert (MEM_P (op));
+
+ if (WORDS_BIG_ENDIAN)
+ op = adjust_address (op, SImode, 4);
+ output_address (XEXP (op, 0));
+ }
+ break;
+
+ case 'Q':
+ if (MEM_P (op))
+ {
+ HOST_WIDE_INT offset;
+
+ op = XEXP (op, 0);
+
+ if (REG_P (op))
+ offset = 0;
+ else if (GET_CODE (op) == PLUS)
+ {
+ rtx displacement;
+
+ if (REG_P (XEXP (op, 0)))
+ {
+ displacement = XEXP (op, 1);
+ op = XEXP (op, 0);
+ }
+ else
+ {
+ displacement = XEXP (op, 0);
+ op = XEXP (op, 1);
+ gcc_assert (REG_P (op));
+ }
+
+ gcc_assert (CONST_INT_P (displacement));
+ offset = INTVAL (displacement);
+ gcc_assert (offset >= 0);
+
+ fprintf (file, "%ld", offset);
+ }
+ else
+ gcc_unreachable ();
+
+ fprintf (file, "[");
+ rx_print_operand (file, op, 0);
+ fprintf (file, "].");
+
+ switch (GET_MODE_SIZE (GET_MODE (op)))
+ {
+ case 1:
+ gcc_assert (offset < 65535 * 1);
+ fprintf (file, "B");
+ break;
+ case 2:
+ gcc_assert (offset % 2 == 0);
+ gcc_assert (offset < 65535 * 2);
+ fprintf (file, "W");
+ break;
+ default:
+ gcc_assert (offset % 4 == 0);
+ gcc_assert (offset < 65535 * 4);
+ fprintf (file, "L");
+ break;
+ }
+ break;
+ }
+
+ /* Fall through. */
+
+ default:
+ switch (GET_CODE (op))
+ {
+ case MULT:
+ /* Should be the scaled part of an
+ indexed register indirect address. */
+ {
+ rtx base = XEXP (op, 0);
+ rtx index = XEXP (op, 1);
+
+ /* Check for a swaped index register and scaling factor.
+ Not sure if this can happen, but be prepared to handle it. */
+ if (CONST_INT_P (base) && REG_P (index))
+ {
+ rtx tmp = base;
+ base = index;
+ index = tmp;
+ }
+
+ gcc_assert (REG_P (base));
+ gcc_assert (REGNO (base) < FIRST_PSEUDO_REGISTER);
+ gcc_assert (CONST_INT_P (index));
+ /* Do not try to verify the value of the scalar as it is based
+ on the mode of the MEM not the mode of the MULT. (Which
+ will always be SImode). */
+ fprintf (file, "%s", reg_names [REGNO (base)]);
+ break;
+ }
+
+ case MEM:
+ output_address (XEXP (op, 0));
+ break;
+
+ case PLUS:
+ output_address (op);
+ break;
+
+ case REG:
+ gcc_assert (REGNO (op) < FIRST_PSEUDO_REGISTER);
+ fprintf (file, "%s", reg_names [REGNO (op)]);
+ break;
+
+ case SUBREG:
+ gcc_assert (subreg_regno (op) < FIRST_PSEUDO_REGISTER);
+ fprintf (file, "%s", reg_names [subreg_regno (op)]);
+ break;
+
+ /* This will only be single precision.... */
+ case CONST_DOUBLE:
+ {
+ unsigned long val;
+ REAL_VALUE_TYPE rv;
+
+ REAL_VALUE_FROM_CONST_DOUBLE (rv, op);
+ REAL_VALUE_TO_TARGET_SINGLE (rv, val);
+ fprintf (file, TARGET_AS100_SYNTAX ? "#0%lxH" : "#0x%lx", val);
+ break;
+ }
+
+ case CONST_INT:
+ fprintf (file, "#");
+ rx_print_integer (file, INTVAL (op));
+ break;
+
+ case SYMBOL_REF:
+ case CONST:
+ case LABEL_REF:
+ case CODE_LABEL:
+ case UNSPEC:
+ rx_print_operand_address (file, op);
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+ break;
+ }
+}
+
+/* Returns an assembler template for a move instruction. */
+
+char *
+rx_gen_move_template (rtx * operands, bool is_movu)
+{
+ static char template [64];
+ const char * extension = TARGET_AS100_SYNTAX ? ".L" : "";
+ const char * src_template;
+ const char * dst_template;
+ rtx dest = operands[0];
+ rtx src = operands[1];
+
+ /* Decide which extension, if any, should be given to the move instruction. */
+ switch (CONST_INT_P (src) ? GET_MODE (dest) : GET_MODE (src))
+ {
+ case QImode:
+ /* The .B extension is not valid when
+ loading an immediate into a register. */
+ if (! REG_P (dest) || ! CONST_INT_P (src))
+ extension = ".B";
+ break;
+ case HImode:
+ if (! REG_P (dest) || ! CONST_INT_P (src))
+ /* The .W extension is not valid when
+ loading an immediate into a register. */
+ extension = ".W";
+ break;
+ case SFmode:
+ case SImode:
+ extension = ".L";
+ break;
+ case VOIDmode:
+ /* This mode is used by constants. */
+ break;
+ default:
+ debug_rtx (src);
+ gcc_unreachable ();
+ }
+
+ if (MEM_P (src) && rx_small_data_operand (XEXP (src, 0)))
+ src_template = "%%gp(%A1)[r13]";
+ else
+ src_template = "%1";
+
+ if (MEM_P (dest) && rx_small_data_operand (XEXP (dest, 0)))
+ dst_template = "%%gp(%A0)[r13]";
+ else
+ dst_template = "%0";
+
+ sprintf (template, "%s%s\t%s, %s", is_movu ? "movu" : "mov",
+ extension, src_template, dst_template);
+ return template;
+}
+
+/* Returns an assembler template for a conditional branch instruction. */
+
+const char *
+rx_gen_cond_branch_template (rtx condition, bool reversed)
+{
+ enum rtx_code code = GET_CODE (condition);
+
+
+ if ((cc_status.flags & CC_NO_OVERFLOW) && ! rx_float_compare_mode)
+ gcc_assert (code != GT && code != GE && code != LE && code != LT);
+
+ if ((cc_status.flags & CC_NO_CARRY) || rx_float_compare_mode)
+ gcc_assert (code != GEU && code != GTU && code != LEU && code != LTU);
+
+ if (reversed)
+ {
+ if (rx_float_compare_mode)
+ code = reverse_condition_maybe_unordered (code);
+ else
+ code = reverse_condition (code);
+ }
+
+ /* We do not worry about encoding the branch length here as GAS knows
+ how to choose the smallest version, and how to expand a branch that
+ is to a destination that is out of range. */
+
+ switch (code)
+ {
+ case UNEQ: return "bo\t1f\n\tbeq\t%0\n1:";
+ case LTGT: return "bo\t1f\n\tbne\t%0\n1:";
+ case UNLT: return "bo\t1f\n\tbn\t%0\n1:";
+ case UNGE: return "bo\t1f\n\tbpz\t%0\n1:";
+ case UNLE: return "bo\t1f\n\tbgt\t1f\n\tbra\t%0\n1:";
+ case UNGT: return "bo\t1f\n\tble\t1f\n\tbra\t%0\n1:";
+ case UNORDERED: return "bo\t%0";
+ case ORDERED: return "bno\t%0";
+
+ case LT: return rx_float_compare_mode ? "bn\t%0" : "blt\t%0";
+ case GE: return rx_float_compare_mode ? "bpz\t%0" : "bge\t%0";
+ case GT: return "bgt\t%0";
+ case LE: return "ble\t%0";
+ case GEU: return "bgeu\t%0";
+ case LTU: return "bltu\t%0";
+ case GTU: return "bgtu\t%0";
+ case LEU: return "bleu\t%0";
+ case EQ: return "beq\t%0";
+ case NE: return "bne\t%0";
+ default:
+ gcc_unreachable ();
+ }
+}
+
+/* Return VALUE rounded up to the next ALIGNMENT boundary. */
+
+static inline unsigned int
+rx_round_up (unsigned int value, unsigned int alignment)
+{
+ alignment -= 1;
+ return (value + alignment) & (~ alignment);
+}
+
+/* Return the number of bytes in the argument registers
+ occupied by an argument of type TYPE and mode MODE. */
+
+unsigned int
+rx_function_arg_size (Mmode mode, const_tree type)
+{
+ unsigned int num_bytes;
+
+ num_bytes = (mode == BLKmode)
+ ? int_size_in_bytes (type) : GET_MODE_SIZE (mode);
+ return rx_round_up (num_bytes, UNITS_PER_WORD);
+}
+
+#define NUM_ARG_REGS 4
+#define MAX_NUM_ARG_BYTES (NUM_ARG_REGS * UNITS_PER_WORD)
+
+/* Return an RTL expression describing the register holding a function
+ parameter of mode MODE and type TYPE or NULL_RTX if the parameter should
+ be passed on the stack. CUM describes the previous parameters to the
+ function and NAMED is false if the parameter is part of a variable
+ parameter list, or the last named parameter before the start of a
+ variable parameter list. */
+
+rtx
+rx_function_arg (Fargs * cum, Mmode mode, const_tree type, bool named)
+{
+ unsigned int next_reg;
+ unsigned int bytes_so_far = *cum;
+ unsigned int size;
+ unsigned int rounded_size;
+
+ /* An exploded version of rx_function_arg_size. */
+ size = (mode == BLKmode) ? int_size_in_bytes (type) : GET_MODE_SIZE (mode);
+
+ rounded_size = rx_round_up (size, UNITS_PER_WORD);
+
+ /* Don't pass this arg via registers if there
+ are insufficient registers to hold all of it. */
+ if (rounded_size + bytes_so_far > MAX_NUM_ARG_BYTES)
+ return NULL_RTX;
+
+ /* Unnamed arguments and the last named argument in a
+ variadic function are always passed on the stack. */
+ if (!named)
+ return NULL_RTX;
+
+ /* Structures must occupy an exact number of registers,
+ otherwise they are passed on the stack. */
+ if ((type == NULL || AGGREGATE_TYPE_P (type))
+ && (size % UNITS_PER_WORD) != 0)
+ return NULL_RTX;
+
+ next_reg = (bytes_so_far / UNITS_PER_WORD) + 1;
+
+ return gen_rtx_REG (mode, next_reg);
+}
+
+/* Return an RTL describing where a function return value of type RET_TYPE
+ is held. */
+
+static rtx
+rx_function_value (const_tree ret_type,
+ const_tree fn_decl_or_type ATTRIBUTE_UNUSED,
+ bool outgoing ATTRIBUTE_UNUSED)
+{
+ return gen_rtx_REG (TYPE_MODE (ret_type), FUNC_RETURN_REGNUM);
+}
+
+static bool
+rx_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
+{
+ HOST_WIDE_INT size;
+
+ if (TYPE_MODE (type) != BLKmode
+ && ! AGGREGATE_TYPE_P (type))
+ return false;
+
+ size = int_size_in_bytes (type);
+ /* Large structs and those whose size is not an
+ exact multiple of 4 are returned in memory. */
+ return size < 1
+ || size > 16
+ || (size % UNITS_PER_WORD) != 0;
+}
+
+static rtx
+rx_struct_value_rtx (tree fndecl ATTRIBUTE_UNUSED,
+ int incoming ATTRIBUTE_UNUSED)
+{
+ return gen_rtx_REG (Pmode, STRUCT_VAL_REGNUM);
+}
+
+static bool
+rx_return_in_msb (const_tree valtype)
+{
+ return TARGET_BIG_ENDIAN_DATA
+ && (AGGREGATE_TYPE_P (valtype) || TREE_CODE (valtype) == COMPLEX_TYPE);
+}
+
+/* Returns true if the provided function has the specified attribute. */
+
+static inline bool
+has_func_attr (const_tree decl, const char * func_attr)
+{
+ if (decl == NULL_TREE)
+ decl = current_function_decl;
+
+ return lookup_attribute (func_attr, DECL_ATTRIBUTES (decl)) != NULL_TREE;
+}
+
+/* Returns true if the provided function has the "fast_interrupt" attribute. */
+
+static inline bool
+is_fast_interrupt_func (const_tree decl)
+{
+ return has_func_attr (decl, "fast_interrupt");
+}
+
+/* Returns true if the provided function has the "interrupt" attribute. */
+
+static inline bool
+is_interrupt_func (const_tree decl)
+{
+ return has_func_attr (decl, "interrupt");
+}
+
+/* Returns true if the provided function has the "naked" attribute. */
+
+static inline bool
+is_naked_func (const_tree decl)
+{
+ return has_func_attr (decl, "naked");
+}
+
+static bool use_fixed_regs = false;
+
+void
+rx_conditional_register_usage (void)
+{
+ static bool using_fixed_regs = false;
+
+ if (rx_small_data_limit > 0)
+ fixed_regs[GP_BASE_REGNUM] = call_used_regs [GP_BASE_REGNUM] = 1;
+
+ if (use_fixed_regs != using_fixed_regs)
+ {
+ static char saved_fixed_regs[FIRST_PSEUDO_REGISTER];
+ static char saved_call_used_regs[FIRST_PSEUDO_REGISTER];
+
+ if (use_fixed_regs)
+ {
+ unsigned int switched = 0;
+ unsigned int r;
+
+ /* This is for fast interrupt handlers. Any register in
+ the range r10 to r13 (inclusive) that is currently
+ marked as fixed is now a viable, call-saved register.
+ All other registers are fixed. */
+ memcpy (saved_fixed_regs, fixed_regs, sizeof fixed_regs);
+ memcpy (saved_call_used_regs, call_used_regs, sizeof call_used_regs);
+
+ for (r = 1; r < 10; r++)
+ fixed_regs[r] = call_used_regs[r] = 1;
+
+ for (r = 10; r <= 13; r++)
+ if (fixed_regs[r])
+ {
+ fixed_regs[r] = 0;
+ call_used_regs[r] = 1;
+ ++ switched;
+ }
+ else
+ {
+ fixed_regs[r] = 1;
+ call_used_regs[r] = 1;
+ }
+
+ fixed_regs[14] = call_used_regs[14] = 1;
+ fixed_regs[15] = call_used_regs[15] = 1;
+
+ if (switched == 0)
+ {
+ static bool warned = false;
+
+ if (! warned)
+ {
+ warning (0, "no fixed registers available "
+ "for use by fast interrupt handler");
+ warned = true;
+ }
+ }
+ }
+ else
+ {
+ /* Restore the normal register masks. */
+ memcpy (fixed_regs, saved_fixed_regs, sizeof fixed_regs);
+ memcpy (call_used_regs, saved_call_used_regs, sizeof call_used_regs);
+ }
+
+ using_fixed_regs = use_fixed_regs;
+ }
+}
+
+/* Perform any actions necessary before starting to compile FNDECL.
+ For the RX we use this to make sure that we have the correct
+ set of register masks selected. If FNDECL is NULL then we are
+ compiling top level things. */
+
+static void
+rx_set_current_function (tree fndecl)
+{
+ /* Remember the last target of rx_set_current_function. */
+ static tree rx_previous_fndecl;
+ bool prev_was_fast_interrupt;
+ bool current_is_fast_interrupt;
+
+ /* Only change the context if the function changes. This hook is called
+ several times in the course of compiling a function, and we don't want
+ to slow things down too much or call target_reinit when it isn't safe. */
+ if (fndecl == rx_previous_fndecl)
+ return;
+
+ prev_was_fast_interrupt
+ = rx_previous_fndecl
+ ? is_fast_interrupt_func (rx_previous_fndecl) : false;
+
+ current_is_fast_interrupt
+ = fndecl ? is_fast_interrupt_func (fndecl) : false;
+
+ if (prev_was_fast_interrupt != current_is_fast_interrupt)
+ {
+ use_fixed_regs = current_is_fast_interrupt;
+ target_reinit ();
+ }
+
+ rx_previous_fndecl = fndecl;
+}
+
+/* Typical stack layout should looks like this after the function's prologue:
+
+ | |
+ -- ^
+ | | \ |
+ | | arguments saved | Increasing
+ | | on the stack | addresses
+ PARENT arg pointer -> | | /
+ -------------------------- ---- -------------------
+ CHILD |ret | return address
+ --
+ | | \
+ | | call saved
+ | | registers
+ | | /
+ --
+ | | \
+ | | local
+ | | variables
+ frame pointer -> | | /
+ --
+ | | \
+ | | outgoing | Decreasing
+ | | arguments | addresses
+ current stack pointer -> | | / |
+ -------------------------- ---- ------------------ V
+ | | */
+
+static unsigned int
+bit_count (unsigned int x)
+{
+ const unsigned int m1 = 0x55555555;
+ const unsigned int m2 = 0x33333333;
+ const unsigned int m4 = 0x0f0f0f0f;
+
+ x -= (x >> 1) & m1;
+ x = (x & m2) + ((x >> 2) & m2);
+ x = (x + (x >> 4)) & m4;
+ x += x >> 8;
+
+ return (x + (x >> 16)) & 0x3f;
+}
+
+/* Returns either the lowest numbered and highest numbered registers that
+ occupy the call-saved area of the stack frame, if the registers are
+ stored as a contiguous block, or else a bitmask of the individual
+ registers if they are stored piecemeal.
+
+ Also computes the size of the frame and the size of the outgoing
+ arguments block (in bytes). */
+
+static void
+rx_get_stack_layout (unsigned int * lowest,
+ unsigned int * highest,
+ unsigned int * register_mask,
+ unsigned int * frame_size,
+ unsigned int * stack_size)
+{
+ unsigned int reg;
+ unsigned int low;
+ unsigned int high;
+ unsigned int fixed_reg = 0;
+ unsigned int save_mask;
+ unsigned int pushed_mask;
+ unsigned int unneeded_pushes;
+
+ if (is_naked_func (NULL_TREE)
+ || is_fast_interrupt_func (NULL_TREE))
+ {
+ /* Naked functions do not create their own stack frame.
+ Instead the programmer must do that for us.
+
+ Fast interrupt handlers use fixed registers that have
+ been epsecially released to the function, so they do
+ not need or want a stack frame. */
+ * lowest = 0;
+ * highest = 0;
+ * register_mask = 0;
+ * frame_size = 0;
+ * stack_size = 0;
+ return;
+ }
+
+ for (save_mask = high = low = 0, reg = 1; reg < FIRST_PSEUDO_REGISTER; reg++)
+ {
+ if (df_regs_ever_live_p (reg)
+ && (! call_used_regs[reg]
+ /* Even call clobbered registered must
+ be pushed inside interrupt handlers. */
+ || is_interrupt_func (NULL_TREE)))
+ {
+ if (low == 0)
+ low = reg;
+ high = reg;
+
+ save_mask |= 1 << reg;
+ }
+
+ /* Remember if we see a fixed register
+ after having found the low register. */
+ if (low != 0 && fixed_reg == 0 && fixed_regs [reg])
+ fixed_reg = reg;
+ }
+
+ /* Decide if it would be faster fill in the call-saved area of the stack
+ frame using multiple PUSH instructions instead of a single PUSHM
+ instruction.
+
+ SAVE_MASK is a bitmask of the registers that must be stored in the
+ call-save area. PUSHED_MASK is a bitmask of the registers that would
+ be pushed into the area if we used a PUSHM instruction. UNNEEDED_PUSHES
+ is a bitmask of those registers in pushed_mask that are not in
+ save_mask.
+
+ We use a simple heuristic that says that it is better to use
+ multiple PUSH instructions if the number of unnecessary pushes is
+ greater than the number of necessary pushes.
+
+ We also use multiple PUSH instructions if there are any fixed registers
+ between LOW and HIGH. The only way that this can happen is if the user
+ has specified --fixed-<reg-name> on the command line and in such
+ circumstances we do not want to touch the fixed registers at all.
+
+ FIXME: Is it worth improving this heuristic ? */
+ pushed_mask = (-1 << low) & ~(-1 << (high + 1));
+ unneeded_pushes = (pushed_mask & (~ save_mask)) & pushed_mask;
+
+ if ((fixed_reg && fixed_reg <= high)
+ || (optimize_function_for_speed_p (cfun)
+ && bit_count (save_mask) < bit_count (unneeded_pushes)))
+ {
+ /* Use multiple pushes. */
+ * lowest = 0;
+ * highest = 0;
+ * register_mask = save_mask;
+ }
+ else
+ {
+ /* Use one push multiple instruction. */
+ * lowest = low;
+ * highest = high;
+ * register_mask = 0;
+ }
+
+ * frame_size = rx_round_up
+ (get_frame_size (), STACK_BOUNDARY / BITS_PER_UNIT);
+
+ if (crtl->args.size > 0)
+ * frame_size += rx_round_up
+ (crtl->args.size, STACK_BOUNDARY / BITS_PER_UNIT);
+
+ * stack_size = rx_round_up
+ (crtl->outgoing_args_size, STACK_BOUNDARY / BITS_PER_UNIT);
+}
+
+/* Generate a PUSHM instruction that matches the given operands. */
+
+void
+rx_emit_stack_pushm (rtx * operands)
+{
+ HOST_WIDE_INT last_reg;
+ rtx first_push;
+
+ gcc_assert (CONST_INT_P (operands[0]));
+ last_reg = (INTVAL (operands[0]) / UNITS_PER_WORD) - 1;
+
+ gcc_assert (GET_CODE (operands[1]) == PARALLEL);
+ first_push = XVECEXP (operands[1], 0, 1);
+ gcc_assert (SET_P (first_push));
+ first_push = SET_SRC (first_push);
+ gcc_assert (REG_P (first_push));
+
+ asm_fprintf (asm_out_file, "\tpushm\t%s-%s\n",
+ reg_names [REGNO (first_push) - last_reg],
+ reg_names [REGNO (first_push)]);
+}
+
+/* Generate a PARALLEL that will pass the rx_store_multiple_vector predicate. */
+
+static rtx
+gen_rx_store_vector (unsigned int low, unsigned int high)
+{
+ unsigned int i;
+ unsigned int count = (high - low) + 2;
+ rtx vector;
+
+ vector = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
+
+ XVECEXP (vector, 0, 0) =
+ gen_rtx_SET (SImode, stack_pointer_rtx,
+ gen_rtx_MINUS (SImode, stack_pointer_rtx,
+ GEN_INT ((count - 1) * UNITS_PER_WORD)));
+
+ for (i = 0; i < count - 1; i++)
+ XVECEXP (vector, 0, i + 1) =
+ gen_rtx_SET (SImode,
+ gen_rtx_MEM (SImode,
+ gen_rtx_MINUS (SImode, stack_pointer_rtx,
+ GEN_INT ((i + 1) * UNITS_PER_WORD))),
+ gen_rtx_REG (SImode, high - i));
+ return vector;
+}
+
+/* Mark INSN as being frame related. If it is a PARALLEL
+ then mark each element as being frame related as well. */
+
+static void
+mark_frame_related (rtx insn)
+{
+ RTX_FRAME_RELATED_P (insn) = 1;
+ insn = PATTERN (insn);
+
+ if (GET_CODE (insn) == PARALLEL)
+ {
+ unsigned int i;
+
+ for (i = 0; i < XVECLEN (insn, 0); i++)
+ RTX_FRAME_RELATED_P (XVECEXP (insn, 0, i)) = 1;
+ }
+}
+
+void
+rx_expand_prologue (void)
+{
+ unsigned int stack_size;
+ unsigned int frame_size;
+ unsigned int mask;
+ unsigned int low;
+ unsigned int high;
+ unsigned int reg;
+ rtx insn;
+
+ /* Naked functions use their own, programmer provided prologues. */
+ if (is_naked_func (NULL_TREE)
+ /* Fast interrupt functions never use the stack. */
+ || is_fast_interrupt_func (NULL_TREE))
+ return;
+
+ rx_get_stack_layout (& low, & high, & mask, & frame_size, & stack_size);
+
+ /* If we use any of the callee-saved registers, save them now. */
+ if (mask)
+ {
+ /* Push registers in reverse order. */
+ for (reg = FIRST_PSEUDO_REGISTER; reg --;)
+ if (mask & (1 << reg))
+ {
+ insn = emit_insn (gen_stack_push (gen_rtx_REG (SImode, reg)));
+ mark_frame_related (insn);
+ }
+ }
+ else if (low)
+ {
+ if (high == low)
+ insn = emit_insn (gen_stack_push (gen_rtx_REG (SImode, low)));
+ else
+ insn = emit_insn (gen_stack_pushm (GEN_INT (((high - low) + 1)
+ * UNITS_PER_WORD),
+ gen_rx_store_vector (low, high)));
+ mark_frame_related (insn);
+ }
+
+ if (is_interrupt_func (NULL_TREE) && TARGET_SAVE_ACC_REGISTER)
+ {
+ unsigned int acc_high, acc_low;
+
+ /* Interrupt handlers have to preserve the accumulator
+ register if so requested by the user. Use the first
+ two pushed register as intermediaries. */
+ if (mask)
+ {
+ acc_low = acc_high = 0;
+
+ for (reg = 1; reg < FIRST_PSEUDO_REGISTER; reg ++)
+ if (mask & (1 << reg))
+ {
+ if (acc_low == 0)
+ acc_low = reg;
+ else
+ {
+ acc_high = reg;
+ break;
+ }
+ }
+
+ /* We have assumed that there are at least two registers pushed... */
+ gcc_assert (acc_high != 0);
+
+ /* Note - the bottom 16 bits of the accumulator are inaccessible.
+ We just assume that they are zero. */
+ emit_insn (gen_mvfacmi (gen_rtx_REG (SImode, acc_low)));
+ emit_insn (gen_mvfachi (gen_rtx_REG (SImode, acc_high)));
+ emit_insn (gen_stack_push (gen_rtx_REG (SImode, acc_low)));
+ emit_insn (gen_stack_push (gen_rtx_REG (SImode, acc_high)));
+ }
+ else
+ {
+ acc_low = low;
+ acc_high = low + 1;
+
+ /* We have assumed that there are at least two registers pushed... */
+ gcc_assert (acc_high <= high);
+
+ emit_insn (gen_mvfacmi (gen_rtx_REG (SImode, acc_low)));
+ emit_insn (gen_mvfachi (gen_rtx_REG (SImode, acc_high)));
+ emit_insn (gen_stack_pushm (GEN_INT (2 * UNITS_PER_WORD),
+ gen_rx_store_vector (acc_low, acc_high)));
+ }
+
+ frame_size += 2 * UNITS_PER_WORD;
+ }
+
+ /* If needed, set up the frame pointer. */
+ if (frame_pointer_needed)
+ {
+ if (frame_size)
+ insn = emit_insn (gen_addsi3 (frame_pointer_rtx, stack_pointer_rtx,
+ GEN_INT (- (HOST_WIDE_INT) frame_size)));
+ else
+ insn = emit_move_insn (frame_pointer_rtx, stack_pointer_rtx);
+
+ RTX_FRAME_RELATED_P (insn) = 1;
+ }
+
+ insn = NULL_RTX;
+
+ /* Allocate space for the outgoing args.
+ If the stack frame has not already been set up then handle this as well. */
+ if (stack_size)
+ {
+ if (frame_size)
+ {
+ if (frame_pointer_needed)
+ insn = emit_insn (gen_addsi3 (stack_pointer_rtx, frame_pointer_rtx,
+ GEN_INT (- (HOST_WIDE_INT)
+ stack_size)));
+ else
+ insn = emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
+ GEN_INT (- (HOST_WIDE_INT)
+ (frame_size + stack_size))));
+ }
+ else
+ insn = emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
+ GEN_INT (- (HOST_WIDE_INT) stack_size)));
+ }
+ else if (frame_size)
+ {
+ if (! frame_pointer_needed)
+ insn = emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
+ GEN_INT (- (HOST_WIDE_INT) frame_size)));
+ else
+ insn = emit_move_insn (stack_pointer_rtx, frame_pointer_rtx);
+ }
+
+ if (insn != NULL_RTX)
+ RTX_FRAME_RELATED_P (insn) = 1;
+}
+
+static void
+rx_output_function_prologue (FILE * file,
+ HOST_WIDE_INT frame_size ATTRIBUTE_UNUSED)
+{
+ if (is_fast_interrupt_func (NULL_TREE))
+ asm_fprintf (file, "\t; Note: Fast Interrupt Handler\n");
+
+ if (is_interrupt_func (NULL_TREE))
+ asm_fprintf (file, "\t; Note: Interrupt Handler\n");
+
+ if (is_naked_func (NULL_TREE))
+ asm_fprintf (file, "\t; Note: Naked Function\n");
+
+ if (cfun->static_chain_decl != NULL)
+ asm_fprintf (file, "\t; Note: Nested function declared "
+ "inside another function.\n");
+
+ if (crtl->calls_eh_return)
+ asm_fprintf (file, "\t; Note: Calls __builtin_eh_return.\n");
+}
+
+/* Generate a POPM or RTSD instruction that matches the given operands. */
+
+void
+rx_emit_stack_popm (rtx * operands, bool is_popm)
+{
+ HOST_WIDE_INT stack_adjust;
+ HOST_WIDE_INT last_reg;
+ rtx first_push;
+
+ gcc_assert (CONST_INT_P (operands[0]));
+ stack_adjust = INTVAL (operands[0]);
+
+ gcc_assert (GET_CODE (operands[1]) == PARALLEL);
+ last_reg = XVECLEN (operands[1], 0) - (is_popm ? 2 : 3);
+
+ first_push = XVECEXP (operands[1], 0, 1);
+ gcc_assert (SET_P (first_push));
+ first_push = SET_DEST (first_push);
+ gcc_assert (REG_P (first_push));
+
+ if (is_popm)
+ asm_fprintf (asm_out_file, "\tpopm\t%s-%s\n",
+ reg_names [REGNO (first_push)],
+ reg_names [REGNO (first_push) + last_reg]);
+ else
+ asm_fprintf (asm_out_file, "\trtsd\t#%d, %s-%s\n",
+ (int) stack_adjust,
+ reg_names [REGNO (first_push)],
+ reg_names [REGNO (first_push) + last_reg]);
+}
+
+/* Generate a PARALLEL which will satisfy the rx_rtsd_vector predicate. */
+
+static rtx
+gen_rx_rtsd_vector (unsigned int adjust, unsigned int low, unsigned int high)
+{
+ unsigned int i;
+ unsigned int bias = 3;
+ unsigned int count = (high - low) + bias;
+ rtx vector;
+
+ vector = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
+
+ XVECEXP (vector, 0, 0) =
+ gen_rtx_SET (SImode, stack_pointer_rtx,
+ plus_constant (stack_pointer_rtx, adjust));
+
+ for (i = 0; i < count - 2; i++)
+ XVECEXP (vector, 0, i + 1) =
+ gen_rtx_SET (SImode,
+ gen_rtx_REG (SImode, low + i),
+ gen_rtx_MEM (SImode,
+ i == 0 ? stack_pointer_rtx
+ : plus_constant (stack_pointer_rtx,
+ i * UNITS_PER_WORD)));
+
+ XVECEXP (vector, 0, count - 1) = gen_rtx_RETURN (VOIDmode);
+
+ return vector;
+}
+
+/* Generate a PARALLEL which will satisfy the rx_load_multiple_vector predicate. */
+
+static rtx
+gen_rx_popm_vector (unsigned int low, unsigned int high)
+{
+ unsigned int i;
+ unsigned int count = (high - low) + 2;
+ rtx vector;
+
+ vector = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
+
+ XVECEXP (vector, 0, 0) =
+ gen_rtx_SET (SImode, stack_pointer_rtx,
+ plus_constant (stack_pointer_rtx,
+ (count - 1) * UNITS_PER_WORD));
+
+ for (i = 0; i < count - 1; i++)
+ XVECEXP (vector, 0, i + 1) =
+ gen_rtx_SET (SImode,
+ gen_rtx_REG (SImode, low + i),
+ gen_rtx_MEM (SImode,
+ i == 0 ? stack_pointer_rtx
+ : plus_constant (stack_pointer_rtx,
+ i * UNITS_PER_WORD)));
+
+ return vector;
+}
+
+void
+rx_expand_epilogue (bool is_sibcall)
+{
+ unsigned int low;
+ unsigned int high;
+ unsigned int frame_size;
+ unsigned int stack_size;
+ unsigned int register_mask;
+ unsigned int regs_size;
+ unsigned int reg;
+ unsigned HOST_WIDE_INT total_size;
+
+ if (is_naked_func (NULL_TREE))
+ {
+ /* Naked functions use their own, programmer provided epilogues.
+ But, in order to keep gcc happy we have to generate some kind of
+ epilogue RTL. */
+ emit_jump_insn (gen_naked_return ());
+ return;
+ }
+
+ rx_get_stack_layout (& low, & high, & register_mask,
+ & frame_size, & stack_size);
+
+ total_size = frame_size + stack_size;
+ regs_size = ((high - low) + 1) * UNITS_PER_WORD;
+
+ /* See if we are unable to use the special stack frame deconstruct and
+ return instructions. In most cases we can use them, but the exceptions
+ are:
+
+ - Sibling calling functions deconstruct the frame but do not return to
+ their caller. Instead they branch to their sibling and allow their
+ return instruction to return to this function's parent.
+
+ - Fast and normal interrupt handling functions have to use special
+ return instructions.
+
+ - Functions where we have pushed a fragmented set of registers into the
+ call-save area must have the same set of registers popped. */
+ if (is_sibcall
+ || is_fast_interrupt_func (NULL_TREE)
+ || is_interrupt_func (NULL_TREE)
+ || register_mask)
+ {
+ /* Cannot use the special instructions - deconstruct by hand. */
+ if (total_size)
+ emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
+ GEN_INT (total_size)));
+
+ if (is_interrupt_func (NULL_TREE) && TARGET_SAVE_ACC_REGISTER)
+ {
+ unsigned int acc_low, acc_high;
+
+ /* Reverse the saving of the accumulator register onto the stack.
+ Note we must adjust the saved "low" accumulator value as it
+ is really the middle 32-bits of the accumulator. */
+ if (register_mask)
+ {
+ acc_low = acc_high = 0;
+ for (reg = 1; reg < FIRST_PSEUDO_REGISTER; reg ++)
+ if (register_mask & (1 << reg))
+ {
+ if (acc_low == 0)
+ acc_low = reg;
+ else
+ {
+ acc_high = reg;
+ break;
+ }
+ }
+ emit_insn (gen_stack_pop (gen_rtx_REG (SImode, acc_high)));
+ emit_insn (gen_stack_pop (gen_rtx_REG (SImode, acc_low)));
+ }
+ else
+ {
+ acc_low = low;
+ acc_high = low + 1;
+ emit_insn (gen_stack_popm (GEN_INT (2 * UNITS_PER_WORD),
+ gen_rx_popm_vector (acc_low, acc_high)));
+ }
+
+ emit_insn (gen_ashlsi3 (gen_rtx_REG (SImode, acc_low),
+ gen_rtx_REG (SImode, acc_low),
+ GEN_INT (16)));
+ emit_insn (gen_mvtaclo (gen_rtx_REG (SImode, acc_low)));
+ emit_insn (gen_mvtachi (gen_rtx_REG (SImode, acc_high)));
+ }
+
+ if (register_mask)
+ {
+ for (reg = 0; reg < FIRST_PSEUDO_REGISTER; reg ++)
+ if (register_mask & (1 << reg))
+ emit_insn (gen_stack_pop (gen_rtx_REG (SImode, reg)));
+ }
+ else if (low)
+ {
+ if (high == low)
+ emit_insn (gen_stack_pop (gen_rtx_REG (SImode, low)));
+ else
+ emit_insn (gen_stack_popm (GEN_INT (regs_size),
+ gen_rx_popm_vector (low, high)));
+ }
+
+ if (is_fast_interrupt_func (NULL_TREE))
+ emit_jump_insn (gen_fast_interrupt_return ());
+ else if (is_interrupt_func (NULL_TREE))
+ emit_jump_insn (gen_exception_return ());
+ else if (! is_sibcall)
+ emit_jump_insn (gen_simple_return ());
+
+ return;
+ }
+
+ /* If we allocated space on the stack, free it now. */
+ if (total_size)
+ {
+ unsigned HOST_WIDE_INT rtsd_size;
+
+ /* See if we can use the RTSD instruction. */
+ rtsd_size = total_size + regs_size;
+ if (rtsd_size < 1024 && (rtsd_size % 4) == 0)
+ {
+ if (low)
+ emit_jump_insn (gen_pop_and_return
+ (GEN_INT (rtsd_size),
+ gen_rx_rtsd_vector (rtsd_size, low, high)));
+ else
+ emit_jump_insn (gen_deallocate_and_return (GEN_INT (total_size)));
+
+ return;
+ }
+
+ emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
+ GEN_INT (total_size)));
+ }
+
+ if (low)
+ emit_jump_insn (gen_pop_and_return (GEN_INT (regs_size),
+ gen_rx_rtsd_vector (regs_size,
+ low, high)));
+ else
+ emit_jump_insn (gen_simple_return ());
+}
+
+
+/* Compute the offset (in words) between FROM (arg pointer
+ or frame pointer) and TO (frame pointer or stack pointer).
+ See ASCII art comment at the start of rx_expand_prologue
+ for more information. */
+
+int
+rx_initial_elimination_offset (int from, int to)
+{
+ unsigned int low;
+ unsigned int high;
+ unsigned int frame_size;
+ unsigned int stack_size;
+ unsigned int mask;
+
+ rx_get_stack_layout (& low, & high, & mask, & frame_size, & stack_size);
+
+ if (from == ARG_POINTER_REGNUM)
+ {
+ /* Extend the computed size of the stack frame to
+ include the registers pushed in the prologue. */
+ if (low)
+ frame_size += ((high - low) + 1) * UNITS_PER_WORD;
+ else
+ frame_size += bit_count (mask) * UNITS_PER_WORD;
+
+ /* Remember to include the return address. */
+ frame_size += 1 * UNITS_PER_WORD;
+
+ if (to == FRAME_POINTER_REGNUM)
+ return frame_size;
+
+ gcc_assert (to == STACK_POINTER_REGNUM);
+ return frame_size + stack_size;
+ }
+
+ gcc_assert (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM);
+ return stack_size;
+}
+
+/* Update the status of the condition
+ codes (cc0) based on the given INSN. */
+
+void
+rx_notice_update_cc (rtx body, rtx insn)
+{
+ switch (get_attr_cc (insn))
+ {
+ case CC_NONE:
+ /* Insn does not affect cc0 at all. */
+ break;
+ case CC_CLOBBER:
+ /* Insn doesn't leave cc0 in a usable state. */
+ CC_STATUS_INIT;
+ break;
+ case CC_SET_ZSOC:
+ /* The insn sets all the condition code bits. */
+ CC_STATUS_INIT;
+ cc_status.value1 = SET_SRC (body);
+ break;
+ case CC_SET_ZSO:
+ /* Insn sets the Z,S and O flags, but not the C flag. */
+ CC_STATUS_INIT;
+ cc_status.flags |= CC_NO_CARRY;
+ /* Do not set the value1 field in this case. The final_scan_insn()
+ function naively believes that if cc_status.value1 is set then
+ it can eliminate *any* comparison against that value, even if
+ the type of comparison cannot be satisfied by the range of flag
+ bits being set here. See gcc.c-torture/execute/20041210-1.c
+ for an example of this in action. */
+ break;
+ case CC_SET_ZS:
+ /* Insn sets the Z and S flags, but not the O or C flags. */
+ CC_STATUS_INIT;
+ cc_status.flags |= (CC_NO_CARRY | CC_NO_OVERFLOW);
+ /* See comment above regarding cc_status.value1. */
+ break;
+ default:
+ gcc_unreachable ();
+ }
+}
+
+/* Decide if a variable should go into one of the small data sections. */
+
+static bool
+rx_in_small_data (const_tree decl)
+{
+ int size;
+ const_tree section;
+
+ if (rx_small_data_limit == 0)
+ return false;
+
+ if (TREE_CODE (decl) != VAR_DECL)
+ return false;
+
+ /* We do not put read-only variables into a small data area because
+ they would be placed with the other read-only sections, far away
+ from the read-write data sections, and we only have one small
+ data area pointer.
+ Similarly commons are placed in the .bss section which might be
+ far away (and out of alignment with respect to) the .data section. */
+ if (TREE_READONLY (decl) || DECL_COMMON (decl))
+ return false;
+
+ section = DECL_SECTION_NAME (decl);
+ if (section)
+ {
+ const char * const name = TREE_STRING_POINTER (section);
+
+ return (strcmp (name, "D_2") == 0) || (strcmp (name, "B_2") == 0);
+ }
+
+ size = int_size_in_bytes (TREE_TYPE (decl));
+
+ return (size > 0) && (size <= rx_small_data_limit);
+}
+
+/* Return a section for X.
+ The only special thing we do here is to honor small data. */
+
+static section *
+rx_select_rtx_section (enum machine_mode mode,
+ rtx x,
+ unsigned HOST_WIDE_INT align)
+{
+ if (rx_small_data_limit > 0
+ && GET_MODE_SIZE (mode) <= rx_small_data_limit
+ && align <= (unsigned HOST_WIDE_INT) rx_small_data_limit * BITS_PER_UNIT)
+ return sdata_section;
+
+ return default_elf_select_rtx_section (mode, x, align);
+}
+
+static section *
+rx_select_section (tree decl,
+ int reloc,
+ unsigned HOST_WIDE_INT align)
+{
+ if (rx_small_data_limit > 0)
+ {
+ switch (categorize_decl_for_section (decl, reloc))
+ {
+ case SECCAT_SDATA: return sdata_section;
+ case SECCAT_SBSS: return sbss_section;
+ case SECCAT_SRODATA:
+ /* Fall through. We do not put small, read only
+ data into the C_2 section because we are not
+ using the C_2 section. We do not use the C_2
+ section because it is located with the other
+ read-only data sections, far away from the read-write
+ data sections and we only have one small data
+ pointer (r13). */
+ default:
+ break;
+ }
+ }
+
+ /* If we are supporting the Renesas assembler
+ we cannot use mergeable sections. */
+ if (TARGET_AS100_SYNTAX)
+ switch (categorize_decl_for_section (decl, reloc))
+ {
+ case SECCAT_RODATA_MERGE_CONST:
+ case SECCAT_RODATA_MERGE_STR_INIT:
+ case SECCAT_RODATA_MERGE_STR:
+ return readonly_data_section;
+
+ default:
+ break;
+ }
+
+ return default_elf_select_section (decl, reloc, align);
+}
+
+enum rx_builtin
+{
+ RX_BUILTIN_BRK,
+ RX_BUILTIN_CLRPSW,
+ RX_BUILTIN_INT,
+ RX_BUILTIN_MACHI,
+ RX_BUILTIN_MACLO,
+ RX_BUILTIN_MULHI,
+ RX_BUILTIN_MULLO,
+ RX_BUILTIN_MVFACHI,
+ RX_BUILTIN_MVFACMI,
+ RX_BUILTIN_MVFC,
+ RX_BUILTIN_MVTACHI,
+ RX_BUILTIN_MVTACLO,
+ RX_BUILTIN_MVTC,
+ RX_BUILTIN_MVTIPL,
+ RX_BUILTIN_RACW,
+ RX_BUILTIN_REVW,
+ RX_BUILTIN_RMPA,
+ RX_BUILTIN_ROUND,
+ RX_BUILTIN_SAT,
+ RX_BUILTIN_SETPSW,
+ RX_BUILTIN_WAIT,
+ RX_BUILTIN_max
+};
+
+static void
+rx_init_builtins (void)
+{
+#define ADD_RX_BUILTIN1(UC_NAME, LC_NAME, RET_TYPE, ARG_TYPE) \
+ add_builtin_function ("__builtin_rx_" LC_NAME, \
+ build_function_type_list (RET_TYPE##_type_node, \
+ ARG_TYPE##_type_node, \
+ NULL_TREE), \
+ RX_BUILTIN_##UC_NAME, \
+ BUILT_IN_MD, NULL, NULL_TREE)
+
+#define ADD_RX_BUILTIN2(UC_NAME, LC_NAME, RET_TYPE, ARG_TYPE1, ARG_TYPE2) \
+ add_builtin_function ("__builtin_rx_" LC_NAME, \
+ build_function_type_list (RET_TYPE##_type_node, \
+ ARG_TYPE1##_type_node,\
+ ARG_TYPE2##_type_node,\
+ NULL_TREE), \
+ RX_BUILTIN_##UC_NAME, \
+ BUILT_IN_MD, NULL, NULL_TREE)
+
+#define ADD_RX_BUILTIN3(UC_NAME,LC_NAME,RET_TYPE,ARG_TYPE1,ARG_TYPE2,ARG_TYPE3) \
+ add_builtin_function ("__builtin_rx_" LC_NAME, \
+ build_function_type_list (RET_TYPE##_type_node, \
+ ARG_TYPE1##_type_node,\
+ ARG_TYPE2##_type_node,\
+ ARG_TYPE3##_type_node,\
+ NULL_TREE), \
+ RX_BUILTIN_##UC_NAME, \
+ BUILT_IN_MD, NULL, NULL_TREE)
+
+ ADD_RX_BUILTIN1 (BRK, "brk", void, void);
+ ADD_RX_BUILTIN1 (CLRPSW, "clrpsw", void, integer);
+ ADD_RX_BUILTIN1 (SETPSW, "setpsw", void, integer);
+ ADD_RX_BUILTIN1 (INT, "int", void, integer);
+ ADD_RX_BUILTIN2 (MACHI, "machi", void, intSI, intSI);
+ ADD_RX_BUILTIN2 (MACLO, "maclo", void, intSI, intSI);
+ ADD_RX_BUILTIN2 (MULHI, "mulhi", void, intSI, intSI);
+ ADD_RX_BUILTIN2 (MULLO, "mullo", void, intSI, intSI);
+ ADD_RX_BUILTIN1 (MVFACHI, "mvfachi", intSI, void);
+ ADD_RX_BUILTIN1 (MVFACMI, "mvfacmi", intSI, void);
+ ADD_RX_BUILTIN1 (MVTACHI, "mvtachi", void, intSI);
+ ADD_RX_BUILTIN1 (MVTACLO, "mvtaclo", void, intSI);
+ ADD_RX_BUILTIN1 (RMPA, "rmpa", void, void);
+ ADD_RX_BUILTIN1 (MVFC, "mvfc", intSI, integer);
+ ADD_RX_BUILTIN2 (MVTC, "mvtc", void, integer, integer);
+ ADD_RX_BUILTIN1 (MVTIPL, "mvtipl", void, integer);
+ ADD_RX_BUILTIN1 (RACW, "racw", void, integer);
+ ADD_RX_BUILTIN1 (ROUND, "round", intSI, float);
+ ADD_RX_BUILTIN1 (REVW, "revw", intSI, intSI);
+ ADD_RX_BUILTIN1 (SAT, "sat", intSI, intSI);
+ ADD_RX_BUILTIN1 (WAIT, "wait", void, void);
+}
+
+static rtx
+rx_expand_void_builtin_1_arg (rtx arg, rtx (* gen_func)(rtx), bool reg)
+{
+ if (reg && ! REG_P (arg))
+ arg = force_reg (SImode, arg);
+
+ emit_insn (gen_func (arg));
+
+ return NULL_RTX;
+}
+
+static rtx
+rx_expand_builtin_mvtc (tree exp)
+{
+ rtx arg1 = expand_normal (CALL_EXPR_ARG (exp, 0));
+ rtx arg2 = expand_normal (CALL_EXPR_ARG (exp, 1));
+
+ if (! CONST_INT_P (arg1))
+ return NULL_RTX;
+
+ if (! REG_P (arg2))
+ arg2 = force_reg (SImode, arg2);
+
+ emit_insn (gen_mvtc (arg1, arg2));
+
+ return NULL_RTX;
+}
+
+static rtx
+rx_expand_builtin_mvfc (tree t_arg, rtx target)
+{
+ rtx arg = expand_normal (t_arg);
+
+ if (! CONST_INT_P (arg))
+ return NULL_RTX;
+
+ if (! REG_P (target))
+ target = force_reg (SImode, target);
+
+ emit_insn (gen_mvfc (target, arg));
+
+ return target;
+}
+
+static rtx
+rx_expand_builtin_mvtipl (rtx arg)
+{
+ /* The RX610 does not support the MVTIPL instruction. */
+ if (rx_cpu_type == RX610)
+ return NULL_RTX;
+
+ if (! CONST_INT_P (arg) || ! IN_RANGE (arg, 0, (1 << 4) - 1))
+ return NULL_RTX;
+
+ emit_insn (gen_mvtipl (arg));
+
+ return NULL_RTX;
+}
+
+static rtx
+rx_expand_builtin_mac (tree exp, rtx (* gen_func)(rtx, rtx))
+{
+ rtx arg1 = expand_normal (CALL_EXPR_ARG (exp, 0));
+ rtx arg2 = expand_normal (CALL_EXPR_ARG (exp, 1));
+
+ if (! REG_P (arg1))
+ arg1 = force_reg (SImode, arg1);
+
+ if (! REG_P (arg2))
+ arg2 = force_reg (SImode, arg2);
+
+ emit_insn (gen_func (arg1, arg2));
+
+ return NULL_RTX;
+}
+
+static rtx
+rx_expand_int_builtin_1_arg (rtx arg,
+ rtx target,
+ rtx (* gen_func)(rtx, rtx),
+ bool mem_ok)
+{
+ if (! REG_P (arg))
+ if (!mem_ok || ! MEM_P (arg))
+ arg = force_reg (SImode, arg);
+
+ if (target == NULL_RTX || ! REG_P (target))
+ target = gen_reg_rtx (SImode);
+
+ emit_insn (gen_func (target, arg));
+
+ return target;
+}
+
+static rtx
+rx_expand_int_builtin_0_arg (rtx target, rtx (* gen_func)(rtx))
+{
+ if (target == NULL_RTX || ! REG_P (target))
+ target = gen_reg_rtx (SImode);
+
+ emit_insn (gen_func (target));
+
+ return target;
+}
+
+static rtx
+rx_expand_builtin_round (rtx arg, rtx target)
+{
+ if ((! REG_P (arg) && ! MEM_P (arg))
+ || GET_MODE (arg) != SFmode)
+ arg = force_reg (SFmode, arg);
+
+ if (target == NULL_RTX || ! REG_P (target))
+ target = gen_reg_rtx (SImode);
+
+ emit_insn (gen_lrintsf2 (target, arg));
+
+ return target;
+}
+
+static rtx
+rx_expand_builtin (tree exp,
+ rtx target,
+ rtx subtarget ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ int ignore ATTRIBUTE_UNUSED)
+{
+ tree fndecl = TREE_OPERAND (CALL_EXPR_FN (exp), 0);
+ tree arg = CALL_EXPR_ARGS (exp) ? CALL_EXPR_ARG (exp, 0) : NULL_TREE;
+ rtx op = arg ? expand_normal (arg) : NULL_RTX;
+ unsigned int fcode = DECL_FUNCTION_CODE (fndecl);
+
+ switch (fcode)
+ {
+ case RX_BUILTIN_BRK: emit_insn (gen_brk ()); return NULL_RTX;
+ case RX_BUILTIN_CLRPSW: return rx_expand_void_builtin_1_arg
+ (op, gen_clrpsw, false);
+ case RX_BUILTIN_SETPSW: return rx_expand_void_builtin_1_arg
+ (op, gen_setpsw, false);
+ case RX_BUILTIN_INT: return rx_expand_void_builtin_1_arg
+ (op, gen_int, false);
+ case RX_BUILTIN_MACHI: return rx_expand_builtin_mac (exp, gen_machi);
+ case RX_BUILTIN_MACLO: return rx_expand_builtin_mac (exp, gen_maclo);
+ case RX_BUILTIN_MULHI: return rx_expand_builtin_mac (exp, gen_mulhi);
+ case RX_BUILTIN_MULLO: return rx_expand_builtin_mac (exp, gen_mullo);
+ case RX_BUILTIN_MVFACHI: return rx_expand_int_builtin_0_arg
+ (target, gen_mvfachi);
+ case RX_BUILTIN_MVFACMI: return rx_expand_int_builtin_0_arg
+ (target, gen_mvfacmi);
+ case RX_BUILTIN_MVTACHI: return rx_expand_void_builtin_1_arg
+ (op, gen_mvtachi, true);
+ case RX_BUILTIN_MVTACLO: return rx_expand_void_builtin_1_arg
+ (op, gen_mvtaclo, true);
+ case RX_BUILTIN_RMPA: emit_insn (gen_rmpa ()); return NULL_RTX;
+ case RX_BUILTIN_MVFC: return rx_expand_builtin_mvfc (arg, target);
+ case RX_BUILTIN_MVTC: return rx_expand_builtin_mvtc (exp);
+ case RX_BUILTIN_MVTIPL: return rx_expand_builtin_mvtipl (op);
+ case RX_BUILTIN_RACW: return rx_expand_void_builtin_1_arg
+ (op, gen_racw, false);
+ case RX_BUILTIN_ROUND: return rx_expand_builtin_round (op, target);
+ case RX_BUILTIN_REVW: return rx_expand_int_builtin_1_arg
+ (op, target, gen_revw, false);
+ case RX_BUILTIN_SAT: return rx_expand_int_builtin_1_arg
+ (op, target, gen_sat, false);
+ case RX_BUILTIN_WAIT: emit_insn (gen_wait ()); return NULL_RTX;
+
+ default:
+ internal_error ("bad builtin code");
+ break;
+ }
+
+ return NULL_RTX;
+}
+
+/* Place an element into a constructor or destructor section.
+ Like default_ctor_section_asm_out_constructor in varasm.c
+ except that it uses .init_array (or .fini_array) and it
+ handles constructor priorities. */
+
+static void
+rx_elf_asm_cdtor (rtx symbol, int priority, bool is_ctor)
+{
+ section * s;
+
+ if (priority != DEFAULT_INIT_PRIORITY)
+ {
+ char buf[18];
+
+ sprintf (buf, "%s.%.5u",
+ is_ctor ? ".init_array" : ".fini_array",
+ priority);
+ s = get_section (buf, SECTION_WRITE, NULL_TREE);
+ }
+ else if (is_ctor)
+ s = ctors_section;
+ else
+ s = dtors_section;
+
+ switch_to_section (s);
+ assemble_align (POINTER_SIZE);
+ assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
+}
+
+static void
+rx_elf_asm_constructor (rtx symbol, int priority)
+{
+ rx_elf_asm_cdtor (symbol, priority, /* is_ctor= */true);
+}
+
+static void
+rx_elf_asm_destructor (rtx symbol, int priority)
+{
+ rx_elf_asm_cdtor (symbol, priority, /* is_ctor= */false);
+}
+
+/* Check "fast_interrupt", "interrupt" and "naked" attributes. */
+
+static tree
+rx_handle_func_attribute (tree * node,
+ tree name,
+ tree args,
+ int flags ATTRIBUTE_UNUSED,
+ bool * no_add_attrs)
+{
+ gcc_assert (DECL_P (* node));
+ gcc_assert (args == NULL_TREE);
+
+ if (TREE_CODE (* node) != FUNCTION_DECL)
+ {
+ warning (OPT_Wattributes, "%qE attribute only applies to functions",
+ name);
+ * no_add_attrs = true;
+ }
+
+ /* FIXME: We ought to check for conflicting attributes. */
+
+ /* FIXME: We ought to check that the interrupt and exception
+ handler attributes have been applied to void functions. */
+ return NULL_TREE;
+}
+
+/* Table of RX specific attributes. */
+const struct attribute_spec rx_attribute_table[] =
+{
+ /* Name, min_len, max_len, decl_req, type_req, fn_type_req, handler. */
+ { "fast_interrupt", 0, 0, true, false, false, rx_handle_func_attribute },
+ { "interrupt", 0, 0, true, false, false, rx_handle_func_attribute },
+ { "naked", 0, 0, true, false, false, rx_handle_func_attribute },
+ { NULL, 0, 0, false, false, false, NULL }
+};
+
+static bool
+rx_allocate_stack_slots_for_args (void)
+{
+ /* Naked functions should not allocate stack slots for arguments. */
+ return ! is_naked_func (NULL_TREE);
+}
+
+static bool
+rx_func_attr_inlinable (const_tree decl)
+{
+ return ! is_fast_interrupt_func (decl)
+ && ! is_interrupt_func (decl)
+ && ! is_naked_func (decl);
+}
+
+static void
+rx_file_start (void)
+{
+ if (! TARGET_AS100_SYNTAX)
+ default_file_start ();
+}
+
+static bool
+rx_is_ms_bitfield_layout (const_tree record_type ATTRIBUTE_UNUSED)
+{
+ return TRUE;
+}
+
+/* Try to generate code for the "isnv" pattern which inserts bits
+ into a word.
+ operands[0] => Location to be altered.
+ operands[1] => Number of bits to change.
+ operands[2] => Starting bit.
+ operands[3] => Value to insert.
+ Returns TRUE if successful, FALSE otherwise. */
+
+bool
+rx_expand_insv (rtx * operands)
+{
+ if (INTVAL (operands[1]) != 1
+ || ! CONST_INT_P (operands[3]))
+ return false;
+
+ if (MEM_P (operands[0])
+ && INTVAL (operands[2]) > 7)
+ return false;
+
+ switch (INTVAL (operands[3]))
+ {
+ case 0:
+ if (MEM_P (operands[0]))
+ emit_insn (gen_bitclr_in_memory (operands[0], operands[0],
+ operands[2]));
+ else
+ emit_insn (gen_bitclr (operands[0], operands[0], operands[2]));
+ break;
+ case 1:
+ case -1:
+ if (MEM_P (operands[0]))
+ emit_insn (gen_bitset_in_memory (operands[0], operands[0],
+ operands[2]));
+ else
+ emit_insn (gen_bitset (operands[0], operands[0], operands[2]));
+ break;
+ default:
+ return false;
+ }
+ return true;
+}
+
+/* Returns true if X a legitimate constant for an immediate
+ operand on the RX. X is already known to satisfy CONSTANT_P. */
+
+bool
+rx_is_legitimate_constant (rtx x)
+{
+ HOST_WIDE_INT val;
+
+ switch (GET_CODE (x))
+ {
+ case CONST:
+ x = XEXP (x, 0);
+
+ if (GET_CODE (x) == PLUS)
+ {
+ if (! CONST_INT_P (XEXP (x, 1)))
+ return false;
+
+ /* GCC would not pass us CONST_INT + CONST_INT so we
+ know that we have {SYMBOL|LABEL} + CONST_INT. */
+ x = XEXP (x, 0);
+ gcc_assert (! CONST_INT_P (x));
+ }
+
+ switch (GET_CODE (x))
+ {
+ case LABEL_REF:
+ case SYMBOL_REF:
+ return true;
+
+ /* One day we may have to handle UNSPEC constants here. */
+ default:
+ /* FIXME: Can this ever happen ? */
+ abort ();
+ return false;
+ }
+ break;
+
+ case LABEL_REF:
+ case SYMBOL_REF:
+ return true;
+ case CONST_DOUBLE:
+ return rx_max_constant_size == 0;
+ case CONST_VECTOR:
+ return false;
+ default:
+ gcc_assert (CONST_INT_P (x));
+ break;
+ }
+
+ if (rx_max_constant_size == 0)
+ /* If there is no constraint on the size of constants
+ used as operands, then any value is legitimate. */
+ return true;
+
+ val = INTVAL (x);
+
+ /* rx_max_constant_size specifies the maximum number
+ of bytes that can be used to hold a signed value. */
+ return IN_RANGE (val, (-1 << (rx_max_constant_size * 8)),
+ ( 1 << (rx_max_constant_size * 8)));
+}
+
+/* This is a tri-state variable. The default value of 0 means that the user
+ has specified neither -mfpu nor -mnofpu on the command line. In this case
+ the selection of RX FPU instructions is entirely based upon the size of
+ the floating point object and whether unsafe math optimizations were
+ enabled. If 32-bit doubles have been enabled then both floats and doubles
+ can make use of FPU instructions, otherwise only floats may do so.
+
+ If the value is 1 then the user has specified -mfpu and the FPU
+ instructions should be used. Unsafe math optimizations will automatically
+ be enabled and doubles set to 32-bits. If the value is -1 then -mnofpu
+ has been specified and FPU instructions will not be used, even if unsafe
+ math optimizations have been enabled. */
+int rx_enable_fpu = 0;
+
+/* Extra processing for target specific command line options. */
+
+static bool
+rx_handle_option (size_t code, const char * arg ATTRIBUTE_UNUSED, int value)
+{
+ switch (code)
+ {
+ /* -mfpu enables the use of RX FPU instructions. This implies the use
+ of 32-bit doubles and also the enabling of fast math optimizations.
+ (Since the RX FPU instructions are not IEEE compliant). The -mnofpu
+ option disables the use of RX FPU instructions, but does not make
+ place any constraints on the size of doubles or the use of fast math
+ optimizations.
+
+ The selection of 32-bit vs 64-bit doubles is handled by the setting
+ of the 32BIT_DOUBLES mask in the rx.opt file. Enabling fast math
+ optimizations is performed in OVERRIDE_OPTIONS since if it was done
+ here it could be overridden by a -fno-fast-math option specified
+ *earlier* on the command line. (Target specific options are
+ processed before generic ones). */
+ case OPT_fpu:
+ rx_enable_fpu = 1;
+ break;
+
+ case OPT_nofpu:
+ rx_enable_fpu = -1;
+ break;
+
+ case OPT_mint_register_:
+ switch (value)
+ {
+ case 4:
+ fixed_regs[10] = call_used_regs [10] = 1;
+ /* Fall through. */
+ case 3:
+ fixed_regs[11] = call_used_regs [11] = 1;
+ /* Fall through. */
+ case 2:
+ fixed_regs[12] = call_used_regs [12] = 1;
+ /* Fall through. */
+ case 1:
+ fixed_regs[13] = call_used_regs [13] = 1;
+ /* Fall through. */
+ case 0:
+ return true;
+ default:
+ return false;
+ }
+ break;
+
+ case OPT_mmax_constant_size_:
+ /* Make sure that the -mmax-constant_size option is in range. */
+ return IN_RANGE (value, 0, 4);
+
+ case OPT_mcpu_:
+ case OPT_patch_:
+ if (strcasecmp (arg, "RX610") == 0)
+ rx_cpu_type = RX610;
+ /* FIXME: Should we check for non-RX cpu names here ? */
+ break;
+
+ default:
+ break;
+ }
+
+ return true;
+}
+
+static int
+rx_address_cost (rtx addr, bool speed)
+{
+ rtx a, b;
+
+ if (GET_CODE (addr) != PLUS)
+ return COSTS_N_INSNS (1);
+
+ a = XEXP (addr, 0);
+ b = XEXP (addr, 1);
+
+ if (REG_P (a) && REG_P (b))
+ /* Try to discourage REG+REG addressing as it keeps two registers live. */
+ return COSTS_N_INSNS (4);
+
+ if (speed)
+ /* [REG+OFF] is just as fast as [REG]. */
+ return COSTS_N_INSNS (1);
+
+ if (CONST_INT_P (b)
+ && ((INTVAL (b) > 128) || INTVAL (b) < -127))
+ /* Try to discourage REG + <large OFF> when optimizing for size. */
+ return COSTS_N_INSNS (2);
+
+ return COSTS_N_INSNS (1);
+}
+
+static bool
+rx_can_eliminate (const int from ATTRIBUTE_UNUSED, const int to)
+{
+ /* We can always eliminate to the frame pointer.
+ We can eliminate to the stack pointer unless a frame
+ pointer is needed. */
+
+ return to == FRAME_POINTER_REGNUM
+ || ( to == STACK_POINTER_REGNUM && ! frame_pointer_needed);
+}
+
+
+static void
+rx_trampoline_template (FILE * file)
+{
+ /* Output assembler code for a block containing the constant
+ part of a trampoline, leaving space for the variable parts.
+
+ On the RX, (where r8 is the static chain regnum) the trampoline
+ looks like:
+
+ mov #<static chain value>, r8
+ mov #<function's address>, r9
+ jmp r9
+
+ In big-endian-data-mode however instructions are read into the CPU
+ 4 bytes at a time. These bytes are then swapped around before being
+ passed to the decoder. So...we must partition our trampoline into
+ 4 byte packets and swap these packets around so that the instruction
+ reader will reverse the process. But, in order to avoid splitting
+ the 32-bit constants across these packet boundaries, (making inserting
+ them into the constructed trampoline very difficult) we have to pad the
+ instruction sequence with NOP insns. ie:
+
+ nop
+ nop
+ mov.l #<...>, r8
+ nop
+ nop
+ mov.l #<...>, r9
+ jmp r9
+ nop
+ nop */
+
+ if (! TARGET_BIG_ENDIAN_DATA)
+ {
+ asm_fprintf (file, "\tmov.L\t#0deadbeefH, r%d\n", STATIC_CHAIN_REGNUM);
+ asm_fprintf (file, "\tmov.L\t#0deadbeefH, r%d\n", TRAMPOLINE_TEMP_REGNUM);
+ asm_fprintf (file, "\tjmp\tr%d\n", TRAMPOLINE_TEMP_REGNUM);
+ }
+ else
+ {
+ char r8 = '0' + STATIC_CHAIN_REGNUM;
+ char r9 = '0' + TRAMPOLINE_TEMP_REGNUM;
+
+ if (TARGET_AS100_SYNTAX)
+ {
+ asm_fprintf (file, "\t.BYTE 0%c2H, 0fbH, 003H, 003H\n", r8);
+ asm_fprintf (file, "\t.BYTE 0deH, 0adH, 0beH, 0efH\n");
+ asm_fprintf (file, "\t.BYTE 0%c2H, 0fbH, 003H, 003H\n", r9);
+ asm_fprintf (file, "\t.BYTE 0deH, 0adH, 0beH, 0efH\n");
+ asm_fprintf (file, "\t.BYTE 003H, 003H, 00%cH, 07fH\n", r9);
+ }
+ else
+ {
+ asm_fprintf (file, "\t.byte 0x%c2, 0xfb, 0x03, 0x03\n", r8);
+ asm_fprintf (file, "\t.byte 0xde, 0xad, 0xbe, 0xef\n");
+ asm_fprintf (file, "\t.byte 0x%c2, 0xfb, 0x03, 0x03\n", r9);
+ asm_fprintf (file, "\t.byte 0xde, 0xad, 0xbe, 0xef\n");
+ asm_fprintf (file, "\t.byte 0x03, 0x03, 0x0%c, 0x7f\n", r9);
+ }
+ }
+}
+
+static void
+rx_trampoline_init (rtx tramp, tree fndecl, rtx chain)
+{
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
+
+ emit_block_move (tramp, assemble_trampoline_template (),
+ GEN_INT (TRAMPOLINE_SIZE), BLOCK_OP_NORMAL);
+
+ if (TARGET_BIG_ENDIAN_DATA)
+ {
+ emit_move_insn (adjust_address (tramp, SImode, 4), chain);
+ emit_move_insn (adjust_address (tramp, SImode, 12), fnaddr);
+ }
+ else
+ {
+ emit_move_insn (adjust_address (tramp, SImode, 2), chain);
+ emit_move_insn (adjust_address (tramp, SImode, 6 + 2), fnaddr);
+ }
+}
+
+#undef TARGET_FUNCTION_VALUE
+#define TARGET_FUNCTION_VALUE rx_function_value
+
+#undef TARGET_RETURN_IN_MSB
+#define TARGET_RETURN_IN_MSB rx_return_in_msb
+
+#undef TARGET_IN_SMALL_DATA_P
+#define TARGET_IN_SMALL_DATA_P rx_in_small_data
+
+#undef TARGET_RETURN_IN_MEMORY
+#define TARGET_RETURN_IN_MEMORY rx_return_in_memory
+
+#undef TARGET_HAVE_SRODATA_SECTION
+#define TARGET_HAVE_SRODATA_SECTION true
+
+#undef TARGET_ASM_SELECT_RTX_SECTION
+#define TARGET_ASM_SELECT_RTX_SECTION rx_select_rtx_section
+
+#undef TARGET_ASM_SELECT_SECTION
+#define TARGET_ASM_SELECT_SECTION rx_select_section
+
+#undef TARGET_INIT_BUILTINS
+#define TARGET_INIT_BUILTINS rx_init_builtins
+
+#undef TARGET_EXPAND_BUILTIN
+#define TARGET_EXPAND_BUILTIN rx_expand_builtin
+
+#undef TARGET_ASM_CONSTRUCTOR
+#define TARGET_ASM_CONSTRUCTOR rx_elf_asm_constructor
+
+#undef TARGET_ASM_DESTRUCTOR
+#define TARGET_ASM_DESTRUCTOR rx_elf_asm_destructor
+
+#undef TARGET_STRUCT_VALUE_RTX
+#define TARGET_STRUCT_VALUE_RTX rx_struct_value_rtx
+
+#undef TARGET_ATTRIBUTE_TABLE
+#define TARGET_ATTRIBUTE_TABLE rx_attribute_table
+
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START rx_file_start
+
+#undef TARGET_MS_BITFIELD_LAYOUT_P
+#define TARGET_MS_BITFIELD_LAYOUT_P rx_is_ms_bitfield_layout
+
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P rx_is_legitimate_address
+
+#undef TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS
+#define TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS rx_allocate_stack_slots_for_args
+
+#undef TARGET_ASM_FUNCTION_PROLOGUE
+#define TARGET_ASM_FUNCTION_PROLOGUE rx_output_function_prologue
+
+#undef TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P
+#define TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P rx_func_attr_inlinable
+
+#undef TARGET_SET_CURRENT_FUNCTION
+#define TARGET_SET_CURRENT_FUNCTION rx_set_current_function
+
+#undef TARGET_HANDLE_OPTION
+#define TARGET_HANDLE_OPTION rx_handle_option
+
+#undef TARGET_ASM_INTEGER
+#define TARGET_ASM_INTEGER rx_assemble_integer
+
+#undef TARGET_USE_BLOCKS_FOR_CONSTANT_P
+#define TARGET_USE_BLOCKS_FOR_CONSTANT_P hook_bool_mode_const_rtx_true
+
+#undef TARGET_MAX_ANCHOR_OFFSET
+#define TARGET_MAX_ANCHOR_OFFSET 32
+
+#undef TARGET_ADDRESS_COST
+#define TARGET_ADDRESS_COST rx_address_cost
+
+#undef TARGET_CAN_ELIMINATE
+#define TARGET_CAN_ELIMINATE rx_can_eliminate
+
+#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
+#define TARGET_ASM_TRAMPOLINE_TEMPLATE rx_trampoline_template
+
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT rx_trampoline_init
+
+struct gcc_target targetm = TARGET_INITIALIZER;
+
+/* #include "gt-rx.h" */
diff --git a/gcc/config/rx/rx.h b/gcc/config/rx/rx.h
new file mode 100644
index 00000000000..bb7cf7f1e3e
--- /dev/null
+++ b/gcc/config/rx/rx.h
@@ -0,0 +1,659 @@
+/* GCC backend definitions for the Renesas RX processor.
+ Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+ Contributed by Red Hat.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+
+ GCC is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+
+#define TARGET_CPU_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define ("__RX__"); \
+ builtin_assert ("cpu=RX"); \
+ if (rx_cpu_type == RX610) \
+ builtin_assert ("machine=RX610"); \
+ else \
+ builtin_assert ("machine=RX600"); \
+ \
+ if (TARGET_BIG_ENDIAN_DATA) \
+ builtin_define ("__RX_BIG_ENDIAN__"); \
+ else \
+ builtin_define ("__RX_LITTLE_ENDIAN__");\
+ \
+ if (TARGET_32BIT_DOUBLES) \
+ builtin_define ("__RX_32BIT_DOUBLES__");\
+ else \
+ builtin_define ("__RX_64BIT_DOUBLES__");\
+ \
+ if (ALLOW_RX_FPU_INSNS) \
+ builtin_define ("__RX_FPU_INSNS__"); \
+ \
+ if (TARGET_AS100_SYNTAX) \
+ builtin_define ("__RX_AS100_SYNTAX__"); \
+ else \
+ builtin_define ("__RX_GAS_SYNTAX__"); \
+ } \
+ while (0)
+
+enum rx_cpu_types
+{
+ RX600,
+ RX610
+};
+
+extern enum rx_cpu_types rx_cpu_type;
+
+#undef CC1_SPEC
+#define CC1_SPEC "%{mas100-syntax:%{gdwarf*:%e-mas100-syntax is incompatible with -gdwarf}}"
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:crt0.o%s} crtbegin.o%s"
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC "crtend.o%s crtn.o%s"
+
+#undef ASM_SPEC
+#define ASM_SPEC "\
+%{mbig-endian-data:-mbig-endian-data} \
+%{m32bit-doubles:-m32bit-doubles} \
+%{!m32bit-doubles:-m64bit-doubles} \
+%{msmall-data-limit*:-msmall-data-limit} \
+%{mrelax:-relax} \
+"
+
+#undef LIB_SPEC
+#define LIB_SPEC " \
+--start-group \
+-lc \
+%{msim*:-lsim}%{!msim*:-lnosys} \
+%{fprofile-arcs|fprofile-generate|coverage:-lgcov} \
+--end-group \
+%{!T*: %{msim*:%Trx-sim.ld}%{!msim*:%Trx.ld}} \
+"
+
+#undef LINK_SPEC
+#define LINK_SPEC "%{mbig-endian-data:--oformat elf32-rx-be} %{mrelax:-relax}"
+
+
+#define BITS_BIG_ENDIAN 0
+#define BYTES_BIG_ENDIAN TARGET_BIG_ENDIAN_DATA
+#define WORDS_BIG_ENDIAN TARGET_BIG_ENDIAN_DATA
+
+#ifdef __RX_BIG_ENDIAN__
+#define LIBGCC2_WORDS_BIG_ENDIAN 1
+#else
+#define LIBGCC2_WORDS_BIG_ENDIAN 0
+#endif
+
+#define UNITS_PER_WORD 4
+
+#define INT_TYPE_SIZE 32
+#define LONG_TYPE_SIZE 32
+#define LONG_LONG_TYPE_SIZE 64
+
+#define FLOAT_TYPE_SIZE 32
+#define DOUBLE_TYPE_SIZE (TARGET_32BIT_DOUBLES ? 32 : 64)
+#define LONG_DOUBLE_TYPE_SIZE DOUBLE_TYPE_SIZE
+
+#ifdef __RX_32BIT_DOUBLES__
+#define LIBGCC2_HAS_DF_MODE 0
+#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 32
+#define LIBGCC2_DOUBLE_TYPE_SIZE 32
+#else
+#define LIBGCC2_HAS_DF_MODE 1
+#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
+#define LIBGCC2_DOUBLE_TYPE_SIZE 64
+#endif
+
+#define DEFAULT_SIGNED_CHAR 0
+
+#define STRICT_ALIGNMENT 1
+#define FUNCTION_BOUNDARY 8
+#define BIGGEST_ALIGNMENT 32
+#define STACK_BOUNDARY 32
+#define PARM_BOUNDARY 8
+
+#define FUNCTION_ARG_BOUNDARY(MODE, TYPE) 32
+
+#define STACK_GROWS_DOWNWARD 1
+#define FRAME_GROWS_DOWNWARD 0
+#define FIRST_PARM_OFFSET(FNDECL) 0
+
+#define MAX_REGS_PER_ADDRESS 2
+
+#define Pmode SImode
+#define POINTER_SIZE 32
+#undef SIZE_TYPE
+#define SIZE_TYPE "long unsigned int"
+#define POINTERS_EXTEND_UNSIGNED 1
+#define FUNCTION_MODE QImode
+#define CASE_VECTOR_MODE Pmode
+#define WORD_REGISTER_OPERATIONS 1
+#define HAS_LONG_COND_BRANCH 0
+#define HAS_LONG_UNCOND_BRANCH 0
+
+#define MOVE_MAX 4
+#define STARTING_FRAME_OFFSET 0
+
+#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, SIZE) 0
+#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
+
+#define LEGITIMATE_CONSTANT_P(X) rx_is_legitimate_constant (X)
+
+#define HANDLE_PRAGMA_PACK_PUSH_POP 1
+
+#define HAVE_PRE_DECCREMENT 1
+#define HAVE_POST_INCREMENT 1
+
+#define MOVE_RATIO(SPEED) ((SPEED) ? 4 : 2)
+#define SLOW_BYTE_ACCESS 1
+
+#define STORE_FLAG_VALUE 1
+#define LOAD_EXTEND_OP(MODE) SIGN_EXTEND
+#define SHORT_IMMEDIATES_SIGN_EXTEND 1
+
+enum reg_class
+{
+ NO_REGS, /* No registers in set. */
+ GR_REGS, /* Integer registers. */
+ ALL_REGS, /* All registers. */
+ LIM_REG_CLASSES /* Max value + 1. */
+};
+
+#define REG_CLASS_NAMES \
+{ \
+ "NO_REGS", \
+ "GR_REGS", \
+ "ALL_REGS" \
+}
+
+#define REG_CLASS_CONTENTS \
+{ \
+ { 0x00000000 }, /* No registers, */ \
+ { 0x0000ffff }, /* Integer registers. */ \
+ { 0x0000ffff } /* All registers. */ \
+}
+
+#define IRA_COVER_CLASSES \
+ { \
+ GR_REGS, LIM_REG_CLASSES \
+ }
+
+#define SMALL_REGISTER_CLASSES 0
+#define N_REG_CLASSES (int) LIM_REG_CLASSES
+#define CLASS_MAX_NREGS(CLASS, MODE) ((GET_MODE_SIZE (MODE) \
+ + UNITS_PER_WORD - 1) \
+ / UNITS_PER_WORD)
+
+#define GENERAL_REGS GR_REGS
+#define BASE_REG_CLASS GR_REGS
+#define INDEX_REG_CLASS GR_REGS
+
+#define FIRST_PSEUDO_REGISTER 16
+
+#define REGNO_REG_CLASS(REGNO) ((REGNO) < FIRST_PSEUDO_REGISTER \
+ ? GR_REGS : NO_REGS)
+
+#define STACK_POINTER_REGNUM 0
+#define FUNC_RETURN_REGNUM 1
+#define FRAME_POINTER_REGNUM 6
+#define ARG_POINTER_REGNUM 7
+#define STATIC_CHAIN_REGNUM 8
+#define TRAMPOLINE_TEMP_REGNUM 9
+#define STRUCT_VAL_REGNUM 15
+
+/* This is the register which is used to hold the address of the start
+ of the small data area, if that feature is being used. Note - this
+ register must not be call_used because otherwise library functions
+ that are compiled without small data support might clobber it.
+
+ FIXME: The function gcc/config/rx/rx.c:rx_gen_move_template() has a
+ built in copy of this register's name, rather than constructing the
+ name from this #define. */
+#define GP_BASE_REGNUM 13
+
+#define ELIMINABLE_REGS \
+{{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
+ { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM }, \
+ { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM }}
+
+#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
+ (OFFSET) = rx_initial_elimination_offset ((FROM), (TO))
+
+
+#define FUNCTION_ARG_REGNO_P(N) (((N) >= 1) && ((N) <= 4))
+#define FUNCTION_VALUE_REGNO_P(N) ((N) == FUNC_RETURN_REGNUM)
+#define DEFAULT_PCC_STRUCT_RETURN 0
+
+#define FIXED_REGISTERS \
+{ \
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 \
+}
+
+#define CALL_USED_REGISTERS \
+{ \
+ 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 \
+}
+
+#define CONDITIONAL_REGISTER_USAGE \
+ rx_conditional_register_usage ()
+
+#define LIBCALL_VALUE(MODE) \
+ gen_rtx_REG (((GET_MODE_CLASS (MODE) != MODE_INT \
+ || GET_MODE_SIZE (MODE) >= 4) \
+ ? (MODE) \
+ : SImode), \
+ FUNC_RETURN_REGNUM)
+
+/* Order of allocation of registers. */
+
+#define REG_ALLOC_ORDER \
+{ 7, 10, 11, 12, 13, 14, 4, 3, 2, 1, 9, 8, 6, 5, 15 \
+}
+
+#define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS
+
+#define REGNO_IN_RANGE(REGNO, MIN, MAX) \
+ (IN_RANGE ((REGNO), (MIN), (MAX)) \
+ || (reg_renumber != NULL \
+ && reg_renumber[(REGNO)] >= (MIN) \
+ && reg_renumber[(REGNO)] <= (MAX)))
+
+#ifdef REG_OK_STRICT
+#define REGNO_OK_FOR_BASE_P(regno) REGNO_IN_RANGE (regno, 0, 15)
+#else
+#define REGNO_OK_FOR_BASE_P(regno) 1
+#endif
+
+#define REGNO_OK_FOR_INDEX_P(regno) REGNO_OK_FOR_BASE_P (regno)
+
+#define RTX_OK_FOR_BASE(X, STRICT) \
+ ((STRICT) ? \
+ ( (REG_P (X) \
+ && REGNO_IN_RANGE (REGNO (X), 0, 15)) \
+ || (GET_CODE (X) == SUBREG \
+ && REG_P (SUBREG_REG (X)) \
+ && REGNO_IN_RANGE (REGNO (SUBREG_REG (X)), 0, 15))) \
+ : \
+ ( (REG_P (X) \
+ || (GET_CODE (X) == SUBREG \
+ && REG_P (SUBREG_REG (X))))))
+
+#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \
+ do \
+ { \
+ if (rx_is_mode_dependent_addr (ADDR)) \
+ goto LABEL; \
+ } \
+ while (0)
+
+
+#define RETURN_ADDR_RTX(COUNT, FRAMEADDR) \
+ ((COUNT) == 0 \
+ ? gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, arg_pointer_rtx, GEN_INT (-4))) \
+ : NULL_RTX)
+
+#define INCOMING_RETURN_ADDR_RTX gen_rtx_MEM (Pmode, stack_pointer_rtx)
+
+#define ACCUMULATE_OUTGOING_ARGS 1
+
+typedef unsigned int CUMULATIVE_ARGS;
+
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
+ (CUM) = 0
+
+#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
+ rx_function_arg (& CUM, MODE, TYPE, NAMED)
+
+#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
+ (CUM) += rx_function_arg_size (MODE, TYPE)
+
+#define TRAMPOLINE_SIZE (! TARGET_BIG_ENDIAN_DATA ? 14 : 20)
+#define TRAMPOLINE_ALIGNMENT 32
+
+#define NO_PROFILE_COUNTERS 1
+#define PROFILE_BEFORE_PROLOGUE 1
+
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ fprintf (FILE, "\tbsr\t__mcount\n");
+
+
+#define HARD_REGNO_NREGS(REGNO, MODE) CLASS_MAX_NREGS (0, MODE)
+
+#define HARD_REGNO_MODE_OK(REGNO, MODE) \
+ REGNO_REG_CLASS (REGNO) == GR_REGS
+
+#define MODES_TIEABLE_P(MODE1, MODE2) \
+ ( ( GET_MODE_CLASS (MODE1) == MODE_FLOAT \
+ || GET_MODE_CLASS (MODE1) == MODE_COMPLEX_FLOAT) \
+ == ( GET_MODE_CLASS (MODE2) == MODE_FLOAT \
+ || GET_MODE_CLASS (MODE2) == MODE_COMPLEX_FLOAT))
+
+
+#define REGISTER_NAMES \
+ { \
+ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
+ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15" \
+ };
+
+#define ADDITIONAL_REGISTER_NAMES \
+{ \
+ { "sp", STACK_POINTER_REGNUM } \
+ , { "fp", FRAME_POINTER_REGNUM } \
+ , { "arg", ARG_POINTER_REGNUM } \
+ , { "chain", STATIC_CHAIN_REGNUM } \
+}
+
+#define DATA_SECTION_ASM_OP \
+ (TARGET_AS100_SYNTAX ? "\t.SECTION D,DATA" \
+ : "\t.section D,\"aw\",@progbits\n\t.p2align 2")
+
+#define SDATA_SECTION_ASM_OP \
+ (TARGET_AS100_SYNTAX ? "\t.SECTION D_2,DATA,ALIGN=2" \
+ : "\t.section D_2,\"aw\",@progbits\n\t.p2align 1")
+
+#undef READONLY_DATA_SECTION_ASM_OP
+#define READONLY_DATA_SECTION_ASM_OP \
+ (TARGET_AS100_SYNTAX ? "\t.SECTION C,ROMDATA,ALIGN=4" \
+ : "\t.section C,\"a\",@progbits\n\t.p2align 2")
+
+#define BSS_SECTION_ASM_OP \
+ (TARGET_AS100_SYNTAX ? "\t.SECTION B,DATA,ALIGN=4" \
+ : "\t.section B,\"w\",@nobits\n\t.p2align 2")
+
+#define SBSS_SECTION_ASM_OP \
+ (TARGET_AS100_SYNTAX ? "\t.SECTION B_2,DATA,ALIGN=2" \
+ : "\t.section B_2,\"w\",@nobits\n\t.p2align 1")
+
+/* The following definitions are conditional depending upon whether the
+ compiler is being built or crtstuff.c is being compiled by the built
+ compiler. */
+#if defined CRT_BEGIN || defined CRT_END
+# ifdef __RX_AS100_SYNTAX
+# define TEXT_SECTION_ASM_OP "\t.SECTION P,CODE"
+# define CTORS_SECTION_ASM_OP "\t.SECTION init_array,CODE"
+# define DTORS_SECTION_ASM_OP "\t.SECTION fini_array,CODE"
+# define INIT_ARRAY_SECTION_ASM_OP "\t.SECTION init_array,CODE"
+# define FINI_ARRAY_SECTION_ASM_OP "\t.SECTION fini_array,CODE"
+# else
+# define TEXT_SECTION_ASM_OP "\t.section P,\"ax\""
+# define CTORS_SECTION_ASM_OP \
+ "\t.section\t.init_array,\"aw\",@init_array"
+# define DTORS_SECTION_ASM_OP \
+ "\t.section\t.fini_array,\"aw\",@fini_array"
+# define INIT_ARRAY_SECTION_ASM_OP \
+ "\t.section\t.init_array,\"aw\",@init_array"
+# define FINI_ARRAY_SECTION_ASM_OP \
+ "\t.section\t.fini_array,\"aw\",@fini_array"
+# endif
+#else
+# define TEXT_SECTION_ASM_OP \
+ (TARGET_AS100_SYNTAX ? "\t.SECTION P,CODE" : "\t.section P,\"ax\"")
+
+# define CTORS_SECTION_ASM_OP \
+ (TARGET_AS100_SYNTAX ? "\t.SECTION init_array,CODE" \
+ : "\t.section\t.init_array,\"aw\",@init_array")
+
+# define DTORS_SECTION_ASM_OP \
+ (TARGET_AS100_SYNTAX ? "\t.SECTION fini_array,CODE" \
+ : "\t.section\t.fini_array,\"aw\",@fini_array")
+
+# define INIT_ARRAY_SECTION_ASM_OP \
+ (TARGET_AS100_SYNTAX ? "\t.SECTION init_array,CODE" \
+ : "\t.section\t.init_array,\"aw\",@init_array")
+
+# define FINI_ARRAY_SECTION_ASM_OP \
+ (TARGET_AS100_SYNTAX ? "\t.SECTION fini_array,CODE" \
+ : "\t.section\t.fini_array,\"aw\",@fini_array")
+#endif
+
+#define GLOBAL_ASM_OP \
+ (TARGET_AS100_SYNTAX ? "\t.GLB\t" : "\t.global\t")
+#define ASM_COMMENT_START " ;"
+#define ASM_APP_ON ""
+#define ASM_APP_OFF ""
+#define LOCAL_LABEL_PREFIX "L"
+#undef USER_LABEL_PREFIX
+#define USER_LABEL_PREFIX "_"
+
+#define ASM_OUTPUT_ALIGN(STREAM, LOG) \
+ do \
+ { \
+ if ((LOG) == 0) \
+ break; \
+ if (TARGET_AS100_SYNTAX) \
+ { \
+ if ((LOG) >= 2) \
+ fprintf (STREAM, "\t.ALIGN 4\t; %d alignment actually requested\n", 1 << (LOG)); \
+ else \
+ fprintf (STREAM, "\t.ALIGN 2\n"); \
+ } \
+ else \
+ fprintf (STREAM, "\t.balign %d\n", 1 << (LOG)); \
+ } \
+ while (0)
+
+#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
+ fprintf (FILE, TARGET_AS100_SYNTAX ? "\t.LWORD L%d\n" : "\t.long .L%d\n", \
+ VALUE)
+
+/* This is how to output an element of a case-vector that is relative.
+ Note: The local label referenced by the "3b" below is emitted by
+ the tablejump insn. */
+
+#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
+ fprintf (FILE, TARGET_AS100_SYNTAX \
+ ? "\t.LWORD L%d - ?-\n" : "\t.long .L%d - 1b\n", VALUE)
+
+#define ASM_OUTPUT_SIZE_DIRECTIVE(STREAM, NAME, SIZE) \
+ do \
+ { \
+ HOST_WIDE_INT size_ = (SIZE); \
+ \
+ /* The as100 assembler does not have an equivalent of the SVR4 \
+ .size pseudo-op. */ \
+ if (TARGET_AS100_SYNTAX) \
+ break; \
+ \
+ fputs (SIZE_ASM_OP, STREAM); \
+ assemble_name (STREAM, NAME); \
+ fprintf (STREAM, ", " HOST_WIDE_INT_PRINT_DEC "\n", size_); \
+ } \
+ while (0)
+
+#define ASM_OUTPUT_MEASURED_SIZE(STREAM, NAME) \
+ do \
+ { \
+ /* The as100 assembler does not have an equivalent of the SVR4 \
+ .size pseudo-op. */ \
+ if (TARGET_AS100_SYNTAX) \
+ break; \
+ fputs (SIZE_ASM_OP, STREAM); \
+ assemble_name (STREAM, NAME); \
+ fputs (", .-", STREAM); \
+ assemble_name (STREAM, NAME); \
+ putc ('\n', STREAM); \
+ } \
+ while (0)
+
+#define ASM_OUTPUT_TYPE_DIRECTIVE(STREAM, NAME, TYPE) \
+ do \
+ { \
+ /* The as100 assembler does not have an equivalent of the SVR4 \
+ .size pseudo-op. */ \
+ if (TARGET_AS100_SYNTAX) \
+ break; \
+ fputs (TYPE_ASM_OP, STREAM); \
+ assemble_name (STREAM, NAME); \
+ fputs (", ", STREAM); \
+ fprintf (STREAM, TYPE_OPERAND_FMT, TYPE); \
+ putc ('\n', STREAM); \
+ } \
+ while (0)
+
+#undef ASM_GENERATE_INTERNAL_LABEL
+#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
+ do \
+ { \
+ sprintf (LABEL, TARGET_AS100_SYNTAX ? "*%s%u" : "*.%s%u", \
+ PREFIX, (unsigned) (NUM)); \
+ } \
+ while (0)
+
+#undef ASM_OUTPUT_EXTERNAL
+#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
+ do \
+ { \
+ if (TARGET_AS100_SYNTAX) \
+ targetm.asm_out.globalize_label (FILE, NAME); \
+ default_elf_asm_output_external (FILE, DECL, NAME); \
+ } \
+ while (0)
+
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
+ do \
+ { \
+ if (TARGET_AS100_SYNTAX) \
+ { \
+ fprintf ((FILE), "\t.GLB\t"); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), "\n"); \
+ assemble_name ((FILE), (NAME)); \
+ switch ((ALIGN) / BITS_PER_UNIT) \
+ { \
+ case 4: \
+ fprintf ((FILE), ":\t.BLKL\t"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\
+ (SIZE) / 4); \
+ break; \
+ case 2: \
+ fprintf ((FILE), ":\t.BLKW\t"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\
+ (SIZE) / 2); \
+ break; \
+ default: \
+ fprintf ((FILE), ":\t.BLKB\t"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\
+ (SIZE)); \
+ break; \
+ } \
+ } \
+ else \
+ { \
+ fprintf ((FILE), "%s", COMMON_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \
+ (SIZE), (ALIGN) / BITS_PER_UNIT); \
+ } \
+ } \
+ while (0)
+
+#undef SKIP_ASM_OP
+#define SKIP_ASM_OP (TARGET_AS100_SYNTAX ? "\t.BLKB\t" : "\t.zero\t")
+
+#undef ASM_OUTPUT_LIMITED_STRING
+#define ASM_OUTPUT_LIMITED_STRING(FILE, STR) \
+ do \
+ { \
+ const unsigned char *_limited_str = \
+ (const unsigned char *) (STR); \
+ unsigned ch; \
+ \
+ fprintf ((FILE), TARGET_AS100_SYNTAX \
+ ? "\t.BYTE\t\"" : "\t.string\t\""); \
+ \
+ for (; (ch = *_limited_str); _limited_str++) \
+ { \
+ int escape; \
+ \
+ switch (escape = ESCAPES[ch]) \
+ { \
+ case 0: \
+ putc (ch, (FILE)); \
+ break; \
+ case 1: \
+ fprintf ((FILE), "\\%03o", ch); \
+ break; \
+ default: \
+ putc ('\\', (FILE)); \
+ putc (escape, (FILE)); \
+ break; \
+ } \
+ } \
+ \
+ fprintf ((FILE), TARGET_AS100_SYNTAX ? "\"\n\t.BYTE\t0\n" : "\"\n");\
+ } \
+ while (0)
+
+#undef IDENT_ASM_OP
+#define IDENT_ASM_OP (TARGET_AS100_SYNTAX \
+ ? "\t.END\t; Built by: ": "\t.ident\t")
+
+/* For PIC put jump tables into the text section so that the offsets that
+ they contain are always computed between two same-section symbols. */
+#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
+
+#define PRINT_OPERAND(FILE, X, CODE) \
+ rx_print_operand (FILE, X, CODE)
+#define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
+ rx_print_operand_address (FILE, ADDR)
+
+#define CC_NO_CARRY 0400
+#define NOTICE_UPDATE_CC(EXP, INSN) rx_notice_update_cc (EXP, INSN)
+
+extern int rx_float_compare_mode;
+
+/* This is a version of REG_P that also returns TRUE for SUBREGs. */
+#define RX_REG_P(rtl) (REG_P (rtl) || GET_CODE (rtl) == SUBREG)
+
+/* Like REG_P except that this macro is true for SET expressions. */
+#define SET_P(rtl) (GET_CODE (rtl) == SET)
+
+#define CAN_DEBUG_WITHOUT_FP 1
+
+/* The AS100 assembler does not support .leb128 and .uleb128, but
+ the compiler-build-time configure tests will have enabled their
+ use because GAS supports them. So default to generating STABS
+ debug information instead of DWARF2 when generating AS100
+ compatible output. */
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE (TARGET_AS100_SYNTAX \
+ ? DBX_DEBUG : DWARF2_DEBUG)
+
+#define INCOMING_FRAME_SP_OFFSET 4
+#define ARG_POINTER_CFA_OFFSET(FNDECL) 4
+#define FRAME_POINTER_CFA_OFFSET(FNDECL) 4
+
+extern int rx_enable_fpu;
+
+/* For some unknown reason LTO compression is not working, at
+ least on my local system. So set the default compression
+ level to none, for now.
+
+ For an explanation of rx_flag_no_fpu see rx_handle_option(). */
+#define OVERRIDE_OPTIONS \
+ do \
+ { \
+ if (flag_lto_compression_level == -1) \
+ flag_lto_compression_level = 0; \
+ \
+ if (rx_enable_fpu == 1) \
+ set_fast_math_flags (true); \
+ } \
+ while (0)
+
+/* This macro is used to decide when RX FPU instructions can be used. */
+#define ALLOW_RX_FPU_INSNS ((rx_enable_fpu != -1) \
+ && flag_unsafe_math_optimizations)
diff --git a/gcc/config/rx/rx.md b/gcc/config/rx/rx.md
new file mode 100644
index 00000000000..360f6235558
--- /dev/null
+++ b/gcc/config/rx/rx.md
@@ -0,0 +1,1766 @@
+;; Machine Description for Renesas RX processors
+;; Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+;; Contributed by Red Hat.
+
+;; 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/>.
+
+
+;; This code iterator allows all branch instructions to
+;; be generated from a single define_expand template.
+(define_code_iterator most_cond [eq ne gt ge lt le gtu geu ltu leu
+ unordered ordered ])
+
+;; This code iterator is used for sign- and zero- extensions.
+(define_mode_iterator small_int_modes [(HI "") (QI "")])
+
+;; We do not handle DFmode here because it is either
+;; the same as SFmode, or if -m64bit-doubles is active
+;; then all operations on doubles have to be handled by
+;; library functions.
+(define_mode_iterator register_modes
+ [(SF "ALLOW_RX_FPU_INSNS") (SI "") (HI "") (QI "")])
+
+
+;; Used to map RX condition names to GCC
+;; condition names for builtin instructions.
+(define_code_iterator gcc_conds [eq ne gt ge lt le gtu geu ltu leu
+ unge unlt uneq ltgt])
+(define_code_attr rx_conds [(eq "eq") (ne "ne") (gt "gt") (ge "ge") (lt "lt")
+ (le "le") (gtu "gtu") (geu "geu") (ltu "ltu")
+ (leu "leu") (unge "pz") (unlt "n") (uneq "o")
+ (ltgt "no")])
+
+(define_constants
+ [
+ (SP_REG 0)
+
+ (UNSPEC_LOW_REG 0)
+ (UNSPEC_HIGH_REG 1)
+
+ (UNSPEC_RTE 10)
+ (UNSPEC_RTFI 11)
+ (UNSPEC_NAKED 12)
+
+ (UNSPEC_MOVSTR 20)
+ (UNSPEC_MOVMEM 21)
+ (UNSPEC_SETMEM 22)
+ (UNSPEC_STRLEN 23)
+ (UNSPEC_CMPSTRN 24)
+
+ (UNSPEC_BUILTIN_BRK 30)
+ (UNSPEC_BUILTIN_CLRPSW 31)
+ (UNSPEC_BUILTIN_INT 32)
+ (UNSPEC_BUILTIN_MACHI 33)
+ (UNSPEC_BUILTIN_MACLO 34)
+ (UNSPEC_BUILTIN_MULHI 35)
+ (UNSPEC_BUILTIN_MULLO 36)
+ (UNSPEC_BUILTIN_MVFACHI 37)
+ (UNSPEC_BUILTIN_MVFACMI 38)
+ (UNSPEC_BUILTIN_MVFC 39)
+ (UNSPEC_BUILTIN_MVFCP 40)
+ (UNSPEC_BUILTIN_MVTACHI 41)
+ (UNSPEC_BUILTIN_MVTACLO 42)
+ (UNSPEC_BUILTIN_MVTC 43)
+ (UNSPEC_BUILTIN_MVTIPL 44)
+ (UNSPEC_BUILTIN_RACW 45)
+ (UNSPEC_BUILTIN_REVW 46)
+ (UNSPEC_BUILTIN_RMPA 47)
+ (UNSPEC_BUILTIN_ROUND 48)
+ (UNSPEC_BUILTIN_SAT 49)
+ (UNSPEC_BUILTIN_SETPSW 50)
+ (UNSPEC_BUILTIN_WAIT 51)
+ ]
+)
+
+;; Condition code settings:
+;; none - insn does not affect the condition code bits
+;; set_zs - insn sets z,s to usable values;
+;; set_zso - insn sets z,s,o to usable values;
+;; set_zsoc - insn sets z,s,o,c to usable values;
+;; clobber - value of cc0 is unknown
+(define_attr "cc" "none,set_zs,set_zso,set_zsoc,clobber" (const_string "none"))
+
+(define_attr "length" "" (const_int 8))
+
+(include "predicates.md")
+(include "constraints.md")
+
+;; Pipeline description.
+
+;; The RX only has a single pipeline. It has five stages (fetch,
+;; decode, execute, memory access, writeback) each of which normally
+;; takes a single CPU clock cycle.
+
+;; The timings attribute consists of two numbers, the first is the
+;; throughput, which is the number of cycles the instruction takes
+;; to execute and generate a result. The second is the latency
+;; which is the effective number of cycles the instruction takes to
+;; execute if its result is used by the following instruction. The
+;; latency is always greater than or equal to the throughput.
+;; These values were taken from tables 2.13 and 2.14 in section 2.8
+;; of the RX610 Group Hardware Manual v0.11
+
+;; Note - it would be nice to use strings rather than integers for
+;; the possible values of this attribute, so that we can have the
+;; gcc build mechanism check for values that are not supported by
+;; the reservations below. But this will not work because the code
+;; in rx_adjust_sched_cost() needs integers not strings.
+
+(define_attr "timings" "" (const_int 11))
+
+(define_automaton "pipelining")
+(define_cpu_unit "throughput" "pipelining")
+
+(define_insn_reservation "throughput__1_latency__1" 1
+ (eq_attr "timings" "11") "throughput")
+(define_insn_reservation "throughput__1_latency__2" 2
+ (eq_attr "timings" "12") "throughput,nothing")
+(define_insn_reservation "throughput__2_latency__2" 1
+ (eq_attr "timings" "22") "throughput*2")
+(define_insn_reservation "throughput__3_latency__3" 1
+ (eq_attr "timings" "33") "throughput*3")
+(define_insn_reservation "throughput__3_latency__4" 2
+ (eq_attr "timings" "34") "throughput*3,nothing")
+(define_insn_reservation "throughput__4_latency__4" 1
+ (eq_attr "timings" "44") "throughput*4")
+(define_insn_reservation "throughput__4_latency__5" 2
+ (eq_attr "timings" "45") "throughput*4,nothing")
+(define_insn_reservation "throughput__5_latency__5" 1
+ (eq_attr "timings" "55") "throughput*5")
+(define_insn_reservation "throughput__5_latency__6" 2
+ (eq_attr "timings" "56") "throughput*5,nothing")
+(define_insn_reservation "throughput__6_latency__6" 1
+ (eq_attr "timings" "66") "throughput*6")
+(define_insn_reservation "throughput_10_latency_10" 1
+ (eq_attr "timings" "1010") "throughput*10")
+(define_insn_reservation "throughput_11_latency_11" 1
+ (eq_attr "timings" "1111") "throughput*11")
+(define_insn_reservation "throughput_16_latency_16" 1
+ (eq_attr "timings" "1616") "throughput*16")
+(define_insn_reservation "throughput_18_latency_18" 1
+ (eq_attr "timings" "1818") "throughput*18")
+
+;; Comparisons
+
+(define_expand "cbranchsi4"
+ [(set (cc0) (compare:CC (match_operand:SI 1 "register_operand")
+ (match_operand:SI 2 "rx_source_operand")))
+ (set (pc)
+ (if_then_else (match_operator:SI 0 "comparison_operator"
+ [(cc0) (const_int 0)])
+ (label_ref (match_operand 3 ""))
+ (pc)))]
+ ""
+ ""
+)
+
+(define_expand "cbranchsf4"
+ [(set (cc0) (compare:CC (match_operand:SF 1 "register_operand")
+ (match_operand:SF 2 "rx_source_operand")))
+ (set (pc)
+ (if_then_else (match_operator:SI 0 "comparison_operator"
+ [(cc0) (const_int 0)])
+ (label_ref (match_operand 3 ""))
+ (pc)))]
+ "ALLOW_RX_FPU_INSNS && ! flag_non_call_exceptions"
+ ""
+)
+
+;; The TST instruction is not used as it does not set the Carry flag,
+;; so for example, the LessThan comparison cannot be tested.
+;;
+;; (define_insn "tstsi"
+;; [(set (cc0)
+;; (match_operand:SI 0 "rx_source_operand" "r,i,Q")))]
+;; ""
+;; {
+;; rx_float_compare_mode = false;
+;; return "tst\t%Q0";
+;; }
+;; [(set_attr "cc" "set_zs")
+;; (set_attr "timings" "11,11,33")
+;; (set_attr "length" "3,7,6")]
+;; )
+
+(define_insn "cmpsi"
+ [(set (cc0) (compare:CC
+ (match_operand:SI 0 "register_operand" "r,r,r,r,r,r,r")
+ (match_operand:SI 1 "rx_source_operand"
+ "r,Uint04,Int08,Sint16,Sint24,i,Q")))]
+ ""
+ {
+ rx_float_compare_mode = false;
+ return "cmp\t%Q1, %Q0";
+ }
+ [(set_attr "cc" "set_zsoc")
+ (set_attr "timings" "11,11,11,11,11,11,33")
+ (set_attr "length" "2,2,3,4,5,6,5")]
+)
+
+;; This pattern is disabled when -fnon-call-exceptions is active because
+;; it could generate a floating point exception, which would introduce an
+;; edge into the flow graph between this insn and the conditional branch
+;; insn to follow, thus breaking the cc0 relationship. Run the g++ test
+;; g++.dg/eh/080514-1.C to see this happen.
+(define_insn "cmpsf"
+ [(set (cc0)
+ (compare:CC (match_operand:SF 0 "register_operand" "r,r,r")
+ (match_operand:SF 1 "rx_source_operand" "r,i,Q")))]
+ "ALLOW_RX_FPU_INSNS && ! flag_non_call_exceptions"
+ {
+ rx_float_compare_mode = true;
+ return "fcmp\t%1, %0";
+ }
+ [(set_attr "cc" "set_zso")
+ (set_attr "timings" "11,11,33")
+ (set_attr "length" "3,7,5")]
+)
+
+;; Flow Control Instructions:
+
+(define_expand "b<code>"
+ [(set (pc)
+ (if_then_else (most_cond (cc0) (const_int 0))
+ (label_ref (match_operand 0))
+ (pc)))]
+ ""
+ ""
+)
+
+(define_insn "*conditional_branch"
+ [(set (pc)
+ (if_then_else (match_operator 1 "comparison_operator"
+ [(cc0) (const_int 0)])
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ ""
+ {
+ return rx_gen_cond_branch_template (operands[1], false);
+ }
+ [(set_attr "length" "8") ;; This length is wrong, but it is
+ ;; too hard to compute statically.
+ (set_attr "timings" "33") ;; The timing assumes that the branch is taken.
+ (set_attr "cc" "clobber")] ;; FIXME: This clobber is wrong.
+)
+
+(define_insn "*reveresed_conditional_branch"
+ [(set (pc)
+ (if_then_else (match_operator 1 "comparison_operator"
+ [(cc0) (const_int 0)])
+ (pc)
+ (label_ref (match_operand 0 "" ""))))]
+ ""
+ {
+ return rx_gen_cond_branch_template (operands[1], true);
+ }
+ [(set_attr "length" "8") ;; This length is wrong, but it is
+ ;; too hard to compute statically.
+ (set_attr "timings" "33") ;; The timing assumes that the branch is taken.
+ (set_attr "cc" "clobber")] ;; FIXME: This clobber is wrong.
+)
+
+(define_insn "jump"
+ [(set (pc) (label_ref (match_operand 0 "" "")))]
+ ""
+ "bra\t%0"
+ [(set_attr "length" "4")
+ (set_attr "timings" "33")
+ (set_attr "cc" "clobber")] ;; FIXME: This clobber is wrong.
+)
+
+(define_insn "indirect_jump"
+ [(set (pc) (match_operand:SI 0 "register_operand" "r"))]
+ ""
+ "jmp\t%0"
+ [(set_attr "length" "2")
+ (set_attr "timings" "33")
+ (set_attr "cc" "clobber")] ;; FIXME: This clobber is wrong.
+)
+
+(define_insn "tablejump"
+ [(set (pc) (match_operand:SI 0 "register_operand" "r"))
+ (use (label_ref (match_operand 1 "" "")))]
+ ""
+ { return flag_pic ? (TARGET_AS100_SYNTAX ? "\n?:\tbra\t%0"
+ : "\n1:\tbra\t%0")
+ : "jmp\t%0";
+ }
+ [(set_attr "cc" "clobber") ;; FIXME: This clobber is wrong.
+ (set_attr "timings" "33")
+ (set_attr "length" "2")]
+)
+
+(define_insn "simple_return"
+ [(return)]
+ ""
+ "rts"
+ [(set_attr "length" "1")
+ (set_attr "timings" "55")]
+)
+
+(define_insn "deallocate_and_return"
+ [(set (reg:SI SP_REG)
+ (plus:SI (reg:SI SP_REG)
+ (match_operand:SI 0 "immediate_operand" "i")))
+ (return)]
+ ""
+ "rtsd\t%0"
+ [(set_attr "length" "2")
+ (set_attr "timings" "55")]
+)
+
+(define_insn "pop_and_return"
+ [(match_parallel 1 "rx_rtsd_vector"
+ [(set:SI (reg:SI SP_REG)
+ (plus:SI (reg:SI SP_REG)
+ (match_operand:SI
+ 0 "const_int_operand" "n")))])]
+ "reload_completed"
+ {
+ rx_emit_stack_popm (operands, false);
+ return "";
+ }
+ [(set_attr "length" "3")
+ (set_attr "timings" "56")]
+)
+
+(define_insn "fast_interrupt_return"
+ [(unspec_volatile [(return)] UNSPEC_RTFI) ]
+ ""
+ "rtfi"
+ [(set_attr "length" "2")
+ (set_attr "timings" "33")]
+)
+
+(define_insn "exception_return"
+ [(unspec_volatile [(return)] UNSPEC_RTE) ]
+ ""
+ "rte"
+ [(set_attr "length" "2")
+ (set_attr "timings" "66")]
+)
+
+(define_insn "naked_return"
+ [(unspec_volatile [(return)] UNSPEC_NAKED) ]
+ ""
+ "; Naked function: epilogue provided by programmer."
+)
+
+
+;; Note - the following set of patterns do not use the "memory_operand"
+;; predicate or an "m" constraint because we do not allow symbol_refs
+;; or label_refs as legitmate memory addresses. This matches the
+;; behaviour of most of the RX instructions. Only the call/branch
+;; instructions are allowed to refer to symbols/labels directly.
+;; The call operands are in QImode because that is the value of
+;; FUNCTION_MODE
+
+(define_expand "call"
+ [(call (match_operand:QI 0 "general_operand")
+ (match_operand:SI 1 "general_operand"))]
+ ""
+ {
+ rtx dest = XEXP (operands[0], 0);
+
+ if (! rx_call_operand (dest, Pmode))
+ dest = force_reg (Pmode, dest);
+ emit_call_insn (gen_call_internal (dest, operands[1]));
+ DONE;
+ }
+)
+
+(define_insn "call_internal"
+ [(call (mem:QI (match_operand:SI 0 "rx_call_operand" "r,Symbol"))
+ (match_operand:SI 1 "general_operand" "g,g"))]
+ ""
+ "@
+ jsr\t%A0
+ bsr\t%A0"
+ [(set_attr "length" "2,4")
+ (set_attr "timings" "33")]
+)
+
+(define_expand "call_value"
+ [(set (match_operand 0 "register_operand")
+ (call (match_operand:QI 1 "general_operand")
+ (match_operand:SI 2 "general_operand")))]
+ ""
+ {
+ rtx dest = XEXP (operands[1], 0);
+
+ if (! rx_call_operand (dest, Pmode))
+ dest = force_reg (Pmode, dest);
+ emit_call_insn (gen_call_value_internal (operands[0], dest, operands[2]));
+ DONE;
+ }
+)
+
+(define_insn "call_value_internal"
+ [(set (match_operand 0 "register_operand" "=r,r")
+ (call (mem:QI (match_operand:SI 1 "rx_call_operand" "r,Symbol"))
+ (match_operand:SI 2 "general_operand" "g,g")))]
+ ""
+ "@
+ jsr\t%A1
+ bsr\t%A1"
+ [(set_attr "length" "2,4")
+ (set_attr "timings" "33")]
+)
+
+(define_insn "sibcall"
+ [(call (mem:QI (match_operand:SI 0 "rx_symbolic_call_operand" "Symbol"))
+ (match_operand:SI 1 "general_operand" "g"))
+ (return)
+ (use (match_operand 2 "" ""))]
+ ""
+ "bra\t%A0"
+ [(set_attr "length" "4")
+ (set_attr "timings" "33")]
+)
+
+(define_insn "sibcall_value"
+ [(set (match_operand 0 "register_operand" "=r")
+ (call (mem:QI (match_operand:SI 1 "rx_symbolic_call_operand" "Symbol"))
+ (match_operand:SI 2 "general_operand" "g")))
+ (return)
+ (use (match_operand 3 "" ""))]
+ ""
+ "bra\t%A1"
+ [(set_attr "length" "4")
+ (set_attr "timings" "33")]
+)
+
+;; Function Prologue/Epilogue Instructions
+
+(define_expand "prologue"
+ [(const_int 0)]
+ ""
+ "rx_expand_prologue (); DONE;"
+)
+
+(define_expand "epilogue"
+ [(return)]
+ ""
+ "rx_expand_epilogue (false); DONE;"
+)
+
+(define_expand "sibcall_epilogue"
+ [(return)]
+ ""
+ "rx_expand_epilogue (true); DONE;"
+)
+
+;; Move Instructions
+
+;; Note - we do not allow memory to memory moves, even though the ISA
+;; supports them. The reason is that the conditions on such moves are
+;; too restrictive, specifically the source addressing mode is limited
+;; by the destination addressing mode and vice versa. (For example it
+;; is not possible to use indexed register indirect addressing for one
+;; of the operands if the other operand is anything other than a register,
+;; but it is possible to use register relative addressing when the other
+;; operand also uses register relative or register indirect addressing).
+;;
+;; GCC does not support computing legitimate addresses based on the
+;; nature of other operands involved in the instruction, and reload is
+;; not smart enough to cope with a whole variety of different memory
+;; addressing constraints, so it is simpler and safer to just refuse
+;; to support memory to memory moves.
+
+(define_expand "mov<register_modes:mode>"
+ [(set (match_operand:register_modes 0 "general_operand")
+ (match_operand:register_modes 1 "general_operand"))]
+ ""
+ {
+ if (MEM_P (operand0) && MEM_P (operand1))
+ operands[1] = copy_to_mode_reg (<register_modes:MODE>mode, operand1);
+ }
+)
+
+(define_insn "*mov<register_modes:mode>_internal"
+ [(set (match_operand:register_modes
+ 0 "nonimmediate_operand" "=r,r,r,r,r,r,m,Q,Q,Q,Q")
+ (match_operand:register_modes
+ 1 "general_operand" "Int08,Sint16,Sint24,i,r,m,r,Int08,Sint16,Sint24,i"))]
+ ""
+ { return rx_gen_move_template (operands, false); }
+ [(set_attr "length" "3,4,5,6,2,4,6,5,6,7,8")
+ (set_attr "timings" "11,11,11,11,11,12,11,11,11,11,11")]
+)
+
+(define_insn "extend<small_int_modes:mode>si2"
+ [(set (match_operand:SI 0 "register_operand" "=r,r")
+ (sign_extend:SI (match_operand:small_int_modes
+ 1 "nonimmediate_operand" "r,m")))]
+ ""
+ { return rx_gen_move_template (operands, false); }
+ [(set_attr "length" "2,6")
+ (set_attr "timings" "11,12")]
+)
+
+(define_insn "zero_extend<small_int_modes:mode>si2"
+ [(set (match_operand:SI 0 "register_operand" "=r,r")
+ (zero_extend:SI (match_operand:small_int_modes
+ 1 "nonimmediate_operand" "r,m")))]
+ ""
+ { return rx_gen_move_template (operands, true); }
+ [(set_attr "length" "2,4")
+ (set_attr "timings" "11,12")]
+)
+
+(define_insn "stack_push"
+ [(set:SI (reg:SI SP_REG)
+ (minus:SI (reg:SI SP_REG)
+ (const_int 4)))
+ (set:SI (mem:SI (reg:SI SP_REG))
+ (match_operand:SI 0 "register_operand" "r"))]
+ ""
+ "push.l\t%0"
+ [(set_attr "length" "2")]
+)
+
+(define_insn "stack_pushm"
+ [(match_parallel 1 "rx_store_multiple_vector"
+ [(set:SI (reg:SI SP_REG)
+ (minus:SI (reg:SI SP_REG)
+ (match_operand:SI
+ 0 "const_int_operand" "n")))])]
+ "reload_completed"
+ {
+ rx_emit_stack_pushm (operands);
+ return "";
+ }
+ [(set_attr "length" "2")
+ (set_attr "timings" "44")] ;; The timing is a guesstimate average timing.
+)
+
+(define_insn "stack_pop"
+ [(set:SI (match_operand:SI 0 "register_operand" "=r")
+ (mem:SI (reg:SI SP_REG)))
+ (set:SI (reg:SI SP_REG)
+ (plus:SI (reg:SI SP_REG)
+ (const_int 4)))]
+ ""
+ "pop\t%0"
+ [(set_attr "length" "2")
+ (set_attr "timings" "12")]
+)
+
+(define_insn "stack_popm"
+ [(match_parallel 1 "rx_load_multiple_vector"
+ [(set:SI (reg:SI SP_REG)
+ (plus:SI (reg:SI SP_REG)
+ (match_operand:SI
+ 0 "const_int_operand" "n")))])]
+ "reload_completed"
+ {
+ rx_emit_stack_popm (operands, true);
+ return "";
+ }
+ [(set_attr "length" "2")
+ (set_attr "timings" "45")] ;; The timing is a guesstimate average timing.
+)
+
+(define_insn "cstoresi4"
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r,r")
+ (match_operator:SI
+ 1 "comparison_operator"
+ [(match_operand:SI
+ 2 "register_operand" "r,r,r,r,r,r,r")
+ (match_operand:SI
+ 3 "rx_source_operand" "r,Uint04,Int08,Sint16,Sint24,i,Q")]))]
+ ""
+ {
+ rx_float_compare_mode = false;
+ return "cmp\t%Q3, %Q2\n\tsc%B1.L\t%0";
+ }
+ [(set_attr "cc" "set_zsoc")
+ (set_attr "timings" "22,22,22,22,22,22,44")
+ (set_attr "length" "5,5,6,7,8,9,8")]
+)
+
+(define_expand "movsicc"
+ [(set (match_operand:SI 0 "register_operand")
+ (if_then_else:SI (match_operand:SI 1 "comparison_operator")
+ (match_operand:SI 2 "nonmemory_operand")
+ (match_operand:SI 3 "immediate_operand")))]
+ ""
+ {
+ if (GET_CODE (operands[1]) != EQ && GET_CODE (operands[1]) != NE)
+ FAIL;
+ if (! CONST_INT_P (operands[3]))
+ FAIL;
+ }
+)
+
+(define_insn "*movsieq"
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r")
+ (if_then_else:SI (eq (match_operand:SI
+ 3 "register_operand" "r,r,r")
+ (match_operand:SI
+ 4 "rx_source_operand" "riQ,riQ,riQ"))
+ (match_operand:SI
+ 1 "nonmemory_operand" "0,i,r")
+ (match_operand:SI
+ 2 "immediate_operand" "i,i,i")))]
+ ""
+ "@
+ cmp\t%Q4, %Q3\n\tstnz\t%2, %0
+ cmp\t%Q4, %Q3\n\tmov.l\t%2, %0\n\tstz\t%1, %0
+ cmp\t%Q4, %Q3\n\tmov.l\t%1, %0\n\tstnz\t%2, %0"
+ [(set_attr "cc" "set_zsoc")
+ (set_attr "length" "13,19,15")
+ (set_attr "timings" "22,33,33")]
+)
+
+(define_insn "*movsine"
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r")
+ (if_then_else:SI (ne (match_operand:SI 3 "register_operand" "r,r,r")
+ (match_operand:SI 4 "rx_source_operand" "riQ,riQ,riQ"))
+ (match_operand:SI 1 "nonmemory_operand" "0,i,r")
+ (match_operand:SI 2 "immediate_operand" "i,i,i")))]
+ ""
+ "@
+ cmp\t%Q4, %Q3\n\tstz\t%2, %0
+ cmp\t%Q4, %Q3\n\tmov.l\t%2, %0\n\tstnz\t%1, %0
+ cmp\t%Q4, %Q3\n\tmov.l\t%1, %0\n\tstz\t%2, %0"
+ [(set_attr "cc" "set_zsoc")
+ (set_attr "length" "13,19,15")
+ (set_attr "timings" "22,33,33")]
+)
+
+;; Arithmetic Instructions
+
+(define_insn "abssi2"
+ [(set (match_operand:SI 0 "register_operand" "=r,r")
+ (abs:SI (match_operand:SI 1 "register_operand" "0,r")))]
+ ""
+ "@
+ abs\t%0
+ abs\t%1, %0"
+ [(set_attr "cc" "set_zso")
+ (set_attr "length" "2,3")]
+)
+
+(define_insn "addsi3"
+ [(set (match_operand:SI 0 "register_operand"
+ "=r,r,r,r,r,r,r,r,r,r,r,r")
+ (plus:SI (match_operand:SI
+ 1 "register_operand"
+ "%0,0,0,0,0,0,r,r,r,r,r,0")
+ (match_operand:SI
+ 2 "rx_source_operand"
+ "r,Uint04,Sint08,Sint16,Sint24,i,r,Sint08,Sint16,Sint24,i,Q")))]
+ ""
+ "@
+ add\t%2, %0
+ add\t%2, %0
+ add\t%2, %0
+ add\t%2, %0
+ add\t%2, %0
+ add\t%2, %0
+ add\t%2, %1, %0
+ add\t%2, %1, %0
+ add\t%2, %1, %0
+ add\t%2, %1, %0
+ add\t%2, %1, %0
+ add\t%Q2, %0"
+ [(set_attr "cc" "set_zsoc")
+ (set_attr "timings" "11,11,11,11,11,11,11,11,11,11,11,33")
+ (set_attr "length" "2,2,3,4,5,6,3,3,4,5,6,5")]
+)
+
+(define_insn "adddi3"
+ [(set (match_operand:DI 0 "register_operand" "=r,r,r,r,r,r")
+ (plus:DI (match_operand:DI 1 "register_operand" "%0,0,0,0,0,0")
+ (match_operand:DI 2 "rx_source_operand"
+ "r,Sint08,Sint16,Sint24,i,Q")))]
+ ""
+ "add\t%L2, %L0\n\tadc\t%H2, %H0"
+ [(set_attr "cc" "set_zsoc")
+ (set_attr "timings" "22,22,22,22,22,44")
+ (set_attr "length" "5,7,9,11,13,11")]
+)
+
+(define_insn "andsi3"
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r,r,r,r")
+ (and:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0,r,0,Q")
+ (match_operand:SI
+ 2 "rx_source_operand"
+ "r,Uint04,Sint08,Sint16,Sint24,i,r,Q,0")))]
+ ""
+ "@
+ and\t%2, %0
+ and\t%2, %0
+ and\t%2, %0
+ and\t%2, %0
+ and\t%2, %0
+ and\t%2, %0
+ and\t%2, %1, %0
+ and\t%Q2, %0
+ and\t%Q1, %0"
+ [(set_attr "cc" "set_zs")
+ (set_attr "timings" "11,11,11,11,11,11,11,33,33")
+ (set_attr "length" "2,2,3,4,5,6,3,5,5")]
+)
+
+;; Byte swap (single 32-bit value).
+(define_insn "bswapsi2"
+ [(set (match_operand:SI 0 "register_operand" "+r")
+ (bswap:SI (match_operand:SI 1 "register_operand" "r")))]
+ ""
+ "revl\t%1, %0"
+ [(set_attr "length" "3")]
+)
+
+;; Byte swap (single 16-bit value). Note - we ignore the swapping of the high 16-bits.
+(define_insn "bswaphi2"
+ [(set (match_operand:HI 0 "register_operand" "+r")
+ (bswap:HI (match_operand:HI 1 "register_operand" "r")))]
+ ""
+ "revw\t%1, %0"
+ [(set_attr "length" "3")]
+)
+
+(define_insn "divsi3"
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
+ (div:SI (match_operand:SI 1 "register_operand" "0,0,0,0,0,0")
+ (match_operand:SI
+ 2 "rx_source_operand" "r,Sint08,Sint16,Sint24,i,Q")))]
+ ""
+ "div\t%Q2, %0"
+ [(set_attr "cc" "clobber")
+ (set_attr "timings" "1111") ;; Strictly speaking the timing should be
+ ;; 2222, but that is a worst case sceanario.
+ (set_attr "length" "3,4,5,6,7,6")]
+)
+
+(define_insn "udivsi3"
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
+ (udiv:SI (match_operand:SI 1 "register_operand" "0,0,0,0,0,0")
+ (match_operand:SI
+ 2 "rx_source_operand" "r,Sint08,Sint16,Sint24,i,Q")))]
+ ""
+ "divu\t%Q2, %0"
+ [(set_attr "cc" "clobber")
+ (set_attr "timings" "1010") ;; Strictly speaking the timing should be
+ ;; 2020, but that is a worst case sceanario.
+ (set_attr "length" "3,4,5,6,7,6")]
+)
+
+;; Note - these patterns are suppressed in big-endian mode because they
+;; generate a little endian result. ie the most significant word of the
+;; result is placed in the higher numbered register of the destination
+;; register pair.
+
+(define_insn "mulsidi3"
+ [(set (match_operand:DI 0 "register_operand" "=r,r,r,r,r,r")
+ (mult:DI (sign_extend:DI (match_operand:SI
+ 1 "register_operand" "%0,0,0,0,0,0"))
+ (sign_extend:DI (match_operand:SI
+ 2 "rx_source_operand"
+ "r,Sint08,Sint16,Sint24,i,Q"))))]
+ "! TARGET_BIG_ENDIAN_DATA"
+ "@
+ emul\t%Q2, %0
+ emul\t%Q2, %0
+ emul\t%Q2, %0
+ emul\t%Q2, %0
+ emul\t%Q2, %0
+ emul\t%Q2, %0"
+ [(set_attr "length" "3,4,5,6,7,6")
+ (set_attr "timings" "22,22,22,22,22,44")]
+)
+
+;; See comment for mulsidi3.
+;; Note - the zero_extends are to distinguish this pattern from the
+;; mulsidi3 pattern. Immediate mode addressing is not supported
+;; because gcc cannot handle the expression: (zero_extend (const_int)).
+(define_insn "umulsidi3"
+ [(set (match_operand:DI 0 "register_operand"
+ "=r,r")
+ (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand"
+ "%0,0"))
+ (zero_extend:DI (match_operand:SI 2 "rx_compare_operand"
+ "r,Q"))))]
+ "! TARGET_BIG_ENDIAN_DATA"
+ "@
+ emulu\t%Q2, %0
+ emulu\t%Q2, %0"
+ [(set_attr "length" "3,6")
+ (set_attr "timings" "22,44")]
+)
+
+(define_insn "smaxsi3"
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
+ (smax:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0")
+ (match_operand:SI 2 "rx_source_operand"
+ "r,Sint08,Sint16,Sint24,i,Q")))]
+ ""
+ "max\t%Q2, %0"
+ [(set_attr "length" "3,4,5,6,7,6")
+ (set_attr "timings" "11,11,11,11,11,33")]
+)
+
+(define_insn "sminsi3"
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r,r")
+ (smin:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0,r")
+ (match_operand:SI 2 "rx_source_operand"
+ "r,Sint08,Sint16,Sint24,i,Q,r")))]
+ ""
+ "@
+ min\t%Q2, %0
+ min\t%Q2, %0
+ min\t%Q2, %0
+ min\t%Q2, %0
+ min\t%Q2, %0
+ min\t%Q2, %0
+ mov.l\t%1,%0\n\tmin\t%Q2, %0"
+ [(set_attr "length" "3,4,5,6,7,6,5")
+ (set_attr "timings" "11,11,11,11,11,33,22")]
+)
+
+(define_insn "mulsi3"
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r,r,r,r")
+ (mult:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0,0,Q,r")
+ (match_operand:SI 2 "rx_source_operand"
+ "r,Uint04,Sint08,Sint16,Sint24,i,Q,0,r")))]
+ ""
+ "@
+ mul\t%Q2, %0
+ mul\t%Q2, %0
+ mul\t%Q2, %0
+ mul\t%Q2, %0
+ mul\t%Q2, %0
+ mul\t%Q2, %0
+ mul\t%Q2, %0
+ mul\t%Q1, %0
+ mul\t%Q2, %1, %0"
+ [(set_attr "length" "2,2,3,4,5,6,5,5,3")
+ (set_attr "timings" "11,11,11,11,11,11,33,33,11")]
+)
+
+(define_insn "negsi2"
+ [(set (match_operand:SI 0 "register_operand" "=r,r")
+ (neg:SI (match_operand:SI 1 "register_operand" "0,r")))]
+ ;; The NEG instruction does not comply with -fwrapv semantics.
+ ;; See gcc.c-torture/execute/pr22493-1.c for an example of this.
+ "! flag_wrapv"
+ "@
+ neg\t%0
+ neg\t%1, %0"
+ [(set_attr "length" "2,3")]
+)
+
+(define_insn "one_cmplsi2"
+ [(set (match_operand:SI 0 "register_operand" "=r,r")
+ (not:SI (match_operand:SI 1 "register_operand" "0,r")))]
+ ""
+ "@
+ not\t%0
+ not\t%1, %0"
+ [(set_attr "cc" "set_zs")
+ (set_attr "length" "2,3")]
+)
+
+(define_insn "iorsi3"
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r,r,r,r")
+ (ior:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0,r,0,Q")
+ (match_operand:SI 2 "rx_source_operand"
+ "r,Uint04,Sint08,Sint16,Sint24,i,r,Q,0")))]
+ ""
+ "@
+ or\t%2, %0
+ or\t%2, %0
+ or\t%2, %0
+ or\t%2, %0
+ or\t%2, %0
+ or\t%2, %0
+ or\t%2, %1, %0
+ or\t%Q2, %0
+ or\t%Q1, %0"
+ [(set_attr "cc" "set_zs")
+ (set_attr "timings" "11,11,11,11,11,11,11,33,33")
+ (set_attr "length" "2,2,3,4,5,6,3,5,5")]
+)
+
+(define_insn "rotlsi3"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (rotate:SI (match_operand:SI 1 "register_operand" "0")
+ (match_operand:SI 2 "rx_shift_operand" "rn")))]
+ ""
+ "rotl\t%2, %0"
+ [(set_attr "cc" "set_zs")
+ (set_attr "length" "3")]
+)
+
+(define_insn "rotrsi3"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (rotatert:SI (match_operand:SI 1 "register_operand" "0")
+ (match_operand:SI 2 "rx_shift_operand" "rn")))]
+ ""
+ "rotr\t%2, %0"
+ [(set_attr "cc" "set_zs")
+ (set_attr "length" "3")]
+)
+
+(define_insn "ashrsi3"
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r")
+ (ashiftrt:SI (match_operand:SI 1 "register_operand" "0,0,r")
+ (match_operand:SI 2 "rx_shift_operand" "r,n,n")))]
+ ""
+ "@
+ shar\t%2, %0
+ shar\t%2, %0
+ shar\t%2, %1, %0"
+ [(set_attr "cc" "set_zsoc")
+ (set_attr "length" "3,2,3")]
+)
+
+(define_insn "lshrsi3"
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r")
+ (lshiftrt:SI (match_operand:SI 1 "register_operand" "0,0,r")
+ (match_operand:SI 2 "rx_shift_operand" "r,n,n")))]
+ ""
+ "@
+ shlr\t%2, %0
+ shlr\t%2, %0
+ shlr\t%2, %1, %0"
+ [(set_attr "cc" "set_zsoc")
+ (set_attr "length" "3,2,3")]
+)
+
+(define_insn "ashlsi3"
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r")
+ (ashift:SI (match_operand:SI 1 "register_operand" "0,0,r")
+ (match_operand:SI 2 "rx_shift_operand" "r,n,n")))]
+ ""
+ "@
+ shll\t%2, %0
+ shll\t%2, %0
+ shll\t%2, %1, %0"
+ [(set_attr "cc" "set_zsoc")
+ (set_attr "length" "3,2,3")]
+)
+
+(define_insn "subsi3"
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r")
+ (minus:SI (match_operand:SI 1 "register_operand" "0,0,0,r,0")
+ (match_operand:SI 2 "rx_source_operand" "r,Uint04,n,r,Q")))]
+ ""
+ "@
+ sub\t%2, %0
+ sub\t%2, %0
+ add\t%N2, %0
+ sub\t%2, %1, %0
+ sub\t%Q2, %0"
+ [(set_attr "cc" "set_zsoc")
+ (set_attr "timings" "11,11,11,11,33")
+ (set_attr "length" "2,2,6,3,5")]
+)
+
+(define_insn "subdi3"
+ [(set (match_operand:DI 0 "register_operand" "=r,r")
+ (minus:DI (match_operand:DI 1 "register_operand" "0,0")
+ (match_operand:DI 2 "rx_source_operand" "r,Q")))]
+ ""
+ "sub\t%L2, %L0\n\tsbb\t%H2, %H0"
+ [(set_attr "cc" "set_zsoc")
+ (set_attr "timings" "22,44")
+ (set_attr "length" "5,11")]
+)
+
+(define_insn "xorsi3"
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
+ (xor:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0")
+ (match_operand:SI 2 "rx_source_operand"
+ "r,Sint08,Sint16,Sint24,i,Q")))]
+ ""
+ "@
+ xor\t%Q2, %0
+ xor\t%Q2, %0
+ xor\t%Q2, %0
+ xor\t%Q2, %0
+ xor\t%Q2, %0
+ xor\t%Q2, %0"
+ [(set_attr "cc" "set_zs")
+ (set_attr "timings" "11,11,11,11,11,33")
+ (set_attr "length" "3,4,5,6,7,6")]
+)
+
+;; Floating Point Instructions
+
+(define_insn "addsf3"
+ [(set (match_operand:SF 0 "register_operand" "=r,r,r")
+ (plus:SF (match_operand:SF 1 "register_operand" "%0,0,0")
+ (match_operand:SF 2 "rx_source_operand" "r,F,Q")))]
+ "ALLOW_RX_FPU_INSNS"
+ "@
+ fadd\t%2, %0
+ fadd\t%2, %0
+ fadd\t%2, %0"
+ [(set_attr "cc" "set_zs")
+ (set_attr "timings" "44,44,66")
+ (set_attr "length" "3,7,5")]
+)
+
+(define_insn "divsf3"
+ [(set (match_operand:SF 0 "register_operand" "=r,r,r")
+ (div:SF (match_operand:SF 1 "register_operand" "0,0,0")
+ (match_operand:SF 2 "rx_source_operand" "r,F,Q")))]
+ "ALLOW_RX_FPU_INSNS"
+ "fdiv\t%2, %0"
+ [(set_attr "cc" "set_zs")
+ (set_attr "timings" "1616,1616,1818")
+ (set_attr "length" "3,7,5")]
+)
+
+(define_insn "mulsf3"
+ [(set (match_operand:SF 0 "register_operand" "=r,r,r")
+ (mult:SF (match_operand:SF 1 "register_operand" "%0,0,0")
+ (match_operand:SF 2 "rx_source_operand" "r,F,Q")))]
+ "ALLOW_RX_FPU_INSNS"
+ "@
+ fmul\t%2, %0
+ fmul\t%2, %0
+ fmul\t%2, %0"
+ [(set_attr "cc" "set_zs")
+ (set_attr "timings" "33,33,55")
+ (set_attr "length" "3,7,5")]
+)
+
+(define_insn "subsf3"
+ [(set (match_operand:SF 0 "register_operand" "=r,r,r")
+ (minus:SF (match_operand:SF 1 "register_operand" "0,0,0")
+ (match_operand:SF 2 "rx_source_operand" "r,F,Q")))]
+ "ALLOW_RX_FPU_INSNS"
+ "fsub\t%2, %0"
+ [(set_attr "cc" "set_zs")
+ (set_attr "timings" "44,44,66")
+ (set_attr "length" "3,7,5")]
+)
+
+(define_insn "fix_truncsfsi2"
+ [(set (match_operand:SI 0 "register_operand" "=r,r")
+ (fix:SI (match_operand:SF 1 "rx_compare_operand" "r,Q")))]
+ "ALLOW_RX_FPU_INSNS"
+ "ftoi\t%1, %0"
+ [(set_attr "cc" "set_zs")
+ (set_attr "timings" "22,44")
+ (set_attr "length" "3,5")]
+)
+
+(define_insn "floatsisf2"
+ [(set (match_operand:SF 0 "register_operand" "=r,r")
+ (float:SF (match_operand:SI 1 "rx_compare_operand" "r,Q")))]
+ "ALLOW_RX_FPU_INSNS"
+ "itof\t%1, %0"
+ [(set_attr "cc" "set_zs")
+ (set_attr "timings" "22,44")
+ (set_attr "length" "3,6")]
+)
+
+;; Bit manipulation instructions.
+;; Note - there are two versions of each pattern because the memory
+;; accessing versions use QImode whilst the register accessing
+;; versions use SImode.
+;; The peephole are here because the combiner only looks at a maximum
+;; of three instructions at a time.
+
+(define_insn "bitset"
+ [(set:SI (match_operand:SI 0 "register_operand" "+r")
+ (ior:SI (match_operand:SI 1 "register_operand" "0")
+ (ashift:SI (const_int 1)
+ (match_operand:SI 2 "nonmemory_operand" "ri"))))]
+ ""
+ "bset\t%2, %0"
+ [(set_attr "length" "3")]
+)
+
+(define_insn "bitset_in_memory"
+ [(set:QI (match_operand:QI 0 "memory_operand" "+m")
+ (ior:QI (match_operand:QI 1 "memory_operand" "0")
+ (ashift:QI (const_int 1)
+ (match_operand:QI 2 "nonmemory_operand" "ri"))))]
+ ""
+ "bset\t%2, %0.B"
+ [(set_attr "length" "3")
+ (set_attr "timings" "34")]
+)
+
+;; (set (reg A) (const_int 1))
+;; (set (reg A) (ashift (reg A) (reg B)))
+;; (set (reg C) (ior (reg A) (reg C)))
+(define_peephole2
+ [(set:SI (match_operand:SI 0 "register_operand" "")
+ (const_int 1))
+ (set:SI (match_dup 0)
+ (ashift:SI (match_dup 0)
+ (match_operand:SI 1 "register_operand" "")))
+ (set:SI (match_operand:SI 2 "register_operand" "")
+ (ior:SI (match_dup 0)
+ (match_dup 2)))]
+ "dead_or_set_p (insn, operands[0])"
+ [(set:SI (match_dup 2)
+ (ior:SI (match_dup 2)
+ (ashift:SI (const_int 1)
+ (match_dup 1))))]
+)
+
+;; (set (reg A) (const_int 1))
+;; (set (reg A) (ashift (reg A) (reg B)))
+;; (set (reg A) (ior (reg A) (reg C)))
+;; (set (reg C) (reg A)
+(define_peephole2
+ [(set:SI (match_operand:SI 0 "register_operand" "")
+ (const_int 1))
+ (set:SI (match_dup 0)
+ (ashift:SI (match_dup 0)
+ (match_operand:SI 1 "register_operand" "")))
+ (set:SI (match_dup 0)
+ (ior:SI (match_dup 0)
+ (match_operand:SI 2 "register_operand" "")))
+ (set:SI (match_dup 2) (match_dup 0))]
+ "dead_or_set_p (insn, operands[0])"
+ [(set:SI (match_dup 2)
+ (ior:SI (match_dup 2)
+ (ashift:SI (const_int 1)
+ (match_dup 1))))]
+)
+
+(define_insn "bitinvert"
+ [(set:SI (match_operand:SI 0 "register_operand" "+r")
+ (xor:SI (match_operand:SI 1 "register_operand" "0")
+ (ashift:SI (const_int 1)
+ (match_operand:SI 2 "nonmemory_operand" "ri"))))]
+ ""
+ "bnot\t%2, %0"
+ [(set_attr "length" "3")]
+)
+
+(define_insn "bitinvert_in_memory"
+ [(set:QI (match_operand:QI 0 "memory_operand" "+m")
+ (xor:QI (match_operand:QI 1 "register_operand" "0")
+ (ashift:QI (const_int 1)
+ (match_operand:QI 2 "nonmemory_operand" "ri"))))]
+ ""
+ "bnot\t%2, %0.B"
+ [(set_attr "length" "5")
+ (set_attr "timings" "33")]
+)
+
+;; (set (reg A) (const_int 1))
+;; (set (reg A) (ashift (reg A) (reg B)))
+;; (set (reg C) (xor (reg A) (reg C)))
+(define_peephole2
+ [(set:SI (match_operand:SI 0 "register_operand" "")
+ (const_int 1))
+ (set:SI (match_dup 0)
+ (ashift:SI (match_dup 0)
+ (match_operand:SI 1 "register_operand" "")))
+ (set:SI (match_operand:SI 2 "register_operand" "")
+ (xor:SI (match_dup 0)
+ (match_dup 2)))]
+ "dead_or_set_p (insn, operands[0])"
+ [(set:SI (match_dup 2)
+ (xor:SI (match_dup 2)
+ (ashift:SI (const_int 1)
+ (match_dup 1))))]
+ ""
+)
+
+;; (set (reg A) (const_int 1))
+;; (set (reg A) (ashift (reg A) (reg B)))
+;; (set (reg A) (xor (reg A) (reg C)))
+;; (set (reg C) (reg A))
+(define_peephole2
+ [(set:SI (match_operand:SI 0 "register_operand" "")
+ (const_int 1))
+ (set:SI (match_dup 0)
+ (ashift:SI (match_dup 0)
+ (match_operand:SI 1 "register_operand" "")))
+ (set:SI (match_dup 0)
+ (xor:SI (match_dup 0)
+ (match_operand:SI 2 "register_operand" "")))
+ (set:SI (match_dup 2) (match_dup 0))]
+ "dead_or_set_p (insn, operands[0])"
+ [(set:SI (match_dup 2)
+ (xor:SI (match_dup 2)
+ (ashift:SI (const_int 1)
+ (match_dup 1))))]
+ ""
+)
+
+(define_insn "bitclr"
+ [(set:SI (match_operand:SI 0 "register_operand" "+r")
+ (and:SI (match_operand:SI 1 "register_operand" "0")
+ (not:SI (ashift:SI (const_int 1)
+ (match_operand:SI 2 "nonmemory_operand" "ri")))))]
+ ""
+ "bclr\t%2, %0"
+ [(set_attr "length" "3")]
+)
+
+(define_insn "bitclr_in_memory"
+ [(set:QI (match_operand:QI 0 "memory_operand" "+m")
+ (and:QI (match_operand:QI 1 "memory_operand" "0")
+ (not:QI (ashift:QI (const_int 1)
+ (match_operand:QI 2 "nonmemory_operand" "ri")))))]
+ ""
+ "bclr\t%2, %0.B"
+ [(set_attr "length" "3")
+ (set_attr "timings" "34")]
+)
+
+;; (set (reg A) (const_int -2))
+;; (set (reg A) (rotate (reg A) (reg B)))
+;; (set (reg C) (and (reg A) (reg C)))
+(define_peephole2
+ [(set:SI (match_operand:SI 0 "register_operand" "")
+ (const_int -2))
+ (set:SI (match_dup 0)
+ (rotate:SI (match_dup 0)
+ (match_operand:SI 1 "register_operand" "")))
+ (set:SI (match_operand:SI 2 "register_operand" "")
+ (and:SI (match_dup 0)
+ (match_dup 2)))]
+ "dead_or_set_p (insn, operands[0])"
+ [(set:SI (match_dup 2)
+ (and:SI (match_dup 2)
+ (not:SI (ashift:SI (const_int 1)
+ (match_dup 1)))))]
+)
+
+;; (set (reg A) (const_int -2))
+;; (set (reg A) (rotate (reg A) (reg B)))
+;; (set (reg A) (and (reg A) (reg C)))
+;; (set (reg C) (reg A)
+(define_peephole2
+ [(set:SI (match_operand:SI 0 "register_operand" "")
+ (const_int -2))
+ (set:SI (match_dup 0)
+ (rotate:SI (match_dup 0)
+ (match_operand:SI 1 "register_operand" "")))
+ (set:SI (match_dup 0)
+ (and:SI (match_dup 0)
+ (match_operand:SI 2 "register_operand" "")))
+ (set:SI (match_dup 2) (match_dup 0))]
+ "dead_or_set_p (insn, operands[0])"
+ [(set:SI (match_dup 2)
+ (and:SI (match_dup 2)
+ (not:SI (ashift:SI (const_int 1)
+ (match_dup 1)))))]
+)
+
+(define_expand "insv"
+ [(set:SI (zero_extract:SI (match_operand:SI
+ 0 "nonimmediate_operand") ;; Destination
+ (match_operand
+ 1 "immediate_operand") ;; # of bits to set
+ (match_operand
+ 2 "immediate_operand")) ;; Starting bit
+ (match_operand
+ 3 "immediate_operand"))] ;; Bits to insert
+ ""
+ {
+ if (rx_expand_insv (operands))
+ DONE;
+ FAIL;
+ }
+)
+
+;; Atomic exchange operation.
+
+(define_insn "sync_lock_test_and_setsi"
+ [(set:SI (match_operand:SI 0 "register_operand" "=r,r")
+ (match_operand:SI 1 "rx_compare_operand" "=r,Q"))
+ (set:SI (match_dup 1)
+ (match_operand:SI 2 "register_operand" "0,0"))]
+ ""
+ "xchg\t%1, %0"
+ [(set_attr "length" "3,6")
+ (set_attr "timings" "22")]
+)
+
+;; Block move functions.
+
+(define_expand "movstr"
+ [(set:SI (match_operand:BLK 1 "memory_operand") ;; Dest
+ (match_operand:BLK 2 "memory_operand")) ;; Source
+ (use (match_operand:SI 0 "register_operand")) ;; Updated Dest
+ ]
+ ""
+ {
+ rtx addr1 = gen_rtx_REG (SImode, 1);
+ rtx addr2 = gen_rtx_REG (SImode, 2);
+ rtx len = gen_rtx_REG (SImode, 3);
+ rtx dest_copy = gen_reg_rtx (SImode);
+
+ emit_move_insn (len, GEN_INT (-1));
+ emit_move_insn (addr1, force_operand (XEXP (operands[1], 0), NULL_RTX));
+ emit_move_insn (addr2, force_operand (XEXP (operands[2], 0), NULL_RTX));
+ operands[1] = replace_equiv_address_nv (operands[1], addr1);
+ operands[2] = replace_equiv_address_nv (operands[2], addr2);
+ emit_move_insn (dest_copy, addr1);
+ emit_insn (gen_rx_movstr ());
+ emit_move_insn (len, GEN_INT (-1));
+ emit_insn (gen_rx_strend (operands[0], dest_copy));
+ DONE;
+ }
+)
+
+(define_insn "rx_movstr"
+ [(set:SI (mem:BLK (reg:SI 1))
+ (mem:BLK (reg:SI 2)))
+ (unspec_volatile:BLK [(reg:SI 1) (reg:SI 2) (reg:SI 3)] UNSPEC_MOVSTR)
+ (clobber (reg:SI 1))
+ (clobber (reg:SI 2))
+ (clobber (reg:SI 3))
+ ]
+ ""
+ "smovu"
+ [(set_attr "length" "2")
+ (set_attr "timings" "1111")] ;; The timing is a guesstimate.
+)
+
+(define_insn "rx_strend"
+ [(set:SI (match_operand:SI 0 "register_operand" "=r")
+ (unspec_volatile:SI [(match_operand:SI 1 "register_operand" "r")
+ (reg:SI 3)] UNSPEC_STRLEN))
+ (clobber (reg:SI 1))
+ (clobber (reg:SI 2))
+ (clobber (reg:SI 3))
+ ]
+ ""
+ "mov\t%1, r1\n\tmov\t#0, r2\n\tsuntil.b\n\tmov\tr1, %0\n\tsub\t#1, %0"
+ [(set_attr "length" "10")
+ (set_attr "cc" "clobber")
+ (set_attr "timings" "1111")] ;; The timing is a guesstimate.
+)
+
+(define_expand "movmemsi"
+ [(parallel
+ [(set (match_operand:BLK 0 "memory_operand") ;; Dest
+ (match_operand:BLK 1 "memory_operand")) ;; Source
+ (use (match_operand:SI 2 "register_operand")) ;; Length in bytes
+ (match_operand 3 "immediate_operand") ;; Align
+ (unspec_volatile:BLK [(reg:SI 1) (reg:SI 2) (reg:SI 3)] UNSPEC_MOVMEM)]
+ )]
+ ""
+ {
+ rtx addr1 = gen_rtx_REG (SImode, 1);
+ rtx addr2 = gen_rtx_REG (SImode, 2);
+ rtx len = gen_rtx_REG (SImode, 3);
+
+ if (REG_P (operands[0]) && (REGNO (operands[0]) == 2
+ || REGNO (operands[0]) == 3))
+ FAIL;
+ if (REG_P (operands[1]) && (REGNO (operands[1]) == 1
+ || REGNO (operands[1]) == 3))
+ FAIL;
+ if (REG_P (operands[2]) && (REGNO (operands[2]) == 1
+ || REGNO (operands[2]) == 2))
+ FAIL;
+ emit_move_insn (addr1, force_operand (XEXP (operands[0], 0), NULL_RTX));
+ emit_move_insn (addr2, force_operand (XEXP (operands[1], 0), NULL_RTX));
+ emit_move_insn (len, force_operand (operands[2], NULL_RTX));
+ operands[0] = replace_equiv_address_nv (operands[0], addr1);
+ operands[1] = replace_equiv_address_nv (operands[1], addr2);
+ emit_insn (gen_rx_movmem ());
+ DONE;
+ }
+)
+
+(define_insn "rx_movmem"
+ [(set (mem:BLK (reg:SI 1))
+ (mem:BLK (reg:SI 2)))
+ (use (reg:SI 3))
+ (unspec_volatile:BLK [(reg:SI 1) (reg:SI 2) (reg:SI 3)] UNSPEC_MOVMEM)
+ (clobber (reg:SI 1))
+ (clobber (reg:SI 2))
+ (clobber (reg:SI 3))]
+ ""
+ "smovf"
+ [(set_attr "length" "2")
+ (set_attr "timings" "1111")] ;; The timing is a guesstimate.
+)
+
+(define_expand "setmemsi"
+ [(set (match_operand:BLK 0 "memory_operand") ;; Dest
+ (match_operand:QI 2 "nonmemory_operand")) ;; Value
+ (use (match_operand:SI 1 "nonmemory_operand")) ;; Length
+ (match_operand 3 "immediate_operand") ;; Align
+ (unspec_volatile:BLK [(reg:SI 1) (reg:SI 2) (reg:SI 3)] UNSPEC_SETMEM)]
+ ""
+ {
+ rtx addr = gen_rtx_REG (SImode, 1);
+ rtx val = gen_rtx_REG (QImode, 2);
+ rtx len = gen_rtx_REG (SImode, 3);
+
+ emit_move_insn (addr, force_operand (XEXP (operands[0], 0), NULL_RTX));
+ emit_move_insn (len, force_operand (operands[1], NULL_RTX));
+ emit_move_insn (val, operands[2]);
+ emit_insn (gen_rx_setmem ());
+ DONE;
+ }
+)
+
+(define_insn "rx_setmem"
+ [(set:BLK (mem:BLK (reg:SI 1)) (reg 2))
+ (unspec_volatile:BLK [(reg:SI 1) (reg:SI 2) (reg:SI 3)] UNSPEC_SETMEM)
+ (clobber (reg:SI 1))
+ (clobber (reg:SI 3))]
+ ""
+ "sstr.b"
+ [(set_attr "length" "2")
+ (set_attr "timings" "1111")] ;; The timing is a guesstimate.
+)
+
+(define_expand "cmpstrnsi"
+ [(set (match_operand:SI
+ 0 "register_operand") ;; Result
+ (unspec_volatile:SI [(match_operand:BLK
+ 1 "memory_operand") ;; String1
+ (match_operand:BLK
+ 2 "memory_operand")] ;; String2
+ UNSPEC_CMPSTRN))
+ (use (match_operand:SI
+ 3 "register_operand")) ;; Max Length
+ (match_operand:SI
+ 4 "immediate_operand")] ;; Known Align
+ ""
+ {
+ rtx str1 = gen_rtx_REG (SImode, 1);
+ rtx str2 = gen_rtx_REG (SImode, 2);
+ rtx len = gen_rtx_REG (SImode, 3);
+
+ emit_move_insn (str1, force_operand (XEXP (operands[1], 0), NULL_RTX));
+ emit_move_insn (str2, force_operand (XEXP (operands[2], 0), NULL_RTX));
+ emit_move_insn (len, force_operand (operands[3], NULL_RTX));
+
+ emit_insn (gen_rx_cmpstrn (operands[0], operands[1], operands[2]));
+ DONE;
+ }
+)
+
+(define_expand "cmpstrsi"
+ [(set (match_operand:SI
+ 0 "register_operand") ;; Result
+ (unspec_volatile:SI [(match_operand:BLK
+ 1 "memory_operand") ;; String1
+ (match_operand:BLK
+ 2 "memory_operand")] ;; String2
+ UNSPEC_CMPSTRN))
+ (match_operand:SI
+ 3 "immediate_operand")] ;; Known Align
+ ""
+ {
+ rtx str1 = gen_rtx_REG (SImode, 1);
+ rtx str2 = gen_rtx_REG (SImode, 2);
+ rtx len = gen_rtx_REG (SImode, 3);
+
+ emit_move_insn (str1, force_reg (SImode, XEXP (operands[1], 0)));
+ emit_move_insn (str2, force_reg (SImode, XEXP (operands[2], 0)));
+ emit_move_insn (len, GEN_INT (-1));
+
+ emit_insn (gen_rx_cmpstrn (operands[0], operands[1], operands[2]));
+ DONE;
+ }
+)
+
+(define_insn "rx_cmpstrn"
+ [(set:SI (match_operand:SI 0 "register_operand" "=r")
+ (unspec_volatile:SI [(reg:SI 1) (reg:SI 2) (reg:SI 3)]
+ UNSPEC_CMPSTRN))
+ (use (match_operand:BLK 1 "memory_operand" "m"))
+ (use (match_operand:BLK 2 "memory_operand" "m"))
+ (clobber (reg:SI 1))
+ (clobber (reg:SI 2))
+ (clobber (reg:SI 3))]
+ ""
+ "scmpu ; Perform the string comparison
+ mov #-1, %0 ; Set up -1 result (which cannot be created
+ ; by the SC insn)
+ bnc ?+ ; If Carry is not set skip over
+ scne.L %0 ; Set result based on Z flag
+?:
+"
+ [(set_attr "length" "9")
+ (set_attr "timings" "1111")] ;; The timing is a guesstimate.
+)
+
+;; Builtin Functions
+;;
+;; GCC does not have the ability to generate the following instructions
+;; on its own so they are provided as builtins instead. To use them from
+;; a program for example invoke them as __builtin_rx_<insn_name>. For
+;; example:
+;;
+;; int short_byte_swap (int arg) { return __builtin_rx_revw (arg); }
+
+;;---------- Accumulator Support ------------------------
+
+;; Multiply & Accumulate (high)
+(define_insn "machi"
+ [(unspec:SI [(match_operand:SI 0 "register_operand" "r")
+ (match_operand:SI 1 "register_operand" "r")]
+ UNSPEC_BUILTIN_MACHI)]
+ ""
+ "machi\t%0, %1"
+ [(set_attr "length" "3")]
+)
+
+;; Multiply & Accumulate (low)
+(define_insn "maclo"
+ [(unspec:SI [(match_operand:SI 0 "register_operand" "r")
+ (match_operand:SI 1 "register_operand" "r")]
+ UNSPEC_BUILTIN_MACLO)]
+ ""
+ "maclo\t%0, %1"
+ [(set_attr "length" "3")]
+)
+
+;; Multiply (high)
+(define_insn "mulhi"
+ [(unspec:SI [(match_operand:SI 0 "register_operand" "r")
+ (match_operand:SI 1 "register_operand" "r")]
+ UNSPEC_BUILTIN_MULHI)]
+ ""
+ "mulhi\t%0, %1"
+ [(set_attr "length" "3")]
+)
+
+;; Multiply (low)
+(define_insn "mullo"
+ [(unspec:SI [(match_operand:SI 0 "register_operand" "r")
+ (match_operand:SI 1 "register_operand" "r")]
+ UNSPEC_BUILTIN_MULLO)]
+ ""
+ "mullo\t%0, %1"
+ [(set_attr "length" "3")]
+)
+
+;; Move from Accumulator (high)
+(define_insn "mvfachi"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (unspec:SI [(const_int 0)]
+ UNSPEC_BUILTIN_MVFACHI))]
+ ""
+ "mvfachi\t%0"
+ [(set_attr "length" "3")]
+)
+
+;; Move from Accumulator (middle)
+(define_insn "mvfacmi"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (unspec:SI [(const_int 0)]
+ UNSPEC_BUILTIN_MVFACMI))]
+ ""
+ "mvfacmi\t%0"
+ [(set_attr "length" "3")]
+)
+
+;; Move to Accumulator (high)
+(define_insn "mvtachi"
+ [(unspec_volatile:SI [(match_operand:SI 0 "register_operand" "r")]
+ UNSPEC_BUILTIN_MVTACHI)]
+ ""
+ "mvtachi\t%0"
+ [(set_attr "length" "3")]
+)
+
+;; Move to Accumulator (low)
+(define_insn "mvtaclo"
+ [(unspec_volatile:SI [(match_operand:SI 0 "register_operand" "r")]
+ UNSPEC_BUILTIN_MVTACLO)]
+ ""
+ "mvtaclo\t%0"
+ [(set_attr "length" "3")]
+)
+
+;; Round Accumulator
+(define_insn "racw"
+ [(unspec_volatile:SI [(match_operand:SI 0 "immediate_operand" "i")]
+ UNSPEC_BUILTIN_RACW)]
+ ""
+ "racw\t%0"
+ [(set_attr "length" "3")]
+)
+
+;; Repeat multiply and accumulate
+(define_insn "rmpa"
+ [(unspec:SI [(const_int 0) (reg:SI 1) (reg:SI 2) (reg:SI 3)
+ (reg:SI 4) (reg:SI 5) (reg:SI 6)]
+ UNSPEC_BUILTIN_RMPA)
+ (clobber (reg:SI 1))
+ (clobber (reg:SI 2))
+ (clobber (reg:SI 3))]
+ ""
+ "rmpa"
+ [(set_attr "length" "2")
+ (set_attr "timings" "1010")]
+)
+
+;;---------- Arithmetic ------------------------
+
+;; Byte swap (two 16-bit values).
+(define_insn "revw"
+ [(set (match_operand:SI 0 "register_operand" "+r")
+ (unspec:SI [(match_operand:SI 1 "register_operand" "r")]
+ UNSPEC_BUILTIN_REVW))]
+ ""
+ "revw\t%1, %0"
+ [(set_attr "length" "3")]
+)
+
+;; Round to integer.
+(define_insn "lrintsf2"
+ [(set (match_operand:SI 0 "register_operand" "=r,r")
+ (unspec:SI [(match_operand:SF 1 "rx_compare_operand" "r,Q")]
+ UNSPEC_BUILTIN_ROUND))]
+ ""
+ "round\t%1, %0"
+ [(set_attr "cc" "set_zs")
+ (set_attr "timings" "22,44")
+ (set_attr "length" "3,5")]
+)
+
+;; Saturate to 32-bits
+(define_insn "sat"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (unspec:SI [(match_operand:SI 1 "register_operand" "0")]
+ UNSPEC_BUILTIN_SAT))]
+ ""
+ "sat\t%0"
+ [(set_attr "length" "2")]
+)
+
+;;---------- Control Registers ------------------------
+
+;; Clear Processor Status Word
+(define_insn "clrpsw"
+ [(unspec:SI [(match_operand:SI 0 "immediate_operand" "i")]
+ UNSPEC_BUILTIN_CLRPSW)
+ (clobber (cc0))]
+ ""
+ "clrpsw\t%F0"
+ [(set_attr "length" "2")
+ (set_attr "cc" "clobber")]
+)
+
+;; Set Processor Status Word
+(define_insn "setpsw"
+ [(unspec:SI [(match_operand:SI 0 "immediate_operand" "i")]
+ UNSPEC_BUILTIN_SETPSW)
+ (clobber (cc0))]
+ ""
+ "setpsw\t%F0"
+ [(set_attr "length" "2")
+ (set_attr "cc" "clobber")]
+)
+
+;; Move from control register
+(define_insn "mvfc"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (unspec:SI [(match_operand:SI 1 "immediate_operand" "i")]
+ UNSPEC_BUILTIN_MVFC))]
+ ""
+ "mvfc\t%C1, %0"
+ [(set_attr "length" "3")]
+)
+
+;; Move to control register
+(define_insn "mvtc"
+ [(unspec:SI [(match_operand:SI 0 "immediate_operand" "i,i")
+ (match_operand:SI 1 "nonmemory_operand" "r,i")]
+ UNSPEC_BUILTIN_MVTC)]
+ ""
+ "mvtc\t%1, %C0"
+ [(set_attr "length" "3,7")]
+ ;; Ignore possible clobbering of the comparison flags in the
+ ;; PSW register. This is a cc0 target so any cc0 setting
+ ;; instruction will always be paired with a cc0 user, without
+ ;; the possibility of this instruction being placed in between
+ ;; them.
+)
+
+;; Move to interrupt priority level
+(define_insn "mvtipl"
+ [(unspec:SI [(match_operand:SI 0 "immediate_operand" "Uint04")]
+ UNSPEC_BUILTIN_MVTIPL)]
+ ""
+ "mvtipl\t%0"
+ [(set_attr "length" "3")]
+)
+
+;;---------- Interrupts ------------------------
+
+;; Break
+(define_insn "brk"
+ [(unspec_volatile [(const_int 0)]
+ UNSPEC_BUILTIN_BRK)]
+ ""
+ "brk"
+ [(set_attr "length" "1")
+ (set_attr "timings" "66")]
+)
+
+;; Interrupt
+(define_insn "int"
+ [(unspec_volatile:SI [(match_operand:SI 0 "immediate_operand" "i")]
+ UNSPEC_BUILTIN_INT)]
+ ""
+ "int\t%0"
+ [(set_attr "length" "3")]
+)
+
+;; Wait
+(define_insn "wait"
+ [(unspec_volatile [(const_int 0)]
+ UNSPEC_BUILTIN_WAIT)]
+ ""
+ "wait"
+ [(set_attr "length" "2")]
+)
+
+;;---------- CoProcessor Support ------------------------
+
+;; FIXME: The instructions are currently commented out because
+;; the bit patterns have not been finalized, so the assembler
+;; does not support them. Once they are decided and the assembler
+;; supports them, enable the instructions here.
+
+;; Move from co-processor register
+(define_insn "mvfcp"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (unspec:SI [(match_operand:SI 1 "immediate_operand" "i")
+ (match_operand:SI 2 "immediate_operand" "i")]
+ UNSPEC_BUILTIN_MVFCP))]
+ ""
+ "; mvfcp\t%1, %0, %2"
+ [(set_attr "length" "5")]
+)
+
+;;---------- Misc ------------------------
+
+;; Required by cfglayout.c...
+(define_insn "nop"
+ [(const_int 0)]
+ ""
+ "nop"
+ [(set_attr "length" "1")]
+)
diff --git a/gcc/config/rx/rx.opt b/gcc/config/rx/rx.opt
new file mode 100644
index 00000000000..768d565b478
--- /dev/null
+++ b/gcc/config/rx/rx.opt
@@ -0,0 +1,98 @@
+; Command line options for the Renesas RX port of GCC.
+; Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+; Contributed by Red Hat.
+;
+; 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/>.
+;---------------------------------------------------
+
+m32bit-doubles
+Target RejectNegative Mask(32BIT_DOUBLES)
+Stores doubles in 32 bits.
+
+m64bit-doubles
+Target RejectNegative InverseMask(32BIT_DOUBLES)
+Store doubles in 64 bits. This is the default.
+
+fpu
+Target RejectNegative Mask(32BIT_DOUBLES) MaskExists
+Enable the use of RX FPU instructions.
+
+nofpu
+Target RejectNegative InverseMask(32BIT_DOUBLES) MaskExists
+Disable the use of RX FPU instructions.
+
+;---------------------------------------------------
+
+mcpu=
+Target RejectNegative Joined Var(rx_cpu_name)
+Specify the target RX cpu type.
+
+patch=
+Target RejectNegative Joined Var(rx_cpu_name)
+Alias for -mcpu.
+
+;---------------------------------------------------
+
+mbig-endian-data
+Target RejectNegative Mask(BIG_ENDIAN_DATA)
+Data is stored in big-endian format.
+
+mlittle-endian-data
+Target RejectNegative InverseMask(BIG_ENDIAN_DATA)
+Data is stored in little-endian format. (Default).
+
+;---------------------------------------------------
+
+msmall-data-limit=
+Target RejectNegative Joined UInteger Var(rx_small_data_limit) Init(0)
+Maximum size of global and static variables which can be placed into the small data area.
+
+;---------------------------------------------------
+
+msim
+Target
+Use the simulator runtime.
+
+;---------------------------------------------------
+
+mas100-syntax
+Target Mask(AS100_SYNTAX)
+Generate assembler output that is compatible with the Renesas AS100 assembler. This may restrict some of the compiler's capabilities. The default is to generate GAS compatable syntax.
+
+;---------------------------------------------------
+
+mrelax
+Target
+Enable linker relaxation.
+
+;---------------------------------------------------
+
+mmax-constant-size=
+Target RejectNegative Joined UInteger Var(rx_max_constant_size) Init(0)
+Maximum size in bytes of constant values allowed as operands.
+
+;---------------------------------------------------
+
+mint-register=
+Target RejectNegative Joined UInteger Var(rx_interrupt_registers) Init(0)
+Specifies the number of registers to reserve for interrupt handlers.
+
+;---------------------------------------------------
+
+msave-acc-in-interrupts
+Target Mask(SAVE_ACC_REGISTER)
+Specifies whether interrupt functions should save and restore the accumulator register.
diff --git a/gcc/config/rx/t-rx b/gcc/config/rx/t-rx
new file mode 100644
index 00000000000..eb1ca48d3a3
--- /dev/null
+++ b/gcc/config/rx/t-rx
@@ -0,0 +1,32 @@
+# Makefile fragment for building GCC for the Renesas RX target.
+# Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+# Contributed by Red Hat.
+#
+# 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/>.
+
+# Enable multilibs:
+
+MULTILIB_OPTIONS = m32bit-doubles mbig-endian-data
+MULTILIB_DIRNAMES = 32fp big-endian-data
+MULTILIB_MATCHES = m32bit-doubles=fpu
+MULTILIB_EXCEPTIONS =
+MULTILIB_EXTRA_OPTS =
+
+LIBGCC = stmp-multilib
+INSTALL_LIBGCC = install-multilib
+
+EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o
diff --git a/gcc/config/s390/2097.md b/gcc/config/s390/2097.md
index eb7240effd4..56893596a74 100644
--- a/gcc/config/s390/2097.md
+++ b/gcc/config/s390/2097.md
@@ -57,7 +57,8 @@
z10_int_fr_A3"
"z10_other_super, z10_other_super_c_E1, z10_other_super_E1, \
z10_int_super, z10_int_super_E1, \
- z10_lr, z10_store_super")
+ z10_lr, z10_store_super"
+ " ! s390_agen_dep_p")
; Forwarding from z10_super to frz10_ and z10_rec.
@@ -68,7 +69,8 @@
z10_store_super"
"z10_int_fr, z10_int_fr_E1, z10_int_fr_A3, \
z10_other_fr, z10_other_fr_A3, z10_lr_fr, z10_lr_fr_E1, \
- z10_other_fr_E1, z10_store_rec")
+ z10_other_fr_E1, z10_store_rec"
+ " ! s390_agen_dep_p")
; Forwarding from z10_fwd and z10_fr to z10_rec and z10_fr.
@@ -84,7 +86,8 @@
z10_int_fr_A3"
"z10_int_fr, z10_int_fr_E1, z10_int_fr_A3, \
z10_other_fr, z10_other_fr_A3, z10_lr_fr, z10_lr_fr_E1, \
- z10_other_fr_E1, z10_store_rec")
+ z10_other_fr_E1, z10_store_rec"
+ " ! s390_agen_dep_p")
;
@@ -205,15 +208,12 @@
(and (eq_attr "type" "lr")
(eq_attr "z10prop" "z10_fr")))
"z10_e1_ANY, z10_Gate_ANY")
-; "z10_e1_ANY")
(define_insn_reservation "z10_lr_fr_E1" 6
(and (eq_attr "cpu" "z10")
(and (eq_attr "type" "lr")
(eq_attr "z10prop" "z10_fr_E1")))
"z10_e1_ANY, z10_Gate_ANY")
-; "z10_e1_ANY")
-
(define_insn_reservation "z10_la" 6
(and (eq_attr "cpu" "z10")
@@ -227,14 +227,12 @@
(and (eq_attr "type" "la")
(eq_attr "z10prop" "z10_fwd")))
"z10_e1_ANY, z10_Gate_ANY")
-; "z10_e1_ANY")
(define_insn_reservation "z10_la_fwd_A1" 6
(and (eq_attr "cpu" "z10")
(and (eq_attr "type" "la")
(eq_attr "z10prop" "z10_fwd_A1")))
"z10_e1_ANY, z10_Gate_ANY")
-; "z10_e1_ANY")
; larl-type instructions
@@ -666,13 +664,14 @@
; Address-related bypasses
;
-; Here is the cycle diagram for Address-related bypasses:
+; Here is the cycle diagram for address-related bypasses:
; ... G1 G2 G3 A0 A1 A2 A3 E1 P1 P2 P3 R0 ...
-; ^ ^ ^ ^ ^
-; | | | | E1-type bypasses provide the new addr AFTER this cycle
-; | | | A3-type bypasses provide the new addr AFTER this cycle
-; | | A1-type bypasses provide the new addr AFTER this cycle
-; | AGI resolution, actual USE of address is DURING this cycle
+; ^ ^ ^ ^ ^ ^
+; | | | | | without bypass, its available AFTER this cycle
+; | | | | E1-type bypasses provide the new value AFTER this cycle
+; | | | A3-type bypasses provide the new value AFTER this cycle
+; | | A1-type bypasses provide the new value AFTER this cycle
+; | AGI resolution, actual USE of new value is DURING this cycle
; AGI detection
(define_bypass 3 "z10_larl_A1, z10_la_fwd_A1, z10_other_fwd_A1, \
@@ -682,7 +681,6 @@
z10_cs, z10_stm, z10_other"
"s390_agen_dep_p")
-
(define_bypass 5 "z10_larl_fwd_A3, z10_load_fwd_A3, z10_other_fwd_A3, \
z10_other_fr_A3, z10_int_fwd_A3, z10_int_fr_A3"
"z10_agen, z10_la, z10_branch, z10_call, z10_load, \
@@ -699,6 +697,12 @@
z10_cs, z10_stm, z10_other"
"s390_agen_dep_p")
+(define_bypass 9 "z10_int_super, z10_int_fwd, z10_int_fr"
+ "z10_agen, z10_la, z10_branch, z10_call, z10_load, \
+ z10_store, \
+ z10_cs, z10_stm, z10_other"
+ "s390_agen_dep_p")
+
;
diff --git a/gcc/config/s390/fixdfdi.h b/gcc/config/s390/fixdfdi.h
deleted file mode 100644
index ddddf3a7c9c..00000000000
--- a/gcc/config/s390/fixdfdi.h
+++ /dev/null
@@ -1,462 +0,0 @@
-/* Definitions of target machine for GNU compiler, for IBM S/390
- Copyright (C) 1999, 2000, 2001, 2007, 2008 Free Software Foundation, Inc.
- Contributed by Hartmut Penner (hpenner@de.ibm.com) and
- Ulrich Weigand (uweigand@de.ibm.com).
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 3, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-#ifdef L_fixunstfdi
-
-#define EXPD(fp) (((fp.l.i[0]) >> 16) & 0x7FFF)
-#define EXPONENT_BIAS 16383
-#define MANTISSA_BITS 112
-#define PRECISION (MANTISSA_BITS + 1)
-#define SIGNBIT 0x80000000
-#define SIGND(fp) ((fp.l.i[0]) & SIGNBIT)
-#define MANTD_HIGH_LL(fp) ((fp.ll[0] & HIGH_LL_FRAC_MASK) | HIGH_LL_UNIT_BIT)
-#define MANTD_LOW_LL(fp) (fp.ll[1])
-#define FRACD_ZERO_P(fp) (!fp.ll[1] && !(fp.ll[0] & HIGH_LL_FRAC_MASK))
-#define HIGH_LL_FRAC_BITS 48
-#define HIGH_LL_UNIT_BIT ((UDItype_x)1 << HIGH_LL_FRAC_BITS)
-#define HIGH_LL_FRAC_MASK (HIGH_LL_UNIT_BIT - 1)
-
-typedef int DItype_x __attribute__ ((mode (DI)));
-typedef unsigned int UDItype_x __attribute__ ((mode (DI)));
-typedef int SItype_x __attribute__ ((mode (SI)));
-typedef unsigned int USItype_x __attribute__ ((mode (SI)));
-
-union double_long {
- long double d;
- struct {
- SItype_x i[4]; /* 32 bit parts: 0 upper ... 3 lowest */
- } l;
- UDItype_x ll[2]; /* 64 bit parts: 0 upper, 1 lower */
-};
-
-UDItype_x __fixunstfdi (long double a1);
-
-/* convert double to unsigned int */
-UDItype_x
-__fixunstfdi (long double a1)
-{
- register union double_long dl1;
- register int exp;
- register UDItype_x l;
-
- dl1.d = a1;
-
- /* +/- 0, denormalized, negative */
- if (!EXPD (dl1) || SIGND(dl1))
- return 0;
-
- /* The exponent - considered the binary point at the right end of
- the mantissa. */
- exp = EXPD (dl1) - EXPONENT_BIAS - MANTISSA_BITS;
-
- /* number < 1: If the mantissa would need to be right-shifted more bits than
- its size (plus the implied one bit on the left) the result would be
- zero. */
- if (exp <= -PRECISION)
- return 0;
-
- /* NaN: All exponent bits set and a nonzero fraction. */
- if ((EXPD(dl1) == 0x7fff) && !FRACD_ZERO_P (dl1))
- return 0x0ULL;
-
- /* One extra bit is needed for the unit bit which is appended by
- MANTD_HIGH_LL on the left of the matissa. */
- exp += HIGH_LL_FRAC_BITS + 1;
-
- /* If the result would still need a left shift it will be too large
- to be represented. */
- if (exp > 0)
- return 0xFFFFFFFFFFFFFFFFULL;
-
- l = MANTD_LOW_LL (dl1) >> (HIGH_LL_FRAC_BITS + 1)
- | MANTD_HIGH_LL (dl1) << (64 - (HIGH_LL_FRAC_BITS + 1));
-
- return l >> -exp;
-}
-#define __fixunstfdi ___fixunstfdi
-#endif
-#undef L_fixunstfdi
-
-#ifdef L_fixtfdi
-#define EXPD(fp) (((fp.l.i[0]) >> 16) & 0x7FFF)
-#define EXPONENT_BIAS 16383
-#define MANTISSA_BITS 112
-#define PRECISION (MANTISSA_BITS + 1)
-#define SIGNBIT 0x80000000
-#define SIGND(fp) ((fp.l.i[0]) & SIGNBIT)
-#define MANTD_HIGH_LL(fp) ((fp.ll[0] & HIGH_LL_FRAC_MASK) | HIGH_LL_UNIT_BIT)
-#define MANTD_LOW_LL(fp) (fp.ll[1])
-#define FRACD_ZERO_P(fp) (!fp.ll[1] && !(fp.ll[0] & HIGH_LL_FRAC_MASK))
-#define HIGH_LL_FRAC_BITS 48
-#define HIGH_LL_UNIT_BIT ((UDItype_x)1 << HIGH_LL_FRAC_BITS)
-#define HIGH_LL_FRAC_MASK (HIGH_LL_UNIT_BIT - 1)
-
-typedef int DItype_x __attribute__ ((mode (DI)));
-typedef unsigned int UDItype_x __attribute__ ((mode (DI)));
-typedef int SItype_x __attribute__ ((mode (SI)));
-typedef unsigned int USItype_x __attribute__ ((mode (SI)));
-
-union double_long {
- long double d;
- struct {
- SItype_x i[4]; /* 32 bit parts: 0 upper ... 3 lowest */
- } l;
- UDItype_x ll[2]; /* 64 bit parts: 0 upper, 1 lower */
-};
-
-DItype_x __fixtfdi (long double a1);
-
-/* convert double to unsigned int */
-DItype_x
-__fixtfdi (long double a1)
-{
- register union double_long dl1;
- register int exp;
- register UDItype_x l;
-
- dl1.d = a1;
-
- /* +/- 0, denormalized */
- if (!EXPD (dl1))
- return 0;
-
- /* The exponent - considered the binary point at the right end of
- the mantissa. */
- exp = EXPD (dl1) - EXPONENT_BIAS - MANTISSA_BITS;
-
- /* number < 1: If the mantissa would need to be right-shifted more bits than
- its size the result would be zero. */
- if (exp <= -PRECISION)
- return 0;
-
- /* NaN: All exponent bits set and a nonzero fraction. */
- if ((EXPD(dl1) == 0x7fff) && !FRACD_ZERO_P (dl1))
- return 0x8000000000000000ULL;
-
- /* One extra bit is needed for the unit bit which is appended by
- MANTD_HIGH_LL on the left of the matissa. */
- exp += HIGH_LL_FRAC_BITS + 1;
-
- /* If the result would still need a left shift it will be too large
- to be represented. Compared to the unsigned variant we have to
- take care that there is still space for the sign bit to be
- applied. So we can only go on if there is a right-shift by one
- or more. */
- if (exp >= 0)
- {
- l = 1ULL << 63; /* long long min */
- return SIGND (dl1) ? l : l - 1;
- }
-
- l = MANTD_LOW_LL (dl1) >> (HIGH_LL_FRAC_BITS + 1)
- | MANTD_HIGH_LL (dl1) << (64 - (HIGH_LL_FRAC_BITS + 1));
-
- return SIGND (dl1) ? -(l >> -exp) : l >> -exp;
-}
-#define __fixtfdi ___fixtfdi
-#endif
-#undef L_fixtfdi
-
-#ifdef L_fixunsdfdi
-#define EXPD(fp) (((fp.l.upper) >> 20) & 0x7FF)
-#define EXCESSD 1022
-#define SIGNBIT 0x80000000
-#define SIGND(fp) ((fp.l.upper) & SIGNBIT)
-#define MANTD_LL(fp) ((fp.ll & (HIDDEND_LL-1)) | HIDDEND_LL)
-#define FRACD_LL(fp) (fp.ll & (HIDDEND_LL-1))
-#define HIDDEND_LL ((UDItype_x)1 << 52)
-
-typedef int DItype_x __attribute__ ((mode (DI)));
-typedef unsigned int UDItype_x __attribute__ ((mode (DI)));
-typedef int SItype_x __attribute__ ((mode (SI)));
-typedef unsigned int USItype_x __attribute__ ((mode (SI)));
-
-union double_long {
- double d;
- struct {
- SItype_x upper;
- USItype_x lower;
- } l;
- UDItype_x ll;
-};
-
-UDItype_x __fixunsdfdi (double a1);
-
-/* convert double to unsigned int */
-UDItype_x
-__fixunsdfdi (double a1)
-{
- register union double_long dl1;
- register int exp;
- register UDItype_x l;
-
- dl1.d = a1;
-
- /* +/- 0, denormalized, negative */
-
- if (!EXPD (dl1) || SIGND(dl1))
- return 0;
-
- exp = EXPD (dl1) - EXCESSD - 53;
-
- /* number < 1 */
-
- if (exp < -53)
- return 0;
-
- /* NaN */
-
- if ((EXPD(dl1) == 0x7ff) && (FRACD_LL(dl1) != 0)) /* NaN */
- return 0x0ULL;
-
- /* Number big number & + inf */
-
- if (exp >= 12) {
- return 0xFFFFFFFFFFFFFFFFULL;
- }
-
- l = MANTD_LL(dl1);
-
- /* shift down until exp < 12 or l = 0 */
- if (exp > 0)
- l <<= exp;
- else
- l >>= -exp;
-
- return l;
-}
-#define __fixunsdfdi ___fixunsdfdi
-#endif
-#undef L_fixunsdfdi
-
-#ifdef L_fixdfdi
-#define EXPD(fp) (((fp.l.upper) >> 20) & 0x7FF)
-#define EXCESSD 1022
-#define SIGNBIT 0x80000000
-#define SIGND(fp) ((fp.l.upper) & SIGNBIT)
-#define MANTD_LL(fp) ((fp.ll & (HIDDEND_LL-1)) | HIDDEND_LL)
-#define FRACD_LL(fp) (fp.ll & (HIDDEND_LL-1))
-#define HIDDEND_LL ((UDItype_x)1 << 52)
-
-typedef int DItype_x __attribute__ ((mode (DI)));
-typedef unsigned int UDItype_x __attribute__ ((mode (DI)));
-typedef int SItype_x __attribute__ ((mode (SI)));
-typedef unsigned int USItype_x __attribute__ ((mode (SI)));
-
-union double_long {
- double d;
- struct {
- SItype_x upper;
- USItype_x lower;
- } l;
- UDItype_x ll;
-};
-
-DItype_x __fixdfdi (double a1);
-
-/* convert double to int */
-DItype_x
-__fixdfdi (double a1)
-{
- register union double_long dl1;
- register int exp;
- register DItype_x l;
-
- dl1.d = a1;
-
- /* +/- 0, denormalized */
-
- if (!EXPD (dl1))
- return 0;
-
- exp = EXPD (dl1) - EXCESSD - 53;
-
- /* number < 1 */
-
- if (exp < -53)
- return 0;
-
- /* NaN */
-
- if ((EXPD(dl1) == 0x7ff) && (FRACD_LL(dl1) != 0)) /* NaN */
- return 0x8000000000000000ULL;
-
- /* Number big number & +/- inf */
-
- if (exp >= 11) {
- l = (long long)1<<63;
- if (!SIGND(dl1))
- l--;
- return l;
- }
-
- l = MANTD_LL(dl1);
-
- /* shift down until exp < 12 or l = 0 */
- if (exp > 0)
- l <<= exp;
- else
- l >>= -exp;
-
- return (SIGND (dl1) ? -l : l);
-}
-#define __fixdfdi ___fixdfdi
-#endif
-#undef L_fixdfdi
-
-#ifdef L_fixunssfdi
-#define EXP(fp) (((fp.l) >> 23) & 0xFF)
-#define EXCESS 126
-#define SIGNBIT 0x80000000
-#define SIGN(fp) ((fp.l) & SIGNBIT)
-#define HIDDEN (1 << 23)
-#define MANT(fp) (((fp.l) & 0x7FFFFF) | HIDDEN)
-#define FRAC(fp) ((fp.l) & 0x7FFFFF)
-
-typedef int DItype_x __attribute__ ((mode (DI)));
-typedef unsigned int UDItype_x __attribute__ ((mode (DI)));
-typedef int SItype_x __attribute__ ((mode (SI)));
-typedef unsigned int USItype_x __attribute__ ((mode (SI)));
-
-union float_long
- {
- float f;
- USItype_x l;
- };
-
-UDItype_x __fixunssfdi (float a1);
-
-/* convert float to unsigned int */
-UDItype_x
-__fixunssfdi (float a1)
-{
- register union float_long fl1;
- register int exp;
- register UDItype_x l;
-
- fl1.f = a1;
-
- /* +/- 0, denormalized, negative */
-
- if (!EXP (fl1) || SIGN(fl1))
- return 0;
-
- exp = EXP (fl1) - EXCESS - 24;
-
- /* number < 1 */
-
- if (exp < -24)
- return 0;
-
- /* NaN */
-
- if ((EXP(fl1) == 0xff) && (FRAC(fl1) != 0)) /* NaN */
- return 0x0ULL;
-
- /* Number big number & + inf */
-
- if (exp >= 41) {
- return 0xFFFFFFFFFFFFFFFFULL;
- }
-
- l = MANT(fl1);
-
- if (exp > 0)
- l <<= exp;
- else
- l >>= -exp;
-
- return l;
-}
-#define __fixunssfdi ___fixunssfdi
-#endif
-#undef L_fixunssfdi
-
-#ifdef L_fixsfdi
-#define EXP(fp) (((fp.l) >> 23) & 0xFF)
-#define EXCESS 126
-#define SIGNBIT 0x80000000
-#define SIGN(fp) ((fp.l) & SIGNBIT)
-#define HIDDEN (1 << 23)
-#define MANT(fp) (((fp.l) & 0x7FFFFF) | HIDDEN)
-#define FRAC(fp) ((fp.l) & 0x7FFFFF)
-
-typedef int DItype_x __attribute__ ((mode (DI)));
-typedef unsigned int UDItype_x __attribute__ ((mode (DI)));
-typedef int SItype_x __attribute__ ((mode (SI)));
-typedef unsigned int USItype_x __attribute__ ((mode (SI)));
-
-union float_long
- {
- float f;
- USItype_x l;
- };
-
-DItype_x __fixsfdi (float a1);
-
-/* convert double to int */
-DItype_x
-__fixsfdi (float a1)
-{
- register union float_long fl1;
- register int exp;
- register DItype_x l;
-
- fl1.f = a1;
-
- /* +/- 0, denormalized */
-
- if (!EXP (fl1))
- return 0;
-
- exp = EXP (fl1) - EXCESS - 24;
-
- /* number < 1 */
-
- if (exp < -24)
- return 0;
-
- /* NaN */
-
- if ((EXP(fl1) == 0xff) && (FRAC(fl1) != 0)) /* NaN */
- return 0x8000000000000000ULL;
-
- /* Number big number & +/- inf */
-
- if (exp >= 40) {
- l = (long long)1<<63;
- if (!SIGN(fl1))
- l--;
- return l;
- }
-
- l = MANT(fl1);
-
- if (exp > 0)
- l <<= exp;
- else
- l >>= -exp;
-
- return (SIGN (fl1) ? -l : l);
-}
-#define __fixsfdi ___fixsfdi
-#endif
-#undef L_fixsfdi
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index e439b01709f..a4334819203 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -9003,6 +9003,7 @@ s390_encode_section_info (tree decl, rtx rtl, int first)
&& GET_CODE (XEXP (rtl, 0)) == SYMBOL_REF
&& TREE_CONSTANT_POOL_ADDRESS_P (XEXP (rtl, 0))
&& (MEM_ALIGN (rtl) == 0
+ || GET_MODE_BITSIZE (GET_MODE (rtl)) == 0
|| MEM_ALIGN (rtl) < GET_MODE_BITSIZE (GET_MODE (rtl))))
SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= SYMBOL_FLAG_NOT_NATURALLY_ALIGNED;
}
@@ -9863,9 +9864,12 @@ s390_z10_optimize_cmp (rtx insn)
if (!REG_P (*op0) || !REG_P (*op1))
return false;
+ if (GET_MODE_CLASS (GET_MODE (*op0)) != MODE_INT)
+ return false;
+
/* Swap the COMPARE arguments and its mask if there is a
conflicting access in the previous insn. */
- prev_insn = PREV_INSN (insn);
+ prev_insn = prev_active_insn (insn);
if (prev_insn != NULL_RTX && INSN_P (prev_insn)
&& reg_referenced_p (*op1, PATTERN (prev_insn)))
s390_swap_cmp (cond, op0, op1, insn);
@@ -9876,7 +9880,7 @@ s390_z10_optimize_cmp (rtx insn)
the operands, or if swapping them would cause a conflict
with the previous insn, issue a NOP after the COMPARE in
order to separate the two instuctions. */
- next_insn = NEXT_INSN (insn);
+ next_insn = next_active_insn (insn);
if (next_insn != NULL_RTX && INSN_P (next_insn)
&& s390_non_addr_reg_read_p (*op1, next_insn))
{
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index ffb96cd0f34..2da8b8753e2 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -24,12 +24,6 @@ along with GCC; see the file COPYING3. If not see
#ifndef _S390_H
#define _S390_H
-/* Override the __fixdfdi etc. routines when building libgcc2.
- ??? This should be done in a cleaner way ... */
-#if defined (IN_LIBGCC2) && !defined (__s390x__)
-#include <config/s390/fixdfdi.h>
-#endif
-
/* Which processor to generate code or schedule for. The cpu attribute
defines a list that mirrors this list, so changes to s390.md must be
made at the same time. */
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index db326ee766c..8f4a71feb3f 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -220,7 +220,7 @@
;; reg: Instruction does not use the agen unit
(define_attr "atype" "agen,reg"
- (if_then_else (eq_attr "op_type" "E,RR,RI,RRE")
+ (if_then_else (eq_attr "op_type" "E,RR,RI,RRE,RSI,RIL,RIE,RRF,RRR")
(const_string "reg")
(const_string "agen")))
@@ -8941,18 +8941,16 @@
;
(define_insn "prefetch"
- [(prefetch (match_operand 0 "address_operand" "ZQZS,ZRZT,X")
- (match_operand:SI 1 "const_int_operand" " n, n,n")
- (match_operand:SI 2 "const_int_operand" " n, n,n"))]
- "TARGET_ZARCH && s390_tune == PROCESSOR_2097_Z10"
+ [(prefetch (match_operand 0 "address_operand" "ZQZRZSZT,X")
+ (match_operand:SI 1 "const_int_operand" " n,n")
+ (match_operand:SI 2 "const_int_operand" " n,n"))]
+ "TARGET_Z10"
{
switch (which_alternative)
{
case 0:
- return INTVAL (operands[1]) == 1 ? "stcmh\t2,0,%a0" : "stcmh\t1,0,%a0";
- case 1:
return INTVAL (operands[1]) == 1 ? "pfd\t2,%a0" : "pfd\t1,%a0";
- case 2:
+ case 1:
if (larl_operand (operands[0], Pmode))
return INTVAL (operands[1]) == 1 ? "pfdrl\t2,%a0" : "pfdrl\t1,%a0";
default:
@@ -8963,10 +8961,9 @@
return "";
}
}
- [(set_attr "type" "store,load,larl")
- (set_attr "op_type" "RSY,RXY,RIL")
- (set_attr "z10prop" "z10_super")
- (set_attr "cpu_facility" "*,z10,z10")])
+ [(set_attr "type" "load,larl")
+ (set_attr "op_type" "RXY,RIL")
+ (set_attr "z10prop" "z10_super")])
;
diff --git a/gcc/config/s390/t-linux b/gcc/config/s390/t-linux
deleted file mode 100644
index d5a92781450..00000000000
--- a/gcc/config/s390/t-linux
+++ /dev/null
@@ -1,3 +0,0 @@
-# Override t-slibgcc-elf-ver to export some libgcc symbols with
-# the symbol versions that glibc used.
-SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver $(srcdir)/config/s390/libgcc-glibc.ver
diff --git a/gcc/config/s390/t-linux64 b/gcc/config/s390/t-linux64
index 0ffb6902c18..36aced09c2c 100644
--- a/gcc/config/s390/t-linux64
+++ b/gcc/config/s390/t-linux64
@@ -1,8 +1,3 @@
MULTILIB_OPTIONS = m64/m31
MULTILIB_DIRNAMES = 64 32
MULTILIB_OSDIRNAMES = ../lib64 ../lib
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
-
-EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
diff --git a/gcc/config/s390/t-tpf b/gcc/config/s390/t-tpf
deleted file mode 100644
index 6e4c377697c..00000000000
--- a/gcc/config/s390/t-tpf
+++ /dev/null
@@ -1,9 +0,0 @@
-# Compile crtbeginS.o and crtendS.o with pic.
-CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
-# Compile libgcc2.a with pic.
-TARGET_LIBGCC2_CFLAGS = -fPIC
-
-# Use unwind-dw2-fde-glibc.
-LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
- $(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c $(srcdir)/unwind-c.c
-LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h
diff --git a/gcc/config/s390/tpf.h b/gcc/config/s390/tpf.h
index 5ffbd07f309..455c8ad92bc 100644
--- a/gcc/config/s390/tpf.h
+++ b/gcc/config/s390/tpf.h
@@ -55,7 +55,7 @@ along with GCC; see the file COPYING3. If not see
enable TPF profiling support and the standard backchain by default. */
#undef TARGET_DEFAULT
#define TARGET_DEFAULT (MASK_TPF_PROFILING | MASK_64BIT | MASK_ZARCH \
- | MASK_HARD_FLOAT | MASK_BACKCHAIN)
+ | MASK_HARD_DFP | MASK_BACKCHAIN)
/* Exception handling. */
diff --git a/gcc/config/score/score.h b/gcc/config/score/score.h
index 0b7af7b2739..cde9c222546 100644
--- a/gcc/config/score/score.h
+++ b/gcc/config/score/score.h
@@ -688,9 +688,6 @@ typedef struct score_args
#define HAVE_PRE_MODIFY_REG 0
#define HAVE_POST_MODIFY_REG 0
-/* Recognize any constant value that is a valid address. */
-#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
-
/* Maximum number of registers that can appear in a valid memory address. */
#define MAX_REGS_PER_ADDRESS 1
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 679cf11e83e..26bceea670d 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -222,7 +222,9 @@ static bool sh_optimize_target_register_callee_saved (bool);
static bool sh_ms_bitfield_layout_p (const_tree);
static void sh_init_builtins (void);
+static tree sh_builtin_decl (unsigned, bool);
static void sh_media_init_builtins (void);
+static tree sh_media_builtin_decl (unsigned, bool);
static rtx sh_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
static void sh_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree);
static void sh_file_start (void);
@@ -416,6 +418,8 @@ static const struct attribute_spec sh_attribute_table[] =
#undef TARGET_INIT_BUILTINS
#define TARGET_INIT_BUILTINS sh_init_builtins
+#undef TARGET_BUILTIN_DECL
+#define TARGET_BUILTIN_DECL sh_builtin_decl
#undef TARGET_EXPAND_BUILTIN
#define TARGET_EXPAND_BUILTIN sh_expand_builtin
@@ -9427,6 +9431,7 @@ nonpic_symbol_mentioned_p (rtx x)
|| XINT (x, 1) == UNSPEC_GOTPLT
|| XINT (x, 1) == UNSPEC_GOTTPOFF
|| XINT (x, 1) == UNSPEC_DTPOFF
+ || XINT (x, 1) == UNSPEC_TPOFF
|| XINT (x, 1) == UNSPEC_PLT
|| XINT (x, 1) == UNSPEC_SYMOFF
|| XINT (x, 1) == UNSPEC_PCREL_SYMOFF))
@@ -10520,6 +10525,7 @@ struct builtin_description
const enum insn_code icode;
const char *const name;
int signature;
+ tree fndecl;
};
/* describe number and signedness of arguments; arg[0] == result
@@ -10586,99 +10592,99 @@ static const char signature_args[][4] =
/* mshalds, mshard, mshards, mshlld, mshlrd: shift count is unsigned int. */
/* mshards_q: returns signed short. */
/* nsb: takes long long arg, returns unsigned char. */
-static const struct builtin_description bdesc[] =
-{
- { CODE_FOR_absv2si2, "__builtin_absv2si2", SH_BLTIN_V2SI2 },
- { CODE_FOR_absv4hi2, "__builtin_absv4hi2", SH_BLTIN_V4HI2 },
- { CODE_FOR_addv2si3, "__builtin_addv2si3", SH_BLTIN_V2SI3 },
- { CODE_FOR_addv4hi3, "__builtin_addv4hi3", SH_BLTIN_V4HI3 },
- { CODE_FOR_ssaddv2si3,"__builtin_ssaddv2si3", SH_BLTIN_V2SI3 },
- { CODE_FOR_usaddv8qi3,"__builtin_usaddv8qi3", SH_BLTIN_V8QI3 },
- { CODE_FOR_ssaddv4hi3,"__builtin_ssaddv4hi3", SH_BLTIN_V4HI3 },
- { CODE_FOR_alloco_i, "__builtin_sh_media_ALLOCO", SH_BLTIN_PV },
- { CODE_FOR_negcmpeqv8qi,"__builtin_sh_media_MCMPEQ_B", SH_BLTIN_V8QI3 },
- { CODE_FOR_negcmpeqv2si,"__builtin_sh_media_MCMPEQ_L", SH_BLTIN_V2SI3 },
- { CODE_FOR_negcmpeqv4hi,"__builtin_sh_media_MCMPEQ_W", SH_BLTIN_V4HI3 },
- { CODE_FOR_negcmpgtuv8qi,"__builtin_sh_media_MCMPGT_UB", SH_BLTIN_V8QI3 },
- { CODE_FOR_negcmpgtv2si,"__builtin_sh_media_MCMPGT_L", SH_BLTIN_V2SI3 },
- { CODE_FOR_negcmpgtv4hi,"__builtin_sh_media_MCMPGT_W", SH_BLTIN_V4HI3 },
- { CODE_FOR_mcmv, "__builtin_sh_media_MCMV", SH_BLTIN_UUUU },
- { CODE_FOR_mcnvs_lw, "__builtin_sh_media_MCNVS_LW", SH_BLTIN_3 },
- { CODE_FOR_mcnvs_wb, "__builtin_sh_media_MCNVS_WB", SH_BLTIN_V4HI2V8QI },
- { CODE_FOR_mcnvs_wub, "__builtin_sh_media_MCNVS_WUB", SH_BLTIN_V4HI2V8QI },
- { CODE_FOR_mextr1, "__builtin_sh_media_MEXTR1", SH_BLTIN_V8QI3 },
- { CODE_FOR_mextr2, "__builtin_sh_media_MEXTR2", SH_BLTIN_V8QI3 },
- { CODE_FOR_mextr3, "__builtin_sh_media_MEXTR3", SH_BLTIN_V8QI3 },
- { CODE_FOR_mextr4, "__builtin_sh_media_MEXTR4", SH_BLTIN_V8QI3 },
- { CODE_FOR_mextr5, "__builtin_sh_media_MEXTR5", SH_BLTIN_V8QI3 },
- { CODE_FOR_mextr6, "__builtin_sh_media_MEXTR6", SH_BLTIN_V8QI3 },
- { CODE_FOR_mextr7, "__builtin_sh_media_MEXTR7", SH_BLTIN_V8QI3 },
- { CODE_FOR_mmacfx_wl, "__builtin_sh_media_MMACFX_WL", SH_BLTIN_MAC_HISI },
- { CODE_FOR_mmacnfx_wl,"__builtin_sh_media_MMACNFX_WL", SH_BLTIN_MAC_HISI },
- { CODE_FOR_mulv2si3, "__builtin_mulv2si3", SH_BLTIN_V2SI3, },
- { CODE_FOR_mulv4hi3, "__builtin_mulv4hi3", SH_BLTIN_V4HI3 },
- { CODE_FOR_mmulfx_l, "__builtin_sh_media_MMULFX_L", SH_BLTIN_V2SI3 },
- { CODE_FOR_mmulfx_w, "__builtin_sh_media_MMULFX_W", SH_BLTIN_V4HI3 },
- { CODE_FOR_mmulfxrp_w,"__builtin_sh_media_MMULFXRP_W", SH_BLTIN_V4HI3 },
- { CODE_FOR_mmulhi_wl, "__builtin_sh_media_MMULHI_WL", SH_BLTIN_V4HI2V2SI },
- { CODE_FOR_mmullo_wl, "__builtin_sh_media_MMULLO_WL", SH_BLTIN_V4HI2V2SI },
- { CODE_FOR_mmulsum_wq,"__builtin_sh_media_MMULSUM_WQ", SH_BLTIN_XXUU },
- { CODE_FOR_mperm_w, "__builtin_sh_media_MPERM_W", SH_BLTIN_SH_HI },
- { CODE_FOR_msad_ubq, "__builtin_sh_media_MSAD_UBQ", SH_BLTIN_XXUU },
- { CODE_FOR_mshalds_l, "__builtin_sh_media_MSHALDS_L", SH_BLTIN_SH_SI },
- { CODE_FOR_mshalds_w, "__builtin_sh_media_MSHALDS_W", SH_BLTIN_SH_HI },
- { CODE_FOR_ashrv2si3, "__builtin_ashrv2si3", SH_BLTIN_SH_SI },
- { CODE_FOR_ashrv4hi3, "__builtin_ashrv4hi3", SH_BLTIN_SH_HI },
- { CODE_FOR_mshards_q, "__builtin_sh_media_MSHARDS_Q", SH_BLTIN_SUS },
- { CODE_FOR_mshfhi_b, "__builtin_sh_media_MSHFHI_B", SH_BLTIN_V8QI3 },
- { CODE_FOR_mshfhi_l, "__builtin_sh_media_MSHFHI_L", SH_BLTIN_V2SI3 },
- { CODE_FOR_mshfhi_w, "__builtin_sh_media_MSHFHI_W", SH_BLTIN_V4HI3 },
- { CODE_FOR_mshflo_b, "__builtin_sh_media_MSHFLO_B", SH_BLTIN_V8QI3 },
- { CODE_FOR_mshflo_l, "__builtin_sh_media_MSHFLO_L", SH_BLTIN_V2SI3 },
- { CODE_FOR_mshflo_w, "__builtin_sh_media_MSHFLO_W", SH_BLTIN_V4HI3 },
- { CODE_FOR_ashlv2si3, "__builtin_ashlv2si3", SH_BLTIN_SH_SI },
- { CODE_FOR_ashlv4hi3, "__builtin_ashlv4hi3", SH_BLTIN_SH_HI },
- { CODE_FOR_lshrv2si3, "__builtin_lshrv2si3", SH_BLTIN_SH_SI },
- { CODE_FOR_lshrv4hi3, "__builtin_lshrv4hi3", SH_BLTIN_SH_HI },
- { CODE_FOR_subv2si3, "__builtin_subv2si3", SH_BLTIN_V2SI3 },
- { CODE_FOR_subv4hi3, "__builtin_subv4hi3", SH_BLTIN_V4HI3 },
- { CODE_FOR_sssubv2si3,"__builtin_sssubv2si3", SH_BLTIN_V2SI3 },
- { CODE_FOR_ussubv8qi3,"__builtin_ussubv8qi3", SH_BLTIN_V8QI3 },
- { CODE_FOR_sssubv4hi3,"__builtin_sssubv4hi3", SH_BLTIN_V4HI3 },
- { CODE_FOR_fcosa_s, "__builtin_sh_media_FCOSA_S", SH_BLTIN_SISF },
- { CODE_FOR_fsina_s, "__builtin_sh_media_FSINA_S", SH_BLTIN_SISF },
- { CODE_FOR_fipr, "__builtin_sh_media_FIPR_S", SH_BLTIN_3 },
- { CODE_FOR_ftrv, "__builtin_sh_media_FTRV_S", SH_BLTIN_3 },
- { CODE_FOR_mac_media, "__builtin_sh_media_FMAC_S", SH_BLTIN_3 },
- { CODE_FOR_sqrtdf2, "__builtin_sh_media_FSQRT_D", SH_BLTIN_2 },
- { CODE_FOR_sqrtsf2, "__builtin_sh_media_FSQRT_S", SH_BLTIN_2 },
- { CODE_FOR_fsrra_s, "__builtin_sh_media_FSRRA_S", SH_BLTIN_2 },
- { CODE_FOR_ldhi_l, "__builtin_sh_media_LDHI_L", SH_BLTIN_LDUA_L },
- { CODE_FOR_ldhi_q, "__builtin_sh_media_LDHI_Q", SH_BLTIN_LDUA_Q },
- { CODE_FOR_ldlo_l, "__builtin_sh_media_LDLO_L", SH_BLTIN_LDUA_L },
- { CODE_FOR_ldlo_q, "__builtin_sh_media_LDLO_Q", SH_BLTIN_LDUA_Q },
- { CODE_FOR_sthi_l, "__builtin_sh_media_STHI_L", SH_BLTIN_STUA_L },
- { CODE_FOR_sthi_q, "__builtin_sh_media_STHI_Q", SH_BLTIN_STUA_Q },
- { CODE_FOR_stlo_l, "__builtin_sh_media_STLO_L", SH_BLTIN_STUA_L },
- { CODE_FOR_stlo_q, "__builtin_sh_media_STLO_Q", SH_BLTIN_STUA_Q },
- { CODE_FOR_ldhi_l64, "__builtin_sh_media_LDHI_L", SH_BLTIN_LDUA_L64 },
- { CODE_FOR_ldhi_q64, "__builtin_sh_media_LDHI_Q", SH_BLTIN_LDUA_Q64 },
- { CODE_FOR_ldlo_l64, "__builtin_sh_media_LDLO_L", SH_BLTIN_LDUA_L64 },
- { CODE_FOR_ldlo_q64, "__builtin_sh_media_LDLO_Q", SH_BLTIN_LDUA_Q64 },
- { CODE_FOR_sthi_l64, "__builtin_sh_media_STHI_L", SH_BLTIN_STUA_L64 },
- { CODE_FOR_sthi_q64, "__builtin_sh_media_STHI_Q", SH_BLTIN_STUA_Q64 },
- { CODE_FOR_stlo_l64, "__builtin_sh_media_STLO_L", SH_BLTIN_STUA_L64 },
- { CODE_FOR_stlo_q64, "__builtin_sh_media_STLO_Q", SH_BLTIN_STUA_Q64 },
- { CODE_FOR_nsb, "__builtin_sh_media_NSB", SH_BLTIN_SU },
- { CODE_FOR_byterev, "__builtin_sh_media_BYTEREV", SH_BLTIN_2 },
- { CODE_FOR_prefetch, "__builtin_sh_media_PREFO", SH_BLTIN_PSSV },
+static struct builtin_description bdesc[] =
+{
+ { CODE_FOR_absv2si2, "__builtin_absv2si2", SH_BLTIN_V2SI2, 0 },
+ { CODE_FOR_absv4hi2, "__builtin_absv4hi2", SH_BLTIN_V4HI2, 0 },
+ { CODE_FOR_addv2si3, "__builtin_addv2si3", SH_BLTIN_V2SI3, 0 },
+ { CODE_FOR_addv4hi3, "__builtin_addv4hi3", SH_BLTIN_V4HI3, 0 },
+ { CODE_FOR_ssaddv2si3,"__builtin_ssaddv2si3", SH_BLTIN_V2SI3, 0 },
+ { CODE_FOR_usaddv8qi3,"__builtin_usaddv8qi3", SH_BLTIN_V8QI3, 0 },
+ { CODE_FOR_ssaddv4hi3,"__builtin_ssaddv4hi3", SH_BLTIN_V4HI3, 0 },
+ { CODE_FOR_alloco_i, "__builtin_sh_media_ALLOCO", SH_BLTIN_PV, 0 },
+ { CODE_FOR_negcmpeqv8qi,"__builtin_sh_media_MCMPEQ_B", SH_BLTIN_V8QI3, 0 },
+ { CODE_FOR_negcmpeqv2si,"__builtin_sh_media_MCMPEQ_L", SH_BLTIN_V2SI3, 0 },
+ { CODE_FOR_negcmpeqv4hi,"__builtin_sh_media_MCMPEQ_W", SH_BLTIN_V4HI3, 0 },
+ { CODE_FOR_negcmpgtuv8qi,"__builtin_sh_media_MCMPGT_UB", SH_BLTIN_V8QI3, 0 },
+ { CODE_FOR_negcmpgtv2si,"__builtin_sh_media_MCMPGT_L", SH_BLTIN_V2SI3, 0 },
+ { CODE_FOR_negcmpgtv4hi,"__builtin_sh_media_MCMPGT_W", SH_BLTIN_V4HI3, 0 },
+ { CODE_FOR_mcmv, "__builtin_sh_media_MCMV", SH_BLTIN_UUUU, 0 },
+ { CODE_FOR_mcnvs_lw, "__builtin_sh_media_MCNVS_LW", SH_BLTIN_3, 0 },
+ { CODE_FOR_mcnvs_wb, "__builtin_sh_media_MCNVS_WB", SH_BLTIN_V4HI2V8QI, 0 },
+ { CODE_FOR_mcnvs_wub, "__builtin_sh_media_MCNVS_WUB", SH_BLTIN_V4HI2V8QI, 0 },
+ { CODE_FOR_mextr1, "__builtin_sh_media_MEXTR1", SH_BLTIN_V8QI3, 0 },
+ { CODE_FOR_mextr2, "__builtin_sh_media_MEXTR2", SH_BLTIN_V8QI3, 0 },
+ { CODE_FOR_mextr3, "__builtin_sh_media_MEXTR3", SH_BLTIN_V8QI3, 0 },
+ { CODE_FOR_mextr4, "__builtin_sh_media_MEXTR4", SH_BLTIN_V8QI3, 0 },
+ { CODE_FOR_mextr5, "__builtin_sh_media_MEXTR5", SH_BLTIN_V8QI3, 0 },
+ { CODE_FOR_mextr6, "__builtin_sh_media_MEXTR6", SH_BLTIN_V8QI3, 0 },
+ { CODE_FOR_mextr7, "__builtin_sh_media_MEXTR7", SH_BLTIN_V8QI3, 0 },
+ { CODE_FOR_mmacfx_wl, "__builtin_sh_media_MMACFX_WL", SH_BLTIN_MAC_HISI, 0 },
+ { CODE_FOR_mmacnfx_wl,"__builtin_sh_media_MMACNFX_WL", SH_BLTIN_MAC_HISI, 0 },
+ { CODE_FOR_mulv2si3, "__builtin_mulv2si3", SH_BLTIN_V2SI3, 0 },
+ { CODE_FOR_mulv4hi3, "__builtin_mulv4hi3", SH_BLTIN_V4HI3, 0 },
+ { CODE_FOR_mmulfx_l, "__builtin_sh_media_MMULFX_L", SH_BLTIN_V2SI3, 0 },
+ { CODE_FOR_mmulfx_w, "__builtin_sh_media_MMULFX_W", SH_BLTIN_V4HI3, 0 },
+ { CODE_FOR_mmulfxrp_w,"__builtin_sh_media_MMULFXRP_W", SH_BLTIN_V4HI3, 0 },
+ { CODE_FOR_mmulhi_wl, "__builtin_sh_media_MMULHI_WL", SH_BLTIN_V4HI2V2SI, 0 },
+ { CODE_FOR_mmullo_wl, "__builtin_sh_media_MMULLO_WL", SH_BLTIN_V4HI2V2SI, 0 },
+ { CODE_FOR_mmulsum_wq,"__builtin_sh_media_MMULSUM_WQ", SH_BLTIN_XXUU, 0 },
+ { CODE_FOR_mperm_w, "__builtin_sh_media_MPERM_W", SH_BLTIN_SH_HI, 0 },
+ { CODE_FOR_msad_ubq, "__builtin_sh_media_MSAD_UBQ", SH_BLTIN_XXUU, 0 },
+ { CODE_FOR_mshalds_l, "__builtin_sh_media_MSHALDS_L", SH_BLTIN_SH_SI, 0 },
+ { CODE_FOR_mshalds_w, "__builtin_sh_media_MSHALDS_W", SH_BLTIN_SH_HI, 0 },
+ { CODE_FOR_ashrv2si3, "__builtin_ashrv2si3", SH_BLTIN_SH_SI, 0 },
+ { CODE_FOR_ashrv4hi3, "__builtin_ashrv4hi3", SH_BLTIN_SH_HI, 0 },
+ { CODE_FOR_mshards_q, "__builtin_sh_media_MSHARDS_Q", SH_BLTIN_SUS, 0 },
+ { CODE_FOR_mshfhi_b, "__builtin_sh_media_MSHFHI_B", SH_BLTIN_V8QI3, 0 },
+ { CODE_FOR_mshfhi_l, "__builtin_sh_media_MSHFHI_L", SH_BLTIN_V2SI3, 0 },
+ { CODE_FOR_mshfhi_w, "__builtin_sh_media_MSHFHI_W", SH_BLTIN_V4HI3, 0 },
+ { CODE_FOR_mshflo_b, "__builtin_sh_media_MSHFLO_B", SH_BLTIN_V8QI3, 0 },
+ { CODE_FOR_mshflo_l, "__builtin_sh_media_MSHFLO_L", SH_BLTIN_V2SI3, 0 },
+ { CODE_FOR_mshflo_w, "__builtin_sh_media_MSHFLO_W", SH_BLTIN_V4HI3, 0 },
+ { CODE_FOR_ashlv2si3, "__builtin_ashlv2si3", SH_BLTIN_SH_SI, 0 },
+ { CODE_FOR_ashlv4hi3, "__builtin_ashlv4hi3", SH_BLTIN_SH_HI, 0 },
+ { CODE_FOR_lshrv2si3, "__builtin_lshrv2si3", SH_BLTIN_SH_SI, 0 },
+ { CODE_FOR_lshrv4hi3, "__builtin_lshrv4hi3", SH_BLTIN_SH_HI, 0 },
+ { CODE_FOR_subv2si3, "__builtin_subv2si3", SH_BLTIN_V2SI3, 0 },
+ { CODE_FOR_subv4hi3, "__builtin_subv4hi3", SH_BLTIN_V4HI3, 0 },
+ { CODE_FOR_sssubv2si3,"__builtin_sssubv2si3", SH_BLTIN_V2SI3, 0 },
+ { CODE_FOR_ussubv8qi3,"__builtin_ussubv8qi3", SH_BLTIN_V8QI3, 0 },
+ { CODE_FOR_sssubv4hi3,"__builtin_sssubv4hi3", SH_BLTIN_V4HI3, 0 },
+ { CODE_FOR_fcosa_s, "__builtin_sh_media_FCOSA_S", SH_BLTIN_SISF, 0 },
+ { CODE_FOR_fsina_s, "__builtin_sh_media_FSINA_S", SH_BLTIN_SISF, 0 },
+ { CODE_FOR_fipr, "__builtin_sh_media_FIPR_S", SH_BLTIN_3, 0 },
+ { CODE_FOR_ftrv, "__builtin_sh_media_FTRV_S", SH_BLTIN_3, 0 },
+ { CODE_FOR_mac_media, "__builtin_sh_media_FMAC_S", SH_BLTIN_3, 0 },
+ { CODE_FOR_sqrtdf2, "__builtin_sh_media_FSQRT_D", SH_BLTIN_2, 0 },
+ { CODE_FOR_sqrtsf2, "__builtin_sh_media_FSQRT_S", SH_BLTIN_2, 0 },
+ { CODE_FOR_fsrra_s, "__builtin_sh_media_FSRRA_S", SH_BLTIN_2, 0 },
+ { CODE_FOR_ldhi_l, "__builtin_sh_media_LDHI_L", SH_BLTIN_LDUA_L, 0 },
+ { CODE_FOR_ldhi_q, "__builtin_sh_media_LDHI_Q", SH_BLTIN_LDUA_Q, 0 },
+ { CODE_FOR_ldlo_l, "__builtin_sh_media_LDLO_L", SH_BLTIN_LDUA_L, 0 },
+ { CODE_FOR_ldlo_q, "__builtin_sh_media_LDLO_Q", SH_BLTIN_LDUA_Q, 0 },
+ { CODE_FOR_sthi_l, "__builtin_sh_media_STHI_L", SH_BLTIN_STUA_L, 0 },
+ { CODE_FOR_sthi_q, "__builtin_sh_media_STHI_Q", SH_BLTIN_STUA_Q, 0 },
+ { CODE_FOR_stlo_l, "__builtin_sh_media_STLO_L", SH_BLTIN_STUA_L, 0 },
+ { CODE_FOR_stlo_q, "__builtin_sh_media_STLO_Q", SH_BLTIN_STUA_Q, 0 },
+ { CODE_FOR_ldhi_l64, "__builtin_sh_media_LDHI_L", SH_BLTIN_LDUA_L64, 0 },
+ { CODE_FOR_ldhi_q64, "__builtin_sh_media_LDHI_Q", SH_BLTIN_LDUA_Q64, 0 },
+ { CODE_FOR_ldlo_l64, "__builtin_sh_media_LDLO_L", SH_BLTIN_LDUA_L64, 0 },
+ { CODE_FOR_ldlo_q64, "__builtin_sh_media_LDLO_Q", SH_BLTIN_LDUA_Q64, 0 },
+ { CODE_FOR_sthi_l64, "__builtin_sh_media_STHI_L", SH_BLTIN_STUA_L64, 0 },
+ { CODE_FOR_sthi_q64, "__builtin_sh_media_STHI_Q", SH_BLTIN_STUA_Q64, 0 },
+ { CODE_FOR_stlo_l64, "__builtin_sh_media_STLO_L", SH_BLTIN_STUA_L64, 0 },
+ { CODE_FOR_stlo_q64, "__builtin_sh_media_STLO_Q", SH_BLTIN_STUA_Q64, 0 },
+ { CODE_FOR_nsb, "__builtin_sh_media_NSB", SH_BLTIN_SU, 0 },
+ { CODE_FOR_byterev, "__builtin_sh_media_BYTEREV", SH_BLTIN_2, 0 },
+ { CODE_FOR_prefetch, "__builtin_sh_media_PREFO", SH_BLTIN_PSSV, 0 },
};
static void
sh_media_init_builtins (void)
{
tree shared[SH_BLTIN_NUM_SHARED_SIGNATURES];
- const struct builtin_description *d;
+ struct builtin_description *d;
memset (shared, 0, sizeof shared);
for (d = bdesc; d - bdesc < (int) ARRAY_SIZE (bdesc); d++)
@@ -10724,11 +10730,23 @@ sh_media_init_builtins (void)
if (signature < SH_BLTIN_NUM_SHARED_SIGNATURES)
shared[signature] = type;
}
- add_builtin_function (d->name, type, d - bdesc, BUILT_IN_MD,
- NULL, NULL_TREE);
+ d->fndecl =
+ add_builtin_function (d->name, type, d - bdesc, BUILT_IN_MD,
+ NULL, NULL_TREE);
}
}
+/* Returns the shmedia builtin decl for CODE. */
+
+static tree
+sh_media_builtin_decl (unsigned code, bool initialize_p ATTRIBUTE_UNUSED)
+{
+ if (code >= ARRAY_SIZE (bdesc))
+ return error_mark_node;
+
+ return bdesc[code].fndecl;
+}
+
/* Implements target hook vector_mode_supported_p. */
bool
sh_vector_mode_supported_p (enum machine_mode mode)
@@ -10767,6 +10785,17 @@ sh_init_builtins (void)
sh_media_init_builtins ();
}
+/* Returns the sh builtin decl for CODE. */
+
+static tree
+sh_builtin_decl (unsigned code, bool initialize_p ATTRIBUTE_UNUSED)
+{
+ if (TARGET_SHMEDIA)
+ return sh_media_builtin_decl (code, initialize_p);
+
+ return error_mark_node;
+}
+
/* Expand an expression EXP that calls a built-in function,
with result going to TARGET if that's convenient
(and in mode MODE if that's convenient).
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index f06098bfc1b..7fa634777b3 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -6824,8 +6824,8 @@ label:
;; jump around the unconditional jump because it was out of range.
(define_insn "stuff_delay_slot"
[(set (pc)
- (unspec [(match_operand:SI 0 "const_int_operand" "") (pc)] UNSPEC_BBR))
- (set (reg:SI T_REG) (match_operand:SI 1 "const_int_operand" ""))]
+ (unspec [(match_operand:SI 0 "const_int_operand" "") (pc)
+ (match_operand:SI 1 "const_int_operand" "")] UNSPEC_BBR))]
"TARGET_SH1"
""
[(set_attr "length" "0")
@@ -6889,8 +6889,6 @@ label:
"TARGET_SHMEDIA"
"
{
- /* hack to generate same code. */
- rtx tmp_di = GET_CODE (operands[0]) == UNORDERED ? NULL : gen_reg_rtx (DImode);
rtx tmp = gen_reg_rtx (SImode);
rtx cmp;
if (GET_CODE (operands[0]) == NE)
@@ -6900,13 +6898,12 @@ label:
operands[1], operands[2]);
emit_insn (gen_cstore4_media (tmp, cmp, operands[1], operands[2]));
- if (tmp_di) emit_insn (gen_extendsidi2 (tmp_di, tmp)); else tmp_di = tmp;
if (GET_CODE (cmp) == GET_CODE (operands[0]))
- operands[0] = gen_rtx_NE (VOIDmode, tmp_di, const0_rtx);
+ operands[0] = gen_rtx_NE (VOIDmode, tmp, const0_rtx);
else
- operands[0] = gen_rtx_EQ (VOIDmode, tmp_di, const0_rtx);
- operands[1] = tmp_di;
+ operands[0] = gen_rtx_EQ (VOIDmode, tmp, const0_rtx);
+ operands[1] = tmp;
operands[2] = const0_rtx;
operands[3] = gen_rtx_LABEL_REF (Pmode, operands[3]);
}")
diff --git a/gcc/config/sparc/sol2-unwind.h b/gcc/config/sparc/sol2-unwind.h
new file mode 100644
index 00000000000..c98dc4dc088
--- /dev/null
+++ b/gcc/config/sparc/sol2-unwind.h
@@ -0,0 +1,458 @@
+/* DWARF2 EH unwinding support for SPARC Solaris.
+ Copyright (C) 2009 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/>. */
+
+/* Do code reading to identify a signal frame, and set the frame
+ state data appropriately. See unwind-dw2.c for the structs. */
+
+#include <ucontext.h>
+
+#if defined(__arch64__)
+
+#define MD_FALLBACK_FRAME_STATE_FOR sparc64_fallback_frame_state
+
+static _Unwind_Reason_Code
+sparc64_fallback_frame_state (struct _Unwind_Context *context,
+ _Unwind_FrameState *fs)
+{
+ void *pc = context->ra;
+ void *this_cfa = context->cfa;
+ void *new_cfa, *ra_location, *shifted_ra_location;
+ int regs_off;
+ int fpu_save_off;
+ unsigned char fpu_save;
+ int i;
+
+ /* This is the observed pattern for the sigacthandler in Solaris 8. */
+ unsigned int sigacthandler_sol8_pattern []
+ = {0x9401400f, 0xca5aafa0, 0x913e2000, 0x892a3003,
+ 0xe0590005, 0x9fc40000, 0x9410001a, 0x80a6e008};
+
+ /* This is the observed pattern for the sigacthandler in Solaris 9. */
+ unsigned int sigacthandler_sol9_pattern []
+ = {0xa33e2000, 0x00000000, 0x892c7003, 0x90100011,
+ 0xe0590005, 0x9fc40000, 0x9410001a, 0x80a46008};
+
+ /* This is the observed pattern for the __sighndlr. */
+ unsigned int sighndlr_pattern []
+ = {0x9de3bf50, 0x90100018, 0x92100019, 0x9fc6c000,
+ 0x9410001a, 0x81c7e008, 0x81e80000};
+
+ /* Deal with frame-less function from which a signal was raised. */
+ if (_Unwind_IsSignalFrame (context))
+ {
+ /* The CFA is by definition unmodified in this case. */
+ fs->regs.cfa_how = CFA_REG_OFFSET;
+ fs->regs.cfa_reg = __builtin_dwarf_sp_column ();
+ fs->regs.cfa_offset = 0;
+
+ /* This is the canonical RA column. */
+ fs->retaddr_column = 15;
+
+ return _URC_NO_REASON;
+ }
+
+ /* Look for the sigacthandler pattern. The pattern changes slightly
+ in different versions of the operating system, so we skip the
+ comparison against pc-(4*6) for Solaris 9. */
+ if (( *(unsigned int *)(pc-(4*7)) == sigacthandler_sol8_pattern[0]
+ && *(unsigned int *)(pc-(4*6)) == sigacthandler_sol8_pattern[1]
+ && *(unsigned int *)(pc-(4*5)) == sigacthandler_sol8_pattern[2]
+ && *(unsigned int *)(pc-(4*4)) == sigacthandler_sol8_pattern[3]
+ && *(unsigned int *)(pc-(4*3)) == sigacthandler_sol8_pattern[4]
+ && *(unsigned int *)(pc-(4*2)) == sigacthandler_sol8_pattern[5]
+ && *(unsigned int *)(pc-(4*1)) == sigacthandler_sol8_pattern[6]
+ && *(unsigned int *)(pc-(4*0)) == sigacthandler_sol8_pattern[7] ) ||
+ ( *(unsigned int *)(pc-(4*7)) == sigacthandler_sol9_pattern[0]
+ /* skip pc-(4*6) */
+ && *(unsigned int *)(pc-(4*5)) == sigacthandler_sol9_pattern[2]
+ && *(unsigned int *)(pc-(4*4)) == sigacthandler_sol9_pattern[3]
+ && *(unsigned int *)(pc-(4*3)) == sigacthandler_sol9_pattern[4]
+ && *(unsigned int *)(pc-(4*2)) == sigacthandler_sol9_pattern[5]
+ && *(unsigned int *)(pc-(4*1)) == sigacthandler_sol9_pattern[6]
+ && *(unsigned int *)(pc-(4*0)) == sigacthandler_sol9_pattern[7] ) )
+ /* We need to move up two frames (the kernel frame and the handler
+ frame). Minimum stack frame size is 176 bytes (128 + 48): 128
+ bytes for spilling register window (16 extended words for in
+ and local registers), and 6 extended words to store at least
+ 6 arguments to callees, The kernel frame and the sigacthandler
+ both have this minimal stack. The ucontext_t structure is after
+ this offset. */
+ regs_off = 176 + 176;
+
+ /* Look for the __sighndlr pattern. */
+ else if ( *(unsigned int *)(pc-(4*5)) == sighndlr_pattern[0]
+ && *(unsigned int *)(pc-(4*4)) == sighndlr_pattern[1]
+ && *(unsigned int *)(pc-(4*3)) == sighndlr_pattern[2]
+ && *(unsigned int *)(pc-(4*2)) == sighndlr_pattern[3]
+ && *(unsigned int *)(pc-(4*1)) == sighndlr_pattern[4]
+ && *(unsigned int *)(pc-(4*0)) == sighndlr_pattern[5]
+ && *(unsigned int *)(pc+(4*1)) == sighndlr_pattern[6] )
+ {
+ /* We have observed different calling frames among different
+ versions of the operating system, so that we need to
+ discriminate using the upper frame. We look for the return
+ address of the caller frame (there is an offset of 15 double
+ words between the frame address and the place where this return
+ address is stored) in order to do some more pattern matching. */
+ unsigned int cuh_pattern
+ = *(unsigned int *)(*(unsigned long *)(this_cfa + 15*8) - 4);
+
+ if (cuh_pattern == 0x9410001a || cuh_pattern == 0x94100013)
+ /* This matches the call_user_handler pattern for Solaris 9 and
+ for Solaris 8 running inside Solaris Containers respectively.
+ We need to move up four frames (the kernel frame, the signal
+ frame, the call_user_handler frame, the __sighndlr frame).
+ Three of them have the minimum stack frame size (kernel,
+ signal, and __sighndlr frames) of 176 bytes, and there is
+ another with a stack frame of 304 bytes (the call_user_handler
+ frame). The ucontext_t structure is after this offset. */
+ regs_off = 176 + 176 + 176 + 304;
+ else
+ /* We need to move up three frames (the kernel frame, the
+ sigacthandler frame, and the __sighndlr frame). The kernel
+ frame has a stack frame size of 176, the __sighndlr frames of
+ 304 bytes, and there is a stack frame of 176 bytes for the
+ sigacthandler frame. The ucontext_t structure is after this
+ offset. */
+ regs_off = 176 + 304 + 176;
+ }
+
+ /* Exit if the pattern at the return address does not match the
+ previous three patterns. */
+ else
+ return _URC_END_OF_STACK;
+
+ /* FPU information can be extracted from the ucontext_t structure
+ that is the third argument for the signal handler, that is saved
+ in the stack. There are 64 bytes between the beginning of the
+ ucontext_t argument of the signal handler and the uc_mcontext
+ field. There are 176 bytes between the beginning of uc_mcontext
+ and the beginning of the fpregs field. */
+ fpu_save_off = regs_off + (8*10) + 176;
+
+ /* The fpregs field contains 32 extended words at the beginning that
+ contain the fpu state. Then there are 2 extended words and two
+ bytes. */
+ fpu_save = *(unsigned char *)(this_cfa + fpu_save_off + (8*32) + (2*8) + 2);
+
+ /* We need to get the frame pointer for the kernel frame that
+ executes when the signal is raised. This frame is just the
+ following to the application code that generated the signal, so
+ that the later's stack pointer is the former's frame pointer.
+ The stack pointer for the interrupted application code can be
+ calculated from the ucontext_t structure (third argument for the
+ signal handler) that is saved in the stack. There are 10 words
+ between the beginning of the ucontext_t argument of the signal
+ handler and the uc_mcontext.gregs field that contains the
+ registers saved by the signal handler. */
+ new_cfa = *(void **)(this_cfa + regs_off + (8*10) + (REG_SP*8));
+ /* The frame address is %sp + STACK_BIAS in 64-bit mode. */
+ new_cfa += 2047;
+ fs->regs.cfa_how = CFA_REG_OFFSET;
+ fs->regs.cfa_reg = __builtin_dwarf_sp_column ();
+ fs->regs.cfa_offset = new_cfa - this_cfa;
+
+ /* Restore global and out registers (in this order) from the
+ ucontext_t structure, uc_mcontext.gregs field. */
+ for (i = 1; i < 16; i++)
+ {
+ /* We never restore %sp as everything is purely CFA-based. */
+ if ((unsigned int) i == __builtin_dwarf_sp_column ())
+ continue;
+
+ /* First the global registers and then the out registers. */
+ fs->regs.reg[i].how = REG_SAVED_OFFSET;
+ fs->regs.reg[i].loc.offset
+ = this_cfa + regs_off + (8*10) + ((REG_Y+i)*8) - new_cfa;
+ }
+
+ /* Just above the stack pointer there are 16 extended words in which
+ the register window (in and local registers) was saved. */
+ for (i = 0; i < 16; i++)
+ {
+ fs->regs.reg[i + 16].how = REG_SAVED_OFFSET;
+ fs->regs.reg[i + 16].loc.offset = i*8;
+ }
+
+ /* Check whether we need to restore fpu registers. */
+ if (fpu_save)
+ {
+ for (i = 0; i < 64; i++)
+ {
+ if (i > 32 && (i & 1))
+ continue;
+
+ fs->regs.reg[i + 32].how = REG_SAVED_OFFSET;
+ fs->regs.reg[i + 32].loc.offset
+ = this_cfa + fpu_save_off + (i*4) - new_cfa;
+ }
+ }
+
+ /* State the rules to find the kernel's code "return address", which is
+ the address of the active instruction when the signal was caught.
+ On the SPARC, since RETURN_ADDR_OFFSET (essentially 8) is defined, we
+ need to preventively subtract it from the purported return address. */
+ ra_location = this_cfa + regs_off + (8*10) + (REG_PC*8);
+ shifted_ra_location = this_cfa + regs_off + (8*10) + (REG_Y*8);
+ *(void **)shifted_ra_location = *(void **)ra_location - 8;
+ fs->retaddr_column = 0;
+ fs->regs.reg[0].how = REG_SAVED_OFFSET;
+ fs->regs.reg[0].loc.offset = shifted_ra_location - new_cfa;
+ fs->signal_frame = 1;
+
+ return _URC_NO_REASON;
+}
+
+#define MD_FROB_UPDATE_CONTEXT sparc64_frob_update_context
+
+static void
+sparc64_frob_update_context (struct _Unwind_Context *context,
+ _Unwind_FrameState *fs)
+{
+ /* The column of %sp contains the old CFA, not the old value of %sp.
+ The CFA offset already comprises the stack bias so, when %sp is the
+ CFA register, we must avoid counting the stack bias twice. Do not
+ do that for signal frames as the offset is artificial for them. */
+ if (fs->regs.cfa_reg == __builtin_dwarf_sp_column ()
+ && fs->regs.cfa_how == CFA_REG_OFFSET
+ && fs->regs.cfa_offset != 0
+ && !fs->signal_frame)
+ context->cfa -= 2047;
+}
+
+#else
+
+#define MD_FALLBACK_FRAME_STATE_FOR sparc_fallback_frame_state
+
+static _Unwind_Reason_Code
+sparc_fallback_frame_state (struct _Unwind_Context *context,
+ _Unwind_FrameState *fs)
+{
+ void *pc = context->ra;
+ void *this_cfa = context->cfa;
+ void *new_cfa, *ra_location, *shifted_ra_location;
+ int regs_off;
+ int fpu_save_off;
+ unsigned char fpu_save;
+ int i;
+
+ /* This is the observed pattern for the sigacthandler. */
+ unsigned int sigacthandler_pattern []
+ = {0x9602400f, 0x92100019, 0x00000000, 0x912e2002,
+ 0xe002000a, 0x90100018, 0x9fc40000, 0x9410001a,
+ 0x80a62008};
+
+ /* This is the observed pattern for the __libthread_segvhdlr. */
+ unsigned int segvhdlr_pattern []
+ = {0x94102000, 0xe007bfe4, 0x9010001c, 0x92100019,
+ 0x9fc40000, 0x9410001a, 0x81c7e008, 0x81e80000,
+ 0x80a26000};
+
+ /* This is the observed pattern for the __sighndlr. */
+ unsigned int sighndlr_pattern []
+ = {0x9de3bfa0, 0x90100018, 0x92100019, 0x9fc6c000,
+ 0x9410001a, 0x81c7e008, 0x81e80000};
+
+ /* Deal with frame-less function from which a signal was raised. */
+ if (_Unwind_IsSignalFrame (context))
+ {
+ /* The CFA is by definition unmodified in this case. */
+ fs->regs.cfa_how = CFA_REG_OFFSET;
+ fs->regs.cfa_reg = __builtin_dwarf_sp_column ();
+ fs->regs.cfa_offset = 0;
+
+ /* This is the canonical RA column. */
+ fs->retaddr_column = 15;
+
+ return _URC_NO_REASON;
+ }
+
+ /* Look for the sigacthandler pattern. The pattern changes slightly
+ in different versions of the operating system, so we skip the
+ comparison against pc-(4*6). */
+ if ( *(unsigned int *)(pc-(4*8)) == sigacthandler_pattern[0]
+ && *(unsigned int *)(pc-(4*7)) == sigacthandler_pattern[1]
+ /* skip pc-(4*6) */
+ && *(unsigned int *)(pc-(4*5)) == sigacthandler_pattern[3]
+ && *(unsigned int *)(pc-(4*4)) == sigacthandler_pattern[4]
+ && *(unsigned int *)(pc-(4*3)) == sigacthandler_pattern[5]
+ && *(unsigned int *)(pc-(4*2)) == sigacthandler_pattern[6]
+ && *(unsigned int *)(pc-(4*1)) == sigacthandler_pattern[7]
+ && *(unsigned int *)(pc-(4*0)) == sigacthandler_pattern[8] )
+ /* We need to move up two frames (the kernel frame and the handler
+ frame). Minimum stack frame size is 96 bytes (64 + 4 + 24): 64
+ bytes for spilling register window (16 words for in and local
+ registers), 4 bytes for a pointer to space for callees
+ returning structs, and 24 bytes to store at least six argument
+ to callees. The ucontext_t structure is after this offset. */
+ regs_off = 96 + 96;
+
+ /* Look for the __libthread_segvhdlr pattern. */
+ else if ( *(unsigned int *)(pc-(4*6)) == segvhdlr_pattern[0]
+ && *(unsigned int *)(pc-(4*5)) == segvhdlr_pattern[1]
+ && *(unsigned int *)(pc-(4*4)) == segvhdlr_pattern[2]
+ && *(unsigned int *)(pc-(4*3)) == segvhdlr_pattern[3]
+ && *(unsigned int *)(pc-(4*2)) == segvhdlr_pattern[4]
+ && *(unsigned int *)(pc-(4*1)) == segvhdlr_pattern[5]
+ && *(unsigned int *)(pc-(4*0)) == segvhdlr_pattern[6]
+ && *(unsigned int *)(pc+(4*1)) == segvhdlr_pattern[7]
+ && *(unsigned int *)(pc+(4*2)) == segvhdlr_pattern[8] )
+ /* We need to move up four frames (the kernel frame, the
+ sigacthandler frame, the __sighndlr frame, and the
+ __libthread_segvhdlr). Two of them have the minimum
+ stack frame size (kernel and __sighndlr frames) of 96 bytes,
+ other has a stack frame of 216 bytes (the sigacthandler frame),
+ and there is another with a stack frame of 128 bytes (the
+ __libthread_segvhdlr). The ucontext_t structure is after this
+ offset. */
+ regs_off = 96 + 96 + 128 + 216;
+
+ /* Look for the __sighndlr pattern. */
+ else if ( *(unsigned int *)(pc-(4*5)) == sighndlr_pattern[0]
+ && *(unsigned int *)(pc-(4*4)) == sighndlr_pattern[1]
+ && *(unsigned int *)(pc-(4*3)) == sighndlr_pattern[2]
+ && *(unsigned int *)(pc-(4*2)) == sighndlr_pattern[3]
+ && *(unsigned int *)(pc-(4*1)) == sighndlr_pattern[4]
+ && *(unsigned int *)(pc-(4*0)) == sighndlr_pattern[5]
+ && *(unsigned int *)(pc+(4*1)) == sighndlr_pattern[6] )
+ {
+ /* We have observed different calling frames among different
+ versions of the operating system, so that we need to
+ discriminate using the upper frame. We look for the return
+ address of the caller frame (there is an offset of 15 words
+ between the frame address and the place where this return
+ address is stored) in order to do some more pattern matching. */
+ unsigned int cuh_pattern
+ = *(unsigned int *)(*(unsigned int *)(this_cfa + 15*4) - 4);
+
+ if (cuh_pattern == 0xd407a04c)
+ /* This matches the call_user_handler pattern for Solaris 10.
+ We need to move up three frames (the kernel frame, the
+ call_user_handler frame, the __sighndlr frame). Two of them
+ have the minimum stack frame size (kernel and __sighndlr
+ frames) of 96 bytes, and there is another with a stack frame
+ of 160 bytes (the call_user_handler frame). The ucontext_t
+ structure is after this offset. */
+ regs_off = 96 + 96 + 160;
+ else if (cuh_pattern == 0x9410001a || cuh_pattern == 0x9410001b)
+ /* This matches the call_user_handler pattern for Solaris 9 and
+ for Solaris 8 running inside Solaris Containers respectively.
+ We need to move up four frames (the kernel frame, the signal
+ frame, the call_user_handler frame, the __sighndlr frame).
+ Three of them have the minimum stack frame size (kernel,
+ signal, and __sighndlr frames) of 96 bytes, and there is
+ another with a stack frame of 160 bytes (the call_user_handler
+ frame). The ucontext_t structure is after this offset. */
+ regs_off = 96 + 96 + 96 + 160;
+ else
+ /* We need to move up three frames (the kernel frame, the
+ sigacthandler frame, and the __sighndlr frame). Two of them
+ have the minimum stack frame size (kernel and __sighndlr
+ frames) of 96 bytes, and there is another with a stack frame
+ of 216 bytes (the sigacthandler frame). The ucontext_t
+ structure is after this offset. */
+ regs_off = 96 + 96 + 216;
+ }
+
+ /* Exit if the pattern at the return address does not match the
+ previous three patterns. */
+ else
+ return _URC_END_OF_STACK;
+
+ /* FPU information can be extracted from the ucontext_t structure
+ that is the third argument for the signal handler, that is saved
+ in the stack. There are 10 words between the beginning of the
+ ucontext_t argument of the signal handler and the uc_mcontext
+ field. There are 80 bytes between the beginning of uc_mcontext
+ and the beginning of the fpregs field. */
+ fpu_save_off = regs_off + (4*10) + (4*20);
+
+ /* The fpregs field contains 32 words at the beginning that contain
+ the fpu state. Then there are 2 words and two bytes. */
+ fpu_save = *(unsigned char *)(this_cfa + fpu_save_off + (4*32) + (2*4) + 2);
+
+ /* We need to get the frame pointer for the kernel frame that
+ executes when the signal is raised. This frame is just the
+ following to the application code that generated the signal, so
+ that the later's stack pointer is the former's frame pointer.
+ The stack pointer for the interrupted application code can be
+ calculated from the ucontext_t structure (third argument for the
+ signal handler) that is saved in the stack. There are 10 words
+ between the beginning of the ucontext_t argument of the signal
+ handler and the uc_mcontext.gregs field that contains the
+ registers saved by the signal handler. */
+ new_cfa = *(void **)(this_cfa + regs_off + (4*10) + (REG_SP*4));
+ fs->regs.cfa_how = CFA_REG_OFFSET;
+ fs->regs.cfa_reg = __builtin_dwarf_sp_column ();
+ fs->regs.cfa_offset = new_cfa - this_cfa;
+
+ /* Restore global and out registers (in this order) from the
+ ucontext_t structure, uc_mcontext.gregs field. */
+ for (i = 1; i < 16; i++)
+ {
+ /* We never restore %sp as everything is purely CFA-based. */
+ if ((unsigned int) i == __builtin_dwarf_sp_column ())
+ continue;
+
+ /* First the global registers and then the out registers */
+ fs->regs.reg[i].how = REG_SAVED_OFFSET;
+ fs->regs.reg[i].loc.offset
+ = this_cfa + regs_off + (4*10) + ((REG_Y+i)*4) - new_cfa;
+ }
+
+ /* Just above the stack pointer there are 16 words in which the
+ register window (in and local registers) was saved. */
+ for (i = 0; i < 16; i++)
+ {
+ fs->regs.reg[i + 16].how = REG_SAVED_OFFSET;
+ fs->regs.reg[i + 16].loc.offset = i*4;
+ }
+
+ /* Check whether we need to restore fpu registers. */
+ if (fpu_save)
+ {
+ for (i = 0; i < 32; i++)
+ {
+ fs->regs.reg[i + 32].how = REG_SAVED_OFFSET;
+ fs->regs.reg[i + 32].loc.offset
+ = this_cfa + fpu_save_off + (i*4) - new_cfa;
+ }
+ }
+
+ /* State the rules to find the kernel's code "return address", which is
+ the address of the active instruction when the signal was caught.
+ On the SPARC, since RETURN_ADDR_OFFSET (essentially 8) is defined, we
+ need to preventively subtract it from the purported return address. */
+ ra_location = this_cfa + regs_off + (4*10) + (REG_PC*4);
+ shifted_ra_location = this_cfa + regs_off + (4*10) + (REG_Y*4);
+ *(void **)shifted_ra_location = *(void **)ra_location - 8;
+ fs->retaddr_column = 0;
+ fs->regs.reg[0].how = REG_SAVED_OFFSET;
+ fs->regs.reg[0].loc.offset = shifted_ra_location - new_cfa;
+ fs->signal_frame = 1;
+
+ return _URC_NO_REASON;
+};
+
+#endif
diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h
index 139f5b39dff..a3f7647027b 100644
--- a/gcc/config/sparc/sol2.h
+++ b/gcc/config/sparc/sol2.h
@@ -194,3 +194,5 @@ along with GCC; see the file COPYING3. If not see
(SIZE), (ALIGN) / BITS_PER_UNIT); \
} \
while (0)
+
+#define MD_UNWIND_SUPPORT "config/sparc/sol2-unwind.h"
diff --git a/gcc/config/spu/cache.S b/gcc/config/spu/cache.S
new file mode 100644
index 00000000000..9ffb6a0d194
--- /dev/null
+++ b/gcc/config/spu/cache.S
@@ -0,0 +1,43 @@
+/* Copyright (C) 2008, 2009 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/>. */
+
+ .data
+ .p2align 7
+ .global __cache
+__cache:
+ .rept __CACHE_SIZE__ * 8
+ .fill 128
+ .endr
+
+ .p2align 7
+ .global __cache_tag_array
+__cache_tag_array:
+ .rept __CACHE_SIZE__ * 2
+ .long 1, 1, 1, 1
+ .fill 128-16
+ .endr
+__end_cache_tag_array:
+
+ .globl __cache_tag_array_size
+ .set __cache_tag_array_size, __end_cache_tag_array-__cache_tag_array
+
diff --git a/gcc/config/spu/cachemgr.c b/gcc/config/spu/cachemgr.c
new file mode 100644
index 00000000000..e7abd5e62db
--- /dev/null
+++ b/gcc/config/spu/cachemgr.c
@@ -0,0 +1,438 @@
+/* Copyright (C) 2008, 2009 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/>. */
+
+#include <spu_mfcio.h>
+#include <spu_internals.h>
+#include <spu_intrinsics.h>
+#include <spu_cache.h>
+
+extern unsigned long long __ea_local_store;
+extern char __cache_tag_array_size;
+
+#define LINE_SIZE 128
+#define TAG_MASK (LINE_SIZE - 1)
+
+#define WAYS 4
+#define SET_MASK ((int) &__cache_tag_array_size - LINE_SIZE)
+
+#define CACHE_LINES ((int) &__cache_tag_array_size / \
+ sizeof (struct __cache_tag_array) * WAYS)
+
+struct __cache_tag_array
+{
+ unsigned int tag_lo[WAYS];
+ unsigned int tag_hi[WAYS];
+ void *base[WAYS];
+ int reserved[WAYS];
+ vector unsigned short dirty_bits[WAYS];
+};
+
+extern struct __cache_tag_array __cache_tag_array[];
+extern char __cache[];
+
+/* In order to make the code seem a little cleaner, and to avoid having
+ 64/32 bit ifdefs all over the place, we use macros. */
+
+#ifdef __EA64__
+typedef unsigned long long addr;
+
+#define CHECK_TAG(_entry, _way, _tag) \
+ ((_entry)->tag_lo[(_way)] == ((_tag) & 0xFFFFFFFF) \
+ && (_entry)->tag_hi[(_way)] == ((_tag) >> 32))
+
+#define GET_TAG(_entry, _way) \
+ ((unsigned long long)(_entry)->tag_hi[(_way)] << 32 \
+ | (unsigned long long)(_entry)->tag_lo[(_way)])
+
+#define SET_TAG(_entry, _way, _tag) \
+ (_entry)->tag_lo[(_way)] = (_tag) & 0xFFFFFFFF; \
+ (_entry)->tag_hi[(_way)] = (_tag) >> 32
+
+#else /*__EA32__*/
+typedef unsigned long addr;
+
+#define CHECK_TAG(_entry, _way, _tag) \
+ ((_entry)->tag_lo[(_way)] == (_tag))
+
+#define GET_TAG(_entry, _way) \
+ ((_entry)->tag_lo[(_way)])
+
+#define SET_TAG(_entry, _way, _tag) \
+ (_entry)->tag_lo[(_way)] = (_tag)
+
+#endif
+
+/* In GET_ENTRY, we cast away the high 32 bits,
+ as the tag is only in the low 32. */
+
+#define GET_ENTRY(_addr) \
+ ((struct __cache_tag_array *) \
+ si_to_uint (si_a (si_and (si_from_uint ((unsigned int) (addr) (_addr)), \
+ si_from_uint (SET_MASK)), \
+ si_from_uint ((unsigned int) __cache_tag_array))))
+
+#define GET_CACHE_LINE(_addr, _way) \
+ ((void *) (__cache + ((_addr) & SET_MASK) * WAYS) + ((_way) * LINE_SIZE));
+
+#define CHECK_DIRTY(_vec) (si_to_uint (si_orx ((qword) (_vec))))
+#define SET_EMPTY(_entry, _way) ((_entry)->tag_lo[(_way)] = 1)
+#define CHECK_EMPTY(_entry, _way) ((_entry)->tag_lo[(_way)] == 1)
+
+#define LS_FLAG 0x80000000
+#define SET_IS_LS(_entry, _way) ((_entry)->reserved[(_way)] |= LS_FLAG)
+#define CHECK_IS_LS(_entry, _way) ((_entry)->reserved[(_way)] & LS_FLAG)
+#define GET_LRU(_entry, _way) ((_entry)->reserved[(_way)] & ~LS_FLAG)
+
+static int dma_tag = 32;
+
+static void
+__cache_evict_entry (struct __cache_tag_array *entry, int way)
+{
+ addr tag = GET_TAG (entry, way);
+
+ if (CHECK_DIRTY (entry->dirty_bits[way]) && !CHECK_IS_LS (entry, way))
+ {
+#ifdef NONATOMIC
+ /* Non-atomic writes. */
+ unsigned int oldmask, mach_stat;
+ char *line = ((void *) 0);
+
+ /* Enter critical section. */
+ mach_stat = spu_readch (SPU_RdMachStat);
+ spu_idisable ();
+
+ /* Issue DMA request. */
+ line = GET_CACHE_LINE (entry->tag_lo[way], way);
+ mfc_put (line, tag, LINE_SIZE, dma_tag, 0, 0);
+
+ /* Wait for DMA completion. */
+ oldmask = mfc_read_tag_mask ();
+ mfc_write_tag_mask (1 << dma_tag);
+ mfc_read_tag_status_all ();
+ mfc_write_tag_mask (oldmask);
+
+ /* Leave critical section. */
+ if (__builtin_expect (mach_stat & 1, 0))
+ spu_ienable ();
+#else
+ /* Allocate a buffer large enough that we know it has 128 bytes
+ that are 128 byte aligned (for DMA). */
+
+ char buffer[LINE_SIZE + 127];
+ qword *buf_ptr = (qword *) (((unsigned int) (buffer) + 127) & ~127);
+ qword *line = GET_CACHE_LINE (entry->tag_lo[way], way);
+ qword bits;
+ unsigned int mach_stat;
+
+ /* Enter critical section. */
+ mach_stat = spu_readch (SPU_RdMachStat);
+ spu_idisable ();
+
+ do
+ {
+ /* We atomically read the current memory into a buffer
+ modify the dirty bytes in the buffer, and write it
+ back. If writeback fails, loop and try again. */
+
+ mfc_getllar (buf_ptr, tag, 0, 0);
+ mfc_read_atomic_status ();
+
+ /* The method we're using to write 16 dirty bytes into
+ the buffer at a time uses fsmb which in turn uses
+ the least significant 16 bits of word 0, so we
+ load the bits and rotate so that the first bit of
+ the bitmap is in the first bit that fsmb will use. */
+
+ bits = (qword) entry->dirty_bits[way];
+ bits = si_rotqbyi (bits, -2);
+
+ /* Si_fsmb creates the mask of dirty bytes.
+ Use selb to nab the appropriate bits. */
+ buf_ptr[0] = si_selb (buf_ptr[0], line[0], si_fsmb (bits));
+
+ /* Rotate to next 16 byte section of cache. */
+ bits = si_rotqbyi (bits, 2);
+
+ buf_ptr[1] = si_selb (buf_ptr[1], line[1], si_fsmb (bits));
+ bits = si_rotqbyi (bits, 2);
+ buf_ptr[2] = si_selb (buf_ptr[2], line[2], si_fsmb (bits));
+ bits = si_rotqbyi (bits, 2);
+ buf_ptr[3] = si_selb (buf_ptr[3], line[3], si_fsmb (bits));
+ bits = si_rotqbyi (bits, 2);
+ buf_ptr[4] = si_selb (buf_ptr[4], line[4], si_fsmb (bits));
+ bits = si_rotqbyi (bits, 2);
+ buf_ptr[5] = si_selb (buf_ptr[5], line[5], si_fsmb (bits));
+ bits = si_rotqbyi (bits, 2);
+ buf_ptr[6] = si_selb (buf_ptr[6], line[6], si_fsmb (bits));
+ bits = si_rotqbyi (bits, 2);
+ buf_ptr[7] = si_selb (buf_ptr[7], line[7], si_fsmb (bits));
+ bits = si_rotqbyi (bits, 2);
+
+ mfc_putllc (buf_ptr, tag, 0, 0);
+ }
+ while (mfc_read_atomic_status ());
+
+ /* Leave critical section. */
+ if (__builtin_expect (mach_stat & 1, 0))
+ spu_ienable ();
+#endif
+ }
+
+ /* In any case, marking the lo tag with 1 which denotes empty. */
+ SET_EMPTY (entry, way);
+ entry->dirty_bits[way] = (vector unsigned short) si_from_uint (0);
+}
+
+void
+__cache_evict (__ea void *ea)
+{
+ addr tag = (addr) ea & ~TAG_MASK;
+ struct __cache_tag_array *entry = GET_ENTRY (ea);
+ int i = 0;
+
+ /* Cycles through all the possible ways an address could be at
+ and evicts the way if found. */
+
+ for (i = 0; i < WAYS; i++)
+ if (CHECK_TAG (entry, i, tag))
+ __cache_evict_entry (entry, i);
+}
+
+static void *
+__cache_fill (int way, addr tag)
+{
+ unsigned int oldmask, mach_stat;
+ char *line = ((void *) 0);
+
+ /* Reserve our DMA tag. */
+ if (dma_tag == 32)
+ dma_tag = mfc_tag_reserve ();
+
+ /* Enter critical section. */
+ mach_stat = spu_readch (SPU_RdMachStat);
+ spu_idisable ();
+
+ /* Issue DMA request. */
+ line = GET_CACHE_LINE (tag, way);
+ mfc_get (line, tag, LINE_SIZE, dma_tag, 0, 0);
+
+ /* Wait for DMA completion. */
+ oldmask = mfc_read_tag_mask ();
+ mfc_write_tag_mask (1 << dma_tag);
+ mfc_read_tag_status_all ();
+ mfc_write_tag_mask (oldmask);
+
+ /* Leave critical section. */
+ if (__builtin_expect (mach_stat & 1, 0))
+ spu_ienable ();
+
+ return (void *) line;
+}
+
+static void
+__cache_miss (__ea void *ea, struct __cache_tag_array *entry, int way)
+{
+
+ addr tag = (addr) ea & ~TAG_MASK;
+ unsigned int lru = 0;
+ int i = 0;
+ int idx = 0;
+
+ /* If way > 4, then there are no empty slots, so we must evict
+ the least recently used entry. */
+ if (way >= 4)
+ {
+ for (i = 0; i < WAYS; i++)
+ {
+ if (GET_LRU (entry, i) > lru)
+ {
+ lru = GET_LRU (entry, i);
+ idx = i;
+ }
+ }
+ __cache_evict_entry (entry, idx);
+ way = idx;
+ }
+
+ /* Set the empty entry's tag and fill it's cache line. */
+
+ SET_TAG (entry, way, tag);
+ entry->reserved[way] = 0;
+
+ /* Check if the address is just an effective address within the
+ SPU's local store. */
+
+ /* Because the LS is not 256k aligned, we can't do a nice and mask
+ here to compare, so we must check the whole range. */
+
+ if ((addr) ea >= (addr) __ea_local_store
+ && (addr) ea < (addr) (__ea_local_store + 0x40000))
+ {
+ SET_IS_LS (entry, way);
+ entry->base[way] =
+ (void *) ((unsigned int) ((addr) ea -
+ (addr) __ea_local_store) & ~0x7f);
+ }
+ else
+ {
+ entry->base[way] = __cache_fill (way, tag);
+ }
+}
+
+void *
+__cache_fetch_dirty (__ea void *ea, int n_bytes_dirty)
+{
+#ifdef __EA64__
+ unsigned int tag_hi;
+ qword etag_hi;
+#endif
+ unsigned int tag_lo;
+ struct __cache_tag_array *entry;
+
+ qword etag_lo;
+ qword equal;
+ qword bit_mask;
+ qword way;
+
+ /* This first chunk, we merely fill the pointer and tag. */
+
+ entry = GET_ENTRY (ea);
+
+#ifndef __EA64__
+ tag_lo =
+ si_to_uint (si_andc
+ (si_shufb
+ (si_from_uint ((addr) ea), si_from_uint (0),
+ si_from_uint (0x00010203)), si_from_uint (TAG_MASK)));
+#else
+ tag_lo =
+ si_to_uint (si_andc
+ (si_shufb
+ (si_from_ullong ((addr) ea), si_from_uint (0),
+ si_from_uint (0x04050607)), si_from_uint (TAG_MASK)));
+
+ tag_hi =
+ si_to_uint (si_shufb
+ (si_from_ullong ((addr) ea), si_from_uint (0),
+ si_from_uint (0x00010203)));
+#endif
+
+ /* Increment LRU in reserved bytes. */
+ si_stqd (si_ai (si_lqd (si_from_ptr (entry), 48), 1),
+ si_from_ptr (entry), 48);
+
+missreturn:
+ /* Check if the entry's lo_tag is equal to the address' lo_tag. */
+ etag_lo = si_lqd (si_from_ptr (entry), 0);
+ equal = si_ceq (etag_lo, si_from_uint (tag_lo));
+#ifdef __EA64__
+ /* And the high tag too. */
+ etag_hi = si_lqd (si_from_ptr (entry), 16);
+ equal = si_and (equal, (si_ceq (etag_hi, si_from_uint (tag_hi))));
+#endif
+
+ if ((si_to_uint (si_orx (equal)) == 0))
+ goto misshandler;
+
+ if (n_bytes_dirty)
+ {
+ /* way = 0x40,0x50,0x60,0x70 for each way, which is also the
+ offset of the appropriate dirty bits. */
+ way = si_shli (si_clz (si_gbb (equal)), 2);
+
+ /* To create the bit_mask, we set it to all 1s (uint -1), then we
+ shift it over (128 - n_bytes_dirty) times. */
+
+ bit_mask = si_from_uint (-1);
+
+ bit_mask =
+ si_shlqby (bit_mask, si_from_uint ((LINE_SIZE - n_bytes_dirty) / 8));
+
+ bit_mask =
+ si_shlqbi (bit_mask, si_from_uint ((LINE_SIZE - n_bytes_dirty) % 8));
+
+ /* Rotate it around to the correct offset. */
+ bit_mask =
+ si_rotqby (bit_mask,
+ si_from_uint (-1 * ((addr) ea & TAG_MASK) / 8));
+
+ bit_mask =
+ si_rotqbi (bit_mask,
+ si_from_uint (-1 * ((addr) ea & TAG_MASK) % 8));
+
+ /* Update the dirty bits. */
+ si_stqx (si_or (si_lqx (si_from_ptr (entry), way), bit_mask),
+ si_from_ptr (entry), way);
+ };
+
+ /* We've definitely found the right entry, set LRU (reserved) to 0
+ maintaining the LS flag (MSB). */
+
+ si_stqd (si_andc
+ (si_lqd (si_from_ptr (entry), 48),
+ si_and (equal, si_from_uint (~(LS_FLAG)))),
+ si_from_ptr (entry), 48);
+
+ return (void *)
+ si_to_uint (si_a
+ (si_orx
+ (si_and (si_lqd (si_from_ptr (entry), 32), equal)),
+ si_from_uint (((unsigned int) (addr) ea) & TAG_MASK)));
+
+misshandler:
+ equal = si_ceqi (etag_lo, 1);
+ __cache_miss (ea, entry, (si_to_uint (si_clz (si_gbb (equal))) - 16) >> 2);
+ goto missreturn;
+}
+
+void *
+__cache_fetch (__ea void *ea)
+{
+ return __cache_fetch_dirty (ea, 0);
+}
+
+void
+__cache_touch (__ea void *ea __attribute__ ((unused)))
+{
+ /* NO-OP for now. */
+}
+
+void __cache_flush (void) __attribute__ ((destructor));
+void
+__cache_flush (void)
+{
+ struct __cache_tag_array *entry = __cache_tag_array;
+ unsigned int i;
+ int j;
+
+ /* Cycle through each cache entry and evict all used ways. */
+
+ for (i = 0; i < CACHE_LINES / WAYS; i++)
+ {
+ for (j = 0; j < WAYS; j++)
+ if (!CHECK_EMPTY (entry, j))
+ __cache_evict_entry (entry, j);
+
+ entry++;
+ }
+}
diff --git a/gcc/config/spu/spu-c.c b/gcc/config/spu/spu-c.c
index fbbbf32e157..380af402c48 100644
--- a/gcc/config/spu/spu-c.c
+++ b/gcc/config/spu/spu-c.c
@@ -201,6 +201,17 @@ spu_cpu_cpp_builtins (struct cpp_reader *pfile)
if (spu_arch == PROCESSOR_CELLEDP)
builtin_define_std ("__SPU_EDP__");
builtin_define_std ("__vector=__attribute__((__spu_vector__))");
+ switch (spu_ea_model)
+ {
+ case 32:
+ builtin_define_std ("__EA32__");
+ break;
+ case 64:
+ builtin_define_std ("__EA64__");
+ break;
+ default:
+ gcc_unreachable ();
+ }
if (!flag_iso)
{
diff --git a/gcc/config/spu/spu-elf.h b/gcc/config/spu/spu-elf.h
index 532313119cb..68982002103 100644
--- a/gcc/config/spu/spu-elf.h
+++ b/gcc/config/spu/spu-elf.h
@@ -68,8 +68,14 @@
#define LINK_SPEC "%{mlarge-mem: --defsym __stack=0xfffffff0 }"
-#define LIB_SPEC \
- "-( %{!shared:%{g*:-lg}} -lc -lgloss -)"
+#define LIB_SPEC "-( %{!shared:%{g*:-lg}} -lc -lgloss -) \
+ %{mno-atomic-updates:-lgcc_cachemgr_nonatomic; :-lgcc_cachemgr} \
+ %{mcache-size=128:-lgcc_cache128k; \
+ mcache-size=64 :-lgcc_cache64k; \
+ mcache-size=32 :-lgcc_cache32k; \
+ mcache-size=16 :-lgcc_cache16k; \
+ mcache-size=8 :-lgcc_cache8k; \
+ :-lgcc_cache64k}"
/* Turn off warnings in the assembler too. */
#undef ASM_SPEC
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index 316cc73d777..2888da67281 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -150,9 +150,12 @@ char regs_ever_allocated[FIRST_PSEUDO_REGISTER];
/* Prototypes and external defs. */
static void spu_init_builtins (void);
+static tree spu_builtin_decl (unsigned, bool);
static unsigned char spu_scalar_mode_supported_p (enum machine_mode mode);
static unsigned char spu_vector_mode_supported_p (enum machine_mode mode);
static bool spu_legitimate_address_p (enum machine_mode, rtx, bool);
+static bool spu_addr_space_legitimate_address_p (enum machine_mode, rtx,
+ bool, addr_space_t);
static rtx adjust_operand (rtx op, HOST_WIDE_INT * start);
static rtx get_pic_reg (void);
static int need_to_save_reg (int regno, int saving);
@@ -202,15 +205,23 @@ static bool spu_return_in_memory (const_tree type, const_tree fntype);
static void fix_range (const char *);
static void spu_encode_section_info (tree, rtx, int);
static rtx spu_legitimize_address (rtx, rtx, enum machine_mode);
+static rtx spu_addr_space_legitimize_address (rtx, rtx, enum machine_mode,
+ addr_space_t);
static tree spu_builtin_mul_widen_even (tree);
static tree spu_builtin_mul_widen_odd (tree);
static tree spu_builtin_mask_for_load (void);
static int spu_builtin_vectorization_cost (bool);
static bool spu_vector_alignment_reachable (const_tree, bool);
static tree spu_builtin_vec_perm (tree, tree *);
+static enum machine_mode spu_addr_space_pointer_mode (addr_space_t);
+static enum machine_mode spu_addr_space_address_mode (addr_space_t);
+static bool spu_addr_space_subset_p (addr_space_t, addr_space_t);
+static rtx spu_addr_space_convert (rtx, tree, tree);
static int spu_sms_res_mii (struct ddg *g);
static void asm_file_start (void);
static unsigned int spu_section_type_flags (tree, const char *, int);
+static section *spu_select_section (tree, int, unsigned HOST_WIDE_INT);
+static void spu_unique_section (tree, int);
static rtx spu_expand_load (rtx, rtx, rtx, int);
static void spu_trampoline_init (rtx, tree, rtx);
@@ -269,6 +280,10 @@ spu_libgcc_cmp_return_mode (void);
static enum machine_mode
spu_libgcc_shift_count_mode (void);
+
+/* Pointer mode for __ea references. */
+#define EAmode (spu_ea_model != 32 ? DImode : SImode)
+
/* Table of machine attributes. */
static const struct attribute_spec spu_attribute_table[] =
@@ -281,8 +296,29 @@ static const struct attribute_spec spu_attribute_table[] =
/* TARGET overrides. */
+#undef TARGET_ADDR_SPACE_POINTER_MODE
+#define TARGET_ADDR_SPACE_POINTER_MODE spu_addr_space_pointer_mode
+
+#undef TARGET_ADDR_SPACE_ADDRESS_MODE
+#define TARGET_ADDR_SPACE_ADDRESS_MODE spu_addr_space_address_mode
+
+#undef TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P
+#define TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P \
+ spu_addr_space_legitimate_address_p
+
+#undef TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS
+#define TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS spu_addr_space_legitimize_address
+
+#undef TARGET_ADDR_SPACE_SUBSET_P
+#define TARGET_ADDR_SPACE_SUBSET_P spu_addr_space_subset_p
+
+#undef TARGET_ADDR_SPACE_CONVERT
+#define TARGET_ADDR_SPACE_CONVERT spu_addr_space_convert
+
#undef TARGET_INIT_BUILTINS
#define TARGET_INIT_BUILTINS spu_init_builtins
+#undef TARGET_BUILTIN_DECL
+#define TARGET_BUILTIN_DECL spu_builtin_decl
#undef TARGET_EXPAND_BUILTIN
#define TARGET_EXPAND_BUILTIN spu_expand_builtin
@@ -293,6 +329,15 @@ static const struct attribute_spec spu_attribute_table[] =
#undef TARGET_LEGITIMIZE_ADDRESS
#define TARGET_LEGITIMIZE_ADDRESS spu_legitimize_address
+/* The current assembler doesn't like .4byte foo@ppu, so use the normal .long
+ and .quad for the debugger. When it is known that the assembler is fixed,
+ these can be removed. */
+#undef TARGET_ASM_UNALIGNED_SI_OP
+#define TARGET_ASM_UNALIGNED_SI_OP "\t.long\t"
+
+#undef TARGET_ASM_ALIGNED_DI_OP
+#define TARGET_ASM_ALIGNED_DI_OP "\t.quad\t"
+
/* The .8byte directive doesn't seem to work well for a 32 bit
architecture. */
#undef TARGET_ASM_UNALIGNED_DI_OP
@@ -409,6 +454,12 @@ static const struct attribute_spec spu_attribute_table[] =
#undef TARGET_SECTION_TYPE_FLAGS
#define TARGET_SECTION_TYPE_FLAGS spu_section_type_flags
+#undef TARGET_ASM_SELECT_SECTION
+#define TARGET_ASM_SELECT_SECTION spu_select_section
+
+#undef TARGET_ASM_UNIQUE_SECTION
+#define TARGET_ASM_UNIQUE_SECTION spu_unique_section
+
#undef TARGET_LEGITIMATE_ADDRESS_P
#define TARGET_LEGITIMATE_ADDRESS_P spu_legitimate_address_p
@@ -2365,7 +2416,7 @@ get_branch_target (rtx branch)
return 0;
/* ASM GOTOs. */
- if (GET_CODE (PATTERN (branch)) == ASM_OPERANDS)
+ if (extract_asm_operands (PATTERN (branch)) != NULL)
return NULL;
set = single_set (branch);
@@ -3610,6 +3661,29 @@ exp2_immediate_p (rtx op, enum machine_mode mode, int low, int high)
return FALSE;
}
+/* Return true if X is a SYMBOL_REF to an __ea qualified variable. */
+
+static int
+ea_symbol_ref (rtx *px, void *data ATTRIBUTE_UNUSED)
+{
+ rtx x = *px;
+ tree decl;
+
+ if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == PLUS)
+ {
+ rtx plus = XEXP (x, 0);
+ rtx op0 = XEXP (plus, 0);
+ rtx op1 = XEXP (plus, 1);
+ if (GET_CODE (op1) == CONST_INT)
+ x = op0;
+ }
+
+ return (GET_CODE (x) == SYMBOL_REF
+ && (decl = SYMBOL_REF_DECL (x)) != 0
+ && TREE_CODE (decl) == VAR_DECL
+ && TYPE_ADDR_SPACE (TREE_TYPE (decl)));
+}
+
/* We accept:
- any 32-bit constant (SImode, SFmode)
- any constant that can be generated with fsmbi (any mode)
@@ -3621,6 +3695,12 @@ spu_legitimate_constant_p (rtx x)
{
if (GET_CODE (x) == HIGH)
x = XEXP (x, 0);
+
+ /* Reject any __ea qualified reference. These can't appear in
+ instructions but must be forced to the constant pool. */
+ if (for_each_rtx (&x, ea_symbol_ref, 0))
+ return 0;
+
/* V4SI with all identical symbols is valid. */
if (!flag_pic
&& GET_MODE (x) == V4SImode
@@ -3659,8 +3739,14 @@ spu_legitimate_address_p (enum machine_mode mode,
switch (GET_CODE (x))
{
case LABEL_REF:
+ return !TARGET_LARGE_MEM;
+
case SYMBOL_REF:
case CONST:
+ /* Keep __ea references until reload so that spu_expand_mov can see them
+ in MEMs. */
+ if (ea_symbol_ref (&x, 0))
+ return !reload_in_progress && !reload_completed;
return !TARGET_LARGE_MEM;
case CONST_INT:
@@ -3704,6 +3790,20 @@ spu_legitimate_address_p (enum machine_mode mode,
return FALSE;
}
+/* Like spu_legitimate_address_p, except with named addresses. */
+static bool
+spu_addr_space_legitimate_address_p (enum machine_mode mode, rtx x,
+ bool reg_ok_strict, addr_space_t as)
+{
+ if (as == ADDR_SPACE_EA)
+ return (REG_P (x) && (GET_MODE (x) == EAmode));
+
+ else if (as != ADDR_SPACE_GENERIC)
+ gcc_unreachable ();
+
+ return spu_legitimate_address_p (mode, x, reg_ok_strict);
+}
+
/* When the address is reg + const_int, force the const_int into a
register. */
rtx
@@ -3735,6 +3835,17 @@ spu_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
return x;
}
+/* Like spu_legitimate_address, except with named address support. */
+static rtx
+spu_addr_space_legitimize_address (rtx x, rtx oldx, enum machine_mode mode,
+ addr_space_t as)
+{
+ if (as != ADDR_SPACE_GENERIC)
+ return x;
+
+ return spu_legitimize_address (x, oldx, mode);
+}
+
/* Handle an attribute requiring a FUNCTION_DECL; arguments as in
struct attribute_spec.handler. */
static tree
@@ -4238,6 +4349,233 @@ address_needs_split (rtx mem)
return 0;
}
+static GTY(()) rtx cache_fetch; /* __cache_fetch function */
+static GTY(()) rtx cache_fetch_dirty; /* __cache_fetch_dirty function */
+static alias_set_type ea_alias_set = -1; /* alias set for __ea memory */
+
+/* MEM is known to be an __ea qualified memory access. Emit a call to
+ fetch the ppu memory to local store, and return its address in local
+ store. */
+
+static void
+ea_load_store (rtx mem, bool is_store, rtx ea_addr, rtx data_addr)
+{
+ if (is_store)
+ {
+ rtx ndirty = GEN_INT (GET_MODE_SIZE (GET_MODE (mem)));
+ if (!cache_fetch_dirty)
+ cache_fetch_dirty = init_one_libfunc ("__cache_fetch_dirty");
+ emit_library_call_value (cache_fetch_dirty, data_addr, LCT_NORMAL, Pmode,
+ 2, ea_addr, EAmode, ndirty, SImode);
+ }
+ else
+ {
+ if (!cache_fetch)
+ cache_fetch = init_one_libfunc ("__cache_fetch");
+ emit_library_call_value (cache_fetch, data_addr, LCT_NORMAL, Pmode,
+ 1, ea_addr, EAmode);
+ }
+}
+
+/* Like ea_load_store, but do the cache tag comparison and, for stores,
+ dirty bit marking, inline.
+
+ The cache control data structure is an array of
+
+ struct __cache_tag_array
+ {
+ unsigned int tag_lo[4];
+ unsigned int tag_hi[4];
+ void *data_pointer[4];
+ int reserved[4];
+ vector unsigned short dirty_bits[4];
+ } */
+
+static void
+ea_load_store_inline (rtx mem, bool is_store, rtx ea_addr, rtx data_addr)
+{
+ rtx ea_addr_si;
+ HOST_WIDE_INT v;
+ rtx tag_size_sym = gen_rtx_SYMBOL_REF (Pmode, "__cache_tag_array_size");
+ rtx tag_arr_sym = gen_rtx_SYMBOL_REF (Pmode, "__cache_tag_array");
+ rtx index_mask = gen_reg_rtx (SImode);
+ rtx tag_arr = gen_reg_rtx (Pmode);
+ rtx splat_mask = gen_reg_rtx (TImode);
+ rtx splat = gen_reg_rtx (V4SImode);
+ rtx splat_hi = NULL_RTX;
+ rtx tag_index = gen_reg_rtx (Pmode);
+ rtx block_off = gen_reg_rtx (SImode);
+ rtx tag_addr = gen_reg_rtx (Pmode);
+ rtx tag = gen_reg_rtx (V4SImode);
+ rtx cache_tag = gen_reg_rtx (V4SImode);
+ rtx cache_tag_hi = NULL_RTX;
+ rtx cache_ptrs = gen_reg_rtx (TImode);
+ rtx cache_ptrs_si = gen_reg_rtx (SImode);
+ rtx tag_equal = gen_reg_rtx (V4SImode);
+ rtx tag_equal_hi = NULL_RTX;
+ rtx tag_eq_pack = gen_reg_rtx (V4SImode);
+ rtx tag_eq_pack_si = gen_reg_rtx (SImode);
+ rtx eq_index = gen_reg_rtx (SImode);
+ rtx bcomp, hit_label, hit_ref, cont_label, insn;
+
+ if (spu_ea_model != 32)
+ {
+ splat_hi = gen_reg_rtx (V4SImode);
+ cache_tag_hi = gen_reg_rtx (V4SImode);
+ tag_equal_hi = gen_reg_rtx (V4SImode);
+ }
+
+ emit_move_insn (index_mask, plus_constant (tag_size_sym, -128));
+ emit_move_insn (tag_arr, tag_arr_sym);
+ v = 0x0001020300010203LL;
+ emit_move_insn (splat_mask, immed_double_const (v, v, TImode));
+ ea_addr_si = ea_addr;
+ if (spu_ea_model != 32)
+ ea_addr_si = convert_to_mode (SImode, ea_addr, 1);
+
+ /* tag_index = ea_addr & (tag_array_size - 128) */
+ emit_insn (gen_andsi3 (tag_index, ea_addr_si, index_mask));
+
+ /* splat ea_addr to all 4 slots. */
+ emit_insn (gen_shufb (splat, ea_addr_si, ea_addr_si, splat_mask));
+ /* Similarly for high 32 bits of ea_addr. */
+ if (spu_ea_model != 32)
+ emit_insn (gen_shufb (splat_hi, ea_addr, ea_addr, splat_mask));
+
+ /* block_off = ea_addr & 127 */
+ emit_insn (gen_andsi3 (block_off, ea_addr_si, spu_const (SImode, 127)));
+
+ /* tag_addr = tag_arr + tag_index */
+ emit_insn (gen_addsi3 (tag_addr, tag_arr, tag_index));
+
+ /* Read cache tags. */
+ emit_move_insn (cache_tag, gen_rtx_MEM (V4SImode, tag_addr));
+ if (spu_ea_model != 32)
+ emit_move_insn (cache_tag_hi, gen_rtx_MEM (V4SImode,
+ plus_constant (tag_addr, 16)));
+
+ /* tag = ea_addr & -128 */
+ emit_insn (gen_andv4si3 (tag, splat, spu_const (V4SImode, -128)));
+
+ /* Read all four cache data pointers. */
+ emit_move_insn (cache_ptrs, gen_rtx_MEM (TImode,
+ plus_constant (tag_addr, 32)));
+
+ /* Compare tags. */
+ emit_insn (gen_ceq_v4si (tag_equal, tag, cache_tag));
+ if (spu_ea_model != 32)
+ {
+ emit_insn (gen_ceq_v4si (tag_equal_hi, splat_hi, cache_tag_hi));
+ emit_insn (gen_andv4si3 (tag_equal, tag_equal, tag_equal_hi));
+ }
+
+ /* At most one of the tags compare equal, so tag_equal has one
+ 32-bit slot set to all 1's, with the other slots all zero.
+ gbb picks off low bit from each byte in the 128-bit registers,
+ so tag_eq_pack is one of 0xf000, 0x0f00, 0x00f0, 0x000f, assuming
+ we have a hit. */
+ emit_insn (gen_spu_gbb (tag_eq_pack, spu_gen_subreg (V16QImode, tag_equal)));
+ emit_insn (gen_spu_convert (tag_eq_pack_si, tag_eq_pack));
+
+ /* So counting leading zeros will set eq_index to 16, 20, 24 or 28. */
+ emit_insn (gen_clzsi2 (eq_index, tag_eq_pack_si));
+
+ /* Allowing us to rotate the corresponding cache data pointer to slot0.
+ (rotating eq_index mod 16 bytes). */
+ emit_insn (gen_rotqby_ti (cache_ptrs, cache_ptrs, eq_index));
+ emit_insn (gen_spu_convert (cache_ptrs_si, cache_ptrs));
+
+ /* Add block offset to form final data address. */
+ emit_insn (gen_addsi3 (data_addr, cache_ptrs_si, block_off));
+
+ /* Check that we did hit. */
+ hit_label = gen_label_rtx ();
+ hit_ref = gen_rtx_LABEL_REF (VOIDmode, hit_label);
+ bcomp = gen_rtx_NE (SImode, tag_eq_pack_si, const0_rtx);
+ insn = emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx,
+ gen_rtx_IF_THEN_ELSE (VOIDmode, bcomp,
+ hit_ref, pc_rtx)));
+ /* Say that this branch is very likely to happen. */
+ v = REG_BR_PROB_BASE - REG_BR_PROB_BASE / 100 - 1;
+ REG_NOTES (insn)
+ = gen_rtx_EXPR_LIST (REG_BR_PROB, GEN_INT (v), REG_NOTES (insn));
+
+ ea_load_store (mem, is_store, ea_addr, data_addr);
+ cont_label = gen_label_rtx ();
+ emit_jump_insn (gen_jump (cont_label));
+ emit_barrier ();
+
+ emit_label (hit_label);
+
+ if (is_store)
+ {
+ HOST_WIDE_INT v_hi;
+ rtx dirty_bits = gen_reg_rtx (TImode);
+ rtx dirty_off = gen_reg_rtx (SImode);
+ rtx dirty_128 = gen_reg_rtx (TImode);
+ rtx neg_block_off = gen_reg_rtx (SImode);
+
+ /* Set up mask with one dirty bit per byte of the mem we are
+ writing, starting from top bit. */
+ v_hi = v = -1;
+ v <<= (128 - GET_MODE_SIZE (GET_MODE (mem))) & 63;
+ if ((128 - GET_MODE_SIZE (GET_MODE (mem))) >= 64)
+ {
+ v_hi = v;
+ v = 0;
+ }
+ emit_move_insn (dirty_bits, immed_double_const (v, v_hi, TImode));
+
+ /* Form index into cache dirty_bits. eq_index is one of
+ 0x10, 0x14, 0x18 or 0x1c. Multiplying by 4 gives us
+ 0x40, 0x50, 0x60 or 0x70 which just happens to be the
+ offset to each of the four dirty_bits elements. */
+ emit_insn (gen_ashlsi3 (dirty_off, eq_index, spu_const (SImode, 2)));
+
+ emit_insn (gen_spu_lqx (dirty_128, tag_addr, dirty_off));
+
+ /* Rotate bit mask to proper bit. */
+ emit_insn (gen_negsi2 (neg_block_off, block_off));
+ emit_insn (gen_rotqbybi_ti (dirty_bits, dirty_bits, neg_block_off));
+ emit_insn (gen_rotqbi_ti (dirty_bits, dirty_bits, neg_block_off));
+
+ /* Or in the new dirty bits. */
+ emit_insn (gen_iorti3 (dirty_128, dirty_bits, dirty_128));
+
+ /* Store. */
+ emit_insn (gen_spu_stqx (dirty_128, tag_addr, dirty_off));
+ }
+
+ emit_label (cont_label);
+}
+
+static rtx
+expand_ea_mem (rtx mem, bool is_store)
+{
+ rtx ea_addr;
+ rtx data_addr = gen_reg_rtx (Pmode);
+ rtx new_mem;
+
+ ea_addr = force_reg (EAmode, XEXP (mem, 0));
+ if (optimize_size || optimize == 0)
+ ea_load_store (mem, is_store, ea_addr, data_addr);
+ else
+ ea_load_store_inline (mem, is_store, ea_addr, data_addr);
+
+ if (ea_alias_set == -1)
+ ea_alias_set = new_alias_set ();
+
+ /* We generate a new MEM RTX to refer to the copy of the data
+ in the cache. We do not copy memory attributes (except the
+ alignment) from the original MEM, as they may no longer apply
+ to the cache copy. */
+ new_mem = gen_rtx_MEM (GET_MODE (mem), data_addr);
+ set_mem_alias_set (new_mem, ea_alias_set);
+ set_mem_align (new_mem, MIN (MEM_ALIGN (mem), 128 * 8));
+
+ return new_mem;
+}
+
int
spu_expand_mov (rtx * ops, enum machine_mode mode)
{
@@ -4295,9 +4633,17 @@ spu_expand_mov (rtx * ops, enum machine_mode mode)
}
}
if (MEM_P (ops[0]))
- return spu_split_store (ops);
+ {
+ if (MEM_ADDR_SPACE (ops[0]))
+ ops[0] = expand_ea_mem (ops[0], true);
+ return spu_split_store (ops);
+ }
if (MEM_P (ops[1]))
- return spu_split_load (ops);
+ {
+ if (MEM_ADDR_SPACE (ops[1]))
+ ops[1] = expand_ea_mem (ops[1], false);
+ return spu_split_load (ops);
+ }
return 0;
}
@@ -5285,6 +5631,18 @@ struct spu_builtin_description spu_builtins[] = {
#undef DEF_BUILTIN
};
+/* Returns the rs6000 builtin decl for CODE. */
+
+static tree
+spu_builtin_decl (unsigned code, bool initialize_p ATTRIBUTE_UNUSED)
+{
+ if (code >= NUM_SPU_BUILTINS)
+ return error_mark_node;
+
+ return spu_builtins[code].fndecl;
+}
+
+
static void
spu_init_builtins (void)
{
@@ -6427,6 +6785,113 @@ spu_builtin_vec_perm (tree type, tree *mask_element_type)
return d->fndecl;
}
+/* Return the appropriate mode for a named address pointer. */
+static enum machine_mode
+spu_addr_space_pointer_mode (addr_space_t addrspace)
+{
+ switch (addrspace)
+ {
+ case ADDR_SPACE_GENERIC:
+ return ptr_mode;
+ case ADDR_SPACE_EA:
+ return EAmode;
+ default:
+ gcc_unreachable ();
+ }
+}
+
+/* Return the appropriate mode for a named address address. */
+static enum machine_mode
+spu_addr_space_address_mode (addr_space_t addrspace)
+{
+ switch (addrspace)
+ {
+ case ADDR_SPACE_GENERIC:
+ return Pmode;
+ case ADDR_SPACE_EA:
+ return EAmode;
+ default:
+ gcc_unreachable ();
+ }
+}
+
+/* Determine if one named address space is a subset of another. */
+
+static bool
+spu_addr_space_subset_p (addr_space_t subset, addr_space_t superset)
+{
+ gcc_assert (subset == ADDR_SPACE_GENERIC || subset == ADDR_SPACE_EA);
+ gcc_assert (superset == ADDR_SPACE_GENERIC || superset == ADDR_SPACE_EA);
+
+ if (subset == superset)
+ return true;
+
+ /* If we have -mno-address-space-conversion, treat __ea and generic as not
+ being subsets but instead as disjoint address spaces. */
+ else if (!TARGET_ADDRESS_SPACE_CONVERSION)
+ return false;
+
+ else
+ return (subset == ADDR_SPACE_GENERIC && superset == ADDR_SPACE_EA);
+}
+
+/* Convert from one address space to another. */
+static rtx
+spu_addr_space_convert (rtx op, tree from_type, tree to_type)
+{
+ addr_space_t from_as = TYPE_ADDR_SPACE (TREE_TYPE (from_type));
+ addr_space_t to_as = TYPE_ADDR_SPACE (TREE_TYPE (to_type));
+
+ gcc_assert (from_as == ADDR_SPACE_GENERIC || from_as == ADDR_SPACE_EA);
+ gcc_assert (to_as == ADDR_SPACE_GENERIC || to_as == ADDR_SPACE_EA);
+
+ if (to_as == ADDR_SPACE_GENERIC && from_as == ADDR_SPACE_EA)
+ {
+ rtx result, ls;
+
+ ls = gen_const_mem (DImode,
+ gen_rtx_SYMBOL_REF (Pmode, "__ea_local_store"));
+ set_mem_align (ls, 128);
+
+ result = gen_reg_rtx (Pmode);
+ ls = force_reg (Pmode, convert_modes (Pmode, DImode, ls, 1));
+ op = force_reg (Pmode, convert_modes (Pmode, EAmode, op, 1));
+ ls = emit_conditional_move (ls, NE, op, const0_rtx, Pmode,
+ ls, const0_rtx, Pmode, 1);
+
+ emit_insn (gen_subsi3 (result, op, ls));
+
+ return result;
+ }
+
+ else if (to_as == ADDR_SPACE_EA && from_as == ADDR_SPACE_GENERIC)
+ {
+ rtx result, ls;
+
+ ls = gen_const_mem (DImode,
+ gen_rtx_SYMBOL_REF (Pmode, "__ea_local_store"));
+ set_mem_align (ls, 128);
+
+ result = gen_reg_rtx (EAmode);
+ ls = force_reg (EAmode, convert_modes (EAmode, DImode, ls, 1));
+ op = force_reg (Pmode, op);
+ ls = emit_conditional_move (ls, NE, op, const0_rtx, Pmode,
+ ls, const0_rtx, EAmode, 1);
+ op = force_reg (EAmode, convert_modes (EAmode, Pmode, op, 1));
+
+ if (EAmode == SImode)
+ emit_insn (gen_addsi3 (result, op, ls));
+ else
+ emit_insn (gen_adddi3 (result, op, ls));
+
+ return result;
+ }
+
+ else
+ gcc_unreachable ();
+}
+
+
/* Count the total number of instructions in each pipe and return the
maximum, which is used as the Minimum Iteration Interval (MII)
in the modulo scheduler. get_pipe() will return -2, -1, 0, or 1.
@@ -6519,9 +6984,46 @@ spu_section_type_flags (tree decl, const char *name, int reloc)
/* .toe needs to have type @nobits. */
if (strcmp (name, ".toe") == 0)
return SECTION_BSS;
+ /* Don't load _ea into the current address space. */
+ if (strcmp (name, "._ea") == 0)
+ return SECTION_WRITE | SECTION_DEBUG;
return default_section_type_flags (decl, name, reloc);
}
+/* Implement targetm.select_section. */
+static section *
+spu_select_section (tree decl, int reloc, unsigned HOST_WIDE_INT align)
+{
+ /* Variables and constants defined in the __ea address space
+ go into a special section named "._ea". */
+ if (TREE_TYPE (decl) != error_mark_node
+ && TYPE_ADDR_SPACE (TREE_TYPE (decl)) == ADDR_SPACE_EA)
+ {
+ /* We might get called with string constants, but get_named_section
+ doesn't like them as they are not DECLs. Also, we need to set
+ flags in that case. */
+ if (!DECL_P (decl))
+ return get_section ("._ea", SECTION_WRITE | SECTION_DEBUG, NULL);
+
+ return get_named_section (decl, "._ea", reloc);
+ }
+
+ return default_elf_select_section (decl, reloc, align);
+}
+
+/* Implement targetm.unique_section. */
+static void
+spu_unique_section (tree decl, int reloc)
+{
+ /* We don't support unique section names in the __ea address
+ space for now. */
+ if (TREE_TYPE (decl) != error_mark_node
+ && TYPE_ADDR_SPACE (TREE_TYPE (decl)) != 0)
+ return;
+
+ default_unique_section (decl, reloc);
+}
+
/* Generate a constant or register which contains 2^SCALE. We assume
the result is valid for MODE. Currently, MODE must be V4SFmode and
SCALE must be SImode. */
diff --git a/gcc/config/spu/spu.h b/gcc/config/spu/spu.h
index 67011a62126..369e6d76e9d 100644
--- a/gcc/config/spu/spu.h
+++ b/gcc/config/spu/spu.h
@@ -51,7 +51,7 @@ extern GTY(()) int spu_tune;
/* Default target_flags if no switches specified. */
#ifndef TARGET_DEFAULT
#define TARGET_DEFAULT (MASK_ERROR_RELOC | MASK_SAFE_DMA | MASK_BRANCH_HINTS \
- | MASK_SAFE_HINTS)
+ | MASK_SAFE_HINTS | MASK_ADDRESS_SPACE_CONVERSION)
#endif
@@ -469,6 +469,17 @@ targetm.resolve_overloaded_builtin = spu_resolve_overloaded_builtin; \
#define ASM_OUTPUT_LABELREF(FILE, NAME) \
asm_fprintf (FILE, "%U%s", default_strip_name_encoding (NAME))
+#define ASM_OUTPUT_SYMBOL_REF(FILE, X) \
+ do \
+ { \
+ tree decl; \
+ assemble_name (FILE, XSTR ((X), 0)); \
+ if ((decl = SYMBOL_REF_DECL ((X))) != 0 \
+ && TREE_CODE (decl) == VAR_DECL \
+ && TYPE_ADDR_SPACE (TREE_TYPE (decl))) \
+ fputs ("@ppu", FILE); \
+ } while (0)
+
/* Instruction Output */
#define REGISTER_NAMES \
@@ -590,6 +601,13 @@ targetm.resolve_overloaded_builtin = spu_resolve_overloaded_builtin; \
} while (0)
+/* Address spaces. */
+#define ADDR_SPACE_EA 1
+
+/* Named address space keywords. */
+#define TARGET_ADDR_SPACE_KEYWORDS ADDR_SPACE_KEYWORD ("__ea", ADDR_SPACE_EA)
+
+
/* Builtins. */
enum spu_builtin_type
diff --git a/gcc/config/spu/spu.opt b/gcc/config/spu/spu.opt
index 1589199b60b..4ad7128de51 100644
--- a/gcc/config/spu/spu.opt
+++ b/gcc/config/spu/spu.opt
@@ -82,3 +82,24 @@ Generate code for given CPU
mtune=
Target RejectNegative Joined Var(spu_tune_string)
Schedule code for given CPU
+
+mea32
+Target Report RejectNegative Var(spu_ea_model,32) Init(32)
+Access variables in 32-bit PPU objects (default)
+
+mea64
+Target Report RejectNegative Var(spu_ea_model,64) VarExists
+Access variables in 64-bit PPU objects
+
+maddress-space-conversion
+Target Report Mask(ADDRESS_SPACE_CONVERSION)
+Allow conversions between __ea and generic pointers (default)
+
+mcache-size=
+Target Report RejectNegative Joined UInteger
+Size (in KB) of software data cache
+
+matomic-updates
+Target Report
+Atomically write back software data cache lines (default)
+
diff --git a/gcc/config/spu/spu_cache.h b/gcc/config/spu/spu_cache.h
new file mode 100644
index 00000000000..66a679be5a0
--- /dev/null
+++ b/gcc/config/spu/spu_cache.h
@@ -0,0 +1,39 @@
+/* Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+
+ This file is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at your option)
+ any later version.
+
+ This file 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/>. */
+
+#ifndef _SPU_CACHE_H
+#define _SPU_CACHE_H
+
+void *__cache_fetch_dirty (__ea void *ea, int n_bytes_dirty);
+void *__cache_fetch (__ea void *ea);
+void __cache_evict (__ea void *ea);
+void __cache_flush (void);
+void __cache_touch (__ea void *ea);
+
+#define cache_fetch_dirty(_ea, _n_bytes_dirty) \
+ __cache_fetch_dirty(_ea, _n_bytes_dirty)
+
+#define cache_fetch(_ea) __cache_fetch(_ea)
+#define cache_touch(_ea) __cache_touch(_ea)
+#define cache_evict(_ea) __cache_evict(_ea)
+#define cache_flush() __cache_flush()
+
+#endif
diff --git a/gcc/config/spu/t-spu-elf b/gcc/config/spu/t-spu-elf
index 0c9236fa89f..a54ede9fa25 100644
--- a/gcc/config/spu/t-spu-elf
+++ b/gcc/config/spu/t-spu-elf
@@ -66,14 +66,39 @@ fp-bit.c: $(srcdir)/config/fp-bit.c $(srcdir)/config/spu/t-spu-elf
# Don't let CTOR_LIST end up in sdata section.
CRTSTUFF_T_CFLAGS =
-#MULTILIB_OPTIONS=mlarge-mem/mtest-abi
-#MULTILIB_DIRNAMES=large-mem test-abi
-#MULTILIB_MATCHES=
+# Multi-lib support.
+MULTILIB_OPTIONS=mea64
# Neither gcc or newlib seem to have a standard way to generate multiple
# crt*.o files. So we don't use the standard crt0.o name anymore.
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o
+EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o libgcc_cachemgr.a libgcc_cachemgr_nonatomic.a \
+ libgcc_cache8k.a libgcc_cache16k.a libgcc_cache32k.a libgcc_cache64k.a libgcc_cache128k.a
+
+$(T)cachemgr.o: $(srcdir)/config/spu/cachemgr.c
+ $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(MULTILIB_CFLAGS) -c $< -o $@
+
+# Specialised rule to add a -D flag.
+$(T)cachemgr_nonatomic.o: $(srcdir)/config/spu/cachemgr.c
+ $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(MULTILIB_CFLAGS) -DNONATOMIC -c $< -o $@
+
+$(T)libgcc_%.a: $(T)%.o
+ $(AR_FOR_TARGET) -rcs $@ $<
+
+$(T)cache8k.o: $(srcdir)/config/spu/cache.S
+ $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -D__CACHE_SIZE__=8 -o $@ -c $<
+
+$(T)cache16k.o: $(srcdir)/config/spu/cache.S
+ $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -D__CACHE_SIZE__=16 -o $@ -c $<
+
+$(T)cache32k.o: $(srcdir)/config/spu/cache.S
+ $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -D__CACHE_SIZE__=32 -o $@ -c $<
+
+$(T)cache64k.o: $(srcdir)/config/spu/cache.S
+ $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -D__CACHE_SIZE__=64 -o $@ -c $<
+
+$(T)cache128k.o: $(srcdir)/config/spu/cache.S
+ $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -D__CACHE_SIZE__=128 -o $@ -c $<
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/stormy16/stormy16.h b/gcc/config/stormy16/stormy16.h
index 682f7e6f466..fa97e8becdc 100644
--- a/gcc/config/stormy16/stormy16.h
+++ b/gcc/config/stormy16/stormy16.h
@@ -522,8 +522,6 @@ enum reg_class
#define HAVE_PRE_DECREMENT 1
-#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
-
#define MAX_REGS_PER_ADDRESS 1
#ifdef REG_OK_STRICT
diff --git a/gcc/config/vax/linux.h b/gcc/config/vax/linux.h
index 1087069adbb..dccbe9cc8ee 100644
--- a/gcc/config/vax/linux.h
+++ b/gcc/config/vax/linux.h
@@ -21,17 +21,7 @@ along with GCC; see the file COPYING3. If not see
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (VAX GNU/Linux with ELF)");
-#define TARGET_OS_CPP_BUILTINS() \
- do \
- { \
- LINUX_TARGET_OS_CPP_BUILTINS(); \
- if (flag_pic) \
- { \
- builtin_define ("__PIC__"); \
- builtin_define ("__pic__"); \
- } \
- } \
- while (0)
+#define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS()
/* We use GAS, G-float double and want new DI patterns. */
#undef TARGET_DEFAULT
diff --git a/gcc/configure b/gcc/configure
index a1e28a79e4b..292b3dca631 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -741,6 +741,8 @@ ac_subst_vars='LTLIBOBJS
LIBOBJS
enable_plugin
pluginlibs
+LIBELFINC
+LIBELFLIBS
CLOOGINC
CLOOGLIBS
PPLINC
@@ -808,6 +810,7 @@ subdirs
slibdir
dollar
gcc_tooldir
+enable_lto
MAINT
zlibinc
zlibdir
@@ -1061,7 +1064,9 @@ GMPINC
PPLLIBS
PPLINC
CLOOGLIBS
-CLOOGINC'
+CLOOGINC
+LIBELFLIBS
+LIBELFINC'
# Initialize some variables set by options.
@@ -1799,6 +1804,8 @@ Some influential environment variables:
PPLINC How to find PPL include files
CLOOGLIBS How to link CLOOG
CLOOGINC How to find CLOOG include files
+ LIBELFLIBS How to link libelf
+ LIBELFINC How to find libelf include files
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
@@ -11565,13 +11572,13 @@ if test "${lt_cv_nm_interface+set}" = set; then :
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:11568: $ac_compile\"" >&5)
+ (eval echo "\"\$as_me:11575: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
- (eval echo "\"\$as_me:11571: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval echo "\"\$as_me:11578: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
- (eval echo "\"\$as_me:11574: output\"" >&5)
+ (eval echo "\"\$as_me:11581: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
@@ -12776,7 +12783,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 12779 "configure"' > conftest.$ac_ext
+ echo '#line 12786 "configure"' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -14436,11 +14443,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14439: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14446: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:14443: \$? = $ac_status" >&5
+ echo "$as_me:14450: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -14775,11 +14782,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14778: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14785: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:14782: \$? = $ac_status" >&5
+ echo "$as_me:14789: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -14880,11 +14887,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14883: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14890: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:14887: \$? = $ac_status" >&5
+ echo "$as_me:14894: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -14935,11 +14942,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14938: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14945: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:14942: \$? = $ac_status" >&5
+ echo "$as_me:14949: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -17317,7 +17324,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 17320 "configure"
+#line 17327 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -17413,7 +17420,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 17416 "configure"
+#line 17423 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -19369,11 +19376,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:19372: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:19379: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:19376: \$? = $ac_status" >&5
+ echo "$as_me:19383: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -19468,11 +19475,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:19471: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:19478: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:19475: \$? = $ac_status" >&5
+ echo "$as_me:19482: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -19520,11 +19527,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:19523: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:19530: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:19527: \$? = $ac_status" >&5
+ echo "$as_me:19534: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -22910,6 +22917,37 @@ $as_echo "#define HAVE_AS_IX86_SAHF 1" >>confdefs.h
fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for swap suffix" >&5
+$as_echo_n "checking assembler for swap suffix... " >&6; }
+if test "${gcc_cv_as_ix86_swap+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ gcc_cv_as_ix86_swap=no
+ if test x$gcc_cv_as != x; then
+ echo 'movl.s %esp, %ebp' > conftest.s
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }
+ then
+ gcc_cv_as_ix86_swap=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_ix86_swap" >&5
+$as_echo "$gcc_cv_as_ix86_swap" >&6; }
+if test $gcc_cv_as_ix86_swap = yes; then
+
+$as_echo "#define HAVE_AS_IX86_SWAP 1" >>confdefs.h
+
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for different section symbol subtraction" >&5
$as_echo_n "checking assembler for different section symbol subtraction... " >&6; }
if test "${gcc_cv_as_ix86_diff_sect_delta+set}" = set; then :
@@ -23508,6 +23546,50 @@ $as_echo "#define HAVE_AS_LWSYNC 1" >>confdefs.h
fi
+ case $target in
+ *-*-aix*) conftest_s=' .machine "476"
+ .csect .text[PR]
+ dci 0';;
+ *) conftest_s=' .machine "476"
+ .text
+ dci 0';;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for data cache invalidate support" >&5
+$as_echo_n "checking assembler for data cache invalidate support... " >&6; }
+if test "${gcc_cv_as_powerpc_dci+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ gcc_cv_as_powerpc_dci=no
+ if test $in_tree_gas = yes; then
+ if test $gcc_cv_gas_vers -ge `expr \( \( 9 \* 1000 \) + 99 \) \* 1000 + 0`
+ then gcc_cv_as_powerpc_dci=yes
+fi
+ elif test x$gcc_cv_as != x; then
+ echo "$conftest_s" > conftest.s
+ if { ac_try='$gcc_cv_as -a32 -o conftest.o conftest.s >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }
+ then
+ gcc_cv_as_powerpc_dci=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_powerpc_dci" >&5
+$as_echo "$gcc_cv_as_powerpc_dci" >&6; }
+if test $gcc_cv_as_powerpc_dci = yes; then
+
+$as_echo "#define HAVE_AS_DCI 1" >>confdefs.h
+
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .gnu_attribute support" >&5
$as_echo_n "checking assembler for .gnu_attribute support... " >&6; }
if test "${gcc_cv_as_powerpc_gnu_attribute+set}" = set; then :
@@ -24760,6 +24842,16 @@ do
all_compilers="$all_compilers $compilers"
all_outputs="$all_outputs $outputs"
all_gtfiles="$all_gtfiles [$subdir] $gtfiles"
+ case ",$enable_languages," in
+ *,lto,*)
+
+$as_echo "#define ENABLE_LTO 1" >>confdefs.h
+
+ enable_lto=yes
+
+ ;;
+ *) ;;
+ esac
done
# Pick up gtfiles for c
@@ -24941,6 +25033,14 @@ $as_echo "#define HAVE_cloog 1" >>confdefs.h
fi
+
+
+if test "x${LIBELFLIBS}" != "x" ; then
+
+$as_echo "#define HAVE_libelf 1" >>confdefs.h
+
+fi
+
# Check for plugin support
# Check whether --enable-plugin was given.
if test "${enable_plugin+set}" = set; then :
@@ -24988,30 +25088,63 @@ rm -f core conftest.err conftest.$ac_objext \
fi
# Check -ldl
- LIBS="$LIBS -ldl"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -ldl" >&5
-$as_echo_n "checking for -ldl... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
+$as_echo_n "checking for library containing dlopen... " >&6; }
+if test "${ac_cv_search_dlopen+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <dlfcn.h>
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
int
main ()
{
-volatile int f = 0; if (f) dlopen ("dummy", 0);
+return dlopen ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }; have_dl=yes
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+for ac_lib in '' dl; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_dlopen=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- if test x"$have_dl" = x"yes"; then
+ conftest$ac_exeext
+ if test "${ac_cv_search_dlopen+set}" = set; then :
+ break
+fi
+done
+if test "${ac_cv_search_dlopen+set}" = set; then :
+
+else
+ ac_cv_search_dlopen=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5
+$as_echo "$ac_cv_search_dlopen" >&6; }
+ac_res=$ac_cv_search_dlopen
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+ if test x"$ac_cv_search_dlopen" = x"-ldl"; then
pluginlibs="$pluginlibs -ldl"
fi
@@ -25039,7 +25172,7 @@ $as_echo "no" >&6; }; have_pic_shared=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- if test x"$have_pic_shared" != x"yes"; then
+ if test x"$have_pic_shared" != x"yes" -o x"$ac_cv_search_dlopen" = x"no"; then
pluginlibs=
enable_plugin=no
fi
diff --git a/gcc/configure.ac b/gcc/configure.ac
index d7597d28341..dd3b7e890d2 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -3047,6 +3047,12 @@ foo: nop
[AC_DEFINE(HAVE_AS_IX86_SAHF, 1,
[Define if your assembler supports the sahf mnemonic.])])
+ gcc_GAS_CHECK_FEATURE([swap suffix],
+ gcc_cv_as_ix86_swap,,,
+ [movl.s %esp, %ebp],,
+ [AC_DEFINE(HAVE_AS_IX86_SWAP, 1,
+ [Define if your assembler supports the swap suffix.])])
+
gcc_GAS_CHECK_FEATURE([different section symbol subtraction],
gcc_cv_as_ix86_diff_sect_delta,,,
[.section .rodata
@@ -3249,6 +3255,21 @@ LCF0:
[AC_DEFINE(HAVE_AS_LWSYNC, 1,
[Define if your assembler supports LWSYNC instructions.])])
+ case $target in
+ *-*-aix*) conftest_s=' .machine "476"
+ .csect .text[[PR]]
+ dci 0';;
+ *) conftest_s=' .machine "476"
+ .text
+ dci 0';;
+ esac
+
+ gcc_GAS_CHECK_FEATURE([data cache invalidate support],
+ gcc_cv_as_powerpc_dci, [9,99,0], -a32,
+ [$conftest_s],,
+ [AC_DEFINE(HAVE_AS_DCI, 1,
+ [Define if your assembler supports the DCI/ICI instructions.])])
+
gcc_GAS_CHECK_FEATURE([.gnu_attribute support],
gcc_cv_as_powerpc_gnu_attribute, [2,18,0],,
[.gnu_attribute 4,1],,
@@ -4041,6 +4062,14 @@ changequote([,])dnl
all_compilers="$all_compilers $compilers"
all_outputs="$all_outputs $outputs"
all_gtfiles="$all_gtfiles [[$subdir]] $gtfiles"
+ case ",$enable_languages," in
+ *,lto,*)
+ AC_DEFINE(ENABLE_LTO, 1, [Define to enable LTO support.])
+ enable_lto=yes
+ AC_SUBST(enable_lto)
+ ;;
+ *) ;;
+ esac
done
# Pick up gtfiles for c
@@ -4213,6 +4242,12 @@ if test "x${CLOOGLIBS}" != "x" ; then
AC_DEFINE(HAVE_cloog, 1, [Define if cloog is in use.])
fi
+AC_ARG_VAR(LIBELFLIBS,[How to link libelf])
+AC_ARG_VAR(LIBELFINC,[How to find libelf include files])
+if test "x${LIBELFLIBS}" != "x" ; then
+ AC_DEFINE(HAVE_libelf, 1, [Define if libelf is in use.])
+fi
+
# Check for plugin support
AC_ARG_ENABLE(plugin,
[ --enable-plugin enable plugin support],
@@ -4239,14 +4274,8 @@ if test x"$enable_plugin" = x"yes"; then
fi
# Check -ldl
- LIBS="$LIBS -ldl"
- AC_MSG_CHECKING([for -ldl])
- AC_TRY_LINK(
- [#include <dlfcn.h>],
- [volatile int f = 0; if (f) dlopen ("dummy", 0);],
- [AC_MSG_RESULT([yes]); have_dl=yes],
- [AC_MSG_RESULT([no])])
- if test x"$have_dl" = x"yes"; then
+ AC_SEARCH_LIBS([dlopen], [dl])
+ if test x"$ac_cv_search_dlopen" = x"-ldl"; then
pluginlibs="$pluginlibs -ldl"
fi
@@ -4257,7 +4286,7 @@ if test x"$enable_plugin" = x"yes"; then
[extern int X;],[return X == 0;],
[AC_MSG_RESULT([yes]); have_pic_shared=yes],
[AC_MSG_RESULT([no]); have_pic_shared=no])
- if test x"$have_pic_shared" != x"yes"; then
+ if test x"$have_pic_shared" != x"yes" -o x"$ac_cv_search_dlopen" = x"no"; then
pluginlibs=
enable_plugin=no
fi
diff --git a/gcc/convert.c b/gcc/convert.c
index a833418d273..453f5ed873c 100644
--- a/gcc/convert.c
+++ b/gcc/convert.c
@@ -54,7 +54,17 @@ convert_to_pointer (tree type, tree expr)
{
case POINTER_TYPE:
case REFERENCE_TYPE:
- return fold_build1_loc (loc, NOP_EXPR, type, expr);
+ {
+ /* If the pointers point to different address spaces, conversion needs
+ to be done via a ADDR_SPACE_CONVERT_EXPR instead of a NOP_EXPR. */
+ addr_space_t to_as = TYPE_ADDR_SPACE (TREE_TYPE (type));
+ addr_space_t from_as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (expr)));
+
+ if (to_as == from_as)
+ return fold_build1_loc (loc, NOP_EXPR, type, expr);
+ else
+ return fold_build1_loc (loc, ADDR_SPACE_CONVERT_EXPR, type, expr);
+ }
case INTEGER_TYPE:
case ENUMERAL_TYPE:
diff --git a/gcc/coretypes.h b/gcc/coretypes.h
index 11583fffe44..0b8261fc614 100644
--- a/gcc/coretypes.h
+++ b/gcc/coretypes.h
@@ -69,6 +69,13 @@ struct gimple_seq_node_d;
typedef struct gimple_seq_node_d *gimple_seq_node;
typedef const struct gimple_seq_node_d *const_gimple_seq_node;
+/* Address space number for named address space support. */
+typedef unsigned char addr_space_t;
+
+/* The value of addr_space_t that represents the generic address space. */
+#define ADDR_SPACE_GENERIC 0
+#define ADDR_SPACE_GENERIC_P(AS) ((AS) == ADDR_SPACE_GENERIC)
+
/* The major intermediate representations of GCC. */
enum ir_type {
IR_GIMPLE,
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 91a6ad68e12..b63977b968e 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,396 @@
+2009-11-06 Jason Merrill <jason@redhat.com>
+
+ PR c++/15946
+ * parser.c (cp_parser_check_template_parameters): Don't talk about
+ specialization at function scope.
+ (cp_parser_diagnose_invalid_type_name): Handle dependent scope.
+ (cp_parser_parse_and_diagnose_invalid_type_name): Likewise.
+ (cp_parser_expression_statement): Suggest typename.
+ * error.c (dump_decl) [SCOPE_REF]: Print the type here.
+ (dump_expr) [SCOPE_REF]: Call it.
+ (dump_type) [UNBOUND_CLASS_TEMPLATE]: Check TFF_UNQUALIFIED_NAME.
+ * cxx-pretty-print.c (pp_cxx_unqualified_id): Print class template
+ args.
+
+ PR c++/9381
+ * decl2.c (build_memfn_type): Preserve attributes.
+ (cp_reconstruct_complex_type): Likewise.
+ (maybe_retrofit_in_chrg): Likewise.
+ * class.c (adjust_clone_args): Likewise.
+ * call.c (standard_conversion): Use build_memfn_type.
+ * pt.c (tsubst): Likewise.
+ * decl.c (build_ptrmem_type): Likewise
+ (check_function_type): Preserve attributes.
+ * tree.c (cp_build_type_attribute_variant): Propagate exception
+ specs on METHOD_TYPE, too.
+ (strip_typedefs): Preserve exception specs and attributes.
+
+2009-11-06 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR c++/41536
+ * optimize.c (maybe_clone_body): Copy DECL_ATTRIBUTES and
+ DECL_DISREGARD_INLINE_LIMITS also.
+
+2009-11-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/41967
+ * parser.c (cp_parser_omp_for_loop): After diagnosing not perfectly
+ nested loop and parsing statements, don't cp_parser_require }, instead
+ exit the loop if next token is CPP_EOF.
+
+2009-11-05 Jason Merrill <jason@redhat.com>
+
+ PR c++/34180
+ * method.c (do_build_copy_constructor): Don't drop cv-quals from
+ the field type.
+
+ PR c++/7046
+ * class.c (finish_struct): Store maximum_field_alignment in
+ TYPE_PRECISION.
+ * pt.c (instantiate_class_template): Set maximum_field_alignment.
+
+ PR c++/34870
+ * name-lookup.c (arg_assoc_class): Call complete_type.
+ * pt.c (instantiate_class_template): Call uses_template_parms
+ instead of dependent_type_p.
+
+ PR c++/41703
+ * pt.c (check_undeduced_parms): New subroutine of...
+ (more_specialized_fn): ...here. Undeduced template parms can make
+ a template less specialized than another.
+
+2009-11-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/39413
+ * search.c (lookup_base): Don't complete_type (base).
+
+ PR c++/35067
+ * method.c (use_thunk): Check DECL_WEAK as well as
+ DECL_ONE_ONLY.
+
+ PR c++/17365, DR 218
+ * name-lookup.c (add_function): Ignore non-functions.
+
+2009-11-03 Jason Merrill <jason@redhat.com>
+
+ PR c++/36959
+ * decl2.c (cxx_callgraph_analyze_expr): Don't reference a function
+ just because a static variable in it is needed unless -frepo.
+
+ PR c++/41876
+ * parser.c (cp_parser_type_specifier_seq): Rename is_condition to
+ is_declaration.
+ (cp_parser_exception_declaration): Pass true.
+ (cp_parser_omp_for_loop): Likewise.
+
+ PR c++/41927
+ * typeck.c (build_x_binary_op): Don't do warn_parentheses
+ if we're in a SFINAE context.
+
+ PR c++/41815
+ * call.c (build_call_a): Strip cv-quals from rvalue result.
+
+ PR c++/40944
+ * call.c (initialize_reference): Add complain parm.
+ * typeck.c (convert_for_initialization): Pass it.
+ * decl.c (grok_reference_init): Likewise.
+ * cp-tree.h: Declare it.
+
+ PR c++/40687
+ * pt.c (do_auto_deduction): Diagnose inconsistent deduction.
+
+2009-11-02 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/37093
+ * pt.c (check_valid_ptrmem_cst_expr): New function.
+ (convert_nontype_argument): Use it to output an error for
+ illegal pointer to member expressions used as template arguments.
+
+2009-11-02 Jason Merrill <jason@redhat.com>
+
+ Restrict DR 757 change to C++0x mode.
+ * decl2.c (mark_used): Check cxx_dialect.
+ * decl.c (grokfndecl): Do check type linkage in C++98 mode.
+ (grokvardecl): Likewise.
+ * pt.c (check_instantiated_arg): Likewise.
+
+2009-11-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/41774
+ * name-lookup.c (handle_namespace_attrs): Pass 1 as last argument to
+ push_visibility.
+ * parser.c (cp_parser_namespace_definition): Pass 1 as argument to
+ pop_visibility.
+ * rtti.c (push_abi_namespace): Pass 2 as last argument to
+ push_visibility.
+ (pop_abi_namespace): Pass 2 as argument to pop_visibility.
+
+2009-10-31 Jason Merrill <jason@redhat.com>
+
+ * tree.c (cv_unqualified): New fn.
+ * cp-tree.h: Declare it.
+ * typeck.c (decay_conversion): Use it instead of TYPE_MAIN_VARIANT.
+
+ * rtti.c (tinfo_name): Fix lengths for private case.
+
+2009-10-31 Jason Merrill <jason@redhat.com>
+
+ PR c++/41754
+ * call.c (compare_ics): Avoid bad union use when
+ comparing two ck_lists.
+
+2009-10-30 Jerry Quinn <jlquinn@optonline.net>
+
+ * mangle.c (mangle_type_string_for_rtti): Reapply 153734.
+ (needs_fake_anon): Likewise.
+ (write_name): Likewise.
+ (write_nested_name): Likewise.
+ * cp-tree.h (mangle_type_string_for_rtti): Likewise.
+ (get_anonymous_namespace): Likewise.
+ * name-lookup.c (get_anonymous_namespace_name): Likewise.
+ * rtti.c (tinfo_name): Likewise, with +1 in the second
+ build_string call fixed.
+ (tinfo_base_init): Likewise.
+
+2009-10-30 Jason Merrill <jason@redhat.com>
+
+ Revert:
+ * decl.c (cp_fname_init): Correct build_string argument.
+
+2009-10-30 Jerry Quinn <jlquinn@optonline.net>
+
+ * mangle.c (mangle_type_string_for_rtti): Revert 153734.
+ (needs_fake_anon): Likewise.
+ (write_name): Likewise.
+ (write_nested_name): Likewise.
+ * cp-tree.h (mangle_type_string_for_rtti): Likewise.
+ (get_anonymous_namespace): Likewise.
+ * name-lookup.c (get_anonymous_namespace_name): Likewise.
+ * rtti.c (tinfo_name): Likewise.
+ (tinfo_base_init): Likewise.
+
+2009-10-30 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/41863
+ * pt.c (iterative_hash_template_arg): articifial parms
+ don't have DECL_PARM_INDEX set. Do not hash it.
+
+2009-10-28 Jerry Quinn <jlquinn@optonline.net>
+
+ * mangle.c (mangle_type_string_for_rtti): Revert r149964.
+ (needs_fake_anon): Likewise.
+ (write_name): Likewise.
+ (write_nested_name): Likewise.
+ * cp-tree.h (mangle_type_string_for_rtti): Likewise.
+ (get_anonymous_namespace): Likewise.
+ * name-lookup.c (get_anonymous_namespace_name): Likewise.
+ * rtti.c (tinfo_name): Insert '*' in front of private names.
+ (tinfo_base_init): Use it.
+
+2009-10-28 Jason Merrill <jason@redhat.com>
+
+ Core issue 812, 861
+ * name-lookup.c (set_decl_namespace): Deal properly with inline
+ namespaces.
+ (qualified_lookup_using_namespace): Overhaul.
+ * pt.c (print_candidates): Handle getting an OVERLOAD.
+
+2009-10-28 Jason Merrill <jason@redhat.com>
+
+ * decl.c (cp_fname_init): Correct build_string argument.
+
+2009-10-27 Jason Merrill <jason@redhat.com>
+
+ Allow no-capture lambdas to convert to function pointer.
+ * semantics.c (maybe_add_lambda_conv_op): New.
+ * parser.c (cp_parser_lambda_expression): Call it.
+ (cp_parser_lambda_declarator_opt): Make op() static if
+ no captures.
+ * mangle.c (write_closure_type_name): Adjust.
+ * semantics.c (finish_this_expr): Adjust.
+ * decl.c (grok_op_properties): Allow it.
+ * call.c (build_user_type_conversion_1): Handle static conversion op.
+ (build_op_call): And op().
+
+2009-10-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/41828
+ * cp-lang.c (cxx_dwarf_name): Return NULL instead of
+ <anonymous ...> for anonymous aggregate names.
+
+2009-10-26 Jason Merrill <jason@redhat.com>
+
+ PR c++/38796, Core issue 906
+ * cp-tree.h (DECL_DEFAULTED_OUTSIDE_CLASS_P): New.
+ (DECL_DEFAULTED_IN_CLASS_P): New.
+ * class.c (user_provided_p): Non-static.
+ (check_methods): Use it.
+ (check_bases_and_members): Check defaulted fns.
+ (defaultable_fn_p): Move and rename to...
+ * method.c (defaultable_fn_check): ...this.
+ (defaulted_late_check): New.
+ * pt.c (tsubst_decl): Call it.
+ * decl2.c (grokfield): Adjust.
+ * decl.c (cp_finish_decl): Adjust.
+ (grok_special_member_properties): Use user_provided_p.
+
+2009-10-26 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/41785
+ * pt.c (template_args_equal): Handle comparison of
+ an ARGUMENT_PACK_SELECT node with the arguments node it selects into.
+ * cp-tree.def: Fix a typo in the description of TYPE_PACK_EXPANSION.
+
+2009-10-26 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/41020
+ * decl.c (decls_match): Use DECL_IS_BUILTIN instead of
+ DECL_BUILT_IN.
+
+2009-10-23 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/40808
+ * mangle.c (write_template_args): Allow mangling of empty template
+ argument list. Updated function comments.
+
+2009-10-23 Jason Merrill <jason@redhat.com>
+
+ * semantics.c (lambda_expr_this_capture): Use thisify_lambda_field.
+
+ * semantics.c (outer_lambda_capture_p): New fn.
+ (thisify_lambda_field): Factor out...
+ (add_default_capture): ...from here.
+ (finish_id_expression): Use them.
+
+ Core issue 899
+ * call.c (add_function_candidate): Only permit explicit conversion
+ ops if copy ctor was called with a single argument.
+
+ * call.c (initialize_reference): Tweak error message.
+
+2009-10-21 Jakub Jelinek <jakub@redhat.com>
+
+ * mangle.c (finish_mangling_get_identifier): Use
+ obstack_base (mangle_obstack) instead of name_base.
+
+2009-10-19 Jakub Jelinek <jakub@redhat.com>
+
+ * parser.c (cp_lexer_print_token, cp_parser_is_string_literal,
+ cp_parser_string_literal, cp_parser_primary_expression): Likewise.
+ (cp_lexer_get_preprocessor_token): Use C_LEX_STRING_JOIN instead
+ of C_LEX_RAW_STRINGS.
+
+2009-10-15 Jason Merrill <jason@redhat.com>
+
+ PR c++/38888
+ * error.c (dump_template_bindings): Wrap argument packs in {}.
+
+ PR c++/38798
+ * parser.c (CP_PARSER_FLAGS_NO_TYPE_DEFINITIONS): New.
+ (cp_parser_type_specifier): Don't try to parse a class-specifier
+ or enum-specifier in that case.
+ (cp_parser_trailing_type_id): New.
+ (cp_parser_late_return_type_opt): Call it.
+ (cp_parser_type_id_1): Add is_trailing_return parm.
+ (cp_parser_type_specifier_seq): Likewise.
+
+2009-10-14 Jason Merrill <jason@redhat.com>
+
+ PR c++/39866
+ * call.c (print_z_candidates): Don't print deleted candidates.
+ (print_z_candidate): Note deleted candidates.
+
+2009-10-14 Larry Evans <cppljevans@suddenlink.net>
+
+ PR c++/40092
+ * tree.c (cp_tree_equal): Add test for TEMPLATE_PARM_PARAMETER_PACK
+ equality.
+
+2009-10-12 Jason Merrill <jason@redhat.com>
+
+ PR c++/37875
+ * parser.c (cp_parser_decltype): Set greater_than_is_operator_p.
+
+ PR c++/37766
+ * pt.c (type_unification_real): Call convert_template_argument
+ for function default template arguments.
+ (check_default_tmpl_args): Suggest -std=c++0x when function default
+ template args seen in C++98 mode.
+
+2009-10-11 Jason Merrill <jason@redhat.com>
+
+ PR c++/37204
+ * typeck.c (build_reinterpret_cast_1): Handle rvalue refs
+ properly.
+
+2009-10-11 Richard Guenther <rguenther@suse.de>
+
+ * tree.c (cp_free_lang_data): Drop anonymous aggregate names.
+
+2009-10-08 Jason Merrill <jason@redhat.com>
+
+ PR c++/36816
+ * pt.c (maybe_adjust_types_for_deduction): Do rvalue ref adjustment
+ even when DEDUCE_EXACT.
+
+ PR c++/37177
+ * pt.c (resolve_nondeduced_context): New.
+ * cvt.c (convert_to_void): Call it.
+ * semantics.c (finish_decltype_type): Likewise.
+ * typeck.c (decay_conversion): Here too.
+ * pt.c (tsubst_decl): Don't clobber input_location.
+ Don't register a bad specialization.
+
+2009-10-07 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ * cp-tree.h: Fix location of documentation for DECL_LANG_FLAG_7.
+
+2009-10-07 Jason Merrill <jason@redhat.com>
+
+ PR c++/39863
+ * pt.c (tsubst_pack_expansion): Don't do anything now if we
+ have incomplete packs of different lengths.
+
+ PR c++/41038
+ * tree.c (build_qualified_name): Call convert_from_reference.
+
+2009-10-06 Jason Merrill <jason@redhat.com>
+
+ Fix lookup of initialized captures in unevaluated context.
+ * cp-tree.h (DECL_NORMAL_CAPTURE_P): New.
+ * name-lookup.c (qualify_lookup): Check it.
+ * parser.c (cp_parser_lambda_introducer): Pass explicit_init_p
+ to add_capture.
+ * semantics.c (add_capture): Set DECL_NORMAL_CAPTURE_P
+ on captures without explicit init.
+ (add_default_capture): Pass explicit_init_p.
+
+ Fix capture by copy of types with explicit copy constructor.
+ * cp-tree.h (TARGET_EXPR_DIRECT_INIT_P): New.
+ (DIRECT_INIT_EXPR_P): New.
+ * typeck.c (convert_for_initialization): Just return if
+ DIRECT_INIT_EXPR_P.
+ * semantics.c (build_lambda_object): Use
+ TARGET_EXPR_DIRECT_INIT_P for normal captures.
+
+2009-10-05 Jason Merrill <jason@redhat.com>
+
+ * parser.c: Mark lambda_scope and lambda_count for PCH.
+
+2009-10-03 Jason Merrill <jason@redhat.com>
+
+ PR c++/41553
+ * parser.c (cp_parser_lambda_introducer): Avoid infinite loop on
+ parse error.
+
+2009-10-02 Jason Merrill <jason@redhat.com>
+
+ * mangle.c (write_unnamed_type_name): Implement.
+ (local_class_index): Split out from...
+ (discriminator_for_local_entity): ...here.
+ (nested_anon_class_index): New.
+ * cp-tree.h (TYPE_FUNCTION_SCOPE_P): New.
+
2009-10-02 Janis Johnson <janis187@us.ibm.com>
* call.c (convert_arg_to_ellipsis): Avoid promoting decimal32
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 3fc22f2b911..1aebaac8cd5 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -313,6 +313,9 @@ build_call_a (tree function, int n, tree *argarray)
gcc_assert (TREE_CODE (fntype) == FUNCTION_TYPE
|| TREE_CODE (fntype) == METHOD_TYPE);
result_type = TREE_TYPE (fntype);
+ /* An rvalue has no cv-qualifiers. */
+ if (SCALAR_TYPE_P (result_type) || VOID_TYPE_P (result_type))
+ result_type = cv_unqualified (result_type);
if (TREE_CODE (function) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (function, 0)) == FUNCTION_DECL)
@@ -893,10 +896,7 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p,
|| cp_type_quals (fbase) != cp_type_quals (tbase))
return NULL;
- from = cp_build_qualified_type (tbase, cp_type_quals (fbase));
- from = build_method_type_directly (from,
- TREE_TYPE (fromfn),
- TREE_CHAIN (TYPE_ARG_TYPES (fromfn)));
+ from = build_memfn_type (fromfn, tbase, cp_type_quals (tbase));
from = build_ptrmemfunc_type (build_pointer_type (from));
conv = build_conv (ck_pmem, from, conv);
conv->base_p = true;
@@ -1631,7 +1631,8 @@ add_function_candidate (struct z_candidate **candidates,
parmtype = build_pointer_type (parmtype);
}
- if (ctype && i == 0 && DECL_COPY_CONSTRUCTOR_P (fn))
+ if (ctype && i == 0 && DECL_COPY_CONSTRUCTOR_P (fn)
+ && (len-skip == 1))
{
/* Hack: Direct-initialize copy parm (i.e. suppress
LOOKUP_ONLYCONVERTING) to make explicit conversion ops
@@ -2718,6 +2719,8 @@ print_z_candidate (const char *msgstr, struct z_candidate *candidate)
inform (input_location, "%s %T <conversion>", msgstr, candidate->fn);
else if (candidate->viable == -1)
inform (input_location, "%s %+#D <near match>", msgstr, candidate->fn);
+ else if (DECL_DELETED_FN (candidate->fn))
+ inform (input_location, "%s %+#D <deleted>", msgstr, candidate->fn);
else
inform (input_location, "%s %+#D", msgstr, candidate->fn);
}
@@ -2729,6 +2732,23 @@ print_z_candidates (struct z_candidate *candidates)
struct z_candidate *cand1;
struct z_candidate **cand2;
+ if (!candidates)
+ return;
+
+ /* Remove deleted candidates. */
+ cand1 = candidates;
+ for (cand2 = &cand1; *cand2; )
+ {
+ if (TREE_CODE ((*cand2)->fn) == FUNCTION_DECL
+ && DECL_DELETED_FN ((*cand2)->fn))
+ *cand2 = (*cand2)->next;
+ else
+ cand2 = &(*cand2)->next;
+ }
+ /* ...if there are any non-deleted ones. */
+ if (cand1)
+ candidates = cand1;
+
/* There may be duplicates in the set of candidates. We put off
checking this condition as long as possible, since we have no way
to eliminate duplicates from a set of functions in less than n^2
@@ -2751,9 +2771,6 @@ print_z_candidates (struct z_candidate *candidates)
}
}
- if (!candidates)
- return;
-
str = _("candidates are:");
print_z_candidate (str, candidates);
if (candidates->next)
@@ -2936,11 +2953,16 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags)
for (fns = TREE_VALUE (conv_fns); fns; fns = OVL_NEXT (fns))
{
tree fn = OVL_CURRENT (fns);
+ tree first = first_arg;
if (DECL_NONCONVERTING_P (fn)
&& (flags & LOOKUP_ONLYCONVERTING))
continue;
+ /* Lambdas have a static conversion op. */
+ if (DECL_STATIC_FUNCTION_P (fn))
+ first = NULL_TREE;
+
/* [over.match.funcs] For conversion functions, the function
is considered to be a member of the class of the implicit
object argument for the purpose of defining the type of
@@ -2951,14 +2973,14 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags)
if (TREE_CODE (fn) == TEMPLATE_DECL)
cand = add_template_candidate (&candidates, fn, fromtype,
NULL_TREE,
- first_arg, NULL, totype,
+ first, NULL, totype,
TYPE_BINFO (fromtype),
conversion_path,
flags,
DEDUCE_CONV);
else
cand = add_function_candidate (&candidates, fn, fromtype,
- first_arg, NULL,
+ first, NULL,
TYPE_BINFO (fromtype),
conversion_path,
flags);
@@ -3365,20 +3387,30 @@ build_op_call (tree obj, VEC(tree,gc) **args, tsubst_flags_t complain)
for (fns = BASELINK_FUNCTIONS (fns); fns; fns = OVL_NEXT (fns))
{
tree fn = OVL_CURRENT (fns);
+
+ tree lfirst = first_mem_arg;
+ if (DECL_STATIC_FUNCTION_P (fn))
+ lfirst = NULL_TREE;
+
if (TREE_CODE (fn) == TEMPLATE_DECL)
add_template_candidate (&candidates, fn, base, NULL_TREE,
- first_mem_arg, *args, NULL_TREE,
+ lfirst, *args, NULL_TREE,
TYPE_BINFO (type),
TYPE_BINFO (type),
LOOKUP_NORMAL, DEDUCE_CALL);
else
add_function_candidate
- (&candidates, fn, base, first_mem_arg, *args, TYPE_BINFO (type),
+ (&candidates, fn, base, lfirst, *args, TYPE_BINFO (type),
TYPE_BINFO (type), LOOKUP_NORMAL);
}
}
- convs = lookup_conversions (type);
+ /* Rather than mess with handling static conversion ops here, just don't
+ look at conversions in lambdas. */
+ if (LAMBDA_TYPE_P (type))
+ convs = NULL_TREE;
+ else
+ convs = lookup_conversions (type);
for (; convs; convs = TREE_CHAIN (convs))
{
@@ -6585,8 +6617,9 @@ compare_ics (conversion *ics1, conversion *ics2)
/* We couldn't make up our minds; try to figure it out below. */
}
- if (ics1->ellipsis_p)
- /* Both conversions are ellipsis conversions. */
+ if (ics1->ellipsis_p || ics1->kind == ck_list)
+ /* Both conversions are ellipsis conversions or both are building a
+ std::initializer_list. */
return 0;
/* User-defined conversion sequence U1 is a better conversion sequence
@@ -7584,7 +7617,8 @@ set_up_extended_ref_temp (tree decl, tree expr, tree *cleanup, tree *initp)
Return the converted expression. */
tree
-initialize_reference (tree type, tree expr, tree decl, tree *cleanup)
+initialize_reference (tree type, tree expr, tree decl, tree *cleanup,
+ tsubst_flags_t complain)
{
conversion *conv;
void *p;
@@ -7599,16 +7633,19 @@ initialize_reference (tree type, tree expr, tree decl, tree *cleanup)
LOOKUP_NORMAL);
if (!conv || conv->bad_p)
{
- if (!(TYPE_QUALS (TREE_TYPE (type)) & TYPE_QUAL_CONST)
- && !TYPE_REF_IS_RVALUE (type)
- && !real_lvalue_p (expr))
- error ("invalid initialization of non-const reference of "
- "type %qT from a temporary of type %qT",
- type, TREE_TYPE (expr));
- else
- error ("invalid initialization of reference of type "
- "%qT from expression of type %qT", type,
- TREE_TYPE (expr));
+ if (complain & tf_error)
+ {
+ if (!(TYPE_QUALS (TREE_TYPE (type)) & TYPE_QUAL_CONST)
+ && !TYPE_REF_IS_RVALUE (type)
+ && !real_lvalue_p (expr))
+ error ("invalid initialization of non-const reference of "
+ "type %qT from an rvalue of type %qT",
+ type, TREE_TYPE (expr));
+ else
+ error ("invalid initialization of reference of type "
+ "%qT from expression of type %qT", type,
+ TREE_TYPE (expr));
+ }
return error_mark_node;
}
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index d29d6615f33..c798ba2833f 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -2677,7 +2677,8 @@ add_implicitly_declared_members (tree t,
CLASSTYPE_LAZY_COPY_CTOR (t) = 1;
}
- /* Currently only lambdas get a lazy move ctor. */
+ /* Currently only lambdas get a lazy move ctor, but N2987 adds them for
+ other classes. */
if (LAMBDA_TYPE_P (t))
CLASSTYPE_LAZY_MOVE_CTOR (t) = 1;
@@ -3843,7 +3844,7 @@ check_methods (tree t)
VEC_safe_push (tree, gc, CLASSTYPE_PURE_VIRTUALS (t), x);
}
/* All user-provided destructors are non-trivial. */
- if (DECL_DESTRUCTOR_P (x) && !DECL_DEFAULTED_FN (x))
+ if (DECL_DESTRUCTOR_P (x) && user_provided_p (x))
TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) = 1;
}
}
@@ -4103,6 +4104,7 @@ adjust_clone_args (tree decl)
/* A default parameter has been added. Adjust the
clone's parameters. */
tree exceptions = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (clone));
+ tree attrs = TYPE_ATTRIBUTES (TREE_TYPE (clone));
tree basetype = TYPE_METHOD_BASETYPE (TREE_TYPE (clone));
tree type;
@@ -4120,6 +4122,8 @@ adjust_clone_args (tree decl)
clone_parms);
if (exceptions)
type = build_exception_variant (type, exceptions);
+ if (attrs)
+ type = cp_build_type_attribute_variant (type, attrs);
TREE_TYPE (clone) = type;
clone_parms = NULL_TREE;
@@ -4174,17 +4178,17 @@ type_has_user_nondefault_constructor (tree t)
}
/* Returns true iff FN is a user-provided function, i.e. user-declared
- and not defaulted at its first declaration. */
+ and not defaulted at its first declaration; or explicit, private,
+ protected, or non-const. */
-static bool
+bool
user_provided_p (tree fn)
{
if (TREE_CODE (fn) == TEMPLATE_DECL)
return true;
else
return (!DECL_ARTIFICIAL (fn)
- && !(DECL_DEFAULTED_FN (fn)
- && DECL_INITIALIZED_IN_CLASS_P (fn)));
+ && !DECL_DEFAULTED_IN_CLASS_P (fn));
}
/* Returns true iff class T has a user-provided constructor. */
@@ -4238,31 +4242,6 @@ type_has_user_provided_default_constructor (tree t)
return false;
}
-/* Returns true if FN can be explicitly defaulted. */
-
-bool
-defaultable_fn_p (tree fn)
-{
- if (DECL_CONSTRUCTOR_P (fn))
- {
- if (FUNCTION_FIRST_USER_PARMTYPE (fn) == void_list_node)
- return true;
- else if (copy_fn_p (fn) > 0
- && (TREE_CHAIN (FUNCTION_FIRST_USER_PARMTYPE (fn))
- == void_list_node))
- return true;
- else
- return false;
- }
- else if (DECL_DESTRUCTOR_P (fn))
- return true;
- else if (DECL_ASSIGNMENT_OPERATOR_P (fn)
- && DECL_OVERLOADED_OPERATOR_P (fn) == NOP_EXPR)
- return copy_fn_p (fn);
- else
- return false;
-}
-
/* Remove all zero-width bit-fields from T. */
static void
@@ -4356,6 +4335,7 @@ check_bases_and_members (tree t)
tree access_decls;
bool saved_complex_asn_ref;
bool saved_nontrivial_dtor;
+ tree fn;
/* By default, we use const reference arguments and generate default
constructors. */
@@ -4453,6 +4433,31 @@ check_bases_and_members (tree t)
cant_have_const_ctor,
no_const_asn_ref);
+ /* Check defaulted declarations here so we have cant_have_const_ctor
+ and don't need to worry about clones. */
+ for (fn = TYPE_METHODS (t); fn; fn = TREE_CHAIN (fn))
+ if (DECL_DEFAULTED_IN_CLASS_P (fn))
+ {
+ int copy = copy_fn_p (fn);
+ if (copy > 0)
+ {
+ bool imp_const_p
+ = (DECL_CONSTRUCTOR_P (fn) ? !cant_have_const_ctor
+ : !no_const_asn_ref);
+ bool fn_const_p = (copy == 2);
+
+ if (fn_const_p && !imp_const_p)
+ /* If the function is defaulted outside the class, we just
+ give the synthesis error. */
+ error ("%q+D declared to take const reference, but implicit "
+ "declaration would take non-const", fn);
+ else if (imp_const_p && !fn_const_p)
+ error ("%q+D declared to take non-const reference cannot be "
+ "defaulted in the class body", fn);
+ }
+ defaulted_late_check (fn);
+ }
+
if (LAMBDA_TYPE_P (t))
{
/* "The closure type associated with a lambda-expression has a deleted
@@ -5514,6 +5519,9 @@ finish_struct (tree t, tree attributes)
if (DECL_PURE_VIRTUAL_P (x))
VEC_safe_push (tree, gc, CLASSTYPE_PURE_VIRTUALS (t), x);
complete_vars (t);
+
+ /* Remember current #pragma pack value. */
+ TYPE_PRECISION (t) = maximum_field_alignment;
}
else
finish_struct_1 (t);
diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c
index d84325d291b..8aa01e24d39 100644
--- a/gcc/cp/cp-lang.c
+++ b/gcc/cp/cp-lang.c
@@ -137,6 +137,9 @@ cxx_dwarf_name (tree t, int verbosity)
{
gcc_assert (DECL_P (t));
+ if (DECL_NAME (t)
+ && (ANON_AGGRNAME_P (DECL_NAME (t)) || LAMBDANAME_P (DECL_NAME (t))))
+ return NULL;
if (verbosity >= 2)
return decl_as_string (t,
TFF_DECL_SPECIFIERS | TFF_UNQUALIFIED_NAME
diff --git a/gcc/cp/cp-tree.def b/gcc/cp/cp-tree.def
index 4df01a8e205..28ecc5bf681 100644
--- a/gcc/cp/cp-tree.def
+++ b/gcc/cp/cp-tree.def
@@ -393,7 +393,7 @@ DEFTREECODE (NONTYPE_ARGUMENT_PACK, "nontype_argument_pack", tcc_expression, 1)
};
The derivation from tuple contains a TYPE_PACK_EXPANSION for the
- template arguments. Its EXPR_PACK_EXPANSION is "Values&" and its
+ template arguments. Its PACK_EXPANSION_PATTERN is "Values&" and its
PACK_EXPANSION_PARAMETER_PACKS will contain "Values". */
DEFTREECODE (TYPE_PACK_EXPANSION, "type_pack_expansion", tcc_type, 0)
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index fc00176c276..c4b088beb56 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -97,6 +97,7 @@ framework extensions, you must include this file before toplev.h, not after.
STATEMENT_LIST_TRY_BLOCK (in STATEMENT_LIST)
TYPENAME_IS_RESOLVING_P (in TYPE_NAME_TYPE)
LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P (in LAMBDA_EXPR)
+ TARGET_EXPR_DIRECT_INIT_P (in TARGET_EXPR)
3: (TREE_REFERENCE_EXPR) (in NON_LVALUE_EXPR) (commented-out).
ICS_BAD_FLAG (in _CONV)
FN_TRY_BLOCK_P (in TRY_BLOCK)
@@ -112,8 +113,6 @@ framework extensions, you must include this file before toplev.h, not after.
6: IDENTIFIER_REPO_CHOSEN (in IDENTIFIER_NODE)
DECL_CONSTRUCTION_VTABLE_P (in VAR_DECL)
TYPE_MARKED_P (in _TYPE)
- 7: DECL_DEAD_FOR_LOCAL (in VAR_DECL)
- 8: DECL_DECLARED_CONSTEXPR_P (in VAR_DECL, FUNCTION_DECL)
Usage of TYPE_LANG_FLAG_?:
0: TYPE_DEPENDENT_P
@@ -147,6 +146,8 @@ framework extensions, you must include this file before toplev.h, not after.
DECL_FIELD_IS_BASE (in FIELD_DECL)
7: DECL_DEAD_FOR_LOCAL (in VAR_DECL).
DECL_THUNK_P (in a member FUNCTION_DECL)
+ DECL_NORMAL_CAPTURE_P (in FIELD_DECL)
+ 8: DECL_DECLARED_CONSTEXPR_P (in VAR_DECL, FUNCTION_DECL)
Usage of language-independent fields in a language-dependent manner:
@@ -2249,6 +2250,9 @@ struct GTY(()) lang_decl {
(DECL_CONTEXT (NODE) \
&& TREE_CODE (DECL_CONTEXT (NODE)) == FUNCTION_DECL)
+#define TYPE_FUNCTION_SCOPE_P(NODE) \
+ (TYPE_CONTEXT (NODE) && TREE_CODE (TYPE_CONTEXT (NODE)) == FUNCTION_DECL)
+
/* 1 iff VAR_DECL node NODE is a type-info decl. This flag is set for
both the primary typeinfo object and the associated NTBS name. */
#define DECL_TINFO_P(NODE) TREE_LANG_FLAG_4 (VAR_DECL_CHECK (NODE))
@@ -2811,10 +2815,18 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
#define DECL_DELETED_FN(DECL) \
(DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (DECL))->u.base.threadprivate_or_deleted_p)
-/* Nonzero if DECL was declared with '= default'. */
+/* Nonzero if DECL was declared with '= default' (maybe implicitly). */
#define DECL_DEFAULTED_FN(DECL) \
(LANG_DECL_FN_CHECK (DECL)->defaulted_p)
+/* Nonzero if DECL is explicitly defaulted in the class body. */
+#define DECL_DEFAULTED_IN_CLASS_P(DECL) \
+ (DECL_DEFAULTED_FN (DECL) && DECL_INITIALIZED_IN_CLASS_P (DECL))
+/* Nonzero if DECL was defaulted outside the class body. */
+#define DECL_DEFAULTED_OUTSIDE_CLASS_P(DECL) \
+ (DECL_DEFAULTED_FN (DECL) \
+ && !(DECL_ARTIFICIAL (DECL) || DECL_INITIALIZED_IN_CLASS_P (DECL)))
+
/* Record whether a typedef for type `int' was actually `signed int'. */
#define C_TYPEDEF_EXPLICITLY_SIGNED(EXP) DECL_LANG_FLAG_1 (EXP)
@@ -3196,6 +3208,12 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
#define DECL_FIELD_IS_BASE(NODE) \
DECL_LANG_FLAG_6 (FIELD_DECL_CHECK (NODE))
+/* Nonzero for FIELD_DECL node means that this field is a simple (no
+ explicit initializer) lambda capture field, making it invisible to
+ name lookup in unevaluated contexts. */
+#define DECL_NORMAL_CAPTURE_P(NODE) \
+ DECL_LANG_FLAG_7 (FIELD_DECL_CHECK (NODE))
+
/* Nonzero if TYPE is an anonymous union or struct type. We have to use a
flag for this because "A union for which objects or pointers are
declared is not an anonymous union" [class.union]. */
@@ -3630,6 +3648,16 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
#define TARGET_EXPR_LIST_INIT_P(NODE) \
TREE_LANG_FLAG_1 (TARGET_EXPR_CHECK (NODE))
+/* True if this TARGET_EXPR expresses direct-initialization of an object
+ to be named later. */
+#define TARGET_EXPR_DIRECT_INIT_P(NODE) \
+ TREE_LANG_FLAG_2 (TARGET_EXPR_CHECK (NODE))
+
+/* True if EXPR expresses direct-initialization of a TYPE. */
+#define DIRECT_INIT_EXPR_P(TYPE,EXPR) \
+ (TREE_CODE (EXPR) == TARGET_EXPR && TREE_LANG_FLAG_2 (EXPR) \
+ && same_type_ignoring_top_level_qualifiers_p (TYPE, TREE_TYPE (EXPR)))
+
/* An enumeration of the kind of tags that C++ accepts. */
enum tag_types {
none_type = 0, /* Not a tag type. */
@@ -4401,7 +4429,7 @@ extern tree type_passed_as (tree);
extern tree convert_for_arg_passing (tree, tree);
extern bool is_properly_derived_from (tree, tree);
extern tree set_up_extended_ref_temp (tree, tree, tree *, tree *);
-extern tree initialize_reference (tree, tree, tree, tree *);
+extern tree initialize_reference (tree, tree, tree, tree *, tsubst_flags_t);
extern tree make_temporary_var_for_ref_to_temp (tree, tree);
extern tree strip_top_quals (tree);
extern bool reference_related_p (tree, tree);
@@ -4463,9 +4491,11 @@ extern void check_for_override (tree, tree);
extern void push_class_stack (void);
extern void pop_class_stack (void);
extern bool type_has_user_nondefault_constructor (tree);
+extern bool user_provided_p (tree);
extern bool type_has_user_provided_constructor (tree);
extern bool type_has_user_provided_default_constructor (tree);
-extern bool defaultable_fn_p (tree);
+extern void defaulted_late_check (tree);
+extern bool defaultable_fn_check (tree);
extern void fixup_type_variants (tree);
extern tree* decl_cloned_function_p (const_tree, bool);
extern void clone_function_decl (tree, int);
@@ -4487,7 +4517,6 @@ extern tree type_promotes_to (tree);
extern tree perform_qualification_conversions (tree, tree);
/* in name-lookup.c */
-extern tree get_anonymous_namespace_name (void);
extern tree pushdecl (tree);
extern tree pushdecl_maybe_friend (tree, bool);
extern void maybe_push_cleanup_level (tree);
@@ -4825,7 +4854,9 @@ bool template_template_parameter_p (const_tree);
extern tree get_primary_template_innermost_parameters (const_tree);
extern tree get_template_innermost_arguments (const_tree);
extern tree get_template_argument_pack_elems (const_tree);
-extern tree get_function_template_decl (const_tree);
+extern tree get_function_template_decl (const_tree);
+extern tree resolve_nondeduced_context (tree);
+
/* in repo.c */
extern void init_repo (void);
extern int repo_emit_p (tree);
@@ -5038,9 +5069,10 @@ extern tree lambda_capture_field_type (tree);
extern tree lambda_return_type (tree);
extern tree lambda_function (tree);
extern void apply_lambda_return_type (tree, tree);
-extern tree add_capture (tree, tree, tree, bool);
+extern tree add_capture (tree, tree, tree, bool, bool);
extern tree add_default_capture (tree, tree, tree);
extern tree lambda_expr_this_capture (tree);
+extern void maybe_add_lambda_conv_op (tree);
/* in tree.c */
void cp_free_lang_data (tree t);
@@ -5114,6 +5146,7 @@ extern tree move (tree);
extern tree cp_build_qualified_type_real (tree, int, tsubst_flags_t);
#define cp_build_qualified_type(TYPE, QUALS) \
cp_build_qualified_type_real ((TYPE), (QUALS), tf_warning_or_error)
+extern tree cv_unqualified (tree);
extern special_function_kind special_function_p (const_tree);
extern int count_trees (tree);
extern int char_type_p (tree);
@@ -5266,7 +5299,7 @@ extern tree merge_exception_specifiers (tree, tree);
/* in mangle.c */
extern void init_mangle (void);
extern void mangle_decl (tree);
-extern const char *mangle_type_string_for_rtti (tree);
+extern const char *mangle_type_string (tree);
extern tree mangle_typeinfo_for_type (tree);
extern tree mangle_typeinfo_string_for_type (tree);
extern tree mangle_vtbl_for_type (tree);
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index aff002dc666..8c5b001dd15 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -956,6 +956,7 @@ convert_to_void (tree expr, const char *implicit, tsubst_flags_t complain)
default:;
}
+ expr = resolve_nondeduced_context (expr);
{
tree probe = expr;
diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c
index 1d7f9cf2caf..4851af901f7 100644
--- a/gcc/cp/cxx-pretty-print.c
+++ b/gcc/cp/cxx-pretty-print.c
@@ -200,6 +200,12 @@ pp_cxx_unqualified_id (cxx_pretty_printer *pp, tree t)
case TYPENAME_TYPE:
case UNBOUND_CLASS_TEMPLATE:
pp_cxx_unqualified_id (pp, TYPE_NAME (t));
+ if (CLASS_TYPE_P (t) && CLASSTYPE_USE_TEMPLATE (t))
+ {
+ pp_cxx_begin_template_argument_list (pp);
+ pp_cxx_template_argument_list (pp, CLASSTYPE_TI_ARGS (t));
+ pp_cxx_end_template_argument_list (pp);
+ }
break;
case BIT_NOT_EXPR:
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 5eb389fe7e3..5e2f85fd9d4 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -935,7 +935,7 @@ decls_match (tree newdecl, tree olddecl)
#ifdef NO_IMPLICIT_EXTERN_C
/* A new declaration doesn't match a built-in one unless it
is also extern "C". */
- if (DECL_BUILT_IN (olddecl)
+ if (DECL_IS_BUILTIN (olddecl)
&& DECL_EXTERN_C_P (olddecl) && !DECL_EXTERN_C_P (newdecl))
return 0;
#endif
@@ -4390,7 +4390,7 @@ grok_reference_init (tree decl, tree type, tree init, tree *cleanup)
DECL_INITIAL for local references (instead assigning to them
explicitly); we need to allow the temporary to be initialized
first. */
- tmp = initialize_reference (type, init, decl, cleanup);
+ tmp = initialize_reference (type, init, decl, cleanup, tf_warning_or_error);
if (tmp == error_mark_node)
return NULL_TREE;
@@ -5603,17 +5603,10 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
}
else if (init == ridpointers[(int)RID_DEFAULT])
{
- if (!defaultable_fn_p (decl))
- {
- error ("%qD cannot be defaulted", decl);
- DECL_INITIAL (decl) = NULL_TREE;
- }
+ if (defaultable_fn_check (decl))
+ DECL_DEFAULTED_FN (decl) = 1;
else
- {
- DECL_DEFAULTED_FN (decl) = 1;
- FOR_EACH_CLONE (clone, decl)
- DECL_DEFAULTED_FN (clone) = 1;
- }
+ DECL_INITIAL (decl) = NULL_TREE;
}
}
@@ -6775,6 +6768,36 @@ grokfndecl (tree ctype,
|| decl_function_context (TYPE_MAIN_DECL (ctype))))
publicp = 0;
+ if (publicp && cxx_dialect == cxx98)
+ {
+ /* [basic.link]: A name with no linkage (notably, the name of a class
+ or enumeration declared in a local scope) shall not be used to
+ declare an entity with linkage.
+
+ DR 757 relaxes this restriction for C++0x. */
+ t = no_linkage_check (TREE_TYPE (decl),
+ /*relaxed_p=*/false);
+ if (t)
+ {
+ if (TYPE_ANONYMOUS_P (t))
+ {
+ if (DECL_EXTERN_C_P (decl))
+ /* Allow this; it's pretty common in C. */;
+ else
+ {
+ permerror (input_location, "non-local function %q#D uses anonymous type",
+ decl);
+ if (DECL_ORIGINAL_TYPE (TYPE_NAME (t)))
+ permerror (input_location, "%q+#D does not refer to the unqualified "
+ "type, so it is not used for linkage",
+ TYPE_NAME (t));
+ }
+ }
+ else
+ permerror (input_location, "non-local function %q#D uses local type %qT", decl, t);
+ }
+ }
+
TREE_PUBLIC (decl) = publicp;
if (! publicp)
{
@@ -7014,15 +7037,48 @@ grokvardecl (tree type,
if (declspecs->specs[(int)ds_thread])
DECL_TLS_MODEL (decl) = decl_default_tls_model (decl);
+ /* If the type of the decl has no linkage, make sure that we'll
+ notice that in mark_used. */
+ if (cxx_dialect > cxx98
+ && decl_linkage (decl) != lk_none
+ && DECL_LANG_SPECIFIC (decl) == NULL
+ && !DECL_EXTERN_C_P (decl)
+ && no_linkage_check (TREE_TYPE (decl), /*relaxed_p=*/false))
+ retrofit_lang_decl (decl);
+
if (TREE_PUBLIC (decl))
{
- /* If the type of the decl has no linkage, make sure that we'll
- notice that in mark_used. */
- if (DECL_LANG_SPECIFIC (decl) == NULL
- && TREE_PUBLIC (decl)
- && !DECL_EXTERN_C_P (decl)
- && no_linkage_check (TREE_TYPE (decl), /*relaxed_p=*/false))
- retrofit_lang_decl (decl);
+ /* [basic.link]: A name with no linkage (notably, the name of a class
+ or enumeration declared in a local scope) shall not be used to
+ declare an entity with linkage.
+
+ DR 757 relaxes this restriction for C++0x. */
+ tree t = (cxx_dialect > cxx98 ? NULL_TREE
+ : no_linkage_check (TREE_TYPE (decl), /*relaxed_p=*/false));
+ if (t)
+ {
+ if (TYPE_ANONYMOUS_P (t))
+ {
+ if (DECL_EXTERN_C_P (decl))
+ /* Allow this; it's pretty common in C. */
+ ;
+ else
+ {
+ /* DRs 132, 319 and 389 seem to indicate types with
+ no linkage can only be used to declare extern "C"
+ entities. Since it's not always an error in the
+ ISO C++ 90 Standard, we only issue a warning. */
+ warning (0, "non-local variable %q#D uses anonymous type",
+ decl);
+ if (DECL_ORIGINAL_TYPE (TYPE_NAME (t)))
+ warning (0, "%q+#D does not refer to the unqualified "
+ "type, so it is not used for linkage",
+ TYPE_NAME (t));
+ }
+ }
+ else
+ warning (0, "non-local variable %q#D uses local type %qT", decl, t);
+ }
}
else
DECL_INTERFACE_KNOWN (decl) = 1;
@@ -7114,16 +7170,9 @@ build_ptrmem_type (tree class_type, tree member_type)
{
if (TREE_CODE (member_type) == METHOD_TYPE)
{
- tree arg_types;
-
- arg_types = TYPE_ARG_TYPES (member_type);
- class_type = (cp_build_qualified_type
- (class_type,
- cp_type_quals (TREE_TYPE (TREE_VALUE (arg_types)))));
- member_type
- = build_method_type_directly (class_type,
- TREE_TYPE (member_type),
- TREE_CHAIN (arg_types));
+ tree arg_types = TYPE_ARG_TYPES (member_type);
+ cp_cv_quals quals = cp_type_quals (TREE_TYPE (TREE_VALUE (arg_types)));
+ member_type = build_memfn_type (member_type, class_type, quals);
return build_ptrmemfunc_type (build_pointer_type (member_type));
}
else
@@ -9866,9 +9915,9 @@ grokparms (tree parmlist, tree *parms)
0 if D is not a copy constructor or copy assignment
operator.
1 if D is a copy constructor or copy assignment operator whose
- first parameter is a reference to const qualified T.
- 2 if D is a copy constructor or copy assignment operator whose
first parameter is a reference to non-const qualified T.
+ 2 if D is a copy constructor or copy assignment operator whose
+ first parameter is a reference to const qualified T.
This function can be used as a predicate. Positive values indicate
a copy constructor and nonzero values indicate a copy assignment
@@ -9977,10 +10026,6 @@ move_fn_p (const_tree d)
/* Remember any special properties of member function DECL. */
-#define DECL_DEFAULTED_IN_CLASS_P(DECL) \
- (DECL_DEFAULTED_FN (DECL) \
- && (DECL_ARTIFICIAL (DECL) || DECL_INITIALIZED_IN_CLASS_P (DECL)))
-
void
grok_special_member_properties (tree decl)
{
@@ -10007,7 +10052,7 @@ grok_special_member_properties (tree decl)
are no other parameters or else all other parameters have
default arguments. */
TYPE_HAS_INIT_REF (class_type) = 1;
- if (!DECL_DEFAULTED_IN_CLASS_P (decl))
+ if (user_provided_p (decl))
TYPE_HAS_COMPLEX_INIT_REF (class_type) = 1;
if (ctor > 1)
TYPE_HAS_CONST_INIT_REF (class_type) = 1;
@@ -10015,8 +10060,7 @@ grok_special_member_properties (tree decl)
else if (sufficient_parms_p (FUNCTION_FIRST_USER_PARMTYPE (decl)))
{
TYPE_HAS_DEFAULT_CONSTRUCTOR (class_type) = 1;
- if (TREE_CODE (decl) == TEMPLATE_DECL
- || !DECL_DEFAULTED_IN_CLASS_P (decl))
+ if (user_provided_p (decl))
TYPE_HAS_COMPLEX_DFLT (class_type) = 1;
}
else if (is_list_ctor (decl))
@@ -10035,7 +10079,7 @@ grok_special_member_properties (tree decl)
if (assop)
{
TYPE_HAS_ASSIGN_REF (class_type) = 1;
- if (!DECL_DEFAULTED_IN_CLASS_P (decl))
+ if (user_provided_p (decl))
TYPE_HAS_COMPLEX_ASSIGN_REF (class_type) = 1;
if (assop != 1)
TYPE_HAS_CONST_ASSIGN_REF (class_type) = 1;
@@ -10221,8 +10265,13 @@ grok_op_properties (tree decl, bool complain)
|| operator_code == ARRAY_REF
|| operator_code == NOP_EXPR)
{
- error ("%qD must be a nonstatic member function", decl);
- return false;
+ if (class_type && LAMBDA_TYPE_P (class_type))
+ /* Lambdas can have static op() and conv ops. */;
+ else
+ {
+ error ("%qD must be a nonstatic member function", decl);
+ return false;
+ }
}
else
{
@@ -11495,7 +11544,7 @@ lookup_enumerator (tree enumtype, tree name)
}
-/* We're defining DECL. Make sure that it's type is OK. */
+/* We're defining DECL. Make sure that its type is OK. */
static void
check_function_type (tree decl, tree current_function_parms)
@@ -11529,9 +11578,12 @@ check_function_type (tree decl, tree current_function_parms)
TREE_CHAIN (args));
else
fntype = build_function_type (void_type_node, args);
- TREE_TYPE (decl)
+ fntype
= build_exception_variant (fntype,
TYPE_RAISES_EXCEPTIONS (TREE_TYPE (decl)));
+ fntype = (cp_build_type_attribute_variant
+ (fntype, TYPE_ATTRIBUTES (TREE_TYPE (decl))));
+ TREE_TYPE (decl) = fntype;
}
else
abstract_virtuals_error (decl, TREE_TYPE (fntype));
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 3e8c0d7a99c..53f66ad73fc 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -114,20 +114,27 @@ tree
build_memfn_type (tree fntype, tree ctype, cp_cv_quals quals)
{
tree raises;
+ tree attrs;
int type_quals;
if (fntype == error_mark_node || ctype == error_mark_node)
return error_mark_node;
+ gcc_assert (TREE_CODE (fntype) == FUNCTION_TYPE
+ || TREE_CODE (fntype) == METHOD_TYPE);
+
type_quals = quals & ~TYPE_QUAL_RESTRICT;
ctype = cp_build_qualified_type (ctype, type_quals);
+ raises = TYPE_RAISES_EXCEPTIONS (fntype);
+ attrs = TYPE_ATTRIBUTES (fntype);
fntype = build_method_type_directly (ctype, TREE_TYPE (fntype),
(TREE_CODE (fntype) == METHOD_TYPE
? TREE_CHAIN (TYPE_ARG_TYPES (fntype))
: TYPE_ARG_TYPES (fntype)));
- raises = TYPE_RAISES_EXCEPTIONS (fntype);
if (raises)
fntype = build_exception_variant (fntype, raises);
+ if (attrs)
+ fntype = cp_build_type_attribute_variant (fntype, attrs);
return fntype;
}
@@ -237,6 +244,9 @@ maybe_retrofit_in_chrg (tree fn)
if (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn)))
fntype = build_exception_variant (fntype,
TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn)));
+ if (TYPE_ATTRIBUTES (TREE_TYPE (fn)))
+ fntype = (cp_build_type_attribute_variant
+ (fntype, TYPE_ATTRIBUTES (TREE_TYPE (fn))));
TREE_TYPE (fn) = fntype;
/* Now we've got the in-charge parameter. */
@@ -862,9 +872,7 @@ grokfield (const cp_declarator *declarator,
}
else if (init == ridpointers[(int)RID_DEFAULT])
{
- if (!defaultable_fn_p (value))
- error ("%qD cannot be defaulted", value);
- else
+ if (defaultable_fn_check (value))
{
DECL_DEFAULTED_FN (value) = 1;
DECL_INITIALIZED_IN_CLASS_P (value) = 1;
@@ -1221,6 +1229,8 @@ cp_reconstruct_complex_type (tree type, tree bottom)
else
return bottom;
+ if (TYPE_ATTRIBUTES (type))
+ outer = cp_build_type_attribute_variant (outer, TYPE_ATTRIBUTES (type));
return cp_build_qualified_type (outer, TYPE_QUALS (type));
}
@@ -3312,6 +3322,7 @@ cxx_callgraph_analyze_expr (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED)
mark_decl_referenced (vtbl);
}
else if (DECL_CONTEXT (t)
+ && flag_use_repository
&& TREE_CODE (DECL_CONTEXT (t)) == FUNCTION_DECL)
/* If we need a static variable in a function, then we
need the containing function. */
@@ -3992,7 +4003,8 @@ mark_used (tree decl)
o the variable or function has extern "C" linkage (7.5 [dcl.link]), or
o the variable or function is not used (3.2 [basic.def.odr]) or is
defined in the same translation unit. */
- if (decl_linkage (decl) != lk_none
+ if (cxx_dialect > cxx98
+ && decl_linkage (decl) != lk_none
&& !DECL_EXTERN_C_P (decl)
&& !DECL_ARTIFICIAL (decl)
&& !decl_defined_p (decl)
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index b50704a3ae4..f4232075119 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -311,7 +311,13 @@ dump_template_bindings (tree parms, tree args, VEC(tree,gc)* typenames)
pp_equal (cxx_pp);
pp_cxx_whitespace (cxx_pp);
if (arg)
- dump_template_argument (arg, TFF_PLAIN_IDENTIFIER);
+ {
+ if (ARGUMENT_PACK_P (arg))
+ pp_cxx_left_brace (cxx_pp);
+ dump_template_argument (arg, TFF_PLAIN_IDENTIFIER);
+ if (ARGUMENT_PACK_P (arg))
+ pp_cxx_right_brace (cxx_pp);
+ }
else
pp_string (cxx_pp, M_("<missing>"));
@@ -460,8 +466,11 @@ dump_type (tree t, int flags)
break;
case UNBOUND_CLASS_TEMPLATE:
- dump_type (TYPE_CONTEXT (t), flags);
- pp_cxx_colon_colon (cxx_pp);
+ if (! (flags & TFF_UNQUALIFIED_NAME))
+ {
+ dump_type (TYPE_CONTEXT (t), flags);
+ pp_cxx_colon_colon (cxx_pp);
+ }
pp_cxx_ws_string (cxx_pp, "template");
dump_type (DECL_NAME (TYPE_NAME (t)), flags);
break;
@@ -941,7 +950,9 @@ dump_decl (tree t, int flags)
break;
case SCOPE_REF:
- pp_expression (cxx_pp, t);
+ dump_type (TREE_OPERAND (t, 0), flags);
+ pp_string (cxx_pp, "::");
+ dump_decl (TREE_OPERAND (t, 1), flags|TFF_UNQUALIFIED_NAME);
break;
case ARRAY_REF:
@@ -2213,6 +2224,9 @@ dump_expr (tree t, int flags)
break;
case SCOPE_REF:
+ dump_decl (t, flags);
+ break;
+
case EXPR_PACK_EXPANSION:
case TYPEID_EXPR:
case MEMBER_REF:
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 1e08465195c..7489665bfa8 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -105,10 +105,6 @@ typedef struct GTY(()) globals {
static GTY (()) globals G;
-/* Whether or not to pretend that a static function is in an anonymous
- namespace. */
-static bool fake_anon_scope;
-
/* The obstack on which we build mangled names. */
static struct obstack *mangle_obstack;
@@ -217,6 +213,7 @@ static void write_discriminator (const int);
static void write_local_name (tree, const tree, const tree);
static void dump_substitution_candidates (void);
static tree mangle_decl_string (const tree);
+static int local_class_index (tree);
/* Control functions. */
@@ -733,20 +730,6 @@ write_encoding (const tree decl)
}
}
-/* Since we now use strcmp to compare typeinfos on all targets because of
- the RTLD_LOCAL problem, we need to munge the typeinfo name used for
- local classes of static functions to fix g++.dg/abi/local1.C. We do
- that by pretending that the function is in an anonymous namespace. */
-
-static bool
-needs_fake_anon (const_tree decl)
-{
- /* Pretend there's an anonymous namespace right around a static
- function if we're mangling for RTTI. */
- return (fake_anon_scope && !TREE_PUBLIC (decl)
- && TREE_CODE (decl) == FUNCTION_DECL);
-}
-
/* Lambdas can have a bit more context for mangling, specifically VAR_DECL
or PARM_DECL context, which doesn't belong in DECL_CONTEXT. */
@@ -790,18 +773,13 @@ write_name (tree decl, const int ignore_local_scope)
context = decl_mangling_context (decl);
- gcc_assert (context != NULL_TREE);
-
- /* If we need a fake anonymous namespace, force the nested name path. */
- if (needs_fake_anon (decl) && context == global_namespace)
- context = error_mark_node;
-
/* A decl in :: or ::std scope is treated specially. The former is
mangled using <unscoped-name> or <unscoped-template-name>, the
latter with a special substitution. Also, a name that is
directly in a local function scope is also mangled with
<unscoped-name> rather than a full <nested-name>. */
- if (context == global_namespace
+ if (context == NULL
+ || context == global_namespace
|| DECL_NAMESPACE_STD_P (context)
|| (ignore_local_scope && TREE_CODE (context) == FUNCTION_DECL))
{
@@ -819,9 +797,6 @@ write_name (tree decl, const int ignore_local_scope)
}
else
{
- if (context == error_mark_node)
- context = global_namespace;
-
/* Handle local names, unless we asked not to (that is, invoked
under <local-name>, to handle only the part of the name under
the local scope). */
@@ -834,10 +809,10 @@ write_name (tree decl, const int ignore_local_scope)
directly in that function's scope, either decl or one of
its enclosing scopes. */
tree local_entity = decl;
- while (context != global_namespace)
+ while (context != NULL && context != global_namespace)
{
/* Make sure we're always dealing with decls. */
- if (TYPE_P (context))
+ if (context != NULL && TYPE_P (context))
context = TYPE_NAME (context);
/* Is this a function? */
if (TREE_CODE (context) == FUNCTION_DECL
@@ -882,6 +857,7 @@ write_unscoped_name (const tree decl)
/* If not, it should be either in the global namespace, or directly
in a local function scope. */
gcc_assert (context == global_namespace
+ || context != NULL
|| TREE_CODE (context) == FUNCTION_DECL);
write_unqualified_name (decl);
@@ -953,9 +929,6 @@ write_nested_name (const tree decl)
{
/* No, just use <prefix> */
write_prefix (DECL_CONTEXT (decl));
- if (needs_fake_anon (decl))
- /* Pretend this static function is in an anonymous namespace. */
- write_source_name (get_anonymous_namespace_name ());
write_unqualified_name (decl);
}
write_char ('E');
@@ -1204,8 +1177,7 @@ write_unqualified_name (const tree decl)
tree type = TREE_TYPE (decl);
if (TREE_CODE (decl) == TYPE_DECL
- && TYPE_ANONYMOUS_P (type)
- && !ANON_UNION_TYPE_P (type))
+ && TYPE_ANONYMOUS_P (type))
write_unnamed_type_name (type);
else if (TREE_CODE (decl) == TYPE_DECL
&& LAMBDA_TYPE_P (type))
@@ -1252,14 +1224,48 @@ write_compact_number (int num)
write_char ('_');
}
+/* Return how many unnamed types precede TYPE in its enclosing class. */
+
+static int
+nested_anon_class_index (tree type)
+{
+ int index = 0;
+ tree member = TYPE_FIELDS (TYPE_CONTEXT (type));
+ for (; member; member = TREE_CHAIN (member))
+ if (DECL_IMPLICIT_TYPEDEF_P (member))
+ {
+ tree memtype = TREE_TYPE (member);
+ if (memtype == type)
+ return index;
+ else if (TYPE_ANONYMOUS_P (memtype))
+ ++index;
+ }
+
+ gcc_unreachable ();
+}
+
+/* <unnamed-type-name> ::= Ut [ <nonnegative number> ] _ */
+
static void
write_unnamed_type_name (const tree type __attribute__ ((__unused__)))
{
+ int discriminator;
MANGLE_TRACE_TREE ("unnamed-type-name", type);
+ if (TYPE_FUNCTION_SCOPE_P (type))
+ discriminator = local_class_index (type);
+ else if (TYPE_CLASS_SCOPE_P (type))
+ discriminator = nested_anon_class_index (type);
+ else
+ {
+ gcc_assert (no_linkage_check (type, /*relaxed_p=*/true));
+ /* Just use the old mangling at namespace scope. */
+ write_source_name (TYPE_IDENTIFIER (type));
+ return;
+ }
+
write_string ("Ut");
- /* TODO: Implement discriminators for unnamed-types. */
- write_char ('_');
+ write_compact_number (discriminator);
}
/* <closure-type-name> ::= Ul <lambda-sig> E [ <nonnegative number> ] _
@@ -1275,7 +1281,7 @@ write_closure_type_name (const tree type)
MANGLE_TRACE_TREE ("closure-type-name", type);
write_string ("Ul");
- write_method_parms (parms, /*method_p=*/1, fn);
+ write_method_parms (parms, DECL_NONSTATIC_MEMBER_FUNCTION_P (fn), fn);
write_char ('E');
write_compact_number (LAMBDA_EXPR_DISCRIMINATOR (lambda));
}
@@ -1539,6 +1545,29 @@ write_special_name_destructor (const tree dtor)
}
}
+/* Scan the vector of local classes and return how many others with the
+ same name (or same no name) and context precede ENTITY. */
+
+static int
+local_class_index (tree entity)
+{
+ int ix, discriminator = 0;
+ tree name = (TYPE_ANONYMOUS_P (entity) ? NULL_TREE
+ : TYPE_IDENTIFIER (entity));
+ tree ctx = TYPE_CONTEXT (entity);
+ for (ix = 0; ; ix++)
+ {
+ tree type = VEC_index (tree, local_classes, ix);
+ if (type == entity)
+ return discriminator;
+ if (TYPE_CONTEXT (type) == ctx
+ && (name ? TYPE_IDENTIFIER (type) == name
+ : TYPE_ANONYMOUS_P (type)))
+ ++discriminator;
+ }
+ gcc_unreachable ();
+}
+
/* Return the discriminator for ENTITY appearing inside
FUNCTION. The discriminator is the lexical ordinal of VAR among
entities with the same name in the same FUNCTION. */
@@ -1546,15 +1575,17 @@ write_special_name_destructor (const tree dtor)
static int
discriminator_for_local_entity (tree entity)
{
- /* Assume this is the only local entity with this name. */
- int discriminator = 0;
-
- if (DECL_DISCRIMINATOR_P (entity) && DECL_LANG_SPECIFIC (entity))
- discriminator = DECL_DISCRIMINATOR (entity);
+ if (DECL_DISCRIMINATOR_P (entity))
+ {
+ if (DECL_LANG_SPECIFIC (entity))
+ return DECL_DISCRIMINATOR (entity);
+ else
+ /* The first entity with a particular name doesn't get
+ DECL_LANG_SPECIFIC/DECL_DISCRIMINATOR. */
+ return 0;
+ }
else if (TREE_CODE (entity) == TYPE_DECL)
{
- int ix;
-
/* Scan the list of local classes. */
entity = TREE_TYPE (entity);
@@ -1562,18 +1593,10 @@ discriminator_for_local_entity (tree entity)
if (LAMBDA_TYPE_P (entity) || TYPE_ANONYMOUS_P (entity))
return 0;
- for (ix = 0; ; ix++)
- {
- tree type = VEC_index (tree, local_classes, ix);
- if (type == entity)
- break;
- if (TYPE_IDENTIFIER (type) == TYPE_IDENTIFIER (entity)
- && TYPE_CONTEXT (type) == TYPE_CONTEXT (entity))
- ++discriminator;
- }
+ return local_class_index (entity);
}
-
- return discriminator;
+ else
+ gcc_unreachable ();
}
/* Return the discriminator for STRING, a string literal used inside
@@ -2233,21 +2256,22 @@ write_class_enum_type (const tree type)
/* Non-terminal <template-args>. ARGS is a TREE_VEC of template
arguments.
- <template-args> ::= I <template-arg>+ E */
+ <template-args> ::= I <template-arg>* E */
static void
write_template_args (tree args)
{
int i;
- int length = TREE_VEC_LENGTH (args);
+ int length = 0;
MANGLE_TRACE_TREE ("template-args", args);
write_char ('I');
- gcc_assert (length > 0);
+ if (args)
+ length = TREE_VEC_LENGTH (args);
- if (TREE_CODE (TREE_VEC_ELT (args, 0)) == TREE_VEC)
+ if (args && TREE_CODE (TREE_VEC_ELT (args, 0)) == TREE_VEC)
{
/* We have nested template args. We want the innermost template
argument list. */
@@ -2907,7 +2931,7 @@ finish_mangling_get_identifier (const bool warn)
finish_mangling_internal (warn);
/* Don't obstack_finish here, and the next start_mangling will
remove the identifier. */
- return get_identifier ((const char *) name_base);
+ return get_identifier ((const char *) obstack_base (mangle_obstack));
}
/* Initialize data structures for mangling. */
@@ -2960,18 +2984,15 @@ mangle_decl (const tree decl)
SET_DECL_ASSEMBLER_NAME (decl, id);
}
-/* Generate the mangled representation of TYPE for the typeinfo name. */
+/* Generate the mangled representation of TYPE. */
const char *
-mangle_type_string_for_rtti (const tree type)
+mangle_type_string (const tree type)
{
const char *result;
start_mangling (type);
- /* Mangle in a fake anonymous namespace if necessary. */
- fake_anon_scope = true;
write_type (type);
- fake_anon_scope = false;
result = finish_mangling (/*warn=*/false);
if (DEBUG_MANGLE)
fprintf (stderr, "mangle_type_string = '%s'\n\n", result);
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index e8b28d877d7..47f9e424dbd 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -378,7 +378,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
DECL_VISIBILITY (thunk_fndecl) = DECL_VISIBILITY (function);
DECL_VISIBILITY_SPECIFIED (thunk_fndecl)
= DECL_VISIBILITY_SPECIFIED (function);
- if (DECL_ONE_ONLY (function))
+ if (DECL_ONE_ONLY (function) || DECL_WEAK (function))
make_decl_one_only (thunk_fndecl, cxx_comdat_group (thunk_fndecl));
if (flag_syntax_only)
@@ -622,6 +622,7 @@ do_build_copy_constructor (tree fndecl)
if (DECL_MUTABLE_P (field))
quals &= ~TYPE_QUAL_CONST;
+ quals |= TYPE_QUALS (expr_type);
expr_type = cp_build_qualified_type (expr_type, quals);
}
@@ -1130,6 +1131,88 @@ implicitly_declare_fn (special_function_kind kind, tree type, bool const_p)
return fn;
}
+/* Gives any errors about defaulted functions which need to be deferred
+ until the containing class is complete. */
+
+void
+defaulted_late_check (tree fn)
+{
+ /* Complain about invalid signature for defaulted fn. */
+ tree ctx = DECL_CONTEXT (fn);
+ special_function_kind kind = special_function_p (fn);
+ bool fn_const_p = (copy_fn_p (fn) == 2);
+ tree implicit_fn = implicitly_declare_fn (kind, ctx, fn_const_p);
+
+ if (!same_type_p (TREE_TYPE (TREE_TYPE (fn)),
+ TREE_TYPE (TREE_TYPE (implicit_fn)))
+ || !compparms (TYPE_ARG_TYPES (TREE_TYPE (fn)),
+ TYPE_ARG_TYPES (TREE_TYPE (implicit_fn))))
+ {
+ error ("defaulted declaration %q+D", fn);
+ error_at (DECL_SOURCE_LOCATION (fn),
+ "does not match expected signature %qD", implicit_fn);
+ }
+}
+
+/* Returns true iff FN can be explicitly defaulted, and gives any
+ errors if defaulting FN is ill-formed. */
+
+bool
+defaultable_fn_check (tree fn)
+{
+ special_function_kind kind = sfk_none;
+
+ if (DECL_CONSTRUCTOR_P (fn))
+ {
+ if (FUNCTION_FIRST_USER_PARMTYPE (fn) == void_list_node)
+ kind = sfk_constructor;
+ else if (copy_fn_p (fn) > 0
+ && (TREE_CHAIN (FUNCTION_FIRST_USER_PARMTYPE (fn))
+ == void_list_node))
+ kind = sfk_copy_constructor;
+ else if (move_fn_p (fn))
+ kind = sfk_move_constructor;
+ }
+ else if (DECL_DESTRUCTOR_P (fn))
+ kind = sfk_destructor;
+ else if (DECL_ASSIGNMENT_OPERATOR_P (fn)
+ && DECL_OVERLOADED_OPERATOR_P (fn) == NOP_EXPR
+ && copy_fn_p (fn))
+ kind = sfk_assignment_operator;
+
+ if (kind == sfk_none)
+ {
+ error ("%qD cannot be defaulted", fn);
+ return false;
+ }
+ else
+ {
+ tree t = FUNCTION_FIRST_USER_PARMTYPE (fn);
+ for (; t && t != void_list_node; t = TREE_CHAIN (t))
+ if (TREE_PURPOSE (t))
+ {
+ error ("defaulted function %q+D with default argument", fn);
+ break;
+ }
+ if (TYPE_BEING_DEFINED (DECL_CONTEXT (fn)))
+ {
+ if (DECL_NONCONVERTING_P (fn))
+ error ("%qD declared explicit cannot be defaulted in the class "
+ "body", fn);
+ if (current_access_specifier != access_public_node)
+ error ("%qD declared with non-public access cannot be defaulted "
+ "in the class body", fn);
+ if (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn)))
+ error ("function %q+D defaulted on its first declaration "
+ "must not have an exception-specification", fn);
+ }
+ else if (!processing_template_decl)
+ defaulted_late_check (fn);
+
+ return true;
+ }
+}
+
/* Add an implicit declaration to TYPE for the kind of function
indicated by SFK. Return the FUNCTION_DECL for the new implicit
declaration. */
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 459e7390805..14f97873484 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -62,14 +62,19 @@ static GTY(()) tree anonymous_namespace_name;
/* Initialize anonymous_namespace_name if necessary, and return it. */
-tree
+static tree
get_anonymous_namespace_name (void)
{
if (!anonymous_namespace_name)
{
/* The anonymous namespace has to have a unique name
if typeinfo objects are being compared by name. */
- anonymous_namespace_name = get_file_function_name ("N");
+ if (! flag_weak || ! SUPPORTS_ONE_ONLY)
+ anonymous_namespace_name = get_file_function_name ("N");
+ else
+ /* The demangler expects anonymous namespaces to be called
+ something starting with '_GLOBAL__N_'. */
+ anonymous_namespace_name = get_identifier ("_GLOBAL__N_1");
}
return anonymous_namespace_name;
}
@@ -3062,7 +3067,7 @@ set_namespace_binding (tree name, tree scope, tree val)
void
set_decl_namespace (tree decl, tree scope, bool friendp)
{
- tree old, fn;
+ tree old;
/* Get rid of namespace aliases. */
scope = ORIGINAL_NAMESPACE (scope);
@@ -3087,17 +3092,25 @@ set_decl_namespace (tree decl, tree scope, bool friendp)
if (old == error_mark_node)
/* No old declaration at all. */
goto complain;
+ /* If it's a TREE_LIST, the result of the lookup was ambiguous. */
+ if (TREE_CODE (old) == TREE_LIST)
+ {
+ error ("reference to %qD is ambiguous", decl);
+ print_candidates (old);
+ return;
+ }
if (!is_overloaded_fn (decl))
- /* Don't compare non-function decls with decls_match here, since
- it can't check for the correct constness at this
- point. pushdecl will find those errors later. */
- return;
+ {
+ /* We might have found OLD in an inline namespace inside SCOPE. */
+ DECL_CONTEXT (decl) = DECL_CONTEXT (old);
+ /* Don't compare non-function decls with decls_match here, since
+ it can't check for the correct constness at this
+ point. pushdecl will find those errors later. */
+ return;
+ }
/* Since decl is a function, old should contain a function decl. */
if (!is_overloaded_fn (old))
goto complain;
- fn = OVL_CURRENT (old);
- if (!is_associated_namespace (scope, CP_DECL_CONTEXT (fn)))
- goto complain;
/* A template can be explicitly specialized in any namespace. */
if (processing_explicit_instantiation)
return;
@@ -3113,12 +3126,43 @@ set_decl_namespace (tree decl, tree scope, bool friendp)
return;
if (is_overloaded_fn (old))
{
- for (; old; old = OVL_NEXT (old))
- if (decls_match (decl, OVL_CURRENT (old)))
+ tree found = NULL_TREE;
+ tree elt = old;
+ for (; elt; elt = OVL_NEXT (elt))
+ {
+ tree ofn = OVL_CURRENT (elt);
+ /* Adjust DECL_CONTEXT first so decls_match will return true
+ if DECL will match a declaration in an inline namespace. */
+ DECL_CONTEXT (decl) = DECL_CONTEXT (ofn);
+ if (decls_match (decl, ofn))
+ {
+ if (found && !decls_match (found, ofn))
+ {
+ DECL_CONTEXT (decl) = FROB_CONTEXT (scope);
+ error ("reference to %qD is ambiguous", decl);
+ print_candidates (old);
+ return;
+ }
+ found = ofn;
+ }
+ }
+ if (found)
+ {
+ if (!is_associated_namespace (scope, CP_DECL_CONTEXT (found)))
+ goto complain;
+ DECL_CONTEXT (decl) = DECL_CONTEXT (found);
return;
+ }
}
- else if (decls_match (decl, old))
- return;
+ else
+ {
+ DECL_CONTEXT (decl) = DECL_CONTEXT (old);
+ if (decls_match (decl, old))
+ return;
+ }
+
+ /* It didn't work, go back to the explicit scope. */
+ DECL_CONTEXT (decl) = FROB_CONTEXT (scope);
complain:
error ("%qD should have been declared inside %qD", decl, scope);
}
@@ -3175,7 +3219,7 @@ handle_namespace_attrs (tree ns, tree attributes)
"%qD attribute is meaningless since members of the "
"anonymous namespace get local symbols", name);
- push_visibility (TREE_STRING_POINTER (x));
+ push_visibility (TREE_STRING_POINTER (x), 1);
saw_vis = true;
}
else
@@ -3757,10 +3801,9 @@ qualify_lookup (tree val, int flags)
return true;
if (flags & (LOOKUP_PREFER_NAMESPACES | LOOKUP_PREFER_TYPES))
return false;
- /* In unevaluated context, look past capture fields. */
- /* FIXME this will cause trouble with the initializer extension. */
+ /* In unevaluated context, look past normal capture fields. */
if (cp_unevaluated_operand && TREE_CODE (val) == FIELD_DECL
- && LAMBDA_TYPE_P (DECL_CONTEXT (val)))
+ && DECL_NORMAL_CAPTURE_P (val))
return false;
return true;
}
@@ -3926,6 +3969,19 @@ lookup_using_namespace (tree name, struct scope_binding *val,
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, val->value != error_mark_node);
}
+/* Returns true iff VEC contains TARGET. */
+
+static bool
+tree_vec_contains (VEC(tree,gc)* vec, tree target)
+{
+ unsigned int i;
+ tree elt;
+ for (i = 0; VEC_iterate(tree,vec,i,elt); ++i)
+ if (elt == target)
+ return true;
+ return false;
+}
+
/* [namespace.qual]
Accepts the NAME to lookup and its qualifying SCOPE.
Returns the name/type pair found into the cxx_binding *RESULT,
@@ -3936,62 +3992,72 @@ qualified_lookup_using_namespace (tree name, tree scope,
struct scope_binding *result, int flags)
{
/* Maintain a list of namespaces visited... */
- tree seen = NULL_TREE;
+ VEC(tree,gc) *seen = NULL;
+ VEC(tree,gc) *seen_inline = NULL;
/* ... and a list of namespace yet to see. */
- tree todo = NULL_TREE;
- tree todo_maybe = NULL_TREE;
- tree *todo_weak = &todo_maybe;
+ VEC(tree,gc) *todo = NULL;
+ VEC(tree,gc) *todo_maybe = NULL;
+ VEC(tree,gc) *todo_inline = NULL;
tree usings;
timevar_push (TV_NAME_LOOKUP);
/* Look through namespace aliases. */
scope = ORIGINAL_NAMESPACE (scope);
- while (scope && result->value != error_mark_node)
+
+ /* Algorithm: Starting with SCOPE, walk through the the set of used
+ namespaces. For each used namespace, look through its inline
+ namespace set for any bindings and usings. If no bindings are found,
+ add any usings seen to the set of used namespaces. */
+ VEC_safe_push (tree, gc, todo, scope);
+
+ while (VEC_length (tree, todo))
{
- cxx_binding *binding =
- cxx_scope_find_binding_for_name (NAMESPACE_LEVEL (scope), name);
- seen = tree_cons (scope, NULL_TREE, seen);
- if (binding)
- ambiguous_decl (result, binding, flags);
-
- /* Consider strong using directives always, and non-strong ones
- if we haven't found a binding yet. */
- for (usings = DECL_NAMESPACE_USING (scope); usings;
- usings = TREE_CHAIN (usings))
- /* If this was a real directive, and we have not seen it. */
- if (!TREE_INDIRECT_USING (usings))
- {
- /* Try to avoid queuing the same namespace more than once,
- the exception being when a namespace was already
- enqueued for todo_maybe and then a strong using is
- found for it. We could try to remove it from
- todo_maybe, but it's probably not worth the effort. */
- if (is_associated_namespace (scope, TREE_PURPOSE (usings))
- && !purpose_member (TREE_PURPOSE (usings), seen)
- && !purpose_member (TREE_PURPOSE (usings), todo))
- todo = tree_cons (TREE_PURPOSE (usings), NULL_TREE, todo);
- else if (!binding
- && !purpose_member (TREE_PURPOSE (usings), seen)
- && !purpose_member (TREE_PURPOSE (usings), todo)
- && !purpose_member (TREE_PURPOSE (usings), todo_maybe))
- *todo_weak = tree_cons (TREE_PURPOSE (usings), NULL_TREE,
- *todo_weak);
- }
- if (todo)
- {
- scope = TREE_PURPOSE (todo);
- todo = TREE_CHAIN (todo);
- }
- else if (todo_maybe
- && (!result->value && !result->type))
+ bool found_here;
+ scope = VEC_pop (tree, todo);
+ if (tree_vec_contains (seen, scope))
+ continue;
+ VEC_safe_push (tree, gc, seen, scope);
+ VEC_safe_push (tree, gc, todo_inline, scope);
+
+ found_here = false;
+ while (VEC_length (tree, todo_inline))
{
- scope = TREE_PURPOSE (todo_maybe);
- todo = TREE_CHAIN (todo_maybe);
- todo_maybe = NULL_TREE;
- todo_weak = &todo;
+ cxx_binding *binding;
+
+ scope = VEC_pop (tree, todo_inline);
+ if (tree_vec_contains (seen_inline, scope))
+ continue;
+ VEC_safe_push (tree, gc, seen_inline, scope);
+
+ binding =
+ cxx_scope_find_binding_for_name (NAMESPACE_LEVEL (scope), name);
+ if (binding)
+ {
+ found_here = true;
+ ambiguous_decl (result, binding, flags);
+ }
+
+ for (usings = DECL_NAMESPACE_USING (scope); usings;
+ usings = TREE_CHAIN (usings))
+ if (!TREE_INDIRECT_USING (usings))
+ {
+ if (is_associated_namespace (scope, TREE_PURPOSE (usings)))
+ VEC_safe_push (tree, gc, todo_inline, TREE_PURPOSE (usings));
+ else
+ VEC_safe_push (tree, gc, todo_maybe, TREE_PURPOSE (usings));
+ }
}
+
+ if (found_here)
+ VEC_truncate (tree, todo_maybe, 0);
else
- scope = NULL_TREE; /* If there never was a todo list. */
+ while (VEC_length (tree, todo_maybe))
+ VEC_safe_push (tree, gc, todo, VEC_pop (tree, todo_maybe));
}
+ VEC_free (tree,gc,todo);
+ VEC_free (tree,gc,todo_maybe);
+ VEC_free (tree,gc,todo_inline);
+ VEC_free (tree,gc,seen);
+ VEC_free (tree,gc,seen_inline);
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, result->value != error_mark_node);
}
@@ -4499,26 +4565,15 @@ add_function (struct arg_lookup *k, tree fn)
total number of functions being compared, which should usually be the
case. */
- /* We must find only functions, or exactly one non-function. */
- if (!k->functions)
+ if (!is_overloaded_fn (fn))
+ /* All names except those of (possibly overloaded) functions and
+ function templates are ignored. */;
+ else if (!k->functions)
k->functions = fn;
else if (fn == k->functions)
;
- else if (is_overloaded_fn (k->functions) && is_overloaded_fn (fn))
- k->functions = build_overload (fn, k->functions);
else
- {
- tree f1 = OVL_CURRENT (k->functions);
- tree f2 = fn;
- if (is_overloaded_fn (f1))
- {
- fn = f1; f1 = f2; f2 = fn;
- }
- error ("%q+D is not a function,", f1);
- error (" conflict with %q+D", f2);
- error (" in call to %qD", k->name);
- return true;
- }
+ k->functions = build_overload (fn, k->functions);
return false;
}
@@ -4725,6 +4780,8 @@ arg_assoc_class (struct arg_lookup *k, tree type)
if (arg_assoc_namespace (k, context))
return true;
+ complete_type (type);
+
if (TYPE_BINFO (type))
{
/* Process baseclasses. */
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index 58d5b9001d2..662bd4a22a3 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -199,6 +199,8 @@ maybe_clone_body (tree fn)
DECL_VISIBILITY (clone) = DECL_VISIBILITY (fn);
DECL_VISIBILITY_SPECIFIED (clone) = DECL_VISIBILITY_SPECIFIED (fn);
DECL_DLLIMPORT_P (clone) = DECL_DLLIMPORT_P (fn);
+ DECL_ATTRIBUTES (clone) = copy_list (DECL_ATTRIBUTES (fn));
+ DECL_DISREGARD_INLINE_LIMITS (clone) = DECL_DISREGARD_INLINE_LIMITS (fn);
/* Adjust the parameter names and locations. */
parm = DECL_ARGUMENTS (fn);
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 210d3dda0e0..47f5f13f1d3 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -402,7 +402,7 @@ cp_lexer_get_preprocessor_token (cp_lexer *lexer, cp_token *token)
/* Get a new token from the preprocessor. */
token->type
= c_lex_with_flags (&token->u.value, &token->location, &token->flags,
- lexer == NULL ? 0 : C_LEX_RAW_STRINGS);
+ lexer == NULL ? 0 : C_LEX_STRING_NO_JOIN);
token->keyword = RID_MAX;
token->pragma_kind = PRAGMA_NONE;
@@ -792,6 +792,7 @@ cp_lexer_print_token (FILE * stream, cp_token *token)
case CPP_STRING16:
case CPP_STRING32:
case CPP_WSTRING:
+ case CPP_UTF8STRING:
fprintf (stream, " \"%s\"", TREE_STRING_POINTER (token->u.value));
break;
@@ -1194,8 +1195,12 @@ enum
/* The construct is optional. If it is not present, then no error
should be issued. */
CP_PARSER_FLAGS_OPTIONAL = 0x1,
- /* When parsing a type-specifier, do not allow user-defined types. */
- CP_PARSER_FLAGS_NO_USER_DEFINED_TYPES = 0x2
+ /* When parsing a type-specifier, treat user-defined type-names
+ as non-type identifiers. */
+ CP_PARSER_FLAGS_NO_USER_DEFINED_TYPES = 0x2,
+ /* When parsing a type-specifier, do not try to parse a class-specifier
+ or enum-specifier. */
+ CP_PARSER_FLAGS_NO_TYPE_DEFINITIONS = 0x4
};
/* This type is used for parameters and variables which hold
@@ -1741,10 +1746,11 @@ static tree cp_parser_type_id
(cp_parser *);
static tree cp_parser_template_type_arg
(cp_parser *);
+static tree cp_parser_trailing_type_id (cp_parser *);
static tree cp_parser_type_id_1
- (cp_parser *, bool);
+ (cp_parser *, bool, bool);
static void cp_parser_type_specifier_seq
- (cp_parser *, bool, cp_decl_specifier_seq *);
+ (cp_parser *, bool, bool, cp_decl_specifier_seq *);
static tree cp_parser_parameter_declaration_clause
(cp_parser *);
static tree cp_parser_parameter_declaration_list
@@ -2060,7 +2066,8 @@ cp_parser_is_string_literal (cp_token* token)
return (token->type == CPP_STRING ||
token->type == CPP_STRING16 ||
token->type == CPP_STRING32 ||
- token->type == CPP_WSTRING);
+ token->type == CPP_WSTRING ||
+ token->type == CPP_UTF8STRING);
}
/* Returns nonzero if TOKEN is the indicated KEYWORD. */
@@ -2393,6 +2400,11 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser,
if (TREE_CODE (parser->scope) == NAMESPACE_DECL)
error_at (location, "%qE in namespace %qE does not name a type",
id, parser->scope);
+ else if (TYPE_P (parser->scope)
+ && dependent_scope_p (parser->scope))
+ error_at (location, "need %<typename%> before %<%T::%E%> to name "
+ "a type in dependent scope %qT",
+ parser->scope, id, parser->scope);
else if (TYPE_P (parser->scope))
error_at (location, "%qE in class %qT does not name a type",
id, parser->scope);
@@ -2426,11 +2438,8 @@ cp_parser_parse_and_diagnose_invalid_type_name (cp_parser *parser)
/*declarator_p=*/true,
/*optional_p=*/false);
/* After the id-expression, there should be a plain identifier,
- otherwise this is not a simple variable declaration. Also, if
- the scope is dependent, we cannot do much. */
+ otherwise this is not a simple variable declaration. */
if (!cp_lexer_next_token_is (parser->lexer, CPP_NAME)
- || (parser->scope && TYPE_P (parser->scope)
- && dependent_type_p (parser->scope))
|| TREE_CODE (id) == TYPE_DECL)
{
cp_parser_abort_tentative_parse (parser);
@@ -2999,6 +3008,7 @@ cp_parser_string_literal (cp_parser *parser, bool translate, bool wide_ok)
{
default:
case CPP_STRING:
+ case CPP_UTF8STRING:
TREE_TYPE (value) = char_array_type_node;
break;
case CPP_STRING16:
@@ -3228,6 +3238,7 @@ cp_parser_primary_expression (cp_parser *parser,
case CPP_STRING16:
case CPP_STRING32:
case CPP_WSTRING:
+ case CPP_UTF8STRING:
/* ??? Should wide strings be allowed when parser->translate_strings_p
is false (i.e. in attributes)? If not, we can kill the third
argument to cp_parser_string_literal. */
@@ -5794,7 +5805,8 @@ cp_parser_new_type_id (cp_parser* parser, tree *nelts)
parser->type_definition_forbidden_message
= "types may not be defined in a new-type-id";
/* Parse the type-specifier-seq. */
- cp_parser_type_specifier_seq (parser, /*is_condition=*/false,
+ cp_parser_type_specifier_seq (parser, /*is_declaration=*/false,
+ /*is_trailing_return=*/false,
&type_specifier_seq);
/* Restore the old message. */
parser->type_definition_forbidden_message = saved_message;
@@ -6955,8 +6967,8 @@ cp_parser_trait_expr (cp_parser* parser, enum rid keyword)
/* Lambdas that appear in variable initializer or default argument scope
get that in their mangling, so we need to record it. We might as well
use the count for function and namespace scopes as well. */
-static tree lambda_scope;
-static int lambda_count;
+static GTY(()) tree lambda_scope;
+static GTY(()) int lambda_count;
typedef struct GTY(()) tree_int
{
tree t;
@@ -7080,6 +7092,8 @@ cp_parser_lambda_expression (cp_parser* parser)
LAMBDA_EXPR_CAPTURE_LIST (lambda_expr) = newlist;
}
+ maybe_add_lambda_conv_op (type);
+
type = finish_struct (type, /*attributes=*/NULL_TREE);
parser->num_template_parameter_lists = saved_num_template_parameter_lists;
@@ -7125,6 +7139,7 @@ cp_parser_lambda_introducer (cp_parser* parser, tree lambda_expr)
tree capture_id;
tree capture_init_expr;
cp_id_kind idk = CP_ID_KIND_NONE;
+ bool explicit_init_p = false;
enum capture_kind_type
{
@@ -7151,7 +7166,8 @@ cp_parser_lambda_introducer (cp_parser* parser, tree lambda_expr)
add_capture (lambda_expr,
/*id=*/get_identifier ("__this"),
/*initializer=*/finish_this_expr(),
- /*by_reference_p=*/false);
+ /*by_reference_p=*/false,
+ explicit_init_p);
continue;
}
@@ -7176,7 +7192,7 @@ cp_parser_lambda_introducer (cp_parser* parser, tree lambda_expr)
/*recovering=*/true,
/*or_comma=*/true,
/*consume_paren=*/true);
- continue;
+ break;
}
/* Find the initializer for this capture. */
@@ -7190,6 +7206,7 @@ cp_parser_lambda_introducer (cp_parser* parser, tree lambda_expr)
capture_init_expr = cp_parser_assignment_expression (parser,
/*cast_p=*/true,
&idk);
+ explicit_init_p = true;
}
else
{
@@ -7231,7 +7248,8 @@ cp_parser_lambda_introducer (cp_parser* parser, tree lambda_expr)
add_capture (lambda_expr,
capture_id,
capture_init_expr,
- /*by_reference_p=*/capture_kind == BY_REFERENCE);
+ /*by_reference_p=*/capture_kind == BY_REFERENCE,
+ explicit_init_p);
}
cp_parser_require (parser, CPP_CLOSE_SQUARE, "%<]%>");
@@ -7333,15 +7351,25 @@ cp_parser_lambda_declarator_opt (cp_parser* parser, tree lambda_expr)
declarator = make_id_declarator (NULL_TREE, ansi_opname (CALL_EXPR),
sfk_none);
- quals = (LAMBDA_EXPR_MUTABLE_P (lambda_expr)
- ? TYPE_UNQUALIFIED : TYPE_QUAL_CONST);
+ quals = TYPE_UNQUALIFIED;
+ if (LAMBDA_EXPR_CAPTURE_LIST (lambda_expr) == NULL_TREE
+ && LAMBDA_EXPR_DEFAULT_CAPTURE_MODE (lambda_expr) == CPLD_NONE)
+ {
+ /* A lambda with no captures has a static op() and a conversion op
+ to function type. */
+ if (LAMBDA_EXPR_MUTABLE_P (lambda_expr))
+ error ("lambda expression with no captures declared mutable");
+ return_type_specs.storage_class = sc_static;
+ }
+ else if (!LAMBDA_EXPR_MUTABLE_P (lambda_expr))
+ quals = TYPE_QUAL_CONST;
declarator = make_call_declarator (declarator, param_list, quals,
exception_spec,
/*late_return_type=*/NULL_TREE);
fco = grokmethod (&return_type_specs,
- declarator,
- attributes);
+ declarator,
+ attributes);
DECL_INITIALIZED_IN_CLASS_P (fco) = 1;
DECL_ARTIFICIAL (fco) = 1;
@@ -7734,12 +7762,21 @@ static tree
cp_parser_expression_statement (cp_parser* parser, tree in_statement_expr)
{
tree statement = NULL_TREE;
+ cp_token *token = cp_lexer_peek_token (parser->lexer);
/* If the next token is a ';', then there is no expression
statement. */
if (cp_lexer_next_token_is_not (parser->lexer, CPP_SEMICOLON))
statement = cp_parser_expression (parser, /*cast_p=*/false, NULL);
+ /* Give a helpful message for "A<T>::type t;" */
+ if (cp_lexer_next_token_is_not (parser->lexer, CPP_SEMICOLON)
+ && !cp_parser_uncommitted_to_tentative_parse_p (parser)
+ && TREE_CODE (statement) == SCOPE_REF)
+ error_at (token->location, "need %<typename%> before %qE to name "
+ "a type in dependent scope %qT",
+ statement, TREE_OPERAND (statement, 0));
+
/* Consume the final `;'. */
cp_parser_consume_semicolon_at_end_of_statement (parser);
@@ -8023,7 +8060,8 @@ cp_parser_condition (cp_parser* parser)
parser->type_definition_forbidden_message
= "types may not be defined in conditions";
/* Parse the type-specifier-seq. */
- cp_parser_type_specifier_seq (parser, /*is_condition==*/true,
+ cp_parser_type_specifier_seq (parser, /*is_declaration==*/true,
+ /*is_trailing_return=*/false,
&type_specifiers);
/* Restore the saved message. */
parser->type_definition_forbidden_message = saved_message;
@@ -9537,12 +9575,25 @@ cp_parser_decltype (cp_parser *parser)
cp_parser_parse_definitely (parser);
else
{
+ bool saved_greater_than_is_operator_p;
+
/* Abort our attempt to parse an id-expression or member access
expression. */
cp_parser_abort_tentative_parse (parser);
+ /* Within a parenthesized expression, a `>' token is always
+ the greater-than operator. */
+ saved_greater_than_is_operator_p
+ = parser->greater_than_is_operator_p;
+ parser->greater_than_is_operator_p = true;
+
/* Parse a full expression. */
expr = cp_parser_expression (parser, /*cast_p=*/false, NULL);
+
+ /* The `>' token might be the end of a template-id or
+ template-parameter-list now. */
+ parser->greater_than_is_operator_p
+ = saved_greater_than_is_operator_p;
}
/* Go back to evaluating expressions. */
@@ -9651,7 +9702,8 @@ cp_parser_conversion_type_id (cp_parser* parser)
/* Parse the attributes. */
attributes = cp_parser_attributes_opt (parser);
/* Parse the type-specifiers. */
- cp_parser_type_specifier_seq (parser, /*is_condition=*/false,
+ cp_parser_type_specifier_seq (parser, /*is_declaration=*/false,
+ /*is_trailing_return=*/false,
&type_specifiers);
/* If that didn't work, stop. */
if (type_specifiers.type == error_mark_node)
@@ -11627,6 +11679,9 @@ cp_parser_type_specifier (cp_parser* parser,
switch (keyword)
{
case RID_ENUM:
+ if ((flags & CP_PARSER_FLAGS_NO_TYPE_DEFINITIONS))
+ goto elaborated_type_specifier;
+
/* Look for the enum-specifier. */
type_spec = cp_parser_enum_specifier (parser);
/* If that worked, we're done. */
@@ -11649,6 +11704,9 @@ cp_parser_type_specifier (cp_parser* parser,
case RID_CLASS:
case RID_STRUCT:
case RID_UNION:
+ if ((flags & CP_PARSER_FLAGS_NO_TYPE_DEFINITIONS))
+ goto elaborated_type_specifier;
+
/* Parse tentatively so that we can back up if we don't find a
class-specifier. */
cp_parser_parse_tentatively (parser);
@@ -12514,7 +12572,8 @@ cp_parser_enum_specifier (cp_parser* parser)
cp_lexer_consume_token (parser->lexer);
/* Parse the type-specifier-seq. */
- cp_parser_type_specifier_seq (parser, /*is_condition=*/false,
+ cp_parser_type_specifier_seq (parser, /*is_declaration=*/false,
+ /*is_trailing_return=*/false,
&type_specifiers);
/* At this point this is surely not elaborated type specifier. */
@@ -12798,7 +12857,7 @@ cp_parser_namespace_definition (cp_parser* parser)
#ifdef HANDLE_PRAGMA_VISIBILITY
if (has_visibility)
- pop_visibility ();
+ pop_visibility (1);
#endif
/* Finish the namespace. */
@@ -14405,7 +14464,7 @@ cp_parser_cv_qualifier_seq_opt (cp_parser* parser)
/* Parse a late-specified return type, if any. This is not a separate
non-terminal, but part of a function declarator, which looks like
- -> type-id
+ -> trailing-type-specifier-seq abstract-declarator(opt)
Returns the type indicated by the type-id. */
@@ -14423,7 +14482,7 @@ cp_parser_late_return_type_opt (cp_parser* parser)
/* Consume the ->. */
cp_lexer_consume_token (parser->lexer);
- return cp_parser_type_id (parser);
+ return cp_parser_trailing_type_id (parser);
}
/* Parse a declarator-id.
@@ -14476,13 +14535,15 @@ cp_parser_declarator_id (cp_parser* parser, bool optional_p)
Returns the TYPE specified. */
static tree
-cp_parser_type_id_1 (cp_parser* parser, bool is_template_arg)
+cp_parser_type_id_1 (cp_parser* parser, bool is_template_arg,
+ bool is_trailing_return)
{
cp_decl_specifier_seq type_specifier_seq;
cp_declarator *abstract_declarator;
/* Parse the type-specifier-seq. */
- cp_parser_type_specifier_seq (parser, /*is_condition=*/false,
+ cp_parser_type_specifier_seq (parser, /*is_declaration=*/false,
+ is_trailing_return,
&type_specifier_seq);
if (type_specifier_seq.type == error_mark_node)
return error_mark_node;
@@ -14520,12 +14581,17 @@ cp_parser_type_id_1 (cp_parser* parser, bool is_template_arg)
static tree cp_parser_type_id (cp_parser *parser)
{
- return cp_parser_type_id_1 (parser, false);
+ return cp_parser_type_id_1 (parser, false, false);
}
static tree cp_parser_template_type_arg (cp_parser *parser)
{
- return cp_parser_type_id_1 (parser, true);
+ return cp_parser_type_id_1 (parser, true, false);
+}
+
+static tree cp_parser_trailing_type_id (cp_parser *parser)
+{
+ return cp_parser_type_id_1 (parser, false, true);
}
/* Parse a type-specifier-seq.
@@ -14538,14 +14604,18 @@ static tree cp_parser_template_type_arg (cp_parser *parser)
type-specifier-seq:
attributes type-specifier-seq [opt]
- If IS_CONDITION is true, we are at the start of a "condition",
- e.g., we've just seen "if (".
+ If IS_DECLARATION is true, we are at the start of a "condition" or
+ exception-declaration, so we might be followed by a declarator-id.
+
+ If IS_TRAILING_RETURN is true, we are in a trailing-return-type,
+ i.e. we've just seen "->".
Sets *TYPE_SPECIFIER_SEQ to represent the sequence. */
static void
cp_parser_type_specifier_seq (cp_parser* parser,
- bool is_condition,
+ bool is_declaration,
+ bool is_trailing_return,
cp_decl_specifier_seq *type_specifier_seq)
{
bool seen_type_specifier = false;
@@ -14555,6 +14625,12 @@ cp_parser_type_specifier_seq (cp_parser* parser,
/* Clear the TYPE_SPECIFIER_SEQ. */
clear_decl_specs (type_specifier_seq);
+ /* In the context of a trailing return type, enum E { } is an
+ elaborated-type-specifier followed by a function-body, not an
+ enum-specifier. */
+ if (is_trailing_return)
+ flags |= CP_PARSER_FLAGS_NO_TYPE_DEFINITIONS;
+
/* Parse the type-specifiers and attributes. */
while (true)
{
@@ -14614,7 +14690,7 @@ cp_parser_type_specifier_seq (cp_parser* parser,
would be clearer just to allow a decl-specifier-seq here, and
then add a semantic restriction that if any decl-specifiers
that are not type-specifiers appear, the program is invalid. */
- if (is_condition && !is_cv_qualifier)
+ if (is_declaration && !is_cv_qualifier)
flags |= CP_PARSER_FLAGS_NO_USER_DEFINED_TYPES;
}
@@ -17265,7 +17341,8 @@ cp_parser_exception_declaration (cp_parser* parser)
= "types may not be defined in exception-declarations";
/* Parse the type-specifier-seq. */
- cp_parser_type_specifier_seq (parser, /*is_condition=*/false,
+ cp_parser_type_specifier_seq (parser, /*is_declaration=*/true,
+ /*is_trailing_return=*/false,
&type_specifiers);
/* If it's a `)', then there is no declarator. */
if (cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_PAREN))
@@ -18131,11 +18208,15 @@ cp_parser_check_template_parameters (cp_parser* parser,
template <class T> void S<T>::R<T>::f (); */
if (parser->num_template_parameter_lists < num_templates)
{
- if (declarator)
+ if (declarator && !current_function_decl)
error_at (location, "specializing member %<%T::%E%> "
"requires %<template<>%> syntax",
declarator->u.id.qualifying_scope,
declarator->u.id.unqualified_name);
+ else if (declarator)
+ error_at (location, "invalid declaration of %<%T::%E%>",
+ declarator->u.id.qualifying_scope,
+ declarator->u.id.unqualified_name);
else
error_at (location, "too few template-parameter-lists");
return false;
@@ -22038,7 +22119,8 @@ cp_parser_omp_for_loop (cp_parser *parser, tree clauses, tree *par_clauses)
cp_parser_condition, from whence the bulk of this is copied. */
cp_parser_parse_tentatively (parser);
- cp_parser_type_specifier_seq (parser, /*is_condition=*/false,
+ cp_parser_type_specifier_seq (parser, /*is_declaration=*/true,
+ /*is_trailing_return=*/false,
&type_specifiers);
if (cp_parser_parse_definitely (parser))
{
@@ -22357,7 +22439,8 @@ cp_parser_omp_for_loop (cp_parser *parser, tree clauses, tree *par_clauses)
}
collapse_err = true;
cp_parser_statement_seq_opt (parser, NULL);
- cp_parser_require (parser, CPP_CLOSE_BRACE, "%<}%>");
+ if (cp_lexer_next_token_is (parser->lexer, CPP_EOF))
+ break;
}
}
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 6b98956d6e6..dd453c526cc 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -1501,7 +1501,8 @@ iterative_hash_template_arg (tree arg, hashval_t val)
}
case PARM_DECL:
- val = iterative_hash_object (DECL_PARM_INDEX (arg), val);
+ if (!DECL_ARTIFICIAL (arg))
+ val = iterative_hash_object (DECL_PARM_INDEX (arg), val);
return iterative_hash_template_arg (TREE_TYPE (arg), val);
case TARGET_EXPR:
@@ -1640,13 +1641,20 @@ void
print_candidates (tree fns)
{
tree fn;
+ tree f;
const char *str = "candidates are:";
- for (fn = fns; fn != NULL_TREE; fn = TREE_CHAIN (fn))
+ if (is_overloaded_fn (fns))
+ {
+ for (f = fns; f; f = OVL_NEXT (f))
+ {
+ error ("%s %+#D", str, OVL_CURRENT (f));
+ str = " ";
+ }
+ }
+ else for (fn = fns; fn != NULL_TREE; fn = TREE_CHAIN (fn))
{
- tree f;
-
for (f = TREE_VALUE (fn); f; f = OVL_NEXT (f))
error ("%s %+#D", str, OVL_CURRENT (f));
str = " ";
@@ -4025,7 +4033,8 @@ check_default_tmpl_args (tree decl, tree parms, int is_primary,
else if (is_friend_decl)
msg = "default template arguments may not be used in function template friend declarations";
else if (TREE_CODE (decl) == FUNCTION_DECL && (cxx_dialect == cxx98))
- msg = "default template arguments may not be used in function templates";
+ msg = ("default template arguments may not be used in function templates "
+ "without -std=c++0x or -std=gnu++0x");
else if (is_partial)
msg = "default template arguments may not be used in partial specializations";
else
@@ -4677,6 +4686,22 @@ convert_nontype_argument_function (tree type, tree expr)
return fn;
}
+/* Subroutine of convert_nontype_argument.
+ Check if EXPR of type TYPE is a valid pointer-to-member constant.
+ Emit an error otherwise. */
+
+static bool
+check_valid_ptrmem_cst_expr (tree type, tree expr)
+{
+ STRIP_NOPS (expr);
+ if (expr && (null_ptr_cst_p (expr) || TREE_CODE (expr) == PTRMEM_CST))
+ return true;
+ error ("%qE is not a valid template argument for type %qT",
+ expr, type);
+ error ("it must be a pointer-to-member of the form `&X::Y'");
+ return false;
+}
+
/* Attempt to convert the non-type template parameter EXPR to the
indicated TYPE. If the conversion is successful, return the
converted value. If the conversion is unsuccessful, return
@@ -4976,6 +5001,11 @@ convert_nontype_argument (tree type, tree expr)
if (expr == error_mark_node)
return error_mark_node;
+ /* [temp.arg.nontype] bullet 1 says the pointer to member
+ expression must be a pointer-to-member constant. */
+ if (!check_valid_ptrmem_cst_expr (type, expr))
+ return error_mark_node;
+
/* There is no way to disable standard conversions in
resolve_address_of_overloaded_function (called by
instantiate_type). It is possible that the call succeeded by
@@ -5002,6 +5032,11 @@ convert_nontype_argument (tree type, tree expr)
qualification conversions (_conv.qual_) are applied. */
else if (TYPE_PTRMEM_P (type))
{
+ /* [temp.arg.nontype] bullet 1 says the pointer to member
+ expression must be a pointer-to-member constant. */
+ if (!check_valid_ptrmem_cst_expr (type, expr))
+ return error_mark_node;
+
expr = perform_qualification_conversions (type, expr);
if (expr == error_mark_node)
return expr;
@@ -5817,6 +5852,18 @@ template_args_equal (tree ot, tree nt)
return 0;
return 1;
}
+ else if (ot && TREE_CODE (ot) == ARGUMENT_PACK_SELECT)
+ {
+ /* We get here probably because we are in the middle of substituting
+ into the pattern of a pack expansion. In that case the
+ ARGUMENT_PACK_SELECT temporarily replaces the pack argument we are
+ interested in. So we want to use the initial pack argument for
+ the comparison. */
+ ot = ARGUMENT_PACK_SELECT_FROM_PACK (ot);
+ if (nt && TREE_CODE (nt) == ARGUMENT_PACK_SELECT)
+ nt = ARGUMENT_PACK_SELECT_FROM_PACK (nt);
+ return template_args_equal (ot, nt);
+ }
else if (TYPE_P (nt))
return TYPE_P (ot) && same_type_p (ot, nt);
else if (TREE_CODE (ot) == TREE_VEC || TYPE_P (ot))
@@ -7305,13 +7352,14 @@ instantiate_class_template (tree type)
tree typedecl;
tree pbinfo;
tree base_list;
+ unsigned int saved_maximum_field_alignment;
if (type == error_mark_node)
return error_mark_node;
if (TYPE_BEING_DEFINED (type)
|| COMPLETE_TYPE_P (type)
- || dependent_type_p (type))
+ || uses_template_parms (type))
return type;
/* Figure out which template is being instantiated. */
@@ -7365,6 +7413,9 @@ instantiate_class_template (tree type)
push_deferring_access_checks (dk_no_deferred);
push_to_top_level ();
+ /* Use #pragma pack from the template context. */
+ saved_maximum_field_alignment = maximum_field_alignment;
+ maximum_field_alignment = TYPE_PRECISION (pattern);
SET_CLASSTYPE_INTERFACE_UNKNOWN (type);
@@ -7780,6 +7831,7 @@ instantiate_class_template (tree type)
perform_typedefs_access_check (pattern, args);
perform_deferred_access_checks ();
pop_nested_class ();
+ maximum_field_alignment = saved_maximum_field_alignment;
pop_from_top_level ();
pop_deferring_access_checks ();
pop_tinst_level ();
@@ -7944,6 +7996,10 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain,
}
else if (len != my_len)
{
+ if (incomplete)
+ /* We got explicit args for some packs but not others;
+ do nothing now and try again after deduction. */
+ return t;
if (TREE_CODE (t) == TYPE_PACK_EXPANSION)
error ("mismatched argument pack lengths while expanding "
"%<%T%>",
@@ -8457,6 +8513,7 @@ tsubst_default_arguments (tree fn)
static tree
tsubst_decl (tree t, tree args, tsubst_flags_t complain)
{
+#define RETURN(EXP) do { r = (EXP); goto out; } while(0)
location_t saved_loc;
tree r = NULL_TREE;
tree in_decl = t;
@@ -8482,7 +8539,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
/* Template template parameter is treated here. */
tree new_type = tsubst (TREE_TYPE (t), args, complain, in_decl);
if (new_type == error_mark_node)
- return error_mark_node;
+ RETURN (error_mark_node);
r = copy_decl (t);
TREE_CHAIN (r) = NULL_TREE;
@@ -8513,12 +8570,12 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
complain, in_decl);
--processing_template_decl;
if (full_args == error_mark_node)
- return error_mark_node;
+ RETURN (error_mark_node);
/* If this is a default template template argument,
tsubst might not have changed anything. */
if (full_args == tmpl_args)
- return t;
+ RETURN (t);
hash = hash_tmpl_and_args (t, full_args);
spec = retrieve_specialization (t, full_args, hash);
@@ -8546,7 +8603,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
new_type = tsubst (TREE_TYPE (t), args, complain, in_decl);
--processing_template_decl;
if (new_type == error_mark_node)
- return error_mark_node;
+ RETURN (error_mark_node);
TREE_TYPE (r) = new_type;
CLASSTYPE_TI_TEMPLATE (new_type) = r;
@@ -8561,7 +8618,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
new_decl = tsubst (decl, args, complain, in_decl);
--processing_template_decl;
if (new_decl == error_mark_node)
- return error_mark_node;
+ RETURN (error_mark_node);
DECL_TEMPLATE_RESULT (r) = new_decl;
DECL_TI_TEMPLATE (new_decl) = r;
@@ -8619,7 +8676,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
dependent_p = value_dependent_expression_p (t);
--processing_template_decl;
if (!dependent_p)
- return t;
+ RETURN (t);
/* Calculate the most general template of which R is a
specialization, and the complete set of arguments used to
@@ -8710,7 +8767,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
}
type = tsubst (TREE_TYPE (t), args, complain, in_decl);
if (type == error_mark_node)
- return error_mark_node;
+ RETURN (error_mark_node);
/* We do NOT check for matching decls pushed separately at this
point, as they may not represent instantiations of this
@@ -8753,6 +8810,13 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
/* We'll re-clone as appropriate in instantiate_template. */
DECL_CLONED_FUNCTION (r) = NULL_TREE;
+ /* If we aren't complaining now, return on error before we register
+ the specialization so that we'll complain eventually. */
+ if ((complain & tf_error) == 0
+ && IDENTIFIER_OPNAME_P (DECL_NAME (r))
+ && !grok_op_properties (r, /*complain=*/false))
+ RETURN (error_mark_node);
+
/* Set up the DECL_TEMPLATE_INFO for R. There's no need to do
this in the special friend case mentioned above where
GEN_TMPL is NULL. */
@@ -8804,9 +8868,10 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
if (PRIMARY_TEMPLATE_P (gen_tmpl))
clone_function_decl (r, /*update_method_vec_p=*/0);
}
- else if (IDENTIFIER_OPNAME_P (DECL_NAME (r))
- && !grok_op_properties (r, (complain & tf_error) != 0))
- return error_mark_node;
+ else if ((complain & tf_error) != 0
+ && IDENTIFIER_OPNAME_P (DECL_NAME (r))
+ && !grok_op_properties (r, /*complain=*/true))
+ RETURN (error_mark_node);
if (DECL_FRIEND_P (t) && DECL_FRIEND_CONTEXT (t))
SET_DECL_FRIEND_CONTEXT (r,
@@ -8822,6 +8887,9 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
= remove_attribute ("visibility", DECL_ATTRIBUTES (r));
}
determine_visibility (r);
+ if (DECL_DEFAULTED_OUTSIDE_CLASS_P (r)
+ && !processing_template_decl)
+ defaulted_late_check (r);
apply_late_template_attributes (&r, DECL_ATTRIBUTES (r), 0,
args, complain, in_decl);
@@ -8847,7 +8915,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
if (spec
&& TREE_CODE (spec) == PARM_DECL
&& TREE_CODE (TREE_TYPE (spec)) != TYPE_PACK_EXPANSION)
- return spec;
+ RETURN (spec);
/* Expand the TYPE_PACK_EXPANSION that provides the types for
the parameters in this function parameter pack. */
@@ -8860,8 +8928,8 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
/* Zero-length parameter packs are boring. Just substitute
into the chain. */
if (len == 0)
- return tsubst (TREE_CHAIN (t), args, complain,
- TREE_CHAIN (t));
+ RETURN (tsubst (TREE_CHAIN (t), args, complain,
+ TREE_CHAIN (t)));
}
else
{
@@ -8951,7 +9019,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
r = copy_decl (t);
type = tsubst (TREE_TYPE (t), args, complain, in_decl);
if (type == error_mark_node)
- return error_mark_node;
+ RETURN (error_mark_node);
TREE_TYPE (r) = type;
cp_apply_type_quals_to_decl (cp_type_quals (type), r);
@@ -9014,7 +9082,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
we've copied the type for a typedef. */
type = tsubst (TREE_TYPE (t), args, complain, in_decl);
if (type == error_mark_node)
- return error_mark_node;
+ RETURN (error_mark_node);
r = TYPE_NAME (type);
break;
}
@@ -9087,7 +9155,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
DECL_INITIALIZED_P (r) = 0;
DECL_TEMPLATE_INSTANTIATED (r) = 0;
if (type == error_mark_node)
- return error_mark_node;
+ RETURN (error_mark_node);
if (TREE_CODE (type) == FUNCTION_TYPE)
{
/* It may seem that this case cannot occur, since:
@@ -9107,7 +9175,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
/* R is not yet sufficiently initialized, so we
just use its name. */
DECL_NAME (r));
- return error_mark_node;
+ RETURN (error_mark_node);
}
type = complete_type (type);
DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (r)
@@ -9203,7 +9271,9 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
default:
gcc_unreachable ();
}
+#undef RETURN
+ out:
/* Restore the file and line information. */
input_location = saved_loc;
@@ -9945,13 +10015,8 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
{
/* The type of the implicit object parameter gets its
cv-qualifiers from the FUNCTION_TYPE. */
- tree method_type;
- tree this_type = cp_build_qualified_type (TYPE_MAIN_VARIANT (r),
- cp_type_quals (type));
tree memptr;
- method_type = build_method_type_directly (this_type,
- TREE_TYPE (type),
- TYPE_ARG_TYPES (type));
+ tree method_type = build_memfn_type (type, r, cp_type_quals (type));
memptr = build_ptrmemfunc_type (build_pointer_type (method_type));
return cp_build_qualified_type_real (memptr, cp_type_quals (t),
complain);
@@ -12440,7 +12505,7 @@ tsubst_copy_and_build (tree t,
}
/* Verify that the instantiated ARGS are valid. For type arguments,
- make sure that the type is not variably modified. For non-type arguments,
+ make sure that the type's linkage is ok. For non-type arguments,
make sure they are constants if they are integral or enumerations.
Emit an error under control of COMPLAIN, and return TRUE on error. */
@@ -12461,7 +12526,33 @@ check_instantiated_arg (tree tmpl, tree t, tsubst_flags_t complain)
}
else if (TYPE_P (t))
{
- if (variably_modified_type_p (t, NULL_TREE))
+ /* [basic.link]: A name with no linkage (notably, the name
+ of a class or enumeration declared in a local scope)
+ shall not be used to declare an entity with linkage.
+ This implies that names with no linkage cannot be used as
+ template arguments
+
+ DR 757 relaxes this restriction for C++0x. */
+ tree nt = (cxx_dialect > cxx98 ? NULL_TREE
+ : no_linkage_check (t, /*relaxed_p=*/false));
+
+ if (nt)
+ {
+ /* DR 488 makes use of a type with no linkage cause
+ type deduction to fail. */
+ if (complain & tf_error)
+ {
+ if (TYPE_ANONYMOUS_P (nt))
+ error ("%qT is/uses anonymous type", t);
+ else
+ error ("template argument for %qD uses local type %qT",
+ tmpl, t);
+ }
+ return true;
+ }
+ /* In order to avoid all sorts of complications, we do not
+ allow variably-modified types as template arguments. */
+ else if (variably_modified_type_p (t, NULL_TREE))
{
if (complain & tf_error)
error ("%qT is a variably modified type", t);
@@ -12891,7 +12982,17 @@ maybe_adjust_types_for_deduction (unification_kind_t strict,
}
case DEDUCE_EXACT:
- /* There is nothing to do in this case. */
+ /* Core issue #873: Do the DR606 thing (see below) for these cases,
+ too, but here handle it by stripping the reference from PARM
+ rather than by adding it to ARG. */
+ if (TREE_CODE (*parm) == REFERENCE_TYPE
+ && TYPE_REF_IS_RVALUE (*parm)
+ && TREE_CODE (TREE_TYPE (*parm)) == TEMPLATE_TYPE_PARM
+ && cp_type_quals (TREE_TYPE (*parm)) == TYPE_UNQUALIFIED
+ && TREE_CODE (*arg) == REFERENCE_TYPE
+ && !TYPE_REF_IS_RVALUE (*arg))
+ *parm = TREE_TYPE (*parm);
+ /* Nothing else to do in this case. */
return 0;
default:
@@ -13153,9 +13254,11 @@ type_unification_real (tree tparms,
to explicitly check cxx_dialect here. */
if (TREE_PURPOSE (TREE_VEC_ELT (tparms, i)))
{
- tree arg = tsubst_template_arg
- (TREE_PURPOSE (TREE_VEC_ELT (tparms, i)),
- targs, tf_none, NULL_TREE);
+ tree parm = TREE_VALUE (TREE_VEC_ELT (tparms, i));
+ tree arg = TREE_PURPOSE (TREE_VEC_ELT (tparms, i));
+ arg = tsubst_template_arg (arg, targs, tf_none, NULL_TREE);
+ arg = convert_template_argument (parm, arg, targs, tf_none,
+ i, NULL_TREE);
if (arg == error_mark_node)
return 1;
else
@@ -13303,6 +13406,105 @@ resolve_overloaded_unification (tree tparms,
return false;
}
+/* Core DR 115: In contexts where deduction is done and fails, or in
+ contexts where deduction is not done, if a template argument list is
+ specified and it, along with any default template arguments, identifies
+ a single function template specialization, then the template-id is an
+ lvalue for the function template specialization. */
+
+tree
+resolve_nondeduced_context (tree orig_expr)
+{
+ tree expr, offset, baselink;
+ bool addr;
+
+ if (!type_unknown_p (orig_expr))
+ return orig_expr;
+
+ expr = orig_expr;
+ addr = false;
+ offset = NULL_TREE;
+ baselink = NULL_TREE;
+
+ if (TREE_CODE (expr) == ADDR_EXPR)
+ {
+ expr = TREE_OPERAND (expr, 0);
+ addr = true;
+ }
+ if (TREE_CODE (expr) == OFFSET_REF)
+ {
+ offset = expr;
+ expr = TREE_OPERAND (expr, 1);
+ }
+ if (TREE_CODE (expr) == BASELINK)
+ {
+ baselink = expr;
+ expr = BASELINK_FUNCTIONS (expr);
+ }
+
+ if (TREE_CODE (expr) == TEMPLATE_ID_EXPR)
+ {
+ int good = 0;
+ tree goodfn = NULL_TREE;
+
+ /* If we got some explicit template args, we need to plug them into
+ the affected templates before we try to unify, in case the
+ explicit args will completely resolve the templates in question. */
+
+ tree expl_subargs = TREE_OPERAND (expr, 1);
+ tree arg = TREE_OPERAND (expr, 0);
+ tree badfn = NULL_TREE;
+ tree badargs = NULL_TREE;
+
+ for (; arg; arg = OVL_NEXT (arg))
+ {
+ tree fn = OVL_CURRENT (arg);
+ tree subargs, elem;
+
+ if (TREE_CODE (fn) != TEMPLATE_DECL)
+ continue;
+
+ ++processing_template_decl;
+ subargs = get_bindings (fn, DECL_TEMPLATE_RESULT (fn),
+ expl_subargs, /*check_ret=*/false);
+ if (subargs && !any_dependent_template_arguments_p (subargs))
+ {
+ elem = instantiate_template (fn, subargs, tf_none);
+ if (elem == error_mark_node)
+ {
+ badfn = fn;
+ badargs = subargs;
+ }
+ else if (elem && (!goodfn || !decls_match (goodfn, elem)))
+ {
+ goodfn = elem;
+ ++good;
+ }
+ }
+ --processing_template_decl;
+ }
+ if (good == 1)
+ {
+ expr = goodfn;
+ if (baselink)
+ expr = build_baselink (BASELINK_BINFO (baselink),
+ BASELINK_ACCESS_BINFO (baselink),
+ expr, BASELINK_OPTYPE (baselink));
+ if (offset)
+ expr = build2 (OFFSET_REF, TREE_TYPE (expr),
+ TREE_OPERAND (offset, 0), expr);
+ if (addr)
+ expr = build_address (expr);
+ return expr;
+ }
+ else if (good == 0 && badargs)
+ /* There were no good options and at least one bad one, so let the
+ user know what the problem is. */
+ instantiate_template (badfn, badargs, tf_warning_or_error);
+ }
+ return orig_expr;
+}
+
/* Subroutine of resolve_overloaded_unification; does deduction for a single
overload. Fills TARGS with any deduced arguments, or error_mark_node if
different overloads deduce different arguments for a given parm.
@@ -14652,6 +14854,35 @@ mark_decl_instantiated (tree result, int extern_p)
DECL_INTERFACE_KNOWN (result) = 1;
}
+/* Subroutine of more_specialized_fn: check whether TARGS is missing any
+ important template arguments. If any are missing, we check whether
+ they're important by using error_mark_node for substituting into any
+ args that were used for partial ordering (the ones between ARGS and END)
+ and seeing if it bubbles up. */
+
+static bool
+check_undeduced_parms (tree targs, tree args, tree end)
+{
+ bool found = false;
+ int i;
+ for (i = TREE_VEC_LENGTH (targs) - 1; i >= 0; --i)
+ if (TREE_VEC_ELT (targs, i) == NULL_TREE)
+ {
+ found = true;
+ TREE_VEC_ELT (targs, i) = error_mark_node;
+ }
+ if (found)
+ {
+ for (; args != end; args = TREE_CHAIN (args))
+ {
+ tree substed = tsubst (TREE_VALUE (args), targs, tf_none, NULL_TREE);
+ if (substed == error_mark_node)
+ return true;
+ }
+ }
+ return false;
+}
+
/* Given two function templates PAT1 and PAT2, return:
1 if PAT1 is more specialized than PAT2 as described in [temp.func.order].
@@ -14675,8 +14906,12 @@ mark_decl_instantiated (tree result, int extern_p)
neither is more cv-qualified, they both are equal). Unlike regular
deduction, after all the arguments have been deduced in this way,
we do *not* verify the deduced template argument values can be
- substituted into non-deduced contexts, nor do we have to verify
- that all template arguments have been deduced. */
+ substituted into non-deduced contexts.
+
+ The logic can be a bit confusing here, because we look at deduce1 and
+ targs1 to see if pat2 is at least as specialized, and vice versa; if we
+ can find template arguments for pat1 to make arg1 look like arg2, that
+ means that arg2 is at least as specialized as arg1. */
int
more_specialized_fn (tree pat1, tree pat2, int len)
@@ -14689,8 +14924,9 @@ more_specialized_fn (tree pat1, tree pat2, int len)
tree tparms2 = DECL_INNERMOST_TEMPLATE_PARMS (pat2);
tree args1 = TYPE_ARG_TYPES (TREE_TYPE (decl1));
tree args2 = TYPE_ARG_TYPES (TREE_TYPE (decl2));
- int better1 = 0;
- int better2 = 0;
+ tree origs1, origs2;
+ bool lose1 = false;
+ bool lose2 = false;
/* Remove the this parameter from non-static member functions. If
one is a non-static member function and the other is not a static
@@ -14729,6 +14965,9 @@ more_specialized_fn (tree pat1, tree pat2, int len)
processing_template_decl++;
+ origs1 = args1;
+ origs2 = args2;
+
while (len--
/* Stop when an ellipsis is seen. */
&& args1 != NULL_TREE && args2 != NULL_TREE)
@@ -14863,28 +15102,37 @@ more_specialized_fn (tree pat1, tree pat2, int len)
deduce2 = !unify (tparms2, targs2, arg2, arg1, UNIFY_ALLOW_NONE);
}
+ /* If we couldn't deduce arguments for tparms1 to make arg1 match
+ arg2, then arg2 is not as specialized as arg1. */
if (!deduce1)
- better2 = -1;
+ lose2 = true;
if (!deduce2)
- better1 = -1;
- if (better1 < 0 && better2 < 0)
- /* We've failed to deduce something in either direction.
- These must be unordered. */
- break;
-
- if (deduce1 && deduce2 && quals1 >= 0 && quals2 >= 0)
+ lose1 = true;
+
+ /* "If, for a given type, deduction succeeds in both directions
+ (i.e., the types are identical after the transformations above)
+ and if the type from the argument template is more cv-qualified
+ than the type from the parameter template (as described above)
+ that type is considered to be more specialized than the other. If
+ neither type is more cv-qualified than the other then neither type
+ is more specialized than the other."
+
+ We check same_type_p explicitly because deduction can also succeed
+ in both directions when there is a nondeduced context. */
+ if (deduce1 && deduce2
+ && quals1 != quals2 && quals1 >= 0 && quals2 >= 0
+ && same_type_p (arg1, arg2))
{
- /* Deduces in both directions, see if quals can
- disambiguate. Pretend the worse one failed to deduce. */
if ((quals1 & quals2) == quals2)
- deduce1 = 0;
+ lose2 = true;
if ((quals1 & quals2) == quals1)
- deduce2 = 0;
+ lose1 = true;
}
- if (deduce1 && !deduce2 && !better2)
- better2 = 1;
- if (deduce2 && !deduce1 && !better1)
- better1 = 1;
+
+ if (lose1 && lose2)
+ /* We've failed to deduce something in either direction.
+ These must be unordered. */
+ break;
if (TREE_CODE (arg1) == TYPE_PACK_EXPANSION
|| TREE_CODE (arg2) == TYPE_PACK_EXPANSION)
@@ -14896,22 +15144,38 @@ more_specialized_fn (tree pat1, tree pat2, int len)
args2 = TREE_CHAIN (args2);
}
+ /* "In most cases, all template parameters must have values in order for
+ deduction to succeed, but for partial ordering purposes a template
+ parameter may remain without a value provided it is not used in the
+ types being used for partial ordering."
+
+ Thus, if we are missing any of the targs1 we need to substitute into
+ origs1, then pat2 is not as specialized as pat1. This can happen when
+ there is a nondeduced context. */
+ if (!lose2 && check_undeduced_parms (targs1, origs1, args1))
+ lose2 = true;
+ if (!lose1 && check_undeduced_parms (targs2, origs2, args2))
+ lose1 = true;
+
processing_template_decl--;
/* All things being equal, if the next argument is a pack expansion
for one function but not for the other, prefer the
- non-variadic function. */
- if ((better1 > 0) - (better2 > 0) == 0
+ non-variadic function. FIXME this is bogus; see c++/41958. */
+ if (lose1 == lose2
&& args1 && TREE_VALUE (args1)
&& args2 && TREE_VALUE (args2))
{
- if (TREE_CODE (TREE_VALUE (args1)) == TYPE_PACK_EXPANSION)
- return TREE_CODE (TREE_VALUE (args2)) == TYPE_PACK_EXPANSION ? 0 : -1;
- else if (TREE_CODE (TREE_VALUE (args2)) == TYPE_PACK_EXPANSION)
- return 1;
+ lose1 = TREE_CODE (TREE_VALUE (args1)) == TYPE_PACK_EXPANSION;
+ lose2 = TREE_CODE (TREE_VALUE (args2)) == TYPE_PACK_EXPANSION;
}
- return (better1 > 0) - (better2 > 0);
+ if (lose1 == lose2)
+ return 0;
+ else if (!lose1)
+ return 1;
+ else
+ return -1;
}
/* Determine which of two partial specializations is more specialized.
@@ -17594,10 +17858,7 @@ make_args_non_dependent (VEC(tree,gc) *args)
tree
make_auto (void)
{
- tree au;
-
- /* ??? Is it worth caching this for multiple autos at the same level? */
- au = cxx_make_type (TEMPLATE_TYPE_PARM);
+ tree au = cxx_make_type (TEMPLATE_TYPE_PARM);
TYPE_NAME (au) = build_decl (BUILTINS_LOCATION,
TYPE_DECL, get_identifier ("auto"), au);
TYPE_STUB_DECL (au) = TYPE_NAME (au);
@@ -17675,6 +17936,19 @@ do_auto_deduction (tree type, tree init, tree auto_node)
return error_mark_node;
}
+ /* If the list of declarators contains more than one declarator, the type
+ of each declared variable is determined as described above. If the
+ type deduced for the template parameter U is not the same in each
+ deduction, the program is ill-formed. */
+ if (TREE_TYPE (auto_node)
+ && !same_type_p (TREE_TYPE (auto_node), TREE_VEC_ELT (targs, 0)))
+ {
+ error ("inconsistent deduction for %qT: %qT and then %qT",
+ auto_node, TREE_TYPE (auto_node), TREE_VEC_ELT (targs, 0));
+ return error_mark_node;
+ }
+ TREE_TYPE (auto_node) = TREE_VEC_ELT (targs, 0);
+
if (processing_template_decl)
targs = add_to_template_args (current_template_args (), targs);
return tsubst (type, targs, tf_warning_or_error, NULL_TREE);
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 8dde479a6c4..3fb6d11c0ce 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -102,7 +102,7 @@ VEC(tree,gc) *unemitted_tinfo_decls;
static GTY (()) VEC(tinfo_s,gc) *tinfo_descs;
static tree ifnonnull (tree, tree);
-static tree tinfo_name (tree);
+static tree tinfo_name (tree, bool);
static tree build_dynamic_cast_1 (tree, tree, tsubst_flags_t);
static tree throw_bad_cast (void);
static tree throw_bad_typeid (void);
@@ -128,13 +128,13 @@ static void
push_abi_namespace (void)
{
push_nested_namespace (abi_node);
- push_visibility ("default");
+ push_visibility ("default", 2);
}
static void
pop_abi_namespace (void)
{
- pop_visibility ();
+ pop_visibility (2);
pop_nested_namespace (abi_node);
}
@@ -349,16 +349,30 @@ build_typeid (tree exp)
return exp;
}
-/* Generate the NTBS name of a type. */
+/* Generate the NTBS name of a type. If MARK_PRIVATE, put a '*' in front so that
+ comparisons will be done by pointer rather than string comparison. */
static tree
-tinfo_name (tree type)
+tinfo_name (tree type, bool mark_private)
{
const char *name;
+ int length;
tree name_string;
- name = mangle_type_string_for_rtti (type);
- name_string = fix_string_type (build_string (strlen (name) + 1, name));
- return name_string;
+ name = mangle_type_string (type);
+ length = strlen (name);
+
+ if (mark_private)
+ {
+ /* Inject '*' at beginning of name to force pointer comparison. */
+ char* buf = (char*) XALLOCAVEC (char, length + 2);
+ buf[0] = '*';
+ memcpy (buf + 1, name, length + 1);
+ name_string = build_string (length + 2, buf);
+ }
+ else
+ name_string = build_string (length + 1, name);
+
+ return fix_string_type (name_string);
}
/* Return a VAR_DECL for the internal ABI defined type_info object for
@@ -839,13 +853,12 @@ tinfo_base_init (tinfo_s *ti, tree target)
tree vtable_ptr;
{
- tree name_name;
+ tree name_name, name_string;
/* Generate the NTBS array variable. */
tree name_type = build_cplus_array_type
(build_qualified_type (char_type_node, TYPE_QUAL_CONST),
NULL_TREE);
- tree name_string = tinfo_name (target);
/* Determine the name of the variable -- and remember with which
type it is associated. */
@@ -862,6 +875,7 @@ tinfo_base_init (tinfo_s *ti, tree target)
DECL_TINFO_P (name_decl) = 1;
set_linkage_according_to_type (target, name_decl);
import_export_decl (name_decl);
+ name_string = tinfo_name (target, !TREE_PUBLIC (name_decl));
DECL_INITIAL (name_decl) = name_string;
mark_used (name_decl);
pushdecl_top_level_and_finish (name_decl, name_string);
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index d6521fb6f82..3adf9e0a1ab 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -214,9 +214,12 @@ lookup_base (tree t, tree base, base_access access, base_kind *kind_ptr)
t_binfo = TYPE_BINFO (t);
}
- base = complete_type (TYPE_MAIN_VARIANT (base));
+ base = TYPE_MAIN_VARIANT (base);
- if (t_binfo)
+ /* If BASE is incomplete, it can't be a base of T--and instantiating it
+ might cause an error. */
+ if (t_binfo && CLASS_TYPE_P (base)
+ && (COMPLETE_TYPE_P (base) || TYPE_BEING_DEFINED (base)))
{
struct lookup_base_data_s data;
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 8199af0e693..e270a734fa0 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -56,6 +56,7 @@ along with GCC; see the file COPYING3. If not see
static tree maybe_convert_cond (tree);
static tree finalize_nrv_r (tree *, int *, void *);
static tree capture_decltype (tree);
+static tree thisify_lambda_field (tree);
/* Deferred Access Checking Overview
@@ -1447,14 +1448,13 @@ finish_non_static_data_member (tree decl, tree object, tree qualifying_scope)
return error_mark_node;
}
- /* If decl is a field, object has a lambda type, and decl is not a member
- of that type, then we have a reference to a member of 'this' from a
+ /* If decl is a non-capture field and object has a lambda type,
+ then we have a reference to a member of 'this' from a
lambda inside a non-static member function, and we must get to decl
through the 'this' capture. If decl is not a member of that object,
either, then its access will still fail later. */
if (LAMBDA_TYPE_P (TREE_TYPE (object))
- && !same_type_ignoring_top_level_qualifiers_p (DECL_CONTEXT (decl),
- TREE_TYPE (object)))
+ && !LAMBDA_TYPE_P (DECL_CONTEXT (decl)))
object = cp_build_indirect_ref (lambda_expr_this_capture
(CLASSTYPE_LAMBDA_EXPR
(TREE_TYPE (object))),
@@ -2063,17 +2063,13 @@ finish_this_expr (void)
{
tree result;
- if (current_class_ptr)
- {
- tree type = TREE_TYPE (current_class_ref);
-
- /* In a lambda expression, 'this' refers to the captured 'this'. */
- if (LAMBDA_TYPE_P (type))
- result = lambda_expr_this_capture (CLASSTYPE_LAMBDA_EXPR (type));
- else
- result = current_class_ptr;
-
- }
+ /* In a lambda expression, 'this' refers to the captured 'this'. */
+ if (current_function_decl
+ && LAMBDA_FUNCTION_P (current_function_decl))
+ result = (lambda_expr_this_capture
+ (CLASSTYPE_LAMBDA_EXPR (current_class_type)));
+ else if (current_class_ptr)
+ result = current_class_ptr;
else if (current_function_decl
&& DECL_STATIC_FUNCTION_P (current_function_decl))
{
@@ -2648,6 +2644,18 @@ outer_automatic_var_p (tree decl)
&& DECL_CONTEXT (decl) != current_function_decl);
}
+/* Returns true iff DECL is a capture field from a lambda that is not our
+ immediate context. */
+
+static bool
+outer_lambda_capture_p (tree decl)
+{
+ return (TREE_CODE (decl) == FIELD_DECL
+ && LAMBDA_TYPE_P (DECL_CONTEXT (decl))
+ && (!current_class_type
+ || !DERIVED_FROM_P (DECL_CONTEXT (decl), current_class_type)));
+}
+
/* ID_EXPRESSION is a representation of parsed, but unprocessed,
id-expression. (See cp_parser_id_expression for details.) SCOPE,
if non-NULL, is the type or namespace used to explicitly qualify
@@ -2751,7 +2759,8 @@ finish_id_expression (tree id_expression,
/* Disallow uses of local variables from containing functions, except
within lambda-expressions. */
- if (outer_automatic_var_p (decl)
+ if ((outer_automatic_var_p (decl)
+ || outer_lambda_capture_p (decl))
/* It's not a use (3.2) if we're in an unevaluated context. */
&& !cp_unevaluated_operand)
{
@@ -2759,6 +2768,7 @@ finish_id_expression (tree id_expression,
tree containing_function = current_function_decl;
tree lambda_stack = NULL_TREE;
tree lambda_expr = NULL_TREE;
+ tree initializer = decl;
/* Core issue 696: "[At the July 2009 meeting] the CWG expressed
support for an approach in which a reference to a local
@@ -2770,6 +2780,13 @@ finish_id_expression (tree id_expression,
if (DECL_INTEGRAL_CONSTANT_VAR_P (decl))
return integral_constant_value (decl);
+ if (TYPE_P (context))
+ {
+ /* Implicit capture of an explicit capture. */
+ context = lambda_function (context);
+ initializer = thisify_lambda_field (decl);
+ }
+
/* If we are in a lambda function, we can move out until we hit
1. the context,
2. a non-lambda function, or
@@ -2796,7 +2813,7 @@ finish_id_expression (tree id_expression,
{
decl = add_default_capture (lambda_stack,
/*id=*/DECL_NAME (decl),
- /*initializer=*/decl);
+ initializer);
}
else if (lambda_expr)
{
@@ -4741,6 +4758,7 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p)
/* The type denoted by decltype(e) is defined as follows: */
+ expr = resolve_nondeduced_context (expr);
if (id_expression_or_member_access_p)
{
/* If e is an id-expression or a class member access (5.2.5
@@ -4766,9 +4784,13 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p)
/* See through BASELINK nodes to the underlying functions. */
expr = BASELINK_FUNCTIONS (expr);
+ if (TREE_CODE (expr) == TEMPLATE_ID_EXPR)
+ expr = TREE_OPERAND (expr, 0);
+
if (TREE_CODE (expr) == OVERLOAD)
{
- if (OVL_CHAIN (expr))
+ if (OVL_CHAIN (expr)
+ || TREE_CODE (OVL_FUNCTION (expr)) == TEMPLATE_DECL)
{
error ("%qE refers to a set of overloaded functions", orig_expr);
return error_mark_node;
@@ -5328,6 +5350,20 @@ build_lambda_object (tree lambda_expr)
do some magic to make it work here. */
if (TREE_CODE (TREE_TYPE (field)) == ARRAY_TYPE)
val = build_array_copy (val);
+ else if (DECL_NORMAL_CAPTURE_P (field)
+ && TREE_CODE (TREE_TYPE (field)) != REFERENCE_TYPE)
+ {
+ /* "the entities that are captured by copy are used to
+ direct-initialize each corresponding non-static data
+ member of the resulting closure object."
+
+ There's normally no way to express direct-initialization
+ from an element of a CONSTRUCTOR, so we build up a special
+ TARGET_EXPR to bypass the usual copy-initialization. */
+ val = force_rvalue (val);
+ if (TREE_CODE (val) == TARGET_EXPR)
+ TARGET_EXPR_DIRECT_INIT_P (val) = true;
+ }
CONSTRUCTOR_APPEND_ELT (elts, DECL_NAME (field), val);
}
@@ -5545,7 +5581,8 @@ capture_decltype (tree decl)
and return it. */
tree
-add_capture (tree lambda, tree id, tree initializer, bool by_reference_p)
+add_capture (tree lambda, tree id, tree initializer, bool by_reference_p,
+ bool explicit_init_p)
{
tree type;
tree member;
@@ -5560,6 +5597,13 @@ add_capture (tree lambda, tree id, tree initializer, bool by_reference_p)
/* Make member variable. */
member = build_lang_decl (FIELD_DECL, id, type);
+ if (!explicit_init_p)
+ /* Normal captures are invisible to name lookup but uses are replaced
+ with references to the capture field; we implement this by only
+ really making them invisible in unevaluated context; see
+ qualify_lookup. For now, let's make explicitly initialized captures
+ always visible. */
+ DECL_NORMAL_CAPTURE_P (member) = true;
/* Add it to the appropriate closure class. */
finish_member_declaration (member);
@@ -5577,6 +5621,21 @@ add_capture (tree lambda, tree id, tree initializer, bool by_reference_p)
return member;
}
+/* Given a FIELD_DECL decl belonging to a closure type, return a
+ COMPONENT_REF of it relative to the 'this' parameter of the op() for
+ that type. */
+
+static tree
+thisify_lambda_field (tree decl)
+{
+ tree context = lambda_function (DECL_CONTEXT (decl));
+ tree object = cp_build_indirect_ref (DECL_ARGUMENTS (context),
+ /*errorstring*/"",
+ tf_warning_or_error);
+ return finish_non_static_data_member (decl, object,
+ /*qualifying_scope*/NULL_TREE);
+}
+
/* Similar to add_capture, except this works on a stack of nested lambdas.
BY_REFERENCE_P in this case is derived from the default capture mode.
Returns the capture for the lambda at the bottom of the stack. */
@@ -5605,17 +5664,9 @@ add_default_capture (tree lambda_stack, tree id, tree initializer)
/*by_reference_p=*/
(!this_capture_p
&& (LAMBDA_EXPR_DEFAULT_CAPTURE_MODE (lambda)
- == CPLD_REFERENCE)));
-
- {
- /* Have to get the old value of current_class_ref. */
- tree object = cp_build_indirect_ref (DECL_ARGUMENTS
- (lambda_function (lambda)),
- /*errorstring=*/"",
- /*complain=*/tf_warning_or_error);
- initializer = finish_non_static_data_member
- (member, object, /*qualifying_scope=*/NULL_TREE);
- }
+ == CPLD_REFERENCE)),
+ /*explicit_init_p=*/false);
+ initializer = thisify_lambda_field (member);
}
current_class_type = saved_class_type;
@@ -5654,10 +5705,7 @@ lambda_expr_this_capture (tree lambda)
{
/* An outer lambda has already captured 'this'. */
tree cap = LAMBDA_EXPR_THIS_CAPTURE (lambda);
- tree lthis
- = cp_build_indirect_ref (DECL_ARGUMENTS (containing_function),
- "", tf_warning_or_error);
- init = finish_non_static_data_member (cap, lthis, NULL_TREE);
+ init = thisify_lambda_field (cap);
break;
}
@@ -5707,4 +5755,55 @@ lambda_expr_this_capture (tree lambda)
return result;
}
+/* If the closure TYPE has a static op(), also add a conversion to function
+ pointer. */
+
+void
+maybe_add_lambda_conv_op (tree type)
+{
+ bool nested = (current_function_decl != NULL_TREE);
+ tree callop = lambda_function (type);
+ tree rettype, name, fntype, fn, body, compound_stmt;
+
+ if (!DECL_STATIC_FUNCTION_P (callop))
+ return;
+
+ rettype = build_pointer_type (TREE_TYPE (callop));
+ name = mangle_conv_op_name_for_type (rettype);
+ fntype = build_function_type (rettype, void_list_node);
+ fn = build_lang_decl (FUNCTION_DECL, name, fntype);
+ DECL_SOURCE_LOCATION (fn) = DECL_SOURCE_LOCATION (callop);
+
+ if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn
+ && DECL_ALIGN (fn) < 2 * BITS_PER_UNIT)
+ DECL_ALIGN (fn) = 2 * BITS_PER_UNIT;
+
+ SET_OVERLOADED_OPERATOR_CODE (fn, TYPE_EXPR);
+ grokclassfn (type, fn, NO_SPECIAL);
+ set_linkage_according_to_type (type, fn);
+ rest_of_decl_compilation (fn, toplevel_bindings_p (), at_eof);
+ DECL_IN_AGGR_P (fn) = 1;
+ DECL_ARTIFICIAL (fn) = 1;
+ DECL_NOT_REALLY_EXTERN (fn) = 1;
+ DECL_DECLARED_INLINE_P (fn) = 1;
+ DECL_STATIC_FUNCTION_P (fn) = 1;
+
+ add_method (type, fn, NULL_TREE);
+
+ if (nested)
+ push_function_context ();
+ start_preparsed_function (fn, NULL_TREE,
+ SF_PRE_PARSED | SF_INCLASS_INLINE);
+ body = begin_function_body ();
+ compound_stmt = begin_compound_stmt (0);
+
+ finish_return_stmt (decay_conversion (callop));
+
+ finish_compound_stmt (compound_stmt);
+ finish_function_body (body);
+
+ expand_or_defer_fn (finish_function (2));
+ if (nested)
+ pop_function_context ();
+}
#include "gt-cp-semantics.h"
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 1cd2bf596f8..5aea55e792f 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -946,6 +946,16 @@ cp_build_qualified_type_real (tree type,
return result;
}
+/* Return TYPE with const and volatile removed. */
+
+tree
+cv_unqualified (tree type)
+{
+ int quals = TYPE_QUALS (type);
+ quals &= ~(TYPE_QUAL_CONST|TYPE_QUAL_VOLATILE);
+ return cp_build_qualified_type (type, quals);
+}
+
/* Builds a qualified variant of T that is not a typedef variant.
E.g. consider the following declarations:
typedef const int ConstInt;
@@ -1040,6 +1050,10 @@ strip_typedefs (tree t)
else
result = build_function_type (type,
arg_types);
+
+ if (TYPE_RAISES_EXCEPTIONS (t))
+ result = build_exception_variant (result,
+ TYPE_RAISES_EXCEPTIONS (t));
}
break;
default:
@@ -1048,6 +1062,8 @@ strip_typedefs (tree t)
if (!result)
result = TYPE_MAIN_VARIANT (t);
+ if (TYPE_ATTRIBUTES (t))
+ result = cp_build_type_attribute_variant (result, TYPE_ATTRIBUTES (t));
return cp_build_qualified_type (result, cp_type_quals (t));
}
@@ -1284,6 +1300,8 @@ build_qualified_name (tree type, tree scope, tree name, bool template_p)
return error_mark_node;
t = build2 (SCOPE_REF, type, scope, name);
QUALIFIED_NAME_IS_TEMPLATE (t) = template_p;
+ if (type)
+ t = convert_from_reference (t);
return t;
}
@@ -2079,6 +2097,8 @@ cp_tree_equal (tree t1, tree t2)
case TEMPLATE_PARM_INDEX:
return (TEMPLATE_PARM_IDX (t1) == TEMPLATE_PARM_IDX (t2)
&& TEMPLATE_PARM_LEVEL (t1) == TEMPLATE_PARM_LEVEL (t2)
+ && (TEMPLATE_PARM_PARAMETER_PACK (t1)
+ == TEMPLATE_PARM_PARAMETER_PACK (t2))
&& same_type_p (TREE_TYPE (TEMPLATE_PARM_DECL (t1)),
TREE_TYPE (TEMPLATE_PARM_DECL (t2))));
@@ -2595,7 +2615,8 @@ cp_build_type_attribute_variant (tree type, tree attributes)
tree new_type;
new_type = build_type_attribute_variant (type, attributes);
- if (TREE_CODE (new_type) == FUNCTION_TYPE
+ if ((TREE_CODE (new_type) == FUNCTION_TYPE
+ || TREE_CODE (new_type) == METHOD_TYPE)
&& (TYPE_RAISES_EXCEPTIONS (new_type)
!= TYPE_RAISES_EXCEPTIONS (type)))
new_type = build_exception_variant (new_type,
@@ -3127,6 +3148,17 @@ cp_free_lang_data (tree t)
DECL_EXTERNAL (t) = 1;
TREE_STATIC (t) = 0;
}
+ if (CP_AGGREGATE_TYPE_P (t)
+ && TYPE_NAME (t))
+ {
+ tree name = TYPE_NAME (t);
+ if (TREE_CODE (name) == TYPE_DECL)
+ name = DECL_NAME (name);
+ /* Drop anonymous names. */
+ if (name != NULL_TREE
+ && ANON_AGGRNAME_P (name))
+ TYPE_NAME (t) = NULL_TREE;
+ }
}
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index b4d54fc4089..7cafc8ab224 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -1613,6 +1613,7 @@ decay_conversion (tree exp)
if (type == error_mark_node)
return error_mark_node;
+ exp = resolve_nondeduced_context (exp);
if (type_unknown_p (exp))
{
cxx_incomplete_type_error (exp, TREE_TYPE (exp));
@@ -1690,7 +1691,7 @@ decay_conversion (tree exp)
Non-class rvalues always have cv-unqualified types. */
type = TREE_TYPE (exp);
if (!CLASS_TYPE_P (type) && cp_type_quals (type))
- exp = build_nop (TYPE_MAIN_VARIANT (type), exp);
+ exp = build_nop (cv_unqualified (type), exp);
return exp;
}
@@ -3244,6 +3245,7 @@ build_x_binary_op (enum tree_code code, tree arg1, enum tree_code arg1_code,
misinterpret. But don't warn about obj << x + y, since that is a
common idiom for I/O. */
if (warn_parentheses
+ && (complain & tf_warning)
&& !processing_template_decl
&& !error_operand_p (arg1)
&& !error_operand_p (arg2)
@@ -5598,12 +5600,17 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p,
intype, type);
expr = cp_build_unary_op (ADDR_EXPR, expr, 0, complain);
+
+ if (warn_strict_aliasing > 2)
+ strict_aliasing_warning (TREE_TYPE (expr), type, expr);
+
if (expr != error_mark_node)
expr = build_reinterpret_cast_1
(build_pointer_type (TREE_TYPE (type)), expr, c_cast_p,
valid_p, complain);
if (expr != error_mark_node)
- expr = cp_build_indirect_ref (expr, 0, complain);
+ /* cp_build_indirect_ref isn't right for rvalue refs. */
+ expr = convert_from_reference (fold_convert (type, expr));
return expr;
}
@@ -6873,7 +6880,7 @@ convert_for_initialization (tree exp, tree type, tree rhs, int flags,
if (fndecl)
savew = warningcount, savee = errorcount;
rhs = initialize_reference (type, rhs, /*decl=*/NULL_TREE,
- /*cleanup=*/NULL);
+ /*cleanup=*/NULL, complain);
if (fndecl)
{
if (warningcount > savew)
@@ -6893,6 +6900,11 @@ convert_for_initialization (tree exp, tree type, tree rhs, int flags,
type = complete_type (type);
+ if (DIRECT_INIT_EXPR_P (type, rhs))
+ /* Don't try to do copy-initialization if we already have
+ direct-initialization. */
+ return rhs;
+
if (MAYBE_CLASS_TYPE_P (type))
return ocp_convert (type, rhs, CONV_IMPLICIT|CONV_FORCE_TEMP, flags);
diff --git a/gcc/cse.c b/gcc/cse.c
index 8f49a9af9f5..05f6ed6e0fe 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -2623,6 +2623,10 @@ exp_equiv_p (const_rtx x, const_rtx y, int validate, bool for_gcse)
if (GET_MODE (x) != GET_MODE (y))
return 0;
+ /* MEMs refering to different address space are not equivalent. */
+ if (code == MEM && MEM_ADDR_SPACE (x) != MEM_ADDR_SPACE (y))
+ return 0;
+
switch (code)
{
case PC:
diff --git a/gcc/cselib.c b/gcc/cselib.c
index e6e5c143dad..0aa22a4fe1b 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -585,6 +585,7 @@ rtx_equal_for_cselib_p (rtx x, rtx y)
{
case CONST_DOUBLE:
case CONST_FIXED:
+ case DEBUG_EXPR:
return 0;
case LABEL_REF:
@@ -661,6 +662,19 @@ rtx_equal_for_cselib_p (rtx x, rtx y)
return 1;
}
+/* We need to pass down the mode of constants through the hash table
+ functions. For that purpose, wrap them in a CONST of the appropriate
+ mode. */
+static rtx
+wrap_constant (enum machine_mode mode, rtx x)
+{
+ if (!CONST_INT_P (x) && GET_CODE (x) != CONST_FIXED
+ && (GET_CODE (x) != CONST_DOUBLE || GET_MODE (x) != VOIDmode))
+ return x;
+ gcc_assert (mode != VOIDmode);
+ return gen_rtx_CONST (mode, x);
+}
+
/* Hash an rtx. Return 0 if we couldn't hash the rtx.
For registers and memory locations, we look up their cselib_val structure
and return its VALUE element.
@@ -703,6 +717,11 @@ cselib_hash_rtx (rtx x, int create)
return e->value;
+ case DEBUG_EXPR:
+ hash += ((unsigned) DEBUG_EXPR << 7)
+ + DEBUG_TEMP_UID (DEBUG_EXPR_TREE_DECL (x));
+ return hash ? hash : (unsigned int) DEBUG_EXPR;
+
case CONST_INT:
hash += ((unsigned) CONST_INT << 7) + INTVAL (x);
return hash ? hash : (unsigned int) CONST_INT;
@@ -1213,6 +1232,13 @@ cselib_expand_value_rtx_1 (rtx orig, struct expand_value_data *evd,
result = expand_loc (CSELIB_VAL_PTR (orig)->locs, evd, max_depth);
return result;
}
+
+ case DEBUG_EXPR:
+ if (evd->callback)
+ return evd->callback (orig, evd->regs_active, max_depth,
+ evd->callback_arg);
+ return orig;
+
default:
break;
}
@@ -1327,21 +1353,9 @@ cselib_expand_value_rtx_1 (rtx orig, struct expand_value_data *evd,
default:
break;
}
- if (scopy == NULL_RTX)
- {
- XEXP (copy, 0)
- = gen_rtx_CONST (GET_MODE (XEXP (orig, 0)), XEXP (copy, 0));
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, " wrapping const_int result in const to preserve mode %s\n",
- GET_MODE_NAME (GET_MODE (XEXP (copy, 0))));
- }
scopy = simplify_rtx (copy);
if (scopy)
- {
- if (GET_MODE (copy) != GET_MODE (scopy))
- scopy = wrap_constant (GET_MODE (copy), scopy);
- return scopy;
- }
+ return scopy;
return copy;
}
@@ -1408,30 +1422,31 @@ cselib_subst_to_values (rtx x)
{
rtx t = cselib_subst_to_values (XEXP (x, i));
- if (t != XEXP (x, i) && x == copy)
- copy = shallow_copy_rtx (x);
-
- XEXP (copy, i) = t;
+ if (t != XEXP (x, i))
+ {
+ if (x == copy)
+ copy = shallow_copy_rtx (x);
+ XEXP (copy, i) = t;
+ }
}
else if (fmt[i] == 'E')
{
- int j, k;
+ int j;
for (j = 0; j < XVECLEN (x, i); j++)
{
rtx t = cselib_subst_to_values (XVECEXP (x, i, j));
- if (t != XVECEXP (x, i, j) && XVEC (x, i) == XVEC (copy, i))
+ if (t != XVECEXP (x, i, j))
{
- if (x == copy)
- copy = shallow_copy_rtx (x);
-
- XVEC (copy, i) = rtvec_alloc (XVECLEN (x, i));
- for (k = 0; k < j; k++)
- XVECEXP (copy, i, k) = XVECEXP (x, i, k);
+ if (XVEC (x, i) == XVEC (copy, i))
+ {
+ if (x == copy)
+ copy = shallow_copy_rtx (x);
+ XVEC (copy, i) = shallow_copy_rtvec (XVEC (x, i));
+ }
+ XVECEXP (copy, i, j) = t;
}
-
- XVECEXP (copy, i, j) = t;
}
}
}
@@ -1875,7 +1890,13 @@ cselib_record_sets (rtx insn)
src = gen_rtx_IF_THEN_ELSE (GET_MODE (dest), cond, src, dest);
sets[i].src_elt = cselib_lookup (src, GET_MODE (dest), 1);
if (MEM_P (dest))
- sets[i].dest_addr_elt = cselib_lookup (XEXP (dest, 0), Pmode, 1);
+ {
+ enum machine_mode address_mode
+ = targetm.addr_space.address_mode (MEM_ADDR_SPACE (dest));
+
+ sets[i].dest_addr_elt = cselib_lookup (XEXP (dest, 0),
+ address_mode, 1);
+ }
else
sets[i].dest_addr_elt = 0;
}
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index 097b20be860..a7bae6003f6 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -346,6 +346,7 @@ const struct gcc_debug_hooks dbx_debug_hooks =
{
dbxout_init,
dbxout_finish,
+ debug_nothing_void,
debug_nothing_int_charstar,
debug_nothing_int_charstar,
dbxout_start_source_file,
@@ -373,6 +374,10 @@ const struct gcc_debug_hooks dbx_debug_hooks =
dbxout_handle_pch, /* handle_pch */
debug_nothing_rtx, /* var_location */
debug_nothing_void, /* switch_text_section */
+ debug_nothing_tree, /* direct_call */
+ debug_nothing_tree_int, /* virtual_call_token */
+ debug_nothing_rtx_rtx, /* copy_call_info */
+ debug_nothing_uid, /* virtual_call */
debug_nothing_tree_tree, /* set_name */
0 /* start_end_main_source_file */
};
@@ -383,6 +388,7 @@ const struct gcc_debug_hooks xcoff_debug_hooks =
{
dbxout_init,
dbxout_finish,
+ debug_nothing_void,
debug_nothing_int_charstar,
debug_nothing_int_charstar,
dbxout_start_source_file,
@@ -406,6 +412,10 @@ const struct gcc_debug_hooks xcoff_debug_hooks =
dbxout_handle_pch, /* handle_pch */
debug_nothing_rtx, /* var_location */
debug_nothing_void, /* switch_text_section */
+ debug_nothing_tree, /* direct_call */
+ debug_nothing_tree_int, /* virtual_call_token */
+ debug_nothing_rtx_rtx, /* copy_call_info */
+ debug_nothing_uid, /* virtual_call */
debug_nothing_tree_tree, /* set_name */
0 /* start_end_main_source_file */
};
@@ -3181,7 +3191,7 @@ dbxout_common_check (tree decl, int *value)
rtx sym_addr;
const char *name = NULL;
- /* If the decl isn't a VAR_DECL, or if it isn't public or static, or if
+ /* If the decl isn't a VAR_DECL, or if it isn't static, or if
it does not have a value (the offset into the common area), or if it
is thread local (as opposed to global) then it isn't common, and shouldn't
be handled as such.
@@ -3190,7 +3200,6 @@ dbxout_common_check (tree decl, int *value)
for thread-local symbols. Can be handled via same mechanism as used
in dwarf2out.c. */
if (TREE_CODE (decl) != VAR_DECL
- || !TREE_PUBLIC(decl)
|| !TREE_STATIC(decl)
|| !DECL_HAS_VALUE_EXPR_P(decl)
|| DECL_THREAD_LOCAL_P (decl)
diff --git a/gcc/ddg.c b/gcc/ddg.c
index 439acd1f434..c06ea75ea2d 100644
--- a/gcc/ddg.c
+++ b/gcc/ddg.c
@@ -167,7 +167,7 @@ create_ddg_dep_from_intra_loop_link (ddg_ptr g, ddg_node_ptr src_node,
t = OUTPUT_DEP;
gcc_assert (!DEBUG_INSN_P (dest_node->insn) || t == ANTI_DEP);
- gcc_assert (!DEBUG_INSN_P (src_node->insn) || DEBUG_INSN_P (dest_node->insn));
+ gcc_assert (!DEBUG_INSN_P (src_node->insn) || t == ANTI_DEP);
/* We currently choose not to create certain anti-deps edges and
compensate for that by generating reg-moves based on the life-range
@@ -213,7 +213,7 @@ create_ddg_dep_no_link (ddg_ptr g, ddg_node_ptr from, ddg_node_ptr to,
struct _dep _dep, *dep = &_dep;
gcc_assert (!DEBUG_INSN_P (to->insn) || d_t == ANTI_DEP);
- gcc_assert (!DEBUG_INSN_P (from->insn) || DEBUG_INSN_P (to->insn));
+ gcc_assert (!DEBUG_INSN_P (from->insn) || d_t == ANTI_DEP);
if (d_t == ANTI_DEP)
dep_kind = REG_DEP_ANTI;
diff --git a/gcc/debug.c b/gcc/debug.c
index df69fd5eb82..c60a78d4708 100644
--- a/gcc/debug.c
+++ b/gcc/debug.c
@@ -27,6 +27,7 @@ const struct gcc_debug_hooks do_nothing_debug_hooks =
{
debug_nothing_charstar,
debug_nothing_charstar,
+ debug_nothing_void,
debug_nothing_int_charstar,
debug_nothing_int_charstar,
debug_nothing_int_charstar,
@@ -50,6 +51,10 @@ const struct gcc_debug_hooks do_nothing_debug_hooks =
debug_nothing_int, /* handle_pch */
debug_nothing_rtx, /* var_location */
debug_nothing_void, /* switch_text_section */
+ debug_nothing_tree, /* direct_call */
+ debug_nothing_tree_int, /* virtual_call_token */
+ debug_nothing_rtx_rtx, /* copy_call_info */
+ debug_nothing_uid, /* virtual_call */
debug_nothing_tree_tree, /* set_name */
0 /* start_end_main_source_file */
};
@@ -93,6 +98,12 @@ debug_nothing_rtx (rtx insn ATTRIBUTE_UNUSED)
}
void
+debug_nothing_rtx_rtx (rtx insn ATTRIBUTE_UNUSED,
+ rtx new_insn ATTRIBUTE_UNUSED)
+{
+}
+
+void
debug_nothing_charstar (const char *main_filename ATTRIBUTE_UNUSED)
{
}
@@ -127,3 +138,8 @@ debug_nothing_tree_int (tree decl ATTRIBUTE_UNUSED,
int local ATTRIBUTE_UNUSED)
{
}
+
+void
+debug_nothing_uid (int uid ATTRIBUTE_UNUSED)
+{
+}
diff --git a/gcc/debug.h b/gcc/debug.h
index de525fec2cd..079ecb623ad 100644
--- a/gcc/debug.h
+++ b/gcc/debug.h
@@ -31,6 +31,10 @@ struct gcc_debug_hooks
/* Output debug symbols. */
void (* finish) (const char *main_filename);
+ /* Called from cgraph_optimize before starting to assemble
+ functions/variables/toplevel asms. */
+ void (* assembly_start) (void);
+
/* Macro defined on line LINE with name and expansion TEXT. */
void (* define) (unsigned int line, const char *text);
@@ -126,6 +130,31 @@ struct gcc_debug_hooks
text sections. */
void (* switch_text_section) (void);
+ /* Records a direct call to the function DECL, noting the point of call
+ and the debug info for the function. Called from final_scan_insn
+ when ICF debugging is enabled. */
+ void (* direct_call) (tree decl);
+
+ /* Records the OBJ_TYPE_REF_TOKEN for a virtual call through ADDR, which
+ for C++ is the vtable slot index, noting the INSN_UID for the call
+ instruction. Called from calls.c:emit_call_1 when ICF debugging is
+ enabled. It's necessary to do this during lowering because the
+ call instruction and the OBJ_TYPE_REF become separated after that
+ point. */
+ void (* virtual_call_token) (tree addr, int insn_uid);
+
+ /* Copies the OBJ_TYPE_REF_TOKEN for a virtual call from OLD_INSN to
+ NEW_INSN. Called from emit-rtl.c:try_split when a CALL_INSN is
+ split, so that the vtable slot index remains associated with the
+ new CALL_INSN. */
+ void (* copy_call_info) (rtx old_insn, rtx new_insn);
+
+ /* Records a virtual call given INSN_UID, which is the UID of the call
+ instruction. The UID is then mapped to the vtable slot index noted
+ during the lowering phase. Called from final_scan_insn when ICF
+ debugging is enabled. */
+ void (* virtual_call) (int insn_uid);
+
/* Called from grokdeclarator. Replaces the anonymous name with the
type name. */
void (* set_name) (tree, tree);
@@ -151,6 +180,8 @@ extern void debug_nothing_tree_int (tree, int);
extern void debug_nothing_tree_tree_tree_bool (tree, tree, tree, bool);
extern bool debug_true_const_tree (const_tree);
extern void debug_nothing_rtx (rtx);
+extern void debug_nothing_rtx_rtx (rtx, rtx);
+extern void debug_nothing_uid (int);
/* Hooks for various debug formats. */
extern const struct gcc_debug_hooks do_nothing_debug_hooks;
diff --git a/gcc/defaults.h b/gcc/defaults.h
index f1d96833070..182de95685c 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -1154,4 +1154,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define GO_IF_MODE_DEPENDENT_ADDRESS(X, WIN)
#endif
+/* For most ports anything that evaluates to a constant symbolic
+ or integer value is acceptable as a constant address. */
+#ifndef CONSTANT_ADDRESS_P
+#define CONSTANT_ADDRESS_P(X) (CONSTANT_P (X) && GET_CODE (X) != CONST_DOUBLE)
+#endif
+
#endif /* ! GCC_DEFAULTS_H */
diff --git a/gcc/df-problems.c b/gcc/df-problems.c
index cdbc8a19d9d..e9896e311d1 100644
--- a/gcc/df-problems.c
+++ b/gcc/df-problems.c
@@ -4026,10 +4026,6 @@ df_simulate_finalize_forwards (basic_block bb, bitmap live)
propagating the information to BB3's successors.
---------------------------------------------------------------------------*/
-/* Scratch var used by transfer functions. This is used to do md analysis
- only for live registers. */
-static bitmap df_md_scratch;
-
/* Set basic block info. */
static void
@@ -4073,7 +4069,6 @@ df_md_alloc (bitmap all_blocks)
sizeof (struct df_md_bb_info), 50);
df_grow_bb_info (df_md);
- df_md_scratch = BITMAP_ALLOC (NULL);
EXECUTE_IF_SET_IN_BITMAP (all_blocks, 0, bb_index, bi)
{
@@ -4249,10 +4244,8 @@ df_md_local_compute (bitmap all_blocks)
bitmap kill = df_md_get_bb_info (bb_index)->kill;
EXECUTE_IF_SET_IN_BITMAP (frontiers[bb_index], 0, df_bb_index, bi2)
{
- basic_block bb = BASIC_BLOCK (df_bb_index);
if (bitmap_bit_p (all_blocks, df_bb_index))
- bitmap_ior_and_into (df_md_get_bb_info (df_bb_index)->init, kill,
- df_get_live_in (bb));
+ bitmap_ior_into (df_md_get_bb_info (df_bb_index)->init, kill);
}
}
@@ -4282,24 +4275,13 @@ df_md_reset (bitmap all_blocks)
static bool
df_md_transfer_function (int bb_index)
{
- basic_block bb = BASIC_BLOCK (bb_index);
struct df_md_bb_info *bb_info = df_md_get_bb_info (bb_index);
bitmap in = bb_info->in;
bitmap out = bb_info->out;
bitmap gen = bb_info->gen;
bitmap kill = bb_info->kill;
- /* We need to use a scratch set here so that the value returned from
- this function invocation properly reflects if the sets changed in
- a significant way; i.e. not just because the live set was anded
- in. */
- bitmap_and (df_md_scratch, gen, df_get_live_out (bb));
-
- /* Multiple definitions of a register are not relevant if it is not
- used. Thus we trim the result to the places where it is live. */
- bitmap_and_into (in, df_get_live_in (bb));
-
- return bitmap_ior_and_compl (out, df_md_scratch, in, kill);
+ return bitmap_ior_and_compl (out, gen, in, kill);
}
/* Initialize the solution bit vectors for problem. */
@@ -4362,7 +4344,6 @@ df_md_free (void)
}
}
- BITMAP_FREE (df_md_scratch);
free_alloc_pool (df_md->block_pool);
df_md->block_info_size = 0;
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index 45df29ecc2b..101234b55bc 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -3248,10 +3248,23 @@ df_uses_record (enum df_ref_class cl, struct df_collection_rec *collection_rec,
width = INTVAL (XEXP (dst, 1));
offset = INTVAL (XEXP (dst, 2));
mode = GET_MODE (dst);
- df_uses_record (DF_REF_EXTRACT, collection_rec, &XEXP (dst, 0),
- DF_REF_REG_USE, bb, insn_info,
- DF_REF_READ_WRITE | DF_REF_ZERO_EXTRACT,
- width, offset, mode);
+ if (GET_CODE (XEXP (dst,0)) == MEM)
+ {
+ /* Handle the case of zero_extract(mem(...)) in the set dest.
+ This special case is allowed only if the mem is a single byte and
+ is useful to set a bitfield in memory. */
+ df_uses_record (DF_REF_EXTRACT, collection_rec, &XEXP (XEXP (dst,0), 0),
+ DF_REF_REG_MEM_STORE, bb, insn_info,
+ DF_REF_ZERO_EXTRACT,
+ width, offset, mode);
+ }
+ else
+ {
+ df_uses_record (DF_REF_EXTRACT, collection_rec, &XEXP (dst, 0),
+ DF_REF_REG_USE, bb, insn_info,
+ DF_REF_READ_WRITE | DF_REF_ZERO_EXTRACT,
+ width, offset, mode);
+ }
}
else
{
diff --git a/gcc/doc/contrib.texi b/gcc/doc/contrib.texi
index d2d1673cc3b..ca86f28dd39 100644
--- a/gcc/doc/contrib.texi
+++ b/gcc/doc/contrib.texi
@@ -173,8 +173,8 @@ The @uref{http://www.gnu.org/software/classpath/,,GNU Classpath project}
for all of their merged runtime code.
@item
-Nick Clifton for arm, mcore, fr30, v850, m32r work, @option{--help}, and
-other random hacking.
+Nick Clifton for arm, mcore, fr30, v850, m32r, rx work,
+@option{--help}, and other random hacking.
@item
Michael Cook for libstdc++ cleanup patches to reduce warnings.
diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi
index ce4c0c3ff5d..590630cee0d 100644
--- a/gcc/doc/cpp.texi
+++ b/gcc/doc/cpp.texi
@@ -3609,8 +3609,6 @@ These directives are not part of the C standard, but they are not
official GNU extensions either. What historical information we have
been able to find, suggests they originated with System V@.
-Both @samp{#ident} and @samp{#sccs} are deprecated extensions.
-
@cindex null directive
The @dfn{null directive} consists of a @samp{#} followed by a newline,
with only whitespace (including comments) in between. A null directive
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 6f0955577c3..e09c9ee6685 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -39,6 +39,7 @@ extensions, accepted by GCC in C89 mode and in C++.
* Decimal Float:: Decimal Floating Types.
* Hex Floats:: Hexadecimal floating-point constants.
* Fixed-Point:: Fixed-Point Types.
+* Named Address Spaces::Named address spaces.
* Zero Length:: Zero-length arrays.
* Variable Length:: Arrays whose length is computed at run time.
* Empty Structures:: Structures with no members.
@@ -1197,6 +1198,31 @@ Pragmas to control overflow and rounding behaviors are not implemented.
Fixed-point types are supported by the DWARF2 debug information format.
+@node Named Address Spaces
+@section Named address spaces
+@cindex named address spaces
+
+As an extension, the GNU C compiler supports named address spaces as
+defined in the N1275 draft of ISO/IEC DTR 18037. Support for named
+address spaces in GCC will evolve as the draft technical report changes.
+Calling conventions for any target might also change. At present, only
+the SPU target supports other address spaces. On the SPU target, for
+example, variables may be declared as belonging to another address space
+by qualifying the type with the @code{__ea} address space identifier:
+
+@smallexample
+extern int __ea i;
+@end smallexample
+
+When the variable @code{i} is accessed, the compiler will generate
+special code to access this variable. It may use runtime library
+support, or generate special machine instructions to access that address
+space.
+
+The @code{__ea} identifier may be used exactly like any other C type
+qualifier (e.g., @code{const} or @code{volatile}). See the N1275
+document for more details.
+
@node Zero Length
@section Arrays of Length Zero
@cindex arrays of length zero
@@ -2280,7 +2306,7 @@ addressing modes.
@item fast_interrupt
@cindex interrupt handler functions
-Use this attribute on the M32C port to indicate that the specified
+Use this attribute on the M32C and RX ports to indicate that the specified
function is a fast interrupt handler. This is just like the
@code{interrupt} attribute, except that @code{freit} is used to return
instead of @code{reit}.
@@ -2472,8 +2498,8 @@ This attribute is ignored for R8C target.
@item interrupt
@cindex interrupt handler functions
-Use this attribute on the ARM, AVR, CRX, M32C, M32R/D, m68k, MeP, MIPS
-and Xstormy16 ports to indicate that the specified function is an
+Use this attribute on the ARM, AVR, CRX, M32C, M32R/D, m68k, MeP, MIPS,
+RX and Xstormy16 ports to indicate that the specified function is an
interrupt handler. The compiler will generate function entry and exit
sequences suitable for use in an interrupt handler when this attribute
is present.
@@ -2679,9 +2705,17 @@ when targeting Windows. On all other systems, the default is the AMD ABI.
Note, This feature is currently sorried out for Windows targets trying to
+@item ms_hook_prologue
+@cindex @code{ms_hook_prologue} attribute
+
+On 32 bit i[34567]86-*-* targets, you can use this function attribute to make
+gcc generate the "hot-patching" function prologue used in Win32 API
+functions in Microsoft Windows XP Service Pack 2 and newer. This requires
+support for the swap suffix in the assembler. (GNU Binutils 2.19.51 or later)
+
@item naked
@cindex function without a prologue/epilogue code
-Use this attribute on the ARM, AVR, IP2K and SPU ports to indicate that
+Use this attribute on the ARM, AVR, IP2K, RX and SPU ports to indicate that
the specified function does not need prologue/epilogue sequences generated by
the compiler. It is up to the programmer to provide these sequences. The
only statements that can be safely included in naked functions are
@@ -3173,6 +3207,16 @@ Enable/disable the generation of the SSE4A instructions.
@cindex @code{target("fma4")} attribute
Enable/disable the generation of the FMA4 instructions.
+@item xop
+@itemx no-xop
+@cindex @code{target("xop")} attribute
+Enable/disable the generation of the XOP instructions.
+
+@item lwp
+@itemx no-lwp
+@cindex @code{target("lwp")} attribute
+Enable/disable the generation of the LWP instructions.
+
@item ssse3
@itemx no-ssse3
@cindex @code{target("ssse3")} attribute
@@ -7452,6 +7496,7 @@ instructions, but allow the compiler to schedule those calls.
* Other MIPS Built-in Functions::
* picoChip Built-in Functions::
* PowerPC AltiVec/VSX Built-in Functions::
+* RX Built-in Functions::
* SPARC VIS Built-in Functions::
* SPU Built-in Functions::
@end menu
@@ -8893,6 +8938,134 @@ v2di __builtin_ia32_insertq (v2di, v2di)
v2di __builtin_ia32_insertqi (v2di, v2di, const unsigned int, const unsigned int)
@end smallexample
+The following built-in functions are available when @option{-mxop} is used.
+@smallexample
+v2df __builtin_ia32_vfrczpd (v2df)
+v4sf __builtin_ia32_vfrczps (v4sf)
+v2df __builtin_ia32_vfrczsd (v2df, v2df)
+v4sf __builtin_ia32_vfrczss (v4sf, v4sf)
+v4df __builtin_ia32_vfrczpd256 (v4df)
+v8sf __builtin_ia32_vfrczps256 (v8sf)
+v2di __builtin_ia32_vpcmov (v2di, v2di, v2di)
+v2di __builtin_ia32_vpcmov_v2di (v2di, v2di, v2di)
+v4si __builtin_ia32_vpcmov_v4si (v4si, v4si, v4si)
+v8hi __builtin_ia32_vpcmov_v8hi (v8hi, v8hi, v8hi)
+v16qi __builtin_ia32_vpcmov_v16qi (v16qi, v16qi, v16qi)
+v2df __builtin_ia32_vpcmov_v2df (v2df, v2df, v2df)
+v4sf __builtin_ia32_vpcmov_v4sf (v4sf, v4sf, v4sf)
+v4di __builtin_ia32_vpcmov_v4di256 (v4di, v4di, v4di)
+v8si __builtin_ia32_vpcmov_v8si256 (v8si, v8si, v8si)
+v16hi __builtin_ia32_vpcmov_v16hi256 (v16hi, v16hi, v16hi)
+v32qi __builtin_ia32_vpcmov_v32qi256 (v32qi, v32qi, v32qi)
+v4df __builtin_ia32_vpcmov_v4df256 (v4df, v4df, v4df)
+v8sf __builtin_ia32_vpcmov_v8sf256 (v8sf, v8sf, v8sf)
+v16qi __builtin_ia32_vpcomeqb (v16qi, v16qi)
+v8hi __builtin_ia32_vpcomeqw (v8hi, v8hi)
+v4si __builtin_ia32_vpcomeqd (v4si, v4si)
+v2di __builtin_ia32_vpcomeqq (v2di, v2di)
+v16qi __builtin_ia32_vpcomequb (v16qi, v16qi)
+v4si __builtin_ia32_vpcomequd (v4si, v4si)
+v2di __builtin_ia32_vpcomequq (v2di, v2di)
+v8hi __builtin_ia32_vpcomequw (v8hi, v8hi)
+v8hi __builtin_ia32_vpcomeqw (v8hi, v8hi)
+v16qi __builtin_ia32_vpcomfalseb (v16qi, v16qi)
+v4si __builtin_ia32_vpcomfalsed (v4si, v4si)
+v2di __builtin_ia32_vpcomfalseq (v2di, v2di)
+v16qi __builtin_ia32_vpcomfalseub (v16qi, v16qi)
+v4si __builtin_ia32_vpcomfalseud (v4si, v4si)
+v2di __builtin_ia32_vpcomfalseuq (v2di, v2di)
+v8hi __builtin_ia32_vpcomfalseuw (v8hi, v8hi)
+v8hi __builtin_ia32_vpcomfalsew (v8hi, v8hi)
+v16qi __builtin_ia32_vpcomgeb (v16qi, v16qi)
+v4si __builtin_ia32_vpcomged (v4si, v4si)
+v2di __builtin_ia32_vpcomgeq (v2di, v2di)
+v16qi __builtin_ia32_vpcomgeub (v16qi, v16qi)
+v4si __builtin_ia32_vpcomgeud (v4si, v4si)
+v2di __builtin_ia32_vpcomgeuq (v2di, v2di)
+v8hi __builtin_ia32_vpcomgeuw (v8hi, v8hi)
+v8hi __builtin_ia32_vpcomgew (v8hi, v8hi)
+v16qi __builtin_ia32_vpcomgtb (v16qi, v16qi)
+v4si __builtin_ia32_vpcomgtd (v4si, v4si)
+v2di __builtin_ia32_vpcomgtq (v2di, v2di)
+v16qi __builtin_ia32_vpcomgtub (v16qi, v16qi)
+v4si __builtin_ia32_vpcomgtud (v4si, v4si)
+v2di __builtin_ia32_vpcomgtuq (v2di, v2di)
+v8hi __builtin_ia32_vpcomgtuw (v8hi, v8hi)
+v8hi __builtin_ia32_vpcomgtw (v8hi, v8hi)
+v16qi __builtin_ia32_vpcomleb (v16qi, v16qi)
+v4si __builtin_ia32_vpcomled (v4si, v4si)
+v2di __builtin_ia32_vpcomleq (v2di, v2di)
+v16qi __builtin_ia32_vpcomleub (v16qi, v16qi)
+v4si __builtin_ia32_vpcomleud (v4si, v4si)
+v2di __builtin_ia32_vpcomleuq (v2di, v2di)
+v8hi __builtin_ia32_vpcomleuw (v8hi, v8hi)
+v8hi __builtin_ia32_vpcomlew (v8hi, v8hi)
+v16qi __builtin_ia32_vpcomltb (v16qi, v16qi)
+v4si __builtin_ia32_vpcomltd (v4si, v4si)
+v2di __builtin_ia32_vpcomltq (v2di, v2di)
+v16qi __builtin_ia32_vpcomltub (v16qi, v16qi)
+v4si __builtin_ia32_vpcomltud (v4si, v4si)
+v2di __builtin_ia32_vpcomltuq (v2di, v2di)
+v8hi __builtin_ia32_vpcomltuw (v8hi, v8hi)
+v8hi __builtin_ia32_vpcomltw (v8hi, v8hi)
+v16qi __builtin_ia32_vpcomneb (v16qi, v16qi)
+v4si __builtin_ia32_vpcomned (v4si, v4si)
+v2di __builtin_ia32_vpcomneq (v2di, v2di)
+v16qi __builtin_ia32_vpcomneub (v16qi, v16qi)
+v4si __builtin_ia32_vpcomneud (v4si, v4si)
+v2di __builtin_ia32_vpcomneuq (v2di, v2di)
+v8hi __builtin_ia32_vpcomneuw (v8hi, v8hi)
+v8hi __builtin_ia32_vpcomnew (v8hi, v8hi)
+v16qi __builtin_ia32_vpcomtrueb (v16qi, v16qi)
+v4si __builtin_ia32_vpcomtrued (v4si, v4si)
+v2di __builtin_ia32_vpcomtrueq (v2di, v2di)
+v16qi __builtin_ia32_vpcomtrueub (v16qi, v16qi)
+v4si __builtin_ia32_vpcomtrueud (v4si, v4si)
+v2di __builtin_ia32_vpcomtrueuq (v2di, v2di)
+v8hi __builtin_ia32_vpcomtrueuw (v8hi, v8hi)
+v8hi __builtin_ia32_vpcomtruew (v8hi, v8hi)
+v4si __builtin_ia32_vphaddbd (v16qi)
+v2di __builtin_ia32_vphaddbq (v16qi)
+v8hi __builtin_ia32_vphaddbw (v16qi)
+v2di __builtin_ia32_vphadddq (v4si)
+v4si __builtin_ia32_vphaddubd (v16qi)
+v2di __builtin_ia32_vphaddubq (v16qi)
+v8hi __builtin_ia32_vphaddubw (v16qi)
+v2di __builtin_ia32_vphaddudq (v4si)
+v4si __builtin_ia32_vphadduwd (v8hi)
+v2di __builtin_ia32_vphadduwq (v8hi)
+v4si __builtin_ia32_vphaddwd (v8hi)
+v2di __builtin_ia32_vphaddwq (v8hi)
+v8hi __builtin_ia32_vphsubbw (v16qi)
+v2di __builtin_ia32_vphsubdq (v4si)
+v4si __builtin_ia32_vphsubwd (v8hi)
+v4si __builtin_ia32_vpmacsdd (v4si, v4si, v4si)
+v2di __builtin_ia32_vpmacsdqh (v4si, v4si, v2di)
+v2di __builtin_ia32_vpmacsdql (v4si, v4si, v2di)
+v4si __builtin_ia32_vpmacssdd (v4si, v4si, v4si)
+v2di __builtin_ia32_vpmacssdqh (v4si, v4si, v2di)
+v2di __builtin_ia32_vpmacssdql (v4si, v4si, v2di)
+v4si __builtin_ia32_vpmacsswd (v8hi, v8hi, v4si)
+v8hi __builtin_ia32_vpmacssww (v8hi, v8hi, v8hi)
+v4si __builtin_ia32_vpmacswd (v8hi, v8hi, v4si)
+v8hi __builtin_ia32_vpmacsww (v8hi, v8hi, v8hi)
+v4si __builtin_ia32_vpmadcsswd (v8hi, v8hi, v4si)
+v4si __builtin_ia32_vpmadcswd (v8hi, v8hi, v4si)
+v16qi __builtin_ia32_vpperm (v16qi, v16qi, v16qi)
+v16qi __builtin_ia32_vprotb (v16qi, v16qi)
+v4si __builtin_ia32_vprotd (v4si, v4si)
+v2di __builtin_ia32_vprotq (v2di, v2di)
+v8hi __builtin_ia32_vprotw (v8hi, v8hi)
+v16qi __builtin_ia32_vpshab (v16qi, v16qi)
+v4si __builtin_ia32_vpshad (v4si, v4si)
+v2di __builtin_ia32_vpshaq (v2di, v2di)
+v8hi __builtin_ia32_vpshaw (v8hi, v8hi)
+v16qi __builtin_ia32_vpshlb (v16qi, v16qi)
+v4si __builtin_ia32_vpshld (v4si, v4si)
+v2di __builtin_ia32_vpshlq (v2di, v2di)
+v8hi __builtin_ia32_vpshlw (v8hi, v8hi)
+@end smallexample
+
The following built-in functions are available when @option{-mfma4} is used.
All of them generate the machine instruction that is part of the name
with MMX registers.
@@ -8933,6 +9106,23 @@ v8sf __builtin_ia32_fmsubaddps256 (v8sf, v8sf, v8sf)
@end smallexample
+The following built-in functions are available when @option{-mlwp} is used.
+
+@smallexample
+void __builtin_ia32_llwpcb16 (void *);
+void __builtin_ia32_llwpcb32 (void *);
+void __builtin_ia32_llwpcb64 (void *);
+void * __builtin_ia32_llwpcb16 (void);
+void * __builtin_ia32_llwpcb32 (void);
+void * __builtin_ia32_llwpcb64 (void);
+void __builtin_ia32_lwpval16 (unsigned short, unsigned int, unsigned short)
+void __builtin_ia32_lwpval32 (unsigned int, unsigned int, unsigned int)
+void __builtin_ia32_lwpval64 (unsigned __int64, unsigned int, unsigned int)
+unsigned char __builtin_ia32_lwpins16 (unsigned short, unsigned int, unsigned short)
+unsigned char __builtin_ia32_lwpins32 (unsigned int, unsigned int, unsigned int)
+unsigned char __builtin_ia32_lwpins64 (unsigned __int64, unsigned int, unsigned int)
+@end smallexample
+
The following built-in functions are available when @option{-m3dnow} is used.
All of them generate the machine instruction that is part of the name.
@@ -9732,7 +9922,7 @@ storing the value 32767 if the result overflows.
@item int __builtin_subs (int @var{x}, int @var{y})
Saturating subtraction. Return the result of subtracting @var{y} from
-@var{x}, storing the value -32768 if the result overflows.
+@var{x}, storing the value @minus{}32768 if the result overflows.
@item void __builtin_halt (void)
Halt. The processor will stop execution. This built-in is useful for
@@ -11746,6 +11936,121 @@ long __builtin_bpermd (long, long);
int __builtin_bswap16 (int);
@end smallexample
+@node RX Built-in Functions
+@subsection RX Built-in Functions
+GCC supports some of the RX instructions which cannot be expressed in
+the C programming language via the use of built-in functions. The
+following functions are supported:
+
+@deftypefn {Built-in Function} void __builtin_rx_brk (void)
+Generates the @code{brk} machine instruction.
+@end deftypefn
+
+@deftypefn {Built-in Function} void __builtin_rx_clrpsw (int)
+Generates the @code{clrpsw} machine instruction to clear the specified
+bit in the processor status word.
+@end deftypefn
+
+@deftypefn {Built-in Function} void __builtin_rx_int (int)
+Generates the @code{int} machine instruction to generate an interrupt
+with the specified value.
+@end deftypefn
+
+@deftypefn {Built-in Function} void __builtin_rx_machi (int, int)
+Generates the @code{machi} machine instruction to add the result of
+multiplying the top 16-bits of the two arguments into the
+accumulator.
+@end deftypefn
+
+@deftypefn {Built-in Function} void __builtin_rx_maclo (int, int)
+Generates the @code{maclo} machine instruction to add the result of
+multiplying the bottom 16-bits of the two arguments into the
+accumulator.
+@end deftypefn
+
+@deftypefn {Built-in Function} void __builtin_rx_mulhi (int, int)
+Generates the @code{mulhi} machine instruction to place the result of
+multiplying the top 16-bits of the two arguments into the
+accumulator.
+@end deftypefn
+
+@deftypefn {Built-in Function} void __builtin_rx_mullo (int, int)
+Generates the @code{mullo} machine instruction to place the result of
+multiplying the bottom 16-bits of the two arguments into the
+accumulator.
+@end deftypefn
+
+@deftypefn {Built-in Function} int __builtin_rx_mvfachi (void)
+Generates the @code{mvfachi} machine instruction to read the top
+32-bits of the accumulator.
+@end deftypefn
+
+@deftypefn {Built-in Function} int __builtin_rx_mvfacmi (void)
+Generates the @code{mvfacmi} machine instruction to read the middle
+32-bits of the accumulator.
+@end deftypefn
+
+@deftypefn {Built-in Function} int __builtin_rx_mvfc (int)
+Generates the @code{mvfc} machine instruction which reads the control
+register specified in its argument and returns its value.
+@end deftypefn
+
+@deftypefn {Built-in Function} void __builtin_rx_mvtachi (int)
+Generates the @code{mvtachi} machine instruction to set the top
+32-bits of the accumulator.
+@end deftypefn
+
+@deftypefn {Built-in Function} void __builtin_rx_mvtaclo (int)
+Generates the @code{mvtaclo} machine instruction to set the bottom
+32-bits of the accumulator.
+@end deftypefn
+
+@deftypefn {Built-in Function} void __builtin_rx_mvtc (int reg, int val)
+Generates the @code{mvtc} machine instruction which sets control
+register number @code{reg} to @code{val}.
+@end deftypefn
+
+@deftypefn {Built-in Function} void __builtin_rx_mvtipl (int)
+Generates the @code{mvtipl} machine instruction set the interrupt
+priority level.
+@end deftypefn
+
+@deftypefn {Built-in Function} void __builtin_rx_racw (int)
+Generates the @code{racw} machine instruction to round the accumulator
+according to the specified mode.
+@end deftypefn
+
+@deftypefn {Built-in Function} int __builtin_rx_revw (int)
+Generates the @code{revw} machine instruction which swaps the bytes in
+the argument so that bits 0--7 now occupy bits 8--15 and vice versa,
+and also bits 16--23 occupy bits 24--31 and vice versa.
+@end deftypefn
+
+@deftypefn {Built-in Function} void __builtin_rx_rmpa (void)
+Generates the @code{rmpa} machine instruction which initiates a
+repeated multiply and accumulate sequence.
+@end deftypefn
+
+@deftypefn {Built-in Function} void __builtin_rx_round (float)
+Generates the @code{round} machine instruction which returns the
+floating point argument rounded according to the current rounding mode
+set in the floating point status word register.
+@end deftypefn
+
+@deftypefn {Built-in Function} int __builtin_rx_sat (int)
+Generates the @code{sat} machine instruction which returns the
+saturated value of the argument.
+@end deftypefn
+
+@deftypefn {Built-in Function} void __builtin_rx_setpsw (int)
+Generates the @code{setpsw} machine instruction to set the specified
+bit in the processor status word.
+@end deftypefn
+
+@deftypefn {Built-in Function} void __builtin_rx_wait (void)
+Generates the @code{wait} machine instruction.
+@end deftypefn
+
@node SPARC VIS Built-in Functions
@subsection SPARC VIS Built-in Functions
@@ -11995,7 +12300,6 @@ extern int foo ();
@end table
-
@node RS/6000 and PowerPC Pragmas
@subsection RS/6000 and PowerPC Pragmas
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index bfa336e2e9e..0fd68244ea7 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -356,6 +356,15 @@ Alternatively, if an MPC source distribution is found in a
subdirectory of your GCC sources named @file{mpc}, it will be built
together with GCC@.
+@item libelf version 0.8.12 (or later)
+
+Necessary to build link-time optimization (LTO) support. It can be
+downloaded from @uref{http://www.mr511.de/software/libelf-0.8.12.tar.gz},
+though it is commonly available in several systems.
+
+The @option{--with-libelf} configure option should be used if libelf is
+not installed in your default library search patch.
+
@end table
@heading Tools/packages necessary for modifying GCC
@@ -1337,8 +1346,10 @@ powerpc-linux for powerpc64-linux, only generates 32-bit code. This
option enables the 32-bit target to be a bi-arch compiler, which is
useful when you want a bi-arch compiler that defaults to 32-bit, and
you are building a bi-arch or multi-arch binutils in a combined tree.
-Currently, this option only affects sparc-linux, powerpc-linux and
-x86-linux.
+On mips-linux, this will build a tri-arch compiler (ABI o32/n32/64),
+defaulted to o32.
+Currently, this option only affects sparc-linux, powerpc-linux, x86-linux
+and mips-linux.
@item --enable-secureplt
This option enables @option{-msecure-plt} by default for powerpc-linux.
@@ -1873,6 +1884,9 @@ not specified, then the Python modules are installed in $(prefix)/share/python.
@item --enable-aot-compile-rpm
Adds aot-compile-rpm to the list of installed scripts.
+@item --enable-browser-plugin
+Build the gcjwebplugin web browser plugin.
+
@table @code
@item ansi
Use the single-byte @code{char} and the Win32 A functions natively,
@@ -1893,6 +1907,30 @@ Use the @code{WCHAR} and Win32 W functions natively. Does @emph{not}
add @code{-lunicows} to @file{libgcj.spec}. The built executables will
only run on Microsoft Windows NT and above.
@end table
+
+@item --enable-lto
+Enable support for link-time optimization (LTO). This is enabled by
+default if a working libelf implementation is found (see
+@option{--with-libelf}).
+
+@item --with-libelf=@var{pathname}
+@itemx --with-libelf-include=@var{pathname}
+@itemx --with-libelf-lib=@var{pathname}
+If you do not have libelf installed in a standard location and you
+want to enable support for link-time optimization (LTO), you can
+explicitly specify the directory where libelf is installed
+(@samp{--with-libelf=@var{libelfinstalldir}}). The
+@option{--with-libelf=@var{libelfinstalldir}} option is shorthand for
+@option{--with-libelf-include=@var{libelfinstalldir}/include}
+@option{--with-libelf-lib=@var{libelfinstalldir}/lib}.
+
+@item --enable-gold
+Enable support for using @command{gold} as the linker. If gold support is
+enabled together with @option{--enable-lto}, an additional directory
+@file{lto-plugin} will be built. The code in this directory is a
+plugin for gold that allows the link-time optimizer to extract object
+files with LTO information out of library archives. See
+@option{-flto} and @option{-fwhopr} for details.
@end table
@subsubheading AWT-Specific Options
@@ -2656,7 +2694,7 @@ incomplete or out of date. Send a note to
@email{gcc@@gcc.gnu.org} detailing how the information should be changed.
If you find a bug, please report it following the
-@uref{../bugs.html,,bug reporting guidelines}.
+@uref{../bugs/,,bug reporting guidelines}.
If you want to print the GCC manuals, do @samp{cd @var{objdir}; make
dvi}. You will need to have @command{texi2dvi} (version at least 4.7)
@@ -3966,6 +4004,14 @@ Embedded PowerPC system in little endian mode.
@html
<hr />
@end html
+@heading @anchor{rx-x-elf}rx-*-elf
+The Renesas RX processor. See
+@uref{http://eu.renesas.com/fmwk.jsp?cnt=rx600_series_landing.jsp&fp=/products/mpumcu/rx_family/rx600_series}
+for more information about this processor.
+
+@html
+<hr />
+@end html
@heading @anchor{s390-x-linux}s390-*-linux*
S/390 system running GNU/Linux for S/390@.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index e12241c97c1..20a9395f0b7 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -307,6 +307,7 @@ Objective-C and Objective-C++ Dialects}.
-fcompare-debug@r{[}=@var{opts}@r{]} -fcompare-debug-second @gol
-feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
-feliminate-unused-debug-symbols -femit-class-debug-always @gol
+-fenable-icf-debug @gol
-fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
-frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
-fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
@@ -320,7 +321,7 @@ Objective-C and Objective-C++ Dialects}.
-femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
-femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
-p -pg -print-file-name=@var{library} -print-libgcc-file-name @gol
--print-multi-directory -print-multi-lib @gol
+-print-multi-directory -print-multi-lib -print-multi-os-directory @gol
-print-prog-name=@var{program} -print-search-dirs -Q @gol
-print-sysroot -print-sysroot-headers-suffix @gol
-save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
@@ -345,12 +346,13 @@ Objective-C and Objective-C++ Dialects}.
-finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg -fipa-pta @gol
-fipa-pure-const -fipa-reference -fipa-struct-reorg @gol
-fipa-type-escape -fira-algorithm=@var{algorithm} @gol
--fira-region=@var{region} -fira-coalesce -fno-ira-share-save-slots @gol
+-fira-region=@var{region} -fira-coalesce @gol
+-fira-loop-pressure -fno-ira-share-save-slots @gol
-fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
-fivopts -fkeep-inline-functions -fkeep-static-consts @gol
-floop-block -floop-interchange -floop-strip-mine -fgraphite-identity @gol
--floop-parallelize-all @gol
--fmerge-all-constants -fmerge-constants -fmodulo-sched @gol
+-floop-parallelize-all -flto -flto-compression-level -flto-report -fltrans @gol
+-fltrans-output-list -fmerge-all-constants -fmerge-constants -fmodulo-sched @gol
-fmodulo-sched-allow-regmoves -fmove-loop-invariants -fmudflap @gol
-fmudflapir -fmudflapth -fno-branch-count-reg -fno-default-inline @gol
-fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
@@ -389,7 +391,7 @@ Objective-C and Objective-C++ Dialects}.
-funit-at-a-time -funroll-all-loops -funroll-loops @gol
-funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
-fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
--fwhole-program @gol
+-fwhole-program -fwhopr -fwpa -fuse-linker-plugin @gol
--param @var{name}=@var{value}
-O -O0 -O1 -O2 -O3 -Os}
@@ -471,7 +473,7 @@ Objective-C and Objective-C++ Dialects}.
-mfix-cortex-m3-ldrd}
@emph{AVR Options}
-@gccoptlist{-mmcu=@var{mcu} -msize -mno-interrupts @gol
+@gccoptlist{-mmcu=@var{mcu} -mno-interrupts @gol
-mcall-prologues -mtiny-stack -mint8}
@emph{Blackfin Options}
@@ -592,7 +594,7 @@ Objective-C and Objective-C++ Dialects}.
-mcld -mcx16 -msahf -mmovbe -mcrc32 -mrecip @gol
-mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
-maes -mpclmul @gol
--msse4a -m3dnow -mpopcnt -mabm -mfma4 @gol
+-msse4a -m3dnow -mpopcnt -mabm -mfma4 -mxop -mlwp @gol
-mthreads -mno-align-stringops -minline-all-stringops @gol
-minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
-mpush-args -maccumulate-outgoing-args -m128bit-long-double @gol
@@ -707,7 +709,7 @@ Objective-C and Objective-C++ Dialects}.
-mbranch-cost=@var{num} -mbranch-likely -mno-branch-likely @gol
-mfp-exceptions -mno-fp-exceptions @gol
-mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
--mrelax-pic-calls -mno-relax-pic-calls}
+-mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
@emph{MMIX Options}
@gccoptlist{-mlibfuncs -mno-libfuncs -mepsilon -mno-epsilon -mabi=gnu @gol
@@ -781,6 +783,18 @@ See RS/6000 and PowerPC Options.
-msim -mmvme -mads -myellowknife -memb -msdata @gol
-msdata=@var{opt} -mvxworks -G @var{num} -pthread}
+@emph{RX Options}
+@gccoptlist{-m64bit-doubles -m32bit-doubles -fpu -nofpu@gol
+-mcpu= -patch=@gol
+-mbig-endian-data -mlittle-endian-data @gol
+-msmall-data @gol
+-msim -mno-sim@gol
+-mas100-syntax -mno-as100-syntax@gol
+-mrelax@gol
+-mmax-constant-size=@gol
+-mint-register=@gol
+-msave-acc-in-interrupts}
+
@emph{S/390 and zSeries Options}
@gccoptlist{-mtune=@var{cpu-type} -march=@var{cpu-type} @gol
-mhard-float -msoft-float -mhard-dfp -mno-hard-dfp @gol
@@ -834,7 +848,11 @@ See RS/6000 and PowerPC Options.
-msafe-dma -munsafe-dma @gol
-mbranch-hints @gol
-msmall-mem -mlarge-mem -mstdmain @gol
--mfixed-range=@var{register-range}}
+-mfixed-range=@var{register-range} @gol
+-mea32 -mea64 @gol
+-maddress-space-conversion -mno-address-space-conversion @gol
+-mcache-size=@var{cache-size} @gol
+-matomic-updates -mno-atomic-updates}
@emph{System V Options}
@gccoptlist{-Qy -Qn -YP,@var{paths} -Ym,@var{dir}}
@@ -861,7 +879,8 @@ See i386 and x86-64 Options.
@emph{i386 and x86-64 Windows Options}
@gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll
--mnop-fun-dllimport -mthread -municode -mwin32 -mwindows}
+-mnop-fun-dllimport -mthread -municode -mwin32 -mwindows
+-fno-set-stack-executable}
@emph{Xstormy16 Options}
@gccoptlist{-msim}
@@ -4315,7 +4334,7 @@ minimum maximum, so we do not diagnose overlength strings in C++@.
This option is implied by @option{-pedantic}, and can be disabled with
@option{-Wno-overlength-strings}.
-@item -Wunsuffixed-float-constants
+@item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
@opindex Wunsuffixed-float-constants
GCC will issue a warning for any floating constant that does not have
@@ -4609,6 +4628,11 @@ The default is @samp{-femit-struct-debug-detailed=all}.
This option works only with DWARF 2.
+@item -fenable-icf-debug
+@opindex fenable-icf-debug
+Generate additional debug information to support identical code folding (ICF).
+This option only works with DWARF version 2 or higher.
+
@item -fno-merge-debug-strings
@opindex fmerge-debug-strings
@opindex fno-merge-debug-strings
@@ -5524,6 +5548,16 @@ that enable them. The directory name is separated from the switches by
@samp{-}, without spaces between multiple switches. This is supposed to
ease shell-processing.
+@item -print-multi-os-directory
+@opindex print-multi-os-directory
+Print the path to OS libraries for the selected
+multilib, relative to some @file{lib} subdirectory. If OS libraries are
+present in the @file{lib} subdirectory and no multilibs are used, this is
+usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
+sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
+@file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
+subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
+
@item -print-prog-name=@var{program}
@opindex print-prog-name
Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
@@ -5621,6 +5655,9 @@ each of them.
Not all optimizations are controlled directly by a flag. Only
optimizations that have a flag are listed in this section.
+Most of the optimizations are not enabled if a @option{-O} level is not set on
+the command line, even if individual optimization flags are specified.
+
Depending on the target and how GCC was configured, a slightly different
set of optimizations may be enabled at each @option{-O} level than
those listed here. You can invoke GCC with @samp{-Q --help=optimizers}
@@ -6210,6 +6247,15 @@ give the best results in most cases and for most architectures.
Do optimistic register coalescing. This option might be profitable for
architectures with big regular register files.
+@item -fira-loop-pressure
+@opindex fira-loop-pressure
+Use IRA to evaluate register pressure in loops for decision to move
+loop invariants. Usage of this option usually results in generation
+of faster and smaller code on machines with big register files (>= 32
+registers) but it can slow compiler down.
+
+This option is enabled at level @option{-O3} for some targets.
+
@item -fno-ira-share-save-slots
@opindex fno-ira-share-save-slots
Switch off sharing stack slots used for saving call used hard
@@ -7105,12 +7151,237 @@ and those merged by attribute @code{externally_visible} become static functions
and in effect are optimized more aggressively by interprocedural optimizers.
While this option is equivalent to proper use of the @code{static} keyword for
programs consisting of a single file, in combination with option
-@option{--combine} this flag can be used to compile many smaller scale C
-programs since the functions and variables become local for the whole combined
-compilation unit, not for the single source file itself.
+@option{-combine}, @option{-flto} or @option{-fwhopr} this flag can be used to
+compile many smaller scale programs since the functions and variables become
+local for the whole combined compilation unit, not for the single source file
+itself.
This option implies @option{-fwhole-file} for Fortran programs.
+@item -flto
+@opindex flto
+This option runs the standard link-time optimizer. When invoked
+with source code, it generates GIMPLE (one of GCC's internal
+representations) and writes it to special ELF sections in the object
+file. When the object files are linked together, all the function
+bodies are read from these ELF sections and instantiated as if they
+had been part of the same translation unit.
+
+To use the link-timer optimizer, @option{-flto} needs to be specified at
+compile time and during the final link. For example,
+
+@smallexample
+gcc -c -O2 -flto foo.c
+gcc -c -O2 -flto bar.c
+gcc -o myprog -flto -O2 foo.o bar.o
+@end smallexample
+
+The first two invocations to GCC will save a bytecode representation
+of GIMPLE into special ELF sections inside @file{foo.o} and
+@file{bar.o}. The final invocation will read the GIMPLE bytecode from
+@file{foo.o} and @file{bar.o}, merge the two files into a single
+internal image, and compile the result as usual. Since both
+@file{foo.o} and @file{bar.o} are merged into a single image, this
+causes all the inter-procedural analyses and optimizations in GCC to
+work across the two files as if they were a single one. This means,
+for example, that the inliner will be able to inline functions in
+@file{bar.o} into functions in @file{foo.o} and vice-versa.
+
+Another (simpler) way to enable link-time optimization is,
+
+@smallexample
+gcc -o myprog -flto -O2 foo.c bar.c
+@end smallexample
+
+The above will generate bytecode for @file{foo.c} and @file{bar.c},
+merge them together into a single GIMPLE representation and optimize
+them as usual to produce @file{myprog}.
+
+The only important thing to keep in mind is that to enable link-time
+optimizations the @option{-flto} flag needs to be passed to both the
+compile and the link commands.
+
+Note that when a file is compiled with @option{-flto}, the generated
+object file will be larger than a regular object file because it will
+contain GIMPLE bytecodes and the usual final code. This means that
+object files with LTO information can be linked as a normal object
+file. So, in the previous example, if the final link is done with
+
+@smallexample
+gcc -o myprog foo.o bar.o
+@end smallexample
+
+The only difference will be that no inter-procedural optimizations
+will be applied to produce @file{myprog}. The two object files
+@file{foo.o} and @file{bar.o} will be simply sent to the regular
+linker.
+
+Additionally, the optimization flags used to compile individual files
+are not necessarily related to those used at link-time. For instance,
+
+@smallexample
+gcc -c -O0 -flto foo.c
+gcc -c -O0 -flto bar.c
+gcc -o myprog -flto -O3 foo.o bar.o
+@end smallexample
+
+This will produce individual object files with unoptimized assembler
+code, but the resulting binary @file{myprog} will be optimized at
+@option{-O3}. Now, if the final binary is generated without
+@option{-flto}, then @file{myprog} will not be optimized.
+
+When producing the final binary with @option{-flto}, GCC will only
+apply link-time optimizations to those files that contain bytecode.
+Therefore, you can mix and match object files and libraries with
+GIMPLE bytecodes and final object code. GCC will automatically select
+which files to optimize in LTO mode and which files to link without
+further processing.
+
+There are some code generation flags that GCC will preserve when
+generating bytecodes, as they need to be used during the final link
+stage. Currently, the following options are saved into the GIMPLE
+bytecode files: @option{-fPIC}, @option{-fcommon} and all the
+@option{-m} target flags.
+
+At link time, these options are read-in and reapplied. Note that the
+current implementation makes no attempt at recognizing conflicting
+values for these options. If two or more files have a conflicting
+value (e.g., one file is compiled with @option{-fPIC} and another
+isn't), the compiler will simply use the last value read from the
+bytecode files. It is recommended, then, that all the files
+participating in the same link be compiled with the same options.
+
+Another feature of LTO is that it is possible to apply interprocedural
+optimizations on files written in different languages. This requires
+some support in the language front end. Currently, the C, C++ and
+Fortran front ends are capable of emitting GIMPLE bytecodes, so
+something like this should work
+
+@smallexample
+gcc -c -flto foo.c
+g++ -c -flto bar.cc
+gfortran -c -flto baz.f90
+g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
+@end smallexample
+
+Notice that the final link is done with @command{g++} to get the C++
+runtime libraries and @option{-lgfortran} is added to get the Fortran
+runtime libraries. In general, when mixing languages in LTO mode, you
+should use the same link command used when mixing languages in a
+regular (non-LTO) compilation. This means that if your build process
+was mixing languages before, all you need to add is @option{-flto} to
+all the compile and link commands.
+
+If object files containing GIMPLE bytecode are stored in a library
+archive, say @file{libfoo.a}, it is possible to extract and use them
+in an LTO link if you are using @command{gold} as the linker (which,
+in turn requires GCC to be configured with @option{--enable-gold}).
+To enable this feature, use the flag @option{-fuse-linker-plugin} at
+link-time:
+
+@smallexample
+gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
+@end smallexample
+
+With the linker plugin enabled, @command{gold} will extract the needed
+GIMPLE files from @file{libfoo.a} and pass them on to the running GCC
+to make them part of the aggregated GIMPLE image to be optimized.
+
+If you are not using @command{gold} and/or do not specify
+@option{-fuse-linker-plugin} then the objects inside @file{libfoo.a}
+will be extracted and linked as usual, but they will not participate
+in the LTO optimization process.
+
+Link time optimizations do not require the presence of the whole
+program to operate. If the program does not require any symbols to
+be exported, it is possible to combine @option{-flto} and
+@option{-fwhopr} with @option{-fwhole-program} to allow the
+interprocedural optimizers to use more aggressive assumptions which
+may lead to improved optimization opportunities.
+
+Regarding portability: the current implementation of LTO makes no
+attempt at generating bytecode that can be ported between different
+types of hosts. The bytecode files are versioned and there is a
+strict version check, so bytecode files generated in one version of
+GCC will not work with an older/newer version of GCC.
+
+This option is disabled by default.
+
+@item -fwhopr
+@opindex fwhopr
+This option is identical in functionality to @option{-flto} but it
+differs in how the final link stage is executed. Instead of loading
+all the function bodies in memory, the callgraph is analyzed and
+optimization decisions are made (whole program analysis or WPA). Once
+optimization decisions are made, the callgraph is partitioned and the
+different sections are compiled separately (local transformations or
+LTRANS)@. This process allows optimizations on very large programs
+that otherwise would not fit in memory. This option enables
+@option{-fwpa} and @option{-fltrans} automatically.
+
+Disabled by default.
+
+@item -fwpa
+@opindex fwpa
+This is an internal option used by GCC when compiling with
+@option{-fwhopr}. You should never need to use it.
+
+This option runs the link-time optimizer in the whole-program-analysis
+(WPA) mode, which reads in summary information from all inputs and
+performs a whole-program analysis based on summary information only.
+It generates object files for subsequent runs of the link-time
+optimizer where individual object files are optimized using both
+summary information from the WPA mode and the actual function bodies.
+It then drives the LTRANS phase.
+
+Disabled by default.
+
+@item -fltrans
+@opindex fltrans
+This is an internal option used by GCC when compiling with
+@option{-fwhopr}. You should never need to use it.
+
+This option runs the link-time optimizer in the local-transformation (LTRANS)
+mode, which reads in output from a previous run of the LTO in WPA mode.
+In the LTRANS mode, LTO optimizes an object and produces the final assembly.
+
+Disabled by default.
+
+@item -fltrans-output-list=@var{file}
+@opindex fltrans-output-list
+This is an internal option used by GCC when compiling with
+@option{-fwhopr}. You should never need to use it.
+
+This option specifies a file to which the names of LTRANS output files are
+written. This option is only meaningful in conjunction with @option{-fwpa}.
+
+Disabled by default.
+
+@item -flto-compression-level=@var{n}
+This option specifies the level of compression used for intermediate
+language written to LTO object files, and is only meaningful in
+conjunction with LTO mode (@option{-fwhopr}, @option{-flto}). Valid
+values are 0 (no compression) to 9 (maximum compression). Values
+outside this range are clamped to either 0 or 9. If the option is not
+given, a default balanced compression setting is used.
+
+@item -flto-report
+Prints a report with internal details on the workings of the link-time
+optimizer. The contents of this report vary from version to version,
+it is meant to be useful to GCC developers when processing object
+files in LTO mode (via @option{-fwhopr} or @option{-flto}).
+
+Disabled by default.
+
+@item -fuse-linker-plugin
+Enables the extraction of objects with GIMPLE bytecode information
+from library archives. This option relies on features available only
+in @command{gold}, so to use this you must configure GCC with
+@option{--enable-gold}. See @option{-flto} for a description on the
+effect of this flag and how to use it.
+
+Disabled by default.
+
@item -fcprop-registers
@opindex fcprop-registers
After register allocation and post-register allocation instruction splitting,
@@ -8156,6 +8427,14 @@ lower quality register allocation algorithm will be used. The
algorithm do not use pseudo-register conflicts. The default value of
the parameter is 2000.
+@item ira-loop-reserved-regs
+IRA can be used to evaluate more accurate register pressure in loops
+for decision to move loop invariants (see @option{-O3}). The number
+of available registers reserved for some other purposes is described
+by this parameter. The default value of the parameter is 2 which is
+minimal number of registers needed for execution of typical
+instruction. This value is the best found from numerous experiments.
+
@item loop-invariant-max-bbs-in-loop
Loop invariant motion can be very expensive, both in compile time and
in amount of needed compile time memory, with very large loops. Loops
@@ -9268,6 +9547,7 @@ platform.
* picoChip Options::
* PowerPC Options::
* RS/6000 and PowerPC Options::
+* RX Options::
* S/390 and zSeries Options::
* Score Options::
* SH Options::
@@ -9706,10 +9986,6 @@ Instruction set avr5 is for the enhanced AVR core with up to 128K program
memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
atmega64, atmega128, at43usb355, at94k).
-@item -msize
-@opindex msize
-Output instruction sizes to the asm file.
-
@item -mno-interrupts
@opindex mno-interrupts
Generated code is not compatible with hardware interrupts.
@@ -10685,7 +10961,7 @@ These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
@table @gcctabopt
@item -mvms-return-codes
@opindex mvms-return-codes
-Return VMS condition codes from main. The default is to return POSIX
+Return VMS condition codes from main. The default is to return POSIX
style condition (e.g.@: error) codes.
@item -mdebug-main=@var{prefix}
@@ -11729,6 +12005,10 @@ preferred alignment to @option{-mpreferred-stack-boundary=2}.
@itemx -mno-sse4a
@itemx -mfma4
@itemx -mno-fma4
+@itemx -mxop
+@itemx -mno-xop
+@itemx -mlwp
+@itemx -mno-lwp
@itemx -m3dnow
@itemx -mno-3dnow
@itemx -mpopcnt
@@ -11742,8 +12022,8 @@ preferred alignment to @option{-mpreferred-stack-boundary=2}.
@opindex m3dnow
@opindex mno-3dnow
These switches enable or disable the use of instructions in the MMX,
-SSE, SSE2, SSE3, SSSE3, SSE4.1, AVX, AES, PCLMUL, SSE4A, FMA4, ABM or
-3DNow!@: extended instruction sets.
+SSE, SSE2, SSE3, SSSE3, SSE4.1, AVX, AES, PCLMUL, SSE4A, FMA4, XOP,
+LWP, ABM or 3DNow!@: extended instruction sets.
These extensions are also available as built-in functions: see
@ref{X86 Built-in Functions}, for details of the functions enabled and
disabled by these switches.
@@ -11816,6 +12096,10 @@ Note that while the throughput of the sequence is higher than the throughput
of the non-reciprocal instruction, the precision of the sequence can be
decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
+Note that GCC implements 1.0f/sqrtf(x) in terms of RSQRTSS (or RSQRTPS)
+already with @option{-ffast-math} (or the above option combination), and
+doesn't need @option{-mrecip}.
+
@item -mveclibabi=@var{type}
@opindex mveclibabi
Specifies the ABI type to use for vectorizing intrinsics using an
@@ -13934,6 +14218,27 @@ an assembler and a linker that supports the @code{.reloc} assembly
directive and @code{-mexplicit-relocs} is in effect. With
@code{-mno-explicit-relocs}, this optimization can be performed by the
assembler and the linker alone without help from the compiler.
+
+@item -mmcount-ra-address
+@itemx -mno-mcount-ra-address
+@opindex mmcount-ra-address
+@opindex mno-mcount-ra-address
+Emit (do not emit) code that allows @code{_mcount} to modify the
+calling function's return address. When enabled, this option extends
+the usual @code{_mcount} interface with a new @var{ra-address}
+parameter, which has type @code{intptr_t *} and is passed in register
+@code{$12}. @code{_mcount} can then modify the return address by
+doing both of the following:
+@itemize
+@item
+Returning the new address in register @code{$31}.
+@item
+Storing the new address in @code{*@var{ra-address}},
+if @var{ra-address} is nonnull.
+@end itemize
+
+The default is @option{-mno-mcount-ra-address}.
+
@end table
@node MMIX Options
@@ -14379,11 +14684,11 @@ Set architecture type, register usage, choice of mnemonics, and
instruction scheduling parameters for machine type @var{cpu_type}.
Supported values for @var{cpu_type} are @samp{401}, @samp{403},
@samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
-@samp{505}, @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
-@samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
-@samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
-@samp{860}, @samp{970}, @samp{8540}, @samp{e300c2}, @samp{e300c3},
-@samp{e500mc}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
+@samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
+@samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
+@samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
+@samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
+@samp{e300c3}, @samp{e500mc}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
@samp{power}, @samp{power2}, @samp{power3}, @samp{power4},
@samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x}, @samp{power7},
@samp{common}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
@@ -14727,7 +15032,7 @@ hardware floating is used.
@opindex mmulhw
@opindex mno-mulhw
Generate code that uses (does not use) the half-word multiply and
-multiply-accumulate instructions on the IBM 405, 440 and 464 processors.
+multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
These instructions are generated by default when targetting those
processors.
@@ -14736,7 +15041,7 @@ processors.
@opindex mdlmzb
@opindex mno-dlmzb
Generate code that uses (does not use) the string-search @samp{dlmzb}
-instruction on the IBM 405, 440 and 464 processors. This instruction is
+instruction on the IBM 405, 440, 464 and 476 processors. This instruction is
generated by default when targetting those processors.
@item -mno-bit-align
@@ -15104,6 +15409,142 @@ This option sets flags for both the preprocessor and linker.
@end table
+@node RX Options
+@subsection RX Options
+@cindex RX Options
+
+These @option{-m} options are defined for RX implementations:
+
+@table @gcctabopt
+@item -m64bit-doubles
+@itemx -m32bit-doubles
+@itemx -fpu
+@itemx -nofpu
+@opindex m64bit-doubles
+@opindex m32bit-doubles
+@opindex fpu
+@opindex nofpu
+Make the @code{double} data type be 64-bits (@option{-m64bit-doubles})
+or 32-bits (@option{-m32bit-doubles}) in size. The default is
+@option{-m64bit-doubles}. @emph{Note} the RX's hardware floating
+point instructions are only used for 32-bit floating point values, and
+then only if @option{-ffast-math} has been specified on the command
+line. This is because the RX FPU instructions do not properly support
+denormal (or sub-normal) values.
+
+The options @option{-fpu} and @option{-nofpu} have been provided at
+the request of Rensas for compatibility with their toolchain. The
+@option{-mfpu} option enables the use of RX FPU instructions by
+selecting 32-bit doubles and enabling unsafe math optimizations. The
+@option{-mnofpu} option disables the use of RX FPU instructions, even
+if @option{-m32bit-doubles} is active and unsafe math optimizations
+have been enabled.
+
+@item -mcpu=@var{name}
+@itemx -patch=@var{name}
+@opindex -mcpu
+@opindex -patch
+Selects the type of RX CPU to be targeted. Currently on two types are
+supported, the generic @var{RX600} and the specific @var{RX610}. The
+only difference between them is that the @var{RX610} does not support
+the @code{MVTIPL} instruction.
+
+@item -mbig-endian-data
+@itemx -mlittle-endian-data
+@opindex mbig-endian-data
+@opindex mlittle-endian-data
+Store data (but not code) in the big-endian format. The default is
+@option{-mlittle-endian-data}, ie to store data in the little endian
+format.
+
+@item -msmall-data-limit=@var{N}
+@opindex msmall-data-limit
+Specifies the maximum size in bytes of global and static variables
+which can be placed into the small data area. Using the small data
+area can lead to smaller and faster code, but the size of area is
+limited and it is up to the programmer to ensure that the area does
+not overflow. Also when the small data area is used one of the RX's
+registers (@code{r13}) is reserved for use pointing to this area, so
+it is no longer available for use by the compiler. This could result
+in slower and/or larger code if variables which once could have been
+held in @code{r13} are now pushed onto the stack.
+
+Note, common variables (variables which have not been initialised) and
+constants are not placed into the small data area as they are assigned
+to other sections in the output executeable.
+
+The default value is zero, which disables this feature. Note, this
+feature is not enabled by default with higher optimization levels
+(@option{-O2} etc) because of the potentially deterimental effects of
+reserving register @code{r13}. It is up to the programmer to
+experiment and discover whether this feature is of benefit to their
+program.
+
+@item -msim
+@item -mno-sim
+@opindex msim
+@opindex mno-sim
+Use the simulator runtime. The default is to use the libgloss board
+specific runtime.
+
+@item -mas100-syntax
+@item -mno-as100-syntax
+@opindex mas100-syntax
+@opindex mno-as100-syntax
+When generating assembler output use a syntax that is compatible with
+Renesas's AS100 assembler. This syntax can also be handled by the GAS
+assembler but it has some restrictions so generating it is not the
+default option.
+
+@item -mmax-constant-size=@var{N}
+@opindex mmax-constant-size
+Specifies the maxium size, in bytes, of a constant that can be used as
+an operand in a RX instruction. Although the RX instruction set does
+allow consants of up to 4 bytes in length to be used in instructions,
+a longer value equates to a longer instruction. Thus in some
+circumstances it can be beneficial to restrict the size of constants
+that are used in instructions. Constants that are too big are instead
+placed into a constant pool and referenced via register indirection.
+
+The value @var{N} can be between 0 and 3. A value of 0, the default,
+means that constants of any size are allowed.
+
+@item -mrelax
+@opindex mrelax
+Enable linker relaxation. Linker relaxation is a process whereby the
+linker will attempt to reduce the size of a program by finding shorter
+versions of various instructions. Disabled by default.
+
+@item -mint-register=@var{N}
+@opindex mint-register
+Specify the number of registers to reserve for fast interrupt handler
+functions. The value @var{N} can be between 0 and 4. A value of 1
+means that register @code{r13} will be reserved for ther exclusive use
+of fast interrupt handlers. A value of 2 reserves @code{r13} and
+@code{r12}. A value of 3 reserves @code{r13}, @code{r12} and
+@code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
+A value of 0, the default, does not reserve any registers.
+
+@item -msave-acc-in-interrupts
+@opindex msave-acc-in-interrupts
+Specifies that interrupt handler functions should preserve the
+accumulator register. This is only necessary if normal code might use
+the accumulator register, for example because it performs 64-bit
+multiplications. The default is to ignore the accumulator as this
+makes the interrupt handlers faster.
+
+@end table
+
+@emph{Note:} The generic GCC command line @option{-ffixed-@var{reg}}
+has special significance to the RX port when used with the
+@code{interrupt} function attribute. This attribute indicates a
+function intended to process fast interrupts. GCC will will ensure
+that it only uses the registers @code{r10}, @code{r11}, @code{r12}
+and/or @code{r13} and only provided that the normal use of the
+corresponding registers have been restricted via the
+@option{-ffixed-@var{reg}} or @option{-mint-register} command line
+options.
+
@node S/390 and zSeries Options
@subsection S/390 and zSeries Options
@cindex S/390 and zSeries Options
@@ -15983,6 +16424,46 @@ useful when compiling kernel code. A register range is specified as
two registers separated by a dash. Multiple register ranges can be
specified separated by a comma.
+@item -mea32
+@itemx -mea64
+@opindex mea32
+@opindex mea64
+Compile code assuming that pointers to the PPU address space accessed
+via the @code{__ea} named address space qualifier are either 32 or 64
+bits wide. The default is 32 bits. As this is an ABI changing option,
+all object code in an executable must be compiled with the same setting.
+
+@item -maddress-space-conversion
+@itemx -mno-address-space-conversion
+@opindex maddress-space-conversion
+@opindex mno-address-space-conversion
+Allow/disallow treating the @code{__ea} address space as superset
+of the generic address space. This enables explicit type casts
+between @code{__ea} and generic pointer as well as implicit
+conversions of generic pointers to @code{__ea} pointers. The
+default is to allow address space pointer conversions.
+
+@item -mcache-size=@var{cache-size}
+@opindex mcache-size
+This option controls the version of libgcc that the compiler links to an
+executable and selects a software-managed cache for accessing variables
+in the @code{__ea} address space with a particular cache size. Possible
+options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
+and @samp{128}. The default cache size is 64KB.
+
+@item -matomic-updates
+@itemx -mno-atomic-updates
+@opindex matomic-updates
+@opindex mno-atomic-updates
+This option controls the version of libgcc that the compiler links to an
+executable and selects whether atomic updates to the software-managed
+cache of PPU-side variables are used. If you use atomic updates, changes
+to a PPU variable from SPU code using the @code{__ea} named address space
+qualifier will not interfere with changes to other PPU variables residing
+in the same cache line from PPU code. If you do not use atomic updates,
+such interference may occur; however, writing back cache lines will be
+more efficient. The default behavior is to use atomic updates.
+
@item -mdual-nops
@itemx -mdual-nops=@var{n}
@opindex mdual-nops
@@ -16285,6 +16766,14 @@ specifies that a GUI application is to be generated by
instructing the linker to set the PE header subsystem type
appropriately.
+@item -fno-set-stack-executable
+@opindex fno-set-stack-executable
+This option is available for MinGW targets. It specifies that
+the executable flag for stack used by nested functions isn't
+set. This is necessary for binaries running in kernel mode of
+Windows, as there the user32 API, which is used to set executable
+privileges, isn't available.
+
@item -mpe-aligned-commons
@opindex mpe-aligned-commons
This option is available for Cygwin and MinGW targets. It
diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi
index 69a23b693b4..2974dcfb20c 100644
--- a/gcc/doc/md.texi
+++ b/gcc/doc/md.texi
@@ -1756,7 +1756,7 @@ Constant integer 1
A floating point constant 0.0
@item R
-Integer constant in the range -6 @dots{} 5.
+Integer constant in the range @minus{}6 @dots{} 5.
@item Q
A memory address based on Y or Z pointer with displacement.
@@ -1787,7 +1787,7 @@ Constant that fits in 4 bits
Constant that fits in 5 bits
@item L
-Constant that is one of -1, 4, -4, 7, 8, 12, 16, 20, 32, 48
+Constant that is one of @minus{}1, 4, @minus{}4, 7, 8, 12, 16, 20, 32, 48
@item G
Floating point constant that is legal for store immediate
@@ -2381,13 +2381,13 @@ RETN, RETI, RETX, RETE, ASTAT, SEQSTAT and USP.
Any register except accumulators or CC.
@item Ksh
-Signed 16 bit integer (in the range -32768 to 32767)
+Signed 16 bit integer (in the range @minus{}32768 to 32767)
@item Kuh
Unsigned 16 bit integer (in the range 0 to 65535)
@item Ks7
-Signed 7 bit integer (in the range -64 to 63)
+Signed 7 bit integer (in the range @minus{}64 to 63)
@item Ku7
Unsigned 7 bit integer (in the range 0 to 127)
@@ -2396,10 +2396,10 @@ Unsigned 7 bit integer (in the range 0 to 127)
Unsigned 5 bit integer (in the range 0 to 31)
@item Ks4
-Signed 4 bit integer (in the range -8 to 7)
+Signed 4 bit integer (in the range @minus{}8 to 7)
@item Ks3
-Signed 3 bit integer (in the range -3 to 4)
+Signed 3 bit integer (in the range @minus{}3 to 4)
@item Ku3
Unsigned 3 bit integer (in the range 0 to 7)
@@ -2511,28 +2511,28 @@ Matches multiple registers in a PARALLEL to form a larger register.
Used to match function return values.
@item Is3
--8 @dots{} 7
+@minus{}8 @dots{} 7
@item IS1
--128 @dots{} 127
+@minus{}128 @dots{} 127
@item IS2
--32768 @dots{} 32767
+@minus{}32768 @dots{} 32767
@item IU2
0 @dots{} 65535
@item In4
--8 @dots{} -1 or 1 @dots{} 8
+@minus{}8 @dots{} @minus{}1 or 1 @dots{} 8
@item In5
--16 @dots{} -1 or 1 @dots{} 16
+@minus{}16 @dots{} @minus{}1 or 1 @dots{} 16
@item In6
--32 @dots{} -1 or 1 @dots{} 32
+@minus{}32 @dots{} @minus{}1 or 1 @dots{} 32
@item IM2
--65536 @dots{} -1
+@minus{}65536 @dots{} @minus{}1
@item Ilb
An 8 bit value with exactly one bit set.
@@ -2717,7 +2717,7 @@ A constant that cannot be loaded using @code{lui}, @code{addiu}
or @code{ori}.
@item N
-A constant in the range -65535 to -1 (inclusive).
+A constant in the range @minus{}65535 to @minus{}1 (inclusive).
@item O
A signed 15-bit constant.
@@ -2893,7 +2893,33 @@ A register indirect memory operand
A constant in the range of 0 to 255.
@item N
-A constant in the range of 0 to -255.
+A constant in the range of 0 to @minus{}255.
+
+@end table
+
+@item RX---@file{config/rx/constraints.md}
+@table @code
+@item Q
+An address which does not involve register indirect addressing or
+pre/post increment/decrement addressing.
+
+@item Symbol
+A symbol reference.
+
+@item Int08
+A constant in the range @minus{}256 to 255, inclusive.
+
+@item Sint08
+A constant in the range @minus{}128 to 127, inclusive.
+
+@item Sint16
+A constant in the range @minus{}32768 to 32767, inclusive.
+
+@item Sint24
+A constant in the range @minus{}8388608 to 8388607, inclusive.
+
+@item Uint04
+A constant in the range 0 to 15, inclusive.
@end table
@@ -3012,7 +3038,7 @@ An immediate for and/xor/or instructions. const_int is treated as a 32 bit valu
An immediate for the @code{iohl} instruction. const_int is treated as a 32 bit value.
@item I
-A constant in the range [-64, 63] for shift/rotate instructions.
+A constant in the range [@minus{}64, 63] for shift/rotate instructions.
@item J
An unsigned 7-bit constant for conversion/nop/channel instructions.
@@ -3083,7 +3109,7 @@ Value appropriate as displacement.
@table @code
@item (0..4095)
for short displacement
-@item (-524288..524287)
+@item (@minus{}524288..524287)
for long displacement
@end table
@@ -5011,11 +5037,19 @@ operations in addition to updating the stack pointer.
@item @samp{check_stack}
If stack checking cannot be done on your system by probing the stack with
a load or store instruction (@pxref{Stack Checking}), define this pattern
-to perform the needed check and signaling an error if the stack
-has overflowed. The single operand is the location in the stack furthest
-from the current stack pointer that you need to validate. Normally,
-on machines where this pattern is needed, you would obtain the stack
-limit from a global or thread-specific variable or register.
+to perform the needed check and signal an error if the stack has overflowed.
+The single operand is the address in the stack furthest from the current
+stack pointer that you need to validate. Normally, on machines where this
+pattern is needed, you would obtain the stack limit from a global or
+thread-specific variable or register.
+
+@cindex @code{probe_stack} instruction pattern
+@item @samp{probe_stack}
+If stack checking can be done on your system by probing the stack but doing
+it with a load or store instruction is not optimal (@pxref{Stack Checking}),
+define this pattern to do the probing differently and signal an error if
+the stack has overflowed. The single operand is the memory location in the
+stack that needs to be probed.
@cindex @code{nonlocal_goto} instruction pattern
@item @samp{nonlocal_goto}
diff --git a/gcc/doc/plugins.texi b/gcc/doc/plugins.texi
index bb32bccbf18..123f67075ad 100644
--- a/gcc/doc/plugins.texi
+++ b/gcc/doc/plugins.texi
@@ -136,6 +136,7 @@ enum plugin_event
PLUGIN_REGISTER_GGC_CACHES, /* Register an extra GGC cache table. */
PLUGIN_ATTRIBUTES, /* Called during attribute registration */
PLUGIN_START_UNIT, /* Called before processing a translation unit. */
+ PLUGIN_PRAGMAS, /* Called during pragma registration. */
PLUGIN_EVENT_LAST /* Dummy event used for indexing callback
array. */
@};
@@ -156,6 +157,11 @@ For the PLUGIN_PASS_MANAGER_SETUP, PLUGIN_INFO, PLUGIN_REGISTER_GGC_ROOTS
and PLUGIN_REGISTER_GGC_CACHES pseudo-events the @code{callback} should be
null, and the @code{user_data} is specific.
+When the PLUGIN_PRAGMAS event is triggered (with a null
+pointer as data from GCC), plugins may register their own pragmas
+using functions like @code{c_register_pragma} or
+@code{c_register_pragma_with_expansion}.
+
@section Interacting with the pass manager
There needs to be a way to add/reorder/remove passes dynamically. This
@@ -165,7 +171,7 @@ such as CFG or an IPA pass) and optimization plugins.
Basic support for inserting new passes or replacing existing passes is
provided. A plugin registers a new pass with GCC by calling
@code{register_callback} with the @code{PLUGIN_PASS_MANAGER_SETUP}
-event and a pointer to a @code{struct plugin_pass} object defined as follows
+event and a pointer to a @code{struct register_pass_info} object defined as follows
@smallexample
enum pass_positioning_ops
@@ -175,7 +181,7 @@ enum pass_positioning_ops
PASS_POS_REPLACE // Replace the reference pass.
@};
-struct plugin_pass
+struct register_pass_info
@{
struct opt_pass *pass; /* New pass provided by the plugin. */
const char *reference_pass_name; /* Name of the reference pass for hooking
@@ -192,7 +198,7 @@ int
plugin_init (struct plugin_name_args *plugin_info,
struct plugin_gcc_version *version)
@{
- struct plugin_pass pass_info;
+ struct register_pass_info pass_info;
...
diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi
index ba72b48096b..4888eb3f1e1 100644
--- a/gcc/doc/rtl.texi
+++ b/gcc/doc/rtl.texi
@@ -420,6 +420,11 @@ the size is implied by the mode.
@findex MEM_ALIGN
@item MEM_ALIGN (@var{x})
The known alignment in bits of the memory reference.
+
+@findex MEM_ADDR_SPACE
+@item MEM_ADDR_SPACE (@var{x})
+The address space of the memory reference. This will commonly be zero
+for the generic address space.
@end table
@item REG
@@ -2364,9 +2369,14 @@ Similar but represent left and right rotate. If @var{c} is a constant,
use @code{rotate}.
@findex abs
+@findex ss_abs
@cindex absolute value
@item (abs:@var{m} @var{x})
+@item (ss_abs:@var{m} @var{x})
Represents the absolute value of @var{x}, computed in mode @var{m}.
+@code{ss_abs} ensures that an out-of-bounds result saturates to the
+maximum signed value.
+
@findex sqrt
@cindex square root
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 22b27e76ec9..4cbc36f14a3 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -93,12 +93,16 @@ The Objective-C and Objective-C++ runtime library.
@item libstdc++-v3
The C++ runtime library.
+@item lto-plugin
+Plugin used by @command{gold} if link-time optimizations are enabled.
+
@item maintainer-scripts
Scripts used by the @code{gccadmin} account on @code{gcc.gnu.org}.
@item zlib
-The @code{zlib} compression library, used by the Java front end and as
-part of the Java runtime library.
+The @code{zlib} compression library, used by the Java front end, as
+part of the Java runtime library, and for compressing and uncompressing
+GCC's intermediate language in LTO object files.
@end table
The build system in the top level directory, including how recursion
@@ -137,11 +141,12 @@ The @file{gcc} directory contains the following subdirectories:
@item @var{language}
Subdirectories for various languages. Directories containing a file
@file{config-lang.in} are language subdirectories. The contents of
-the subdirectories @file{cp} (for C++), @file{objc} (for Objective-C)
-and @file{objcp} (for Objective-C++) are documented in this manual
-(@pxref{Passes, , Passes and Files of the Compiler}); those for other
-languages are not. @xref{Front End, , Anatomy of a Language Front End},
-for details of the files in these directories.
+the subdirectories @file{cp} (for C++), @file{lto} (for LTO),
+@file{objc} (for Objective-C) and @file{objcp} (for Objective-C++) are
+documented in this manual (@pxref{Passes, , Passes and Files of the
+Compiler}); those for other languages are not. @xref{Front End, ,
+Anatomy of a Language Front End}, for details of the files in these
+directories.
@item config
Configuration files for supported architectures and operating
@@ -821,6 +826,7 @@ here; FIXME: document the others.
* Ada Tests:: The Ada language testsuites.
* C Tests:: The C language testsuites.
* libgcj Tests:: The Java library testsuites.
+* LTO Testing:: Support for testing link-time optimizations.
* gcov Testing:: Support for testing gcov.
* profopt Testing:: Support for testing profile-directed optimizations.
* compat Testing:: Support for testing binary compatibility.
@@ -1347,6 +1353,42 @@ bugs in libgcj that had caused Mauve test failures.
We encourage developers to contribute test cases to Mauve.
+@node LTO Testing
+@subsection Support for testing link-time optimizations
+
+Tests for link-time optimizations usually require multiple source files
+that are compiled separately, perhaps with different sets of options.
+There are several special-purpose test directives used for these tests.
+
+@table @code
+@item @{ dg-lto-do @var{do-what-keyword} @}
+@var{do-what-keyword} specifies how the test is compiled and whether
+it is executed. It is one of:
+
+@table @code
+@item assemble
+Compile with @option{-c} to produce a relocatable object file.
+@item link
+Compile, assemble, and link to produce an executable file.
+@item run
+Produce and run an executable file, which is expected to return
+an exit code of 0.
+@end table
+
+The default is @code{assemble}. That can be overridden for a set of
+tests by redefining @code{dg-do-what-default} within the @code{.exp}
+file for those tests.
+
+Unlike @code{dg-do}, @code{dg-lto-do} does not support an optional
+@samp{target} or @samp{xfail} list. Use @code{dg-skip-if},
+@code{dg-xfail-if}, or @code{dg-xfail-run-if}.
+
+@item @{ dg-lto-options @{ @{ @var{options} @} [@{ @var{options} @}] @} [@{ target @var{selector} @}]@}
+This directive provides a list of one or more sets of compiler options
+to override @var{LTO_OPTIONS}. Each test will be compiled and run with
+each of these sets of options.
+@end table
+
@node gcov Testing
@subsection Support for testing @command{gcov}
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 27263d91c59..c69ef0c73ab 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -55,6 +55,7 @@ through the macros defined in the @file{.h} file.
* MIPS Coprocessors:: MIPS coprocessor support and how to customize it.
* PCH Target:: Validity checking for precompiled headers.
* C++ ABI:: Controlling C++ ABI changes.
+* Named Address Spaces:: Adding support for named address spaces
* Misc:: Everything else.
@end menu
@@ -813,8 +814,22 @@ parsed.
Don't use this macro to turn on various extra optimizations for
@option{-O}. That is what @code{OPTIMIZATION_OPTIONS} is for.
+
+If you need to do something whenever the optimization level is
+changed via the optimize attribute or pragma, see
+@code{TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE}
@end defmac
+@deftypefn {Target Hook} void TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE (void)
+This target function is similar to the macro @code{OVERRIDE_OPTIONS}
+but is called when the optimize level is changed via an attribute or
+pragma or when it is reset at the end of the code affected by the
+attribute or pragma. It is not called at the beginning of compilation
+when @code{OVERRIDE_OPTIONS} is called so if you want to perform these
+actions then, you should have @code{OVERRIDE_OPTIONS} call
+@code{TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE}.
+@end deftypefn
+
@defmac C_COMMON_OVERRIDE_OPTIONS
This is similar to @code{OVERRIDE_OPTIONS} but is only used in the C
language frontends (C, Objective-C, C++, Objective-C++) and so can be
@@ -2349,6 +2364,11 @@ with it, as well as defining these macros.
Define this if the machine has any stack-like registers.
@end defmac
+@defmac STACK_REG_COVER_CLASS
+This is a cover class containing the stack registers. Define this if
+the machine has any stack-like registers.
+@end defmac
+
@defmac FIRST_STACK_REG
The number of the first stack-like register. This one is the top
of the stack.
@@ -3524,7 +3544,7 @@ dynamically if their size exceeds @code{STACK_CHECK_MAX_VAR_SIZE} bytes.
@defmac STACK_CHECK_BUILTIN
A nonzero value if stack checking is done by the configuration files in a
machine-dependent manner. You should define this macro if stack checking
-is require by the ABI of your machine or if you would like to do stack
+is required by the ABI of your machine or if you would like to do stack
checking in some more efficient way than the generic approach. The default
value of this macro is zero.
@end defmac
@@ -3536,11 +3556,12 @@ like to do static stack checking in some more efficient way than the generic
approach. The default value of this macro is zero.
@end defmac
-@defmac STACK_CHECK_PROBE_INTERVAL
-An integer representing the interval at which GCC must generate stack
-probe instructions. You will normally define this macro to be no larger
-than the size of the ``guard pages'' at the end of a stack area. The
-default value of 4096 is suitable for most systems.
+@defmac STACK_CHECK_PROBE_INTERVAL_EXP
+An integer specifying the interval at which GCC must generate stack probe
+instructions, defined as 2 raised to this integer. You will normally
+define this macro so that the interval be no larger than the size of
+the ``guard pages'' at the end of a stack area. The default value
+of 12 (4096-byte interval) is suitable for most systems.
@end defmac
@defmac STACK_CHECK_PROBE_LOAD
@@ -3549,6 +3570,15 @@ as a load instruction and zero if GCC should use a store instruction.
The default is zero, which is the most efficient choice on most systems.
@end defmac
+@defmac STACK_CHECK_MOVING_SP
+An integer which is nonzero if GCC should move the stack pointer page by page
+when doing probes. This can be necessary on systems where the stack pointer
+contains the bottom address of the memory area accessible to the executing
+thread at any point in time. In this situation an alternate signal stack
+is required in order to be able to recover from a stack overflow. The
+default value of this macro is zero.
+@end defmac
+
@defmac STACK_CHECK_PROTECT
The number of bytes of stack needed to recover from a stack overflow,
for languages where such a recovery is supported. The default value of
@@ -3783,7 +3813,7 @@ registers @code{regs_ever_live} and @code{call_used_regs}.
If @code{ELIMINABLE_REGS} is defined, this macro will be not be used and
need not be defined. Otherwise, it must be defined even if
-@code{TARGET_FRAME_POINTER_REQUIRED} is always return true; in that
+@code{TARGET_FRAME_POINTER_REQUIRED} always returns true; in that
case, you may set @var{depth-var} to anything.
@end defmac
@@ -4200,7 +4230,6 @@ on the stack. The compiler knows how to track the amount of stack space
used for arguments without any special help.
@end defmac
-
@defmac FUNCTION_ARG_OFFSET (@var{mode}, @var{type})
If defined, a C expression that is the number of bytes to add to the
offset of the argument passed in memory. This is needed for the SPU,
@@ -4394,7 +4423,7 @@ compiled.
@end defmac
@deftypefn {Target Hook} rtx TARGET_LIBCALL_VALUE (enum machine_mode
-@var{mode}, rtx @var{fun})
+@var{mode}, const_rtx @var{fun})
Define this hook if the back-end needs to know the name of the libcall
function in order to determine where the result should be returned.
@@ -5365,9 +5394,10 @@ post-address side-effect generation involving a register displacement.
@defmac CONSTANT_ADDRESS_P (@var{x})
A C expression that is 1 if the RTX @var{x} is a constant which
-is a valid address. On most machines, this can be defined as
-@code{CONSTANT_P (@var{x})}, but a few machines are more restrictive
-in which constant addresses are supported.
+is a valid address. On most machines the default definition of
+@code{(CONSTANT_P (@var{x}) && GET_CODE (@var{x}) != CONST_DOUBLE)}
+is acceptable, but a few machines are more restrictive as to which
+constant addresses are supported.
@end defmac
@defmac CONSTANT_P (@var{x})
@@ -5628,7 +5658,7 @@ should comply with the semantics expected by @code{REALIGN_LOAD}
described above.
If this hook is not defined, then @var{addr} will be used as
the argument @var{OFF} to @code{REALIGN_LOAD}, in which case the low
-log2(@var{VS})-1 bits of @var{addr} will be considered.
+log2(@var{VS}) @minus{} 1 bits of @var{addr} will be considered.
@end deftypefn
@deftypefn {Target Hook} tree TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN (tree @var{x})
@@ -6122,7 +6152,7 @@ this macro is defined, it should produce a nonzero value when
@code{STRICT_ALIGNMENT} is nonzero.
@end defmac
-@defmac MOVE_RATIO
+@defmac MOVE_RATIO (@var{speed})
The threshold of number of scalar memory-to-memory move insns, @emph{below}
which a sequence of insns should be generated instead of a
string move insn or a library call. Increasing the value will always
@@ -6132,6 +6162,9 @@ Note that on machines where the corresponding move insn is a
@code{define_expand} that emits a sequence of insns, this macro counts
the number of such sequences.
+The parameter @var{speed} is true if the code is currently being
+optimized for speed rather than size.
+
If you don't define this, a reasonable default is used.
@end defmac
@@ -6147,12 +6180,15 @@ A C expression used by @code{move_by_pieces} to determine the largest unit
a load or store used to copy memory is. Defaults to @code{MOVE_MAX}.
@end defmac
-@defmac CLEAR_RATIO
+@defmac CLEAR_RATIO (@var{speed})
The threshold of number of scalar move insns, @emph{below} which a sequence
of insns should be generated to clear memory instead of a string clear insn
or a library call. Increasing the value will always make code faster, but
eventually incurs high cost in increased code size.
+The parameter @var{speed} is true if the code is currently being
+optimized for speed rather than size.
+
If you don't define this, a reasonable default is used.
@end defmac
@@ -6163,13 +6199,16 @@ will be used. Defaults to 1 if @code{move_by_pieces_ninsns} returns less
than @code{CLEAR_RATIO}.
@end defmac
-@defmac SET_RATIO
+@defmac SET_RATIO (@var{speed})
The threshold of number of scalar move insns, @emph{below} which a sequence
of insns should be generated to set memory to a constant value, instead of
a block set insn or a library call.
Increasing the value will always make code faster, but
eventually incurs high cost in increased code size.
+The parameter @var{speed} is true if the code is currently being
+optimized for speed rather than size.
+
If you don't define this, it defaults to the value of @code{MOVE_RATIO}.
@end defmac
@@ -6184,7 +6223,7 @@ than @code{SET_RATIO}.
@defmac STORE_BY_PIECES_P (@var{size}, @var{alignment})
A C expression used to determine whether @code{store_by_pieces} will be
-used to set a chunk of memory to a constant string value, or whether some
+used to set a chunk of memory to a constant string value, or whether some
other mechanism will be used. Used by @code{__builtin_strcpy} when
called with a constant source string.
Defaults to 1 if @code{move_by_pieces_ninsns} returns less
@@ -6250,7 +6289,7 @@ Define this macro if a non-short-circuit operation produced by
@code{BRANCH_COST} is greater than or equal to the value 2.
@end defmac
-@deftypefn {Target Hook} bool TARGET_RTX_COSTS (rtx @var{x}, int @var{code}, int @var{outer_code}, int *@var{total})
+@deftypefn {Target Hook} bool TARGET_RTX_COSTS (rtx @var{x}, int @var{code}, int @var{outer_code}, int *@var{total}, bool @var{speed})
This target hook describes the relative costs of RTL expressions.
The cost may depend on the precise form of the expression, which is
@@ -6269,15 +6308,15 @@ necessary. Traditionally, the default costs are @code{COSTS_N_INSNS (5)}
for multiplications, @code{COSTS_N_INSNS (7)} for division and modulus
operations, and @code{COSTS_N_INSNS (1)} for all other operations.
-When optimizing for code size, i.e.@: when @code{optimize_size} is
-nonzero, this target hook should be used to estimate the relative
+When optimizing for code size, i.e.@: when @code{speed} is
+false, this target hook should be used to estimate the relative
size cost of an expression, again relative to @code{COSTS_N_INSNS}.
The hook returns true when all subexpressions of @var{x} have been
processed, and false when @code{rtx_cost} should recurse.
@end deftypefn
-@deftypefn {Target Hook} int TARGET_ADDRESS_COST (rtx @var{address})
+@deftypefn {Target Hook} int TARGET_ADDRESS_COST (rtx @var{address}, bool @var{speed})
This hook computes the cost of an addressing mode that contains
@var{address}. If not defined, the cost is computed from
the @var{address} expression and the @code{TARGET_RTX_COST} hook.
@@ -6379,7 +6418,7 @@ debug output to. @var{verbose} is the verbose level provided by
list of instructions that are ready to be scheduled. @var{n_readyp} is
a pointer to the number of elements in the ready list. The scheduler
reads the ready list in reverse order, starting with
-@var{ready}[@var{*n_readyp}-1] and going to @var{ready}[0]. @var{clock}
+@var{ready}[@var{*n_readyp} @minus{} 1] and going to @var{ready}[0]. @var{clock}
is the timer tick of the scheduler. You may modify the ready list and
the number of ready insns. The return value is the number of insns that
can issue this cycle; normally this is just @code{issue_rate}. See also
@@ -6610,7 +6649,7 @@ speculative dependencies and therefore can be scheduled speculatively.
The hook is used to check if the pattern of @var{insn} has a speculative
version and, in case of successful check, to generate that speculative
pattern. The hook should return 1, if the instruction has a speculative form,
-or -1, if it doesn't. @var{request} describes the type of requested
+or @minus{}1, if it doesn't. @var{request} describes the type of requested
speculation. If the return value equals 1 then @var{new_pat} is assigned
the generated speculative pattern.
@end deftypefn
@@ -9511,7 +9550,7 @@ attributes, or a copy of the list may be made if further changes are
needed.
@end deftypefn
-@deftypefn {Target Hook} bool TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P (tree @var{fndecl})
+@deftypefn {Target Hook} bool TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P (const_tree @var{fndecl})
@cindex inlining
This target hook returns @code{true} if it is ok to inline @var{fndecl}
into the current function, despite its having target-specific
@@ -9811,6 +9850,105 @@ defined. Use this hook to make adjustments to the class (eg, tweak
visibility or perform any other required target modifications).
@end deftypefn
+@node Named Address Spaces
+@section Adding support for named address spaces
+@cindex named address spaces
+
+The draft technical report of the ISO/IEC JTC1 S22 WG14 N1275
+standards committee, @cite{Programming Languages - C - Extensions to
+support embedded processors}, specifies a syntax for embedded
+processors to specify alternate address spaces. You can configure a
+GCC port to support section 5.1 of the draft report to add support for
+address spaces other than the default address space. These address
+spaces are new keywords that are similar to the @code{volatile} and
+@code{const} type attributes.
+
+Pointers to named address spaces can a a different size than
+pointers to the generic address space.
+
+For example, the SPU port uses the @code{__ea} address space to refer
+to memory in the host processor, rather than memory local to the SPU
+processor. Access to memory in the @code{__ea} address space involves
+issuing DMA operations to move data between the host processor and the
+local processor memory address space. Pointers in the @code{__ea}
+address space are either 32 bits or 64 bits based on the
+@option{-mea32} or @option{-mea64} switches (native SPU pointers are
+always 32 bits).
+
+Internally, address spaces are represented as a small integer in the
+range 0 to 15 with address space 0 being reserved for the generic
+address space.
+
+@defmac TARGET_ADDR_SPACE_KEYWORDS
+A list of @code{ADDR_SPACE_KEYWORD} macros to define each named
+address keyword. The @code{ADDR_SPACE_KEYWORD} macro takes two
+arguments, the keyword string and the number of the named address
+space. For example, the SPU port uses the following to declare
+@code{__ea} as the keyword for named address space #1:
+@smallexample
+#define ADDR_SPACE_EA 1
+#define TARGET_ADDR_SPACE_KEYWORDS ADDR_SPACE_KEYWORD ("__ea", ADDR_SPACE_EA)
+@end smallexample
+@end defmac
+
+@deftypefn {Target Hook} {enum machine_mode} TARGET_ADDR_SPACE_POINTER_MODE (addr_space_t @var{address_space})
+Define this to return the machine mode to use for pointers to
+@var{address_space} if the target supports named address spaces.
+The default version of this hook returns @code{ptr_mode} for the
+generic address space only.
+@end deftypefn
+
+@deftypefn {Target Hook} {enum machine_mode} TARGET_ADDR_SPACE_ADDRESS_MODE (addr_space_t @var{address_space})
+Define this to return the machine mode to use for addresses in
+@var{address_space} if the target supports named address spaces.
+The default version of this hook returns @code{Pmode} for the
+generic address space only.
+@end deftypefn
+
+@deftypefn {Target Hook} bool TARGET_ADDR_SPACE_VALID_POINTER_MODE (enum machine_mode @var{mode}, addr_space_t @var{as})
+Define this to return nonzero if the port can handle pointers
+with machine mode @var{mode} to address space @var{as}. This target
+hook is the same as the @code{TARGET_VALID_POINTER_MODE} target hook,
+except that it includes explicit named address space support. The default
+version of this hook returns true for the modes returned by either the
+@code{TARGET_ADDR_SPACE_POINTER_MODE} or @code{TARGET_ADDR_SPACE_ADDRESS_MODE}
+target hooks for the given address space.
+@end deftypefn
+
+@deftypefn {Target Hook} {bool} TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P (enum machine_mode @var{mode}, rtx @var{exp}, bool @var{strict}, addr_space_t @var{as})
+Define this to return true if @var{exp} is a valid address for mode
+@var{mode} in the named address space @var{as}. The @var{strict}
+parameter says whether strict addressing is in effect after reload has
+finished. This target hook is the same as the
+@code{TARGET_LEGITIMATE_ADDRESS_P} target hook, except that it includes
+explicit named address space support.
+@end deftypefn
+
+@deftypefn {Target Hook} {rtx} TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS (rtx @var{x}, rtx @var{oldx}, enum machine_mode @var{mode}, addr_space_t @var{as})
+Define this to modify an invalid address @var{x} to be a valid address
+with mode @var{mode} in the named address space @var{as}. This target
+hook is the same as the @code{TARGET_LEGITIMIZE_ADDRESS} target hook,
+except that it includes explicit named address space support.
+@end deftypefn
+
+@deftypefn {Target Hook} {bool} TARGET_ADDR_SPACE_SUBSET_P (addr_space_t @var{superset}, addr_space_t @var{subset})
+Define this to return whether the @var{subset} named address space is
+contained within the @var{superset} named address space. Pointers to
+a named address space that is a subset of another named address space
+will be converted automatically without a cast if used together in
+arithmetic operations. Pointers to a superset address space can be
+converted to pointers to a subset address space via explict casts.
+@end deftypefn
+
+@deftypefn {Target Hook} {rtx} TARGET_ADDR_SPACE_CONVERT (rtx @var{op}, tree @var{from_type}, tree @var{to_type})
+Define this to convert the pointer expression represented by the RTL
+@var{op} with type @var{from_type} that points to a named address
+space to a new pointer expression with type @var{to_type} that points
+to a different named address space. When this hook it called, it is
+guaranteed that one of the two address spaces is a subset of the other,
+as determined by the @code{TARGET_ADDR_SPACE_SUBSET_P} target hook.
+@end deftypefn
+
@node Misc
@section Miscellaneous Parameters
@cindex parameters, miscellaneous
@@ -10532,6 +10670,16 @@ only language front ends that use those two functions will call
@samp{TARGET_INIT_BUILTINS}.
@end deftypefn
+@deftypefn {Target Hook} tree TARGET_BUILTIN_FUNCTION (unsigned @var{code}, bool @var{initialize_p})
+Define this hook if you have any machine-specific built-in functions
+that need to be defined. It should be a function that returns the
+builtin function declaration for the builtin function code @var{code}.
+If there is no such builtin and it cannot be initialized at this time
+if @var{initialize_p} is true the function should return @code{NULL_TREE}.
+If @var{code} is out of range the function should return
+@code{error_mark_node}.
+@end deftypefn
+
@deftypefn {Target Hook} rtx TARGET_EXPAND_BUILTIN (tree @var{exp}, rtx @var{target}, rtx @var{subtarget}, enum machine_mode @var{mode}, int @var{ignore})
Expand a call to a machine specific built-in function that was set up by
@@ -10718,6 +10866,12 @@ to have to make special provisions in @code{INITIAL_ELIMINATION_OFFSET}
to reserve space for caller-saved target registers.
@end deftypefn
+@deftypefn {Target Hook} bool TARGET_HAVE_CONDITIONAL_EXECUTION (void)
+This target hook returns true if the target supports conditional execution.
+This target hook is required only when the target has several different
+modes and they have different conditional execution capability, such as ARM.
+@end deftypefn
+
@defmac POWI_MAX_MULTS
If defined, this macro is interpreted as a signed integer C expression
that specifies the maximum number of floating point multiplications
@@ -10895,7 +11049,6 @@ to the stack. Therefore, this hook should return true in general, but
false for naked functions. The default implementation always returns true.
@end deftypefn
-
@deftypevr {Target Hook} {unsigned HOST_WIDE_INT} TARGET_CONST_ANCHOR
On some architectures it can take multiple instructions to synthesize
a constant. If there is another constant already in a register that
diff --git a/gcc/dse.c b/gcc/dse.c
index 9d3e2c07ed6..a883bcd3d69 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -826,9 +826,9 @@ replace_inc_dec (rtx *r, void *d)
case POST_INC:
{
rtx r1 = XEXP (x, 0);
- rtx c = gen_int_mode (data->size, Pmode);
- emit_insn_before (gen_rtx_SET (Pmode, r1,
- gen_rtx_PLUS (Pmode, r1, c)),
+ rtx c = gen_int_mode (data->size, GET_MODE (r1));
+ emit_insn_before (gen_rtx_SET (VOIDmode, r1,
+ gen_rtx_PLUS (GET_MODE (r1), r1, c)),
data->insn);
return -1;
}
@@ -837,9 +837,9 @@ replace_inc_dec (rtx *r, void *d)
case POST_DEC:
{
rtx r1 = XEXP (x, 0);
- rtx c = gen_int_mode (-data->size, Pmode);
- emit_insn_before (gen_rtx_SET (Pmode, r1,
- gen_rtx_PLUS (Pmode, r1, c)),
+ rtx c = gen_int_mode (-data->size, GET_MODE (r1));
+ emit_insn_before (gen_rtx_SET (VOIDmode, r1,
+ gen_rtx_PLUS (GET_MODE (r1), r1, c)),
data->insn);
return -1;
}
@@ -851,7 +851,7 @@ replace_inc_dec (rtx *r, void *d)
insn that contained it. */
rtx add = XEXP (x, 0);
rtx r1 = XEXP (add, 0);
- emit_insn_before (gen_rtx_SET (Pmode, r1, add), data->insn);
+ emit_insn_before (gen_rtx_SET (VOIDmode, r1, add), data->insn);
return -1;
}
@@ -1068,6 +1068,8 @@ canon_address (rtx mem,
HOST_WIDE_INT *offset,
cselib_val **base)
{
+ enum machine_mode address_mode
+ = targetm.addr_space.address_mode (MEM_ADDR_SPACE (mem));
rtx mem_address = XEXP (mem, 0);
rtx expanded_address, address;
int expanded;
@@ -1107,7 +1109,7 @@ canon_address (rtx mem,
*alias_set_out = 0;
- cselib_lookup (mem_address, Pmode, 1);
+ cselib_lookup (mem_address, address_mode, 1);
if (dump_file)
{
@@ -1173,7 +1175,8 @@ canon_address (rtx mem,
address = XEXP (address, 0);
}
- if (const_or_frame_p (address))
+ if (ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (mem))
+ && const_or_frame_p (address))
{
group_info_t group = get_group_info (address);
@@ -1186,7 +1189,7 @@ canon_address (rtx mem,
}
}
- *base = cselib_lookup (address, Pmode, true);
+ *base = cselib_lookup (address, address_mode, true);
*group_id = -1;
if (*base == NULL)
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 26e85940c23..e5648090f9c 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -224,6 +224,8 @@ static GTY(()) section *debug_line_section;
static GTY(()) section *debug_loc_section;
static GTY(()) section *debug_pubnames_section;
static GTY(()) section *debug_pubtypes_section;
+static GTY(()) section *debug_dcall_section;
+static GTY(()) section *debug_vcall_section;
static GTY(()) section *debug_str_section;
static GTY(()) section *debug_ranges_section;
static GTY(()) section *debug_frame_section;
@@ -5399,6 +5401,7 @@ static int output_indirect_string (void **, void *);
static void dwarf2out_init (const char *);
static void dwarf2out_finish (const char *);
+static void dwarf2out_assembly_start (void);
static void dwarf2out_define (unsigned int, const char *);
static void dwarf2out_undef (unsigned int, const char *);
static void dwarf2out_start_source_file (unsigned, const char *);
@@ -5413,6 +5416,10 @@ static void dwarf2out_imported_module_or_decl_1 (tree, tree, tree,
dw_die_ref);
static void dwarf2out_abstract_function (tree);
static void dwarf2out_var_location (rtx);
+static void dwarf2out_direct_call (tree);
+static void dwarf2out_virtual_call_token (tree, int);
+static void dwarf2out_copy_call_info (rtx, rtx);
+static void dwarf2out_virtual_call (int);
static void dwarf2out_begin_function (tree);
static void dwarf2out_set_name (tree, tree);
@@ -5422,6 +5429,7 @@ const struct gcc_debug_hooks dwarf2_debug_hooks =
{
dwarf2out_init,
dwarf2out_finish,
+ dwarf2out_assembly_start,
dwarf2out_define,
dwarf2out_undef,
dwarf2out_start_source_file,
@@ -5448,6 +5456,10 @@ const struct gcc_debug_hooks dwarf2_debug_hooks =
debug_nothing_int, /* handle_pch */
dwarf2out_var_location,
dwarf2out_switch_text_section,
+ dwarf2out_direct_call,
+ dwarf2out_virtual_call_token,
+ dwarf2out_copy_call_info,
+ dwarf2out_virtual_call,
dwarf2out_set_name,
1 /* start_end_main_source_file */
};
@@ -5828,6 +5840,45 @@ static GTY(()) bool have_location_lists;
/* Unique label counter. */
static GTY(()) unsigned int loclabel_num;
+/* Unique label counter for point-of-call tables. */
+static GTY(()) unsigned int poc_label_num;
+
+/* The direct call table structure. */
+
+typedef struct GTY(()) dcall_struct {
+ unsigned int poc_label_num;
+ tree poc_decl;
+ dw_die_ref targ_die;
+}
+dcall_entry;
+
+DEF_VEC_O(dcall_entry);
+DEF_VEC_ALLOC_O(dcall_entry, gc);
+
+/* The virtual call table structure. */
+
+typedef struct GTY(()) vcall_struct {
+ unsigned int poc_label_num;
+ unsigned int vtable_slot;
+}
+vcall_entry;
+
+DEF_VEC_O(vcall_entry);
+DEF_VEC_ALLOC_O(vcall_entry, gc);
+
+/* Pointers to the direct and virtual call tables. */
+static GTY (()) VEC (dcall_entry, gc) * dcall_table = NULL;
+static GTY (()) VEC (vcall_entry, gc) * vcall_table = NULL;
+
+/* A hash table to map INSN_UIDs to vtable slot indexes. */
+
+struct GTY (()) vcall_insn {
+ int insn_uid;
+ unsigned int vtable_slot;
+};
+
+static GTY ((param_is (struct vcall_insn))) htab_t vcall_insn_table;
+
#ifdef DWARF2_DEBUGGING_INFO
/* Record whether the function being analyzed contains inlined functions. */
static int current_function_has_inlines;
@@ -6165,6 +6216,12 @@ static void gen_remaining_tmpl_value_param_die_attribute (void);
#ifndef DEBUG_PUBTYPES_SECTION
#define DEBUG_PUBTYPES_SECTION ".debug_pubtypes"
#endif
+#ifndef DEBUG_DCALL_SECTION
+#define DEBUG_DCALL_SECTION ".debug_dcall"
+#endif
+#ifndef DEBUG_VCALL_SECTION
+#define DEBUG_VCALL_SECTION ".debug_vcall"
+#endif
#ifndef DEBUG_STR_SECTION
#define DEBUG_STR_SECTION ".debug_str"
#endif
@@ -6425,6 +6482,10 @@ dwarf_tag_name (unsigned int tag)
return "DW_TAG_shared_type";
case DW_TAG_type_unit:
return "DW_TAG_type_unit";
+ case DW_TAG_rvalue_reference_type:
+ return "DW_TAG_rvalue_reference_type";
+ case DW_TAG_template_alias:
+ return "DW_TAG_template_alias";
case DW_TAG_GNU_template_parameter_pack:
return "DW_TAG_GNU_template_parameter_pack";
case DW_TAG_GNU_formal_parameter_pack:
@@ -6609,6 +6670,16 @@ dwarf_attr_name (unsigned int attr)
case DW_AT_signature:
return "DW_AT_signature";
+ case DW_AT_main_subprogram:
+ return "DW_AT_main_subprogram";
+ case DW_AT_data_bit_offset:
+ return "DW_AT_data_bit_offset";
+ case DW_AT_const_expr:
+ return "DW_AT_const_expr";
+ case DW_AT_enum_class:
+ return "DW_AT_enum_class";
+ case DW_AT_linkage_name:
+ return "DW_AT_linkage_name";
case DW_AT_MIPS_fde:
return "DW_AT_MIPS_fde";
@@ -6647,6 +6718,22 @@ dwarf_attr_name (unsigned int attr)
return "DW_AT_body_end";
case DW_AT_GNU_vector:
return "DW_AT_GNU_vector";
+ case DW_AT_GNU_guarded_by:
+ return "DW_AT_GNU_guarded_by";
+ case DW_AT_GNU_pt_guarded_by:
+ return "DW_AT_GNU_pt_guarded_by";
+ case DW_AT_GNU_guarded:
+ return "DW_AT_GNU_guarded";
+ case DW_AT_GNU_pt_guarded:
+ return "DW_AT_GNU_pt_guarded";
+ case DW_AT_GNU_locks_excluded:
+ return "DW_AT_GNU_locks_excluded";
+ case DW_AT_GNU_exclusive_locks_required:
+ return "DW_AT_GNU_exclusive_locks_required";
+ case DW_AT_GNU_shared_locks_required:
+ return "DW_AT_GNU_shared_locks_required";
+ case DW_AT_GNU_odr_signature:
+ return "DW_AT_GNU_odr_signature";
case DW_AT_GNU_template_name:
return "DW_AT_GNU_template_name";
@@ -6707,6 +6794,14 @@ dwarf_form_name (unsigned int form)
return "DW_FORM_ref_udata";
case DW_FORM_indirect:
return "DW_FORM_indirect";
+ case DW_FORM_sec_offset:
+ return "DW_FORM_sec_offset";
+ case DW_FORM_exprloc:
+ return "DW_FORM_exprloc";
+ case DW_FORM_flag_present:
+ return "DW_FORM_flag_present";
+ case DW_FORM_ref_sig8:
+ return "DW_FORM_ref_sig8";
default:
return "DW_FORM_<unknown>";
}
@@ -10299,7 +10394,7 @@ output_signature (const char *sig, const char *name)
int i;
for (i = 0; i < DWARF_TYPE_SIGNATURE_SIZE; i++)
- dw2_asm_output_data (1, sig[i], "%s", name);
+ dw2_asm_output_data (1, sig[i], i == 0 ? "%s" : NULL, name);
}
/* Output the DIE and its attributes. Called recursively to generate
@@ -10520,7 +10615,7 @@ output_die (dw_die_ref die)
for (i = 0; i < 8; i++)
dw2_asm_output_data (1, a->dw_attr_val.v.val_data8[i],
- "%s", name);
+ i == 0 ? "%s" : NULL, name);
break;
}
@@ -10688,7 +10783,11 @@ static void
add_pubname (tree decl, dw_die_ref die)
{
if (TREE_PUBLIC (decl))
- add_pubname_string (dwarf2_name (decl, 1), die);
+ {
+ const char *name = dwarf2_name (decl, 1);
+ if (name)
+ add_pubname_string (name, die);
+ }
}
/* Add a new entry to .debug_pubtypes if appropriate. */
@@ -10718,7 +10817,11 @@ add_pubtype (tree decl, dw_die_ref die)
}
}
else
- e.name = xstrdup (dwarf2_name (decl, 1));
+ {
+ e.name = dwarf2_name (decl, 1);
+ if (e.name)
+ e.name = xstrdup (e.name);
+ }
/* If we don't have a name for the type, there's no point in adding
it to the table. */
@@ -11684,6 +11787,129 @@ output_line_info (void)
/* Output the marker for the end of the line number info. */
ASM_OUTPUT_LABEL (asm_out_file, l2);
}
+
+/* Return the size of the .debug_dcall table for the compilation unit. */
+
+static unsigned long
+size_of_dcall_table (void)
+{
+ unsigned long size;
+ unsigned int i;
+ dcall_entry *p;
+ tree last_poc_decl = NULL;
+
+ /* Header: version + debug info section pointer + pointer size. */
+ size = 2 + DWARF_OFFSET_SIZE + 1;
+
+ /* Each entry: code label + DIE offset. */
+ for (i = 0; VEC_iterate (dcall_entry, dcall_table, i, p); i++)
+ {
+ gcc_assert (p->targ_die != NULL);
+ /* Insert a "from" entry when the point-of-call DIE offset changes. */
+ if (p->poc_decl != last_poc_decl)
+ {
+ dw_die_ref poc_die = lookup_decl_die (p->poc_decl);
+ gcc_assert (poc_die);
+ last_poc_decl = p->poc_decl;
+ if (poc_die)
+ size += (DWARF_OFFSET_SIZE
+ + size_of_uleb128 (poc_die->die_offset));
+ }
+ size += DWARF_OFFSET_SIZE + size_of_uleb128 (p->targ_die->die_offset);
+ }
+
+ return size;
+}
+
+/* Output the direct call table used to disambiguate PC values when
+ identical function have been merged. */
+
+static void
+output_dcall_table (void)
+{
+ unsigned i;
+ unsigned long dcall_length = size_of_dcall_table ();
+ dcall_entry *p;
+ char poc_label[MAX_ARTIFICIAL_LABEL_BYTES];
+ tree last_poc_decl = NULL;
+
+ if (DWARF_INITIAL_LENGTH_SIZE - DWARF_OFFSET_SIZE == 4)
+ dw2_asm_output_data (4, 0xffffffff,
+ "Initial length escape value indicating 64-bit DWARF extension");
+ dw2_asm_output_data (DWARF_OFFSET_SIZE, dcall_length,
+ "Length of Direct Call Table");
+ dw2_asm_output_data (2, 4, "Version number");
+ dw2_asm_output_offset (DWARF_OFFSET_SIZE, debug_info_section_label,
+ debug_info_section,
+ "Offset of Compilation Unit Info");
+ dw2_asm_output_data (1, DWARF2_ADDR_SIZE, "Pointer Size (in bytes)");
+
+ for (i = 0; VEC_iterate (dcall_entry, dcall_table, i, p); i++)
+ {
+ /* Insert a "from" entry when the point-of-call DIE offset changes. */
+ if (p->poc_decl != last_poc_decl)
+ {
+ dw_die_ref poc_die = lookup_decl_die (p->poc_decl);
+ last_poc_decl = p->poc_decl;
+ if (poc_die)
+ {
+ dw2_asm_output_data (DWARF_OFFSET_SIZE, 0, "New caller");
+ dw2_asm_output_data_uleb128 (poc_die->die_offset,
+ "Caller DIE offset");
+ }
+ }
+ ASM_GENERATE_INTERNAL_LABEL (poc_label, "LPOC", p->poc_label_num);
+ dw2_asm_output_addr (DWARF_OFFSET_SIZE, poc_label, "Point of call");
+ dw2_asm_output_data_uleb128 (p->targ_die->die_offset,
+ "Callee DIE offset");
+ }
+}
+
+/* Return the size of the .debug_vcall table for the compilation unit. */
+
+static unsigned long
+size_of_vcall_table (void)
+{
+ unsigned long size;
+ unsigned int i;
+ vcall_entry *p;
+
+ /* Header: version + pointer size. */
+ size = 2 + 1;
+
+ /* Each entry: code label + vtable slot index. */
+ for (i = 0; VEC_iterate (vcall_entry, vcall_table, i, p); i++)
+ size += DWARF_OFFSET_SIZE + size_of_uleb128 (p->vtable_slot);
+
+ return size;
+}
+
+/* Output the virtual call table used to disambiguate PC values when
+ identical function have been merged. */
+
+static void
+output_vcall_table (void)
+{
+ unsigned i;
+ unsigned long vcall_length = size_of_vcall_table ();
+ vcall_entry *p;
+ char poc_label[MAX_ARTIFICIAL_LABEL_BYTES];
+
+ if (DWARF_INITIAL_LENGTH_SIZE - DWARF_OFFSET_SIZE == 4)
+ dw2_asm_output_data (4, 0xffffffff,
+ "Initial length escape value indicating 64-bit DWARF extension");
+ dw2_asm_output_data (DWARF_OFFSET_SIZE, vcall_length,
+ "Length of Virtual Call Table");
+ dw2_asm_output_data (2, 4, "Version number");
+ dw2_asm_output_data (1, DWARF2_ADDR_SIZE, "Pointer Size (in bytes)");
+
+ for (i = 0; VEC_iterate (vcall_entry, vcall_table, i, p); i++)
+ {
+ ASM_GENERATE_INTERNAL_LABEL (poc_label, "LPOC", p->poc_label_num);
+ dw2_asm_output_addr (DWARF_OFFSET_SIZE, poc_label, "Point of call");
+ dw2_asm_output_data_uleb128 (p->vtable_slot, "Vtable slot");
+ }
+}
/* Given a pointer to a tree node for some base type, return a pointer to
a DIE that describes the given type.
@@ -11934,6 +12160,9 @@ modified_type_die (tree type, int is_const_type, int is_volatile_type,
add_AT_unsigned (mod_type_die, DW_AT_byte_size,
simple_type_size_in_bits (type) / BITS_PER_UNIT);
item_type = TREE_TYPE (type);
+ if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (item_type)))
+ add_AT_unsigned (mod_type_die, DW_AT_address_class,
+ TYPE_ADDR_SPACE (item_type));
}
else if (code == REFERENCE_TYPE)
{
@@ -11941,6 +12170,9 @@ modified_type_die (tree type, int is_const_type, int is_volatile_type,
add_AT_unsigned (mod_type_die, DW_AT_byte_size,
simple_type_size_in_bits (type) / BITS_PER_UNIT);
item_type = TREE_TYPE (type);
+ if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (item_type)))
+ add_AT_unsigned (mod_type_die, DW_AT_address_class,
+ TYPE_ADDR_SPACE (item_type));
}
else if (code == INTEGER_TYPE
&& TREE_TYPE (type) != NULL_TREE
@@ -11971,10 +12203,16 @@ modified_type_die (tree type, int is_const_type, int is_volatile_type,
/* Builtin types don't have a DECL_ORIGINAL_TYPE. For those,
don't output a DW_TAG_typedef, since there isn't one in the
- user's program; just attach a DW_AT_name to the type. */
+ user's program; just attach a DW_AT_name to the type.
+ Don't attach a DW_AT_name to DW_TAG_const_type or DW_TAG_volatile_type
+ if the base type already has the same name. */
if (name
- && (TREE_CODE (name) != TYPE_DECL
- || (TREE_TYPE (name) == qualified_type && DECL_NAME (name))))
+ && ((TREE_CODE (name) != TYPE_DECL
+ && (qualified_type == TYPE_MAIN_VARIANT (type)
+ || (!is_const_type && !is_volatile_type)))
+ || (TREE_CODE (name) == TYPE_DECL
+ && TREE_TYPE (name) == qualified_type
+ && DECL_NAME (name))))
{
if (TREE_CODE (name) == TYPE_DECL)
/* Could just call add_name_and_src_coords_attributes here,
@@ -12137,7 +12375,8 @@ generic_parameter_die (tree parm, tree arg,
/* The DW_AT_GNU_template_name attribute of the DIE must be set
to the name of the argument. */
name = dwarf2_name (TYPE_P (arg) ? TYPE_NAME (arg) : arg, 1);
- add_AT_string (tmpl_die, DW_AT_GNU_template_name, name);
+ if (name)
+ add_AT_string (tmpl_die, DW_AT_GNU_template_name, name);
}
if (TREE_CODE (parm) == PARM_DECL)
@@ -12171,13 +12410,10 @@ template_parameter_pack_die (tree parm_pack,
dw_die_ref die;
int j;
- gcc_assert (parent_die
- && parm_pack
- && DECL_NAME (parm_pack));
+ gcc_assert (parent_die && parm_pack);
die = new_die (DW_TAG_GNU_template_parameter_pack, parent_die, parm_pack);
- add_AT_string (die, DW_AT_name, IDENTIFIER_POINTER (DECL_NAME (parm_pack)));
-
+ add_name_and_src_coords_attributes (die, parm_pack);
for (j = 0; j < TREE_VEC_LENGTH (parm_pack_args); j++)
generic_parameter_die (parm_pack,
TREE_VEC_ELT (parm_pack_args, j),
@@ -12677,10 +12913,7 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode,
case POST_INC:
case POST_DEC:
case POST_MODIFY:
- /* POST_INC and POST_DEC can be handled just like a SUBREG. So we
- just fall into the SUBREG code. */
-
- /* ... fall through ... */
+ return mem_loc_descriptor (XEXP (rtl, 0), mode, initialized);
case SUBREG:
/* The case of a subreg may arise when we have a local (register)
@@ -12688,9 +12921,13 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode,
up an entire register. For now, just assume that it is
legitimate to make the Dwarf info refer to the whole register which
contains the given subreg. */
- rtl = XEXP (rtl, 0);
+ if (!subreg_lowpart_p (rtl))
+ break;
+ rtl = SUBREG_REG (rtl);
if (GET_MODE_SIZE (GET_MODE (rtl)) > DWARF2_ADDR_SIZE)
break;
+ if (GET_MODE_CLASS (GET_MODE (rtl)) != MODE_INT)
+ break;
mem_loc_result = mem_loc_descriptor (rtl, mode, initialized);
break;
@@ -13175,12 +13412,19 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode,
if (BITS_BIG_ENDIAN)
shift = GET_MODE_BITSIZE (GET_MODE (XEXP (rtl, 0)))
- shift - size;
- add_loc_descr (&mem_loc_result,
- int_loc_descriptor (DWARF2_ADDR_SIZE - shift - size));
- add_loc_descr (&mem_loc_result, new_loc_descr (DW_OP_shl, 0, 0));
- add_loc_descr (&mem_loc_result,
- int_loc_descriptor (DWARF2_ADDR_SIZE - size));
- add_loc_descr (&mem_loc_result, new_loc_descr (op, 0, 0));
+ if (shift + size != (int) DWARF2_ADDR_SIZE)
+ {
+ add_loc_descr (&mem_loc_result,
+ int_loc_descriptor (DWARF2_ADDR_SIZE
+ - shift - size));
+ add_loc_descr (&mem_loc_result, new_loc_descr (DW_OP_shl, 0, 0));
+ }
+ if (size != (int) DWARF2_ADDR_SIZE)
+ {
+ add_loc_descr (&mem_loc_result,
+ int_loc_descriptor (DWARF2_ADDR_SIZE - size));
+ add_loc_descr (&mem_loc_result, new_loc_descr (op, 0, 0));
+ }
}
break;
@@ -13202,6 +13446,7 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode,
case ORDERED:
case UNEQ:
case UNGE:
+ case UNGT:
case UNLE:
case UNLT:
case LTGT:
@@ -13596,71 +13841,101 @@ decl_by_reference_p (tree decl)
&& DECL_BY_REFERENCE (decl));
}
+/* Return single element location list containing loc descr REF. */
-/* Dereference a location expression LOC if DECL is passed by invisible
- reference. */
-
-static dw_loc_descr_ref
-loc_by_reference (dw_loc_descr_ref loc, tree decl)
+static dw_loc_list_ref
+single_element_loc_list (dw_loc_descr_ref ref)
{
- HOST_WIDE_INT size;
- enum dwarf_location_atom op;
+ return new_loc_list (ref, NULL, NULL, NULL, 0);
+}
- if (loc == NULL)
- return NULL;
+/* Helper function for dw_loc_list. Compute proper Dwarf location descriptor
+ for VARLOC. */
- if (!decl_by_reference_p (decl))
- return loc;
+static dw_loc_descr_ref
+dw_loc_list_1 (tree loc, rtx varloc, int want_address,
+ enum var_init_status initialized)
+{
+ int have_address = 0;
+ dw_loc_descr_ref descr;
+ enum machine_mode mode;
- /* If loc is DW_OP_reg{0...31,x}, don't add DW_OP_deref, instead
- change it into corresponding DW_OP_breg{0...31,x} 0. Then the
- location expression is considered to be address of a memory location,
- rather than the register itself. */
- if (((loc->dw_loc_opc >= DW_OP_reg0 && loc->dw_loc_opc <= DW_OP_reg31)
- || loc->dw_loc_opc == DW_OP_regx)
- && (loc->dw_loc_next == NULL
- || (loc->dw_loc_next->dw_loc_opc == DW_OP_GNU_uninit
- && loc->dw_loc_next->dw_loc_next == NULL)))
+ if (want_address != 2)
{
- if (loc->dw_loc_opc == DW_OP_regx)
+ gcc_assert (GET_CODE (varloc) == VAR_LOCATION);
+ /* Single part. */
+ if (GET_CODE (XEXP (varloc, 1)) != PARALLEL)
{
- loc->dw_loc_opc = DW_OP_bregx;
- loc->dw_loc_oprnd2.v.val_int = 0;
+ varloc = XEXP (XEXP (varloc, 1), 0);
+ mode = GET_MODE (varloc);
+ if (MEM_P (varloc))
+ {
+ varloc = XEXP (varloc, 0);
+ have_address = 1;
+ }
+ descr = mem_loc_descriptor (varloc, mode, initialized);
}
else
+ return 0;
+ }
+ else
+ {
+ descr = loc_descriptor (varloc, DECL_MODE (loc), initialized);
+ have_address = 1;
+ }
+
+ if (!descr)
+ return 0;
+
+ if (want_address == 2 && !have_address
+ && (dwarf_version >= 4 || !dwarf_strict))
+ {
+ if (int_size_in_bytes (TREE_TYPE (loc)) > DWARF2_ADDR_SIZE)
{
- loc->dw_loc_opc
- = (enum dwarf_location_atom)
- (loc->dw_loc_opc + (DW_OP_breg0 - DW_OP_reg0));
- loc->dw_loc_oprnd1.v.val_int = 0;
+ expansion_failed (loc, NULL_RTX,
+ "DWARF address size mismatch");
+ return 0;
}
- return loc;
+ add_loc_descr (&descr, new_loc_descr (DW_OP_stack_value, 0, 0));
+ have_address = 1;
+ }
+ /* Show if we can't fill the request for an address. */
+ if (want_address && !have_address)
+ {
+ expansion_failed (loc, NULL_RTX,
+ "Want address and only have value");
+ return 0;
}
- size = int_size_in_bytes (TREE_TYPE (decl));
- if (size > DWARF2_ADDR_SIZE || size == -1)
- return 0;
- else if (size == DWARF2_ADDR_SIZE)
- op = DW_OP_deref;
- else
- op = DW_OP_deref_size;
- add_loc_descr (&loc, new_loc_descr (op, size, 0));
- return loc;
-}
+ /* If we've got an address and don't want one, dereference. */
+ if (!want_address && have_address)
+ {
+ HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (loc));
+ enum dwarf_location_atom op;
-/* Return single element location list containing loc descr REF. */
+ if (size > DWARF2_ADDR_SIZE || size == -1)
+ {
+ expansion_failed (loc, NULL_RTX,
+ "DWARF address size mismatch");
+ return 0;
+ }
+ else if (size == DWARF2_ADDR_SIZE)
+ op = DW_OP_deref;
+ else
+ op = DW_OP_deref_size;
-static dw_loc_list_ref
-single_element_loc_list (dw_loc_descr_ref ref)
-{
- return new_loc_list (ref, NULL, NULL, NULL, 0);
+ add_loc_descr (&descr, new_loc_descr (op, size, 0));
+ }
+
+ return descr;
}
/* Return dwarf representation of location list representing for
- LOC_LIST of DECL. */
+ LOC_LIST of DECL. WANT_ADDRESS has the same meaning as in
+ loc_list_from_tree function. */
static dw_loc_list_ref
-dw_loc_list (var_loc_list * loc_list, tree decl, bool toplevel)
+dw_loc_list (var_loc_list * loc_list, tree decl, int want_address)
{
const char *endname, *secname;
dw_loc_list_ref list;
@@ -13670,8 +13945,6 @@ dw_loc_list (var_loc_list * loc_list, tree decl, bool toplevel)
dw_loc_descr_ref descr;
char label_id[MAX_ARTIFICIAL_LABEL_BYTES];
- bool by_reference = decl_by_reference_p (decl);
-
/* Now that we know what section we are using for a base,
actually construct the list of locations.
The first location information is what is passed to the
@@ -13684,28 +13957,14 @@ dw_loc_list (var_loc_list * loc_list, tree decl, bool toplevel)
a range of [last location start, end of function label]. */
node = loc_list->first;
- varloc = NOTE_VAR_LOCATION (node->var_loc_note);
secname = secname_for_decl (decl);
if (NOTE_VAR_LOCATION_LOC (node->var_loc_note))
initialized = NOTE_VAR_LOCATION_STATUS (node->var_loc_note);
else
initialized = VAR_INIT_STATUS_INITIALIZED;
-
- if (!toplevel || by_reference)
- {
- gcc_assert (GET_CODE (varloc) == VAR_LOCATION);
- /* Single part. */
- if (GET_CODE (XEXP (varloc, 1)) != PARALLEL)
- descr = loc_by_reference (mem_loc_descriptor (XEXP (XEXP (varloc, 1), 0),
- TYPE_MODE (TREE_TYPE (decl)),
- initialized),
- decl);
- else
- descr = NULL;
- }
- else
- descr = loc_descriptor (varloc, DECL_MODE (decl), initialized);
+ varloc = NOTE_VAR_LOCATION (node->var_loc_note);
+ descr = dw_loc_list_1 (decl, varloc, want_address, initialized);
if (loc_list && loc_list->first != loc_list->last)
list = new_loc_list (descr, node->label, node->next->label, secname, 1);
@@ -13721,22 +13980,9 @@ dw_loc_list (var_loc_list * loc_list, tree decl, bool toplevel)
{
/* The variable has a location between NODE->LABEL and
NODE->NEXT->LABEL. */
- enum var_init_status initialized =
- NOTE_VAR_LOCATION_STATUS (node->var_loc_note);
+ initialized = NOTE_VAR_LOCATION_STATUS (node->var_loc_note);
varloc = NOTE_VAR_LOCATION (node->var_loc_note);
- if (!toplevel || by_reference)
- {
- gcc_assert (GET_CODE (varloc) == VAR_LOCATION);
- /* Single part. */
- if (GET_CODE (XEXP (varloc, 1)) != PARALLEL)
- descr = mem_loc_descriptor (XEXP (XEXP (varloc, 1), 0),
- TYPE_MODE (TREE_TYPE (decl)), initialized);
- else
- descr = NULL;
- descr = loc_by_reference (descr, decl);
- }
- else
- descr = loc_descriptor (varloc, DECL_MODE (decl), initialized);
+ descr = dw_loc_list_1 (decl, varloc, want_address, initialized);
add_loc_descr_to_loc_list (&list, descr,
node->label, node->next->label, secname);
}
@@ -13745,9 +13991,6 @@ dw_loc_list (var_loc_list * loc_list, tree decl, bool toplevel)
it keeps its location until the end of function. */
if (NOTE_VAR_LOCATION_LOC (node->var_loc_note) != NULL_RTX)
{
- enum var_init_status initialized =
- NOTE_VAR_LOCATION_STATUS (node->var_loc_note);
-
if (!current_function_decl)
endname = text_end_label;
else
@@ -13757,20 +14000,9 @@ dw_loc_list (var_loc_list * loc_list, tree decl, bool toplevel)
endname = ggc_strdup (label_id);
}
+ initialized = NOTE_VAR_LOCATION_STATUS (node->var_loc_note);
varloc = NOTE_VAR_LOCATION (node->var_loc_note);
- if (!toplevel || by_reference)
- {
- gcc_assert (GET_CODE (varloc) == VAR_LOCATION);
- /* Single part. */
- if (GET_CODE (XEXP (varloc, 1)) != PARALLEL)
- descr = mem_loc_descriptor (XEXP (XEXP (varloc, 1), 0),
- TYPE_MODE (TREE_TYPE (decl)), initialized);
- else
- descr = NULL;
- descr = loc_by_reference (descr, decl);
- }
- else
- descr = loc_descriptor (varloc, DECL_MODE (decl), initialized);
+ descr = dw_loc_list_1 (decl, varloc, want_address, initialized);
add_loc_descr_to_loc_list (&list, descr, node->label, endname, secname);
}
return list;
@@ -13948,11 +14180,7 @@ loc_list_for_address_of_addr_expr_of_indirect_ref (tree loc, bool toplev)
If WANT_ADDRESS is 1, expression computing address of LOC will be returned
if WANT_ADDRESS is 2, expression computing address useable in location
will be returned (i.e. DW_OP_reg can be used
- to refer to register values)
- TODO: Dwarf4 adds types to the stack machine that ought to be used here
- DW_OP_stack_value will help in cases where we fail to find address of the
- expression.
- */
+ to refer to register values). */
static dw_loc_list_ref
loc_list_from_tree (tree loc, int want_address)
@@ -14087,8 +14315,8 @@ loc_list_from_tree (tree loc, int want_address)
var_loc_list *loc_list = lookup_decl_loc (loc);
if (loc_list && loc_list->first
- && (list_ret = dw_loc_list (loc_list, loc, want_address == 2)))
- have_address = 1;
+ && (list_ret = dw_loc_list (loc_list, loc, want_address)))
+ have_address = want_address != 0;
else if (rtl == NULL_RTX)
{
expansion_failed (loc, NULL_RTX, "DECL has no RTL");
@@ -15395,12 +15623,11 @@ fortran_common (tree decl, HOST_WIDE_INT *value)
tree offset;
int volatilep = 0, unsignedp = 0;
- /* If the decl isn't a VAR_DECL, or if it isn't public or static, or if
+ /* If the decl isn't a VAR_DECL, or if it isn't static, or if
it does not have a value (the offset into the common area), or if it
is thread local (as opposed to global) then it isn't common, and shouldn't
be handled as such. */
if (TREE_CODE (decl) != VAR_DECL
- || !TREE_PUBLIC (decl)
|| !TREE_STATIC (decl)
|| !DECL_HAS_VALUE_EXPR_P (decl)
|| !is_fortran ())
@@ -15712,6 +15939,10 @@ tree_add_const_value_attribute_for_decl (dw_die_ref var_die, tree decl)
else
return false;
+ /* Don't add DW_AT_const_value if abstract origin already has one. */
+ if (get_AT (var_die, DW_AT_const_value))
+ return false;
+
return tree_add_const_value_attribute (var_die, DECL_INITIAL (decl));
}
@@ -16249,7 +16480,9 @@ add_name_and_src_coords_attributes (dw_die_ref die, tree decl)
decl_name = DECL_NAME (decl);
if (decl_name != NULL && IDENTIFIER_POINTER (decl_name) != NULL)
{
- add_name_attribute (die, dwarf2_name (decl, 0));
+ const char *name = dwarf2_name (decl, 0);
+ if (name)
+ add_name_attribute (die, name);
if (! DECL_ARTIFICIAL (decl))
add_src_coords_attributes (die, decl);
@@ -17038,12 +17271,10 @@ gen_formal_parameter_pack_die (tree parm_pack,
gcc_assert (parm_pack
&& lang_hooks.function_parameter_pack_p (parm_pack)
- && DECL_NAME (parm_pack)
&& subr_die);
parm_pack_die = new_die (DW_TAG_GNU_formal_parameter_pack, subr_die, parm_pack);
- add_AT_string (parm_pack_die, DW_AT_name,
- IDENTIFIER_POINTER (DECL_NAME (parm_pack)));
+ add_src_coords_attributes (parm_pack_die, parm_pack);
for (arg = pack_arg; arg; arg = TREE_CHAIN (arg))
{
@@ -19009,7 +19240,11 @@ gen_namespace_die (tree decl, dw_die_ref context_die)
context_die, decl);
/* For Fortran modules defined in different CU don't add src coords. */
if (namespace_die->die_tag == DW_TAG_module && DECL_EXTERNAL (decl))
- add_name_attribute (namespace_die, dwarf2_name (decl, 0));
+ {
+ const char *name = dwarf2_name (decl, 0);
+ if (name)
+ add_name_attribute (namespace_die, name);
+ }
else
add_name_and_src_coords_attributes (namespace_die, decl);
if (DECL_EXTERNAL (decl))
@@ -19697,23 +19932,157 @@ dwarf2out_set_name (tree decl, tree name)
{
dw_die_ref die;
dw_attr_ref attr;
+ const char *dname;
die = TYPE_SYMTAB_DIE (decl);
if (!die)
return;
+ dname = dwarf2_name (name, 0);
+ if (!dname)
+ return;
+
attr = get_AT (die, DW_AT_name);
if (attr)
{
struct indirect_string_node *node;
- node = find_AT_string (dwarf2_name (name, 0));
+ node = find_AT_string (dname);
/* replace the string. */
attr->dw_attr_val.v.val_str = node;
}
else
- add_name_attribute (die, dwarf2_name (name, 0));
+ add_name_attribute (die, dname);
+}
+
+/* Called by the final INSN scan whenever we see a direct function call.
+ Make an entry into the direct call table, recording the point of call
+ and a reference to the target function's debug entry. */
+
+static void
+dwarf2out_direct_call (tree targ)
+{
+ dcall_entry e;
+ tree origin = decl_ultimate_origin (targ);
+
+ /* If this is a clone, use the abstract origin as the target. */
+ if (origin)
+ targ = origin;
+
+ e.poc_label_num = poc_label_num++;
+ e.poc_decl = current_function_decl;
+ e.targ_die = force_decl_die (targ);
+ VEC_safe_push (dcall_entry, gc, dcall_table, &e);
+
+ /* Drop a label at the return point to mark the point of call. */
+ ASM_OUTPUT_DEBUG_LABEL (asm_out_file, "LPOC", e.poc_label_num);
+}
+
+/* Returns a hash value for X (which really is a struct vcall_insn). */
+
+static hashval_t
+vcall_insn_table_hash (const void *x)
+{
+ return (hashval_t) ((const struct vcall_insn *) x)->insn_uid;
+}
+
+/* Return nonzero if insn_uid of struct vcall_insn *X is the same as
+ insnd_uid of *Y. */
+
+static int
+vcall_insn_table_eq (const void *x, const void *y)
+{
+ return (((const struct vcall_insn *) x)->insn_uid
+ == ((const struct vcall_insn *) y)->insn_uid);
+}
+
+/* Associate VTABLE_SLOT with INSN_UID in the VCALL_INSN_TABLE. */
+
+static void
+store_vcall_insn (unsigned int vtable_slot, int insn_uid)
+{
+ struct vcall_insn *item = GGC_NEW (struct vcall_insn);
+ struct vcall_insn **slot;
+
+ gcc_assert (item);
+ item->insn_uid = insn_uid;
+ item->vtable_slot = vtable_slot;
+ slot = (struct vcall_insn **)
+ htab_find_slot_with_hash (vcall_insn_table, &item,
+ (hashval_t) insn_uid, INSERT);
+ *slot = item;
+}
+
+/* Return the VTABLE_SLOT associated with INSN_UID. */
+
+static unsigned int
+lookup_vcall_insn (unsigned int insn_uid)
+{
+ struct vcall_insn item;
+ struct vcall_insn *p;
+
+ item.insn_uid = insn_uid;
+ item.vtable_slot = 0;
+ p = (struct vcall_insn *) htab_find_with_hash (vcall_insn_table,
+ (void *) &item,
+ (hashval_t) insn_uid);
+ if (p == NULL)
+ return (unsigned int) -1;
+ return p->vtable_slot;
+}
+
+
+/* Called when lowering indirect calls to RTL. We make a note of INSN_UID
+ and the OBJ_TYPE_REF_TOKEN from ADDR. For C++ virtual calls, the token
+ is the vtable slot index that we will need to put in the virtual call
+ table later. */
+
+static void
+dwarf2out_virtual_call_token (tree addr, int insn_uid)
+{
+ if (is_cxx() && TREE_CODE (addr) == OBJ_TYPE_REF)
+ {
+ tree token = OBJ_TYPE_REF_TOKEN (addr);
+ if (TREE_CODE (token) == INTEGER_CST)
+ store_vcall_insn (TREE_INT_CST_LOW (token), insn_uid);
+ }
+}
+
+/* Called when scheduling RTL, when a CALL_INSN is split. Copies the
+ OBJ_TYPE_REF_TOKEN previously associated with OLD_INSN and associates it
+ with NEW_INSN. */
+
+static void
+dwarf2out_copy_call_info (rtx old_insn, rtx new_insn)
+{
+ unsigned int vtable_slot = lookup_vcall_insn (INSN_UID (old_insn));
+
+ if (vtable_slot != (unsigned int) -1)
+ store_vcall_insn (vtable_slot, INSN_UID (new_insn));
+}
+
+/* Called by the final INSN scan whenever we see a virtual function call.
+ Make an entry into the virtual call table, recording the point of call
+ and the slot index of the vtable entry used to call the virtual member
+ function. The slot index was associated with the INSN_UID during the
+ lowering to RTL. */
+
+static void
+dwarf2out_virtual_call (int insn_uid)
+{
+ unsigned int vtable_slot = lookup_vcall_insn (insn_uid);
+ vcall_entry e;
+
+ if (vtable_slot == (unsigned int) -1)
+ return;
+
+ e.poc_label_num = poc_label_num++;
+ e.vtable_slot = vtable_slot;
+ VEC_safe_push (vcall_entry, gc, vcall_table, &e);
+
+ /* Drop a label at the return point to mark the point of call. */
+ ASM_OUTPUT_DEBUG_LABEL (asm_out_file, "LPOC", e.poc_label_num);
}
/* Called by the final INSN scan whenever we see a var location. We
@@ -19751,8 +20120,7 @@ dwarf2out_var_location (rtx loc_note)
ASM_OUTPUT_DEBUG_LABEL (asm_out_file, "LVL", loclabel_num);
loclabel_num++;
last_label = ggc_strdup (loclabel);
- if (!NOTE_DURING_CALL_P (loc_note))
- last_postcall_label = NULL;
+ last_postcall_label = NULL;
}
newloc->var_loc_note = loc_note;
newloc->next = NULL;
@@ -20004,6 +20372,10 @@ dwarf2out_init (const char *filename ATTRIBUTE_UNUSED)
pubname_table = VEC_alloc (pubname_entry, gc, 32);
pubtype_table = VEC_alloc (pubname_entry, gc, 32);
+ /* Allocate the table that maps insn UIDs to vtable slot indexes. */
+ vcall_insn_table = htab_create_ggc (10, vcall_insn_table_hash,
+ vcall_insn_table_eq, NULL);
+
/* Generate the initial DIE for the .debug section. Note that the (string)
value given in the DW_AT_name attribute of the DW_TAG_compile_unit DIE
will (typically) be a relative pathname and that this pathname should be
@@ -20032,6 +20404,10 @@ dwarf2out_init (const char *filename ATTRIBUTE_UNUSED)
SECTION_DEBUG, NULL);
debug_pubtypes_section = get_section (DEBUG_PUBTYPES_SECTION,
SECTION_DEBUG, NULL);
+ debug_dcall_section = get_section (DEBUG_DCALL_SECTION,
+ SECTION_DEBUG, NULL);
+ debug_vcall_section = get_section (DEBUG_VCALL_SECTION,
+ SECTION_DEBUG, NULL);
debug_str_section = get_section (DEBUG_STR_SECTION,
DEBUG_STR_SECTION_FLAGS, NULL);
debug_ranges_section = get_section (DEBUG_RANGES_SECTION,
@@ -20077,15 +20453,21 @@ dwarf2out_init (const char *filename ATTRIBUTE_UNUSED)
ASM_OUTPUT_LABEL (asm_out_file, cold_text_section_label);
}
-#ifdef HAVE_GAS_CFI_SECTIONS_DIRECTIVE
- if (dwarf2out_do_cfi_asm ())
+}
+
+/* Called before cgraph_optimize starts outputtting functions, variables
+ and toplevel asms into assembly. */
+
+static void
+dwarf2out_assembly_start (void)
+{
+ if (HAVE_GAS_CFI_SECTIONS_DIRECTIVE && dwarf2out_do_cfi_asm ())
{
#ifndef TARGET_UNWIND_INFO
if (USING_SJLJ_EXCEPTIONS || (!flag_unwind_tables && !flag_exceptions))
#endif
fprintf (asm_out_file, "\t.cfi_sections\t.debug_frame\n");
}
-#endif
}
/* A helper function for dwarf2out_finish called through
@@ -20406,6 +20788,7 @@ prune_unused_types (void)
limbo_die_node *node;
comdat_type_node *ctnode;
pubname_ref pub;
+ dcall_entry *dcall;
#if ENABLE_ASSERT_CHECKING
/* All the marks should already be clear. */
@@ -20436,6 +20819,10 @@ prune_unused_types (void)
for (i = 0; i < arange_table_in_use; i++)
prune_unused_types_mark (arange_table[i], 1);
+ /* Mark nodes referenced from the direct call table. */
+ for (i = 0; VEC_iterate (dcall_entry, dcall_table, i, dcall); i++)
+ prune_unused_types_mark (dcall->targ_die, 1);
+
/* Get rid of nodes that aren't marked; and update the string counts. */
if (debug_str_hash && debug_str_hash_forced)
htab_traverse (debug_str_hash, prune_indirect_string, NULL);
@@ -20897,6 +21284,18 @@ dwarf2out_finish (const char *filename)
output_pubnames (pubtype_table);
}
+ /* Output direct and virtual call tables if necessary. */
+ if (!VEC_empty (dcall_entry, dcall_table))
+ {
+ switch_to_section (debug_dcall_section);
+ output_dcall_table ();
+ }
+ if (!VEC_empty (vcall_entry, vcall_table))
+ {
+ switch_to_section (debug_vcall_section);
+ output_vcall_table ();
+ }
+
/* Output the address range information. We only put functions in the arange
table, so don't write it out if we don't have any. */
if (fde_table_in_use)
@@ -20944,6 +21343,7 @@ const struct gcc_debug_hooks dwarf2_debug_hooks =
{
0, /* init */
0, /* finish */
+ 0, /* assembly_start */
0, /* define */
0, /* undef */
0, /* start_source_file */
@@ -20967,6 +21367,10 @@ const struct gcc_debug_hooks dwarf2_debug_hooks =
0, /* handle_pch */
0, /* var_location */
0, /* switch_text_section */
+ 0, /* direct_call */
+ 0, /* virtual_call_token */
+ 0, /* copy_call_info */
+ 0, /* virtual_call */
0, /* set_name */
0 /* start_end_main_source_file */
};
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index b3672e3e5ad..674bcc4e4b9 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -59,6 +59,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-pass.h"
#include "df.h"
#include "params.h"
+#include "target.h"
/* Commonly used modes. */
@@ -193,7 +194,7 @@ static rtx lookup_const_fixed (rtx);
static hashval_t mem_attrs_htab_hash (const void *);
static int mem_attrs_htab_eq (const void *, const void *);
static mem_attrs *get_mem_attrs (alias_set_type, tree, rtx, rtx, unsigned int,
- enum machine_mode);
+ addr_space_t, enum machine_mode);
static hashval_t reg_attrs_htab_hash (const void *);
static int reg_attrs_htab_eq (const void *, const void *);
static reg_attrs *get_reg_attrs (tree, int);
@@ -292,6 +293,7 @@ mem_attrs_htab_hash (const void *x)
const mem_attrs *const p = (const mem_attrs *) x;
return (p->alias ^ (p->align * 1000)
+ ^ (p->addrspace * 4000)
^ ((p->offset ? INTVAL (p->offset) : 0) * 50000)
^ ((p->size ? INTVAL (p->size) : 0) * 2500000)
^ (size_t) iterative_hash_expr (p->expr, 0));
@@ -309,6 +311,7 @@ mem_attrs_htab_eq (const void *x, const void *y)
return (p->alias == q->alias && p->offset == q->offset
&& p->size == q->size && p->align == q->align
+ && p->addrspace == q->addrspace
&& (p->expr == q->expr
|| (p->expr != NULL_TREE && q->expr != NULL_TREE
&& operand_equal_p (p->expr, q->expr, 0))));
@@ -320,7 +323,7 @@ mem_attrs_htab_eq (const void *x, const void *y)
static mem_attrs *
get_mem_attrs (alias_set_type alias, tree expr, rtx offset, rtx size,
- unsigned int align, enum machine_mode mode)
+ unsigned int align, addr_space_t addrspace, enum machine_mode mode)
{
mem_attrs attrs;
void **slot;
@@ -328,7 +331,7 @@ get_mem_attrs (alias_set_type alias, tree expr, rtx offset, rtx size,
/* If everything is the default, we can just return zero.
This must match what the corresponding MEM_* macros return when the
field is not present. */
- if (alias == 0 && expr == 0 && offset == 0
+ if (alias == 0 && expr == 0 && offset == 0 && addrspace == 0
&& (size == 0
|| (mode != BLKmode && GET_MODE_SIZE (mode) == INTVAL (size)))
&& (STRICT_ALIGNMENT && mode != BLKmode
@@ -340,6 +343,7 @@ get_mem_attrs (alias_set_type alias, tree expr, rtx offset, rtx size,
attrs.offset = offset;
attrs.size = size;
attrs.align = align;
+ attrs.addrspace = addrspace;
slot = htab_find_slot (mem_attrs_htab, &attrs, INSERT);
if (*slot == 0)
@@ -1386,7 +1390,9 @@ operand_subword (rtx op, unsigned int offset, int validate_address, enum machine
else if (reload_completed)
{
- if (! strict_memory_address_p (word_mode, XEXP (new_rtx, 0)))
+ if (! strict_memory_address_addr_space_p (word_mode,
+ XEXP (new_rtx, 0),
+ MEM_ADDR_SPACE (op)))
return 0;
}
else
@@ -1795,7 +1801,8 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
/* Now set the attributes we computed above. */
MEM_ATTRS (ref)
- = get_mem_attrs (alias, expr, offset, size, align, GET_MODE (ref));
+ = get_mem_attrs (alias, expr, offset, size, align,
+ TYPE_ADDR_SPACE (type), GET_MODE (ref));
/* If this is already known to be a scalar or aggregate, we are done. */
if (MEM_IN_STRUCT_P (ref) || MEM_SCALAR_P (ref))
@@ -1827,7 +1834,17 @@ set_mem_alias_set (rtx mem, alias_set_type set)
MEM_ATTRS (mem) = get_mem_attrs (set, MEM_EXPR (mem), MEM_OFFSET (mem),
MEM_SIZE (mem), MEM_ALIGN (mem),
- GET_MODE (mem));
+ MEM_ADDR_SPACE (mem), GET_MODE (mem));
+}
+
+/* Set the address space of MEM to ADDRSPACE (target-defined). */
+
+void
+set_mem_addr_space (rtx mem, addr_space_t addrspace)
+{
+ MEM_ATTRS (mem) = get_mem_attrs (MEM_ALIAS_SET (mem), MEM_EXPR (mem),
+ MEM_OFFSET (mem), MEM_SIZE (mem),
+ MEM_ALIGN (mem), addrspace, GET_MODE (mem));
}
/* Set the alignment of MEM to ALIGN bits. */
@@ -1837,7 +1854,7 @@ set_mem_align (rtx mem, unsigned int align)
{
MEM_ATTRS (mem) = get_mem_attrs (MEM_ALIAS_SET (mem), MEM_EXPR (mem),
MEM_OFFSET (mem), MEM_SIZE (mem), align,
- GET_MODE (mem));
+ MEM_ADDR_SPACE (mem), GET_MODE (mem));
}
/* Set the expr for MEM to EXPR. */
@@ -1847,7 +1864,8 @@ set_mem_expr (rtx mem, tree expr)
{
MEM_ATTRS (mem)
= get_mem_attrs (MEM_ALIAS_SET (mem), expr, MEM_OFFSET (mem),
- MEM_SIZE (mem), MEM_ALIGN (mem), GET_MODE (mem));
+ MEM_SIZE (mem), MEM_ALIGN (mem),
+ MEM_ADDR_SPACE (mem), GET_MODE (mem));
}
/* Set the offset of MEM to OFFSET. */
@@ -1857,7 +1875,7 @@ set_mem_offset (rtx mem, rtx offset)
{
MEM_ATTRS (mem) = get_mem_attrs (MEM_ALIAS_SET (mem), MEM_EXPR (mem),
offset, MEM_SIZE (mem), MEM_ALIGN (mem),
- GET_MODE (mem));
+ MEM_ADDR_SPACE (mem), GET_MODE (mem));
}
/* Set the size of MEM to SIZE. */
@@ -1867,7 +1885,7 @@ set_mem_size (rtx mem, rtx size)
{
MEM_ATTRS (mem) = get_mem_attrs (MEM_ALIAS_SET (mem), MEM_EXPR (mem),
MEM_OFFSET (mem), size, MEM_ALIGN (mem),
- GET_MODE (mem));
+ MEM_ADDR_SPACE (mem), GET_MODE (mem));
}
/* Return a memory reference like MEMREF, but with its mode changed to MODE
@@ -1879,23 +1897,25 @@ set_mem_size (rtx mem, rtx size)
static rtx
change_address_1 (rtx memref, enum machine_mode mode, rtx addr, int validate)
{
+ addr_space_t as;
rtx new_rtx;
gcc_assert (MEM_P (memref));
+ as = MEM_ADDR_SPACE (memref);
if (mode == VOIDmode)
mode = GET_MODE (memref);
if (addr == 0)
addr = XEXP (memref, 0);
if (mode == GET_MODE (memref) && addr == XEXP (memref, 0)
- && (!validate || memory_address_p (mode, addr)))
+ && (!validate || memory_address_addr_space_p (mode, addr, as)))
return memref;
if (validate)
{
if (reload_in_progress || reload_completed)
- gcc_assert (memory_address_p (mode, addr));
+ gcc_assert (memory_address_addr_space_p (mode, addr, as));
else
- addr = memory_address (mode, addr);
+ addr = memory_address_addr_space (mode, addr, as);
}
if (rtx_equal_p (addr, XEXP (memref, 0)) && mode == GET_MODE (memref))
@@ -1934,7 +1954,8 @@ change_address (rtx memref, enum machine_mode mode, rtx addr)
}
MEM_ATTRS (new_rtx)
- = get_mem_attrs (MEM_ALIAS_SET (memref), 0, 0, size, align, mmode);
+ = get_mem_attrs (MEM_ALIAS_SET (memref), 0, 0, size, align,
+ MEM_ADDR_SPACE (memref), mmode);
return new_rtx;
}
@@ -1954,11 +1975,13 @@ adjust_address_1 (rtx memref, enum machine_mode mode, HOST_WIDE_INT offset,
rtx memoffset = MEM_OFFSET (memref);
rtx size = 0;
unsigned int memalign = MEM_ALIGN (memref);
+ addr_space_t as = MEM_ADDR_SPACE (memref);
+ enum machine_mode address_mode = targetm.addr_space.address_mode (as);
int pbits;
/* If there are no changes, just return the original memory reference. */
if (mode == GET_MODE (memref) && !offset
- && (!validate || memory_address_p (mode, addr)))
+ && (!validate || memory_address_addr_space_p (mode, addr, as)))
return memref;
/* ??? Prefer to create garbage instead of creating shared rtl.
@@ -1968,7 +1991,7 @@ adjust_address_1 (rtx memref, enum machine_mode mode, HOST_WIDE_INT offset,
/* Convert a possibly large offset to a signed value within the
range of the target address space. */
- pbits = GET_MODE_BITSIZE (Pmode);
+ pbits = GET_MODE_BITSIZE (address_mode);
if (HOST_BITS_PER_WIDE_INT > pbits)
{
int shift = HOST_BITS_PER_WIDE_INT - pbits;
@@ -1984,7 +2007,7 @@ adjust_address_1 (rtx memref, enum machine_mode mode, HOST_WIDE_INT offset,
&& offset >= 0
&& (unsigned HOST_WIDE_INT) offset
< GET_MODE_ALIGNMENT (GET_MODE (memref)) / BITS_PER_UNIT)
- addr = gen_rtx_LO_SUM (Pmode, XEXP (addr, 0),
+ addr = gen_rtx_LO_SUM (address_mode, XEXP (addr, 0),
plus_constant (XEXP (addr, 1), offset));
else
addr = plus_constant (addr, offset);
@@ -2017,7 +2040,8 @@ adjust_address_1 (rtx memref, enum machine_mode mode, HOST_WIDE_INT offset,
size = plus_constant (MEM_SIZE (memref), -offset);
MEM_ATTRS (new_rtx) = get_mem_attrs (MEM_ALIAS_SET (memref), MEM_EXPR (memref),
- memoffset, size, memalign, GET_MODE (new_rtx));
+ memoffset, size, memalign, as,
+ GET_MODE (new_rtx));
/* At some point, we should validate that this offset is within the object,
if all the appropriate values are known. */
@@ -2045,8 +2069,10 @@ rtx
offset_address (rtx memref, rtx offset, unsigned HOST_WIDE_INT pow2)
{
rtx new_rtx, addr = XEXP (memref, 0);
+ addr_space_t as = MEM_ADDR_SPACE (memref);
+ enum machine_mode address_mode = targetm.addr_space.address_mode (as);
- new_rtx = simplify_gen_binary (PLUS, Pmode, addr, offset);
+ new_rtx = simplify_gen_binary (PLUS, address_mode, addr, offset);
/* At this point we don't know _why_ the address is invalid. It
could have secondary memory references, multiplies or anything.
@@ -2055,12 +2081,12 @@ offset_address (rtx memref, rtx offset, unsigned HOST_WIDE_INT pow2)
being able to recognize the magic around pic_offset_table_rtx.
This stuff is fragile, and is yet another example of why it is
bad to expose PIC machinery too early. */
- if (! memory_address_p (GET_MODE (memref), new_rtx)
+ if (! memory_address_addr_space_p (GET_MODE (memref), new_rtx, as)
&& GET_CODE (addr) == PLUS
&& XEXP (addr, 0) == pic_offset_table_rtx)
{
addr = force_reg (GET_MODE (addr), addr);
- new_rtx = simplify_gen_binary (PLUS, Pmode, addr, offset);
+ new_rtx = simplify_gen_binary (PLUS, address_mode, addr, offset);
}
update_temp_slot_address (XEXP (memref, 0), new_rtx);
@@ -2075,7 +2101,7 @@ offset_address (rtx memref, rtx offset, unsigned HOST_WIDE_INT pow2)
MEM_ATTRS (new_rtx)
= get_mem_attrs (MEM_ALIAS_SET (memref), MEM_EXPR (memref), 0, 0,
MIN (MEM_ALIGN (memref), pow2 * BITS_PER_UNIT),
- GET_MODE (new_rtx));
+ as, GET_MODE (new_rtx));
return new_rtx;
}
@@ -2179,7 +2205,8 @@ widen_memory_access (rtx memref, enum machine_mode mode, HOST_WIDE_INT offset)
/* ??? Maybe use get_alias_set on any remaining expression. */
MEM_ATTRS (new_rtx) = get_mem_attrs (0, expr, memoffset, GEN_INT (size),
- MEM_ALIGN (new_rtx), mode);
+ MEM_ALIGN (new_rtx),
+ MEM_ADDR_SPACE (new_rtx), mode);
return new_rtx;
}
@@ -2207,7 +2234,7 @@ get_spill_slot_decl (bool force_build_p)
rd = gen_rtx_MEM (BLKmode, frame_pointer_rtx);
MEM_NOTRAP_P (rd) = 1;
MEM_ATTRS (rd) = get_mem_attrs (new_alias_set (), d, const0_rtx,
- NULL_RTX, 0, BLKmode);
+ NULL_RTX, 0, ADDR_SPACE_GENERIC, BLKmode);
SET_DECL_RTL (d, rd);
return d;
@@ -2240,7 +2267,7 @@ set_mem_attrs_for_spill (rtx mem)
MEM_ATTRS (mem) = get_mem_attrs (alias, expr, offset,
MEM_SIZE (mem), MEM_ALIGN (mem),
- GET_MODE (mem));
+ ADDR_SPACE_GENERIC, GET_MODE (mem));
MEM_NOTRAP_P (mem) = 1;
}
@@ -2393,6 +2420,8 @@ verify_rtx_sharing (rtx orig, rtx insn)
switch (code)
{
case REG:
+ case DEBUG_EXPR:
+ case VALUE:
case CONST_INT:
case CONST_DOUBLE:
case CONST_FIXED:
@@ -2593,6 +2622,8 @@ repeat:
switch (code)
{
case REG:
+ case DEBUG_EXPR:
+ case VALUE:
case CONST_INT:
case CONST_DOUBLE:
case CONST_FIXED:
@@ -2712,6 +2743,8 @@ repeat:
switch (code)
{
case REG:
+ case DEBUG_EXPR:
+ case VALUE:
case CONST_INT:
case CONST_DOUBLE:
case CONST_FIXED:
@@ -2783,6 +2816,8 @@ set_used_flags (rtx x)
switch (code)
{
case REG:
+ case DEBUG_EXPR:
+ case VALUE:
case CONST_INT:
case CONST_DOUBLE:
case CONST_FIXED:
@@ -3481,6 +3516,10 @@ try_split (rtx pat, rtx trial, int last)
p = &XEXP (*p, 1);
*p = CALL_INSN_FUNCTION_USAGE (trial);
SIBLING_CALL_P (insn) = SIBLING_CALL_P (trial);
+
+ /* Update the debug information for the CALL_INSN. */
+ if (flag_enable_icf_debug)
+ (*debug_hooks->copy_call_info) (trial, insn);
}
}
diff --git a/gcc/emit-rtl.h b/gcc/emit-rtl.h
index ad96181af40..01479e1eb5f 100644
--- a/gcc/emit-rtl.h
+++ b/gcc/emit-rtl.h
@@ -26,6 +26,9 @@ extern void set_mem_alias_set (rtx, alias_set_type);
/* Set the alignment of MEM to ALIGN bits. */
extern void set_mem_align (rtx, unsigned int);
+/* Set the address space of MEM to ADDRSPACE. */
+extern void set_mem_addr_space (rtx, addr_space_t);
+
/* Set the expr for MEM to EXPR. */
extern void set_mem_expr (rtx, tree);
diff --git a/gcc/except.c b/gcc/except.c
index bb26bf4dc6f..b25e48b6c9b 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -552,8 +552,11 @@ duplicate_eh_regions_1 (struct duplicate_eh_regions_data *data,
case ERT_ALLOWED_EXCEPTIONS:
new_r->u.allowed.type_list = old_r->u.allowed.type_list;
- new_r->u.allowed.label
- = data->label_map (old_r->u.allowed.label, data->label_map_data);
+ if (old_r->u.allowed.label)
+ new_r->u.allowed.label
+ = data->label_map (old_r->u.allowed.label, data->label_map_data);
+ else
+ new_r->u.allowed.label = NULL_TREE;
break;
case ERT_MUST_NOT_THROW:
@@ -2886,7 +2889,14 @@ output_ttype (tree type, int tt_format, int tt_format_size)
{
struct varpool_node *node;
- type = lookup_type_for_runtime (type);
+ /* FIXME lto. pass_ipa_free_lang_data changes all types to
+ runtime types so TYPE should already be a runtime type
+ reference. When pass_ipa_free_lang data is made a default
+ pass, we can then remove the call to lookup_type_for_runtime
+ below. */
+ if (TYPE_P (type))
+ type = lookup_type_for_runtime (type);
+
value = expand_expr (type, NULL_RTX, VOIDmode, EXPAND_INITIALIZER);
/* Let cgraph know that the rtti decl is used. Not all of the
diff --git a/gcc/explow.c b/gcc/explow.c
index 3073ff0eb91..0bbbc003f6d 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -43,6 +43,7 @@ along with GCC; see the file COPYING3. If not see
static rtx break_out_memory_refs (rtx);
static void emit_stack_probe (rtx);
+static void anti_adjust_stack_and_probe (rtx);
/* Truncate and perhaps sign-extend C as appropriate for MODE. */
@@ -306,27 +307,27 @@ break_out_memory_refs (rtx x)
rtx op1 = break_out_memory_refs (XEXP (x, 1));
if (op0 != XEXP (x, 0) || op1 != XEXP (x, 1))
- x = simplify_gen_binary (GET_CODE (x), Pmode, op0, op1);
+ x = simplify_gen_binary (GET_CODE (x), GET_MODE (x), op0, op1);
}
return x;
}
-/* Given X, a memory address in ptr_mode, convert it to an address
- in Pmode, or vice versa (TO_MODE says which way). We take advantage of
- the fact that pointers are not allowed to overflow by commuting arithmetic
- operations over conversions so that address arithmetic insns can be
- used. */
+/* Given X, a memory address in address space AS' pointer mode, convert it to
+ an address in the address space's address mode, or vice versa (TO_MODE says
+ which way). We take advantage of the fact that pointers are not allowed to
+ overflow by commuting arithmetic operations over conversions so that address
+ arithmetic insns can be used. */
rtx
-convert_memory_address (enum machine_mode to_mode ATTRIBUTE_UNUSED,
- rtx x)
+convert_memory_address_addr_space (enum machine_mode to_mode ATTRIBUTE_UNUSED,
+ rtx x, addr_space_t as ATTRIBUTE_UNUSED)
{
#ifndef POINTERS_EXTEND_UNSIGNED
gcc_assert (GET_MODE (x) == to_mode || GET_MODE (x) == VOIDmode);
return x;
#else /* defined(POINTERS_EXTEND_UNSIGNED) */
- enum machine_mode from_mode;
+ enum machine_mode pointer_mode, address_mode, from_mode;
rtx temp;
enum rtx_code code;
@@ -334,7 +335,9 @@ convert_memory_address (enum machine_mode to_mode ATTRIBUTE_UNUSED,
if (GET_MODE (x) == to_mode)
return x;
- from_mode = to_mode == ptr_mode ? Pmode : ptr_mode;
+ pointer_mode = targetm.addr_space.pointer_mode (as);
+ address_mode = targetm.addr_space.address_mode (as);
+ from_mode = to_mode == pointer_mode ? address_mode : pointer_mode;
/* Here we handle some special cases. If none of them apply, fall through
to the default case. */
@@ -375,7 +378,8 @@ convert_memory_address (enum machine_mode to_mode ATTRIBUTE_UNUSED,
case CONST:
return gen_rtx_CONST (to_mode,
- convert_memory_address (to_mode, XEXP (x, 0)));
+ convert_memory_address_addr_space
+ (to_mode, XEXP (x, 0), as));
break;
case PLUS:
@@ -389,10 +393,12 @@ convert_memory_address (enum machine_mode to_mode ATTRIBUTE_UNUSED,
if (GET_MODE_SIZE (to_mode) < GET_MODE_SIZE (from_mode)
|| (GET_CODE (x) == PLUS
&& CONST_INT_P (XEXP (x, 1))
- && (XEXP (x, 1) == convert_memory_address (to_mode, XEXP (x, 1))
+ && (XEXP (x, 1) == convert_memory_address_addr_space
+ (to_mode, XEXP (x, 1), as)
|| POINTERS_EXTEND_UNSIGNED < 0)))
return gen_rtx_fmt_ee (GET_CODE (x), to_mode,
- convert_memory_address (to_mode, XEXP (x, 0)),
+ convert_memory_address_addr_space
+ (to_mode, XEXP (x, 0), as),
XEXP (x, 1));
break;
@@ -405,21 +411,22 @@ convert_memory_address (enum machine_mode to_mode ATTRIBUTE_UNUSED,
#endif /* defined(POINTERS_EXTEND_UNSIGNED) */
}
-/* Return something equivalent to X but valid as a memory address
- for something of mode MODE. When X is not itself valid, this
- works by copying X or subexpressions of it into registers. */
+/* Return something equivalent to X but valid as a memory address for something
+ of mode MODE in the named address space AS. When X is not itself valid,
+ this works by copying X or subexpressions of it into registers. */
rtx
-memory_address (enum machine_mode mode, rtx x)
+memory_address_addr_space (enum machine_mode mode, rtx x, addr_space_t as)
{
rtx oldx = x;
+ enum machine_mode address_mode = targetm.addr_space.address_mode (as);
- x = convert_memory_address (Pmode, x);
+ x = convert_memory_address_addr_space (address_mode, x, as);
/* By passing constant addresses through registers
we get a chance to cse them. */
if (! cse_not_expected && CONSTANT_P (x) && CONSTANT_ADDRESS_P (x))
- x = force_reg (Pmode, x);
+ x = force_reg (address_mode, x);
/* We get better cse by rejecting indirect addressing at this stage.
Let the combiner create indirect addresses where appropriate.
@@ -431,12 +438,12 @@ memory_address (enum machine_mode mode, rtx x)
x = break_out_memory_refs (x);
/* At this point, any valid address is accepted. */
- if (memory_address_p (mode, x))
+ if (memory_address_addr_space_p (mode, x, as))
goto done;
/* If it was valid before but breaking out memory refs invalidated it,
use it the old way. */
- if (memory_address_p (mode, oldx))
+ if (memory_address_addr_space_p (mode, oldx, as))
{
x = oldx;
goto done;
@@ -447,9 +454,9 @@ memory_address (enum machine_mode mode, rtx x)
below can handle all possible cases, but machine-dependent
transformations can make better code. */
{
- rtx orig_x = x;
- x = targetm.legitimize_address (x, oldx, mode);
- if (orig_x != x && memory_address_p (mode, x))
+ rtx orig_x = x;
+ x = targetm.addr_space.legitimize_address (x, oldx, mode, as);
+ if (orig_x != x && memory_address_addr_space_p (mode, x, as))
goto done;
}
@@ -467,12 +474,12 @@ memory_address (enum machine_mode mode, rtx x)
rtx constant_term = const0_rtx;
rtx y = eliminate_constant_term (x, &constant_term);
if (constant_term == const0_rtx
- || ! memory_address_p (mode, y))
+ || ! memory_address_addr_space_p (mode, y, as))
x = force_operand (x, NULL_RTX);
else
{
y = gen_rtx_PLUS (GET_MODE (x), copy_to_reg (y), constant_term);
- if (! memory_address_p (mode, y))
+ if (! memory_address_addr_space_p (mode, y, as))
x = force_operand (x, NULL_RTX);
else
x = y;
@@ -490,12 +497,12 @@ memory_address (enum machine_mode mode, rtx x)
/* Last resort: copy the value to a register, since
the register is a valid address. */
else
- x = force_reg (Pmode, x);
+ x = force_reg (address_mode, x);
}
done:
- gcc_assert (memory_address_p (mode, x));
+ gcc_assert (memory_address_addr_space_p (mode, x, as));
/* If we didn't change the address, we are done. Otherwise, mark
a reg as a pointer if we have REG or REG + CONST_INT. */
if (oldx == x)
@@ -523,7 +530,8 @@ validize_mem (rtx ref)
if (!MEM_P (ref))
return ref;
ref = use_anchored_address (ref);
- if (memory_address_p (GET_MODE (ref), XEXP (ref, 0)))
+ if (memory_address_addr_space_p (GET_MODE (ref), XEXP (ref, 0),
+ MEM_ADDR_SPACE (ref)))
return ref;
/* Don't alter REF itself, since that is probably a stack slot. */
@@ -800,7 +808,8 @@ promote_mode (const_tree type ATTRIBUTE_UNUSED, enum machine_mode mode,
case REFERENCE_TYPE:
case POINTER_TYPE:
*punsignedp = POINTERS_EXTEND_UNSIGNED;
- return Pmode;
+ return targetm.addr_space.address_mode
+ (TYPE_ADDR_SPACE (TREE_TYPE (type)));
break;
#endif
@@ -1225,9 +1234,11 @@ allocate_dynamic_stack_space (rtx size, rtx target, int known_align)
gcc_assert (!(stack_pointer_delta
% (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT)));
- /* If needed, check that we have the required amount of stack.
- Take into account what has already been checked. */
- if (flag_stack_check == GENERIC_STACK_CHECK)
+ /* If needed, check that we have the required amount of stack. Take into
+ account what has already been checked. */
+ if (STACK_CHECK_MOVING_SP)
+ ;
+ else if (flag_stack_check == GENERIC_STACK_CHECK)
probe_stack_range (STACK_OLD_CHECK_PROTECT + STACK_CHECK_MAX_FRAME_SIZE,
size);
else if (flag_stack_check == STATIC_BUILTIN_STACK_CHECK)
@@ -1296,7 +1307,10 @@ allocate_dynamic_stack_space (rtx size, rtx target, int known_align)
emit_label (space_available);
}
- anti_adjust_stack (size);
+ if (flag_stack_check && STACK_CHECK_MOVING_SP)
+ anti_adjust_stack_and_probe (size);
+ else
+ anti_adjust_stack (size);
#ifdef STACK_GROWS_DOWNWARD
emit_move_insn (target, virtual_stack_dynamic_rtx);
@@ -1347,6 +1361,12 @@ emit_stack_probe (rtx address)
MEM_VOLATILE_P (memref) = 1;
+ /* See if we have an insn to probe the stack. */
+#ifdef HAVE_probe_stack
+ if (HAVE_probe_stack)
+ emit_insn (gen_probe_stack (memref));
+ else
+#endif
if (STACK_CHECK_PROBE_LOAD)
emit_move_insn (gen_reg_rtx (word_mode), memref);
else
@@ -1354,15 +1374,20 @@ emit_stack_probe (rtx address)
}
/* Probe a range of stack addresses from FIRST to FIRST+SIZE, inclusive.
- FIRST is a constant and size is a Pmode RTX. These are offsets from the
- current stack pointer. STACK_GROWS_DOWNWARD says whether to add or
- subtract from the stack. If SIZE is constant, this is done
- with a fixed number of probes. Otherwise, we must make a loop. */
+ FIRST is a constant and size is a Pmode RTX. These are offsets from
+ the current stack pointer. STACK_GROWS_DOWNWARD says whether to add
+ or subtract them from the stack pointer. */
+
+#define PROBE_INTERVAL (1 << STACK_CHECK_PROBE_INTERVAL_EXP)
#ifdef STACK_GROWS_DOWNWARD
#define STACK_GROW_OP MINUS
+#define STACK_GROW_OPTAB sub_optab
+#define STACK_GROW_OFF(off) -(off)
#else
#define STACK_GROW_OP PLUS
+#define STACK_GROW_OPTAB add_optab
+#define STACK_GROW_OFF(off) (off)
#endif
void
@@ -1372,113 +1397,272 @@ probe_stack_range (HOST_WIDE_INT first, rtx size)
if (GET_MODE (size) != VOIDmode && GET_MODE (size) != Pmode)
size = convert_to_mode (Pmode, size, 1);
- /* Next see if the front end has set up a function for us to call to
- check the stack. */
- if (stack_check_libfunc != 0)
+ /* Next see if we have a function to check the stack. */
+ if (stack_check_libfunc)
{
- rtx addr = memory_address (QImode,
+ rtx addr = memory_address (Pmode,
gen_rtx_fmt_ee (STACK_GROW_OP, Pmode,
stack_pointer_rtx,
plus_constant (size, first)));
-
- addr = convert_memory_address (ptr_mode, addr);
- emit_library_call (stack_check_libfunc, LCT_NORMAL, VOIDmode, 1, addr,
- ptr_mode);
+ emit_library_call (stack_check_libfunc, LCT_NORMAL, VOIDmode, 1, addr);
}
- /* Next see if we have an insn to check the stack. Use it if so. */
+ /* Next see if we have an insn to check the stack. */
#ifdef HAVE_check_stack
else if (HAVE_check_stack)
{
- insn_operand_predicate_fn pred;
- rtx last_addr
- = force_operand (gen_rtx_fmt_ee (STACK_GROW_OP, Pmode,
- stack_pointer_rtx,
- plus_constant (size, first)),
- NULL_RTX);
-
- pred = insn_data[(int) CODE_FOR_check_stack].operand[0].predicate;
- if (pred && ! ((*pred) (last_addr, Pmode)))
- last_addr = copy_to_mode_reg (Pmode, last_addr);
+ rtx addr = memory_address (Pmode,
+ gen_rtx_fmt_ee (STACK_GROW_OP, Pmode,
+ stack_pointer_rtx,
+ plus_constant (size, first)));
+ insn_operand_predicate_fn pred
+ = insn_data[(int) CODE_FOR_check_stack].operand[0].predicate;
+ if (pred && !((*pred) (addr, Pmode)))
+ addr = copy_to_mode_reg (Pmode, addr);
- emit_insn (gen_check_stack (last_addr));
+ emit_insn (gen_check_stack (addr));
}
#endif
- /* If we have to generate explicit probes, see if we have a constant
- small number of them to generate. If so, that's the easy case. */
- else if (CONST_INT_P (size)
- && INTVAL (size) < 10 * STACK_CHECK_PROBE_INTERVAL)
+ /* Otherwise we have to generate explicit probes. If we have a constant
+ small number of them to generate, that's the easy case. */
+ else if (CONST_INT_P (size) && INTVAL (size) < 7 * PROBE_INTERVAL)
{
- HOST_WIDE_INT offset;
-
- /* Start probing at FIRST + N * STACK_CHECK_PROBE_INTERVAL
- for values of N from 1 until it exceeds LAST. If only one
- probe is needed, this will not generate any code. Then probe
- at LAST. */
- for (offset = first + STACK_CHECK_PROBE_INTERVAL;
- offset < INTVAL (size);
- offset = offset + STACK_CHECK_PROBE_INTERVAL)
- emit_stack_probe (gen_rtx_fmt_ee (STACK_GROW_OP, Pmode,
- stack_pointer_rtx,
- GEN_INT (offset)));
-
- emit_stack_probe (gen_rtx_fmt_ee (STACK_GROW_OP, Pmode,
- stack_pointer_rtx,
- plus_constant (size, first)));
+ HOST_WIDE_INT isize = INTVAL (size), i;
+ rtx addr;
+
+ /* Probe at FIRST + N * PROBE_INTERVAL for values of N from 1 until
+ it exceeds SIZE. If only one probe is needed, this will not
+ generate any code. Then probe at FIRST + SIZE. */
+ for (i = PROBE_INTERVAL; i < isize; i += PROBE_INTERVAL)
+ {
+ addr = memory_address (Pmode,
+ plus_constant (stack_pointer_rtx,
+ STACK_GROW_OFF (first + i)));
+ emit_stack_probe (addr);
+ }
+
+ addr = memory_address (Pmode,
+ plus_constant (stack_pointer_rtx,
+ STACK_GROW_OFF (first + isize)));
+ emit_stack_probe (addr);
}
- /* In the variable case, do the same as above, but in a loop. We emit loop
- notes so that loop optimization can be done. */
+ /* In the variable case, do the same as above, but in a loop. Note that we
+ must be extra careful with variables wrapping around because we might be
+ at the very top (or the very bottom) of the address space and we have to
+ be able to handle this case properly; in particular, we use an equality
+ test for the loop condition. */
else
{
- rtx test_addr
- = force_operand (gen_rtx_fmt_ee (STACK_GROW_OP, Pmode,
- stack_pointer_rtx,
- GEN_INT (first + STACK_CHECK_PROBE_INTERVAL)),
- NULL_RTX);
- rtx last_addr
- = force_operand (gen_rtx_fmt_ee (STACK_GROW_OP, Pmode,
- stack_pointer_rtx,
- plus_constant (size, first)),
- NULL_RTX);
- rtx incr = GEN_INT (STACK_CHECK_PROBE_INTERVAL);
+ rtx rounded_size, rounded_size_op, test_addr, last_addr, temp;
rtx loop_lab = gen_label_rtx ();
- rtx test_lab = gen_label_rtx ();
rtx end_lab = gen_label_rtx ();
- rtx temp;
- if (!REG_P (test_addr)
- || REGNO (test_addr) < FIRST_PSEUDO_REGISTER)
- test_addr = force_reg (Pmode, test_addr);
- emit_jump (test_lab);
+ /* Step 1: round SIZE to the previous multiple of the interval. */
+
+ /* ROUNDED_SIZE = SIZE & -PROBE_INTERVAL */
+ rounded_size
+ = simplify_gen_binary (AND, Pmode, size, GEN_INT (-PROBE_INTERVAL));
+ rounded_size_op = force_operand (rounded_size, NULL_RTX);
+
+
+ /* Step 2: compute initial and final value of the loop counter. */
+
+ /* TEST_ADDR = SP + FIRST. */
+ test_addr = force_operand (gen_rtx_fmt_ee (STACK_GROW_OP, Pmode,
+ stack_pointer_rtx,
+ GEN_INT (first)), NULL_RTX);
+
+ /* LAST_ADDR = SP + FIRST + ROUNDED_SIZE. */
+ last_addr = force_operand (gen_rtx_fmt_ee (STACK_GROW_OP, Pmode,
+ test_addr,
+ rounded_size_op), NULL_RTX);
+
+
+ /* Step 3: the loop
+
+ while (TEST_ADDR != LAST_ADDR)
+ {
+ TEST_ADDR = TEST_ADDR + PROBE_INTERVAL
+ probe at TEST_ADDR
+ }
+
+ probes at FIRST + N * PROBE_INTERVAL for values of N from 1
+ until it is equal to ROUNDED_SIZE. */
emit_label (loop_lab);
- emit_stack_probe (test_addr);
-#ifdef STACK_GROWS_DOWNWARD
-#define CMP_OPCODE GTU
- temp = expand_binop (Pmode, sub_optab, test_addr, incr, test_addr,
- 1, OPTAB_WIDEN);
-#else
-#define CMP_OPCODE LTU
- temp = expand_binop (Pmode, add_optab, test_addr, incr, test_addr,
+ /* Jump to END_LAB if TEST_ADDR == LAST_ADDR. */
+ emit_cmp_and_jump_insns (test_addr, last_addr, EQ, NULL_RTX, Pmode, 1,
+ end_lab);
+
+ /* TEST_ADDR = TEST_ADDR + PROBE_INTERVAL. */
+ temp = expand_binop (Pmode, STACK_GROW_OPTAB, test_addr,
+ GEN_INT (PROBE_INTERVAL), test_addr,
1, OPTAB_WIDEN);
-#endif
gcc_assert (temp == test_addr);
- emit_label (test_lab);
- emit_cmp_and_jump_insns (test_addr, last_addr, CMP_OPCODE,
- NULL_RTX, Pmode, 1, loop_lab);
- emit_jump (end_lab);
+ /* Probe at TEST_ADDR. */
+ emit_stack_probe (test_addr);
+
+ emit_jump (loop_lab);
+
emit_label (end_lab);
- emit_stack_probe (last_addr);
+
+ /* Step 4: probe at FIRST + SIZE if we cannot assert at compile-time
+ that SIZE is equal to ROUNDED_SIZE. */
+
+ /* TEMP = SIZE - ROUNDED_SIZE. */
+ temp = simplify_gen_binary (MINUS, Pmode, size, rounded_size);
+ if (temp != const0_rtx)
+ {
+ rtx addr;
+
+ if (GET_CODE (temp) == CONST_INT)
+ {
+ /* Use [base + disp} addressing mode if supported. */
+ HOST_WIDE_INT offset = INTVAL (temp);
+ addr = memory_address (Pmode,
+ plus_constant (last_addr,
+ STACK_GROW_OFF (offset)));
+ }
+ else
+ {
+ /* Manual CSE if the difference is not known at compile-time. */
+ temp = gen_rtx_MINUS (Pmode, size, rounded_size_op);
+ addr = memory_address (Pmode,
+ gen_rtx_fmt_ee (STACK_GROW_OP, Pmode,
+ last_addr, temp));
+ }
+
+ emit_stack_probe (addr);
+ }
}
}
-
+
+/* Adjust the stack by SIZE bytes while probing it. Note that we skip the
+ probe for the first interval + a small dope of 4 words and instead probe
+ that many bytes past the specified size to maintain a protection area. */
+
+static void
+anti_adjust_stack_and_probe (rtx size)
+{
+ const int dope = 4 * UNITS_PER_WORD;
+
+ /* First ensure SIZE is Pmode. */
+ if (GET_MODE (size) != VOIDmode && GET_MODE (size) != Pmode)
+ size = convert_to_mode (Pmode, size, 1);
+
+ /* If we have a constant small number of probes to generate, that's the
+ easy case. */
+ if (GET_CODE (size) == CONST_INT && INTVAL (size) < 7 * PROBE_INTERVAL)
+ {
+ HOST_WIDE_INT isize = INTVAL (size), i;
+ bool first_probe = true;
+
+ /* Adjust SP and probe to PROBE_INTERVAL + N * PROBE_INTERVAL for
+ values of N from 1 until it exceeds SIZE. If only one probe is
+ needed, this will not generate any code. Then adjust and probe
+ to PROBE_INTERVAL + SIZE. */
+ for (i = PROBE_INTERVAL; i < isize; i += PROBE_INTERVAL)
+ {
+ if (first_probe)
+ {
+ anti_adjust_stack (GEN_INT (2 * PROBE_INTERVAL + dope));
+ first_probe = false;
+ }
+ else
+ anti_adjust_stack (GEN_INT (PROBE_INTERVAL));
+ emit_stack_probe (stack_pointer_rtx);
+ }
+
+ if (first_probe)
+ anti_adjust_stack (plus_constant (size, PROBE_INTERVAL + dope));
+ else
+ anti_adjust_stack (plus_constant (size, PROBE_INTERVAL - i));
+ emit_stack_probe (stack_pointer_rtx);
+ }
+
+ /* In the variable case, do the same as above, but in a loop. Note that we
+ must be extra careful with variables wrapping around because we might be
+ at the very top (or the very bottom) of the address space and we have to
+ be able to handle this case properly; in particular, we use an equality
+ test for the loop condition. */
+ else
+ {
+ rtx rounded_size, rounded_size_op, last_addr, temp;
+ rtx loop_lab = gen_label_rtx ();
+ rtx end_lab = gen_label_rtx ();
+
+
+ /* Step 1: round SIZE to the previous multiple of the interval. */
+
+ /* ROUNDED_SIZE = SIZE & -PROBE_INTERVAL */
+ rounded_size
+ = simplify_gen_binary (AND, Pmode, size, GEN_INT (-PROBE_INTERVAL));
+ rounded_size_op = force_operand (rounded_size, NULL_RTX);
+
+
+ /* Step 2: compute initial and final value of the loop counter. */
+
+ /* SP = SP_0 + PROBE_INTERVAL. */
+ anti_adjust_stack (GEN_INT (PROBE_INTERVAL + dope));
+
+ /* LAST_ADDR = SP_0 + PROBE_INTERVAL + ROUNDED_SIZE. */
+ last_addr = force_operand (gen_rtx_fmt_ee (STACK_GROW_OP, Pmode,
+ stack_pointer_rtx,
+ rounded_size_op), NULL_RTX);
+
+
+ /* Step 3: the loop
+
+ while (SP != LAST_ADDR)
+ {
+ SP = SP + PROBE_INTERVAL
+ probe at SP
+ }
+
+ adjusts SP and probes to PROBE_INTERVAL + N * PROBE_INTERVAL for
+ values of N from 1 until it is equal to ROUNDED_SIZE. */
+
+ emit_label (loop_lab);
+
+ /* Jump to END_LAB if SP == LAST_ADDR. */
+ emit_cmp_and_jump_insns (stack_pointer_rtx, last_addr, EQ, NULL_RTX,
+ Pmode, 1, end_lab);
+
+ /* SP = SP + PROBE_INTERVAL and probe at SP. */
+ anti_adjust_stack (GEN_INT (PROBE_INTERVAL));
+ emit_stack_probe (stack_pointer_rtx);
+
+ emit_jump (loop_lab);
+
+ emit_label (end_lab);
+
+
+ /* Step 4: adjust SP and probe to PROBE_INTERVAL + SIZE if we cannot
+ assert at compile-time that SIZE is equal to ROUNDED_SIZE. */
+
+ /* TEMP = SIZE - ROUNDED_SIZE. */
+ temp = simplify_gen_binary (MINUS, Pmode, size, rounded_size);
+ if (temp != const0_rtx)
+ {
+ /* Manual CSE if the difference is not known at compile-time. */
+ if (GET_CODE (temp) != CONST_INT)
+ temp = gen_rtx_MINUS (Pmode, size, rounded_size_op);
+ anti_adjust_stack (temp);
+ emit_stack_probe (stack_pointer_rtx);
+ }
+ }
+
+ /* Adjust back to account for the additional first interval. */
+ adjust_stack (GEN_INT (PROBE_INTERVAL + dope));
+}
+
/* Return an rtx representing the register or memory location
in which a scalar value of data type VALTYPE
was returned by a function call to function FUNC.
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 98a99a2b5f1..8a5cf5054e7 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -5089,10 +5089,11 @@ make_tree (tree type, rtx x)
default:
t = build_decl (RTL_LOCATION (x), VAR_DECL, NULL_TREE, type);
- /* If TYPE is a POINTER_TYPE, X might be Pmode with TYPE_MODE being
- ptr_mode. So convert. */
+ /* If TYPE is a POINTER_TYPE, we might need to convert X from
+ address mode to pointer mode. */
if (POINTER_TYPE_P (type))
- x = convert_memory_address (TYPE_MODE (type), x);
+ x = convert_memory_address_addr_space
+ (TYPE_MODE (type), x, TYPE_ADDR_SPACE (TREE_TYPE (type)));
/* Note that we do *not* use SET_DECL_RTL here, because we do not
want set_decl_rtl to go adjusting REG_ATTRS for this temporary. */
@@ -5497,9 +5498,13 @@ emit_store_flag (rtx target, enum rtx_code code, rtx op0, rtx op1,
|| (! HONOR_NANS (mode) && (code == LTGT || code == UNEQ))
|| (! HONOR_SNANS (mode) && (code == EQ || code == NE))))
{
+ int want_add = ((STORE_FLAG_VALUE == 1 && normalizep == -1)
+ || (STORE_FLAG_VALUE == -1 && normalizep == 1));
+
/* For the reverse comparison, use either an addition or a XOR. */
- if ((STORE_FLAG_VALUE == 1 && normalizep == -1)
- || (STORE_FLAG_VALUE == -1 && normalizep == 1))
+ if (want_add
+ && rtx_cost (GEN_INT (normalizep), PLUS,
+ optimize_insn_for_speed_p ()) == 0)
{
tem = emit_store_flag_1 (subtarget, rcode, op0, op1, mode, 0,
STORE_FLAG_VALUE, target_mode);
@@ -5508,7 +5513,9 @@ emit_store_flag (rtx target, enum rtx_code code, rtx op0, rtx op1,
GEN_INT (normalizep),
target, 0, OPTAB_WIDEN);
}
- else
+ else if (!want_add
+ && rtx_cost (trueval, XOR,
+ optimize_insn_for_speed_p ()) == 0)
{
tem = emit_store_flag_1 (subtarget, rcode, op0, op1, mode, 0,
normalizep, target_mode);
@@ -5595,9 +5602,13 @@ emit_store_flag (rtx target, enum rtx_code code, rtx op0, rtx op1,
&& GET_MODE_SIZE (mode) < UNITS_PER_WORD
&& op1 == const0_rtx))
{
+ int want_add = ((STORE_FLAG_VALUE == 1 && normalizep == -1)
+ || (STORE_FLAG_VALUE == -1 && normalizep == 1));
+
/* Again, for the reverse comparison, use either an addition or a XOR. */
- if ((STORE_FLAG_VALUE == 1 && normalizep == -1)
- || (STORE_FLAG_VALUE == -1 && normalizep == 1))
+ if (want_add
+ && rtx_cost (GEN_INT (normalizep), PLUS,
+ optimize_insn_for_speed_p ()) == 0)
{
tem = emit_store_flag_1 (subtarget, rcode, op0, op1, mode, 0,
STORE_FLAG_VALUE, target_mode);
@@ -5605,7 +5616,9 @@ emit_store_flag (rtx target, enum rtx_code code, rtx op0, rtx op1,
tem = expand_binop (target_mode, add_optab, tem,
GEN_INT (normalizep), target, 0, OPTAB_WIDEN);
}
- else
+ else if (!want_add
+ && rtx_cost (trueval, XOR,
+ optimize_insn_for_speed_p ()) == 0)
{
tem = emit_store_flag_1 (subtarget, rcode, op0, op1, mode, 0,
normalizep, target_mode);
diff --git a/gcc/expr.c b/gcc/expr.c
index 5d18435a99a..e62b5302114 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -877,6 +877,8 @@ move_by_pieces (rtx to, rtx from, unsigned HOST_WIDE_INT len,
unsigned int align, int endp)
{
struct move_by_pieces_d data;
+ enum machine_mode to_addr_mode, from_addr_mode
+ = targetm.addr_space.address_mode (MEM_ADDR_SPACE (from));
rtx to_addr, from_addr = XEXP (from, 0);
unsigned int max_size = MOVE_MAX_PIECES + 1;
enum machine_mode mode = VOIDmode, tmode;
@@ -888,6 +890,7 @@ move_by_pieces (rtx to, rtx from, unsigned HOST_WIDE_INT len,
data.from_addr = from_addr;
if (to)
{
+ to_addr_mode = targetm.addr_space.address_mode (MEM_ADDR_SPACE (to));
to_addr = XEXP (to, 0);
data.to = to;
data.autinc_to
@@ -898,6 +901,7 @@ move_by_pieces (rtx to, rtx from, unsigned HOST_WIDE_INT len,
}
else
{
+ to_addr_mode = VOIDmode;
to_addr = NULL_RTX;
data.to = NULL_RTX;
data.autinc_to = 1;
@@ -933,32 +937,34 @@ move_by_pieces (rtx to, rtx from, unsigned HOST_WIDE_INT len,
if (USE_LOAD_PRE_DECREMENT (mode) && data.reverse && ! data.autinc_from)
{
- data.from_addr = copy_addr_to_reg (plus_constant (from_addr, len));
+ data.from_addr = copy_to_mode_reg (from_addr_mode,
+ plus_constant (from_addr, len));
data.autinc_from = 1;
data.explicit_inc_from = -1;
}
if (USE_LOAD_POST_INCREMENT (mode) && ! data.autinc_from)
{
- data.from_addr = copy_addr_to_reg (from_addr);
+ data.from_addr = copy_to_mode_reg (from_addr_mode, from_addr);
data.autinc_from = 1;
data.explicit_inc_from = 1;
}
if (!data.autinc_from && CONSTANT_P (from_addr))
- data.from_addr = copy_addr_to_reg (from_addr);
+ data.from_addr = copy_to_mode_reg (from_addr_mode, from_addr);
if (USE_STORE_PRE_DECREMENT (mode) && data.reverse && ! data.autinc_to)
{
- data.to_addr = copy_addr_to_reg (plus_constant (to_addr, len));
+ data.to_addr = copy_to_mode_reg (to_addr_mode,
+ plus_constant (to_addr, len));
data.autinc_to = 1;
data.explicit_inc_to = -1;
}
if (USE_STORE_POST_INCREMENT (mode) && ! data.reverse && ! data.autinc_to)
{
- data.to_addr = copy_addr_to_reg (to_addr);
+ data.to_addr = copy_to_mode_reg (to_addr_mode, to_addr);
data.autinc_to = 1;
data.explicit_inc_to = 1;
}
if (!data.autinc_to && CONSTANT_P (to_addr))
- data.to_addr = copy_addr_to_reg (to_addr);
+ data.to_addr = copy_to_mode_reg (to_addr_mode, to_addr);
}
tmode = mode_for_size (MOVE_MAX_PIECES * BITS_PER_UNIT, MODE_INT, 1);
@@ -1013,7 +1019,8 @@ move_by_pieces (rtx to, rtx from, unsigned HOST_WIDE_INT len,
if (HAVE_POST_INCREMENT && data.explicit_inc_to > 0)
emit_insn (gen_add2_insn (data.to_addr, constm1_rtx));
else
- data.to_addr = copy_addr_to_reg (plus_constant (data.to_addr,
+ data.to_addr = copy_to_mode_reg (to_addr_mode,
+ plus_constant (data.to_addr,
-1));
}
to1 = adjust_automodify_address (data.to, QImode, data.to_addr,
@@ -1215,7 +1222,9 @@ emit_block_move_hints (rtx x, rtx y, rtx size, enum block_op_methods method,
else if (emit_block_move_via_movmem (x, y, size, align,
expected_align, expected_size))
;
- else if (may_use_call)
+ else if (may_use_call
+ && ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (x))
+ && ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (y)))
retval = emit_block_move_via_libcall (x, y, size,
method == BLOCK_OP_TAILCALL);
else
@@ -1466,6 +1475,10 @@ emit_block_move_via_loop (rtx x, rtx y, rtx size,
unsigned int align ATTRIBUTE_UNUSED)
{
rtx cmp_label, top_label, iter, x_addr, y_addr, tmp;
+ enum machine_mode x_addr_mode
+ = targetm.addr_space.address_mode (MEM_ADDR_SPACE (x));
+ enum machine_mode y_addr_mode
+ = targetm.addr_space.address_mode (MEM_ADDR_SPACE (y));
enum machine_mode iter_mode;
iter_mode = GET_MODE (size);
@@ -1485,9 +1498,13 @@ emit_block_move_via_loop (rtx x, rtx y, rtx size,
emit_jump (cmp_label);
emit_label (top_label);
- tmp = convert_modes (Pmode, iter_mode, iter, true);
- x_addr = gen_rtx_PLUS (Pmode, x_addr, tmp);
- y_addr = gen_rtx_PLUS (Pmode, y_addr, tmp);
+ tmp = convert_modes (x_addr_mode, iter_mode, iter, true);
+ x_addr = gen_rtx_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);
+
x = change_address (x, QImode, x_addr);
y = change_address (y, QImode, y_addr);
@@ -2382,6 +2399,8 @@ store_by_pieces (rtx to, unsigned HOST_WIDE_INT len,
rtx (*constfun) (void *, HOST_WIDE_INT, enum machine_mode),
void *constfundata, unsigned int align, bool memsetp, int endp)
{
+ enum machine_mode to_addr_mode
+ = targetm.addr_space.address_mode (MEM_ADDR_SPACE (to));
struct store_by_pieces_d data;
if (len == 0)
@@ -2410,7 +2429,8 @@ store_by_pieces (rtx to, unsigned HOST_WIDE_INT len,
if (HAVE_POST_INCREMENT && data.explicit_inc_to > 0)
emit_insn (gen_add2_insn (data.to_addr, constm1_rtx));
else
- data.to_addr = copy_addr_to_reg (plus_constant (data.to_addr,
+ data.to_addr = copy_to_mode_reg (to_addr_mode,
+ plus_constant (data.to_addr,
-1));
}
to1 = adjust_automodify_address (data.to, QImode, data.to_addr,
@@ -2465,6 +2485,8 @@ static void
store_by_pieces_1 (struct store_by_pieces_d *data ATTRIBUTE_UNUSED,
unsigned int align ATTRIBUTE_UNUSED)
{
+ enum machine_mode to_addr_mode
+ = targetm.addr_space.address_mode (MEM_ADDR_SPACE (data->to));
rtx to_addr = XEXP (data->to, 0);
unsigned int max_size = STORE_MAX_PIECES + 1;
enum machine_mode mode = VOIDmode, tmode;
@@ -2496,7 +2518,8 @@ store_by_pieces_1 (struct store_by_pieces_d *data ATTRIBUTE_UNUSED,
if (USE_STORE_PRE_DECREMENT (mode) && data->reverse && ! data->autinc_to)
{
- data->to_addr = copy_addr_to_reg (plus_constant (to_addr, data->len));
+ data->to_addr = copy_to_mode_reg (to_addr_mode,
+ plus_constant (to_addr, data->len));
data->autinc_to = 1;
data->explicit_inc_to = -1;
}
@@ -2504,13 +2527,13 @@ store_by_pieces_1 (struct store_by_pieces_d *data ATTRIBUTE_UNUSED,
if (USE_STORE_POST_INCREMENT (mode) && ! data->reverse
&& ! data->autinc_to)
{
- data->to_addr = copy_addr_to_reg (to_addr);
+ data->to_addr = copy_to_mode_reg (to_addr_mode, to_addr);
data->autinc_to = 1;
data->explicit_inc_to = 1;
}
if ( !data->autinc_to && CONSTANT_P (to_addr))
- data->to_addr = copy_addr_to_reg (to_addr);
+ data->to_addr = copy_to_mode_reg (to_addr_mode, to_addr);
}
tmode = mode_for_size (STORE_MAX_PIECES * BITS_PER_UNIT, MODE_INT, 1);
@@ -2641,9 +2664,11 @@ clear_storage_hints (rtx object, rtx size, enum block_op_methods method,
else if (set_storage_via_setmem (object, size, const0_rtx, align,
expected_align, expected_size))
;
- else
+ else if (ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (object)))
return set_storage_via_libcall (object, size, const0_rtx,
method == BLOCK_OP_TAILCALL);
+ else
+ gcc_unreachable ();
return NULL;
}
@@ -3432,12 +3457,14 @@ emit_move_insn (rtx x, rtx y)
/* If X or Y are memory references, verify that their addresses are valid
for the machine. */
if (MEM_P (x)
- && (! memory_address_p (GET_MODE (x), XEXP (x, 0))
+ && (! memory_address_addr_space_p (GET_MODE (x), XEXP (x, 0),
+ MEM_ADDR_SPACE (x))
&& ! push_operand (x, GET_MODE (x))))
x = validize_mem (x);
if (MEM_P (y)
- && ! memory_address_p (GET_MODE (y), XEXP (y, 0)))
+ && ! memory_address_addr_space_p (GET_MODE (y), XEXP (y, 0),
+ MEM_ADDR_SPACE (y)))
y = validize_mem (y);
gcc_assert (mode != BLKmode);
@@ -4208,6 +4235,7 @@ expand_assignment (tree to, tree from, bool nontemporal)
if (offset != 0)
{
+ enum machine_mode address_mode;
rtx offset_rtx;
if (!MEM_P (to_rtx))
@@ -4220,13 +4248,10 @@ expand_assignment (tree to, tree from, bool nontemporal)
}
offset_rtx = expand_expr (offset, NULL_RTX, VOIDmode, EXPAND_SUM);
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (offset_rtx) != Pmode)
- offset_rtx = convert_to_mode (Pmode, offset_rtx, 0);
-#else
- if (GET_MODE (offset_rtx) != ptr_mode)
- offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 0);
-#endif
+ address_mode
+ = targetm.addr_space.address_mode (MEM_ADDR_SPACE (to_rtx));
+ if (GET_MODE (offset_rtx) != address_mode)
+ offset_rtx = convert_to_mode (address_mode, offset_rtx, 0);
/* A constant address in TO_RTX can have VOIDmode, we must not try
to call force_reg for that case. Avoid that case. */
@@ -4298,20 +4323,25 @@ expand_assignment (tree to, tree from, bool nontemporal)
else if (TREE_CODE (to) == MISALIGNED_INDIRECT_REF)
{
+ addr_space_t as = ADDR_SPACE_GENERIC;
enum machine_mode mode, op_mode1;
enum insn_code icode;
rtx reg, addr, mem, insn;
+ if (POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (to, 0))))
+ as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (TREE_OPERAND (to, 0))));
+
reg = expand_expr (from, NULL_RTX, VOIDmode, EXPAND_NORMAL);
reg = force_not_mem (reg);
mode = TYPE_MODE (TREE_TYPE (to));
addr = expand_expr (TREE_OPERAND (to, 0), NULL_RTX, VOIDmode,
EXPAND_SUM);
- addr = memory_address (mode, addr);
+ addr = memory_address_addr_space (mode, addr, as);
mem = gen_rtx_MEM (mode, addr);
set_mem_attributes (mem, to, 0);
+ set_mem_addr_space (mem, as);
icode = movmisalign_optab->handlers[mode].insn_code;
gcc_assert (icode != CODE_FOR_nothing);
@@ -4360,7 +4390,10 @@ expand_assignment (tree to, tree from, bool nontemporal)
else
{
if (POINTER_TYPE_P (TREE_TYPE (to)))
- value = convert_memory_address (GET_MODE (to_rtx), value);
+ value = convert_memory_address_addr_space
+ (GET_MODE (to_rtx), value,
+ TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (to))));
+
emit_move_insn (to_rtx, value);
}
preserve_temp_slots (to_rtx);
@@ -4400,6 +4433,8 @@ expand_assignment (tree to, tree from, bool nontemporal)
the place the value is being stored, use a safe function when copying
a value through a pointer into a structure value return block. */
if (TREE_CODE (to) == RESULT_DECL && TREE_CODE (from) == INDIRECT_REF
+ && ADDR_SPACE_GENERIC_P
+ (TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (TREE_OPERAND (from, 0)))))
&& cfun->returns_struct
&& !cfun->returns_pcc_struct)
{
@@ -4718,6 +4753,11 @@ store_expr (tree exp, rtx target, int call_param_p, bool nontemporal)
? BLOCK_OP_CALL_PARM : BLOCK_OP_NORMAL));
else
{
+ enum machine_mode pointer_mode
+ = targetm.addr_space.pointer_mode (MEM_ADDR_SPACE (target));
+ enum machine_mode address_mode
+ = targetm.addr_space.address_mode (MEM_ADDR_SPACE (target));
+
/* Compute the size of the data to copy from the string. */
tree copy_size
= size_binop_loc (loc, MIN_EXPR,
@@ -4730,14 +4770,14 @@ store_expr (tree exp, rtx target, int call_param_p, bool nontemporal)
rtx label = 0;
/* Copy that much. */
- copy_size_rtx = convert_to_mode (ptr_mode, copy_size_rtx,
+ copy_size_rtx = convert_to_mode (pointer_mode, copy_size_rtx,
TYPE_UNSIGNED (sizetype));
emit_block_move (target, temp, copy_size_rtx,
(call_param_p
? BLOCK_OP_CALL_PARM : BLOCK_OP_NORMAL));
/* Figure out how much is left in TARGET that we have to clear.
- Do all calculations in ptr_mode. */
+ Do all calculations in pointer_mode. */
if (CONST_INT_P (copy_size_rtx))
{
size = plus_constant (size, -INTVAL (copy_size_rtx));
@@ -4750,11 +4790,10 @@ store_expr (tree exp, rtx target, int call_param_p, bool nontemporal)
copy_size_rtx, NULL_RTX, 0,
OPTAB_LIB_WIDEN);
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (copy_size_rtx) != Pmode)
- copy_size_rtx = convert_to_mode (Pmode, copy_size_rtx,
+ if (GET_MODE (copy_size_rtx) != address_mode)
+ copy_size_rtx = convert_to_mode (address_mode,
+ copy_size_rtx,
TYPE_UNSIGNED (sizetype));
-#endif
target = offset_address (target, copy_size_rtx,
highest_pow2_factor (copy_size));
@@ -5244,6 +5283,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
if (offset)
{
+ enum machine_mode address_mode;
rtx offset_rtx;
offset
@@ -5254,13 +5294,10 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
offset_rtx = expand_normal (offset);
gcc_assert (MEM_P (to_rtx));
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (offset_rtx) != Pmode)
- offset_rtx = convert_to_mode (Pmode, offset_rtx, 0);
-#else
- if (GET_MODE (offset_rtx) != ptr_mode)
- offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 0);
-#endif
+ address_mode
+ = targetm.addr_space.address_mode (MEM_ADDR_SPACE (to_rtx));
+ if (GET_MODE (offset_rtx) != address_mode)
+ offset_rtx = convert_to_mode (address_mode, offset_rtx, 0);
to_rtx = offset_address (to_rtx, offset_rtx,
highest_pow2_factor (offset));
@@ -6783,7 +6820,7 @@ expand_expr_constant (tree exp, int defer, enum expand_modifier modifier)
static rtx
expand_expr_addr_expr_1 (tree exp, rtx target, enum machine_mode tmode,
- enum expand_modifier modifier)
+ enum expand_modifier modifier, addr_space_t as)
{
rtx result, subtarget;
tree inner, offset;
@@ -6810,7 +6847,7 @@ expand_expr_addr_expr_1 (tree exp, rtx target, enum machine_mode tmode,
case CONST_DECL:
/* Recurse and make the output_constant_def clause above handle this. */
return expand_expr_addr_expr_1 (DECL_INITIAL (exp), target,
- tmode, modifier);
+ tmode, modifier, as);
case REALPART_EXPR:
/* The real part of the complex number is always first, therefore
@@ -6900,7 +6937,7 @@ expand_expr_addr_expr_1 (tree exp, rtx target, enum machine_mode tmode,
TYPE_ALIGN (TREE_TYPE (inner)) = TYPE_ALIGN (TREE_TYPE (exp));
TYPE_USER_ALIGN (TREE_TYPE (inner)) = 1;
}
- result = expand_expr_addr_expr_1 (inner, subtarget, tmode, modifier);
+ result = expand_expr_addr_expr_1 (inner, subtarget, tmode, modifier, as);
if (offset)
{
@@ -6912,8 +6949,8 @@ expand_expr_addr_expr_1 (tree exp, rtx target, enum machine_mode tmode,
modifier == EXPAND_INITIALIZER
? EXPAND_INITIALIZER : EXPAND_NORMAL);
- result = convert_memory_address (tmode, result);
- tmp = convert_memory_address (tmode, tmp);
+ result = convert_memory_address_addr_space (tmode, result, as);
+ tmp = convert_memory_address_addr_space (tmode, tmp, as);
if (modifier == EXPAND_SUM || modifier == EXPAND_INITIALIZER)
result = gen_rtx_PLUS (tmode, result, tmp);
@@ -6946,6 +6983,9 @@ static rtx
expand_expr_addr_expr (tree exp, rtx target, enum machine_mode tmode,
enum expand_modifier modifier)
{
+ addr_space_t as = ADDR_SPACE_GENERIC;
+ enum machine_mode address_mode = Pmode;
+ enum machine_mode pointer_mode = ptr_mode;
enum machine_mode rmode;
rtx result;
@@ -6953,14 +6993,21 @@ expand_expr_addr_expr (tree exp, rtx target, enum machine_mode tmode,
if (tmode == VOIDmode)
tmode = TYPE_MODE (TREE_TYPE (exp));
+ if (POINTER_TYPE_P (TREE_TYPE (exp)))
+ {
+ as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp)));
+ address_mode = targetm.addr_space.address_mode (as);
+ pointer_mode = targetm.addr_space.pointer_mode (as);
+ }
+
/* We can get called with some Weird Things if the user does silliness
like "(short) &a". In that case, convert_memory_address won't do
the right thing, so ignore the given target mode. */
- if (tmode != Pmode && tmode != ptr_mode)
- tmode = Pmode;
+ if (tmode != address_mode && tmode != pointer_mode)
+ tmode = address_mode;
result = expand_expr_addr_expr_1 (TREE_OPERAND (exp, 0), target,
- tmode, modifier);
+ tmode, modifier, as);
/* Despite expand_expr claims concerning ignoring TMODE when not
strictly convenient, stuff breaks if we don't honor it. Note
@@ -6969,7 +7016,7 @@ expand_expr_addr_expr (tree exp, rtx target, enum machine_mode tmode,
if (rmode == VOIDmode)
rmode = tmode;
if (rmode != tmode)
- result = convert_memory_address (tmode, result);
+ result = convert_memory_address_addr_space (tmode, result, as);
return result;
}
@@ -7343,6 +7390,39 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode,
return REDUCE_BIT_FIELD (op0);
+ case ADDR_SPACE_CONVERT_EXPR:
+ {
+ tree treeop0_type = TREE_TYPE (treeop0);
+ addr_space_t as_to;
+ addr_space_t as_from;
+
+ gcc_assert (POINTER_TYPE_P (type));
+ gcc_assert (POINTER_TYPE_P (treeop0_type));
+
+ as_to = TYPE_ADDR_SPACE (TREE_TYPE (type));
+ as_from = TYPE_ADDR_SPACE (TREE_TYPE (treeop0_type));
+
+ /* Conversions between pointers to the same address space should
+ have been implemented via CONVERT_EXPR / NOP_EXPR. */
+ gcc_assert (as_to != as_from);
+
+ /* Ask target code to handle conversion between pointers
+ to overlapping address spaces. */
+ if (targetm.addr_space.subset_p (as_to, as_from)
+ || targetm.addr_space.subset_p (as_from, as_to))
+ {
+ op0 = expand_expr (treeop0, NULL_RTX, VOIDmode, modifier);
+ op0 = targetm.addr_space.convert (op0, treeop0_type, type);
+ gcc_assert (op0);
+ return op0;
+ }
+
+ /* For disjoint address spaces, converting anything but
+ a null pointer invokes undefined behaviour. We simply
+ always return a null pointer here. */
+ return CONST0_RTX (mode);
+ }
+
case POINTER_PLUS_EXPR:
/* Even though the sizetype mode and the pointer's mode can be different
expand is able to handle this correctly and get the correct result out
@@ -8431,7 +8511,9 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
decl_rtl = use_anchored_address (decl_rtl);
if (modifier != EXPAND_CONST_ADDRESS
&& modifier != EXPAND_SUM
- && !memory_address_p (DECL_MODE (exp), XEXP (decl_rtl, 0)))
+ && !memory_address_addr_space_p (DECL_MODE (exp),
+ XEXP (decl_rtl, 0),
+ MEM_ADDR_SPACE (decl_rtl)))
temp = replace_equiv_address (decl_rtl,
copy_rtx (XEXP (decl_rtl, 0)));
}
@@ -8551,7 +8633,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
if (modifier != EXPAND_CONST_ADDRESS
&& modifier != EXPAND_INITIALIZER
&& modifier != EXPAND_SUM
- && ! memory_address_p (mode, XEXP (temp, 0)))
+ && ! memory_address_addr_space_p (mode, XEXP (temp, 0),
+ MEM_ADDR_SPACE (temp)))
return replace_equiv_address (temp,
copy_rtx (XEXP (temp, 0)));
return temp;
@@ -8607,6 +8690,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case INDIRECT_REF:
{
tree exp1 = treeop0;
+ addr_space_t as = ADDR_SPACE_GENERIC;
+ enum machine_mode address_mode = Pmode;
if (modifier != EXPAND_WRITE)
{
@@ -8617,19 +8702,26 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
return expand_expr (t, target, tmode, modifier);
}
+ if (POINTER_TYPE_P (TREE_TYPE (exp1)))
+ {
+ as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp1)));
+ address_mode = targetm.addr_space.address_mode (as);
+ }
+
op0 = expand_expr (exp1, NULL_RTX, VOIDmode, EXPAND_SUM);
- op0 = memory_address (mode, op0);
+ op0 = memory_address_addr_space (mode, op0, as);
if (code == ALIGN_INDIRECT_REF)
{
int align = TYPE_ALIGN_UNIT (type);
- op0 = gen_rtx_AND (Pmode, op0, GEN_INT (-align));
- op0 = memory_address (mode, op0);
+ op0 = gen_rtx_AND (address_mode, op0, GEN_INT (-align));
+ op0 = memory_address_addr_space (mode, op0, as);
}
temp = gen_rtx_MEM (mode, op0);
set_mem_attributes (temp, exp, 0);
+ set_mem_addr_space (temp, as);
/* Resolve the misalignment now, so that we don't have to remember
to resolve it later. Of course, this only works for reads. */
@@ -8661,13 +8753,15 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case TARGET_MEM_REF:
{
+ addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (exp));
struct mem_address addr;
get_address_description (exp, &addr);
- op0 = addr_for_mem_ref (&addr, true);
- op0 = memory_address (mode, op0);
+ op0 = addr_for_mem_ref (&addr, as, true);
+ op0 = memory_address_addr_space (mode, op0, as);
temp = gen_rtx_MEM (mode, op0);
set_mem_attributes (temp, TMR_ORIGINAL (exp), 0);
+ set_mem_addr_space (temp, as);
}
return temp;
@@ -8955,18 +9049,16 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
if (offset)
{
+ enum machine_mode address_mode;
rtx offset_rtx = expand_expr (offset, NULL_RTX, VOIDmode,
EXPAND_SUM);
gcc_assert (MEM_P (op0));
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (offset_rtx) != Pmode)
- offset_rtx = convert_to_mode (Pmode, offset_rtx, 0);
-#else
- if (GET_MODE (offset_rtx) != ptr_mode)
- offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 0);
-#endif
+ address_mode
+ = targetm.addr_space.address_mode (MEM_ADDR_SPACE (op0));
+ if (GET_MODE (offset_rtx) != address_mode)
+ offset_rtx = convert_to_mode (address_mode, offset_rtx, 0);
if (GET_MODE (op0) == BLKmode
/* A constant address in OP0 can have VOIDmode, we must
diff --git a/gcc/expr.h b/gcc/expr.h
index 4e02c24b75f..e84779639b5 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -218,9 +218,9 @@ do { \
#define STACK_CHECK_STATIC_BUILTIN 0
#endif
-/* The default interval is one page. */
-#ifndef STACK_CHECK_PROBE_INTERVAL
-#define STACK_CHECK_PROBE_INTERVAL 4096
+/* The default interval is one page (4096 bytes). */
+#ifndef STACK_CHECK_PROBE_INTERVAL_EXP
+#define STACK_CHECK_PROBE_INTERVAL_EXP 12
#endif
/* The default is to do a store into the stack. */
@@ -228,6 +228,11 @@ do { \
#define STACK_CHECK_PROBE_LOAD 0
#endif
+/* The default is not to move the stack pointer. */
+#ifndef STACK_CHECK_MOVING_SP
+#define STACK_CHECK_MOVING_SP 0
+#endif
+
/* This is a kludge to try to capture the discrepancy between the old
mechanism (generic stack checking) and the new mechanism (static
builtin stack checking). STACK_CHECK_PROTECT needs to be bumped
@@ -252,7 +257,7 @@ do { \
one probe per function. */
#ifndef STACK_CHECK_MAX_FRAME_SIZE
#define STACK_CHECK_MAX_FRAME_SIZE \
- (STACK_CHECK_PROBE_INTERVAL - UNITS_PER_WORD)
+ ((1 << STACK_CHECK_PROBE_INTERVAL_EXP) - UNITS_PER_WORD)
#endif
/* This is arbitrary, but should be large enough everywhere. */
@@ -650,9 +655,15 @@ extern rtx force_label_rtx (tree);
The constant terms are added and stored via a second arg. */
extern rtx eliminate_constant_term (rtx, rtx *);
-/* Convert arg to a valid memory address for specified machine mode,
- by emitting insns to perform arithmetic if nec. */
-extern rtx memory_address (enum machine_mode, rtx);
+/* Convert arg to a valid memory address for specified machine mode that points
+ to a specific named address space, by emitting insns to perform arithmetic
+ if necessary. */
+extern rtx memory_address_addr_space (enum machine_mode, rtx, addr_space_t);
+
+/* Like memory_address_addr_space, except assume the memory address points to
+ the generic named address space. */
+#define memory_address(MODE,RTX) \
+ memory_address_addr_space ((MODE), (RTX), ADDR_SPACE_GENERIC)
/* Return a memory reference like MEMREF, but with its mode changed
to MODE and its address changed to ADDR.
@@ -773,10 +784,9 @@ extern void update_nonlocal_goto_save_area (void);
extern rtx allocate_dynamic_stack_space (rtx, rtx, int);
/* Probe a range of stack addresses from FIRST to FIRST+SIZE, inclusive.
- FIRST is a constant and size is a Pmode RTX. These are offsets from the
- current stack pointer. STACK_GROWS_DOWNWARD says whether to add or
- subtract from the stack. If SIZE is constant, this is done
- with a fixed number of probes. Otherwise, we must make a loop. */
+ FIRST is a constant and size is a Pmode RTX. These are offsets from
+ the current stack pointer. STACK_GROWS_DOWNWARD says whether to add
+ or subtract them from the stack pointer. */
extern void probe_stack_range (HOST_WIDE_INT, rtx);
/* Return an rtx that refers to the value returned by a library call
diff --git a/gcc/final.c b/gcc/final.c
index 78a698b4484..ef450d2fe3e 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -204,10 +204,8 @@ rtx final_sequence;
static int dialect_number;
#endif
-#ifdef HAVE_conditional_execution
/* Nonnull if the insn currently being emitted was a COND_EXEC pattern. */
rtx current_insn_predicate;
-#endif
#ifdef HAVE_ATTR_length
static int asm_insn_count (rtx);
@@ -1399,13 +1397,23 @@ static int
asm_insn_count (rtx body)
{
const char *templ;
- int count = 1;
if (GET_CODE (body) == ASM_INPUT)
templ = XSTR (body, 0);
else
templ = decode_asm_operands (body, NULL, NULL, NULL, NULL, NULL);
+ return asm_str_count (templ);
+}
+#endif
+
+/* Return the number of machine instructions likely to be generated for the
+ inline-asm template. */
+int
+asm_str_count (const char *templ)
+{
+ int count = 1;
+
if (!*templ)
return 0;
@@ -1416,7 +1424,6 @@ asm_insn_count (rtx body)
return count;
}
-#endif
/* ??? This is probably the wrong place for these. */
/* Structure recording the mapping from source file and directory
@@ -2093,10 +2100,9 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
const char *templ;
bool is_stmt;
-#ifdef HAVE_conditional_execution
/* Reset this early so it is correct for ASM statements. */
current_insn_predicate = NULL_RTX;
-#endif
+
/* An INSN, JUMP_INSN or CALL_INSN.
First check for special kinds that recog doesn't recognize. */
@@ -2581,10 +2587,9 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
FINAL_PRESCAN_INSN (insn, recog_data.operand, recog_data.n_operands);
#endif
-#ifdef HAVE_conditional_execution
- if (GET_CODE (PATTERN (insn)) == COND_EXEC)
+ if (targetm.have_conditional_execution ()
+ && GET_CODE (PATTERN (insn)) == COND_EXEC)
current_insn_predicate = COND_EXEC_TEST (PATTERN (insn));
-#endif
#ifdef HAVE_cc0
cc_prev_status = cc_status;
@@ -2675,6 +2680,26 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
/* Output assembler code from the template. */
output_asm_insn (templ, recog_data.operand);
+ /* Record point-of-call information for ICF debugging. */
+ if (flag_enable_icf_debug && CALL_P (insn))
+ {
+ rtx x = call_from_call_insn (insn);
+ x = XEXP (x, 0);
+ if (x && MEM_P (x))
+ {
+ if (GET_CODE (XEXP (x, 0)) == SYMBOL_REF)
+ {
+ tree t;
+ x = XEXP (x, 0);
+ t = SYMBOL_REF_DECL (x);
+ if (t)
+ (*debug_hooks->direct_call) (t);
+ }
+ else
+ (*debug_hooks->virtual_call) (INSN_UID (insn));
+ }
+ }
+
/* Some target machines need to postscan each insn after
it is output. */
if (targetm.asm_out.final_postscan_insn)
diff --git a/gcc/flags.h b/gcc/flags.h
index 8b71302f3e4..bd8b82d4372 100644
--- a/gcc/flags.h
+++ b/gcc/flags.h
@@ -111,6 +111,17 @@ extern int optimize;
extern int optimize_size;
+/* True if this is the LTO front end (lto1). This is used to disable
+ gimple generation and lowering passes that are normally run on the
+ output of a front end. These passes must be bypassed for lto since
+ they have already been done before the gimple was written. */
+
+extern bool in_lto_p;
+
+/* Nonzero if we should write GIMPLE bytecode for link-time optimization. */
+
+extern int flag_generate_lto;
+
/* Used to set the level of -Wstrict-aliasing, when no level is specified.
The external way to set the default level is to use
-Wstrict-aliasing=level.
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 1539ad21387..3403938edc3 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -206,15 +206,9 @@ fit_double_type (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
{
unsigned HOST_WIDE_INT low0 = l1;
HOST_WIDE_INT high0 = h1;
- unsigned int prec;
+ unsigned int prec = int_or_pointer_precision (type);
int sign_extended_type;
- if (POINTER_TYPE_P (type)
- || TREE_CODE (type) == OFFSET_TYPE)
- prec = POINTER_SIZE;
- else
- prec = TYPE_PRECISION (type);
-
/* Size types *are* sign extended. */
sign_extended_type = (!TYPE_UNSIGNED (type)
|| (TREE_CODE (type) == INTEGER_TYPE
@@ -2647,8 +2641,16 @@ fold_convert_loc (location_t loc, tree type, tree arg)
switch (TREE_CODE (type))
{
+ case POINTER_TYPE:
+ case REFERENCE_TYPE:
+ /* Handle conversions between pointers to different address spaces. */
+ if (POINTER_TYPE_P (orig)
+ && (TYPE_ADDR_SPACE (TREE_TYPE (type))
+ != TYPE_ADDR_SPACE (TREE_TYPE (orig))))
+ return fold_build1_loc (loc, ADDR_SPACE_CONVERT_EXPR, type, arg);
+ /* fall through */
+
case INTEGER_TYPE: case ENUMERAL_TYPE: case BOOLEAN_TYPE:
- case POINTER_TYPE: case REFERENCE_TYPE:
case OFFSET_TYPE:
if (TREE_CODE (arg) == INTEGER_CST)
{
@@ -3179,6 +3181,12 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
|| POINTER_TYPE_P (TREE_TYPE (arg0)) != POINTER_TYPE_P (TREE_TYPE (arg1)))
return 0;
+ /* We cannot consider pointers to different address space equal. */
+ if (POINTER_TYPE_P (TREE_TYPE (arg0)) && POINTER_TYPE_P (TREE_TYPE (arg1))
+ && (TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (arg0)))
+ != TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (arg1)))))
+ return 0;
+
/* If both types don't have the same precision, then it is not safe
to strip NOPs. */
if (TYPE_PRECISION (TREE_TYPE (arg0)) != TYPE_PRECISION (TREE_TYPE (arg1)))
@@ -8682,6 +8690,11 @@ fold_unary_loc (location_t loc, enum tree_code code, tree type, tree op0)
tem = fold_convert_const (code, type, op0);
return tem ? tem : NULL_TREE;
+ case ADDR_SPACE_CONVERT_EXPR:
+ if (integer_zerop (arg0))
+ return fold_convert_const (code, type, arg0);
+ return NULL_TREE;
+
case FIXED_CONVERT_EXPR:
tem = fold_convert_const (code, type, arg0);
return tem ? tem : NULL_TREE;
@@ -10134,7 +10147,6 @@ fold_binary_loc (location_t loc,
tem = fold_build2_loc (loc, code, type,
fold_convert_loc (loc, TREE_TYPE (op0),
TREE_OPERAND (arg0, 1)), op1);
- protected_set_expr_location (tem, loc);
tem = build2 (COMPOUND_EXPR, type, TREE_OPERAND (arg0, 0), tem);
goto fold_binary_exit;
}
@@ -10144,7 +10156,6 @@ fold_binary_loc (location_t loc,
tem = fold_build2_loc (loc, code, type, op0,
fold_convert_loc (loc, TREE_TYPE (op1),
TREE_OPERAND (arg1, 1)));
- protected_set_expr_location (tem, loc);
tem = build2 (COMPOUND_EXPR, type, TREE_OPERAND (arg1, 0), tem);
goto fold_binary_exit;
}
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index c325d258ae8..eef8cf8d5a0 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,349 @@
+2009-11-05 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/41918
+ * fortran/trans-decl.c: Silence intent(out) warning for derived type
+ dummy arguments with default initialization.
+
+2009-11-05 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41556
+ * interface.c (matching_typebound_op,gfc_extend_assign): Handle CLASS
+ variables.
+
+2009-11-05 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41556
+ PR fortran/41873
+ * resolve.c (resolve_function,resolve_call): Prevent abstract interfaces
+ from being called, but allow deferred type-bound procedures with
+ abstract interface.
+
+2009-11-04 Tobias Burnus <burnus@gcc.gnu.org>
+ Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41556
+ PR fortran/41937
+ * interface.c (gfc_check_operator_interface): Handle CLASS arguments.
+ * resolve.c (resolve_allocate_expr): Handle allocatable components of
+ CLASS variables.
+
+2009-11-04 Richard Guenther <rguenther@suse.de>
+
+ * options.c (gfc_post_options): Rely on common code processing
+ LTO options. Only enable -fwhole-file here.
+
+2009-11-03 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/41907
+ * trans-expr.c (gfc_conv_procedure_call): Fix presence check
+ for optional arguments.
+
+2009-11-01 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/41872
+ * trans-decl.c (gfc_trans_deferred_vars): Do not nullify
+ autodeallocated allocatable scalars at the end of scope.
+ (gfc_generate_function_code): Fix indention.
+ * trans-expr.c (gfc_conv_procedure_call): For allocatable
+ scalars, fix calling by reference and autodeallocating
+ of intent out variables.
+
+2009-11-01 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/41850
+ * trans-expr.c (gfc_conv_procedure_call): Deallocate intent-out
+ variables only when present. Remove unneccessary present check.
+
+2009-10-29 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/41777
+ * trans-expr.c (gfc_conv_procedure_call,gfc_conv_expr_reference):
+ Use for generic EXPR_FUNCTION the attributes of the specific
+ function.
+
+2009-10-29 Janne Blomqvist <jb@gcc.gnu.org>
+
+ PR fortran/41860
+ * resolve.c (apply_default_init_local): Treat -fno-automatic as if
+ var was saved.
+
+2009-10-28 Rafael Avila de Espindola <espindola@google.com>
+
+ * trans-common.c (create_common): Set TREE_PUBLIC to false on
+ fake variables.
+
+2009-10-26 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41714
+ * trans.c (gfc_trans_code): Remove call to
+ 'tree_annotate_all_with_location'. Location should already be set.
+ * trans-openmp.c (gfc_trans_omp_workshare): Ditto.
+ * trans-stmt.c (gfc_trans_allocate): Do correct data initialization for
+ CLASS variables with SOURCE tag, plus some cleanup.
+
+2009-10-24 Janus Weil <janus@gcc.gnu.org>
+ Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/41784
+ * module.c (load_derived_extensions): Skip symbols which are not being
+ loaded.
+
+2009-10-24 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/41772
+ * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Stop'extent'
+ from going negative.
+
+2009-10-23 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41800
+ * trans-expr.c (gfc_trans_scalar_assign): Handle CLASS variables.
+
+2009-10-23 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41758
+ * match.c (conformable_arrays): Move to resolve.c.
+ (gfc_match_allocate): Don't resolve SOURCE expr yet, and move some
+ checks to resolve_allocate_expr.
+ * resolve.c (conformable_arrays): Moved here from match.c.
+ (resolve_allocate_expr): Moved some checks here from gfc_match_allocate.
+ (resolve_code): Resolve SOURCE tag for ALLOCATE expressions.
+
+2009-10-22 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41781
+ * resolve.c (resolve_codes): Don't clear 'cs_base' for BLOCK constructs,
+ to make sure labels are treated correctly.
+ * symbol.c (gfc_get_st_label): Create labels in the right namespace.
+ For BLOCK constructs go into the parent namespace.
+
+2009-10-21 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41706
+ PR fortran/41766
+ * match.c (select_type_set_tmp): Set flavor for temporary.
+ * resolve.c (resolve_class_typebound_call): Correctly resolve actual
+ arguments.
+
+2009-10-20 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/41706
+ * resolve.c (resolve_arg_exprs): New function.
+ (resolve_class_compcall): Call the above.
+ (resolve_class_typebound_call): The same.
+
+2009-10-19 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41586
+ * parse.c (parse_derived): Correctly set 'alloc_comp' and 'pointer_comp'
+ for CLASS variables.
+ * trans-array.c (structure_alloc_comps): Handle deallocation and
+ nullification of allocatable scalar components.
+ * trans-decl.c (gfc_get_symbol_decl): Remember allocatable scalars for
+ automatic deallocation.
+ (gfc_trans_deferred_vars): Automatically deallocate allocatable scalars.
+
+2009-10-19 Tobias Burnus <burnus@net-b.de>
+ Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/41755
+ * symbol.c (gfc_undo_symbols): Add NULL check.
+ * match.c (gfc_match_equivalence): Add check for
+ missing comma.
+
+2009-10-19 Richard Guenther <rguenther@suse.de>
+
+ PR fortran/41494
+ * trans-expr.c (gfc_trans_scalar_assign): Do not call
+ gfc_evaluate_now.
+
+2009-10-17 Janus Weil <janus@gcc.gnu.org>
+ Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/41608
+ * decl.c (gfc_match_data_decl): Add BT_CLASS for undefined type
+ and empty type errors.
+ * parse.c (gfc_build_block_ns): Only set recursive if parent ns
+ has a proc_name.
+
+ PR fortran/41629
+ PR fortran/41618
+ PR fortran/41587
+ * gfortran.h : Add class_ok bitfield to symbol_attr.
+ * decl.c (build_sym): Set attr.class_ok if dummy, pointer or
+ allocatable.
+ (build_struct): Use gfc_try 't' to carry errors past the call
+ to encapsulate_class_symbol.
+ (attr_decl1): For a CLASS object, apply the new attribute to
+ the data component.
+ * match.c (gfc_match_select_type): Set attr.class_ok for an
+ assigned selector.
+ * resolve.c (resolve_fl_variable_derived): Check a CLASS object
+ is dummy, pointer or allocatable by testing the class_ok and
+ the use_assoc attribute.
+
+2009-10-16 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41719
+ * resolve.c (resolve_ordinary_assign): Reject intrinsic assignments
+ to polymorphic variables.
+
+2009-10-16 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/41648
+ PR fortran/41656
+ * trans-expr.c (select_class_proc): Convert the expression for the
+ vindex, carried on the first member of the esym list.
+ * gfortran.h : Add the vindex field to the esym_list structure.
+ and eliminate the class_object field.
+ * resolve.c (check_class_members): Remove the setting of the
+ class_object field.
+ (vindex_expr): New function.
+ (get_class_from_expr): New function.
+ (resolve_class_compcall): Call the above to find the ultimate
+ class or derived component. If derived, do not generate the
+ esym list. Add and expression for the vindex to the esym list
+ by calling the above.
+ (resolve_class_typebound_call): The same.
+
+2009-10-15 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/41712
+ * intrinsic.texi: Explicitly state that ETIME and DTIME take
+ REAL(4) arguments. Fix nearby typographically errors where
+ /leq was used instead of \leq.
+
+2009-10-13 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41581
+ * decl.c (encapsulate_class_symbol): Add new component '$size'.
+ * resolve.c (resolve_allocate_expr): Move CLASS handling to
+ gfc_trans_allocate.
+ (resolve_class_assign): Replaced by gfc_trans_class_assign.
+ (resolve_code): Remove calls to resolve_class_assign.
+ * trans.c (gfc_trans_code): Use new function gfc_trans_class_assign.
+ * trans-expr.c (get_proc_ptr_comp): Fix a memory leak.
+ (gfc_conv_procedure_call): For CLASS dummies, set the
+ $size component.
+ (gfc_trans_class_assign): New function, replacing resolve_class_assign.
+ * trans-stmt.h (gfc_trans_class_assign): New prototype.
+ * trans-stmt.c (gfc_trans_allocate): Use correct size when allocating
+ CLASS variables. Do proper initialization. Move some code here from
+ resolve_allocate_expr.
+
+2009-10-11 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/38439
+ * io.c (check_format): Fix locus for error messages and fix a comment.
+
+2009-10-11 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/41583
+ * decl.c (hash_value): New function.
+ (gfc_match_derived_decl): Call it.
+
+2009-10-09 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41585
+ * decl.c (build_struct): Bugfix for CLASS components.
+
+2009-10-09 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/41582
+ * decl.c (encapsulate_class_symbol): Save attr.abstract.
+ * resolve.c (resolve_allocate_expr): Reject class allocate
+ without typespec or source=.
+ * trans-stmt.c (gfc_trans_allocate): Change gfc_warning
+ into gfc_error for "not yet implemented".
+
+2009-10-09 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41579
+ * gfortran.h (gfc_select_type_stack): New struct, to be used as a stack
+ for SELECT TYPE statements.
+ (select_type_stack): New global variable.
+ (type_selector,select_type_tmp): Removed.
+ * match.c (type_selector,type_selector): Removed.
+ (select_type_stack): New variable, serving as a stack for
+ SELECT TYPE statements.
+ (select_type_push,select_type_set_tmp): New functions.
+ (gfc_match_select_type): Call select_type_push.
+ (gfc_match_type_is): Call select_type_set_tmp.
+ * parse.c (select_type_pop): New function.
+ (parse_select_type_block): Call select_type_pop.
+ * symbol.c (select_type_insert_tmp): New function.
+ (gfc_find_sym_tree): Call select_type_insert_tmp.
+
+2009-10-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * arith.c (arith_power): Use mpc_pow_z.
+ * gfortran.h (HAVE_mpc_pow_z): Define.
+
+2009-10-07 Daniel Kraft <d@domob.eu>
+
+ PR fortran/41615
+ * resolve.c (resolve_contained_fntype): Clarify error message for
+ invalid assumed-length character result on module procedures.
+
+2009-10-07 Janus Weil <janus@gcc.gnu.org>
+
+ * expr.c (gfc_check_pointer_assign): Do the correct type checking when
+ CLASS variables are involved.
+ * match.c (gfc_match_select_type): Parse associate-name in SELECT TYPE
+ statements, and set up a local namespace for the SELECT TYPE block.
+ * parse.h (gfc_build_block_ns): New prototype.
+ * parse.c (parse_select_type_block): Return from local namespace to its
+ parent after SELECT TYPE block.
+ (gfc_build_block_ns): New function for setting up the local namespace
+ for a BLOCK construct.
+ (parse_block_construct): Use gfc_build_block_ns.
+ * resolve.c (resolve_select_type): Insert assignment for the selector
+ variable, in case an associate-name is given, and put the SELECT TYPE
+ statement inside a BLOCK.
+ (resolve_code): Call resolve_class_assign after checking the assignment.
+ * symbol.c (gfc_find_sym_tree): Moved some code here from
+ gfc_get_ha_sym_tree.
+ (gfc_get_ha_sym_tree): Moved some code to gfc_find_sym_tree.
+
+2009-10-07 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/41613
+ * resolve.c (check_class_members): Reset compcall.assign.
+
+2009-10-05 Paul Thomas <pault@gcc.gnu.org>
+
+ * trans-expr.c (select_class_proc): New function.
+ (conv_function_val): Deal with class methods and call above.
+ * symbol.c (gfc_type_compatible): Treat case where both ts1 and
+ ts2 are BT_CLASS.
+ gfortran.h : Add structure gfc_class_esym_list and include in
+ the structure gfc_expr.
+ * module.c (load_derived_extensions): New function.
+ (read_module): Call above.
+ (write_dt_extensions): New function.
+ (write_derived_extensions): New function.
+ (write_module): Use the above.
+ * resolve.c (resolve_typebound_call): Add a function expression
+ for class methods. This carries the chain of symbols for the
+ dynamic dispatch in select_class_proc.
+ (resolve_compcall): Add second, boolean argument to indicate if
+ a function is being handled.
+ (check_members): New function.
+ (check_class_members): New function.
+ (resolve_class_compcall): New function.
+ (resolve_class_typebound_call): New function.
+ (gfc_resolve_expr): Call above for component calls..
+
+2009-10-05 Daniel Kraft <d@domob.eu>
+
+ PR fortran/41403
+ * trans-stmt.c (gfc_trans_goto): Ignore statement list on assigned goto
+ if it is present.
+
+2009-10-03 Richard Guenther <rguenther@suse.de>
+
+ * options.c (gfc_post_options): Handle -flto and -fwhopr.
+
2009-10-02 Tobias Burnus <burnus@net-b.de>
PR fortran/41479
@@ -285,7 +631,6 @@
* parse.c (next_free): Improve error locus printing.
(next_fixed): Change gfc_warn to gfc_warning_now, and improve
locus reporting.
-
2009-09-16 Michael Matz <matz@suse.de>
diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c
index dddf7e003ce..82a43ad7178 100644
--- a/gcc/fortran/arith.c
+++ b/gcc/fortran/arith.c
@@ -1111,7 +1111,10 @@ arith_power (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
case BT_COMPLEX:
{
-#ifdef HAVE_mpc_pow
+#ifdef HAVE_mpc_pow_z
+ mpc_pow_z (result->value.complex, op1->value.complex,
+ op2->value.integer, GFC_MPC_RND_MODE);
+#elif defined(HAVE_mpc_pow)
mpc_t apower;
gfc_set_model (mpc_realref (op1->value.complex));
mpc_init2 (apower, mpfr_get_default_prec());
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 171eeaa97bf..9b6f8ea0a4f 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -599,10 +599,8 @@ gfc_check_associated (gfc_expr *pointer, gfc_expr *target)
where = &pointer->where;
- if (pointer->expr_type == EXPR_VARIABLE)
- attr1 = gfc_variable_attr (pointer, NULL);
- else if (pointer->expr_type == EXPR_FUNCTION)
- attr1 = pointer->symtree->n.sym->attr;
+ if (pointer->expr_type == EXPR_VARIABLE || pointer->expr_type == EXPR_FUNCTION)
+ attr1 = gfc_expr_attr (pointer);
else if (pointer->expr_type == EXPR_NULL)
goto null_arg;
else
@@ -624,10 +622,8 @@ gfc_check_associated (gfc_expr *pointer, gfc_expr *target)
if (target->expr_type == EXPR_NULL)
goto null_arg;
- if (target->expr_type == EXPR_VARIABLE)
- attr2 = gfc_variable_attr (target, NULL);
- else if (target->expr_type == EXPR_FUNCTION)
- attr2 = target->symtree->n.sym->attr;
+ if (target->expr_type == EXPR_VARIABLE || target->expr_type == EXPR_FUNCTION)
+ attr2 = gfc_expr_attr (target);
else
{
gfc_error ("'%s' argument of '%s' intrinsic at %L must be a pointer "
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 82442042dcc..08d2bd69ddf 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -1028,7 +1028,8 @@ verify_c_interop_param (gfc_symbol *sym)
/* Build a polymorphic CLASS entity, using the symbol that comes from build_sym.
A CLASS entity is represented by an encapsulating type, which contains the
declared type as '$data' component, plus an integer component '$vindex'
- which determines the dynamic type. */
+ which determines the dynamic type, and another integer '$size', which
+ contains the size of the dynamic type structure. */
static gfc_try
encapsulate_class_symbol (gfc_typespec *ts, symbol_attribute *attr,
@@ -1077,6 +1078,7 @@ encapsulate_class_symbol (gfc_typespec *ts, symbol_attribute *attr,
c->attr.pointer = attr->pointer || attr->dummy;
c->attr.allocatable = attr->allocatable;
c->attr.dimension = attr->dimension;
+ c->attr.abstract = ts->u.derived->attr.abstract;
c->as = (*as);
c->initializer = gfc_get_expr ();
c->initializer->expr_type = EXPR_NULL;
@@ -1088,6 +1090,14 @@ encapsulate_class_symbol (gfc_typespec *ts, symbol_attribute *attr,
c->ts.kind = 4;
c->attr.access = ACCESS_PRIVATE;
c->initializer = gfc_int_expr (0);
+
+ /* Add component '$size'. */
+ if (gfc_add_component (fclass, "$size", &c) == FAILURE)
+ return FAILURE;
+ c->ts.type = BT_INTEGER;
+ c->ts.kind = 4;
+ c->attr.access = ACCESS_PRIVATE;
+ c->initializer = gfc_int_expr (0);
}
fclass->attr.extension = 1;
@@ -1171,7 +1181,12 @@ build_sym (const char *name, gfc_charlen *cl,
sym->attr.implied_index = 0;
if (sym->ts.type == BT_CLASS)
- encapsulate_class_symbol (&sym->ts, &sym->attr, &sym->as);
+ {
+ sym->attr.class_ok = (sym->attr.dummy
+ || sym->attr.pointer
+ || sym->attr.allocatable) ? 1 : 0;
+ encapsulate_class_symbol (&sym->ts, &sym->attr, &sym->as);
+ }
return SUCCESS;
}
@@ -1462,10 +1477,11 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr **init,
gfc_array_spec **as)
{
gfc_component *c;
+ gfc_try t = SUCCESS;
- /* If the current symbol is of the same derived type that we're
+ /* F03:C438/C439. If the current symbol is of the same derived type that we're
constructing, it must have the pointer attribute. */
- if (current_ts.type == BT_DERIVED
+ if ((current_ts.type == BT_DERIVED || current_ts.type == BT_CLASS)
&& current_ts.u.derived == gfc_current_block ()
&& current_attr.pointer == 0)
{
@@ -1544,12 +1560,9 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr **init,
}
}
- if (c->ts.type == BT_CLASS)
- encapsulate_class_symbol (&c->ts, &c->attr, &c->as);
-
/* Check array components. */
if (!c->attr.dimension)
- return SUCCESS;
+ goto scalar;
if (c->attr.pointer)
{
@@ -1557,7 +1570,7 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr **init,
{
gfc_error ("Pointer array component of structure at %C must have a "
"deferred shape");
- return FAILURE;
+ t = FAILURE;
}
}
else if (c->attr.allocatable)
@@ -1566,7 +1579,7 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr **init,
{
gfc_error ("Allocatable component of structure at %C must have a "
"deferred shape");
- return FAILURE;
+ t = FAILURE;
}
}
else
@@ -1575,11 +1588,15 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr **init,
{
gfc_error ("Array component of structure at %C must have an "
"explicit shape");
- return FAILURE;
+ t = FAILURE;
}
}
- return SUCCESS;
+scalar:
+ if (c->ts.type == BT_CLASS)
+ encapsulate_class_symbol (&c->ts, &c->attr, &c->as);
+
+ return t;
}
@@ -3751,7 +3768,8 @@ gfc_match_data_decl (void)
if (m != MATCH_YES)
return m;
- if (current_ts.type == BT_DERIVED && gfc_current_state () != COMP_DERIVED)
+ if ((current_ts.type == BT_DERIVED || current_ts.type == BT_CLASS)
+ && gfc_current_state () != COMP_DERIVED)
{
sym = gfc_use_derived (current_ts.u.derived);
@@ -3771,7 +3789,8 @@ gfc_match_data_decl (void)
goto cleanup;
}
- if (current_ts.type == BT_DERIVED && current_ts.u.derived->components == NULL
+ if ((current_ts.type == BT_DERIVED || current_ts.type == BT_CLASS)
+ && current_ts.u.derived->components == NULL
&& !current_ts.u.derived->attr.zero_comp)
{
@@ -5684,13 +5703,31 @@ attr_decl1 (void)
}
}
- /* Update symbol table. DIMENSION attribute is set
- in gfc_set_array_spec(). */
- if (current_attr.dimension == 0
- && gfc_copy_attr (&sym->attr, &current_attr, &var_locus) == FAILURE)
+ /* Update symbol table. DIMENSION attribute is set in
+ gfc_set_array_spec(). For CLASS variables, this must be applied
+ to the first component, or '$data' field. */
+ if (sym->ts.type == BT_CLASS && sym->ts.u.derived)
{
- m = MATCH_ERROR;
- goto cleanup;
+ gfc_component *comp;
+ comp = gfc_find_component (sym->ts.u.derived, "$data", true, true);
+ if (comp == NULL || gfc_copy_attr (&comp->attr, &current_attr,
+ &var_locus) == FAILURE)
+ {
+ m = MATCH_ERROR;
+ goto cleanup;
+ }
+ sym->attr.class_ok = (sym->attr.class_ok
+ || current_attr.allocatable
+ || current_attr.pointer);
+ }
+ else
+ {
+ if (current_attr.dimension == 0
+ && gfc_copy_attr (&sym->attr, &current_attr, &var_locus) == FAILURE)
+ {
+ m = MATCH_ERROR;
+ goto cleanup;
+ }
}
if (gfc_set_array_spec (sym, as, &var_locus) == FAILURE)
@@ -6746,8 +6783,44 @@ gfc_get_type_attr_spec (symbol_attribute *attr, char *name)
}
-/* Counter for assigning a unique vindex number to each derived type. */
-static int vindex_counter = 0;
+/* Assign a hash value for a derived type. The algorithm is that of
+ SDBM. The hashed string is '[module_name #] derived_name'. */
+static unsigned int
+hash_value (gfc_symbol *sym)
+{
+ unsigned int hash = 0;
+ const char *c;
+ int i, len;
+
+ /* Hash of the module or procedure name. */
+ if (sym->module != NULL)
+ c = sym->module;
+ else if (sym->ns && sym->ns->proc_name
+ && sym->ns->proc_name->attr.flavor == FL_MODULE)
+ c = sym->ns->proc_name->name;
+ else
+ c = NULL;
+
+ if (c)
+ {
+ len = strlen (c);
+ for (i = 0; i < len; i++, c++)
+ hash = (hash << 6) + (hash << 16) - hash + (*c);
+
+ /* Disambiguate between 'a' in 'aa' and 'aa' in 'a'. */
+ hash = (hash << 6) + (hash << 16) - hash + '#';
+ }
+
+ /* Hash of the derived type name. */
+ len = strlen (sym->name);
+ c = sym->name;
+ for (i = 0; i < len; i++, c++)
+ hash = (hash << 6) + (hash << 16) - hash + (*c);
+
+ /* Return the hash but take the modulus for the sake of module read,
+ even though this slightly increases the chance of collision. */
+ return (hash % 100000000);
+}
/* Match the beginning of a derived type declaration. If a type name
@@ -6871,8 +6944,8 @@ gfc_match_derived_decl (void)
}
if (!sym->vindex)
- /* Set the vindex for this type and increment the counter. */
- sym->vindex = ++vindex_counter;
+ /* Set the vindex for this type. */
+ sym->vindex = hash_value (sym);
/* Take over the ABSTRACT attribute. */
sym->attr.abstract = attr.abstract;
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 32aa68265bb..cbd3172b454 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -3277,8 +3277,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
return SUCCESS;
}
- if (lvalue->ts.type != BT_CLASS && lvalue->symtree->n.sym->ts.type != BT_CLASS
- && !gfc_compare_types (&lvalue->ts, &rvalue->ts))
+ if (!gfc_compare_types (&lvalue->ts, &rvalue->ts))
{
gfc_error ("Different types in pointer assignment at %L; attempted "
"assignment of %s to %s", &lvalue->where,
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index b40f01ba4bf..74a31d2661c 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -672,6 +672,7 @@ typedef struct
unsigned is_bind_c:1; /* say if is bound to C. */
unsigned extension:1; /* extends a derived type. */
unsigned is_class:1; /* is a CLASS container. */
+ unsigned class_ok:1; /* is a CLASS object with correct attributes. */
/* These flags are both in the typespec and attribute. The attribute
list is what gets read from/written to a module file. The typespec
@@ -1594,6 +1595,17 @@ typedef struct gfc_intrinsic_sym
gfc_intrinsic_sym;
+typedef struct gfc_class_esym_list
+{
+ gfc_symbol *derived;
+ gfc_symbol *esym;
+ struct gfc_expr *vindex;
+ struct gfc_class_esym_list *next;
+}
+gfc_class_esym_list;
+
+#define gfc_get_class_esym_list() XCNEW (gfc_class_esym_list)
+
/* Expression nodes. The expression node types deserve explanations,
since the last couple can be easily misconstrued:
@@ -1618,6 +1630,7 @@ gfc_intrinsic_sym;
# endif
# if MPC_VERSION >= MPC_VERSION_NUM(0,7,1)
# define HAVE_mpc_arc
+# define HAVE_mpc_pow_z
# endif
#else
#define mpc_realref(X) ((X).r)
@@ -1705,6 +1718,7 @@ typedef struct gfc_expr
const char *name; /* Points to the ultimate name of the function */
gfc_intrinsic_sym *isym;
gfc_symbol *esym;
+ gfc_class_esym_list *class_esym;
}
function;
@@ -2195,6 +2209,18 @@ iterator_stack;
extern iterator_stack *iter_stack;
+/* Used for (possibly nested) SELECT TYPE statements. */
+typedef struct gfc_select_type_stack
+{
+ gfc_symbol *selector; /* Current selector variable. */
+ gfc_symtree *tmp; /* Current temporary variable. */
+ struct gfc_select_type_stack *prev; /* Previous element on stack. */
+}
+gfc_select_type_stack;
+extern gfc_select_type_stack *select_type_stack;
+#define gfc_get_select_type_stack() XCNEW (gfc_select_type_stack)
+
+
/* Node in the linked list used for storing finalizer procedures. */
typedef struct gfc_finalizer
@@ -2553,10 +2579,6 @@ void gfc_free_equiv (gfc_equiv *);
void gfc_free_data (gfc_data *);
void gfc_free_case_list (gfc_case *);
-/* Used for SELECT TYPE statements. */
-extern gfc_symbol *type_selector;
-extern gfc_symtree *select_type_tmp;
-
/* matchexp.c -- FIXME too? */
gfc_expr *gfc_get_parentheses (gfc_expr *);
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 0fd4742a1de..866a81ca1d8 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -626,6 +626,7 @@ gfc_check_operator_interface (gfc_symbol *sym, gfc_intrinsic_op op,
- Types and kinds do not conform, and
- First argument is of derived type. */
if (sym->formal->sym->ts.type != BT_DERIVED
+ && sym->formal->sym->ts.type != BT_CLASS
&& (r1 == 0 || r1 == r2)
&& (sym->formal->sym->ts.type == sym->formal->next->sym->ts.type
|| (gfc_numeric_ts (&sym->formal->sym->ts)
@@ -2573,13 +2574,16 @@ matching_typebound_op (gfc_expr** tb_base,
gfc_actual_arglist* base;
for (base = args; base; base = base->next)
- if (base->expr->ts.type == BT_DERIVED)
+ if (base->expr->ts.type == BT_DERIVED || base->expr->ts.type == BT_CLASS)
{
gfc_typebound_proc* tb;
gfc_symbol* derived;
gfc_try result;
- derived = base->expr->ts.u.derived;
+ if (base->expr->ts.type == BT_CLASS)
+ derived = base->expr->ts.u.derived->components->ts.u.derived;
+ else
+ derived = base->expr->ts.u.derived;
if (op == INTRINSIC_USER)
{
@@ -2836,7 +2840,7 @@ gfc_extend_assign (gfc_code *c, gfc_namespace *ns)
rhs = c->expr2;
/* Don't allow an intrinsic assignment to be replaced. */
- if (lhs->ts.type != BT_DERIVED
+ if (lhs->ts.type != BT_DERIVED && lhs->ts.type != BT_CLASS
&& (rhs->rank == 0 || rhs->rank == lhs->rank)
&& (lhs->ts.type == rhs->ts.type
|| (gfc_numeric_ts (&lhs->ts) && gfc_numeric_ts (&rhs->ts))))
diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi
index 2c993b9048a..3aa16b0f860 100644
--- a/gcc/fortran/intrinsic.texi
+++ b/gcc/fortran/intrinsic.texi
@@ -2744,7 +2744,7 @@ Inverse function: @ref{ACOSH}
@code{COUNT(MASK [, DIM [, KIND]])} counts the number of @code{.TRUE.}
elements of @var{MASK} along the dimension of @var{DIM}. If @var{DIM} is
omitted it is taken to be @code{1}. @var{DIM} is a scalar of type
-@code{INTEGER} in the range of @math{1 /leq DIM /leq n)} where @math{n}
+@code{INTEGER} in the range of @math{1 \leq DIM \leq n)} where @math{n}
is the rank of @var{MASK}.
@item @emph{Standard}:
@@ -2864,7 +2864,7 @@ end program test_cpu_time
@code{CSHIFT(ARRAY, SHIFT [, DIM])} performs a circular shift on elements of
@var{ARRAY} along the dimension of @var{DIM}. If @var{DIM} is omitted it is
taken to be @code{1}. @var{DIM} is a scalar of type @code{INTEGER} in the
-range of @math{1 /leq DIM /leq n)} where @math{n} is the rank of @var{ARRAY}.
+range of @math{1 \leq DIM \leq n)} where @math{n} is the rank of @var{ARRAY}.
If the rank of @var{ARRAY} is one, then all elements of @var{ARRAY} are shifted
by @var{SHIFT} places. If rank is greater than one, then all complete rank one
sections of @var{ARRAY} along the given dimension are shifted. Elements
@@ -3458,8 +3458,8 @@ Subroutine, function
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
-@item @var{VALUES}@tab The type shall be @code{REAL, DIMENSION(2)}.
-@item @var{TIME}@tab The type shall be @code{REAL}.
+@item @var{VALUES}@tab The type shall be @code{REAL(4), DIMENSION(2)}.
+@item @var{TIME}@tab The type shall be @code{REAL(4)}.
@end multitable
@item @emph{Return value}:
@@ -3503,7 +3503,7 @@ end program test_dtime
@code{EOSHIFT(ARRAY, SHIFT[, BOUNDARY, DIM])} performs an end-off shift on
elements of @var{ARRAY} along the dimension of @var{DIM}. If @var{DIM} is
omitted it is taken to be @code{1}. @var{DIM} is a scalar of type
-@code{INTEGER} in the range of @math{1 /leq DIM /leq n)} where @math{n} is the
+@code{INTEGER} in the range of @math{1 \leq DIM \leq n)} where @math{n} is the
rank of @var{ARRAY}. If the rank of @var{ARRAY} is one, then all elements of
@var{ARRAY} are shifted by @var{SHIFT} places. If rank is greater than one,
then all complete rank one sections of @var{ARRAY} along the given dimension are
@@ -3767,8 +3767,8 @@ Subroutine, function
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
-@item @var{VALUES}@tab The type shall be @code{REAL, DIMENSION(2)}.
-@item @var{TIME}@tab The type shall be @code{REAL}.
+@item @var{VALUES}@tab The type shall be @code{REAL(4), DIMENSION(2)}.
+@item @var{TIME}@tab The type shall be @code{REAL(4)}.
@end multitable
@item @emph{Return value}:
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index abd370f5048..d6b64c4120c 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -643,6 +643,8 @@ format_item_1:
case FMT_X:
/* X requires a prior number if we're being pedantic. */
+ if (mode != MODE_FORMAT)
+ format_locus.nextc += format_string_pos;
if (gfc_notify_std (GFC_STD_GNU, "Extension: X descriptor "
"requires leading space count at %L", &format_locus)
== FAILURE)
@@ -722,7 +724,7 @@ data_desc:
break;
case FMT_P:
- /* Comma after P is allowed only for F, E, EN, ES, D, or G.
+ /* No comma after P allowed only for F, E, EN, ES, D, or G.
10.1.1 (1). */
t = format_lex ();
if (t == FMT_ERROR)
@@ -1052,7 +1054,7 @@ between_desc:
default:
if (mode != MODE_FORMAT)
- format_locus.nextc += format_string_pos;
+ format_locus.nextc += format_string_pos - 1;
if (gfc_notify_std (GFC_STD_GNU, "Extension: Missing comma at %L",
&format_locus) == FAILURE)
return FAILURE;
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index 3e969e78ca2..24e292bd4d6 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -29,9 +29,8 @@ along with GCC; see the file COPYING3. If not see
int gfc_matching_procptr_assignment = 0;
bool gfc_matching_prefix = false;
-/* Used for SELECT TYPE statements. */
-gfc_symbol *type_selector;
-gfc_symtree *select_type_tmp;
+/* Stack of SELECT TYPE statements. */
+gfc_select_type_stack *select_type_stack = NULL;
/* For debugging and diagnostic purposes. Return the textual representation
of the intrinsic operator OP. */
@@ -2389,58 +2388,6 @@ char_selector:
}
-/* Used in gfc_match_allocate to check that a allocation-object and
- a source-expr are conformable. This does not catch all possible
- cases; in particular a runtime checking is needed. */
-
-static gfc_try
-conformable_arrays (gfc_expr *e1, gfc_expr *e2)
-{
- /* First compare rank. */
- if (e2->ref && e1->rank != e2->ref->u.ar.as->rank)
- {
- gfc_error ("Source-expr at %L must be scalar or have the "
- "same rank as the allocate-object at %L",
- &e1->where, &e2->where);
- return FAILURE;
- }
-
- if (e1->shape)
- {
- int i;
- mpz_t s;
-
- mpz_init (s);
-
- for (i = 0; i < e1->rank; i++)
- {
- if (e2->ref->u.ar.end[i])
- {
- mpz_set (s, e2->ref->u.ar.end[i]->value.integer);
- mpz_sub (s, s, e2->ref->u.ar.start[i]->value.integer);
- mpz_add_ui (s, s, 1);
- }
- else
- {
- mpz_set (s, e2->ref->u.ar.start[i]->value.integer);
- }
-
- if (mpz_cmp (e1->shape[i], s) != 0)
- {
- gfc_error ("Source-expr at %L and allocate-object at %L must "
- "have the same shape", &e1->where, &e2->where);
- mpz_clear (s);
- return FAILURE;
- }
- }
-
- mpz_clear (s);
- }
-
- return SUCCESS;
-}
-
-
/* Match an ALLOCATE statement. */
match
@@ -2621,7 +2568,7 @@ alloc_opt_list:
goto cleanup;
}
- /* The next 3 conditionals check C631. */
+ /* The next 2 conditionals check C631. */
if (ts.type != BT_UNKNOWN)
{
gfc_error ("SOURCE tag at %L conflicts with the typespec at %L",
@@ -2636,28 +2583,6 @@ alloc_opt_list:
goto cleanup;
}
- gfc_resolve_expr (tmp);
-
- if (!gfc_type_compatible (&head->expr->ts, &tmp->ts))
- {
- gfc_error ("Type of entity at %L is type incompatible with "
- "source-expr at %L", &head->expr->where, &tmp->where);
- goto cleanup;
- }
-
- /* Check C633. */
- if (tmp->ts.kind != head->expr->ts.kind)
- {
- gfc_error ("The allocate-object at %L and the source-expr at %L "
- "shall have the same kind type parameter",
- &head->expr->where, &tmp->where);
- goto cleanup;
- }
-
- /* Check C632 and restriction following Note 6.18. */
- if (tmp->rank > 0 && conformable_arrays (tmp, head->expr) == FAILURE)
- goto cleanup;
-
source = tmp;
saw_source = true;
@@ -3751,7 +3676,10 @@ gfc_match_equivalence (void)
if (gfc_match_eos () == MATCH_YES)
break;
if (gfc_match_char (',') != MATCH_YES)
- goto syntax;
+ {
+ gfc_error ("Expecting a comma in EQUIVALENCE at %C");
+ goto cleanup;
+ }
}
return MATCH_YES;
@@ -4021,46 +3949,90 @@ gfc_match_select (void)
}
+/* Push the current selector onto the SELECT TYPE stack. */
+
+static void
+select_type_push (gfc_symbol *sel)
+{
+ gfc_select_type_stack *top = gfc_get_select_type_stack ();
+ top->selector = sel;
+ top->tmp = NULL;
+ top->prev = select_type_stack;
+
+ select_type_stack = top;
+}
+
+
+/* Set the temporary for the current SELECT TYPE selector. */
+
+static void
+select_type_set_tmp (gfc_typespec *ts)
+{
+ char name[GFC_MAX_SYMBOL_LEN];
+ gfc_symtree *tmp;
+
+ sprintf (name, "tmp$%s", ts->u.derived->name);
+ gfc_get_sym_tree (name, gfc_current_ns, &tmp, false);
+ gfc_add_type (tmp->n.sym, ts, NULL);
+ gfc_set_sym_referenced (tmp->n.sym);
+ gfc_add_pointer (&tmp->n.sym->attr, NULL);
+ gfc_add_flavor (&tmp->n.sym->attr, FL_VARIABLE, name, NULL);
+
+ select_type_stack->tmp = tmp;
+}
+
+
/* Match a SELECT TYPE statement. */
match
gfc_match_select_type (void)
{
- gfc_expr *expr;
+ gfc_expr *expr1, *expr2 = NULL;
match m;
+ char name[GFC_MAX_SYMBOL_LEN];
m = gfc_match_label ();
if (m == MATCH_ERROR)
return m;
- m = gfc_match (" select type ( %e ", &expr);
+ m = gfc_match (" select type ( ");
if (m != MATCH_YES)
return m;
- /* TODO: Implement ASSOCIATE. */
- m = gfc_match (" => ");
+ gfc_current_ns = gfc_build_block_ns (gfc_current_ns);
+
+ m = gfc_match (" %n => %e", name, &expr2);
if (m == MATCH_YES)
{
- gfc_error ("Associate-name in SELECT TYPE statement at %C "
- "is not yet supported");
- return MATCH_ERROR;
+ expr1 = gfc_get_expr();
+ expr1->expr_type = EXPR_VARIABLE;
+ if (gfc_get_sym_tree (name, NULL, &expr1->symtree, false))
+ return MATCH_ERROR;
+ expr1->symtree->n.sym->ts = expr2->ts;
+ expr1->symtree->n.sym->attr.referenced = 1;
+ expr1->symtree->n.sym->attr.class_ok = 1;
+ }
+ else
+ {
+ m = gfc_match (" %e ", &expr1);
+ if (m != MATCH_YES)
+ return m;
}
m = gfc_match (" )%t");
if (m != MATCH_YES)
return m;
- /* Check for F03:C811.
- TODO: Change error message once ASSOCIATE is implemented. */
- if (expr->expr_type != EXPR_VARIABLE || expr->ref != NULL)
+ /* Check for F03:C811. */
+ if (!expr2 && (expr1->expr_type != EXPR_VARIABLE || expr1->ref != NULL))
{
- gfc_error ("Selector must be a named variable in SELECT TYPE statement "
- "at %C");
+ gfc_error ("Selector in SELECT TYPE at %C is not a named variable; "
+ "use associate-name=>");
return MATCH_ERROR;
}
/* Check for F03:C813. */
- if (expr->ts.type != BT_CLASS)
+ if (expr1->ts.type != BT_CLASS && !(expr2 && expr2->ts.type == BT_CLASS))
{
gfc_error ("Selector shall be polymorphic in SELECT TYPE statement "
"at %C");
@@ -4068,9 +4040,11 @@ gfc_match_select_type (void)
}
new_st.op = EXEC_SELECT_TYPE;
- new_st.expr1 = expr;
+ new_st.expr1 = expr1;
+ new_st.expr2 = expr2;
+ new_st.ext.ns = gfc_current_ns;
- type_selector = expr->symtree->n.sym;
+ select_type_push (expr1->symtree->n.sym);
return MATCH_YES;
}
@@ -4155,7 +4129,6 @@ gfc_match_type_is (void)
{
gfc_case *c = NULL;
match m;
- char name[GFC_MAX_SYMBOL_LEN];
if (gfc_current_state () != COMP_SELECT_TYPE)
{
@@ -4187,11 +4160,7 @@ gfc_match_type_is (void)
new_st.ext.case_list = c;
/* Create temporary variable. */
- sprintf (name, "tmp$%s", c->ts.u.derived->name);
- gfc_get_sym_tree (name, gfc_current_ns, &select_type_tmp, false);
- select_type_tmp->n.sym->ts = c->ts;
- select_type_tmp->n.sym->attr.referenced = 1;
- select_type_tmp->n.sym->attr.pointer = 1;
+ select_type_set_tmp (&c->ts);
return MATCH_YES;
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index 1769eada5fe..b2ad6ecc477 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -3972,6 +3972,72 @@ load_equiv (void)
}
+/* This function loads the sym_root of f2k_derived with the extensions to
+ the derived type. */
+static void
+load_derived_extensions (void)
+{
+ int symbol, nuse, j;
+ gfc_symbol *derived;
+ gfc_symbol *dt;
+ gfc_symtree *st;
+ pointer_info *info;
+ char name[GFC_MAX_SYMBOL_LEN + 1];
+ char module[GFC_MAX_SYMBOL_LEN + 1];
+ const char *p;
+
+ mio_lparen ();
+ while (peek_atom () != ATOM_RPAREN)
+ {
+ mio_lparen ();
+ mio_integer (&symbol);
+ info = get_integer (symbol);
+ derived = info->u.rsym.sym;
+
+ /* This one is not being loaded. */
+ if (!info || !derived)
+ {
+ while (peek_atom () != ATOM_RPAREN)
+ skip_list ();
+ continue;
+ }
+
+ gcc_assert (derived->attr.flavor == FL_DERIVED);
+ if (derived->f2k_derived == NULL)
+ derived->f2k_derived = gfc_get_namespace (NULL, 0);
+
+ while (peek_atom () != ATOM_RPAREN)
+ {
+ mio_lparen ();
+ mio_internal_string (name);
+ mio_internal_string (module);
+
+ /* Only use one use name to find the symbol. */
+ nuse = number_use_names (name, false);
+ j = 1;
+ p = find_use_name_n (name, &j, false);
+ if (p)
+ {
+ st = gfc_find_symtree (gfc_current_ns->sym_root, p);
+ dt = st->n.sym;
+ st = gfc_find_symtree (derived->f2k_derived->sym_root, name);
+ if (st == NULL)
+ {
+ /* Only use the real name in f2k_derived to ensure a single
+ symtree. */
+ st = gfc_new_symtree (&derived->f2k_derived->sym_root, name);
+ st->n.sym = dt;
+ st->n.sym->refs++;
+ }
+ }
+ mio_rparen ();
+ }
+ mio_rparen ();
+ }
+ mio_rparen ();
+}
+
+
/* Recursive function to traverse the pointer_info tree and load a
needed symbol. We return nonzero if we load a symbol and stop the
traversal, because the act of loading can alter the tree. */
@@ -4113,7 +4179,7 @@ check_for_ambiguous (gfc_symbol *st_sym, pointer_info *info)
static void
read_module (void)
{
- module_locus operator_interfaces, user_operators;
+ module_locus operator_interfaces, user_operators, extensions;
const char *p;
char name[GFC_MAX_SYMBOL_LEN + 1];
int i;
@@ -4130,10 +4196,13 @@ read_module (void)
skip_list ();
skip_list ();
- /* Skip commons and equivalences for now. */
+ /* Skip commons, equivalences and derived type extensions for now. */
skip_list ();
skip_list ();
+ get_module_locus (&extensions);
+ skip_list ();
+
mio_lparen ();
/* Create the fixup nodes for all the symbols. */
@@ -4386,6 +4455,11 @@ read_module (void)
gfc_check_interfaces (gfc_current_ns);
+ /* Now we should be in a position to fill f2k_derived with derived type
+ extensions, since everything has been loaded. */
+ set_module_locus (&extensions);
+ load_derived_extensions ();
+
/* Clean up symbol nodes that were never loaded, create references
to hidden symbols. */
@@ -4594,6 +4668,36 @@ write_equiv (void)
}
+/* Write derived type extensions to the module. */
+
+static void
+write_dt_extensions (gfc_symtree *st)
+{
+ mio_lparen ();
+ mio_pool_string (&st->n.sym->name);
+ if (st->n.sym->module != NULL)
+ mio_pool_string (&st->n.sym->module);
+ else
+ mio_internal_string (module_name);
+ mio_rparen ();
+}
+
+static void
+write_derived_extensions (gfc_symtree *st)
+{
+ if (!((st->n.sym->attr.flavor == FL_DERIVED)
+ && (st->n.sym->f2k_derived != NULL)
+ && (st->n.sym->f2k_derived->sym_root != NULL)))
+ return;
+
+ mio_lparen ();
+ mio_symbol_ref (&(st->n.sym));
+ gfc_traverse_symtree (st->n.sym->f2k_derived->sym_root,
+ write_dt_extensions);
+ mio_rparen ();
+}
+
+
/* Write a symbol to the module. */
static void
@@ -4820,6 +4924,13 @@ write_module (void)
write_char ('\n');
write_char ('\n');
+ mio_lparen ();
+ gfc_traverse_symtree (gfc_current_ns->sym_root,
+ write_derived_extensions);
+ mio_rparen ();
+ write_char ('\n');
+ write_char ('\n');
+
/* Write symbol information. First we traverse all symbols in the
primary namespace, writing those that need to be written.
Sometimes writing one symbol will cause another to need to be
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index 3e20f8e45d4..3742addb6b1 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -242,6 +242,10 @@ gfc_post_options (const char **pfilename)
if (flag_whole_program)
gfc_option.flag_whole_file = 1;
+ /* Enable whole-file mode if LTO is in effect. */
+ if (flag_lto || flag_whopr)
+ gfc_option.flag_whole_file = 1;
+
/* -fbounds-check is equivalent to -fcheck=bounds */
if (flag_bounds_check)
gfc_option.rtcheck |= GFC_RTCHECK_BOUNDS;
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index 13199c91bb0..95a327bf23d 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -2068,11 +2068,15 @@ endType:
{
/* Look for allocatable components. */
if (c->attr.allocatable
+ || (c->ts.type == BT_CLASS
+ && c->ts.u.derived->components->attr.allocatable)
|| (c->ts.type == BT_DERIVED && c->ts.u.derived->attr.alloc_comp))
sym->attr.alloc_comp = 1;
/* Look for pointer components. */
if (c->attr.pointer
+ || (c->ts.type == BT_CLASS
+ && c->ts.u.derived->components->attr.pointer)
|| (c->ts.type == BT_DERIVED && c->ts.u.derived->attr.pointer_comp))
sym->attr.pointer_comp = 1;
@@ -2887,6 +2891,17 @@ parse_select_block (void)
}
+/* Pop the current selector from the SELECT TYPE stack. */
+
+static void
+select_type_pop (void)
+{
+ gfc_select_type_stack *old = select_type_stack;
+ select_type_stack = old->prev;
+ gfc_free (old);
+}
+
+
/* Parse a SELECT TYPE construct (F03:R821). */
static void
@@ -2909,12 +2924,8 @@ parse_select_type_block (void)
if (st == ST_NONE)
unexpected_eof ();
if (st == ST_END_SELECT)
- {
- /* Empty SELECT CASE is OK. */
- accept_statement (st);
- pop_state ();
- return;
- }
+ /* Empty SELECT CASE is OK. */
+ goto done;
if (st == ST_TYPE_IS || st == ST_CLASS_IS)
break;
@@ -2959,8 +2970,11 @@ parse_select_type_block (void)
}
while (st != ST_END_SELECT);
+done:
pop_state ();
accept_statement (st);
+ gfc_current_ns = gfc_current_ns->parent;
+ select_type_pop ();
}
@@ -3033,18 +3047,13 @@ check_do_closure (void)
static void parse_progunit (gfc_statement);
-/* Parse a BLOCK construct. */
+/* Set up the local namespace for a BLOCK construct. */
-static void
-parse_block_construct (void)
+gfc_namespace*
+gfc_build_block_ns (gfc_namespace *parent_ns)
{
- gfc_namespace* parent_ns;
gfc_namespace* my_ns;
- gfc_state_data s;
-
- gfc_notify_std (GFC_STD_F2008, "Fortran 2008: BLOCK construct at %C");
- parent_ns = gfc_current_ns;
my_ns = gfc_get_namespace (parent_ns, 1);
my_ns->construct_entities = 1;
@@ -3064,7 +3073,25 @@ parse_block_construct (void)
my_ns->proc_name->name, NULL);
gcc_assert (t == SUCCESS);
}
- my_ns->proc_name->attr.recursive = parent_ns->proc_name->attr.recursive;
+
+ if (parent_ns->proc_name)
+ my_ns->proc_name->attr.recursive = parent_ns->proc_name->attr.recursive;
+
+ return my_ns;
+}
+
+
+/* Parse a BLOCK construct. */
+
+static void
+parse_block_construct (void)
+{
+ gfc_namespace* my_ns;
+ gfc_state_data s;
+
+ gfc_notify_std (GFC_STD_F2008, "Fortran 2008: BLOCK construct at %C");
+
+ my_ns = gfc_build_block_ns (gfc_current_ns);
new_st.op = EXEC_BLOCK;
new_st.ext.ns = my_ns;
@@ -3075,7 +3102,7 @@ parse_block_construct (void)
parse_progunit (ST_NONE);
- gfc_current_ns = parent_ns;
+ gfc_current_ns = gfc_current_ns->parent;
pop_state ();
}
diff --git a/gcc/fortran/parse.h b/gcc/fortran/parse.h
index 2b926618d28..e0a2969c2a3 100644
--- a/gcc/fortran/parse.h
+++ b/gcc/fortran/parse.h
@@ -70,4 +70,5 @@ match gfc_match_enumerator_def (void);
void gfc_free_enum_history (void);
extern bool gfc_matching_function;
match gfc_match_prefix (gfc_typespec *);
+gfc_namespace* gfc_build_block_ns (gfc_namespace *);
#endif /* GFC_PARSE_H */
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index bb803b3475c..a721d944b33 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -367,15 +367,26 @@ resolve_contained_fntype (gfc_symbol *sym, gfc_namespace *ns)
/* Fortran 95 Draft Standard, page 51, Section 5.1.1.5, on the Character
type, lists the only ways a character length value of * can be used:
dummy arguments of procedures, named constants, and function results
- in external functions. Internal function results are not on that list;
- ergo, not permitted. */
+ in external functions. Internal function results and results of module
+ procedures are not on this list, ergo, not permitted. */
if (sym->result->ts.type == BT_CHARACTER)
{
gfc_charlen *cl = sym->result->ts.u.cl;
if (!cl || !cl->length)
- gfc_error ("Character-valued internal function '%s' at %L must "
- "not be assumed length", sym->name, &sym->declared_at);
+ {
+ /* See if this is a module-procedure and adapt error message
+ accordingly. */
+ bool module_proc;
+ gcc_assert (ns->parent && ns->parent->proc_name);
+ module_proc = (ns->parent->proc_name->attr.flavor == FL_MODULE);
+
+ gfc_error ("Character-valued %s '%s' at %L must not be"
+ " assumed length",
+ module_proc ? _("module procedure")
+ : _("internal function"),
+ sym->name, &sym->declared_at);
+ }
}
}
@@ -2515,7 +2526,9 @@ resolve_function (gfc_expr *expr)
return FAILURE;
}
- if (sym && sym->attr.abstract)
+ /* If this ia a deferred TBP with an abstract interface (which may
+ of course be referenced), expr->value.function.name will be set. */
+ if (sym && sym->attr.abstract && !expr->value.function.name)
{
gfc_error ("ABSTRACT INTERFACE '%s' must not be referenced at %L",
sym->name, &expr->where);
@@ -3127,6 +3140,15 @@ resolve_call (gfc_code *c)
}
}
+ /* If this ia a deferred TBP with an abstract interface
+ (which may of course be referenced), c->expr1 will be set. */
+ if (csym && csym->attr.abstract && !c->expr1)
+ {
+ gfc_error ("ABSTRACT INTERFACE '%s' must not be referenced at %L",
+ csym->name, &c->loc);
+ return FAILURE;
+ }
+
/* Subroutines without the RECURSIVE attribution are not allowed to
* call themselves. */
if (csym && is_illegal_recursion (csym, gfc_current_ns))
@@ -4997,28 +5019,42 @@ resolve_typebound_call (gfc_code* c)
c->op = (c->expr1->value.compcall.assign ? EXEC_ASSIGN_CALL : EXEC_CALL);
gcc_assert (!c->expr1->ref && !c->expr1->value.compcall.actual);
+
gfc_free_expr (c->expr1);
- c->expr1 = NULL;
+ c->expr1 = gfc_get_expr ();
+ c->expr1->expr_type = EXPR_FUNCTION;
+ c->expr1->symtree = target;
+ c->expr1->where = c->loc;
return resolve_call (c);
}
-/* Resolve a component-call expression. */
-
+/* Resolve a component-call expression. This originally was intended
+ only to see functions. However, it is convenient to use it in
+ resolving subroutine class methods, since we do not have to add a
+ gfc_code each time. */
static gfc_try
-resolve_compcall (gfc_expr* e)
+resolve_compcall (gfc_expr* e, bool fcn)
{
gfc_actual_arglist* newactual;
gfc_symtree* target;
/* Check that's really a FUNCTION. */
- if (!e->value.compcall.tbp->function)
+ if (fcn && !e->value.compcall.tbp->function)
{
gfc_error ("'%s' at %L should be a FUNCTION",
e->value.compcall.name, &e->where);
return FAILURE;
}
+ else if (!fcn && !e->value.compcall.tbp->subroutine)
+ {
+ /* To resolve class member calls, we borrow this bit
+ of code to select the specific procedures. */
+ gfc_error ("'%s' at %L should be a SUBROUTINE",
+ e->value.compcall.name, &e->where);
+ return FAILURE;
+ }
/* These must not be assign-calls! */
gcc_assert (!e->value.compcall.assign);
@@ -5043,12 +5079,337 @@ resolve_compcall (gfc_expr* e)
e->value.function.actual = newactual;
e->value.function.name = e->value.compcall.name;
e->value.function.esym = target->n.sym;
+ e->value.function.class_esym = NULL;
e->value.function.isym = NULL;
e->symtree = target;
e->ts = target->n.sym->ts;
e->expr_type = EXPR_FUNCTION;
- return gfc_resolve_expr (e);
+ /* Resolution is not necessary if this is a class subroutine; this
+ function only has to identify the specific proc. Resolution of
+ the call will be done next in resolve_typebound_call. */
+ return fcn ? gfc_resolve_expr (e) : SUCCESS;
+}
+
+
+/* Resolve a typebound call for the members in a class. This group of
+ functions implements dynamic dispatch in the provisional version
+ of f03 OOP. As soon as vtables are in place and contain pointers
+ to methods, this will no longer be necessary. */
+static gfc_expr *list_e;
+static void check_class_members (gfc_symbol *);
+static gfc_try class_try;
+static bool fcn_flag;
+static gfc_symbol *class_object;
+
+
+static void
+check_members (gfc_symbol *derived)
+{
+ if (derived->attr.flavor == FL_DERIVED)
+ check_class_members (derived);
+}
+
+
+static void
+check_class_members (gfc_symbol *derived)
+{
+ gfc_symbol* tbp_sym;
+ gfc_expr *e;
+ gfc_symtree *tbp;
+ gfc_class_esym_list *etmp;
+
+ e = gfc_copy_expr (list_e);
+
+ tbp = gfc_find_typebound_proc (derived, &class_try,
+ e->value.compcall.name,
+ false, &e->where);
+
+ if (tbp == NULL)
+ {
+ gfc_error ("no typebound available procedure named '%s' at %L",
+ e->value.compcall.name, &e->where);
+ return;
+ }
+
+ if (tbp->n.tb->is_generic)
+ {
+ tbp_sym = NULL;
+
+ /* If we have to match a passed class member, force the actual
+ expression to have the correct type. */
+ if (!tbp->n.tb->nopass)
+ {
+ if (e->value.compcall.base_object == NULL)
+ e->value.compcall.base_object =
+ extract_compcall_passed_object (e);
+
+ e->value.compcall.base_object->ts.type = BT_DERIVED;
+ e->value.compcall.base_object->ts.u.derived = derived;
+ }
+ }
+ else
+ tbp_sym = tbp->n.tb->u.specific->n.sym;
+
+ e->value.compcall.tbp = tbp->n.tb;
+ e->value.compcall.name = tbp->name;
+
+ /* Let the original expresssion catch the assertion in
+ resolve_compcall, since this flag does not appear to be reset or
+ copied in some systems. */
+ e->value.compcall.assign = 0;
+
+ /* Do the renaming, PASSing, generic => specific and other
+ good things for each class member. */
+ class_try = (resolve_compcall (e, fcn_flag) == SUCCESS)
+ ? class_try : FAILURE;
+
+ /* Now transfer the found symbol to the esym list. */
+ if (class_try == SUCCESS)
+ {
+ etmp = list_e->value.function.class_esym;
+ list_e->value.function.class_esym
+ = gfc_get_class_esym_list();
+ list_e->value.function.class_esym->next = etmp;
+ list_e->value.function.class_esym->derived = derived;
+ list_e->value.function.class_esym->esym
+ = e->value.function.esym;
+ }
+
+ gfc_free_expr (e);
+
+ /* Burrow down into grandchildren types. */
+ if (derived->f2k_derived)
+ gfc_traverse_ns (derived->f2k_derived, check_members);
+}
+
+
+/* Eliminate esym_lists where all the members point to the
+ typebound procedure of the declared type; ie. one where
+ type selection has no effect.. */
+static void
+resolve_class_esym (gfc_expr *e)
+{
+ gfc_class_esym_list *p, *q;
+ bool empty = true;
+
+ gcc_assert (e && e->expr_type == EXPR_FUNCTION);
+
+ p = e->value.function.class_esym;
+ if (p == NULL)
+ return;
+
+ for (; p; p = p->next)
+ empty = empty && (e->value.function.esym == p->esym);
+
+ if (empty)
+ {
+ p = e->value.function.class_esym;
+ for (; p; p = q)
+ {
+ q = p->next;
+ gfc_free (p);
+ }
+ e->value.function.class_esym = NULL;
+ }
+}
+
+
+/* Generate an expression for the vindex, given the reference to
+ the class of the final expression (class_ref), the base of the
+ full reference list (new_ref), the declared type and the class
+ object (st). */
+static gfc_expr*
+vindex_expr (gfc_ref *class_ref, gfc_ref *new_ref,
+ gfc_symbol *declared, gfc_symtree *st)
+{
+ gfc_expr *vindex;
+ gfc_ref *ref;
+
+ /* Build an expression for the correct vindex; ie. that of the last
+ CLASS reference. */
+ ref = gfc_get_ref();
+ ref->type = REF_COMPONENT;
+ ref->u.c.component = declared->components->next;
+ ref->u.c.sym = declared;
+ ref->next = NULL;
+ if (class_ref)
+ {
+ class_ref->next = ref;
+ }
+ else
+ {
+ gfc_free_ref_list (new_ref);
+ new_ref = ref;
+ }
+ vindex = gfc_get_expr ();
+ vindex->expr_type = EXPR_VARIABLE;
+ vindex->symtree = st;
+ vindex->symtree->n.sym->refs++;
+ vindex->ts = ref->u.c.component->ts;
+ vindex->ref = new_ref;
+
+ return vindex;
+}
+
+
+/* Get the ultimate declared type from an expression. In addition,
+ return the last class/derived type reference and the copy of the
+ reference list. */
+static gfc_symbol*
+get_declared_from_expr (gfc_ref **class_ref, gfc_ref **new_ref,
+ gfc_expr *e)
+{
+ gfc_symbol *declared;
+ gfc_ref *ref;
+
+ declared = NULL;
+ *class_ref = NULL;
+ *new_ref = gfc_copy_ref (e->ref);
+ for (ref = *new_ref; ref; ref = ref->next)
+ {
+ if (ref->type != REF_COMPONENT)
+ continue;
+
+ if (ref->u.c.component->ts.type == BT_CLASS
+ || ref->u.c.component->ts.type == BT_DERIVED)
+ {
+ declared = ref->u.c.component->ts.u.derived;
+ *class_ref = ref;
+ }
+ }
+
+ if (declared == NULL)
+ declared = e->symtree->n.sym->ts.u.derived;
+
+ return declared;
+}
+
+
+/* Resolve the argument expressions so that any arguments expressions
+ that include class methods are resolved before the current call.
+ This is necessary because of the static variables used in CLASS
+ method resolution. */
+static void
+resolve_arg_exprs (gfc_actual_arglist *arg)
+{
+ /* Resolve the actual arglist expressions. */
+ for (; arg; arg = arg->next)
+ {
+ if (arg->expr)
+ gfc_resolve_expr (arg->expr);
+ }
+}
+
+
+/* Resolve a CLASS typebound function, or 'method'. */
+static gfc_try
+resolve_class_compcall (gfc_expr* e)
+{
+ gfc_symbol *derived, *declared;
+ gfc_ref *new_ref;
+ gfc_ref *class_ref;
+ gfc_symtree *st;
+
+ st = e->symtree;
+ class_object = st->n.sym;
+
+ /* Get the CLASS declared type. */
+ declared = get_declared_from_expr (&class_ref, &new_ref, e);
+
+ /* Weed out cases of the ultimate component being a derived type. */
+ if (class_ref && class_ref->u.c.component->ts.type == BT_DERIVED)
+ {
+ gfc_free_ref_list (new_ref);
+ return resolve_compcall (e, true);
+ }
+
+ /* Resolve the argument expressions, */
+ resolve_arg_exprs (e->value.function.actual);
+
+ /* Get the data component, which is of the declared type. */
+ derived = declared->components->ts.u.derived;
+
+ /* Resolve the function call for each member of the class. */
+ class_try = SUCCESS;
+ fcn_flag = true;
+ list_e = gfc_copy_expr (e);
+ check_class_members (derived);
+
+ class_try = (resolve_compcall (e, true) == SUCCESS)
+ ? class_try : FAILURE;
+
+ /* Transfer the class list to the original expression. Note that
+ the class_esym list is cleaned up in trans-expr.c, as the calls
+ are translated. */
+ e->value.function.class_esym = list_e->value.function.class_esym;
+ list_e->value.function.class_esym = NULL;
+ gfc_free_expr (list_e);
+
+ resolve_class_esym (e);
+
+ /* More than one typebound procedure so transmit an expression for
+ the vindex as the selector. */
+ if (e->value.function.class_esym != NULL)
+ e->value.function.class_esym->vindex
+ = vindex_expr (class_ref, new_ref, declared, st);
+
+ return class_try;
+}
+
+/* Resolve a CLASS typebound subroutine, or 'method'. */
+static gfc_try
+resolve_class_typebound_call (gfc_code *code)
+{
+ gfc_symbol *derived, *declared;
+ gfc_ref *new_ref;
+ gfc_ref *class_ref;
+ gfc_symtree *st;
+
+ st = code->expr1->symtree;
+ class_object = st->n.sym;
+
+ /* Get the CLASS declared type. */
+ declared = get_declared_from_expr (&class_ref, &new_ref, code->expr1);
+
+ /* Weed out cases of the ultimate component being a derived type. */
+ if (class_ref && class_ref->u.c.component->ts.type == BT_DERIVED)
+ {
+ gfc_free_ref_list (new_ref);
+ return resolve_typebound_call (code);
+ }
+
+ /* Resolve the argument expressions, */
+ resolve_arg_exprs (code->expr1->value.compcall.actual);
+
+ /* Get the data component, which is of the declared type. */
+ derived = declared->components->ts.u.derived;
+
+ class_try = SUCCESS;
+ fcn_flag = false;
+ list_e = gfc_copy_expr (code->expr1);
+ check_class_members (derived);
+
+ class_try = (resolve_typebound_call (code) == SUCCESS)
+ ? class_try : FAILURE;
+
+ /* Transfer the class list to the original expression. Note that
+ the class_esym list is cleaned up in trans-expr.c, as the calls
+ are translated. */
+ code->expr1->value.function.class_esym
+ = list_e->value.function.class_esym;
+ list_e->value.function.class_esym = NULL;
+ gfc_free_expr (list_e);
+
+ resolve_class_esym (code->expr1);
+
+ /* More than one typebound procedure so transmit an expression for
+ the vindex as the selector. */
+ if (code->expr1->value.function.class_esym != NULL)
+ code->expr1->value.function.class_esym->vindex
+ = vindex_expr (class_ref, new_ref, declared, st);
+
+ return class_try;
}
@@ -5162,7 +5523,10 @@ gfc_resolve_expr (gfc_expr *e)
break;
case EXPR_COMPCALL:
- t = resolve_compcall (e);
+ if (e->symtree && e->symtree->n.sym->ts.type == BT_CLASS)
+ t = resolve_class_compcall (e);
+ else
+ t = resolve_compcall (e, true);
break;
case EXPR_SUBSTRING:
@@ -5605,6 +5969,58 @@ gfc_expr_to_initialize (gfc_expr *e)
}
+/* Used in resolve_allocate_expr to check that a allocation-object and
+ a source-expr are conformable. This does not catch all possible
+ cases; in particular a runtime checking is needed. */
+
+static gfc_try
+conformable_arrays (gfc_expr *e1, gfc_expr *e2)
+{
+ /* First compare rank. */
+ if (e2->ref && e1->rank != e2->ref->u.ar.as->rank)
+ {
+ gfc_error ("Source-expr at %L must be scalar or have the "
+ "same rank as the allocate-object at %L",
+ &e1->where, &e2->where);
+ return FAILURE;
+ }
+
+ if (e1->shape)
+ {
+ int i;
+ mpz_t s;
+
+ mpz_init (s);
+
+ for (i = 0; i < e1->rank; i++)
+ {
+ if (e2->ref->u.ar.end[i])
+ {
+ mpz_set (s, e2->ref->u.ar.end[i]->value.integer);
+ mpz_sub (s, s, e2->ref->u.ar.start[i]->value.integer);
+ mpz_add_ui (s, s, 1);
+ }
+ else
+ {
+ mpz_set (s, e2->ref->u.ar.start[i]->value.integer);
+ }
+
+ if (mpz_cmp (e1->shape[i], s) != 0)
+ {
+ gfc_error ("Source-expr at %L and allocate-object at %L must "
+ "have the same shape", &e1->where, &e2->where);
+ mpz_clear (s);
+ return FAILURE;
+ }
+ }
+
+ mpz_clear (s);
+ }
+
+ return SUCCESS;
+}
+
+
/* Resolve the expression in an ALLOCATE statement, doing the additional
checks to see whether the expression is OK or not. The expression must
have a trailing array reference that gives the size of the array. */
@@ -5612,11 +6028,10 @@ gfc_expr_to_initialize (gfc_expr *e)
static gfc_try
resolve_allocate_expr (gfc_expr *e, gfc_code *code)
{
- int i, pointer, allocatable, dimension, check_intent_in;
+ int i, pointer, allocatable, dimension, check_intent_in, is_abstract;
symbol_attribute attr;
gfc_ref *ref, *ref2;
gfc_array_ref *ar;
- gfc_code *init_st;
gfc_symbol *sym;
gfc_alloc *a;
gfc_component *c;
@@ -5634,6 +6049,9 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code)
if (e->symtree)
sym = e->symtree->n.sym;
+ /* Check whether ultimate component is abstract and CLASS. */
+ is_abstract = 0;
+
if (e->expr_type != EXPR_VARIABLE)
{
allocatable = 0;
@@ -5648,6 +6066,7 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code)
allocatable = sym->ts.u.derived->components->attr.allocatable;
pointer = sym->ts.u.derived->components->attr.pointer;
dimension = sym->ts.u.derived->components->attr.dimension;
+ is_abstract = sym->ts.u.derived->components->attr.abstract;
}
else
{
@@ -5675,12 +6094,14 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code)
allocatable = c->ts.u.derived->components->attr.allocatable;
pointer = c->ts.u.derived->components->attr.pointer;
dimension = c->ts.u.derived->components->attr.dimension;
+ is_abstract = c->ts.u.derived->components->attr.abstract;
}
else
{
allocatable = c->attr.allocatable;
pointer = c->attr.pointer;
dimension = c->attr.dimension;
+ is_abstract = c->attr.abstract;
}
break;
@@ -5699,46 +6120,44 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code)
return FAILURE;
}
- if (check_intent_in && sym->attr.intent == INTENT_IN)
- {
- gfc_error ("Cannot allocate INTENT(IN) variable '%s' at %L",
- sym->name, &e->where);
- return FAILURE;
- }
-
- if (e->ts.type == BT_CLASS)
+ /* Some checks for the SOURCE tag. */
+ if (code->expr3)
{
- /* Initialize VINDEX for CLASS objects. */
- init_st = gfc_get_code ();
- init_st->loc = code->loc;
- init_st->expr1 = gfc_expr_to_initialize (e);
- init_st->op = EXEC_ASSIGN;
- gfc_add_component_ref (init_st->expr1, "$vindex");
- if (code->expr3 && code->expr3->ts.type == BT_CLASS)
+ /* Check F03:C631. */
+ if (!gfc_type_compatible (&e->ts, &code->expr3->ts))
{
- /* vindex must be determined at run time. */
- init_st->expr2 = gfc_copy_expr (code->expr3);
- gfc_add_component_ref (init_st->expr2, "$vindex");
+ gfc_error ("Type of entity at %L is type incompatible with "
+ "source-expr at %L", &e->where, &code->expr3->where);
+ return FAILURE;
}
- else
+
+ /* Check F03:C632 and restriction following Note 6.18. */
+ if (code->expr3->rank > 0
+ && conformable_arrays (code->expr3, e) == FAILURE)
+ return FAILURE;
+
+ /* Check F03:C633. */
+ if (code->expr3->ts.kind != e->ts.kind)
{
- /* vindex is fixed at compile time. */
- int vindex;
- if (code->expr3)
- vindex = code->expr3->ts.u.derived->vindex;
- else if (code->ext.alloc.ts.type == BT_DERIVED)
- vindex = code->ext.alloc.ts.u.derived->vindex;
- else if (e->ts.type == BT_CLASS)
- vindex = e->ts.u.derived->components->ts.u.derived->vindex;
- else
- vindex = e->ts.u.derived->vindex;
- init_st->expr2 = gfc_int_expr (vindex);
+ gfc_error ("The allocate-object at %L and the source-expr at %L "
+ "shall have the same kind type parameter",
+ &e->where, &code->expr3->where);
+ return FAILURE;
}
- init_st->expr2->where = init_st->expr1->where = init_st->loc;
- init_st->next = code->next;
- code->next = init_st;
- /* Only allocate the DATA component. */
- gfc_add_component_ref (e, "$data");
+ }
+ else if (is_abstract&& code->ext.alloc.ts.type == BT_UNKNOWN)
+ {
+ gcc_assert (e->ts.type == BT_CLASS);
+ gfc_error ("Allocating %s of ABSTRACT base type at %L requires a "
+ "type-spec or SOURCE=", sym->name, &e->where);
+ return FAILURE;
+ }
+
+ if (check_intent_in && sym->attr.intent == INTENT_IN)
+ {
+ gfc_error ("Cannot allocate INTENT(IN) variable '%s' at %L",
+ sym->name, &e->where);
+ return FAILURE;
}
if (pointer || dimension == 0)
@@ -5790,7 +6209,7 @@ check_symbols:
sym = a->expr->symtree->n.sym;
/* TODO - check derived type components. */
- if (sym->ts.type == BT_DERIVED)
+ if (sym->ts.type == BT_DERIVED || sym->ts.type == BT_CLASS)
continue;
if ((ar->start[i] != NULL
@@ -6444,8 +6863,15 @@ resolve_select_type (gfc_code *code)
gfc_case *c, *default_case;
gfc_symtree *st;
char name[GFC_MAX_SYMBOL_LEN];
+ gfc_namespace *ns;
- selector_type = code->expr1->ts.u.derived->components->ts.u.derived;
+ ns = code->ext.ns;
+ gfc_resolve (ns);
+
+ if (code->expr2)
+ selector_type = code->expr2->ts.u.derived->components->ts.u.derived;
+ else
+ selector_type = code->expr1->ts.u.derived->components->ts.u.derived;
/* Assume there is no DEFAULT case. */
default_case = NULL;
@@ -6487,6 +6913,32 @@ resolve_select_type (gfc_code *code)
}
}
+ if (code->expr2)
+ {
+ /* Insert assignment for selector variable. */
+ new_st = gfc_get_code ();
+ new_st->op = EXEC_ASSIGN;
+ new_st->expr1 = gfc_copy_expr (code->expr1);
+ new_st->expr2 = gfc_copy_expr (code->expr2);
+ ns->code = new_st;
+ }
+
+ /* Put SELECT TYPE statement inside a BLOCK. */
+ new_st = gfc_get_code ();
+ new_st->op = code->op;
+ new_st->expr1 = code->expr1;
+ new_st->expr2 = code->expr2;
+ new_st->block = code->block;
+ if (!ns->code)
+ ns->code = new_st;
+ else
+ ns->code->next = new_st;
+ code->op = EXEC_BLOCK;
+ code->expr1 = code->expr2 = NULL;
+ code->block = NULL;
+
+ code = new_st;
+
/* Transform to EXEC_SELECT. */
code->op = EXEC_SELECT;
gfc_add_component_ref (code->expr1, "$vindex");
@@ -6506,7 +6958,7 @@ resolve_select_type (gfc_code *code)
continue;
/* Assign temporary to selector. */
sprintf (name, "tmp$%s", c->ts.u.derived->name);
- st = gfc_find_symtree (code->expr1->symtree->n.sym->ns->sym_root, name);
+ st = gfc_find_symtree (ns->sym_root, name);
new_st = gfc_get_code ();
new_st->op = EXEC_POINTER_ASSIGN;
new_st->expr1 = gfc_get_variable_expr (st);
@@ -7287,46 +7739,16 @@ resolve_ordinary_assign (gfc_code *code, gfc_namespace *ns)
}
}
- gfc_check_assign (lhs, rhs, 1);
- return false;
-}
-
-
-/* Check an assignment to a CLASS object (pointer or ordinary assignment). */
-
-static void
-resolve_class_assign (gfc_code *code)
-{
- gfc_code *assign_code = gfc_get_code ();
-
- if (code->expr2->ts.type != BT_CLASS)
+ /* F03:7.4.1.2. */
+ if (lhs->ts.type == BT_CLASS)
{
- /* Insert an additional assignment which sets the vindex. */
- assign_code->next = code->next;
- code->next = assign_code;
- assign_code->op = EXEC_ASSIGN;
- assign_code->expr1 = gfc_copy_expr (code->expr1);
- gfc_add_component_ref (assign_code->expr1, "$vindex");
- if (code->expr2->ts.type == BT_DERIVED)
- /* vindex is constant, determined at compile time. */
- assign_code->expr2 = gfc_int_expr (code->expr2->ts.u.derived->vindex);
- else if (code->expr2->ts.type == BT_CLASS)
- {
- /* vindex must be determined at run time. */
- assign_code->expr2 = gfc_copy_expr (code->expr2);
- gfc_add_component_ref (assign_code->expr2, "$vindex");
- }
- else if (code->expr2->expr_type == EXPR_NULL)
- assign_code->expr2 = gfc_int_expr (0);
- else
- gcc_unreachable ();
+ gfc_error ("Variable must not be polymorphic in assignment at %L",
+ &lhs->where);
+ return false;
}
- /* Modify the actual pointer assignment. */
- if (code->expr2->ts.type == BT_CLASS)
- code->op = EXEC_ASSIGN;
- else
- gfc_add_component_ref (code->expr1, "$data");
+ gfc_check_assign (lhs, rhs, 1);
+ return false;
}
@@ -7400,6 +7822,10 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
if (gfc_resolve_expr (code->expr2) == FAILURE)
t = FAILURE;
+ if (code->op == EXEC_ALLOCATE
+ && gfc_resolve_expr (code->expr3) == FAILURE)
+ t = FAILURE;
+
switch (code->op)
{
case EXEC_NOP:
@@ -7452,9 +7878,6 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
if (t == FAILURE)
break;
- if (code->expr1->ts.type == BT_CLASS)
- resolve_class_assign (code);
-
if (resolve_ordinary_assign (code, ns))
{
if (code->op == EXEC_COMPCALL)
@@ -7462,7 +7885,6 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
else
goto call;
}
-
break;
case EXEC_LABEL_ASSIGN:
@@ -7483,11 +7905,7 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
if (t == FAILURE)
break;
- if (code->expr1->ts.type == BT_CLASS)
- resolve_class_assign (code);
-
gfc_check_pointer_assign (code->expr1, code->expr2);
-
break;
case EXEC_ARITHMETIC_IF:
@@ -7517,7 +7935,11 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
case EXEC_COMPCALL:
compcall:
- resolve_typebound_call (code);
+ if (code->expr1->symtree
+ && code->expr1->symtree->n.sym->ts.type == BT_CLASS)
+ resolve_class_typebound_call (code);
+ else
+ resolve_typebound_call (code);
break;
case EXEC_CALL_PPC:
@@ -8219,7 +8641,8 @@ apply_default_init_local (gfc_symbol *sym)
/* For saved variables, we don't want to add an initializer at
function entry, so we just add a static initializer. */
- if (sym->attr.save || sym->ns->save_all)
+ if (sym->attr.save || sym->ns->save_all
+ || gfc_option.flag_max_stack_var_size == 0)
{
/* Don't clobber an existing initializer! */
gcc_assert (sym->value == NULL);
@@ -8333,9 +8756,8 @@ resolve_fl_variable_derived (gfc_symbol *sym, int no_init_flag)
}
/* C509. */
- if (!(sym->attr.dummy || sym->attr.allocatable || sym->attr.pointer
- || sym->ts.u.derived->components->attr.allocatable
- || sym->ts.u.derived->components->attr.pointer))
+ /* Assume that use associated symbols were checked in the module ns. */
+ if (!sym->attr.class_ok && !sym->attr.use_assoc)
{
gfc_error ("CLASS variable '%s' at %L must be dummy, allocatable "
"or pointer", sym->name, &sym->declared_at);
@@ -11724,7 +12146,11 @@ resolve_codes (gfc_namespace *ns)
resolve_codes (n);
gfc_current_ns = ns;
- cs_base = NULL;
+
+ /* Don't clear 'cs_base' if this is the namespace of a BLOCK construct. */
+ if (!(ns->proc_name && ns->proc_name->attr.flavor == FL_LABEL))
+ cs_base = NULL;
+
/* Set to an out of range value. */
current_entry_id = -1;
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index 39285b16fea..c1b39b0d9f1 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -2030,9 +2030,16 @@ gfc_st_label *
gfc_get_st_label (int labelno)
{
gfc_st_label *lp;
+ gfc_namespace *ns;
+
+ /* Find the namespace of the scoping unit:
+ If we're in a BLOCK construct, jump to the parent namespace. */
+ ns = gfc_current_ns;
+ while (ns->proc_name && ns->proc_name->attr.flavor == FL_LABEL)
+ ns = ns->parent;
/* First see if the label is already in this namespace. */
- lp = gfc_current_ns->st_labels;
+ lp = ns->st_labels;
while (lp)
{
if (lp->value == labelno)
@@ -2050,7 +2057,7 @@ gfc_get_st_label (int labelno)
lp->defined = ST_LABEL_UNKNOWN;
lp->referenced = ST_LABEL_UNKNOWN;
- gfc_insert_bbt (&gfc_current_ns->st_labels, lp, compare_st_labels);
+ gfc_insert_bbt (&ns->st_labels, lp, compare_st_labels);
return lp;
}
@@ -2461,6 +2468,19 @@ ambiguous_symbol (const char *name, gfc_symtree *st)
}
+/* If we're in a SELECT TYPE block, check if the variable 'st' matches any
+ selector on the stack. If yes, replace it by the corresponding temporary. */
+
+static void
+select_type_insert_tmp (gfc_symtree **st)
+{
+ gfc_select_type_stack *stack = select_type_stack;
+ for (; stack; stack = stack->prev)
+ if ((*st)->n.sym == stack->selector)
+ *st = stack->tmp;
+}
+
+
/* Search for a symtree starting in the current namespace, resorting to
any parent namespaces if requested by a nonzero parent_flag.
Returns nonzero if the name is ambiguous. */
@@ -2479,6 +2499,8 @@ gfc_find_sym_tree (const char *name, gfc_namespace *ns, int parent_flag,
st = gfc_find_symtree (ns->sym_root, name);
if (st != NULL)
{
+ select_type_insert_tmp (&st);
+
*result = st;
/* Ambiguous generic interfaces are permitted, as long
as the specific interfaces are different. */
@@ -2645,12 +2667,6 @@ gfc_get_ha_sym_tree (const char *name, gfc_symtree **result)
i = gfc_find_sym_tree (name, gfc_current_ns, 0, &st);
- /* Special case: If we're in a SELECT TYPE block,
- replace the selector variable by a temporary. */
- if (gfc_current_state () == COMP_SELECT_TYPE
- && st && st->n.sym == type_selector)
- st = select_type_tmp;
-
if (st != NULL)
{
save_symbol_data (st->n.sym);
@@ -2732,7 +2748,7 @@ gfc_undo_symbols (void)
if (p->gfc_new)
{
/* Symbol was new. */
- if (p->attr.in_common && p->common_block->head)
+ if (p->attr.in_common && p->common_block && p->common_block->head)
{
/* If the symbol was added to any common block, it
needs to be removed to stop the resolver looking
@@ -4579,9 +4595,12 @@ gfc_type_compatible (gfc_typespec *ts1, gfc_typespec *ts2)
if ((ts1->type == BT_DERIVED || ts1->type == BT_CLASS)
&& (ts2->type == BT_DERIVED || ts2->type == BT_CLASS))
{
- if (ts1->type == BT_CLASS)
+ if (ts1->type == BT_CLASS && ts2->type == BT_DERIVED)
return gfc_type_is_extension_of (ts1->u.derived->components->ts.u.derived,
ts2->u.derived);
+ else if (ts1->type == BT_CLASS && ts2->type == BT_CLASS)
+ return gfc_type_is_extension_of (ts1->u.derived->components->ts.u.derived,
+ ts2->u.derived->components->ts.u.derived);
else if (ts2->type != BT_CLASS)
return gfc_compare_derived_types (ts1->u.derived, ts2->u.derived);
else
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index e16200010d1..4e94373133a 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -5906,6 +5906,36 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
tmp = gfc_trans_dealloc_allocated (comp);
gfc_add_expr_to_block (&fnblock, tmp);
}
+ else if (c->attr.allocatable)
+ {
+ /* Allocatable scalar components. */
+ comp = fold_build3 (COMPONENT_REF, ctype, decl, cdecl, NULL_TREE);
+
+ tmp = gfc_deallocate_with_status (comp, NULL_TREE, true, NULL);
+ gfc_add_expr_to_block (&fnblock, tmp);
+
+ tmp = fold_build2 (MODIFY_EXPR, void_type_node, comp,
+ build_int_cst (TREE_TYPE (comp), 0));
+ gfc_add_expr_to_block (&fnblock, tmp);
+ }
+ else if (c->ts.type == BT_CLASS
+ && c->ts.u.derived->components->attr.allocatable)
+ {
+ /* Allocatable scalar CLASS components. */
+ comp = fold_build3 (COMPONENT_REF, ctype, decl, cdecl, NULL_TREE);
+
+ /* Add reference to '$data' component. */
+ tmp = c->ts.u.derived->components->backend_decl;
+ comp = fold_build3 (COMPONENT_REF, TREE_TYPE (tmp),
+ comp, tmp, NULL_TREE);
+
+ tmp = gfc_deallocate_with_status (comp, NULL_TREE, true, NULL);
+ gfc_add_expr_to_block (&fnblock, tmp);
+
+ tmp = fold_build2 (MODIFY_EXPR, void_type_node, comp,
+ build_int_cst (TREE_TYPE (comp), 0));
+ gfc_add_expr_to_block (&fnblock, tmp);
+ }
break;
case NULLIFY_ALLOC_COMP:
@@ -5917,6 +5947,27 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
decl, cdecl, NULL_TREE);
gfc_conv_descriptor_data_set (&fnblock, comp, null_pointer_node);
}
+ else if (c->attr.allocatable)
+ {
+ /* Allocatable scalar components. */
+ comp = fold_build3 (COMPONENT_REF, ctype, decl, cdecl, NULL_TREE);
+ tmp = fold_build2 (MODIFY_EXPR, void_type_node, comp,
+ build_int_cst (TREE_TYPE (comp), 0));
+ gfc_add_expr_to_block (&fnblock, tmp);
+ }
+ else if (c->ts.type == BT_CLASS
+ && c->ts.u.derived->components->attr.allocatable)
+ {
+ /* Allocatable scalar CLASS components. */
+ comp = fold_build3 (COMPONENT_REF, ctype, decl, cdecl, NULL_TREE);
+ /* Add reference to '$data' component. */
+ tmp = c->ts.u.derived->components->backend_decl;
+ comp = fold_build3 (COMPONENT_REF, TREE_TYPE (tmp),
+ comp, tmp, NULL_TREE);
+ tmp = fold_build2 (MODIFY_EXPR, void_type_node, comp,
+ build_int_cst (TREE_TYPE (comp), 0));
+ gfc_add_expr_to_block (&fnblock, tmp);
+ }
else if (cmp_has_alloc_comps)
{
comp = fold_build3 (COMPONENT_REF, ctype,
diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c
index 5b1952aee4a..1fb3c40f113 100644
--- a/gcc/fortran/trans-common.c
+++ b/gcc/fortran/trans-common.c
@@ -680,7 +680,6 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv)
var_decl = build_decl (s->sym->declared_at.lb->location,
VAR_DECL, DECL_NAME (s->field),
TREE_TYPE (s->field));
- TREE_PUBLIC (var_decl) = TREE_PUBLIC (decl);
TREE_STATIC (var_decl) = TREE_STATIC (decl);
TREE_USED (var_decl) = TREE_USED (decl);
if (s->sym->attr.use_assoc)
@@ -689,7 +688,9 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv)
TREE_ADDRESSABLE (var_decl) = 1;
/* This is a fake variable just for debugging purposes. */
TREE_ASM_WRITTEN (var_decl) = 1;
-
+ /* Fake variables are not visible from other translation units. */
+ TREE_PUBLIC (var_decl) = 0;
+
/* To preserve identifier names in COMMON, chain to procedure
scope unless at top level in a module definition. */
if (com
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index ee38efbe27c..200c3f5654c 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -1187,22 +1187,23 @@ gfc_get_symbol_decl (gfc_symbol * sym)
/* Create variables to hold the non-constant bits of array info. */
gfc_build_qualified_array (decl, sym);
- /* Remember this variable for allocation/cleanup. */
- gfc_defer_symbol_init (sym);
-
if ((sym->attr.allocatable || !sym->attr.dummy) && !sym->attr.pointer)
GFC_DECL_PACKED_ARRAY (decl) = 1;
}
- if (sym->ts.type == BT_DERIVED && sym->ts.u.derived->attr.alloc_comp)
- gfc_defer_symbol_init (sym);
- /* This applies a derived type default initializer. */
- else if (sym->ts.type == BT_DERIVED
- && sym->attr.save == SAVE_NONE
- && !sym->attr.data
- && !sym->attr.allocatable
- && (sym->value && !sym->ns->proc_name->attr.is_main_program)
- && !sym->attr.use_assoc)
+ /* Remember this variable for allocation/cleanup. */
+ if (sym->attr.dimension || sym->attr.allocatable
+ || (sym->ts.type == BT_CLASS &&
+ (sym->ts.u.derived->components->attr.dimension
+ || sym->ts.u.derived->components->attr.allocatable))
+ || (sym->ts.type == BT_DERIVED && sym->ts.u.derived->attr.alloc_comp)
+ /* This applies a derived type default initializer. */
+ || (sym->ts.type == BT_DERIVED
+ && sym->attr.save == SAVE_NONE
+ && !sym->attr.data
+ && !sym->attr.allocatable
+ && (sym->value && !sym->ns->proc_name->attr.is_main_program)
+ && !sym->attr.use_assoc))
gfc_defer_symbol_init (sym);
gfc_finish_var_decl (decl, sym);
@@ -3054,7 +3055,8 @@ init_intent_out_dt (gfc_symbol * proc_sym, tree body)
Allocation and initialization of array variables.
Allocation of character string variables.
Initialization and possibly repacking of dummy arrays.
- Initialization of ASSIGN statement auxiliary variable. */
+ Initialization of ASSIGN statement auxiliary variable.
+ Automatic deallocation. */
tree
gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody)
@@ -3182,6 +3184,33 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody)
}
else if (sym_has_alloc_comp)
fnbody = gfc_trans_deferred_array (sym, fnbody);
+ else if (sym->attr.allocatable
+ || (sym->ts.type == BT_CLASS
+ && sym->ts.u.derived->components->attr.allocatable))
+ {
+ /* Automatic deallocatation of allocatable scalars. */
+ tree tmp;
+ gfc_expr *e;
+ gfc_se se;
+ stmtblock_t block;
+
+ e = gfc_lval_expr_from_sym (sym);
+ if (sym->ts.type == BT_CLASS)
+ gfc_add_component_ref (e, "$data");
+
+ gfc_init_se (&se, NULL);
+ se.want_pointer = 1;
+ gfc_conv_expr (&se, e);
+ gfc_free_expr (e);
+
+ gfc_start_block (&block);
+ gfc_add_expr_to_block (&block, fnbody);
+
+ /* Note: Nullifying is not needed. */
+ tmp = gfc_deallocate_with_status (se.expr, NULL_TREE, true, NULL);
+ gfc_add_expr_to_block (&block, tmp);
+ fnbody = gfc_finish_block (&block);
+ }
else if (sym->ts.type == BT_CHARACTER)
{
gfc_get_backend_locus (&loc);
@@ -3747,8 +3776,12 @@ generate_local_decl (gfc_symbol * sym)
else if (warn_unused_variable
&& sym->attr.dummy
&& sym->attr.intent == INTENT_OUT)
- gfc_warning ("Dummy argument '%s' at %L was declared INTENT(OUT) but was not set",
- sym->name, &sym->declared_at);
+ {
+ if (!(sym->ts.type == BT_DERIVED
+ && sym->ts.u.derived->components->initializer))
+ gfc_warning ("Dummy argument '%s' at %L was declared INTENT(OUT) "
+ "but was not set", sym->name, &sym->declared_at);
+ }
/* Specific warning for unused dummy arguments. */
else if (warn_unused_variable && sym->attr.dummy)
gfc_warning ("Unused dummy argument '%s' at %L", sym->name,
@@ -4363,10 +4396,10 @@ gfc_generate_function_code (gfc_namespace * ns)
/* Reset recursion-check variable. */
if ((gfc_option.rtcheck & GFC_RTCHECK_RECURSION) && !is_recursive)
- {
- gfc_add_modify (&block, recurcheckvar, boolean_false_node);
- recurcheckvar = NULL;
- }
+ {
+ gfc_add_modify (&block, recurcheckvar, boolean_false_node);
+ recurcheckvar = NULL;
+ }
if (result == NULL_TREE)
{
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index eb741f8231f..5a45f4f6368 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -1519,15 +1519,142 @@ get_proc_ptr_comp (gfc_expr *e)
e2 = gfc_copy_expr (e);
e2->expr_type = EXPR_VARIABLE;
gfc_conv_expr (&comp_se, e2);
+ gfc_free_expr (e2);
return build_fold_addr_expr_loc (input_location, comp_se.expr);
}
+/* Select a class typebound procedure at runtime. */
+static void
+select_class_proc (gfc_se *se, gfc_class_esym_list *elist,
+ tree declared, gfc_expr *expr)
+{
+ tree end_label;
+ tree label;
+ tree tmp;
+ tree vindex;
+ stmtblock_t body;
+ gfc_class_esym_list *next_elist, *tmp_elist;
+ gfc_se tmpse;
+
+ /* Convert the vindex expression. */
+ gfc_init_se (&tmpse, NULL);
+ gfc_conv_expr (&tmpse, elist->vindex);
+ gfc_add_block_to_block (&se->pre, &tmpse.pre);
+ vindex = gfc_evaluate_now (tmpse.expr, &se->pre);
+ gfc_add_block_to_block (&se->post, &tmpse.post);
+
+ /* Fix the function type to be that of the declared type method. */
+ declared = gfc_create_var (TREE_TYPE (declared), "method");
+
+ end_label = gfc_build_label_decl (NULL_TREE);
+
+ gfc_init_block (&body);
+
+ /* Go through the list of extensions. */
+ for (; elist; elist = next_elist)
+ {
+ /* This case has already been added. */
+ if (elist->derived == NULL)
+ goto free_elist;
+
+ /* Run through the chain picking up all the cases that call the
+ same procedure. */
+ tmp_elist = elist;
+ for (; elist; elist = elist->next)
+ {
+ tree cval;
+
+ if (elist->esym != tmp_elist->esym)
+ continue;
+
+ cval = build_int_cst (TREE_TYPE (vindex),
+ elist->derived->vindex);
+ /* Build a label for the vindex value. */
+ label = gfc_build_label_decl (NULL_TREE);
+ tmp = fold_build3 (CASE_LABEL_EXPR, void_type_node,
+ cval, NULL_TREE, label);
+ gfc_add_expr_to_block (&body, tmp);
+
+ /* Null the reference the derived type so that this case is
+ not used again. */
+ elist->derived = NULL;
+ }
+
+ elist = tmp_elist;
+
+ /* Get a pointer to the procedure, */
+ tmp = gfc_get_symbol_decl (elist->esym);
+ if (!POINTER_TYPE_P (TREE_TYPE (tmp)))
+ {
+ gcc_assert (TREE_CODE (tmp) == FUNCTION_DECL);
+ tmp = gfc_build_addr_expr (NULL_TREE, tmp);
+ }
+
+ /* Assign the pointer to the appropriate procedure. */
+ gfc_add_modify (&body, declared,
+ fold_convert (TREE_TYPE (declared), tmp));
+
+ /* Break to the end of the construct. */
+ tmp = build1_v (GOTO_EXPR, end_label);
+ gfc_add_expr_to_block (&body, tmp);
+
+ /* Free the elists as we go; freeing them in gfc_free_expr causes
+ segfaults because it occurs too early and too often. */
+ free_elist:
+ next_elist = elist->next;
+ if (elist->vindex)
+ gfc_free_expr (elist->vindex);
+ gfc_free (elist);
+ elist = NULL;
+ }
+
+ /* Default is an error. */
+ label = gfc_build_label_decl (NULL_TREE);
+ tmp = fold_build3 (CASE_LABEL_EXPR, void_type_node,
+ NULL_TREE, NULL_TREE, label);
+ gfc_add_expr_to_block (&body, tmp);
+ tmp = gfc_trans_runtime_error (true, &expr->where,
+ "internal error: bad vindex in dynamic dispatch");
+ gfc_add_expr_to_block (&body, tmp);
+
+ /* Write the switch expression. */
+ tmp = gfc_finish_block (&body);
+ tmp = build3_v (SWITCH_EXPR, vindex, tmp, NULL_TREE);
+ gfc_add_expr_to_block (&se->pre, tmp);
+
+ tmp = build1_v (LABEL_EXPR, end_label);
+ gfc_add_expr_to_block (&se->pre, tmp);
+
+ se->expr = declared;
+ return;
+}
+
+
static void
conv_function_val (gfc_se * se, gfc_symbol * sym, gfc_expr * expr)
{
tree tmp;
+ if (expr && expr->symtree
+ && expr->value.function.class_esym)
+ {
+ if (!sym->backend_decl)
+ sym->backend_decl = gfc_get_extern_function_decl (sym);
+
+ tmp = sym->backend_decl;
+
+ if (!POINTER_TYPE_P (TREE_TYPE (tmp)))
+ {
+ gcc_assert (TREE_CODE (tmp) == FUNCTION_DECL);
+ tmp = gfc_build_addr_expr (NULL_TREE, tmp);
+ }
+
+ select_class_proc (se, expr->value.function.class_esym,
+ tmp, expr);
+ return;
+ }
+
if (gfc_is_proc_ptr_comp (expr, NULL))
tmp = get_proc_ptr_comp (expr);
else if (sym->attr.dummy)
@@ -2651,6 +2778,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
{
tree data;
tree vindex;
+ tree size;
/* The derived type needs to be converted to a temporary
CLASS object. */
@@ -2664,13 +2792,20 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
var, tmp, NULL_TREE);
tmp = fsym->ts.u.derived->components->next->backend_decl;
vindex = fold_build3 (COMPONENT_REF, TREE_TYPE (tmp),
+ var, tmp, NULL_TREE);
+ tmp = fsym->ts.u.derived->components->next->next->backend_decl;
+ size = fold_build3 (COMPONENT_REF, TREE_TYPE (tmp),
var, tmp, NULL_TREE);
/* Set the vindex. */
- tmp = build_int_cst (TREE_TYPE (vindex),
- e->ts.u.derived->vindex);
+ tmp = build_int_cst (TREE_TYPE (vindex), e->ts.u.derived->vindex);
gfc_add_modify (&parmse.pre, vindex, tmp);
+ /* Set the size. */
+ tmp = TYPE_SIZE_UNIT (gfc_typenode_for_spec (&e->ts));
+ gfc_add_modify (&parmse.pre, size,
+ fold_convert (TREE_TYPE (size), tmp));
+
/* Now set the data field. */
argss = gfc_walk_expr (e);
if (argss == gfc_ss_terminator)
@@ -2735,8 +2870,11 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
through arg->name. */
conv_arglist_function (&parmse, arg->expr, arg->name);
else if ((e->expr_type == EXPR_FUNCTION)
- && e->symtree->n.sym->attr.pointer
- && fsym && fsym->attr.target)
+ && ((e->value.function.esym
+ && e->value.function.esym->result->attr.pointer)
+ || (!e->value.function.esym
+ && e->symtree->n.sym->attr.pointer))
+ && fsym && fsym->attr.target)
{
gfc_conv_expr (&parmse, e);
parmse.expr = gfc_build_addr_expr (NULL_TREE, parmse.expr);
@@ -2754,6 +2892,37 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
else
{
gfc_conv_expr_reference (&parmse, e);
+
+ /* If an ALLOCATABLE dummy argument has INTENT(OUT) and is
+ allocated on entry, it must be deallocated. */
+ if (fsym && fsym->attr.allocatable
+ && fsym->attr.intent == INTENT_OUT)
+ {
+ stmtblock_t block;
+
+ gfc_init_block (&block);
+ tmp = gfc_deallocate_with_status (parmse.expr, NULL_TREE,
+ true, NULL);
+ gfc_add_expr_to_block (&block, tmp);
+ tmp = fold_build2 (MODIFY_EXPR, void_type_node,
+ parmse.expr, null_pointer_node);
+ gfc_add_expr_to_block (&block, tmp);
+
+ if (fsym->attr.optional
+ && e->expr_type == EXPR_VARIABLE
+ && e->symtree->n.sym->attr.optional)
+ {
+ tmp = fold_build3 (COND_EXPR, void_type_node,
+ gfc_conv_expr_present (e->symtree->n.sym),
+ gfc_finish_block (&block),
+ build_empty_stmt (input_location));
+ }
+ else
+ tmp = gfc_finish_block (&block);
+
+ gfc_add_expr_to_block (&se->pre, tmp);
+ }
+
if (fsym && e->expr_type != EXPR_NULL
&& ((fsym->attr.pointer
&& fsym->attr.flavor != FL_PROCEDURE)
@@ -2761,7 +2930,8 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
&& !(e->expr_type == EXPR_VARIABLE
&& e->symtree->n.sym->attr.dummy))
|| (e->expr_type == EXPR_VARIABLE
- && gfc_is_proc_ptr_comp (e, NULL))))
+ && gfc_is_proc_ptr_comp (e, NULL))
+ || fsym->attr.allocatable))
{
/* Scalar pointer dummy args require an extra level of
indirection. The null pointer already contains
@@ -2797,17 +2967,22 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
gfc_conv_array_parameter (&parmse, e, argss, f, fsym,
sym->name, NULL);
- /* If an ALLOCATABLE dummy argument has INTENT(OUT) and is
- allocated on entry, it must be deallocated. */
- if (fsym && fsym->attr.allocatable
- && fsym->attr.intent == INTENT_OUT)
- {
- tmp = build_fold_indirect_ref_loc (input_location,
- parmse.expr);
- tmp = gfc_trans_dealloc_allocated (tmp);
- gfc_add_expr_to_block (&se->pre, tmp);
- }
-
+ /* If an ALLOCATABLE dummy argument has INTENT(OUT) and is
+ allocated on entry, it must be deallocated. */
+ if (fsym && fsym->attr.allocatable
+ && fsym->attr.intent == INTENT_OUT)
+ {
+ tmp = build_fold_indirect_ref_loc (input_location,
+ parmse.expr);
+ tmp = gfc_trans_dealloc_allocated (tmp);
+ if (fsym->attr.optional
+ && e->expr_type == EXPR_VARIABLE
+ && e->symtree->n.sym->attr.optional)
+ tmp = fold_build3 (COND_EXPR, void_type_node,
+ gfc_conv_expr_present (e->symtree->n.sym),
+ tmp, build_empty_stmt (input_location));
+ gfc_add_expr_to_block (&se->pre, tmp);
+ }
}
}
@@ -2819,9 +2994,23 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
if (e && (fsym == NULL || fsym->attr.optional))
{
/* If an optional argument is itself an optional dummy argument,
- check its presence and substitute a null if absent. */
+ check its presence and substitute a null if absent. This is
+ only needed when passing an array to an elemental procedure
+ as then array elements are accessed - or no NULL pointer is
+ allowed and a "1" or "0" should be passed if not present.
+ When passing a non-array-descriptor full array to a
+ non-array-descriptor dummy, no check is needed. For
+ array-descriptor actual to array-descriptor dummy, see
+ PR 41911 for why a check has to be inserted.
+ fsym == NULL is checked as intrinsics required the descriptor
+ but do not always set fsym. */
if (e->expr_type == EXPR_VARIABLE
- && e->symtree->n.sym->attr.optional)
+ && e->symtree->n.sym->attr.optional
+ && ((e->rank > 0 && sym->attr.elemental)
+ || e->representation.length || e->ts.type == BT_CHARACTER
+ || (e->rank > 0
+ && (fsym == NULL || fsym->as->type == AS_ASSUMED_SHAPE
+ || fsym->as->type == AS_DEFERRED))))
gfc_conv_missing_dummy (&parmse, e, fsym ? fsym->ts : e->ts,
e->representation.length);
}
@@ -3015,7 +3204,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
cl.backend_decl = formal->sym->ts.u.cl->backend_decl;
}
}
- else
+ else
{
tree tmp;
@@ -4233,8 +4422,12 @@ gfc_conv_expr_reference (gfc_se * se, gfc_expr * expr)
}
if (expr->expr_type == EXPR_FUNCTION
- && expr->symtree->n.sym->attr.pointer
- && !expr->symtree->n.sym->attr.dimension)
+ && ((expr->value.function.esym
+ && expr->value.function.esym->result->attr.pointer
+ && !expr->value.function.esym->result->attr.dimension)
+ || (!expr->value.function.esym
+ && expr->symtree->n.sym->attr.pointer
+ && !expr->symtree->n.sym->attr.dimension)))
{
se->want_pointer = 1;
gfc_conv_expr (se, expr);
@@ -4525,12 +4718,11 @@ gfc_trans_scalar_assign (gfc_se * lse, gfc_se * rse, gfc_typespec ts,
gfc_add_expr_to_block (&block, tmp);
}
}
- else if (ts.type == BT_DERIVED)
+ else if (ts.type == BT_DERIVED || ts.type == BT_CLASS)
{
gfc_add_block_to_block (&block, &lse->pre);
gfc_add_block_to_block (&block, &rse->pre);
- tmp = gfc_evaluate_now (rse->expr, &block);
- tmp = fold_build1 (VIEW_CONVERT_EXPR, TREE_TYPE (lse->expr), tmp);
+ tmp = fold_build1 (VIEW_CONVERT_EXPR, TREE_TYPE (lse->expr), rse->expr);
gfc_add_modify (&block, lse->expr, tmp);
}
else
@@ -5137,3 +5329,75 @@ gfc_trans_assign (gfc_code * code)
{
return gfc_trans_assignment (code->expr1, code->expr2, false);
}
+
+
+/* Translate an assignment to a CLASS object
+ (pointer or ordinary assignment). */
+
+tree
+gfc_trans_class_assign (gfc_code *code)
+{
+ stmtblock_t block;
+ tree tmp;
+
+ gfc_start_block (&block);
+
+ if (code->expr2->ts.type != BT_CLASS)
+ {
+ /* Insert an additional assignment which sets the '$vindex' field. */
+ gfc_expr *lhs,*rhs;
+ lhs = gfc_copy_expr (code->expr1);
+ gfc_add_component_ref (lhs, "$vindex");
+ if (code->expr2->ts.type == BT_DERIVED)
+ /* vindex is constant, determined at compile time. */
+ rhs = gfc_int_expr (code->expr2->ts.u.derived->vindex);
+ else if (code->expr2->expr_type == EXPR_NULL)
+ rhs = gfc_int_expr (0);
+ else
+ gcc_unreachable ();
+ tmp = gfc_trans_assignment (lhs, rhs, false);
+ gfc_add_expr_to_block (&block, tmp);
+
+ /* Insert another assignment which sets the '$size' field. */
+ lhs = gfc_copy_expr (code->expr1);
+ gfc_add_component_ref (lhs, "$size");
+ if (code->expr2->ts.type == BT_DERIVED)
+ {
+ /* Size is fixed at compile time. */
+ gfc_se lse;
+ gfc_init_se (&lse, NULL);
+ gfc_conv_expr (&lse, lhs);
+ tmp = TYPE_SIZE_UNIT (gfc_typenode_for_spec (&code->expr2->ts));
+ gfc_add_modify (&block, lse.expr,
+ fold_convert (TREE_TYPE (lse.expr), tmp));
+ }
+ else if (code->expr2->expr_type == EXPR_NULL)
+ {
+ rhs = gfc_int_expr (0);
+ tmp = gfc_trans_assignment (lhs, rhs, false);
+ gfc_add_expr_to_block (&block, tmp);
+ }
+ else
+ gcc_unreachable ();
+
+ gfc_free_expr (lhs);
+ gfc_free_expr (rhs);
+ }
+
+ /* Do the actual CLASS assignment. */
+ if (code->expr2->ts.type == BT_CLASS)
+ code->op = EXEC_ASSIGN;
+ else
+ gfc_add_component_ref (code->expr1, "$data");
+
+ if (code->op == EXEC_ASSIGN)
+ tmp = gfc_trans_assign (code);
+ else if (code->op == EXEC_POINTER_ASSIGN)
+ tmp = gfc_trans_pointer_assign (code);
+ else
+ gcc_unreachable();
+
+ gfc_add_expr_to_block (&block, tmp);
+
+ return gfc_finish_block (&block);
+}
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index 1e7b35f5c17..c3d7dfbab3c 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -4490,6 +4490,8 @@ gfc_conv_intrinsic_transfer (gfc_se * se, gfc_expr * expr)
scalar_transfer:
extent = fold_build2 (MIN_EXPR, gfc_array_index_type,
dest_word_len, source_bytes);
+ extent = fold_build2 (MAX_EXPR, gfc_array_index_type,
+ extent, gfc_index_zero_node);
if (expr->ts.type == BT_CHARACTER)
{
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index 56534ccdd38..4d461cfa488 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -1641,11 +1641,6 @@ gfc_trans_omp_workshare (gfc_code *code, gfc_omp_clauses *clauses)
if (res != NULL_TREE && ! IS_EMPTY_STMT (res))
{
- if (TREE_CODE (res) == STATEMENT_LIST)
- tree_annotate_all_with_location (&res, input_location);
- else
- SET_EXPR_LOCATION (res, input_location);
-
if (prev_singleunit)
{
if (ompws_flags & OMPWS_CURR_SINGLEUNIT)
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index 9d3197d11bc..9b2a6230853 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -159,31 +159,15 @@ gfc_trans_goto (gfc_code * code)
assigned_goto = GFC_DECL_ASSIGN_ADDR (se.expr);
- code = code->block;
- if (code == NULL)
- {
- target = fold_build1 (GOTO_EXPR, void_type_node, assigned_goto);
- gfc_add_expr_to_block (&se.pre, target);
- return gfc_finish_block (&se.pre);
- }
-
- /* Check the label list. */
- do
- {
- target = gfc_get_label_decl (code->label1);
- tmp = gfc_build_addr_expr (pvoid_type_node, target);
- tmp = fold_build2 (EQ_EXPR, boolean_type_node, tmp, assigned_goto);
- tmp = build3_v (COND_EXPR, tmp,
- fold_build1 (GOTO_EXPR, void_type_node, target),
- build_empty_stmt (input_location));
- gfc_add_expr_to_block (&se.pre, tmp);
- code = code->block;
- }
- while (code != NULL);
- gfc_trans_runtime_check (true, false, boolean_true_node, &se.pre, &loc,
- "Assigned label is not in the list");
-
- return gfc_finish_block (&se.pre);
+ /* We're going to ignore a label list. It does not really change the
+ statement's semantics (because it is just a further restriction on
+ what's legal code); before, we were comparing label addresses here, but
+ that's a very fragile business and may break with optimization. So
+ just ignore it. */
+
+ target = fold_build1 (GOTO_EXPR, void_type_node, assigned_goto);
+ gfc_add_expr_to_block (&se.pre, target);
+ return gfc_finish_block (&se.pre);
}
@@ -3992,19 +3976,20 @@ tree
gfc_trans_allocate (gfc_code * code)
{
gfc_alloc *al;
- gfc_expr *expr, *init_e, *rhs;
+ gfc_expr *expr, *init_e;
gfc_se se;
tree tmp;
tree parm;
tree stat;
tree pstat;
tree error_label;
+ tree memsz;
stmtblock_t block;
if (!code->ext.alloc.list)
return NULL_TREE;
- pstat = stat = error_label = tmp = NULL_TREE;
+ pstat = stat = error_label = tmp = memsz = NULL_TREE;
gfc_start_block (&block);
@@ -4022,7 +4007,10 @@ gfc_trans_allocate (gfc_code * code)
for (al = code->ext.alloc.list; al != NULL; al = al->next)
{
- expr = al->expr;
+ expr = gfc_copy_expr (al->expr);
+
+ if (expr->ts.type == BT_CLASS)
+ gfc_add_component_ref (expr, "$data");
gfc_init_se (&se, NULL);
gfc_start_block (&se.pre);
@@ -4038,25 +4026,26 @@ gfc_trans_allocate (gfc_code * code)
/* Determine allocate size. */
if (code->expr3 && code->expr3->ts.type == BT_CLASS)
{
- gfc_typespec *ts;
- /* TODO: Size must be determined at run time, since it must equal
- the size of the dynamic type of SOURCE, not the declared type. */
- gfc_warning ("Dynamic size allocation at %L not supported yet, "
- "using size of declared type", &code->loc);
- ts = &code->expr3->ts.u.derived->components->ts;
- tmp = TYPE_SIZE_UNIT (gfc_typenode_for_spec (ts));
+ gfc_expr *sz;
+ gfc_se se_sz;
+ sz = gfc_copy_expr (code->expr3);
+ gfc_add_component_ref (sz, "$size");
+ gfc_init_se (&se_sz, NULL);
+ gfc_conv_expr (&se_sz, sz);
+ gfc_free_expr (sz);
+ memsz = se_sz.expr;
}
else if (code->expr3 && code->expr3->ts.type != BT_CLASS)
- tmp = TYPE_SIZE_UNIT (gfc_typenode_for_spec (&code->expr3->ts));
+ memsz = TYPE_SIZE_UNIT (gfc_typenode_for_spec (&code->expr3->ts));
else if (code->ext.alloc.ts.type != BT_UNKNOWN)
- tmp = TYPE_SIZE_UNIT (gfc_typenode_for_spec (&code->ext.alloc.ts));
+ memsz = TYPE_SIZE_UNIT (gfc_typenode_for_spec (&code->ext.alloc.ts));
else
- tmp = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (se.expr)));
+ memsz = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (se.expr)));
- if (expr->ts.type == BT_CHARACTER && tmp == NULL_TREE)
- tmp = se.string_length;
+ if (expr->ts.type == BT_CHARACTER && memsz == NULL_TREE)
+ memsz = se.string_length;
- tmp = gfc_allocate_with_status (&se.pre, tmp, pstat);
+ tmp = gfc_allocate_with_status (&se.pre, memsz, pstat);
tmp = fold_build2 (MODIFY_EXPR, void_type_node, se.expr,
fold_convert (TREE_TYPE (se.expr), tmp));
gfc_add_expr_to_block (&se.pre, tmp);
@@ -4086,17 +4075,91 @@ gfc_trans_allocate (gfc_code * code)
/* Initialization via SOURCE block. */
if (code->expr3)
{
- rhs = gfc_copy_expr (code->expr3);
- if (rhs->ts.type == BT_CLASS)
- gfc_add_component_ref (rhs, "$data");
- tmp = gfc_trans_assignment (gfc_expr_to_initialize (expr), rhs, false);
+ gfc_expr *rhs = gfc_copy_expr (code->expr3);
+ if (al->expr->ts.type == BT_CLASS)
+ {
+ gfc_se dst,src;
+ if (rhs->ts.type == BT_CLASS)
+ gfc_add_component_ref (rhs, "$data");
+ gfc_init_se (&dst, NULL);
+ gfc_init_se (&src, NULL);
+ gfc_conv_expr (&dst, expr);
+ gfc_conv_expr (&src, rhs);
+ gfc_add_block_to_block (&block, &src.pre);
+ tmp = gfc_build_memcpy_call (dst.expr, src.expr, memsz);
+ }
+ else
+ tmp = gfc_trans_assignment (gfc_expr_to_initialize (expr),
+ rhs, false);
+ gfc_free_expr (rhs);
+ gfc_add_expr_to_block (&block, tmp);
+ }
+ /* Default initializer for CLASS variables. */
+ else if (al->expr->ts.type == BT_CLASS
+ && code->ext.alloc.ts.type == BT_DERIVED
+ && (init_e = gfc_default_initializer (&code->ext.alloc.ts)))
+ {
+ gfc_se dst,src;
+ gfc_init_se (&dst, NULL);
+ gfc_init_se (&src, NULL);
+ gfc_conv_expr (&dst, expr);
+ gfc_conv_expr (&src, init_e);
+ gfc_add_block_to_block (&block, &src.pre);
+ tmp = gfc_build_memcpy_call (dst.expr, src.expr, memsz);
gfc_add_expr_to_block (&block, tmp);
}
/* Add default initializer for those derived types that need them. */
- else if (expr->ts.type == BT_DERIVED && (init_e = gfc_default_initializer (&expr->ts)))
+ else if (expr->ts.type == BT_DERIVED
+ && (init_e = gfc_default_initializer (&expr->ts)))
+ {
+ tmp = gfc_trans_assignment (gfc_expr_to_initialize (expr),
+ init_e, true);
+ gfc_add_expr_to_block (&block, tmp);
+ }
+
+ /* Allocation of CLASS entities. */
+ gfc_free_expr (expr);
+ expr = al->expr;
+ if (expr->ts.type == BT_CLASS)
{
- tmp = gfc_trans_assignment (gfc_expr_to_initialize (expr), init_e, true);
+ gfc_expr *lhs,*rhs;
+ gfc_se lse;
+ /* Initialize VINDEX for CLASS objects. */
+ lhs = gfc_expr_to_initialize (expr);
+ gfc_add_component_ref (lhs, "$vindex");
+ if (code->expr3 && code->expr3->ts.type == BT_CLASS)
+ {
+ /* vindex must be determined at run time. */
+ rhs = gfc_copy_expr (code->expr3);
+ gfc_add_component_ref (rhs, "$vindex");
+ }
+ else
+ {
+ /* vindex is fixed at compile time. */
+ int vindex;
+ if (code->expr3)
+ vindex = code->expr3->ts.u.derived->vindex;
+ else if (code->ext.alloc.ts.type == BT_DERIVED)
+ vindex = code->ext.alloc.ts.u.derived->vindex;
+ else if (expr->ts.type == BT_CLASS)
+ vindex = expr->ts.u.derived->components->ts.u.derived->vindex;
+ else
+ vindex = expr->ts.u.derived->vindex;
+ rhs = gfc_int_expr (vindex);
+ }
+ tmp = gfc_trans_assignment (lhs, rhs, false);
+ gfc_free_expr (lhs);
+ gfc_free_expr (rhs);
gfc_add_expr_to_block (&block, tmp);
+
+ /* Initialize SIZE for CLASS objects. */
+ lhs = gfc_expr_to_initialize (expr);
+ gfc_add_component_ref (lhs, "$size");
+ gfc_init_se (&lse, NULL);
+ gfc_conv_expr (&lse, lhs);
+ gfc_add_modify (&block, lse.expr,
+ fold_convert (TREE_TYPE (lse.expr), memsz));
+ gfc_free_expr (lhs);
}
}
diff --git a/gcc/fortran/trans-stmt.h b/gcc/fortran/trans-stmt.h
index 0b8461c4e15..e6faacd0022 100644
--- a/gcc/fortran/trans-stmt.h
+++ b/gcc/fortran/trans-stmt.h
@@ -29,6 +29,7 @@ tree gfc_trans_code (gfc_code *);
tree gfc_trans_assign (gfc_code *);
tree gfc_trans_pointer_assign (gfc_code *);
tree gfc_trans_init_assign (gfc_code *);
+tree gfc_trans_class_assign (gfc_code *code);
/* trans-stmt.c */
tree gfc_trans_cycle (gfc_code *);
diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c
index 09b424c378f..42d22388105 100644
--- a/gcc/fortran/trans.c
+++ b/gcc/fortran/trans.c
@@ -1079,7 +1079,10 @@ gfc_trans_code (gfc_code * code)
break;
case EXEC_ASSIGN:
- res = gfc_trans_assign (code);
+ if (code->expr1->ts.type == BT_CLASS)
+ res = gfc_trans_class_assign (code);
+ else
+ res = gfc_trans_assign (code);
break;
case EXEC_LABEL_ASSIGN:
@@ -1087,7 +1090,10 @@ gfc_trans_code (gfc_code * code)
break;
case EXEC_POINTER_ASSIGN:
- res = gfc_trans_pointer_assign (code);
+ if (code->expr1->ts.type == BT_CLASS)
+ res = gfc_trans_class_assign (code);
+ else
+ res = gfc_trans_pointer_assign (code);
break;
case EXEC_INIT_ASSIGN:
@@ -1275,9 +1281,7 @@ gfc_trans_code (gfc_code * code)
if (res != NULL_TREE && ! IS_EMPTY_STMT (res))
{
- if (TREE_CODE (res) == STATEMENT_LIST)
- tree_annotate_all_with_location (&res, input_location);
- else
+ if (TREE_CODE (res) != STATEMENT_LIST)
SET_EXPR_LOCATION (res, input_location);
/* Add the new statement to the block. */
diff --git a/gcc/fwprop.c b/gcc/fwprop.c
index d3ed74298c0..75a354ea54d 100644
--- a/gcc/fwprop.c
+++ b/gcc/fwprop.c
@@ -375,11 +375,12 @@ canonicalize_address (rtx x)
static bool
should_replace_address (rtx old_rtx, rtx new_rtx, enum machine_mode mode,
- bool speed)
+ addr_space_t as, bool speed)
{
int gain;
- if (rtx_equal_p (old_rtx, new_rtx) || !memory_address_p (mode, new_rtx))
+ if (rtx_equal_p (old_rtx, new_rtx)
+ || !memory_address_addr_space_p (mode, new_rtx, as))
return false;
/* Copy propagation is always ok. */
@@ -387,7 +388,8 @@ should_replace_address (rtx old_rtx, rtx new_rtx, enum machine_mode mode,
return true;
/* Prefer the new address if it is less expensive. */
- gain = address_cost (old_rtx, mode, speed) - address_cost (new_rtx, mode, speed);
+ gain = (address_cost (old_rtx, mode, as, speed)
+ - address_cost (new_rtx, mode, as, speed));
/* If the addresses have equivalent cost, prefer the new address
if it has the highest `rtx_cost'. That has the potential of
@@ -555,6 +557,7 @@ propagate_rtx_1 (rtx *px, rtx old_rtx, rtx new_rtx, int flags)
/* Copy propagations are always ok. Otherwise check the costs. */
if (!(REG_P (old_rtx) && REG_P (new_rtx))
&& !should_replace_address (op0, new_op0, GET_MODE (x),
+ MEM_ADDR_SPACE (x),
flags & PR_OPTIMIZE_FOR_SPEED))
return true;
diff --git a/gcc/gcc-plugin.h b/gcc/gcc-plugin.h
index 1792c0393a2..2e36f486262 100644
--- a/gcc/gcc-plugin.h
+++ b/gcc/gcc-plugin.h
@@ -43,6 +43,7 @@ enum plugin_event
PLUGIN_REGISTER_GGC_CACHES, /* Register an extra GGC cache table. */
PLUGIN_ATTRIBUTES, /* Called during attribute registration. */
PLUGIN_START_UNIT, /* Called before processing a translation unit. */
+ PLUGIN_PRAGMAS, /* Called during pragma registration. */
PLUGIN_EVENT_LAST /* Dummy event used for indexing callback
array. */
};
diff --git a/gcc/gcc.c b/gcc/gcc.c
index a9ed7e21696..6bc8e150a67 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -684,9 +684,15 @@ proper position among the other output files. */
#endif
/* config.h can define SWITCHES_NEED_SPACES to control which options
- require spaces between the option and the argument. */
+ require spaces between the option and the argument.
+
+ We define SWITCHES_NEED_SPACES to include "o" by default. This
+ causes "-ofoo.o" to be split into "-o foo.o" during the initial
+ processing of the command-line, before being seen by the specs
+ machinery. This makes sure we record "foo.o" as the temporary file
+ to be deleted in the case of error, rather than "-ofoo.o". */
#ifndef SWITCHES_NEED_SPACES
-#define SWITCHES_NEED_SPACES ""
+#define SWITCHES_NEED_SPACES "o"
#endif
/* config.h can define ENDFILE_SPEC to override the default crtn files. */
@@ -764,10 +770,24 @@ proper position among the other output files. */
/* We want %{T*} after %{L*} and %D so that it can be used to specify linker
scripts which exist in user specified directories, or in standard
directories. */
+/* We pass any -flto and -fwhopr flags on to the linker, which is expected
+ to understand them. In practice, this means it had better be collect2. */
#ifndef LINK_COMMAND_SPEC
#define LINK_COMMAND_SPEC "\
%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
- %(linker) %l " LINK_PIE_SPEC "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\
+ %(linker) \
+ %{fuse-linker-plugin: \
+ -plugin %(linker_plugin_file) \
+ -plugin-opt=%(lto_wrapper) \
+ -plugin-opt=%(lto_gcc) \
+ %{static|static-libgcc:-plugin-opt=-pass-through=%(lto_libgcc)} \
+ %{static:-plugin-opt=-pass-through=-lc} \
+ %{O*:-plugin-opt=-O%*} \
+ %{w:-plugin-opt=-w} \
+ %{f*:-plugin-opt=-f%*} \
+ } \
+ %{flto} %{fwhopr} %l " LINK_PIE_SPEC \
+ "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
%{static:} %{L*} %(mfwrap) %(link_libgcc) %o\
%{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)} %(mflib)\
@@ -815,6 +835,10 @@ static const char *endfile_spec = ENDFILE_SPEC;
static const char *startfile_spec = STARTFILE_SPEC;
static const char *switches_need_spaces = SWITCHES_NEED_SPACES;
static const char *linker_name_spec = LINKER_NAME;
+static const char *linker_plugin_file_spec = "";
+static const char *lto_wrapper_spec = "";
+static const char *lto_gcc_spec = "";
+static const char *lto_libgcc_spec = "";
static const char *link_command_spec = LINK_COMMAND_SPEC;
static const char *link_libgcc_spec = LINK_LIBGCC_SPEC;
static const char *startfile_prefix_spec = STARTFILE_PREFIX_SPEC;
@@ -891,11 +915,15 @@ static const char *asm_options =
static const char *invoke_as =
#ifdef AS_NEEDS_DASH_FOR_PIPED_INPUT
-"%{fcompare-debug=*|fdump-final-insns=*:%:compare-debug-dump-opt()}\
- %{!S:-o %|.s |\n as %(asm_options) %|.s %A }";
+"%{!fwpa:\
+ %{fcompare-debug=*|fdump-final-insns=*:%:compare-debug-dump-opt()}\
+ %{!S:-o %|.s |\n as %(asm_options) %|.s %A }\
+ }";
#else
-"%{fcompare-debug=*|fdump-final-insns=*:%:compare-debug-dump-opt()}\
- %{!S:-o %|.s |\n as %(asm_options) %m.s %A }";
+"%{!fwpa:\
+ %{fcompare-debug=*|fdump-final-insns=*:%:compare-debug-dump-opt()}\
+ %{!S:-o %|.s |\n as %(asm_options) %m.s %A }\
+ }";
#endif
/* Some compilers have limits on line lengths, and the multilib_select
@@ -962,7 +990,7 @@ static struct user_specs *user_specs_head, *user_specs_tail;
#ifdef HAVE_TARGET_EXECUTABLE_SUFFIX
/* This defines which switches stop a full compilation. */
#define DEFAULT_SWITCH_CURTAILS_COMPILATION(CHAR) \
- ((CHAR) == 'c' || (CHAR) == 'S')
+ ((CHAR) == 'c' || (CHAR) == 'S' || (CHAR) == 'E')
#ifndef SWITCH_CURTAILS_COMPILATION
#define SWITCH_CURTAILS_COMPILATION(CHAR) \
@@ -1653,6 +1681,10 @@ static struct spec_list static_specs[] =
INIT_STATIC_SPEC ("multilib_exclusions", &multilib_exclusions),
INIT_STATIC_SPEC ("multilib_options", &multilib_options),
INIT_STATIC_SPEC ("linker", &linker_name_spec),
+ INIT_STATIC_SPEC ("linker_plugin_file", &linker_plugin_file_spec),
+ INIT_STATIC_SPEC ("lto_wrapper", &lto_wrapper_spec),
+ INIT_STATIC_SPEC ("lto_gcc", &lto_gcc_spec),
+ INIT_STATIC_SPEC ("lto_libgcc", &lto_libgcc_spec),
INIT_STATIC_SPEC ("link_libgcc", &link_libgcc_spec),
INIT_STATIC_SPEC ("md_exec_prefix", &md_exec_prefix),
INIT_STATIC_SPEC ("md_startfile_prefix", &md_startfile_prefix),
@@ -1974,7 +2006,7 @@ static int argbuf_index;
static int have_o_argbuf_index = 0;
-/* Were the options -c or -S passed. */
+/* Were the options -c, -S or -E passed. */
static int have_c = 0;
/* Was the option -o passed. */
@@ -4116,6 +4148,7 @@ process_command (int argc, const char **argv)
case 'S':
case 'c':
+ case 'E':
if (p[1] == 0)
{
have_c = 1;
@@ -4131,7 +4164,7 @@ process_command (int argc, const char **argv)
{
int skip;
- /* Forward scan, just in case -S or -c is specified
+ /* Forward scan, just in case -S, -E or -c is specified
after -o. */
int j = i + 1;
if (p[1] == 0)
@@ -4162,7 +4195,10 @@ process_command (int argc, const char **argv)
argv[i] = convert_filename (argv[i], ! have_c, 0);
#endif
/* Save the output name in case -save-temps=obj was used. */
- save_temps_prefix = xstrdup ((p[1] == 0) ? argv[i + 1] : argv[i] + 1);
+ if ((p[1] == 0) && argv[i + 1])
+ save_temps_prefix = xstrdup(argv[i + 1]);
+ else
+ save_temps_prefix = xstrdup(argv[i] + 1);
goto normal_switch;
default:
@@ -4532,20 +4568,32 @@ process_command (int argc, const char **argv)
}
else
{
+ const char *p = strchr (argv[i], '@');
+ char *fname;
#ifdef HAVE_TARGET_OBJECT_SUFFIX
argv[i] = convert_filename (argv[i], 0, access (argv[i], F_OK));
#endif
+ if (!p)
+ fname = xstrdup (argv[i]);
+ else
+ {
+ fname = (char *)xmalloc (p - argv[i] + 1);
+ memcpy (fname, argv[i], p - argv[i]);
+ fname[p - argv[i]] = '\0';
+ }
+
+ if (strcmp (fname, "-") != 0 && access (fname, F_OK) < 0)
+ {
+ perror_with_name (fname);
+ error_count++;
+ }
+ else
+ {
+ infiles[n_infiles].language = spec_lang;
+ infiles[n_infiles++].name = argv[i];
+ }
- if (strcmp (argv[i], "-") != 0 && access (argv[i], F_OK) < 0)
- {
- perror_with_name (argv[i]);
- error_count++;
- }
- else
- {
- infiles[n_infiles].language = spec_lang;
- infiles[n_infiles++].name = argv[i];
- }
+ free (fname);
}
}
@@ -4608,11 +4656,6 @@ set_collect_gcc_options (void)
if ((switches[i].live_cond & SWITCH_IGNORE) != 0)
continue;
- /* Don't use -fwhole-program when compiling the init and fini routines,
- since we'd wrongly assume that the routines aren't needed. */
- if (strcmp (switches[i].part1, "fwhole-program") == 0)
- continue;
-
obstack_grow (&collect_obstack, "'-", 2);
q = switches[i].part1;
while ((p = strchr (q, '\'')))
@@ -6834,14 +6877,6 @@ main (int argc, char **argv)
multilib_defaults = XOBFINISH (&multilib_obstack, const char *);
}
- /* Set up to remember the pathname of gcc and any options
- needed for collect. We use argv[0] instead of programname because
- we need the complete pathname. */
- obstack_init (&collect_obstack);
- obstack_grow (&collect_obstack, "COLLECT_GCC=", sizeof ("COLLECT_GCC=") - 1);
- obstack_grow (&collect_obstack, argv[0], strlen (argv[0]) + 1);
- xputenv (XOBFINISH (&collect_obstack, char *));
-
#ifdef INIT_ENVIRONMENT
/* Set up any other necessary machine specific environment variables. */
xputenv (INIT_ENVIRONMENT);
@@ -7055,6 +7090,27 @@ main (int argc, char **argv)
the subdirectory based on the options. */
set_multilib_dir ();
+ /* Set up to remember the pathname of gcc and any options
+ needed for collect. We use argv[0] instead of programname because
+ we need the complete pathname. */
+ obstack_init (&collect_obstack);
+ obstack_grow (&collect_obstack, "COLLECT_GCC=", sizeof ("COLLECT_GCC=") - 1);
+ obstack_grow (&collect_obstack, argv[0], strlen (argv[0]) + 1);
+ xputenv (XOBFINISH (&collect_obstack, char *));
+
+ /* Set up to remember the pathname of the lto wrapper. */
+
+ lto_wrapper_spec = find_a_file (&exec_prefixes, "lto-wrapper", X_OK, false);
+ if (lto_wrapper_spec)
+ {
+ obstack_init (&collect_obstack);
+ obstack_grow (&collect_obstack, "COLLECT_LTO_WRAPPER=",
+ sizeof ("COLLECT_LTO_WRAPPER=") - 1);
+ obstack_grow (&collect_obstack, lto_wrapper_spec,
+ strlen (lto_wrapper_spec) + 1);
+ xputenv (XOBFINISH (&collect_obstack, char *));
+ }
+
/* Warn about any switches that no pass was interested in. */
for (i = 0; (int) i < n_switches; i++)
@@ -7267,7 +7323,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
}
if (!combine_inputs && have_c && have_o && lang_n_infiles > 1)
- fatal ("cannot specify -o with -c or -S with multiple files");
+ fatal ("cannot specify -o with -c, -S or -E with multiple files");
if (combine_flag && save_temps_flag)
{
@@ -7475,6 +7531,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
if (num_linker_inputs > 0 && error_count == 0 && print_subprocess_help < 2)
{
int tmp = execution_count;
+ const char *fuse_linker_plugin = "fuse-linker-plugin";
/* We'll use ld if we can't find collect2. */
if (! strcmp (linker_name_spec, "collect2"))
@@ -7483,6 +7540,23 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
if (s == NULL)
linker_name_spec = "ld";
}
+
+ if (switch_matches (fuse_linker_plugin,
+ fuse_linker_plugin + strlen (fuse_linker_plugin), 0))
+ {
+ linker_plugin_file_spec = find_a_file (&exec_prefixes,
+ "liblto_plugin.so", X_OK,
+ false);
+ if (!linker_plugin_file_spec)
+ fatal ("-fuse-linker-plugin, but liblto_plugin.so not found");
+
+ lto_libgcc_spec = find_a_file (&startfile_prefixes, "libgcc.a",
+ R_OK, true);
+ if (!lto_libgcc_spec)
+ fatal ("could not find libgcc.a");
+ }
+ lto_gcc_spec = argv[0];
+
/* Rebuild the COMPILER_PATH and LIBRARY_PATH environment variables
for collect. */
putenv_from_prefixes (&exec_prefixes, "COMPILER_PATH", false);
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 803ab3e5a14..7ccb05e1d85 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -2276,8 +2276,7 @@ try_replace_reg (rtx from, rtx to, rtx insn)
with our replacement. */
if (note != 0 && REG_NOTE_KIND (note) == REG_EQUAL)
set_unique_reg_note (insn, REG_EQUAL,
- simplify_replace_rtx (XEXP (note, 0), from,
- copy_rtx (to)));
+ simplify_replace_rtx (XEXP (note, 0), from, to));
if (!success && set && reg_mentioned_p (from, SET_SRC (set)))
{
/* If above failed and this is a single set, try to simplify the source of
@@ -3038,12 +3037,12 @@ bypass_block (basic_block bb, rtx setcc, rtx jump)
src = SET_SRC (pc_set (jump));
if (setcc != NULL)
- src = simplify_replace_rtx (src,
- SET_DEST (PATTERN (setcc)),
- SET_SRC (PATTERN (setcc)));
+ src = simplify_replace_rtx (src,
+ SET_DEST (PATTERN (setcc)),
+ SET_SRC (PATTERN (setcc)));
new_rtx = simplify_replace_rtx (src, reg_used->reg_rtx,
- SET_SRC (set->expr));
+ SET_SRC (set->expr));
/* Jump bypassing may have already placed instructions on
edges of the CFG. We can't bypass an outgoing edge that
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index bb067368db4..32abf6eff12 100644
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -141,8 +141,7 @@ static void oprintf (outf_p o, const char *S, ...)
static outf_p output_files;
/* The plugin input files and their number; in that case only
- corresponding gt-<plugin>.h are generated in the current
- directory. */
+ a single file is produced. */
static char** plugin_files;
static size_t nb_plugin_files;
/* the generated plugin output name & file */
@@ -1118,6 +1117,8 @@ adjust_field_rtx_def (type_p t, options_p ARG_UNUSED (opt))
t = scalar_tp, subname = "rt_int";
else if (i == VALUE && aindex == 0)
t = scalar_tp, subname = "rt_int";
+ else if (i == DEBUG_EXPR && aindex == 0)
+ t = tree_tp, subname = "rt_tree";
else if (i == REG && aindex == 1)
t = scalar_tp, subname = "rt_int";
else if (i == REG && aindex == 2)
@@ -1570,7 +1571,7 @@ open_base_files (void)
"optabs.h", "libfuncs.h", "debug.h", "ggc.h", "cgraph.h",
"tree-flow.h", "reload.h", "cpp-id-data.h", "tree-chrec.h",
"cfglayout.h", "except.h", "output.h", "gimple.h", "cfgloop.h",
- "target.h", NULL
+ "target.h", "ipa-prop.h", NULL
};
const char *const *ifp;
outf_p gtype_desc_c;
@@ -2719,6 +2720,9 @@ write_types (outf_p output_header, type_p structures, type_p param_structs,
type_p s;
oprintf (output_header, "\n/* %s*/\n", wtd->comment);
+ /* We first emit the macros and the declarations. Functions' code is
+ emitted afterwards. This is needed in plugin mode. */
+ oprintf (output_header, "/* macros and declarations */\n");
for (s = structures; s; s = s->next)
if (s->gc_used == GC_POINTED_TO
|| s->gc_used == GC_MAYBE_POINTED_TO)
@@ -2767,21 +2771,11 @@ write_types (outf_p output_header, type_p structures, type_p param_structs,
s->u.s.tag);
continue;
}
-
- if (s->kind == TYPE_LANG_STRUCT)
- {
- type_p ss;
- for (ss = s->u.s.lang_struct; ss; ss = ss->next)
- write_func_for_structure (s, ss, NULL, wtd);
- }
- else
- write_func_for_structure (s, s, NULL, wtd);
}
for (s = param_structs; s; s = s->next)
if (s->gc_used == GC_POINTED_TO)
{
- type_p * param = s->u.param_struct.param;
type_p stru = s->u.param_struct.stru;
/* Declare the marker procedure. */
@@ -2795,7 +2789,41 @@ write_types (outf_p output_header, type_p structures, type_p param_structs,
s->u.s.tag);
continue;
}
+ }
+
+ /* At last we emit the functions code. */
+ oprintf (output_header, "\n/* functions code */\n");
+ for (s = structures; s; s = s->next)
+ if (s->gc_used == GC_POINTED_TO
+ || s->gc_used == GC_MAYBE_POINTED_TO)
+ {
+ options_p opt;
+ if (s->gc_used == GC_MAYBE_POINTED_TO
+ && s->u.s.line.file == NULL)
+ continue;
+ for (opt = s->u.s.opt; opt; opt = opt->next)
+ if (strcmp (opt->name, "ptr_alias") == 0)
+ break;
+ if (opt)
+ continue;
+
+ if (s->kind == TYPE_LANG_STRUCT)
+ {
+ type_p ss;
+ for (ss = s->u.s.lang_struct; ss; ss = ss->next)
+ write_func_for_structure (s, ss, NULL, wtd);
+ }
+ else
+ write_func_for_structure (s, s, NULL, wtd);
+ }
+ for (s = param_structs; s; s = s->next)
+ if (s->gc_used == GC_POINTED_TO)
+ {
+ type_p *param = s->u.param_struct.param;
+ type_p stru = s->u.param_struct.stru;
+ if (stru->u.s.line.file == NULL)
+ continue;
if (stru->kind == TYPE_LANG_STRUCT)
{
type_p ss;
diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c
index 744355e3de3..adb32880cfa 100644
--- a/gcc/ggc-page.c
+++ b/gcc/ggc-page.c
@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3. If not see
#include "timevar.h"
#include "params.h"
#include "tree-flow.h"
+#include "cfgloop.h"
#include "plugin.h"
/* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a
@@ -157,6 +158,24 @@ along with GCC; see the file COPYING3. If not see
#define OFFSET_TO_BIT(OFFSET, ORDER) \
(((OFFSET) * DIV_MULT (ORDER)) >> DIV_SHIFT (ORDER))
+/* We use this structure to determine the alignment required for
+ allocations. For power-of-two sized allocations, that's not a
+ problem, but it does matter for odd-sized allocations.
+ We do not care about alignment for floating-point types. */
+
+struct max_alignment {
+ char c;
+ union {
+ HOST_WIDEST_INT i;
+ void *p;
+ } u;
+};
+
+/* The biggest alignment required. */
+
+#define MAX_ALIGNMENT (offsetof (struct max_alignment, u))
+
+
/* The number of extra orders, not corresponding to power-of-two sized
objects. */
@@ -173,42 +192,35 @@ along with GCC; see the file COPYING3. If not see
thing you need to do to add a new special allocation size. */
static const size_t extra_order_size_table[] = {
- sizeof (struct var_ann_d),
+ /* Extra orders for small non-power-of-two multiples of MAX_ALIGNMENT.
+ There are a lot of structures with these sizes and explicitly
+ listing them risks orders being dropped because they changed size. */
+ MAX_ALIGNMENT * 3,
+ MAX_ALIGNMENT * 5,
+ MAX_ALIGNMENT * 6,
+ MAX_ALIGNMENT * 7,
+ MAX_ALIGNMENT * 9,
+ MAX_ALIGNMENT * 10,
+ MAX_ALIGNMENT * 11,
+ MAX_ALIGNMENT * 12,
+ MAX_ALIGNMENT * 13,
+ MAX_ALIGNMENT * 14,
+ MAX_ALIGNMENT * 15,
sizeof (struct tree_decl_non_common),
sizeof (struct tree_field_decl),
sizeof (struct tree_parm_decl),
sizeof (struct tree_var_decl),
- sizeof (struct tree_list),
- sizeof (struct tree_ssa_name),
+ sizeof (struct tree_type),
sizeof (struct function),
sizeof (struct basic_block_def),
- sizeof (bitmap_element),
- sizeof (bitmap_head),
- TREE_EXP_SIZE (2),
- RTL_SIZE (2), /* MEM, PLUS, etc. */
- RTL_SIZE (9), /* INSN */
+ sizeof (struct cgraph_node),
+ sizeof (struct loop),
};
/* The total number of orders. */
#define NUM_ORDERS (HOST_BITS_PER_PTR + NUM_EXTRA_ORDERS)
-/* We use this structure to determine the alignment required for
- allocations. For power-of-two sized allocations, that's not a
- problem, but it does matter for odd-sized allocations. */
-
-struct max_alignment {
- char c;
- union {
- HOST_WIDEST_INT i;
- long double d;
- } u;
-};
-
-/* The biggest alignment required. */
-
-#define MAX_ALIGNMENT (offsetof (struct max_alignment, u))
-
/* Compute the smallest nonnegative number which when added to X gives
a multiple of F. */
diff --git a/gcc/gimple-iterator.c b/gcc/gimple-iterator.c
index 66927d67c2c..c3ca0e37501 100644
--- a/gcc/gimple-iterator.c
+++ b/gcc/gimple-iterator.c
@@ -358,7 +358,8 @@ gsi_split_seq_before (gimple_stmt_iterator *i)
/* Replace the statement pointed-to by GSI to STMT. If UPDATE_EH_INFO
is true, the exception handling information of the original
- statement is moved to the new statement. */
+ statement is moved to the new statement. Assignments must only be
+ replaced with assignments to the same LHS. */
void
gsi_replace (gimple_stmt_iterator *gsi, gimple stmt, bool update_eh_info)
@@ -368,6 +369,9 @@ gsi_replace (gimple_stmt_iterator *gsi, gimple stmt, bool update_eh_info)
if (stmt == orig_stmt)
return;
+ gcc_assert (!gimple_has_lhs (orig_stmt)
+ || gimple_get_lhs (orig_stmt) == gimple_get_lhs (stmt));
+
gimple_set_location (stmt, gimple_location (orig_stmt));
gimple_set_bb (stmt, gsi_bb (*gsi));
@@ -470,6 +474,8 @@ gsi_remove (gimple_stmt_iterator *i, bool remove_permanently)
gimple_seq_node cur, next, prev;
gimple stmt = gsi_stmt (*i);
+ insert_debug_temps_for_defs (i);
+
/* Free all the data flow information for STMT. */
gimple_set_bb (stmt, NULL);
delink_stmt_imm_use (stmt);
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c
index b58fd7b42f5..cce31e946ff 100644
--- a/gcc/gimple-low.c
+++ b/gcc/gimple-low.c
@@ -76,6 +76,9 @@ struct lower_data
of the function. */
VEC(return_statements_t,heap) *return_statements;
+ /* True if the current statement cannot fall through. */
+ bool cannot_fallthru;
+
/* True if the function calls __builtin_setjmp. */
bool calls_builtin_setjmp;
};
@@ -317,7 +320,12 @@ lower_omp_directive (gimple_stmt_iterator *gsi, struct lower_data *data)
}
-/* Lower statement GSI. DATA is passed through the recursion. */
+/* Lower statement GSI. DATA is passed through the recursion. We try to
+ track the fallthruness of statements and get rid of unreachable return
+ statements in order to prevent the EH lowering pass from adding useless
+ edges that can cause bogus warnings to be issued later; this guess need
+ not be 100% accurate, simply be conservative and reset cannot_fallthru
+ to false if we don't know. */
static void
lower_stmt (gimple_stmt_iterator *gsi, struct lower_data *data)
@@ -330,36 +338,61 @@ lower_stmt (gimple_stmt_iterator *gsi, struct lower_data *data)
{
case GIMPLE_BIND:
lower_gimple_bind (gsi, data);
+ /* Propagate fallthruness. */
return;
case GIMPLE_COND:
- /* The gimplifier has already lowered this into gotos. */
- break;
+ case GIMPLE_GOTO:
+ case GIMPLE_SWITCH:
+ data->cannot_fallthru = true;
+ gsi_next (gsi);
+ return;
case GIMPLE_RETURN:
- lower_gimple_return (gsi, data);
+ if (data->cannot_fallthru)
+ {
+ gsi_remove (gsi, false);
+ /* Propagate fallthruness. */
+ }
+ else
+ {
+ lower_gimple_return (gsi, data);
+ data->cannot_fallthru = true;
+ }
return;
case GIMPLE_TRY:
- lower_sequence (gimple_try_eval (stmt), data);
- lower_sequence (gimple_try_cleanup (stmt), data);
+ {
+ bool try_cannot_fallthru;
+ lower_sequence (gimple_try_eval (stmt), data);
+ try_cannot_fallthru = data->cannot_fallthru;
+ data->cannot_fallthru = false;
+ lower_sequence (gimple_try_cleanup (stmt), data);
+ /* See gimple_stmt_may_fallthru for the rationale. */
+ if (gimple_try_kind (stmt) == GIMPLE_TRY_FINALLY)
+ {
+ data->cannot_fallthru |= try_cannot_fallthru;
+ gsi_next (gsi);
+ return;
+ }
+ }
break;
case GIMPLE_CATCH:
+ data->cannot_fallthru = false;
lower_sequence (gimple_catch_handler (stmt), data);
break;
case GIMPLE_EH_FILTER:
+ data->cannot_fallthru = false;
lower_sequence (gimple_eh_filter_failure (stmt), data);
break;
case GIMPLE_NOP:
case GIMPLE_ASM:
case GIMPLE_ASSIGN:
- case GIMPLE_GOTO:
case GIMPLE_PREDICT:
case GIMPLE_LABEL:
- case GIMPLE_SWITCH:
case GIMPLE_EH_MUST_NOT_THROW:
case GIMPLE_OMP_FOR:
case GIMPLE_OMP_SECTIONS:
@@ -383,8 +416,16 @@ lower_stmt (gimple_stmt_iterator *gsi, struct lower_data *data)
&& DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL
&& DECL_FUNCTION_CODE (decl) == BUILT_IN_SETJMP)
{
- data->calls_builtin_setjmp = true;
lower_builtin_setjmp (gsi);
+ data->cannot_fallthru = false;
+ data->calls_builtin_setjmp = true;
+ return;
+ }
+
+ if (decl && (flags_from_decl_or_type (decl) & ECF_NORETURN))
+ {
+ data->cannot_fallthru = true;
+ gsi_next (gsi);
return;
}
}
@@ -392,13 +433,16 @@ lower_stmt (gimple_stmt_iterator *gsi, struct lower_data *data)
case GIMPLE_OMP_PARALLEL:
case GIMPLE_OMP_TASK:
+ data->cannot_fallthru = false;
lower_omp_directive (gsi, data);
+ data->cannot_fallthru = false;
return;
default:
gcc_unreachable ();
}
+ data->cannot_fallthru = false;
gsi_next (gsi);
}
@@ -647,9 +691,9 @@ gimple_stmt_may_fallthru (gimple stmt)
return false;
case GIMPLE_SWITCH:
- /* Switch has already been lowered and represents a
- branch to a selected label and hence can not fall through. */
- return true;
+ /* Switch has already been lowered and represents a branch
+ to a selected label and hence can't fall through. */
+ return false;
case GIMPLE_COND:
/* GIMPLE_COND's are already lowered into a two-way branch. They
@@ -675,13 +719,10 @@ gimple_stmt_may_fallthru (gimple stmt)
return (gimple_seq_may_fallthru (gimple_try_eval (stmt))
&& gimple_seq_may_fallthru (gimple_try_cleanup (stmt)));
- case GIMPLE_ASSIGN:
- return true;
-
case GIMPLE_CALL:
/* Functions that do not return do not fall through. */
return (gimple_call_flags (stmt) & ECF_NORETURN) == 0;
-
+
default:
return true;
}
@@ -731,7 +772,7 @@ lower_gimple_return (gimple_stmt_iterator *gsi, struct lower_data *data)
gsi_remove (gsi, false);
}
-/* Lower a __builtin_setjmp TSI.
+/* Lower a __builtin_setjmp GSI.
__builtin_setjmp is passed a pointer to an array of five words (not
all will be used on all machines). It operates similarly to the C
diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c
index 3d3134beaa6..4f6c4470c9d 100644
--- a/gcc/gimple-pretty-print.c
+++ b/gcc/gimple-pretty-print.c
@@ -254,6 +254,7 @@ dump_unary_rhs (pretty_printer *buffer, gimple gs, int spc, int flags)
break;
case FIXED_CONVERT_EXPR:
+ case ADDR_SPACE_CONVERT_EXPR:
case FIX_TRUNC_EXPR:
case FLOAT_EXPR:
CASE_CONVERT:
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 425463c31ca..676e3fd4678 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "target.h"
#include "tree.h"
#include "ggc.h"
#include "hard-reg-set.h"
@@ -33,8 +34,19 @@ along with GCC; see the file COPYING3. If not see
#include "tree-flow.h"
#include "value-prof.h"
#include "flags.h"
+#include "alias.h"
#include "demangle.h"
+/* Global type table. FIXME lto, it should be possible to re-use some
+ of the type hashing routines in tree.c (type_hash_canon, type_hash_lookup,
+ etc), but those assume that types were built with the various
+ build_*_type routines which is not the case with the streamer. */
+static htab_t gimple_types;
+static struct pointer_map_t *type_hash_cache;
+
+/* Global type comparison cache. */
+static htab_t gtc_visited;
+static struct obstack gtc_ob;
/* All the tuples have their operand vector (if present) at the very bottom
of the structure. Therefore, the offset required to find the
@@ -115,8 +127,7 @@ gimple_size (enum gimple_code code)
/* Allocate memory for a GIMPLE statement with code CODE and NUM_OPS
operands. */
-#define gimple_alloc(c, n) gimple_alloc_stat (c, n MEM_STAT_INFO)
-static gimple
+gimple
gimple_alloc_stat (enum gimple_code code, unsigned num_ops MEM_STAT_DECL)
{
size_t size;
@@ -613,7 +624,7 @@ gimple_build_eh_must_not_throw (tree decl)
gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
gcc_assert (flags_from_decl_or_type (decl) & ECF_NORETURN);
- p->gimple_eh_mnt.fndecl = decl;
+ gimple_eh_must_not_throw_set_fndecl (p, decl);
return p;
}
@@ -3000,6 +3011,1226 @@ gimple_call_copy_skip_args (gimple stmt, bitmap args_to_skip)
}
+static hashval_t gimple_type_hash (const void *);
+
+/* Structure used to maintain a cache of some type pairs compared by
+ gimple_types_compatible_p when comparing aggregate types. There are
+ four possible values for SAME_P:
+
+ -2: The pair (T1, T2) has just been inserted in the table.
+ -1: The pair (T1, T2) is currently being compared.
+ 0: T1 and T2 are different types.
+ 1: T1 and T2 are the same type.
+
+ This table is only used when comparing aggregate types to avoid
+ infinite recursion due to self-referential types. */
+struct type_pair_d
+{
+ unsigned int uid1;
+ unsigned int uid2;
+ int same_p;
+};
+typedef struct type_pair_d *type_pair_t;
+
+/* Return a hash value for the type pair pointed-to by P. */
+
+static hashval_t
+type_pair_hash (const void *p)
+{
+ const struct type_pair_d *pair = (const struct type_pair_d *) p;
+ hashval_t val1 = pair->uid1;
+ hashval_t val2 = pair->uid2;
+ return (iterative_hash_hashval_t (val2, val1)
+ ^ iterative_hash_hashval_t (val1, val2));
+}
+
+/* Compare two type pairs pointed-to by P1 and P2. */
+
+static int
+type_pair_eq (const void *p1, const void *p2)
+{
+ const struct type_pair_d *pair1 = (const struct type_pair_d *) p1;
+ const struct type_pair_d *pair2 = (const struct type_pair_d *) p2;
+ return ((pair1->uid1 == pair2->uid1 && pair1->uid2 == pair2->uid2)
+ || (pair1->uid1 == pair2->uid2 && pair1->uid2 == pair2->uid1));
+}
+
+/* Lookup the pair of types T1 and T2 in *VISITED_P. Insert a new
+ entry if none existed. */
+
+static type_pair_t
+lookup_type_pair (tree t1, tree t2, htab_t *visited_p, struct obstack *ob_p)
+{
+ struct type_pair_d pair;
+ type_pair_t p;
+ void **slot;
+
+ if (*visited_p == NULL)
+ {
+ *visited_p = htab_create (251, type_pair_hash, type_pair_eq, NULL);
+ gcc_obstack_init (ob_p);
+ }
+
+ pair.uid1 = TYPE_UID (t1);
+ pair.uid2 = TYPE_UID (t2);
+ slot = htab_find_slot (*visited_p, &pair, INSERT);
+
+ if (*slot)
+ p = *((type_pair_t *) slot);
+ else
+ {
+ p = XOBNEW (ob_p, struct type_pair_d);
+ p->uid1 = TYPE_UID (t1);
+ p->uid2 = TYPE_UID (t2);
+ p->same_p = -2;
+ *slot = (void *) p;
+ }
+
+ return p;
+}
+
+
+/* Return true if T1 and T2 have the same name. If FOR_COMPLETION_P is
+ true then if any type has no name return false, otherwise return
+ true if both types have no names. */
+
+static bool
+compare_type_names_p (tree t1, tree t2, bool for_completion_p)
+{
+ tree name1 = TYPE_NAME (t1);
+ tree name2 = TYPE_NAME (t2);
+
+ /* Consider anonymous types all unique for completion. */
+ if (for_completion_p
+ && (!name1 || !name2))
+ return false;
+
+ if (name1 && TREE_CODE (name1) == TYPE_DECL)
+ {
+ name1 = DECL_NAME (name1);
+ if (for_completion_p
+ && !name1)
+ return false;
+ }
+ gcc_assert (!name1 || TREE_CODE (name1) == IDENTIFIER_NODE);
+
+ if (name2 && TREE_CODE (name2) == TYPE_DECL)
+ {
+ name2 = DECL_NAME (name2);
+ if (for_completion_p
+ && !name2)
+ return false;
+ }
+ gcc_assert (!name2 || TREE_CODE (name2) == IDENTIFIER_NODE);
+
+ /* Identifiers can be compared with pointer equality rather
+ than a string comparison. */
+ if (name1 == name2)
+ return true;
+
+ return false;
+}
+
+/* Return true if the field decls F1 and F2 are at the same offset. */
+
+static bool
+compare_field_offset (tree f1, tree f2)
+{
+ if (DECL_OFFSET_ALIGN (f1) == DECL_OFFSET_ALIGN (f2))
+ return (operand_equal_p (DECL_FIELD_OFFSET (f1),
+ DECL_FIELD_OFFSET (f2), 0)
+ && tree_int_cst_equal (DECL_FIELD_BIT_OFFSET (f1),
+ DECL_FIELD_BIT_OFFSET (f2)));
+
+ /* Fortran and C do not always agree on what DECL_OFFSET_ALIGN
+ should be, so handle differing ones specially by decomposing
+ the offset into a byte and bit offset manually. */
+ if (host_integerp (DECL_FIELD_OFFSET (f1), 0)
+ && host_integerp (DECL_FIELD_OFFSET (f2), 0))
+ {
+ unsigned HOST_WIDE_INT byte_offset1, byte_offset2;
+ unsigned HOST_WIDE_INT bit_offset1, bit_offset2;
+ bit_offset1 = TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (f1));
+ byte_offset1 = (TREE_INT_CST_LOW (DECL_FIELD_OFFSET (f1))
+ + bit_offset1 / BITS_PER_UNIT);
+ bit_offset2 = TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (f2));
+ byte_offset2 = (TREE_INT_CST_LOW (DECL_FIELD_OFFSET (f2))
+ + bit_offset2 / BITS_PER_UNIT);
+ if (byte_offset1 != byte_offset2)
+ return false;
+ return bit_offset1 % BITS_PER_UNIT == bit_offset2 % BITS_PER_UNIT;
+ }
+
+ return false;
+}
+
+/* Return 1 iff T1 and T2 are structurally identical.
+ Otherwise, return 0. */
+
+static int
+gimple_types_compatible_p (tree t1, tree t2)
+{
+ type_pair_t p = NULL;
+
+ /* Check first for the obvious case of pointer identity. */
+ if (t1 == t2)
+ return 1;
+
+ /* Check that we have two types to compare. */
+ if (t1 == NULL_TREE || t2 == NULL_TREE)
+ return 0;
+
+ /* Can't be the same type if the types don't have the same code. */
+ if (TREE_CODE (t1) != TREE_CODE (t2))
+ return 0;
+
+ /* Can't be the same type if they have different CV qualifiers. */
+ if (TYPE_QUALS (t1) != TYPE_QUALS (t2))
+ return 0;
+
+ /* Void types are always the same. */
+ if (TREE_CODE (t1) == VOID_TYPE)
+ return 1;
+
+ /* For numerical types do some simple checks before doing three
+ hashtable queries. */
+ if (INTEGRAL_TYPE_P (t1)
+ || SCALAR_FLOAT_TYPE_P (t1)
+ || FIXED_POINT_TYPE_P (t1)
+ || TREE_CODE (t1) == VECTOR_TYPE
+ || TREE_CODE (t1) == COMPLEX_TYPE
+ || TREE_CODE (t1) == OFFSET_TYPE)
+ {
+ /* Can't be the same type if they have different alignment,
+ sign, precision or mode. */
+ if (TYPE_ALIGN (t1) != TYPE_ALIGN (t2)
+ || TYPE_PRECISION (t1) != TYPE_PRECISION (t2)
+ || TYPE_MODE (t1) != TYPE_MODE (t2)
+ || TYPE_UNSIGNED (t1) != TYPE_UNSIGNED (t2))
+ return 0;
+
+ if (TREE_CODE (t1) == INTEGER_TYPE
+ && (TYPE_IS_SIZETYPE (t1) != TYPE_IS_SIZETYPE (t2)
+ || TYPE_STRING_FLAG (t1) != TYPE_STRING_FLAG (t2)))
+ return 0;
+
+ /* That's all we need to check for float and fixed-point types. */
+ if (SCALAR_FLOAT_TYPE_P (t1)
+ || FIXED_POINT_TYPE_P (t1))
+ return 1;
+
+ /* Perform cheap tail-recursion for vector and complex types. */
+ if (TREE_CODE (t1) == VECTOR_TYPE
+ || TREE_CODE (t1) == COMPLEX_TYPE)
+ return gimple_types_compatible_p (TREE_TYPE (t1), TREE_TYPE (t2));
+
+ /* For integral types fall thru to more complex checks. */
+ }
+
+ /* If the hash values of t1 and t2 are different the types can't
+ possibly be the same. This helps keeping the type-pair hashtable
+ small, only tracking comparisons for hash collisions. */
+ if (gimple_type_hash (t1) != gimple_type_hash (t2))
+ return 0;
+
+ /* If we've visited this type pair before (in the case of aggregates
+ with self-referential types), and we made a decision, return it. */
+ p = lookup_type_pair (t1, t2, &gtc_visited, &gtc_ob);
+ if (p->same_p == 0 || p->same_p == 1)
+ {
+ /* We have already decided whether T1 and T2 are the
+ same, return the cached result. */
+ return p->same_p == 1;
+ }
+ else if (p->same_p == -1)
+ {
+ /* We are currently comparing this pair of types, assume
+ that they are the same and let the caller decide. */
+ return 1;
+ }
+
+ gcc_assert (p->same_p == -2);
+
+ /* Mark the (T1, T2) comparison in progress. */
+ p->same_p = -1;
+
+ /* If their attributes are not the same they can't be the same type. */
+ if (!attribute_list_equal (TYPE_ATTRIBUTES (t1), TYPE_ATTRIBUTES (t2)))
+ goto different_types;
+
+ /* Do type-specific comparisons. */
+ switch (TREE_CODE (t1))
+ {
+ case ARRAY_TYPE:
+ /* Array types are the same if the element types are the same and
+ the number of elements are the same. */
+ if (!gimple_types_compatible_p (TREE_TYPE (t1), TREE_TYPE (t2))
+ || TYPE_STRING_FLAG (t1) != TYPE_STRING_FLAG (t2)
+ || TYPE_NONALIASED_COMPONENT (t1) != TYPE_NONALIASED_COMPONENT (t2))
+ goto different_types;
+ else
+ {
+ tree i1 = TYPE_DOMAIN (t1);
+ tree i2 = TYPE_DOMAIN (t2);
+
+ /* For an incomplete external array, the type domain can be
+ NULL_TREE. Check this condition also. */
+ if (i1 == NULL_TREE && i2 == NULL_TREE)
+ goto same_types;
+ else if (i1 == NULL_TREE || i2 == NULL_TREE)
+ goto different_types;
+ /* If for a complete array type the possibly gimplified sizes
+ are different the types are different. */
+ else if (((TYPE_SIZE (i1) != NULL) ^ (TYPE_SIZE (i2) != NULL))
+ || (TYPE_SIZE (i1)
+ && TYPE_SIZE (i2)
+ && !operand_equal_p (TYPE_SIZE (i1), TYPE_SIZE (i2), 0)))
+ goto different_types;
+ else
+ {
+ tree min1 = TYPE_MIN_VALUE (i1);
+ tree min2 = TYPE_MIN_VALUE (i2);
+ tree max1 = TYPE_MAX_VALUE (i1);
+ tree max2 = TYPE_MAX_VALUE (i2);
+
+ /* The minimum/maximum values have to be the same. */
+ if ((min1 == min2
+ || (min1 && min2 && operand_equal_p (min1, min2, 0)))
+ && (max1 == max2
+ || (max1 && max2 && operand_equal_p (max1, max2, 0))))
+ goto same_types;
+ else
+ goto different_types;
+ }
+ }
+
+ case METHOD_TYPE:
+ /* Method types should belong to the same class. */
+ if (!gimple_types_compatible_p (TYPE_METHOD_BASETYPE (t1),
+ TYPE_METHOD_BASETYPE (t2)))
+ goto different_types;
+
+ /* Fallthru */
+
+ case FUNCTION_TYPE:
+ /* Function types are the same if the return type and arguments types
+ are the same. */
+ if (!gimple_types_compatible_p (TREE_TYPE (t1), TREE_TYPE (t2)))
+ goto different_types;
+ else
+ {
+ if (!targetm.comp_type_attributes (t1, t2))
+ goto different_types;
+
+ if (TYPE_ARG_TYPES (t1) == TYPE_ARG_TYPES (t2))
+ goto same_types;
+ else
+ {
+ tree parms1, parms2;
+
+ for (parms1 = TYPE_ARG_TYPES (t1), parms2 = TYPE_ARG_TYPES (t2);
+ parms1 && parms2;
+ parms1 = TREE_CHAIN (parms1), parms2 = TREE_CHAIN (parms2))
+ {
+ if (!gimple_types_compatible_p (TREE_VALUE (parms1),
+ TREE_VALUE (parms2)))
+ goto different_types;
+ }
+
+ if (parms1 || parms2)
+ goto different_types;
+
+ goto same_types;
+ }
+ }
+
+ case OFFSET_TYPE:
+ {
+ if (!gimple_types_compatible_p (TREE_TYPE (t1), TREE_TYPE (t2))
+ || !gimple_types_compatible_p (TYPE_OFFSET_BASETYPE (t1),
+ TYPE_OFFSET_BASETYPE (t2)))
+ goto different_types;
+
+ goto same_types;
+ }
+
+ case POINTER_TYPE:
+ case REFERENCE_TYPE:
+ {
+ /* If the two pointers have different ref-all attributes,
+ they can't be the same type. */
+ if (TYPE_REF_CAN_ALIAS_ALL (t1) != TYPE_REF_CAN_ALIAS_ALL (t2))
+ goto different_types;
+
+ /* If one pointer points to an incomplete type variant of
+ the other pointed-to type they are the same. */
+ if (TREE_CODE (TREE_TYPE (t1)) == TREE_CODE (TREE_TYPE (t2))
+ && RECORD_OR_UNION_TYPE_P (TREE_TYPE (t1))
+ && (!COMPLETE_TYPE_P (TREE_TYPE (t1))
+ || !COMPLETE_TYPE_P (TREE_TYPE (t2)))
+ && compare_type_names_p (TYPE_MAIN_VARIANT (TREE_TYPE (t1)),
+ TYPE_MAIN_VARIANT (TREE_TYPE (t2)), true))
+ {
+ /* Replace the pointed-to incomplete type with the
+ complete one. */
+ if (COMPLETE_TYPE_P (TREE_TYPE (t2)))
+ TREE_TYPE (t1) = TREE_TYPE (t2);
+ else
+ TREE_TYPE (t2) = TREE_TYPE (t1);
+ goto same_types;
+ }
+
+ /* Otherwise, pointer and reference types are the same if the
+ pointed-to types are the same. */
+ if (gimple_types_compatible_p (TREE_TYPE (t1), TREE_TYPE (t2)))
+ goto same_types;
+
+ goto different_types;
+ }
+
+ case INTEGER_TYPE:
+ case BOOLEAN_TYPE:
+ {
+ tree min1 = TYPE_MIN_VALUE (t1);
+ tree max1 = TYPE_MAX_VALUE (t1);
+ tree min2 = TYPE_MIN_VALUE (t2);
+ tree max2 = TYPE_MAX_VALUE (t2);
+ bool min_equal_p = false;
+ bool max_equal_p = false;
+
+ /* If either type has a minimum value, the other type must
+ have the same. */
+ if (min1 == NULL_TREE && min2 == NULL_TREE)
+ min_equal_p = true;
+ else if (min1 && min2 && operand_equal_p (min1, min2, 0))
+ min_equal_p = true;
+
+ /* Likewise, if either type has a maximum value, the other
+ type must have the same. */
+ if (max1 == NULL_TREE && max2 == NULL_TREE)
+ max_equal_p = true;
+ else if (max1 && max2 && operand_equal_p (max1, max2, 0))
+ max_equal_p = true;
+
+ if (!min_equal_p || !max_equal_p)
+ goto different_types;
+
+ goto same_types;
+ }
+
+ case ENUMERAL_TYPE:
+ {
+ /* FIXME lto, we cannot check bounds on enumeral types because
+ different front ends will produce different values.
+ In C, enumeral types are integers, while in C++ each element
+ will have its own symbolic value. We should decide how enums
+ are to be represented in GIMPLE and have each front end lower
+ to that. */
+ tree v1, v2;
+
+ /* For enumeral types, all the values must be the same. */
+ if (TYPE_VALUES (t1) == TYPE_VALUES (t2))
+ goto same_types;
+
+ for (v1 = TYPE_VALUES (t1), v2 = TYPE_VALUES (t2);
+ v1 && v2;
+ v1 = TREE_CHAIN (v1), v2 = TREE_CHAIN (v2))
+ {
+ tree c1 = TREE_VALUE (v1);
+ tree c2 = TREE_VALUE (v2);
+
+ if (TREE_CODE (c1) == CONST_DECL)
+ c1 = DECL_INITIAL (c1);
+
+ if (TREE_CODE (c2) == CONST_DECL)
+ c2 = DECL_INITIAL (c2);
+
+ if (tree_int_cst_equal (c1, c2) != 1)
+ goto different_types;
+ }
+
+ /* If one enumeration has more values than the other, they
+ are not the same. */
+ if (v1 || v2)
+ goto different_types;
+
+ goto same_types;
+ }
+
+ case RECORD_TYPE:
+ case UNION_TYPE:
+ case QUAL_UNION_TYPE:
+ {
+ tree f1, f2;
+
+ /* If one type requires structural equality checks and the
+ other doesn't, do not merge the types. */
+ if (TYPE_STRUCTURAL_EQUALITY_P (t1)
+ != TYPE_STRUCTURAL_EQUALITY_P (t2))
+ goto different_types;
+
+ /* The struct tags shall compare equal. */
+ if (!compare_type_names_p (TYPE_MAIN_VARIANT (t1),
+ TYPE_MAIN_VARIANT (t2), false))
+ goto different_types;
+
+ /* For aggregate types, all the fields must be the same. */
+ for (f1 = TYPE_FIELDS (t1), f2 = TYPE_FIELDS (t2);
+ f1 && f2;
+ f1 = TREE_CHAIN (f1), f2 = TREE_CHAIN (f2))
+ {
+ /* The fields must have the same name, offset and type. */
+ if (DECL_NAME (f1) != DECL_NAME (f2)
+ || DECL_NONADDRESSABLE_P (f1) != DECL_NONADDRESSABLE_P (f2)
+ || !compare_field_offset (f1, f2)
+ || !gimple_types_compatible_p (TREE_TYPE (f1),
+ TREE_TYPE (f2)))
+ goto different_types;
+ }
+
+ /* If one aggregate has more fields than the other, they
+ are not the same. */
+ if (f1 || f2)
+ goto different_types;
+
+ goto same_types;
+ }
+
+ default:
+ gcc_unreachable ();
+ }
+
+ /* Common exit path for types that are not compatible. */
+different_types:
+ p->same_p = 0;
+ return 0;
+
+ /* Common exit path for types that are compatible. */
+same_types:
+ p->same_p = 1;
+ return 1;
+}
+
+
+
+
+/* Per pointer state for the SCC finding. The on_sccstack flag
+ is not strictly required, it is true when there is no hash value
+ recorded for the type and false otherwise. But querying that
+ is slower. */
+
+struct sccs
+{
+ unsigned int dfsnum;
+ unsigned int low;
+ bool on_sccstack;
+ hashval_t hash;
+};
+
+static unsigned int next_dfs_num;
+
+static hashval_t
+iterative_hash_gimple_type (tree, hashval_t, VEC(tree, heap) **,
+ struct pointer_map_t *, struct obstack *);
+
+/* DFS visit the edge from the callers type with state *STATE to T.
+ Update the callers type hash V with the hash for T if it is not part
+ of the SCC containing the callers type and return it.
+ SCCSTACK, SCCSTATE and SCCSTATE_OBSTACK are state for the DFS walk done. */
+
+static hashval_t
+visit (tree t, struct sccs *state, hashval_t v,
+ VEC (tree, heap) **sccstack,
+ struct pointer_map_t *sccstate,
+ struct obstack *sccstate_obstack)
+{
+ struct sccs *cstate = NULL;
+ void **slot;
+
+ /* If there is a hash value recorded for this type then it can't
+ possibly be part of our parent SCC. Simply mix in its hash. */
+ if ((slot = pointer_map_contains (type_hash_cache, t)))
+ return iterative_hash_hashval_t ((hashval_t) (size_t) *slot, v);
+
+ if ((slot = pointer_map_contains (sccstate, t)) != NULL)
+ cstate = (struct sccs *)*slot;
+ if (!cstate)
+ {
+ hashval_t tem;
+ /* Not yet visited. DFS recurse. */
+ tem = iterative_hash_gimple_type (t, v,
+ sccstack, sccstate, sccstate_obstack);
+ if (!cstate)
+ cstate = (struct sccs *)* pointer_map_contains (sccstate, t);
+ state->low = MIN (state->low, cstate->low);
+ /* If the type is no longer on the SCC stack and thus is not part
+ of the parents SCC mix in its hash value. Otherwise we will
+ ignore the type for hashing purposes and return the unaltered
+ hash value. */
+ if (!cstate->on_sccstack)
+ return tem;
+ }
+ if (cstate->dfsnum < state->dfsnum
+ && cstate->on_sccstack)
+ state->low = MIN (cstate->dfsnum, state->low);
+
+ /* We are part of our parents SCC, skip this type during hashing
+ and return the unaltered hash value. */
+ return v;
+}
+
+/* Hash NAME with the previous hash value V and return it. */
+
+static hashval_t
+iterative_hash_name (tree name, hashval_t v)
+{
+ if (!name)
+ return v;
+ if (TREE_CODE (name) == TYPE_DECL)
+ name = DECL_NAME (name);
+ if (!name)
+ return v;
+ gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
+ return iterative_hash_object (IDENTIFIER_HASH_VALUE (name), v);
+}
+
+/* Returning a hash value for gimple type TYPE combined with VAL.
+ SCCSTACK, SCCSTATE and SCCSTATE_OBSTACK are state for the DFS walk done.
+
+ To hash a type we end up hashing in types that are reachable.
+ Through pointers we can end up with cycles which messes up the
+ required property that we need to compute the same hash value
+ for structurally equivalent types. To avoid this we have to
+ hash all types in a cycle (the SCC) in a commutative way. The
+ easiest way is to not mix in the hashes of the SCC members at
+ all. To make this work we have to delay setting the hash
+ values of the SCC until it is complete. */
+
+static hashval_t
+iterative_hash_gimple_type (tree type, hashval_t val,
+ VEC(tree, heap) **sccstack,
+ struct pointer_map_t *sccstate,
+ struct obstack *sccstate_obstack)
+{
+ hashval_t v;
+ void **slot;
+ struct sccs *state;
+
+#ifdef ENABLE_CHECKING
+ /* Not visited during this DFS walk nor during previous walks. */
+ gcc_assert (!pointer_map_contains (type_hash_cache, type)
+ && !pointer_map_contains (sccstate, type));
+#endif
+ state = XOBNEW (sccstate_obstack, struct sccs);
+ *pointer_map_insert (sccstate, type) = state;
+
+ VEC_safe_push (tree, heap, *sccstack, type);
+ state->dfsnum = next_dfs_num++;
+ state->low = state->dfsnum;
+ state->on_sccstack = true;
+
+ /* Combine a few common features of types so that types are grouped into
+ smaller sets; when searching for existing matching types to merge,
+ only existing types having the same features as the new type will be
+ checked. */
+ v = iterative_hash_hashval_t (TREE_CODE (type), 0);
+ v = iterative_hash_hashval_t (TYPE_QUALS (type), v);
+ v = iterative_hash_hashval_t (TREE_ADDRESSABLE (type), v);
+
+ /* Do not hash the types size as this will cause differences in
+ hash values for the complete vs. the incomplete type variant. */
+
+ /* Incorporate common features of numerical types. */
+ if (INTEGRAL_TYPE_P (type)
+ || SCALAR_FLOAT_TYPE_P (type)
+ || FIXED_POINT_TYPE_P (type))
+ {
+ v = iterative_hash_hashval_t (TYPE_PRECISION (type), v);
+ v = iterative_hash_hashval_t (TYPE_MODE (type), v);
+ v = iterative_hash_hashval_t (TYPE_UNSIGNED (type), v);
+ }
+
+ /* For pointer and reference types, fold in information about the type
+ pointed to but do not recurse into possibly incomplete types to
+ avoid hash differences for complete vs. incomplete types. */
+ if (POINTER_TYPE_P (type))
+ {
+ if (RECORD_OR_UNION_TYPE_P (TREE_TYPE (type)))
+ {
+ v = iterative_hash_hashval_t (TREE_CODE (TREE_TYPE (type)), v);
+ v = iterative_hash_name
+ (TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (type))), v);
+ }
+ else
+ v = visit (TREE_TYPE (type), state, v,
+ sccstack, sccstate, sccstate_obstack);
+ }
+
+ /* For integer types hash the types min/max values and the string flag. */
+ if (TREE_CODE (type) == INTEGER_TYPE)
+ {
+ v = iterative_hash_expr (TYPE_MIN_VALUE (type), v);
+ v = iterative_hash_expr (TYPE_MAX_VALUE (type), v);
+ v = iterative_hash_hashval_t (TYPE_STRING_FLAG (type), v);
+ }
+
+ /* For array types hash their domain and the string flag. */
+ if (TREE_CODE (type) == ARRAY_TYPE
+ && TYPE_DOMAIN (type))
+ {
+ v = iterative_hash_hashval_t (TYPE_STRING_FLAG (type), v);
+ v = visit (TYPE_DOMAIN (type), state, v,
+ sccstack, sccstate, sccstate_obstack);
+ }
+
+ /* Recurse for aggregates with a single element type. */
+ if (TREE_CODE (type) == ARRAY_TYPE
+ || TREE_CODE (type) == COMPLEX_TYPE
+ || TREE_CODE (type) == VECTOR_TYPE)
+ v = visit (TREE_TYPE (type), state, v,
+ sccstack, sccstate, sccstate_obstack);
+
+ /* Incorporate function return and argument types. */
+ if (TREE_CODE (type) == FUNCTION_TYPE || TREE_CODE (type) == METHOD_TYPE)
+ {
+ unsigned na;
+ tree p;
+
+ /* For method types also incorporate their parent class. */
+ if (TREE_CODE (type) == METHOD_TYPE)
+ v = visit (TYPE_METHOD_BASETYPE (type), state, v,
+ sccstack, sccstate, sccstate_obstack);
+
+ v = visit (TREE_TYPE (type), state, v,
+ sccstack, sccstate, sccstate_obstack);
+
+ for (p = TYPE_ARG_TYPES (type), na = 0; p; p = TREE_CHAIN (p))
+ {
+ v = visit (TREE_VALUE (p), state, v,
+ sccstack, sccstate, sccstate_obstack);
+ na++;
+ }
+
+ v = iterative_hash_hashval_t (na, v);
+ }
+
+ if (TREE_CODE (type) == RECORD_TYPE
+ || TREE_CODE (type) == UNION_TYPE
+ || TREE_CODE (type) == QUAL_UNION_TYPE)
+ {
+ unsigned nf;
+ tree f;
+
+ v = iterative_hash_name (TYPE_NAME (TYPE_MAIN_VARIANT (type)), v);
+
+ for (f = TYPE_FIELDS (type), nf = 0; f; f = TREE_CHAIN (f))
+ {
+ v = iterative_hash_name (DECL_NAME (f), v);
+ v = visit (TREE_TYPE (f), state, v,
+ sccstack, sccstate, sccstate_obstack);
+ nf++;
+ }
+
+ v = iterative_hash_hashval_t (nf, v);
+ }
+
+ /* Record hash for us. */
+ state->hash = v;
+
+ /* See if we found an SCC. */
+ if (state->low == state->dfsnum)
+ {
+ tree x;
+
+ /* Pop off the SCC and set its hash values. */
+ do
+ {
+ struct sccs *cstate;
+ x = VEC_pop (tree, *sccstack);
+ gcc_assert (!pointer_map_contains (type_hash_cache, x));
+ cstate = (struct sccs *)*pointer_map_contains (sccstate, x);
+ cstate->on_sccstack = false;
+ slot = pointer_map_insert (type_hash_cache, x);
+ *slot = (void *) (size_t) cstate->hash;
+ }
+ while (x != type);
+ }
+
+ return iterative_hash_hashval_t (v, val);
+}
+
+
+/* Returns a hash value for P (assumed to be a type). The hash value
+ is computed using some distinguishing features of the type. Note
+ that we cannot use pointer hashing here as we may be dealing with
+ two distinct instances of the same type.
+
+ This function should produce the same hash value for two compatible
+ types according to gimple_types_compatible_p. */
+
+static hashval_t
+gimple_type_hash (const void *p)
+{
+ const_tree t = (const_tree) p;
+ VEC(tree, heap) *sccstack = NULL;
+ struct pointer_map_t *sccstate;
+ struct obstack sccstate_obstack;
+ hashval_t val;
+ void **slot;
+
+ if (type_hash_cache == NULL)
+ type_hash_cache = pointer_map_create ();
+
+ if ((slot = pointer_map_contains (type_hash_cache, p)) != NULL)
+ return iterative_hash_hashval_t ((hashval_t) (size_t) *slot, 0);
+
+ /* Perform a DFS walk and pre-hash all reachable types. */
+ next_dfs_num = 1;
+ sccstate = pointer_map_create ();
+ gcc_obstack_init (&sccstate_obstack);
+ val = iterative_hash_gimple_type (CONST_CAST_TREE (t), 0,
+ &sccstack, sccstate, &sccstate_obstack);
+ VEC_free (tree, heap, sccstack);
+ pointer_map_destroy (sccstate);
+ obstack_free (&sccstate_obstack, NULL);
+
+ return val;
+}
+
+
+/* Returns nonzero if P1 and P2 are equal. */
+
+static int
+gimple_type_eq (const void *p1, const void *p2)
+{
+ const_tree t1 = (const_tree) p1;
+ const_tree t2 = (const_tree) p2;
+ return gimple_types_compatible_p (CONST_CAST_TREE (t1), CONST_CAST_TREE (t2));
+}
+
+
+/* Register type T in the global type table gimple_types.
+ If another type T', compatible with T, already existed in
+ gimple_types then return T', otherwise return T. This is used by
+ LTO to merge identical types read from different TUs. */
+
+tree
+gimple_register_type (tree t)
+{
+ void **slot;
+
+ gcc_assert (TYPE_P (t));
+
+ /* Always register the main variant first. This is important so we
+ pick up the non-typedef variants as canonical, otherwise we'll end
+ up taking typedef ids for structure tags during comparison. */
+ if (TYPE_MAIN_VARIANT (t) != t)
+ gimple_register_type (TYPE_MAIN_VARIANT (t));
+
+ if (gimple_types == NULL)
+ gimple_types = htab_create (16381, gimple_type_hash, gimple_type_eq, 0);
+
+ slot = htab_find_slot (gimple_types, t, INSERT);
+ if (*slot
+ && *(tree *)slot != t)
+ {
+ tree new_type = (tree) *((tree *) slot);
+
+ /* Do not merge types with different addressability. */
+ gcc_assert (TREE_ADDRESSABLE (t) == TREE_ADDRESSABLE (new_type));
+
+ /* If t is not its main variant then make t unreachable from its
+ main variant list. Otherwise we'd queue up a lot of duplicates
+ there. */
+ if (t != TYPE_MAIN_VARIANT (t))
+ {
+ tree tem = TYPE_MAIN_VARIANT (t);
+ while (tem && TYPE_NEXT_VARIANT (tem) != t)
+ tem = TYPE_NEXT_VARIANT (tem);
+ if (tem)
+ TYPE_NEXT_VARIANT (tem) = TYPE_NEXT_VARIANT (t);
+ TYPE_NEXT_VARIANT (t) = NULL_TREE;
+ }
+
+ /* If we are a pointer then remove us from the pointer-to or
+ reference-to chain. Otherwise we'd queue up a lot of duplicates
+ there. */
+ if (TREE_CODE (t) == POINTER_TYPE)
+ {
+ if (TYPE_POINTER_TO (TREE_TYPE (t)) == t)
+ TYPE_POINTER_TO (TREE_TYPE (t)) = TYPE_NEXT_PTR_TO (t);
+ else
+ {
+ tree tem = TYPE_POINTER_TO (TREE_TYPE (t));
+ while (tem && TYPE_NEXT_PTR_TO (tem) != t)
+ tem = TYPE_NEXT_PTR_TO (tem);
+ if (tem)
+ TYPE_NEXT_PTR_TO (tem) = TYPE_NEXT_PTR_TO (t);
+ }
+ TYPE_NEXT_PTR_TO (t) = NULL_TREE;
+ }
+ else if (TREE_CODE (t) == REFERENCE_TYPE)
+ {
+ if (TYPE_REFERENCE_TO (TREE_TYPE (t)) == t)
+ TYPE_REFERENCE_TO (TREE_TYPE (t)) = TYPE_NEXT_REF_TO (t);
+ else
+ {
+ tree tem = TYPE_REFERENCE_TO (TREE_TYPE (t));
+ while (tem && TYPE_NEXT_REF_TO (tem) != t)
+ tem = TYPE_NEXT_REF_TO (tem);
+ if (tem)
+ TYPE_NEXT_REF_TO (tem) = TYPE_NEXT_REF_TO (t);
+ }
+ TYPE_NEXT_REF_TO (t) = NULL_TREE;
+ }
+
+ t = new_type;
+ }
+ else
+ *slot = (void *) t;
+
+ return t;
+}
+
+
+/* Show statistics on references to the global type table gimple_types. */
+
+void
+print_gimple_types_stats (void)
+{
+ if (gimple_types)
+ fprintf (stderr, "GIMPLE type table: size %ld, %ld elements, "
+ "%ld searches, %ld collisions (ratio: %f)\n",
+ (long) htab_size (gimple_types),
+ (long) htab_elements (gimple_types),
+ (long) gimple_types->searches,
+ (long) gimple_types->collisions,
+ htab_collisions (gimple_types));
+ else
+ fprintf (stderr, "GIMPLE type table is empty\n");
+ if (gtc_visited)
+ fprintf (stderr, "GIMPLE type comparison table: size %ld, %ld "
+ "elements, %ld searches, %ld collisions (ratio: %f)\n",
+ (long) htab_size (gtc_visited),
+ (long) htab_elements (gtc_visited),
+ (long) gtc_visited->searches,
+ (long) gtc_visited->collisions,
+ htab_collisions (gtc_visited));
+ else
+ fprintf (stderr, "GIMPLE type comparison table is empty\n");
+}
+
+/* Free the gimple type hashtables used for LTO type merging. */
+
+void
+free_gimple_type_tables (void)
+{
+ /* Last chance to print stats for the tables. */
+ if (flag_lto_report)
+ print_gimple_types_stats ();
+
+ if (gimple_types)
+ {
+ htab_delete (gimple_types);
+ gimple_types = NULL;
+ }
+ if (type_hash_cache)
+ {
+ pointer_map_destroy (type_hash_cache);
+ type_hash_cache = NULL;
+ }
+ if (gtc_visited)
+ {
+ htab_delete (gtc_visited);
+ obstack_free (&gtc_ob, NULL);
+ gtc_visited = NULL;
+ }
+}
+
+
+/* Return a type the same as TYPE except unsigned or
+ signed according to UNSIGNEDP. */
+
+static tree
+gimple_signed_or_unsigned_type (bool unsignedp, tree type)
+{
+ tree type1;
+
+ type1 = TYPE_MAIN_VARIANT (type);
+ if (type1 == signed_char_type_node
+ || type1 == char_type_node
+ || type1 == unsigned_char_type_node)
+ return unsignedp ? unsigned_char_type_node : signed_char_type_node;
+ if (type1 == integer_type_node || type1 == unsigned_type_node)
+ return unsignedp ? unsigned_type_node : integer_type_node;
+ if (type1 == short_integer_type_node || type1 == short_unsigned_type_node)
+ return unsignedp ? short_unsigned_type_node : short_integer_type_node;
+ if (type1 == long_integer_type_node || type1 == long_unsigned_type_node)
+ return unsignedp ? long_unsigned_type_node : long_integer_type_node;
+ if (type1 == long_long_integer_type_node
+ || type1 == long_long_unsigned_type_node)
+ return unsignedp
+ ? long_long_unsigned_type_node
+ : long_long_integer_type_node;
+#if HOST_BITS_PER_WIDE_INT >= 64
+ if (type1 == intTI_type_node || type1 == unsigned_intTI_type_node)
+ return unsignedp ? unsigned_intTI_type_node : intTI_type_node;
+#endif
+ if (type1 == intDI_type_node || type1 == unsigned_intDI_type_node)
+ return unsignedp ? unsigned_intDI_type_node : intDI_type_node;
+ if (type1 == intSI_type_node || type1 == unsigned_intSI_type_node)
+ return unsignedp ? unsigned_intSI_type_node : intSI_type_node;
+ if (type1 == intHI_type_node || type1 == unsigned_intHI_type_node)
+ return unsignedp ? unsigned_intHI_type_node : intHI_type_node;
+ if (type1 == intQI_type_node || type1 == unsigned_intQI_type_node)
+ return unsignedp ? unsigned_intQI_type_node : intQI_type_node;
+
+#define GIMPLE_FIXED_TYPES(NAME) \
+ if (type1 == short_ ## NAME ## _type_node \
+ || type1 == unsigned_short_ ## NAME ## _type_node) \
+ return unsignedp ? unsigned_short_ ## NAME ## _type_node \
+ : short_ ## NAME ## _type_node; \
+ if (type1 == NAME ## _type_node \
+ || type1 == unsigned_ ## NAME ## _type_node) \
+ return unsignedp ? unsigned_ ## NAME ## _type_node \
+ : NAME ## _type_node; \
+ if (type1 == long_ ## NAME ## _type_node \
+ || type1 == unsigned_long_ ## NAME ## _type_node) \
+ return unsignedp ? unsigned_long_ ## NAME ## _type_node \
+ : long_ ## NAME ## _type_node; \
+ if (type1 == long_long_ ## NAME ## _type_node \
+ || type1 == unsigned_long_long_ ## NAME ## _type_node) \
+ return unsignedp ? unsigned_long_long_ ## NAME ## _type_node \
+ : long_long_ ## NAME ## _type_node;
+
+#define GIMPLE_FIXED_MODE_TYPES(NAME) \
+ if (type1 == NAME ## _type_node \
+ || type1 == u ## NAME ## _type_node) \
+ return unsignedp ? u ## NAME ## _type_node \
+ : NAME ## _type_node;
+
+#define GIMPLE_FIXED_TYPES_SAT(NAME) \
+ if (type1 == sat_ ## short_ ## NAME ## _type_node \
+ || type1 == sat_ ## unsigned_short_ ## NAME ## _type_node) \
+ return unsignedp ? sat_ ## unsigned_short_ ## NAME ## _type_node \
+ : sat_ ## short_ ## NAME ## _type_node; \
+ if (type1 == sat_ ## NAME ## _type_node \
+ || type1 == sat_ ## unsigned_ ## NAME ## _type_node) \
+ return unsignedp ? sat_ ## unsigned_ ## NAME ## _type_node \
+ : sat_ ## NAME ## _type_node; \
+ if (type1 == sat_ ## long_ ## NAME ## _type_node \
+ || type1 == sat_ ## unsigned_long_ ## NAME ## _type_node) \
+ return unsignedp ? sat_ ## unsigned_long_ ## NAME ## _type_node \
+ : sat_ ## long_ ## NAME ## _type_node; \
+ if (type1 == sat_ ## long_long_ ## NAME ## _type_node \
+ || type1 == sat_ ## unsigned_long_long_ ## NAME ## _type_node) \
+ return unsignedp ? sat_ ## unsigned_long_long_ ## NAME ## _type_node \
+ : sat_ ## long_long_ ## NAME ## _type_node;
+
+#define GIMPLE_FIXED_MODE_TYPES_SAT(NAME) \
+ if (type1 == sat_ ## NAME ## _type_node \
+ || type1 == sat_ ## u ## NAME ## _type_node) \
+ return unsignedp ? sat_ ## u ## NAME ## _type_node \
+ : sat_ ## NAME ## _type_node;
+
+ GIMPLE_FIXED_TYPES (fract);
+ GIMPLE_FIXED_TYPES_SAT (fract);
+ GIMPLE_FIXED_TYPES (accum);
+ GIMPLE_FIXED_TYPES_SAT (accum);
+
+ GIMPLE_FIXED_MODE_TYPES (qq);
+ GIMPLE_FIXED_MODE_TYPES (hq);
+ GIMPLE_FIXED_MODE_TYPES (sq);
+ GIMPLE_FIXED_MODE_TYPES (dq);
+ GIMPLE_FIXED_MODE_TYPES (tq);
+ GIMPLE_FIXED_MODE_TYPES_SAT (qq);
+ GIMPLE_FIXED_MODE_TYPES_SAT (hq);
+ GIMPLE_FIXED_MODE_TYPES_SAT (sq);
+ GIMPLE_FIXED_MODE_TYPES_SAT (dq);
+ GIMPLE_FIXED_MODE_TYPES_SAT (tq);
+ GIMPLE_FIXED_MODE_TYPES (ha);
+ GIMPLE_FIXED_MODE_TYPES (sa);
+ GIMPLE_FIXED_MODE_TYPES (da);
+ GIMPLE_FIXED_MODE_TYPES (ta);
+ GIMPLE_FIXED_MODE_TYPES_SAT (ha);
+ GIMPLE_FIXED_MODE_TYPES_SAT (sa);
+ GIMPLE_FIXED_MODE_TYPES_SAT (da);
+ GIMPLE_FIXED_MODE_TYPES_SAT (ta);
+
+ /* For ENUMERAL_TYPEs in C++, must check the mode of the types, not
+ the precision; they have precision set to match their range, but
+ may use a wider mode to match an ABI. If we change modes, we may
+ wind up with bad conversions. For INTEGER_TYPEs in C, must check
+ the precision as well, so as to yield correct results for
+ bit-field types. C++ does not have these separate bit-field
+ types, and producing a signed or unsigned variant of an
+ ENUMERAL_TYPE may cause other problems as well. */
+ if (!INTEGRAL_TYPE_P (type)
+ || TYPE_UNSIGNED (type) == unsignedp)
+ return type;
+
+#define TYPE_OK(node) \
+ (TYPE_MODE (type) == TYPE_MODE (node) \
+ && TYPE_PRECISION (type) == TYPE_PRECISION (node))
+ if (TYPE_OK (signed_char_type_node))
+ return unsignedp ? unsigned_char_type_node : signed_char_type_node;
+ if (TYPE_OK (integer_type_node))
+ return unsignedp ? unsigned_type_node : integer_type_node;
+ if (TYPE_OK (short_integer_type_node))
+ return unsignedp ? short_unsigned_type_node : short_integer_type_node;
+ if (TYPE_OK (long_integer_type_node))
+ return unsignedp ? long_unsigned_type_node : long_integer_type_node;
+ if (TYPE_OK (long_long_integer_type_node))
+ return (unsignedp
+ ? long_long_unsigned_type_node
+ : long_long_integer_type_node);
+
+#if HOST_BITS_PER_WIDE_INT >= 64
+ if (TYPE_OK (intTI_type_node))
+ return unsignedp ? unsigned_intTI_type_node : intTI_type_node;
+#endif
+ if (TYPE_OK (intDI_type_node))
+ return unsignedp ? unsigned_intDI_type_node : intDI_type_node;
+ if (TYPE_OK (intSI_type_node))
+ return unsignedp ? unsigned_intSI_type_node : intSI_type_node;
+ if (TYPE_OK (intHI_type_node))
+ return unsignedp ? unsigned_intHI_type_node : intHI_type_node;
+ if (TYPE_OK (intQI_type_node))
+ return unsignedp ? unsigned_intQI_type_node : intQI_type_node;
+
+#undef GIMPLE_FIXED_TYPES
+#undef GIMPLE_FIXED_MODE_TYPES
+#undef GIMPLE_FIXED_TYPES_SAT
+#undef GIMPLE_FIXED_MODE_TYPES_SAT
+#undef TYPE_OK
+
+ return build_nonstandard_integer_type (TYPE_PRECISION (type), unsignedp);
+}
+
+
+/* Return an unsigned type the same as TYPE in other respects. */
+
+tree
+gimple_unsigned_type (tree type)
+{
+ return gimple_signed_or_unsigned_type (true, type);
+}
+
+
+/* Return a signed type the same as TYPE in other respects. */
+
+tree
+gimple_signed_type (tree type)
+{
+ return gimple_signed_or_unsigned_type (false, type);
+}
+
+
+/* Return the typed-based alias set for T, which may be an expression
+ or a type. Return -1 if we don't do anything special. */
+
+alias_set_type
+gimple_get_alias_set (tree t)
+{
+ tree u;
+
+ /* Permit type-punning when accessing a union, provided the access
+ is directly through the union. For example, this code does not
+ permit taking the address of a union member and then storing
+ through it. Even the type-punning allowed here is a GCC
+ extension, albeit a common and useful one; the C standard says
+ that such accesses have implementation-defined behavior. */
+ for (u = t;
+ TREE_CODE (u) == COMPONENT_REF || TREE_CODE (u) == ARRAY_REF;
+ u = TREE_OPERAND (u, 0))
+ if (TREE_CODE (u) == COMPONENT_REF
+ && TREE_CODE (TREE_TYPE (TREE_OPERAND (u, 0))) == UNION_TYPE)
+ return 0;
+
+ /* That's all the expressions we handle specially. */
+ if (!TYPE_P (t))
+ return -1;
+
+ /* For convenience, follow the C standard when dealing with
+ character types. Any object may be accessed via an lvalue that
+ has character type. */
+ if (t == char_type_node
+ || t == signed_char_type_node
+ || t == unsigned_char_type_node)
+ return 0;
+
+ /* Allow aliasing between signed and unsigned variants of the same
+ type. We treat the signed variant as canonical. */
+ if (TREE_CODE (t) == INTEGER_TYPE && TYPE_UNSIGNED (t))
+ {
+ tree t1 = gimple_signed_type (t);
+
+ /* t1 == t can happen for boolean nodes which are always unsigned. */
+ if (t1 != t)
+ return get_alias_set (t1);
+ }
+ else if (POINTER_TYPE_P (t))
+ {
+ /* From the common C and C++ langhook implementation:
+
+ Unfortunately, there is no canonical form of a pointer type.
+ In particular, if we have `typedef int I', then `int *', and
+ `I *' are different types. So, we have to pick a canonical
+ representative. We do this below.
+
+ Technically, this approach is actually more conservative that
+ it needs to be. In particular, `const int *' and `int *'
+ should be in different alias sets, according to the C and C++
+ standard, since their types are not the same, and so,
+ technically, an `int **' and `const int **' cannot point at
+ the same thing.
+
+ But, the standard is wrong. In particular, this code is
+ legal C++:
+
+ int *ip;
+ int **ipp = &ip;
+ const int* const* cipp = ipp;
+ And, it doesn't make sense for that to be legal unless you
+ can dereference IPP and CIPP. So, we ignore cv-qualifiers on
+ the pointed-to types. This issue has been reported to the
+ C++ committee. */
+
+ /* In addition to the above canonicalization issue with LTO
+ we should also canonicalize `T (*)[]' to `T *' avoiding
+ alias issues with pointer-to element types and pointer-to
+ array types.
+
+ Likewise we need to deal with the situation of incomplete
+ pointed-to types and make `*(struct X **)&a' and
+ `*(struct X {} **)&a' alias. Otherwise we will have to
+ guarantee that all pointer-to incomplete type variants
+ will be replaced by pointer-to complete type variants if
+ they are available.
+
+ With LTO the convenient situation of using `void *' to
+ access and store any pointer type will also become
+ more apparent (and `void *' is just another pointer-to
+ incomplete type). Assigning alias-set zero to `void *'
+ and all pointer-to incomplete types is a not appealing
+ solution. Assigning an effective alias-set zero only
+ affecting pointers might be - by recording proper subset
+ relationships of all pointer alias-sets.
+
+ Pointer-to function types are another grey area which
+ needs caution. Globbing them all into one alias-set
+ or the above effective zero set would work. */
+
+ /* For now just assign the same alias-set to all pointers.
+ That's simple and avoids all the above problems. */
+ if (t != ptr_type_node)
+ return get_alias_set (ptr_type_node);
+ }
+
+ return -1;
+}
+
+
/* Data structure used to count the number of dereferences to PTR
inside an expression. */
struct count_ptr_d
@@ -3344,7 +4575,6 @@ gimple_decl_printable_name (tree decl, int verbosity)
if (verbosity >= 2)
{
dmgl_opts = DMGL_VERBOSE
- | DMGL_TYPES
| DMGL_ANSI
| DMGL_GNU_V3
| DMGL_RET_POSTFIX;
diff --git a/gcc/gimple.h b/gcc/gimple.h
index e1e3b655b7d..8f6b3522098 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -855,6 +855,8 @@ bool gimple_assign_rhs_could_trap_p (gimple);
void gimple_regimplify_operands (gimple, gimple_stmt_iterator *);
bool empty_body_p (gimple_seq);
unsigned get_gimple_rhs_num_ops (enum tree_code);
+#define gimple_alloc(c, n) gimple_alloc_stat (c, n MEM_STAT_INFO)
+gimple gimple_alloc_stat (enum gimple_code, unsigned MEM_STAT_DECL);
const char *gimple_decl_printable_name (tree, int);
tree gimple_fold_obj_type_ref (tree, tree);
@@ -913,6 +915,12 @@ extern bool is_gimple_call_addr (tree);
extern tree get_call_expr_in (tree t);
extern void recalculate_side_effects (tree);
+extern tree gimple_register_type (tree);
+extern void print_gimple_types_stats (void);
+extern void free_gimple_type_tables (void);
+extern tree gimple_unsigned_type (tree);
+extern tree gimple_signed_type (tree);
+extern alias_set_type gimple_get_alias_set (tree);
extern void count_uses_and_derefs (tree, gimple, unsigned *, unsigned *,
unsigned *);
extern bool walk_stmt_load_store_addr_ops (gimple, void *,
@@ -931,7 +939,6 @@ extern tree create_tmp_var (tree, const char *);
extern tree get_initialized_tmp_var (tree, gimple_seq *, gimple_seq *);
extern tree get_formal_tmp_var (tree, gimple_seq *);
extern void declare_vars (tree, gimple, bool);
-extern void tree_annotate_all_with_location (tree *, location_t);
extern void annotate_all_with_location (gimple_seq, location_t);
/* Validation of GIMPLE expressions. Note that these predicates only check
@@ -2912,6 +2919,16 @@ gimple_eh_must_not_throw_fndecl (gimple gs)
return gs->gimple_eh_mnt.fndecl;
}
+/* Set the function decl to be called by GS to DECL. */
+
+static inline void
+gimple_eh_must_not_throw_set_fndecl (gimple gs, tree decl)
+{
+ GIMPLE_CHECK (gs, GIMPLE_EH_MUST_NOT_THROW);
+ gs->gimple_eh_mnt.fndecl = decl;
+}
+
+
/* GIMPLE_TRY accessors. */
/* Return the kind of try block represented by GIMPLE_TRY GS. This is
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index c0cab205613..d68aacd04f3 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -777,23 +777,6 @@ should_carry_location_p (gimple gs)
return true;
}
-/* Same, but for a tree. */
-
-static bool
-tree_should_carry_location_p (const_tree stmt)
-{
- /* Don't emit a line note for a label. We particularly don't want to
- emit one for the break label, since it doesn't actually correspond
- to the beginning of the loop/switch. */
- if (TREE_CODE (stmt) == LABEL_EXPR)
- return false;
-
- /* Do not annotate empty statements, since it confuses gcov. */
- if (!TREE_SIDE_EFFECTS (stmt))
- return false;
-
- return true;
-}
/* Return true if a location should not be emitted for this statement
by annotate_one_with_location. */
@@ -826,16 +809,6 @@ annotate_one_with_location (gimple gs, location_t location)
gimple_set_location (gs, location);
}
-/* Same, but for tree T. */
-
-static void
-tree_annotate_one_with_location (tree t, location_t location)
-{
- if (CAN_HAVE_LOCATION_P (t)
- && ! EXPR_HAS_LOCATION (t) && tree_should_carry_location_p (t))
- SET_EXPR_LOCATION (t, location);
-}
-
/* Set LOCATION for all the statements after iterator GSI in sequence
SEQ. If GSI is pointing to the end of the sequence, start with the
@@ -872,29 +845,6 @@ annotate_all_with_location (gimple_seq stmt_p, location_t location)
}
}
-/* Same, but for statement or statement list in *STMT_P. */
-
-void
-tree_annotate_all_with_location (tree *stmt_p, location_t location)
-{
- tree_stmt_iterator i;
-
- if (!*stmt_p)
- return;
-
- for (i = tsi_start (*stmt_p); !tsi_end_p (i); tsi_next (&i))
- {
- tree t = tsi_stmt (i);
-
- /* Assuming we've already been gimplified, we shouldn't
- see nested chaining constructs anymore. */
- gcc_assert (TREE_CODE (t) != STATEMENT_LIST
- && TREE_CODE (t) != COMPOUND_EXPR);
-
- tree_annotate_one_with_location (t, location);
- }
-}
-
/* Similar to copy_tree_r() but do not copy SAVE_EXPR or TARGET_EXPR nodes.
These nodes model computations that should only be done once. If we
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index ccf539eb0dc..2eb50df2575 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2084,7 +2084,7 @@ build_poly_scop (scop_p scop)
/* Always return false. Exercise the scop_to_clast function. */
void
-check_poly_representation (scop_p scop)
+check_poly_representation (scop_p scop ATTRIBUTE_UNUSED)
{
#ifdef ENABLE_CHECKING
cloog_prog_clast pc = scop_to_clast (scop);
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index dc0791f6f2f..7cbe1ecee51 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -989,7 +989,7 @@ dep_list_size (rtx insn)
{
if (DEBUG_INSN_P (DEP_CON (dep)))
dbgcount++;
- else
+ else if (!DEBUG_INSN_P (DEP_PRO (dep)))
nodbgcount++;
}
@@ -1688,6 +1688,39 @@ schedule_insn (rtx insn)
should have been removed from the ready list. */
gcc_assert (sd_lists_empty_p (insn, SD_LIST_BACK));
+ /* Reset debug insns invalidated by moving this insn. */
+ if (MAY_HAVE_DEBUG_INSNS && !DEBUG_INSN_P (insn))
+ for (sd_it = sd_iterator_start (insn, SD_LIST_BACK);
+ sd_iterator_cond (&sd_it, &dep);)
+ {
+ rtx dbg = DEP_PRO (dep);
+
+ gcc_assert (DEBUG_INSN_P (dbg));
+
+ if (sched_verbose >= 6)
+ fprintf (sched_dump, ";;\t\tresetting: debug insn %d\n",
+ INSN_UID (dbg));
+
+ /* ??? Rather than resetting the debug insn, we might be able
+ to emit a debug temp before the just-scheduled insn, but
+ this would involve checking that the expression at the
+ point of the debug insn is equivalent to the expression
+ before the just-scheduled insn. They might not be: the
+ expression in the debug insn may depend on other insns not
+ yet scheduled that set MEMs, REGs or even other debug
+ insns. It's not clear that attempting to preserve debug
+ information in these cases is worth the effort, given how
+ uncommon these resets are and the likelihood that the debug
+ temps introduced won't survive the schedule change. */
+ INSN_VAR_LOCATION_LOC (dbg) = gen_rtx_UNKNOWN_VAR_LOC ();
+ df_insn_rescan (dbg);
+
+ /* We delete rather than resolve these deps, otherwise we
+ crash in sched_free_deps(), because forward deps are
+ expected to be released before backward deps. */
+ sd_delete_dep (sd_it);
+ }
+
gcc_assert (QUEUE_INDEX (insn) == QUEUE_NOWHERE);
QUEUE_INDEX (insn) = QUEUE_SCHEDULED;
@@ -1712,6 +1745,12 @@ schedule_insn (rtx insn)
advancing the iterator. */
sd_resolve_dep (sd_it);
+ /* Don't bother trying to mark next as ready if insn is a debug
+ insn. If insn is the last hard dependency, it will have
+ already been discounted. */
+ if (DEBUG_INSN_P (insn) && !DEBUG_INSN_P (next))
+ continue;
+
if (!IS_SPECULATION_BRANCHY_CHECK_P (insn))
{
int effective_cost;
@@ -3715,6 +3754,10 @@ try_ready (rtx next)
{
ds_t ds = DEP_STATUS (dep) & SPECULATIVE;
+ if (DEBUG_INSN_P (DEP_PRO (dep))
+ && !DEBUG_INSN_P (next))
+ continue;
+
if (first_p)
{
first_p = false;
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 1ef2d21f903..4417e6e6b87 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -47,9 +47,6 @@
#include "vecprim.h"
#include "dbgcnt.h"
-#ifndef HAVE_conditional_execution
-#define HAVE_conditional_execution 0
-#endif
#ifndef HAVE_conditional_move
#define HAVE_conditional_move 0
#endif
@@ -1329,11 +1326,15 @@ noce_try_cmove_arith (struct noce_if_info *if_info)
/* ??? FIXME: Magic number 5. */
if (cse_not_expected
&& MEM_P (a) && MEM_P (b)
+ && MEM_ADDR_SPACE (a) == MEM_ADDR_SPACE (b)
&& if_info->branch_cost >= 5)
{
+ enum machine_mode address_mode
+ = targetm.addr_space.address_mode (MEM_ADDR_SPACE (a));
+
a = XEXP (a, 0);
b = XEXP (b, 0);
- x = gen_reg_rtx (Pmode);
+ x = gen_reg_rtx (address_mode);
is_mem = 1;
}
@@ -1482,6 +1483,9 @@ noce_try_cmove_arith (struct noce_if_info *if_info)
set_mem_align (tmp,
MIN (MEM_ALIGN (if_info->a), MEM_ALIGN (if_info->b)));
+ gcc_assert (MEM_ADDR_SPACE (if_info->a) == MEM_ADDR_SPACE (if_info->b));
+ set_mem_addr_space (tmp, MEM_ADDR_SPACE (if_info->a));
+
noce_emit_move_insn (if_info->x, tmp);
}
else if (target != x)
@@ -2419,7 +2423,7 @@ noce_process_if_block (struct noce_if_info *if_info)
if (HAVE_conditional_move
&& noce_try_cmove (if_info))
goto success;
- if (! HAVE_conditional_execution)
+ if (! targetm.have_conditional_execution ())
{
if (noce_try_store_flag_constants (if_info))
goto success;
@@ -3063,7 +3067,7 @@ find_if_header (basic_block test_bb, int pass)
&& noce_find_if_block (test_bb, then_edge, else_edge, pass))
goto success;
- if (HAVE_conditional_execution && reload_completed
+ if (targetm.have_conditional_execution () && reload_completed
&& cond_exec_find_if_block (&ce_info))
goto success;
@@ -3073,7 +3077,7 @@ find_if_header (basic_block test_bb, int pass)
goto success;
if (dom_info_state (CDI_POST_DOMINATORS) >= DOM_NO_FAST_QUERY
- && (! HAVE_conditional_execution || reload_completed))
+ && (! targetm.have_conditional_execution () || reload_completed))
{
if (find_if_case_1 (test_bb, then_edge, else_edge))
goto success;
@@ -3180,7 +3184,7 @@ cond_exec_find_if_block (struct ce_if_block * ce_info)
/* We only ever should get here after reload,
and only if we have conditional execution. */
- gcc_assert (HAVE_conditional_execution && reload_completed);
+ gcc_assert (targetm.have_conditional_execution () && reload_completed);
/* Discover if any fall through predecessors of the current test basic block
were && tests (which jump to the else block) or || tests (which jump to
@@ -3858,7 +3862,7 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb,
/* Disable handling dead code by conditional execution if the machine needs
to do anything funny with the tests, etc. */
#ifndef IFCVT_MODIFY_TESTS
- if (HAVE_conditional_execution)
+ if (targetm.have_conditional_execution ())
{
/* In the conditional execution case, we have things easy. We know
the condition is reversible. We don't have to check life info
diff --git a/gcc/input.h b/gcc/input.h
index 299f56c3ce6..7f00dc7cd0a 100644
--- a/gcc/input.h
+++ b/gcc/input.h
@@ -1,6 +1,6 @@
/* Declarations for variables relating to reading the source file.
Used by parsers, lexical analyzers, and error message routines.
- Copyright (C) 1993, 1997, 1998, 2000, 2003, 2004, 2007, 2008
+ Copyright (C) 1993, 1997, 1998, 2000, 2003, 2004, 2007, 2008, 2009
Free Software Foundation, Inc.
This file is part of GCC.
@@ -30,7 +30,12 @@ extern GTY(()) struct line_maps *line_table;
#define UNKNOWN_LOCATION ((source_location) 0)
/* The location for declarations in "<built-in>" */
-#define BUILTINS_LOCATION ((source_location) 2)
+#define BUILTINS_LOCATION ((source_location) 1)
+
+/* line-map.c reserves RESERVED_LOCATION_COUNT to the user. Ensure
+ both UNKNOWN_LOCATION and BUILTINS_LOCATION fit into that. */
+extern char builtins_location_check[(BUILTINS_LOCATION
+ < RESERVED_LOCATION_COUNT) ? 1 : -1];
typedef struct GTY (())
{
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index f7782cbbf83..79ff16e0e7f 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -299,9 +299,16 @@ ipcp_lattice_from_jfunc (struct ipa_node_params *info, struct ipcp_lattice *lat,
cst = caller_lat->constant;
if (jfunc->value.pass_through.operation != NOP_EXPR)
- cst = fold_binary (jfunc->value.pass_through.operation,
- TREE_TYPE (cst), cst,
- jfunc->value.pass_through.operand);
+ {
+ tree restype;
+ if (TREE_CODE_CLASS (jfunc->value.pass_through.operation)
+ == tcc_comparison)
+ restype = boolean_type_node;
+ else
+ restype = TREE_TYPE (cst);
+ cst = fold_binary (jfunc->value.pass_through.operation,
+ restype, cst, jfunc->value.pass_through.operand);
+ }
if (!cst || !is_gimple_ip_invariant (cst))
lat->type = IPA_BOTTOM;
lat->constant = cst;
@@ -442,7 +449,7 @@ ipcp_cloning_candidate_p (struct cgraph_node *node)
FIXME: in future we should clone such functions when they are called with
different constants, but current ipcp implementation is not good on this.
*/
- if (!node->needed || !node->analyzed)
+ if (cgraph_only_called_directly_p (node) || !node->analyzed)
return false;
if (cgraph_function_body_availability (node) <= AVAIL_OVERWRITABLE)
@@ -536,7 +543,7 @@ ipcp_initialize_node_lattices (struct cgraph_node *node)
if (ipa_is_called_with_var_arguments (info))
type = IPA_BOTTOM;
- else if (!node->needed)
+ else if (cgraph_only_called_directly_p (node))
type = IPA_TOP;
/* When cloning is allowed, we can assume that externally visible functions
are not called. We will compensate this by cloning later. */
@@ -607,7 +614,9 @@ ipcp_init_stage (void)
/* building jump functions */
for (cs = node->callees; cs; cs = cs->next_callee)
{
- if (!cs->callee->analyzed)
+ /* We do not need to bother analyzing calls to unknown
+ functions unless they may become known during lto/whopr. */
+ if (!cs->callee->analyzed && !flag_lto && !flag_whopr)
continue;
ipa_count_arguments (cs);
if (ipa_get_cs_argument_count (IPA_EDGE_REF (cs))
@@ -689,7 +698,9 @@ ipcp_propagate_stage (void)
struct ipa_node_params *callee_info = IPA_NODE_REF (cs->callee);
struct ipa_edge_args *args = IPA_EDGE_REF (cs);
- if (ipa_is_called_with_var_arguments (callee_info))
+ if (ipa_is_called_with_var_arguments (callee_info)
+ || !cs->callee->analyzed
+ || ipa_is_called_with_var_arguments (callee_info))
continue;
count = ipa_get_cs_argument_count (args);
@@ -720,6 +731,10 @@ ipcp_iterate_stage (void)
if (dump_file)
fprintf (dump_file, "\nIPA iterate stage:\n\n");
+
+ if (in_lto_p)
+ ipa_update_after_lto_read ();
+
for (node = cgraph_nodes; node; node = node->next)
{
ipcp_initialize_node_lattices (node);
@@ -954,7 +969,7 @@ ipcp_estimate_growth (struct cgraph_node *node)
struct cgraph_edge *cs;
int redirectable_node_callers = 0;
int removable_args = 0;
- bool need_original = node->needed;
+ bool need_original = !cgraph_only_called_directly_p (node);
struct ipa_node_params *info;
int i, count;
int growth;
@@ -1143,7 +1158,7 @@ ipcp_insert_stage (void)
for (cs = node->callers; cs != NULL; cs = cs->next_caller)
if (cs->caller == node || ipcp_need_redirect_p (cs))
break;
- if (!cs && !node->needed)
+ if (!cs && cgraph_only_called_directly_p (node))
bitmap_set_bit (dead_nodes, node->uid);
info = IPA_NODE_REF (node);
@@ -1269,6 +1284,20 @@ ipcp_generate_summary (void)
ipcp_init_stage ();
}
+/* Write ipcp summary for nodes in SET. */
+static void
+ipcp_write_summary (cgraph_node_set set)
+{
+ ipa_prop_write_jump_functions (set);
+}
+
+/* Read ipcp summary. */
+static void
+ipcp_read_summary (void)
+{
+ ipa_prop_read_jump_functions ();
+}
+
/* Gate for IPCP optimization. */
static bool
cgraph_gate_cp (void)
@@ -1295,8 +1324,8 @@ struct ipa_opt_pass_d pass_ipa_cp =
TODO_remove_functions /* todo_flags_finish */
},
ipcp_generate_summary, /* generate_summary */
- NULL, /* write_summary */
- NULL, /* read_summary */
+ ipcp_write_summary, /* write_summary */
+ ipcp_read_summary, /* read_summary */
NULL, /* function_read_summary */
0, /* TODOs */
NULL, /* function_transform */
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 8851d605372..bc7048f51c6 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -223,7 +223,7 @@ cgraph_clone_inlined_nodes (struct cgraph_edge *e, bool duplicate,
/* We may eliminate the need for out-of-line copy to be output.
In that case just go ahead and re-use it. */
if (!e->callee->callers->next_caller
- && !e->callee->needed
+ && cgraph_can_remove_if_no_direct_calls_p (e->callee)
&& !cgraph_new_nodes)
{
gcc_assert (!e->callee->global.inlined_to);
@@ -233,6 +233,7 @@ cgraph_clone_inlined_nodes (struct cgraph_edge *e, bool duplicate,
nfunctions_inlined++;
}
duplicate = false;
+ e->callee->local.externally_visible = false;
}
else
{
@@ -286,7 +287,7 @@ cgraph_mark_inline_edge (struct cgraph_edge *e, bool update_original,
e->callee->global.inlined = true;
if (e->callee->callers->next_caller
- || e->callee->needed)
+ || !cgraph_can_remove_if_no_direct_calls_p (e->callee))
duplicate = true;
cgraph_clone_inlined_nodes (e, true, update_original);
@@ -309,7 +310,7 @@ cgraph_mark_inline_edge (struct cgraph_edge *e, bool update_original,
overall_size -= orig_size;
ncalls_inlined++;
- if (flag_indirect_inlining)
+ if (flag_indirect_inlining && !flag_wpa)
return ipa_propagate_indirect_call_infos (curr, new_edges);
else
return false;
@@ -326,7 +327,7 @@ cgraph_mark_inline (struct cgraph_edge *edge)
struct cgraph_node *what = edge->callee;
struct cgraph_edge *e, *next;
- gcc_assert (!gimple_call_cannot_inline_p (edge->call_stmt));
+ gcc_assert (!edge->call_stmt_cannot_inline_p);
/* Look for all calls, mark them inline and clone recursively
all inlined functions. */
for (e = what->callers; e; e = next)
@@ -368,7 +369,8 @@ cgraph_estimate_growth (struct cgraph_node *node)
we decide to not inline for different reasons, but it is not big deal
as in that case we will keep the body around, but we will also avoid
some inlining. */
- if (!node->needed && !DECL_EXTERNAL (node->decl) && !self_recursive)
+ if (cgraph_only_called_directly_p (node)
+ && !DECL_EXTERNAL (node->decl) && !self_recursive)
growth -= node->global.size;
node->global.estimated_growth = growth;
@@ -874,7 +876,7 @@ cgraph_decide_inlining_of_small_functions (void)
int min_size, max_size;
VEC (cgraph_edge_p, heap) *new_indirect_edges = NULL;
- if (flag_indirect_inlining)
+ if (flag_indirect_inlining && !flag_wpa)
new_indirect_edges = VEC_alloc (cgraph_edge_p, heap, 8);
if (dump_file)
@@ -1021,17 +1023,17 @@ cgraph_decide_inlining_of_small_functions (void)
if (where->global.inlined_to)
where = where->global.inlined_to;
if (!cgraph_decide_recursive_inlining (where,
- flag_indirect_inlining
+ flag_indirect_inlining && !flag_wpa
? &new_indirect_edges : NULL))
continue;
- if (flag_indirect_inlining)
+ if (flag_indirect_inlining && !flag_wpa)
add_new_edges_to_heap (heap, new_indirect_edges);
update_callee_keys (heap, where, updated_nodes);
}
else
{
struct cgraph_node *callee;
- if (gimple_call_cannot_inline_p (edge->call_stmt)
+ if (edge->call_stmt_cannot_inline_p
|| !cgraph_check_inline_limits (edge->caller, edge->callee,
&edge->inline_failed, true))
{
@@ -1043,7 +1045,7 @@ cgraph_decide_inlining_of_small_functions (void)
}
callee = edge->callee;
cgraph_mark_inline_edge (edge, true, &new_indirect_edges);
- if (flag_indirect_inlining)
+ if (flag_indirect_inlining && !flag_wpa)
add_new_edges_to_heap (heap, new_indirect_edges);
update_callee_keys (heap, callee, updated_nodes);
@@ -1112,6 +1114,8 @@ cgraph_decide_inlining (void)
int initial_size = 0;
cgraph_remove_function_insertion_hook (function_insertion_hook_holder);
+ if (in_lto_p && flag_indirect_inlining && !flag_wpa)
+ ipa_update_after_lto_read ();
max_count = 0;
max_benefit = 0;
@@ -1121,7 +1125,6 @@ cgraph_decide_inlining (void)
struct cgraph_edge *e;
gcc_assert (inline_summary (node)->self_size == node->global.size);
- gcc_assert (node->needed || node->reachable);
initial_size += node->global.size;
for (e = node->callees; e; e = e->next_callee)
if (max_count < e->count)
@@ -1129,7 +1132,9 @@ cgraph_decide_inlining (void)
if (max_benefit < inline_summary (node)->time_inlining_benefit)
max_benefit = inline_summary (node)->time_inlining_benefit;
}
- gcc_assert (!max_count || (profile_info && flag_branch_probabilities));
+ gcc_assert (in_lto_p
+ || !max_count
+ || (profile_info && flag_branch_probabilities));
overall_size = initial_size;
nnodes = cgraph_postorder (order);
@@ -1177,8 +1182,7 @@ cgraph_decide_inlining (void)
for (e = node->callers; e; e = next)
{
next = e->next_caller;
- if (!e->inline_failed
- || gimple_call_cannot_inline_p (e->call_stmt))
+ if (!e->inline_failed || e->call_stmt_cannot_inline_p)
continue;
if (cgraph_recursive_inlining_p (e->caller, e->callee,
&e->inline_failed))
@@ -1220,15 +1224,16 @@ cgraph_decide_inlining (void)
if (node->callers
&& !node->callers->next_caller
- && !node->needed
+ && cgraph_only_called_directly_p (node)
&& node->local.inlinable
&& node->callers->inline_failed
&& node->callers->caller != node
&& node->callers->caller->global.inlined_to != node
- && !gimple_call_cannot_inline_p (node->callers->call_stmt)
+ && !node->callers->call_stmt_cannot_inline_p
&& !DECL_EXTERNAL (node->decl)
&& !DECL_COMDAT (node->decl))
{
+ cgraph_inline_failed_t reason;
old_size = overall_size;
if (dump_file)
{
@@ -1242,7 +1247,7 @@ cgraph_decide_inlining (void)
}
if (cgraph_check_inline_limits (node->callers->caller, node,
- NULL, false))
+ &reason, false))
{
cgraph_mark_inline (node->callers);
if (dump_file)
@@ -1257,14 +1262,15 @@ cgraph_decide_inlining (void)
{
if (dump_file)
fprintf (dump_file,
- " Inline limit reached, not inlined.\n");
+ " Not inlining: %s.\n",
+ cgraph_inline_failed_string (reason));
}
}
}
}
/* Free ipa-prop structures if they are no longer needed. */
- if (flag_indirect_inlining)
+ if (flag_indirect_inlining && !flag_wpa)
free_all_ipa_structures_after_iinln ();
if (dump_file)
@@ -1411,7 +1417,7 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node,
if (!e->callee->local.disregard_inline_limits
&& (mode != INLINE_ALL || !e->callee->local.inlinable))
continue;
- if (gimple_call_cannot_inline_p (e->call_stmt))
+ if (e->call_stmt_cannot_inline_p)
continue;
/* When the edge is already inlined, we just need to recurse into
it in order to fully flatten the leaves. */
@@ -1529,7 +1535,7 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node,
}
if (!cgraph_check_inline_limits (node, e->callee, &e->inline_failed,
false)
- || gimple_call_cannot_inline_p (e->call_stmt))
+ || e->call_stmt_cannot_inline_p)
{
if (dump_file)
{
@@ -1585,10 +1591,10 @@ cgraph_early_inlining (void)
if (sorrycount || errorcount)
return 0;
- while (cgraph_decide_inlining_incrementally (node,
- iterations
- ? INLINE_SIZE_NORECURSIVE : INLINE_SIZE, 0)
- && iterations < PARAM_VALUE (PARAM_EARLY_INLINER_MAX_ITERATIONS))
+ while (iterations < PARAM_VALUE (PARAM_EARLY_INLINER_MAX_ITERATIONS)
+ && cgraph_decide_inlining_incrementally (node,
+ iterations
+ ? INLINE_SIZE_NORECURSIVE : INLINE_SIZE, 0))
{
timevar_push (TV_INTEGRATION);
todo |= optimize_inline_calls (current_function_decl);
@@ -1632,6 +1638,7 @@ static bool
cgraph_gate_ipa_early_inlining (void)
{
return (flag_early_inlining
+ && !in_lto_p
&& (flag_branch_probabilities || flag_test_coverage
|| profile_arc_flag));
}
@@ -1963,6 +1970,34 @@ inline_transform (struct cgraph_node *node)
return todo | execute_fixup_cfg ();
}
+/* Read inline summary. Jump functions are shared among ipa-cp
+ and inliner, so when ipa-cp is active, we don't need to write them
+ twice. */
+
+static void
+inline_read_summary (void)
+{
+ if (flag_indirect_inlining && !flag_wpa)
+ {
+ ipa_register_cgraph_hooks ();
+ if (!flag_ipa_cp)
+ ipa_prop_read_jump_functions ();
+ }
+ function_insertion_hook_holder =
+ cgraph_add_function_insertion_hook (&add_new_function, NULL);
+}
+
+/* Write inline summary for node in SET.
+ Jump functions are shared among ipa-cp and inliner, so when ipa-cp is
+ active, we don't need to write them twice. */
+
+static void
+inline_write_summary (cgraph_node_set set)
+{
+ if (flag_indirect_inlining && !flag_ipa_cp)
+ ipa_prop_write_jump_functions (set);
+}
+
struct ipa_opt_pass_d pass_ipa_inline =
{
{
@@ -1982,8 +2017,8 @@ struct ipa_opt_pass_d pass_ipa_inline =
| TODO_remove_functions /* todo_flags_finish */
},
inline_generate_summary, /* generate_summary */
- NULL, /* write_summary */
- NULL, /* read_summary */
+ inline_write_summary, /* write_summary */
+ inline_read_summary, /* read_summary */
NULL, /* function_read_summary */
0, /* TODOs */
inline_transform, /* function_transform */
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 23710067ee7..9956fbc53b7 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -33,11 +33,12 @@ along with GCC; see the file COPYING3. If not see
#include "timevar.h"
#include "flags.h"
#include "diagnostic.h"
+#include "lto-streamer.h"
/* Vector where the parameter infos are actually stored. */
VEC (ipa_node_params_t, heap) *ipa_node_params_vector;
/* Vector where the parameter infos are actually stored. */
-VEC (ipa_edge_args_t, heap) *ipa_edge_args_vector;
+VEC (ipa_edge_args_t, gc) *ipa_edge_args_vector;
/* Holders of ipa cgraph hooks: */
static struct cgraph_edge_hook_list *edge_removal_hook_holder;
@@ -248,7 +249,7 @@ ipa_count_arguments (struct cgraph_edge *cs)
arg_num = gimple_call_num_args (stmt);
if (VEC_length (ipa_edge_args_t, ipa_edge_args_vector)
<= (unsigned) cgraph_edge_max_uid)
- VEC_safe_grow_cleared (ipa_edge_args_t, heap,
+ VEC_safe_grow_cleared (ipa_edge_args_t, gc,
ipa_edge_args_vector, cgraph_edge_max_uid + 1);
ipa_set_cs_argument_count (IPA_EDGE_REF (cs), arg_num);
}
@@ -357,6 +358,9 @@ compute_complex_pass_through (struct ipa_node_params *info,
{
if (TREE_CODE (op1) != SSA_NAME
|| !SSA_NAME_IS_DEFAULT_DEF (op1)
+ || (TREE_CODE_CLASS (gimple_expr_code (stmt)) != tcc_comparison
+ && !useless_type_conversion_p (TREE_TYPE (name),
+ TREE_TYPE (op1)))
|| !is_gimple_ip_invariant (op2))
return;
@@ -658,8 +662,8 @@ ipa_compute_jump_functions (struct cgraph_edge *cs)
if (ipa_get_cs_argument_count (arguments) == 0 || arguments->jump_functions)
return;
- arguments->jump_functions = XCNEWVEC (struct ipa_jump_func,
- ipa_get_cs_argument_count (arguments));
+ arguments->jump_functions = GGC_CNEWVEC (struct ipa_jump_func,
+ ipa_get_cs_argument_count (arguments));
call = cs->call_stmt;
gcc_assert (is_gimple_call (call));
@@ -1150,6 +1154,10 @@ bool
ipa_propagate_indirect_call_infos (struct cgraph_edge *cs,
VEC (cgraph_edge_p, heap) **new_edges)
{
+ /* FIXME lto: We do not stream out indirect call information. */
+ if (flag_wpa)
+ return false;
+
/* Do nothing if the preparation phase has not been carried out yet
(i.e. during early inlining). */
if (!ipa_node_params_vector)
@@ -1166,7 +1174,7 @@ void
ipa_free_edge_args_substructures (struct ipa_edge_args *args)
{
if (args->jump_functions)
- free (args->jump_functions);
+ ggc_free (args->jump_functions);
memset (args, 0, sizeof (*args));
}
@@ -1184,7 +1192,7 @@ ipa_free_all_edge_args (void)
i++)
ipa_free_edge_args_substructures (args);
- VEC_free (ipa_edge_args_t, heap, ipa_edge_args_vector);
+ VEC_free (ipa_edge_args_t, gc, ipa_edge_args_vector);
ipa_edge_args_vector = NULL;
}
@@ -1255,7 +1263,22 @@ duplicate_array (void *src, size_t n)
if (!src)
return NULL;
- p = xcalloc (1, n);
+ p = xmalloc (n);
+ memcpy (p, src, n);
+ return p;
+}
+
+/* Like duplicate_array byt in GGC memory. */
+
+static void *
+duplicate_ggc_array (void *src, size_t n)
+{
+ void *p;
+
+ if (!src)
+ return NULL;
+
+ p = ggc_alloc (n);
memcpy (p, src, n);
return p;
}
@@ -1277,8 +1300,8 @@ ipa_edge_duplication_hook (struct cgraph_edge *src, struct cgraph_edge *dst,
arg_count = ipa_get_cs_argument_count (old_args);
ipa_set_cs_argument_count (new_args, arg_count);
new_args->jump_functions = (struct ipa_jump_func *)
- duplicate_array (old_args->jump_functions,
- sizeof (struct ipa_jump_func) * arg_count);
+ duplicate_ggc_array (old_args->jump_functions,
+ sizeof (struct ipa_jump_func) * arg_count);
}
/* Hook that is called by cgraph.c when a node is duplicated. */
@@ -1394,7 +1417,9 @@ ipa_print_node_params (FILE * f, struct cgraph_node *node)
temp = ipa_get_param (info, i);
if (TREE_CODE (temp) == PARM_DECL)
fprintf (f, " param %d : %s", i,
- (*lang_hooks.decl_printable_name) (temp, 2));
+ (DECL_NAME (temp)
+ ? (*lang_hooks.decl_printable_name) (temp, 2)
+ : "(unnamed)"));
if (ipa_is_param_modified (info, i))
fprintf (f, " modified");
if (ipa_is_param_called (info, i))
@@ -1866,3 +1891,283 @@ ipa_dump_param_adjustments (FILE *file, ipa_parm_adjustment_vec adjustments,
VEC_free (tree, heap, parms);
}
+/* Stream out jump function JUMP_FUNC to OB. */
+
+static void
+ipa_write_jump_function (struct output_block *ob,
+ struct ipa_jump_func *jump_func)
+{
+ lto_output_uleb128_stream (ob->main_stream,
+ jump_func->type);
+
+ switch (jump_func->type)
+ {
+ case IPA_JF_UNKNOWN:
+ break;
+ case IPA_JF_CONST:
+ lto_output_tree (ob, jump_func->value.constant, true);
+ break;
+ case IPA_JF_PASS_THROUGH:
+ lto_output_tree (ob, jump_func->value.pass_through.operand, true);
+ lto_output_uleb128_stream (ob->main_stream,
+ jump_func->value.pass_through.formal_id);
+ lto_output_uleb128_stream (ob->main_stream,
+ jump_func->value.pass_through.operation);
+ break;
+ case IPA_JF_ANCESTOR:
+ lto_output_uleb128_stream (ob->main_stream,
+ jump_func->value.ancestor.offset);
+ lto_output_tree (ob, jump_func->value.ancestor.type, true);
+ lto_output_uleb128_stream (ob->main_stream,
+ jump_func->value.ancestor.formal_id);
+ break;
+ case IPA_JF_CONST_MEMBER_PTR:
+ lto_output_tree (ob, jump_func->value.member_cst.pfn, true);
+ lto_output_tree (ob, jump_func->value.member_cst.delta, false);
+ break;
+ }
+}
+
+/* Read in jump function JUMP_FUNC from IB. */
+
+static void
+ipa_read_jump_function (struct lto_input_block *ib,
+ struct ipa_jump_func *jump_func,
+ struct data_in *data_in)
+{
+ jump_func->type = (enum jump_func_type) lto_input_uleb128 (ib);
+
+ switch (jump_func->type)
+ {
+ case IPA_JF_UNKNOWN:
+ break;
+ case IPA_JF_CONST:
+ jump_func->value.constant = lto_input_tree (ib, data_in);
+ break;
+ case IPA_JF_PASS_THROUGH:
+ jump_func->value.pass_through.operand = lto_input_tree (ib, data_in);
+ jump_func->value.pass_through.formal_id = lto_input_uleb128 (ib);
+ jump_func->value.pass_through.operation = (enum tree_code) lto_input_uleb128 (ib);
+ break;
+ case IPA_JF_ANCESTOR:
+ jump_func->value.ancestor.offset = lto_input_uleb128 (ib);
+ jump_func->value.ancestor.type = lto_input_tree (ib, data_in);
+ jump_func->value.ancestor.formal_id = lto_input_uleb128 (ib);
+ break;
+ case IPA_JF_CONST_MEMBER_PTR:
+ jump_func->value.member_cst.pfn = lto_input_tree (ib, data_in);
+ jump_func->value.member_cst.delta = lto_input_tree (ib, data_in);
+ break;
+ }
+}
+
+/* Stream out NODE info to OB. */
+
+static void
+ipa_write_node_info (struct output_block *ob, struct cgraph_node *node)
+{
+ int node_ref;
+ lto_cgraph_encoder_t encoder;
+ struct ipa_node_params *info = IPA_NODE_REF (node);
+ int j;
+ struct cgraph_edge *e;
+ struct bitpack_d *bp;
+
+ encoder = ob->decl_state->cgraph_node_encoder;
+ node_ref = lto_cgraph_encoder_encode (encoder, node);
+ lto_output_uleb128_stream (ob->main_stream, node_ref);
+
+ /* Note that flags will need to be read in the opposite
+ order as we are pushing the bitflags into FLAGS. */
+ bp = bitpack_create ();
+ bp_pack_value (bp, info->called_with_var_arguments, 1);
+ gcc_assert (info->modification_analysis_done || ipa_get_param_count (info) == 0);
+ gcc_assert (info->uses_analysis_done || ipa_get_param_count (info) == 0);
+ gcc_assert (!info->node_enqueued);
+ gcc_assert (!info->ipcp_orig_node);
+ for (j = 0; j < ipa_get_param_count (info); j++)
+ {
+ bp_pack_value (bp, info->params[j].modified, 1);
+ bp_pack_value (bp, info->params[j].called, 1);
+ }
+ lto_output_bitpack (ob->main_stream, bp);
+ bitpack_delete (bp);
+ for (e = node->callees; e; e = e->next_callee)
+ {
+ struct ipa_edge_args *args = IPA_EDGE_REF (e);
+
+ lto_output_uleb128_stream (ob->main_stream, ipa_get_cs_argument_count (args));
+ for (j = 0; j < ipa_get_cs_argument_count (args); j++)
+ ipa_write_jump_function (ob, ipa_get_ith_jump_func (args, j));
+ }
+}
+
+/* Srtream in NODE info from IB. */
+
+static void
+ipa_read_node_info (struct lto_input_block *ib, struct cgraph_node *node,
+ struct data_in *data_in)
+{
+ struct ipa_node_params *info = IPA_NODE_REF (node);
+ int k;
+ struct cgraph_edge *e;
+ struct bitpack_d *bp;
+
+ ipa_initialize_node_params (node);
+
+ /* Note that the flags must be read in the opposite
+ order in which they were written (the bitflags were
+ pushed into FLAGS). */
+ bp = lto_input_bitpack (ib);
+ info->called_with_var_arguments = bp_unpack_value (bp, 1);
+ if (ipa_get_param_count (info) != 0)
+ {
+ info->modification_analysis_done = true;
+ info->uses_analysis_done = true;
+ }
+ info->node_enqueued = false;
+ for (k = 0; k < ipa_get_param_count (info); k++)
+ {
+ info->params[k].modified = bp_unpack_value (bp, 1);
+ info->params[k].called = bp_unpack_value (bp, 1);
+ }
+ bitpack_delete (bp);
+ for (e = node->callees; e; e = e->next_callee)
+ {
+ struct ipa_edge_args *args = IPA_EDGE_REF (e);
+ int count = lto_input_uleb128 (ib);
+
+ if (VEC_length (ipa_edge_args_t, ipa_edge_args_vector)
+ <= (unsigned) cgraph_edge_max_uid)
+ VEC_safe_grow_cleared (ipa_edge_args_t, gc,
+ ipa_edge_args_vector, cgraph_edge_max_uid + 1);
+ ipa_set_cs_argument_count (args, count);
+ if (!count)
+ continue;
+
+ args->jump_functions = GGC_CNEWVEC (struct ipa_jump_func,
+ ipa_get_cs_argument_count (args));
+ for (k = 0; k < ipa_get_cs_argument_count (args); k++)
+ ipa_read_jump_function (ib, ipa_get_ith_jump_func (args, k), data_in);
+ }
+}
+
+/* Write jump functions for nodes in SET. */
+
+void
+ipa_prop_write_jump_functions (cgraph_node_set set)
+{
+ struct cgraph_node *node;
+ struct output_block *ob = create_output_block (LTO_section_jump_functions);
+ unsigned int count = 0;
+ cgraph_node_set_iterator csi;
+
+ ob->cgraph_node = NULL;
+
+ for (csi = csi_start (set); !csi_end_p (csi); csi_next (&csi))
+ {
+ node = csi_node (csi);
+ if (node->analyzed && IPA_NODE_REF (node) != NULL)
+ count++;
+ }
+
+ lto_output_uleb128_stream (ob->main_stream, count);
+
+ /* Process all of the functions. */
+ for (csi = csi_start (set); !csi_end_p (csi); csi_next (&csi))
+ {
+ node = csi_node (csi);
+ if (node->analyzed && IPA_NODE_REF (node) != NULL)
+ ipa_write_node_info (ob, node);
+ }
+ lto_output_1_stream (ob->main_stream, 0);
+ produce_asm (ob, NULL);
+ destroy_output_block (ob);
+}
+
+/* Read section in file FILE_DATA of length LEN with data DATA. */
+
+static void
+ipa_prop_read_section (struct lto_file_decl_data *file_data, const char *data,
+ size_t len)
+{
+ const struct lto_function_header *header =
+ (const struct lto_function_header *) data;
+ const int32_t cfg_offset = sizeof (struct lto_function_header);
+ const int32_t main_offset = cfg_offset + header->cfg_size;
+ const int32_t string_offset = main_offset + header->main_size;
+ struct data_in *data_in;
+ struct lto_input_block ib_main;
+ unsigned int i;
+ unsigned int count;
+
+ LTO_INIT_INPUT_BLOCK (ib_main, (const char *) data + main_offset, 0,
+ header->main_size);
+
+ data_in =
+ lto_data_in_create (file_data, (const char *) data + string_offset,
+ header->string_size, NULL);
+ count = lto_input_uleb128 (&ib_main);
+
+ for (i = 0; i < count; i++)
+ {
+ unsigned int index;
+ struct cgraph_node *node;
+ lto_cgraph_encoder_t encoder;
+
+ index = lto_input_uleb128 (&ib_main);
+ encoder = file_data->cgraph_node_encoder;
+ node = lto_cgraph_encoder_deref (encoder, index);
+ ipa_read_node_info (&ib_main, node, data_in);
+ }
+ lto_free_section_data (file_data, LTO_section_jump_functions, NULL, data,
+ len);
+ lto_data_in_delete (data_in);
+}
+
+/* Read ipcp jump functions. */
+
+void
+ipa_prop_read_jump_functions (void)
+{
+ struct lto_file_decl_data **file_data_vec = lto_get_file_decl_data ();
+ struct lto_file_decl_data *file_data;
+ unsigned int j = 0;
+
+ ipa_check_create_node_params ();
+ ipa_check_create_edge_args ();
+ ipa_register_cgraph_hooks ();
+
+ while ((file_data = file_data_vec[j++]))
+ {
+ size_t len;
+ const char *data = lto_get_section_data (file_data, LTO_section_jump_functions, NULL, &len);
+
+ if (data)
+ ipa_prop_read_section (file_data, data, len);
+ }
+}
+
+/* After merging units, we can get mismatch in argument counts.
+ Also decl merging might've rendered parameter lists obsolette.
+ Also compute called_with_variable_arg info. */
+
+void
+ipa_update_after_lto_read (void)
+{
+ struct cgraph_node *node;
+ struct cgraph_edge *cs;
+
+ for (node = cgraph_nodes; node; node = node->next)
+ {
+ if (!node->analyzed)
+ continue;
+ ipa_populate_param_decls (node, IPA_NODE_REF (node));
+ for (cs = node->callees; cs; cs = cs->next_callee)
+ {
+ if (ipa_get_cs_argument_count (IPA_EDGE_REF (cs))
+ != ipa_get_param_count (IPA_NODE_REF (cs->callee)))
+ ipa_set_called_with_variable_arg (IPA_NODE_REF (cs->callee));
+ }
+ }
+}
diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h
index 9b5f74f87ad..35005954deb 100644
--- a/gcc/ipa-prop.h
+++ b/gcc/ipa-prop.h
@@ -72,7 +72,7 @@ enum ipa_lattice_type
/* Structure holding data required to describe a pass-through jump function. */
-struct ipa_pass_through_data
+struct GTY(()) ipa_pass_through_data
{
/* If an operation is to be performed on the original parameter, this is the
second (constant) operand. */
@@ -89,7 +89,7 @@ struct ipa_pass_through_data
/* Structure holding data required to describe and ancestor pass throu
funkci. */
-struct ipa_ancestor_jf_data
+struct GTY(()) ipa_ancestor_jf_data
{
/* Offset of the field representing the ancestor. */
HOST_WIDE_INT offset;
@@ -101,30 +101,28 @@ struct ipa_ancestor_jf_data
/* Structure holding a C++ member pointer constant. Holds a pointer to the
method and delta offset. */
-struct ipa_member_ptr_cst
+struct GTY(()) ipa_member_ptr_cst
{
tree pfn;
tree delta;
};
-/* Represents a value of a jump function. pass_through is used only in jump
- function context. constant represents the actual constant in constant jump
- functions and member_cst holds constant c++ member functions. */
-union jump_func_value
-{
- tree constant;
- struct ipa_pass_through_data pass_through;
- struct ipa_ancestor_jf_data ancestor;
- struct ipa_member_ptr_cst member_cst;
-};
-
/* A jump function for a callsite represents the values passed as actual
arguments of the callsite. See enum jump_func_type for the various
types of jump functions supported. */
-struct ipa_jump_func
+struct GTY (()) ipa_jump_func
{
enum jump_func_type type;
- union jump_func_value value;
+ /* Represents a value of a jump function. pass_through is used only in jump
+ function context. constant represents the actual constant in constant jump
+ functions and member_cst holds constant c++ member functions. */
+ union jump_func_value
+ {
+ tree GTY ((tag ("IPA_JF_CONST"))) constant;
+ struct ipa_pass_through_data GTY ((tag ("IPA_JF_PASS_THROUGH"))) pass_through;
+ struct ipa_ancestor_jf_data GTY ((tag ("IPA_JF_ANCESTOR"))) ancestor;
+ struct ipa_member_ptr_cst GTY ((tag ("IPA_JF_CONST_MEMBER_PTR"))) member_cst;
+ } GTY ((desc ("%1.type"))) value;
};
/* All formal parameters in the program have a cval computed by
@@ -280,15 +278,15 @@ ipa_is_called_with_var_arguments (struct ipa_node_params *info)
/* ipa_edge_args stores information related to a callsite and particularly
its arguments. It is pointed to by a field in the
callsite's corresponding cgraph_edge. */
-struct ipa_edge_args
+typedef struct GTY(()) ipa_edge_args
{
/* Number of actual arguments in this callsite. When set to 0,
this callsite's parameters would not be analyzed by the different
stages of IPA CP. */
int argument_count;
/* Array of the callsite's jump function of each parameter. */
- struct ipa_jump_func *jump_functions;
-};
+ struct ipa_jump_func GTY ((length ("%h.argument_count"))) *jump_functions;
+} ipa_edge_args_t;
/* ipa_edge_args access functions. Please use these to access fields that
are or will be shared among various passes. */
@@ -321,18 +319,17 @@ ipa_get_ith_jump_func (struct ipa_edge_args *args, int i)
/* Vectors need to have typedefs of structures. */
typedef struct ipa_node_params ipa_node_params_t;
-typedef struct ipa_edge_args ipa_edge_args_t;
/* Types of vectors holding the infos. */
DEF_VEC_O (ipa_node_params_t);
DEF_VEC_ALLOC_O (ipa_node_params_t, heap);
DEF_VEC_O (ipa_edge_args_t);
-DEF_VEC_ALLOC_O (ipa_edge_args_t, heap);
+DEF_VEC_ALLOC_O (ipa_edge_args_t, gc);
/* Vector where the parameter infos are actually stored. */
extern VEC (ipa_node_params_t, heap) *ipa_node_params_vector;
/* Vector where the parameter infos are actually stored. */
-extern VEC (ipa_edge_args_t, heap) *ipa_edge_args_vector;
+extern GTY(()) VEC (ipa_edge_args_t, gc) *ipa_edge_args_vector;
/* Return the associated parameter/argument info corresponding to the given
node/edge. */
@@ -378,12 +375,12 @@ static inline void
ipa_check_create_edge_args (void)
{
if (!ipa_edge_args_vector)
- ipa_edge_args_vector = VEC_alloc (ipa_edge_args_t, heap,
+ ipa_edge_args_vector = VEC_alloc (ipa_edge_args_t, gc,
cgraph_edge_max_uid);
if (VEC_length (ipa_edge_args_t, ipa_edge_args_vector)
<= (unsigned) cgraph_edge_max_uid)
- VEC_safe_grow_cleared (ipa_edge_args_t, heap, ipa_edge_args_vector,
+ VEC_safe_grow_cleared (ipa_edge_args_t, gc, ipa_edge_args_vector,
cgraph_edge_max_uid + 1);
}
@@ -508,6 +505,10 @@ ipa_parm_adjustment_vec ipa_combine_adjustments (ipa_parm_adjustment_vec,
ipa_parm_adjustment_vec);
void ipa_dump_param_adjustments (FILE *, ipa_parm_adjustment_vec, tree);
+void ipa_prop_write_jump_functions (cgraph_node_set set);
+void ipa_prop_read_jump_functions (void);
+void ipa_update_after_lto_read (void);
+
/* From tree-sra.c: */
bool build_ref_for_offset (tree *, tree, HOST_WIDE_INT, tree, bool);
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c
index 04d4e112ed3..e37af05d08e 100644
--- a/gcc/ipa-pure-const.c
+++ b/gcc/ipa-pure-const.c
@@ -51,6 +51,7 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic.h"
#include "langhooks.h"
#include "target.h"
+#include "lto-streamer.h"
#include "cfgloop.h"
#include "tree-scalar-evolution.h"
@@ -329,12 +330,11 @@ check_call (funct_state local, gimple call, bool ipa)
/* When not in IPA mode, we can still handle self recursion. */
if (!ipa && callee_t == current_function_decl)
local->looping = true;
- /* The callee is either unknown (indirect call) or there is just no
- scannable code for it (external call) . We look to see if there
- are any bits available for the callee (such as by declaration or
- because it is builtin) and process solely on the basis of those
- bits. */
- else if (avail <= AVAIL_OVERWRITABLE || !ipa)
+ /* Either calle is unknown or we are doing local analysis.
+ Look to see if there are any bits available for the callee (such as by
+ declaration or because it is builtin) and process solely on the basis of
+ those bits. */
+ else if (!ipa || !callee_t)
{
if (possibly_throws && flag_non_call_exceptions)
{
@@ -491,13 +491,6 @@ analyze_function (struct cgraph_node *fn, bool ipa)
funct_state l;
basic_block this_block;
- if (cgraph_function_body_availability (fn) <= AVAIL_OVERWRITABLE)
- {
- if (dump_file)
- fprintf (dump_file, "Function is not available or overwrittable; not analyzing.\n");
- return NULL;
- }
-
l = XCNEW (struct funct_state_d);
l->pure_const_state = IPA_CONST;
l->state_previously_known = IPA_NEITHER;
@@ -608,7 +601,7 @@ end:
static void
add_new_function (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED)
{
- if (cgraph_function_body_availability (node) <= AVAIL_OVERWRITABLE)
+ if (cgraph_function_body_availability (node) < AVAIL_OVERWRITABLE)
return;
/* There are some shared nodes, in particular the initializers on
static declarations. We do not need to scan them more than once
@@ -648,13 +641,15 @@ remove_node_data (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED)
}
-/* Analyze each function in the cgraph to see if it is locally PURE or
- CONST. */
-
-static void
-generate_summary (void)
+static void
+register_hooks (void)
{
- struct cgraph_node *node;
+ static bool init_p = false;
+
+ if (init_p)
+ return;
+
+ init_p = true;
node_removal_hook_holder =
cgraph_add_node_removal_hook (&remove_node_data, NULL);
@@ -662,6 +657,19 @@ generate_summary (void)
cgraph_add_node_duplication_hook (&duplicate_node_data, NULL);
function_insertion_hook_holder =
cgraph_add_function_insertion_hook (&add_new_function, NULL);
+}
+
+
+/* Analyze each function in the cgraph to see if it is locally PURE or
+ CONST. */
+
+static void
+generate_summary (void)
+{
+ struct cgraph_node *node;
+
+ register_hooks ();
+
/* There are some shared nodes, in particular the initializers on
static declarations. We do not need to scan them more than once
since all we would be interested in are the addressof
@@ -670,18 +678,132 @@ generate_summary (void)
/* Process all of the functions.
- We do NOT process any AVAIL_OVERWRITABLE functions, we cannot
- guarantee that what we learn about the one we see will be true
- for the one that overrides it.
- */
+ We process AVAIL_OVERWRITABLE functions. We can not use the results
+ by default, but the info can be used at LTO with -fwhole-program or
+ when function got clonned and the clone is AVAILABLE. */
+
for (node = cgraph_nodes; node; node = node->next)
- if (cgraph_function_body_availability (node) > AVAIL_OVERWRITABLE)
+ if (cgraph_function_body_availability (node) >= AVAIL_OVERWRITABLE)
set_function_state (node, analyze_function (node, true));
pointer_set_destroy (visited_nodes);
visited_nodes = NULL;
}
+
+/* Serialize the ipa info for lto. */
+
+static void
+pure_const_write_summary (cgraph_node_set set)
+{
+ struct cgraph_node *node;
+ struct lto_simple_output_block *ob
+ = lto_create_simple_output_block (LTO_section_ipa_pure_const);
+ unsigned int count = 0;
+ cgraph_node_set_iterator csi;
+
+ for (csi = csi_start (set); !csi_end_p (csi); csi_next (&csi))
+ {
+ node = csi_node (csi);
+ if (node->analyzed && get_function_state (node) != NULL)
+ count++;
+ }
+
+ lto_output_uleb128_stream (ob->main_stream, count);
+
+ /* Process all of the functions. */
+ for (csi = csi_start (set); !csi_end_p (csi); csi_next (&csi))
+ {
+ node = csi_node (csi);
+ if (node->analyzed && get_function_state (node) != NULL)
+ {
+ struct bitpack_d *bp;
+ funct_state fs;
+ int node_ref;
+ lto_cgraph_encoder_t encoder;
+
+ fs = get_function_state (node);
+
+ encoder = ob->decl_state->cgraph_node_encoder;
+ node_ref = lto_cgraph_encoder_encode (encoder, node);
+ lto_output_uleb128_stream (ob->main_stream, node_ref);
+
+ /* Note that flags will need to be read in the opposite
+ order as we are pushing the bitflags into FLAGS. */
+ bp = bitpack_create ();
+ bp_pack_value (bp, fs->pure_const_state, 2);
+ bp_pack_value (bp, fs->state_previously_known, 2);
+ bp_pack_value (bp, fs->looping_previously_known, 1);
+ bp_pack_value (bp, fs->looping, 1);
+ bp_pack_value (bp, fs->can_throw, 1);
+ lto_output_bitpack (ob->main_stream, bp);
+ bitpack_delete (bp);
+ }
+ }
+
+ lto_destroy_simple_output_block (ob);
+}
+
+
+/* Deserialize the ipa info for lto. */
+
+static void
+pure_const_read_summary (void)
+{
+ struct lto_file_decl_data **file_data_vec = lto_get_file_decl_data ();
+ struct lto_file_decl_data *file_data;
+ unsigned int j = 0;
+
+ register_hooks ();
+ while ((file_data = file_data_vec[j++]))
+ {
+ const char *data;
+ size_t len;
+ struct lto_input_block *ib
+ = lto_create_simple_input_block (file_data,
+ LTO_section_ipa_pure_const,
+ &data, &len);
+ if (ib)
+ {
+ unsigned int i;
+ unsigned int count = lto_input_uleb128 (ib);
+
+ for (i = 0; i < count; i++)
+ {
+ unsigned int index;
+ struct cgraph_node *node;
+ struct bitpack_d *bp;
+ funct_state fs;
+ lto_cgraph_encoder_t encoder;
+
+ fs = XCNEW (struct funct_state_d);
+ index = lto_input_uleb128 (ib);
+ encoder = file_data->cgraph_node_encoder;
+ node = lto_cgraph_encoder_deref (encoder, index);
+ set_function_state (node, fs);
+
+ /* Note that the flags must be read in the opposite
+ order in which they were written (the bitflags were
+ pushed into FLAGS). */
+ bp = lto_input_bitpack (ib);
+ fs->pure_const_state
+ = (enum pure_const_state_e) bp_unpack_value (bp, 2);
+ fs->state_previously_known
+ = (enum pure_const_state_e) bp_unpack_value (bp, 2);
+ fs->looping_previously_known = bp_unpack_value (bp, 1);
+ fs->looping = bp_unpack_value (bp, 1);
+ fs->can_throw = bp_unpack_value (bp, 1);
+ bitpack_delete (bp);
+ }
+
+ lto_destroy_simple_input_block (file_data,
+ LTO_section_ipa_pure_const,
+ ib, data, len);
+ }
+ }
+}
+
+
static bool
ignore_edge (struct cgraph_edge *e)
{
@@ -748,6 +870,12 @@ propagate (void)
if (w_l->looping)
looping = true;
+ if (cgraph_function_body_availability (w) == AVAIL_OVERWRITABLE)
+ {
+ looping |= w_l->looping_previously_known;
+ if (pure_const_state < w_l->state_previously_known)
+ pure_const_state = w_l->state_previously_known;
+ }
if (pure_const_state == IPA_NEITHER)
break;
@@ -771,6 +899,20 @@ propagate (void)
if (y_l->looping)
looping = true;
}
+ else
+ {
+ int flags = flags_from_decl_or_type (y->decl);
+
+ if (flags & ECF_LOOPING_CONST_OR_PURE)
+ looping = true;
+ if (flags & ECF_CONST)
+ ;
+ else if ((flags & ECF_PURE) && pure_const_state == IPA_CONST)
+ pure_const_state = IPA_PURE;
+ else
+ pure_const_state = IPA_NEITHER, looping = true;
+
+ }
}
w_info = (struct ipa_dfs_info *) w->aux;
w = w_info->next_cycle;
@@ -858,7 +1000,8 @@ propagate (void)
struct cgraph_edge *e;
funct_state w_l = get_function_state (w);
- if (w_l->can_throw)
+ if (w_l->can_throw
+ || cgraph_function_body_availability (w) == AVAIL_OVERWRITABLE)
can_throw = true;
if (can_throw)
@@ -878,6 +1021,8 @@ propagate (void)
&& e->can_throw_external)
can_throw = true;
}
+ else if (e->can_throw_external && !TREE_NOTHROW (y->decl))
+ can_throw = true;
}
w_info = (struct ipa_dfs_info *) w->aux;
w = w_info->next_cycle;
@@ -916,7 +1061,7 @@ propagate (void)
free (node->aux);
node->aux = NULL;
}
- if (cgraph_function_body_availability (node) > AVAIL_OVERWRITABLE)
+ if (cgraph_function_body_availability (node) >= AVAIL_OVERWRITABLE)
free (get_function_state (node));
}
@@ -952,8 +1097,8 @@ struct ipa_opt_pass_d pass_ipa_pure_const =
0 /* todo_flags_finish */
},
generate_summary, /* generate_summary */
- NULL, /* write_summary */
- NULL, /* read_summary */
+ pure_const_write_summary, /* write_summary */
+ pure_const_read_summary, /* read_summary */
NULL, /* function_read_summary */
0, /* TODOs */
NULL, /* function_transform */
@@ -979,15 +1124,16 @@ local_pure_const (void)
fprintf (dump_file, "Function called in recursive cycle; ignoring\n");
return 0;
}
-
- l = analyze_function (cgraph_node (current_function_decl), false);
- if (!l)
+ if (cgraph_function_body_availability (cgraph_node (current_function_decl))
+ <= AVAIL_OVERWRITABLE)
{
if (dump_file)
fprintf (dump_file, "Function has wrong visibility; ignoring\n");
return 0;
}
+ l = analyze_function (cgraph_node (current_function_decl), false);
+
switch (l->pure_const_state)
{
case IPA_CONST:
diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c
index 10daf56eab6..8610f13311f 100644
--- a/gcc/ipa-reference.c
+++ b/gcc/ipa-reference.c
@@ -68,6 +68,15 @@ along with GCC; see the file COPYING3. If not see
#include "timevar.h"
#include "diagnostic.h"
#include "langhooks.h"
+#include "lto-streamer.h"
+
+static void add_new_function (struct cgraph_node *node,
+ void *data ATTRIBUTE_UNUSED);
+static void remove_node_data (struct cgraph_node *node,
+ void *data ATTRIBUTE_UNUSED);
+static void duplicate_node_data (struct cgraph_node *src,
+ struct cgraph_node *dst,
+ void *data ATTRIBUTE_UNUSED);
/* The static variables defined within the compilation unit that are
loaded or stored directly by function that owns this structure. */
@@ -309,6 +318,8 @@ has_proper_scope_for_analysis (tree t)
if (!TREE_STATIC (t) && !DECL_EXTERNAL (t))
return false;
+ /* FIXME: for LTO we should include PUBLIC vars too. This is bit difficult
+ as summarie would need unsharing. */
if (DECL_EXTERNAL (t) || TREE_PUBLIC (t))
return false;
@@ -404,31 +415,25 @@ check_call (ipa_reference_local_vars_info_t local, gimple stmt)
{
int flags = gimple_call_flags (stmt);
tree callee_t = gimple_call_fndecl (stmt);
- enum availability avail = AVAIL_NOT_AVAILABLE;
- if (callee_t)
+ /* Process indirect calls. All direct calles are handled at propagation
+ time. */
+ if (!callee_t)
{
- struct cgraph_node* callee = cgraph_node(callee_t);
- avail = cgraph_function_body_availability (callee);
- }
-
- if (avail <= AVAIL_OVERWRITABLE)
- if (local)
- {
- if (flags & ECF_CONST)
- ;
- else if (flags & ECF_PURE)
+ if (flags & ECF_CONST)
+ ;
+ else if (flags & ECF_PURE)
+ local->calls_read_all = true;
+ else
+ {
local->calls_read_all = true;
- else
- {
- local->calls_read_all = true;
+ /* When function does not reutrn, it is safe to ignore anythign it writes
+ to, because the effect will never happen. */
+ if ((flags & (ECF_NOTHROW | ECF_NORETURN))
+ != (ECF_NOTHROW | ECF_NORETURN))
local->calls_write_all = true;
- }
- }
- /* TODO: To be able to produce sane results, we should also handle
- common builtins, in particular throw.
- Indirect calls hsould be only counted and as inliner is replacing them
- by direct calls, we can conclude if any indirect calls are left in body */
+ }
+ }
}
/* TP is the part of the tree currently under the microscope.
@@ -518,7 +523,7 @@ propagate_bits (ipa_reference_global_vars_info_t x_global, struct cgraph_node *x
{
struct cgraph_node *y = e->callee;
- /* Only look at the master nodes and skip external nodes. */
+ /* Only look into nodes we can propagate something. */
if (cgraph_function_body_availability (e->callee) > AVAIL_OVERWRITABLE)
{
if (get_reference_vars_info (y))
@@ -578,6 +583,13 @@ propagate_bits (ipa_reference_global_vars_info_t x_global, struct cgraph_node *x
static void
ipa_init (void)
{
+ static bool init_p = false;
+
+ if (init_p)
+ return;
+
+ init_p = true;
+
memory_identifier_string = build_string(7, "memory");
reference_vars_to_consider =
@@ -594,6 +606,13 @@ ipa_init (void)
since all we would be interested in are the addressof
operations. */
visited_nodes = pointer_set_create ();
+
+ function_insertion_hook_holder =
+ cgraph_add_function_insertion_hook (&add_new_function, NULL);
+ node_removal_hook_holder =
+ cgraph_add_node_removal_hook (&remove_node_data, NULL);
+ node_duplication_hook_holder =
+ cgraph_add_node_duplication_hook (&duplicate_node_data, NULL);
}
/* Check out the rhs of a static or global initialization VNODE to see
@@ -614,6 +633,7 @@ analyze_variable (struct varpool_node *vnode)
&wi, wi.pset);
}
+
/* Set up the persistent info for FN. */
static ipa_reference_local_vars_info_t
@@ -634,9 +654,10 @@ init_function_info (struct cgraph_node *fn)
return l;
}
+
/* This is the main routine for finding the reference patterns for
global variables within a function FN. */
-
+
static void
analyze_function (struct cgraph_node *fn)
{
@@ -646,6 +667,7 @@ analyze_function (struct cgraph_node *fn)
#ifdef ENABLE_CHECKING
tree step;
#endif
+ ipa_reference_local_vars_info_t local;
if (dump_file)
fprintf (dump_file, "\n local analysis of %s\n", cgraph_node_name (fn));
@@ -680,6 +702,21 @@ analyze_function (struct cgraph_node *fn)
scan_stmt_for_static_refs (&gsi, fn);
}
+ local = get_reference_vars_info (fn)->local;
+ if ((flags_from_decl_or_type (decl) & (ECF_NOTHROW | ECF_NORETURN))
+ == (ECF_NOTHROW | ECF_NORETURN))
+ {
+ local->calls_write_all = false;
+ bitmap_clear (local->statics_written);
+ }
+
+ /* Free bitmaps of direct references if we can not use them anyway. */
+ if (local->calls_write_all)
+ BITMAP_FREE (local->statics_written);
+ if (local->calls_read_all)
+ BITMAP_FREE (local->statics_read);
+
+
#ifdef ENABLE_CHECKING
/* Verify that all local initializers was expanded by gimplifier. */
for (step = DECL_STRUCT_FUNCTION (decl)->local_decls;
@@ -845,12 +882,6 @@ generate_summary (void)
bitmap module_statics_readonly;
bitmap bm_temp;
- function_insertion_hook_holder =
- cgraph_add_function_insertion_hook (&add_new_function, NULL);
- node_removal_hook_holder =
- cgraph_add_node_removal_hook (&remove_node_data, NULL);
- node_duplication_hook_holder =
- cgraph_add_node_duplication_hook (&duplicate_node_data, NULL);
ipa_init ();
module_statics_readonly = BITMAP_ALLOC (&local_info_obstack);
bm_temp = BITMAP_ALLOC (&local_info_obstack);
@@ -945,10 +976,12 @@ generate_summary (void)
removed from the local maps. This will include all of the
variables that were found to escape in the function
scanning. */
- bitmap_and_into (l->statics_read,
- all_module_statics);
- bitmap_and_into (l->statics_written,
- all_module_statics);
+ if (l->statics_read)
+ bitmap_and_into (l->statics_read,
+ all_module_statics);
+ if (l->statics_written)
+ bitmap_and_into (l->statics_written,
+ all_module_statics);
}
BITMAP_FREE(module_statics_readonly);
@@ -967,26 +1000,203 @@ generate_summary (void)
"\nFunction name:%s/%i:",
cgraph_node_name (node), node->uid);
fprintf (dump_file, "\n locals read: ");
- EXECUTE_IF_SET_IN_BITMAP (l->statics_read,
- 0, index, bi)
- {
- fprintf (dump_file, "%s ",
- get_static_name (index));
- }
+ if (l->statics_read)
+ EXECUTE_IF_SET_IN_BITMAP (l->statics_read,
+ 0, index, bi)
+ {
+ fprintf (dump_file, "%s ",
+ get_static_name (index));
+ }
fprintf (dump_file, "\n locals written: ");
- EXECUTE_IF_SET_IN_BITMAP (l->statics_written,
- 0, index, bi)
- {
- fprintf(dump_file, "%s ",
- get_static_name (index));
- }
+ if (l->statics_written)
+ EXECUTE_IF_SET_IN_BITMAP (l->statics_written,
+ 0, index, bi)
+ {
+ fprintf(dump_file, "%s ",
+ get_static_name (index));
+ }
if (l->calls_read_all)
fprintf (dump_file, "\n calls read all: ");
if (l->calls_write_all)
fprintf (dump_file, "\n calls read all: ");
}
}
+
+
+/* Return true if we need to write summary of NODE. */
+
+static bool
+write_node_summary_p (struct cgraph_node *node)
+{
+ gcc_assert (node->global.inlined_to == NULL);
+ return (node->analyzed
+ && cgraph_function_body_availability (node) >= AVAIL_OVERWRITABLE
+ && get_reference_vars_info (node) != NULL);
+}
+
+/* Serialize the ipa info for lto. */
+
+static void
+ipa_reference_write_summary (cgraph_node_set set)
+{
+ struct cgraph_node *node;
+ struct lto_simple_output_block *ob
+ = lto_create_simple_output_block (LTO_section_ipa_reference);
+ unsigned int count = 0;
+ cgraph_node_set_iterator csi;
+
+ for (csi = csi_start (set); !csi_end_p (csi); csi_next (&csi))
+ if (write_node_summary_p (csi_node (csi)))
+ count++;
+
+ lto_output_uleb128_stream (ob->main_stream, count);
+
+ /* Process all of the functions. */
+ for (csi = csi_start (set); !csi_end_p (csi); csi_next (&csi))
+ {
+ node = csi_node (csi);
+ if (write_node_summary_p (node))
+ {
+ ipa_reference_local_vars_info_t l
+ = get_reference_vars_info (node)->local;
+ unsigned int index;
+ bitmap_iterator bi;
+ lto_cgraph_encoder_t encoder;
+ int node_ref;
+
+ encoder = ob->decl_state->cgraph_node_encoder;
+ node_ref = lto_cgraph_encoder_encode (encoder, node);
+ lto_output_uleb128_stream (ob->main_stream, node_ref);
+
+ /* Stream out the statics read. */
+ if (l->calls_read_all)
+ lto_output_sleb128_stream (ob->main_stream, -1);
+ else
+ {
+ lto_output_sleb128_stream (ob->main_stream,
+ bitmap_count_bits (l->statics_read));
+ EXECUTE_IF_SET_IN_BITMAP (l->statics_read, 0, index, bi)
+ lto_output_var_decl_index(ob->decl_state, ob->main_stream,
+ get_static_decl (index));
+ }
+
+ /* Stream out the statics written. */
+ if (l->calls_write_all)
+ lto_output_sleb128_stream (ob->main_stream, -1);
+ else
+ {
+ lto_output_sleb128_stream (ob->main_stream,
+ bitmap_count_bits (l->statics_written));
+ EXECUTE_IF_SET_IN_BITMAP (l->statics_written, 0, index, bi)
+ lto_output_var_decl_index(ob->decl_state, ob->main_stream,
+ get_static_decl (index));
+ }
+ }
+ }
+ lto_destroy_simple_output_block (ob);
+}
+
+
+/* Deserialize the ipa info for lto. */
+
+static void
+ipa_reference_read_summary (void)
+{
+ struct lto_file_decl_data ** file_data_vec
+ = lto_get_file_decl_data ();
+ struct lto_file_decl_data * file_data;
+ unsigned int j = 0;
+
+ ipa_init ();
+
+ while ((file_data = file_data_vec[j++]))
+ {
+ const char *data;
+ size_t len;
+ struct lto_input_block *ib
+ = lto_create_simple_input_block (file_data,
+ LTO_section_ipa_reference,
+ &data, &len);
+ if (ib)
+ {
+ unsigned int i;
+ unsigned int f_count = lto_input_uleb128 (ib);
+
+ for (i = 0; i < f_count; i++)
+ {
+ unsigned int j, index;
+ struct cgraph_node *node;
+ ipa_reference_local_vars_info_t l;
+ int v_count;
+ lto_cgraph_encoder_t encoder;
+
+ index = lto_input_uleb128 (ib);
+ encoder = file_data->cgraph_node_encoder;
+ node = lto_cgraph_encoder_deref (encoder, index);
+ l = init_function_info (node);
+
+ /* Set the statics read. */
+ v_count = lto_input_sleb128 (ib);
+ if (v_count == -1)
+ l->calls_read_all = true;
+ else
+ for (j = 0; j < (unsigned int)v_count; j++)
+ {
+ unsigned int var_index = lto_input_uleb128 (ib);
+ tree v_decl = lto_file_decl_data_get_var_decl (file_data,
+ var_index);
+ add_static_var (v_decl);
+ bitmap_set_bit (l->statics_read, DECL_UID (v_decl));
+ }
+
+ /* Set the statics written. */
+ v_count = lto_input_sleb128 (ib);
+ if (v_count == -1)
+ l->calls_write_all = true;
+ else
+ for (j = 0; j < (unsigned int)v_count; j++)
+ {
+ unsigned int var_index = lto_input_uleb128 (ib);
+ tree v_decl = lto_file_decl_data_get_var_decl (file_data,
+ var_index);
+ add_static_var (v_decl);
+ bitmap_set_bit (l->statics_written, DECL_UID (v_decl));
+ }
+ }
+
+ lto_destroy_simple_input_block (file_data,
+ LTO_section_ipa_reference,
+ ib, data, len);
+ }
+ }
+}
+
+
+/* Set READ_ALL/WRITE_ALL based on DECL flags. */
+static void
+read_write_all_from_decl (tree decl, bool * read_all, bool * write_all)
+{
+ int flags = flags_from_decl_or_type (decl);
+ if (flags & ECF_CONST)
+ ;
+ else if (flags & ECF_PURE)
+ *read_all = true;
+ else
+ {
+ /* TODO: To be able to produce sane results, we should also handle
+ common builtins, in particular throw.
+ Indirect calls hsould be only counted and as inliner is replacing them
+ by direct calls, we can conclude if any indirect calls are left in body */
+ *read_all = true;
+ /* When function does not reutrn, it is safe to ignore anythign it writes
+ to, because the effect will never happen. */
+ if ((flags & (ECF_NOTHROW | ECF_NORETURN))
+ != (ECF_NOTHROW | ECF_NORETURN))
+ *write_all = true;
+ }
+}
+
/* Produce the global information by preforming a transitive closure
on the local information that was produced by ipa_analyze_function
and ipa_analyze_variable. */
@@ -1019,6 +1229,7 @@ propagate (void)
ipa_reference_global_vars_info_t node_g =
XCNEW (struct ipa_reference_global_vars_info_d);
ipa_reference_local_vars_info_t node_l;
+ struct cgraph_edge *e;
bool read_all;
bool write_all;
@@ -1039,6 +1250,15 @@ propagate (void)
read_all = node_l->calls_read_all;
write_all = node_l->calls_write_all;
+ /* When function is overwrittable, we can not assume anything. */
+ if (cgraph_function_body_availability (node) <= AVAIL_OVERWRITABLE)
+ read_write_all_from_decl (node->decl, &read_all, &write_all);
+
+ for (e = node->callees; e; e = e->next_callee)
+ if (cgraph_function_body_availability (e->callee) <= AVAIL_OVERWRITABLE)
+ read_write_all_from_decl (e->callee->decl, &read_all, &write_all);
+
+
/* If any node in a cycle is calls_read_all or calls_write_all
they all are. */
w_info = (struct ipa_dfs_info *) node->aux;
@@ -1047,6 +1267,15 @@ propagate (void)
{
ipa_reference_local_vars_info_t w_l =
get_reference_vars_info (w)->local;
+
+ /* When function is overwrittable, we can not assume anything. */
+ if (cgraph_function_body_availability (w) <= AVAIL_OVERWRITABLE)
+ read_write_all_from_decl (w->decl, &read_all, &write_all);
+
+ for (e = w->callees; e; e = e->next_callee)
+ if (cgraph_function_body_availability (e->callee) <= AVAIL_OVERWRITABLE)
+ read_write_all_from_decl (e->callee->decl, &read_all, &write_all);
+
read_all |= w_l->calls_read_all;
write_all |= w_l->calls_write_all;
@@ -1054,6 +1283,7 @@ propagate (void)
w = w_info->next_cycle;
}
+
/* Initialized the bitmaps for the reduced nodes */
if (read_all)
node_g->statics_read = all_module_statics;
@@ -1063,7 +1293,6 @@ propagate (void)
bitmap_copy (node_g->statics_read,
node_l->statics_read);
}
-
if (write_all)
node_g->statics_written = all_module_statics;
else
@@ -1135,19 +1364,21 @@ propagate (void)
"\nFunction name:%s/%i:",
cgraph_node_name (node), node->uid);
fprintf (dump_file, "\n locals read: ");
- EXECUTE_IF_SET_IN_BITMAP (node_l->statics_read,
- 0, index, bi)
- {
- fprintf (dump_file, "%s ",
- get_static_name (index));
- }
+ if (node_l->statics_read)
+ EXECUTE_IF_SET_IN_BITMAP (node_l->statics_read,
+ 0, index, bi)
+ {
+ fprintf (dump_file, "%s ",
+ get_static_name (index));
+ }
fprintf (dump_file, "\n locals written: ");
- EXECUTE_IF_SET_IN_BITMAP (node_l->statics_written,
- 0, index, bi)
- {
- fprintf(dump_file, "%s ",
- get_static_name (index));
- }
+ if (node_l->statics_written)
+ EXECUTE_IF_SET_IN_BITMAP (node_l->statics_written,
+ 0, index, bi)
+ {
+ fprintf(dump_file, "%s ",
+ get_static_name (index));
+ }
w_info = (struct ipa_dfs_info *) node->aux;
w = w_info->next_cycle;
@@ -1179,19 +1410,25 @@ propagate (void)
w = w_info->next_cycle;
}
fprintf (dump_file, "\n globals read: ");
- EXECUTE_IF_SET_IN_BITMAP (node_g->statics_read,
- 0, index, bi)
- {
- fprintf (dump_file, "%s ",
- get_static_name (index));
- }
+ if (node_g->statics_read == all_module_statics)
+ fprintf (dump_file, "ALL");
+ else
+ EXECUTE_IF_SET_IN_BITMAP (node_g->statics_read,
+ 0, index, bi)
+ {
+ fprintf (dump_file, "%s ",
+ get_static_name (index));
+ }
fprintf (dump_file, "\n globals written: ");
- EXECUTE_IF_SET_IN_BITMAP (node_g->statics_written,
- 0, index, bi)
- {
- fprintf (dump_file, "%s ",
- get_static_name (index));
- }
+ if (node_g->statics_written == all_module_statics)
+ fprintf (dump_file, "ALL");
+ else
+ EXECUTE_IF_SET_IN_BITMAP (node_g->statics_written,
+ 0, index, bi)
+ {
+ fprintf (dump_file, "%s ",
+ get_static_name (index));
+ }
}
}
@@ -1271,8 +1508,8 @@ struct ipa_opt_pass_d pass_ipa_reference =
0 /* todo_flags_finish */
},
generate_summary, /* generate_summary */
- NULL, /* write_summary */
- NULL, /* read_summary */
+ ipa_reference_write_summary, /* write_summary */
+ ipa_reference_read_summary, /* read_summary */
NULL, /* function_read_summary */
0, /* TODOs */
NULL, /* function_transform */
diff --git a/gcc/ipa-struct-reorg.c b/gcc/ipa-struct-reorg.c
index bc84eee372b..147610a43e4 100644
--- a/gcc/ipa-struct-reorg.c
+++ b/gcc/ipa-struct-reorg.c
@@ -258,15 +258,21 @@ find_field_in_struct_1 (tree str_type, tree field)
{
tree str_field;
+ if (!DECL_NAME (field))
+ return NULL;
+
for (str_field = TYPE_FIELDS (str_type); str_field;
str_field = TREE_CHAIN (str_field))
{
- const char * str_field_name;
- const char * field_name;
+ const char *str_field_name;
+ const char *field_name;
+
+ if (!DECL_NAME (str_field))
+ continue;
str_field_name = IDENTIFIER_POINTER (DECL_NAME (str_field));
field_name = IDENTIFIER_POINTER (DECL_NAME (field));
-
+
gcc_assert (str_field_name);
gcc_assert (field_name);
@@ -274,7 +280,7 @@ find_field_in_struct_1 (tree str_type, tree field)
{
/* Check field types. */
if (is_equal_types (TREE_TYPE (str_field), TREE_TYPE (field)))
- return str_field;
+ return str_field;
}
}
@@ -3374,6 +3380,14 @@ build_data_structure (VEC (tree, heap) **unsuitable_types)
if (is_candidate (var, &type, unsuitable_types))
add_structure (type);
+ if (fn == NULL)
+ {
+ /* Skip cones that haven't been materialized yet. */
+ gcc_assert (c_node->clone_of
+ && c_node->clone_of->decl != c_node->decl);
+ continue;
+ }
+
/* Check function local variables. */
for (var_list = fn->local_decls; var_list;
var_list = TREE_CHAIN (var_list))
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 9204caae77b..c859242fa70 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -52,7 +52,9 @@ cgraph_postorder (struct cgraph_node **order)
for (pass = 0; pass < 2; pass++)
for (node = cgraph_nodes; node; node = node->next)
if (!node->aux
- && (pass || (node->needed && !node->address_taken)))
+ && (pass
+ || (!cgraph_only_called_directly_p (node)
+ && !node->address_taken)))
{
node2 = node;
if (!node->callers)
@@ -132,11 +134,12 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
gcc_assert (!node->aux);
#endif
for (node = cgraph_nodes; node; node = node->next)
- if (node->needed && !node->global.inlined_to
+ if (!cgraph_can_remove_if_no_direct_calls_p (node)
&& ((!DECL_EXTERNAL (node->decl))
|| !node->analyzed
|| before_inlining_p))
{
+ gcc_assert (!node->global.inlined_to);
node->aux = first;
first = node;
}
@@ -248,6 +251,28 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
return changed;
}
+static bool
+cgraph_externally_visible_p (struct cgraph_node *node, bool whole_program)
+{
+ if (!node->local.finalized)
+ return false;
+ if (!DECL_COMDAT (node->decl)
+ && (!TREE_PUBLIC (node->decl) || DECL_EXTERNAL (node->decl)))
+ return false;
+ if (!whole_program)
+ return true;
+ /* COMDAT functions must be shared only if they have address taken,
+ otherwise we can produce our own private implementation with
+ -fwhole-program. */
+ if (DECL_COMDAT (node->decl) && (node->address_taken || !node->analyzed))
+ return true;
+ if (MAIN_NAME_P (DECL_NAME (node->decl)))
+ return true;
+ if (lookup_attribute ("externally_visible", DECL_ATTRIBUTES (node->decl)))
+ return true;
+ return false;
+}
+
/* Mark visibility of all functions.
A local function is one whose calls can occur only in the current
@@ -260,38 +285,48 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
via visibilities for the backend point of view. */
static unsigned int
-function_and_variable_visibility (void)
+function_and_variable_visibility (bool whole_program)
{
struct cgraph_node *node;
struct varpool_node *vnode;
for (node = cgraph_nodes; node; node = node->next)
{
- if (node->reachable
- && (DECL_COMDAT (node->decl)
- || (!flag_whole_program
- && TREE_PUBLIC (node->decl) && !DECL_EXTERNAL (node->decl))))
- node->local.externally_visible = true;
+ if (cgraph_externally_visible_p (node, whole_program))
+ {
+ gcc_assert (!node->global.inlined_to);
+ node->local.externally_visible = true;
+ }
+ else
+ node->local.externally_visible = false;
if (!node->local.externally_visible && node->analyzed
&& !DECL_EXTERNAL (node->decl))
{
- gcc_assert (flag_whole_program || !TREE_PUBLIC (node->decl));
+ gcc_assert (whole_program || !TREE_PUBLIC (node->decl));
TREE_PUBLIC (node->decl) = 0;
+ DECL_COMDAT (node->decl) = 0;
+ DECL_WEAK (node->decl) = 0;
}
- node->local.local = (!node->needed
+ node->local.local = (cgraph_only_called_directly_p (node)
&& node->analyzed
&& !DECL_EXTERNAL (node->decl)
&& !node->local.externally_visible);
}
for (vnode = varpool_nodes_queue; vnode; vnode = vnode->next_needed)
{
+ if (!vnode->finalized)
+ continue;
if (vnode->needed
- && !flag_whole_program
- && (DECL_COMDAT (vnode->decl) || TREE_PUBLIC (vnode->decl)))
- vnode->externally_visible = 1;
+ && (DECL_COMDAT (vnode->decl) || TREE_PUBLIC (vnode->decl))
+ && (!whole_program
+ || lookup_attribute ("externally_visible",
+ DECL_ATTRIBUTES (vnode->decl))))
+ vnode->externally_visible = true;
+ else
+ vnode->externally_visible = false;
if (!vnode->externally_visible)
{
- gcc_assert (flag_whole_program || !TREE_PUBLIC (vnode->decl));
+ gcc_assert (whole_program || !TREE_PUBLIC (vnode->decl));
TREE_PUBLIC (vnode->decl) = 0;
}
gcc_assert (TREE_STATIC (vnode->decl));
@@ -314,13 +349,22 @@ function_and_variable_visibility (void)
return 0;
}
+/* Local function pass handling visibilities. This happens before LTO streaming
+ so in particular -fwhole-program should be ignored at this level. */
+
+static unsigned int
+local_function_and_variable_visibility (void)
+{
+ return function_and_variable_visibility (flag_whole_program && !flag_lto && !flag_whopr);
+}
+
struct simple_ipa_opt_pass pass_ipa_function_and_variable_visibility =
{
{
SIMPLE_IPA_PASS,
"visibility", /* name */
NULL, /* gate */
- function_and_variable_visibility, /* execute */
+ local_function_and_variable_visibility,/* execute */
NULL, /* sub */
NULL, /* next */
0, /* static_pass_number */
@@ -333,6 +377,58 @@ struct simple_ipa_opt_pass pass_ipa_function_and_variable_visibility =
}
};
+/* Do not re-run on ltrans stage. */
+
+static bool
+gate_whole_program_function_and_variable_visibility (void)
+{
+ return !flag_ltrans;
+}
+
+/* Bring functionss local at LTO time whith -fwhole-program. */
+
+static unsigned int
+whole_program_function_and_variable_visibility (void)
+{
+ struct cgraph_node *node;
+ struct varpool_node *vnode;
+
+ function_and_variable_visibility (flag_whole_program);
+
+ for (node = cgraph_nodes; node; node = node->next)
+ if (node->local.externally_visible && node->local.finalized)
+ cgraph_mark_needed_node (node);
+ for (vnode = varpool_nodes_queue; vnode; vnode = vnode->next_needed)
+ if (vnode->externally_visible)
+ varpool_mark_needed_node (vnode);
+ return 0;
+}
+
+struct ipa_opt_pass_d pass_ipa_whole_program_visibility =
+{
+ {
+ IPA_PASS,
+ "whole-program", /* name */
+ gate_whole_program_function_and_variable_visibility,/* gate */
+ whole_program_function_and_variable_visibility,/* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_CGRAPHOPT, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_dump_cgraph | TODO_remove_functions/* todo_flags_finish */
+ },
+ NULL, /* generate_summary */
+ NULL, /* write_summary */
+ NULL, /* read_summary */
+ NULL, /* function_read_summary */
+ 0, /* TODOs */
+ NULL, /* function_transform */
+ NULL, /* variable_transform */
+};
/* Hash a cgraph node set element. */
diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c
index fd756f6de73..4b9d29f1db1 100644
--- a/gcc/ira-costs.c
+++ b/gcc/ira-costs.c
@@ -1665,6 +1665,7 @@ ira_finish_costs_once (void)
static void
init_costs (void)
{
+ init_subregs_of_mode ();
costs = (struct costs *) ira_allocate (max_struct_costs_size
* cost_elements_num);
pref_buffer
diff --git a/gcc/ira-lives.c b/gcc/ira-lives.c
index 57a953bad59..c67e89cbd79 100644
--- a/gcc/ira-lives.c
+++ b/gcc/ira-lives.c
@@ -500,7 +500,7 @@ check_and_make_def_conflict (int alt, int def, enum reg_class def_cl)
for (use = 0; use < recog_data.n_operands; use++)
{
if (use == def || recog_data.operand_type[use] == OP_OUT)
- return;
+ continue;
if (recog_op_alt[use][alt].anything_ok)
use_cl = ALL_REGS;
@@ -513,7 +513,7 @@ check_and_make_def_conflict (int alt, int def, enum reg_class def_cl)
if ((use_match = recog_op_alt[use][alt].matches) >= 0)
{
if (use_match == def)
- return;
+ continue;
if (recog_op_alt[use_match][alt].anything_ok)
use_cl = ALL_REGS;
@@ -841,6 +841,7 @@ process_single_reg_class_operands (bool in_p, int freq)
[ira_class_hard_regs[cl][0]]) >= 0
&& reg_class_size[cl] <= (unsigned) CLASS_MAX_NREGS (cl, mode))
{
+ int i, size;
cost
= (freq
* (in_p
@@ -848,10 +849,12 @@ process_single_reg_class_operands (bool in_p, int freq)
: ira_get_register_move_cost (mode, cl, cover_class)));
ira_allocate_and_set_costs
(&ALLOCNO_CONFLICT_HARD_REG_COSTS (operand_a), cover_class, 0);
- ALLOCNO_CONFLICT_HARD_REG_COSTS (operand_a)
- [ira_class_hard_reg_index
- [cover_class][ira_class_hard_regs[cl][0]]]
- -= cost;
+ size = ira_reg_class_nregs[cover_class][mode];
+ for (i = 0; i < size; i++)
+ ALLOCNO_CONFLICT_HARD_REG_COSTS (operand_a)
+ [ira_class_hard_reg_index
+ [cover_class][ira_class_hard_regs[cl][i]]]
+ -= cost;
}
}
diff --git a/gcc/ira.c b/gcc/ira.c
index b960f769534..a3e899f8313 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -1442,6 +1442,9 @@ ira_setup_eliminable_regset (void)
int need_fp
= (! flag_omit_frame_pointer
|| (cfun->calls_alloca && EXIT_IGNORE_STACK)
+ /* We need the frame pointer to catch stack overflow exceptions
+ if the stack pointer is moving. */
+ || (flag_stack_check && STACK_CHECK_MOVING_SP)
|| crtl->accesses_prior_frames
|| crtl->stack_realign_needed
|| targetm.frame_pointer_required ());
@@ -3132,6 +3135,9 @@ ira (FILE *f)
epilogue thus changing register elimination offsets. */
current_function_is_leaf = leaf_function_p ();
+ if (resize_reg_info () && flag_ira_loop_pressure)
+ ira_set_pseudo_classes (ira_dump_file);
+
rebuild_p = update_equiv_regs ();
#ifndef IRA_NO_OBSTACK
@@ -3158,7 +3164,6 @@ ira (FILE *f)
}
max_regno_before_ira = allocated_reg_info_size = max_reg_num ();
- resize_reg_info ();
ira_setup_eliminable_regset ();
ira_overall_cost = ira_reg_cost = ira_mem_cost = 0;
@@ -3272,6 +3277,8 @@ ira (FILE *f)
reload_completed = !reload (get_insns (), ira_conflicts_p);
+ finish_subregs_of_mode ();
+
timevar_pop (TV_RELOAD);
timevar_push (TV_IRA);
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 5a9f1d6e010..7815bc8a050 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,14 @@
+2009-10-20 Joel Dice <dicej@mailsnare.net>
+
+ PR java/28474
+ * mangle_name.c (append_unicode_mangled_name): Fix mangling
+ of names with multiple underscores and "U".
+ (unicode_mangling_length): Likewise.
+
+2009-10-03 Simon Baldwin <simonb@google.com>
+
+ * config-lang.in (lang_dirs): Remove zlib.
+
2009-09-28 Richard Henderson <rth@redhat.com>
* builtins.c (initialize_builtins): Update call to
diff --git a/gcc/java/config-lang.in b/gcc/java/config-lang.in
index d3a4d4dbbe5..29ee3fd8547 100644
--- a/gcc/java/config-lang.in
+++ b/gcc/java/config-lang.in
@@ -35,6 +35,6 @@ compilers="jc1\$(exeext) jvgenmain\$(exeext)"
gtfiles="\$(srcdir)/java/java-tree.h \$(srcdir)/java/jcf.h \$(srcdir)/java/parse.h \$(srcdir)/java/builtins.c \$(srcdir)/java/class.c \$(srcdir)/java/constants.c \$(srcdir)/java/decl.c \$(srcdir)/java/expr.c \$(srcdir)/java/jcf-parse.c \$(srcdir)/java/lang.c \$(srcdir)/java/mangle.c \$(srcdir)/java/resource.c"
target_libs=${libgcj_saved}
-lang_dirs="zlib fastjar"
+lang_dirs="fastjar"
#build_by_default=no
lang_requires=c++
diff --git a/gcc/java/mangle_name.c b/gcc/java/mangle_name.c
index a0e6887a04e..a75f5cad090 100644
--- a/gcc/java/mangle_name.c
+++ b/gcc/java/mangle_name.c
@@ -266,7 +266,10 @@ append_unicode_mangled_name (const char *name, int len)
int ch = UTF8_GET(ptr, limit);
if ((ISALNUM (ch) && ch != 'U') || ch == '$')
- obstack_1grow (mangle_obstack, ch);
+ {
+ obstack_1grow (mangle_obstack, ch);
+ uuU = 0;
+ }
/* Everything else needs encoding */
else
{
@@ -321,7 +324,10 @@ unicode_mangling_length (const char *name, int len)
if (ch < 0)
error ("internal error - invalid Utf8 name");
if ((ISALNUM (ch) && ch != 'U') || ch == '$')
- num_chars++;
+ {
+ num_chars++;
+ uuU = 0;
+ }
/* Everything else needs encoding */
else
{
diff --git a/gcc/jump.c b/gcc/jump.c
index a12d0404500..6ebc7ef1cd7 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -1695,6 +1695,10 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y)
if (GET_MODE (x) != GET_MODE (y))
return 0;
+ /* MEMs refering to different address space are not equivalent. */
+ if (code == MEM && MEM_ADDR_SPACE (x) != MEM_ADDR_SPACE (y))
+ return 0;
+
/* For commutative operations, the RTX match if the operand match in any
order. Also handle the simple binary and unary cases without a loop. */
if (targetm.commutative_p (x, UNKNOWN))
diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h
index 40a4de93d6d..4f01483846b 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -62,7 +62,7 @@ extern bool lhd_decl_ok_for_sibcall (const_tree);
extern size_t lhd_tree_size (enum tree_code);
extern HOST_WIDE_INT lhd_to_target_charset (HOST_WIDE_INT);
extern tree lhd_expr_to_decl (tree, bool *, bool *);
-extern tree lhd_builtin_function (tree decl);
+extern tree lhd_builtin_function (tree);
/* Declarations of default tree inlining hooks. */
extern void lhd_initialize_diagnostics (struct diagnostic_context *);
@@ -236,6 +236,21 @@ extern tree lhd_make_node (enum tree_code);
LANG_HOOKS_OMP_FINISH_CLAUSE \
}
+/* LTO hooks. */
+extern void lhd_begin_section (const char *);
+extern void lhd_append_data (const void *, size_t, void *);
+extern void lhd_end_section (void);
+
+#define LANG_HOOKS_BEGIN_SECTION lhd_begin_section
+#define LANG_HOOKS_APPEND_DATA lhd_append_data
+#define LANG_HOOKS_END_SECTION lhd_end_section
+
+#define LANG_HOOKS_LTO { \
+ LANG_HOOKS_BEGIN_SECTION, \
+ LANG_HOOKS_APPEND_DATA, \
+ LANG_HOOKS_END_SECTION \
+}
+
/* The whole thing. The structure is defined in langhooks.h. */
#define LANG_HOOKS_INITIALIZER { \
LANG_HOOKS_NAME, \
@@ -273,6 +288,7 @@ extern tree lhd_make_node (enum tree_code);
LANG_HOOKS_TREE_DUMP_INITIALIZER, \
LANG_HOOKS_DECLS, \
LANG_HOOKS_FOR_TYPES_INITIALIZER, \
+ LANG_HOOKS_LTO, \
LANG_HOOKS_GET_INNERMOST_GENERIC_PARMS, \
LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS, \
LANG_HOOKS_FUNCTION_PARAMETER_PACK_P, \
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index 092a3238592..633caf58c53 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -38,6 +38,7 @@ along with GCC; see the file COPYING3. If not see
#include "ggc.h"
#include "diagnostic.h"
#include "cgraph.h"
+#include "output.h"
/* Do nothing; in many cases the default hook. */
@@ -584,3 +585,54 @@ lhd_builtin_function (tree decl)
lang_hooks.decls.pushdecl (decl);
return decl;
}
+
+/* LTO hooks. */
+
+/* Used to save and restore any previously active section. */
+static section *saved_section;
+
+
+/* Begin a new LTO output section named NAME. This default implementation
+ saves the old section and emits assembly code to switch to the new
+ section. */
+
+void
+lhd_begin_section (const char *name)
+{
+ section *section;
+
+ /* Save the old section so we can restore it in lto_end_asm_section. */
+ gcc_assert (!saved_section);
+ saved_section = in_section;
+
+ /* Create a new section and switch to it. */
+ section = get_section (name, SECTION_DEBUG, NULL);
+ switch_to_section (section);
+}
+
+
+/* Write DATA of length LEN to the current LTO output section. This default
+ implementation just calls assemble_string and frees BLOCK. */
+
+void
+lhd_append_data (const void *data, size_t len, void *block)
+{
+ if (data)
+ assemble_string ((const char *)data, len);
+ free (block);
+}
+
+
+/* Finish the current LTO output section. This default implementation emits
+ assembly code to switch to any section previously saved by
+ lhd_begin_section. */
+
+void
+lhd_end_section (void)
+{
+ if (saved_section)
+ {
+ switch_to_section (saved_section);
+ saved_section = NULL;
+ }
+}
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index b133ea05763..81f24366234 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -231,6 +231,23 @@ struct lang_hooks_for_decls
void (*omp_finish_clause) (tree clause);
};
+/* Language hooks related to LTO serialization. */
+
+struct lang_hooks_for_lto
+{
+ /* Begin a new LTO section named NAME. */
+ void (*begin_section) (const char *name);
+
+ /* Write DATA of length LEN to the currently open LTO section. BLOCK is a
+ pointer to the dynamically allocated memory containing DATA. The
+ append_data function is responsible for freeing it when it is no longer
+ needed. */
+ void (*append_data) (const void *data, size_t len, void *block);
+
+ /* End the previously begun LTO section. */
+ void (*end_section) (void);
+};
+
/* Language-specific hooks. See langhooks-def.h for defaults. */
struct lang_hooks
@@ -386,6 +403,8 @@ struct lang_hooks
struct lang_hooks_for_types types;
+ struct lang_hooks_for_lto lto;
+
/* Returns the generic parameters of an instantiation of
a generic type or decl, e.g. C++ template instantiation. */
tree (*get_innermost_generic_parms) (const_tree);
diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c
index 11a8310f33e..37f88f2fcbd 100644
--- a/gcc/loop-invariant.c
+++ b/gcc/loop-invariant.c
@@ -39,9 +39,9 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "hard-reg-set.h"
#include "rtl.h"
#include "tm_p.h"
-#include "hard-reg-set.h"
#include "obstack.h"
#include "basic-block.h"
#include "cfgloop.h"
@@ -54,6 +54,8 @@ along with GCC; see the file COPYING3. If not see
#include "hashtab.h"
#include "except.h"
#include "params.h"
+#include "regs.h"
+#include "ira.h"
/* The data stored for the loop. */
@@ -61,6 +63,12 @@ struct loop_data
{
struct loop *outermost_exit; /* The outermost exit of the loop. */
bool has_call; /* True if the loop contains a call. */
+ /* Maximal register pressure inside loop for given register class
+ (defined only for the cover classes). */
+ int max_reg_pressure[N_REG_CLASSES];
+ /* Loop regs referenced and live pseudo-registers. */
+ bitmap_head regs_ref;
+ bitmap_head regs_live;
};
#define LOOP_DATA(LOOP) ((struct loop_data *) (LOOP)->aux)
@@ -100,6 +108,10 @@ struct invariant
value. */
rtx reg;
+ /* If we moved the invariant out of the loop, the original regno
+ that contained its value. */
+ int orig_regno;
+
/* The definition of the invariant. */
struct def *def;
@@ -126,6 +138,9 @@ struct invariant
unsigned stamp;
};
+/* Currently processed loop. */
+static struct loop *curr_loop;
+
/* Table of invariants indexed by the df_ref uid field. */
static unsigned int invariant_table_size = 0;
@@ -615,7 +630,12 @@ find_exits (struct loop *loop, basic_block *body,
}
}
- loop->aux = xcalloc (1, sizeof (struct loop_data));
+ if (loop->aux == NULL)
+ {
+ loop->aux = xcalloc (1, sizeof (struct loop_data));
+ bitmap_initialize (&LOOP_DATA (loop)->regs_ref, &reg_obstack);
+ bitmap_initialize (&LOOP_DATA (loop)->regs_live, &reg_obstack);
+ }
LOOP_DATA (loop)->outermost_exit = outermost_exit;
LOOP_DATA (loop)->has_call = has_call;
}
@@ -685,8 +705,17 @@ create_new_invariant (struct def *def, rtx insn, bitmap depends_on,
if (def)
{
inv->cost = rtx_cost (set, SET, speed);
+ /* ??? Try to determine cheapness of address computation. Unfortunately
+ the address cost is only a relative measure, we can't really compare
+ it with any absolute number, but only with other address costs.
+ But here we don't have any other addresses, so compare with a magic
+ number anyway. It has to be large enough to not regress PR33928
+ (by avoiding to move reg+8,reg+16,reg+24 invariants), but small
+ enough to not regress 410.bwaves either (by still moving reg+reg
+ invariants).
+ See http://gcc.gnu.org/ml/gcc-patches/2009-10/msg01210.html . */
inv->cheap_address = address_cost (SET_SRC (set), word_mode,
- speed) < COSTS_N_INSNS (1);
+ ADDR_SPACE_GENERIC, speed) < 3;
}
else
{
@@ -696,6 +725,7 @@ create_new_invariant (struct def *def, rtx insn, bitmap depends_on,
inv->move = false;
inv->reg = NULL_RTX;
+ inv->orig_regno = -1;
inv->stamp = 0;
inv->insn = insn;
@@ -982,14 +1012,46 @@ free_use_list (struct use *use)
}
}
+/* Return cover class and number of hard registers (through *NREGS)
+ for destination of INSN. */
+static enum reg_class
+get_cover_class_and_nregs (rtx insn, int *nregs)
+{
+ rtx reg;
+ enum reg_class cover_class;
+ rtx set = single_set (insn);
+
+ /* Considered invariant insns have only one set. */
+ gcc_assert (set != NULL_RTX);
+ reg = SET_DEST (set);
+ if (GET_CODE (reg) == SUBREG)
+ reg = SUBREG_REG (reg);
+ if (MEM_P (reg))
+ {
+ *nregs = 0;
+ cover_class = NO_REGS;
+ }
+ else
+ {
+ if (! REG_P (reg))
+ reg = NULL_RTX;
+ if (reg == NULL_RTX)
+ cover_class = GENERAL_REGS;
+ else
+ cover_class = reg_cover_class (REGNO (reg));
+ *nregs = ira_reg_class_nregs[cover_class][GET_MODE (SET_SRC (set))];
+ }
+ return cover_class;
+}
+
/* Calculates cost and number of registers needed for moving invariant INV
out of the loop and stores them to *COST and *REGS_NEEDED. */
static void
get_inv_cost (struct invariant *inv, int *comp_cost, unsigned *regs_needed)
{
- int acomp_cost;
- unsigned aregs_needed;
+ int i, acomp_cost;
+ unsigned aregs_needed[N_REG_CLASSES];
unsigned depno;
struct invariant *dep;
bitmap_iterator bi;
@@ -998,13 +1060,30 @@ get_inv_cost (struct invariant *inv, int *comp_cost, unsigned *regs_needed)
inv = VEC_index (invariant_p, invariants, inv->eqto);
*comp_cost = 0;
- *regs_needed = 0;
+ if (! flag_ira_loop_pressure)
+ regs_needed[0] = 0;
+ else
+ {
+ for (i = 0; i < ira_reg_class_cover_size; i++)
+ regs_needed[ira_reg_class_cover[i]] = 0;
+ }
+
if (inv->move
|| inv->stamp == actual_stamp)
return;
inv->stamp = actual_stamp;
- (*regs_needed)++;
+ if (! flag_ira_loop_pressure)
+ regs_needed[0]++;
+ else
+ {
+ int nregs;
+ enum reg_class cover_class;
+
+ cover_class = get_cover_class_and_nregs (inv->insn, &nregs);
+ regs_needed[cover_class] += nregs;
+ }
+
if (!inv->cheap_address
|| inv->def->n_addr_uses < inv->def->n_uses)
(*comp_cost) += inv->cost;
@@ -1029,19 +1108,35 @@ get_inv_cost (struct invariant *inv, int *comp_cost, unsigned *regs_needed)
on floating point constants is unlikely to ever occur. */
rtx set = single_set (inv->insn);
if (set
- && IS_STACK_MODE (GET_MODE (SET_SRC (set)))
- && constant_pool_constant_p (SET_SRC (set)))
- (*regs_needed) += 2;
+ && IS_STACK_MODE (GET_MODE (SET_SRC (set)))
+ && constant_pool_constant_p (SET_SRC (set)))
+ {
+ if (flag_ira_loop_pressure)
+ regs_needed[STACK_REG_COVER_CLASS] += 2;
+ else
+ regs_needed[0] += 2;
+ }
}
#endif
EXECUTE_IF_SET_IN_BITMAP (inv->depends_on, 0, depno, bi)
{
+ bool check_p;
+
dep = VEC_index (invariant_p, invariants, depno);
- get_inv_cost (dep, &acomp_cost, &aregs_needed);
+ get_inv_cost (dep, &acomp_cost, aregs_needed);
- if (aregs_needed
+ if (! flag_ira_loop_pressure)
+ check_p = aregs_needed[0] != 0;
+ else
+ {
+ for (i = 0; i < ira_reg_class_cover_size; i++)
+ if (aregs_needed[ira_reg_class_cover[i]] != 0)
+ break;
+ check_p = i < ira_reg_class_cover_size;
+ }
+ if (check_p
/* We need to check always_executed, since if the original value of
the invariant may be preserved, we may need to keep it in a
separate register. TODO check whether the register has an
@@ -1051,10 +1146,26 @@ get_inv_cost (struct invariant *inv, int *comp_cost, unsigned *regs_needed)
{
/* If this is a single use, after moving the dependency we will not
need a new register. */
- aregs_needed--;
+ if (! flag_ira_loop_pressure)
+ aregs_needed[0]--;
+ else
+ {
+ int nregs;
+ enum reg_class cover_class;
+
+ cover_class = get_cover_class_and_nregs (inv->insn, &nregs);
+ aregs_needed[cover_class] -= nregs;
+ }
}
- (*regs_needed) += aregs_needed;
+ if (! flag_ira_loop_pressure)
+ regs_needed[0] += aregs_needed[0];
+ else
+ {
+ for (i = 0; i < ira_reg_class_cover_size; i++)
+ regs_needed[ira_reg_class_cover[i]]
+ += aregs_needed[ira_reg_class_cover[i]];
+ }
(*comp_cost) += acomp_cost;
}
}
@@ -1066,15 +1177,62 @@ get_inv_cost (struct invariant *inv, int *comp_cost, unsigned *regs_needed)
static int
gain_for_invariant (struct invariant *inv, unsigned *regs_needed,
- unsigned new_regs, unsigned regs_used, bool speed)
+ unsigned *new_regs, unsigned regs_used, bool speed)
{
int comp_cost, size_cost;
- get_inv_cost (inv, &comp_cost, regs_needed);
actual_stamp++;
- size_cost = (estimate_reg_pressure_cost (new_regs + *regs_needed, regs_used, speed)
- - estimate_reg_pressure_cost (new_regs, regs_used, speed));
+ get_inv_cost (inv, &comp_cost, regs_needed);
+
+ if (! flag_ira_loop_pressure)
+ {
+ size_cost = (estimate_reg_pressure_cost (new_regs[0] + regs_needed[0],
+ regs_used, speed)
+ - estimate_reg_pressure_cost (new_regs[0],
+ regs_used, speed));
+ }
+ else
+ {
+ int i;
+ enum reg_class cover_class;
+
+ for (i = 0; i < ira_reg_class_cover_size; i++)
+ {
+ cover_class = ira_reg_class_cover[i];
+ if ((int) new_regs[cover_class]
+ + (int) regs_needed[cover_class]
+ + LOOP_DATA (curr_loop)->max_reg_pressure[cover_class]
+ + IRA_LOOP_RESERVED_REGS
+ > ira_available_class_regs[cover_class])
+ break;
+ }
+ if (i < ira_reg_class_cover_size)
+ /* There will be register pressure excess and we want not to
+ make this loop invariant motion. All loop invariants with
+ non-positive gains will be rejected in function
+ find_invariants_to_move. Therefore we return the negative
+ number here.
+
+ One could think that this rejects also expensive loop
+ invariant motions and this will hurt code performance.
+ However numerous experiments with different heuristics
+ taking invariant cost into account did not confirm this
+ assumption. There are possible explanations for this
+ result:
+ o probably all expensive invariants were already moved out
+ of the loop by PRE and gimple invariant motion pass.
+ o expensive invariant execution will be hidden by insn
+ scheduling or OOO processor hardware because usually such
+ invariants have a lot of freedom to be executed
+ out-of-order.
+ Another reason for ignoring invariant cost vs spilling cost
+ heuristics is also in difficulties to evaluate accurately
+ spill cost at this stage. */
+ return -1;
+ else
+ size_cost = 0;
+ }
return comp_cost - size_cost;
}
@@ -1087,11 +1245,11 @@ gain_for_invariant (struct invariant *inv, unsigned *regs_needed,
static int
best_gain_for_invariant (struct invariant **best, unsigned *regs_needed,
- unsigned new_regs, unsigned regs_used, bool speed)
+ unsigned *new_regs, unsigned regs_used, bool speed)
{
struct invariant *inv;
- int gain = 0, again;
- unsigned aregs_needed, invno;
+ int i, gain = 0, again;
+ unsigned aregs_needed[N_REG_CLASSES], invno;
for (invno = 0; VEC_iterate (invariant_p, invariants, invno, inv); invno++)
{
@@ -1102,13 +1260,20 @@ best_gain_for_invariant (struct invariant **best, unsigned *regs_needed,
if (inv->eqto != inv->invno)
continue;
- again = gain_for_invariant (inv, &aregs_needed, new_regs, regs_used,
+ again = gain_for_invariant (inv, aregs_needed, new_regs, regs_used,
speed);
if (again > gain)
{
gain = again;
*best = inv;
- *regs_needed = aregs_needed;
+ if (! flag_ira_loop_pressure)
+ regs_needed[0] = aregs_needed[0];
+ else
+ {
+ for (i = 0; i < ira_reg_class_cover_size; i++)
+ regs_needed[ira_reg_class_cover[i]]
+ = aregs_needed[ira_reg_class_cover[i]];
+ }
}
}
@@ -1118,7 +1283,7 @@ best_gain_for_invariant (struct invariant **best, unsigned *regs_needed,
/* Marks invariant INVNO and all its dependencies for moving. */
static void
-set_move_mark (unsigned invno)
+set_move_mark (unsigned invno, int gain)
{
struct invariant *inv = VEC_index (invariant_p, invariants, invno);
bitmap_iterator bi;
@@ -1131,11 +1296,18 @@ set_move_mark (unsigned invno)
inv->move = true;
if (dump_file)
- fprintf (dump_file, "Decided to move invariant %d\n", invno);
+ {
+ if (gain >= 0)
+ fprintf (dump_file, "Decided to move invariant %d -- gain %d\n",
+ invno, gain);
+ else
+ fprintf (dump_file, "Decided to move dependent invariant %d\n",
+ invno);
+ };
EXECUTE_IF_SET_IN_BITMAP (inv->depends_on, 0, invno, bi)
{
- set_move_mark (invno);
+ set_move_mark (invno, -1);
}
}
@@ -1144,32 +1316,54 @@ set_move_mark (unsigned invno)
static void
find_invariants_to_move (bool speed)
{
- unsigned i, regs_used, regs_needed = 0, new_regs;
+ int gain;
+ unsigned i, regs_used, regs_needed[N_REG_CLASSES], new_regs[N_REG_CLASSES];
struct invariant *inv = NULL;
- unsigned int n_regs = DF_REG_SIZE (df);
if (!VEC_length (invariant_p, invariants))
return;
- /* We do not really do a good job in estimating number of registers used;
- we put some initial bound here to stand for induction variables etc.
- that we do not detect. */
- regs_used = 2;
-
- for (i = 0; i < n_regs; i++)
+ if (flag_ira_loop_pressure)
+ /* REGS_USED is actually never used when the flag is on. */
+ regs_used = 0;
+ else
+ /* We do not really do a good job in estimating number of
+ registers used; we put some initial bound here to stand for
+ induction variables etc. that we do not detect. */
{
- if (!DF_REGNO_FIRST_DEF (i) && DF_REGNO_LAST_USE (i))
+ unsigned int n_regs = DF_REG_SIZE (df);
+
+ regs_used = 2;
+
+ for (i = 0; i < n_regs; i++)
{
- /* This is a value that is used but not changed inside loop. */
- regs_used++;
+ if (!DF_REGNO_FIRST_DEF (i) && DF_REGNO_LAST_USE (i))
+ {
+ /* This is a value that is used but not changed inside loop. */
+ regs_used++;
+ }
}
}
- new_regs = 0;
- while (best_gain_for_invariant (&inv, &regs_needed, new_regs, regs_used, speed) > 0)
+ if (! flag_ira_loop_pressure)
+ new_regs[0] = regs_needed[0] = 0;
+ else
{
- set_move_mark (inv->invno);
- new_regs += regs_needed;
+ for (i = 0; (int) i < ira_reg_class_cover_size; i++)
+ new_regs[ira_reg_class_cover[i]] = 0;
+ }
+ while ((gain = best_gain_for_invariant (&inv, regs_needed,
+ new_regs, regs_used, speed)) > 0)
+ {
+ set_move_mark (inv->invno, gain);
+ if (! flag_ira_loop_pressure)
+ new_regs[0] += regs_needed[0];
+ else
+ {
+ for (i = 0; (int) i < ira_reg_class_cover_size; i++)
+ new_regs[ira_reg_class_cover[i]]
+ += regs_needed[ira_reg_class_cover[i]];
+ }
}
}
@@ -1186,11 +1380,13 @@ move_invariant_reg (struct loop *loop, unsigned invno)
rtx reg, set, dest, note;
struct use *use;
bitmap_iterator bi;
+ int regno;
if (inv->reg)
return true;
if (!repr->move)
return false;
+ regno = -1;
/* If this is a representative of the class of equivalent invariants,
really move the invariant. Otherwise just replace its use with
the register used for the representative. */
@@ -1211,7 +1407,12 @@ move_invariant_reg (struct loop *loop, unsigned invno)
would not be dominated by it, we may just move it (TODO). Otherwise we
need to create a temporary register. */
set = single_set (inv->insn);
- dest = SET_DEST (set);
+ reg = dest = SET_DEST (set);
+ if (GET_CODE (reg) == SUBREG)
+ reg = SUBREG_REG (reg);
+ if (REG_P (reg))
+ regno = REGNO (reg);
+
reg = gen_reg_rtx_and_attrs (dest);
/* Try replacing the destination by a new pseudoregister. */
@@ -1237,6 +1438,7 @@ move_invariant_reg (struct loop *loop, unsigned invno)
if (!move_invariant_reg (loop, repr->invno))
goto fail;
reg = repr->reg;
+ regno = repr->orig_regno;
set = single_set (inv->insn);
emit_insn_after (gen_move_insn (SET_DEST (set), reg), inv->insn);
delete_insn (inv->insn);
@@ -1244,6 +1446,7 @@ move_invariant_reg (struct loop *loop, unsigned invno)
inv->reg = reg;
+ inv->orig_regno = regno;
/* Replace the uses we know to be dominated. It saves work for copy
propagation, and also it is necessary so that dependent invariants
@@ -1266,6 +1469,7 @@ fail:
fprintf (dump_file, "Failed to move invariant %d\n", invno);
inv->move = false;
inv->reg = NULL_RTX;
+ inv->orig_regno = -1;
return false;
}
@@ -1281,6 +1485,21 @@ move_invariants (struct loop *loop)
for (i = 0; VEC_iterate (invariant_p, invariants, i, inv); i++)
move_invariant_reg (loop, i);
+ if (flag_ira_loop_pressure && resize_reg_info ())
+ {
+ for (i = 0; VEC_iterate (invariant_p, invariants, i, inv); i++)
+ if (inv->reg != NULL_RTX)
+ {
+ if (inv->orig_regno >= 0)
+ setup_reg_classes (REGNO (inv->reg),
+ reg_preferred_class (inv->orig_regno),
+ reg_alternate_class (inv->orig_regno),
+ reg_cover_class (inv->orig_regno));
+ else
+ setup_reg_classes (REGNO (inv->reg),
+ GENERAL_REGS, NO_REGS, GENERAL_REGS);
+ }
+ }
}
/* Initializes invariant motion data. */
@@ -1346,10 +1565,317 @@ free_loop_data (struct loop *loop)
{
struct loop_data *data = LOOP_DATA (loop);
+ bitmap_clear (&LOOP_DATA (loop)->regs_ref);
+ bitmap_clear (&LOOP_DATA (loop)->regs_live);
free (data);
loop->aux = NULL;
}
+
+
+/* Registers currently living. */
+static bitmap_head curr_regs_live;
+
+/* Current reg pressure for each cover class. */
+static int curr_reg_pressure[N_REG_CLASSES];
+
+/* Record all regs that are set in any one insn. Communication from
+ mark_reg_{store,clobber} and global_conflicts. Asm can refer to
+ all hard-registers. */
+static rtx regs_set[(FIRST_PSEUDO_REGISTER > MAX_RECOG_OPERANDS
+ ? FIRST_PSEUDO_REGISTER : MAX_RECOG_OPERANDS) * 2];
+/* Number of regs stored in the previous array. */
+static int n_regs_set;
+
+/* Return cover class and number of needed hard registers (through
+ *NREGS) of register REGNO. */
+static enum reg_class
+get_regno_cover_class (int regno, int *nregs)
+{
+ if (regno >= FIRST_PSEUDO_REGISTER)
+ {
+ enum reg_class cover_class = reg_cover_class (regno);
+
+ *nregs = ira_reg_class_nregs[cover_class][PSEUDO_REGNO_MODE (regno)];
+ return cover_class;
+ }
+ else if (! TEST_HARD_REG_BIT (ira_no_alloc_regs, regno)
+ && ! TEST_HARD_REG_BIT (eliminable_regset, regno))
+ {
+ *nregs = 1;
+ return ira_class_translate[REGNO_REG_CLASS (regno)];
+ }
+ else
+ {
+ *nregs = 0;
+ return NO_REGS;
+ }
+}
+
+/* Increase (if INCR_P) or decrease current register pressure for
+ register REGNO. */
+static void
+change_pressure (int regno, bool incr_p)
+{
+ int nregs;
+ enum reg_class cover_class;
+
+ cover_class = get_regno_cover_class (regno, &nregs);
+ if (! incr_p)
+ curr_reg_pressure[cover_class] -= nregs;
+ else
+ {
+ curr_reg_pressure[cover_class] += nregs;
+ if (LOOP_DATA (curr_loop)->max_reg_pressure[cover_class]
+ < curr_reg_pressure[cover_class])
+ LOOP_DATA (curr_loop)->max_reg_pressure[cover_class]
+ = curr_reg_pressure[cover_class];
+ }
+}
+
+/* Mark REGNO birth. */
+static void
+mark_regno_live (int regno)
+{
+ struct loop *loop;
+
+ for (loop = curr_loop;
+ loop != current_loops->tree_root;
+ loop = loop_outer (loop))
+ bitmap_set_bit (&LOOP_DATA (loop)->regs_live, regno);
+ if (bitmap_bit_p (&curr_regs_live, regno))
+ return;
+ bitmap_set_bit (&curr_regs_live, regno);
+ change_pressure (regno, true);
+}
+
+/* Mark REGNO death. */
+static void
+mark_regno_death (int regno)
+{
+ if (! bitmap_bit_p (&curr_regs_live, regno))
+ return;
+ bitmap_clear_bit (&curr_regs_live, regno);
+ change_pressure (regno, false);
+}
+
+/* Mark setting register REG. */
+static void
+mark_reg_store (rtx reg, const_rtx setter ATTRIBUTE_UNUSED,
+ void *data ATTRIBUTE_UNUSED)
+{
+ int regno;
+
+ if (GET_CODE (reg) == SUBREG)
+ reg = SUBREG_REG (reg);
+
+ if (! REG_P (reg))
+ return;
+
+ regs_set[n_regs_set++] = reg;
+
+ regno = REGNO (reg);
+
+ if (regno >= FIRST_PSEUDO_REGISTER)
+ mark_regno_live (regno);
+ else
+ {
+ int last = regno + hard_regno_nregs[regno][GET_MODE (reg)];
+
+ while (regno < last)
+ {
+ mark_regno_live (regno);
+ regno++;
+ }
+ }
+}
+
+/* Mark clobbering register REG. */
+static void
+mark_reg_clobber (rtx reg, const_rtx setter, void *data)
+{
+ if (GET_CODE (setter) == CLOBBER)
+ mark_reg_store (reg, setter, data);
+}
+
+/* Mark register REG death. */
+static void
+mark_reg_death (rtx reg)
+{
+ int regno = REGNO (reg);
+
+ if (regno >= FIRST_PSEUDO_REGISTER)
+ mark_regno_death (regno);
+ else
+ {
+ int last = regno + hard_regno_nregs[regno][GET_MODE (reg)];
+
+ while (regno < last)
+ {
+ mark_regno_death (regno);
+ regno++;
+ }
+ }
+}
+
+/* Mark occurrence of registers in X for the current loop. */
+static void
+mark_ref_regs (rtx x)
+{
+ RTX_CODE code;
+ int i;
+ const char *fmt;
+
+ if (!x)
+ return;
+
+ code = GET_CODE (x);
+ if (code == REG)
+ {
+ struct loop *loop;
+
+ for (loop = curr_loop;
+ loop != current_loops->tree_root;
+ loop = loop_outer (loop))
+ bitmap_set_bit (&LOOP_DATA (loop)->regs_ref, REGNO (x));
+ return;
+ }
+
+ fmt = GET_RTX_FORMAT (code);
+ for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
+ if (fmt[i] == 'e')
+ mark_ref_regs (XEXP (x, i));
+ else if (fmt[i] == 'E')
+ {
+ int j;
+
+ for (j = 0; j < XVECLEN (x, i); j++)
+ mark_ref_regs (XVECEXP (x, i, j));
+ }
+}
+
+/* Calculate register pressure in the loops. */
+static void
+calculate_loop_reg_pressure (void)
+{
+ int i;
+ unsigned int j;
+ bitmap_iterator bi;
+ basic_block bb;
+ rtx insn, link;
+ struct loop *loop, *parent;
+ loop_iterator li;
+
+ FOR_EACH_LOOP (li, loop, 0)
+ if (loop->aux == NULL)
+ {
+ loop->aux = xcalloc (1, sizeof (struct loop_data));
+ bitmap_initialize (&LOOP_DATA (loop)->regs_ref, &reg_obstack);
+ bitmap_initialize (&LOOP_DATA (loop)->regs_live, &reg_obstack);
+ }
+ ira_setup_eliminable_regset ();
+ bitmap_initialize (&curr_regs_live, &reg_obstack);
+ FOR_EACH_BB (bb)
+ {
+ curr_loop = bb->loop_father;
+ if (curr_loop == current_loops->tree_root)
+ continue;
+
+ for (loop = curr_loop;
+ loop != current_loops->tree_root;
+ loop = loop_outer (loop))
+ bitmap_ior_into (&LOOP_DATA (loop)->regs_live, DF_LR_IN (bb));
+
+ bitmap_copy (&curr_regs_live, DF_LR_IN (bb));
+ for (i = 0; i < ira_reg_class_cover_size; i++)
+ curr_reg_pressure[ira_reg_class_cover[i]] = 0;
+ EXECUTE_IF_SET_IN_BITMAP (&curr_regs_live, 0, j, bi)
+ change_pressure (j, true);
+
+ FOR_BB_INSNS (bb, insn)
+ {
+ if (! NONDEBUG_INSN_P (insn))
+ continue;
+
+ mark_ref_regs (PATTERN (insn));
+ n_regs_set = 0;
+ note_stores (PATTERN (insn), mark_reg_clobber, NULL);
+
+ /* Mark any registers dead after INSN as dead now. */
+
+ for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
+ if (REG_NOTE_KIND (link) == REG_DEAD)
+ mark_reg_death (XEXP (link, 0));
+
+ /* Mark any registers set in INSN as live,
+ and mark them as conflicting with all other live regs.
+ Clobbers are processed again, so they conflict with
+ the registers that are set. */
+
+ note_stores (PATTERN (insn), mark_reg_store, NULL);
+
+#ifdef AUTO_INC_DEC
+ for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
+ if (REG_NOTE_KIND (link) == REG_INC)
+ mark_reg_store (XEXP (link, 0), NULL_RTX, NULL);
+#endif
+ while (n_regs_set-- > 0)
+ {
+ rtx note = find_regno_note (insn, REG_UNUSED,
+ REGNO (regs_set[n_regs_set]));
+ if (! note)
+ continue;
+
+ mark_reg_death (XEXP (note, 0));
+ }
+ }
+ }
+ bitmap_clear (&curr_regs_live);
+ if (flag_ira_region == IRA_REGION_MIXED
+ || flag_ira_region == IRA_REGION_ALL)
+ FOR_EACH_LOOP (li, loop, 0)
+ {
+ EXECUTE_IF_SET_IN_BITMAP (&LOOP_DATA (loop)->regs_live, 0, j, bi)
+ if (! bitmap_bit_p (&LOOP_DATA (loop)->regs_ref, j))
+ {
+ enum reg_class cover_class;
+ int nregs;
+
+ cover_class = get_regno_cover_class (j, &nregs);
+ LOOP_DATA (loop)->max_reg_pressure[cover_class] -= nregs;
+ }
+ }
+ if (dump_file == NULL)
+ return;
+ FOR_EACH_LOOP (li, loop, 0)
+ {
+ parent = loop_outer (loop);
+ fprintf (dump_file, "\n Loop %d (parent %d, header bb%d, depth %d)\n",
+ loop->num, (parent == NULL ? -1 : parent->num),
+ loop->header->index, loop_depth (loop));
+ fprintf (dump_file, "\n ref. regnos:");
+ EXECUTE_IF_SET_IN_BITMAP (&LOOP_DATA (loop)->regs_ref, 0, j, bi)
+ fprintf (dump_file, " %d", j);
+ fprintf (dump_file, "\n live regnos:");
+ EXECUTE_IF_SET_IN_BITMAP (&LOOP_DATA (loop)->regs_live, 0, j, bi)
+ fprintf (dump_file, " %d", j);
+ fprintf (dump_file, "\n Pressure:");
+ for (i = 0; (int) i < ira_reg_class_cover_size; i++)
+ {
+ enum reg_class cover_class;
+
+ cover_class = ira_reg_class_cover[i];
+ if (LOOP_DATA (loop)->max_reg_pressure[cover_class] == 0)
+ continue;
+ fprintf (dump_file, " %s=%d", reg_class_names[cover_class],
+ LOOP_DATA (loop)->max_reg_pressure[cover_class]);
+ }
+ fprintf (dump_file, "\n");
+ }
+}
+
+
+
/* Move the invariants out of the loops. */
void
@@ -1358,10 +1884,17 @@ move_loop_invariants (void)
struct loop *loop;
loop_iterator li;
+ if (flag_ira_loop_pressure)
+ {
+ df_analyze ();
+ ira_set_pseudo_classes (dump_file);
+ calculate_loop_reg_pressure ();
+ }
df_set_flags (DF_EQ_NOTES + DF_DEFER_INSN_RESCAN);
/* Process the loops, innermost first. */
FOR_EACH_LOOP (li, loop, LI_FROM_INNERMOST)
{
+ curr_loop = loop;
/* move_single_loop_invariants for very large loops
is time consuming and might need a lot of memory. */
if (loop->num_nodes <= (unsigned) LOOP_INVARIANT_MAX_BBS_IN_LOOP)
@@ -1373,6 +1906,10 @@ move_loop_invariants (void)
free_loop_data (loop);
}
+ if (flag_ira_loop_pressure)
+ /* There is no sense to keep this info because it was most
+ probably outdated by subsequent passes. */
+ free_reg_info ();
free (invariant_table);
invariant_table = NULL;
invariant_table_size = 0;
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
new file mode 100644
index 00000000000..6b340a37d58
--- /dev/null
+++ b/gcc/lto-cgraph.c
@@ -0,0 +1,687 @@
+/* Write and read the cgraph to the memory mapped representation of a
+ .o file.
+
+ Copyright 2009 Free Software Foundation, Inc.
+ Contributed by Kenneth Zadeck <zadeck@naturalbridge.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "toplev.h"
+#include "tree.h"
+#include "expr.h"
+#include "flags.h"
+#include "params.h"
+#include "input.h"
+#include "varray.h"
+#include "hashtab.h"
+#include "langhooks.h"
+#include "basic-block.h"
+#include "tree-flow.h"
+#include "cgraph.h"
+#include "function.h"
+#include "ggc.h"
+#include "diagnostic.h"
+#include "except.h"
+#include "vec.h"
+#include "timevar.h"
+#include "output.h"
+#include "pointer-set.h"
+#include "lto-streamer.h"
+
+/* Create a new cgraph encoder. */
+
+lto_cgraph_encoder_t
+lto_cgraph_encoder_new (void)
+{
+ lto_cgraph_encoder_t encoder = XCNEW (struct lto_cgraph_encoder_d);
+ encoder->map = pointer_map_create ();
+ encoder->nodes = NULL;
+ return encoder;
+}
+
+
+/* Delete ENCODER and its components. */
+
+void
+lto_cgraph_encoder_delete (lto_cgraph_encoder_t encoder)
+{
+ VEC_free (cgraph_node_ptr, heap, encoder->nodes);
+ pointer_map_destroy (encoder->map);
+ free (encoder);
+}
+
+
+/* Return the existing reference number of NODE in the cgraph encoder in
+ output block OB. Assign a new reference if this is the first time
+ NODE is encoded. */
+
+int
+lto_cgraph_encoder_encode (lto_cgraph_encoder_t encoder,
+ struct cgraph_node *node)
+{
+ int ref;
+ void **slot;
+
+ slot = pointer_map_contains (encoder->map, node);
+ if (!slot)
+ {
+ ref = VEC_length (cgraph_node_ptr, encoder->nodes);
+ slot = pointer_map_insert (encoder->map, node);
+ *slot = (void *) (intptr_t) ref;
+ VEC_safe_push (cgraph_node_ptr, heap, encoder->nodes, node);
+ }
+ else
+ ref = (int) (intptr_t) *slot;
+
+ return ref;
+}
+
+
+/* Look up NODE in encoder. Return NODE's reference if it has been encoded
+ or LCC_NOT_FOUND if it is not there. */
+
+int
+lto_cgraph_encoder_lookup (lto_cgraph_encoder_t encoder,
+ struct cgraph_node *node)
+{
+ void **slot = pointer_map_contains (encoder->map, node);
+ return (slot ? (int) (intptr_t) *slot : LCC_NOT_FOUND);
+}
+
+
+/* Return the cgraph node corresponding to REF using ENCODER. */
+
+struct cgraph_node *
+lto_cgraph_encoder_deref (lto_cgraph_encoder_t encoder, int ref)
+{
+ if (ref == LCC_NOT_FOUND)
+ return NULL;
+
+ return VEC_index (cgraph_node_ptr, encoder->nodes, ref);
+}
+
+
+/* Return number of encoded nodes in ENCODER. */
+
+static int
+lto_cgraph_encoder_size (lto_cgraph_encoder_t encoder)
+{
+ return VEC_length (cgraph_node_ptr, encoder->nodes);
+}
+
+
+/* Output the cgraph EDGE to OB using ENCODER. */
+
+static void
+lto_output_edge (struct lto_simple_output_block *ob, struct cgraph_edge *edge,
+ lto_cgraph_encoder_t encoder)
+{
+ unsigned int uid;
+ intptr_t ref;
+ struct bitpack_d *bp;
+
+ lto_output_uleb128_stream (ob->main_stream, LTO_cgraph_edge);
+
+ ref = lto_cgraph_encoder_lookup (encoder, edge->caller);
+ gcc_assert (ref != LCC_NOT_FOUND);
+ lto_output_sleb128_stream (ob->main_stream, ref);
+
+ ref = lto_cgraph_encoder_lookup (encoder, edge->callee);
+ gcc_assert (ref != LCC_NOT_FOUND);
+ lto_output_sleb128_stream (ob->main_stream, ref);
+
+ lto_output_sleb128_stream (ob->main_stream, edge->count);
+
+ bp = bitpack_create ();
+ uid = flag_wpa ? edge->lto_stmt_uid : gimple_uid (edge->call_stmt);
+ bp_pack_value (bp, uid, HOST_BITS_PER_INT);
+ bp_pack_value (bp, edge->inline_failed, HOST_BITS_PER_INT);
+ bp_pack_value (bp, edge->frequency, HOST_BITS_PER_INT);
+ bp_pack_value (bp, edge->loop_nest, 30);
+ bp_pack_value (bp, edge->indirect_call, 1);
+ bp_pack_value (bp, edge->call_stmt_cannot_inline_p, 1);
+ bp_pack_value (bp, edge->can_throw_external, 1);
+ lto_output_bitpack (ob->main_stream, bp);
+ bitpack_delete (bp);
+}
+
+
+/* Output the cgraph NODE to OB. ENCODER is used to find the
+ reference number of NODE->inlined_to. SET is the set of nodes we
+ are writing to the current file. If NODE is not in SET, then NODE
+ is a boundary of a cgraph_node_set and we pretend NODE just has a
+ decl and no callees. WRITTEN_DECLS is the set of FUNCTION_DECLs
+ that have had their callgraph node written so far. This is used to
+ determine if NODE is a clone of a previously written node. */
+
+static void
+lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
+ lto_cgraph_encoder_t encoder, cgraph_node_set set,
+ bitmap written_decls)
+{
+ unsigned int tag;
+ struct bitpack_d *bp;
+ unsigned local, externally_visible, inlinable, analyzed;
+ bool boundary_p, wrote_decl_p;
+ intptr_t ref;
+
+ boundary_p = !cgraph_node_in_set_p (node, set);
+ wrote_decl_p = bitmap_bit_p (written_decls, DECL_UID (node->decl));
+
+ switch (cgraph_function_body_availability (node))
+ {
+ case AVAIL_NOT_AVAILABLE:
+ tag = LTO_cgraph_unavail_node;
+ break;
+
+ case AVAIL_AVAILABLE:
+ case AVAIL_LOCAL:
+ tag = LTO_cgraph_avail_node;
+ break;
+
+ case AVAIL_OVERWRITABLE:
+ tag = LTO_cgraph_overwritable_node;
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+
+ if (boundary_p)
+ tag = LTO_cgraph_unavail_node;
+
+ lto_output_uleb128_stream (ob->main_stream, tag);
+
+ local = node->local.local;
+ externally_visible = node->local.externally_visible;
+ inlinable = node->local.inlinable;
+ analyzed = node->analyzed;
+
+ /* In WPA mode, we only output part of the call-graph. Also, we
+ fake cgraph node attributes. There are two cases that we care.
+
+ Boundary nodes: There are nodes that are not part of SET but are
+ called from within SET. We artificially make them look like
+ externally visible nodes with no function body.
+
+ Cherry-picked nodes: These are nodes we pulled from other
+ translation units into SET during IPA-inlining. We make them as
+ local static nodes to prevent clashes with other local statics. */
+ if (boundary_p)
+ {
+ /* Inline clones can not be part of boundary. */
+ gcc_assert (!node->global.inlined_to);
+ local = 0;
+ externally_visible = 1;
+ inlinable = 0;
+ analyzed = 0;
+ }
+ else if (lto_forced_extern_inline_p (node->decl))
+ {
+ local = 1;
+ externally_visible = 0;
+ inlinable = 1;
+ }
+
+ lto_output_uleb128_stream (ob->main_stream, wrote_decl_p);
+
+ if (!wrote_decl_p)
+ bitmap_set_bit (written_decls, DECL_UID (node->decl));
+
+ lto_output_fn_decl_index (ob->decl_state, ob->main_stream, node->decl);
+ lto_output_sleb128_stream (ob->main_stream, node->count);
+
+ bp = bitpack_create ();
+ bp_pack_value (bp, local, 1);
+ bp_pack_value (bp, externally_visible, 1);
+ bp_pack_value (bp, node->local.finalized, 1);
+ bp_pack_value (bp, inlinable, 1);
+ bp_pack_value (bp, node->local.disregard_inline_limits, 1);
+ bp_pack_value (bp, node->local.redefined_extern_inline, 1);
+ bp_pack_value (bp, node->local.for_functions_valid, 1);
+ bp_pack_value (bp, node->local.vtable_method, 1);
+ bp_pack_value (bp, node->needed, 1);
+ bp_pack_value (bp, node->address_taken, 1);
+ bp_pack_value (bp, node->abstract_and_needed, 1);
+ bp_pack_value (bp, node->reachable, 1);
+ bp_pack_value (bp, node->lowered, 1);
+ bp_pack_value (bp, analyzed, 1);
+ bp_pack_value (bp, node->process, 1);
+ bp_pack_value (bp, node->alias, 1);
+ bp_pack_value (bp, node->finalized_by_frontend, 1);
+ lto_output_bitpack (ob->main_stream, bp);
+ bitpack_delete (bp);
+
+ if (tag != LTO_cgraph_unavail_node)
+ {
+ lto_output_sleb128_stream (ob->main_stream,
+ node->local.inline_summary.estimated_self_stack_size);
+ lto_output_sleb128_stream (ob->main_stream,
+ node->local.inline_summary.self_size);
+ lto_output_sleb128_stream (ob->main_stream,
+ node->local.inline_summary.size_inlining_benefit);
+ lto_output_sleb128_stream (ob->main_stream,
+ node->local.inline_summary.self_time);
+ lto_output_sleb128_stream (ob->main_stream,
+ node->local.inline_summary.time_inlining_benefit);
+ }
+
+ /* FIXME lto: Outputting global info is not neccesary until after
+ inliner was run. Global structure holds results of propagation
+ done by inliner. */
+ lto_output_sleb128_stream (ob->main_stream,
+ node->global.estimated_stack_size);
+ lto_output_sleb128_stream (ob->main_stream,
+ node->global.stack_frame_offset);
+ if (node->global.inlined_to && !boundary_p)
+ {
+ ref = lto_cgraph_encoder_lookup (encoder, node->global.inlined_to);
+ gcc_assert (ref != LCC_NOT_FOUND);
+ }
+ else
+ ref = LCC_NOT_FOUND;
+ lto_output_sleb128_stream (ob->main_stream, ref);
+
+ lto_output_sleb128_stream (ob->main_stream, node->global.time);
+ lto_output_sleb128_stream (ob->main_stream, node->global.size);
+ lto_output_sleb128_stream (ob->main_stream,
+ node->global.estimated_growth);
+ lto_output_uleb128_stream (ob->main_stream, node->global.inlined);
+}
+
+
+/* Output the part of the cgraph in SET. */
+
+void
+output_cgraph (cgraph_node_set set)
+{
+ struct cgraph_node *node;
+ struct lto_simple_output_block *ob;
+ cgraph_node_set_iterator csi;
+ struct cgraph_edge *edge;
+ int i, n_nodes;
+ bitmap written_decls;
+ lto_cgraph_encoder_t encoder;
+ struct cgraph_asm_node *can;
+
+ ob = lto_create_simple_output_block (LTO_section_cgraph);
+
+ /* An encoder for cgraph nodes should have been created by
+ ipa_write_summaries_1. */
+ gcc_assert (ob->decl_state->cgraph_node_encoder);
+ encoder = ob->decl_state->cgraph_node_encoder;
+
+ /* The FUNCTION_DECLs for which we have written a node. The first
+ node found is written as the "original" node, the remaining nodes
+ are considered its clones. */
+ written_decls = lto_bitmap_alloc ();
+
+ /* Go over all the nodes in SET and assign references. */
+ for (csi = csi_start (set); !csi_end_p (csi); csi_next (&csi))
+ {
+ node = csi_node (csi);
+ lto_cgraph_encoder_encode (encoder, node);
+ }
+
+ /* Go over all the nodes again to include callees that are not in
+ SET. */
+ for (csi = csi_start (set); !csi_end_p (csi); csi_next (&csi))
+ {
+ node = csi_node (csi);
+ for (edge = node->callees; edge; edge = edge->next_callee)
+ {
+ struct cgraph_node *callee = edge->callee;
+ if (!cgraph_node_in_set_p (callee, set))
+ {
+ /* We should have moved all the inlines. */
+ gcc_assert (!callee->global.inlined_to);
+ lto_cgraph_encoder_encode (encoder, callee);
+ }
+ }
+ }
+
+ /* Write out the nodes. */
+ n_nodes = lto_cgraph_encoder_size (encoder);
+ for (i = 0; i < n_nodes; i++)
+ {
+ node = lto_cgraph_encoder_deref (encoder, i);
+ lto_output_node (ob, node, encoder, set, written_decls);
+ }
+
+ lto_bitmap_free (written_decls);
+
+ /* Go over the nodes in SET again to write edges. */
+ for (csi = csi_start (set); !csi_end_p (csi); csi_next (&csi))
+ {
+ node = csi_node (csi);
+ if (node->callees)
+ {
+ /* Output edges in backward direction, so the reconstructed callgraph
+ match and it is easy to associate call sites in the IPA pass summaries. */
+ edge = node->callees;
+ while (edge->next_callee)
+ edge = edge->next_callee;
+ for (; edge; edge = edge->prev_callee)
+ lto_output_edge (ob, edge, encoder);
+ }
+ }
+
+ lto_output_uleb128_stream (ob->main_stream, 0);
+
+ /* Emit toplevel asms. */
+ for (can = cgraph_asm_nodes; can; can = can->next)
+ {
+ int len = TREE_STRING_LENGTH (can->asm_str);
+ lto_output_uleb128_stream (ob->main_stream, len);
+ for (i = 0; i < len; ++i)
+ lto_output_1_stream (ob->main_stream,
+ TREE_STRING_POINTER (can->asm_str)[i]);
+ }
+
+ lto_output_uleb128_stream (ob->main_stream, 0);
+
+ lto_destroy_simple_output_block (ob);
+}
+
+
+/* Overwrite the information in NODE based on FILE_DATA, TAG, FLAGS,
+ STACK_SIZE, SELF_TIME and SELF_SIZE. This is called either to initialize
+ NODE or to replace the values in it, for instance because the first
+ time we saw it, the function body was not available but now it
+ is. BP is a bitpack with all the bitflags for NODE read from the
+ stream. */
+
+static void
+input_overwrite_node (struct lto_file_decl_data *file_data,
+ struct cgraph_node *node,
+ enum LTO_cgraph_tags tag,
+ struct bitpack_d *bp,
+ unsigned int stack_size,
+ unsigned int self_time,
+ unsigned int time_inlining_benefit,
+ unsigned int self_size,
+ unsigned int size_inlining_benefit)
+{
+ node->aux = (void *) tag;
+ node->local.inline_summary.estimated_self_stack_size = stack_size;
+ node->local.inline_summary.self_time = self_time;
+ node->local.inline_summary.time_inlining_benefit = time_inlining_benefit;
+ node->local.inline_summary.self_size = self_size;
+ node->local.inline_summary.size_inlining_benefit = size_inlining_benefit;
+ node->global.time = self_time;
+ node->global.size = self_size;
+ node->local.lto_file_data = file_data;
+
+ node->local.local = bp_unpack_value (bp, 1);
+ node->local.externally_visible = bp_unpack_value (bp, 1);
+ node->local.finalized = bp_unpack_value (bp, 1);
+ node->local.inlinable = bp_unpack_value (bp, 1);
+ node->local.disregard_inline_limits = bp_unpack_value (bp, 1);
+ node->local.redefined_extern_inline = bp_unpack_value (bp, 1);
+ node->local.for_functions_valid = bp_unpack_value (bp, 1);
+ node->local.vtable_method = bp_unpack_value (bp, 1);
+ node->needed = bp_unpack_value (bp, 1);
+ node->address_taken = bp_unpack_value (bp, 1);
+ node->abstract_and_needed = bp_unpack_value (bp, 1);
+ node->reachable = bp_unpack_value (bp, 1);
+ node->lowered = bp_unpack_value (bp, 1);
+ node->analyzed = bp_unpack_value (bp, 1);
+ node->process = bp_unpack_value (bp, 1);
+ node->alias = bp_unpack_value (bp, 1);
+ node->finalized_by_frontend = bp_unpack_value (bp, 1);
+}
+
+
+/* Read a node from input_block IB. TAG is the node's tag just read.
+ Return the node read or overwriten. */
+
+static struct cgraph_node *
+input_node (struct lto_file_decl_data *file_data,
+ struct lto_input_block *ib,
+ enum LTO_cgraph_tags tag)
+{
+ tree fn_decl;
+ struct cgraph_node *node;
+ struct bitpack_d *bp;
+ int stack_size = 0;
+ unsigned decl_index;
+ bool clone_p;
+ int estimated_stack_size = 0;
+ int stack_frame_offset = 0;
+ int ref = LCC_NOT_FOUND;
+ int estimated_growth = 0;
+ int time = 0;
+ int size = 0;
+ int self_time = 0;
+ int self_size = 0;
+ int time_inlining_benefit = 0;
+ int size_inlining_benefit = 0;
+ bool inlined = false;
+
+ clone_p = (lto_input_uleb128 (ib) != 0);
+
+ decl_index = lto_input_uleb128 (ib);
+ fn_decl = lto_file_decl_data_get_fn_decl (file_data, decl_index);
+
+ if (clone_p)
+ node = cgraph_clone_node (cgraph_node (fn_decl), 0,
+ CGRAPH_FREQ_BASE, 0, false, NULL);
+
+ else
+ node = cgraph_node (fn_decl);
+
+ node->count = lto_input_sleb128 (ib);
+ bp = lto_input_bitpack (ib);
+
+ if (tag != LTO_cgraph_unavail_node)
+ {
+ stack_size = lto_input_sleb128 (ib);
+ self_size = lto_input_sleb128 (ib);
+ size_inlining_benefit = lto_input_sleb128 (ib);
+ self_time = lto_input_sleb128 (ib);
+ time_inlining_benefit = lto_input_sleb128 (ib);
+ }
+
+ estimated_stack_size = lto_input_sleb128 (ib);
+ stack_frame_offset = lto_input_sleb128 (ib);
+ ref = lto_input_sleb128 (ib);
+ time = lto_input_sleb128 (ib);
+ size = lto_input_sleb128 (ib);
+ estimated_growth = lto_input_sleb128 (ib);
+ inlined = lto_input_uleb128 (ib);
+
+ /* Make sure that we have not read this node before. Nodes that
+ have already been read will have their tag stored in the 'aux'
+ field. Since built-in functions can be referenced in multiple
+ functions, they are expected to be read more than once. */
+ if (node->aux && !DECL_IS_BUILTIN (node->decl))
+ internal_error ("bytecode stream: found multiple instances of cgraph "
+ "node %d", node->uid);
+
+ input_overwrite_node (file_data, node, tag, bp, stack_size, self_time,
+ time_inlining_benefit, self_size,
+ size_inlining_benefit);
+ bitpack_delete (bp);
+
+ node->global.estimated_stack_size = estimated_stack_size;
+ node->global.stack_frame_offset = stack_frame_offset;
+ node->global.time = time;
+ node->global.size = size;
+
+ /* Store a reference for now, and fix up later to be a pointer. */
+ node->global.inlined_to = (cgraph_node_ptr) (intptr_t) ref;
+
+ node->global.estimated_growth = estimated_growth;
+ node->global.inlined = inlined;
+
+ return node;
+}
+
+
+/* Read an edge from IB. NODES points to a vector of previously read
+ nodes for decoding caller and callee of the edge to be read. */
+
+static void
+input_edge (struct lto_input_block *ib, VEC(cgraph_node_ptr, heap) *nodes)
+{
+ struct cgraph_node *caller, *callee;
+ struct cgraph_edge *edge;
+ unsigned int stmt_id;
+ gcov_type count;
+ int freq;
+ unsigned int nest;
+ cgraph_inline_failed_t inline_failed;
+ struct bitpack_d *bp;
+ enum ld_plugin_symbol_resolution caller_resolution;
+
+ caller = VEC_index (cgraph_node_ptr, nodes, lto_input_sleb128 (ib));
+ if (caller == NULL || caller->decl == NULL_TREE)
+ internal_error ("bytecode stream: no caller found while reading edge");
+
+ callee = VEC_index (cgraph_node_ptr, nodes, lto_input_sleb128 (ib));
+ if (callee == NULL || callee->decl == NULL_TREE)
+ internal_error ("bytecode stream: no callee found while reading edge");
+
+ count = (gcov_type) lto_input_sleb128 (ib);
+
+ bp = lto_input_bitpack (ib);
+ stmt_id = (unsigned int) bp_unpack_value (bp, HOST_BITS_PER_INT);
+ inline_failed = (cgraph_inline_failed_t) bp_unpack_value (bp,
+ HOST_BITS_PER_INT);
+ freq = (int) bp_unpack_value (bp, HOST_BITS_PER_INT);
+ nest = (unsigned) bp_unpack_value (bp, 30);
+
+ /* If the caller was preempted, don't create the edge.
+ ??? Should we ever have edges from a preempted caller? */
+ caller_resolution = lto_symtab_get_resolution (caller->decl);
+ if (caller_resolution == LDPR_PREEMPTED_REG
+ || caller_resolution == LDPR_PREEMPTED_IR)
+ return;
+
+ edge = cgraph_create_edge (caller, callee, NULL, count, freq, nest);
+ edge->lto_stmt_uid = stmt_id;
+ edge->inline_failed = inline_failed;
+ edge->indirect_call = bp_unpack_value (bp, 1);
+ edge->call_stmt_cannot_inline_p = bp_unpack_value (bp, 1);
+ edge->can_throw_external = bp_unpack_value (bp, 1);
+ bitpack_delete (bp);
+}
+
+
+/* Read a cgraph from IB using the info in FILE_DATA. */
+
+static void
+input_cgraph_1 (struct lto_file_decl_data *file_data,
+ struct lto_input_block *ib)
+{
+ enum LTO_cgraph_tags tag;
+ VEC(cgraph_node_ptr, heap) *nodes = NULL;
+ struct cgraph_node *node;
+ unsigned i;
+ unsigned HOST_WIDE_INT len;
+
+ tag = (enum LTO_cgraph_tags) lto_input_uleb128 (ib);
+ while (tag)
+ {
+ if (tag == LTO_cgraph_edge)
+ input_edge (ib, nodes);
+ else
+ {
+ node = input_node (file_data, ib, tag);
+ if (node == NULL || node->decl == NULL_TREE)
+ internal_error ("bytecode stream: found empty cgraph node");
+ VEC_safe_push (cgraph_node_ptr, heap, nodes, node);
+ lto_cgraph_encoder_encode (file_data->cgraph_node_encoder, node);
+ }
+
+ tag = (enum LTO_cgraph_tags) lto_input_uleb128 (ib);
+ }
+
+ /* Input toplevel asms. */
+ len = lto_input_uleb128 (ib);
+ while (len)
+ {
+ char *str = (char *)xmalloc (len + 1);
+ for (i = 0; i < len; ++i)
+ str[i] = lto_input_1_unsigned (ib);
+ cgraph_add_asm_node (build_string (len, str));
+ free (str);
+
+ len = lto_input_uleb128 (ib);
+ }
+
+ for (i = 0; VEC_iterate (cgraph_node_ptr, nodes, i, node); i++)
+ {
+ const int ref = (int) (intptr_t) node->global.inlined_to;
+
+ /* Fixup inlined_to from reference to pointer. */
+ if (ref != LCC_NOT_FOUND)
+ node->global.inlined_to = VEC_index (cgraph_node_ptr, nodes, ref);
+ else
+ node->global.inlined_to = NULL;
+ }
+
+ VEC_free (cgraph_node_ptr, heap, nodes);
+}
+
+
+/* Input and merge the cgraph from each of the .o files passed to
+ lto1. */
+
+void
+input_cgraph (void)
+{
+ struct lto_file_decl_data **file_data_vec = lto_get_file_decl_data ();
+ struct lto_file_decl_data *file_data;
+ unsigned int j = 0;
+ struct cgraph_node *node;
+
+ while ((file_data = file_data_vec[j++]))
+ {
+ const char *data;
+ size_t len;
+ struct lto_input_block *ib;
+
+ ib = lto_create_simple_input_block (file_data, LTO_section_cgraph,
+ &data, &len);
+ file_data->cgraph_node_encoder = lto_cgraph_encoder_new ();
+ input_cgraph_1 (file_data, ib);
+ lto_destroy_simple_input_block (file_data, LTO_section_cgraph,
+ ib, data, len);
+
+ /* Assume that every file read needs to be processed by LTRANS. */
+ if (flag_wpa)
+ lto_mark_file_for_ltrans (file_data);
+ }
+
+ /* Clear out the aux field that was used to store enough state to
+ tell which nodes should be overwritten. */
+ for (node = cgraph_nodes; node; node = node->next)
+ {
+ /* Some nodes may have been created by cgraph_node. This
+ happens when the callgraph contains nested functions. If the
+ node for the parent function was never emitted to the gimple
+ file, cgraph_node will create a node for it when setting the
+ context of the nested function. */
+ if (node->local.lto_file_data)
+ node->aux = NULL;
+ }
+}
diff --git a/gcc/lto-compress.c b/gcc/lto-compress.c
new file mode 100644
index 00000000000..8d745f6a047
--- /dev/null
+++ b/gcc/lto-compress.c
@@ -0,0 +1,314 @@
+/* LTO IL compression streams.
+
+ Copyright 2009 Free Software Foundation, Inc.
+ Contributed by Simon Baldwin <simonb@google.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+/* zlib.h includes other system headers. Those headers may test feature
+ test macros. config.h may define feature test macros. For this reason,
+ zlib.h needs to be included after, rather than before, config.h and
+ system.h. */
+#include <zlib.h>
+#include "coretypes.h"
+#include "tree.h"
+#include "diagnostic.h"
+#include "errors.h"
+#include "langhooks.h"
+#include "lto-streamer.h"
+#include "lto-compress.h"
+
+/* Compression stream structure, holds the flush callback and opaque token,
+ the buffered data, and a note of whether compressing or uncompressing. */
+
+struct lto_compression_stream
+{
+ void (*callback) (const char *, unsigned, void *);
+ void *opaque;
+ char *buffer;
+ size_t bytes;
+ size_t allocation;
+ bool is_compression;
+};
+
+/* Overall compression constants for zlib. */
+
+static const size_t Z_BUFFER_LENGTH = 4096;
+static const size_t MIN_STREAM_ALLOCATION = 1024;
+
+/* For zlib, allocate SIZE count of ITEMS and return the address, OPAQUE
+ is unused. */
+
+static void *
+lto_zalloc (void *opaque, unsigned items, unsigned size)
+{
+ gcc_assert (opaque == Z_NULL);
+ return xmalloc (items * size);
+}
+
+/* For zlib, free memory at ADDRESS, OPAQUE is unused. */
+
+static void
+lto_zfree (void *opaque, void *address)
+{
+ gcc_assert (opaque == Z_NULL);
+ free (address);
+}
+
+/* Return a zlib compression level that zlib will not reject. Normalizes
+ the compression level from the command line flag, clamping non-default
+ values to the appropriate end of their valid range. */
+
+static int
+lto_normalized_zlib_level (void)
+{
+ int level = flag_lto_compression_level;
+
+ if (level != Z_DEFAULT_COMPRESSION)
+ {
+ if (level < Z_NO_COMPRESSION)
+ level = Z_NO_COMPRESSION;
+ else if (level > Z_BEST_COMPRESSION)
+ level = Z_BEST_COMPRESSION;
+ }
+
+ return level;
+}
+
+/* Create a new compression stream, with CALLBACK flush function passed
+ OPAQUE token, IS_COMPRESSION indicates if compressing or uncompressing. */
+
+static struct lto_compression_stream *
+lto_new_compression_stream (void (*callback) (const char *, unsigned, void *),
+ void *opaque, bool is_compression)
+{
+ struct lto_compression_stream *stream
+ = (struct lto_compression_stream *) xmalloc (sizeof (*stream));
+
+ memset (stream, 0, sizeof (*stream));
+ stream->callback = callback;
+ stream->opaque = opaque;
+ stream->is_compression = is_compression;
+
+ return stream;
+}
+
+/* Append NUM_CHARS from address BASE to STREAM. */
+
+static void
+lto_append_to_compression_stream (struct lto_compression_stream *stream,
+ const char *base, size_t num_chars)
+{
+ size_t required = stream->bytes + num_chars;
+
+ if (stream->allocation < required)
+ {
+ if (stream->allocation == 0)
+ stream->allocation = MIN_STREAM_ALLOCATION;
+ while (stream->allocation < required)
+ stream->allocation *= 2;
+
+ stream->buffer = (char *) xrealloc (stream->buffer, stream->allocation);
+ }
+
+ memcpy (stream->buffer + stream->bytes, base, num_chars);
+ stream->bytes += num_chars;
+}
+
+/* Free the buffer and memory associated with STREAM. */
+
+static void
+lto_destroy_compression_stream (struct lto_compression_stream *stream)
+{
+ free (stream->buffer);
+ free (stream);
+}
+
+/* Return a new compression stream, with CALLBACK flush function passed
+ OPAQUE token. */
+
+struct lto_compression_stream *
+lto_start_compression (void (*callback) (const char *, unsigned, void *),
+ void *opaque)
+{
+ return lto_new_compression_stream (callback, opaque, true);
+}
+
+/* Append NUM_CHARS from address BASE to STREAM. */
+
+void
+lto_compress_block (struct lto_compression_stream *stream,
+ const char *base, size_t num_chars)
+{
+ gcc_assert (stream->is_compression);
+
+ lto_append_to_compression_stream (stream, base, num_chars);
+ lto_stats.num_output_il_bytes += num_chars;
+}
+
+/* Finalize STREAM compression, and free stream allocations. */
+
+void
+lto_end_compression (struct lto_compression_stream *stream)
+{
+ unsigned char *cursor = (unsigned char *) stream->buffer;
+ size_t remaining = stream->bytes;
+ const size_t outbuf_length = Z_BUFFER_LENGTH;
+ unsigned char *outbuf = (unsigned char *) xmalloc (outbuf_length);
+ z_stream out_stream;
+ size_t compressed_bytes = 0;
+ int status;
+
+ gcc_assert (stream->is_compression);
+
+ out_stream.next_out = outbuf;
+ out_stream.avail_out = outbuf_length;
+ out_stream.next_in = cursor;
+ out_stream.avail_in = remaining;
+ out_stream.zalloc = lto_zalloc;
+ out_stream.zfree = lto_zfree;
+ out_stream.opaque = Z_NULL;
+
+ status = deflateInit (&out_stream, lto_normalized_zlib_level ());
+ if (status != Z_OK)
+ internal_error ("compressed stream: %s", zError (status));
+
+ do
+ {
+ size_t in_bytes, out_bytes;
+
+ status = deflate (&out_stream, Z_FINISH);
+ if (status != Z_OK && status != Z_STREAM_END)
+ internal_error ("compressed stream: %s", zError (status));
+
+ in_bytes = remaining - out_stream.avail_in;
+ out_bytes = outbuf_length - out_stream.avail_out;
+
+ stream->callback ((const char *) outbuf, out_bytes, stream->opaque);
+ lto_stats.num_compressed_il_bytes += out_bytes;
+ compressed_bytes += out_bytes;
+
+ cursor += in_bytes;
+ remaining -= in_bytes;
+
+ out_stream.next_out = outbuf;
+ out_stream.avail_out = outbuf_length;
+ out_stream.next_in = cursor;
+ out_stream.avail_in = remaining;
+ }
+ while (status != Z_STREAM_END);
+
+ status = deflateEnd (&out_stream);
+ if (status != Z_OK)
+ internal_error ("compressed stream: %s", zError (status));
+
+ lto_destroy_compression_stream (stream);
+ free (outbuf);
+}
+
+/* Return a new uncompression stream, with CALLBACK flush function passed
+ OPAQUE token. */
+
+struct lto_compression_stream *
+lto_start_uncompression (void (*callback) (const char *, unsigned, void *),
+ void *opaque)
+{
+ return lto_new_compression_stream (callback, opaque, false);
+}
+
+/* Append NUM_CHARS from address BASE to STREAM. */
+
+void
+lto_uncompress_block (struct lto_compression_stream *stream,
+ const char *base, size_t num_chars)
+{
+ gcc_assert (!stream->is_compression);
+
+ lto_append_to_compression_stream (stream, base, num_chars);
+ lto_stats.num_input_il_bytes += num_chars;
+}
+
+/* Finalize STREAM uncompression, and free stream allocations.
+
+ Because of the way LTO IL streams are compressed, there may be several
+ concatenated compressed segments in the accumulated data, so for this
+ function we iterate decompressions until no data remains. */
+
+void
+lto_end_uncompression (struct lto_compression_stream *stream)
+{
+ unsigned char *cursor = (unsigned char *) stream->buffer;
+ size_t remaining = stream->bytes;
+ const size_t outbuf_length = Z_BUFFER_LENGTH;
+ unsigned char *outbuf = (unsigned char *) xmalloc (outbuf_length);
+ size_t uncompressed_bytes = 0;
+
+ gcc_assert (!stream->is_compression);
+
+ while (remaining > 0)
+ {
+ z_stream in_stream;
+ size_t out_bytes;
+ int status;
+
+ in_stream.next_out = outbuf;
+ in_stream.avail_out = outbuf_length;
+ in_stream.next_in = cursor;
+ in_stream.avail_in = remaining;
+ in_stream.zalloc = lto_zalloc;
+ in_stream.zfree = lto_zfree;
+ in_stream.opaque = Z_NULL;
+
+ status = inflateInit (&in_stream);
+ if (status != Z_OK)
+ internal_error ("compressed stream: %s", zError (status));
+
+ do
+ {
+ size_t in_bytes;
+
+ status = inflate (&in_stream, Z_SYNC_FLUSH);
+ if (status != Z_OK && status != Z_STREAM_END)
+ internal_error ("compressed stream: %s", zError (status));
+
+ in_bytes = remaining - in_stream.avail_in;
+ out_bytes = outbuf_length - in_stream.avail_out;
+
+ stream->callback ((const char *) outbuf, out_bytes, stream->opaque);
+ lto_stats.num_uncompressed_il_bytes += out_bytes;
+ uncompressed_bytes += out_bytes;
+
+ cursor += in_bytes;
+ remaining -= in_bytes;
+
+ in_stream.next_out = outbuf;
+ in_stream.avail_out = outbuf_length;
+ in_stream.next_in = cursor;
+ in_stream.avail_in = remaining;
+ }
+ while (!(status == Z_STREAM_END && out_bytes == 0));
+
+ status = inflateEnd (&in_stream);
+ if (status != Z_OK)
+ internal_error ("compressed stream: %s", zError (status));
+ }
+
+ lto_destroy_compression_stream (stream);
+ free (outbuf);
+}
diff --git a/gcc/lto-compress.h b/gcc/lto-compress.h
new file mode 100644
index 00000000000..566a73498d2
--- /dev/null
+++ b/gcc/lto-compress.h
@@ -0,0 +1,42 @@
+/* LTO IL compression streams.
+
+ Copyright 2009 Free Software Foundation, Inc.
+ Contributed by Simon Baldwin <simonb@google.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef GCC_LTO_COMPRESS_H
+#define GCC_LTO_COMPRESS_H
+
+struct lto_compression_stream;
+
+/* In lto-compress.c. */
+extern struct lto_compression_stream
+ *lto_start_compression (void (*callback) (const char *, unsigned, void *),
+ void *opaque);
+extern void lto_compress_block (struct lto_compression_stream *stream,
+ const char *base, size_t num_chars);
+extern void lto_end_compression (struct lto_compression_stream *stream);
+
+extern struct lto_compression_stream
+ *lto_start_uncompression (void (*callback) (const char *, unsigned, void *),
+ void *opaque);
+extern void lto_uncompress_block (struct lto_compression_stream *stream,
+ const char *base, size_t num_chars);
+extern void lto_end_uncompression (struct lto_compression_stream *stream);
+
+#endif /* GCC_LTO_COMPRESS_H */
diff --git a/gcc/lto-opts.c b/gcc/lto-opts.c
new file mode 100644
index 00000000000..fd485b9db60
--- /dev/null
+++ b/gcc/lto-opts.c
@@ -0,0 +1,397 @@
+/* LTO IL options.
+
+ Copyright 2009 Free Software Foundation, Inc.
+ Contributed by Simon Baldwin <simonb@google.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tree.h"
+#include "hashtab.h"
+#include "ggc.h"
+#include "vec.h"
+#include "bitmap.h"
+#include "flags.h"
+#include "opts.h"
+#include "options.h"
+#include "target.h"
+#include "toplev.h"
+#include "lto-streamer.h"
+
+/* When a file is initially compiled, the options used when generating
+ the IL are not necessarily the same as those used when linking the
+ objects into the final executable. In general, most build systems
+ will proceed with something along the lines of:
+
+ $ gcc <cc-flags> -flto -c f1.c -o f1.o
+ $ gcc <cc-flags> -flto -c f2.c -o f2.o
+ ...
+ $ gcc <cc-flags> -flto -c fN.c -o fN.o
+
+ And the final link may or may not include the same <cc-flags> used
+ to generate the initial object files:
+
+ $ gcc <ld-flags> -flto -o prog f1.o ... fN.o
+
+ Since we will be generating final code during the link step, some
+ of the flags used during the compile step need to be re-applied
+ during the link step. For instance, flags in the -m family.
+
+ The idea is to save a selected set of <cc-flags> in a special
+ section of the initial object files. This section is then read
+ during linking and the options re-applied.
+
+ FIXME lto. Currently the scheme is limited in that only the
+ options saved on the first object file (f1.o) are read back during
+ the link step. This means that the options used to compile f1.o
+ will be applied to ALL the object files in the final link step.
+ More work needs to be done to implement a merging and validation
+ mechanism, as this will not be enough for all cases. */
+
+/* Saved options hold the type of the option (currently CL_TARGET or
+ CL_COMMON), and the code, argument, and value. */
+
+typedef struct GTY(()) opt_d
+{
+ unsigned int type;
+ size_t code;
+ char *arg;
+ int value;
+} opt_t;
+
+DEF_VEC_O (opt_t);
+DEF_VEC_ALLOC_O (opt_t, heap);
+
+
+/* Options are held in two vectors, one for those registered by
+ command line handling code, and the other for those read in from
+ any LTO IL input. */
+static VEC(opt_t, heap) *user_options = NULL;
+static VEC(opt_t, heap) *file_options = NULL;
+
+/* Iterate FROM in reverse, writing option codes not yet in CODES into *TO.
+ Mark each new option code encountered in CODES. */
+
+static void
+reverse_iterate_options (VEC(opt_t, heap) *from, VEC(opt_t, heap) **to,
+ bitmap codes)
+{
+ int i;
+
+ for (i = VEC_length (opt_t, from); i > 0; i--)
+ {
+ const opt_t *const o = VEC_index (opt_t, from, i - 1);
+
+ if (bitmap_set_bit (codes, o->code))
+ VEC_safe_push (opt_t, heap, *to, o);
+ }
+}
+
+/* Concatenate options vectors FIRST and SECOND, rationalize so that only the
+ final of any given option remains, and return the result. */
+
+static VEC(opt_t, heap) *
+concatenate_options (VEC(opt_t, heap) *first, VEC(opt_t, heap) *second)
+{
+ VEC(opt_t, heap) *results = NULL;
+ bitmap codes = lto_bitmap_alloc ();
+
+ reverse_iterate_options (second, &results, codes);
+ reverse_iterate_options (first, &results, codes);
+
+ lto_bitmap_free (codes);
+ return results;
+}
+
+/* Clear the options vector in *OPTS_P and set it to NULL. */
+
+static void
+clear_options (VEC(opt_t, heap) **opts_p)
+{
+ int i;
+ opt_t *o;
+
+ for (i = 0; VEC_iterate (opt_t, *opts_p, i, o); i++)
+ free (o->arg);
+
+ VEC_free (opt_t, heap, *opts_p);
+}
+
+/* Write LENGTH bytes from ADDR to STREAM. */
+
+static void
+output_data_stream (struct lto_output_stream *stream,
+ const void *addr, size_t length)
+{
+ lto_output_data_stream (stream, addr, length);
+}
+
+/* Write string STRING to STREAM. */
+
+static void
+output_string_stream (struct lto_output_stream *stream, const char *string)
+{
+ bool flag = false;
+
+ if (string != NULL)
+ {
+ const size_t length = strlen (string);
+
+ flag = true;
+ output_data_stream (stream, &flag, sizeof (flag));
+ output_data_stream (stream, &length, sizeof (length));
+ output_data_stream (stream, string, length);
+ }
+ else
+ output_data_stream (stream, &flag, sizeof (flag));
+}
+
+/* Read LENGTH bytes from STREAM to ADDR. */
+
+static void
+input_data_block (struct lto_input_block *ib, void *addr, size_t length)
+{
+ size_t i;
+ unsigned char *const buffer = (unsigned char *const) addr;
+
+ for (i = 0; i < length; i++)
+ buffer[i] = lto_input_1_unsigned (ib);
+}
+
+/* Return a string from IB. The string is allocated, and the caller is
+ responsible for freeing it. */
+
+static char *
+input_string_block (struct lto_input_block *ib)
+{
+ bool flag;
+
+ input_data_block (ib, &flag, sizeof (flag));
+ if (flag)
+ {
+ size_t length;
+ char *string;
+
+ input_data_block (ib, &length, sizeof (length));
+ string = (char *) xcalloc (1, length + 1);
+ input_data_block (ib, string, length);
+
+ return string;
+ }
+ else
+ return NULL;
+}
+
+/* Return true if this option is one we need to save in LTO output files.
+ At present, we pass along all target options, and common options that
+ involve position independent code.
+
+ TODO This list of options requires expansion and rationalization.
+ Among others, optimization options may well be appropriate here. */
+
+static bool
+register_user_option_p (size_t code, int type)
+{
+ if (type == CL_TARGET)
+ return true;
+ else if (type == CL_COMMON)
+ {
+ return (code == OPT_fPIC
+ || code == OPT_fpic
+ || code == OPT_fPIE
+ || code == OPT_fpie
+ || code == OPT_fcommon
+ || code == OPT_fexceptions);
+ }
+
+ return false;
+}
+
+/* Note command line option with the given TYPE and CODE, ARG, and VALUE.
+ If relevant to LTO, save it in the user options vector. */
+
+void
+lto_register_user_option (size_t code, const char *arg, int value, int type)
+{
+ if (register_user_option_p (code, type))
+ {
+ opt_t o;
+
+ o.type = type;
+ o.code = code;
+ if (arg != NULL)
+ {
+ o.arg = (char *) xmalloc (strlen (arg) + 1);
+ strcpy (o.arg, arg);
+ }
+ else
+ o.arg = NULL;
+ o.value = value;
+ VEC_safe_push (opt_t, heap, user_options, &o);
+ }
+}
+
+/* Empty the saved user options vector. */
+
+void
+lto_clear_user_options (void)
+{
+ clear_options (&user_options);
+}
+
+/* Empty the saved file options vector. */
+
+void
+lto_clear_file_options (void)
+{
+ clear_options (&file_options);
+}
+
+/* Concatenate the user options and any file options read from an LTO IL
+ file, and serialize them to STREAM. File options precede user options
+ so that the latter override the former when reissued. */
+
+static void
+output_options (struct lto_output_stream *stream)
+{
+ VEC(opt_t, heap) *opts = concatenate_options (file_options, user_options);
+ const size_t length = VEC_length (opt_t, opts);
+ int i;
+ opt_t *o;
+
+ output_data_stream (stream, &length, sizeof (length));
+
+ for (i = 0; VEC_iterate (opt_t, opts, i, o); i++)
+ {
+ output_data_stream (stream, &o->type, sizeof (o->type));
+ output_data_stream (stream, &o->code, sizeof (o->code));
+ output_string_stream (stream, o->arg);
+ output_data_stream (stream, &o->value, sizeof (o->value));
+ }
+
+ VEC_free (opt_t, heap, opts);
+}
+
+/* Write currently held options to an LTO IL section. */
+
+void
+lto_write_options (void)
+{
+ char *const section_name = lto_get_section_name (LTO_section_opts, NULL);
+ struct lto_output_stream stream;
+ struct lto_simple_header header;
+ struct lto_output_stream *header_stream;
+
+ lto_begin_section (section_name, !flag_wpa);
+ free (section_name);
+
+ memset (&stream, 0, sizeof (stream));
+ output_options (&stream);
+
+ memset (&header, 0, sizeof (header));
+ header.lto_header.major_version = LTO_major_version;
+ header.lto_header.minor_version = LTO_minor_version;
+ header.lto_header.section_type = LTO_section_opts;
+
+ header.compressed_size = 0;
+ header.main_size = stream.total_size;
+
+ header_stream = ((struct lto_output_stream *)
+ xcalloc (1, sizeof (*header_stream)));
+ lto_output_data_stream (header_stream, &header, sizeof (header));
+ lto_write_stream (header_stream);
+ free (header_stream);
+
+ lto_write_stream (&stream);
+ lto_end_section ();
+}
+
+/* Unserialize an options vector from IB, and append to file_options. */
+
+static void
+input_options (struct lto_input_block *ib)
+{
+ size_t length, i;
+
+ input_data_block (ib, &length, sizeof (length));
+
+ for (i = 0; i < length; i++)
+ {
+ opt_t o;
+
+ input_data_block (ib, &o.type, sizeof (o.type));
+ input_data_block (ib, &o.code, sizeof (o.code));
+ o.arg = input_string_block (ib);
+ input_data_block (ib, &o.value, sizeof (o.value));
+ VEC_safe_push (opt_t, heap, file_options, &o);
+ }
+}
+
+/* Read options from an LTO IL section. */
+
+void
+lto_read_file_options (struct lto_file_decl_data *file_data)
+{
+ size_t len;
+ const char *data;
+ const struct lto_simple_header *header;
+ int32_t opts_offset;
+ struct lto_input_block ib;
+
+ data = lto_get_section_data (file_data, LTO_section_opts, NULL, &len);
+ header = (const struct lto_simple_header *) data;
+ opts_offset = sizeof (*header);
+
+ lto_check_version (header->lto_header.major_version,
+ header->lto_header.minor_version);
+
+ LTO_INIT_INPUT_BLOCK (ib, data + opts_offset, 0, header->main_size);
+ input_options (&ib);
+
+ lto_free_section_data (file_data, LTO_section_opts, 0, data, len);
+}
+
+/* Concatenate the user options and any file options read from an LTO IL
+ file, and reissue them as if all had just been read in from the command
+ line. As with serialization, file options precede user options. */
+
+void
+lto_reissue_options (void)
+{
+ VEC(opt_t, heap) *opts = concatenate_options (file_options, user_options);
+ int i;
+ opt_t *o;
+
+ for (i = 0; VEC_iterate (opt_t, opts, i, o); i++)
+ {
+ const struct cl_option *option = &cl_options[o->code];
+
+ if (option->flag_var)
+ set_option (option, o->value, o->arg);
+
+ if (o->type == CL_TARGET)
+ targetm.handle_option (o->code, o->arg, o->value);
+ else if (o->type == CL_COMMON)
+ gcc_assert (option->flag_var);
+ else
+ gcc_unreachable ();
+ }
+
+ VEC_free (opt_t, heap, opts);
+}
diff --git a/gcc/lto-section-in.c b/gcc/lto-section-in.c
new file mode 100644
index 00000000000..da2384e0839
--- /dev/null
+++ b/gcc/lto-section-in.c
@@ -0,0 +1,489 @@
+/* Input functions for reading LTO sections.
+
+ Copyright 2009 Free Software Foundation, Inc.
+ Contributed by Kenneth Zadeck <zadeck@naturalbridge.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "toplev.h"
+#include "tree.h"
+#include "expr.h"
+#include "flags.h"
+#include "params.h"
+#include "input.h"
+#include "varray.h"
+#include "hashtab.h"
+#include "basic-block.h"
+#include "tree-flow.h"
+#include "cgraph.h"
+#include "function.h"
+#include "ggc.h"
+#include "diagnostic.h"
+#include "except.h"
+#include "vec.h"
+#include "timevar.h"
+#include "output.h"
+#include "lto-streamer.h"
+#include "lto-compress.h"
+
+/* Section names. These must correspond to the values of
+ enum lto_section_type. */
+const char *lto_section_name[LTO_N_SECTION_TYPES] =
+{
+ "decls",
+ "function_body",
+ "static_initializer",
+ "cgraph",
+ "ipa_pure_const",
+ "ipa_reference",
+ "symtab",
+ "wpa_fixup",
+ "opts"
+};
+
+unsigned char
+lto_input_1_unsigned (struct lto_input_block *ib)
+{
+ if (ib->p >= ib->len)
+ internal_error ("bytecode stream: trying to read %d bytes "
+ "after the end of the input buffer", ib->p - ib->len);
+
+ return (ib->data[ib->p++]);
+}
+
+
+/* Read an ULEB128 Number of IB. */
+
+unsigned HOST_WIDE_INT
+lto_input_uleb128 (struct lto_input_block *ib)
+{
+ unsigned HOST_WIDE_INT result = 0;
+ int shift = 0;
+ unsigned HOST_WIDE_INT byte;
+
+ while (true)
+ {
+ byte = lto_input_1_unsigned (ib);
+ result |= (byte & 0x7f) << shift;
+ shift += 7;
+ if ((byte & 0x80) == 0)
+ return result;
+ }
+}
+
+/* HOST_WIDEST_INT version of lto_input_uleb128. IB is as in
+ lto_input_uleb128. */
+
+unsigned HOST_WIDEST_INT
+lto_input_widest_uint_uleb128 (struct lto_input_block *ib)
+{
+ unsigned HOST_WIDEST_INT result = 0;
+ int shift = 0;
+ unsigned HOST_WIDEST_INT byte;
+
+ while (true)
+ {
+ byte = lto_input_1_unsigned (ib);
+ result |= (byte & 0x7f) << shift;
+ shift += 7;
+ if ((byte & 0x80) == 0)
+ return result;
+ }
+}
+
+/* Read an SLEB128 Number of IB. */
+
+HOST_WIDE_INT
+lto_input_sleb128 (struct lto_input_block *ib)
+{
+ HOST_WIDE_INT result = 0;
+ int shift = 0;
+ unsigned HOST_WIDE_INT byte;
+
+ while (true)
+ {
+ byte = lto_input_1_unsigned (ib);
+ result |= (byte & 0x7f) << shift;
+ shift += 7;
+ if ((byte & 0x80) == 0)
+ {
+ if ((shift < HOST_BITS_PER_WIDE_INT) && (byte & 0x40))
+ result |= - ((HOST_WIDE_INT)1 << shift);
+
+ return result;
+ }
+ }
+}
+
+
+/* Hooks so that the ipa passes can call into the lto front end to get
+ sections. */
+
+static struct lto_file_decl_data ** file_decl_data;
+static lto_get_section_data_f* get_section_f;
+static lto_free_section_data_f* free_section_f;
+
+
+/* This is called from the lto front end to set up the hooks that are
+ used by the ipa passes to get the data that they will
+ deserialize. */
+
+void
+lto_set_in_hooks (struct lto_file_decl_data ** data,
+ lto_get_section_data_f* get_f,
+ lto_free_section_data_f* free_f)
+{
+ file_decl_data = data;
+ get_section_f = get_f;
+ free_section_f = free_f;
+}
+
+
+/* Return an array of file decl datas for all of the files passed to
+ this compilation. */
+
+struct lto_file_decl_data **
+lto_get_file_decl_data (void)
+{
+ gcc_assert (file_decl_data);
+ return file_decl_data;
+}
+
+/* Buffer structure for accumulating data from compression callbacks. */
+
+struct lto_buffer
+{
+ char *data;
+ size_t length;
+};
+
+/* Compression callback, append LENGTH bytes from DATA to the buffer pointed
+ to by OPAQUE. */
+
+static void
+lto_append_data (const char *data, unsigned length, void *opaque)
+{
+ struct lto_buffer *buffer = (struct lto_buffer *) opaque;
+
+ buffer->data = (char *) xrealloc (buffer->data, buffer->length + length);
+ memcpy (buffer->data + buffer->length, data, length);
+ buffer->length += length;
+}
+
+/* Header placed in returned uncompressed data streams. Allows the
+ uncompressed allocated data to be mapped back to the underlying
+ compressed data for use with free_section_f. */
+
+struct lto_data_header
+{
+ const char *data;
+ size_t len;
+};
+
+/* Return a char pointer to the start of a data stream for an LTO pass
+ or function. FILE_DATA indicates where to obtain the data.
+ SECTION_TYPE is the type of information to be obtained. NAME is
+ the name of the function and is only used when finding a function
+ body; otherwise it is NULL. LEN is the size of the data
+ returned. */
+
+const char *
+lto_get_section_data (struct lto_file_decl_data *file_data,
+ enum lto_section_type section_type,
+ const char *name,
+ size_t *len)
+{
+ const char *data = (get_section_f) (file_data, section_type, name, len);
+ const size_t header_length = sizeof (struct lto_data_header);
+ struct lto_data_header *header;
+ struct lto_buffer buffer;
+ struct lto_compression_stream *stream;
+ lto_stats.section_size[section_type] += *len;
+
+ if (data == NULL)
+ return NULL;
+
+ /* FIXME lto: WPA mode does not write compressed sections, so for now
+ suppress uncompression if flag_ltrans. */
+ if (flag_ltrans)
+ return data;
+
+ /* Create a mapping header containing the underlying data and length,
+ and prepend this to the uncompression buffer. The uncompressed data
+ then follows, and a pointer to the start of the uncompressed data is
+ returned. */
+ header = (struct lto_data_header *) xmalloc (header_length);
+ header->data = data;
+ header->len = *len;
+
+ buffer.data = (char *) header;
+ buffer.length = header_length;
+
+ stream = lto_start_uncompression (lto_append_data, &buffer);
+ lto_uncompress_block (stream, data, *len);
+ lto_end_uncompression (stream);
+
+ *len = buffer.length - header_length;
+ return buffer.data + header_length;
+}
+
+
+/* Free the data found from the above call. The first three
+ parameters are the same as above. DATA is the data to be freed and
+ LEN is the length of that data. */
+
+void
+lto_free_section_data (struct lto_file_decl_data *file_data,
+ enum lto_section_type section_type,
+ const char *name,
+ const char *data,
+ size_t len)
+{
+ const size_t header_length = sizeof (struct lto_data_header);
+ const char *real_data = data - header_length;
+ const struct lto_data_header *header
+ = (const struct lto_data_header *) real_data;
+
+ gcc_assert (free_section_f);
+
+ /* FIXME lto: WPA mode does not write compressed sections, so for now
+ suppress uncompression mapping if flag_ltrans. */
+ if (flag_ltrans)
+ {
+ (free_section_f) (file_data, section_type, name, data, len);
+ return;
+ }
+
+ /* The underlying data address has been extracted from the mapping header.
+ Free that, then free the allocated uncompression buffer. */
+ (free_section_f) (file_data, section_type, name, header->data, header->len);
+ free (CONST_CAST (char *, real_data));
+}
+
+
+/* Load a section of type SECTION_TYPE from FILE_DATA, parse the
+ header and then return an input block pointing to the section. The
+ raw pointer to the section is returned in DATAR and LEN. These are
+ used to free the section. Return NULL if the section is not present. */
+
+struct lto_input_block *
+lto_create_simple_input_block (struct lto_file_decl_data *file_data,
+ enum lto_section_type section_type,
+ const char **datar, size_t *len)
+{
+ const char *data = lto_get_section_data (file_data, section_type, NULL, len);
+ const struct lto_simple_header * header
+ = (const struct lto_simple_header *) data;
+
+ struct lto_input_block* ib_main;
+ int32_t main_offset = sizeof (struct lto_simple_header);
+
+ if (!data)
+ return NULL;
+
+ ib_main = XNEW (struct lto_input_block);
+
+ *datar = data;
+ LTO_INIT_INPUT_BLOCK_PTR (ib_main, data + main_offset,
+ 0, header->main_size);
+
+ return ib_main;
+}
+
+
+/* Close the section returned from a call to
+ LTO_CREATE_SIMPLE_INPUT_BLOCK. IB is the input block returned from
+ that call. The FILE_DATA and SECTION_TYPE are the same as what was
+ passed to that call and the DATA and LEN are what was returned from
+ that call. */
+
+void
+lto_destroy_simple_input_block (struct lto_file_decl_data *file_data,
+ enum lto_section_type section_type,
+ struct lto_input_block *ib,
+ const char *data, size_t len)
+{
+ free (ib);
+ lto_free_section_data (file_data, section_type, NULL, data, len);
+}
+
+/*****************************************************************************/
+/* Record renamings of static declarations */
+/*****************************************************************************/
+
+struct lto_renaming_slot
+{
+ const char *old_name;
+ const char *new_name;
+};
+
+/* Returns a hash code for P. */
+
+static hashval_t
+hash_name (const void *p)
+{
+ const struct lto_renaming_slot *ds = (const struct lto_renaming_slot *) p;
+ return (hashval_t) htab_hash_string (ds->new_name);
+}
+
+/* Returns nonzero if P1 and P2 are equal. */
+
+static int
+eq_name (const void *p1, const void *p2)
+{
+ const struct lto_renaming_slot *s1 =
+ (const struct lto_renaming_slot *) p1;
+ const struct lto_renaming_slot *s2 =
+ (const struct lto_renaming_slot *) p2;
+
+ return strcmp (s1->new_name, s2->new_name) == 0;
+}
+
+/* Free a renaming table entry. */
+
+static void
+renaming_slot_free (void *slot)
+{
+ struct lto_renaming_slot *s = (struct lto_renaming_slot *) slot;
+
+ free (CONST_CAST (void *, (const void *) s->old_name));
+ free (CONST_CAST (void *, (const void *) s->new_name));
+ free ((void *) s);
+}
+
+/* Create an empty hash table for recording declaration renamings. */
+
+htab_t
+lto_create_renaming_table (void)
+{
+ return htab_create (37, hash_name, eq_name, renaming_slot_free);
+}
+
+/* Record a declaration name mapping OLD_NAME -> NEW_NAME. DECL_DATA
+ holds the renaming hash table to use. */
+
+void
+lto_record_renamed_decl (struct lto_file_decl_data *decl_data,
+ const char *old_name, const char *new_name)
+{
+ void **slot;
+ struct lto_renaming_slot r_slot;
+
+ r_slot.new_name = new_name;
+ slot = htab_find_slot (decl_data->renaming_hash_table, &r_slot, INSERT);
+ if (*slot == NULL)
+ {
+ struct lto_renaming_slot *new_slot = XNEW (struct lto_renaming_slot);
+ new_slot->old_name = xstrdup (old_name);
+ new_slot->new_name = xstrdup (new_name);
+ *slot = new_slot;
+ }
+ else
+ gcc_unreachable ();
+}
+
+
+/* Given a string NAME, return the string that it has been mapped to
+ by lto_record_renamed_decl. If NAME was not renamed, it is
+ returned unchanged. DECL_DATA holds the renaming hash table to use. */
+
+const char *
+lto_get_decl_name_mapping (struct lto_file_decl_data *decl_data,
+ const char *name)
+{
+ htab_t renaming_hash_table = decl_data->renaming_hash_table;
+ struct lto_renaming_slot *slot;
+ struct lto_renaming_slot r_slot;
+
+ r_slot.new_name = name;
+ slot = (struct lto_renaming_slot *) htab_find (renaming_hash_table, &r_slot);
+ if (slot)
+ return slot->old_name;
+ else
+ return name;
+}
+
+/*****************************************************************************/
+/* Input decl state object. */
+/*****************************************************************************/
+
+/* Return a newly created in-decl state object. */
+
+struct lto_in_decl_state *
+lto_new_in_decl_state (void)
+{
+ struct lto_in_decl_state *state;
+
+ state = ((struct lto_in_decl_state *) xmalloc (sizeof (*state)));
+ memset (state, 0, sizeof (*state));
+ return state;
+}
+
+/* Delete STATE and its components. */
+
+void
+lto_delete_in_decl_state (struct lto_in_decl_state *state)
+{
+ int i;
+
+ for (i = 0; i < LTO_N_DECL_STREAMS; i++)
+ if (state->streams[i].trees)
+ free (state->streams[i].trees);
+ free (state);
+}
+
+/* Hashtable helpers. lto_in_decl_states are hash by their function decls. */
+
+hashval_t
+lto_hash_in_decl_state (const void *p)
+{
+ const struct lto_in_decl_state *state = (const struct lto_in_decl_state *) p;
+ return htab_hash_pointer (state->fn_decl);
+}
+
+/* Return true if the fn_decl field of the lto_in_decl_state pointed to by
+ P1 equals to the function decl P2. */
+
+int
+lto_eq_in_decl_state (const void *p1, const void *p2)
+{
+ const struct lto_in_decl_state *state1 =
+ (const struct lto_in_decl_state *) p1;
+ const struct lto_in_decl_state *state2 =
+ (const struct lto_in_decl_state *) p2;
+ return state1->fn_decl == state2->fn_decl;
+}
+
+
+/* Search the in-decl state of a function FUNC contained in the file
+ associated with FILE_DATA. Return NULL if not found. */
+
+struct lto_in_decl_state*
+lto_get_function_in_decl_state (struct lto_file_decl_data *file_data,
+ tree func)
+{
+ struct lto_in_decl_state temp;
+ void **slot;
+
+ temp.fn_decl = func;
+ slot = htab_find_slot (file_data->function_decl_states, &temp, NO_INSERT);
+ return slot? ((struct lto_in_decl_state*) *slot) : NULL;
+}
diff --git a/gcc/lto-section-out.c b/gcc/lto-section-out.c
new file mode 100644
index 00000000000..e347027c709
--- /dev/null
+++ b/gcc/lto-section-out.c
@@ -0,0 +1,652 @@
+/* Functions for writing LTO sections.
+
+ Copyright (C) 2009 Free Software Foundation, Inc.
+ Contributed by Kenneth Zadeck <zadeck@naturalbridge.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "toplev.h"
+#include "tree.h"
+#include "expr.h"
+#include "params.h"
+#include "input.h"
+#include "varray.h"
+#include "hashtab.h"
+#include "basic-block.h"
+#include "tree-flow.h"
+#include "tree-pass.h"
+#include "cgraph.h"
+#include "function.h"
+#include "ggc.h"
+#include "except.h"
+#include "vec.h"
+#include "pointer-set.h"
+#include "bitmap.h"
+#include "langhooks.h"
+#include "lto-streamer.h"
+#include "lto-compress.h"
+
+static VEC(lto_out_decl_state_ptr, heap) *decl_state_stack;
+
+/* List of out decl states used by functions. We use this to
+ generate the decl directory later. */
+
+VEC(lto_out_decl_state_ptr, heap) *lto_function_decl_states;
+
+/* Bitmap indexed by DECL_UID to indicate if a function needs to be
+ forced extern inline. */
+static bitmap forced_extern_inline;
+
+/* Initialize states for determining which function decls to be ouput
+ as extern inline, regardless of the decls' own attributes. */
+
+void
+lto_new_extern_inline_states (void)
+{
+ forced_extern_inline = lto_bitmap_alloc ();
+}
+
+/* Releasing resources use for states to determine which function decls
+ to be ouput as extern inline */
+
+void
+lto_delete_extern_inline_states (void)
+{
+ lto_bitmap_free (forced_extern_inline);
+ forced_extern_inline = NULL;
+}
+
+/* Force all the functions in DECLS to be output as extern inline.
+ DECLS is a bitmap indexed by DECL_UID. */
+
+void
+lto_force_functions_extern_inline (bitmap decls)
+{
+ bitmap_ior_into (forced_extern_inline, decls);
+}
+
+/* Return true if FN_DECL is a function which should be emitted as
+ extern inline. */
+
+bool
+lto_forced_extern_inline_p (tree fn_decl)
+{
+ return bitmap_bit_p (forced_extern_inline, DECL_UID (fn_decl));
+}
+
+/* Returns a hash code for P. */
+
+hashval_t
+lto_hash_decl_slot_node (const void *p)
+{
+ const struct lto_decl_slot *ds = (const struct lto_decl_slot *) p;
+
+ /*
+ return (hashval_t) DECL_UID (ds->t);
+ */
+ return (hashval_t) TREE_HASH (ds->t);
+}
+
+
+/* Returns nonzero if P1 and P2 are equal. */
+
+int
+lto_eq_decl_slot_node (const void *p1, const void *p2)
+{
+ const struct lto_decl_slot *ds1 =
+ (const struct lto_decl_slot *) p1;
+ const struct lto_decl_slot *ds2 =
+ (const struct lto_decl_slot *) p2;
+
+ /*
+ return DECL_UID (ds1->t) == DECL_UID (ds2->t);
+ */
+ return ds1->t == ds2->t;
+}
+
+
+/* Returns a hash code for P. */
+
+hashval_t
+lto_hash_type_slot_node (const void *p)
+{
+ const struct lto_decl_slot *ds = (const struct lto_decl_slot *) p;
+ return (hashval_t) TYPE_UID (ds->t);
+}
+
+
+/* Returns nonzero if P1 and P2 are equal. */
+
+int
+lto_eq_type_slot_node (const void *p1, const void *p2)
+{
+ const struct lto_decl_slot *ds1 =
+ (const struct lto_decl_slot *) p1;
+ const struct lto_decl_slot *ds2 =
+ (const struct lto_decl_slot *) p2;
+
+ return TYPE_UID (ds1->t) == TYPE_UID (ds2->t);
+}
+
+/*****************************************************************************
+ Output routines shared by all of the serialization passes.
+*****************************************************************************/
+
+
+/* Flush compressed stream data function, sends NUM_CHARS from CHARS
+ to the append lang hook, OPAQUE is currently always NULL. */
+
+static void
+lto_append_data (const char *chars, unsigned int num_chars, void *opaque)
+{
+ gcc_assert (opaque == NULL);
+ lang_hooks.lto.append_data (chars, num_chars, opaque);
+}
+
+/* Pointer to the current compression stream. */
+
+static struct lto_compression_stream *compression_stream = NULL;
+
+/* Begin a new output section named NAME. If COMPRESS is true, zlib compress
+ the section. */
+
+void
+lto_begin_section (const char *name, bool compress)
+{
+ lang_hooks.lto.begin_section (name);
+
+ /* FIXME lto: for now, suppress compression if the lang_hook that appends
+ data is anything other than assembler output. The effect here is that
+ we get compression of IL only in non-ltrans object files. */
+ gcc_assert (compression_stream == NULL);
+ if (compress)
+ compression_stream = lto_start_compression (lto_append_data, NULL);
+}
+
+
+/* End the current output section. */
+
+void
+lto_end_section (void)
+{
+ if (compression_stream)
+ {
+ lto_end_compression (compression_stream);
+ compression_stream = NULL;
+ }
+ lang_hooks.lto.end_section ();
+}
+
+
+/* Write all of the chars in OBS to the assembler. Recycle the blocks
+ in obs as this is being done. */
+
+void
+lto_write_stream (struct lto_output_stream *obs)
+{
+ unsigned int block_size = 1024;
+ struct lto_char_ptr_base *block;
+ struct lto_char_ptr_base *next_block;
+ if (!obs->first_block)
+ return;
+
+ for (block = obs->first_block; block; block = next_block)
+ {
+ const char *base = ((char *)block) + sizeof (struct lto_char_ptr_base);
+ unsigned int num_chars = block_size - sizeof (struct lto_char_ptr_base);
+
+ /* If this is not the last block, it is full. If it is the last
+ block, left_in_block indicates how many chars are unoccupied in
+ this block; subtract from num_chars to obtain occupancy. */
+ next_block = (struct lto_char_ptr_base *) block->ptr;
+ if (!next_block)
+ num_chars -= obs->left_in_block;
+
+ /* FIXME lto: WPA mode uses an ELF function as a lang_hook to append
+ output data. This hook is not happy with the way that compression
+ blocks up output differently to the way it's blocked here. So for
+ now, we don't compress WPA output. */
+ if (compression_stream)
+ {
+ lto_compress_block (compression_stream, base, num_chars);
+ lang_hooks.lto.append_data (NULL, 0, block);
+ }
+ else
+ lang_hooks.lto.append_data (base, num_chars, block);
+ block_size *= 2;
+ }
+}
+
+
+/* Adds a new block to output stream OBS. */
+
+static void
+append_block (struct lto_output_stream *obs)
+{
+ struct lto_char_ptr_base *new_block;
+
+ gcc_assert (obs->left_in_block == 0);
+
+ if (obs->first_block == NULL)
+ {
+ /* This is the first time the stream has been written
+ into. */
+ obs->block_size = 1024;
+ new_block = (struct lto_char_ptr_base*) xmalloc (obs->block_size);
+ obs->first_block = new_block;
+ }
+ else
+ {
+ struct lto_char_ptr_base *tptr;
+ /* Get a new block that is twice as big as the last block
+ and link it into the list. */
+ obs->block_size *= 2;
+ new_block = (struct lto_char_ptr_base*) xmalloc (obs->block_size);
+ /* The first bytes of the block are reserved as a pointer to
+ the next block. Set the chain of the full block to the
+ pointer to the new block. */
+ tptr = obs->current_block;
+ tptr->ptr = (char *) new_block;
+ }
+
+ /* Set the place for the next char at the first position after the
+ chain to the next block. */
+ obs->current_pointer
+ = ((char *) new_block) + sizeof (struct lto_char_ptr_base);
+ obs->current_block = new_block;
+ /* Null out the newly allocated block's pointer to the next block. */
+ new_block->ptr = NULL;
+ obs->left_in_block = obs->block_size - sizeof (struct lto_char_ptr_base);
+}
+
+
+/* Write a character to the output block. */
+
+void
+lto_output_1_stream (struct lto_output_stream *obs, char c)
+{
+ /* No space left. */
+ if (obs->left_in_block == 0)
+ append_block (obs);
+
+ /* Write the actual character. */
+ *obs->current_pointer = c;
+ obs->current_pointer++;
+ obs->total_size++;
+ obs->left_in_block--;
+}
+
+
+/* Write raw DATA of length LEN to the output block OB. */
+
+void
+lto_output_data_stream (struct lto_output_stream *obs, const void *data,
+ size_t len)
+{
+ while (len)
+ {
+ size_t copy;
+
+ /* No space left. */
+ if (obs->left_in_block == 0)
+ append_block (obs);
+
+ /* Determine how many bytes to copy in this loop. */
+ if (len <= obs->left_in_block)
+ copy = len;
+ else
+ copy = obs->left_in_block;
+
+ /* Copy the data and do bookkeeping. */
+ memcpy (obs->current_pointer, data, copy);
+ obs->current_pointer += copy;
+ obs->total_size += copy;
+ obs->left_in_block -= copy;
+ data = (const char *) data + copy;
+ len -= copy;
+ }
+}
+
+
+/* Output an unsigned LEB128 quantity to OBS. */
+
+void
+lto_output_uleb128_stream (struct lto_output_stream *obs,
+ unsigned HOST_WIDE_INT work)
+{
+ do
+ {
+ unsigned int byte = (work & 0x7f);
+ work >>= 7;
+ if (work != 0)
+ /* More bytes to follow. */
+ byte |= 0x80;
+
+ lto_output_1_stream (obs, byte);
+ }
+ while (work != 0);
+}
+
+/* Identical to output_uleb128_stream above except using unsigned
+ HOST_WIDEST_INT type. For efficiency on host where unsigned HOST_WIDEST_INT
+ is not native, we only use this if we know that HOST_WIDE_INT is not wide
+ enough. */
+
+void
+lto_output_widest_uint_uleb128_stream (struct lto_output_stream *obs,
+ unsigned HOST_WIDEST_INT work)
+{
+ do
+ {
+ unsigned int byte = (work & 0x7f);
+ work >>= 7;
+ if (work != 0)
+ /* More bytes to follow. */
+ byte |= 0x80;
+
+ lto_output_1_stream (obs, byte);
+ }
+ while (work != 0);
+}
+
+
+/* Output a signed LEB128 quantity. */
+
+void
+lto_output_sleb128_stream (struct lto_output_stream *obs, HOST_WIDE_INT work)
+{
+ int more, byte;
+
+ do
+ {
+ byte = (work & 0x7f);
+ /* arithmetic shift */
+ work >>= 7;
+ more = !((work == 0 && (byte & 0x40) == 0)
+ || (work == -1 && (byte & 0x40) != 0));
+ if (more)
+ byte |= 0x80;
+
+ lto_output_1_stream (obs, byte);
+ }
+ while (more);
+}
+
+
+/* Lookup NAME in ENCODER. If NAME is not found, create a new entry in
+ ENCODER for NAME with the next available index of ENCODER, then
+ print the index to OBS. True is returned if NAME was added to
+ ENCODER. The resulting index is stored in THIS_INDEX.
+
+ If OBS is NULL, the only action is to add NAME to the encoder. */
+
+bool
+lto_output_decl_index (struct lto_output_stream *obs,
+ struct lto_tree_ref_encoder *encoder,
+ tree name, unsigned int *this_index)
+{
+ void **slot;
+ struct lto_decl_slot d_slot;
+ int index;
+ bool new_entry_p = FALSE;
+
+ d_slot.t = name;
+ slot = htab_find_slot (encoder->tree_hash_table, &d_slot, INSERT);
+ if (*slot == NULL)
+ {
+ struct lto_decl_slot *new_slot
+ = (struct lto_decl_slot *) xmalloc (sizeof (struct lto_decl_slot));
+ index = encoder->next_index++;
+
+ new_slot->t = name;
+ new_slot->slot_num = index;
+ *slot = new_slot;
+ VEC_safe_push (tree, heap, encoder->trees, name);
+ new_entry_p = TRUE;
+ }
+ else
+ {
+ struct lto_decl_slot *old_slot = (struct lto_decl_slot *)*slot;
+ index = old_slot->slot_num;
+ }
+
+ if (obs)
+ lto_output_uleb128_stream (obs, index);
+ *this_index = index;
+ return new_entry_p;
+}
+
+/* Output a field DECL to OBS. */
+
+void
+lto_output_field_decl_index (struct lto_out_decl_state *decl_state,
+ struct lto_output_stream * obs, tree decl)
+{
+ unsigned int index;
+ lto_output_decl_index (obs, &decl_state->streams[LTO_DECL_STREAM_FIELD_DECL],
+ decl, &index);
+}
+
+/* Output a function DECL to OBS. */
+
+void
+lto_output_fn_decl_index (struct lto_out_decl_state *decl_state,
+ struct lto_output_stream * obs, tree decl)
+{
+ unsigned int index;
+ lto_output_decl_index (obs, &decl_state->streams[LTO_DECL_STREAM_FN_DECL],
+ decl, &index);
+}
+
+/* Output a namespace DECL to OBS. */
+
+void
+lto_output_namespace_decl_index (struct lto_out_decl_state *decl_state,
+ struct lto_output_stream * obs, tree decl)
+{
+ unsigned int index;
+ lto_output_decl_index (obs,
+ &decl_state->streams[LTO_DECL_STREAM_NAMESPACE_DECL],
+ decl, &index);
+}
+
+/* Output a static or extern var DECL to OBS. */
+
+void
+lto_output_var_decl_index (struct lto_out_decl_state *decl_state,
+ struct lto_output_stream * obs, tree decl)
+{
+ unsigned int index;
+ lto_output_decl_index (obs, &decl_state->streams[LTO_DECL_STREAM_VAR_DECL],
+ decl, &index);
+}
+
+/* Output a type DECL to OBS. */
+
+void
+lto_output_type_decl_index (struct lto_out_decl_state *decl_state,
+ struct lto_output_stream * obs, tree decl)
+{
+ unsigned int index;
+ lto_output_decl_index (obs, &decl_state->streams[LTO_DECL_STREAM_TYPE_DECL],
+ decl, &index);
+}
+
+/* Output a type REF to OBS. */
+
+void
+lto_output_type_ref_index (struct lto_out_decl_state *decl_state,
+ struct lto_output_stream *obs, tree ref)
+{
+ unsigned int index;
+ lto_output_decl_index (obs, &decl_state->streams[LTO_DECL_STREAM_TYPE],
+ ref, &index);
+}
+
+
+/* Create the output block and return it. */
+
+struct lto_simple_output_block *
+lto_create_simple_output_block (enum lto_section_type section_type)
+{
+ struct lto_simple_output_block *ob
+ = ((struct lto_simple_output_block *)
+ xcalloc (1, sizeof (struct lto_simple_output_block)));
+
+ ob->section_type = section_type;
+ ob->decl_state = lto_get_out_decl_state ();
+ ob->main_stream = ((struct lto_output_stream *)
+ xcalloc (1, sizeof (struct lto_output_stream)));
+
+ return ob;
+}
+
+
+/* Produce a simple section for one of the ipa passes. */
+
+void
+lto_destroy_simple_output_block (struct lto_simple_output_block *ob)
+{
+ char *section_name;
+ struct lto_simple_header header;
+ struct lto_output_stream *header_stream;
+
+ section_name = lto_get_section_name (ob->section_type, NULL);
+ lto_begin_section (section_name, !flag_wpa);
+ free (section_name);
+
+ /* Write the header which says how to decode the pieces of the
+ t. */
+ memset (&header, 0, sizeof (struct lto_simple_header));
+ header.lto_header.major_version = LTO_major_version;
+ header.lto_header.minor_version = LTO_minor_version;
+ header.lto_header.section_type = LTO_section_cgraph;
+
+ header.compressed_size = 0;
+
+ header.main_size = ob->main_stream->total_size;
+
+ header_stream = XCNEW (struct lto_output_stream);
+ lto_output_data_stream (header_stream, &header, sizeof header);
+ lto_write_stream (header_stream);
+ free (header_stream);
+
+ lto_write_stream (ob->main_stream);
+
+ /* Put back the assembly section that was there before we started
+ writing lto info. */
+ lto_end_section ();
+
+ free (ob->main_stream);
+ free (ob);
+}
+
+
+/* Return a new lto_out_decl_state. */
+
+struct lto_out_decl_state *
+lto_new_out_decl_state (void)
+{
+ struct lto_out_decl_state *state = XCNEW (struct lto_out_decl_state);
+ int i;
+ htab_hash hash_fn;
+ htab_eq eq_fn;
+
+ for (i = 0; i < LTO_N_DECL_STREAMS; i++)
+ {
+ if (i == LTO_DECL_STREAM_TYPE)
+ {
+ hash_fn = lto_hash_type_slot_node;
+ eq_fn = lto_eq_type_slot_node;
+ }
+ else
+ {
+ hash_fn = lto_hash_decl_slot_node;
+ eq_fn = lto_eq_decl_slot_node;
+ }
+ lto_init_tree_ref_encoder (&state->streams[i], hash_fn, eq_fn);
+ }
+
+ state->cgraph_node_encoder = lto_cgraph_encoder_new ();
+
+ return state;
+}
+
+
+/* Delete STATE and components. */
+
+void
+lto_delete_out_decl_state (struct lto_out_decl_state *state)
+{
+ int i;
+
+ for (i = 0; i < LTO_N_DECL_STREAMS; i++)
+ lto_destroy_tree_ref_encoder (&state->streams[i]);
+
+ free (state);
+}
+
+
+/* Get the currently used lto_out_decl_state structure. */
+
+struct lto_out_decl_state *
+lto_get_out_decl_state (void)
+{
+ return VEC_last (lto_out_decl_state_ptr, decl_state_stack);
+}
+
+/* Push STATE to top of out decl stack. */
+
+void
+lto_push_out_decl_state (struct lto_out_decl_state *state)
+{
+ VEC_safe_push (lto_out_decl_state_ptr, heap, decl_state_stack, state);
+}
+
+/* Pop the currently used out-decl state from top of stack. */
+
+struct lto_out_decl_state *
+lto_pop_out_decl_state (void)
+{
+ return VEC_pop (lto_out_decl_state_ptr, decl_state_stack);
+}
+
+/* Record STATE after it has been used in serializing the body of
+ FN_DECL. STATE should no longer be used by the caller. The ownership
+ of it is taken over from this point. */
+
+void
+lto_record_function_out_decl_state (tree fn_decl,
+ struct lto_out_decl_state *state)
+{
+ int i;
+
+ /* Strip all hash tables to save some memory. */
+ for (i = 0; i < LTO_N_DECL_STREAMS; i++)
+ if (state->streams[i].tree_hash_table)
+ {
+ htab_delete (state->streams[i].tree_hash_table);
+ state->streams[i].tree_hash_table = NULL;
+ }
+ state->fn_decl = fn_decl;
+ VEC_safe_push (lto_out_decl_state_ptr, heap, lto_function_decl_states,
+ state);
+}
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
new file mode 100644
index 00000000000..f7c793647bc
--- /dev/null
+++ b/gcc/lto-streamer-in.c
@@ -0,0 +1,2741 @@
+/* Read the GIMPLE representation from a file stream.
+
+ Copyright 2009 Free Software Foundation, Inc.
+ Contributed by Kenneth Zadeck <zadeck@naturalbridge.com>
+ Re-implemented by Diego Novillo <dnovillo@google.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "toplev.h"
+#include "tree.h"
+#include "expr.h"
+#include "flags.h"
+#include "params.h"
+#include "input.h"
+#include "varray.h"
+#include "hashtab.h"
+#include "basic-block.h"
+#include "tree-flow.h"
+#include "tree-pass.h"
+#include "cgraph.h"
+#include "function.h"
+#include "ggc.h"
+#include "diagnostic.h"
+#include "libfuncs.h"
+#include "except.h"
+#include "debug.h"
+#include "vec.h"
+#include "timevar.h"
+#include "output.h"
+#include "ipa-utils.h"
+#include "lto-streamer.h"
+#include "tree-pass.h"
+
+/* Data structure used to hash file names in the source_location field. */
+struct string_slot
+{
+ const char *s;
+ unsigned int slot_num;
+};
+
+/* The table to hold the file names. */
+static htab_t file_name_hash_table;
+
+
+/* Check that tag ACTUAL has one of the given values. NUM_TAGS is the
+ number of valid tag values to check. */
+
+static void
+lto_tag_check_set (enum LTO_tags actual, int ntags, ...)
+{
+ va_list ap;
+ int i;
+
+ va_start (ap, ntags);
+ for (i = 0; i < ntags; i++)
+ if ((unsigned) actual == va_arg (ap, unsigned))
+ {
+ va_end (ap);
+ return;
+ }
+
+ va_end (ap);
+ internal_error ("bytecode stream: unexpected tag %s", lto_tag_name (actual));
+}
+
+
+/* Check that tag ACTUAL is in the range [TAG1, TAG2]. */
+
+static void
+lto_tag_check_range (enum LTO_tags actual, enum LTO_tags tag1,
+ enum LTO_tags tag2)
+{
+ if (actual < tag1 || actual > tag2)
+ internal_error ("bytecode stream: tag %s is not in the expected range "
+ "[%s, %s]",
+ lto_tag_name (actual),
+ lto_tag_name (tag1),
+ lto_tag_name (tag2));
+}
+
+
+/* Check that tag ACTUAL == EXPECTED. */
+
+static void
+lto_tag_check (enum LTO_tags actual, enum LTO_tags expected)
+{
+ if (actual != expected)
+ internal_error ("bytecode stream: expected tag %s instead of %s",
+ lto_tag_name (expected), lto_tag_name (actual));
+}
+
+
+/* Return a hash code for P. */
+
+static hashval_t
+hash_string_slot_node (const void *p)
+{
+ const struct string_slot *ds = (const struct string_slot *) p;
+ return (hashval_t) htab_hash_string (ds->s);
+}
+
+
+/* Returns nonzero if P1 and P2 are equal. */
+
+static int
+eq_string_slot_node (const void *p1, const void *p2)
+{
+ const struct string_slot *ds1 = (const struct string_slot *) p1;
+ const struct string_slot *ds2 = (const struct string_slot *) p2;
+ return strcmp (ds1->s, ds2->s) == 0;
+}
+
+
+/* Read a string from the string table in DATA_IN using input block
+ IB. Write the length to RLEN. */
+
+static const char *
+input_string_internal (struct data_in *data_in, struct lto_input_block *ib,
+ unsigned int *rlen)
+{
+ struct lto_input_block str_tab;
+ unsigned int len;
+ unsigned int loc;
+ const char *result;
+
+ loc = lto_input_uleb128 (ib);
+ LTO_INIT_INPUT_BLOCK (str_tab, data_in->strings, loc, data_in->strings_len);
+ len = lto_input_uleb128 (&str_tab);
+ *rlen = len;
+
+ if (str_tab.p + len > data_in->strings_len)
+ internal_error ("bytecode stream: string too long for the string table");
+
+ result = (const char *)(data_in->strings + str_tab.p);
+
+ return result;
+}
+
+
+/* Read a STRING_CST from the string table in DATA_IN using input
+ block IB. */
+
+static tree
+input_string_cst (struct data_in *data_in, struct lto_input_block *ib)
+{
+ unsigned int len;
+ const char * ptr;
+ unsigned int is_null;
+
+ is_null = lto_input_uleb128 (ib);
+ if (is_null)
+ return NULL;
+
+ ptr = input_string_internal (data_in, ib, &len);
+ return build_string (len, ptr);
+}
+
+
+/* Read an IDENTIFIER from the string table in DATA_IN using input
+ block IB. */
+
+static tree
+input_identifier (struct data_in *data_in, struct lto_input_block *ib)
+{
+ unsigned int len;
+ const char *ptr;
+ unsigned int is_null;
+
+ is_null = lto_input_uleb128 (ib);
+ if (is_null)
+ return NULL;
+
+ ptr = input_string_internal (data_in, ib, &len);
+ return get_identifier_with_length (ptr, len);
+}
+
+/* Read a NULL terminated string from the string table in DATA_IN. */
+
+static const char *
+input_string (struct data_in *data_in, struct lto_input_block *ib)
+{
+ unsigned int len;
+ const char *ptr;
+ unsigned int is_null;
+
+ is_null = lto_input_uleb128 (ib);
+ if (is_null)
+ return NULL;
+
+ ptr = input_string_internal (data_in, ib, &len);
+ if (ptr[len - 1] != '\0')
+ internal_error ("bytecode stream: found non-null terminated string");
+
+ return ptr;
+}
+
+
+/* Return the next tag in the input block IB. */
+
+static enum LTO_tags
+input_record_start (struct lto_input_block *ib)
+{
+ enum LTO_tags tag = (enum LTO_tags) lto_input_uleb128 (ib);
+ return tag;
+}
+
+
+/* Lookup STRING in file_name_hash_table. If found, return the existing
+ string, otherwise insert STRING as the canonical version. */
+
+static const char *
+canon_file_name (const char *string)
+{
+ void **slot;
+ struct string_slot s_slot;
+ s_slot.s = string;
+
+ slot = htab_find_slot (file_name_hash_table, &s_slot, INSERT);
+ if (*slot == NULL)
+ {
+ size_t len;
+ char *saved_string;
+ struct string_slot *new_slot;
+
+ len = strlen (string);
+ saved_string = (char *) xmalloc (len + 1);
+ new_slot = XCNEW (struct string_slot);
+ strcpy (saved_string, string);
+ new_slot->s = saved_string;
+ *slot = new_slot;
+ return saved_string;
+ }
+ else
+ {
+ struct string_slot *old_slot = (struct string_slot *) *slot;
+ return old_slot->s;
+ }
+}
+
+
+/* Clear the line info stored in DATA_IN. */
+
+static void
+clear_line_info (struct data_in *data_in)
+{
+ if (data_in->current_file)
+ linemap_add (line_table, LC_LEAVE, false, NULL, 0);
+ data_in->current_file = NULL;
+ data_in->current_line = 0;
+ data_in->current_col = 0;
+}
+
+
+/* Read a location from input block IB. */
+
+static location_t
+lto_input_location (struct lto_input_block *ib, struct data_in *data_in)
+{
+ expanded_location xloc;
+
+ xloc.file = input_string (data_in, ib);
+ if (xloc.file == NULL)
+ return UNKNOWN_LOCATION;
+
+ xloc.file = canon_file_name (xloc.file);
+ xloc.line = lto_input_sleb128 (ib);
+ xloc.column = lto_input_sleb128 (ib);
+ xloc.sysp = lto_input_sleb128 (ib);
+
+ if (data_in->current_file != xloc.file)
+ {
+ if (data_in->current_file)
+ linemap_add (line_table, LC_LEAVE, false, NULL, 0);
+
+ linemap_add (line_table, LC_ENTER, xloc.sysp, xloc.file, xloc.line);
+ }
+ else if (data_in->current_line != xloc.line)
+ linemap_line_start (line_table, xloc.line, xloc.column);
+
+ data_in->current_file = xloc.file;
+ data_in->current_line = xloc.line;
+ data_in->current_col = xloc.column;
+
+ return linemap_position_for_column (line_table, xloc.column);
+}
+
+
+/* Read a reference to a tree node from DATA_IN using input block IB.
+ TAG is the expected node that should be found in IB, if TAG belongs
+ to one of the indexable trees, expect to read a reference index to
+ be looked up in one of the symbol tables, otherwise read the pysical
+ representation of the tree using lto_input_tree. FN is the
+ function scope for the read tree. */
+
+static tree
+lto_input_tree_ref (struct lto_input_block *ib, struct data_in *data_in,
+ struct function *fn, enum LTO_tags tag)
+{
+ unsigned HOST_WIDE_INT ix_u;
+ tree result = NULL_TREE;
+
+ lto_tag_check_range (tag, LTO_field_decl_ref, LTO_global_decl_ref);
+
+ switch (tag)
+ {
+ case LTO_type_ref:
+ ix_u = lto_input_uleb128 (ib);
+ result = lto_file_decl_data_get_type (data_in->file_data, ix_u);
+ break;
+
+ case LTO_ssa_name_ref:
+ ix_u = lto_input_uleb128 (ib);
+ result = VEC_index (tree, SSANAMES (fn), ix_u);
+ break;
+
+ case LTO_field_decl_ref:
+ ix_u = lto_input_uleb128 (ib);
+ result = lto_file_decl_data_get_field_decl (data_in->file_data, ix_u);
+ break;
+
+ case LTO_function_decl_ref:
+ ix_u = lto_input_uleb128 (ib);
+ result = lto_file_decl_data_get_fn_decl (data_in->file_data, ix_u);
+ break;
+
+ case LTO_type_decl_ref:
+ ix_u = lto_input_uleb128 (ib);
+ result = lto_file_decl_data_get_type_decl (data_in->file_data, ix_u);
+ break;
+
+ case LTO_namespace_decl_ref:
+ ix_u = lto_input_uleb128 (ib);
+ result = lto_file_decl_data_get_namespace_decl (data_in->file_data, ix_u);
+ break;
+
+ case LTO_global_decl_ref:
+ case LTO_result_decl_ref:
+ case LTO_const_decl_ref:
+ case LTO_imported_decl_ref:
+ case LTO_label_decl_ref:
+ ix_u = lto_input_uleb128 (ib);
+ result = lto_file_decl_data_get_var_decl (data_in->file_data, ix_u);
+ if (tag == LTO_global_decl_ref)
+ varpool_mark_needed_node (varpool_node (result));
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+
+ gcc_assert (result);
+
+ return result;
+}
+
+
+/* Read and return a double-linked list of catch handlers from input
+ block IB, using descriptors in DATA_IN. */
+
+static struct eh_catch_d *
+lto_input_eh_catch_list (struct lto_input_block *ib, struct data_in *data_in,
+ eh_catch *last_p)
+{
+ eh_catch first;
+ enum LTO_tags tag;
+
+ *last_p = first = NULL;
+ tag = input_record_start (ib);
+ while (tag)
+ {
+ tree list;
+ eh_catch n;
+
+ lto_tag_check_range (tag, LTO_eh_catch, LTO_eh_catch);
+
+ /* Read the catch node. */
+ n = GGC_CNEW (struct eh_catch_d);
+ n->type_list = lto_input_tree (ib, data_in);
+ n->filter_list = lto_input_tree (ib, data_in);
+ n->label = lto_input_tree (ib, data_in);
+
+ /* Register all the types in N->FILTER_LIST. */
+ for (list = n->filter_list; list; list = TREE_CHAIN (list))
+ add_type_for_runtime (TREE_VALUE (list));
+
+ /* Chain N to the end of the list. */
+ if (*last_p)
+ (*last_p)->next_catch = n;
+ n->prev_catch = *last_p;
+ *last_p = n;
+
+ /* Set the head of the list the first time through the loop. */
+ if (first == NULL)
+ first = n;
+
+ tag = input_record_start (ib);
+ }
+
+ return first;
+}
+
+
+/* Read and return EH region IX from input block IB, using descriptors
+ in DATA_IN. */
+
+static eh_region
+input_eh_region (struct lto_input_block *ib, struct data_in *data_in, int ix)
+{
+ enum LTO_tags tag;
+ eh_region r;
+
+ /* Read the region header. */
+ tag = input_record_start (ib);
+ if (tag == LTO_null)
+ return NULL;
+
+ r = GGC_CNEW (struct eh_region_d);
+ r->index = lto_input_sleb128 (ib);
+
+ gcc_assert (r->index == ix);
+
+ /* Read all the region pointers as region numbers. We'll fix up
+ the pointers once the whole array has been read. */
+ r->outer = (eh_region) (intptr_t) lto_input_sleb128 (ib);
+ r->inner = (eh_region) (intptr_t) lto_input_sleb128 (ib);
+ r->next_peer = (eh_region) (intptr_t) lto_input_sleb128 (ib);
+
+ switch (tag)
+ {
+ case LTO_ert_cleanup:
+ r->type = ERT_CLEANUP;
+ break;
+
+ case LTO_ert_try:
+ {
+ struct eh_catch_d *last_catch;
+ r->type = ERT_TRY;
+ r->u.eh_try.first_catch = lto_input_eh_catch_list (ib, data_in,
+ &last_catch);
+ r->u.eh_try.last_catch = last_catch;
+ break;
+ }
+
+ case LTO_ert_allowed_exceptions:
+ {
+ tree l;
+
+ r->type = ERT_ALLOWED_EXCEPTIONS;
+ r->u.allowed.type_list = lto_input_tree (ib, data_in);
+ r->u.allowed.label = lto_input_tree (ib, data_in);
+ r->u.allowed.filter = lto_input_uleb128 (ib);
+
+ for (l = r->u.allowed.type_list; l ; l = TREE_CHAIN (l))
+ add_type_for_runtime (TREE_VALUE (l));
+ }
+ break;
+
+ case LTO_ert_must_not_throw:
+ r->type = ERT_MUST_NOT_THROW;
+ r->u.must_not_throw.failure_decl = lto_input_tree (ib, data_in);
+ r->u.must_not_throw.failure_loc = lto_input_location (ib, data_in);
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+
+ r->landing_pads = (eh_landing_pad) (intptr_t) lto_input_sleb128 (ib);
+
+ return r;
+}
+
+
+/* Read and return EH landing pad IX from input block IB, using descriptors
+ in DATA_IN. */
+
+static eh_landing_pad
+input_eh_lp (struct lto_input_block *ib, struct data_in *data_in, int ix)
+{
+ enum LTO_tags tag;
+ eh_landing_pad lp;
+
+ /* Read the landing pad header. */
+ tag = input_record_start (ib);
+ if (tag == LTO_null)
+ return NULL;
+
+ lto_tag_check_range (tag, LTO_eh_landing_pad, LTO_eh_landing_pad);
+
+ lp = GGC_CNEW (struct eh_landing_pad_d);
+ lp->index = lto_input_sleb128 (ib);
+ gcc_assert (lp->index == ix);
+ lp->next_lp = (eh_landing_pad) (intptr_t) lto_input_sleb128 (ib);
+ lp->region = (eh_region) (intptr_t) lto_input_sleb128 (ib);
+ lp->post_landing_pad = lto_input_tree (ib, data_in);
+
+ return lp;
+}
+
+
+/* After reading the EH regions, pointers to peer and children regions
+ are region numbers. This converts all these region numbers into
+ real pointers into the rematerialized regions for FN. ROOT_REGION
+ is the region number for the root EH region in FN. */
+
+static void
+fixup_eh_region_pointers (struct function *fn, HOST_WIDE_INT root_region)
+{
+ unsigned i;
+ VEC(eh_region,gc) *eh_array = fn->eh->region_array;
+ VEC(eh_landing_pad,gc) *lp_array = fn->eh->lp_array;
+ eh_region r;
+ eh_landing_pad lp;
+
+ gcc_assert (eh_array && lp_array);
+
+ gcc_assert (root_region >= 0);
+ fn->eh->region_tree = VEC_index (eh_region, eh_array, root_region);
+
+#define FIXUP_EH_REGION(r) (r) = VEC_index (eh_region, eh_array, \
+ (HOST_WIDE_INT) (intptr_t) (r))
+#define FIXUP_EH_LP(p) (p) = VEC_index (eh_landing_pad, lp_array, \
+ (HOST_WIDE_INT) (intptr_t) (p))
+
+ /* Convert all the index numbers stored in pointer fields into
+ pointers to the corresponding slots in the EH region array. */
+ for (i = 0; VEC_iterate (eh_region, eh_array, i, r); i++)
+ {
+ /* The array may contain NULL regions. */
+ if (r == NULL)
+ continue;
+
+ gcc_assert (i == (unsigned) r->index);
+ FIXUP_EH_REGION (r->outer);
+ FIXUP_EH_REGION (r->inner);
+ FIXUP_EH_REGION (r->next_peer);
+ FIXUP_EH_LP (r->landing_pads);
+ }
+
+ /* Convert all the index numbers stored in pointer fields into
+ pointers to the corresponding slots in the EH landing pad array. */
+ for (i = 0; VEC_iterate (eh_landing_pad, lp_array, i, lp); i++)
+ {
+ /* The array may contain NULL landing pads. */
+ if (lp == NULL)
+ continue;
+
+ gcc_assert (i == (unsigned) lp->index);
+ FIXUP_EH_LP (lp->next_lp);
+ FIXUP_EH_REGION (lp->region);
+ }
+
+#undef FIXUP_EH_REGION
+#undef FIXUP_EH_LP
+}
+
+
+/* Initialize EH support. */
+
+static void
+lto_init_eh (void)
+{
+ /* Contrary to most other FEs, we only initialize EH support when at
+ least one of the files in the set contains exception regions in
+ it. Since this happens much later than the call to init_eh in
+ lang_dependent_init, we have to set flag_exceptions and call
+ init_eh again to initialize the EH tables. */
+ flag_exceptions = 1;
+ init_eh ();
+
+ /* Initialize dwarf2 tables. Since dwarf2out_do_frame() returns
+ true only when exceptions are enabled, this initialization is
+ never done during lang_dependent_init. */
+#if defined DWARF2_DEBUGGING_INFO || defined DWARF2_UNWIND_INFO
+ if (dwarf2out_do_frame ())
+ dwarf2out_frame_init ();
+#endif
+}
+
+
+/* Read the exception table for FN from IB using the data descriptors
+ in DATA_IN. */
+
+static void
+input_eh_regions (struct lto_input_block *ib, struct data_in *data_in,
+ struct function *fn)
+{
+ HOST_WIDE_INT i, root_region, len;
+ enum LTO_tags tag;
+ static bool eh_initialized_p = false;
+
+ tag = input_record_start (ib);
+ if (tag == LTO_null)
+ return;
+
+ lto_tag_check_range (tag, LTO_eh_table, LTO_eh_table);
+
+ /* If the file contains EH regions, then it was compiled with
+ -fexceptions. In that case, initialize the backend EH
+ machinery. */
+ if (!eh_initialized_p)
+ {
+ lto_init_eh ();
+ eh_initialized_p = true;
+ }
+
+ gcc_assert (fn->eh);
+
+ root_region = lto_input_sleb128 (ib);
+ gcc_assert (root_region == (int) root_region);
+
+ /* Read the EH region array. */
+ len = lto_input_sleb128 (ib);
+ gcc_assert (len == (int) len);
+ if (len > 0)
+ {
+ VEC_safe_grow (eh_region, gc, fn->eh->region_array, len);
+ for (i = 0; i < len; i++)
+ {
+ eh_region r = input_eh_region (ib, data_in, i);
+ VEC_replace (eh_region, fn->eh->region_array, i, r);
+ }
+ }
+
+ /* Read the landing pads. */
+ len = lto_input_sleb128 (ib);
+ gcc_assert (len == (int) len);
+ if (len > 0)
+ {
+ VEC_safe_grow (eh_landing_pad, gc, fn->eh->lp_array, len);
+ for (i = 0; i < len; i++)
+ {
+ eh_landing_pad lp = input_eh_lp (ib, data_in, i);
+ VEC_replace (eh_landing_pad, fn->eh->lp_array, i, lp);
+ }
+ }
+
+ /* Read the runtime type data. */
+ len = lto_input_sleb128 (ib);
+ gcc_assert (len == (int) len);
+ if (len > 0)
+ {
+ VEC_safe_grow (tree, gc, fn->eh->ttype_data, len);
+ for (i = 0; i < len; i++)
+ {
+ tree ttype = lto_input_tree (ib, data_in);
+ VEC_replace (tree, fn->eh->ttype_data, i, ttype);
+ }
+ }
+
+ /* Read the table of action chains. */
+ len = lto_input_sleb128 (ib);
+ gcc_assert (len == (int) len);
+ if (len > 0)
+ {
+ if (targetm.arm_eabi_unwinder)
+ {
+ VEC_safe_grow (tree, gc, fn->eh->ehspec_data.arm_eabi, len);
+ for (i = 0; i < len; i++)
+ {
+ tree t = lto_input_tree (ib, data_in);
+ VEC_replace (tree, fn->eh->ehspec_data.arm_eabi, i, t);
+ }
+ }
+ else
+ {
+ VEC_safe_grow (uchar, gc, fn->eh->ehspec_data.other, len);
+ for (i = 0; i < len; i++)
+ {
+ uchar c = lto_input_1_unsigned (ib);
+ VEC_replace (uchar, fn->eh->ehspec_data.other, i, c);
+ }
+ }
+ }
+
+ /* Reconstruct the EH region tree by fixing up the peer/children
+ pointers. */
+ fixup_eh_region_pointers (fn, root_region);
+
+ tag = input_record_start (ib);
+ lto_tag_check_range (tag, LTO_null, LTO_null);
+}
+
+
+/* Make a new basic block with index INDEX in function FN. */
+
+static basic_block
+make_new_block (struct function *fn, unsigned int index)
+{
+ basic_block bb = alloc_block ();
+ bb->index = index;
+ SET_BASIC_BLOCK_FOR_FUNCTION (fn, index, bb);
+ bb->il.gimple = GGC_CNEW (struct gimple_bb_info);
+ n_basic_blocks_for_function (fn)++;
+ bb->flags = 0;
+ set_bb_seq (bb, gimple_seq_alloc ());
+ return bb;
+}
+
+
+/* Read the CFG for function FN from input block IB. */
+
+static void
+input_cfg (struct lto_input_block *ib, struct function *fn)
+{
+ unsigned int bb_count;
+ basic_block p_bb;
+ unsigned int i;
+ int index;
+
+ init_empty_tree_cfg_for_function (fn);
+ init_ssa_operands ();
+
+ profile_status_for_function (fn) =
+ (enum profile_status_d) lto_input_uleb128 (ib);
+
+ bb_count = lto_input_uleb128 (ib);
+
+ last_basic_block_for_function (fn) = bb_count;
+ if (bb_count > VEC_length (basic_block, basic_block_info_for_function (fn)))
+ VEC_safe_grow_cleared (basic_block, gc,
+ basic_block_info_for_function (fn), bb_count);
+
+ if (bb_count > VEC_length (basic_block, label_to_block_map_for_function (fn)))
+ VEC_safe_grow_cleared (basic_block, gc,
+ label_to_block_map_for_function (fn), bb_count);
+
+ index = lto_input_sleb128 (ib);
+ while (index != -1)
+ {
+ basic_block bb = BASIC_BLOCK_FOR_FUNCTION (fn, index);
+ unsigned int edge_count;
+
+ if (bb == NULL)
+ bb = make_new_block (fn, index);
+
+ edge_count = lto_input_uleb128 (ib);
+
+ /* Connect up the CFG. */
+ for (i = 0; i < edge_count; i++)
+ {
+ unsigned int dest_index;
+ unsigned int edge_flags;
+ basic_block dest;
+ int probability;
+ gcov_type count;
+ edge e;
+
+ dest_index = lto_input_uleb128 (ib);
+ probability = (int) lto_input_sleb128 (ib);
+ count = (gcov_type) lto_input_sleb128 (ib);
+ edge_flags = lto_input_uleb128 (ib);
+
+ dest = BASIC_BLOCK_FOR_FUNCTION (fn, dest_index);
+
+ if (dest == NULL)
+ dest = make_new_block (fn, dest_index);
+
+ e = make_edge (bb, dest, edge_flags);
+ e->probability = probability;
+ e->count = count;
+ }
+
+ index = lto_input_sleb128 (ib);
+ }
+
+ p_bb = ENTRY_BLOCK_PTR_FOR_FUNCTION(fn);
+ index = lto_input_sleb128 (ib);
+ while (index != -1)
+ {
+ basic_block bb = BASIC_BLOCK_FOR_FUNCTION (fn, index);
+ bb->prev_bb = p_bb;
+ p_bb->next_bb = bb;
+ p_bb = bb;
+ index = lto_input_sleb128 (ib);
+ }
+}
+
+
+/* Read a PHI function for basic block BB in function FN. DATA_IN is
+ the file being read. IB is the input block to use for reading. */
+
+static gimple
+input_phi (struct lto_input_block *ib, basic_block bb, struct data_in *data_in,
+ struct function *fn)
+{
+ unsigned HOST_WIDE_INT ix;
+ tree phi_result;
+ int i, len;
+ gimple result;
+
+ ix = lto_input_uleb128 (ib);
+ phi_result = VEC_index (tree, SSANAMES (fn), ix);
+ len = EDGE_COUNT (bb->preds);
+ result = create_phi_node (phi_result, bb);
+ SSA_NAME_DEF_STMT (phi_result) = result;
+
+ /* We have to go through a lookup process here because the preds in the
+ reconstructed graph are generally in a different order than they
+ were in the original program. */
+ for (i = 0; i < len; i++)
+ {
+ tree def = lto_input_tree (ib, data_in);
+ int src_index = lto_input_uleb128 (ib);
+ location_t arg_loc = lto_input_location (ib, data_in);
+ basic_block sbb = BASIC_BLOCK_FOR_FUNCTION (fn, src_index);
+
+ edge e = NULL;
+ int j;
+
+ for (j = 0; j < len; j++)
+ if (EDGE_PRED (bb, j)->src == sbb)
+ {
+ e = EDGE_PRED (bb, j);
+ break;
+ }
+
+ add_phi_arg (result, def, e, arg_loc);
+ }
+
+ return result;
+}
+
+
+/* Read the SSA names array for function FN from DATA_IN using input
+ block IB. */
+
+static void
+input_ssa_names (struct lto_input_block *ib, struct data_in *data_in,
+ struct function *fn)
+{
+ unsigned int i, size;
+
+ size = lto_input_uleb128 (ib);
+ init_ssanames (fn, size);
+
+ i = lto_input_uleb128 (ib);
+ while (i)
+ {
+ tree ssa_name, name;
+ bool is_default_def;
+
+ /* Skip over the elements that had been freed. */
+ while (VEC_length (tree, SSANAMES (fn)) < i)
+ VEC_quick_push (tree, SSANAMES (fn), NULL_TREE);
+
+ is_default_def = (lto_input_1_unsigned (ib) != 0);
+ name = lto_input_tree (ib, data_in);
+ ssa_name = make_ssa_name_fn (fn, name, gimple_build_nop ());
+
+ if (is_default_def)
+ set_default_def (SSA_NAME_VAR (ssa_name), ssa_name);
+
+ i = lto_input_uleb128 (ib);
+ }
+}
+
+
+/* Fixup the reference tree OP for replaced VAR_DECLs with mismatched
+ types. */
+
+static void
+maybe_fixup_handled_component (tree op)
+{
+ tree decl_type;
+ tree wanted_type;
+
+ while (handled_component_p (TREE_OPERAND (op, 0)))
+ op = TREE_OPERAND (op, 0);
+ if (TREE_CODE (TREE_OPERAND (op, 0)) != VAR_DECL)
+ return;
+
+ decl_type = TREE_TYPE (TREE_OPERAND (op, 0));
+
+ switch (TREE_CODE (op))
+ {
+ case COMPONENT_REF:
+ /* The DECL_CONTEXT of the field-decl is the record type we look for. */
+ wanted_type = DECL_CONTEXT (TREE_OPERAND (op, 1));
+ break;
+
+ case ARRAY_REF:
+ if (TREE_CODE (decl_type) == ARRAY_TYPE
+ && (TREE_TYPE (decl_type) == TREE_TYPE (op)
+ || useless_type_conversion_p (TREE_TYPE (op),
+ TREE_TYPE (decl_type))))
+ return;
+ /* An unknown size array type should be ok. But we do not
+ lower the lower bound in all cases - ugh. */
+ wanted_type = build_array_type (TREE_TYPE (op), NULL_TREE);
+ break;
+
+ case ARRAY_RANGE_REF:
+ if (TREE_CODE (decl_type) == ARRAY_TYPE
+ && (TREE_TYPE (decl_type) == TREE_TYPE (TREE_TYPE (op))
+ || useless_type_conversion_p (TREE_TYPE (TREE_TYPE (op)),
+ TREE_TYPE (decl_type))))
+ return;
+ /* An unknown size array type should be ok. But we do not
+ lower the lower bound in all cases - ugh. */
+ wanted_type = build_array_type (TREE_TYPE (TREE_TYPE (op)), NULL_TREE);
+ break;
+
+ case BIT_FIELD_REF:
+ case VIEW_CONVERT_EXPR:
+ /* Very nice - nothing to do. */
+ return;
+
+ case REALPART_EXPR:
+ case IMAGPART_EXPR:
+ if (TREE_CODE (decl_type) == COMPLEX_TYPE
+ && (TREE_TYPE (decl_type) == TREE_TYPE (op)
+ || useless_type_conversion_p (TREE_TYPE (op),
+ TREE_TYPE (decl_type))))
+ return;
+ wanted_type = build_complex_type (TREE_TYPE (op));
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+
+ if (!useless_type_conversion_p (wanted_type, decl_type))
+ TREE_OPERAND (op, 0) = build1 (VIEW_CONVERT_EXPR, wanted_type,
+ TREE_OPERAND (op, 0));
+}
+
+/* Fixup reference tree operands for substituted prevailing decls
+ with mismatched types in STMT. */
+
+static void
+maybe_fixup_decls (gimple stmt)
+{
+ /* We have to fixup replaced decls here in case there were
+ inter-TU type mismatches. Catch the most common cases
+ for now - this way we'll get testcases for the rest as
+ the type verifier will complain. */
+ if (gimple_assign_single_p (stmt))
+ {
+ tree lhs = gimple_assign_lhs (stmt);
+ tree rhs = gimple_assign_rhs1 (stmt);
+
+ /* First catch loads and aggregate copies by adjusting the rhs. */
+ if (TREE_CODE (rhs) == VAR_DECL)
+ {
+ if (!useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (rhs)))
+ gimple_assign_set_rhs1 (stmt, build1 (VIEW_CONVERT_EXPR,
+ TREE_TYPE (lhs), rhs));
+ }
+ else if (handled_component_p (rhs))
+ maybe_fixup_handled_component (rhs);
+ /* Then catch scalar stores. */
+ else if (TREE_CODE (lhs) == VAR_DECL)
+ {
+ if (!useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (rhs)))
+ gimple_assign_set_lhs (stmt, build1 (VIEW_CONVERT_EXPR,
+ TREE_TYPE (rhs), lhs));
+ }
+ else if (handled_component_p (lhs))
+ maybe_fixup_handled_component (lhs);
+ }
+ else if (is_gimple_call (stmt))
+ {
+ tree lhs = gimple_call_lhs (stmt);
+
+ if (lhs && TREE_CODE (lhs) == VAR_DECL)
+ {
+ if (!useless_type_conversion_p (TREE_TYPE (lhs),
+ gimple_call_return_type (stmt)))
+ gimple_call_set_lhs (stmt, build1 (VIEW_CONVERT_EXPR,
+ gimple_call_return_type (stmt),
+ lhs));
+ }
+ else if (lhs && handled_component_p (lhs))
+ maybe_fixup_handled_component (lhs);
+
+ /* Arguments, especially for varargs functions will be funny... */
+ }
+}
+
+/* Read a statement with tag TAG in function FN from block IB using
+ descriptors in DATA_IN. */
+
+static gimple
+input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in,
+ struct function *fn, enum LTO_tags tag)
+{
+ gimple stmt;
+ enum gimple_code code;
+ unsigned HOST_WIDE_INT num_ops;
+ size_t i;
+ struct bitpack_d *bp;
+
+ code = lto_tag_to_gimple_code (tag);
+
+ /* Read the tuple header. */
+ bp = lto_input_bitpack (ib);
+ num_ops = bp_unpack_value (bp, sizeof (unsigned) * 8);
+ stmt = gimple_alloc (code, num_ops);
+ stmt->gsbase.no_warning = bp_unpack_value (bp, 1);
+ if (is_gimple_assign (stmt))
+ stmt->gsbase.nontemporal_move = bp_unpack_value (bp, 1);
+ stmt->gsbase.has_volatile_ops = bp_unpack_value (bp, 1);
+ stmt->gsbase.subcode = bp_unpack_value (bp, 16);
+ bitpack_delete (bp);
+
+ /* Read location information. */
+ gimple_set_location (stmt, lto_input_location (ib, data_in));
+
+ /* Read lexical block reference. */
+ gimple_set_block (stmt, lto_input_tree (ib, data_in));
+
+ /* Read in all the operands. */
+ switch (code)
+ {
+ case GIMPLE_RESX:
+ gimple_resx_set_region (stmt, lto_input_sleb128 (ib));
+ break;
+
+ case GIMPLE_EH_MUST_NOT_THROW:
+ gimple_eh_must_not_throw_set_fndecl (stmt, lto_input_tree (ib, data_in));
+ break;
+
+ case GIMPLE_EH_DISPATCH:
+ gimple_eh_dispatch_set_region (stmt, lto_input_sleb128 (ib));
+ break;
+
+ case GIMPLE_ASM:
+ {
+ /* FIXME lto. Move most of this into a new gimple_asm_set_string(). */
+ tree str;
+ stmt->gimple_asm.ni = lto_input_uleb128 (ib);
+ stmt->gimple_asm.no = lto_input_uleb128 (ib);
+ stmt->gimple_asm.nc = lto_input_uleb128 (ib);
+ str = input_string_cst (data_in, ib);
+ stmt->gimple_asm.string = TREE_STRING_POINTER (str);
+ }
+ /* Fallthru */
+
+ case GIMPLE_ASSIGN:
+ case GIMPLE_CALL:
+ case GIMPLE_RETURN:
+ case GIMPLE_SWITCH:
+ case GIMPLE_LABEL:
+ case GIMPLE_COND:
+ case GIMPLE_GOTO:
+ case GIMPLE_DEBUG:
+ for (i = 0; i < num_ops; i++)
+ {
+ tree op = lto_input_tree (ib, data_in);
+ gimple_set_op (stmt, i, op);
+
+ /* Fixup FIELD_DECLs. */
+ while (op && handled_component_p (op))
+ {
+ if (TREE_CODE (op) == COMPONENT_REF)
+ {
+ tree field, type, tem;
+ field = TREE_OPERAND (op, 1);
+ type = DECL_CONTEXT (field);
+ for (tem = TYPE_FIELDS (type); tem; tem = TREE_CHAIN (tem))
+ {
+ if (tem == field
+ || (TREE_TYPE (tem) == TREE_TYPE (field)
+ && (DECL_FIELD_OFFSET (tem)
+ == DECL_FIELD_OFFSET (field))
+ && (DECL_FIELD_BIT_OFFSET (tem)
+ == DECL_FIELD_BIT_OFFSET (field))
+ && (DECL_OFFSET_ALIGN (tem)
+ == DECL_OFFSET_ALIGN (field))))
+ break;
+ }
+ /* In case of type mismatches across units we can fail
+ to unify some types and thus not find a proper
+ field-decl here. Just do nothing in this case. */
+ if (tem != NULL_TREE)
+ TREE_OPERAND (op, 1) = tem;
+ }
+
+ op = TREE_OPERAND (op, 0);
+ }
+ }
+ break;
+
+ case GIMPLE_NOP:
+ case GIMPLE_PREDICT:
+ break;
+
+ default:
+ internal_error ("bytecode stream: unknown GIMPLE statement tag %s",
+ lto_tag_name (tag));
+ }
+
+ /* Update the properties of symbols, SSA names and labels associated
+ with STMT. */
+ if (code == GIMPLE_ASSIGN || code == GIMPLE_CALL)
+ {
+ tree lhs = gimple_get_lhs (stmt);
+ if (lhs && TREE_CODE (lhs) == SSA_NAME)
+ SSA_NAME_DEF_STMT (lhs) = stmt;
+ }
+ else if (code == GIMPLE_LABEL)
+ gcc_assert (emit_label_in_global_context_p (gimple_label_label (stmt))
+ || DECL_CONTEXT (gimple_label_label (stmt)) == fn->decl);
+ else if (code == GIMPLE_ASM)
+ {
+ unsigned i;
+
+ for (i = 0; i < gimple_asm_noutputs (stmt); i++)
+ {
+ tree op = TREE_VALUE (gimple_asm_output_op (stmt, i));
+ if (TREE_CODE (op) == SSA_NAME)
+ SSA_NAME_DEF_STMT (op) = stmt;
+ }
+ }
+
+ /* Fixup reference tree operands for substituted prevailing decls
+ with mismatched types. */
+ maybe_fixup_decls (stmt);
+
+ /* Mark the statement modified so its operand vectors can be filled in. */
+ gimple_set_modified (stmt, true);
+
+ return stmt;
+}
+
+
+/* Read a basic block with tag TAG from DATA_IN using input block IB.
+ FN is the function being processed. */
+
+static void
+input_bb (struct lto_input_block *ib, enum LTO_tags tag,
+ struct data_in *data_in, struct function *fn)
+{
+ unsigned int index;
+ basic_block bb;
+ gimple_stmt_iterator bsi;
+
+ /* This routine assumes that CFUN is set to FN, as it needs to call
+ basic GIMPLE routines that use CFUN. */
+ gcc_assert (cfun == fn);
+
+ index = lto_input_uleb128 (ib);
+ bb = BASIC_BLOCK_FOR_FUNCTION (fn, index);
+
+ bb->count = lto_input_sleb128 (ib);
+ bb->loop_depth = lto_input_sleb128 (ib);
+ bb->frequency = lto_input_sleb128 (ib);
+ bb->flags = lto_input_sleb128 (ib);
+
+ /* LTO_bb1 has statements. LTO_bb0 does not. */
+ if (tag == LTO_bb0)
+ return;
+
+ bsi = gsi_start_bb (bb);
+ tag = input_record_start (ib);
+ while (tag)
+ {
+ gimple stmt = input_gimple_stmt (ib, data_in, fn, tag);
+
+ /* Change debug stmts to nops on-the-fly if we do not have VTA enabled.
+ This allows us to build for example static libs with debugging
+ enabled and do the final link without. */
+ if (!MAY_HAVE_DEBUG_STMTS
+ && is_gimple_debug (stmt))
+ stmt = gimple_build_nop ();
+
+ find_referenced_vars_in (stmt);
+ gsi_insert_after (&bsi, stmt, GSI_NEW_STMT);
+
+ /* After the statement, expect a 0 delimiter or the EH region
+ that the previous statement belongs to. */
+ tag = input_record_start (ib);
+ lto_tag_check_set (tag, 2, LTO_eh_region, LTO_null);
+
+ if (tag == LTO_eh_region)
+ {
+ HOST_WIDE_INT region = lto_input_sleb128 (ib);
+ gcc_assert (region == (int) region);
+ add_stmt_to_eh_lp (stmt, region);
+ }
+
+ tag = input_record_start (ib);
+ }
+
+ tag = input_record_start (ib);
+ while (tag)
+ {
+ gimple phi = input_phi (ib, bb, data_in, fn);
+ find_referenced_vars_in (phi);
+ tag = input_record_start (ib);
+ }
+}
+
+/* Go through all NODE edges and fixup call_stmt pointers
+ so they point to STMTS. */
+
+static void
+fixup_call_stmt_edges_1 (struct cgraph_node *node, gimple *stmts)
+{
+ struct cgraph_edge *cedge;
+ for (cedge = node->callees; cedge; cedge = cedge->next_callee)
+ cedge->call_stmt = stmts[cedge->lto_stmt_uid];
+}
+
+/* Fixup call_stmt pointers in NODE and all clones. */
+
+static void
+fixup_call_stmt_edges (struct cgraph_node *orig, gimple *stmts)
+{
+ struct cgraph_node *node;
+
+ while (orig->clone_of)
+ orig = orig->clone_of;
+
+ fixup_call_stmt_edges_1 (orig, stmts);
+ if (orig->clones)
+ for (node = orig->clones; node != orig;)
+ {
+ fixup_call_stmt_edges_1 (node, stmts);
+ if (node->clones)
+ node = node->clones;
+ else if (node->next_sibling_clone)
+ node = node->next_sibling_clone;
+ else
+ {
+ while (node != orig && !node->next_sibling_clone)
+ node = node->clone_of;
+ if (node != orig)
+ node = node->next_sibling_clone;
+ }
+ }
+}
+
+/* Read the body of function FN_DECL from DATA_IN using input block IB. */
+
+static void
+input_function (tree fn_decl, struct data_in *data_in,
+ struct lto_input_block *ib)
+{
+ struct function *fn;
+ enum LTO_tags tag;
+ gimple *stmts;
+ basic_block bb;
+ struct bitpack_d *bp;
+
+ fn = DECL_STRUCT_FUNCTION (fn_decl);
+ tag = input_record_start (ib);
+ clear_line_info (data_in);
+
+ gimple_register_cfg_hooks ();
+ lto_tag_check (tag, LTO_function);
+
+ /* Read all the attributes for FN. */
+ bp = lto_input_bitpack (ib);
+ fn->is_thunk = bp_unpack_value (bp, 1);
+ fn->has_local_explicit_reg_vars = bp_unpack_value (bp, 1);
+ fn->after_tree_profile = bp_unpack_value (bp, 1);
+ fn->returns_pcc_struct = bp_unpack_value (bp, 1);
+ fn->returns_struct = bp_unpack_value (bp, 1);
+ fn->always_inline_functions_inlined = bp_unpack_value (bp, 1);
+ fn->after_inlining = bp_unpack_value (bp, 1);
+ fn->dont_save_pending_sizes_p = bp_unpack_value (bp, 1);
+ fn->stdarg = bp_unpack_value (bp, 1);
+ fn->has_nonlocal_label = bp_unpack_value (bp, 1);
+ fn->calls_alloca = bp_unpack_value (bp, 1);
+ fn->calls_setjmp = bp_unpack_value (bp, 1);
+ fn->function_frequency = (enum function_frequency) bp_unpack_value (bp, 2);
+ fn->va_list_fpr_size = bp_unpack_value (bp, 8);
+ fn->va_list_gpr_size = bp_unpack_value (bp, 8);
+ bitpack_delete (bp);
+
+ /* Read the static chain and non-local goto save area. */
+ fn->static_chain_decl = lto_input_tree (ib, data_in);
+ fn->nonlocal_goto_save_area = lto_input_tree (ib, data_in);
+
+ /* Read all the local symbols. */
+ fn->local_decls = lto_input_tree (ib, data_in);
+
+ /* Read all the SSA names. */
+ input_ssa_names (ib, data_in, fn);
+
+ /* Read the exception handling regions in the function. */
+ input_eh_regions (ib, data_in, fn);
+
+ /* Read the tree of lexical scopes for the function. */
+ DECL_INITIAL (fn_decl) = lto_input_tree (ib, data_in);
+ gcc_assert (DECL_INITIAL (fn_decl));
+ DECL_SAVED_TREE (fn_decl) = NULL_TREE;
+
+ /* Read all function arguments. */
+ DECL_ARGUMENTS (fn_decl) = lto_input_tree (ib, data_in);
+
+ /* Read all the basic blocks. */
+ tag = input_record_start (ib);
+ while (tag)
+ {
+ input_bb (ib, tag, data_in, fn);
+ tag = input_record_start (ib);
+ }
+
+ /* Fix up the call statements that are mentioned in the callgraph
+ edges. */
+ renumber_gimple_stmt_uids ();
+ stmts = (gimple *) xcalloc (gimple_stmt_max_uid (fn), sizeof (gimple));
+ FOR_ALL_BB (bb)
+ {
+ gimple_stmt_iterator bsi;
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
+ {
+ gimple stmt = gsi_stmt (bsi);
+ stmts[gimple_uid (stmt)] = stmt;
+ }
+ }
+
+ /* Set the gimple body to the statement sequence in the entry
+ basic block. FIXME lto, this is fairly hacky. The existence
+ of a gimple body is used by the cgraph routines, but we should
+ really use the presence of the CFG. */
+ {
+ edge_iterator ei = ei_start (ENTRY_BLOCK_PTR->succs);
+ gimple_set_body (fn_decl, bb_seq (ei_edge (ei)->dest));
+ }
+
+ fixup_call_stmt_edges (cgraph_node (fn_decl), stmts);
+
+ update_ssa (TODO_update_ssa_only_virtuals);
+ free_dominance_info (CDI_DOMINATORS);
+ free_dominance_info (CDI_POST_DOMINATORS);
+ free (stmts);
+}
+
+
+/* Read initializer expressions for public statics. DATA_IN is the
+ file being read. IB is the input block used for reading. */
+
+static void
+input_alias_pairs (struct lto_input_block *ib, struct data_in *data_in)
+{
+ tree var;
+
+ clear_line_info (data_in);
+
+ /* Skip over all the unreferenced globals. */
+ do
+ var = lto_input_tree (ib, data_in);
+ while (var);
+
+ var = lto_input_tree (ib, data_in);
+ while (var)
+ {
+ const char *orig_name, *new_name;
+ alias_pair *p;
+
+ p = VEC_safe_push (alias_pair, gc, alias_pairs, NULL);
+ p->decl = var;
+ p->target = lto_input_tree (ib, data_in);
+
+ /* If the target is a static object, we may have registered a
+ new name for it to avoid clashes between statics coming from
+ different files. In that case, use the new name. */
+ orig_name = IDENTIFIER_POINTER (p->target);
+ new_name = lto_get_decl_name_mapping (data_in->file_data, orig_name);
+ if (strcmp (orig_name, new_name) != 0)
+ p->target = get_identifier (new_name);
+
+ var = lto_input_tree (ib, data_in);
+ }
+}
+
+
+/* Read the body from DATA for function FN_DECL and fill it in.
+ FILE_DATA are the global decls and types. SECTION_TYPE is either
+ LTO_section_function_body or LTO_section_static_initializer. If
+ section type is LTO_section_function_body, FN must be the decl for
+ that function. */
+
+static void
+lto_read_body (struct lto_file_decl_data *file_data, tree fn_decl,
+ const char *data, enum lto_section_type section_type)
+{
+ const struct lto_function_header *header;
+ struct data_in *data_in;
+ int32_t cfg_offset;
+ int32_t main_offset;
+ int32_t string_offset;
+ struct lto_input_block ib_cfg;
+ struct lto_input_block ib_main;
+
+ header = (const struct lto_function_header *) data;
+ cfg_offset = sizeof (struct lto_function_header);
+ main_offset = cfg_offset + header->cfg_size;
+ string_offset = main_offset + header->main_size;
+
+ LTO_INIT_INPUT_BLOCK (ib_cfg,
+ data + cfg_offset,
+ 0,
+ header->cfg_size);
+
+ LTO_INIT_INPUT_BLOCK (ib_main,
+ data + main_offset,
+ 0,
+ header->main_size);
+
+ data_in = lto_data_in_create (file_data, data + string_offset,
+ header->string_size, NULL);
+
+ /* Make sure the file was generated by the exact same compiler. */
+ lto_check_version (header->lto_header.major_version,
+ header->lto_header.minor_version);
+
+ if (section_type == LTO_section_function_body)
+ {
+ struct function *fn = DECL_STRUCT_FUNCTION (fn_decl);
+ struct lto_in_decl_state *decl_state;
+
+ push_cfun (fn);
+ init_tree_ssa (fn);
+
+ /* Use the function's decl state. */
+ decl_state = lto_get_function_in_decl_state (file_data, fn_decl);
+ gcc_assert (decl_state);
+ file_data->current_decl_state = decl_state;
+
+ input_cfg (&ib_cfg, fn);
+
+ /* Set up the struct function. */
+ input_function (fn_decl, data_in, &ib_main);
+
+ /* We should now be in SSA. */
+ cfun->gimple_df->in_ssa_p = true;
+
+ /* Fill in properties we know hold for the rebuilt CFG. */
+ cfun->curr_properties = PROP_ssa
+ | PROP_cfg
+ | PROP_gimple_any
+ | PROP_gimple_lcf
+ | PROP_gimple_leh
+ | PROP_referenced_vars;
+
+ /* Restore decl state */
+ file_data->current_decl_state = file_data->global_decl_state;
+
+ /* FIXME: ipa_transforms_to_apply holds list of passes that have optimization
+ summaries computed and needs to apply changes. At the moment WHOPR only
+ supports inlining, so we can push it here by hand. In future we need to stream
+ this field into ltrans compilation. This will also need to move the field
+ from struct function into cgraph node where it belongs. */
+ if (flag_ltrans && !cgraph_node (fn_decl)->global.inlined_to)
+ VEC_safe_push (ipa_opt_pass, heap,
+ cfun->ipa_transforms_to_apply,
+ (ipa_opt_pass)&pass_ipa_inline);
+ pop_cfun ();
+ }
+ else
+ {
+ input_alias_pairs (&ib_main, data_in);
+ }
+
+ clear_line_info (data_in);
+ lto_data_in_delete (data_in);
+}
+
+
+/* Read the body of FN_DECL using DATA. FILE_DATA holds the global
+ decls and types. */
+
+void
+lto_input_function_body (struct lto_file_decl_data *file_data,
+ tree fn_decl, const char *data)
+{
+ current_function_decl = fn_decl;
+ lto_read_body (file_data, fn_decl, data, LTO_section_function_body);
+}
+
+
+/* Read in VAR_DECL using DATA. FILE_DATA holds the global decls and
+ types. */
+
+void
+lto_input_constructors_and_inits (struct lto_file_decl_data *file_data,
+ const char *data)
+{
+ lto_read_body (file_data, NULL, data, LTO_section_static_initializer);
+}
+
+
+/* Return the resolution for the decl with index INDEX from DATA_IN. */
+
+static enum ld_plugin_symbol_resolution
+get_resolution (struct data_in *data_in, unsigned index)
+{
+ if (data_in->globals_resolution)
+ {
+ ld_plugin_symbol_resolution_t ret;
+ gcc_assert (index < VEC_length (ld_plugin_symbol_resolution_t,
+ data_in->globals_resolution));
+ ret = VEC_index (ld_plugin_symbol_resolution_t,
+ data_in->globals_resolution,
+ index);
+ gcc_assert (ret != LDPR_UNKNOWN);
+ return ret;
+ }
+ else
+ /* Delay resolution finding until decl merging. */
+ return LDPR_UNKNOWN;
+}
+
+
+/* Unpack all the non-pointer fields of the TS_BASE structure of
+ expression EXPR from bitpack BP. */
+
+static void
+unpack_ts_base_value_fields (struct bitpack_d *bp, tree expr)
+{
+ /* Note that the code for EXPR has already been unpacked to create EXPR in
+ lto_materialize_tree. */
+ if (!TYPE_P (expr))
+ {
+ TREE_SIDE_EFFECTS (expr) = (unsigned) bp_unpack_value (bp, 1);
+ TREE_CONSTANT (expr) = (unsigned) bp_unpack_value (bp, 1);
+ TREE_READONLY (expr) = (unsigned) bp_unpack_value (bp, 1);
+
+ /* TREE_PUBLIC is used on types to indicate that the type
+ has a TYPE_CACHED_VALUES vector. This is not streamed out,
+ so we skip it here. */
+ TREE_PUBLIC (expr) = (unsigned) bp_unpack_value (bp, 1);
+ }
+ TREE_ADDRESSABLE (expr) = (unsigned) bp_unpack_value (bp, 1);
+ TREE_THIS_VOLATILE (expr) = (unsigned) bp_unpack_value (bp, 1);
+ if (DECL_P (expr))
+ DECL_UNSIGNED (expr) = (unsigned) bp_unpack_value (bp, 1);
+ else if (TYPE_P (expr))
+ TYPE_UNSIGNED (expr) = (unsigned) bp_unpack_value (bp, 1);
+ TREE_ASM_WRITTEN (expr) = (unsigned) bp_unpack_value (bp, 1);
+ TREE_NO_WARNING (expr) = (unsigned) bp_unpack_value (bp, 1);
+ TREE_USED (expr) = (unsigned) bp_unpack_value (bp, 1);
+ TREE_NOTHROW (expr) = (unsigned) bp_unpack_value (bp, 1);
+ TREE_STATIC (expr) = (unsigned) bp_unpack_value (bp, 1);
+ TREE_PRIVATE (expr) = (unsigned) bp_unpack_value (bp, 1);
+ TREE_PROTECTED (expr) = (unsigned) bp_unpack_value (bp, 1);
+ TREE_DEPRECATED (expr) = (unsigned) bp_unpack_value (bp, 1);
+ if (TYPE_P (expr))
+ TYPE_SATURATING (expr) = (unsigned) bp_unpack_value (bp, 1);
+ if (TREE_CODE (expr) == SSA_NAME)
+ SSA_NAME_IS_DEFAULT_DEF (expr) = (unsigned) bp_unpack_value (bp, 1);
+}
+
+
+/* Unpack all the non-pointer fields of the TS_REAL_CST structure of
+ expression EXPR from bitpack BP. */
+
+static void
+unpack_ts_real_cst_value_fields (struct bitpack_d *bp, tree expr)
+{
+ unsigned i;
+ REAL_VALUE_TYPE r;
+ REAL_VALUE_TYPE *rp;
+
+ r.cl = (unsigned) bp_unpack_value (bp, 2);
+ r.decimal = (unsigned) bp_unpack_value (bp, 1);
+ r.sign = (unsigned) bp_unpack_value (bp, 1);
+ r.signalling = (unsigned) bp_unpack_value (bp, 1);
+ r.canonical = (unsigned) bp_unpack_value (bp, 1);
+ r.uexp = (unsigned) bp_unpack_value (bp, EXP_BITS);
+ for (i = 0; i < SIGSZ; i++)
+ r.sig[i] = (unsigned long) bp_unpack_value (bp, HOST_BITS_PER_LONG);
+
+ rp = GGC_NEW (REAL_VALUE_TYPE);
+ memcpy (rp, &r, sizeof (REAL_VALUE_TYPE));
+ TREE_REAL_CST_PTR (expr) = rp;
+}
+
+
+/* Unpack all the non-pointer fields of the TS_FIXED_CST structure of
+ expression EXPR from bitpack BP. */
+
+static void
+unpack_ts_fixed_cst_value_fields (struct bitpack_d *bp, tree expr)
+{
+ struct fixed_value fv;
+
+ fv.data.low = (HOST_WIDE_INT) bp_unpack_value (bp, HOST_BITS_PER_WIDE_INT);
+ fv.data.high = (HOST_WIDE_INT) bp_unpack_value (bp, HOST_BITS_PER_WIDE_INT);
+ TREE_FIXED_CST (expr) = fv;
+}
+
+
+/* Unpack all the non-pointer fields of the TS_DECL_COMMON structure
+ of expression EXPR from bitpack BP. */
+
+static void
+unpack_ts_decl_common_value_fields (struct bitpack_d *bp, tree expr)
+{
+ DECL_MODE (expr) = (enum machine_mode) bp_unpack_value (bp, 8);
+ DECL_NONLOCAL (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_VIRTUAL_P (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_IGNORED_P (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_ABSTRACT (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_ARTIFICIAL (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_USER_ALIGN (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_PRESERVE_P (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_DEBUG_EXPR_IS_FROM (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_EXTERNAL (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_GIMPLE_REG_P (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_ALIGN (expr) = (unsigned) bp_unpack_value (bp, HOST_BITS_PER_INT);
+
+ if (TREE_CODE (expr) == LABEL_DECL)
+ {
+ DECL_ERROR_ISSUED (expr) = (unsigned) bp_unpack_value (bp, 1);
+ EH_LANDING_PAD_NR (expr) = (int) bp_unpack_value (bp, HOST_BITS_PER_INT);
+
+ /* Always assume an initial value of -1 for LABEL_DECL_UID to
+ force gimple_set_bb to recreate label_to_block_map. */
+ LABEL_DECL_UID (expr) = -1;
+ }
+
+ if (TREE_CODE (expr) == FIELD_DECL)
+ {
+ unsigned HOST_WIDE_INT off_align;
+ DECL_PACKED (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_NONADDRESSABLE_P (expr) = (unsigned) bp_unpack_value (bp, 1);
+ off_align = (unsigned HOST_WIDE_INT) bp_unpack_value (bp, 8);
+ SET_DECL_OFFSET_ALIGN (expr, off_align);
+ }
+
+ if (TREE_CODE (expr) == RESULT_DECL
+ || TREE_CODE (expr) == PARM_DECL
+ || TREE_CODE (expr) == VAR_DECL)
+ {
+ DECL_BY_REFERENCE (expr) = (unsigned) bp_unpack_value (bp, 1);
+ if (TREE_CODE (expr) == VAR_DECL
+ || TREE_CODE (expr) == PARM_DECL)
+ DECL_HAS_VALUE_EXPR_P (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_RESTRICTED_P (expr) = (unsigned) bp_unpack_value (bp, 1);
+ }
+}
+
+
+/* Unpack all the non-pointer fields of the TS_DECL_WRTL structure
+ of expression EXPR from bitpack BP. */
+
+static void
+unpack_ts_decl_wrtl_value_fields (struct bitpack_d *bp, tree expr)
+{
+ DECL_REGISTER (expr) = (unsigned) bp_unpack_value (bp, 1);
+}
+
+
+/* Unpack all the non-pointer fields of the TS_DECL_WITH_VIS structure
+ of expression EXPR from bitpack BP. */
+
+static void
+unpack_ts_decl_with_vis_value_fields (struct bitpack_d *bp, tree expr)
+{
+ DECL_DEFER_OUTPUT (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_COMMON (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_DLLIMPORT_P (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_WEAK (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_SEEN_IN_BIND_EXPR_P (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_COMDAT (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_VISIBILITY (expr) = (enum symbol_visibility) bp_unpack_value (bp, 2);
+ DECL_VISIBILITY_SPECIFIED (expr) = (unsigned) bp_unpack_value (bp, 1);
+
+ if (TREE_CODE (expr) == VAR_DECL)
+ {
+ DECL_HARD_REGISTER (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_IN_TEXT_SECTION (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_TLS_MODEL (expr) = (enum tls_model) bp_unpack_value (bp, 3);
+ }
+
+ if (VAR_OR_FUNCTION_DECL_P (expr))
+ {
+ priority_type p;
+ p = (priority_type) bp_unpack_value (bp, HOST_BITS_PER_SHORT);
+ SET_DECL_INIT_PRIORITY (expr, p);
+ }
+}
+
+
+/* Unpack all the non-pointer fields of the TS_FUNCTION_DECL structure
+ of expression EXPR from bitpack BP. */
+
+static void
+unpack_ts_function_decl_value_fields (struct bitpack_d *bp, tree expr)
+{
+ DECL_FUNCTION_CODE (expr) = (enum built_in_function) bp_unpack_value (bp, 11);
+ DECL_BUILT_IN_CLASS (expr) = (enum built_in_class) bp_unpack_value (bp, 2);
+ DECL_STATIC_CONSTRUCTOR (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_STATIC_DESTRUCTOR (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_UNINLINABLE (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_POSSIBLY_INLINED (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_IS_NOVOPS (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_IS_RETURNS_TWICE (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_IS_MALLOC (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_IS_OPERATOR_NEW (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_DECLARED_INLINE_P (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_STATIC_CHAIN (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_NO_INLINE_WARNING_P (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (expr)
+ = (unsigned) bp_unpack_value (bp, 1);
+ DECL_NO_LIMIT_STACK (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_DISREGARD_INLINE_LIMITS (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_PURE_P (expr) = (unsigned) bp_unpack_value (bp, 1);
+ DECL_LOOPING_CONST_OR_PURE_P (expr) = (unsigned) bp_unpack_value (bp, 1);
+}
+
+
+/* Unpack all the non-pointer fields of the TS_TYPE structure
+ of expression EXPR from bitpack BP. */
+
+static void
+unpack_ts_type_value_fields (struct bitpack_d *bp, tree expr)
+{
+ enum machine_mode mode;
+
+ TYPE_PRECISION (expr) = (unsigned) bp_unpack_value (bp, 9);
+ mode = (enum machine_mode) bp_unpack_value (bp, 7);
+ SET_TYPE_MODE (expr, mode);
+ TYPE_STRING_FLAG (expr) = (unsigned) bp_unpack_value (bp, 1);
+ TYPE_NO_FORCE_BLK (expr) = (unsigned) bp_unpack_value (bp, 1);
+ TYPE_NEEDS_CONSTRUCTING(expr) = (unsigned) bp_unpack_value (bp, 1);
+ if (TREE_CODE (expr) == UNION_TYPE)
+ TYPE_TRANSPARENT_UNION (expr) = (unsigned) bp_unpack_value (bp, 1);
+ TYPE_PACKED (expr) = (unsigned) bp_unpack_value (bp, 1);
+ TYPE_RESTRICT (expr) = (unsigned) bp_unpack_value (bp, 1);
+ TYPE_CONTAINS_PLACEHOLDER_INTERNAL (expr)
+ = (unsigned) bp_unpack_value (bp, 2);
+ TYPE_USER_ALIGN (expr) = (unsigned) bp_unpack_value (bp, 1);
+ TYPE_READONLY (expr) = (unsigned) bp_unpack_value (bp, 1);
+ TYPE_ALIGN (expr) = (unsigned) bp_unpack_value (bp, HOST_BITS_PER_INT);
+ TYPE_ALIAS_SET (expr) = bp_unpack_value (bp, HOST_BITS_PER_INT);
+}
+
+
+/* Unpack all the non-pointer fields of the TS_BLOCK structure
+ of expression EXPR from bitpack BP. */
+
+static void
+unpack_ts_block_value_fields (struct bitpack_d *bp, tree expr)
+{
+ BLOCK_ABSTRACT (expr) = (unsigned) bp_unpack_value (bp, 1);
+ BLOCK_NUMBER (expr) = (unsigned) bp_unpack_value (bp, 31);
+}
+
+
+/* Unpack all the non-pointer fields in EXPR into a bit pack. */
+
+static void
+unpack_value_fields (struct bitpack_d *bp, tree expr)
+{
+ enum tree_code code;
+
+ code = TREE_CODE (expr);
+
+ /* Note that all these functions are highly sensitive to changes in
+ the types and sizes of each of the fields being packed. */
+ unpack_ts_base_value_fields (bp, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_REAL_CST))
+ unpack_ts_real_cst_value_fields (bp, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_FIXED_CST))
+ unpack_ts_fixed_cst_value_fields (bp, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
+ unpack_ts_decl_common_value_fields (bp, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_DECL_WRTL))
+ unpack_ts_decl_wrtl_value_fields (bp, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_DECL_WITH_VIS))
+ unpack_ts_decl_with_vis_value_fields (bp, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_FUNCTION_DECL))
+ unpack_ts_function_decl_value_fields (bp, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_TYPE))
+ unpack_ts_type_value_fields (bp, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_BLOCK))
+ unpack_ts_block_value_fields (bp, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_SSA_NAME))
+ {
+ /* We only stream the version number of SSA names. */
+ gcc_unreachable ();
+ }
+
+ if (CODE_CONTAINS_STRUCT (code, TS_STATEMENT_LIST))
+ {
+ /* This is only used by GENERIC. */
+ gcc_unreachable ();
+ }
+
+ if (CODE_CONTAINS_STRUCT (code, TS_OMP_CLAUSE))
+ {
+ /* This is only used by High GIMPLE. */
+ gcc_unreachable ();
+ }
+}
+
+
+/* Read a bitpack from input block IB. */
+
+struct bitpack_d *
+lto_input_bitpack (struct lto_input_block *ib)
+{
+ unsigned i, num_words;
+ struct bitpack_d *bp;
+
+ bp = bitpack_create ();
+
+ /* If we are about to read more than a handful of words, something
+ is wrong. This check is overly strict, but it acts as an early
+ warning. No streamed object has hundreds of bits in its fields. */
+ num_words = lto_input_uleb128 (ib);
+ gcc_assert (num_words < 20);
+
+ for (i = 0; i < num_words; i++)
+ {
+ bitpack_word_t w = lto_input_uleb128 (ib);
+ VEC_safe_push (bitpack_word_t, heap, bp->values, w);
+ }
+
+ return bp;
+}
+
+
+/* Materialize a new tree from input block IB using descriptors in
+ DATA_IN. The code for the new tree should match TAG. Store in
+ *IX_P the index into the reader cache where the new tree is stored. */
+
+static tree
+lto_materialize_tree (struct lto_input_block *ib, struct data_in *data_in,
+ enum LTO_tags tag, int *ix_p)
+{
+ struct bitpack_d *bp;
+ enum tree_code code;
+ tree result;
+#ifdef LTO_STREAMER_DEBUG
+ HOST_WIDEST_INT orig_address_in_writer;
+#endif
+ HOST_WIDE_INT ix;
+
+ result = NULL_TREE;
+
+ /* Read the header of the node we are about to create. */
+ ix = lto_input_sleb128 (ib);
+ gcc_assert ((int) ix == ix);
+ *ix_p = (int) ix;
+
+#ifdef LTO_STREAMER_DEBUG
+ /* Read the word representing the memory address for the tree
+ as it was written by the writer. This is useful when
+ debugging differences between the writer and reader. */
+ orig_address_in_writer = lto_input_sleb128 (ib);
+ gcc_assert ((intptr_t) orig_address_in_writer == orig_address_in_writer);
+#endif
+
+ code = lto_tag_to_tree_code (tag);
+
+ /* We should never see an SSA_NAME tree. Only the version numbers of
+ SSA names are ever written out. See input_ssa_names. */
+ gcc_assert (code != SSA_NAME);
+
+ /* Instantiate a new tree using the header data. */
+ if (CODE_CONTAINS_STRUCT (code, TS_STRING))
+ result = input_string_cst (data_in, ib);
+ else if (CODE_CONTAINS_STRUCT (code, TS_IDENTIFIER))
+ result = input_identifier (data_in, ib);
+ else if (CODE_CONTAINS_STRUCT (code, TS_VEC))
+ {
+ HOST_WIDE_INT len = lto_input_sleb128 (ib);
+ result = make_tree_vec (len);
+ }
+ else if (CODE_CONTAINS_STRUCT (code, TS_BINFO))
+ {
+ unsigned HOST_WIDE_INT len = lto_input_uleb128 (ib);
+ result = make_tree_binfo (len);
+ }
+ else
+ {
+ /* All other nodes can be materialized with a raw make_node
+ call. */
+ result = make_node (code);
+ }
+
+#ifdef LTO_STREAMER_DEBUG
+ /* Store the original address of the tree as seen by the writer
+ in RESULT's aux field. This is useful when debugging streaming
+ problems. This way, a debugging session can be started on
+ both writer and reader with a breakpoint using this address
+ value in both. */
+ lto_orig_address_map (result, (intptr_t) orig_address_in_writer);
+#endif
+
+ /* Read the bitpack of non-pointer values from IB. */
+ bp = lto_input_bitpack (ib);
+
+ /* The first word in BP contains the code of the tree that we
+ are about to read. */
+ code = (enum tree_code) bp_unpack_value (bp, 16);
+ lto_tag_check (lto_tree_code_to_tag (code), tag);
+
+ /* Unpack all the value fields from BP. */
+ unpack_value_fields (bp, result);
+ bitpack_delete (bp);
+
+ /* Enter RESULT in the reader cache. This will make RESULT
+ available so that circular references in the rest of the tree
+ structure can be resolved in subsequent calls to lto_input_tree. */
+ lto_streamer_cache_insert_at (data_in->reader_cache, result, ix);
+
+ return result;
+}
+
+
+/* Read a chain of tree nodes from input block IB. DATA_IN contains
+ tables and descriptors for the file being read. */
+
+static tree
+lto_input_chain (struct lto_input_block *ib, struct data_in *data_in)
+{
+ int i, count;
+ tree first, prev, curr;
+
+ first = prev = NULL_TREE;
+ count = lto_input_sleb128 (ib);
+ for (i = 0; i < count; i++)
+ {
+ curr = lto_input_tree (ib, data_in);
+ if (prev)
+ TREE_CHAIN (prev) = curr;
+ else
+ first = curr;
+
+ TREE_CHAIN (curr) = NULL_TREE;
+ prev = curr;
+ }
+
+ return first;
+}
+
+
+/* Read all pointer fields in the TS_COMMON structure of EXPR from input
+ block IB. DATA_IN contains tables and descriptors for the
+ file being read. */
+
+
+static void
+lto_input_ts_common_tree_pointers (struct lto_input_block *ib,
+ struct data_in *data_in, tree expr)
+{
+ TREE_TYPE (expr) = lto_input_tree (ib, data_in);
+}
+
+
+/* Read all pointer fields in the TS_VECTOR structure of EXPR from input
+ block IB. DATA_IN contains tables and descriptors for the
+ file being read. */
+
+static void
+lto_input_ts_vector_tree_pointers (struct lto_input_block *ib,
+ struct data_in *data_in, tree expr)
+{
+ TREE_VECTOR_CST_ELTS (expr) = lto_input_chain (ib, data_in);
+}
+
+
+/* Read all pointer fields in the TS_COMPLEX structure of EXPR from input
+ block IB. DATA_IN contains tables and descriptors for the
+ file being read. */
+
+static void
+lto_input_ts_complex_tree_pointers (struct lto_input_block *ib,
+ struct data_in *data_in, tree expr)
+{
+ TREE_REALPART (expr) = lto_input_tree (ib, data_in);
+ TREE_IMAGPART (expr) = lto_input_tree (ib, data_in);
+}
+
+
+/* Read all pointer fields in the TS_DECL_MINIMAL structure of EXPR
+ from input block IB. DATA_IN contains tables and descriptors for the
+ file being read. */
+
+static void
+lto_input_ts_decl_minimal_tree_pointers (struct lto_input_block *ib,
+ struct data_in *data_in, tree expr)
+{
+ DECL_NAME (expr) = lto_input_tree (ib, data_in);
+ DECL_CONTEXT (expr) = lto_input_tree (ib, data_in);
+ DECL_SOURCE_LOCATION (expr) = lto_input_location (ib, data_in);
+}
+
+
+/* Read all pointer fields in the TS_DECL_COMMON structure of EXPR from
+ input block IB. DATA_IN contains tables and descriptors for the
+ file being read. */
+
+static void
+lto_input_ts_decl_common_tree_pointers (struct lto_input_block *ib,
+ struct data_in *data_in, tree expr)
+{
+ DECL_SIZE (expr) = lto_input_tree (ib, data_in);
+ DECL_SIZE_UNIT (expr) = lto_input_tree (ib, data_in);
+
+ if (TREE_CODE (expr) != FUNCTION_DECL)
+ DECL_INITIAL (expr) = lto_input_tree (ib, data_in);
+
+ DECL_ATTRIBUTES (expr) = lto_input_tree (ib, data_in);
+ DECL_ABSTRACT_ORIGIN (expr) = lto_input_tree (ib, data_in);
+
+ if (TREE_CODE (expr) == PARM_DECL)
+ TREE_CHAIN (expr) = lto_input_chain (ib, data_in);
+}
+
+
+/* Read all pointer fields in the TS_DECL_NON_COMMON structure of
+ EXPR from input block IB. DATA_IN contains tables and descriptors for the
+ file being read. */
+
+static void
+lto_input_ts_decl_non_common_tree_pointers (struct lto_input_block *ib,
+ struct data_in *data_in, tree expr)
+{
+ if (TREE_CODE (expr) == FUNCTION_DECL)
+ {
+ DECL_ARGUMENTS (expr) = lto_input_tree (ib, data_in);
+ DECL_RESULT (expr) = lto_input_tree (ib, data_in);
+ }
+ DECL_VINDEX (expr) = lto_input_tree (ib, data_in);
+}
+
+
+/* Read all pointer fields in the TS_DECL_WITH_VIS structure of EXPR
+ from input block IB. DATA_IN contains tables and descriptors for the
+ file being read. */
+
+static void
+lto_input_ts_decl_with_vis_tree_pointers (struct lto_input_block *ib,
+ struct data_in *data_in, tree expr)
+{
+ tree id;
+
+ id = lto_input_tree (ib, data_in);
+ if (id)
+ {
+ gcc_assert (TREE_CODE (id) == IDENTIFIER_NODE);
+ SET_DECL_ASSEMBLER_NAME (expr, id);
+ }
+
+ DECL_SECTION_NAME (expr) = lto_input_tree (ib, data_in);
+ DECL_COMDAT_GROUP (expr) = lto_input_tree (ib, data_in);
+}
+
+
+/* Read all pointer fields in the TS_FIELD_DECL structure of EXPR from
+ input block IB. DATA_IN contains tables and descriptors for the
+ file being read. */
+
+static void
+lto_input_ts_field_decl_tree_pointers (struct lto_input_block *ib,
+ struct data_in *data_in, tree expr)
+{
+ DECL_FIELD_OFFSET (expr) = lto_input_tree (ib, data_in);
+ DECL_BIT_FIELD_TYPE (expr) = lto_input_tree (ib, data_in);
+ DECL_QUALIFIER (expr) = lto_input_tree (ib, data_in);
+ DECL_FIELD_BIT_OFFSET (expr) = lto_input_tree (ib, data_in);
+ DECL_FCONTEXT (expr) = lto_input_tree (ib, data_in);
+ TREE_CHAIN (expr) = lto_input_chain (ib, data_in);
+}
+
+
+/* Read all pointer fields in the TS_FUNCTION_DECL structure of EXPR
+ from input block IB. DATA_IN contains tables and descriptors for the
+ file being read. */
+
+static void
+lto_input_ts_function_decl_tree_pointers (struct lto_input_block *ib,
+ struct data_in *data_in, tree expr)
+{
+ /* DECL_STRUCT_FUNCTION is handled by lto_input_function. FIXME lto,
+ maybe it should be handled here? */
+ DECL_FUNCTION_PERSONALITY (expr) = lto_input_tree (ib, data_in);
+ DECL_FUNCTION_SPECIFIC_TARGET (expr) = lto_input_tree (ib, data_in);
+ DECL_FUNCTION_SPECIFIC_OPTIMIZATION (expr) = lto_input_tree (ib, data_in);
+}
+
+
+/* Read all pointer fields in the TS_TYPE structure of EXPR from input
+ block IB. DATA_IN contains tables and descriptors for the
+ file being read. */
+
+static void
+lto_input_ts_type_tree_pointers (struct lto_input_block *ib,
+ struct data_in *data_in, tree expr)
+{
+ if (TREE_CODE (expr) == ENUMERAL_TYPE)
+ TYPE_VALUES (expr) = lto_input_tree (ib, data_in);
+ else if (TREE_CODE (expr) == ARRAY_TYPE)
+ TYPE_DOMAIN (expr) = lto_input_tree (ib, data_in);
+ else if (TREE_CODE (expr) == RECORD_TYPE || TREE_CODE (expr) == UNION_TYPE)
+ TYPE_FIELDS (expr) = lto_input_tree (ib, data_in);
+ else if (TREE_CODE (expr) == FUNCTION_TYPE || TREE_CODE (expr) == METHOD_TYPE)
+ TYPE_ARG_TYPES (expr) = lto_input_tree (ib, data_in);
+ else if (TREE_CODE (expr) == VECTOR_TYPE)
+ TYPE_DEBUG_REPRESENTATION_TYPE (expr) = lto_input_tree (ib, data_in);
+
+ TYPE_SIZE (expr) = lto_input_tree (ib, data_in);
+ TYPE_SIZE_UNIT (expr) = lto_input_tree (ib, data_in);
+ TYPE_ATTRIBUTES (expr) = lto_input_tree (ib, data_in);
+ TYPE_NAME (expr) = lto_input_tree (ib, data_in);
+ /* Do not stream TYPE_POINTER_TO or TYPE_REFERENCE_TO nor
+ TYPE_NEXT_PTR_TO or TYPE_NEXT_REF_TO. */
+ if (!POINTER_TYPE_P (expr))
+ TYPE_MINVAL (expr) = lto_input_tree (ib, data_in);
+ TYPE_MAXVAL (expr) = lto_input_tree (ib, data_in);
+ TYPE_MAIN_VARIANT (expr) = lto_input_tree (ib, data_in);
+ /* Do not stream TYPE_NEXT_VARIANT, we reconstruct the variant lists
+ during fixup. */
+ if (RECORD_OR_UNION_TYPE_P (expr))
+ TYPE_BINFO (expr) = lto_input_tree (ib, data_in);
+ TYPE_CONTEXT (expr) = lto_input_tree (ib, data_in);
+ TYPE_CANONICAL (expr) = lto_input_tree (ib, data_in);
+}
+
+
+/* Read all pointer fields in the TS_LIST structure of EXPR from input
+ block IB. DATA_IN contains tables and descriptors for the
+ file being read. */
+
+static void
+lto_input_ts_list_tree_pointers (struct lto_input_block *ib,
+ struct data_in *data_in, tree expr)
+{
+ TREE_PURPOSE (expr) = lto_input_tree (ib, data_in);
+ TREE_VALUE (expr) = lto_input_tree (ib, data_in);
+ TREE_CHAIN (expr) = lto_input_chain (ib, data_in);
+}
+
+
+/* Read all pointer fields in the TS_VEC structure of EXPR from input
+ block IB. DATA_IN contains tables and descriptors for the
+ file being read. */
+
+static void
+lto_input_ts_vec_tree_pointers (struct lto_input_block *ib,
+ struct data_in *data_in, tree expr)
+{
+ int i;
+
+ /* Note that TREE_VEC_LENGTH was read by lto_materialize_tree to
+ instantiate EXPR. */
+ for (i = 0; i < TREE_VEC_LENGTH (expr); i++)
+ TREE_VEC_ELT (expr, i) = lto_input_tree (ib, data_in);
+}
+
+
+/* Read all pointer fields in the TS_EXP structure of EXPR from input
+ block IB. DATA_IN contains tables and descriptors for the
+ file being read. */
+
+
+static void
+lto_input_ts_exp_tree_pointers (struct lto_input_block *ib,
+ struct data_in *data_in, tree expr)
+{
+ int i, length;
+ location_t loc;
+
+ length = lto_input_sleb128 (ib);
+ gcc_assert (length == TREE_OPERAND_LENGTH (expr));
+
+ for (i = 0; i < length; i++)
+ TREE_OPERAND (expr, i) = lto_input_tree (ib, data_in);
+
+ loc = lto_input_location (ib, data_in);
+ SET_EXPR_LOCATION (expr, loc);
+ TREE_BLOCK (expr) = lto_input_tree (ib, data_in);
+}
+
+
+/* Read all pointer fields in the TS_BLOCK structure of EXPR from input
+ block IB. DATA_IN contains tables and descriptors for the
+ file being read. */
+
+static void
+lto_input_ts_block_tree_pointers (struct lto_input_block *ib,
+ struct data_in *data_in, tree expr)
+{
+ unsigned i, len;
+
+ BLOCK_SOURCE_LOCATION (expr) = lto_input_location (ib, data_in);
+ BLOCK_VARS (expr) = lto_input_chain (ib, data_in);
+
+ len = lto_input_uleb128 (ib);
+ for (i = 0; i < len; i++)
+ {
+ tree t = lto_input_tree (ib, data_in);
+ VEC_safe_push (tree, gc, BLOCK_NONLOCALIZED_VARS (expr), t);
+ }
+
+ BLOCK_SUPERCONTEXT (expr) = lto_input_tree (ib, data_in);
+ BLOCK_ABSTRACT_ORIGIN (expr) = lto_input_tree (ib, data_in);
+ BLOCK_FRAGMENT_ORIGIN (expr) = lto_input_tree (ib, data_in);
+ BLOCK_FRAGMENT_CHAIN (expr) = lto_input_tree (ib, data_in);
+ BLOCK_SUBBLOCKS (expr) = lto_input_chain (ib, data_in);
+}
+
+
+/* Read all pointer fields in the TS_BINFO structure of EXPR from input
+ block IB. DATA_IN contains tables and descriptors for the
+ file being read. */
+
+static void
+lto_input_ts_binfo_tree_pointers (struct lto_input_block *ib,
+ struct data_in *data_in, tree expr)
+{
+ unsigned i, len;
+ tree t;
+
+ /* Note that the number of slots in EXPR was read in
+ lto_materialize_tree when instantiating EXPR. However, the
+ vector is empty so we cannot rely on VEC_length to know how many
+ elements to read. So, this list is emitted as a 0-terminated
+ list on the writer side. */
+ do
+ {
+ t = lto_input_tree (ib, data_in);
+ if (t)
+ VEC_quick_push (tree, BINFO_BASE_BINFOS (expr), t);
+ }
+ while (t);
+
+ BINFO_OFFSET (expr) = lto_input_tree (ib, data_in);
+ BINFO_VTABLE (expr) = lto_input_tree (ib, data_in);
+ BINFO_VIRTUALS (expr) = lto_input_tree (ib, data_in);
+ BINFO_VPTR_FIELD (expr) = lto_input_tree (ib, data_in);
+
+ len = lto_input_uleb128 (ib);
+ for (i = 0; i < len; i++)
+ {
+ tree a = lto_input_tree (ib, data_in);
+ VEC_safe_push (tree, gc, BINFO_BASE_ACCESSES (expr), a);
+ }
+
+ BINFO_INHERITANCE_CHAIN (expr) = lto_input_tree (ib, data_in);
+ BINFO_SUBVTT_INDEX (expr) = lto_input_tree (ib, data_in);
+ BINFO_VPTR_INDEX (expr) = lto_input_tree (ib, data_in);
+}
+
+
+/* Read all pointer fields in the TS_CONSTRUCTOR structure of EXPR from
+ input block IB. DATA_IN contains tables and descriptors for the
+ file being read. */
+
+static void
+lto_input_ts_constructor_tree_pointers (struct lto_input_block *ib,
+ struct data_in *data_in, tree expr)
+{
+ unsigned i, len;
+
+ len = lto_input_uleb128 (ib);
+ for (i = 0; i < len; i++)
+ {
+ tree index, value;
+
+ index = lto_input_tree (ib, data_in);
+ value = lto_input_tree (ib, data_in);
+ CONSTRUCTOR_APPEND_ELT (CONSTRUCTOR_ELTS (expr), index, value);
+ }
+}
+
+
+/* Helper for lto_input_tree. Read all pointer fields in EXPR from
+ input block IB. DATA_IN contains tables and descriptors for the
+ file being read. */
+
+static void
+lto_input_tree_pointers (struct lto_input_block *ib, struct data_in *data_in,
+ tree expr)
+{
+ enum tree_code code;
+
+ code = TREE_CODE (expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_COMMON))
+ lto_input_ts_common_tree_pointers (ib, data_in, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_VECTOR))
+ lto_input_ts_vector_tree_pointers (ib, data_in, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_COMPLEX))
+ lto_input_ts_complex_tree_pointers (ib, data_in, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_DECL_MINIMAL))
+ lto_input_ts_decl_minimal_tree_pointers (ib, data_in, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
+ lto_input_ts_decl_common_tree_pointers (ib, data_in, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_DECL_NON_COMMON))
+ lto_input_ts_decl_non_common_tree_pointers (ib, data_in, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_DECL_WITH_VIS))
+ lto_input_ts_decl_with_vis_tree_pointers (ib, data_in, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_FIELD_DECL))
+ lto_input_ts_field_decl_tree_pointers (ib, data_in, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_FUNCTION_DECL))
+ lto_input_ts_function_decl_tree_pointers (ib, data_in, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_TYPE))
+ lto_input_ts_type_tree_pointers (ib, data_in, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_LIST))
+ lto_input_ts_list_tree_pointers (ib, data_in, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_VEC))
+ lto_input_ts_vec_tree_pointers (ib, data_in, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_EXP))
+ lto_input_ts_exp_tree_pointers (ib, data_in, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_SSA_NAME))
+ {
+ /* We only stream the version number of SSA names. */
+ gcc_unreachable ();
+ }
+
+ if (CODE_CONTAINS_STRUCT (code, TS_BLOCK))
+ lto_input_ts_block_tree_pointers (ib, data_in, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_BINFO))
+ lto_input_ts_binfo_tree_pointers (ib, data_in, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_STATEMENT_LIST))
+ {
+ /* This should only appear in GENERIC. */
+ gcc_unreachable ();
+ }
+
+ if (CODE_CONTAINS_STRUCT (code, TS_CONSTRUCTOR))
+ lto_input_ts_constructor_tree_pointers (ib, data_in, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_OMP_CLAUSE))
+ {
+ /* This should only appear in High GIMPLE. */
+ gcc_unreachable ();
+ }
+
+ if (CODE_CONTAINS_STRUCT (code, TS_OPTIMIZATION))
+ {
+ sorry ("optimization options not supported yet");
+ }
+
+ if (CODE_CONTAINS_STRUCT (code, TS_TARGET_OPTION))
+ {
+ sorry ("target optimization options not supported yet");
+ }
+}
+
+
+/* Register DECL with the global symbol table and change its
+ name if necessary to avoid name clashes for static globals across
+ different files. */
+
+static void
+lto_register_var_decl_in_symtab (struct data_in *data_in, tree decl)
+{
+ /* Register symbols with file or global scope to mark what input
+ file has their definition. */
+ if (decl_function_context (decl) == NULL_TREE)
+ {
+ /* Variable has file scope, not local. Need to ensure static variables
+ between different files don't clash unexpectedly. */
+ if (!TREE_PUBLIC (decl))
+ {
+ /* ??? We normally pre-mangle names before we serialize them
+ out. Here, in lto1, we do not know the language, and
+ thus cannot do the mangling again. Instead, we just
+ append a suffix to the mangled name. The resulting name,
+ however, is not a properly-formed mangled name, and will
+ confuse any attempt to unmangle it. */
+ const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
+ char *label;
+
+ ASM_FORMAT_PRIVATE_NAME (label, name, DECL_UID (decl));
+ SET_DECL_ASSEMBLER_NAME (decl, get_identifier (label));
+ rest_of_decl_compilation (decl, 1, 0);
+ }
+ }
+
+ /* If this variable has already been declared, queue the
+ declaration for merging. */
+ if (TREE_PUBLIC (decl))
+ {
+ int ix;
+ if (!lto_streamer_cache_lookup (data_in->reader_cache, decl, &ix))
+ gcc_unreachable ();
+ lto_symtab_register_decl (decl, get_resolution (data_in, ix),
+ data_in->file_data);
+ }
+}
+
+
+
+/* Register DECL with the global symbol table and change its
+ name if necessary to avoid name clashes for static globals across
+ different files. DATA_IN contains descriptors and tables for the
+ file being read. */
+
+static void
+lto_register_function_decl_in_symtab (struct data_in *data_in, tree decl)
+{
+ /* Need to ensure static entities between different files
+ don't clash unexpectedly. */
+ if (!TREE_PUBLIC (decl))
+ {
+ /* We must not use the DECL_ASSEMBLER_NAME macro here, as it
+ may set the assembler name where it was previously empty. */
+ tree old_assembler_name = decl->decl_with_vis.assembler_name;
+
+ /* FIXME lto: We normally pre-mangle names before we serialize
+ them out. Here, in lto1, we do not know the language, and
+ thus cannot do the mangling again. Instead, we just append a
+ suffix to the mangled name. The resulting name, however, is
+ not a properly-formed mangled name, and will confuse any
+ attempt to unmangle it. */
+ const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
+ char *label;
+
+ ASM_FORMAT_PRIVATE_NAME (label, name, DECL_UID (decl));
+ SET_DECL_ASSEMBLER_NAME (decl, get_identifier (label));
+
+ /* We may arrive here with the old assembler name not set
+ if the function body is not needed, e.g., it has been
+ inlined away and does not appear in the cgraph. */
+ if (old_assembler_name)
+ {
+ tree new_assembler_name = DECL_ASSEMBLER_NAME (decl);
+
+ /* Make the original assembler name available for later use.
+ We may have used it to indicate the section within its
+ object file where the function body may be found.
+ FIXME lto: Find a better way to maintain the function decl
+ to body section mapping so we don't need this hack. */
+ lto_record_renamed_decl (data_in->file_data,
+ IDENTIFIER_POINTER (old_assembler_name),
+ IDENTIFIER_POINTER (new_assembler_name));
+
+ /* Also register the reverse mapping so that we can find the
+ new name given to an existing assembler name (used when
+ restoring alias pairs in input_constructors_or_inits. */
+ lto_record_renamed_decl (data_in->file_data,
+ IDENTIFIER_POINTER (new_assembler_name),
+ IDENTIFIER_POINTER (old_assembler_name));
+ }
+ }
+
+ /* If this variable has already been declared, queue the
+ declaration for merging. */
+ if (TREE_PUBLIC (decl) && !DECL_ABSTRACT (decl))
+ {
+ int ix;
+ if (!lto_streamer_cache_lookup (data_in->reader_cache, decl, &ix))
+ gcc_unreachable ();
+ lto_symtab_register_decl (decl, get_resolution (data_in, ix),
+ data_in->file_data);
+ }
+}
+
+
+/* Read an index IX from input block IB and return the tree node at
+ DATA_IN->FILE_DATA->GLOBALS_INDEX[IX]. */
+
+static tree
+lto_get_pickled_tree (struct lto_input_block *ib, struct data_in *data_in)
+{
+ HOST_WIDE_INT ix;
+ tree result;
+ enum LTO_tags expected_tag;
+ unsigned HOST_WIDE_INT orig_offset;
+
+ ix = lto_input_sleb128 (ib);
+ expected_tag = (enum LTO_tags) lto_input_uleb128 (ib);
+
+ orig_offset = lto_input_uleb128 (ib);
+ gcc_assert (orig_offset == (unsigned) orig_offset);
+
+ result = lto_streamer_cache_get (data_in->reader_cache, ix);
+ if (result == NULL_TREE)
+ {
+ /* We have not yet read the cache slot IX. Go to the offset
+ in the stream where the physical tree node is, and materialize
+ it from there. */
+ struct lto_input_block fwd_ib;
+
+ /* If we are trying to go back in the stream, something is wrong.
+ We should've read the node at the earlier position already. */
+ if (ib->p >= orig_offset)
+ internal_error ("bytecode stream: tried to jump backwards in the "
+ "stream");
+
+ LTO_INIT_INPUT_BLOCK (fwd_ib, ib->data, orig_offset, ib->len);
+ result = lto_input_tree (&fwd_ib, data_in);
+ }
+
+ gcc_assert (result
+ && TREE_CODE (result) == lto_tag_to_tree_code (expected_tag));
+
+ return result;
+}
+
+
+/* Read a code and class from input block IB and return the
+ corresponding builtin. DATA_IN is as in lto_input_tree. */
+
+static tree
+lto_get_builtin_tree (struct lto_input_block *ib, struct data_in *data_in)
+{
+ enum built_in_class fclass;
+ enum built_in_function fcode;
+ const char *asmname;
+ tree result;
+ int ix;
+
+ fclass = (enum built_in_class) lto_input_uleb128 (ib);
+ gcc_assert (fclass == BUILT_IN_NORMAL || fclass == BUILT_IN_MD);
+
+ fcode = (enum built_in_function) lto_input_uleb128 (ib);
+
+ ix = lto_input_sleb128 (ib);
+ gcc_assert (ix == (int) ix);
+
+ if (fclass == BUILT_IN_NORMAL)
+ {
+ gcc_assert (fcode < END_BUILTINS);
+ result = built_in_decls[fcode];
+ gcc_assert (result);
+ }
+ else if (fclass == BUILT_IN_MD)
+ {
+ result = targetm.builtin_decl (fcode, true);
+ if (!result || result == error_mark_node)
+ fatal_error ("target specific builtin not available");
+ }
+
+ asmname = input_string (data_in, ib);
+ if (asmname)
+ set_builtin_user_assembler_name (result, asmname);
+
+ lto_streamer_cache_insert_at (data_in->reader_cache, result, ix);
+
+ return result;
+}
+
+
+/* Read the physical representation of a tree node with tag TAG from
+ input block IB using the per-file context in DATA_IN. */
+
+static tree
+lto_read_tree (struct lto_input_block *ib, struct data_in *data_in,
+ enum LTO_tags tag)
+{
+ tree result;
+ char end_marker;
+ int ix;
+
+ result = lto_materialize_tree (ib, data_in, tag, &ix);
+
+ /* Read all the pointer fields in RESULT. */
+ lto_input_tree_pointers (ib, data_in, result);
+
+ /* We should never try to instantiate an MD or NORMAL builtin here. */
+ if (TREE_CODE (result) == FUNCTION_DECL)
+ gcc_assert (!lto_stream_as_builtin_p (result));
+
+ if (TREE_CODE (result) == VAR_DECL)
+ lto_register_var_decl_in_symtab (data_in, result);
+ else if (TREE_CODE (result) == FUNCTION_DECL && !DECL_BUILT_IN (result))
+ lto_register_function_decl_in_symtab (data_in, result);
+
+ end_marker = lto_input_1_unsigned (ib);
+
+#ifdef LTO_STREAMER_DEBUG
+ /* Remove the mapping to RESULT's original address set by
+ lto_materialize_tree. */
+ lto_orig_address_remove (result);
+#endif
+
+ return result;
+}
+
+
+/* Read and INTEGER_CST node from input block IB using the per-file
+ context in DATA_IN. */
+
+static tree
+lto_input_integer_cst (struct lto_input_block *ib, struct data_in *data_in)
+{
+ tree result, type;
+ HOST_WIDE_INT low, high;
+ bool overflow_p;
+
+ type = lto_input_tree (ib, data_in);
+ overflow_p = (lto_input_1_unsigned (ib) != 0);
+ low = lto_input_uleb128 (ib);
+ high = lto_input_uleb128 (ib);
+ result = build_int_cst_wide (type, low, high);
+
+ /* If the original constant had overflown, build a replica of RESULT to
+ avoid modifying the shared constant returned by build_int_cst_wide. */
+ if (overflow_p)
+ {
+ result = copy_node (result);
+ TREE_OVERFLOW (result) = 1;
+ }
+
+ return result;
+}
+
+
+/* Read a tree from input block IB using the per-file context in
+ DATA_IN. This context is used, for example, to resolve references
+ to previously read nodes. */
+
+tree
+lto_input_tree (struct lto_input_block *ib, struct data_in *data_in)
+{
+ enum LTO_tags tag;
+ tree result;
+
+ tag = input_record_start (ib);
+ gcc_assert ((unsigned) tag < (unsigned) LTO_NUM_TAGS);
+
+ if (tag == LTO_null)
+ result = NULL_TREE;
+ else if (tag >= LTO_field_decl_ref && tag <= LTO_global_decl_ref)
+ {
+ /* If TAG is a reference to an indexable tree, the next value
+ in IB is the index into the table where we expect to find
+ that tree. */
+ result = lto_input_tree_ref (ib, data_in, cfun, tag);
+ }
+ else if (tag == LTO_tree_pickle_reference)
+ {
+ /* If TAG is a reference to a previously read tree, look it up in
+ the reader cache. */
+ result = lto_get_pickled_tree (ib, data_in);
+ }
+ else if (tag == LTO_builtin_decl)
+ {
+ /* If we are going to read a built-in function, all we need is
+ the code and class. */
+ result = lto_get_builtin_tree (ib, data_in);
+ }
+ else if (tag == lto_tree_code_to_tag (INTEGER_CST))
+ {
+ /* For integer constants we only need the type and its hi/low
+ words. */
+ result = lto_input_integer_cst (ib, data_in);
+ }
+ else
+ {
+ /* Otherwise, materialize a new node from IB. */
+ result = lto_read_tree (ib, data_in, tag);
+ }
+
+ return result;
+}
+
+
+/* Initialization for the LTO reader. */
+
+void
+lto_init_reader (void)
+{
+ lto_streamer_init ();
+
+ memset (&lto_stats, 0, sizeof (lto_stats));
+ bitmap_obstack_initialize (NULL);
+
+ file_name_hash_table = htab_create (37, hash_string_slot_node,
+ eq_string_slot_node, free);
+
+ gimple_register_cfg_hooks ();
+}
+
+
+/* Create a new data_in object for FILE_DATA. STRINGS is the string
+ table to use with LEN strings. RESOLUTIONS is the vector of linker
+ resolutions (NULL if not using a linker plugin). */
+
+struct data_in *
+lto_data_in_create (struct lto_file_decl_data *file_data, const char *strings,
+ unsigned len,
+ VEC(ld_plugin_symbol_resolution_t,heap) *resolutions)
+{
+ struct data_in *data_in = XCNEW (struct data_in);
+ data_in->file_data = file_data;
+ data_in->strings = strings;
+ data_in->strings_len = len;
+ data_in->globals_resolution = resolutions;
+ data_in->reader_cache = lto_streamer_cache_create ();
+
+ return data_in;
+}
+
+
+/* Remove DATA_IN. */
+
+void
+lto_data_in_delete (struct data_in *data_in)
+{
+ VEC_free (ld_plugin_symbol_resolution_t, heap, data_in->globals_resolution);
+ lto_streamer_cache_delete (data_in->reader_cache);
+ free (data_in->labels);
+ free (data_in);
+}
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
new file mode 100644
index 00000000000..1ed1939b2b2
--- /dev/null
+++ b/gcc/lto-streamer-out.c
@@ -0,0 +1,2551 @@
+/* Write the GIMPLE representation to a file stream.
+
+ Copyright 2009 Free Software Foundation, Inc.
+ Contributed by Kenneth Zadeck <zadeck@naturalbridge.com>
+ Re-implemented by Diego Novillo <dnovillo@google.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "toplev.h"
+#include "tree.h"
+#include "expr.h"
+#include "flags.h"
+#include "params.h"
+#include "input.h"
+#include "varray.h"
+#include "hashtab.h"
+#include "basic-block.h"
+#include "tree-flow.h"
+#include "tree-pass.h"
+#include "cgraph.h"
+#include "function.h"
+#include "ggc.h"
+#include "diagnostic.h"
+#include "except.h"
+#include "vec.h"
+#include "lto-symtab.h"
+#include "lto-streamer.h"
+
+
+struct string_slot
+{
+ const char *s;
+ int len;
+ unsigned int slot_num;
+};
+
+
+/* Returns a hash code for P. */
+
+static hashval_t
+hash_string_slot_node (const void *p)
+{
+ const struct string_slot *ds = (const struct string_slot *) p;
+ return (hashval_t) htab_hash_string (ds->s);
+}
+
+
+/* Returns nonzero if P1 and P2 are equal. */
+
+static int
+eq_string_slot_node (const void *p1, const void *p2)
+{
+ const struct string_slot *ds1 = (const struct string_slot *) p1;
+ const struct string_slot *ds2 = (const struct string_slot *) p2;
+
+ if (ds1->len == ds2->len)
+ {
+ int i;
+ for (i = 0; i < ds1->len; i++)
+ if (ds1->s[i] != ds2->s[i])
+ return 0;
+ return 1;
+ }
+
+ return 0;
+}
+
+
+/* Free the string slot pointed-to by P. */
+
+static void
+string_slot_free (void *p)
+{
+ struct string_slot *slot = (struct string_slot *) p;
+ free (CONST_CAST (void *, (const void *) slot->s));
+ free (slot);
+}
+
+
+/* Clear the line info stored in DATA_IN. */
+
+static void
+clear_line_info (struct output_block *ob)
+{
+ ob->current_file = NULL;
+ ob->current_line = 0;
+ ob->current_col = 0;
+}
+
+
+/* Create the output block and return it. SECTION_TYPE is
+ LTO_section_function_body or LTO_static_initializer. */
+
+struct output_block *
+create_output_block (enum lto_section_type section_type)
+{
+ struct output_block *ob = XCNEW (struct output_block);
+
+ ob->section_type = section_type;
+ ob->decl_state = lto_get_out_decl_state ();
+ ob->main_stream = XCNEW (struct lto_output_stream);
+ ob->string_stream = XCNEW (struct lto_output_stream);
+ ob->writer_cache = lto_streamer_cache_create ();
+
+ if (section_type == LTO_section_function_body)
+ ob->cfg_stream = XCNEW (struct lto_output_stream);
+
+ clear_line_info (ob);
+
+ ob->string_hash_table = htab_create (37, hash_string_slot_node,
+ eq_string_slot_node, string_slot_free);
+
+ return ob;
+}
+
+
+/* Destroy the output block OB. */
+
+void
+destroy_output_block (struct output_block *ob)
+{
+ enum lto_section_type section_type = ob->section_type;
+
+ htab_delete (ob->string_hash_table);
+
+ free (ob->main_stream);
+ free (ob->string_stream);
+ if (section_type == LTO_section_function_body)
+ free (ob->cfg_stream);
+
+ lto_streamer_cache_delete (ob->writer_cache);
+
+ free (ob);
+}
+
+
+/* Output bitpack BP to output stream S. */
+
+void
+lto_output_bitpack (struct lto_output_stream *s, struct bitpack_d *bp)
+{
+ unsigned i;
+ bitpack_word_t v;
+
+ lto_output_uleb128_stream (s, VEC_length (bitpack_word_t, bp->values));
+ for (i = 0; VEC_iterate (bitpack_word_t, bp->values, i, v); i++)
+ lto_output_uleb128_stream (s, v);
+}
+
+
+/* Output STRING of LEN characters to the string
+ table in OB. The string might or might not include a trailing '\0'.
+ Then put the index onto the INDEX_STREAM. */
+
+static void
+output_string_with_length (struct output_block *ob,
+ struct lto_output_stream *index_stream,
+ const char *s,
+ unsigned int len)
+{
+ struct string_slot **slot;
+ struct string_slot s_slot;
+ char *string = (char *) xmalloc (len + 1);
+ memcpy (string, s, len);
+ string[len] = '\0';
+
+ s_slot.s = string;
+ s_slot.len = len;
+ s_slot.slot_num = 0;
+
+ slot = (struct string_slot **) htab_find_slot (ob->string_hash_table,
+ &s_slot, INSERT);
+ if (*slot == NULL)
+ {
+ struct lto_output_stream *string_stream = ob->string_stream;
+ unsigned int start = string_stream->total_size;
+ struct string_slot *new_slot
+ = (struct string_slot *) xmalloc (sizeof (struct string_slot));
+ unsigned int i;
+
+ new_slot->s = string;
+ new_slot->len = len;
+ new_slot->slot_num = start;
+ *slot = new_slot;
+ lto_output_uleb128_stream (index_stream, start);
+ lto_output_uleb128_stream (string_stream, len);
+ for (i = 0; i < len; i++)
+ lto_output_1_stream (string_stream, string[i]);
+ }
+ else
+ {
+ struct string_slot *old_slot = (struct string_slot *)*slot;
+ lto_output_uleb128_stream (index_stream, old_slot->slot_num);
+ free (string);
+ }
+}
+
+/* Output the '\0' terminated STRING to the string
+ table in OB. Then put the index onto the INDEX_STREAM. */
+
+static void
+output_string (struct output_block *ob,
+ struct lto_output_stream *index_stream,
+ const char *string)
+{
+ if (string)
+ {
+ lto_output_uleb128_stream (index_stream, 0);
+ output_string_with_length (ob, index_stream, string, strlen (string) + 1);
+ }
+ else
+ lto_output_uleb128_stream (index_stream, 1);
+}
+
+
+/* Output the STRING constant to the string
+ table in OB. Then put the index onto the INDEX_STREAM. */
+
+static void
+output_string_cst (struct output_block *ob,
+ struct lto_output_stream *index_stream,
+ tree string)
+{
+ if (string)
+ {
+ lto_output_uleb128_stream (index_stream, 0);
+ output_string_with_length (ob, index_stream,
+ TREE_STRING_POINTER (string),
+ TREE_STRING_LENGTH (string));
+ }
+ else
+ lto_output_uleb128_stream (index_stream, 1);
+}
+
+
+/* Output the identifier ID to the string
+ table in OB. Then put the index onto the INDEX_STREAM. */
+
+static void
+output_identifier (struct output_block *ob,
+ struct lto_output_stream *index_stream,
+ tree id)
+{
+ if (id)
+ {
+ lto_output_uleb128_stream (index_stream, 0);
+ output_string_with_length (ob, index_stream,
+ IDENTIFIER_POINTER (id),
+ IDENTIFIER_LENGTH (id));
+ }
+ else
+ lto_output_uleb128_stream (index_stream, 1);
+}
+
+/* Write a zero to the output stream. */
+
+static void
+output_zero (struct output_block *ob)
+{
+ lto_output_1_stream (ob->main_stream, 0);
+}
+
+
+/* Output an unsigned LEB128 quantity to OB->main_stream. */
+
+static void
+output_uleb128 (struct output_block *ob, unsigned HOST_WIDE_INT work)
+{
+ lto_output_uleb128_stream (ob->main_stream, work);
+}
+
+
+/* Output a signed LEB128 quantity to OB->main_stream. */
+
+static void
+output_sleb128 (struct output_block *ob, HOST_WIDE_INT work)
+{
+ lto_output_sleb128_stream (ob->main_stream, work);
+}
+
+
+/* Output the start of a record with TAG to output block OB. */
+
+static void
+output_record_start (struct output_block *ob, enum LTO_tags tag)
+{
+ /* Make sure TAG fits inside an unsigned int. */
+ gcc_assert (tag == (enum LTO_tags) (unsigned) tag);
+ output_uleb128 (ob, tag);
+}
+
+
+/* Look up NODE in the type table and write the index for it to OB. */
+
+static void
+output_type_ref (struct output_block *ob, tree node)
+{
+ output_record_start (ob, LTO_type_ref);
+ lto_output_type_ref_index (ob->decl_state, ob->main_stream, node);
+}
+
+
+/* Pack all the non-pointer fields of the TS_BASE structure of
+ expression EXPR into bitpack BP. */
+
+static void
+pack_ts_base_value_fields (struct bitpack_d *bp, tree expr)
+{
+ bp_pack_value (bp, TREE_CODE (expr), 16);
+ if (!TYPE_P (expr))
+ {
+ bp_pack_value (bp, TREE_SIDE_EFFECTS (expr), 1);
+ bp_pack_value (bp, TREE_CONSTANT (expr), 1);
+ bp_pack_value (bp, TREE_READONLY (expr), 1);
+
+ /* TREE_PUBLIC is used on types to indicate that the type
+ has a TYPE_CACHED_VALUES vector. This is not streamed out,
+ so we skip it here. */
+ bp_pack_value (bp, TREE_PUBLIC (expr), 1);
+ }
+ bp_pack_value (bp, TREE_ADDRESSABLE (expr), 1);
+ bp_pack_value (bp, TREE_THIS_VOLATILE (expr), 1);
+ if (DECL_P (expr))
+ bp_pack_value (bp, DECL_UNSIGNED (expr), 1);
+ else if (TYPE_P (expr))
+ bp_pack_value (bp, TYPE_UNSIGNED (expr), 1);
+ bp_pack_value (bp, TREE_ASM_WRITTEN (expr), 1);
+ bp_pack_value (bp, TREE_NO_WARNING (expr), 1);
+ bp_pack_value (bp, TREE_USED (expr), 1);
+ bp_pack_value (bp, TREE_NOTHROW (expr), 1);
+ bp_pack_value (bp, TREE_STATIC (expr), 1);
+ bp_pack_value (bp, TREE_PRIVATE (expr), 1);
+ bp_pack_value (bp, TREE_PROTECTED (expr), 1);
+ bp_pack_value (bp, TREE_DEPRECATED (expr), 1);
+ if (TYPE_P (expr))
+ bp_pack_value (bp, TYPE_SATURATING (expr), 1);
+ if (TREE_CODE (expr) == SSA_NAME)
+ bp_pack_value (bp, SSA_NAME_IS_DEFAULT_DEF (expr), 1);
+}
+
+
+/* Pack all the non-pointer fields of the TS_REAL_CST structure of
+ expression EXPR into bitpack BP. */
+
+static void
+pack_ts_real_cst_value_fields (struct bitpack_d *bp, tree expr)
+{
+ unsigned i;
+ REAL_VALUE_TYPE r;
+
+ r = TREE_REAL_CST (expr);
+ bp_pack_value (bp, r.cl, 2);
+ bp_pack_value (bp, r.decimal, 1);
+ bp_pack_value (bp, r.sign, 1);
+ bp_pack_value (bp, r.signalling, 1);
+ bp_pack_value (bp, r.canonical, 1);
+ bp_pack_value (bp, r.uexp, EXP_BITS);
+ for (i = 0; i < SIGSZ; i++)
+ bp_pack_value (bp, r.sig[i], HOST_BITS_PER_LONG);
+}
+
+
+/* Pack all the non-pointer fields of the TS_FIXED_CST structure of
+ expression EXPR into bitpack BP. */
+
+static void
+pack_ts_fixed_cst_value_fields (struct bitpack_d *bp, tree expr)
+{
+ struct fixed_value fv = TREE_FIXED_CST (expr);
+ bp_pack_value (bp, fv.data.low, HOST_BITS_PER_WIDE_INT);
+ bp_pack_value (bp, fv.data.high, HOST_BITS_PER_WIDE_INT);
+}
+
+
+/* Pack all the non-pointer fields of the TS_DECL_COMMON structure
+ of expression EXPR into bitpack BP. */
+
+static void
+pack_ts_decl_common_value_fields (struct bitpack_d *bp, tree expr)
+{
+ bp_pack_value (bp, DECL_MODE (expr), 8);
+ bp_pack_value (bp, DECL_NONLOCAL (expr), 1);
+ bp_pack_value (bp, DECL_VIRTUAL_P (expr), 1);
+ bp_pack_value (bp, DECL_IGNORED_P (expr), 1);
+ bp_pack_value (bp, DECL_ABSTRACT (expr), 1);
+ bp_pack_value (bp, DECL_ARTIFICIAL (expr), 1);
+ bp_pack_value (bp, DECL_USER_ALIGN (expr), 1);
+ bp_pack_value (bp, DECL_PRESERVE_P (expr), 1);
+ bp_pack_value (bp, DECL_DEBUG_EXPR_IS_FROM (expr), 1);
+ bp_pack_value (bp, DECL_EXTERNAL (expr), 1);
+ bp_pack_value (bp, DECL_GIMPLE_REG_P (expr), 1);
+ bp_pack_value (bp, DECL_ALIGN (expr), HOST_BITS_PER_INT);
+
+ if (TREE_CODE (expr) == LABEL_DECL)
+ {
+ /* Note that we do not write LABEL_DECL_UID. The reader will
+ always assume an initial value of -1 so that the
+ label_to_block_map is recreated by gimple_set_bb. */
+ bp_pack_value (bp, DECL_ERROR_ISSUED (expr), 1);
+ bp_pack_value (bp, EH_LANDING_PAD_NR (expr), HOST_BITS_PER_INT);
+ }
+
+ if (TREE_CODE (expr) == FIELD_DECL)
+ {
+ bp_pack_value (bp, DECL_PACKED (expr), 1);
+ bp_pack_value (bp, DECL_NONADDRESSABLE_P (expr), 1);
+ bp_pack_value (bp, DECL_OFFSET_ALIGN (expr), 8);
+ }
+
+ if (TREE_CODE (expr) == RESULT_DECL
+ || TREE_CODE (expr) == PARM_DECL
+ || TREE_CODE (expr) == VAR_DECL)
+ {
+ bp_pack_value (bp, DECL_BY_REFERENCE (expr), 1);
+ if (TREE_CODE (expr) == VAR_DECL
+ || TREE_CODE (expr) == PARM_DECL)
+ bp_pack_value (bp, DECL_HAS_VALUE_EXPR_P (expr), 1);
+ bp_pack_value (bp, DECL_RESTRICTED_P (expr), 1);
+ }
+}
+
+
+/* Pack all the non-pointer fields of the TS_DECL_WRTL structure
+ of expression EXPR into bitpack BP. */
+
+static void
+pack_ts_decl_wrtl_value_fields (struct bitpack_d *bp, tree expr)
+{
+ bp_pack_value (bp, DECL_REGISTER (expr), 1);
+}
+
+
+/* Pack all the non-pointer fields of the TS_DECL_WITH_VIS structure
+ of expression EXPR into bitpack BP. */
+
+static void
+pack_ts_decl_with_vis_value_fields (struct bitpack_d *bp, tree expr)
+{
+ bp_pack_value (bp, DECL_DEFER_OUTPUT (expr), 1);
+ bp_pack_value (bp, DECL_COMMON (expr), 1);
+ bp_pack_value (bp, DECL_DLLIMPORT_P (expr), 1);
+ bp_pack_value (bp, DECL_WEAK (expr), 1);
+ bp_pack_value (bp, DECL_SEEN_IN_BIND_EXPR_P (expr), 1);
+ bp_pack_value (bp, DECL_COMDAT (expr), 1);
+ bp_pack_value (bp, DECL_VISIBILITY (expr), 2);
+ bp_pack_value (bp, DECL_VISIBILITY_SPECIFIED (expr), 1);
+
+ if (TREE_CODE (expr) == VAR_DECL)
+ {
+ bp_pack_value (bp, DECL_HARD_REGISTER (expr), 1);
+ bp_pack_value (bp, DECL_IN_TEXT_SECTION (expr), 1);
+ bp_pack_value (bp, DECL_TLS_MODEL (expr), 3);
+ }
+
+ if (VAR_OR_FUNCTION_DECL_P (expr))
+ bp_pack_value (bp, DECL_INIT_PRIORITY (expr), HOST_BITS_PER_SHORT);
+}
+
+
+/* Pack all the non-pointer fields of the TS_FUNCTION_DECL structure
+ of expression EXPR into bitpack BP. */
+
+static void
+pack_ts_function_decl_value_fields (struct bitpack_d *bp, tree expr)
+{
+ /* For normal/md builtins we only write the class and code, so they
+ should never be handled here. */
+ gcc_assert (!lto_stream_as_builtin_p (expr));
+
+ bp_pack_value (bp, DECL_FUNCTION_CODE (expr), 11);
+ bp_pack_value (bp, DECL_BUILT_IN_CLASS (expr), 2);
+ bp_pack_value (bp, DECL_STATIC_CONSTRUCTOR (expr), 1);
+ bp_pack_value (bp, DECL_STATIC_DESTRUCTOR (expr), 1);
+ bp_pack_value (bp, DECL_UNINLINABLE (expr), 1);
+ bp_pack_value (bp, DECL_POSSIBLY_INLINED (expr), 1);
+ bp_pack_value (bp, DECL_IS_NOVOPS (expr), 1);
+ bp_pack_value (bp, DECL_IS_RETURNS_TWICE (expr), 1);
+ bp_pack_value (bp, DECL_IS_MALLOC (expr), 1);
+ bp_pack_value (bp, DECL_IS_OPERATOR_NEW (expr), 1);
+ bp_pack_value (bp, DECL_DECLARED_INLINE_P (expr), 1);
+ bp_pack_value (bp, DECL_STATIC_CHAIN (expr), 1);
+ bp_pack_value (bp, DECL_NO_INLINE_WARNING_P (expr), 1);
+ bp_pack_value (bp, DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (expr), 1);
+ bp_pack_value (bp, DECL_NO_LIMIT_STACK (expr), 1);
+ bp_pack_value (bp, DECL_DISREGARD_INLINE_LIMITS (expr), 1);
+ bp_pack_value (bp, DECL_PURE_P (expr), 1);
+ bp_pack_value (bp, DECL_LOOPING_CONST_OR_PURE_P (expr), 1);
+}
+
+
+/* Pack all the non-pointer fields of the TS_TYPE structure
+ of expression EXPR into bitpack BP. */
+
+static void
+pack_ts_type_value_fields (struct bitpack_d *bp, tree expr)
+{
+ bp_pack_value (bp, TYPE_PRECISION (expr), 9);
+ bp_pack_value (bp, TYPE_MODE (expr), 7);
+ bp_pack_value (bp, TYPE_STRING_FLAG (expr), 1);
+ bp_pack_value (bp, TYPE_NO_FORCE_BLK (expr), 1);
+ bp_pack_value (bp, TYPE_NEEDS_CONSTRUCTING(expr), 1);
+ if (TREE_CODE (expr) == UNION_TYPE)
+ bp_pack_value (bp, TYPE_TRANSPARENT_UNION (expr), 1);
+ bp_pack_value (bp, TYPE_PACKED (expr), 1);
+ bp_pack_value (bp, TYPE_RESTRICT (expr), 1);
+ bp_pack_value (bp, TYPE_CONTAINS_PLACEHOLDER_INTERNAL (expr), 2);
+ bp_pack_value (bp, TYPE_USER_ALIGN (expr), 1);
+ bp_pack_value (bp, TYPE_READONLY (expr), 1);
+ bp_pack_value (bp, TYPE_ALIGN (expr), HOST_BITS_PER_INT);
+ bp_pack_value (bp, TYPE_ALIAS_SET (expr) == 0 ? 0 : -1, HOST_BITS_PER_INT);
+}
+
+
+/* Pack all the non-pointer fields of the TS_BLOCK structure
+ of expression EXPR into bitpack BP. */
+
+static void
+pack_ts_block_value_fields (struct bitpack_d *bp, tree expr)
+{
+ bp_pack_value (bp, BLOCK_ABSTRACT (expr), 1);
+ bp_pack_value (bp, BLOCK_NUMBER (expr), 31);
+}
+
+
+/* Pack all the non-pointer fields in EXPR into a bit pack. */
+
+static struct bitpack_d *
+pack_value_fields (tree expr)
+{
+ enum tree_code code;
+ struct bitpack_d *bp;
+
+ code = TREE_CODE (expr);
+ bp = bitpack_create ();
+
+ /* Note that all these functions are highly sensitive to changes in
+ the types and sizes of each of the fields being packed. */
+ pack_ts_base_value_fields (bp, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_REAL_CST))
+ pack_ts_real_cst_value_fields (bp, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_FIXED_CST))
+ pack_ts_fixed_cst_value_fields (bp, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
+ pack_ts_decl_common_value_fields (bp, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_DECL_WRTL))
+ pack_ts_decl_wrtl_value_fields (bp, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_DECL_WITH_VIS))
+ pack_ts_decl_with_vis_value_fields (bp, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_FUNCTION_DECL))
+ pack_ts_function_decl_value_fields (bp, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_TYPE))
+ pack_ts_type_value_fields (bp, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_BLOCK))
+ pack_ts_block_value_fields (bp, expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_SSA_NAME))
+ {
+ /* We only stream the version number of SSA names. */
+ gcc_unreachable ();
+ }
+
+ if (CODE_CONTAINS_STRUCT (code, TS_STATEMENT_LIST))
+ {
+ /* This is only used by GENERIC. */
+ gcc_unreachable ();
+ }
+
+ if (CODE_CONTAINS_STRUCT (code, TS_OMP_CLAUSE))
+ {
+ /* This is only used by High GIMPLE. */
+ gcc_unreachable ();
+ }
+
+ return bp;
+}
+
+
+/* Emit location LOC to output block OB. */
+
+static void
+lto_output_location (struct output_block *ob, location_t loc)
+{
+ expanded_location xloc;
+
+ if (loc == UNKNOWN_LOCATION)
+ {
+ output_string (ob, ob->main_stream, NULL);
+ return;
+ }
+
+ xloc = expand_location (loc);
+
+ output_string (ob, ob->main_stream, xloc.file);
+ output_sleb128 (ob, xloc.line);
+ output_sleb128 (ob, xloc.column);
+ output_sleb128 (ob, xloc.sysp);
+
+ ob->current_file = xloc.file;
+ ob->current_line = xloc.line;
+ ob->current_col = xloc.column;
+}
+
+
+/* Return true if tree node T is written to various tables. For these
+ nodes, we sometimes want to write their phyiscal representation
+ (via lto_output_tree), and sometimes we need to emit an index
+ reference into a table (via lto_output_tree_ref). */
+
+static bool
+tree_is_indexable (tree t)
+{
+ if (TREE_CODE (t) == PARM_DECL)
+ return false;
+ else if (TREE_CODE (t) == VAR_DECL && decl_function_context (t))
+ return false;
+ else
+ return (TYPE_P (t) || DECL_P (t) || TREE_CODE (t) == SSA_NAME);
+}
+
+
+/* If EXPR is an indexable tree node, output a reference to it to
+ output block OB. Otherwise, output the physical representation of
+ EXPR to OB. */
+
+static void
+lto_output_tree_ref (struct output_block *ob, tree expr)
+{
+ enum tree_code code;
+
+ if (expr == NULL_TREE)
+ {
+ output_zero (ob);
+ return;
+ }
+
+ if (!tree_is_indexable (expr))
+ {
+ /* Even though we are emitting the physical representation of
+ EXPR, its leaves must be emitted as references. */
+ lto_output_tree (ob, expr, true);
+ return;
+ }
+
+ if (TYPE_P (expr))
+ {
+ output_type_ref (ob, expr);
+ return;
+ }
+
+ code = TREE_CODE (expr);
+ switch (code)
+ {
+ case SSA_NAME:
+ output_record_start (ob, LTO_ssa_name_ref);
+ output_uleb128 (ob, SSA_NAME_VERSION (expr));
+ break;
+
+ case FIELD_DECL:
+ output_record_start (ob, LTO_field_decl_ref);
+ lto_output_field_decl_index (ob->decl_state, ob->main_stream, expr);
+ break;
+
+ case FUNCTION_DECL:
+ output_record_start (ob, LTO_function_decl_ref);
+ lto_output_fn_decl_index (ob->decl_state, ob->main_stream, expr);
+ break;
+
+ case VAR_DECL:
+ case DEBUG_EXPR_DECL:
+ gcc_assert (decl_function_context (expr) == NULL);
+ output_record_start (ob, LTO_global_decl_ref);
+ lto_output_var_decl_index (ob->decl_state, ob->main_stream, expr);
+ break;
+
+ case CONST_DECL:
+ output_record_start (ob, LTO_const_decl_ref);
+ lto_output_var_decl_index (ob->decl_state, ob->main_stream, expr);
+ break;
+
+ case IMPORTED_DECL:
+ gcc_assert (decl_function_context (expr) == NULL);
+ output_record_start (ob, LTO_imported_decl_ref);
+ lto_output_var_decl_index (ob->decl_state, ob->main_stream, expr);
+ break;
+
+ case TYPE_DECL:
+ output_record_start (ob, LTO_type_decl_ref);
+ lto_output_type_decl_index (ob->decl_state, ob->main_stream, expr);
+ break;
+
+ case NAMESPACE_DECL:
+ output_record_start (ob, LTO_namespace_decl_ref);
+ lto_output_namespace_decl_index (ob->decl_state, ob->main_stream, expr);
+ break;
+
+ case LABEL_DECL:
+ output_record_start (ob, LTO_label_decl_ref);
+ lto_output_var_decl_index (ob->decl_state, ob->main_stream, expr);
+ break;
+
+ case RESULT_DECL:
+ output_record_start (ob, LTO_result_decl_ref);
+ lto_output_var_decl_index (ob->decl_state, ob->main_stream, expr);
+ break;
+
+ default:
+ /* No other node is indexable, so it should have been handled
+ by lto_output_tree. */
+ gcc_unreachable ();
+ }
+}
+
+
+/* If REF_P is true, emit a reference to EXPR in output block OB,
+ otherwise emit the physical representation of EXPR in OB. */
+
+static inline void
+lto_output_tree_or_ref (struct output_block *ob, tree expr, bool ref_p)
+{
+ if (ref_p)
+ lto_output_tree_ref (ob, expr);
+ else
+ lto_output_tree (ob, expr, false);
+}
+
+
+/* Emit the chain of tree nodes starting at T. OB is the output block
+ to write to. REF_P is true if chain elements should be emitted
+ as references. */
+
+static void
+lto_output_chain (struct output_block *ob, tree t, bool ref_p)
+{
+ int i, count;
+
+ count = list_length (t);
+ output_sleb128 (ob, count);
+ for (i = 0; i < count; i++)
+ {
+ tree saved_chain;
+
+ /* Clear TREE_CHAIN to avoid blindly recursing into the rest
+ of the list. */
+ saved_chain = TREE_CHAIN (t);
+ TREE_CHAIN (t) = NULL_TREE;
+
+ lto_output_tree_or_ref (ob, t, ref_p);
+
+ TREE_CHAIN (t) = saved_chain;
+ t = TREE_CHAIN (t);
+ }
+}
+
+
+/* Write all pointer fields in the TS_COMMON structure of EXPR to output
+ block OB. If REF_P is true, write a reference to EXPR's pointer
+ fields. */
+
+static void
+lto_output_ts_common_tree_pointers (struct output_block *ob, tree expr,
+ bool ref_p)
+{
+ lto_output_tree_or_ref (ob, TREE_TYPE (expr), ref_p);
+}
+
+
+/* Write all pointer fields in the TS_VECTOR structure of EXPR to output
+ block OB. If REF_P is true, write a reference to EXPR's pointer
+ fields. */
+
+static void
+lto_output_ts_vector_tree_pointers (struct output_block *ob, tree expr,
+ bool ref_p)
+{
+ lto_output_chain (ob, TREE_VECTOR_CST_ELTS (expr), ref_p);
+}
+
+
+/* Write all pointer fields in the TS_COMPLEX structure of EXPR to output
+ block OB. If REF_P is true, write a reference to EXPR's pointer
+ fields. */
+
+static void
+lto_output_ts_complex_tree_pointers (struct output_block *ob, tree expr,
+ bool ref_p)
+{
+ lto_output_tree_or_ref (ob, TREE_REALPART (expr), ref_p);
+ lto_output_tree_or_ref (ob, TREE_IMAGPART (expr), ref_p);
+}
+
+
+/* Write all pointer fields in the TS_DECL_MINIMAL structure of EXPR
+ to output block OB. If REF_P is true, write a reference to EXPR's
+ pointer fields. */
+
+static void
+lto_output_ts_decl_minimal_tree_pointers (struct output_block *ob, tree expr,
+ bool ref_p)
+{
+ lto_output_tree_or_ref (ob, DECL_NAME (expr), ref_p);
+ lto_output_tree_or_ref (ob, DECL_CONTEXT (expr), ref_p);
+ lto_output_location (ob, DECL_SOURCE_LOCATION (expr));
+}
+
+
+/* Write all pointer fields in the TS_DECL_COMMON structure of EXPR to
+ output block OB. If REF_P is true, write a reference to EXPR's
+ pointer fields. */
+
+static void
+lto_output_ts_decl_common_tree_pointers (struct output_block *ob, tree expr,
+ bool ref_p)
+{
+ lto_output_tree_or_ref (ob, DECL_SIZE (expr), ref_p);
+ lto_output_tree_or_ref (ob, DECL_SIZE_UNIT (expr), ref_p);
+
+ if (TREE_CODE (expr) != FUNCTION_DECL)
+ lto_output_tree_or_ref (ob, DECL_INITIAL (expr), ref_p);
+
+ lto_output_tree_or_ref (ob, DECL_ATTRIBUTES (expr), ref_p);
+ lto_output_tree_or_ref (ob, DECL_ABSTRACT_ORIGIN (expr), ref_p);
+
+ if (TREE_CODE (expr) == PARM_DECL)
+ lto_output_chain (ob, TREE_CHAIN (expr), ref_p);
+}
+
+
+/* Write all pointer fields in the TS_DECL_NON_COMMON structure of
+ EXPR to output block OB. If REF_P is true, write a reference to EXPR's
+ pointer fields. */
+
+static void
+lto_output_ts_decl_non_common_tree_pointers (struct output_block *ob,
+ tree expr, bool ref_p)
+{
+ if (TREE_CODE (expr) == FUNCTION_DECL)
+ {
+ /* DECL_SAVED_TREE holds the GENERIC representation for DECL.
+ At this point, it should not exist. Either because it was
+ converted to gimple or because DECL didn't have a GENERIC
+ representation in this TU. */
+ gcc_assert (DECL_SAVED_TREE (expr) == NULL_TREE);
+ lto_output_tree_or_ref (ob, DECL_ARGUMENTS (expr), ref_p);
+ lto_output_tree_or_ref (ob, DECL_RESULT (expr), ref_p);
+ }
+ lto_output_tree_or_ref (ob, DECL_VINDEX (expr), ref_p);
+}
+
+
+/* Write all pointer fields in the TS_DECL_WITH_VIS structure of EXPR
+ to output block OB. If REF_P is true, write a reference to EXPR's
+ pointer fields. */
+
+static void
+lto_output_ts_decl_with_vis_tree_pointers (struct output_block *ob, tree expr,
+ bool ref_p)
+{
+ /* Make sure we don't inadvertently set the assembler name. */
+ if (DECL_ASSEMBLER_NAME_SET_P (expr))
+ lto_output_tree_or_ref (ob, DECL_ASSEMBLER_NAME (expr), ref_p);
+ else
+ output_zero (ob);
+
+ lto_output_tree_or_ref (ob, DECL_SECTION_NAME (expr), ref_p);
+ lto_output_tree_or_ref (ob, DECL_COMDAT_GROUP (expr), ref_p);
+}
+
+
+/* Write all pointer fields in the TS_FIELD_DECL structure of EXPR to
+ output block OB. If REF_P is true, write a reference to EXPR's
+ pointer fields. */
+
+static void
+lto_output_ts_field_decl_tree_pointers (struct output_block *ob, tree expr,
+ bool ref_p)
+{
+ lto_output_tree_or_ref (ob, DECL_FIELD_OFFSET (expr), ref_p);
+ lto_output_tree_or_ref (ob, DECL_BIT_FIELD_TYPE (expr), ref_p);
+ lto_output_tree_or_ref (ob, DECL_QUALIFIER (expr), ref_p);
+ lto_output_tree_or_ref (ob, DECL_FIELD_BIT_OFFSET (expr), ref_p);
+ lto_output_tree_or_ref (ob, DECL_FCONTEXT (expr), ref_p);
+ lto_output_chain (ob, TREE_CHAIN (expr), ref_p);
+}
+
+
+/* Write all pointer fields in the TS_FUNCTION_DECL structure of EXPR
+ to output block OB. If REF_P is true, write a reference to EXPR's
+ pointer fields. */
+
+static void
+lto_output_ts_function_decl_tree_pointers (struct output_block *ob, tree expr,
+ bool ref_p)
+{
+ /* DECL_STRUCT_FUNCTION is handled by lto_output_function. FIXME lto,
+ maybe it should be handled here? */
+ lto_output_tree_or_ref (ob, DECL_FUNCTION_PERSONALITY (expr), ref_p);
+ lto_output_tree_or_ref (ob, DECL_FUNCTION_SPECIFIC_TARGET (expr), ref_p);
+ lto_output_tree_or_ref (ob, DECL_FUNCTION_SPECIFIC_OPTIMIZATION (expr),
+ ref_p);
+}
+
+
+/* Write all pointer fields in the TS_TYPE structure of EXPR to output
+ block OB. If REF_P is true, write a reference to EXPR's pointer
+ fields. */
+
+static void
+lto_output_ts_type_tree_pointers (struct output_block *ob, tree expr,
+ bool ref_p)
+{
+ if (TREE_CODE (expr) == ENUMERAL_TYPE)
+ lto_output_tree_or_ref (ob, TYPE_VALUES (expr), ref_p);
+ else if (TREE_CODE (expr) == ARRAY_TYPE)
+ lto_output_tree_or_ref (ob, TYPE_DOMAIN (expr), ref_p);
+ else if (TREE_CODE (expr) == RECORD_TYPE || TREE_CODE (expr) == UNION_TYPE)
+ lto_output_tree_or_ref (ob, TYPE_FIELDS (expr), ref_p);
+ else if (TREE_CODE (expr) == FUNCTION_TYPE || TREE_CODE (expr) == METHOD_TYPE)
+ lto_output_tree_or_ref (ob, TYPE_ARG_TYPES (expr), ref_p);
+ else if (TREE_CODE (expr) == VECTOR_TYPE)
+ lto_output_tree_or_ref (ob, TYPE_DEBUG_REPRESENTATION_TYPE (expr), ref_p);
+
+ lto_output_tree_or_ref (ob, TYPE_SIZE (expr), ref_p);
+ lto_output_tree_or_ref (ob, TYPE_SIZE_UNIT (expr), ref_p);
+ lto_output_tree_or_ref (ob, TYPE_ATTRIBUTES (expr), ref_p);
+ lto_output_tree_or_ref (ob, TYPE_NAME (expr), ref_p);
+ /* Do not stream TYPE_POINTER_TO or TYPE_REFERENCE_TO nor
+ TYPE_NEXT_PTR_TO or TYPE_NEXT_REF_TO. */
+ if (!POINTER_TYPE_P (expr))
+ lto_output_tree_or_ref (ob, TYPE_MINVAL (expr), ref_p);
+ lto_output_tree_or_ref (ob, TYPE_MAXVAL (expr), ref_p);
+ lto_output_tree_or_ref (ob, TYPE_MAIN_VARIANT (expr), ref_p);
+ /* Do not stream TYPE_NEXT_VARIANT, we reconstruct the variant lists
+ during fixup. */
+ if (TREE_CODE (expr) == RECORD_TYPE || TREE_CODE (expr) == UNION_TYPE)
+ lto_output_tree_or_ref (ob, TYPE_BINFO (expr), ref_p);
+ lto_output_tree_or_ref (ob, TYPE_CONTEXT (expr), ref_p);
+ lto_output_tree_or_ref (ob, TYPE_CANONICAL (expr), ref_p);
+}
+
+
+/* Write all pointer fields in the TS_LIST structure of EXPR to output
+ block OB. If REF_P is true, write a reference to EXPR's pointer
+ fields. */
+
+static void
+lto_output_ts_list_tree_pointers (struct output_block *ob, tree expr,
+ bool ref_p)
+{
+ lto_output_tree_or_ref (ob, TREE_PURPOSE (expr), ref_p);
+ lto_output_tree_or_ref (ob, TREE_VALUE (expr), ref_p);
+ lto_output_chain (ob, TREE_CHAIN (expr), ref_p);
+}
+
+
+/* Write all pointer fields in the TS_VEC structure of EXPR to output
+ block OB. If REF_P is true, write a reference to EXPR's pointer
+ fields. */
+
+static void
+lto_output_ts_vec_tree_pointers (struct output_block *ob, tree expr, bool ref_p)
+{
+ int i;
+
+ /* Note that the number of slots for EXPR has already been emitted
+ in EXPR's header (see lto_output_tree_header). */
+ for (i = 0; i < TREE_VEC_LENGTH (expr); i++)
+ lto_output_tree_or_ref (ob, TREE_VEC_ELT (expr, i), ref_p);
+}
+
+
+/* Write all pointer fields in the TS_EXP structure of EXPR to output
+ block OB. If REF_P is true, write a reference to EXPR's pointer
+ fields. */
+
+static void
+lto_output_ts_exp_tree_pointers (struct output_block *ob, tree expr, bool ref_p)
+{
+ int i;
+
+ output_sleb128 (ob, TREE_OPERAND_LENGTH (expr));
+ for (i = 0; i < TREE_OPERAND_LENGTH (expr); i++)
+ lto_output_tree_or_ref (ob, TREE_OPERAND (expr, i), ref_p);
+ lto_output_location (ob, EXPR_LOCATION (expr));
+ lto_output_tree_or_ref (ob, TREE_BLOCK (expr), ref_p);
+}
+
+
+/* Write all pointer fields in the TS_BLOCK structure of EXPR to output
+ block OB. If REF_P is true, write a reference to EXPR's pointer
+ fields. */
+
+static void
+lto_output_ts_block_tree_pointers (struct output_block *ob, tree expr,
+ bool ref_p)
+{
+ unsigned i;
+ tree t;
+
+ lto_output_location (ob, BLOCK_SOURCE_LOCATION (expr));
+ lto_output_chain (ob, BLOCK_VARS (expr), ref_p);
+
+ output_uleb128 (ob, VEC_length (tree, BLOCK_NONLOCALIZED_VARS (expr)));
+ for (i = 0; VEC_iterate (tree, BLOCK_NONLOCALIZED_VARS (expr), i, t); i++)
+ lto_output_tree_or_ref (ob, t, ref_p);
+
+ lto_output_tree_or_ref (ob, BLOCK_SUPERCONTEXT (expr), ref_p);
+ lto_output_tree_or_ref (ob, BLOCK_ABSTRACT_ORIGIN (expr), ref_p);
+ lto_output_tree_or_ref (ob, BLOCK_FRAGMENT_ORIGIN (expr), ref_p);
+ lto_output_tree_or_ref (ob, BLOCK_FRAGMENT_CHAIN (expr), ref_p);
+ lto_output_chain (ob, BLOCK_SUBBLOCKS (expr), ref_p);
+}
+
+
+/* Write all pointer fields in the TS_BINFO structure of EXPR to output
+ block OB. If REF_P is true, write a reference to EXPR's pointer
+ fields. */
+
+static void
+lto_output_ts_binfo_tree_pointers (struct output_block *ob, tree expr,
+ bool ref_p)
+{
+ unsigned i;
+ tree t;
+
+ /* Note that the number of BINFO slots has already been emitted in
+ EXPR's header (see lto_output_tree_header) because this length
+ is needed to build the empty BINFO node on the reader side. */
+ for (i = 0; VEC_iterate (tree, BINFO_BASE_BINFOS (expr), i, t); i++)
+ lto_output_tree_or_ref (ob, t, ref_p);
+ output_zero (ob);
+
+ lto_output_tree_or_ref (ob, BINFO_OFFSET (expr), ref_p);
+ lto_output_tree_or_ref (ob, BINFO_VTABLE (expr), ref_p);
+ lto_output_tree_or_ref (ob, BINFO_VIRTUALS (expr), ref_p);
+ lto_output_tree_or_ref (ob, BINFO_VPTR_FIELD (expr), ref_p);
+
+ output_uleb128 (ob, VEC_length (tree, BINFO_BASE_ACCESSES (expr)));
+ for (i = 0; VEC_iterate (tree, BINFO_BASE_ACCESSES (expr), i, t); i++)
+ lto_output_tree_or_ref (ob, t, ref_p);
+
+ lto_output_tree_or_ref (ob, BINFO_INHERITANCE_CHAIN (expr), ref_p);
+ lto_output_tree_or_ref (ob, BINFO_SUBVTT_INDEX (expr), ref_p);
+ lto_output_tree_or_ref (ob, BINFO_VPTR_INDEX (expr), ref_p);
+}
+
+
+/* Write all pointer fields in the TS_CONSTRUCTOR structure of EXPR to
+ output block OB. If REF_P is true, write a reference to EXPR's
+ pointer fields. */
+
+static void
+lto_output_ts_constructor_tree_pointers (struct output_block *ob, tree expr,
+ bool ref_p)
+{
+ unsigned i;
+ tree index, value;
+
+ output_uleb128 (ob, CONSTRUCTOR_NELTS (expr));
+ FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (expr), i, index, value)
+ {
+ lto_output_tree_or_ref (ob, index, ref_p);
+ lto_output_tree_or_ref (ob, value, ref_p);
+ }
+}
+
+
+/* Helper for lto_output_tree. Write all pointer fields in EXPR to output
+ block OB. If REF_P is true, the leaves of EXPR are emitted as
+ references. */
+
+static void
+lto_output_tree_pointers (struct output_block *ob, tree expr, bool ref_p)
+{
+ enum tree_code code;
+
+ code = TREE_CODE (expr);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_COMMON))
+ lto_output_ts_common_tree_pointers (ob, expr, ref_p);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_VECTOR))
+ lto_output_ts_vector_tree_pointers (ob, expr, ref_p);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_COMPLEX))
+ lto_output_ts_complex_tree_pointers (ob, expr, ref_p);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_DECL_MINIMAL))
+ lto_output_ts_decl_minimal_tree_pointers (ob, expr, ref_p);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
+ lto_output_ts_decl_common_tree_pointers (ob, expr, ref_p);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_DECL_NON_COMMON))
+ lto_output_ts_decl_non_common_tree_pointers (ob, expr, ref_p);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_DECL_WITH_VIS))
+ lto_output_ts_decl_with_vis_tree_pointers (ob, expr, ref_p);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_FIELD_DECL))
+ lto_output_ts_field_decl_tree_pointers (ob, expr, ref_p);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_FUNCTION_DECL))
+ lto_output_ts_function_decl_tree_pointers (ob, expr, ref_p);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_TYPE))
+ lto_output_ts_type_tree_pointers (ob, expr, ref_p);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_LIST))
+ lto_output_ts_list_tree_pointers (ob, expr, ref_p);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_VEC))
+ lto_output_ts_vec_tree_pointers (ob, expr, ref_p);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_EXP))
+ lto_output_ts_exp_tree_pointers (ob, expr, ref_p);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_SSA_NAME))
+ {
+ /* We only stream the version number of SSA names. */
+ gcc_unreachable ();
+ }
+
+ if (CODE_CONTAINS_STRUCT (code, TS_BLOCK))
+ lto_output_ts_block_tree_pointers (ob, expr, ref_p);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_BINFO))
+ lto_output_ts_binfo_tree_pointers (ob, expr, ref_p);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_CONSTRUCTOR))
+ lto_output_ts_constructor_tree_pointers (ob, expr, ref_p);
+
+ if (CODE_CONTAINS_STRUCT (code, TS_STATEMENT_LIST))
+ {
+ /* This should only appear in GENERIC. */
+ gcc_unreachable ();
+ }
+
+ if (CODE_CONTAINS_STRUCT (code, TS_OMP_CLAUSE))
+ {
+ /* This should only appear in High GIMPLE. */
+ gcc_unreachable ();
+ }
+
+ if (CODE_CONTAINS_STRUCT (code, TS_OPTIMIZATION))
+ sorry ("gimple bytecode streams do not support the optimization attribute");
+
+ if (CODE_CONTAINS_STRUCT (code, TS_TARGET_OPTION))
+ sorry ("gimple bytecode streams do not support the target attribute");
+}
+
+
+/* Emit header information for tree EXPR to output block OB. The header
+ contains everything needed to instantiate an empty skeleton for
+ EXPR on the reading side. IX is the index into the streamer cache
+ where EXPR is stored. REF_P is as in lto_output_tree. */
+
+static void
+lto_output_tree_header (struct output_block *ob, tree expr, int ix)
+{
+ enum LTO_tags tag;
+ enum tree_code code;
+
+ /* We should not see any non-GIMPLE tree nodes here. */
+ code = TREE_CODE (expr);
+ if (!lto_is_streamable (expr))
+ internal_error ("tree code %qs is not supported in gimple streams",
+ tree_code_name[code]);
+
+ /* The header of a tree node consists of its tag, the size of
+ the node, and any other information needed to instantiate
+ EXPR on the reading side (such as the number of slots in
+ variable sized nodes). */
+ tag = lto_tree_code_to_tag (code);
+ output_record_start (ob, tag);
+ output_sleb128 (ob, ix);
+
+ /* The following will cause bootstrap miscomparisons. Enable with care. */
+#ifdef LTO_STREAMER_DEBUG
+ /* This is used mainly for debugging purposes. When the reader
+ and the writer do not agree on a streamed node, the pointer
+ value for EXPR can be used to track down the differences in
+ the debugger. */
+ gcc_assert ((HOST_WIDEST_INT) (intptr_t) expr == (intptr_t) expr);
+ output_sleb128 (ob, (HOST_WIDEST_INT) (intptr_t) expr);
+#endif
+
+ /* The text in strings and identifiers are completely emitted in
+ the header. */
+ if (CODE_CONTAINS_STRUCT (code, TS_STRING))
+ output_string_cst (ob, ob->main_stream, expr);
+ else if (CODE_CONTAINS_STRUCT (code, TS_IDENTIFIER))
+ output_identifier (ob, ob->main_stream, expr);
+ else if (CODE_CONTAINS_STRUCT (code, TS_VEC))
+ output_sleb128 (ob, TREE_VEC_LENGTH (expr));
+ else if (CODE_CONTAINS_STRUCT (code, TS_BINFO))
+ output_uleb128 (ob, BINFO_N_BASE_BINFOS (expr));
+}
+
+
+/* Write the code and class of builtin EXPR to output block OB. IX is
+ the index into the streamer cache where EXPR is stored.*/
+
+static void
+lto_output_builtin_tree (struct output_block *ob, tree expr, int ix)
+{
+ gcc_assert (lto_stream_as_builtin_p (expr));
+
+ if (DECL_BUILT_IN_CLASS (expr) == BUILT_IN_MD
+ && !targetm.builtin_decl)
+ sorry ("gimple bytecode streams do not support machine specific builtin "
+ "functions on this target");
+
+ output_record_start (ob, LTO_builtin_decl);
+ output_uleb128 (ob, DECL_BUILT_IN_CLASS (expr));
+ output_uleb128 (ob, DECL_FUNCTION_CODE (expr));
+ output_sleb128 (ob, ix);
+
+ if (DECL_ASSEMBLER_NAME_SET_P (expr))
+ {
+ /* When the assembler name of a builtin gets a user name,
+ the new name is always prefixed with '*' by
+ set_builtin_user_assembler_name. So, to prevent the
+ reader side from adding a second '*', we omit it here. */
+ const char *str = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (expr));
+ if (strlen (str) > 1 && str[0] == '*')
+ output_string (ob, ob->main_stream, &str[1]);
+ else
+ output_string (ob, ob->main_stream, NULL);
+ }
+ else
+ output_string (ob, ob->main_stream, NULL);
+}
+
+
+/* Write a physical representation of tree node EXPR to output block
+ OB. If REF_P is true, the leaves of EXPR are emitted as references
+ via lto_output_tree_ref. IX is the index into the streamer cache
+ where EXPR is stored. */
+
+static void
+lto_write_tree (struct output_block *ob, tree expr, bool ref_p, int ix)
+{
+ struct bitpack_d *bp;
+
+ /* Write the header, containing everything needed to materialize
+ EXPR on the reading side. */
+ lto_output_tree_header (ob, expr, ix);
+
+ /* Pack all the non-pointer fields in EXPR into a bitpack and write
+ the resulting bitpack. */
+ bp = pack_value_fields (expr);
+ lto_output_bitpack (ob->main_stream, bp);
+ bitpack_delete (bp);
+
+ /* Write all the pointer fields in EXPR. */
+ lto_output_tree_pointers (ob, expr, ref_p);
+
+ /* Mark the end of EXPR. */
+ output_zero (ob);
+}
+
+
+/* Emit the integer constant CST to output block OB. If REF_P is true,
+ CST's type will be emitted as a reference. */
+
+static void
+lto_output_integer_cst (struct output_block *ob, tree cst, bool ref_p)
+{
+ output_record_start (ob, lto_tree_code_to_tag (INTEGER_CST));
+ lto_output_tree_or_ref (ob, TREE_TYPE (cst), ref_p);
+ lto_output_1_stream (ob->main_stream, TREE_OVERFLOW_P (cst));
+ output_uleb128 (ob, TREE_INT_CST_LOW (cst));
+ output_uleb128 (ob, TREE_INT_CST_HIGH (cst));
+}
+
+
+/* Emit the physical representation of tree node EXPR to output block
+ OB. If REF_P is true, the leaves of EXPR are emitted as references
+ via lto_output_tree_ref. */
+
+void
+lto_output_tree (struct output_block *ob, tree expr, bool ref_p)
+{
+ int ix;
+ bool existed_p;
+ unsigned offset;
+
+ if (expr == NULL_TREE)
+ {
+ output_zero (ob);
+ return;
+ }
+
+ /* INTEGER_CST nodes are special because they need their original type
+ to be materialized by the reader (to implement TYPE_CACHED_VALUES). */
+ if (TREE_CODE (expr) == INTEGER_CST)
+ {
+ lto_output_integer_cst (ob, expr, ref_p);
+ return;
+ }
+
+ /* Determine the offset in the stream where EXPR will be written.
+ This is used when emitting pickle references so the reader knows
+ where to reconstruct the pickled object from. This allows
+ circular and forward references within the same stream. */
+ offset = ob->main_stream->total_size;
+
+ existed_p = lto_streamer_cache_insert (ob->writer_cache, expr, &ix, &offset);
+ if (existed_p)
+ {
+ /* If a node has already been streamed out, make sure that
+ we don't write it more than once. Otherwise, the reader
+ will instantiate two different nodes for the same object. */
+ output_record_start (ob, LTO_tree_pickle_reference);
+ output_sleb128 (ob, ix);
+ output_uleb128 (ob, lto_tree_code_to_tag (TREE_CODE (expr)));
+ output_uleb128 (ob, offset);
+ }
+ else if (lto_stream_as_builtin_p (expr))
+ {
+ /* MD and NORMAL builtins do not need to be written out
+ completely as they are always instantiated by the
+ compiler on startup. The only builtins that need to
+ be written out are BUILT_IN_FRONTEND. For all other
+ builtins, we simply write the class and code. */
+ lto_output_builtin_tree (ob, expr, ix);
+ }
+ else
+ {
+ /* This is the first time we see EXPR, write its fields
+ to OB. */
+ lto_write_tree (ob, expr, ref_p, ix);
+ }
+}
+
+
+/* Output to OB a list of try/catch handlers starting with FIRST. */
+
+static void
+output_eh_try_list (struct output_block *ob, eh_catch first)
+{
+ eh_catch n;
+
+ for (n = first; n; n = n->next_catch)
+ {
+ output_record_start (ob, LTO_eh_catch);
+ lto_output_tree_ref (ob, n->type_list);
+ lto_output_tree_ref (ob, n->filter_list);
+ lto_output_tree_ref (ob, n->label);
+ }
+
+ output_zero (ob);
+}
+
+
+/* Output EH region R in function FN to OB. CURR_RN is the slot index
+ that is being emitted in FN->EH->REGION_ARRAY. This is used to
+ detect EH region sharing. */
+
+static void
+output_eh_region (struct output_block *ob, eh_region r)
+{
+ enum LTO_tags tag;
+
+ if (r == NULL)
+ {
+ output_zero (ob);
+ return;
+ }
+
+ if (r->type == ERT_CLEANUP)
+ tag = LTO_ert_cleanup;
+ else if (r->type == ERT_TRY)
+ tag = LTO_ert_try;
+ else if (r->type == ERT_ALLOWED_EXCEPTIONS)
+ tag = LTO_ert_allowed_exceptions;
+ else if (r->type == ERT_MUST_NOT_THROW)
+ tag = LTO_ert_must_not_throw;
+ else
+ gcc_unreachable ();
+
+ output_record_start (ob, tag);
+ output_sleb128 (ob, r->index);
+
+ if (r->outer)
+ output_sleb128 (ob, r->outer->index);
+ else
+ output_zero (ob);
+
+ if (r->inner)
+ output_sleb128 (ob, r->inner->index);
+ else
+ output_zero (ob);
+
+ if (r->next_peer)
+ output_sleb128 (ob, r->next_peer->index);
+ else
+ output_zero (ob);
+
+ if (r->type == ERT_TRY)
+ {
+ output_eh_try_list (ob, r->u.eh_try.first_catch);
+ }
+ else if (r->type == ERT_ALLOWED_EXCEPTIONS)
+ {
+ lto_output_tree_ref (ob, r->u.allowed.type_list);
+ lto_output_tree_ref (ob, r->u.allowed.label);
+ output_uleb128 (ob, r->u.allowed.filter);
+ }
+ else if (r->type == ERT_MUST_NOT_THROW)
+ {
+ lto_output_tree_ref (ob, r->u.must_not_throw.failure_decl);
+ lto_output_location (ob, r->u.must_not_throw.failure_loc);
+ }
+
+ if (r->landing_pads)
+ output_sleb128 (ob, r->landing_pads->index);
+ else
+ output_zero (ob);
+}
+
+
+/* Output landing pad LP to OB. */
+
+static void
+output_eh_lp (struct output_block *ob, eh_landing_pad lp)
+{
+ if (lp == NULL)
+ {
+ output_zero (ob);
+ return;
+ }
+
+ output_record_start (ob, LTO_eh_landing_pad);
+ output_sleb128 (ob, lp->index);
+ if (lp->next_lp)
+ output_sleb128 (ob, lp->next_lp->index);
+ else
+ output_zero (ob);
+
+ if (lp->region)
+ output_sleb128 (ob, lp->region->index);
+ else
+ output_zero (ob);
+
+ lto_output_tree_ref (ob, lp->post_landing_pad);
+}
+
+
+/* Output the existing eh_table to OB. */
+
+static void
+output_eh_regions (struct output_block *ob, struct function *fn)
+{
+ if (fn->eh && fn->eh->region_tree)
+ {
+ unsigned i;
+ eh_region eh;
+ eh_landing_pad lp;
+ tree ttype;
+
+ output_record_start (ob, LTO_eh_table);
+
+ /* Emit the index of the root of the EH region tree. */
+ output_sleb128 (ob, fn->eh->region_tree->index);
+
+ /* Emit all the EH regions in the region array. */
+ output_sleb128 (ob, VEC_length (eh_region, fn->eh->region_array));
+ for (i = 0; VEC_iterate (eh_region, fn->eh->region_array, i, eh); i++)
+ output_eh_region (ob, eh);
+
+ /* Emit all landing pads. */
+ output_sleb128 (ob, VEC_length (eh_landing_pad, fn->eh->lp_array));
+ for (i = 0; VEC_iterate (eh_landing_pad, fn->eh->lp_array, i, lp); i++)
+ output_eh_lp (ob, lp);
+
+ /* Emit all the runtime type data. */
+ output_sleb128 (ob, VEC_length (tree, fn->eh->ttype_data));
+ for (i = 0; VEC_iterate (tree, fn->eh->ttype_data, i, ttype); i++)
+ lto_output_tree_ref (ob, ttype);
+
+ /* Emit the table of action chains. */
+ if (targetm.arm_eabi_unwinder)
+ {
+ tree t;
+ output_sleb128 (ob, VEC_length (tree, fn->eh->ehspec_data.arm_eabi));
+ for (i = 0;
+ VEC_iterate (tree, fn->eh->ehspec_data.arm_eabi, i, t);
+ i++)
+ lto_output_tree_ref (ob, t);
+ }
+ else
+ {
+ uchar c;
+ output_sleb128 (ob, VEC_length (uchar, fn->eh->ehspec_data.other));
+ for (i = 0; VEC_iterate (uchar, fn->eh->ehspec_data.other, i, c); i++)
+ lto_output_1_stream (ob->main_stream, c);
+ }
+ }
+
+ /* The 0 either terminates the record or indicates that there are no
+ eh_records at all. */
+ output_zero (ob);
+}
+
+
+/* Output all of the active ssa names to the ssa_names stream. */
+
+static void
+output_ssa_names (struct output_block *ob, struct function *fn)
+{
+ unsigned int i, len;
+
+ len = VEC_length (tree, SSANAMES (fn));
+ output_uleb128 (ob, len);
+
+ for (i = 1; i < len; i++)
+ {
+ tree ptr = VEC_index (tree, SSANAMES (fn), i);
+
+ if (ptr == NULL_TREE
+ || SSA_NAME_IN_FREE_LIST (ptr)
+ || !is_gimple_reg (ptr))
+ continue;
+
+ output_uleb128 (ob, i);
+ lto_output_1_stream (ob->main_stream, SSA_NAME_IS_DEFAULT_DEF (ptr));
+ lto_output_tree_ref (ob, SSA_NAME_VAR (ptr));
+ }
+
+ output_zero (ob);
+}
+
+
+/* Output the cfg. */
+
+static void
+output_cfg (struct output_block *ob, struct function *fn)
+{
+ struct lto_output_stream *tmp_stream = ob->main_stream;
+ basic_block bb;
+
+ ob->main_stream = ob->cfg_stream;
+
+ output_uleb128 (ob, profile_status_for_function (fn));
+
+ /* Output the number of the highest basic block. */
+ output_uleb128 (ob, last_basic_block_for_function (fn));
+
+ FOR_ALL_BB_FN (bb, fn)
+ {
+ edge_iterator ei;
+ edge e;
+
+ output_sleb128 (ob, bb->index);
+
+ /* Output the successors and the edge flags. */
+ output_uleb128 (ob, EDGE_COUNT (bb->succs));
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ {
+ output_uleb128 (ob, e->dest->index);
+ output_sleb128 (ob, e->probability);
+ output_sleb128 (ob, e->count);
+ output_uleb128 (ob, e->flags);
+ }
+ }
+
+ output_sleb128 (ob, -1);
+
+ bb = ENTRY_BLOCK_PTR;
+ while (bb->next_bb)
+ {
+ output_sleb128 (ob, bb->next_bb->index);
+ bb = bb->next_bb;
+ }
+
+ output_sleb128 (ob, -1);
+
+ ob->main_stream = tmp_stream;
+}
+
+
+/* Output PHI function PHI to the main stream in OB. */
+
+static void
+output_phi (struct output_block *ob, gimple phi)
+{
+ unsigned i, len = gimple_phi_num_args (phi);
+
+ output_record_start (ob, lto_gimple_code_to_tag (GIMPLE_PHI));
+ output_uleb128 (ob, SSA_NAME_VERSION (PHI_RESULT (phi)));
+
+ for (i = 0; i < len; i++)
+ {
+ lto_output_tree_ref (ob, gimple_phi_arg_def (phi, i));
+ output_uleb128 (ob, gimple_phi_arg_edge (phi, i)->src->index);
+ lto_output_location (ob, gimple_phi_arg_location (phi, i));
+ }
+}
+
+
+/* Emit statement STMT on the main stream of output block OB. */
+
+static void
+output_gimple_stmt (struct output_block *ob, gimple stmt)
+{
+ unsigned i;
+ enum gimple_code code;
+ enum LTO_tags tag;
+ struct bitpack_d *bp;
+
+ /* Emit identifying tag. */
+ code = gimple_code (stmt);
+ tag = lto_gimple_code_to_tag (code);
+ output_record_start (ob, tag);
+
+ /* Emit the tuple header. */
+ bp = bitpack_create ();
+ bp_pack_value (bp, gimple_num_ops (stmt), sizeof (unsigned) * 8);
+ bp_pack_value (bp, gimple_no_warning_p (stmt), 1);
+ if (is_gimple_assign (stmt))
+ bp_pack_value (bp, gimple_assign_nontemporal_move_p (stmt), 1);
+ bp_pack_value (bp, gimple_has_volatile_ops (stmt), 1);
+ bp_pack_value (bp, stmt->gsbase.subcode, 16);
+ lto_output_bitpack (ob->main_stream, bp);
+ bitpack_delete (bp);
+
+ /* Emit location information for the statement. */
+ lto_output_location (ob, gimple_location (stmt));
+
+ /* Emit the lexical block holding STMT. */
+ lto_output_tree (ob, gimple_block (stmt), true);
+
+ /* Emit the operands. */
+ switch (gimple_code (stmt))
+ {
+ case GIMPLE_RESX:
+ output_sleb128 (ob, gimple_resx_region (stmt));
+ break;
+
+ case GIMPLE_EH_MUST_NOT_THROW:
+ lto_output_tree_ref (ob, gimple_eh_must_not_throw_fndecl (stmt));
+ break;
+
+ case GIMPLE_EH_DISPATCH:
+ output_sleb128 (ob, gimple_eh_dispatch_region (stmt));
+ break;
+
+ case GIMPLE_ASM:
+ lto_output_uleb128_stream (ob->main_stream, gimple_asm_ninputs (stmt));
+ lto_output_uleb128_stream (ob->main_stream, gimple_asm_noutputs (stmt));
+ lto_output_uleb128_stream (ob->main_stream, gimple_asm_nclobbers (stmt));
+ output_string (ob, ob->main_stream, gimple_asm_string (stmt));
+ /* Fallthru */
+
+ case GIMPLE_ASSIGN:
+ case GIMPLE_CALL:
+ case GIMPLE_RETURN:
+ case GIMPLE_SWITCH:
+ case GIMPLE_LABEL:
+ case GIMPLE_COND:
+ case GIMPLE_GOTO:
+ case GIMPLE_DEBUG:
+ for (i = 0; i < gimple_num_ops (stmt); i++)
+ {
+ tree op = gimple_op (stmt, i);
+ lto_output_tree_ref (ob, op);
+ }
+ break;
+
+ case GIMPLE_NOP:
+ case GIMPLE_PREDICT:
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+}
+
+
+/* Output a basic block BB to the main stream in OB for this FN. */
+
+static void
+output_bb (struct output_block *ob, basic_block bb, struct function *fn)
+{
+ gimple_stmt_iterator bsi = gsi_start_bb (bb);
+
+ output_record_start (ob,
+ (!gsi_end_p (bsi)) || phi_nodes (bb)
+ ? LTO_bb1
+ : LTO_bb0);
+
+ output_uleb128 (ob, bb->index);
+ output_sleb128 (ob, bb->count);
+ output_sleb128 (ob, bb->loop_depth);
+ output_sleb128 (ob, bb->frequency);
+ output_sleb128 (ob, bb->flags);
+
+ if (!gsi_end_p (bsi) || phi_nodes (bb))
+ {
+ /* Output the statements. The list of statements is terminated
+ with a zero. */
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
+ {
+ int region;
+ gimple stmt = gsi_stmt (bsi);
+
+ output_gimple_stmt (ob, stmt);
+
+ /* Emit the EH region holding STMT. */
+ region = lookup_stmt_eh_lp_fn (fn, stmt);
+ if (region != 0)
+ {
+ output_record_start (ob, LTO_eh_region);
+ output_sleb128 (ob, region);
+ }
+ else
+ output_zero (ob);
+ }
+
+ output_zero (ob);
+
+ for (bsi = gsi_start_phis (bb); !gsi_end_p (bsi); gsi_next (&bsi))
+ {
+ gimple phi = gsi_stmt (bsi);
+
+ /* Only emit PHIs for gimple registers. PHI nodes for .MEM
+ will be filled in on reading when the SSA form is
+ updated. */
+ if (is_gimple_reg (gimple_phi_result (phi)))
+ output_phi (ob, phi);
+ }
+
+ output_zero (ob);
+ }
+}
+
+/* Create the header in the file using OB. If the section type is for
+ a function, set FN to the decl for that function. */
+
+void
+produce_asm (struct output_block *ob, tree fn)
+{
+ enum lto_section_type section_type = ob->section_type;
+ struct lto_function_header header;
+ char *section_name;
+ struct lto_output_stream *header_stream;
+
+ if (section_type == LTO_section_function_body)
+ {
+ const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fn));
+ section_name = lto_get_section_name (section_type, name);
+ }
+ else
+ section_name = lto_get_section_name (section_type, NULL);
+
+ lto_begin_section (section_name, !flag_wpa);
+ free (section_name);
+
+ /* The entire header is stream computed here. */
+ memset (&header, 0, sizeof (struct lto_function_header));
+
+ /* Write the header. */
+ header.lto_header.major_version = LTO_major_version;
+ header.lto_header.minor_version = LTO_minor_version;
+ header.lto_header.section_type = section_type;
+
+ header.compressed_size = 0;
+
+ if (section_type == LTO_section_function_body)
+ header.cfg_size = ob->cfg_stream->total_size;
+ header.main_size = ob->main_stream->total_size;
+ header.string_size = ob->string_stream->total_size;
+
+ header_stream = XCNEW (struct lto_output_stream);
+ lto_output_data_stream (header_stream, &header, sizeof header);
+ lto_write_stream (header_stream);
+ free (header_stream);
+
+ /* Put all of the gimple and the string table out the asm file as a
+ block of text. */
+ if (section_type == LTO_section_function_body)
+ lto_write_stream (ob->cfg_stream);
+ lto_write_stream (ob->main_stream);
+ lto_write_stream (ob->string_stream);
+
+ lto_end_section ();
+}
+
+
+/* Output the body of function NODE->DECL. */
+
+static void
+output_function (struct cgraph_node *node)
+{
+ struct bitpack_d *bp;
+ tree function;
+ struct function *fn;
+ basic_block bb;
+ struct output_block *ob;
+
+ function = node->decl;
+ fn = DECL_STRUCT_FUNCTION (function);
+ ob = create_output_block (LTO_section_function_body);
+
+ clear_line_info (ob);
+ ob->cgraph_node = node;
+
+ gcc_assert (current_function_decl == NULL_TREE && cfun == NULL);
+
+ /* Set current_function_decl and cfun. */
+ current_function_decl = function;
+ push_cfun (fn);
+
+ /* Make string 0 be a NULL string. */
+ lto_output_1_stream (ob->string_stream, 0);
+
+ output_record_start (ob, LTO_function);
+
+ /* Write all the attributes for FN. */
+ bp = bitpack_create ();
+ bp_pack_value (bp, fn->is_thunk, 1);
+ bp_pack_value (bp, fn->has_local_explicit_reg_vars, 1);
+ bp_pack_value (bp, fn->after_tree_profile, 1);
+ bp_pack_value (bp, fn->returns_pcc_struct, 1);
+ bp_pack_value (bp, fn->returns_struct, 1);
+ bp_pack_value (bp, fn->always_inline_functions_inlined, 1);
+ bp_pack_value (bp, fn->after_inlining, 1);
+ bp_pack_value (bp, fn->dont_save_pending_sizes_p, 1);
+ bp_pack_value (bp, fn->stdarg, 1);
+ bp_pack_value (bp, fn->has_nonlocal_label, 1);
+ bp_pack_value (bp, fn->calls_alloca, 1);
+ bp_pack_value (bp, fn->calls_setjmp, 1);
+ bp_pack_value (bp, fn->function_frequency, 2);
+ bp_pack_value (bp, fn->va_list_fpr_size, 8);
+ bp_pack_value (bp, fn->va_list_gpr_size, 8);
+ lto_output_bitpack (ob->main_stream, bp);
+ bitpack_delete (bp);
+
+ /* Output the static chain and non-local goto save area. */
+ lto_output_tree_ref (ob, fn->static_chain_decl);
+ lto_output_tree_ref (ob, fn->nonlocal_goto_save_area);
+
+ /* Output all the local variables in the function. */
+ lto_output_tree_ref (ob, fn->local_decls);
+
+ /* Output all the SSA names used in the function. */
+ output_ssa_names (ob, fn);
+
+ /* Output any exception handling regions. */
+ output_eh_regions (ob, fn);
+
+ /* Output DECL_INITIAL for the function, which contains the tree of
+ lexical scopes. */
+ lto_output_tree (ob, DECL_INITIAL (function), true);
+
+ /* Output the head of the arguments list. */
+ lto_output_tree_ref (ob, DECL_ARGUMENTS (function));
+
+ /* We will renumber the statements. The code that does this uses
+ the same ordering that we use for serializing them so we can use
+ the same code on the other end and not have to write out the
+ statement numbers. */
+ renumber_gimple_stmt_uids ();
+
+ /* Output the code for the function. */
+ FOR_ALL_BB_FN (bb, fn)
+ output_bb (ob, bb, fn);
+
+ /* The terminator for this function. */
+ output_zero (ob);
+
+ output_cfg (ob, fn);
+
+ /* Create a section to hold the pickled output of this function. */
+ produce_asm (ob, function);
+
+ destroy_output_block (ob);
+
+ current_function_decl = NULL;
+ pop_cfun ();
+}
+
+
+/* Return true if alias pair P belongs to the set of cgraph nodes in
+ SET. If P is a an alias for a VAR_DECL, it can always be emitted.
+ However, for FUNCTION_DECL aliases, we should only output the pair
+ if it belongs to a function whose cgraph node is in SET.
+ Otherwise, the LTRANS phase will get into trouble when finalizing
+ aliases because the alias will refer to a function not defined in
+ the file processed by LTRANS. */
+
+static bool
+output_alias_pair_p (alias_pair *p, cgraph_node_set set)
+{
+ cgraph_node_set_iterator csi;
+ struct cgraph_node *target_node;
+
+ /* Always emit VAR_DECLs. FIXME lto, we should probably only emit
+ those VAR_DECLs that are instantiated in this file partition, but
+ we have no easy way of knowing this based on SET. */
+ if (TREE_CODE (p->decl) == VAR_DECL)
+ return true;
+
+ /* Check if the assembler name for P->TARGET has its cgraph node in SET. */
+ gcc_assert (TREE_CODE (p->decl) == FUNCTION_DECL);
+ target_node = cgraph_node_for_asm (p->target);
+ csi = cgraph_node_set_find (set, target_node);
+ return (!csi_end_p (csi));
+}
+
+
+/* Output any unreferenced global symbol defined in SET, alias pairs
+ and labels. */
+
+static void
+output_unreferenced_globals (cgraph_node_set set)
+{
+ struct output_block *ob;
+ alias_pair *p;
+ unsigned i;
+ struct varpool_node *vnode;
+
+ ob = create_output_block (LTO_section_static_initializer);
+ ob->cgraph_node = NULL;
+
+ clear_line_info (ob);
+
+ /* Make string 0 be a NULL string. */
+ lto_output_1_stream (ob->string_stream, 0);
+
+ /* Emit references for all the global symbols. If a global symbol
+ was never referenced in any of the functions of this file, it
+ would not be emitted otherwise. This will result in unreferenced
+ symbols at link time if a file defines a global symbol but
+ never references it. */
+ FOR_EACH_STATIC_VARIABLE (vnode)
+ {
+ tree var = vnode->decl;
+
+ if (TREE_CODE (var) == VAR_DECL && TREE_PUBLIC (var))
+ lto_output_tree_ref (ob, var);
+ }
+
+ output_zero (ob);
+
+ /* Emit the alias pairs for the nodes in SET. */
+ for (i = 0; VEC_iterate (alias_pair, alias_pairs, i, p); i++)
+ {
+ if (output_alias_pair_p (p, set))
+ {
+ lto_output_tree_ref (ob, p->decl);
+ lto_output_tree_ref (ob, p->target);
+ }
+ }
+
+ output_zero (ob);
+
+ produce_asm (ob, NULL);
+ destroy_output_block (ob);
+}
+
+
+/* Copy the function body of NODE without deserializing. */
+
+static void
+copy_function (struct cgraph_node *node)
+{
+ tree function = node->decl;
+ struct lto_file_decl_data *file_data = node->local.lto_file_data;
+ struct lto_output_stream *output_stream = XCNEW (struct lto_output_stream);
+ const char *data;
+ size_t len;
+ const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (function));
+ char *section_name =
+ lto_get_section_name (LTO_section_function_body, name);
+ size_t i, j;
+ struct lto_in_decl_state *in_state;
+ struct lto_out_decl_state *out_state = lto_get_out_decl_state ();
+
+ lto_begin_section (section_name, !flag_wpa);
+ free (section_name);
+
+ /* We may have renamed the declaration, e.g., a static function. */
+ name = lto_get_decl_name_mapping (file_data, name);
+
+ data = lto_get_section_data (file_data, LTO_section_function_body,
+ name, &len);
+ gcc_assert (data);
+
+ /* Do a bit copy of the function body. */
+ lto_output_data_stream (output_stream, data, len);
+ lto_write_stream (output_stream);
+
+ /* Copy decls. */
+ in_state =
+ lto_get_function_in_decl_state (node->local.lto_file_data, function);
+ gcc_assert (in_state);
+
+ for (i = 0; i < LTO_N_DECL_STREAMS; i++)
+ {
+ size_t n = in_state->streams[i].size;
+ tree *trees = in_state->streams[i].trees;
+ struct lto_tree_ref_encoder *encoder = &(out_state->streams[i]);
+
+ /* The out state must have the same indices and the in state.
+ So just copy the vector. All the encoders in the in state
+ must be empty where we reach here. */
+ gcc_assert (lto_tree_ref_encoder_size (encoder) == 0);
+ for (j = 0; j < n; j++)
+ VEC_safe_push (tree, heap, encoder->trees, trees[j]);
+ encoder->next_index = n;
+ }
+
+ lto_free_section_data (file_data, LTO_section_function_body, name,
+ data, len);
+ free (output_stream);
+ lto_end_section ();
+}
+
+
+/* Initialize the LTO writer. */
+
+static void
+lto_writer_init (void)
+{
+ lto_streamer_init ();
+}
+
+
+/* Main entry point from the pass manager. */
+
+static void
+lto_output (cgraph_node_set set)
+{
+ struct cgraph_node *node;
+ struct lto_out_decl_state *decl_state;
+ cgraph_node_set_iterator csi;
+ bitmap output = lto_bitmap_alloc ();
+
+ lto_writer_init ();
+
+ /* Process only the functions with bodies. */
+ for (csi = csi_start (set); !csi_end_p (csi); csi_next (&csi))
+ {
+ node = csi_node (csi);
+ if (node->analyzed && !bitmap_bit_p (output, DECL_UID (node->decl)))
+ {
+ bitmap_set_bit (output, DECL_UID (node->decl));
+ decl_state = lto_new_out_decl_state ();
+ lto_push_out_decl_state (decl_state);
+ if (!flag_wpa)
+ output_function (node);
+ else
+ copy_function (node);
+ gcc_assert (lto_get_out_decl_state () == decl_state);
+ lto_pop_out_decl_state ();
+ lto_record_function_out_decl_state (node->decl, decl_state);
+ }
+ }
+
+ /* Emit the callgraph after emitting function bodies. This needs to
+ be done now to make sure that all the statements in every function
+ have been renumbered so that edges can be associated with call
+ statements using the statement UIDs. */
+ output_cgraph (set);
+
+ lto_bitmap_free (output);
+}
+
+struct ipa_opt_pass_d pass_ipa_lto_gimple_out =
+{
+ {
+ IPA_PASS,
+ "lto_gimple_out", /* name */
+ gate_lto_out, /* gate */
+ NULL, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_IPA_LTO_GIMPLE_IO, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_dump_func /* todo_flags_finish */
+ },
+ NULL, /* generate_summary */
+ lto_output, /* write_summary */
+ NULL, /* read_summary */
+ NULL, /* function_read_summary */
+ 0, /* TODOs */
+ NULL, /* function_transform */
+ NULL /* variable_transform */
+};
+
+
+/* Write each node in encoded by ENCODER to OB, as well as those reachable
+ from it and required for correct representation of its semantics.
+ Each node in ENCODER must be a global declaration or a type. A node
+ is written only once, even if it appears multiple times in the
+ vector. Certain transitively-reachable nodes, such as those
+ representing expressions, may be duplicated, but such nodes
+ must not appear in ENCODER itself. */
+
+static void
+write_global_stream (struct output_block *ob,
+ struct lto_tree_ref_encoder *encoder)
+{
+ tree t;
+ size_t index;
+ const size_t size = lto_tree_ref_encoder_size (encoder);
+
+ for (index = 0; index < size; index++)
+ {
+ t = lto_tree_ref_encoder_get_tree (encoder, index);
+ if (!lto_streamer_cache_lookup (ob->writer_cache, t, NULL))
+ {
+ if (flag_wpa)
+ {
+ /* In WPA we should not emit multiple definitions of the
+ same symbol to all the files in the link set. If
+ T had already been emitted as the pervailing definition
+ in one file, emit it as an external reference in the
+ others. */
+ /* FIXME lto. We should check if T belongs to the
+ file we are writing to. */
+ if (TREE_CODE (t) == VAR_DECL
+ && TREE_PUBLIC (t)
+ && !DECL_EXTERNAL (t))
+ {
+ /* FIXME lto. Make DECLS_ALREADY_EMITTED an argument
+ to this function so it can be freed up afterwards.
+ Alternately, assign global symbols to cgraph
+ node sets. */
+ static struct pointer_set_t *decls_already_emitted = NULL;
+
+ if (decls_already_emitted == NULL)
+ decls_already_emitted = pointer_set_create ();
+
+ if (pointer_set_insert (decls_already_emitted, t))
+ make_decl_one_only (t, DECL_ASSEMBLER_NAME (t));
+ }
+ }
+
+ lto_output_tree (ob, t, false);
+ }
+ }
+}
+
+
+/* Write a sequence of indices into the globals vector corresponding
+ to the trees in ENCODER. These are used by the reader to map the
+ indices used to refer to global entities within function bodies to
+ their referents. */
+
+static void
+write_global_references (struct output_block *ob,
+ struct lto_output_stream *ref_stream,
+ struct lto_tree_ref_encoder *encoder)
+{
+ tree t;
+ int32_t index;
+ const int32_t size = lto_tree_ref_encoder_size (encoder);
+
+ /* Write size as 32-bit unsigned. */
+ lto_output_data_stream (ref_stream, &size, sizeof (int32_t));
+
+ for (index = 0; index < size; index++)
+ {
+ int32_t slot_num;
+
+ t = lto_tree_ref_encoder_get_tree (encoder, index);
+ lto_streamer_cache_lookup (ob->writer_cache, t, &slot_num);
+ gcc_assert (slot_num >= 0);
+ lto_output_data_stream (ref_stream, &slot_num, sizeof slot_num);
+ }
+}
+
+
+/* Write all the streams in an lto_out_decl_state STATE using
+ output block OB and output stream OUT_STREAM. */
+
+static void
+lto_output_decl_state_streams (struct output_block *ob,
+ struct lto_out_decl_state *state)
+{
+ int i;
+
+ for (i = 0; i < LTO_N_DECL_STREAMS; i++)
+ write_global_stream (ob, &state->streams[i]);
+}
+
+
+/* Write all the references in an lto_out_decl_state STATE using
+ output block OB and output stream OUT_STREAM. */
+
+static void
+lto_output_decl_state_refs (struct output_block *ob,
+ struct lto_output_stream *out_stream,
+ struct lto_out_decl_state *state)
+{
+ unsigned i;
+ int32_t ref;
+ tree decl;
+
+ /* Write reference to FUNCTION_DECL. If there is not function,
+ write reference to void_type_node. */
+ decl = (state->fn_decl) ? state->fn_decl : void_type_node;
+ lto_streamer_cache_lookup (ob->writer_cache, decl, &ref);
+ gcc_assert (ref >= 0);
+ lto_output_data_stream (out_stream, &ref, sizeof (int32_t));
+
+ for (i = 0; i < LTO_N_DECL_STREAMS; i++)
+ write_global_references (ob, out_stream, &state->streams[i]);
+}
+
+
+/* Return the written size of STATE. */
+
+static size_t
+lto_out_decl_state_written_size (struct lto_out_decl_state *state)
+{
+ int i;
+ size_t size;
+
+ size = sizeof (int32_t); /* fn_ref. */
+ for (i = 0; i < LTO_N_DECL_STREAMS; i++)
+ {
+ size += sizeof (int32_t); /* vector size. */
+ size += (lto_tree_ref_encoder_size (&state->streams[i])
+ * sizeof (int32_t));
+ }
+ return size;
+}
+
+
+/* Helper function of write_symbols_of_kind. CACHE is the streamer
+ cache with all the pickled nodes. STREAM is the stream where to
+ write the table. V is a vector with the DECLs that should be on
+ the table. SEEN is a bitmap of symbols written so far. */
+
+static void
+write_symbol_vec (struct lto_streamer_cache_d *cache,
+ struct lto_output_stream *stream,
+ VEC(tree,heap) *v, bitmap seen)
+{
+ tree t;
+ int index;
+
+ for (index = 0; VEC_iterate(tree, v, index, t); index++)
+ {
+ const char *name;
+ enum gcc_plugin_symbol_kind kind;
+ enum gcc_plugin_symbol_visibility visibility;
+ int slot_num;
+ uint64_t size;
+ const char *comdat;
+
+ /* None of the following kinds of symbols are needed in the
+ symbol table. */
+ if (!TREE_PUBLIC (t)
+ || is_builtin_fn (t)
+ || DECL_ABSTRACT (t)
+ || TREE_CODE (t) == RESULT_DECL)
+ continue;
+
+ gcc_assert (TREE_CODE (t) == VAR_DECL
+ || TREE_CODE (t) == FUNCTION_DECL);
+
+ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (t));
+
+ /* FIXME lto: this is from assemble_name_raw in varasm.c. For some
+ architectures we might have to do the same name manipulations that
+ ASM_OUTPUT_LABELREF does. */
+ if (name[0] == '*')
+ name = &name[1];
+
+ lto_streamer_cache_lookup (cache, t, &slot_num);
+ gcc_assert (slot_num >= 0);
+
+ /* Avoid duplicate symbols. */
+ if (bitmap_bit_p (seen, slot_num))
+ continue;
+ else
+ bitmap_set_bit (seen, slot_num);
+
+ if (DECL_EXTERNAL (t))
+ {
+ if (DECL_WEAK (t))
+ kind = GCCPK_WEAKUNDEF;
+ else
+ kind = GCCPK_UNDEF;
+ }
+ else
+ {
+ if (DECL_WEAK (t))
+ kind = GCCPK_WEAKDEF;
+ else if (DECL_COMMON (t))
+ kind = GCCPK_COMMON;
+ else
+ kind = GCCPK_DEF;
+ }
+
+ switch (DECL_VISIBILITY(t))
+ {
+ case VISIBILITY_DEFAULT:
+ visibility = GCCPV_DEFAULT;
+ break;
+ case VISIBILITY_PROTECTED:
+ visibility = GCCPV_PROTECTED;
+ break;
+ case VISIBILITY_HIDDEN:
+ visibility = GCCPV_HIDDEN;
+ break;
+ case VISIBILITY_INTERNAL:
+ visibility = GCCPV_INTERNAL;
+ break;
+ }
+
+ if (kind == GCCPK_COMMON && DECL_SIZE (t))
+ size = (((uint64_t) TREE_INT_CST_HIGH (DECL_SIZE (t))) << 32)
+ | TREE_INT_CST_LOW (DECL_SIZE (t));
+ else
+ size = 0;
+
+ if (DECL_ONE_ONLY (t))
+ comdat = IDENTIFIER_POINTER (DECL_COMDAT_GROUP (t));
+ else
+ comdat = "";
+
+ lto_output_data_stream (stream, name, strlen (name) + 1);
+ lto_output_data_stream (stream, comdat, strlen (comdat) + 1);
+ lto_output_data_stream (stream, &kind, 1);
+ lto_output_data_stream (stream, &visibility, 1);
+ lto_output_data_stream (stream, &size, 8);
+ lto_output_data_stream (stream, &slot_num, 4);
+ }
+}
+
+
+/* Write IL symbols of KIND. CACHE is the streamer cache with all the
+ pickled nodes. SEEN is a bitmap of symbols written so far. */
+
+static void
+write_symbols_of_kind (lto_decl_stream_e_t kind,
+ struct lto_streamer_cache_d *cache, bitmap seen)
+{
+ struct lto_out_decl_state *out_state;
+ struct lto_output_stream stream;
+ unsigned num_fns =
+ VEC_length (lto_out_decl_state_ptr, lto_function_decl_states);
+ unsigned idx;
+
+ memset (&stream, 0, sizeof (stream));
+ out_state = lto_get_out_decl_state ();
+ write_symbol_vec (cache, &stream, out_state->streams[kind].trees, seen);
+
+ for (idx = 0; idx < num_fns; idx++)
+ {
+ out_state =
+ VEC_index (lto_out_decl_state_ptr, lto_function_decl_states, idx);
+ write_symbol_vec (cache, &stream, out_state->streams[kind].trees, seen);
+ }
+
+ lto_write_stream (&stream);
+}
+
+
+/* Write an IL symbol table. CACHE is the streamer cache with all the
+ pickled nodes. */
+
+static void
+produce_symtab (struct lto_streamer_cache_d *cache)
+{
+ char *section_name = lto_get_section_name (LTO_section_symtab, NULL);
+ bitmap seen;
+
+ lto_begin_section (section_name, false);
+ free (section_name);
+
+ seen = lto_bitmap_alloc ();
+ write_symbols_of_kind (LTO_DECL_STREAM_FN_DECL, cache, seen);
+ write_symbols_of_kind (LTO_DECL_STREAM_VAR_DECL, cache, seen);
+ lto_bitmap_free (seen);
+
+ lto_end_section ();
+}
+
+
+/* This pass is run after all of the functions are serialized and all
+ of the IPA passes have written their serialized forms. This pass
+ causes the vector of all of the global decls and types used from
+ this file to be written in to a section that can then be read in to
+ recover these on other side. */
+
+static void
+produce_asm_for_decls (cgraph_node_set set)
+{
+ struct lto_out_decl_state *out_state;
+ struct lto_out_decl_state *fn_out_state;
+ struct lto_decl_header header;
+ char *section_name;
+ struct output_block *ob;
+ struct lto_output_stream *header_stream, *decl_state_stream;
+ unsigned idx, num_fns;
+ size_t decl_state_size;
+ int32_t num_decl_states;
+
+ ob = create_output_block (LTO_section_decls);
+ ob->global = true;
+
+ /* Write out unreferenced globals, alias pairs and labels. We defer
+ doing this until now so that we can write out only what is
+ needed. */
+ output_unreferenced_globals (set);
+
+ memset (&header, 0, sizeof (struct lto_decl_header));
+
+ section_name = lto_get_section_name (LTO_section_decls, NULL);
+ lto_begin_section (section_name, !flag_wpa);
+ free (section_name);
+
+ /* Make string 0 be a NULL string. */
+ lto_output_1_stream (ob->string_stream, 0);
+
+ /* Write the global symbols. */
+ out_state = lto_get_out_decl_state ();
+ num_fns = VEC_length (lto_out_decl_state_ptr, lto_function_decl_states);
+ lto_output_decl_state_streams (ob, out_state);
+ for (idx = 0; idx < num_fns; idx++)
+ {
+ fn_out_state =
+ VEC_index (lto_out_decl_state_ptr, lto_function_decl_states, idx);
+ lto_output_decl_state_streams (ob, fn_out_state);
+ }
+
+ header.lto_header.major_version = LTO_major_version;
+ header.lto_header.minor_version = LTO_minor_version;
+ header.lto_header.section_type = LTO_section_decls;
+
+ /* Currently not used. This field would allow us to preallocate
+ the globals vector, so that it need not be resized as it is extended. */
+ header.num_nodes = -1;
+
+ /* Compute the total size of all decl out states. */
+ decl_state_size = sizeof (int32_t);
+ decl_state_size += lto_out_decl_state_written_size (out_state);
+ for (idx = 0; idx < num_fns; idx++)
+ {
+ fn_out_state =
+ VEC_index (lto_out_decl_state_ptr, lto_function_decl_states, idx);
+ decl_state_size += lto_out_decl_state_written_size (fn_out_state);
+ }
+ header.decl_state_size = decl_state_size;
+
+ header.main_size = ob->main_stream->total_size;
+ header.string_size = ob->string_stream->total_size;
+
+ header_stream = XCNEW (struct lto_output_stream);
+ lto_output_data_stream (header_stream, &header, sizeof header);
+ lto_write_stream (header_stream);
+ free (header_stream);
+
+ /* Write the main out-decl state, followed by out-decl states of
+ functions. */
+ decl_state_stream = ((struct lto_output_stream *)
+ xcalloc (1, sizeof (struct lto_output_stream)));
+ num_decl_states = num_fns + 1;
+ lto_output_data_stream (decl_state_stream, &num_decl_states,
+ sizeof (num_decl_states));
+ lto_output_decl_state_refs (ob, decl_state_stream, out_state);
+ for (idx = 0; idx < num_fns; idx++)
+ {
+ fn_out_state =
+ VEC_index (lto_out_decl_state_ptr, lto_function_decl_states, idx);
+ lto_output_decl_state_refs (ob, decl_state_stream, fn_out_state);
+ }
+ lto_write_stream (decl_state_stream);
+ free(decl_state_stream);
+
+ lto_write_stream (ob->main_stream);
+ lto_write_stream (ob->string_stream);
+
+ lto_end_section ();
+
+ /* Write the symbol table. */
+ produce_symtab (ob->writer_cache);
+
+ /* Write command line opts. */
+ lto_write_options ();
+
+ /* Deallocate memory and clean up. */
+ lto_cgraph_encoder_delete (ob->decl_state->cgraph_node_encoder);
+ VEC_free (lto_out_decl_state_ptr, heap, lto_function_decl_states);
+ lto_function_decl_states = NULL;
+ destroy_output_block (ob);
+}
+
+
+struct ipa_opt_pass_d pass_ipa_lto_finish_out =
+{
+ {
+ IPA_PASS,
+ "lto_decls_out", /* name */
+ gate_lto_out, /* gate */
+ NULL, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_IPA_LTO_DECL_IO, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0 /* todo_flags_finish */
+ },
+ NULL, /* generate_summary */
+ produce_asm_for_decls, /* write_summary */
+ NULL, /* read_summary */
+ NULL, /* function_read_summary */
+ 0, /* TODOs */
+ NULL, /* function_transform */
+ NULL /* variable_transform */
+};
diff --git a/gcc/lto-streamer.c b/gcc/lto-streamer.c
new file mode 100644
index 00000000000..5b925db504e
--- /dev/null
+++ b/gcc/lto-streamer.c
@@ -0,0 +1,863 @@
+/* Miscellaneous utilities for GIMPLE streaming. Things that are used
+ in both input and output are here.
+
+ Copyright 2009 Free Software Foundation, Inc.
+ Contributed by Doug Kwan <dougkwan@google.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "toplev.h"
+#include "flags.h"
+#include "tree.h"
+#include "gimple.h"
+#include "tree-flow.h"
+#include "diagnostic.h"
+#include "bitmap.h"
+#include "vec.h"
+#include "lto-streamer.h"
+
+/* Statistics gathered during LTO, WPA and LTRANS. */
+struct lto_stats_d lto_stats;
+
+/* LTO uses bitmaps with different life-times. So use a seperate
+ obstack for all LTO bitmaps. */
+static bitmap_obstack lto_obstack;
+static bool lto_obstack_initialized;
+
+
+/* Return a string representing LTO tag TAG. */
+
+const char *
+lto_tag_name (enum LTO_tags tag)
+{
+ if (lto_tag_is_tree_code_p (tag))
+ {
+ /* For tags representing tree nodes, return the name of the
+ associated tree code. */
+ return tree_code_name[lto_tag_to_tree_code (tag)];
+ }
+
+ if (lto_tag_is_gimple_code_p (tag))
+ {
+ /* For tags representing gimple statements, return the name of
+ the associated gimple code. */
+ return gimple_code_name[lto_tag_to_gimple_code (tag)];
+ }
+
+ switch (tag)
+ {
+ case LTO_null:
+ return "LTO_null";
+ case LTO_bb0:
+ return "LTO_bb0";
+ case LTO_bb1:
+ return "LTO_bb1";
+ case LTO_eh_region:
+ return "LTO_eh_region";
+ case LTO_function:
+ return "LTO_function";
+ case LTO_eh_table:
+ return "LTO_eh_table";
+ case LTO_ert_cleanup:
+ return "LTO_ert_cleanup";
+ case LTO_ert_try:
+ return "LTO_ert_try";
+ case LTO_ert_allowed_exceptions:
+ return "LTO_ert_allowed_exceptions";
+ case LTO_ert_must_not_throw:
+ return "LTO_ert_must_not_throw";
+ case LTO_tree_pickle_reference:
+ return "LTO_tree_pickle_reference";
+ case LTO_field_decl_ref:
+ return "LTO_field_decl_ref";
+ case LTO_function_decl_ref:
+ return "LTO_function_decl_ref";
+ case LTO_label_decl_ref:
+ return "LTO_label_decl_ref";
+ case LTO_namespace_decl_ref:
+ return "LTO_namespace_decl_ref";
+ case LTO_result_decl_ref:
+ return "LTO_result_decl_ref";
+ case LTO_ssa_name_ref:
+ return "LTO_ssa_name_ref";
+ case LTO_type_decl_ref:
+ return "LTO_type_decl_ref";
+ case LTO_type_ref:
+ return "LTO_type_ref";
+ case LTO_global_decl_ref:
+ return "LTO_global_decl_ref";
+ default:
+ return "LTO_UNKNOWN";
+ }
+}
+
+
+/* Allocate a bitmap from heap. Initializes the LTO obstack if necessary. */
+
+bitmap
+lto_bitmap_alloc (void)
+{
+ if (!lto_obstack_initialized)
+ {
+ bitmap_obstack_initialize (&lto_obstack);
+ lto_obstack_initialized = true;
+ }
+ return BITMAP_ALLOC (&lto_obstack);
+}
+
+/* Free bitmap B. */
+
+void
+lto_bitmap_free (bitmap b)
+{
+ BITMAP_FREE (b);
+}
+
+
+/* Get a section name for a particular type or name. The NAME field
+ is only used if SECTION_TYPE is LTO_section_function_body or
+ LTO_static_initializer. For all others it is ignored. The callee
+ of this function is responcible to free the returned name. */
+
+char *
+lto_get_section_name (int section_type, const char *name)
+{
+ switch (section_type)
+ {
+ case LTO_section_function_body:
+ return concat (LTO_SECTION_NAME_PREFIX, name, NULL);
+
+ case LTO_section_static_initializer:
+ return concat (LTO_SECTION_NAME_PREFIX, ".statics", NULL);
+
+ case LTO_section_symtab:
+ return concat (LTO_SECTION_NAME_PREFIX, ".symtab", NULL);
+
+ case LTO_section_decls:
+ return concat (LTO_SECTION_NAME_PREFIX, ".decls", NULL);
+
+ case LTO_section_cgraph:
+ return concat (LTO_SECTION_NAME_PREFIX, ".cgraph", NULL);
+
+ case LTO_section_jump_functions:
+ return concat (LTO_SECTION_NAME_PREFIX, ".jmpfuncs", NULL);
+
+ case LTO_section_ipa_pure_const:
+ return concat (LTO_SECTION_NAME_PREFIX, ".pureconst", NULL);
+
+ case LTO_section_ipa_reference:
+ return concat (LTO_SECTION_NAME_PREFIX, ".reference", NULL);
+
+ case LTO_section_wpa_fixup:
+ return concat (LTO_SECTION_NAME_PREFIX, ".wpa_fixup", NULL);
+
+ case LTO_section_opts:
+ return concat (LTO_SECTION_NAME_PREFIX, ".opts", NULL);
+
+ default:
+ internal_error ("bytecode stream: unexpected LTO section %s", name);
+ }
+}
+
+
+/* Show various memory usage statistics related to LTO. */
+
+void
+print_lto_report (void)
+{
+ const char *s = (flag_lto) ? "LTO" : (flag_wpa) ? "WPA" : "LTRANS";
+ unsigned i;
+
+ fprintf (stderr, "%s statistics\n", s);
+ fprintf (stderr, "[%s] # of input files: "
+ HOST_WIDE_INT_PRINT_UNSIGNED "\n", s, lto_stats.num_input_files);
+
+ fprintf (stderr, "[%s] # of input cgraph nodes: "
+ HOST_WIDE_INT_PRINT_UNSIGNED "\n", s,
+ lto_stats.num_input_cgraph_nodes);
+
+ fprintf (stderr, "[%s] # of function bodies: "
+ HOST_WIDE_INT_PRINT_UNSIGNED "\n", s,
+ lto_stats.num_function_bodies);
+
+ fprintf (stderr, "[%s] ", s);
+ print_gimple_types_stats ();
+
+ for (i = 0; i < NUM_TREE_CODES; i++)
+ if (lto_stats.num_trees[i])
+ fprintf (stderr, "[%s] # of '%s' objects read: "
+ HOST_WIDE_INT_PRINT_UNSIGNED "\n", s,
+ tree_code_name[i], lto_stats.num_trees[i]);
+
+ if (flag_lto)
+ {
+ fprintf (stderr, "[%s] Compression: "
+ HOST_WIDE_INT_PRINT_UNSIGNED " output bytes, "
+ HOST_WIDE_INT_PRINT_UNSIGNED " compressed bytes", s,
+ lto_stats.num_output_il_bytes,
+ lto_stats.num_compressed_il_bytes);
+ if (lto_stats.num_output_il_bytes > 0)
+ {
+ const float dividend = (float) lto_stats.num_compressed_il_bytes;
+ const float divisor = (float) lto_stats.num_output_il_bytes;
+ fprintf (stderr, " (ratio: %f)", dividend / divisor);
+ }
+ fprintf (stderr, "\n");
+ }
+
+ if (flag_wpa)
+ {
+ fprintf (stderr, "[%s] # of output files: "
+ HOST_WIDE_INT_PRINT_UNSIGNED "\n", s,
+ lto_stats.num_output_files);
+
+ fprintf (stderr, "[%s] # of output cgraph nodes: "
+ HOST_WIDE_INT_PRINT_UNSIGNED "\n", s,
+ lto_stats.num_output_cgraph_nodes);
+
+ fprintf (stderr, "[%s] # callgraph partitions: "
+ HOST_WIDE_INT_PRINT_UNSIGNED "\n", s,
+ lto_stats.num_cgraph_partitions);
+
+ fprintf (stderr, "[%s] Compression: "
+ HOST_WIDE_INT_PRINT_UNSIGNED " input bytes, "
+ HOST_WIDE_INT_PRINT_UNSIGNED " uncompressed bytes", s,
+ lto_stats.num_input_il_bytes,
+ lto_stats.num_uncompressed_il_bytes);
+ if (lto_stats.num_input_il_bytes > 0)
+ {
+ const float dividend = (float) lto_stats.num_uncompressed_il_bytes;
+ const float divisor = (float) lto_stats.num_input_il_bytes;
+ fprintf (stderr, " (ratio: %f)", dividend / divisor);
+ }
+ fprintf (stderr, "\n");
+ }
+
+ for (i = 0; i < LTO_N_SECTION_TYPES; i++)
+ fprintf (stderr, "[%s] Size of mmap'd section %s: "
+ HOST_WIDE_INT_PRINT_UNSIGNED " bytes\n", s,
+ lto_section_name[i], lto_stats.section_size[i]);
+}
+
+
+/* Create a new bitpack. */
+
+struct bitpack_d *
+bitpack_create (void)
+{
+ return XCNEW (struct bitpack_d);
+}
+
+
+/* Free the memory used by bitpack BP. */
+
+void
+bitpack_delete (struct bitpack_d *bp)
+{
+ VEC_free (bitpack_word_t, heap, bp->values);
+ free (bp);
+}
+
+
+/* Return an index to the word in bitpack BP that contains the
+ next NBITS. */
+
+static inline unsigned
+bp_get_next_word (struct bitpack_d *bp, unsigned nbits)
+{
+ unsigned last, ix;
+
+ /* In principle, the next word to use is determined by the
+ number of bits already processed in BP. */
+ ix = bp->num_bits / BITS_PER_BITPACK_WORD;
+
+ /* All the encoded bit patterns in BP are contiguous, therefore if
+ the next NBITS would straddle over two different words, move the
+ index to the next word and update the number of encoded bits
+ by adding up the hole of unused bits created by this move. */
+ bp->first_unused_bit %= BITS_PER_BITPACK_WORD;
+ last = bp->first_unused_bit + nbits - 1;
+ if (last >= BITS_PER_BITPACK_WORD)
+ {
+ ix++;
+ bp->num_bits += (BITS_PER_BITPACK_WORD - bp->first_unused_bit);
+ bp->first_unused_bit = 0;
+ }
+
+ return ix;
+}
+
+
+/* Pack NBITS of value VAL into bitpack BP. */
+
+void
+bp_pack_value (struct bitpack_d *bp, bitpack_word_t val, unsigned nbits)
+{
+ unsigned ix;
+ bitpack_word_t word;
+
+ /* We cannot encode more bits than BITS_PER_BITPACK_WORD. */
+ gcc_assert (nbits > 0 && nbits <= BITS_PER_BITPACK_WORD);
+
+ /* Compute which word will contain the next NBITS. */
+ ix = bp_get_next_word (bp, nbits);
+ if (ix >= VEC_length (bitpack_word_t, bp->values))
+ {
+ /* If there is no room left in the last word of the values
+ array, add a new word. Additionally, we should only
+ need to add a single word, since every pack operation cannot
+ use more bits than fit in a single word. */
+ gcc_assert (ix < VEC_length (bitpack_word_t, bp->values) + 1);
+ VEC_safe_push (bitpack_word_t, heap, bp->values, 0);
+ }
+
+ /* Grab the last word to pack VAL into. */
+ word = VEC_index (bitpack_word_t, bp->values, ix);
+
+ /* To fit VAL in WORD, we need to shift VAL to the left to
+ skip the bottom BP->FIRST_UNUSED_BIT bits. */
+ gcc_assert (BITS_PER_BITPACK_WORD >= bp->first_unused_bit + nbits);
+ val <<= bp->first_unused_bit;
+
+ /* Update WORD with VAL. */
+ word |= val;
+
+ /* Update BP. */
+ VEC_replace (bitpack_word_t, bp->values, ix, word);
+ bp->num_bits += nbits;
+ bp->first_unused_bit += nbits;
+}
+
+
+/* Unpack the next NBITS from bitpack BP. */
+
+bitpack_word_t
+bp_unpack_value (struct bitpack_d *bp, unsigned nbits)
+{
+ bitpack_word_t val, word, mask;
+ unsigned ix;
+
+ /* We cannot decode more bits than BITS_PER_BITPACK_WORD. */
+ gcc_assert (nbits > 0 && nbits <= BITS_PER_BITPACK_WORD);
+
+ /* Compute which word contains the next NBITS. */
+ ix = bp_get_next_word (bp, nbits);
+ word = VEC_index (bitpack_word_t, bp->values, ix);
+
+ /* Compute the mask to get NBITS from WORD. */
+ mask = (nbits == BITS_PER_BITPACK_WORD)
+ ? (bitpack_word_t) -1
+ : ((bitpack_word_t) 1 << nbits) - 1;
+
+ /* Shift WORD to the right to skip over the bits already decoded
+ in word. */
+ word >>= bp->first_unused_bit;
+
+ /* Apply the mask to obtain the requested value. */
+ val = word & mask;
+
+ /* Update BP->NUM_BITS for the next unpack operation. */
+ bp->num_bits += nbits;
+ bp->first_unused_bit += nbits;
+
+ return val;
+}
+
+
+/* Check that all the TS_* structures handled by the lto_output_* and
+ lto_input_* routines are exactly ALL the structures defined in
+ treestruct.def. */
+
+static void
+check_handled_ts_structures (void)
+{
+ bool handled_p[LAST_TS_ENUM];
+ unsigned i;
+
+ memset (&handled_p, 0, sizeof (handled_p));
+
+ /* These are the TS_* structures that are either handled or
+ explicitly ignored by the streamer routines. */
+ handled_p[TS_BASE] = true;
+ handled_p[TS_COMMON] = true;
+ handled_p[TS_INT_CST] = true;
+ handled_p[TS_REAL_CST] = true;
+ handled_p[TS_FIXED_CST] = true;
+ handled_p[TS_VECTOR] = true;
+ handled_p[TS_STRING] = true;
+ handled_p[TS_COMPLEX] = true;
+ handled_p[TS_IDENTIFIER] = true;
+ handled_p[TS_DECL_MINIMAL] = true;
+ handled_p[TS_DECL_COMMON] = true;
+ handled_p[TS_DECL_WRTL] = true;
+ handled_p[TS_DECL_NON_COMMON] = true;
+ handled_p[TS_DECL_WITH_VIS] = true;
+ handled_p[TS_FIELD_DECL] = true;
+ handled_p[TS_VAR_DECL] = true;
+ handled_p[TS_PARM_DECL] = true;
+ handled_p[TS_LABEL_DECL] = true;
+ handled_p[TS_RESULT_DECL] = true;
+ handled_p[TS_CONST_DECL] = true;
+ handled_p[TS_TYPE_DECL] = true;
+ handled_p[TS_FUNCTION_DECL] = true;
+ handled_p[TS_TYPE] = true;
+ handled_p[TS_LIST] = true;
+ handled_p[TS_VEC] = true;
+ handled_p[TS_EXP] = true;
+ handled_p[TS_SSA_NAME] = true;
+ handled_p[TS_BLOCK] = true;
+ handled_p[TS_BINFO] = true;
+ handled_p[TS_STATEMENT_LIST] = true;
+ handled_p[TS_CONSTRUCTOR] = true;
+ handled_p[TS_OMP_CLAUSE] = true;
+ handled_p[TS_OPTIMIZATION] = true;
+ handled_p[TS_TARGET_OPTION] = true;
+
+ /* Anything not marked above will trigger the following assertion.
+ If this assertion triggers, it means that there is a new TS_*
+ structure that should be handled by the streamer. */
+ for (i = 0; i < LAST_TS_ENUM; i++)
+ gcc_assert (handled_p[i]);
+}
+
+
+/* Helper for lto_streamer_cache_insert_1. Add T to CACHE->NODES at
+ slot IX. Add OFFSET to CACHE->OFFSETS at slot IX. */
+
+static void
+lto_streamer_cache_add_to_node_array (struct lto_streamer_cache_d *cache,
+ int ix, tree t, unsigned offset)
+{
+ gcc_assert (ix >= 0);
+
+ /* Grow the array of nodes and offsets to accomodate T at IX. */
+ if (ix >= (int) VEC_length (tree, cache->nodes))
+ {
+ size_t sz = ix + (20 + ix) / 4;
+ VEC_safe_grow_cleared (tree, gc, cache->nodes, sz);
+ VEC_safe_grow_cleared (unsigned, heap, cache->offsets, sz);
+ }
+
+ VEC_replace (tree, cache->nodes, ix, t);
+ VEC_replace (unsigned, cache->offsets, ix, offset);
+}
+
+
+/* Helper for lto_streamer_cache_insert and lto_streamer_cache_insert_at.
+ CACHE, T, IX_P and OFFSET_P are as in lto_streamer_cache_insert.
+
+ If INSERT_AT_NEXT_SLOT_P is true, T is inserted at the next available
+ slot in the cache. Otherwise, T is inserted at the position indicated
+ in *IX_P.
+
+ If T already existed in CACHE, return true. Otherwise,
+ return false. */
+
+static bool
+lto_streamer_cache_insert_1 (struct lto_streamer_cache_d *cache,
+ tree t, int *ix_p, unsigned *offset_p,
+ bool insert_at_next_slot_p)
+{
+ void **slot;
+ struct tree_int_map d_entry, *entry;
+ int ix;
+ unsigned offset;
+ bool existed_p;
+
+ gcc_assert (t);
+
+ d_entry.base.from = t;
+ slot = htab_find_slot (cache->node_map, &d_entry, INSERT);
+ if (*slot == NULL)
+ {
+ /* Determine the next slot to use in the cache. */
+ if (insert_at_next_slot_p)
+ ix = cache->next_slot++;
+ else
+ ix = *ix_p;
+
+ entry = XCNEW (struct tree_int_map);
+ entry->base.from = t;
+ entry->to = (unsigned) ix;
+ *slot = entry;
+
+ /* If no offset was given, store the invalid offset -1. */
+ offset = (offset_p) ? *offset_p : (unsigned) -1;
+
+ lto_streamer_cache_add_to_node_array (cache, ix, t, offset);
+
+ /* Indicate that the item was not present in the cache. */
+ existed_p = false;
+ }
+ else
+ {
+ entry = (struct tree_int_map *) *slot;
+ ix = (int) entry->to;
+ offset = VEC_index (unsigned, cache->offsets, ix);
+
+ if (!insert_at_next_slot_p && ix != *ix_p)
+ {
+ /* If the caller wants to insert T at a specific slot
+ location, and ENTRY->TO does not match *IX_P, add T to
+ the requested location slot. This situation arises when
+ streaming builtin functions.
+
+ For instance, on the writer side we could have two
+ FUNCTION_DECLS T1 and T2 that are represented by the same
+ builtin function. The reader will only instantiate the
+ canonical builtin, but since T1 and T2 had been
+ originally stored in different cache slots (S1 and S2),
+ the reader must be able to find the canonical builtin
+ function at slots S1 and S2. */
+ gcc_assert (lto_stream_as_builtin_p (t));
+ ix = *ix_p;
+
+ /* Since we are storing a builtin, the offset into the
+ stream is not necessary as we will not need to read
+ forward in the stream. */
+ lto_streamer_cache_add_to_node_array (cache, ix, t, -1);
+ }
+
+ /* Indicate that T was already in the cache. */
+ existed_p = true;
+ }
+
+ if (ix_p)
+ *ix_p = ix;
+
+ if (offset_p)
+ *offset_p = offset;
+
+ return existed_p;
+}
+
+
+/* Insert tree node T in CACHE. If T already existed in the cache
+ return true. Otherwise, return false.
+
+ If IX_P is non-null, update it with the index into the cache where
+ T has been stored.
+
+ *OFFSET_P represents the offset in the stream where T is physically
+ written out. The first time T is added to the cache, *OFFSET_P is
+ recorded in the cache together with T. But if T already existed
+ in the cache, *OFFSET_P is updated with the value that was recorded
+ the first time T was added to the cache.
+
+ If OFFSET_P is NULL, it is ignored. */
+
+bool
+lto_streamer_cache_insert (struct lto_streamer_cache_d *cache, tree t,
+ int *ix_p, unsigned *offset_p)
+{
+ return lto_streamer_cache_insert_1 (cache, t, ix_p, offset_p, true);
+}
+
+
+/* Insert tree node T in CACHE at slot IX. If T already
+ existed in the cache return true. Otherwise, return false. */
+
+bool
+lto_streamer_cache_insert_at (struct lto_streamer_cache_d *cache,
+ tree t, int ix)
+{
+ return lto_streamer_cache_insert_1 (cache, t, &ix, NULL, false);
+}
+
+
+/* Return true if tree node T exists in CACHE. If IX_P is
+ not NULL, write to *IX_P the index into the cache where T is stored
+ (-1 if T is not found). */
+
+bool
+lto_streamer_cache_lookup (struct lto_streamer_cache_d *cache, tree t,
+ int *ix_p)
+{
+ void **slot;
+ struct tree_int_map d_slot;
+ bool retval;
+ int ix;
+
+ gcc_assert (t);
+
+ d_slot.base.from = t;
+ slot = htab_find_slot (cache->node_map, &d_slot, NO_INSERT);
+ if (slot == NULL)
+ {
+ retval = false;
+ ix = -1;
+ }
+ else
+ {
+ retval = true;
+ ix = (int) ((struct tree_int_map *) *slot)->to;
+ }
+
+ if (ix_p)
+ *ix_p = ix;
+
+ return retval;
+}
+
+
+/* Return the tree node at slot IX in CACHE. */
+
+tree
+lto_streamer_cache_get (struct lto_streamer_cache_d *cache, int ix)
+{
+ gcc_assert (cache);
+
+ /* If the reader is requesting an index beyond the length of the
+ cache, it will need to read ahead. Return NULL_TREE to indicate
+ that. */
+ if ((unsigned) ix >= VEC_length (tree, cache->nodes))
+ return NULL_TREE;
+
+ return VEC_index (tree, cache->nodes, (unsigned) ix);
+}
+
+
+/* Record NODE in COMMON_NODES if it is not NULL and is not already in
+ SEEN_NODES. */
+
+static void
+lto_record_common_node (tree *nodep, VEC(tree, heap) **common_nodes,
+ struct pointer_set_t *seen_nodes)
+{
+ tree node = *nodep;
+
+ if (node == NULL_TREE)
+ return;
+
+ if (TYPE_P (node))
+ *nodep = node = gimple_register_type (node);
+
+ /* Return if node is already seen. */
+ if (pointer_set_insert (seen_nodes, node))
+ return;
+
+ VEC_safe_push (tree, heap, *common_nodes, node);
+
+ if (tree_node_can_be_shared (node))
+ {
+ if (POINTER_TYPE_P (node)
+ || TREE_CODE (node) == COMPLEX_TYPE
+ || TREE_CODE (node) == ARRAY_TYPE)
+ lto_record_common_node (&TREE_TYPE (node), common_nodes, seen_nodes);
+ }
+}
+
+
+/* Generate a vector of common nodes and make sure they are merged
+ properly according to the the gimple type table. */
+
+static VEC(tree,heap) *
+lto_get_common_nodes (void)
+{
+ unsigned i;
+ VEC(tree,heap) *common_nodes = NULL;
+ struct pointer_set_t *seen_nodes;
+
+ /* The MAIN_IDENTIFIER_NODE is normally set up by the front-end, but the
+ LTO back-end must agree. Currently, the only languages that set this
+ use the name "main". */
+ if (main_identifier_node)
+ {
+ const char *main_name = IDENTIFIER_POINTER (main_identifier_node);
+ gcc_assert (strcmp (main_name, "main") == 0);
+ }
+ else
+ main_identifier_node = get_identifier ("main");
+
+ gcc_assert (ptrdiff_type_node == integer_type_node);
+
+ /* FIXME lto. In the C++ front-end, fileptr_type_node is defined as a
+ variant copy of of ptr_type_node, rather than ptr_node itself. The
+ distinction should only be relevant to the front-end, so we always
+ use the C definition here in lto1.
+
+ These should be assured in pass_ipa_free_lang_data. */
+ gcc_assert (fileptr_type_node == ptr_type_node);
+ gcc_assert (TYPE_MAIN_VARIANT (fileptr_type_node) == ptr_type_node);
+
+ seen_nodes = pointer_set_create ();
+
+ /* Skip itk_char. char_type_node is shared with the appropriately
+ signed variant. */
+ for (i = itk_signed_char; i < itk_none; i++)
+ lto_record_common_node (&integer_types[i], &common_nodes, seen_nodes);
+
+ for (i = 0; i < TYPE_KIND_LAST; i++)
+ lto_record_common_node (&sizetype_tab[i], &common_nodes, seen_nodes);
+
+ for (i = 0; i < TI_MAX; i++)
+ lto_record_common_node (&global_trees[i], &common_nodes, seen_nodes);
+
+ pointer_set_destroy (seen_nodes);
+
+ return common_nodes;
+}
+
+
+/* Assign an index to tree node T and enter it in the streamer cache
+ CACHE. */
+
+static void
+preload_common_node (struct lto_streamer_cache_d *cache, tree t)
+{
+ gcc_assert (t);
+
+ lto_streamer_cache_insert (cache, t, NULL, NULL);
+
+ /* The FIELD_DECLs of structures should be shared, so that every
+ COMPONENT_REF uses the same tree node when referencing a field.
+ Pointer equality between FIELD_DECLs is used by the alias
+ machinery to compute overlapping memory references (See
+ nonoverlapping_component_refs_p). */
+ if (TREE_CODE (t) == RECORD_TYPE)
+ {
+ tree f;
+
+ for (f = TYPE_FIELDS (t); f; f = TREE_CHAIN (f))
+ preload_common_node (cache, f);
+ }
+}
+
+
+/* Create a cache of pickled nodes. */
+
+struct lto_streamer_cache_d *
+lto_streamer_cache_create (void)
+{
+ struct lto_streamer_cache_d *cache;
+ VEC(tree, heap) *common_nodes;
+ unsigned i;
+ tree node;
+
+ cache = XCNEW (struct lto_streamer_cache_d);
+
+ cache->node_map = htab_create (101, tree_int_map_hash, tree_int_map_eq, NULL);
+
+ /* Load all the well-known tree nodes that are always created by
+ the compiler on startup. This prevents writing them out
+ unnecessarily. */
+ common_nodes = lto_get_common_nodes ();
+
+ for (i = 0; VEC_iterate (tree, common_nodes, i, node); i++)
+ preload_common_node (cache, node);
+
+ VEC_free(tree, heap, common_nodes);
+
+ return cache;
+}
+
+
+/* Delete the streamer cache C. */
+
+void
+lto_streamer_cache_delete (struct lto_streamer_cache_d *c)
+{
+ if (c == NULL)
+ return;
+
+ htab_delete (c->node_map);
+ VEC_free (tree, gc, c->nodes);
+ VEC_free (unsigned, heap, c->offsets);
+ free (c);
+}
+
+
+/* Initialization common to the LTO reader and writer. */
+
+void
+lto_streamer_init (void)
+{
+ /* Check that all the TS_* handled by the reader and writer routines
+ match exactly the structures defined in treestruct.def. When a
+ new TS_* astructure is added, the streamer should be updated to
+ handle it. */
+ check_handled_ts_structures ();
+}
+
+
+/* Gate function for all LTO streaming passes. */
+
+bool
+gate_lto_out (void)
+{
+ return ((flag_generate_lto || in_lto_p)
+ /* Don't bother doing anything if the program has errors. */
+ && !(errorcount || sorrycount));
+}
+
+
+#ifdef LTO_STREAMER_DEBUG
+/* Add a mapping between T and ORIG_T, which is the numeric value of
+ the original address of T as it was seen by the LTO writer. This
+ mapping is useful when debugging streaming problems. A debugging
+ session can be started on both reader and writer using ORIG_T
+ as a breakpoint value in both sessions.
+
+ Note that this mapping is transient and only valid while T is
+ being reconstructed. Once T is fully built, the mapping is
+ removed. */
+
+void
+lto_orig_address_map (tree t, intptr_t orig_t)
+{
+ /* FIXME lto. Using the annotation field is quite hacky as it relies
+ on the GC not running while T is being rematerialized. It would
+ be cleaner to use a hash table here. */
+ t->base.ann = (union tree_ann_d *) orig_t;
+}
+
+
+/* Get the original address of T as it was seen by the writer. This
+ is only valid while T is being reconstructed. */
+
+intptr_t
+lto_orig_address_get (tree t)
+{
+ return (intptr_t) t->base.ann;
+}
+
+
+/* Clear the mapping of T to its original address. */
+
+void
+lto_orig_address_remove (tree t)
+{
+ t->base.ann = NULL;
+}
+#endif
+
+
+/* Check that the version MAJOR.MINOR is the correct version number. */
+
+void
+lto_check_version (int major, int minor)
+{
+ if (major != LTO_major_version || minor != LTO_minor_version)
+ fatal_error ("bytecode stream generated with LTO version %d.%d instead "
+ "of the expected %d.%d",
+ major, minor,
+ LTO_major_version, LTO_minor_version);
+}
diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h
new file mode 100644
index 00000000000..c3880b61efa
--- /dev/null
+++ b/gcc/lto-streamer.h
@@ -0,0 +1,1046 @@
+/* Data structures and declarations used for reading and writing
+ GIMPLE to a file stream.
+
+ Copyright (C) 2009 Free Software Foundation, Inc.
+ Contributed by Doug Kwan <dougkwan@google.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef GCC_LTO_STREAMER_H
+#define GCC_LTO_STREAMER_H
+
+#include "plugin-api.h"
+#include "tree.h"
+#include "gimple.h"
+#include "target.h"
+#include "cgraph.h"
+#include "vec.h"
+#include "vecprim.h"
+
+/* Define when debugging the LTO streamer. This causes the writer
+ to output the numeric value for the memory address of the tree node
+ being emitted. When debugging a problem in the reader, check the
+ original address that the writer was emitting using lto_orig_address_get.
+ With this value, set a breakpoint in the writer (e.g., lto_output_tree)
+ to trace how the faulty node is being emitted. */
+/* #define LTO_STREAMER_DEBUG 1 */
+
+/* The encoding for a function consists of the following sections:
+
+ 1) The header.
+ 2) FIELD_DECLS.
+ 3) FUNCTION_DECLS.
+ 4) global VAR_DECLS.
+ 5) type_decls
+ 6) types.
+ 7) Names for the labels that have names
+ 8) The SSA names.
+ 9) The control flow graph.
+ 10-11)Gimple for local decls.
+ 12) Gimple for the function.
+ 13) Strings.
+
+ 1) THE HEADER.
+ 2-6) THE GLOBAL DECLS AND TYPES.
+
+ The global decls and types are encoded in the same way. For each
+ entry, there is word with the offset within the section to the
+ entry.
+
+ 7) THE LABEL NAMES.
+
+ Since most labels do not have names, this section my be of zero
+ length. It consists of an array of string table references, one
+ per label. In the lto code, the labels are given either
+ positive or negative indexes. the positive ones have names and
+ the negative ones do not. The positive index can be used to
+ find the name in this array.
+
+ 9) THE CFG.
+
+ 10) Index into the local decls. Since local decls can have local
+ decls inside them, they must be read in randomly in order to
+ properly restore them.
+
+ 11-12) GIMPLE FOR THE LOCAL DECLS AND THE FUNCTION BODY.
+
+ The gimple consists of a set of records.
+
+ THE FUNCTION
+
+ At the top level of (8) is the function. It consists of five
+ pieces:
+
+ LTO_function - The tag.
+ eh tree - This is all of the exception handling regions
+ put out in a post order traversial of the
+ tree. Siblings are output as lists terminated
+ by a 0. The set of fields matches the fields
+ defined in except.c.
+
+ last_basic_block - in uleb128 form.
+
+ basic blocks - This is the set of basic blocks.
+
+ zero - The termination of the basic blocks.
+
+ BASIC BLOCKS
+
+ There are two forms of basic blocks depending on if they are
+ empty or not.
+
+ The basic block consists of:
+
+ LTO_bb1 or LTO_bb0 - The tag.
+
+ bb->index - the index in uleb128 form.
+
+ #succs - The number of successors un uleb128 form.
+
+ the successors - For each edge, a pair. The first of the
+ pair is the index of the successor in
+ uleb128 form and the second are the flags in
+ uleb128 form.
+
+ the statements - A gimple tree, as described above.
+ These are only present for LTO_BB1.
+ Following each statement is an optional
+ exception handling record LTO_eh_region
+ which contains the region number (for
+ regions >= 0).
+
+ zero - This is only present for LTO_BB1 and is used
+ to terminate the statements and exception
+ regions within this block.
+
+ 12) STRINGS
+
+ String are represented in the table as pairs, a length in ULEB128
+ form followed by the data for the string. */
+
+/* The string that is the prefix on the section names we make for lto.
+ For decls the DECL_ASSEMBLER_NAME is appended to make the section
+ name for the functions and static_initializers. For other types of
+ sections a '.' and the section type are appended. */
+#define LTO_SECTION_NAME_PREFIX ".gnu.lto_"
+
+#define LTO_major_version 1
+#define LTO_minor_version 0
+
+typedef unsigned char lto_decl_flags_t;
+
+
+/* Data structures used to pack values and bitflags into a vector of
+ words. Used to stream values of a fixed number of bits in a space
+ efficient way. */
+static unsigned const BITS_PER_BITPACK_WORD = HOST_BITS_PER_WIDE_INT;
+
+typedef unsigned HOST_WIDE_INT bitpack_word_t;
+DEF_VEC_I(bitpack_word_t);
+DEF_VEC_ALLOC_I(bitpack_word_t, heap);
+
+struct bitpack_d
+{
+ /* Total number of bits packed/unpacked so far. */
+ size_t num_bits;
+
+ /* Values are stored contiguously, so there may be internal
+ fragmentation (words with unused bits). Therefore, we need to
+ keep track of the first available bit in the last word of the
+ bitpack. */
+ size_t first_unused_bit;
+
+ /* Vector of words holding the packed values. */
+ VEC(bitpack_word_t, heap) *values;
+};
+
+/* Tags representing the various IL objects written to the bytecode file
+ (GIMPLE statements, basic blocks, EH regions, tree nodes, etc).
+
+ NOTE, when adding new LTO tags, also update lto_tag_name. */
+enum LTO_tags
+{
+ LTO_null = 0,
+
+ /* Reserve enough entries to fit all the tree and gimple codes handled
+ by the streamer. This guarantees that:
+
+ 1- Given a tree code C:
+ enum LTO_tags tag == C + 1
+
+ 2- Given a gimple code C:
+ enum LTO_tags tag == C + NUM_TREE_CODES + 1
+
+ Conversely, to map between LTO tags and tree/gimple codes, the
+ reverse operation must be applied. */
+ LTO_bb0 = 1 + NUM_TREE_CODES + LAST_AND_UNUSED_GIMPLE_CODE,
+ LTO_bb1,
+
+ /* EH region holding the previous statement. */
+ LTO_eh_region,
+
+ /* An MD or NORMAL builtin. Only the code and class are streamed out. */
+ LTO_builtin_decl,
+
+ /* Function body. */
+ LTO_function,
+
+ /* EH table. */
+ LTO_eh_table,
+
+ /* EH region types. These mirror enum eh_region_type. */
+ LTO_ert_cleanup,
+ LTO_ert_try,
+ LTO_ert_allowed_exceptions,
+ LTO_ert_must_not_throw,
+
+ /* EH landing pad. */
+ LTO_eh_landing_pad,
+
+ /* EH try/catch node. */
+ LTO_eh_catch,
+
+ /* Special for global streamer. Reference to previously-streamed node. */
+ LTO_tree_pickle_reference,
+
+ /* References to indexable tree nodes. These objects are stored in
+ tables that are written separately from the function bodies that
+ reference them. This way they can be instantiated even when the
+ referencing functions aren't (e.g., during WPA) and it also allows
+ functions to be copied from one file to another without having
+ to unpickle the body first (the references are location
+ independent).
+
+ NOTE, do not regroup these values as the grouping is exposed
+ in the range checks done in lto_input_tree. */
+ LTO_field_decl_ref, /* Do not change. */
+ LTO_function_decl_ref,
+ LTO_label_decl_ref,
+ LTO_namespace_decl_ref,
+ LTO_result_decl_ref,
+ LTO_ssa_name_ref,
+ LTO_type_decl_ref,
+ LTO_type_ref,
+ LTO_const_decl_ref,
+ LTO_imported_decl_ref,
+ LTO_global_decl_ref, /* Do not change. */
+
+ /* This tag must always be last. */
+ LTO_NUM_TAGS
+};
+
+
+/* Set of section types that are in an LTO file. This list will grow
+ as the number of IPA passes grows since each IPA pass will need its
+ own section type to store its summary information.
+
+ When adding a new section type, you must also extend the
+ LTO_SECTION_NAME array in lto-section-in.c. */
+enum lto_section_type
+{
+ LTO_section_decls = 0,
+ LTO_section_function_body,
+ LTO_section_static_initializer,
+ LTO_section_cgraph,
+ LTO_section_jump_functions,
+ LTO_section_ipa_pure_const,
+ LTO_section_ipa_reference,
+ LTO_section_symtab,
+ LTO_section_wpa_fixup,
+ LTO_section_opts,
+ LTO_N_SECTION_TYPES /* Must be last. */
+};
+
+/* Indices to the various function, type and symbol streams. */
+typedef enum
+{
+ LTO_DECL_STREAM_TYPE = 0, /* Must be first. */
+ LTO_DECL_STREAM_FIELD_DECL,
+ LTO_DECL_STREAM_FN_DECL,
+ LTO_DECL_STREAM_VAR_DECL,
+ LTO_DECL_STREAM_TYPE_DECL,
+ LTO_DECL_STREAM_NAMESPACE_DECL,
+ LTO_DECL_STREAM_LABEL_DECL,
+ LTO_N_DECL_STREAMS
+} lto_decl_stream_e_t;
+
+typedef enum ld_plugin_symbol_resolution ld_plugin_symbol_resolution_t;
+DEF_VEC_I(ld_plugin_symbol_resolution_t);
+DEF_VEC_ALLOC_I(ld_plugin_symbol_resolution_t, heap);
+
+
+/* Macro to define convenience functions for type and decl streams
+ in lto_file_decl_data. */
+#define DEFINE_DECL_STREAM_FUNCS(UPPER_NAME, name) \
+static inline tree \
+lto_file_decl_data_get_ ## name (struct lto_file_decl_data *data, \
+ unsigned int idx) \
+{ \
+ struct lto_in_decl_state *state = data->current_decl_state; \
+ gcc_assert (idx < state->streams[LTO_DECL_STREAM_## UPPER_NAME].size); \
+ return state->streams[LTO_DECL_STREAM_## UPPER_NAME].trees[idx]; \
+} \
+\
+static inline unsigned int \
+lto_file_decl_data_num_ ## name ## s (struct lto_file_decl_data *data) \
+{ \
+ struct lto_in_decl_state *state = data->current_decl_state; \
+ return state->streams[LTO_DECL_STREAM_## UPPER_NAME].size; \
+}
+
+
+/* Return a char pointer to the start of a data stream for an lto pass
+ or function. The first parameter is the file data that contains
+ the information. The second parameter is the type of information
+ to be obtained. The third parameter is the name of the function
+ and is only used when finding a function body; otherwise it is
+ NULL. The fourth parameter is the length of the data returned. */
+typedef const char* (lto_get_section_data_f) (struct lto_file_decl_data *,
+ enum lto_section_type,
+ const char *,
+ size_t *);
+
+/* Return the data found from the above call. The first three
+ parameters are the same as above. The fourth parameter is the data
+ itself and the fifth is the lenght of the data. */
+typedef void (lto_free_section_data_f) (struct lto_file_decl_data *,
+ enum lto_section_type,
+ const char *,
+ const char *,
+ size_t);
+
+/* Cache of pickled nodes. Used to avoid writing the same node more
+ than once. The first time a tree node is streamed out, it is
+ entered in this cache. Subsequent references to the same node are
+ resolved by looking it up in this cache.
+
+ This is used in two ways:
+
+ - On the writing side, the first time T is added to STREAMER_CACHE,
+ a new reference index is created for T and T is emitted on the
+ stream. If T needs to be emitted again to the stream, instead of
+ pickling it again, the reference index is emitted.
+
+ - On the reading side, the first time T is read from the stream, it
+ is reconstructed in memory and a new reference index created for
+ T. The reconstructed T is inserted in some array so that when
+ the reference index for T is found in the input stream, it can be
+ used to look up into the array to get the reconstructed T. */
+struct lto_streamer_cache_d
+{
+ /* The mapping between tree nodes and slots into the nodes array. */
+ htab_t node_map;
+
+ /* Next available slot in the nodes and offsets arrays. */
+ unsigned next_slot;
+
+ /* The nodes pickled so far. */
+ VEC(tree,gc) *nodes;
+
+ /* Offset into the stream where the nodes have been written. */
+ VEC(unsigned,heap) *offsets;
+};
+
+
+/* Structure used as buffer for reading an LTO file. */
+struct lto_input_block
+{
+ const char *data;
+ unsigned int p;
+ unsigned int len;
+};
+
+#define LTO_INIT_INPUT_BLOCK(BASE,D,P,L) \
+ do { \
+ BASE.data = D; \
+ BASE.p = P; \
+ BASE.len = L; \
+ } while (0)
+
+#define LTO_INIT_INPUT_BLOCK_PTR(BASE,D,P,L) \
+ do { \
+ BASE->data = D; \
+ BASE->p = P; \
+ BASE->len = L; \
+ } while (0)
+
+
+/* The is the first part of the record for a function or constructor
+ in the .o file. */
+struct lto_header
+{
+ int16_t major_version;
+ int16_t minor_version;
+ enum lto_section_type section_type;
+};
+
+/* The header for a function body. */
+struct lto_function_header
+{
+ /* The header for all types of sections. */
+ struct lto_header lto_header;
+
+ /* Number of labels with names. */
+ int32_t num_named_labels;
+
+ /* Number of labels without names. */
+ int32_t num_unnamed_labels;
+
+ /* Size compressed or 0 if not compressed. */
+ int32_t compressed_size;
+
+ /* Size of names for named labels. */
+ int32_t named_label_size;
+
+ /* Size of the cfg. */
+ int32_t cfg_size;
+
+ /* Size of main gimple body of function. */
+ int32_t main_size;
+
+ /* Size of the string table. */
+ int32_t string_size;
+};
+
+
+/* Structure describing a symbol section. */
+struct lto_decl_header
+{
+ /* The header for all types of sections. */
+ struct lto_header lto_header;
+
+ /* Size of region for decl state. */
+ int32_t decl_state_size;
+
+ /* Number of nodes in globals stream. */
+ int32_t num_nodes;
+
+ /* Size of region for expressions, decls, types, etc. */
+ int32_t main_size;
+
+ /* Size of the string table. */
+ int32_t string_size;
+};
+
+
+/* Statistics gathered during LTO, WPA and LTRANS. */
+struct lto_stats_d
+{
+ unsigned HOST_WIDE_INT num_input_cgraph_nodes;
+ unsigned HOST_WIDE_INT num_output_cgraph_nodes;
+ unsigned HOST_WIDE_INT num_input_files;
+ unsigned HOST_WIDE_INT num_output_files;
+ unsigned HOST_WIDE_INT num_cgraph_partitions;
+ unsigned HOST_WIDE_INT section_size[LTO_N_SECTION_TYPES];
+ unsigned HOST_WIDE_INT num_function_bodies;
+ unsigned HOST_WIDE_INT num_trees[NUM_TREE_CODES];
+ unsigned HOST_WIDE_INT num_output_il_bytes;
+ unsigned HOST_WIDE_INT num_compressed_il_bytes;
+ unsigned HOST_WIDE_INT num_input_il_bytes;
+ unsigned HOST_WIDE_INT num_uncompressed_il_bytes;
+};
+
+/* Encoder data structure used to stream callgraph nodes. */
+struct lto_cgraph_encoder_d
+{
+ /* Map nodes to reference number. */
+ struct pointer_map_t *map;
+
+ /* Map reference number to node. */
+ VEC(cgraph_node_ptr,heap) *nodes;
+};
+
+typedef struct lto_cgraph_encoder_d *lto_cgraph_encoder_t;
+
+/* Mapping from indices to trees. */
+struct lto_tree_ref_table
+{
+ /* Array of referenced trees . */
+ tree *trees;
+
+ /* Size of array. */
+ unsigned int size;
+};
+
+
+/* Mapping between trees and slots in an array. */
+struct lto_decl_slot
+{
+ tree t;
+ int slot_num;
+};
+
+
+/* The lto_tree_ref_encoder struct is used to encode trees into indices. */
+
+struct lto_tree_ref_encoder
+{
+ htab_t tree_hash_table; /* Maps pointers to indices. */
+ unsigned int next_index; /* Next available index. */
+ VEC(tree,heap) *trees; /* Maps indices to pointers. */
+};
+
+
+/* Structure to hold states of input scope. */
+struct lto_in_decl_state
+{
+ /* Array of lto_in_decl_buffers to store type and decls streams. */
+ struct lto_tree_ref_table streams[LTO_N_DECL_STREAMS];
+
+ /* If this in-decl state is associated with a function. FN_DECL
+ point to the FUNCTION_DECL. */
+ tree fn_decl;
+};
+
+typedef struct lto_in_decl_state *lto_in_decl_state_ptr;
+
+
+/* The structure that holds all of the vectors of global types,
+ decls and cgraph nodes used in the serialization of this file. */
+struct lto_out_decl_state
+{
+ /* The buffers contain the sets of decls of various kinds and types we have
+ seen so far and the indexes assigned to them. */
+ struct lto_tree_ref_encoder streams[LTO_N_DECL_STREAMS];
+
+ /* Encoder for cgraph nodes. */
+ lto_cgraph_encoder_t cgraph_node_encoder;
+
+ /* If this out-decl state belongs to a function, fn_decl points to that
+ function. Otherwise, it is NULL. */
+ tree fn_decl;
+};
+
+typedef struct lto_out_decl_state *lto_out_decl_state_ptr;
+
+DEF_VEC_P(lto_out_decl_state_ptr);
+DEF_VEC_ALLOC_P(lto_out_decl_state_ptr, heap);
+
+/* One of these is allocated for each object file that being compiled
+ by lto. This structure contains the tables that are needed by the
+ serialized functions and ipa passes to connect themselves to the
+ global types and decls as they are reconstituted. */
+struct lto_file_decl_data
+{
+ /* Decl state currently used. */
+ struct lto_in_decl_state *current_decl_state;
+
+ /* Decl state corresponding to regions outside of any functions
+ in the compilation unit. */
+ struct lto_in_decl_state *global_decl_state;
+
+ /* Table of cgraph nodes present in this file. */
+ lto_cgraph_encoder_t cgraph_node_encoder;
+
+ /* Hash table maps lto-related section names to location in file. */
+ htab_t function_decl_states;
+
+ /* The .o file that these offsets relate to. */
+ const char *file_name;
+
+ /* Nonzero if this file should be recompiled with LTRANS. */
+ unsigned needs_ltrans_p : 1;
+
+ /* Hash table maps lto-related section names to location in file. */
+ htab_t section_hash_table;
+
+ /* Hash new name of renamed global declaration to its original name. */
+ htab_t renaming_hash_table;
+};
+
+struct lto_char_ptr_base
+{
+ char *ptr;
+};
+
+/* An incore byte stream to buffer the various parts of the function.
+ The entire structure should be zeroed when created. The record
+ consists of a set of blocks. The first sizeof (ptr) bytes are used
+ as a chain, and the rest store the bytes to be written. */
+struct lto_output_stream
+{
+ /* The pointer to the first block in the stream. */
+ struct lto_char_ptr_base * first_block;
+
+ /* The pointer to the last and current block in the stream. */
+ struct lto_char_ptr_base * current_block;
+
+ /* The pointer to where the next char should be written. */
+ char * current_pointer;
+
+ /* The number of characters left in the current block. */
+ unsigned int left_in_block;
+
+ /* The block size of the last block allocated. */
+ unsigned int block_size;
+
+ /* The total number of characters written. */
+ unsigned int total_size;
+};
+
+/* The is the first part of the record in an LTO file for many of the
+ IPA passes. */
+struct lto_simple_header
+{
+ /* The header for all types of sections. */
+ struct lto_header lto_header;
+
+ /* Size of main gimple body of function. */
+ int32_t main_size;
+
+ /* Size of main stream when compressed. */
+ int32_t compressed_size;
+};
+
+/* A simple output block. This can be used for simple IPA passes that
+ do not need more than one stream. */
+struct lto_simple_output_block
+{
+ enum lto_section_type section_type;
+ struct lto_out_decl_state *decl_state;
+
+ /* The stream that the main tree codes are written to. */
+ struct lto_output_stream *main_stream;
+};
+
+/* Data structure holding all the data and descriptors used when writing
+ an LTO file. */
+struct output_block
+{
+ enum lto_section_type section_type;
+ struct lto_out_decl_state *decl_state;
+
+ /* The stream that the main tree codes are written to. */
+ struct lto_output_stream *main_stream;
+
+ /* The stream that contains the string table. */
+ struct lto_output_stream *string_stream;
+
+ /* The stream that contains the cfg. */
+ struct lto_output_stream *cfg_stream;
+
+ /* The hash table that contains the set of strings we have seen so
+ far and the indexes assigned to them. */
+ htab_t string_hash_table;
+
+ /* The current cgraph_node that we are currently serializing. Null
+ if we are serializing something else. */
+ struct cgraph_node *cgraph_node;
+
+ /* These are the last file and line that were seen in the stream.
+ If the current node differs from these, it needs to insert
+ something into the stream and fix these up. */
+ const char *current_file;
+ int current_line;
+ int current_col;
+
+ /* True if writing globals and types. */
+ bool global;
+
+ /* Cache of nodes written in this section. */
+ struct lto_streamer_cache_d *writer_cache;
+};
+
+
+/* Data and descriptors used when reading from an LTO file. */
+struct data_in
+{
+ /* The global decls and types. */
+ struct lto_file_decl_data *file_data;
+
+ /* All of the labels. */
+ tree *labels;
+
+ /* The string table. */
+ const char *strings;
+
+ /* The length of the string table. */
+ unsigned int strings_len;
+
+ /* Number of named labels. Used to find the index of unnamed labels
+ since they share space with the named labels. */
+ unsigned int num_named_labels;
+
+ /* Number of unnamed labels. */
+ unsigned int num_unnamed_labels;
+
+ const char *current_file;
+ int current_line;
+ int current_col;
+
+ /* Maps each reference number to the resolution done by the linker. */
+ VEC(ld_plugin_symbol_resolution_t,heap) *globals_resolution;
+
+ /* Cache of pickled nodes. */
+ struct lto_streamer_cache_d *reader_cache;
+};
+
+
+/* In lto-section-in.c */
+extern struct lto_input_block * lto_create_simple_input_block (
+ struct lto_file_decl_data *,
+ enum lto_section_type, const char **, size_t *);
+extern void
+lto_destroy_simple_input_block (struct lto_file_decl_data *,
+ enum lto_section_type,
+ struct lto_input_block *, const char *, size_t);
+extern void lto_set_in_hooks (struct lto_file_decl_data **,
+ lto_get_section_data_f *,
+ lto_free_section_data_f *);
+extern struct lto_file_decl_data **lto_get_file_decl_data (void);
+extern const char *lto_get_section_data (struct lto_file_decl_data *,
+ enum lto_section_type,
+ const char *, size_t *);
+extern void lto_free_section_data (struct lto_file_decl_data *,
+ enum lto_section_type,
+ const char *, const char *, size_t);
+extern unsigned char lto_input_1_unsigned (struct lto_input_block *);
+extern unsigned HOST_WIDE_INT lto_input_uleb128 (struct lto_input_block *);
+extern unsigned HOST_WIDEST_INT lto_input_widest_uint_uleb128 (
+ struct lto_input_block *);
+extern HOST_WIDE_INT lto_input_sleb128 (struct lto_input_block *);
+extern htab_t lto_create_renaming_table (void);
+extern void lto_record_renamed_decl (struct lto_file_decl_data *,
+ const char *, const char *);
+extern const char *lto_get_decl_name_mapping (struct lto_file_decl_data *,
+ const char *);
+extern struct lto_in_decl_state *lto_new_in_decl_state (void);
+extern void lto_delete_in_decl_state (struct lto_in_decl_state *);
+extern hashval_t lto_hash_in_decl_state (const void *);
+extern int lto_eq_in_decl_state (const void *, const void *);
+extern struct lto_in_decl_state *lto_get_function_in_decl_state (
+ struct lto_file_decl_data *, tree);
+
+/* In lto-section-out.c */
+extern hashval_t lto_hash_decl_slot_node (const void *);
+extern int lto_eq_decl_slot_node (const void *, const void *);
+extern hashval_t lto_hash_type_slot_node (const void *);
+extern int lto_eq_type_slot_node (const void *, const void *);
+extern void lto_begin_section (const char *, bool);
+extern void lto_end_section (void);
+extern void lto_write_stream (struct lto_output_stream *);
+extern void lto_output_1_stream (struct lto_output_stream *, char);
+extern void lto_output_data_stream (struct lto_output_stream *, const void *,
+ size_t);
+extern void lto_output_uleb128_stream (struct lto_output_stream *,
+ unsigned HOST_WIDE_INT);
+extern void lto_output_widest_uint_uleb128_stream (struct lto_output_stream *,
+ unsigned HOST_WIDEST_INT);
+extern void lto_output_sleb128_stream (struct lto_output_stream *,
+ HOST_WIDE_INT);
+extern bool lto_output_decl_index (struct lto_output_stream *,
+ struct lto_tree_ref_encoder *,
+ tree, unsigned int *);
+extern void lto_output_field_decl_index (struct lto_out_decl_state *,
+ struct lto_output_stream *, tree);
+extern void lto_output_fn_decl_index (struct lto_out_decl_state *,
+ struct lto_output_stream *, tree);
+extern void lto_output_namespace_decl_index (struct lto_out_decl_state *,
+ struct lto_output_stream *, tree);
+extern void lto_output_var_decl_index (struct lto_out_decl_state *,
+ struct lto_output_stream *, tree);
+extern void lto_output_type_decl_index (struct lto_out_decl_state *,
+ struct lto_output_stream *, tree);
+extern void lto_output_type_ref_index (struct lto_out_decl_state *,
+ struct lto_output_stream *, tree);
+extern struct lto_simple_output_block *lto_create_simple_output_block (
+ enum lto_section_type);
+extern void lto_destroy_simple_output_block (struct lto_simple_output_block *);
+extern struct lto_out_decl_state *lto_new_out_decl_state (void);
+extern void lto_delete_out_decl_state (struct lto_out_decl_state *);
+extern struct lto_out_decl_state *lto_get_out_decl_state (void);
+extern void lto_push_out_decl_state (struct lto_out_decl_state *);
+extern struct lto_out_decl_state *lto_pop_out_decl_state (void);
+extern void lto_record_function_out_decl_state (tree,
+ struct lto_out_decl_state *);
+extern void lto_new_extern_inline_states (void);
+extern void lto_delete_extern_inline_states (void);
+extern void lto_force_functions_extern_inline (bitmap decls);
+extern bool lto_forced_extern_inline_p (tree fn_decl);
+
+
+/* In lto-streamer.c. */
+extern const char *lto_tag_name (enum LTO_tags);
+extern bitmap lto_bitmap_alloc (void);
+extern void lto_bitmap_free (bitmap);
+extern char *lto_get_section_name (int, const char *);
+extern void print_lto_report (void);
+extern struct bitpack_d *bitpack_create (void);
+extern void bitpack_delete (struct bitpack_d *);
+extern void bp_pack_value (struct bitpack_d *, bitpack_word_t, unsigned);
+extern bitpack_word_t bp_unpack_value (struct bitpack_d *, unsigned);
+extern bool lto_streamer_cache_insert (struct lto_streamer_cache_d *, tree,
+ int *, unsigned *);
+extern bool lto_streamer_cache_insert_at (struct lto_streamer_cache_d *, tree,
+ int);
+extern bool lto_streamer_cache_lookup (struct lto_streamer_cache_d *, tree,
+ int *);
+extern tree lto_streamer_cache_get (struct lto_streamer_cache_d *, int);
+extern struct lto_streamer_cache_d *lto_streamer_cache_create (void);
+extern void lto_streamer_cache_delete (struct lto_streamer_cache_d *);
+extern void lto_streamer_init (void);
+extern bool gate_lto_out (void);
+#ifdef LTO_STREAMER_DEBUG
+extern void lto_orig_address_map (tree, intptr_t);
+extern intptr_t lto_orig_address_get (tree);
+extern void lto_orig_address_remove (tree);
+#endif
+extern void lto_check_version (int, int);
+
+
+/* In lto-streamer-in.c */
+extern void lto_input_cgraph (struct lto_file_decl_data *, const char *);
+extern void lto_init_reader (void);
+extern tree lto_input_tree (struct lto_input_block *, struct data_in *);
+extern void lto_input_function_body (struct lto_file_decl_data *, tree,
+ const char *);
+extern void lto_input_constructors_and_inits (struct lto_file_decl_data *,
+ const char *);
+extern struct bitpack_d *lto_input_bitpack (struct lto_input_block *);
+extern void lto_init_reader (void);
+extern struct data_in *lto_data_in_create (struct lto_file_decl_data *,
+ const char *, unsigned,
+ VEC(ld_plugin_symbol_resolution_t,heap) *);
+extern void lto_data_in_delete (struct data_in *);
+
+
+/* In lto-streamer-out.c */
+extern void lto_register_decl_definition (tree, struct lto_file_decl_data *);
+extern struct output_block *create_output_block (enum lto_section_type);
+extern void destroy_output_block (struct output_block *);
+extern void lto_output_tree (struct output_block *, tree, bool);
+extern void lto_output_bitpack (struct lto_output_stream *, struct bitpack_d *);
+extern void produce_asm (struct output_block *ob, tree fn);
+
+
+/* In lto-cgraph.c */
+struct cgraph_node *lto_cgraph_encoder_deref (lto_cgraph_encoder_t, int);
+int lto_cgraph_encoder_lookup (lto_cgraph_encoder_t, struct cgraph_node *);
+lto_cgraph_encoder_t lto_cgraph_encoder_new (void);
+int lto_cgraph_encoder_encode (lto_cgraph_encoder_t, struct cgraph_node *);
+void lto_cgraph_encoder_delete (lto_cgraph_encoder_t encoder);
+void output_cgraph (cgraph_node_set);
+void input_cgraph (void);
+
+
+/* In lto-symtab.c. */
+extern void lto_symtab_register_decl (tree, ld_plugin_symbol_resolution_t,
+ struct lto_file_decl_data *);
+extern void lto_symtab_merge_decls (void);
+extern void lto_symtab_merge_cgraph_nodes (void);
+extern tree lto_symtab_prevailing_decl (tree decl);
+extern enum ld_plugin_symbol_resolution lto_symtab_get_resolution (tree decl);
+
+
+/* In lto-opts.c. */
+extern void lto_register_user_option (size_t, const char *, int, int);
+extern void lto_read_file_options (struct lto_file_decl_data *);
+extern void lto_write_options (void);
+extern void lto_reissue_options (void);
+void lto_clear_user_options (void);
+void lto_clear_file_options (void);
+
+
+/* In lto-wpa-fixup.c */
+void lto_mark_nothrow_fndecl (tree);
+void lto_fixup_nothrow_decls (void);
+
+
+/* Statistics gathered during LTO, WPA and LTRANS. */
+extern struct lto_stats_d lto_stats;
+
+/* Section names corresponding to the values of enum lto_section_type. */
+extern const char *lto_section_name[];
+
+/* Holds all the out decl states of functions output so far in the
+ current output file. */
+extern VEC(lto_out_decl_state_ptr, heap) *lto_function_decl_states;
+
+/* Return true if LTO tag TAG corresponds to a tree code. */
+static inline bool
+lto_tag_is_tree_code_p (enum LTO_tags tag)
+{
+ return tag > LTO_null && (unsigned) tag <= NUM_TREE_CODES;
+}
+
+
+/* Return true if LTO tag TAG corresponds to a gimple code. */
+static inline bool
+lto_tag_is_gimple_code_p (enum LTO_tags tag)
+{
+ return (unsigned) tag >= NUM_TREE_CODES + 1
+ && (unsigned) tag < 1 + NUM_TREE_CODES + LAST_AND_UNUSED_GIMPLE_CODE;
+}
+
+
+/* Return the LTO tag corresponding to gimple code CODE. See enum
+ LTO_tags for details on the conversion. */
+static inline enum LTO_tags
+lto_gimple_code_to_tag (enum gimple_code code)
+{
+ return (enum LTO_tags) ((unsigned) code + NUM_TREE_CODES + 1);
+}
+
+
+/* Return the GIMPLE code corresponding to TAG. See enum LTO_tags for
+ details on the conversion. */
+static inline enum gimple_code
+lto_tag_to_gimple_code (enum LTO_tags tag)
+{
+ gcc_assert (lto_tag_is_gimple_code_p (tag));
+ return (enum gimple_code) ((unsigned) tag - NUM_TREE_CODES - 1);
+}
+
+
+/* Return the LTO tag corresponding to tree code CODE. See enum
+ LTO_tags for details on the conversion. */
+static inline enum LTO_tags
+lto_tree_code_to_tag (enum tree_code code)
+{
+ return (enum LTO_tags) ((unsigned) code + 1);
+}
+
+
+/* Return the tree code corresponding to TAG. See enum LTO_tags for
+ details on the conversion. */
+static inline enum tree_code
+lto_tag_to_tree_code (enum LTO_tags tag)
+{
+ gcc_assert (lto_tag_is_tree_code_p (tag));
+ return (enum tree_code) ((unsigned) tag - 1);
+}
+
+
+/* Return true if FILE needs to be compiled with LTRANS. */
+static inline bool
+lto_file_needs_ltrans_p (struct lto_file_decl_data *file)
+{
+ return file->needs_ltrans_p != 0;
+}
+
+
+/* Mark FILE to be compiled with LTRANS. */
+static inline void
+lto_mark_file_for_ltrans (struct lto_file_decl_data *file)
+{
+ file->needs_ltrans_p = 1;
+}
+
+
+/* Return true if any files in node set SET need to be compiled
+ with LTRANS. */
+static inline bool
+cgraph_node_set_needs_ltrans_p (cgraph_node_set set)
+{
+ cgraph_node_set_iterator csi;
+
+ for (csi = csi_start (set); !csi_end_p (csi); csi_next (&csi))
+ if (lto_file_needs_ltrans_p (csi_node (csi)->local.lto_file_data))
+ return true;
+
+ return false;
+}
+
+
+/* Initialize an lto_out_decl_buffer ENCODER. */
+static inline void
+lto_init_tree_ref_encoder (struct lto_tree_ref_encoder *encoder,
+ htab_hash hash_fn, htab_eq eq_fn)
+{
+ encoder->tree_hash_table = htab_create (37, hash_fn, eq_fn, free);
+ encoder->next_index = 0;
+ encoder->trees = NULL;
+}
+
+
+/* Destory an lto_tree_ref_encoder ENCODER by freeing its contents. The
+ memory used by ENCODER is not freed by this function. */
+static inline void
+lto_destroy_tree_ref_encoder (struct lto_tree_ref_encoder *encoder)
+{
+ /* Hash table may be delete already. */
+ if (encoder->tree_hash_table)
+ htab_delete (encoder->tree_hash_table);
+ VEC_free (tree, heap, encoder->trees);
+}
+
+/* Return the number of trees encoded in ENCODER. */
+static inline unsigned int
+lto_tree_ref_encoder_size (struct lto_tree_ref_encoder *encoder)
+{
+ return VEC_length (tree, encoder->trees);
+}
+
+/* Return the IDX-th tree in ENCODER. */
+static inline tree
+lto_tree_ref_encoder_get_tree (struct lto_tree_ref_encoder *encoder,
+ unsigned int idx)
+{
+ return VEC_index (tree, encoder->trees, idx);
+}
+
+
+/* Return true if LABEL should be emitted in the global context. */
+static inline bool
+emit_label_in_global_context_p (tree label)
+{
+ return DECL_NONLOCAL (label) || FORCED_LABEL (label);
+}
+
+/* Return true if tree node EXPR should be streamed as a builtin. For
+ these nodes, we just emit the class and function code. */
+static inline bool
+lto_stream_as_builtin_p (tree expr)
+{
+ return (TREE_CODE (expr) == FUNCTION_DECL
+ && DECL_IS_BUILTIN (expr)
+ && (DECL_BUILT_IN_CLASS (expr) == BUILT_IN_NORMAL
+ || DECL_BUILT_IN_CLASS (expr) == BUILT_IN_MD));
+}
+
+/* Return true if EXPR is a tree node that can be written to disk. */
+static inline bool
+lto_is_streamable (tree expr)
+{
+ enum tree_code code = TREE_CODE (expr);
+
+ /* Notice that we reject SSA_NAMEs as well. We only emit the SSA
+ name version in lto_output_tree_ref (see output_ssa_names). */
+ return !is_lang_specific (expr)
+ && code != SSA_NAME
+ && code != CALL_EXPR
+ && code != LANG_TYPE
+ && code != MODIFY_EXPR
+ && code != INIT_EXPR
+ && code != TARGET_EXPR
+ && code != BIND_EXPR
+ && code != WITH_CLEANUP_EXPR
+ && code != STATEMENT_LIST
+ && (code == CASE_LABEL_EXPR
+ || code == DECL_EXPR
+ || TREE_CODE_CLASS (code) != tcc_statement);
+}
+
+DEFINE_DECL_STREAM_FUNCS (TYPE, type)
+DEFINE_DECL_STREAM_FUNCS (FIELD_DECL, field_decl)
+DEFINE_DECL_STREAM_FUNCS (FN_DECL, fn_decl)
+DEFINE_DECL_STREAM_FUNCS (VAR_DECL, var_decl)
+DEFINE_DECL_STREAM_FUNCS (TYPE_DECL, type_decl)
+DEFINE_DECL_STREAM_FUNCS (NAMESPACE_DECL, namespace_decl)
+DEFINE_DECL_STREAM_FUNCS (LABEL_DECL, label_decl)
+
+#endif /* GCC_LTO_STREAMER_H */
diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c
new file mode 100644
index 00000000000..642b6235d90
--- /dev/null
+++ b/gcc/lto-symtab.c
@@ -0,0 +1,676 @@
+/* LTO symbol table.
+ Copyright 2009 Free Software Foundation, Inc.
+ Contributed by CodeSourcery, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "toplev.h"
+#include "tree.h"
+#include "gimple.h"
+#include "ggc.h" /* lambda.h needs this */
+#include "lambda.h" /* gcd */
+#include "hashtab.h"
+#include "plugin-api.h"
+#include "lto-streamer.h"
+
+/* Vector to keep track of external variables we've seen so far. */
+VEC(tree,gc) *lto_global_var_decls;
+
+/* Symbol table entry. */
+
+struct GTY(()) lto_symtab_entry_def
+{
+ /* The symbol table entry key, an IDENTIFIER. */
+ tree id;
+ /* The symbol table entry, a DECL. */
+ tree decl;
+ /* The cgraph node if decl is a function decl. Filled in during the
+ merging process. */
+ struct cgraph_node *node;
+ /* LTO file-data and symbol resolution for this decl. */
+ struct lto_file_decl_data * GTY((skip (""))) file_data;
+ enum ld_plugin_symbol_resolution resolution;
+ /* Pointer to the next entry with the same key. Before decl merging
+ this links all symbols from the different TUs. After decl merging
+ this links merged but incompatible decls, thus all prevailing ones
+ remaining. */
+ struct lto_symtab_entry_def *next;
+};
+typedef struct lto_symtab_entry_def *lto_symtab_entry_t;
+
+/* A poor man's symbol table. This hashes identifier to prevailing DECL
+ if there is one. */
+
+static GTY ((if_marked ("lto_symtab_entry_marked_p"),
+ param_is (struct lto_symtab_entry_def)))
+ htab_t lto_symtab_identifiers;
+
+/* Return the hash value of an lto_symtab_entry_t object pointed to by P. */
+
+static hashval_t
+lto_symtab_entry_hash (const void *p)
+{
+ const struct lto_symtab_entry_def *base =
+ (const struct lto_symtab_entry_def *) p;
+ return htab_hash_string (IDENTIFIER_POINTER (base->id));
+}
+
+/* Return non-zero if P1 and P2 points to lto_symtab_entry_def structs
+ corresponding to the same symbol. */
+
+static int
+lto_symtab_entry_eq (const void *p1, const void *p2)
+{
+ const struct lto_symtab_entry_def *base1 =
+ (const struct lto_symtab_entry_def *) p1;
+ const struct lto_symtab_entry_def *base2 =
+ (const struct lto_symtab_entry_def *) p2;
+ return (base1->id == base2->id);
+}
+
+/* Returns non-zero if P points to an lto_symtab_entry_def struct that needs
+ to be marked for GC. */
+
+static int
+lto_symtab_entry_marked_p (const void *p)
+{
+ const struct lto_symtab_entry_def *base =
+ (const struct lto_symtab_entry_def *) p;
+
+ /* Keep this only if the decl or the chain is marked. */
+ return (ggc_marked_p (base->decl)
+ || (base->next && ggc_marked_p (base->next)));
+}
+
+/* Lazily initialize resolution hash tables. */
+
+static void
+lto_symtab_maybe_init_hash_table (void)
+{
+ if (lto_symtab_identifiers)
+ return;
+
+ lto_symtab_identifiers =
+ htab_create_ggc (1021, lto_symtab_entry_hash,
+ lto_symtab_entry_eq, NULL);
+}
+
+/* Registers DECL with the LTO symbol table as having resolution RESOLUTION
+ and read from FILE_DATA. */
+
+void
+lto_symtab_register_decl (tree decl,
+ ld_plugin_symbol_resolution_t resolution,
+ struct lto_file_decl_data *file_data)
+{
+ lto_symtab_entry_t new_entry;
+ void **slot;
+
+ /* Check that declarations reaching this function do not have
+ properties inconsistent with having external linkage. If any of
+ these asertions fail, then the object file reader has failed to
+ detect these cases and issue appropriate error messages. */
+ gcc_assert (decl
+ && TREE_PUBLIC (decl)
+ && (TREE_CODE (decl) == VAR_DECL
+ || TREE_CODE (decl) == FUNCTION_DECL)
+ && DECL_ASSEMBLER_NAME_SET_P (decl));
+ if (TREE_CODE (decl) == VAR_DECL
+ && DECL_INITIAL (decl))
+ gcc_assert (!DECL_EXTERNAL (decl)
+ || (TREE_STATIC (decl) && TREE_READONLY (decl)));
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ gcc_assert (!DECL_ABSTRACT (decl));
+
+ new_entry = GGC_CNEW (struct lto_symtab_entry_def);
+ new_entry->id = DECL_ASSEMBLER_NAME (decl);
+ new_entry->decl = decl;
+ new_entry->resolution = resolution;
+ new_entry->file_data = file_data;
+
+ lto_symtab_maybe_init_hash_table ();
+ slot = htab_find_slot (lto_symtab_identifiers, new_entry, INSERT);
+ new_entry->next = (lto_symtab_entry_t) *slot;
+ *slot = new_entry;
+}
+
+/* Get the lto_symtab_entry_def struct associated with ID
+ if there is one. */
+
+static lto_symtab_entry_t
+lto_symtab_get (tree id)
+{
+ struct lto_symtab_entry_def temp;
+ void **slot;
+
+ lto_symtab_maybe_init_hash_table ();
+ temp.id = id;
+ slot = htab_find_slot (lto_symtab_identifiers, &temp, NO_INSERT);
+ return slot ? (lto_symtab_entry_t) *slot : NULL;
+}
+
+/* Get the linker resolution for DECL. */
+
+enum ld_plugin_symbol_resolution
+lto_symtab_get_resolution (tree decl)
+{
+ lto_symtab_entry_t e;
+
+ gcc_assert (DECL_ASSEMBLER_NAME_SET_P (decl));
+
+ e = lto_symtab_get (DECL_ASSEMBLER_NAME (decl));
+ while (e && e->decl != decl)
+ e = e->next;
+ if (!e)
+ return LDPR_UNKNOWN;
+
+ return e->resolution;
+}
+
+
+/* Replace the cgraph node NODE with PREVAILING_NODE in the cgraph, merging
+ all edges and removing the old node. */
+
+static void
+lto_cgraph_replace_node (struct cgraph_node *node,
+ struct cgraph_node *prevailing_node)
+{
+ struct cgraph_edge *e, *next;
+
+ /* Merge node flags. */
+ if (node->needed)
+ cgraph_mark_needed_node (prevailing_node);
+ if (node->reachable)
+ cgraph_mark_reachable_node (prevailing_node);
+ if (node->address_taken)
+ {
+ gcc_assert (!prevailing_node->global.inlined_to);
+ cgraph_mark_address_taken_node (prevailing_node);
+ }
+
+ /* Redirect all incoming edges. */
+ for (e = node->callers; e; e = next)
+ {
+ next = e->next_caller;
+ cgraph_redirect_edge_callee (e, prevailing_node);
+ }
+
+ /* There are not supposed to be any outgoing edges from a node we
+ replace. Still this can happen for multiple instances of weak
+ functions. */
+ for (e = node->callees; e; e = next)
+ {
+ next = e->next_callee;
+ cgraph_remove_edge (e);
+ }
+
+ /* Finally remove the replaced node. */
+ cgraph_remove_node (node);
+}
+
+/* Merge two variable or function symbol table entries PREVAILING and ENTRY.
+ Return false if the symbols are not fully compatible and a diagnostic
+ should be emitted. */
+
+static bool
+lto_symtab_merge (lto_symtab_entry_t prevailing, lto_symtab_entry_t entry)
+{
+ tree prevailing_decl = prevailing->decl;
+ tree decl = entry->decl;
+ tree prevailing_type, type;
+
+ /* Merge decl state in both directions, we may still end up using
+ the new decl. */
+ TREE_ADDRESSABLE (prevailing_decl) |= TREE_ADDRESSABLE (decl);
+ TREE_ADDRESSABLE (decl) |= TREE_ADDRESSABLE (prevailing_decl);
+
+ /* The linker may ask us to combine two incompatible symbols.
+ Detect this case and notify the caller of required diagnostics. */
+
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ {
+ if (TREE_TYPE (prevailing_decl) != TREE_TYPE (decl))
+ /* If we don't have a merged type yet...sigh. The linker
+ wouldn't complain if the types were mismatched, so we
+ probably shouldn't either. Just use the type from
+ whichever decl appears to be associated with the
+ definition. If for some odd reason neither decl is, the
+ older one wins. */
+ (void) 0;
+
+ return true;
+ }
+
+ /* Now we exclusively deal with VAR_DECLs. */
+
+ /* Sharing a global symbol is a strong hint that two types are
+ compatible. We could use this information to complete
+ incomplete pointed-to types more aggressively here, ignoring
+ mismatches in both field and tag names. It's difficult though
+ to guarantee that this does not have side-effects on merging
+ more compatible types from other translation units though. */
+
+ /* We can tolerate differences in type qualification, the
+ qualification of the prevailing definition will prevail.
+ ??? In principle we might want to only warn for structurally
+ incompatible types here, but unless we have protective measures
+ for TBAA in place that would hide useful information. */
+ prevailing_type = TYPE_MAIN_VARIANT (TREE_TYPE (prevailing_decl));
+ type = TYPE_MAIN_VARIANT (TREE_TYPE (decl));
+
+ /* We have to register and fetch canonical types here as the global
+ fixup process didn't yet run. */
+ prevailing_type = gimple_register_type (prevailing_type);
+ type = gimple_register_type (type);
+ if (prevailing_type != type)
+ {
+ if (COMPLETE_TYPE_P (type))
+ return false;
+
+ /* If type is incomplete then avoid warnings in the cases
+ that TBAA handles just fine. */
+
+ if (TREE_CODE (prevailing_type) != TREE_CODE (type))
+ return false;
+
+ if (TREE_CODE (prevailing_type) == ARRAY_TYPE)
+ {
+ tree tem1 = TREE_TYPE (prevailing_type);
+ tree tem2 = TREE_TYPE (type);
+ while (TREE_CODE (tem1) == ARRAY_TYPE
+ && TREE_CODE (tem2) == ARRAY_TYPE)
+ {
+ tem1 = TREE_TYPE (tem1);
+ tem2 = TREE_TYPE (tem2);
+ }
+
+ if (TREE_CODE (tem1) != TREE_CODE (tem2))
+ return false;
+
+ if (gimple_register_type (tem1) != gimple_register_type (tem2))
+ return false;
+ }
+
+ /* Fallthru. Compatible enough. */
+ }
+
+ /* ??? We might want to emit a warning here if type qualification
+ differences were spotted. Do not do this unconditionally though. */
+
+ /* There is no point in comparing too many details of the decls here.
+ The type compatibility checks or the completing of types has properly
+ dealt with most issues. */
+
+ /* The following should all not invoke fatal errors as in non-LTO
+ mode the linker wouldn't complain either. Just emit warnings. */
+
+ /* Report a warning if user-specified alignments do not match. */
+ if ((DECL_USER_ALIGN (prevailing_decl) && DECL_USER_ALIGN (decl))
+ && DECL_ALIGN (prevailing_decl) < DECL_ALIGN (decl))
+ return false;
+
+ return true;
+}
+
+/* Return true if the symtab entry E can be replaced by another symtab
+ entry. */
+
+static bool
+lto_symtab_resolve_replaceable_p (lto_symtab_entry_t e)
+{
+ if (DECL_EXTERNAL (e->decl)
+ || DECL_COMDAT (e->decl)
+ || DECL_WEAK (e->decl))
+ return true;
+
+ if (TREE_CODE (e->decl) == VAR_DECL)
+ return (DECL_COMMON (e->decl)
+ || (!flag_no_common && !DECL_INITIAL (e->decl)));
+
+ return false;
+}
+
+/* Return true if the symtab entry E can be the prevailing one. */
+
+static bool
+lto_symtab_resolve_can_prevail_p (lto_symtab_entry_t e)
+{
+ if (!TREE_STATIC (e->decl))
+ return false;
+
+ /* For functions we need a non-discarded body. */
+ if (TREE_CODE (e->decl) == FUNCTION_DECL)
+ return (e->node && e->node->analyzed);
+
+ /* A variable should have a size. */
+ else if (TREE_CODE (e->decl) == VAR_DECL)
+ return (DECL_SIZE (e->decl) != NULL_TREE
+ /* The C++ frontend retains TREE_STATIC on the declaration
+ of foo_ in struct Foo { static Foo *foo_; }; but it is
+ not a definition. g++.dg/lto/20090315_0.C. */
+ && !DECL_EXTERNAL (e->decl));
+
+ gcc_unreachable ();
+}
+
+/* Resolve the symbol with the candidates in the chain *SLOT and store
+ their resolutions. */
+
+static void
+lto_symtab_resolve_symbols (void **slot)
+{
+ lto_symtab_entry_t e = (lto_symtab_entry_t) *slot;
+ lto_symtab_entry_t prevailing = NULL;
+
+ /* If the chain is already resolved there is nothing to do. */
+ if (e->resolution != LDPR_UNKNOWN)
+ return;
+
+ /* Find the single non-replaceable prevailing symbol and
+ diagnose ODR violations. */
+ for (; e; e = e->next)
+ {
+ if (TREE_CODE (e->decl) == FUNCTION_DECL)
+ e->node = cgraph_get_node (e->decl);
+
+ if (!lto_symtab_resolve_can_prevail_p (e))
+ {
+ e->resolution = LDPR_RESOLVED_IR;
+ continue;
+ }
+
+ /* Set a default resolution - the final prevailing one will get
+ adjusted later. */
+ e->resolution = LDPR_PREEMPTED_IR;
+ if (!lto_symtab_resolve_replaceable_p (e))
+ {
+ if (prevailing)
+ {
+ error_at (DECL_SOURCE_LOCATION (e->decl),
+ "%qD has already been defined", e->decl);
+ inform (DECL_SOURCE_LOCATION (prevailing->decl),
+ "previously defined here");
+ }
+ prevailing = e;
+ }
+ }
+ if (prevailing)
+ goto found;
+
+ /* Do a second round choosing one from the replaceable prevailing decls. */
+ for (e = (lto_symtab_entry_t) *slot; e; e = e->next)
+ {
+ if (e->resolution != LDPR_PREEMPTED_IR)
+ continue;
+
+ /* Choose the first function that can prevail as prevailing. */
+ if (TREE_CODE (e->decl) == FUNCTION_DECL)
+ {
+ prevailing = e;
+ break;
+ }
+
+ /* From variables that can prevail choose the largest one. */
+ if (!prevailing
+ || tree_int_cst_lt (DECL_SIZE (prevailing->decl),
+ DECL_SIZE (e->decl)))
+ prevailing = e;
+ }
+
+ if (!prevailing)
+ return;
+
+found:
+ if (TREE_CODE (prevailing->decl) == VAR_DECL
+ && TREE_READONLY (prevailing->decl))
+ prevailing->resolution = LDPR_PREVAILING_DEF_IRONLY;
+ else
+ prevailing->resolution = LDPR_PREVAILING_DEF;
+}
+
+/* Merge all decls in the symbol table chain to the prevailing decl and
+ issue diagnostics about type mismatches. */
+
+static void
+lto_symtab_merge_decls_2 (void **slot)
+{
+ lto_symtab_entry_t prevailing, e;
+ VEC(tree, heap) *mismatches = NULL;
+ unsigned i;
+ tree decl;
+ bool diagnosed_p = false;
+
+ /* Nothing to do for a single entry. */
+ prevailing = (lto_symtab_entry_t) *slot;
+ if (!prevailing->next)
+ return;
+
+ /* Try to merge each entry with the prevailing one. */
+ for (e = prevailing->next; e; e = e->next)
+ {
+ if (!lto_symtab_merge (prevailing, e))
+ VEC_safe_push (tree, heap, mismatches, e->decl);
+ }
+ if (VEC_empty (tree, mismatches))
+ return;
+
+ /* Diagnose all mismatched re-declarations. */
+ for (i = 0; VEC_iterate (tree, mismatches, i, decl); ++i)
+ {
+ if (TREE_TYPE (prevailing->decl) != TREE_TYPE (decl))
+ diagnosed_p |= warning_at (DECL_SOURCE_LOCATION (decl), 0,
+ "type of %qD does not match original "
+ "declaration", decl);
+
+ else if ((DECL_USER_ALIGN (prevailing->decl) && DECL_USER_ALIGN (decl))
+ && DECL_ALIGN (prevailing->decl) < DECL_ALIGN (decl))
+ {
+ diagnosed_p |= warning_at (DECL_SOURCE_LOCATION (decl), 0,
+ "alignment of %qD is bigger than "
+ "original declaration", decl);
+ }
+ }
+ if (diagnosed_p)
+ inform (DECL_SOURCE_LOCATION (prevailing->decl),
+ "previously declared here");
+
+ VEC_free (tree, heap, mismatches);
+}
+
+/* Helper to process the decl chain for the symbol table entry *SLOT. */
+
+static int
+lto_symtab_merge_decls_1 (void **slot, void *data ATTRIBUTE_UNUSED)
+{
+ lto_symtab_entry_t e, prevailing;
+ bool diagnosed_p = false;
+
+ /* Compute the symbol resolutions. This is a no-op when using the
+ linker plugin. */
+ lto_symtab_resolve_symbols (slot);
+
+ /* Find the prevailing decl. */
+ for (prevailing = (lto_symtab_entry_t) *slot;
+ prevailing
+ && prevailing->resolution != LDPR_PREVAILING_DEF_IRONLY
+ && prevailing->resolution != LDPR_PREVAILING_DEF;
+ prevailing = prevailing->next)
+ ;
+
+ /* Assert it's the only one. */
+ if (prevailing)
+ for (e = prevailing->next; e; e = e->next)
+ gcc_assert (e->resolution != LDPR_PREVAILING_DEF_IRONLY
+ && e->resolution != LDPR_PREVAILING_DEF);
+
+ /* If there's not a prevailing symbol yet it's an external reference.
+ Happens a lot during ltrans. Choose the first symbol with a
+ cgraph or a varpool node. */
+ if (!prevailing)
+ {
+ prevailing = (lto_symtab_entry_t) *slot;
+ /* For functions choose one with a cgraph node. */
+ if (TREE_CODE (prevailing->decl) == FUNCTION_DECL)
+ while (!prevailing->node
+ && prevailing->next)
+ prevailing = prevailing->next;
+ /* We do not stream varpool nodes, so the first decl has to
+ be good enough for now.
+ ??? For QOI choose a variable with readonly initializer
+ if there is one. This matches C++
+ struct Foo { static const int i = 1; }; without a real
+ definition. */
+ if (TREE_CODE (prevailing->decl) == VAR_DECL)
+ while (!(TREE_READONLY (prevailing->decl)
+ && DECL_INITIAL (prevailing->decl))
+ && prevailing->next)
+ prevailing = prevailing->next;
+ }
+
+ /* Move it first in the list. */
+ if ((lto_symtab_entry_t) *slot != prevailing)
+ {
+ for (e = (lto_symtab_entry_t) *slot; e->next != prevailing; e = e->next)
+ ;
+ e->next = prevailing->next;
+ prevailing->next = (lto_symtab_entry_t) *slot;
+ *slot = (void *) prevailing;
+ }
+
+ /* Record the prevailing variable. */
+ if (TREE_CODE (prevailing->decl) == VAR_DECL)
+ VEC_safe_push (tree, gc, lto_global_var_decls, prevailing->decl);
+
+ /* Diagnose mismatched objects. */
+ for (e = prevailing->next; e; e = e->next)
+ {
+ if (TREE_CODE (prevailing->decl) == TREE_CODE (e->decl))
+ continue;
+
+ switch (TREE_CODE (prevailing->decl))
+ {
+ case VAR_DECL:
+ gcc_assert (TREE_CODE (e->decl) == FUNCTION_DECL);
+ error_at (DECL_SOURCE_LOCATION (e->decl),
+ "variable %qD redeclared as function", prevailing->decl);
+ break;
+
+ case FUNCTION_DECL:
+ gcc_assert (TREE_CODE (e->decl) == VAR_DECL);
+ error_at (DECL_SOURCE_LOCATION (e->decl),
+ "function %qD redeclared as variable", prevailing->decl);
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+
+ diagnosed_p = true;
+ }
+ if (diagnosed_p)
+ inform (DECL_SOURCE_LOCATION (prevailing->decl),
+ "previously declared here");
+
+ /* Register and adjust types of the entries. */
+ for (e = (lto_symtab_entry_t) *slot; e; e = e->next)
+ TREE_TYPE (e->decl) = gimple_register_type (TREE_TYPE (e->decl));
+
+ /* Merge the chain to the single prevailing decl and diagnose
+ mismatches. */
+ lto_symtab_merge_decls_2 (slot);
+
+ /* Drop all but the prevailing decl from the symtab. */
+ if (TREE_CODE (prevailing->decl) != FUNCTION_DECL)
+ prevailing->next = NULL;
+
+ return 1;
+}
+
+/* Resolve and merge all symbol table chains to a prevailing decl. */
+
+void
+lto_symtab_merge_decls (void)
+{
+ lto_symtab_maybe_init_hash_table ();
+ htab_traverse (lto_symtab_identifiers, lto_symtab_merge_decls_1, NULL);
+}
+
+/* Helper to process the decl chain for the symbol table entry *SLOT. */
+
+static int
+lto_symtab_merge_cgraph_nodes_1 (void **slot, void *data ATTRIBUTE_UNUSED)
+{
+ lto_symtab_entry_t e, prevailing = (lto_symtab_entry_t) *slot;
+
+ if (!prevailing->next)
+ return 1;
+
+ gcc_assert (TREE_CODE (prevailing->decl) == FUNCTION_DECL);
+
+ /* Replace the cgraph node of each entry with the prevailing one. */
+ for (e = prevailing->next; e; e = e->next)
+ {
+ if (e->node != NULL)
+ lto_cgraph_replace_node (e->node, prevailing->node);
+ }
+
+ /* Drop all but the prevailing decl from the symtab. */
+ prevailing->next = NULL;
+
+ return 1;
+}
+
+/* Merge cgraph nodes according to the symbol merging done by
+ lto_symtab_merge_decls. */
+
+void
+lto_symtab_merge_cgraph_nodes (void)
+{
+ lto_symtab_maybe_init_hash_table ();
+ htab_traverse (lto_symtab_identifiers, lto_symtab_merge_cgraph_nodes_1, NULL);
+}
+
+/* Given the decl DECL, return the prevailing decl with the same name. */
+
+tree
+lto_symtab_prevailing_decl (tree decl)
+{
+ lto_symtab_entry_t ret;
+
+ /* Builtins and local symbols are their own prevailing decl. */
+ if (!TREE_PUBLIC (decl) || is_builtin_fn (decl))
+ return decl;
+
+ /* DECL_ABSTRACTs are their own prevailng decl. */
+ if (TREE_CODE (decl) == FUNCTION_DECL && DECL_ABSTRACT (decl))
+ return decl;
+
+ /* Ensure DECL_ASSEMBLER_NAME will not set assembler name. */
+ gcc_assert (DECL_ASSEMBLER_NAME_SET_P (decl));
+
+ /* Walk through the list of candidates and return the one we merged to. */
+ ret = lto_symtab_get (DECL_ASSEMBLER_NAME (decl));
+ if (!ret)
+ return NULL_TREE;
+
+ return ret->decl;
+}
+
+#include "gt-lto-symtab.h"
diff --git a/gcc/lto-wpa-fixup.c b/gcc/lto-wpa-fixup.c
new file mode 100644
index 00000000000..4411588f2f3
--- /dev/null
+++ b/gcc/lto-wpa-fixup.c
@@ -0,0 +1,281 @@
+/* Write and read any fix-up information generated by the WPA mode.
+
+ Copyright 2009 Free Software Foundation, Inc.
+ Contributed by Doug Kwan <dougkwan@google.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "toplev.h"
+#include "tree.h"
+#include "expr.h"
+#include "flags.h"
+#include "cgraph.h"
+#include "function.h"
+#include "diagnostic.h"
+#include "vec.h"
+#include "bitmap.h"
+#include "timevar.h"
+#include "tree-flow.h"
+#include "tree-pass.h"
+#include "lto-streamer.h"
+
+/* LTO fix-up.
+
+ In WPA mode, LTO cannot access function bodies. Some modifications in
+ IR require additional updates in function bodies, which are not possible
+ in WPA mode. So we write out information about these modifications for
+ LTRANS to fix up the function bodies accordingly. */
+
+/* The vectors records function DECLs having multiple copies with different
+ exception throwing attributes. We do not mark a DECL if all copies of it
+ have the same exception throwing attribute. */
+static bitmap lto_nothrow_fndecls;
+
+/* We need to fix up GIMPLE bodies due to changes in exception setting.
+ Consider this example:
+
+ a.h:
+ class a {
+ public:
+ a();
+ ~a();
+ };
+
+ main.cc:
+ #include "a.h"
+
+ int
+ main (int argc, char **argv)
+ {
+ a x;
+ return 0;
+ }
+
+ a.cc:
+ #include "a.h"
+ a::a() {}
+ a::~a() {}
+
+ When main.cc is compiled, gcc only sees the constructor declaration, so
+ the constructor and hence the call to it are marked as exception throwing.
+ When a.cc is compiled, the body of the constructor is available and is
+ obviously not exception throwing. Thus DECL of a::a in a.o has the NOTHROW
+ attribute. When LTO runs, two DECLs of a::a with different exception
+ attributes are merged. We want the merged DECL to be not exception
+ throwing for better generated code. To do that, we need to fix up any
+ function calls that have been marked as exception throwing. */
+
+/* Fix up all the call statements whose target fndecls might have changed
+ to NOTHROW. Note that this problem is not WPA specific. We can also
+ run into this problem in normal LTO with multiple input files. */
+
+void
+lto_fixup_nothrow_decls (void)
+{
+ struct cgraph_node *node;
+ struct cgraph_edge *edge;
+ struct function *caller_function;
+ gimple call_stmt;
+
+ /* Quit if we are in WPA mode or have not marked any DECLs. */
+ if (flag_wpa || !lto_nothrow_fndecls)
+ return;
+
+ /* For each node that has been marked, go over all call edges to it. */
+ for (node = cgraph_nodes; node; node = node->next)
+ if (bitmap_bit_p (lto_nothrow_fndecls, DECL_UID (node->decl)))
+ {
+ gcc_assert (TREE_NOTHROW (node->decl));
+ for (edge = node->callers; edge; edge = edge->next_caller)
+ {
+ caller_function = DECL_STRUCT_FUNCTION (edge->caller->decl);
+ call_stmt = edge->call_stmt;
+ gcc_assert (call_stmt);
+ if (lookup_stmt_eh_lp_fn (caller_function, call_stmt) != 0)
+ remove_stmt_from_eh_lp_fn (caller_function, call_stmt);
+ }
+ }
+}
+
+/* Mark FNDECL as becoming not exception throwing. */
+
+void
+lto_mark_nothrow_fndecl (tree fndecl)
+{
+ gcc_assert (TREE_CODE (fndecl) == FUNCTION_DECL);
+ if (!lto_nothrow_fndecls)
+ lto_nothrow_fndecls = lto_bitmap_alloc ();
+
+ bitmap_set_bit (lto_nothrow_fndecls, DECL_UID (fndecl));
+}
+
+/* Write out fix-up information. Currently the only WPA fix-up
+ information is the list of DECLs marked as not exception throwing. SET
+ is a cgraph node set whose fix-up information is to be written. */
+
+static void
+lto_output_wpa_fixup (cgraph_node_set set)
+{
+ struct lto_simple_output_block *ob;
+ cgraph_node_set_iterator csi;
+ tree fndecl;
+ bitmap seen_decls;
+ VEC(tree, heap) *decls = NULL;
+ unsigned HOST_WIDE_INT i, count;
+
+ ob = lto_create_simple_output_block (LTO_section_wpa_fixup);
+
+ /* Accumulate the DECLs to be written out. Since we do not want
+ duplicates, we need to use a bitmap and a vector to save the
+ DECLs we want. Note that we need to check if lto_nothrow_fndecls
+ is NULL. This happens when no DECL has been marked. */
+ seen_decls = lto_bitmap_alloc ();
+ if (lto_nothrow_fndecls)
+ for (csi = csi_start (set); !csi_end_p (csi); csi_next (&csi))
+ {
+ struct cgraph_edge *e;
+ struct cgraph_node *n;
+
+ n = csi_node (csi);
+ fndecl = n->decl;
+
+ /* Check if the N's function is in the set of nothrow functions. */
+ if (!bitmap_bit_p (seen_decls, DECL_UID (fndecl)))
+ {
+ bitmap_set_bit (seen_decls, (DECL_UID (fndecl)));
+ if (bitmap_bit_p (lto_nothrow_fndecls, DECL_UID (fndecl)))
+ VEC_safe_push (tree, heap, decls, fndecl);
+ }
+
+ /* Now check the callees and also add them if they are nothrow. This
+ is needed because node N may end up in a different partition than
+ its callees. In which case, when the file holding N is compiled,
+ the calls it makes to nothrow functions will not be fixed up,
+ causing verification issues. */
+ for (e = n->callees; e; e = e->next_callee)
+ {
+ fndecl = e->callee->decl;
+ if (!bitmap_bit_p (seen_decls, DECL_UID (fndecl)))
+ {
+ bitmap_set_bit (seen_decls, (DECL_UID (fndecl)));
+ if (bitmap_bit_p (lto_nothrow_fndecls, DECL_UID (fndecl)))
+ VEC_safe_push (tree, heap, decls, fndecl);
+ }
+ }
+ }
+
+ /* Write out number of DECLs, followed by the DECLs. */
+ count = VEC_length (tree, decls);
+ lto_output_uleb128_stream (ob->main_stream, count);
+ for (i = 0; i < count; i++)
+ {
+ fndecl = VEC_index (tree, decls, i);
+ lto_output_fn_decl_index (ob->decl_state, ob->main_stream, fndecl);
+ }
+
+ /* Release resources. */
+ lto_destroy_simple_output_block (ob);
+ VEC_free(tree, heap, decls);
+ lto_bitmap_free (seen_decls);
+}
+
+/* Read in WPA fix-up information from one file. FILE_DATA points to
+ DECL information of the file where as IB is the input block for the
+ WPA fix-up section. */
+
+static void
+lto_input_wpa_fixup_1 (struct lto_file_decl_data *file_data,
+ struct lto_input_block *ib)
+{
+ unsigned HOST_WIDE_INT i, count, decl_index;
+ tree fndecl;
+
+ count = lto_input_uleb128 (ib);
+ for (i = 0; i < count; i++)
+ {
+ decl_index = lto_input_uleb128 (ib);
+ fndecl = lto_file_decl_data_get_fn_decl (file_data, decl_index);
+ lto_mark_nothrow_fndecl (fndecl);
+ }
+}
+
+/* Read in WPA fix-up information. */
+
+static void
+lto_input_wpa_fixup (void)
+{
+ struct lto_file_decl_data ** file_data_vec
+ = lto_get_file_decl_data ();
+ struct lto_file_decl_data * file_data;
+ int i = 0;
+
+ /* Fix up information is only used in LTRANS mode. */
+ if (!flag_ltrans)
+ return;
+
+ while ((file_data = file_data_vec[i++]))
+ {
+ const char *data;
+ size_t len;
+ struct lto_input_block *ib
+ = lto_create_simple_input_block (file_data, LTO_section_wpa_fixup,
+ &data, &len);
+
+ lto_input_wpa_fixup_1 (file_data, ib);
+ lto_destroy_simple_input_block (file_data, LTO_section_wpa_fixup, ib,
+ data, len);
+ }
+}
+
+/* Gate function for all lto streaming passes. */
+
+static bool
+gate_wpa_fixup (void)
+{
+ return (flag_wpa || flag_ltrans) && gate_lto_out ();
+}
+
+struct ipa_opt_pass_d pass_ipa_lto_wpa_fixup =
+{
+ {
+ IPA_PASS,
+ "lto_wpa_fixup", /* name */
+ gate_wpa_fixup, /* gate */
+ NULL, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_WHOPR_WPA_FIXUP, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_dump_func /* todo_flags_finish */
+ },
+ NULL, /* generate_summary */
+ lto_output_wpa_fixup, /* write_summary */
+ lto_input_wpa_fixup, /* read_summary */
+ NULL, /* function_read_summary */
+ 0, /* TODOs */
+ NULL, /* function_transform */
+ NULL /* variable_transform */
+};
+
diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c
new file mode 100644
index 00000000000..cddd4156a35
--- /dev/null
+++ b/gcc/lto-wrapper.c
@@ -0,0 +1,396 @@
+/* Wrapper to call lto. Used by collect2 and the linker plugin.
+ Copyright (C) 2009 Free Software Foundation, Inc.
+
+ Factored out of collect2 by Rafael Espindola <espindola@google.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 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/>. */
+
+
+/* This program is passed a gcc, a list of gcc arguments and a list of
+ object files containing IL. It scans the argument list to check if
+ we are in whopr mode or not modifies the arguments and needed and
+ prints a list of output files on stdout.
+
+ Example:
+
+ $ lto-wrapper gcc/xgcc -B gcc a.o b.o -o test -flto
+
+ The above will print something like
+ /tmp/ccwbQ8B2.lto.o
+
+ If -fwhopr is used instead, more than one file might be produced
+ ./ccXj2DTk.lto.ltrans.o
+ ./ccCJuXGv.lto.ltrans.o
+*/
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "intl.h"
+#include "libiberty.h"
+
+int debug; /* true if -debug */
+
+enum lto_mode_d {
+ LTO_MODE_NONE, /* Not doing LTO. */
+ LTO_MODE_LTO, /* Normal LTO. */
+ LTO_MODE_WHOPR /* WHOPR. */
+};
+
+/* Current LTO mode. */
+static enum lto_mode_d lto_mode = LTO_MODE_NONE;
+
+static char *ltrans_output_file;
+static char *flto_out;
+static char *args_name;
+
+static void maybe_unlink_file (const char *);
+
+/* Delete tempfiles and exit function. */
+
+static void
+lto_wrapper_exit (int status)
+{
+ if (ltrans_output_file)
+ maybe_unlink_file (ltrans_output_file);
+ if (flto_out)
+ maybe_unlink_file (flto_out);
+ if (args_name)
+ maybe_unlink_file (args_name);
+ exit (status);
+}
+
+/* Just die. CMSGID is the error message. */
+
+static void __attribute__ ((format (printf, 1, 2)))
+fatal (const char * cmsgid, ...)
+{
+ va_list ap;
+
+ va_start (ap, cmsgid);
+ fprintf (stderr, "lto-wrapper: ");
+ vfprintf (stderr, _(cmsgid), ap);
+ fprintf (stderr, "\n");
+ va_end (ap);
+
+ lto_wrapper_exit (FATAL_EXIT_CODE);
+}
+
+
+/* Die when sys call fails. CMSGID is the error message. */
+
+static void __attribute__ ((format (printf, 1, 2)))
+fatal_perror (const char *cmsgid, ...)
+{
+ int e = errno;
+ va_list ap;
+
+ va_start (ap, cmsgid);
+ fprintf (stderr, "lto-wrapper: ");
+ vfprintf (stderr, _(cmsgid), ap);
+ fprintf (stderr, ": %s\n", xstrerror (e));
+ va_end (ap);
+
+ lto_wrapper_exit (FATAL_EXIT_CODE);
+}
+
+
+/* Execute a program, and wait for the reply. ARGV are the arguments. The
+ last one must be NULL. */
+
+static struct pex_obj *
+collect_execute (char **argv)
+{
+ struct pex_obj *pex;
+ const char *errmsg;
+ int err;
+
+ if (debug)
+ {
+ char **p_argv;
+ const char *str;
+
+ for (p_argv = argv; (str = *p_argv) != (char *) 0; p_argv++)
+ fprintf (stderr, " %s", str);
+
+ fprintf (stderr, "\n");
+ }
+
+ fflush (stdout);
+ fflush (stderr);
+
+ pex = pex_init (0, "lto-wrapper", NULL);
+ if (pex == NULL)
+ fatal_perror ("pex_init failed");
+
+ errmsg = pex_run (pex, PEX_LAST | PEX_SEARCH, argv[0], argv, NULL,
+ NULL, &err);
+ if (errmsg != NULL)
+ {
+ if (err != 0)
+ {
+ errno = err;
+ fatal_perror (errmsg);
+ }
+ else
+ fatal (errmsg);
+ }
+
+ return pex;
+}
+
+
+/* Wait for a process to finish, and exit if a nonzero status is found.
+ PROG is the program name. PEX is the process we should wait for. */
+
+static int
+collect_wait (const char *prog, struct pex_obj *pex)
+{
+ int status;
+
+ if (!pex_get_status (pex, 1, &status))
+ fatal_perror ("can't get program status");
+ pex_free (pex);
+
+ if (status)
+ {
+ if (WIFSIGNALED (status))
+ {
+ int sig = WTERMSIG (status);
+ if (WCOREDUMP (status))
+ fatal ("%s terminated with signal %d [%s], core dumped",
+ prog, sig, strsignal (sig));
+ else
+ fatal ("%s terminated with signal %d [%s]",
+ prog, sig, strsignal (sig));
+ }
+
+ if (WIFEXITED (status))
+ fatal ("%s returned %d exit status", prog, WEXITSTATUS (status));
+ }
+
+ return 0;
+}
+
+
+/* Unlink a temporary LTRANS file unless requested otherwise. */
+
+static void
+maybe_unlink_file (const char *file)
+{
+ if (! debug)
+ {
+ if (unlink_if_ordinary (file))
+ fatal_perror ("deleting LTRANS file %s", file);
+ }
+ else
+ fprintf (stderr, "[Leaving LTRANS %s]\n", file);
+}
+
+
+/* Execute program ARGV[0] with arguments ARGV. Wait for it to finish. */
+
+static void
+fork_execute (char **argv)
+{
+ struct pex_obj *pex;
+ char *new_argv[3];
+ char *at_args;
+ FILE *args;
+ int status;
+
+ args_name = make_temp_file (".args");
+ at_args = concat ("@", args_name, NULL);
+ args = fopen (args_name, "w");
+ if (args == NULL)
+ fatal ("failed to open %s", args_name);
+
+ status = writeargv (&argv[1], args);
+
+ if (status)
+ fatal ("could not write to temporary file %s", args_name);
+
+ fclose (args);
+
+ new_argv[0] = argv[0];
+ new_argv[1] = at_args;
+ new_argv[2] = NULL;
+
+ pex = collect_execute (new_argv);
+ collect_wait (new_argv[0], pex);
+
+ maybe_unlink_file (args_name);
+ free (at_args);
+}
+
+
+/* Execute gcc. ARGC is the number of arguments. ARGV contains the arguments. */
+
+static void
+run_gcc (unsigned argc, char *argv[])
+{
+ unsigned i;
+ unsigned new_argc = argc;
+ const char **new_argv;
+ const char **argv_ptr;
+ char *list_option_full = NULL;
+
+ new_argc += 8;
+ new_argv = (const char **) xcalloc (sizeof (char *), new_argc);
+
+ argv_ptr = new_argv;
+
+ *argv_ptr++ = argv[0];
+ *argv_ptr++ = "-combine";
+ *argv_ptr++ = "-x";
+ *argv_ptr++ = "lto";
+ *argv_ptr++ = "-c";
+ if (lto_mode == LTO_MODE_LTO)
+ {
+ flto_out = make_temp_file (".lto.o");
+ *argv_ptr++ = "-o";
+ *argv_ptr++ = flto_out;
+ }
+ else if (lto_mode == LTO_MODE_WHOPR)
+ {
+ const char *list_option = "-fltrans-output-list=";
+ size_t list_option_len = strlen (list_option);
+ char *tmp;
+
+ ltrans_output_file = make_temp_file (".ltrans.out");
+ list_option_full = (char *) xmalloc (sizeof (char) *
+ (strlen (ltrans_output_file) + list_option_len + 1));
+ tmp = list_option_full;
+
+ *argv_ptr++ = tmp;
+ strcpy (tmp, list_option);
+ tmp += list_option_len;
+ strcpy (tmp, ltrans_output_file);
+
+ *argv_ptr++ = "-fwpa";
+ }
+ else
+ fatal ("invalid LTO mode");
+
+ /* Add inherited GCC options to the LTO back end command line.
+ Filter out some obviously inappropriate options that will
+ conflict with the options that we force above. We pass
+ all of the remaining options on to LTO, and let it complain
+ about any it doesn't like. Note that we invoke LTO via the
+ `gcc' driver, so the usual option processing takes place.
+ Except for `-flto' and `-fwhopr', we should only filter options that
+ are meaningful to `ld', lest an option go silently unclaimed. */
+ for (i = 1; i < argc; i++)
+ {
+ const char *s = argv[i];
+
+ if (strcmp (s, "-flto") == 0 || strcmp (s, "-fwhopr") == 0)
+ /* We've handled this LTO option, don't pass it on. */
+ ;
+ else if (*s == '-' && s[1] == 'o')
+ {
+ /* Drop `-o' and its filename argument. We will use a
+ temporary file for the LTO output. The `-o' option
+ will be interpreted by the linker. */
+ if (s[2] == '\0')
+ i++;
+ }
+ else
+ /* Pass the option or argument to LTO. */
+ *argv_ptr++ = s;
+ }
+
+ *argv_ptr = NULL;
+
+ fork_execute (CONST_CAST (char **, new_argv));
+ free (new_argv);
+ new_argv = NULL;
+
+ if (lto_mode == LTO_MODE_LTO)
+ {
+ printf("%s\n", flto_out);
+ free (flto_out);
+ flto_out = NULL;
+ }
+ else if (lto_mode == LTO_MODE_WHOPR)
+ {
+ FILE *stream = fopen (ltrans_output_file, "r");
+ int c;
+
+ if (!stream)
+ fatal_perror ("fopen: %s", ltrans_output_file);
+
+ while ((c = getc (stream)) != EOF)
+ putc (c, stdout);
+ fclose (stream);
+ maybe_unlink_file (ltrans_output_file);
+ free (list_option_full);
+ }
+ else
+ fatal ("invalid LTO mode");
+}
+
+
+/* Parse the command line. Copy any unused argument to GCC_ARGV. ARGC is the
+ number of arguments. ARGV contains the arguments. */
+
+static int
+process_args (int argc, char *argv[], char *gcc_argv[])
+{
+ int i;
+ int j = 0;
+
+ for (i = 1; i < argc; i ++)
+ {
+ if (! strcmp (argv[i], "-debug"))
+ debug = 1;
+ else if (! strcmp (argv[i], "-flto"))
+ lto_mode = LTO_MODE_LTO;
+ else if (! strcmp (argv[i], "-fwhopr"))
+ lto_mode = LTO_MODE_WHOPR;
+ else
+ {
+ gcc_argv[j] = argv[i];
+ j++;
+ }
+ }
+
+ return j;
+}
+
+
+/* Entry point. */
+
+int
+main (int argc, char *argv[])
+{
+ char **gcc_argv;
+ int gcc_argc;
+
+ gcc_init_libintl ();
+
+ /* We may be called with all the arguments stored in some file and
+ passed with @file. Expand them into argv before processing. */
+ expandargv (&argc, &argv);
+ gcc_argv = (char **) xcalloc (sizeof (char *), argc);
+ gcc_argc = process_args (argc, argv, gcc_argv);
+ run_gcc (gcc_argc, gcc_argv);
+ free (gcc_argv);
+
+ return 0;
+}
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
new file mode 100644
index 00000000000..3334de7eb95
--- /dev/null
+++ b/gcc/lto/ChangeLog
@@ -0,0 +1,2628 @@
+2009-11-04 Richard Guenther <rguenther@suse.de>
+ Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-elf.c (lto_elf_build_section_table): Add the base offset.
+ (lto_elf_file_open): Handle offsets in arguments name@offest.
+
+2009-10-30 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41858
+ * lto.c (lto_file_read): Do not set file_data->fd.
+ (lto_read_section_data): Use a single-entry file-descriptor cache.
+ Do not check the result of xmalloc.
+ (free_section_data): Do not use file_data->fd.
+ (lto_read_all_file_options): Likewise.
+
+2009-10-22 Richard Guenther <rguenther@suse.de>
+
+ * lto.c (lto_fixup_jump_functions): Remove.
+ (lto_fixup_decls): Do not fixup jump functions.
+ (read_cgraph_and_symbols): Schedule cgraph merging after
+ summary reading. Schedule type and decl fixup before
+ summary reading.
+
+2009-10-22 Richard Guenther <rguenther@suse.de>
+
+ * lto.c (lto_fixup_data_t): Remove free_list member.
+ (lto_fixup_tree): Do not insert into free_list.
+ (free_decl): Remove.
+ (lto_fixup_decls): Remove free-list handling.
+
+2009-10-22 Jan Hubicka <jh@suse.cz>
+
+ * lto.c (lto_fixup_jump_functions): New function.
+ (lto_fixup_decls): Use it.
+
+2009-10-16 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41715
+ * lto.c (lto_fixup_tree): Revert last change.
+
+2009-10-14 Richard Guenther <rguenther@suse.de>
+
+ * lto.c (lto_fixup_tree): In case the prevailing decl is not
+ compatible with the one we replace wrap it around a
+ VIEW_CONVERT_EXPR.
+
+2009-10-09 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41635
+ PR lto/41636
+ * lto.c (read_cgraph_and_symbols): Do not assert we can open
+ a file.
+ * lto-elf.c (init_shdr##BITS): Fix i18n problems.
+ (init_ehdr##BITS): Likewise.
+
+2009-10-08 Joseph Myers <joseph@codesourcery.com>
+
+ * lto-elf.c (init_shdr##BITS, lto_elf_begin_section_with_type,
+ init_ehdr##BITS, lto_elf_file_close): Remove trailing "." from
+ diagnostics.
+ * lto-lang.c (lto_post_options): Remove trailing "." from
+ diagnostics.
+
+2009-10-08 Richard Guenther <rguenther@suse.de>
+
+ * lto.c (read_cgraph_and_symbols): Free the gimple type merging
+ hash tables.
+
+2009-10-07 Joseph Myers <joseph@codesourcery.com>
+
+ * lto.c: Only include <sys/mman.h> if HAVE_MMAP_FILE.
+
+2009-10-07 Jan Hubicka <jh@suse.cz>
+
+ * lto.c (read_cgraph_and_symbols): Mark functions neccesary only at
+ ltrans stage; explain why this is needed and should not.
+
+2009-10-05 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41552
+ PR lto/41487
+ * lto.c (lto_read_decls): Do not register deferred decls.
+ (read_cgraph_and_symbols): Delay symbol and cgraph merging
+ until after reading the IPA summaries.
+
+2009-10-02 Rafael Avila de Espindola <espindola@google.com>
+
+ * Make-lang.in (lto/lto-lang.o): Don't depend on lto/common.h.
+ (lto-lang.c): Don't include lto/common.h.
+
+2009-10-02 Rafael Avila de Espindola <espindola@google.com>
+
+ * Make-lang.in (LTO_OBJS): Remove lto/common.o.
+ (lto/common.o): Remove.
+ * common.c: Remove.
+ * common.h (lto_kind_str): Remove.
+ (lto_visibility_str): Remove.
+ (lto_resolution_str): Make it static.
+
+2009-10-01 Diego Novillo <dnovillo@google.com>
+
+ * lto.c (lto_read_decls): Add comment.
+ Call internal_error instead of gcc_assert.
+ (lto_resolution_read): Likewise.
+ (lto_add_all_inlinees): Tidy.
+ * Make-lang.in: Fix copyright boilerplate.
+ (lto.pdf): New.
+ (lto.install-pdf): New.
+ * lto-tree.h: Fix copyright boilerplate.
+ * lang-specs.h: Likewise.
+ Remove ".lto" entry from compilers fragment.
+ * lto-elf.c: Move inclusion of gelf.h after config.h.
+ Tidy formatting everywhere.
+ * lto.h: Fix copyright boilerplate.
+ Tidy formatting everywhere.
+ * common.c: Likewise.
+ * config-lang.in: Likewise.
+ * common.h: Likewise.
+ * lto-lang.c: Likewise.
+
+2009-10-01 Richard Guenther <rguenther@suse.de>
+
+ * lto.c (lto_read_section_data): Use plain lseek/read.
+
+2009-10-01 Richard Guenther <rguenther@suse.de>
+
+ * lto.c (LTO_MMAP_IO): Define if we can mmap files and
+ use sysconf to query the system page size.
+ (lto_file_read): Implement fallback using stdio.
+ (free_section_data): Likewise.
+
+2009-09-29 Diego Novillo <dnovillo@google.com>
+
+ * lto-lang.c (lto_init): Really fix call to
+ build_common_builtin_nodes.
+
+2009-09-29 Diego Novillo <dnovillo@google.com>
+
+ * lto-lang.c (lto_init): Fix call to
+ build_common_builtin_nodes.
+
+2009-09-29 Richard Guenther <rguenther@suse.de>
+
+ PR lto/40754
+ * lto-elf.c (init_shdr##BITS): Properly specify alignment
+ in bytes.
+ (first_data_block): New static variable.
+ (lto_elf_append_data): Align the first data block in each
+ section.
+
+2009-09-28 Diego Novillo <dnovillo@google.com>
+
+ * lto-lang.c: Tidy. Remove stale FIXME lto markers.
+ * lto.c (strip_extension): New.
+ (get_filename_for_set): Call it. Do not call make_cwd_temp_file.
+ (lto_execute_ltrans): Tidy.
+ Do not pass -fwpa nor -fltrans-* to LTRANS.
+ * opts.c: Tidy formatting and remove stale FIXME lto markers.
+ * tree.c (need_assembler_name_p): Call
+ lang_hooks.decls.may_need_assembler_name_p if set.
+ * varasm.c (default_binds_local_p_1): Remove check for
+ flag_ltrans.
+ * varpool.c (decide_is_variable_needed): Do not test for
+ in_lto_p.
+
+2009-09-22 Richard Guenther <rguenther@suse.de>
+
+ PR lto/39276
+ * lto.c (lto_execute_ltrans): Perform ltrans phase manually.
+ * Make-lang.in: Remove ltrans-driver stuff.
+ * config-lang.in: Likewise.
+ * lang.opt (fltrans-driver): Remove.
+ * lto-lang.c (lto_init_options): Remove code initializing
+ ltrans_driver.
+ * ltrans-driver: Remove.
+
+2009-09-21 Diego Novillo <dnovillo@google.com>
+
+ * lto-lang.c (lto_define_builtins): Remove superfluous
+ calls to targetm.init_builtins and build_common_builtin_nodes.
+ (lto_init): Add targetm.arm_eabi_unwinder as parameter to
+ build_common_builtin_nodes.
+ * lto.c (lto_materialize_function): Do nothing if NODE is a
+ clone.
+
+2009-09-03 Diego Novillo <dnovillo@google.com>
+
+ * lto-elf.c (validate_file): Replace call to
+ elf_getshstrndx with call to elf_getshdrstrndx.
+
+2009-08-19 Richard Guenther <rguenther@suse.de>
+
+ * lto-lang.c (lto_init): Merge char_type_node with the
+ appropriately signed variant.
+
+2009-08-19 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41071
+ * lto.c (lto_fixup_common): Re-build the pointer-to chain part one.
+ (lto_fixup_type): Re-build the pointer-to chain part two.
+
+2009-08-19 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41071
+ * lto.c (lto_fixup_type): Re-build the type variant chain.
+
+2009-08-19 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41071
+ * lto.c (lto_fixup_constructor): New function.
+ (lto_fixup_tree): Replace all types. Properly fixup
+ constructors and constants.
+
+2009-08-14 Richard Guenther <rguenther@suse.de>
+
+ * lto.c (read_cgraph_and_symbols): Exchange TREE_CHAIN use
+ for DECL_LANG_SPECIFIC.
+
+2009-08-13 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41032
+ * lto-lang.c (LANG_HOOKS_TYPES_COMPATIBLE_P): Define to NULL.
+
+2009-07-30 Richard Guenther <rguenther@suse.de>
+
+ PR lto/40903
+ * lto.c (read_cgraph_and_symbols): After fixing up decls choose
+ the largest decl for output and free TREE_CHAIN for further
+ use.
+
+2009-07-24 Diego Novillo <dnovillo@google.com>
+
+ * Make-lang.in: Add empty lto.install-plugin target.
+
+2009-07-13 Diego Novillo <dnovillo@google.com>
+
+ * lto.c (lto_fixup_tree): Handle IMPORTED_DECL.
+
+2009-07-11 Richard Guenther <rguenther@suse.de>
+
+ * lto-lang.c (lto_write_globals): Wrapup global decls.
+
+2009-07-10 Richard Guenther <rguenther@suse.de>
+
+ * lto-lang.c (lto_init): Allocate one more location to make
+ BUILTINS_LOCATION correct.
+
+2009-07-09 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * lto.c (free_section_data): Cast computed_offset to caddr_t.
+
+2009-07-06 Diego Novillo <dnovillo@google.com>
+
+ * lto.c (lto_fixup_type): Fixup TYPE_SIZE and
+ TYPE_SIZE_UNIT.
+
+2009-07-06 Diego Novillo <dnovillo@google.com>
+
+ * lto.c (preload_common_nodes): Remove.
+ (lto_read_in_decl_state): Call lto_streamer_cache_get.
+ (lto_read_decls): Call lto_data_in_create and
+ lto_data_in_delete.
+ (free_decl): Do not call ggc_free.
+ (lto_main): Call lto_init_reader.
+ * lto-lang.c (lto_type_for_size): Handle intTI_type_node.
+ (lto_init): Initialize main_identifier_node if needed.
+ Make ptrdiff_type_node be integer_type_node.
+
+2009-06-19 Diego Novillo <dnovillo@google.com>
+
+ * lto.c: Remove code guarded by #ifdef LTO_STREAM_DEBUGGING.
+ Remove code guarded by #ifdef GLOBAL_STREAMER_TRACE.
+ Remove code guarded by #ifdef LOCAL_TRACE.
+
+2009-06-18 Diego Novillo <dnovillo@google.com>
+
+ * lto.c: Update license to GPLv3.
+ * lto-elf.c: Likewise.
+ * common.c: Likewise.
+ * lto-lang.c: Likewise.
+ * lto.h: Remove superfluous include files. Update all
+ users.
+
+2009-06-17 Diego Novillo <dnovillo@google.com>
+
+ * lto.c (read_cgraph_and_symbols): Call input_cgraph.
+
+2009-06-02 Diego Novillo <dnovillo@google.com>
+
+ * lto.c (lto_1_to_1_map): Ignore nodes that have not been
+ read in.
+ (materialize_cgraph): Only materialize nodes that have a
+ representation on file.
+
+2009-06-01 Diego Novillo <dnovillo@google.com>
+
+ * lto-lang.c (lto_handle_option): Hanlde OPT_Wabi.
+
+2009-05-31 Diego Novillo <dnovillo@google.com>
+
+ * lto-lang.c (lto_type_for_mode): Handle all the modes
+ handled in c_common_type_for_mode.
+
+2009-05-21 Diego Novillo <dnovillo@google.com>
+
+ * lto-elf.c: Always include <gelf.h>.
+ * config-lang.in (target_libs): Remove.
+ (build_by_default): Set to no.
+
+2009-05-15 Diego Novillo <dnovillo@google.com>
+
+ * lto.c (lto_materialize_function): Assert that DECL is
+ not a builtin.
+ (materialize_cgraph): Don't try to materialize builtin
+ functions.
+ * lto-section-out.c (write_symbol_vec): Do not write
+ builtin functions.
+
+2009-05-13 Diego Novillo <dnovillo@google.com>
+
+ * lto-lang.c (LANG_HOOKS_GET_ALIAS_SET): Define.
+
+2009-05-07 Diego Novillo <dnovillo@google.com>
+
+ * lto.c (lto_resolution_read): Add type casts for C++ warnings.
+ (LTO_REGISTER_TYPE_AND_FIXUP_SUBTREE): Define.
+ (lto_fixup_type): Call it for TYPE_POINTER_TO,
+ TYPE_REFERENCE_TO, TYPE_CONTEXT and TYPE_CANONICAL.
+ (lto_fixup_tree): Call gimple_register_type when *TP is a
+ type.
+ (lto_main): Call bitmap_obstack_initialize.
+
+2009-04-22 Diego Novillo <dnovillo@google.com>
+
+ * lto.c (free_section_data): Tidy.
+ (lto_1_to_1_map): Tidy.
+ (lto_add_all_inlinees): Tidy.
+ (prefix_name_with_star): New.
+ (get_filename_for_set): New.
+ (lto_wpa_write_files): Call cgraph_node_set_needs_ltrans_p
+ to determine what cgraph node sets to write.
+ Call get_filename_for_set to compute temporary file
+ names.
+ (lto_execute_ltrans): Do not execute LTRANS on files with
+ names that start with '*'.
+ Move logic to execute LTRANS together so that LTRANS is
+ invoked only if there are any files to compile.
+ (do_whole_program_analysis): Only remove output files
+ that do not start with '*'.
+
+2009-04-06 Diego Novillo <dnovillo@google.com>
+
+ * lto-lang.c (lto_post_options): Set flag_excess_precision_cmdline.
+ * lto.c (read_cgraph_and_symbols): Set cgraph_function_flags_ready.
+ (lto_add_all_inlinees): Tidy.
+
+2009-03-26 Diego Novillo <dnovillo@google.com>
+
+ * lto.c: Include gimple.h.
+ (lto_read_in_decl_state): Call gimple_register_type for
+ every type in every stream.
+ (lto_fixup_common): Call gimple_register_type if T has a
+ type.
+ (do_whole_program_analysis): Call print_lto_report.
+ (lto_main): Call print_lto_report after cgraph_optimize.
+ * Make-lang.in (lto.o): Add dependency on GIMPLE_H.
+
+2009-03-24 Diego Novillo <dnovillo@google.com>
+
+ * Make-lang.in (lto-lang.o): Add dependency on TARGET_H and EXPR_H.
+ (lto.o): Add dependency on GIMPLE_H.
+
+2009-03-10 Simon Baldwin <simonb@google.com>
+
+ * lto.c (lto_read_all_file_options): Close any open file descriptor
+ contained in file_data before freeing.
+
+2009-02-24 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto.c (lto_add_inline_clones): Don't add the master clone. Check
+ for a decl in the original bitmap, not a node.
+ (lto_add_all_inlinees): Remove original nodes that are not needed.
+ (lto_scan_statics_in_cgraph_node): Don't care if the node is the master.
+
+2009-02-24 Diego Novillo <dnovillo@google.com>
+
+ * lto.c (lto_materialize_function): Update
+ lto_stats.num_function_bodies.
+ (get_section_data): Initialize *LEN to 0.
+ (lto_1_to_1_map): Update lto_stats.num_cgraph_partitions.
+ (lto_wpa_write_files): Update lto_stats.num_cgraph_nodes.
+ Update lto_stats.num_output_files.
+ (read_cgraph_and_symbols): Update lto_stats.num_input_files.
+ (materialize_cgraph): Update lto_stats.num_input_cgraph_nodes.
+ (lto_main): Initialize lto_stats.
+ If flag_lto_report is set, call print_lto_report.
+
+2009-02-19 Diego Novillo <dnovillo@google.com>
+
+ Revert
+
+ 2009-02-19 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto.c (lto_add_inline_clones): Don't add the
+ master clone. Check for a decl in the original
+ bitmap, not a node.
+ (lto_add_all_inlinees): Remove original nodes
+ that are not needed.
+ (lto_scan_statics_in_cgraph_node): Don't care if
+ the node is the master.
+ (lto_promote_cross_file_statics): Use a new
+ context.seen_node_decls for each set
+
+2009-02-19 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto.c (lto_add_inline_clones): Don't add the master clone. Check
+ for a decl in the original bitmap, not a node.
+ (lto_add_all_inlinees): Remove original nodes that are not needed.
+ (lto_scan_statics_in_cgraph_node): Don't care if the node is the master.
+ (lto_promote_cross_file_statics): Use a new context.seen_node_decls
+ for each set
+
+2009-02-18 Diego Novillo <dnovillo@google.com>
+
+ * lto.c (lto_wpa_write_files): Use timers TV_WHOPR_WPA
+ and TV_WHOPR_WPA_IO.
+ (lto_execute_ltrans): Use timer TV_WHOPR_WPA_LTRANS_EXEC.
+ (read_cgraph_and_symbols): Use timer TV_IPA_LTO_DECL_IO.
+ (materialize_cgraph): Use timer TV_IPA_LTO_GIMPLE_IO.
+ Use timer TV_WHOPR_WPA or TV_WHOPR_LTRANS or TV_LTO
+ depending on command line flags.
+ (do_whole_program_analysis): Use timer TV_WHOPR_WPA.
+ (lto_main): Remove timer uses.
+
+2009-02-18 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto.c (lto_materialize_function): Don't set DECL_EXTERN to 0.
+ (lto_wpa_write_files): Update calls to renamed functions.
+
+2009-02-17 Diego Novillo <dnovillo@google.com>
+
+ PR 39203
+ * lto-lang.c (lto_post_options): Disable -fwhole-program
+ when running LTRANS.
+
+2009-02-10 Diego Novillo <dnovillo@google.com>
+
+ * lto.c (read_cgraph_and_symbols): Fix comment.
+
+2009-02-10 Diego Novillo <dnovillo@google.com>
+
+ * lto.c (read_cgraph_and_symbols): Read options from all
+ IL files.
+
+2009-02-10 Diego Novillo <dnovillo@google.com>
+
+ * lto.c (read_cgraph_and_symbols): Factor out of lto_main.
+ (materialize_cgraph): Likewise.
+ (do_whole_program_analysis): Likewise.
+ (lto_main): Call read_cgraph_and_symbols,
+ materialize_cgraph and do_whole_program_analysis.
+
+2009-02-10 Simon Baldwin <simonb@google.com>
+
+ * lto.c: Include lto-opts.h.
+ * (lto_main): Clear file options at loop start, read any saved
+ options from the first file handled, and re-issue options.
+ * Makefile.in (lto.o): Add dependency on lto-opts.h.
+
+2009-02-02 Diego Novillo <dnovillo@google.com>
+
+ * lto.c (lto_main): Stop LTO_TIMER and use
+ TV_WHOPR_WPA_LTRANS_EXEC when launching LTRANS.
+
+2009-01-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR lto/38995
+ * lto-elf.c (init_shdr##BITS): Set the sh_addralign field
+ to POINTER_SIZE.
+
+2009-01-29 Ramana Radhakrishnan <ramana.r@gmail.com>
+
+ * Make-lang.in (LTO_EXE): Link with all
+ BACKENDLIBS and not only GMPLIBS
+
+2009-01-28 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR bootstrap/38992
+ * lto-elf.c: Include gelf.h instead of libelf.h.
+ (lto_elf_file_close): Replace elfx_update_shstrndx with
+ gelf_getehdr, elf_getscn, gelf_getshdr, gelf_update_shdr and
+ gelf_update_ehdr.
+
+2009-01-28 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/38996
+ * lto-elf.c (DEFINE_INIT_EHDR): Initialize e_version.
+
+2009-01-26 Diego Novillo <dnovillo@google.com>
+
+ * lto-lang.c (LANG_HOOKS_TYPES_COMPATIBLE_P): Update.
+
+2009-01-26 Diego Novillo <dnovillo@google.com>
+
+ * lto-lang.c (lto_types_compatible_p): Move to gimple.c
+ and rename into gimple_types_compatible_p.
+
+2009-01-12 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-lang.c (lang_hooks): Remove the const qualifier.
+
+2009-01-06 Diego Novillo <dnovillo@google.com>
+
+ * ltrans-driver: Mark 'all' target as phony.
+
+2008-12-31 Diego Novillo <dnovillo@google.com>
+
+ * ltrans-driver: Execute a NOP action for target 'all'.
+
+2008-12-19 Diego Novillo <dnovillo@google.com>
+
+ * lto.c (lto_1_to_1_map): Tidy.
+
+2008-12-19 Diego Novillo <dnovillo@google.com>
+
+ * lto-elf.c (lto_elf_file_open): When FILENAME cannot
+ be opened, show its name.
+ * ltrans-driver: If $verbose is set, do not use parallelism.
+
+2008-12-17 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto.c (lto_fixup_function): New.
+ (lto_fixup_tree): Call lto_fixup_function.
+
+2008-12-14 Doug Kwan <dougkwan@google.com>
+
+ * lto.c (lto_1_to_1_map): Create a cgraph node set for any global
+ variables if there is no function.
+
+2008-12-10 Simon Baldwin <simonb@google.com>
+
+ * ltrans-driver: Always run make in silent mode, to avoid make's
+ trace on stdout interfering with lto-wrapper output.
+
+2008-12-10 Doug Kwan <dougkwan@google.com>
+
+ * lto.c (lto_add_inline_clones): Do not force master clones of
+ inlined functions already in SET to be static inline.
+
+2008-12-04 Doug Kwan <dougkwan@google.com>
+
+ * lto.c (globalize_context_t): New type to store states in
+ globalization of cross-file statics.
+ (globalize_cross_file_statics): New.
+ (lto_scan_statics_in_ref_table): Walk tree to look for reachable
+ static decls that need to be fixed up.
+ (lto_scan_statics_in_cgraph_node): Change call interface to use
+ a globalize_context_t CONTEXT for all states used.
+ (lto_scan_statics_in_remaining_global_vars): New.
+ (lto_promote_cross_file_statics): Use new call interface of
+ LTO_SCAN_STATICS_IN_CGRAPH_NODE. Handle remaining externally
+ visible vars in the last set.
+
+2008-12-03 Diego Novillo <dnovillo@google.com>
+
+ * lto.c (lto_fixup_tree): Do not emit an error when
+ PREVAILING throw but T doesn't.
+
+2008-12-02 Doug Kwan <dougkwan@google.com>
+
+ * lto.c (lto_scan_statics_in_ref_table): New function factored out
+ from code in ...
+ (lto_scan_statics_in_cgraph_node): Handle both file-scope static
+ variables and functions.
+ (lto_promote_cross_file_statics): Rename bitmaps to SEEN_DECLS
+ and GLOBAL_DECLS from SEEN_VARS and GLOBAL_VARS.
+
+2008-11-29 Diego Novillo <dnovillo@google.com>
+
+ * lto.c: Include timevar.h.
+ (lto_materialize_function): Tidy. Add comments.
+ (lto_wpa_write_files): Tidy.
+ (lto_execute_ltrans): Tidy.
+ (lto_main): Add local variable LTO_TIMER. Initialize it
+ to one of TV_WHOPR_WPA, TV_WHOPR_LTRANS or TV_LTO.
+ Start and stop the timer.
+ Tidy comments.
+ * Make-lang.in (lto.o): Add dependency on timevar.h.
+ * ltrans-driver: React to -v and -save-temps.
+ Use simple heuristic to determine how much parallelism to
+ use when executing make.
+
+2008-11-12 Doug Kwan <dougkwan@google.com>
+
+ * lto.c (lto_bitmap_obstack): Remove var.
+ (lto_materialize_function): Do nothing instead of marking function
+ body in file if flag_wpa is true.
+ (lto_add_all_inlinees): Use bitmap functions in lto-utils.c.
+ (lto_scan_statics_in_cgraph_node): New function.
+ (lto_promote_cross_file_statics): Same.
+ (lto_wpa_write_files): Call lto_promote_cross_file_statics.
+ Use bitmap functions in lto-utils.c. Remove unsued label OUT.
+ * Make-lang.in (lto/lto.o): Add lto-utils.h to dependency list.
+
+2008-11-09 Diego Novillo <dnovillo@google.com>
+
+ * lto/lto.c (lto_fixup_tree): Change error message locus
+ information to include location of mismatching
+ declaration.
+ Use TREE_NO_WARNING to avoid repeated messages.
+ (lto_main): If lto_fixup_decls emitted any errors, exit.
+ * lto/lto-lang.c: Don't include libfuncs.h and except.h
+ (lto_init_options): Don't enable exceptions by default.
+ (lto_eh_runtime_type): Move to lto-function-in.c
+ (lto_init_eh): Likewise.
+ (lto_init): Don't call lto_init_eh.
+ * lto/Make-lang.in (lto-lang.o): Remove dependency on
+ libfuncs.h and except.h.
+
+2008-10-30 Diego Novillo <dnovillo@google.com>
+
+ * lto.c (lto_read_decls): Declare debug_main only if
+ LTO_STREAM_DEBUGGING is enabled.
+
+2008-10-30 Simon Baldwin <simonb@google.com>
+
+ * lto.c (lto_wpa_write_files): Create intermediate files with
+ make_cwd_temp_file().
+ (lto_maybe_unlink): New. Delete intermediate WPA files unless
+ WPA_SAVE_LTRANS is set.
+ (lto_main): Call lto_maybe_unlink() for intermediate WPA files.
+ * ltrans-driver: Do not strip directory from output files.
+
+2008-10-29 Doug Kwan <dougkwan@google.com>
+
+ * lto.c (free_decl): Call lto_symtab_clear_resolution when freeing
+ DECL.
+ * Make-lang.in (LTO_OBJS): Remove lto/lto-symtab.o
+ (lto/lto-symtab.o): Remove rule.
+ * lto-tree.h (struct lang_identifier): Remove LTO specific fields.
+ (struct lang_decl): Remove RESOLUTION and add DUMMY in struct.
+ (LANG_IDENTIFIER_CAST, LTO_IDENTIFIER_DECL, LTO_DECL_RESOLUTION):
+ Remove macros.
+ lto-symtab.c (File): Move up one level.
+ lto-lang.c (cgraph.h): Remove include.
+ (input_overwrite_node, input_node, input_edge, input_cgraph_1,
+ input_cgraph): Move to lto-cgraph.c in gcc directory above.
+ (LANG_HOOKS_INPUT_CGRAPH): Remove use of macro.
+
+2008-10-24 Rafael Espindola <espindola@google.com>
+
+ * lto-function-in.c (get_resolution): Return LDPR_PREEMPTED_IR for
+ non prevailing weak symbols.
+
+2008-10-24 Rafael Espindola <espindola@google.com>
+
+ * lto-lang.c (input_cgraph_1): Iterate over nodes, not cgraph_nodes.
+
+2008-10-24 Rafael Espindola <espindola@google.com>
+
+ * lto-lang.c (input_node): Avoid casts from pointers to ints of
+ different types.
+
+2008-10-23 Simon Baldwin <simonb@google.com>
+
+ * lto-lang.c (input_node): Save the node reference, rather than the
+ node pointer, in node->inlined_to.
+ (input_cgraph_1): Convert node references into node pointers.
+
+2008-10-22 Diego Novillo <dnovillo@google.com>
+ Rafael Espindola <espindola@google.com>
+
+ * lto.c (lto_resolution_read): Tidy.
+ * lto-symtab.c (lto_symtab_prevailing_decl): Do not
+ abort if RET is NULL.
+
+2008-10-22 Doug Kwan <dougkwan@google.com>
+
+ * lto.c (lto_fixup_tree): Check for NOTHROW conflict only if
+ exceptions flag is given.
+ * lto-lang.c: (lto_init_options) Set default exceptions flag.
+ (lto_init_eh): Remove exceptions flag initialization.
+ (lto_init): Only call lto_init_eh if exceptions flag is set.
+
+2008-10-21 Diego Novillo <dnovillo@google.com>
+
+ * lto.c: Tidy some formatting.
+ * lto.h: Likewise.
+
+2008-10-21 Simon Baldwin <simonb@google.com>
+
+ * lto-symtab.c: (lto_same_type_p): Types cannot be equal if one of
+ them is NULL (but not the other).
+
+2008-10-17 Diego Novillo <dnovillo@google.com>
+
+ * ltrans-driver: Divert output from make to a temporary file.
+ Show it if the call to make failed.
+
+2008-10-15 Diego Novillo <dnovillo@google.com>
+
+ * lto.c (lto_wpa_write_files): Reformat do-while loop.
+ Do not print TEMP_FILENAME
+ * ltrans-driver: Call make with -s.
+
+2008-10-15 Diego Novillo <dnovillo@google.com>
+
+ * lto-symtab.c (lto_symtab_merge_decl): Do not force
+ TREE_STATIC on global symbols.
+
+2008-10-14 Ollie Wild <aaw@google.com>
+
+ * Make-lang.in (LTRANS_DRIVER_INSTALL_NAME): Remove.
+ (LTRANS_DRIVER_EXE): Add.
+ (lto.all.cross): Add LTRANS_DRIVER_EXE.
+ (lto.all.encap): Add LTRANS_DRIVER_EXE.
+ (lto.install.common): Remove ltrans-driver.
+ (lto.mostlyclean): Add LTRANS_DRIVER_EXE.
+ (LTRANS_DRIVER_EXE): New build rule.
+ * config-lang.in (compilers): Add ltrans-driver.
+
+2008-10-14 Diego Novillo <dnovillo@google.com>
+
+ * Make-lang.in (LTRANS_DRIVER_INSTALL_NAME): Disable transformation
+ of program name.
+
+2008-10-13 Ollie Wild <aaw@google.com>
+
+ * lang-spec.h (@lto): Replace lto1_options with cc1_options.
+ * lto.c (lto_execute_ltrans): Add "-fno-wpa -fltrans -xlto" to CFLAGS.
+ * ltrans-driver (LTRANS_FLAGS): Remove.
+
+2008-10-08 Doug Kwan <dougkwan@google.com>
+
+ * lto.c (lto_fixup_tree): Remove ATTRIBUTE_UNUSED from DATA.
+ Handle new tree codes RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE
+ and TREE_BINFO. Also move code handling FUNCTION_DECL and VAR_DECL
+ from lto_fixup_state to here.
+ (lto_fixup_state): Take an lto_fixup_data_t object DATA instead of
+ just a free-list. Fix up types also. Move decl merging code to
+ lto_fixup_tree.
+ (lto_fixup_state_aux): Change AUX to point to an lto_fixup_data_t
+ object.
+ (lto_fixup_decls): Use another pointer set to avoid multiple
+ walking of nodes except for DECLs to be replaced. Pass an
+ lto_fixup_data_t object to tree-walker.
+
+2008-10-08 Rafael Espindola <espindola@google.com>
+
+ * lto-symtab.c (lto_symtab_set_resolution): New.
+ (lto_symtab_merge_decl): Use lto_symtab_set_resolution and
+ lto_symtab_get_resolution.
+ (lto_symtab_prevailing_decl): Return decl for non public decls.
+ (lto_symtab_get_resolution): New.
+ * lto.c (lto_fixup_tree, lto_fixup_state): Remove unecessary checks.
+
+2008-10-06 Rafael Espindola <espindola@google.com>
+
+ * lto-lang.c: Include cgraph.h.
+ (input_overwrite_node, input_node, input_edge, input_cgraph_1,
+ input_cgraph): Moved from lto-cgraph.c.
+ (LANG_HOOKS_INPUT_CGRAPH): New.
+
+2008-10-03 Rafael Espindola <espindola@google.com>
+
+ * lto.c (lto_fixup_tree, lto_fixup_state): Fix the FIXME.
+
+2008-10-03 Rafael Espindola <espindola@google.com>
+
+ * lto-symtab.c (lto_symtab_overwrite_decl): Remove. Remove all calls.
+ (lto_symtab_merge_decl): Update LTO_IDENTIFIER_DECL the reflect the
+ prevailing definition. Don't mark TREE_NOTHROW differences.
+ * lto.c (lto_fixup_tree): New.
+ (lto_fixup_state): New.
+ (lto_fixup_state_aux): New.
+ (free_decl): New.
+ (lto_fixup_decls): New.
+ (lto_main): Call lto_fixup_decls.
+
+2008-10-02 Ollie Wild <aaw@google.com>
+
+ * lang.opt (fltrans): Moved from common.opt. Remove RejectNegative
+ and Init.
+ (fwpa): Moved from common.opt. Remove RejectNegative and Init.
+ * lto-lang.c (lto_post_options): Add validation and fixups for
+ -fltrans and -fwpa.
+
+2008-10-02 Rafael Espindola <espindola@google.com>
+
+ * lto-symtab.c (lto_symtab_merge_var, lto_symtab_merge_fn,
+ lto_symtab_merge_decl): Return void.
+ (lto_symtab_prevailing_decl): New.
+
+2008-09-30 Rafael Espindola <espindola@google.com>
+
+ * lto-symtab.c (lto_symtab_compatible): Remove the check for already
+ defined symbols.
+ (lto_symtab_overwrite_decl): Copy LTO_DECL_RESOLUTION.
+ (lto_symtab_merge_decl): Store symbol resolution in LTO_DECL_RESOLUTION.
+ Check for already defined symbols.
+ * lto-tree.h (lang_decl): Remove dummy and add resolution fields.
+ (LTO_IDENTIFIER_RESOLUTION): Remove.
+ (LTO_DECL_RESOLUTION): New.
+
+2008-09-30 Rafael Espindola <espindola@google.com>
+
+ * lto.c (lto_read_decls): Use new input_tree signature.
+
+2008-09-26 Doug Kwan <dougkwan@google.com>
+
+ * lto.c (lto_main): Call lto_fixup_nothrow_decls to fix up function
+ bodies affected by exception attribute merging of DECLs.
+ * lto-symtab.c (lto_symtab_merge_decl): Handle exception attribute
+ merging.
+
+2008-09-25 Rafael Espindola <espindola@google.com>
+
+ * Make-lang.in (PLUGIN_API_H, LTO_TREE_H): New.
+ (lto/lto-lang.o, lto/lto.o, lto/lto-symtab.o) Use LTO_TREE_H.
+ * lto-symtab.c (lto_symtab_compatible): New.
+ (lto_symtab_overwrite_decl): New.
+ (lto_symtab_merge_decl): Refactor to use the above functions
+ and the resolution from lang_identifier.
+ * lto-tree.h: Include plugin-api.h.
+ (lang_identifier): Add resolution.
+ (LTO_IDENTIFIER_RESOLUTION): New.
+
+2008-09-25 Ollie Wild <aaw@google.com>
+
+ * lang.opt (fltrans-output-list=): New option.
+ * lto.c (lto_execute_ltrans): Output file names to ltrans_output_list.
+
+2008-09-25 Rafael Espindola <espindola@google.com>
+
+ * lto.c (lto_resolution_read): Initialize ret;
+
+2008-09-24 Ollie Wild <aaw@google.com>
+
+ * lto.c (sys/mman.h): Move include.
+ (lto_wpa_write_files): Return a list of written files.
+ (lto_execute_ltrans): New function.
+ (lto_main): Call lto_execute_ltrans.
+ (ltrans-driver): New file.
+ * lto-lang.c (DEFAULT_LTRANS_DRIVER): New macro.
+ (DEAULT_LTRANS_DRIVER_LEN): New macro.
+ (lto_init_options): Initialize ltrans_driver.
+ (lto_handle_option): Fix incorrect default output value.
+ * lang.opt (fltrans-driver=): New option.
+ * Make-lang.in (LTRANS_DRIVER_INSTALL_NAME): New variable.
+ (lto.install-common): Add lto/ltrans-driver.
+
+2008-09-24 Rafael Espindola <espindola@google.com>
+
+ * Make-lang.in (LTO_OBJS): Add lto/common.o.
+ (lto/lto.o): Depend on lto/common.h.
+ (lto/common.o): New.
+ * lang.opt (resolution): New.
+ * lto-lang.c (resolution_file_name): New.
+ (lto_handle_option): Handle OPT_resolution.
+ * lto-symtab.c (lto_symtab_merge_decl): Add a resolution argument.
+ (lto_symtab_merge_var,lto_symtab_merge_fn): Add a resolution argument.
+ pass it to lto_symtab_merge_decl.
+ * lto.c: Include common.h.
+ (lto_read_decls): Add resolutions and resolutions_size arguments.
+ Initialize data_in.globals_resolution and
+ data_in.globals_resolution_size.
+ (index_and_symbol_resolution): New.
+ (lto_resolution_read): New.
+ (lto_file_read): Add argument resolution_file.
+ Read resolution.
+ * lto.h (resolution_file_name): New.
+
+2008-09-23 Rafael Espindola <espindola@google.com>
+
+ * common.c: Update description.
+ * common.h: Update description.
+
+2008-09-23 Rafael Espindola <espindola@google.com>
+
+ * common.c: Moved from lto-plugin.
+ * common.h: Moved from lto-plugin.
+
+2008-09-22 Doug Kwan <dougkwan@google.com>
+
+ * lto.c (VEC(bitmap,heap)): Declare.
+ (lto_materialize_function): Handle WAP mode specially.
+ (lto_add_inline_clones): New.
+ (lto_add_all_inlinees): Changle algorithm and to use bitmaps. Also
+ return a bitmap of inlined decls.
+ (lto_wpa_write_files): Handle all DECLs brought in by inlining.
+ (lto_main): Call reset_inline_failed to reset inlining states.
+ Check call-graph after WPA inlining.
+ * lto-lang.c (lto_init): Do not clear flag_generate_lto
+ unconditionally.
+
+2008-09-19 Doug Kwan <dougkwan@google.com>
+
+ lto.c (lto_main): Remove unsued wrapper code.
+ lang-specs.h (@lto): Use lto1_options instead of cc1_options.
+
+2008-09-19 Rafael Espindola <espindola@google.com>
+
+ * lto-symtab.c: Include lto-tree-in.h.
+ * lto-tree.h (lto_symtab_merge_var, lto_symtab_merge_fn): Remove.
+ * lto.h (lto_symtab_merge_var, lto_symtab_merge_fn): Remove
+ * Make-lang.in (lto/lto-symtab.o): Add lto-tree-in.h.
+
+2008-09-17 Paolo Bonzini <bonzini@gnu.org>
+ Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-lang.c (COMPOUND_LITERAL_EXPR_DECL_STMT,
+ COMPOUND_LITERAL_EXPR_DECL): Remove.
+ (emit_local_var): Remove.
+ (lto_expand_expr): Remove.
+ (lto_staticp): Remove.
+ (LANG_HOOKS_EXPAND_EXPR): Remove.
+ (LANG_HOOKS_STATICP): Remove.
+
+2008-09-11 Diego Novillo <dnovillo@google.com>
+
+ * lto-lang.c: Include except.h and libfuncs.h.
+ (lto_init_eh): New.
+ (lto_init): Call it.
+ Set flag_generate_lto to 0.
+ * Make-lang.in (lto-lang.o): Add dependency on except.h
+ and libfuncs.h.
+
+2008-09-09 Bill Maddox <maddox@google.com>
+
+ * lto-lang.c: Include header file expr.h.
+ (COMPOUND_LITERAL_EXPR_DECL_STMT,
+ COMPOUND_LITERAL_EXPR_DECL): Copied from c-common.h.
+ (emit_local_var): Copied from c-semantics.c.
+ (lto_expand_expr, lto_staticp): Copied from c_expand_expr
+ and c_staticp in c-common.c.
+ (LANG_HOOKS_EXPAND_EXPR,LANG_HOOKS_STATICP): Redefined.
+
+2008-09-08 Diego Novillo <dnovillo@google.com>
+
+ * lto-lang.c (lto_global_bindings_p): Return 1 during
+ IPA passes.
+
+2008-09-07 Diego Novillo <dnovillo@google.com>
+
+ * lto.c: Tidy formatting.
+
+2008-08-04 Bill Maddox <maddox@google.com>
+
+ * lto-symtab.c (lto_symtab_merge_decl): Add comment.
+
+2008-09-03 Doug Kwan <dougkwan@google.com>
+
+ lto.c (lto_add_all_inlinees): Reset FAILED_REASON of edges to
+ CIF_OK instead of NULL.
+
+2008-09-02 Diego Novillo <dnovillo@google.com>
+ Simon Baldwin <simonb@google.com>
+
+ * lto-lang.c (lto_type_for_size): Rewrite. Adapt from
+ c_common_type_for_size.
+ (lto_type_for_mode): Remove ATTRIBUTE_UNUSED markers.
+ (lto_init): Call linemap_add.
+ (signed_and_unsigned_types): Remove.
+
+2008-08-29 Diego Novillo <dnovillo@google.com>
+
+ * lto-lang.c (handle_noreturn_attribute): New local function.
+ (handle_const_attribute): New local function.
+ (handle_malloc_attribute): New local function.
+ (handle_pure_attribute): New local function.
+ (handle_novops_attribute): New local function.
+ (handle_nonnull_attribute): New local function.
+ (handle_nothrow_attribute): New local function.
+ (handle_sentinel_attribute): New local function.
+ (handle_type_generic_attribute): New local function.
+ (handle_format_attribute): New local function.
+ (handle_format_arg_attribute): New local function.
+ (lto_attribute_table): Declare.
+ (lto_format_attribute_table): Declare.
+ (lto_init_attributes): New local function.
+ (lto_define_builtins): Call it.
+ Call targetm.init_builtins and build_common_builtin_nodes.
+ (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Define.
+ (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Define.
+
+2008-08-28 Diego Novillo <dnovillo@google.com>
+
+ * Make-lang.in (lto-lang.o): Replace tree-gimple.h with
+ $(GIMPLE_H).
+ (lto-symtab.o): Add dependency on $(GIMPLE_H).
+ * lto-lang.c: Include gimple.h instead of tree-gimple.h.
+ * lto-symtab.c: Include gimple.h.
+ * lto-tree.h (chain_next): Replace GENERIC_NEXT with
+ TREE_CHAIN.
+
+2008-08-27 Doug Kwan <dougkwan@google.com>
+
+ * lto.c (vec.h, bitmap.h, pointer-set.h, ipa-prop.h, ggc.h,
+ gt-lto-lto.h): New includes.
+ (lto_materialize_function): Do not read in function body in WPA mode.
+ Format a line to fit in 80 columns.
+ (lto_cgraph_node_sets): New garbage collected variable.
+ (lto_1_to_1_map, lto_add_all_inlinees, lto_wpa_write_files):
+ New functions.
+ (lto_main): Initialize bitmap obstack. Add code to handle WPA mode.
+ * Make-lang.in (LTO_H): Replace filename lto-section-in.h with
+ variable LTO_SECTION_IN_H.
+ (lto/lto.o): Include gt-lto-lto-c.h ggc.h ,VEC_H, BITMAP_H,
+ pointer-set.h and IPA_PROP_H. Also replace filename lto-section-in.h
+ with variable LTO_SECTION_IN_H.
+ * config-lang.in (gtfiles): Add lto/lto.c.
+ * lto-symtab.c (lto_symtab_merge_decl): Set DECL_CONTEXT of
+ merged DECL_RESULT correctly.
+
+2008-08-26 Bill Maddox <maddox@google.com>
+
+ * lto-lang.c Include tree-gimple.h.
+ (lto_mark_addressable): Call mark_addressable rather than
+ asserting.
+ (lto_post_options): Suppress debug info generation.
+ * Make-lang.in: Add dependency of lto-lang.o on tree-gimple.h.
+
+2008-08-25 Bill Maddox <maddox@google.com>
+
+ * lto-symtab.c (lto_symtab_merge_decl): Remove a suspect
+ assertion and leave an explanatory comment in its place.
+
+2008-08-21 Doug Kwan <dougkwan@google.com>
+
+ * lto.c (preload_common_nodes): Call lto_get_common_nodes to get a list
+ of common nodes instead of computing locallly.
+ (lto_read_in_decl_state): New.
+ (lto_read_decls): Change code for udpate in struct lto_decl_header.
+ Read global and per-function in-decl states.
+ * Make-lang.in (LTO_H): Update dependency.
+ (lto/lto.o): Same.
+ (lto-symtab.c): Merge (revision 139039)
+ * lto-symtab.c (lto_symtab_merge_decl): Merge DECL_RESULT.
+
+2008-08-21 Rafael Espindola <espindola@google.com>
+
+ * config-lang.in (target_libs): New.
+
+2008-08-20 Bill Maddox <maddox@google.com>
+
+ * lto.c (current_lto_file): Remove GTY marker from static
+ variable. Remove include of file gt-lto-lto.h.
+ * Make-lang.in: Remove dependency of lto/lto.o on
+ gt-lto-lto.h.
+ * lto-elf.c (lto_file_close): Removed.
+ (lto_elf_file_open): Use XCNEW instead of GGC_CNEW to
+ allocate lto_elf_file object.
+ (lto_elf_file_close): Free lto_elf_file object after close.
+ * lto.h (struct lto_file_struct): Remove GTY marker.
+ * config-lang.in: Remove lto/lto.h and lto/lto.c from
+ gtfiles.
+
+2008-08-20 Bill Maddox <maddox@google.com>
+
+ * lto.c (lto_read_decls): Provide dummy argument to input_tree
+ to conform to its new signature.
+ * lto-symtab.c (lto_symtab_merge_decl): Do not invoke ggc_free
+ on discarded node here, now called in global_vector_fixup.
+
+2008-08-09 Bill Maddox <maddox@google.com>
+
+ * lto.c (preload_common_nodes): Verify that fileptr_type_node
+ has not been set to a front-end-specific value.
+
+2008-08-05 Doug Kwan <dougkwan@google.com>
+
+ * Make-lang.in (lto-symtab.o): Add missing dependencies to fix
+ build breakage.
+
+2008-07-30 Bill Maddox <maddox@google.com>
+
+ * lto.c (lto_materialize_function): Call lto_original_decl_name.
+ Remove obsolete comments.
+ (lto_read_decls): Remove initialization of deleted field data_in.global.
+ Tidy up comments.
+ (lto_main): Remove redundant initialization of section_hash_table.
+ * lto-elf.c: Removed obsolete comments.
+ * lto.h: Tidy up comments.
+ * lto-symtab.c (lto_least_common_multiple): New function.
+ (lto_symtab_merge_decl): Merge variable alignments in some cases.
+ Tidy up comments.
+
+2008-07-25 Diego Novillo <dnovillo@google.com>
+ Bill Maddox <maddox@google.com>
+
+ * lto.c: Re-order include files.
+ Include lto-section-out.h.
+ (preload_common_nodes): Add debugging output.
+ Add new local INDEX_TABLE.
+ Call preload_common_node.
+ * Make-lang.in (lto.o): Add dependency on lto-section-out.h
+
+2008-07-13 Bill Maddox <maddox@google.com>
+
+ * lto.c (lto_read_decls): Cast pointer to const char * to avoid
+ unwanted scaling during pointer addition.
+
+2008-07-11 Bill Maddox <maddox@google.com>
+ Diego Novillo <dnovillo@google.com>
+
+ * lto.c (lto_read_decls): Fix C++ compatibility warnings.
+ Make code const-correct.
+ (lto_file_read): Fix C++ compatibility warnings.
+ (lto_read_section_data): Fix C++ compatibility warnings.
+ (lto_get_section_data): Use CONST_CAST to avoid warning when
+ const pointer passed to free.
+ * lto-elf.c (lto_elf_build_section_table): Fix C++
+ compatibility warnings.
+ (lto_elf_append_data): Fix C++ compatibility warnings. Use CONST_CAST
+ to avoid warning assigning const pointer to d_buf field of Elf_Data.
+ (lto_get_current_out_file): Fix C++ compatibility warnings.
+
+2008-07-11 Diego Novillo <dnovillo@google.com>
+
+ * Make-lang.in (lto-warn): Define.
+
+2008-07-03 Simon Baldwin <simonb@google.com>
+
+ * lto.c (lto_read_decls): Wrapped debug-only data items within #ifdef
+ LTO_STREAM_DEBUGGING.
+
+2008-06-27 Ollie Wild <aaw@google.com>
+
+ * lto-elf.c (lto-section-out.h): New include.
+ (struct lto_elf_file): Remove bits member. Add scn, shstrtab_stream,
+ and data members.
+ (cached_file_attrs): New static variable.
+ (lto_elf_get_shdr, lto_elf_free_shdr): Remove elf_file parameter.
+ Use cached_file_attrs for checking bits.
+ (lto_elf_build_section_table): Remove elf_file argument from
+ lto_elf_get_shdr and lto_elf_free_shdr calls.
+ (DEFINE_INIT_SHDR): New macro.
+ (init_shdr32, init_shdr64): New functions defined via the
+ DEFINE_INIT_SHDR macro.
+ (lto_elf_begin_section_with_type): New function.
+ (lto_elf_begin_section): New function.
+ (lto_elf_append_data): New function.
+ (lto_elf_end_section): New function.
+ (DEFINE_VALIDATE_EHDR): New macro.
+ (validate_ehdr32, validate_ehdr64): New functions defined via the
+ DEFINE_VALIDATE_EHDR macro.
+ (validate_file): New function.
+ (DEFINE_INIT_EHDR): New macro.
+ (init_ehdr32, init_ehdr64): New functions defined via the
+ DEFINE_INIT_EHDR macro.
+ (init_ehdr): New function.
+ (lto_elf_file_open): Add support for writable files. Move some
+ validation logic to validate_file.
+ (lto_elf_file_close): Add support for writable files. Write file data
+ and free data blocks.
+ (current_out_file): New static variable.
+ (lto_set_current_out_file): New function.
+ (lto_get_current_out_file): New function.
+ * lto.c (lto_main): Add writable argument to lto_elf_file_open calls.
+ Add temporary initialization for testing ELF serialization.
+ * lto.h (lto-section-out.h): New include.
+ (struct lto_file_struct): Slight modification to comment.
+ (lto_elf_file_open): Add writable parameter.
+ (lto_elf_begin_section): New function declaration.
+ (lto_elf_append_data): New function declaration.
+ (lto_elf_end_section): New function declaration.
+ (lto_set_current_out_file, lto_get_current_out_file): New function
+ declarations.
+ * lto-lang.c (LANG_HOOKS_BEGIN_SECTION): Set as lto_elf_begin_section.
+ (LANG_HOOKS_APPEND_DATA): Set as lto_elf_append_data.
+ (LANG_HOOKS_END_SECTION): Set as lto_elf_end_section.
+ * Make-lang.in (LTO_H): Add lto-section-out.h.
+
+2008-06-12 Ollie Wild <aaw@google.com>
+
+ * lto.h (struct lto_file_vtable_struct): Remove.
+ (struct lto_file_struct): Remove vtable member.
+ * lto-elf.c (lto_file_init): Remove vtable argument.
+ (lto_elf_map_optional_lto_section): Remove.
+ (lto_elf_unmap_section): Remove.
+ (lto_elf_file_vtable): Remove.
+ (lto_elf_file_open): Remove lto_elf_file_vtable argument from
+ lto_file_init call.
+ (lto_elf_find_section_data): Remove.
+
+2008-06-11 Ollie Wild <aaw@google.com>
+
+ * lto.c (lto_file_read): Add const qualifier to data variable.
+
+2008-06-11 Diego Novillo <dnovillo@google.com>
+
+ Merge from lto-streamber sub-branch.
+
+ 2008-06-04 Ollie Wild <aaw@google.com>
+
+ * lto.c: Remove inclusion of dwarf2.h and dwarf2out.h.
+ * Make-lang.in (lto.o): Remove dependency on dwarf2.h.
+
+ 2008-05-28 Bill Maddox <maddox@google.com>
+
+ Replace the DWARF reader in the LTO front-end.
+
+ * lto.c: Include lto-tree-in.h, lto-tags.h.
+ (enum DWARF2_class, DW_cl_constant, struct
+ DWARF2_form_data, struct lto_context,
+ lto_fd_init, lto_info_fd_init,
+ lto_abbrev_fd_init, lto_info_fd_close,
+ lto_file_init, lto_file_close,
+ lto_file_corrupt_error, lto_abi_mismatch_error,
+ LTO_CHECK_INT_VAL, LTO_READ_TYPE,
+ lto_read_uleb128, lto_read_sleb128,
+ lto_read_initial_length, lto_abbrev_read_attrs,
+ lto_abbrev_read, lto_abbrev_read_lookup,
+ lto_read_section_offset,
+ lto_read_comp_unit_header, find_cu_for_offset,
+ lto_get_file_name,
+ lto_resolve_reference,lto_read_form,
+ attribute_value_as_int,
+ make_signed_host_wide_int,
+ attribute_value_as_constant, lto_cache_hash,
+ lto_cache_eq, lto_cache_store_DIE,
+ lto_cache_lookup_DIE, lto_find_integral_type,
+ lto_find_integral_type_1,
+ LTO_BEGIN_READ_ATTRS_UNCHECKED,
+ LTO_BEGIN_READ_ATTRS, LTO_END_READ_ATTRS,
+ lto_unsupported_attr_error, lto_get_identifier,
+ lto_read_referenced_type_DIE,
+ lto_read_compile_unit_DIE,
+ lto_read_array_type_DIE,
+ lto_read_structure_union_class_type_DIE,
+ lto_read_enumerator_DIE,
+ lto_read_enumeration_type_DIE,
+ lto_read_only_for_child_DIEs,
+ lto_read_only_for_child_DIEs,
+ lto_read_member_DIE, lto_read_abbrev,
+ lto_read_variable_formal_parameter_constant_DIE,
+ lto_get_body): Removed.
+ (preload_common_nodes): New function.
+ (lto_read_decls): Convert for new global streamer.
+ (lto_materialze_file_data,
+ lto_read_subroutine_type_subprogram_die,
+ lto_read_unspecified_parameters_DIE,
+ lto_read_typedef_DIE,
+ lto_read_pointer_reference_type_DIE,
+ lto_read_subrange_type_DIE,
+ lto_read_base_type_DIE,
+ lto_read_const_volatile_restrict_type_DIE,
+ lto_read_namespace_DIE,
+ lto_read_unspecified_type_DIE, lto_read_DIE,
+ lto_read_child_DIEs, lto_collect_child_DIEs):
+ Removed.
+ (lto_info_read, lto_set_cu_context): Removed.
+ (lto_file_read): Convert for new global streamer.
+ (lto_resolve_type_ref, lto_read_DIE_at_ptr,
+ lto_resolve_var_ref, lto_resolve_fn_ref,
+ lto_resolve_field_ref, lto_resolve_typedecl_ref,
+ lto_resolve_namespacedecl_ref): Removed.
+ (lto_file_init, lto_file_close): Moved to lto-elf.c.
+ * lto-tree.h (lto_symtab_merge_var,
+ lto_symtab_mergee_fun): Declare here.
+ * lto-elf.c (lto_file_init, lto_file_close): Moved from lto.c.
+ (lto_elf_file_open): Removed code to read DWARF debug sections.
+ * lto.h (lto_context, DWARF2_attr, DWARF2_abbrev,
+ DWARF2_CompUnit, lto_die_ptr,
+ lto_die_cache_entry, lto_fd, lto_info_fd,
+ lto_abbrev_fd): Removed.
+ (lto_file): Removed debug_info and debug_abbrev fields.
+ (lto_ref): Removed.
+ (lto_file_init, lto_file_close,
+ lto_resolve_type_ref, lto_resolve_var_ref,
+ lto_resolve_fn_ref, lto_resolve_field_ref,
+ lto_resolve_typedecl_ref,
+ lto_resolve_namespacedecl_ref,
+ lto_get_file_name): Removed declarations.
+ (lto_symtab_merge_var, lto_symtab_merge_fn):
+ Declarations moved to lto-tree.h.
+ * lto-symtab.c (lto_compatible_attributes_p):
+ Lobotomize this, as it barfs on "Hello, world!".
+ * lto-section-out.c: Include lto-tree-out.h.
+ (lto_hash_global_slot_node,
+ lto_eq_global_slot_node, preload_common_nodes,
+ write_global_stream, write_global_references):
+ New functions.
+ (produce_asm_for_decls): Convert for new global streamer.
+ * lto-section-out.h (lto_hash_global_slot_node,
+ lto_eq_global_slot_node): Declare.
+
+2008-06-07 Kenneth Zadeck <zadeck@naturalbridge.com>
+ Jan Hubicka <jh@suse.cz>
+
+ * lto.c (sys/mman.h, tree-pass.h): New includes.
+ (lto_materialize_constructors_and_inits,
+ lto_materialize_function): Keeps length of section.
+ (lto_materialize_cgraph): Removed.
+ (lto_read_decls): Initialize fd field.
+ (lto_file_read): Different return type and removed much code to
+ lto_main.
+ (page_mask): New variable.
+ (lto_read_section_data, get_section_data, free_section_data): New
+ functions.
+ (lto_main): Now calls pass manager, sets the hooks so that the ipa
+ passes can get the section data.
+
+2008-05-27 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto.h (lto_read_decls): Made local.
+ (lto_input_function_body, lto_input_constructors_and_inits,
+ lto_input_cgraph): Declarations moved to lto-section-in.h.
+ * lto-section-in.c: Moved to .. .
+ * lto-cgraph-in.c: Ditto.
+ * lto-section-in.h: Ditto.
+ * lto-function-in.c: Ditto.
+ * lto-lang.c (lto_handle_option): Added ATTRIBUTE_UNUSED to parms.
+ (lto_insert_block): Removed.
+ (LANG_HOOKS_INSERT_BLOCK): Removed.
+ * Make-lang.in (lto-cgraph-in.o, lto-function-in.o,
+ lto-section-in.o): Rules moved to lto/Makefile.in.
+
+
+2008-05-16 Ollie Wild <aaw@google.com>
+
+ * lto-lang.c (tree-inline.h): Include.
+ (lto_post_options): New function.
+ (LANG_HOOKS_POST_OPTIONS): Define.
+ * lto-cgraph-in.c (overwrite_node): Set node->global.insns.
+ * lto-function-in.c (input_bb): Set TREE_BLOCK (stmt).
+
+2008-05-13 Diego Novillo <dnovillo@google.com>
+
+ * lto-function-in.c (input_ssa_names): Call
+ make_ssa_name_fn instead of make_ssa_name.
+
+2008-05-12 Diego Novillo <dnovillo@google.com>
+
+ * lto-cgraph-in.c (overwrite_node): Update references to
+ inline summary fields.
+ * lto-function-in.c (input_expr_operand): Do not handle
+ STRUCT_FIELD_TAG.
+
+2008-05-09 Ollie Wild <aaw@google.com>
+
+ * lang.opt: New file.
+ * lto-lang.c (lto_init_options): New function.
+ (lto_handle_option): New function.
+ (lto_init): Move initialization of flag_unit_at_a_time to
+ lto_init_options.
+ (LANG_HOOKS_INIT_OPTIONS): Define.
+ (LANG_HOOKS_HANDLE_OPTION): Define.
+
+2008-04-29 Ollie Wild <aaw@google.com>
+
+ * lto.c (lto_read_namespace_DIE): New function.
+ (lto_read_DIE): Add lto_read_namespace_DIE callback. Cache
+ NAMESPACE_DECL DIE's.
+ (lto_resolve_namespacedecl_ref): New function.
+ * lto.h (lto_resolve_namespacedecl_ref): New function.
+ * lto-section-in.c (lto_read_decls): Read namespace declarations.
+ * lto-section-in.h (struct lto_file_decl_data): Add namespace_decls
+ and num_namespace_decls.
+ * lto-function-in.c (input_expr_operand): Add NAMESPACE_DECL case.
+ * lto-lang.c (lto_init_ts): New function.
+ (LANG_HOOKS_INIT_TS): Set as lto_init_ts.
+
+2008-04-16 Ollie Wild <aaw@google.com>
+
+ * lto-function-in.c (input_type_ref): Updated function description.
+
+2008-04-16 Ollie Wild <aaw@google.com>
+
+ * lto-function-in.c (input_type_ref_1): New function.
+ (input_type_ref): Split into two functions.
+ (input_function): Add support for type contexts.
+
+2008-04-16 Ollie Wild <aaw@google.com>
+
+ * lto.c (lto_materialize_function): Use DECL_ASSEMBLER_NAME to compute
+ section name
+
+2008-04-16 Ollie Wild <aaw@google.com>
+
+ * lto.c (lto_read_compile_unit_DIE): Add DW_LANG_C_plus_plus to the
+ list of supported languages.
+
+2008-03-25 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ Merge with mainline @133491.
+
+2008-03-05 Kenneth Zadeck <zadeck@naturalbridge.com>
+ Jan Hubicka <jh@suse.cz>
+
+ * lto.c (lto_info_fd_init, lto_info_fd_close): Get rid of
+ fd->unmaterialized_fndecls.
+ (lto_get_file_name, lto_materialize_cgraph): New function.
+ (lto_materialize_constructors_and_inits,
+ lto_materialize_function): Read info directly from elf file.
+ (lto_file_read): Made local and initialize dictionary so that
+ other lto sections can be read without reprocessing the elf file.
+ (lto_main): Read all functions after all files have been processed
+ for their types, globals and cgraph.
+ * Make-lang.in (lto.o, lto-cgraph-in.c, lto-section-in): Changed
+ dependencies.
+ * lto-elf.c (lto_elf_file): Removed strtab, symtab fields.
+ (hash_name, eq_name, lto_elf_build_section_table): New functions.
+ (lto_elf_read_symtab): Removed function.
+ (lto_elf_file_open): Removed call to lto_elf_read_symtab.
+ * lto.h (lto_info_fd_struct): Removed unmaterialized_fndecls.
+ (lto_file_read): Made local.
+ (lto_get_file_name, lto_elf_build_section_table,
+ lto_input_cgraph):
+ New function.
+ * lto-section-in.c (lto_read_section_data, lto_get_section_data):
+ New functions.
+ (lto_read_decls): Get the file name.
+ * lto-cgraph-in.c: New file.
+ * lto-function-in.c (tag_to_expr): Stops at LTO_tree_last_tag.
+ (input_expr_operand, lto_read_body): Set lto_debug_context.tag_names.
+ (input_labels): Fixed latent sizeof issue.
+ (input_function): Build stmt array to set call sites into cgraph
+ edges.
+ (lto_read_body): Reset cfun->curr_properties.
+ * lto_section_in.h (lto_section_slot): New structure.
+ (section_hash_table.lto_file_decl_data): New field.
+
+
+2008-02-09 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto.c (lto_read_variable_formal_parameter_const): Remove code to
+ reconstruct static initializers.
+ (lto_get_body, lto_materialize_function): Add lto_section_type as
+ a parameter.
+ (lto_materialize_constructors_and_inits,
+ lto_materialize_file_data): New function.
+ (lto_materialize_function,
+ lto_read_subroutine_type_subprogram_DIE): Renamed unmap_fn_body to
+ unmap_section and map_fn_body to map_section.
+ (lto_set_cu_context): Process functions and static inits
+ differently.
+ * Make-lang.in (LTO_H, lto/lto-function-in.o,
+ lto/lto-section-in.o): Update dependencies.
+ * lto/lto-elf.c (lto_elf_map_optional_lto_section): Add
+ lto_section_type parameter.
+ (lto_elf_unmap_fn_body): Renamed to lto_elf_unmap_section.
+ * lto.h (lto_file_vtable_struct): Removed two of the fields and
+ renamed the other two so that there is only one map function and
+ one unmap function and each takes a section type parameter.
+ (lto_read_function_body): Renamed to lto_input_function_body and
+ added file_data parameter.
+ (lto_read_var_init): Removed.
+ (lto_input_constructors_and_inits): New function.
+ * lto-section-in.c (lto_read_decls): New function.
+ * lto-function-in.c (data_in): Moved fields field_decls, fn_decls,
+ var_decls, type_decls, types to lto_file_decl_data.
+ (input_type_ref, input_expr_operand, lto_read_body): Get
+ field_decls, fn_decls, var_decls, type_decls, types from different
+ structure.
+ (input_globals, input_constructor, lto_read_var_init): Removed.
+ (input_constructors_or_inits): New function.
+ (lto_read_function_body, lto_input_constructors_and_inits):
+ Renamed to lto_input_function_body and takes file_data parameter.
+ * lto-section-in.h (lto_file_decl_data): New structure.
+
+2008-01-28 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-function-in.c (input_globals.c): Changed input type to
+ lto_function_header.
+ (input_bb): Removed code to deserialize the stmt number.
+ (input_function): Renumber all stmts after they are input.
+ (lto_read_body, lto_read_function_body, lto_read_var_init):
+ Changed to used new header format and enum section_type.
+ *lto-lang.c (success): Removed.
+
+2008-01-28 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto-elf.c (lto_elf_lookup_sym): Remove unused function.
+ (lto_elf_free_sym): Likewise.
+
+ * lto-elf.c (lto_elf_read_var_init): Remove unused function.
+ (lto_elf_build_init): Likewise.
+
+2008-01-14 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c: Renamed to lto-function-in.c.
+ (input_1_unsigned): Moved to lto-section-in.c and renamed
+ lto_input_1_unsigned.
+ (input_uleb128): Moved to lto-section-in.c and renamed
+ lto_input_uleb128.
+ (input_widest_uint_uleb128): Moved to lto-section-in.c and renamed
+ lto_input_widest_uint_uleb128.
+ (input_sleb128): Moved to lto-section-in.c and renamed
+ lto_input_sleb128.
+ (input_integer): Moved to lto-section-in.c and renamed
+ lto_input_integer.
+ (debug_in_fun): Moved to lto-section-in.c and renamed
+ lto_debug_in_fun.
+ (input_block): Moved to lto-section-in.h and renamed
+ lto_input_block.
+ (input_expr_operand): Fixed to allow lists with more than one
+ element.
+ * lto-section-in.h: New file.
+ * lto-section-in.c: New file with changes from above.
+ * Make-lang.in (lto-read.o): Renamed lto-function-in.c.
+ (lto-section-in.o): New rule.
+
+2007-12-29 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto-read.c (input_expr_operand): Mark static and external
+ VAR_DECLs as needed.
+
+2007-12-29 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto-read.c (input_integer): Use the correct shift amount.
+
+2007-12-29 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto-lang.c (lto_pushdecl): Do nothing instead of aborting.
+ (LANG_HOOKS_NAME): Define.
+
+2007-12-27 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_find_integral_type): Define as a macro. Rename the
+ original function to...
+ (lto_find_integral_type_1): ...this. Consult UNSIGNEDP if we
+ don't have a base type.
+ (lto_read_enumeration_type_DIE): Examine the values of the
+ enumeration to determine whether we can use an unsigned type for
+ the base type of the enumeration.
+
+2007-12-24 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_read_structure_union_class_type_DIE): Set TYPE_MODE
+ and TYPE_ALIGN on UNION_TYPEs as soon as possible.
+
+2007-12-22 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto-lang.c (lto_types_compatible_p): New function.
+ (LANG_HOOKS_TYPES_COMPATIBLE_P): Define.
+
+2007-12-22 Nathan Froyd <froydnj@codesourcery.com>
+ Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (input_expr_operand): Fixed uninitialize var warning.
+ (input_local_vars): Read in DECL_INITIAL and context for local
+ statics that need to be put in unexpanded_vars_list.
+
+2007-12-21 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto-read.c (input_real): Use a separate null-terminated buffer
+ for calling real_from_string.
+ (input_expr_operand): If we take the address of a FUNCTION_DECL,
+ tell cgraph that it's needed.
+
+2007-12-19 Doug Kwan <dougkwan@google.com>
+
+ * lto.c (lto_read_base_type_DIE): Handle complex integer types.
+
+2007-12-18 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_read_DIE): Call lto_read_only_for_child_DIEs instead.
+ (lto_file_read): Reset the members of 'context' every time we read
+ a toplevel DIE, with special attention to last_param_type.
+
+2007-12-18 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_read_subroutine_type_subprogram_DIE): Initialize
+ 'declaration'. Set the assembler name for non-public functions.
+
+2007-12-17 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto_read.c (data_in.unexpanded_indexes): New array.
+ (input_local_var): Added code to read in unexpanded_var_list
+ indexes for variables. Only read in DECL_CHAIN field for
+ parameters.
+ (input_local_vars): Added code to rebuild unexpanded_var_list in
+ order using unexpanded_indexes.
+ (input_function): Added code to set DECL_CONTEXT for functions.
+
+2007-12-13 Doug Kwan <dougkwan@google.com>
+
+ * lto.c (lto_read_pointer_reference_type_DIE): Handle optional name
+ in pointer and reference types.
+
+2007-12-13 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto-read.c (input_expr_operand): Use DECL_RESULT when reading a
+ RESULT_DECL.
+
+2007-12-13 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_read_array_type_DIE): Return the cached DIE if we've
+ already read the DIE.
+ (lto_get_body): New function, split out from...
+ (lto_materialize_function): ...here. Call it.
+ (lto_read_subroutine_type_subprogram_DIE): Call lto_get_body to
+ determine DECL_EXTERNAL.
+ * lto-symtab.c (lto_symtab_merge_decl): Merge the DECL_RESULTs of
+ FUNCTION_DECLs when necessary. Use the type of the actual
+ function definition if we are unable to easily merge types. Ignore
+ spurious DECL_MODE mismatches on VAR_DECLs. Merge DECL_MODEs when
+ necessary.
+
+2007-12-13 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Define.
+
+2007-12-12 Bill Maddox <maddox@google.com>
+
+ Revert
+ 2007-12-07 Bill Maddox <maddox@google.com>
+
+ * lto.c (lto_str_fd_init): New function.
+ (lto_str_fd_close): New function.
+ (lto_file_init): Call lto_str_fd_init.
+ (lto_file_close): Call lto_str_fd_close.
+ (lto_str_read): New function. Read debug string table.
+ (lto_str_lookup): New function. Get string for debug
+ string table offset.
+ (lto_read_form): Recognize DW_FORM_strp.
+ (lto_file_read): Invoke lto_str_read.
+
+ * lto-elf.c (lto_elf_file_open): Read raw section data
+ for the .debug_str section, if present.
+
+ * lto.h (struct lto_str_fd_struct): New struct.
+ (struct lto_file_struct): Added new field DEBUG_STR
+ to hold the file descriptor for the debug string table.
+
+2007-12-07 Bill Maddox <maddox@google.com>
+
+ * lto.c (lto_str_fd_init): New function.
+ (lto_str_fd_close): New function.
+ (lto_file_init): Call lto_str_fd_init.
+ (lto_file_close): Call lto_str_fd_close.
+ (lto_str_read): New function. Read debug string table.
+ (lto_str_lookup): New function. Get string for debug
+ string table offset.
+ (lto_read_form): Recognize DW_FORM_strp.
+ (lto_file_read): Invoke lto_str_read.
+
+ * lto-elf.c (lto_elf_file_open): Read raw section data
+ for the .debug_str section, if present.
+
+ * lto.h (struct lto_str_fd_struct): New struct.
+ (struct lto_file_struct): Added new field DEBUG_STR
+ to hold the file descriptor for the debug string table.
+
+2007-12-07 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto-read.c (input_cfg): Call init_empty_tree_cfg_for_function.
+ Grow the basic_block_info and label_to_block_map vectors if
+ necessary. Read in the block chain.
+
+2007-12-06 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_read_DIE): Set TYPE_ALIAS_SET where necessary.
+
+2007-12-06 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_read_form): Add DW_cl_address for DW_AT_const_value.
+
+2007-12-06 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto-read.c (input_expr_operand): Don't check for MTAGs.
+ (lto_read_body): Don't declare PROP_alias.
+
+2007-12-06 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto-symtab.c (lto_symtab_merge_decl): Handle FUNCTION_DECLs without
+ argument type information.
+
+2007-12-03 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_read_variable_formal_parameter_constant_DIE): Set
+ TREE_THIS_VOLATILE if the associated type is a volatile type.
+ (lto_materialize_function): Remove call to init_ssa_operands.
+ * lto-read.c (input_expr_operand): Add SSA_NAME_VAR as a referenced
+ variable when reading an SSA_NAME. Do the same when reading a
+ RESULT_DECL, a RETURN_EXPR, or an MTAG.
+ (input_cfg): Call init_ssa_operands.
+ (input_ssa_names): Set the default def of an SSA_NAME if necessary.
+ Move call to init_tree_ssa...
+ (lto_read_body): ...here. Use push_cfun and pop_cfun. Call
+ add_referenced_var on any variables referenced from the body of the
+ function. Inform the rest of the compiler we are in SSA form and
+ inform later passes about the current properties.
+
+2007-11-30 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_materialize_function): Add FIXME.
+
+2007-11-29 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto-lang.c (enum built_in_attribute): New enum.
+ (flag_no_builtin, flag_no_nonansi_builtin, flag_isoc94, flag_isoc99,
+ built_in_attributes): New variables.
+ (def_builtin_1): New function.
+ (lto_define_builtins): #define DEF_BUILTIN and include builtins.def.
+
+2007-11-28 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_read_variable_formal_parameter_constant_DIE): Set
+ DECL_SOURCE_LOCATION for debugging purposes.
+ (lto_read_member_DIE): Set DECL_SOURCE_LOCATION. If we have read a
+ bitfield, use the type specified by the DIE for TREE_TYPE and defer
+ laying out the decl until later.
+ (lto_read_subroutine_type_subprogram_DIE): Compare the function's
+ name with DECL_ASSEMBLER_NAME. Set DECL_SOURCE_LOCATION and
+ TREE_ADDRESSABLE.
+ * lto-read.c (input_expr_operand): Set TREE_ADDRESSABLE on the
+ operand of an ADDR_EXPR.
+ * lto-lang.c (enum lto_builtin_type): New enum.
+ (builtin_type): New typedef.
+ (builtin_types, string_type_node, const_string_type_node,
+ wint_type_node, intmax_type_node, uintmax_type_node,
+ signed_size_type_node): New variables.
+ (def_fn_type, builtin_type_for_size, lto_define_builtins,
+ lto_build_c_type_nodes): New functions.
+ (lto_init): Initialize builtin types.
+ (lto_set_decl_assembler_name): Let the target machine mangle the
+ name if the decl is TREE_PUBLIC, otherwise uniquify it.
+
+2007-11-21 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_read_variable_formal_parameter_constant_DIE): Don't
+ set TREE_ADDRESSABLE. Do set DECL_COMDAT. Set TREE_READONLY if
+ the type is a constant type. Set the assembler name and inform
+ the rest of the compiler about the new decl if the decl is not
+ public.
+ (lto_read_subroutine_type_subprogram_DIE): Don't check for equivalency
+ of DECL_ASSEMBLER_NAME when determining if we have a builtin. Don't
+ try to read in function bodies for functions that already have bodies.
+ * lto-symtab.c (lto_same_type_p): Check for unbounded array
+ equivalency.
+ (lto_symtab_merge_decl): Don't merge decls that aren't TREE_PUBLIC.
+ Check for whether we matched a builtin function type before calling
+ lto_same_type_p on the generated type. Permit cases where the
+ declaration of an array is unbounded, but the definition is bounded.
+ Don't combine TREE_PUBLIC flags. Copy over DECL_SIZE and
+ DECL_SIZE_UNIT if necessary.
+
+2007-11-16 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (input_expr_operand): Get types right
+ for COMPLEX_CST.
+
+2007-11-16 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (make_new_block, input_cfg): Properly set
+ n_basic_blocks.
+
+2007-11-16 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_read_array_type_DIE): Handle DIEs with DW_AT_GNU_vector
+ set properly by building a VECTOR_TYPE instead of an ARRAY_TYPE.
+
+2007-11-16 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_read_base_type_DIE): Use make_bitfield_integer_type to
+ construct the integer type for bitfields.
+
+2007-11-16 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (data_in.current_node_has_loc): Removed.
+ (input_line_info): Returns true if node needs line set.
+ (set_line_info): Always sets line if called.
+ (clear_line_info): Removed reference to current_node_needs_loc.
+ (input_expr_operand): Keeps track locally if current node needs a loc.
+ (input_local_var): Added code to handle DECL_INITIAL for
+ static local vars. Only set loc if necessary.
+
+2007-11-15 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_read_subroutine_type_subprogram_DIE): Fix thinko'd
+ DECL_CONTEXT.
+
+2007-11-15 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c: Include langhooks.h.
+ (lto_find_integral_type): Rework logic to handle the case where
+ got_byte_size is true, but the bitsize requested and that of the
+ base_type doesn't match.
+ (lto_read_variable_formal_parameter_constant_DIE): Only check for
+ asm_name if we are creating a VAR_DECL.
+ (lto_materialize_function): Set DECL_EXTERNAL if we can't find a
+ definition.
+ (lto_read_subroutine_type_subprogram_DIE): Check for a builtin
+ function reference and use the builtin's decl if so. Set the
+ DECL_CONTEXT of the RESULT_DECL for the function.
+ * lto-lang.c (registered_builtin_fndecls): New variable.
+ (lto_getdecls): Return it.
+ (lto_builtin_function): Chain the new decl onto
+ registered_builtin_fndecls.
+
+2007-11-15 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (process_tree_flags, lto_static_init_local):
+ Renamed to ADD_CLASS_EXPR_FLAG. ADD_CLASS_DECL_FLAG New Macro.
+ (input_line_info, clear_line_info): Fixed new line number code.
+ (input_expr_operand): Added type to SWITCH_EXPR.
+ (lto_read_body): Properly initialized data_in.
+ Clear line info when leaving.
+
+2007-11-13 Diego Novillo <dnovillo@google.com>
+
+ * lto.c (lto_read_variable_formal_parameter_constant_DIE):
+ Initialize ARTIFICIAL.
+ (lto_read_subroutine_type_subprogram_DIE): Initialize
+ SAVED_SCOPE.
+ * lto-read.c (set_line_info): Remove ; from calls to
+ LINEMAP_POSITION_FOR_COLUMN.
+
+2007-11-13 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (input_type_ref): Renamed from get_type_ref.
+ (input_expr_operand, input_local_var): Renamed get_type_ref to
+ input_type_ref.
+ (input_expr_operand): Get the types correct for
+ vector-cst. Get SSA_NAME_DEF_STMT correct for return_exprs.
+
+2007-11-13 Doug Kwan <dougkwan@google.com>
+
+ * lto-read.c (input_widest_uint_uleb128): New function.
+ (input_tree_flags, process_tree_flags, input_line_info,
+ input_expr_operand, input_local_var, input_phi, input_ssa_names):
+ Change to use lto_flags_type and BITS_PER_LTO_FLAGS_TYPES instead of
+ unsigned HOST_WIDE_INT and HOST_BITS_PER_WIDE_INT.
+ (lto_static_init_local): Add code to assert that lto_flags_type is
+ wide enough.
+
+2007-11-13 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_read_array_type_DIE): Handle DW_AT_GNU_vector.
+ (lto_read_subroutine_type_subprogram_DIE): Handle
+ DW_AT_static_link and DW_AT_specification. Return the
+ specification if present.
+ (lto_read_base_type_DIE): Handle DW_ATE_complex_float.
+
+2007-11-13 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto-lang.c: Include target.h.
+ (registered_builtin_types): New variable.
+ (lto_type_for_mode): Increase number of modes handled.
+ (lto_builtin_function): Fix argument list and return the decl.
+ (lto_register_builtin_type): New function.
+ (lto_init): Initialize target builtins and language-independent
+ nodes.
+ (LANG_HOOKS_REGISTER_BUILTIN_TYPE): Define.
+
+2007-11-13 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (input_expr_operand): Added code to properly handle
+ index filed. Added new RANGE_EXPR case.
+
+2007-11-11 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (ADD_FUNC_FLAG): Deleted macro.
+ (data_in): Added current_node_has_loc field.
+ (input_line_info, set_line_info, clear_line_info): Added a support
+ for USE_MAPPED_LOCATION and not adding line numbers to nodes that
+ did not have on on the source side.
+ (input_expr_operand): Make sure that GIMPLE_MODIFY_STMTS get line
+ numbers too.
+
+2007-11-09 Doug Kwan <dougkwan@google.com>
+
+ * lto-read.c (input_expr_operand): Change type of operand 2 of
+ BIT_FIELD_REF expression to be bitsizetype instead of sizetype.
+
+2007-11-09 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c: Include lto-tree.h. Effect small spaces->tabs cleanup.
+ (lto_read_variable_formal_parameter_constant_DIE): Transfer bits
+ from a DW_AT_specification or DW_AT_abstract_origin attribute to
+ the new decl we are creating. Move informing the middle end about
+ the new decl to...
+ (lto_main): ...here. Inform the middle end about global variables
+ after we have read in all the input files.
+ * lto-symtab.c (lto_symtab_merge_decl): We really do need to merge
+ variables with internal linkage, so delete the check for internal
+ linkage. Combine TREE_PUBLIC flags.
+
+2007-11-08 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_read_subroutine_type_subprogram_DIE): Handle
+ DW_AT_decl_line.
+ * lto-symtab.c (lto_symtab_merge_decl): Handle redefinition of a
+ builtin specially. Move check for attribute compatibility
+ earlier.
+
+2007-11-07 Nathan Froyd <froydnj@codesourcery.com>
+
+ * Make-lang.in (lto/lto.o): Depend on gt-lto-lto.h.
+ * config-lang.in (gtfiles): Add lto.h and lto.c.
+ * lto-elf.c: Include ggc.h.
+ (lto_elf_file_open): Allocate elf_file from GC memory.
+ * lto.c: Include tree-ssa-operands.h and gt-lto-lto.h
+ (lto_info_fd_init): Allocate the die_cache and unmaterialized_fndecls
+ in GC memory.
+ (lto_info_fd_close): Free unmaterialized_fndecls from GC memory.
+ (lto_file_close): Free file from GC memory.
+ (lto_cache_store_DIE): Allocate the new entry in GC memory.
+ (lto_read_member_DIE): Fix declaration.
+ (lto_read_subroutine_type_subprogram_DIE): unmaterialized_fndecls lives
+ in GC memory.
+ (current_lto_file): New variable.
+ (lto_main): Use it.
+ (DWARF2_attr, DWARF2_abbrev, lto_die_ptr, DWARF2_CompUnit,
+ lto_die_cache_entry): Move to...
+ * lto.h: ...here and add GTY markers as appropriate. Delete forward
+ declarations accordingly.
+ (struct lto_file_struct): Declare.
+ (lto_file_vtable): Use it instead of lto_file.
+
+2007-11-06 Alon Dayan <alond@il.ibm.com>
+ Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (process_flags, lto_static_init_local):
+ read flags of VAR_DECL and FUNCTION_DECL of size>1.
+ change global array num_flags_for_code to flags_length_for_code.
+ (set_line_info): Make decls work in USE_MAPPED_LOCATION mode.
+
+2007-11-05 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_read_structure_union_class_type_DIE): Use proper record
+ layout functions to compute information about the newly constructed
+ type.
+
+2007-11-02 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto-read.c (input_expr_operand): Change the LTO_return_expr1
+ case to use DECL_RESULT if necessary.
+
+2007-11-01 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (input_tree_list): Removed.
+ (input_tree_flags): Added parameter to force flags no matter what
+ tree code.
+ (input_expr_operand): Added parameter to input_tree_flags.
+ Added case for IDENTIFIER_NODE and TREE_LIST. Changed ASM to call
+ input_expr_operand rather than input_tree_lists.
+ (input_local_var): Use input_expr_operand to read attributes
+ rather then input_tree_list.
+ (input_phi, input_ssa_names): Added parameter to input_tree_flags.
+
+2007-10-31 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_read_typedef_DIE): Fix comment typo.
+ (lto_resolve_typedecl_ref): Fetch the referred-to type and build a fake
+ TYPE_DECL for it.
+ * lto-read.c (lto_read_body): Use correct sizes for calculating
+ type_decls_offset and types_offset.
+
+2007-10-30 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto-tree.h (union lang_tree_node): Change GTY description to chain
+ with GENERIC_NEXT.
+ * config-lang.in (gtfiles): Add lto-lang.c.
+ * lto-lang.c: Include gt-lto-lto-lang.h.
+ * Make-lang.in (lto/lto-lang.o): Add dependency on gt-lto-lto-lang.h
+ (lto/lto-symtab.o): Depend on LTO_H instead of TREE_H.
+ (lto/lto-read.o): Likewise.
+
+2007-10-29 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (data_in): Added type_decls and current_col fields.
+ (string_slot): New type to hold canonized file name.
+ (hash_string_slot_node, eq_string_slot_node, canon_file_name,
+ input_line_info, set_line_info, clear_line_info): New functions.
+ (file_name_hash_table): New hash table.
+ (input_local_var, input_labels, input_local_vars_index,
+ input_local_var, input_local_vars, input_ssa_names): Reorganized parameters.
+ (input_uleb128): Changed type of byte var.
+ (input_expr_operand): Large number of changes to get line numbers
+ correct. Added TYPE_DECL case.
+ (input_globals): Added code to get TYPE_DECLs processed.
+ (input_local_var): Added code to process line numbers and
+ TREE_CHAIN and DECL_CONTEXT.
+ (input_function, input_constructor): Added call to
+ clear_line_number.
+ (lto_static_init_local): Added code to get line numbers correct.
+ (lto_read_body): Added code to get TYPE_DECLS read and to change
+ parameters to the calls above that had their parms reorganized.
+
+
+2007-10-29 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.h (lto_resolve_typedecl_ref): Declare.
+ * lto.c (lto_resolve_typedecl_ref): New function.
+
+2007-10-29 Mark Mitchell <mark@codesourcery.com>
+ Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_read_subroutine_type_subprogram_DIE): Read the child
+ DIEs even if we find an abstract origin for this DIE.
+
+2007-10-29 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_read_subroutine_type_subprogram_DIE): Build the
+ RESULT_DECL slightly earlier. Only remember the decl for later
+ if we successfully merge declarations.
+
+2007-10-24 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (input_expr_operand): Give label_values the proper
+ context and provide switch statements with a default type.
+
+2007-10-23 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto-read.c (lto_read_body): Move call to init_ssa_operands...
+ * lto.c (lto_materialize_function): ...to here.
+
+2007-10-22 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.h (struct lto_info_fd): Add field unmaterialized_fndecls.
+ * lto.c (lto_info_fd_init): Initialize it.
+ (lto_info_fd_close): Free it.
+ (lto_materialize_function): New function.
+ (lto_read_subroutine_type_subprogram_DIE): Save the result decl on
+ unmaterialized_fndecls.
+ (lto_file_read): Read in all the function bodies after we have read
+ all of the DWARF info.
+ * lto-read.c (lto_read_body): Call init_ssa_operands if we are
+ reading a function body.
+
+2007-10-20 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (input_tree_flags): Renamed from input_flags to be
+ semetric with output_tree_flags. Added call to log flags.
+ (process_tree_flags): Renamed from process_flags. Fixed a lot of
+ type issues to make everything consistent with flags being
+ unsigned HOST_WIDE_INTS.
+ (input_expr_operand): Added call to
+ recompute_tree_invariant_for_addr_expr.
+ (input_local_var): Added debugging for tree_chains. Now calls
+ input_tree_flags.
+ (input_phi): Made flags unsigned HOST_WIDE_INT.
+ (input_ssa_names): Now calls input_tree_flags.
+ (lto_read_body): Now sets cfun.
+ (lto_read_function_body): Now sets current_function_pointer.
+
+2007-10-19 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_read_variable_formal_parameter_constant_DIE): Check
+ definitively whether SPECIFICATION or ABSTRACT_ORIGIN exist before
+ inspecting fields within.
+ (lto_read_DIE_at_ptr): Delete check for null result; let callers
+ handle this appropriately.
+
+2007-10-19 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_read_variable_formal_parameter_constant_DIE): Handle
+ DW_AT_abstract_origin properly. Ensure that we're not dealing with
+ both DW_AT_abstract_origin and DW_AT_specification.
+ (lto_read_subroutine_type_subprogram_DIE): Handle
+ DW_AT_abstract_origin.
+ (lto_read_DIE): Use lto_read_only_for_child_DIEs for labels.
+ (lto_read_DIE_at_ptr): Define as static to match declaration.
+ Lookup the PTR in the cache before reading it from the file.
+ (lto_resolve_var_ref): Adjust accordingly.
+ (lto_resolve_fn_ref): Adjust accordingly. Tweak comment.
+ (lto_resolve_field_ref): Adjust accordingly. Tweak comment.
+
+2007-10-19 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_read_DIE_at_ptr): New function.
+ (lto_resolve_var_ref): Use it.
+ (lto_resolve_fn_ref): Use it.
+ (lto_resolve_field_ref): Use it.
+ (lto_read_variable_formal_parameter_constant_DIE): Follow
+ DW_AT_specification and return the associated decl when appropriate.
+
+2007-10-18 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto-lang.c (lto_type_for_mode): Move after lto_type_for_size.
+ Implement for scalar integer modes.
+ (lto_init): Initialize size_type_node.
+
+2007-10-18 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (input_expr_operand): Remove ssa name asserts.
+ (input_local_var): Add chaining for params.
+ (input_ssa_names): Add cfun parameter.
+ (input_function): Remove unnecessary else.
+
+2007-10-17 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_read_only_for_child_DIEs): Mark die parameter as unused.
+ (lto_resolve_var_ref): Use proper types.
+ (lto_resolve_fn_ref): Likewise.
+ (lto_resolve_field_ref): Likewise.
+
+2007-10-17 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto-read.c (input_expr_operand): Remove case.
+
+2007-10-17 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_read_only_for_child_DIEs): New function.
+ (lto_read_DIE): Use it for lexical_block and inlined_subroutine DIEs.
+ * lto-elf.c (lto_elf_map_lto_section): Remove.
+ (lto_elf_file_vtable): Use lto_elf_map_optional_lto_section instead.
+ * lto-read.c (input_expr_operand): Assert that we never read a NULL
+ SSA_NAME. Add missing case for mechanical codes.
+ (input_cfg): Use basic_block_info_for_function instead of
+ basic_block_info.
+
+2007-10-16 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (input_sleb128, input_integer): Use proper casts.
+ (input_list): Renamed input_tree_list and modified to follow same
+ protocol as lto-function-out.c:output_tree_list.
+ (input_expr_operand): Make asm operands use input_tree_list.
+ (input_local_var): Now uses input_tree_list.
+ (lto_read_body): Change placement for setting context of debug_labels.
+
+
+2007-10-16 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (input_real): Output debugging in proper order.
+ (input_integer): Compute bit lengths properly.
+ (input_list): Clean up declaration.
+ (input_expr_operand): Change calls to input_real to match fix.
+ Make reading of LTO_bit_field_ref1 match output.
+ (input_local_var): Make reading of attributes match what is being
+ written.
+ (dump_debug_stream): Also print char in hex.
+ (debug_out_fun): Fix signed unsigned mismatch.
+
+2007-10-10 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c (lto_read_form): Handle DW_AT_MIPS_linkage_name and
+ DW_AT_GNU_vector specially, as they are not contiguous with the
+ specified set of attribute names. Use class_mask to check for
+ errors at the end of the function
+ (lto_resolve_var_ref): Read the DIE if it is not cached.
+ (lto_resolve_fn_ref): Likewise.
+ (lto_resolve_field_ref): Likewise.
+
+2007-10-05 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c: Include dwarf2out.h.
+ (lto_cache_store_DIE): Assert that we never change the value.
+ (LTO_BEGIN_READ_ATTRS): Print an informative error message.
+ (lto_read_compile_unit_DIE): Handle DW_AT_entry_pc.
+ (lto_read_array_type_DIE): Don't error on ndims == 0; build a
+ sensible type instead.
+ (lto_read_structure_union_class_type_DIE): Store the newly
+ created type prior to reading the members of the structure to
+ avoid infinite recursion. Avoid computing types and alignments
+ for structures whose sizes are unknown.
+ (lto_read_variable_formal_parameter_const): Handle DW_AT_artificial
+ and set DECL_ARTIFICIAL accordingly. Ignore DW_AT_abstract_origin,
+ DW_AT_const_value, and DW_AT_specification.
+ (lto_read_subroutine_type_subprogram_DIE): Handle DW_AT_declaration.
+ Return early if we have already constructed the function type.
+ (lto_read_typedef_DIE): Check to see if the type has been cached
+ already. Cache the type before reading any children.
+ (lto_read_const_volatile_restrict_type_DIE): Handle DW_AT_name.
+ (lto_read_DIE): Unset context->skip_non_parameters around reading
+ the DIE.
+ (lto_resolve_fn_ref): Delete trailing whitespace.
+
+2007-09-11 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (input_expr_operand): Added type for STRING_CST.
+
+2007-09-10 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto-read.c (lto_read): Set the type of the newly created CALL_EXPR.
+
+2007-09-07 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto-lang.c (signed_and_unsigned_types): New variable.
+ (lto_type_for_size): Consult signed_and_unsigned_types to find
+ an approprite type, creating it if necessary.
+ (lto_set_decl_assembler_name): Add actual method body.
+
+2007-09-06 Jim Blandy <jimb@codesourcery.com>
+
+ * lto.c (lto_read_variable_formal_parameter_constant_DIE): If we
+ can't find a var init for this variable, leave its DECL_INITIAL.
+ * lto-elf.c (lto_elf_map_optional_lto_section): Renamed from
+ lto_elf_map_fn_body.
+ (lto_map_lto_section): New function.
+ (lto_elf_file_vtable): Use lto_elf_map_lto_section for function
+ bodies, and lto_elf_map_optional_lto_section for variable
+ initializers.
+ (lto_elf_find_section_data): Quietly return NULL if the section is
+ missing.
+ (lto_elf_file_open): Check for a NULL from lto_elf_find_section_data.
+
+ * lto-elf.c (lto_elf_find_section_data): Remove dead code.
+
+ * lto-read.c (lto_read_body): Doc fix.
+
+2007-08-29 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (fun_in): Renamed to data_in.
+ (input_expr_operand, input_local_var, input_string_internal,
+ input_string, input_real, input_list, get_label_decl,
+ get_type_ref, input_expr_operand, input_globals, input_labels,
+ input_local_vars_index, input_local_var, input_local_vars,
+ input_cfg, input_phi, input_ssa_names, input_bb, ): Renamed fun_in to data_in.
+ (input_constructor): New function.
+ (lto_read_function_body): Renamed to lto_read_body and generalized
+ to handle both functions and constructors.
+ (lto_read_function_body, lto_read_var_init): New function.
+
+
+2007-08-28 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (input_expr_operand): Assert that there really is a
+ FUNCTION_DECL.
+ (input_globals): Removed checks on 0 section.
+
+2007-08-28 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (fun_in): Added local_decls_index and
+ local_decls_index_d.
+ (input_expr_operand): Changed inputting of PARM_DECLs and VAR_DECLs.
+ (input_globals): Enabled code to handle FIELD_DECLs.
+ (input_local_vars_index, input_local_vars): New function.
+ (input_local_var): Changed to allow locals to be input randomly.
+ (lto_read_function_body): Added code to input the
+ local_decls_index and to free various structures.
+
+2007-08-17 Jim Blandy <jimb@codesourcery.com>
+
+ * lto.c (lto_read_variable_formal_parameter_constant_DIE): Remove
+ ATTRIBUTE_UNUSED from 'die' formal.
+
+ Use enum LTO_tags where appropriate, instead of 'unsigned int'.
+ * lto-read.c (input_record_start): Fix return type, type of 'tag'.
+ (input_list): Fix type of 'tag'.
+ (input_expr_operand): Fix type of 'tag' argument. Update
+ declaration. Fix type of 'ctag'. Add default case to switch,
+ since the type of the switched value is now an enum.
+ (input_local_vars): Fix type of 'tag'.
+ (input_bb): Fix type of 'tag' argument.
+ (input_function): Fix type of 'tag' argument.
+
+2007-08-16 Jim Blandy <jimb@codesourcery.com>
+
+ * lto.c (lto_read_member_DIE): Record the tree we create in
+ fd->die_cache. (Our 'die' argument is no longer unused.)
+ (lto_resolve_field_ref): New function.
+ * lto.h (lto_resolve_field_ref): New declaration.
+
+2007-08-15 Jim Blandy <jimb@codesourcery.com>
+
+ * lto-read.c (lto_read_var_init): Mark arguments as unused.
+
+2007-08-07 Jim Blandy <jimb@codesourcery.com>
+
+ * lto.c (lto_read_form): Complete attr_classes table.
+ (DWARF2_form_data): Doc fix.
+
+2007-08-05 Mark Mitchell <mark@codesourcery.com>
+
+ * lto.h (lto_file_vtable): Remove read_var_init. Add map_var_init
+ and unmap_var_init.
+ (lto_read_var_init): Declare.
+ * lto.c (lto_read_variable_formal_parameter_constant_DIE): Use new
+ interface for reading variable initializers.
+ * lto-elf.c (lto_elf_read_var_init): Remove.
+ (lto_elf_file_vtable): Update initializer.
+ (lto_elf_read_var_init): Add comment about unused-ness.
+ * lto-read.c (lto_read_var_init): New.
+
+ * lto.c (lto_read_form): Add entry for DW_AT_inline.
+
+2007-08-02 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (lto_read_function_body): Moved declaration of fn
+ outside of ifdef.
+
+2007-08-01 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (input_uleb128, input_string_internal, input_real,
+ input_integer, input_record_start, input_list, get_type_ref,
+ input_flags, input_expr_operand, input_expr_operand,
+ input_expr_operand, input_local_vars, input_cfg, input_phi,
+ input_ssa_names, input_bb, input_function): Added semicolons.
+
+
+2007-07-31 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (input_globals): Remove debugging.
+ (input_function): Set DECL_ARGUMENTS.
+
+
+2007-07-31 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (input_expr_operand): Fixed code for COND_EXEC,
+ RETURN_EXPR, MODIFY_EXPR and processing of flags.
+ (input_phi): Made work with operands other than SSA_NAMES and
+ fixed processing of flags.
+ (input_ssa_names): Initialize SSA_NAME_DEF_STMT to empty stmt.
+ (input_flags): New function.
+ * lto-lang.c (lto_init): Changed state of in_lto_p.
+
+
+2007-07-24 Mark Mitchell <mark@codesourcery.com>
+
+ * lto-tree.h (lto_varargs_cookie): Remove.
+ * lto.c (lto_context): Add last_parm_type, varargs_p, skip_all,
+ skip_non_parameters, skip_parameters.
+ (lto_varargs_cookie): Remove.
+ (lto_read_variable_formal_parameter_constant_DIE): Keep track of
+ parameter types.
+ (lto_read_abbrev): New function.
+ (lto_read_subroutine_type_subprogram_DIE): Make two passes over
+ child DIEs.
+ (lto_read_unspecified_parameters_DIE): Set context->varargs_p.
+ (lto_read_DIE): Use lto_read_abbrev. Honor skip_* flags.
+ (lto_file_read): Initialize new context fields.
+ * lto-lang.c (lto_type_for_mode): Return NULL_TREE.
+ (lto_unsigned_type): Remove.
+ (lto_signed_type): Likewise.
+ (lto_signed_or_unsigned_type): Likewise.
+ (lto_init): Do not create lto_varargs_cookie.
+ (LANG_HOOKS_UNSIGNED_TYPE): Do not define.
+ (LANG_HOOKS_SIGNED_TYPE): Likewise.
+ (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Likewise.
+
+2007-07-19 Jan Hubicka <jh@suse.cz>
+
+ * lto-read.c (lto_read_function_body): Produce empty scope block
+ to avoid crash.
+
+2007-07-18 Mark Mitchell <mark@codesourcery.com>
+
+ * lto.c (lto_read_variable_formal_parameter_constant_DIE): Do not
+ process local variables.
+ (lto_read_subroutine_type_subprogram_DIE): Read child DIEs.
+
+2007-07-13 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (input_list, input_expr_operand): Added struct
+ function parameter.
+ (init_cfg, finalize_cfg): Removed function.
+ (input_expr_operand): Added SSA_NAME and GIMPLE_MODIFY_STMT cases.
+ (input_labels, input_local_vars): Now takes input_block parameter rather than
+ synthsyzing it.
+ (input_cfg, input_phi, input_ssa_names): New functions.
+ (input_bb): Now passes in input_blocks. Does not construct cfg
+ and processes the list of phi functions.
+ (input_function): Now builds both the cfg and ssa_names table.
+ (lto_read_function_body): Processes new header fields to construct
+ streams for the ssa_names and cfg and their debugging.
+ * lto/lto-lang.c (lto_init): Set in_lto_p.
+
+
+2007-06-28 Mark Mitchell <mark@codesourcery.com>
+
+ * lto.h (lto_file_vtable): Add read_var_init.
+ * lto.c (lto_read_variable_formal_parameter_constant_DIE): Read
+ initializers.
+ (lto_main): Remove bogus asserts.
+ * lto-elf.c (tm.h): Include it.
+ (libiberty.y): Likewise.
+ (lto_elf_file): Add strtab and symtab. Rename
+ string_table_section_index to sec_strtab.
+ (lto_elf_file_vtable): Add lto_elf_read_var_init.
+ (lto_elf_get_shdr): New function.
+ (lto_elf_free_shdr): Likewise.
+ (lto_elf_find_section_data): Use them.
+ (lto_elf_read_symtab): New function.
+ (lto_elf_lookup_sym): Likewise.
+ (lto_elf_free_sym): Likewise.
+ (lto_elf_file_open): Tidy. Call lto_elf_read_symtab.
+ (lto_elf_built_init): New function.
+ (lto_elf_read_var_init): Likewise.
+ * Make-lang.in (lto/lto-elf.o): Depend on $(TM_H).
+
+2007-06-26 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read (make_new_block): Initialize the stmt_list.
+ (lto_static_init_local): Add debugging for missing codes.
+
+2007-06-26 Mark Mitchell <mark@codesourcery.com>
+
+ * lto.c (lto_read_subroutine_type_subprogram_DIE): Handle
+ unprototyped functions.
+
+2007-06-23 Mark Mitchell <mark@codesourcery.com>
+
+ * lto.c (lto_read_variable_formal_parameter_constant_DIE):
+ Handle DW_AT_MIPS_linkage_name.
+ (lto_read_subroutine_type_subprogram): Likewise. Correct
+ compilation errors.
+ (lto_main): Remove incorrect assertions.
+ * lto-symbtab.c: Build function types out of TREE_LISTs.
+
+ * lto-elf.c (<libelf>): Check for HAVE_LIBELF_H.
+
+ * Make-lang.in (LTO_OBJS): Depend on attribs.o.
+
+2007-06-21 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto/lto-tree.h (lang_decl, lang_type, language_function): Added
+ dummy since ggc does not like empty structs.
+ * lto/lto-elf.c (libelf.h): Changed to libelf/libelf.h.
+ * lto/lto-read.c (ADD_CLASS_FLAG, ADD_EXPR_FLAG): Changed
+ expr->common to expr->base.
+ (make_new_block): Moved stmt_list to proper place.
+
+
+2007-03-14 Robert Kennedy <jimbob@google.com>
+
+ Eliminate use of lang_hooks.set_decl_assembler_name from LTO
+ * lto.c (lto_read_subroutine_type_subprogram_DIE) Get DECL
+ assembler name from DWARF.
+ * lto-lang.c (lto_set_decl_assembler_name) New function.
+
+2006-09-10 Mark Mitchell <mark@codesourcery.com>
+
+ * lto.h (lto_file_vtable): New structure.
+ (lto_file): Add vtable pointer.
+ (lto_file_init): Add vtable paramter.
+ (lto_read_function_body): New function.
+ (lto_symtab_merge_fn): New function.
+ * lto.c (lto_file_init): Add vtable parameter.
+ (lto_read_form): Fill in entries for DW_AT_prototyped,
+ DW_AT_frame_base.
+ (lto_read_subroutine_type_subprogram_DIE): New function.
+ (lto_read_DIE): Fill in entries for DW_TAG_subroutine_type and
+ DW_TAG_subprogram.
+ * lto-elf.c (lto_elf_vile_vtable): New variable.
+ (lto_elf_file_open): Pass it to lto_file_init.
+ (lto_elf_map_fn_body): New function.
+ (lto_elf_unmap_fn_body): Likewise.
+ * lto-read.c: New file.
+ * lto-symtab.c (lto_symtab_merge_fn): New function.
+ * lto-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Define to
+ tree_rest_of_compilation.
+ * Make-lang.in (LTO_OBJS): Add lto-read.o
+ (lto-read.o): New target.
+
+2006-09-03 Mark Mitchell <mark@codesourcery.com>
+
+ * lto.c (<inttypes.h>): Don't include it.
+ (lto_context): Don't typedef it.
+ (lto_resolve_reference): New function.
+ (lto_read_form): Use it.
+ (lto_resolve_type_ref): New function.
+ (lto_resolve_var_ref): Likewise.
+ (lto_resolve_fn_ref): Likewise.
+ * lto.h (<inttypes.h>): Include it.
+ (lto_context): New type.
+ (lto_ref): New structure.
+ (lto_resolve_type_ref): Declare.
+ (lto_resolve_var_ref): Likewise.
+ (lto_resolve_fn_ref): Likewise.
+
+2006-08-18 Mark Mitchell <mark@codesourcery.com>
+
+ * lang-specs.h: New file.
+
+2006-08-14 Mark Mitchell <mark@codesourcery.com>
+
+ * lto.c (lto_info_fd_init): Allocate the DIE cache.
+ (lto_info_fd_close): Deallocate it.
+ (lto_die_cache_entry): New structure.
+ (lto_cache_hash): New function.
+ (lto_cache_eq): Likewise.
+ (lto_cache_store_DIE): Likewise.
+ (lto_cache_lookup_DIE): Likewise.
+ (lto_read_referenced_type_DIE): Use the cache.
+ (lto_read_pointer_type_DIE): Robustify.
+ (lto_read_DIE): Use the cache.
+ * lto.h (hashtab.h): Include.
+ (lto_info_fd): Add DIE cache.
+ * Make-lang.in (LTO_H): New variable.
+ (lto/lto-lang.o): Use LTO_H.
+ (lto/lto-elf.o): Likewise.
+ (lto/lto-symtab.o): Likewise.
+
+2006-07-09 Mark Mitchell <mark@codesourcery.com>
+
+ * lto.c (lto_abi_mismatch_error): New function.
+ (lto_abbrev_read): Initialize num_abbrevs.
+ (lto_read_form): Specify allowed form classes for
+ DW_AT_declaration. Adjust for change to lto_set_cu_context.
+ (lto_read_variable_formal_parameter_constant_DIE): Handle
+ DW_AT_declaration. Call lto_symtab_merge_var.
+ (lto_read_pointer_type_DIE): New function.
+ (lto_read_base_type_DIE): Use build_nonstandard_integer_type. Do
+ not creat TYPE_DECLs for types that already have them.
+ (lto_read_DIE): Add lto_read_pointer_type_DIE.
+ (lto_set_cu_context): Make cu_start point to the header, not the
+ first DIE.
+ (lto_file_read): Adjust for change to lto_set_cu_context.
+ * Make-lang.in (LTO_OBJS): Add lto-symtab.o.
+ (lto/lto-symtab.o): New rule.
+ * lto-tree.h (lang_identifier): Add decl field.
+ (LANG_IDENTIFIER_CAST): New macro.
+ (LTO_IDENTIFIER_DECL): Likewise.
+ (lto_symtab_merge_var): Declare.
+ * lto-symtab.c: New file.
+
+2006-07-02 Daniel Berlin <dberlin@dberlin.org>
+
+ * lto.c (lto_context): Add current_cu and info_fd members.
+ (DWARF2_CompUnit): New structure.
+ (lto_read_DIE): Take lto_info_fd *.
+ (lto_read_child_DIEs): Ditto.
+ (lto_file_corrupt_error): Constify argument.
+ (lto_set_cu_context): New function
+ (lto_info_fd_init): Ditto.
+ (lto_info_fd_close): Ditto.
+ (lto_file_init): Use lto_info_fd_init.
+ (lto_file_close): Use lto_info_fd_close.
+ (lto_read_initial_length): Pass in pointer to header size.
+ (lto_read_comp_unit_header): Correct cu_length to
+ real length from beginning of header. Take lto_info_fd * as
+ argument.
+ (find_cu_for_offset): New function.
+ (lto_read_form): Change first argument to lto_info_fd *.
+ Add FORM_CONTEXT argument.
+ Handle DW_FORM_ref_addr.
+ (lto_read_tag_DIE): Change first argument to lto_info_fd *.
+ (LTO_BEGIN_READ_ATTRS_UNCHECKED): Save old context.
+ Swap contexts if necessary for form.
+ (LTO_BEGIN_READ_ATTRS): Cast fd to right type for
+ lto_file_corrupt_error.
+ (LTO_END_READ_ATTRS): Swap contexts back if it had changed.
+ (lto_read_referenced_type_DIE): Change first argument to
+ lto_info_fd *. Access lto_fd fields through base pointer.
+ (lto_read_compile_unit_DIE): Change first argument to an
+ lto_info_fd *.
+ (lto_read_variable_formal_parameter_constant_DIE): Ditto.
+ (lto_read_base_type_DIE): Ditto.
+ (lto_read_child_DIEs): Ditto.
+ (lto_read_DIE): Ditto. Change type of function pointer.
+ (lto_info_read): New function.
+ (lto_set_cu_context): Ditto.
+ (lto_file_read): Use lto_info_read, walk resulting CU's
+ (lto_main): Update for lto_info_fd change.
+ * lto-elf.c (lto_elf_file_open): Cast lto_info_fd to lto_fd where
+ necessary.
+ * lto.h (DWARF2_CompUnit): New structure.
+ (lto_info_fd): Ditto.
+ (lto_file): Change debug_info to be an lto_info_fd.
+
+2006-06-25 Mark Mitchell <mark@codesourcery.com>
+
+ * lto.c (toplev.h): Include it.
+ (dwarf2.h): Likewise.
+ (tree.h): Likewise.
+ (tm.h): Likewise.
+ (cgraph.h): Likewise.
+ (ggc.h): Likewise.
+ (inttypes.h): Likewise.
+ (DWARF2_attr): New type.
+ (DWARF2_abbrev): Likewise.
+ (DWARF2_class): Likewise.
+ (DWARF2_form_data): Likewise.
+ (lto_context): Likewise.
+ (lto_fd_init): New function.
+ (lto_abbrev_fd_init): Likewise.
+ (lto_abbrev_fd_close): Likewise.
+ (lto_file_init): Use them.
+ (lto_file_close): New function.
+ (lto_file_corrupt_error): Likewise.
+ (LTO_CHECK_INT_VAL): New macro.
+ (lto_check_size_t_val): New function.
+ (lto_check_int_val): Likewise.
+ (LTO_READ_TYPE): New macro.
+ (lto_read_ubyte): New function.
+ (lto_read_uhalf): Likewise.
+ (lto_read_uword): Likewise.
+ (lto_read_uleb128): Likewise.
+ (lto_read_initial_length): Likewise.
+ (lto_abbrev_read_attrs): Likewise.
+ (lto_abbrev_read): Likewise.
+ (lto_abbrev_lookup): Likewise.
+ (lto_read_section_offset): Likewise.
+ (lto_read_comp_unit_header): Likewise.
+ (lto_read_form): Likewise.
+ (LTO_BEGIN_READ_ATTRS_UNCHECKED): New macro.
+ (LTO_BEGIN_READ_ATTRS): Likewise.
+ (LTO_END_READ_ATTRS): Likewise.
+ (lto_unsupported_attr_error): New function.
+ (lto_get_identifier): Likewise.
+ (lto_read_referenced_type_DIE): Likewise.
+ (lto_read_compile_unit_DIE): Likewise.
+ (lto_read_variable_formal_parameter_constant_DIE): Likewise.
+ (lto_read_base_type_DIE): Likewise.
+ (lto_read_DIE): Likewise.
+ (lto_read_child_DIEs): Likewise.
+ (lto_file_read): Read DIEs.
+ (lto_main): Ask middle end to emit entities.
+ * lto-tree.h (lang_identifier): Inherit from tree_identifier.
+ * lto-elf.c (lto_elf_file_open): Adjust for interface changes.
+ (lto_elf_file_close): Likewise.
+ * lto.h (lto_file): Declare.
+ (DWARF2_abbrev): Likewise.
+ (lto_fd): New type.
+ (lto_abbrev_fd): Likewise.
+ (lto_file): Use new types.
+ (lto_file_close): Declare.
+ * lto-lang.c (lto_init): Always use unit-at-a-time mode.
+
+2006-06-18 Mark Mitchell <mark@codesourcery.com>
+
+ * lto.h: New file.
+ * lto.c: New file.
+ * lto-elf.c: New file.
+ * lto-lang.c (flags.h): Include it.
+ (lto.h): Likewise.
+ (lto_init): New function.
+ (lto_write_globals): Remove.
+ (LANG_HOOKS_WRITE_GLOBALS): Define to lhd_do_nothing.
+ (LANG_HOOKS_INIT): Define.
+ (LANG_HOOKS_PARSE_FILE): Likewise.
+ * Make-lang.in (LTO_OBJS): Add lto.o and lto-elf.o.
+ (LTO_EXE): Link with libelf.
+ (lto/lto-lang.o): Update dependencies.
+ (lto/lto.o): New target.
+ (lto/lto-elf.o): Likewise.
+
+2006-06-12 Mark Mitchell <mark@codesourcery.com>
+
+ * config-lang.in: New file.
+ * Make-lang.in: Likewise.
+ * lto-tree.h: Likewise.
+ * lto-lang.c: Likewise.
+
diff --git a/gcc/lto/Make-lang.in b/gcc/lto/Make-lang.in
new file mode 100644
index 00000000000..1dcaace1ade
--- /dev/null
+++ b/gcc/lto/Make-lang.in
@@ -0,0 +1,89 @@
+# Top level -*- makefile -*- fragment for LTO
+# Copyright (C) 2009
+# 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/>.
+
+# Variables
+
+# The name of the LTO compiler.
+LTO_EXE = lto1$(exeext)
+# The LTO-specific object files inclued in $(LTO_EXE).
+LTO_OBJS = lto/lto-lang.o lto/lto.o lto/lto-elf.o attribs.o
+LTO_H = lto/lto.h $(HASHTAB_H)
+LINKER_PLUGIN_API_H = $(srcdir)/../include/plugin-api.h
+LTO_TREE_H = lto/lto-tree.h $(LINKER_PLUGIN_API_H)
+
+
+# Rules
+
+# These hooks are used by the main GCC Makefile. Consult that
+# Makefile for documentation.
+lto.all.cross: $(LTO_EXE)
+lto.start.encap: $(LTO_EXE)
+lto.rest.encap:
+lto.tags:
+lto.install-common:
+lto.install-man:
+lto.install-info:
+lto.dvi:
+lto.pdf:
+lto.install-pdf:
+lto.html:
+lto.uninstall:
+lto.info:
+lto.man:
+lto.srcextra:
+lto.srcman:
+lto.srcinfo:
+lto.install-plugin:
+
+lto.mostlyclean:
+ rm -f $(LTO_OBJS) $(LTO_EXE)
+
+lto.clean:
+lto.distclean:
+lto.maintainer-clean:
+lto.stage1:
+lto.stage2:
+lto.stage3:
+lto.stage4:
+lto.stageprofile:
+lto.stagefeedback:
+
+# LTO rules.
+
+# Use strict warnings for this front end.
+lto-warn = $(STRICT_WARN)
+
+$(LTO_EXE): $(LTO_OBJS) $(BACKEND) $(LIBDEPS)
+ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
+ $(LTO_OBJS) $(BACKEND) $(BACKENDLIBS) $(LIBS) -lelf
+
+# Dependencies
+lto/lto-lang.o: lto/lto-lang.c $(CONFIG_H) coretypes.h debug.h \
+ flags.h $(GGC_H) langhooks.h $(LANGHOOKS_DEF_H) $(SYSTEM_H) \
+ $(TARGET_H) $(LTO_H) $(GIMPLE_H) gtype-lto.h gt-lto-lto-lang.h \
+ $(EXPR_H)
+lto/lto.o: lto/lto.c $(CONFIG_H) $(SYSTEM_H) coretypes.h opts.h \
+ toplev.h $(TREE_H) $(DIAGNOSTIC_H) $(TM_H) $(LIBIBERTY_H) \
+ $(CGRAPH_H) $(GGC_H) tree-ssa-operands.h $(TREE_PASS_H) \
+ langhooks.h vec.h $(BITMAP_H) pointer-set.h $(IPA_PROP_H) \
+ $(COMMON_H) $(TIMEVAR_H) $(GIMPLE_H) $(LTO_H) $(LTO_TREE_H) \
+ $(LTO_TAGS_H) $(LTO_STREAMER_H)
+lto/lto-elf.o: lto/lto-elf.c $(CONFIG_H) coretypes.h $(SYSTEM_H) \
+ toplev.h $(LTO_H) $(TM_H) $(LIBIBERTY_H) $(GGC_H) $(LTO_STREAMER_H)
diff --git a/gcc/lto/common.c b/gcc/lto/common.c
new file mode 100644
index 00000000000..b54ec491e12
--- /dev/null
+++ b/gcc/lto/common.c
@@ -0,0 +1,46 @@
+/* Common code for the plugin and lto1.
+ Copyright (C) 2009 Free Software Foundation, Inc.
+ Contributed by Rafael Avila de Espindola (espindola@google.com).
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+#include "common.h"
+
+const char *lto_kind_str[5] __attribute__ ((visibility ("hidden"))) =
+{
+ "DEF", "WEAKDEF", "UNDEF",
+ "WEAKUNDEF", "COMMON"
+};
+
+const char *lto_visibility_str[4] __attribute__ ((visibility ("hidden"))) =
+{
+ "DEFAULT", "PROTECTED",
+ "INTERNAL", "HIDDEN"
+};
+
+const char *lto_resolution_str[9] __attribute__ ((visibility ("hidden"))) =
+{
+ "UNKNOWN",
+ "UNDEF",
+ "PREVAILING_DEF",
+ "PREVAILING_DEF_IRONLY",
+ "PREEMPTED_REG",
+ "PREEMPTED_IR",
+ "RESOLVED_IR",
+ "RESOLVED_EXEC",
+ "RESOLVED_DYN"
+};
+
diff --git a/gcc/lto/common.h b/gcc/lto/common.h
new file mode 100644
index 00000000000..e82184795ba
--- /dev/null
+++ b/gcc/lto/common.h
@@ -0,0 +1,34 @@
+/* Common code for the plugin and lto1.
+ Copyright (C) 2008 Free Software Foundation, Inc.
+ Contributed by Rafael Avila de Espindola (espindola@google.com).
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 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/>. */
+
+
+
+static const char *lto_resolution_str[9] =
+{
+ "UNKNOWN",
+ "UNDEF",
+ "PREVAILING_DEF",
+ "PREVAILING_DEF_IRONLY",
+ "PREEMPTED_REG",
+ "PREEMPTED_IR",
+ "RESOLVED_IR",
+ "RESOLVED_EXEC",
+ "RESOLVED_DYN"
+};
diff --git a/gcc/lto/config-lang.in b/gcc/lto/config-lang.in
new file mode 100644
index 00000000000..aa84db1e79f
--- /dev/null
+++ b/gcc/lto/config-lang.in
@@ -0,0 +1,32 @@
+# Top level configure fragment for LTO
+# Copyright (C) 2009
+# 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/>.
+
+language="lto"
+compilers="lto1\$(exeext)"
+stagestuff="lto1\$(exeext)"
+
+gtfiles="\$(srcdir)/lto/lto-tree.h \$(srcdir)/lto/lto-lang.c \$(srcdir)/lto/lto.c"
+
+# LTO is a special front end. From a user's perspective it is not
+# really a language, but a middle end feature. However, the GIMPLE
+# reading module is implemented as a front end, so enabling LTO means
+# enabling this "language". To enable LTO functionality, use
+# --enable-lto when configuring the compiler.
+build_by_default=no
diff --git a/gcc/lto/lang-specs.h b/gcc/lto/lang-specs.h
new file mode 100644
index 00000000000..cbcb19b797c
--- /dev/null
+++ b/gcc/lto/lang-specs.h
@@ -0,0 +1,24 @@
+/* LTO driver specs.
+ Copyright 2009 Free Software Foundation, Inc.
+ Contributed by CodeSourcery, 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/>. */
+
+/* LTO contributions to the "compilers" array in gcc.c. */
+
+ {"@lto", "lto1 %(cc1_options) %i %{!fsyntax-only:%(invoke_as)}",
+ /*cpp_spec=*/NULL, /*combinable=*/1, /*needs_preprocessing=*/0},
diff --git a/gcc/lto/lang.opt b/gcc/lto/lang.opt
new file mode 100644
index 00000000000..f383d7ce18a
--- /dev/null
+++ b/gcc/lto/lang.opt
@@ -0,0 +1,43 @@
+; Options for the LTO front end.
+; Copyright (C) 2008 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/>.
+
+; See the GCC internals manual for a description of this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+Language
+LTO
+
+fltrans
+LTO Report Var(flag_ltrans) Optimization
+Run the link-time optimizer in local transformation (LTRANS) mode.
+
+fltrans-output-list=
+LTO Joined Var(ltrans_output_list)
+Specify a file to which a list of files output by LTRANS is written.
+
+fwpa
+LTO Report Var(flag_wpa) Optimization
+Run the link-time optimizer in whole program analysis (WPA) mode.
+
+resolution
+LTO Separate
+The resolution file
+
+; This comment is to ensure we retain the blank line above.
diff --git a/gcc/lto/lto-elf.c b/gcc/lto/lto-elf.c
new file mode 100644
index 00000000000..ee587f7a750
--- /dev/null
+++ b/gcc/lto/lto-elf.c
@@ -0,0 +1,729 @@
+/* LTO routines for ELF object files.
+ Copyright 2009 Free Software Foundation, Inc.
+ Contributed by CodeSourcery, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "toplev.h"
+#include <gelf.h>
+#include "lto.h"
+#include "tm.h"
+#include "libiberty.h"
+#include "ggc.h"
+#include "lto-streamer.h"
+
+
+/* Initialize FILE, an LTO file object for FILENAME. */
+static void
+lto_file_init (lto_file *file, const char *filename)
+{
+ file->filename = filename;
+}
+
+/* An ELF file. */
+struct lto_elf_file
+{
+ /* The base information. */
+ lto_file base;
+
+ /* The system file descriptor for the file. */
+ int fd;
+
+ /* The libelf descriptor for the file. */
+ Elf *elf;
+
+ /* Section number of string table used for section names. */
+ size_t sec_strtab;
+
+ /* Writable file members. */
+
+ /* The currently active section. */
+ Elf_Scn *scn;
+
+ /* The output stream for section header names. */
+ struct lto_output_stream *shstrtab_stream;
+
+ /* Linked list of data which must be freed *after* the file has been
+ closed. This is an annoying limitation of libelf. */
+ struct lto_char_ptr_base *data;
+};
+typedef struct lto_elf_file lto_elf_file;
+
+/* Stores executable header attributes which must be shared by all ELF files.
+ This is used for validating input files and populating output files. */
+static struct {
+ bool initialized;
+ /* 32 or 64 bits? */
+ size_t bits;
+ unsigned char elf_ident[EI_NIDENT];
+ Elf64_Half elf_machine;
+} cached_file_attrs;
+
+
+/* Return the section header for SECTION. The return value is never
+ NULL. Call lto_elf_free_shdr to release the memory allocated. */
+
+static Elf64_Shdr *
+lto_elf_get_shdr (Elf_Scn *section)
+{
+ Elf64_Shdr *shdr;
+
+ switch (cached_file_attrs.bits)
+ {
+ case 32:
+ {
+ Elf32_Shdr *shdr32;
+
+ /* Read the 32-bit section header. */
+ shdr32 = elf32_getshdr (section);
+ if (!shdr32)
+ fatal_error ("could not read section header: %s", elf_errmsg (0));
+
+ /* Transform it into a 64-bit section header. */
+ shdr = XNEW (Elf64_Shdr);
+ shdr->sh_name = shdr32->sh_name;
+ shdr->sh_type = shdr32->sh_type;
+ shdr->sh_flags = shdr32->sh_flags;
+ shdr->sh_addr = shdr32->sh_addr;
+ shdr->sh_offset = shdr32->sh_offset;
+ shdr->sh_size = shdr32->sh_size;
+ shdr->sh_link = shdr32->sh_link;
+ shdr->sh_info = shdr32->sh_info;
+ shdr->sh_addralign = shdr32->sh_addralign;
+ shdr->sh_entsize = shdr32->sh_entsize;
+ break;
+ }
+ break;
+
+ case 64:
+ shdr = elf64_getshdr (section);
+ if (!shdr)
+ fatal_error ("could not read section header: %s", elf_errmsg (0));
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+
+ return shdr;
+}
+
+/* Free SHDR, previously allocated by lto_elf_get_shdr. */
+static void
+lto_elf_free_shdr (Elf64_Shdr *shdr)
+{
+ if (cached_file_attrs.bits != 64)
+ free (shdr);
+}
+
+
+/* Returns a hash code for P. */
+
+static hashval_t
+hash_name (const void *p)
+{
+ const struct lto_section_slot *ds = (const struct lto_section_slot *) p;
+ return (hashval_t) htab_hash_string (ds->name);
+}
+
+
+/* Returns nonzero if P1 and P2 are equal. */
+
+static int
+eq_name (const void *p1, const void *p2)
+{
+ const struct lto_section_slot *s1 =
+ (const struct lto_section_slot *) p1;
+ const struct lto_section_slot *s2 =
+ (const struct lto_section_slot *) p2;
+
+ return strcmp (s1->name, s2->name) == 0;
+}
+
+
+/* Build a hash table whose key is the section names and whose data is
+ the start and size of each section in the .o file. */
+
+htab_t
+lto_elf_build_section_table (lto_file *lto_file)
+{
+ lto_elf_file *elf_file = (lto_elf_file *)lto_file;
+ htab_t section_hash_table;
+ Elf_Scn *section;
+ size_t base_offset;
+
+ section_hash_table = htab_create (37, hash_name, eq_name, free);
+
+ base_offset = elf_getbase (elf_file->elf);
+ for (section = elf_getscn (elf_file->elf, 0);
+ section;
+ section = elf_nextscn (elf_file->elf, section))
+ {
+ Elf64_Shdr *shdr;
+ const char *name;
+ size_t offset;
+ char *new_name;
+ void **slot;
+ struct lto_section_slot s_slot;
+
+ /* Get the name of this section. */
+ shdr = lto_elf_get_shdr (section);
+ offset = shdr->sh_name;
+ name = elf_strptr (elf_file->elf,
+ elf_file->sec_strtab,
+ offset);
+
+ /* Only put lto stuff into the symtab. */
+ if (strncmp (name, LTO_SECTION_NAME_PREFIX,
+ strlen (LTO_SECTION_NAME_PREFIX)) != 0)
+ {
+ lto_elf_free_shdr (shdr);
+ continue;
+ }
+
+ new_name = XNEWVEC (char, strlen (name) + 1);
+ strcpy (new_name, name);
+ s_slot.name = new_name;
+ slot = htab_find_slot (section_hash_table, &s_slot, INSERT);
+ if (*slot == NULL)
+ {
+ struct lto_section_slot *new_slot = XNEW (struct lto_section_slot);
+
+ new_slot->name = new_name;
+ /* The offset into the file for this section. */
+ new_slot->start = base_offset + shdr->sh_offset;
+ new_slot->len = shdr->sh_size;
+ *slot = new_slot;
+ }
+ else
+ {
+ error ("two or more sections for %s:", new_name);
+ return NULL;
+ }
+
+ lto_elf_free_shdr (shdr);
+ }
+
+ return section_hash_table;
+}
+
+
+/* Initialize the section header of section SCN. SH_NAME is the section name
+ as an index into the section header string table. SH_TYPE is the section
+ type, an SHT_* macro from libelf headers. */
+
+#define DEFINE_INIT_SHDR(BITS) \
+static void \
+init_shdr##BITS (Elf_Scn *scn, size_t sh_name, size_t sh_type) \
+{ \
+ Elf##BITS##_Shdr *shdr; \
+ \
+ shdr = elf##BITS##_getshdr (scn); \
+ if (!shdr) \
+ { \
+ if (BITS == 32) \
+ fatal_error ("elf32_getshdr() failed: %s", elf_errmsg (-1)); \
+ else \
+ fatal_error ("elf64_getshdr() failed: %s", elf_errmsg (-1)); \
+ } \
+ \
+ shdr->sh_name = sh_name; \
+ shdr->sh_type = sh_type; \
+ shdr->sh_addralign = POINTER_SIZE / BITS_PER_UNIT; \
+ shdr->sh_flags = 0; \
+ shdr->sh_entsize = 0; \
+}
+
+DEFINE_INIT_SHDR (32)
+DEFINE_INIT_SHDR (64)
+
+static bool first_data_block;
+
+/* Begin a new ELF section named NAME with type TYPE in the current output
+ file. TYPE is an SHT_* macro from the libelf headers. */
+
+static void
+lto_elf_begin_section_with_type (const char *name, size_t type)
+{
+ lto_elf_file *file;
+ Elf_Scn *scn;
+ size_t sh_name;
+
+ /* Grab the current output file and do some basic assertion checking. */
+ file = (lto_elf_file *) lto_get_current_out_file (),
+ gcc_assert (file);
+ gcc_assert (file->elf);
+ gcc_assert (!file->scn);
+
+ /* Create a new section. */
+ scn = elf_newscn (file->elf);
+ if (!scn)
+ fatal_error ("could not create a new ELF section: %s", elf_errmsg (-1));
+ file->scn = scn;
+
+ /* Add a string table entry and record the offset. */
+ gcc_assert (file->shstrtab_stream);
+ sh_name = file->shstrtab_stream->total_size;
+ lto_output_data_stream (file->shstrtab_stream, name, strlen (name) + 1);
+
+ /* Initialize the section header. */
+ switch (cached_file_attrs.bits)
+ {
+ case 32:
+ init_shdr32 (scn, sh_name, type);
+ break;
+
+ case 64:
+ init_shdr64 (scn, sh_name, type);
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+
+ first_data_block = true;
+}
+
+
+/* Begin a new ELF section named NAME in the current output file. */
+
+void
+lto_elf_begin_section (const char *name)
+{
+ lto_elf_begin_section_with_type (name, SHT_PROGBITS);
+}
+
+
+/* Append DATA of length LEN to the current output section. BASE is a pointer
+ to the output page containing DATA. It is freed once the output file has
+ been written. */
+
+void
+lto_elf_append_data (const void *data, size_t len, void *block)
+{
+ lto_elf_file *file;
+ Elf_Data *elf_data;
+ struct lto_char_ptr_base *base = (struct lto_char_ptr_base *) block;
+
+ /* Grab the current output file and do some basic assertion checking. */
+ file = (lto_elf_file *) lto_get_current_out_file ();
+ gcc_assert (file);
+ gcc_assert (file->scn);
+
+ elf_data = elf_newdata (file->scn);
+ if (!elf_data)
+ fatal_error ("could not append data to ELF section: %s", elf_errmsg (-1));
+
+ if (first_data_block)
+ {
+ elf_data->d_align = POINTER_SIZE / BITS_PER_UNIT;
+ first_data_block = false;
+ }
+ else
+ elf_data->d_align = 1;
+ elf_data->d_buf = CONST_CAST (void *, data);
+ elf_data->d_off = 0LL;
+ elf_data->d_size = len;
+ elf_data->d_type = ELF_T_BYTE;
+ elf_data->d_version = EV_CURRENT;
+
+ base->ptr = (char *)file->data;
+ file->data = base;
+}
+
+
+/* End the current output section. This just does some assertion checking
+ and sets the current output file's scn member to NULL. */
+
+void
+lto_elf_end_section (void)
+{
+ lto_elf_file *file;
+
+ /* Grab the current output file and validate some basic assertions. */
+ file = (lto_elf_file *) lto_get_current_out_file ();
+ gcc_assert (file);
+ gcc_assert (file->scn);
+
+ file->scn = NULL;
+}
+
+
+/* Validate's ELF_FILE's executable header and, if cached_file_attrs is
+ uninitialized, caches the architecture. */
+
+#define DEFINE_VALIDATE_EHDR(BITS) \
+static bool \
+validate_ehdr##BITS (lto_elf_file *elf_file) \
+{ \
+ Elf##BITS##_Ehdr *elf_header; \
+ \
+ elf_header = elf##BITS##_getehdr (elf_file->elf); \
+ if (!elf_header) \
+ { \
+ error ("could not read ELF header: %s", elf_errmsg (0)); \
+ return false; \
+ } \
+ \
+ if (elf_header->e_type != ET_REL) \
+ { \
+ error ("not a relocatable ELF object file"); \
+ return false; \
+ } \
+ \
+ if (!cached_file_attrs.initialized) \
+ cached_file_attrs.elf_machine = elf_header->e_machine; \
+ \
+ if (cached_file_attrs.elf_machine != elf_header->e_machine) \
+ { \
+ error ("inconsistent file architecture detected"); \
+ return false; \
+ } \
+ \
+ return true; \
+}
+
+DEFINE_VALIDATE_EHDR (32)
+DEFINE_VALIDATE_EHDR (64)
+
+
+/* Validate's ELF_FILE's executable header and, if cached_file_attrs is
+ uninitialized, caches the results. Also records the section header string
+ table's section index. Returns true on success or false on failure. */
+
+static bool
+validate_file (lto_elf_file *elf_file)
+{
+ const char *elf_ident;
+
+ /* Some aspects of the libelf API are dependent on whether the
+ object file is a 32-bit or 64-bit file. Determine which kind of
+ file this is now. */
+ elf_ident = elf_getident (elf_file->elf, NULL);
+ if (!elf_ident)
+ {
+ error ("could not read ELF identification information: %s",
+ elf_errmsg (0));
+ return false;
+
+ }
+
+ if (!cached_file_attrs.initialized)
+ {
+ switch (elf_ident[EI_CLASS])
+ {
+ case ELFCLASS32:
+ cached_file_attrs.bits = 32;
+ break;
+
+ case ELFCLASS64:
+ cached_file_attrs.bits = 64;
+ break;
+
+ default:
+ error ("unsupported ELF file class");
+ return false;
+ }
+
+ memcpy (cached_file_attrs.elf_ident, elf_ident,
+ sizeof cached_file_attrs.elf_ident);
+ }
+
+ if (memcmp (elf_ident, cached_file_attrs.elf_ident,
+ sizeof cached_file_attrs.elf_ident))
+ return false;
+
+ /* Check that the input file is a relocatable object file with the correct
+ architecture. */
+ switch (cached_file_attrs.bits)
+ {
+ case 32:
+ if (!validate_ehdr32 (elf_file))
+ return false;
+ break;
+
+ case 64:
+ if (!validate_ehdr64 (elf_file))
+ return false;
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+
+ /* Read the string table used for section header names. */
+ if (elf_getshdrstrndx (elf_file->elf, &elf_file->sec_strtab) == -1)
+ {
+ error ("could not locate ELF string table: %s", elf_errmsg (0));
+ return false;
+ }
+
+ cached_file_attrs.initialized = true;
+ return true;
+}
+
+
+/* Helper functions used by init_ehdr. Initialize ELF_FILE's executable
+ header using cached data from previously read files. */
+
+#define DEFINE_INIT_EHDR(BITS) \
+static void \
+init_ehdr##BITS (lto_elf_file *elf_file) \
+{ \
+ Elf##BITS##_Ehdr *ehdr; \
+ \
+ gcc_assert (cached_file_attrs.bits); \
+ \
+ ehdr = elf##BITS##_newehdr (elf_file->elf); \
+ if (!ehdr) \
+ { \
+ if (BITS == 32) \
+ fatal_error ("elf32_newehdr() failed: %s", elf_errmsg (-1)); \
+ else \
+ fatal_error ("elf64_newehdr() failed: %s", elf_errmsg (-1)); \
+ } \
+ \
+ memcpy (ehdr->e_ident, cached_file_attrs.elf_ident, \
+ sizeof cached_file_attrs.elf_ident); \
+ ehdr->e_type = ET_REL; \
+ ehdr->e_version = EV_CURRENT; \
+ ehdr->e_machine = cached_file_attrs.elf_machine; \
+}
+
+DEFINE_INIT_EHDR (32)
+DEFINE_INIT_EHDR (64)
+
+
+/* Initialize ELF_FILE's executable header using cached data from previously
+ read files. */
+
+static void
+init_ehdr (lto_elf_file *elf_file)
+{
+ switch (cached_file_attrs.bits)
+ {
+ case 32:
+ init_ehdr32 (elf_file);
+ break;
+
+ case 64:
+ init_ehdr64 (elf_file);
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+}
+
+/* Open ELF file FILENAME. If WRITABLE is true, the file is opened for write
+ and, if necessary, created. Otherwise, the file is opened for reading.
+ Returns the opened file. */
+
+lto_file *
+lto_elf_file_open (const char *filename, bool writable)
+{
+ lto_elf_file *elf_file;
+ lto_file *result;
+ off_t offset;
+ const char *offset_p;
+ char *fname;
+
+ offset_p = strchr (filename, '@');
+ if (!offset_p)
+ {
+ fname = xstrdup (filename);
+ offset = 0;
+ }
+ else
+ {
+ int64_t t;
+ fname = (char *) xmalloc (offset_p - filename + 1);
+ memcpy (fname, filename, offset_p - filename);
+ fname[offset_p - filename] = '\0';
+ offset_p++;
+ sscanf(offset_p, "%" PRId64 , &t);
+ offset = t;
+ /* elf_rand expects the offset to point to the ar header, not the
+ object itself. Subtract the size of the ar header (60 bytes).
+ We don't uses sizeof (struct ar_hd) to avoid including ar.h */
+ offset -= 60;
+ }
+
+ /* Set up. */
+ elf_file = XCNEW (lto_elf_file);
+ result = (lto_file *) elf_file;
+ lto_file_init (result, fname);
+ elf_file->fd = -1;
+
+ /* Open the file. */
+ elf_file->fd = open (fname, writable ? O_WRONLY|O_CREAT : O_RDONLY, 0666);
+ if (elf_file->fd == -1)
+ {
+ error ("could not open file %s", fname);
+ goto fail;
+ }
+
+ /* Initialize the ELF library. */
+ if (elf_version (EV_CURRENT) == EV_NONE)
+ {
+ error ("ELF library is older than that used when building GCC");
+ goto fail;
+ }
+
+ /* Open the ELF file descriptor. */
+ elf_file->elf = elf_begin (elf_file->fd, writable ? ELF_C_WRITE : ELF_C_READ,
+ NULL);
+ if (!elf_file->elf)
+ {
+ error ("could not open ELF file: %s", elf_errmsg (0));
+ goto fail;
+ }
+
+ if (offset != 0)
+ {
+ Elf *e;
+ off_t t = elf_rand (elf_file->elf, offset);
+ if (t != offset)
+ {
+ error ("could not seek in archive");
+ goto fail;
+ }
+
+ e = elf_begin (elf_file->fd, ELF_C_READ, elf_file->elf);
+ if (e == NULL)
+ {
+ error("could not find archive member");
+ goto fail;
+ }
+ elf_end (elf_file->elf);
+ elf_file->elf = e;
+ }
+
+ if (writable)
+ {
+ init_ehdr (elf_file);
+ elf_file->shstrtab_stream = XCNEW (struct lto_output_stream);
+ /* Output an empty string to the section header table. This becomes the
+ name of the initial NULL section. */
+ lto_output_1_stream (elf_file->shstrtab_stream, '\0');
+ }
+ else
+ if (!validate_file (elf_file))
+ goto fail;
+
+ return result;
+
+ fail:
+ lto_elf_file_close (result);
+ return NULL;
+}
+
+
+/* Close ELF file FILE and clean up any associated data structures. If FILE
+ was opened for writing, the file's ELF data is written at this time, and
+ any cached data buffers are freed. */
+
+void
+lto_elf_file_close (lto_file *file)
+{
+ lto_elf_file *elf_file = (lto_elf_file *) file;
+ struct lto_char_ptr_base *cur, *tmp;
+
+ /* Write the ELF section header string table. */
+ if (elf_file->shstrtab_stream)
+ {
+ size_t strtab;
+ GElf_Ehdr *ehdr_p, ehdr_buf;
+ lto_file *old_file = lto_set_current_out_file (file);
+
+ lto_elf_begin_section_with_type (".shstrtab", SHT_STRTAB);
+ ehdr_p = gelf_getehdr (elf_file->elf, &ehdr_buf);
+ if (ehdr_p == NULL)
+ fatal_error ("gelf_getehdr() failed: %s", elf_errmsg (-1));
+ strtab = elf_ndxscn (elf_file->scn);
+ if (strtab < SHN_LORESERVE)
+ ehdr_p->e_shstrndx = strtab;
+ else
+ {
+ GElf_Shdr *shdr_p, shdr_buf;
+ Elf_Scn *scn_p = elf_getscn (elf_file->elf, 0);
+ if (scn_p == NULL)
+ fatal_error ("elf_getscn() failed: %s", elf_errmsg (-1));
+ shdr_p = gelf_getshdr (scn_p, &shdr_buf);
+ if (shdr_p == NULL)
+ fatal_error ("gelf_getshdr() failed: %s", elf_errmsg (-1));
+ shdr_p->sh_link = strtab;
+ if (gelf_update_shdr (scn_p, shdr_p) == 0)
+ fatal_error ("gelf_update_shdr() failed: %s", elf_errmsg (-1));
+ ehdr_p->e_shstrndx = SHN_XINDEX;
+ }
+ if (gelf_update_ehdr (elf_file->elf, ehdr_p) == 0)
+ fatal_error ("gelf_update_ehdr() failed: %s", elf_errmsg (-1));
+ lto_write_stream (elf_file->shstrtab_stream);
+ lto_elf_end_section ();
+
+ lto_set_current_out_file (old_file);
+ free (elf_file->shstrtab_stream);
+
+ if (elf_update (elf_file->elf, ELF_C_WRITE) < 0)
+ fatal_error ("elf_update() failed: %s", elf_errmsg (-1));
+ }
+
+ if (elf_file->elf)
+ elf_end (elf_file->elf);
+ if (elf_file->fd != -1)
+ close (elf_file->fd);
+
+ /* Free any ELF data buffers. */
+ cur = elf_file->data;
+ while (cur)
+ {
+ tmp = cur;
+ cur = (struct lto_char_ptr_base *) cur->ptr;
+ free (tmp);
+ }
+
+ free (file);
+}
+
+
+/* The current output file. */
+static lto_file *current_out_file;
+
+
+/* Sets the current output file to FILE. Returns the old output file or
+ NULL. */
+
+lto_file *
+lto_set_current_out_file (lto_file *file)
+{
+ lto_file *old_file = current_out_file;
+ current_out_file = file;
+ return old_file;
+}
+
+
+/* Returns the current output file. */
+
+lto_file *
+lto_get_current_out_file (void)
+{
+ return current_out_file;
+}
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
new file mode 100644
index 00000000000..04d42307656
--- /dev/null
+++ b/gcc/lto/lto-lang.c
@@ -0,0 +1,1188 @@
+/* Language-dependent hooks for LTO.
+ Copyright 2009 Free Software Foundation, Inc.
+ Contributed by CodeSourcery, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "flags.h"
+#include "tm.h"
+#include "tree.h"
+#include "expr.h"
+#include "target.h"
+#include "langhooks.h"
+#include "langhooks-def.h"
+#include "debug.h"
+#include "lto-tree.h"
+#include "lto.h"
+#include "tree-inline.h"
+#include "gimple.h"
+#include "toplev.h"
+
+static tree handle_noreturn_attribute (tree *, tree, tree, int, bool *);
+static tree handle_const_attribute (tree *, tree, tree, int, bool *);
+static tree handle_malloc_attribute (tree *, tree, tree, int, bool *);
+static tree handle_pure_attribute (tree *, tree, tree, int, bool *);
+static tree handle_novops_attribute (tree *, tree, tree, int, bool *);
+static tree handle_nonnull_attribute (tree *, tree, tree, int, bool *);
+static tree handle_nothrow_attribute (tree *, tree, tree, int, bool *);
+static tree handle_sentinel_attribute (tree *, tree, tree, int, bool *);
+static tree handle_type_generic_attribute (tree *, tree, tree, int, bool *);
+static tree handle_format_attribute (tree *, tree, tree, int, bool *);
+static tree handle_format_arg_attribute (tree *, tree, tree, int, bool *);
+
+/* Table of machine-independent attributes supported in GIMPLE. */
+const struct attribute_spec lto_attribute_table[] =
+{
+ /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
+ { "noreturn", 0, 0, true, false, false,
+ handle_noreturn_attribute },
+ /* The same comments as for noreturn attributes apply to const ones. */
+ { "const", 0, 0, true, false, false,
+ handle_const_attribute },
+ { "malloc", 0, 0, true, false, false,
+ handle_malloc_attribute },
+ { "pure", 0, 0, true, false, false,
+ handle_pure_attribute },
+ { "no vops", 0, 0, true, false, false,
+ handle_novops_attribute },
+ { "nonnull", 0, -1, false, true, true,
+ handle_nonnull_attribute },
+ { "nothrow", 0, 0, true, false, false,
+ handle_nothrow_attribute },
+ { "sentinel", 0, 1, false, true, true,
+ handle_sentinel_attribute },
+ { "type generic", 0, 0, false, true, true,
+ handle_type_generic_attribute },
+ { NULL, 0, 0, false, false, false, NULL }
+};
+
+/* Give the specifications for the format attributes, used by C and all
+ descendants. */
+
+const struct attribute_spec lto_format_attribute_table[] =
+{
+ /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
+ { "format", 3, 3, false, true, true,
+ handle_format_attribute },
+ { "format_arg", 1, 1, false, true, true,
+ handle_format_arg_attribute },
+ { NULL, 0, 0, false, false, false, NULL }
+};
+
+enum built_in_attribute
+{
+#define DEF_ATTR_NULL_TREE(ENUM) ENUM,
+#define DEF_ATTR_INT(ENUM, VALUE) ENUM,
+#define DEF_ATTR_IDENT(ENUM, STRING) ENUM,
+#define DEF_ATTR_TREE_LIST(ENUM, PURPOSE, VALUE, CHAIN) ENUM,
+#include "builtin-attrs.def"
+#undef DEF_ATTR_NULL_TREE
+#undef DEF_ATTR_INT
+#undef DEF_ATTR_IDENT
+#undef DEF_ATTR_TREE_LIST
+ ATTR_LAST
+};
+
+static GTY(()) tree built_in_attributes[(int) ATTR_LAST];
+
+/* Builtin types. */
+
+enum lto_builtin_type
+{
+#define DEF_PRIMITIVE_TYPE(NAME, VALUE) NAME,
+#define DEF_FUNCTION_TYPE_0(NAME, RETURN) NAME,
+#define DEF_FUNCTION_TYPE_1(NAME, RETURN, ARG1) NAME,
+#define DEF_FUNCTION_TYPE_2(NAME, RETURN, ARG1, ARG2) NAME,
+#define DEF_FUNCTION_TYPE_3(NAME, RETURN, ARG1, ARG2, ARG3) NAME,
+#define DEF_FUNCTION_TYPE_4(NAME, RETURN, ARG1, ARG2, ARG3, ARG4) NAME,
+#define DEF_FUNCTION_TYPE_5(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) NAME,
+#define DEF_FUNCTION_TYPE_6(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) NAME,
+#define DEF_FUNCTION_TYPE_7(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) NAME,
+#define DEF_FUNCTION_TYPE_VAR_0(NAME, RETURN) NAME,
+#define DEF_FUNCTION_TYPE_VAR_1(NAME, RETURN, ARG1) NAME,
+#define DEF_FUNCTION_TYPE_VAR_2(NAME, RETURN, ARG1, ARG2) NAME,
+#define DEF_FUNCTION_TYPE_VAR_3(NAME, RETURN, ARG1, ARG2, ARG3) NAME,
+#define DEF_FUNCTION_TYPE_VAR_4(NAME, RETURN, ARG1, ARG2, ARG3, ARG4) NAME,
+#define DEF_FUNCTION_TYPE_VAR_5(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG6) \
+ NAME,
+#define DEF_POINTER_TYPE(NAME, TYPE) NAME,
+#include "builtin-types.def"
+#undef DEF_PRIMITIVE_TYPE
+#undef DEF_FUNCTION_TYPE_0
+#undef DEF_FUNCTION_TYPE_1
+#undef DEF_FUNCTION_TYPE_2
+#undef DEF_FUNCTION_TYPE_3
+#undef DEF_FUNCTION_TYPE_4
+#undef DEF_FUNCTION_TYPE_5
+#undef DEF_FUNCTION_TYPE_6
+#undef DEF_FUNCTION_TYPE_7
+#undef DEF_FUNCTION_TYPE_VAR_0
+#undef DEF_FUNCTION_TYPE_VAR_1
+#undef DEF_FUNCTION_TYPE_VAR_2
+#undef DEF_FUNCTION_TYPE_VAR_3
+#undef DEF_FUNCTION_TYPE_VAR_4
+#undef DEF_FUNCTION_TYPE_VAR_5
+#undef DEF_POINTER_TYPE
+ BT_LAST
+};
+
+typedef enum lto_builtin_type builtin_type;
+
+static GTY(()) tree builtin_types[(int) BT_LAST + 1];
+
+static GTY(()) tree string_type_node;
+static GTY(()) tree const_string_type_node;
+static GTY(()) tree wint_type_node;
+static GTY(()) tree intmax_type_node;
+static GTY(()) tree uintmax_type_node;
+static GTY(()) tree signed_size_type_node;
+
+/* Flags needed to process builtins.def. */
+int flag_no_builtin;
+int flag_no_nonansi_builtin;
+int flag_isoc94;
+int flag_isoc99;
+
+/* Attribute handlers. */
+
+/* Handle a "noreturn" attribute; arguments as in
+ struct attribute_spec.handler. */
+
+static tree
+handle_noreturn_attribute (tree *node, tree ARG_UNUSED (name),
+ tree ARG_UNUSED (args), int ARG_UNUSED (flags),
+ bool * ARG_UNUSED (no_add_attrs))
+{
+ tree type = TREE_TYPE (*node);
+
+ if (TREE_CODE (*node) == FUNCTION_DECL)
+ TREE_THIS_VOLATILE (*node) = 1;
+ else if (TREE_CODE (type) == POINTER_TYPE
+ && TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE)
+ TREE_TYPE (*node)
+ = build_pointer_type
+ (build_type_variant (TREE_TYPE (type),
+ TYPE_READONLY (TREE_TYPE (type)), 1));
+ else
+ gcc_unreachable ();
+
+ return NULL_TREE;
+}
+
+
+/* Handle a "const" attribute; arguments as in
+ struct attribute_spec.handler. */
+
+static tree
+handle_const_attribute (tree *node, tree ARG_UNUSED (name),
+ tree ARG_UNUSED (args), int ARG_UNUSED (flags),
+ bool * ARG_UNUSED (no_add_attrs))
+{
+ tree type = TREE_TYPE (*node);
+
+ /* See FIXME comment on noreturn in c_common_attribute_table. */
+ if (TREE_CODE (*node) == FUNCTION_DECL)
+ TREE_READONLY (*node) = 1;
+ else if (TREE_CODE (type) == POINTER_TYPE
+ && TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE)
+ TREE_TYPE (*node)
+ = build_pointer_type
+ (build_type_variant (TREE_TYPE (type), 1,
+ TREE_THIS_VOLATILE (TREE_TYPE (type))));
+ else
+ gcc_unreachable ();
+
+ return NULL_TREE;
+}
+
+
+/* Handle a "malloc" attribute; arguments as in
+ struct attribute_spec.handler. */
+
+static tree
+handle_malloc_attribute (tree *node, tree ARG_UNUSED (name),
+ tree ARG_UNUSED (args), int ARG_UNUSED (flags),
+ bool * ARG_UNUSED (no_add_attrs))
+{
+ if (TREE_CODE (*node) == FUNCTION_DECL
+ && POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (*node))))
+ DECL_IS_MALLOC (*node) = 1;
+ else
+ gcc_unreachable ();
+
+ return NULL_TREE;
+}
+
+
+/* Handle a "pure" attribute; arguments as in
+ struct attribute_spec.handler. */
+
+static tree
+handle_pure_attribute (tree *node, tree ARG_UNUSED (name),
+ tree ARG_UNUSED (args), int ARG_UNUSED (flags),
+ bool * ARG_UNUSED (no_add_attrs))
+{
+ if (TREE_CODE (*node) == FUNCTION_DECL)
+ DECL_PURE_P (*node) = 1;
+ else
+ gcc_unreachable ();
+
+ return NULL_TREE;
+}
+
+
+/* Handle a "no vops" attribute; arguments as in
+ struct attribute_spec.handler. */
+
+static tree
+handle_novops_attribute (tree *node, tree ARG_UNUSED (name),
+ tree ARG_UNUSED (args), int ARG_UNUSED (flags),
+ bool *ARG_UNUSED (no_add_attrs))
+{
+ gcc_assert (TREE_CODE (*node) == FUNCTION_DECL);
+ DECL_IS_NOVOPS (*node) = 1;
+ return NULL_TREE;
+}
+
+
+/* Helper for nonnull attribute handling; fetch the operand number
+ from the attribute argument list. */
+
+static bool
+get_nonnull_operand (tree arg_num_expr, unsigned HOST_WIDE_INT *valp)
+{
+ /* Verify the arg number is a constant. */
+ if (TREE_CODE (arg_num_expr) != INTEGER_CST
+ || TREE_INT_CST_HIGH (arg_num_expr) != 0)
+ return false;
+
+ *valp = TREE_INT_CST_LOW (arg_num_expr);
+ return true;
+}
+
+/* Handle the "nonnull" attribute. */
+
+static tree
+handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name),
+ tree args, int ARG_UNUSED (flags),
+ bool * ARG_UNUSED (no_add_attrs))
+{
+ tree type = *node;
+ unsigned HOST_WIDE_INT attr_arg_num;
+
+ /* If no arguments are specified, all pointer arguments should be
+ non-null. Verify a full prototype is given so that the arguments
+ will have the correct types when we actually check them later. */
+ if (!args)
+ {
+ gcc_assert (TYPE_ARG_TYPES (type));
+ return NULL_TREE;
+ }
+
+ /* Argument list specified. Verify that each argument number references
+ a pointer argument. */
+ for (attr_arg_num = 1; args; args = TREE_CHAIN (args))
+ {
+ tree argument;
+ unsigned HOST_WIDE_INT arg_num = 0, ck_num;
+
+ if (!get_nonnull_operand (TREE_VALUE (args), &arg_num))
+ gcc_unreachable ();
+
+ argument = TYPE_ARG_TYPES (type);
+ if (argument)
+ {
+ for (ck_num = 1; ; ck_num++)
+ {
+ if (!argument || ck_num == arg_num)
+ break;
+ argument = TREE_CHAIN (argument);
+ }
+
+ gcc_assert (argument
+ && TREE_CODE (TREE_VALUE (argument)) == POINTER_TYPE);
+ }
+ }
+
+ return NULL_TREE;
+}
+
+
+/* Handle a "nothrow" attribute; arguments as in
+ struct attribute_spec.handler. */
+
+static tree
+handle_nothrow_attribute (tree *node, tree ARG_UNUSED (name),
+ tree ARG_UNUSED (args), int ARG_UNUSED (flags),
+ bool * ARG_UNUSED (no_add_attrs))
+{
+ if (TREE_CODE (*node) == FUNCTION_DECL)
+ TREE_NOTHROW (*node) = 1;
+ else
+ gcc_unreachable ();
+
+ return NULL_TREE;
+}
+
+
+/* Handle a "sentinel" attribute. */
+
+static tree
+handle_sentinel_attribute (tree *node, tree ARG_UNUSED (name), tree args,
+ int ARG_UNUSED (flags),
+ bool * ARG_UNUSED (no_add_attrs))
+{
+ tree params = TYPE_ARG_TYPES (*node);
+ gcc_assert (params);
+
+ while (TREE_CHAIN (params))
+ params = TREE_CHAIN (params);
+
+ gcc_assert (!VOID_TYPE_P (TREE_VALUE (params)));
+
+ if (args)
+ {
+ tree position = TREE_VALUE (args);
+ gcc_assert (TREE_CODE (position) == INTEGER_CST);
+ if (tree_int_cst_lt (position, integer_zero_node))
+ gcc_unreachable ();
+ }
+
+ return NULL_TREE;
+}
+
+/* Handle a "type_generic" attribute. */
+
+static tree
+handle_type_generic_attribute (tree *node, tree ARG_UNUSED (name),
+ tree ARG_UNUSED (args), int ARG_UNUSED (flags),
+ bool * ARG_UNUSED (no_add_attrs))
+{
+ tree params;
+
+ /* Ensure we have a function type. */
+ gcc_assert (TREE_CODE (*node) == FUNCTION_TYPE);
+
+ params = TYPE_ARG_TYPES (*node);
+ while (params && ! VOID_TYPE_P (TREE_VALUE (params)))
+ params = TREE_CHAIN (params);
+
+ /* Ensure we have a variadic function. */
+ gcc_assert (!params);
+
+ return NULL_TREE;
+}
+
+/* Handle a "format" attribute; arguments as in
+ struct attribute_spec.handler. */
+
+static tree
+handle_format_attribute (tree * ARG_UNUSED (node), tree ARG_UNUSED (name),
+ tree ARG_UNUSED (args), int ARG_UNUSED (flags),
+ bool *no_add_attrs)
+{
+ *no_add_attrs = true;
+ return NULL_TREE;
+}
+
+
+/* Handle a "format_arg" attribute; arguments as in
+ struct attribute_spec.handler. */
+
+tree
+handle_format_arg_attribute (tree * ARG_UNUSED (node), tree ARG_UNUSED (name),
+ tree ARG_UNUSED (args), int ARG_UNUSED (flags),
+ bool *no_add_attrs)
+{
+ *no_add_attrs = true;
+ return NULL_TREE;
+}
+
+
+/* Cribbed from c-common.c. */
+
+static void
+def_fn_type (builtin_type def, builtin_type ret, bool var, int n, ...)
+{
+ tree args = NULL, t;
+ va_list list;
+ int i;
+
+ va_start (list, n);
+ for (i = 0; i < n; ++i)
+ {
+ builtin_type a = (builtin_type) va_arg (list, int);
+ t = builtin_types[a];
+ if (t == error_mark_node)
+ goto egress;
+ args = tree_cons (NULL_TREE, t, args);
+ }
+ va_end (list);
+
+ args = nreverse (args);
+ if (!var)
+ args = chainon (args, void_list_node);
+
+ t = builtin_types[ret];
+ if (t == error_mark_node)
+ goto egress;
+ t = build_function_type (t, args);
+
+ egress:
+ builtin_types[def] = t;
+}
+
+/* Used to help initialize the builtin-types.def table. When a type of
+ the correct size doesn't exist, use error_mark_node instead of NULL.
+ The later results in segfaults even when a decl using the type doesn't
+ get invoked. */
+
+static tree
+builtin_type_for_size (int size, bool unsignedp)
+{
+ tree type = lang_hooks.types.type_for_size (size, unsignedp);
+ return type ? type : error_mark_node;
+}
+
+/* Support for DEF_BUILTIN. */
+
+static void
+def_builtin_1 (enum built_in_function fncode, const char *name,
+ enum built_in_class fnclass, tree fntype, tree libtype,
+ bool both_p, bool fallback_p, bool nonansi_p,
+ tree fnattrs, bool implicit_p)
+{
+ tree decl;
+ const char *libname;
+
+ if (fntype == error_mark_node)
+ return;
+
+ libname = name + strlen ("__builtin_");
+ decl = add_builtin_function (name, fntype, fncode, fnclass,
+ (fallback_p ? libname : NULL),
+ fnattrs);
+
+ if (both_p
+ && !flag_no_builtin
+ && !(nonansi_p && flag_no_nonansi_builtin))
+ add_builtin_function (libname, libtype, fncode, fnclass,
+ NULL, fnattrs);
+
+ built_in_decls[(int) fncode] = decl;
+ if (implicit_p)
+ implicit_built_in_decls[(int) fncode] = decl;
+}
+
+
+/* Initialize the attribute table for all the supported builtins. */
+
+static void
+lto_init_attributes (void)
+{
+ /* Fill in the built_in_attributes array. */
+#define DEF_ATTR_NULL_TREE(ENUM) \
+ built_in_attributes[(int) ENUM] = NULL_TREE;
+#define DEF_ATTR_INT(ENUM, VALUE) \
+ built_in_attributes[(int) ENUM] = build_int_cst (NULL_TREE, VALUE);
+#define DEF_ATTR_IDENT(ENUM, STRING) \
+ built_in_attributes[(int) ENUM] = get_identifier (STRING);
+#define DEF_ATTR_TREE_LIST(ENUM, PURPOSE, VALUE, CHAIN) \
+ built_in_attributes[(int) ENUM] \
+ = tree_cons (built_in_attributes[(int) PURPOSE], \
+ built_in_attributes[(int) VALUE], \
+ built_in_attributes[(int) CHAIN]);
+#include "builtin-attrs.def"
+#undef DEF_ATTR_NULL_TREE
+#undef DEF_ATTR_INT
+#undef DEF_ATTR_IDENT
+#undef DEF_ATTR_TREE_LIST
+}
+
+/* Create builtin types and functions. VA_LIST_REF_TYPE_NODE and
+ VA_LIST_ARG_TYPE_NODE are used in builtin-types.def. */
+
+static void
+lto_define_builtins (tree va_list_ref_type_node ATTRIBUTE_UNUSED,
+ tree va_list_arg_type_node ATTRIBUTE_UNUSED)
+{
+#define DEF_PRIMITIVE_TYPE(ENUM, VALUE) \
+ builtin_types[ENUM] = VALUE;
+#define DEF_FUNCTION_TYPE_0(ENUM, RETURN) \
+ def_fn_type (ENUM, RETURN, 0, 0);
+#define DEF_FUNCTION_TYPE_1(ENUM, RETURN, ARG1) \
+ def_fn_type (ENUM, RETURN, 0, 1, ARG1);
+#define DEF_FUNCTION_TYPE_2(ENUM, RETURN, ARG1, ARG2) \
+ def_fn_type (ENUM, RETURN, 0, 2, ARG1, ARG2);
+#define DEF_FUNCTION_TYPE_3(ENUM, RETURN, ARG1, ARG2, ARG3) \
+ def_fn_type (ENUM, RETURN, 0, 3, ARG1, ARG2, ARG3);
+#define DEF_FUNCTION_TYPE_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \
+ def_fn_type (ENUM, RETURN, 0, 4, ARG1, ARG2, ARG3, ARG4);
+#define DEF_FUNCTION_TYPE_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \
+ def_fn_type (ENUM, RETURN, 0, 5, ARG1, ARG2, ARG3, ARG4, ARG5);
+#define DEF_FUNCTION_TYPE_6(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
+ ARG6) \
+ def_fn_type (ENUM, RETURN, 0, 6, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6);
+#define DEF_FUNCTION_TYPE_7(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
+ ARG6, ARG7) \
+ def_fn_type (ENUM, RETURN, 0, 7, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7);
+#define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN) \
+ def_fn_type (ENUM, RETURN, 1, 0);
+#define DEF_FUNCTION_TYPE_VAR_1(ENUM, RETURN, ARG1) \
+ def_fn_type (ENUM, RETURN, 1, 1, ARG1);
+#define DEF_FUNCTION_TYPE_VAR_2(ENUM, RETURN, ARG1, ARG2) \
+ def_fn_type (ENUM, RETURN, 1, 2, ARG1, ARG2);
+#define DEF_FUNCTION_TYPE_VAR_3(ENUM, RETURN, ARG1, ARG2, ARG3) \
+ def_fn_type (ENUM, RETURN, 1, 3, ARG1, ARG2, ARG3);
+#define DEF_FUNCTION_TYPE_VAR_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \
+ def_fn_type (ENUM, RETURN, 1, 4, ARG1, ARG2, ARG3, ARG4);
+#define DEF_FUNCTION_TYPE_VAR_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \
+ def_fn_type (ENUM, RETURN, 1, 5, ARG1, ARG2, ARG3, ARG4, ARG5);
+#define DEF_POINTER_TYPE(ENUM, TYPE) \
+ builtin_types[(int) ENUM] = build_pointer_type (builtin_types[(int) TYPE]);
+
+#include "builtin-types.def"
+
+#undef DEF_PRIMITIVE_TYPE
+#undef DEF_FUNCTION_TYPE_1
+#undef DEF_FUNCTION_TYPE_2
+#undef DEF_FUNCTION_TYPE_3
+#undef DEF_FUNCTION_TYPE_4
+#undef DEF_FUNCTION_TYPE_5
+#undef DEF_FUNCTION_TYPE_6
+#undef DEF_FUNCTION_TYPE_VAR_0
+#undef DEF_FUNCTION_TYPE_VAR_1
+#undef DEF_FUNCTION_TYPE_VAR_2
+#undef DEF_FUNCTION_TYPE_VAR_3
+#undef DEF_FUNCTION_TYPE_VAR_4
+#undef DEF_FUNCTION_TYPE_VAR_5
+#undef DEF_POINTER_TYPE
+ builtin_types[(int) BT_LAST] = NULL_TREE;
+
+ lto_init_attributes ();
+
+#define DEF_BUILTIN(ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P, FALLBACK_P,\
+ NONANSI_P, ATTRS, IMPLICIT, COND) \
+ if (NAME && COND) \
+ def_builtin_1 (ENUM, NAME, CLASS, builtin_types[(int) TYPE], \
+ builtin_types[(int) LIBTYPE], BOTH_P, FALLBACK_P, \
+ NONANSI_P, built_in_attributes[(int) ATTRS], IMPLICIT);
+#include "builtins.def"
+#undef DEF_BUILTIN
+}
+
+static GTY(()) tree registered_builtin_types;
+
+/* A chain of builtin functions that we need to recognize. We will
+ assume that all other function names we see will be defined by the
+ user's program. */
+static GTY(()) tree registered_builtin_fndecls;
+
+/* Language hooks. */
+
+static unsigned int
+lto_init_options (unsigned int argc ATTRIBUTE_UNUSED,
+ const char **argv ATTRIBUTE_UNUSED)
+{
+ /* Always operate in unit-at-time mode so that we can defer
+ decisions about what to output. */
+ flag_unit_at_a_time = 1;
+
+ return CL_LTO;
+}
+
+/* Handle command-line option SCODE. If the option takes an argument, it is
+ stored in ARG, which is otherwise NULL. VALUE holds either a numerical
+ argument or a binary value indicating whether the positive or negative form
+ of the option was supplied. */
+
+const char *resolution_file_name;
+static int
+lto_handle_option (size_t scode, const char *arg, int value ATTRIBUTE_UNUSED)
+{
+ enum opt_code code = (enum opt_code) scode;
+ int result = 1;
+
+ switch (code)
+ {
+ case OPT_resolution:
+ resolution_file_name = arg;
+ result = 1;
+ break;
+
+ case OPT_Wabi:
+ warn_psabi = value;
+ break;
+
+ default:
+ break;
+ }
+
+ return result;
+}
+
+/* Perform post-option processing. Does additional initialization based on
+ command-line options. PFILENAME is the main input filename. Returns false
+ to enable subsequent back-end initialization. */
+
+static bool
+lto_post_options (const char **pfilename ATTRIBUTE_UNUSED)
+{
+ /* FIXME lto: We have stripped enough type and other
+ debugging information out of the IR that it may
+ appear ill-formed to dwarf2out, etc. We must not
+ attempt to generate debug info in lto1. A more
+ graceful solution would disable the option flags
+ rather than ignoring them, but we'd also have to
+ worry about default debugging options. */
+ write_symbols = NO_DEBUG;
+ debug_info_level = DINFO_LEVEL_NONE;
+
+ /* -fltrans and -fwpa are mutually exclusive. Check for that here. */
+ if (flag_wpa && flag_ltrans)
+ error ("-fwpa and -fltrans are mutually exclusive");
+
+ if (flag_ltrans)
+ {
+ flag_generate_lto = 0;
+
+ /* During LTRANS, we are not looking at the whole program, only
+ a subset of the whole callgraph. */
+ flag_whole_program = 0;
+ }
+
+ if (flag_wpa)
+ flag_generate_lto = 1;
+
+ /* Excess precision other than "fast" requires front-end
+ support. */
+ flag_excess_precision_cmdline = EXCESS_PRECISION_FAST;
+
+ lto_read_all_file_options ();
+
+ /* Initialize the compiler back end. */
+ return false;
+}
+
+/* Return an integer type with PRECISION bits of precision,
+ that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */
+
+static tree
+lto_type_for_size (unsigned precision, int unsignedp)
+{
+ if (precision == TYPE_PRECISION (integer_type_node))
+ return unsignedp ? unsigned_type_node : integer_type_node;
+
+ if (precision == TYPE_PRECISION (signed_char_type_node))
+ return unsignedp ? unsigned_char_type_node : signed_char_type_node;
+
+ if (precision == TYPE_PRECISION (short_integer_type_node))
+ return unsignedp ? short_unsigned_type_node : short_integer_type_node;
+
+ if (precision == TYPE_PRECISION (long_integer_type_node))
+ return unsignedp ? long_unsigned_type_node : long_integer_type_node;
+
+ if (precision == TYPE_PRECISION (long_long_integer_type_node))
+ return unsignedp
+ ? long_long_unsigned_type_node
+ : long_long_integer_type_node;
+
+ if (precision <= TYPE_PRECISION (intQI_type_node))
+ return unsignedp ? unsigned_intQI_type_node : intQI_type_node;
+
+ if (precision <= TYPE_PRECISION (intHI_type_node))
+ return unsignedp ? unsigned_intHI_type_node : intHI_type_node;
+
+ if (precision <= TYPE_PRECISION (intSI_type_node))
+ return unsignedp ? unsigned_intSI_type_node : intSI_type_node;
+
+ if (precision <= TYPE_PRECISION (intDI_type_node))
+ return unsignedp ? unsigned_intDI_type_node : intDI_type_node;
+
+ if (precision <= TYPE_PRECISION (intTI_type_node))
+ return unsignedp ? unsigned_intTI_type_node : intTI_type_node;
+
+ return NULL_TREE;
+}
+
+
+/* Return a data type that has machine mode MODE.
+ If the mode is an integer,
+ then UNSIGNEDP selects between signed and unsigned types.
+ If the mode is a fixed-point mode,
+ then UNSIGNEDP selects between saturating and nonsaturating types. */
+
+static tree
+lto_type_for_mode (enum machine_mode mode, int unsigned_p)
+{
+ tree t;
+
+ if (mode == TYPE_MODE (integer_type_node))
+ return unsigned_p ? unsigned_type_node : integer_type_node;
+
+ if (mode == TYPE_MODE (signed_char_type_node))
+ return unsigned_p ? unsigned_char_type_node : signed_char_type_node;
+
+ if (mode == TYPE_MODE (short_integer_type_node))
+ return unsigned_p ? short_unsigned_type_node : short_integer_type_node;
+
+ if (mode == TYPE_MODE (long_integer_type_node))
+ return unsigned_p ? long_unsigned_type_node : long_integer_type_node;
+
+ if (mode == TYPE_MODE (long_long_integer_type_node))
+ return unsigned_p ? long_long_unsigned_type_node : long_long_integer_type_node;
+
+ if (mode == QImode)
+ return unsigned_p ? unsigned_intQI_type_node : intQI_type_node;
+
+ if (mode == HImode)
+ return unsigned_p ? unsigned_intHI_type_node : intHI_type_node;
+
+ if (mode == SImode)
+ return unsigned_p ? unsigned_intSI_type_node : intSI_type_node;
+
+ if (mode == DImode)
+ return unsigned_p ? unsigned_intDI_type_node : intDI_type_node;
+
+#if HOST_BITS_PER_WIDE_INT >= 64
+ if (mode == TYPE_MODE (intTI_type_node))
+ return unsigned_p ? unsigned_intTI_type_node : intTI_type_node;
+#endif
+
+ if (mode == TYPE_MODE (float_type_node))
+ return float_type_node;
+
+ if (mode == TYPE_MODE (double_type_node))
+ return double_type_node;
+
+ if (mode == TYPE_MODE (long_double_type_node))
+ return long_double_type_node;
+
+ if (mode == TYPE_MODE (void_type_node))
+ return void_type_node;
+
+ if (mode == TYPE_MODE (build_pointer_type (char_type_node)))
+ return (unsigned_p
+ ? make_unsigned_type (GET_MODE_PRECISION (mode))
+ : make_signed_type (GET_MODE_PRECISION (mode)));
+
+ if (mode == TYPE_MODE (build_pointer_type (integer_type_node)))
+ return (unsigned_p
+ ? make_unsigned_type (GET_MODE_PRECISION (mode))
+ : make_signed_type (GET_MODE_PRECISION (mode)));
+
+ if (COMPLEX_MODE_P (mode))
+ {
+ enum machine_mode inner_mode;
+ tree inner_type;
+
+ if (mode == TYPE_MODE (complex_float_type_node))
+ return complex_float_type_node;
+ if (mode == TYPE_MODE (complex_double_type_node))
+ return complex_double_type_node;
+ if (mode == TYPE_MODE (complex_long_double_type_node))
+ return complex_long_double_type_node;
+
+ if (mode == TYPE_MODE (complex_integer_type_node) && !unsigned_p)
+ return complex_integer_type_node;
+
+ inner_mode = GET_MODE_INNER (mode);
+ inner_type = lto_type_for_mode (inner_mode, unsigned_p);
+ if (inner_type != NULL_TREE)
+ return build_complex_type (inner_type);
+ }
+ else if (VECTOR_MODE_P (mode))
+ {
+ enum machine_mode inner_mode = GET_MODE_INNER (mode);
+ tree inner_type = lto_type_for_mode (inner_mode, unsigned_p);
+ if (inner_type != NULL_TREE)
+ return build_vector_type_for_mode (inner_type, mode);
+ }
+
+ if (mode == TYPE_MODE (dfloat32_type_node))
+ return dfloat32_type_node;
+ if (mode == TYPE_MODE (dfloat64_type_node))
+ return dfloat64_type_node;
+ if (mode == TYPE_MODE (dfloat128_type_node))
+ return dfloat128_type_node;
+
+ if (ALL_SCALAR_FIXED_POINT_MODE_P (mode))
+ {
+ if (mode == TYPE_MODE (short_fract_type_node))
+ return unsigned_p ? sat_short_fract_type_node : short_fract_type_node;
+ if (mode == TYPE_MODE (fract_type_node))
+ return unsigned_p ? sat_fract_type_node : fract_type_node;
+ if (mode == TYPE_MODE (long_fract_type_node))
+ return unsigned_p ? sat_long_fract_type_node : long_fract_type_node;
+ if (mode == TYPE_MODE (long_long_fract_type_node))
+ return unsigned_p ? sat_long_long_fract_type_node
+ : long_long_fract_type_node;
+
+ if (mode == TYPE_MODE (unsigned_short_fract_type_node))
+ return unsigned_p ? sat_unsigned_short_fract_type_node
+ : unsigned_short_fract_type_node;
+ if (mode == TYPE_MODE (unsigned_fract_type_node))
+ return unsigned_p ? sat_unsigned_fract_type_node
+ : unsigned_fract_type_node;
+ if (mode == TYPE_MODE (unsigned_long_fract_type_node))
+ return unsigned_p ? sat_unsigned_long_fract_type_node
+ : unsigned_long_fract_type_node;
+ if (mode == TYPE_MODE (unsigned_long_long_fract_type_node))
+ return unsigned_p ? sat_unsigned_long_long_fract_type_node
+ : unsigned_long_long_fract_type_node;
+
+ if (mode == TYPE_MODE (short_accum_type_node))
+ return unsigned_p ? sat_short_accum_type_node : short_accum_type_node;
+ if (mode == TYPE_MODE (accum_type_node))
+ return unsigned_p ? sat_accum_type_node : accum_type_node;
+ if (mode == TYPE_MODE (long_accum_type_node))
+ return unsigned_p ? sat_long_accum_type_node : long_accum_type_node;
+ if (mode == TYPE_MODE (long_long_accum_type_node))
+ return unsigned_p ? sat_long_long_accum_type_node
+ : long_long_accum_type_node;
+
+ if (mode == TYPE_MODE (unsigned_short_accum_type_node))
+ return unsigned_p ? sat_unsigned_short_accum_type_node
+ : unsigned_short_accum_type_node;
+ if (mode == TYPE_MODE (unsigned_accum_type_node))
+ return unsigned_p ? sat_unsigned_accum_type_node
+ : unsigned_accum_type_node;
+ if (mode == TYPE_MODE (unsigned_long_accum_type_node))
+ return unsigned_p ? sat_unsigned_long_accum_type_node
+ : unsigned_long_accum_type_node;
+ if (mode == TYPE_MODE (unsigned_long_long_accum_type_node))
+ return unsigned_p ? sat_unsigned_long_long_accum_type_node
+ : unsigned_long_long_accum_type_node;
+
+ if (mode == QQmode)
+ return unsigned_p ? sat_qq_type_node : qq_type_node;
+ if (mode == HQmode)
+ return unsigned_p ? sat_hq_type_node : hq_type_node;
+ if (mode == SQmode)
+ return unsigned_p ? sat_sq_type_node : sq_type_node;
+ if (mode == DQmode)
+ return unsigned_p ? sat_dq_type_node : dq_type_node;
+ if (mode == TQmode)
+ return unsigned_p ? sat_tq_type_node : tq_type_node;
+
+ if (mode == UQQmode)
+ return unsigned_p ? sat_uqq_type_node : uqq_type_node;
+ if (mode == UHQmode)
+ return unsigned_p ? sat_uhq_type_node : uhq_type_node;
+ if (mode == USQmode)
+ return unsigned_p ? sat_usq_type_node : usq_type_node;
+ if (mode == UDQmode)
+ return unsigned_p ? sat_udq_type_node : udq_type_node;
+ if (mode == UTQmode)
+ return unsigned_p ? sat_utq_type_node : utq_type_node;
+
+ if (mode == HAmode)
+ return unsigned_p ? sat_ha_type_node : ha_type_node;
+ if (mode == SAmode)
+ return unsigned_p ? sat_sa_type_node : sa_type_node;
+ if (mode == DAmode)
+ return unsigned_p ? sat_da_type_node : da_type_node;
+ if (mode == TAmode)
+ return unsigned_p ? sat_ta_type_node : ta_type_node;
+
+ if (mode == UHAmode)
+ return unsigned_p ? sat_uha_type_node : uha_type_node;
+ if (mode == USAmode)
+ return unsigned_p ? sat_usa_type_node : usa_type_node;
+ if (mode == UDAmode)
+ return unsigned_p ? sat_uda_type_node : uda_type_node;
+ if (mode == UTAmode)
+ return unsigned_p ? sat_uta_type_node : uta_type_node;
+ }
+
+ for (t = registered_builtin_types; t; t = TREE_CHAIN (t))
+ if (TYPE_MODE (TREE_VALUE (t)) == mode)
+ return TREE_VALUE (t);
+
+ return NULL_TREE;
+}
+
+static int
+lto_global_bindings_p (void)
+{
+ return cfun == NULL;
+}
+
+static void
+lto_set_decl_assembler_name (tree decl)
+{
+ /* This is almost the same as lhd_set_decl_assembler_name, except that
+ we need to uniquify file-scope names, even if they are not
+ TREE_PUBLIC, to avoid conflicts between individual files. */
+ tree id;
+
+ if (TREE_PUBLIC (decl))
+ id = targetm.mangle_decl_assembler_name (decl, DECL_NAME (decl));
+ else
+ {
+ const char *name = IDENTIFIER_POINTER (DECL_NAME (decl));
+ char *label;
+
+ ASM_FORMAT_PRIVATE_NAME (label, name, DECL_UID (decl));
+ id = get_identifier (label);
+ }
+
+ SET_DECL_ASSEMBLER_NAME (decl, id);
+}
+
+static tree
+lto_pushdecl (tree t ATTRIBUTE_UNUSED)
+{
+ /* Do nothing, since we get all information from DWARF and LTO
+ sections. */
+ return NULL_TREE;
+}
+
+static tree
+lto_getdecls (void)
+{
+ return registered_builtin_fndecls;
+}
+
+static void
+lto_write_globals (void)
+{
+ tree *vec = VEC_address (tree, lto_global_var_decls);
+ int len = VEC_length (tree, lto_global_var_decls);
+ wrapup_global_declarations (vec, len);
+ emit_debug_global_declarations (vec, len);
+ VEC_free (tree, gc, lto_global_var_decls);
+}
+
+static tree
+lto_builtin_function (tree decl)
+{
+ /* Record it. */
+ TREE_CHAIN (decl) = registered_builtin_fndecls;
+ registered_builtin_fndecls = decl;
+
+ return decl;
+}
+
+static void
+lto_register_builtin_type (tree type, const char *name)
+{
+ tree decl;
+
+ decl = build_decl (UNKNOWN_LOCATION, TYPE_DECL, get_identifier (name), type);
+ DECL_ARTIFICIAL (decl) = 1;
+ if (!TYPE_NAME (type))
+ TYPE_NAME (type) = decl;
+
+ registered_builtin_types = tree_cons (0, type, registered_builtin_types);
+}
+
+/* Build nodes that would have be created by the C front-end; necessary
+ for including builtin-types.def and ultimately builtins.def. */
+
+static void
+lto_build_c_type_nodes (void)
+{
+ gcc_assert (void_type_node);
+
+ void_list_node = build_tree_list (NULL_TREE, void_type_node);
+ string_type_node = build_pointer_type (char_type_node);
+ const_string_type_node
+ = build_pointer_type (build_qualified_type (char_type_node, TYPE_QUAL_CONST));
+
+ if (strcmp (SIZE_TYPE, "unsigned int") == 0)
+ {
+ intmax_type_node = integer_type_node;
+ uintmax_type_node = unsigned_type_node;
+ signed_size_type_node = integer_type_node;
+ }
+ else if (strcmp (SIZE_TYPE, "long unsigned int") == 0)
+ {
+ intmax_type_node = long_integer_type_node;
+ uintmax_type_node = long_unsigned_type_node;
+ signed_size_type_node = long_integer_type_node;
+ }
+ else
+ gcc_unreachable ();
+
+ wint_type_node = unsigned_type_node;
+ pid_type_node = integer_type_node;
+}
+
+
+/* Perform LTO-specific initialization. */
+
+static bool
+lto_init (void)
+{
+ /* We need to generate LTO if running in WPA mode. */
+ flag_generate_lto = flag_wpa;
+
+ /* Initialize libcpp line maps for gcc_assert to work. */
+ linemap_add (line_table, LC_RENAME, 0, NULL, 0);
+ linemap_add (line_table, LC_RENAME, 0, NULL, 0);
+
+ /* Create the basic integer types. */
+ build_common_tree_nodes (flag_signed_char, /*signed_sizetype=*/false);
+
+ /* Share char_type_node with whatever would be the default for the target.
+ char_type_node will be used for internal types such as
+ va_list_type_node but will not be present in the lto stream. */
+ char_type_node
+ = DEFAULT_SIGNED_CHAR ? signed_char_type_node : unsigned_char_type_node;
+
+ /* Tell the middle end what type to use for the size of objects. */
+ if (strcmp (SIZE_TYPE, "unsigned int") == 0)
+ {
+ set_sizetype (unsigned_type_node);
+ size_type_node = unsigned_type_node;
+ }
+ else if (strcmp (SIZE_TYPE, "long unsigned int") == 0)
+ {
+ set_sizetype (long_unsigned_type_node);
+ size_type_node = long_unsigned_type_node;
+ }
+ else
+ gcc_unreachable ();
+
+ /* The global tree for the main identifier is filled in by
+ language-specific front-end initialization that is not run in the
+ LTO back-end. It appears that all languages that perform such
+ initialization currently do so in the same way, so we do it here. */
+ if (main_identifier_node == NULL_TREE)
+ main_identifier_node = get_identifier ("main");
+
+ /* In the C++ front-end, fileptr_type_node is defined as a variant
+ copy of of ptr_type_node, rather than ptr_node itself. The
+ distinction should only be relevant to the front-end, so we
+ always use the C definition here in lto1. */
+ gcc_assert (fileptr_type_node == ptr_type_node);
+
+ ptrdiff_type_node = integer_type_node;
+
+ /* Create other basic types. */
+ build_common_tree_nodes_2 (/*short_double=*/false);
+ lto_build_c_type_nodes ();
+ gcc_assert (va_list_type_node);
+
+ if (TREE_CODE (va_list_type_node) == ARRAY_TYPE)
+ {
+ tree x = build_pointer_type (TREE_TYPE (va_list_type_node));
+ lto_define_builtins (x, x);
+ }
+ else
+ {
+ lto_define_builtins (va_list_type_node,
+ build_reference_type (va_list_type_node));
+ }
+
+ targetm.init_builtins ();
+ build_common_builtin_nodes ();
+
+ /* Initialize LTO-specific data structures. */
+ lto_global_var_decls = VEC_alloc (tree, gc, 256);
+ in_lto_p = true;
+
+ return true;
+}
+
+/* Initialize tree structures required by the LTO front end. */
+
+static void lto_init_ts (void)
+{
+ tree_contains_struct[NAMESPACE_DECL][TS_DECL_MINIMAL] = 1;
+}
+
+#undef LANG_HOOKS_NAME
+#define LANG_HOOKS_NAME "GNU GIMPLE"
+#undef LANG_HOOKS_INIT_OPTIONS
+#define LANG_HOOKS_INIT_OPTIONS lto_init_options
+#undef LANG_HOOKS_HANDLE_OPTION
+#define LANG_HOOKS_HANDLE_OPTION lto_handle_option
+#undef LANG_HOOKS_POST_OPTIONS
+#define LANG_HOOKS_POST_OPTIONS lto_post_options
+#undef LANG_HOOKS_GET_ALIAS_SET
+#define LANG_HOOKS_GET_ALIAS_SET gimple_get_alias_set
+#undef LANG_HOOKS_TYPE_FOR_MODE
+#define LANG_HOOKS_TYPE_FOR_MODE lto_type_for_mode
+#undef LANG_HOOKS_TYPE_FOR_SIZE
+#define LANG_HOOKS_TYPE_FOR_SIZE lto_type_for_size
+#undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME
+#define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME lto_set_decl_assembler_name
+#undef LANG_HOOKS_GLOBAL_BINDINGS_P
+#define LANG_HOOKS_GLOBAL_BINDINGS_P lto_global_bindings_p
+#undef LANG_HOOKS_PUSHDECL
+#define LANG_HOOKS_PUSHDECL lto_pushdecl
+#undef LANG_HOOKS_GETDECLS
+#define LANG_HOOKS_GETDECLS lto_getdecls
+#undef LANG_HOOKS_WRITE_GLOBALS
+#define LANG_HOOKS_WRITE_GLOBALS lto_write_globals
+#undef LANG_HOOKS_REGISTER_BUILTIN_TYPE
+#define LANG_HOOKS_REGISTER_BUILTIN_TYPE lto_register_builtin_type
+#undef LANG_HOOKS_BUILTIN_FUNCTION
+#define LANG_HOOKS_BUILTIN_FUNCTION lto_builtin_function
+#undef LANG_HOOKS_INIT
+#define LANG_HOOKS_INIT lto_init
+#undef LANG_HOOKS_PARSE_FILE
+#define LANG_HOOKS_PARSE_FILE lto_main
+#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION
+#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION tree_rest_of_compilation
+#undef LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS
+#define LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS true
+#undef LANG_HOOKS_TYPES_COMPATIBLE_P
+#define LANG_HOOKS_TYPES_COMPATIBLE_P NULL
+
+/* Attribute hooks. */
+#undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE
+#define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE lto_attribute_table
+#undef LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE
+#define LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE lto_format_attribute_table
+
+#undef LANG_HOOKS_BEGIN_SECTION
+#define LANG_HOOKS_BEGIN_SECTION lto_elf_begin_section
+#undef LANG_HOOKS_APPEND_DATA
+#define LANG_HOOKS_APPEND_DATA lto_elf_append_data
+#undef LANG_HOOKS_END_SECTION
+#define LANG_HOOKS_END_SECTION lto_elf_end_section
+
+#undef LANG_HOOKS_INIT_TS
+#define LANG_HOOKS_INIT_TS lto_init_ts
+
+struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
+
+/* Language hooks that are not part of lang_hooks. */
+
+tree
+convert (tree type ATTRIBUTE_UNUSED, tree expr ATTRIBUTE_UNUSED)
+{
+ gcc_unreachable ();
+}
+
+/* Tree walking support. */
+
+static enum lto_tree_node_structure_enum
+lto_tree_node_structure (union lang_tree_node *t ATTRIBUTE_UNUSED)
+{
+ return TS_LTO_GENERIC;
+}
+
+#include "ggc.h"
+#include "gtype-lto.h"
+#include "gt-lto-lto-lang.h"
diff --git a/gcc/lto/lto-tree.h b/gcc/lto/lto-tree.h
new file mode 100644
index 00000000000..671fa4ade26
--- /dev/null
+++ b/gcc/lto/lto-tree.h
@@ -0,0 +1,61 @@
+/* Language-dependent trees for LTO.
+ Copyright 2009 Free Software Foundation, Inc.
+ Contributed by CodeSourcery, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef GCC_LTO_TREE_H
+#define GCC_LTO_TREE_H
+
+#include "plugin-api.h"
+
+struct GTY(()) lang_identifier
+{
+ struct tree_identifier base;
+};
+
+struct GTY(()) lang_decl
+{
+ int dummy; /* Added because ggc does not like empty structs. */
+};
+
+struct GTY(()) lang_type
+{
+ int dummy; /* Added because ggc does not like empty structs. */
+};
+
+struct GTY(()) language_function
+{
+ int dummy; /* Added because ggc does not like empty structs. */
+};
+
+enum lto_tree_node_structure_enum {
+ TS_LTO_GENERIC
+};
+
+union GTY((desc ("lto_tree_node_structure (&%h)"),
+ chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.generic)")))
+ lang_tree_node
+{
+ union tree_node GTY ((tag ("TS_LTO_GENERIC"),
+ desc ("tree_node_structure (&%h)"))) generic;
+};
+
+/* Vector to keep track of external variables we've seen so far. */
+extern GTY(()) VEC(tree,gc) *lto_global_var_decls;
+
+#endif /* GCC_LTO_TREE_H */
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
new file mode 100644
index 00000000000..d8c49cf729f
--- /dev/null
+++ b/gcc/lto/lto.c
@@ -0,0 +1,2021 @@
+/* Top-level LTO routines.
+ Copyright 2009 Free Software Foundation, Inc.
+ Contributed by CodeSourcery, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "opts.h"
+#include "toplev.h"
+#include "tree.h"
+#include "diagnostic.h"
+#include "tm.h"
+#include "libiberty.h"
+#include "cgraph.h"
+#include "ggc.h"
+#include "tree-ssa-operands.h"
+#include "tree-pass.h"
+#include "langhooks.h"
+#include "vec.h"
+#include "bitmap.h"
+#include "pointer-set.h"
+#include "ipa-prop.h"
+#include "common.h"
+#include "timevar.h"
+#include "gimple.h"
+#include "lto.h"
+#include "lto-tree.h"
+#include "lto-streamer.h"
+
+/* This needs to be included after config.h. Otherwise, _GNU_SOURCE will not
+ be defined in time to set __USE_GNU in the system headers, and strsignal
+ will not be declared. */
+#if HAVE_MMAP_FILE
+#include <sys/mman.h>
+#endif
+
+DEF_VEC_P(bitmap);
+DEF_VEC_ALLOC_P(bitmap,heap);
+
+/* Read the constructors and inits. */
+
+static void
+lto_materialize_constructors_and_inits (struct lto_file_decl_data * file_data)
+{
+ size_t len;
+ const char *data = lto_get_section_data (file_data,
+ LTO_section_static_initializer,
+ NULL, &len);
+ lto_input_constructors_and_inits (file_data, data);
+ lto_free_section_data (file_data, LTO_section_static_initializer, NULL,
+ data, len);
+}
+
+/* Read the function body for the function associated with NODE if possible. */
+
+static void
+lto_materialize_function (struct cgraph_node *node)
+{
+ tree decl;
+ struct lto_file_decl_data *file_data;
+ const char *data, *name;
+ size_t len;
+ tree step;
+
+ /* Ignore clone nodes. Read the body only from the original one.
+ We may find clone nodes during LTRANS after WPA has made inlining
+ decisions. */
+ if (node->clone_of)
+ return;
+
+ decl = node->decl;
+ file_data = node->local.lto_file_data;
+ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
+
+ /* We may have renamed the declaration, e.g., a static function. */
+ name = lto_get_decl_name_mapping (file_data, name);
+
+ data = lto_get_section_data (file_data, LTO_section_function_body,
+ name, &len);
+ if (data)
+ {
+ struct function *fn;
+
+ gcc_assert (!DECL_IS_BUILTIN (decl));
+
+ /* This function has a definition. */
+ TREE_STATIC (decl) = 1;
+
+ gcc_assert (DECL_STRUCT_FUNCTION (decl) == NULL);
+ allocate_struct_function (decl, false);
+
+ /* Load the function body only if not operating in WPA mode. In
+ WPA mode, the body of the function is not needed. */
+ if (!flag_wpa)
+ {
+ lto_input_function_body (file_data, decl, data);
+ lto_stats.num_function_bodies++;
+ }
+
+ fn = DECL_STRUCT_FUNCTION (decl);
+ lto_free_section_data (file_data, LTO_section_function_body, name,
+ data, len);
+
+ /* Look for initializers of constant variables and private
+ statics. */
+ for (step = fn->local_decls; step; step = TREE_CHAIN (step))
+ {
+ tree decl = TREE_VALUE (step);
+ if (TREE_CODE (decl) == VAR_DECL
+ && (TREE_STATIC (decl) && !DECL_EXTERNAL (decl))
+ && flag_unit_at_a_time)
+ varpool_finalize_decl (decl);
+ }
+ }
+ else
+ DECL_EXTERNAL (decl) = 1;
+
+ /* Let the middle end know about the function. */
+ rest_of_decl_compilation (decl, 1, 0);
+ if (cgraph_node (decl)->needed)
+ cgraph_mark_reachable_node (cgraph_node (decl));
+}
+
+
+/* Decode the content of memory pointed to by DATA in the the
+ in decl state object STATE. DATA_IN points to a data_in structure for
+ decoding. Return the address after the decoded object in the input. */
+
+static const uint32_t *
+lto_read_in_decl_state (struct data_in *data_in, const uint32_t *data,
+ struct lto_in_decl_state *state)
+{
+ uint32_t ix;
+ tree decl;
+ uint32_t i, j;
+
+ ix = *data++;
+ decl = lto_streamer_cache_get (data_in->reader_cache, (int) ix);
+ if (TREE_CODE (decl) != FUNCTION_DECL)
+ {
+ gcc_assert (decl == void_type_node);
+ decl = NULL_TREE;
+ }
+ state->fn_decl = decl;
+
+ for (i = 0; i < LTO_N_DECL_STREAMS; i++)
+ {
+ uint32_t size = *data++;
+ tree *decls = (tree *) xcalloc (size, sizeof (tree));
+
+ for (j = 0; j < size; j++)
+ {
+ decls[j] = lto_streamer_cache_get (data_in->reader_cache, data[j]);
+
+ /* Register every type in the global type table. If the
+ type existed already, use the existing type. */
+ if (TYPE_P (decls[j]))
+ decls[j] = gimple_register_type (decls[j]);
+ }
+
+ state->streams[i].size = size;
+ state->streams[i].trees = decls;
+ data += size;
+ }
+
+ return data;
+}
+
+
+/* Read all the symbols from buffer DATA, using descriptors in DECL_DATA.
+ RESOLUTIONS is the set of symbols picked by the linker (read from the
+ resolution file when the linker plugin is being used). */
+
+static void
+lto_read_decls (struct lto_file_decl_data *decl_data, const void *data,
+ VEC(ld_plugin_symbol_resolution_t,heap) *resolutions)
+{
+ const struct lto_decl_header *header = (const struct lto_decl_header *) data;
+ const int32_t decl_offset = sizeof (struct lto_decl_header);
+ const int32_t main_offset = decl_offset + header->decl_state_size;
+ const int32_t string_offset = main_offset + header->main_size;
+ struct lto_input_block ib_main;
+ struct data_in *data_in;
+ unsigned int i;
+ const uint32_t *data_ptr, *data_end;
+ uint32_t num_decl_states;
+
+ LTO_INIT_INPUT_BLOCK (ib_main, (const char *) data + main_offset, 0,
+ header->main_size);
+
+ data_in = lto_data_in_create (decl_data, (const char *) data + string_offset,
+ header->string_size, resolutions);
+
+ /* Read the global declarations and types. */
+ while (ib_main.p < ib_main.len)
+ {
+ tree t = lto_input_tree (&ib_main, data_in);
+ gcc_assert (t && ib_main.p <= ib_main.len);
+ }
+
+ /* Read in lto_in_decl_state objects. */
+ data_ptr = (const uint32_t *) ((const char*) data + decl_offset);
+ data_end =
+ (const uint32_t *) ((const char*) data_ptr + header->decl_state_size);
+ num_decl_states = *data_ptr++;
+
+ gcc_assert (num_decl_states > 0);
+ decl_data->global_decl_state = lto_new_in_decl_state ();
+ data_ptr = lto_read_in_decl_state (data_in, data_ptr,
+ decl_data->global_decl_state);
+
+ /* Read in per-function decl states and enter them in hash table. */
+ decl_data->function_decl_states =
+ htab_create (37, lto_hash_in_decl_state, lto_eq_in_decl_state, free);
+
+ for (i = 1; i < num_decl_states; i++)
+ {
+ struct lto_in_decl_state *state = lto_new_in_decl_state ();
+ void **slot;
+
+ data_ptr = lto_read_in_decl_state (data_in, data_ptr, state);
+ slot = htab_find_slot (decl_data->function_decl_states, state, INSERT);
+ gcc_assert (*slot == NULL);
+ *slot = state;
+ }
+
+ if (data_ptr != data_end)
+ internal_error ("bytecode stream: garbage at the end of symbols section");
+
+ /* Set the current decl state to be the global state. */
+ decl_data->current_decl_state = decl_data->global_decl_state;
+
+ lto_data_in_delete (data_in);
+}
+
+/* Read resolution for file named FILE_NAME. The resolution is read from
+ RESOLUTION. An array with the symbol resolution is returned. The array
+ size is written to SIZE. */
+
+static VEC(ld_plugin_symbol_resolution_t,heap) *
+lto_resolution_read (FILE *resolution, const char *file_name)
+{
+ /* We require that objects in the resolution file are in the same
+ order as the lto1 command line. */
+ unsigned int name_len;
+ char *obj_name;
+ unsigned int num_symbols;
+ unsigned int i;
+ VEC(ld_plugin_symbol_resolution_t,heap) *ret = NULL;
+ unsigned max_index = 0;
+
+ if (!resolution)
+ return NULL;
+
+ name_len = strlen (file_name);
+ obj_name = XNEWVEC (char, name_len + 1);
+ fscanf (resolution, " "); /* Read white space. */
+
+ fread (obj_name, sizeof (char), name_len, resolution);
+ obj_name[name_len] = '\0';
+ if (strcmp (obj_name, file_name) != 0)
+ internal_error ("unexpected file name %s in linker resolution file. "
+ "Expected %s", obj_name, file_name);
+
+ free (obj_name);
+
+ fscanf (resolution, "%u", &num_symbols);
+
+ for (i = 0; i < num_symbols; i++)
+ {
+ unsigned index;
+ char r_str[27];
+ enum ld_plugin_symbol_resolution r;
+ unsigned int j;
+ unsigned int lto_resolution_str_len =
+ sizeof (lto_resolution_str) / sizeof (char *);
+
+ fscanf (resolution, "%u %26s", &index, r_str);
+ if (index > max_index)
+ max_index = index;
+
+ for (j = 0; j < lto_resolution_str_len; j++)
+ {
+ if (strcmp (lto_resolution_str[j], r_str) == 0)
+ {
+ r = (enum ld_plugin_symbol_resolution) j;
+ break;
+ }
+ }
+ if (j >= lto_resolution_str_len)
+ internal_error ("tried to read past the end of the linker resolution "
+ "file");
+
+ VEC_safe_grow_cleared (ld_plugin_symbol_resolution_t, heap, ret,
+ index + 1);
+ VEC_replace (ld_plugin_symbol_resolution_t, ret, index, r);
+ }
+
+ return ret;
+}
+
+/* Generate a TREE representation for all types and external decls
+ entities in FILE.
+
+ Read all of the globals out of the file. Then read the cgraph
+ and process the .o index into the cgraph nodes so that it can open
+ the .o file to load the functions and ipa information. */
+
+static struct lto_file_decl_data *
+lto_file_read (lto_file *file, FILE *resolution_file)
+{
+ struct lto_file_decl_data *file_data;
+ const char *data;
+ size_t len;
+ VEC(ld_plugin_symbol_resolution_t,heap) *resolutions;
+
+ resolutions = lto_resolution_read (resolution_file, file->filename);
+
+ file_data = XCNEW (struct lto_file_decl_data);
+ file_data->file_name = file->filename;
+ file_data->section_hash_table = lto_elf_build_section_table (file);
+ file_data->renaming_hash_table = lto_create_renaming_table ();
+
+ data = lto_get_section_data (file_data, LTO_section_decls, NULL, &len);
+ lto_read_decls (file_data, data, resolutions);
+ lto_free_section_data (file_data, LTO_section_decls, NULL, data, len);
+
+ return file_data;
+}
+
+#if HAVE_MMAP_FILE && HAVE_SYSCONF && defined _SC_PAGE_SIZE
+#define LTO_MMAP_IO 1
+#endif
+
+#if LTO_MMAP_IO
+/* Page size of machine is used for mmap and munmap calls. */
+static size_t page_mask;
+#endif
+
+/* Get the section data of length LEN from FILENAME starting at
+ OFFSET. The data segment must be freed by the caller when the
+ caller is finished. Returns NULL if all was not well. */
+
+static char *
+lto_read_section_data (struct lto_file_decl_data *file_data,
+ intptr_t offset, size_t len)
+{
+ char *result;
+ static int fd = -1;
+ static char *fd_name;
+#if LTO_MMAP_IO
+ intptr_t computed_len;
+ intptr_t computed_offset;
+ intptr_t diff;
+#endif
+
+ /* Keep a single-entry file-descriptor cache. The last file we
+ touched will get closed at exit.
+ ??? Eventually we want to add a more sophisticated larger cache
+ or rather fix function body streaming to not stream them in
+ practically random order. */
+ if (fd != -1
+ && strcmp (fd_name, file_data->file_name) != 0)
+ {
+ free (fd_name);
+ close (fd);
+ fd = -1;
+ }
+ if (fd == -1)
+ {
+ fd_name = xstrdup (file_data->file_name);
+ fd = open (file_data->file_name, O_RDONLY);
+ if (fd == -1)
+ return NULL;
+ }
+
+#if LTO_MMAP_IO
+ if (!page_mask)
+ {
+ size_t page_size = sysconf (_SC_PAGE_SIZE);
+ page_mask = ~(page_size - 1);
+ }
+
+ computed_offset = offset & page_mask;
+ diff = offset - computed_offset;
+ computed_len = len + diff;
+
+ result = (char *) mmap (NULL, computed_len, PROT_READ, MAP_PRIVATE,
+ fd, computed_offset);
+ if (result == MAP_FAILED)
+ return NULL;
+
+ return result + diff;
+#else
+ result = (char *) xmalloc (len);
+ if (lseek (fd, offset, SEEK_SET) != offset
+ || read (fd, result, len) != (ssize_t) len)
+ {
+ free (result);
+ return NULL;
+ }
+
+ return result;
+#endif
+}
+
+
+/* Get the section data from FILE_DATA of SECTION_TYPE with NAME.
+ NAME will be NULL unless the section type is for a function
+ body. */
+
+static const char *
+get_section_data (struct lto_file_decl_data *file_data,
+ enum lto_section_type section_type,
+ const char *name,
+ size_t *len)
+{
+ htab_t section_hash_table = file_data->section_hash_table;
+ struct lto_section_slot *f_slot;
+ struct lto_section_slot s_slot;
+ const char *section_name = lto_get_section_name (section_type, name);
+ char *data = NULL;
+
+ *len = 0;
+ s_slot.name = section_name;
+ f_slot = (struct lto_section_slot *) htab_find (section_hash_table, &s_slot);
+ if (f_slot)
+ {
+ data = lto_read_section_data (file_data, f_slot->start, f_slot->len);
+ *len = f_slot->len;
+ }
+
+ free (CONST_CAST (char *, section_name));
+ return data;
+}
+
+
+/* Free the section data from FILE_DATA of SECTION_TYPE with NAME that
+ starts at OFFSET and has LEN bytes. */
+
+static void
+free_section_data (struct lto_file_decl_data *file_data ATTRIBUTE_UNUSED,
+ enum lto_section_type section_type ATTRIBUTE_UNUSED,
+ const char *name ATTRIBUTE_UNUSED,
+ const char *offset, size_t len ATTRIBUTE_UNUSED)
+{
+#if LTO_MMAP_IO
+ intptr_t computed_len;
+ intptr_t computed_offset;
+ intptr_t diff;
+#endif
+
+#if LTO_MMAP_IO
+ computed_offset = ((intptr_t) offset) & page_mask;
+ diff = (intptr_t) offset - computed_offset;
+ computed_len = len + diff;
+
+ munmap ((caddr_t) computed_offset, computed_len);
+#else
+ free (CONST_CAST(char *, offset));
+#endif
+}
+
+/* Vector of all cgraph node sets. */
+static GTY (()) VEC(cgraph_node_set, gc) *lto_cgraph_node_sets;
+
+
+/* Group cgrah nodes by input files. This is used mainly for testing
+ right now. */
+
+static void
+lto_1_to_1_map (void)
+{
+ struct cgraph_node *node;
+ struct lto_file_decl_data *file_data;
+ struct pointer_map_t *pmap;
+ cgraph_node_set set;
+ void **slot;
+
+ timevar_push (TV_WHOPR_WPA);
+
+ lto_cgraph_node_sets = VEC_alloc (cgraph_node_set, gc, 1);
+
+ /* If the cgraph is empty, create one cgraph node set so that there is still
+ an output file for any variables that need to be exported in a DSO. */
+ if (!cgraph_nodes)
+ {
+ set = cgraph_node_set_new ();
+ VEC_safe_push (cgraph_node_set, gc, lto_cgraph_node_sets, set);
+ goto finish;
+ }
+
+ pmap = pointer_map_create ();
+
+ for (node = cgraph_nodes; node; node = node->next)
+ {
+ /* We only need to partition the nodes that we read from the
+ gimple bytecode files. */
+ file_data = node->local.lto_file_data;
+ if (file_data == NULL)
+ continue;
+
+ slot = pointer_map_contains (pmap, file_data);
+ if (slot)
+ set = (cgraph_node_set) *slot;
+ else
+ {
+ set = cgraph_node_set_new ();
+ slot = pointer_map_insert (pmap, file_data);
+ *slot = set;
+ VEC_safe_push (cgraph_node_set, gc, lto_cgraph_node_sets, set);
+ }
+
+ cgraph_node_set_add (set, node);
+ }
+
+ pointer_map_destroy (pmap);
+
+finish:
+ timevar_pop (TV_WHOPR_WPA);
+
+ lto_stats.num_cgraph_partitions += VEC_length (cgraph_node_set,
+ lto_cgraph_node_sets);
+}
+
+
+/* Add inlined clone NODE and its master clone to SET, if NODE itself has
+ inlined callees, recursively add the callees. */
+
+static void
+lto_add_inline_clones (cgraph_node_set set, struct cgraph_node *node,
+ bitmap original_decls, bitmap inlined_decls)
+{
+ struct cgraph_node *callee;
+ struct cgraph_edge *edge;
+
+ cgraph_node_set_add (set, node);
+
+ if (!bitmap_bit_p (original_decls, DECL_UID (node->decl)))
+ bitmap_set_bit (inlined_decls, DECL_UID (node->decl));
+
+ /* Check to see if NODE has any inlined callee. */
+ for (edge = node->callees; edge != NULL; edge = edge->next_callee)
+ {
+ callee = edge->callee;
+ if (callee->global.inlined_to != NULL)
+ lto_add_inline_clones (set, callee, original_decls, inlined_decls);
+ }
+}
+
+/* Compute the transitive closure of inlining of SET based on the
+ information in the callgraph. Returns a bitmap of decls that have
+ been inlined into SET indexed by UID. */
+
+static bitmap
+lto_add_all_inlinees (cgraph_node_set set)
+{
+ cgraph_node_set_iterator csi;
+ struct cgraph_node *node;
+ bitmap original_nodes = lto_bitmap_alloc ();
+ bitmap original_decls = lto_bitmap_alloc ();
+ bitmap inlined_decls = lto_bitmap_alloc ();
+ bool changed;
+
+ /* We are going to iterate SET while adding to it, mark all original
+ nodes so that we only add node inlined to original nodes. */
+ for (csi = csi_start (set); !csi_end_p (csi); csi_next (&csi))
+ {
+ bitmap_set_bit (original_nodes, csi_node (csi)->uid);
+ bitmap_set_bit (original_decls, DECL_UID (csi_node (csi)->decl));
+ }
+
+ /* Some of the original nodes might not be needed anymore.
+ Remove them. */
+ do
+ {
+ changed = false;
+ for (csi = csi_start (set); !csi_end_p (csi); csi_next (&csi))
+ {
+ struct cgraph_node *inlined_to;
+ node = csi_node (csi);
+
+ /* NODE was not inlined. We still need it. */
+ if (!node->global.inlined_to)
+ continue;
+
+ inlined_to = node->global.inlined_to;
+
+ /* NODE should have only one caller. */
+ gcc_assert (!node->callers->next_caller);
+
+ if (!bitmap_bit_p (original_nodes, inlined_to->uid))
+ {
+ bitmap_clear_bit (original_nodes, node->uid);
+ cgraph_node_set_remove (set, node);
+ changed = true;
+ }
+ }
+ }
+ while (changed);
+
+ /* Transitively add to SET all the inline clones for every node that
+ has been inlined. */
+ for (csi = csi_start (set); !csi_end_p (csi); csi_next (&csi))
+ {
+ node = csi_node (csi);
+ if (bitmap_bit_p (original_nodes, node->uid))
+ lto_add_inline_clones (set, node, original_decls, inlined_decls);
+ }
+
+ lto_bitmap_free (original_nodes);
+ lto_bitmap_free (original_decls);
+
+ return inlined_decls;
+}
+
+/* Owing to inlining, we may need to promote a file-scope variable
+ to a global variable. Consider this case:
+
+ a.c:
+ static int var;
+
+ void
+ foo (void)
+ {
+ var++;
+ }
+
+ b.c:
+
+ extern void foo (void);
+
+ void
+ bar (void)
+ {
+ foo ();
+ }
+
+ If WPA inlines FOO inside BAR, then the static variable VAR needs to
+ be promoted to global because BAR and VAR may be in different LTRANS
+ files. */
+
+/* This struct keeps track of states used in globalization. */
+
+typedef struct
+{
+ /* Current cgraph node set. */
+ cgraph_node_set set;
+
+ /* Function DECLs of cgraph nodes seen. */
+ bitmap seen_node_decls;
+
+ /* Use in walk_tree to avoid multiple visits of a node. */
+ struct pointer_set_t *visited;
+
+ /* static vars in this set. */
+ bitmap static_vars_in_set;
+
+ /* static vars in all previous set. */
+ bitmap all_static_vars;
+
+ /* all vars in all previous set. */
+ bitmap all_vars;
+} globalize_context_t;
+
+/* Callback for walk_tree. Examine the tree pointer to by TP and see if
+ if its a file-scope static variable of function that need to be turned
+ into a global. */
+
+static tree
+globalize_cross_file_statics (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
+ void *data)
+{
+ globalize_context_t *context = (globalize_context_t *) data;
+ tree t = *tp;
+
+ if (t == NULL_TREE)
+ return NULL;
+
+ /* The logic for globalization of VAR_DECLs and FUNCTION_DECLs are
+ different. For functions, we can simply look at the cgraph node sets
+ to tell if there are references to static functions outside the set.
+ The cgraph node sets do not keep track of vars, we need to traverse
+ the trees to determine what vars need to be globalized. */
+ if (TREE_CODE (t) == VAR_DECL)
+ {
+ if (!TREE_PUBLIC (t))
+ {
+ /* This file-scope static variable is reachable from more
+ that one set. Make it global but with hidden visibility
+ so that we do not export it in dynamic linking. */
+ if (bitmap_bit_p (context->all_static_vars, DECL_UID (t)))
+ {
+ TREE_PUBLIC (t) = 1;
+ DECL_VISIBILITY (t) = VISIBILITY_HIDDEN;
+ }
+ bitmap_set_bit (context->static_vars_in_set, DECL_UID (t));
+ }
+ bitmap_set_bit (context->all_vars, DECL_UID (t));
+ walk_tree (&DECL_INITIAL (t), globalize_cross_file_statics, context,
+ context->visited);
+ }
+ else if (TREE_CODE (t) == FUNCTION_DECL && !TREE_PUBLIC (t))
+ {
+ if (!cgraph_node_in_set_p (cgraph_node (t), context->set))
+ {
+ /* This file-scope static function is reachable from a set
+ which does not contain the function DECL. Make it global
+ but with hidden visibility. */
+ TREE_PUBLIC (t) = 1;
+ DECL_VISIBILITY (t) = VISIBILITY_HIDDEN;
+ }
+ }
+
+ return NULL;
+}
+
+/* Helper of lto_scan_statics_in_cgraph_node below. Scan TABLE for
+ static decls that may be used in more than one LTRANS file.
+ CONTEXT is a globalize_context_t for storing scanning states. */
+
+static void
+lto_scan_statics_in_ref_table (struct lto_tree_ref_table *table,
+ globalize_context_t *context)
+{
+ unsigned i;
+
+ for (i = 0; i < table->size; i++)
+ walk_tree (&table->trees[i], globalize_cross_file_statics, context,
+ context->visited);
+}
+
+/* Promote file-scope decl reachable from NODE if necessary to global.
+ CONTEXT is a globalize_context_t storing scanning states. */
+
+static void
+lto_scan_statics_in_cgraph_node (struct cgraph_node *node,
+ globalize_context_t *context)
+{
+ struct lto_in_decl_state *state;
+
+ /* Do nothing if NODE has no function body. */
+ if (!node->analyzed)
+ return;
+
+ /* Return if the DECL of nodes has been visited before. */
+ if (bitmap_bit_p (context->seen_node_decls, DECL_UID (node->decl)))
+ return;
+
+ bitmap_set_bit (context->seen_node_decls, DECL_UID (node->decl));
+
+ state = lto_get_function_in_decl_state (node->local.lto_file_data,
+ node->decl);
+ gcc_assert (state);
+
+ lto_scan_statics_in_ref_table (&state->streams[LTO_DECL_STREAM_VAR_DECL],
+ context);
+ lto_scan_statics_in_ref_table (&state->streams[LTO_DECL_STREAM_FN_DECL],
+ context);
+}
+
+/* Scan all global variables that we have not yet seen so far. CONTEXT
+ is a globalize_context_t storing scanning states. */
+
+static void
+lto_scan_statics_in_remaining_global_vars (globalize_context_t *context)
+{
+ tree var, var_context;
+ struct varpool_node *vnode;
+
+ FOR_EACH_STATIC_VARIABLE (vnode)
+ {
+ var = vnode->decl;
+ var_context = DECL_CONTEXT (var);
+ if (TREE_STATIC (var)
+ && TREE_PUBLIC (var)
+ && (!var_context || TREE_CODE (var_context) != FUNCTION_DECL)
+ && !bitmap_bit_p (context->all_vars, DECL_UID (var)))
+ walk_tree (&var, globalize_cross_file_statics, context,
+ context->visited);
+ }
+}
+
+/* Find out all static decls that need to be promoted to global because
+ of cross file sharing. This function must be run in the WPA mode after
+ all inlinees are added. */
+
+static void
+lto_promote_cross_file_statics (void)
+{
+ unsigned i, n_sets;
+ cgraph_node_set set;
+ cgraph_node_set_iterator csi;
+ globalize_context_t context;
+
+ memset (&context, 0, sizeof (context));
+ context.all_vars = lto_bitmap_alloc ();
+ context.all_static_vars = lto_bitmap_alloc ();
+
+ n_sets = VEC_length (cgraph_node_set, lto_cgraph_node_sets);
+ for (i = 0; i < n_sets; i++)
+ {
+ set = VEC_index (cgraph_node_set, lto_cgraph_node_sets, i);
+ context.set = set;
+ context.visited = pointer_set_create ();
+ context.static_vars_in_set = lto_bitmap_alloc ();
+ context.seen_node_decls = lto_bitmap_alloc ();
+
+ for (csi = csi_start (set); !csi_end_p (csi); csi_next (&csi))
+ lto_scan_statics_in_cgraph_node (csi_node (csi), &context);
+
+ if (i == n_sets - 1)
+ lto_scan_statics_in_remaining_global_vars (&context);
+
+ bitmap_ior_into (context.all_static_vars, context.static_vars_in_set);
+
+ pointer_set_destroy (context.visited);
+ lto_bitmap_free (context.static_vars_in_set);
+ lto_bitmap_free (context.seen_node_decls);
+ }
+
+ lto_bitmap_free (context.all_vars);
+ lto_bitmap_free (context.all_static_vars);
+}
+
+
+/* Given a file name FNAME, return a string with FNAME prefixed with '*'. */
+
+static char *
+prefix_name_with_star (const char *fname)
+{
+ char *star_fname;
+ size_t len;
+
+ len = strlen (fname) + 1 + 1;
+ star_fname = XNEWVEC (char, len);
+ snprintf (star_fname, len, "*%s", fname);
+
+ return star_fname;
+}
+
+
+/* Return a copy of FNAME without the .o extension. */
+
+static char *
+strip_extension (const char *fname)
+{
+ char *s = XNEWVEC (char, strlen (fname) - 2 + 1);
+ gcc_assert (strstr (fname, ".o"));
+ snprintf (s, strlen (fname) - 2 + 1, "%s", fname);
+
+ return s;
+}
+
+
+/* Return a file name associated with cgraph node set SET. This may
+ be a new temporary file name if SET needs to be processed by
+ LTRANS, or the original file name if all the nodes in SET belong to
+ the same input file. */
+
+static char *
+get_filename_for_set (cgraph_node_set set)
+{
+ char *fname = NULL;
+ static const size_t max_fname_len = 100;
+
+ if (cgraph_node_set_needs_ltrans_p (set))
+ {
+ /* Create a new temporary file to store SET. To facilitate
+ debugging, use file names from SET as part of the new
+ temporary file name. */
+ cgraph_node_set_iterator si;
+ struct pointer_set_t *pset = pointer_set_create ();
+ for (si = csi_start (set); !csi_end_p (si); csi_next (&si))
+ {
+ struct cgraph_node *n = csi_node (si);
+ const char *node_fname;
+ char *f;
+
+ /* Don't use the same file name more than once. */
+ if (pointer_set_insert (pset, n->local.lto_file_data))
+ continue;
+
+ /* The first file name found in SET determines the output
+ directory. For the remaining files, we use their
+ base names. */
+ node_fname = n->local.lto_file_data->file_name;
+ if (fname == NULL)
+ {
+ fname = strip_extension (node_fname);
+ continue;
+ }
+
+ f = strip_extension (lbasename (node_fname));
+
+ /* If the new name causes an excessively long file name,
+ make the last component "___" to indicate overflow. */
+ if (strlen (fname) + strlen (f) > max_fname_len - 3)
+ {
+ fname = reconcat (fname, fname, "___", NULL);
+ break;
+ }
+ else
+ {
+ fname = reconcat (fname, fname, "_", f, NULL);
+ free (f);
+ }
+ }
+
+ pointer_set_destroy (pset);
+
+ /* Add the extension .wpa.o to indicate that this file has been
+ produced by WPA. */
+ fname = reconcat (fname, fname, ".wpa.o", NULL);
+ gcc_assert (fname);
+ }
+ else
+ {
+ /* Since SET does not need to be processed by LTRANS, use
+ the original file name and mark it with a '*' prefix so that
+ lto_execute_ltrans knows not to process it. */
+ cgraph_node_set_iterator si = csi_start (set);
+ struct cgraph_node *first = csi_node (si);
+ fname = prefix_name_with_star (first->local.lto_file_data->file_name);
+ }
+
+ return fname;
+}
+
+static lto_file *current_lto_file;
+
+
+/* Write all output files in WPA mode. Returns a NULL-terminated array of
+ output file names. */
+
+static char **
+lto_wpa_write_files (void)
+{
+ char **output_files;
+ unsigned i, n_sets, last_out_file_ix, num_out_files;
+ lto_file *file;
+ cgraph_node_set set;
+ bitmap decls;
+ VEC(bitmap,heap) *inlined_decls = NULL;
+
+ timevar_push (TV_WHOPR_WPA);
+
+ /* Include all inlined functions and determine what sets need to be
+ compiled by LTRANS. After this loop, only those sets that
+ contain callgraph nodes from more than one file will need to be
+ compiled by LTRANS. */
+ for (i = 0; VEC_iterate (cgraph_node_set, lto_cgraph_node_sets, i, set); i++)
+ {
+ decls = lto_add_all_inlinees (set);
+ VEC_safe_push (bitmap, heap, inlined_decls, decls);
+ lto_stats.num_output_cgraph_nodes += VEC_length (cgraph_node_ptr,
+ set->nodes);
+ }
+
+ /* After adding all inlinees, find out statics that need to be promoted
+ to globals because of cross-file inlining. */
+ lto_promote_cross_file_statics ();
+
+ timevar_pop (TV_WHOPR_WPA);
+
+ timevar_push (TV_WHOPR_WPA_IO);
+
+ /* The number of output files depends on the number of input files
+ and how many callgraph node sets we create. Reserve enough space
+ for the maximum of these two. */
+ num_out_files = MAX (VEC_length (cgraph_node_set, lto_cgraph_node_sets),
+ num_in_fnames);
+ output_files = XNEWVEC (char *, num_out_files + 1);
+
+ n_sets = VEC_length (cgraph_node_set, lto_cgraph_node_sets);
+ for (i = 0; i < n_sets; i++)
+ {
+ char *temp_filename;
+
+ set = VEC_index (cgraph_node_set, lto_cgraph_node_sets, i);
+ temp_filename = get_filename_for_set (set);
+ output_files[i] = temp_filename;
+
+ if (cgraph_node_set_needs_ltrans_p (set))
+ {
+ /* Write all the nodes in SET to TEMP_FILENAME. */
+ file = lto_elf_file_open (temp_filename, true);
+ if (!file)
+ fatal_error ("lto_elf_file_open() failed");
+
+ lto_set_current_out_file (file);
+ lto_new_extern_inline_states ();
+
+ decls = VEC_index (bitmap, inlined_decls, i);
+ lto_force_functions_extern_inline (decls);
+
+ ipa_write_summaries_of_cgraph_node_set (set);
+ lto_delete_extern_inline_states ();
+
+ lto_set_current_out_file (NULL);
+ lto_elf_file_close (file);
+ }
+ }
+
+ last_out_file_ix = n_sets;
+
+ lto_stats.num_output_files += n_sets;
+
+ output_files[last_out_file_ix] = NULL;
+
+ for (i = 0; VEC_iterate (bitmap, inlined_decls, i, decls); i++)
+ lto_bitmap_free (decls);
+ VEC_free (bitmap, heap, inlined_decls);
+
+ timevar_pop (TV_WHOPR_WPA_IO);
+
+ return output_files;
+}
+
+
+/* Perform local transformations (LTRANS) on the files in the NULL-terminated
+ FILES array. These should have been written previously by
+ lto_wpa_write_files (). Transformations are performed via executing
+ COLLECT_GCC for reach file. */
+
+static void
+lto_execute_ltrans (char *const *files)
+{
+ struct pex_obj *pex;
+ const char *collect_gcc_options, *collect_gcc;
+ struct obstack env_obstack;
+ const char **argv;
+ const char **argv_ptr;
+ const char *errmsg;
+ size_t i, j;
+ int err;
+ int status;
+ FILE *ltrans_output_list_stream = NULL;
+
+ timevar_push (TV_WHOPR_WPA_LTRANS_EXEC);
+
+ /* Get the driver and options. */
+ collect_gcc = getenv ("COLLECT_GCC");
+ if (!collect_gcc)
+ fatal_error ("environment variable COLLECT_GCC must be set");
+
+ /* Set the CFLAGS environment variable. */
+ collect_gcc_options = getenv ("COLLECT_GCC_OPTIONS");
+ if (!collect_gcc_options)
+ fatal_error ("environment variable COLLECT_GCC_OPTIONS must be set");
+
+ /* Count arguments. */
+ i = 0;
+ for (j = 0; collect_gcc_options[j] != '\0'; ++j)
+ if (collect_gcc_options[j] == '\'')
+ ++i;
+
+ if (i % 2 != 0)
+ fatal_error ("malformed COLLECT_GCC_OPTIONS");
+
+ /* Initalize the arguments for the LTRANS driver. */
+ argv = XNEWVEC (const char *, 8 + i / 2);
+ argv_ptr = argv;
+ *argv_ptr++ = collect_gcc;
+ *argv_ptr++ = "-xlto";
+ for (j = 0; collect_gcc_options[j] != '\0'; ++j)
+ if (collect_gcc_options[j] == '\'')
+ {
+ char *option;
+
+ ++j;
+ i = j;
+ while (collect_gcc_options[j] != '\'')
+ ++j;
+ obstack_init (&env_obstack);
+ obstack_grow (&env_obstack, &collect_gcc_options[i], j - i);
+ obstack_1grow (&env_obstack, 0);
+ option = XOBFINISH (&env_obstack, char *);
+
+ /* LTRANS does not need -fwpa nor -fltrans-*. */
+ if (strncmp (option, "-fwpa", 5) != 0
+ && strncmp (option, "-fltrans-", 9) != 0)
+ *argv_ptr++ = option;
+ }
+ *argv_ptr++ = "-fltrans";
+
+ /* Open the LTRANS output list. */
+ if (ltrans_output_list)
+ {
+ ltrans_output_list_stream = fopen (ltrans_output_list, "w");
+ if (ltrans_output_list_stream == NULL)
+ error ("opening LTRANS output list %s: %m", ltrans_output_list);
+ }
+
+ for (i = 0; files[i]; ++i)
+ {
+ size_t len;
+
+ /* If the file is prefixed with a '*', it means that we do not
+ need to re-compile it with LTRANS because it has not been
+ modified by WPA. Skip it from the command line to
+ lto_execute_ltrans, but add it to ltrans_output_list_stream
+ so it is linked after we are done. */
+ if (files[i][0] == '*')
+ {
+ size_t len = strlen (files[i]) - 1;
+ if (ltrans_output_list_stream)
+ if (fwrite (&files[i][1], 1, len, ltrans_output_list_stream) < len
+ || fwrite ("\n", 1, 1, ltrans_output_list_stream) < 1)
+ error ("writing to LTRANS output list %s: %m",
+ ltrans_output_list);
+ }
+ else
+ {
+ char *output_name;
+
+ /* Otherwise, add FILES[I] to lto_execute_ltrans command line
+ and add the resulting file to LTRANS output list. */
+
+ /* Replace the .o suffix with a .ltrans.o suffix and write
+ the resulting name to the LTRANS output list. */
+ obstack_init (&env_obstack);
+ obstack_grow (&env_obstack, files[i], strlen (files[i]) - 2);
+ obstack_grow (&env_obstack, ".ltrans.o", sizeof (".ltrans.o"));
+ output_name = XOBFINISH (&env_obstack, char *);
+ if (ltrans_output_list_stream)
+ {
+ len = strlen (output_name);
+
+ if (fwrite (output_name, 1, len, ltrans_output_list_stream) < len
+ || fwrite ("\n", 1, 1, ltrans_output_list_stream) < 1)
+ error ("writing to LTRANS output list %s: %m",
+ ltrans_output_list);
+ }
+
+ argv_ptr[0] = "-o";
+ argv_ptr[1] = output_name;
+ argv_ptr[2] = files[i];
+ argv_ptr[3] = NULL;
+
+ /* Execute the driver. */
+ pex = pex_init (0, "lto1", NULL);
+ if (pex == NULL)
+ fatal_error ("pex_init failed: %s", xstrerror (errno));
+
+ errmsg = pex_run (pex, PEX_LAST | PEX_SEARCH, argv[0],
+ CONST_CAST (char **, argv), NULL, NULL, &err);
+ if (errmsg)
+ fatal_error ("%s: %s", errmsg, xstrerror (err));
+
+ if (!pex_get_status (pex, 1, &status))
+ fatal_error ("can't get program status: %s", xstrerror (errno));
+
+ if (status)
+ {
+ if (WIFSIGNALED (status))
+ {
+ int sig = WTERMSIG (status);
+ fatal_error ("%s terminated with signal %d [%s]%s",
+ argv[0], sig, strsignal (sig),
+ WCOREDUMP (status) ? ", core dumped" : "");
+ }
+ else
+ fatal_error ("%s terminated with status %d", argv[0], status);
+ }
+
+ pex_free (pex);
+ }
+ }
+
+ /* Close the LTRANS output list. */
+ if (ltrans_output_list_stream && fclose (ltrans_output_list_stream))
+ error ("closing LTRANS output list %s: %m", ltrans_output_list);
+
+ obstack_free (&env_obstack, NULL);
+ free (argv);
+
+ timevar_pop (TV_WHOPR_WPA_LTRANS_EXEC);
+}
+
+
+typedef struct {
+ struct pointer_set_t *seen;
+} lto_fixup_data_t;
+
+#define LTO_FIXUP_SUBTREE(t) \
+ do \
+ walk_tree (&(t), lto_fixup_tree, data, NULL); \
+ while (0)
+
+#define LTO_REGISTER_TYPE_AND_FIXUP_SUBTREE(t) \
+ do \
+ { \
+ if (t) \
+ (t) = gimple_register_type (t); \
+ walk_tree (&(t), lto_fixup_tree, data, NULL); \
+ } \
+ while (0)
+
+static tree lto_fixup_tree (tree *, int *, void *);
+
+/* Return true if T does not need to be fixed up recursively. */
+
+static inline bool
+no_fixup_p (tree t)
+{
+ return (t == NULL
+ || CONSTANT_CLASS_P (t)
+ || TREE_CODE (t) == IDENTIFIER_NODE);
+}
+
+/* Fix up fields of a tree_common T. DATA points to fix-up states. */
+
+static void
+lto_fixup_common (tree t, void *data)
+{
+ /* The following re-creates the TYPE_REFERENCE_TO and TYPE_POINTER_TO
+ lists. We do not stream TYPE_REFERENCE_TO, TYPE_POINTER_TO or
+ TYPE_NEXT_PTR_TO and TYPE_NEXT_REF_TO.
+ First remove us from any pointer list we are on. */
+ if (TREE_CODE (t) == POINTER_TYPE)
+ {
+ if (TYPE_POINTER_TO (TREE_TYPE (t)) == t)
+ TYPE_POINTER_TO (TREE_TYPE (t)) = TYPE_NEXT_PTR_TO (t);
+ else
+ {
+ tree tem = TYPE_POINTER_TO (TREE_TYPE (t));
+ while (tem && TYPE_NEXT_PTR_TO (tem) != t)
+ tem = TYPE_NEXT_PTR_TO (tem);
+ if (tem)
+ TYPE_NEXT_PTR_TO (tem) = TYPE_NEXT_PTR_TO (t);
+ }
+ TYPE_NEXT_PTR_TO (t) = NULL_TREE;
+ }
+ else if (TREE_CODE (t) == REFERENCE_TYPE)
+ {
+ if (TYPE_REFERENCE_TO (TREE_TYPE (t)) == t)
+ TYPE_REFERENCE_TO (TREE_TYPE (t)) = TYPE_NEXT_REF_TO (t);
+ else
+ {
+ tree tem = TYPE_REFERENCE_TO (TREE_TYPE (t));
+ while (tem && TYPE_NEXT_REF_TO (tem) != t)
+ tem = TYPE_NEXT_REF_TO (tem);
+ if (tem)
+ TYPE_NEXT_REF_TO (tem) = TYPE_NEXT_REF_TO (t);
+ }
+ TYPE_NEXT_REF_TO (t) = NULL_TREE;
+ }
+
+ /* Fixup our type. */
+ LTO_REGISTER_TYPE_AND_FIXUP_SUBTREE (TREE_TYPE (t));
+
+ /* Second put us on the list of pointers of the new pointed-to type
+ if we are a main variant. This is done in lto_fixup_type after
+ fixing up our main variant. */
+
+ /* This is not very efficient because we cannot do tail-recursion with
+ a long chain of trees. */
+ LTO_FIXUP_SUBTREE (TREE_CHAIN (t));
+}
+
+/* Fix up fields of a decl_minimal T. DATA points to fix-up states. */
+
+static void
+lto_fixup_decl_minimal (tree t, void *data)
+{
+ lto_fixup_common (t, data);
+ LTO_FIXUP_SUBTREE (DECL_NAME (t));
+ LTO_FIXUP_SUBTREE (DECL_CONTEXT (t));
+}
+
+/* Fix up fields of a decl_common T. DATA points to fix-up states. */
+
+static void
+lto_fixup_decl_common (tree t, void *data)
+{
+ lto_fixup_decl_minimal (t, data);
+ LTO_FIXUP_SUBTREE (DECL_SIZE (t));
+ LTO_FIXUP_SUBTREE (DECL_SIZE_UNIT (t));
+ LTO_FIXUP_SUBTREE (DECL_INITIAL (t));
+ LTO_FIXUP_SUBTREE (DECL_ATTRIBUTES (t));
+ LTO_FIXUP_SUBTREE (DECL_ABSTRACT_ORIGIN (t));
+}
+
+/* Fix up fields of a decl_with_vis T. DATA points to fix-up states. */
+
+static void
+lto_fixup_decl_with_vis (tree t, void *data)
+{
+ lto_fixup_decl_common (t, data);
+
+ /* Accessor macro has side-effects, use field-name here. */
+ LTO_FIXUP_SUBTREE (t->decl_with_vis.assembler_name);
+
+ gcc_assert (no_fixup_p (DECL_SECTION_NAME (t)));
+}
+
+/* Fix up fields of a decl_non_common T. DATA points to fix-up states. */
+
+static void
+lto_fixup_decl_non_common (tree t, void *data)
+{
+ lto_fixup_decl_with_vis (t, data);
+ LTO_FIXUP_SUBTREE (DECL_ARGUMENT_FLD (t));
+ LTO_FIXUP_SUBTREE (DECL_RESULT_FLD (t));
+ LTO_FIXUP_SUBTREE (DECL_VINDEX (t));
+
+ /* SAVED_TREE should not cleared by now. Also no accessor for base type. */
+ gcc_assert (no_fixup_p (t->decl_non_common.saved_tree));
+}
+
+/* Fix up fields of a decl_non_common T. DATA points to fix-up states. */
+
+static void
+lto_fixup_function (tree t, void *data)
+{
+ lto_fixup_decl_non_common (t, data);
+ LTO_FIXUP_SUBTREE (DECL_FUNCTION_PERSONALITY (t));
+}
+
+/* Fix up fields of a field_decl T. DATA points to fix-up states. */
+
+static void
+lto_fixup_field_decl (tree t, void *data)
+{
+ lto_fixup_decl_common (t, data);
+ gcc_assert (no_fixup_p (DECL_FIELD_OFFSET (t)));
+ LTO_FIXUP_SUBTREE (DECL_BIT_FIELD_TYPE (t));
+ LTO_FIXUP_SUBTREE (DECL_QUALIFIER (t));
+ gcc_assert (no_fixup_p (DECL_FIELD_BIT_OFFSET (t)));
+ LTO_FIXUP_SUBTREE (DECL_FCONTEXT (t));
+}
+
+/* Fix up fields of a type T. DATA points to fix-up states. */
+
+static void
+lto_fixup_type (tree t, void *data)
+{
+ tree tem, mv;
+
+ lto_fixup_common (t, data);
+ LTO_FIXUP_SUBTREE (TYPE_CACHED_VALUES (t));
+ LTO_FIXUP_SUBTREE (TYPE_SIZE (t));
+ LTO_FIXUP_SUBTREE (TYPE_SIZE_UNIT (t));
+ LTO_FIXUP_SUBTREE (TYPE_ATTRIBUTES (t));
+ LTO_FIXUP_SUBTREE (TYPE_NAME (t));
+
+ /* Accessors are for derived node types only. */
+ if (!POINTER_TYPE_P (t))
+ LTO_FIXUP_SUBTREE (t->type.minval);
+ LTO_FIXUP_SUBTREE (t->type.maxval);
+
+ /* Accessor is for derived node types only. */
+ LTO_FIXUP_SUBTREE (t->type.binfo);
+
+ LTO_REGISTER_TYPE_AND_FIXUP_SUBTREE (TYPE_CONTEXT (t));
+ LTO_REGISTER_TYPE_AND_FIXUP_SUBTREE (TYPE_CANONICAL (t));
+
+ /* The following re-creates proper variant lists while fixing up
+ the variant leaders. We do not stream TYPE_NEXT_VARIANT so the
+ variant list state before fixup is broken. */
+
+ /* Remove us from our main variant list if we are not the variant leader. */
+ if (TYPE_MAIN_VARIANT (t) != t)
+ {
+ tem = TYPE_MAIN_VARIANT (t);
+ while (tem && TYPE_NEXT_VARIANT (tem) != t)
+ tem = TYPE_NEXT_VARIANT (tem);
+ if (tem)
+ TYPE_NEXT_VARIANT (tem) = TYPE_NEXT_VARIANT (t);
+ TYPE_NEXT_VARIANT (t) = NULL_TREE;
+ }
+
+ /* Query our new main variant. */
+ mv = gimple_register_type (TYPE_MAIN_VARIANT (t));
+
+ /* If we were the variant leader and we get replaced ourselves drop
+ all variants from our list. */
+ if (TYPE_MAIN_VARIANT (t) == t
+ && mv != t)
+ {
+ tem = t;
+ while (tem)
+ {
+ tree tem2 = TYPE_NEXT_VARIANT (tem);
+ TYPE_NEXT_VARIANT (tem) = NULL_TREE;
+ tem = tem2;
+ }
+ }
+
+ /* If we are not our own variant leader link us into our new leaders
+ variant list. */
+ if (mv != t)
+ {
+ TYPE_NEXT_VARIANT (t) = TYPE_NEXT_VARIANT (mv);
+ TYPE_NEXT_VARIANT (mv) = t;
+ }
+
+ /* Finally adjust our main variant and fix it up. */
+ TYPE_MAIN_VARIANT (t) = mv;
+ LTO_FIXUP_SUBTREE (TYPE_MAIN_VARIANT (t));
+
+ /* As the second step of reconstructing the pointer chains put us
+ on the list of pointers of the new pointed-to type
+ if we are a main variant. See lto_fixup_common for the first step. */
+ if (TREE_CODE (t) == POINTER_TYPE
+ && TYPE_MAIN_VARIANT (t) == t)
+ {
+ TYPE_NEXT_PTR_TO (t) = TYPE_POINTER_TO (TREE_TYPE (t));
+ TYPE_POINTER_TO (TREE_TYPE (t)) = t;
+ }
+ else if (TREE_CODE (t) == REFERENCE_TYPE
+ && TYPE_MAIN_VARIANT (t) == t)
+ {
+ TYPE_NEXT_REF_TO (t) = TYPE_REFERENCE_TO (TREE_TYPE (t));
+ TYPE_REFERENCE_TO (TREE_TYPE (t)) = t;
+ }
+}
+
+/* Fix up fields of a BINFO T. DATA points to fix-up states. */
+
+static void
+lto_fixup_binfo (tree t, void *data)
+{
+ unsigned HOST_WIDE_INT i, n;
+ tree base, saved_base;
+
+ lto_fixup_common (t, data);
+ gcc_assert (no_fixup_p (BINFO_OFFSET (t)));
+ LTO_FIXUP_SUBTREE (BINFO_VTABLE (t));
+ LTO_FIXUP_SUBTREE (BINFO_VIRTUALS (t));
+ LTO_FIXUP_SUBTREE (BINFO_VPTR_FIELD (t));
+ n = VEC_length (tree, BINFO_BASE_ACCESSES (t));
+ for (i = 0; i < n; i++)
+ {
+ saved_base = base = BINFO_BASE_ACCESS (t, i);
+ LTO_FIXUP_SUBTREE (base);
+ if (base != saved_base)
+ VEC_replace (tree, BINFO_BASE_ACCESSES (t), i, base);
+ }
+ LTO_FIXUP_SUBTREE (BINFO_INHERITANCE_CHAIN (t));
+ LTO_FIXUP_SUBTREE (BINFO_SUBVTT_INDEX (t));
+ LTO_FIXUP_SUBTREE (BINFO_VPTR_INDEX (t));
+ n = BINFO_N_BASE_BINFOS (t);
+ for (i = 0; i < n; i++)
+ {
+ saved_base = base = BINFO_BASE_BINFO (t, i);
+ LTO_FIXUP_SUBTREE (base);
+ if (base != saved_base)
+ VEC_replace (tree, BINFO_BASE_BINFOS (t), i, base);
+ }
+}
+
+/* Fix up fields of a CONSTRUCTOR T. DATA points to fix-up states. */
+
+static void
+lto_fixup_constructor (tree t, void *data)
+{
+ unsigned HOST_WIDE_INT idx;
+ constructor_elt *ce;
+
+ LTO_REGISTER_TYPE_AND_FIXUP_SUBTREE (TREE_TYPE (t));
+
+ for (idx = 0;
+ VEC_iterate(constructor_elt, CONSTRUCTOR_ELTS (t), idx, ce);
+ idx++)
+ {
+ LTO_FIXUP_SUBTREE (ce->index);
+ LTO_FIXUP_SUBTREE (ce->value);
+ }
+}
+
+/* A walk_tree callback used by lto_fixup_state. TP is the pointer to the
+ current tree. WALK_SUBTREES indicates if the subtrees will be walked.
+ DATA is a pointer set to record visited nodes. */
+
+static tree
+lto_fixup_tree (tree *tp, int *walk_subtrees, void *data)
+{
+ tree t;
+ lto_fixup_data_t *fixup_data = (lto_fixup_data_t *) data;
+ tree prevailing;
+
+ t = *tp;
+ *walk_subtrees = 0;
+ if (pointer_set_contains (fixup_data->seen, t))
+ return NULL;
+
+ if (TREE_CODE (t) == VAR_DECL || TREE_CODE (t) == FUNCTION_DECL)
+ {
+ prevailing = lto_symtab_prevailing_decl (t);
+
+ if (t != prevailing)
+ {
+ if (TREE_CODE (t) == FUNCTION_DECL
+ && TREE_NOTHROW (prevailing) != TREE_NOTHROW (t))
+ {
+ /* If the prevailing definition does not throw but the
+ declaration (T) was considered throwing, then we
+ simply add PREVAILING to the list of throwing
+ functions. However, if the opposite is true, then
+ the call to PREVAILING was generated assuming that
+ the function didn't throw, which means that CFG
+ cleanup may have removed surrounding try/catch
+ regions.
+
+ Note that we currently accept these cases even when
+ they occur within a single file. It's certainly a
+ user error, but we silently allow the compiler to
+ remove surrounding try/catch regions. Perhaps we
+ could emit a warning here, instead of silently
+ accepting the conflicting declaration. */
+ if (TREE_NOTHROW (prevailing))
+ lto_mark_nothrow_fndecl (prevailing);
+ }
+
+ /* Also replace t with prevailing defintion. We don't want to
+ insert the other defintion in the seen set as we want to
+ replace all instances of it. */
+ *tp = prevailing;
+ t = prevailing;
+ }
+ }
+ else if (TYPE_P (t))
+ {
+ /* Replace t with the prevailing type. We don't want to insert the
+ other type in the seen set as we want to replace all instances of it. */
+ t = gimple_register_type (t);
+ *tp = t;
+ }
+
+ if (pointer_set_insert (fixup_data->seen, t))
+ return NULL;
+
+ /* walk_tree does not visit all reachable nodes that need to be fixed up.
+ Hence we do special processing here for those kind of nodes. */
+ switch (TREE_CODE (t))
+ {
+ case FIELD_DECL:
+ lto_fixup_field_decl (t, data);
+ break;
+
+ case LABEL_DECL:
+ case CONST_DECL:
+ case PARM_DECL:
+ case RESULT_DECL:
+ case IMPORTED_DECL:
+ lto_fixup_decl_common (t, data);
+ break;
+
+ case VAR_DECL:
+ lto_fixup_decl_with_vis (t, data);
+ break;
+
+ case TYPE_DECL:
+ lto_fixup_decl_non_common (t, data);
+ break;
+
+ case FUNCTION_DECL:
+ lto_fixup_function (t, data);
+ break;
+
+ case TREE_BINFO:
+ lto_fixup_binfo (t, data);
+ break;
+
+ default:
+ if (TYPE_P (t))
+ lto_fixup_type (t, data);
+ else if (TREE_CODE (t) == CONSTRUCTOR)
+ lto_fixup_constructor (t, data);
+ else if (CONSTANT_CLASS_P (t))
+ LTO_REGISTER_TYPE_AND_FIXUP_SUBTREE (TREE_TYPE (t));
+ else if (EXPR_P (t))
+ {
+ /* walk_tree only handles TREE_OPERANDs. Do the rest here. */
+ lto_fixup_common (t, data);
+ LTO_FIXUP_SUBTREE (t->exp.block);
+ *walk_subtrees = 1;
+ }
+ else
+ {
+ /* Let walk_tree handle sub-trees. */
+ *walk_subtrees = 1;
+ }
+ }
+
+ return NULL;
+}
+
+/* Helper function of lto_fixup_decls. Walks the var and fn streams in STATE,
+ replaces var and function decls with the corresponding prevailing def and
+ records the old decl in the free-list in DATA. We also record visted nodes
+ in the seen-set in DATA to avoid multiple visit for nodes that need not
+ to be replaced. */
+
+static void
+lto_fixup_state (struct lto_in_decl_state *state, lto_fixup_data_t *data)
+{
+ unsigned i, si;
+ struct lto_tree_ref_table *table;
+
+ /* Although we only want to replace FUNCTION_DECLs and VAR_DECLs,
+ we still need to walk from all DECLs to find the reachable
+ FUNCTION_DECLs and VAR_DECLs. */
+ for (si = 0; si < LTO_N_DECL_STREAMS; si++)
+ {
+ table = &state->streams[si];
+ for (i = 0; i < table->size; i++)
+ walk_tree (table->trees + i, lto_fixup_tree, data, NULL);
+ }
+}
+
+/* A callback of htab_traverse. Just extract a state from SLOT and the
+ lto_fixup_data_t object from AUX and calls lto_fixup_state. */
+
+static int
+lto_fixup_state_aux (void **slot, void *aux)
+{
+ struct lto_in_decl_state *state = (struct lto_in_decl_state *) *slot;
+ lto_fixup_state (state, (lto_fixup_data_t *) aux);
+ return 1;
+}
+
+/* Fix the decls from all FILES. Replaces each decl with the corresponding
+ prevailing one. */
+
+static void
+lto_fixup_decls (struct lto_file_decl_data **files)
+{
+ unsigned int i;
+ tree decl;
+ struct pointer_set_t *seen = pointer_set_create ();
+ lto_fixup_data_t data;
+
+ data.seen = seen;
+ for (i = 0; files[i]; i++)
+ {
+ struct lto_file_decl_data *file = files[i];
+ struct lto_in_decl_state *state = file->global_decl_state;
+ lto_fixup_state (state, &data);
+
+ htab_traverse (file->function_decl_states, lto_fixup_state_aux, &data);
+ }
+
+ for (i = 0; VEC_iterate (tree, lto_global_var_decls, i, decl); i++)
+ {
+ tree saved_decl = decl;
+ walk_tree (&decl, lto_fixup_tree, &data, NULL);
+ if (decl != saved_decl)
+ VEC_replace (tree, lto_global_var_decls, i, decl);
+ }
+
+ pointer_set_destroy (seen);
+}
+
+/* Unlink a temporary LTRANS file unless requested otherwise. */
+
+static void
+lto_maybe_unlink (const char *file)
+{
+ if (!getenv ("WPA_SAVE_LTRANS"))
+ {
+ if (unlink_if_ordinary (file))
+ error ("deleting LTRANS input file %s: %m", file);
+ }
+ else
+ fprintf (stderr, "[Leaving LTRANS input file %s]\n", file);
+}
+
+/* Read the options saved from each file in the command line. Called
+ from lang_hooks.post_options which is called by process_options
+ right before all the options are used to initialize the compiler.
+ This assumes that decode_options has already run, so the
+ num_in_fnames and in_fnames are properly set.
+
+ Note that this assumes that all the files had been compiled with
+ the same options, which is not a good assumption. In general,
+ options ought to be read from all the files in the set and merged.
+ However, it is still unclear what the merge rules should be. */
+
+void
+lto_read_all_file_options (void)
+{
+ size_t i;
+
+ /* Clear any file options currently saved. */
+ lto_clear_file_options ();
+
+ /* Set the hooks to read ELF sections. */
+ lto_set_in_hooks (NULL, get_section_data, free_section_data);
+
+ for (i = 0; i < num_in_fnames; i++)
+ {
+ struct lto_file_decl_data *file_data;
+ lto_file *file = lto_elf_file_open (in_fnames[i], false);
+ if (!file)
+ break;
+
+ file_data = XCNEW (struct lto_file_decl_data);
+ file_data->file_name = file->filename;
+ file_data->section_hash_table = lto_elf_build_section_table (file);
+
+ lto_read_file_options (file_data);
+
+ lto_elf_file_close (file);
+ htab_delete (file_data->section_hash_table);
+ free (file_data);
+ }
+
+ /* Apply globally the options read from all the files. */
+ lto_reissue_options ();
+}
+
+
+/* Read all the symbols from the input files FNAMES. NFILES is the
+ number of files requested in the command line. Instantiate a
+ global call graph by aggregating all the sub-graphs found in each
+ file. */
+
+static void
+read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
+{
+ unsigned int i, last_file_ix;
+ struct lto_file_decl_data **all_file_decl_data;
+ FILE *resolution;
+ struct cgraph_node *node;
+
+ lto_stats.num_input_files = nfiles;
+
+ timevar_push (TV_IPA_LTO_DECL_IO);
+
+ /* Set the hooks so that all of the ipa passes can read in their data. */
+ all_file_decl_data = XNEWVEC (struct lto_file_decl_data *, nfiles + 1);
+ lto_set_in_hooks (all_file_decl_data, get_section_data, free_section_data);
+
+ /* Read the resolution file. */
+ resolution = NULL;
+ if (resolution_file_name)
+ {
+ int t;
+ unsigned num_objects;
+
+ resolution = fopen (resolution_file_name, "r");
+ if (resolution == NULL)
+ fatal_error ("could not open symbol resolution file: %s",
+ xstrerror (errno));
+
+ t = fscanf (resolution, "%u", &num_objects);
+ gcc_assert (t == 1);
+
+ /* True, since the plugin splits the archives. */
+ gcc_assert (num_objects == nfiles);
+ }
+
+ /* Read all of the object files specified on the command line. */
+ for (i = 0, last_file_ix = 0; i < nfiles; ++i)
+ {
+ struct lto_file_decl_data *file_data = NULL;
+
+ current_lto_file = lto_elf_file_open (fnames[i], false);
+ if (!current_lto_file)
+ break;
+
+ file_data = lto_file_read (current_lto_file, resolution);
+ if (!file_data)
+ break;
+
+ all_file_decl_data[last_file_ix++] = file_data;
+
+ lto_elf_file_close (current_lto_file);
+ current_lto_file = NULL;
+ }
+
+ if (resolution_file_name)
+ fclose (resolution);
+
+ all_file_decl_data[last_file_ix] = NULL;
+
+ /* Set the hooks so that all of the ipa passes can read in their data. */
+ lto_set_in_hooks (all_file_decl_data, get_section_data, free_section_data);
+
+ /* Each pass will set the appropriate timer. */
+ timevar_pop (TV_IPA_LTO_DECL_IO);
+
+ /* Read the callgraph. */
+ input_cgraph ();
+
+ /* Merge global decls. */
+ lto_symtab_merge_decls ();
+
+ /* Fixup all decls and types and free the type hash tables. */
+ lto_fixup_decls (all_file_decl_data);
+ free_gimple_type_tables ();
+
+ /* Read the IPA summary data. */
+ ipa_read_summaries ();
+
+ /* Finally merge the cgraph according to the decl merging decisions. */
+ lto_symtab_merge_cgraph_nodes ();
+
+ /* Mark cgraph nodes needed in the merged cgraph
+ This normally happens in whole-program pass, but for
+ ltrans the pass was already run at WPA phase.
+
+ FIXME: This is not valid way to do so; nodes can be needed
+ for non-obvious reasons. We should stream the flags from WPA
+ phase. */
+ if (flag_ltrans)
+ for (node = cgraph_nodes; node; node = node->next)
+ if (!node->global.inlined_to
+ && cgraph_decide_is_function_needed (node, node->decl))
+ cgraph_mark_needed_node (node);
+
+ timevar_push (TV_IPA_LTO_DECL_IO);
+
+ /* FIXME lto. This loop needs to be changed to use the pass manager to
+ call the ipa passes directly. */
+ if (!errorcount)
+ for (i = 0; i < last_file_ix; i++)
+ {
+ struct lto_file_decl_data *file_data = all_file_decl_data [i];
+ lto_materialize_constructors_and_inits (file_data);
+ }
+
+ /* Indicate that the cgraph is built and ready. */
+ cgraph_function_flags_ready = true;
+
+ timevar_pop (TV_IPA_LTO_DECL_IO);
+}
+
+
+/* Materialize all the bodies for all the nodes in the callgraph. */
+
+static void
+materialize_cgraph (void)
+{
+ tree decl;
+ struct cgraph_node *node;
+ unsigned i;
+ timevar_id_t lto_timer;
+
+ /* Now that we have input the cgraph, we need to clear all of the aux
+ nodes and read the functions if we are not running in WPA mode. */
+ timevar_push (TV_IPA_LTO_GIMPLE_IO);
+
+ for (node = cgraph_nodes; node; node = node->next)
+ {
+ /* Some cgraph nodes get created on the fly, and they don't need
+ to be materialized. For instance, nodes for nested functions
+ where the parent function was not streamed out or builtin
+ functions. Additionally, builtin functions should not be
+ materialized and may, in fact, cause confusion because there
+ may be a regular function in the file whose assembler name
+ matches that of the function.
+ See gcc.c-torture/execute/20030125-1.c and
+ gcc.c-torture/execute/921215-1.c. */
+ if (node->local.lto_file_data
+ && !DECL_IS_BUILTIN (node->decl))
+ {
+ lto_materialize_function (node);
+ lto_stats.num_input_cgraph_nodes++;
+ }
+ }
+
+ timevar_pop (TV_IPA_LTO_GIMPLE_IO);
+
+ /* Start the appropriate timer depending on the mode that we are
+ operating in. */
+ lto_timer = (flag_wpa) ? TV_WHOPR_WPA
+ : (flag_ltrans) ? TV_WHOPR_LTRANS
+ : TV_LTO;
+ timevar_push (lto_timer);
+
+ current_function_decl = NULL;
+ set_cfun (NULL);
+
+ /* Inform the middle end about the global variables we have seen. */
+ for (i = 0; VEC_iterate (tree, lto_global_var_decls, i, decl); i++)
+ rest_of_decl_compilation (decl, 1, 0);
+
+ /* Fix up any calls to DECLs that have become not exception throwing. */
+ lto_fixup_nothrow_decls ();
+
+ timevar_pop (lto_timer);
+}
+
+
+/* Perform whole program analysis (WPA) on the callgraph and write out the
+ optimization plan. */
+
+static void
+do_whole_program_analysis (void)
+{
+ char **output_files;
+ size_t i;
+ struct cgraph_node *node;
+
+ lto_1_to_1_map ();
+
+ /* Note that since we are in WPA mode, materialize_cgraph will not
+ actually read in all the function bodies. It only materializes
+ the decls and cgraph nodes so that analysis can be performed. */
+ materialize_cgraph ();
+
+ /* Reading in the cgraph uses different timers, start timing WPA now. */
+ timevar_push (TV_WHOPR_WPA);
+
+ /* FIXME lto. Hack. We should use the IPA passes. There are a
+ number of issues with this now. 1. There is no convenient way to
+ do this. 2. Some passes may depend on properties that requires
+ the function bodies to compute. */
+ cgraph_function_flags_ready = true;
+ bitmap_obstack_initialize (NULL);
+ ipa_register_cgraph_hooks ();
+
+ /* Reset inlining information before running IPA inliner. */
+ for (node = cgraph_nodes; node; node = node->next)
+ reset_inline_failed (node);
+
+ /* FIXME lto. We should not call this function directly. */
+ pass_ipa_inline.pass.execute ();
+
+ verify_cgraph ();
+ bitmap_obstack_release (NULL);
+
+ /* We are about to launch the final LTRANS phase, stop the WPA timer. */
+ timevar_pop (TV_WHOPR_WPA);
+
+ output_files = lto_wpa_write_files ();
+
+ /* Show the LTO report before launching LTRANS. */
+ if (flag_lto_report)
+ print_lto_report ();
+
+ lto_execute_ltrans (output_files);
+
+ for (i = 0; output_files[i]; ++i)
+ {
+ if (output_files[i][0] != '*')
+ lto_maybe_unlink (output_files[i]);
+
+ free (output_files[i]);
+ }
+
+ XDELETEVEC (output_files);
+}
+
+
+/* Main entry point for the GIMPLE front end. This front end has
+ three main personalities:
+
+ - LTO (-flto). All the object files on the command line are
+ loaded in memory and processed as a single translation unit.
+ This is the traditional link-time optimization behavior.
+
+ - WPA (-fwpa). Only the callgraph and summary information for
+ files in the command file are loaded. A single callgraph
+ (without function bodies) is instantiated for the whole set of
+ files. IPA passes are only allowed to analyze the call graph
+ and make transformation decisions. The callgraph is
+ partitioned, each partition is written to a new object file
+ together with the transformation decisions.
+
+ - LTRANS (-fltrans). Similar to -flto but it prevents the IPA
+ summary files from running again. Since WPA computed summary
+ information and decided what transformations to apply, LTRANS
+ simply applies them. */
+
+void
+lto_main (int debug_p ATTRIBUTE_UNUSED)
+{
+ lto_init_reader ();
+
+ /* Read all the symbols and call graph from all the files in the
+ command line. */
+ read_cgraph_and_symbols (num_in_fnames, in_fnames);
+
+ if (!errorcount)
+ {
+ /* If WPA is enabled analyze the whole call graph and create an
+ optimization plan. Otherwise, read in all the function
+ bodies and continue with optimization. */
+ if (flag_wpa)
+ do_whole_program_analysis ();
+ else
+ {
+ materialize_cgraph ();
+
+ /* Let the middle end know that we have read and merged all of
+ the input files. */
+ cgraph_optimize ();
+
+ /* FIXME lto, if the processes spawned by WPA fail, we miss
+ the chance to print WPA's report, so WPA will call
+ print_lto_report before launching LTRANS. If LTRANS was
+ launched directly by the driver we would not need to do
+ this. */
+ if (flag_lto_report)
+ print_lto_report ();
+ }
+ }
+}
+
+#include "gt-lto-lto.h"
diff --git a/gcc/lto/lto.h b/gcc/lto/lto.h
new file mode 100644
index 00000000000..cdd1e06de93
--- /dev/null
+++ b/gcc/lto/lto.h
@@ -0,0 +1,60 @@
+/* LTO declarations.
+ Copyright 2009 Free Software Foundation, Inc.
+ Contributed by CodeSourcery, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef LTO_H
+#define LTO_H
+
+#include "hashtab.h"
+
+/* A file. */
+typedef struct lto_file_struct
+{
+ /* The name of the file. */
+ const char *filename;
+} lto_file;
+
+/* In lto-lang.c */
+extern const char *resolution_file_name;
+
+/* In lto.c */
+extern void lto_main (int);
+extern void lto_read_all_file_options (void);
+
+/* In lto-elf.c */
+extern lto_file *lto_elf_file_open (const char *filename, bool writable);
+extern void lto_elf_file_close (lto_file *file);
+extern htab_t lto_elf_build_section_table (lto_file *file);
+extern void lto_elf_begin_section (const char *name);
+extern void lto_elf_append_data (const void *data, size_t len, void *block);
+extern void lto_elf_end_section (void);
+extern lto_file *lto_set_current_out_file (lto_file *file);
+extern lto_file *lto_get_current_out_file (void);
+
+/* Hash table entry to hold the start offset and length of an LTO
+ section in a .o file. */
+struct lto_section_slot
+{
+ const char *name;
+ intptr_t start;
+ size_t len;
+};
+
+
+#endif /* LTO_H */
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 1c136236060..39257f5a6c3 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -1595,11 +1595,11 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
unsigned int bits = GET_MODE_BITSIZE (mode);
if (CONST_INT_P (op1))
- newop1 = GEN_INT (bits - INTVAL (op1));
+ newop1 = GEN_INT (bits - INTVAL (op1));
else if (targetm.shift_truncation_mask (mode) == bits - 1)
- newop1 = negate_rtx (mode, op1);
+ newop1 = negate_rtx (GET_MODE (op1), op1);
else
- newop1 = expand_binop (mode, sub_optab,
+ newop1 = expand_binop (GET_MODE (op1), sub_optab,
GEN_INT (bits), op1,
NULL_RTX, unsignedp, OPTAB_DIRECT);
diff --git a/gcc/optc-gen.awk b/gcc/optc-gen.awk
index 2117150f4d1..992e4d316ac 100644
--- a/gcc/optc-gen.awk
+++ b/gcc/optc-gen.awk
@@ -327,6 +327,7 @@ for (i = 0; i < n_opt_char; i++) {
print " " var_opt_char[i] " = ptr->" var_opt_char[i] ";";
}
+print " targetm.override_options_after_change ();";
print "}";
print "";
diff --git a/gcc/opts.c b/gcc/opts.c
index 0e505181799..878d9587c46 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -44,6 +44,7 @@ along with GCC; see the file COPYING3. If not see
#include "debug.h"
#include "plugin.h"
#include "except.h"
+#include "lto-streamer.h"
/* Value of the -G xx switch, and whether it was passed or not. */
unsigned HOST_WIDE_INT g_switch_value;
@@ -432,6 +433,17 @@ complain_wrong_lang (const char *text, const struct cl_option *option,
{
char *ok_langs, *bad_lang;
+ /* The LTO front end inherits all the options from the first front
+ end that was used. However, not all the original front end
+ options make sense in LTO.
+
+ A real solution would be to filter this in collect2, but collect2
+ does not have access to all the option attributes to know what to
+ filter. So, in lto1 we silently accept inherited flags and do
+ nothing about it. */
+ if (lang_mask & CL_LTO)
+ return;
+
ok_langs = write_langs (option->flags);
bad_lang = write_langs (lang_mask);
@@ -598,44 +610,31 @@ handle_option (const char **argv, unsigned int lang_mask)
}
if (option->flag_var)
- switch (option->var_type)
- {
- case CLVC_BOOLEAN:
- *(int *) option->flag_var = value;
- break;
-
- case CLVC_EQUAL:
- *(int *) option->flag_var = (value
- ? option->var_value
- : !option->var_value);
- break;
-
- case CLVC_BIT_CLEAR:
- case CLVC_BIT_SET:
- if ((value != 0) == (option->var_type == CLVC_BIT_SET))
- *(int *) option->flag_var |= option->var_value;
- else
- *(int *) option->flag_var &= ~option->var_value;
- if (option->flag_var == &target_flags)
- target_flags_explicit |= option->var_value;
- break;
-
- case CLVC_STRING:
- *(const char **) option->flag_var = arg;
- break;
- }
+ set_option (option, value, arg);
if (option->flags & lang_mask)
- if (lang_hooks.handle_option (opt_index, arg, value) == 0)
- result = 0;
+ {
+ if (lang_hooks.handle_option (opt_index, arg, value) == 0)
+ result = 0;
+ else
+ lto_register_user_option (opt_index, arg, value, lang_mask);
+ }
if (result && (option->flags & CL_COMMON))
- if (common_handle_option (opt_index, arg, value, lang_mask) == 0)
- result = 0;
+ {
+ if (common_handle_option (opt_index, arg, value, lang_mask) == 0)
+ result = 0;
+ else
+ lto_register_user_option (opt_index, arg, value, CL_COMMON);
+ }
if (result && (option->flags & CL_TARGET))
- if (!targetm.handle_option (opt_index, arg, value))
- result = 0;
+ {
+ if (!targetm.handle_option (opt_index, arg, value))
+ result = 0;
+ else
+ lto_register_user_option (opt_index, arg, value, CL_TARGET);
+ }
done:
if (dup)
@@ -898,6 +897,7 @@ decode_options (unsigned int argc, const char **argv)
flag_tree_pre = opt2;
flag_tree_switch_conversion = 1;
flag_ipa_cp = opt2;
+ flag_ipa_sra = opt2;
/* Track fields in field-sensitive alias analysis. */
set_param_value ("max-fields-for-field-sensitive",
@@ -958,6 +958,9 @@ decode_options (unsigned int argc, const char **argv)
flag_unwind_tables = targetm.unwind_tables_default;
}
+ /* Clear any options currently held for LTO. */
+ lto_clear_user_options ();
+
#ifdef OPTIMIZATION_OPTIONS
/* Allow default optimizations to be specified on a per-machine basis. */
OPTIMIZATION_OPTIONS (optimize, optimize_size);
@@ -1114,6 +1117,28 @@ decode_options (unsigned int argc, const char **argv)
PARAM_VALUE (PARAM_STACK_FRAME_GROWTH) = 40;
}
+ if (flag_lto || flag_whopr)
+ {
+#ifdef ENABLE_LTO
+ flag_generate_lto = 1;
+
+ /* When generating IL, do not operate in whole-program mode.
+ Otherwise, symbols will be privatized too early, causing link
+ errors later. */
+ flag_whole_program = 0;
+
+ /* FIXME lto. Disable var-tracking until debug information
+ is properly handled in free_lang_data. */
+ flag_var_tracking = 0;
+#else
+ error ("LTO support has not been enabled in this configuration");
+#endif
+ }
+
+ /* Reconcile -flto and -fwhopr. Set additional flags as appropriate and
+ check option consistency. */
+ if (flag_lto && flag_whopr)
+ error ("-flto and -fwhopr are mutually exclusive");
}
#define LEFT_COLUMN 27
@@ -2099,6 +2124,10 @@ common_handle_option (size_t scode, const char *arg, int value,
/* These are no-ops, preserved for backward compatibility. */
break;
+ case OPT_fuse_linker_plugin:
+ /* No-op. Used by the driver and passed to us because it starts with f.*/
+ break;
+
default:
/* If the flag was handled in a standard way, assume the lack of
processing here is intentional. */
@@ -2321,6 +2350,42 @@ get_option_state (int option, struct cl_option_state *state)
return true;
}
+/* Set *OPTION according to VALUE and ARG. */
+
+void
+set_option (const struct cl_option *option, int value, const char *arg)
+{
+ if (!option->flag_var)
+ return;
+
+ switch (option->var_type)
+ {
+ case CLVC_BOOLEAN:
+ *(int *) option->flag_var = value;
+ break;
+
+ case CLVC_EQUAL:
+ *(int *) option->flag_var = (value
+ ? option->var_value
+ : !option->var_value);
+ break;
+
+ case CLVC_BIT_CLEAR:
+ case CLVC_BIT_SET:
+ if ((value != 0) == (option->var_type == CLVC_BIT_SET))
+ *(int *) option->flag_var |= option->var_value;
+ else
+ *(int *) option->flag_var &= ~option->var_value;
+ if (option->flag_var == &target_flags)
+ target_flags_explicit |= option->var_value;
+ break;
+
+ case CLVC_STRING:
+ *(const char **) option->flag_var = arg;
+ break;
+ }
+}
+
/* Enable a warning option as an error. This is used by -Werror= and
also by legacy Werror-implicit-function-declaration. */
diff --git a/gcc/opts.h b/gcc/opts.h
index b4be1111675..a2eef1938c7 100644
--- a/gcc/opts.h
+++ b/gcc/opts.h
@@ -103,6 +103,7 @@ extern void prune_options (int *argcp, char ***argvp);
extern void decode_options (unsigned int argc, const char **argv);
extern int option_enabled (int opt_idx);
extern bool get_option_state (int, struct cl_option_state *);
+extern void set_option (const struct cl_option *, int, const char *);
extern void enable_warning_as_error (const char *arg, int value,
unsigned int lang_mask);
diff --git a/gcc/output.h b/gcc/output.h
index 9e2b704920a..5d771d7d06f 100644
--- a/gcc/output.h
+++ b/gcc/output.h
@@ -626,7 +626,6 @@ extern void default_emit_except_table_label (FILE *);
extern void default_internal_label (FILE *, const char *, unsigned long);
extern void default_file_start (void);
extern void file_end_indicate_exec_stack (void);
-extern bool default_valid_pointer_mode (enum machine_mode);
extern void default_elf_asm_output_external (FILE *file, tree,
const char *);
diff --git a/gcc/params.def b/gcc/params.def
index 051398573e6..21cfbdc7fec 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -719,6 +719,11 @@ DEFPARAM (PARAM_IRA_MAX_CONFLICT_TABLE_SIZE,
"max size of conflict table in MB",
1000, 0, 0)
+DEFPARAM (PARAM_IRA_LOOP_RESERVED_REGS,
+ "ira-loop-reserved-regs",
+ "The number of registers in each class kept unused by loop invariant motion",
+ 2, 0, 0)
+
/* Switch initialization conversion will refuse to create arrays that are
bigger than this parameter times the number of switch branches. */
diff --git a/gcc/params.h b/gcc/params.h
index 67a7a05c3de..56db145e1f6 100644
--- a/gcc/params.h
+++ b/gcc/params.h
@@ -160,6 +160,8 @@ typedef enum compiler_param
PARAM_VALUE (PARAM_IRA_MAX_LOOPS_NUM)
#define IRA_MAX_CONFLICT_TABLE_SIZE \
PARAM_VALUE (PARAM_IRA_MAX_CONFLICT_TABLE_SIZE)
+#define IRA_LOOP_RESERVED_REGS \
+ PARAM_VALUE (PARAM_IRA_LOOP_RESERVED_REGS)
#define SWITCH_CONVERSION_BRANCH_RATIO \
PARAM_VALUE (PARAM_SWITCH_CONVERSION_BRANCH_RATIO)
#define LOOP_INVARIANT_MAX_BBS_IN_LOOP \
diff --git a/gcc/passes.c b/gcc/passes.c
index 5b91698e179..80225490cbd 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -84,6 +84,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-dump.h"
#include "df.h"
#include "predict.h"
+#include "lto-streamer.h"
#if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
#include "dwarf2out.h"
@@ -331,7 +332,8 @@ struct rtl_opt_pass pass_postreload =
/* The root of the compilation pass tree, once constructed. */
-struct opt_pass *all_passes, *all_ipa_passes, *all_lowering_passes;
+struct opt_pass *all_passes, *all_small_ipa_passes, *all_lowering_passes,
+ *all_regular_ipa_passes, *all_lto_gen_passes;
/* A map from static pass id to optimization pass. */
struct opt_pass **passes_by_id;
@@ -598,22 +600,31 @@ position_pass (struct register_pass_info *new_pass_info,
void
register_pass (struct register_pass_info *pass_info)
{
+ /* The checks below could fail in buggy plugins. Existing GCC
+ passes should never fail these checks, so we mention plugin in
+ the messages. */
if (!pass_info->pass)
- {
- gcc_unreachable ();
- }
+ fatal_error ("plugin cannot register a missing pass");
+
+ if (!pass_info->pass->name)
+ fatal_error ("plugin cannot register an unnamed pass");
if (!pass_info->reference_pass_name)
- {
- gcc_unreachable ();
- }
+ fatal_error
+ ("plugin cannot register pass %qs without reference pass name",
+ pass_info->pass->name);
- /* Try to insert the new pass to the pass lists. We need to check all
- three lists as the reference pass could be in one (or all) of them. */
+ /* Try to insert the new pass to the pass lists. We need to check
+ all three lists as the reference pass could be in one (or all) of
+ them. */
if (!position_pass (pass_info, &all_lowering_passes)
- && !position_pass (pass_info, &all_ipa_passes)
+ && !position_pass (pass_info, &all_small_ipa_passes)
+ && !position_pass (pass_info, &all_regular_ipa_passes)
+ && !position_pass (pass_info, &all_lto_gen_passes)
&& !position_pass (pass_info, &all_passes))
- gcc_unreachable ();
+ fatal_error
+ ("pass %qs not found but is referenced by new pass %qs",
+ pass_info->reference_pass_name, pass_info->pass->name);
else
{
/* OK, we have successfully inserted the new pass. We need to register
@@ -658,7 +669,7 @@ register_pass (struct register_pass_info *pass_info)
If we are optimizing, cgraph_optimize is then invoked:
cgraph_optimize ()
- ipa_passes () -> all_ipa_passes
+ ipa_passes () -> all_small_ipa_passes
cgraph_expand_all_functions ()
for each node N in the cgraph
cgraph_expand_function (N)
@@ -679,7 +690,6 @@ init_optimization_passes (void)
p = &all_lowering_passes;
NEXT_PASS (pass_warn_unused_result);
NEXT_PASS (pass_diagnose_omp_blocks);
- NEXT_PASS (pass_remove_useless_stmts);
NEXT_PASS (pass_mudflap_1);
NEXT_PASS (pass_lower_omp);
NEXT_PASS (pass_lower_cf);
@@ -694,7 +704,7 @@ init_optimization_passes (void)
*p = NULL;
/* Interprocedural optimization passes. */
- p = &all_ipa_passes;
+ p = &all_small_ipa_passes;
NEXT_PASS (pass_ipa_function_and_variable_visibility);
NEXT_PASS (pass_ipa_early_inline);
{
@@ -716,11 +726,16 @@ init_optimization_passes (void)
NEXT_PASS (pass_referenced_vars);
NEXT_PASS (pass_build_ssa);
NEXT_PASS (pass_early_warn_uninitialized);
+ /* Note that it is not strictly necessary to schedule an early
+ inline pass here. However, some test cases (e.g.,
+ g++.dg/other/p334435.C g++.dg/other/i386-1.C) expect extern
+ inline functions to be inlined even at -O0. This does not
+ happen during the first early inline pass. */
+ NEXT_PASS (pass_rebuild_cgraph_edges);
+ NEXT_PASS (pass_early_inline);
NEXT_PASS (pass_all_early_optimizations);
{
struct opt_pass **p = &pass_all_early_optimizations.pass.sub;
- NEXT_PASS (pass_rebuild_cgraph_edges);
- NEXT_PASS (pass_early_inline);
NEXT_PASS (pass_remove_cgraph_callee_edges);
NEXT_PASS (pass_rename_ssa_copies);
NEXT_PASS (pass_ccp);
@@ -747,13 +762,23 @@ init_optimization_passes (void)
}
NEXT_PASS (pass_ipa_increase_alignment);
NEXT_PASS (pass_ipa_matrix_reorg);
+ *p = NULL;
+
+ p = &all_regular_ipa_passes;
+ NEXT_PASS (pass_ipa_whole_program_visibility);
NEXT_PASS (pass_ipa_cp);
NEXT_PASS (pass_ipa_inline);
NEXT_PASS (pass_ipa_reference);
NEXT_PASS (pass_ipa_pure_const);
NEXT_PASS (pass_ipa_type_escape);
NEXT_PASS (pass_ipa_pta);
- NEXT_PASS (pass_ipa_struct_reorg);
+ NEXT_PASS (pass_ipa_struct_reorg);
+ *p = NULL;
+
+ p = &all_lto_gen_passes;
+ NEXT_PASS (pass_ipa_lto_gimple_out);
+ NEXT_PASS (pass_ipa_lto_wpa_fixup);
+ NEXT_PASS (pass_ipa_lto_finish_out); /* This must be the last LTO pass. */
*p = NULL;
/* These passes are run after IPA passes on every function that is being
@@ -855,7 +880,6 @@ init_optimization_passes (void)
NEXT_PASS (pass_tree_loop_done);
}
NEXT_PASS (pass_cse_reciprocals);
- NEXT_PASS (pass_convert_to_rsqrt);
NEXT_PASS (pass_reassoc);
NEXT_PASS (pass_vrp);
NEXT_PASS (pass_dominator);
@@ -918,6 +942,7 @@ init_optimization_passes (void)
NEXT_PASS (pass_rtl_store_motion);
NEXT_PASS (pass_cse_after_global_opts);
NEXT_PASS (pass_rtl_ifcvt);
+ NEXT_PASS (pass_reginfo_init);
/* Perform loop optimizations. It might be better to do them a bit
sooner, but we want the profile feedback to work more
efficiently. */
@@ -937,7 +962,6 @@ init_optimization_passes (void)
NEXT_PASS (pass_cse2);
NEXT_PASS (pass_rtl_dse1);
NEXT_PASS (pass_rtl_fwprop_addr);
- NEXT_PASS (pass_reginfo_init);
NEXT_PASS (pass_inc_dec);
NEXT_PASS (pass_initialize_regs);
NEXT_PASS (pass_ud_rtl_dce);
@@ -953,10 +977,8 @@ init_optimization_passes (void)
NEXT_PASS (pass_mode_switching);
NEXT_PASS (pass_match_asm_constraints);
NEXT_PASS (pass_sms);
- NEXT_PASS (pass_subregs_of_mode_init);
NEXT_PASS (pass_sched);
NEXT_PASS (pass_ira);
- NEXT_PASS (pass_subregs_of_mode_finish);
NEXT_PASS (pass_postreload);
{
struct opt_pass **p = &pass_postreload.pass.sub;
@@ -1005,7 +1027,13 @@ init_optimization_passes (void)
/* Register the passes with the tree dump code. */
register_dump_files (all_lowering_passes, PROP_gimple_any);
- register_dump_files (all_ipa_passes,
+ register_dump_files (all_small_ipa_passes,
+ PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh
+ | PROP_cfg);
+ register_dump_files (all_regular_ipa_passes,
+ PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh
+ | PROP_cfg);
+ register_dump_files (all_lto_gen_passes,
PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh
| PROP_cfg);
register_dump_files (all_passes,
@@ -1032,8 +1060,11 @@ do_per_function (void (*callback) (void *data), void *data)
push_cfun (DECL_STRUCT_FUNCTION (node->decl));
current_function_decl = node->decl;
callback (data);
- free_dominance_info (CDI_DOMINATORS);
- free_dominance_info (CDI_POST_DOMINATORS);
+ if (!flag_wpa)
+ {
+ free_dominance_info (CDI_DOMINATORS);
+ free_dominance_info (CDI_POST_DOMINATORS);
+ }
current_function_decl = NULL;
pop_cfun ();
ggc_collect ();
@@ -1072,7 +1103,7 @@ do_per_function_toporder (void (*callback) (void *data), void *data)
/* Allow possibly removed nodes to be garbage collected. */
order[i] = NULL;
node->process = 0;
- if (node->analyzed && (node->needed || node->reachable))
+ if (node->analyzed)
{
push_cfun (DECL_STRUCT_FUNCTION (node->decl));
current_function_decl = node->decl;
@@ -1346,7 +1377,7 @@ add_ipa_transform_pass (void *data)
/* Execute summary generation for all of the passes in IPA_PASS. */
-static void
+void
execute_ipa_summary_passes (struct ipa_opt_pass_d *ipa_pass)
{
while (ipa_pass)
@@ -1355,10 +1386,21 @@ execute_ipa_summary_passes (struct ipa_opt_pass_d *ipa_pass)
/* Execute all of the IPA_PASSes in the list. */
if (ipa_pass->pass.type == IPA_PASS
- && (!pass->gate || pass->gate ()))
+ && (!pass->gate || pass->gate ())
+ && ipa_pass->generate_summary)
{
pass_init_dump_file (pass);
+
+ /* If a timevar is present, start it. */
+ if (pass->tv_id)
+ timevar_push (pass->tv_id);
+
ipa_pass->generate_summary ();
+
+ /* Stop timevar. */
+ if (pass->tv_id)
+ timevar_pop (pass->tv_id);
+
pass_fini_dump_file (pass);
}
ipa_pass = (struct ipa_opt_pass_d *)ipa_pass->pass.next;
@@ -1407,19 +1449,11 @@ execute_one_ipa_transform_pass (struct cgraph_node *node,
current_pass = NULL;
}
-static bool
-execute_one_pass (struct opt_pass *pass)
-{
- bool initializing_dump;
- unsigned int todo_after = 0;
-
- /* IPA passes are executed on whole program, so cfun should be NULL.
- Other passes need function context set. */
- if (pass->type == SIMPLE_IPA_PASS || pass->type == IPA_PASS)
- gcc_assert (!cfun && !current_function_decl);
- else
- gcc_assert (cfun && current_function_decl);
+/* For the current function, execute all ipa transforms. */
+void
+execute_all_ipa_transforms (void)
+{
if (cfun && cfun->ipa_transforms_to_apply)
{
unsigned int i;
@@ -1428,12 +1462,28 @@ execute_one_pass (struct opt_pass *pass)
for (i = 0; i < VEC_length (ipa_opt_pass, cfun->ipa_transforms_to_apply);
i++)
execute_one_ipa_transform_pass (node,
- VEC_index (ipa_opt_pass,
+ VEC_index (ipa_opt_pass,
cfun->ipa_transforms_to_apply,
i));
VEC_free (ipa_opt_pass, heap, cfun->ipa_transforms_to_apply);
cfun->ipa_transforms_to_apply = NULL;
}
+}
+
+/* Execute PASS. */
+
+static bool
+execute_one_pass (struct opt_pass *pass)
+{
+ bool initializing_dump;
+ unsigned int todo_after = 0;
+
+ /* IPA passes are executed on whole program, so cfun should be NULL.
+ Other passes need function context set. */
+ if (pass->type == SIMPLE_IPA_PASS || pass->type == IPA_PASS)
+ gcc_assert (!cfun && !current_function_decl);
+ else
+ gcc_assert (cfun && current_function_decl);
current_pass = pass;
@@ -1522,26 +1572,161 @@ execute_pass_list (struct opt_pass *pass)
}
/* Same as execute_pass_list but assume that subpasses of IPA passes
- are local passes. */
+ are local passes. If SET is not NULL, write out summaries of only
+ those node in SET. */
+
+static void
+ipa_write_summaries_2 (struct opt_pass *pass, cgraph_node_set set,
+ struct lto_out_decl_state *state)
+{
+ while (pass)
+ {
+ struct ipa_opt_pass_d *ipa_pass = (struct ipa_opt_pass_d *)pass;
+ gcc_assert (!current_function_decl);
+ gcc_assert (!cfun);
+ gcc_assert (pass->type == SIMPLE_IPA_PASS || pass->type == IPA_PASS);
+ if (pass->type == IPA_PASS
+ && ipa_pass->write_summary
+ && (!pass->gate || pass->gate ()))
+ {
+ /* If a timevar is present, start it. */
+ if (pass->tv_id)
+ timevar_push (pass->tv_id);
+
+ ipa_pass->write_summary (set);
+
+ /* If a timevar is present, start it. */
+ if (pass->tv_id)
+ timevar_pop (pass->tv_id);
+ }
+
+ if (pass->sub && pass->sub->type != GIMPLE_PASS)
+ ipa_write_summaries_2 (pass->sub, set, state);
+
+ pass = pass->next;
+ }
+}
+
+/* Helper function of ipa_write_summaries. Creates and destroys the
+ decl state and calls ipa_write_summaries_2 for all passes that have
+ summaries. SET is the set of nodes to be written. */
+
+static void
+ipa_write_summaries_1 (cgraph_node_set set)
+{
+ struct lto_out_decl_state *state = lto_new_out_decl_state ();
+ lto_push_out_decl_state (state);
+
+ if (!flag_wpa)
+ ipa_write_summaries_2 (all_regular_ipa_passes, set, state);
+ ipa_write_summaries_2 (all_lto_gen_passes, set, state);
+
+ gcc_assert (lto_get_out_decl_state () == state);
+ lto_pop_out_decl_state ();
+ lto_delete_out_decl_state (state);
+}
+
+/* Write out summaries for all the nodes in the callgraph. */
+
void
-execute_ipa_pass_list (struct opt_pass *pass)
+ipa_write_summaries (void)
{
- bool summaries_generated = false;
- do
+ cgraph_node_set set;
+ struct cgraph_node **order;
+ int i, order_pos;
+
+ if (!flag_generate_lto || errorcount || sorrycount)
+ return;
+
+ lto_new_extern_inline_states ();
+ set = cgraph_node_set_new ();
+
+ /* Create the callgraph set in the same order used in
+ cgraph_expand_all_functions. This mostly facilitates debugging,
+ since it causes the gimple file to be processed in the same order
+ as the source code. */
+ order = XCNEWVEC (struct cgraph_node *, cgraph_n_nodes);
+ order_pos = cgraph_postorder (order);
+ gcc_assert (order_pos == cgraph_n_nodes);
+
+ for (i = order_pos - 1; i >= 0; i--)
+ cgraph_node_set_add (set, order[i]);
+
+ ipa_write_summaries_1 (set);
+ lto_delete_extern_inline_states ();
+
+ free (order);
+ ggc_free (set);
+}
+
+
+/* Write all the summaries for the cgraph nodes in SET. If SET is
+ NULL, write out all summaries of all nodes. */
+
+void
+ipa_write_summaries_of_cgraph_node_set (cgraph_node_set set)
+{
+ if (flag_generate_lto && !(errorcount || sorrycount))
+ ipa_write_summaries_1 (set);
+}
+
+/* Same as execute_pass_list but assume that subpasses of IPA passes
+ are local passes. */
+
+static void
+ipa_read_summaries_1 (struct opt_pass *pass)
+{
+ while (pass)
{
+ struct ipa_opt_pass_d *ipa_pass = (struct ipa_opt_pass_d *) pass;
+
gcc_assert (!current_function_decl);
gcc_assert (!cfun);
gcc_assert (pass->type == SIMPLE_IPA_PASS || pass->type == IPA_PASS);
- if (pass->type == IPA_PASS && (!pass->gate || pass->gate ()))
+
+ if (pass->gate == NULL || pass->gate ())
{
- if (!summaries_generated)
+ if (pass->type == IPA_PASS && ipa_pass->read_summary)
{
- if (!quiet_flag && !cfun)
- fprintf (stderr, " <summary generate>");
- execute_ipa_summary_passes ((struct ipa_opt_pass_d *) pass);
+ /* If a timevar is present, start it. */
+ if (pass->tv_id)
+ timevar_push (pass->tv_id);
+
+ ipa_pass->read_summary ();
+
+ /* Stop timevar. */
+ if (pass->tv_id)
+ timevar_pop (pass->tv_id);
}
- summaries_generated = true;
+
+ if (pass->sub && pass->sub->type != GIMPLE_PASS)
+ ipa_read_summaries_1 (pass->sub);
}
+ pass = pass->next;
+ }
+}
+
+
+/* Read all the summaries for all_regular_ipa_passes and all_lto_gen_passes. */
+
+void
+ipa_read_summaries (void)
+{
+ if (!flag_ltrans)
+ ipa_read_summaries_1 (all_regular_ipa_passes);
+ ipa_read_summaries_1 (all_lto_gen_passes);
+}
+
+/* Same as execute_pass_list but assume that subpasses of IPA passes
+ are local passes. */
+void
+execute_ipa_pass_list (struct opt_pass *pass)
+{
+ do
+ {
+ gcc_assert (!current_function_decl);
+ gcc_assert (!cfun);
+ gcc_assert (pass->type == SIMPLE_IPA_PASS || pass->type == IPA_PASS);
if (execute_one_pass (pass) && pass->sub)
{
if (pass->sub->type == GIMPLE_PASS)
@@ -1553,13 +1738,46 @@ execute_ipa_pass_list (struct opt_pass *pass)
else
gcc_unreachable ();
}
- if (!current_function_decl)
- cgraph_process_new_functions ();
+ gcc_assert (!current_function_decl);
+ cgraph_process_new_functions ();
pass = pass->next;
}
while (pass);
}
+extern void debug_properties (unsigned int);
+extern void dump_properties (FILE *, unsigned int);
+
+void
+dump_properties (FILE *dump, unsigned int props)
+{
+ fprintf (dump, "Properties:\n");
+ if (props & PROP_gimple_any)
+ fprintf (dump, "PROP_gimple_any\n");
+ if (props & PROP_gimple_lcf)
+ fprintf (dump, "PROP_gimple_lcf\n");
+ if (props & PROP_gimple_leh)
+ fprintf (dump, "PROP_gimple_leh\n");
+ if (props & PROP_cfg)
+ fprintf (dump, "PROP_cfg\n");
+ if (props & PROP_referenced_vars)
+ fprintf (dump, "PROP_referenced_vars\n");
+ if (props & PROP_ssa)
+ fprintf (dump, "PROP_ssa\n");
+ if (props & PROP_no_crit_edges)
+ fprintf (dump, "PROP_no_crit_edges\n");
+ if (props & PROP_rtl)
+ fprintf (dump, "PROP_rtl\n");
+ if (props & PROP_gimple_lomp)
+ fprintf (dump, "PROP_gimple_lomp\n");
+}
+
+void
+debug_properties (unsigned int props)
+{
+ dump_properties (stderr, props);
+}
+
/* Called by local passes to see if function is called by already processed nodes.
Because we process nodes in topological order, this means that function is
in recursive cycle or we introduced new direct calls. */
@@ -1571,7 +1789,7 @@ function_called_by_processed_nodes_p (void)
{
if (e->caller->decl == current_function_decl)
continue;
- if (!e->caller->analyzed || (!e->caller->needed && !e->caller->reachable))
+ if (!e->caller->analyzed)
continue;
if (TREE_ASM_WRITTEN (e->caller->decl))
continue;
diff --git a/gcc/plugin.c b/gcc/plugin.c
index 414d5783fa5..2d64422787e 100644
--- a/gcc/plugin.c
+++ b/gcc/plugin.c
@@ -58,7 +58,9 @@ const char *plugin_event_name[] =
"PLUGIN_GGC_END",
"PLUGIN_REGISTER_GGC_ROOTS",
"PLUGIN_REGISTER_GGC_CACHES",
- "PLUGIN_START_UNIT",
+ "PLUGIN_ATTRIBUTES",
+ "PLUGIN_START_UNIT",
+ "PLUGIN_PRAGMAS",
"PLUGIN_EVENT_LAST"
};
@@ -325,6 +327,7 @@ register_callback (const char *plugin_name,
case PLUGIN_GGC_MARKING:
case PLUGIN_GGC_END:
case PLUGIN_ATTRIBUTES:
+ case PLUGIN_PRAGMAS:
case PLUGIN_FINISH:
{
struct callback_info *new_callback;
@@ -344,7 +347,7 @@ register_callback (const char *plugin_name,
break;
case PLUGIN_EVENT_LAST:
default:
- error ("Unkown callback event registered by plugin %s",
+ error ("Unknown callback event registered by plugin %s",
plugin_name);
}
}
@@ -368,6 +371,7 @@ invoke_plugin_callbacks (enum plugin_event event, void *gcc_data)
case PLUGIN_FINISH_UNIT:
case PLUGIN_CXX_CP_PRE_GENERICIZE:
case PLUGIN_ATTRIBUTES:
+ case PLUGIN_PRAGMAS:
case PLUGIN_FINISH:
case PLUGIN_GGC_START:
case PLUGIN_GGC_MARKING:
@@ -408,7 +412,7 @@ try_init_one_plugin (struct plugin_name_args *plugin)
{
void *dl_handle;
plugin_init_func plugin_init;
- char *err;
+ const char *err;
PTR_UNION_TYPE (plugin_init_func) plugin_init_union;
/* We use RTLD_NOW to accelerate binding and detect any mismatch
diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog
index e8ba16b4c8d..e565291c7e1 100644
--- a/gcc/po/ChangeLog
+++ b/gcc/po/ChangeLog
@@ -1,3 +1,7 @@
+2009-10-17 Joseph Myers <joseph@codesourcery.com>
+
+ * gcc.pot: Regenerate.
+
2009-09-03 Joseph Myers <joseph@codesourcery.com>
* fi.po: Update.
diff --git a/gcc/po/gcc.pot b/gcc/po/gcc.pot
index c3f85328bd8..c00b9d0d016 100644
--- a/gcc/po/gcc.pot
+++ b/gcc/po/gcc.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n"
-"POT-Creation-Date: 2009-05-10 10:32+0000\n"
+"POT-Creation-Date: 2009-10-17 13:36+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -16,265 +16,265 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
-#: c-decl.c:3944 c-pretty-print.c:393 c-typeck.c:5151 toplev.c:1597
-#: cp/error.c:585 cp/error.c:848
+#: c-decl.c:4539 c-pretty-print.c:393 c-typeck.c:5349 toplev.c:1641
+#: cp/error.c:602 cp/error.c:875
msgid "<anonymous>"
msgstr ""
-#: c-format.c:361 c-format.c:385 config/i386/msformat-c.c:49
+#: c-format.c:363 c-format.c:387 config/i386/msformat-c.c:49
msgid "' ' flag"
msgstr ""
-#: c-format.c:361 c-format.c:385 config/i386/msformat-c.c:49
+#: c-format.c:363 c-format.c:387 config/i386/msformat-c.c:49
msgid "the ' ' printf flag"
msgstr ""
-#: c-format.c:362 c-format.c:386 c-format.c:420 c-format.c:432 c-format.c:491
+#: c-format.c:364 c-format.c:388 c-format.c:422 c-format.c:434 c-format.c:493
#: config/i386/msformat-c.c:50
msgid "'+' flag"
msgstr ""
-#: c-format.c:362 c-format.c:386 c-format.c:420 c-format.c:432
+#: c-format.c:364 c-format.c:388 c-format.c:422 c-format.c:434
#: config/i386/msformat-c.c:50
msgid "the '+' printf flag"
msgstr ""
-#: c-format.c:363 c-format.c:387 c-format.c:433 c-format.c:467
+#: c-format.c:365 c-format.c:389 c-format.c:435 c-format.c:469
#: config/i386/msformat-c.c:51 config/i386/msformat-c.c:86
msgid "'#' flag"
msgstr ""
-#: c-format.c:363 c-format.c:387 c-format.c:433 config/i386/msformat-c.c:51
+#: c-format.c:365 c-format.c:389 c-format.c:435 config/i386/msformat-c.c:51
msgid "the '#' printf flag"
msgstr ""
-#: c-format.c:364 c-format.c:388 c-format.c:465 config/i386/msformat-c.c:52
+#: c-format.c:366 c-format.c:390 c-format.c:467 config/i386/msformat-c.c:52
msgid "'0' flag"
msgstr ""
-#: c-format.c:364 c-format.c:388 config/i386/msformat-c.c:52
+#: c-format.c:366 c-format.c:390 config/i386/msformat-c.c:52
msgid "the '0' printf flag"
msgstr ""
-#: c-format.c:365 c-format.c:389 c-format.c:464 c-format.c:494
+#: c-format.c:367 c-format.c:391 c-format.c:466 c-format.c:496
#: config/i386/msformat-c.c:53
msgid "'-' flag"
msgstr ""
-#: c-format.c:365 c-format.c:389 config/i386/msformat-c.c:53
+#: c-format.c:367 c-format.c:391 config/i386/msformat-c.c:53
msgid "the '-' printf flag"
msgstr ""
-#: c-format.c:366 c-format.c:447 config/i386/msformat-c.c:54
+#: c-format.c:368 c-format.c:449 config/i386/msformat-c.c:54
#: config/i386/msformat-c.c:74
msgid "''' flag"
msgstr ""
-#: c-format.c:366 config/i386/msformat-c.c:54
+#: c-format.c:368 config/i386/msformat-c.c:54
msgid "the ''' printf flag"
msgstr ""
-#: c-format.c:367 c-format.c:448
+#: c-format.c:369 c-format.c:450
msgid "'I' flag"
msgstr ""
-#: c-format.c:367
+#: c-format.c:369
msgid "the 'I' printf flag"
msgstr ""
-#: c-format.c:368 c-format.c:390 c-format.c:445 c-format.c:468 c-format.c:495
-#: c-format.c:1629 config/sol2-c.c:45 config/i386/msformat-c.c:55
+#: c-format.c:370 c-format.c:392 c-format.c:447 c-format.c:470 c-format.c:497
+#: c-format.c:1621 config/sol2-c.c:45 config/i386/msformat-c.c:55
#: config/i386/msformat-c.c:72
msgid "field width"
msgstr ""
-#: c-format.c:368 c-format.c:390 config/sol2-c.c:45
+#: c-format.c:370 c-format.c:392 config/sol2-c.c:45
#: config/i386/msformat-c.c:55
msgid "field width in printf format"
msgstr ""
-#: c-format.c:369 c-format.c:391 c-format.c:422 c-format.c:435
+#: c-format.c:371 c-format.c:393 c-format.c:424 c-format.c:437
#: config/i386/msformat-c.c:56
msgid "precision"
msgstr ""
-#: c-format.c:369 c-format.c:391 c-format.c:422 c-format.c:435
+#: c-format.c:371 c-format.c:393 c-format.c:424 c-format.c:437
#: config/i386/msformat-c.c:56
msgid "precision in printf format"
msgstr ""
-#: c-format.c:370 c-format.c:392 c-format.c:423 c-format.c:436 c-format.c:446
-#: c-format.c:498 config/sol2-c.c:46 config/i386/msformat-c.c:57
+#: c-format.c:372 c-format.c:394 c-format.c:425 c-format.c:438 c-format.c:448
+#: c-format.c:500 config/sol2-c.c:46 config/i386/msformat-c.c:57
#: config/i386/msformat-c.c:73
msgid "length modifier"
msgstr ""
-#: c-format.c:370 c-format.c:392 c-format.c:423 c-format.c:436
+#: c-format.c:372 c-format.c:394 c-format.c:425 c-format.c:438
#: config/sol2-c.c:46 config/i386/msformat-c.c:57
msgid "length modifier in printf format"
msgstr ""
-#: c-format.c:421 c-format.c:434
+#: c-format.c:423 c-format.c:436
msgid "'q' flag"
msgstr ""
-#: c-format.c:421 c-format.c:434
+#: c-format.c:423 c-format.c:436
msgid "the 'q' diagnostic flag"
msgstr ""
-#: c-format.c:442 config/i386/msformat-c.c:70
+#: c-format.c:444 config/i386/msformat-c.c:70
msgid "assignment suppression"
msgstr ""
-#: c-format.c:442 config/i386/msformat-c.c:70
+#: c-format.c:444 config/i386/msformat-c.c:70
msgid "the assignment suppression scanf feature"
msgstr ""
-#: c-format.c:443 config/i386/msformat-c.c:71
+#: c-format.c:445 config/i386/msformat-c.c:71
msgid "'a' flag"
msgstr ""
-#: c-format.c:443 config/i386/msformat-c.c:71
+#: c-format.c:445 config/i386/msformat-c.c:71
msgid "the 'a' scanf flag"
msgstr ""
-#: c-format.c:444
+#: c-format.c:446
msgid "'m' flag"
msgstr ""
-#: c-format.c:444
+#: c-format.c:446
msgid "the 'm' scanf flag"
msgstr ""
-#: c-format.c:445 config/i386/msformat-c.c:72
+#: c-format.c:447 config/i386/msformat-c.c:72
msgid "field width in scanf format"
msgstr ""
-#: c-format.c:446 config/i386/msformat-c.c:73
+#: c-format.c:448 config/i386/msformat-c.c:73
msgid "length modifier in scanf format"
msgstr ""
-#: c-format.c:447 config/i386/msformat-c.c:74
+#: c-format.c:449 config/i386/msformat-c.c:74
msgid "the ''' scanf flag"
msgstr ""
-#: c-format.c:448
+#: c-format.c:450
msgid "the 'I' scanf flag"
msgstr ""
-#: c-format.c:463
+#: c-format.c:465
msgid "'_' flag"
msgstr ""
-#: c-format.c:463
+#: c-format.c:465
msgid "the '_' strftime flag"
msgstr ""
-#: c-format.c:464
+#: c-format.c:466
msgid "the '-' strftime flag"
msgstr ""
-#: c-format.c:465
+#: c-format.c:467
msgid "the '0' strftime flag"
msgstr ""
-#: c-format.c:466 c-format.c:490
+#: c-format.c:468 c-format.c:492
msgid "'^' flag"
msgstr ""
-#: c-format.c:466
+#: c-format.c:468
msgid "the '^' strftime flag"
msgstr ""
-#: c-format.c:467 config/i386/msformat-c.c:86
+#: c-format.c:469 config/i386/msformat-c.c:86
msgid "the '#' strftime flag"
msgstr ""
-#: c-format.c:468
+#: c-format.c:470
msgid "field width in strftime format"
msgstr ""
-#: c-format.c:469
+#: c-format.c:471
msgid "'E' modifier"
msgstr ""
-#: c-format.c:469
+#: c-format.c:471
msgid "the 'E' strftime modifier"
msgstr ""
-#: c-format.c:470
+#: c-format.c:472
msgid "'O' modifier"
msgstr ""
-#: c-format.c:470
+#: c-format.c:472
msgid "the 'O' strftime modifier"
msgstr ""
-#: c-format.c:471
+#: c-format.c:473
msgid "the 'O' modifier"
msgstr ""
-#: c-format.c:489
+#: c-format.c:491
msgid "fill character"
msgstr ""
-#: c-format.c:489
+#: c-format.c:491
msgid "fill character in strfmon format"
msgstr ""
-#: c-format.c:490
+#: c-format.c:492
msgid "the '^' strfmon flag"
msgstr ""
-#: c-format.c:491
+#: c-format.c:493
msgid "the '+' strfmon flag"
msgstr ""
-#: c-format.c:492
+#: c-format.c:494
msgid "'(' flag"
msgstr ""
-#: c-format.c:492
+#: c-format.c:494
msgid "the '(' strfmon flag"
msgstr ""
-#: c-format.c:493
+#: c-format.c:495
msgid "'!' flag"
msgstr ""
-#: c-format.c:493
+#: c-format.c:495
msgid "the '!' strfmon flag"
msgstr ""
-#: c-format.c:494
+#: c-format.c:496
msgid "the '-' strfmon flag"
msgstr ""
-#: c-format.c:495
+#: c-format.c:497
msgid "field width in strfmon format"
msgstr ""
-#: c-format.c:496
+#: c-format.c:498
msgid "left precision"
msgstr ""
-#: c-format.c:496
+#: c-format.c:498
msgid "left precision in strfmon format"
msgstr ""
-#: c-format.c:497
+#: c-format.c:499
msgid "right precision"
msgstr ""
-#: c-format.c:497
+#: c-format.c:499
msgid "right precision in strfmon format"
msgstr ""
-#: c-format.c:498
+#: c-format.c:500
msgid "length modifier in strfmon format"
msgstr ""
-#: c-format.c:1731
+#: c-format.c:1724
msgid "field precision"
msgstr ""
@@ -282,12 +282,12 @@ msgstr ""
msgid "({anonymous})"
msgstr ""
-#: c-opts.c:1490 cp/error.c:990 fortran/cpp.c:552
+#: c-opts.c:1520 tree.c:3958 cp/error.c:1017 fortran/cpp.c:552
msgid "<built-in>"
msgstr ""
#. Handle deferred options from command-line.
-#: c-opts.c:1508 fortran/cpp.c:557
+#: c-opts.c:1538 fortran/cpp.c:557
msgid "<command-line>"
msgstr ""
@@ -327,57 +327,52 @@ msgstr ""
msgid "<return-value>"
msgstr ""
-#: c-typeck.c:5268
+#: c-typeck.c:5466
msgid "array initialized from parenthesized string constant"
msgstr ""
-#: c-typeck.c:5338 c-typeck.c:6197
+#: c-typeck.c:5539 c-typeck.c:6410
msgid "initialization of a flexible array member"
msgstr ""
-#: c-typeck.c:5348 cp/typeck2.c:756
+#: c-typeck.c:5549 cp/typeck2.c:758
#, gcc-internal-format
msgid "char-array initialized from wide string"
msgstr ""
-#: c-typeck.c:5356
+#: c-typeck.c:5557
msgid "wide character array initialized from non-wide string"
msgstr ""
-#: c-typeck.c:5362
+#: c-typeck.c:5563
msgid "wide character array initialized from incompatible wide string"
msgstr ""
-#: c-typeck.c:5380 cp/typeck2.c:784
-#, gcc-internal-format
-msgid "initializer-string for array of chars is too long"
-msgstr ""
-
-#: c-typeck.c:5386
+#: c-typeck.c:5597
msgid "array of inappropriate type initialized from string constant"
msgstr ""
#. ??? This should not be an error when inlining calls to
#. unprototyped functions.
-#: c-typeck.c:5453 c-typeck.c:4925 cp/typeck.c:1645
+#: c-typeck.c:5665 c-typeck.c:5118 cp/typeck.c:1658
#, gcc-internal-format
msgid "invalid use of non-lvalue array"
msgstr ""
-#: c-typeck.c:5479
+#: c-typeck.c:5691
msgid "array initialized from non-constant array expression"
msgstr ""
-#: c-typeck.c:5493 c-typeck.c:5496 c-typeck.c:5504 c-typeck.c:5542
-#: c-typeck.c:6996
+#: c-typeck.c:5705 c-typeck.c:5708 c-typeck.c:5716 c-typeck.c:5755
+#: c-typeck.c:7209
msgid "initializer element is not constant"
msgstr ""
-#: c-typeck.c:5509 c-typeck.c:5554 c-typeck.c:7006
+#: c-typeck.c:5721 c-typeck.c:5767 c-typeck.c:7219
msgid "initializer element is not a constant expression"
msgstr ""
-#: c-typeck.c:5549 c-typeck.c:7001
+#: c-typeck.c:5762 c-typeck.c:7214
#, gcc-internal-format
msgid "initializer element is not computable at load time"
msgstr ""
@@ -386,276 +381,287 @@ msgstr ""
#. of VLAs themselves count as VLAs, it does not make
#. sense to permit them to be initialized given that
#. ordinary VLAs may not be initialized.
-#: c-typeck.c:5563 c-decl.c:3337 c-decl.c:3352
+#: c-typeck.c:5776 c-decl.c:3921 c-decl.c:3936
#, gcc-internal-format
msgid "variable-sized object may not be initialized"
msgstr ""
-#: c-typeck.c:5567
+#: c-typeck.c:5780
msgid "invalid initializer"
msgstr ""
-#: c-typeck.c:5776
+#: c-typeck.c:5989
msgid "(anonymous)"
msgstr ""
-#: c-typeck.c:6054
+#: c-typeck.c:6267
msgid "extra brace group at end of initializer"
msgstr ""
-#: c-typeck.c:6075
+#: c-typeck.c:6288
msgid "missing braces around initializer"
msgstr ""
-#: c-typeck.c:6136
+#: c-typeck.c:6349
msgid "braces around scalar initializer"
msgstr ""
-#: c-typeck.c:6194
+#: c-typeck.c:6407
msgid "initialization of flexible array member in a nested context"
msgstr ""
-#: c-typeck.c:6225
+#: c-typeck.c:6438
msgid "missing initializer"
msgstr ""
-#: c-typeck.c:6247
+#: c-typeck.c:6460
msgid "empty scalar initializer"
msgstr ""
-#: c-typeck.c:6252
+#: c-typeck.c:6465
msgid "extra elements in scalar initializer"
msgstr ""
-#: c-typeck.c:6360 c-typeck.c:6438
+#: c-typeck.c:6573 c-typeck.c:6651
msgid "array index in non-array initializer"
msgstr ""
-#: c-typeck.c:6365 c-typeck.c:6494
+#: c-typeck.c:6578 c-typeck.c:6707
msgid "field name not in record or union initializer"
msgstr ""
-#: c-typeck.c:6411
+#: c-typeck.c:6624
msgid "array index in initializer not of integer type"
msgstr ""
-#: c-typeck.c:6420 c-typeck.c:6429
+#: c-typeck.c:6633 c-typeck.c:6642
msgid "array index in initializer is not an integer constant expression"
msgstr ""
-#: c-typeck.c:6434 c-typeck.c:6436
+#: c-typeck.c:6647 c-typeck.c:6649
msgid "nonconstant array index in initializer"
msgstr ""
-#: c-typeck.c:6440 c-typeck.c:6443
+#: c-typeck.c:6653 c-typeck.c:6656
msgid "array index in initializer exceeds array bounds"
msgstr ""
-#: c-typeck.c:6457
+#: c-typeck.c:6670
msgid "empty index range in initializer"
msgstr ""
-#: c-typeck.c:6466
+#: c-typeck.c:6679
msgid "array index range in initializer exceeds array bounds"
msgstr ""
-#: c-typeck.c:6549 c-typeck.c:6576 c-typeck.c:7095
+#: c-typeck.c:6762 c-typeck.c:6789 c-typeck.c:7308
msgid "initialized field with side-effects overwritten"
msgstr ""
-#: c-typeck.c:6551 c-typeck.c:6578 c-typeck.c:7097
+#: c-typeck.c:6764 c-typeck.c:6791 c-typeck.c:7310
msgid "initialized field overwritten"
msgstr ""
-#: c-typeck.c:7023 c-typeck.c:4574
+#: c-typeck.c:7236 c-typeck.c:4761
#, gcc-internal-format
msgid "enum conversion in initialization is invalid in C++"
msgstr ""
-#: c-typeck.c:7312
+#: c-typeck.c:7525
msgid "excess elements in char array initializer"
msgstr ""
-#: c-typeck.c:7319 c-typeck.c:7378
+#: c-typeck.c:7532 c-typeck.c:7591
msgid "excess elements in struct initializer"
msgstr ""
-#: c-typeck.c:7393
+#: c-typeck.c:7606
msgid "non-static initialization of a flexible array member"
msgstr ""
-#: c-typeck.c:7463
+#: c-typeck.c:7676
msgid "excess elements in union initializer"
msgstr ""
-#: c-typeck.c:7552
+#: c-typeck.c:7765
msgid "excess elements in array initializer"
msgstr ""
-#: c-typeck.c:7584
+#: c-typeck.c:7798
msgid "excess elements in vector initializer"
msgstr ""
-#: c-typeck.c:7614
+#: c-typeck.c:7829
msgid "excess elements in scalar initializer"
msgstr ""
-#: cfgrtl.c:1941
+#: cfgrtl.c:2026
msgid "flow control insn inside a basic block"
msgstr ""
-#: cfgrtl.c:2070
+#: cfgrtl.c:2157
msgid "wrong insn in the fallthru edge"
msgstr ""
-#: cfgrtl.c:2126
+#: cfgrtl.c:2211
msgid "insn outside basic block"
msgstr ""
-#: cfgrtl.c:2133
+#: cfgrtl.c:2218
msgid "return not followed by barrier"
msgstr ""
-#: collect2.c:396 gcc.c:7153
+#: collect2.c:486 gcc.c:7686
#, c-format
msgid "internal gcc abort in %s, at %s:%d"
msgstr ""
-#: collect2.c:910
+#: collect2.c:939
+#, c-format
+msgid "COLLECT_LTO_WRAPPER must be set."
+msgstr ""
+
+#: collect2.c:1081
+#, c-format
+msgid "too many lto output files"
+msgstr ""
+
+#: collect2.c:1284
#, c-format
msgid "no arguments"
msgstr ""
-#: collect2.c:1284 collect2.c:1432 collect2.c:1467
+#: collect2.c:1677 collect2.c:1839 collect2.c:1874
#, c-format
msgid "fopen %s"
msgstr ""
-#: collect2.c:1287 collect2.c:1437 collect2.c:1470
+#: collect2.c:1680 collect2.c:1844 collect2.c:1877
#, c-format
msgid "fclose %s"
msgstr ""
-#: collect2.c:1296
+#: collect2.c:1689
#, c-format
msgid "collect2 version %s"
msgstr ""
-#: collect2.c:1386
+#: collect2.c:1785
#, c-format
msgid "%d constructor(s) found\n"
msgstr ""
-#: collect2.c:1387
+#: collect2.c:1786
#, c-format
msgid "%d destructor(s) found\n"
msgstr ""
-#: collect2.c:1388
+#: collect2.c:1787
#, c-format
msgid "%d frame table(s) found\n"
msgstr ""
-#: collect2.c:1525
+#: collect2.c:1938 lto-wrapper.c:167
#, c-format
msgid "can't get program status"
msgstr ""
-#: collect2.c:1594
+#: collect2.c:2007
#, c-format
msgid "could not open response file %s"
msgstr ""
-#: collect2.c:1599
+#: collect2.c:2012
#, c-format
msgid "could not write to response file %s"
msgstr ""
-#: collect2.c:1604
+#: collect2.c:2017
#, c-format
msgid "could not close response file %s"
msgstr ""
-#: collect2.c:1622
+#: collect2.c:2035
#, c-format
msgid "[cannot find %s]"
msgstr ""
-#: collect2.c:1637
+#: collect2.c:2050
#, c-format
msgid "cannot find '%s'"
msgstr ""
-#: collect2.c:1641 collect2.c:2132 collect2.c:2287 gcc.c:3021
+#: collect2.c:2054 collect2.c:2577 collect2.c:2773 gcc.c:3075
+#: lto-wrapper.c:139
#, c-format
msgid "pex_init failed"
msgstr ""
-#: collect2.c:1679
+#: collect2.c:2092
#, c-format
msgid "[Leaving %s]\n"
msgstr ""
-#: collect2.c:1900
+#: collect2.c:2324
#, c-format
msgid ""
"\n"
"write_c_file - output name is %s, prefix is %s\n"
msgstr ""
-#: collect2.c:2106
+#: collect2.c:2551
#, c-format
msgid "cannot find 'nm'"
msgstr ""
-#: collect2.c:2153
+#: collect2.c:2599
#, c-format
msgid "can't open nm output"
msgstr ""
-#: collect2.c:2197
+#: collect2.c:2682
#, c-format
msgid "init function found in object %s"
msgstr ""
-#: collect2.c:2205
+#: collect2.c:2692
#, c-format
msgid "fini function found in object %s"
msgstr ""
-#: collect2.c:2308
+#: collect2.c:2794
#, c-format
msgid "can't open ldd output"
msgstr ""
-#: collect2.c:2311
+#: collect2.c:2797
#, c-format
msgid ""
"\n"
"ldd output with constructors/destructors.\n"
msgstr ""
-#: collect2.c:2326
+#: collect2.c:2812
#, c-format
msgid "dynamic dependency %s not found"
msgstr ""
-#: collect2.c:2338
+#: collect2.c:2824
#, c-format
msgid "unable to open dynamic dependency '%s'"
msgstr ""
-#: collect2.c:2494
+#: collect2.c:2985
#, c-format
msgid "%s: not a COFF file"
msgstr ""
-#: collect2.c:2614
+#: collect2.c:3115
#, c-format
msgid "%s: cannot open as COFF file"
msgstr ""
-#: collect2.c:2672
+#: collect2.c:3173
#, c-format
msgid "library lib%s not found"
msgstr ""
@@ -670,12 +676,12 @@ msgstr ""
msgid "too many input files"
msgstr ""
-#: diagnostic.c:190
+#: diagnostic.c:185
#, c-format
msgid "compilation terminated due to -Wfatal-errors.\n"
msgstr ""
-#: diagnostic.c:199
+#: diagnostic.c:194
#, c-format
msgid ""
"Please submit a full bug report,\n"
@@ -683,66 +689,66 @@ msgid ""
"See %s for instructions.\n"
msgstr ""
-#: diagnostic.c:208
+#: diagnostic.c:203
#, c-format
msgid "compilation terminated.\n"
msgstr ""
-#: diagnostic.c:377
+#: diagnostic.c:381
#, c-format
msgid ""
"*** WARNING *** there are active plugins, do not report this as a bug unless "
"you can reproduce it without enabling any plugins.\n"
msgstr ""
-#: diagnostic.c:394
+#: diagnostic.c:398
#, c-format
msgid "%s:%d: confused by earlier errors, bailing out\n"
msgstr ""
-#: diagnostic.c:705
+#: diagnostic.c:709
#, c-format
msgid "Internal compiler error: Error reporting routines re-entered.\n"
msgstr ""
-#: final.c:1134
+#: final.c:1152
msgid "negative insn length"
msgstr ""
-#: final.c:2608
+#: final.c:2651
msgid "could not split insn"
msgstr ""
-#: final.c:3005
+#: final.c:3085
msgid "invalid 'asm': "
msgstr ""
-#: final.c:3188
+#: final.c:3268
#, c-format
msgid "nested assembly dialect alternatives"
msgstr ""
-#: final.c:3205 final.c:3217
+#: final.c:3285 final.c:3297
#, c-format
msgid "unterminated assembly dialect alternative"
msgstr ""
-#: final.c:3264
+#: final.c:3344
#, c-format
msgid "operand number missing after %%-letter"
msgstr ""
-#: final.c:3267 final.c:3308
+#: final.c:3347 final.c:3388
#, c-format
msgid "operand number out of range"
msgstr ""
-#: final.c:3327
+#: final.c:3407
#, c-format
msgid "invalid %%-code"
msgstr ""
-#: final.c:3357
+#: final.c:3437
#, c-format
msgid "'%%l' operand isn't a label"
msgstr ""
@@ -753,118 +759,118 @@ msgstr ""
#. handle them.
#. We can't handle floating point constants;
#. PRINT_OPERAND must handle them.
-#: final.c:3503 vmsdbgout.c:488 config/i386/i386.c:10285
-#: config/pdp11/pdp11.c:1677
+#: final.c:3583 vmsdbgout.c:495 config/i386/i386.c:10677
+#: config/pdp11/pdp11.c:1682
#, c-format
msgid "floating constant misused"
msgstr ""
-#: final.c:3565 vmsdbgout.c:545 config/i386/i386.c:10372
-#: config/pdp11/pdp11.c:1724
+#: final.c:3645 vmsdbgout.c:552 config/i386/i386.c:10764
+#: config/pdp11/pdp11.c:1729
#, c-format
msgid "invalid expression as operand"
msgstr ""
-#: gcc.c:1736
+#: gcc.c:1789
#, c-format
msgid "Using built-in specs.\n"
msgstr ""
-#: gcc.c:1921
+#: gcc.c:1974
#, c-format
msgid ""
"Setting spec %s to '%s'\n"
"\n"
msgstr ""
-#: gcc.c:2036
+#: gcc.c:2089
#, c-format
msgid "Reading specs from %s\n"
msgstr ""
-#: gcc.c:2132 gcc.c:2151
+#: gcc.c:2185 gcc.c:2204
#, c-format
msgid "specs %%include syntax malformed after %ld characters"
msgstr ""
-#: gcc.c:2159
+#: gcc.c:2212
#, c-format
msgid "could not find specs file %s\n"
msgstr ""
-#: gcc.c:2176 gcc.c:2184 gcc.c:2193 gcc.c:2202
+#: gcc.c:2229 gcc.c:2237 gcc.c:2246 gcc.c:2255
#, c-format
msgid "specs %%rename syntax malformed after %ld characters"
msgstr ""
-#: gcc.c:2211
+#: gcc.c:2264
#, c-format
msgid "specs %s spec was not found to be renamed"
msgstr ""
-#: gcc.c:2218
+#: gcc.c:2271
#, c-format
msgid "%s: attempt to rename spec '%s' to already defined spec '%s'"
msgstr ""
-#: gcc.c:2223
+#: gcc.c:2276
#, c-format
msgid "rename spec %s to %s\n"
msgstr ""
-#: gcc.c:2225
+#: gcc.c:2278
#, c-format
msgid ""
"spec is '%s'\n"
"\n"
msgstr ""
-#: gcc.c:2238
+#: gcc.c:2291
#, c-format
msgid "specs unknown %% command after %ld characters"
msgstr ""
-#: gcc.c:2249 gcc.c:2262
+#: gcc.c:2302 gcc.c:2315
#, c-format
msgid "specs file malformed after %ld characters"
msgstr ""
-#: gcc.c:2314
+#: gcc.c:2367
#, c-format
msgid "spec file has no spec for linking"
msgstr ""
-#: gcc.c:2642 gcc.c:4954
+#: gcc.c:2695 gcc.c:5233
#, c-format
msgid "%s\n"
msgstr ""
-#: gcc.c:2843
+#: gcc.c:2896
#, c-format
msgid "system path '%s' is not absolute"
msgstr ""
-#: gcc.c:2915
+#: gcc.c:2968
#, c-format
msgid "-pipe not supported"
msgstr ""
-#: gcc.c:2977
+#: gcc.c:3030
#, c-format
msgid ""
"\n"
"Go ahead? (y or n) "
msgstr ""
-#: gcc.c:3060
+#: gcc.c:3114
msgid "failed to get exit status"
msgstr ""
-#: gcc.c:3066
+#: gcc.c:3120
msgid "failed to get process times"
msgstr ""
-#: gcc.c:3092
+#: gcc.c:3146
#, c-format
msgid ""
"Internal error: %s (program %s)\n"
@@ -872,225 +878,231 @@ msgid ""
"See %s for instructions."
msgstr ""
-#: gcc.c:3118
+#: gcc.c:3174
#, c-format
msgid "# %s %.2f %.2f\n"
msgstr ""
-#: gcc.c:3252
+#: gcc.c:3365
#, c-format
msgid "Usage: %s [options] file...\n"
msgstr ""
-#: gcc.c:3253
+#: gcc.c:3366
msgid "Options:\n"
msgstr ""
-#: gcc.c:3255
+#: gcc.c:3368
msgid " -pass-exit-codes Exit with highest error code from a phase\n"
msgstr ""
-#: gcc.c:3256
+#: gcc.c:3369
msgid " --help Display this information\n"
msgstr ""
-#: gcc.c:3257
+#: gcc.c:3370
msgid ""
" --target-help Display target specific command line options\n"
msgstr ""
-#: gcc.c:3258
+#: gcc.c:3371
msgid ""
" --help={target|optimizers|warnings|params|[^]{joined|separate|"
"undocumented}}[,...]\n"
msgstr ""
-#: gcc.c:3259
+#: gcc.c:3372
msgid ""
" Display specific types of command line options\n"
msgstr ""
-#: gcc.c:3261
+#: gcc.c:3374
msgid " (Use '-v --help' to display command line options of sub-processes)\n"
msgstr ""
-#: gcc.c:3262
+#: gcc.c:3375
msgid " --version Display compiler version information\n"
msgstr ""
-#: gcc.c:3263
+#: gcc.c:3376
msgid " -dumpspecs Display all of the built in spec strings\n"
msgstr ""
-#: gcc.c:3264
+#: gcc.c:3377
msgid " -dumpversion Display the version of the compiler\n"
msgstr ""
-#: gcc.c:3265
+#: gcc.c:3378
msgid " -dumpmachine Display the compiler's target processor\n"
msgstr ""
-#: gcc.c:3266
+#: gcc.c:3379
msgid ""
" -print-search-dirs Display the directories in the compiler's search "
"path\n"
msgstr ""
-#: gcc.c:3267
+#: gcc.c:3380
msgid ""
" -print-libgcc-file-name Display the name of the compiler's companion "
"library\n"
msgstr ""
-#: gcc.c:3268
+#: gcc.c:3381
msgid " -print-file-name=<lib> Display the full path to library <lib>\n"
msgstr ""
-#: gcc.c:3269
+#: gcc.c:3382
msgid ""
" -print-prog-name=<prog> Display the full path to compiler component "
"<prog>\n"
msgstr ""
-#: gcc.c:3270
+#: gcc.c:3383
msgid ""
" -print-multi-directory Display the root directory for versions of "
"libgcc\n"
msgstr ""
-#: gcc.c:3271
+#: gcc.c:3384
msgid ""
" -print-multi-lib Display the mapping between command line options "
"and\n"
" multiple library search directories\n"
msgstr ""
-#: gcc.c:3274
+#: gcc.c:3387
msgid " -print-multi-os-directory Display the relative path to OS libraries\n"
msgstr ""
-#: gcc.c:3275
+#: gcc.c:3388
msgid " -print-sysroot Display the target libraries directory\n"
msgstr ""
-#: gcc.c:3276
+#: gcc.c:3389
msgid ""
" -print-sysroot-headers-suffix Display the sysroot suffix used to find "
"headers\n"
msgstr ""
-#: gcc.c:3277
+#: gcc.c:3390
msgid ""
" -Wa,<options> Pass comma-separated <options> on to the "
"assembler\n"
msgstr ""
-#: gcc.c:3278
+#: gcc.c:3391
msgid ""
" -Wp,<options> Pass comma-separated <options> on to the "
"preprocessor\n"
msgstr ""
-#: gcc.c:3279
+#: gcc.c:3392
msgid ""
" -Wl,<options> Pass comma-separated <options> on to the linker\n"
msgstr ""
-#: gcc.c:3280
+#: gcc.c:3393
msgid " -Xassembler <arg> Pass <arg> on to the assembler\n"
msgstr ""
-#: gcc.c:3281
+#: gcc.c:3394
msgid " -Xpreprocessor <arg> Pass <arg> on to the preprocessor\n"
msgstr ""
-#: gcc.c:3282
+#: gcc.c:3395
msgid " -Xlinker <arg> Pass <arg> on to the linker\n"
msgstr ""
-#: gcc.c:3283
+#: gcc.c:3396
msgid ""
" -combine Pass multiple source files to compiler at once\n"
msgstr ""
-#: gcc.c:3284
+#: gcc.c:3397
msgid " -save-temps Do not delete intermediate files\n"
msgstr ""
-#: gcc.c:3285
+#: gcc.c:3398
msgid " -save-temps=<arg> Do not delete intermediate files\n"
msgstr ""
-#: gcc.c:3286
+#: gcc.c:3399
+msgid ""
+" -no-canonical-prefixes Do not canonicalize paths when building relative\n"
+" prefixes to other gcc components\n"
+msgstr ""
+
+#: gcc.c:3402
msgid " -pipe Use pipes rather than intermediate files\n"
msgstr ""
-#: gcc.c:3287
+#: gcc.c:3403
msgid " -time Time the execution of each subprocess\n"
msgstr ""
-#: gcc.c:3288
+#: gcc.c:3404
msgid ""
" -specs=<file> Override built-in specs with the contents of "
"<file>\n"
msgstr ""
-#: gcc.c:3289
+#: gcc.c:3405
msgid ""
" -std=<standard> Assume that the input sources are for <standard>\n"
msgstr ""
-#: gcc.c:3290
+#: gcc.c:3406
msgid ""
" --sysroot=<directory> Use <directory> as the root directory for "
"headers\n"
" and libraries\n"
msgstr ""
-#: gcc.c:3293
+#: gcc.c:3409
msgid ""
" -B <directory> Add <directory> to the compiler's search paths\n"
msgstr ""
-#: gcc.c:3294
+#: gcc.c:3410
msgid " -b <machine> Run gcc for target <machine>, if installed\n"
msgstr ""
-#: gcc.c:3295
+#: gcc.c:3411
msgid ""
" -V <version> Run gcc version number <version>, if installed\n"
msgstr ""
-#: gcc.c:3296
+#: gcc.c:3412
msgid ""
" -v Display the programs invoked by the compiler\n"
msgstr ""
-#: gcc.c:3297
+#: gcc.c:3413
msgid ""
" -### Like -v but options quoted and commands not "
"executed\n"
msgstr ""
-#: gcc.c:3298
+#: gcc.c:3414
msgid ""
" -E Preprocess only; do not compile, assemble or "
"link\n"
msgstr ""
-#: gcc.c:3299
+#: gcc.c:3415
msgid " -S Compile only; do not assemble or link\n"
msgstr ""
-#: gcc.c:3300
+#: gcc.c:3416
msgid " -c Compile and assemble, but do not link\n"
msgstr ""
-#: gcc.c:3301
+#: gcc.c:3417
msgid " -o <file> Place the output into <file>\n"
msgstr ""
-#: gcc.c:3302
+#: gcc.c:3418
msgid ""
" -x <language> Specify the language of the following input "
"files\n"
@@ -1101,7 +1113,7 @@ msgid ""
"extension\n"
msgstr ""
-#: gcc.c:3309
+#: gcc.c:3425
#, c-format
msgid ""
"\n"
@@ -1110,201 +1122,206 @@ msgid ""
" other options on to these processes the -W<letter> options must be used.\n"
msgstr ""
-#: gcc.c:3439
+#: gcc.c:3557
#, c-format
msgid "'-%c' option must have argument"
msgstr ""
-#: gcc.c:3465
+#: gcc.c:3583
#, c-format
msgid "couldn't run '%s': %s"
msgstr ""
-#: gcc.c:3467
+#: gcc.c:3585
#, c-format
msgid "couldn't run '%s': %s: %s"
msgstr ""
-#: gcc.c:3792
+#: gcc.c:3963
#, c-format
msgid "argument to '-Xlinker' is missing"
msgstr ""
-#: gcc.c:3800
+#: gcc.c:3971
#, c-format
msgid "argument to '-Xpreprocessor' is missing"
msgstr ""
-#: gcc.c:3807
+#: gcc.c:3978
#, c-format
msgid "argument to '-Xassembler' is missing"
msgstr ""
-#: gcc.c:3814
+#: gcc.c:3985
#, c-format
msgid "argument to '-l' is missing"
msgstr ""
-#: gcc.c:3835
+#: gcc.c:4006
#, c-format
msgid "'%s' is an unknown -save-temps option"
msgstr ""
-#: gcc.c:3846
+#: gcc.c:4020
#, c-format
msgid "argument to '-specs' is missing"
msgstr ""
-#: gcc.c:3860
+#: gcc.c:4034
#, c-format
msgid "argument to '-specs=' is missing"
msgstr ""
-#: gcc.c:3882
+#: gcc.c:4062
#, c-format
msgid "argument to '-wrapper' is missing"
msgstr ""
-#: gcc.c:3910
+#: gcc.c:4090
#, c-format
msgid "'-%c' must come at the start of the command line"
msgstr ""
-#: gcc.c:3919
+#: gcc.c:4099
#, c-format
msgid "argument to '-B' is missing"
msgstr ""
-#: gcc.c:4294
+#: gcc.c:4492
#, c-format
msgid "argument to '-x' is missing"
msgstr ""
-#: gcc.c:4322
+#: gcc.c:4520 gcc.c:4951
#, c-format
msgid "argument to '-%s' is missing"
msgstr ""
-#: gcc.c:4695
+#: gcc.c:4746
+#, c-format
+msgid "unable to locate default linker script '%s' in the library search paths"
+msgstr ""
+
+#: gcc.c:4927
#, c-format
msgid "switch '%s' does not start with '-'"
msgstr ""
-#: gcc.c:4770
+#: gcc.c:5043
#, c-format
msgid "could not open temporary response file %s"
msgstr ""
-#: gcc.c:4776
+#: gcc.c:5049
#, c-format
msgid "could not write to temporary response file %s"
msgstr ""
-#: gcc.c:4782
+#: gcc.c:5055
#, c-format
msgid "could not close temporary response file %s"
msgstr ""
-#: gcc.c:4882
+#: gcc.c:5157
#, c-format
msgid "spec '%s' invalid"
msgstr ""
-#: gcc.c:5027
+#: gcc.c:5306
#, c-format
msgid "spec '%s' has invalid '%%0%c'"
msgstr ""
-#: gcc.c:5326
+#: gcc.c:5615
#, c-format
msgid "spec '%s' has invalid '%%W%c"
msgstr ""
-#: gcc.c:5346
+#: gcc.c:5635
#, c-format
msgid "spec '%s' has invalid '%%x%c'"
msgstr ""
-#: gcc.c:5568
+#: gcc.c:5857
#, c-format
msgid "Processing spec %c%s%c, which is '%s'\n"
msgstr ""
-#: gcc.c:5692
+#: gcc.c:5982
#, c-format
msgid "unknown spec function '%s'"
msgstr ""
-#: gcc.c:5711
+#: gcc.c:6002
#, c-format
msgid "error in args to spec function '%s'"
msgstr ""
-#: gcc.c:5759
+#: gcc.c:6051
#, c-format
msgid "malformed spec function name"
msgstr ""
#. )
-#: gcc.c:5762
+#: gcc.c:6054
#, c-format
msgid "no arguments for spec function"
msgstr ""
-#: gcc.c:5781
+#: gcc.c:6073
#, c-format
msgid "malformed spec function arguments"
msgstr ""
-#: gcc.c:6027
+#: gcc.c:6319
#, c-format
msgid "braced spec '%s' is invalid at '%c'"
msgstr ""
-#: gcc.c:6115
+#: gcc.c:6407
#, c-format
msgid "braced spec body '%s' is invalid"
msgstr ""
-#: gcc.c:6644
+#: gcc.c:7106
#, c-format
msgid "install: %s%s\n"
msgstr ""
-#: gcc.c:6647
+#: gcc.c:7109
#, c-format
msgid "programs: %s\n"
msgstr ""
-#: gcc.c:6649
+#: gcc.c:7111
#, c-format
msgid "libraries: %s\n"
msgstr ""
#. The error status indicates that only one set of fixed
#. headers should be built.
-#: gcc.c:6715
+#: gcc.c:7177
#, c-format
msgid "not configured with sysroot headers suffix"
msgstr ""
-#: gcc.c:6724
+#: gcc.c:7186
#, c-format
msgid ""
"\n"
"For bug reporting instructions, please see:\n"
msgstr ""
-#: gcc.c:6740
+#: gcc.c:7202
#, c-format
msgid "%s %s%s\n"
msgstr ""
-#: gcc.c:6743 gcov.c:430 fortran/gfortranspec.c:383 java/jcf-dump.c:1170
+#: gcc.c:7205 gcov.c:430 fortran/gfortranspec.c:373 java/jcf-dump.c:1170
msgid "(C)"
msgstr ""
-#: gcc.c:6744 java/jcf-dump.c:1171
+#: gcc.c:7206 java/jcf-dump.c:1171
#, c-format
msgid ""
"This is free software; see the source for copying conditions. There is NO\n"
@@ -1312,47 +1329,57 @@ msgid ""
"\n"
msgstr ""
-#: gcc.c:6761
+#: gcc.c:7223
#, c-format
msgid "Target: %s\n"
msgstr ""
-#: gcc.c:6762
+#: gcc.c:7224
#, c-format
msgid "Configured with: %s\n"
msgstr ""
-#: gcc.c:6776
+#: gcc.c:7238
#, c-format
msgid "Thread model: %s\n"
msgstr ""
-#: gcc.c:6787
+#: gcc.c:7249
#, c-format
msgid "gcc version %s %s\n"
msgstr ""
-#: gcc.c:6789
+#: gcc.c:7251
#, c-format
msgid "gcc driver version %s %sexecuting gcc version %s\n"
msgstr ""
-#: gcc.c:6797
+#: gcc.c:7259
#, c-format
msgid "no input files"
msgstr ""
-#: gcc.c:6846
+#: gcc.c:7308
#, c-format
-msgid "cannot specify -o with -c or -S with multiple files"
+msgid "cannot specify -o with -c, -S or -E with multiple files"
msgstr ""
-#: gcc.c:6880
+#: gcc.c:7342
#, c-format
msgid "spec '%s' is invalid"
msgstr ""
-#: gcc.c:7016
+#: gcc.c:7533
+#, c-format
+msgid "-use-linker-plugin, but liblto_plugin.so not found"
+msgstr ""
+
+#: gcc.c:7538
+#, c-format
+msgid "could not find libgcc.a"
+msgstr ""
+
+#: gcc.c:7549
#, c-format
msgid ""
"\n"
@@ -1361,59 +1388,59 @@ msgid ""
"\n"
msgstr ""
-#: gcc.c:7017
+#: gcc.c:7550
#, c-format
msgid ""
"Use \"-Wl,OPTION\" to pass \"OPTION\" to the linker.\n"
"\n"
msgstr ""
-#: gcc.c:7369
+#: gcc.c:7902
#, c-format
msgid "multilib spec '%s' is invalid"
msgstr ""
-#: gcc.c:7560
+#: gcc.c:8093
#, c-format
msgid "multilib exclusions '%s' is invalid"
msgstr ""
-#: gcc.c:7618 gcc.c:7759
+#: gcc.c:8151 gcc.c:8292
#, c-format
msgid "multilib select '%s' is invalid"
msgstr ""
-#: gcc.c:7797
+#: gcc.c:8330
#, c-format
msgid "multilib exclusion '%s' is invalid"
msgstr ""
-#: gcc.c:8003
+#: gcc.c:8536
#, c-format
msgid "environment variable \"%s\" not defined"
msgstr ""
-#: gcc.c:8094 gcc.c:8099
+#: gcc.c:8627 gcc.c:8632
#, c-format
msgid "invalid version number `%s'"
msgstr ""
-#: gcc.c:8142
+#: gcc.c:8675
#, c-format
msgid "too few arguments to %%:version-compare"
msgstr ""
-#: gcc.c:8148
+#: gcc.c:8681
#, c-format
msgid "too many arguments to %%:version-compare"
msgstr ""
-#: gcc.c:8189
+#: gcc.c:8722
#, c-format
msgid "unknown operator '%s' in %%:version-compare"
msgstr ""
-#: gcc.c:8223
+#: gcc.c:8756
#, c-format
msgid ""
"Assembler options\n"
@@ -1421,13 +1448,38 @@ msgid ""
"\n"
msgstr ""
-#: gcc.c:8224
+#: gcc.c:8757
#, c-format
msgid ""
"Use \"-Wa,OPTION\" to pass \"OPTION\" to the assembler.\n"
"\n"
msgstr ""
+#: gcc.c:8803
+#, c-format
+msgid "too many arguments to %%:compare-debug-dump-opt"
+msgstr ""
+
+#: gcc.c:8870
+#, c-format
+msgid "too many arguments to %%:compare-debug-self-opt"
+msgstr ""
+
+#: gcc.c:8905
+#, c-format
+msgid "too few arguments to %%:compare-debug-auxbase-opt"
+msgstr ""
+
+#: gcc.c:8908
+#, c-format
+msgid "too many arguments to %%:compare-debug-auxbase-opt"
+msgstr ""
+
+#: gcc.c:8915
+#, c-format
+msgid "argument to %%:compare-debug-auxbase-opt does not end in .gk"
+msgstr ""
+
#: gcov.c:403
#, c-format
msgid ""
@@ -1608,130 +1660,130 @@ msgstr ""
msgid "%s:stamp mismatch with graph file\n"
msgstr ""
-#: gcov.c:1082
+#: gcov.c:1083
#, c-format
msgid "%s:unknown function '%u'\n"
msgstr ""
-#: gcov.c:1095
+#: gcov.c:1097
#, c-format
msgid "%s:profile mismatch for '%s'\n"
msgstr ""
-#: gcov.c:1114
+#: gcov.c:1116
#, c-format
msgid "%s:overflowed\n"
msgstr ""
-#: gcov.c:1138
+#: gcov.c:1140
#, c-format
msgid "%s:'%s' lacks entry and/or exit blocks\n"
msgstr ""
-#: gcov.c:1143
+#: gcov.c:1145
#, c-format
msgid "%s:'%s' has arcs to entry block\n"
msgstr ""
-#: gcov.c:1151
+#: gcov.c:1153
#, c-format
msgid "%s:'%s' has arcs from exit block\n"
msgstr ""
-#: gcov.c:1359
+#: gcov.c:1361
#, c-format
msgid "%s:graph is unsolvable for '%s'\n"
msgstr ""
-#: gcov.c:1439
+#: gcov.c:1441
#, c-format
msgid "%s '%s'\n"
msgstr ""
-#: gcov.c:1442
+#: gcov.c:1444
#, c-format
msgid "Lines executed:%s of %d\n"
msgstr ""
-#: gcov.c:1446
+#: gcov.c:1448
#, c-format
msgid "No executable lines\n"
msgstr ""
-#: gcov.c:1452
+#: gcov.c:1454
#, c-format
msgid "Branches executed:%s of %d\n"
msgstr ""
-#: gcov.c:1456
+#: gcov.c:1458
#, c-format
msgid "Taken at least once:%s of %d\n"
msgstr ""
-#: gcov.c:1462
+#: gcov.c:1464
#, c-format
msgid "No branches\n"
msgstr ""
-#: gcov.c:1464
+#: gcov.c:1466
#, c-format
msgid "Calls executed:%s of %d\n"
msgstr ""
-#: gcov.c:1468
+#: gcov.c:1470
#, c-format
msgid "No calls\n"
msgstr ""
-#: gcov.c:1628
+#: gcov.c:1630
#, c-format
msgid "%s:no lines for '%s'\n"
msgstr ""
-#: gcov.c:1823
+#: gcov.c:1825
#, c-format
msgid "call %2d returned %s\n"
msgstr ""
-#: gcov.c:1828
+#: gcov.c:1830
#, c-format
msgid "call %2d never executed\n"
msgstr ""
-#: gcov.c:1833
+#: gcov.c:1835
#, c-format
msgid "branch %2d taken %s%s\n"
msgstr ""
-#: gcov.c:1837
+#: gcov.c:1839
#, c-format
msgid "branch %2d never executed\n"
msgstr ""
-#: gcov.c:1842
+#: gcov.c:1844
#, c-format
msgid "unconditional %2d taken %s\n"
msgstr ""
-#: gcov.c:1845
+#: gcov.c:1847
#, c-format
msgid "unconditional %2d never executed\n"
msgstr ""
-#: gcov.c:1881
+#: gcov.c:1883
#, c-format
msgid "%s:cannot open source file\n"
msgstr ""
-#: gcse.c:3944
+#: gcse.c:3967
msgid "PRE disabled"
msgstr ""
-#: gcse.c:4425
+#: gcse.c:4448
msgid "GCSE disabled"
msgstr ""
-#: gcse.c:4942
+#: gcse.c:4965
msgid "const/copy propagation disabled"
msgstr ""
@@ -1775,155 +1827,195 @@ msgstr ""
msgid "'"
msgstr ""
-#: langhooks.c:362
+#: langhooks.c:355
msgid "At top level:"
msgstr ""
-#: langhooks.c:382 cp/error.c:2661
+#: langhooks.c:375 cp/error.c:2710
#, c-format
msgid "In member function %qs"
msgstr ""
-#: langhooks.c:386 cp/error.c:2664
+#: langhooks.c:379 cp/error.c:2713
#, c-format
msgid "In function %qs"
msgstr ""
-#: langhooks.c:437 cp/error.c:2620
+#: langhooks.c:430 cp/error.c:2663
#, c-format
msgid " inlined from %qs at %s:%d:%d"
msgstr ""
-#: langhooks.c:442 cp/error.c:2625
+#: langhooks.c:435 cp/error.c:2668
#, c-format
msgid " inlined from %qs at %s:%d"
msgstr ""
-#: langhooks.c:448 cp/error.c:2631
+#: langhooks.c:441 cp/error.c:2674
#, c-format
msgid " inlined from %qs"
msgstr ""
-#: loop-iv.c:2965 tree-ssa-loop-niter.c:1871
+#: loop-iv.c:2966 tree-ssa-loop-niter.c:1874
msgid "assuming that the loop is not infinite"
msgstr ""
-#: loop-iv.c:2966 tree-ssa-loop-niter.c:1872
+#: loop-iv.c:2967 tree-ssa-loop-niter.c:1875
msgid "cannot optimize possibly infinite loops"
msgstr ""
-#: loop-iv.c:2974 tree-ssa-loop-niter.c:1876
+#: loop-iv.c:2975 tree-ssa-loop-niter.c:1879
msgid "assuming that the loop counter does not overflow"
msgstr ""
-#: loop-iv.c:2975 tree-ssa-loop-niter.c:1877
+#: loop-iv.c:2976 tree-ssa-loop-niter.c:1880
msgid "cannot optimize loop, the loop counter may overflow"
msgstr ""
+#: lto-wrapper.c:176
+#, c-format
+msgid "%s terminated with signal %d [%s], core dumped"
+msgstr ""
+
+#: lto-wrapper.c:179
+#, c-format
+msgid "%s terminated with signal %d [%s]"
+msgstr ""
+
+#: lto-wrapper.c:184 collect2.c:1964
+#, gcc-internal-format
+msgid "%s returned %d exit status"
+msgstr ""
+
+#: lto-wrapper.c:199
+#, c-format
+msgid "deleting LTRANS file %s"
+msgstr ""
+
+#: lto-wrapper.c:221
+#, c-format
+msgid "failed to open %s"
+msgstr ""
+
+#: lto-wrapper.c:226
+#, c-format
+msgid "could not write to temporary file %s"
+msgstr ""
+
+#: lto-wrapper.c:288 lto-wrapper.c:345
+#, c-format
+msgid "invalid LTO mode"
+msgstr ""
+
+#: lto-wrapper.c:336
+#, c-format
+msgid "fopen: %s"
+msgstr ""
+
#. What to print when a switch has no documentation.
-#: opts.c:339
+#: opts.c:341
msgid "This switch lacks documentation"
msgstr ""
-#: opts.c:1265
+#: opts.c:1289
msgid "[enabled]"
msgstr ""
-#: opts.c:1265
+#: opts.c:1289
msgid "[disabled]"
msgstr ""
-#: opts.c:1280
+#: opts.c:1304
#, c-format
msgid " No options with the desired characteristics were found\n"
msgstr ""
-#: opts.c:1289
+#: opts.c:1313
#, c-format
msgid ""
" None found. Use --help=%s to show *all* the options supported by the %s "
"front-end\n"
msgstr ""
-#: opts.c:1295
+#: opts.c:1319
#, c-format
msgid ""
" All options with the desired characteristics have already been displayed\n"
msgstr ""
-#: opts.c:1349
+#: opts.c:1373
msgid "The following options are target specific"
msgstr ""
-#: opts.c:1352
+#: opts.c:1376
msgid "The following options control compiler warning messages"
msgstr ""
-#: opts.c:1355
+#: opts.c:1379
msgid "The following options control optimizations"
msgstr ""
-#: opts.c:1358 opts.c:1397
+#: opts.c:1382 opts.c:1421
msgid "The following options are language-independent"
msgstr ""
-#: opts.c:1361
+#: opts.c:1385
msgid "The --param option recognizes the following as parameters"
msgstr ""
-#: opts.c:1367
+#: opts.c:1391
msgid "The following options are specific to just the language "
msgstr ""
-#: opts.c:1369
+#: opts.c:1393
msgid "The following options are supported by the language "
msgstr ""
-#: opts.c:1380
+#: opts.c:1404
msgid "The following options are not documented"
msgstr ""
-#: opts.c:1382
+#: opts.c:1406
msgid "The following options take separate arguments"
msgstr ""
-#: opts.c:1384
+#: opts.c:1408
msgid "The following options take joined arguments"
msgstr ""
-#: opts.c:1395
+#: opts.c:1419
msgid "The following options are language-related"
msgstr ""
-#: opts.c:1555
+#: opts.c:1579
#, c-format
msgid "warning: --help argument %.*s is ambiguous, please be more specific\n"
msgstr ""
-#: opts.c:1563
+#: opts.c:1587
#, c-format
msgid "warning: unrecognized argument to --help= option: %.*s\n"
msgstr ""
-#: reload.c:3780
+#: reload.c:3813
msgid "unable to generate reloads for:"
msgstr ""
-#: reload1.c:2094
+#: reload1.c:2151
msgid "this is the insn:"
msgstr ""
#. It's the compiler's fault.
-#: reload1.c:5619
+#: reload1.c:5671
msgid "could not find a spill register"
msgstr ""
#. It's the compiler's fault.
-#: reload1.c:7597
+#: reload1.c:7656
msgid "VOIDmode on an output"
msgstr ""
-#: reload1.c:8352
+#: reload1.c:8411
msgid "Failure trying to reload:"
msgstr ""
@@ -1981,70 +2073,75 @@ msgstr ""
msgid "collect: relinking\n"
msgstr ""
-#: toplev.c:606
+#: toplev.c:621
#, c-format
msgid "unrecoverable error"
msgstr ""
-#: toplev.c:1168
+#: toplev.c:1196
#, c-format
msgid ""
"%s%s%s %sversion %s (%s)\n"
"%s\tcompiled by GNU C version %s, "
msgstr ""
-#: toplev.c:1170
+#: toplev.c:1198
#, c-format
msgid "%s%s%s %sversion %s (%s) compiled by CC, "
msgstr ""
-#: toplev.c:1174
+#: toplev.c:1203
#, c-format
-msgid "GMP version %s, MPFR version %s.\n"
+msgid "GMP version %s, MPFR version %s, MPC version %s\n"
msgstr ""
-#: toplev.c:1176
+#: toplev.c:1206
+#, c-format
+msgid "GMP version %s, MPFR version %s\n"
+msgstr ""
+
+#: toplev.c:1209
#, c-format
msgid "%s%swarning: %s header version %s differs from library version %s.\n"
msgstr ""
-#: toplev.c:1178
+#: toplev.c:1211
#, c-format
msgid ""
"%s%sGGC heuristics: --param ggc-min-expand=%d --param ggc-min-heapsize=%d\n"
msgstr ""
-#: toplev.c:1336
+#: toplev.c:1380
msgid "options passed: "
msgstr ""
-#: toplev.c:1370
+#: toplev.c:1414
msgid "options enabled: "
msgstr ""
-#: toplev.c:1505
+#: toplev.c:1549
#, c-format
msgid "created and used with differing settings of '%s'"
msgstr ""
-#: toplev.c:1507
+#: toplev.c:1551
msgid "out of memory"
msgstr ""
-#: toplev.c:1522
+#: toplev.c:1566
msgid "created and used with different settings of -fpic"
msgstr ""
-#: toplev.c:1524
+#: toplev.c:1568
msgid "created and used with different settings of -fpie"
msgstr ""
-#: tree-vrp.c:6517
+#: tree-vrp.c:6516
msgid ""
"assuming signed overflow does not occur when simplifying && or || to & or |"
msgstr ""
-#: tree-vrp.c:6521
+#: tree-vrp.c:6520
msgid ""
"assuming signed overflow does not occur when simplifying ==, != or ! to "
"identity or ^"
@@ -2167,956 +2264,985 @@ msgstr ""
msgid "permerror: "
msgstr ""
-#: params.def:47
-msgid ""
-"The maximum structure size (in bytes) for which GCC will use by-element "
-"copies"
-msgstr ""
-
-#: params.def:56
-msgid ""
-"The maximum number of structure fields for which GCC will use by-element "
-"copies"
-msgstr ""
-
-#: params.def:68
-msgid ""
-"The threshold ratio between instantiated fields and the total structure size"
-msgstr ""
-
-#: params.def:78
+#: params.def:48
msgid "The threshold ratio between current and hottest structure counts"
msgstr ""
-#: params.def:85
+#: params.def:55
msgid "Maximal esitmated outcome of branch considered predictable"
msgstr ""
-#: params.def:102
+#: params.def:72
msgid ""
"The maximum number of instructions in a single function eligible for inlining"
msgstr ""
-#: params.def:114
+#: params.def:84
msgid "The maximum number of instructions when automatically inlining"
msgstr ""
-#: params.def:119
+#: params.def:89
msgid ""
"The maximum number of instructions inline function can grow to via recursive "
"inlining"
msgstr ""
-#: params.def:124
+#: params.def:94
msgid ""
"The maximum number of instructions non-inline function can grow to via "
"recursive inlining"
msgstr ""
-#: params.def:129
+#: params.def:99
msgid "The maximum depth of recursive inlining for inline functions"
msgstr ""
-#: params.def:134
+#: params.def:104
msgid "The maximum depth of recursive inlining for non-inline functions"
msgstr ""
-#: params.def:139
+#: params.def:109
msgid ""
"Inline recursively only when the probability of call being executed exceeds "
"the parameter"
msgstr ""
-#: params.def:146
+#: params.def:117
+msgid ""
+"The maximum number of nested indirect inlining performed by early inliner"
+msgstr ""
+
+#: params.def:124
msgid ""
"If -fvariable-expansion-in-unroller is used, the maximum number of times "
"that an individual variable will be expanded during loop unrolling"
msgstr ""
-#: params.def:152
+#: params.def:130
msgid ""
"If -ftree-vectorize is used, the minimal loop bound of a loop to be "
"considered for vectorization"
msgstr ""
-#: params.def:163
+#: params.def:141
msgid "The maximum number of instructions to consider to fill a delay slot"
msgstr ""
-#: params.def:174
+#: params.def:152
msgid ""
"The maximum number of instructions to consider to find accurate live "
"register information"
msgstr ""
-#: params.def:184
+#: params.def:162
msgid "The maximum length of scheduling's pending operations list"
msgstr ""
-#: params.def:189
+#: params.def:167
msgid "The size of function body to be considered large"
msgstr ""
-#: params.def:193
+#: params.def:171
msgid "Maximal growth due to inlining of large function (in percent)"
msgstr ""
-#: params.def:197
+#: params.def:175
msgid "The size of translation unit to be considered large"
msgstr ""
-#: params.def:201
+#: params.def:179
msgid ""
"how much can given compilation unit grow because of the inlining (in percent)"
msgstr ""
-#: params.def:205
+#: params.def:183
msgid ""
"how much can given compilation unit grow because of the interprocedural "
"constant propagation (in percent)"
msgstr ""
-#: params.def:209
-msgid "expense of call operation relative to ordinary arithmetic operations"
+#: params.def:187
+msgid ""
+"maximal estimated growth of function body caused by early inlining of single "
+"call"
msgstr ""
-#: params.def:213
+#: params.def:191
msgid "The size of stack frame to be considered large"
msgstr ""
-#: params.def:217
+#: params.def:195
msgid "Maximal stack frame growth due to inlining (in percent)"
msgstr ""
-#: params.def:224
+#: params.def:202
msgid "The maximum amount of memory to be allocated by GCSE"
msgstr ""
-#: params.def:235
+#: params.def:213
msgid ""
"The threshold ratio for performing partial redundancy elimination after "
"reload"
msgstr ""
-#: params.def:242
+#: params.def:220
msgid ""
"The threshold ratio of critical edges execution count that permit performing "
"redundancy elimination after reload"
msgstr ""
-#: params.def:253
+#: params.def:231
msgid "The maximum number of instructions to consider to unroll in a loop"
msgstr ""
-#: params.def:259
+#: params.def:237
msgid ""
"The maximum number of instructions to consider to unroll in a loop on average"
msgstr ""
-#: params.def:264
+#: params.def:242
msgid "The maximum number of unrollings of a single loop"
msgstr ""
-#: params.def:269
+#: params.def:247
msgid "The maximum number of insns of a peeled loop"
msgstr ""
-#: params.def:274
+#: params.def:252
msgid "The maximum number of peelings of a single loop"
msgstr ""
-#: params.def:279
+#: params.def:257
msgid "The maximum number of insns of a completely peeled loop"
msgstr ""
-#: params.def:284
+#: params.def:262
msgid ""
"The maximum number of peelings of a single loop that is peeled completely"
msgstr ""
-#: params.def:289
+#: params.def:267
msgid "The maximum number of insns of a peeled loop that rolls only once"
msgstr ""
-#: params.def:295
+#: params.def:273
msgid "The maximum number of insns of an unswitched loop"
msgstr ""
-#: params.def:300
+#: params.def:278
msgid "The maximum number of unswitchings in a single loop"
msgstr ""
-#: params.def:307
+#: params.def:285
msgid ""
"Bound on the number of iterations the brute force # of iterations analysis "
"algorithm evaluates"
msgstr ""
-#: params.def:313
+#: params.def:291
msgid "Bound on the cost of an expression to compute the number of iterations"
msgstr ""
-#: params.def:319
+#: params.def:297
msgid ""
"A factor for tuning the upper bound that swing modulo scheduler uses for "
"scheduling a loop"
msgstr ""
-#: params.def:323
+#: params.def:301
msgid ""
"The number of cycles the swing modulo scheduler considers when checking "
"conflicts using DFA"
msgstr ""
-#: params.def:327
+#: params.def:305
msgid ""
"A threshold on the average loop count considered by the swing modulo "
"scheduler"
msgstr ""
-#: params.def:332
+#: params.def:310
msgid ""
"Select fraction of the maximal count of repetitions of basic block in "
"program given basic block needs to have to be considered hot"
msgstr ""
-#: params.def:336
+#: params.def:314
msgid ""
"Select fraction of the maximal frequency of executions of basic block in "
"function given basic block needs to have to be considered hot"
msgstr ""
-#: params.def:341
+#: params.def:319
msgid ""
"Select fraction of the maximal frequency of executions of basic block in "
"function given basic block get alignment"
msgstr ""
-#: params.def:346
+#: params.def:324
msgid ""
"Loops iterating at least selected number of iterations will get loop "
"alignement."
msgstr ""
-#: params.def:362
+#: params.def:340
msgid "The maximum number of loop iterations we predict statically"
msgstr ""
-#: params.def:366
+#: params.def:344
msgid ""
"The percentage of function, weighted by execution frequency, that must be "
"covered by trace formation. Used when profile feedback is available"
msgstr ""
-#: params.def:370
+#: params.def:348
msgid ""
"The percentage of function, weighted by execution frequency, that must be "
"covered by trace formation. Used when profile feedback is not available"
msgstr ""
-#: params.def:374
+#: params.def:352
msgid "Maximal code growth caused by tail duplication (in percent)"
msgstr ""
-#: params.def:378
+#: params.def:356
msgid ""
"Stop reverse growth if the reverse probability of best edge is less than "
"this threshold (in percent)"
msgstr ""
-#: params.def:382
+#: params.def:360
msgid ""
"Stop forward growth if the probability of best edge is less than this "
"threshold (in percent). Used when profile feedback is available"
msgstr ""
-#: params.def:386
+#: params.def:364
msgid ""
"Stop forward growth if the probability of best edge is less than this "
"threshold (in percent). Used when profile feedback is not available"
msgstr ""
-#: params.def:392
+#: params.def:370
msgid "The maximum number of incoming edges to consider for crossjumping"
msgstr ""
-#: params.def:398
+#: params.def:376
msgid ""
"The minimum number of matching instructions to consider for crossjumping"
msgstr ""
-#: params.def:404
+#: params.def:382
msgid "The maximum expansion factor when copying basic blocks"
msgstr ""
-#: params.def:410
+#: params.def:388
msgid ""
"The maximum number of insns to duplicate when unfactoring computed gotos"
msgstr ""
-#: params.def:416
+#: params.def:394
msgid "The maximum length of path considered in cse"
msgstr ""
-#: params.def:420
+#: params.def:398
msgid "The maximum instructions CSE process before flushing"
msgstr ""
-#: params.def:427
+#: params.def:405
msgid ""
"The minimum cost of an expensive expression in the loop invariant motion"
msgstr ""
-#: params.def:436
+#: params.def:414
msgid ""
"Bound on number of candidates below that all candidates are considered in iv "
"optimizations"
msgstr ""
-#: params.def:444
+#: params.def:422
msgid "Bound on number of iv uses in loop optimized in iv optimizations"
msgstr ""
-#: params.def:452
+#: params.def:430
msgid ""
"If number of candidates in the set is smaller, we always try to remove "
"unused ivs during its optimization"
msgstr ""
-#: params.def:457
+#: params.def:435
msgid "Bound on size of expressions used in the scalar evolutions analyzer"
msgstr ""
-#: params.def:462
+#: params.def:440
msgid "Bound on the number of variables in Omega constraint systems"
msgstr ""
-#: params.def:467
+#: params.def:445
msgid "Bound on the number of inequalities in Omega constraint systems"
msgstr ""
-#: params.def:472
+#: params.def:450
msgid "Bound on the number of equalities in Omega constraint systems"
msgstr ""
-#: params.def:477
+#: params.def:455
msgid "Bound on the number of wild cards in Omega constraint systems"
msgstr ""
-#: params.def:482
+#: params.def:460
msgid "Bound on the size of the hash table in Omega constraint systems"
msgstr ""
-#: params.def:487
+#: params.def:465
msgid "Bound on the number of keys in Omega constraint systems"
msgstr ""
-#: params.def:492
+#: params.def:470
msgid ""
"When set to 1, use expensive methods to eliminate all redundant constraints"
msgstr ""
-#: params.def:497
+#: params.def:475
msgid ""
"Bound on number of runtime checks inserted by the vectorizer's loop "
"versioning for alignment check"
msgstr ""
-#: params.def:502
+#: params.def:480
msgid ""
"Bound on number of runtime checks inserted by the vectorizer's loop "
"versioning for alias check"
msgstr ""
-#: params.def:507
+#: params.def:485
msgid "The maximum memory locations recorded by cselib"
msgstr ""
-#: params.def:520
+#: params.def:498
msgid ""
"Minimum heap expansion to trigger garbage collection, as a percentage of the "
"total size of the heap"
msgstr ""
-#: params.def:525
+#: params.def:503
msgid "Minimum heap size before we start collecting garbage, in kilobytes"
msgstr ""
-#: params.def:533
+#: params.def:511
msgid ""
"The maximum number of instructions to search backward when looking for "
"equivalent reload"
msgstr ""
-#: params.def:538 params.def:548
+#: params.def:516 params.def:526
msgid ""
"The maximum number of blocks in a region to be considered for interblock "
"scheduling"
msgstr ""
-#: params.def:543 params.def:553
+#: params.def:521 params.def:531
msgid ""
"The maximum number of insns in a region to be considered for interblock "
"scheduling"
msgstr ""
-#: params.def:558
+#: params.def:536
msgid ""
"The minimum probability of reaching a source block for interblock "
"speculative scheduling"
msgstr ""
-#: params.def:563
+#: params.def:541
msgid "The maximum number of iterations through CFG to extend regions"
msgstr ""
-#: params.def:568
+#: params.def:546
msgid ""
"The maximum conflict delay for an insn to be considered for speculative "
"motion"
msgstr ""
-#: params.def:573
+#: params.def:551
msgid ""
"The minimal probability of speculation success (in percents), so that "
"speculative insn will be scheduled."
msgstr ""
-#: params.def:578
+#: params.def:556
msgid "The maximum size of the lookahead window of selective scheduling"
msgstr ""
-#: params.def:583
+#: params.def:561
msgid "Maximum number of times that an insn could be scheduled"
msgstr ""
-#: params.def:588
+#: params.def:566
msgid ""
"Maximum number of instructions in the ready list that are considered "
"eligible for renaming"
msgstr ""
-#: params.def:593
+#: params.def:571
msgid "Minimal distance between possibly conflicting store and load"
msgstr ""
-#: params.def:598
+#: params.def:576
msgid ""
"The maximum number of RTL nodes that can be recorded as combiner's last value"
msgstr ""
-#: params.def:606
+#: params.def:584
msgid "The upper bound for sharing integer constants"
msgstr ""
-#: params.def:625
+#: params.def:603
msgid ""
"Minimum number of virtual mappings to consider switching to full virtual "
"renames"
msgstr ""
-#: params.def:630
+#: params.def:608
msgid ""
"Ratio between virtual mappings and virtual symbols to do full virtual renames"
msgstr ""
-#: params.def:635
+#: params.def:613
msgid ""
"The lower bound for a buffer to be considered for stack smashing protection"
msgstr ""
-#: params.def:653
+#: params.def:631
msgid ""
"Maximum number of statements allowed in a block that needs to be duplicated "
"when threading jumps"
msgstr ""
-#: params.def:662
+#: params.def:640
msgid ""
"Maximum number of fields in a structure before pointer analysis treats the "
"structure as a single variable"
msgstr ""
-#: params.def:667
+#: params.def:645
msgid ""
"The maximum number of instructions ready to be issued to be considered by "
"the scheduler during the first scheduling pass"
msgstr ""
-#: params.def:677
+#: params.def:655
msgid "The number of insns executed before prefetch is completed"
msgstr ""
-#: params.def:684
+#: params.def:662
msgid "The number of prefetches that can run at the same time"
msgstr ""
-#: params.def:691
+#: params.def:669
msgid "The size of L1 cache"
msgstr ""
-#: params.def:698
+#: params.def:676
msgid "The size of L1 cache line"
msgstr ""
-#: params.def:705
+#: params.def:683
msgid "The size of L2 cache"
msgstr ""
-#: params.def:716
+#: params.def:694
msgid "Whether to use canonical types"
msgstr ""
-#: params.def:721
+#: params.def:699
msgid ""
"Maximum length of partial antic set when performing tree pre optimization"
msgstr ""
-#: params.def:731
+#: params.def:709
msgid "Maximum size of a SCC before SCCVN stops processing a function"
msgstr ""
-#: params.def:736
+#: params.def:714
msgid "max loops number for regional RA"
msgstr ""
-#: params.def:741
+#: params.def:719
msgid "max size of conflict table in MB"
msgstr ""
-#: params.def:749
+#: params.def:724
+msgid ""
+"The number of registers in each class kept unused by loop invariant motion"
+msgstr ""
+
+#: params.def:732
msgid ""
"The maximum ratio between array size and switch branches for a switch "
"conversion to take place"
msgstr ""
-#: params.def:757
+#: params.def:740
msgid "max basic blocks number in loop for loop invariant motion"
msgstr ""
-#: config/alpha/alpha.c:5054
+#: params.def:746
+msgid ""
+"Maximum number of instructions in basic block to be considered for SLP "
+"vectorization"
+msgstr ""
+
+#: params.def:751
+msgid ""
+"min. ratio of insns to prefetches to enable prefetching for a loop with an "
+"unknown trip count"
+msgstr ""
+
+#: params.def:757
+msgid "min. ratio of insns to mem ops to enable prefetching in a loop"
+msgstr ""
+
+#: params.def:764
+msgid "The minimum UID to be used for a nondebug insn"
+msgstr ""
+
+#: params.def:769
+msgid ""
+"maximum allowed growth of size of new parameters ipa-sra replaces a pointer "
+"to an aggregate with"
+msgstr ""
+
+#: config/alpha/alpha.c:5131
#, c-format
msgid "invalid %%H value"
msgstr ""
-#: config/alpha/alpha.c:5075 config/bfin/bfin.c:1631
+#: config/alpha/alpha.c:5152 config/bfin/bfin.c:1682
#, c-format
msgid "invalid %%J value"
msgstr ""
-#: config/alpha/alpha.c:5105 config/ia64/ia64.c:4765
+#: config/alpha/alpha.c:5182 config/ia64/ia64.c:4978
#, c-format
msgid "invalid %%r value"
msgstr ""
-#: config/alpha/alpha.c:5115 config/ia64/ia64.c:4719
-#: config/rs6000/rs6000.c:12250 config/xtensa/xtensa.c:2242
+#: config/alpha/alpha.c:5192 config/ia64/ia64.c:4932
+#: config/rs6000/rs6000.c:14541 config/xtensa/xtensa.c:2253
#, c-format
msgid "invalid %%R value"
msgstr ""
-#: config/alpha/alpha.c:5121 config/rs6000/rs6000.c:12169
-#: config/xtensa/xtensa.c:2209
+#: config/alpha/alpha.c:5198 config/rs6000/rs6000.c:14460
+#: config/xtensa/xtensa.c:2220
#, c-format
msgid "invalid %%N value"
msgstr ""
-#: config/alpha/alpha.c:5129 config/rs6000/rs6000.c:12197
+#: config/alpha/alpha.c:5206 config/rs6000/rs6000.c:14488
#, c-format
msgid "invalid %%P value"
msgstr ""
-#: config/alpha/alpha.c:5137
+#: config/alpha/alpha.c:5214
#, c-format
msgid "invalid %%h value"
msgstr ""
-#: config/alpha/alpha.c:5145 config/xtensa/xtensa.c:2235
+#: config/alpha/alpha.c:5222 config/xtensa/xtensa.c:2246
#, c-format
msgid "invalid %%L value"
msgstr ""
-#: config/alpha/alpha.c:5184 config/rs6000/rs6000.c:12151
+#: config/alpha/alpha.c:5261 config/rs6000/rs6000.c:14442
#, c-format
msgid "invalid %%m value"
msgstr ""
-#: config/alpha/alpha.c:5192 config/rs6000/rs6000.c:12159
+#: config/alpha/alpha.c:5269 config/rs6000/rs6000.c:14450
#, c-format
msgid "invalid %%M value"
msgstr ""
-#: config/alpha/alpha.c:5236
+#: config/alpha/alpha.c:5313
#, c-format
msgid "invalid %%U value"
msgstr ""
-#: config/alpha/alpha.c:5248 config/alpha/alpha.c:5262
-#: config/rs6000/rs6000.c:12258
+#: config/alpha/alpha.c:5325 config/alpha/alpha.c:5339
+#: config/rs6000/rs6000.c:14549
#, c-format
msgid "invalid %%s value"
msgstr ""
-#: config/alpha/alpha.c:5285
+#: config/alpha/alpha.c:5362
#, c-format
msgid "invalid %%C value"
msgstr ""
-#: config/alpha/alpha.c:5322 config/rs6000/rs6000.c:11986
-#: config/rs6000/rs6000.c:12005
+#: config/alpha/alpha.c:5399 config/rs6000/rs6000.c:14296
#, c-format
msgid "invalid %%E value"
msgstr ""
-#: config/alpha/alpha.c:5347 config/alpha/alpha.c:5395
+#: config/alpha/alpha.c:5424 config/alpha/alpha.c:5472
#, c-format
msgid "unknown relocation unspec"
msgstr ""
-#: config/alpha/alpha.c:5356 config/crx/crx.c:1081
-#: config/rs6000/rs6000.c:12589 config/spu/spu.c:1614
+#: config/alpha/alpha.c:5433 config/crx/crx.c:1092
+#: config/rs6000/rs6000.c:14903 config/spu/spu.c:1647
#, c-format
msgid "invalid %%xn code"
msgstr ""
-#: config/arc/arc.c:1729 config/m32r/m32r.c:1820
+#: config/arc/arc.c:1724 config/m32r/m32r.c:1980
#, c-format
msgid "invalid operand to %%R code"
msgstr ""
-#: config/arc/arc.c:1761 config/m32r/m32r.c:1843
+#: config/arc/arc.c:1756 config/m32r/m32r.c:2003
#, c-format
msgid "invalid operand to %%H/%%L code"
msgstr ""
-#: config/arc/arc.c:1783 config/m32r/m32r.c:1914
+#: config/arc/arc.c:1778 config/m32r/m32r.c:2074
#, c-format
msgid "invalid operand to %%U code"
msgstr ""
-#: config/arc/arc.c:1794
+#: config/arc/arc.c:1789
#, c-format
msgid "invalid operand to %%V code"
msgstr ""
#. Unknown flag.
#. Undocumented flag.
-#: config/arc/arc.c:1801 config/m32r/m32r.c:1941 config/sparc/sparc.c:7048
+#: config/arc/arc.c:1796 config/m32r/m32r.c:2101 config/sparc/sparc.c:7184
#, c-format
msgid "invalid operand output code"
msgstr ""
-#: config/arm/arm.c:13323 config/arm/arm.c:13341
+#: config/arm/arm.c:14627 config/arm/arm.c:14645
#, c-format
msgid "predicated Thumb instruction"
msgstr ""
-#: config/arm/arm.c:13329
+#: config/arm/arm.c:14633
#, c-format
msgid "predicated instruction in conditional sequence"
msgstr ""
-#: config/arm/arm.c:13499
+#: config/arm/arm.c:14803
#, c-format
msgid "invalid shift operand"
msgstr ""
-#: config/arm/arm.c:13546 config/arm/arm.c:13556 config/arm/arm.c:13566
-#: config/arm/arm.c:13576 config/arm/arm.c:13586 config/arm/arm.c:13625
-#: config/arm/arm.c:13643 config/arm/arm.c:13678 config/arm/arm.c:13697
-#: config/arm/arm.c:13712 config/arm/arm.c:13740 config/arm/arm.c:13747
-#: config/arm/arm.c:13755 config/arm/arm.c:13776 config/arm/arm.c:13783
-#: config/bfin/bfin.c:1644 config/bfin/bfin.c:1651 config/bfin/bfin.c:1658
-#: config/bfin/bfin.c:1665 config/bfin/bfin.c:1674 config/bfin/bfin.c:1681
-#: config/bfin/bfin.c:1688 config/bfin/bfin.c:1695
+#: config/arm/arm.c:14850 config/arm/arm.c:14860 config/arm/arm.c:14870
+#: config/arm/arm.c:14880 config/arm/arm.c:14890 config/arm/arm.c:14929
+#: config/arm/arm.c:14947 config/arm/arm.c:14982 config/arm/arm.c:15001
+#: config/arm/arm.c:15016 config/arm/arm.c:15044 config/arm/arm.c:15051
+#: config/arm/arm.c:15059 config/arm/arm.c:15080 config/arm/arm.c:15087
+#: config/arm/arm.c:15178 config/arm/arm.c:15185 config/bfin/bfin.c:1695
+#: config/bfin/bfin.c:1702 config/bfin/bfin.c:1709 config/bfin/bfin.c:1716
+#: config/bfin/bfin.c:1725 config/bfin/bfin.c:1732 config/bfin/bfin.c:1739
+#: config/bfin/bfin.c:1746
#, c-format
msgid "invalid operand for code '%c'"
msgstr ""
-#: config/arm/arm.c:13638
+#: config/arm/arm.c:14942
#, c-format
msgid "instruction never executed"
msgstr ""
-#: config/arm/arm.c:13850
+#: config/arm/arm.c:15197
#, c-format
msgid "missing operand"
msgstr ""
-#: config/avr/avr.c:1212
+#: config/arm/arm.c:17472
+msgid "function parameters cannot have __fp16 type"
+msgstr ""
+
+#: config/arm/arm.c:17482
+msgid "functions cannot return __fp16 type"
+msgstr ""
+
+#: config/avr/avr.c:1083
#, c-format
msgid "address operand requires constraint for X, Y, or Z register"
msgstr ""
-#: config/avr/avr.c:1324
+#: config/avr/avr.c:1195
msgid "bad address, not (reg+disp):"
msgstr ""
-#: config/avr/avr.c:1331
+#: config/avr/avr.c:1202
msgid "bad address, not post_inc or pre_dec:"
msgstr ""
-#: config/avr/avr.c:1342
+#: config/avr/avr.c:1213
msgid "internal compiler error. Bad address:"
msgstr ""
-#: config/avr/avr.c:1355
+#: config/avr/avr.c:1226
msgid "internal compiler error. Unknown mode:"
msgstr ""
-#: config/avr/avr.c:1950 config/avr/avr.c:2638
+#: config/avr/avr.c:1813 config/avr/avr.c:2501
msgid "invalid insn:"
msgstr ""
-#: config/avr/avr.c:1989 config/avr/avr.c:2075 config/avr/avr.c:2124
-#: config/avr/avr.c:2152 config/avr/avr.c:2247 config/avr/avr.c:2416
-#: config/avr/avr.c:2677 config/avr/avr.c:2789
+#: config/avr/avr.c:1852 config/avr/avr.c:1938 config/avr/avr.c:1987
+#: config/avr/avr.c:2015 config/avr/avr.c:2110 config/avr/avr.c:2279
+#: config/avr/avr.c:2540 config/avr/avr.c:2652
msgid "incorrect insn:"
msgstr ""
-#: config/avr/avr.c:2171 config/avr/avr.c:2332 config/avr/avr.c:2487
-#: config/avr/avr.c:2855
+#: config/avr/avr.c:2034 config/avr/avr.c:2195 config/avr/avr.c:2350
+#: config/avr/avr.c:2718
msgid "unknown move insn:"
msgstr ""
-#: config/avr/avr.c:3085
+#: config/avr/avr.c:2948
msgid "bad shift insn:"
msgstr ""
-#: config/avr/avr.c:3201 config/avr/avr.c:3621 config/avr/avr.c:3979
+#: config/avr/avr.c:3064 config/avr/avr.c:3484 config/avr/avr.c:3842
msgid "internal compiler error. Incorrect shift:"
msgstr ""
-#: config/bfin/bfin.c:1593
+#: config/bfin/bfin.c:1644
#, c-format
msgid "invalid %%j value"
msgstr ""
-#: config/bfin/bfin.c:1786
+#: config/bfin/bfin.c:1837
#, c-format
msgid "invalid const_double operand"
msgstr ""
-#: config/cris/cris.c:504 c-typeck.c:5217 c-typeck.c:5233 c-typeck.c:5250
-#: final.c:3010 final.c:3012 gcc.c:4940 loop-iv.c:2967 loop-iv.c:2976
-#: rtl-error.c:105 toplev.c:610 tree-ssa-loop-niter.c:1882 cp/typeck.c:4743
-#: java/expr.c:411
+#: config/cris/cris.c:520 config/moxie/moxie.c:91 c-typeck.c:5415
+#: c-typeck.c:5431 c-typeck.c:5448 final.c:3090 final.c:3092 fold-const.c:996
+#: gcc.c:5219 loop-iv.c:2968 loop-iv.c:2977 rtl-error.c:105 toplev.c:625
+#: tree-ssa-loop-niter.c:1883 tree-vrp.c:5726 cp/typeck.c:4813 java/expr.c:411
#, gcc-internal-format
msgid "%s"
msgstr ""
-#: config/cris/cris.c:555
+#: config/cris/cris.c:571
msgid "unexpected index-type in cris_print_index"
msgstr ""
-#: config/cris/cris.c:572
+#: config/cris/cris.c:588
msgid "unexpected base-type in cris_print_base"
msgstr ""
-#: config/cris/cris.c:688
+#: config/cris/cris.c:704
msgid "invalid operand for 'b' modifier"
msgstr ""
-#: config/cris/cris.c:705
+#: config/cris/cris.c:721
msgid "invalid operand for 'o' modifier"
msgstr ""
-#: config/cris/cris.c:724
+#: config/cris/cris.c:740
msgid "invalid operand for 'O' modifier"
msgstr ""
-#: config/cris/cris.c:757
+#: config/cris/cris.c:773
msgid "invalid operand for 'p' modifier"
msgstr ""
-#: config/cris/cris.c:796
+#: config/cris/cris.c:812
msgid "invalid operand for 'z' modifier"
msgstr ""
-#: config/cris/cris.c:860 config/cris/cris.c:894
+#: config/cris/cris.c:876 config/cris/cris.c:910
msgid "invalid operand for 'H' modifier"
msgstr ""
-#: config/cris/cris.c:870
+#: config/cris/cris.c:886
msgid "bad register"
msgstr ""
-#: config/cris/cris.c:914
+#: config/cris/cris.c:930
msgid "invalid operand for 'e' modifier"
msgstr ""
-#: config/cris/cris.c:931
+#: config/cris/cris.c:947
msgid "invalid operand for 'm' modifier"
msgstr ""
-#: config/cris/cris.c:956
+#: config/cris/cris.c:972
msgid "invalid operand for 'A' modifier"
msgstr ""
-#: config/cris/cris.c:979
+#: config/cris/cris.c:995
msgid "invalid operand for 'D' modifier"
msgstr ""
-#: config/cris/cris.c:993
+#: config/cris/cris.c:1009
msgid "invalid operand for 'T' modifier"
msgstr ""
-#: config/cris/cris.c:1013
+#: config/cris/cris.c:1029 config/moxie/moxie.c:161
msgid "invalid operand modifier letter"
msgstr ""
-#: config/cris/cris.c:1070
+#: config/cris/cris.c:1086
msgid "unexpected multiplicative operand"
msgstr ""
-#: config/cris/cris.c:1090
+#: config/cris/cris.c:1106 config/moxie/moxie.c:186
msgid "unexpected operand"
msgstr ""
-#: config/cris/cris.c:1123 config/cris/cris.c:1133
+#: config/cris/cris.c:1139 config/cris/cris.c:1149
msgid "unrecognized address"
msgstr ""
-#: config/cris/cris.c:2231
+#: config/cris/cris.c:2257
msgid "unrecognized supposed constant"
msgstr ""
-#: config/cris/cris.c:2660 config/cris/cris.c:2724
+#: config/cris/cris.c:2686 config/cris/cris.c:2750
msgid "unexpected side-effects in address"
msgstr ""
#. Can't possibly get a GOT-needing-fixup for a function-call,
#. right?
-#: config/cris/cris.c:3561
+#: config/cris/cris.c:3587
msgid "Unidentifiable call op"
msgstr ""
-#: config/cris/cris.c:3613
+#: config/cris/cris.c:3639
#, c-format
msgid "PIC register isn't set up"
msgstr ""
-#: config/fr30/fr30.c:464
+#: config/fr30/fr30.c:481
#, c-format
msgid "fr30_print_operand_address: unhandled address"
msgstr ""
-#: config/fr30/fr30.c:488
+#: config/fr30/fr30.c:505
#, c-format
msgid "fr30_print_operand: unrecognized %%p code"
msgstr ""
-#: config/fr30/fr30.c:508
+#: config/fr30/fr30.c:525
#, c-format
msgid "fr30_print_operand: unrecognized %%b code"
msgstr ""
-#: config/fr30/fr30.c:529
+#: config/fr30/fr30.c:546
#, c-format
msgid "fr30_print_operand: unrecognized %%B code"
msgstr ""
-#: config/fr30/fr30.c:537
+#: config/fr30/fr30.c:554
#, c-format
msgid "fr30_print_operand: invalid operand to %%A code"
msgstr ""
-#: config/fr30/fr30.c:554
+#: config/fr30/fr30.c:571
#, c-format
msgid "fr30_print_operand: invalid %%x code"
msgstr ""
-#: config/fr30/fr30.c:561
+#: config/fr30/fr30.c:578
#, c-format
msgid "fr30_print_operand: invalid %%F code"
msgstr ""
-#: config/fr30/fr30.c:578
+#: config/fr30/fr30.c:595
#, c-format
msgid "fr30_print_operand: unknown code"
msgstr ""
-#: config/fr30/fr30.c:606 config/fr30/fr30.c:615 config/fr30/fr30.c:626
-#: config/fr30/fr30.c:639
+#: config/fr30/fr30.c:623 config/fr30/fr30.c:632 config/fr30/fr30.c:643
+#: config/fr30/fr30.c:656
#, c-format
msgid "fr30_print_operand: unhandled MEM"
msgstr ""
-#: config/frv/frv.c:2589
+#: config/frv/frv.c:2592
msgid "bad insn to frv_print_operand_address:"
msgstr ""
-#: config/frv/frv.c:2600
+#: config/frv/frv.c:2603
msgid "bad register to frv_print_operand_memory_reference_reg:"
msgstr ""
-#: config/frv/frv.c:2639 config/frv/frv.c:2649 config/frv/frv.c:2658
-#: config/frv/frv.c:2679 config/frv/frv.c:2684
+#: config/frv/frv.c:2642 config/frv/frv.c:2652 config/frv/frv.c:2661
+#: config/frv/frv.c:2682 config/frv/frv.c:2687
msgid "bad insn to frv_print_operand_memory_reference:"
msgstr ""
-#: config/frv/frv.c:2770
+#: config/frv/frv.c:2773
#, c-format
msgid "bad condition code"
msgstr ""
-#: config/frv/frv.c:2845
+#: config/frv/frv.c:2848
msgid "bad insn in frv_print_operand, bad const_double"
msgstr ""
-#: config/frv/frv.c:2906
+#: config/frv/frv.c:2909
msgid "bad insn to frv_print_operand, 'e' modifier:"
msgstr ""
-#: config/frv/frv.c:2914
+#: config/frv/frv.c:2917
msgid "bad insn to frv_print_operand, 'F' modifier:"
msgstr ""
-#: config/frv/frv.c:2930
+#: config/frv/frv.c:2933
msgid "bad insn to frv_print_operand, 'f' modifier:"
msgstr ""
-#: config/frv/frv.c:2944
+#: config/frv/frv.c:2947
msgid "bad insn to frv_print_operand, 'g' modifier:"
msgstr ""
-#: config/frv/frv.c:2992
+#: config/frv/frv.c:2995
msgid "bad insn to frv_print_operand, 'L' modifier:"
msgstr ""
-#: config/frv/frv.c:3005
+#: config/frv/frv.c:3008
msgid "bad insn to frv_print_operand, 'M/N' modifier:"
msgstr ""
-#: config/frv/frv.c:3026
+#: config/frv/frv.c:3029
msgid "bad insn to frv_print_operand, 'O' modifier:"
msgstr ""
-#: config/frv/frv.c:3044
+#: config/frv/frv.c:3047
msgid "bad insn to frv_print_operand, P modifier:"
msgstr ""
-#: config/frv/frv.c:3064
+#: config/frv/frv.c:3067
msgid "bad insn in frv_print_operand, z case"
msgstr ""
-#: config/frv/frv.c:3095
+#: config/frv/frv.c:3098
msgid "bad insn in frv_print_operand, 0 case"
msgstr ""
-#: config/frv/frv.c:3100
+#: config/frv/frv.c:3103
msgid "frv_print_operand: unknown code"
msgstr ""
-#: config/frv/frv.c:4469
+#: config/frv/frv.c:4456
msgid "bad output_move_single operand"
msgstr ""
-#: config/frv/frv.c:4596
+#: config/frv/frv.c:4583
msgid "bad output_move_double operand"
msgstr ""
-#: config/frv/frv.c:4738
+#: config/frv/frv.c:4725
msgid "bad output_condmove_single operand"
msgstr ""
@@ -3134,61 +3260,61 @@ msgstr ""
msgid " (frv)"
msgstr ""
-#: config/i386/i386.c:10366
+#: config/i386/i386.c:10758
#, c-format
msgid "invalid UNSPEC as operand"
msgstr ""
-#: config/i386/i386.c:10980 config/i386/i386.c:11055
+#: config/i386/i386.c:11370 config/i386/i386.c:11445
#, c-format
msgid "invalid operand size for operand code '%c'"
msgstr ""
-#: config/i386/i386.c:11050
+#: config/i386/i386.c:11440
#, c-format
msgid "invalid operand type used with operand code '%c'"
msgstr ""
-#: config/i386/i386.c:11130 config/i386/i386.c:11169 config/i386/i386.c:11343
+#: config/i386/i386.c:11520 config/i386/i386.c:11559
#, c-format
msgid "operand is not a condition code, invalid operand code 'D'"
msgstr ""
-#: config/i386/i386.c:11194
+#: config/i386/i386.c:11584
#, c-format
msgid ""
"operand is neither a constant nor a condition code, invalid operand code 'C'"
msgstr ""
-#: config/i386/i386.c:11204
+#: config/i386/i386.c:11594
#, c-format
msgid ""
"operand is neither a constant nor a condition code, invalid operand code 'F'"
msgstr ""
-#: config/i386/i386.c:11222
+#: config/i386/i386.c:11612
#, c-format
msgid ""
"operand is neither a constant nor a condition code, invalid operand code 'c'"
msgstr ""
-#: config/i386/i386.c:11232
+#: config/i386/i386.c:11622
#, c-format
msgid ""
"operand is neither a constant nor a condition code, invalid operand code 'f'"
msgstr ""
-#: config/i386/i386.c:11357
+#: config/i386/i386.c:11692
#, c-format
msgid "invalid operand code '%c'"
msgstr ""
-#: config/i386/i386.c:11406
+#: config/i386/i386.c:11741
#, c-format
msgid "invalid constraints for operand"
msgstr ""
-#: config/i386/i386.c:19388
+#: config/i386/i386.c:19309
msgid "unknown insn mode"
msgstr ""
@@ -3209,195 +3335,201 @@ msgstr ""
msgid "environment variable DJGPP points to corrupt file '%s'"
msgstr ""
-#: config/ia64/ia64.c:4647
+#: config/ia64/ia64.c:4860
#, c-format
msgid "invalid %%G mode"
msgstr ""
-#: config/ia64/ia64.c:4817
+#: config/ia64/ia64.c:5030
#, c-format
msgid "ia64_print_operand: unknown code"
msgstr ""
-#: config/ia64/ia64.c:10495
+#: config/ia64/ia64.c:10748
msgid "invalid conversion from %<__fpreg%>"
msgstr ""
-#: config/ia64/ia64.c:10498
+#: config/ia64/ia64.c:10751
msgid "invalid conversion to %<__fpreg%>"
msgstr ""
-#: config/ia64/ia64.c:10511 config/ia64/ia64.c:10522
+#: config/ia64/ia64.c:10764 config/ia64/ia64.c:10775
msgid "invalid operation on %<__fpreg%>"
msgstr ""
-#: config/iq2000/iq2000.c:3137
+#: config/iq2000/iq2000.c:3130
#, c-format
msgid "invalid %%P operand"
msgstr ""
-#: config/iq2000/iq2000.c:3145 config/rs6000/rs6000.c:12187
+#: config/iq2000/iq2000.c:3138 config/rs6000/rs6000.c:14478
#, c-format
msgid "invalid %%p value"
msgstr ""
-#: config/iq2000/iq2000.c:3201
+#: config/iq2000/iq2000.c:3194
#, c-format
msgid "invalid use of %%d, %%x, or %%X"
msgstr ""
-#: config/m32r/m32r.c:1790
+#: config/m32r/m32r.c:1950
#, c-format
msgid "invalid operand to %%s code"
msgstr ""
-#: config/m32r/m32r.c:1797
+#: config/m32r/m32r.c:1957
#, c-format
msgid "invalid operand to %%p code"
msgstr ""
-#: config/m32r/m32r.c:1852
+#: config/m32r/m32r.c:2012
msgid "bad insn for 'A'"
msgstr ""
-#: config/m32r/m32r.c:1899
+#: config/m32r/m32r.c:2059
#, c-format
msgid "invalid operand to %%T/%%B code"
msgstr ""
-#: config/m32r/m32r.c:1922
+#: config/m32r/m32r.c:2082
#, c-format
msgid "invalid operand to %%N code"
msgstr ""
-#: config/m32r/m32r.c:1955
+#: config/m32r/m32r.c:2115
msgid "pre-increment address is not a register"
msgstr ""
-#: config/m32r/m32r.c:1962
+#: config/m32r/m32r.c:2122
msgid "pre-decrement address is not a register"
msgstr ""
-#: config/m32r/m32r.c:1969
+#: config/m32r/m32r.c:2129
msgid "post-increment address is not a register"
msgstr ""
-#: config/m32r/m32r.c:2045 config/m32r/m32r.c:2059
-#: config/rs6000/rs6000.c:20957
+#: config/m32r/m32r.c:2205 config/m32r/m32r.c:2219
+#: config/rs6000/rs6000.c:23575
msgid "bad address"
msgstr ""
-#: config/m32r/m32r.c:2064
+#: config/m32r/m32r.c:2224
msgid "lo_sum not of register"
msgstr ""
#. !!!! SCz wrong here.
-#: config/m68hc11/m68hc11.c:3181 config/m68hc11/m68hc11.c:3559
+#: config/m68hc11/m68hc11.c:3204 config/m68hc11/m68hc11.c:3582
msgid "move insn not handled"
msgstr ""
-#: config/m68hc11/m68hc11.c:3405 config/m68hc11/m68hc11.c:3489
-#: config/m68hc11/m68hc11.c:3762
+#: config/m68hc11/m68hc11.c:3428 config/m68hc11/m68hc11.c:3512
+#: config/m68hc11/m68hc11.c:3785
msgid "invalid register in the move instruction"
msgstr ""
-#: config/m68hc11/m68hc11.c:3439
+#: config/m68hc11/m68hc11.c:3462
msgid "invalid operand in the instruction"
msgstr ""
-#: config/m68hc11/m68hc11.c:3736
+#: config/m68hc11/m68hc11.c:3759
msgid "invalid register in the instruction"
msgstr ""
-#: config/m68hc11/m68hc11.c:3769
+#: config/m68hc11/m68hc11.c:3792
msgid "operand 1 must be a hard register"
msgstr ""
-#: config/m68hc11/m68hc11.c:3783
+#: config/m68hc11/m68hc11.c:3806
msgid "invalid rotate insn"
msgstr ""
-#: config/m68hc11/m68hc11.c:4207
+#: config/m68hc11/m68hc11.c:4234
msgid "registers IX, IY and Z used in the same INSN"
msgstr ""
-#: config/m68hc11/m68hc11.c:4540 config/m68hc11/m68hc11.c:4840
+#: config/m68hc11/m68hc11.c:4567 config/m68hc11/m68hc11.c:4867
msgid "cannot do z-register replacement"
msgstr ""
-#: config/m68hc11/m68hc11.c:4903
+#: config/m68hc11/m68hc11.c:4930
msgid "invalid Z register replacement for insn"
msgstr ""
-#: config/mips/mips.c:7131 config/mips/mips.c:7152 config/mips/mips.c:7264
+#: config/mep/mep.c:3414
+#, c-format
+msgid "invalid %%L code"
+msgstr ""
+
+#: config/mips/mips.c:7370 config/mips/mips.c:7391 config/mips/mips.c:7503
#, c-format
msgid "'%%%c' is not a valid operand prefix"
msgstr ""
-#: config/mips/mips.c:7201 config/mips/mips.c:7208 config/mips/mips.c:7215
-#: config/mips/mips.c:7222 config/mips/mips.c:7282
+#: config/mips/mips.c:7440 config/mips/mips.c:7447 config/mips/mips.c:7454
+#: config/mips/mips.c:7461 config/mips/mips.c:7521 config/mips/mips.c:7535
+#: config/mips/mips.c:7548 config/mips/mips.c:7557
#, c-format
msgid "invalid use of '%%%c'"
msgstr ""
-#: config/mips/mips.c:7534
+#: config/mips/mips.c:7779
msgid "mips_debugger_offset called with non stack/frame/arg pointer"
msgstr ""
-#: config/mmix/mmix.c:1484 config/mmix/mmix.c:1614
+#: config/mmix/mmix.c:1494 config/mmix/mmix.c:1624
msgid "MMIX Internal: Expected a CONST_INT, not this"
msgstr ""
-#: config/mmix/mmix.c:1563
+#: config/mmix/mmix.c:1573
msgid "MMIX Internal: Bad value for 'm', not a CONST_INT"
msgstr ""
-#: config/mmix/mmix.c:1582
+#: config/mmix/mmix.c:1592
msgid "MMIX Internal: Expected a register, not this"
msgstr ""
-#: config/mmix/mmix.c:1592
+#: config/mmix/mmix.c:1602
msgid "MMIX Internal: Expected a constant, not this"
msgstr ""
#. We need the original here.
-#: config/mmix/mmix.c:1676
+#: config/mmix/mmix.c:1686
msgid "MMIX Internal: Cannot decode this operand"
msgstr ""
-#: config/mmix/mmix.c:1733
+#: config/mmix/mmix.c:1743
msgid "MMIX Internal: This is not a recognized address"
msgstr ""
-#: config/mmix/mmix.c:2666
+#: config/mmix/mmix.c:2620
msgid "MMIX Internal: Trying to output invalidly reversed condition:"
msgstr ""
-#: config/mmix/mmix.c:2673
+#: config/mmix/mmix.c:2627
msgid "MMIX Internal: What's the CC of this?"
msgstr ""
-#: config/mmix/mmix.c:2677
+#: config/mmix/mmix.c:2631
msgid "MMIX Internal: What is the CC of this?"
msgstr ""
-#: config/mmix/mmix.c:2741
+#: config/mmix/mmix.c:2695
msgid "MMIX Internal: This is not a constant:"
msgstr ""
-#: config/picochip/picochip.c:2406
+#: config/picochip/picochip.c:2410
msgid "picochip_print_memory_address - Operand isn't memory based"
msgstr ""
-#: config/picochip/picochip.c:2665
+#: config/picochip/picochip.c:2669
msgid "Unknown mode in print_operand (CONST_DOUBLE) :"
msgstr ""
-#: config/picochip/picochip.c:2711 config/picochip/picochip.c:2743
+#: config/picochip/picochip.c:2715 config/picochip/picochip.c:2747
msgid "Bad address, not (reg+disp):"
msgstr ""
-#: config/picochip/picochip.c:2757
+#: config/picochip/picochip.c:2761
msgid "Bad address, not register:"
msgstr ""
@@ -3411,407 +3543,451 @@ msgstr ""
msgid "Try running '%s' in the shell to raise its limit.\n"
msgstr ""
-#: config/rs6000/rs6000.c:12014
+#: config/rs6000/rs6000.c:2391
+msgid "-mvsx requires hardware floating point"
+msgstr ""
+
+#: config/rs6000/rs6000.c:2396
+msgid "-mvsx and -mpaired are incompatible"
+msgstr ""
+
+#: config/rs6000/rs6000.c:2401
+msgid "-mvsx used with little endian code"
+msgstr ""
+
+#: config/rs6000/rs6000.c:2403
+msgid "-mvsx needs indexed addressing"
+msgstr ""
+
+#: config/rs6000/rs6000.c:6610
+msgid "bad move"
+msgstr ""
+
+#: config/rs6000/rs6000.c:14277
+#, c-format
+msgid "invalid %%c value"
+msgstr ""
+
+#: config/rs6000/rs6000.c:14305
#, c-format
msgid "invalid %%f value"
msgstr ""
-#: config/rs6000/rs6000.c:12023
+#: config/rs6000/rs6000.c:14314
#, c-format
msgid "invalid %%F value"
msgstr ""
-#: config/rs6000/rs6000.c:12032
+#: config/rs6000/rs6000.c:14323
#, c-format
msgid "invalid %%G value"
msgstr ""
-#: config/rs6000/rs6000.c:12067
+#: config/rs6000/rs6000.c:14358
#, c-format
msgid "invalid %%j code"
msgstr ""
-#: config/rs6000/rs6000.c:12077
+#: config/rs6000/rs6000.c:14368
#, c-format
msgid "invalid %%J code"
msgstr ""
-#: config/rs6000/rs6000.c:12087
+#: config/rs6000/rs6000.c:14378
#, c-format
msgid "invalid %%k value"
msgstr ""
-#: config/rs6000/rs6000.c:12107 config/xtensa/xtensa.c:2228
+#: config/rs6000/rs6000.c:14398 config/xtensa/xtensa.c:2239
#, c-format
msgid "invalid %%K value"
msgstr ""
-#: config/rs6000/rs6000.c:12177
+#: config/rs6000/rs6000.c:14468
#, c-format
msgid "invalid %%O value"
msgstr ""
-#: config/rs6000/rs6000.c:12224
+#: config/rs6000/rs6000.c:14515
#, c-format
msgid "invalid %%q value"
msgstr ""
-#: config/rs6000/rs6000.c:12268
+#: config/rs6000/rs6000.c:14559
#, c-format
msgid "invalid %%S value"
msgstr ""
-#: config/rs6000/rs6000.c:12308
+#: config/rs6000/rs6000.c:14599
#, c-format
msgid "invalid %%T value"
msgstr ""
-#: config/rs6000/rs6000.c:12318
+#: config/rs6000/rs6000.c:14609
#, c-format
msgid "invalid %%u value"
msgstr ""
-#: config/rs6000/rs6000.c:12327 config/xtensa/xtensa.c:2198
+#: config/rs6000/rs6000.c:14618 config/xtensa/xtensa.c:2209
#, c-format
msgid "invalid %%v value"
msgstr ""
-#: config/rs6000/rs6000.c:12548
+#: config/rs6000/rs6000.c:14717 config/xtensa/xtensa.c:2260
+#, c-format
+msgid "invalid %%x value"
+msgstr ""
+
+#: config/rs6000/rs6000.c:14862
#, c-format
msgid "invalid %%y value, try using the 'Z' constraint"
msgstr ""
-#: config/rs6000/rs6000.c:22826
+#: config/rs6000/rs6000.c:25542
msgid "AltiVec argument passed to unprototyped function"
msgstr ""
-#: config/s390/s390.c:4934
+#: config/s390/s390.c:4944
#, c-format
msgid "cannot decompose address"
msgstr ""
-#: config/s390/s390.c:5147
+#: config/s390/s390.c:5167
msgid "UNKNOWN in print_operand !?"
msgstr ""
-#: config/score/score3.c:1262 config/score/score3.c:1282
-#: config/score/score7.c:1253
+#: config/score/score3.c:1282 config/score/score3.c:1302
+#: config/score/score7.c:1270
#, c-format
msgid "invalid operand for code: '%c'"
msgstr ""
-#: config/sh/sh.c:785
+#: config/sh/sh.c:1114
#, c-format
msgid "invalid operand to %%R"
msgstr ""
-#: config/sh/sh.c:812
+#: config/sh/sh.c:1141
#, c-format
msgid "invalid operand to %%S"
msgstr ""
-#: config/sh/sh.c:8384
+#: config/sh/sh.c:8877
msgid "created and used with different architectures / ABIs"
msgstr ""
-#: config/sh/sh.c:8386
+#: config/sh/sh.c:8879
msgid "created and used with different ABIs"
msgstr ""
-#: config/sh/sh.c:8388
+#: config/sh/sh.c:8881
msgid "created and used with different endianness"
msgstr ""
-#: config/sparc/sparc.c:6856 config/sparc/sparc.c:6862
+#: config/sparc/sparc.c:6992 config/sparc/sparc.c:6998
#, c-format
msgid "invalid %%Y operand"
msgstr ""
-#: config/sparc/sparc.c:6932
+#: config/sparc/sparc.c:7068
#, c-format
msgid "invalid %%A operand"
msgstr ""
-#: config/sparc/sparc.c:6942
+#: config/sparc/sparc.c:7078
#, c-format
msgid "invalid %%B operand"
msgstr ""
-#: config/sparc/sparc.c:6981
+#: config/sparc/sparc.c:7117
#, c-format
msgid "invalid %%c operand"
msgstr ""
-#: config/sparc/sparc.c:7003
+#: config/sparc/sparc.c:7139
#, c-format
msgid "invalid %%d operand"
msgstr ""
-#: config/sparc/sparc.c:7020
+#: config/sparc/sparc.c:7156
#, c-format
msgid "invalid %%f operand"
msgstr ""
-#: config/sparc/sparc.c:7034
+#: config/sparc/sparc.c:7170
#, c-format
msgid "invalid %%s operand"
msgstr ""
-#: config/sparc/sparc.c:7088
+#: config/sparc/sparc.c:7224
#, c-format
msgid "long long constant not a valid immediate operand"
msgstr ""
-#: config/sparc/sparc.c:7091
+#: config/sparc/sparc.c:7227
#, c-format
msgid "floating point constant not a valid immediate operand"
msgstr ""
-#: config/stormy16/stormy16.c:1746 config/stormy16/stormy16.c:1817
+#: config/stormy16/stormy16.c:1755 config/stormy16/stormy16.c:1826
#, c-format
msgid "'B' operand is not constant"
msgstr ""
-#: config/stormy16/stormy16.c:1773
+#: config/stormy16/stormy16.c:1782
#, c-format
msgid "'B' operand has multiple bits set"
msgstr ""
-#: config/stormy16/stormy16.c:1799
+#: config/stormy16/stormy16.c:1808
#, c-format
msgid "'o' operand is not constant"
msgstr ""
-#: config/stormy16/stormy16.c:1831
+#: config/stormy16/stormy16.c:1840
#, c-format
msgid "xstormy16_print_operand: unknown code"
msgstr ""
-#: config/v850/v850.c:372
+#: config/v850/v850.c:400
msgid "const_double_split got a bad insn:"
msgstr ""
-#: config/v850/v850.c:936
+#: config/v850/v850.c:971
msgid "output_move_single:"
msgstr ""
-#: config/vax/vax.c:382
+#: config/vax/vax.c:399
#, c-format
msgid "symbol used with both base and indexed registers"
msgstr ""
-#: config/vax/vax.c:391
+#: config/vax/vax.c:408
#, c-format
msgid "symbol with offset used in PIC mode"
msgstr ""
-#: config/vax/vax.c:475
+#: config/vax/vax.c:494
#, c-format
msgid "symbol used as immediate operand"
msgstr ""
-#: config/vax/vax.c:1469
+#: config/vax/vax.c:1519
msgid "illegal operand detected"
msgstr ""
-#: config/xtensa/xtensa.c:696 config/xtensa/xtensa.c:728
-#: config/xtensa/xtensa.c:737
+#: config/xtensa/xtensa.c:705 config/xtensa/xtensa.c:737
+#: config/xtensa/xtensa.c:746
msgid "bad test"
msgstr ""
-#: config/xtensa/xtensa.c:2186
+#: config/xtensa/xtensa.c:2197
#, c-format
msgid "invalid %%D value"
msgstr ""
-#: config/xtensa/xtensa.c:2223
+#: config/xtensa/xtensa.c:2234
msgid "invalid mask"
msgstr ""
-#: config/xtensa/xtensa.c:2249
-#, c-format
-msgid "invalid %%x value"
-msgstr ""
-
-#: config/xtensa/xtensa.c:2256
+#: config/xtensa/xtensa.c:2267
#, c-format
msgid "invalid %%d value"
msgstr ""
-#: config/xtensa/xtensa.c:2277 config/xtensa/xtensa.c:2287
+#: config/xtensa/xtensa.c:2288 config/xtensa/xtensa.c:2298
#, c-format
msgid "invalid %%t/%%b value"
msgstr ""
-#: config/xtensa/xtensa.c:2329
+#: config/xtensa/xtensa.c:2340
msgid "invalid address"
msgstr ""
-#: config/xtensa/xtensa.c:2354
+#: config/xtensa/xtensa.c:2365
msgid "no register in address"
msgstr ""
-#: config/xtensa/xtensa.c:2362
+#: config/xtensa/xtensa.c:2373
msgid "address offset not a constant"
msgstr ""
-#: cp/call.c:2604
+#: cp/call.c:2773
msgid "candidates are:"
msgstr ""
-#: cp/call.c:6904
+#: cp/call.c:7256
msgid "candidate 1:"
msgstr ""
-#: cp/call.c:6905
+#: cp/call.c:7257
msgid "candidate 2:"
msgstr ""
-#: cp/cxx-pretty-print.c:173 cp/error.c:916 objc/objc-act.c:7078
+#: cp/cxx-pretty-print.c:173 cp/error.c:943 objc/objc-act.c:7141
msgid "<unnamed>"
msgstr ""
-#: cp/cxx-pretty-print.c:2055
+#: cp/cxx-pretty-print.c:2056
msgid "template-parameter-"
msgstr ""
-#: cp/decl2.c:676
+#: cp/decl2.c:683
msgid "candidates are: %+#D"
msgstr ""
-#: cp/decl2.c:678
+#: cp/decl2.c:685
msgid "candidate is: %+#D"
msgstr ""
-#: cp/error.c:305
+#: cp/error.c:322
msgid "<missing>"
msgstr ""
-#: cp/error.c:346
+#: cp/error.c:363
msgid "<brace-enclosed initializer list>"
msgstr ""
-#: cp/error.c:348
+#: cp/error.c:365
msgid "<unresolved overloaded function type>"
msgstr ""
-#: cp/error.c:488
+#: cp/error.c:505
msgid "<type error>"
msgstr ""
-#: cp/error.c:587
+#: cp/error.c:604
#, c-format
msgid "<anonymous %s>"
msgstr ""
-#: cp/error.c:709
+#. A lambda's "type" is essentially its signature.
+#: cp/error.c:609
+msgid "<lambda"
+msgstr ""
+
+#: cp/error.c:735
msgid "<typeprefixerror>"
msgstr ""
-#: cp/error.c:819
+#: cp/error.c:846
#, c-format
msgid "(static initializers for %s)"
msgstr ""
-#: cp/error.c:821
+#: cp/error.c:848
#, c-format
msgid "(static destructors for %s)"
msgstr ""
-#: cp/error.c:891
+#: cp/error.c:918
msgid "vtable for "
msgstr ""
-#: cp/error.c:903
+#: cp/error.c:930
msgid "<return value> "
msgstr ""
-#: cp/error.c:1029
+#: cp/error.c:1056
msgid "<enumerator>"
msgstr ""
-#: cp/error.c:1069
+#: cp/error.c:1096
msgid "<declaration error>"
msgstr ""
-#: cp/error.c:1299
+#: cp/error.c:1336
msgid "with"
msgstr ""
-#: cp/error.c:1464 cp/error.c:1484
+#: cp/error.c:1504 cp/error.c:1524
msgid "<template parameter error>"
msgstr ""
-#: cp/error.c:1610
+#: cp/error.c:1650
msgid "<statement>"
msgstr ""
#. While waiting for caret diagnostics, avoid printing
#. __cxa_allocate_exception, __cxa_throw, and the like.
-#: cp/error.c:1639
+#: cp/error.c:1679
msgid "<throw-expression>"
msgstr ""
-#: cp/error.c:2085
+#: cp/error.c:2125
msgid "<unparsed>"
msgstr ""
-#: cp/error.c:2231
+#: cp/error.c:2271
msgid "<expression error>"
msgstr ""
-#: cp/error.c:2245
+#: cp/error.c:2285
msgid "<unknown operator>"
msgstr ""
-#: cp/error.c:2449
+#: cp/error.c:2492
msgid "<unknown>"
msgstr ""
-#: cp/error.c:2469
+#: cp/error.c:2512
msgid "{unknown}"
msgstr ""
-#: cp/error.c:2551
+#: cp/error.c:2594
msgid "At global scope:"
msgstr ""
-#: cp/error.c:2653
+#: cp/error.c:2700
#, c-format
msgid "In static member function %qs"
msgstr ""
-#: cp/error.c:2655
+#: cp/error.c:2702
#, c-format
msgid "In copy constructor %qs"
msgstr ""
-#: cp/error.c:2657
+#: cp/error.c:2704
#, c-format
msgid "In constructor %qs"
msgstr ""
-#: cp/error.c:2659
+#: cp/error.c:2706
#, c-format
msgid "In destructor %qs"
msgstr ""
-#: cp/error.c:2689
+#: cp/error.c:2708
+msgid "In lambda function"
+msgstr ""
+
+#: cp/error.c:2738
#, c-format
msgid "%s: In instantiation of %qs:\n"
msgstr ""
-#: cp/error.c:2713
+#: cp/error.c:2767
+#, c-format
+msgid "%s:%d:%d: instantiated from %qs\n"
+msgstr ""
+
+#: cp/error.c:2771
#, c-format
msgid "%s:%d: instantiated from %qs\n"
msgstr ""
-#: cp/error.c:2719
+#: cp/error.c:2776
+#, c-format
+msgid "%s:%d:%d: instantiated from here"
+msgstr ""
+
+#: cp/error.c:2779
#, c-format
msgid "%s:%d: instantiated from here"
msgstr ""
-#: cp/g++spec.c:254 java/jvspec.c:406
+#: cp/g++spec.c:266 java/jvspec.c:407
#, c-format
msgid "argument to '%s' missing\n"
msgstr ""
@@ -3849,73 +4025,68 @@ msgstr ""
msgid "Integer outside symmetric range implied by Standard Fortran at %L"
msgstr ""
-#: fortran/arith.c:1072 fortran/arith.c:1096
+#: fortran/arith.c:1151 fortran/arith.c:1173
#, no-c-format
msgid "Fortran 2003: Noninteger exponent in an initialization expression at %L"
msgstr ""
-#: fortran/arith.c:1080
+#: fortran/arith.c:1159
#, no-c-format
msgid "Raising a negative REAL at %L to a REAL power is prohibited"
msgstr ""
-#: fortran/arith.c:1564
+#: fortran/arith.c:1666
msgid "elemental binary operation"
msgstr ""
-#: fortran/arith.c:2143
+#: fortran/arith.c:2250
#, no-c-format
msgid "Arithmetic OK converting %s to %s at %L"
msgstr ""
-#: fortran/arith.c:2147
+#: fortran/arith.c:2254
#, no-c-format
msgid ""
"Arithmetic overflow converting %s to %s at %L. This check can be disabled "
"with the option -fno-range-check"
msgstr ""
-#: fortran/arith.c:2152
+#: fortran/arith.c:2259
#, no-c-format
msgid ""
"Arithmetic underflow converting %s to %s at %L. This check can be disabled "
"with the option -fno-range-check"
msgstr ""
-#: fortran/arith.c:2157
+#: fortran/arith.c:2264
#, no-c-format
msgid ""
"Arithmetic NaN converting %s to %s at %L. This check can be disabled with "
"the option -fno-range-check"
msgstr ""
-#: fortran/arith.c:2162
+#: fortran/arith.c:2269
#, no-c-format
msgid "Division by zero converting %s to %s at %L"
msgstr ""
-#: fortran/arith.c:2166
+#: fortran/arith.c:2273
#, no-c-format
msgid "Array operands are incommensurate converting %s to %s at %L"
msgstr ""
-#: fortran/arith.c:2170
+#: fortran/arith.c:2277
#, no-c-format
msgid ""
"Integer outside symmetric range implied by Standard Fortran converting %s to "
"%s at %L"
msgstr ""
-#: fortran/arith.c:2503
+#: fortran/arith.c:2628
#, no-c-format
msgid "The Hollerith constant at %L is too long to convert to %s"
msgstr ""
-#: fortran/arith.c:2662
-#, no-c-format
-msgid "Enumerator exceeds the C integer type at %C"
-msgstr ""
-
#: fortran/array.c:90
#, no-c-format
msgid "Expected array subscript at %C"
@@ -3981,47 +4152,47 @@ msgstr ""
msgid "Fortran 2008: Array specification at %C with more than 7 dimensions"
msgstr ""
-#: fortran/array.c:644
+#: fortran/array.c:645
#, no-c-format
msgid "duplicated initializer"
msgstr ""
-#: fortran/array.c:736
+#: fortran/array.c:737
#, no-c-format
msgid "DO-iterator '%s' at %L is inside iterator of the same name"
msgstr ""
-#: fortran/array.c:838 fortran/array.c:980
+#: fortran/array.c:839 fortran/array.c:981
#, no-c-format
msgid "Syntax error in array constructor at %C"
msgstr ""
-#: fortran/array.c:895
+#: fortran/array.c:896
#, no-c-format
msgid "Fortran 2003: [...] style array constructors at %C"
msgstr ""
-#: fortran/array.c:915
+#: fortran/array.c:916
#, no-c-format
msgid "Fortran 2003: Array constructor including type specification at %C"
msgstr ""
-#: fortran/array.c:930
+#: fortran/array.c:931
#, no-c-format
msgid "Empty array constructor at %C is not allowed"
msgstr ""
-#: fortran/array.c:1027
+#: fortran/array.c:1028
#, no-c-format
msgid "Element in %s array constructor at %L is %s"
msgstr ""
-#: fortran/array.c:1364
+#: fortran/array.c:1365
#, no-c-format
msgid "Iterator step at %L cannot be zero"
msgstr ""
-#: fortran/array.c:1650
+#: fortran/array.c:1649
#, no-c-format
msgid "Different CHARACTER lengths (%d/%d) in array constructor at %L"
msgstr ""
@@ -4041,7 +4212,7 @@ msgstr ""
msgid "'%s' argument of '%s' intrinsic at %L must be a numeric type"
msgstr ""
-#: fortran/check.c:101 fortran/check.c:830 fortran/check.c:840
+#: fortran/check.c:101 fortran/check.c:855 fortran/check.c:865
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be INTEGER or REAL"
msgstr ""
@@ -4107,290 +4278,359 @@ msgstr ""
msgid "'%s' argument of '%s' intrinsic at %L must be a variable"
msgstr ""
-#: fortran/check.c:361
+#: fortran/check.c:364
#, no-c-format
msgid "'dim' argument of '%s' intrinsic at %L is not a valid dimension index"
msgstr ""
-#: fortran/check.c:431
+#: fortran/check.c:434
#, no-c-format
msgid "Unequal character lengths (%ld/%ld) in %s at %L"
msgstr ""
-#: fortran/check.c:537 fortran/check.c:2039 fortran/check.c:2054
+#: fortran/check.c:543 fortran/check.c:2141 fortran/check.c:2153
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be ALLOCATABLE"
msgstr ""
-#: fortran/check.c:561 fortran/check.c:3908
+#: fortran/check.c:564 fortran/check.c:4236
#, no-c-format
msgid "'%s' and '%s' arguments of '%s' intrinsic at %L must have the same type"
msgstr ""
-#: fortran/check.c:570 fortran/check.c:1202 fortran/check.c:1345
-#: fortran/check.c:1419 fortran/check.c:1708
+#: fortran/check.c:573 fortran/check.c:1316 fortran/check.c:1459
+#: fortran/check.c:1533 fortran/check.c:1819
#, no-c-format
msgid "Extension: Different type kinds at %L"
msgstr ""
-#: fortran/check.c:610 fortran/check.c:2123
+#: fortran/check.c:613 fortran/check.c:2222
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be a POINTER"
msgstr ""
-#: fortran/check.c:630
+#: fortran/check.c:633
#, no-c-format
msgid ""
"'%s' argument of '%s' intrinsic at %L must be a pointer or target VARIABLE "
"or FUNCTION"
msgstr ""
-#: fortran/check.c:638
+#: fortran/check.c:641
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be a POINTER or a TARGET"
msgstr ""
-#: fortran/check.c:654
+#: fortran/check.c:657
#, no-c-format
msgid ""
"Array section with a vector subscript at %L shall not be the target of a "
"pointer"
msgstr ""
-#: fortran/check.c:665
+#: fortran/check.c:668
#, no-c-format
msgid ""
"NULL pointer at %L is not permitted as actual argument of '%s' intrinsic "
"function"
msgstr ""
-#: fortran/check.c:811 fortran/check.c:935
+#: fortran/check.c:827 fortran/check.c:994
#, no-c-format
msgid ""
"'%s' argument of '%s' intrinsic at %L must not be present if 'x' is COMPLEX"
msgstr ""
-#: fortran/check.c:861 fortran/check.c:1264 fortran/check.c:1367
-#: fortran/check.c:1526 fortran/check.c:1543 fortran/check.c:2427
-#: fortran/check.c:2569 fortran/check.c:2912 fortran/check.c:2973
+#: fortran/check.c:835 fortran/check.c:1002
#, no-c-format
-msgid "Fortran 2003: '%s' intrinsic with KIND argument at %L"
+msgid ""
+"'%s' argument of '%s' intrinsic at %L must have a type of either REAL or "
+"INTEGER"
msgstr ""
-#: fortran/check.c:886
+#: fortran/check.c:888 fortran/check.c:1378 fortran/check.c:1481
+#: fortran/check.c:1637 fortran/check.c:1654 fortran/check.c:2710
+#: fortran/check.c:2849 fortran/check.c:3201 fortran/check.c:3301
#, no-c-format
-msgid "SHIFT argument at %L of CSHIFT must have rank %d or be a scalar"
+msgid "Fortran 2003: '%s' intrinsic with KIND argument at %L"
msgstr ""
-#: fortran/check.c:984 fortran/check.c:1804 fortran/check.c:1812
+#: fortran/check.c:935 fortran/check.c:1141
#, no-c-format
-msgid "'%s' argument of '%s' intrinsic at %L must be numeric or LOGICAL"
+msgid ""
+"'%s' argument of '%s' intrinsic at %L has invalid shape in dimension %d (%ld/"
+"%ld)"
msgstr ""
-#: fortran/check.c:998
+#: fortran/check.c:950 fortran/check.c:1156 fortran/check.c:1184
#, no-c-format
msgid ""
-"Different shape for arguments '%s' and '%s' at %L for intrinsic 'dot_product'"
+"'%s' argument of intrinsic '%s' at %L of must have rank %d or be a scalar"
msgstr ""
-#: fortran/check.c:1017 fortran/check.c:1025
+#: fortran/check.c:1051 fortran/check.c:1913 fortran/check.c:1921
#, no-c-format
-msgid "'%s' argument of '%s' intrinsic at %L must be default real"
+msgid "'%s' argument of '%s' intrinsic at %L must be numeric or LOGICAL"
msgstr ""
-#: fortran/check.c:1052
+#: fortran/check.c:1065
#, no-c-format
-msgid "SHIFT argument at %L of EOSHIFT must have rank %d or be a scalar"
+msgid ""
+"Different shape for arguments '%s' and '%s' at %L for intrinsic 'dot_product'"
msgstr ""
-#: fortran/check.c:1072
+#: fortran/check.c:1084 fortran/check.c:1092
#, no-c-format
-msgid "BOUNDARY argument at %L of EOSHIFT must have rank %d or be a scalar"
+msgid "'%s' argument of '%s' intrinsic at %L must be default real"
msgstr ""
-#: fortran/check.c:1083
+#: fortran/check.c:1175 fortran/check.c:2028 fortran/check.c:2082
+#, c-format
+msgid "arguments '%s' and '%s' for intrinsic %s"
+msgstr ""
+
+#: fortran/check.c:1248
#, no-c-format
-msgid ""
-"Different shape in dimension %d for SHIFT and BOUNDARY arguments of EOSHIFT "
-"at %L"
+msgid "Fortran 2008: COMPLEX argument '%s' argument of '%s' intrinsic at %L"
msgstr ""
-#: fortran/check.c:1315
+#: fortran/check.c:1429
#, no-c-format
msgid "Argument of %s at %L must be of length one"
msgstr ""
-#: fortran/check.c:1374
+#: fortran/check.c:1488
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be the same kind as '%s'"
msgstr ""
-#: fortran/check.c:1499
+#: fortran/check.c:1613
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be a non-derived type"
msgstr ""
-#: fortran/check.c:1681
+#: fortran/check.c:1792
#, no-c-format
msgid "Intrinsic '%s' at %L must have at least two arguments"
msgstr ""
-#: fortran/check.c:1714
+#: fortran/check.c:1825
#, no-c-format
msgid "'a%d' argument of '%s' intrinsic at %L must be %s(%d)"
msgstr ""
-#: fortran/check.c:1747
+#: fortran/check.c:1834
+#, c-format
+msgid "arguments 'a%d' and 'a%d' for intrinsic '%s'"
+msgstr ""
+
+#: fortran/check.c:1856
#, no-c-format
msgid "Fortran 2003: '%s' intrinsic with CHARACTER argument at %L"
msgstr ""
-#: fortran/check.c:1754
+#: fortran/check.c:1863
#, no-c-format
msgid ""
"'a1' argument of '%s' intrinsic at %L must be INTEGER, REAL or CHARACTER"
msgstr ""
-#: fortran/check.c:1821
+#: fortran/check.c:1930
#, no-c-format
msgid "Argument types of '%s' intrinsic at %L must match (%s/%s)"
msgstr ""
-#: fortran/check.c:1835
+#: fortran/check.c:1944
#, no-c-format
msgid ""
"Different shape on dimension 1 for arguments '%s' and '%s' at %L for "
"intrinsic matmul"
msgstr ""
-#: fortran/check.c:1854
+#: fortran/check.c:1963
#, no-c-format
msgid ""
"Different shape on dimension 2 for argument '%s' and dimension 1 for "
"argument '%s' at %L for intrinsic matmul"
msgstr ""
-#: fortran/check.c:1863
+#: fortran/check.c:1972
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be of rank 1 or 2"
msgstr ""
-#: fortran/check.c:2065
+#: fortran/check.c:2164
#, no-c-format
msgid ""
"the '%s' and '%s' arguments of '%s' intrinsic at %L must have the same rank %"
"d/%d"
msgstr ""
-#: fortran/check.c:2074
+#: fortran/check.c:2173
#, no-c-format
msgid ""
"the '%s' and '%s' arguments of '%s' intrinsic at %L must be of the same kind "
"%d/%d"
msgstr ""
-#: fortran/check.c:2170
+#: fortran/check.c:2242 fortran/intrinsic.c:3639
+#, c-format
+msgid "arguments '%s' and '%s' for intrinsic '%s'"
+msgstr ""
+
+#: fortran/check.c:2293 fortran/check.c:3248
+#, no-c-format
+msgid ""
+"'%s' argument of '%s' intrinsic at %L must provide at least as many elements "
+"as there are .TRUE. values in '%s' (%ld/%d)"
+msgstr ""
+
+#: fortran/check.c:2318
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be of type REAL or COMPLEX"
msgstr ""
-#: fortran/check.c:2191
+#: fortran/check.c:2339
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be of a dummy variable"
msgstr ""
-#: fortran/check.c:2199
+#: fortran/check.c:2347
#, no-c-format
msgid ""
"'%s' argument of '%s' intrinsic at %L must be of an OPTIONAL dummy variable"
msgstr ""
-#: fortran/check.c:2215
+#: fortran/check.c:2363
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must not be a subobject of '%s'"
msgstr ""
-#: fortran/check.c:2340
+#: fortran/check.c:2488
#, no-c-format
msgid ""
"'shape' argument of 'reshape' intrinsic at %L must be an array of constant "
"size"
msgstr ""
-#: fortran/check.c:2350
+#: fortran/check.c:2498
+#, no-c-format
+msgid "'%s' argument of '%s' intrinsic at %L is empty"
+msgstr ""
+
+#: fortran/check.c:2505
#, no-c-format
msgid "'shape' argument of 'reshape' intrinsic at %L has more than %d elements"
msgstr ""
-#: fortran/check.c:2388
+#: fortran/check.c:2525
+#, no-c-format
+msgid "'%s' argument of '%s' intrinsic at %L has negative element (%d)"
+msgstr ""
+
+#: fortran/check.c:2566
+#, no-c-format
+msgid ""
+"'%s' argument of '%s' intrinsic at %L has wrong number of elements (%d/%d)"
+msgstr ""
+
+#: fortran/check.c:2587
+#, no-c-format
+msgid "'%s' argument of '%s' intrinsic at %L has out-of-range dimension (%d)"
+msgstr ""
+
+#: fortran/check.c:2596
+#, no-c-format
+msgid ""
+"'%s' argument of '%s' intrinsic at %L has invalid permutation of dimensions "
+"(dimension '%d' duplicated)"
+msgstr ""
+
+#: fortran/check.c:2631
#, no-c-format
msgid ""
"Without padding, there are not enough elements in the intrinsic RESHAPE "
"source at %L to match the shape"
msgstr ""
-#: fortran/check.c:2489
+#: fortran/check.c:2649 fortran/check.c:2665
+#, no-c-format
+msgid "'%s' argument of '%s' intrinsic at %L must be of a derived type"
+msgstr ""
+
+#: fortran/check.c:2657 fortran/check.c:2673
+#, no-c-format
+msgid "'%s' argument of '%s' intrinsic at %L must be of an extensible type"
+msgstr ""
+
+#: fortran/check.c:2772
#, no-c-format
msgid "Missing arguments to %s intrinsic at %L"
msgstr ""
-#: fortran/check.c:2530
+#: fortran/check.c:2813
#, no-c-format
msgid ""
"'source' argument of 'shape' intrinsic at %L must not be an assumed size "
"array"
msgstr ""
-#: fortran/check.c:2604
+#: fortran/check.c:2884
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be less than rank %d"
msgstr ""
-#: fortran/check.c:2864
+#: fortran/check.c:2903
+#, no-c-format
+msgid "'%s' argument of '%s' intrinsic at %L is not a valid dimension index"
+msgstr ""
+
+#: fortran/check.c:3156
#, no-c-format
msgid "'MOLD' argument of 'TRANSFER' intrinsic at %L must not be %s"
msgstr ""
-#: fortran/check.c:2938
+#: fortran/check.c:3262
#, no-c-format
msgid ""
-"FIELD argument at %L of UNPACK must have the same rank as MASK or be a scalar"
+"'%s' argument of '%s' intrinsic at %L must have the same rank as '%s' or be "
+"a scalar"
msgstr ""
-#: fortran/check.c:2949
+#: fortran/check.c:3275
#, no-c-format
msgid ""
-"Different shape in dimension %d for MASK and FIELD arguments of UNPACK at %L"
+"'%s' and '%s' arguments of '%s' intrinsic at %L must have identical shape."
msgstr ""
-#: fortran/check.c:3190 fortran/check.c:3222
+#: fortran/check.c:3518 fortran/check.c:3550
#, no-c-format
msgid "Size of '%s' argument of '%s' intrinsic at %L too small (%i/%i)"
msgstr ""
-#: fortran/check.c:3230
+#: fortran/check.c:3558
#, no-c-format
msgid "Too many arguments to %s at %L"
msgstr ""
-#: fortran/check.c:3342 fortran/check.c:3819 fortran/check.c:3843
+#: fortran/check.c:3670 fortran/check.c:4147 fortran/check.c:4171
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be INTEGER or PROCEDURE"
msgstr ""
-#: fortran/check.c:3525
+#: fortran/check.c:3853
#, no-c-format
msgid ""
"'%s' argument of '%s' intrinsic at %L must be of a kind not wider than the "
"default kind (%d)"
msgstr ""
-#: fortran/check.c:3892 fortran/check.c:3900
+#: fortran/check.c:4220 fortran/check.c:4228
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be INTEGER or LOGICAL"
msgstr ""
-#: fortran/cpp.c:381 c-opts.c:902
+#: fortran/cpp.c:381 c-opts.c:909
#, gcc-internal-format
msgid "output filename specified twice"
msgstr ""
@@ -4440,497 +4680,502 @@ msgstr ""
msgid "Extension: re-initialization of '%s' at %L"
msgstr ""
-#: fortran/decl.c:258
+#: fortran/decl.c:259
#, no-c-format
msgid "Host associated variable '%s' may not be in the DATA statement at %C"
msgstr ""
-#: fortran/decl.c:265
+#: fortran/decl.c:266
#, no-c-format
msgid ""
"Extension: initialization of common block variable '%s' in DATA statement at "
"%C"
msgstr ""
-#: fortran/decl.c:370
+#: fortran/decl.c:371
#, no-c-format
msgid "Symbol '%s' must be a PARAMETER in DATA statement at %C"
msgstr ""
-#: fortran/decl.c:395
+#: fortran/decl.c:396
#, no-c-format
msgid "Invalid initializer %s in Data statement at %C"
msgstr ""
-#: fortran/decl.c:498
+#: fortran/decl.c:499
#, no-c-format
msgid "Initialization at %C is not allowed in a PURE procedure"
msgstr ""
-#: fortran/decl.c:557
+#: fortran/decl.c:558
#, no-c-format
msgid "DATA statement at %C is not allowed in a PURE procedure"
msgstr ""
-#: fortran/decl.c:586
+#: fortran/decl.c:587
#, no-c-format
msgid "Bad INTENT specification at %C"
msgstr ""
-#: fortran/decl.c:633
+#: fortran/decl.c:634
#, no-c-format
msgid "Conflict in attributes of function argument at %C"
msgstr ""
-#: fortran/decl.c:686
+#: fortran/decl.c:658
+#, no-c-format
+msgid "Obsolescent feature: Old-style character length at %C"
+msgstr ""
+
+#: fortran/decl.c:690
#, no-c-format
msgid "Syntax error in character length specification at %C"
msgstr ""
-#: fortran/decl.c:805
+#: fortran/decl.c:813
#, no-c-format
msgid "Procedure '%s' at %C is already defined at %L"
msgstr ""
-#: fortran/decl.c:813
+#: fortran/decl.c:821
#, no-c-format
msgid "Name '%s' at %C is already defined as a generic interface at %L"
msgstr ""
-#: fortran/decl.c:826
+#: fortran/decl.c:834
#, no-c-format
msgid ""
"Procedure '%s' at %C has an explicit interface and must not have attributes "
"declared at %L"
msgstr ""
-#: fortran/decl.c:898
+#: fortran/decl.c:906
#, no-c-format
msgid ""
"Procedure '%s' at %L must have the BIND(C) attribute to be C interoperable"
msgstr ""
-#: fortran/decl.c:928
+#: fortran/decl.c:936
#, no-c-format
msgid ""
"Type '%s' at %L is a parameter to the BIND(C) procedure '%s' but is not C "
"interoperable because derived type '%s' is not C interoperable"
msgstr ""
-#: fortran/decl.c:935
+#: fortran/decl.c:943
#, no-c-format
msgid ""
"Variable '%s' at %L is a parameter to the BIND(C) procedure '%s' but may not "
"be C interoperable"
msgstr ""
-#: fortran/decl.c:950
+#: fortran/decl.c:958
#, no-c-format
msgid ""
"Character argument '%s' at %L must be length 1 because procedure '%s' is BIND"
"(C)"
msgstr ""
-#: fortran/decl.c:964
+#: fortran/decl.c:972
#, no-c-format
msgid ""
"Variable '%s' at %L cannot have the ALLOCATABLE attribute because procedure "
"'%s' is BIND(C)"
msgstr ""
-#: fortran/decl.c:973
+#: fortran/decl.c:981
#, no-c-format
msgid ""
"Variable '%s' at %L cannot have the POINTER attribute because procedure '%s' "
"is BIND(C)"
msgstr ""
-#: fortran/decl.c:982
+#: fortran/decl.c:990
#, no-c-format
msgid ""
"Variable '%s' at %L cannot have the OPTIONAL attribute because procedure '%"
"s' is BIND(C)"
msgstr ""
-#: fortran/decl.c:995
+#: fortran/decl.c:1003
#, no-c-format
msgid ""
"Assumed-shape array '%s' at %L cannot be an argument to the procedure '%s' "
"at %L because the procedure is BIND(C)"
msgstr ""
-#: fortran/decl.c:1005
+#: fortran/decl.c:1013
#, no-c-format
msgid ""
"Deferred-shape array '%s' at %L cannot be an argument to the procedure '%s' "
"at %L because the procedure is BIND(C)"
msgstr ""
-#: fortran/decl.c:1081
+#: fortran/decl.c:1172
#, no-c-format
msgid ""
"Variable '%s' in common block '%s' at %C must be declared with a C "
"interoperable kind since common block '%s' is BIND(C)"
msgstr ""
-#: fortran/decl.c:1120
+#: fortran/decl.c:1214
#, no-c-format
msgid "CHARACTER expression at %L is being truncated (%d/%d)"
msgstr ""
-#: fortran/decl.c:1127
+#: fortran/decl.c:1221
#, no-c-format
msgid ""
"The CHARACTER elements of the array constructor at %L must have the same "
"length (%d/%d)"
msgstr ""
-#: fortran/decl.c:1217
+#: fortran/decl.c:1311
#, no-c-format
msgid "Initializer not allowed for PARAMETER '%s' at %C"
msgstr ""
-#: fortran/decl.c:1227
+#: fortran/decl.c:1321
#, no-c-format
msgid "PARAMETER at %L is missing an initializer"
msgstr ""
-#: fortran/decl.c:1237
+#: fortran/decl.c:1331
#, no-c-format
msgid ""
"Variable '%s' at %C with an initializer already appears in a DATA statement"
msgstr ""
-#: fortran/decl.c:1387
+#: fortran/decl.c:1482
#, no-c-format
msgid "Component at %C must have the POINTER attribute"
msgstr ""
-#: fortran/decl.c:1395
+#: fortran/decl.c:1490
#, no-c-format
msgid "Array component of structure at %C must have explicit or deferred shape"
msgstr ""
-#: fortran/decl.c:1468
-#, no-c-format
-msgid "Allocatable component at %C must be an array"
-msgstr ""
-
-#: fortran/decl.c:1479
+#: fortran/decl.c:1568
#, no-c-format
msgid "Pointer array component of structure at %C must have a deferred shape"
msgstr ""
-#: fortran/decl.c:1488
+#: fortran/decl.c:1577
#, no-c-format
msgid "Allocatable component of structure at %C must have a deferred shape"
msgstr ""
-#: fortran/decl.c:1497
+#: fortran/decl.c:1586
#, no-c-format
msgid "Array component of structure at %C must have an explicit shape"
msgstr ""
-#: fortran/decl.c:1523
+#: fortran/decl.c:1612
#, no-c-format
msgid "NULL() initialization at %C is ambiguous"
msgstr ""
-#: fortran/decl.c:1646 fortran/decl.c:5778
+#: fortran/decl.c:1731 fortran/decl.c:5890
#, no-c-format
msgid "Duplicate array spec for Cray pointee at %C"
msgstr ""
-#: fortran/decl.c:1717
+#: fortran/decl.c:1802
#, no-c-format
msgid "the type of '%s' at %C has not been declared within the interface"
msgstr ""
-#: fortran/decl.c:1733
+#: fortran/decl.c:1818
#, no-c-format
msgid "Function name '%s' not allowed at %C"
msgstr ""
-#: fortran/decl.c:1749
+#: fortran/decl.c:1834
#, no-c-format
msgid "Extension: Old-style initialization at %C"
msgstr ""
-#: fortran/decl.c:1764 fortran/decl.c:4330
+#: fortran/decl.c:1849 fortran/decl.c:4437
#, no-c-format
msgid "Initialization at %C isn't for a pointer variable"
msgstr ""
-#: fortran/decl.c:1772 fortran/decl.c:4338 fortran/decl.c:4480
+#: fortran/decl.c:1857 fortran/decl.c:4445 fortran/decl.c:4585
#, no-c-format
msgid "Pointer initialization requires a NULL() at %C"
msgstr ""
-#: fortran/decl.c:1778 fortran/decl.c:4344 fortran/decl.c:4485
+#: fortran/decl.c:1863 fortran/decl.c:4451 fortran/decl.c:4590
#, no-c-format
msgid "Initialization of pointer at %C is not allowed in a PURE procedure"
msgstr ""
-#: fortran/decl.c:1791
+#: fortran/decl.c:1876
#, no-c-format
msgid "Pointer initialization at %C requires '=>', not '='"
msgstr ""
-#: fortran/decl.c:1800 fortran/decl.c:6864
+#: fortran/decl.c:1885 fortran/decl.c:7071
#, no-c-format
msgid "Expected an initialization expression at %C"
msgstr ""
-#: fortran/decl.c:1806
+#: fortran/decl.c:1891
#, no-c-format
msgid "Initialization of variable at %C is not allowed in a PURE procedure"
msgstr ""
-#: fortran/decl.c:1819
+#: fortran/decl.c:1904
#, no-c-format
msgid "Initialization of allocatable component at %C is not allowed"
msgstr ""
-#: fortran/decl.c:1873 fortran/decl.c:1882
+#: fortran/decl.c:1958 fortran/decl.c:1967
#, no-c-format
msgid "Old-style type declaration %s*%d not supported at %C"
msgstr ""
-#: fortran/decl.c:1887
+#: fortran/decl.c:1972
#, no-c-format
msgid "Nonstandard type declaration %s*%d at %C"
msgstr ""
-#: fortran/decl.c:1938 fortran/decl.c:2014
+#: fortran/decl.c:2023 fortran/decl.c:2099
#, no-c-format
msgid "Missing right parenthesis at %C"
msgstr ""
-#: fortran/decl.c:1951 fortran/decl.c:2059
+#: fortran/decl.c:2036 fortran/decl.c:2144
#, no-c-format
msgid "Expected initialization expression at %C"
msgstr ""
-#: fortran/decl.c:1959 fortran/decl.c:2065
+#: fortran/decl.c:2044 fortran/decl.c:2150
#, no-c-format
msgid "Expected scalar initialization expression at %C"
msgstr ""
-#: fortran/decl.c:1990
+#: fortran/decl.c:2075
#, no-c-format
msgid "Kind %d not supported for type %s at %C"
msgstr ""
-#: fortran/decl.c:2003
+#: fortran/decl.c:2088
#, no-c-format
msgid "C kind type parameter is for type %s but type at %L is %s"
msgstr ""
-#: fortran/decl.c:2012
+#: fortran/decl.c:2097
#, no-c-format
msgid "Missing right parenthesis or comma at %C"
msgstr ""
-#: fortran/decl.c:2085
+#: fortran/decl.c:2170
#, no-c-format
msgid "Kind %d is not supported for CHARACTER at %C"
msgstr ""
-#: fortran/decl.c:2214
+#: fortran/decl.c:2300
#, no-c-format
msgid "Syntax error in CHARACTER declaration at %C"
msgstr ""
-#: fortran/decl.c:2299
+#: fortran/decl.c:2383
#, no-c-format
msgid "Extension: BYTE type at %C"
msgstr ""
-#: fortran/decl.c:2305
+#: fortran/decl.c:2389
#, no-c-format
msgid "BYTE type used at %C is not available on the target machine"
msgstr ""
-#: fortran/decl.c:2354
+#: fortran/decl.c:2438
#, no-c-format
msgid "DOUBLE COMPLEX at %C does not conform to the Fortran 95 standard"
msgstr ""
-#: fortran/decl.c:2394 fortran/decl.c:2403 fortran/decl.c:2718
-#: fortran/decl.c:2726
+#: fortran/decl.c:2464
+#, no-c-format
+msgid "Fortran 2003: CLASS statement at %C"
+msgstr ""
+
+#: fortran/decl.c:2487 fortran/decl.c:2496 fortran/decl.c:2809
+#: fortran/decl.c:2817
#, no-c-format
msgid "Type name '%s' at %C is ambiguous"
msgstr ""
-#: fortran/decl.c:2479
+#: fortran/decl.c:2572
#, no-c-format
msgid "Missing character range in IMPLICIT at %C"
msgstr ""
-#: fortran/decl.c:2525
+#: fortran/decl.c:2618
#, no-c-format
msgid "Letters must be in alphabetic order in IMPLICIT statement at %C"
msgstr ""
-#: fortran/decl.c:2581
+#: fortran/decl.c:2674
#, no-c-format
msgid "Empty IMPLICIT statement at %C"
msgstr ""
-#: fortran/decl.c:2684
+#: fortran/decl.c:2775
#, no-c-format
msgid "IMPORT statement at %C only permitted in an INTERFACE body"
msgstr ""
-#: fortran/decl.c:2689
+#: fortran/decl.c:2780
#, no-c-format
msgid "Fortran 2003: IMPORT statement at %C"
msgstr ""
-#: fortran/decl.c:2704
+#: fortran/decl.c:2795
#, no-c-format
msgid "Expecting list of named entities at %C"
msgstr ""
-#: fortran/decl.c:2732
+#: fortran/decl.c:2823
#, no-c-format
msgid "Cannot IMPORT '%s' from host scoping unit at %C - does not exist."
msgstr ""
-#: fortran/decl.c:2739
+#: fortran/decl.c:2830
#, no-c-format
msgid "'%s' is already IMPORTed from host scoping unit at %C."
msgstr ""
-#: fortran/decl.c:2768
+#: fortran/decl.c:2859
#, no-c-format
msgid "Syntax error in IMPORT statement at %C"
msgstr ""
-#: fortran/decl.c:3017
+#: fortran/decl.c:3108
#, no-c-format
msgid "Missing dimension specification at %C"
msgstr ""
-#: fortran/decl.c:3091
+#: fortran/decl.c:3182
#, no-c-format
msgid "Duplicate %s attribute at %L"
msgstr ""
-#: fortran/decl.c:3110
+#: fortran/decl.c:3201
#, no-c-format
msgid "Fortran 2003: ALLOCATABLE attribute at %C in a TYPE definition"
msgstr ""
-#: fortran/decl.c:3120
+#: fortran/decl.c:3211
#, no-c-format
msgid "Attribute at %L is not allowed in a TYPE definition"
msgstr ""
-#: fortran/decl.c:3138
+#: fortran/decl.c:3229
#, no-c-format
msgid "Fortran 2003: Attribute %s at %L in a TYPE definition"
msgstr ""
-#: fortran/decl.c:3149
+#: fortran/decl.c:3240
#, no-c-format
msgid ""
"%s attribute at %L is not allowed outside of the specification part of a "
"module"
msgstr ""
-#: fortran/decl.c:3201 fortran/decl.c:6018
+#: fortran/decl.c:3292 fortran/decl.c:6143
#, no-c-format
msgid "PROTECTED at %C only allowed in specification part of a module"
msgstr ""
-#: fortran/decl.c:3207
+#: fortran/decl.c:3298
#, no-c-format
msgid "Fortran 2003: PROTECTED attribute at %C"
msgstr ""
-#: fortran/decl.c:3238
+#: fortran/decl.c:3329
#, no-c-format
msgid "Fortran 2003: VALUE attribute at %C"
msgstr ""
-#: fortran/decl.c:3248
+#: fortran/decl.c:3339
#, no-c-format
msgid "Fortran 2003: VOLATILE attribute at %C"
msgstr ""
-#: fortran/decl.c:3288
+#: fortran/decl.c:3379
#, no-c-format
msgid "Multiple identifiers provided with single NAME= specifier at %C"
msgstr ""
-#: fortran/decl.c:3384
+#: fortran/decl.c:3475
#, no-c-format
msgid ""
"Implicitly declared BIND(C) function '%s' at %L may not be C interoperable"
msgstr ""
-#: fortran/decl.c:3405
+#: fortran/decl.c:3496
#, no-c-format
msgid ""
"Variable '%s' in common block '%s' at %L may not be a C interoperable kind "
"though common block '%s' is BIND(C)"
msgstr ""
-#: fortran/decl.c:3414
+#: fortran/decl.c:3505
#, no-c-format
msgid "Type declaration '%s' at %L is not C interoperable but it is BIND(C)"
msgstr ""
-#: fortran/decl.c:3418
+#: fortran/decl.c:3509
#, no-c-format
msgid "Variable '%s' at %L may not be a C interoperable kind but it is bind(c)"
msgstr ""
-#: fortran/decl.c:3430
+#: fortran/decl.c:3521
#, no-c-format
msgid ""
"Variable '%s' in common block '%s' at %L cannot be declared with BIND(C) "
"since it is not a global"
msgstr ""
-#: fortran/decl.c:3444
+#: fortran/decl.c:3535
#, no-c-format
msgid "Variable '%s' at %L cannot have both the POINTER and BIND(C) attributes"
msgstr ""
-#: fortran/decl.c:3452
+#: fortran/decl.c:3543
#, no-c-format
msgid ""
"Variable '%s' at %L cannot have both the ALLOCATABLE and BIND(C) attributes"
msgstr ""
-#: fortran/decl.c:3464
+#: fortran/decl.c:3555
#, no-c-format
msgid "Return type of BIND(C) function '%s' at %L cannot be an array"
msgstr ""
-#: fortran/decl.c:3472
+#: fortran/decl.c:3563
#, no-c-format
msgid "Return type of BIND(C) function '%s' at %L cannot be a character string"
msgstr ""
#. Use gfc_warning_now because we won't say that the symbol fails
#. just because of this.
-#: fortran/decl.c:3483
+#: fortran/decl.c:3574
#, no-c-format
msgid ""
"Symbol '%s' at %L is marked PRIVATE but has been given the binding label '%s'"
msgstr ""
-#: fortran/decl.c:3558
+#: fortran/decl.c:3649
#, no-c-format
msgid ""
"Need either entity or common block name for attribute specification "
"statement at %C"
msgstr ""
-#: fortran/decl.c:3605
+#: fortran/decl.c:3696
#, no-c-format
msgid ""
"Missing entity or common block name for attribute specification statement at "
@@ -4939,702 +5184,737 @@ msgstr ""
#. Now we have an error, which we signal, and then fix up
#. because the knock-on is plain and simple confusing.
-#: fortran/decl.c:3712
+#: fortran/decl.c:3803
#, no-c-format
msgid ""
"Derived type at %C has not been previously defined and so cannot appear in a "
"derived type definition"
msgstr ""
-#: fortran/decl.c:3744
+#: fortran/decl.c:3835
#, no-c-format
msgid "Syntax error in data declaration at %C"
msgstr ""
-#: fortran/decl.c:3901
+#: fortran/decl.c:3992
#, no-c-format
msgid "Name '%s' at %C is the name of the procedure"
msgstr ""
-#: fortran/decl.c:3913
+#: fortran/decl.c:4004
#, no-c-format
msgid "Unexpected junk in formal argument list at %C"
msgstr ""
-#: fortran/decl.c:3930
+#: fortran/decl.c:4021
#, no-c-format
msgid "Duplicate symbol '%s' in formal argument list at %C"
msgstr ""
-#: fortran/decl.c:3981
+#: fortran/decl.c:4072
#, no-c-format
msgid "RESULT variable at %C must be different than function name"
msgstr ""
-#: fortran/decl.c:4058
+#: fortran/decl.c:4149
#, no-c-format
msgid "Unexpected junk after function declaration at %C"
msgstr ""
-#: fortran/decl.c:4068 fortran/decl.c:5102
+#: fortran/decl.c:4159 fortran/decl.c:5204
#, no-c-format
msgid ""
"Fortran 2008: BIND(C) attribute at %L may not be specified for an internal "
"procedure"
msgstr ""
-#: fortran/decl.c:4196
+#: fortran/decl.c:4303
#, no-c-format
msgid "Interface '%s' at %C may not be generic"
msgstr ""
-#: fortran/decl.c:4202
+#: fortran/decl.c:4309
#, no-c-format
msgid "Interface '%s' at %C may not be a statement function"
msgstr ""
-#: fortran/decl.c:4215
+#: fortran/decl.c:4322
#, no-c-format
msgid "Intrinsic procedure '%s' not allowed in PROCEDURE statement at %C"
msgstr ""
-#: fortran/decl.c:4270
+#: fortran/decl.c:4377
#, no-c-format
msgid "BIND(C) attribute at %C requires an interface with BIND(C)"
msgstr ""
-#: fortran/decl.c:4277
+#: fortran/decl.c:4384
#, no-c-format
msgid "BIND(C) procedure with NAME may not have POINTER attribute at %C"
msgstr ""
-#: fortran/decl.c:4283
+#: fortran/decl.c:4390
#, no-c-format
msgid "Dummy procedure at %C may not have BIND(C) attribute with NAME"
msgstr ""
-#: fortran/decl.c:4306
+#: fortran/decl.c:4413
#, no-c-format
msgid "Procedure '%s' at %L already has basic type of %s"
msgstr ""
-#: fortran/decl.c:4367 fortran/decl.c:4547
+#: fortran/decl.c:4474 fortran/decl.c:4652
#, no-c-format
msgid "Syntax error in PROCEDURE statement at %C"
msgstr ""
-#: fortran/decl.c:4410
+#: fortran/decl.c:4523 fortran/decl.c:7453
#, no-c-format
-msgid "Procedure Pointer Component with PASS at %C not yet implemented"
+msgid "Expected '::' after binding-attributes at %C"
msgstr ""
-#: fortran/decl.c:4424 fortran/decl.c:7246
+#: fortran/decl.c:4530
#, no-c-format
-msgid "Expected '::' after binding-attributes at %C"
+msgid "NOPASS or explicit interface required at %C"
msgstr ""
-#: fortran/decl.c:4431
+#: fortran/decl.c:4534
#, no-c-format
-msgid "NOPASS or explicit interface required at %C"
+msgid "Fortran 2003: Procedure pointer component at %C"
msgstr ""
-#: fortran/decl.c:4504
+#: fortran/decl.c:4609
#, no-c-format
msgid "Syntax error in procedure pointer component at %C"
msgstr ""
-#: fortran/decl.c:4521
+#: fortran/decl.c:4626
#, no-c-format
msgid "PROCEDURE at %C must be in a generic interface"
msgstr ""
-#: fortran/decl.c:4586
+#: fortran/decl.c:4691
#, no-c-format
msgid "Fortran 2003: PROCEDURE statement at %C"
msgstr ""
-#: fortran/decl.c:4654
+#: fortran/decl.c:4759
#, no-c-format
msgid "Expected formal argument list in function definition at %C"
msgstr ""
-#: fortran/decl.c:4678 fortran/decl.c:4682 fortran/decl.c:4884
-#: fortran/decl.c:4888 fortran/decl.c:5070 fortran/decl.c:5074
-#: fortran/symbol.c:1484
+#: fortran/decl.c:4783 fortran/decl.c:4787 fortran/decl.c:4986
+#: fortran/decl.c:4990 fortran/decl.c:5172 fortran/decl.c:5176
+#: fortran/symbol.c:1490
#, no-c-format
msgid "BIND(C) attribute at %L can only be used for variables or common blocks"
msgstr ""
-#: fortran/decl.c:4714
-#, no-c-format
-msgid "Function '%s' at %C already has a type of %s"
-msgstr ""
-
-#: fortran/decl.c:4806
+#: fortran/decl.c:4908
#, no-c-format
msgid "ENTRY statement at %C cannot appear within a PROGRAM"
msgstr ""
-#: fortran/decl.c:4809
+#: fortran/decl.c:4911
#, no-c-format
msgid "ENTRY statement at %C cannot appear within a MODULE"
msgstr ""
-#: fortran/decl.c:4812
+#: fortran/decl.c:4914
#, no-c-format
msgid "ENTRY statement at %C cannot appear within a BLOCK DATA"
msgstr ""
-#: fortran/decl.c:4816
+#: fortran/decl.c:4918
#, no-c-format
msgid "ENTRY statement at %C cannot appear within an INTERFACE"
msgstr ""
-#: fortran/decl.c:4820
+#: fortran/decl.c:4922
#, no-c-format
msgid "ENTRY statement at %C cannot appear within a DERIVED TYPE block"
msgstr ""
-#: fortran/decl.c:4824
+#: fortran/decl.c:4926
#, no-c-format
msgid "ENTRY statement at %C cannot appear within an IF-THEN block"
msgstr ""
-#: fortran/decl.c:4828
+#: fortran/decl.c:4930
#, no-c-format
msgid "ENTRY statement at %C cannot appear within a DO block"
msgstr ""
-#: fortran/decl.c:4832
+#: fortran/decl.c:4934
#, no-c-format
msgid "ENTRY statement at %C cannot appear within a SELECT block"
msgstr ""
-#: fortran/decl.c:4836
+#: fortran/decl.c:4938
#, no-c-format
msgid "ENTRY statement at %C cannot appear within a FORALL block"
msgstr ""
-#: fortran/decl.c:4840
+#: fortran/decl.c:4942
#, no-c-format
msgid "ENTRY statement at %C cannot appear within a WHERE block"
msgstr ""
-#: fortran/decl.c:4844
+#: fortran/decl.c:4946
#, no-c-format
msgid "ENTRY statement at %C cannot appear within a contained subprogram"
msgstr ""
-#: fortran/decl.c:4862
+#: fortran/decl.c:4964
#, no-c-format
msgid "ENTRY statement at %C cannot appear in a contained procedure"
msgstr ""
-#: fortran/decl.c:4916 fortran/decl.c:5110
+#: fortran/decl.c:5018 fortran/decl.c:5212
#, no-c-format
msgid "Missing required parentheses before BIND(C) at %C"
msgstr ""
-#: fortran/decl.c:5172 fortran/decl.c:5188
+#: fortran/decl.c:5274 fortran/decl.c:5290
#, no-c-format
msgid "Syntax error in NAME= specifier for binding label at %C"
msgstr ""
-#: fortran/decl.c:5203
+#: fortran/decl.c:5305
#, no-c-format
msgid "Missing closing quote '\"' for binding label at %C"
msgstr ""
-#: fortran/decl.c:5212
+#: fortran/decl.c:5314
#, no-c-format
msgid "Missing closing quote ''' for binding label at %C"
msgstr ""
-#: fortran/decl.c:5222
+#: fortran/decl.c:5324
#, no-c-format
msgid "Missing closing paren for binding label at %C"
msgstr ""
-#: fortran/decl.c:5228
+#: fortran/decl.c:5330
#, no-c-format
msgid "No binding name is allowed in BIND(C) at %C"
msgstr ""
-#: fortran/decl.c:5234
+#: fortran/decl.c:5336
#, no-c-format
msgid "For dummy procedure %s, no binding name is allowed in BIND(C) at %C"
msgstr ""
-#: fortran/decl.c:5265
+#: fortran/decl.c:5367
#, no-c-format
msgid "NAME not allowed on BIND(C) for ABSTRACT INTERFACE at %C"
msgstr ""
-#: fortran/decl.c:5438
+#: fortran/decl.c:5550
#, no-c-format
msgid "Unexpected END statement at %C"
msgstr ""
#. We would have required END [something].
-#: fortran/decl.c:5447
+#: fortran/decl.c:5559
#, no-c-format
msgid "%s statement expected at %L"
msgstr ""
-#: fortran/decl.c:5458
+#: fortran/decl.c:5570
#, no-c-format
msgid "Expecting %s statement at %C"
msgstr ""
-#: fortran/decl.c:5473
+#: fortran/decl.c:5585
#, no-c-format
msgid "Expected block name of '%s' in %s statement at %C"
msgstr ""
-#: fortran/decl.c:5490
+#: fortran/decl.c:5602
#, no-c-format
msgid "Expected terminating name at %C"
msgstr ""
-#: fortran/decl.c:5499 fortran/decl.c:5507
+#: fortran/decl.c:5611 fortran/decl.c:5619
#, no-c-format
msgid "Expected label '%s' for %s statement at %C"
msgstr ""
-#: fortran/decl.c:5562
+#: fortran/decl.c:5674
#, no-c-format
msgid "Missing array specification at %L in DIMENSION statement"
msgstr ""
-#: fortran/decl.c:5570
+#: fortran/decl.c:5682
#, no-c-format
msgid "Dimensions specified for %s at %L after its initialisation"
msgstr ""
-#: fortran/decl.c:5579
+#: fortran/decl.c:5691
#, no-c-format
msgid "Array specification must be deferred at %L"
msgstr ""
-#: fortran/decl.c:5658
+#: fortran/decl.c:5770
#, no-c-format
msgid "Unexpected character in variable list at %C"
msgstr ""
-#: fortran/decl.c:5695
+#: fortran/decl.c:5807
#, no-c-format
msgid "Expected '(' at %C"
msgstr ""
-#: fortran/decl.c:5709 fortran/decl.c:5749
+#: fortran/decl.c:5821 fortran/decl.c:5861
#, no-c-format
msgid "Expected variable name at %C"
msgstr ""
-#: fortran/decl.c:5725
+#: fortran/decl.c:5837
#, no-c-format
msgid "Cray pointer at %C must be an integer"
msgstr ""
-#: fortran/decl.c:5729
+#: fortran/decl.c:5841
#, no-c-format
msgid ""
"Cray pointer at %C has %d bytes of precision; memory addresses require %d "
"bytes"
msgstr ""
-#: fortran/decl.c:5735
+#: fortran/decl.c:5847
#, no-c-format
msgid "Expected \",\" at %C"
msgstr ""
-#: fortran/decl.c:5798
+#: fortran/decl.c:5910
#, no-c-format
msgid "Expected \")\" at %C"
msgstr ""
-#: fortran/decl.c:5810
+#: fortran/decl.c:5922
#, no-c-format
msgid "Expected \",\" or end of statement at %C"
msgstr ""
-#: fortran/decl.c:5874
+#: fortran/decl.c:5948
+#, no-c-format
+msgid "INTENT is not allowed inside of BLOCK at %C"
+msgstr ""
+
+#: fortran/decl.c:5980
+#, no-c-format
+msgid "OPTIONAL is not allowed inside of BLOCK at %C"
+msgstr ""
+
+#: fortran/decl.c:5999
#, no-c-format
msgid "Cray pointer declaration at %C requires -fcray-pointer flag"
msgstr ""
-#: fortran/decl.c:5969
+#: fortran/decl.c:6094
#, no-c-format
msgid ""
"Access specification of the %s operator at %C has already been specified"
msgstr ""
-#: fortran/decl.c:5986
+#: fortran/decl.c:6111
#, no-c-format
msgid ""
"Access specification of the .%s. operator at %C has already been specified"
msgstr ""
-#: fortran/decl.c:6024
+#: fortran/decl.c:6149
#, no-c-format
msgid "Fortran 2003: PROTECTED statement at %C"
msgstr ""
-#: fortran/decl.c:6064
+#: fortran/decl.c:6189
#, no-c-format
msgid "Syntax error in PROTECTED statement at %C"
msgstr ""
-#: fortran/decl.c:6088
+#: fortran/decl.c:6213
#, no-c-format
msgid ""
"PRIVATE statement at %C is only allowed in the specification part of a module"
msgstr ""
-#: fortran/decl.c:6125
+#: fortran/decl.c:6250
#, no-c-format
msgid ""
"PUBLIC statement at %C is only allowed in the specification part of a module"
msgstr ""
-#: fortran/decl.c:6152
+#: fortran/decl.c:6278
#, no-c-format
msgid "Expected variable name at %C in PARAMETER statement"
msgstr ""
-#: fortran/decl.c:6159
+#: fortran/decl.c:6285
#, no-c-format
msgid "Expected = sign in PARAMETER statement at %C"
msgstr ""
-#: fortran/decl.c:6165
+#: fortran/decl.c:6291
#, no-c-format
msgid "Expected expression at %C in PARAMETER statement"
msgstr ""
-#: fortran/decl.c:6185
+#: fortran/decl.c:6311
#, no-c-format
msgid "Initializing already initialized variable at %C"
msgstr ""
-#: fortran/decl.c:6247
+#: fortran/decl.c:6346
#, no-c-format
msgid "Unexpected characters in PARAMETER statement at %C"
msgstr ""
-#: fortran/decl.c:6271
+#: fortran/decl.c:6370
#, no-c-format
msgid "Blanket SAVE statement at %C follows previous SAVE statement"
msgstr ""
-#: fortran/decl.c:6283
+#: fortran/decl.c:6382
#, no-c-format
msgid "SAVE statement at %C follows blanket SAVE statement"
msgstr ""
-#: fortran/decl.c:6330
+#: fortran/decl.c:6429
#, no-c-format
msgid "Syntax error in SAVE statement at %C"
msgstr ""
-#: fortran/decl.c:6341
+#: fortran/decl.c:6443
+#, no-c-format
+msgid "VALUE is not allowed inside of BLOCK at %C"
+msgstr ""
+
+#: fortran/decl.c:6447
#, no-c-format
msgid "Fortran 2003: VALUE statement at %C"
msgstr ""
-#: fortran/decl.c:6381
+#: fortran/decl.c:6487
#, no-c-format
msgid "Syntax error in VALUE statement at %C"
msgstr ""
-#: fortran/decl.c:6392
+#: fortran/decl.c:6498
#, no-c-format
msgid "Fortran 2003: VOLATILE statement at %C"
msgstr ""
-#: fortran/decl.c:6434
+#: fortran/decl.c:6540
#, no-c-format
msgid "Syntax error in VOLATILE statement at %C"
msgstr ""
-#: fortran/decl.c:6457
+#: fortran/decl.c:6563
#, no-c-format
msgid "MODULE PROCEDURE at %C must be in a generic module interface"
msgstr ""
-#: fortran/decl.c:6539
+#: fortran/decl.c:6608
+#, no-c-format
+msgid "Intrinsic procedure at %L cannot be a MODULE PROCEDURE"
+msgstr ""
+
+#: fortran/decl.c:6657
#, no-c-format
msgid "Ambiguous symbol in TYPE definition at %C"
msgstr ""
-#: fortran/decl.c:6545
+#: fortran/decl.c:6663
#, no-c-format
msgid "No such symbol in TYPE definition at %C"
msgstr ""
-#: fortran/decl.c:6551
+#: fortran/decl.c:6669
#, no-c-format
msgid "'%s' in EXTENDS expression at %C is not a derived type"
msgstr ""
-#: fortran/decl.c:6558
+#: fortran/decl.c:6676
#, no-c-format
msgid "'%s' cannot be extended at %C because it is BIND(C)"
msgstr ""
-#: fortran/decl.c:6565
+#: fortran/decl.c:6683
#, no-c-format
msgid "'%s' cannot be extended at %C because it is a SEQUENCE type"
msgstr ""
-#: fortran/decl.c:6588
+#: fortran/decl.c:6706
#, no-c-format
msgid ""
"Derived type at %C can only be PRIVATE in the specification part of a module"
msgstr ""
-#: fortran/decl.c:6600
+#: fortran/decl.c:6718
#, no-c-format
msgid ""
"Derived type at %C can only be PUBLIC in the specification part of a module"
msgstr ""
-#: fortran/decl.c:6621
+#: fortran/decl.c:6739
#, no-c-format
msgid "Fortran 2003: ABSTRACT type at %C"
msgstr ""
-#: fortran/decl.c:6685
+#: fortran/decl.c:6843
#, no-c-format
msgid "Expected :: in TYPE definition at %C"
msgstr ""
-#: fortran/decl.c:6696
+#: fortran/decl.c:6854
#, no-c-format
msgid "Type name '%s' at %C cannot be the same as an intrinsic type"
msgstr ""
-#: fortran/decl.c:6706
+#: fortran/decl.c:6864
#, no-c-format
msgid "Derived type name '%s' at %C already has a basic type of %s"
msgstr ""
-#: fortran/decl.c:6722
+#: fortran/decl.c:6880
#, no-c-format
msgid "Derived type definition of '%s' at %C has already been defined"
msgstr ""
-#: fortran/decl.c:6789
+#: fortran/decl.c:6951
#, no-c-format
msgid "Cray Pointee at %C cannot be assumed shape array"
msgstr ""
-#: fortran/decl.c:6809
+#: fortran/decl.c:6971
#, no-c-format
msgid "Fortran 2003: ENUM and ENUMERATOR at %C"
msgstr ""
-#: fortran/decl.c:6881
+#: fortran/decl.c:7009
+#, no-c-format
+msgid "Enumerator exceeds the C integer type at %C"
+msgstr ""
+
+#: fortran/decl.c:7088
#, no-c-format
msgid "ENUMERATOR %L not initialized with integer expression"
msgstr ""
-#: fortran/decl.c:6930
+#: fortran/decl.c:7137
#, no-c-format
msgid "ENUM definition statement expected before %C"
msgstr ""
-#: fortran/decl.c:6963
+#: fortran/decl.c:7170
#, no-c-format
msgid "Syntax error in ENUMERATOR definition at %C"
msgstr ""
-#: fortran/decl.c:7011 fortran/decl.c:7026
+#: fortran/decl.c:7217 fortran/decl.c:7232
#, no-c-format
msgid "Duplicate access-specifier at %C"
msgstr ""
-#: fortran/decl.c:7046
+#: fortran/decl.c:7252
#, no-c-format
msgid "Binding attributes already specify passing, illegal NOPASS at %C"
msgstr ""
-#: fortran/decl.c:7066
+#: fortran/decl.c:7272
#, no-c-format
msgid "Binding attributes already specify passing, illegal PASS at %C"
msgstr ""
-#: fortran/decl.c:7093
+#: fortran/decl.c:7299
#, no-c-format
msgid "Duplicate POINTER attribute at %C"
msgstr ""
-#: fortran/decl.c:7112
+#: fortran/decl.c:7317
#, no-c-format
msgid "Duplicate NON_OVERRIDABLE at %C"
msgstr ""
-#: fortran/decl.c:7128
+#: fortran/decl.c:7333
#, no-c-format
msgid "Duplicate DEFERRED at %C"
msgstr ""
-#: fortran/decl.c:7141
+#: fortran/decl.c:7346
#, no-c-format
msgid "Expected access-specifier at %C"
msgstr ""
-#: fortran/decl.c:7143
+#: fortran/decl.c:7348
#, no-c-format
msgid "Expected binding attribute at %C"
msgstr ""
-#: fortran/decl.c:7151
+#: fortran/decl.c:7356
#, no-c-format
msgid "NON_OVERRIDABLE and DEFERRED can't both appear at %C"
msgstr ""
-#: fortran/decl.c:7160
+#: fortran/decl.c:7368
#, no-c-format
msgid "POINTER attribute is required for procedure pointer component at %C"
msgstr ""
-#: fortran/decl.c:7202
+#: fortran/decl.c:7409
#, no-c-format
msgid "Interface-name expected after '(' at %C"
msgstr ""
-#: fortran/decl.c:7208
+#: fortran/decl.c:7415
#, no-c-format
msgid "')' expected at %C"
msgstr ""
-#: fortran/decl.c:7230
+#: fortran/decl.c:7437
#, no-c-format
msgid "Interface must be specified for DEFERRED binding at %C"
msgstr ""
-#: fortran/decl.c:7235
+#: fortran/decl.c:7442
#, no-c-format
msgid "PROCEDURE(interface) at %C should be declared DEFERRED"
msgstr ""
-#: fortran/decl.c:7256
+#: fortran/decl.c:7463
#, no-c-format
msgid "Expected binding name at %C"
msgstr ""
-#: fortran/decl.c:7268
+#: fortran/decl.c:7475
#, no-c-format
msgid "'=> target' is invalid for DEFERRED binding at %C"
msgstr ""
-#: fortran/decl.c:7274
+#: fortran/decl.c:7481
#, no-c-format
msgid "'::' needed in PROCEDURE binding with explicit target at %C"
msgstr ""
-#: fortran/decl.c:7284
+#: fortran/decl.c:7491
#, no-c-format
msgid "Expected binding target after '=>' at %C"
msgstr ""
-#: fortran/decl.c:7296
+#: fortran/decl.c:7503
#, no-c-format
msgid "Junk after PROCEDURE declaration at %C"
msgstr ""
-#: fortran/decl.c:7311
+#: fortran/decl.c:7518
#, no-c-format
msgid "Type '%s' containing DEFERRED binding at %C is not ABSTRACT"
msgstr ""
-#: fortran/decl.c:7322
+#: fortran/decl.c:7529
#, no-c-format
msgid ""
"There's already a procedure with binding name '%s' for the derived type '%s' "
"at %C"
msgstr ""
-#: fortran/decl.c:7360
+#: fortran/decl.c:7569
#, no-c-format
msgid "GENERIC at %C must be inside a derived-type CONTAINS"
msgstr ""
-#: fortran/decl.c:7377
+#: fortran/decl.c:7586
#, no-c-format
msgid "Expected '::' at %C"
msgstr ""
-#: fortran/decl.c:7387
+#: fortran/decl.c:7598
#, no-c-format
-msgid "Expected generic name at %C"
+msgid "Expected generic name or operator descriptor at %C"
msgstr ""
-#: fortran/decl.c:7401
+#: fortran/decl.c:7624
+#, no-c-format
+msgid "Expected '=>' at %C"
+msgstr ""
+
+#: fortran/decl.c:7666
#, no-c-format
msgid ""
"There's already a non-generic procedure with binding name '%s' for the "
"derived type '%s' at %C"
msgstr ""
-#: fortran/decl.c:7409
+#: fortran/decl.c:7674
#, no-c-format
msgid "Binding at %C must have the same access as already defined binding '%s'"
msgstr ""
-#: fortran/decl.c:7437
+#: fortran/decl.c:7723
#, no-c-format
msgid "Expected specific binding name at %C"
msgstr ""
-#: fortran/decl.c:7447
+#: fortran/decl.c:7733
#, no-c-format
msgid "'%s' already defined as specific binding for the generic '%s' at %C"
msgstr ""
-#: fortran/decl.c:7463
+#: fortran/decl.c:7749
#, no-c-format
msgid "Junk after GENERIC binding at %C"
msgstr ""
-#: fortran/decl.c:7488
+#: fortran/decl.c:7774
#, no-c-format
msgid "FINAL declaration at %C must be inside a derived type CONTAINS section"
msgstr ""
-#: fortran/decl.c:7499
+#: fortran/decl.c:7785
#, no-c-format
msgid ""
"Derived type declaration with FINAL at %C must be in the specification part "
"of a MODULE"
msgstr ""
-#: fortran/decl.c:7521
+#: fortran/decl.c:7807
#, no-c-format
msgid "Empty FINAL at %C"
msgstr ""
-#: fortran/decl.c:7528
+#: fortran/decl.c:7814
#, no-c-format
msgid "Expected module procedure name at %C"
msgstr ""
-#: fortran/decl.c:7538
+#: fortran/decl.c:7824
#, no-c-format
msgid "Expected ',' at %C"
msgstr ""
-#: fortran/decl.c:7544
+#: fortran/decl.c:7830
#, no-c-format
msgid "Unknown procedure name \"%s\" at %C"
msgstr ""
-#: fortran/decl.c:7558
+#: fortran/decl.c:7844
#, no-c-format
msgid "'%s' at %C is already defined as FINAL procedure!"
msgstr ""
+#: fortran/decl.c:7913
+#, no-c-format
+msgid "Unknown attribute in !GCC$ ATTRIBUTES statement at %C"
+msgstr ""
+
+#: fortran/decl.c:7960
+#, no-c-format
+msgid "Syntax error in !GCC$ ATTRIBUTES statement at %C"
+msgstr ""
+
#. We are told not to check dependencies.
#. We do it, however, and issue a warning in case we find one.
#. If a dependency is found in the case
@@ -5646,435 +5926,443 @@ msgid ""
"INTENT(%s) actual argument at %L might interfere with actual argument at %L."
msgstr ""
-#: fortran/error.c:298
+#: fortran/error.c:300
#, no-c-format
msgid " Included at %s:%d:"
msgstr ""
-#: fortran/error.c:382
+#: fortran/error.c:384
#, no-c-format
msgid "<During initialization>\n"
msgstr ""
-#: fortran/error.c:716
+#: fortran/error.c:718
#, no-c-format
msgid "Error count reached limit of %d."
msgstr ""
-#: fortran/error.c:735 fortran/error.c:789 fortran/error.c:826
+#: fortran/error.c:737 fortran/error.c:791 fortran/error.c:826
+#: fortran/error.c:901
msgid "Warning:"
msgstr ""
-#: fortran/error.c:791 fortran/error.c:874 fortran/error.c:900
+#: fortran/error.c:793 fortran/error.c:881 fortran/error.c:931
msgid "Error:"
msgstr ""
-#: fortran/error.c:924
+#: fortran/error.c:955
msgid "Fatal Error:"
msgstr ""
-#: fortran/error.c:943
+#: fortran/error.c:974
#, no-c-format
msgid "Internal Error at (1):"
msgstr ""
-#: fortran/expr.c:257
+#: fortran/expr.c:261
#, c-format
msgid "Constant expression required at %C"
msgstr ""
-#: fortran/expr.c:260
+#: fortran/expr.c:264
#, c-format
msgid "Integer expression required at %C"
msgstr ""
-#: fortran/expr.c:265
+#: fortran/expr.c:269
#, c-format
msgid "Integer value too large in expression at %C"
msgstr ""
-#: fortran/expr.c:1058
+#: fortran/expr.c:1098
#, no-c-format
msgid "Index in dimension %d is out of bounds at %L"
msgstr ""
-#: fortran/expr.c:1234 fortran/expr.c:1285
+#: fortran/expr.c:1274 fortran/expr.c:1325
#, no-c-format
msgid "index in dimension %d is out of bounds at %L"
msgstr ""
-#: fortran/expr.c:1888
+#: fortran/expr.c:1923
#, no-c-format
msgid "elemental function arguments at %C are not compliant"
msgstr ""
-#: fortran/expr.c:1932
+#: fortran/expr.c:1967
#, no-c-format
msgid "Numeric or CHARACTER operands are required in expression at %L"
msgstr ""
-#: fortran/expr.c:1957
+#: fortran/expr.c:1992
#, no-c-format
msgid ""
"Concatenation operator in expression at %L must have two CHARACTER operands"
msgstr ""
-#: fortran/expr.c:1964
+#: fortran/expr.c:1999
#, no-c-format
msgid "Concat operator at %L must concatenate strings of the same kind"
msgstr ""
-#: fortran/expr.c:1974
+#: fortran/expr.c:2009
#, no-c-format
msgid ".NOT. operator in expression at %L must have a LOGICAL operand"
msgstr ""
-#: fortran/expr.c:1990
+#: fortran/expr.c:2025
#, no-c-format
msgid "LOGICAL operands are required in expression at %L"
msgstr ""
-#: fortran/expr.c:2001
+#: fortran/expr.c:2036
#, no-c-format
msgid "Only intrinsic operators can be used in expression at %L"
msgstr ""
-#: fortran/expr.c:2009
+#: fortran/expr.c:2044
#, no-c-format
msgid "Numeric operands are required in expression at %L"
msgstr ""
-#: fortran/expr.c:2102
+#: fortran/expr.c:2137
#, no-c-format
msgid "Assumed character length variable '%s' in constant expression at %L"
msgstr ""
-#: fortran/expr.c:2153 fortran/expr.c:2159
+#: fortran/expr.c:2195
#, no-c-format
msgid ""
"transformational intrinsic '%s' at %L is not permitted in an initialization "
"expression"
msgstr ""
-#: fortran/expr.c:2191
+#: fortran/expr.c:2226
#, no-c-format
msgid "Extension: Evaluation of nonstandard initialization expression at %L"
msgstr ""
-#: fortran/expr.c:2248
+#: fortran/expr.c:2283
#, no-c-format
msgid ""
"Function '%s' in initialization expression at %L must be an intrinsic or a "
"specification function"
msgstr ""
-#: fortran/expr.c:2260
+#: fortran/expr.c:2295
#, no-c-format
msgid ""
"Intrinsic function '%s' at %L is not permitted in an initialization "
"expression"
msgstr ""
-#: fortran/expr.c:2292
+#: fortran/expr.c:2327
#, no-c-format
msgid "PARAMETER '%s' is used at %L before its definition is complete"
msgstr ""
-#: fortran/expr.c:2312
+#: fortran/expr.c:2347
#, no-c-format
msgid ""
"Assumed size array '%s' at %L is not permitted in an initialization "
"expression"
msgstr ""
-#: fortran/expr.c:2318
+#: fortran/expr.c:2353
#, no-c-format
msgid ""
"Assumed shape array '%s' at %L is not permitted in an initialization "
"expression"
msgstr ""
-#: fortran/expr.c:2324
+#: fortran/expr.c:2359
#, no-c-format
msgid ""
"Deferred array '%s' at %L is not permitted in an initialization expression"
msgstr ""
-#: fortran/expr.c:2330
+#: fortran/expr.c:2365
#, no-c-format
msgid ""
"Array '%s' at %L is a variable, which does not reduce to a constant "
"expression"
msgstr ""
-#: fortran/expr.c:2340
+#: fortran/expr.c:2375
#, no-c-format
msgid ""
"Parameter '%s' at %L has not been declared or is a variable, which does not "
"reduce to a constant expression"
msgstr ""
-#: fortran/expr.c:2416
+#: fortran/expr.c:2451
#, no-c-format
msgid "Initialization expression didn't reduce %C"
msgstr ""
-#: fortran/expr.c:2495
+#: fortran/expr.c:2530
#, no-c-format
msgid "Specification function '%s' at %L cannot be a statement function"
msgstr ""
-#: fortran/expr.c:2502
+#: fortran/expr.c:2537
#, no-c-format
msgid "Specification function '%s' at %L cannot be an internal function"
msgstr ""
-#: fortran/expr.c:2509
+#: fortran/expr.c:2544
#, no-c-format
msgid "Specification function '%s' at %L must be PURE"
msgstr ""
-#: fortran/expr.c:2516
+#: fortran/expr.c:2551
#, no-c-format
msgid "Specification function '%s' at %L cannot be RECURSIVE"
msgstr ""
-#: fortran/expr.c:2650
+#: fortran/expr.c:2685
#, no-c-format
msgid "Dummy argument '%s' not allowed in expression at %L"
msgstr ""
-#: fortran/expr.c:2657
+#: fortran/expr.c:2692
#, no-c-format
msgid "Dummy argument '%s' at %L cannot be OPTIONAL"
msgstr ""
-#: fortran/expr.c:2664
+#: fortran/expr.c:2699
#, no-c-format
msgid "Dummy argument '%s' at %L cannot be INTENT(OUT)"
msgstr ""
-#: fortran/expr.c:2695
+#: fortran/expr.c:2730
#, no-c-format
msgid "Variable '%s' cannot appear in the expression at %L"
msgstr ""
-#: fortran/expr.c:2745
+#: fortran/expr.c:2780
#, no-c-format
msgid "Expression at %L must be of INTEGER type, found %s"
msgstr ""
-#: fortran/expr.c:2755
+#: fortran/expr.c:2790
#, no-c-format
msgid "Function '%s' at %L must be PURE"
msgstr ""
-#: fortran/expr.c:2764
+#: fortran/expr.c:2799
#, no-c-format
msgid "Expression at %L must be scalar"
msgstr ""
-#: fortran/expr.c:2791
+#: fortran/expr.c:2833
#, no-c-format
msgid "Incompatible ranks in %s (%d and %d) at %L"
msgstr ""
-#: fortran/expr.c:2805
+#: fortran/expr.c:2847
#, no-c-format
msgid "Different shape for %s at %L on dimension %d (%d and %d)"
msgstr ""
-#: fortran/expr.c:2851 fortran/expr.c:3111
+#: fortran/expr.c:2893 fortran/expr.c:3153
#, no-c-format
msgid "Cannot assign to INTENT(IN) variable '%s' at %L"
msgstr ""
-#: fortran/expr.c:2903
+#: fortran/expr.c:2945
#, no-c-format
msgid "'%s' at %L is not a VALUE"
msgstr ""
-#: fortran/expr.c:2910
+#: fortran/expr.c:2952
#, no-c-format
msgid "Incompatible ranks %d and %d in assignment at %L"
msgstr ""
-#: fortran/expr.c:2917
+#: fortran/expr.c:2959
#, no-c-format
msgid "Variable type is UNKNOWN in assignment at %L"
msgstr ""
-#: fortran/expr.c:2929
+#: fortran/expr.c:2971
#, no-c-format
msgid "NULL appears on right-hand side in assignment at %L"
msgstr ""
-#: fortran/expr.c:2940
+#: fortran/expr.c:2982
#, no-c-format
msgid "Vector assignment to assumed-size Cray Pointee at %L is illegal"
msgstr ""
-#: fortran/expr.c:2949
+#: fortran/expr.c:2991
#, no-c-format
msgid "POINTER valued function appears on right-hand side of assignment at %L"
msgstr ""
-#: fortran/expr.c:2954
+#: fortran/expr.c:2996
msgid "array assignment"
msgstr ""
-#: fortran/expr.c:2959
+#: fortran/expr.c:3001
#, no-c-format
msgid ""
"Extension: BOZ literal at %L used to initialize non-integer variable '%s'"
msgstr ""
-#: fortran/expr.c:2965 fortran/resolve.c:6726
+#: fortran/expr.c:3007 fortran/resolve.c:7535
#, no-c-format
msgid ""
"Extension: BOZ literal at %L outside a DATA statement and outside INT/REAL/"
"DBLE/CMPLX"
msgstr ""
-#: fortran/expr.c:2975 fortran/resolve.c:6736
+#: fortran/expr.c:3017 fortran/resolve.c:7545
#, no-c-format
msgid "BOZ literal at %L is bitwise transferred non-integer symbol '%s'"
msgstr ""
-#: fortran/expr.c:2983 fortran/resolve.c:6745
+#: fortran/expr.c:3025 fortran/resolve.c:7554
#, no-c-format
msgid ""
"Arithmetic underflow of bit-wise transferred BOZ at %L. This check can be "
"disabled with the option -fno-range-check"
msgstr ""
-#: fortran/expr.c:2987 fortran/resolve.c:6749
+#: fortran/expr.c:3029 fortran/resolve.c:7558
#, no-c-format
msgid ""
"Arithmetic overflow of bit-wise transferred BOZ at %L. This check can be "
"disabled with the option -fno-range-check"
msgstr ""
-#: fortran/expr.c:2991 fortran/resolve.c:6753
+#: fortran/expr.c:3033 fortran/resolve.c:7562
#, no-c-format
msgid ""
"Arithmetic NaN of bit-wise transferred BOZ at %L. This check can be disabled "
"with the option -fno-range-check"
msgstr ""
-#: fortran/expr.c:3013
+#: fortran/expr.c:3055
#, no-c-format
msgid ""
"Incompatible types in DATA statement at %L; attempted conversion of %s to %s"
msgstr ""
-#: fortran/expr.c:3049
+#: fortran/expr.c:3091
#, no-c-format
msgid "Pointer assignment target is not a POINTER at %L"
msgstr ""
-#: fortran/expr.c:3058
+#: fortran/expr.c:3100
#, no-c-format
msgid ""
"'%s' in the pointer assignment at %L cannot be an l-value since it is a "
"procedure"
msgstr ""
-#: fortran/expr.c:3089
+#: fortran/expr.c:3131
#, no-c-format
msgid "Expected bounds specification for '%s' at %L"
msgstr ""
-#: fortran/expr.c:3094
+#: fortran/expr.c:3136
#, no-c-format
msgid "Fortran 2003: Bounds specification for '%s' in pointer assignment at %L"
msgstr ""
-#: fortran/expr.c:3100
+#: fortran/expr.c:3142
#, no-c-format
msgid "Pointer bounds remapping at %L is not yet implemented in gfortran"
msgstr ""
-#: fortran/expr.c:3118
+#: fortran/expr.c:3162
#, no-c-format
msgid "Pointer assignment to non-POINTER at %L"
msgstr ""
-#: fortran/expr.c:3127
+#: fortran/expr.c:3171
#, no-c-format
msgid "Bad pointer object in PURE procedure at %L"
msgstr ""
-#: fortran/expr.c:3147
+#: fortran/expr.c:3196
#, no-c-format
msgid "Invalid procedure pointer assignment at %L"
msgstr ""
-#: fortran/expr.c:3153
+#: fortran/expr.c:3202
#, no-c-format
msgid ""
"Abstract interface '%s' is invalid in procedure pointer assignment at %L"
msgstr ""
-#: fortran/expr.c:3163
+#: fortran/expr.c:3212
#, no-c-format
msgid ""
"Statement function '%s' is invalid in procedure pointer assignment at %L"
msgstr ""
-#: fortran/expr.c:3169
+#: fortran/expr.c:3218
#, no-c-format
msgid ""
"Internal procedure '%s' is invalid in procedure pointer assignment at %L"
msgstr ""
-#: fortran/expr.c:3181
+#: fortran/expr.c:3241
#, no-c-format
-msgid "Interfaces don't match in procedure pointer assignment at %L"
+msgid ""
+"Mismatch in the procedure pointer assignment at %L: mismatch in the calling "
+"convention"
msgstr ""
-#: fortran/expr.c:3190
+#: fortran/expr.c:3272
+#, no-c-format
+msgid "Interface mismatch in procedure pointer assignment at %L: %s"
+msgstr ""
+
+#: fortran/expr.c:3282
#, no-c-format
msgid ""
"Different types in pointer assignment at %L; attempted assignment of %s to %s"
msgstr ""
-#: fortran/expr.c:3198
+#: fortran/expr.c:3290
#, no-c-format
msgid "Different kind type parameters in pointer assignment at %L"
msgstr ""
-#: fortran/expr.c:3205
+#: fortran/expr.c:3297
#, no-c-format
msgid "Different ranks in pointer assignment at %L"
msgstr ""
-#: fortran/expr.c:3227
+#: fortran/expr.c:3319
#, no-c-format
msgid "Pointer assignment target is neither TARGET nor POINTER at %L"
msgstr ""
-#: fortran/expr.c:3234
+#: fortran/expr.c:3326
#, no-c-format
msgid "Bad target in pointer assignment in PURE procedure at %L"
msgstr ""
-#: fortran/expr.c:3240
+#: fortran/expr.c:3332
#, no-c-format
msgid "Pointer assignment with vector subscript on rhs at %L"
msgstr ""
-#: fortran/expr.c:3248
+#: fortran/expr.c:3340
#, no-c-format
msgid "Pointer assignment target has PROTECTED attribute at %L"
msgstr ""
-#: fortran/gfortranspec.c:251
+#: fortran/gfortranspec.c:245
#, c-format
msgid "overflowed output arg list for '%s'"
msgstr ""
-#: fortran/gfortranspec.c:384
+#: fortran/gfortranspec.c:374
#, c-format
msgid ""
"GNU Fortran comes with NO WARRANTY, to the extent permitted by law.\n"
@@ -6084,287 +6372,292 @@ msgid ""
"\n"
msgstr ""
-#: fortran/gfortranspec.c:406 fortran/gfortranspec.c:445
+#: fortran/gfortranspec.c:396 fortran/gfortranspec.c:435
#, c-format
msgid "argument to '%s' missing"
msgstr ""
-#: fortran/gfortranspec.c:410
+#: fortran/gfortranspec.c:400
#, c-format
msgid "no input files; unwilling to write output files"
msgstr ""
-#: fortran/gfortranspec.c:432
+#: fortran/gfortranspec.c:422
#, c-format
msgid "Warning: Using -M <directory> is deprecated, use -J instead\n"
msgstr ""
-#: fortran/gfortranspec.c:578
+#: fortran/gfortranspec.c:557
#, c-format
msgid "Driving:"
msgstr ""
-#: fortran/interface.c:173
+#: fortran/interface.c:174
#, no-c-format
msgid "Syntax error in generic specification at %C"
msgstr ""
-#: fortran/interface.c:200
+#: fortran/interface.c:201
#, no-c-format
msgid "Syntax error: Trailing garbage in INTERFACE statement at %C"
msgstr ""
-#: fortran/interface.c:219
+#: fortran/interface.c:220
#, no-c-format
msgid "Dummy procedure '%s' at %C cannot have a generic interface"
msgstr ""
-#: fortran/interface.c:252
+#: fortran/interface.c:253
#, no-c-format
msgid "Fortran 2003: ABSTRACT INTERFACE at %C"
msgstr ""
-#: fortran/interface.c:260
+#: fortran/interface.c:261
#, no-c-format
msgid "Syntax error in ABSTRACT INTERFACE statement at %C"
msgstr ""
-#: fortran/interface.c:291
+#: fortran/interface.c:292
#, no-c-format
msgid "Syntax error: Trailing garbage in END INTERFACE statement at %C"
msgstr ""
-#: fortran/interface.c:304
+#: fortran/interface.c:305
#, no-c-format
msgid "Expected a nameless interface at %C"
msgstr ""
-#: fortran/interface.c:315
+#: fortran/interface.c:316
#, no-c-format
msgid "Expected 'END INTERFACE ASSIGNMENT (=)' at %C"
msgstr ""
-#: fortran/interface.c:317
+#: fortran/interface.c:318
#, no-c-format
msgid "Expecting 'END INTERFACE OPERATOR (%s)' at %C"
msgstr ""
-#: fortran/interface.c:331
+#: fortran/interface.c:332
#, no-c-format
msgid "Expecting 'END INTERFACE OPERATOR (.%s.)' at %C"
msgstr ""
-#: fortran/interface.c:342
+#: fortran/interface.c:343
#, no-c-format
msgid "Expecting 'END INTERFACE %s' at %C"
msgstr ""
-#: fortran/interface.c:569
+#: fortran/interface.c:574
#, no-c-format
msgid "Alternate return cannot appear in operator interface at %L"
msgstr ""
-#: fortran/interface.c:599
+#: fortran/interface.c:602
#, no-c-format
msgid "Operator interface at %L has the wrong number of arguments"
msgstr ""
-#: fortran/interface.c:610
+#: fortran/interface.c:613
#, no-c-format
msgid "Assignment operator interface at %L must be a SUBROUTINE"
msgstr ""
-#: fortran/interface.c:616
+#: fortran/interface.c:619
#, no-c-format
msgid "Assignment operator interface at %L must have two arguments"
msgstr ""
-#: fortran/interface.c:631
+#: fortran/interface.c:634
#, no-c-format
msgid ""
"Assignment operator interface at %L must not redefine an INTRINSIC type "
"assignment"
msgstr ""
-#: fortran/interface.c:640
+#: fortran/interface.c:643
#, no-c-format
msgid "Intrinsic operator interface at %L must be a FUNCTION"
msgstr ""
-#: fortran/interface.c:650
+#: fortran/interface.c:654
#, no-c-format
msgid ""
"First argument of defined assignment at %L must be INTENT(OUT) or INTENT"
"(INOUT)"
msgstr ""
-#: fortran/interface.c:654
+#: fortran/interface.c:661
#, no-c-format
msgid "Second argument of defined assignment at %L must be INTENT(IN)"
msgstr ""
-#: fortran/interface.c:660 fortran/resolve.c:10741
+#: fortran/interface.c:670 fortran/resolve.c:11879
#, no-c-format
msgid "First argument of operator interface at %L must be INTENT(IN)"
msgstr ""
-#: fortran/interface.c:664 fortran/resolve.c:10753
+#: fortran/interface.c:677 fortran/resolve.c:11897
#, no-c-format
msgid "Second argument of operator interface at %L must be INTENT(IN)"
msgstr ""
-#: fortran/interface.c:767
+#: fortran/interface.c:782
#, no-c-format
msgid "Operator interface at %L conflicts with intrinsic interface"
msgstr ""
-#: fortran/interface.c:1029
+#: fortran/interface.c:1074
#, no-c-format
msgid "Procedure '%s' in %s at %L has no explicit interface"
msgstr ""
-#: fortran/interface.c:1032
+#: fortran/interface.c:1077
#, no-c-format
msgid "Procedure '%s' in %s at %L is neither function nor subroutine"
msgstr ""
-#: fortran/interface.c:1087 fortran/interface.c:1093
+#: fortran/interface.c:1133 fortran/interface.c:1139
#, no-c-format
msgid "Ambiguous interfaces '%s' and '%s' in %s at %L"
msgstr ""
-#: fortran/interface.c:1129
+#: fortran/interface.c:1175
#, no-c-format
msgid "'%s' at %L is not a module procedure"
msgstr ""
-#: fortran/interface.c:1372
+#: fortran/interface.c:1408
#, no-c-format
-msgid "Type/rank mismatch in argument '%s' at %L"
+msgid "Invalid procedure argument at %L"
msgstr ""
-#: fortran/interface.c:1381
+#: fortran/interface.c:1416
+#, no-c-format
+msgid "Interface mismatch in dummy procedure '%s' at %L: %s"
+msgstr ""
+
+#: fortran/interface.c:1440
#, no-c-format
msgid "Type mismatch in argument '%s' at %L; passed %s to %s"
msgstr ""
-#: fortran/interface.c:1399 fortran/interface.c:1439
+#: fortran/interface.c:1458 fortran/interface.c:1498
#, no-c-format
msgid "Rank mismatch in argument '%s' at %L (%d and %d)"
msgstr ""
-#: fortran/interface.c:1426
+#: fortran/interface.c:1485
#, no-c-format
msgid ""
"Fortran 2003: Scalar CHARACTER actual argument with array dummy argument '%"
"s' at %L"
msgstr ""
-#: fortran/interface.c:1451
+#: fortran/interface.c:1510
#, no-c-format
msgid "Element of assumed-shaped array passed to dummy argument '%s' at %L"
msgstr ""
-#: fortran/interface.c:1768
+#: fortran/interface.c:1827
#, no-c-format
msgid "Keyword argument '%s' at %L is not in the procedure"
msgstr ""
-#: fortran/interface.c:1776
+#: fortran/interface.c:1835
#, no-c-format
msgid ""
"Keyword argument '%s' at %L is already associated with another actual "
"argument"
msgstr ""
-#: fortran/interface.c:1786
+#: fortran/interface.c:1845
#, no-c-format
msgid "More actual than formal arguments in procedure call at %L"
msgstr ""
-#: fortran/interface.c:1798 fortran/interface.c:2031
+#: fortran/interface.c:1857 fortran/interface.c:2093
#, no-c-format
msgid "Missing alternate return spec in subroutine call at %L"
msgstr ""
-#: fortran/interface.c:1806
+#: fortran/interface.c:1865
#, no-c-format
msgid "Unexpected alternate return spec in subroutine call at %L"
msgstr ""
-#: fortran/interface.c:1829
+#: fortran/interface.c:1888
#, no-c-format
msgid ""
"Character length mismatch (%ld/%ld) between actual argument and pointer or "
"allocatable dummy argument '%s' at %L"
msgstr ""
-#: fortran/interface.c:1836
+#: fortran/interface.c:1895
#, no-c-format
msgid ""
"Character length mismatch (%ld/%ld) between actual argument and assumed-"
"shape dummy argument '%s' at %L"
msgstr ""
-#: fortran/interface.c:1852
+#: fortran/interface.c:1911
#, no-c-format
msgid ""
"Character length of actual argument shorter than of dummy argument '%s' (%lu/"
"%lu) at %L"
msgstr ""
-#: fortran/interface.c:1857
+#: fortran/interface.c:1916
#, no-c-format
msgid ""
"Actual argument contains too few elements for dummy argument '%s' (%lu/%lu) "
"at %L"
msgstr ""
-#: fortran/interface.c:1871
+#: fortran/interface.c:1933
#, no-c-format
msgid "Expected a procedure pointer for argument '%s' at %L"
msgstr ""
-#: fortran/interface.c:1883
+#: fortran/interface.c:1945
#, no-c-format
msgid "Expected a procedure for argument '%s' at %L"
msgstr ""
-#: fortran/interface.c:1893
+#: fortran/interface.c:1955
#, no-c-format
msgid "Expected a PURE procedure for argument '%s' at %L"
msgstr ""
-#: fortran/interface.c:1907
+#: fortran/interface.c:1969
#, no-c-format
msgid "Actual argument for '%s' cannot be an assumed-size array at %L"
msgstr ""
-#: fortran/interface.c:1916
+#: fortran/interface.c:1978
#, no-c-format
msgid "Actual argument for '%s' must be a pointer at %L"
msgstr ""
-#: fortran/interface.c:1925
+#: fortran/interface.c:1987
#, no-c-format
msgid "Actual argument for '%s' must be ALLOCATABLE at %L"
msgstr ""
-#: fortran/interface.c:1938
+#: fortran/interface.c:2000
#, no-c-format
msgid ""
"Actual argument at %L must be definable as the dummy argument '%s' is INTENT "
"= OUT/INOUT"
msgstr ""
-#: fortran/interface.c:1947
+#: fortran/interface.c:2009
#, no-c-format
msgid ""
"Actual argument at %L is use-associated with PROTECTED attribute and dummy "
"argument '%s' is INTENT = OUT/INOUT"
msgstr ""
-#: fortran/interface.c:1960
+#: fortran/interface.c:2022
#, no-c-format
msgid ""
"Array-section actual argument with vector subscripts at %L is incompatible "
@@ -6372,80 +6665,88 @@ msgid ""
"'%s'"
msgstr ""
-#: fortran/interface.c:1977
+#: fortran/interface.c:2039
#, no-c-format
msgid ""
"Assumed-shape actual argument at %L is incompatible with the non-assumed-"
"shape dummy argument '%s' due to VOLATILE attribute"
msgstr ""
-#: fortran/interface.c:1989
+#: fortran/interface.c:2051
#, no-c-format
msgid ""
"Array-section actual argument at %L is incompatible with the non-assumed-"
"shape dummy argument '%s' due to VOLATILE attribute"
msgstr ""
-#: fortran/interface.c:2008
+#: fortran/interface.c:2070
#, no-c-format
msgid ""
"Pointer-array actual argument at %L requires an assumed-shape or pointer-"
"array dummy argument '%s' due to VOLATILE attribute"
msgstr ""
-#: fortran/interface.c:2038
+#: fortran/interface.c:2100
#, no-c-format
msgid "Missing actual argument for argument '%s' at %L"
msgstr ""
-#: fortran/interface.c:2224
+#: fortran/interface.c:2286
#, no-c-format
msgid ""
"Same actual argument associated with INTENT(%s) argument '%s' and INTENT(%s) "
"argument '%s' at %L"
msgstr ""
-#: fortran/interface.c:2280
+#: fortran/interface.c:2342
#, no-c-format
msgid ""
"Procedure argument at %L is INTENT(IN) while interface specifies INTENT(%s)"
msgstr ""
-#: fortran/interface.c:2290
+#: fortran/interface.c:2352
#, no-c-format
msgid ""
"Procedure argument at %L is local to a PURE procedure and is passed to an "
"INTENT(%s) argument"
msgstr ""
-#: fortran/interface.c:2298
+#: fortran/interface.c:2360
#, no-c-format
msgid ""
"Procedure argument at %L is local to a PURE procedure and has the POINTER "
"attribute"
msgstr ""
-#: fortran/interface.c:2324
+#: fortran/interface.c:2386
#, no-c-format
msgid "Procedure '%s' called with an implicit interface at %L"
msgstr ""
-#: fortran/interface.c:2335
+#: fortran/interface.c:2397
#, no-c-format
msgid "Keyword argument requires explicit interface for procedure '%s' at %L"
msgstr ""
-#: fortran/interface.c:2570
+#: fortran/interface.c:2429
#, no-c-format
-msgid "Function '%s' called in lieu of an operator at %L must be PURE"
+msgid ""
+"Procedure pointer component '%s' called with an implicit interface at %L"
msgstr ""
-#: fortran/interface.c:2650
+#: fortran/interface.c:2440
+#, no-c-format
+msgid ""
+"Keyword argument requires explicit interface for procedure pointer component "
+"'%s' at %L"
+msgstr ""
+
+#: fortran/interface.c:2916
#, no-c-format
msgid "Entity '%s' at %C is already present in the interface"
msgstr ""
-#: fortran/intrinsic.c:842
+#: fortran/intrinsic.c:961
#, no-c-format
msgid ""
"The intrinsic '%s' at %L is not included in the selected standard but %s and "
@@ -6453,818 +6754,957 @@ msgid ""
"option or define -fall-intrinsics to allow this intrinsic."
msgstr ""
-#: fortran/intrinsic.c:3083
+#: fortran/intrinsic.c:3241
#, no-c-format
msgid "Too many arguments in call to '%s' at %L"
msgstr ""
-#: fortran/intrinsic.c:3098
+#: fortran/intrinsic.c:3256
#, no-c-format
msgid ""
"The argument list functions %%VAL, %%LOC or %%REF are not allowed in this "
"context at %L"
msgstr ""
-#: fortran/intrinsic.c:3101
+#: fortran/intrinsic.c:3259
#, no-c-format
msgid "Can't find keyword named '%s' in call to '%s' at %L"
msgstr ""
-#: fortran/intrinsic.c:3108
+#: fortran/intrinsic.c:3266
#, no-c-format
msgid "Argument '%s' is appears twice in call to '%s' at %L"
msgstr ""
-#: fortran/intrinsic.c:3122
+#: fortran/intrinsic.c:3280
#, no-c-format
msgid "Missing actual argument '%s' in call to '%s' at %L"
msgstr ""
-#: fortran/intrinsic.c:3137
+#: fortran/intrinsic.c:3295
#, no-c-format
msgid "ALTERNATE RETURN not permitted at %L"
msgstr ""
-#: fortran/intrinsic.c:3194
+#: fortran/intrinsic.c:3352
#, no-c-format
msgid "Type of argument '%s' in call to '%s' at %L should be %s, not %s"
msgstr ""
-#: fortran/intrinsic.c:3560
+#: fortran/intrinsic.c:3717
#, no-c-format
msgid "Intrinsic '%s' (is %s) is used at %L"
msgstr ""
-#: fortran/intrinsic.c:3624
+#: fortran/intrinsic.c:3781
#, no-c-format
msgid "Fortran 2003: Function '%s' as initialization expression at %L"
msgstr ""
-#: fortran/intrinsic.c:3700
+#: fortran/intrinsic.c:3857
#, no-c-format
msgid ""
"Fortran 2003: Elemental function as initialization expression with non-"
"integer/non-character arguments at %L"
msgstr ""
-#: fortran/intrinsic.c:3761
+#: fortran/intrinsic.c:3918
#, no-c-format
msgid "Subroutine call to intrinsic '%s' at %L is not PURE"
msgstr ""
-#: fortran/intrinsic.c:3833
+#: fortran/intrinsic.c:3990
#, no-c-format
msgid "Extension: Conversion from %s to %s at %L"
msgstr ""
-#: fortran/intrinsic.c:3836
+#: fortran/intrinsic.c:3993
#, no-c-format
msgid "Conversion from %s to %s at %L"
msgstr ""
-#: fortran/intrinsic.c:3883
+#: fortran/intrinsic.c:4041
#, no-c-format
msgid "Can't convert %s to %s at %L"
msgstr ""
-#: fortran/intrinsic.c:3979
+#: fortran/intrinsic.c:4137
#, no-c-format
msgid ""
"'%s' declared at %L may shadow the intrinsic of the same name. In order to "
"call the intrinsic, explicit INTRINSIC declarations may be required."
msgstr ""
-#: fortran/intrinsic.c:3984
+#: fortran/intrinsic.c:4142
#, no-c-format
msgid ""
"'%s' declared at %L is also the name of an intrinsic. It can only be called "
"via an explicit interface or if declared EXTERNAL."
msgstr ""
-#: fortran/io.c:165 fortran/primary.c:768
+#: fortran/io.c:167 fortran/primary.c:771
#, no-c-format
msgid "Extension: backslash character at %C"
msgstr ""
-#: fortran/io.c:201 fortran/io.c:204
+#: fortran/io.c:203 fortran/io.c:206
#, no-c-format
msgid "Extension: Tab character in format at %C"
msgstr ""
-#: fortran/io.c:448
+#: fortran/io.c:452
#, no-c-format
msgid "Fortran 2003: DP format specifier not allowed at %C"
msgstr ""
-#: fortran/io.c:455
+#: fortran/io.c:459
#, no-c-format
msgid "Fortran 2003: DC format specifier not allowed at %C"
msgstr ""
-#: fortran/io.c:491
+#: fortran/io.c:548
msgid "Positive width required"
msgstr ""
-#: fortran/io.c:492
+#: fortran/io.c:549
msgid "Nonnegative width required"
msgstr ""
-#: fortran/io.c:493
+#: fortran/io.c:550
msgid "Unexpected element '%c' in format string at %L"
msgstr ""
-#: fortran/io.c:495
+#: fortran/io.c:552
msgid "Unexpected end of format string"
msgstr ""
-#: fortran/io.c:496
+#: fortran/io.c:553
msgid "Zero width in format descriptor"
msgstr ""
-#: fortran/io.c:516
+#: fortran/io.c:573
msgid "Missing leading left parenthesis"
msgstr ""
-#: fortran/io.c:563
+#: fortran/io.c:602
+msgid "Left parenthesis required after '*'"
+msgstr ""
+
+#: fortran/io.c:633
msgid "Expected P edit descriptor"
msgstr ""
#. P requires a prior number.
-#: fortran/io.c:571
+#: fortran/io.c:641
msgid "P descriptor requires leading scale factor"
msgstr ""
-#. X requires a prior number if we're being pedantic.
-#: fortran/io.c:576
+#: fortran/io.c:648
#, no-c-format
-msgid "Extension: X descriptor requires leading space count at %C"
+msgid "Extension: X descriptor requires leading space count at %L"
msgstr ""
-#: fortran/io.c:600
+#: fortran/io.c:678
#, no-c-format
-msgid "Extension: $ descriptor at %C"
+msgid "Extension: $ descriptor at %L"
msgstr ""
-#: fortran/io.c:605
+#: fortran/io.c:683
#, no-c-format
-msgid "$ should be the last specifier in format at %C"
+msgid "$ should be the last specifier in format at %L"
msgstr ""
-#: fortran/io.c:654
-msgid "Repeat count cannot follow P descriptor"
+#: fortran/io.c:736 fortran/io.c:750
+msgid "Comma required after P descriptor"
msgstr ""
-#: fortran/io.c:669
+#: fortran/io.c:764
msgid "Positive width required with T descriptor"
msgstr ""
-#: fortran/io.c:684
+#: fortran/io.c:781
#, no-c-format
-msgid "Extension: Missing positive width after L descriptor at %C"
+msgid "Extension: Missing positive width after L descriptor at %L"
msgstr ""
-#: fortran/io.c:727
+#: fortran/io.c:825
#, no-c-format
-msgid "Fortran 2008: 'G0' in format at %C"
+msgid "Fortran 2008: 'G0' in format at %L"
msgstr ""
-#: fortran/io.c:745
+#: fortran/io.c:843
msgid "E specifier not allowed with g0 descriptor"
msgstr ""
-#: fortran/io.c:759 fortran/io.c:761 fortran/io.c:822 fortran/io.c:824
+#: fortran/io.c:853
#, no-c-format
-msgid "Period required in format specifier at %C"
+msgid "Positive width required in format specifier %s at %L"
msgstr ""
-#: fortran/io.c:793
+#: fortran/io.c:869 fortran/io.c:876
+#, no-c-format
+msgid "Period required in format specifier %s at %L"
+msgstr ""
+
+#: fortran/io.c:913
msgid "Positive exponent width required"
msgstr ""
-#: fortran/io.c:842
+#: fortran/io.c:943
+msgid "Period required in format specifier"
+msgstr ""
+
+#: fortran/io.c:948
+#, no-c-format
+msgid "Period required in format specifier at %L"
+msgstr ""
+
+#: fortran/io.c:970
#, no-c-format
-msgid "The H format specifier at %C is a Fortran 95 deleted feature"
+msgid "The H format specifier at %L is a Fortran 95 deleted feature"
msgstr ""
-#: fortran/io.c:927 fortran/io.c:984
+#: fortran/io.c:1058 fortran/io.c:1121
#, no-c-format
-msgid "Extension: Missing comma at %C"
+msgid "Extension: Missing comma at %L"
msgstr ""
-#: fortran/io.c:999
+#: fortran/io.c:1140
#, no-c-format
msgid "%s in format string at %L"
msgstr ""
-#: fortran/io.c:1044
+#: fortran/io.c:1185
#, no-c-format
msgid "Format statement in module main block at %C"
msgstr ""
-#: fortran/io.c:1050
+#: fortran/io.c:1191
#, no-c-format
msgid "Missing format label at %C"
msgstr ""
-#: fortran/io.c:1110 fortran/io.c:1141 fortran/io.c:1203
+#: fortran/io.c:1251 fortran/io.c:1282 fortran/io.c:1344
#, no-c-format
msgid "Invalid value for %s specification at %C"
msgstr ""
-#: fortran/io.c:1116 fortran/io.c:1147
+#: fortran/io.c:1257 fortran/io.c:1288
#, no-c-format
msgid "Duplicate %s specification at %C"
msgstr ""
-#: fortran/io.c:1154
+#: fortran/io.c:1295
#, no-c-format
msgid "Variable %s cannot be INTENT(IN) at %C"
msgstr ""
-#: fortran/io.c:1161
+#: fortran/io.c:1302
#, no-c-format
msgid "Variable %s cannot be assigned in PURE procedure at %C"
msgstr ""
-#: fortran/io.c:1209
+#: fortran/io.c:1350
#, no-c-format
msgid "Duplicate %s label specification at %C"
msgstr ""
-#: fortran/io.c:1229
+#: fortran/io.c:1370
#, no-c-format
msgid ""
"Constant expression in FORMAT tag at %L must be of type default CHARACTER"
msgstr ""
-#: fortran/io.c:1242
+#: fortran/io.c:1386
#, no-c-format
msgid "FORMAT tag at %L must be of type CHARACTER or INTEGER"
msgstr ""
-#: fortran/io.c:1248
+#: fortran/io.c:1392
#, no-c-format
msgid "Deleted feature: ASSIGNED variable in FORMAT tag at %L"
msgstr ""
-#: fortran/io.c:1254
+#: fortran/io.c:1398
#, no-c-format
msgid "Variable '%s' at %L has not been assigned a format label"
msgstr ""
-#: fortran/io.c:1261
+#: fortran/io.c:1405
#, no-c-format
msgid "Scalar '%s' in FORMAT tag at %L is not an ASSIGNED variable"
msgstr ""
-#: fortran/io.c:1274
+#: fortran/io.c:1417
#, no-c-format
-msgid "Extension: Character array in FORMAT tag at %L"
+msgid "Extension: Non-character in FORMAT tag at %L"
msgstr ""
-#: fortran/io.c:1280
+#: fortran/io.c:1423
#, no-c-format
-msgid "Extension: Non-character in FORMAT tag at %L"
+msgid "Non-character assumed shape array element in FORMAT tag at %L"
+msgstr ""
+
+#: fortran/io.c:1430
+#, no-c-format
+msgid "Non-character assumed size array element in FORMAT tag at %L"
+msgstr ""
+
+#: fortran/io.c:1437
+#, no-c-format
+msgid "Non-character pointer array element in FORMAT tag at %L"
msgstr ""
-#: fortran/io.c:1305
+#: fortran/io.c:1463
#, no-c-format
msgid "%s tag at %L must be of type %s"
msgstr ""
-#: fortran/io.c:1312
+#: fortran/io.c:1470
#, no-c-format
msgid "%s tag at %L must be scalar"
msgstr ""
-#: fortran/io.c:1318
+#: fortran/io.c:1476
#, no-c-format
msgid "Fortran 2003: IOMSG tag at %L"
msgstr ""
-#: fortran/io.c:1326
+#: fortran/io.c:1484
#, no-c-format
msgid "Fortran 95 requires default INTEGER in %s tag at %L"
msgstr ""
-#: fortran/io.c:1334
+#: fortran/io.c:1492
#, no-c-format
msgid "Extension: CONVERT tag at %L"
msgstr ""
-#: fortran/io.c:1515 fortran/io.c:1523
+#: fortran/io.c:1678 fortran/io.c:1686
#, no-c-format
msgid "Fortran 2003: %s specifier in %s statement at %C has value '%s'"
msgstr ""
-#: fortran/io.c:1542 fortran/io.c:1550
+#: fortran/io.c:1705 fortran/io.c:1713
#, no-c-format
msgid "Extension: %s specifier in %s statement at %C has value '%s'"
msgstr ""
-#: fortran/io.c:1563 fortran/io.c:1571
+#: fortran/io.c:1726 fortran/io.c:1734
#, no-c-format
msgid "%s specifier in %s statement at %C has invalid value '%s'"
msgstr ""
-#: fortran/io.c:1626
+#: fortran/io.c:1789
#, no-c-format
msgid "OPEN statement not allowed in PURE procedure at %C"
msgstr ""
-#: fortran/io.c:1659
+#: fortran/io.c:1800
+#, no-c-format
+msgid "UNIT specifier not allowed with NEWUNIT at %C"
+msgstr ""
+
+#: fortran/io.c:1808
+#, no-c-format
+msgid "NEWUNIT specifier must have FILE= or STATUS='scratch' at %C"
+msgstr ""
+
+#: fortran/io.c:1842
#, no-c-format
msgid "Fortran 2003: ASYNCHRONOUS= at %C not allowed in Fortran 95"
msgstr ""
-#: fortran/io.c:1677 fortran/io.c:3060
+#: fortran/io.c:1860 fortran/io.c:3274
#, no-c-format
msgid "Fortran 2003: BLANK= at %C not allowed in Fortran 95"
msgstr ""
-#: fortran/io.c:1695 fortran/io.c:3039
+#: fortran/io.c:1878 fortran/io.c:3253
#, no-c-format
msgid "Fortran 2003: DECIMAL= at %C not allowed in Fortran 95"
msgstr ""
-#: fortran/io.c:1713 fortran/io.c:3150
+#: fortran/io.c:1896 fortran/io.c:3361
#, no-c-format
msgid "Fortran 2003: DELIM= at %C not allowed in Fortran 95"
msgstr ""
-#: fortran/io.c:1731
+#: fortran/io.c:1914
#, no-c-format
msgid "Fortran 2003: ENCODING= at %C not allowed in Fortran 95"
msgstr ""
-#. When implemented, change the following to use gfc_notify_std F2003.
-#: fortran/io.c:1783
+#: fortran/io.c:1965
#, no-c-format
-msgid "Fortran F2003: ROUND= specifier at %C not implemented"
+msgid "Fortran F2003: ROUND= at %C not allowed in Fortran 95"
msgstr ""
-#: fortran/io.c:1802
+#: fortran/io.c:1985
#, no-c-format
msgid "Fortran 2003: SIGN= at %C not allowed in Fortran 95"
msgstr ""
-#: fortran/io.c:2015
+#: fortran/io.c:2198
#, no-c-format
msgid "CLOSE statement not allowed in PURE procedure at %C"
msgstr ""
-#: fortran/io.c:2152 fortran/match.c:1949
+#: fortran/io.c:2245
+#, no-c-format
+msgid "UNIT number in CLOSE statement at %L must be non-negative"
+msgstr ""
+
+#: fortran/io.c:2343 fortran/match.c:1976
#, no-c-format
msgid "%s statement not allowed in PURE procedure at %C"
msgstr ""
-#: fortran/io.c:2208
+#: fortran/io.c:2375 fortran/io.c:2783
+#, no-c-format
+msgid "UNIT number in statement at %L must be non-negative"
+msgstr ""
+
+#: fortran/io.c:2407
#, no-c-format
msgid "Fortran 2003: FLUSH statement at %C"
msgstr ""
-#: fortran/io.c:2264
+#: fortran/io.c:2463
#, no-c-format
msgid "Duplicate UNIT specification at %C"
msgstr ""
-#: fortran/io.c:2324
+#: fortran/io.c:2523
#, no-c-format
msgid "Duplicate format specification at %C"
msgstr ""
-#: fortran/io.c:2341
+#: fortran/io.c:2540
#, no-c-format
msgid "Symbol '%s' in namelist '%s' is INTENT(IN) at %C"
msgstr ""
-#: fortran/io.c:2377
+#: fortran/io.c:2576
#, no-c-format
msgid "Duplicate NML specification at %C"
msgstr ""
-#: fortran/io.c:2386
+#: fortran/io.c:2585
#, no-c-format
msgid "Symbol '%s' at %C must be a NAMELIST group name"
msgstr ""
-#: fortran/io.c:2451
+#: fortran/io.c:2650
#, no-c-format
msgid "END tag at %C not allowed in output statement"
msgstr ""
-#: fortran/io.c:2528
+#: fortran/io.c:2721
+#, no-c-format
+msgid "UNIT not specified at %L"
+msgstr ""
+
+#: fortran/io.c:2733
#, no-c-format
msgid ""
"UNIT specification at %L must be an INTEGER expression or a CHARACTER "
"variable"
msgstr ""
-#: fortran/io.c:2553
+#: fortran/io.c:2758
#, no-c-format
msgid "Invalid form of WRITE statement at %L, UNIT required"
msgstr ""
-#: fortran/io.c:2564
+#: fortran/io.c:2769
#, no-c-format
msgid "Internal unit with vector subscript at %L"
msgstr ""
-#: fortran/io.c:2571
+#: fortran/io.c:2776
#, no-c-format
msgid "External IO UNIT cannot be an array at %L"
msgstr ""
-#: fortran/io.c:2576
+#: fortran/io.c:2788
#, no-c-format
msgid "Extension: Comma before i/o item list at %L"
msgstr ""
-#: fortran/io.c:2586
+#: fortran/io.c:2798
#, no-c-format
msgid "ERR tag label %d at %L not defined"
msgstr ""
-#: fortran/io.c:2598
+#: fortran/io.c:2810
#, no-c-format
msgid "END tag label %d at %L not defined"
msgstr ""
-#: fortran/io.c:2610
+#: fortran/io.c:2822
#, no-c-format
msgid "EOR tag label %d at %L not defined"
msgstr ""
-#: fortran/io.c:2620
+#: fortran/io.c:2832
#, no-c-format
msgid "FORMAT label %d at %L not defined"
msgstr ""
-#: fortran/io.c:2741
+#: fortran/io.c:2953
#, no-c-format
msgid "Syntax error in I/O iterator at %C"
msgstr ""
-#: fortran/io.c:2772
+#: fortran/io.c:2984
#, no-c-format
msgid "Expected variable in READ statement at %C"
msgstr ""
-#: fortran/io.c:2778
+#: fortran/io.c:2990
#, no-c-format
msgid "Expected expression in %s statement at %C"
msgstr ""
-#: fortran/io.c:2788
+#: fortran/io.c:3000
#, no-c-format
msgid "Variable '%s' in input list at %C cannot be INTENT(IN)"
msgstr ""
-#: fortran/io.c:2797
+#: fortran/io.c:3010
#, no-c-format
msgid "Cannot read to variable '%s' in PURE procedure at %C"
msgstr ""
-#: fortran/io.c:2813
+#: fortran/io.c:3027
#, no-c-format
msgid "Cannot write to internal file unit '%s' at %C inside a PURE procedure"
msgstr ""
#. A general purpose syntax error.
-#: fortran/io.c:2874 fortran/io.c:3481 fortran/gfortran.h:2232
+#: fortran/io.c:3088 fortran/io.c:3692 fortran/gfortran.h:2362
#, no-c-format
msgid "Syntax error in %s statement at %C"
msgstr ""
-#: fortran/io.c:2959
+#: fortran/io.c:3173
#, no-c-format
msgid "Fortran 2003: Internal file at %L with namelist"
msgstr ""
-#: fortran/io.c:3013
+#: fortran/io.c:3227
#, no-c-format
msgid "ASYNCHRONOUS= specifier at %L must be an initialization expression"
msgstr ""
-#: fortran/io.c:3081
+#: fortran/io.c:3295
#, no-c-format
msgid "Fortran 2003: PAD= at %C not allowed in Fortran 95"
msgstr ""
-#. When implemented, change the following to use gfc_notify_std F2003.
-#. if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: ROUND= at %C "
-#. "not allowed in Fortran 95") == FAILURE)
-#. return MATCH_ERROR;
-#: fortran/io.c:3106
+#: fortran/io.c:3316
#, no-c-format
-msgid "F2003 Feature: ROUND= specifier at %C not implemented"
+msgid "Fortran 2003: ROUND= at %C not allowed in Fortran 95"
msgstr ""
-#: fortran/io.c:3299
+#: fortran/io.c:3510
#, no-c-format
msgid "PRINT namelist at %C is an extension"
msgstr ""
-#: fortran/io.c:3451
+#: fortran/io.c:3662
#, no-c-format
msgid "Expected comma in I/O list at %C"
msgstr ""
-#: fortran/io.c:3515
+#: fortran/io.c:3726
#, no-c-format
msgid "PRINT statement at %C not allowed within PURE procedure"
msgstr ""
-#: fortran/io.c:3671 fortran/io.c:3722
+#: fortran/io.c:3882 fortran/io.c:3933
#, no-c-format
msgid "INQUIRE statement not allowed in PURE procedure at %C"
msgstr ""
-#: fortran/io.c:3698
+#: fortran/io.c:3909
#, no-c-format
msgid "IOLENGTH tag invalid in INQUIRE statement at %C"
msgstr ""
-#: fortran/io.c:3708 fortran/trans-io.c:1176
+#: fortran/io.c:3919 fortran/trans-io.c:1181
#, no-c-format
msgid "INQUIRE statement at %L cannot contain both FILE and UNIT specifiers"
msgstr ""
-#: fortran/io.c:3715
+#: fortran/io.c:3926
#, no-c-format
msgid "INQUIRE statement at %L requires either FILE or UNIT specifier"
msgstr ""
-#: fortran/io.c:3728
+#: fortran/io.c:3939
#, no-c-format
msgid ""
"INQUIRE statement at %L requires a PENDING= specifier with the ID= specifier"
msgstr ""
-#: fortran/io.c:3888
+#: fortran/io.c:4099
#, no-c-format
msgid "Fortran 2003: WAIT at %C not allowed in Fortran 95"
msgstr ""
-#: fortran/io.c:3894
+#: fortran/io.c:4105
#, no-c-format
msgid "WAIT statement not allowed in PURE procedure at %C"
msgstr ""
-#: fortran/match.c:158
+#: fortran/match.c:161
#, no-c-format
msgid "Missing ')' in statement at or before %L"
msgstr ""
-#: fortran/match.c:163
+#: fortran/match.c:166
#, no-c-format
msgid "Missing '(' in statement at or before %L"
msgstr ""
-#: fortran/match.c:360
+#: fortran/match.c:363
#, no-c-format
msgid "Integer too large at %C"
msgstr ""
-#: fortran/match.c:453 fortran/parse.c:599
+#: fortran/match.c:456 fortran/parse.c:631
#, no-c-format
msgid "Too many digits in statement label at %C"
msgstr ""
-#: fortran/match.c:459
+#: fortran/match.c:462
#, no-c-format
msgid "Statement label at %C is zero"
msgstr ""
-#: fortran/match.c:492
+#: fortran/match.c:495
#, no-c-format
msgid "Label name '%s' at %C is ambiguous"
msgstr ""
-#: fortran/match.c:498
+#: fortran/match.c:501
#, no-c-format
msgid "Duplicate construct label '%s' at %C"
msgstr ""
-#: fortran/match.c:529
+#: fortran/match.c:532
#, no-c-format
msgid "Invalid character in name at %C"
msgstr ""
-#: fortran/match.c:542 fortran/match.c:623
+#: fortran/match.c:545 fortran/match.c:626
#, no-c-format
msgid "Name at %C is too long"
msgstr ""
-#: fortran/match.c:553
+#: fortran/match.c:556
#, no-c-format
msgid ""
"Invalid character '$' at %C. Use -fdollar-ok to allow it as an extension"
msgstr ""
-#: fortran/match.c:604 fortran/match.c:652
+#: fortran/match.c:607 fortran/match.c:655
#, no-c-format
msgid "Invalid C name in NAME= specifier at %C"
msgstr ""
-#: fortran/match.c:643
+#: fortran/match.c:646
#, no-c-format
msgid "Embedded space in NAME= specifier at %C"
msgstr ""
-#: fortran/match.c:968
+#: fortran/match.c:971
#, no-c-format
msgid "Loop variable at %C cannot be a sub-component"
msgstr ""
-#: fortran/match.c:974
+#: fortran/match.c:977
#, no-c-format
msgid "Loop variable '%s' at %C cannot be INTENT(IN)"
msgstr ""
-#: fortran/match.c:1007
+#: fortran/match.c:1010
#, no-c-format
msgid "Expected a step value in iterator at %C"
msgstr ""
-#: fortran/match.c:1019
+#: fortran/match.c:1022
#, no-c-format
msgid "Syntax error in iterator at %C"
msgstr ""
-#: fortran/match.c:1260
+#: fortran/match.c:1263
#, no-c-format
msgid "Invalid form of PROGRAM statement at %C"
msgstr ""
-#: fortran/match.c:1386 fortran/match.c:1467
+#: fortran/match.c:1389 fortran/match.c:1470
#, no-c-format
-msgid "Obsolescent: arithmetic IF statement at %C"
+msgid "Obsolescent feature: Arithmetic IF statement at %C"
msgstr ""
-#: fortran/match.c:1442
+#: fortran/match.c:1445
#, no-c-format
msgid "Syntax error in IF-expression at %C"
msgstr ""
-#: fortran/match.c:1453
+#: fortran/match.c:1456
#, no-c-format
msgid "Block label not appropriate for arithmetic IF statement at %C"
msgstr ""
-#: fortran/match.c:1491
+#: fortran/match.c:1494
#, no-c-format
msgid "Block label is not appropriate for IF statement at %C"
msgstr ""
-#: fortran/match.c:1571 fortran/primary.c:2931
+#: fortran/match.c:1574 fortran/primary.c:2992
#, no-c-format
msgid "Cannot assign to a named constant at %C"
msgstr ""
-#: fortran/match.c:1581
+#: fortran/match.c:1584
#, no-c-format
msgid "Unclassifiable statement in IF-clause at %C"
msgstr ""
-#: fortran/match.c:1588
+#: fortran/match.c:1591
#, no-c-format
msgid "Syntax error in IF-clause at %C"
msgstr ""
-#: fortran/match.c:1632
+#: fortran/match.c:1635
#, no-c-format
msgid "Unexpected junk after ELSE statement at %C"
msgstr ""
-#: fortran/match.c:1638 fortran/match.c:1673
+#: fortran/match.c:1641 fortran/match.c:1676
#, no-c-format
msgid "Label '%s' at %C doesn't match IF label '%s'"
msgstr ""
-#: fortran/match.c:1667
+#: fortran/match.c:1670
#, no-c-format
msgid "Unexpected junk after ELSE IF statement at %C"
msgstr ""
-#: fortran/match.c:1835
+#: fortran/match.c:1862
#, no-c-format
msgid "Name '%s' in %s statement at %C is not a loop name"
msgstr ""
-#: fortran/match.c:1851
+#: fortran/match.c:1878
#, no-c-format
msgid "%s statement at %C is not within a loop"
msgstr ""
-#: fortran/match.c:1854
+#: fortran/match.c:1881
#, no-c-format
msgid "%s statement at %C is not within loop '%s'"
msgstr ""
-#: fortran/match.c:1862
+#: fortran/match.c:1889
#, no-c-format
msgid "%s statement at %C leaving OpenMP structured block"
msgstr ""
-#: fortran/match.c:1875
+#: fortran/match.c:1902
#, no-c-format
msgid "EXIT statement at %C terminating !$OMP DO loop"
msgstr ""
-#: fortran/match.c:1927
+#: fortran/match.c:1954
#, no-c-format
msgid "Too many digits in STOP code at %C"
msgstr ""
-#: fortran/match.c:1980
+#: fortran/match.c:2007
#, no-c-format
msgid "Deleted feature: PAUSE statement at %C"
msgstr ""
-#: fortran/match.c:2028
+#: fortran/match.c:2055
#, no-c-format
msgid "Deleted feature: ASSIGN statement at %C"
msgstr ""
-#: fortran/match.c:2074
+#: fortran/match.c:2101
#, no-c-format
msgid "Deleted feature: Assigned GOTO statement at %C"
msgstr ""
-#: fortran/match.c:2121 fortran/match.c:2173
+#: fortran/match.c:2148 fortran/match.c:2200
#, no-c-format
msgid "Statement label list in GOTO at %C cannot be empty"
msgstr ""
-#: fortran/match.c:2258
+#: fortran/match.c:2210
+#, no-c-format
+msgid "Obsolescent feature: Computed GOTO at %C"
+msgstr ""
+
+#. Enforce F03:C476.
+#: fortran/match.c:2273
+#, no-c-format
+msgid "'%s' at %L is not an accessible derived type"
+msgstr ""
+
+#: fortran/match.c:2351
+#, no-c-format
+msgid "Derived type '%s' at %L may not be ABSTRACT"
+msgstr ""
+
+#: fortran/match.c:2369
+#, no-c-format
+msgid "Invalid type-spec at %C"
+msgstr ""
+
+#: fortran/match.c:2401
+#, no-c-format
+msgid ""
+"Source-expr at %L must be scalar or have the same rank as the allocate-"
+"object at %L"
+msgstr ""
+
+#: fortran/match.c:2429
+#, no-c-format
+msgid "Source-expr at %L and allocate-object at %L must have the same shape"
+msgstr ""
+
+#: fortran/match.c:2474
+#, no-c-format
+msgid "Fortran 2003: typespec in ALLOCATE at %L"
+msgstr ""
+
+#: fortran/match.c:2506
#, no-c-format
msgid "Bad allocate-object at %C for a PURE procedure"
msgstr ""
-#: fortran/match.c:2274 fortran/match.c:2476
+#: fortran/match.c:2517
+#, no-c-format
+msgid "Type of entity at %L is type incompatible with typespec"
+msgstr ""
+
+#: fortran/match.c:2525
+#, no-c-format
+msgid ""
+"Kind type parameter for entity at %L differs from the kind type parameter of "
+"the typespec"
+msgstr ""
+
+#: fortran/match.c:2552 fortran/match.c:2829
#, no-c-format
msgid ""
"Allocate-object at %C is not a nonprocedure pointer or an allocatable "
"variable"
msgstr ""
-#: fortran/match.c:2291 fortran/match.c:2493
+#: fortran/match.c:2570 fortran/match.c:2846
#, no-c-format
msgid "Redundant STAT tag found at %L "
msgstr ""
-#: fortran/match.c:2311 fortran/match.c:2513
+#: fortran/match.c:2589
#, no-c-format
-msgid "Fortran 2003: ERRMSG at %L"
+msgid "Fortran 2003: ERRMSG tag at %L"
msgstr ""
-#: fortran/match.c:2317 fortran/match.c:2519
+#: fortran/match.c:2596 fortran/match.c:2872
#, no-c-format
msgid "Redundant ERRMSG tag found at %L "
msgstr ""
-#: fortran/match.c:2385
+#: fortran/match.c:2612
+#, no-c-format
+msgid "Fortran 2003: SOURCE tag at %L"
+msgstr ""
+
+#: fortran/match.c:2619
+#, no-c-format
+msgid "Redundant SOURCE tag found at %L "
+msgstr ""
+
+#: fortran/match.c:2626
+#, no-c-format
+msgid "SOURCE tag at %L conflicts with the typespec at %L"
+msgstr ""
+
+#: fortran/match.c:2633
+#, no-c-format
+msgid "SOURCE tag at %L requires only a single entity in the allocation-list"
+msgstr ""
+
+#: fortran/match.c:2642
+#, no-c-format
+msgid "Type of entity at %L is type incompatible with source-expr at %L"
+msgstr ""
+
+#: fortran/match.c:2650
+#, no-c-format
+msgid ""
+"The allocate-object at %L and the source-expr at %L shall have the same kind "
+"type parameter"
+msgstr ""
+
+#: fortran/match.c:2727
#, no-c-format
msgid "Illegal variable in NULLIFY at %C for a PURE procedure"
msgstr ""
-#: fortran/match.c:2463
+#: fortran/match.c:2813
#, no-c-format
msgid "Illegal allocate-object at %C for a PURE procedure"
msgstr ""
-#: fortran/match.c:2573
+#: fortran/match.c:2866
+#, no-c-format
+msgid "Fortran 2003: ERRMSG at %L"
+msgstr ""
+
+#: fortran/match.c:2926
#, no-c-format
msgid "Alternate RETURN statement at %C is only allowed within a SUBROUTINE"
msgstr ""
-#: fortran/match.c:2604
+#: fortran/match.c:2931
+#, no-c-format
+msgid "Obsolescent feature: Alternate RETURN at %C"
+msgstr ""
+
+#: fortran/match.c:2961
#, no-c-format
msgid "Extension: RETURN statement in main program at %C"
msgstr ""
-#: fortran/match.c:2635
+#: fortran/match.c:2992
#, no-c-format
msgid "Expected component reference at %C"
msgstr ""
-#: fortran/match.c:2641
+#: fortran/match.c:2998
#, no-c-format
msgid "Junk after CALL at %C"
msgstr ""
-#: fortran/match.c:2651
+#: fortran/match.c:3008
#, no-c-format
msgid "Expected type-bound procedure or procedure pointer component at %C"
msgstr ""
-#: fortran/match.c:2868
+#: fortran/match.c:3226
#, no-c-format
msgid "Syntax error in common block name at %C"
msgstr ""
-#: fortran/match.c:2904
+#: fortran/match.c:3262
#, no-c-format
msgid "Symbol '%s' at %C is already an external symbol that is not COMMON"
msgstr ""
@@ -7272,131 +7712,162 @@ msgstr ""
#. If we find an error, just print it and continue,
#. cause it's just semantic, and we can see if there
#. are more errors.
-#: fortran/match.c:2963
+#: fortran/match.c:3321
#, no-c-format
msgid ""
"Variable '%s' at %L in common block '%s' at %C must be declared with a C "
"interoperable kind since common block '%s' is bind(c)"
msgstr ""
-#: fortran/match.c:2972
+#: fortran/match.c:3330
#, no-c-format
msgid ""
"Variable '%s' in common block '%s' at %C can not be bind(c) since it is not "
"global"
msgstr ""
-#: fortran/match.c:2979
+#: fortran/match.c:3337
#, no-c-format
msgid "Symbol '%s' at %C is already in a COMMON block"
msgstr ""
-#: fortran/match.c:2987
+#: fortran/match.c:3345
#, no-c-format
msgid "Initialized symbol '%s' at %C can only be COMMON in BLOCK DATA"
msgstr ""
-#: fortran/match.c:3014
+#: fortran/match.c:3372
#, no-c-format
msgid "Array specification for symbol '%s' in COMMON at %C must be explicit"
msgstr ""
-#: fortran/match.c:3024
+#: fortran/match.c:3382
#, no-c-format
msgid "Symbol '%s' in COMMON at %C cannot be a POINTER array"
msgstr ""
-#: fortran/match.c:3056
+#: fortran/match.c:3414
#, no-c-format
msgid ""
"Symbol '%s', in COMMON block '%s' at %C is being indirectly equivalenced to "
"another COMMON block '%s'"
msgstr ""
-#: fortran/match.c:3164
+#: fortran/match.c:3522
#, no-c-format
msgid "Namelist group name '%s' at %C already has a basic type of %s"
msgstr ""
-#: fortran/match.c:3172
+#: fortran/match.c:3530
#, no-c-format
msgid ""
"Namelist group name '%s' at %C already is USE associated and cannot be "
"respecified."
msgstr ""
-#: fortran/match.c:3199
+#: fortran/match.c:3557
#, no-c-format
msgid "Assumed size array '%s' in namelist '%s' at %C is not allowed"
msgstr ""
-#: fortran/match.c:3206
+#: fortran/match.c:3564
#, no-c-format
msgid "Assumed character length '%s' in namelist '%s' at %C is not allowed"
msgstr ""
-#: fortran/match.c:3333
+#: fortran/match.c:3691
#, no-c-format
msgid "Derived type component %C is not a permitted EQUIVALENCE member"
msgstr ""
-#: fortran/match.c:3341
+#: fortran/match.c:3699
#, no-c-format
msgid "Array reference in EQUIVALENCE at %C cannot be an array section"
msgstr ""
-#: fortran/match.c:3369
+#: fortran/match.c:3727
#, no-c-format
msgid "EQUIVALENCE at %C requires two or more objects"
msgstr ""
-#: fortran/match.c:3383
+#: fortran/match.c:3741
#, no-c-format
msgid ""
"Attempt to indirectly overlap COMMON blocks %s and %s by EQUIVALENCE at %C"
msgstr ""
-#: fortran/match.c:3509
+#: fortran/match.c:3867
#, no-c-format
msgid "Statement function at %L is recursive"
msgstr ""
-#: fortran/match.c:3597
+#: fortran/match.c:3873
+#, no-c-format
+msgid "Obsolescent feature: Statement function at %C"
+msgstr ""
+
+#: fortran/match.c:3959
#, no-c-format
msgid "Expected initialization expression in CASE at %C"
msgstr ""
-#: fortran/match.c:3620
+#: fortran/match.c:3991
+#, no-c-format
+msgid "Expected block name '%s' of SELECT construct at %C"
+msgstr ""
+
+#: fortran/match.c:4098
#, no-c-format
-msgid "Expected the name of the SELECT CASE construct at %C"
+msgid ""
+"Selector in SELECT TYPE at %C is not a named variable; use associate-name=>"
msgstr ""
-#: fortran/match.c:3632
+#: fortran/match.c:4106
#, no-c-format
-msgid "Expected case name of '%s' at %C"
+msgid "Selector shall be polymorphic in SELECT TYPE statement at %C"
msgstr ""
-#: fortran/match.c:3676
+#: fortran/match.c:4134
#, no-c-format
msgid "Unexpected CASE statement at %C"
msgstr ""
-#: fortran/match.c:3728
+#: fortran/match.c:4186
+#, no-c-format
+msgid "Syntax error in CASE specification at %C"
+msgstr ""
+
+#: fortran/match.c:4204
+#, no-c-format
+msgid "Unexpected TYPE IS statement at %C"
+msgstr ""
+
+#: fortran/match.c:4237
+#, no-c-format
+msgid "Syntax error in TYPE IS specification at %C"
+msgstr ""
+
+#: fortran/match.c:4303
#, no-c-format
-msgid "Syntax error in CASE-specification at %C"
+msgid "CLASS IS specification at %C is not yet supported"
msgstr ""
-#: fortran/match.c:3848
+#: fortran/match.c:4308
+#, no-c-format
+msgid "Syntax error in CLASS IS specification at %C"
+msgstr ""
+
+#: fortran/match.c:4430
#, no-c-format
msgid "ELSEWHERE statement at %C not enclosed in WHERE block"
msgstr ""
-#: fortran/match.c:3886
+#: fortran/match.c:4468
#, no-c-format
msgid "Label '%s' at %C doesn't match WHERE label '%s'"
msgstr ""
-#: fortran/match.c:3986
+#: fortran/match.c:4568
#, no-c-format
msgid "Syntax error in FORALL iterator at %C"
msgstr ""
@@ -7439,284 +7910,284 @@ msgstr ""
msgid "Out of memory-- malloc() failed"
msgstr ""
-#: fortran/module.c:509
+#: fortran/module.c:519
#, no-c-format
msgid "Fortran 2003: module nature in USE statement at %C"
msgstr ""
-#: fortran/module.c:521
+#: fortran/module.c:531
#, no-c-format
msgid ""
"Module nature in USE statement at %C shall be either INTRINSIC or "
"NON_INTRINSIC"
msgstr ""
-#: fortran/module.c:534
+#: fortran/module.c:544
#, no-c-format
msgid "\"::\" was expected after module nature at %C but was not found"
msgstr ""
-#: fortran/module.c:543
+#: fortran/module.c:553
#, no-c-format
msgid "Fortran 2003: \"USE :: module\" at %C"
msgstr ""
-#: fortran/module.c:597
+#: fortran/module.c:607
#, no-c-format
msgid "Missing generic specification in USE statement at %C"
msgstr ""
-#: fortran/module.c:605
+#: fortran/module.c:615
#, no-c-format
msgid "Fortran 2003: Renaming operators in USE statements at %C"
msgstr ""
-#: fortran/module.c:647
+#: fortran/module.c:657
#, no-c-format
msgid "The name '%s' at %C has already been used as an external module name."
msgstr ""
-#: fortran/module.c:925
+#: fortran/module.c:935
#, no-c-format
msgid "Reading module %s at line %d column %d: %s"
msgstr ""
-#: fortran/module.c:929
+#: fortran/module.c:939
#, no-c-format
msgid "Writing module %s at line %d column %d: %s"
msgstr ""
-#: fortran/module.c:933
+#: fortran/module.c:943
#, no-c-format
msgid "Module %s at line %d column %d: %s"
msgstr ""
-#: fortran/module.c:973
+#: fortran/module.c:983
msgid "Unexpected EOF"
msgstr ""
-#: fortran/module.c:1005
+#: fortran/module.c:1015
msgid "Unexpected end of module in string constant"
msgstr ""
-#: fortran/module.c:1059
+#: fortran/module.c:1069
msgid "Integer overflow"
msgstr ""
-#: fortran/module.c:1090
+#: fortran/module.c:1100
msgid "Name too long"
msgstr ""
-#: fortran/module.c:1197
+#: fortran/module.c:1207
msgid "Bad name"
msgstr ""
-#: fortran/module.c:1241
+#: fortran/module.c:1251
msgid "Expected name"
msgstr ""
-#: fortran/module.c:1244
+#: fortran/module.c:1254
msgid "Expected left parenthesis"
msgstr ""
-#: fortran/module.c:1247
+#: fortran/module.c:1257
msgid "Expected right parenthesis"
msgstr ""
-#: fortran/module.c:1250
+#: fortran/module.c:1260
msgid "Expected integer"
msgstr ""
-#: fortran/module.c:1253
+#: fortran/module.c:1263
msgid "Expected string"
msgstr ""
-#: fortran/module.c:1277
+#: fortran/module.c:1287
msgid "find_enum(): Enum not found"
msgstr ""
-#: fortran/module.c:1291
+#: fortran/module.c:1301
#, no-c-format
msgid "Error writing modules file: %s"
msgstr ""
-#: fortran/module.c:1841
+#: fortran/module.c:1882
msgid "Expected attribute bit name"
msgstr ""
-#: fortran/module.c:2666
+#: fortran/module.c:2741
msgid "Expected integer string"
msgstr ""
-#: fortran/module.c:2670
+#: fortran/module.c:2745
msgid "Error converting integer"
msgstr ""
-#: fortran/module.c:2692
+#: fortran/module.c:2767
msgid "Expected real string"
msgstr ""
-#: fortran/module.c:2894
+#: fortran/module.c:2969
msgid "Expected expression type"
msgstr ""
-#: fortran/module.c:2948
+#: fortran/module.c:3023
msgid "Bad operator"
msgstr ""
-#: fortran/module.c:3037
+#: fortran/module.c:3112
msgid "Bad type in constant expression"
msgstr ""
-#: fortran/module.c:3079
+#: fortran/module.c:3154
#, no-c-format
msgid "Namelist %s cannot be renamed by USE association to %s"
msgstr ""
-#: fortran/module.c:4261
+#: fortran/module.c:4428
#, no-c-format
msgid "Symbol '%s' referenced at %L not found in module '%s'"
msgstr ""
-#: fortran/module.c:4268
+#: fortran/module.c:4435
#, no-c-format
msgid "User operator '%s' referenced at %L not found in module '%s'"
msgstr ""
-#: fortran/module.c:4273
+#: fortran/module.c:4440
#, no-c-format
msgid "Intrinsic operator '%s' referenced at %L not found in module '%s'"
msgstr ""
-#: fortran/module.c:4836
+#: fortran/module.c:5049
#, no-c-format
msgid "Can't open module file '%s' for writing at %C: %s"
msgstr ""
-#: fortran/module.c:4874
+#: fortran/module.c:5087
#, no-c-format
msgid "Error writing module file '%s' for writing: %s"
msgstr ""
-#: fortran/module.c:4883
+#: fortran/module.c:5096
#, no-c-format
msgid "Can't delete module file '%s': %s"
msgstr ""
-#: fortran/module.c:4886
+#: fortran/module.c:5099
#, no-c-format
msgid "Can't rename module file '%s' to '%s': %s"
msgstr ""
-#: fortran/module.c:4892
+#: fortran/module.c:5105
#, no-c-format
msgid "Can't delete temporary module file '%s': %s"
msgstr ""
-#: fortran/module.c:4912 fortran/module.c:4994
+#: fortran/module.c:5125 fortran/module.c:5208
#, no-c-format
msgid ""
"Symbol '%s' referenced at %L does not exist in intrinsic module "
"ISO_C_BINDING."
msgstr ""
-#: fortran/module.c:5029
+#: fortran/module.c:5243
#, no-c-format
msgid ""
"Symbol '%s' referenced at %L not found in intrinsic module ISO_C_BINDING"
msgstr ""
-#: fortran/module.c:5051
+#: fortran/module.c:5265
#, no-c-format
msgid "Symbol '%s' already declared"
msgstr ""
-#: fortran/module.c:5106
+#: fortran/module.c:5320
#, no-c-format
msgid ""
"Use of intrinsic module '%s' at %C conflicts with non-intrinsic module name "
"used previously"
msgstr ""
-#: fortran/module.c:5119
+#: fortran/module.c:5333
#, no-c-format
msgid ""
"Symbol '%s' referenced at %L does not exist in intrinsic module "
"ISO_FORTRAN_ENV"
msgstr ""
-#: fortran/module.c:5127
+#: fortran/module.c:5341
#, no-c-format
msgid ""
"Use of the NUMERIC_STORAGE_SIZE named constant from intrinsic module "
"ISO_FORTRAN_ENV at %L is incompatible with option %s"
msgstr ""
-#: fortran/module.c:5155
+#: fortran/module.c:5369
#, no-c-format
msgid ""
"Use of the NUMERIC_STORAGE_SIZE named constant from intrinsic module "
"ISO_FORTRAN_ENV at %C is incompatible with option %s"
msgstr ""
-#: fortran/module.c:5171
+#: fortran/module.c:5385
#, no-c-format
msgid ""
"Symbol '%s' referenced at %L not found in intrinsic module ISO_FORTRAN_ENV"
msgstr ""
-#: fortran/module.c:5205
+#: fortran/module.c:5419
#, no-c-format
msgid "Fortran 2003: ISO_FORTRAN_ENV intrinsic module at %C"
msgstr ""
-#: fortran/module.c:5213
+#: fortran/module.c:5427
#, no-c-format
msgid "Fortran 2003: ISO_C_BINDING module at %C"
msgstr ""
-#: fortran/module.c:5223
+#: fortran/module.c:5437
#, no-c-format
msgid "Can't find an intrinsic module named '%s' at %C"
msgstr ""
-#: fortran/module.c:5228
+#: fortran/module.c:5442
#, no-c-format
msgid "Can't open module file '%s' for reading at %C: %s"
msgstr ""
-#: fortran/module.c:5236
+#: fortran/module.c:5450
#, no-c-format
msgid ""
"Use of non-intrinsic module '%s' at %C conflicts with intrinsic module name "
"used previously"
msgstr ""
-#: fortran/module.c:5251
+#: fortran/module.c:5465
msgid "Unexpected end of module"
msgstr ""
-#: fortran/module.c:5256
+#: fortran/module.c:5470
#, no-c-format
msgid "File '%s' opened at %C is not a GFORTRAN module file"
msgstr ""
-#: fortran/module.c:5263
+#: fortran/module.c:5477
#, no-c-format
msgid "Parse error when checking module version for file '%s' opened at %C"
msgstr ""
-#: fortran/module.c:5268
+#: fortran/module.c:5482
#, no-c-format
msgid "Wrong module version '%s' (expected '"
msgstr ""
-#: fortran/module.c:5281
+#: fortran/module.c:5495
#, no-c-format
msgid "Can't USE the same module we're building!"
msgstr ""
-#: fortran/openmp.c:134 fortran/openmp.c:562
+#: fortran/openmp.c:134 fortran/openmp.c:563
#, no-c-format
msgid "COMMON block /%s/ not found at %C"
msgstr ""
@@ -7736,689 +8207,701 @@ msgstr ""
msgid "COLLAPSE clause argument not constant positive integer at %C"
msgstr ""
-#: fortran/openmp.c:541
+#: fortran/openmp.c:542
#, no-c-format
msgid "Threadprivate variable at %C is an element of a COMMON block"
msgstr ""
-#: fortran/openmp.c:581
+#: fortran/openmp.c:582
#, no-c-format
msgid "Syntax error in !$OMP THREADPRIVATE list at %C"
msgstr ""
-#: fortran/openmp.c:759 fortran/resolve.c:6635 fortran/resolve.c:6989
+#: fortran/openmp.c:760 fortran/resolve.c:7424 fortran/resolve.c:7813
#, no-c-format
msgid "IF clause at %L requires a scalar LOGICAL expression"
msgstr ""
-#: fortran/openmp.c:767
+#: fortran/openmp.c:768
#, no-c-format
msgid "NUM_THREADS clause at %L requires a scalar INTEGER expression"
msgstr ""
-#: fortran/openmp.c:775
+#: fortran/openmp.c:776
#, no-c-format
msgid "SCHEDULE clause's chunk_size at %L requires a scalar INTEGER expression"
msgstr ""
-#: fortran/openmp.c:815
+#: fortran/openmp.c:816
#, no-c-format
msgid "Object '%s' is not a variable at %L"
msgstr ""
-#: fortran/openmp.c:823 fortran/openmp.c:833 fortran/openmp.c:840
-#: fortran/openmp.c:850
+#: fortran/openmp.c:824 fortran/openmp.c:834 fortran/openmp.c:841
+#: fortran/openmp.c:851
#, no-c-format
msgid "Symbol '%s' present on multiple clauses at %L"
msgstr ""
-#: fortran/openmp.c:873
+#: fortran/openmp.c:874
#, no-c-format
msgid "Non-THREADPRIVATE object '%s' in COPYIN clause at %L"
msgstr ""
-#: fortran/openmp.c:876
+#: fortran/openmp.c:877
#, no-c-format
msgid "COPYIN clause object '%s' at %L has ALLOCATABLE components"
msgstr ""
-#: fortran/openmp.c:884
+#: fortran/openmp.c:885
#, no-c-format
msgid "Assumed size array '%s' in COPYPRIVATE clause at %L"
msgstr ""
-#: fortran/openmp.c:887
+#: fortran/openmp.c:888
#, no-c-format
msgid "COPYPRIVATE clause object '%s' at %L has ALLOCATABLE components"
msgstr ""
-#: fortran/openmp.c:895
+#: fortran/openmp.c:896
#, no-c-format
msgid "THREADPRIVATE object '%s' in SHARED clause at %L"
msgstr ""
-#: fortran/openmp.c:898
+#: fortran/openmp.c:899
#, no-c-format
msgid "Cray pointee '%s' in SHARED clause at %L"
msgstr ""
-#: fortran/openmp.c:906
+#: fortran/openmp.c:907
#, no-c-format
msgid "THREADPRIVATE object '%s' in %s clause at %L"
msgstr ""
-#: fortran/openmp.c:909
+#: fortran/openmp.c:910
#, no-c-format
msgid "Cray pointee '%s' in %s clause at %L"
msgstr ""
-#: fortran/openmp.c:914
+#: fortran/openmp.c:915
#, no-c-format
msgid "POINTER object '%s' in %s clause at %L"
msgstr ""
-#: fortran/openmp.c:919
+#: fortran/openmp.c:920
#, no-c-format
msgid "%s clause object '%s' has ALLOCATABLE components at %L"
msgstr ""
-#: fortran/openmp.c:922
+#: fortran/openmp.c:923
#, no-c-format
msgid "Cray pointer '%s' in %s clause at %L"
msgstr ""
-#: fortran/openmp.c:926
+#: fortran/openmp.c:927
#, no-c-format
msgid "Assumed size array '%s' in %s clause at %L"
msgstr ""
-#: fortran/openmp.c:931
+#: fortran/openmp.c:932
#, no-c-format
msgid "Variable '%s' in %s clause is used in NAMELIST statement at %L"
msgstr ""
-#: fortran/openmp.c:940
+#: fortran/openmp.c:941
#, no-c-format
msgid "%c REDUCTION variable '%s' at %L must be of numeric type, got %s"
msgstr ""
-#: fortran/openmp.c:951
+#: fortran/openmp.c:952
#, no-c-format
msgid "%s REDUCTION variable '%s' must be LOGICAL at %L"
msgstr ""
-#: fortran/openmp.c:962
+#: fortran/openmp.c:963
#, no-c-format
msgid "%s REDUCTION variable '%s' must be INTEGER or REAL at %L"
msgstr ""
-#: fortran/openmp.c:971
+#: fortran/openmp.c:972
#, no-c-format
msgid "%s REDUCTION variable '%s' must be INTEGER at %L"
msgstr ""
-#: fortran/openmp.c:1083
+#: fortran/openmp.c:1084
#, no-c-format
msgid ""
"!$OMP ATOMIC statement must set a scalar variable of intrinsic type at %L"
msgstr ""
-#: fortran/openmp.c:1123
+#: fortran/openmp.c:1124
#, no-c-format
msgid ""
"!$OMP ATOMIC assignment operator must be +, *, -, /, .AND., .OR., .EQV. or ."
"NEQV. at %L"
msgstr ""
-#: fortran/openmp.c:1171
+#: fortran/openmp.c:1172
#, no-c-format
msgid ""
"!$OMP ATOMIC assignment must be var = var op expr or var = expr op var at %L"
msgstr ""
-#: fortran/openmp.c:1185
+#: fortran/openmp.c:1186
#, no-c-format
msgid ""
"!$OMP ATOMIC var = var op expr not mathematically equivalent to var = var op "
"(expr) at %L"
msgstr ""
-#: fortran/openmp.c:1217
+#: fortran/openmp.c:1218
#, no-c-format
msgid ""
"expr in !$OMP ATOMIC assignment var = var op expr must be scalar and cannot "
"reference var at %L"
msgstr ""
-#: fortran/openmp.c:1241
+#: fortran/openmp.c:1242
#, no-c-format
msgid ""
"!$OMP ATOMIC assignment intrinsic IAND, IOR or IEOR must have two arguments "
"at %L"
msgstr ""
-#: fortran/openmp.c:1248
+#: fortran/openmp.c:1249
#, no-c-format
msgid ""
"!$OMP ATOMIC assignment intrinsic must be MIN, MAX, IAND, IOR or IEOR at %L"
msgstr ""
-#: fortran/openmp.c:1264
+#: fortran/openmp.c:1265
#, no-c-format
msgid ""
"!$OMP ATOMIC intrinsic arguments except one must not reference '%s' at %L"
msgstr ""
-#: fortran/openmp.c:1267
+#: fortran/openmp.c:1268
#, no-c-format
msgid "!$OMP ATOMIC intrinsic arguments must be scalar at %L"
msgstr ""
-#: fortran/openmp.c:1273
+#: fortran/openmp.c:1274
#, no-c-format
msgid "First or last !$OMP ATOMIC intrinsic argument must be '%s' at %L"
msgstr ""
-#: fortran/openmp.c:1291
+#: fortran/openmp.c:1292
#, no-c-format
msgid ""
"!$OMP ATOMIC assignment must have an operator or intrinsic on right hand "
"side at %L"
msgstr ""
-#: fortran/openmp.c:1426
+#: fortran/openmp.c:1427
#, no-c-format
msgid "!$OMP DO cannot be a DO WHILE or DO without loop control at %L"
msgstr ""
-#: fortran/openmp.c:1432
+#: fortran/openmp.c:1433
#, no-c-format
msgid "!$OMP DO iteration variable must be of type integer at %L"
msgstr ""
-#: fortran/openmp.c:1436
+#: fortran/openmp.c:1437
#, no-c-format
msgid "!$OMP DO iteration variable must not be THREADPRIVATE at %L"
msgstr ""
-#: fortran/openmp.c:1444
+#: fortran/openmp.c:1445
#, no-c-format
msgid ""
"!$OMP DO iteration variable present on clause other than PRIVATE or "
"LASTPRIVATE at %L"
msgstr ""
-#: fortran/openmp.c:1462
+#: fortran/openmp.c:1463
#, no-c-format
msgid "!$OMP DO collapsed loops don't form rectangular iteration space at %L"
msgstr ""
-#: fortran/openmp.c:1476
+#: fortran/openmp.c:1477
#, no-c-format
msgid "collapsed !$OMP DO loops not perfectly nested at %L"
msgstr ""
-#: fortran/openmp.c:1485 fortran/openmp.c:1492
+#: fortran/openmp.c:1486 fortran/openmp.c:1493
#, no-c-format
msgid "not enough DO loops for collapsed !$OMP DO at %L"
msgstr ""
-#: fortran/options.c:243
-#, no-c-format
-msgid "Option -fwhole-program is not supported for Fortran"
-msgstr ""
-
-#: fortran/options.c:301
+#: fortran/options.c:326
#, no-c-format
msgid "Reading file '%s' as free form"
msgstr ""
-#: fortran/options.c:311
+#: fortran/options.c:336
#, no-c-format
msgid "'-fd-lines-as-comments' has no effect in free form"
msgstr ""
-#: fortran/options.c:314
+#: fortran/options.c:339
#, no-c-format
msgid "'-fd-lines-as-code' has no effect in free form"
msgstr ""
-#: fortran/options.c:332
+#: fortran/options.c:357
#, no-c-format
msgid "Flag -fno-automatic overwrites -fmax-stack-var-size=%d"
msgstr ""
-#: fortran/options.c:335
+#: fortran/options.c:360
#, no-c-format
msgid "Flag -fno-automatic overwrites -frecursive"
msgstr ""
-#: fortran/options.c:337
+#: fortran/options.c:362
#, no-c-format
msgid "Flag -fno-automatic overwrites -frecursive implied by -fopenmp"
msgstr ""
-#: fortran/options.c:341
+#: fortran/options.c:366
#, no-c-format
msgid "Flag -frecursive overwrites -fmax-stack-var-size=%d"
msgstr ""
-#: fortran/options.c:345
+#: fortran/options.c:370
#, no-c-format
msgid "Flag -fmax-stack-var-size=%d overwrites -frecursive implied by -fopenmp"
msgstr ""
-#: fortran/options.c:418
+#: fortran/options.c:446
#, no-c-format
msgid "gfortran: Only one -J option allowed"
msgstr ""
-#: fortran/options.c:461
+#: fortran/options.c:489
#, no-c-format
msgid "Argument to -ffpe-trap is not valid: %s"
msgstr ""
-#: fortran/options.c:498
+#: fortran/options.c:527
#, no-c-format
msgid "Argument to -fcheck is not valid: %s"
msgstr ""
-#: fortran/options.c:651
+#: fortran/options.c:680
#, no-c-format
msgid "Fixed line length must be at least seven."
msgstr ""
-#: fortran/options.c:669
+#: fortran/options.c:698
#, no-c-format
msgid "Free line length must be at least three."
msgstr ""
-#: fortran/options.c:687
+#: fortran/options.c:716
#, no-c-format
msgid "-static-libgfortran is not supported in this configuration"
msgstr ""
-#: fortran/options.c:735
+#: fortran/options.c:764
#, no-c-format
msgid "Maximum supported identifier length is %d"
msgstr ""
-#: fortran/options.c:767
+#: fortran/options.c:796
#, no-c-format
msgid "Unrecognized option to -finit-logical: %s"
msgstr ""
-#: fortran/options.c:783
+#: fortran/options.c:812
#, no-c-format
msgid "Unrecognized option to -finit-real: %s"
msgstr ""
-#: fortran/options.c:799
+#: fortran/options.c:828
#, no-c-format
msgid "The value of n in -finit-character=n must be between 0 and 127"
msgstr ""
-#: fortran/options.c:890
+#: fortran/options.c:919
#, no-c-format
msgid "Maximum subrecord length cannot exceed %d"
msgstr ""
-#: fortran/parse.c:455
+#: fortran/parse.c:459
#, no-c-format
msgid "Unclassifiable statement at %C"
msgstr ""
-#: fortran/parse.c:479
+#: fortran/parse.c:483
#, no-c-format
msgid "OpenMP directives at %C may not appear in PURE or ELEMENTAL procedures"
msgstr ""
-#: fortran/parse.c:560
+#: fortran/parse.c:564
#, no-c-format
msgid "Unclassifiable OpenMP directive at %C"
msgstr ""
-#: fortran/parse.c:602 fortran/parse.c:743
+#: fortran/parse.c:592
+#, no-c-format
+msgid "Unclassifiable GCC directive at %C"
+msgstr ""
+
+#: fortran/parse.c:634 fortran/parse.c:803
#, no-c-format
msgid "Zero is not a valid statement label at %C"
msgstr ""
-#: fortran/parse.c:609 fortran/parse.c:735
+#: fortran/parse.c:641 fortran/parse.c:795
#, no-c-format
msgid "Non-numeric character in statement label at %C"
msgstr ""
-#: fortran/parse.c:621 fortran/parse.c:657 fortran/parse.c:783
+#: fortran/parse.c:653 fortran/parse.c:707 fortran/parse.c:843
#, no-c-format
msgid "Semicolon at %C needs to be preceded by statement"
msgstr ""
-#: fortran/parse.c:629 fortran/parse.c:795
+#: fortran/parse.c:661 fortran/parse.c:855
#, no-c-format
-msgid "Ignoring statement label in empty statement at %C"
+msgid "Ignoring statement label in empty statement at %L"
msgstr ""
-#: fortran/parse.c:722 fortran/parse.c:762
+#: fortran/parse.c:782 fortran/parse.c:822
#, no-c-format
msgid "Bad continuation line at %C"
msgstr ""
-#: fortran/parse.c:822
-#, no-c-format
-msgid "Line truncated at %C"
-msgstr ""
-
-#: fortran/parse.c:1009
+#: fortran/parse.c:1069
#, no-c-format
msgid "FORMAT statement at %L does not have a statement label"
msgstr ""
-#: fortran/parse.c:1081
+#: fortran/parse.c:1141
msgid "arithmetic IF"
msgstr ""
-#: fortran/parse.c:1087
+#: fortran/parse.c:1147
msgid "attribute declaration"
msgstr ""
-#: fortran/parse.c:1117
+#: fortran/parse.c:1180
msgid "data declaration"
msgstr ""
-#: fortran/parse.c:1126
+#: fortran/parse.c:1189
msgid "derived type declaration"
msgstr ""
-#: fortran/parse.c:1208
+#: fortran/parse.c:1274
msgid "block IF"
msgstr ""
-#: fortran/parse.c:1217
+#: fortran/parse.c:1283
msgid "implied END DO"
msgstr ""
-#: fortran/parse.c:1293
+#: fortran/parse.c:1359
msgid "assignment"
msgstr ""
-#: fortran/parse.c:1296
+#: fortran/parse.c:1362
msgid "pointer assignment"
msgstr ""
-#: fortran/parse.c:1305
+#: fortran/parse.c:1380
msgid "simple IF"
msgstr ""
-#: fortran/parse.c:1541
+#: fortran/parse.c:1621
#, no-c-format
msgid "Unexpected %s statement at %C"
msgstr ""
-#: fortran/parse.c:1681
+#: fortran/parse.c:1768
#, no-c-format
msgid "%s statement at %C cannot follow %s statement at %L"
msgstr ""
-#: fortran/parse.c:1698
+#: fortran/parse.c:1785
#, no-c-format
msgid "Unexpected end of file in '%s'"
msgstr ""
-#: fortran/parse.c:1730
+#: fortran/parse.c:1817
#, no-c-format
msgid "Derived-type '%s' with SEQUENCE must not have a CONTAINS section at %C"
msgstr ""
-#: fortran/parse.c:1733
+#: fortran/parse.c:1820
#, no-c-format
msgid "Derived-type '%s' with BIND(C) must not have a CONTAINS section at %C"
msgstr ""
-#: fortran/parse.c:1753
+#: fortran/parse.c:1840
#, no-c-format
msgid "Components in TYPE at %C must precede CONTAINS"
msgstr ""
-#: fortran/parse.c:1758
+#: fortran/parse.c:1845
#, no-c-format
msgid "Fortran 2003: Type-bound procedure at %C"
msgstr ""
-#: fortran/parse.c:1767
+#: fortran/parse.c:1854
#, no-c-format
msgid "Fortran 2003: GENERIC binding at %C"
msgstr ""
-#: fortran/parse.c:1777
+#: fortran/parse.c:1864
#, no-c-format
msgid "Fortran 2003: FINAL procedure declaration at %C"
msgstr ""
-#: fortran/parse.c:1789
+#: fortran/parse.c:1876
#, no-c-format
msgid "Fortran 2008: Derived type definition at %C with empty CONTAINS section"
msgstr ""
-#: fortran/parse.c:1800 fortran/parse.c:1907
+#: fortran/parse.c:1887 fortran/parse.c:1994
#, no-c-format
msgid "PRIVATE statement in TYPE at %C must be inside a MODULE"
msgstr ""
-#: fortran/parse.c:1808
+#: fortran/parse.c:1895
#, no-c-format
msgid "PRIVATE statement at %C must precede procedure bindings"
msgstr ""
-#: fortran/parse.c:1816 fortran/parse.c:1923
+#: fortran/parse.c:1903 fortran/parse.c:2010
#, no-c-format
msgid "Duplicate PRIVATE statement at %C"
msgstr ""
-#: fortran/parse.c:1826
+#: fortran/parse.c:1913
#, no-c-format
msgid "SEQUENCE statement at %C must precede CONTAINS"
msgstr ""
-#: fortran/parse.c:1831
+#: fortran/parse.c:1918
#, no-c-format
msgid "Already inside a CONTAINS block at %C"
msgstr ""
-#: fortran/parse.c:1887
+#: fortran/parse.c:1974
#, no-c-format
msgid "FINAL declaration at %C must be inside CONTAINS"
msgstr ""
-#: fortran/parse.c:1896
+#: fortran/parse.c:1983
#, no-c-format
msgid "Fortran 2003: Derived type definition at %C without components"
msgstr ""
-#: fortran/parse.c:1915
+#: fortran/parse.c:2002
#, no-c-format
msgid "PRIVATE statement at %C must precede structure components"
msgstr ""
-#: fortran/parse.c:1936
+#: fortran/parse.c:2023
#, no-c-format
msgid "SEQUENCE statement at %C must precede structure components"
msgstr ""
-#: fortran/parse.c:1943
+#: fortran/parse.c:2030
#, no-c-format
msgid "SEQUENCE attribute at %C already specified in TYPE statement"
msgstr ""
-#: fortran/parse.c:1948
+#: fortran/parse.c:2035
#, no-c-format
msgid "Duplicate SEQUENCE statement at %C"
msgstr ""
-#: fortran/parse.c:1959
+#: fortran/parse.c:2046
#, no-c-format
msgid "Fortran 2003: CONTAINS block in derived type definition at %C"
msgstr ""
-#: fortran/parse.c:2047
+#: fortran/parse.c:2134
#, no-c-format
msgid "ENUM declaration at %C has no ENUMERATORS"
msgstr ""
-#: fortran/parse.c:2133
+#: fortran/parse.c:2220
#, no-c-format
msgid "Unexpected %s statement in INTERFACE block at %C"
msgstr ""
-#: fortran/parse.c:2159
+#: fortran/parse.c:2246
#, no-c-format
msgid "SUBROUTINE at %C does not belong in a generic function interface"
msgstr ""
-#: fortran/parse.c:2163
+#: fortran/parse.c:2250
#, no-c-format
msgid "FUNCTION at %C does not belong in a generic subroutine interface"
msgstr ""
-#: fortran/parse.c:2173
+#: fortran/parse.c:2260
#, no-c-format
msgid ""
"Name '%s' of ABSTRACT INTERFACE at %C cannot be the same as an intrinsic type"
msgstr ""
-#: fortran/parse.c:2204
+#: fortran/parse.c:2291
#, no-c-format
msgid "Unexpected %s statement at %C in INTERFACE body"
msgstr ""
-#: fortran/parse.c:2222
+#: fortran/parse.c:2309
#, no-c-format
msgid ""
"INTERFACE procedure '%s' at %L has the same name as the enclosing procedure"
msgstr ""
-#: fortran/parse.c:2408
+#: fortran/parse.c:2430
+#, no-c-format
+msgid "%s statement is not allowed inside of BLOCK at %C"
+msgstr ""
+
+#: fortran/parse.c:2516
#, no-c-format
msgid "%s statement must appear in a MODULE"
msgstr ""
-#: fortran/parse.c:2415
+#: fortran/parse.c:2523
#, no-c-format
msgid "%s statement at %C follows another accessibility specification"
msgstr ""
-#: fortran/parse.c:2465
+#: fortran/parse.c:2573
#, no-c-format
msgid "Bad kind expression for function '%s' at %L"
msgstr ""
-#: fortran/parse.c:2469
+#: fortran/parse.c:2577
#, no-c-format
msgid "The type for function '%s' at %L is not accessible"
msgstr ""
-#: fortran/parse.c:2527
+#: fortran/parse.c:2635
#, no-c-format
msgid "ELSEWHERE statement at %C follows previous unmasked ELSEWHERE"
msgstr ""
-#: fortran/parse.c:2548
+#: fortran/parse.c:2656
#, no-c-format
msgid "Unexpected %s statement in WHERE block at %C"
msgstr ""
-#: fortran/parse.c:2607
+#: fortran/parse.c:2715
#, no-c-format
msgid "Unexpected %s statement in FORALL block at %C"
msgstr ""
-#: fortran/parse.c:2658
+#: fortran/parse.c:2766
#, no-c-format
msgid "ELSE IF statement at %C cannot follow ELSE statement at %L"
msgstr ""
-#: fortran/parse.c:2676
+#: fortran/parse.c:2784
#, no-c-format
msgid "Duplicate ELSE statements at %L and %C"
msgstr ""
-#: fortran/parse.c:2737
+#: fortran/parse.c:2845
#, no-c-format
msgid "Expected a CASE or END SELECT statement following SELECT CASE at %C"
msgstr ""
-#: fortran/parse.c:2795
+#: fortran/parse.c:2928
+#, no-c-format
+msgid ""
+"Expected TYPE IS, CLASS IS or END SELECT statement following SELECT TYPE at %"
+"C"
+msgstr ""
+
+#: fortran/parse.c:2990
#, no-c-format
msgid "Variable '%s' at %C cannot be redefined inside loop beginning at %L"
msgstr ""
-#: fortran/parse.c:2828
+#: fortran/parse.c:3023
#, no-c-format
msgid "End of nonblock DO statement at %C is within another block"
msgstr ""
-#: fortran/parse.c:2837
+#: fortran/parse.c:3032
#, no-c-format
msgid "End of nonblock DO statement at %C is interwoven with another DO loop"
msgstr ""
-#: fortran/parse.c:2886
+#: fortran/parse.c:3086
+#, no-c-format
+msgid "Fortran 2008: BLOCK construct at %C"
+msgstr ""
+
+#: fortran/parse.c:3144
#, no-c-format
msgid "Statement label in ENDDO at %C doesn't match DO label"
msgstr ""
-#: fortran/parse.c:2902
+#: fortran/parse.c:3160
#, no-c-format
msgid "Named block DO at %L requires matching ENDDO name"
msgstr ""
-#: fortran/parse.c:3161
+#: fortran/parse.c:3419
#, no-c-format
msgid "Name after !$omp critical and !$omp end critical does not match at %C"
msgstr ""
-#: fortran/parse.c:3217
+#: fortran/parse.c:3475
#, no-c-format
msgid "%s statement at %C cannot terminate a non-block DO loop"
msgstr ""
-#: fortran/parse.c:3404
+#: fortran/parse.c:3665
#, no-c-format
msgid "Contained procedure '%s' at %C is already ambiguous"
msgstr ""
-#: fortran/parse.c:3454
+#: fortran/parse.c:3715
#, no-c-format
msgid "Unexpected %s statement in CONTAINS section at %C"
msgstr ""
-#: fortran/parse.c:3478
+#: fortran/parse.c:3739
#, no-c-format
msgid ""
"Fortran 2008: CONTAINS statement without FUNCTION or SUBROUTINE statement at "
"%C"
msgstr ""
-#: fortran/parse.c:3549
+#: fortran/parse.c:3816
#, no-c-format
msgid "CONTAINS statement at %C is already in a contained program unit"
msgstr ""
-#: fortran/parse.c:3598
+#: fortran/parse.c:3865
#, no-c-format
msgid "Global name '%s' at %L is already being used as a %s at %L"
msgstr ""
-#: fortran/parse.c:3619
+#: fortran/parse.c:3886
#, no-c-format
msgid "Blank BLOCK DATA at %C conflicts with prior BLOCK DATA at %L"
msgstr ""
-#: fortran/parse.c:3645
+#: fortran/parse.c:3912
#, no-c-format
msgid "Unexpected %s statement in BLOCK DATA at %C"
msgstr ""
-#: fortran/parse.c:3688
+#: fortran/parse.c:3955
#, no-c-format
msgid "Unexpected %s statement in MODULE at %C"
msgstr ""
@@ -8426,291 +8909,291 @@ msgstr ""
#. If we see a duplicate main program, shut down. If the second
#. instance is an implied main program, i.e. data decls or executable
#. statements, we're in for lots of errors.
-#: fortran/parse.c:3936
+#: fortran/parse.c:4272
#, no-c-format
msgid "Two main PROGRAMs at %L and %C"
msgstr ""
-#: fortran/primary.c:90
+#: fortran/primary.c:93
#, no-c-format
msgid "Missing kind-parameter at %C"
msgstr ""
-#: fortran/primary.c:214
+#: fortran/primary.c:217
#, no-c-format
msgid "Integer kind %d at %C not available"
msgstr ""
-#: fortran/primary.c:222
+#: fortran/primary.c:225
#, no-c-format
msgid ""
"Integer too big for its kind at %C. This check can be disabled with the "
"option -fno-range-check"
msgstr ""
-#: fortran/primary.c:251
+#: fortran/primary.c:254
#, no-c-format
msgid "Extension: Hollerith constant at %C"
msgstr ""
-#: fortran/primary.c:263
+#: fortran/primary.c:266
#, no-c-format
msgid "Invalid Hollerith constant: %L must contain at least one character"
msgstr ""
-#: fortran/primary.c:269
+#: fortran/primary.c:272
#, no-c-format
msgid "Invalid Hollerith constant: Integer kind at %L should be default"
msgstr ""
-#: fortran/primary.c:286
+#: fortran/primary.c:289
#, no-c-format
msgid "Invalid Hollerith constant at %L contains a wide character"
msgstr ""
-#: fortran/primary.c:367
+#: fortran/primary.c:370
#, no-c-format
msgid "Extension: Hexadecimal constant at %C uses non-standard syntax"
msgstr ""
-#: fortran/primary.c:377
+#: fortran/primary.c:380
#, no-c-format
msgid "Empty set of digits in BOZ constant at %C"
msgstr ""
-#: fortran/primary.c:383
+#: fortran/primary.c:386
#, no-c-format
msgid "Illegal character in BOZ constant at %C"
msgstr ""
-#: fortran/primary.c:406
+#: fortran/primary.c:409
#, no-c-format
msgid "Extension: BOZ constant at %C uses non-standard postfix syntax"
msgstr ""
-#: fortran/primary.c:437
+#: fortran/primary.c:440
#, no-c-format
msgid "Integer too big for integer kind %i at %C"
msgstr ""
-#: fortran/primary.c:443
+#: fortran/primary.c:446
#, no-c-format
msgid "Fortran 2003: BOZ used outside a DATA statement at %C"
msgstr ""
-#: fortran/primary.c:543
+#: fortran/primary.c:546
#, no-c-format
msgid "Missing exponent in real number at %C"
msgstr ""
-#: fortran/primary.c:599
+#: fortran/primary.c:602
#, no-c-format
msgid "Real number at %C has a 'd' exponent and an explicit kind"
msgstr ""
-#: fortran/primary.c:612
+#: fortran/primary.c:615
#, no-c-format
msgid "Invalid real kind %d at %C"
msgstr ""
-#: fortran/primary.c:626
+#: fortran/primary.c:629
#, no-c-format
msgid "Real constant overflows its kind at %C"
msgstr ""
-#: fortran/primary.c:631
+#: fortran/primary.c:634
#, no-c-format
msgid "Real constant underflows its kind at %C"
msgstr ""
-#: fortran/primary.c:723
+#: fortran/primary.c:726
#, no-c-format
msgid "Syntax error in SUBSTRING specification at %C"
msgstr ""
-#: fortran/primary.c:935
+#: fortran/primary.c:938
#, no-c-format
msgid "Invalid kind %d for CHARACTER constant at %C"
msgstr ""
-#: fortran/primary.c:956
+#: fortran/primary.c:959
#, no-c-format
msgid "Unterminated character constant beginning at %C"
msgstr ""
-#: fortran/primary.c:997
+#: fortran/primary.c:1000
#, no-c-format
msgid ""
"Character '%s' in string at %C is not representable in character kind %d"
msgstr ""
-#: fortran/primary.c:1080
+#: fortran/primary.c:1083
#, no-c-format
msgid "Bad kind for logical constant at %C"
msgstr ""
-#: fortran/primary.c:1119
+#: fortran/primary.c:1122
#, no-c-format
msgid "Expected PARAMETER symbol in complex constant at %C"
msgstr ""
-#: fortran/primary.c:1125
+#: fortran/primary.c:1128
#, no-c-format
msgid "Numeric PARAMETER required in complex constant at %C"
msgstr ""
-#: fortran/primary.c:1131
+#: fortran/primary.c:1134
#, no-c-format
msgid "Scalar PARAMETER required in complex constant at %C"
msgstr ""
-#: fortran/primary.c:1135
+#: fortran/primary.c:1138
#, no-c-format
msgid "Fortran 2003: PARAMETER symbol in complex constant at %C"
msgstr ""
-#: fortran/primary.c:1165
+#: fortran/primary.c:1168
#, no-c-format
msgid "Error converting PARAMETER constant in complex constant at %C"
msgstr ""
-#: fortran/primary.c:1294
+#: fortran/primary.c:1297
#, no-c-format
msgid "Syntax error in COMPLEX constant at %C"
msgstr ""
-#: fortran/primary.c:1483
+#: fortran/primary.c:1486
#, no-c-format
msgid "Keyword '%s' at %C has already appeared in the current argument list"
msgstr ""
-#: fortran/primary.c:1547
+#: fortran/primary.c:1550
#, no-c-format
msgid "Extension: argument list function at %C"
msgstr ""
-#: fortran/primary.c:1614
+#: fortran/primary.c:1617
#, no-c-format
msgid "Expected alternate return label at %C"
msgstr ""
-#: fortran/primary.c:1632
+#: fortran/primary.c:1635
#, no-c-format
msgid "Missing keyword name in actual argument list at %C"
msgstr ""
-#: fortran/primary.c:1677
+#: fortran/primary.c:1680
#, no-c-format
msgid "Syntax error in argument list at %C"
msgstr ""
-#: fortran/primary.c:1775
+#: fortran/primary.c:1785
#, no-c-format
msgid "Expected structure component name at %C"
msgstr ""
-#: fortran/primary.c:1812
+#: fortran/primary.c:1829
#, no-c-format
msgid "Expected argument list at %C"
msgstr ""
-#: fortran/primary.c:2118
+#: fortran/primary.c:2179
#, no-c-format
msgid ""
"Fortran 2003: Structure constructor with missing optional arguments at %C"
msgstr ""
-#: fortran/primary.c:2126
+#: fortran/primary.c:2187
#, no-c-format
msgid ""
"No initializer for component '%s' given in the structure constructor at %C!"
msgstr ""
-#: fortran/primary.c:2182
+#: fortran/primary.c:2243
#, no-c-format
msgid "Can't construct ABSTRACT type '%s' at %C"
msgstr ""
-#: fortran/primary.c:2210
+#: fortran/primary.c:2271
#, no-c-format
msgid "Fortran 2003: Structure constructor with named arguments at %C"
msgstr ""
-#: fortran/primary.c:2225
+#: fortran/primary.c:2286
#, no-c-format
msgid "Component initializer without name after component named %s at %C!"
msgstr ""
-#: fortran/primary.c:2228
+#: fortran/primary.c:2289
#, no-c-format
msgid "Too many components in structure constructor at %C!"
msgstr ""
-#: fortran/primary.c:2261
+#: fortran/primary.c:2322
#, no-c-format
msgid "Component '%s' is initialized twice in the structure constructor at %C!"
msgstr ""
-#: fortran/primary.c:2317
+#: fortran/primary.c:2378
#, no-c-format
msgid ""
"component '%s' at %L has already been set by a parent derived type "
"constructor"
msgstr ""
-#: fortran/primary.c:2340
+#: fortran/primary.c:2401
#, no-c-format
msgid "Syntax error in structure constructor at %C"
msgstr ""
-#: fortran/primary.c:2456
+#: fortran/primary.c:2517
#, no-c-format
msgid ""
"'%s' at %C is the name of a recursive function and so refers to the result "
"variable. Use an explicit RESULT variable for direct recursion (12.5.2.1)"
msgstr ""
-#: fortran/primary.c:2577
+#: fortran/primary.c:2638
#, no-c-format
msgid "Unexpected use of subroutine name '%s' at %C"
msgstr ""
-#: fortran/primary.c:2608
+#: fortran/primary.c:2669
#, no-c-format
msgid "Statement function '%s' requires argument list at %C"
msgstr ""
-#: fortran/primary.c:2611
+#: fortran/primary.c:2672
#, no-c-format
msgid "Function '%s' requires an argument list at %C"
msgstr ""
-#: fortran/primary.c:2658
+#: fortran/primary.c:2719
#, no-c-format
msgid "Missing argument to '%s' at %C"
msgstr ""
-#: fortran/primary.c:2799
+#: fortran/primary.c:2860
#, no-c-format
msgid "Missing argument list in function '%s' at %C"
msgstr ""
-#: fortran/primary.c:2827
+#: fortran/primary.c:2888
#, no-c-format
msgid "Symbol at %C is not appropriate for an expression"
msgstr ""
-#: fortran/primary.c:2895
+#: fortran/primary.c:2956
#, no-c-format
msgid "Assigning to PROTECTED variable at %C"
msgstr ""
-#: fortran/primary.c:2929
+#: fortran/primary.c:2990
#, no-c-format
msgid "Named constant at %C in an EQUIVALENCE"
msgstr ""
-#: fortran/primary.c:2965
+#: fortran/primary.c:3026
#, no-c-format
msgid "'%s' at %C is not a variable"
msgstr ""
@@ -8746,7 +9229,7 @@ msgstr ""
msgid "Dummy procedure at %L not allowed in ELEMENTAL procedure"
msgstr ""
-#: fortran/resolve.c:201 fortran/resolve.c:1334
+#: fortran/resolve.c:201 fortran/resolve.c:1412
#, no-c-format
msgid ""
"Unable to find a specific INTRINSIC procedure for the reference '%s' at %L"
@@ -8801,218 +9284,248 @@ msgstr ""
msgid "Result '%s' of contained function '%s' at %L has no IMPLICIT type"
msgstr ""
-#: fortran/resolve.c:377
+#: fortran/resolve.c:386
+msgid "module procedure"
+msgstr ""
+
+#: fortran/resolve.c:387
+msgid "internal function"
+msgstr ""
+
+#: fortran/resolve.c:384
#, no-c-format
-msgid ""
-"Character-valued internal function '%s' at %L must not be assumed length"
+msgid "Character-valued %s '%s' at %L must not be assumed length"
msgstr ""
-#: fortran/resolve.c:548
+#: fortran/resolve.c:559
#, no-c-format
msgid "Function %s at %L has entries with mismatched array specifications"
msgstr ""
-#: fortran/resolve.c:565
+#: fortran/resolve.c:576
#, no-c-format
msgid ""
"Extension: Function %s at %L with entries returning variables of different "
"string lengths"
msgstr ""
-#: fortran/resolve.c:592
+#: fortran/resolve.c:603
#, no-c-format
msgid "FUNCTION result %s can't be an array in FUNCTION %s at %L"
msgstr ""
-#: fortran/resolve.c:596
+#: fortran/resolve.c:607
#, no-c-format
msgid "ENTRY result %s can't be an array in FUNCTION %s at %L"
msgstr ""
-#: fortran/resolve.c:603
+#: fortran/resolve.c:614
#, no-c-format
msgid "FUNCTION result %s can't be a POINTER in FUNCTION %s at %L"
msgstr ""
-#: fortran/resolve.c:607
+#: fortran/resolve.c:618
#, no-c-format
msgid "ENTRY result %s can't be a POINTER in FUNCTION %s at %L"
msgstr ""
-#: fortran/resolve.c:645
+#: fortran/resolve.c:656
#, no-c-format
msgid "FUNCTION result %s can't be of type %s in FUNCTION %s at %L"
msgstr ""
-#: fortran/resolve.c:650
+#: fortran/resolve.c:661
#, no-c-format
msgid "ENTRY result %s can't be of type %s in FUNCTION %s at %L"
msgstr ""
-#: fortran/resolve.c:708
+#: fortran/resolve.c:719
#, no-c-format
msgid ""
"Variable '%s' at %L is in COMMON but only in BLOCK DATA initialization is "
"allowed"
msgstr ""
-#: fortran/resolve.c:712
+#: fortran/resolve.c:723
#, no-c-format
msgid ""
"Initialized variable '%s' at %L is in a blank COMMON but initialization is "
"only allowed in named common blocks"
msgstr ""
-#: fortran/resolve.c:723
+#: fortran/resolve.c:734
#, no-c-format
msgid ""
"Derived type variable '%s' in COMMON at %L has neither the SEQUENCE nor the "
"BIND(C) attribute"
msgstr ""
-#: fortran/resolve.c:727
+#: fortran/resolve.c:738
#, no-c-format
msgid ""
"Derived type variable '%s' in COMMON at %L has an ultimate component that is "
"allocatable"
msgstr ""
-#: fortran/resolve.c:731
+#: fortran/resolve.c:742
#, no-c-format
msgid ""
"Derived type variable '%s' in COMMON at %L may not have default initializer"
msgstr ""
-#: fortran/resolve.c:761
+#: fortran/resolve.c:772
#, no-c-format
msgid "COMMON block '%s' at %L is used as PARAMETER at %L"
msgstr ""
-#: fortran/resolve.c:765
+#: fortran/resolve.c:776
#, no-c-format
msgid "COMMON block '%s' at %L is also an intrinsic procedure"
msgstr ""
-#: fortran/resolve.c:769
+#: fortran/resolve.c:780
#, no-c-format
msgid "Fortran 2003: COMMON block '%s' at %L that is also a function result"
msgstr ""
-#: fortran/resolve.c:774
+#: fortran/resolve.c:785
#, no-c-format
msgid "Fortran 2003: COMMON block '%s' at %L that is also a global procedure"
msgstr ""
-#: fortran/resolve.c:836
+#: fortran/resolve.c:847
#, no-c-format
msgid "Components of structure constructor '%s' at %L are PRIVATE"
msgstr ""
-#: fortran/resolve.c:858
+#: fortran/resolve.c:869
#, no-c-format
msgid ""
"The rank of the element in the derived type constructor at %L does not match "
"that of the component (%d/%d)"
msgstr ""
-#: fortran/resolve.c:871
+#: fortran/resolve.c:882
#, no-c-format
msgid ""
"The element in the derived type constructor at %L, for pointer component '%"
"s', is %s but should be %s"
msgstr ""
-#: fortran/resolve.c:885
+#: fortran/resolve.c:899
#, no-c-format
msgid ""
"The NULL in the derived type constructor at %L is being applied to component "
"'%s', which is neither a POINTER nor ALLOCATABLE"
msgstr ""
-#: fortran/resolve.c:899
+#: fortran/resolve.c:913
#, no-c-format
msgid ""
"The element in the derived type constructor at %L, for pointer component '%"
"s' should be a POINTER or a TARGET"
msgstr ""
-#: fortran/resolve.c:1020
+#: fortran/resolve.c:1034
#, no-c-format
msgid ""
"The upper bound in the last dimension must appear in the reference to the "
"assumed size array '%s' at %L"
msgstr ""
-#: fortran/resolve.c:1082
+#: fortran/resolve.c:1096
#, no-c-format
msgid "'%s' at %L is ambiguous"
msgstr ""
-#: fortran/resolve.c:1086
+#: fortran/resolve.c:1100
#, no-c-format
msgid "GENERIC procedure '%s' is not allowed as an actual argument at %L"
msgstr ""
-#: fortran/resolve.c:1197
+#: fortran/resolve.c:1199
+#, no-c-format
+msgid "Type specified for intrinsic function '%s' at %L is ignored"
+msgstr ""
+
+#: fortran/resolve.c:1212
+#, no-c-format
+msgid "Intrinsic subroutine '%s' at %L shall not have a type specifier"
+msgstr ""
+
+#: fortran/resolve.c:1223
+#, no-c-format
+msgid "'%s' declared INTRINSIC at %L does not exist"
+msgstr ""
+
+#: fortran/resolve.c:1234
+#, no-c-format
+msgid ""
+"The intrinsic '%s' declared INTRINSIC at %L is not available in the current "
+"standard settings but %s. Use an appropriate -std=* option or enable -fall-"
+"intrinsics in order to use it."
+msgstr ""
+
+#: fortran/resolve.c:1270
#, no-c-format
msgid ""
"Non-RECURSIVE procedure '%s' at %L is possibly calling itself recursively. "
"Declare it RECURSIVE or use -frecursive"
msgstr ""
-#: fortran/resolve.c:1231 fortran/resolve.c:6214 fortran/resolve.c:6954
+#: fortran/resolve.c:1304 fortran/resolve.c:6991 fortran/resolve.c:7778
#, no-c-format
msgid "Label %d referenced at %L is never defined"
msgstr ""
-#: fortran/resolve.c:1283
+#: fortran/resolve.c:1361
#, no-c-format
msgid "Statement function '%s' at %L is not allowed as an actual argument"
msgstr ""
-#: fortran/resolve.c:1291
+#: fortran/resolve.c:1369
#, no-c-format
msgid "Intrinsic '%s' at %L is not allowed as an actual argument"
msgstr ""
-#: fortran/resolve.c:1298
+#: fortran/resolve.c:1376
#, no-c-format
msgid "Internal procedure '%s' is not allowed as an actual argument at %L"
msgstr ""
-#: fortran/resolve.c:1304
+#: fortran/resolve.c:1382
#, no-c-format
msgid ""
"ELEMENTAL non-INTRINSIC procedure '%s' is not allowed as an actual argument "
"at %L"
msgstr ""
-#: fortran/resolve.c:1356
+#: fortran/resolve.c:1434
#, no-c-format
msgid "Symbol '%s' at %L is ambiguous"
msgstr ""
-#: fortran/resolve.c:1407
+#: fortran/resolve.c:1485
#, no-c-format
msgid "By-value argument at %L is not of numeric type"
msgstr ""
-#: fortran/resolve.c:1414
+#: fortran/resolve.c:1492
#, no-c-format
msgid "By-value argument at %L cannot be an array or an array section"
msgstr ""
-#: fortran/resolve.c:1428
+#: fortran/resolve.c:1506
#, no-c-format
msgid "By-value argument at %L is not allowed in this context"
msgstr ""
-#: fortran/resolve.c:1440
+#: fortran/resolve.c:1518
#, no-c-format
msgid "Passing internal procedure at %L by location not allowed"
msgstr ""
-#: fortran/resolve.c:1565
+#: fortran/resolve.c:1643
#, no-c-format
msgid ""
"'%s' at %L is an array and OPTIONAL; IF IT IS MISSING, it cannot be the "
@@ -9020,600 +9533,625 @@ msgid ""
"argument with the same rank (12.4.1.5)"
msgstr ""
-#: fortran/resolve.c:1587
+#: fortran/resolve.c:1666
msgid "elemental procedure"
msgstr ""
-#: fortran/resolve.c:1604
+#: fortran/resolve.c:1682
#, no-c-format
msgid ""
"Actual argument at %L for INTENT(%s) dummy '%s' of ELEMENTAL subroutine '%s' "
"is a scalar, but another actual argument is an array"
msgstr ""
-#: fortran/resolve.c:1773
+#: fortran/resolve.c:1828
+#, no-c-format
+msgid ""
+"The reference to function '%s' at %L either needs an explicit INTERFACE or "
+"the rank is incorrect"
+msgstr ""
+
+#: fortran/resolve.c:1928
#, no-c-format
msgid "There is no specific function for the generic '%s' at %L"
msgstr ""
-#: fortran/resolve.c:1782
+#: fortran/resolve.c:1937
#, no-c-format
msgid ""
"Generic function '%s' at %L is not consistent with a specific intrinsic "
"interface"
msgstr ""
-#: fortran/resolve.c:1820
+#: fortran/resolve.c:1975
#, no-c-format
msgid ""
"Function '%s' at %L is INTRINSIC but is not compatible with an intrinsic"
msgstr ""
-#: fortran/resolve.c:1866
+#: fortran/resolve.c:2024
#, no-c-format
msgid "Unable to resolve the specific function '%s' at %L"
msgstr ""
-#: fortran/resolve.c:1922 fortran/resolve.c:10672
+#: fortran/resolve.c:2080 fortran/resolve.c:11813
#, no-c-format
msgid "Function '%s' at %L has no IMPLICIT type"
msgstr ""
-#: fortran/resolve.c:2131
+#: fortran/resolve.c:2289
#, no-c-format
msgid "Argument to '%s' at %L is not a variable"
msgstr ""
-#: fortran/resolve.c:2179
+#: fortran/resolve.c:2337
#, no-c-format
msgid "More actual than formal arguments in '%s' call at %L"
msgstr ""
-#: fortran/resolve.c:2188
+#: fortran/resolve.c:2346
#, no-c-format
msgid ""
"Parameter '%s' to '%s' at %L must be either a TARGET or an associated pointer"
msgstr ""
-#: fortran/resolve.c:2211
+#: fortran/resolve.c:2369
#, no-c-format
msgid ""
"Allocatable variable '%s' used as a parameter to '%s' at %L must not be an "
"array of zero size"
msgstr ""
-#: fortran/resolve.c:2228
+#: fortran/resolve.c:2386
#, no-c-format
msgid ""
"Assumed-shape array '%s' at %L cannot be an argument to the procedure '%s' "
"because it is not C interoperable"
msgstr ""
-#: fortran/resolve.c:2238
+#: fortran/resolve.c:2396
#, no-c-format
msgid ""
"Deferred-shape array '%s' at %L cannot be an argument to the procedure '%s' "
"because it is not C interoperable"
msgstr ""
-#: fortran/resolve.c:2261 fortran/resolve.c:2298
+#: fortran/resolve.c:2419 fortran/resolve.c:2456
#, no-c-format
msgid "CHARACTER argument '%s' to '%s' at %L must have a length of 1"
msgstr ""
#. Case 1c, section 15.1.2.5, J3/04-007: an associated
#. scalar pointer.
-#: fortran/resolve.c:2274
+#: fortran/resolve.c:2432
#, no-c-format
msgid "Argument '%s' to '%s' at %L must be an associated scalar POINTER"
msgstr ""
-#: fortran/resolve.c:2290
+#: fortran/resolve.c:2448
#, no-c-format
msgid "Parameter '%s' to '%s' at %L must be a scalar"
msgstr ""
#. TODO: Update this error message to allow for procedure
#. pointers once they are implemented.
-#: fortran/resolve.c:2312
+#: fortran/resolve.c:2470
#, no-c-format
msgid "Parameter '%s' to '%s' at %L must be a procedure"
msgstr ""
-#: fortran/resolve.c:2320
+#: fortran/resolve.c:2478
#, no-c-format
msgid "Parameter '%s' to '%s' at %L must be BIND(C)"
msgstr ""
-#: fortran/resolve.c:2367
+#: fortran/resolve.c:2525
#, no-c-format
msgid "'%s' at %L is not a function"
msgstr ""
-#: fortran/resolve.c:2373
+#: fortran/resolve.c:2531
#, no-c-format
msgid "ABSTRACT INTERFACE '%s' must not be referenced at %L"
msgstr ""
#. Internal procedures are taken care of in resolve_contained_fntype.
-#: fortran/resolve.c:2419
+#: fortran/resolve.c:2577
#, no-c-format
msgid ""
"Function '%s' is declared CHARACTER(*) and cannot be used at %L since it is "
"not a dummy argument"
msgstr ""
-#: fortran/resolve.c:2472
+#: fortran/resolve.c:2630
#, no-c-format
msgid ""
"User defined non-ELEMENTAL function '%s' at %L not allowed in WORKSHARE "
"construct"
msgstr ""
-#: fortran/resolve.c:2522
+#: fortran/resolve.c:2680
#, no-c-format
msgid "reference to non-PURE function '%s' at %L inside a FORALL %s"
msgstr ""
-#: fortran/resolve.c:2529
+#: fortran/resolve.c:2687
#, no-c-format
msgid ""
"Function reference to '%s' at %L is to a non-PURE procedure within a PURE "
"procedure"
msgstr ""
-#: fortran/resolve.c:2545
+#: fortran/resolve.c:2703
#, no-c-format
msgid ""
"ENTRY '%s' at %L cannot be called recursively, as function '%s' is not "
"RECURSIVE"
msgstr ""
-#: fortran/resolve.c:2549
+#: fortran/resolve.c:2707
#, no-c-format
msgid ""
"Function '%s' at %L cannot be called recursively, as it is not RECURSIVE"
msgstr ""
-#: fortran/resolve.c:2597
+#: fortran/resolve.c:2755
#, no-c-format
msgid "Subroutine call to '%s' in FORALL block at %L is not PURE"
msgstr ""
-#: fortran/resolve.c:2600
+#: fortran/resolve.c:2758
#, no-c-format
msgid "Subroutine call to '%s' at %L is not PURE"
msgstr ""
-#: fortran/resolve.c:2663
+#: fortran/resolve.c:2821
#, no-c-format
msgid "There is no specific subroutine for the generic '%s' at %L"
msgstr ""
-#: fortran/resolve.c:2672
+#: fortran/resolve.c:2830
#, no-c-format
msgid ""
"Generic subroutine '%s' at %L is not consistent with an intrinsic subroutine "
"interface"
msgstr ""
-#: fortran/resolve.c:2780
+#: fortran/resolve.c:2938
#, no-c-format
msgid "Missing SHAPE parameter for call to %s at %L"
msgstr ""
-#: fortran/resolve.c:2788
+#: fortran/resolve.c:2946
#, no-c-format
msgid "SHAPE parameter for call to %s at %L must be a rank 1 INTEGER array"
msgstr ""
-#: fortran/resolve.c:2855
+#: fortran/resolve.c:3013
#, no-c-format
msgid ""
"Subroutine '%s' at %L is INTRINSIC but is not compatible with an intrinsic"
msgstr ""
-#: fortran/resolve.c:2899
+#: fortran/resolve.c:3057
#, no-c-format
msgid "Unable to resolve the specific subroutine '%s' at %L"
msgstr ""
-#: fortran/resolve.c:2959
+#: fortran/resolve.c:3117
#, no-c-format
msgid "'%s' at %L has a type, which is not consistent with the CALL at %L"
msgstr ""
-#: fortran/resolve.c:2988
+#: fortran/resolve.c:3146
#, no-c-format
msgid ""
"ENTRY '%s' at %L cannot be called recursively, as subroutine '%s' is not "
"RECURSIVE"
msgstr ""
-#: fortran/resolve.c:2992
+#: fortran/resolve.c:3150
#, no-c-format
msgid ""
"SUBROUTINE '%s' at %L cannot be called recursively, as it is not RECURSIVE"
msgstr ""
-#: fortran/resolve.c:3070
+#: fortran/resolve.c:3228
#, no-c-format
msgid "Shapes for operands at %L and %L are not conformable"
msgstr ""
-#: fortran/resolve.c:3121
+#: fortran/resolve.c:3279
#, c-format
msgid "Invalid context for NULL() pointer at %%L"
msgstr ""
-#: fortran/resolve.c:3137
+#: fortran/resolve.c:3295
#, c-format
msgid "Operand of unary numeric operator '%s' at %%L is %s"
msgstr ""
-#: fortran/resolve.c:3153
+#: fortran/resolve.c:3311
#, c-format
msgid "Operands of binary numeric operator '%s' at %%L are %s/%s"
msgstr ""
-#: fortran/resolve.c:3168
+#: fortran/resolve.c:3326
#, c-format
msgid "Operands of string concatenation operator at %%L are %s/%s"
msgstr ""
-#: fortran/resolve.c:3187
+#: fortran/resolve.c:3345
#, c-format
msgid "Operands of logical operator '%s' at %%L are %s/%s"
msgstr ""
-#: fortran/resolve.c:3201
+#: fortran/resolve.c:3359
#, c-format
msgid "Operand of .not. operator at %%L is %s"
msgstr ""
-#: fortran/resolve.c:3215
+#: fortran/resolve.c:3373
msgid "COMPLEX quantities cannot be compared at %L"
msgstr ""
-#: fortran/resolve.c:3244
+#: fortran/resolve.c:3402
#, c-format
msgid "Logicals at %%L must be compared with %s instead of %s"
msgstr ""
-#: fortran/resolve.c:3250
+#: fortran/resolve.c:3408
#, c-format
msgid "Operands of comparison operator '%s' at %%L are %s/%s"
msgstr ""
-#: fortran/resolve.c:3258
+#: fortran/resolve.c:3416
#, c-format
msgid "Unknown operator '%s' at %%L"
msgstr ""
-#: fortran/resolve.c:3260
+#: fortran/resolve.c:3418
#, c-format
msgid "Operand of user operator '%s' at %%L is %s"
msgstr ""
-#: fortran/resolve.c:3263
+#: fortran/resolve.c:3421
#, c-format
msgid "Operands of user operator '%s' at %%L are %s/%s"
msgstr ""
-#: fortran/resolve.c:3349
+#: fortran/resolve.c:3507
#, c-format
msgid "Inconsistent ranks for operator at %%L and %%L"
msgstr ""
-#: fortran/resolve.c:3546
+#: fortran/resolve.c:3710
#, no-c-format
msgid "Array reference at %L is out of bounds (%ld < %ld) in dimension %d"
msgstr ""
-#: fortran/resolve.c:3554
+#: fortran/resolve.c:3718
#, no-c-format
msgid "Array reference at %L is out of bounds (%ld > %ld) in dimension %d"
msgstr ""
-#: fortran/resolve.c:3573
+#: fortran/resolve.c:3737
#, no-c-format
msgid "Illegal stride of zero at %L"
msgstr ""
-#: fortran/resolve.c:3590
+#: fortran/resolve.c:3754
#, no-c-format
msgid ""
"Lower array reference at %L is out of bounds (%ld < %ld) in dimension %d"
msgstr ""
-#: fortran/resolve.c:3598
+#: fortran/resolve.c:3762
#, no-c-format
msgid ""
"Lower array reference at %L is out of bounds (%ld > %ld) in dimension %d"
msgstr ""
-#: fortran/resolve.c:3614
+#: fortran/resolve.c:3778
#, no-c-format
msgid ""
"Upper array reference at %L is out of bounds (%ld < %ld) in dimension %d"
msgstr ""
-#: fortran/resolve.c:3623
+#: fortran/resolve.c:3787
#, no-c-format
msgid ""
"Upper array reference at %L is out of bounds (%ld > %ld) in dimension %d"
msgstr ""
-#: fortran/resolve.c:3662
+#: fortran/resolve.c:3826
#, no-c-format
msgid "Rightmost upper bound of assumed size array section not specified at %L"
msgstr ""
-#: fortran/resolve.c:3672
+#: fortran/resolve.c:3836
#, no-c-format
msgid "Rank mismatch in array reference at %L (%d/%d)"
msgstr ""
-#: fortran/resolve.c:3700
+#: fortran/resolve.c:3864
#, no-c-format
msgid "Array index at %L must be scalar"
msgstr ""
-#: fortran/resolve.c:3706
+#: fortran/resolve.c:3870
#, no-c-format
msgid "Array index at %L must be of INTEGER type, found %s"
msgstr ""
-#: fortran/resolve.c:3712
+#: fortran/resolve.c:3876
#, no-c-format
msgid "Extension: REAL array index at %L"
msgstr ""
-#: fortran/resolve.c:3742
+#: fortran/resolve.c:3906
#, no-c-format
msgid "Argument dim at %L must be scalar"
msgstr ""
-#: fortran/resolve.c:3749
+#: fortran/resolve.c:3913
#, no-c-format
msgid "Argument dim at %L must be of INTEGER type"
msgstr ""
-#: fortran/resolve.c:3870
+#: fortran/resolve.c:4037
#, no-c-format
msgid "Array index at %L is an array of rank %d"
msgstr ""
-#: fortran/resolve.c:3907
+#: fortran/resolve.c:4076
#, no-c-format
msgid "Substring start index at %L must be of type INTEGER"
msgstr ""
-#: fortran/resolve.c:3914
+#: fortran/resolve.c:4083
#, no-c-format
msgid "Substring start index at %L must be scalar"
msgstr ""
-#: fortran/resolve.c:3923
+#: fortran/resolve.c:4092
#, no-c-format
msgid "Substring start index at %L is less than one"
msgstr ""
-#: fortran/resolve.c:3936
+#: fortran/resolve.c:4105
#, no-c-format
msgid "Substring end index at %L must be of type INTEGER"
msgstr ""
-#: fortran/resolve.c:3943
+#: fortran/resolve.c:4112
#, no-c-format
msgid "Substring end index at %L must be scalar"
msgstr ""
-#: fortran/resolve.c:3953
+#: fortran/resolve.c:4122
#, no-c-format
msgid "Substring end index at %L exceeds the string length"
msgstr ""
-#: fortran/resolve.c:4091
+#: fortran/resolve.c:4132
+#, no-c-format
+msgid "Substring end index at %L is too large"
+msgstr ""
+
+#: fortran/resolve.c:4266
#, no-c-format
msgid ""
"Component to the right of a part reference with nonzero rank must not have "
"the POINTER attribute at %L"
msgstr ""
-#: fortran/resolve.c:4098
+#: fortran/resolve.c:4273
#, no-c-format
msgid ""
"Component to the right of a part reference with nonzero rank must not have "
"the ALLOCATABLE attribute at %L"
msgstr ""
-#: fortran/resolve.c:4117
+#: fortran/resolve.c:4292
#, no-c-format
msgid ""
"Two or more part references with nonzero rank must not be specified at %L"
msgstr ""
-#: fortran/resolve.c:4300
+#: fortran/resolve.c:4475
#, no-c-format
msgid ""
"Variable '%s', used in a specification expression, is referenced at %L "
"before the ENTRY statement in which it is a parameter"
msgstr ""
-#: fortran/resolve.c:4305
+#: fortran/resolve.c:4480
#, no-c-format
msgid ""
"Variable '%s' is used at %L before the ENTRY statement in which it is a "
"parameter"
msgstr ""
-#: fortran/resolve.c:4589
+#: fortran/resolve.c:4767 fortran/resolve.c:4839
#, no-c-format
msgid "Passed-object at %L must be scalar"
msgstr ""
-#: fortran/resolve.c:4622
+#: fortran/resolve.c:4868
#, no-c-format
msgid ""
"Base object for type-bound procedure call at %L is of ABSTRACT type '%s'"
msgstr ""
#. Nothing matching found!
-#: fortran/resolve.c:4723
+#: fortran/resolve.c:4970
#, no-c-format
msgid ""
"Found no matching specific binding for the call to the GENERIC '%s' at %L"
msgstr ""
-#: fortran/resolve.c:4743
+#. To resolve class member calls, we borrow this bit
+#. of code to select the specific procedures.
+#: fortran/resolve.c:4990 fortran/resolve.c:5043
#, no-c-format
msgid "'%s' at %L should be a SUBROUTINE"
msgstr ""
-#: fortran/resolve.c:4782
+#: fortran/resolve.c:5035
#, no-c-format
msgid "'%s' at %L should be a FUNCTION"
msgstr ""
-#: fortran/resolve.c:4980
+#: fortran/resolve.c:5119
+#, no-c-format
+msgid "no typebound available procedure named '%s' at %L"
+msgstr ""
+
+#: fortran/resolve.c:5568
#, no-c-format
msgid "%s at %L must be a scalar"
msgstr ""
-#: fortran/resolve.c:4990
+#: fortran/resolve.c:5578
#, no-c-format
msgid "Deleted feature: %s at %L must be integer"
msgstr ""
-#: fortran/resolve.c:4994 fortran/resolve.c:5001
+#: fortran/resolve.c:5582 fortran/resolve.c:5589
#, no-c-format
msgid "%s at %L must be INTEGER"
msgstr ""
-#: fortran/resolve.c:5021
+#: fortran/resolve.c:5609
#, no-c-format
msgid "Cannot assign to loop variable in PURE procedure at %L"
msgstr ""
-#: fortran/resolve.c:5045
+#: fortran/resolve.c:5633
#, no-c-format
msgid "Step expression in DO loop at %L cannot be zero"
msgstr ""
-#: fortran/resolve.c:5080
+#: fortran/resolve.c:5668
#, no-c-format
msgid "DO loop at %L will be executed zero times"
msgstr ""
-#: fortran/resolve.c:5141
+#: fortran/resolve.c:5729
#, no-c-format
msgid "FORALL index-name at %L must be a scalar INTEGER"
msgstr ""
-#: fortran/resolve.c:5146
+#: fortran/resolve.c:5734
#, no-c-format
msgid "FORALL start expression at %L must be a scalar INTEGER"
msgstr ""
-#: fortran/resolve.c:5153
+#: fortran/resolve.c:5741
#, no-c-format
msgid "FORALL end expression at %L must be a scalar INTEGER"
msgstr ""
-#: fortran/resolve.c:5161
+#: fortran/resolve.c:5749
#, no-c-format
msgid "FORALL stride expression at %L must be a scalar %s"
msgstr ""
-#: fortran/resolve.c:5166
+#: fortran/resolve.c:5754
#, no-c-format
msgid "FORALL stride expression at %L cannot be zero"
msgstr ""
-#: fortran/resolve.c:5182
+#: fortran/resolve.c:5770
#, no-c-format
msgid "FORALL index '%s' may not appear in triplet specification at %L"
msgstr ""
-#: fortran/resolve.c:5262 fortran/resolve.c:5396
+#: fortran/resolve.c:5870 fortran/resolve.c:6033
#, no-c-format
msgid "Allocate-object at %L must be ALLOCATABLE or a POINTER"
msgstr ""
-#: fortran/resolve.c:5269
+#: fortran/resolve.c:5876
#, no-c-format
msgid "Cannot deallocate INTENT(IN) variable '%s' at %L"
msgstr ""
-#: fortran/resolve.c:5404
+#: fortran/resolve.c:6041
+#, no-c-format
+msgid ""
+"Allocating %s of ABSTRACT base type at %L requires a type-spec or SOURCE="
+msgstr ""
+
+#: fortran/resolve.c:6048
#, no-c-format
msgid "Cannot allocate INTENT(IN) variable '%s' at %L"
msgstr ""
-#: fortran/resolve.c:5428
+#: fortran/resolve.c:6060
#, no-c-format
msgid "Array specification required in ALLOCATE statement at %L"
msgstr ""
-#: fortran/resolve.c:5458
+#: fortran/resolve.c:6090
#, no-c-format
msgid "Bad array specification in ALLOCATE statement at %L"
msgstr ""
-#: fortran/resolve.c:5478
+#: fortran/resolve.c:6110
#, no-c-format
msgid ""
"'%s' must not appear in the array specification at %L in the same ALLOCATE "
"statement where it is itself allocated"
msgstr ""
-#: fortran/resolve.c:5503
+#: fortran/resolve.c:6135
#, no-c-format
msgid "Stat-variable '%s' at %L cannot be INTENT(IN)"
msgstr ""
-#: fortran/resolve.c:5507
+#: fortran/resolve.c:6139
#, no-c-format
msgid "Illegal stat-variable at %L for a PURE procedure"
msgstr ""
-#: fortran/resolve.c:5513
+#: fortran/resolve.c:6146
#, no-c-format
msgid "Stat-variable at %L must be a scalar INTEGER variable"
msgstr ""
-#: fortran/resolve.c:5518
+#: fortran/resolve.c:6151
#, no-c-format
msgid "Stat-variable at %L shall not be %sd within the same %s statement"
msgstr ""
-#: fortran/resolve.c:5526
+#: fortran/resolve.c:6159
#, no-c-format
msgid "ERRMSG at %L is useless without a STAT tag"
msgstr ""
-#: fortran/resolve.c:5530
+#: fortran/resolve.c:6163
#, no-c-format
msgid "Errmsg-variable '%s' at %L cannot be INTENT(IN)"
msgstr ""
-#: fortran/resolve.c:5534
+#: fortran/resolve.c:6167
#, no-c-format
msgid "Illegal errmsg-variable at %L for a PURE procedure"
msgstr ""
-#: fortran/resolve.c:5541
+#: fortran/resolve.c:6175
#, no-c-format
msgid "Errmsg-variable at %L must be a scalar CHARACTER variable"
msgstr ""
-#: fortran/resolve.c:5546
+#: fortran/resolve.c:6180
#, no-c-format
msgid "Errmsg-variable at %L shall not be %sd within the same %s statement"
msgstr ""
-#: fortran/resolve.c:5564
+#: fortran/resolve.c:6198
#, no-c-format
msgid "Allocate-object at %L also appears at %L"
msgstr ""
@@ -9622,99 +10160,109 @@ msgstr ""
#. element in the list. Either way, we must
#. issue an error and get the next case from P.
#. FIXME: Sort P and Q by line number.
-#: fortran/resolve.c:5731
+#: fortran/resolve.c:6365
#, no-c-format
msgid "CASE label at %L overlaps with CASE label at %L"
msgstr ""
-#: fortran/resolve.c:5782
+#: fortran/resolve.c:6416
#, no-c-format
msgid "Expression in CASE statement at %L must be of type %s"
msgstr ""
-#: fortran/resolve.c:5793
+#: fortran/resolve.c:6427
#, no-c-format
msgid "Expression in CASE statement at %L must be of kind %d"
msgstr ""
-#: fortran/resolve.c:5805
+#: fortran/resolve.c:6439
#, no-c-format
msgid "Expression in CASE statement at %L must be scalar"
msgstr ""
-#: fortran/resolve.c:5851
+#: fortran/resolve.c:6485
#, no-c-format
msgid ""
"Selection expression in computed GOTO statement at %L must be a scalar "
"integer expression"
msgstr ""
-#: fortran/resolve.c:5869
+#: fortran/resolve.c:6503
#, no-c-format
msgid "Argument of SELECT statement at %L cannot be %s"
msgstr ""
-#: fortran/resolve.c:5878
+#: fortran/resolve.c:6512
#, no-c-format
msgid "Argument of SELECT statement at %L must be a scalar expression"
msgstr ""
-#: fortran/resolve.c:5943
+#: fortran/resolve.c:6577 fortran/resolve.c:6797
#, no-c-format
msgid ""
"The DEFAULT CASE at %L cannot be followed by a second DEFAULT CASE at %L"
msgstr ""
-#: fortran/resolve.c:5969
+#: fortran/resolve.c:6603
#, no-c-format
msgid "Logical range in CASE statement at %L is not allowed"
msgstr ""
-#: fortran/resolve.c:5981
+#: fortran/resolve.c:6615
#, no-c-format
msgid "constant logical value in CASE statement is repeated at %L"
msgstr ""
-#: fortran/resolve.c:5995
+#: fortran/resolve.c:6629
#, no-c-format
msgid "Range specification at %L can never be matched"
msgstr ""
-#: fortran/resolve.c:6098
+#: fortran/resolve.c:6732
#, no-c-format
msgid "Logical SELECT CASE block at %L has more that two cases"
msgstr ""
-#: fortran/resolve.c:6136
+#: fortran/resolve.c:6778
+#, no-c-format
+msgid "Derived type '%s' at %L must be extensible"
+msgstr ""
+
+#: fortran/resolve.c:6787
+#, no-c-format
+msgid "Derived type '%s' at %L must be an extension of '%s'"
+msgstr ""
+
+#: fortran/resolve.c:6913
#, no-c-format
msgid "Data transfer element at %L cannot have POINTER components"
msgstr ""
-#: fortran/resolve.c:6143
+#: fortran/resolve.c:6920
#, no-c-format
msgid "Data transfer element at %L cannot have ALLOCATABLE components"
msgstr ""
-#: fortran/resolve.c:6150
+#: fortran/resolve.c:6927
#, no-c-format
msgid "Data transfer element at %L cannot have PRIVATE components"
msgstr ""
-#: fortran/resolve.c:6159
+#: fortran/resolve.c:6936
#, no-c-format
msgid ""
"Data transfer element at %L cannot be a full reference to an assumed-size "
"array"
msgstr ""
-#: fortran/resolve.c:6221
+#: fortran/resolve.c:6998
#, no-c-format
msgid ""
"Statement at %L is not a valid branch target statement for the branch "
"statement at %L"
msgstr ""
-#: fortran/resolve.c:6230
+#: fortran/resolve.c:7007
#, no-c-format
msgid "Branch at %L may result in an infinite loop"
msgstr ""
@@ -9722,113 +10270,113 @@ msgstr ""
#. The label is not in an enclosing block, so illegal. This was
#. allowed in Fortran 66, so we allow it as extension. No
#. further checks are necessary in this case.
-#: fortran/resolve.c:6258
+#: fortran/resolve.c:7035
#, no-c-format
msgid "Label at %L is not in the same block as the GOTO statement at %L"
msgstr ""
-#: fortran/resolve.c:6333
+#: fortran/resolve.c:7110
#, no-c-format
msgid "WHERE mask at %L has inconsistent shape"
msgstr ""
-#: fortran/resolve.c:6349
+#: fortran/resolve.c:7126
#, no-c-format
msgid "WHERE assignment target at %L has inconsistent shape"
msgstr ""
-#: fortran/resolve.c:6357 fortran/resolve.c:6444
+#: fortran/resolve.c:7134 fortran/resolve.c:7221
#, no-c-format
msgid "Non-ELEMENTAL user-defined assignment in WHERE at %L"
msgstr ""
-#: fortran/resolve.c:6367 fortran/resolve.c:6454
+#: fortran/resolve.c:7144 fortran/resolve.c:7231
#, no-c-format
msgid "Unsupported statement inside WHERE at %L"
msgstr ""
-#: fortran/resolve.c:6398
+#: fortran/resolve.c:7175
#, no-c-format
msgid "Assignment to a FORALL index variable at %L"
msgstr ""
-#: fortran/resolve.c:6407
+#: fortran/resolve.c:7184
#, no-c-format
msgid ""
"The FORALL with index '%s' is not used on the left side of the assignment at "
"%L and so might cause multiple assignment to this object"
msgstr ""
-#: fortran/resolve.c:6576
+#: fortran/resolve.c:7353
#, no-c-format
msgid "An outer FORALL construct already has an index with this name %L"
msgstr ""
-#: fortran/resolve.c:6643
+#: fortran/resolve.c:7432
#, no-c-format
msgid "WHERE/ELSEWHERE clause at %L requires a LOGICAL array"
msgstr ""
-#: fortran/resolve.c:6705
-#, no-c-format
-msgid "Subroutine '%s' called instead of assignment at %L must be PURE"
-msgstr ""
-
-#: fortran/resolve.c:6778
+#: fortran/resolve.c:7587
#, no-c-format
msgid "CHARACTER expression will be truncated in assignment (%d/%d) at %L"
msgstr ""
-#: fortran/resolve.c:6803
+#: fortran/resolve.c:7612
#, no-c-format
msgid "Cannot assign to variable '%s' in PURE procedure at %L"
msgstr ""
-#: fortran/resolve.c:6815
+#: fortran/resolve.c:7624
#, no-c-format
msgid ""
"The impure variable at %L is assigned to a derived type variable with a "
"POINTER component in a PURE procedure (12.6)"
msgstr ""
-#: fortran/resolve.c:6922
+#: fortran/resolve.c:7635
+#, no-c-format
+msgid "Variable must not be polymorphic in assignment at %L"
+msgstr ""
+
+#: fortran/resolve.c:7741
#, no-c-format
msgid "ASSIGNED GOTO statement at %L requires an INTEGER variable"
msgstr ""
-#: fortran/resolve.c:6925
+#: fortran/resolve.c:7744
#, no-c-format
msgid "Variable '%s' has not been assigned a target label at %L"
msgstr ""
-#: fortran/resolve.c:6936
+#: fortran/resolve.c:7755
#, no-c-format
msgid ""
"Alternate RETURN statement at %L requires a SCALAR-INTEGER return specifier"
msgstr ""
-#: fortran/resolve.c:6962
+#: fortran/resolve.c:7786
#, no-c-format
msgid "ASSIGN statement at %L requires a scalar default INTEGER variable"
msgstr ""
-#: fortran/resolve.c:6977
+#: fortran/resolve.c:7801
#, no-c-format
msgid "Arithmetic IF statement at %L requires a numeric expression"
msgstr ""
-#: fortran/resolve.c:7027
+#: fortran/resolve.c:7864
#, no-c-format
msgid ""
"Exit condition of DO WHILE loop at %L must be a scalar LOGICAL expression"
msgstr ""
-#: fortran/resolve.c:7109
+#: fortran/resolve.c:7946
#, no-c-format
msgid "FORALL mask clause at %L requires a LOGICAL expression"
msgstr ""
-#: fortran/resolve.c:7181 fortran/resolve.c:7237
+#: fortran/resolve.c:8018 fortran/resolve.c:8074
#, no-c-format
msgid ""
"Binding label '%s' for common block '%s' at %L collides with the global "
@@ -9836,14 +10384,14 @@ msgid ""
msgstr ""
#. Common block names match but binding labels do not.
-#: fortran/resolve.c:7202
+#: fortran/resolve.c:8039
#, no-c-format
msgid ""
"Binding label '%s' for common block '%s' at %L does not match the binding "
"label '%s' for common block '%s' at %L"
msgstr ""
-#: fortran/resolve.c:7249
+#: fortran/resolve.c:8086
#, no-c-format
msgid ""
"Binding label '%s' for common block '%s' at %L collides with global entity '%"
@@ -9851,255 +10399,270 @@ msgid ""
msgstr ""
#. Make sure global procedures don't collide with anything.
-#: fortran/resolve.c:7301
+#: fortran/resolve.c:8138
#, no-c-format
msgid "Binding label '%s' at %L collides with the global entity '%s' at %L"
msgstr ""
#. Make sure procedures in interface bodies don't collide.
-#: fortran/resolve.c:7314
+#: fortran/resolve.c:8151
#, no-c-format
msgid ""
"Binding label '%s' in interface body at %L collides with the global entity '%"
"s' at %L"
msgstr ""
-#: fortran/resolve.c:7327
+#: fortran/resolve.c:8164
#, no-c-format
msgid "Binding label '%s' at %L collides with global entity '%s' at %L"
msgstr ""
-#: fortran/resolve.c:7404
+#: fortran/resolve.c:8241
#, no-c-format
msgid "CHARACTER variable has zero length at %L"
msgstr ""
-#: fortran/resolve.c:7697
+#: fortran/resolve.c:8252
+#, no-c-format
+msgid "String length at %L is too large"
+msgstr ""
+
+#: fortran/resolve.c:8553
#, no-c-format
msgid "Allocatable array '%s' at %L must have a deferred shape"
msgstr ""
-#: fortran/resolve.c:7700
+#: fortran/resolve.c:8557
#, no-c-format
msgid "Scalar object '%s' at %L may not be ALLOCATABLE"
msgstr ""
-#: fortran/resolve.c:7707
+#: fortran/resolve.c:8565
#, no-c-format
msgid "Array pointer '%s' at %L must have a deferred shape"
msgstr ""
-#: fortran/resolve.c:7718
+#: fortran/resolve.c:8576
#, no-c-format
msgid "Array '%s' at %L cannot have a deferred shape"
msgstr ""
-#: fortran/resolve.c:7746
+#: fortran/resolve.c:8604
#, no-c-format
msgid ""
"The type '%s' cannot be host associated at %L because it is blocked by an "
"incompatible object of the same name declared at %L"
msgstr ""
-#: fortran/resolve.c:7769
+#: fortran/resolve.c:8627
#, no-c-format
msgid ""
"Object '%s' at %L must have the SAVE attribute for default initialization of "
"a component"
msgstr ""
+#: fortran/resolve.c:8638
+#, no-c-format
+msgid "Type '%s' of CLASS variable '%s' at %L is not extensible"
+msgstr ""
+
+#: fortran/resolve.c:8648
+#, no-c-format
+msgid "CLASS variable '%s' at %L must be dummy, allocatable or pointer"
+msgstr ""
+
#. The shape of a main program or module array needs to be
#. constant.
-#: fortran/resolve.c:7816
+#: fortran/resolve.c:8695
#, no-c-format
msgid "The module or main program array '%s' at %L must have constant shape"
msgstr ""
-#: fortran/resolve.c:7829
+#: fortran/resolve.c:8708
#, no-c-format
msgid ""
"Entity with assumed character length at %L must be a dummy argument or a "
"PARAMETER"
msgstr ""
-#: fortran/resolve.c:7848
+#: fortran/resolve.c:8727
#, no-c-format
msgid "'%s' at %L must have constant character length in this context"
msgstr ""
-#: fortran/resolve.c:7884
+#: fortran/resolve.c:8763
#, no-c-format
msgid "Allocatable '%s' at %L cannot have an initializer"
msgstr ""
-#: fortran/resolve.c:7887
+#: fortran/resolve.c:8766
#, no-c-format
msgid "External '%s' at %L cannot have an initializer"
msgstr ""
-#: fortran/resolve.c:7891
+#: fortran/resolve.c:8770
#, no-c-format
msgid "Dummy '%s' at %L cannot have an initializer"
msgstr ""
-#: fortran/resolve.c:7894
+#: fortran/resolve.c:8773
#, no-c-format
msgid "Intrinsic '%s' at %L cannot have an initializer"
msgstr ""
-#: fortran/resolve.c:7897
+#: fortran/resolve.c:8776
#, no-c-format
msgid "Function result '%s' at %L cannot have an initializer"
msgstr ""
-#: fortran/resolve.c:7900
+#: fortran/resolve.c:8779
#, no-c-format
msgid "Automatic array '%s' at %L cannot have an initializer"
msgstr ""
-#: fortran/resolve.c:7923
+#: fortran/resolve.c:8802
#, no-c-format
msgid "Although not referenced, '%s' at %L has ambiguous interfaces"
msgstr ""
-#: fortran/resolve.c:7942
+#: fortran/resolve.c:8821
#, no-c-format
msgid ""
"Character-valued statement function '%s' at %L must have constant length"
msgstr ""
-#: fortran/resolve.c:7950
+#: fortran/resolve.c:8829
#, no-c-format
msgid ""
"Automatic character length function '%s' at %L must have an explicit "
"interface"
msgstr ""
-#: fortran/resolve.c:7975
+#: fortran/resolve.c:8854
#, no-c-format
msgid ""
"Fortran 2003: '%s' is of a PRIVATE type and cannot be a dummy argument of '%"
"s', which is PUBLIC at %L"
msgstr ""
-#: fortran/resolve.c:7998 fortran/resolve.c:8023
+#: fortran/resolve.c:8877 fortran/resolve.c:8902
#, no-c-format
msgid ""
"Fortran 2003: Procedure '%s' in PUBLIC interface '%s' at %L takes dummy "
"arguments of '%s' which is PRIVATE"
msgstr ""
-#: fortran/resolve.c:8041
+#: fortran/resolve.c:8920
#, no-c-format
msgid "Function '%s' at %L cannot have an initializer"
msgstr ""
-#: fortran/resolve.c:8050
+#: fortran/resolve.c:8929
#, no-c-format
msgid "External object '%s' at %L may not have an initializer"
msgstr ""
-#: fortran/resolve.c:8058
+#: fortran/resolve.c:8937
#, no-c-format
msgid "ELEMENTAL function '%s' at %L must have a scalar result"
msgstr ""
-#: fortran/resolve.c:8079
+#: fortran/resolve.c:8958
#, no-c-format
msgid "CHARACTER(*) function '%s' at %L cannot be array-valued"
msgstr ""
-#: fortran/resolve.c:8083
+#: fortran/resolve.c:8962
#, no-c-format
msgid "CHARACTER(*) function '%s' at %L cannot be pointer-valued"
msgstr ""
-#: fortran/resolve.c:8087
+#: fortran/resolve.c:8966
#, no-c-format
msgid "CHARACTER(*) function '%s' at %L cannot be pure"
msgstr ""
-#: fortran/resolve.c:8091
+#: fortran/resolve.c:8970
#, no-c-format
msgid "CHARACTER(*) function '%s' at %L cannot be recursive"
msgstr ""
-#: fortran/resolve.c:8100
+#: fortran/resolve.c:8979
#, no-c-format
-msgid "CHARACTER(*) function '%s' at %L is obsolescent in fortran 95"
+msgid "Obsolescent feature: CHARACTER(*) function '%s' at %L"
msgstr ""
-#: fortran/resolve.c:8155
+#: fortran/resolve.c:9034
#, no-c-format
msgid "PROCEDURE attribute conflicts with SAVE attribute in '%s' at %L"
msgstr ""
-#: fortran/resolve.c:8161
+#: fortran/resolve.c:9040
#, no-c-format
msgid "PROCEDURE attribute conflicts with INTENT attribute in '%s' at %L"
msgstr ""
-#: fortran/resolve.c:8167
+#: fortran/resolve.c:9046
#, no-c-format
msgid "PROCEDURE attribute conflicts with RESULT attribute in '%s' at %L"
msgstr ""
-#: fortran/resolve.c:8175
+#: fortran/resolve.c:9054
#, no-c-format
msgid "EXTERNAL attribute conflicts with FUNCTION attribute in '%s' at %L"
msgstr ""
-#: fortran/resolve.c:8181
+#: fortran/resolve.c:9060
#, no-c-format
msgid "Procedure pointer result '%s' at %L is missing the pointer attribute"
msgstr ""
-#: fortran/resolve.c:8227
+#: fortran/resolve.c:9106
#, no-c-format
msgid "FINAL procedure '%s' at %L is not a SUBROUTINE"
msgstr ""
-#: fortran/resolve.c:8235
+#: fortran/resolve.c:9114
#, no-c-format
msgid "FINAL procedure at %L must have exactly one argument"
msgstr ""
-#: fortran/resolve.c:8244
+#: fortran/resolve.c:9123
#, no-c-format
msgid "Argument of FINAL procedure at %L must be of type '%s'"
msgstr ""
-#: fortran/resolve.c:8252
+#: fortran/resolve.c:9131
#, no-c-format
msgid "Argument of FINAL procedure at %L must not be a POINTER"
msgstr ""
-#: fortran/resolve.c:8258
+#: fortran/resolve.c:9137
#, no-c-format
msgid "Argument of FINAL procedure at %L must not be ALLOCATABLE"
msgstr ""
-#: fortran/resolve.c:8264
+#: fortran/resolve.c:9143
#, no-c-format
msgid "Argument of FINAL procedure at %L must not be OPTIONAL"
msgstr ""
-#: fortran/resolve.c:8272
+#: fortran/resolve.c:9151
#, no-c-format
msgid "Argument of FINAL procedure at %L must not be INTENT(OUT)"
msgstr ""
-#: fortran/resolve.c:8280
+#: fortran/resolve.c:9159
#, no-c-format
msgid "Non-scalar FINAL procedure at %L should have assumed shape argument"
msgstr ""
-#: fortran/resolve.c:8299
+#: fortran/resolve.c:9178
#, no-c-format
msgid "FINAL procedure '%s' declared at %L has the same rank (%d) as '%s'"
msgstr ""
-#: fortran/resolve.c:8332
+#: fortran/resolve.c:9211
#, no-c-format
msgid ""
"Only array FINAL procedures declared for derived type '%s' defined at %L, "
@@ -10107,819 +10670,854 @@ msgid ""
msgstr ""
#. TODO: Remove this error when finalization is finished.
-#: fortran/resolve.c:8337
+#: fortran/resolve.c:9216
#, no-c-format
msgid "Finalization at %L is not yet implemented"
msgstr ""
-#: fortran/resolve.c:8363
+#: fortran/resolve.c:9242
#, no-c-format
msgid "Can't overwrite GENERIC '%s' at %L"
msgstr ""
-#: fortran/resolve.c:8375
+#: fortran/resolve.c:9254
#, no-c-format
msgid "'%s' at %L overrides a procedure binding declared NON_OVERRIDABLE"
msgstr ""
-#: fortran/resolve.c:8383
+#: fortran/resolve.c:9262
#, no-c-format
msgid "'%s' at %L must not be DEFERRED as it overrides a non-DEFERRED binding"
msgstr ""
-#: fortran/resolve.c:8391
+#: fortran/resolve.c:9270
#, no-c-format
msgid "'%s' at %L overrides a PURE procedure and must also be PURE"
msgstr ""
-#: fortran/resolve.c:8400
+#: fortran/resolve.c:9279
#, no-c-format
msgid "'%s' at %L overrides an ELEMENTAL procedure and must also be ELEMENTAL"
msgstr ""
-#: fortran/resolve.c:8406
+#: fortran/resolve.c:9285
#, no-c-format
msgid ""
"'%s' at %L overrides a non-ELEMENTAL procedure and must not be ELEMENTAL, "
"either"
msgstr ""
-#: fortran/resolve.c:8415
+#: fortran/resolve.c:9294
#, no-c-format
msgid "'%s' at %L overrides a SUBROUTINE and must also be a SUBROUTINE"
msgstr ""
-#: fortran/resolve.c:8426
+#: fortran/resolve.c:9305
#, no-c-format
msgid "'%s' at %L overrides a FUNCTION and must also be a FUNCTION"
msgstr ""
-#: fortran/resolve.c:8437
+#: fortran/resolve.c:9316
#, no-c-format
msgid ""
"'%s' at %L and the overridden FUNCTION should have matching result types"
msgstr ""
-#: fortran/resolve.c:8448
+#: fortran/resolve.c:9327
#, no-c-format
msgid "'%s' at %L overrides a PUBLIC procedure and must not be PRIVATE"
msgstr ""
-#: fortran/resolve.c:8477
+#: fortran/resolve.c:9356
#, no-c-format
msgid ""
"Dummy argument '%s' of '%s' at %L should be named '%s' as to match the "
"corresponding argument of the overridden procedure"
msgstr ""
-#: fortran/resolve.c:8490
+#: fortran/resolve.c:9369
#, no-c-format
msgid ""
"Types mismatch for dummy argument '%s' of '%s' %L in in respect to the "
"overridden procedure"
msgstr ""
-#: fortran/resolve.c:8500
+#: fortran/resolve.c:9379
#, no-c-format
msgid ""
"'%s' at %L must have the same number of formal arguments as the overridden "
"procedure"
msgstr ""
-#: fortran/resolve.c:8509
+#: fortran/resolve.c:9388
#, no-c-format
msgid "'%s' at %L overrides a NOPASS binding and must also be NOPASS"
msgstr ""
-#: fortran/resolve.c:8520
+#: fortran/resolve.c:9399
#, no-c-format
msgid "'%s' at %L overrides a binding with PASS and must also be PASS"
msgstr ""
-#: fortran/resolve.c:8527
+#: fortran/resolve.c:9406
#, no-c-format
msgid ""
"Passed-object dummy argument of '%s' at %L must be at the same position as "
"the passed-object dummy argument of the overridden procedure"
msgstr ""
-#: fortran/resolve.c:8558
+#: fortran/resolve.c:9440
#, no-c-format
msgid "'%s' and '%s' can't be mixed FUNCTION/SUBROUTINE for GENERIC '%s' at %L"
msgstr ""
-#: fortran/resolve.c:8567
+#: fortran/resolve.c:9449
#, no-c-format
msgid "'%s' and '%s' for GENERIC '%s' at %L are ambiguous"
msgstr ""
-#: fortran/resolve.c:8636
+#: fortran/resolve.c:9508
#, no-c-format
msgid "Undefined specific binding '%s' as target of GENERIC '%s' at %L"
msgstr ""
-#: fortran/resolve.c:8648
+#: fortran/resolve.c:9520
#, no-c-format
msgid "GENERIC '%s' at %L must target a specific binding, '%s' is GENERIC, too"
msgstr ""
-#: fortran/resolve.c:8678
+#: fortran/resolve.c:9550
#, no-c-format
msgid "GENERIC '%s' at %L can't overwrite specific binding with the same name"
msgstr ""
-#: fortran/resolve.c:8742
+#: fortran/resolve.c:9606
+#, no-c-format
+msgid "Type-bound operator at %L can't be NOPASS"
+msgstr ""
+
+#: fortran/resolve.c:9769
#, no-c-format
msgid ""
"'%s' must be a module procedure or an external procedure with an explicit "
"interface at %L"
msgstr ""
-#: fortran/resolve.c:8779
+#: fortran/resolve.c:9806
#, no-c-format
msgid "Procedure '%s' with PASS(%s) at %L has no argument '%s'"
msgstr ""
-#: fortran/resolve.c:8793
+#: fortran/resolve.c:9820
#, no-c-format
msgid "Procedure '%s' with PASS at %L must have at least one argument"
msgstr ""
-#: fortran/resolve.c:8805
+#: fortran/resolve.c:9831 fortran/resolve.c:10199
#, no-c-format
-msgid ""
-"Argument '%s' of '%s' with PASS(%s) at %L must be of the derived-type '%s'"
+msgid "Non-polymorphic passed-object dummy argument of '%s' at %L"
msgstr ""
-#: fortran/resolve.c:8811
+#: fortran/resolve.c:9839
#, no-c-format
msgid ""
-"Polymorphic entities are not yet implemented, non-polymorphic passed-object "
-"dummy argument of '%s' at %L accepted"
+"Argument '%s' of '%s' with PASS(%s) at %L must be of the derived-type '%s'"
msgstr ""
-#: fortran/resolve.c:8836
+#: fortran/resolve.c:9867
#, no-c-format
msgid "Procedure '%s' at %L has the same name as a component of '%s'"
msgstr ""
-#: fortran/resolve.c:8845
+#: fortran/resolve.c:9876
#, no-c-format
msgid ""
"Procedure '%s' at %L has the same name as an inherited component of '%s'"
msgstr ""
-#: fortran/resolve.c:8916
+#: fortran/resolve.c:9963
#, no-c-format
msgid ""
"Derived-type '%s' declared at %L must be ABSTRACT because '%s' is DEFERRED "
"and not overridden"
msgstr ""
-#: fortran/resolve.c:8974
+#: fortran/resolve.c:10024
#, no-c-format
msgid "Non-extensible derived-type '%s' at %L must not be ABSTRACT"
msgstr ""
-#: fortran/resolve.c:8984
+#: fortran/resolve.c:10034
#, no-c-format
msgid ""
"Interface '%s', used by procedure pointer component '%s' at %L, is declared "
"in a later PROCEDURE statement"
msgstr ""
-#: fortran/resolve.c:9041
+#: fortran/resolve.c:10095
#, no-c-format
msgid ""
"Interface '%s' of procedure pointer component '%s' at %L must be explicit"
msgstr ""
-#: fortran/resolve.c:9063
+#: fortran/resolve.c:10133
+#, no-c-format
+msgid ""
+"Procedure pointer component '%s' with PASS(%s) at %L has no argument '%s'"
+msgstr ""
+
+#: fortran/resolve.c:10147
+#, no-c-format
+msgid ""
+"Procedure pointer component '%s' with PASS at %L must have at least one "
+"argument"
+msgstr ""
+
+#: fortran/resolve.c:10163
+#, no-c-format
+msgid ""
+"Argument '%s' of '%s' with PASS(%s) at %L must be of the derived type '%s'"
+msgstr ""
+
+#: fortran/resolve.c:10173
+#, no-c-format
+msgid "Argument '%s' of '%s' with PASS(%s) at %L must be scalar"
+msgstr ""
+
+#: fortran/resolve.c:10182
+#, no-c-format
+msgid ""
+"Argument '%s' of '%s' with PASS(%s) at %L may not have the POINTER attribute"
+msgstr ""
+
+#: fortran/resolve.c:10191
+#, no-c-format
+msgid "Argument '%s' of '%s' with PASS(%s) at %L may not be ALLOCATABLE"
+msgstr ""
+
+#: fortran/resolve.c:10214
#, no-c-format
msgid ""
"Component '%s' of '%s' at %L has the same name as an inherited type-bound "
"procedure"
msgstr ""
-#: fortran/resolve.c:9075
+#: fortran/resolve.c:10226
#, no-c-format
msgid ""
"Character length of component '%s' needs to be a constant specification "
"expression at %L"
msgstr ""
-#: fortran/resolve.c:9091
+#: fortran/resolve.c:10241
#, no-c-format
msgid ""
"Fortran 2003: the component '%s' is a PRIVATE type and cannot be a component "
"of '%s', which is PUBLIC at %L"
msgstr ""
-#: fortran/resolve.c:9102
+#: fortran/resolve.c:10251
#, no-c-format
msgid ""
"Component %s of SEQUENCE type declared at %L does not have the SEQUENCE "
"attribute"
msgstr ""
-#: fortran/resolve.c:9113
+#: fortran/resolve.c:10262
#, no-c-format
msgid ""
"The pointer component '%s' of '%s' at %L is a type that has not been declared"
msgstr ""
-#: fortran/resolve.c:9141
+#: fortran/resolve.c:10273
+#, no-c-format
+msgid "Component '%s' with CLASS at %L must be allocatable or pointer"
+msgstr ""
+
+#: fortran/resolve.c:10301
#, no-c-format
msgid "Component '%s' of '%s' at %L must have constant array bounds"
msgstr ""
-#: fortran/resolve.c:9186
+#: fortran/resolve.c:10346
#, no-c-format
msgid ""
"NAMELIST object '%s' was declared PRIVATE and cannot be member of PUBLIC "
"namelist '%s' at %L"
msgstr ""
-#: fortran/resolve.c:9196
+#: fortran/resolve.c:10356
#, no-c-format
msgid ""
"NAMELIST object '%s' has use-associated PRIVATE components and cannot be "
"member of namelist '%s' at %L"
msgstr ""
-#: fortran/resolve.c:9209
+#: fortran/resolve.c:10369
#, no-c-format
msgid ""
"NAMELIST object '%s' has PRIVATE components and cannot be a member of PUBLIC "
"namelist '%s' at %L"
msgstr ""
-#: fortran/resolve.c:9221
+#: fortran/resolve.c:10381
#, no-c-format
msgid ""
"NAMELIST array object '%s' must not have assumed shape in namelist '%s' at %L"
msgstr ""
-#: fortran/resolve.c:9230
+#: fortran/resolve.c:10390
#, no-c-format
msgid ""
"NAMELIST array object '%s' must have constant shape in namelist '%s' at %L"
msgstr ""
-#: fortran/resolve.c:9242
+#: fortran/resolve.c:10402
#, no-c-format
msgid ""
"NAMELIST object '%s' in namelist '%s' at %L cannot have ALLOCATABLE "
"components"
msgstr ""
-#: fortran/resolve.c:9250
+#: fortran/resolve.c:10410
#, no-c-format
msgid ""
"NAMELIST object '%s' in namelist '%s' at %L cannot have POINTER components"
msgstr ""
-#: fortran/resolve.c:9276
+#: fortran/resolve.c:10436
#, no-c-format
msgid "PROCEDURE attribute conflicts with NAMELIST attribute in '%s' at %L"
msgstr ""
-#: fortran/resolve.c:9295
+#: fortran/resolve.c:10455
#, no-c-format
msgid "Parameter array '%s' at %L cannot be automatic or of deferred shape"
msgstr ""
-#: fortran/resolve.c:9307
+#: fortran/resolve.c:10467
#, no-c-format
msgid ""
"Implicitly typed PARAMETER '%s' at %L doesn't match a later IMPLICIT type"
msgstr ""
-#: fortran/resolve.c:9318
+#: fortran/resolve.c:10478
#, no-c-format
msgid "Incompatible derived type in PARAMETER at %L"
msgstr ""
-#: fortran/resolve.c:9380
+#: fortran/resolve.c:10541
+#, no-c-format
+msgid "PROCEDURE '%s' at %L may not be used as its own interface"
+msgstr ""
+
+#: fortran/resolve.c:10547
#, no-c-format
msgid ""
"Interface '%s', used by procedure '%s' at %L, is declared in a later "
"PROCEDURE statement"
msgstr ""
-#: fortran/resolve.c:9437
+#: fortran/resolve.c:10600
#, no-c-format
msgid "Interface '%s' of procedure '%s' at %L must be explicit"
msgstr ""
-#: fortran/resolve.c:9471
-#, no-c-format
-msgid "Type specified for intrinsic function '%s' at %L is ignored"
-msgstr ""
-
-#: fortran/resolve.c:9478
-#, no-c-format
-msgid "Intrinsic subroutine '%s' at %L shall not have a type specifier"
-msgstr ""
-
-#: fortran/resolve.c:9485
-#, no-c-format
-msgid "'%s' declared INTRINSIC at %L does not exist"
-msgstr ""
-
-#: fortran/resolve.c:9494
-#, no-c-format
-msgid ""
-"The intrinsic '%s' declared INTRINSIC at %L is not available in the current "
-"standard settings but %s. Use an appropriate -std=* option or enable -fall-"
-"intrinsics in order to use it."
-msgstr ""
-
-#: fortran/resolve.c:9541
+#: fortran/resolve.c:10667
#, no-c-format
msgid "Assumed size array at %L must be a dummy argument"
msgstr ""
-#: fortran/resolve.c:9544
+#: fortran/resolve.c:10670
#, no-c-format
msgid "Assumed shape array at %L must be a dummy argument"
msgstr ""
-#: fortran/resolve.c:9556
+#: fortran/resolve.c:10682
#, no-c-format
msgid "Symbol at %L is not a DUMMY variable"
msgstr ""
-#: fortran/resolve.c:9562
+#: fortran/resolve.c:10688
#, no-c-format
msgid ""
"'%s' at %L cannot have the VALUE attribute because it is not a dummy argument"
msgstr ""
-#: fortran/resolve.c:9572
+#: fortran/resolve.c:10698
#, no-c-format
msgid ""
"Character dummy variable '%s' at %L with VALUE attribute must have constant "
"length"
msgstr ""
-#: fortran/resolve.c:9581
+#: fortran/resolve.c:10707
#, no-c-format
msgid ""
"C interoperable character dummy variable '%s' at %L with VALUE attribute "
"must have length one"
msgstr ""
-#: fortran/resolve.c:9607
+#: fortran/resolve.c:10733
#, no-c-format
msgid ""
"Variable '%s' at %L cannot be BIND(C) because it is neither a COMMON block "
"nor declared at the module level scope"
msgstr ""
-#: fortran/resolve.c:9660
+#: fortran/resolve.c:10786
#, no-c-format
msgid "The derived type '%s' at %L is of type '%s', which has not been defined"
msgstr ""
-#: fortran/resolve.c:9701
+#: fortran/resolve.c:10827
#, no-c-format
msgid "Fortran 2003: PUBLIC %s '%s' at %L of PRIVATE derived type '%s'"
msgstr ""
-#: fortran/resolve.c:9720
+#: fortran/resolve.c:10846
#, no-c-format
msgid ""
"The INTENT(OUT) dummy argument '%s' at %L is ASSUMED SIZE and so cannot have "
"a default initializer"
msgstr ""
-#: fortran/resolve.c:9779
+#: fortran/resolve.c:10920
#, no-c-format
msgid "Threadprivate at %L isn't SAVEd"
msgstr ""
-#: fortran/resolve.c:9867
+#: fortran/resolve.c:10968
+#, no-c-format
+msgid "non-constant DATA value at %L"
+msgstr ""
+
+#: fortran/resolve.c:11011
#, no-c-format
msgid "BLOCK DATA element '%s' at %L must be in COMMON"
msgstr ""
-#: fortran/resolve.c:9873
+#: fortran/resolve.c:11017
#, no-c-format
msgid "DATA array '%s' at %L must be specified in a previous declaration"
msgstr ""
-#: fortran/resolve.c:9889
+#: fortran/resolve.c:11033
#, no-c-format
msgid "DATA element '%s' at %L is a pointer and so must be a full array"
msgstr ""
-#: fortran/resolve.c:9935
+#: fortran/resolve.c:11079
#, no-c-format
msgid "Nonconstant array section at %L in DATA statement"
msgstr ""
-#: fortran/resolve.c:9948
+#: fortran/resolve.c:11092
#, no-c-format
msgid "DATA statement at %L has more variables than values"
msgstr ""
-#: fortran/resolve.c:10042
+#: fortran/resolve.c:11186
#, no-c-format
msgid "iterator start at %L does not simplify"
msgstr ""
-#: fortran/resolve.c:10049
+#: fortran/resolve.c:11193
#, no-c-format
msgid "iterator end at %L does not simplify"
msgstr ""
-#: fortran/resolve.c:10056
+#: fortran/resolve.c:11200
#, no-c-format
msgid "iterator step at %L does not simplify"
msgstr ""
-#: fortran/resolve.c:10182
+#: fortran/resolve.c:11326
#, no-c-format
msgid "DATA statement at %L has more values than variables"
msgstr ""
-#: fortran/resolve.c:10273
+#: fortran/resolve.c:11417
#, no-c-format
msgid "Label %d at %L defined but not used"
msgstr ""
-#: fortran/resolve.c:10278
+#: fortran/resolve.c:11422
#, no-c-format
msgid "Label %d at %L defined but cannot be used"
msgstr ""
-#: fortran/resolve.c:10363
+#: fortran/resolve.c:11506
#, no-c-format
msgid ""
"Derived type variable '%s' at %L must have SEQUENCE attribute to be an "
"EQUIVALENCE object"
msgstr ""
-#: fortran/resolve.c:10372
+#: fortran/resolve.c:11515
#, no-c-format
msgid ""
"Derived type variable '%s' at %L cannot have ALLOCATABLE components to be an "
"EQUIVALENCE object"
msgstr ""
-#: fortran/resolve.c:10380
+#: fortran/resolve.c:11523
#, no-c-format
msgid ""
"Derived type variable '%s' at %L with default initialization cannot be in "
"EQUIVALENCE with a variable in COMMON"
msgstr ""
-#: fortran/resolve.c:10397
+#: fortran/resolve.c:11539
#, no-c-format
msgid ""
"Derived type variable '%s' at %L with pointer component(s) cannot be an "
"EQUIVALENCE object"
msgstr ""
-#: fortran/resolve.c:10502
+#: fortran/resolve.c:11643
#, no-c-format
msgid "Syntax error in EQUIVALENCE statement at %L"
msgstr ""
-#: fortran/resolve.c:10517
+#: fortran/resolve.c:11658
#, no-c-format
msgid ""
"Either all or none of the objects in the EQUIVALENCE set at %L shall have "
"the PROTECTED attribute"
msgstr ""
-#: fortran/resolve.c:10529
+#: fortran/resolve.c:11670
#, no-c-format
msgid ""
"Common block member '%s' at %L cannot be an EQUIVALENCE object in the pure "
"procedure '%s'"
msgstr ""
-#: fortran/resolve.c:10538
+#: fortran/resolve.c:11679
#, no-c-format
msgid "Named constant '%s' at %L cannot be an EQUIVALENCE object"
msgstr ""
-#: fortran/resolve.c:10617
+#: fortran/resolve.c:11758
#, no-c-format
msgid ""
"Array '%s' at %L with non-constant bounds cannot be an EQUIVALENCE object"
msgstr ""
-#: fortran/resolve.c:10628
+#: fortran/resolve.c:11769
#, no-c-format
msgid "Structure component '%s' at %L cannot be an EQUIVALENCE object"
msgstr ""
-#: fortran/resolve.c:10639
+#: fortran/resolve.c:11780
#, no-c-format
msgid "Substring at %L has length zero"
msgstr ""
-#: fortran/resolve.c:10683
+#: fortran/resolve.c:11824
#, no-c-format
msgid "Fortran 2003: PUBLIC function '%s' at %L of PRIVATE type '%s'"
msgstr ""
-#: fortran/resolve.c:10696
+#: fortran/resolve.c:11837
#, no-c-format
msgid "ENTRY '%s' at %L has no IMPLICIT type"
msgstr ""
-#: fortran/resolve.c:10722
+#: fortran/resolve.c:11854
#, no-c-format
msgid "User operator procedure '%s' at %L must be a FUNCTION"
msgstr ""
-#: fortran/resolve.c:10729
+#: fortran/resolve.c:11864
#, no-c-format
msgid "User operator procedure '%s' at %L cannot be assumed character length"
msgstr ""
-#: fortran/resolve.c:10735
+#: fortran/resolve.c:11872
#, no-c-format
msgid "User operator procedure '%s' at %L must have at least one argument"
msgstr ""
-#: fortran/resolve.c:10745
+#: fortran/resolve.c:11886
#, no-c-format
msgid "First argument of operator interface at %L cannot be optional"
msgstr ""
-#: fortran/resolve.c:10757
+#: fortran/resolve.c:11904
#, no-c-format
msgid "Second argument of operator interface at %L cannot be optional"
msgstr ""
-#: fortran/resolve.c:10761
+#: fortran/resolve.c:11911
#, no-c-format
msgid "Operator interface at %L must have, at most, two arguments"
msgstr ""
-#: fortran/resolve.c:10815
+#: fortran/resolve.c:11983
#, no-c-format
msgid "Contained procedure '%s' at %L of a PURE procedure must also be PURE"
msgstr ""
-#: fortran/scanner.c:727
+#: fortran/scanner.c:760
#, no-c-format
msgid ""
"!$OMP at %C starts a commented line as it neither is followed by a space nor "
"is a continuation line"
msgstr ""
-#: fortran/scanner.c:1030 fortran/scanner.c:1154
+#: fortran/scanner.c:1078 fortran/scanner.c:1221
#, no-c-format
msgid "Limit of %d continuations exceeded in statement at %C"
msgstr ""
-#: fortran/scanner.c:1078
+#: fortran/scanner.c:1090 fortran/scanner.c:1177
+#, no-c-format
+msgid "Line truncated at %L"
+msgstr ""
+
+#: fortran/scanner.c:1137
#, no-c-format
msgid "Missing '&' in continued character constant at %C"
msgstr ""
-#: fortran/scanner.c:1304
+#: fortran/scanner.c:1371
#, no-c-format
msgid "Nonconforming tab character at %C"
msgstr ""
-#: fortran/scanner.c:1392 fortran/scanner.c:1395
+#: fortran/scanner.c:1459 fortran/scanner.c:1462
#, no-c-format
msgid "'&' not allowed by itself in line %d"
msgstr ""
-#: fortran/scanner.c:1442
+#: fortran/scanner.c:1509
#, no-c-format
msgid "Nonconforming tab character in column %d of line %d"
msgstr ""
-#: fortran/scanner.c:1650
+#: fortran/scanner.c:1717
#, no-c-format
msgid "%s:%d: file %s left but not entered"
msgstr ""
-#: fortran/scanner.c:1684
+#: fortran/scanner.c:1751
#, no-c-format
msgid "%s:%d: Illegal preprocessor directive"
msgstr ""
-#: fortran/scanner.c:1802
+#: fortran/scanner.c:1869
#, no-c-format
msgid "Can't open file '%s'"
msgstr ""
-#: fortran/simplify.c:82
+#: fortran/simplify.c:86
#, no-c-format
msgid "Result of %s overflows its kind at %L"
msgstr ""
-#: fortran/simplify.c:87
+#: fortran/simplify.c:91
#, no-c-format
msgid "Result of %s underflows its kind at %L"
msgstr ""
-#: fortran/simplify.c:92
+#: fortran/simplify.c:96
#, no-c-format
msgid "Result of %s is NaN at %L"
msgstr ""
-#: fortran/simplify.c:96
+#: fortran/simplify.c:100
#, no-c-format
msgid "Result of %s gives range error for its kind at %L"
msgstr ""
-#: fortran/simplify.c:119
+#: fortran/simplify.c:123
#, no-c-format
msgid "KIND parameter of %s at %L must be an initialization expression"
msgstr ""
-#: fortran/simplify.c:127
+#: fortran/simplify.c:131
#, no-c-format
msgid "Invalid KIND parameter of %s at %L"
msgstr ""
-#: fortran/simplify.c:276
+#: fortran/simplify.c:680
#, no-c-format
msgid "Argument of %s function at %L is negative"
msgstr ""
-#: fortran/simplify.c:283
+#: fortran/simplify.c:687
#, no-c-format
msgid "Argument of %s function at %L outside of range [0,127]"
msgstr ""
-#: fortran/simplify.c:301
+#: fortran/simplify.c:705
#, no-c-format
msgid ""
"Argument of %s function at %L is too large for the collating sequence of "
"kind %d"
msgstr ""
-#: fortran/simplify.c:337
+#: fortran/simplify.c:744
#, no-c-format
msgid "Argument of ACOS at %L must be between -1 and 1"
msgstr ""
-#: fortran/simplify.c:359
+#: fortran/simplify.c:780
#, no-c-format
msgid "Argument of ACOSH at %L must not be less than 1"
msgstr ""
-#: fortran/simplify.c:576
+#: fortran/simplify.c:1049
#, no-c-format
msgid "Argument of ASIN at %L must be between -1 and 1"
msgstr ""
-#: fortran/simplify.c:632
+#: fortran/simplify.c:1146
#, no-c-format
msgid "Argument of ATANH at %L must be inside the range -1 to 1"
msgstr ""
-#: fortran/simplify.c:655
+#: fortran/simplify.c:1180
#, no-c-format
msgid ""
"If first argument of ATAN2 %L is zero, then the second argument must not be "
"zero"
msgstr ""
-#: fortran/simplify.c:1462
+#: fortran/simplify.c:2221
#, no-c-format
msgid "Argument of IACHAR at %L must be of length one"
msgstr ""
-#: fortran/simplify.c:1469
+#: fortran/simplify.c:2228
#, no-c-format
msgid "Argument of IACHAR function at %L outside of range 0..127"
msgstr ""
-#: fortran/simplify.c:1508
+#: fortran/simplify.c:2267
#, no-c-format
msgid "Invalid second argument of IBCLR at %L"
msgstr ""
-#: fortran/simplify.c:1516
+#: fortran/simplify.c:2275
#, no-c-format
msgid "Second argument of IBCLR exceeds bit size at %L"
msgstr ""
-#: fortran/simplify.c:1550
+#: fortran/simplify.c:2309
#, no-c-format
msgid "Invalid second argument of IBITS at %L"
msgstr ""
-#: fortran/simplify.c:1556
+#: fortran/simplify.c:2315
#, no-c-format
msgid "Invalid third argument of IBITS at %L"
msgstr ""
-#: fortran/simplify.c:1566
+#: fortran/simplify.c:2325
#, no-c-format
msgid "Sum of second and third arguments of IBITS exceeds bit size at %L"
msgstr ""
-#: fortran/simplify.c:1613
+#: fortran/simplify.c:2372
#, no-c-format
msgid "Invalid second argument of IBSET at %L"
msgstr ""
-#: fortran/simplify.c:1621
+#: fortran/simplify.c:2380
#, no-c-format
msgid "Second argument of IBSET exceeds bit size at %L"
msgstr ""
-#: fortran/simplify.c:1651
+#: fortran/simplify.c:2410
#, no-c-format
msgid "Argument of ICHAR at %L must be of length one"
msgstr ""
-#: fortran/simplify.c:1854
+#: fortran/simplify.c:2613
#, no-c-format
msgid "Argument of INT at %L is not a valid type"
msgstr ""
-#: fortran/simplify.c:1885
+#: fortran/simplify.c:2644
#, no-c-format
msgid "Argument of %s at %L is not a valid type"
msgstr ""
-#: fortran/simplify.c:1982
+#: fortran/simplify.c:2789
#, no-c-format
msgid "Invalid second argument of ISHFT at %L"
msgstr ""
-#: fortran/simplify.c:1997
+#: fortran/simplify.c:2804
#, no-c-format
msgid "Magnitude of second argument of ISHFT exceeds bit size at %L"
msgstr ""
-#: fortran/simplify.c:2061
+#: fortran/simplify.c:2868
#, no-c-format
msgid "Invalid second argument of ISHFTC at %L"
msgstr ""
-#: fortran/simplify.c:2075
+#: fortran/simplify.c:2882
#, no-c-format
msgid "Invalid third argument of ISHFTC at %L"
msgstr ""
-#: fortran/simplify.c:2081
+#: fortran/simplify.c:2888
#, no-c-format
msgid ""
"Magnitude of third argument of ISHFTC exceeds BIT_SIZE of first argument at %"
"L"
msgstr ""
-#: fortran/simplify.c:2097
+#: fortran/simplify.c:2904
#, no-c-format
msgid "Magnitude of second argument of ISHFTC exceeds third argument at %L"
msgstr ""
-#: fortran/simplify.c:2100
+#: fortran/simplify.c:2907
#, no-c-format
msgid ""
"Magnitude of second argument of ISHFTC exceeds BIT_SIZE of first argument at "
"%L"
msgstr ""
-#: fortran/simplify.c:2171
+#: fortran/simplify.c:2978
#, no-c-format
msgid "Argument of KIND at %L is a DERIVED type"
msgstr ""
-#: fortran/simplify.c:2383
+#: fortran/simplify.c:3190
#, no-c-format
msgid "DIM argument at %L is out of bounds"
msgstr ""
-#: fortran/simplify.c:2555
+#: fortran/simplify.c:3376
#, no-c-format
msgid "Argument of LOG at %L cannot be less than or equal to zero"
msgstr ""
-#: fortran/simplify.c:2568
+#: fortran/simplify.c:3389
#, no-c-format
msgid "Complex argument of LOG at %L cannot be zero"
msgstr ""
-#: fortran/simplify.c:2609
+#: fortran/simplify.c:3436
#, no-c-format
msgid "Argument of LOG10 at %L cannot be less than or equal to zero"
msgstr ""
#. Result is processor-dependent.
-#: fortran/simplify.c:2902
+#: fortran/simplify.c:3807
#, no-c-format
msgid "Second argument MOD at %L is zero"
msgstr ""
#. Result is processor-dependent.
-#: fortran/simplify.c:2913
+#: fortran/simplify.c:3818
#, no-c-format
msgid "Second argument of MOD at %L is zero"
msgstr ""
@@ -10927,95 +11525,49 @@ msgstr ""
#. Result is processor-dependent. This processor just opts
#. to not handle it at all.
#. Result is processor-dependent.
-#: fortran/simplify.c:2955 fortran/simplify.c:2967
+#: fortran/simplify.c:3860 fortran/simplify.c:3872
#, no-c-format
msgid "Second argument of MODULO at %L is zero"
msgstr ""
-#: fortran/simplify.c:3013
+#: fortran/simplify.c:3918
#, no-c-format
msgid "Second argument of NEAREST at %L shall not be zero"
msgstr ""
-#: fortran/simplify.c:3049
+#: fortran/simplify.c:3954
#, no-c-format
msgid "Result of NEAREST is NaN at %L"
msgstr ""
-#: fortran/simplify.c:3330
+#: fortran/simplify.c:4332
#, no-c-format
msgid "Argument NCOPIES of REPEAT intrinsic is negative at %L"
msgstr ""
-#: fortran/simplify.c:3385
+#: fortran/simplify.c:4387
#, no-c-format
msgid "Argument NCOPIES of REPEAT intrinsic is too large at %L"
msgstr ""
-#: fortran/simplify.c:3496
-#, no-c-format
-msgid "Integer too large in shape specification at %L"
-msgstr ""
-
-#: fortran/simplify.c:3504
-#, no-c-format
-msgid "Too many dimensions in shape specification for RESHAPE at %L"
-msgstr ""
-
-#: fortran/simplify.c:3512
-#, no-c-format
-msgid "Shape specification at %L cannot be negative"
-msgstr ""
-
-#: fortran/simplify.c:3524
-#, no-c-format
-msgid "Shape specification at %L cannot be the null array"
-msgstr ""
-
-#: fortran/simplify.c:3545
-#, no-c-format
-msgid ""
-"ORDER parameter of RESHAPE at %L is not the same size as SHAPE parameter"
-msgstr ""
-
-#: fortran/simplify.c:3552
-#, no-c-format
-msgid "Error in ORDER parameter of RESHAPE at %L"
-msgstr ""
-
-#: fortran/simplify.c:3560
-#, no-c-format
-msgid "ORDER parameter of RESHAPE at %L is out of range"
-msgstr ""
-
-#: fortran/simplify.c:3570
-#, no-c-format
-msgid "Invalid permutation in ORDER parameter at %L"
-msgstr ""
-
-#: fortran/simplify.c:3629
-#, no-c-format
-msgid "PAD parameter required for short SOURCE parameter at %L"
-msgstr ""
-
-#: fortran/simplify.c:3748
+#: fortran/simplify.c:4659
#, no-c-format
msgid "Result of SCALE overflows its kind at %L"
msgstr ""
-#: fortran/simplify.c:4382
+#: fortran/simplify.c:5423
#, no-c-format
msgid "Argument of SQRT at %L has a negative value"
msgstr ""
-#: fortran/simplify.c:4537
+#: fortran/simplify.c:5623
#, no-c-format
msgid ""
"Intrinsic TRANSFER at %L has partly undefined result: source size %ld < "
"result size %ld"
msgstr ""
-#: fortran/simplify.c:4903
+#: fortran/simplify.c:6078
#, no-c-format
msgid ""
"Character '%s' in string at %L cannot be converted into character kind %d"
@@ -11047,7 +11599,7 @@ msgid "Symbol '%s' at %L has no IMPLICIT type"
msgstr ""
#. BIND(C) variables should not be implicitly declared.
-#: fortran/symbol.c:281
+#: fortran/symbol.c:278
#, no-c-format
msgid ""
"Implicitly declared BIND(C) variable '%s' at %L may not be C interoperable"
@@ -11055,270 +11607,282 @@ msgstr ""
#. Dummy args to a BIND(C) routine may not be interoperable if
#. they are implicitly typed.
-#: fortran/symbol.c:295
+#: fortran/symbol.c:292
#, no-c-format
msgid ""
"Implicitly declared variable '%s' at %L may not be C interoperable but it is "
"a dummy argument to the BIND(C) procedure '%s' at %L"
msgstr ""
-#: fortran/symbol.c:336
+#: fortran/symbol.c:333
#, no-c-format
msgid "Function result '%s' at %L has no IMPLICIT type"
msgstr ""
-#: fortran/symbol.c:415
+#: fortran/symbol.c:412
#, no-c-format
msgid "%s attribute not allowed in BLOCK DATA program unit at %L"
msgstr ""
-#: fortran/symbol.c:470
+#: fortran/symbol.c:467
#, no-c-format
msgid "Fortran 2003: Procedure pointer at %C"
msgstr ""
-#: fortran/symbol.c:620
+#: fortran/symbol.c:617
#, no-c-format
msgid "%s attribute applied to %s %s at %L"
msgstr ""
-#: fortran/symbol.c:627
+#: fortran/symbol.c:624
#, no-c-format
msgid "BIND(C) applied to %s %s at %L"
msgstr ""
-#: fortran/symbol.c:728 fortran/symbol.c:1381
+#: fortran/symbol.c:725 fortran/symbol.c:1387
#, no-c-format
msgid "%s attribute conflicts with %s attribute at %L"
msgstr ""
-#: fortran/symbol.c:731
+#: fortran/symbol.c:728
#, no-c-format
msgid "%s attribute conflicts with %s attribute in '%s' at %L"
msgstr ""
-#: fortran/symbol.c:739
+#: fortran/symbol.c:736
#, no-c-format
msgid "Fortran 2003: %s attribute with %s attribute at %L"
msgstr ""
-#: fortran/symbol.c:745
+#: fortran/symbol.c:742
#, no-c-format
msgid "Fortran 2003: %s attribute with %s attribute in '%s' at %L"
msgstr ""
-#: fortran/symbol.c:789
+#: fortran/symbol.c:786
#, no-c-format
msgid "Cannot change attributes of USE-associated symbol at %L"
msgstr ""
-#: fortran/symbol.c:792
+#: fortran/symbol.c:789
#, no-c-format
msgid "Cannot change attributes of USE-associated symbol %s at %L"
msgstr ""
-#: fortran/symbol.c:808
+#: fortran/symbol.c:805
#, no-c-format
msgid "Duplicate %s attribute specified at %L"
msgstr ""
-#: fortran/symbol.c:841
+#: fortran/symbol.c:847
#, no-c-format
msgid "ALLOCATABLE specified outside of INTERFACE body at %L"
msgstr ""
-#: fortran/symbol.c:867
+#: fortran/symbol.c:873
#, no-c-format
msgid "DIMENSION specified for '%s' outside its INTERFACE body at %L"
msgstr ""
-#: fortran/symbol.c:985
+#: fortran/symbol.c:991
#, no-c-format
msgid "Cray Pointee at %L appears in multiple pointer() statements"
msgstr ""
-#: fortran/symbol.c:1004
+#: fortran/symbol.c:1010
#, no-c-format
msgid "Duplicate PROTECTED attribute specified at %L"
msgstr ""
-#: fortran/symbol.c:1037
+#: fortran/symbol.c:1043
#, no-c-format
msgid "SAVE attribute at %L cannot be specified in a PURE procedure"
msgstr ""
-#: fortran/symbol.c:1045
+#: fortran/symbol.c:1051
#, no-c-format
msgid "Duplicate SAVE attribute specified at %L"
msgstr ""
-#: fortran/symbol.c:1066
+#: fortran/symbol.c:1072
#, no-c-format
msgid "Duplicate VALUE attribute specified at %L"
msgstr ""
-#: fortran/symbol.c:1086
+#: fortran/symbol.c:1092
#, no-c-format
msgid "Duplicate VOLATILE attribute specified at %L"
msgstr ""
-#: fortran/symbol.c:1377
+#: fortran/symbol.c:1383
#, no-c-format
msgid "%s attribute of '%s' conflicts with %s attribute at %L"
msgstr ""
-#: fortran/symbol.c:1411
+#: fortran/symbol.c:1417
#, no-c-format
msgid "%s procedure at %L is already declared as %s procedure"
msgstr ""
-#: fortran/symbol.c:1446
+#: fortran/symbol.c:1452
#, no-c-format
msgid "INTENT (%s) conflicts with INTENT(%s) at %L"
msgstr ""
-#: fortran/symbol.c:1470
+#: fortran/symbol.c:1476
#, no-c-format
msgid "ACCESS specification at %L was already specified"
msgstr ""
-#: fortran/symbol.c:1487
+#: fortran/symbol.c:1493
#, no-c-format
msgid "Duplicate BIND attribute specified at %L"
msgstr ""
-#: fortran/symbol.c:1494
+#: fortran/symbol.c:1500
#, no-c-format
msgid "Fortran 2003: BIND(C) at %L"
msgstr ""
-#: fortran/symbol.c:1511
+#: fortran/symbol.c:1517
#, no-c-format
msgid "Duplicate EXTENDS attribute specified at %L"
msgstr ""
-#: fortran/symbol.c:1515
+#: fortran/symbol.c:1521
#, no-c-format
msgid "Fortran 2003: EXTENDS at %L"
msgstr ""
-#: fortran/symbol.c:1537
+#: fortran/symbol.c:1543
#, no-c-format
msgid "Symbol '%s' at %L already has an explicit interface"
msgstr ""
-#: fortran/symbol.c:1544
+#: fortran/symbol.c:1550
#, no-c-format
msgid "'%s' at %L has attributes specified outside its INTERFACE body"
msgstr ""
-#: fortran/symbol.c:1585
+#: fortran/symbol.c:1583
+#, no-c-format
+msgid "Symbol '%s' at %L already has basic type of %s"
+msgstr ""
+
+#: fortran/symbol.c:1590
#, no-c-format
msgid "Procedure '%s' at %L may not have basic type of %s"
msgstr ""
-#: fortran/symbol.c:1597
+#: fortran/symbol.c:1602
#, no-c-format
msgid "Symbol '%s' at %L cannot have a type"
msgstr ""
-#: fortran/symbol.c:1756
+#: fortran/symbol.c:1765
#, no-c-format
msgid "Component '%s' at %C already declared at %L"
msgstr ""
-#: fortran/symbol.c:1767
+#: fortran/symbol.c:1776
#, no-c-format
msgid "Component '%s' at %C already in the parent type at %L"
msgstr ""
-#: fortran/symbol.c:1843
+#: fortran/symbol.c:1852
#, no-c-format
msgid "Symbol '%s' at %C is ambiguous"
msgstr ""
-#: fortran/symbol.c:1875
+#: fortran/symbol.c:1884
#, no-c-format
msgid "Derived type '%s' at %C is being used before it is defined"
msgstr ""
-#: fortran/symbol.c:1916
+#: fortran/symbol.c:1925
#, no-c-format
msgid "'%s' at %C is not a member of the '%s' structure"
msgstr ""
-#: fortran/symbol.c:1924
+#: fortran/symbol.c:1933
#, no-c-format
msgid "Component '%s' at %C is a PRIVATE component of '%s'"
msgstr ""
-#: fortran/symbol.c:1934
+#: fortran/symbol.c:1943
#, no-c-format
msgid "All components of '%s' are PRIVATE in structure constructor at %C"
msgstr ""
-#: fortran/symbol.c:2063
+#: fortran/symbol.c:2072
#, no-c-format
msgid "Duplicate statement label %d at %L and %L"
msgstr ""
-#: fortran/symbol.c:2073
+#: fortran/symbol.c:2082
#, no-c-format
msgid "Label %d at %C already referenced as branch target"
msgstr ""
-#: fortran/symbol.c:2082
+#: fortran/symbol.c:2091
#, no-c-format
msgid "Label %d at %C already referenced as a format label"
msgstr ""
-#: fortran/symbol.c:2124
+#: fortran/symbol.c:2133
#, no-c-format
msgid "Label %d at %C previously used as a FORMAT label"
msgstr ""
-#: fortran/symbol.c:2132
+#: fortran/symbol.c:2141
#, no-c-format
msgid "Label %d at %C previously used as branch target"
msgstr ""
-#: fortran/symbol.c:2444
+#: fortran/symbol.c:2456
#, no-c-format
msgid "Name '%s' at %C is an ambiguous reference to '%s' from module '%s'"
msgstr ""
-#: fortran/symbol.c:2447
+#: fortran/symbol.c:2459
#, no-c-format
msgid ""
"Name '%s' at %C is an ambiguous reference to '%s' from current program unit"
msgstr ""
#. Symbol is from another namespace.
-#: fortran/symbol.c:2591
+#: fortran/symbol.c:2618
#, no-c-format
msgid "Symbol '%s' at %C has already been host associated"
msgstr ""
-#: fortran/symbol.c:3398
+#: fortran/symbol.c:3452
#, no-c-format
msgid ""
"Derived type '%s' declared at %L must have the BIND attribute to be C "
"interoperable"
msgstr ""
-#: fortran/symbol.c:3409
+#: fortran/symbol.c:3463
#, no-c-format
msgid "Derived type '%s' at %L is empty"
msgstr ""
-#: fortran/symbol.c:3426
+#: fortran/symbol.c:3480
#, no-c-format
msgid ""
"Component '%s' at %L cannot have the POINTER attribute because it is a "
"member of the BIND(C) derived type '%s' at %L"
msgstr ""
-#: fortran/symbol.c:3438
+#: fortran/symbol.c:3490
+#, no-c-format
+msgid ""
+"Procedure pointer component '%s' at %L cannot be a member of the BIND(C) "
+"derived type '%s' at %L"
+msgstr ""
+
+#: fortran/symbol.c:3501
#, no-c-format
msgid ""
"Component '%s' at %L cannot have the ALLOCATABLE attribute because it is a "
@@ -11327,7 +11891,7 @@ msgstr ""
#. If the derived type is bind(c), all fields must be
#. interop.
-#: fortran/symbol.c:3476
+#: fortran/symbol.c:3539
#, no-c-format
msgid ""
"Component '%s' in derived type '%s' at %L may not be C interoperable, even "
@@ -11337,136 +11901,136 @@ msgstr ""
#. If derived type is param to bind(c) routine, or to one
#. of the iso_c_binding procs, it must be interoperable, so
#. all fields must interop too.
-#: fortran/symbol.c:3485
+#: fortran/symbol.c:3548
#, no-c-format
msgid "Component '%s' in derived type '%s' at %L may not be C interoperable"
msgstr ""
-#: fortran/symbol.c:3499
+#: fortran/symbol.c:3562
#, no-c-format
msgid ""
"Derived type '%s' at %L cannot be declared with both PRIVATE and BIND(C) "
"attributes"
msgstr ""
-#: fortran/symbol.c:3507
+#: fortran/symbol.c:3570
#, no-c-format
msgid ""
"Derived type '%s' at %L cannot have the SEQUENCE attribute because it is BIND"
"(C)"
msgstr ""
-#: fortran/symbol.c:4379
+#: fortran/symbol.c:4500
#, no-c-format
msgid "Symbol '%s' is used before it is typed at %L"
msgstr ""
-#: fortran/symbol.c:4385
+#: fortran/symbol.c:4506
#, no-c-format
msgid "Extension: Symbol '%s' is used before it is typed at %L"
msgstr ""
-#: fortran/symbol.c:4457
+#: fortran/symbol.c:4639 fortran/symbol.c:4713
#, no-c-format
-msgid "'%s' of '%s' is PRIVATE at %C"
+msgid "'%s' of '%s' is PRIVATE at %L"
msgstr ""
-#: fortran/target-memory.c:615
+#: fortran/target-memory.c:659
#, no-c-format
msgid "Overlapping unequal initializers in EQUIVALENCE at %L"
msgstr ""
-#: fortran/target-memory.c:702
+#: fortran/target-memory.c:746
#, no-c-format
msgid "BOZ constant at %L is too large (%ld vs %ld bits)"
msgstr ""
-#: fortran/trans-array.c:641 fortran/trans-array.c:4464
-#: fortran/trans-array.c:5453 fortran/trans-intrinsic.c:3722
+#: fortran/trans-array.c:705 fortran/trans-array.c:4557
+#: fortran/trans-array.c:5592 fortran/trans-intrinsic.c:4296
#, no-c-format
msgid "Creating array temporary at %L"
msgstr ""
#. Problems occur when we get something like
#. integer :: a(lots) = (/(i, i=1, lots)/)
-#: fortran/trans-array.c:4033
+#: fortran/trans-array.c:4124
#, no-c-format
msgid ""
"The number of elements in the array constructor at %L requires an increase "
"of the allowed %d upper limit. See -fmax-array-constructor option"
msgstr ""
-#: fortran/trans-array.c:5450
+#: fortran/trans-array.c:5589
#, no-c-format
msgid "Creating array temporary at %L for argument '%s'"
msgstr ""
-#: fortran/trans-common.c:399
+#: fortran/trans-common.c:400
#, no-c-format
msgid "Named COMMON block '%s' at %L shall be of the same size"
msgstr ""
-#: fortran/trans-common.c:838
+#: fortran/trans-common.c:840
#, no-c-format
msgid "Bad array reference at %L"
msgstr ""
-#: fortran/trans-common.c:846
+#: fortran/trans-common.c:848
#, no-c-format
msgid "Illegal reference type at %L as EQUIVALENCE object"
msgstr ""
-#: fortran/trans-common.c:886
+#: fortran/trans-common.c:888
#, no-c-format
msgid "Inconsistent equivalence rules involving '%s' at %L and '%s' at %L"
msgstr ""
#. Aligning this field would misalign a previous field.
-#: fortran/trans-common.c:1019
+#: fortran/trans-common.c:1021
#, no-c-format
msgid ""
"The equivalence set for variable '%s' declared at %L violates alignment "
"requirements"
msgstr ""
-#: fortran/trans-common.c:1086
+#: fortran/trans-common.c:1088
#, no-c-format
msgid "Equivalence for '%s' does not match ordering of COMMON '%s' at %L"
msgstr ""
-#: fortran/trans-common.c:1101
+#: fortran/trans-common.c:1103
#, no-c-format
msgid ""
"The equivalence set for '%s' cause an invalid extension to COMMON '%s' at %L"
msgstr ""
-#: fortran/trans-common.c:1116
+#: fortran/trans-common.c:1118
#, no-c-format
msgid ""
"Padding of %d bytes required before '%s' in COMMON '%s' at %L; reorder "
"elements or use -fno-align-commons"
msgstr ""
-#: fortran/trans-common.c:1121
+#: fortran/trans-common.c:1123
#, no-c-format
msgid ""
"Padding of %d bytes required before '%s' in COMMON at %L; reorder elements "
"or use -fno-align-commons"
msgstr ""
-#: fortran/trans-common.c:1144
+#: fortran/trans-common.c:1146
#, no-c-format
msgid "COMMON '%s' at %L does not exist"
msgstr ""
-#: fortran/trans-common.c:1152
+#: fortran/trans-common.c:1154
#, no-c-format
msgid ""
"COMMON '%s' at %L requires %d bytes of padding at start; reorder elements or "
"use -fno-align-commons"
msgstr ""
-#: fortran/trans-common.c:1156
+#: fortran/trans-common.c:1158
#, no-c-format
msgid ""
"COMMON at %L requires %d bytes of padding at start; reorder elements or use -"
@@ -11478,66 +12042,76 @@ msgstr ""
msgid "Assigning value other than 0 or 1 to LOGICAL has undefined result at %L"
msgstr ""
-#: fortran/trans-decl.c:2957 fortran/trans-decl.c:4113
+#: fortran/trans-decl.c:3083 fortran/trans-decl.c:4375
#, no-c-format
msgid "Return value of function '%s' at %L not set"
msgstr ""
-#: fortran/trans-decl.c:3616
+#: fortran/trans-decl.c:3750
#, no-c-format
msgid "Dummy argument '%s' at %L was declared INTENT(OUT) but was not set"
msgstr ""
-#: fortran/trans-decl.c:3620
+#: fortran/trans-decl.c:3754
#, no-c-format
msgid "Unused dummy argument '%s' at %L"
msgstr ""
-#: fortran/trans-decl.c:3626
+#: fortran/trans-decl.c:3760
#, no-c-format
msgid "Unused variable '%s' declared at %L"
msgstr ""
-#: fortran/trans-decl.c:3672
+#: fortran/trans-decl.c:3808
#, no-c-format
msgid "Unused parameter '%s' declared at %L"
msgstr ""
-#: fortran/trans-decl.c:3686
+#: fortran/trans-decl.c:3822
#, no-c-format
msgid "Return value '%s' of function '%s' declared at %L not set"
msgstr ""
-#: fortran/trans-decl.c:3790
+#: fortran/trans-decl.c:3930
#, c-format
msgid ""
"Actual string length does not match the declared one for dummy argument '%"
"s' (%ld/%ld)"
msgstr ""
-#: fortran/trans-decl.c:3796
+#: fortran/trans-decl.c:3938
#, c-format
msgid ""
"Actual string length is shorter than the declared one for dummy argument '%"
"s' (%ld/%ld)"
msgstr ""
-#: fortran/trans-expr.c:2361
+#: fortran/trans-expr.c:1618
+msgid "internal error: bad vindex in dynamic dispatch"
+msgstr ""
+
+#: fortran/trans-expr.c:2532
#, no-c-format
msgid "Unknown argument list function at %L"
msgstr ""
-#: fortran/trans-intrinsic.c:883
+#: fortran/trans-intrinsic.c:888
#, no-c-format
msgid "'dim' argument of %s intrinsic at %L is not a valid dimension index"
msgstr ""
-#: fortran/trans-io.c:2002
+#. TODO: Implement EXTENDS_TYPE_OF.
+#: fortran/trans-intrinsic.c:4747
+#, no-c-format
+msgid "Intrinsic EXTENDS_TYPE_OF at %L not yet implemented"
+msgstr ""
+
+#: fortran/trans-io.c:2017
#, no-c-format
msgid "Derived type '%s' at %L has PRIVATE components"
msgstr ""
-#: fortran/trans-stmt.c:499
+#: fortran/trans-stmt.c:484
#, no-c-format
msgid "An alternate return at %L without a * dummy argument"
msgstr ""
@@ -11554,33 +12128,33 @@ msgstr ""
msgid "Incorrect function return value"
msgstr ""
-#: fortran/trans.c:516 fortran/trans.c:936
+#: fortran/trans.c:521 fortran/trans.c:951
msgid "Attempt to allocate a negative amount of memory."
msgstr ""
-#: fortran/trans.c:534
+#: fortran/trans.c:541
msgid "Memory allocation failed"
msgstr ""
-#: fortran/trans.c:616
+#: fortran/trans.c:624
msgid ""
"Attempt to allocate negative amount of memory. Possible integer overflow"
msgstr ""
-#: fortran/trans.c:647 fortran/trans.c:953
+#: fortran/trans.c:658 fortran/trans.c:970
msgid "Out of memory"
msgstr ""
-#: fortran/trans.c:738
+#: fortran/trans.c:750
#, c-format
msgid "Attempting to allocate already allocated array '%s'"
msgstr ""
-#: fortran/trans.c:744
+#: fortran/trans.c:756
msgid "Attempting to allocate already allocatedarray"
msgstr ""
-#: fortran/trans.c:853
+#: fortran/trans.c:867
#, c-format
msgid "Attempt to DEALLOCATE unallocated '%s'"
msgstr ""
@@ -11726,136 +12300,115 @@ msgstr ""
msgid "%s: Failed to close output file %s\n"
msgstr ""
-#: java/jvspec.c:409
+#: java/jvspec.c:410
#, c-format
msgid "can't specify '-D' without '--main'\n"
msgstr ""
-#: java/jvspec.c:412
+#: java/jvspec.c:413
#, c-format
msgid "'%s' is not a valid class name"
msgstr ""
-#: java/jvspec.c:418
+#: java/jvspec.c:419
#, c-format
msgid "--resource requires -o"
msgstr ""
-#: java/jvspec.c:432
+#: java/jvspec.c:433
#, c-format
msgid "cannot specify both -C and -o"
msgstr ""
-#: java/jvspec.c:444
+#: java/jvspec.c:445
#, c-format
msgid "cannot create temporary file"
msgstr ""
-#: java/jvspec.c:466
+#: java/jvspec.c:467
#, c-format
msgid "using both @FILE with multiple files not implemented"
msgstr ""
-#: java/jvspec.c:588
+#: java/jvspec.c:589
#, c-format
msgid "cannot specify 'main' class when not linking"
msgstr ""
-#: config/sparc/linux64.h:165 config/sparc/linux64.h:176
-#: config/sparc/netbsd-elf.h:125 config/sparc/netbsd-elf.h:144
-#: config/sparc/sol2-bi.h:240 config/sparc/sol2-bi.h:250
-msgid "may not use both -m32 and -m64"
-msgstr ""
-
-#: config/mips/mips.h:1183 config/arc/arc.h:61
-msgid "may not use both -EB and -EL"
-msgstr ""
-
-#: config/mips/r3900.h:34
-msgid "-mhard-float not supported"
-msgstr ""
-
-#: config/mips/r3900.h:36
-msgid "-msingle-float and -msoft-float cannot both be specified"
-msgstr ""
-
-#: config/i386/mingw-w64.h:65 config/i386/mingw32.h:85 config/i386/cygwin.h:91
+#: config/i386/mingw-w64.h:61 config/i386/mingw32.h:81 config/i386/cygwin.h:91
msgid "shared and mdll are not compatible"
msgstr ""
-#: gcc.c:820
-msgid "GCC does not support -C or -CC without -E"
-msgstr ""
-
-#: gcc.c:848 java/jvspec.c:80 ada/gcc-interface/lang-specs.h:33
-msgid "-pg and -fomit-frame-pointer are incompatible"
-msgstr ""
-
-#: gcc.c:1033
-msgid "-E or -x required when input is from standard input"
-msgstr ""
-
-#: config/darwin.h:274
+#: config/darwin.h:306
msgid "-current_version only allowed with -dynamiclib"
msgstr ""
-#: config/darwin.h:276
+#: config/darwin.h:308
msgid "-install_name only allowed with -dynamiclib"
msgstr ""
-#: config/darwin.h:281
+#: config/darwin.h:313
msgid "-bundle not allowed with -dynamiclib"
msgstr ""
-#: config/darwin.h:282
+#: config/darwin.h:314
msgid "-bundle_loader not allowed with -dynamiclib"
msgstr ""
-#: config/darwin.h:283
+#: config/darwin.h:315
msgid "-client_name not allowed with -dynamiclib"
msgstr ""
-#: config/darwin.h:288
+#: config/darwin.h:320
msgid "-force_flat_namespace not allowed with -dynamiclib"
msgstr ""
-#: config/darwin.h:290
+#: config/darwin.h:322
msgid "-keep_private_externs not allowed with -dynamiclib"
msgstr ""
-#: config/darwin.h:291
+#: config/darwin.h:323
msgid "-private_bundle not allowed with -dynamiclib"
msgstr ""
-#: ada/gcc-interface/lang-specs.h:34
-msgid "-c or -S required for Ada"
+#: fortran/lang-specs.h:55 fortran/lang-specs.h:69
+msgid "gfortran does not support -E without -cpp"
msgstr ""
-#: config/sparc/sol2-bi.h:212 config/sparc/sol2-bi.h:217
-#: config/sparc/sol2-gld-bi.h:40 config/sparc/sol2-gld-bi.h:45
-msgid "does not support multilib"
+#: config/sh/sh.h:463
+msgid "SH2a does not support little-endian"
msgstr ""
-#: config/rs6000/linux64.h:354 config/rs6000/linux64.h:356
-#: config/rs6000/sysv4.h:908 config/rs6000/sysv4.h:910 config/linux.h:111
-#: config/linux.h:113 config/alpha/linux-elf.h:33 config/alpha/linux-elf.h:35
-msgid "-mglibc and -muclibc used together"
+#: config/rs6000/darwin.h:95
+msgid " conflicting code gen style switches are used"
msgstr ""
-#: config/bfin/elf.h:54
-msgid "no processor type specified for linking"
+#: ada/gcc-interface/lang-specs.h:33 gcc.c:887 java/jvspec.c:81
+msgid "-pg and -fomit-frame-pointer are incompatible"
msgstr ""
-#: config/vxworks.h:71
-msgid "-Xbind-now and -Xbind-lazy are incompatible"
+#: ada/gcc-interface/lang-specs.h:34
+msgid "-c or -S required for Ada"
+msgstr ""
+
+#: config/vax/vax.h:50 config/vax/vax.h:51
+msgid "profiling not supported with -mg\n"
+msgstr ""
+
+#: gcc.c:859
+msgid "GCC does not support -C or -CC without -E"
+msgstr ""
+
+#: gcc.c:1080
+msgid "-E or -x required when input is from standard input"
msgstr ""
#: config/i386/cygwin.h:28
msgid "mno-cygwin and mno-win32 are not compatible"
msgstr ""
-#: fortran/lang-specs.h:55 fortran/lang-specs.h:69
-msgid "gfortran does not support -E without -cpp"
+#: config/bfin/elf.h:54
+msgid "no processor type specified for linking"
msgstr ""
#: config/i386/nwld.h:34
@@ -11874,28 +12427,49 @@ msgstr ""
msgid "-femit-class-file should used along with -fsyntax-only"
msgstr ""
-#: config/sh/sh.h:461
-msgid "SH2a does not support little-endian"
+#: config/s390/tpf.h:119
+msgid "static is not supported on TPF-OS"
+msgstr ""
+
+#: config/rs6000/linux64.h:354 config/rs6000/linux64.h:356
+#: config/alpha/linux-elf.h:33 config/alpha/linux-elf.h:35
+#: config/rs6000/sysv4.h:906 config/rs6000/sysv4.h:908 config/linux.h:111
+#: config/linux.h:113
+msgid "-mglibc and -muclibc used together"
msgstr ""
-#: config/arm/arm.h:148
+#: config/mips/mips.h:1230 config/arc/arc.h:61
+msgid "may not use both -EB and -EL"
+msgstr ""
+
+#: config/arm/arm.h:154
msgid "-msoft-float and -mhard_float may not be used together"
msgstr ""
-#: config/arm/arm.h:150
+#: config/arm/arm.h:156
msgid "-mbig-endian and -mlittle-endian may not be used together"
msgstr ""
-#: config/cris/cris.h:207
-msgid "Do not specify both -march=... and -mcpu=..."
+#: config/vxworks.h:71
+msgid "-Xbind-now and -Xbind-lazy are incompatible"
msgstr ""
-#: config/vax/netbsd-elf.h:47
-msgid "the -shared option is not currently supported for VAX ELF"
+#: config/mips/r3900.h:34
+msgid "-mhard-float not supported"
msgstr ""
-#: config/vax/vax.h:50 config/vax/vax.h:51
-msgid "profiling not supported with -mg\n"
+#: config/mips/r3900.h:36
+msgid "-msingle-float and -msoft-float cannot both be specified"
+msgstr ""
+
+#: config/cris/cris.h:207
+msgid "Do not specify both -march=... and -mcpu=..."
+msgstr ""
+
+#: config/sparc/linux64.h:165 config/sparc/linux64.h:176
+#: config/sparc/netbsd-elf.h:125 config/sparc/netbsd-elf.h:144
+#: config/sparc/sol2-bi.h:240 config/sparc/sol2-bi.h:250
+msgid "may not use both -m32 and -m64"
msgstr ""
#: config/mcore/mcore.h:54
@@ -11910,12 +12484,13 @@ msgstr ""
msgid "cannot use mshared and static together"
msgstr ""
-#: config/s390/tpf.h:119
-msgid "static is not supported on TPF-OS"
+#: config/sparc/sol2-bi.h:212 config/sparc/sol2-bi.h:217
+#: config/sparc/sol2-gld-bi.h:40 config/sparc/sol2-gld-bi.h:45
+msgid "does not support multilib"
msgstr ""
-#: config/rs6000/darwin.h:95
-msgid " conflicting code gen style switches are used"
+#: config/vax/netbsd-elf.h:51
+msgid "the -shared option is not currently supported for VAX ELF"
msgstr ""
#: java/lang.opt:69
@@ -12013,14 +12588,18 @@ msgid "Call a library routine to do integer divisions"
msgstr ""
#: java/lang.opt:197
-msgid "Generated should be loaded by bootstrap loader"
+msgid "Generate code for built-in atomic operations"
msgstr ""
#: java/lang.opt:201
-msgid "Set the source language version"
+msgid "Generated should be loaded by bootstrap loader"
msgstr ""
#: java/lang.opt:205
+msgid "Set the source language version"
+msgstr ""
+
+#: java/lang.opt:209
msgid "Set the target VM version"
msgstr ""
@@ -12301,10 +12880,6 @@ msgstr ""
msgid "Append a second underscore if the name already contains an underscore"
msgstr ""
-#: fortran/lang.opt:353 c.opt:749
-msgid "Use the narrowest integer type possible for enumeration types"
-msgstr ""
-
#: fortran/lang.opt:357
msgid "Apply negative sign to zero values"
msgstr ""
@@ -12704,7 +13279,7 @@ msgid ""
msgstr ""
#: config/s390/s390.opt:87 config/ia64/ia64.opt:115 config/sparc/sparc.opt:95
-#: config/i386/i386.opt:229 config/rs6000/rs6000.opt:234 config/spu/spu.opt:84
+#: config/i386/i386.opt:229 config/rs6000/rs6000.opt:274 config/spu/spu.opt:84
msgid "Schedule code for given CPU"
msgstr ""
@@ -12894,7 +13469,19 @@ msgstr ""
msgid "Don't generate checks for control speculation in selective scheduling"
msgstr ""
-#: config/m32c/m32c.opt:24 config/bfin/bfin.opt:23
+#: config/ia64/ia64.opt:183
+msgid "Enable fused multiply/add and multiply/subtract instructions"
+msgstr ""
+
+#: config/ia64/vms_symvec_libgcc_s.opt:3
+msgid "! It would be better to auto-generate this file."
+msgstr ""
+
+#: config/ia64/vms_symvec_libgcc_s.opt:7
+msgid "SYMBOL_VECTOR=(__divdi3=PROCEDURE)"
+msgstr ""
+
+#: config/m32c/m32c.opt:24 config/bfin/bfin.opt:23 config/mep/mep.opt:138
msgid "Use simulator runtime"
msgstr ""
@@ -12990,7 +13577,7 @@ msgstr ""
msgid "Optimize tail call instructions in assembler and linker"
msgstr ""
-#: config/sparc/sparc.opt:91 config/rs6000/rs6000.opt:230
+#: config/sparc/sparc.opt:91 config/rs6000/rs6000.opt:270
msgid "Use features of and schedule code for given CPU"
msgstr ""
@@ -13218,6 +13805,10 @@ msgstr ""
msgid "Support more than 8192 GOT entries on ColdFire"
msgstr ""
+#: config/m68k/m68k.opt:188
+msgid "Support TLS segment larger than 64K"
+msgstr ""
+
#: config/m68k/ieee.opt:24 config/i386/i386.opt:137
msgid "Use IEEE math for fp comparisons"
msgstr ""
@@ -13387,111 +13978,114 @@ msgstr ""
msgid "Generate cld instruction in the function prologue."
msgstr ""
-#: config/i386/i386.opt:252
-msgid ""
-"Enable automatic generation of fused floating point multiply-add instructions"
-msgstr ""
-
-#: config/i386/i386.opt:260
+#: config/i386/i386.opt:251
msgid "Generate 32bit i386 code"
msgstr ""
-#: config/i386/i386.opt:264
+#: config/i386/i386.opt:255
msgid "Generate 64bit x86-64 code"
msgstr ""
-#: config/i386/i386.opt:268
+#: config/i386/i386.opt:259
msgid "Support MMX built-in functions"
msgstr ""
-#: config/i386/i386.opt:272
+#: config/i386/i386.opt:263
msgid "Support 3DNow! built-in functions"
msgstr ""
-#: config/i386/i386.opt:276
+#: config/i386/i386.opt:267
msgid "Support Athlon 3Dnow! built-in functions"
msgstr ""
-#: config/i386/i386.opt:280
+#: config/i386/i386.opt:271
msgid "Support MMX and SSE built-in functions and code generation"
msgstr ""
-#: config/i386/i386.opt:284
+#: config/i386/i386.opt:275
msgid "Support MMX, SSE and SSE2 built-in functions and code generation"
msgstr ""
-#: config/i386/i386.opt:288
+#: config/i386/i386.opt:279
msgid "Support MMX, SSE, SSE2 and SSE3 built-in functions and code generation"
msgstr ""
-#: config/i386/i386.opt:292
+#: config/i386/i386.opt:283
msgid ""
"Support MMX, SSE, SSE2, SSE3 and SSSE3 built-in functions and code generation"
msgstr ""
-#: config/i386/i386.opt:296
+#: config/i386/i386.opt:287
msgid ""
"Support MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1 built-in functions and code "
"generation"
msgstr ""
-#: config/i386/i386.opt:300 config/i386/i386.opt:304
+#: config/i386/i386.opt:291 config/i386/i386.opt:295
msgid ""
"Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1 and SSE4.2 built-in functions "
"and code generation"
msgstr ""
-#: config/i386/i386.opt:308
+#: config/i386/i386.opt:299
msgid "Do not support SSE4.1 and SSE4.2 built-in functions and code generation"
msgstr ""
-#: config/i386/i386.opt:312
+#: config/i386/i386.opt:303
msgid ""
"Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2 and AVX built-in "
"functions and code generation"
msgstr ""
-#: config/i386/i386.opt:316
+#: config/i386/i386.opt:307
msgid ""
"Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX and FMA built-in "
"functions and code generation"
msgstr ""
-#: config/i386/i386.opt:320
+#: config/i386/i386.opt:311
msgid ""
"Support MMX, SSE, SSE2, SSE3 and SSE4A built-in functions and code generation"
msgstr ""
-#: config/i386/i386.opt:324
-msgid "Support SSE5 built-in functions and code generation"
+#: config/i386/i386.opt:315
+msgid "Support FMA4 built-in functions and code generation "
msgstr ""
-#: config/i386/i386.opt:328
+#: config/i386/i386.opt:319
msgid ""
"Support code generation of Advanced Bit Manipulation (ABM) instructions."
msgstr ""
-#: config/i386/i386.opt:332
+#: config/i386/i386.opt:323
msgid "Support code generation of popcnt instruction."
msgstr ""
-#: config/i386/i386.opt:336
+#: config/i386/i386.opt:327
msgid "Support code generation of cmpxchg16b instruction."
msgstr ""
-#: config/i386/i386.opt:340
+#: config/i386/i386.opt:331
msgid "Support code generation of sahf instruction in 64bit x86-64 code."
msgstr ""
-#: config/i386/i386.opt:344
+#: config/i386/i386.opt:335
+msgid "Support code generation of movbe instruction."
+msgstr ""
+
+#: config/i386/i386.opt:339
+msgid "Support code generation of crc32 instruction."
+msgstr ""
+
+#: config/i386/i386.opt:343
msgid "Support AES built-in functions and code generation"
msgstr ""
-#: config/i386/i386.opt:348
+#: config/i386/i386.opt:347
msgid "Support PCLMUL built-in functions and code generation"
msgstr ""
-#: config/i386/i386.opt:352
+#: config/i386/i386.opt:351
msgid "Encode SSE instructions with VEX prefix"
msgstr ""
@@ -13523,11 +14117,15 @@ msgstr ""
msgid "Create GUI application"
msgstr ""
+#: config/i386/cygming.opt:51
+msgid "Use the GNU extension to the PE format for aligned common data"
+msgstr ""
+
#: config/i386/mingw-w64.opt:23
msgid "Use unicode startup and define UNICODE macro"
msgstr ""
-#: config/rs6000/aix.opt:24 config/rs6000/rs6000.opt:155
+#: config/rs6000/aix.opt:24 config/rs6000/rs6000.opt:195
msgid "Conform more closely to IBM XLC semantics"
msgstr ""
@@ -13632,166 +14230,170 @@ msgid "Do not use hardware floating point"
msgstr ""
#: config/rs6000/rs6000.opt:116
-msgid "Do not generate load/store with update instructions"
+msgid "Use PowerPC V2.06 popcntd instruction"
msgstr ""
#: config/rs6000/rs6000.opt:120
-msgid "Generate load/store with update instructions"
+msgid "Use vector/scalar (VSX) instructions"
msgstr ""
-#: config/rs6000/rs6000.opt:124
-msgid "Avoid generation of indexed load/store instructions when possible"
+#: config/rs6000/rs6000.opt:160
+msgid "Do not generate load/store with update instructions"
+msgstr ""
+
+#: config/rs6000/rs6000.opt:164
+msgid "Generate load/store with update instructions"
msgstr ""
-#: config/rs6000/rs6000.opt:128
-msgid "Do not generate fused multiply/add instructions"
+#: config/rs6000/rs6000.opt:168
+msgid "Avoid generation of indexed load/store instructions when possible"
msgstr ""
-#: config/rs6000/rs6000.opt:132
+#: config/rs6000/rs6000.opt:172
msgid "Generate fused multiply/add instructions"
msgstr ""
-#: config/rs6000/rs6000.opt:136
+#: config/rs6000/rs6000.opt:176
msgid "Mark __tls_get_addr calls with argument info"
msgstr ""
-#: config/rs6000/rs6000.opt:140
+#: config/rs6000/rs6000.opt:183
msgid "Schedule the start and end of the procedure"
msgstr ""
-#: config/rs6000/rs6000.opt:147
+#: config/rs6000/rs6000.opt:187
msgid "Return all structures in memory (AIX default)"
msgstr ""
-#: config/rs6000/rs6000.opt:151
+#: config/rs6000/rs6000.opt:191
msgid "Return small structures in registers (SVR4 default)"
msgstr ""
-#: config/rs6000/rs6000.opt:159
+#: config/rs6000/rs6000.opt:199
msgid "Generate software reciprocal sqrt for better throughput"
msgstr ""
-#: config/rs6000/rs6000.opt:163
+#: config/rs6000/rs6000.opt:203
msgid "Do not place floating point constants in TOC"
msgstr ""
-#: config/rs6000/rs6000.opt:167
+#: config/rs6000/rs6000.opt:207
msgid "Place floating point constants in TOC"
msgstr ""
-#: config/rs6000/rs6000.opt:171
+#: config/rs6000/rs6000.opt:211
msgid "Do not place symbol+offset constants in TOC"
msgstr ""
-#: config/rs6000/rs6000.opt:175
+#: config/rs6000/rs6000.opt:215
msgid "Place symbol+offset constants in TOC"
msgstr ""
-#: config/rs6000/rs6000.opt:186
+#: config/rs6000/rs6000.opt:226
msgid "Use only one TOC entry per procedure"
msgstr ""
-#: config/rs6000/rs6000.opt:190
+#: config/rs6000/rs6000.opt:230
msgid "Put everything in the regular TOC"
msgstr ""
-#: config/rs6000/rs6000.opt:194
+#: config/rs6000/rs6000.opt:234
msgid "Generate VRSAVE instructions when generating AltiVec code"
msgstr ""
-#: config/rs6000/rs6000.opt:198
+#: config/rs6000/rs6000.opt:238
msgid "Deprecated option. Use -mvrsave/-mno-vrsave instead"
msgstr ""
-#: config/rs6000/rs6000.opt:202
+#: config/rs6000/rs6000.opt:242
msgid "Generate isel instructions"
msgstr ""
-#: config/rs6000/rs6000.opt:206
+#: config/rs6000/rs6000.opt:246
msgid "Deprecated option. Use -misel/-mno-isel instead"
msgstr ""
-#: config/rs6000/rs6000.opt:210
+#: config/rs6000/rs6000.opt:250
msgid "Generate SPE SIMD instructions on E500"
msgstr ""
-#: config/rs6000/rs6000.opt:214
+#: config/rs6000/rs6000.opt:254
msgid "Generate PPC750CL paired-single instructions"
msgstr ""
-#: config/rs6000/rs6000.opt:218
+#: config/rs6000/rs6000.opt:258
msgid "Deprecated option. Use -mspe/-mno-spe instead"
msgstr ""
-#: config/rs6000/rs6000.opt:222
+#: config/rs6000/rs6000.opt:262
msgid "Enable debug output"
msgstr ""
-#: config/rs6000/rs6000.opt:226
+#: config/rs6000/rs6000.opt:266
msgid "Specify ABI to use"
msgstr ""
-#: config/rs6000/rs6000.opt:238
+#: config/rs6000/rs6000.opt:278
msgid "Select full, part, or no traceback table"
msgstr ""
-#: config/rs6000/rs6000.opt:242
+#: config/rs6000/rs6000.opt:282
msgid "Avoid all range limits on call instructions"
msgstr ""
-#: config/rs6000/rs6000.opt:246
+#: config/rs6000/rs6000.opt:286
msgid "Generate Cell microcode"
msgstr ""
-#: config/rs6000/rs6000.opt:250
+#: config/rs6000/rs6000.opt:290
msgid "Warn when a Cell microcoded instruction is emitted"
msgstr ""
-#: config/rs6000/rs6000.opt:254
+#: config/rs6000/rs6000.opt:294
msgid "Warn about deprecated 'vector long ...' AltiVec type usage"
msgstr ""
-#: config/rs6000/rs6000.opt:258
+#: config/rs6000/rs6000.opt:298
msgid "Select GPR floating point method"
msgstr ""
-#: config/rs6000/rs6000.opt:262
+#: config/rs6000/rs6000.opt:302
msgid "Specify size of long double (64 or 128 bits)"
msgstr ""
-#: config/rs6000/rs6000.opt:266
+#: config/rs6000/rs6000.opt:306
msgid "Determine which dependences between insns are considered costly"
msgstr ""
-#: config/rs6000/rs6000.opt:270
+#: config/rs6000/rs6000.opt:310
msgid "Specify which post scheduling nop insertion scheme to apply"
msgstr ""
-#: config/rs6000/rs6000.opt:274
+#: config/rs6000/rs6000.opt:314
msgid "Specify alignment of structure fields default/natural"
msgstr ""
-#: config/rs6000/rs6000.opt:278
+#: config/rs6000/rs6000.opt:318
msgid "Specify scheduling priority for dispatch slot restricted insns"
msgstr ""
-#: config/rs6000/rs6000.opt:282
+#: config/rs6000/rs6000.opt:322
msgid "Single-precision floating point unit"
msgstr ""
-#: config/rs6000/rs6000.opt:286
+#: config/rs6000/rs6000.opt:326
msgid "Double-precision floating point unit"
msgstr ""
-#: config/rs6000/rs6000.opt:290
+#: config/rs6000/rs6000.opt:330
msgid "Floating point unit does not support divide & sqrt"
msgstr ""
-#: config/rs6000/rs6000.opt:294
+#: config/rs6000/rs6000.opt:334
msgid "Specify FP (sp, dp, sp-lite, dp-lite) (implies -mxilinx-fpu)"
msgstr ""
-#: config/rs6000/rs6000.opt:298
+#: config/rs6000/rs6000.opt:338
msgid "Specify Xilinx FPU."
msgstr ""
@@ -14030,7 +14632,7 @@ msgid "Generate SH2 code"
msgstr ""
#: config/sh/sh.opt:52
-msgid "Generate SH2a code"
+msgid "Generate default double-precision SH2a-FPU code"
msgstr ""
#: config/sh/sh.opt:56
@@ -14038,11 +14640,11 @@ msgid "Generate SH2a FPU-less code"
msgstr ""
#: config/sh/sh.opt:60
-msgid "Generate default single-precision SH2a code"
+msgid "Generate default single-precision SH2a-FPU code"
msgstr ""
#: config/sh/sh.opt:64
-msgid "Generate only single-precision SH2a code"
+msgid "Generate only single-precision SH2a-FPU code"
msgstr ""
#: config/sh/sh.opt:68
@@ -14204,107 +14806,107 @@ msgid "Enable cbranchdi4 pattern"
msgstr ""
#: config/sh/sh.opt:229
-msgid "Expand cbranchdi4 pattern early into separate comparisons and branches."
+msgid "Emit cmpeqdi_t pattern even when -mcbranchdi is in effect."
msgstr ""
#: config/sh/sh.opt:233
-msgid ""
-"Emit cmpeqdi_t pattern even when -mcbranchdi and -mexpand-cbranchdi are in "
-"effect."
-msgstr ""
-
-#: config/sh/sh.opt:237
msgid "Enable SH5 cut2 workaround"
msgstr ""
-#: config/sh/sh.opt:241
+#: config/sh/sh.opt:237
msgid "Align doubles at 64-bit boundaries"
msgstr ""
-#: config/sh/sh.opt:245
+#: config/sh/sh.opt:241
msgid ""
"Division strategy, one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, "
"inv:call, inv:call2, inv:fp, call-div1, call-fp, call-table"
msgstr ""
-#: config/sh/sh.opt:249
+#: config/sh/sh.opt:245
msgid "Specify name for 32 bit signed division function"
msgstr ""
-#: config/sh/sh.opt:260
+#: config/sh/sh.opt:249
+msgid ""
+"Enable the use of 64-bit floating point registers in fmov instructions. See "
+"-mdalign if 64-bit alignment is required."
+msgstr ""
+
+#: config/sh/sh.opt:257
msgid ""
"Enable the use of the fused floating point multiply-accumulate operation"
msgstr ""
-#: config/sh/sh.opt:264
+#: config/sh/sh.opt:261
msgid "Cost to assume for gettr insn"
msgstr ""
-#: config/sh/sh.opt:268 config/sh/sh.opt:318
+#: config/sh/sh.opt:265 config/sh/sh.opt:315
msgid "Follow Renesas (formerly Hitachi) / SuperH calling conventions"
msgstr ""
-#: config/sh/sh.opt:272
+#: config/sh/sh.opt:269
msgid "Increase the IEEE compliance for floating-point code"
msgstr ""
-#: config/sh/sh.opt:276
+#: config/sh/sh.opt:273
msgid "Enable the use of the indexed addressing mode for SHmedia32/SHcompact"
msgstr ""
-#: config/sh/sh.opt:280
+#: config/sh/sh.opt:277
msgid ""
"inline code to invalidate instruction cache entries after setting up nested "
"function trampolines"
msgstr ""
-#: config/sh/sh.opt:284
+#: config/sh/sh.opt:281
msgid "Assume symbols might be invalid"
msgstr ""
-#: config/sh/sh.opt:288
+#: config/sh/sh.opt:285
msgid "Annotate assembler instructions with estimated addresses"
msgstr ""
-#: config/sh/sh.opt:292
+#: config/sh/sh.opt:289
msgid "Generate code in little endian mode"
msgstr ""
-#: config/sh/sh.opt:296
+#: config/sh/sh.opt:293
msgid "Mark MAC register as call-clobbered"
msgstr ""
-#: config/sh/sh.opt:302
+#: config/sh/sh.opt:299
msgid "Make structs a multiple of 4 bytes (warning: ABI altered)"
msgstr ""
-#: config/sh/sh.opt:306
+#: config/sh/sh.opt:303
msgid "Emit function-calls using global offset table when generating PIC"
msgstr ""
-#: config/sh/sh.opt:310
+#: config/sh/sh.opt:307
msgid "Assume pt* instructions won't trap"
msgstr ""
-#: config/sh/sh.opt:314
+#: config/sh/sh.opt:311
msgid "Shorten address references during linking"
msgstr ""
-#: config/sh/sh.opt:322
-msgid "Deprecated. Use -Os instead"
+#: config/sh/sh.opt:319
+msgid "Deprecated. Use -Os instead"
msgstr ""
-#: config/sh/sh.opt:326
+#: config/sh/sh.opt:323
msgid "Cost to assume for a multiply insn"
msgstr ""
-#: config/sh/sh.opt:330
+#: config/sh/sh.opt:327
msgid ""
"Don't generate privileged-mode only code; implies -mno-inline-ic_invalidate "
"if the inline code would not work in user mode."
msgstr ""
-#: config/sh/sh.opt:336
+#: config/sh/sh.opt:333
msgid "Pretend a branch-around-a-move is a conditional move."
msgstr ""
@@ -14364,84 +14966,88 @@ msgstr ""
msgid "Specify if floating point hardware should be used"
msgstr ""
-#: config/arm/arm.opt:90
-msgid "Specify the name of the target floating point hardware/format"
+#: config/arm/arm.opt:83
+msgid "Specify the __fp16 floating-point format"
msgstr ""
#: config/arm/arm.opt:94
-msgid "Alias for -mfloat-abi=hard"
+msgid "Specify the name of the target floating point hardware/format"
msgstr ""
#: config/arm/arm.opt:98
-msgid "Assume target CPU is configured as little endian"
+msgid "Alias for -mfloat-abi=hard"
msgstr ""
#: config/arm/arm.opt:102
-msgid "Generate call insns as indirect calls, if necessary"
+msgid "Assume target CPU is configured as little endian"
msgstr ""
#: config/arm/arm.opt:106
-msgid "Specify the register to be used for PIC addressing"
+msgid "Generate call insns as indirect calls, if necessary"
msgstr ""
#: config/arm/arm.opt:110
-msgid "Store function names in object code"
+msgid "Specify the register to be used for PIC addressing"
msgstr ""
#: config/arm/arm.opt:114
-msgid "Permit scheduling of a function's prologue sequence"
+msgid "Store function names in object code"
msgstr ""
#: config/arm/arm.opt:118
-msgid "Do not load the PIC register in function prologues"
+msgid "Permit scheduling of a function's prologue sequence"
msgstr ""
#: config/arm/arm.opt:122
-msgid "Alias for -mfloat-abi=soft"
+msgid "Do not load the PIC register in function prologues"
msgstr ""
#: config/arm/arm.opt:126
-msgid "Specify the minimum bit alignment of structures"
+msgid "Alias for -mfloat-abi=soft"
msgstr ""
#: config/arm/arm.opt:130
-msgid "Compile for the Thumb not the ARM"
+msgid "Specify the minimum bit alignment of structures"
msgstr ""
#: config/arm/arm.opt:134
-msgid "Support calls between Thumb and ARM instruction sets"
+msgid "Compile for the Thumb not the ARM"
msgstr ""
#: config/arm/arm.opt:138
-msgid "Specify how to access the thread pointer"
+msgid "Support calls between Thumb and ARM instruction sets"
msgstr ""
#: config/arm/arm.opt:142
-msgid "Thumb: Generate (non-leaf) stack frames even if not needed"
+msgid "Specify how to access the thread pointer"
msgstr ""
#: config/arm/arm.opt:146
-msgid "Thumb: Generate (leaf) stack frames even if not needed"
+msgid "Thumb: Generate (non-leaf) stack frames even if not needed"
msgstr ""
#: config/arm/arm.opt:150
-msgid "Tune code for the given processor"
+msgid "Thumb: Generate (leaf) stack frames even if not needed"
msgstr ""
#: config/arm/arm.opt:154
-msgid "Assume big endian bytes, little endian words"
+msgid "Tune code for the given processor"
msgstr ""
#: config/arm/arm.opt:158
+msgid "Assume big endian bytes, little endian words"
+msgstr ""
+
+#: config/arm/arm.opt:162
msgid ""
"Use Neon quad-word (rather than double-word) registers for vectorization"
msgstr ""
-#: config/arm/arm.opt:162
+#: config/arm/arm.opt:166
msgid "Only generate absolute relocations on word sized values."
msgstr ""
-#: config/arm/arm.opt:166
+#: config/arm/arm.opt:170
msgid ""
"Avoid overlapping destination and address registers on LDRD instructions"
msgstr ""
@@ -14535,18 +15141,14 @@ msgid "Use rjmp/rcall (limited range) on >8K devices"
msgstr ""
#: config/avr/avr.opt:52
-msgid "Output instruction sizes to the asm file"
-msgstr ""
-
-#: config/avr/avr.opt:56
msgid "Change only the low 8 bits of the stack pointer"
msgstr ""
-#: config/avr/avr.opt:60
+#: config/avr/avr.opt:56
msgid "Relax branches"
msgstr ""
-#: config/avr/avr.opt:64
+#: config/avr/avr.opt:60
msgid ""
"Make the linker relaxation machine assume that a program counter wrap-around "
"occures."
@@ -14737,11 +15339,11 @@ msgstr ""
msgid "Use MIPS-DSP REV 2 instructions"
msgstr ""
-#: config/mips/mips.opt:89
+#: config/mips/mips.opt:89 config/mep/mep.opt:80
msgid "Use big-endian byte order"
msgstr ""
-#: config/mips/mips.opt:93
+#: config/mips/mips.opt:93 config/mep/mep.opt:84
msgid "Use little-endian byte order"
msgstr ""
@@ -14900,45 +15502,53 @@ msgid "Specify when r10k cache barriers should be inserted"
msgstr ""
#: config/mips/mips.opt:249
+msgid "Try to allow the linker to turn PIC calls into direct calls"
+msgstr ""
+
+#: config/mips/mips.opt:253
msgid ""
"When generating -mabicalls code, make the code suitable for use in shared "
"libraries"
msgstr ""
-#: config/mips/mips.opt:253
+#: config/mips/mips.opt:257
msgid ""
"Restrict the use of hardware floating-point instructions to 32-bit operations"
msgstr ""
-#: config/mips/mips.opt:257
+#: config/mips/mips.opt:261
msgid "Use SmartMIPS instructions"
msgstr ""
-#: config/mips/mips.opt:261
+#: config/mips/mips.opt:265
msgid "Prevent the use of all hardware floating-point instructions"
msgstr ""
-#: config/mips/mips.opt:265
+#: config/mips/mips.opt:269
msgid "Optimize lui/addiu address loads"
msgstr ""
-#: config/mips/mips.opt:269
+#: config/mips/mips.opt:273
msgid "Assume all symbols have 32-bit values"
msgstr ""
-#: config/mips/mips.opt:273
+#: config/mips/mips.opt:277
+msgid "Use synci instruction to invalidate i-cache"
+msgstr ""
+
+#: config/mips/mips.opt:281
msgid "Optimize the output for PROCESSOR"
msgstr ""
-#: config/mips/mips.opt:277 config/iq2000/iq2000.opt:44
+#: config/mips/mips.opt:285 config/iq2000/iq2000.opt:44
msgid "Put uninitialized constants in ROM (needs -membedded-data)"
msgstr ""
-#: config/mips/mips.opt:281
+#: config/mips/mips.opt:289
msgid "Perform VR4130-specific alignment optimizations"
msgstr ""
-#: config/mips/mips.opt:285
+#: config/mips/mips.opt:293
msgid "Lift restrictions on GOT size"
msgstr ""
@@ -15463,11 +16073,131 @@ msgid "Support SCORE 3d ISA"
msgstr ""
#: config/linux.opt:24
-msgid "Use uClibc instead of GNU libc"
+msgid "Use GNU libc instead of uClibc"
msgstr ""
#: config/linux.opt:28
-msgid "Use GNU libc instead of uClibc"
+msgid "Use uClibc instead of GNU libc"
+msgstr ""
+
+#: config/mep/mep.opt:21
+msgid "Enable absolute difference instructions"
+msgstr ""
+
+#: config/mep/mep.opt:25
+msgid "Enable all optional instructions"
+msgstr ""
+
+#: config/mep/mep.opt:29
+msgid "Enable average instructions"
+msgstr ""
+
+#: config/mep/mep.opt:33
+msgid "Variables this size and smaller go in the based section. (default 0)"
+msgstr ""
+
+#: config/mep/mep.opt:37
+msgid "Enable bit manipulation instructions"
+msgstr ""
+
+#: config/mep/mep.opt:41
+msgid "Section to put all const variables in (tiny, near, far) (no default)"
+msgstr ""
+
+#: config/mep/mep.opt:45
+msgid "Enable clip instructions"
+msgstr ""
+
+#: config/mep/mep.opt:49
+msgid "Configuration name"
+msgstr ""
+
+#: config/mep/mep.opt:53
+msgid "Enable MeP Coprocessor"
+msgstr ""
+
+#: config/mep/mep.opt:57
+msgid "Enable MeP Coprocessor with 32-bit registers"
+msgstr ""
+
+#: config/mep/mep.opt:61
+msgid "Enable MeP Coprocessor with 64-bit registers"
+msgstr ""
+
+#: config/mep/mep.opt:65
+msgid "Enable IVC2 scheduling"
+msgstr ""
+
+#: config/mep/mep.opt:69
+msgid "Const variables default to the near section"
+msgstr ""
+
+#: config/mep/mep.opt:76
+msgid "Enable 32-bit divide instructions"
+msgstr ""
+
+#: config/mep/mep.opt:88
+msgid "__io vars are volatile by default"
+msgstr ""
+
+#: config/mep/mep.opt:92
+msgid "All variables default to the far section"
+msgstr ""
+
+#: config/mep/mep.opt:96
+msgid "Enable leading zero instructions"
+msgstr ""
+
+#: config/mep/mep.opt:103
+msgid "All variables default to the near section"
+msgstr ""
+
+#: config/mep/mep.opt:107
+msgid "Enable min/max instructions"
+msgstr ""
+
+#: config/mep/mep.opt:111
+msgid "Enable 32-bit multiply instructions"
+msgstr ""
+
+#: config/mep/mep.opt:115
+msgid "Disable all optional instructions"
+msgstr ""
+
+#: config/mep/mep.opt:122
+msgid "Allow gcc to use the repeat/erepeat instructions"
+msgstr ""
+
+#: config/mep/mep.opt:126
+msgid "All variables default to the tiny section"
+msgstr ""
+
+#: config/mep/mep.opt:130
+msgid "Enable saturation instructions"
+msgstr ""
+
+#: config/mep/mep.opt:134
+msgid "Use sdram version of runtime"
+msgstr ""
+
+#: config/mep/mep.opt:142
+msgid "Use simulator runtime without vectors"
+msgstr ""
+
+#: config/mep/mep.opt:146
+msgid "All functions default to the far section"
+msgstr ""
+
+#: config/mep/mep.opt:150
+msgid "Variables this size and smaller go in the tiny section. (default 4)"
+msgstr ""
+
+#: config/vms/vms.opt:21
+msgid "Malloc data into P2 space"
+msgstr ""
+
+#: config/vms/vms.opt:25
+msgid "Set name of main routine for the debugger"
msgstr ""
#: c.opt:42
@@ -15498,7 +16228,7 @@ msgstr ""
msgid "Print the name of header files as they are used"
msgstr ""
-#: c.opt:69 c.opt:894
+#: c.opt:69 c.opt:906
msgid "Add <dir> to the end of the main include path"
msgstr ""
@@ -15713,653 +16443,689 @@ msgid "Warn about PCH files that are found but not used"
msgstr ""
#: c.opt:289
+msgid "Warn when a jump misses a variable initialization"
+msgstr ""
+
+#: c.opt:293
msgid ""
"Warn when a logical operator is suspiciously always evaluating to true or "
"false"
msgstr ""
-#: c.opt:293
+#: c.opt:297
msgid "Do not warn about using \"long long\" when -pedantic"
msgstr ""
-#: c.opt:297
+#: c.opt:301
msgid "Warn about suspicious declarations of \"main\""
msgstr ""
-#: c.opt:301
+#: c.opt:305
msgid "Warn about possibly missing braces around initializers"
msgstr ""
-#: c.opt:305
+#: c.opt:309
msgid "Warn about global functions without previous declarations"
msgstr ""
-#: c.opt:309
+#: c.opt:313
msgid "Warn about missing fields in struct initializers"
msgstr ""
-#: c.opt:313
+#: c.opt:317
msgid "Warn about functions which might be candidates for format attributes"
msgstr ""
-#: c.opt:317
+#: c.opt:321
msgid "Warn about user-specified include directories that do not exist"
msgstr ""
-#: c.opt:321
+#: c.opt:325
msgid ""
"Warn about function parameters declared without a type specifier in K&R-"
"style functions"
msgstr ""
-#: c.opt:325
+#: c.opt:329
msgid "Warn about global functions without prototypes"
msgstr ""
-#: c.opt:329
+#: c.opt:333
msgid "Warn about use of multi-character character constants"
msgstr ""
-#: c.opt:333
+#: c.opt:337
msgid "Warn about \"extern\" declarations not at file scope"
msgstr ""
-#: c.opt:337
+#: c.opt:341
msgid ""
"Warn when non-templatized friend functions are declared within a template"
msgstr ""
-#: c.opt:341
+#: c.opt:345
msgid "Warn about non-virtual destructors"
msgstr ""
-#: c.opt:345
+#: c.opt:349
msgid ""
"Warn about NULL being passed to argument slots marked as requiring non-NULL"
msgstr ""
-#: c.opt:349
+#: c.opt:353
msgid "Warn about non-normalised Unicode strings"
msgstr ""
-#: c.opt:353
+#: c.opt:357
msgid "Warn if a C-style cast is used in a program"
msgstr ""
-#: c.opt:357
+#: c.opt:361
msgid "Warn for obsolescent usage in a declaration"
msgstr ""
-#: c.opt:361
+#: c.opt:365
msgid "Warn if an old-style parameter definition is used"
msgstr ""
-#: c.opt:365
+#: c.opt:369
msgid ""
"Warn if a string is longer than the maximum portable length specified by the "
"standard"
msgstr ""
-#: c.opt:369
+#: c.opt:373
msgid "Warn about overloaded virtual function names"
msgstr ""
-#: c.opt:373
+#: c.opt:377
msgid "Warn about overriding initializers without side effects"
msgstr ""
-#: c.opt:377
+#: c.opt:381
msgid "Warn about packed bit-fields whose offset changed in GCC 4.4"
msgstr ""
-#: c.opt:381
+#: c.opt:385
msgid "Warn about possibly missing parentheses"
msgstr ""
-#: c.opt:385
+#: c.opt:389
msgid "Warn when converting the type of pointers to member functions"
msgstr ""
-#: c.opt:389
+#: c.opt:393
msgid "Warn about function pointer arithmetic"
msgstr ""
-#: c.opt:393
+#: c.opt:397
msgid "Warn when a pointer is cast to an integer of a different size"
msgstr ""
-#: c.opt:397
+#: c.opt:401
msgid "Warn about misuses of pragmas"
msgstr ""
-#: c.opt:401
+#: c.opt:405
msgid "Warn if inherited methods are unimplemented"
msgstr ""
-#: c.opt:405
+#: c.opt:409
msgid "Warn about multiple declarations of the same object"
msgstr ""
-#: c.opt:409
+#: c.opt:413
msgid "Warn when the compiler reorders code"
msgstr ""
-#: c.opt:413
+#: c.opt:417
msgid ""
"Warn whenever a function's return type defaults to \"int\" (C), or about "
"inconsistent return types (C++)"
msgstr ""
-#: c.opt:417
+#: c.opt:421
msgid "Warn if a selector has multiple methods"
msgstr ""
-#: c.opt:421
+#: c.opt:425
msgid "Warn about possible violations of sequence point rules"
msgstr ""
-#: c.opt:425
+#: c.opt:429
msgid "Warn about signed-unsigned comparisons"
msgstr ""
-#: c.opt:429
+#: c.opt:433
msgid "Warn when overload promotes from unsigned to signed"
msgstr ""
-#: c.opt:433
+#: c.opt:437
msgid "Warn about uncasted NULL used as sentinel"
msgstr ""
-#: c.opt:437
+#: c.opt:441
msgid "Warn about unprototyped function declarations"
msgstr ""
-#: c.opt:441
+#: c.opt:445
msgid "Warn if type signatures of candidate methods do not match exactly"
msgstr ""
-#: c.opt:445
+#: c.opt:449
msgid ""
"Warn when __sync_fetch_and_nand and __sync_nand_and_fetch built-in functions "
"are used"
msgstr ""
-#: c.opt:449
+#: c.opt:453
msgid "Deprecated. This switch has no effect"
msgstr ""
-#: c.opt:457
+#: c.opt:461
msgid "Warn about features not present in traditional C"
msgstr ""
-#: c.opt:461
+#: c.opt:465
msgid ""
"Warn of prototypes causing type conversions different from what would happen "
"in the absence of prototype"
msgstr ""
-#: c.opt:465
+#: c.opt:469
msgid ""
"Warn if trigraphs are encountered that might affect the meaning of the "
"program"
msgstr ""
-#: c.opt:469
+#: c.opt:473
msgid "Warn about @selector()s without previously declared methods"
msgstr ""
-#: c.opt:473
+#: c.opt:477
msgid "Warn if an undefined macro is used in an #if directive"
msgstr ""
-#: c.opt:477
+#: c.opt:481
msgid "Warn about unrecognized pragmas"
msgstr ""
-#: c.opt:481
+#: c.opt:485
msgid "Warn about unsuffixed float constants"
msgstr ""
-#: c.opt:485
+#: c.opt:489
msgid "Warn about macros defined in the main file that are not used"
msgstr ""
-#: c.opt:489
+#: c.opt:493
+msgid ""
+"Warn if a caller of a function, marked with attribute warn_unused_result, "
+"does not use its return value"
+msgstr ""
+
+#: c.opt:497
msgid "Do not warn about using variadic macros when -pedantic"
msgstr ""
-#: c.opt:493
+#: c.opt:501
msgid "Warn if a variable length array is used"
msgstr ""
-#: c.opt:497
+#: c.opt:505
msgid "Warn when a register variable is declared volatile"
msgstr ""
-#: c.opt:501
+#: c.opt:509
msgid ""
"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."
msgstr ""
-#: c.opt:505
+#: c.opt:513
msgid "Warn when a pointer differs in signedness in an assignment"
msgstr ""
-#: c.opt:509
+#: c.opt:517
msgid "A synonym for -std=c89 (for C) or -std=c++98 (for C++)"
msgstr ""
-#: c.opt:517
+#: c.opt:525
msgid "Enforce class member access control semantics"
msgstr ""
-#: c.opt:524
+#: c.opt:532
msgid "Change when template instances are emitted"
msgstr ""
-#: c.opt:528
+#: c.opt:536
msgid "Recognize the \"asm\" keyword"
msgstr ""
-#: c.opt:532
+#: c.opt:540
msgid "Recognize built-in functions"
msgstr ""
-#: c.opt:539
+#: c.opt:547
msgid "Check the return value of new"
msgstr ""
-#: c.opt:543
+#: c.opt:551
msgid "Allow the arguments of the '?' operator to have different types"
msgstr ""
-#: c.opt:547
+#: c.opt:555
msgid "Reduce the size of object files"
msgstr ""
-#: c.opt:551
+#: c.opt:559
msgid "Use class <name> for constant strings"
msgstr ""
-#: c.opt:555
+#: c.opt:563
+msgid ""
+"disable deduction of std::initializer_list for a template type parameter "
+"from a brace-enclosed initializer-list"
+msgstr ""
+
+#: c.opt:567
msgid "Inline member functions by default"
msgstr ""
-#: c.opt:559
+#: c.opt:571
msgid "Preprocess directives only."
msgstr ""
-#: c.opt:563
+#: c.opt:575
msgid "Permit '$' as an identifier character"
msgstr ""
-#: c.opt:570
+#: c.opt:582
msgid "Generate code to check exception specifications"
msgstr ""
-#: c.opt:577
+#: c.opt:589
msgid "Convert all strings and character constants to character set <cset>"
msgstr ""
-#: c.opt:581
+#: c.opt:593
msgid "Permit universal character names (\\u and \\U) in identifiers"
msgstr ""
-#: c.opt:585
+#: c.opt:597
msgid "Specify the default character set for source files"
msgstr ""
-#: c.opt:593
+#: c.opt:605
msgid "Scope of for-init-statement variables is local to the loop"
msgstr ""
-#: c.opt:597
+#: c.opt:609
msgid "Do not assume that standard C libraries and \"main\" exist"
msgstr ""
-#: c.opt:601
+#: c.opt:613
msgid "Recognize GNU-defined keywords"
msgstr ""
-#: c.opt:605
+#: c.opt:617
msgid "Generate code for GNU runtime environment"
msgstr ""
-#: c.opt:609
+#: c.opt:621
msgid "Use traditional GNU semantics for inline functions"
msgstr ""
-#: c.opt:622
+#: c.opt:634
msgid "Assume normal C execution environment"
msgstr ""
-#: c.opt:626
+#: c.opt:638
msgid "Enable support for huge objects"
msgstr ""
-#: c.opt:630
+#: c.opt:642
msgid "Export functions even if they can be inlined"
msgstr ""
-#: c.opt:634
+#: c.opt:646
msgid "Emit implicit instantiations of inline templates"
msgstr ""
-#: c.opt:638
+#: c.opt:650
msgid "Emit implicit instantiations of templates"
msgstr ""
-#: c.opt:642
+#: c.opt:654
msgid "Inject friend functions into enclosing namespace"
msgstr ""
-#: c.opt:649
+#: c.opt:661
msgid ""
"Allow implicit conversions between vectors with differing numbers of "
"subparts and/or differing element types."
msgstr ""
-#: c.opt:653
+#: c.opt:665
msgid "Don't warn about uses of Microsoft extensions"
msgstr ""
-#: c.opt:663
+#: c.opt:675
msgid "Generate code for NeXT (Apple Mac OS X) runtime environment"
msgstr ""
-#: c.opt:667
+#: c.opt:679
msgid "Assume that receivers of Objective-C messages may be nil"
msgstr ""
-#: c.opt:679
+#: c.opt:691
msgid ""
"Generate special Objective-C methods to initialize/destroy non-POD C++ "
"ivars, if needed"
msgstr ""
-#: c.opt:683
+#: c.opt:695
msgid "Allow fast jumps to the message dispatcher"
msgstr ""
-#: c.opt:689
+#: c.opt:701
msgid "Enable Objective-C exception and synchronization syntax"
msgstr ""
-#: c.opt:693
+#: c.opt:705
msgid "Enable garbage collection (GC) in Objective-C/Objective-C++ programs"
msgstr ""
-#: c.opt:698
+#: c.opt:710
msgid "Enable Objective-C setjmp exception handling runtime"
msgstr ""
-#: c.opt:702
+#: c.opt:714
msgid "Enable OpenMP (implies -frecursive in Fortran)"
msgstr ""
-#: c.opt:706
+#: c.opt:718
msgid "Recognize C++ keywords like \"compl\" and \"xor\""
msgstr ""
-#: c.opt:710
+#: c.opt:722
msgid "Enable optional diagnostics"
msgstr ""
-#: c.opt:717
+#: c.opt:729
msgid "Look for and use PCH files even when preprocessing"
msgstr ""
-#: c.opt:721
+#: c.opt:733
msgid "Downgrade conformance errors to warnings"
msgstr ""
-#: c.opt:725
+#: c.opt:737
msgid "Treat the input file as already preprocessed"
msgstr ""
-#: c.opt:729
+#: c.opt:741
msgid ""
"-fno-pretty-templates Do not pretty-print template specializations as the "
"template signature followed by the arguments"
msgstr ""
-#: c.opt:733
+#: c.opt:745
msgid ""
"Used in Fix-and-Continue mode to indicate that object files may be swapped "
"in at runtime"
msgstr ""
-#: c.opt:737
+#: c.opt:749
msgid "Enable automatic template instantiation"
msgstr ""
-#: c.opt:741
+#: c.opt:753
msgid "Generate run time type descriptor information"
msgstr ""
-#: c.opt:745
+#: c.opt:757
msgid "Use the same size for double as for float"
msgstr ""
-#: c.opt:753
+#: c.opt:761
+msgid "Use the narrowest integer type possible for enumeration types"
+msgstr ""
+
+#: c.opt:765
msgid "Force the underlying type for \"wchar_t\" to be \"unsigned short\""
msgstr ""
-#: c.opt:757
+#: c.opt:769
msgid "When \"signed\" or \"unsigned\" is not given make the bitfield signed"
msgstr ""
-#: c.opt:761
+#: c.opt:773
msgid "Make \"char\" signed by default"
msgstr ""
-#: c.opt:768
+#: c.opt:780
msgid "Display statistics accumulated during compilation"
msgstr ""
-#: c.opt:775
+#: c.opt:787
msgid "Distance between tab stops for column reporting"
msgstr ""
-#: c.opt:779
+#: c.opt:791
msgid "Specify maximum template instantiation depth"
msgstr ""
-#: c.opt:786
+#: c.opt:798
msgid "Do not generate thread-safe code for initializing local statics"
msgstr ""
-#: c.opt:790
+#: c.opt:802
msgid "When \"signed\" or \"unsigned\" is not given make the bitfield unsigned"
msgstr ""
-#: c.opt:794
+#: c.opt:806
msgid "Make \"char\" unsigned by default"
msgstr ""
-#: c.opt:798
+#: c.opt:810
msgid "Use __cxa_atexit to register destructors"
msgstr ""
-#: c.opt:802
+#: c.opt:814
msgid "Use __cxa_get_exception_ptr in exception handling"
msgstr ""
-#: c.opt:806
+#: c.opt:818
msgid "Marks all inlined methods as having hidden visibility"
msgstr ""
-#: c.opt:810
+#: c.opt:822
msgid "Changes visibility to match Microsoft Visual Studio by default"
msgstr ""
-#: c.opt:814
+#: c.opt:826
msgid "Discard unused virtual functions"
msgstr ""
-#: c.opt:818
+#: c.opt:830
msgid "Implement vtables using thunks"
msgstr ""
-#: c.opt:822
+#: c.opt:834
msgid "Emit common-like symbols as weak symbols"
msgstr ""
-#: c.opt:826
+#: c.opt:838
msgid ""
"Convert all wide strings and character constants to character set <cset>"
msgstr ""
-#: c.opt:830
+#: c.opt:842
msgid "Generate a #line directive pointing at the current working directory"
msgstr ""
-#: c.opt:834
+#: c.opt:846
msgid "Emit cross referencing information"
msgstr ""
-#: c.opt:838
+#: c.opt:850
msgid ""
"Generate lazy class lookup (via objc_getClass()) for use in Zero-Link mode"
msgstr ""
-#: c.opt:842
+#: c.opt:854
msgid "Dump declarations to a .decl file"
msgstr ""
-#: c.opt:846
+#: c.opt:858
msgid "Aggressive reduced debug info for structs"
msgstr ""
-#: c.opt:850
+#: c.opt:862
msgid "Conservative reduced debug info for structs"
msgstr ""
-#: c.opt:854
+#: c.opt:866
msgid "Detailed reduced debug info for structs"
msgstr ""
-#: c.opt:858 c.opt:890
+#: c.opt:870 c.opt:902
msgid "Add <dir> to the end of the system include path"
msgstr ""
-#: c.opt:862
+#: c.opt:874
msgid "Accept definition of macros in <file>"
msgstr ""
-#: c.opt:866
+#: c.opt:878
msgid "-imultilib <dir> Set <dir> to be the multilib include subdirectory"
msgstr ""
-#: c.opt:870
+#: c.opt:882
msgid "Include the contents of <file> before other files"
msgstr ""
-#: c.opt:874
+#: c.opt:886
msgid "Specify <path> as a prefix for next two options"
msgstr ""
-#: c.opt:878
+#: c.opt:890
msgid "Set <dir> to be the system root directory"
msgstr ""
-#: c.opt:882
+#: c.opt:894
msgid "Add <dir> to the start of the system include path"
msgstr ""
-#: c.opt:886
+#: c.opt:898
msgid "Add <dir> to the end of the quote include path"
msgstr ""
-#: c.opt:904
+#: c.opt:916
msgid ""
"Do not search standard system include directories (those specified with -"
"isystem will still be used)"
msgstr ""
-#: c.opt:908
+#: c.opt:920
msgid "Do not search standard system include directories for C++"
msgstr ""
-#: c.opt:924
+#: c.opt:936
msgid "Generate C header of platform-specific features"
msgstr ""
-#: c.opt:928
+#: c.opt:940
msgid "Print a checksum of the executable for PCH validity checking, and stop"
msgstr ""
-#: c.opt:932
+#: c.opt:944
msgid "Remap file names when including files"
msgstr ""
-#: c.opt:936
+#: c.opt:948
msgid "Conform to the ISO 1998 C++ standard"
msgstr ""
-#: c.opt:940
+#: c.opt:952
msgid ""
"Conform to the ISO 1998 C++ standard, with extensions that are likely to"
msgstr ""
-#: c.opt:947 c.opt:982
+#: c.opt:959 c.opt:994
msgid "Conform to the ISO 1990 C standard"
msgstr ""
-#: c.opt:951 c.opt:990
+#: c.opt:963 c.opt:1002
msgid "Conform to the ISO 1999 C standard"
msgstr ""
-#: c.opt:955
+#: c.opt:967
msgid "Deprecated in favor of -std=c99"
msgstr ""
-#: c.opt:959
+#: c.opt:971
msgid "Conform to the ISO 1998 C++ standard with GNU extensions"
msgstr ""
-#: c.opt:963
+#: c.opt:975
msgid "Conform to the ISO 1998 C++ standard, with GNU extensions and"
msgstr ""
-#: c.opt:970
+#: c.opt:982
msgid "Conform to the ISO 1990 C standard with GNU extensions"
msgstr ""
-#: c.opt:974
+#: c.opt:986
msgid "Conform to the ISO 1999 C standard with GNU extensions"
msgstr ""
-#: c.opt:978
+#: c.opt:990
msgid "Deprecated in favor of -std=gnu99"
msgstr ""
-#: c.opt:986
+#: c.opt:998
msgid "Conform to the ISO 1990 C standard as amended in 1994"
msgstr ""
-#: c.opt:994
+#: c.opt:1006
msgid "Deprecated in favor of -std=iso9899:1999"
msgstr ""
-#: c.opt:998
+#: c.opt:1010
msgid "Enable traditional preprocessing"
msgstr ""
-#: c.opt:1002
+#: c.opt:1014
msgid "Support ISO C trigraphs"
msgstr ""
-#: c.opt:1006
+#: c.opt:1018
msgid "Do not predefine system-specific and GCC-specific macros"
msgstr ""
-#: c.opt:1010
+#: c.opt:1022
msgid "Enable verbose output"
msgstr ""
+#: lto/lang.opt:29
+msgid "Run the link-time optimizer in local transformation (LTRANS) mode."
+msgstr ""
+
+#: lto/lang.opt:33
+msgid "Specify a file to which a list of files output by LTRANS is written."
+msgstr ""
+
+#: lto/lang.opt:37
+msgid "Run the link-time optimizer in whole program analysis (WPA) mode."
+msgstr ""
+
+#: lto/lang.opt:41
+msgid "The resolution file"
+msgstr ""
+
#: common.opt:28
msgid "Display this information"
msgstr ""
@@ -16650,1010 +17416,1122 @@ msgid "Do not put uninitialized globals in the common section"
msgstr ""
#: common.opt:385
-msgid "Do not perform optimizations increasing noticeably stack usage"
+msgid ""
+"-fcompare-debug[=<opts>] Compile with and without e.g. -gtoggle, and compare "
+"the final-insns dump"
msgstr ""
#: common.opt:389
-msgid "Perform a register copy-propagation optimization pass"
+msgid "Run only the second compilation of -fcompare-debug"
msgstr ""
#: common.opt:393
-msgid "Perform cross-jumping optimization"
+msgid "Do not perform optimizations increasing noticeably stack usage"
msgstr ""
#: common.opt:397
+msgid "Perform a register copy-propagation optimization pass"
+msgstr ""
+
+#: common.opt:401
+msgid "Perform cross-jumping optimization"
+msgstr ""
+
+#: common.opt:405
msgid "When running CSE, follow jumps to their targets"
msgstr ""
-#: common.opt:401 common.opt:514 common.opt:727 common.opt:956 common.opt:1108
-#: common.opt:1167 common.opt:1183 common.opt:1243
+#: common.opt:409 common.opt:538 common.opt:759 common.opt:1001
+#: common.opt:1122 common.opt:1181 common.opt:1240 common.opt:1256
+#: common.opt:1328
msgid "Does nothing. Preserved for backward compatibility."
msgstr ""
-#: common.opt:405
+#: common.opt:413
msgid "Omit range reduction step when performing complex division"
msgstr ""
-#: common.opt:409
+#: common.opt:417
msgid "Complex multiplication and division follow Fortran rules"
msgstr ""
-#: common.opt:413
+#: common.opt:421
msgid "Place data items into their own section"
msgstr ""
-#: common.opt:417
+#: common.opt:425
msgid "List all available debugging counters with their limits and counts."
msgstr ""
-#: common.opt:421
+#: common.opt:429
msgid ""
"-fdbg-cnt=<counter>:<limit>[,<counter>:<limit>,...] Set the debug counter "
"limit. "
msgstr ""
-#: common.opt:425
+#: common.opt:433
msgid "Map one directory name to another in debug information"
msgstr ""
-#: common.opt:431
+#: common.opt:439
msgid "Defer popping functions args from stack until later"
msgstr ""
-#: common.opt:435
+#: common.opt:443
msgid "Attempt to fill delay slots of branch instructions"
msgstr ""
-#: common.opt:439
+#: common.opt:447
msgid "Delete useless null pointer checks"
msgstr ""
-#: common.opt:443
+#: common.opt:451
msgid ""
"How often to emit source location at the beginning of line-wrapped "
"diagnostics"
msgstr ""
-#: common.opt:447
+#: common.opt:455
msgid ""
"Amend appropriate diagnostic messages with the command line option that "
"controls them"
msgstr ""
-#: common.opt:451
+#: common.opt:459
msgid "Dump various compiler internals to a file"
msgstr ""
-#: common.opt:455
+#: common.opt:463
+msgid "Dump to filename the insns at the end of translation"
+msgstr ""
+
+#: common.opt:467
msgid "Suppress output of addresses in debugging dumps"
msgstr ""
-#: common.opt:459
+#: common.opt:471
msgid ""
"Suppress output of instruction numbers, line number notes and addresses in "
"debugging dumps"
msgstr ""
-#: common.opt:463
+#: common.opt:475
+msgid "Suppress output of previous and next insn numbers in debugging dumps"
+msgstr ""
+
+#: common.opt:479
msgid "Enable CFI tables via GAS assembler directives."
msgstr ""
-#: common.opt:467
+#: common.opt:483
msgid "Perform early inlining"
msgstr ""
-#: common.opt:471
+#: common.opt:487
msgid "Perform DWARF2 duplicate elimination"
msgstr ""
-#: common.opt:475 common.opt:479
+#: common.opt:491
+msgid "Perform interprocedural reduction of aggregates"
+msgstr ""
+
+#: common.opt:495 common.opt:499
msgid "Perform unused type elimination in debug info"
msgstr ""
-#: common.opt:483
+#: common.opt:503
msgid "Do not suppress C++ class debug information."
msgstr ""
-#: common.opt:487
+#: common.opt:507
+msgid "Generate debug information to support Identical Code Folding (ICF)"
+msgstr ""
+
+#: common.opt:511
msgid "Enable exception handling"
msgstr ""
-#: common.opt:491
+#: common.opt:515
msgid "Perform a number of minor, expensive optimizations"
msgstr ""
-#: common.opt:495
+#: common.opt:519
msgid "Specify handling of excess floating-point precision"
msgstr ""
-#: common.opt:502
+#: common.opt:526
msgid "Assume no NaNs or infinities are generated"
msgstr ""
-#: common.opt:506
+#: common.opt:530
msgid "Mark <register> as being unavailable to the compiler"
msgstr ""
-#: common.opt:510
+#: common.opt:534
msgid "Don't allocate floats and doubles in extended-precision registers"
msgstr ""
-#: common.opt:518
+#: common.opt:542
msgid "Perform a forward propagation pass on RTL"
msgstr ""
-#: common.opt:525
+#: common.opt:549
msgid "Allow function addresses to be held in registers"
msgstr ""
-#: common.opt:529
+#: common.opt:553
msgid "Place each function into its own section"
msgstr ""
-#: common.opt:533
+#: common.opt:557
msgid "Perform global common subexpression elimination"
msgstr ""
-#: common.opt:537
+#: common.opt:561
msgid ""
"Perform enhanced load motion during global common subexpression elimination"
msgstr ""
-#: common.opt:541
+#: common.opt:565
msgid "Perform store motion after global common subexpression elimination"
msgstr ""
-#: common.opt:545
+#: common.opt:569
msgid ""
"Perform redundant load after store elimination in global common subexpression"
msgstr ""
-#: common.opt:550
+#: common.opt:574
msgid ""
"Perform global common subexpression elimination after register allocation"
msgstr ""
-#: common.opt:556
+#: common.opt:580
msgid "Enable in and out of Graphite representation"
msgstr ""
-#: common.opt:560
+#: common.opt:584
+msgid "Enable Graphite Identity transformation"
+msgstr ""
+
+#: common.opt:588
+msgid "Mark all loops as parallel"
+msgstr ""
+
+#: common.opt:592
msgid "Enable Loop Strip Mining transformation"
msgstr ""
-#: common.opt:564
+#: common.opt:596
msgid "Enable Loop Interchange transformation"
msgstr ""
-#: common.opt:568
+#: common.opt:600
msgid "Enable Loop Blocking transformation"
msgstr ""
-#: common.opt:573
-msgid "Enable Graphite Identity transformation"
-msgstr ""
-
-#: common.opt:577
+#: common.opt:604
msgid "Enable guessing of branch probabilities"
msgstr ""
-#: common.opt:585
+#: common.opt:612
msgid "Process #ident directives"
msgstr ""
-#: common.opt:589
+#: common.opt:616
msgid "Perform conversion of conditional jumps to branchless equivalents"
msgstr ""
-#: common.opt:593
+#: common.opt:620
msgid "Perform conversion of conditional jumps to conditional execution"
msgstr ""
-#: common.opt:601
+#: common.opt:628
msgid "Do not generate .size directives"
msgstr ""
-#: common.opt:605
+#: common.opt:632
msgid "Perform indirect inlining"
msgstr ""
-#: common.opt:614
+#: common.opt:641
msgid "Pay attention to the \"inline\" keyword"
msgstr ""
-#: common.opt:618
+#: common.opt:645
msgid ""
"Integrate simple functions into their callers when code size is known to not "
"growth"
msgstr ""
-#: common.opt:622
+#: common.opt:649
msgid "Integrate simple functions into their callers"
msgstr ""
-#: common.opt:626
+#: common.opt:653
msgid "Integrate functions called once into their callers"
msgstr ""
-#: common.opt:633
+#: common.opt:660
msgid "Limit the size of inlined functions to <number>"
msgstr ""
-#: common.opt:637
+#: common.opt:664
msgid "Instrument function entry and exit with profiling calls"
msgstr ""
-#: common.opt:641
+#: common.opt:668
msgid ""
"-finstrument-functions-exclude-function-list=name,... Do not instrument "
"listed functions"
msgstr ""
-#: common.opt:645
+#: common.opt:672
msgid ""
"-finstrument-functions-exclude-file-list=filename,... Do not instrument "
"functions listed in files"
msgstr ""
-#: common.opt:649
+#: common.opt:676
msgid "Perform Interprocedural constant propagation"
msgstr ""
-#: common.opt:653
+#: common.opt:680
msgid "Perform cloning to make Interprocedural constant propagation stronger"
msgstr ""
-#: common.opt:657
+#: common.opt:684
msgid "Discover pure and const functions"
msgstr ""
-#: common.opt:661
+#: common.opt:688
msgid "Perform interprocedural points-to analysis"
msgstr ""
-#: common.opt:665
+#: common.opt:692
msgid "Discover readonly and non addressable static variables"
msgstr ""
-#: common.opt:669
+#: common.opt:696
msgid "Type based escape and alias analysis"
msgstr ""
-#: common.opt:673
+#: common.opt:700
msgid "Perform matrix layout flattening and transposing based"
msgstr ""
-#: common.opt:678
+#: common.opt:705
msgid "Perform structure layout optimizations based"
msgstr ""
-#: common.opt:683
+#: common.opt:710
msgid "-fira-algorithm=[CB|priority] Set the used IRA algorithm"
msgstr ""
-#: common.opt:687
+#: common.opt:714
msgid "-fira-region=[one|all|mixed] Set regions for IRA"
msgstr ""
-#: common.opt:691
+#: common.opt:718
msgid "Do optimistic coalescing."
msgstr ""
-#: common.opt:695
+#: common.opt:722
+msgid "Use IRA based register pressure calculation"
+msgstr ""
+
+#: common.opt:727
msgid "Share slots for saving different hard registers."
msgstr ""
-#: common.opt:699
+#: common.opt:731
msgid "Share stack slots for spilled pseudo-registers."
msgstr ""
-#: common.opt:703
+#: common.opt:735
msgid "-fira-verbose=<number> Control IRA's level of diagnostic messages."
msgstr ""
-#: common.opt:707
+#: common.opt:739
msgid "Optimize induction variables on trees"
msgstr ""
-#: common.opt:711
+#: common.opt:743
msgid "Use jump tables for sufficiently large switch statements"
msgstr ""
-#: common.opt:715
+#: common.opt:747
msgid "Generate code for functions even if they are fully inlined"
msgstr ""
-#: common.opt:719
+#: common.opt:751
msgid "Emit static const variables even if they are not used"
msgstr ""
-#: common.opt:723
+#: common.opt:755
msgid "Give external symbols a leading underscore"
msgstr ""
-#: common.opt:731
+#: common.opt:763
+msgid "Enable link-time optimization."
+msgstr ""
+
+#: common.opt:768
+msgid ""
+"-flto-compression-level=<number> Use zlib compression level <number> for IL"
+msgstr ""
+
+#: common.opt:772
+msgid "Report various link-time optimization statistics"
+msgstr ""
+
+#: common.opt:776
msgid "Set errno after built-in math functions"
msgstr ""
-#: common.opt:735
+#: common.opt:780
msgid "Report on permanent memory allocation"
msgstr ""
-#: common.opt:742
+#: common.opt:787
msgid "Attempt to merge identical constants and constant variables"
msgstr ""
-#: common.opt:746
+#: common.opt:791
msgid "Attempt to merge identical constants across compilation units"
msgstr ""
-#: common.opt:750
+#: common.opt:795
msgid "Attempt to merge identical debug strings across compilation units"
msgstr ""
-#: common.opt:754
+#: common.opt:799
msgid ""
"Limit diagnostics to <number> characters per line. 0 suppresses line-"
"wrapping"
msgstr ""
-#: common.opt:758
+#: common.opt:803
msgid "Perform SMS based modulo scheduling before the first scheduling pass"
msgstr ""
-#: common.opt:762
+#: common.opt:807
msgid "Perform SMS based modulo scheduling with register moves allowed"
msgstr ""
-#: common.opt:766
+#: common.opt:811
msgid "Move loop invariant computations out of loops"
msgstr ""
-#: common.opt:770
+#: common.opt:815
msgid "Add mudflap bounds-checking instrumentation for single-threaded program"
msgstr ""
-#: common.opt:774
+#: common.opt:819
msgid "Add mudflap bounds-checking instrumentation for multi-threaded program"
msgstr ""
-#: common.opt:778
+#: common.opt:823
msgid "Ignore read operations when inserting mudflap instrumentation"
msgstr ""
-#: common.opt:782
+#: common.opt:827
msgid "Use the RTL dead code elimination pass"
msgstr ""
-#: common.opt:786
+#: common.opt:831
msgid "Use the RTL dead store elimination pass"
msgstr ""
-#: common.opt:790
+#: common.opt:835
msgid ""
"Enable/Disable the traditional scheduling in loops that already passed "
"modulo scheduling"
msgstr ""
-#: common.opt:794
+#: common.opt:839
msgid "Support synchronous non-call exceptions"
msgstr ""
-#: common.opt:798
+#: common.opt:843
msgid "When possible do not generate stack frames"
msgstr ""
-#: common.opt:802
+#: common.opt:847
msgid "Do the full register move optimization pass"
msgstr ""
-#: common.opt:806
+#: common.opt:851
msgid "Optimize sibling and tail recursive calls"
msgstr ""
-#: common.opt:810 common.opt:814
+#: common.opt:855 common.opt:859
msgid "Report on memory allocation before interprocedural optimization"
msgstr ""
-#: common.opt:818
+#: common.opt:863
msgid "Pack structure members together without holes"
msgstr ""
-#: common.opt:822
+#: common.opt:867
msgid "Set initial maximum structure member alignment"
msgstr ""
-#: common.opt:826
+#: common.opt:871
msgid "Return small aggregates in memory, not registers"
msgstr ""
-#: common.opt:830
+#: common.opt:875
msgid "Perform loop peeling"
msgstr ""
-#: common.opt:834
+#: common.opt:879
msgid "Enable machine specific peephole optimizations"
msgstr ""
-#: common.opt:838
+#: common.opt:883
msgid "Enable an RTL peephole pass before sched2"
msgstr ""
-#: common.opt:842
+#: common.opt:887
msgid "Generate position-independent code if possible (large mode)"
msgstr ""
-#: common.opt:846
+#: common.opt:891
msgid ""
"Generate position-independent code for executables if possible (large mode)"
msgstr ""
-#: common.opt:850
+#: common.opt:895
msgid "Generate position-independent code if possible (small mode)"
msgstr ""
-#: common.opt:854
+#: common.opt:899
msgid ""
"Generate position-independent code for executables if possible (small mode)"
msgstr ""
-#: common.opt:858
+#: common.opt:903
msgid "Specify a plugin to load"
msgstr ""
-#: common.opt:862
+#: common.opt:907
msgid ""
"-fplugin-arg-<name>-<key>[=<value>] Specify argument <key>=<value> for "
"plugin <name>"
msgstr ""
-#: common.opt:866
+#: common.opt:911
msgid "Run predictive commoning optimization."
msgstr ""
-#: common.opt:870
+#: common.opt:915
msgid "Generate prefetch instructions, if available, for arrays in loops"
msgstr ""
-#: common.opt:874
+#: common.opt:919
msgid "Enable basic program profiling code"
msgstr ""
-#: common.opt:878
+#: common.opt:923
msgid "Insert arc-based program profiling code"
msgstr ""
-#: common.opt:882
+#: common.opt:927
msgid "Set the top-level directory for storing the profile data."
msgstr ""
-#: common.opt:887
+#: common.opt:932
msgid "Enable correction of flow inconsistent profile data input"
msgstr ""
-#: common.opt:891
+#: common.opt:936
msgid ""
"Enable common options for generating profile info for profile feedback "
"directed optimizations"
msgstr ""
-#: common.opt:895
+#: common.opt:940
msgid ""
"Enable common options for generating profile info for profile feedback "
"directed optimizations, and set -fprofile-dir="
msgstr ""
-#: common.opt:899
+#: common.opt:944
msgid ""
"Enable common options for performing profile feedback directed optimizations"
msgstr ""
-#: common.opt:903
+#: common.opt:948
msgid ""
"Enable common options for performing profile feedback directed "
"optimizations, and set -fprofile-dir="
msgstr ""
-#: common.opt:907
+#: common.opt:952
msgid "Insert code to profile values of expressions"
msgstr ""
-#: common.opt:914
+#: common.opt:959
msgid "Make compile reproducible using <string>"
msgstr ""
-#: common.opt:924
+#: common.opt:969
msgid "Record gcc command line switches in the object file."
msgstr ""
-#: common.opt:928
+#: common.opt:973
msgid "Return small aggregates in registers"
msgstr ""
-#: common.opt:932
+#: common.opt:977
msgid "Enables a register move optimization"
msgstr ""
-#: common.opt:936
+#: common.opt:981
msgid "Perform a register renaming optimization pass"
msgstr ""
-#: common.opt:940
+#: common.opt:985
msgid "Reorder basic blocks to improve code placement"
msgstr ""
-#: common.opt:944
+#: common.opt:989
msgid "Reorder basic blocks and partition into hot and cold sections"
msgstr ""
-#: common.opt:948
+#: common.opt:993
msgid "Reorder functions to improve code placement"
msgstr ""
-#: common.opt:952
+#: common.opt:997
msgid "Add a common subexpression elimination pass after loop optimizations"
msgstr ""
-#: common.opt:960
+#: common.opt:1005
msgid "Disable optimizations that assume default FP rounding behavior"
msgstr ""
-#: common.opt:964
+#: common.opt:1009
msgid "Enable scheduling across basic blocks"
msgstr ""
-#: common.opt:968
+#: common.opt:1013
+msgid "Enable register pressure sensitive insn scheduling"
+msgstr ""
+
+#: common.opt:1017
msgid "Allow speculative motion of non-loads"
msgstr ""
-#: common.opt:972
+#: common.opt:1021
msgid "Allow speculative motion of some loads"
msgstr ""
-#: common.opt:976
+#: common.opt:1025
msgid "Allow speculative motion of more loads"
msgstr ""
-#: common.opt:980
+#: common.opt:1029
msgid "Set the verbosity level of the scheduler"
msgstr ""
-#: common.opt:984
+#: common.opt:1033
msgid "If scheduling post reload, do superblock scheduling"
msgstr ""
-#: common.opt:988
+#: common.opt:1037
msgid "If scheduling post reload, do trace scheduling"
msgstr ""
-#: common.opt:992
+#: common.opt:1041
msgid "Reschedule instructions before register allocation"
msgstr ""
-#: common.opt:996
+#: common.opt:1045
msgid "Reschedule instructions after register allocation"
msgstr ""
-#: common.opt:1003
+#: common.opt:1052
msgid "Schedule instructions using selective scheduling algorithm"
msgstr ""
-#: common.opt:1007
+#: common.opt:1056
msgid "Run selective scheduling after reload"
msgstr ""
-#: common.opt:1011
+#: common.opt:1060
msgid "Perform software pipelining of inner loops during selective scheduling"
msgstr ""
-#: common.opt:1015
+#: common.opt:1064
msgid "Perform software pipelining of outer loops during selective scheduling"
msgstr ""
-#: common.opt:1019
+#: common.opt:1068
msgid "Reschedule pipelined regions without pipelining"
msgstr ""
-#: common.opt:1025
+#: common.opt:1074
msgid "Allow premature scheduling of queued insns"
msgstr ""
-#: common.opt:1029
+#: common.opt:1078
msgid "Set number of queued insns that can be prematurely scheduled"
msgstr ""
-#: common.opt:1037 common.opt:1041
+#: common.opt:1086 common.opt:1090
msgid ""
"Set dependence distance checking in premature scheduling of queued insns"
msgstr ""
-#: common.opt:1045
-msgid "Access data in the same section from shared anchor points"
+#: common.opt:1094
+msgid "Enable the group heuristic in the scheduler"
+msgstr ""
+
+#: common.opt:1098
+msgid "Enable the critical path heuristic in the scheduler"
+msgstr ""
+
+#: common.opt:1102
+msgid "Enable the speculative instruction heuristic in the scheduler"
+msgstr ""
+
+#: common.opt:1106
+msgid "Enable the rank heuristic in the scheduler"
+msgstr ""
+
+#: common.opt:1110
+msgid "Enable the last instruction heuristic in the scheduler"
+msgstr ""
+
+#: common.opt:1114
+msgid "Enable the dependent count heuristic in the scheduler"
msgstr ""
-#: common.opt:1049
-msgid "Eliminate redundant sign extensions using LCM."
+#: common.opt:1118
+msgid "Access data in the same section from shared anchor points"
msgstr ""
-#: common.opt:1053
-msgid "Show column numbers in diagnostics, when available. Default off"
+#: common.opt:1126
+msgid "Show column numbers in diagnostics, when available. Default on"
msgstr ""
-#: common.opt:1057
+#: common.opt:1130
msgid "Disable optimizations observable by IEEE signaling NaNs"
msgstr ""
-#: common.opt:1061
+#: common.opt:1134
msgid ""
"Disable floating point optimizations that ignore the IEEE signedness of zero"
msgstr ""
-#: common.opt:1065
+#: common.opt:1138
msgid "Convert floating point constants to single precision constants"
msgstr ""
-#: common.opt:1069
+#: common.opt:1142
msgid "Split lifetimes of induction variables when loops are unrolled"
msgstr ""
-#: common.opt:1073
+#: common.opt:1146
msgid "Split wide types into independent registers"
msgstr ""
-#: common.opt:1077
+#: common.opt:1150
msgid "Apply variable expansion when loops are unrolled"
msgstr ""
-#: common.opt:1081
+#: common.opt:1154
msgid "Insert stack checking code into the program"
msgstr ""
-#: common.opt:1085
+#: common.opt:1158
msgid ""
"Insert stack checking code into the program. Same as -fstack-check=specific"
msgstr ""
-#: common.opt:1092
+#: common.opt:1165
msgid "Trap if the stack goes past <register>"
msgstr ""
-#: common.opt:1096
+#: common.opt:1169
msgid "Trap if the stack goes past symbol <name>"
msgstr ""
-#: common.opt:1100
+#: common.opt:1173
msgid "Use propolice as a stack protection method"
msgstr ""
-#: common.opt:1104
+#: common.opt:1177
msgid "Use a stack protection method for every function"
msgstr ""
-#: common.opt:1116
+#: common.opt:1189
msgid "Assume strict aliasing rules apply"
msgstr ""
-#: common.opt:1120
+#: common.opt:1193
msgid "Treat signed overflow as undefined"
msgstr ""
-#: common.opt:1124
+#: common.opt:1197
msgid "Check for syntax errors, then stop"
msgstr ""
-#: common.opt:1128
+#: common.opt:1201
msgid "Create data files needed by \"gcov\""
msgstr ""
-#: common.opt:1132
+#: common.opt:1205
msgid "Perform jump threading optimizations"
msgstr ""
-#: common.opt:1136
+#: common.opt:1209
msgid "Report the time taken by each compiler pass"
msgstr ""
-#: common.opt:1140
+#: common.opt:1213
msgid "Set the default thread-local storage code generation model"
msgstr ""
-#: common.opt:1144
+#: common.opt:1217
msgid "Reorder top level functions, variables, and asms"
msgstr ""
-#: common.opt:1148
+#: common.opt:1221
msgid "Perform superblock formation via tail duplication"
msgstr ""
-#: common.opt:1155
+#: common.opt:1228
msgid "Assume floating-point operations can trap"
msgstr ""
-#: common.opt:1159
+#: common.opt:1232
msgid "Trap for signed overflow in addition, subtraction and multiplication"
msgstr ""
-#: common.opt:1163
+#: common.opt:1236
msgid "Enable SSA-CCP optimization on trees"
msgstr ""
-#: common.opt:1171
+#: common.opt:1244
msgid "Enable loop header copying on trees"
msgstr ""
-#: common.opt:1175
+#: common.opt:1248
msgid "Replace SSA temporaries with better names in copies"
msgstr ""
-#: common.opt:1179
+#: common.opt:1252
msgid "Enable copy propagation on trees"
msgstr ""
-#: common.opt:1187
+#: common.opt:1260
msgid "Transform condition stores into unconditional ones"
msgstr ""
-#: common.opt:1191
+#: common.opt:1264
msgid "Perform conversions of switch initializations."
msgstr ""
-#: common.opt:1195
+#: common.opt:1268
msgid "Enable SSA dead code elimination optimization on trees"
msgstr ""
-#: common.opt:1199
+#: common.opt:1272
msgid "Enable dominator optimizations"
msgstr ""
-#: common.opt:1203
+#: common.opt:1276
msgid "Enable dead store elimination"
msgstr ""
-#: common.opt:1207
+#: common.opt:1280
+msgid "Enable forward propagation on trees"
+msgstr ""
+
+#: common.opt:1284
msgid "Enable Full Redundancy Elimination (FRE) on trees"
msgstr ""
-#: common.opt:1211
+#: common.opt:1288
msgid "Enable loop distribution on trees"
msgstr ""
-#: common.opt:1215
+#: common.opt:1292
msgid "Enable loop invariant motion on trees"
msgstr ""
-#: common.opt:1219
+#: common.opt:1296
msgid "Enable linear loop transforms on trees"
msgstr ""
-#: common.opt:1223
+#: common.opt:1300
msgid "Create canonical induction variables in loops"
msgstr ""
-#: common.opt:1227
+#: common.opt:1304
msgid "Enable loop optimizations on tree level"
msgstr ""
-#: common.opt:1231
+#: common.opt:1308
msgid "Enable automatic parallelization of loops"
msgstr ""
-#: common.opt:1235
+#: common.opt:1312
+msgid "Enable hoisting loads from conditional pointers."
+msgstr ""
+
+#: common.opt:1316
msgid "Enable SSA-PRE optimization on trees"
msgstr ""
-#: common.opt:1239
+#: common.opt:1320
+msgid "Perform function-local points-to analysis on trees."
+msgstr ""
+
+#: common.opt:1324
msgid "Enable reassociation on tree level"
msgstr ""
-#: common.opt:1247
+#: common.opt:1332
msgid "Enable SSA code sinking on trees"
msgstr ""
-#: common.opt:1251
+#: common.opt:1336
msgid "Perform scalar replacement of aggregates"
msgstr ""
-#: common.opt:1255
+#: common.opt:1340
msgid "Replace temporary expressions in the SSA->normal pass"
msgstr ""
-#: common.opt:1259
+#: common.opt:1344
msgid "Perform live range splitting during the SSA->normal pass"
msgstr ""
-#: common.opt:1263
+#: common.opt:1348
msgid "Perform Value Range Propagation on trees"
msgstr ""
-#: common.opt:1267
+#: common.opt:1352
msgid "Compile whole compilation unit at a time"
msgstr ""
-#: common.opt:1271
+#: common.opt:1356
msgid "Perform loop unrolling when iteration count is known"
msgstr ""
-#: common.opt:1275
+#: common.opt:1360
msgid "Perform loop unrolling for all loops"
msgstr ""
-#: common.opt:1282
+#: common.opt:1367
msgid "Allow loop optimizations to assume that the loops behave in normal way"
msgstr ""
-#: common.opt:1286
+#: common.opt:1371
msgid "Allow optimization for floating-point arithmetic which may change the"
msgstr ""
-#: common.opt:1291
+#: common.opt:1376
msgid "Same as -fassociative-math for expressions which include division."
msgstr ""
-#: common.opt:1299
+#: common.opt:1384
msgid "Allow math optimizations that may violate IEEE or ISO standards"
msgstr ""
-#: common.opt:1303
+#: common.opt:1388
msgid "Perform loop unswitching"
msgstr ""
-#: common.opt:1307
+#: common.opt:1392
msgid "Just generate unwind tables for exception handling"
msgstr ""
-#: common.opt:1311
+#: common.opt:1396
msgid "Perform variable tracking"
msgstr ""
-#: common.opt:1315
+#: common.opt:1400
+msgid "Perform variable tracking by annotating assignments"
+msgstr ""
+
+#: common.opt:1404
+msgid "Toggle -fvar-tracking-assignments"
+msgstr ""
+
+#: common.opt:1408
msgid "Perform variable tracking and also tag variables that are uninitialized"
msgstr ""
-#: common.opt:1319
+#: common.opt:1412
msgid "Enable loop vectorization on trees"
msgstr ""
-#: common.opt:1323
+#: common.opt:1416
+msgid "Enable basic block vectorization (SLP) on trees"
+msgstr ""
+
+#: common.opt:1420
msgid "Enable use of cost model in vectorization"
msgstr ""
-#: common.opt:1327
+#: common.opt:1424
msgid "Enable loop versioning when doing loop vectorization on trees"
msgstr ""
-#: common.opt:1331
+#: common.opt:1428
msgid "Set the verbosity level of the vectorizer"
msgstr ""
-#: common.opt:1335
+#: common.opt:1432
msgid "Enable copy propagation of scalar-evolution information."
msgstr ""
-#: common.opt:1345
+#: common.opt:1442
msgid "Add extra commentary to assembler output"
msgstr ""
-#: common.opt:1349
+#: common.opt:1446
msgid "Set the default symbol visibility"
msgstr ""
-#: common.opt:1354
+#: common.opt:1451
msgid "Use expression value profiles in optimizations"
msgstr ""
-#: common.opt:1358
+#: common.opt:1455
msgid "Construct webs and split unrelated uses of single variable"
msgstr ""
-#: common.opt:1362
+#: common.opt:1459
+msgid "Enable partitioned link-time optimization."
+msgstr ""
+
+#: common.opt:1463
msgid "Enable conditional dead code elimination for builtin calls"
msgstr ""
-#: common.opt:1366
+#: common.opt:1467
msgid "Perform whole program optimizations"
msgstr ""
-#: common.opt:1370
+#: common.opt:1471
msgid "Assume signed arithmetic overflow wraps around"
msgstr ""
-#: common.opt:1374
+#: common.opt:1475
msgid "Put zero initialized data in the bss section"
msgstr ""
-#: common.opt:1378
+#: common.opt:1479
msgid "Generate debug information in default format"
msgstr ""
-#: common.opt:1382
+#: common.opt:1483
msgid "Generate debug information in COFF format"
msgstr ""
-#: common.opt:1386
-msgid "Generate debug information in DWARF v2 format"
+#: common.opt:1487
+msgid "Generate debug information in DWARF v2 (or later) format"
msgstr ""
-#: common.opt:1390
+#: common.opt:1491
msgid "Generate debug information in default extended format"
msgstr ""
-#: common.opt:1394
+#: common.opt:1495
msgid "Generate debug information in STABS format"
msgstr ""
-#: common.opt:1398
+#: common.opt:1499
msgid "Generate debug information in extended STABS format"
msgstr ""
-#: common.opt:1402
+#: common.opt:1503
+msgid "Emit DWARF additions beyond selected version"
+msgstr ""
+
+#: common.opt:1507
+msgid "Don't emit DWARF additions beyond selected version"
+msgstr ""
+
+#: common.opt:1511
+msgid "Toggle debug information generation"
+msgstr ""
+
+#: common.opt:1515
msgid "Generate debug information in VMS format"
msgstr ""
-#: common.opt:1406
+#: common.opt:1519
msgid "Generate debug information in XCOFF format"
msgstr ""
-#: common.opt:1410
+#: common.opt:1523
msgid "Generate debug information in extended XCOFF format"
msgstr ""
-#: common.opt:1414
+#: common.opt:1527
msgid "Place output into <file>"
msgstr ""
-#: common.opt:1418
+#: common.opt:1531
msgid "Enable function profiling"
msgstr ""
-#: common.opt:1422
+#: common.opt:1535
msgid "Issue warnings needed for strict compliance to the standard"
msgstr ""
-#: common.opt:1426
+#: common.opt:1539
msgid "Like -pedantic but issue them as errors"
msgstr ""
-#: common.opt:1430
+#: common.opt:1543
msgid "Do not display functions compiled or elapsed time"
msgstr ""
-#: common.opt:1434
+#: common.opt:1547
msgid "Display the compiler's version"
msgstr ""
-#: common.opt:1438
+#: common.opt:1551
msgid "Suppress warnings"
msgstr ""
-#: common.opt:1442
+#: common.opt:1555
msgid "Create a shared library"
msgstr ""
-#: common.opt:1446
+#: common.opt:1559
msgid "Create a position independent executable"
msgstr ""
-#: attribs.c:283
+#: attribs.c:293
#, gcc-internal-format
msgid "%qE attribute directive ignored"
msgstr ""
-#: attribs.c:291
+#: attribs.c:301
#, gcc-internal-format
msgid "wrong number of arguments specified for %qE attribute"
msgstr ""
-#: attribs.c:309
+#: attribs.c:319
#, gcc-internal-format
msgid "%qE attribute does not apply to types"
msgstr ""
-#: attribs.c:360
+#: attribs.c:370
#, gcc-internal-format
msgid "%qE attribute only applies to function types"
msgstr ""
-#: attribs.c:370
+#: attribs.c:380
#, gcc-internal-format
msgid "type attributes ignored after type is already defined"
msgstr ""
@@ -17669,146 +18547,143 @@ msgid ""
"branch target register load optimization is not intended to be run twice"
msgstr ""
-#: builtins.c:489
+#: builtins.c:499
#, gcc-internal-format
msgid "offset outside bounds of constant string"
msgstr ""
-#: builtins.c:1052
+#: builtins.c:1063
#, gcc-internal-format
msgid "second argument to %<__builtin_prefetch%> must be a constant"
msgstr ""
-#: builtins.c:1059
+#: builtins.c:1070
#, gcc-internal-format
msgid "invalid second argument to %<__builtin_prefetch%>; using zero"
msgstr ""
-#: builtins.c:1067
+#: builtins.c:1078
#, gcc-internal-format
msgid "third argument to %<__builtin_prefetch%> must be a constant"
msgstr ""
-#: builtins.c:1074
+#: builtins.c:1085
#, gcc-internal-format
msgid "invalid third argument to %<__builtin_prefetch%>; using zero"
msgstr ""
-#: builtins.c:4678
+#: builtins.c:4314
#, gcc-internal-format
msgid "argument of %<__builtin_args_info%> must be constant"
msgstr ""
-#: builtins.c:4684
+#: builtins.c:4320
#, gcc-internal-format
msgid "argument of %<__builtin_args_info%> out of range"
msgstr ""
-#: builtins.c:4690
+#: builtins.c:4326
#, gcc-internal-format
msgid "missing argument in %<__builtin_args_info%>"
msgstr ""
-#: builtins.c:4826 gimplify.c:2376
+#: builtins.c:4463 gimplify.c:2321
#, gcc-internal-format
msgid "too few arguments to function %<va_start%>"
msgstr ""
-#: builtins.c:4984
+#: builtins.c:4625
#, gcc-internal-format
msgid "first argument to %<va_arg%> not of type %<va_list%>"
msgstr ""
-#. Unfortunately, this is merely undefined, rather than a constraint
-#. violation, so we cannot make this an error. If this call is never
-#. executed, the program is still strictly conforming.
-#: builtins.c:4999
+#: builtins.c:4641
#, gcc-internal-format
msgid "%qT is promoted to %qT when passed through %<...%>"
msgstr ""
-#: builtins.c:5004
+#: builtins.c:4646
#, gcc-internal-format
msgid "(so you should pass %qT not %qT to %<va_arg%>)"
msgstr ""
#. We can, however, treat "undefined" any way we please.
#. Call abort to encourage the user to fix the program.
-#: builtins.c:5011 c-typeck.c:2513
+#: builtins.c:4653 c-typeck.c:2580
#, gcc-internal-format
msgid "if this code is reached, the program will abort"
msgstr ""
-#: builtins.c:5135
+#: builtins.c:4780
#, gcc-internal-format
msgid "invalid argument to %<__builtin_frame_address%>"
msgstr ""
-#: builtins.c:5137
+#: builtins.c:4782
#, gcc-internal-format
msgid "invalid argument to %<__builtin_return_address%>"
msgstr ""
-#: builtins.c:5150
+#: builtins.c:4795
#, gcc-internal-format
msgid "unsupported argument to %<__builtin_frame_address%>"
msgstr ""
-#: builtins.c:5152
+#: builtins.c:4797
#, gcc-internal-format
msgid "unsupported argument to %<__builtin_return_address%>"
msgstr ""
-#: builtins.c:5698
+#: builtins.c:5333
#, gcc-internal-format
msgid "both arguments to %<__builtin___clear_cache%> must be pointers"
msgstr ""
-#: builtins.c:6060 builtins.c:6075
+#: builtins.c:5709 builtins.c:5723
#, gcc-internal-format
msgid "%qD changed semantics in GCC 4.4"
msgstr ""
#. All valid uses of __builtin_va_arg_pack () are removed during
#. inlining.
-#: builtins.c:6461 expr.c:8053
+#: builtins.c:6113 expr.c:9162
msgid "%Kinvalid use of %<__builtin_va_arg_pack ()%>"
msgstr ""
#. All valid uses of __builtin_va_arg_pack_len () are removed during
#. inlining.
-#: builtins.c:6467
+#: builtins.c:6119
msgid "%Kinvalid use of %<__builtin_va_arg_pack_len ()%>"
msgstr ""
-#: builtins.c:6763
+#: builtins.c:6347
#, gcc-internal-format
msgid "%<__builtin_longjmp%> second argument must be 1"
msgstr ""
-#: builtins.c:7399
+#: builtins.c:6982
#, gcc-internal-format
msgid "target format does not support infinity"
msgstr ""
-#: builtins.c:11812
+#: builtins.c:11740
#, gcc-internal-format
msgid "%<va_start%> used in function with fixed args"
msgstr ""
-#: builtins.c:11820
+#: builtins.c:11748
#, gcc-internal-format
msgid "wrong number of arguments to function %<va_start%>"
msgstr ""
#. Evidently an out of date version of <stdarg.h>; can't validate
#. va_start's second argument, but can still work as intended.
-#: builtins.c:11833
+#: builtins.c:11761
#, gcc-internal-format
msgid "%<__builtin_next_arg%> called without an argument"
msgstr ""
-#: builtins.c:11838
+#: builtins.c:11766
#, gcc-internal-format
msgid "wrong number of arguments to function %<__builtin_next_arg%>"
msgstr ""
@@ -17818,948 +18693,948 @@ msgstr ""
#. argument. We just warn and set the arg to be the last
#. argument so that we will get wrong-code because of
#. it.
-#: builtins.c:11868
+#: builtins.c:11796
#, gcc-internal-format
msgid "second parameter of %<va_start%> not last named argument"
msgstr ""
-#: builtins.c:11878
+#: builtins.c:11806
#, gcc-internal-format
msgid ""
"undefined behaviour when second parameter of %<va_start%> is declared with %"
"<register%> storage"
msgstr ""
-#: builtins.c:11993
+#: builtins.c:11922
msgid "%Kfirst argument of %D must be a pointer, second integer constant"
msgstr ""
-#: builtins.c:12006
+#: builtins.c:11935
msgid "%Klast argument of %D is not integer constant between 0 and 3"
msgstr ""
-#: builtins.c:12051 builtins.c:12216 builtins.c:12275
+#: builtins.c:11980 builtins.c:12131 builtins.c:12190
msgid "%Kcall to %D will always overflow destination buffer"
msgstr ""
-#: builtins.c:12206
+#: builtins.c:12121
msgid "%Kcall to %D might overflow destination buffer"
msgstr ""
-#: builtins.c:12296
+#: builtins.c:12211
msgid "%Kattempt to free a non-heap object %qD"
msgstr ""
-#: builtins.c:12299
+#: builtins.c:12214
msgid "%Kattempt to free a non-heap object"
msgstr ""
-#: c-common.c:1157
+#: c-common.c:990
#, gcc-internal-format
msgid "%qD is not defined outside of function scope"
msgstr ""
-#: c-common.c:1207
+#: c-common.c:1040
#, gcc-internal-format
msgid ""
"string length %qd is greater than the length %qd ISO C%d compilers are "
"required to support"
msgstr ""
-#: c-common.c:1655 c-common.c:1667
+#: c-common.c:1533 c-common.c:1545
#, gcc-internal-format
msgid "overflow in constant expression"
msgstr ""
-#: c-common.c:1689
+#: c-common.c:1568
#, gcc-internal-format
msgid "integer overflow in expression"
msgstr ""
-#: c-common.c:1693
+#: c-common.c:1573
#, gcc-internal-format
msgid "floating point overflow in expression"
msgstr ""
-#: c-common.c:1697
+#: c-common.c:1577
#, gcc-internal-format
msgid "fixed-point overflow in expression"
msgstr ""
-#: c-common.c:1701
+#: c-common.c:1581
#, gcc-internal-format
msgid "vector overflow in expression"
msgstr ""
-#: c-common.c:1706
+#: c-common.c:1587
#, gcc-internal-format
msgid "complex integer overflow in expression"
msgstr ""
-#: c-common.c:1708
+#: c-common.c:1590
#, gcc-internal-format
msgid "complex floating point overflow in expression"
msgstr ""
-#: c-common.c:1747
+#: c-common.c:1633
#, gcc-internal-format
msgid "logical %<or%> applied to non-boolean constant"
msgstr ""
-#: c-common.c:1750
+#: c-common.c:1636
#, gcc-internal-format
msgid "logical %<and%> applied to non-boolean constant"
msgstr ""
-#: c-common.c:1786
+#: c-common.c:1681
+#, gcc-internal-format
+msgid "logical %<or%> of collectively exhaustive tests is always true"
+msgstr ""
+
+#: c-common.c:1685
+#, gcc-internal-format
+msgid "logical %<and%> of mutually exclusive tests is always false"
+msgstr ""
+
+#: c-common.c:1720
#, gcc-internal-format
msgid "type-punning to incomplete type might break strict-aliasing rules"
msgstr ""
-#: c-common.c:1801
+#: c-common.c:1735
#, gcc-internal-format
msgid "dereferencing type-punned pointer will break strict-aliasing rules"
msgstr ""
-#: c-common.c:1808 c-common.c:1826
+#: c-common.c:1742 c-common.c:1760
#, gcc-internal-format
msgid "dereferencing type-punned pointer might break strict-aliasing rules"
msgstr ""
-#: c-common.c:1857
+#: c-common.c:1791
#, gcc-internal-format
msgid "first argument of %q+D should be %<int%>"
msgstr ""
-#: c-common.c:1866
+#: c-common.c:1800
#, gcc-internal-format
msgid "second argument of %q+D should be %<char **%>"
msgstr ""
-#: c-common.c:1875
+#: c-common.c:1809
#, gcc-internal-format
msgid "third argument of %q+D should probably be %<char **%>"
msgstr ""
-#: c-common.c:1885
+#: c-common.c:1819
#, gcc-internal-format
msgid "%q+D takes only zero or two arguments"
msgstr ""
-#: c-common.c:1934
+#: c-common.c:1868
#, gcc-internal-format
msgid ""
"use -flax-vector-conversions to permit conversions between vectors with "
"differing element types or numbers of subparts"
msgstr ""
-#: c-common.c:2089
+#: c-common.c:2023
#, gcc-internal-format
msgid "conversion to %qT from boolean expression"
msgstr ""
-#: c-common.c:2111
+#: c-common.c:2045
#, gcc-internal-format
msgid "negative integer implicitly converted to unsigned type"
msgstr ""
-#: c-common.c:2113
+#: c-common.c:2047
#, gcc-internal-format
msgid "conversion of unsigned constant value to negative integer"
msgstr ""
-#: c-common.c:2140
+#: c-common.c:2074
#, gcc-internal-format
msgid "conversion to %qT alters %qT constant value"
msgstr ""
-#: c-common.c:2232
+#: c-common.c:2166
#, gcc-internal-format
msgid "conversion to %qT from %qT may change the sign of the result"
msgstr ""
-#: c-common.c:2264
+#: c-common.c:2198
#, gcc-internal-format
msgid "conversion to %qT from %qT may alter its value"
msgstr ""
-#: c-common.c:2292
+#: c-common.c:2226
#, gcc-internal-format
msgid "large integer implicitly truncated to unsigned type"
msgstr ""
-#: c-common.c:2298 c-common.c:2305 c-common.c:2313
+#: c-common.c:2232 c-common.c:2239 c-common.c:2247
#, gcc-internal-format
msgid "overflow in implicit constant conversion"
msgstr ""
-#: c-common.c:2484
+#: c-common.c:2420
#, gcc-internal-format
msgid "operation on %qE may be undefined"
msgstr ""
-#: c-common.c:2792
+#: c-common.c:2728
#, gcc-internal-format
msgid "case label does not reduce to an integer constant"
msgstr ""
-#: c-common.c:2832
+#: c-common.c:2768
#, gcc-internal-format
msgid "case label value is less than minimum value for type"
msgstr ""
-#: c-common.c:2840
+#: c-common.c:2776
#, gcc-internal-format
msgid "case label value exceeds maximum value for type"
msgstr ""
-#: c-common.c:2848
+#: c-common.c:2784
#, gcc-internal-format
msgid "lower value in case label range less than minimum value for type"
msgstr ""
-#: c-common.c:2857
+#: c-common.c:2793
#, gcc-internal-format
msgid "upper value in case label range exceeds maximum value for type"
msgstr ""
-#: c-common.c:2931
+#: c-common.c:2867
#, gcc-internal-format
msgid ""
"GCC cannot support operators with integer types and fixed-point types that "
"have too many integral and fractional bits together"
msgstr ""
-#: c-common.c:3417
+#: c-common.c:3354
#, gcc-internal-format
msgid "invalid operands to binary %s (have %qT and %qT)"
msgstr ""
-#: c-common.c:3653
+#: c-common.c:3590
#, gcc-internal-format
msgid "comparison is always false due to limited range of data type"
msgstr ""
-#: c-common.c:3655
+#: c-common.c:3592
#, gcc-internal-format
msgid "comparison is always true due to limited range of data type"
msgstr ""
-#: c-common.c:3734
+#: c-common.c:3671
#, gcc-internal-format
msgid "comparison of unsigned expression >= 0 is always true"
msgstr ""
-#: c-common.c:3744
+#: c-common.c:3681
#, gcc-internal-format
msgid "comparison of unsigned expression < 0 is always false"
msgstr ""
-#: c-common.c:3785
+#: c-common.c:3723
#, gcc-internal-format
msgid "pointer of type %<void *%> used in arithmetic"
msgstr ""
-#: c-common.c:3791
+#: c-common.c:3729
#, gcc-internal-format
msgid "pointer to a function used in arithmetic"
msgstr ""
-#: c-common.c:3797
+#: c-common.c:3735
#, gcc-internal-format
msgid "pointer to member function used in arithmetic"
msgstr ""
-#: c-common.c:3978
+#: c-common.c:3941
#, gcc-internal-format
msgid "the address of %qD will always evaluate as %<true%>"
msgstr ""
-#: c-common.c:4066 cp/semantics.c:593 cp/typeck.c:6676
+#: c-common.c:4042 cp/semantics.c:594 cp/typeck.c:6810
#, gcc-internal-format
msgid "suggest parentheses around assignment used as truth value"
msgstr ""
-#: c-common.c:4143 c-decl.c:3001 c-typeck.c:9934
+#: c-common.c:4124 c-decl.c:3581 c-typeck.c:10029
#, gcc-internal-format
msgid "invalid use of %<restrict%>"
msgstr ""
-#: c-common.c:4360
+#: c-common.c:4338
#, gcc-internal-format
msgid "invalid application of %<sizeof%> to a function type"
msgstr ""
-#: c-common.c:4373
+#: c-common.c:4351
#, gcc-internal-format
msgid "invalid application of %qs to a void type"
msgstr ""
-#: c-common.c:4381
+#: c-common.c:4359
#, gcc-internal-format
msgid "invalid application of %qs to incomplete type %qT "
msgstr ""
-#: c-common.c:4422
+#: c-common.c:4401
#, gcc-internal-format
msgid "%<__alignof%> applied to a bit-field"
msgstr ""
-#: c-common.c:5149
+#: c-common.c:5110
#, gcc-internal-format
msgid "cannot disable built-in function %qs"
msgstr ""
-#: c-common.c:5340
+#: c-common.c:5302
#, gcc-internal-format
msgid "pointers are not permitted as case values"
msgstr ""
-#: c-common.c:5347
+#: c-common.c:5309
#, gcc-internal-format
msgid "range expressions in switch statements are non-standard"
msgstr ""
-#: c-common.c:5373
+#: c-common.c:5335
#, gcc-internal-format
msgid "empty range specified"
msgstr ""
-#: c-common.c:5433
+#: c-common.c:5395
#, gcc-internal-format
msgid "duplicate (or overlapping) case value"
msgstr ""
-#: c-common.c:5434
+#: c-common.c:5397
#, gcc-internal-format
-msgid "%Jthis is the first entry overlapping that value"
+msgid "this is the first entry overlapping that value"
msgstr ""
-#: c-common.c:5438
+#: c-common.c:5401
#, gcc-internal-format
msgid "duplicate case value"
msgstr ""
-#: c-common.c:5439
+#: c-common.c:5402
#, gcc-internal-format
-msgid "%Jpreviously used here"
+msgid "previously used here"
msgstr ""
-#: c-common.c:5443
+#: c-common.c:5406
#, gcc-internal-format
msgid "multiple default labels in one switch"
msgstr ""
-#: c-common.c:5444
+#: c-common.c:5408
#, gcc-internal-format
-msgid "%Jthis is the first default label"
+msgid "this is the first default label"
msgstr ""
-#: c-common.c:5495
+#: c-common.c:5460
#, gcc-internal-format
-msgid "%Jcase value %qs not in enumerated type"
+msgid "case value %qs not in enumerated type"
msgstr ""
-#: c-common.c:5499
+#: c-common.c:5465
#, gcc-internal-format
-msgid "%Jcase value %qs not in enumerated type %qT"
+msgid "case value %qs not in enumerated type %qT"
msgstr ""
-#: c-common.c:5558
+#: c-common.c:5524
#, gcc-internal-format
-msgid "%Hswitch missing default case"
+msgid "switch missing default case"
msgstr ""
-#: c-common.c:5629
+#: c-common.c:5596
#, gcc-internal-format
-msgid "%Henumeration value %qE not handled in switch"
+msgid "enumeration value %qE not handled in switch"
msgstr ""
-#: c-common.c:5664
+#: c-common.c:5622
#, gcc-internal-format
msgid "taking the address of a label is non-standard"
msgstr ""
-#: c-common.c:5837
+#: c-common.c:5795
#, gcc-internal-format
msgid "%qE attribute ignored for field of type %qT"
msgstr ""
-#: c-common.c:5848 c-common.c:5867 c-common.c:5885 c-common.c:5912
-#: c-common.c:5939 c-common.c:5965 c-common.c:5984 c-common.c:6008
-#: c-common.c:6031 c-common.c:6054 c-common.c:6075 c-common.c:6096
-#: c-common.c:6120 c-common.c:6146 c-common.c:6183 c-common.c:6210
-#: c-common.c:6253 c-common.c:6337 c-common.c:6367 c-common.c:6387
-#: c-common.c:6722 c-common.c:6738 c-common.c:6786 c-common.c:6809
-#: c-common.c:6873 c-common.c:7001 c-common.c:7067 c-common.c:7111
-#: c-common.c:7157 c-common.c:7235 c-common.c:7259 c-common.c:7545
-#: c-common.c:7568 c-common.c:7607 c-common.c:7696 c-common.c:7836 tree.c:4066
-#: tree.c:4078 tree.c:4088 config/darwin.c:1437 config/arm/arm.c:3299
-#: config/arm/arm.c:3327 config/avr/avr.c:4807 config/h8300/h8300.c:5283
-#: config/h8300/h8300.c:5307 config/i386/i386.c:4286 config/i386/i386.c:26894
-#: config/ia64/ia64.c:621 config/m68hc11/m68hc11.c:1110
-#: config/rs6000/rs6000.c:20744 config/spu/spu.c:3784
-#: ada/gcc-interface/utils.c:5036 ada/gcc-interface/utils.c:5209
-#: ada/gcc-interface/utils.c:5228
+#: c-common.c:5806 c-common.c:5825 c-common.c:5843 c-common.c:5870
+#: c-common.c:5897 c-common.c:5923 c-common.c:5942 c-common.c:5959
+#: c-common.c:5983 c-common.c:6006 c-common.c:6029 c-common.c:6050
+#: c-common.c:6071 c-common.c:6095 c-common.c:6121 c-common.c:6158
+#: c-common.c:6185 c-common.c:6228 c-common.c:6312 c-common.c:6342
+#: c-common.c:6362 c-common.c:6699 c-common.c:6715 c-common.c:6763
+#: c-common.c:6786 c-common.c:6850 c-common.c:6978 c-common.c:7046
+#: c-common.c:7090 c-common.c:7138 c-common.c:7216 c-common.c:7240
+#: c-common.c:7526 c-common.c:7549 c-common.c:7588 c-common.c:7677
+#: c-common.c:7817 tree.c:5305 tree.c:5317 tree.c:5327 config/darwin.c:1437
+#: config/arm/arm.c:4504 config/arm/arm.c:4532 config/arm/arm.c:4549
+#: config/avr/avr.c:4658 config/h8300/h8300.c:5362 config/h8300/h8300.c:5386
+#: config/i386/i386.c:4403 config/i386/i386.c:26515 config/ia64/ia64.c:631
+#: config/m68hc11/m68hc11.c:1142 config/rs6000/rs6000.c:23362
+#: config/spu/spu.c:3809
#, gcc-internal-format
msgid "%qE attribute ignored"
msgstr ""
-#: c-common.c:5930 c-common.c:5956
+#: c-common.c:5888 c-common.c:5914
#, gcc-internal-format
msgid "%qE attribute conflicts with attribute %s"
msgstr ""
-#: c-common.c:6177
+#: c-common.c:6152
#, gcc-internal-format
msgid "%qE attribute have effect only on public objects"
msgstr ""
-#: c-common.c:6274
+#: c-common.c:6249
#, gcc-internal-format
msgid "destructor priorities are not supported"
msgstr ""
-#: c-common.c:6276
+#: c-common.c:6251
#, gcc-internal-format
msgid "constructor priorities are not supported"
msgstr ""
-#: c-common.c:6293
+#: c-common.c:6268
#, gcc-internal-format
msgid "destructor priorities from 0 to %d are reserved for the implementation"
msgstr ""
-#: c-common.c:6298
+#: c-common.c:6273
#, gcc-internal-format
msgid "constructor priorities from 0 to %d are reserved for the implementation"
msgstr ""
-#: c-common.c:6306
+#: c-common.c:6281
#, gcc-internal-format
msgid "destructor priorities must be integers from 0 to %d inclusive"
msgstr ""
-#: c-common.c:6309
+#: c-common.c:6284
#, gcc-internal-format
msgid "constructor priorities must be integers from 0 to %d inclusive"
msgstr ""
-#: c-common.c:6431
+#: c-common.c:6406
#, gcc-internal-format
msgid "unknown machine mode %qE"
msgstr ""
-#: c-common.c:6460
+#: c-common.c:6435
#, gcc-internal-format
msgid "specifying vector types with __attribute__ ((mode)) is deprecated"
msgstr ""
-#: c-common.c:6463
+#: c-common.c:6438
#, gcc-internal-format
msgid "use __attribute__ ((vector_size)) instead"
msgstr ""
-#: c-common.c:6472
+#: c-common.c:6447
#, gcc-internal-format
msgid "unable to emulate %qs"
msgstr ""
-#: c-common.c:6482
+#: c-common.c:6457
#, gcc-internal-format
msgid "invalid pointer mode %qs"
msgstr ""
-#: c-common.c:6499
+#: c-common.c:6474
#, gcc-internal-format
msgid "signness of type and machine mode %qs don't match"
msgstr ""
-#: c-common.c:6510
+#: c-common.c:6485
#, gcc-internal-format
msgid "no data type for mode %qs"
msgstr ""
-#: c-common.c:6520
+#: c-common.c:6495
#, gcc-internal-format
msgid "cannot use mode %qs for enumeral types"
msgstr ""
-#: c-common.c:6547
+#: c-common.c:6522
#, gcc-internal-format
msgid "mode %qs applied to inappropriate type"
msgstr ""
-#: c-common.c:6578
+#: c-common.c:6554
#, gcc-internal-format
-msgid "%Jsection attribute cannot be specified for local variables"
+msgid "section attribute cannot be specified for local variables"
msgstr ""
-#: c-common.c:6589 config/bfin/bfin.c:5371 config/bfin/bfin.c:5422
+#: c-common.c:6565 config/bfin/bfin.c:5647 config/bfin/bfin.c:5698
+#: config/bfin/bfin.c:5725 config/bfin/bfin.c:5738
#, gcc-internal-format
msgid "section of %q+D conflicts with previous declaration"
msgstr ""
-#: c-common.c:6597
+#: c-common.c:6573
#, gcc-internal-format
msgid "section of %q+D cannot be overridden"
msgstr ""
-#: c-common.c:6605
+#: c-common.c:6581
#, gcc-internal-format
msgid "section attribute not allowed for %q+D"
msgstr ""
-#: c-common.c:6611
+#: c-common.c:6588
#, gcc-internal-format
-msgid "%Jsection attributes are not supported for this target"
+msgid "section attributes are not supported for this target"
msgstr ""
-#: c-common.c:6643
+#: c-common.c:6620
#, gcc-internal-format
msgid "requested alignment is not a constant"
msgstr ""
-#: c-common.c:6648
+#: c-common.c:6625
#, gcc-internal-format
msgid "requested alignment is not a power of 2"
msgstr ""
-#: c-common.c:6653
+#: c-common.c:6630
#, gcc-internal-format
msgid "requested alignment is too large"
msgstr ""
-#: c-common.c:6679
+#: c-common.c:6656
#, gcc-internal-format
msgid "alignment may not be specified for %q+D"
msgstr ""
-#: c-common.c:6686
+#: c-common.c:6663
#, gcc-internal-format
msgid ""
"alignment for %q+D was previously specified as %d and may not be decreased"
msgstr ""
-#: c-common.c:6690
+#: c-common.c:6667
#, gcc-internal-format
msgid "alignment for %q+D must be at least %d"
msgstr ""
-#: c-common.c:6715
+#: c-common.c:6692
#, gcc-internal-format
msgid "inline function %q+D cannot be declared weak"
msgstr ""
-#: c-common.c:6749
+#: c-common.c:6726
#, gcc-internal-format
msgid "%q+D defined both normally and as an alias"
msgstr ""
-#: c-common.c:6765
+#: c-common.c:6742
#, gcc-internal-format
msgid "alias argument not a string"
msgstr ""
-#: c-common.c:6830
+#: c-common.c:6808
#, gcc-internal-format
-msgid "%Jweakref attribute must appear before alias attribute"
+msgid "weakref attribute must appear before alias attribute"
msgstr ""
-#: c-common.c:6860
+#: c-common.c:6837
#, gcc-internal-format
msgid "%qE attribute ignored on non-class types"
msgstr ""
-#: c-common.c:6866
+#: c-common.c:6843
#, gcc-internal-format
msgid "%qE attribute ignored because %qT is already defined"
msgstr ""
-#: c-common.c:6879
+#: c-common.c:6856
#, gcc-internal-format
msgid "visibility argument not a string"
msgstr ""
-#: c-common.c:6891
+#: c-common.c:6868
#, gcc-internal-format
msgid "%qE attribute ignored on types"
msgstr ""
-#: c-common.c:6907
+#: c-common.c:6884
#, gcc-internal-format
msgid ""
"visibility argument must be one of \"default\", \"hidden\", \"protected\" or "
"\"internal\""
msgstr ""
-#: c-common.c:6918
+#: c-common.c:6895
#, gcc-internal-format
msgid "%qD redeclared with different visibility"
msgstr ""
-#: c-common.c:6921 c-common.c:6925
+#: c-common.c:6898 c-common.c:6902
#, gcc-internal-format
msgid "%qD was declared %qs which implies default visibility"
msgstr ""
-#: c-common.c:7009
+#: c-common.c:6986
#, gcc-internal-format
msgid "tls_model argument not a string"
msgstr ""
-#: c-common.c:7022
+#: c-common.c:6999
#, gcc-internal-format
msgid ""
"tls_model argument must be one of \"local-exec\", \"initial-exec\", \"local-"
"dynamic\" or \"global-dynamic\""
msgstr ""
-#: c-common.c:7041 c-common.c:7131
+#: c-common.c:7019 c-common.c:7111 config/m32c/m32c.c:2832
#, gcc-internal-format
-msgid "%J%qE attribute applies only to functions"
+msgid "%qE attribute applies only to functions"
msgstr ""
-#: c-common.c:7046 c-common.c:7136
+#: c-common.c:7025 c-common.c:7117
#, gcc-internal-format
-msgid "%Jcan%'t set %qE attribute after definition"
+msgid "can%'t set %qE attribute after definition"
msgstr ""
-#: c-common.c:7092
+#: c-common.c:7071
#, gcc-internal-format
msgid "alloc_size parameter outside range"
msgstr ""
-#: c-common.c:7193
+#: c-common.c:7174
#, gcc-internal-format
msgid "deprecated message is not a string"
msgstr ""
-#: c-common.c:7233
+#: c-common.c:7214
#, gcc-internal-format
msgid "%qE attribute ignored for %qE"
msgstr ""
-#: c-common.c:7293
+#: c-common.c:7274
#, gcc-internal-format
msgid "invalid vector type for attribute %qE"
msgstr ""
-#: c-common.c:7299
+#: c-common.c:7280 ada/gcc-interface/utils.c:5457
+#: ada/gcc-interface/utils.c:5551
#, gcc-internal-format
msgid "vector size not an integral multiple of component size"
msgstr ""
-#: c-common.c:7305
+#: c-common.c:7286 ada/gcc-interface/utils.c:5463
+#: ada/gcc-interface/utils.c:5557
#, gcc-internal-format
msgid "zero vector size"
msgstr ""
-#: c-common.c:7313
+#: c-common.c:7294 ada/gcc-interface/utils.c:5471
+#: ada/gcc-interface/utils.c:5564
#, gcc-internal-format
msgid "number of components of the vector not a power of two"
msgstr ""
-#: c-common.c:7341 ada/gcc-interface/utils.c:5087
+#: c-common.c:7322 ada/gcc-interface/utils.c:5211
#, gcc-internal-format
msgid "nonnull attribute without arguments on a non-prototype"
msgstr ""
-#: c-common.c:7356 ada/gcc-interface/utils.c:5102
+#: c-common.c:7337 ada/gcc-interface/utils.c:5226
#, gcc-internal-format
msgid "nonnull argument has invalid operand number (argument %lu)"
msgstr ""
-#: c-common.c:7375 ada/gcc-interface/utils.c:5121
+#: c-common.c:7356 ada/gcc-interface/utils.c:5245
#, gcc-internal-format
msgid ""
"nonnull argument with out-of-range operand number (argument %lu, operand %lu)"
msgstr ""
-#: c-common.c:7383 ada/gcc-interface/utils.c:5129
+#: c-common.c:7364 ada/gcc-interface/utils.c:5253
#, gcc-internal-format
msgid ""
"nonnull argument references non-pointer operand (argument %lu, operand %lu)"
msgstr ""
-#: c-common.c:7459
+#: c-common.c:7440
#, gcc-internal-format
msgid "not enough variable arguments to fit a sentinel"
msgstr ""
-#: c-common.c:7473
+#: c-common.c:7454
#, gcc-internal-format
msgid "missing sentinel in function call"
msgstr ""
-#: c-common.c:7514
+#: c-common.c:7495
#, gcc-internal-format
msgid "null argument where non-null required (argument %lu)"
msgstr ""
-#: c-common.c:7579
+#: c-common.c:7560
#, gcc-internal-format
msgid "cleanup argument not an identifier"
msgstr ""
-#: c-common.c:7586
+#: c-common.c:7567
#, gcc-internal-format
msgid "cleanup argument not a function"
msgstr ""
-#: c-common.c:7625 ada/gcc-interface/utils.c:5151
+#: c-common.c:7606
#, gcc-internal-format
msgid "%qE attribute requires prototypes with named arguments"
msgstr ""
-#: c-common.c:7636 ada/gcc-interface/utils.c:5162
+#: c-common.c:7617
#, gcc-internal-format
msgid "%qE attribute only applies to variadic functions"
msgstr ""
-#: c-common.c:7648 ada/gcc-interface/utils.c:5173
+#: c-common.c:7629 ada/gcc-interface/utils.c:5299
#, gcc-internal-format
msgid "requested position is not an integer constant"
msgstr ""
-#: c-common.c:7656 ada/gcc-interface/utils.c:5180
+#: c-common.c:7637 ada/gcc-interface/utils.c:5306
#, gcc-internal-format
msgid "requested position is less than zero"
msgstr ""
-#: c-common.c:7780
+#: c-common.c:7761
#, gcc-internal-format
msgid "Bad option %s to optimize attribute."
msgstr ""
-#: c-common.c:7783
+#: c-common.c:7764
#, gcc-internal-format
msgid "Bad option %s to pragma attribute"
msgstr ""
-#: c-common.c:7976
+#: c-common.c:7957
#, gcc-internal-format
msgid "not enough arguments to function %qE"
msgstr ""
-#: c-common.c:7981 c-typeck.c:2664
+#: c-common.c:7962 c-typeck.c:2732
#, gcc-internal-format
msgid "too many arguments to function %qE"
msgstr ""
-#: c-common.c:8011 c-common.c:8057
+#: c-common.c:7992 c-common.c:8038
#, gcc-internal-format
msgid "non-floating-point argument in call to function %qE"
msgstr ""
-#: c-common.c:8034
+#: c-common.c:8015
#, gcc-internal-format
msgid "non-floating-point arguments in call to function %qE"
msgstr ""
-#: c-common.c:8050
+#: c-common.c:8031
#, gcc-internal-format
msgid "non-const integer argument %u in call to function %qE"
msgstr ""
-#: c-common.c:8343
-#, gcc-internal-format
-msgid ""
-"%Hignoring return value of %qD, declared with attribute warn_unused_result"
-msgstr ""
-
-#: c-common.c:8347
-#, gcc-internal-format
-msgid ""
-"%Hignoring return value of function declared with attribute "
-"warn_unused_result"
-msgstr ""
-
-#: c-common.c:8401
+#: c-common.c:8320
#, gcc-internal-format
msgid "cannot apply %<offsetof%> to static data member %qD"
msgstr ""
-#: c-common.c:8406
+#: c-common.c:8325
#, gcc-internal-format
msgid "cannot apply %<offsetof%> when %<operator[]%> is overloaded"
msgstr ""
-#: c-common.c:8427 cp/typeck.c:4708
+#: c-common.c:8346 cp/typeck.c:4778
#, gcc-internal-format
msgid "attempt to take address of bit-field structure member %qD"
msgstr ""
-#: c-common.c:8480
+#: c-common.c:8400
#, gcc-internal-format
msgid "lvalue required as left operand of assignment"
msgstr ""
-#: c-common.c:8483
+#: c-common.c:8403
#, gcc-internal-format
msgid "lvalue required as increment operand"
msgstr ""
-#: c-common.c:8486
+#: c-common.c:8406
#, gcc-internal-format
msgid "lvalue required as decrement operand"
msgstr ""
-#: c-common.c:8489
+#: c-common.c:8409
#, gcc-internal-format
msgid "lvalue required as unary %<&%> operand"
msgstr ""
-#: c-common.c:8492
+#: c-common.c:8412
#, gcc-internal-format
msgid "lvalue required in asm statement"
msgstr ""
-#: c-common.c:8621
+#: c-common.c:8542
#, gcc-internal-format
msgid "size of array is too large"
msgstr ""
-#: c-common.c:8657 c-common.c:8708 c-typeck.c:2883
+#: c-common.c:8578 c-common.c:8629 c-typeck.c:2954
#, gcc-internal-format
msgid "too few arguments to function %qE"
msgstr ""
-#: c-common.c:8674 c-typeck.c:4972
+#: c-common.c:8595 c-typeck.c:5165 config/mep/mep.c:6340
#, gcc-internal-format
msgid "incompatible type for argument %d of %qE"
msgstr ""
-#: c-common.c:8869
+#: c-common.c:8792
#, gcc-internal-format
msgid "array subscript has type %<char%>"
msgstr ""
-#: c-common.c:8904
+#: c-common.c:8827
#, gcc-internal-format
msgid "suggest parentheses around %<+%> inside %<<<%>"
msgstr ""
-#: c-common.c:8907
+#: c-common.c:8830
#, gcc-internal-format
msgid "suggest parentheses around %<-%> inside %<<<%>"
msgstr ""
-#: c-common.c:8913
+#: c-common.c:8836
#, gcc-internal-format
msgid "suggest parentheses around %<+%> inside %<>>%>"
msgstr ""
-#: c-common.c:8916
+#: c-common.c:8839
#, gcc-internal-format
msgid "suggest parentheses around %<-%> inside %<>>%>"
msgstr ""
-#: c-common.c:8922
+#: c-common.c:8845
#, gcc-internal-format
msgid "suggest parentheses around %<&&%> within %<||%>"
msgstr ""
-#: c-common.c:8931
+#: c-common.c:8854
#, gcc-internal-format
msgid "suggest parentheses around arithmetic in operand of %<|%>"
msgstr ""
-#: c-common.c:8936
+#: c-common.c:8859
#, gcc-internal-format
msgid "suggest parentheses around comparison in operand of %<|%>"
msgstr ""
-#: c-common.c:8940
+#: c-common.c:8863
#, gcc-internal-format
msgid ""
"suggest parentheses around operand of %<!%> or change %<|%> to %<||%> or %<!%"
"> to %<~%>"
msgstr ""
-#: c-common.c:8950
+#: c-common.c:8873
#, gcc-internal-format
msgid "suggest parentheses around arithmetic in operand of %<^%>"
msgstr ""
-#: c-common.c:8955
+#: c-common.c:8878
#, gcc-internal-format
msgid "suggest parentheses around comparison in operand of %<^%>"
msgstr ""
-#: c-common.c:8961
+#: c-common.c:8884
#, gcc-internal-format
msgid "suggest parentheses around %<+%> in operand of %<&%>"
msgstr ""
-#: c-common.c:8964
+#: c-common.c:8887
#, gcc-internal-format
msgid "suggest parentheses around %<-%> in operand of %<&%>"
msgstr ""
-#: c-common.c:8969
+#: c-common.c:8892
#, gcc-internal-format
msgid "suggest parentheses around comparison in operand of %<&%>"
msgstr ""
-#: c-common.c:8973
+#: c-common.c:8896
#, gcc-internal-format
msgid ""
"suggest parentheses around operand of %<!%> or change %<&%> to %<&&%> or %<!%"
"> to %<~%>"
msgstr ""
-#: c-common.c:8981
+#: c-common.c:8904
#, gcc-internal-format
msgid "suggest parentheses around comparison in operand of %<==%>"
msgstr ""
-#: c-common.c:8987
+#: c-common.c:8910
#, gcc-internal-format
msgid "suggest parentheses around comparison in operand of %<!=%>"
msgstr ""
-#: c-common.c:8998
+#: c-common.c:8921
#, gcc-internal-format
msgid "comparisons like %<X<=Y<=Z%> do not have their mathematical meaning"
msgstr ""
-#: c-common.c:9013
+#: c-common.c:8936
#, gcc-internal-format
msgid "label %q+D defined but not used"
msgstr ""
-#: c-common.c:9015
+#: c-common.c:8938
#, gcc-internal-format
msgid "label %q+D declared but not defined"
msgstr ""
-#: c-common.c:9035
+#: c-common.c:8958
#, gcc-internal-format
msgid "division by zero"
msgstr ""
-#: c-common.c:9067
+#: c-common.c:8990
#, gcc-internal-format
msgid "comparison between types %qT and %qT"
msgstr ""
-#: c-common.c:9118
+#: c-common.c:9041
#, gcc-internal-format
msgid "comparison between signed and unsigned integer expressions"
msgstr ""
-#: c-common.c:9169
+#: c-common.c:9092
#, gcc-internal-format
msgid "promoted ~unsigned is always non-zero"
msgstr ""
-#: c-common.c:9172
+#: c-common.c:9095
#, gcc-internal-format
msgid "comparison of promoted ~unsigned with constant"
msgstr ""
-#: c-common.c:9182
+#: c-common.c:9105
#, gcc-internal-format
msgid "comparison of promoted ~unsigned with unsigned"
msgstr ""
@@ -18769,132 +19644,137 @@ msgstr ""
#. an unprototyped function, it is compile-time undefined;
#. making it a constraint in that case was rejected in
#. DR#252.
-#: c-convert.c:98 c-typeck.c:1788 c-typeck.c:4591 cp/typeck.c:1619
-#: cp/typeck.c:5974 cp/typeck.c:6584 fortran/convert.c:88
+#: c-convert.c:102 c-typeck.c:1834 c-typeck.c:4778 cp/typeck.c:1632
+#: cp/typeck.c:6094 cp/typeck.c:6715 fortran/convert.c:88
#, gcc-internal-format
msgid "void value not ignored as it ought to be"
msgstr ""
-#: c-convert.c:152 fortran/convert.c:121 java/typeck.c:151
+#: c-convert.c:156 fortran/convert.c:121 java/typeck.c:151
#, gcc-internal-format
msgid "conversion to non-scalar type requested"
msgstr ""
-#: c-decl.c:578
+#: c-decl.c:696
#, gcc-internal-format
msgid "array %q+D assumed to have one element"
msgstr ""
-#: c-decl.c:619
+#: c-decl.c:737
#, gcc-internal-format
msgid "%qD is static but used in inline function %qD which is not static"
msgstr ""
-#: c-decl.c:624
+#: c-decl.c:742
#, gcc-internal-format
msgid "%q+D is static but declared in inline function %qD which is not static"
msgstr ""
-#: c-decl.c:769
+#: c-decl.c:954
#, gcc-internal-format
msgid "GCC supports only %u nested scopes"
msgstr ""
-#: c-decl.c:855 cp/decl.c:356
+#: c-decl.c:1102 cp/decl.c:356
#, gcc-internal-format
msgid "label %q+D used but not defined"
msgstr ""
-#: c-decl.c:896
+#: c-decl.c:1147
#, gcc-internal-format
msgid "nested function %q+D declared but never defined"
msgstr ""
-#: c-decl.c:908
+#: c-decl.c:1159
#, gcc-internal-format
msgid "inline function %q+D declared but never defined"
msgstr ""
-#: c-decl.c:923 cp/decl.c:601
+#: c-decl.c:1174 cp/decl.c:601
#, gcc-internal-format
msgid "unused variable %q+D"
msgstr ""
-#: c-decl.c:927
+#: c-decl.c:1178
#, gcc-internal-format
msgid "type of array %q+D completed incompatibly with implicit initialization"
msgstr ""
-#: c-decl.c:1177
+#: c-decl.c:1462 c-decl.c:5571 c-decl.c:6349 c-decl.c:6950
+#, gcc-internal-format
+msgid "originally defined here"
+msgstr ""
+
+#: c-decl.c:1533
#, gcc-internal-format
msgid ""
"a parameter list with an ellipsis can%'t match an empty parameter name list "
"declaration"
msgstr ""
-#: c-decl.c:1184
+#: c-decl.c:1540
#, gcc-internal-format
msgid ""
"an argument type that has a default promotion can%'t match an empty "
"parameter name list declaration"
msgstr ""
-#: c-decl.c:1225
+#: c-decl.c:1581
#, gcc-internal-format
msgid ""
"prototype for %q+D declares more arguments than previous old-style definition"
msgstr ""
-#: c-decl.c:1231
+#: c-decl.c:1587
#, gcc-internal-format
msgid ""
"prototype for %q+D declares fewer arguments than previous old-style "
"definition"
msgstr ""
-#: c-decl.c:1240
+#: c-decl.c:1596
#, gcc-internal-format
msgid "prototype for %q+D declares argument %d with incompatible type"
msgstr ""
#. If we get here, no errors were found, but do issue a warning
#. for this poor-style construct.
-#: c-decl.c:1253
+#: c-decl.c:1609
#, gcc-internal-format
msgid "prototype for %q+D follows non-prototype definition"
msgstr ""
-#: c-decl.c:1268
+#: c-decl.c:1624
#, gcc-internal-format
msgid "previous definition of %q+D was here"
msgstr ""
-#: c-decl.c:1270
+#: c-decl.c:1626
#, gcc-internal-format
msgid "previous implicit declaration of %q+D was here"
msgstr ""
-#: c-decl.c:1272
+#: c-decl.c:1628
#, gcc-internal-format
msgid "previous declaration of %q+D was here"
msgstr ""
-#: c-decl.c:1312
+#: c-decl.c:1668
#, gcc-internal-format
msgid "%q+D redeclared as different kind of symbol"
msgstr ""
-#: c-decl.c:1316
+#: c-decl.c:1672
#, gcc-internal-format
msgid "built-in function %q+D declared as non-function"
msgstr ""
-#: c-decl.c:1319 c-decl.c:1439 c-decl.c:2113
+#: c-decl.c:1675 c-decl.c:1795 c-decl.c:2483
#, gcc-internal-format
msgid "declaration of %q+D shadows a built-in function"
msgstr ""
-#: c-decl.c:1328
+#: c-decl.c:1684
#, gcc-internal-format
msgid "redeclaration of enumerator %q+D"
msgstr ""
@@ -18902,269 +19782,298 @@ msgstr ""
#. If types don't match for a built-in, throw away the
#. built-in. No point in calling locate_old_decl here, it
#. won't print anything.
-#: c-decl.c:1349
+#: c-decl.c:1705
#, gcc-internal-format
msgid "conflicting types for built-in function %q+D"
msgstr ""
-#: c-decl.c:1374 c-decl.c:1387 c-decl.c:1396
+#: c-decl.c:1730 c-decl.c:1743 c-decl.c:1752
#, gcc-internal-format
msgid "conflicting types for %q+D"
msgstr ""
-#: c-decl.c:1394
+#: c-decl.c:1750
#, gcc-internal-format
msgid "conflicting type qualifiers for %q+D"
msgstr ""
#. Allow OLDDECL to continue in use.
-#: c-decl.c:1414
+#: c-decl.c:1770
#, gcc-internal-format
msgid "redefinition of typedef %q+D"
msgstr ""
-#: c-decl.c:1465 c-decl.c:1567
+#: c-decl.c:1821 c-decl.c:1924
#, gcc-internal-format
msgid "redefinition of %q+D"
msgstr ""
-#: c-decl.c:1500 c-decl.c:1605
+#: c-decl.c:1856 c-decl.c:1962
#, gcc-internal-format
msgid "static declaration of %q+D follows non-static declaration"
msgstr ""
-#: c-decl.c:1510 c-decl.c:1518 c-decl.c:1595 c-decl.c:1602
+#: c-decl.c:1866 c-decl.c:1874 c-decl.c:1952 c-decl.c:1959
#, gcc-internal-format
msgid "non-static declaration of %q+D follows static declaration"
msgstr ""
-#: c-decl.c:1534
+#: c-decl.c:1890
#, gcc-internal-format
msgid "%<gnu_inline%> attribute present on %q+D"
msgstr ""
-#: c-decl.c:1536
+#: c-decl.c:1893
#, gcc-internal-format
-msgid "%Jbut not here"
+msgid "but not here"
msgstr ""
-#: c-decl.c:1554
+#: c-decl.c:1911
#, gcc-internal-format
msgid "thread-local declaration of %q+D follows non-thread-local declaration"
msgstr ""
-#: c-decl.c:1557
+#: c-decl.c:1914
#, gcc-internal-format
msgid "non-thread-local declaration of %q+D follows thread-local declaration"
msgstr ""
-#: c-decl.c:1587
+#: c-decl.c:1944
#, gcc-internal-format
msgid "extern declaration of %q+D follows declaration with no linkage"
msgstr ""
-#: c-decl.c:1623
+#: c-decl.c:1980
#, gcc-internal-format
msgid "declaration of %q+D with no linkage follows extern declaration"
msgstr ""
-#: c-decl.c:1629
+#: c-decl.c:1986
#, gcc-internal-format
msgid "redeclaration of %q+D with no linkage"
msgstr ""
-#: c-decl.c:1643
+#: c-decl.c:2012
#, gcc-internal-format
msgid ""
"redeclaration of %q+D with different visibility (old visibility preserved)"
msgstr ""
-#: c-decl.c:1654
+#: c-decl.c:2023
#, gcc-internal-format
msgid "inline declaration of %qD follows declaration with attribute noinline"
msgstr ""
-#: c-decl.c:1661
+#: c-decl.c:2030
#, gcc-internal-format
msgid "declaration of %q+D with attribute noinline follows inline declaration "
msgstr ""
-#: c-decl.c:1679
+#: c-decl.c:2048
#, gcc-internal-format
msgid "redefinition of parameter %q+D"
msgstr ""
-#: c-decl.c:1706
+#: c-decl.c:2075
#, gcc-internal-format
msgid "redundant redeclaration of %q+D"
msgstr ""
-#: c-decl.c:2100
+#: c-decl.c:2470
#, gcc-internal-format
msgid "declaration of %q+D shadows previous non-variable"
msgstr ""
-#: c-decl.c:2105
+#: c-decl.c:2475
#, gcc-internal-format
msgid "declaration of %q+D shadows a parameter"
msgstr ""
-#: c-decl.c:2108
+#: c-decl.c:2478
#, gcc-internal-format
msgid "declaration of %q+D shadows a global declaration"
msgstr ""
-#: c-decl.c:2118
+#: c-decl.c:2488
#, gcc-internal-format
msgid "declaration of %q+D shadows a previous local"
msgstr ""
-#: c-decl.c:2121 cp/name-lookup.c:1048 cp/name-lookup.c:1079
+#: c-decl.c:2492 cp/name-lookup.c:1045 cp/name-lookup.c:1078
#: cp/name-lookup.c:1087
#, gcc-internal-format
-msgid "%Jshadowed declaration is here"
+msgid "shadowed declaration is here"
msgstr ""
-#: c-decl.c:2254
+#: c-decl.c:2619
#, gcc-internal-format
msgid "nested extern declaration of %qD"
msgstr ""
-#: c-decl.c:2422 c-decl.c:2425
+#: c-decl.c:2787 c-decl.c:2790
#, gcc-internal-format
msgid "implicit declaration of function %qE"
msgstr ""
-#: c-decl.c:2488
+#: c-decl.c:2853
#, gcc-internal-format
msgid "incompatible implicit declaration of built-in function %qD"
msgstr ""
-#: c-decl.c:2497
+#: c-decl.c:2862
#, gcc-internal-format
msgid "incompatible implicit declaration of function %qD"
msgstr ""
-#: c-decl.c:2551
+#: c-decl.c:2915
#, gcc-internal-format
-msgid "%H%qE undeclared here (not in a function)"
+msgid "%qE undeclared here (not in a function)"
msgstr ""
-#: c-decl.c:2556
+#: c-decl.c:2920
#, gcc-internal-format
-msgid "%H%qE undeclared (first use in this function)"
+msgid "%qE undeclared (first use in this function)"
msgstr ""
-#: c-decl.c:2560
+#: c-decl.c:2924
#, gcc-internal-format
-msgid "%H(Each undeclared identifier is reported only once"
+msgid "(Each undeclared identifier is reported only once"
msgstr ""
-#: c-decl.c:2561
+#: c-decl.c:2925
#, gcc-internal-format
-msgid "%Hfor each function it appears in.)"
+msgid "for each function it appears in.)"
msgstr ""
-#: c-decl.c:2600 cp/decl.c:2404
+#: c-decl.c:2974 cp/decl.c:2439
#, gcc-internal-format
msgid "label %qE referenced outside of any function"
msgstr ""
-#: c-decl.c:2642
+#: c-decl.c:3010
#, gcc-internal-format
-msgid "duplicate label declaration %qE"
+msgid "jump into scope of identifier with variably modified type"
msgstr ""
-#: c-decl.c:2678
+#: c-decl.c:3013
#, gcc-internal-format
-msgid "%Hduplicate label %qD"
+msgid "jump skips variable initialization"
msgstr ""
-#: c-decl.c:2688
+#: c-decl.c:3014 c-decl.c:3070 c-decl.c:3155
#, gcc-internal-format
-msgid "%Jjump into statement expression"
+msgid "label %qD defined here"
msgstr ""
-#: c-decl.c:2690
+#: c-decl.c:3015 c-decl.c:3279
#, gcc-internal-format
-msgid "%Jjump into scope of identifier with variably modified type"
+msgid "%qD declared here"
msgstr ""
-#: c-decl.c:2705
+#: c-decl.c:3069 c-decl.c:3154
+#, gcc-internal-format
+msgid "jump into statement expression"
+msgstr ""
+
+#: c-decl.c:3091
+#, gcc-internal-format
+msgid "duplicate label declaration %qE"
+msgstr ""
+
+#: c-decl.c:3185 cp/decl.c:2748
+#, gcc-internal-format
+msgid "duplicate label %qD"
+msgstr ""
+
+#: c-decl.c:3216
#, gcc-internal-format
msgid ""
-"%Htraditional C lacks a separate namespace for labels, identifier %qE "
-"conflicts"
+"traditional C lacks a separate namespace for labels, identifier %qE conflicts"
msgstr ""
-#: c-decl.c:2780
+#: c-decl.c:3277
#, gcc-internal-format
-msgid "%H%qE defined as wrong kind of tag"
+msgid "switch jumps over variable initialization"
msgstr ""
-#: c-decl.c:3011
+#: c-decl.c:3278 c-decl.c:3289
+#, gcc-internal-format
+msgid "switch starts here"
+msgstr ""
+
+#: c-decl.c:3288
+#, gcc-internal-format
+msgid "switch jumps into statement expression"
+msgstr ""
+
+#: c-decl.c:3359
+#, gcc-internal-format
+msgid "%qE defined as wrong kind of tag"
+msgstr ""
+
+#: c-decl.c:3591
#, gcc-internal-format
msgid "unnamed struct/union that defines no instances"
msgstr ""
-#: c-decl.c:3020
+#: c-decl.c:3600
#, gcc-internal-format
msgid "empty declaration with storage class specifier does not redeclare tag"
msgstr ""
-#: c-decl.c:3032
+#: c-decl.c:3612
#, gcc-internal-format
msgid "empty declaration with type qualifier does not redeclare tag"
msgstr ""
-#: c-decl.c:3054 c-decl.c:3061
+#: c-decl.c:3634 c-decl.c:3641
#, gcc-internal-format
msgid "useless type name in empty declaration"
msgstr ""
-#: c-decl.c:3069
+#: c-decl.c:3649
#, gcc-internal-format
msgid "%<inline%> in empty declaration"
msgstr ""
-#: c-decl.c:3075
+#: c-decl.c:3655
#, gcc-internal-format
msgid "%<auto%> in file-scope empty declaration"
msgstr ""
-#: c-decl.c:3081
+#: c-decl.c:3661
#, gcc-internal-format
msgid "%<register%> in file-scope empty declaration"
msgstr ""
-#: c-decl.c:3087
+#: c-decl.c:3667
#, gcc-internal-format
msgid "useless storage class specifier in empty declaration"
msgstr ""
-#: c-decl.c:3093
+#: c-decl.c:3673
#, gcc-internal-format
msgid "useless %<__thread%> in empty declaration"
msgstr ""
-#: c-decl.c:3101
+#: c-decl.c:3681
#, gcc-internal-format
msgid "useless type qualifier in empty declaration"
msgstr ""
-#: c-decl.c:3108 c-parser.c:1176
+#: c-decl.c:3688 c-parser.c:1181
#, gcc-internal-format
msgid "empty declaration"
msgstr ""
-#: c-decl.c:3175
+#: c-decl.c:3758
#, gcc-internal-format
msgid ""
"ISO C90 does not support %<static%> or type qualifiers in parameter array "
"declarators"
msgstr ""
-#: c-decl.c:3179
+#: c-decl.c:3762
#, gcc-internal-format
msgid "ISO C90 does not support %<[*]%> array declarators"
msgstr ""
@@ -19172,263 +20081,273 @@ msgstr ""
#. C99 6.7.5.2p4
#. A function definition isn't function prototype scope C99 6.2.1p4.
#. C99 6.7.5.2p4
-#: c-decl.c:3186 c-decl.c:5294
+#: c-decl.c:3769 c-decl.c:5945
#, gcc-internal-format
msgid "%<[*]%> not allowed in other than function prototype scope"
msgstr ""
-#: c-decl.c:3298
+#: c-decl.c:3882
#, gcc-internal-format
msgid "%q+D is usually a function"
msgstr ""
-#: c-decl.c:3307 cp/decl2.c:781
+#: c-decl.c:3891 cp/decl2.c:782
#, gcc-internal-format
msgid "typedef %qD is initialized (use __typeof__ instead)"
msgstr ""
-#: c-decl.c:3312
+#: c-decl.c:3896
#, gcc-internal-format
msgid "function %qD is initialized like a variable"
msgstr ""
#. DECL_INITIAL in a PARM_DECL is really DECL_ARG_TYPE.
-#: c-decl.c:3318
+#: c-decl.c:3902
#, gcc-internal-format
msgid "parameter %qD is initialized"
msgstr ""
-#: c-decl.c:3343
+#: c-decl.c:3927
#, gcc-internal-format
msgid "variable %qD has initializer but incomplete type"
msgstr ""
-#: c-decl.c:3432 c-decl.c:6429 cp/decl.c:4104 cp/decl.c:11493
+#: c-decl.c:4016 cp/decl.c:4152 cp/decl.c:11602
#, gcc-internal-format
msgid "inline function %q+D given attribute noinline"
msgstr ""
-#: c-decl.c:3536
+#: c-decl.c:4113
#, gcc-internal-format
msgid "initializer fails to determine size of %q+D"
msgstr ""
-#: c-decl.c:3541
+#: c-decl.c:4118
#, gcc-internal-format
msgid "array size missing in %q+D"
msgstr ""
-#: c-decl.c:3553
+#: c-decl.c:4130
#, gcc-internal-format
msgid "zero or negative size array %q+D"
msgstr ""
-#: c-decl.c:3608 varasm.c:2117
+#: c-decl.c:4185 varasm.c:2124
#, gcc-internal-format
msgid "storage size of %q+D isn%'t known"
msgstr ""
-#: c-decl.c:3619
+#: c-decl.c:4196
#, gcc-internal-format
msgid "storage size of %q+D isn%'t constant"
msgstr ""
-#: c-decl.c:3666
+#: c-decl.c:4243
#, gcc-internal-format
msgid "ignoring asm-specifier for non-static local variable %q+D"
msgstr ""
-#: c-decl.c:3694 fortran/f95-lang.c:620
+#: c-decl.c:4271
#, gcc-internal-format
msgid "cannot put object with volatile field into register"
msgstr ""
-#: c-decl.c:3823
+#: c-decl.c:4361
+#, gcc-internal-format
+msgid "uninitialized const %qD is invalid in C++"
+msgstr ""
+
+#: c-decl.c:4407
#, gcc-internal-format
msgid "ISO C forbids forward parameter declarations"
msgstr ""
-#: c-decl.c:3951
+#: c-decl.c:4493
+#, gcc-internal-format
+msgid "defining a type in a compound literal is invalid in C++"
+msgstr ""
+
+#: c-decl.c:4546
#, gcc-internal-format
msgid "bit-field %qs width not an integer constant"
msgstr ""
-#: c-decl.c:3959
+#: c-decl.c:4554
#, gcc-internal-format
msgid "negative width in bit-field %qs"
msgstr ""
-#: c-decl.c:3964
+#: c-decl.c:4559
#, gcc-internal-format
msgid "zero width for bit-field %qs"
msgstr ""
-#: c-decl.c:3974
+#: c-decl.c:4569
#, gcc-internal-format
msgid "bit-field %qs has invalid type"
msgstr ""
-#: c-decl.c:3984
+#: c-decl.c:4579
#, gcc-internal-format
msgid "type of bit-field %qs is a GCC extension"
msgstr ""
-#: c-decl.c:3990
+#: c-decl.c:4585
#, gcc-internal-format
msgid "width of %qs exceeds its type"
msgstr ""
-#: c-decl.c:4003
+#: c-decl.c:4598
#, gcc-internal-format
msgid "%qs is narrower than values of its type"
msgstr ""
-#: c-decl.c:4022
+#: c-decl.c:4617
#, gcc-internal-format
msgid "ISO C90 forbids array %qE whose size can%'t be evaluated"
msgstr ""
-#: c-decl.c:4026
+#: c-decl.c:4621
#, gcc-internal-format
msgid "ISO C90 forbids array whose size can%'t be evaluated"
msgstr ""
-#: c-decl.c:4033
+#: c-decl.c:4628
#, gcc-internal-format
msgid "ISO C90 forbids variable length array %qE"
msgstr ""
-#: c-decl.c:4036
+#: c-decl.c:4631
#, gcc-internal-format
msgid "ISO C90 forbids variable length array"
msgstr ""
-#: c-decl.c:4045
+#: c-decl.c:4640
#, gcc-internal-format
msgid "the size of array %qE can%'t be evaluated"
msgstr ""
-#: c-decl.c:4049
+#: c-decl.c:4644
#, gcc-internal-format
msgid "the size of array can %'t be evaluated"
msgstr ""
-#: c-decl.c:4055
+#: c-decl.c:4650
#, gcc-internal-format
msgid "variable length array %qE is used"
msgstr ""
-#: c-decl.c:4059 cp/decl.c:7265
+#: c-decl.c:4654 cp/decl.c:7284
#, gcc-internal-format
msgid "variable length array is used"
msgstr ""
-#: c-decl.c:4230 c-decl.c:4559 c-decl.c:4569
+#: c-decl.c:4831 c-decl.c:5167 c-decl.c:5177
#, gcc-internal-format
msgid "variably modified %qE at file scope"
msgstr ""
-#: c-decl.c:4232
+#: c-decl.c:4833
#, gcc-internal-format
msgid "variably modified field at file scope"
msgstr ""
-#: c-decl.c:4252
+#: c-decl.c:4853
#, gcc-internal-format
msgid "type defaults to %<int%> in declaration of %qE"
msgstr ""
-#: c-decl.c:4256
+#: c-decl.c:4857
#, gcc-internal-format
msgid "type defaults to %<int%> in type name"
msgstr ""
-#: c-decl.c:4285
+#: c-decl.c:4886
#, gcc-internal-format
msgid "duplicate %<const%>"
msgstr ""
-#: c-decl.c:4287
+#: c-decl.c:4888
#, gcc-internal-format
msgid "duplicate %<restrict%>"
msgstr ""
-#: c-decl.c:4289
+#: c-decl.c:4890
#, gcc-internal-format
msgid "duplicate %<volatile%>"
msgstr ""
-#: c-decl.c:4309
+#: c-decl.c:4910
#, gcc-internal-format
msgid "function definition declared %<auto%>"
msgstr ""
-#: c-decl.c:4311
+#: c-decl.c:4912
#, gcc-internal-format
msgid "function definition declared %<register%>"
msgstr ""
-#: c-decl.c:4313
+#: c-decl.c:4914
#, gcc-internal-format
msgid "function definition declared %<typedef%>"
msgstr ""
-#: c-decl.c:4315
+#: c-decl.c:4916
#, gcc-internal-format
msgid "function definition declared %<__thread%>"
msgstr ""
-#: c-decl.c:4332
+#: c-decl.c:4933
#, gcc-internal-format
msgid "storage class specified for structure field %qE"
msgstr ""
-#: c-decl.c:4335
+#: c-decl.c:4936
#, gcc-internal-format
msgid "storage class specified for structure field"
msgstr ""
-#: c-decl.c:4339
+#: c-decl.c:4940
#, gcc-internal-format
msgid "storage class specified for parameter %qE"
msgstr ""
-#: c-decl.c:4341
+#: c-decl.c:4943
#, gcc-internal-format
msgid "storage class specified for unnamed parameter"
msgstr ""
-#: c-decl.c:4344 cp/decl.c:8165
+#: c-decl.c:4946 cp/decl.c:8204
#, gcc-internal-format
msgid "storage class specified for typename"
msgstr ""
-#: c-decl.c:4361
+#: c-decl.c:4963
#, gcc-internal-format
msgid "%qE initialized and declared %<extern%>"
msgstr ""
-#: c-decl.c:4364
+#: c-decl.c:4967
#, gcc-internal-format
msgid "%qE has both %<extern%> and initializer"
msgstr ""
-#: c-decl.c:4369
+#: c-decl.c:4972
#, gcc-internal-format
msgid "file-scope declaration of %qE specifies %<auto%>"
msgstr ""
-#: c-decl.c:4372
+#: c-decl.c:4976
#, gcc-internal-format
msgid "file-scope declaration of %qE specifies %<register%>"
msgstr ""
-#: c-decl.c:4377
+#: c-decl.c:4981
#, gcc-internal-format
msgid "nested function %qE declared %<extern%>"
msgstr ""
-#: c-decl.c:4380
+#: c-decl.c:4984
#, gcc-internal-format
msgid "function-scope %qE implicitly auto and declared %<__thread%>"
msgstr ""
@@ -19436,528 +20355,544 @@ msgstr ""
#. Only the innermost declarator (making a parameter be of
#. array type which is converted to pointer type)
#. may have static or type qualifiers.
-#: c-decl.c:4427 c-decl.c:4743
+#: c-decl.c:5031 c-decl.c:5352
#, gcc-internal-format
msgid "static or type qualifiers in non-parameter array declarator"
msgstr ""
-#: c-decl.c:4475
+#: c-decl.c:5079
#, gcc-internal-format
msgid "declaration of %qE as array of voids"
msgstr ""
-#: c-decl.c:4477
+#: c-decl.c:5081
#, gcc-internal-format
msgid "declaration of type name as array of voids"
msgstr ""
-#: c-decl.c:4484
+#: c-decl.c:5088
#, gcc-internal-format
msgid "declaration of %qE as array of functions"
msgstr ""
-#: c-decl.c:4486
+#: c-decl.c:5091
#, gcc-internal-format
msgid "declaration of type name as array of functions"
msgstr ""
-#: c-decl.c:4492
+#: c-decl.c:5098 c-decl.c:6736
#, gcc-internal-format
msgid "invalid use of structure with flexible array member"
msgstr ""
-#: c-decl.c:4518
+#: c-decl.c:5124
#, gcc-internal-format
msgid "size of array %qE has non-integer type"
msgstr ""
-#: c-decl.c:4520
+#: c-decl.c:5128
#, gcc-internal-format
msgid "size of unnamed array has non-integer type"
msgstr ""
-#: c-decl.c:4530
+#: c-decl.c:5138
#, gcc-internal-format
msgid "ISO C forbids zero-size array %qE"
msgstr ""
-#: c-decl.c:4533
+#: c-decl.c:5141
#, gcc-internal-format
msgid "ISO C forbids zero-size array"
msgstr ""
-#: c-decl.c:4542
+#: c-decl.c:5150
#, gcc-internal-format
msgid "size of array %qE is negative"
msgstr ""
-#: c-decl.c:4544
+#: c-decl.c:5152
#, gcc-internal-format
msgid "size of unnamed array is negative"
msgstr ""
-#: c-decl.c:4620 c-decl.c:4913
+#: c-decl.c:5228 c-decl.c:5530
#, gcc-internal-format
msgid "size of array %qE is too large"
msgstr ""
-#: c-decl.c:4622 c-decl.c:4915
+#: c-decl.c:5231 c-decl.c:5532
#, gcc-internal-format
msgid "size of unnamed array is too large"
msgstr ""
-#: c-decl.c:4659
+#: c-decl.c:5268
#, gcc-internal-format
msgid "ISO C90 does not support flexible array members"
msgstr ""
#. C99 6.7.5.2p4
-#: c-decl.c:4680
+#: c-decl.c:5289
#, gcc-internal-format
msgid "%<[*]%> not in a declaration"
msgstr ""
-#: c-decl.c:4693
+#: c-decl.c:5302
#, gcc-internal-format
msgid "array type has incomplete element type"
msgstr ""
-#: c-decl.c:4776
+#: c-decl.c:5385
#, gcc-internal-format
msgid "%qE declared as function returning a function"
msgstr ""
-#: c-decl.c:4779
+#: c-decl.c:5388
#, gcc-internal-format
msgid "type name declared as function returning a function"
msgstr ""
-#: c-decl.c:4786
+#: c-decl.c:5395
#, gcc-internal-format
msgid "%qE declared as function returning an array"
msgstr ""
-#: c-decl.c:4788
+#: c-decl.c:5398
#, gcc-internal-format
msgid "type name declared as function returning an array"
msgstr ""
-#: c-decl.c:4811
+#: c-decl.c:5428
#, gcc-internal-format
msgid "function definition has qualified void return type"
msgstr ""
-#: c-decl.c:4814 cp/decl.c:8271
+#: c-decl.c:5431 cp/decl.c:8310
#, gcc-internal-format
msgid "type qualifiers ignored on function return type"
msgstr ""
-#: c-decl.c:4844 c-decl.c:4929 c-decl.c:5019 c-decl.c:5112
+#: c-decl.c:5461 c-decl.c:5546 c-decl.c:5656 c-decl.c:5749
#, gcc-internal-format
msgid "ISO C forbids qualified function types"
msgstr ""
-#: c-decl.c:4937
+#: c-decl.c:5554
#, gcc-internal-format
msgid "typedef %q+D declared %<inline%>"
msgstr ""
-#: c-decl.c:4953
+#: c-decl.c:5590
#, gcc-internal-format
msgid "ISO C forbids const or volatile function types"
msgstr ""
-#: c-decl.c:4964
+#. C99 6.7.2.1p8
+#: c-decl.c:5600
#, gcc-internal-format
msgid "a member of a structure or union cannot have a variably modified type"
msgstr ""
-#: c-decl.c:4980 cp/decl.c:7481
+#: c-decl.c:5617 cp/decl.c:7500
#, gcc-internal-format
msgid "variable or field %qE declared void"
msgstr ""
-#: c-decl.c:5011
+#: c-decl.c:5648
#, gcc-internal-format
msgid "attributes in parameter array declarator ignored"
msgstr ""
-#: c-decl.c:5045
+#: c-decl.c:5682
#, gcc-internal-format
msgid "parameter %q+D declared %<inline%>"
msgstr ""
-#: c-decl.c:5058
+#: c-decl.c:5695
#, gcc-internal-format
msgid "field %qE declared as a function"
msgstr ""
-#: c-decl.c:5065
+#: c-decl.c:5702
#, gcc-internal-format
msgid "field %qE has incomplete type"
msgstr ""
-#: c-decl.c:5067
+#: c-decl.c:5704
#, gcc-internal-format
msgid "unnamed field has incomplete type"
msgstr ""
-#: c-decl.c:5084 c-decl.c:5095 c-decl.c:5098
+#: c-decl.c:5721 c-decl.c:5732 c-decl.c:5735
#, gcc-internal-format
msgid "invalid storage class for function %qE"
msgstr ""
-#: c-decl.c:5118
+#: c-decl.c:5755
#, gcc-internal-format
msgid "%<noreturn%> function returns non-void value"
msgstr ""
-#: c-decl.c:5154
+#: c-decl.c:5791
#, gcc-internal-format
msgid "cannot inline function %<main%>"
msgstr ""
-#: c-decl.c:5183
+#: c-decl.c:5820
#, gcc-internal-format
msgid "variable previously declared %<static%> redeclared %<extern%>"
msgstr ""
-#: c-decl.c:5193
+#: c-decl.c:5830
#, gcc-internal-format
msgid "variable %q+D declared %<inline%>"
msgstr ""
-#: c-decl.c:5228
+#: c-decl.c:5865
#, gcc-internal-format
msgid "non-nested function with variably modified type"
msgstr ""
-#: c-decl.c:5230
+#: c-decl.c:5867
#, gcc-internal-format
msgid "object with variably modified type must have no linkage"
msgstr ""
-#: c-decl.c:5299 c-decl.c:6523
+#: c-decl.c:5950 c-decl.c:7366
#, gcc-internal-format
msgid "function declaration isn%'t a prototype"
msgstr ""
-#: c-decl.c:5307
+#: c-decl.c:5958
#, gcc-internal-format
msgid "parameter names (without types) in function declaration"
msgstr ""
-#: c-decl.c:5340
+#: c-decl.c:5993
#, gcc-internal-format
msgid "parameter %u (%q+D) has incomplete type"
msgstr ""
-#: c-decl.c:5343
+#: c-decl.c:5997
#, gcc-internal-format
-msgid "%Jparameter %u has incomplete type"
+msgid "parameter %u has incomplete type"
msgstr ""
-#: c-decl.c:5352
+#: c-decl.c:6007
#, gcc-internal-format
msgid "parameter %u (%q+D) has void type"
msgstr ""
-#: c-decl.c:5355
+#: c-decl.c:6011
#, gcc-internal-format
-msgid "%Jparameter %u has void type"
+msgid "parameter %u has void type"
msgstr ""
-#: c-decl.c:5417
+#: c-decl.c:6081
#, gcc-internal-format
msgid "%<void%> as only parameter may not be qualified"
msgstr ""
-#: c-decl.c:5421 c-decl.c:5455
+#: c-decl.c:6085 c-decl.c:6119
#, gcc-internal-format
msgid "%<void%> must be the only parameter"
msgstr ""
-#: c-decl.c:5449
+#: c-decl.c:6113
#, gcc-internal-format
msgid "parameter %q+D has just a forward declaration"
msgstr ""
#. The %s will be one of 'struct', 'union', or 'enum'.
-#: c-decl.c:5494
+#: c-decl.c:6158
#, gcc-internal-format
msgid "%<%s %E%> declared inside parameter list"
msgstr ""
#. The %s will be one of 'struct', 'union', or 'enum'.
-#: c-decl.c:5498
+#: c-decl.c:6162
#, gcc-internal-format
msgid "anonymous %s declared inside parameter list"
msgstr ""
-#: c-decl.c:5503
+#: c-decl.c:6167
#, gcc-internal-format
msgid ""
"its scope is only this definition or declaration, which is probably not what "
"you want"
msgstr ""
-#: c-decl.c:5642
+#: c-decl.c:6260
+#, gcc-internal-format
+msgid "enum type defined here"
+msgstr ""
+
+#: c-decl.c:6266
+#, gcc-internal-format
+msgid "struct defined here"
+msgstr ""
+
+#: c-decl.c:6272
+#, gcc-internal-format
+msgid "union defined here"
+msgstr ""
+
+#: c-decl.c:6345
#, gcc-internal-format
msgid "redefinition of %<union %E%>"
msgstr ""
-#: c-decl.c:5644
+#: c-decl.c:6347
#, gcc-internal-format
msgid "redefinition of %<struct %E%>"
msgstr ""
-#: c-decl.c:5651
+#: c-decl.c:6356
#, gcc-internal-format
msgid "nested redefinition of %<union %E%>"
msgstr ""
-#: c-decl.c:5653
+#: c-decl.c:6358
#, gcc-internal-format
msgid "nested redefinition of %<struct %E%>"
msgstr ""
-#: c-decl.c:5731 cp/decl.c:3839
+#: c-decl.c:6390 c-decl.c:6968
+#, gcc-internal-format
+msgid "defining type in %qs expression is invalid in C++"
+msgstr ""
+
+#: c-decl.c:6457 cp/decl.c:3885
#, gcc-internal-format
msgid "declaration does not declare anything"
msgstr ""
-#: c-decl.c:5734
+#: c-decl.c:6460
#, gcc-internal-format
msgid "ISO C doesn%'t support unnamed structs/unions"
msgstr ""
-#: c-decl.c:5778 c-decl.c:5794
+#: c-decl.c:6523 c-decl.c:6539
#, gcc-internal-format
msgid "duplicate member %q+D"
msgstr ""
-#: c-decl.c:5833
+#: c-decl.c:6642
#, gcc-internal-format
msgid "union has no named members"
msgstr ""
-#: c-decl.c:5835
+#: c-decl.c:6644
#, gcc-internal-format
msgid "union has no members"
msgstr ""
-#: c-decl.c:5840
+#: c-decl.c:6649
#, gcc-internal-format
msgid "struct has no named members"
msgstr ""
-#: c-decl.c:5842
+#: c-decl.c:6651
#, gcc-internal-format
msgid "struct has no members"
msgstr ""
-#: c-decl.c:5906
-#, gcc-internal-format
-msgid "%Jflexible array member in union"
-msgstr ""
-
-#: c-decl.c:5911
+#: c-decl.c:6716
#, gcc-internal-format
-msgid "%Jflexible array member not at end of struct"
+msgid "flexible array member in union"
msgstr ""
-#: c-decl.c:5916
+#: c-decl.c:6722
#, gcc-internal-format
-msgid "%Jflexible array member in otherwise empty struct"
+msgid "flexible array member not at end of struct"
msgstr ""
-#: c-decl.c:5924
+#: c-decl.c:6728
#, gcc-internal-format
-msgid "%Jinvalid use of structure with flexible array member"
+msgid "flexible array member in otherwise empty struct"
msgstr ""
-#: c-decl.c:6033
+#: c-decl.c:6845
#, gcc-internal-format
msgid "union cannot be made transparent"
msgstr ""
-#: c-decl.c:6104
+#: c-decl.c:6941
#, gcc-internal-format
msgid "nested redefinition of %<enum %E%>"
msgstr ""
#. This enum is a named one that has been declared already.
-#: c-decl.c:6111
+#: c-decl.c:6948
#, gcc-internal-format
msgid "redeclaration of %<enum %E%>"
msgstr ""
-#: c-decl.c:6174
+#: c-decl.c:7023
#, gcc-internal-format
msgid "enumeration values exceed range of largest integer"
msgstr ""
-#: c-decl.c:6191
+#: c-decl.c:7040
#, gcc-internal-format
msgid "specified mode too small for enumeral values"
msgstr ""
-#: c-decl.c:6287 c-decl.c:6302
+#: c-decl.c:7144 c-decl.c:7160
#, gcc-internal-format
msgid "enumerator value for %qE is not an integer constant"
msgstr ""
-#: c-decl.c:6297
+#: c-decl.c:7155
#, gcc-internal-format
msgid "enumerator value for %qE is not an integer constant expression"
msgstr ""
-#: c-decl.c:6321
+#: c-decl.c:7179
#, gcc-internal-format
msgid "overflow in enumeration values"
msgstr ""
-#: c-decl.c:6329
+#: c-decl.c:7187
#, gcc-internal-format
msgid "ISO C restricts enumerator values to range of %<int%>"
msgstr ""
-#: c-decl.c:6447
+#: c-decl.c:7272
+#, gcc-internal-format
+msgid "inline function %qD given attribute noinline"
+msgstr ""
+
+#: c-decl.c:7290
#, gcc-internal-format
msgid "return type is an incomplete type"
msgstr ""
-#: c-decl.c:6457
+#: c-decl.c:7300
#, gcc-internal-format
msgid "return type defaults to %<int%>"
msgstr ""
-#: c-decl.c:6530
+#: c-decl.c:7374
#, gcc-internal-format
-msgid "no previous prototype for %q+D"
+msgid "no previous prototype for %qD"
msgstr ""
-#: c-decl.c:6539
+#: c-decl.c:7383
#, gcc-internal-format
-msgid "%q+D was used with no prototype before its definition"
+msgid "%qD was used with no prototype before its definition"
msgstr ""
-#: c-decl.c:6545 cp/decl.c:11634
+#: c-decl.c:7390
#, gcc-internal-format
-msgid "no previous declaration for %q+D"
+msgid "no previous declaration for %qD"
msgstr ""
-#: c-decl.c:6555
+#: c-decl.c:7400
#, gcc-internal-format
-msgid "%q+D was used with no declaration before its definition"
+msgid "%qD was used with no declaration before its definition"
msgstr ""
-#: c-decl.c:6578
+#: c-decl.c:7423
#, gcc-internal-format
-msgid "return type of %q+D is not %<int%>"
+msgid "return type of %qD is not %<int%>"
msgstr ""
-#: c-decl.c:6583
+#: c-decl.c:7429
#, gcc-internal-format
-msgid "%q+D is normally a non-static function"
+msgid "%qD is normally a non-static function"
msgstr ""
-#: c-decl.c:6617
+#: c-decl.c:7464
#, gcc-internal-format
-msgid "%Jold-style parameter declarations in prototyped function definition"
+msgid "old-style parameter declarations in prototyped function definition"
msgstr ""
-#: c-decl.c:6631
+#: c-decl.c:7478
#, gcc-internal-format
-msgid "%Jtraditional C rejects ISO C style function definitions"
+msgid "traditional C rejects ISO C style function definitions"
msgstr ""
-#: c-decl.c:6648
+#: c-decl.c:7494
#, gcc-internal-format
-msgid "%Jparameter name omitted"
+msgid "parameter name omitted"
msgstr ""
-#: c-decl.c:6682
+#: c-decl.c:7529
#, gcc-internal-format
-msgid "%Jold-style function definition"
+msgid "old-style function definition"
msgstr ""
-#: c-decl.c:6691
+#: c-decl.c:7538
#, gcc-internal-format
-msgid "%Jparameter name missing from parameter list"
+msgid "parameter name missing from parameter list"
msgstr ""
-#: c-decl.c:6702
+#: c-decl.c:7550
#, gcc-internal-format
-msgid "%q+D declared as a non-parameter"
+msgid "%qD declared as a non-parameter"
msgstr ""
-#: c-decl.c:6707
+#: c-decl.c:7556
#, gcc-internal-format
-msgid "multiple parameters named %q+D"
+msgid "multiple parameters named %qD"
msgstr ""
-#: c-decl.c:6715
+#: c-decl.c:7565
#, gcc-internal-format
-msgid "parameter %q+D declared with void type"
+msgid "parameter %qD declared with void type"
msgstr ""
-#: c-decl.c:6732 c-decl.c:6734
+#: c-decl.c:7594 c-decl.c:7598
#, gcc-internal-format
-msgid "type of %q+D defaults to %<int%>"
+msgid "type of %qD defaults to %<int%>"
msgstr ""
-#: c-decl.c:6753
+#: c-decl.c:7618
#, gcc-internal-format
-msgid "parameter %q+D has incomplete type"
+msgid "parameter %qD has incomplete type"
msgstr ""
-#: c-decl.c:6759
+#: c-decl.c:7625
#, gcc-internal-format
-msgid "declaration for parameter %q+D but no such parameter"
+msgid "declaration for parameter %qD but no such parameter"
msgstr ""
-#: c-decl.c:6809
+#: c-decl.c:7677
#, gcc-internal-format
msgid "number of arguments doesn%'t match built-in prototype"
msgstr ""
-#: c-decl.c:6813
+#: c-decl.c:7688
#, gcc-internal-format
msgid "number of arguments doesn%'t match prototype"
msgstr ""
-#: c-decl.c:6814 c-decl.c:6866
+#: c-decl.c:7691 c-decl.c:7733 c-decl.c:7747
#, gcc-internal-format
-msgid "%Hprototype declaration"
+msgid "prototype declaration"
msgstr ""
-#: c-decl.c:6848
+#: c-decl.c:7725
#, gcc-internal-format
msgid "promoted argument %qD doesn%'t match built-in prototype"
msgstr ""
-#: c-decl.c:6852
+#: c-decl.c:7730
#, gcc-internal-format
msgid "promoted argument %qD doesn%'t match prototype"
msgstr ""
-#: c-decl.c:6855
-#, gcc-internal-format
-msgid "prototype declaration"
-msgstr ""
-
-#: c-decl.c:6861
+#: c-decl.c:7740
#, gcc-internal-format
msgid "argument %qD doesn%'t match built-in prototype"
msgstr ""
-#: c-decl.c:6865
+#: c-decl.c:7745
#, gcc-internal-format
msgid "argument %qD doesn%'t match prototype"
msgstr ""
-#: c-decl.c:7074 cp/decl.c:12338
+#: c-decl.c:7929 cp/decl.c:12448
#, gcc-internal-format
msgid "no return statement in function returning non-void"
msgstr ""
@@ -19965,443 +20900,158 @@ msgstr ""
#. If we get here, declarations have been used in a for loop without
#. the C99 for loop scope. This doesn't make much sense, so don't
#. allow it.
-#: c-decl.c:7147
+#: c-decl.c:8001
#, gcc-internal-format
msgid "%<for%> loop initial declarations are only allowed in C99 mode"
msgstr ""
-#: c-decl.c:7151
+#: c-decl.c:8006
#, gcc-internal-format
msgid "use option -std=c99 or -std=gnu99 to compile your code"
msgstr ""
-#: c-decl.c:7182
+#: c-decl.c:8040
#, gcc-internal-format
-msgid "declaration of static variable %q+D in %<for%> loop initial declaration"
+msgid "declaration of static variable %qD in %<for%> loop initial declaration"
msgstr ""
-#: c-decl.c:7185
+#: c-decl.c:8044
#, gcc-internal-format
msgid ""
-"declaration of %<extern%> variable %q+D in %<for%> loop initial declaration"
+"declaration of %<extern%> variable %qD in %<for%> loop initial declaration"
msgstr ""
-#: c-decl.c:7190
+#: c-decl.c:8051
#, gcc-internal-format
msgid "%<struct %E%> declared in %<for%> loop initial declaration"
msgstr ""
-#: c-decl.c:7194
+#: c-decl.c:8056
#, gcc-internal-format
msgid "%<union %E%> declared in %<for%> loop initial declaration"
msgstr ""
-#: c-decl.c:7198
+#: c-decl.c:8060
#, gcc-internal-format
msgid "%<enum %E%> declared in %<for%> loop initial declaration"
msgstr ""
-#: c-decl.c:7202
+#: c-decl.c:8064
#, gcc-internal-format
-msgid "declaration of non-variable %q+D in %<for%> loop initial declaration"
+msgid "declaration of non-variable %qD in %<for%> loop initial declaration"
msgstr ""
-#: c-decl.c:7487 c-decl.c:7729 c-decl.c:8036
+#: c-decl.c:8334 c-decl.c:8631 c-decl.c:8997
#, gcc-internal-format
msgid "duplicate %qE"
msgstr ""
-#: c-decl.c:7512 c-decl.c:7739 c-decl.c:7926
+#: c-decl.c:8360 c-decl.c:8642 c-decl.c:8874
#, gcc-internal-format
msgid "two or more data types in declaration specifiers"
msgstr ""
-#: c-decl.c:7524
+#: c-decl.c:8372 cp/parser.c:2183
#, gcc-internal-format
msgid "%<long long long%> is too long for GCC"
msgstr ""
-#: c-decl.c:7531 c-decl.c:7829
-#, gcc-internal-format
-msgid "both %<long long%> and %<double%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7536
+#: c-decl.c:8385
#, gcc-internal-format
msgid "ISO C90 does not support %<long long%>"
msgstr ""
-#: c-decl.c:7541 c-decl.c:7570
-#, gcc-internal-format
-msgid "both %<long%> and %<short%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7544 c-decl.c:7746
-#, gcc-internal-format
-msgid "both %<long%> and %<void%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7547 c-decl.c:7768
-#, gcc-internal-format
-msgid "both %<long%> and %<_Bool%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7550 c-decl.c:7790
-#, gcc-internal-format
-msgid "both %<long%> and %<char%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7553 c-decl.c:7810
-#, gcc-internal-format
-msgid "both %<long%> and %<float%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7556
-#, gcc-internal-format
-msgid "both %<long%> and %<_Decimal32%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7559
-#, gcc-internal-format
-msgid "both %<long%> and %<_Decimal64%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7562
-#, gcc-internal-format
-msgid "both %<long%> and %<_Decimal128%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7573 c-decl.c:7749
-#, gcc-internal-format
-msgid "both %<short%> and %<void%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7576 c-decl.c:7771
-#, gcc-internal-format
-msgid "both %<short%> and %<_Bool%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7579 c-decl.c:7793
-#, gcc-internal-format
-msgid "both %<short%> and %<char%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7582 c-decl.c:7813
-#, gcc-internal-format
-msgid "both %<short%> and %<float%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7585 c-decl.c:7832
-#, gcc-internal-format
-msgid "both %<short%> and %<double%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7588
-#, gcc-internal-format
-msgid "both %<short%> and %<_Decimal32%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7591
-#, gcc-internal-format
-msgid "both %<short%> and %<_Decimal64%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7594
-#, gcc-internal-format
-msgid "both %<short%> and %<_Decimal128%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7602 c-decl.c:7631
-#, gcc-internal-format
-msgid "both %<signed%> and %<unsigned%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7605 c-decl.c:7752
-#, gcc-internal-format
-msgid "both %<signed%> and %<void%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7608 c-decl.c:7774
-#, gcc-internal-format
-msgid "both %<signed%> and %<_Bool%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7611 c-decl.c:7816
-#, gcc-internal-format
-msgid "both %<signed%> and %<float%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7614 c-decl.c:7835
-#, gcc-internal-format
-msgid "both %<signed%> and %<double%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7617
-#, gcc-internal-format
-msgid "both %<signed%> and %<_Decimal32%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7620
-#, gcc-internal-format
-msgid "both %<signed%> and %<_Decimal64%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7623
-#, gcc-internal-format
-msgid "both %<signed%> and %<_Decimal128%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7634 c-decl.c:7755
-#, gcc-internal-format
-msgid "both %<unsigned%> and %<void%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7637 c-decl.c:7777
-#, gcc-internal-format
-msgid "both %<unsigned%> and %<_Bool%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7640 c-decl.c:7819
-#, gcc-internal-format
-msgid "both %<unsigned%> and %<float%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7643 c-decl.c:7838
-#, gcc-internal-format
-msgid "both %<unsigned%> and %<double%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7646
-#, gcc-internal-format
-msgid "both %<unsigned%> and %<_Decimal32%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7649
-#, gcc-internal-format
-msgid "both %<unsigned%> and %<_Decimal64%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7652
-#, gcc-internal-format
-msgid "both %<unsigned%> and %<_Decimal128%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7660
+#: c-decl.c:8543
#, gcc-internal-format
msgid "ISO C90 does not support complex types"
msgstr ""
-#: c-decl.c:7662 c-decl.c:7758
-#, gcc-internal-format
-msgid "both %<complex%> and %<void%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7665 c-decl.c:7780
-#, gcc-internal-format
-msgid "both %<complex%> and %<_Bool%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7668
-#, gcc-internal-format
-msgid "both %<complex%> and %<_Decimal32%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7671
-#, gcc-internal-format
-msgid "both %<complex%> and %<_Decimal64%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7674
-#, gcc-internal-format
-msgid "both %<complex%> and %<_Decimal128%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7677
-#, gcc-internal-format
-msgid "both %<complex%> and %<_Fract%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7680
-#, gcc-internal-format
-msgid "both %<complex%> and %<_Accum%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7683
-#, gcc-internal-format
-msgid "both %<complex%> and %<_Sat%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7690
+#: c-decl.c:8582
#, gcc-internal-format
msgid "ISO C does not support saturating types"
msgstr ""
-#: c-decl.c:7692 c-decl.c:7761
-#, gcc-internal-format
-msgid "both %<_Sat%> and %<void%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7695 c-decl.c:7783
-#, gcc-internal-format
-msgid "both %<_Sat%> and %<_Bool%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7698 c-decl.c:7796
-#, gcc-internal-format
-msgid "both %<_Sat%> and %<char%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7701 c-decl.c:7803
-#, gcc-internal-format
-msgid "both %<_Sat%> and %<int%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7704 c-decl.c:7822
-#, gcc-internal-format
-msgid "both %<_Sat%> and %<float%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7707 c-decl.c:7841
-#, gcc-internal-format
-msgid "both %<_Sat%> and %<double%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7710
-#, gcc-internal-format
-msgid "both %<_Sat%> and %<_Decimal32%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7713
-#, gcc-internal-format
-msgid "both %<_Sat%> and %<_Decimal64%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7716
-#, gcc-internal-format
-msgid "both %<_Sat%> and %<_Decimal128%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7719
-#, gcc-internal-format
-msgid "both %<_Sat%> and %<complex%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7858
-#, gcc-internal-format
-msgid "both %<long long%> and %<%s%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7861
-#, gcc-internal-format
-msgid "both %<long%> and %<%s%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7864
-#, gcc-internal-format
-msgid "both %<short%> and %<%s%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7867
-#, gcc-internal-format
-msgid "both %<signed%> and %<%s%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7870
-#, gcc-internal-format
-msgid "both %<unsigned%> and %<%s%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7873 c-decl.c:7899
-#, gcc-internal-format
-msgid "both %<complex%> and %<%s%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7876
-#, gcc-internal-format
-msgid "both %<_Sat%> and %<%s%> in declaration specifiers"
-msgstr ""
-
-#: c-decl.c:7886
-#, gcc-internal-format
-msgid "decimal floating point not supported for this target"
-msgstr ""
-
-#: c-decl.c:7888
+#: c-decl.c:8833
#, gcc-internal-format
msgid "ISO C does not support decimal floating point"
msgstr ""
-#: c-decl.c:7907 c-decl.c:8097 c-parser.c:5189
+#: c-decl.c:8855 c-decl.c:9058 c-parser.c:5337
#, gcc-internal-format
msgid "fixed-point types not supported for this target"
msgstr ""
-#: c-decl.c:7909
+#: c-decl.c:8857
#, gcc-internal-format
msgid "ISO C does not support fixed-point types"
msgstr ""
-#: c-decl.c:7943
+#: c-decl.c:8891
+#, gcc-internal-format
+msgid "C++ lookup of %qD would return a field, not a type"
+msgstr ""
+
+#: c-decl.c:8904
#, gcc-internal-format
msgid "%qE fails to be a typedef or built in type"
msgstr ""
-#: c-decl.c:7987
+#: c-decl.c:8948
#, gcc-internal-format
msgid "%qE is not at beginning of declaration"
msgstr ""
-#: c-decl.c:8001
+#: c-decl.c:8962
#, gcc-internal-format
msgid "%<__thread%> used with %<auto%>"
msgstr ""
-#: c-decl.c:8003
+#: c-decl.c:8964
#, gcc-internal-format
msgid "%<__thread%> used with %<register%>"
msgstr ""
-#: c-decl.c:8005
+#: c-decl.c:8966
#, gcc-internal-format
msgid "%<__thread%> used with %<typedef%>"
msgstr ""
-#: c-decl.c:8016
+#: c-decl.c:8977
#, gcc-internal-format
msgid "%<__thread%> before %<extern%>"
msgstr ""
-#: c-decl.c:8025
+#: c-decl.c:8986
#, gcc-internal-format
msgid "%<__thread%> before %<static%>"
msgstr ""
-#: c-decl.c:8041
+#: c-decl.c:9002
#, gcc-internal-format
msgid "multiple storage classes in declaration specifiers"
msgstr ""
-#: c-decl.c:8048
+#: c-decl.c:9009
#, gcc-internal-format
msgid "%<__thread%> used with %qE"
msgstr ""
-#: c-decl.c:8095
+#: c-decl.c:9056
#, gcc-internal-format
msgid "%<_Sat%> is used without %<_Fract%> or %<_Accum%>"
msgstr ""
-#: c-decl.c:8109
+#: c-decl.c:9070
#, gcc-internal-format
msgid "ISO C does not support plain %<complex%> meaning %<double complex%>"
msgstr ""
-#: c-decl.c:8154 c-decl.c:8180
+#: c-decl.c:9115 c-decl.c:9141
#, gcc-internal-format
msgid "ISO C does not support complex integer types"
msgstr ""
-#: c-decl.c:8334 toplev.c:847
+#: c-decl.c:9295 toplev.c:862
#, gcc-internal-format
msgid "%q+F used but never defined"
msgstr ""
@@ -20441,293 +21091,293 @@ msgstr ""
msgid "format string argument follows the args to be formatted"
msgstr ""
-#: c-format.c:933
+#: c-format.c:923
#, gcc-internal-format
msgid "function might be possible candidate for %qs format attribute"
msgstr ""
-#: c-format.c:1025 c-format.c:1046 c-format.c:2065
+#: c-format.c:1015 c-format.c:1036 c-format.c:2060
#, gcc-internal-format
msgid "missing $ operand number in format"
msgstr ""
-#: c-format.c:1055
+#: c-format.c:1045
#, gcc-internal-format
msgid "%s does not support %%n$ operand number formats"
msgstr ""
-#: c-format.c:1062
+#: c-format.c:1052
#, gcc-internal-format
msgid "operand number out of range in format"
msgstr ""
-#: c-format.c:1085
+#: c-format.c:1075
#, gcc-internal-format
msgid "format argument %d used more than once in %s format"
msgstr ""
-#: c-format.c:1117
+#: c-format.c:1107
#, gcc-internal-format
msgid "$ operand number used after format without operand number"
msgstr ""
-#: c-format.c:1148
+#: c-format.c:1138
#, gcc-internal-format
msgid "format argument %d unused before used argument %d in $-style format"
msgstr ""
-#: c-format.c:1243
+#: c-format.c:1233
#, gcc-internal-format
msgid "format not a string literal, format string not checked"
msgstr ""
-#: c-format.c:1258 c-format.c:1261
+#: c-format.c:1248 c-format.c:1251
#, gcc-internal-format
msgid "format not a string literal and no format arguments"
msgstr ""
-#: c-format.c:1264
+#: c-format.c:1254
#, gcc-internal-format
msgid "format not a string literal, argument types not checked"
msgstr ""
-#: c-format.c:1277
+#: c-format.c:1267
#, gcc-internal-format
msgid "too many arguments for format"
msgstr ""
-#: c-format.c:1280
+#: c-format.c:1270
#, gcc-internal-format
msgid "unused arguments in $-style format"
msgstr ""
-#: c-format.c:1283
+#: c-format.c:1273
#, gcc-internal-format
msgid "zero-length %s format string"
msgstr ""
-#: c-format.c:1287
+#: c-format.c:1277
#, gcc-internal-format
msgid "format is a wide character string"
msgstr ""
-#: c-format.c:1290
+#: c-format.c:1280
#, gcc-internal-format
msgid "unterminated format string"
msgstr ""
-#: c-format.c:1498
+#: c-format.c:1489
#, gcc-internal-format
msgid "embedded %<\\0%> in format"
msgstr ""
-#: c-format.c:1513
+#: c-format.c:1504
#, gcc-internal-format
msgid "spurious trailing %<%%%> in format"
msgstr ""
-#: c-format.c:1557 c-format.c:1828
+#: c-format.c:1548 c-format.c:1823
#, gcc-internal-format
msgid "repeated %s in format"
msgstr ""
-#: c-format.c:1570
+#: c-format.c:1561
#, gcc-internal-format
msgid "missing fill character at end of strfmon format"
msgstr ""
-#: c-format.c:1614 c-format.c:1716 c-format.c:2012 c-format.c:2077
+#: c-format.c:1605 c-format.c:1708 c-format.c:2007 c-format.c:2072
#, gcc-internal-format
msgid "too few arguments for format"
msgstr ""
-#: c-format.c:1655
+#: c-format.c:1647
#, gcc-internal-format
msgid "zero width in %s format"
msgstr ""
-#: c-format.c:1673
+#: c-format.c:1665
#, gcc-internal-format
msgid "empty left precision in %s format"
msgstr ""
-#: c-format.c:1746
+#: c-format.c:1739
#, gcc-internal-format
msgid "empty precision in %s format"
msgstr ""
-#: c-format.c:1812
+#: c-format.c:1807
#, gcc-internal-format
msgid "%s does not support the %qs %s length modifier"
msgstr ""
-#: c-format.c:1845
+#: c-format.c:1840
#, gcc-internal-format
msgid "conversion lacks type at end of format"
msgstr ""
-#: c-format.c:1856
+#: c-format.c:1851
#, gcc-internal-format
msgid "unknown conversion type character %qc in format"
msgstr ""
-#: c-format.c:1859
+#: c-format.c:1854
#, gcc-internal-format
msgid "unknown conversion type character 0x%x in format"
msgstr ""
-#: c-format.c:1866
+#: c-format.c:1861
#, gcc-internal-format
msgid "%s does not support the %<%%%c%> %s format"
msgstr ""
-#: c-format.c:1882
+#: c-format.c:1877
#, gcc-internal-format
msgid "%s used with %<%%%c%> %s format"
msgstr ""
-#: c-format.c:1891
+#: c-format.c:1886
#, gcc-internal-format
msgid "%s does not support %s"
msgstr ""
-#: c-format.c:1901
+#: c-format.c:1896
#, gcc-internal-format
msgid "%s does not support %s with the %<%%%c%> %s format"
msgstr ""
-#: c-format.c:1937
+#: c-format.c:1932
#, gcc-internal-format
msgid "%s ignored with %s and %<%%%c%> %s format"
msgstr ""
-#: c-format.c:1941
+#: c-format.c:1936
#, gcc-internal-format
msgid "%s ignored with %s in %s format"
msgstr ""
-#: c-format.c:1948
+#: c-format.c:1943
#, gcc-internal-format
msgid "use of %s and %s together with %<%%%c%> %s format"
msgstr ""
-#: c-format.c:1952
+#: c-format.c:1947
#, gcc-internal-format
msgid "use of %s and %s together in %s format"
msgstr ""
-#: c-format.c:1971
+#: c-format.c:1966
#, gcc-internal-format
msgid "%<%%%c%> yields only last 2 digits of year in some locales"
msgstr ""
-#: c-format.c:1974
+#: c-format.c:1969
#, gcc-internal-format
msgid "%<%%%c%> yields only last 2 digits of year"
msgstr ""
#. The end of the format string was reached.
-#: c-format.c:1991
+#: c-format.c:1986
#, gcc-internal-format
msgid "no closing %<]%> for %<%%[%> format"
msgstr ""
-#: c-format.c:2005
+#: c-format.c:2000
#, gcc-internal-format
msgid "use of %qs length modifier with %qc type character"
msgstr ""
-#: c-format.c:2027
+#: c-format.c:2022
#, gcc-internal-format
msgid "%s does not support the %<%%%s%c%> %s format"
msgstr ""
-#: c-format.c:2044
+#: c-format.c:2039
#, gcc-internal-format
msgid "operand number specified with suppressed assignment"
msgstr ""
-#: c-format.c:2047
+#: c-format.c:2042
#, gcc-internal-format
msgid "operand number specified for format taking no argument"
msgstr ""
-#: c-format.c:2180
+#: c-format.c:2178
#, gcc-internal-format
msgid "writing through null pointer (argument %d)"
msgstr ""
-#: c-format.c:2188
+#: c-format.c:2186
#, gcc-internal-format
msgid "reading through null pointer (argument %d)"
msgstr ""
-#: c-format.c:2208
+#: c-format.c:2206
#, gcc-internal-format
msgid "writing into constant object (argument %d)"
msgstr ""
-#: c-format.c:2219
+#: c-format.c:2217
#, gcc-internal-format
msgid "extra type qualifiers in format argument (argument %d)"
msgstr ""
-#: c-format.c:2330
+#: c-format.c:2334
#, gcc-internal-format
msgid "%s should have type %<%s%s%>, but argument %d has type %qT"
msgstr ""
-#: c-format.c:2334
+#: c-format.c:2338
#, gcc-internal-format
msgid "format %q.*s expects type %<%s%s%>, but argument %d has type %qT"
msgstr ""
-#: c-format.c:2342
+#: c-format.c:2346
#, gcc-internal-format
msgid "%s should have type %<%T%s%>, but argument %d has type %qT"
msgstr ""
-#: c-format.c:2346
+#: c-format.c:2350
#, gcc-internal-format
msgid "format %q.*s expects type %<%T%s%>, but argument %d has type %qT"
msgstr ""
-#: c-format.c:2405 c-format.c:2411 c-format.c:2562
+#: c-format.c:2409 c-format.c:2415 c-format.c:2566
#, gcc-internal-format
msgid "%<__gcc_host_wide_int__%> is not defined as a type"
msgstr ""
-#: c-format.c:2418 c-format.c:2572
+#: c-format.c:2422 c-format.c:2576
#, gcc-internal-format
msgid "%<__gcc_host_wide_int__%> is not defined as %<long%> or %<long long%>"
msgstr ""
-#: c-format.c:2468
+#: c-format.c:2472
#, gcc-internal-format
msgid "%<locus%> is not defined as a type"
msgstr ""
-#: c-format.c:2521
+#: c-format.c:2525
#, gcc-internal-format
msgid "%<location_t%> is not defined as a type"
msgstr ""
-#: c-format.c:2538
+#: c-format.c:2542
#, gcc-internal-format
msgid "%<tree%> is not defined as a type"
msgstr ""
-#: c-format.c:2543
+#: c-format.c:2547
#, gcc-internal-format
msgid "%<tree%> is not defined as a pointer type"
msgstr ""
-#: c-format.c:2850
+#: c-format.c:2818
#, gcc-internal-format
msgid "args to be formatted is not %<...%>"
msgstr ""
-#: c-format.c:2862
+#: c-format.c:2830
#, gcc-internal-format
msgid "strftime formats cannot format arguments"
msgstr ""
@@ -20739,13 +21389,13 @@ msgstr ""
#: c-lex.c:267
#, gcc-internal-format
-msgid "%Hignoring #pragma %s %s"
+msgid "ignoring #pragma %s %s"
msgstr ""
#. ... or not.
#: c-lex.c:382
#, gcc-internal-format
-msgid "%Hstray %<@%> in program"
+msgid "stray %<@%> in program"
msgstr ""
#: c-lex.c:397
@@ -20803,7 +21453,7 @@ msgstr ""
msgid "floating constant truncated to zero"
msgstr ""
-#: c-lex.c:929
+#: c-lex.c:929 cp/parser.c:2978
#, gcc-internal-format
msgid "unsupported non-standard concatenation of string literals"
msgstr ""
@@ -20813,37 +21463,37 @@ msgstr ""
msgid "traditional C rejects string constant concatenation"
msgstr ""
-#: c-omp.c:119
+#: c-omp.c:126
#, gcc-internal-format
msgid "invalid expression type for %<#pragma omp atomic%>"
msgstr ""
-#: c-omp.c:245
+#: c-omp.c:260 cp/semantics.c:4408
#, gcc-internal-format
msgid "invalid type for iteration variable %qE"
msgstr ""
-#: c-omp.c:258
+#: c-omp.c:273
#, gcc-internal-format
msgid "%qE is not initialized"
msgstr ""
-#: c-omp.c:271
+#: c-omp.c:290 cp/semantics.c:4323
#, gcc-internal-format
msgid "missing controlling predicate"
msgstr ""
-#: c-omp.c:349
+#: c-omp.c:368 cp/semantics.c:4080
#, gcc-internal-format
msgid "invalid controlling predicate"
msgstr ""
-#: c-omp.c:356
+#: c-omp.c:375 cp/semantics.c:4329
#, gcc-internal-format
msgid "missing increment expression"
msgstr ""
-#: c-omp.c:423
+#: c-omp.c:444 cp/semantics.c:4185
#, gcc-internal-format
msgid "invalid increment expression"
msgstr ""
@@ -20878,168 +21528,178 @@ msgstr ""
msgid "missing makefile target after %qs"
msgstr ""
-#: c-opts.c:325
+#: c-opts.c:326
#, gcc-internal-format
msgid "-I- specified twice"
msgstr ""
-#: c-opts.c:328
+#: c-opts.c:329
#, gcc-internal-format
msgid "obsolete option -I- used, please use -iquote instead"
msgstr ""
-#: c-opts.c:506
+#: c-opts.c:513
#, gcc-internal-format
msgid "argument %qs to %<-Wnormalized%> not recognized"
msgstr ""
-#: c-opts.c:589
+#: c-opts.c:596
#, gcc-internal-format
msgid "switch %qs is no longer supported"
msgstr ""
-#: c-opts.c:696
+#: c-opts.c:703
#, gcc-internal-format
msgid ""
"-fhandle-exceptions has been renamed -fexceptions (and is now on by default)"
msgstr ""
-#: c-opts.c:1035
+#: c-opts.c:1050 collect2.c:1495 fortran/options.c:258
+#, gcc-internal-format
+msgid "LTO support has not been enabled in this configuration"
+msgstr ""
+
+#: c-opts.c:1057 fortran/options.c:265
+#, gcc-internal-format
+msgid "-flto and -fwhopr are mutually exclusive"
+msgstr ""
+
+#: c-opts.c:1065
#, gcc-internal-format
msgid "-fexcess-precision=standard for C++"
msgstr ""
-#: c-opts.c:1048
+#: c-opts.c:1078
#, gcc-internal-format
msgid "-fno-gnu89-inline is only supported in GNU99 or C99 mode"
msgstr ""
-#: c-opts.c:1127
+#: c-opts.c:1157
#, gcc-internal-format
msgid "-Wformat-y2k ignored without -Wformat"
msgstr ""
-#: c-opts.c:1129
+#: c-opts.c:1159
#, gcc-internal-format
msgid "-Wformat-extra-args ignored without -Wformat"
msgstr ""
-#: c-opts.c:1131
+#: c-opts.c:1161
#, gcc-internal-format
msgid "-Wformat-zero-length ignored without -Wformat"
msgstr ""
-#: c-opts.c:1133
+#: c-opts.c:1163
#, gcc-internal-format
msgid "-Wformat-nonliteral ignored without -Wformat"
msgstr ""
-#: c-opts.c:1135
+#: c-opts.c:1165
#, gcc-internal-format
msgid "-Wformat-contains-nul ignored without -Wformat"
msgstr ""
-#: c-opts.c:1137
+#: c-opts.c:1167
#, gcc-internal-format
msgid "-Wformat-security ignored without -Wformat"
msgstr ""
-#: c-opts.c:1161
+#: c-opts.c:1191
#, gcc-internal-format
msgid "opening output file %s: %m"
msgstr ""
-#: c-opts.c:1166
+#: c-opts.c:1196
#, gcc-internal-format
msgid "too many filenames given. Type %s --help for usage"
msgstr ""
-#: c-opts.c:1246
+#: c-opts.c:1276
#, gcc-internal-format
msgid "The C parser does not support -dy, option ignored"
msgstr ""
-#: c-opts.c:1250
+#: c-opts.c:1280
#, gcc-internal-format
msgid "The Objective-C parser does not support -dy, option ignored"
msgstr ""
-#: c-opts.c:1253
+#: c-opts.c:1283
#, gcc-internal-format
msgid "The C++ parser does not support -dy, option ignored"
msgstr ""
-#: c-opts.c:1257
+#: c-opts.c:1287
#, gcc-internal-format
msgid "The Objective-C++ parser does not support -dy, option ignored"
msgstr ""
-#: c-opts.c:1308
+#: c-opts.c:1338
#, gcc-internal-format
msgid "opening dependency file %s: %m"
msgstr ""
-#: c-opts.c:1318
+#: c-opts.c:1348
#, gcc-internal-format
msgid "closing dependency file %s: %m"
msgstr ""
-#: c-opts.c:1321
+#: c-opts.c:1351
#, gcc-internal-format
msgid "when writing output to %s: %m"
msgstr ""
-#: c-opts.c:1401
+#: c-opts.c:1431
#, gcc-internal-format
msgid "to generate dependencies you must specify either -M or -MM"
msgstr ""
-#: c-opts.c:1424
+#: c-opts.c:1454
#, gcc-internal-format
msgid "-MG may only be used with -M or -MM"
msgstr ""
-#: c-opts.c:1454
+#: c-opts.c:1484
#, gcc-internal-format
msgid "-fdirectives-only is incompatible with -Wunused_macros"
msgstr ""
-#: c-opts.c:1456
+#: c-opts.c:1486
#, gcc-internal-format
msgid "-fdirectives-only is incompatible with -traditional"
msgstr ""
-#: c-opts.c:1594
+#: c-opts.c:1624
#, gcc-internal-format
msgid "too late for # directive to set debug directory"
msgstr ""
-#: c-parser.c:225
+#: c-parser.c:226
#, gcc-internal-format
msgid "identifier %qE conflicts with C++ keyword"
msgstr ""
-#: c-parser.c:974
+#: c-parser.c:979
#, gcc-internal-format
msgid "ISO C forbids an empty translation unit"
msgstr ""
-#: c-parser.c:1060 c-parser.c:6319
+#: c-parser.c:1065 c-parser.c:6430
#, gcc-internal-format
msgid "ISO C does not allow extra %<;%> outside of a function"
msgstr ""
-#: c-parser.c:1164 c-parser.c:6881
+#: c-parser.c:1169 c-parser.c:6992
#, gcc-internal-format
msgid "expected declaration specifiers"
msgstr ""
-#: c-parser.c:1212
+#: c-parser.c:1217
#, gcc-internal-format
msgid "data definition has no type or storage class"
msgstr ""
-#: c-parser.c:1266
+#: c-parser.c:1275
#, gcc-internal-format
msgid "expected %<,%> or %<;%>"
msgstr ""
@@ -21047,188 +21707,188 @@ msgstr ""
#. This can appear in many cases looking nothing like a
#. function definition, so we don't give a more specific
#. error suggesting there was one.
-#: c-parser.c:1273 c-parser.c:1289
+#: c-parser.c:1282 c-parser.c:1298
#, gcc-internal-format
msgid "expected %<=%>, %<,%>, %<;%>, %<asm%> or %<__attribute__%>"
msgstr ""
-#: c-parser.c:1281
+#: c-parser.c:1290
#, gcc-internal-format
msgid "ISO C forbids nested functions"
msgstr ""
-#: c-parser.c:1656 c-parser.c:2467 c-parser.c:3117 c-parser.c:3380
-#: c-parser.c:4331 c-parser.c:4970 c-parser.c:5395 c-parser.c:5417
-#: c-parser.c:5524 c-parser.c:5705 c-parser.c:5734 c-parser.c:5961
-#: c-parser.c:5973 c-parser.c:5998 c-parser.c:6132 c-parser.c:6161
-#: c-parser.c:6169 c-parser.c:6197 c-parser.c:6211 c-parser.c:6427
-#: c-parser.c:6526 c-parser.c:7051 c-parser.c:7756
+#: c-parser.c:1675 c-parser.c:2495 c-parser.c:3146 c-parser.c:3415
+#: c-parser.c:4403 c-parser.c:4493 c-parser.c:5111 c-parser.c:5549
+#: c-parser.c:5571 c-parser.c:5678 c-parser.c:5867 c-parser.c:5896
+#: c-parser.c:6072 c-parser.c:6084 c-parser.c:6109 c-parser.c:6243
+#: c-parser.c:6272 c-parser.c:6280 c-parser.c:6308 c-parser.c:6322
+#: c-parser.c:6538 c-parser.c:6637 c-parser.c:7166 c-parser.c:7894
#, gcc-internal-format
msgid "expected identifier"
msgstr ""
-#: c-parser.c:1689 cp/parser.c:11978
+#: c-parser.c:1708 cp/parser.c:12649
#, gcc-internal-format
msgid "comma at end of enumerator list"
msgstr ""
-#: c-parser.c:1695
+#: c-parser.c:1714
#, gcc-internal-format
msgid "expected %<,%> or %<}%>"
msgstr ""
-#: c-parser.c:1711 c-parser.c:1898 c-parser.c:6286
+#: c-parser.c:1730 c-parser.c:1925 c-parser.c:6397
#, gcc-internal-format
msgid "expected %<{%>"
msgstr ""
-#: c-parser.c:1725
+#: c-parser.c:1744
#, gcc-internal-format
msgid "ISO C forbids forward references to %<enum%> types"
msgstr ""
-#: c-parser.c:1831
+#: c-parser.c:1858
#, gcc-internal-format
msgid "expected class name"
msgstr ""
-#: c-parser.c:1850 c-parser.c:6065
+#: c-parser.c:1877 c-parser.c:6176
#, gcc-internal-format
msgid "extra semicolon in struct or union specified"
msgstr ""
-#: c-parser.c:1879
+#: c-parser.c:1906
#, gcc-internal-format
msgid "no semicolon at end of struct or union"
msgstr ""
-#: c-parser.c:1882
+#: c-parser.c:1909
#, gcc-internal-format
msgid "expected %<;%>"
msgstr ""
-#: c-parser.c:1965 c-parser.c:2943
+#: c-parser.c:1992 c-parser.c:2971
#, gcc-internal-format
msgid "expected specifier-qualifier-list"
msgstr ""
-#: c-parser.c:1975
+#: c-parser.c:2002
#, gcc-internal-format
msgid "ISO C forbids member declarations with no members"
msgstr ""
-#: c-parser.c:2051
+#: c-parser.c:2078
#, gcc-internal-format
msgid "expected %<,%>, %<;%> or %<}%>"
msgstr ""
-#: c-parser.c:2058
+#: c-parser.c:2085
#, gcc-internal-format
msgid "expected %<:%>, %<,%>, %<;%>, %<}%> or %<__attribute__%>"
msgstr ""
-#: c-parser.c:2111
+#: c-parser.c:2138
#, gcc-internal-format
msgid "%<typeof%> applied to a bit-field"
msgstr ""
-#: c-parser.c:2335
+#: c-parser.c:2362
#, gcc-internal-format
msgid "expected identifier or %<(%>"
msgstr ""
-#: c-parser.c:2537
+#: c-parser.c:2565
#, gcc-internal-format
msgid "ISO C requires a named argument before %<...%>"
msgstr ""
-#: c-parser.c:2645
+#: c-parser.c:2673
#, gcc-internal-format
msgid "expected declaration specifiers or %<...%>"
msgstr ""
-#: c-parser.c:2696
+#: c-parser.c:2724
#, gcc-internal-format
msgid "wide string literal in %<asm%>"
msgstr ""
-#: c-parser.c:2702 c-parser.c:6936
+#: c-parser.c:2730 c-parser.c:7047 cp/parser.c:22825
#, gcc-internal-format
msgid "expected string literal"
msgstr ""
-#: c-parser.c:3035
+#: c-parser.c:3064
#, gcc-internal-format
msgid "ISO C forbids empty initializer braces"
msgstr ""
-#: c-parser.c:3083
+#: c-parser.c:3112
#, gcc-internal-format
msgid "obsolete use of designated initializer with %<:%>"
msgstr ""
-#: c-parser.c:3215
+#: c-parser.c:3247
#, gcc-internal-format
msgid "ISO C forbids specifying range of elements to initialize"
msgstr ""
-#: c-parser.c:3228
+#: c-parser.c:3260
#, gcc-internal-format
msgid "ISO C90 forbids specifying subobject to initialize"
msgstr ""
-#: c-parser.c:3235
+#: c-parser.c:3267
#, gcc-internal-format
msgid "obsolete use of designated initializer without %<=%>"
msgstr ""
-#: c-parser.c:3242
+#: c-parser.c:3274
#, gcc-internal-format
msgid "expected %<=%>"
msgstr ""
-#: c-parser.c:3395
+#: c-parser.c:3430
#, gcc-internal-format
msgid "ISO C forbids label declarations"
msgstr ""
-#: c-parser.c:3401 c-parser.c:3481
+#: c-parser.c:3436 c-parser.c:3516
#, gcc-internal-format
msgid "expected declaration or statement"
msgstr ""
-#: c-parser.c:3433 c-parser.c:3462
+#: c-parser.c:3468 c-parser.c:3497
#, gcc-internal-format
msgid "ISO C90 forbids mixed declarations and code"
msgstr ""
-#: c-parser.c:3489
+#: c-parser.c:3524
#, gcc-internal-format
msgid "expected %<}%> before %<else%>"
msgstr ""
-#: c-parser.c:3494
+#: c-parser.c:3529 cp/parser.c:7838
#, gcc-internal-format
msgid "%<else%> without a previous %<if%>"
msgstr ""
-#: c-parser.c:3511
+#: c-parser.c:3546
#, gcc-internal-format
msgid "label at end of compound statement"
msgstr ""
-#: c-parser.c:3556
+#: c-parser.c:3591
#, gcc-internal-format
msgid "expected %<:%> or %<...%>"
msgstr ""
-#: c-parser.c:3590
+#: c-parser.c:3624
#, gcc-internal-format
msgid ""
"a label can only be part of a statement and a declaration is not a statement"
msgstr ""
-#: c-parser.c:3752
+#: c-parser.c:3788
#, gcc-internal-format
msgid "expected identifier or %<*%>"
msgstr ""
@@ -21237,279 +21897,279 @@ msgstr ""
#. c_parser_skip_until_found stops at a closing nesting
#. delimiter without consuming it, but here we need to consume
#. it to proceed further.
-#: c-parser.c:3816
+#: c-parser.c:3852
#, gcc-internal-format
msgid "expected statement"
msgstr ""
-#: c-parser.c:3911 cp/parser.c:7294
+#: c-parser.c:3950 cp/parser.c:7920
#, gcc-internal-format
msgid "suggest braces around empty body in an %<if%> statement"
msgstr ""
-#: c-parser.c:3937 cp/parser.c:7315
+#: c-parser.c:3978 cp/parser.c:7943
#, gcc-internal-format
msgid "suggest braces around empty body in an %<else%> statement"
msgstr ""
-#: c-parser.c:4057
+#: c-parser.c:4109
#, gcc-internal-format
msgid "suggest braces around empty body in %<do%> statement"
msgstr ""
-#: c-parser.c:4210
+#: c-parser.c:4270
#, gcc-internal-format
msgid "%E qualifier ignored on asm"
msgstr ""
-#: c-parser.c:4507
+#: c-parser.c:4621
#, gcc-internal-format
msgid "ISO C forbids omitting the middle term of a ?: expression"
msgstr ""
-#: c-parser.c:4939
+#: c-parser.c:5076
#, gcc-internal-format
msgid "traditional C rejects the unary plus operator"
msgstr ""
-#: c-parser.c:5056
+#: c-parser.c:5200
#, gcc-internal-format
msgid "%<sizeof%> applied to a bit-field"
msgstr ""
-#: c-parser.c:5217 c-parser.c:5561 c-parser.c:5581
+#: c-parser.c:5365 c-parser.c:5715 c-parser.c:5735
#, gcc-internal-format
msgid "expected expression"
msgstr ""
-#: c-parser.c:5243
+#: c-parser.c:5391
#, gcc-internal-format
msgid "braced-group within expression allowed only inside a function"
msgstr ""
-#: c-parser.c:5256
+#: c-parser.c:5404
#, gcc-internal-format
msgid "ISO C forbids braced-groups within expressions"
msgstr ""
-#: c-parser.c:5455
+#: c-parser.c:5609
#, gcc-internal-format
msgid "first argument to %<__builtin_choose_expr%> not a constant"
msgstr ""
-#: c-parser.c:5612
+#: c-parser.c:5770
#, gcc-internal-format
msgid "compound literal has variable size"
msgstr ""
-#: c-parser.c:5620
+#: c-parser.c:5778
#, gcc-internal-format
msgid "ISO C90 forbids compound literals"
msgstr ""
-#: c-parser.c:6282
+#: c-parser.c:6393
#, gcc-internal-format
msgid "extra semicolon in method definition specified"
msgstr ""
-#: c-parser.c:6830
+#: c-parser.c:6941 cp/parser.c:22869
#, gcc-internal-format
msgid "%<#pragma omp barrier%> may only be used in compound statements"
msgstr ""
-#: c-parser.c:6841
+#: c-parser.c:6952 cp/parser.c:22884
#, gcc-internal-format
msgid "%<#pragma omp flush%> may only be used in compound statements"
msgstr ""
-#: c-parser.c:6852
+#: c-parser.c:6963 cp/parser.c:22900
#, gcc-internal-format
msgid "%<#pragma omp taskwait%> may only be used in compound statements"
msgstr ""
-#: c-parser.c:6865
+#: c-parser.c:6976 cp/parser.c:22928
#, gcc-internal-format
msgid ""
"%<#pragma omp section%> may only be used in %<#pragma omp sections%> "
"construct"
msgstr ""
-#: c-parser.c:6871
+#: c-parser.c:6982 cp/parser.c:22859
#, gcc-internal-format
msgid "%<#pragma GCC pch_preprocess%> must be first"
msgstr ""
-#: c-parser.c:7029
+#: c-parser.c:7141 cp/parser.c:21149
#, gcc-internal-format
msgid "too many %qs clauses"
msgstr ""
-#: c-parser.c:7125
+#: c-parser.c:7243 cp/parser.c:21263
#, gcc-internal-format
msgid "collapse argument needs positive constant integer expression"
msgstr ""
-#: c-parser.c:7190
+#: c-parser.c:7309
#, gcc-internal-format
msgid "expected %<none%> or %<shared%>"
msgstr ""
-#: c-parser.c:7233
+#: c-parser.c:7353
#, gcc-internal-format
msgid "expected %<(%>"
msgstr ""
-#: c-parser.c:7278 c-parser.c:7463
+#: c-parser.c:7400 c-parser.c:7592
#, gcc-internal-format
msgid "expected integer expression"
msgstr ""
-#: c-parser.c:7288
+#: c-parser.c:7412
#, gcc-internal-format
msgid "%<num_threads%> value must be positive"
msgstr ""
-#: c-parser.c:7368
+#: c-parser.c:7495
#, gcc-internal-format
msgid "expected %<+%>, %<*%>, %<-%>, %<&%>, %<^%>, %<|%>, %<&&%>, or %<||%>"
msgstr ""
-#: c-parser.c:7454
+#: c-parser.c:7583 cp/parser.c:21551
#, gcc-internal-format
msgid "schedule %<runtime%> does not take a %<chunk_size%> parameter"
msgstr ""
-#: c-parser.c:7458
+#: c-parser.c:7587 cp/parser.c:21554
#, gcc-internal-format
msgid "schedule %<auto%> does not take a %<chunk_size%> parameter"
msgstr ""
-#: c-parser.c:7476
+#: c-parser.c:7605
#, gcc-internal-format
msgid "invalid schedule kind"
msgstr ""
-#: c-parser.c:7594
+#: c-parser.c:7725
#, gcc-internal-format
msgid "expected %<#pragma omp%> clause"
msgstr ""
-#: c-parser.c:7603
+#: c-parser.c:7734 cp/parser.c:21702
#, gcc-internal-format
msgid "%qs is not valid for %qs"
msgstr ""
-#: c-parser.c:7705
+#: c-parser.c:7838
#, gcc-internal-format
msgid "invalid operator for %<#pragma omp atomic%>"
msgstr ""
-#: c-parser.c:7759 c-parser.c:7779
+#: c-parser.c:7897 c-parser.c:7918
#, gcc-internal-format
msgid "expected %<(%> or end of line"
msgstr ""
-#: c-parser.c:7811
+#: c-parser.c:7952
#, gcc-internal-format
msgid "for statement expected"
msgstr ""
-#: c-parser.c:7864
+#: c-parser.c:8005 cp/semantics.c:4313 cp/semantics.c:4383
#, gcc-internal-format
msgid "expected iteration declaration or initialization"
msgstr ""
-#: c-parser.c:7944
+#: c-parser.c:8085
#, gcc-internal-format
msgid "not enough perfectly nested loops"
msgstr ""
-#: c-parser.c:7992
+#: c-parser.c:8138 cp/parser.c:22407
#, gcc-internal-format
msgid "collapsed loops not perfectly nested"
msgstr ""
-#: c-parser.c:8029 cp/pt.c:10584
+#: c-parser.c:8176 cp/parser.c:22251 cp/parser.c:22289 cp/pt.c:11018
#, gcc-internal-format
msgid "iteration variable %qD should not be firstprivate"
msgstr ""
-#: c-parser.c:8179
+#: c-parser.c:8338
#, gcc-internal-format
msgid "expected %<#pragma omp section%> or %<}%>"
msgstr ""
-#: c-parser.c:8449
+#: c-parser.c:8621
#, gcc-internal-format
msgid "%qD is not a variable"
msgstr ""
-#: c-parser.c:8451 cp/semantics.c:3837
+#: c-parser.c:8623 cp/semantics.c:3938
#, gcc-internal-format
msgid "%qE declared %<threadprivate%> after first use"
msgstr ""
-#: c-parser.c:8453 cp/semantics.c:3839
+#: c-parser.c:8625 cp/semantics.c:3940
#, gcc-internal-format
msgid "automatic variable %qE cannot be %<threadprivate%>"
msgstr ""
-#: c-parser.c:8457 cp/semantics.c:3841
+#: c-parser.c:8629 cp/semantics.c:3942
#, gcc-internal-format
msgid "%<threadprivate%> %qE has incomplete type"
msgstr ""
-#: c-pch.c:131
+#: c-pch.c:132
#, gcc-internal-format
msgid "can%'t create precompiled header %s: %m"
msgstr ""
-#: c-pch.c:152
+#: c-pch.c:153
#, gcc-internal-format
msgid "can%'t write to %s: %m"
msgstr ""
-#: c-pch.c:158
+#: c-pch.c:159
#, gcc-internal-format
msgid "%qs is not a valid output file"
msgstr ""
-#: c-pch.c:187 c-pch.c:202 c-pch.c:216
+#: c-pch.c:188 c-pch.c:203 c-pch.c:217
#, gcc-internal-format
msgid "can%'t write %s: %m"
msgstr ""
-#: c-pch.c:192 c-pch.c:209
+#: c-pch.c:193 c-pch.c:210
#, gcc-internal-format
msgid "can%'t seek in %s: %m"
msgstr ""
-#: c-pch.c:200 c-pch.c:242 c-pch.c:283 c-pch.c:334
+#: c-pch.c:201 c-pch.c:243 c-pch.c:284 c-pch.c:335
#, gcc-internal-format
msgid "can%'t read %s: %m"
msgstr ""
-#: c-pch.c:465
+#: c-pch.c:466
#, gcc-internal-format
msgid "pch_preprocess pragma should only be used with -fpreprocessed"
msgstr ""
-#: c-pch.c:466
+#: c-pch.c:467
#, gcc-internal-format
msgid "use #include instead"
msgstr ""
-#: c-pch.c:472
+#: c-pch.c:473
#, gcc-internal-format
msgid "%s: couldn%'t open PCH file: %m"
msgstr ""
-#: c-pch.c:477
+#: c-pch.c:478
#, gcc-internal-format
msgid "use -Winvalid-pch for more information"
msgstr ""
-#: c-pch.c:478
+#: c-pch.c:479
#, gcc-internal-format
msgid "%s: PCH file was invalid"
msgstr ""
@@ -21626,357 +22286,362 @@ msgid ""
"applying #pragma weak %q+D after first use results in unspecified behavior"
msgstr ""
-#: c-pragma.c:479 c-pragma.c:484
+#: c-pragma.c:480 c-pragma.c:485
#, gcc-internal-format
msgid "malformed #pragma weak, ignored"
msgstr ""
-#: c-pragma.c:488
+#: c-pragma.c:489
#, gcc-internal-format
msgid "junk at end of %<#pragma weak%>"
msgstr ""
-#: c-pragma.c:556 c-pragma.c:558
+#: c-pragma.c:557 c-pragma.c:559
#, gcc-internal-format
msgid "malformed #pragma redefine_extname, ignored"
msgstr ""
-#: c-pragma.c:561
+#: c-pragma.c:562
#, gcc-internal-format
msgid "junk at end of %<#pragma redefine_extname%>"
msgstr ""
-#: c-pragma.c:567
-#, gcc-internal-format
-msgid "#pragma redefine_extname not supported on this target"
-msgstr ""
-
-#: c-pragma.c:584 c-pragma.c:671
+#: c-pragma.c:577 c-pragma.c:664
#, gcc-internal-format
msgid "#pragma redefine_extname ignored due to conflict with previous rename"
msgstr ""
-#: c-pragma.c:607
+#: c-pragma.c:600
#, gcc-internal-format
msgid ""
"#pragma redefine_extname ignored due to conflict with previous #pragma "
"redefine_extname"
msgstr ""
-#: c-pragma.c:626
+#: c-pragma.c:619
#, gcc-internal-format
msgid "malformed #pragma extern_prefix, ignored"
msgstr ""
-#: c-pragma.c:629
+#: c-pragma.c:622
#, gcc-internal-format
msgid "junk at end of %<#pragma extern_prefix%>"
msgstr ""
-#: c-pragma.c:636
+#: c-pragma.c:629
#, gcc-internal-format
msgid "#pragma extern_prefix not supported on this target"
msgstr ""
-#: c-pragma.c:662
+#: c-pragma.c:655
#, gcc-internal-format
msgid "asm declaration ignored due to conflict with previous rename"
msgstr ""
-#: c-pragma.c:693
+#: c-pragma.c:686
#, gcc-internal-format
msgid ""
"#pragma redefine_extname ignored due to conflict with __asm__ declaration"
msgstr ""
-#: c-pragma.c:755
+#: c-pragma.c:748
#, gcc-internal-format
msgid ""
"#pragma GCC visibility push() must specify default, internal, hidden or "
"protected"
msgstr ""
-#: c-pragma.c:790
+#: c-pragma.c:783
#, gcc-internal-format
msgid "#pragma GCC visibility must be followed by push or pop"
msgstr ""
-#: c-pragma.c:796
+#: c-pragma.c:789
#, gcc-internal-format
msgid "no matching push for %<#pragma GCC visibility pop%>"
msgstr ""
-#: c-pragma.c:803 c-pragma.c:810
+#: c-pragma.c:796 c-pragma.c:803
#, gcc-internal-format
msgid "missing %<(%> after %<#pragma GCC visibility push%> - ignored"
msgstr ""
-#: c-pragma.c:806
+#: c-pragma.c:799
#, gcc-internal-format
msgid "malformed #pragma GCC visibility push"
msgstr ""
-#: c-pragma.c:814
+#: c-pragma.c:807
#, gcc-internal-format
msgid "junk at end of %<#pragma GCC visibility%>"
msgstr ""
-#: c-pragma.c:830
+#: c-pragma.c:823
#, gcc-internal-format
msgid "#pragma GCC diagnostic not allowed inside functions"
msgstr ""
-#: c-pragma.c:836
+#: c-pragma.c:829
#, gcc-internal-format
msgid "missing [error|warning|ignored] after %<#pragma GCC diagnostic%>"
msgstr ""
-#: c-pragma.c:845
+#: c-pragma.c:838
#, gcc-internal-format
msgid "expected [error|warning|ignored] after %<#pragma GCC diagnostic%>"
msgstr ""
-#: c-pragma.c:849
+#: c-pragma.c:842
#, gcc-internal-format
msgid "missing option after %<#pragma GCC diagnostic%> kind"
msgstr ""
-#: c-pragma.c:863
+#: c-pragma.c:856
#, gcc-internal-format
msgid "unknown option after %<#pragma GCC diagnostic%> kind"
msgstr ""
-#: c-pragma.c:876
+#: c-pragma.c:869
#, gcc-internal-format
msgid "#pragma GCC option is not allowed inside functions"
msgstr ""
-#: c-pragma.c:889
+#: c-pragma.c:882
#, gcc-internal-format
msgid "%<#pragma GCC option%> is not a string"
msgstr ""
-#: c-pragma.c:916
+#: c-pragma.c:909
#, gcc-internal-format
msgid ""
"%<#pragma GCC target (string [,string]...)%> does not have a final %<)%>."
msgstr ""
-#: c-pragma.c:922
+#: c-pragma.c:915
#, gcc-internal-format
msgid "#pragma GCC target string... is badly formed"
msgstr ""
-#: c-pragma.c:945
+#: c-pragma.c:938
#, gcc-internal-format
msgid "#pragma GCC optimize is not allowed inside functions"
msgstr ""
-#: c-pragma.c:958
+#: c-pragma.c:951
#, gcc-internal-format
msgid "%<#pragma GCC optimize%> is not a string or number"
msgstr ""
-#: c-pragma.c:984
+#: c-pragma.c:977
#, gcc-internal-format
msgid ""
"%<#pragma GCC optimize (string [,string]...)%> does not have a final %<)%>."
msgstr ""
-#: c-pragma.c:990
+#: c-pragma.c:983
#, gcc-internal-format
msgid "#pragma GCC optimize string... is badly formed"
msgstr ""
-#: c-pragma.c:1032
+#: c-pragma.c:1025
#, gcc-internal-format
msgid "junk at end of %<#pragma push_options%>"
msgstr ""
-#: c-pragma.c:1062
+#: c-pragma.c:1055
#, gcc-internal-format
msgid "junk at end of %<#pragma pop_options%>"
msgstr ""
-#: c-pragma.c:1069
+#: c-pragma.c:1062
#, gcc-internal-format
msgid ""
"%<#pragma GCC pop_options%> without a corresponding %<#pragma GCC "
"push_options%>"
msgstr ""
-#: c-pragma.c:1110
+#: c-pragma.c:1103
#, gcc-internal-format
msgid "junk at end of %<#pragma reset_options%>"
msgstr ""
-#: c-pragma.c:1147 c-pragma.c:1154
+#: c-pragma.c:1140 c-pragma.c:1147
#, gcc-internal-format
msgid "expected a string after %<#pragma message%>"
msgstr ""
-#: c-pragma.c:1149
+#: c-pragma.c:1142
#, gcc-internal-format
msgid "malformed %<#pragma message%>, ignored"
msgstr ""
-#: c-pragma.c:1159
+#: c-pragma.c:1152
#, gcc-internal-format
msgid "junk at end of %<#pragma message%>"
msgstr ""
-#: c-pragma.c:1162
+#: c-pragma.c:1155
#, gcc-internal-format
msgid "#pragma message: %s"
msgstr ""
-#: c-pragma.c:1199
+#: c-pragma.c:1192
#, gcc-internal-format
msgid "invalid location for %<pragma %s%>, ignored"
msgstr ""
-#: c-pragma.c:1206 c-pragma.c:1220
+#: c-pragma.c:1199 c-pragma.c:1213
#, gcc-internal-format
msgid "malformed %<#pragma %s%>, ignored"
msgstr ""
-#: c-pragma.c:1226
+#: c-pragma.c:1219
#, gcc-internal-format
msgid "junk at end of %<#pragma %s%>"
msgstr ""
-#: c-pragma.c:1244
+#: c-pragma.c:1237
#, gcc-internal-format
msgid "%<#pragma STDC FLOAT_CONST_DECIMAL64%> is not supported for C++"
msgstr ""
-#: c-pragma.c:1253
+#: c-pragma.c:1246
#, gcc-internal-format
msgid "%<#pragma STDC FLOAT_CONST_DECIMAL64%> is not supported on this target"
msgstr ""
-#: c-pragma.c:1259
+#: c-pragma.c:1252
#, gcc-internal-format
msgid "ISO C does not support %<#pragma STDC FLOAT_CONST_DECIMAL64%>"
msgstr ""
-#: c-typeck.c:217
+#: c-typeck.c:215
#, gcc-internal-format
msgid "%qD has an incomplete type"
msgstr ""
-#: c-typeck.c:238 cp/call.c:2920
+#: c-typeck.c:236 cp/call.c:3092
#, gcc-internal-format
msgid "invalid use of void expression"
msgstr ""
-#: c-typeck.c:246
+#: c-typeck.c:244
#, gcc-internal-format
msgid "invalid use of flexible array member"
msgstr ""
-#: c-typeck.c:252
+#: c-typeck.c:250
#, gcc-internal-format
msgid "invalid use of array with unspecified bounds"
msgstr ""
-#: c-typeck.c:260
+#: c-typeck.c:258
#, gcc-internal-format
msgid "invalid use of undefined type %<%s %E%>"
msgstr ""
#. If this type has a typedef-name, the TYPE_NAME is a TYPE_DECL.
-#: c-typeck.c:264
+#: c-typeck.c:262
#, gcc-internal-format
msgid "invalid use of incomplete typedef %qD"
msgstr ""
-#: c-typeck.c:530 c-typeck.c:555
+#: c-typeck.c:528 c-typeck.c:553
#, gcc-internal-format
msgid "function types not truly compatible in ISO C"
msgstr ""
-#: c-typeck.c:683
+#: c-typeck.c:681
#, gcc-internal-format
msgid "can%'t mix operands of decimal float and vector types"
msgstr ""
-#: c-typeck.c:688
+#: c-typeck.c:686
#, gcc-internal-format
msgid "can%'t mix operands of decimal float and complex types"
msgstr ""
-#: c-typeck.c:693
+#: c-typeck.c:691
#, gcc-internal-format
msgid "can%'t mix operands of decimal float and other float types"
msgstr ""
-#: c-typeck.c:1099
+#: c-typeck.c:1128
#, gcc-internal-format
msgid "types are not quite compatible"
msgstr ""
-#: c-typeck.c:1422
+#: c-typeck.c:1132
+#, gcc-internal-format
+msgid "pointer target types incompatible in C++"
+msgstr ""
+
+#: c-typeck.c:1462
#, gcc-internal-format
msgid "function return types not compatible due to %<volatile%>"
msgstr ""
-#: c-typeck.c:1581 c-typeck.c:3059
+#: c-typeck.c:1624 c-typeck.c:3132
#, gcc-internal-format
msgid "arithmetic on pointer to an incomplete type"
msgstr ""
-#: c-typeck.c:1926
+#: c-typeck.c:1977
#, gcc-internal-format
msgid "%qT has no member named %qE"
msgstr ""
-#: c-typeck.c:1978
+#: c-typeck.c:2031
#, gcc-internal-format
msgid "request for member %qE in something not a structure or union"
msgstr ""
-#: c-typeck.c:2027
+#: c-typeck.c:2080
#, gcc-internal-format
msgid "dereferencing pointer to incomplete type"
msgstr ""
-#: c-typeck.c:2031
+#: c-typeck.c:2084
#, gcc-internal-format
msgid "dereferencing %<void *%> pointer"
msgstr ""
-#: c-typeck.c:2050
+#: c-typeck.c:2103
#, gcc-internal-format
msgid "invalid type argument of %qs (have %qT)"
msgstr ""
-#: c-typeck.c:2081 cp/typeck.c:2697
+#: c-typeck.c:2134 cp/typeck.c:2715
#, gcc-internal-format
msgid "subscripted value is neither array nor pointer"
msgstr ""
-#: c-typeck.c:2092 cp/typeck.c:2612 cp/typeck.c:2702
+#: c-typeck.c:2145 cp/typeck.c:2630 cp/typeck.c:2720
#, gcc-internal-format
msgid "array subscript is not an integer"
msgstr ""
-#: c-typeck.c:2098
+#: c-typeck.c:2151
#, gcc-internal-format
msgid "subscripted value is pointer to function"
msgstr ""
-#: c-typeck.c:2146
+#: c-typeck.c:2199
#, gcc-internal-format
msgid "ISO C forbids subscripting %<register%> array"
msgstr ""
-#: c-typeck.c:2149
+#: c-typeck.c:2202
#, gcc-internal-format
msgid "ISO C90 forbids subscripting non-lvalue array"
msgstr ""
-#: c-typeck.c:2474
+#: c-typeck.c:2310
+#, gcc-internal-format
+msgid "enum constant defined here"
+msgstr ""
+
+#: c-typeck.c:2541
#, gcc-internal-format
msgid "called object %qE is not a function"
msgstr ""
@@ -21984,362 +22649,370 @@ msgstr ""
#. This situation leads to run-time undefined behavior. We can't,
#. therefore, simply error unless we can prove that all possible
#. executions of the program must execute the code.
-#: c-typeck.c:2510
+#: c-typeck.c:2577
#, gcc-internal-format
msgid "function called through a non-compatible type"
msgstr ""
-#: c-typeck.c:2524 c-typeck.c:2577
+#: c-typeck.c:2591 c-typeck.c:2645
#, gcc-internal-format
msgid "function with qualified void return type called"
msgstr ""
-#: c-typeck.c:2699
+#: c-typeck.c:2767
#, gcc-internal-format
msgid "type of formal parameter %d is incomplete"
msgstr ""
-#: c-typeck.c:2714
+#: c-typeck.c:2782
#, gcc-internal-format
msgid ""
"passing argument %d of %qE as integer rather than floating due to prototype"
msgstr ""
-#: c-typeck.c:2719
+#: c-typeck.c:2787
#, gcc-internal-format
msgid ""
"passing argument %d of %qE as integer rather than complex due to prototype"
msgstr ""
-#: c-typeck.c:2724
+#: c-typeck.c:2792
#, gcc-internal-format
msgid ""
"passing argument %d of %qE as complex rather than floating due to prototype"
msgstr ""
-#: c-typeck.c:2729
+#: c-typeck.c:2797
#, gcc-internal-format
msgid ""
"passing argument %d of %qE as floating rather than integer due to prototype"
msgstr ""
-#: c-typeck.c:2734
+#: c-typeck.c:2802
#, gcc-internal-format
msgid ""
"passing argument %d of %qE as complex rather than integer due to prototype"
msgstr ""
-#: c-typeck.c:2739
+#: c-typeck.c:2807
#, gcc-internal-format
msgid ""
"passing argument %d of %qE as floating rather than complex due to prototype"
msgstr ""
-#: c-typeck.c:2752
+#: c-typeck.c:2820
#, gcc-internal-format
msgid ""
"passing argument %d of %qE as %<float%> rather than %<double%> due to "
"prototype"
msgstr ""
-#: c-typeck.c:2777
+#: c-typeck.c:2845
#, gcc-internal-format
msgid "passing argument %d of %qE as %qT rather than %qT due to prototype"
msgstr ""
-#: c-typeck.c:2798
+#: c-typeck.c:2867
#, gcc-internal-format
msgid "passing argument %d of %qE with different width due to prototype"
msgstr ""
-#: c-typeck.c:2821
+#: c-typeck.c:2891
#, gcc-internal-format
msgid "passing argument %d of %qE as unsigned due to prototype"
msgstr ""
-#: c-typeck.c:2825
+#: c-typeck.c:2896
#, gcc-internal-format
msgid "passing argument %d of %qE as signed due to prototype"
msgstr ""
-#: c-typeck.c:2962 c-typeck.c:2966
+#: c-typeck.c:3034 c-typeck.c:3039
#, gcc-internal-format
msgid "comparison with string literal results in unspecified behavior"
msgstr ""
-#: c-typeck.c:2980
+#: c-typeck.c:3053
#, gcc-internal-format
msgid "comparison between %qT and %qT"
msgstr ""
-#: c-typeck.c:3000
+#: c-typeck.c:3073
#, gcc-internal-format
msgid "pointer of type %<void *%> used in subtraction"
msgstr ""
-#: c-typeck.c:3003
+#: c-typeck.c:3076
#, gcc-internal-format
msgid "pointer to a function used in subtraction"
msgstr ""
-#: c-typeck.c:3130
+#: c-typeck.c:3204
#, gcc-internal-format
msgid "wrong type argument to unary plus"
msgstr ""
-#: c-typeck.c:3143
+#: c-typeck.c:3217
#, gcc-internal-format
msgid "wrong type argument to unary minus"
msgstr ""
-#: c-typeck.c:3163
+#: c-typeck.c:3237
#, gcc-internal-format
msgid "ISO C does not support %<~%> for complex conjugation"
msgstr ""
-#: c-typeck.c:3169
+#: c-typeck.c:3243
#, gcc-internal-format
msgid "wrong type argument to bit-complement"
msgstr ""
-#: c-typeck.c:3177
+#: c-typeck.c:3251
#, gcc-internal-format
msgid "wrong type argument to abs"
msgstr ""
-#: c-typeck.c:3189
+#: c-typeck.c:3263
#, gcc-internal-format
msgid "wrong type argument to conjugation"
msgstr ""
-#: c-typeck.c:3202
+#: c-typeck.c:3276
#, gcc-internal-format
msgid "wrong type argument to unary exclamation mark"
msgstr ""
-#: c-typeck.c:3269
+#: c-typeck.c:3340
+#, gcc-internal-format
+msgid "increment of enumeration value is invalid in C++"
+msgstr ""
+
+#: c-typeck.c:3343
+#, gcc-internal-format
+msgid "decrement of enumeration value is invalid in C++"
+msgstr ""
+
+#: c-typeck.c:3356
#, gcc-internal-format
msgid "ISO C does not support %<++%> and %<--%> on complex types"
msgstr ""
-#: c-typeck.c:3288 c-typeck.c:3320
+#: c-typeck.c:3375 c-typeck.c:3407
#, gcc-internal-format
msgid "wrong type argument to increment"
msgstr ""
-#: c-typeck.c:3290 c-typeck.c:3323
+#: c-typeck.c:3377 c-typeck.c:3410
#, gcc-internal-format
msgid "wrong type argument to decrement"
msgstr ""
-#: c-typeck.c:3310
+#: c-typeck.c:3397
#, gcc-internal-format
msgid "increment of pointer to unknown structure"
msgstr ""
-#: c-typeck.c:3313
+#: c-typeck.c:3400
#, gcc-internal-format
msgid "decrement of pointer to unknown structure"
msgstr ""
-#: c-typeck.c:3390
+#: c-typeck.c:3477
#, gcc-internal-format
msgid "taking address of expression of type %<void%>"
msgstr ""
-#: c-typeck.c:3557
+#: c-typeck.c:3646
#, gcc-internal-format
msgid "assignment of read-only member %qD"
msgstr ""
-#: c-typeck.c:3558
+#: c-typeck.c:3647
#, gcc-internal-format
msgid "increment of read-only member %qD"
msgstr ""
-#: c-typeck.c:3559
+#: c-typeck.c:3648
#, gcc-internal-format
msgid "decrement of read-only member %qD"
msgstr ""
-#: c-typeck.c:3560
+#: c-typeck.c:3649
#, gcc-internal-format
msgid "read-only member %qD used as %<asm%> output"
msgstr ""
-#: c-typeck.c:3564
+#: c-typeck.c:3653
#, gcc-internal-format
msgid "assignment of read-only variable %qD"
msgstr ""
-#: c-typeck.c:3565
+#: c-typeck.c:3654
#, gcc-internal-format
msgid "increment of read-only variable %qD"
msgstr ""
-#: c-typeck.c:3566
+#: c-typeck.c:3655
#, gcc-internal-format
msgid "decrement of read-only variable %qD"
msgstr ""
-#: c-typeck.c:3567
+#: c-typeck.c:3656
#, gcc-internal-format
msgid "read-only variable %qD used as %<asm%> output"
msgstr ""
-#: c-typeck.c:3570 c-typeck.c:3586
+#: c-typeck.c:3659 c-typeck.c:3675
#, gcc-internal-format
msgid "assignment of read-only location %qE"
msgstr ""
-#: c-typeck.c:3571 c-typeck.c:3589
+#: c-typeck.c:3660 c-typeck.c:3678
#, gcc-internal-format
msgid "increment of read-only location %qE"
msgstr ""
-#: c-typeck.c:3572 c-typeck.c:3592
+#: c-typeck.c:3661 c-typeck.c:3681
#, gcc-internal-format
msgid "decrement of read-only location %qE"
msgstr ""
-#: c-typeck.c:3573
+#: c-typeck.c:3662
#, gcc-internal-format
msgid "read-only location %qE used as %<asm%> output"
msgstr ""
-#: c-typeck.c:3632
+#: c-typeck.c:3721
#, gcc-internal-format
msgid "cannot take address of bit-field %qD"
msgstr ""
-#: c-typeck.c:3660
+#: c-typeck.c:3749
#, gcc-internal-format
msgid "global register variable %qD used in nested function"
msgstr ""
-#: c-typeck.c:3663
+#: c-typeck.c:3752
#, gcc-internal-format
msgid "register variable %qD used in nested function"
msgstr ""
-#: c-typeck.c:3668
+#: c-typeck.c:3757
#, gcc-internal-format
msgid "address of global register variable %qD requested"
msgstr ""
-#: c-typeck.c:3670
+#: c-typeck.c:3759
#, gcc-internal-format
msgid "address of register variable %qD requested"
msgstr ""
-#: c-typeck.c:3735
+#: c-typeck.c:3826
#, gcc-internal-format
msgid "non-lvalue array in conditional expression"
msgstr ""
-#: c-typeck.c:3824
-#, gcc-internal-format
-msgid "signed and unsigned type in conditional expression"
-msgstr ""
-
-#: c-typeck.c:3846
+#: c-typeck.c:3954
#, gcc-internal-format
msgid "ISO C forbids conditional expr with only one void side"
msgstr ""
-#: c-typeck.c:3861 c-typeck.c:3870
+#: c-typeck.c:3969 c-typeck.c:3978
#, gcc-internal-format
msgid "ISO C forbids conditional expr between %<void *%> and function pointer"
msgstr ""
-#: c-typeck.c:3879
+#: c-typeck.c:3987
#, gcc-internal-format
msgid "pointer type mismatch in conditional expression"
msgstr ""
-#: c-typeck.c:3887 c-typeck.c:3898
+#: c-typeck.c:3995 c-typeck.c:4006
#, gcc-internal-format
msgid "pointer/integer type mismatch in conditional expression"
msgstr ""
-#: c-typeck.c:3912
+#: c-typeck.c:4020
#, gcc-internal-format
msgid "type mismatch in conditional expression"
msgstr ""
-#: c-typeck.c:4005
+#: c-typeck.c:4116
#, gcc-internal-format
msgid "left-hand operand of comma expression has no effect"
msgstr ""
-#: c-typeck.c:4057
+#: c-typeck.c:4181
#, gcc-internal-format
-msgid "cast specifies array type"
+msgid "cast adds new qualifiers to function type"
msgstr ""
-#: c-typeck.c:4063
+#: c-typeck.c:4187
#, gcc-internal-format
-msgid "cast specifies function type"
+msgid "cast discards qualifiers from pointer target type"
msgstr ""
-#: c-typeck.c:4079
+#: c-typeck.c:4257
#, gcc-internal-format
-msgid "ISO C forbids casting nonscalar to the same type"
+msgid "cast specifies array type"
msgstr ""
-#: c-typeck.c:4096
+#: c-typeck.c:4263
#, gcc-internal-format
-msgid "ISO C forbids casts to union type"
+msgid "cast specifies function type"
msgstr ""
-#: c-typeck.c:4103
+#: c-typeck.c:4279
#, gcc-internal-format
-msgid "cast to union type from type not present in union"
+msgid "ISO C forbids casting nonscalar to the same type"
msgstr ""
-#: c-typeck.c:4149
+#: c-typeck.c:4295
#, gcc-internal-format
-msgid "cast adds new qualifiers to function type"
+msgid "ISO C forbids casts to union type"
msgstr ""
-#. There are qualifiers present in IN_OTYPE that are not
-#. present in IN_TYPE.
-#: c-typeck.c:4154
+#: c-typeck.c:4302
#, gcc-internal-format
-msgid "cast discards qualifiers from pointer target type"
+msgid "cast to union type from type not present in union"
msgstr ""
-#: c-typeck.c:4170
+#: c-typeck.c:4337
#, gcc-internal-format
msgid "cast increases required alignment of target type"
msgstr ""
-#: c-typeck.c:4181
+#: c-typeck.c:4348
#, gcc-internal-format
msgid "cast from pointer to integer of different size"
msgstr ""
-#: c-typeck.c:4185
+#: c-typeck.c:4353
#, gcc-internal-format
msgid "cast from function call of type %qT to non-matching type %qT"
msgstr ""
-#: c-typeck.c:4193
+#: c-typeck.c:4362
#, gcc-internal-format
msgid "cast to pointer from integer of different size"
msgstr ""
-#: c-typeck.c:4207
+#: c-typeck.c:4376
#, gcc-internal-format
msgid "ISO C forbids conversion of function pointer to object pointer type"
msgstr ""
-#: c-typeck.c:4216
+#: c-typeck.c:4385
#, gcc-internal-format
msgid "ISO C forbids conversion of object pointer to function pointer type"
msgstr ""
-#: c-typeck.c:4407 c-typeck.c:4572
+#: c-typeck.c:4467
+#, gcc-internal-format
+msgid "defining a type in a cast is invalid in C++"
+msgstr ""
+
+#: c-typeck.c:4592 c-typeck.c:4759
#, gcc-internal-format
msgid "enum conversion in assignment is invalid in C++"
msgstr ""
@@ -22347,493 +23020,456 @@ msgstr ""
#. This macro is used to emit diagnostics to ensure that all format
#. strings are complete sentences, visible to gettext and checked at
#. compile time.
-#: c-typeck.c:4510 c-typeck.c:4975
+#: c-typeck.c:4697 c-typeck.c:5168
#, gcc-internal-format
msgid "expected %qT but argument is of type %qT"
msgstr ""
-#: c-typeck.c:4570
+#: c-typeck.c:4757
#, gcc-internal-format
msgid "enum conversion when passing argument %d of %qE is invalid in C++"
msgstr ""
-#: c-typeck.c:4576
+#: c-typeck.c:4763
#, gcc-internal-format
msgid "enum conversion in return is invalid in C++"
msgstr ""
-#: c-typeck.c:4605
+#: c-typeck.c:4792
#, gcc-internal-format
msgid "cannot pass rvalue to reference parameter"
msgstr ""
-#: c-typeck.c:4728 c-typeck.c:4897
+#: c-typeck.c:4920 c-typeck.c:5090
#, gcc-internal-format
msgid ""
"passing argument %d of %qE makes qualified function pointer from unqualified"
msgstr ""
-#: c-typeck.c:4731 c-typeck.c:4900
+#: c-typeck.c:4923 c-typeck.c:5093
#, gcc-internal-format
msgid "assignment makes qualified function pointer from unqualified"
msgstr ""
-#: c-typeck.c:4734 c-typeck.c:4902
+#: c-typeck.c:4926 c-typeck.c:5095
#, gcc-internal-format
msgid "initialization makes qualified function pointer from unqualified"
msgstr ""
-#: c-typeck.c:4737 c-typeck.c:4904
+#: c-typeck.c:4929 c-typeck.c:5097
#, gcc-internal-format
msgid "return makes qualified function pointer from unqualified"
msgstr ""
-#: c-typeck.c:4742 c-typeck.c:4862
+#: c-typeck.c:4934 c-typeck.c:5055
#, gcc-internal-format
msgid "passing argument %d of %qE discards qualifiers from pointer target type"
msgstr ""
-#: c-typeck.c:4744 c-typeck.c:4864
+#: c-typeck.c:4936 c-typeck.c:5057
#, gcc-internal-format
msgid "assignment discards qualifiers from pointer target type"
msgstr ""
-#: c-typeck.c:4746 c-typeck.c:4866
+#: c-typeck.c:4938 c-typeck.c:5059
#, gcc-internal-format
msgid "initialization discards qualifiers from pointer target type"
msgstr ""
-#: c-typeck.c:4748 c-typeck.c:4868
+#: c-typeck.c:4940 c-typeck.c:5061
#, gcc-internal-format
msgid "return discards qualifiers from pointer target type"
msgstr ""
-#: c-typeck.c:4756
+#: c-typeck.c:4948
#, gcc-internal-format
msgid "ISO C prohibits argument conversion to union type"
msgstr ""
-#: c-typeck.c:4789
+#: c-typeck.c:4982
#, gcc-internal-format
msgid "request for implicit conversion from %qT to %qT not permitted in C++"
msgstr ""
-#: c-typeck.c:4801
+#: c-typeck.c:4994
#, gcc-internal-format
msgid "argument %d of %qE might be a candidate for a format attribute"
msgstr ""
-#: c-typeck.c:4807
+#: c-typeck.c:5000
#, gcc-internal-format
msgid "assignment left-hand side might be a candidate for a format attribute"
msgstr ""
-#: c-typeck.c:4812
+#: c-typeck.c:5005
#, gcc-internal-format
msgid ""
"initialization left-hand side might be a candidate for a format attribute"
msgstr ""
-#: c-typeck.c:4817
+#: c-typeck.c:5010
#, gcc-internal-format
msgid "return type might be a candidate for a format attribute"
msgstr ""
-#: c-typeck.c:4841
+#: c-typeck.c:5034
#, gcc-internal-format
msgid ""
"ISO C forbids passing argument %d of %qE between function pointer and %<void "
"*%>"
msgstr ""
-#: c-typeck.c:4844
+#: c-typeck.c:5037
#, gcc-internal-format
msgid "ISO C forbids assignment between function pointer and %<void *%>"
msgstr ""
-#: c-typeck.c:4846
+#: c-typeck.c:5039
#, gcc-internal-format
msgid "ISO C forbids initialization between function pointer and %<void *%>"
msgstr ""
-#: c-typeck.c:4848
+#: c-typeck.c:5041
#, gcc-internal-format
msgid "ISO C forbids return between function pointer and %<void *%>"
msgstr ""
-#: c-typeck.c:4879
+#: c-typeck.c:5072
#, gcc-internal-format
msgid "pointer targets in passing argument %d of %qE differ in signedness"
msgstr ""
-#: c-typeck.c:4881
+#: c-typeck.c:5074
#, gcc-internal-format
msgid "pointer targets in assignment differ in signedness"
msgstr ""
-#: c-typeck.c:4883
+#: c-typeck.c:5076
#, gcc-internal-format
msgid "pointer targets in initialization differ in signedness"
msgstr ""
-#: c-typeck.c:4885
+#: c-typeck.c:5078
#, gcc-internal-format
msgid "pointer targets in return differ in signedness"
msgstr ""
-#: c-typeck.c:4912
+#: c-typeck.c:5105
#, gcc-internal-format
msgid "passing argument %d of %qE from incompatible pointer type"
msgstr ""
-#: c-typeck.c:4914
+#: c-typeck.c:5107
#, gcc-internal-format
msgid "assignment from incompatible pointer type"
msgstr ""
-#: c-typeck.c:4915
+#: c-typeck.c:5108
#, gcc-internal-format
msgid "initialization from incompatible pointer type"
msgstr ""
-#: c-typeck.c:4917
+#: c-typeck.c:5110
#, gcc-internal-format
msgid "return from incompatible pointer type"
msgstr ""
-#: c-typeck.c:4935
+#: c-typeck.c:5128
#, gcc-internal-format
msgid "passing argument %d of %qE makes pointer from integer without a cast"
msgstr ""
-#: c-typeck.c:4937
+#: c-typeck.c:5130
#, gcc-internal-format
msgid "assignment makes pointer from integer without a cast"
msgstr ""
-#: c-typeck.c:4939
+#: c-typeck.c:5132
#, gcc-internal-format
msgid "initialization makes pointer from integer without a cast"
msgstr ""
-#: c-typeck.c:4941
+#: c-typeck.c:5134
#, gcc-internal-format
msgid "return makes pointer from integer without a cast"
msgstr ""
-#: c-typeck.c:4949
+#: c-typeck.c:5142
#, gcc-internal-format
msgid "passing argument %d of %qE makes integer from pointer without a cast"
msgstr ""
-#: c-typeck.c:4951
+#: c-typeck.c:5144
#, gcc-internal-format
msgid "assignment makes integer from pointer without a cast"
msgstr ""
-#: c-typeck.c:4953
+#: c-typeck.c:5146
#, gcc-internal-format
msgid "initialization makes integer from pointer without a cast"
msgstr ""
-#: c-typeck.c:4955
+#: c-typeck.c:5148
#, gcc-internal-format
msgid "return makes integer from pointer without a cast"
msgstr ""
-#: c-typeck.c:4978
+#: c-typeck.c:5171
#, gcc-internal-format
msgid "incompatible types when assigning to type %qT from type %qT"
msgstr ""
-#: c-typeck.c:4982
+#: c-typeck.c:5176
#, gcc-internal-format
msgid "incompatible types when initializing type %qT using type %qT"
msgstr ""
-#: c-typeck.c:4986
+#: c-typeck.c:5181
#, gcc-internal-format
msgid "incompatible types when returning type %qT but %qT was expected"
msgstr ""
-#: c-typeck.c:5047
+#: c-typeck.c:5245
#, gcc-internal-format
msgid "traditional C rejects automatic aggregate initialization"
msgstr ""
-#: c-typeck.c:5220 c-typeck.c:5236 c-typeck.c:5253
+#: c-typeck.c:5418 c-typeck.c:5434 c-typeck.c:5451
#, gcc-internal-format
msgid "(near initialization for %qs)"
msgstr ""
-#: c-typeck.c:5841 cp/decl.c:5148
+#: c-typeck.c:6054 cp/decl.c:5202
#, gcc-internal-format
msgid "opaque vector types cannot be initialized"
msgstr ""
-#: c-typeck.c:6506
+#: c-typeck.c:6719
#, gcc-internal-format
msgid "unknown field %qE specified in initializer"
msgstr ""
-#: c-typeck.c:7485
+#: c-typeck.c:7698
#, gcc-internal-format
msgid "traditional C rejects initialization of unions"
msgstr ""
-#: c-typeck.c:7804
-#, gcc-internal-format
-msgid "jump into statement expression"
-msgstr ""
-
-#: c-typeck.c:7810
-#, gcc-internal-format
-msgid "jump into scope of identifier with variably modified type"
-msgstr ""
-
-#: c-typeck.c:7846
+#: c-typeck.c:8037
#, gcc-internal-format
msgid "ISO C forbids %<goto *expr;%>"
msgstr ""
-#: c-typeck.c:7864 cp/typeck.c:6858
+#: c-typeck.c:8059 cp/typeck.c:6998
#, gcc-internal-format
msgid "function declared %<noreturn%> has a %<return%> statement"
msgstr ""
-#: c-typeck.c:7887
+#: c-typeck.c:8082
#, gcc-internal-format
msgid "%<return%> with no value, in function returning non-void"
msgstr ""
-#: c-typeck.c:7897
+#: c-typeck.c:8092
#, gcc-internal-format
msgid "%<return%> with a value, in function returning void"
msgstr ""
-#: c-typeck.c:7899
+#: c-typeck.c:8094
#, gcc-internal-format
msgid "ISO C forbids %<return%> with expression, in function returning void"
msgstr ""
-#: c-typeck.c:7958
+#: c-typeck.c:8155
#, gcc-internal-format
msgid "function returns address of local variable"
msgstr ""
-#: c-typeck.c:8033 cp/semantics.c:951
+#: c-typeck.c:8228 cp/semantics.c:952
#, gcc-internal-format
msgid "switch quantity not an integer"
msgstr ""
-#: c-typeck.c:8045
+#: c-typeck.c:8241
#, gcc-internal-format
msgid "%<long%> switch expression not converted to %<int%> in ISO C"
msgstr ""
-#: c-typeck.c:8081 c-typeck.c:8089
+#: c-typeck.c:8277 c-typeck.c:8285
#, gcc-internal-format
msgid "case label is not an integer constant expression"
msgstr ""
-#: c-typeck.c:8105
-#, gcc-internal-format
-msgid ""
-"case label in statement expression not containing enclosing switch statement"
-msgstr ""
-
-#: c-typeck.c:8108
-#, gcc-internal-format
-msgid ""
-"%<default%> label in statement expression not containing enclosing switch "
-"statement"
-msgstr ""
-
-#: c-typeck.c:8114
-#, gcc-internal-format
-msgid ""
-"case label in scope of identifier with variably modified type not containing "
-"enclosing switch statement"
-msgstr ""
-
-#: c-typeck.c:8117
-#, gcc-internal-format
-msgid ""
-"%<default%> label in scope of identifier with variably modified type not "
-"containing enclosing switch statement"
-msgstr ""
-
-#: c-typeck.c:8121
+#: c-typeck.c:8291 cp/parser.c:7698
#, gcc-internal-format
msgid "case label not within a switch statement"
msgstr ""
-#: c-typeck.c:8123
+#: c-typeck.c:8293
#, gcc-internal-format
msgid "%<default%> label not within a switch statement"
msgstr ""
-#: c-typeck.c:8200
+#: c-typeck.c:8376 cp/parser.c:7969
#, gcc-internal-format
-msgid "%Hsuggest explicit braces to avoid ambiguous %<else%>"
+msgid "suggest explicit braces to avoid ambiguous %<else%>"
msgstr ""
-#: c-typeck.c:8309 cp/cp-gimplify.c:92
+#: c-typeck.c:8485 cp/cp-gimplify.c:92 cp/parser.c:8319
#, gcc-internal-format
msgid "break statement not within loop or switch"
msgstr ""
-#: c-typeck.c:8311
+#: c-typeck.c:8487 cp/parser.c:8340
#, gcc-internal-format
msgid "continue statement not within a loop"
msgstr ""
-#: c-typeck.c:8316
+#: c-typeck.c:8492 cp/parser.c:8330
#, gcc-internal-format
msgid "break statement used with OpenMP for loop"
msgstr ""
-#: c-typeck.c:8342
+#: c-typeck.c:8518 cp/cp-gimplify.c:412
#, gcc-internal-format
-msgid "%Hstatement with no effect"
+msgid "statement with no effect"
msgstr ""
-#: c-typeck.c:8366
+#: c-typeck.c:8542
#, gcc-internal-format
msgid "expression statement has incomplete type"
msgstr ""
-#: c-typeck.c:9032 cp/typeck.c:3529
+#: c-typeck.c:9117 cp/typeck.c:3589
#, gcc-internal-format
msgid "right shift count is negative"
msgstr ""
-#: c-typeck.c:9043 cp/typeck.c:3535
+#: c-typeck.c:9128 cp/typeck.c:3596
#, gcc-internal-format
msgid "right shift count >= width of type"
msgstr ""
-#: c-typeck.c:9069 cp/typeck.c:3556
+#: c-typeck.c:9154 cp/typeck.c:3618
#, gcc-internal-format
msgid "left shift count is negative"
msgstr ""
-#: c-typeck.c:9076 cp/typeck.c:3561
+#: c-typeck.c:9161 cp/typeck.c:3624
#, gcc-internal-format
msgid "left shift count >= width of type"
msgstr ""
-#: c-typeck.c:9096 cp/typeck.c:3607
+#: c-typeck.c:9181 cp/typeck.c:3670
#, gcc-internal-format
msgid "comparing floating point with == or != is unsafe"
msgstr ""
-#: c-typeck.c:9120 c-typeck.c:9127
+#: c-typeck.c:9205 c-typeck.c:9212
#, gcc-internal-format
msgid "ISO C forbids comparison of %<void *%> with function pointer"
msgstr ""
-#: c-typeck.c:9134 c-typeck.c:9196
+#: c-typeck.c:9219 c-typeck.c:9281
#, gcc-internal-format
msgid "comparison of distinct pointer types lacks a cast"
msgstr ""
-#: c-typeck.c:9144 c-typeck.c:9153 cp/typeck.c:3630 cp/typeck.c:3642
+#: c-typeck.c:9229 c-typeck.c:9238 cp/typeck.c:3693 cp/typeck.c:3705
#, gcc-internal-format
msgid "the address of %qD will never be NULL"
msgstr ""
-#: c-typeck.c:9160 c-typeck.c:9165 c-typeck.c:9218 c-typeck.c:9223
+#: c-typeck.c:9245 c-typeck.c:9250 c-typeck.c:9303 c-typeck.c:9308
#, gcc-internal-format
msgid "comparison between pointer and integer"
msgstr ""
-#: c-typeck.c:9187
+#: c-typeck.c:9272
#, gcc-internal-format
msgid "comparison of complete and incomplete pointers"
msgstr ""
-#: c-typeck.c:9189
+#: c-typeck.c:9274
#, gcc-internal-format
msgid "ISO C forbids ordered comparisons of pointers to functions"
msgstr ""
-#: c-typeck.c:9204 c-typeck.c:9207 c-typeck.c:9213
+#: c-typeck.c:9289 c-typeck.c:9292 c-typeck.c:9298
#, gcc-internal-format
msgid "ordered comparison of pointer with integer zero"
msgstr ""
-#: c-typeck.c:9539
+#: c-typeck.c:9620
#, gcc-internal-format
msgid "used array that cannot be converted to pointer where scalar is required"
msgstr ""
-#: c-typeck.c:9543
+#: c-typeck.c:9624
#, gcc-internal-format
msgid "used struct type value where scalar is required"
msgstr ""
-#: c-typeck.c:9547
+#: c-typeck.c:9628
#, gcc-internal-format
msgid "used union type value where scalar is required"
msgstr ""
-#: c-typeck.c:9699 cp/semantics.c:3720
+#: c-typeck.c:9785 cp/semantics.c:3821
#, gcc-internal-format
msgid "%qE has invalid type for %<reduction%>"
msgstr ""
-#: c-typeck.c:9733 cp/semantics.c:3733
+#: c-typeck.c:9820 cp/semantics.c:3834
#, gcc-internal-format
msgid "%qE has invalid type for %<reduction(%s)%>"
msgstr ""
-#: c-typeck.c:9749 cp/semantics.c:3743
+#: c-typeck.c:9837 cp/semantics.c:3844
#, gcc-internal-format
msgid "%qE must be %<threadprivate%> for %<copyin%>"
msgstr ""
-#: c-typeck.c:9758 cp/semantics.c:3540
+#: c-typeck.c:9847 cp/semantics.c:3641
#, gcc-internal-format
msgid "%qE is not a variable in clause %qs"
msgstr ""
-#: c-typeck.c:9765 c-typeck.c:9785 c-typeck.c:9805
+#: c-typeck.c:9855 c-typeck.c:9877 c-typeck.c:9899
#, gcc-internal-format
msgid "%qE appears more than once in data clauses"
msgstr ""
-#: c-typeck.c:9779 cp/semantics.c:3563
+#: c-typeck.c:9870 cp/semantics.c:3664
#, gcc-internal-format
msgid "%qE is not a variable in clause %<firstprivate%>"
msgstr ""
-#: c-typeck.c:9799 cp/semantics.c:3585
+#: c-typeck.c:9892 cp/semantics.c:3686
#, gcc-internal-format
msgid "%qE is not a variable in clause %<lastprivate%>"
msgstr ""
-#: c-typeck.c:9859 cp/semantics.c:3784
+#: c-typeck.c:9954 cp/semantics.c:3885
#, gcc-internal-format
msgid "%qE is predetermined %qs for %qs"
msgstr ""
-#: calls.c:2056
+#: c-typeck.c:10043
#, gcc-internal-format
-msgid "function call has aggregate value"
+msgid "C++ requires promoted type, not enum type, in %<va_arg%>"
msgstr ""
-#: cfgexpand.c:318
+#: calls.c:2057
#, gcc-internal-format
-msgid "Unrecognized GIMPLE statement during RTL expansion"
+msgid "function call has aggregate value"
msgstr ""
-#: cfgexpand.c:2477
+#: cfgexpand.c:3578
#, gcc-internal-format
msgid "not protecting local variables: variable length buffer"
msgstr ""
-#: cfgexpand.c:2480
+#: cfgexpand.c:3581
#, gcc-internal-format
msgid "not protecting function: no buffer at least %d bytes long"
msgstr ""
@@ -22888,7 +23524,7 @@ msgstr ""
msgid "verify_flow_info: Basic block %d succ edge is corrupted"
msgstr ""
-#: cfghooks.c:197 cfgrtl.c:1856
+#: cfghooks.c:197
#, gcc-internal-format
msgid "wrong amount of branch edges after unconditional jump %i"
msgstr ""
@@ -22933,492 +23569,512 @@ msgstr ""
msgid "%s does not support split_block"
msgstr ""
-#: cfghooks.c:482
+#: cfghooks.c:483
#, gcc-internal-format
msgid "%s does not support move_block_after"
msgstr ""
-#: cfghooks.c:495
+#: cfghooks.c:496
#, gcc-internal-format
msgid "%s does not support delete_basic_block"
msgstr ""
-#: cfghooks.c:545
+#: cfghooks.c:546
#, gcc-internal-format
msgid "%s does not support split_edge"
msgstr ""
-#: cfghooks.c:618
+#: cfghooks.c:619
#, gcc-internal-format
msgid "%s does not support create_basic_block"
msgstr ""
-#: cfghooks.c:646
+#: cfghooks.c:647
#, gcc-internal-format
msgid "%s does not support can_merge_blocks_p"
msgstr ""
-#: cfghooks.c:657
+#: cfghooks.c:658
#, gcc-internal-format
msgid "%s does not support predict_edge"
msgstr ""
-#: cfghooks.c:666
+#: cfghooks.c:667
#, gcc-internal-format
msgid "%s does not support predicted_by_p"
msgstr ""
-#: cfghooks.c:680
+#: cfghooks.c:681
#, gcc-internal-format
msgid "%s does not support merge_blocks"
msgstr ""
-#: cfghooks.c:733
+#: cfghooks.c:734
#, gcc-internal-format
msgid "%s does not support make_forwarder_block"
msgstr ""
-#: cfghooks.c:880
+#: cfghooks.c:881
#, gcc-internal-format
msgid "%s does not support can_duplicate_block_p"
msgstr ""
-#: cfghooks.c:902
+#: cfghooks.c:903
#, gcc-internal-format
msgid "%s does not support duplicate_block"
msgstr ""
-#: cfghooks.c:979
+#: cfghooks.c:980
#, gcc-internal-format
msgid "%s does not support block_ends_with_call_p"
msgstr ""
-#: cfghooks.c:990
+#: cfghooks.c:991
#, gcc-internal-format
msgid "%s does not support block_ends_with_condjump_p"
msgstr ""
-#: cfghooks.c:1008
+#: cfghooks.c:1009
#, gcc-internal-format
msgid "%s does not support flow_call_edges_add"
msgstr ""
-#: cfgloop.c:1344
+#: cfgloop.c:1345
#, gcc-internal-format
msgid "size of loop %d should be %d, not %d"
msgstr ""
-#: cfgloop.c:1358
+#: cfgloop.c:1359
#, gcc-internal-format
msgid "bb %d do not belong to loop %d"
msgstr ""
-#: cfgloop.c:1373
+#: cfgloop.c:1374
#, gcc-internal-format
msgid "loop %d's header does not have exactly 2 entries"
msgstr ""
-#: cfgloop.c:1380
+#: cfgloop.c:1381
#, gcc-internal-format
msgid "loop %d's latch does not have exactly 1 successor"
msgstr ""
-#: cfgloop.c:1385
+#: cfgloop.c:1386
#, gcc-internal-format
msgid "loop %d's latch does not have header as successor"
msgstr ""
-#: cfgloop.c:1390
+#: cfgloop.c:1391
#, gcc-internal-format
msgid "loop %d's latch does not belong directly to it"
msgstr ""
-#: cfgloop.c:1396
+#: cfgloop.c:1397
#, gcc-internal-format
msgid "loop %d's header does not belong directly to it"
msgstr ""
-#: cfgloop.c:1402
+#: cfgloop.c:1403
#, gcc-internal-format
msgid "loop %d's latch is marked as part of irreducible region"
msgstr ""
-#: cfgloop.c:1435
+#: cfgloop.c:1436
#, gcc-internal-format
msgid "basic block %d should be marked irreducible"
msgstr ""
-#: cfgloop.c:1441
+#: cfgloop.c:1442
#, gcc-internal-format
msgid "basic block %d should not be marked irreducible"
msgstr ""
-#: cfgloop.c:1449
+#: cfgloop.c:1450
#, gcc-internal-format
msgid "edge from %d to %d should be marked irreducible"
msgstr ""
-#: cfgloop.c:1456
+#: cfgloop.c:1457
#, gcc-internal-format
msgid "edge from %d to %d should not be marked irreducible"
msgstr ""
-#: cfgloop.c:1471
+#: cfgloop.c:1472
#, gcc-internal-format
msgid "corrupted head of the exits list of loop %d"
msgstr ""
-#: cfgloop.c:1489
+#: cfgloop.c:1490
#, gcc-internal-format
msgid "corrupted exits list of loop %d"
msgstr ""
-#: cfgloop.c:1498
+#: cfgloop.c:1499
#, gcc-internal-format
msgid "nonempty exits list of loop %d, but exits are not recorded"
msgstr ""
-#: cfgloop.c:1524
+#: cfgloop.c:1525
#, gcc-internal-format
msgid "Exit %d->%d not recorded"
msgstr ""
-#: cfgloop.c:1542
+#: cfgloop.c:1543
#, gcc-internal-format
msgid "Wrong list of exited loops for edge %d->%d"
msgstr ""
-#: cfgloop.c:1551
+#: cfgloop.c:1552
#, gcc-internal-format
msgid "Too many loop exits recorded"
msgstr ""
-#: cfgloop.c:1562
+#: cfgloop.c:1563
#, gcc-internal-format
msgid "%d exits recorded for loop %d (having %d exits)"
msgstr ""
-#: cfgrtl.c:1750
+#: cfgrtl.c:1830
#, gcc-internal-format
msgid "BB_RTL flag not set for block %d"
msgstr ""
-#: cfgrtl.c:1757
+#: cfgrtl.c:1837
#, gcc-internal-format
msgid "insn %d basic block pointer is %d, should be %d"
msgstr ""
-#: cfgrtl.c:1768
+#: cfgrtl.c:1848
#, gcc-internal-format
msgid "insn %d in header of bb %d has non-NULL basic block"
msgstr ""
-#: cfgrtl.c:1776
+#: cfgrtl.c:1856
#, gcc-internal-format
msgid "insn %d in footer of bb %d has non-NULL basic block"
msgstr ""
-#: cfgrtl.c:1798
+#: cfgrtl.c:1878
#, gcc-internal-format
msgid "verify_flow_info: REG_BR_PROB does not match cfg %wi %i"
msgstr ""
-#: cfgrtl.c:1813
+#: cfgrtl.c:1893
#, gcc-internal-format
msgid "fallthru edge crosses section boundary (bb %i)"
msgstr ""
-#: cfgrtl.c:1838
+#: cfgrtl.c:1917
#, gcc-internal-format
msgid "missing REG_EH_REGION note in the end of bb %i"
msgstr ""
-#: cfgrtl.c:1846
+#: cfgrtl.c:1922
+#, gcc-internal-format
+msgid "too many eh edges %i"
+msgstr ""
+
+#: cfgrtl.c:1930
#, gcc-internal-format
msgid "too many outgoing branch edges from bb %i"
msgstr ""
-#: cfgrtl.c:1851
+#: cfgrtl.c:1935
#, gcc-internal-format
msgid "fallthru edge after unconditional jump %i"
msgstr ""
-#: cfgrtl.c:1862
+#: cfgrtl.c:1940
+#, gcc-internal-format
+msgid "wrong number of branch edges after unconditional jump %i"
+msgstr ""
+
+#: cfgrtl.c:1947
#, gcc-internal-format
msgid "wrong amount of branch edges after conditional jump %i"
msgstr ""
-#: cfgrtl.c:1868
+#: cfgrtl.c:1953
#, gcc-internal-format
msgid "call edges for non-call insn in bb %i"
msgstr ""
-#: cfgrtl.c:1877
+#: cfgrtl.c:1962
#, gcc-internal-format
msgid "abnormal edges for no purpose in bb %i"
msgstr ""
-#: cfgrtl.c:1889
+#: cfgrtl.c:1974
#, gcc-internal-format
msgid "insn %d inside basic block %d but block_for_insn is NULL"
msgstr ""
-#: cfgrtl.c:1893
+#: cfgrtl.c:1978
#, gcc-internal-format
msgid "insn %d inside basic block %d but block_for_insn is %i"
msgstr ""
-#: cfgrtl.c:1907 cfgrtl.c:1917
+#: cfgrtl.c:1992 cfgrtl.c:2002
#, gcc-internal-format
msgid "NOTE_INSN_BASIC_BLOCK is missing for block %d"
msgstr ""
-#: cfgrtl.c:1930
+#: cfgrtl.c:2015
#, gcc-internal-format
msgid "NOTE_INSN_BASIC_BLOCK %d in middle of basic block %d"
msgstr ""
-#: cfgrtl.c:1940
+#: cfgrtl.c:2025
#, gcc-internal-format
msgid "in basic block %d:"
msgstr ""
-#: cfgrtl.c:1993 cfgrtl.c:2083
+#: cfgrtl.c:2078 cfgrtl.c:2170
#, gcc-internal-format
msgid "insn %d outside of basic blocks has non-NULL bb field"
msgstr ""
-#: cfgrtl.c:2001
+#: cfgrtl.c:2086
#, gcc-internal-format
msgid "end insn %d for block %d not found in the insn stream"
msgstr ""
-#: cfgrtl.c:2014
+#: cfgrtl.c:2099
#, gcc-internal-format
msgid "insn %d is in multiple basic blocks (%d and %d)"
msgstr ""
-#: cfgrtl.c:2026
+#: cfgrtl.c:2111
#, gcc-internal-format
msgid "head insn %d for block %d not found in the insn stream"
msgstr ""
-#: cfgrtl.c:2046
+#: cfgrtl.c:2130
#, gcc-internal-format
msgid "missing barrier after block %i"
msgstr ""
-#: cfgrtl.c:2059
+#: cfgrtl.c:2146
#, gcc-internal-format
msgid "verify_flow_info: Incorrect blocks for fallthru %i->%i"
msgstr ""
-#: cfgrtl.c:2068
+#: cfgrtl.c:2155
#, gcc-internal-format
msgid "verify_flow_info: Incorrect fallthru %i->%i"
msgstr ""
-#: cfgrtl.c:2101
+#: cfgrtl.c:2188
#, gcc-internal-format
msgid "basic blocks not laid down consecutively"
msgstr ""
-#: cfgrtl.c:2140
+#: cfgrtl.c:2225
#, gcc-internal-format
msgid "number of bb notes in insn chain (%d) != n_basic_blocks (%d)"
msgstr ""
-#: cgraph.c:1494
+#: cgraph.c:1601
#, gcc-internal-format
msgid "%D renamed after being referenced in assembly"
msgstr ""
-#: cgraphunit.c:580
+#: cgraphunit.c:581
#, gcc-internal-format
msgid "aux field set for edge %s->%s"
msgstr ""
-#: cgraphunit.c:587
+#: cgraphunit.c:588
#, gcc-internal-format
msgid "Execution count is negative"
msgstr ""
-#: cgraphunit.c:594
+#: cgraphunit.c:593
+#, gcc-internal-format
+msgid "Externally visible inline clone"
+msgstr ""
+
+#: cgraphunit.c:598
+#, gcc-internal-format
+msgid "Inline clone with address taken"
+msgstr ""
+
+#: cgraphunit.c:603
+#, gcc-internal-format
+msgid "Inline clone is needed"
+msgstr ""
+
+#: cgraphunit.c:610
#, gcc-internal-format
msgid "caller edge count is negative"
msgstr ""
-#: cgraphunit.c:599
+#: cgraphunit.c:615
#, gcc-internal-format
msgid "caller edge frequency is negative"
msgstr ""
-#: cgraphunit.c:604
+#: cgraphunit.c:620
#, gcc-internal-format
msgid "caller edge frequency is too large"
msgstr ""
-#: cgraphunit.c:613
+#: cgraphunit.c:629
#, gcc-internal-format
msgid "inlined_to pointer is wrong"
msgstr ""
-#: cgraphunit.c:618
+#: cgraphunit.c:634
#, gcc-internal-format
msgid "multiple inline callers"
msgstr ""
-#: cgraphunit.c:625
+#: cgraphunit.c:641
#, gcc-internal-format
msgid "inlined_to pointer set for noninline callers"
msgstr ""
-#: cgraphunit.c:631
+#: cgraphunit.c:647
#, gcc-internal-format
msgid "inlined_to pointer is set but no predecessors found"
msgstr ""
-#: cgraphunit.c:636
+#: cgraphunit.c:652
#, gcc-internal-format
msgid "inlined_to pointer refers to itself"
msgstr ""
-#: cgraphunit.c:642
+#: cgraphunit.c:658
#, gcc-internal-format
msgid "node not found in cgraph_hash"
msgstr ""
-#: cgraphunit.c:654
+#: cgraphunit.c:670
#, gcc-internal-format
msgid "node has wrong clone_of"
msgstr ""
-#: cgraphunit.c:666
+#: cgraphunit.c:682
#, gcc-internal-format
msgid "node has wrong clone list"
msgstr ""
-#: cgraphunit.c:672
+#: cgraphunit.c:688
#, gcc-internal-format
msgid "node is in clone list but it is not clone"
msgstr ""
-#: cgraphunit.c:677
+#: cgraphunit.c:693
#, gcc-internal-format
msgid "node has wrong prev_clone pointer"
msgstr ""
-#: cgraphunit.c:682
+#: cgraphunit.c:698
#, gcc-internal-format
msgid "double linked list of clones corrupted"
msgstr ""
-#: cgraphunit.c:711
+#: cgraphunit.c:728
#, gcc-internal-format
msgid "shared call_stmt:"
msgstr ""
-#: cgraphunit.c:718
+#: cgraphunit.c:735
#, gcc-internal-format
msgid "edge points to wrong declaration:"
msgstr ""
-#: cgraphunit.c:727
+#: cgraphunit.c:744
#, gcc-internal-format
msgid "missing callgraph edge for call stmt:"
msgstr ""
-#: cgraphunit.c:743
+#: cgraphunit.c:760
#, gcc-internal-format
msgid "edge %s->%s has no corresponding call_stmt"
msgstr ""
-#: cgraphunit.c:755
+#: cgraphunit.c:772
#, gcc-internal-format
msgid "verify_cgraph_node failed"
msgstr ""
-#: cgraphunit.c:848 cgraphunit.c:871
+#: cgraphunit.c:875 cgraphunit.c:894
#, gcc-internal-format
-msgid "%J%<externally_visible%> attribute have effect only on public objects"
+msgid "%<externally_visible%> attribute have effect only on public objects"
msgstr ""
-#: cgraphunit.c:1065
+#: cgraphunit.c:1132
#, gcc-internal-format
msgid "failed to reclaim unneeded function"
msgstr ""
-#: cgraphunit.c:1400
+#: cgraphunit.c:1492
#, gcc-internal-format
msgid "nodes with unreleased memory found"
msgstr ""
-#: collect2.c:1210
+#: collect2.c:1588
#, gcc-internal-format
msgid "unknown demangling style '%s'"
msgstr ""
-#: collect2.c:1533
+#: collect2.c:1946 lto/lto.c:1172
#, gcc-internal-format
msgid "%s terminated with signal %d [%s]%s"
msgstr ""
-#: collect2.c:1551
-#, gcc-internal-format
-msgid "%s returned %d exit status"
-msgstr ""
-
-#: collect2.c:2262
+#: collect2.c:2748
#, gcc-internal-format
msgid "cannot find 'ldd'"
msgstr ""
-#: convert.c:69
+#: convert.c:79
#, gcc-internal-format
msgid "cannot convert to a pointer type"
msgstr ""
-#: convert.c:370
+#: convert.c:380
#, gcc-internal-format
msgid "pointer value used where a floating point value was expected"
msgstr ""
-#: convert.c:374
+#: convert.c:384
#, gcc-internal-format
msgid "aggregate value used where a float was expected"
msgstr ""
-#: convert.c:399
+#: convert.c:409
#, gcc-internal-format
msgid "conversion to incomplete type"
msgstr ""
-#: convert.c:769 convert.c:845
+#: convert.c:819 convert.c:895
#, gcc-internal-format
msgid "can't convert between vector values of different size"
msgstr ""
-#: convert.c:775
+#: convert.c:825
#, gcc-internal-format
msgid "aggregate value used where an integer was expected"
msgstr ""
-#: convert.c:825
+#: convert.c:875
#, gcc-internal-format
msgid "pointer value used where a complex was expected"
msgstr ""
-#: convert.c:829
+#: convert.c:879
#, gcc-internal-format
msgid "aggregate value used where a complex was expected"
msgstr ""
-#: convert.c:851
+#: convert.c:901
#, gcc-internal-format
msgid "can't convert value to a vector"
msgstr ""
-#: convert.c:890
+#: convert.c:940
#, gcc-internal-format
msgid "aggregate value used where a fixed-point was expected"
msgstr ""
@@ -23483,37 +24139,37 @@ msgstr ""
msgid "this can result in poorly optimized code"
msgstr ""
-#: coverage.c:569
+#: coverage.c:570
#, gcc-internal-format
msgid "cannot open %s"
msgstr ""
-#: coverage.c:604
+#: coverage.c:605
#, gcc-internal-format
msgid "error writing %qs"
msgstr ""
-#: dbgcnt.c:134
+#: dbgcnt.c:135
#, gcc-internal-format
msgid "Can not find a valid counter:value pair:"
msgstr ""
-#: dbgcnt.c:135
+#: dbgcnt.c:136
#, gcc-internal-format
msgid "-fdbg-cnt=%s"
msgstr ""
-#: dbgcnt.c:136
+#: dbgcnt.c:137
#, gcc-internal-format
msgid " %s"
msgstr ""
-#: dbxout.c:3228
+#: dbxout.c:3257
#, gcc-internal-format
msgid "common symbol debug info is not structured as symbol+offset"
msgstr ""
-#: diagnostic.c:724
+#: diagnostic.c:728
#, gcc-internal-format
msgid "in %s, at %s:%d"
msgstr ""
@@ -23528,253 +24184,250 @@ msgstr ""
msgid "dominator of %d should be %d, not %d"
msgstr ""
-#: dwarf2out.c:4543
+#: dwarf2out.c:4011
+#, gcc-internal-format
+msgid ""
+"Multiple EH personalities are supported only with assemblers supporting .cfi."
+"personality directive."
+msgstr ""
+
+#: dwarf2out.c:5389
#, gcc-internal-format
msgid "DW_LOC_OP %s not implemented"
msgstr ""
-#: emit-rtl.c:2457
+#: emit-rtl.c:2437
#, gcc-internal-format
msgid "invalid rtl sharing found in the insn"
msgstr ""
-#: emit-rtl.c:2459
+#: emit-rtl.c:2439
#, gcc-internal-format
msgid "shared rtx"
msgstr ""
-#: emit-rtl.c:2461
+#: emit-rtl.c:2441
#, gcc-internal-format
msgid "internal consistency failure"
msgstr ""
-#: emit-rtl.c:3521
+#: emit-rtl.c:3599
#, gcc-internal-format
msgid "ICE: emit_insn used where emit_jump_insn needed:\n"
msgstr ""
-#: errors.c:132
+#: errors.c:133
#, gcc-internal-format
msgid "abort in %s, at %s:%d"
msgstr ""
-#: except.c:199
+#: except.c:223
#, gcc-internal-format
msgid "exception handling disabled, use -fexceptions to enable"
msgstr ""
-#: except.c:3387
+#: except.c:2026
#, gcc-internal-format
msgid "argument of %<__builtin_eh_return_regno%> must be constant"
msgstr ""
-#: except.c:3520
+#: except.c:2163
#, gcc-internal-format
msgid "__builtin_eh_return not supported on this target"
msgstr ""
-#: except.c:4470
-#, gcc-internal-format
-msgid "Try region %i has wrong rh_catch pointer to %i"
-msgstr ""
-
-#: except.c:4480
-#, gcc-internal-format
-msgid "Catch region %i has different outer region than try region %i"
-msgstr ""
-
-#: except.c:4486
-#, gcc-internal-format
-msgid "Catch region %i has corrupted catchlist"
-msgstr ""
-
-#: except.c:4495
+#: except.c:3334 except.c:3359
#, gcc-internal-format
-msgid "Try region %i has wrong last_catch pointer to %i instead of %i"
+msgid "region_array is corrupted for region %i"
msgstr ""
-#: except.c:4507
+#: except.c:3347 except.c:3378
#, gcc-internal-format
-msgid "Catch region %i should be followed by try"
+msgid "lp_array is corrupted for lp %i"
msgstr ""
-#: except.c:4545 except.c:4556
+#: except.c:3364
#, gcc-internal-format
-msgid "region_array is corrupted for region %i"
+msgid "outer block of region %i is wrong"
msgstr ""
-#: except.c:4561
+#: except.c:3369
#, gcc-internal-format
-msgid "outer block of region %i is wrong"
+msgid "negative nesting depth of region %i"
msgstr ""
-#: except.c:4567
+#: except.c:3383
#, gcc-internal-format
-msgid "region %i may contain throw and is contained in region that may not"
+msgid "region of lp %i is wrong"
msgstr ""
-#: except.c:4573
+#: except.c:3410
#, gcc-internal-format
-msgid "negative nesting depth of region %i"
+msgid "tree list ends on depth %i"
msgstr ""
-#: except.c:4594
+#: except.c:3415
#, gcc-internal-format
-msgid "tree list ends on depth %i"
+msgid "region_array does not match region_tree"
msgstr ""
-#: except.c:4599
+#: except.c:3420
#, gcc-internal-format
-msgid "array does not match the region tree"
+msgid "lp_array does not match region_tree"
msgstr ""
-#: except.c:4609
+#: except.c:3427
#, gcc-internal-format
msgid "verify_eh_tree failed"
msgstr ""
-#: explow.c:1263
+#: explow.c:1294
#, gcc-internal-format
msgid "stack limits not supported on this target"
msgstr ""
-#: expr.c:8060
+#: expr.c:9169
msgid "%Kcall to %qs declared with attribute error: %s"
msgstr ""
-#: expr.c:8067
+#: expr.c:9176
msgid "%Kcall to %qs declared with attribute warning: %s"
msgstr ""
-#: final.c:1432
+#: final.c:1459
#, gcc-internal-format
msgid "invalid argument %qs to -fdebug-prefix-map"
msgstr ""
-#: final.c:1533
+#: final.c:1576
#, gcc-internal-format
msgid "the frame size of %wd bytes is larger than %wd bytes"
msgstr ""
-#: fixed-value.c:104
+#: final.c:4371 toplev.c:1920
#, gcc-internal-format
-msgid "large fixed-point constant implicitly truncated to fixed-point type"
+msgid "could not open final insn dump file %qs: %s"
+msgstr ""
+
+#: final.c:4425
+#, gcc-internal-format
+msgid "could not close final insn dump file %qs: %s"
msgstr ""
-#: fold-const.c:991 tree-ssa-loop-niter.c:1880 tree-vrp.c:5723 tree-vrp.c:5764
+#: fixed-value.c:104
#, gcc-internal-format
-msgid "%H%s"
+msgid "large fixed-point constant implicitly truncated to fixed-point type"
msgstr ""
-#: fold-const.c:1361
+#: fold-const.c:1366
#, gcc-internal-format
msgid "assuming signed overflow does not occur when negating a division"
msgstr ""
-#: fold-const.c:4059 fold-const.c:4070
+#: fold-const.c:4264 fold-const.c:4276
#, gcc-internal-format
msgid "comparison is always %d due to width of bit-field"
msgstr ""
-#: fold-const.c:5404
+#: fold-const.c:5616
#, gcc-internal-format
msgid "assuming signed overflow does not occur when simplifying range test"
msgstr ""
-#: fold-const.c:5781 fold-const.c:5796
+#: fold-const.c:6011 fold-const.c:6026
#, gcc-internal-format
msgid "comparison is always %d"
msgstr ""
-#: fold-const.c:5925
+#: fold-const.c:6161
#, gcc-internal-format
msgid "%<or%> of unmatched not-equal tests is always 1"
msgstr ""
-#: fold-const.c:5930
+#: fold-const.c:6166
#, gcc-internal-format
msgid "%<and%> of mutually exclusive equal-tests is always 0"
msgstr ""
-#: fold-const.c:8833
+#: fold-const.c:9127
#, gcc-internal-format
msgid ""
"assuming signed overflow does not occur when reducing constant in comparison"
msgstr ""
-#: fold-const.c:9200
+#: fold-const.c:9499
#, gcc-internal-format
msgid ""
"assuming signed overflow does not occur when combining constants around a "
"comparison"
msgstr ""
-#: fold-const.c:13762
+#: fold-const.c:14202
#, gcc-internal-format
msgid "fold check: original tree changed by fold"
msgstr ""
-#: function.c:251
+#: function.c:254
#, gcc-internal-format
-msgid "%Jtotal size of local objects too large"
+msgid "total size of local objects too large"
msgstr ""
-#: function.c:916 varasm.c:2145
+#: function.c:919 varasm.c:2152
#, gcc-internal-format
msgid "size of variable %q+D is too large"
msgstr ""
-#: function.c:1624 gimplify.c:4931
+#: function.c:1627 gimplify.c:4924
#, gcc-internal-format
msgid "impossible constraint in %<asm%>"
msgstr ""
-#: function.c:3730
+#: function.c:3750
#, gcc-internal-format
msgid "variable %q+D might be clobbered by %<longjmp%> or %<vfork%>"
msgstr ""
-#: function.c:3751
+#: function.c:3771
#, gcc-internal-format
msgid "argument %q+D might be clobbered by %<longjmp%> or %<vfork%>"
msgstr ""
-#: function.c:4196
+#: function.c:4216
#, gcc-internal-format
msgid "function returns an aggregate"
msgstr ""
-#: function.c:4597
+#: function.c:4618
#, gcc-internal-format
msgid "unused parameter %q+D"
msgstr ""
-#: gcc.c:1318
+#: gcc.c:1366
#, gcc-internal-format
msgid "ambiguous abbreviation %s"
msgstr ""
-#: gcc.c:1345
+#: gcc.c:1393
#, gcc-internal-format
msgid "incomplete '%s' option"
msgstr ""
-#: gcc.c:1356
+#: gcc.c:1404
#, gcc-internal-format
msgid "missing argument to '%s' option"
msgstr ""
-#: gcc.c:1369
+#: gcc.c:1417
#, gcc-internal-format
msgid "extraneous argument to '%s' option"
msgstr ""
-#: gcc.c:4092
+#: gcc.c:4276
#, gcc-internal-format
msgid "warning: -pipe ignored because -save-temps specified"
msgstr ""
-#: gcc.c:4385
+#: gcc.c:4583
#, gcc-internal-format
msgid "warning: '-x %s' after last input file has no effect"
msgstr ""
@@ -23782,125 +24435,165 @@ msgstr ""
#. Catch the case where a spec string contains something like
#. '%{foo:%*}'. i.e. there is no * in the pattern on the left
#. hand side of the :.
-#: gcc.c:5541
+#: gcc.c:5830
#, gcc-internal-format
msgid "spec failure: '%%*' has not been initialized by pattern match"
msgstr ""
-#: gcc.c:5550
+#: gcc.c:5839
#, gcc-internal-format
msgid "warning: use of obsolete %%[ operator in specs"
msgstr ""
-#: gcc.c:5631
+#: gcc.c:5920
#, gcc-internal-format
msgid "spec failure: unrecognized spec option '%c'"
msgstr ""
-#: gcc.c:6528
+#: gcc.c:6655
+#, gcc-internal-format
+msgid "%s: could not determine length of compare-debug file %s"
+msgstr ""
+
+#: gcc.c:6666
+#, gcc-internal-format
+msgid "%s: -fcompare-debug failure (length)"
+msgstr ""
+
+#: gcc.c:6676 gcc.c:6717
+#, gcc-internal-format
+msgid "%s: could not open compare-debug file %s"
+msgstr ""
+
+#: gcc.c:6696 gcc.c:6733
+#, gcc-internal-format
+msgid "%s: -fcompare-debug failure"
+msgstr ""
+
+#: gcc.c:6969
#, gcc-internal-format
msgid "spec failure: more than one arg to SYSROOT_SUFFIX_SPEC"
msgstr ""
-#: gcc.c:6551
+#: gcc.c:6992
#, gcc-internal-format
msgid "spec failure: more than one arg to SYSROOT_HEADERS_SUFFIX_SPEC"
msgstr ""
-#: gcc.c:6638
+#: gcc.c:7100
#, gcc-internal-format
msgid "unrecognized option '-%s'"
msgstr ""
-#: gcc.c:6871 gcc.c:6934
+#: gcc.c:7333 gcc.c:7396
#, gcc-internal-format
msgid "%s: %s compiler not installed on this system"
msgstr ""
-#: gcc.c:7034
+#: gcc.c:7420
+#, gcc-internal-format
+msgid "Recompiling with -fcompare-debug"
+msgstr ""
+
+#: gcc.c:7434
+#, gcc-internal-format
+msgid "during -fcompare-debug recompilation"
+msgstr ""
+
+#: gcc.c:7443
+#, gcc-internal-format
+msgid "Comparing final insns dumps"
+msgstr ""
+
+#: gcc.c:7567
#, gcc-internal-format
msgid "%s: linker input file unused because linking not done"
msgstr ""
-#: gcc.c:7074
+#: gcc.c:7607
#, gcc-internal-format
msgid "language %s not recognized"
msgstr ""
-#: gcc.c:7145
+#: gcc.c:7678 lto/lto.c:1162
#, gcc-internal-format
msgid "%s: %s"
msgstr ""
-#: gcse.c:4910
+#: gcse.c:4933
#, gcc-internal-format
msgid "%s: %d basic blocks and %d edges/basic block"
msgstr ""
-#: gcse.c:4923
+#: gcse.c:4946
#, gcc-internal-format
msgid "%s: %d basic blocks and %d registers"
msgstr ""
-#: ggc-common.c:400 ggc-common.c:408 ggc-common.c:476 ggc-common.c:495
-#: ggc-page.c:2173 ggc-page.c:2204 ggc-page.c:2211 ggc-zone.c:2437
-#: ggc-zone.c:2448 ggc-zone.c:2452
+#: ggc-common.c:466 ggc-common.c:474 ggc-common.c:542 ggc-common.c:561
+#: ggc-page.c:2180 ggc-page.c:2211 ggc-page.c:2218 ggc-zone.c:2442
+#: ggc-zone.c:2453 ggc-zone.c:2457
#, gcc-internal-format
msgid "can't write PCH file: %m"
msgstr ""
-#: ggc-common.c:488 config/i386/host-cygwin.c:57
+#: ggc-common.c:554 config/i386/host-cygwin.c:57
#, gcc-internal-format
msgid "can't get position in PCH file: %m"
msgstr ""
-#: ggc-common.c:498
+#: ggc-common.c:564
#, gcc-internal-format
msgid "can't write padding to PCH file: %m"
msgstr ""
-#: ggc-common.c:553 ggc-common.c:561 ggc-common.c:568 ggc-common.c:571
-#: ggc-common.c:581 ggc-common.c:584 ggc-page.c:2301 ggc-zone.c:2471
+#: ggc-common.c:619 ggc-common.c:627 ggc-common.c:634 ggc-common.c:637
+#: ggc-common.c:647 ggc-common.c:650 ggc-page.c:2308 ggc-zone.c:2476
#, gcc-internal-format
msgid "can't read PCH file: %m"
msgstr ""
-#: ggc-common.c:576
+#: ggc-common.c:642
#, gcc-internal-format
msgid "had to relocate PCH"
msgstr ""
-#: ggc-page.c:1505
+#: ggc-page.c:1506
#, gcc-internal-format
msgid "open /dev/zero: %m"
msgstr ""
-#: ggc-page.c:2189 ggc-page.c:2195
+#: ggc-page.c:2196 ggc-page.c:2202
#, gcc-internal-format
msgid "can't write PCH file"
msgstr ""
-#: ggc-zone.c:2434 ggc-zone.c:2445
+#: ggc-zone.c:2439 ggc-zone.c:2450
#, gcc-internal-format
msgid "can't seek PCH file: %m"
msgstr ""
-#: gimple.c:1113
+#: gimple.c:1032
#, gcc-internal-format
msgid "gimple check: expected %s(%s), have %s(%s) in %s, at %s:%d"
msgstr ""
-#: gimplify.c:4816
+#: gimplify.c:2423
+#, gcc-internal-format
+msgid "using result of function returning %<void%>"
+msgstr ""
+
+#: gimplify.c:4809
#, gcc-internal-format
msgid "invalid lvalue in asm output %d"
msgstr ""
-#: gimplify.c:4932
+#: gimplify.c:4925
#, gcc-internal-format
msgid "non-memory input %d must stay in memory"
msgstr ""
-#: gimplify.c:4947
+#: gimplify.c:4940
#, gcc-internal-format
msgid "memory input %d is not directly addressable"
msgstr ""
@@ -23912,7 +24605,7 @@ msgstr ""
#: gimplify.c:5443
#, gcc-internal-format
-msgid "%Henclosing parallel"
+msgid "enclosing parallel"
msgstr ""
#: gimplify.c:5548
@@ -23935,99 +24628,250 @@ msgstr ""
msgid "%s variable %qE is private in outer context"
msgstr ""
-#: gimplify.c:7252
+#: gimplify.c:7246
#, gcc-internal-format
msgid "gimplification failed"
msgstr ""
-#: graph.c:401 java/jcf-parse.c:1750 java/jcf-parse.c:1890 objc/objc-act.c:496
+#: graph.c:401 java/jcf-parse.c:1751 java/jcf-parse.c:1892 objc/objc-act.c:524
#, gcc-internal-format
msgid "can't open %s: %m"
msgstr ""
-#: graphite.c:6188 toplev.c:1791
+#: graphite.c:299 toplev.c:1836
#, gcc-internal-format
msgid "Graphite loop optimizations cannot be used"
msgstr ""
-#: haifa-sched.c:184
+#: haifa-sched.c:185
#, gcc-internal-format
msgid "fix_sched_param: unknown param: %s"
msgstr ""
-#: ira.c:1439 ira.c:1452 ira.c:1466
+#: ira.c:1472 ira.c:1485 ira.c:1499
#, gcc-internal-format
msgid "%s cannot be used in asm here"
msgstr ""
-#: omp-low.c:1819
+#: lto-cgraph.c:508
+#, gcc-internal-format
+msgid "bytecode stream: found multiple instances of cgraph node %d"
+msgstr ""
+
+#: lto-cgraph.c:549
+#, gcc-internal-format
+msgid "bytecode stream: no caller found while reading edge"
+msgstr ""
+
+#: lto-cgraph.c:553
+#, gcc-internal-format
+msgid "bytecode stream: no callee found while reading edge"
+msgstr ""
+
+#: lto-cgraph.c:602
+#, gcc-internal-format
+msgid "bytecode stream: found empty cgraph node"
+msgstr ""
+
+#: lto-compress.c:190 lto-compress.c:198 lto-compress.c:219 lto-compress.c:280
+#: lto-compress.c:288 lto-compress.c:309
+#, gcc-internal-format
+msgid "compressed stream: %s"
+msgstr ""
+
+#: lto-section-in.c:66
+#, gcc-internal-format
+msgid ""
+"bytecode stream: trying to read %d bytes after the end of the input buffer"
+msgstr ""
+
+#: lto-streamer-in.c:80
+#, gcc-internal-format
+msgid "bytecode stream: unexpected tag %s"
+msgstr ""
+
+#: lto-streamer-in.c:91
+#, gcc-internal-format
+msgid "bytecode stream: tag %s is not in the expected range [%s, %s]"
+msgstr ""
+
+#: lto-streamer-in.c:105
+#, gcc-internal-format
+msgid "bytecode stream: expected tag %s instead of %s"
+msgstr ""
+
+#: lto-streamer-in.c:149
+#, gcc-internal-format
+msgid "bytecode stream: string too long for the string table"
+msgstr ""
+
+#: lto-streamer-in.c:209
+#, gcc-internal-format
+msgid "bytecode stream: found non-null terminated string"
+msgstr ""
+
+#: lto-streamer-in.c:1102
+#, gcc-internal-format
+msgid "bytecode stream: unknown GIMPLE statement tag %s"
+msgstr ""
+
+#: lto-streamer-in.c:2357
+#, gcc-internal-format
+msgid "optimization options not supported yet"
+msgstr ""
+
+#: lto-streamer-in.c:2362
+#, gcc-internal-format
+msgid "target optimization options not supported yet"
+msgstr ""
+
+#: lto-streamer-in.c:2505
+#, gcc-internal-format
+msgid "bytecode stream: tried to jump backwards in the stream"
+msgstr ""
+
+#: lto-streamer-in.c:2549
+#, gcc-internal-format
+msgid "target specific builtin not available"
+msgstr ""
+
+#: lto-streamer-out.c:1169
+#, gcc-internal-format
+msgid "gimple bytecode streams do not support the optimization attribute"
+msgstr ""
+
+#: lto-streamer-out.c:1172
+#, gcc-internal-format
+msgid "gimple bytecode streams do not support the target attribute"
+msgstr ""
+
+#: lto-streamer-out.c:1190
+#, gcc-internal-format
+msgid "tree code %qs is not supported in gimple streams"
+msgstr ""
+
+#: lto-streamer-out.c:1234
+#, gcc-internal-format
+msgid ""
+"gimple bytecode streams do not support machine specific builtin functions on "
+"this target"
+msgstr ""
+
+#: lto-streamer.c:173
+#, gcc-internal-format
+msgid "bytecode stream: unexpected LTO section %s"
+msgstr ""
+
+#: lto-streamer.c:856
+#, gcc-internal-format
+msgid ""
+"bytecode stream generated with LTO version %d.%d instead of the expected %d.%"
+"d"
+msgstr ""
+
+#: lto-symtab.c:410
+#, gcc-internal-format
+msgid "%qD has already been defined"
+msgstr ""
+
+#: lto-symtab.c:412
+#, gcc-internal-format
+msgid "previously defined here"
+msgstr ""
+
+#: lto-symtab.c:482
+#, gcc-internal-format
+msgid "type of %qD does not match original declaration"
+msgstr ""
+
+#: lto-symtab.c:489
+#, gcc-internal-format
+msgid "alignment of %qD is bigger than original declaration"
+msgstr ""
+
+#: lto-symtab.c:495 lto-symtab.c:592
+#, gcc-internal-format
+msgid "previously declared here"
+msgstr ""
+
+#: lto-symtab.c:575
+#, gcc-internal-format
+msgid "variable %qD redeclared as function"
+msgstr ""
+
+#: lto-symtab.c:581
+#, gcc-internal-format
+msgid "function %qD redeclared as variable"
+msgstr ""
+
+#: omp-low.c:1840
#, gcc-internal-format
msgid ""
"barrier region may not be closely nested inside of work-sharing, critical, "
"ordered, master or explicit task region"
msgstr ""
-#: omp-low.c:1824
+#: omp-low.c:1845
#, gcc-internal-format
msgid ""
"work-sharing region may not be closely nested inside of work-sharing, "
"critical, ordered, master or explicit task region"
msgstr ""
-#: omp-low.c:1842
+#: omp-low.c:1863
#, gcc-internal-format
msgid ""
"master region may not be closely nested inside of work-sharing or explicit "
"task region"
msgstr ""
-#: omp-low.c:1857
+#: omp-low.c:1878
#, gcc-internal-format
msgid ""
"ordered region may not be closely nested inside of critical or explicit task "
"region"
msgstr ""
-#: omp-low.c:1863
+#: omp-low.c:1884
#, gcc-internal-format
msgid ""
"ordered region must be closely nested inside a loop region with an ordered "
"clause"
msgstr ""
-#: omp-low.c:1878
+#: omp-low.c:1899
#, gcc-internal-format
msgid ""
"critical region may not be nested inside a critical region with the same name"
msgstr ""
-#: omp-low.c:6695 cp/decl.c:2667
+#: omp-low.c:6756 cp/decl.c:2712 cp/parser.c:8327 cp/parser.c:8347
#, gcc-internal-format
msgid "invalid exit from OpenMP structured block"
msgstr ""
-#: omp-low.c:6697 omp-low.c:6702
+#: omp-low.c:6758 omp-low.c:6763
#, gcc-internal-format
msgid "invalid entry to OpenMP structured block"
msgstr ""
#. Otherwise, be vague and lazy, but efficient.
-#: omp-low.c:6705
+#: omp-low.c:6766
#, gcc-internal-format
msgid "invalid branch to/from an OpenMP structured block"
msgstr ""
-#: opts.c:169
+#: opts.c:171
#, gcc-internal-format
msgid "argument %qs to %<-femit-struct-debug-detailed%> not recognized"
msgstr ""
-#: opts.c:203
+#: opts.c:205
#, gcc-internal-format
msgid "argument %qs to %<-femit-struct-debug-detailed%> unknown"
msgstr ""
-#: opts.c:209
+#: opts.c:211
#, gcc-internal-format
msgid ""
"%<-femit-struct-debug-detailed=dir:...%> must allow at least as much as %<-"
@@ -24035,147 +24879,156 @@ msgid ""
msgstr ""
#. Eventually this should become a hard error IMO.
-#: opts.c:435
+#: opts.c:451
#, gcc-internal-format
msgid "command line option \"%s\" is valid for %s but not for %s"
msgstr ""
-#: opts.c:466 opts.c:762
+#: opts.c:482 opts.c:765
#, gcc-internal-format
msgid "unrecognized command line option \"%s\""
msgstr ""
-#: opts.c:527
+#: opts.c:543
#, gcc-internal-format
msgid "command line option %qs is not supported by this configuration"
msgstr ""
-#: opts.c:580
+#: opts.c:596
#, gcc-internal-format
msgid "missing argument to \"%s\""
msgstr ""
-#: opts.c:590
+#: opts.c:606
#, gcc-internal-format
msgid "argument to \"%s\" should be a non-negative integer"
msgstr ""
-#: opts.c:990
+#: opts.c:998
#, gcc-internal-format
msgid "Section anchors must be disabled when unit-at-a-time is disabled."
msgstr ""
-#: opts.c:994
+#: opts.c:1002
#, gcc-internal-format
msgid "Toplevel reorder must be disabled when unit-at-a-time is disabled."
msgstr ""
-#: opts.c:1009
+#: opts.c:1017
#, gcc-internal-format
msgid "section anchors must be disabled when toplevel reorder is disabled"
msgstr ""
-#: opts.c:1039
+#: opts.c:1052 config/sh/sh.c:896
#, gcc-internal-format
-msgid "-freorder-blocks-and-partition does not work with exceptions"
+msgid ""
+"-freorder-blocks-and-partition does not work with exceptions on this "
+"architecture"
msgstr ""
-#: opts.c:1050
+#: opts.c:1069 config/sh/sh.c:904
#, gcc-internal-format
-msgid "-freorder-blocks-and-partition does not support unwind info"
+msgid ""
+"-freorder-blocks-and-partition does not support unwind info on this "
+"architecture"
msgstr ""
-#: opts.c:1064
+#: opts.c:1088
#, gcc-internal-format
msgid "-freorder-blocks-and-partition does not work on this architecture"
msgstr ""
-#: opts.c:1078
+#: opts.c:1102
#, gcc-internal-format
msgid "-fira-algorithm=CB does not work on this architecture"
msgstr ""
-#: opts.c:1387
+#: opts.c:1411
#, gcc-internal-format
msgid "unrecognized include_flags 0x%x passed to print_specific_help"
msgstr ""
-#: opts.c:1725
+#: opts.c:1749
#, gcc-internal-format
msgid "unknown excess precision style \"%s\""
msgstr ""
-#: opts.c:1762
+#: opts.c:1786
#, gcc-internal-format
msgid "structure alignment must be a small power of two, not %d"
msgstr ""
-#: opts.c:1778 opts.c:1786
+#: opts.c:1802 opts.c:1810
#, gcc-internal-format
msgid "Plugin support is disabled. Configure with --enable-plugin."
msgstr ""
-#: opts.c:1865
+#: opts.c:1889
#, gcc-internal-format
msgid "unrecognized visibility value \"%s\""
msgstr ""
-#: opts.c:1923
+#: opts.c:1947
#, gcc-internal-format
msgid "unknown stack check parameter \"%s\""
msgstr ""
-#: opts.c:1949
+#: opts.c:1973
#, gcc-internal-format
msgid "unrecognized register name \"%s\""
msgstr ""
-#: opts.c:1973
+#: opts.c:1997
#, gcc-internal-format
msgid "unknown tls-model \"%s\""
msgstr ""
-#: opts.c:1982
+#: opts.c:2006
#, gcc-internal-format
msgid "unknown ira algorithm \"%s\""
msgstr ""
-#: opts.c:1993
+#: opts.c:2017
#, gcc-internal-format
msgid "unknown ira region \"%s\""
msgstr ""
-#: opts.c:2096
+#: opts.c:2062
+#, gcc-internal-format
+msgid "dwarf version %d is not supported"
+msgstr ""
+
+#: opts.c:2126
#, gcc-internal-format
msgid "%s: --param arguments should be of the form NAME=VALUE"
msgstr ""
-#: opts.c:2101
+#: opts.c:2131
#, gcc-internal-format
msgid "invalid --param value %qs"
msgstr ""
-#: opts.c:2204
+#: opts.c:2234
#, gcc-internal-format
msgid "target system does not support debug output"
msgstr ""
-#: opts.c:2211
+#: opts.c:2241
#, gcc-internal-format
msgid "debug format \"%s\" conflicts with prior selection"
msgstr ""
-#: opts.c:2227
+#: opts.c:2257
#, gcc-internal-format
msgid "unrecognised debug output level \"%s\""
msgstr ""
-#: opts.c:2229
+#: opts.c:2259
#, gcc-internal-format
msgid "debug output level %s is too high"
msgstr ""
-#: opts.c:2313
+#: opts.c:2379
#, gcc-internal-format
msgid "-Werror=%s: No option -%s"
msgstr ""
@@ -24196,499 +25049,517 @@ msgstr ""
msgid "invalid parameter %qs"
msgstr ""
-#: plugin.c:160
+#: passes.c:567
#, gcc-internal-format
-msgid ""
-"Plugin %s was specified with different paths:\n"
-"%s\n"
-"%s"
+msgid "Invalid pass positioning operation"
msgstr ""
-#: plugin.c:206
+#: passes.c:607
#, gcc-internal-format
-msgid "Malformed option -fplugin-arg-%s (multiple '=' signs)"
+msgid "plugin cannot register a missing pass"
msgstr ""
-#: plugin.c:222
+#: passes.c:610
#, gcc-internal-format
-msgid "Malformed option -fplugin-arg-%s (missing -<key>[=<value>])"
+msgid "plugin cannot register an unnamed pass"
msgstr ""
-#: plugin.c:284
+#: passes.c:614
#, gcc-internal-format
-msgid ""
-"Plugin %s should be specified before -fplugin-arg-%s in the command line"
+msgid "plugin cannot register pass %qs without reference pass name"
msgstr ""
-#: plugin.c:365
+#: passes.c:626
#, gcc-internal-format
-msgid "Invalid pass positioning operation"
+msgid "pass %qs not found but is referenced by new pass %qs"
msgstr ""
-#: plugin.c:405
+#: plugin.c:145
#, gcc-internal-format
-msgid "No pass specified when registering a new pass in plugin %s"
+msgid ""
+"Plugin %s was specified with different paths:\n"
+"%s\n"
+"%s"
+msgstr ""
+
+#: plugin.c:191
+#, gcc-internal-format
+msgid "Malformed option -fplugin-arg-%s (multiple '=' signs)"
msgstr ""
-#: plugin.c:412
+#: plugin.c:207
#, gcc-internal-format
-msgid "No reference pass specified for positioning the pass from plugin %s"
+msgid "Malformed option -fplugin-arg-%s (missing -<key>[=<value>])"
msgstr ""
-#: plugin.c:422
+#: plugin.c:269
#, gcc-internal-format
msgid ""
-"Failed to position pass %s registered by plugin %s. Cannot find the "
-"(specified instance of) reference pass %s"
+"Plugin %s should be specified before -fplugin-arg-%s in the command line"
msgstr ""
-#: plugin.c:501
+#: plugin.c:333
#, gcc-internal-format
msgid "Plugin %s registered a null callback function for event %s"
msgstr ""
-#: plugin.c:515
+#: plugin.c:347
#, gcc-internal-format
msgid "Unkown callback event registered by plugin %s"
msgstr ""
-#: plugin.c:578
+#: plugin.c:421
#, gcc-internal-format
msgid ""
"Cannot load plugin %s\n"
"%s"
msgstr ""
-#: plugin.c:591
+#: plugin.c:430
+#, gcc-internal-format
+msgid ""
+"plugin %s is not licensed under a GPL-compatible license\n"
+"%s"
+msgstr ""
+
+#: plugin.c:439
#, gcc-internal-format
msgid ""
"Cannot find %s in plugin %s\n"
"%s"
msgstr ""
-#: plugin.c:600
+#: plugin.c:447
#, gcc-internal-format
msgid "Fail to initialize plugin %s"
msgstr ""
-#: profile.c:415
+#: profile.c:414
#, gcc-internal-format
msgid "corrupted profile info: edge from %i to %i exceeds maximal count"
msgstr ""
-#: profile.c:460
+#: profile.c:458
#, gcc-internal-format
msgid "corrupted profile info: run_max * runs < sum_max"
msgstr ""
-#: profile.c:466
+#: profile.c:464
#, gcc-internal-format
msgid "corrupted profile info: sum_all is smaller than sum_max"
msgstr ""
-#: profile.c:632
+#: profile.c:630
#, gcc-internal-format
msgid "correcting inconsistent profile data"
msgstr ""
-#: profile.c:642
+#: profile.c:640
#, gcc-internal-format
msgid "corrupted profile info: profile data is not flow-consistent"
msgstr ""
-#: profile.c:660
+#: profile.c:657
#, gcc-internal-format
msgid ""
"corrupted profile info: number of iterations for basic block %d thought to "
"be %i"
msgstr ""
-#: profile.c:681
+#: profile.c:678
#, gcc-internal-format
msgid ""
"corrupted profile info: number of executions for edge %d-%d thought to be %i"
msgstr ""
-#: reg-stack.c:538
+#: reg-stack.c:537
#, gcc-internal-format
msgid "output constraint %d must specify a single register"
msgstr ""
-#: reg-stack.c:548
+#: reg-stack.c:547
#, gcc-internal-format
msgid "output constraint %d cannot be specified together with \"%s\" clobber"
msgstr ""
-#: reg-stack.c:571
+#: reg-stack.c:570
#, gcc-internal-format
msgid "output regs must be grouped at top of stack"
msgstr ""
-#: reg-stack.c:608
+#: reg-stack.c:607
#, gcc-internal-format
msgid "implicitly popped regs must be grouped at top of stack"
msgstr ""
-#: reg-stack.c:627
+#: reg-stack.c:626
#, gcc-internal-format
msgid "output operand %d must use %<&%> constraint"
msgstr ""
-#: regcprop.c:948
+#: regcprop.c:978
#, gcc-internal-format
msgid "validate_value_data: [%u] Bad next_regno for empty chain (%u)"
msgstr ""
-#: regcprop.c:960
+#: regcprop.c:990
#, gcc-internal-format
msgid "validate_value_data: Loop in regno chain (%u)"
msgstr ""
-#: regcprop.c:963
+#: regcprop.c:993
#, gcc-internal-format
msgid "validate_value_data: [%u] Bad oldest_regno (%u)"
msgstr ""
-#: regcprop.c:975
+#: regcprop.c:1005
#, gcc-internal-format
msgid "validate_value_data: [%u] Non-empty reg in chain (%s %u %i)"
msgstr ""
-#: reginfo.c:823
+#: reginfo.c:819
#, gcc-internal-format
msgid "can't use '%s' as a %s register"
msgstr ""
-#: reginfo.c:838 config/ia64/ia64.c:5186 config/ia64/ia64.c:5193
-#: config/pa/pa.c:367 config/pa/pa.c:374 config/sh/sh.c:7966
-#: config/sh/sh.c:7973 config/spu/spu.c:4624 config/spu/spu.c:4631
+#: reginfo.c:834 config/ia64/ia64.c:5399 config/ia64/ia64.c:5406
+#: config/pa/pa.c:380 config/pa/pa.c:387 config/sh/sh.c:8484
+#: config/sh/sh.c:8491 config/spu/spu.c:4717 config/spu/spu.c:4724
#, gcc-internal-format
msgid "unknown register name: %s"
msgstr ""
-#: reginfo.c:847
+#: reginfo.c:843
#, gcc-internal-format
msgid "global register variable follows a function definition"
msgstr ""
-#: reginfo.c:851
+#: reginfo.c:847
#, gcc-internal-format
msgid "register used for two global register variables"
msgstr ""
-#: reginfo.c:856
+#: reginfo.c:852
#, gcc-internal-format
msgid "call-clobbered register used for global register variable"
msgstr ""
-#: reload.c:1259
+#: reload.c:1260
#, gcc-internal-format
msgid "cannot reload integer constant operand in %<asm%>"
msgstr ""
-#: reload.c:1273
+#: reload.c:1274
#, gcc-internal-format
msgid "impossible register constraint in %<asm%>"
msgstr ""
-#: reload.c:3610
+#: reload.c:3617
#, gcc-internal-format
msgid "%<&%> constraint used with no register class"
msgstr ""
-#: reload.c:3781 reload.c:4039
+#: reload.c:3814 reload.c:4072
#, gcc-internal-format
msgid "inconsistent operand constraints in an %<asm%>"
msgstr ""
-#: reload1.c:1323
+#: reload1.c:1380
#, gcc-internal-format
msgid "%<asm%> operand has impossible constraints"
msgstr ""
-#: reload1.c:1343
+#: reload1.c:1400
#, gcc-internal-format
msgid "frame size too large for reliable stack checking"
msgstr ""
-#: reload1.c:1346
+#: reload1.c:1403
#, gcc-internal-format
msgid "try reducing the number of local variables"
msgstr ""
-#: reload1.c:2081
+#: reload1.c:2138
#, gcc-internal-format
msgid "can't find a register in class %qs while reloading %<asm%>"
msgstr ""
-#: reload1.c:2086
+#: reload1.c:2143
#, gcc-internal-format
msgid "unable to find a register to spill in class %qs"
msgstr ""
-#: reload1.c:4241
+#: reload1.c:4294
#, gcc-internal-format
msgid "%<asm%> operand requires impossible reload"
msgstr ""
-#: reload1.c:5624
+#: reload1.c:5676
#, gcc-internal-format
msgid "%<asm%> operand constraint incompatible with operand size"
msgstr ""
-#: reload1.c:7598
+#: reload1.c:7657
#, gcc-internal-format
msgid "output operand is constant in %<asm%>"
msgstr ""
-#: rtl.c:501
+#: rtl.c:613
#, gcc-internal-format
msgid "RTL check: access of elt %d of '%s' with last elt %d in %s, at %s:%d"
msgstr ""
-#: rtl.c:511
+#: rtl.c:623
#, gcc-internal-format
msgid ""
"RTL check: expected elt %d type '%c', have '%c' (rtx %s) in %s, at %s:%d"
msgstr ""
-#: rtl.c:521
+#: rtl.c:633
#, gcc-internal-format
msgid ""
"RTL check: expected elt %d type '%c' or '%c', have '%c' (rtx %s) in %s, at %"
"s:%d"
msgstr ""
-#: rtl.c:530
+#: rtl.c:642
#, gcc-internal-format
msgid "RTL check: expected code '%s', have '%s' in %s, at %s:%d"
msgstr ""
-#: rtl.c:540
+#: rtl.c:652
#, gcc-internal-format
msgid "RTL check: expected code '%s' or '%s', have '%s' in %s, at %s:%d"
msgstr ""
-#: rtl.c:567
+#: rtl.c:679
#, gcc-internal-format
msgid ""
"RTL check: attempt to treat non-block symbol as a block symbol in %s, at %s:%"
"d"
msgstr ""
-#: rtl.c:577
+#: rtl.c:689
#, gcc-internal-format
msgid "RTL check: access of elt %d of vector with last elt %d in %s, at %s:%d"
msgstr ""
-#: rtl.c:588
+#: rtl.c:700
#, gcc-internal-format
msgid "RTL flag check: %s used with unexpected rtx code '%s' in %s, at %s:%d"
msgstr ""
-#: stmt.c:311
+#: stmt.c:312
#, gcc-internal-format
msgid "output operand constraint lacks %<=%>"
msgstr ""
-#: stmt.c:326
+#: stmt.c:327
#, gcc-internal-format
msgid "output constraint %qc for operand %d is not at the beginning"
msgstr ""
-#: stmt.c:349
+#: stmt.c:350
#, gcc-internal-format
msgid "operand constraint contains incorrectly positioned %<+%> or %<=%>"
msgstr ""
-#: stmt.c:356 stmt.c:455
+#: stmt.c:357 stmt.c:456
#, gcc-internal-format
msgid "%<%%%> constraint used with last operand"
msgstr ""
-#: stmt.c:375
+#: stmt.c:376
#, gcc-internal-format
msgid "matching constraint not valid in output operand"
msgstr ""
-#: stmt.c:446
+#: stmt.c:447
#, gcc-internal-format
msgid "input operand constraint contains %qc"
msgstr ""
-#: stmt.c:488
+#: stmt.c:489
#, gcc-internal-format
msgid "matching constraint references invalid operand number"
msgstr ""
-#: stmt.c:526
+#: stmt.c:527
#, gcc-internal-format
msgid "invalid punctuation %qc in constraint"
msgstr ""
-#: stmt.c:550
+#: stmt.c:551
#, gcc-internal-format
msgid "matching constraint does not allow a register"
msgstr ""
-#: stmt.c:604
+#: stmt.c:605
#, gcc-internal-format
msgid "asm-specifier for variable %qE conflicts with asm clobber list"
msgstr ""
-#: stmt.c:694
+#: stmt.c:696
#, gcc-internal-format
msgid "unknown register name %qs in %<asm%>"
msgstr ""
-#: stmt.c:702
+#: stmt.c:704
#, gcc-internal-format
msgid "PIC register %qs clobbered in %<asm%>"
msgstr ""
-#: stmt.c:749
+#: stmt.c:751
#, gcc-internal-format
msgid "more than %d operands in %<asm%>"
msgstr ""
-#: stmt.c:812
+#: stmt.c:814
#, gcc-internal-format
msgid "output number %d not directly addressable"
msgstr ""
-#: stmt.c:895
+#: stmt.c:900
#, gcc-internal-format
msgid "asm operand %d probably doesn%'t match constraints"
msgstr ""
-#: stmt.c:905
+#: stmt.c:910
#, gcc-internal-format
msgid "use of memory input without lvalue in asm operand %d is deprecated"
msgstr ""
-#: stmt.c:1052
+#: stmt.c:1065
#, gcc-internal-format
msgid "asm clobber conflict with output operand"
msgstr ""
-#: stmt.c:1057
+#: stmt.c:1070
#, gcc-internal-format
msgid "asm clobber conflict with input operand"
msgstr ""
-#: stmt.c:1135
+#: stmt.c:1195
#, gcc-internal-format
msgid "too many alternatives in %<asm%>"
msgstr ""
-#: stmt.c:1147
+#: stmt.c:1207
#, gcc-internal-format
msgid "operand constraints for %<asm%> differ in number of alternatives"
msgstr ""
-#: stmt.c:1200
+#: stmt.c:1274
#, gcc-internal-format
msgid "duplicate asm operand name %qs"
msgstr ""
-#: stmt.c:1298
+#: stmt.c:1371
#, gcc-internal-format
msgid "missing close brace for named operand"
msgstr ""
-#: stmt.c:1326
+#: stmt.c:1396
#, gcc-internal-format
msgid "undefined named operand %qs"
msgstr ""
-#: stmt.c:1471
+#: stmt.c:1541 cp/cvt.c:916 cp/cvt.c:1032
#, gcc-internal-format
-msgid "%Hvalue computed is not used"
+msgid "value computed is not used"
msgstr ""
-#: stor-layout.c:149
+#: stor-layout.c:160
#, gcc-internal-format
msgid "type size can%'t be explicitly evaluated"
msgstr ""
-#: stor-layout.c:151
+#: stor-layout.c:162
#, gcc-internal-format
msgid "variable-size type declared outside of any function"
msgstr ""
-#: stor-layout.c:467
+#: stor-layout.c:680
#, gcc-internal-format
msgid "size of %q+D is %d bytes"
msgstr ""
-#: stor-layout.c:469
+#: stor-layout.c:682
#, gcc-internal-format
msgid "size of %q+D is larger than %wd bytes"
msgstr ""
-#: stor-layout.c:888
+#: stor-layout.c:1101
#, gcc-internal-format
msgid "packed attribute causes inefficient alignment for %q+D"
msgstr ""
-#: stor-layout.c:891
+#: stor-layout.c:1104
#, gcc-internal-format
msgid "packed attribute is unnecessary for %q+D"
msgstr ""
-#. No, we need to skip space before this field.
-#. Bump the cumulative size to multiple of field alignment.
-#: stor-layout.c:908
+#: stor-layout.c:1122
#, gcc-internal-format
msgid "padding struct to align %q+D"
msgstr ""
-#: stor-layout.c:969
+#: stor-layout.c:1183
#, gcc-internal-format
msgid "Offset of packed bit-field %qD has changed in GCC 4.4"
msgstr ""
-#: stor-layout.c:1273
+#: stor-layout.c:1489
#, gcc-internal-format
msgid "padding struct size to alignment boundary"
msgstr ""
-#: stor-layout.c:1303
+#: stor-layout.c:1519
#, gcc-internal-format
msgid "packed attribute causes inefficient alignment for %qE"
msgstr ""
-#: stor-layout.c:1307
+#: stor-layout.c:1523
#, gcc-internal-format
msgid "packed attribute is unnecessary for %qE"
msgstr ""
-#: stor-layout.c:1313
+#: stor-layout.c:1529
#, gcc-internal-format
msgid "packed attribute causes inefficient alignment"
msgstr ""
-#: stor-layout.c:1315
+#: stor-layout.c:1531
#, gcc-internal-format
msgid "packed attribute is unnecessary"
msgstr ""
-#: stor-layout.c:1848
+#: stor-layout.c:2044
#, gcc-internal-format
msgid "alignment of array elements is greater than element size"
msgstr ""
-#: targhooks.c:124
+#: targhooks.c:163
#, gcc-internal-format
msgid "__builtin_saveregs not supported by this target"
msgstr ""
-#: targhooks.c:742
+#: targhooks.c:658
+#, gcc-internal-format
+msgid "nested functions not supported on this target"
+msgstr ""
+
+#: targhooks.c:671
+#, gcc-internal-format
+msgid "nested function trampolines not supported on this target"
+msgstr ""
+
+#: targhooks.c:847
#, gcc-internal-format
msgid "target attribute is not supported on this machine"
msgstr ""
-#: targhooks.c:752
+#: targhooks.c:857
#, gcc-internal-format
msgid "#pragma GCC target is not supported for this machine"
msgstr ""
@@ -24710,797 +25581,848 @@ msgstr ""
msgid "ld returned %d exit status"
msgstr ""
-#: toplev.c:528
+#: toplev.c:551
#, gcc-internal-format
msgid "invalid option argument %qs"
msgstr ""
-#: toplev.c:626
+#: toplev.c:641
#, gcc-internal-format
msgid "getting core file size maximum limit: %m"
msgstr ""
-#: toplev.c:629
+#: toplev.c:644
#, gcc-internal-format
msgid "setting core file size limit to maximum: %m"
msgstr ""
-#: toplev.c:849
+#: toplev.c:864
#, gcc-internal-format
msgid "%q+F declared %<static%> but never defined"
msgstr ""
-#: toplev.c:877
+#: toplev.c:892
#, gcc-internal-format
msgid "%q+D defined but not used"
msgstr ""
-#: toplev.c:944
+#: toplev.c:959
#, gcc-internal-format
msgid "%qD is deprecated (declared at %s:%d): %s"
msgstr ""
-#: toplev.c:948
+#: toplev.c:963
#, gcc-internal-format
msgid "%qD is deprecated (declared at %s:%d)"
msgstr ""
-#: toplev.c:973
+#: toplev.c:988
#, gcc-internal-format
msgid "%qE is deprecated (declared at %s:%d): %s"
msgstr ""
-#: toplev.c:977
+#: toplev.c:992
#, gcc-internal-format
msgid "%qE is deprecated (declared at %s:%d)"
msgstr ""
-#: toplev.c:984
+#: toplev.c:999
#, gcc-internal-format
msgid "type is deprecated (declared at %s:%d): %s"
msgstr ""
-#: toplev.c:988
+#: toplev.c:1003
#, gcc-internal-format
msgid "type is deprecated (declared at %s:%d)"
msgstr ""
-#: toplev.c:997
+#: toplev.c:1012
#, gcc-internal-format
msgid "%qE is deprecated: %s"
msgstr ""
-#: toplev.c:1000
+#: toplev.c:1015
#, gcc-internal-format
msgid "%qE is deprecated"
msgstr ""
-#: toplev.c:1005
+#: toplev.c:1020
#, gcc-internal-format
msgid "type is deprecated: %s"
msgstr ""
-#: toplev.c:1008
+#: toplev.c:1023
#, gcc-internal-format
msgid "type is deprecated"
msgstr ""
-#: toplev.c:1148
+#: toplev.c:1176
#, gcc-internal-format
msgid "unrecognized gcc debugging option: %c"
msgstr ""
-#: toplev.c:1407
+#: toplev.c:1451
#, gcc-internal-format
msgid "can%'t open %s for writing: %m"
msgstr ""
-#: toplev.c:1428
+#: toplev.c:1472
#, gcc-internal-format
msgid "-frecord-gcc-switches is not supported by the current target"
msgstr ""
-#: toplev.c:1765
+#: toplev.c:1809
#, gcc-internal-format
msgid "this target does not support %qs"
msgstr ""
-#: toplev.c:1820
+#: toplev.c:1865
#, gcc-internal-format
msgid "instruction scheduling not supported on this target machine"
msgstr ""
-#: toplev.c:1824
+#: toplev.c:1869
#, gcc-internal-format
msgid "this target machine does not have delayed branches"
msgstr ""
-#: toplev.c:1838
+#: toplev.c:1883
#, gcc-internal-format
msgid "-f%sleading-underscore not supported on this target machine"
msgstr ""
-#: toplev.c:1911
+#: toplev.c:1926
+#, gcc-internal-format
+msgid "could not close zeroed insn dump file %qs: %s"
+msgstr ""
+
+#: toplev.c:1991
#, gcc-internal-format
msgid "target system does not support the \"%s\" debug format"
msgstr ""
-#: toplev.c:1924
+#: toplev.c:2004
#, gcc-internal-format
msgid "variable tracking requested, but useless unless producing debug info"
msgstr ""
-#: toplev.c:1927
+#: toplev.c:2007
#, gcc-internal-format
msgid "variable tracking requested, but not supported by this debug format"
msgstr ""
-#: toplev.c:1961
+#: toplev.c:2035
+#, gcc-internal-format
+msgid "var-tracking-assignments changes selective scheduling"
+msgstr ""
+
+#: toplev.c:2055
#, gcc-internal-format
msgid "can%'t open %s: %m"
msgstr ""
-#: toplev.c:1968
+#: toplev.c:2062
#, gcc-internal-format
msgid "-ffunction-sections not supported for this target"
msgstr ""
-#: toplev.c:1973
+#: toplev.c:2067
#, gcc-internal-format
msgid "-fdata-sections not supported for this target"
msgstr ""
-#: toplev.c:1980
+#: toplev.c:2074
#, gcc-internal-format
msgid "-ffunction-sections disabled; it makes profiling impossible"
msgstr ""
-#: toplev.c:1987
+#: toplev.c:2081
#, gcc-internal-format
msgid "-fprefetch-loop-arrays not supported for this target"
msgstr ""
-#: toplev.c:1993
+#: toplev.c:2087
#, gcc-internal-format
msgid ""
"-fprefetch-loop-arrays not supported for this target (try -march switches)"
msgstr ""
-#: toplev.c:2002
+#: toplev.c:2096
#, gcc-internal-format
msgid "-fprefetch-loop-arrays is not supported with -Os"
msgstr ""
-#: toplev.c:2013
+#: toplev.c:2107
#, gcc-internal-format
msgid "-fassociative-math disabled; other options take precedence"
msgstr ""
-#: toplev.c:2029
+#: toplev.c:2123
#, gcc-internal-format
msgid "-fstack-protector not supported for this target"
msgstr ""
-#: toplev.c:2042
+#: toplev.c:2136
#, gcc-internal-format
msgid "unwind tables currently require a frame pointer for correctness"
msgstr ""
-#: toplev.c:2269
+#: toplev.c:2363
#, gcc-internal-format
msgid "error writing to %s: %m"
msgstr ""
-#: toplev.c:2271 java/jcf-parse.c:1769
+#: toplev.c:2365 java/jcf-parse.c:1770
#, gcc-internal-format
msgid "error closing %s: %m"
msgstr ""
-#: tree-cfg.c:1535 tree-cfg.c:2214
+#: tree-cfg.c:1849
#, gcc-internal-format
-msgid "%Hwill never be executed"
+msgid "will never be executed"
msgstr ""
-#: tree-cfg.c:2848
+#: tree-cfg.c:2535
#, gcc-internal-format
msgid "SSA name in freelist but still referenced"
msgstr ""
-#: tree-cfg.c:2857
+#: tree-cfg.c:2544
#, gcc-internal-format
msgid "Indirect reference's operand is not a register or a constant."
msgstr ""
-#: tree-cfg.c:2866
+#: tree-cfg.c:2553
#, gcc-internal-format
msgid "ASSERT_EXPR with an always-false condition"
msgstr ""
-#: tree-cfg.c:2872
+#: tree-cfg.c:2559
#, gcc-internal-format
msgid "MODIFY_EXPR not expected while having tuples."
msgstr ""
-#: tree-cfg.c:2893
+#: tree-cfg.c:2580
#, gcc-internal-format
msgid "constant not recomputed when ADDR_EXPR changed"
msgstr ""
-#: tree-cfg.c:2898
+#: tree-cfg.c:2585
#, gcc-internal-format
msgid "side effects not recomputed when ADDR_EXPR changed"
msgstr ""
-#: tree-cfg.c:2916 tree-ssa.c:497
+#: tree-cfg.c:2603 tree-ssa.c:816
#, gcc-internal-format
msgid "address taken, but ADDRESSABLE bit not set"
msgstr ""
-#: tree-cfg.c:2921
+#: tree-cfg.c:2608
#, gcc-internal-format
msgid "DECL_GIMPLE_REG_P set on a variable with address taken"
msgstr ""
-#: tree-cfg.c:2932
+#: tree-cfg.c:2619
#, gcc-internal-format
msgid "non-integral used in condition"
msgstr ""
-#: tree-cfg.c:2937
+#: tree-cfg.c:2624
#, gcc-internal-format
msgid "invalid conditional operand"
msgstr ""
-#: tree-cfg.c:2984
+#: tree-cfg.c:2671
#, gcc-internal-format
msgid "invalid position or size operand to BIT_FIELD_REF"
msgstr ""
-#: tree-cfg.c:2991
+#: tree-cfg.c:2678
#, gcc-internal-format
msgid ""
"integral result type precision does not match field size of BIT_FIELD_REF"
msgstr ""
-#: tree-cfg.c:2999
+#: tree-cfg.c:2686
#, gcc-internal-format
msgid ""
"mode precision of non-integral result does not match field size of "
"BIT_FIELD_REF"
msgstr ""
-#: tree-cfg.c:3010
+#: tree-cfg.c:2697
#, gcc-internal-format
msgid "invalid reference prefix"
msgstr ""
-#: tree-cfg.c:3021
+#: tree-cfg.c:2708
#, gcc-internal-format
msgid "invalid operand to plus/minus, type is a pointer"
msgstr ""
-#: tree-cfg.c:3032
+#: tree-cfg.c:2719
#, gcc-internal-format
msgid "invalid operand to pointer plus, first operand is not a pointer"
msgstr ""
-#: tree-cfg.c:3040
+#: tree-cfg.c:2727
#, gcc-internal-format
msgid ""
"invalid operand to pointer plus, second operand is not an integer with type "
"of sizetype."
msgstr ""
-#: tree-cfg.c:3111
+#: tree-cfg.c:2798
#, gcc-internal-format
msgid "invalid expression for min lvalue"
msgstr ""
-#: tree-cfg.c:3122
+#: tree-cfg.c:2809
#, gcc-internal-format
msgid "invalid operand in indirect reference"
msgstr ""
-#: tree-cfg.c:3129
+#: tree-cfg.c:2816
#, gcc-internal-format
msgid "type mismatch in indirect reference"
msgstr ""
-#: tree-cfg.c:3158
+#: tree-cfg.c:2845
#, gcc-internal-format
msgid "invalid operands to array reference"
msgstr ""
-#: tree-cfg.c:3169
+#: tree-cfg.c:2856
#, gcc-internal-format
msgid "type mismatch in array reference"
msgstr ""
-#: tree-cfg.c:3178
+#: tree-cfg.c:2865
#, gcc-internal-format
msgid "type mismatch in array range reference"
msgstr ""
-#: tree-cfg.c:3189
+#: tree-cfg.c:2876
#, gcc-internal-format
msgid "type mismatch in real/imagpart reference"
msgstr ""
-#: tree-cfg.c:3199
+#: tree-cfg.c:2886
#, gcc-internal-format
msgid "type mismatch in component reference"
msgstr ""
-#: tree-cfg.c:3262
+#: tree-cfg.c:2949
#, gcc-internal-format
msgid "non-function in gimple call"
msgstr ""
-#: tree-cfg.c:3269
+#: tree-cfg.c:2956
#, gcc-internal-format
msgid "invalid LHS in gimple call"
msgstr ""
-#: tree-cfg.c:3285
+#: tree-cfg.c:2972
#, gcc-internal-format
msgid "invalid conversion in gimple call"
msgstr ""
-#: tree-cfg.c:3310
+#: tree-cfg.c:2985
+#, gcc-internal-format
+msgid "static chain in indirect gimple call"
+msgstr ""
+
+#: tree-cfg.c:2992
+#, gcc-internal-format
+msgid "static chain with function that doesn't use one"
+msgstr ""
+
+#: tree-cfg.c:3016
#, gcc-internal-format
msgid "invalid operands in gimple comparison"
msgstr ""
-#: tree-cfg.c:3328
+#: tree-cfg.c:3034
#, gcc-internal-format
msgid "type mismatch in comparison expression"
msgstr ""
-#: tree-cfg.c:3354
+#: tree-cfg.c:3060
#, gcc-internal-format
msgid "non-register as LHS of unary operation"
msgstr ""
-#: tree-cfg.c:3360
+#: tree-cfg.c:3066
#, gcc-internal-format
msgid "invalid operand in unary operation"
msgstr ""
-#: tree-cfg.c:3395
+#: tree-cfg.c:3101
#, gcc-internal-format
msgid "invalid types in nop conversion"
msgstr ""
-#: tree-cfg.c:3409
+#: tree-cfg.c:3115
#, gcc-internal-format
msgid "invalid types in fixed-point conversion"
msgstr ""
-#: tree-cfg.c:3422
+#: tree-cfg.c:3128
#, gcc-internal-format
msgid "invalid types in conversion to floating point"
msgstr ""
-#: tree-cfg.c:3435
+#: tree-cfg.c:3141
#, gcc-internal-format
msgid "invalid types in conversion to integer"
msgstr ""
-#: tree-cfg.c:3470
+#: tree-cfg.c:3176
#, gcc-internal-format
msgid "non-trivial conversion in unary operation"
msgstr ""
-#: tree-cfg.c:3497
+#: tree-cfg.c:3203
#, gcc-internal-format
msgid "non-register as LHS of binary operation"
msgstr ""
-#: tree-cfg.c:3504
+#: tree-cfg.c:3210
#, gcc-internal-format
msgid "invalid operands in binary operation"
msgstr ""
-#: tree-cfg.c:3519
+#: tree-cfg.c:3225
#, gcc-internal-format
msgid "type mismatch in complex expression"
msgstr ""
-#: tree-cfg.c:3548
+#: tree-cfg.c:3254
#, gcc-internal-format
msgid "type mismatch in shift expression"
msgstr ""
-#: tree-cfg.c:3570
+#: tree-cfg.c:3276
#, gcc-internal-format
msgid "type mismatch in vector shift expression"
msgstr ""
-#: tree-cfg.c:3583
+#: tree-cfg.c:3289
#, gcc-internal-format
msgid "non-element sized vector shift of floating point vector"
msgstr ""
-#: tree-cfg.c:3601
+#: tree-cfg.c:3307
#, gcc-internal-format
msgid "invalid non-vector operands to vector valued plus"
msgstr ""
-#: tree-cfg.c:3625
+#: tree-cfg.c:3331
#, gcc-internal-format
msgid "invalid (pointer) operands to plus/minus"
msgstr ""
-#: tree-cfg.c:3640
+#: tree-cfg.c:3346
#, gcc-internal-format
msgid "type mismatch in pointer plus expression"
msgstr ""
-#: tree-cfg.c:3663
+#: tree-cfg.c:3369
#, gcc-internal-format
msgid "type mismatch in binary truth expression"
msgstr ""
-#: tree-cfg.c:3731
+#: tree-cfg.c:3437
#, gcc-internal-format
msgid "type mismatch in binary expression"
msgstr ""
-#: tree-cfg.c:3756
+#: tree-cfg.c:3462
#, gcc-internal-format
msgid "non-trivial conversion at assignment"
msgstr ""
-#: tree-cfg.c:3773
+#: tree-cfg.c:3479
#, gcc-internal-format
msgid "invalid operand in unary expression"
msgstr ""
-#: tree-cfg.c:3780
+#: tree-cfg.c:3487
#, gcc-internal-format
msgid "type mismatch in address expression"
msgstr ""
-#: tree-cfg.c:3804 tree-cfg.c:3830
+#: tree-cfg.c:3511 tree-cfg.c:3537
#, gcc-internal-format
msgid "invalid rhs for gimple memory store"
msgstr ""
-#: tree-cfg.c:3896
+#: tree-cfg.c:3601
#, gcc-internal-format
msgid "invalid operand in return statement"
msgstr ""
-#: tree-cfg.c:3908
+#: tree-cfg.c:3613
#, gcc-internal-format
msgid "invalid conversion in return statement"
msgstr ""
-#: tree-cfg.c:3932
+#: tree-cfg.c:3637
#, gcc-internal-format
msgid "goto destination is neither a label nor a pointer"
msgstr ""
-#: tree-cfg.c:3947
+#: tree-cfg.c:3652
#, gcc-internal-format
msgid "invalid operand to switch statement"
msgstr ""
-#: tree-cfg.c:3967
+#: tree-cfg.c:3672
#, gcc-internal-format
msgid "Invalid PHI result"
msgstr ""
-#: tree-cfg.c:3979
+#: tree-cfg.c:3684
#, gcc-internal-format
msgid "Invalid PHI argument"
msgstr ""
-#: tree-cfg.c:3985
+#: tree-cfg.c:3690
#, gcc-internal-format
msgid "Incompatible types in PHI argument %u"
msgstr ""
-#: tree-cfg.c:4110
+#: tree-cfg.c:3830
#, gcc-internal-format
msgid "verify_gimple failed"
msgstr ""
-#: tree-cfg.c:4144
+#: tree-cfg.c:3865
#, gcc-internal-format
msgid "invalid function in call statement"
msgstr ""
-#: tree-cfg.c:4155
+#: tree-cfg.c:3876
#, gcc-internal-format
msgid "invalid pure const state for function"
msgstr ""
-#: tree-cfg.c:4165 tree-ssa.c:669 tree-ssa.c:678
+#: tree-cfg.c:3889 tree-ssa.c:991 tree-ssa.c:1000
#, gcc-internal-format
msgid "in statement"
msgstr ""
-#: tree-cfg.c:4182
+#: tree-cfg.c:3909
#, gcc-internal-format
msgid "statement marked for throw, but doesn%'t"
msgstr ""
-#: tree-cfg.c:4187
+#: tree-cfg.c:3915
#, gcc-internal-format
msgid "statement marked for throw in middle of block"
msgstr ""
-#: tree-cfg.c:4259
+#: tree-cfg.c:3987
#, gcc-internal-format
msgid "Dead STMT in EH table"
msgstr ""
-#: tree-cfg.c:4297
+#: tree-cfg.c:4025
#, gcc-internal-format
msgid "gimple_bb (phi) is set to a wrong basic block"
msgstr ""
-#: tree-cfg.c:4308
+#: tree-cfg.c:4036
#, gcc-internal-format
msgid "missing PHI def"
msgstr ""
-#: tree-cfg.c:4319
+#: tree-cfg.c:4047
#, gcc-internal-format
msgid "PHI argument is not a GIMPLE value"
msgstr ""
-#: tree-cfg.c:4328 tree-cfg.c:4389
+#: tree-cfg.c:4056 tree-cfg.c:4129
#, gcc-internal-format
msgid "incorrect sharing of tree nodes"
msgstr ""
-#: tree-cfg.c:4351
+#: tree-cfg.c:4079
#, gcc-internal-format
msgid "invalid GIMPLE statement"
msgstr ""
-#: tree-cfg.c:4360
+#: tree-cfg.c:4088
#, gcc-internal-format
msgid "gimple_bb (stmt) is set to a wrong basic block"
msgstr ""
-#: tree-cfg.c:4372
+#: tree-cfg.c:4101
+#, gcc-internal-format
+msgid "incorrect entry in label_to_block_map"
+msgstr ""
+
+#: tree-cfg.c:4111
#, gcc-internal-format
-msgid "incorrect entry in label_to_block_map.\n"
+msgid "incorrect setting of landing pad number"
msgstr ""
-#: tree-cfg.c:4405
+#: tree-cfg.c:4145
#, gcc-internal-format
msgid "verify_stmts failed"
msgstr ""
-#: tree-cfg.c:4428
+#: tree-cfg.c:4168
#, gcc-internal-format
msgid "ENTRY_BLOCK has IL associated with it"
msgstr ""
-#: tree-cfg.c:4434
+#: tree-cfg.c:4174
#, gcc-internal-format
msgid "EXIT_BLOCK has IL associated with it"
msgstr ""
-#: tree-cfg.c:4441
+#: tree-cfg.c:4181
#, gcc-internal-format
msgid "fallthru to exit from bb %d"
msgstr ""
-#: tree-cfg.c:4465
+#: tree-cfg.c:4205
#, gcc-internal-format
msgid "nonlocal label "
msgstr ""
-#: tree-cfg.c:4474 tree-cfg.c:4483 tree-cfg.c:4508
+#: tree-cfg.c:4214 tree-cfg.c:4223 tree-cfg.c:4248
#, gcc-internal-format
msgid "label "
msgstr ""
-#: tree-cfg.c:4498
+#: tree-cfg.c:4238
#, gcc-internal-format
msgid "control flow in the middle of basic block %d"
msgstr ""
-#: tree-cfg.c:4528
+#: tree-cfg.c:4271
#, gcc-internal-format
msgid "fallthru edge after a control statement in bb %d"
msgstr ""
-#: tree-cfg.c:4541
+#: tree-cfg.c:4284
#, gcc-internal-format
msgid "true/false edge after a non-GIMPLE_COND in bb %d"
msgstr ""
-#: tree-cfg.c:4564 tree-cfg.c:4586 tree-cfg.c:4599 tree-cfg.c:4668
+#: tree-cfg.c:4307 tree-cfg.c:4329 tree-cfg.c:4342 tree-cfg.c:4411
#, gcc-internal-format
msgid "wrong outgoing edge flags at end of bb %d"
msgstr ""
-#: tree-cfg.c:4574
+#: tree-cfg.c:4317
#, gcc-internal-format
msgid "explicit goto at end of bb %d"
msgstr ""
-#: tree-cfg.c:4604
+#: tree-cfg.c:4347
#, gcc-internal-format
msgid "return edge does not point to exit in bb %d"
msgstr ""
-#: tree-cfg.c:4634
+#: tree-cfg.c:4377
#, gcc-internal-format
msgid "found default case not at the start of case vector"
msgstr ""
-#: tree-cfg.c:4642
+#: tree-cfg.c:4385
#, gcc-internal-format
msgid "case labels not sorted: "
msgstr ""
-#: tree-cfg.c:4659
+#: tree-cfg.c:4402
#, gcc-internal-format
msgid "extra outgoing edge %d->%d"
msgstr ""
-#: tree-cfg.c:4682
+#: tree-cfg.c:4425
#, gcc-internal-format
msgid "missing edge %i->%i"
msgstr ""
-#: tree-cfg.c:7156
+#: tree-cfg.c:7006
#, gcc-internal-format
-msgid "%H%<noreturn%> function does return"
+msgid "%<noreturn%> function does return"
msgstr ""
-#: tree-cfg.c:7176
+#: tree-cfg.c:7026
#, gcc-internal-format
msgid "control reaches end of non-void function"
msgstr ""
-#: tree-cfg.c:7238
+#: tree-cfg.c:7089
+#, gcc-internal-format
+msgid "function might be possible candidate for attribute %<noreturn%>"
+msgstr ""
+
+#: tree-cfg.c:7160
#, gcc-internal-format
-msgid "%Jfunction might be possible candidate for attribute %<noreturn%>"
+msgid ""
+"ignoring return value of %qD, declared with attribute warn_unused_result"
msgstr ""
-#: tree-dump.c:923
+#: tree-cfg.c:7165
+#, gcc-internal-format
+msgid ""
+"ignoring return value of function declared with attribute warn_unused_result"
+msgstr ""
+
+#: tree-dump.c:929
#, gcc-internal-format
msgid "could not open dump file %qs: %s"
msgstr ""
-#: tree-dump.c:1056
+#: tree-dump.c:1062
#, gcc-internal-format
msgid "ignoring unknown option %q.*s in %<-fdump-%s%>"
msgstr ""
-#: tree-eh.c:2080
+#: tree-eh.c:3882
#, gcc-internal-format
-msgid "EH edge %i->%i is missing"
+msgid "BB %i has multiple EH edges"
msgstr ""
-#: tree-eh.c:2085
+#: tree-eh.c:3894
#, gcc-internal-format
-msgid "EH edge %i->%i miss EH flag"
+msgid "BB %i can not throw but has an EH edge"
msgstr ""
-#. ??? might not be mistake.
-#: tree-eh.c:2091
+#: tree-eh.c:3902
#, gcc-internal-format
-msgid "EH edge %i->%i has duplicated regions"
+msgid "BB %i last statement has incorrectly set lp"
msgstr ""
-#: tree-eh.c:2127
+#: tree-eh.c:3908
#, gcc-internal-format
-msgid "BB %i can not throw but has EH edges"
+msgid "BB %i is missing an EH edge"
msgstr ""
-#: tree-eh.c:2134
+#: tree-eh.c:3914
#, gcc-internal-format
-msgid "BB %i last statement has incorrectly set region"
+msgid "Incorrect EH edge %i->%i"
msgstr ""
-#: tree-eh.c:2146
+#: tree-eh.c:3948 tree-eh.c:3967
#, gcc-internal-format
-msgid "unnecessary EH edge %i->%i"
+msgid "BB %i is missing an edge"
msgstr ""
-#: tree-inline.c:2474
+#: tree-eh.c:3984
+#, gcc-internal-format
+msgid "BB %i too many fallthru edges"
+msgstr ""
+
+#: tree-eh.c:3993
+#, gcc-internal-format
+msgid "BB %i has incorrect edge"
+msgstr ""
+
+#: tree-eh.c:3999
+#, gcc-internal-format
+msgid "BB %i has incorrect fallthru edge"
+msgstr ""
+
+#: tree-inline.c:2774
+#, gcc-internal-format
+msgid "function %q+F can never be copied because it receives a non-local goto"
+msgstr ""
+
+#: tree-inline.c:2791
+#, gcc-internal-format
+msgid ""
+"function %q+F can never be copied because it saves address of local label in "
+"a static variable"
+msgstr ""
+
+#: tree-inline.c:2801
#, gcc-internal-format
msgid ""
-"function %q+F can never be inlined because it uses variable sized variables"
+"function %q+F can never be copied because it uses variable sized variables"
msgstr ""
-#: tree-inline.c:2508
+#: tree-inline.c:2839
#, gcc-internal-format
msgid ""
"function %q+F can never be inlined because it uses alloca (override using "
"the always_inline attribute)"
msgstr ""
-#: tree-inline.c:2522
+#: tree-inline.c:2853
#, gcc-internal-format
msgid "function %q+F can never be inlined because it uses setjmp"
msgstr ""
-#: tree-inline.c:2536
+#: tree-inline.c:2867
#, gcc-internal-format
msgid ""
"function %q+F can never be inlined because it uses variable argument lists"
msgstr ""
-#: tree-inline.c:2548
+#: tree-inline.c:2879
#, gcc-internal-format
msgid ""
"function %q+F can never be inlined because it uses setjmp-longjmp exception "
"handling"
msgstr ""
-#: tree-inline.c:2556
+#: tree-inline.c:2887
#, gcc-internal-format
msgid "function %q+F can never be inlined because it uses non-local goto"
msgstr ""
-#: tree-inline.c:2568
+#: tree-inline.c:2899
#, gcc-internal-format
msgid ""
"function %q+F can never be inlined because it uses __builtin_return or "
"__builtin_apply_args"
msgstr ""
-#: tree-inline.c:2588
+#: tree-inline.c:2919
#, gcc-internal-format
msgid "function %q+F can never be inlined because it contains a computed goto"
msgstr ""
-#: tree-inline.c:2603
-#, gcc-internal-format
-msgid "function %q+F can never be inlined because it receives a non-local goto"
-msgstr ""
-
-#: tree-inline.c:2629
-#, gcc-internal-format
-msgid ""
-"function %q+F can never be inlined because it saves address of local label "
-"in a static variable"
-msgstr ""
-
-#: tree-inline.c:2720
+#: tree-inline.c:2999
#, gcc-internal-format
msgid ""
"function %q+F can never be inlined because it is suppressed using -fno-inline"
msgstr ""
-#: tree-inline.c:2734
+#: tree-inline.c:3013
#, gcc-internal-format
msgid ""
"function %q+F can never be inlined because it uses attributes conflicting "
"with inlining"
msgstr ""
-#: tree-inline.c:3259 tree-inline.c:3270
+#: tree-inline.c:3577 tree-inline.c:3588
#, gcc-internal-format
msgid "inlining failed in call to %q+F: %s"
msgstr ""
-#: tree-inline.c:3261 tree-inline.c:3272
+#: tree-inline.c:3579 tree-inline.c:3590
#, gcc-internal-format
msgid "called from here"
msgstr ""
-#: tree-mudflap.c:873
+#: tree-mudflap.c:907
#, gcc-internal-format
msgid "mudflap checking not yet implemented for ARRAY_RANGE_REF"
msgstr ""
-#: tree-mudflap.c:1064
+#: tree-mudflap.c:1114
#, gcc-internal-format
msgid "mudflap cannot track %qE in stub function"
msgstr ""
-#: tree-mudflap.c:1308
+#: tree-mudflap.c:1358
#, gcc-internal-format
msgid "mudflap cannot track unknown size extern %qE"
msgstr ""
@@ -25510,18 +26432,18 @@ msgstr ""
msgid "mudflap: this language is not supported"
msgstr ""
-#: tree-optimize.c:419
+#: tree-optimize.c:417
#, gcc-internal-format
msgid "size of return value of %q+D is %u bytes"
msgstr ""
-#: tree-optimize.c:422
+#: tree-optimize.c:420
#, gcc-internal-format
msgid "size of return value of %q+D is larger than %wd bytes"
msgstr ""
-#: tree-outof-ssa.c:693 tree-outof-ssa.c:750 tree-ssa-coalesce.c:956
-#: tree-ssa-coalesce.c:971 tree-ssa-coalesce.c:1190 tree-ssa-live.c:1130
+#: tree-outof-ssa.c:756 tree-outof-ssa.c:813 tree-ssa-coalesce.c:958
+#: tree-ssa-coalesce.c:973 tree-ssa-coalesce.c:1195 tree-ssa-live.c:1194
#, gcc-internal-format
msgid "SSA corruption"
msgstr ""
@@ -25531,310 +26453,314 @@ msgstr ""
msgid "unimplemented functionality"
msgstr ""
-#: tree-ssa-structalias.c:4708
+#: tree-ssa-loop.c:315
#, gcc-internal-format
-msgid "initialized from %qE"
+msgid "loop blocking not implemented"
msgstr ""
-#: tree-ssa-structalias.c:4712
-#, gcc-internal-format
-msgid "initialized from here"
-msgstr ""
-
-#: tree-ssa-structalias.c:4761
-#, gcc-internal-format
-msgid "dereferencing pointer %qD does break strict-aliasing rules"
-msgstr ""
-
-#: tree-ssa.c:252
+#: tree-ssa.c:571
#, gcc-internal-format
msgid "expected an SSA_NAME object"
msgstr ""
-#: tree-ssa.c:258
+#: tree-ssa.c:577
#, gcc-internal-format
msgid "type mismatch between an SSA_NAME and its symbol"
msgstr ""
-#: tree-ssa.c:264
+#: tree-ssa.c:583
#, gcc-internal-format
msgid "found an SSA_NAME that had been released into the free pool"
msgstr ""
-#: tree-ssa.c:270
+#: tree-ssa.c:589
#, gcc-internal-format
msgid "found a virtual definition for a GIMPLE register"
msgstr ""
-#: tree-ssa.c:276
+#: tree-ssa.c:595
#, gcc-internal-format
msgid "virtual SSA name for non-VOP decl"
msgstr ""
-#: tree-ssa.c:282
+#: tree-ssa.c:601
#, gcc-internal-format
msgid "found a real definition for a non-register"
msgstr ""
-#: tree-ssa.c:289
+#: tree-ssa.c:608
#, gcc-internal-format
msgid "found a default name with a non-empty defining statement"
msgstr ""
-#: tree-ssa.c:317
+#: tree-ssa.c:636
#, gcc-internal-format
msgid "SSA_NAME created in two different blocks %i and %i"
msgstr ""
-#: tree-ssa.c:326 tree-ssa.c:696
+#: tree-ssa.c:645 tree-ssa.c:1018
#, gcc-internal-format
msgid "SSA_NAME_DEF_STMT is wrong"
msgstr ""
-#: tree-ssa.c:378
+#: tree-ssa.c:697
#, gcc-internal-format
msgid "missing definition"
msgstr ""
-#: tree-ssa.c:384
+#: tree-ssa.c:703
#, gcc-internal-format
msgid "definition in block %i does not dominate use in block %i"
msgstr ""
-#: tree-ssa.c:392
+#: tree-ssa.c:711
#, gcc-internal-format
msgid "definition in block %i follows the use"
msgstr ""
-#: tree-ssa.c:399
+#: tree-ssa.c:718
#, gcc-internal-format
msgid "SSA_NAME_OCCURS_IN_ABNORMAL_PHI should be set"
msgstr ""
-#: tree-ssa.c:407
+#: tree-ssa.c:726
#, gcc-internal-format
msgid "no immediate_use list"
msgstr ""
-#: tree-ssa.c:419
+#: tree-ssa.c:738
#, gcc-internal-format
msgid "wrong immediate use list"
msgstr ""
-#: tree-ssa.c:453
+#: tree-ssa.c:772
#, gcc-internal-format
msgid "incoming edge count does not match number of PHI arguments"
msgstr ""
-#: tree-ssa.c:467
+#: tree-ssa.c:786
#, gcc-internal-format
msgid "PHI argument is missing for edge %d->%d"
msgstr ""
-#: tree-ssa.c:476
+#: tree-ssa.c:795
#, gcc-internal-format
msgid "PHI argument is not SSA_NAME, or invariant"
msgstr ""
-#: tree-ssa.c:504
+#: tree-ssa.c:823
#, gcc-internal-format
msgid "wrong edge %d->%d for PHI argument"
msgstr ""
-#: tree-ssa.c:585
+#: tree-ssa.c:904
#, gcc-internal-format
msgid "AUX pointer initialized for edge %d->%d"
msgstr ""
-#: tree-ssa.c:611
+#: tree-ssa.c:930
#, gcc-internal-format
msgid "stmt (%p) marked modified after optimization pass: "
msgstr ""
-#: tree-ssa.c:630
+#: tree-ssa.c:949
#, gcc-internal-format
msgid "statement makes a memory store, but has no VDEFS"
msgstr ""
-#: tree-ssa.c:642
+#: tree-ssa.c:964
#, gcc-internal-format
msgid "statement has VDEF operand not in defs list"
msgstr ""
-#: tree-ssa.c:647
+#: tree-ssa.c:969
#, gcc-internal-format
msgid "statement has VDEF but no VUSE operand"
msgstr ""
-#: tree-ssa.c:653
+#: tree-ssa.c:975
#, gcc-internal-format
msgid "VDEF and VUSE do not use the same symbol"
msgstr ""
-#: tree-ssa.c:662
+#: tree-ssa.c:984
#, gcc-internal-format
msgid "statement has VUSE operand not in uses list"
msgstr ""
-#: tree-ssa.c:725
+#: tree-ssa.c:1047
#, gcc-internal-format
msgid "verify_ssa failed"
msgstr ""
-#: tree-ssa.c:1271
+#: tree-ssa.c:1665
#, gcc-internal-format
-msgid "%J%qD was declared here"
+msgid "%qD was declared here"
msgstr ""
-#: tree-ssa.c:1338
+#: tree-ssa.c:1737
#, gcc-internal-format
msgid "%qD is used uninitialized in this function"
msgstr ""
-#: tree-ssa.c:1341 tree-ssa.c:1380
+#: tree-ssa.c:1740 tree-ssa.c:1779
#, gcc-internal-format
msgid "%qD may be used uninitialized in this function"
msgstr ""
-#: tree-vrp.c:5033
+#: tree-vrp.c:5017
#, gcc-internal-format
msgid "array subscript is outside array bounds"
msgstr ""
-#: tree-vrp.c:5048
+#: tree-vrp.c:5032
#, gcc-internal-format
msgid "array subscript is above array bounds"
msgstr ""
-#: tree-vrp.c:5055
+#: tree-vrp.c:5039
#, gcc-internal-format
msgid "array subscript is below array bounds"
msgstr ""
-#: tree-vrp.c:5705
+#: tree-vrp.c:5708
#, gcc-internal-format
msgid ""
"assuming signed overflow does not occur when simplifying conditional to "
"constant"
msgstr ""
-#: tree-vrp.c:5711
+#: tree-vrp.c:5714
#, gcc-internal-format
msgid "assuming signed overflow does not occur when simplifying conditional"
msgstr ""
-#: tree-vrp.c:5748
+#: tree-vrp.c:5758
#, gcc-internal-format
msgid "comparison always false due to limited range of data type"
msgstr ""
-#: tree-vrp.c:5751
+#: tree-vrp.c:5760
#, gcc-internal-format
msgid "comparison always true due to limited range of data type"
msgstr ""
-#: tree.c:3697
+#: tree-vrp.c:6602
+#, gcc-internal-format
+msgid ""
+"assuming signed overflow does not occur when simplifying %</%> or %<%%%> to %"
+"<>>%> or %<&%>"
+msgstr ""
+
+#: tree-vrp.c:6684
+#, gcc-internal-format
+msgid ""
+"assuming signed overflow does not occur when simplifying %<abs (X)%> to %<X%"
+"> or %<-X%>"
+msgstr ""
+
+#: tree.c:4072
#, gcc-internal-format
msgid "ignoring attributes applied to %qT after definition"
msgstr ""
-#: tree.c:3980
+#: tree.c:5218
#, gcc-internal-format
msgid "%q+D already declared with dllexport attribute: dllimport ignored"
msgstr ""
-#: tree.c:3992
+#: tree.c:5230
#, gcc-internal-format
msgid ""
"%q+D redeclared without dllimport attribute after being referenced with dll "
"linkage"
msgstr ""
-#: tree.c:4007
+#: tree.c:5245
#, gcc-internal-format
msgid "%q+D redeclared without dllimport attribute: previous dllimport ignored"
msgstr ""
-#: tree.c:4104
+#: tree.c:5345
#, gcc-internal-format
msgid "inline function %q+D declared as dllimport: attribute ignored"
msgstr ""
-#: tree.c:4112
+#: tree.c:5353
#, gcc-internal-format
msgid "function %q+D definition is marked dllimport"
msgstr ""
-#: tree.c:4120 config/sh/symbian.c:430
+#: tree.c:5361 config/sh/symbian-c.c:144 config/sh/symbian-cxx.c:576
#, gcc-internal-format
msgid "variable %q+D definition is marked dllimport"
msgstr ""
-#: tree.c:4143 config/sh/symbian.c:505
+#: tree.c:5388 config/sh/symbian-c.c:164 config/sh/symbian-cxx.c:651
#, gcc-internal-format
msgid "external linkage required for symbol %q+D because of %qE attribute"
msgstr ""
-#: tree.c:4157
+#: tree.c:5402
#, gcc-internal-format
msgid ""
"%qE implies default visibility, but %qD has already been declared with a "
"different visibility"
msgstr ""
-#: tree.c:5739
+#: tree.c:6995
#, gcc-internal-format
msgid "arrays of functions are not meaningful"
msgstr ""
-#: tree.c:5890
+#: tree.c:7131
#, gcc-internal-format
msgid "function return type cannot be function"
msgstr ""
-#: tree.c:7103 tree.c:7188 tree.c:7249
+#: tree.c:8343 tree.c:8428 tree.c:8489
#, gcc-internal-format
msgid "tree check: %s, have %s in %s, at %s:%d"
msgstr ""
-#: tree.c:7140
+#: tree.c:8380
#, gcc-internal-format
msgid "tree check: expected none of %s, have %s in %s, at %s:%d"
msgstr ""
-#: tree.c:7153
+#: tree.c:8393
#, gcc-internal-format
msgid "tree check: expected class %qs, have %qs (%s) in %s, at %s:%d"
msgstr ""
-#: tree.c:7202
+#: tree.c:8442
#, gcc-internal-format
msgid "tree check: did not expect class %qs, have %qs (%s) in %s, at %s:%d"
msgstr ""
-#: tree.c:7215
+#: tree.c:8455
#, gcc-internal-format
msgid "tree check: expected omp_clause %s, have %s in %s, at %s:%d"
msgstr ""
-#: tree.c:7275
+#: tree.c:8515
#, gcc-internal-format
msgid ""
"tree check: expected tree that contains %qs structure, have %qs in %s, at %s:"
"%d"
msgstr ""
-#: tree.c:7289
+#: tree.c:8529
#, gcc-internal-format
msgid "tree check: accessed elt %d of tree_vec with %d elts in %s, at %s:%d"
msgstr ""
-#: tree.c:7302
+#: tree.c:8542
#, gcc-internal-format
msgid "tree check: accessed operand %d of %s with %d operands in %s, at %s:%d"
msgstr ""
-#: tree.c:7315
+#: tree.c:8555
#, gcc-internal-format
msgid ""
"tree check: accessed operand %d of omp_clause %s with %d operands in %s, at %"
@@ -25868,154 +26794,149 @@ msgstr ""
#: value-prof.c:477
#, gcc-internal-format
msgid ""
-"%HCorrupted value profile: %s profiler overall count (%d) does not match BB "
+"Corrupted value profile: %s profiler overall count (%d) does not match BB "
"count (%d)"
msgstr ""
-#: varasm.c:574
+#: varasm.c:580
#, gcc-internal-format
msgid "%+D causes a section type conflict"
msgstr ""
-#: varasm.c:1124
+#: varasm.c:1130
#, gcc-internal-format
msgid ""
"alignment of %q+D is greater than maximum object file alignment. Using %d"
msgstr ""
-#: varasm.c:1350 varasm.c:1358
+#: varasm.c:1356 varasm.c:1364
#, gcc-internal-format
msgid "register name not specified for %q+D"
msgstr ""
-#: varasm.c:1360
+#: varasm.c:1366
#, gcc-internal-format
msgid "invalid register name for %q+D"
msgstr ""
-#: varasm.c:1362
+#: varasm.c:1368
#, gcc-internal-format
msgid "data type of %q+D isn%'t suitable for a register"
msgstr ""
-#: varasm.c:1365
+#: varasm.c:1371
#, gcc-internal-format
msgid "register specified for %q+D isn%'t suitable for data type"
msgstr ""
-#: varasm.c:1375
+#: varasm.c:1381
#, gcc-internal-format
msgid "global register variable has initial value"
msgstr ""
-#: varasm.c:1379
+#: varasm.c:1385
#, gcc-internal-format
msgid "optimization may eliminate reads and/or writes to register variables"
msgstr ""
-#: varasm.c:1417
+#: varasm.c:1423
#, gcc-internal-format
msgid "register name given for non-register variable %q+D"
msgstr ""
-#: varasm.c:1486
+#: varasm.c:1492
#, gcc-internal-format
msgid "global destructors not supported on this target"
msgstr ""
-#: varasm.c:1552
+#: varasm.c:1558
#, gcc-internal-format
msgid "global constructors not supported on this target"
msgstr ""
-#: varasm.c:1938
+#: varasm.c:1945
#, gcc-internal-format
msgid "thread-local COMMON data not implemented"
msgstr ""
-#: varasm.c:1967
+#: varasm.c:1974
#, gcc-internal-format
msgid ""
"requested alignment for %q+D is greater than implemented alignment of %wu"
msgstr ""
-#: varasm.c:4486
+#: varasm.c:4536
#, gcc-internal-format
msgid "initializer for integer/fixed-point value is too complicated"
msgstr ""
-#: varasm.c:4491
+#: varasm.c:4541
#, gcc-internal-format
msgid "initializer for floating value is not a floating constant"
msgstr ""
-#: varasm.c:4764
+#: varasm.c:4847
#, gcc-internal-format
msgid "invalid initial value for member %qE"
msgstr ""
-#: varasm.c:4960 varasm.c:5004
+#: varasm.c:5156 varasm.c:5200
#, gcc-internal-format
msgid "weak declaration of %q+D must precede definition"
msgstr ""
-#: varasm.c:4968
+#: varasm.c:5164
#, gcc-internal-format
msgid ""
"weak declaration of %q+D after first use results in unspecified behavior"
msgstr ""
-#: varasm.c:5002
+#: varasm.c:5198
#, gcc-internal-format
msgid "weak declaration of %q+D must be public"
msgstr ""
-#: varasm.c:5006
+#: varasm.c:5202
#, gcc-internal-format
msgid "weak declaration of %q+D not supported"
msgstr ""
-#: varasm.c:5032
+#: varasm.c:5228 varasm.c:5630
#, gcc-internal-format
msgid "only weak aliases are supported in this configuration"
msgstr ""
-#: varasm.c:5266
+#: varasm.c:5445
#, gcc-internal-format
-msgid "%Jweakref is not supported in this configuration"
+msgid "weakref is not supported in this configuration"
msgstr ""
-#: varasm.c:5347
+#: varasm.c:5559
#, gcc-internal-format
msgid "%q+D aliased to undefined symbol %qE"
msgstr ""
-#: varasm.c:5352
+#: varasm.c:5569
#, gcc-internal-format
msgid "%q+D aliased to external symbol %qE"
msgstr ""
-#: varasm.c:5391
+#: varasm.c:5608
#, gcc-internal-format
msgid "weakref %q+D ultimately targets itself"
msgstr ""
-#: varasm.c:5400
+#: varasm.c:5617
#, gcc-internal-format
msgid "weakref %q+D must have static linkage"
msgstr ""
-#: varasm.c:5406
-#, gcc-internal-format
-msgid "%Jalias definitions not supported in this configuration"
-msgstr ""
-
-#: varasm.c:5411
+#: varasm.c:5624
#, gcc-internal-format
-msgid "%Jonly weak aliases are supported in this configuration"
+msgid "alias definitions not supported in this configuration"
msgstr ""
-#: varasm.c:5471
+#: varasm.c:5690
#, gcc-internal-format
msgid "visibility attribute not supported in this configuration; ignored"
msgstr ""
@@ -26030,7 +26951,7 @@ msgstr ""
msgid "underflowed virtual array %s in %s, at %s:%d"
msgstr ""
-#: vec.c:382
+#: vec.c:523
#, gcc-internal-format
msgid "vector %s %s domain error, in %s at %s:%u"
msgstr ""
@@ -26195,7 +27116,7 @@ msgstr ""
#. coalesced sections. Weak aliases (or any other kind of aliases) are
#. not supported. Weak symbols that aren't visible outside the .s file
#. are not supported.
-#: config/darwin.h:456
+#: config/darwin.h:488
#, gcc-internal-format
msgid "alias definitions not supported in Mach-O; ignored"
msgstr ""
@@ -26206,303 +27127,339 @@ msgstr ""
msgid "profiler support for VxWorks"
msgstr ""
-#: config/alpha/alpha.c:233 config/rs6000/rs6000.c:2194
+#: config/alpha/alpha.c:230 config/rs6000/rs6000.c:3103
#, gcc-internal-format
msgid "bad value %qs for -mtls-size switch"
msgstr ""
-#: config/alpha/alpha.c:287
+#: config/alpha/alpha.c:284
#, gcc-internal-format
msgid "-f%s ignored for Unicos/Mk (not supported)"
msgstr ""
-#: config/alpha/alpha.c:311
+#: config/alpha/alpha.c:308
#, gcc-internal-format
msgid "-mieee not supported on Unicos/Mk"
msgstr ""
-#: config/alpha/alpha.c:322
+#: config/alpha/alpha.c:319
#, gcc-internal-format
msgid "-mieee-with-inexact not supported on Unicos/Mk"
msgstr ""
-#: config/alpha/alpha.c:339
+#: config/alpha/alpha.c:336
#, gcc-internal-format
msgid "bad value %qs for -mtrap-precision switch"
msgstr ""
-#: config/alpha/alpha.c:353
+#: config/alpha/alpha.c:350
#, gcc-internal-format
msgid "bad value %qs for -mfp-rounding-mode switch"
msgstr ""
-#: config/alpha/alpha.c:368
+#: config/alpha/alpha.c:365
#, gcc-internal-format
msgid "bad value %qs for -mfp-trap-mode switch"
msgstr ""
-#: config/alpha/alpha.c:382 config/alpha/alpha.c:394
+#: config/alpha/alpha.c:379 config/alpha/alpha.c:391
#, gcc-internal-format
msgid "bad value %qs for -mcpu switch"
msgstr ""
-#: config/alpha/alpha.c:401
+#: config/alpha/alpha.c:398
#, gcc-internal-format
msgid "trap mode not supported on Unicos/Mk"
msgstr ""
-#: config/alpha/alpha.c:408
+#: config/alpha/alpha.c:405
#, gcc-internal-format
msgid "fp software completion requires -mtrap-precision=i"
msgstr ""
-#: config/alpha/alpha.c:424
+#: config/alpha/alpha.c:421
#, gcc-internal-format
msgid "rounding mode not supported for VAX floats"
msgstr ""
-#: config/alpha/alpha.c:429
+#: config/alpha/alpha.c:426
#, gcc-internal-format
msgid "trap mode not supported for VAX floats"
msgstr ""
-#: config/alpha/alpha.c:433
+#: config/alpha/alpha.c:430
#, gcc-internal-format
msgid "128-bit long double not supported for VAX floats"
msgstr ""
-#: config/alpha/alpha.c:461
+#: config/alpha/alpha.c:458
#, gcc-internal-format
msgid "L%d cache latency unknown for %s"
msgstr ""
-#: config/alpha/alpha.c:476
+#: config/alpha/alpha.c:473
#, gcc-internal-format
msgid "bad value %qs for -mmemory-latency"
msgstr ""
-#: config/alpha/alpha.c:6578 config/alpha/alpha.c:6581 config/s390/s390.c:8715
-#: config/s390/s390.c:8718
+#: config/alpha/alpha.c:6728 config/alpha/alpha.c:6731 config/s390/s390.c:8797
+#: config/s390/s390.c:8800
#, gcc-internal-format
msgid "bad builtin fcode"
msgstr ""
-#: config/arc/arc.c:392
+#: config/arc/arc.c:393
#, gcc-internal-format
msgid "argument of %qE attribute is not a string constant"
msgstr ""
-#: config/arc/arc.c:400
+#: config/arc/arc.c:401
#, gcc-internal-format
msgid "argument of %qE attribute is not \"ilink1\" or \"ilink2\""
msgstr ""
-#: config/arm/arm.c:1183
+#: config/arm/arm.c:1342
#, gcc-internal-format
msgid "switch -mcpu=%s conflicts with -march= switch"
msgstr ""
-#: config/arm/arm.c:1193 config/rs6000/rs6000.c:1592 config/sparc/sparc.c:768
+#: config/arm/arm.c:1352 config/rs6000/rs6000.c:2334 config/sparc/sparc.c:780
#, gcc-internal-format
msgid "bad value (%s) for %s switch"
msgstr ""
-#: config/arm/arm.c:1306
+#: config/arm/arm.c:1465
+#, gcc-internal-format
+msgid "invalid __fp16 format option: -mfp16-format=%s"
+msgstr ""
+
+#: config/arm/arm.c:1482
#, gcc-internal-format
msgid "invalid ABI option: -mabi=%s"
msgstr ""
-#: config/arm/arm.c:1314
+#: config/arm/arm.c:1490
#, gcc-internal-format
msgid "target CPU does not support ARM mode"
msgstr ""
-#: config/arm/arm.c:1320
+#: config/arm/arm.c:1496
#, gcc-internal-format
msgid "target CPU does not support interworking"
msgstr ""
-#: config/arm/arm.c:1326
+#: config/arm/arm.c:1502
#, gcc-internal-format
msgid "target CPU does not support THUMB instructions"
msgstr ""
-#: config/arm/arm.c:1344
+#: config/arm/arm.c:1520
#, gcc-internal-format
msgid ""
"enabling backtrace support is only meaningful when compiling for the Thumb"
msgstr ""
-#: config/arm/arm.c:1347
+#: config/arm/arm.c:1523
#, gcc-internal-format
msgid ""
"enabling callee interworking support is only meaningful when compiling for "
"the Thumb"
msgstr ""
-#: config/arm/arm.c:1350
+#: config/arm/arm.c:1526
#, gcc-internal-format
msgid ""
"enabling caller interworking support is only meaningful when compiling for "
"the Thumb"
msgstr ""
-#: config/arm/arm.c:1354
+#: config/arm/arm.c:1530
#, gcc-internal-format
msgid "-mapcs-stack-check incompatible with -mno-apcs-frame"
msgstr ""
-#: config/arm/arm.c:1362
+#: config/arm/arm.c:1538
#, gcc-internal-format
msgid "-fpic and -mapcs-reent are incompatible"
msgstr ""
-#: config/arm/arm.c:1365
+#: config/arm/arm.c:1541
#, gcc-internal-format
msgid "APCS reentrant code not supported. Ignored"
msgstr ""
-#: config/arm/arm.c:1373
+#: config/arm/arm.c:1549
#, gcc-internal-format
msgid "-g with -mno-apcs-frame may not give sensible debugging"
msgstr ""
-#: config/arm/arm.c:1376
+#: config/arm/arm.c:1552
#, gcc-internal-format
msgid "passing floating point arguments in fp regs not yet supported"
msgstr ""
-#: config/arm/arm.c:1433
+#: config/arm/arm.c:1609
#, gcc-internal-format
msgid "iwmmxt requires an AAPCS compatible ABI for proper operation"
msgstr ""
-#: config/arm/arm.c:1436
+#: config/arm/arm.c:1612
#, gcc-internal-format
msgid "iwmmxt abi requires an iwmmxt capable cpu"
msgstr ""
-#: config/arm/arm.c:1446
+#: config/arm/arm.c:1622
#, gcc-internal-format
msgid "invalid floating point emulation option: -mfpe=%s"
msgstr ""
-#: config/arm/arm.c:1463
+#: config/arm/arm.c:1639
#, gcc-internal-format
msgid "invalid floating point option: -mfpu=%s"
msgstr ""
-#: config/arm/arm.c:1503
+#: config/arm/arm.c:1679
#, gcc-internal-format
msgid "invalid floating point abi: -mfloat-abi=%s"
msgstr ""
-#: config/arm/arm.c:1510
+#: config/arm/arm.c:1687
#, gcc-internal-format
-msgid "-mfloat-abi=hard and VFP"
+msgid "FPA is unsupported in the AAPCS"
msgstr ""
-#: config/arm/arm.c:1514
+#: config/arm/arm.c:1692
#, gcc-internal-format
-msgid "FPA is unsupported in the AAPCS"
+msgid "AAPCS does not support -mcaller-super-interworking"
msgstr ""
-#: config/arm/arm.c:1520
+#: config/arm/arm.c:1695
+#, gcc-internal-format
+msgid "AAPCS does not support -mcallee-super-interworking"
+msgstr ""
+
+#: config/arm/arm.c:1702
#, gcc-internal-format
msgid "iWMMXt and hardware floating point"
msgstr ""
-#: config/arm/arm.c:1524
+#: config/arm/arm.c:1706
#, gcc-internal-format
msgid "Thumb-2 iWMMXt"
msgstr ""
-#: config/arm/arm.c:1547
+#: config/arm/arm.c:1710
+#, gcc-internal-format
+msgid "__fp16 and no ldrh"
+msgstr ""
+
+#: config/arm/arm.c:1730
+#, gcc-internal-format
+msgid "-mfloat-abi=hard and VFP"
+msgstr ""
+
+#: config/arm/arm.c:1755
#, gcc-internal-format
msgid "invalid thread pointer option: -mtp=%s"
msgstr ""
-#: config/arm/arm.c:1560
+#: config/arm/arm.c:1768
#, gcc-internal-format
msgid "can not use -mtp=cp15 with 16-bit Thumb"
msgstr ""
-#: config/arm/arm.c:1574
+#: config/arm/arm.c:1782
#, gcc-internal-format
msgid "structure size boundary can only be set to %s"
msgstr ""
-#: config/arm/arm.c:1580
+#: config/arm/arm.c:1788
#, gcc-internal-format
msgid "RTP PIC is incompatible with Thumb"
msgstr ""
-#: config/arm/arm.c:1589
+#: config/arm/arm.c:1797
#, gcc-internal-format
msgid "RTP PIC is incompatible with -msingle-pic-base"
msgstr ""
-#: config/arm/arm.c:1601
+#: config/arm/arm.c:1809
#, gcc-internal-format
msgid "-mpic-register= is useless without -fpic"
msgstr ""
-#: config/arm/arm.c:1610
+#: config/arm/arm.c:1818
#, gcc-internal-format
msgid "unable to use '%s' for PIC register"
msgstr ""
-#: config/arm/arm.c:3267 config/arm/arm.c:3285 config/avr/avr.c:4827
-#: config/avr/avr.c:4843 config/bfin/bfin.c:5270 config/bfin/bfin.c:5331
-#: config/bfin/bfin.c:5360 config/h8300/h8300.c:5259 config/i386/i386.c:4248
-#: config/i386/i386.c:26839 config/m68hc11/m68hc11.c:1147
-#: config/m68k/m68k.c:784 config/mcore/mcore.c:3034
-#: config/rs6000/rs6000.c:20670 config/sh/sh.c:8132 config/sh/sh.c:8150
-#: config/sh/sh.c:8179 config/sh/sh.c:8261 config/sh/sh.c:8284
-#: config/spu/spu.c:3726 config/stormy16/stormy16.c:2221
-#: config/v850/v850.c:2048
+#: config/arm/arm.c:3590
+#, gcc-internal-format
+msgid "Non-AAPCS derived PCS variant"
+msgstr ""
+
+#: config/arm/arm.c:3592
+#, gcc-internal-format
+msgid "Variadic functions must use the base AAPCS variant"
+msgstr ""
+
+#: config/arm/arm.c:3611
+#, gcc-internal-format
+msgid "PCS variant"
+msgstr ""
+
+#: config/arm/arm.c:4472 config/arm/arm.c:4490 config/avr/avr.c:4678
+#: config/avr/avr.c:4694 config/bfin/bfin.c:5546 config/bfin/bfin.c:5607
+#: config/bfin/bfin.c:5636 config/h8300/h8300.c:5338 config/i386/i386.c:4364
+#: config/i386/i386.c:26460 config/i386/i386.c:26542
+#: config/m68hc11/m68hc11.c:1168 config/m68k/m68k.c:802
+#: config/mcore/mcore.c:3036 config/mep/mep.c:4061 config/mep/mep.c:4075
+#: config/mep/mep.c:4149 config/rs6000/rs6000.c:23288 config/sh/sh.c:8625
+#: config/sh/sh.c:8643 config/sh/sh.c:8672 config/sh/sh.c:8754
+#: config/sh/sh.c:8777 config/spu/spu.c:3751 config/stormy16/stormy16.c:2230
+#: config/v850/v850.c:2072
#, gcc-internal-format
msgid "%qE attribute only applies to functions"
msgstr ""
-#: config/arm/arm.c:14814
+#: config/arm/arm.c:16127
#, gcc-internal-format
msgid "unable to compute real location of stacked parameter"
msgstr ""
-#: config/arm/arm.c:16320
+#: config/arm/arm.c:17707
#, gcc-internal-format
msgid "argument must be a constant"
msgstr ""
#. @@@ better error message
-#: config/arm/arm.c:16628 config/arm/arm.c:16665
+#: config/arm/arm.c:18015 config/arm/arm.c:18052
#, gcc-internal-format
msgid "selector must be an immediate"
msgstr ""
#. @@@ better error message
-#: config/arm/arm.c:16708
+#: config/arm/arm.c:18095
#, gcc-internal-format
msgid "mask must be an immediate"
msgstr ""
-#: config/arm/arm.c:17369
+#: config/arm/arm.c:18757
#, gcc-internal-format
msgid "no low registers available for popping high registers"
msgstr ""
-#: config/arm/arm.c:17592
+#: config/arm/arm.c:18980
#, gcc-internal-format
msgid "interrupt Service Routines cannot be coded in Thumb mode"
msgstr ""
-#: config/arm/arm.c:19640
+#: config/arm/arm.c:21099
#, gcc-internal-format
msgid "the mangling of %<va_list%> has changed in GCC 4.4"
msgstr ""
-#: config/arm/pe.c:158 config/mcore/mcore.c:2900
+#: config/arm/pe.c:158 config/mcore/mcore.c:2911
#, gcc-internal-format
msgid "initialized variable %q+D is marked dllimport"
msgstr ""
@@ -26512,107 +27469,103 @@ msgstr ""
msgid "static variable %q+D is marked dllimport"
msgstr ""
-#: config/avr/avr.c:4629
+#: config/avr/avr.c:4492
#, gcc-internal-format
msgid "%qs appears to be a misspelled interrupt handler"
msgstr ""
-#: config/avr/avr.c:4638
+#: config/avr/avr.c:4501
#, gcc-internal-format
msgid "%qs appears to be a misspelled signal handler"
msgstr ""
-#: config/avr/avr.c:4800
+#: config/avr/avr.c:4651
#, gcc-internal-format
msgid "only initialized variables can be placed into program memory area"
msgstr ""
-#: config/avr/avr.c:4934
+#: config/avr/avr.c:4785
#, gcc-internal-format
msgid "only uninitialized variables can be placed in the .noinit section"
msgstr ""
-#: config/avr/avr.c:4948
+#: config/avr/avr.c:4799
#, gcc-internal-format
msgid "MCU %qs supported for assembler only"
msgstr ""
-#: config/avr/avr.h:738
-#, gcc-internal-format
-msgid "trampolines not supported"
-msgstr ""
-
-#: config/bfin/bfin.c:2458 config/m68k/m68k.c:501
+#: config/bfin/bfin.c:2554 config/m68k/m68k.c:519
#, gcc-internal-format
msgid "-mshared-library-id=%s is not between 0 and %d"
msgstr ""
-#: config/bfin/bfin.c:2478
+#: config/bfin/bfin.c:2574
#, gcc-internal-format
msgid "-mcpu=%s is not valid"
msgstr ""
-#: config/bfin/bfin.c:2514
+#: config/bfin/bfin.c:2610
#, gcc-internal-format
msgid "-mcpu=%s has invalid silicon revision"
msgstr ""
-#: config/bfin/bfin.c:2579
+#: config/bfin/bfin.c:2675
#, gcc-internal-format
msgid "-mshared-library-id= specified without -mid-shared-library"
msgstr ""
-#: config/bfin/bfin.c:2582
+#: config/bfin/bfin.c:2678
#, gcc-internal-format
msgid "Can't use multiple stack checking methods together."
msgstr ""
-#: config/bfin/bfin.c:2585
+#: config/bfin/bfin.c:2681
#, gcc-internal-format
msgid "ID shared libraries and FD-PIC mode can't be used together."
msgstr ""
-#: config/bfin/bfin.c:2590 config/m68k/m68k.c:609
+#: config/bfin/bfin.c:2686 config/m68k/m68k.c:627
#, gcc-internal-format
msgid "cannot specify both -msep-data and -mid-shared-library"
msgstr ""
-#: config/bfin/bfin.c:2610
+#: config/bfin/bfin.c:2706
#, gcc-internal-format
msgid "-mmulticore can only be used with BF561"
msgstr ""
-#: config/bfin/bfin.c:2613
+#: config/bfin/bfin.c:2709
#, gcc-internal-format
msgid "-mcorea should be used with -mmulticore"
msgstr ""
-#: config/bfin/bfin.c:2616
+#: config/bfin/bfin.c:2712
#, gcc-internal-format
msgid "-mcoreb should be used with -mmulticore"
msgstr ""
-#: config/bfin/bfin.c:2619
+#: config/bfin/bfin.c:2715
#, gcc-internal-format
msgid "-mcorea and -mcoreb can't be used together"
msgstr ""
-#: config/bfin/bfin.c:5275
+#: config/bfin/bfin.c:5551
#, gcc-internal-format
msgid "multiple function type attributes specified"
msgstr ""
-#: config/bfin/bfin.c:5342
+#: config/bfin/bfin.c:5618
#, gcc-internal-format
msgid "can't apply both longcall and shortcall attributes to the same function"
msgstr ""
-#: config/bfin/bfin.c:5392 config/i386/winnt.c:59
+#: config/bfin/bfin.c:5668 config/i386/winnt.c:59 config/mep/mep.c:3965
+#: config/mep/mep.c:4103
#, gcc-internal-format
msgid "%qE attribute only applies to variables"
msgstr ""
-#: config/bfin/bfin.c:5399
+#: config/bfin/bfin.c:5675
#, gcc-internal-format
msgid "%qE attribute cannot be specified for local variables"
msgstr ""
@@ -26621,90 +27574,90 @@ msgstr ""
#. an operator, for immediate output. If that ever happens for
#. MULT, we need to apply TARGET_MUL_BUG in the caller. Make sure
#. we notice.
-#: config/cris/cris.c:447
+#: config/cris/cris.c:463
#, gcc-internal-format
msgid "MULT case in cris_op_str"
msgstr ""
-#: config/cris/cris.c:837
+#: config/cris/cris.c:853
#, gcc-internal-format
msgid "invalid use of ':' modifier"
msgstr ""
-#: config/cris/cris.c:1024
+#: config/cris/cris.c:1040 config/moxie/moxie.c:169
#, gcc-internal-format
msgid "internal error: bad register: %d"
msgstr ""
-#: config/cris/cris.c:1586
+#: config/cris/cris.c:1607
#, gcc-internal-format
msgid "internal error: sideeffect-insn affecting main effect"
msgstr ""
-#: config/cris/cris.c:1683
+#: config/cris/cris.c:1704
#, gcc-internal-format
msgid "unknown cc_attr value"
msgstr ""
#. If we get here, the caller got its initial tests wrong.
-#: config/cris/cris.c:2062
+#: config/cris/cris.c:2088
#, gcc-internal-format
msgid "internal error: cris_side_effect_mode_ok with bad operands"
msgstr ""
-#: config/cris/cris.c:2354
+#: config/cris/cris.c:2380
#, gcc-internal-format
msgid "-max-stackframe=%d is not usable, not between 0 and %d"
msgstr ""
-#: config/cris/cris.c:2382
+#: config/cris/cris.c:2408
#, gcc-internal-format
msgid "unknown CRIS version specification in -march= or -mcpu= : %s"
msgstr ""
-#: config/cris/cris.c:2418
+#: config/cris/cris.c:2444
#, gcc-internal-format
msgid "unknown CRIS cpu version specification in -mtune= : %s"
msgstr ""
-#: config/cris/cris.c:2439
+#: config/cris/cris.c:2465
#, gcc-internal-format
msgid "-fPIC and -fpic are not supported in this configuration"
msgstr ""
-#: config/cris/cris.c:2454
+#: config/cris/cris.c:2480
#, gcc-internal-format
msgid "that particular -g option is invalid with -maout and -melinux"
msgstr ""
-#: config/cris/cris.c:2680
+#: config/cris/cris.c:2706
#, gcc-internal-format
msgid "Unknown src"
msgstr ""
-#: config/cris/cris.c:2741
+#: config/cris/cris.c:2767
#, gcc-internal-format
msgid "Unknown dest"
msgstr ""
-#: config/cris/cris.c:3026
+#: config/cris/cris.c:3052
#, gcc-internal-format
msgid "stackframe too big: %d bytes"
msgstr ""
-#: config/cris/cris.c:3520 config/cris/cris.c:3548
+#: config/cris/cris.c:3546 config/cris/cris.c:3574
#, gcc-internal-format
msgid "expand_binop failed in movsi got"
msgstr ""
-#: config/cris/cris.c:3630
+#: config/cris/cris.c:3656
#, gcc-internal-format
msgid "emitting PIC operand, but PIC register isn't set up"
msgstr ""
#. Definitions for GCC. Part of the machine description for CRIS.
-#. Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
-#. Free Software Foundation, Inc.
+#. Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008,
+#. 2009 Free Software Foundation, Inc.
#. Contributed by Axis Communications. Written by Hans-Peter Nilsson.
#.
#. This file is part of GCC.
@@ -26751,77 +27704,72 @@ msgstr ""
#. See cris.c for TARGET_ASM_FUNCTION_PROLOGUE and
#. TARGET_ASM_FUNCTION_EPILOGUE.
#. Node: Profiling
-#: config/cris/cris.h:953
+#: config/cris/cris.h:935
#, gcc-internal-format
msgid "no FUNCTION_PROFILER for CRIS"
msgstr ""
-#: config/crx/crx.h:368
+#: config/crx/crx.h:363
#, gcc-internal-format
msgid "Profiler support for CRX"
msgstr ""
-#: config/crx/crx.h:379
-#, gcc-internal-format
-msgid "Trampoline support for CRX"
-msgstr ""
-
-#: config/frv/frv.c:8705
+#: config/frv/frv.c:8694
#, gcc-internal-format
msgid "accumulator is not a constant integer"
msgstr ""
-#: config/frv/frv.c:8710
+#: config/frv/frv.c:8699
#, gcc-internal-format
msgid "accumulator number is out of bounds"
msgstr ""
-#: config/frv/frv.c:8721
+#: config/frv/frv.c:8710
#, gcc-internal-format
msgid "inappropriate accumulator for %qs"
msgstr ""
-#: config/frv/frv.c:8798
+#: config/frv/frv.c:8787
#, gcc-internal-format
msgid "invalid IACC argument"
msgstr ""
-#: config/frv/frv.c:8821
+#: config/frv/frv.c:8810
#, gcc-internal-format
msgid "%qs expects a constant argument"
msgstr ""
-#: config/frv/frv.c:8826
+#: config/frv/frv.c:8815
#, gcc-internal-format
msgid "constant argument out of range for %qs"
msgstr ""
-#: config/frv/frv.c:9307
+#: config/frv/frv.c:9296
#, gcc-internal-format
msgid "media functions are not available unless -mmedia is used"
msgstr ""
-#: config/frv/frv.c:9319
+#: config/frv/frv.c:9308
#, gcc-internal-format
msgid "this media function is only available on the fr500"
msgstr ""
-#: config/frv/frv.c:9347
+#: config/frv/frv.c:9336
#, gcc-internal-format
msgid "this media function is only available on the fr400 and fr550"
msgstr ""
-#: config/frv/frv.c:9366
+#: config/frv/frv.c:9355
#, gcc-internal-format
msgid "this builtin function is only available on the fr405 and fr450"
msgstr ""
-#: config/frv/frv.c:9375
+#: config/frv/frv.c:9364
#, gcc-internal-format
msgid "this builtin function is only available on the fr500 and fr550"
msgstr ""
-#: config/frv/frv.c:9387
+#: config/frv/frv.c:9376
#, gcc-internal-format
msgid "this builtin function is only available on the fr450"
msgstr ""
@@ -26846,392 +27794,392 @@ msgstr ""
msgid "can't set position in PCH file: %m"
msgstr ""
-#: config/i386/i386.c:2748 config/i386/i386.c:2990
+#: config/i386/i386.c:2786 config/i386/i386.c:3031
#, gcc-internal-format
msgid "bad value (%s) for %stune=%s %s"
msgstr ""
-#: config/i386/i386.c:2792
+#: config/i386/i386.c:2830
#, gcc-internal-format
msgid "bad value (%s) for %sstringop-strategy=%s %s"
msgstr ""
-#: config/i386/i386.c:2796
+#: config/i386/i386.c:2834
#, gcc-internal-format
msgid ""
"%stune=x86-64%s is deprecated. Use %stune=k8%s or %stune=generic%s instead "
"as appropriate."
msgstr ""
-#: config/i386/i386.c:2806
+#: config/i386/i386.c:2844
#, gcc-internal-format
msgid "generic CPU can be used only for %stune=%s %s"
msgstr ""
-#: config/i386/i386.c:2809 config/i386/i386.c:2951
+#: config/i386/i386.c:2847 config/i386/i386.c:2992
#, gcc-internal-format
msgid "bad value (%s) for %sarch=%s %s"
msgstr ""
-#: config/i386/i386.c:2820
+#: config/i386/i386.c:2858
#, gcc-internal-format
msgid "unknown ABI (%s) for %sabi=%s %s"
msgstr ""
-#: config/i386/i386.c:2835
+#: config/i386/i386.c:2873
#, gcc-internal-format
msgid "code model %s does not support PIC mode"
msgstr ""
-#: config/i386/i386.c:2841
+#: config/i386/i386.c:2879
#, gcc-internal-format
msgid "bad value (%s) for %scmodel=%s %s"
msgstr ""
-#: config/i386/i386.c:2865
+#: config/i386/i386.c:2903
#, gcc-internal-format
msgid "bad value (%s) for %sasm=%s %s"
msgstr ""
-#: config/i386/i386.c:2869
+#: config/i386/i386.c:2907
#, gcc-internal-format
msgid "code model %qs not supported in the %s bit mode"
msgstr ""
-#: config/i386/i386.c:2872
+#: config/i386/i386.c:2910
#, gcc-internal-format
msgid "%i-bit mode not compiled in"
msgstr ""
-#: config/i386/i386.c:2884 config/i386/i386.c:2976
+#: config/i386/i386.c:2922 config/i386/i386.c:3017
#, gcc-internal-format
msgid "CPU you selected does not support x86-64 instruction set"
msgstr ""
-#: config/i386/i386.c:3009
+#: config/i386/i386.c:3050
#, gcc-internal-format
msgid "%sregparm%s is ignored in 64-bit mode"
msgstr ""
-#: config/i386/i386.c:3012
+#: config/i386/i386.c:3053
#, gcc-internal-format
msgid "%sregparm=%d%s is not between 0 and %d"
msgstr ""
-#: config/i386/i386.c:3025
+#: config/i386/i386.c:3066
#, gcc-internal-format
msgid "%salign-loops%s is obsolete, use -falign-loops%s"
msgstr ""
-#: config/i386/i386.c:3031 config/i386/i386.c:3046 config/i386/i386.c:3061
+#: config/i386/i386.c:3072 config/i386/i386.c:3087 config/i386/i386.c:3102
#, gcc-internal-format
msgid "%salign-loops=%d%s is not between 0 and %d"
msgstr ""
-#: config/i386/i386.c:3040
+#: config/i386/i386.c:3081
#, gcc-internal-format
msgid "%salign-jumps%s is obsolete, use -falign-jumps%s"
msgstr ""
-#: config/i386/i386.c:3055
+#: config/i386/i386.c:3096
#, gcc-internal-format
msgid "%salign-functions%s is obsolete, use -falign-functions%s"
msgstr ""
-#: config/i386/i386.c:3090
+#: config/i386/i386.c:3131
#, gcc-internal-format
msgid "%sbranch-cost=%d%s is not between 0 and 5"
msgstr ""
-#: config/i386/i386.c:3098
+#: config/i386/i386.c:3139
#, gcc-internal-format
msgid "%slarge-data-threshold=%d%s is negative"
msgstr ""
-#: config/i386/i386.c:3112
+#: config/i386/i386.c:3153
#, gcc-internal-format
msgid "bad value (%s) for %stls-dialect=%s %s"
msgstr ""
-#: config/i386/i386.c:3120
+#: config/i386/i386.c:3161
#, gcc-internal-format
msgid "pc%d is not valid precision setting (32, 64 or 80)"
msgstr ""
-#: config/i386/i386.c:3136
+#: config/i386/i386.c:3177
#, gcc-internal-format
msgid "%srtd%s is ignored in 64bit mode"
msgstr ""
-#: config/i386/i386.c:3191
+#: config/i386/i386.c:3232
#, gcc-internal-format
msgid "%spreferred-stack-boundary=%d%s is not between %d and 12"
msgstr ""
-#: config/i386/i386.c:3212
+#: config/i386/i386.c:3253
#, gcc-internal-format
msgid "-mincoming-stack-boundary=%d is not between %d and 12"
msgstr ""
-#: config/i386/i386.c:3225
+#: config/i386/i386.c:3266
#, gcc-internal-format
msgid "%ssseregparm%s used without SSE enabled"
msgstr ""
-#: config/i386/i386.c:3236 config/i386/i386.c:3250
+#: config/i386/i386.c:3277 config/i386/i386.c:3291
#, gcc-internal-format
msgid "SSE instruction set disabled, using 387 arithmetics"
msgstr ""
-#: config/i386/i386.c:3255
+#: config/i386/i386.c:3296
#, gcc-internal-format
msgid "387 instruction set disabled, using SSE arithmetics"
msgstr ""
-#: config/i386/i386.c:3262
+#: config/i386/i386.c:3303
#, gcc-internal-format
msgid "bad value (%s) for %sfpmath=%s %s"
msgstr ""
-#: config/i386/i386.c:3278
+#: config/i386/i386.c:3319
#, gcc-internal-format
msgid "unknown vectorization library ABI type (%s) for %sveclibabi=%s %s"
msgstr ""
-#: config/i386/i386.c:3298
+#: config/i386/i386.c:3339
#, gcc-internal-format
msgid ""
"unwind tables currently require either a frame pointer or %saccumulate-"
"outgoing-args%s for correctness"
msgstr ""
-#: config/i386/i386.c:3311
+#: config/i386/i386.c:3352
#, gcc-internal-format
msgid "stack probing requires %saccumulate-outgoing-args%s for correctness"
msgstr ""
-#: config/i386/i386.c:3649
+#: config/i386/i386.c:3761
#, gcc-internal-format
msgid "attribute(target(\"%s\")) is unknown"
msgstr ""
-#: config/i386/i386.c:3671
+#: config/i386/i386.c:3783
#, gcc-internal-format
msgid "option(\"%s\") was already specified"
msgstr ""
-#: config/i386/i386.c:4261 config/i386/i386.c:4305
+#: config/i386/i386.c:4377 config/i386/i386.c:4422
#, gcc-internal-format
msgid "fastcall and regparm attributes are not compatible"
msgstr ""
-#: config/i386/i386.c:4268
+#: config/i386/i386.c:4384
#, gcc-internal-format
msgid "%qE attribute requires an integer constant argument"
msgstr ""
-#: config/i386/i386.c:4274
+#: config/i386/i386.c:4390
#, gcc-internal-format
msgid "argument to %qE attribute larger than %d"
msgstr ""
-#: config/i386/i386.c:4297 config/i386/i386.c:4332
+#: config/i386/i386.c:4414 config/i386/i386.c:4449
#, gcc-internal-format
msgid "fastcall and cdecl attributes are not compatible"
msgstr ""
-#: config/i386/i386.c:4301
+#: config/i386/i386.c:4418
#, gcc-internal-format
msgid "fastcall and stdcall attributes are not compatible"
msgstr ""
-#: config/i386/i386.c:4315 config/i386/i386.c:4328
+#: config/i386/i386.c:4432 config/i386/i386.c:4445
#, gcc-internal-format
msgid "stdcall and cdecl attributes are not compatible"
msgstr ""
-#: config/i386/i386.c:4319
+#: config/i386/i386.c:4436
#, gcc-internal-format
msgid "stdcall and fastcall attributes are not compatible"
msgstr ""
-#: config/i386/i386.c:4406
+#: config/i386/i386.c:4579
#, gcc-internal-format
-msgid "nested functions are limited to 2 register parameters"
+msgid "Calling %qD with attribute sseregparm without SSE/SSE2 enabled"
msgstr ""
-#: config/i386/i386.c:4492
+#: config/i386/i386.c:4582
#, gcc-internal-format
-msgid "Calling %qD with attribute sseregparm without SSE/SSE2 enabled"
+msgid "Calling %qT with attribute sseregparm without SSE/SSE2 enabled"
msgstr ""
-#: config/i386/i386.c:4495
+#: config/i386/i386.c:4787
#, gcc-internal-format
-msgid "Calling %qT with attribute sseregparm without SSE/SSE2 enabled"
+msgid "ms_hook_prologue is not compatible with nested function"
msgstr ""
-#: config/i386/i386.c:4754
+#: config/i386/i386.c:4860
#, gcc-internal-format
msgid ""
-"ms_abi attribute require -maccumulate-outgoing-args or subtarget "
+"ms_abi attribute requires -maccumulate-outgoing-args or subtarget "
"optimization implying it"
msgstr ""
-#: config/i386/i386.c:4871
+#: config/i386/i386.c:4979
#, gcc-internal-format
msgid "AVX vector argument without AVX enabled changes the ABI"
msgstr ""
-#: config/i386/i386.c:5053
+#: config/i386/i386.c:5161
#, gcc-internal-format
msgid ""
"The ABI of passing struct with a flexible array member has changed in GCC 4.4"
msgstr ""
-#: config/i386/i386.c:5169
+#: config/i386/i386.c:5277
#, gcc-internal-format
msgid "The ABI of passing union with long double has changed in GCC 4.4"
msgstr ""
-#: config/i386/i386.c:5284
+#: config/i386/i386.c:5392
#, gcc-internal-format
msgid ""
"The ABI of passing structure with complex float member has changed in GCC 4.4"
msgstr ""
-#: config/i386/i386.c:5429
+#: config/i386/i386.c:5537
#, gcc-internal-format
msgid "SSE register return with SSE disabled"
msgstr ""
-#: config/i386/i386.c:5435
+#: config/i386/i386.c:5543
#, gcc-internal-format
msgid "SSE register argument with SSE disabled"
msgstr ""
-#: config/i386/i386.c:5451
+#: config/i386/i386.c:5559
#, gcc-internal-format
msgid "x87 register return with x87 disabled"
msgstr ""
-#: config/i386/i386.c:5820
+#: config/i386/i386.c:5928
#, gcc-internal-format
msgid "SSE vector argument without SSE enabled changes the ABI"
msgstr ""
-#: config/i386/i386.c:5857
+#: config/i386/i386.c:5965
#, gcc-internal-format
msgid "MMX vector argument without MMX enabled changes the ABI"
msgstr ""
-#: config/i386/i386.c:6458
+#: config/i386/i386.c:6567
#, gcc-internal-format
msgid "SSE vector return without SSE enabled changes the ABI"
msgstr ""
-#: config/i386/i386.c:6468
+#: config/i386/i386.c:6577
#, gcc-internal-format
msgid "MMX vector return without MMX enabled changes the ABI"
msgstr ""
-#: config/i386/i386.c:10734
+#: config/i386/i386.c:11125
#, gcc-internal-format
msgid "extended registers have no high halves"
msgstr ""
-#: config/i386/i386.c:10749
+#: config/i386/i386.c:11140
#, gcc-internal-format
msgid "unsupported operand size for extended register"
msgstr ""
-#: config/i386/i386.c:10987
+#: config/i386/i386.c:11377
#, gcc-internal-format
msgid "non-integer operand used with operand code '%c'"
msgstr ""
-#: config/i386/i386.c:24052
+#: config/i386/i386.c:23627
#, gcc-internal-format
msgid "last argument must be an immediate"
msgstr ""
-#: config/i386/i386.c:24345
+#: config/i386/i386.c:23920
#, gcc-internal-format
msgid "the fifth argument must be a 8-bit immediate"
msgstr ""
-#: config/i386/i386.c:24440
+#: config/i386/i386.c:24015
#, gcc-internal-format
msgid "the third argument must be a 8-bit immediate"
msgstr ""
-#: config/i386/i386.c:24780
+#: config/i386/i386.c:24360
#, gcc-internal-format
msgid "the last argument must be a 4-bit immediate"
msgstr ""
-#: config/i386/i386.c:24785
+#: config/i386/i386.c:24365
#, gcc-internal-format
msgid "the last argument must be a 2-bit immediate"
msgstr ""
-#: config/i386/i386.c:24794
+#: config/i386/i386.c:24374
#, gcc-internal-format
msgid "the last argument must be a 1-bit immediate"
msgstr ""
-#: config/i386/i386.c:24803
+#: config/i386/i386.c:24383
#, gcc-internal-format
msgid "the last argument must be a 5-bit immediate"
msgstr ""
-#: config/i386/i386.c:24812
+#: config/i386/i386.c:24392
#, gcc-internal-format
msgid "the next to last argument must be an 8-bit immediate"
msgstr ""
-#: config/i386/i386.c:24816 config/i386/i386.c:24994
+#: config/i386/i386.c:24396 config/i386/i386.c:24580
#, gcc-internal-format
msgid "the last argument must be an 8-bit immediate"
msgstr ""
-#: config/i386/i386.c:25052 config/rs6000/rs6000.c:8545
+#: config/i386/i386.c:24641 config/rs6000/rs6000.c:10154
#, gcc-internal-format
msgid "selector must be an integer constant in the range 0..%wi"
msgstr ""
-#: config/i386/i386.c:25195
+#: config/i386/i386.c:24784
#, gcc-internal-format
msgid "%qE needs unknown isa option"
msgstr ""
-#: config/i386/i386.c:25199
+#: config/i386/i386.c:24788
#, gcc-internal-format
msgid "%qE needs isa option %s"
msgstr ""
-#: config/i386/i386.c:26846
+#: config/i386/i386.c:26467
#, gcc-internal-format
msgid "%qE attribute only available for 64-bit"
msgstr ""
-#: config/i386/i386.c:26857 config/i386/i386.c:26866
+#: config/i386/i386.c:26478 config/i386/i386.c:26487
#, gcc-internal-format
msgid "ms_abi and sysv_abi attributes are not compatible"
msgstr ""
-#: config/i386/i386.c:26904 config/rs6000/rs6000.c:20753
+#: config/i386/i386.c:26525 config/rs6000/rs6000.c:23371
#, gcc-internal-format
msgid "%qE incompatible attribute ignored"
msgstr ""
-#: config/i386/netware.c:253
+#: config/i386/i386.c:26550
#, gcc-internal-format
-msgid "-fPIC and -fpic are not supported for this target"
+msgid "%qE attribute only available for 32-bit"
msgstr ""
-#: config/i386/winnt-cxx.c:71 config/sh/symbian.c:172
+#: config/i386/i386.c:26556
#, gcc-internal-format
-msgid "definition of static data member %q+D of dllimport'd class"
+msgid "ms_hook_prologue attribute needs assembler swap suffix support"
msgstr ""
#: config/i386/winnt.c:81
@@ -27240,17 +28188,23 @@ msgid ""
"%qE attribute applies only to initialized variables with external linkage"
msgstr ""
-#: config/i386/winnt.c:290
+#: config/i386/winnt.c:143 config/sh/symbian-c.c:96
+#: config/sh/symbian-cxx.c:120
+#, gcc-internal-format
+msgid "definition of static data member %q+D of dllimport'd class"
+msgstr ""
+
+#: config/i386/winnt.c:292
#, gcc-internal-format
msgid "%q+D:'selectany' attribute applies only to initialized objects"
msgstr ""
-#: config/i386/winnt.c:447
+#: config/i386/winnt.c:440
#, gcc-internal-format
msgid "%q+D causes a section type conflict"
msgstr ""
-#: config/i386/cygming.h:150
+#: config/i386/cygming.h:151
#, gcc-internal-format
msgid "-f%s ignored for target (all code is position independent)"
msgstr ""
@@ -27265,94 +28219,101 @@ msgstr ""
msgid "ms-bitfields not supported for objc"
msgstr ""
+#. Don't allow flag_pic to propagate since invalid relocations will
+#. result otherwise.
+#: config/i386/netware.h:81
+#, gcc-internal-format
+msgid "-fPIC and -fpic are not supported for this target"
+msgstr ""
+
#: config/ia64/ia64-c.c:51
#, gcc-internal-format
msgid "malformed #pragma builtin"
msgstr ""
-#: config/ia64/ia64.c:589
+#: config/ia64/ia64.c:597
#, gcc-internal-format
msgid "invalid argument of %qE attribute"
msgstr ""
-#: config/ia64/ia64.c:601
+#: config/ia64/ia64.c:610
#, gcc-internal-format
-msgid "%Jan address area attribute cannot be specified for local variables"
+msgid "an address area attribute cannot be specified for local variables"
msgstr ""
-#: config/ia64/ia64.c:608
+#: config/ia64/ia64.c:617
#, gcc-internal-format
msgid "address area of %q+D conflicts with previous declaration"
msgstr ""
-#: config/ia64/ia64.c:615
+#: config/ia64/ia64.c:625
+#, gcc-internal-format
+msgid "address area attribute cannot be specified for functions"
+msgstr ""
+
+#: config/ia64/ia64.c:666
#, gcc-internal-format
-msgid "%Jaddress area attribute cannot be specified for functions"
+msgid "%qE attribute requires a string constant argument"
msgstr ""
-#: config/ia64/ia64.c:5174 config/pa/pa.c:355 config/sh/sh.c:7955
-#: config/spu/spu.c:4613
+#: config/ia64/ia64.c:5387 config/pa/pa.c:368 config/sh/sh.c:8473
+#: config/spu/spu.c:4706
#, gcc-internal-format
msgid "value of -mfixed-range must have form REG1-REG2"
msgstr ""
-#: config/ia64/ia64.c:5201 config/pa/pa.c:382 config/sh/sh.c:7981
-#: config/spu/spu.c:4639
+#: config/ia64/ia64.c:5414 config/pa/pa.c:395 config/sh/sh.c:8499
+#: config/spu/spu.c:4732
#, gcc-internal-format
msgid "%s-%s is an empty range"
msgstr ""
-#: config/ia64/ia64.c:5231
+#: config/ia64/ia64.c:5444
#, gcc-internal-format
msgid "bad value %<%s%> for -mtls-size= switch"
msgstr ""
-#: config/ia64/ia64.c:5260
+#: config/ia64/ia64.c:5473
#, gcc-internal-format
msgid "value %<%s%> for -mtune= switch is deprecated"
msgstr ""
-#: config/ia64/ia64.c:5262
+#: config/ia64/ia64.c:5475
#, gcc-internal-format
msgid "GCC 4.4 is the last release with Itanium1 tuning support"
msgstr ""
-#: config/ia64/ia64.c:5269
+#: config/ia64/ia64.c:5482
#, gcc-internal-format
msgid "bad value %<%s%> for -mtune= switch"
msgstr ""
-#: config/ia64/ia64.c:5288
-#, gcc-internal-format
-msgid "not yet implemented: latency-optimized inline square root"
-msgstr ""
-
-#: config/ia64/ia64.c:10557
+#: config/ia64/ia64.c:10810
#, gcc-internal-format
msgid "version attribute is not a string"
msgstr ""
-#: config/iq2000/iq2000.c:1832
+#: config/iq2000/iq2000.c:1825
#, gcc-internal-format
msgid "gp_offset (%ld) or end_offset (%ld) is less than zero"
msgstr ""
-#: config/iq2000/iq2000.c:2602
+#: config/iq2000/iq2000.c:2595
#, gcc-internal-format
msgid "argument %qd is not a constant"
msgstr ""
-#: config/iq2000/iq2000.c:2904 config/xtensa/xtensa.c:2324
+#: config/iq2000/iq2000.c:2897 config/xtensa/xtensa.c:2335
#, gcc-internal-format
msgid "PRINT_OPERAND_ADDRESS, null pointer"
msgstr ""
-#: config/iq2000/iq2000.c:3059
+#: config/iq2000/iq2000.c:3052
#, gcc-internal-format
msgid "PRINT_OPERAND: Unknown punctuation '%c'"
msgstr ""
-#: config/iq2000/iq2000.c:3068 config/xtensa/xtensa.c:2178
+#: config/iq2000/iq2000.c:3061 config/xtensa/xtensa.c:2189
#, gcc-internal-format
msgid "PRINT_OPERAND null pointer"
msgstr ""
@@ -27372,327 +28333,612 @@ msgstr ""
msgid "#pragma GCC memregs takes a number [0..16]"
msgstr ""
-#: config/m32c/m32c.c:416
+#: config/m32c/m32c.c:421
#, gcc-internal-format
msgid "invalid target memregs value '%d'"
msgstr ""
-#: config/m32c/m32c.c:2784
+#: config/m32c/m32c.c:2824
#, gcc-internal-format
msgid "%qE attribute is not supported for R8C target"
msgstr ""
-#: config/m32c/m32c.c:2792
-#, gcc-internal-format
-msgid "%qE attribute applies only to functions"
-msgstr ""
-
#. The argument must be a constant integer.
-#: config/m32c/m32c.c:2800 config/sh/sh.c:8187 config/sh/sh.c:8293
+#: config/m32c/m32c.c:2840 config/sh/sh.c:8680 config/sh/sh.c:8786
#, gcc-internal-format
msgid "%qE attribute argument not an integer constant"
msgstr ""
-#: config/m32c/m32c.c:2809
+#: config/m32c/m32c.c:2849
#, gcc-internal-format
msgid "%qE attribute argument should be between 18 to 255"
msgstr ""
-#: config/m32r/m32r.c:377
+#: config/m32c/m32c.c:3980
+#, gcc-internal-format
+msgid "%<bank_switch%> has no effect on non-interrupt functions"
+msgstr ""
+
+#: config/m32c/m32c.c:4081
+#, gcc-internal-format
+msgid "%<fast_interrupt%> attribute directive ignored"
+msgstr ""
+
+#: config/m32r/m32r.c:382
#, gcc-internal-format
msgid "invalid argument of %qs attribute"
msgstr ""
-#: config/m68hc11/m68hc11.c:279
+#: config/m68hc11/m68hc11.c:301
#, gcc-internal-format
msgid "-f%s ignored for 68HC11/68HC12 (not supported)"
msgstr ""
-#: config/m68hc11/m68hc11.c:1232
+#: config/m68hc11/m68hc11.c:1253
#, gcc-internal-format
msgid "%<trap%> and %<far%> attributes are not compatible, ignoring %<far%>"
msgstr ""
-#: config/m68hc11/m68hc11.c:1239
+#: config/m68hc11/m68hc11.c:1260
#, gcc-internal-format
msgid "%<trap%> attribute is already used"
msgstr ""
-#: config/m68k/m68k.c:550
+#: config/m68k/m68k.c:568
#, gcc-internal-format
msgid "-mcpu=%s conflicts with -march=%s"
msgstr ""
-#: config/m68k/m68k.c:621
+#: config/m68k/m68k.c:639
#, gcc-internal-format
msgid "-mpcrel -fPIC is not currently supported on selected cpu"
msgstr ""
-#: config/m68k/m68k.c:683
+#: config/m68k/m68k.c:701
#, gcc-internal-format
msgid "-falign-labels=%d is not supported"
msgstr ""
-#: config/m68k/m68k.c:688
+#: config/m68k/m68k.c:706
#, gcc-internal-format
msgid "-falign-loops=%d is not supported"
msgstr ""
-#: config/m68k/m68k.c:791
+#: config/m68k/m68k.c:809
#, gcc-internal-format
msgid "multiple interrupt attributes not allowed"
msgstr ""
-#: config/m68k/m68k.c:798
+#: config/m68k/m68k.c:816
#, gcc-internal-format
msgid "interrupt_thread is available only on fido"
msgstr ""
-#: config/m68k/m68k.c:1120 config/rs6000/rs6000.c:15600
+#: config/m68k/m68k.c:1145 config/rs6000/rs6000.c:17877
#, gcc-internal-format
msgid "stack limit expression is not supported"
msgstr ""
-#: config/mips/mips.c:1283 config/mips/mips.c:1285
+#: config/mep/mep-pragma.c:65
+#, gcc-internal-format
+msgid "junk at end of #pragma io_volatile"
+msgstr ""
+
+#: config/mep/mep-pragma.c:79
+#, gcc-internal-format
+msgid "#pragma io_volatile takes only on or off"
+msgstr ""
+
+#: config/mep/mep-pragma.c:118
+#, gcc-internal-format
+msgid "invalid coprocessor register range"
+msgstr ""
+
+#: config/mep/mep-pragma.c:138
+#, gcc-internal-format
+msgid "invalid coprocessor register %qE"
+msgstr ""
+
+#: config/mep/mep-pragma.c:161
+#, gcc-internal-format
+msgid "malformed coprocessor register"
+msgstr ""
+
+#: config/mep/mep-pragma.c:248
+#, gcc-internal-format
+msgid "junk at end of #pragma GCC coprocessor width"
+msgstr ""
+
+#: config/mep/mep-pragma.c:255
+#, gcc-internal-format
+msgid "#pragma GCC coprocessor width takes only 32 or 64"
+msgstr ""
+
+#: config/mep/mep-pragma.c:275
+#, gcc-internal-format
+msgid "#pragma GCC coprocessor subclass letter must be in [ABCD]"
+msgstr ""
+
+#: config/mep/mep-pragma.c:280
+#, gcc-internal-format
+msgid "#pragma GCC coprocessor subclass '%c' already defined"
+msgstr ""
+
+#: config/mep/mep-pragma.c:298
+#, gcc-internal-format
+msgid "malformed #pragma GCC coprocessor subclass"
+msgstr ""
+
+#: config/mep/mep-pragma.c:320
+#, gcc-internal-format
+msgid "malformed #pragma disinterrupt"
+msgstr ""
+
+#: config/mep/mep-pragma.c:334
+#, gcc-internal-format
+msgid "malformed #pragma GCC coprocessor"
+msgstr ""
+
+#: config/mep/mep-pragma.c:339
+#, gcc-internal-format
+msgid "coprocessor not enabled"
+msgstr ""
+
+#: config/mep/mep-pragma.c:350
+#, gcc-internal-format
+msgid "unknown #pragma GCC coprocessor %E"
+msgstr ""
+
+#: config/mep/mep-pragma.c:372
+#, gcc-internal-format
+msgid "malformed #pragma call"
+msgstr ""
+
+#: config/mep/mep.c:388
+#, gcc-internal-format
+msgid "-fpic is not supported"
+msgstr ""
+
+#: config/mep/mep.c:390
+#, gcc-internal-format
+msgid "-fPIC is not supported"
+msgstr ""
+
+#: config/mep/mep.c:392
+#, gcc-internal-format
+msgid "only one of -ms and -mm may be given"
+msgstr ""
+
+#: config/mep/mep.c:394
+#, gcc-internal-format
+msgid "only one of -ms and -ml may be given"
+msgstr ""
+
+#: config/mep/mep.c:396
+#, gcc-internal-format
+msgid "only one of -mm and -ml may be given"
+msgstr ""
+
+#: config/mep/mep.c:398
+#, gcc-internal-format
+msgid "only one of -ms and -mtiny= may be given"
+msgstr ""
+
+#: config/mep/mep.c:400
+#, gcc-internal-format
+msgid "only one of -mm and -mtiny= may be given"
+msgstr ""
+
+#: config/mep/mep.c:402
+#, gcc-internal-format
+msgid "-mclip currently has no effect without -mminmax"
+msgstr ""
+
+#: config/mep/mep.c:409
+#, gcc-internal-format
+msgid "-mc= must be -mc=tiny, -mc=near, or -mc=far"
+msgstr ""
+
+#: config/mep/mep.c:1534
+#, gcc-internal-format
+msgid "unusual TP-relative address"
+msgstr ""
+
+#: config/mep/mep.c:3530
+#, gcc-internal-format
+msgid "unconvertible operand %c %qs"
+msgstr ""
+
+#: config/mep/mep.c:3972 config/mep/mep.c:4035
+#, gcc-internal-format
+msgid "address region attributes not allowed with auto storage class"
+msgstr ""
+
+#: config/mep/mep.c:3978 config/mep/mep.c:4041
+#, gcc-internal-format
+msgid "address region attributes on pointed-to types ignored"
+msgstr ""
+
+#: config/mep/mep.c:4027
+#, gcc-internal-format
+msgid "%qE attribute only applies to variables and functions"
+msgstr ""
+
+#: config/mep/mep.c:4047 config/mep/mep.c:4335
+#, gcc-internal-format
+msgid "duplicate address region attribute %qE in declaration of %qE on line %d"
+msgstr ""
+
+#: config/mep/mep.c:4081
+#, gcc-internal-format
+msgid "cannot inline interrupt function %qE"
+msgstr ""
+
+#: config/mep/mep.c:4087
+#, gcc-internal-format
+msgid "interrupt function must have return type of void"
+msgstr ""
+
+#: config/mep/mep.c:4092
+#, gcc-internal-format
+msgid "interrupt function must have no arguments"
+msgstr ""
+
+#: config/mep/mep.c:4113
+#, gcc-internal-format
+msgid "%qE attribute allows only an integer constant argument"
+msgstr ""
+
+#: config/mep/mep.c:4146
+#, gcc-internal-format
+msgid "%qE attribute only applies to functions, not %s"
+msgstr ""
+
+#: config/mep/mep.c:4156
+#, gcc-internal-format
+msgid "To describe a pointer to a VLIW function, use syntax like this:"
+msgstr ""
+
+#: config/mep/mep.c:4157
+#, gcc-internal-format
+msgid " typedef int (__vliw *vfuncptr) ();"
+msgstr ""
+
+#: config/mep/mep.c:4164
+#, gcc-internal-format
+msgid "To describe an array of VLIW function pointers, use syntax like this:"
+msgstr ""
+
+#: config/mep/mep.c:4165
+#, gcc-internal-format
+msgid " typedef int (__vliw *vfuncptr[]) ();"
+msgstr ""
+
+#: config/mep/mep.c:4170
+#, gcc-internal-format
+msgid "VLIW functions are not allowed without a VLIW configuration"
+msgstr ""
+
+#: config/mep/mep.c:4318
+#, gcc-internal-format
+msgid "\"#pragma disinterrupt %s\" not used"
+msgstr ""
+
+#: config/mep/mep.c:4460
+#, gcc-internal-format
+msgid "__io address 0x%x is the same for %qE and %qE"
+msgstr ""
+
+#: config/mep/mep.c:4608
+#, gcc-internal-format
+msgid "variable %s (%ld bytes) is too large for the %s section (%d bytes)"
+msgstr ""
+
+#: config/mep/mep.c:4706
+#, gcc-internal-format
+msgid "variable %D of type %<io%> must be uninitialized"
+msgstr ""
+
+#: config/mep/mep.c:4711
+#, gcc-internal-format
+msgid "variable %D of type %<cb%> must be uninitialized"
+msgstr ""
+
+#: config/mep/mep.c:6164
+#, gcc-internal-format
+msgid "coprocessor intrinsic %qs is not available in this configuration"
+msgstr ""
+
+#: config/mep/mep.c:6167
+#, gcc-internal-format
+msgid "%qs is not available in VLIW functions"
+msgstr ""
+
+#: config/mep/mep.c:6170
+#, gcc-internal-format
+msgid "%qs is not available in non-VLIW functions"
+msgstr ""
+
+#: config/mep/mep.c:6332 config/mep/mep.c:6450
+#, gcc-internal-format
+msgid "argument %d of %qE must be in the range %d...%d"
+msgstr ""
+
+#: config/mep/mep.c:6335
+#, gcc-internal-format
+msgid "argument %d of %qE must be a multiple of %d"
+msgstr ""
+
+#: config/mep/mep.c:6389
+#, gcc-internal-format
+msgid "too few arguments to %qE"
+msgstr ""
+
+#: config/mep/mep.c:6394
+#, gcc-internal-format
+msgid "too many arguments to %qE"
+msgstr ""
+
+#: config/mep/mep.c:6412
+#, gcc-internal-format
+msgid "argument %d of %qE must be an address"
+msgstr ""
+
+#: config/mep/mep.c:7208
+#, gcc-internal-format
+msgid "2 byte cop instructions are not allowed in 64-bit VLIW mode"
+msgstr ""
+
+#: config/mep/mep.c:7214
+#, gcc-internal-format
+msgid "unexpected %d byte cop instruction"
+msgstr ""
+
+#: config/mips/mips.c:1340 config/mips/mips.c:1342
#, gcc-internal-format
msgid "%qs attribute only applies to functions"
msgstr ""
-#: config/mips/mips.c:1295
+#: config/mips/mips.c:1352
#, gcc-internal-format
msgid "%qE cannot have both %<mips16%> and %<nomips16%> attributes"
msgstr ""
-#: config/mips/mips.c:1317 config/mips/mips.c:1320
+#: config/mips/mips.c:1374 config/mips/mips.c:1377
#, gcc-internal-format
msgid "%qE redeclared with conflicting %qs attributes"
msgstr ""
-#: config/mips/mips.c:2780
+#: config/mips/mips.c:2870
#, gcc-internal-format
msgid "MIPS16 TLS"
msgstr ""
-#: config/mips/mips.c:6116
+#: config/mips/mips.c:6345
#, gcc-internal-format
msgid "cannot handle inconsistent calls to %qs"
msgstr ""
-#: config/mips/mips.c:8719
+#: config/mips/mips.c:9127
#, gcc-internal-format
msgid "the %<interrupt%> attribute requires a MIPS32r2 processor"
msgstr ""
-#: config/mips/mips.c:8721
+#: config/mips/mips.c:9129
#, gcc-internal-format
msgid "the %<interrupt%> attribute requires %<-msoft-float%>"
msgstr ""
-#: config/mips/mips.c:8723
+#: config/mips/mips.c:9131
#, gcc-internal-format
msgid "interrupt handlers cannot be MIPS16 functions"
msgstr ""
-#: config/mips/mips.c:12134
+#: config/mips/mips.c:13034
#, gcc-internal-format
msgid "invalid argument to built-in function"
msgstr ""
-#: config/mips/mips.c:12375
+#: config/mips/mips.c:13275
#, gcc-internal-format
msgid "built-in function %qE not supported for MIPS16"
msgstr ""
-#: config/mips/mips.c:12953
+#: config/mips/mips.c:13865
#, gcc-internal-format
msgid "%qs does not support MIPS16 code"
msgstr ""
-#: config/mips/mips.c:13927
+#: config/mips/mips.c:15069
#, gcc-internal-format
msgid "MIPS16 PIC for ABIs other than o32 and o64"
msgstr ""
-#: config/mips/mips.c:13930
+#: config/mips/mips.c:15072
#, gcc-internal-format
msgid "MIPS16 -mxgot code"
msgstr ""
-#: config/mips/mips.c:13933
+#: config/mips/mips.c:15075
#, gcc-internal-format
msgid "hard-float MIPS16 code for ABIs other than o32 and o64"
msgstr ""
-#: config/mips/mips.c:14062
+#: config/mips/mips.c:15206
#, gcc-internal-format
msgid "CPU names must be lower case"
msgstr ""
-#: config/mips/mips.c:14205
+#: config/mips/mips.c:15349
#, gcc-internal-format
msgid ""
"%<-%s%> conflicts with the other architecture options, which specify a %s "
"processor"
msgstr ""
-#: config/mips/mips.c:14221
+#: config/mips/mips.c:15365
#, gcc-internal-format
msgid "%<-march=%s%> is not compatible with the selected ABI"
msgstr ""
-#: config/mips/mips.c:14236
+#: config/mips/mips.c:15380
#, gcc-internal-format
msgid "%<-mgp64%> used with a 32-bit processor"
msgstr ""
-#: config/mips/mips.c:14238
+#: config/mips/mips.c:15382
#, gcc-internal-format
msgid "%<-mgp32%> used with a 64-bit ABI"
msgstr ""
-#: config/mips/mips.c:14240
+#: config/mips/mips.c:15384
#, gcc-internal-format
msgid "%<-mgp64%> used with a 32-bit ABI"
msgstr ""
-#: config/mips/mips.c:14256 config/mips/mips.c:14258 config/mips/mips.c:14325
+#: config/mips/mips.c:15400 config/mips/mips.c:15402 config/mips/mips.c:15469
#, gcc-internal-format
msgid "unsupported combination: %s"
msgstr ""
-#: config/mips/mips.c:14262
+#: config/mips/mips.c:15406
#, gcc-internal-format
msgid ""
"%<-mgp32%> and %<-mfp64%> can only be combined if the target supports the "
"mfhc1 and mthc1 instructions"
msgstr ""
-#: config/mips/mips.c:14265
+#: config/mips/mips.c:15409
#, gcc-internal-format
msgid "%<-mgp32%> and %<-mfp64%> can only be combined when using the o32 ABI"
msgstr ""
-#: config/mips/mips.c:14319
+#: config/mips/mips.c:15463
#, gcc-internal-format
msgid "the %qs architecture does not support branch-likely instructions"
msgstr ""
-#: config/mips/mips.c:14359
+#: config/mips/mips.c:15503
#, gcc-internal-format
msgid "%<-mno-gpopt%> needs %<-mexplicit-relocs%>"
msgstr ""
-#: config/mips/mips.c:14367 config/mips/mips.c:14370
+#: config/mips/mips.c:15511 config/mips/mips.c:15514
#, gcc-internal-format
msgid "cannot use small-data accesses for %qs"
msgstr ""
-#: config/mips/mips.c:14384
+#: config/mips/mips.c:15528
#, gcc-internal-format
msgid "%<-mips3d%> requires %<-mpaired-single%>"
msgstr ""
-#: config/mips/mips.c:14393
+#: config/mips/mips.c:15537
#, gcc-internal-format
msgid "%qs must be used with %qs"
msgstr ""
-#: config/mips/mips.c:14400
+#: config/mips/mips.c:15544
#, gcc-internal-format
msgid "the %qs architecture does not support paired-single instructions"
msgstr ""
-#: config/mips/mips.c:14406
+#: config/mips/mips.c:15550
#, gcc-internal-format
msgid "%qs requires a target that provides the %qs instruction"
msgstr ""
-#: config/mips/mips.c:14506
+#: config/mips/mips.c:15655
#, gcc-internal-format
msgid "%qs requires branch-likely instructions"
msgstr ""
+#: config/mips/mips.c:15659
+#, gcc-internal-format
+msgid "the %qs architecture does not support the synci instruction"
+msgstr ""
+
#. Output assembler code to FILE to increment profiler label # LABELNO
#. for profiling a function entry.
-#: config/mips/mips.h:2335
+#: config/mips/mips.h:2378
#, gcc-internal-format
msgid "mips16 function profiling"
msgstr ""
-#: config/mmix/mmix.c:226
+#: config/mmix/mmix.c:239
#, gcc-internal-format
msgid "-f%s not supported: ignored"
msgstr ""
-#: config/mmix/mmix.c:674
+#: config/mmix/mmix.c:687
#, gcc-internal-format
msgid "support for mode %qs"
msgstr ""
-#: config/mmix/mmix.c:688
+#: config/mmix/mmix.c:701
#, gcc-internal-format
msgid ""
"too large function value type, needs %d registers, have only %d registers "
"for this"
msgstr ""
-#: config/mmix/mmix.c:858
+#: config/mmix/mmix.c:871
#, gcc-internal-format
msgid "function_profiler support for MMIX"
msgstr ""
-#: config/mmix/mmix.c:880
+#: config/mmix/mmix.c:893
#, gcc-internal-format
msgid "MMIX Internal: Last named vararg would not fit in a register"
msgstr ""
-#: config/mmix/mmix.c:1492 config/mmix/mmix.c:1516 config/mmix/mmix.c:1632
+#: config/mmix/mmix.c:1502 config/mmix/mmix.c:1526 config/mmix/mmix.c:1642
#, gcc-internal-format
msgid "MMIX Internal: Bad register: %d"
msgstr ""
#. Presumably there's a missing case above if we get here.
-#: config/mmix/mmix.c:1624
+#: config/mmix/mmix.c:1634
#, gcc-internal-format
msgid "MMIX Internal: Missing %qc case in mmix_print_operand"
msgstr ""
-#: config/mmix/mmix.c:1910
+#: config/mmix/mmix.c:1920
#, gcc-internal-format
msgid "stack frame not a multiple of 8 bytes: %wd"
msgstr ""
-#: config/mmix/mmix.c:2146
+#: config/mmix/mmix.c:2156
#, gcc-internal-format
msgid "stack frame not a multiple of octabyte: %wd"
msgstr ""
-#: config/mmix/mmix.c:2486 config/mmix/mmix.c:2550
+#: config/mmix/mmix.c:2440 config/mmix/mmix.c:2504
#, gcc-internal-format
msgid "MMIX Internal: %s is not a shiftable int"
msgstr ""
-#: config/pa/pa.c:487
+#: config/pa/pa.c:500
#, gcc-internal-format
msgid "PIC code generation is not supported in the portable runtime model"
msgstr ""
-#: config/pa/pa.c:492
+#: config/pa/pa.c:505
#, gcc-internal-format
msgid "PIC code generation is not compatible with fast indirect calls"
msgstr ""
-#: config/pa/pa.c:497
+#: config/pa/pa.c:510
#, gcc-internal-format
msgid "-g is only supported when using GAS on this processor,"
msgstr ""
-#: config/pa/pa.c:498
+#: config/pa/pa.c:511
#, gcc-internal-format
msgid "-g option disabled"
msgstr ""
-#: config/pa/pa.c:8380
+#: config/pa/pa.c:8463
#, gcc-internal-format
msgid ""
"alignment (%u) for %s exceeds maximum alignment for global common data. "
@@ -27704,93 +28950,93 @@ msgstr ""
msgid "-munix=98 option required for C89 Amendment 1 features.\n"
msgstr ""
-#: config/picochip/picochip.c:379
+#: config/picochip/picochip.c:383
#, gcc-internal-format
msgid "invalid AE type specified (%s)\n"
msgstr ""
-#: config/picochip/picochip.c:402
+#: config/picochip/picochip.c:406
#, gcc-internal-format
msgid "Invalid mul type specified (%s) - expected mac, mul or none"
msgstr ""
-#: config/picochip/picochip.c:634
+#: config/picochip/picochip.c:638
#, gcc-internal-format
msgid "unexpected mode %s encountered in picochip_emit_save_register\n"
msgstr ""
-#: config/picochip/picochip.c:801
+#: config/picochip/picochip.c:805
#, gcc-internal-format
msgid "Defaulting to stack for %s register creation\n"
msgstr ""
-#: config/picochip/picochip.c:1338
+#: config/picochip/picochip.c:1342
#, gcc-internal-format
msgid "LCFI labels have already been deferred."
msgstr ""
-#: config/picochip/picochip.c:1401
+#: config/picochip/picochip.c:1405
#, gcc-internal-format
msgid "LM label has already been deferred."
msgstr ""
-#: config/picochip/picochip.c:1681
+#: config/picochip/picochip.c:1685
#, gcc-internal-format
msgid "picochip_asm_output_opcode - Found multiple lines in VLIW packet %s\n"
msgstr ""
-#: config/picochip/picochip.c:1784
+#: config/picochip/picochip.c:1788
#, gcc-internal-format
msgid "picochip_asm_output_opcode - can't output unknown operator %c\n"
msgstr ""
-#: config/picochip/picochip.c:2036 config/picochip/picochip.c:2095
+#: config/picochip/picochip.c:2040 config/picochip/picochip.c:2099
#, gcc-internal-format
msgid "%s: At least one operand can't be handled"
msgstr ""
-#: config/picochip/picochip.c:2176
+#: config/picochip/picochip.c:2180
#, gcc-internal-format
msgid "Unknown short branch in %s (type %d)\n"
msgstr ""
-#: config/picochip/picochip.c:2213
+#: config/picochip/picochip.c:2217
#, gcc-internal-format
msgid "Unknown long branch in %s (type %d)\n"
msgstr ""
-#: config/picochip/picochip.c:2253 config/picochip/picochip.c:2321
+#: config/picochip/picochip.c:2257 config/picochip/picochip.c:2325
#, gcc-internal-format
msgid "PUT uses port array index %d, which is out of range [%d..%d)"
msgstr ""
-#: config/picochip/picochip.c:2287
+#: config/picochip/picochip.c:2291
#, gcc-internal-format
msgid "GET uses port array index %d, which is out of range [%d..%d)"
msgstr ""
-#: config/picochip/picochip.c:3130
+#: config/picochip/picochip.c:3134
#, gcc-internal-format
msgid "Too many ALU instructions emitted (%d)\n"
msgstr ""
-#: config/picochip/picochip.c:3761 config/picochip/picochip.c:3854
+#: config/picochip/picochip.c:3765 config/picochip/picochip.c:3858
#, gcc-internal-format
msgid "%s: Second source operand is not a constant"
msgstr ""
-#: config/picochip/picochip.c:3764 config/picochip/picochip.c:3815
-#: config/picochip/picochip.c:3857
+#: config/picochip/picochip.c:3768 config/picochip/picochip.c:3819
+#: config/picochip/picochip.c:3861
#, gcc-internal-format
msgid "%s: Third source operand is not a constant"
msgstr ""
-#: config/picochip/picochip.c:3818
+#: config/picochip/picochip.c:3822
#, gcc-internal-format
msgid "%s: Fourth source operand is not a constant"
msgstr ""
-#: config/picochip/picochip.c:4128
+#: config/picochip/picochip.c:4132
#, gcc-internal-format
msgid "%s (disable warning using -mno-inefficient-warnings)"
msgstr ""
@@ -27854,298 +29100,336 @@ msgstr ""
msgid "junk at end of #pragma longcall"
msgstr ""
-#: config/rs6000/rs6000-c.c:3023
+#: config/rs6000/rs6000-c.c:3238
#, gcc-internal-format
msgid "%s only accepts %d arguments"
msgstr ""
-#: config/rs6000/rs6000-c.c:3028
+#: config/rs6000/rs6000-c.c:3243
#, gcc-internal-format
msgid "%s only accepts 1 argument"
msgstr ""
-#: config/rs6000/rs6000-c.c:3033
+#: config/rs6000/rs6000-c.c:3248
#, gcc-internal-format
msgid "%s only accepts 2 arguments"
msgstr ""
-#: config/rs6000/rs6000-c.c:3094
+#: config/rs6000/rs6000-c.c:3313
#, gcc-internal-format
msgid "vec_extract only accepts 2 arguments"
msgstr ""
-#: config/rs6000/rs6000-c.c:3149
+#: config/rs6000/rs6000-c.c:3389
#, gcc-internal-format
msgid "vec_insert only accepts 3 arguments"
msgstr ""
-#: config/rs6000/rs6000-c.c:3231
+#: config/rs6000/rs6000-c.c:3492
#, gcc-internal-format
msgid "passing arg %d of %qE discards qualifiers frompointer target type"
msgstr ""
-#: config/rs6000/rs6000-c.c:3274
+#: config/rs6000/rs6000-c.c:3535
#, gcc-internal-format
msgid "invalid parameter combination for AltiVec intrinsic"
msgstr ""
-#: config/rs6000/rs6000.c:1372
+#: config/rs6000/rs6000.c:2088
#, gcc-internal-format
msgid "-mdynamic-no-pic overrides -fpic or -fPIC"
msgstr ""
-#: config/rs6000/rs6000.c:1383
+#: config/rs6000/rs6000.c:2099
#, gcc-internal-format
msgid "-m64 requires PowerPC64 architecture, enabling"
msgstr ""
-#: config/rs6000/rs6000.c:1604
+#: config/rs6000/rs6000.c:2342
#, gcc-internal-format
msgid "AltiVec not supported in this target"
msgstr ""
-#: config/rs6000/rs6000.c:1606
+#: config/rs6000/rs6000.c:2344
#, gcc-internal-format
msgid "Spe not supported in this target"
msgstr ""
-#: config/rs6000/rs6000.c:1633
+#: config/rs6000/rs6000.c:2371
#, gcc-internal-format
msgid "-mmultiple is not supported on little endian systems"
msgstr ""
-#: config/rs6000/rs6000.c:1640
+#: config/rs6000/rs6000.c:2378
#, gcc-internal-format
msgid "-mstring is not supported on little endian systems"
msgstr ""
-#: config/rs6000/rs6000.c:1654
+#: config/rs6000/rs6000.c:2432
#, gcc-internal-format
msgid "unknown -mdebug-%s switch"
msgstr ""
-#: config/rs6000/rs6000.c:1666
+#: config/rs6000/rs6000.c:2472
#, gcc-internal-format
msgid ""
"unknown -mtraceback arg %qs; expecting %<full%>, %<partial%> or %<none%>"
msgstr ""
-#: config/rs6000/rs6000.c:2177
+#: config/rs6000/rs6000.c:3086
#, gcc-internal-format
msgid "unknown -m%s= option specified: '%s'"
msgstr ""
-#: config/rs6000/rs6000.c:2223
+#: config/rs6000/rs6000.c:3132
#, gcc-internal-format
msgid "unknown value %s for -mfpu"
msgstr ""
-#: config/rs6000/rs6000.c:2421
+#: config/rs6000/rs6000.c:3461
#, gcc-internal-format
msgid "not configured for ABI: '%s'"
msgstr ""
-#: config/rs6000/rs6000.c:2434
+#: config/rs6000/rs6000.c:3474
#, gcc-internal-format
msgid "Using darwin64 ABI"
msgstr ""
-#: config/rs6000/rs6000.c:2439
+#: config/rs6000/rs6000.c:3479
#, gcc-internal-format
msgid "Using old darwin ABI"
msgstr ""
-#: config/rs6000/rs6000.c:2446
+#: config/rs6000/rs6000.c:3486
#, gcc-internal-format
msgid "Using IBM extended precision long double"
msgstr ""
-#: config/rs6000/rs6000.c:2452
+#: config/rs6000/rs6000.c:3492
#, gcc-internal-format
msgid "Using IEEE extended precision long double"
msgstr ""
-#: config/rs6000/rs6000.c:2457
+#: config/rs6000/rs6000.c:3497
#, gcc-internal-format
msgid "unknown ABI specified: '%s'"
msgstr ""
-#: config/rs6000/rs6000.c:2484
+#: config/rs6000/rs6000.c:3524
#, gcc-internal-format
msgid "invalid option for -mfloat-gprs: '%s'"
msgstr ""
-#: config/rs6000/rs6000.c:2494
+#: config/rs6000/rs6000.c:3534
#, gcc-internal-format
msgid "Unknown switch -mlong-double-%s"
msgstr ""
-#: config/rs6000/rs6000.c:2515
+#: config/rs6000/rs6000.c:3555
#, gcc-internal-format
msgid ""
"-malign-power is not supported for 64-bit Darwin; it is incompatible with "
"the installed C and C++ libraries"
msgstr ""
-#: config/rs6000/rs6000.c:2523
+#: config/rs6000/rs6000.c:3563
#, gcc-internal-format
msgid "unknown -malign-XXXXX option specified: '%s'"
msgstr ""
-#: config/rs6000/rs6000.c:2530
+#: config/rs6000/rs6000.c:3570
#, gcc-internal-format
msgid "-msingle-float option equivalent to -mhard-float"
msgstr ""
-#: config/rs6000/rs6000.c:2546
+#: config/rs6000/rs6000.c:3586
#, gcc-internal-format
msgid "-msimple-fpu option ignored"
msgstr ""
-#: config/rs6000/rs6000.c:5382
+#: config/rs6000/rs6000.c:6698
#, gcc-internal-format
msgid ""
"GCC vector returned by reference: non-standard ABI extension with no "
"compatibility guarantee"
msgstr ""
-#: config/rs6000/rs6000.c:5455
+#: config/rs6000/rs6000.c:6771
#, gcc-internal-format
msgid ""
"cannot return value in vector register because altivec instructions are "
"disabled, use -maltivec to enable them"
msgstr ""
-#: config/rs6000/rs6000.c:5713
+#: config/rs6000/rs6000.c:7030
#, gcc-internal-format
msgid ""
"cannot pass argument in vector register because altivec instructions are "
"disabled, use -maltivec to enable them"
msgstr ""
-#: config/rs6000/rs6000.c:6614
+#: config/rs6000/rs6000.c:7932
#, gcc-internal-format
msgid ""
"GCC vector passed by reference: non-standard ABI extension with no "
"compatibility guarantee"
msgstr ""
-#: config/rs6000/rs6000.c:7873
+#: config/rs6000/rs6000.c:8514
+#, gcc-internal-format
+msgid "internal error: builtin function to %s already processed."
+msgstr ""
+
+#: config/rs6000/rs6000.c:9449
#, gcc-internal-format
msgid "argument 1 must be a 5-bit signed literal"
msgstr ""
-#: config/rs6000/rs6000.c:7976 config/rs6000/rs6000.c:8908
+#: config/rs6000/rs6000.c:9552 config/rs6000/rs6000.c:10524
#, gcc-internal-format
msgid "argument 2 must be a 5-bit unsigned literal"
msgstr ""
-#: config/rs6000/rs6000.c:8016
+#: config/rs6000/rs6000.c:9591
#, gcc-internal-format
msgid "argument 1 of __builtin_altivec_predicate must be a constant"
msgstr ""
-#: config/rs6000/rs6000.c:8069
+#: config/rs6000/rs6000.c:9643
#, gcc-internal-format
msgid "argument 1 of __builtin_altivec_predicate is out of range"
msgstr ""
-#: config/rs6000/rs6000.c:8318
+#: config/rs6000/rs6000.c:9893
#, gcc-internal-format
msgid "argument 3 must be a 4-bit unsigned literal"
msgstr ""
-#: config/rs6000/rs6000.c:8490
+#: config/rs6000/rs6000.c:9911
+#, gcc-internal-format
+msgid "argument 3 must be a 2-bit unsigned literal"
+msgstr ""
+
+#: config/rs6000/rs6000.c:9923
+#, gcc-internal-format
+msgid "argument 3 must be a 1-bit unsigned literal"
+msgstr ""
+
+#: config/rs6000/rs6000.c:10099
#, gcc-internal-format
msgid "argument to %qs must be a 2-bit unsigned literal"
msgstr ""
-#: config/rs6000/rs6000.c:8632
+#: config/rs6000/rs6000.c:10243
#, gcc-internal-format
msgid "unresolved overload for Altivec builtin %qF"
msgstr ""
-#: config/rs6000/rs6000.c:8723
+#: config/rs6000/rs6000.c:10334
#, gcc-internal-format
msgid "argument to dss must be a 2-bit unsigned literal"
msgstr ""
-#: config/rs6000/rs6000.c:9028
+#: config/rs6000/rs6000.c:10644
#, gcc-internal-format
msgid "argument 1 of __builtin_paired_predicate must be a constant"
msgstr ""
-#: config/rs6000/rs6000.c:9075
+#: config/rs6000/rs6000.c:10691
#, gcc-internal-format
msgid "argument 1 of __builtin_paired_predicate is out of range"
msgstr ""
-#: config/rs6000/rs6000.c:9100
+#: config/rs6000/rs6000.c:10716
#, gcc-internal-format
msgid "argument 1 of __builtin_spe_predicate must be a constant"
msgstr ""
-#: config/rs6000/rs6000.c:9172
+#: config/rs6000/rs6000.c:10788
#, gcc-internal-format
msgid "argument 1 of __builtin_spe_predicate is out of range"
msgstr ""
-#: config/rs6000/rs6000.c:15563
+#: config/rs6000/rs6000.c:12134
#, gcc-internal-format
-msgid "stack frame too large"
+msgid "internal error: builtin function %s had no type"
msgstr ""
-#: config/rs6000/rs6000.c:18606
+#: config/rs6000/rs6000.c:12141
#, gcc-internal-format
-msgid "no profiling of 64-bit code for this ABI"
+msgid "internal error: builtin function %s had an unexpected return type %s"
msgstr ""
-#: config/rs6000/rs6000.c:20555
+#: config/rs6000/rs6000.c:12154
#, gcc-internal-format
-msgid "use of %<long%> in AltiVec types is invalid for 64-bit code"
+msgid ""
+"internal error: builtin function %s, argument %d had unexpected argument "
+"type %s"
msgstr ""
-#: config/rs6000/rs6000.c:20557
+#: config/rs6000/rs6000.c:17847
#, gcc-internal-format
-msgid "use of %<long%> in AltiVec types is deprecated; use %<int%>"
+msgid "stack frame too large"
msgstr ""
-#: config/rs6000/rs6000.c:20561
+#: config/rs6000/rs6000.c:18243
#, gcc-internal-format
-msgid "use of %<long long%> in AltiVec types is invalid"
+msgid "Out-of-line save/restore routines not supported on Darwin"
msgstr ""
-#: config/rs6000/rs6000.c:20563
+#: config/rs6000/rs6000.c:21138
#, gcc-internal-format
-msgid "use of %<double%> in AltiVec types is invalid"
+msgid "no profiling of 64-bit code for this ABI"
msgstr ""
-#: config/rs6000/rs6000.c:20565
+#: config/rs6000/rs6000.c:23158
#, gcc-internal-format
msgid "use of %<long double%> in AltiVec types is invalid"
msgstr ""
-#: config/rs6000/rs6000.c:20567
+#: config/rs6000/rs6000.c:23160
#, gcc-internal-format
msgid "use of boolean types in AltiVec types is invalid"
msgstr ""
-#: config/rs6000/rs6000.c:20569
+#: config/rs6000/rs6000.c:23162
#, gcc-internal-format
msgid "use of %<complex%> in AltiVec types is invalid"
msgstr ""
-#: config/rs6000/rs6000.c:20571
+#: config/rs6000/rs6000.c:23164
#, gcc-internal-format
msgid "use of decimal floating point types in AltiVec types is invalid"
msgstr ""
-#: config/rs6000/rs6000.c:22861
+#: config/rs6000/rs6000.c:23170
+#, gcc-internal-format
+msgid ""
+"use of %<long%> in AltiVec types is invalid for 64-bit code without -mvsx"
+msgstr ""
+
+#: config/rs6000/rs6000.c:23173
+#, gcc-internal-format
+msgid "use of %<long%> in AltiVec types is deprecated; use %<int%>"
+msgstr ""
+
+#: config/rs6000/rs6000.c:23178
+#, gcc-internal-format
+msgid "use of %<long long%> in AltiVec types is invalid without -mvsx"
+msgstr ""
+
+#: config/rs6000/rs6000.c:23181
+#, gcc-internal-format
+msgid "use of %<double%> in AltiVec types is invalid without -mvsx"
+msgstr ""
+
+#: config/rs6000/rs6000.c:25577
#, gcc-internal-format
msgid "emitting microcode insn %s\t[%s] #%d"
msgstr ""
-#: config/rs6000/rs6000.c:22865
+#: config/rs6000/rs6000.c:25581
#, gcc-internal-format
msgid "emitting conditional microcode insn %s\t[%s] #%d"
msgstr ""
@@ -28175,17 +29459,22 @@ msgid ""
"-maix64 required: 64-bit computation with 32-bit addressing not yet supported"
msgstr ""
-#: config/rs6000/e500.h:39
+#: config/rs6000/e500.h:40
#, gcc-internal-format
msgid "AltiVec and E500 instructions cannot coexist"
msgstr ""
-#: config/rs6000/e500.h:41
+#: config/rs6000/e500.h:42
+#, gcc-internal-format
+msgid "VSX and E500 instructions cannot coexist"
+msgstr ""
+
+#: config/rs6000/e500.h:44
#, gcc-internal-format
msgid "64-bit E500 not supported"
msgstr ""
-#: config/rs6000/e500.h:43
+#: config/rs6000/e500.h:46
#, gcc-internal-format
msgid "E500 and FPRs not supported"
msgstr ""
@@ -28212,7 +29501,7 @@ msgstr ""
#. Number of bytes into the frame return addresses can be found. See
#. rs6000_stack_info in rs6000.c for more information on how the different
#. abi's store the return address.
-#: config/rs6000/rs6000.h:1641
+#: config/rs6000/rs6000.h:1756
#, gcc-internal-format
msgid "RETURN_ADDRESS_OFFSET not supported"
msgstr ""
@@ -28337,118 +29626,121 @@ msgstr ""
msgid "-mstack-guard implies use of -mstack-size"
msgstr ""
-#: config/s390/s390.c:7065
+#: config/s390/s390.c:7088
#, gcc-internal-format
msgid "total size of local variables exceeds architecture limit"
msgstr ""
-#: config/s390/s390.c:7734
+#: config/s390/s390.c:7786
#, gcc-internal-format
msgid "frame size of function %qs is "
msgstr ""
-#: config/s390/s390.c:7764
+#: config/s390/s390.c:7812
#, gcc-internal-format
msgid "frame size of %qs is "
msgstr ""
-#: config/s390/s390.c:7768
+#: config/s390/s390.c:7816
#, gcc-internal-format
msgid "%qs uses dynamic stack allocation"
msgstr ""
-#: config/score/score3.c:653 config/score/score7.c:652
+#: config/score/score3.c:649 config/score/score7.c:648
#, gcc-internal-format
msgid "-fPIC and -G are incompatible"
msgstr ""
-#: config/sh/sh.c:6954
+#: config/sh/sh.c:881
+#, gcc-internal-format
+msgid "ignoring -fschedule-insns because of exception handling bug"
+msgstr ""
+
+#: config/sh/sh.c:7456
#, gcc-internal-format
msgid "__builtin_saveregs not supported by this subtarget"
msgstr ""
-#: config/sh/sh.c:8043
+#: config/sh/sh.c:8561
#, gcc-internal-format
msgid "%qE attribute only applies to interrupt functions"
msgstr ""
-#: config/sh/sh.c:8126
+#: config/sh/sh.c:8619
#, gcc-internal-format
msgid "%qE attribute is supported only for SH2A"
msgstr ""
-#: config/sh/sh.c:8156
+#: config/sh/sh.c:8649
#, gcc-internal-format
msgid "attribute interrupt_handler is not compatible with -m5-compact"
msgstr ""
-#: config/sh/sh.c:8173
+#: config/sh/sh.c:8666
#, gcc-internal-format
msgid "%qE attribute only applies to SH2A"
msgstr ""
-#: config/sh/sh.c:8195
+#: config/sh/sh.c:8688
#, gcc-internal-format
msgid "%qE attribute argument should be between 0 to 255"
msgstr ""
#. The argument must be a constant string.
-#: config/sh/sh.c:8268
+#: config/sh/sh.c:8761
#, gcc-internal-format
msgid "%qE attribute argument not a string constant"
msgstr ""
-#: config/sh/sh.c:10539
+#: config/sh/sh.c:11186
#, gcc-internal-format
msgid "r0 needs to be available as a call-clobbered register"
msgstr ""
-#: config/sh/sh.c:10560
+#: config/sh/sh.c:11207
#, gcc-internal-format
msgid "Need a second call-clobbered general purpose register"
msgstr ""
-#: config/sh/sh.c:10568
+#: config/sh/sh.c:11215
#, gcc-internal-format
msgid "Need a call-clobbered target register"
msgstr ""
-#: config/sh/symbian.c:146
-#, gcc-internal-format
-msgid ""
-"function %q+D is defined after prior declaration as dllimport: attribute "
-"ignored"
-msgstr ""
-
-#: config/sh/symbian.c:158
-#, gcc-internal-format
-msgid "inline function %q+D is declared as dllimport: attribute ignored"
-msgstr ""
-
-#: config/sh/symbian.c:272
+#: config/sh/symbian-base.c:112
#, gcc-internal-format
msgid "%qE declared as both exported to and imported from a DLL"
msgstr ""
-#: config/sh/symbian.c:279
+#: config/sh/symbian-base.c:119
#, gcc-internal-format
msgid ""
"failure in redeclaration of %q+D: dllimport'd symbol lacks external linkage"
msgstr ""
-#: config/sh/symbian.c:325
+#: config/sh/symbian-base.c:210
#, gcc-internal-format
msgid "%s %q+D %s after being referenced with dllimport linkage"
msgstr ""
-#: config/sh/symbian.c:408 config/sh/symbian.c:415
+#: config/sh/symbian-c.c:83 config/sh/symbian-cxx.c:94
+#, gcc-internal-format
+msgid ""
+"function %q+D is defined after prior declaration as dllimport: attribute "
+"ignored"
+msgstr ""
+
+#: config/sh/symbian-c.c:122 config/sh/symbian-c.c:129
+#: config/sh/symbian-cxx.c:554 config/sh/symbian-cxx.c:561
+#: ada/gcc-interface/utils.c:5159 ada/gcc-interface/utils.c:5335
+#: ada/gcc-interface/utils.c:5355 ada/gcc-interface/utils.c:5415
#, gcc-internal-format
msgid "%qs attribute ignored"
msgstr ""
-#: config/sh/symbian.c:891 cp/tree.c:2858
+#: config/sh/symbian-cxx.c:106
#, gcc-internal-format
-msgid "lang_* check: failed in %s, at %s:%d"
+msgid "inline function %q+D is declared as dllimport: attribute ignored"
msgstr ""
#. FIXME
@@ -28457,49 +29749,28 @@ msgstr ""
msgid "unimplemented-shmedia profiling"
msgstr ""
-#. There are no delay slots on SHmedia.
-#. Relaxation isn't yet supported for SHmedia
-#. After reload, if conversion does little good but can cause ICEs: - find_if_block doesn't do anything for SH because we don't have conditional execution patterns. (We use conditional move patterns, which are handled differently, and only before reload). - find_cond_trap doesn't do anything for the SH because we #. don't have conditional traps. - find_if_case_1 uses redirect_edge_and_branch_force in the only path that does an optimization, and this causes an ICE when branch targets are in registers. - find_if_case_2 doesn't do anything for the SHmedia after reload except when it can redirect a tablejump - and that's rather rare.
-#. Assembler CFI isn't yet fully supported for SHmedia.
-#. Only the sh64-elf assembler fully supports .quad properly.
-#. Pick one that makes most sense for the target in general. It is not much good to use different functions depending on -Os, since then we'll end up with two different functions when some of the code is compiled for size, and some for speed.
-#. SH4 tends to emphasize speed.
-#. These have their own way of doing things.
-#. ??? Should we use the integer SHmedia function instead?
-#. SH1 .. SH3 cores often go into small-footprint systems, so default to the smallest implementation available.
-#. ??? EXPERIMENTAL
-#. User supplied - leave it alone.
-#. The debugging information is sufficient, but gdb doesn't implement this yet
-#. Never run scheduling before reload, since that can break global alloc, and generates slower code anyway due to the pressure on R0.
-#. Enable sched1 for SH4; ready queue will be reordered by the target hooks when pressure is high. We can not do this for PIC, SH3 and lower as they give spill failures for R0.
-#. ??? Current exception handling places basic block boundaries after call_insns. It causes the high pressure on R0 and gives spill failures for R0 in reload. See PR 22553 and the thread on gcc-patches <http://gcc.gnu.org/ml/gcc-patches/2005-10/msg00816.html>.
-#: config/sh/sh.h:728
-#, gcc-internal-format
-msgid "ignoring -fschedule-insns because of exception handling bug"
-msgstr ""
-
#. The kernel loader cannot handle the relaxation relocations, so it cannot load kernel modules (which are ET_REL) or RTP executables (which are linked with --emit-relocs). No relaxation relocations appear in shared libraries, so relaxation is OK for RTP PIC.
#: config/sh/vxworks.h:43
#, gcc-internal-format
msgid "-mrelax is only supported for RTP PIC"
msgstr ""
-#: config/sparc/sparc.c:705
+#: config/sparc/sparc.c:717
#, gcc-internal-format
msgid "%s is not supported by this configuration"
msgstr ""
-#: config/sparc/sparc.c:712
+#: config/sparc/sparc.c:724
#, gcc-internal-format
msgid "-mlong-double-64 not allowed with -m64"
msgstr ""
-#: config/sparc/sparc.c:732
+#: config/sparc/sparc.c:744
#, gcc-internal-format
msgid "bad value (%s) for -mcmodel= switch"
msgstr ""
-#: config/sparc/sparc.c:737
+#: config/sparc/sparc.c:749
#, gcc-internal-format
msgid "-mcmodel= is not supported on 32 bit systems"
msgstr ""
@@ -28519,901 +29790,948 @@ msgstr ""
msgid "parameter list does not match a valid signature for %s()"
msgstr ""
-#: config/spu/spu.c:450 config/spu/spu.c:461
+#: config/spu/spu.c:468 config/spu/spu.c:479
#, gcc-internal-format
msgid "Unknown architecture '%s'"
msgstr ""
-#: config/spu/spu.c:5973
+#: config/spu/spu.c:4986 config/spu/spu.c:4989
+#, gcc-internal-format
+msgid "creating run-time relocation for %qD"
+msgstr ""
+
+#: config/spu/spu.c:4994 config/spu/spu.c:4996
+#, gcc-internal-format
+msgid "creating run-time relocation"
+msgstr ""
+
+#: config/spu/spu.c:6054
#, gcc-internal-format
msgid "%s expects an integer literal in the range [%d, %d]."
msgstr ""
-#: config/spu/spu.c:5993
+#: config/spu/spu.c:6074
#, gcc-internal-format
msgid "%s expects an integer literal in the range [%d, %d]. ("
msgstr ""
-#: config/spu/spu.c:6023
+#: config/spu/spu.c:6104
#, gcc-internal-format
msgid "%d least significant bits of %s are ignored."
msgstr ""
-#: config/stormy16/stormy16.c:1086
+#: config/stormy16/stormy16.c:1090
#, gcc-internal-format
msgid "local variable memory requirements exceed capacity"
msgstr ""
-#: config/stormy16/stormy16.c:1243
+#: config/stormy16/stormy16.c:1247
#, gcc-internal-format
msgid "function_profiler support"
msgstr ""
-#: config/stormy16/stormy16.c:1333
+#: config/stormy16/stormy16.c:1340
#, gcc-internal-format
msgid "cannot use va_start in interrupt function"
msgstr ""
-#: config/stormy16/stormy16.c:1875
+#: config/stormy16/stormy16.c:1884
#, gcc-internal-format
msgid "switch statement of size %lu entries too large"
msgstr ""
-#: config/stormy16/stormy16.c:2244
+#: config/stormy16/stormy16.c:2253
#, gcc-internal-format
msgid "%<__BELOW100__%> attribute only applies to variables"
msgstr ""
-#: config/stormy16/stormy16.c:2251
+#: config/stormy16/stormy16.c:2260
#, gcc-internal-format
msgid "__BELOW100__ attribute not allowed with auto storage class"
msgstr ""
-#: config/v850/v850-c.c:66
+#: config/v850/v850-c.c:67
#, gcc-internal-format
msgid "#pragma GHS endXXXX found without previous startXXX"
msgstr ""
-#: config/v850/v850-c.c:69
+#: config/v850/v850-c.c:70
#, gcc-internal-format
msgid "#pragma GHS endXXX does not match previous startXXX"
msgstr ""
-#: config/v850/v850-c.c:95
+#: config/v850/v850-c.c:96
#, gcc-internal-format
msgid "cannot set interrupt attribute: no current function"
msgstr ""
-#: config/v850/v850-c.c:103
+#: config/v850/v850-c.c:104
#, gcc-internal-format
msgid "cannot set interrupt attribute: no such identifier"
msgstr ""
-#: config/v850/v850-c.c:152
+#: config/v850/v850-c.c:153
#, gcc-internal-format
msgid "junk at end of #pragma ghs section"
msgstr ""
-#: config/v850/v850-c.c:169
+#: config/v850/v850-c.c:170
#, gcc-internal-format
msgid "unrecognized section name %qE"
msgstr ""
-#: config/v850/v850-c.c:184
+#: config/v850/v850-c.c:185
#, gcc-internal-format
msgid "malformed #pragma ghs section"
msgstr ""
-#: config/v850/v850-c.c:203
+#: config/v850/v850-c.c:204
#, gcc-internal-format
msgid "junk at end of #pragma ghs interrupt"
msgstr ""
-#: config/v850/v850-c.c:214
+#: config/v850/v850-c.c:215
#, gcc-internal-format
msgid "junk at end of #pragma ghs starttda"
msgstr ""
-#: config/v850/v850-c.c:225
+#: config/v850/v850-c.c:226
#, gcc-internal-format
msgid "junk at end of #pragma ghs startsda"
msgstr ""
-#: config/v850/v850-c.c:236
+#: config/v850/v850-c.c:237
#, gcc-internal-format
msgid "junk at end of #pragma ghs startzda"
msgstr ""
-#: config/v850/v850-c.c:247
+#: config/v850/v850-c.c:248
#, gcc-internal-format
msgid "junk at end of #pragma ghs endtda"
msgstr ""
-#: config/v850/v850-c.c:258
+#: config/v850/v850-c.c:259
#, gcc-internal-format
msgid "junk at end of #pragma ghs endsda"
msgstr ""
-#: config/v850/v850-c.c:269
+#: config/v850/v850-c.c:270
#, gcc-internal-format
msgid "junk at end of #pragma ghs endzda"
msgstr ""
-#: config/v850/v850.c:184
+#: config/v850/v850.c:212
#, gcc-internal-format
msgid "value passed to %<-m%s%> is too large"
msgstr ""
-#: config/v850/v850.c:2084
+#: config/v850/v850.c:2109
#, gcc-internal-format
-msgid "%Jdata area attributes cannot be specified for local variables"
+msgid "data area attributes cannot be specified for local variables"
msgstr ""
-#: config/v850/v850.c:2095
+#: config/v850/v850.c:2120
#, gcc-internal-format
msgid "data area of %q+D conflicts with previous declaration"
msgstr ""
-#: config/v850/v850.c:2225
+#: config/v850/v850.c:2250
#, gcc-internal-format
msgid "bogus JR construction: %d"
msgstr ""
-#: config/v850/v850.c:2243 config/v850/v850.c:2352
+#: config/v850/v850.c:2268 config/v850/v850.c:2377
#, gcc-internal-format
msgid "bad amount of stack space removal: %d"
msgstr ""
-#: config/v850/v850.c:2332
+#: config/v850/v850.c:2357
#, gcc-internal-format
msgid "bogus JARL construction: %d\n"
msgstr ""
-#: config/v850/v850.c:2631
+#: config/v850/v850.c:2656
#, gcc-internal-format
msgid "bogus DISPOSE construction: %d"
msgstr ""
-#: config/v850/v850.c:2650
+#: config/v850/v850.c:2675
#, gcc-internal-format
msgid "too much stack space to dispose of: %d"
msgstr ""
-#: config/v850/v850.c:2752
+#: config/v850/v850.c:2777
#, gcc-internal-format
msgid "bogus PREPEARE construction: %d"
msgstr ""
-#: config/v850/v850.c:2771
+#: config/v850/v850.c:2796
#, gcc-internal-format
msgid "too much stack space to prepare: %d"
msgstr ""
-#: config/xtensa/xtensa.c:2065
+#: config/xtensa/xtensa.c:2076
#, gcc-internal-format
msgid "boolean registers required for the floating-point option"
msgstr ""
-#: config/xtensa/xtensa.c:2100
+#: config/xtensa/xtensa.c:2111
#, gcc-internal-format
msgid "-f%s is not supported with CONST16 instructions"
msgstr ""
-#: config/xtensa/xtensa.c:2105
+#: config/xtensa/xtensa.c:2116
#, gcc-internal-format
msgid "PIC is required but not supported with CONST16 instructions"
msgstr ""
-#: config/xtensa/xtensa.c:3010 config/xtensa/xtensa.c:3050
+#: config/xtensa/xtensa.c:3025 config/xtensa/xtensa.c:3065
#, gcc-internal-format
msgid "bad builtin code"
msgstr ""
-#: config/xtensa/xtensa.c:3160
+#: config/xtensa/xtensa.c:3175
#, gcc-internal-format
msgid "only uninitialized variables can be placed in a .bss section"
msgstr ""
-#: cp/call.c:2552
+#: cp/call.c:2705
#, gcc-internal-format
msgid "%s %D(%T, %T, %T) <built-in>"
msgstr ""
-#: cp/call.c:2557
+#: cp/call.c:2710
#, gcc-internal-format
msgid "%s %D(%T, %T) <built-in>"
msgstr ""
-#: cp/call.c:2561
+#: cp/call.c:2714
#, gcc-internal-format
msgid "%s %D(%T) <built-in>"
msgstr ""
-#: cp/call.c:2565
+#: cp/call.c:2718
#, gcc-internal-format
msgid "%s %T <conversion>"
msgstr ""
-#: cp/call.c:2567
+#: cp/call.c:2720
#, gcc-internal-format
msgid "%s %+#D <near match>"
msgstr ""
-#: cp/call.c:2569 cp/pt.c:1407
+#: cp/call.c:2722
+#, gcc-internal-format
+msgid "%s %+#D <deleted>"
+msgstr ""
+
+#: cp/call.c:2724 cp/pt.c:1651
#, gcc-internal-format
msgid "%s %+#D"
msgstr ""
-#: cp/call.c:2851
+#: cp/call.c:3023
#, gcc-internal-format
msgid "conversion from %qT to %qT is ambiguous"
msgstr ""
-#: cp/call.c:3010 cp/call.c:3030 cp/call.c:3094
+#: cp/call.c:3185 cp/call.c:3206 cp/call.c:3271
#, gcc-internal-format
msgid "no matching function for call to %<%D(%A)%>"
msgstr ""
-#: cp/call.c:3033 cp/call.c:3097
+#: cp/call.c:3209 cp/call.c:3274
#, gcc-internal-format
msgid "call of overloaded %<%D(%A)%> is ambiguous"
msgstr ""
#. It's no good looking for an overloaded operator() on a
#. pointer-to-member-function.
-#: cp/call.c:3170
+#: cp/call.c:3353
#, gcc-internal-format
msgid ""
"pointer-to-member function %E cannot be called without an object; consider "
"using .* or ->*"
msgstr ""
-#: cp/call.c:3246
+#: cp/call.c:3435
#, gcc-internal-format
msgid "no match for call to %<(%T) (%A)%>"
msgstr ""
-#: cp/call.c:3258
+#: cp/call.c:3448
#, gcc-internal-format
msgid "call of %<(%T) (%A)%> is ambiguous"
msgstr ""
-#: cp/call.c:3299
+#: cp/call.c:3489
#, gcc-internal-format
msgid "%s for ternary %<operator?:%> in %<%E ? %E : %E%>"
msgstr ""
-#: cp/call.c:3305
+#: cp/call.c:3495
#, gcc-internal-format
msgid "%s for %<operator%s%> in %<%E%s%>"
msgstr ""
-#: cp/call.c:3309
+#: cp/call.c:3499
#, gcc-internal-format
msgid "%s for %<operator[]%> in %<%E[%E]%>"
msgstr ""
-#: cp/call.c:3314
+#: cp/call.c:3504
#, gcc-internal-format
msgid "%s for %qs in %<%s %E%>"
msgstr ""
-#: cp/call.c:3319
+#: cp/call.c:3509
#, gcc-internal-format
msgid "%s for %<operator%s%> in %<%E %s %E%>"
msgstr ""
-#: cp/call.c:3322
+#: cp/call.c:3512
#, gcc-internal-format
msgid "%s for %<operator%s%> in %<%s%E%>"
msgstr ""
-#: cp/call.c:3416
+#: cp/call.c:3606
#, gcc-internal-format
msgid "ISO C++ forbids omitting the middle term of a ?: expression"
msgstr ""
-#: cp/call.c:3496
+#: cp/call.c:3687
#, gcc-internal-format
msgid ""
"second operand to the conditional operator is of type %<void%>, but the "
"third operand is neither a throw-expression nor of type %<void%>"
msgstr ""
-#: cp/call.c:3501
+#: cp/call.c:3692
#, gcc-internal-format
msgid ""
"third operand to the conditional operator is of type %<void%>, but the "
"second operand is neither a throw-expression nor of type %<void%>"
msgstr ""
-#: cp/call.c:3543 cp/call.c:3779
+#: cp/call.c:3734 cp/call.c:3972
#, gcc-internal-format
msgid "operands to ?: have different types %qT and %qT"
msgstr ""
-#: cp/call.c:3726
+#: cp/call.c:3919
#, gcc-internal-format
msgid "enumeral mismatch in conditional expression: %qT vs %qT"
msgstr ""
-#: cp/call.c:3737
+#: cp/call.c:3930
#, gcc-internal-format
msgid "enumeral and non-enumeral type in conditional expression"
msgstr ""
-#: cp/call.c:4052
+#: cp/call.c:4272
#, gcc-internal-format
msgid "no %<%D(int)%> declared for postfix %qs, trying prefix operator instead"
msgstr ""
-#: cp/call.c:4142
+#: cp/call.c:4274
+#, gcc-internal-format
+msgid "no %<%D(int)%> declared for postfix %qs"
+msgstr ""
+
+#: cp/call.c:4368
#, gcc-internal-format
msgid "comparison between %q#T and %q#T"
msgstr ""
-#: cp/call.c:4430
+#: cp/call.c:4662
#, gcc-internal-format
msgid "no corresponding deallocation function for %qD"
msgstr ""
-#: cp/call.c:4435
+#: cp/call.c:4667
#, gcc-internal-format
msgid "no suitable %<operator %s%> for %qT"
msgstr ""
-#: cp/call.c:4453
+#: cp/call.c:4685
#, gcc-internal-format
msgid "%q+#D is private"
msgstr ""
-#: cp/call.c:4455
+#: cp/call.c:4687
#, gcc-internal-format
msgid "%q+#D is protected"
msgstr ""
-#: cp/call.c:4457
+#: cp/call.c:4689
#, gcc-internal-format
msgid "%q+#D is inaccessible"
msgstr ""
-#: cp/call.c:4458
+#: cp/call.c:4690
#, gcc-internal-format
msgid "within this context"
msgstr ""
-#: cp/call.c:4504
+#: cp/call.c:4737
#, gcc-internal-format
msgid "passing NULL to non-pointer argument %P of %qD"
msgstr ""
-#: cp/call.c:4507
+#: cp/call.c:4740
#, gcc-internal-format
msgid "converting to non-pointer type %qT from NULL"
msgstr ""
-#: cp/call.c:4513
+#: cp/call.c:4746
#, gcc-internal-format
msgid "converting %<false%> to pointer type for argument %P of %qD"
msgstr ""
-#: cp/call.c:4564 cp/cvt.c:217
+#: cp/call.c:4784
+#, gcc-internal-format
+msgid "too many braces around initializer for %qT"
+msgstr ""
+
+#: cp/call.c:4806 cp/cvt.c:217
#, gcc-internal-format
msgid "invalid conversion from %qT to %qT"
msgstr ""
-#: cp/call.c:4566
+#: cp/call.c:4808
#, gcc-internal-format
msgid " initializing argument %P of %qD"
msgstr ""
-#: cp/call.c:4590
+#: cp/call.c:4832
#, gcc-internal-format
msgid ""
"converting to %qT from initializer list would use explicit constructor %qD"
msgstr ""
-#: cp/call.c:4753
+#: cp/call.c:4992
+#, gcc-internal-format
+msgid "cannot bind %qT lvalue to %qT"
+msgstr ""
+
+#: cp/call.c:4995
+#, gcc-internal-format
+msgid " initializing argument %P of %q+D"
+msgstr ""
+
+#: cp/call.c:5022
#, gcc-internal-format
msgid "cannot bind bitfield %qE to %qT"
msgstr ""
-#: cp/call.c:4756 cp/call.c:4774
+#: cp/call.c:5025 cp/call.c:5043
#, gcc-internal-format
msgid "cannot bind packed field %qE to %qT"
msgstr ""
-#: cp/call.c:4759
+#: cp/call.c:5028
#, gcc-internal-format
msgid "cannot bind rvalue %qE to %qT"
msgstr ""
-#: cp/call.c:4883
+#: cp/call.c:5147
#, gcc-internal-format
-msgid ""
-"cannot pass objects of non-POD type %q#T through %<...%>; call will abort at "
-"runtime"
+msgid "cannot pass objects of non-trivially-copyable type %q#T through %<...%>"
msgstr ""
-#. Undefined behavior [expr.call] 5.2.2/7.
-#: cp/call.c:4911
+#. conditionally-supported behavior [expr.call] 5.2.2/7.
+#: cp/call.c:5174
#, gcc-internal-format
msgid ""
-"cannot receive objects of non-POD type %q#T through %<...%>; call will abort "
-"at runtime"
+"cannot receive objects of non-trivially-copyable type %q#T through %<...%>; "
msgstr ""
-#: cp/call.c:4959
+#: cp/call.c:5220
#, gcc-internal-format
msgid "the default argument for parameter %d of %qD has not yet been parsed"
msgstr ""
-#: cp/call.c:4969
+#: cp/call.c:5230
#, gcc-internal-format
msgid "recursive evaluation of default argument for %q#D"
msgstr ""
-#: cp/call.c:5086
+#: cp/call.c:5347
#, gcc-internal-format
msgid "argument of function call might be a candidate for a format attribute"
msgstr ""
-#: cp/call.c:5240
+#: cp/call.c:5531
#, gcc-internal-format
msgid "passing %qT as %<this%> argument of %q#D discards qualifiers"
msgstr ""
-#: cp/call.c:5262
+#: cp/call.c:5553
#, gcc-internal-format
msgid "%qT is not an accessible base of %qT"
msgstr ""
-#: cp/call.c:5557
+#: cp/call.c:5601
+#, gcc-internal-format
+msgid "deducing %qT as %qT"
+msgstr ""
+
+#: cp/call.c:5604
+#, gcc-internal-format
+msgid " in call to %q+D"
+msgstr ""
+
+#: cp/call.c:5606
+#, gcc-internal-format
+msgid " (you can disable this with -fno-deduce-init-list)"
+msgstr ""
+
+#: cp/call.c:5879
#, gcc-internal-format
msgid "could not find class$ field in java interface type %qT"
msgstr ""
-#: cp/call.c:5800
+#: cp/call.c:6138
#, gcc-internal-format
msgid "call to non-function %qD"
msgstr ""
-#: cp/call.c:5939
+#: cp/call.c:6290
#, gcc-internal-format
msgid "no matching function for call to %<%T::%s(%A)%#V%>"
msgstr ""
-#: cp/call.c:5960
+#: cp/call.c:6315
#, gcc-internal-format
msgid "call of overloaded %<%s(%A)%> is ambiguous"
msgstr ""
-#: cp/call.c:5989
+#: cp/call.c:6344
#, gcc-internal-format
msgid "cannot call member function %qD without object"
msgstr ""
-#: cp/call.c:6677
+#: cp/call.c:7029
#, gcc-internal-format
msgid "passing %qT chooses %qT over %qT"
msgstr ""
-#: cp/call.c:6679 cp/name-lookup.c:4474 cp/name-lookup.c:4919
+#: cp/call.c:7031 cp/name-lookup.c:4518 cp/name-lookup.c:4978
#, gcc-internal-format
msgid " in call to %qD"
msgstr ""
-#: cp/call.c:6736
+#: cp/call.c:7088
#, gcc-internal-format
msgid "choosing %qD over %qD"
msgstr ""
-#: cp/call.c:6737
+#: cp/call.c:7089
#, gcc-internal-format
msgid " for conversion from %qT to %qT"
msgstr ""
-#: cp/call.c:6740
+#: cp/call.c:7092
#, gcc-internal-format
msgid " because conversion sequence for the argument is better"
msgstr ""
-#: cp/call.c:6858
+#: cp/call.c:7210
#, gcc-internal-format
msgid "default argument mismatch in overload resolution"
msgstr ""
-#: cp/call.c:6861
+#: cp/call.c:7213
#, gcc-internal-format
msgid " candidate 1: %q+#F"
msgstr ""
-#: cp/call.c:6863
+#: cp/call.c:7215
#, gcc-internal-format
msgid " candidate 2: %q+#F"
msgstr ""
-#: cp/call.c:6901
+#: cp/call.c:7253
#, gcc-internal-format
msgid ""
"ISO C++ says that these are ambiguous, even though the worst conversion for "
"the first is better than the worst conversion for the second:"
msgstr ""
-#: cp/call.c:7045
+#: cp/call.c:7406
#, gcc-internal-format
msgid "could not convert %qE to %qT"
msgstr ""
-#: cp/call.c:7251
+#: cp/call.c:7621
#, gcc-internal-format
msgid ""
"invalid initialization of non-const reference of type %qT from a temporary "
"of type %qT"
msgstr ""
-#: cp/call.c:7255
+#: cp/call.c:7625
#, gcc-internal-format
msgid ""
"invalid initialization of reference of type %qT from expression of type %qT"
msgstr ""
-#: cp/class.c:280
+#: cp/class.c:278
#, gcc-internal-format
msgid "cannot convert from base %qT to derived type %qT via virtual base %qT"
msgstr ""
-#: cp/class.c:974
+#: cp/class.c:972
#, gcc-internal-format
msgid "Java class %qT cannot have a destructor"
msgstr ""
-#: cp/class.c:976
+#: cp/class.c:974
#, gcc-internal-format
msgid "Java class %qT cannot have an implicit non-trivial destructor"
msgstr ""
-#: cp/class.c:1077
+#: cp/class.c:1075
#, gcc-internal-format
msgid "repeated using declaration %q+D"
msgstr ""
-#: cp/class.c:1079
+#: cp/class.c:1077
#, gcc-internal-format
msgid "using declaration %q+D conflicts with a previous using declaration"
msgstr ""
-#: cp/class.c:1084
+#: cp/class.c:1082
#, gcc-internal-format
msgid "%q+#D cannot be overloaded"
msgstr ""
-#: cp/class.c:1085
+#: cp/class.c:1083
#, gcc-internal-format
msgid "with %q+#D"
msgstr ""
-#: cp/class.c:1152
+#: cp/class.c:1150
#, gcc-internal-format
msgid "conflicting access specifications for method %q+D, ignored"
msgstr ""
-#: cp/class.c:1155
+#: cp/class.c:1153
#, gcc-internal-format
msgid "conflicting access specifications for field %qE, ignored"
msgstr ""
-#: cp/class.c:1216 cp/class.c:1224
+#: cp/class.c:1214 cp/class.c:1222
#, gcc-internal-format
msgid "%q+D invalid in %q#T"
msgstr ""
-#: cp/class.c:1217
+#: cp/class.c:1215
#, gcc-internal-format
msgid " because of local method %q+#D with same name"
msgstr ""
-#: cp/class.c:1225
+#: cp/class.c:1223
#, gcc-internal-format
msgid " because of local member %q+#D with same name"
msgstr ""
-#: cp/class.c:1268
+#: cp/class.c:1272
#, gcc-internal-format
msgid "base class %q#T has a non-virtual destructor"
msgstr ""
-#: cp/class.c:1597
+#: cp/class.c:1632
#, gcc-internal-format
msgid "all member functions in class %qT are private"
msgstr ""
-#: cp/class.c:1609
+#: cp/class.c:1644
#, gcc-internal-format
msgid "%q#T only defines a private destructor and has no friends"
msgstr ""
-#: cp/class.c:1654
+#: cp/class.c:1689
#, gcc-internal-format
msgid "%q#T only defines private constructors and has no friends"
msgstr ""
-#: cp/class.c:2047
+#: cp/class.c:2082
#, gcc-internal-format
msgid "no unique final overrider for %qD in %qT"
msgstr ""
#. Here we know it is a hider, and no overrider exists.
-#: cp/class.c:2467
+#: cp/class.c:2505
#, gcc-internal-format
msgid "%q+D was hidden"
msgstr ""
-#: cp/class.c:2468
+#: cp/class.c:2506
#, gcc-internal-format
msgid " by %q+D"
msgstr ""
-#: cp/class.c:2511 cp/decl2.c:1269
+#: cp/class.c:2549 cp/decl2.c:1282
#, gcc-internal-format
msgid "%q+#D invalid; an anonymous union can only have non-static data members"
msgstr ""
-#: cp/class.c:2514
+#: cp/class.c:2552
#, gcc-internal-format
msgid ""
"%q+#D invalid; an anonymous struct can only have non-static data members"
msgstr ""
-#: cp/class.c:2522 cp/decl2.c:1275
+#: cp/class.c:2560 cp/decl2.c:1288
#, gcc-internal-format
msgid "private member %q+#D in anonymous union"
msgstr ""
-#: cp/class.c:2524
+#: cp/class.c:2562
#, gcc-internal-format
msgid "private member %q+#D in anonymous struct"
msgstr ""
-#: cp/class.c:2529 cp/decl2.c:1277
+#: cp/class.c:2567 cp/decl2.c:1290
#, gcc-internal-format
msgid "protected member %q+#D in anonymous union"
msgstr ""
-#: cp/class.c:2531
+#: cp/class.c:2569
#, gcc-internal-format
msgid "protected member %q+#D in anonymous struct"
msgstr ""
-#: cp/class.c:2710
+#: cp/class.c:2752
#, gcc-internal-format
msgid "bit-field %q+#D with non-integral type"
msgstr ""
-#: cp/class.c:2723
+#: cp/class.c:2765
#, gcc-internal-format
msgid "bit-field %q+D width not an integer constant"
msgstr ""
-#: cp/class.c:2728
+#: cp/class.c:2770
#, gcc-internal-format
msgid "negative width in bit-field %q+D"
msgstr ""
-#: cp/class.c:2733
+#: cp/class.c:2775
#, gcc-internal-format
msgid "zero width for bit-field %q+D"
msgstr ""
-#: cp/class.c:2739
+#: cp/class.c:2781
#, gcc-internal-format
msgid "width of %q+D exceeds its type"
msgstr ""
-#: cp/class.c:2749
+#: cp/class.c:2791
#, gcc-internal-format
msgid "%q+D is too small to hold all values of %q#T"
msgstr ""
-#: cp/class.c:2806
+#: cp/class.c:2848
#, gcc-internal-format
msgid "member %q+#D with constructor not allowed in union"
msgstr ""
-#: cp/class.c:2809
+#: cp/class.c:2851
#, gcc-internal-format
msgid "member %q+#D with destructor not allowed in union"
msgstr ""
-#: cp/class.c:2811
+#: cp/class.c:2853
#, gcc-internal-format
msgid "member %q+#D with copy assignment operator not allowed in union"
msgstr ""
-#: cp/class.c:2835
+#: cp/class.c:2877
#, gcc-internal-format
msgid "multiple fields in union %qT initialized"
msgstr ""
-#: cp/class.c:2924
+#: cp/class.c:2968
#, gcc-internal-format
msgid "%q+D may not be static because it is a member of a union"
msgstr ""
-#: cp/class.c:2929
+#: cp/class.c:2973
#, gcc-internal-format
msgid "%q+D may not have reference type %qT because it is a member of a union"
msgstr ""
-#: cp/class.c:2940
+#: cp/class.c:2984
#, gcc-internal-format
msgid "field %q+D invalidly declared function type"
msgstr ""
-#: cp/class.c:2946
+#: cp/class.c:2990
#, gcc-internal-format
msgid "field %q+D invalidly declared method type"
msgstr ""
-#: cp/class.c:2984
+#: cp/class.c:3039
#, gcc-internal-format
msgid "ignoring packed attribute because of unpacked non-POD field %q+#D"
msgstr ""
-#: cp/class.c:3064
+#: cp/class.c:3122
#, gcc-internal-format
msgid "field %q+#D with same name as class"
msgstr ""
-#: cp/class.c:3095
+#: cp/class.c:3153
#, gcc-internal-format
msgid "%q#T has pointer data members"
msgstr ""
-#: cp/class.c:3100
+#: cp/class.c:3158
#, gcc-internal-format
msgid " but does not override %<%T(const %T&)%>"
msgstr ""
-#: cp/class.c:3102
+#: cp/class.c:3160
#, gcc-internal-format
msgid " or %<operator=(const %T&)%>"
msgstr ""
-#: cp/class.c:3106
+#: cp/class.c:3164
#, gcc-internal-format
msgid " but does not override %<operator=(const %T&)%>"
msgstr ""
-#: cp/class.c:3567
+#: cp/class.c:3627
#, gcc-internal-format
msgid ""
"offset of empty base %qT may not be ABI-compliant and maychange in a future "
"version of GCC"
msgstr ""
-#: cp/class.c:3692
+#: cp/class.c:3754
#, gcc-internal-format
msgid "class %qT will be considered nearly empty in a future version of GCC"
msgstr ""
-#: cp/class.c:3774
+#: cp/class.c:3836
#, gcc-internal-format
msgid "initializer specified for non-virtual method %q+D"
msgstr ""
-#: cp/class.c:4345
+#: cp/class.c:4441
#, gcc-internal-format
msgid "non-static reference %q+#D in class without a constructor"
msgstr ""
-#: cp/class.c:4350
+#: cp/class.c:4446
#, gcc-internal-format
msgid "non-static const member %q+#D in class without a constructor"
msgstr ""
-#: cp/class.c:4605
+#: cp/class.c:4669
#, gcc-internal-format
msgid ""
"offset of virtual base %qT is not ABI-compliant and may change in a future "
"version of GCC"
msgstr ""
-#: cp/class.c:4706
+#: cp/class.c:4770
#, gcc-internal-format
msgid "direct base %qT inaccessible in %qT due to ambiguity"
msgstr ""
-#: cp/class.c:4718
+#: cp/class.c:4782
#, gcc-internal-format
msgid "virtual base %qT inaccessible in %qT due to ambiguity"
msgstr ""
-#: cp/class.c:4897
+#: cp/class.c:4961
#, gcc-internal-format
msgid ""
"size assigned to %qT may not be ABI-compliant and may change in a future "
"version of GCC"
msgstr ""
-#: cp/class.c:4937
+#: cp/class.c:5001
#, gcc-internal-format
msgid ""
"the offset of %qD may not be ABI-compliant and may change in a future "
"version of GCC"
msgstr ""
-#: cp/class.c:4965
+#: cp/class.c:5029
#, gcc-internal-format
msgid ""
"offset of %q+D is not ABI-compliant and may change in a future version of GCC"
msgstr ""
-#: cp/class.c:4974
+#: cp/class.c:5038
#, gcc-internal-format
msgid ""
"%q+D contains empty classes which may cause base classes to be placed at "
"different locations in a future version of GCC"
msgstr ""
-#: cp/class.c:5061
+#: cp/class.c:5126
#, gcc-internal-format
msgid ""
"layout of classes derived from empty class %qT may change in a future "
"version of GCC"
msgstr ""
-#: cp/class.c:5207
+#: cp/class.c:5274 cp/parser.c:16267
#, gcc-internal-format
msgid "redefinition of %q#T"
msgstr ""
-#: cp/class.c:5363
+#: cp/class.c:5426
#, gcc-internal-format
msgid "%q#T has virtual functions and accessible non-virtual destructor"
msgstr ""
-#: cp/class.c:5465
+#: cp/class.c:5528
#, gcc-internal-format
msgid "trying to finish struct, but kicked out due to previous parse errors"
msgstr ""
-#: cp/class.c:5927
+#: cp/class.c:5992
#, gcc-internal-format
msgid "language string %<\"%E\"%> not recognized"
msgstr ""
-#: cp/class.c:6020
+#: cp/class.c:6085
#, gcc-internal-format
msgid "cannot resolve overloaded function %qD based on conversion to type %qT"
msgstr ""
-#: cp/class.c:6149
+#: cp/class.c:6225
#, gcc-internal-format
msgid "no matches converting function %qD to type %q#T"
msgstr ""
-#: cp/class.c:6179
+#: cp/class.c:6255
#, gcc-internal-format
msgid "converting overloaded function %qD to type %q#T is ambiguous"
msgstr ""
-#: cp/class.c:6206
+#: cp/class.c:6282
#, gcc-internal-format
msgid "assuming pointer to member %qD"
msgstr ""
-#: cp/class.c:6209
+#: cp/class.c:6285
#, gcc-internal-format
msgid "(a pointer to member can only be formed with %<&%E%>)"
msgstr ""
-#: cp/class.c:6271 cp/class.c:6305
+#: cp/class.c:6347 cp/class.c:6381
#, gcc-internal-format
msgid "not enough type information"
msgstr ""
-#: cp/class.c:6288
+#: cp/class.c:6364
#, gcc-internal-format
msgid "argument of type %qT does not match %qT"
msgstr ""
@@ -29423,12 +30741,12 @@ msgstr ""
#. A name N used in a class S shall refer to the same declaration
#. in its context and when re-evaluated in the completed scope of
#. S.
-#: cp/class.c:6588 cp/decl.c:1180 cp/name-lookup.c:525
+#: cp/class.c:6665 cp/decl.c:1199 cp/name-lookup.c:520
#, gcc-internal-format
msgid "declaration of %q#D"
msgstr ""
-#: cp/class.c:6589
+#: cp/class.c:6666
#, gcc-internal-format
msgid "changes meaning of %qD from %q+#D"
msgstr ""
@@ -29438,12 +30756,7 @@ msgstr ""
msgid "continue statement not within loop or switch"
msgstr ""
-#: cp/cp-gimplify.c:409
-#, gcc-internal-format
-msgid "statement with no effect"
-msgstr ""
-
-#: cp/cp-gimplify.c:1141
+#: cp/cp-gimplify.c:1196
#, gcc-internal-format
msgid "%qE implicitly determined as %<firstprivate%> has reference type"
msgstr ""
@@ -29468,7 +30781,7 @@ msgstr ""
msgid "conversion from %qT to %qT discards qualifiers"
msgstr ""
-#: cp/cvt.c:470 cp/typeck.c:5485
+#: cp/cvt.c:470 cp/typeck.c:5598
#, gcc-internal-format
msgid "casting %qT to %qT does not dereference pointer"
msgstr ""
@@ -29478,195 +30791,190 @@ msgstr ""
msgid "cannot convert type %qT to type %qT"
msgstr ""
-#: cp/cvt.c:652
+#: cp/cvt.c:668
#, gcc-internal-format
msgid "conversion from %q#T to %q#T"
msgstr ""
-#: cp/cvt.c:667
+#: cp/cvt.c:683
#, gcc-internal-format
msgid ""
"the result of the conversion is unspecified because %qE is outside the range "
"of type %qT"
msgstr ""
-#: cp/cvt.c:678 cp/cvt.c:698
+#: cp/cvt.c:694 cp/cvt.c:714
#, gcc-internal-format
msgid "%q#T used where a %qT was expected"
msgstr ""
-#: cp/cvt.c:713
+#: cp/cvt.c:729
#, gcc-internal-format
msgid "%q#T used where a floating point value was expected"
msgstr ""
-#: cp/cvt.c:769
+#: cp/cvt.c:789
#, gcc-internal-format
msgid "conversion from %qT to non-scalar type %qT requested"
msgstr ""
-#: cp/cvt.c:808
+#: cp/cvt.c:828
#, gcc-internal-format
msgid "pseudo-destructor is not called"
msgstr ""
-#: cp/cvt.c:870
+#: cp/cvt.c:891
#, gcc-internal-format
msgid "object of incomplete type %qT will not be accessed in %s"
msgstr ""
-#: cp/cvt.c:878
+#: cp/cvt.c:899
#, gcc-internal-format
msgid "object of type %qT will not be accessed in %s"
msgstr ""
-#: cp/cvt.c:895 cp/cvt.c:1009
-#, gcc-internal-format
-msgid "value computed is not used"
-msgstr ""
-
-#: cp/cvt.c:909
+#: cp/cvt.c:930
#, gcc-internal-format
msgid "object %qE of incomplete type %qT will not be accessed in %s"
msgstr ""
-#: cp/cvt.c:947
+#: cp/cvt.c:970
#, gcc-internal-format
msgid "%s cannot resolve address of overloaded function"
msgstr ""
-#: cp/cvt.c:957
+#: cp/cvt.c:980
#, gcc-internal-format
msgid "%s is a reference, not call, to function %qE"
msgstr ""
-#: cp/cvt.c:975
+#: cp/cvt.c:998
#, gcc-internal-format
msgid "%s has no effect"
msgstr ""
-#: cp/cvt.c:1119
+#: cp/cvt.c:1142
#, gcc-internal-format
msgid "converting NULL to non-pointer type"
msgstr ""
-#: cp/cvt.c:1225
+#: cp/cvt.c:1251
#, gcc-internal-format
msgid "ambiguous default type conversion from %qT"
msgstr ""
-#: cp/cvt.c:1227
+#: cp/cvt.c:1253
#, gcc-internal-format
msgid " candidate conversions include %qD and %qD"
msgstr ""
-#: cp/decl.c:1043
+#: cp/decl.c:1062
#, gcc-internal-format
msgid "%qD was declared %<extern%> and later %<static%>"
msgstr ""
-#: cp/decl.c:1044 cp/decl.c:1591 objc/objc-act.c:2938 objc/objc-act.c:7539
+#: cp/decl.c:1063 cp/decl.c:1611 objc/objc-act.c:2977 objc/objc-act.c:7602
#, gcc-internal-format
msgid "previous declaration of %q+D"
msgstr ""
-#: cp/decl.c:1077
+#: cp/decl.c:1096
#, gcc-internal-format
msgid "declaration of %qF throws different exceptions"
msgstr ""
-#: cp/decl.c:1078
+#: cp/decl.c:1097
#, gcc-internal-format
msgid "from previous declaration %q+F"
msgstr ""
-#: cp/decl.c:1134
+#: cp/decl.c:1153
#, gcc-internal-format
msgid "function %q+D redeclared as inline"
msgstr ""
-#: cp/decl.c:1136
+#: cp/decl.c:1155
#, gcc-internal-format
msgid "previous declaration of %q+D with attribute noinline"
msgstr ""
-#: cp/decl.c:1143
+#: cp/decl.c:1162
#, gcc-internal-format
msgid "function %q+D redeclared with attribute noinline"
msgstr ""
-#: cp/decl.c:1145
+#: cp/decl.c:1164
#, gcc-internal-format
msgid "previous declaration of %q+D was inline"
msgstr ""
-#: cp/decl.c:1167 cp/decl.c:1240
+#: cp/decl.c:1186 cp/decl.c:1259
#, gcc-internal-format
msgid "shadowing %s function %q#D"
msgstr ""
-#: cp/decl.c:1176
+#: cp/decl.c:1195
#, gcc-internal-format
msgid "library function %q#D redeclared as non-function %q#D"
msgstr ""
-#: cp/decl.c:1181
+#: cp/decl.c:1200
#, gcc-internal-format
msgid "conflicts with built-in declaration %q#D"
msgstr ""
-#: cp/decl.c:1235 cp/decl.c:1361 cp/decl.c:1377
+#: cp/decl.c:1254 cp/decl.c:1380 cp/decl.c:1396
#, gcc-internal-format
msgid "new declaration %q#D"
msgstr ""
-#: cp/decl.c:1236
+#: cp/decl.c:1255
#, gcc-internal-format
msgid "ambiguates built-in declaration %q#D"
msgstr ""
-#: cp/decl.c:1325
+#: cp/decl.c:1344
#, gcc-internal-format
msgid "%q#D redeclared as different kind of symbol"
msgstr ""
-#: cp/decl.c:1328
+#: cp/decl.c:1347
#, gcc-internal-format
msgid "previous declaration of %q+#D"
msgstr ""
-#: cp/decl.c:1347
+#: cp/decl.c:1366
#, gcc-internal-format
msgid "declaration of template %q#D"
msgstr ""
-#: cp/decl.c:1348 cp/name-lookup.c:526 cp/name-lookup.c:812
-#: cp/name-lookup.c:823
+#: cp/decl.c:1367 cp/name-lookup.c:521 cp/name-lookup.c:807
+#: cp/name-lookup.c:818
#, gcc-internal-format
msgid "conflicts with previous declaration %q+#D"
msgstr ""
-#: cp/decl.c:1362 cp/decl.c:1378
+#: cp/decl.c:1381 cp/decl.c:1397
#, gcc-internal-format
msgid "ambiguates old declaration %q+#D"
msgstr ""
-#: cp/decl.c:1370
+#: cp/decl.c:1389
#, gcc-internal-format
msgid "declaration of C function %q#D conflicts with"
msgstr ""
-#: cp/decl.c:1372
+#: cp/decl.c:1391
#, gcc-internal-format
msgid "previous declaration %q+#D here"
msgstr ""
-#: cp/decl.c:1386
+#: cp/decl.c:1405
#, gcc-internal-format
msgid "conflicting declaration %q#D"
msgstr ""
-#: cp/decl.c:1387
+#: cp/decl.c:1406
#, gcc-internal-format
msgid "%q+D has a previous declaration as %q#D"
msgstr ""
@@ -29678,63 +30986,63 @@ msgstr ""
#. A namespace-name defined at global scope shall not be
#. declared as the name of any other entity in any global scope
#. of the program.
-#: cp/decl.c:1439
+#: cp/decl.c:1458
#, gcc-internal-format
msgid "declaration of namespace %qD conflicts with"
msgstr ""
-#: cp/decl.c:1440
+#: cp/decl.c:1459
#, gcc-internal-format
msgid "previous declaration of namespace %q+D here"
msgstr ""
-#: cp/decl.c:1451
+#: cp/decl.c:1470
#, gcc-internal-format
msgid "%q+#D previously defined here"
msgstr ""
#. Prototype decl follows defn w/o prototype.
-#: cp/decl.c:1461
+#: cp/decl.c:1480
#, gcc-internal-format
msgid "prototype for %q+#D"
msgstr ""
-#: cp/decl.c:1462
+#: cp/decl.c:1482
#, gcc-internal-format
-msgid "%Jfollows non-prototype definition here"
+msgid "follows non-prototype definition here"
msgstr ""
-#: cp/decl.c:1502
+#: cp/decl.c:1522
#, gcc-internal-format
msgid "previous declaration of %q+#D with %qL linkage"
msgstr ""
-#: cp/decl.c:1504
+#: cp/decl.c:1524
#, gcc-internal-format
msgid "conflicts with new declaration with %qL linkage"
msgstr ""
-#: cp/decl.c:1527 cp/decl.c:1533
+#: cp/decl.c:1547 cp/decl.c:1553
#, gcc-internal-format
msgid "default argument given for parameter %d of %q#D"
msgstr ""
-#: cp/decl.c:1529 cp/decl.c:1535
+#: cp/decl.c:1549 cp/decl.c:1555
#, gcc-internal-format
msgid "after previous specification in %q+#D"
msgstr ""
-#: cp/decl.c:1590
+#: cp/decl.c:1610
#, gcc-internal-format
msgid "redundant redeclaration of %qD in same scope"
msgstr ""
-#: cp/decl.c:1596
+#: cp/decl.c:1616
#, gcc-internal-format
msgid "deleted definition of %qD"
msgstr ""
-#: cp/decl.c:1597
+#: cp/decl.c:1617
#, gcc-internal-format
msgid "after previous declaration %q+D"
msgstr ""
@@ -29747,334 +31055,324 @@ msgstr ""
#. that specialization that would cause an implicit
#. instantiation to take place, in every translation unit in
#. which such a use occurs.
-#: cp/decl.c:1933
+#: cp/decl.c:1968
#, gcc-internal-format
msgid "explicit specialization of %qD after first use"
msgstr ""
-#: cp/decl.c:2029
+#: cp/decl.c:2065
#, gcc-internal-format
msgid "%q+D: visibility attribute ignored because it"
msgstr ""
-#: cp/decl.c:2031
+#: cp/decl.c:2067
#, gcc-internal-format
-msgid "%Jconflicts with previous declaration here"
+msgid "conflicts with previous declaration here"
msgstr ""
-#: cp/decl.c:2464
+#: cp/decl.c:2507
#, gcc-internal-format
msgid "jump to label %qD"
msgstr ""
-#: cp/decl.c:2466
+#: cp/decl.c:2509
#, gcc-internal-format
msgid "jump to case label"
msgstr ""
-#: cp/decl.c:2468
+#: cp/decl.c:2511 cp/decl.c:2651 cp/decl.c:2692
#, gcc-internal-format
-msgid "%H from here"
+msgid " from here"
msgstr ""
-#: cp/decl.c:2487 cp/decl.c:2650
+#: cp/decl.c:2530 cp/decl.c:2695
#, gcc-internal-format
msgid " exits OpenMP structured block"
msgstr ""
-#: cp/decl.c:2508
+#: cp/decl.c:2551
#, gcc-internal-format
msgid " crosses initialization of %q+#D"
msgstr ""
-#: cp/decl.c:2510 cp/decl.c:2625
+#: cp/decl.c:2553 cp/decl.c:2669
#, gcc-internal-format
-msgid " enters scope of non-POD %q+#D"
+msgid " enters scope of %q+#D which has non-trivial destructor"
msgstr ""
-#: cp/decl.c:2523 cp/decl.c:2629
+#: cp/decl.c:2567 cp/decl.c:2674
#, gcc-internal-format
msgid " enters try block"
msgstr ""
-#: cp/decl.c:2525 cp/decl.c:2631
+#. Can't skip init of __exception_info.
+#: cp/decl.c:2569 cp/decl.c:2663 cp/decl.c:2676
#, gcc-internal-format
msgid " enters catch block"
msgstr ""
-#: cp/decl.c:2535 cp/decl.c:2634
+#: cp/decl.c:2579 cp/decl.c:2679
#, gcc-internal-format
msgid " enters OpenMP structured block"
msgstr ""
-#: cp/decl.c:2606 cp/decl.c:2646
+#: cp/decl.c:2650 cp/decl.c:2691
#, gcc-internal-format
msgid "jump to label %q+D"
msgstr ""
-#: cp/decl.c:2607 cp/decl.c:2647
-#, gcc-internal-format
-msgid " from here"
-msgstr ""
-
-#. Can't skip init of __exception_info.
-#: cp/decl.c:2619
-#, gcc-internal-format
-msgid "%J enters catch block"
-msgstr ""
-
-#: cp/decl.c:2623
+#: cp/decl.c:2667
#, gcc-internal-format
msgid " skips initialization of %q+#D"
msgstr ""
-#: cp/decl.c:2699
+#: cp/decl.c:2744
#, gcc-internal-format
msgid "label named wchar_t"
msgstr ""
-#: cp/decl.c:2703
-#, gcc-internal-format
-msgid "duplicate label %qD"
-msgstr ""
-
-#: cp/decl.c:2970
+#: cp/decl.c:3015
#, gcc-internal-format
msgid "%qD is not a type"
msgstr ""
-#: cp/decl.c:2976
+#: cp/decl.c:3021 cp/parser.c:4197
#, gcc-internal-format
msgid "%qD used without template parameters"
msgstr ""
-#: cp/decl.c:2985
+#: cp/decl.c:3030
#, gcc-internal-format
msgid "%q#T is not a class"
msgstr ""
-#: cp/decl.c:3009 cp/decl.c:3077
+#: cp/decl.c:3054 cp/decl.c:3122
#, gcc-internal-format
msgid "no class template named %q#T in %q#T"
msgstr ""
-#: cp/decl.c:3017
+#: cp/decl.c:3062
#, gcc-internal-format
msgid "%<typename %T::%D%> names %q#T, which is not a class template"
msgstr ""
-#: cp/decl.c:3024
+#: cp/decl.c:3069
#, gcc-internal-format
msgid "%<typename %T::%D%> names %q#T, which is not a type"
msgstr ""
-#: cp/decl.c:3086
+#: cp/decl.c:3131
#, gcc-internal-format
msgid "template parameters do not match template"
msgstr ""
-#: cp/decl.c:3087 cp/friend.c:321 cp/friend.c:329
+#: cp/decl.c:3132 cp/friend.c:321 cp/friend.c:329
#, gcc-internal-format
msgid "%q+D declared here"
msgstr ""
-#: cp/decl.c:3770
+#: cp/decl.c:3815
#, gcc-internal-format
-msgid "%Jan anonymous struct cannot have function members"
+msgid "an anonymous struct cannot have function members"
msgstr ""
-#: cp/decl.c:3772
+#: cp/decl.c:3818
#, gcc-internal-format
-msgid "%Jan anonymous union cannot have function members"
+msgid "an anonymous union cannot have function members"
msgstr ""
-#: cp/decl.c:3790
+#: cp/decl.c:3836
#, gcc-internal-format
msgid "member %q+#D with constructor not allowed in anonymous aggregate"
msgstr ""
-#: cp/decl.c:3793
+#: cp/decl.c:3839
#, gcc-internal-format
msgid "member %q+#D with destructor not allowed in anonymous aggregate"
msgstr ""
-#: cp/decl.c:3796
+#: cp/decl.c:3842
#, gcc-internal-format
msgid ""
"member %q+#D with copy assignment operator not allowed in anonymous aggregate"
msgstr ""
-#: cp/decl.c:3821
+#: cp/decl.c:3867
#, gcc-internal-format
msgid "multiple types in one declaration"
msgstr ""
-#: cp/decl.c:3825
+#: cp/decl.c:3871
#, gcc-internal-format
msgid "redeclaration of C++ built-in type %qT"
msgstr ""
-#: cp/decl.c:3862
+#: cp/decl.c:3908
#, gcc-internal-format
msgid "missing type-name in typedef-declaration"
msgstr ""
-#: cp/decl.c:3869
+#: cp/decl.c:3915
#, gcc-internal-format
msgid "ISO C++ prohibits anonymous structs"
msgstr ""
-#: cp/decl.c:3876
+#: cp/decl.c:3922
#, gcc-internal-format
msgid "%qs can only be specified for functions"
msgstr ""
-#: cp/decl.c:3882
+#: cp/decl.c:3928
#, gcc-internal-format
msgid "%<friend%> can only be specified inside a class"
msgstr ""
-#: cp/decl.c:3884
+#: cp/decl.c:3930
#, gcc-internal-format
msgid "%<explicit%> can only be specified for constructors"
msgstr ""
-#: cp/decl.c:3886
+#: cp/decl.c:3932
#, gcc-internal-format
msgid "a storage class can only be specified for objects and functions"
msgstr ""
-#: cp/decl.c:3892
+#: cp/decl.c:3938
#, gcc-internal-format
msgid "qualifiers can only be specified for objects and functions"
msgstr ""
-#: cp/decl.c:3895
+#: cp/decl.c:3941
#, gcc-internal-format
msgid "%<typedef%> was ignored in this declaration"
msgstr ""
-#: cp/decl.c:3924
+#: cp/decl.c:3943
+#, gcc-internal-format
+msgid "%<constexpr> cannot be used for type declarations"
+msgstr ""
+
+#: cp/decl.c:3972
#, gcc-internal-format
msgid "attribute ignored in declaration of %q+#T"
msgstr ""
-#: cp/decl.c:3925
+#: cp/decl.c:3973
#, gcc-internal-format
msgid "attribute for %q+#T must follow the %qs keyword"
msgstr ""
-#: cp/decl.c:3970
+#: cp/decl.c:4018
#, gcc-internal-format
msgid "ignoring attributes applied to class type %qT outside of definition"
msgstr ""
#. A template type parameter or other dependent type.
-#: cp/decl.c:3974
+#: cp/decl.c:4022
#, gcc-internal-format
msgid ""
"ignoring attributes applied to dependent type %qT without an associated "
"declaration"
msgstr ""
-#: cp/decl.c:4050
+#: cp/decl.c:4098
#, gcc-internal-format
msgid "typedef %qD is initialized (use decltype instead)"
msgstr ""
-#: cp/decl.c:4068
+#: cp/decl.c:4116
#, gcc-internal-format
msgid "declaration of %q#D has %<extern%> and is initialized"
msgstr ""
-#: cp/decl.c:4093
+#: cp/decl.c:4141
#, gcc-internal-format
msgid "definition of %q#D is marked %<dllimport%>"
msgstr ""
-#: cp/decl.c:4112
+#: cp/decl.c:4160
#, gcc-internal-format
msgid "%q#D is not a static member of %q#T"
msgstr ""
-#: cp/decl.c:4118
+#: cp/decl.c:4166
#, gcc-internal-format
msgid "ISO C++ does not permit %<%T::%D%> to be defined as %<%T::%D%>"
msgstr ""
-#: cp/decl.c:4127
+#: cp/decl.c:4175
#, gcc-internal-format
msgid ""
"template header not allowed in member definition of explicitly specialized "
"class"
msgstr ""
-#: cp/decl.c:4135
+#: cp/decl.c:4183
#, gcc-internal-format
msgid "duplicate initialization of %qD"
msgstr ""
-#: cp/decl.c:4174
+#: cp/decl.c:4188
+#, gcc-internal-format
+msgid "%qD declared %<constexpr%> outside its class"
+msgstr ""
+
+#: cp/decl.c:4225
#, gcc-internal-format
msgid "declaration of %q#D outside of class is not definition"
msgstr ""
-#: cp/decl.c:4269
+#: cp/decl.c:4323
#, gcc-internal-format
msgid "variable %q#D has initializer but incomplete type"
msgstr ""
-#: cp/decl.c:4275 cp/decl.c:5023
+#: cp/decl.c:4329 cp/decl.c:5077
#, gcc-internal-format
msgid "elements of array %q#D have incomplete type"
msgstr ""
-#: cp/decl.c:4282 cp/decl.c:5519
+#: cp/decl.c:4336 cp/decl.c:5573
#, gcc-internal-format
msgid "declaration of %q#D has no initializer"
msgstr ""
-#: cp/decl.c:4284
+#: cp/decl.c:4338
#, gcc-internal-format
msgid "aggregate %q#D has incomplete type and cannot be defined"
msgstr ""
-#: cp/decl.c:4320
+#: cp/decl.c:4374
#, gcc-internal-format
msgid "%qD declared as reference but not initialized"
msgstr ""
-#: cp/decl.c:4326
-#, gcc-internal-format
-msgid "ISO C++ forbids use of initializer list to initialize reference %qD"
-msgstr ""
-
-#: cp/decl.c:4352
+#: cp/decl.c:4399
#, gcc-internal-format
msgid "cannot initialize %qT from %qT"
msgstr ""
-#: cp/decl.c:4413
+#: cp/decl.c:4463
#, gcc-internal-format
msgid "name used in a GNU-style designated initializer for an array"
msgstr ""
-#: cp/decl.c:4418
+#: cp/decl.c:4468
#, gcc-internal-format
msgid "name %qD used in a GNU-style designated initializer for an array"
msgstr ""
-#: cp/decl.c:4468
+#: cp/decl.c:4518
#, gcc-internal-format
msgid "initializer fails to determine size of %qD"
msgstr ""
-#: cp/decl.c:4475
+#: cp/decl.c:4525
#, gcc-internal-format
msgid "array size missing in %qD"
msgstr ""
-#: cp/decl.c:4487
+#: cp/decl.c:4537
#, gcc-internal-format
msgid "zero-size array %qD"
msgstr ""
@@ -30082,894 +31380,897 @@ msgstr ""
#. An automatic variable with an incomplete type: that is an error.
#. Don't talk about array types here, since we took care of that
#. message in grokdeclarator.
-#: cp/decl.c:4530
+#: cp/decl.c:4580
#, gcc-internal-format
msgid "storage size of %qD isn't known"
msgstr ""
-#: cp/decl.c:4553
+#: cp/decl.c:4603
#, gcc-internal-format
msgid "storage size of %qD isn't constant"
msgstr ""
-#: cp/decl.c:4604
+#: cp/decl.c:4649
#, gcc-internal-format
msgid ""
"sorry: semantics of inline function static data %q+#D are wrong (you'll wind "
"up with multiple copies)"
msgstr ""
-#: cp/decl.c:4607
+#: cp/decl.c:4653
+#, gcc-internal-format
+msgid " you can work around this by removing the initializer"
+msgstr ""
+
+#: cp/decl.c:4673
#, gcc-internal-format
-msgid "%J you can work around this by removing the initializer"
+msgid "missing initializer for constexpr %qD"
msgstr ""
-#: cp/decl.c:4634
+#: cp/decl.c:4683
#, gcc-internal-format
msgid "uninitialized const %qD"
msgstr ""
-#: cp/decl.c:4746
+#: cp/decl.c:4795
#, gcc-internal-format
msgid "invalid type %qT as initializer for a vector of type %qT"
msgstr ""
-#: cp/decl.c:4788
+#: cp/decl.c:4837
#, gcc-internal-format
msgid "initializer for %qT must be brace-enclosed"
msgstr ""
-#: cp/decl.c:4806
+#: cp/decl.c:4855
#, gcc-internal-format
msgid "%qT has no non-static data member named %qD"
msgstr ""
-#: cp/decl.c:4862
+#: cp/decl.c:4911
#, gcc-internal-format
msgid "braces around scalar initializer for type %qT"
msgstr ""
-#: cp/decl.c:4948
+#: cp/decl.c:5002
#, gcc-internal-format
msgid "missing braces around initializer for %qT"
msgstr ""
-#: cp/decl.c:5005 cp/typeck2.c:1086 cp/typeck2.c:1109 cp/typeck2.c:1152
+#: cp/decl.c:5059 cp/typeck2.c:924 cp/typeck2.c:1099 cp/typeck2.c:1122
+#: cp/typeck2.c:1165
#, gcc-internal-format
msgid "too many initializers for %qT"
msgstr ""
-#: cp/decl.c:5025
+#: cp/decl.c:5079
#, gcc-internal-format
msgid "elements of array %q#T have incomplete type"
msgstr ""
-#: cp/decl.c:5034
+#: cp/decl.c:5088
#, gcc-internal-format
msgid "variable-sized object %qD may not be initialized"
msgstr ""
-#: cp/decl.c:5036
+#: cp/decl.c:5090
#, gcc-internal-format
msgid "variable-sized compound literal"
msgstr ""
-#: cp/decl.c:5090
+#: cp/decl.c:5144
#, gcc-internal-format
msgid "%qD has incomplete type"
msgstr ""
-#: cp/decl.c:5110
+#: cp/decl.c:5164
#, gcc-internal-format
msgid "scalar object %qD requires one element in initializer"
msgstr ""
-#: cp/decl.c:5141
+#: cp/decl.c:5195
#, gcc-internal-format
msgid "in C++98 %qD must be initialized by constructor, not by %<{...}%>"
msgstr ""
-#: cp/decl.c:5173
+#: cp/decl.c:5227
#, gcc-internal-format
msgid "array %qD initialized by parenthesized string literal %qE"
msgstr ""
-#: cp/decl.c:5187
+#: cp/decl.c:5241
#, gcc-internal-format
msgid "structure %qD with uninitialized const members"
msgstr ""
-#: cp/decl.c:5189
+#: cp/decl.c:5243
#, gcc-internal-format
msgid "structure %qD with uninitialized reference members"
msgstr ""
-#: cp/decl.c:5486
+#: cp/decl.c:5540
#, gcc-internal-format
msgid "assignment (not initialization) in declaration"
msgstr ""
-#: cp/decl.c:5545 cp/decl2.c:853
+#: cp/decl.c:5608 cp/decl2.c:866
#, gcc-internal-format
msgid "%qD cannot be defaulted"
msgstr ""
-#: cp/decl.c:5621
+#: cp/decl.c:5688
#, gcc-internal-format
msgid "shadowing previous type declaration of %q#D"
msgstr ""
-#: cp/decl.c:5651
+#: cp/decl.c:5720
#, gcc-internal-format
-msgid "%qD cannot be thread-local because it has non-POD type %qT"
+msgid "%qD cannot be thread-local because it has non-trivial type %qT"
msgstr ""
-#: cp/decl.c:5683
+#: cp/decl.c:5752
#, gcc-internal-format
msgid "Java object %qD not allocated with %<new%>"
msgstr ""
-#: cp/decl.c:5700
+#: cp/decl.c:5769
#, gcc-internal-format
msgid "%qD is thread-local and so cannot be dynamically initialized"
msgstr ""
-#: cp/decl.c:5718
+#: cp/decl.c:5787
#, gcc-internal-format
msgid ""
"%qD cannot be initialized by a non-constant expression when being declared"
msgstr ""
-#: cp/decl.c:5758
+#: cp/decl.c:5836
#, gcc-internal-format
msgid "non-static data member %qD has Java class type"
msgstr ""
-#: cp/decl.c:5822
+#: cp/decl.c:5900
#, gcc-internal-format
msgid "function %q#D is initialized like a variable"
msgstr ""
-#: cp/decl.c:6411
+#: cp/decl.c:6480
#, gcc-internal-format
msgid "destructor for alien class %qT cannot be a member"
msgstr ""
-#: cp/decl.c:6413
+#: cp/decl.c:6482
#, gcc-internal-format
msgid "constructor for alien class %qT cannot be a member"
msgstr ""
-#: cp/decl.c:6434
+#: cp/decl.c:6503
#, gcc-internal-format
msgid "%qD declared as a %<virtual%> %s"
msgstr ""
-#: cp/decl.c:6436
+#: cp/decl.c:6505
#, gcc-internal-format
msgid "%qD declared as an %<inline%> %s"
msgstr ""
-#: cp/decl.c:6438
+#: cp/decl.c:6507
#, gcc-internal-format
msgid ""
"%<const%> and %<volatile%> function specifiers on %qD invalid in %s "
"declaration"
msgstr ""
-#: cp/decl.c:6442
+#: cp/decl.c:6511
#, gcc-internal-format
msgid "%q+D declared as a friend"
msgstr ""
-#: cp/decl.c:6448
+#: cp/decl.c:6517
#, gcc-internal-format
msgid "%q+D declared with an exception specification"
msgstr ""
-#: cp/decl.c:6482
+#: cp/decl.c:6551
#, gcc-internal-format
msgid "definition of %qD is not in namespace enclosing %qT"
msgstr ""
-#: cp/decl.c:6602
+#: cp/decl.c:6672
#, gcc-internal-format
msgid "defining explicit specialization %qD in friend declaration"
msgstr ""
#. Something like `template <class T> friend void f<T>()'.
-#: cp/decl.c:6612
+#: cp/decl.c:6682
#, gcc-internal-format
msgid "invalid use of template-id %qD in declaration of primary template"
msgstr ""
-#: cp/decl.c:6642
+#: cp/decl.c:6712
#, gcc-internal-format
msgid ""
"default arguments are not allowed in declaration of friend template "
"specialization %qD"
msgstr ""
-#: cp/decl.c:6650
+#: cp/decl.c:6720
#, gcc-internal-format
msgid ""
"%<inline%> is not allowed in declaration of friend template specialization %"
"qD"
msgstr ""
-#: cp/decl.c:6693
+#: cp/decl.c:6763
#, gcc-internal-format
msgid "cannot declare %<::main%> to be a template"
msgstr ""
-#: cp/decl.c:6695
+#: cp/decl.c:6765
#, gcc-internal-format
msgid "cannot declare %<::main%> to be inline"
msgstr ""
-#: cp/decl.c:6697
+#: cp/decl.c:6767
#, gcc-internal-format
msgid "cannot declare %<::main%> to be static"
msgstr ""
-#: cp/decl.c:6725
-#, gcc-internal-format
-msgid "non-local function %q#D uses anonymous type"
-msgstr ""
-
-#: cp/decl.c:6728 cp/decl.c:7004
-#, gcc-internal-format
-msgid ""
-"%q+#D does not refer to the unqualified type, so it is not used for linkage"
-msgstr ""
-
-#: cp/decl.c:6734
-#, gcc-internal-format
-msgid "non-local function %q#D uses local type %qT"
-msgstr ""
-
-#: cp/decl.c:6753
+#: cp/decl.c:6793
#, gcc-internal-format
msgid "static member function %qD cannot have cv-qualifier"
msgstr ""
-#: cp/decl.c:6754
+#: cp/decl.c:6794
#, gcc-internal-format
msgid "non-member function %qD cannot have cv-qualifier"
msgstr ""
-#: cp/decl.c:6802
+#: cp/decl.c:6839
#, gcc-internal-format
msgid "%<::main%> must return %<int%>"
msgstr ""
-#: cp/decl.c:6842
+#: cp/decl.c:6879
#, gcc-internal-format
msgid "definition of implicitly-declared %qD"
msgstr ""
-#: cp/decl.c:6859 cp/decl2.c:685
+#: cp/decl.c:6896 cp/decl2.c:692
#, gcc-internal-format
msgid "no %q#D member function declared in class %qT"
msgstr ""
-#. DRs 132, 319 and 389 seem to indicate types with
-#. no linkage can only be used to declare extern "C"
-#. entities. Since it's not always an error in the
-#. ISO C++ 90 Standard, we only issue a warning.
-#: cp/decl.c:7001
-#, gcc-internal-format
-msgid "non-local variable %q#D uses anonymous type"
-msgstr ""
-
-#: cp/decl.c:7010
-#, gcc-internal-format
-msgid "non-local variable %q#D uses local type %qT"
-msgstr ""
-
-#: cp/decl.c:7133
+#: cp/decl.c:7152
#, gcc-internal-format
msgid ""
"invalid in-class initialization of static data member of non-integral type %"
"qT"
msgstr ""
-#: cp/decl.c:7143
+#: cp/decl.c:7162
#, gcc-internal-format
msgid "ISO C++ forbids in-class initialization of non-const static member %qD"
msgstr ""
-#: cp/decl.c:7147
+#: cp/decl.c:7166
#, gcc-internal-format
msgid ""
"ISO C++ forbids initialization of member constant %qD of non-integral type %"
"qT"
msgstr ""
-#: cp/decl.c:7172
+#: cp/decl.c:7191
#, gcc-internal-format
msgid "size of array %qD has non-integral type %qT"
msgstr ""
-#: cp/decl.c:7174
+#: cp/decl.c:7193
#, gcc-internal-format
msgid "size of array has non-integral type %qT"
msgstr ""
-#: cp/decl.c:7226
+#: cp/decl.c:7245
#, gcc-internal-format
msgid "size of array %qD is negative"
msgstr ""
-#: cp/decl.c:7228
+#: cp/decl.c:7247
#, gcc-internal-format
msgid "size of array is negative"
msgstr ""
-#: cp/decl.c:7236
+#: cp/decl.c:7255
#, gcc-internal-format
msgid "ISO C++ forbids zero-size array %qD"
msgstr ""
-#: cp/decl.c:7238
+#: cp/decl.c:7257
#, gcc-internal-format
msgid "ISO C++ forbids zero-size array"
msgstr ""
-#: cp/decl.c:7245
+#: cp/decl.c:7264
#, gcc-internal-format
msgid "size of array %qD is not an integral constant-expression"
msgstr ""
-#: cp/decl.c:7248
+#: cp/decl.c:7267
#, gcc-internal-format
msgid "size of array is not an integral constant-expression"
msgstr ""
-#: cp/decl.c:7254
+#: cp/decl.c:7273
#, gcc-internal-format
msgid "ISO C++ forbids variable length array %qD"
msgstr ""
-#: cp/decl.c:7256
+#: cp/decl.c:7275
#, gcc-internal-format
msgid "ISO C++ forbids variable length array"
msgstr ""
-#: cp/decl.c:7262
+#: cp/decl.c:7281
#, gcc-internal-format
msgid "variable length array %qD is used"
msgstr ""
-#: cp/decl.c:7298
+#: cp/decl.c:7317
#, gcc-internal-format
msgid "overflow in array dimension"
msgstr ""
-#: cp/decl.c:7379
+#: cp/decl.c:7398
#, gcc-internal-format
msgid "declaration of %qD as %s"
msgstr ""
-#: cp/decl.c:7381
+#: cp/decl.c:7400
#, gcc-internal-format
msgid "creating %s"
msgstr ""
-#: cp/decl.c:7393
+#: cp/decl.c:7412
#, gcc-internal-format
msgid ""
"declaration of %qD as multidimensional array must have bounds for all "
"dimensions except the first"
msgstr ""
-#: cp/decl.c:7397
+#: cp/decl.c:7416
#, gcc-internal-format
msgid ""
"multidimensional array must have bounds for all dimensions except the first"
msgstr ""
-#: cp/decl.c:7432
+#: cp/decl.c:7451
#, gcc-internal-format
msgid "return type specification for constructor invalid"
msgstr ""
-#: cp/decl.c:7442
+#: cp/decl.c:7461
#, gcc-internal-format
msgid "return type specification for destructor invalid"
msgstr ""
-#: cp/decl.c:7455
+#: cp/decl.c:7474
#, gcc-internal-format
msgid "return type specified for %<operator %T%>"
msgstr ""
-#: cp/decl.c:7477
+#: cp/decl.c:7496
#, gcc-internal-format
msgid "unnamed variable or field declared void"
msgstr ""
-#: cp/decl.c:7484
+#: cp/decl.c:7503
#, gcc-internal-format
msgid "variable or field declared void"
msgstr ""
-#: cp/decl.c:7657
+#: cp/decl.c:7677
#, gcc-internal-format
msgid "invalid use of qualified-name %<::%D%>"
msgstr ""
-#: cp/decl.c:7660
+#: cp/decl.c:7680
#, gcc-internal-format
msgid "invalid use of qualified-name %<%T::%D%>"
msgstr ""
-#: cp/decl.c:7663
+#: cp/decl.c:7683
#, gcc-internal-format
msgid "invalid use of qualified-name %<%D::%D%>"
msgstr ""
-#: cp/decl.c:7675
+#: cp/decl.c:7695
#, gcc-internal-format
msgid "type %qT is not derived from type %qT"
msgstr ""
-#: cp/decl.c:7691 cp/decl.c:7783 cp/decl.c:8985
+#: cp/decl.c:7711 cp/decl.c:7803 cp/decl.c:9063
#, gcc-internal-format
msgid "declaration of %qD as non-function"
msgstr ""
-#: cp/decl.c:7697
+#: cp/decl.c:7717
#, gcc-internal-format
msgid "declaration of %qD as non-member"
msgstr ""
-#: cp/decl.c:7728
+#: cp/decl.c:7748
#, gcc-internal-format
msgid "declarator-id missing; using reserved word %qD"
msgstr ""
-#: cp/decl.c:7775
+#: cp/decl.c:7795
#, gcc-internal-format
msgid "function definition does not declare parameters"
msgstr ""
-#: cp/decl.c:7817
+#: cp/decl.c:7837
#, gcc-internal-format
msgid "two or more data types in declaration of %qs"
msgstr ""
-#: cp/decl.c:7823
+#: cp/decl.c:7843
#, gcc-internal-format
msgid "conflicting specifiers in declaration of %qs"
msgstr ""
-#: cp/decl.c:7894 cp/decl.c:7897 cp/decl.c:7900
+#: cp/decl.c:7914 cp/decl.c:7917 cp/decl.c:7920
#, gcc-internal-format
msgid "ISO C++ forbids declaration of %qs with no type"
msgstr ""
-#: cp/decl.c:7925 cp/decl.c:7943
+#: cp/decl.c:7945 cp/decl.c:7963
#, gcc-internal-format
msgid "%<signed%> or %<unsigned%> invalid for %qs"
msgstr ""
-#: cp/decl.c:7927
+#: cp/decl.c:7947
#, gcc-internal-format
msgid "%<signed%> and %<unsigned%> specified together for %qs"
msgstr ""
-#: cp/decl.c:7929
+#: cp/decl.c:7949
#, gcc-internal-format
msgid "%<long long%> invalid for %qs"
msgstr ""
-#: cp/decl.c:7931
+#: cp/decl.c:7951
#, gcc-internal-format
msgid "%<long%> invalid for %qs"
msgstr ""
-#: cp/decl.c:7933
+#: cp/decl.c:7953
#, gcc-internal-format
msgid "%<short%> invalid for %qs"
msgstr ""
-#: cp/decl.c:7935
+#: cp/decl.c:7955
#, gcc-internal-format
msgid "%<long%> or %<short%> invalid for %qs"
msgstr ""
-#: cp/decl.c:7937
+#: cp/decl.c:7957
#, gcc-internal-format
msgid "%<long%> or %<short%> specified with char for %qs"
msgstr ""
-#: cp/decl.c:7939
+#: cp/decl.c:7959
#, gcc-internal-format
msgid "%<long%> and %<short%> specified together for %qs"
msgstr ""
-#: cp/decl.c:7945
+#: cp/decl.c:7965
#, gcc-internal-format
msgid "%<short%> or %<long%> invalid for %qs"
msgstr ""
-#: cp/decl.c:7953
+#: cp/decl.c:7973
#, gcc-internal-format
msgid "long, short, signed or unsigned used invalidly for %qs"
msgstr ""
-#: cp/decl.c:8017
+#: cp/decl.c:8037
#, gcc-internal-format
msgid "complex invalid for %qs"
msgstr ""
-#: cp/decl.c:8046
+#: cp/decl.c:8068
+#, gcc-internal-format
+msgid "both %<const%> and %<constexpr%> cannot be used here"
+msgstr ""
+
+#: cp/decl.c:8077
#, gcc-internal-format
msgid "qualifiers are not allowed on declaration of %<operator %T%>"
msgstr ""
-#: cp/decl.c:8059 cp/typeck.c:7293
+#: cp/decl.c:8090 cp/typeck.c:7458
#, gcc-internal-format
msgid "ignoring %qV qualifiers added to function type %qT"
msgstr ""
-#: cp/decl.c:8082
+#: cp/decl.c:8113
#, gcc-internal-format
msgid "member %qD cannot be declared both virtual and static"
msgstr ""
-#: cp/decl.c:8090
+#: cp/decl.c:8121
#, gcc-internal-format
msgid "%<%T::%D%> is not a valid declarator"
msgstr ""
-#: cp/decl.c:8099
+#: cp/decl.c:8130
#, gcc-internal-format
msgid "typedef declaration invalid in parameter declaration"
msgstr ""
-#: cp/decl.c:8105
+#: cp/decl.c:8136
#, gcc-internal-format
msgid "storage class specifiers invalid in parameter declarations"
msgstr ""
-#: cp/decl.c:8109
+#: cp/decl.c:8140
#, gcc-internal-format
msgid "parameter declared %<auto%>"
msgstr ""
-#: cp/decl.c:8118
+#: cp/decl.c:8148
+#, gcc-internal-format
+msgid "a parameter cannot be declared %<constexpr%>"
+msgstr ""
+
+#: cp/decl.c:8157
#, gcc-internal-format
msgid "%<virtual%> outside class declaration"
msgstr ""
-#: cp/decl.c:8136
+#: cp/decl.c:8175
#, gcc-internal-format
msgid "multiple storage classes in declaration of %qs"
msgstr ""
-#: cp/decl.c:8159
+#: cp/decl.c:8198
#, gcc-internal-format
msgid "storage class specified for %qs"
msgstr ""
-#: cp/decl.c:8163
+#: cp/decl.c:8202
#, gcc-internal-format
msgid "storage class specified for parameter %qs"
msgstr ""
-#: cp/decl.c:8176
+#: cp/decl.c:8215
#, gcc-internal-format
msgid "nested function %qs declared %<extern%>"
msgstr ""
-#: cp/decl.c:8180
+#: cp/decl.c:8219
#, gcc-internal-format
msgid "top-level declaration of %qs specifies %<auto%>"
msgstr ""
-#: cp/decl.c:8186
+#: cp/decl.c:8225
#, gcc-internal-format
msgid "function-scope %qs implicitly auto and declared %<__thread%>"
msgstr ""
-#: cp/decl.c:8193
+#: cp/decl.c:8232
#, gcc-internal-format
msgid "storage class specifiers invalid in friend function declarations"
msgstr ""
-#: cp/decl.c:8282
+#: cp/decl.c:8326
#, gcc-internal-format
msgid "%qs declared as function returning a function"
msgstr ""
-#: cp/decl.c:8287
+#: cp/decl.c:8331
#, gcc-internal-format
msgid "%qs declared as function returning an array"
msgstr ""
-#: cp/decl.c:8308
+#: cp/decl.c:8352
#, gcc-internal-format
msgid "%qs function uses %<auto%> type specifier without late return type"
msgstr ""
-#: cp/decl.c:8314
+#: cp/decl.c:8358
#, gcc-internal-format
msgid ""
"%qs function with late return type has %qT as its type rather than plain %"
"<auto%>"
msgstr ""
-#: cp/decl.c:8322
+#: cp/decl.c:8366
#, gcc-internal-format
msgid ""
"%qs function with late return type not declared with %<auto%> type specifier"
msgstr ""
-#: cp/decl.c:8355
+#: cp/decl.c:8399
#, gcc-internal-format
msgid "destructor cannot be static member function"
msgstr ""
-#: cp/decl.c:8360
+#: cp/decl.c:8404
#, gcc-internal-format
msgid "destructors may not be cv-qualified"
msgstr ""
-#: cp/decl.c:8378
+#: cp/decl.c:8422
#, gcc-internal-format
msgid "constructors cannot be declared virtual"
msgstr ""
-#: cp/decl.c:8391
+#: cp/decl.c:8435
#, gcc-internal-format
msgid "can't initialize friend function %qs"
msgstr ""
#. Cannot be both friend and virtual.
-#: cp/decl.c:8395
+#: cp/decl.c:8439
#, gcc-internal-format
msgid "virtual functions cannot be friends"
msgstr ""
-#: cp/decl.c:8399
+#: cp/decl.c:8443
#, gcc-internal-format
msgid "friend declaration not in class definition"
msgstr ""
-#: cp/decl.c:8401
+#: cp/decl.c:8445
#, gcc-internal-format
msgid "can't define friend function %qs in a local class definition"
msgstr ""
-#: cp/decl.c:8414
+#: cp/decl.c:8463
+#, gcc-internal-format
+msgid ""
+"the %<constexpr%> specifier cannot be used in a function declaration that is "
+"not a definition"
+msgstr ""
+
+#: cp/decl.c:8481
#, gcc-internal-format
msgid "destructors may not have parameters"
msgstr ""
-#: cp/decl.c:8433
+#: cp/decl.c:8500
#, gcc-internal-format
msgid "cannot declare pointer to %q#T"
msgstr ""
-#: cp/decl.c:8446 cp/decl.c:8453
+#: cp/decl.c:8513 cp/decl.c:8520
#, gcc-internal-format
msgid "cannot declare reference to %q#T"
msgstr ""
-#: cp/decl.c:8455
+#: cp/decl.c:8522
#, gcc-internal-format
msgid "cannot declare pointer to %q#T member"
msgstr ""
-#: cp/decl.c:8475
+#: cp/decl.c:8542
#, gcc-internal-format
msgid "cannot declare %s to qualified function type %qT"
msgstr ""
-#: cp/decl.c:8512
+#: cp/decl.c:8579
#, gcc-internal-format
msgid ""
"cannot declare reference to %q#T, which is not a typedef or a template type "
"argument"
msgstr ""
-#: cp/decl.c:8556
+#: cp/decl.c:8623
#, gcc-internal-format
msgid "template-id %qD used as a declarator"
msgstr ""
-#: cp/decl.c:8607
+#: cp/decl.c:8674
#, gcc-internal-format
msgid "member functions are implicitly friends of their class"
msgstr ""
-#: cp/decl.c:8612
+#: cp/decl.c:8679
#, gcc-internal-format
msgid "extra qualification %<%T::%> on member %qs"
msgstr ""
-#: cp/decl.c:8644
+#: cp/decl.c:8711
#, gcc-internal-format
msgid "cannot define member function %<%T::%s%> within %<%T%>"
msgstr ""
-#: cp/decl.c:8661
+#: cp/decl.c:8720
+#, gcc-internal-format
+msgid "a constexpr function cannot be defined outside of its class."
+msgstr ""
+
+#: cp/decl.c:8734
#, gcc-internal-format
msgid "cannot declare member %<%T::%s%> within %qT"
msgstr ""
-#: cp/decl.c:8684
+#: cp/decl.c:8757
#, gcc-internal-format
msgid "non-parameter %qs cannot be a parameter pack"
msgstr ""
-#: cp/decl.c:8694
+#: cp/decl.c:8767
#, gcc-internal-format
msgid "size of array %qs is too large"
msgstr ""
-#: cp/decl.c:8705
+#: cp/decl.c:8778
#, gcc-internal-format
msgid "data member may not have variably modified type %qT"
msgstr ""
-#: cp/decl.c:8707
+#: cp/decl.c:8780
#, gcc-internal-format
msgid "parameter may not have variably modified type %qT"
msgstr ""
#. [dcl.fct.spec] The explicit specifier shall only be used in
#. declarations of constructors within a class definition.
-#: cp/decl.c:8715
+#: cp/decl.c:8788
#, gcc-internal-format
msgid "only declarations of constructors can be %<explicit%>"
msgstr ""
-#: cp/decl.c:8723
+#: cp/decl.c:8796
#, gcc-internal-format
msgid "non-member %qs cannot be declared %<mutable%>"
msgstr ""
-#: cp/decl.c:8728
+#: cp/decl.c:8801
#, gcc-internal-format
msgid "non-object member %qs cannot be declared %<mutable%>"
msgstr ""
-#: cp/decl.c:8734
+#: cp/decl.c:8807
#, gcc-internal-format
msgid "function %qs cannot be declared %<mutable%>"
msgstr ""
-#: cp/decl.c:8739
+#: cp/decl.c:8812
#, gcc-internal-format
msgid "static %qs cannot be declared %<mutable%>"
msgstr ""
-#: cp/decl.c:8744
+#: cp/decl.c:8817
#, gcc-internal-format
msgid "const %qs cannot be declared %<mutable%>"
msgstr ""
-#: cp/decl.c:8781
+#: cp/decl.c:8855
#, gcc-internal-format
-msgid "%Jtypedef name may not be a nested-name-specifier"
+msgid "typedef name may not be a nested-name-specifier"
msgstr ""
-#: cp/decl.c:8799
+#: cp/decl.c:8873
#, gcc-internal-format
msgid "ISO C++ forbids nested type %qD with same name as enclosing class"
msgstr ""
-#: cp/decl.c:8887
+#: cp/decl.c:8965
#, gcc-internal-format
msgid ""
"qualified function types cannot be used to declare static member functions"
msgstr ""
-#: cp/decl.c:8889
+#: cp/decl.c:8967
#, gcc-internal-format
msgid "qualified function types cannot be used to declare free functions"
msgstr ""
-#: cp/decl.c:8915
+#: cp/decl.c:8993
#, gcc-internal-format
msgid "type qualifiers specified for friend class declaration"
msgstr ""
-#: cp/decl.c:8920
+#: cp/decl.c:8998
#, gcc-internal-format
msgid "%<inline%> specified for friend class declaration"
msgstr ""
-#: cp/decl.c:8928
+#: cp/decl.c:9006
#, gcc-internal-format
msgid "template parameters cannot be friends"
msgstr ""
-#: cp/decl.c:8930
+#: cp/decl.c:9008
#, gcc-internal-format
msgid "friend declaration requires class-key, i.e. %<friend class %T::%D%>"
msgstr ""
-#: cp/decl.c:8934
+#: cp/decl.c:9012
#, gcc-internal-format
msgid "friend declaration requires class-key, i.e. %<friend %#T%>"
msgstr ""
-#: cp/decl.c:8947
+#: cp/decl.c:9025
#, gcc-internal-format
msgid "trying to make class %qT a friend of global scope"
msgstr ""
-#: cp/decl.c:8965
+#: cp/decl.c:9043
#, gcc-internal-format
msgid "invalid qualifiers on non-member function type"
msgstr ""
-#: cp/decl.c:8975
+#: cp/decl.c:9053
#, gcc-internal-format
msgid "abstract declarator %qT used as declaration"
msgstr ""
-#: cp/decl.c:9004
+#: cp/decl.c:9082
#, gcc-internal-format
msgid "cannot use %<::%> in parameter declaration"
msgstr ""
#. Something like struct S { int N::j; };
-#: cp/decl.c:9050
+#: cp/decl.c:9128
#, gcc-internal-format
msgid "invalid use of %<::%>"
msgstr ""
-#: cp/decl.c:9065
+#: cp/decl.c:9143
#, gcc-internal-format
msgid "can't make %qD into a method -- not in a class"
msgstr ""
-#: cp/decl.c:9074
+#: cp/decl.c:9152
#, gcc-internal-format
msgid "function %qD declared virtual inside a union"
msgstr ""
-#: cp/decl.c:9083
+#: cp/decl.c:9161
#, gcc-internal-format
msgid "%qD cannot be declared virtual, since it is always static"
msgstr ""
-#: cp/decl.c:9101
+#: cp/decl.c:9179
#, gcc-internal-format
msgid "expected qualified name in friend declaration for destructor %qD"
msgstr ""
-#: cp/decl.c:9108
+#: cp/decl.c:9186
#, gcc-internal-format
msgid "declaration of %qD as member of %qT"
msgstr ""
-#: cp/decl.c:9115
+#: cp/decl.c:9191
+#, gcc-internal-format
+msgid "a destructor cannot be %<constexpr%>"
+msgstr ""
+
+#: cp/decl.c:9195
#, gcc-internal-format
msgid "expected qualified name in friend declaration for constructor %qD"
msgstr ""
-#: cp/decl.c:9178
+#: cp/decl.c:9259
#, gcc-internal-format
msgid "field %qD has incomplete type"
msgstr ""
-#: cp/decl.c:9180
+#: cp/decl.c:9261
#, gcc-internal-format
msgid "name %qT has incomplete type"
msgstr ""
-#: cp/decl.c:9189
+#: cp/decl.c:9270
#, gcc-internal-format
msgid " in instantiation of template %qT"
msgstr ""
-#: cp/decl.c:9198
+#: cp/decl.c:9279
#, gcc-internal-format
msgid "%qE is neither function nor member function; cannot be declared friend"
msgstr ""
@@ -30986,127 +32287,132 @@ msgstr ""
#. the rest of the compiler does not correctly
#. handle the initialization unless the member is
#. static so we make it static below.
-#: cp/decl.c:9250
+#: cp/decl.c:9332
#, gcc-internal-format
msgid "ISO C++ forbids initialization of member %qD"
msgstr ""
-#: cp/decl.c:9252
+#: cp/decl.c:9334
#, gcc-internal-format
msgid "making %qD static"
msgstr ""
-#: cp/decl.c:9317
+#: cp/decl.c:9368
+#, gcc-internal-format
+msgid "non-static data member %qE declared %<constexpr%>"
+msgstr ""
+
+#: cp/decl.c:9403
#, gcc-internal-format
msgid "storage class %<auto%> invalid for function %qs"
msgstr ""
-#: cp/decl.c:9319
+#: cp/decl.c:9405
#, gcc-internal-format
msgid "storage class %<register%> invalid for function %qs"
msgstr ""
-#: cp/decl.c:9321
+#: cp/decl.c:9407
#, gcc-internal-format
msgid "storage class %<__thread%> invalid for function %qs"
msgstr ""
-#: cp/decl.c:9333
+#: cp/decl.c:9419
#, gcc-internal-format
msgid ""
"%<static%> specified invalid for function %qs declared out of global scope"
msgstr ""
-#: cp/decl.c:9337
+#: cp/decl.c:9423
#, gcc-internal-format
msgid ""
"%<inline%> specifier invalid for function %qs declared out of global scope"
msgstr ""
-#: cp/decl.c:9344
+#: cp/decl.c:9430
#, gcc-internal-format
msgid "%q#T is not a class or a namespace"
msgstr ""
-#: cp/decl.c:9352
+#: cp/decl.c:9438
#, gcc-internal-format
msgid "virtual non-class function %qs"
msgstr ""
-#: cp/decl.c:9359
+#: cp/decl.c:9445
#, gcc-internal-format
msgid "%qs defined in a non-class scope"
msgstr ""
-#: cp/decl.c:9392
+#: cp/decl.c:9478
#, gcc-internal-format
msgid "cannot declare member function %qD to have static linkage"
msgstr ""
#. FIXME need arm citation
-#: cp/decl.c:9399
+#: cp/decl.c:9485
#, gcc-internal-format
msgid "cannot declare static function inside another function"
msgstr ""
-#: cp/decl.c:9429
+#: cp/decl.c:9515
#, gcc-internal-format
msgid ""
"%<static%> may not be used when defining (as opposed to declaring) a static "
"data member"
msgstr ""
-#: cp/decl.c:9436
+#: cp/decl.c:9522
#, gcc-internal-format
msgid "static member %qD declared %<register%>"
msgstr ""
-#: cp/decl.c:9442
+#: cp/decl.c:9528
#, gcc-internal-format
msgid "cannot explicitly declare member %q#D to have extern linkage"
msgstr ""
-#: cp/decl.c:9456
+#: cp/decl.c:9542
#, gcc-internal-format
msgid "%qs initialized and declared %<extern%>"
msgstr ""
-#: cp/decl.c:9460
+#: cp/decl.c:9546
#, gcc-internal-format
msgid "%qs has both %<extern%> and initializer"
msgstr ""
-#: cp/decl.c:9586
+#: cp/decl.c:9673
#, gcc-internal-format
msgid "default argument for %q#D has type %qT"
msgstr ""
-#: cp/decl.c:9589
+#: cp/decl.c:9676
#, gcc-internal-format
msgid "default argument for parameter of type %qT has type %qT"
msgstr ""
-#: cp/decl.c:9605
+#: cp/decl.c:9692
#, gcc-internal-format
msgid "default argument %qE uses local variable %qD"
msgstr ""
-#: cp/decl.c:9688
+#: cp/decl.c:9776
#, gcc-internal-format
msgid "parameter %qD has Java class type"
msgstr ""
-#: cp/decl.c:9708
+#: cp/decl.c:9804
#, gcc-internal-format
msgid "parameter %qD invalidly declared method type"
msgstr ""
-#: cp/decl.c:9732
+#: cp/decl.c:9828
#, gcc-internal-format
msgid "parameter %qD includes %s to array of unknown bound %qT"
msgstr ""
-#: cp/decl.c:9747
+#: cp/decl.c:9843
#, gcc-internal-format
msgid "parameter packs must be at the end of the parameter list"
msgstr ""
@@ -31126,139 +32432,139 @@ msgstr ""
#. or implicitly defined), there's no need to worry about their
#. existence. Theoretically, they should never even be
#. instantiated, but that's hard to forestall.
-#: cp/decl.c:9970
+#: cp/decl.c:10071
#, gcc-internal-format
msgid "invalid constructor; you probably meant %<%T (const %T&)%>"
msgstr ""
-#: cp/decl.c:10092
+#: cp/decl.c:10193
#, gcc-internal-format
msgid "%qD may not be declared within a namespace"
msgstr ""
-#: cp/decl.c:10097
+#: cp/decl.c:10198
#, gcc-internal-format
msgid "%qD may not be declared as static"
msgstr ""
-#: cp/decl.c:10123
+#: cp/decl.c:10224
#, gcc-internal-format
msgid "%qD must be a nonstatic member function"
msgstr ""
-#: cp/decl.c:10132
+#: cp/decl.c:10233
#, gcc-internal-format
msgid ""
"%qD must be either a non-static member function or a non-member function"
msgstr ""
-#: cp/decl.c:10154
+#: cp/decl.c:10255
#, gcc-internal-format
msgid "%qD must have an argument of class or enumerated type"
msgstr ""
-#: cp/decl.c:10195
+#: cp/decl.c:10296
#, gcc-internal-format
msgid "conversion to %s%s will never use a type conversion operator"
msgstr ""
#. 13.4.0.3
-#: cp/decl.c:10203
+#: cp/decl.c:10304
#, gcc-internal-format
msgid "ISO C++ prohibits overloading operator ?:"
msgstr ""
-#: cp/decl.c:10208
+#: cp/decl.c:10309
#, gcc-internal-format
msgid "%qD must not have variable number of arguments"
msgstr ""
-#: cp/decl.c:10259
+#: cp/decl.c:10360
#, gcc-internal-format
msgid "postfix %qD must take %<int%> as its argument"
msgstr ""
-#: cp/decl.c:10262
+#: cp/decl.c:10363
#, gcc-internal-format
msgid "postfix %qD must take %<int%> as its second argument"
msgstr ""
-#: cp/decl.c:10270
+#: cp/decl.c:10371
#, gcc-internal-format
msgid "%qD must take either zero or one argument"
msgstr ""
-#: cp/decl.c:10272
+#: cp/decl.c:10373
#, gcc-internal-format
msgid "%qD must take either one or two arguments"
msgstr ""
-#: cp/decl.c:10294
+#: cp/decl.c:10395
#, gcc-internal-format
msgid "prefix %qD should return %qT"
msgstr ""
-#: cp/decl.c:10300
+#: cp/decl.c:10401
#, gcc-internal-format
msgid "postfix %qD should return %qT"
msgstr ""
-#: cp/decl.c:10309
+#: cp/decl.c:10410
#, gcc-internal-format
msgid "%qD must take %<void%>"
msgstr ""
-#: cp/decl.c:10311 cp/decl.c:10320
+#: cp/decl.c:10412 cp/decl.c:10421
#, gcc-internal-format
msgid "%qD must take exactly one argument"
msgstr ""
-#: cp/decl.c:10322
+#: cp/decl.c:10423
#, gcc-internal-format
msgid "%qD must take exactly two arguments"
msgstr ""
-#: cp/decl.c:10331
+#: cp/decl.c:10432
#, gcc-internal-format
msgid "user-defined %qD always evaluates both arguments"
msgstr ""
-#: cp/decl.c:10345
+#: cp/decl.c:10446
#, gcc-internal-format
msgid "%qD should return by value"
msgstr ""
-#: cp/decl.c:10356 cp/decl.c:10361
+#: cp/decl.c:10457 cp/decl.c:10462
#, gcc-internal-format
msgid "%qD cannot have default arguments"
msgstr ""
-#: cp/decl.c:10419
+#: cp/decl.c:10520
#, gcc-internal-format
msgid "using template type parameter %qT after %qs"
msgstr ""
-#: cp/decl.c:10434
+#: cp/decl.c:10535
#, gcc-internal-format
msgid "using typedef-name %qD after %qs"
msgstr ""
-#: cp/decl.c:10435
+#: cp/decl.c:10536
#, gcc-internal-format
msgid "%q+D has a previous declaration here"
msgstr ""
-#: cp/decl.c:10443
+#: cp/decl.c:10544
#, gcc-internal-format
msgid "%qT referred to as %qs"
msgstr ""
-#: cp/decl.c:10444 cp/decl.c:10451
+#: cp/decl.c:10545 cp/decl.c:10552
#, gcc-internal-format
msgid "%q+T has a previous declaration here"
msgstr ""
-#: cp/decl.c:10450
+#: cp/decl.c:10551
#, gcc-internal-format
msgid "%qT referred to as enum"
msgstr ""
@@ -31270,77 +32576,78 @@ msgstr ""
#. void f(class C); // No template header here
#.
#. then the required template argument is missing.
-#: cp/decl.c:10465
+#: cp/decl.c:10566
#, gcc-internal-format
msgid "template argument required for %<%s %T%>"
msgstr ""
-#: cp/decl.c:10513 cp/name-lookup.c:2807
+#: cp/decl.c:10614 cp/name-lookup.c:2818
#, gcc-internal-format
msgid "%qD has the same name as the class in which it is declared"
msgstr ""
-#: cp/decl.c:10543 cp/name-lookup.c:2315
+#: cp/decl.c:10644 cp/name-lookup.c:2323 cp/parser.c:4202 cp/parser.c:15645
+#: cp/parser.c:17996
#, gcc-internal-format
msgid "reference to %qD is ambiguous"
msgstr ""
-#: cp/decl.c:10657
+#: cp/decl.c:10758
#, gcc-internal-format
msgid "use of enum %q#D without previous declaration"
msgstr ""
-#: cp/decl.c:10678
+#: cp/decl.c:10779
#, gcc-internal-format
msgid "redeclaration of %qT as a non-template"
msgstr ""
-#: cp/decl.c:10679
+#: cp/decl.c:10780
#, gcc-internal-format
msgid "previous declaration %q+D"
msgstr ""
-#: cp/decl.c:10793
+#: cp/decl.c:10894
#, gcc-internal-format
msgid "derived union %qT invalid"
msgstr ""
-#: cp/decl.c:10802
+#: cp/decl.c:10903
#, gcc-internal-format
msgid "Java class %qT cannot have multiple bases"
msgstr ""
-#: cp/decl.c:10813
+#: cp/decl.c:10914
#, gcc-internal-format
msgid "Java class %qT cannot have virtual bases"
msgstr ""
-#: cp/decl.c:10833
+#: cp/decl.c:10934
#, gcc-internal-format
msgid "base type %qT fails to be a struct or class type"
msgstr ""
-#: cp/decl.c:10866
+#: cp/decl.c:10967
#, gcc-internal-format
msgid "recursive type %qT undefined"
msgstr ""
-#: cp/decl.c:10868
+#: cp/decl.c:10969
#, gcc-internal-format
msgid "duplicate base type %qT invalid"
msgstr ""
-#: cp/decl.c:10952
+#: cp/decl.c:11053
#, gcc-internal-format
msgid "multiple definition of %q#T"
msgstr ""
-#: cp/decl.c:10953
+#: cp/decl.c:11055
#, gcc-internal-format
-msgid "%Jprevious definition here"
+msgid "previous definition here"
msgstr ""
-#: cp/decl.c:11000
+#: cp/decl.c:11102
#, gcc-internal-format
msgid "underlying type %<%T%> of %<%T%> must be an integral type"
msgstr ""
@@ -31349,210 +32656,220 @@ msgstr ""
#.
#. IF no integral type can represent all the enumerator values, the
#. enumeration is ill-formed.
-#: cp/decl.c:11132
+#: cp/decl.c:11236
#, gcc-internal-format
msgid "no integral type can represent all of the enumerator values for %qT"
msgstr ""
-#: cp/decl.c:11263
+#: cp/decl.c:11368
#, gcc-internal-format
msgid "enumerator value for %qD is not an integer constant"
msgstr ""
-#: cp/decl.c:11295
+#: cp/decl.c:11400
#, gcc-internal-format
msgid "overflow in enumeration values at %qD"
msgstr ""
-#: cp/decl.c:11315
+#: cp/decl.c:11420
#, gcc-internal-format
msgid "enumerator value %E is too large for underlying type %<%T%>"
msgstr ""
-#: cp/decl.c:11412
+#: cp/decl.c:11521
#, gcc-internal-format
msgid "return type %q#T is incomplete"
msgstr ""
-#: cp/decl.c:11414
+#: cp/decl.c:11523
#, gcc-internal-format
msgid "return type has Java class type %q#T"
msgstr ""
-#: cp/decl.c:11539 cp/typeck.c:6977
+#: cp/decl.c:11648 cp/typeck.c:7142
#, gcc-internal-format
msgid "%<operator=%> should return a reference to %<*this%>"
msgstr ""
-#: cp/decl.c:11854
+#: cp/decl.c:11743
+#, gcc-internal-format
+msgid "no previous declaration for %q+D"
+msgstr ""
+
+#: cp/decl.c:11964
#, gcc-internal-format
msgid "invalid function declaration"
msgstr ""
-#: cp/decl.c:11938
+#: cp/decl.c:12048
#, gcc-internal-format
msgid "parameter %qD declared void"
msgstr ""
-#: cp/decl.c:12440
+#: cp/decl.c:12547
#, gcc-internal-format
msgid "invalid member function declaration"
msgstr ""
-#: cp/decl.c:12455
+#: cp/decl.c:12562
#, gcc-internal-format
msgid "%qD is already defined in class %qT"
msgstr ""
-#: cp/decl.c:12702
+#: cp/decl.c:12746
#, gcc-internal-format
msgid "static member function %q#D declared with type qualifiers"
msgstr ""
-#: cp/decl2.c:270
+#: cp/decl2.c:277
#, gcc-internal-format
msgid "name missing for member function"
msgstr ""
-#: cp/decl2.c:341 cp/decl2.c:355
+#: cp/decl2.c:348 cp/decl2.c:362
#, gcc-internal-format
msgid "ambiguous conversion for array subscript"
msgstr ""
-#: cp/decl2.c:349
+#: cp/decl2.c:356
#, gcc-internal-format
msgid "invalid types %<%T[%T]%> for array subscript"
msgstr ""
-#: cp/decl2.c:392
+#: cp/decl2.c:399
#, gcc-internal-format
msgid "deleting array %q#D"
msgstr ""
-#: cp/decl2.c:398
+#: cp/decl2.c:405
#, gcc-internal-format
msgid "type %q#T argument given to %<delete%>, expected pointer"
msgstr ""
-#: cp/decl2.c:410
+#: cp/decl2.c:417
#, gcc-internal-format
msgid ""
"cannot delete a function. Only pointer-to-objects are valid arguments to %"
"<delete%>"
msgstr ""
-#: cp/decl2.c:418
+#: cp/decl2.c:425
#, gcc-internal-format
msgid "deleting %qT is undefined"
msgstr ""
-#: cp/decl2.c:461 cp/pt.c:3849
+#: cp/decl2.c:468 cp/pt.c:4210
#, gcc-internal-format
msgid "template declaration of %q#D"
msgstr ""
-#: cp/decl2.c:513
+#: cp/decl2.c:520
#, gcc-internal-format
msgid "Java method %qD has non-Java return type %qT"
msgstr ""
-#: cp/decl2.c:530
+#: cp/decl2.c:537
#, gcc-internal-format
msgid "Java method %qD has non-Java parameter type %qT"
msgstr ""
-#: cp/decl2.c:579
+#: cp/decl2.c:586
#, gcc-internal-format
msgid ""
"template parameter lists provided don't match the template parameters of %qD"
msgstr ""
-#: cp/decl2.c:647
+#: cp/decl2.c:654
#, gcc-internal-format
msgid "prototype for %q#D does not match any in class %qT"
msgstr ""
-#: cp/decl2.c:727
+#: cp/decl2.c:730
#, gcc-internal-format
msgid "local class %q#T shall not have static data member %q#D"
msgstr ""
-#: cp/decl2.c:735
+#: cp/decl2.c:738
#, gcc-internal-format
msgid "initializer invalid for static member with constructor"
msgstr ""
-#: cp/decl2.c:738
+#: cp/decl2.c:741
#, gcc-internal-format
msgid "(an out of class initialization is required)"
msgstr ""
-#: cp/decl2.c:798
+#: cp/decl2.c:802
+#, gcc-internal-format
+msgid "explicit template argument list not allowed"
+msgstr ""
+
+#: cp/decl2.c:808
#, gcc-internal-format
msgid "member %qD conflicts with virtual function table field name"
msgstr ""
-#: cp/decl2.c:831
+#: cp/decl2.c:844
#, gcc-internal-format
msgid "%qD is already defined in %qT"
msgstr ""
-#: cp/decl2.c:869
+#: cp/decl2.c:882
#, gcc-internal-format
msgid "initializer specified for static member function %qD"
msgstr ""
-#: cp/decl2.c:892
+#: cp/decl2.c:905
#, gcc-internal-format
msgid "field initializer is not constant"
msgstr ""
-#: cp/decl2.c:919
+#: cp/decl2.c:932
#, gcc-internal-format
msgid "%<asm%> specifiers are not permitted on non-static data members"
msgstr ""
-#: cp/decl2.c:971
+#: cp/decl2.c:984
#, gcc-internal-format
msgid "bit-field %qD with non-integral type"
msgstr ""
-#: cp/decl2.c:977
+#: cp/decl2.c:990
#, gcc-internal-format
msgid "cannot declare %qD to be a bit-field type"
msgstr ""
-#: cp/decl2.c:987
+#: cp/decl2.c:1000
#, gcc-internal-format
msgid "cannot declare bit-field %qD with function type"
msgstr ""
-#: cp/decl2.c:994
+#: cp/decl2.c:1007
#, gcc-internal-format
msgid "%qD is already defined in the class %qT"
msgstr ""
-#: cp/decl2.c:1001
+#: cp/decl2.c:1014
#, gcc-internal-format
msgid "static member %qD cannot be a bit-field"
msgstr ""
-#: cp/decl2.c:1256
+#: cp/decl2.c:1269
#, gcc-internal-format
msgid "anonymous struct not inside named type"
msgstr ""
-#: cp/decl2.c:1340
+#: cp/decl2.c:1354
#, gcc-internal-format
msgid "namespace-scope anonymous aggregates must be static"
msgstr ""
-#: cp/decl2.c:1349
+#: cp/decl2.c:1363
#, gcc-internal-format
msgid "anonymous union with no members"
msgstr ""
-#: cp/decl2.c:1386
+#: cp/decl2.c:1400
#, gcc-internal-format
msgid "%<operator new%> must return type %qT"
msgstr ""
@@ -31561,62 +32878,78 @@ msgstr ""
#.
#. The first parameter shall not have an associated default
#. argument.
-#: cp/decl2.c:1397
+#: cp/decl2.c:1411
#, gcc-internal-format
msgid "the first parameter of %<operator new%> cannot have a default argument"
msgstr ""
-#: cp/decl2.c:1413
+#: cp/decl2.c:1427
#, gcc-internal-format
msgid "%<operator new%> takes type %<size_t%> (%qT) as first parameter"
msgstr ""
-#: cp/decl2.c:1442
+#: cp/decl2.c:1456
#, gcc-internal-format
msgid "%<operator delete%> must return type %qT"
msgstr ""
-#: cp/decl2.c:1451
+#: cp/decl2.c:1465
#, gcc-internal-format
msgid "%<operator delete%> takes type %qT as first parameter"
msgstr ""
-#: cp/decl2.c:2142
+#: cp/decl2.c:2186
#, gcc-internal-format
msgid "%qT has a field %qD whose type uses the anonymous namespace"
msgstr ""
-#: cp/decl2.c:2149
+#: cp/decl2.c:2193
#, gcc-internal-format
msgid "%qT declared with greater visibility than the type of its field %qD"
msgstr ""
-#: cp/decl2.c:2162
+#: cp/decl2.c:2206
#, gcc-internal-format
msgid "%qT has a base %qT whose type uses the anonymous namespace"
msgstr ""
-#: cp/decl2.c:2168
+#: cp/decl2.c:2212
#, gcc-internal-format
msgid "%qT declared with greater visibility than its base %qT"
msgstr ""
-#: cp/decl2.c:3602
+#: cp/decl2.c:3427
+#, gcc-internal-format
+msgid "%q+#D, declared using anonymous type, is used but never defined"
+msgstr ""
+
+#: cp/decl2.c:3430
+#, gcc-internal-format
+msgid ""
+"%q+#D does not refer to the unqualified type, so it is not used for linkage"
+msgstr ""
+
+#: cp/decl2.c:3434
+#, gcc-internal-format
+msgid "%q+#D, declared using local type %qT, is used but never defined"
+msgstr ""
+
+#: cp/decl2.c:3714
#, gcc-internal-format
msgid "inline function %q+D used but never defined"
msgstr ""
-#: cp/decl2.c:3751
+#: cp/decl2.c:3880
#, gcc-internal-format
msgid "default argument missing for parameter %P of %q+#D"
msgstr ""
-#: cp/decl2.c:3800 cp/search.c:1912
+#: cp/decl2.c:3931 cp/search.c:1912
#, gcc-internal-format
msgid "deleted function %q+D"
msgstr ""
-#: cp/decl2.c:3801
+#: cp/decl2.c:3932
#, gcc-internal-format
msgid "used here"
msgstr ""
@@ -31624,67 +32957,67 @@ msgstr ""
#. We really want to suppress this warning in system headers,
#. because libstdc++ uses variadic templates even when we aren't
#. in C++0x mode.
-#: cp/error.c:2825
+#: cp/error.c:2885
#, gcc-internal-format
msgid "%s only available with -std=c++0x or -std=gnu++0x"
msgstr ""
#. Can't throw a reference.
-#: cp/except.c:286
+#: cp/except.c:277
#, gcc-internal-format
msgid "type %qT is disallowed in Java %<throw%> or %<catch%>"
msgstr ""
-#: cp/except.c:297
+#: cp/except.c:288
#, gcc-internal-format
msgid "call to Java %<catch%> or %<throw%> with %<jthrowable%> undefined"
msgstr ""
#. Thrown object must be a Throwable.
-#: cp/except.c:304
+#: cp/except.c:295
#, gcc-internal-format
msgid "type %qT is not derived from %<java::lang::Throwable%>"
msgstr ""
-#: cp/except.c:368
+#: cp/except.c:357
#, gcc-internal-format
msgid "mixing C++ and Java catches in a single translation unit"
msgstr ""
-#: cp/except.c:639
+#: cp/except.c:629
#, gcc-internal-format
msgid "throwing NULL, which has integral, not pointer type"
msgstr ""
-#: cp/except.c:662 cp/init.c:1895
+#: cp/except.c:652 cp/init.c:1886
#, gcc-internal-format
msgid "%qD should never be overloaded"
msgstr ""
-#: cp/except.c:759
+#: cp/except.c:750
#, gcc-internal-format
msgid " in thrown expression"
msgstr ""
-#: cp/except.c:915
+#: cp/except.c:906
#, gcc-internal-format
msgid ""
"expression %qE of abstract class type %qT cannot be used in throw-expression"
msgstr ""
-#: cp/except.c:1000
+#: cp/except.c:992
#, gcc-internal-format
-msgid "%Hexception of type %qT will be caught"
+msgid "exception of type %qT will be caught"
msgstr ""
-#: cp/except.c:1002
+#: cp/except.c:995
#, gcc-internal-format
-msgid "%H by earlier handler for %qT"
+msgid " by earlier handler for %qT"
msgstr ""
-#: cp/except.c:1032
+#: cp/except.c:1024
#, gcc-internal-format
-msgid "%H%<...%> handler must be the last handler for its try block"
+msgid "%<...%> handler must be the last handler for its try block"
msgstr ""
#: cp/friend.c:156
@@ -31773,238 +33106,242 @@ msgid ""
"already been declared and add <> after the function name here) "
msgstr ""
-#: cp/init.c:351
+#: cp/init.c:352
#, gcc-internal-format
msgid "value-initialization of reference"
msgstr ""
-#: cp/init.c:429
+#: cp/init.c:431
#, gcc-internal-format
-msgid "%J%qD should be initialized in the member initialization list"
+msgid "%qD should be initialized in the member initialization list"
msgstr ""
-#: cp/init.c:454
+#: cp/init.c:457
#, gcc-internal-format
-msgid "%Jvalue-initialization of %q#D, which has reference type"
+msgid "value-initialization of %q#D, which has reference type"
msgstr ""
-#. TYPE_NEEDS_CONSTRUCTING can be set just because we have a
-#. vtable; still give this diagnostic.
-#: cp/init.c:495 cp/init.c:510
+#: cp/init.c:498 cp/init.c:515
#, gcc-internal-format
-msgid "%Juninitialized member %qD with %<const%> type %qT"
+msgid "uninitialized member %qD with %<const%> type %qT"
msgstr ""
-#: cp/init.c:507
+#: cp/init.c:511
#, gcc-internal-format
-msgid "%Juninitialized reference member %qD"
+msgid "uninitialized reference member %qD"
msgstr ""
-#: cp/init.c:655
+#: cp/init.c:660
#, gcc-internal-format
msgid "%q+D will be initialized after"
msgstr ""
-#: cp/init.c:658
+#: cp/init.c:663
#, gcc-internal-format
msgid "base %qT will be initialized after"
msgstr ""
-#: cp/init.c:661
+#: cp/init.c:666
#, gcc-internal-format
msgid " %q+#D"
msgstr ""
-#: cp/init.c:663
+#: cp/init.c:668
#, gcc-internal-format
msgid " base %qT"
msgstr ""
-#: cp/init.c:664
+#: cp/init.c:670
#, gcc-internal-format
-msgid "%J when initialized here"
+msgid " when initialized here"
msgstr ""
-#: cp/init.c:680
+#: cp/init.c:687
#, gcc-internal-format
-msgid "%Jmultiple initializations given for %qD"
+msgid "multiple initializations given for %qD"
msgstr ""
-#: cp/init.c:683
+#: cp/init.c:691
#, gcc-internal-format
-msgid "%Jmultiple initializations given for base %qT"
+msgid "multiple initializations given for base %qT"
msgstr ""
-#: cp/init.c:750
+#: cp/init.c:759
#, gcc-internal-format
-msgid "%Jinitializations for multiple members of %qT"
+msgid "initializations for multiple members of %qT"
msgstr ""
-#: cp/init.c:813
+#: cp/init.c:823
#, gcc-internal-format
msgid ""
-"%Jbase class %q#T should be explicitly initialized in the copy constructor"
+"base class %q#T should be explicitly initialized in the copy constructor"
msgstr ""
-#: cp/init.c:1036 cp/init.c:1055
+#: cp/init.c:1047 cp/init.c:1066
#, gcc-internal-format
msgid "class %qT does not have any field named %qD"
msgstr ""
-#: cp/init.c:1042
+#: cp/init.c:1053
#, gcc-internal-format
msgid ""
"%q#D is a static data member; it can only be initialized at its definition"
msgstr ""
-#: cp/init.c:1049
+#: cp/init.c:1060
#, gcc-internal-format
msgid "%q#D is not a non-static data member of %qT"
msgstr ""
-#: cp/init.c:1088
+#: cp/init.c:1099
#, gcc-internal-format
msgid "unnamed initializer for %qT, which has no base classes"
msgstr ""
-#: cp/init.c:1096
+#: cp/init.c:1107
#, gcc-internal-format
msgid "unnamed initializer for %qT, which uses multiple inheritance"
msgstr ""
-#: cp/init.c:1142
+#: cp/init.c:1153
#, gcc-internal-format
msgid "%qD is both a direct base and an indirect virtual base"
msgstr ""
-#: cp/init.c:1150
+#: cp/init.c:1161
#, gcc-internal-format
msgid "type %qT is not a direct or virtual base of %qT"
msgstr ""
-#: cp/init.c:1153
+#: cp/init.c:1164
#, gcc-internal-format
msgid "type %qT is not a direct base of %qT"
msgstr ""
-#: cp/init.c:1234
+#: cp/init.c:1245
#, gcc-internal-format
msgid "bad array initializer"
msgstr ""
-#: cp/init.c:1440 cp/semantics.c:2536
+#: cp/init.c:1456 cp/semantics.c:2561
#, gcc-internal-format
msgid "%qT is not a class type"
msgstr ""
-#: cp/init.c:1494
+#: cp/init.c:1510
#, gcc-internal-format
msgid "incomplete type %qT does not have member %qD"
msgstr ""
-#: cp/init.c:1507
+#: cp/init.c:1523
#, gcc-internal-format
msgid "invalid pointer to bit-field %qD"
msgstr ""
-#: cp/init.c:1585
+#: cp/init.c:1601
#, gcc-internal-format
msgid "invalid use of non-static member function %qD"
msgstr ""
-#: cp/init.c:1591
+#: cp/init.c:1607
#, gcc-internal-format
msgid "invalid use of non-static data member %qD"
msgstr ""
-#: cp/init.c:1851
+#: cp/init.c:1833
#, gcc-internal-format
msgid "invalid type %<void%> for new"
msgstr ""
-#: cp/init.c:1864
+#: cp/init.c:1846
#, gcc-internal-format
msgid "uninitialized const in %<new%> of %q#T"
msgstr ""
-#: cp/init.c:1889
+#: cp/init.c:1880
#, gcc-internal-format
msgid "call to Java constructor with %qs undefined"
msgstr ""
-#: cp/init.c:1907
+#: cp/init.c:1898
#, gcc-internal-format
msgid "Java class %q#T object allocated using placement new"
msgstr ""
-#: cp/init.c:1937
+#: cp/init.c:1928
#, gcc-internal-format
msgid "no suitable %qD found in class %qT"
msgstr ""
-#: cp/init.c:1944
+#: cp/init.c:1935
#, gcc-internal-format
msgid "request for member %qD is ambiguous"
msgstr ""
-#: cp/init.c:2123
+#: cp/init.c:2125
+#, gcc-internal-format
+msgid ""
+"non-constant array size in new, unable to verify length of initializer-list"
+msgstr ""
+
+#: cp/init.c:2134
#, gcc-internal-format
msgid "ISO C++ forbids initialization in array new"
msgstr ""
-#: cp/init.c:2347
+#: cp/init.c:2360
#, gcc-internal-format
msgid "size in array new must have integral type"
msgstr ""
-#: cp/init.c:2360
+#: cp/init.c:2373
#, gcc-internal-format
msgid "new cannot be applied to a reference type"
msgstr ""
-#: cp/init.c:2369
+#: cp/init.c:2382
#, gcc-internal-format
msgid "new cannot be applied to a function type"
msgstr ""
-#: cp/init.c:2408
+#: cp/init.c:2426
#, gcc-internal-format
msgid "call to Java constructor, while %<jclass%> undefined"
msgstr ""
-#: cp/init.c:2426
+#: cp/init.c:2444
#, gcc-internal-format
msgid "can't find %<class$%> in %qT"
msgstr ""
-#: cp/init.c:2801
+#: cp/init.c:2833
#, gcc-internal-format
msgid "initializer ends prematurely"
msgstr ""
-#: cp/init.c:2859
+#: cp/init.c:2891
#, gcc-internal-format
msgid "cannot initialize multi-dimensional array with initializer"
msgstr ""
-#: cp/init.c:3008
+#: cp/init.c:3040
#, gcc-internal-format
msgid "possible problem detected in invocation of delete operator:"
msgstr ""
-#: cp/init.c:3012
+#: cp/init.c:3044
#, gcc-internal-format
msgid ""
"neither the destructor nor the class-specific operator delete will be "
"called, even if they are declared when the class is defined."
msgstr ""
-#: cp/init.c:3034
+#: cp/init.c:3066
#, gcc-internal-format
msgid "unknown array size in delete"
msgstr ""
-#: cp/init.c:3288
+#: cp/init.c:3321
#, gcc-internal-format
msgid "type to vector delete is neither pointer or array type"
msgstr ""
@@ -32054,46 +33391,46 @@ msgstr ""
#. Note that we have the exact wording of the following message in
#. the manual (trouble.texi, node "Name lookup"), so they need to
#. be kept in synch.
-#: cp/lex.c:488
+#: cp/lex.c:489
#, gcc-internal-format
msgid ""
"there are no arguments to %qD that depend on a template parameter, so a "
"declaration of %qD must be available"
msgstr ""
-#: cp/lex.c:497
+#: cp/lex.c:498
#, gcc-internal-format
msgid ""
"(if you use %<-fpermissive%>, G++ will accept your code, but allowing the "
"use of an undeclared name is deprecated)"
msgstr ""
-#: cp/mangle.c:1689
+#: cp/mangle.c:1897
#, gcc-internal-format
msgid "mangling typeof, use decltype instead"
msgstr ""
-#: cp/mangle.c:1902
+#: cp/mangle.c:2116
#, gcc-internal-format
msgid "mangling unknown fixed point type"
msgstr ""
-#: cp/mangle.c:2331
+#: cp/mangle.c:2544
#, gcc-internal-format
msgid "mangling %C"
msgstr ""
-#: cp/mangle.c:2386
+#: cp/mangle.c:2599
#, gcc-internal-format
msgid "mangling new-expression"
msgstr ""
-#: cp/mangle.c:2406
+#: cp/mangle.c:2619
#, gcc-internal-format
msgid "omitted middle operand to %<?:%> operand cannot be mangled"
msgstr ""
-#: cp/mangle.c:2721
+#: cp/mangle.c:2932
#, gcc-internal-format
msgid "the mangled name of %qD will change in a future version of GCC"
msgstr ""
@@ -32103,29 +33440,29 @@ msgstr ""
msgid "generic thunk code fails for method %q#D which uses %<...%>"
msgstr ""
-#: cp/method.c:697
+#: cp/method.c:704
#, gcc-internal-format
msgid "non-static const member %q#D, can't use default assignment operator"
msgstr ""
-#: cp/method.c:703
+#: cp/method.c:710
#, gcc-internal-format
msgid "non-static reference member %q#D, can't use default assignment operator"
msgstr ""
-#: cp/method.c:816
+#: cp/method.c:823
#, gcc-internal-format
msgid "synthesized method %qD first required here "
msgstr ""
-#: cp/method.c:1159
+#: cp/method.c:1172
#, gcc-internal-format
msgid ""
"vtable layout for class %qT may not be ABI-compliantand may change in a "
"future version of GCC due to implicit virtual destructor"
msgstr ""
-#: cp/name-lookup.c:733
+#: cp/name-lookup.c:728
#, gcc-internal-format
msgid "redeclaration of %<wchar_t%> as %qT"
msgstr ""
@@ -32136,58 +33473,58 @@ msgstr ""
#. [basic.start.main]
#.
#. This function shall not be overloaded.
-#: cp/name-lookup.c:763
+#: cp/name-lookup.c:758
#, gcc-internal-format
msgid "invalid redeclaration of %q+D"
msgstr ""
-#: cp/name-lookup.c:764
+#: cp/name-lookup.c:759
#, gcc-internal-format
msgid "as %qD"
msgstr ""
-#: cp/name-lookup.c:810 cp/name-lookup.c:821
+#: cp/name-lookup.c:805 cp/name-lookup.c:816
#, gcc-internal-format
msgid "declaration of %q#D with C language linkage"
msgstr ""
-#: cp/name-lookup.c:814
+#: cp/name-lookup.c:809
#, gcc-internal-format
msgid "due to different exception specifications"
msgstr ""
-#: cp/name-lookup.c:905
+#: cp/name-lookup.c:900
#, gcc-internal-format
msgid "type mismatch with previous external decl of %q#D"
msgstr ""
-#: cp/name-lookup.c:906
+#: cp/name-lookup.c:901
#, gcc-internal-format
msgid "previous external decl of %q+#D"
msgstr ""
-#: cp/name-lookup.c:997
+#: cp/name-lookup.c:992
#, gcc-internal-format
msgid "extern declaration of %q#D doesn't match"
msgstr ""
-#: cp/name-lookup.c:998
+#: cp/name-lookup.c:993
#, gcc-internal-format
msgid "global declaration %q+#D"
msgstr ""
-#: cp/name-lookup.c:1040 cp/name-lookup.c:1047
+#: cp/name-lookup.c:1035 cp/name-lookup.c:1043
#, gcc-internal-format
msgid "declaration of %q#D shadows a parameter"
msgstr ""
#. Location of previous decl is not useful in this case.
-#: cp/name-lookup.c:1072
+#: cp/name-lookup.c:1069
#, gcc-internal-format
msgid "declaration of %qD shadows a member of 'this'"
msgstr ""
-#: cp/name-lookup.c:1078
+#: cp/name-lookup.c:1076
#, gcc-internal-format
msgid "declaration of %qD shadows a previous local"
msgstr ""
@@ -32227,776 +33564,710 @@ msgstr ""
msgid " using obsolete binding at %q+D"
msgstr ""
-#: cp/name-lookup.c:1246 cp/parser.c:10152
+#: cp/name-lookup.c:1246 cp/parser.c:10818
#, gcc-internal-format
msgid "(if you use %<-fpermissive%> G++ will accept your code)"
msgstr ""
-#: cp/name-lookup.c:1302
+#: cp/name-lookup.c:1301
#, gcc-internal-format
msgid "%s %s(%E) %p %d\n"
msgstr ""
-#: cp/name-lookup.c:1305
+#: cp/name-lookup.c:1304
#, gcc-internal-format
msgid "%s %s %p %d\n"
msgstr ""
-#: cp/name-lookup.c:1433
-#, gcc-internal-format
-msgid "XXX is_class_level != (current_scope == class_scope)\n"
-msgstr ""
-
-#: cp/name-lookup.c:2028
+#: cp/name-lookup.c:2036
#, gcc-internal-format
msgid "%q#D hides constructor for %q#T"
msgstr ""
-#: cp/name-lookup.c:2045
+#: cp/name-lookup.c:2053
#, gcc-internal-format
msgid "%q#D conflicts with previous using declaration %q#D"
msgstr ""
-#: cp/name-lookup.c:2068
+#: cp/name-lookup.c:2076
#, gcc-internal-format
msgid "previous non-function declaration %q+#D"
msgstr ""
-#: cp/name-lookup.c:2069
+#: cp/name-lookup.c:2077
#, gcc-internal-format
msgid "conflicts with function declaration %q#D"
msgstr ""
#. It's a nested name with template parameter dependent scope.
#. This can only be using-declaration for class member.
-#: cp/name-lookup.c:2147 cp/name-lookup.c:2172
+#: cp/name-lookup.c:2155 cp/name-lookup.c:2180
#, gcc-internal-format
msgid "%qT is not a namespace"
msgstr ""
#. 7.3.3/5
#. A using-declaration shall not name a template-id.
-#: cp/name-lookup.c:2157
+#: cp/name-lookup.c:2165
#, gcc-internal-format
msgid "a using-declaration cannot specify a template-id. Try %<using %D%>"
msgstr ""
-#: cp/name-lookup.c:2164
+#: cp/name-lookup.c:2172
#, gcc-internal-format
msgid "namespace %qD not allowed in using-declaration"
msgstr ""
-#: cp/name-lookup.c:2200
+#: cp/name-lookup.c:2208
#, gcc-internal-format
msgid "%qD not declared"
msgstr ""
-#: cp/name-lookup.c:2236 cp/name-lookup.c:2273 cp/name-lookup.c:2307
-#: cp/name-lookup.c:2322
+#: cp/name-lookup.c:2244 cp/name-lookup.c:2281 cp/name-lookup.c:2315
+#: cp/name-lookup.c:2330
#, gcc-internal-format
msgid "%qD is already declared in this scope"
msgstr ""
-#: cp/name-lookup.c:2926
+#: cp/name-lookup.c:2937
#, gcc-internal-format
msgid "using-declaration for non-member at class scope"
msgstr ""
-#: cp/name-lookup.c:2933
+#: cp/name-lookup.c:2944
#, gcc-internal-format
msgid "%<%T::%D%> names destructor"
msgstr ""
-#: cp/name-lookup.c:2938
+#: cp/name-lookup.c:2949
#, gcc-internal-format
msgid "%<%T::%D%> names constructor"
msgstr ""
-#: cp/name-lookup.c:2943
+#: cp/name-lookup.c:2954
#, gcc-internal-format
msgid "%<%T::%D%> names constructor in %qT"
msgstr ""
-#: cp/name-lookup.c:2993
+#: cp/name-lookup.c:3004
#, gcc-internal-format
msgid "no members matching %<%T::%D%> in %q#T"
msgstr ""
-#: cp/name-lookup.c:3061
+#: cp/name-lookup.c:3072
#, gcc-internal-format
msgid "declaration of %qD not in a namespace surrounding %qD"
msgstr ""
-#: cp/name-lookup.c:3069
+#: cp/name-lookup.c:3080
#, gcc-internal-format
msgid "explicit qualification in declaration of %qD"
msgstr ""
-#: cp/name-lookup.c:3112
+#: cp/name-lookup.c:3123
#, gcc-internal-format
msgid "%qD should have been declared inside %qD"
msgstr ""
-#: cp/name-lookup.c:3157
+#: cp/name-lookup.c:3168
#, gcc-internal-format
msgid "%qD attribute requires a single NTBS argument"
msgstr ""
-#: cp/name-lookup.c:3164
+#: cp/name-lookup.c:3175
#, gcc-internal-format
msgid ""
"%qD attribute is meaningless since members of the anonymous namespace get "
"local symbols"
msgstr ""
-#: cp/name-lookup.c:3173 cp/name-lookup.c:3543
+#: cp/name-lookup.c:3184 cp/name-lookup.c:3554
#, gcc-internal-format
msgid "%qD attribute directive ignored"
msgstr ""
-#: cp/name-lookup.c:3218
+#: cp/name-lookup.c:3229
#, gcc-internal-format
msgid "namespace alias %qD not allowed here, assuming %qD"
msgstr ""
-#: cp/name-lookup.c:3531
+#: cp/name-lookup.c:3542
#, gcc-internal-format
msgid "strong using only meaningful at namespace scope"
msgstr ""
-#: cp/name-lookup.c:3535
+#: cp/name-lookup.c:3546
#, gcc-internal-format
msgid "current namespace %qD does not enclose strongly used namespace %qD"
msgstr ""
-#: cp/name-lookup.c:4472
+#: cp/name-lookup.c:4516
#, gcc-internal-format
msgid "%q+D is not a function,"
msgstr ""
-#: cp/name-lookup.c:4473
+#: cp/name-lookup.c:4517
#, gcc-internal-format
msgid " conflict with %q+D"
msgstr ""
-#: cp/name-lookup.c:4918
+#: cp/name-lookup.c:4977
#, gcc-internal-format
msgid "argument dependent lookup finds %q+D"
msgstr ""
-#: cp/name-lookup.c:5359
+#: cp/name-lookup.c:5422
#, gcc-internal-format
msgid "XXX entering pop_everything ()\n"
msgstr ""
-#: cp/name-lookup.c:5368
+#: cp/name-lookup.c:5431
#, gcc-internal-format
msgid "XXX leaving pop_everything ()\n"
msgstr ""
-#: cp/parser.c:431
+#: cp/parser.c:435
#, gcc-internal-format
msgid "identifier %qE will become a keyword in C++0x"
msgstr ""
-#: cp/parser.c:2078
+#: cp/parser.c:2098
#, gcc-internal-format
-msgid "%H%<#pragma%> is not allowed here"
+msgid "%<#pragma%> is not allowed here"
msgstr ""
-#: cp/parser.c:2109
+#: cp/parser.c:2129
#, gcc-internal-format
-msgid "%H%<%E::%E%> has not been declared"
+msgid "%<%E::%E%> has not been declared"
msgstr ""
-#: cp/parser.c:2112
+#: cp/parser.c:2132
#, gcc-internal-format
-msgid "%H%<::%E%> has not been declared"
+msgid "%<::%E%> has not been declared"
msgstr ""
-#: cp/parser.c:2115
+#: cp/parser.c:2135
#, gcc-internal-format
-msgid "%Hrequest for member %qE in non-class type %qT"
+msgid "request for member %qE in non-class type %qT"
msgstr ""
-#: cp/parser.c:2118
+#: cp/parser.c:2138
#, gcc-internal-format
-msgid "%H%<%T::%E%> has not been declared"
+msgid "%<%T::%E%> has not been declared"
msgstr ""
-#: cp/parser.c:2121
+#: cp/parser.c:2141
#, gcc-internal-format
-msgid "%H%qE has not been declared"
+msgid "%qE has not been declared"
msgstr ""
-#: cp/parser.c:2124
+#: cp/parser.c:2144
#, gcc-internal-format
-msgid "%H%<%E::%E%> %s"
+msgid "%<%E::%E%> %s"
msgstr ""
-#: cp/parser.c:2126
+#: cp/parser.c:2146
#, gcc-internal-format
-msgid "%H%<::%E%> %s"
+msgid "%<::%E%> %s"
msgstr ""
-#: cp/parser.c:2128
+#: cp/parser.c:2148
#, gcc-internal-format
-msgid "%H%qE %s"
+msgid "%qE %s"
msgstr ""
-#: cp/parser.c:2163
-#, gcc-internal-format
-msgid "%H%<long long long%> is too long for GCC"
-msgstr ""
-
-#: cp/parser.c:2166
+#: cp/parser.c:2186
#, gcc-internal-format
msgid "ISO C++ 1998 does not support %<long long%>"
msgstr ""
-#: cp/parser.c:2186
+#: cp/parser.c:2207
#, gcc-internal-format
-msgid "%Hduplicate %qs"
+msgid "duplicate %qs"
msgstr ""
-#: cp/parser.c:2230
+#: cp/parser.c:2252
#, gcc-internal-format
-msgid "%Hnew types may not be defined in a return type"
+msgid "new types may not be defined in a return type"
msgstr ""
-#: cp/parser.c:2232
+#: cp/parser.c:2254
#, gcc-internal-format
msgid "(perhaps a semicolon is missing after the definition of %qT)"
msgstr ""
-#: cp/parser.c:2252
+#: cp/parser.c:2274 cp/parser.c:4248 cp/pt.c:6030
#, gcc-internal-format
-msgid "%H%qT is not a template"
+msgid "%qT is not a template"
msgstr ""
-#: cp/parser.c:2254
+#: cp/parser.c:2276
#, gcc-internal-format
-msgid "%H%qE is not a template"
+msgid "%qE is not a template"
msgstr ""
-#: cp/parser.c:2256
+#: cp/parser.c:2278
#, gcc-internal-format
-msgid "%Hinvalid template-id"
+msgid "invalid template-id"
msgstr ""
-#: cp/parser.c:2318
+#: cp/parser.c:2341
#, gcc-internal-format
-msgid "%Hinvalid use of template-name %qE without an argument list"
+msgid "invalid use of template-name %qE without an argument list"
msgstr ""
-#: cp/parser.c:2321
+#: cp/parser.c:2344
#, gcc-internal-format
-msgid "%Hinvalid use of destructor %qD as a type"
+msgid "invalid use of destructor %qD as a type"
msgstr ""
#. Something like 'unsigned A a;'
-#: cp/parser.c:2324
+#: cp/parser.c:2347
#, gcc-internal-format
-msgid "%Hinvalid combination of multiple type-specifiers"
+msgid "invalid combination of multiple type-specifiers"
msgstr ""
#. Issue an error message.
-#: cp/parser.c:2329
+#: cp/parser.c:2351
#, gcc-internal-format
-msgid "%H%qE does not name a type"
+msgid "%qE does not name a type"
msgstr ""
-#: cp/parser.c:2362
+#: cp/parser.c:2384
#, gcc-internal-format
msgid "(perhaps %<typename %T::%E%> was intended)"
msgstr ""
-#: cp/parser.c:2377
+#: cp/parser.c:2399
#, gcc-internal-format
-msgid "%H%qE in namespace %qE does not name a type"
+msgid "%qE in namespace %qE does not name a type"
msgstr ""
-#: cp/parser.c:2380
+#: cp/parser.c:2402
#, gcc-internal-format
-msgid "%H%qE in class %qT does not name a type"
+msgid "%qE in class %qT does not name a type"
msgstr ""
-#: cp/parser.c:2944
+#: cp/parser.c:3182
#, gcc-internal-format
-msgid "%Hunsupported non-standard concatenation of string literals"
+msgid "fixed-point types not supported in C++"
msgstr ""
-#: cp/parser.c:3147
-#, gcc-internal-format
-msgid "%Hfixed-point types not supported in C++"
-msgstr ""
-
-#: cp/parser.c:3228
+#: cp/parser.c:3262
#, gcc-internal-format
msgid "ISO C++ forbids braced-groups within expressions"
msgstr ""
-#: cp/parser.c:3239
+#: cp/parser.c:3274
#, gcc-internal-format
msgid ""
-"%Hstatement-expressions are not allowed outside functions nor in template-"
+"statement-expressions are not allowed outside functions nor in template-"
"argument lists"
msgstr ""
-#: cp/parser.c:3298
-#, gcc-internal-format
-msgid "%H%<this%> may not be used in this context"
-msgstr ""
-
-#: cp/parser.c:3507
+#: cp/parser.c:3347
#, gcc-internal-format
-msgid "%Hlocal variable %qD may not appear in this context"
+msgid "%<this%> may not be used in this context"
msgstr ""
-#: cp/parser.c:3807
+#: cp/parser.c:3558
#, gcc-internal-format
-msgid "%Hscope %qT before %<~%> is not a class-name"
+msgid "local variable %qD may not appear in this context"
msgstr ""
-#: cp/parser.c:3921
+#: cp/parser.c:3852
#, gcc-internal-format
-msgid "%Hdeclaration of %<~%T%> as member of %qT"
+msgid "scope %qT before %<~%> is not a class-name"
msgstr ""
-#: cp/parser.c:3935
+#: cp/parser.c:3967
#, gcc-internal-format
-msgid "%Htypedef-name %qD used as destructor declarator"
+msgid "declaration of %<~%T%> as member of %qT"
msgstr ""
-#: cp/parser.c:4149
+#: cp/parser.c:3982
#, gcc-internal-format
-msgid "%H%qD used without template parameters"
-msgstr ""
-
-#: cp/parser.c:4153 cp/parser.c:14879 cp/parser.c:17176
-#, gcc-internal-format
-msgid "%Hreference to %qD is ambiguous"
-msgstr ""
-
-#: cp/parser.c:4199 cp/pt.c:5660
-#, gcc-internal-format
-msgid "%qT is not a template"
+msgid "typedef-name %qD used as destructor declarator"
msgstr ""
#. Warn the user that a compound literal is not
#. allowed in standard C++.
-#: cp/parser.c:4623
+#: cp/parser.c:4672
#, gcc-internal-format
msgid "ISO C++ forbids compound-literals"
msgstr ""
-#: cp/parser.c:4996
+#: cp/parser.c:5050
#, gcc-internal-format
-msgid "%H%qE does not have class type"
+msgid "%qE does not have class type"
msgstr ""
-#: cp/parser.c:5080
+#: cp/parser.c:5135 cp/typeck.c:2121
#, gcc-internal-format
-msgid "%Hinvalid use of %qD"
+msgid "invalid use of %qD"
msgstr ""
-#: cp/parser.c:5659
+#: cp/parser.c:5718
#, gcc-internal-format
-msgid "%Harray bound forbidden after parenthesized type-id"
+msgid "array bound forbidden after parenthesized type-id"
msgstr ""
-#: cp/parser.c:5662
+#: cp/parser.c:5720
#, gcc-internal-format
msgid "try removing the parentheses around the type-id"
msgstr ""
-#: cp/parser.c:5855
+#: cp/parser.c:5924
#, gcc-internal-format
-msgid "%Hexpression in new-declarator must have integral or enumeration type"
+msgid "expression in new-declarator must have integral or enumeration type"
msgstr ""
-#: cp/parser.c:6111
+#: cp/parser.c:6178
#, gcc-internal-format
msgid "use of old-style cast"
msgstr ""
-#: cp/parser.c:6242
+#: cp/parser.c:6309
#, gcc-internal-format
-msgid "%H%<>>%> operator will be treated as two right angle brackets in C++0x"
+msgid "%<>>%> operator will be treated as two right angle brackets in C++0x"
msgstr ""
-#: cp/parser.c:6245
+#: cp/parser.c:6312
#, gcc-internal-format
msgid "suggest parentheses around %<>>%> expression"
msgstr ""
-#: cp/parser.c:7082
-#, gcc-internal-format
-msgid "%Hcase label %qE not within a switch statement"
-msgstr ""
-
-#: cp/parser.c:7094
+#: cp/parser.c:7145
#, gcc-internal-format
-msgid "%Hcase label not within a switch statement"
+msgid "expected end of capture-list"
msgstr ""
-#: cp/parser.c:7212
+#: cp/parser.c:7196
#, gcc-internal-format
-msgid "%H%<else%> without a previous %<if%>"
+msgid "ISO C++ does not allow initializers in lambda expression capture lists"
msgstr ""
-#: cp/parser.c:7691
+#: cp/parser.c:7290
#, gcc-internal-format
-msgid "%Hbreak statement not within loop or switch"
+msgid "default argument specified for lambda parameter"
msgstr ""
-#: cp/parser.c:7699 cp/parser.c:7719
+#: cp/parser.c:7686
#, gcc-internal-format
-msgid "%Hinvalid exit from OpenMP structured block"
-msgstr ""
-
-#: cp/parser.c:7702
-#, gcc-internal-format
-msgid "%Hbreak statement used with OpenMP for loop"
-msgstr ""
-
-#: cp/parser.c:7712
-#, gcc-internal-format
-msgid "%Hcontinue statement not within a loop"
+msgid "case label %qE not within a switch statement"
msgstr ""
#. Issue a warning about this use of a GNU extension.
-#: cp/parser.c:7755
+#: cp/parser.c:8383
#, gcc-internal-format
msgid "ISO C++ forbids computed gotos"
msgstr ""
-#: cp/parser.c:7899 cp/parser.c:15753
+#: cp/parser.c:8528 cp/parser.c:16519
#, gcc-internal-format
msgid "extra %<;%>"
msgstr ""
-#: cp/parser.c:8120
+#: cp/parser.c:8749
#, gcc-internal-format
-msgid "%H%<__label__%> not at the beginning of a block"
+msgid "%<__label__%> not at the beginning of a block"
msgstr ""
-#: cp/parser.c:8257
+#: cp/parser.c:8887
#, gcc-internal-format
-msgid "%Hmixing declarations and function-definitions is forbidden"
+msgid "mixing declarations and function-definitions is forbidden"
msgstr ""
-#: cp/parser.c:8397
+#: cp/parser.c:9028
#, gcc-internal-format
-msgid "%H%<friend%> used outside of class"
+msgid "%<friend%> used outside of class"
msgstr ""
-#: cp/parser.c:8453
+#. Complain about `auto' as a storage specifier, if
+#. we're complaining about C++0x compatibility.
+#: cp/parser.c:9087
#, gcc-internal-format
-msgid "%H%<auto%> will change meaning in C++0x; please remove it"
+msgid "%<auto%> will change meaning in C++0x; please remove it"
msgstr ""
-#: cp/parser.c:8572
+#: cp/parser.c:9207
#, gcc-internal-format
-msgid "%Hclass definition may not be declared a friend"
+msgid "class definition may not be declared a friend"
msgstr ""
-#: cp/parser.c:8642 cp/parser.c:16075
+#: cp/parser.c:9276 cp/parser.c:16843
#, gcc-internal-format
-msgid "%Htemplates may not be %<virtual%>"
+msgid "templates may not be %<virtual%>"
msgstr ""
-#: cp/parser.c:9045
+#: cp/parser.c:9697
#, gcc-internal-format
msgid "invalid use of %<auto%> in conversion operator"
msgstr ""
-#: cp/parser.c:9129
+#: cp/parser.c:9782
#, gcc-internal-format
-msgid "%Honly constructors take base initializers"
+msgid "only constructors take base initializers"
msgstr ""
-#: cp/parser.c:9151
+#: cp/parser.c:9804
#, gcc-internal-format
-msgid "%Hcannot expand initializer for member %<%D%>"
+msgid "cannot expand initializer for member %<%D%>"
msgstr ""
-#: cp/parser.c:9206
+#: cp/parser.c:9859
#, gcc-internal-format
msgid "anachronistic old-style base class initializer"
msgstr ""
-#: cp/parser.c:9266
+#: cp/parser.c:9927
#, gcc-internal-format
msgid ""
-"%Hkeyword %<typename%> not allowed in this context (a qualified member "
+"keyword %<typename%> not allowed in this context (a qualified member "
"initializer is implicitly a type)"
msgstr ""
#. Warn that we do not support `export'.
-#: cp/parser.c:9612
+#: cp/parser.c:10272
#, gcc-internal-format
msgid "keyword %<export%> not implemented, and will be ignored"
msgstr ""
-#: cp/parser.c:9794 cp/parser.c:9892 cp/parser.c:9998
+#: cp/parser.c:10458 cp/parser.c:10557 cp/parser.c:10665 cp/parser.c:15222
#, gcc-internal-format
-msgid "%Htemplate parameter pack %qD cannot have a default argument"
+msgid "template parameter pack %qD cannot have a default argument"
msgstr ""
-#: cp/parser.c:9797
+#: cp/parser.c:10462 cp/parser.c:15229
#, gcc-internal-format
-msgid "%Htemplate parameter pack cannot have a default argument"
+msgid "template parameter pack cannot have a default argument"
msgstr ""
-#: cp/parser.c:9895 cp/parser.c:10002
+#: cp/parser.c:10561 cp/parser.c:10669
#, gcc-internal-format
-msgid "%Htemplate parameter packs cannot have default arguments"
+msgid "template parameter packs cannot have default arguments"
msgstr ""
-#: cp/parser.c:10144
+#: cp/parser.c:10810
#, gcc-internal-format
msgid "%<<::%> cannot begin a template-argument list"
msgstr ""
-#: cp/parser.c:10148
+#: cp/parser.c:10814
#, gcc-internal-format
msgid ""
"%<<:%> is an alternate spelling for %<[%>. Insert whitespace between %<<%> "
"and %<::%>"
msgstr ""
-#: cp/parser.c:10226
+#: cp/parser.c:10892
#, gcc-internal-format
-msgid "%Hparse error in template argument list"
+msgid "parse error in template argument list"
msgstr ""
#. Explain what went wrong.
-#: cp/parser.c:10341
+#: cp/parser.c:11006
#, gcc-internal-format
-msgid "%Hnon-template %qD used as template"
+msgid "non-template %qD used as template"
msgstr ""
-#: cp/parser.c:10343
+#: cp/parser.c:11008
#, gcc-internal-format
msgid "use %<%T::template %D%> to indicate that it is a template"
msgstr ""
-#: cp/parser.c:10476
+#: cp/parser.c:11142
#, gcc-internal-format
-msgid "%Hexpected parameter pack before %<...%>"
+msgid "expected parameter pack before %<...%>"
msgstr ""
-#: cp/parser.c:10886
+#: cp/parser.c:11551
#, gcc-internal-format
-msgid "%Htemplate specialization with C linkage"
+msgid "template specialization with C linkage"
msgstr ""
-#: cp/parser.c:11532
-#, gcc-internal-format
-msgid "using %<typename%> outside of template"
-msgstr ""
-
-#: cp/parser.c:11700
+#: cp/parser.c:12369
#, gcc-internal-format
msgid "declaration %qD does not declare anything"
msgstr ""
-#: cp/parser.c:11786
+#: cp/parser.c:12455
#, gcc-internal-format
msgid "attributes ignored on uninstantiated type"
msgstr ""
-#: cp/parser.c:11790
+#: cp/parser.c:12459
#, gcc-internal-format
msgid "attributes ignored on template instantiation"
msgstr ""
-#: cp/parser.c:11795
+#: cp/parser.c:12464
#, gcc-internal-format
msgid ""
"attributes ignored on elaborated-type-specifier that is not a forward "
"declaration"
msgstr ""
-#: cp/parser.c:12078
+#: cp/parser.c:12749
#, gcc-internal-format
-msgid "%H%qD is not a namespace-name"
+msgid "%qD is not a namespace-name"
msgstr ""
-#: cp/parser.c:12205
+#: cp/parser.c:12876
#, gcc-internal-format
-msgid "%H%<namespace%> definition is not allowed here"
+msgid "%<namespace%> definition is not allowed here"
msgstr ""
-#. [namespace.udecl]
-#.
-#. A using declaration shall not name a template-id.
-#: cp/parser.c:12345
+#: cp/parser.c:13017
#, gcc-internal-format
-msgid "%Ha template-id may not appear in a using-declaration"
+msgid "a template-id may not appear in a using-declaration"
msgstr ""
-#: cp/parser.c:12722
+#: cp/parser.c:13438
#, gcc-internal-format
-msgid "%Han asm-specification is not allowed on a function-definition"
+msgid "an asm-specification is not allowed on a function-definition"
msgstr ""
-#: cp/parser.c:12726
+#: cp/parser.c:13442
#, gcc-internal-format
-msgid "%Hattributes are not allowed on a function-definition"
+msgid "attributes are not allowed on a function-definition"
msgstr ""
-#: cp/parser.c:12879
+#: cp/parser.c:13595
#, gcc-internal-format
-msgid "%Hinitializer provided for function"
+msgid "initializer provided for function"
msgstr ""
-#: cp/parser.c:12901
+#: cp/parser.c:13628
#, gcc-internal-format
msgid "attributes after parenthesized initializer ignored"
msgstr ""
-#: cp/parser.c:13306
+#: cp/parser.c:14027 cp/pt.c:9622
#, gcc-internal-format
-msgid "%Harray bound is not an integer constant"
+msgid "array bound is not an integer constant"
msgstr ""
-#: cp/parser.c:13418
+#: cp/parser.c:14146
#, gcc-internal-format
-msgid "%H%<%T::%E%> is not a type"
+msgid "%<%T::%E%> is not a type"
msgstr ""
-#: cp/parser.c:13445
+#: cp/parser.c:14173
#, gcc-internal-format
-msgid "%Hinvalid use of constructor as a template"
+msgid "invalid use of constructor as a template"
msgstr ""
-#: cp/parser.c:13447
+#: cp/parser.c:14175
#, gcc-internal-format
msgid ""
"use %<%T::%D%> instead of %<%T::%D%> to name the constructor in a qualified "
"name"
msgstr ""
-#: cp/parser.c:13620
+#: cp/parser.c:14349
#, gcc-internal-format
-msgid "%H%qD is a namespace"
+msgid "%qD is a namespace"
msgstr ""
-#: cp/parser.c:13695
+#: cp/parser.c:14424
#, gcc-internal-format
-msgid "%Hduplicate cv-qualifier"
+msgid "duplicate cv-qualifier"
msgstr ""
-#: cp/parser.c:13807
+#: cp/parser.c:14546
#, gcc-internal-format
msgid "invalid use of %<auto%>"
msgstr ""
-#: cp/parser.c:14392
+#: cp/parser.c:15155
#, gcc-internal-format
-msgid "%Hfile ends in default argument"
+msgid "file ends in default argument"
msgstr ""
-#: cp/parser.c:14438
+#: cp/parser.c:15201
#, gcc-internal-format
msgid "deprecated use of default argument for parameter of non-function"
msgstr ""
-#: cp/parser.c:14441
+#: cp/parser.c:15205
#, gcc-internal-format
-msgid "%Hdefault arguments are only permitted for function parameters"
+msgid "default arguments are only permitted for function parameters"
msgstr ""
-#: cp/parser.c:14459
-#, gcc-internal-format
-msgid "%H%sparameter pack %qD cannot have a default argument"
-msgstr ""
-
-#: cp/parser.c:14463
-#, gcc-internal-format
-msgid "%H%sparameter pack cannot have a default argument"
-msgstr ""
-
-#: cp/parser.c:14726
+#: cp/parser.c:15491
#, gcc-internal-format
msgid "ISO C++ does not allow designated initializers"
msgstr ""
-#: cp/parser.c:15345
+#: cp/parser.c:16111
#, gcc-internal-format
-msgid "%Hinvalid class name in declaration of %qD"
+msgid "invalid class name in declaration of %qD"
msgstr ""
-#: cp/parser.c:15358
+#: cp/parser.c:16125
#, gcc-internal-format
-msgid "%Hdeclaration of %qD in namespace %qD which does not enclose %qD"
+msgid "declaration of %qD in namespace %qD which does not enclose %qD"
msgstr ""
-#: cp/parser.c:15363
+#: cp/parser.c:16130
#, gcc-internal-format
-msgid "%Hdeclaration of %qD in %qD which does not enclose %qD"
+msgid "declaration of %qD in %qD which does not enclose %qD"
msgstr ""
-#: cp/parser.c:15377
+#: cp/parser.c:16144
#, gcc-internal-format
-msgid "%Hextra qualification not allowed"
+msgid "extra qualification not allowed"
msgstr ""
-#: cp/parser.c:15389
+#: cp/parser.c:16156
#, gcc-internal-format
-msgid "%Han explicit specialization must be preceded by %<template <>%>"
+msgid "an explicit specialization must be preceded by %<template <>%>"
msgstr ""
-#: cp/parser.c:15419
+#: cp/parser.c:16186
#, gcc-internal-format
-msgid "%Hfunction template %qD redeclared as a class template"
+msgid "function template %qD redeclared as a class template"
msgstr ""
-#: cp/parser.c:15501
+#: cp/parser.c:16269
#, gcc-internal-format
-msgid "%Hredefinition of %q#T"
+msgid "previous definition of %q+#T"
msgstr ""
-#: cp/parser.c:15503
+#: cp/parser.c:16538
#, gcc-internal-format
-msgid "%Hprevious definition of %q+#T"
+msgid "a class-key must be used when declaring a friend"
msgstr ""
-#: cp/parser.c:15771
+#: cp/parser.c:16553
#, gcc-internal-format
-msgid "%Ha class-key must be used when declaring a friend"
+msgid "friend declaration does not name a class or function"
msgstr ""
-#: cp/parser.c:15786
+#: cp/parser.c:16735
#, gcc-internal-format
-msgid "%Hfriend declaration does not name a class or function"
+msgid "pure-specifier on function-definition"
msgstr ""
-#: cp/parser.c:15966
+#: cp/parser.c:17048
#, gcc-internal-format
-msgid "%Hpure-specifier on function-definition"
+msgid "keyword %<typename%> not allowed outside of templates"
msgstr ""
-#: cp/parser.c:16279
-#, gcc-internal-format
-msgid "%Hkeyword %<typename%> not allowed outside of templates"
-msgstr ""
-
-#: cp/parser.c:16282
+#: cp/parser.c:17051
#, gcc-internal-format
msgid ""
-"%Hkeyword %<typename%> not allowed in this context (the base class is "
+"keyword %<typename%> not allowed in this context (the base class is "
"implicitly a type)"
msgstr ""
-#: cp/parser.c:17365
+#: cp/parser.c:18185
#, gcc-internal-format
msgid "specializing member %<%T::%E%> requires %<template<>%> syntax"
msgstr ""
-#: cp/parser.c:17370
+#: cp/parser.c:18190
#, gcc-internal-format
msgid "too few template-parameter-lists"
msgstr ""
@@ -33005,317 +34276,248 @@ msgstr ""
#. something like:
#.
#. template <class T> template <class U> void S::f();
-#: cp/parser.c:17377
+#: cp/parser.c:18197
#, gcc-internal-format
-msgid "%Htoo many template-parameter-lists"
+msgid "too many template-parameter-lists"
msgstr ""
-#. Issue an error message.
-#: cp/parser.c:17651
+#: cp/parser.c:18472
#, gcc-internal-format
-msgid "%Hnamed return values are no longer supported"
+msgid "named return values are no longer supported"
msgstr ""
-#. 14.5.2.2 [temp.mem]
-#.
-#. A local class shall not have member templates.
-#: cp/parser.c:17726
+#: cp/parser.c:18552
#, gcc-internal-format
-msgid "%Hinvalid declaration of member template in local class"
+msgid "invalid declaration of member template in local class"
msgstr ""
-#: cp/parser.c:17736
+#: cp/parser.c:18561
#, gcc-internal-format
-msgid "%Htemplate with C linkage"
+msgid "template with C linkage"
msgstr ""
-#: cp/parser.c:17883
+#: cp/parser.c:18709
#, gcc-internal-format
-msgid "%Htemplate declaration of %qs"
+msgid "template declaration of %<typedef%>"
msgstr ""
-#: cp/parser.c:17947
+#: cp/parser.c:18773
#, gcc-internal-format
-msgid "%Hexplicit template specialization cannot have a storage class"
+msgid "explicit template specialization cannot have a storage class"
msgstr ""
-#: cp/parser.c:18165
+#: cp/parser.c:18998
#, gcc-internal-format
-msgid "%H%<>>%> should be %<> >%> within a nested template argument list"
+msgid "%<>>%> should be %<> >%> within a nested template argument list"
msgstr ""
-#: cp/parser.c:18178
+#: cp/parser.c:19011
#, gcc-internal-format
-msgid "%Hspurious %<>>%>, use %<>%> to terminate a template argument list"
+msgid "spurious %<>>%>, use %<>%> to terminate a template argument list"
msgstr ""
-#: cp/parser.c:18512
+#: cp/parser.c:19354
#, gcc-internal-format
-msgid "%Hinvalid use of %qD in linkage specification"
+msgid "invalid use of %qD in linkage specification"
msgstr ""
-#: cp/parser.c:18525
+#: cp/parser.c:19367
#, gcc-internal-format
-msgid "%H%<__thread%> before %qD"
+msgid "%<__thread%> before %qD"
msgstr ""
-#: cp/parser.c:18846
+#: cp/parser.c:19688
#, gcc-internal-format
msgid "%qs tag used in naming %q#T"
msgstr ""
-#: cp/parser.c:18867
+#: cp/parser.c:19709
#, gcc-internal-format
-msgid "%H%qD redeclared with different access"
+msgid "%qD redeclared with different access"
msgstr ""
-#: cp/parser.c:18885
+#: cp/parser.c:19728
#, gcc-internal-format
-msgid "%H%<template%> (as a disambiguator) is only allowed within templates"
+msgid "%<template%> (as a disambiguator) is only allowed within templates"
msgstr ""
-#: cp/parser.c:19151 cp/parser.c:20078 cp/parser.c:20210
+#: cp/parser.c:19995 cp/parser.c:20923 cp/parser.c:21056
#, gcc-internal-format
-msgid "%Hmisplaced %<@%D%> Objective-C++ construct"
+msgid "misplaced %<@%D%> Objective-C++ construct"
msgstr ""
-#: cp/parser.c:19295
+#: cp/parser.c:20140
#, gcc-internal-format
-msgid "%H%<@encode%> must specify a type as an argument"
+msgid "%<@encode%> must specify a type as an argument"
msgstr ""
-#: cp/parser.c:19611
+#: cp/parser.c:20456
#, gcc-internal-format
-msgid "%Hinvalid Objective-C++ selector name"
+msgid "invalid Objective-C++ selector name"
msgstr ""
-#: cp/parser.c:19942
+#: cp/parser.c:20787
#, gcc-internal-format
-msgid "%Hidentifier expected after %<@protocol%>"
+msgid "identifier expected after %<@protocol%>"
msgstr ""
-#: cp/parser.c:20303
-#, gcc-internal-format
-msgid "%Htoo many %qs clauses"
-msgstr ""
-
-#: cp/parser.c:20417
-#, gcc-internal-format
-msgid "%Hcollapse argument needs positive constant integer expression"
-msgstr ""
-
-#: cp/parser.c:20706
-#, gcc-internal-format
-msgid "%Hschedule %<runtime%> does not take a %<chunk_size%> parameter"
-msgstr ""
-
-#: cp/parser.c:20709
-#, gcc-internal-format
-msgid "%Hschedule %<auto%> does not take a %<chunk_size%> parameter"
-msgstr ""
-
-#: cp/parser.c:20857
-#, gcc-internal-format
-msgid "%H%qs is not valid for %qs"
-msgstr ""
-
-#: cp/parser.c:21280
+#: cp/parser.c:22126
#, gcc-internal-format
msgid "parenthesized initialization is not allowed in OpenMP %<for%> loop"
msgstr ""
-#: cp/parser.c:21405 cp/parser.c:21443
-#, gcc-internal-format
-msgid "%Hiteration variable %qD should not be firstprivate"
-msgstr ""
-
-#: cp/parser.c:21447
-#, gcc-internal-format
-msgid "%Hiteration variable %qD should not be reduction"
-msgstr ""
-
-#: cp/parser.c:21514
+#: cp/parser.c:22294 cp/pt.c:11021
#, gcc-internal-format
-msgid "%Hnot enough collapsed for loops"
-msgstr ""
-
-#: cp/parser.c:21560
-#, gcc-internal-format
-msgid "%Hcollapsed loops not perfectly nested"
-msgstr ""
-
-#: cp/parser.c:21971
-#, gcc-internal-format
-msgid "%Hjunk at end of %<#pragma GCC pch_preprocess%>"
-msgstr ""
-
-#: cp/parser.c:21975
-#, gcc-internal-format
-msgid "%Hexpected string literal"
-msgstr ""
-
-#: cp/parser.c:22008
-#, gcc-internal-format
-msgid "%H%<#pragma GCC pch_preprocess%> must be first"
-msgstr ""
-
-#: cp/parser.c:22019
-#, gcc-internal-format
-msgid "%H%<#pragma omp barrier%> may only be used in compound statements"
-msgstr ""
-
-#: cp/parser.c:22034
-#, gcc-internal-format
-msgid "%H%<#pragma omp flush%> may only be used in compound statements"
+msgid "iteration variable %qD should not be reduction"
msgstr ""
-#: cp/parser.c:22049
+#: cp/parser.c:22361
#, gcc-internal-format
-msgid "%H%<#pragma omp taskwait%> may only be used in compound statements"
+msgid "not enough collapsed for loops"
msgstr ""
-#: cp/parser.c:22077
+#: cp/parser.c:22822
#, gcc-internal-format
-msgid ""
-"%H%<#pragma omp section%> may only be used in %<#pragma omp sections%> "
-"construct"
+msgid "junk at end of %<#pragma GCC pch_preprocess%>"
msgstr ""
-#: cp/parser.c:22135
+#: cp/parser.c:22986
#, gcc-internal-format
msgid "inter-module optimizations not implemented for C++"
msgstr ""
-#: cp/pt.c:254
+#: cp/pt.c:273
#, gcc-internal-format
msgid "data member %qD cannot be a member template"
msgstr ""
-#: cp/pt.c:266
+#: cp/pt.c:285
#, gcc-internal-format
msgid "invalid member template declaration %qD"
msgstr ""
-#: cp/pt.c:613
+#: cp/pt.c:636
#, gcc-internal-format
msgid "explicit specialization in non-namespace scope %qD"
msgstr ""
-#: cp/pt.c:627
+#: cp/pt.c:650
#, gcc-internal-format
msgid "enclosing class templates are not explicitly specialized"
msgstr ""
-#: cp/pt.c:715
+#: cp/pt.c:738
#, gcc-internal-format
msgid "specialization of %qD in different namespace"
msgstr ""
-#: cp/pt.c:716 cp/pt.c:817
+#: cp/pt.c:739 cp/pt.c:841
#, gcc-internal-format
msgid " from definition of %q+#D"
msgstr ""
-#: cp/pt.c:733
+#: cp/pt.c:756
#, gcc-internal-format
msgid ""
"explicit instantiation of %qD in namespace %qD (which does not enclose "
"namespace %qD)"
msgstr ""
-#: cp/pt.c:751
+#: cp/pt.c:774
#, gcc-internal-format
msgid "name of class shadows template template parameter %qD"
msgstr ""
-#: cp/pt.c:784
+#: cp/pt.c:807
#, gcc-internal-format
msgid "specialization of %qT after instantiation"
msgstr ""
-#: cp/pt.c:816
+#: cp/pt.c:840
#, gcc-internal-format
msgid "specializing %q#T in different namespace"
msgstr ""
-#: cp/pt.c:831
+#. But if we've had an implicit instantiation, that's a
+#. problem ([temp.expl.spec]/6).
+#: cp/pt.c:878
#, gcc-internal-format
msgid "specialization %qT after instantiation %qT"
msgstr ""
-#: cp/pt.c:844
+#: cp/pt.c:892
#, gcc-internal-format
msgid "explicit specialization of non-template %qT"
msgstr ""
-#: cp/pt.c:1252
+#: cp/pt.c:1308
#, gcc-internal-format
msgid "specialization of %qD after instantiation"
msgstr ""
-#: cp/pt.c:1474
+#: cp/pt.c:1718
#, gcc-internal-format
msgid "%qD is not a function template"
msgstr ""
-#: cp/pt.c:1683
+#: cp/pt.c:1927
#, gcc-internal-format
msgid "template-id %qD for %q+D does not match any template declaration"
msgstr ""
-#: cp/pt.c:1691
+#: cp/pt.c:1935
#, gcc-internal-format
msgid "ambiguous template specialization %qD for %q+D"
msgstr ""
#. This case handles bogus declarations like template <>
#. template <class T> void f<int>();
-#: cp/pt.c:1926 cp/pt.c:1980
+#: cp/pt.c:2171 cp/pt.c:2225
#, gcc-internal-format
msgid "template-id %qD in declaration of primary template"
msgstr ""
-#: cp/pt.c:1939
+#: cp/pt.c:2184
#, gcc-internal-format
msgid "template parameter list used in explicit instantiation"
msgstr ""
-#: cp/pt.c:1945
+#: cp/pt.c:2190
#, gcc-internal-format
msgid "definition provided for explicit instantiation"
msgstr ""
-#: cp/pt.c:1953
+#: cp/pt.c:2198
#, gcc-internal-format
msgid "too many template parameter lists in declaration of %qD"
msgstr ""
-#: cp/pt.c:1956
+#: cp/pt.c:2201
#, gcc-internal-format
msgid "too few template parameter lists in declaration of %qD"
msgstr ""
-#: cp/pt.c:1958
+#: cp/pt.c:2203
#, gcc-internal-format
msgid "explicit specialization of %qD must be introduced by %<template <>%>"
msgstr ""
-#: cp/pt.c:1977
+#: cp/pt.c:2222
#, gcc-internal-format
msgid "function template partial specialization %qD is not allowed"
msgstr ""
-#: cp/pt.c:2009
+#: cp/pt.c:2254
#, gcc-internal-format
msgid "default argument specified in explicit specialization"
msgstr ""
-#: cp/pt.c:2039
+#: cp/pt.c:2284
#, gcc-internal-format
msgid "%qD is not a template function"
msgstr ""
-#: cp/pt.c:2047
+#: cp/pt.c:2292
#, gcc-internal-format
msgid "%qD is not declared in %qD"
msgstr ""
@@ -33328,104 +34530,104 @@ msgstr ""
#. program is ill-formed.
#.
#. Similar language is found in [temp.explicit].
-#: cp/pt.c:2109
+#: cp/pt.c:2354
#, gcc-internal-format
msgid "specialization of implicitly-declared special member function"
msgstr ""
-#: cp/pt.c:2153
+#: cp/pt.c:2398
#, gcc-internal-format
msgid "no member function %qD declared in %qT"
msgstr ""
-#: cp/pt.c:2634
+#: cp/pt.c:3000
#, gcc-internal-format
msgid "base initializer expansion %<%T%> contains no parameter packs"
msgstr ""
-#: cp/pt.c:2693
+#: cp/pt.c:3061
#, gcc-internal-format
msgid "expansion pattern %<%T%> contains no argument packs"
msgstr ""
-#: cp/pt.c:2695
+#: cp/pt.c:3063
#, gcc-internal-format
msgid "expansion pattern %<%E%> contains no argument packs"
msgstr ""
-#: cp/pt.c:2736
+#: cp/pt.c:3104
#, gcc-internal-format
msgid "parameter packs not expanded with %<...%>:"
msgstr ""
-#: cp/pt.c:2751 cp/pt.c:3372
+#: cp/pt.c:3119 cp/pt.c:3733
#, gcc-internal-format
msgid " %qD"
msgstr ""
-#: cp/pt.c:2753
+#: cp/pt.c:3121
#, gcc-internal-format
msgid " <anonymous>"
msgstr ""
-#: cp/pt.c:2861
+#: cp/pt.c:3229
#, gcc-internal-format
msgid "declaration of %q+#D"
msgstr ""
-#: cp/pt.c:2862
+#: cp/pt.c:3230
#, gcc-internal-format
msgid " shadows template parm %q+#D"
msgstr ""
-#: cp/pt.c:3368
+#: cp/pt.c:3729
#, gcc-internal-format
msgid "template parameters not used in partial specialization:"
msgstr ""
-#: cp/pt.c:3383
+#: cp/pt.c:3744
#, gcc-internal-format
msgid "partial specialization %qT does not specialize any template arguments"
msgstr ""
-#: cp/pt.c:3428
+#: cp/pt.c:3789
#, gcc-internal-format
msgid ""
"parameter pack argument %qE must be at the end of the template argument list"
msgstr ""
-#: cp/pt.c:3430
+#: cp/pt.c:3791
#, gcc-internal-format
msgid ""
"parameter pack argument %qT must be at the end of the template argument list"
msgstr ""
-#: cp/pt.c:3451
+#: cp/pt.c:3812
#, gcc-internal-format
msgid "template argument %qE involves template parameter(s)"
msgstr ""
-#: cp/pt.c:3495
+#: cp/pt.c:3856
#, gcc-internal-format
msgid "type %qT of template argument %qE depends on template parameter(s)"
msgstr ""
-#: cp/pt.c:3603
+#: cp/pt.c:3963
#, gcc-internal-format
msgid "no default argument for %qD"
msgstr ""
-#: cp/pt.c:3624
+#: cp/pt.c:3984
#, gcc-internal-format
msgid "parameter pack %qE must be at the end of the template parameter list"
msgstr ""
-#: cp/pt.c:3627
+#: cp/pt.c:3987
#, gcc-internal-format
msgid "parameter pack %qT must be at the end of the template parameter list"
msgstr ""
-#: cp/pt.c:3815
+#: cp/pt.c:4176
#, gcc-internal-format
msgid "template class without a name"
msgstr ""
@@ -33433,7 +34635,7 @@ msgstr ""
#. [temp.mem]
#.
#. A destructor shall not be a member template.
-#: cp/pt.c:3825
+#: cp/pt.c:4186
#, gcc-internal-format
msgid "destructor %qD declared as member template"
msgstr ""
@@ -33443,72 +34645,72 @@ msgstr ""
#. An allocation function can be a function
#. template. ... Template allocation functions shall
#. have two or more parameters.
-#: cp/pt.c:3840
+#: cp/pt.c:4201
#, gcc-internal-format
msgid "invalid template declaration of %qD"
msgstr ""
-#: cp/pt.c:3957
+#: cp/pt.c:4318
#, gcc-internal-format
msgid "template definition of non-template %q#D"
msgstr ""
-#: cp/pt.c:4000
+#: cp/pt.c:4361
#, gcc-internal-format
msgid "expected %d levels of template parms for %q#D, got %d"
msgstr ""
-#: cp/pt.c:4012
+#: cp/pt.c:4373
#, gcc-internal-format
msgid "got %d template parameters for %q#D"
msgstr ""
-#: cp/pt.c:4015
+#: cp/pt.c:4376
#, gcc-internal-format
msgid "got %d template parameters for %q#T"
msgstr ""
-#: cp/pt.c:4017
+#: cp/pt.c:4378
#, gcc-internal-format
msgid " but %d required"
msgstr ""
-#: cp/pt.c:4035
+#: cp/pt.c:4396
#, gcc-internal-format
msgid "template arguments to %qD do not match original template %qD"
msgstr ""
-#: cp/pt.c:4039
+#: cp/pt.c:4400
#, gcc-internal-format
msgid "use template<> for an explicit specialization"
msgstr ""
-#: cp/pt.c:4135
+#: cp/pt.c:4496
#, gcc-internal-format
msgid "%qT is not a template type"
msgstr ""
-#: cp/pt.c:4148
+#: cp/pt.c:4509
#, gcc-internal-format
msgid "template specifiers not specified in declaration of %qD"
msgstr ""
-#: cp/pt.c:4158
+#: cp/pt.c:4519
#, gcc-internal-format
msgid "redeclared with %d template parameter(s)"
msgstr ""
-#: cp/pt.c:4160
+#: cp/pt.c:4521
#, gcc-internal-format
msgid "previous declaration %q+D used %d template parameter(s)"
msgstr ""
-#: cp/pt.c:4194
+#: cp/pt.c:4555
#, gcc-internal-format
msgid "template parameter %q+#D"
msgstr ""
-#: cp/pt.c:4195
+#: cp/pt.c:4556
#, gcc-internal-format
msgid "redeclared here as %q#D"
msgstr ""
@@ -33517,220 +34719,220 @@ msgstr ""
#.
#. A template-parameter may not be given default arguments
#. by two different declarations in the same scope.
-#: cp/pt.c:4205
+#: cp/pt.c:4566
#, gcc-internal-format
msgid "redefinition of default argument for %q#D"
msgstr ""
-#: cp/pt.c:4206
+#: cp/pt.c:4568
#, gcc-internal-format
-msgid "%Joriginal definition appeared here"
+msgid "original definition appeared here"
msgstr ""
-#: cp/pt.c:4310
+#: cp/pt.c:4672
#, gcc-internal-format
msgid ""
"%qE is not a valid template argument for type %qT because function %qD has "
"not external linkage"
msgstr ""
-#: cp/pt.c:4351
+#: cp/pt.c:4713
#, gcc-internal-format
msgid ""
"%qE is not a valid template argument for type %qT because string literals "
"can never be used in this context"
msgstr ""
-#: cp/pt.c:4428
+#: cp/pt.c:4790
#, gcc-internal-format
msgid ""
"%qE is not a valid template argument for type %qT because it is a non-"
"constant expression"
msgstr ""
-#: cp/pt.c:4472
+#: cp/pt.c:4834
#, gcc-internal-format
msgid ""
"%qD is not a valid template argument because %qD is a variable, not the "
"address of a variable"
msgstr ""
-#: cp/pt.c:4490
+#: cp/pt.c:4852
#, gcc-internal-format
msgid ""
"%qE is not a valid template argument of type %qT because %qE is not a "
"variable"
msgstr ""
-#: cp/pt.c:4497
+#: cp/pt.c:4859
#, gcc-internal-format
msgid ""
"%qE is not a valid template argument of type %qT because %qD does not have "
"external linkage"
msgstr ""
-#: cp/pt.c:4527
+#: cp/pt.c:4889
#, gcc-internal-format
msgid ""
"%qE is not a valid template argument for type %qT because of conflicts in cv-"
"qualification"
msgstr ""
-#: cp/pt.c:4534
+#: cp/pt.c:4896
#, gcc-internal-format
msgid ""
"%qE is not a valid template argument for type %qT because it is not an lvalue"
msgstr ""
-#: cp/pt.c:4547
+#: cp/pt.c:4909
#, gcc-internal-format
msgid ""
"%qE is not a valid template argument for type %qT because object %qD has not "
"external linkage"
msgstr ""
-#: cp/pt.c:4579
+#: cp/pt.c:4941
#, gcc-internal-format
msgid "%qE is not a valid template argument for type %qT"
msgstr ""
-#: cp/pt.c:4580
+#: cp/pt.c:4942
#, gcc-internal-format
msgid "it must be the address of a function with external linkage"
msgstr ""
-#: cp/pt.c:4594
+#: cp/pt.c:4956
#, gcc-internal-format
msgid ""
"%qE is not a valid template argument for type %qT because it is a pointer"
msgstr ""
-#: cp/pt.c:4596
+#: cp/pt.c:4958
#, gcc-internal-format
msgid "try using %qE instead"
msgstr ""
-#: cp/pt.c:4631
+#: cp/pt.c:4993
#, gcc-internal-format
msgid ""
"%qE is not a valid template argument for type %qT because it is of type %qT"
msgstr ""
-#: cp/pt.c:4634
+#: cp/pt.c:4996
#, gcc-internal-format
msgid "standard conversions are not allowed in this context"
msgstr ""
-#: cp/pt.c:4971
+#: cp/pt.c:5333
#, gcc-internal-format
msgid "to refer to a type member of a template parameter, use %<typename %E%>"
msgstr ""
-#: cp/pt.c:4987 cp/pt.c:5006 cp/pt.c:5056
+#: cp/pt.c:5349 cp/pt.c:5368 cp/pt.c:5418
#, gcc-internal-format
msgid "type/value mismatch at argument %d in template parameter list for %qD"
msgstr ""
-#: cp/pt.c:4991
+#: cp/pt.c:5353
#, gcc-internal-format
msgid " expected a constant of type %qT, got %qT"
msgstr ""
-#: cp/pt.c:4995
+#: cp/pt.c:5357
#, gcc-internal-format
msgid " expected a class template, got %qE"
msgstr ""
-#: cp/pt.c:4997
+#: cp/pt.c:5359
#, gcc-internal-format
msgid " expected a type, got %qE"
msgstr ""
-#: cp/pt.c:5010
+#: cp/pt.c:5372
#, gcc-internal-format
msgid " expected a type, got %qT"
msgstr ""
-#: cp/pt.c:5012
+#: cp/pt.c:5374
#, gcc-internal-format
msgid " expected a class template, got %qT"
msgstr ""
-#: cp/pt.c:5059
+#: cp/pt.c:5421
#, gcc-internal-format
msgid " expected a template of type %qD, got %qD"
msgstr ""
#. Not sure if this is reachable, but it doesn't hurt
#. to be robust.
-#: cp/pt.c:5092
+#: cp/pt.c:5454
#, gcc-internal-format
msgid "type mismatch in nontype parameter pack"
msgstr ""
-#: cp/pt.c:5114
+#: cp/pt.c:5476
#, gcc-internal-format
msgid "could not convert template argument %qE to %qT"
msgstr ""
-#: cp/pt.c:5170
+#: cp/pt.c:5532
#, gcc-internal-format
msgid "wrong number of template arguments (%d, should be %d)"
msgstr ""
-#: cp/pt.c:5307
+#: cp/pt.c:5670
#, gcc-internal-format
msgid "wrong number of template arguments (%d, should be %d%s)"
msgstr ""
-#: cp/pt.c:5311
+#: cp/pt.c:5674
#, gcc-internal-format
msgid "provided for %q+D"
msgstr ""
-#: cp/pt.c:5376
+#: cp/pt.c:5741
#, gcc-internal-format
msgid "cannot expand %<%E%> into a fixed-length argument list"
msgstr ""
-#: cp/pt.c:5379
+#: cp/pt.c:5744
#, gcc-internal-format
msgid "cannot expand %<%T%> into a fixed-length argument list"
msgstr ""
-#: cp/pt.c:5395
+#: cp/pt.c:5760
#, gcc-internal-format
msgid "template argument %d is invalid"
msgstr ""
-#: cp/pt.c:5672
+#: cp/pt.c:6042
#, gcc-internal-format
msgid "non-template type %qT used as a template"
msgstr ""
-#: cp/pt.c:5674
+#: cp/pt.c:6044
#, gcc-internal-format
msgid "for template declaration %q+D"
msgstr ""
-#: cp/pt.c:6377
+#: cp/pt.c:6700
#, gcc-internal-format
msgid ""
"template instantiation depth exceeds maximum of %d (use -ftemplate-depth-NN "
"to increase the maximum) instantiating %qD"
msgstr ""
-#: cp/pt.c:7611
+#: cp/pt.c:7953
#, gcc-internal-format
msgid "mismatched argument pack lengths while expanding %<%T%>"
msgstr ""
-#: cp/pt.c:7615
+#: cp/pt.c:7957
#, gcc-internal-format
msgid "mismatched argument pack lengths while expanding %<%E%>"
msgstr ""
-#: cp/pt.c:8587
+#: cp/pt.c:8981
#, gcc-internal-format
msgid "instantiation of %q+D as type %qT"
msgstr ""
@@ -33748,241 +34950,226 @@ msgstr ""
#.
#. is an attempt to declare a variable with function
#. type.
-#: cp/pt.c:8727
+#: cp/pt.c:9120
#, gcc-internal-format
msgid "variable %qD has function type"
msgstr ""
-#: cp/pt.c:8874
+#: cp/pt.c:9285
#, gcc-internal-format
msgid "invalid parameter type %qT"
msgstr ""
-#: cp/pt.c:8876
+#: cp/pt.c:9287
#, gcc-internal-format
msgid "in declaration %q+D"
msgstr ""
-#: cp/pt.c:8953
+#: cp/pt.c:9364
#, gcc-internal-format
msgid "function returning an array"
msgstr ""
-#: cp/pt.c:8955
+#: cp/pt.c:9366
#, gcc-internal-format
msgid "function returning a function"
msgstr ""
-#: cp/pt.c:8982
+#: cp/pt.c:9393
#, gcc-internal-format
msgid "creating pointer to member function of non-class type %qT"
msgstr ""
-#: cp/pt.c:9211
-#, gcc-internal-format
-msgid "array bound is not an integer constant"
-msgstr ""
-
-#: cp/pt.c:9231
+#: cp/pt.c:9642
#, gcc-internal-format
msgid "creating array with negative size (%qE)"
msgstr ""
-#: cp/pt.c:9480
+#: cp/pt.c:9891
#, gcc-internal-format
msgid "forming reference to void"
msgstr ""
-#: cp/pt.c:9482
+#: cp/pt.c:9893
#, gcc-internal-format
msgid "forming %s to reference type %qT"
msgstr ""
-#: cp/pt.c:9533
+#: cp/pt.c:9944
#, gcc-internal-format
msgid "creating pointer to member of non-class type %qT"
msgstr ""
-#: cp/pt.c:9539
+#: cp/pt.c:9950
#, gcc-internal-format
msgid "creating pointer to member reference type %qT"
msgstr ""
-#: cp/pt.c:9545
+#: cp/pt.c:9956
#, gcc-internal-format
msgid "creating pointer to member of type void"
msgstr ""
-#: cp/pt.c:9612
+#: cp/pt.c:10023
#, gcc-internal-format
msgid "creating array of %qT"
msgstr ""
-#: cp/pt.c:9618
+#: cp/pt.c:10029
#, gcc-internal-format
msgid "creating array of %qT, which is an abstract class type"
msgstr ""
-#: cp/pt.c:9669
+#: cp/pt.c:10081
#, gcc-internal-format
msgid "%qT is not a class, struct, or union type"
msgstr ""
-#: cp/pt.c:9704
+#: cp/pt.c:10117
#, gcc-internal-format
msgid "%qT resolves to %qT, which is not an enumeration type"
msgstr ""
-#: cp/pt.c:9707
+#: cp/pt.c:10120
#, gcc-internal-format
msgid "%qT resolves to %qT, which is is not a class type"
msgstr ""
-#: cp/pt.c:9813
+#: cp/pt.c:10234
#, gcc-internal-format
msgid "use of %qs in template"
msgstr ""
-#: cp/pt.c:9950
+#: cp/pt.c:10369
+#, gcc-internal-format
+msgid "qualifying type %qT does not match destructor name ~%qT"
+msgstr ""
+
+#: cp/pt.c:10384
#, gcc-internal-format
msgid ""
"dependent-name %qE is parsed as a non-type, but instantiation yields a type"
msgstr ""
-#: cp/pt.c:9952
+#: cp/pt.c:10386
#, gcc-internal-format
msgid "say %<typename %E%> if a type is meant"
msgstr ""
-#: cp/pt.c:10098
+#: cp/pt.c:10532
#, gcc-internal-format
msgid "using invalid field %qD"
msgstr ""
-#: cp/pt.c:10428 cp/pt.c:11091
+#: cp/pt.c:10862 cp/pt.c:11534
#, gcc-internal-format
msgid "invalid use of pack expansion expression"
msgstr ""
-#: cp/pt.c:10432 cp/pt.c:11095
+#: cp/pt.c:10866 cp/pt.c:11538
#, gcc-internal-format
msgid "use %<...%> to expand argument pack"
msgstr ""
-#: cp/pt.c:10587
-#, gcc-internal-format
-msgid "iteration variable %qD should not be reduction"
-msgstr ""
-
-#: cp/pt.c:11255
+#: cp/pt.c:11698
#, gcc-internal-format
msgid ""
"a cast to a type other than an integral or enumeration type cannot appear in "
"a constant-expression"
msgstr ""
-#: cp/pt.c:11723
+#: cp/pt.c:12238
#, gcc-internal-format
msgid "%qT is not a class or namespace"
msgstr ""
-#: cp/pt.c:11726
+#: cp/pt.c:12241
#, gcc-internal-format
msgid "%qD is not a class or namespace"
msgstr ""
-#: cp/pt.c:11946
-#, gcc-internal-format
-msgid "%qT is/uses anonymous type"
-msgstr ""
-
-#: cp/pt.c:11948
-#, gcc-internal-format
-msgid "template argument for %qD uses local type %qT"
-msgstr ""
-
-#: cp/pt.c:11958
+#: cp/pt.c:12483
#, gcc-internal-format
msgid "%qT is a variably modified type"
msgstr ""
-#: cp/pt.c:11969
+#: cp/pt.c:12494
#, gcc-internal-format
msgid "integral expression %qE is not constant"
msgstr ""
-#: cp/pt.c:11987
+#: cp/pt.c:12512
#, gcc-internal-format
msgid " trying to instantiate %qD"
msgstr ""
-#: cp/pt.c:14822
+#: cp/pt.c:15507
#, gcc-internal-format
msgid "ambiguous class template instantiation for %q#T"
msgstr ""
-#: cp/pt.c:14825
+#: cp/pt.c:15510
#, gcc-internal-format
msgid "%s %+#T"
msgstr ""
-#: cp/pt.c:14848 cp/pt.c:14931
+#: cp/pt.c:15533 cp/pt.c:15616
#, gcc-internal-format
msgid "explicit instantiation of non-template %q#D"
msgstr ""
-#: cp/pt.c:14863
+#: cp/pt.c:15548
#, gcc-internal-format
msgid "%qD is not a static data member of a class template"
msgstr ""
-#: cp/pt.c:14869 cp/pt.c:14926
+#: cp/pt.c:15554 cp/pt.c:15611
#, gcc-internal-format
msgid "no matching template for %qD found"
msgstr ""
-#: cp/pt.c:14874
+#: cp/pt.c:15559
#, gcc-internal-format
msgid ""
"type %qT for explicit instantiation %qD does not match declared type %qT"
msgstr ""
-#: cp/pt.c:14882
+#: cp/pt.c:15567
#, gcc-internal-format
msgid "explicit instantiation of %q#D"
msgstr ""
-#: cp/pt.c:14918
+#: cp/pt.c:15603
#, gcc-internal-format
msgid "duplicate explicit instantiation of %q#D"
msgstr ""
-#: cp/pt.c:14941 cp/pt.c:15033
+#: cp/pt.c:15626 cp/pt.c:15718
#, gcc-internal-format
msgid "ISO C++ 1998 forbids the use of %<extern%> on explicit instantiations"
msgstr ""
-#: cp/pt.c:14946 cp/pt.c:15050
+#: cp/pt.c:15631 cp/pt.c:15735
#, gcc-internal-format
msgid "storage class %qD applied to template instantiation"
msgstr ""
-#: cp/pt.c:15011
+#: cp/pt.c:15696
#, gcc-internal-format
msgid "explicit instantiation of non-template type %qT"
msgstr ""
-#: cp/pt.c:15020
+#: cp/pt.c:15705
#, gcc-internal-format
msgid "explicit instantiation of %q#T before definition of template"
msgstr ""
-#: cp/pt.c:15038
+#: cp/pt.c:15723
#, gcc-internal-format
msgid "ISO C++ forbids the use of %qE on explicit instantiations"
msgstr ""
-#: cp/pt.c:15084
+#: cp/pt.c:15769
#, gcc-internal-format
msgid "duplicate explicit instantiation of %q#T"
msgstr ""
@@ -33994,12 +35181,12 @@ msgstr ""
#. member function or static data member of a class template
#. shall be present in every translation unit in which it is
#. explicitly instantiated.
-#: cp/pt.c:15534
+#: cp/pt.c:16233
#, gcc-internal-format
msgid "explicit instantiation of %qD but no definition available"
msgstr ""
-#: cp/pt.c:15700
+#: cp/pt.c:16399
#, gcc-internal-format
msgid ""
"template instantiation depth exceeds maximum of %d instantiating %q+D, "
@@ -34007,34 +35194,34 @@ msgid ""
"the maximum)"
msgstr ""
-#: cp/pt.c:16055
+#: cp/pt.c:16754
#, gcc-internal-format
msgid "%q#T is not a valid type for a template constant parameter"
msgstr ""
-#: cp/pt.c:17053
+#: cp/pt.c:17751
#, gcc-internal-format
msgid ""
-"deducing auto from brace-enclosed initializer list requires #include "
+"deducing from brace-enclosed initializer list requires #include "
"<initializer_list>"
msgstr ""
-#: cp/pt.c:17094
+#: cp/pt.c:17801
#, gcc-internal-format
msgid "unable to deduce %qT from %qE"
msgstr ""
-#: cp/repo.c:111
+#: cp/repo.c:119
#, gcc-internal-format
msgid "-frepo must be used with -c"
msgstr ""
-#: cp/repo.c:200
+#: cp/repo.c:209
#, gcc-internal-format
msgid "mysterious repository information in %s"
msgstr ""
-#: cp/repo.c:218
+#: cp/repo.c:227
#, gcc-internal-format
msgid "can't create repository information file %qs"
msgstr ""
@@ -34143,802 +35330,805 @@ msgstr ""
msgid " since %q+#D declared in base class"
msgstr ""
-#: cp/semantics.c:760
+#: cp/semantics.c:761
#, gcc-internal-format
msgid "suggest explicit braces around empty body in %<do%> statement"
msgstr ""
-#: cp/semantics.c:1284
+#: cp/semantics.c:1286
#, gcc-internal-format
msgid "type of asm operand %qE could not be determined"
msgstr ""
-#: cp/semantics.c:1340
+#: cp/semantics.c:1344
#, gcc-internal-format
msgid "__label__ declarations are only allowed in function scopes"
msgstr ""
-#: cp/semantics.c:1438
+#: cp/semantics.c:1442
#, gcc-internal-format
msgid "invalid use of member %q+D in static member function"
msgstr ""
-#: cp/semantics.c:1440
+#: cp/semantics.c:1444
#, gcc-internal-format
msgid "invalid use of non-static data member %q+D"
msgstr ""
-#: cp/semantics.c:1441 cp/semantics.c:1483
+#: cp/semantics.c:1445 cp/semantics.c:1502
#, gcc-internal-format
msgid "from this location"
msgstr ""
-#: cp/semantics.c:1482
+#: cp/semantics.c:1501
#, gcc-internal-format
msgid "object missing in reference to %q+D"
msgstr ""
-#: cp/semantics.c:2006
+#: cp/semantics.c:2022
#, gcc-internal-format
msgid "arguments to destructor are not allowed"
msgstr ""
-#: cp/semantics.c:2056
+#: cp/semantics.c:2080
#, gcc-internal-format
msgid "%<this%> is unavailable for static member functions"
msgstr ""
-#: cp/semantics.c:2062
+#: cp/semantics.c:2086
#, gcc-internal-format
msgid "invalid use of %<this%> in non-member function"
msgstr ""
-#: cp/semantics.c:2064
+#: cp/semantics.c:2088
#, gcc-internal-format
msgid "invalid use of %<this%> at top level"
msgstr ""
-#: cp/semantics.c:2088
+#: cp/semantics.c:2112
#, gcc-internal-format
msgid "invalid qualifying scope in pseudo-destructor name"
msgstr ""
-#: cp/semantics.c:2093 cp/typeck.c:2130
+#: cp/semantics.c:2117 cp/typeck.c:2147
#, gcc-internal-format
msgid "qualified type %qT does not match destructor name ~%qT"
msgstr ""
-#: cp/semantics.c:2115
+#: cp/semantics.c:2139
#, gcc-internal-format
msgid "%qE is not of type %qT"
msgstr ""
-#: cp/semantics.c:2159
+#: cp/semantics.c:2183
#, gcc-internal-format
msgid "compound literal of non-object type %qT"
msgstr ""
-#: cp/semantics.c:2243
+#: cp/semantics.c:2267
#, gcc-internal-format
msgid "template type parameters must use the keyword %<class%> or %<typename%>"
msgstr ""
-#: cp/semantics.c:2284
+#: cp/semantics.c:2309
#, gcc-internal-format
msgid ""
"invalid use of type %qT as a default value for a template template-parameter"
msgstr ""
-#: cp/semantics.c:2287
+#: cp/semantics.c:2312
#, gcc-internal-format
msgid "invalid default argument for a template template parameter"
msgstr ""
-#: cp/semantics.c:2304
+#: cp/semantics.c:2329
#, gcc-internal-format
msgid "definition of %q#T inside template parameter list"
msgstr ""
-#: cp/semantics.c:2315
+#: cp/semantics.c:2340
#, gcc-internal-format
msgid "invalid definition of qualified type %qT"
msgstr ""
-#: cp/semantics.c:2531
+#: cp/semantics.c:2556
#, gcc-internal-format
msgid "invalid base-class specification"
msgstr ""
-#: cp/semantics.c:2543
+#: cp/semantics.c:2568
#, gcc-internal-format
msgid "base class %qT has cv qualifiers"
msgstr ""
-#: cp/semantics.c:2568
+#: cp/semantics.c:2593
+#, gcc-internal-format
+msgid "incomplete type %qT used in nested name specifier"
+msgstr ""
+
+#: cp/semantics.c:2597
#, gcc-internal-format
-msgid "%Hincomplete type %qT used in nested name specifier"
+msgid "reference to %<%T::%D%> is ambiguous"
msgstr ""
-#: cp/semantics.c:2572
+#: cp/semantics.c:2602 cp/typeck.c:1947
#, gcc-internal-format
-msgid "%Hreference to %<%T::%D%> is ambiguous"
+msgid "%qD is not a member of %qT"
msgstr ""
-#: cp/semantics.c:2576
+#: cp/semantics.c:2605
#, gcc-internal-format
-msgid "%H%qD is not a member of %qT"
+msgid "%qD is not a member of %qD"
msgstr ""
-#: cp/semantics.c:2579
+#: cp/semantics.c:2607
#, gcc-internal-format
-msgid "%H%qD is not a member of %qD"
+msgid "%<::%D%> has not been declared"
msgstr ""
-#: cp/semantics.c:2581
+#: cp/semantics.c:2803 cp/semantics.c:5532
#, gcc-internal-format
-msgid "%H%<::%D%> has not been declared"
+msgid "%qD is not captured"
msgstr ""
-#: cp/semantics.c:2722
+#: cp/semantics.c:2809
#, gcc-internal-format
msgid "use of %<auto%> variable from containing function"
msgstr ""
-#: cp/semantics.c:2724
+#: cp/semantics.c:2811
#, gcc-internal-format
msgid " %q+#D declared here"
msgstr ""
-#: cp/semantics.c:2762
+#: cp/semantics.c:2849
#, gcc-internal-format
msgid ""
"template parameter %qD of type %qT is not allowed in an integral constant "
"expression because it is not of integral or enumeration type"
msgstr ""
-#: cp/semantics.c:2926
+#: cp/semantics.c:3013
#, gcc-internal-format
msgid "%qD cannot appear in a constant-expression"
msgstr ""
-#: cp/semantics.c:2934
+#: cp/semantics.c:3021
#, gcc-internal-format
msgid "use of namespace %qD as expression"
msgstr ""
-#: cp/semantics.c:2939
+#: cp/semantics.c:3026
#, gcc-internal-format
msgid "use of class template %qT as expression"
msgstr ""
#. Ambiguous reference to base members.
-#: cp/semantics.c:2945
+#: cp/semantics.c:3032
#, gcc-internal-format
msgid "request for member %qD is ambiguous in multiple inheritance lattice"
msgstr ""
-#: cp/semantics.c:3067 cp/semantics.c:4798
+#: cp/semantics.c:3154 cp/semantics.c:4917
#, gcc-internal-format
msgid "type of %qE is unknown"
msgstr ""
-#: cp/semantics.c:3082
+#: cp/semantics.c:3169
#, gcc-internal-format
msgid "cannot apply %<offsetof%> to destructor %<~%T%>"
msgstr ""
-#: cp/semantics.c:3093
+#: cp/semantics.c:3180
#, gcc-internal-format
msgid "cannot apply %<offsetof%> to member function %qD"
msgstr ""
-#: cp/semantics.c:3538
+#: cp/semantics.c:3639
#, gcc-internal-format
msgid "%qD is not a variable in clause %qs"
msgstr ""
-#: cp/semantics.c:3547 cp/semantics.c:3569 cp/semantics.c:3591
+#: cp/semantics.c:3648 cp/semantics.c:3670 cp/semantics.c:3692
#, gcc-internal-format
msgid "%qD appears more than once in data clauses"
msgstr ""
-#: cp/semantics.c:3561
+#: cp/semantics.c:3662
#, gcc-internal-format
msgid "%qD is not a variable in clause %<firstprivate%>"
msgstr ""
-#: cp/semantics.c:3583
+#: cp/semantics.c:3684
#, gcc-internal-format
msgid "%qD is not a variable in clause %<lastprivate%>"
msgstr ""
-#: cp/semantics.c:3613
+#: cp/semantics.c:3714
#, gcc-internal-format
msgid "num_threads expression must be integral"
msgstr ""
-#: cp/semantics.c:3627
+#: cp/semantics.c:3728
#, gcc-internal-format
msgid "schedule chunk size expression must be integral"
msgstr ""
-#: cp/semantics.c:3759
+#: cp/semantics.c:3860
#, gcc-internal-format
msgid "%qE has reference type for %qs"
msgstr ""
-#: cp/semantics.c:3830
+#: cp/semantics.c:3931
#, gcc-internal-format
msgid "%<threadprivate%> %qD is not file, namespace or block scope variable"
msgstr ""
-#: cp/semantics.c:3844
+#: cp/semantics.c:3945
#, gcc-internal-format
msgid "%<threadprivate%> %qE directive not in %qT definition"
msgstr ""
-#: cp/semantics.c:3979
+#: cp/semantics.c:4090
#, gcc-internal-format
-msgid "%Hinvalid controlling predicate"
+msgid "difference between %qE and %qD does not have integer type"
msgstr ""
-#: cp/semantics.c:3989
+#. Report the error.
+#: cp/semantics.c:4616
#, gcc-internal-format
-msgid "%Hdifference between %qE and %qD does not have integer type"
+msgid "static assertion failed: %E"
msgstr ""
-#: cp/semantics.c:4084
+#: cp/semantics.c:4618
#, gcc-internal-format
-msgid "%Hinvalid increment expression"
+msgid "non-constant condition for static assertion"
msgstr ""
-#: cp/semantics.c:4211 cp/semantics.c:4282
+#: cp/semantics.c:4706 cp/semantics.c:4828
#, gcc-internal-format
-msgid "%Hexpected iteration declaration or initialization"
+msgid "argument to decltype must be an expression"
msgstr ""
-#: cp/semantics.c:4222
+#: cp/semantics.c:4778
#, gcc-internal-format
-msgid "%Hmissing controlling predicate"
+msgid "%qE refers to a set of overloaded functions"
msgstr ""
-#: cp/semantics.c:4228
+#: cp/semantics.c:4861
#, gcc-internal-format
-msgid "%Hmissing increment expression"
+msgid "unable to determine the declared type of expression %<%E%>"
msgstr ""
-#: cp/semantics.c:4308
+#: cp/semantics.c:5122
#, gcc-internal-format
-msgid "%Hinvalid type for iteration variable %qE"
+msgid "__is_convertible_to"
msgstr ""
-#. Report the error.
-#: cp/semantics.c:4510
+#: cp/semantics.c:5163 cp/semantics.c:5173
#, gcc-internal-format
-msgid "static assertion failed: %E"
+msgid "incomplete type %qT not allowed"
msgstr ""
-#: cp/semantics.c:4512
+#: cp/semantics.c:5236
#, gcc-internal-format
-msgid "non-constant condition for static assertion"
+msgid "the type %qT of constexpr variable %qD is not literal"
msgstr ""
-#: cp/semantics.c:4604 cp/semantics.c:4721
+#: cp/semantics.c:5271
#, gcc-internal-format
-msgid "argument to decltype must be an expression"
+msgid "parameter %q#D is not of literal type"
msgstr ""
-#: cp/semantics.c:4671
+#: cp/semantics.c:5284
#, gcc-internal-format
-msgid "%qE refers to a set of overloaded functions"
+msgid "return type %qT of function %qD is not a literal type"
msgstr ""
-#: cp/semantics.c:4754
+#: cp/semantics.c:5578
#, gcc-internal-format
-msgid "unable to determine the declared type of expression %<%E%>"
+msgid "cannot capture %qE by reference"
msgstr ""
-#: cp/semantics.c:4985
+#: cp/semantics.c:5600
#, gcc-internal-format
-msgid "__is_convertible_to"
+msgid "already captured %<this%> in lambda expression"
msgstr ""
-#: cp/semantics.c:5024 cp/semantics.c:5034
+#: cp/semantics.c:5716
#, gcc-internal-format
-msgid "incomplete type %qT not allowed"
+msgid "%<this%> was not captured for this lambda function"
msgstr ""
-#: cp/tree.c:882
+#: cp/tree.c:918
#, gcc-internal-format
msgid "%qV qualifiers cannot be applied to %qT"
msgstr ""
-#: cp/tree.c:2230
+#: cp/tree.c:2466
#, gcc-internal-format
msgid "%qE attribute can only be applied to Java class definitions"
msgstr ""
-#: cp/tree.c:2259
+#: cp/tree.c:2495
#, gcc-internal-format
msgid "%qE attribute can only be applied to class definitions"
msgstr ""
-#: cp/tree.c:2265
+#: cp/tree.c:2501
#, gcc-internal-format
msgid "%qE is obsolete; g++ vtables are now COM-compatible by default"
msgstr ""
-#: cp/tree.c:2289
+#: cp/tree.c:2525
#, gcc-internal-format
msgid "requested init_priority is not an integer constant"
msgstr ""
-#: cp/tree.c:2310
+#: cp/tree.c:2546
#, gcc-internal-format
msgid ""
"can only use %qE attribute on file-scope definitions of objects of class type"
msgstr ""
-#: cp/tree.c:2318
+#: cp/tree.c:2554
#, gcc-internal-format
msgid "requested init_priority is out of range"
msgstr ""
-#: cp/tree.c:2328
+#: cp/tree.c:2564
#, gcc-internal-format
msgid "requested init_priority is reserved for internal use"
msgstr ""
-#: cp/tree.c:2339
+#: cp/tree.c:2575
#, gcc-internal-format
msgid "%qE attribute is not supported on this platform"
msgstr ""
-#: cp/typeck.c:457 cp/typeck.c:472 cp/typeck.c:574
+#: cp/tree.c:3155
+#, gcc-internal-format
+msgid "lang_* check: failed in %s, at %s:%d"
+msgstr ""
+
+#: cp/typeck.c:465 cp/typeck.c:480 cp/typeck.c:582
#, gcc-internal-format
msgid "%s between distinct pointer types %qT and %qT lacks a cast"
msgstr ""
-#: cp/typeck.c:534
+#: cp/typeck.c:542
#, gcc-internal-format
msgid ""
"ISO C++ forbids %s between pointer of type %<void *%> and pointer-to-function"
msgstr ""
-#: cp/typeck.c:595
+#: cp/typeck.c:603
#, gcc-internal-format
msgid "%s between distinct pointer-to-member types %qT and %qT lacks a cast"
msgstr ""
-#: cp/typeck.c:1200
+#: cp/typeck.c:1212
#, gcc-internal-format
msgid "canonical types differ for identical types %T and %T"
msgstr ""
-#: cp/typeck.c:1207
+#: cp/typeck.c:1219
#, gcc-internal-format
msgid "same canonical type node for different types %T and %T"
msgstr ""
-#: cp/typeck.c:1320
+#: cp/typeck.c:1332
#, gcc-internal-format
msgid "invalid application of %qs to a member function"
msgstr ""
-#: cp/typeck.c:1388
+#: cp/typeck.c:1400
#, gcc-internal-format
msgid "invalid application of %<sizeof%> to a bit-field"
msgstr ""
-#: cp/typeck.c:1396
+#: cp/typeck.c:1408
#, gcc-internal-format
msgid "ISO C++ forbids applying %<sizeof%> to an expression of function type"
msgstr ""
-#: cp/typeck.c:1445
+#: cp/typeck.c:1457
#, gcc-internal-format
msgid "invalid application of %<__alignof%> to a bit-field"
msgstr ""
-#: cp/typeck.c:1456
+#: cp/typeck.c:1468
#, gcc-internal-format
msgid ""
"ISO C++ forbids applying %<__alignof%> to an expression of function type"
msgstr ""
-#: cp/typeck.c:1514
+#: cp/typeck.c:1526
#, gcc-internal-format
msgid "invalid use of non-static member function"
msgstr ""
-#: cp/typeck.c:1776
+#: cp/typeck.c:1793
#, gcc-internal-format
msgid "deprecated conversion from string constant to %qT"
msgstr ""
-#: cp/typeck.c:1899 cp/typeck.c:2274
+#: cp/typeck.c:1916 cp/typeck.c:2291
#, gcc-internal-format
msgid "request for member %qD in %qE, which is of non-class type %qT"
msgstr ""
-#: cp/typeck.c:1928
+#: cp/typeck.c:1945
#, gcc-internal-format
msgid "invalid use of nonstatic data member %qE"
msgstr ""
-#: cp/typeck.c:1930
-#, gcc-internal-format
-msgid "%qD is not a member of %qT"
-msgstr ""
-
-#: cp/typeck.c:1983
+#: cp/typeck.c:2000
#, gcc-internal-format
msgid "invalid access to non-static data member %qD of NULL object"
msgstr ""
-#: cp/typeck.c:1986 cp/typeck.c:2017
+#: cp/typeck.c:2003 cp/typeck.c:2034
#, gcc-internal-format
msgid "(perhaps the %<offsetof%> macro was used incorrectly)"
msgstr ""
-#: cp/typeck.c:2014
+#: cp/typeck.c:2031
#, gcc-internal-format
msgid "invalid access to non-static data member %qD of NULL object"
msgstr ""
-#: cp/typeck.c:2104
-#, gcc-internal-format
-msgid "invalid use of %qD"
-msgstr ""
-
-#: cp/typeck.c:2142
+#: cp/typeck.c:2159
#, gcc-internal-format
msgid "object type %qT does not match destructor name ~%qT"
msgstr ""
-#: cp/typeck.c:2150
+#: cp/typeck.c:2167
#, gcc-internal-format
msgid "the type being destroyed is %qT, but the destructor refers to %qT"
msgstr ""
-#: cp/typeck.c:2189 cp/typeck.c:2209
+#: cp/typeck.c:2206 cp/typeck.c:2226
#, gcc-internal-format
msgid "%qD is not a template"
msgstr ""
-#: cp/typeck.c:2313
+#: cp/typeck.c:2330
#, gcc-internal-format
msgid "%<%D::%D%> is not a member of %qT"
msgstr ""
-#: cp/typeck.c:2329
+#: cp/typeck.c:2346
#, gcc-internal-format
msgid "%qT is not a base of %qT"
msgstr ""
-#: cp/typeck.c:2349
+#: cp/typeck.c:2366
#, gcc-internal-format
msgid "%qD has no member named %qE"
msgstr ""
-#: cp/typeck.c:2365
+#: cp/typeck.c:2382
#, gcc-internal-format
msgid "%qD is not a member template function"
msgstr ""
-#: cp/typeck.c:2509
+#: cp/typeck.c:2527
#, gcc-internal-format
msgid "%qT is not a pointer-to-object type"
msgstr ""
-#: cp/typeck.c:2537
+#: cp/typeck.c:2555
#, gcc-internal-format
msgid "invalid use of %qs on pointer to member"
msgstr ""
-#: cp/typeck.c:2541
+#: cp/typeck.c:2559
#, gcc-internal-format
msgid "invalid type argument of %qs"
msgstr ""
-#: cp/typeck.c:2543
+#: cp/typeck.c:2561
#, gcc-internal-format
msgid "invalid type argument"
msgstr ""
-#: cp/typeck.c:2570
+#: cp/typeck.c:2588
#, gcc-internal-format
msgid "subscript missing in array reference"
msgstr ""
-#: cp/typeck.c:2650
+#: cp/typeck.c:2668
#, gcc-internal-format
msgid "ISO C++ forbids subscripting non-lvalue array"
msgstr ""
-#: cp/typeck.c:2662
+#: cp/typeck.c:2680
#, gcc-internal-format
msgid "subscripting array declared %<register%>"
msgstr ""
-#: cp/typeck.c:2754
+#: cp/typeck.c:2772
#, gcc-internal-format
msgid "object missing in use of %qE"
msgstr ""
-#: cp/typeck.c:2914
+#: cp/typeck.c:2954
#, gcc-internal-format
msgid "ISO C++ forbids calling %<::main%> from within program"
msgstr ""
-#: cp/typeck.c:2933
+#: cp/typeck.c:2973
#, gcc-internal-format
msgid ""
"must use %<.*%> or %<->*%> to call pointer-to-member function in %<%E (...)%"
">, e.g. %<(... ->* %E) (...)%>"
msgstr ""
-#: cp/typeck.c:2948
+#: cp/typeck.c:2988
#, gcc-internal-format
msgid "%qE cannot be used as a function"
msgstr ""
-#: cp/typeck.c:3041
+#: cp/typeck.c:3079
#, gcc-internal-format
msgid "too many arguments to %s %q+#D"
msgstr ""
-#: cp/typeck.c:3043 cp/typeck.c:3156
+#: cp/typeck.c:3081 cp/typeck.c:3194
#, gcc-internal-format
msgid "at this point in file"
msgstr ""
-#: cp/typeck.c:3046
+#: cp/typeck.c:3084
#, gcc-internal-format
msgid "too many arguments to function"
msgstr ""
-#: cp/typeck.c:3081
+#: cp/typeck.c:3119
#, gcc-internal-format
msgid "parameter %P of %qD has incomplete type %qT"
msgstr ""
-#: cp/typeck.c:3084
+#: cp/typeck.c:3122
#, gcc-internal-format
msgid "parameter %P has incomplete type %qT"
msgstr ""
-#: cp/typeck.c:3154
+#: cp/typeck.c:3192
#, gcc-internal-format
msgid "too few arguments to %s %q+#D"
msgstr ""
-#: cp/typeck.c:3159
+#: cp/typeck.c:3197
#, gcc-internal-format
msgid "too few arguments to function"
msgstr ""
-#: cp/typeck.c:3365 cp/typeck.c:3376
+#: cp/typeck.c:3402 cp/typeck.c:3413
#, gcc-internal-format
msgid "assuming cast to type %qT from overloaded function"
msgstr ""
-#: cp/typeck.c:3584
+#. Some sort of arithmetic operation involving NULL was
+#. performed.
+#: cp/typeck.c:3456
+#, gcc-internal-format
+msgid "NULL used in arithmetic"
+msgstr ""
+
+#: cp/typeck.c:3647
#, gcc-internal-format
msgid "left rotate count is negative"
msgstr ""
-#: cp/typeck.c:3585
+#: cp/typeck.c:3648
#, gcc-internal-format
msgid "right rotate count is negative"
msgstr ""
-#: cp/typeck.c:3591
+#: cp/typeck.c:3654
#, gcc-internal-format
msgid "left rotate count >= width of type"
msgstr ""
-#: cp/typeck.c:3592
+#: cp/typeck.c:3655
#, gcc-internal-format
msgid "right rotate count >= width of type"
msgstr ""
-#: cp/typeck.c:3611 cp/typeck.c:3834
+#: cp/typeck.c:3674 cp/typeck.c:3897
#, gcc-internal-format
msgid "comparison with string literal results in unspecified behaviour"
msgstr ""
-#: cp/typeck.c:3651 cp/typeck.c:3659 cp/typeck.c:3854 cp/typeck.c:3862
+#: cp/typeck.c:3714 cp/typeck.c:3722 cp/typeck.c:3917 cp/typeck.c:3925
#, gcc-internal-format
msgid "ISO C++ forbids comparison between pointer and integer"
msgstr ""
-#: cp/typeck.c:3879
+#: cp/typeck.c:3942
#, gcc-internal-format
msgid "unordered comparison on non-floating point argument"
msgstr ""
-#: cp/typeck.c:3918
+#: cp/typeck.c:3982
#, gcc-internal-format
msgid "invalid operands of types %qT and %qT to binary %qO"
msgstr ""
-#. Some sort of arithmetic operation involving NULL was
-#. performed. Note that pointer-difference and pointer-addition
-#. have already been handled above, and so we don't end up here in
-#. that case.
-#: cp/typeck.c:4008
-#, gcc-internal-format
-msgid "NULL used in arithmetic"
-msgstr ""
-
-#: cp/typeck.c:4075
+#: cp/typeck.c:4123
#, gcc-internal-format
msgid "ISO C++ forbids using pointer of type %<void *%> in subtraction"
msgstr ""
-#: cp/typeck.c:4077
+#: cp/typeck.c:4125
#, gcc-internal-format
msgid "ISO C++ forbids using pointer to a function in subtraction"
msgstr ""
-#: cp/typeck.c:4079
+#: cp/typeck.c:4127
#, gcc-internal-format
msgid "ISO C++ forbids using pointer to a method in subtraction"
msgstr ""
-#: cp/typeck.c:4092
+#: cp/typeck.c:4140
#, gcc-internal-format
msgid "invalid use of a pointer to an incomplete type in pointer arithmetic"
msgstr ""
-#: cp/typeck.c:4152
+#: cp/typeck.c:4199
+#, gcc-internal-format
+msgid "taking address of %s %qE"
+msgstr ""
+
+#: cp/typeck.c:4212
#, gcc-internal-format
msgid "invalid use of %qE to form a pointer-to-member-function"
msgstr ""
-#: cp/typeck.c:4155
+#: cp/typeck.c:4215
#, gcc-internal-format
msgid " a qualified-id is required"
msgstr ""
-#: cp/typeck.c:4160
+#: cp/typeck.c:4220
#, gcc-internal-format
msgid ""
"parentheses around %qE cannot be used to form a pointer-to-member-function"
msgstr ""
-#: cp/typeck.c:4183
+#: cp/typeck.c:4243
#, gcc-internal-format
msgid "taking address of temporary"
msgstr ""
-#: cp/typeck.c:4443
+#: cp/typeck.c:4513
#, gcc-internal-format
msgid "ISO C++ forbids incrementing an enum"
msgstr ""
-#: cp/typeck.c:4444
+#: cp/typeck.c:4514
#, gcc-internal-format
msgid "ISO C++ forbids decrementing an enum"
msgstr ""
-#: cp/typeck.c:4460
+#: cp/typeck.c:4530
#, gcc-internal-format
msgid "cannot increment a pointer to incomplete type %qT"
msgstr ""
-#: cp/typeck.c:4461
+#: cp/typeck.c:4531
#, gcc-internal-format
msgid "cannot decrement a pointer to incomplete type %qT"
msgstr ""
-#: cp/typeck.c:4472
+#: cp/typeck.c:4542
#, gcc-internal-format
msgid "ISO C++ forbids incrementing a pointer of type %qT"
msgstr ""
-#: cp/typeck.c:4473
+#: cp/typeck.c:4543
#, gcc-internal-format
msgid "ISO C++ forbids decrementing a pointer of type %qT"
msgstr ""
-#: cp/typeck.c:4499
+#: cp/typeck.c:4569
#, gcc-internal-format
msgid "invalid use of Boolean expression as operand to %<operator--%>"
msgstr ""
-#: cp/typeck.c:4534
+#: cp/typeck.c:4604
#, gcc-internal-format
msgid "ISO C++ forbids taking address of function %<::main%>"
msgstr ""
#. An expression like &memfn.
-#: cp/typeck.c:4595
+#: cp/typeck.c:4665
#, gcc-internal-format
msgid ""
"ISO C++ forbids taking the address of an unqualified or parenthesized non-"
"static member function to form a pointer to member function. Say %<&%T::%D%>"
msgstr ""
-#: cp/typeck.c:4600
+#: cp/typeck.c:4670
#, gcc-internal-format
msgid ""
"ISO C++ forbids taking the address of a bound member function to form a "
"pointer to member function. Say %<&%T::%D%>"
msgstr ""
-#: cp/typeck.c:4629
+#: cp/typeck.c:4699
#, gcc-internal-format
msgid "ISO C++ forbids taking the address of a cast to a non-lvalue expression"
msgstr ""
-#: cp/typeck.c:4657
+#: cp/typeck.c:4727
#, gcc-internal-format
msgid "cannot create pointer to reference member %qD"
msgstr ""
-#: cp/typeck.c:4872
+#: cp/typeck.c:4942
#, gcc-internal-format
msgid "cannot take the address of %<this%>, which is an rvalue expression"
msgstr ""
-#: cp/typeck.c:4895
+#: cp/typeck.c:4965
#, gcc-internal-format
msgid "address of explicit register variable %qD requested"
msgstr ""
-#: cp/typeck.c:4900
+#: cp/typeck.c:4970
#, gcc-internal-format
msgid "address requested for %qD, which is declared %<register%>"
msgstr ""
-#: cp/typeck.c:4967
+#: cp/typeck.c:5037 cp/typeck.c:5064
#, gcc-internal-format
msgid "%s expression list treated as compound expression"
msgstr ""
-#: cp/typeck.c:5039
+#: cp/typeck.c:5137
#, gcc-internal-format
msgid "no context to resolve type of %qE"
msgstr ""
-#: cp/typeck.c:5070
+#: cp/typeck.c:5168
#, gcc-internal-format
msgid "cast from type %qT to type %qT casts away qualifiers"
msgstr ""
-#: cp/typeck.c:5075
+#: cp/typeck.c:5173
#, gcc-internal-format
msgid "static_cast from type %qT to type %qT casts away qualifiers"
msgstr ""
-#: cp/typeck.c:5080
+#: cp/typeck.c:5178
#, gcc-internal-format
msgid "reinterpret_cast from type %qT to type %qT casts away qualifiers"
msgstr ""
-#: cp/typeck.c:5400
+#: cp/typeck.c:5513
#, gcc-internal-format
msgid "invalid static_cast from type %qT to type %qT"
msgstr ""
-#: cp/typeck.c:5423
+#: cp/typeck.c:5536
#, gcc-internal-format
msgid "converting from %qT to %qT"
msgstr ""
-#: cp/typeck.c:5472
+#: cp/typeck.c:5585
#, gcc-internal-format
msgid "invalid cast of an rvalue expression of type %qT to type %qT"
msgstr ""
-#: cp/typeck.c:5534
+#: cp/typeck.c:5652
#, gcc-internal-format
msgid "cast from %qT to %qT loses precision"
msgstr ""
-#: cp/typeck.c:5564
+#: cp/typeck.c:5682
#, gcc-internal-format
msgid "cast from %qT to %qT increases required alignment of target type"
msgstr ""
@@ -34947,160 +36137,172 @@ msgstr ""
#. where possible, and it is necessary in some cases. DR 195
#. addresses this issue, but as of 2004/10/26 is still in
#. drafting.
-#: cp/typeck.c:5583
+#: cp/typeck.c:5701
#, gcc-internal-format
msgid ""
"ISO C++ forbids casting between pointer-to-function and pointer-to-object"
msgstr ""
-#: cp/typeck.c:5595
+#: cp/typeck.c:5714
#, gcc-internal-format
msgid "invalid cast from type %qT to type %qT"
msgstr ""
-#: cp/typeck.c:5651
+#: cp/typeck.c:5770
#, gcc-internal-format
msgid ""
"invalid use of const_cast with type %qT, which is not a pointer, reference, "
"nor a pointer-to-data-member type"
msgstr ""
-#: cp/typeck.c:5660
+#: cp/typeck.c:5779
#, gcc-internal-format
msgid ""
"invalid use of const_cast with type %qT, which is a pointer or reference to "
"a function type"
msgstr ""
-#: cp/typeck.c:5685
+#: cp/typeck.c:5804
#, gcc-internal-format
msgid "invalid const_cast of an rvalue of type %qT to type %qT"
msgstr ""
-#: cp/typeck.c:5734
+#: cp/typeck.c:5853
#, gcc-internal-format
msgid "invalid const_cast from type %qT to type %qT"
msgstr ""
-#: cp/typeck.c:5811 cp/typeck.c:5819
+#: cp/typeck.c:5930 cp/typeck.c:5938
#, gcc-internal-format
msgid "ISO C++ forbids casting to an array type %qT"
msgstr ""
-#: cp/typeck.c:5828
+#: cp/typeck.c:5947
#, gcc-internal-format
msgid "invalid cast to function type %qT"
msgstr ""
-#: cp/typeck.c:6069
+#: cp/typeck.c:6193
#, gcc-internal-format
msgid " in evaluation of %<%Q(%#T, %#T)%>"
msgstr ""
-#: cp/typeck.c:6120
+#: cp/typeck.c:6247
#, gcc-internal-format
msgid "incompatible types in assignment of %qT to %qT"
msgstr ""
-#: cp/typeck.c:6133
+#: cp/typeck.c:6261
#, gcc-internal-format
msgid "array used as initializer"
msgstr ""
-#: cp/typeck.c:6135
+#: cp/typeck.c:6263
#, gcc-internal-format
msgid "invalid array assignment"
msgstr ""
-#: cp/typeck.c:6233
+#: cp/typeck.c:6363
#, gcc-internal-format
msgid " in pointer to member function conversion"
msgstr ""
-#: cp/typeck.c:6244
+#: cp/typeck.c:6374
#, gcc-internal-format
msgid "pointer to member conversion via virtual base %qT"
msgstr ""
-#: cp/typeck.c:6284 cp/typeck.c:6296
+#: cp/typeck.c:6414 cp/typeck.c:6427
#, gcc-internal-format
msgid " in pointer to member conversion"
msgstr ""
-#: cp/typeck.c:6374
+#: cp/typeck.c:6505
#, gcc-internal-format
msgid "invalid conversion to type %qT from type %qT"
msgstr ""
-#: cp/typeck.c:6645
+#: cp/typeck.c:6776
#, gcc-internal-format
msgid "cannot convert %qT to %qT for argument %qP to %qD"
msgstr ""
-#: cp/typeck.c:6648
+#: cp/typeck.c:6779
#, gcc-internal-format
msgid "cannot convert %qT to %qT in %s"
msgstr ""
-#: cp/typeck.c:6662
+#: cp/typeck.c:6793
#, gcc-internal-format
msgid "%s might be a candidate for a format attribute"
msgstr ""
-#: cp/typeck.c:6751 cp/typeck.c:6753
+#: cp/typeck.c:6886 cp/typeck.c:6888
#, gcc-internal-format
msgid "in passing argument %P of %q+D"
msgstr ""
-#: cp/typeck.c:6803
+#: cp/typeck.c:6943
#, gcc-internal-format
msgid "returning reference to temporary"
msgstr ""
-#: cp/typeck.c:6810
+#: cp/typeck.c:6950
#, gcc-internal-format
msgid "reference to non-lvalue returned"
msgstr ""
-#: cp/typeck.c:6826
+#: cp/typeck.c:6966
#, gcc-internal-format
msgid "reference to local variable %q+D returned"
msgstr ""
-#: cp/typeck.c:6829
+#: cp/typeck.c:6969
#, gcc-internal-format
msgid "address of local variable %q+D returned"
msgstr ""
-#: cp/typeck.c:6864
+#: cp/typeck.c:7004
#, gcc-internal-format
msgid "returning a value from a destructor"
msgstr ""
#. If a return statement appears in a handler of the
#. function-try-block of a constructor, the program is ill-formed.
-#: cp/typeck.c:6872
+#: cp/typeck.c:7012
#, gcc-internal-format
msgid "cannot return from a handler of a function-try-block of a constructor"
msgstr ""
#. You can't return a value from a constructor.
-#: cp/typeck.c:6875
+#: cp/typeck.c:7015
#, gcc-internal-format
msgid "returning a value from a constructor"
msgstr ""
-#: cp/typeck.c:6900
+#: cp/typeck.c:7033
+#, gcc-internal-format
+msgid ""
+"lambda return type can only be deduced when the return statement is the only "
+"statement in the function body"
+msgstr ""
+
+#: cp/typeck.c:7039
+#, gcc-internal-format
+msgid "inconsistent types %qT and %qT deduced for lambda return type"
+msgstr ""
+
+#: cp/typeck.c:7065
#, gcc-internal-format
msgid "return-statement with no value, in function returning %qT"
msgstr ""
-#: cp/typeck.c:6921
+#: cp/typeck.c:7086
#, gcc-internal-format
msgid "return-statement with a value, in function returning 'void'"
msgstr ""
-#: cp/typeck.c:6951
+#: cp/typeck.c:7116
#, gcc-internal-format
msgid ""
"%<operator new%> must not return NULL unless it is declared %<throw()%> (or -"
@@ -35178,184 +36380,169 @@ msgstr ""
msgid "cannot allocate an object of abstract type %qT"
msgstr ""
-#: cp/typeck2.c:315
+#: cp/typeck2.c:316
#, gcc-internal-format
-msgid "%J because the following virtual functions are pure within %qT:"
+msgid " because the following virtual functions are pure within %qT:"
msgstr ""
-#: cp/typeck2.c:319
+#: cp/typeck2.c:320
#, gcc-internal-format
msgid "\t%+#D"
msgstr ""
-#: cp/typeck2.c:326
+#: cp/typeck2.c:328
#, gcc-internal-format
-msgid "%J since type %qT has pure virtual functions"
+msgid " since type %qT has pure virtual functions"
msgstr ""
-#: cp/typeck2.c:606
+#: cp/typeck2.c:608
#, gcc-internal-format
msgid "constructor syntax used, but no constructor declared for type %qT"
msgstr ""
-#: cp/typeck2.c:620
+#: cp/typeck2.c:622
#, gcc-internal-format
msgid "cannot initialize arrays using this syntax"
msgstr ""
-#: cp/typeck2.c:706
+#: cp/typeck2.c:708
#, gcc-internal-format
msgid "narrowing conversion of %qE from %qT to %qT inside { }"
msgstr ""
-#: cp/typeck2.c:764
+#: cp/typeck2.c:766
#, gcc-internal-format
msgid "int-array initialized from non-wide string"
msgstr ""
-#: cp/typeck2.c:769
+#: cp/typeck2.c:771
#, gcc-internal-format
msgid "int-array initialized from incompatible wide string"
msgstr ""
-#: cp/typeck2.c:830
+#: cp/typeck2.c:786
+#, gcc-internal-format
+msgid "initializer-string for array of chars is too long"
+msgstr ""
+
+#: cp/typeck2.c:832
#, gcc-internal-format
msgid "cannot initialize aggregate of type %qT with a compound literal"
msgstr ""
-#: cp/typeck2.c:839
+#: cp/typeck2.c:847
#, gcc-internal-format
msgid "array must be initialized with a brace-enclosed initializer"
msgstr ""
-#: cp/typeck2.c:921 cp/typeck2.c:1029
+#: cp/typeck2.c:934 cp/typeck2.c:1042
#, gcc-internal-format
msgid "non-trivial designated initializers not supported"
msgstr ""
-#: cp/typeck2.c:1053 cp/typeck2.c:1067
+#: cp/typeck2.c:1066 cp/typeck2.c:1080
#, gcc-internal-format
msgid "missing initializer for member %qD"
msgstr ""
-#: cp/typeck2.c:1058
+#: cp/typeck2.c:1071
#, gcc-internal-format
msgid "uninitialized const member %qD"
msgstr ""
-#: cp/typeck2.c:1060
+#: cp/typeck2.c:1073
#, gcc-internal-format
msgid "member %qD with uninitialized const fields"
msgstr ""
-#: cp/typeck2.c:1062
+#: cp/typeck2.c:1075
#, gcc-internal-format
msgid "member %qD is uninitialized reference"
msgstr ""
-#: cp/typeck2.c:1130
+#: cp/typeck2.c:1143
#, gcc-internal-format
msgid "no field %qD found in union being initialized"
msgstr ""
-#: cp/typeck2.c:1139
+#: cp/typeck2.c:1152
#, gcc-internal-format
msgid "index value instead of field name in union initializer"
msgstr ""
-#: cp/typeck2.c:1298
+#: cp/typeck2.c:1311
#, gcc-internal-format
msgid "circular pointer delegation detected"
msgstr ""
-#: cp/typeck2.c:1311
+#: cp/typeck2.c:1324
#, gcc-internal-format
msgid "base operand of %<->%> has non-pointer type %qT"
msgstr ""
-#: cp/typeck2.c:1335
+#: cp/typeck2.c:1348
#, gcc-internal-format
msgid "result of %<operator->()%> yields non-pointer result"
msgstr ""
-#: cp/typeck2.c:1337
+#: cp/typeck2.c:1350
#, gcc-internal-format
msgid "base operand of %<->%> is not a pointer"
msgstr ""
-#: cp/typeck2.c:1359
+#: cp/typeck2.c:1372
#, gcc-internal-format
msgid "%qE cannot be used as a member pointer, since it is of type %qT"
msgstr ""
-#: cp/typeck2.c:1368
+#: cp/typeck2.c:1381
#, gcc-internal-format
msgid "cannot apply member pointer %qE to %qE, which is of non-class type %qT"
msgstr ""
-#: cp/typeck2.c:1390
+#: cp/typeck2.c:1403
#, gcc-internal-format
msgid "pointer to member type %qT incompatible with object type %qT"
msgstr ""
-#: cp/typeck2.c:1450
+#: cp/typeck2.c:1464
#, gcc-internal-format
msgid "invalid value-initialization of reference types"
msgstr ""
-#: cp/typeck2.c:1637
+#: cp/typeck2.c:1655
#, gcc-internal-format
msgid "call to function %qD which throws incomplete type %q#T"
msgstr ""
-#: cp/typeck2.c:1640
+#: cp/typeck2.c:1658
#, gcc-internal-format
msgid "call to function which throws incomplete type %q#T"
msgstr ""
-#: fortran/f95-lang.c:208
+#: fortran/f95-lang.c:214
#, gcc-internal-format
msgid "Unexpected type in truthvalue_conversion"
msgstr ""
-#: fortran/f95-lang.c:270
+#: fortran/f95-lang.c:273
#, gcc-internal-format
msgid "can't open input file: %s"
msgstr ""
-#: fortran/f95-lang.c:596
-#, gcc-internal-format
-msgid "global register variable %qs used in nested function"
-msgstr ""
-
-#: fortran/f95-lang.c:600
-#, gcc-internal-format
-msgid "register variable %qs used in nested function"
-msgstr ""
-
-#: fortran/f95-lang.c:607
-#, gcc-internal-format
-msgid "address of global register variable %qs requested"
-msgstr ""
-
-#: fortran/f95-lang.c:625
-#, gcc-internal-format
-msgid "address of register variable %qs requested"
-msgstr ""
-
#: fortran/options.c:238
#, gcc-internal-format
msgid "-fexcess-precision=standard for Fortran"
msgstr ""
-#: fortran/trans-array.c:5870
+#: fortran/trans-array.c:6018
#, gcc-internal-format
msgid ""
"Possible frontend bug: Deferred array size without pointer, allocatable "
"attribute or derived type without allocatable components."
msgstr ""
-#: fortran/trans-array.c:6351
+#: fortran/trans-array.c:6504
#, gcc-internal-format
msgid "bad expression type during walk (%d)"
msgstr ""
@@ -35365,107 +36552,107 @@ msgstr ""
msgid "gfc_conv_constant_to_tree(): invalid type: %s"
msgstr ""
-#: fortran/trans-decl.c:1071
+#: fortran/trans-decl.c:1160
#, gcc-internal-format
msgid "intrinsic variable which isn't a procedure"
msgstr ""
-#: fortran/trans-decl.c:3254
+#: fortran/trans-decl.c:3380
#, gcc-internal-format
msgid "backend decl for module variable %s already exists"
msgstr ""
-#: fortran/trans-expr.c:1322
+#: fortran/trans-expr.c:1340
#, gcc-internal-format
msgid "Unknown intrinsic op"
msgstr ""
-#: fortran/trans-intrinsic.c:734
+#: fortran/trans-intrinsic.c:738
#, gcc-internal-format
msgid "Intrinsic function %s(%d) not recognized"
msgstr ""
-#: fortran/trans-io.c:2101
+#: fortran/trans-io.c:2121
#, gcc-internal-format
msgid "Bad IO basetype (%d)"
msgstr ""
-#: fortran/trans-openmp.c:1632
+#: fortran/trans-openmp.c:1637
#, gcc-internal-format
msgid "gfc_trans_omp_workshare(): Bad statement code"
msgstr ""
-#: fortran/trans-types.c:378
+#: fortran/trans-types.c:465
#, gcc-internal-format
msgid "integer kind=8 not available for -fdefault-integer-8 option"
msgstr ""
-#: fortran/trans-types.c:401
+#: fortran/trans-types.c:488
#, gcc-internal-format
msgid "real kind=8 not available for -fdefault-real-8 option"
msgstr ""
-#: fortran/trans-types.c:414
+#: fortran/trans-types.c:501
#, gcc-internal-format
msgid "Use of -fdefault-double-8 requires -fdefault-real-8"
msgstr ""
-#: fortran/trans-types.c:1250
+#: fortran/trans-types.c:1345
#, gcc-internal-format
msgid "Array element size too big"
msgstr ""
-#: fortran/trans.c:1241
+#: fortran/trans.c:1277
#, gcc-internal-format
msgid "gfc_trans_code(): Bad statement code"
msgstr ""
-#: java/class.c:834
+#: java/class.c:836
#, gcc-internal-format
msgid "bad method signature"
msgstr ""
-#: java/class.c:890
+#: java/class.c:893
#, gcc-internal-format
msgid "misplaced ConstantValue attribute (not in any field)"
msgstr ""
-#: java/class.c:893
+#: java/class.c:896
#, gcc-internal-format
msgid "duplicate ConstantValue attribute for field '%s'"
msgstr ""
-#: java/class.c:904
+#: java/class.c:907
#, gcc-internal-format
msgid "ConstantValue attribute of field '%s' has wrong type"
msgstr ""
-#: java/class.c:1601
+#: java/class.c:1613
#, gcc-internal-format
-msgid "%Jabstract method in non-abstract class"
+msgid "abstract method in non-abstract class"
msgstr ""
-#: java/class.c:2669
+#: java/class.c:2689
#, gcc-internal-format
msgid "non-static method %q+D overrides static method"
msgstr ""
-#: java/decl.c:1155
+#: java/decl.c:1261
#, gcc-internal-format
msgid "%q+D used prior to declaration"
msgstr ""
-#: java/decl.c:1578
+#: java/decl.c:1687
#, gcc-internal-format
msgid "In %+D: overlapped variable and exception ranges at %d"
msgstr ""
-#: java/decl.c:1629
+#: java/decl.c:1738
#, gcc-internal-format
msgid "bad type in parameter debug info"
msgstr ""
-#: java/decl.c:1638
+#: java/decl.c:1747
#, gcc-internal-format
msgid "bad PC range for debug info for local %q+D"
msgstr ""
@@ -35525,38 +36712,38 @@ msgstr ""
msgid "invoke[non-static] on static method"
msgstr ""
-#: java/expr.c:2916
+#: java/expr.c:2918
#, gcc-internal-format
msgid "missing field '%s' in '%s'"
msgstr ""
-#: java/expr.c:2923
+#: java/expr.c:2925
#, gcc-internal-format
msgid "mismatching signature for field '%s' in '%s'"
msgstr ""
-#: java/expr.c:2952
+#: java/expr.c:2954
#, gcc-internal-format
msgid "assignment to final field %q+D not in field's class"
msgstr ""
-#: java/expr.c:3175
+#: java/expr.c:3178
#, gcc-internal-format
msgid "invalid PC in line number table"
msgstr ""
-#: java/expr.c:3225
+#: java/expr.c:3228
#, gcc-internal-format
msgid "unreachable bytecode from %d to before %d"
msgstr ""
-#: java/expr.c:3267
+#: java/expr.c:3270
#, gcc-internal-format
msgid "unreachable bytecode from %d to the end of the method"
msgstr ""
#. duplicate code from LOAD macro
-#: java/expr.c:3574
+#: java/expr.c:3577
#, gcc-internal-format
msgid "unrecogized wide sub-instruction"
msgstr ""
@@ -35619,7 +36806,7 @@ msgstr ""
#: java/jcf-parse.c:1512
#, gcc-internal-format
-msgid "%Hduplicate class will only be compiled once"
+msgid "duplicate class will only be compiled once"
msgstr ""
#: java/jcf-parse.c:1607
@@ -35627,62 +36814,62 @@ msgstr ""
msgid "missing Code attribute"
msgstr ""
-#: java/jcf-parse.c:1851
+#: java/jcf-parse.c:1853
#, gcc-internal-format
msgid "no input file specified"
msgstr ""
-#: java/jcf-parse.c:1886
+#: java/jcf-parse.c:1888
#, gcc-internal-format
msgid "can't close input file %s: %m"
msgstr ""
-#: java/jcf-parse.c:1931
+#: java/jcf-parse.c:1933
#, gcc-internal-format
msgid "bad zip/jar file %s"
msgstr ""
-#: java/jcf-parse.c:2138
+#: java/jcf-parse.c:2135
#, gcc-internal-format
msgid "error while reading %s from zip file"
msgstr ""
-#: java/jvspec.c:425
+#: java/jvspec.c:426
#, gcc-internal-format
msgid "warning: already-compiled .class files ignored with -C"
msgstr ""
-#: java/lang.c:534
+#: java/lang.c:559
#, gcc-internal-format
msgid "-fexcess-precision=standard for Java"
msgstr ""
-#: java/lang.c:545
+#: java/lang.c:570
#, gcc-internal-format
msgid "-findirect-dispatch is incompatible with -freduced-reflection"
msgstr ""
-#: java/lang.c:548
+#: java/lang.c:573
#, gcc-internal-format
msgid "-fjni is incompatible with -freduced-reflection"
msgstr ""
-#: java/lang.c:559
+#: java/lang.c:584
#, gcc-internal-format
msgid "can't do dependency tracking with input from stdin"
msgstr ""
-#: java/lang.c:575
+#: java/lang.c:600
#, gcc-internal-format
msgid "couldn't determine target name for dependency tracking"
msgstr ""
-#: java/mangle_name.c:139 java/mangle_name.c:209
+#: java/mangle_name.c:322 java/mangle_name.c:396
#, gcc-internal-format
msgid "internal error - invalid Utf8 name"
msgstr ""
-#: java/typeck.c:490
+#: java/typeck.c:427
#, gcc-internal-format
msgid "junk at end of signature string"
msgstr ""
@@ -35702,264 +36889,466 @@ msgstr ""
msgid "bad pc in exception_table"
msgstr ""
-#: objc/objc-act.c:701
+#: lto/lto-elf.c:97 lto/lto-elf.c:118
+#, gcc-internal-format
+msgid "could not read section header: %s"
+msgstr ""
+
+#: lto/lto-elf.c:215
+#, gcc-internal-format
+msgid "two or more sections for %s:"
+msgstr ""
+
+#. Initialize the section header of section SCN. SH_NAME is the section name
+#. as an index into the section header string table. SH_TYPE is the section
+#. type, an SHT_* macro from libelf headers.
+#: lto/lto-elf.c:240
+#, gcc-internal-format
+msgid "elf32_getshdr() failed: %s"
+msgstr ""
+
+#: lto/lto-elf.c:242
+#, gcc-internal-format
+msgid "elf64_getshdr() failed: %s"
+msgstr ""
+
+#: lto/lto-elf.c:276
+#, gcc-internal-format
+msgid "could not create a new ELF section: %s"
+msgstr ""
+
+#: lto/lto-elf.c:330
+#, gcc-internal-format
+msgid "could not append data to ELF section: %s"
+msgstr ""
+
+#. Validate's ELF_FILE's executable header and, if cached_file_attrs is
+#. uninitialized, caches the architecture.
+#: lto/lto-elf.c:379
+#, gcc-internal-format
+msgid "could not read ELF header: %s"
+msgstr ""
+
+#: lto/lto-elf.c:385
+#, gcc-internal-format
+msgid "not a relocatable ELF object file"
+msgstr ""
+
+#: lto/lto-elf.c:394
+#, gcc-internal-format
+msgid "inconsistent file architecture detected"
+msgstr ""
+
+#: lto/lto-elf.c:420
+#, gcc-internal-format
+msgid "could not read ELF identification information: %s"
+msgstr ""
+
+#: lto/lto-elf.c:439
+#, gcc-internal-format
+msgid "unsupported ELF file class"
+msgstr ""
+
+#: lto/lto-elf.c:472
+#, gcc-internal-format
+msgid "could not locate ELF string table: %s"
+msgstr ""
+
+#. Helper functions used by init_ehdr. Initialize ELF_FILE's executable
+#. header using cached data from previously read files.
+#: lto/lto-elf.c:496
+#, gcc-internal-format
+msgid "elf32_newehdr() failed: %s"
+msgstr ""
+
+#: lto/lto-elf.c:498
+#, gcc-internal-format
+msgid "elf64_newehdr() failed: %s"
+msgstr ""
+
+#: lto/lto-elf.c:554
+#, gcc-internal-format
+msgid "could not open file %s"
+msgstr ""
+
+#: lto/lto-elf.c:561
+#, gcc-internal-format
+msgid "ELF library is older than that used when building GCC"
+msgstr ""
+
+#: lto/lto-elf.c:570
+#, gcc-internal-format
+msgid "could not open ELF file: %s"
+msgstr ""
+
+#: lto/lto-elf.c:614
+#, gcc-internal-format
+msgid "gelf_getehdr() failed: %s"
+msgstr ""
+
+#: lto/lto-elf.c:623
+#, gcc-internal-format
+msgid "elf_getscn() failed: %s"
+msgstr ""
+
+#: lto/lto-elf.c:626
+#, gcc-internal-format
+msgid "gelf_getshdr() failed: %s"
+msgstr ""
+
+#: lto/lto-elf.c:629
+#, gcc-internal-format
+msgid "gelf_update_shdr() failed: %s"
+msgstr ""
+
+#: lto/lto-elf.c:633
+#, gcc-internal-format
+msgid "gelf_update_ehdr() failed: %s"
+msgstr ""
+
+#: lto/lto-elf.c:641
+#, gcc-internal-format
+msgid "elf_update() failed: %s"
+msgstr ""
+
+#: lto/lto-lang.c:660
+#, gcc-internal-format
+msgid "-fwpa and -fltrans are mutually exclusive"
+msgstr ""
+
+#: lto/lto.c:244
+#, gcc-internal-format
+msgid "bytecode stream: garbage at the end of symbols section"
+msgstr ""
+
+#: lto/lto.c:278
+#, gcc-internal-format
+msgid "unexpected file name %s in linker resolution file. Expected %s"
+msgstr ""
+
+#: lto/lto.c:307
+#, gcc-internal-format
+msgid "tried to read past the end of the linker resolution file"
+msgstr ""
+
+#: lto/lto.c:1002
+#, gcc-internal-format
+msgid "lto_elf_file_open() failed"
+msgstr ""
+
+#: lto/lto.c:1058
+#, gcc-internal-format
+msgid "environment variable COLLECT_GCC must be set"
+msgstr ""
+
+#: lto/lto.c:1063
+#, gcc-internal-format
+msgid "environment variable COLLECT_GCC_OPTIONS must be set"
+msgstr ""
+
+#: lto/lto.c:1072
+#, gcc-internal-format
+msgid "malformed COLLECT_GCC_OPTIONS"
+msgstr ""
+
+#: lto/lto.c:1105
+#, gcc-internal-format
+msgid "opening LTRANS output list %s: %m"
+msgstr ""
+
+#: lto/lto.c:1123 lto/lto.c:1145
+#, gcc-internal-format
+msgid "writing to LTRANS output list %s: %m"
+msgstr ""
+
+#: lto/lto.c:1157
+#, gcc-internal-format
+msgid "pex_init failed: %s"
+msgstr ""
+
+#: lto/lto.c:1165
+#, gcc-internal-format
+msgid "can't get program status: %s"
+msgstr ""
+
+#: lto/lto.c:1177
+#, gcc-internal-format
+msgid "%s terminated with status %d"
+msgstr ""
+
+#: lto/lto.c:1186
+#, gcc-internal-format
+msgid "closing LTRANS output list %s: %m"
+msgstr ""
+
+#: lto/lto.c:1699
+#, gcc-internal-format
+msgid "deleting LTRANS input file %s: %m"
+msgstr ""
+
+#: lto/lto.c:1783
+#, gcc-internal-format
+msgid "could not open symbol resolution file: %s"
+msgstr ""
+
+#: objc/objc-act.c:729
#, gcc-internal-format
msgid "%<@end%> must appear in an @implementation context"
msgstr ""
-#: objc/objc-act.c:730
+#: objc/objc-act.c:758
#, gcc-internal-format
msgid "method declaration not in @interface context"
msgstr ""
-#: objc/objc-act.c:741
+#: objc/objc-act.c:769
#, gcc-internal-format
msgid "method definition not in @implementation context"
msgstr ""
-#: objc/objc-act.c:990
+#: objc/objc-act.c:1019
#, gcc-internal-format
msgid "class %qs does not implement the %qE protocol"
msgstr ""
-#: objc/objc-act.c:993
+#: objc/objc-act.c:1022
#, gcc-internal-format
msgid "type %qs does not conform to the %qE protocol"
msgstr ""
-#: objc/objc-act.c:1170
+#: objc/objc-act.c:1199
#, gcc-internal-format
msgid "comparison of distinct Objective-C types lacks a cast"
msgstr ""
-#: objc/objc-act.c:1174
+#: objc/objc-act.c:1203
#, gcc-internal-format
msgid "initialization from distinct Objective-C type"
msgstr ""
-#: objc/objc-act.c:1178
+#: objc/objc-act.c:1207
#, gcc-internal-format
msgid "assignment from distinct Objective-C type"
msgstr ""
-#: objc/objc-act.c:1182
+#: objc/objc-act.c:1211
#, gcc-internal-format
msgid "distinct Objective-C type in return"
msgstr ""
-#: objc/objc-act.c:1186
+#: objc/objc-act.c:1215
#, gcc-internal-format
msgid "passing argument %d of %qE from distinct Objective-C type"
msgstr ""
-#: objc/objc-act.c:1342
+#: objc/objc-act.c:1371
#, gcc-internal-format
msgid "statically allocated instance of Objective-C class %qE"
msgstr ""
-#: objc/objc-act.c:1419
+#: objc/objc-act.c:1448
#, gcc-internal-format
msgid "protocol %qE has circular dependency"
msgstr ""
-#: objc/objc-act.c:1444 objc/objc-act.c:6619
+#: objc/objc-act.c:1473 objc/objc-act.c:6681
#, gcc-internal-format
msgid "cannot find protocol declaration for %qE"
msgstr ""
-#: objc/objc-act.c:1908 objc/objc-act.c:3358 objc/objc-act.c:7234
-#: objc/objc-act.c:7568 objc/objc-act.c:7623 objc/objc-act.c:7648
+#: objc/objc-act.c:1944 objc/objc-act.c:3399 objc/objc-act.c:7297
+#: objc/objc-act.c:7631 objc/objc-act.c:7686 objc/objc-act.c:7711
#, gcc-internal-format
msgid "cannot find interface declaration for %qE"
msgstr ""
-#: objc/objc-act.c:1912
+#: objc/objc-act.c:1948
#, gcc-internal-format
msgid "interface %qE does not have valid constant string layout"
msgstr ""
-#: objc/objc-act.c:1917
+#: objc/objc-act.c:1953
#, gcc-internal-format
msgid "cannot find reference tag for class %qE"
msgstr ""
-#: objc/objc-act.c:2552
+#: objc/objc-act.c:2591
#, gcc-internal-format
-msgid "%Hcreating selector for nonexistent method %qE"
+msgid "creating selector for nonexistent method %qE"
msgstr ""
-#: objc/objc-act.c:2757
+#: objc/objc-act.c:2794
#, gcc-internal-format
msgid "%qE is not an Objective-C class name or alias"
msgstr ""
-#: objc/objc-act.c:2885 objc/objc-act.c:2916 objc/objc-act.c:7496
-#: objc/objc-act.c:7798 objc/objc-act.c:7828
+#: objc/objc-act.c:2923 objc/objc-act.c:2955 objc/objc-act.c:7559
+#: objc/objc-act.c:7861 objc/objc-act.c:7891
#, gcc-internal-format
msgid "Objective-C declarations may only appear in global scope"
msgstr ""
-#: objc/objc-act.c:2890
+#: objc/objc-act.c:2928
#, gcc-internal-format
msgid "cannot find class %qE"
msgstr ""
-#: objc/objc-act.c:2892
+#: objc/objc-act.c:2930
#, gcc-internal-format
msgid "class %qE already exists"
msgstr ""
-#: objc/objc-act.c:2936 objc/objc-act.c:7537
+#: objc/objc-act.c:2975 objc/objc-act.c:7600
#, gcc-internal-format
msgid "%qE redeclared as different kind of symbol"
msgstr ""
-#: objc/objc-act.c:3212
+#: objc/objc-act.c:3253
#, gcc-internal-format
msgid "strong-cast assignment has been intercepted"
msgstr ""
-#: objc/objc-act.c:3254
+#: objc/objc-act.c:3295
#, gcc-internal-format
msgid "strong-cast may possibly be needed"
msgstr ""
-#: objc/objc-act.c:3264
+#: objc/objc-act.c:3305
#, gcc-internal-format
msgid "instance variable assignment has been intercepted"
msgstr ""
-#: objc/objc-act.c:3283
+#: objc/objc-act.c:3324
#, gcc-internal-format
msgid "pointer arithmetic for garbage-collected objects not allowed"
msgstr ""
-#: objc/objc-act.c:3289
+#: objc/objc-act.c:3330
#, gcc-internal-format
msgid "global/static variable assignment has been intercepted"
msgstr ""
-#: objc/objc-act.c:3471
+#: objc/objc-act.c:3819 objc/objc-act.c:3975
#, gcc-internal-format
msgid "use %<-fobjc-exceptions%> to enable Objective-C exception syntax"
msgstr ""
-#: objc/objc-act.c:3814
+#: objc/objc-act.c:3857
#, gcc-internal-format
msgid "@catch parameter is not a known Objective-C class type"
msgstr ""
-#: objc/objc-act.c:3830
+#: objc/objc-act.c:3873
#, gcc-internal-format
msgid "exception of type %<%T%> will be caught"
msgstr ""
-#: objc/objc-act.c:3832
+#: objc/objc-act.c:3875
#, gcc-internal-format
-msgid "%H by earlier handler for %<%T%>"
+msgid " by earlier handler for %<%T%>"
msgstr ""
-#: objc/objc-act.c:3885
+#: objc/objc-act.c:3928
#, gcc-internal-format
msgid "%<@try%> without %<@catch%> or %<@finally%>"
msgstr ""
-#: objc/objc-act.c:3936
+#: objc/objc-act.c:3986
#, gcc-internal-format
msgid "%<@throw%> (rethrow) used outside of a @catch block"
msgstr ""
-#: objc/objc-act.c:4337
+#: objc/objc-act.c:4388
#, gcc-internal-format
msgid "type %q+D does not have a known size"
msgstr ""
-#: objc/objc-act.c:4973
+#: objc/objc-act.c:5020
#, gcc-internal-format
-msgid "%J%s %qs"
+msgid "%s %qs"
msgstr ""
-#: objc/objc-act.c:4996 objc/objc-act.c:5015
+#: objc/objc-act.c:5043 objc/objc-act.c:5062
#, gcc-internal-format
msgid "inconsistent instance variable specification"
msgstr ""
-#: objc/objc-act.c:5880
+#: objc/objc-act.c:5928
#, gcc-internal-format
msgid "can not use an object as parameter to a method"
msgstr ""
-#: objc/objc-act.c:6107
+#: objc/objc-act.c:6156
#, gcc-internal-format
msgid "multiple methods named %<%c%E%> found"
msgstr ""
-#: objc/objc-act.c:6110
+#: objc/objc-act.c:6159
#, gcc-internal-format
-msgid "%Jusing %<%c%s%>"
+msgid "using %<%c%s%>"
msgstr ""
-#: objc/objc-act.c:6118
+#: objc/objc-act.c:6168
#, gcc-internal-format
msgid "multiple selectors named %<%c%E%> found"
msgstr ""
-#: objc/objc-act.c:6121
+#: objc/objc-act.c:6171
#, gcc-internal-format
-msgid "%Jfound %<%c%s%>"
+msgid "found %<%c%s%>"
msgstr ""
-#: objc/objc-act.c:6130
+#: objc/objc-act.c:6180
#, gcc-internal-format
-msgid "%Jalso found %<%c%s%>"
+msgid "also found %<%c%s%>"
msgstr ""
-#: objc/objc-act.c:6344
+#: objc/objc-act.c:6400
#, gcc-internal-format
msgid "no super class declared in @interface for %qE"
msgstr ""
-#: objc/objc-act.c:6382
+#: objc/objc-act.c:6438
#, gcc-internal-format
msgid "found %<-%E%> instead of %<+%E%> in protocol(s)"
msgstr ""
-#: objc/objc-act.c:6440
+#: objc/objc-act.c:6496
#, gcc-internal-format
msgid "invalid receiver type %qs"
msgstr ""
-#: objc/objc-act.c:6455
+#: objc/objc-act.c:6511
#, gcc-internal-format
msgid "%<%c%E%> not found in protocol(s)"
msgstr ""
-#: objc/objc-act.c:6469
+#: objc/objc-act.c:6525
#, gcc-internal-format
msgid "%qE may not respond to %<%c%E%>"
msgstr ""
-#: objc/objc-act.c:6477
+#: objc/objc-act.c:6533
#, gcc-internal-format
msgid "no %<%c%E%> method found"
msgstr ""
-#: objc/objc-act.c:6483
+#: objc/objc-act.c:6540
#, gcc-internal-format
msgid "(Messages without a matching method signature"
msgstr ""
-#: objc/objc-act.c:6484
+#: objc/objc-act.c:6542
#, gcc-internal-format
msgid "will be assumed to return %<id%> and accept"
msgstr ""
-#: objc/objc-act.c:6485
+#: objc/objc-act.c:6544
#, gcc-internal-format
msgid "%<...%> as arguments.)"
msgstr ""
-#: objc/objc-act.c:6719
+#: objc/objc-act.c:6782
#, gcc-internal-format
msgid "undeclared selector %qE"
msgstr ""
@@ -35973,185 +37362,210 @@ msgstr ""
#. to an instance variable. It's better to catch the cases
#. where this is done unknowingly than to support the above
#. paradigm.
-#: objc/objc-act.c:6761
+#: objc/objc-act.c:6824
#, gcc-internal-format
msgid "instance variable %qE accessed in class method"
msgstr ""
-#: objc/objc-act.c:6995
+#: objc/objc-act.c:7058
#, gcc-internal-format
msgid "duplicate declaration of method %<%c%E%>"
msgstr ""
-#: objc/objc-act.c:7056
+#: objc/objc-act.c:7119
#, gcc-internal-format
msgid "duplicate interface declaration for category %<%E(%E)%>"
msgstr ""
-#: objc/objc-act.c:7083
+#: objc/objc-act.c:7146
#, gcc-internal-format
msgid "illegal reference type specified for instance variable %qs"
msgstr ""
-#: objc/objc-act.c:7094
+#: objc/objc-act.c:7157
#, gcc-internal-format
msgid "instance variable %qs has unknown size"
msgstr ""
-#: objc/objc-act.c:7119
+#: objc/objc-act.c:7182
#, gcc-internal-format
msgid "type %qE has no default constructor to call"
msgstr ""
-#: objc/objc-act.c:7125
+#: objc/objc-act.c:7188
#, gcc-internal-format
msgid "destructor for %qE shall not be run either"
msgstr ""
#. Vtable pointers are Real Bad(tm), since Obj-C cannot
#. initialize them.
-#: objc/objc-act.c:7137
+#: objc/objc-act.c:7200
#, gcc-internal-format
msgid "type %qE has virtual member functions"
msgstr ""
-#: objc/objc-act.c:7138
+#: objc/objc-act.c:7201
#, gcc-internal-format
msgid "illegal aggregate type %qE specified for instance variable %qs"
msgstr ""
-#: objc/objc-act.c:7148
+#: objc/objc-act.c:7211
#, gcc-internal-format
msgid "type %qE has a user-defined constructor"
msgstr ""
-#: objc/objc-act.c:7150
+#: objc/objc-act.c:7213
#, gcc-internal-format
msgid "type %qE has a user-defined destructor"
msgstr ""
-#: objc/objc-act.c:7154
+#: objc/objc-act.c:7217
#, gcc-internal-format
msgid ""
"C++ constructors and destructors will not be invoked for Objective-C fields"
msgstr ""
-#: objc/objc-act.c:7263
+#: objc/objc-act.c:7326
#, gcc-internal-format
msgid "instance variable %qE is declared private"
msgstr ""
-#: objc/objc-act.c:7274
+#: objc/objc-act.c:7337
#, gcc-internal-format
msgid "instance variable %qE is %s; this will be a hard error in the future"
msgstr ""
-#: objc/objc-act.c:7281
+#: objc/objc-act.c:7344
#, gcc-internal-format
msgid "instance variable %qE is declared %s"
msgstr ""
-#: objc/objc-act.c:7307 objc/objc-act.c:7395
+#: objc/objc-act.c:7370 objc/objc-act.c:7458
#, gcc-internal-format
msgid "incomplete implementation of class %qE"
msgstr ""
-#: objc/objc-act.c:7311 objc/objc-act.c:7399
+#: objc/objc-act.c:7374 objc/objc-act.c:7462
#, gcc-internal-format
msgid "incomplete implementation of category %qE"
msgstr ""
-#: objc/objc-act.c:7316 objc/objc-act.c:7403
+#: objc/objc-act.c:7379 objc/objc-act.c:7466
#, gcc-internal-format
msgid "method definition for %<%c%E%> not found"
msgstr ""
-#: objc/objc-act.c:7444
+#: objc/objc-act.c:7507
#, gcc-internal-format
msgid "%s %qE does not fully implement the %qE protocol"
msgstr ""
-#: objc/objc-act.c:7502 objc/objc-act.c:9189
+#: objc/objc-act.c:7565 objc/objc-act.c:9256
#, gcc-internal-format
msgid "%<@end%> missing in implementation context"
msgstr ""
-#: objc/objc-act.c:7521
+#: objc/objc-act.c:7584
#, gcc-internal-format
msgid "cannot find interface declaration for %qE, superclass of %qE"
msgstr ""
-#: objc/objc-act.c:7551
+#: objc/objc-act.c:7614
#, gcc-internal-format
msgid "reimplementation of class %qE"
msgstr ""
-#: objc/objc-act.c:7581
+#: objc/objc-act.c:7644
#, gcc-internal-format
msgid "conflicting super class name %qE"
msgstr ""
-#: objc/objc-act.c:7584
+#: objc/objc-act.c:7647
#, gcc-internal-format
msgid "previous declaration of %qE"
msgstr ""
-#: objc/objc-act.c:7586
+#: objc/objc-act.c:7649
#, gcc-internal-format
msgid "previous declaration"
msgstr ""
-#: objc/objc-act.c:7602 objc/objc-act.c:7600
+#: objc/objc-act.c:7665 objc/objc-act.c:7663
#, gcc-internal-format
msgid "duplicate interface declaration for class %qE"
msgstr ""
-#: objc/objc-act.c:7856
+#: objc/objc-act.c:7919
#, gcc-internal-format
msgid "duplicate declaration for protocol %qE"
msgstr ""
-#: objc/objc-act.c:8684
+#: objc/objc-act.c:8740
#, gcc-internal-format
-msgid "%Jconflicting types for %<%c%s%>"
+msgid "conflicting types for %<%c%s%>"
msgstr ""
-#: objc/objc-act.c:8687
+#: objc/objc-act.c:8744
#, gcc-internal-format
-msgid "%Jprevious declaration of %<%c%s%>"
+msgid "previous declaration of %<%c%s%>"
msgstr ""
-#: objc/objc-act.c:8773
+#: objc/objc-act.c:8834
#, gcc-internal-format
msgid "no super class declared in interface for %qE"
msgstr ""
-#: objc/objc-act.c:8826
+#: objc/objc-act.c:8893
#, gcc-internal-format
msgid "[super ...] must appear in a method context"
msgstr ""
-#: objc/objc-act.c:8865
+#: objc/objc-act.c:8932
#, gcc-internal-format
msgid "method possibly missing a [super dealloc] call"
msgstr ""
-#: objc/objc-act.c:9479
+#: objc/objc-act.c:9549
#, gcc-internal-format
msgid "local declaration of %qE hides instance variable"
msgstr ""
-#: ada/gcc-interface/misc.c:195
+#: ada/gcc-interface/misc.c:196
#, gcc-internal-format
msgid "missing argument to \"-%s\""
msgstr ""
-#: ada/gcc-interface/misc.c:253
+#: ada/gcc-interface/misc.c:254
#, gcc-internal-format
msgid "%<-gnat%> misspelled as %<-gant%>"
msgstr ""
-#: ada/gcc-interface/misc.c:311
+#: ada/gcc-interface/misc.c:312
#, gcc-internal-format
msgid "-fexcess-precision=standard for Ada"
msgstr ""
+
+#: ada/gcc-interface/utils.c:5275
+#, gcc-internal-format
+msgid "%qs attribute requires prototypes with named arguments"
+msgstr ""
+
+#: ada/gcc-interface/utils.c:5287
+#, gcc-internal-format
+msgid "%qs attribute only applies to variadic functions"
+msgstr ""
+
+#: ada/gcc-interface/utils.c:5450
+#, gcc-internal-format
+msgid "invalid vector type for attribute %qs"
+msgstr ""
+
+#: ada/gcc-interface/utils.c:5513
+#, gcc-internal-format
+msgid "attribute %qs applies to array types only"
+msgstr ""
+
+#: ada/gcc-interface/utils.c:5540
+#, gcc-internal-format
+msgid "invalid element type for attribute %qs"
+msgstr ""
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index a75442eb6c7..bc2854d9179 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -318,6 +318,13 @@ print_rtx (const_rtx in_rtx)
dump_addr (outfile, "/", (void*)val);
#endif
}
+ else if (i == 0 && GET_CODE (in_rtx) == DEBUG_EXPR)
+ {
+#ifndef GENERATOR_FILE
+ fprintf (outfile, " D#%i",
+ DEBUG_TEMP_UID (DEBUG_EXPR_TREE_DECL (in_rtx)));
+#endif
+ }
break;
case 'e':
@@ -378,6 +385,22 @@ print_rtx (const_rtx in_rtx)
fprintf(outfile, " %s:%i", insn_file (in_rtx), insn_line (in_rtx));
#endif
}
+ else if (i == 6 && GET_CODE (in_rtx) == ASM_OPERANDS)
+ {
+#ifndef GENERATOR_FILE
+ fprintf (outfile, " %s:%i",
+ locator_file (ASM_OPERANDS_SOURCE_LOCATION (in_rtx)),
+ locator_line (ASM_OPERANDS_SOURCE_LOCATION (in_rtx)));
+#endif
+ }
+ else if (i == 1 && GET_CODE (in_rtx) == ASM_INPUT)
+ {
+#ifndef GENERATOR_FILE
+ fprintf (outfile, " %s:%i",
+ locator_file (ASM_INPUT_SOURCE_LOCATION (in_rtx)),
+ locator_line (ASM_INPUT_SOURCE_LOCATION (in_rtx)));
+#endif
+ }
else if (i == 6 && NOTE_P (in_rtx))
{
/* This field is only used for NOTE_INSN_DELETED_LABEL, and
@@ -539,6 +562,9 @@ print_rtx (const_rtx in_rtx)
if (MEM_ALIGN (in_rtx) != 1)
fprintf (outfile, " A%u", MEM_ALIGN (in_rtx));
+ if (!ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (in_rtx)))
+ fprintf (outfile, " AS%u", MEM_ADDR_SPACE (in_rtx));
+
fputc (']', outfile);
break;
diff --git a/gcc/print-tree.c b/gcc/print-tree.c
index f4b74d95ffc..f0a3294263a 100644
--- a/gcc/print-tree.c
+++ b/gcc/print-tree.c
@@ -111,6 +111,8 @@ print_node_brief (FILE *file, const char *prefix, const_tree node, int indent)
fprintf (file, " %s",
IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (node))));
}
+ if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node)))
+ fprintf (file, " address-space-%d", TYPE_ADDR_SPACE (node));
}
if (TREE_CODE (node) == IDENTIFIER_NODE)
fprintf (file, " %s", IDENTIFIER_POINTER (node));
@@ -300,6 +302,9 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
else if (TYPE_P (node) && TYPE_SIZES_GIMPLIFIED (node))
fputs (" sizes-gimplified", file);
+ if (TYPE_P (node) && !ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node)))
+ fprintf (file, " address-space-%d", TYPE_ADDR_SPACE (node));
+
if (TREE_ADDRESSABLE (node))
fputs (" addressable", file);
if (TREE_THIS_VOLATILE (node))
@@ -541,7 +546,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
&& DECL_STRUCT_FUNCTION (node) != 0)
{
indent_to (file, indent + 4);
- dump_addr (file, "saved-insns ", DECL_STRUCT_FUNCTION (node));
+ dump_addr (file, "struct-function ", DECL_STRUCT_FUNCTION (node));
}
if ((code == VAR_DECL || code == PARM_DECL)
diff --git a/gcc/real.c b/gcc/real.c
index eb4e25bba83..98e7d7875eb 100644
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -57,7 +57,7 @@
Both of these requirements are easily satisfied. The largest target
significand is 113 bits; we store at least 160. The smallest
- denormal number fits in 17 exponent bits; we store 27.
+ denormal number fits in 17 exponent bits; we store 26.
Note that the decimal string conversion routines are sensitive to
rounding errors. Since the raw arithmetic routines do not themselves
diff --git a/gcc/real.h b/gcc/real.h
index e72723e01ea..e1fd3b07f60 100644
--- a/gcc/real.h
+++ b/gcc/real.h
@@ -32,6 +32,9 @@ extern tree do_mpc_arg2 (tree, tree, tree, int, int (*)(mpc_ptr, mpc_srcptr, mpc
# if MPC_VERSION >= MPC_VERSION_NUM(0,6,1)
# define HAVE_mpc_pow
# endif
+# if MPC_VERSION >= MPC_VERSION_NUM(0,7,1)
+# define HAVE_mpc_arc
+# endif
#endif
#endif
#include "machmode.h"
diff --git a/gcc/recog.c b/gcc/recog.c
index 6874d6c5c60..4ad3be9dfaf 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -376,7 +376,9 @@ verify_changes (int num)
if (MEM_P (object))
{
- if (! memory_address_p (GET_MODE (object), XEXP (object, 0)))
+ if (! memory_address_addr_space_p (GET_MODE (object),
+ XEXP (object, 0),
+ MEM_ADDR_SPACE (object)))
break;
}
else if (REG_P (changes[i].old)
@@ -978,7 +980,7 @@ general_operand (rtx op, enum machine_mode mode)
return 0;
/* Use the mem's mode, since it will be reloaded thus. */
- if (memory_address_p (GET_MODE (op), y))
+ if (memory_address_addr_space_p (GET_MODE (op), y, MEM_ADDR_SPACE (op)))
return 1;
}
@@ -1262,19 +1264,22 @@ pop_operand (rtx op, enum machine_mode mode)
return XEXP (op, 0) == stack_pointer_rtx;
}
-/* Return 1 if ADDR is a valid memory address for mode MODE. */
+/* Return 1 if ADDR is a valid memory address
+ for mode MODE in address space AS. */
int
-memory_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, rtx addr)
+memory_address_addr_space_p (enum machine_mode mode ATTRIBUTE_UNUSED,
+ rtx addr, addr_space_t as)
{
#ifdef GO_IF_LEGITIMATE_ADDRESS
+ gcc_assert (ADDR_SPACE_GENERIC_P (as));
GO_IF_LEGITIMATE_ADDRESS (mode, addr, win);
return 0;
win:
return 1;
#else
- return targetm.legitimate_address_p (mode, addr, 0);
+ return targetm.addr_space.legitimate_address_p (mode, addr, 0, as);
#endif
}
@@ -1871,7 +1876,8 @@ int
offsettable_memref_p (rtx op)
{
return ((MEM_P (op))
- && offsettable_address_p (1, GET_MODE (op), XEXP (op, 0)));
+ && offsettable_address_addr_space_p (1, GET_MODE (op), XEXP (op, 0),
+ MEM_ADDR_SPACE (op)));
}
/* Similar, but don't require a strictly valid mem ref:
@@ -1881,12 +1887,13 @@ int
offsettable_nonstrict_memref_p (rtx op)
{
return ((MEM_P (op))
- && offsettable_address_p (0, GET_MODE (op), XEXP (op, 0)));
+ && offsettable_address_addr_space_p (0, GET_MODE (op), XEXP (op, 0),
+ MEM_ADDR_SPACE (op)));
}
/* Return 1 if Y is a memory address which contains no side effects
- and would remain valid after the addition of a positive integer
- less than the size of that mode.
+ and would remain valid for address space AS after the addition of
+ a positive integer less than the size of that mode.
We assume that the original address is valid and do not check it.
We do check that it is valid for narrower modes.
@@ -1895,14 +1902,16 @@ offsettable_nonstrict_memref_p (rtx op)
for the sake of use in reload.c. */
int
-offsettable_address_p (int strictp, enum machine_mode mode, rtx y)
+offsettable_address_addr_space_p (int strictp, enum machine_mode mode, rtx y,
+ addr_space_t as)
{
enum rtx_code ycode = GET_CODE (y);
rtx z;
rtx y1 = y;
rtx *y2;
- int (*addressp) (enum machine_mode, rtx) =
- (strictp ? strict_memory_address_p : memory_address_p);
+ int (*addressp) (enum machine_mode, rtx, addr_space_t) =
+ (strictp ? strict_memory_address_addr_space_p
+ : memory_address_addr_space_p);
unsigned int mode_sz = GET_MODE_SIZE (mode);
if (CONSTANT_ADDRESS_P (y))
@@ -1932,7 +1941,7 @@ offsettable_address_p (int strictp, enum machine_mode mode, rtx y)
*y2 = plus_constant (*y2, mode_sz - 1);
/* Use QImode because an odd displacement may be automatically invalid
for any wider mode. But it should be valid for a single byte. */
- good = (*addressp) (QImode, y);
+ good = (*addressp) (QImode, y, as);
/* In any case, restore old contents of memory. */
*y2 = y1;
@@ -1957,7 +1966,7 @@ offsettable_address_p (int strictp, enum machine_mode mode, rtx y)
/* Use QImode because an odd displacement may be automatically invalid
for any wider mode. But it should be valid for a single byte. */
- return (*addressp) (QImode, z);
+ return (*addressp) (QImode, z, as);
}
/* Return 1 if ADDR is an address-expression whose effect depends
@@ -2502,11 +2511,14 @@ constrain_operands (int strict)
if (MEM_P (op))
{
if (strict > 0
- && !strict_memory_address_p (GET_MODE (op),
- XEXP (op, 0)))
+ && !strict_memory_address_addr_space_p
+ (GET_MODE (op), XEXP (op, 0),
+ MEM_ADDR_SPACE (op)))
break;
if (strict == 0
- && !memory_address_p (GET_MODE (op), XEXP (op, 0)))
+ && !memory_address_addr_space_p
+ (GET_MODE (op), XEXP (op, 0),
+ MEM_ADDR_SPACE (op)))
break;
win = 1;
}
@@ -3267,40 +3279,44 @@ peephole2_optimize (void)
do_cleanup_cfg |= purge_dead_edges (bb);
}
-#ifdef HAVE_conditional_execution
- for (i = 0; i < MAX_INSNS_PER_PEEP2 + 1; ++i)
- peep2_insn_data[i].insn = NULL_RTX;
- peep2_insn_data[peep2_current].insn = PEEP2_EOB;
- peep2_current_count = 0;
-#else
- /* Back up lifetime information past the end of the
- newly created sequence. */
- if (++i >= MAX_INSNS_PER_PEEP2 + 1)
- i = 0;
- bitmap_copy (live, peep2_insn_data[i].live_before);
-
- /* Update life information for the new sequence. */
- x = attempt;
- do
+ if (targetm.have_conditional_execution ())
{
- if (INSN_P (x))
+ for (i = 0; i < MAX_INSNS_PER_PEEP2 + 1; ++i)
+ peep2_insn_data[i].insn = NULL_RTX;
+ peep2_insn_data[peep2_current].insn = PEEP2_EOB;
+ peep2_current_count = 0;
+ }
+ else
+ {
+ /* Back up lifetime information past the end of the
+ newly created sequence. */
+ if (++i >= MAX_INSNS_PER_PEEP2 + 1)
+ i = 0;
+ bitmap_copy (live, peep2_insn_data[i].live_before);
+
+ /* Update life information for the new sequence. */
+ x = attempt;
+ do
{
- if (--i < 0)
- i = MAX_INSNS_PER_PEEP2;
- if (peep2_current_count < MAX_INSNS_PER_PEEP2
- && peep2_insn_data[i].insn == NULL_RTX)
- peep2_current_count++;
- peep2_insn_data[i].insn = x;
- df_insn_rescan (x);
- df_simulate_one_insn_backwards (bb, x, live);
- bitmap_copy (peep2_insn_data[i].live_before, live);
+ if (INSN_P (x))
+ {
+ if (--i < 0)
+ i = MAX_INSNS_PER_PEEP2;
+ if (peep2_current_count < MAX_INSNS_PER_PEEP2
+ && peep2_insn_data[i].insn == NULL_RTX)
+ peep2_current_count++;
+ peep2_insn_data[i].insn = x;
+ df_insn_rescan (x);
+ df_simulate_one_insn_backwards (bb, x, live);
+ bitmap_copy (peep2_insn_data[i].live_before,
+ live);
+ }
+ x = PREV_INSN (x);
}
- x = PREV_INSN (x);
- }
- while (x != prev);
+ while (x != prev);
- peep2_current = i;
-#endif
+ peep2_current = i;
+ }
/* If we generated a jump instruction, it won't have
JUMP_LABEL set. Recompute after we're done. */
diff --git a/gcc/recog.h b/gcc/recog.h
index 4dce8d9a5ee..3354a66496a 100644
--- a/gcc/recog.h
+++ b/gcc/recog.h
@@ -84,8 +84,13 @@ extern int num_validated_changes (void);
extern void cancel_changes (int);
extern int constrain_operands (int);
extern int constrain_operands_cached (int);
-extern int memory_address_p (enum machine_mode, rtx);
-extern int strict_memory_address_p (enum machine_mode, rtx);
+extern int memory_address_addr_space_p (enum machine_mode, rtx, addr_space_t);
+#define memory_address_p(mode,addr) \
+ memory_address_addr_space_p ((mode), (addr), ADDR_SPACE_GENERIC)
+extern int strict_memory_address_addr_space_p (enum machine_mode, rtx,
+ addr_space_t);
+#define strict_memory_address_p(mode,addr) \
+ strict_memory_address_addr_space_p ((mode), (addr), ADDR_SPACE_GENERIC)
extern int validate_replace_rtx_subexp (rtx, rtx, rtx, rtx *);
extern int validate_replace_rtx (rtx, rtx, rtx);
extern int validate_replace_rtx_part (rtx, rtx, rtx *, rtx);
@@ -101,7 +106,11 @@ extern int reg_fits_class_p (rtx, enum reg_class, int, enum machine_mode);
extern int offsettable_memref_p (rtx);
extern int offsettable_nonstrict_memref_p (rtx);
-extern int offsettable_address_p (int, enum machine_mode, rtx);
+extern int offsettable_address_addr_space_p (int, enum machine_mode, rtx,
+ addr_space_t);
+#define offsettable_address_p(strict,mode,addr) \
+ offsettable_address_addr_space_p ((strict), (mode), (addr), \
+ ADDR_SPACE_GENERIC)
extern int mode_dependent_address_p (rtx);
extern int recog (rtx, rtx, int *);
diff --git a/gcc/regcprop.c b/gcc/regcprop.c
index 893751886eb..ac8350d1f4e 100644
--- a/gcc/regcprop.c
+++ b/gcc/regcprop.c
@@ -247,7 +247,7 @@ kill_autoinc_value (rtx *px, void *data)
{
x = XEXP (x, 0);
kill_value (x, vd);
- set_value_regno (REGNO (x), Pmode, vd);
+ set_value_regno (REGNO (x), GET_MODE (x), vd);
return -1;
}
diff --git a/gcc/reginfo.c b/gcc/reginfo.c
index 0f11c91a3de..96e9bd9437a 100644
--- a/gcc/reginfo.c
+++ b/gcc/reginfo.c
@@ -904,6 +904,9 @@ struct reg_pref
run. */
static struct reg_pref *reg_pref;
+/* Current size of reg_info. */
+static int reg_info_size;
+
/* Return the reg_class in which pseudo reg number REGNO is best allocated.
This function is sometimes called before the info has been computed.
When that happens, just return GENERAL_REGS, which is innocuous. */
@@ -937,9 +940,6 @@ reg_cover_class (int regno)
-/* Current size of reg_info. */
-static int reg_info_size;
-
/* Allocate space for reg info. */
static void
allocate_reg_info (void)
@@ -1040,6 +1040,7 @@ setup_reg_classes (int regno,
{
if (reg_pref == NULL)
return;
+ gcc_assert (reg_info_size == max_reg_num ());
reg_pref[regno].prefclass = prefclass;
reg_pref[regno].altclass = altclass;
reg_pref[regno].coverclass = coverclass;
@@ -1321,7 +1322,7 @@ find_subregs_of_mode (rtx x)
}
}
-static unsigned int
+void
init_subregs_of_mode (void)
{
basic_block bb;
@@ -1336,8 +1337,6 @@ init_subregs_of_mode (void)
FOR_BB_INSNS (bb, insn)
if (INSN_P (insn))
find_subregs_of_mode (PATTERN (insn));
-
- return 0;
}
/* Return 1 if REGNO has had an invalid mode change in CLASS from FROM
@@ -1367,74 +1366,22 @@ invalid_mode_change_p (unsigned int regno,
return false;
}
-static unsigned int
+void
finish_subregs_of_mode (void)
{
htab_delete (subregs_of_mode);
subregs_of_mode = 0;
- return 0;
}
#else
-static unsigned int
+void
init_subregs_of_mode (void)
{
- return 0;
}
-static unsigned int
+void
finish_subregs_of_mode (void)
{
- return 0;
}
#endif /* CANNOT_CHANGE_MODE_CLASS */
-static bool
-gate_subregs_of_mode_init (void)
-{
-#ifdef CANNOT_CHANGE_MODE_CLASS
- return true;
-#else
- return false;
-#endif
-}
-
-struct rtl_opt_pass pass_subregs_of_mode_init =
-{
- {
- RTL_PASS,
- "subregs_of_mode_init", /* name */
- gate_subregs_of_mode_init, /* gate */
- init_subregs_of_mode, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
-};
-
-struct rtl_opt_pass pass_subregs_of_mode_finish =
-{
- {
- RTL_PASS,
- "subregs_of_mode_finish", /* name */
- gate_subregs_of_mode_init, /* gate */
- finish_subregs_of_mode, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
-};
-
-
#include "gt-reginfo.h"
diff --git a/gcc/regmove.c b/gcc/regmove.c
index ab1a4696d36..581af4c7edc 100644
--- a/gcc/regmove.c
+++ b/gcc/regmove.c
@@ -44,6 +44,7 @@ along with GCC; see the file COPYING3. If not see
#include "timevar.h"
#include "tree-pass.h"
#include "df.h"
+#include "ira.h"
static int optimize_reg_copy_1 (rtx, rtx, rtx);
static void optimize_reg_copy_2 (rtx, rtx, rtx);
@@ -184,7 +185,9 @@ try_auto_increment (rtx insn, rtx inc_insn, rtx inc_insn_set, rtx reg,
&SET_SRC (inc_insn_set),
XEXP (SET_SRC (inc_insn_set), 0), 1);
validate_change (insn, &XEXP (use, 0),
- gen_rtx_fmt_e (inc_code, Pmode, reg), 1);
+ gen_rtx_fmt_e (inc_code,
+ GET_MODE (XEXP (use, 0)), reg),
+ 1);
if (apply_change_group ())
{
/* If there is a REG_DEAD note on this insn, we must
@@ -1117,23 +1120,28 @@ regmove_backward_pass (void)
break;
}
- /* We can't make this change if SRC is read or
+ /* We can't make this change if DST is mentioned at
+ all in P, since we are going to change its value.
+ We can't make this change if SRC is read or
partially written in P, since we are going to
- eliminate SRC. We can't make this change
- if DST is mentioned at all in P,
- since we are going to change its value. */
- if (reg_overlap_mentioned_p (src, PATTERN (p)))
+ eliminate SRC. However, if it's a debug insn, we
+ can't refrain from making the change, for this
+ would cause codegen differences, so instead we
+ invalidate debug expressions that reference DST,
+ and adjust references to SRC in them so that they
+ become references to DST. */
+ if (reg_mentioned_p (dst, PATTERN (p)))
{
if (DEBUG_INSN_P (p))
- validate_replace_rtx_group (dst, src, insn);
+ validate_change (p, &INSN_VAR_LOCATION_LOC (p),
+ gen_rtx_UNKNOWN_VAR_LOC (), 1);
else
break;
}
- if (reg_mentioned_p (dst, PATTERN (p)))
+ if (reg_overlap_mentioned_p (src, PATTERN (p)))
{
if (DEBUG_INSN_P (p))
- validate_change (p, &INSN_VAR_LOCATION_LOC (p),
- gen_rtx_UNKNOWN_VAR_LOC (), 1);
+ validate_replace_rtx_group (src, dst, p);
else
break;
}
@@ -1221,6 +1229,9 @@ regmove_optimize (void)
df_note_add_problem ();
df_analyze ();
+ if (flag_ira_loop_pressure)
+ ira_set_pseudo_classes (dump_file);
+
regstat_init_n_sets_and_refs ();
regstat_compute_ri ();
@@ -1243,6 +1254,8 @@ regmove_optimize (void)
}
regstat_free_n_sets_and_refs ();
regstat_free_ri ();
+ if (flag_ira_loop_pressure)
+ free_reg_info ();
return 0;
}
diff --git a/gcc/reload.c b/gcc/reload.c
index 1435945d62c..3333697f2e0 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -268,7 +268,8 @@ static bool alternative_allows_const_pool_ref (rtx, const char *, int);
static rtx find_reloads_toplev (rtx, int, enum reload_type, int, int, rtx,
int *);
static rtx make_memloc (rtx, int);
-static int maybe_memory_address_p (enum machine_mode, rtx, rtx *);
+static int maybe_memory_address_addr_space_p (enum machine_mode, rtx,
+ addr_space_t, rtx *);
static int find_reloads_address (enum machine_mode, rtx *, rtx, rtx *,
int, enum reload_type, int, rtx);
static rtx subst_reg_equivs (rtx, rtx);
@@ -612,7 +613,8 @@ get_secondary_mem (rtx x ATTRIBUTE_UNUSED, enum machine_mode mode,
didn't give us a new MEM, make a new one if it isn't valid. */
loc = eliminate_regs (secondary_memlocs[(int) mode], VOIDmode, NULL_RTX);
- mem_valid = strict_memory_address_p (mode, XEXP (loc, 0));
+ mem_valid = strict_memory_address_addr_space_p (mode, XEXP (loc, 0),
+ MEM_ADDR_SPACE (loc));
if (! mem_valid && loc == secondary_memlocs[(int) mode])
loc = copy_rtx (loc);
@@ -2129,21 +2131,23 @@ hard_reg_set_here_p (unsigned int beg_regno, unsigned int end_regno, rtx x)
return 0;
}
-/* Return 1 if ADDR is a valid memory address for mode MODE,
- and check that each pseudo reg has the proper kind of
- hard reg. */
+/* Return 1 if ADDR is a valid memory address for mode MODE
+ in address space AS, and check that each pseudo reg has the
+ proper kind of hard reg. */
int
-strict_memory_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, rtx addr)
+strict_memory_address_addr_space_p (enum machine_mode mode ATTRIBUTE_UNUSED,
+ rtx addr, addr_space_t as)
{
#ifdef GO_IF_LEGITIMATE_ADDRESS
+ gcc_assert (ADDR_SPACE_GENERIC_P (as));
GO_IF_LEGITIMATE_ADDRESS (mode, addr, win);
return 0;
win:
return 1;
#else
- return targetm.legitimate_address_p (mode, addr, 1);
+ return targetm.addr_space.legitimate_address_p (mode, addr, 1, as);
#endif
}
@@ -2247,6 +2251,10 @@ operands_match_p (rtx x, rtx y)
if (GET_MODE (x) != GET_MODE (y))
return 0;
+ /* MEMs refering to different address space are not equivalent. */
+ if (code == MEM && MEM_ADDR_SPACE (x) != MEM_ADDR_SPACE (y))
+ return 0;
+
switch (code)
{
case CONST_INT:
@@ -3979,12 +3987,15 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
&& MEM_P (recog_data.operand[i]))
{
/* If the address to be reloaded is a VOIDmode constant,
- use Pmode as mode of the reload register, as would have
- been done by find_reloads_address. */
+ use the default address mode as mode of the reload register,
+ as would have been done by find_reloads_address. */
enum machine_mode address_mode;
address_mode = GET_MODE (XEXP (recog_data.operand[i], 0));
if (address_mode == VOIDmode)
- address_mode = Pmode;
+ {
+ addr_space_t as = MEM_ADDR_SPACE (recog_data.operand[i]);
+ address_mode = targetm.addr_space.address_mode (as);
+ }
operand_reloadnum[i]
= push_reload (XEXP (recog_data.operand[i], 0), NULL_RTX,
@@ -4760,8 +4771,9 @@ find_reloads_toplev (rtx x, int opnum, enum reload_type type,
#endif
&& (reg_equiv_address[regno] != 0
|| (reg_equiv_mem[regno] != 0
- && (! strict_memory_address_p (GET_MODE (x),
- XEXP (reg_equiv_mem[regno], 0))
+ && (! strict_memory_address_addr_space_p
+ (GET_MODE (x), XEXP (reg_equiv_mem[regno], 0),
+ MEM_ADDR_SPACE (reg_equiv_mem[regno]))
|| ! offsettable_memref_p (reg_equiv_mem[regno])
|| num_not_at_initial_offset))))
x = find_reloads_subreg_address (x, 1, opnum, type, ind_levels,
@@ -4819,18 +4831,19 @@ make_memloc (rtx ad, int regno)
}
/* Returns true if AD could be turned into a valid memory reference
- to mode MODE by reloading the part pointed to by PART into a
- register. */
+ to mode MODE in address space AS by reloading the part pointed to
+ by PART into a register. */
static int
-maybe_memory_address_p (enum machine_mode mode, rtx ad, rtx *part)
+maybe_memory_address_addr_space_p (enum machine_mode mode, rtx ad,
+ addr_space_t as, rtx *part)
{
int retv;
rtx tem = *part;
rtx reg = gen_rtx_REG (GET_MODE (tem), max_reg_num ());
*part = reg;
- retv = memory_address_p (mode, ad);
+ retv = memory_address_addr_space_p (mode, ad, as);
*part = tem;
return retv;
@@ -4866,6 +4879,8 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad,
rtx *loc, int opnum, enum reload_type type,
int ind_levels, rtx insn)
{
+ addr_space_t as = memrefloc? MEM_ADDR_SPACE (*memrefloc)
+ : ADDR_SPACE_GENERIC;
int regno;
int removed_and = 0;
int op_index;
@@ -4893,7 +4908,9 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad,
if (reg_equiv_address[regno] != 0 || num_not_at_initial_offset)
{
tem = make_memloc (ad, regno);
- if (! strict_memory_address_p (GET_MODE (tem), XEXP (tem, 0)))
+ if (! strict_memory_address_addr_space_p (GET_MODE (tem),
+ XEXP (tem, 0),
+ MEM_ADDR_SPACE (tem)))
{
rtx orig = tem;
@@ -4909,7 +4926,7 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad,
address: only reg or reg+constant. */
if (ind_levels > 0
- && strict_memory_address_p (mode, tem)
+ && strict_memory_address_addr_space_p (mode, tem, as)
&& (REG_P (XEXP (tem, 0))
|| (GET_CODE (XEXP (tem, 0)) == PLUS
&& REG_P (XEXP (XEXP (tem, 0), 0))
@@ -4953,7 +4970,7 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad,
return 1;
}
- if (strict_memory_address_p (mode, ad))
+ if (strict_memory_address_addr_space_p (mode, ad, as))
{
/* The address appears valid, so reloads are not needed.
But the address may contain an eliminable register.
@@ -4976,14 +4993,14 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad,
return 0;
/* Check result for validity after substitution. */
- if (strict_memory_address_p (mode, ad))
+ if (strict_memory_address_addr_space_p (mode, ad, as))
return 0;
}
#ifdef LEGITIMIZE_RELOAD_ADDRESS
do
{
- if (memrefloc)
+ if (memrefloc && ADDR_SPACE_GENERIC_P (as))
{
LEGITIMIZE_RELOAD_ADDRESS (ad, GET_MODE (*memrefloc), opnum, type,
ind_levels, win);
@@ -5099,7 +5116,7 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad,
That will at least work. */
find_reloads_address_part (ad, loc,
base_reg_class (mode, MEM, SCRATCH),
- Pmode, opnum, type, ind_levels);
+ GET_MODE (ad), opnum, type, ind_levels);
}
return ! removed_and;
}
@@ -5160,8 +5177,8 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad,
|| operand == arg_pointer_rtx
#endif
|| operand == stack_pointer_rtx)
- && ! maybe_memory_address_p (mode, ad,
- &XEXP (XEXP (ad, 0), 1 - op_index)))
+ && ! maybe_memory_address_addr_space_p
+ (mode, ad, as, &XEXP (XEXP (ad, 0), 1 - op_index)))
{
rtx offset_reg;
enum reg_class cls;
@@ -5199,7 +5216,7 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad,
tem = ad;
if (GET_CODE (ad) == PLUS)
tem = subst_indexed_address (ad);
- if (tem != ad && strict_memory_address_p (mode, tem))
+ if (tem != ad && strict_memory_address_addr_space_p (mode, tem, as))
{
/* Ok, we win that way. Replace any additional eliminable
registers. */
@@ -5209,7 +5226,8 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad,
/* Make sure that didn't make the address invalid again. */
- if (! subst_reg_equivs_changed || strict_memory_address_p (mode, tem))
+ if (! subst_reg_equivs_changed
+ || strict_memory_address_addr_space_p (mode, tem, as))
{
*loc = tem;
return 0;
@@ -5218,8 +5236,12 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad,
/* If constants aren't valid addresses, reload the constant address
into a register. */
- if (CONSTANT_P (ad) && ! strict_memory_address_p (mode, ad))
+ if (CONSTANT_P (ad) && ! strict_memory_address_addr_space_p (mode, ad, as))
{
+ enum machine_mode address_mode = GET_MODE (ad);
+ if (ad == VOIDmode)
+ address_mode = targetm.addr_space.address_mode (as);
+
/* If AD is an address in the constant pool, the MEM rtx may be shared.
Unshare it so we can safely alter it. */
if (memrefloc && GET_CODE (ad) == SYMBOL_REF
@@ -5232,7 +5254,7 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad,
}
find_reloads_address_part (ad, loc, base_reg_class (mode, MEM, SCRATCH),
- Pmode, opnum, type, ind_levels);
+ address_mode, opnum, type, ind_levels);
return ! removed_and;
}
@@ -5319,16 +5341,12 @@ subst_reg_equivs (rtx ad, rtx insn)
This routine assumes both inputs are already in canonical form. */
rtx
-form_sum (rtx x, rtx y)
+form_sum (enum machine_mode mode, rtx x, rtx y)
{
rtx tem;
- enum machine_mode mode = GET_MODE (x);
-
- if (mode == VOIDmode)
- mode = GET_MODE (y);
- if (mode == VOIDmode)
- mode = Pmode;
+ gcc_assert (GET_MODE (x) == mode || GET_MODE (x) == VOIDmode);
+ gcc_assert (GET_MODE (y) == mode || GET_MODE (y) == VOIDmode);
if (CONST_INT_P (x))
return plus_constant (y, INTVAL (x));
@@ -5338,12 +5356,12 @@ form_sum (rtx x, rtx y)
tem = x, x = y, y = tem;
if (GET_CODE (x) == PLUS && CONSTANT_P (XEXP (x, 1)))
- return form_sum (XEXP (x, 0), form_sum (XEXP (x, 1), y));
+ return form_sum (mode, XEXP (x, 0), form_sum (mode, XEXP (x, 1), y));
/* Note that if the operands of Y are specified in the opposite
order in the recursive calls below, infinite recursion will occur. */
if (GET_CODE (y) == PLUS && CONSTANT_P (XEXP (y, 1)))
- return form_sum (form_sum (x, XEXP (y, 0)), XEXP (y, 1));
+ return form_sum (mode, form_sum (mode, x, XEXP (y, 0)), XEXP (y, 1));
/* If both constant, encapsulate sum. Otherwise, just form sum. A
constant will have been placed second. */
@@ -5410,9 +5428,9 @@ subst_indexed_address (rtx addr)
/* Compute the sum. */
if (op2 != 0)
- op1 = form_sum (op1, op2);
+ op1 = form_sum (GET_MODE (addr), op1, op2);
if (op1 != 0)
- op0 = form_sum (op0, op1);
+ op0 = form_sum (GET_MODE (addr), op0, op1);
return op0;
}
@@ -5812,7 +5830,8 @@ find_reloads_address_1 (enum machine_mode mode, rtx x, int context,
rtx equiv = (MEM_P (XEXP (x, 0))
? XEXP (x, 0)
: reg_equiv_mem[regno]);
- int icode = (int) optab_handler (add_optab, Pmode)->insn_code;
+ int icode
+ = (int) optab_handler (add_optab, GET_MODE (x))->insn_code;
if (insn && NONJUMP_INSN_P (insn) && equiv
&& memory_operand (equiv, GET_MODE (equiv))
#ifdef HAVE_cc0
@@ -5820,9 +5839,9 @@ find_reloads_address_1 (enum machine_mode mode, rtx x, int context,
#endif
&& ! (icode != CODE_FOR_nothing
&& ((*insn_data[icode].operand[0].predicate)
- (equiv, Pmode))
+ (equiv, GET_MODE (x)))
&& ((*insn_data[icode].operand[1].predicate)
- (equiv, Pmode))))
+ (equiv, GET_MODE (x)))))
{
/* We use the original pseudo for loc, so that
emit_reload_insns() knows which pseudo this
@@ -6180,8 +6199,9 @@ find_reloads_subreg_address (rtx x, int force_replace, int opnum,
the address, there is nothing further to do. */
if (reloaded == 0
&& reg_equiv_mem[regno] != 0
- && !strict_memory_address_p (GET_MODE (x),
- XEXP (reg_equiv_mem[regno], 0)))
+ && !strict_memory_address_addr_space_p
+ (GET_MODE (x), XEXP (reg_equiv_mem[regno], 0),
+ MEM_ADDR_SPACE (reg_equiv_mem[regno])))
push_reload (XEXP (tem, 0), NULL_RTX, &XEXP (tem, 0), (rtx*) 0,
base_reg_class (GET_MODE (tem), MEM, SCRATCH),
GET_MODE (XEXP (tem, 0)), VOIDmode, 0, 0,
diff --git a/gcc/reload.h b/gcc/reload.h
index 3789680f7ca..5d8375b9589 100644
--- a/gcc/reload.h
+++ b/gcc/reload.h
@@ -289,7 +289,7 @@ extern int find_reloads (rtx, int, int, int, short *);
address, namely: sum constant integers, surround the sum of two
constants with a CONST, put the constant as the second operand, and
group the constant on the outermost sum. */
-extern rtx form_sum (rtx, rtx);
+extern rtx form_sum (enum machine_mode, rtx, rtx);
/* Substitute into the current INSN the registers into which we have reloaded
the things that need reloading. */
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 5581cd66083..ce049220608 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -1000,8 +1000,9 @@ reload (rtx first, int global)
rtx x = eliminate_regs (reg_equiv_memory_loc[i], VOIDmode,
NULL_RTX);
- if (strict_memory_address_p (GET_MODE (regno_reg_rtx[i]),
- XEXP (x, 0)))
+ if (strict_memory_address_addr_space_p
+ (GET_MODE (regno_reg_rtx[i]), XEXP (x, 0),
+ MEM_ADDR_SPACE (x)))
reg_equiv_mem[i] = x, reg_equiv_address[i] = 0;
else if (CONSTANT_P (XEXP (x, 0))
|| (REG_P (XEXP (x, 0))
@@ -1257,36 +1258,25 @@ reload (rtx first, int global)
for (use = DF_REG_USE_CHAIN (i); use; use = next)
{
- rtx *loc = DF_REF_LOC (use);
- rtx x = *loc;
-
insn = DF_REF_INSN (use);
+
+ /* Make sure the next ref is for a different instruction,
+ so that we're not affected by the rescan. */
next = DF_REF_NEXT_REG (use);
+ while (next && DF_REF_INSN (next) == insn)
+ next = DF_REF_NEXT_REG (next);
if (DEBUG_INSN_P (insn))
{
- gcc_assert (x == reg
- || (GET_CODE (x) == SUBREG
- && SUBREG_REG (x) == reg));
-
if (!equiv)
{
INSN_VAR_LOCATION_LOC (insn) = gen_rtx_UNKNOWN_VAR_LOC ();
df_insn_rescan_debug_internal (insn);
}
else
- {
- if (x == reg)
- *loc = copy_rtx (equiv);
- else if (GET_CODE (x) == SUBREG
- && SUBREG_REG (x) == reg)
- *loc = simplify_gen_subreg (GET_MODE (x), equiv,
- GET_MODE (reg),
- SUBREG_BYTE (x));
- else
- gcc_unreachable ();
- *loc = wrap_constant (GET_MODE (x), *loc);
- }
+ INSN_VAR_LOCATION_LOC (insn)
+ = simplify_replace_rtx (INSN_VAR_LOCATION_LOC (insn),
+ reg, equiv);
}
}
}
@@ -2668,7 +2658,7 @@ eliminate_regs_1 (rtx x, enum machine_mode mem_mode, rtx insn,
&& reg_equiv_constant[REGNO (new0)] != 0)
new0 = reg_equiv_constant[REGNO (new0)];
- new_rtx = form_sum (new0, new1);
+ new_rtx = form_sum (GET_MODE (x), new0, new1);
/* As above, if we are not inside a MEM we do not want to
turn a PLUS into something else. We might try to do so here
diff --git a/gcc/rtl.c b/gcc/rtl.c
index feeb40bf61b..58867aec7cc 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -164,6 +164,20 @@ rtvec_alloc (int n)
return rt;
}
+/* Create a bitwise copy of VEC. */
+
+rtvec
+shallow_copy_rtvec (rtvec vec)
+{
+ rtvec newvec;
+ int n;
+
+ n = GET_NUM_ELEM (vec);
+ newvec = rtvec_alloc (n);
+ memcpy (&newvec->elem[0], &vec->elem[0], sizeof (rtx) * n);
+ return newvec;
+}
+
/* Return the number of bytes occupied by rtx value X. */
unsigned int
@@ -232,6 +246,8 @@ copy_rtx (rtx orig)
switch (code)
{
case REG:
+ case DEBUG_EXPR:
+ case VALUE:
case CONST_INT:
case CONST_DOUBLE:
case CONST_FIXED:
@@ -369,6 +385,10 @@ rtx_equal_p_cb (const_rtx x, const_rtx y, rtx_equal_p_callback_function cb)
if (GET_MODE (x) != GET_MODE (y))
return 0;
+ /* MEMs refering to different address space are not equivalent. */
+ if (code == MEM && MEM_ADDR_SPACE (x) != MEM_ADDR_SPACE (y))
+ return 0;
+
/* Some RTL can be compared nonrecursively. */
switch (code)
{
@@ -381,6 +401,7 @@ rtx_equal_p_cb (const_rtx x, const_rtx y, rtx_equal_p_callback_function cb)
case SYMBOL_REF:
return XSTR (x, 0) == XSTR (y, 0);
+ case DEBUG_EXPR:
case VALUE:
case SCRATCH:
case CONST_DOUBLE:
@@ -484,6 +505,10 @@ rtx_equal_p (const_rtx x, const_rtx y)
if (GET_MODE (x) != GET_MODE (y))
return 0;
+ /* MEMs refering to different address space are not equivalent. */
+ if (code == MEM && MEM_ADDR_SPACE (x) != MEM_ADDR_SPACE (y))
+ return 0;
+
/* Some RTL can be compared nonrecursively. */
switch (code)
{
@@ -496,6 +521,7 @@ rtx_equal_p (const_rtx x, const_rtx y)
case SYMBOL_REF:
return XSTR (x, 0) == XSTR (y, 0);
+ case DEBUG_EXPR:
case VALUE:
case SCRATCH:
case CONST_DOUBLE:
diff --git a/gcc/rtl.def b/gcc/rtl.def
index 2aa76b1f6c8..acb7ee915b8 100644
--- a/gcc/rtl.def
+++ b/gcc/rtl.def
@@ -88,6 +88,10 @@ DEF_RTL_EXPR(UNKNOWN, "UnKnown", "*", RTX_EXTRA)
DECL codes in trees. */
DEF_RTL_EXPR(VALUE, "value", "0", RTX_OBJ)
+/* The RTL generated for a DEBUG_EXPR_DECL. It links back to the
+ DEBUG_EXPR_DECL in the first operand. */
+DEF_RTL_EXPR(DEBUG_EXPR, "debug_expr", "0", RTX_OBJ)
+
/* ---------------------------------------------------------------------
Expressions used in constructing lists.
--------------------------------------------------------------------- */
diff --git a/gcc/rtl.h b/gcc/rtl.h
index d415ba483f3..7cf3a7fe2e0 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -146,6 +146,7 @@ typedef struct GTY(()) mem_attrs
rtx size; /* Size in bytes, as a CONST_INT. */
alias_set_type alias; /* Memory alias set. */
unsigned int align; /* Alignment of MEM in bits. */
+ unsigned char addrspace; /* Address space (0 for generic). */
} mem_attrs;
/* Structure used to describe the attributes of a REG in similar way as
@@ -762,7 +763,7 @@ extern void rtl_check_failed_flag (const char *, const_rtx, const char *,
#define INSN_LOCATOR(INSN) XINT (INSN, 4)
/* LOCATION of an RTX if relevant. */
#define RTL_LOCATION(X) (INSN_P (X) ? \
- locator_location (INSN_LOCATOR (x)) \
+ locator_location (INSN_LOCATOR (X)) \
: UNKNOWN_LOCATION)
/* LOCATION of current INSN. */
#define CURR_INSN_LOCATION (locator_location (curr_insn_locator ()))
@@ -930,6 +931,9 @@ extern const char * const reg_note_name[];
#define NOTE_DURING_CALL_P(RTX) \
(RTL_FLAG_CHECK1("NOTE_VAR_LOCATION_DURING_CALL_P", (RTX), NOTE)->call)
+/* DEBUG_EXPR_DECL corresponding to a DEBUG_EXPR RTX. */
+#define DEBUG_EXPR_TREE_DECL(RTX) XCTREE (RTX, 0, DEBUG_EXPR)
+
/* Possible initialization status of a variable. When requested
by the user, this information is tracked and recorded in the DWARF
debug information, along with the variable's location. */
@@ -1119,7 +1123,7 @@ rhs_regno (const_rtx x)
extern void init_rtlanal (void);
extern int rtx_cost (rtx, enum rtx_code, bool);
-extern int address_cost (rtx, enum machine_mode, bool);
+extern int address_cost (rtx, enum machine_mode, addr_space_t, bool);
extern unsigned int subreg_lsb (const_rtx);
extern unsigned int subreg_lsb_1 (enum machine_mode, enum machine_mode,
unsigned int);
@@ -1266,6 +1270,10 @@ do { \
RTX that is always a CONST_INT. */
#define MEM_OFFSET(RTX) (MEM_ATTRS (RTX) == 0 ? 0 : MEM_ATTRS (RTX)->offset)
+/* For a MEM rtx, the address space. */
+#define MEM_ADDR_SPACE(RTX) (MEM_ATTRS (RTX) == 0 ? ADDR_SPACE_GENERIC \
+ : MEM_ATTRS (RTX)->addrspace)
+
/* For a MEM rtx, the size in bytes of the MEM, if known, as an RTX that
is always a CONST_INT. */
#define MEM_SIZE(RTX) \
@@ -1565,6 +1573,7 @@ extern rtx rtx_alloc_stat (RTX_CODE MEM_STAT_DECL);
#define rtx_alloc(c) rtx_alloc_stat (c MEM_STAT_INFO)
extern rtvec rtvec_alloc (int);
+extern rtvec shallow_copy_rtvec (rtvec);
extern bool shared_const_p (const_rtx);
extern rtx copy_rtx (rtx);
extern void dump_rtx_statistics (void);
@@ -1604,7 +1613,10 @@ extern unsigned int subreg_highpart_offset (enum machine_mode,
enum machine_mode);
extern int byte_lowpart_offset (enum machine_mode, enum machine_mode);
extern rtx make_safe_from (rtx, rtx);
-extern rtx convert_memory_address (enum machine_mode, rtx);
+extern rtx convert_memory_address_addr_space (enum machine_mode, rtx,
+ addr_space_t);
+#define convert_memory_address(to_mode,x) \
+ convert_memory_address_addr_space ((to_mode), (x), ADDR_SPACE_GENERIC)
extern rtx get_insns (void);
extern const char *get_insn_name (int);
extern rtx get_last_insn (void);
@@ -1765,6 +1777,8 @@ extern rtx simplify_subreg (enum machine_mode, rtx, enum machine_mode,
unsigned int);
extern rtx simplify_gen_subreg (enum machine_mode, rtx, enum machine_mode,
unsigned int);
+extern rtx simplify_replace_fn_rtx (rtx, const_rtx,
+ rtx (*fn) (rtx, void *), void *);
extern rtx simplify_replace_rtx (rtx, const_rtx, rtx);
extern rtx simplify_rtx (const_rtx);
extern rtx avoid_constant_pool_reference (rtx);
@@ -1927,6 +1941,8 @@ extern void init_move_cost (enum machine_mode);
extern bool resize_reg_info (void);
/* Free up register info memory. */
extern void free_reg_info (void);
+extern void init_subregs_of_mode (void);
+extern void finish_subregs_of_mode (void);
/* recog.c */
extern rtx extract_asm_operands (rtx);
@@ -2404,8 +2420,6 @@ extern void invert_br_probabilities (rtx);
extern bool expensive_function_p (int);
/* In cfgexpand.c */
extern void add_reg_br_prob_note (rtx last, int probability);
-extern rtx wrap_constant (enum machine_mode, rtx);
-extern rtx unwrap_constant (rtx);
/* In var-tracking.c */
extern unsigned int variable_tracking_main (void);
@@ -2424,6 +2438,7 @@ extern void simplify_using_condition (rtx, rtx *, struct bitmap_head_def *);
/* In final.c */
extern unsigned int compute_alignments (void);
+extern int asm_str_count (const char *templ);
struct rtl_hooks
{
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 7a734eb66e5..ab88f23a379 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -2252,6 +2252,11 @@ may_trap_p_1 (const_rtx x, unsigned flags)
/* Memory ref can trap unless it's a static var or a stack slot. */
case MEM:
+ /* Recognize specific pattern of stack checking probes. */
+ if (flag_stack_check
+ && MEM_VOLATILE_P (x)
+ && XEXP (x, 0) == stack_pointer_rtx)
+ return 1;
if (/* MEM_NOTRAP_P only relates to the actual position of the memory
reference; moving it out of context such as when moving code
when optimizing, might cause its address to become invalid. */
@@ -3603,13 +3608,13 @@ rtx_cost (rtx x, enum rtx_code outer_code ATTRIBUTE_UNUSED, bool speed)
be returned. */
int
-address_cost (rtx x, enum machine_mode mode, bool speed)
+address_cost (rtx x, enum machine_mode mode, addr_space_t as, bool speed)
{
/* We may be asked for cost of various unusual addresses, such as operands
of push instruction. It is not worthwhile to complicate writing
of the target hook by such cases. */
- if (!memory_address_p (mode, x))
+ if (!memory_address_addr_space_p (mode, x, as))
return 1000;
return targetm.address_cost (x, speed);
@@ -3748,7 +3753,11 @@ nonzero_bits1 (const_rtx x, enum machine_mode mode, const_rtx known_x,
#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
/* If pointers extend unsigned and this is a pointer in Pmode, say that
all the bits above ptr_mode are known to be zero. */
- if (POINTERS_EXTEND_UNSIGNED && GET_MODE (x) == Pmode
+ /* As we do not know which address space the pointer is refering to,
+ we can do this only if the target does not support different pointer
+ or address modes depending on the address space. */
+ if (target_default_pointer_address_modes_p ()
+ && POINTERS_EXTEND_UNSIGNED && GET_MODE (x) == Pmode
&& REG_POINTER (x))
nonzero &= GET_MODE_MASK (ptr_mode);
#endif
@@ -3985,7 +3994,11 @@ nonzero_bits1 (const_rtx x, enum machine_mode mode, const_rtx known_x,
/* If pointers extend unsigned and this is an addition or subtraction
to a pointer in Pmode, all the bits above ptr_mode are known to be
zero. */
- if (POINTERS_EXTEND_UNSIGNED > 0 && GET_MODE (x) == Pmode
+ /* As we do not know which address space the pointer is refering to,
+ we can do this only if the target does not support different pointer
+ or address modes depending on the address space. */
+ if (target_default_pointer_address_modes_p ()
+ && POINTERS_EXTEND_UNSIGNED > 0 && GET_MODE (x) == Pmode
&& (code == PLUS || code == MINUS)
&& REG_P (XEXP (x, 0)) && REG_POINTER (XEXP (x, 0)))
nonzero &= GET_MODE_MASK (ptr_mode);
@@ -4259,8 +4272,12 @@ num_sign_bit_copies1 (const_rtx x, enum machine_mode mode, const_rtx known_x,
#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
/* If pointers extend signed and this is a pointer in Pmode, say that
all the bits above ptr_mode are known to be sign bit copies. */
- if (! POINTERS_EXTEND_UNSIGNED && GET_MODE (x) == Pmode && mode == Pmode
- && REG_POINTER (x))
+ /* As we do not know which address space the pointer is refering to,
+ we can do this only if the target does not support different pointer
+ or address modes depending on the address space. */
+ if (target_default_pointer_address_modes_p ()
+ && ! POINTERS_EXTEND_UNSIGNED && GET_MODE (x) == Pmode
+ && mode == Pmode && REG_POINTER (x))
return GET_MODE_BITSIZE (Pmode) - GET_MODE_BITSIZE (ptr_mode) + 1;
#endif
@@ -4456,7 +4473,11 @@ num_sign_bit_copies1 (const_rtx x, enum machine_mode mode, const_rtx known_x,
/* If pointers extend signed and this is an addition or subtraction
to a pointer in Pmode, all the bits above ptr_mode are known to be
sign bit copies. */
- if (! POINTERS_EXTEND_UNSIGNED && GET_MODE (x) == Pmode
+ /* As we do not know which address space the pointer is refering to,
+ we can do this only if the target does not support different pointer
+ or address modes depending on the address space. */
+ if (target_default_pointer_address_modes_p ()
+ && ! POINTERS_EXTEND_UNSIGNED && GET_MODE (x) == Pmode
&& (code == PLUS || code == MINUS)
&& REG_P (XEXP (x, 0)) && REG_POINTER (XEXP (x, 0)))
result = MAX ((int) (GET_MODE_BITSIZE (Pmode)
@@ -4501,8 +4522,16 @@ num_sign_bit_copies1 (const_rtx x, enum machine_mode mode, const_rtx known_x,
known_x, known_mode, known_ret);
case UMOD:
- /* The result must be <= the second operand. */
- return cached_num_sign_bit_copies (XEXP (x, 1), mode,
+ /* The result must be <= the second operand. If the second operand
+ has (or just might have) the high bit set, we know nothing about
+ the number of sign bit copies. */
+ if (bitwidth > HOST_BITS_PER_WIDE_INT)
+ return 1;
+ else if ((nonzero_bits (XEXP (x, 1), mode)
+ & ((HOST_WIDE_INT) 1 << (bitwidth - 1))) != 0)
+ return 1;
+ else
+ return cached_num_sign_bit_copies (XEXP (x, 1), mode,
known_x, known_mode, known_ret);
case DIV:
diff --git a/gcc/rtlhooks.c b/gcc/rtlhooks.c
index 4cf757d829d..a64c0674dc8 100644
--- a/gcc/rtlhooks.c
+++ b/gcc/rtlhooks.c
@@ -153,7 +153,8 @@ gen_lowpart_if_possible (enum machine_mode mode, rtx x)
- MIN (UNITS_PER_WORD, GET_MODE_SIZE (GET_MODE (x))));
new_rtx = adjust_address_nv (x, mode, offset);
- if (! memory_address_p (mode, XEXP (new_rtx, 0)))
+ if (! memory_address_addr_space_p (mode, XEXP (new_rtx, 0),
+ MEM_ADDR_SPACE (x)))
return 0;
return new_rtx;
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index cef383a1d0e..1f1a76c1090 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -42,6 +42,7 @@ along with GCC; see the file COPYING3. If not see
#include "params.h"
#include "cselib.h"
#include "ira.h"
+#include "target.h"
#ifdef INSN_SCHEDULING
@@ -211,6 +212,16 @@ sd_debug_dep (dep_t dep)
fprintf (stderr, "\n");
}
+/* Determine whether DEP is a dependency link of a non-debug insn on a
+ debug insn. */
+
+static inline bool
+depl_on_debug_p (dep_link_t dep)
+{
+ return (DEBUG_INSN_P (DEP_LINK_PRO (dep))
+ && !DEBUG_INSN_P (DEP_LINK_CON (dep)));
+}
+
/* Functions to operate with a single link from the dependencies lists -
dep_link_t. */
@@ -246,7 +257,9 @@ add_to_deps_list (dep_link_t link, deps_list_t l)
{
attach_dep_link (link, &DEPS_LIST_FIRST (l));
- ++DEPS_LIST_N_LINKS (l);
+ /* Don't count debug deps. */
+ if (!depl_on_debug_p (link))
+ ++DEPS_LIST_N_LINKS (l);
}
/* Detach dep_link L from the list. */
@@ -271,7 +284,9 @@ remove_from_deps_list (dep_link_t link, deps_list_t list)
{
detach_dep_link (link);
- --DEPS_LIST_N_LINKS (list);
+ /* Don't count debug deps. */
+ if (!depl_on_debug_p (link))
+ --DEPS_LIST_N_LINKS (list);
}
/* Move link LINK from list FROM to list TO. */
@@ -668,10 +683,21 @@ sd_lists_size (const_rtx insn, sd_list_types_def list_types)
}
/* Return true if INSN's lists defined by LIST_TYPES are all empty. */
+
bool
sd_lists_empty_p (const_rtx insn, sd_list_types_def list_types)
{
- return sd_lists_size (insn, list_types) == 0;
+ while (list_types != SD_LIST_NONE)
+ {
+ deps_list_t list;
+ bool resolved_p;
+
+ sd_next_list (insn, &list_types, &list, &resolved_p);
+ if (!deps_list_empty_p (list))
+ return false;
+ }
+
+ return true;
}
/* Initialize data for INSN. */
@@ -1201,7 +1227,6 @@ sd_add_dep (dep_t dep, bool resolved_p)
rtx insn = DEP_CON (dep);
gcc_assert (INSN_P (insn) && INSN_P (elem) && insn != elem);
- gcc_assert (!DEBUG_INSN_P (elem) || DEBUG_INSN_P (insn));
if ((current_sched_info->flags & DO_SPECULATION)
&& !sched_insn_is_legitimate_for_speculation_p (insn, DEP_STATUS (dep)))
@@ -1528,7 +1553,8 @@ add_insn_mem_dependence (struct deps *deps, bool read_p,
{
insn_list = &deps->pending_read_insns;
mem_list = &deps->pending_read_mems;
- deps->pending_read_list_length++;
+ if (!DEBUG_INSN_P (insn))
+ deps->pending_read_list_length++;
}
else
{
@@ -2256,8 +2282,11 @@ sched_analyze_1 (struct deps *deps, rtx x, rtx insn)
if (sched_deps_info->use_cselib)
{
+ enum machine_mode address_mode
+ = targetm.addr_space.address_mode (MEM_ADDR_SPACE (dest));
+
t = shallow_copy_rtx (dest);
- cselib_lookup (XEXP (t, 0), Pmode, 1);
+ cselib_lookup (XEXP (t, 0), address_mode, 1);
XEXP (t, 0) = cselib_subst_to_values (XEXP (t, 0));
}
t = canon_rtx (t);
@@ -2408,63 +2437,66 @@ sched_analyze_2 (struct deps *deps, rtx x, rtx insn)
rtx pending, pending_mem;
rtx t = x;
- if (DEBUG_INSN_P (insn))
- {
- sched_analyze_2 (deps, XEXP (x, 0), insn);
- return;
- }
-
if (sched_deps_info->use_cselib)
{
+ enum machine_mode address_mode
+ = targetm.addr_space.address_mode (MEM_ADDR_SPACE (t));
+
t = shallow_copy_rtx (t);
- cselib_lookup (XEXP (t, 0), Pmode, 1);
+ cselib_lookup (XEXP (t, 0), address_mode, 1);
XEXP (t, 0) = cselib_subst_to_values (XEXP (t, 0));
}
- t = canon_rtx (t);
- pending = deps->pending_read_insns;
- pending_mem = deps->pending_read_mems;
- while (pending)
- {
- if (read_dependence (XEXP (pending_mem, 0), t)
- && ! sched_insns_conditions_mutex_p (insn, XEXP (pending, 0)))
- note_mem_dep (t, XEXP (pending_mem, 0), XEXP (pending, 0),
- DEP_ANTI);
- pending = XEXP (pending, 1);
- pending_mem = XEXP (pending_mem, 1);
- }
-
- pending = deps->pending_write_insns;
- pending_mem = deps->pending_write_mems;
- while (pending)
+ if (!DEBUG_INSN_P (insn))
{
- if (true_dependence (XEXP (pending_mem, 0), VOIDmode,
- t, rtx_varies_p)
- && ! sched_insns_conditions_mutex_p (insn, XEXP (pending, 0)))
- note_mem_dep (t, XEXP (pending_mem, 0), XEXP (pending, 0),
- sched_deps_info->generate_spec_deps
- ? BEGIN_DATA | DEP_TRUE : DEP_TRUE);
-
- pending = XEXP (pending, 1);
- pending_mem = XEXP (pending_mem, 1);
- }
+ t = canon_rtx (t);
+ pending = deps->pending_read_insns;
+ pending_mem = deps->pending_read_mems;
+ while (pending)
+ {
+ if (read_dependence (XEXP (pending_mem, 0), t)
+ && ! sched_insns_conditions_mutex_p (insn,
+ XEXP (pending, 0)))
+ note_mem_dep (t, XEXP (pending_mem, 0), XEXP (pending, 0),
+ DEP_ANTI);
+
+ pending = XEXP (pending, 1);
+ pending_mem = XEXP (pending_mem, 1);
+ }
- for (u = deps->last_pending_memory_flush; u; u = XEXP (u, 1))
- {
- if (! JUMP_P (XEXP (u, 0)))
- add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
- else if (deps_may_trap_p (x))
+ pending = deps->pending_write_insns;
+ pending_mem = deps->pending_write_mems;
+ while (pending)
{
- if ((sched_deps_info->generate_spec_deps)
- && sel_sched_p () && (spec_info->mask & BEGIN_CONTROL))
- {
- ds_t ds = set_dep_weak (DEP_ANTI, BEGIN_CONTROL,
- MAX_DEP_WEAK);
+ if (true_dependence (XEXP (pending_mem, 0), VOIDmode,
+ t, rtx_varies_p)
+ && ! sched_insns_conditions_mutex_p (insn,
+ XEXP (pending, 0)))
+ note_mem_dep (t, XEXP (pending_mem, 0), XEXP (pending, 0),
+ sched_deps_info->generate_spec_deps
+ ? BEGIN_DATA | DEP_TRUE : DEP_TRUE);
+
+ pending = XEXP (pending, 1);
+ pending_mem = XEXP (pending_mem, 1);
+ }
- note_dep (XEXP (u, 0), ds);
- }
- else
+ for (u = deps->last_pending_memory_flush; u; u = XEXP (u, 1))
+ {
+ if (! JUMP_P (XEXP (u, 0)))
add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
+ else if (deps_may_trap_p (x))
+ {
+ if ((sched_deps_info->generate_spec_deps)
+ && sel_sched_p () && (spec_info->mask & BEGIN_CONTROL))
+ {
+ ds_t ds = set_dep_weak (DEP_ANTI, BEGIN_CONTROL,
+ MAX_DEP_WEAK);
+
+ note_dep (XEXP (u, 0), ds);
+ }
+ else
+ add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
+ }
}
}
@@ -2473,7 +2505,6 @@ sched_analyze_2 (struct deps *deps, rtx x, rtx insn)
if (!deps->readonly)
add_insn_mem_dependence (deps, true, insn, x);
- /* Take advantage of tail recursion here. */
sched_analyze_2 (deps, XEXP (x, 0), insn);
if (cslr_p && sched_deps_info->finish_rhs)
@@ -2773,6 +2804,9 @@ sched_analyze_insn (struct deps *deps, rtx x, rtx insn)
struct deps_reg *reg_last = &deps->reg_last[i];
add_dependence_list (insn, reg_last->sets, 1, REG_DEP_ANTI);
add_dependence_list (insn, reg_last->clobbers, 1, REG_DEP_ANTI);
+
+ if (!deps->readonly)
+ reg_last->uses = alloc_INSN_LIST (insn, reg_last->uses);
}
CLEAR_REG_SET (reg_pending_uses);
@@ -3505,7 +3539,8 @@ remove_from_deps (struct deps *deps, rtx insn)
removed = remove_from_both_dependence_lists (insn, &deps->pending_read_insns,
&deps->pending_read_mems);
- deps->pending_read_list_length -= removed;
+ if (!DEBUG_INSN_P (insn))
+ deps->pending_read_list_length -= removed;
removed = remove_from_both_dependence_lists (insn, &deps->pending_write_insns,
&deps->pending_write_mems);
deps->pending_write_list_length -= removed;
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index de2dd0acd1d..0acdc4a2a47 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -2508,7 +2508,9 @@ add_branch_dependences (rtx head, rtx tail)
add_dependence (last, insn, REG_DEP_ANTI);
}
-#ifdef HAVE_conditional_execution
+ if (!targetm.have_conditional_execution ())
+ return;
+
/* Finally, if the block ends in a jump, and we are doing intra-block
scheduling, make sure that the branch depends on any COND_EXEC insns
inside the block to avoid moving the COND_EXECs past the branch insn.
@@ -2557,7 +2559,6 @@ add_branch_dependences (rtx head, rtx tail)
if (INSN_P (insn) && GET_CODE (PATTERN (insn)) == COND_EXEC)
add_dependence (tail, insn, REG_DEP_ANTI);
}
-#endif
}
/* Data structures for the computation of data dependences in a regions. We
@@ -3588,4 +3589,3 @@ struct rtl_opt_pass pass_sched2 =
TODO_ggc_collect /* todo_flags_finish */
}
};
-
diff --git a/gcc/sched-vis.c b/gcc/sched-vis.c
index 89230efa34c..906e9c31f2a 100644
--- a/gcc/sched-vis.c
+++ b/gcc/sched-vis.c
@@ -521,6 +521,10 @@ print_value (char *buf, const_rtx x, int verbose)
cur = safe_concat (buf, cur, t);
cur = safe_concat (buf, cur, "]");
break;
+ case DEBUG_EXPR:
+ sprintf (t, "D#%i", DEBUG_TEMP_UID (DEBUG_EXPR_TREE_DECL (x)));
+ cur = safe_concat (buf, cur, t);
+ break;
default:
print_exp (t, x, verbose);
cur = safe_concat (buf, cur, t);
@@ -670,11 +674,18 @@ print_insn (char *buf, const_rtx x, int verbose)
if (DECL_P (INSN_VAR_LOCATION_DECL (insn)))
{
tree id = DECL_NAME (INSN_VAR_LOCATION_DECL (insn));
+ char idbuf[32];
if (id)
name = IDENTIFIER_POINTER (id);
+ else if (TREE_CODE (INSN_VAR_LOCATION_DECL (insn))
+ == DEBUG_EXPR_DECL)
+ {
+ sprintf (idbuf, "D#%i",
+ DEBUG_TEMP_UID (INSN_VAR_LOCATION_DECL (insn)));
+ name = idbuf;
+ }
else
{
- char idbuf[32];
sprintf (idbuf, "D.%i",
DECL_UID (INSN_VAR_LOCATION_DECL (insn)));
name = idbuf;
diff --git a/gcc/sdbout.c b/gcc/sdbout.c
index 1c4ddfaabed..7d5c820e8d0 100644
--- a/gcc/sdbout.c
+++ b/gcc/sdbout.c
@@ -307,6 +307,7 @@ const struct gcc_debug_hooks sdb_debug_hooks =
{
sdbout_init, /* init */
sdbout_finish, /* finish */
+ debug_nothing_void, /* assembly_start */
debug_nothing_int_charstar, /* define */
debug_nothing_int_charstar, /* undef */
sdbout_start_source_file, /* start_source_file */
@@ -337,6 +338,10 @@ const struct gcc_debug_hooks sdb_debug_hooks =
debug_nothing_int, /* handle_pch */
debug_nothing_rtx, /* var_location */
debug_nothing_void, /* switch_text_section */
+ debug_nothing_tree, /* direct_call */
+ debug_nothing_tree_int, /* virtual_call_token */
+ debug_nothing_rtx_rtx, /* copy_call_info */
+ debug_nothing_uid, /* virtual_call */
debug_nothing_tree_tree, /* set_name */
0 /* start_end_main_source_file */
};
@@ -1702,6 +1707,7 @@ const struct gcc_debug_hooks sdb_debug_hooks =
{
0, /* init */
0, /* finish */
+ 0, /* assembly_start */
0, /* define */
0, /* undef */
0, /* start_source_file */
@@ -1725,6 +1731,10 @@ const struct gcc_debug_hooks sdb_debug_hooks =
0, /* handle_pch */
0, /* var_location */
0, /* switch_text_section */
+ 0, /* direct_call */
+ 0, /* virtual_call_token */
+ 0, /* copy_call_info */
+ 0, /* virtual_call */
0, /* set_name */
0 /* start_end_main_source_file */
};
diff --git a/gcc/sel-sched-dump.c b/gcc/sel-sched-dump.c
index 5fce7cf6b9e..b307f52b841 100644
--- a/gcc/sel-sched-dump.c
+++ b/gcc/sel-sched-dump.c
@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3. If not see
#include "output.h"
#include "basic-block.h"
#include "cselib.h"
+#include "target.h"
#ifdef INSN_SCHEDULING
#include "sel-sched-ir.h"
@@ -931,10 +932,13 @@ rtx
debug_mem_addr_value (rtx x)
{
rtx t, addr;
+ enum machine_mode address_mode;
gcc_assert (MEM_P (x));
+ address_mode = targetm.addr_space.address_mode (MEM_ADDR_SPACE (x));
+
t = shallow_copy_rtx (x);
- if (cselib_lookup (XEXP (t, 0), Pmode, 0))
+ if (cselib_lookup (XEXP (t, 0), address_mode, 0))
XEXP (t, 0) = cselib_subst_to_values (XEXP (t, 0));
t = canon_rtx (t);
diff --git a/gcc/sel-sched-ir.h b/gcc/sel-sched-ir.h
index 9bc90bda559..70163c36c38 100644
--- a/gcc/sel-sched-ir.h
+++ b/gcc/sel-sched-ir.h
@@ -1395,6 +1395,9 @@ _eligible_successor_edge_p (edge e1, succ_iterator *ip)
&& !(flags & SUCCS_OUT))
return false;
+ if (EDGE_COUNT (bb->succs) == 0)
+ return false;
+
e2 = EDGE_SUCC (bb, 0);
bb = e2->dest;
}
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 0450ea083f4..ee119bcd65c 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -350,38 +350,50 @@ simplify_gen_relational (enum rtx_code code, enum machine_mode mode,
return gen_rtx_fmt_ee (code, mode, op0, op1);
}
-/* Replace all occurrences of OLD_RTX in X with NEW_RTX and try to simplify the
- resulting RTX. Return a new RTX which is as simplified as possible. */
+/* Replace all occurrences of OLD_RTX in X with FN (X', DATA), where X'
+ is an expression in X that is equal to OLD_RTX. Canonicalize and
+ simplify the result.
+
+ If FN is null, assume FN (X', DATA) == copy_rtx (DATA). */
rtx
-simplify_replace_rtx (rtx x, const_rtx old_rtx, rtx new_rtx)
+simplify_replace_fn_rtx (rtx x, const_rtx old_rtx,
+ rtx (*fn) (rtx, void *), void *data)
{
enum rtx_code code = GET_CODE (x);
enum machine_mode mode = GET_MODE (x);
enum machine_mode op_mode;
- rtx op0, op1, op2;
+ const char *fmt;
+ rtx op0, op1, op2, newx, op;
+ rtvec vec, newvec;
+ int i, j;
- /* If X is OLD_RTX, return NEW_RTX. Otherwise, if this is an expression, try
- to build a new expression substituting recursively. If we can't do
- anything, return our input. */
+ /* If X is OLD_RTX, return FN (X, DATA), with a null FN. Otherwise,
+ if this is an expression, try to build a new expression, substituting
+ recursively. If we can't do anything, return our input. */
- if (x == old_rtx)
- return new_rtx;
+ if (rtx_equal_p (x, old_rtx))
+ {
+ if (fn)
+ return fn (x, data);
+ else
+ return copy_rtx ((rtx) data);
+ }
switch (GET_RTX_CLASS (code))
{
case RTX_UNARY:
op0 = XEXP (x, 0);
op_mode = GET_MODE (op0);
- op0 = simplify_replace_rtx (op0, old_rtx, new_rtx);
+ op0 = simplify_replace_fn_rtx (op0, old_rtx, fn, data);
if (op0 == XEXP (x, 0))
return x;
return simplify_gen_unary (code, mode, op0, op_mode);
case RTX_BIN_ARITH:
case RTX_COMM_ARITH:
- op0 = simplify_replace_rtx (XEXP (x, 0), old_rtx, new_rtx);
- op1 = simplify_replace_rtx (XEXP (x, 1), old_rtx, new_rtx);
+ op0 = simplify_replace_fn_rtx (XEXP (x, 0), old_rtx, fn, data);
+ op1 = simplify_replace_fn_rtx (XEXP (x, 1), old_rtx, fn, data);
if (op0 == XEXP (x, 0) && op1 == XEXP (x, 1))
return x;
return simplify_gen_binary (code, mode, op0, op1);
@@ -391,8 +403,8 @@ simplify_replace_rtx (rtx x, const_rtx old_rtx, rtx new_rtx)
op0 = XEXP (x, 0);
op1 = XEXP (x, 1);
op_mode = GET_MODE (op0) != VOIDmode ? GET_MODE (op0) : GET_MODE (op1);
- op0 = simplify_replace_rtx (op0, old_rtx, new_rtx);
- op1 = simplify_replace_rtx (op1, old_rtx, new_rtx);
+ op0 = simplify_replace_fn_rtx (op0, old_rtx, fn, data);
+ op1 = simplify_replace_fn_rtx (op1, old_rtx, fn, data);
if (op0 == XEXP (x, 0) && op1 == XEXP (x, 1))
return x;
return simplify_gen_relational (code, mode, op_mode, op0, op1);
@@ -401,9 +413,9 @@ simplify_replace_rtx (rtx x, const_rtx old_rtx, rtx new_rtx)
case RTX_BITFIELD_OPS:
op0 = XEXP (x, 0);
op_mode = GET_MODE (op0);
- op0 = simplify_replace_rtx (op0, old_rtx, new_rtx);
- op1 = simplify_replace_rtx (XEXP (x, 1), old_rtx, new_rtx);
- op2 = simplify_replace_rtx (XEXP (x, 2), old_rtx, new_rtx);
+ op0 = simplify_replace_fn_rtx (op0, old_rtx, fn, data);
+ op1 = simplify_replace_fn_rtx (XEXP (x, 1), old_rtx, fn, data);
+ op2 = simplify_replace_fn_rtx (XEXP (x, 2), old_rtx, fn, data);
if (op0 == XEXP (x, 0) && op1 == XEXP (x, 1) && op2 == XEXP (x, 2))
return x;
if (op_mode == VOIDmode)
@@ -411,10 +423,9 @@ simplify_replace_rtx (rtx x, const_rtx old_rtx, rtx new_rtx)
return simplify_gen_ternary (code, mode, op_mode, op0, op1, op2);
case RTX_EXTRA:
- /* The only case we try to handle is a SUBREG. */
if (code == SUBREG)
{
- op0 = simplify_replace_rtx (SUBREG_REG (x), old_rtx, new_rtx);
+ op0 = simplify_replace_fn_rtx (SUBREG_REG (x), old_rtx, fn, data);
if (op0 == SUBREG_REG (x))
return x;
op0 = simplify_gen_subreg (GET_MODE (x), op0,
@@ -427,15 +438,15 @@ simplify_replace_rtx (rtx x, const_rtx old_rtx, rtx new_rtx)
case RTX_OBJ:
if (code == MEM)
{
- op0 = simplify_replace_rtx (XEXP (x, 0), old_rtx, new_rtx);
+ op0 = simplify_replace_fn_rtx (XEXP (x, 0), old_rtx, fn, data);
if (op0 == XEXP (x, 0))
return x;
return replace_equiv_address_nv (x, op0);
}
else if (code == LO_SUM)
{
- op0 = simplify_replace_rtx (XEXP (x, 0), old_rtx, new_rtx);
- op1 = simplify_replace_rtx (XEXP (x, 1), old_rtx, new_rtx);
+ op0 = simplify_replace_fn_rtx (XEXP (x, 0), old_rtx, fn, data);
+ op1 = simplify_replace_fn_rtx (XEXP (x, 1), old_rtx, fn, data);
/* (lo_sum (high x) x) -> x */
if (GET_CODE (op0) == HIGH && rtx_equal_p (XEXP (op0, 0), op1))
@@ -445,17 +456,58 @@ simplify_replace_rtx (rtx x, const_rtx old_rtx, rtx new_rtx)
return x;
return gen_rtx_LO_SUM (mode, op0, op1);
}
- else if (code == REG)
- {
- if (rtx_equal_p (x, old_rtx))
- return new_rtx;
- }
break;
default:
break;
}
- return x;
+
+ newx = x;
+ fmt = GET_RTX_FORMAT (code);
+ for (i = 0; fmt[i]; i++)
+ switch (fmt[i])
+ {
+ case 'E':
+ vec = XVEC (x, i);
+ newvec = XVEC (newx, i);
+ for (j = 0; j < GET_NUM_ELEM (vec); j++)
+ {
+ op = simplify_replace_fn_rtx (RTVEC_ELT (vec, j),
+ old_rtx, fn, data);
+ if (op != RTVEC_ELT (vec, j))
+ {
+ if (newvec == vec)
+ {
+ newvec = shallow_copy_rtvec (vec);
+ if (x == newx)
+ newx = shallow_copy_rtx (x);
+ XVEC (newx, i) = newvec;
+ }
+ RTVEC_ELT (newvec, j) = op;
+ }
+ }
+ break;
+
+ case 'e':
+ op = simplify_replace_fn_rtx (XEXP (x, i), old_rtx, fn, data);
+ if (op != XEXP (x, i))
+ {
+ if (x == newx)
+ newx = shallow_copy_rtx (x);
+ XEXP (newx, i) = op;
+ }
+ break;
+ }
+ return newx;
+}
+
+/* Replace all occurrences of OLD_RTX in X with NEW_RTX and try to simplify the
+ resulting RTX. Return a new RTX which is as simplified as possible. */
+
+rtx
+simplify_replace_rtx (rtx x, const_rtx old_rtx, rtx new_rtx)
+{
+ return simplify_replace_fn_rtx (x, old_rtx, 0, new_rtx);
}
/* Try to simplify a unary operation CODE whose output mode is to be
@@ -467,9 +519,6 @@ simplify_unary_operation (enum rtx_code code, enum machine_mode mode,
{
rtx trueop, tem;
- if (GET_CODE (op) == CONST)
- op = XEXP (op, 0);
-
trueop = avoid_constant_pool_reference (op);
tem = simplify_const_unary_operation (code, mode, trueop, op_mode);
@@ -963,7 +1012,11 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op)
return rtl_hooks.gen_lowpart_no_emit (mode, op);
#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
- if (! POINTERS_EXTEND_UNSIGNED
+ /* As we do not know which address space the pointer is refering to,
+ we can do this only if the target does not support different pointer
+ or address modes depending on the address space. */
+ if (target_default_pointer_address_modes_p ()
+ && ! POINTERS_EXTEND_UNSIGNED
&& mode == Pmode && GET_MODE (op) == ptr_mode
&& (CONSTANT_P (op)
|| (GET_CODE (op) == SUBREG
@@ -985,7 +1038,11 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op)
return rtl_hooks.gen_lowpart_no_emit (mode, op);
#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
- if (POINTERS_EXTEND_UNSIGNED > 0
+ /* As we do not know which address space the pointer is refering to,
+ we can do this only if the target does not support different pointer
+ or address modes depending on the address space. */
+ if (target_default_pointer_address_modes_p ()
+ && POINTERS_EXTEND_UNSIGNED > 0
&& mode == Pmode && GET_MODE (op) == ptr_mode
&& (CONSTANT_P (op)
|| (GET_CODE (op) == SUBREG
@@ -1250,6 +1307,7 @@ simplify_const_unary_operation (enum rtx_code code, enum machine_mode mode,
case US_TRUNCATE:
case SS_NEG:
case US_NEG:
+ case SS_ABS:
return 0;
default:
@@ -2888,6 +2946,9 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode,
tmp_op, gen_rtx_PARALLEL (VOIDmode, vec));
return tmp;
}
+ if (GET_CODE (trueop0) == VEC_DUPLICATE
+ && GET_MODE (XEXP (trueop0, 0)) == mode)
+ return XEXP (trueop0, 0);
}
else
{
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 5967fb5770f..e512db83979 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -52,9 +52,9 @@ unsigned int maximum_field_alignment = TARGET_DEFAULT_PACK_STRUCT * BITS_PER_UNI
/* ... and its original value in bytes, specified via -fpack-struct=<value>. */
unsigned int initial_max_fld_align = TARGET_DEFAULT_PACK_STRUCT;
-/* Nonzero if all REFERENCE_TYPEs are internal and hence should be
- allocated in Pmode, not ptr_mode. Set only by internal_reference_types
- called only by a front end. */
+/* Nonzero if all REFERENCE_TYPEs are internal and hence should be allocated
+ in the address spaces' address_mode, not pointer_mode. Set only by
+ internal_reference_types called only by a front end. */
static int reference_types_internal = 0;
static tree self_referential_size (tree);
@@ -71,8 +71,8 @@ extern void debug_rli (record_layout_info);
static GTY(()) tree pending_sizes;
-/* Show that REFERENCE_TYPES are internal and should be Pmode. Called only
- by front end. */
+/* Show that REFERENCE_TYPES are internal and should use address_mode.
+ Called only by front end. */
void
internal_reference_types (void)
@@ -1118,7 +1118,8 @@ place_field (record_layout_info rli, tree field)
/* No, we need to skip space before this field.
Bump the cumulative size to multiple of field alignment. */
- warning (OPT_Wpadded, "padding struct to align %q+D", field);
+ if (DECL_SOURCE_LOCATION (field) != BUILTINS_LOCATION)
+ warning (OPT_Wpadded, "padding struct to align %q+D", field);
/* If the alignment is still within offset_align, just align
the bit position. */
@@ -1483,7 +1484,8 @@ finalize_record_size (record_layout_info rli)
= round_up_loc (input_location, unpadded_size_unit, TYPE_ALIGN_UNIT (rli->t));
if (TREE_CONSTANT (unpadded_size)
- && simple_cst_equal (unpadded_size, TYPE_SIZE (rli->t)) == 0)
+ && simple_cst_equal (unpadded_size, TYPE_SIZE (rli->t)) == 0
+ && input_location != BUILTINS_LOCATION)
warning (OPT_Wpadded, "padding struct size to alignment boundary");
if (warn_packed && TREE_CODE (rli->t) == RECORD_TYPE
@@ -1915,6 +1917,7 @@ layout_type (tree type)
/* A pointer might be MODE_PARTIAL_INT,
but ptrdiff_t must be integral. */
SET_TYPE_MODE (type, mode_for_size (POINTER_SIZE, MODE_INT, 0));
+ TYPE_PRECISION (type) = POINTER_SIZE;
break;
case FUNCTION_TYPE:
@@ -1930,16 +1933,17 @@ layout_type (tree type)
case POINTER_TYPE:
case REFERENCE_TYPE:
{
- enum machine_mode mode = ((TREE_CODE (type) == REFERENCE_TYPE
- && reference_types_internal)
- ? Pmode : TYPE_MODE (type));
-
- int nbits = GET_MODE_BITSIZE (mode);
+ enum machine_mode mode = TYPE_MODE (type);
+ if (TREE_CODE (type) == REFERENCE_TYPE && reference_types_internal)
+ {
+ addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (type));
+ mode = targetm.addr_space.address_mode (as);
+ }
- TYPE_SIZE (type) = bitsize_int (nbits);
+ TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (mode));
TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (mode));
TYPE_UNSIGNED (type) = 1;
- TYPE_PRECISION (type) = nbits;
+ TYPE_PRECISION (type) = GET_MODE_BITSIZE (mode);
}
break;
diff --git a/gcc/system.h b/gcc/system.h
index 0c846cfbdd6..03910d0152f 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -761,7 +761,7 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
TARGET_ASM_EXCEPTION_SECTION TARGET_ASM_EH_FRAME_SECTION \
SMALL_ARG_MAX ASM_OUTPUT_SHARED_BSS ASM_OUTPUT_SHARED_COMMON \
ASM_OUTPUT_SHARED_LOCAL UNALIGNED_WORD_ASM_OP \
- ASM_MAKE_LABEL_LINKONCE
+ ASM_MAKE_LABEL_LINKONCE STACK_CHECK_PROBE_INTERVAL
/* Hooks that are no longer used. */
#pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \
diff --git a/gcc/target-def.h b/gcc/target-def.h
index 45b7ab7430e..ddab977aa2f 100644
--- a/gcc/target-def.h
+++ b/gcc/target-def.h
@@ -84,7 +84,7 @@
#define TARGET_ASM_INTERNAL_LABEL default_internal_label
#endif
-#ifndef TARGET_ARM_TTYPE
+#ifndef TARGET_ASM_TTYPE
#define TARGET_ASM_TTYPE hook_bool_rtx_false
#endif
@@ -410,6 +410,8 @@
#define TARGET_DEFAULT_TARGET_FLAGS 0
+#define TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE hook_void_void
+
#define TARGET_HANDLE_OPTION hook_bool_size_t_constcharptr_int_true
#define TARGET_HELP NULL
@@ -437,6 +439,7 @@
#define TARGET_EXPAND_BUILTIN default_expand_builtin
#define TARGET_RESOLVE_OVERLOADED_BUILTIN NULL
#define TARGET_FOLD_BUILTIN hook_tree_tree_tree_bool_null
+#define TARGET_BUILTIN_DECL NULL
/* In tree-ssa-math-opts.c */
#define TARGET_BUILTIN_RECIPROCAL default_builtin_reciprocal
@@ -470,6 +473,48 @@
#define TARGET_VALID_POINTER_MODE default_valid_pointer_mode
#endif
+#ifndef TARGET_ADDR_SPACE_POINTER_MODE
+#define TARGET_ADDR_SPACE_POINTER_MODE default_addr_space_pointer_mode
+#endif
+
+#ifndef TARGET_ADDR_SPACE_ADDRESS_MODE
+#define TARGET_ADDR_SPACE_ADDRESS_MODE default_addr_space_address_mode
+#endif
+
+#ifndef TARGET_ADDR_SPACE_VALID_POINTER_MODE
+#define TARGET_ADDR_SPACE_VALID_POINTER_MODE \
+ default_addr_space_valid_pointer_mode
+#endif
+
+#ifndef TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P
+#define TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P \
+ default_addr_space_legitimate_address_p
+#endif
+
+#ifndef TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS
+#define TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS \
+ default_addr_space_legitimize_address
+#endif
+
+#ifndef TARGET_ADDR_SPACE_SUBSET_P
+#define TARGET_ADDR_SPACE_SUBSET_P default_addr_space_subset_p
+#endif
+
+#ifndef TARGET_ADDR_SPACE_CONVERT
+#define TARGET_ADDR_SPACE_CONVERT default_addr_space_convert
+#endif
+
+#define TARGET_ADDR_SPACE_HOOKS \
+ { \
+ TARGET_ADDR_SPACE_POINTER_MODE, \
+ TARGET_ADDR_SPACE_ADDRESS_MODE, \
+ TARGET_ADDR_SPACE_VALID_POINTER_MODE, \
+ TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P, \
+ TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS, \
+ TARGET_ADDR_SPACE_SUBSET_P, \
+ TARGET_ADDR_SPACE_CONVERT, \
+ }
+
#ifndef TARGET_SCALAR_MODE_SUPPORTED_P
#define TARGET_SCALAR_MODE_SUPPORTED_P default_scalar_mode_supported_p
#endif
@@ -491,6 +536,7 @@
#define TARGET_BRANCH_TARGET_REGISTER_CLASS \
default_branch_target_register_class
#define TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED hook_bool_bool_false
+#define TARGET_HAVE_CONDITIONAL_EXECUTION default_have_conditional_execution
#define TARGET_CANNOT_FORCE_CONST_MEM hook_bool_rtx_false
#define TARGET_CANNOT_COPY_INSN_P NULL
#define TARGET_COMMUTATIVE_P hook_bool_const_rtx_commutative_p
@@ -861,6 +907,7 @@
TARGET_SCHED, \
TARGET_VECTORIZE, \
TARGET_DEFAULT_TARGET_FLAGS, \
+ TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE, \
TARGET_HANDLE_OPTION, \
TARGET_HELP, \
TARGET_EH_RETURN_FILTER_MODE, \
@@ -880,6 +927,7 @@
TARGET_ALIGN_ANON_BITFIELD, \
TARGET_NARROW_VOLATILE_BITFIELD, \
TARGET_INIT_BUILTINS, \
+ TARGET_BUILTIN_DECL, \
TARGET_EXPAND_BUILTIN, \
TARGET_RESOLVE_OVERLOADED_BUILTIN, \
TARGET_FOLD_BUILTIN, \
@@ -890,6 +938,7 @@
TARGET_CANNOT_MODIFY_JUMPS_P, \
TARGET_BRANCH_TARGET_REGISTER_CLASS, \
TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED, \
+ TARGET_HAVE_CONDITIONAL_EXECUTION, \
TARGET_CANNOT_FORCE_CONST_MEM, \
TARGET_CANNOT_COPY_INSN_P, \
TARGET_COMMUTATIVE_P, \
@@ -911,6 +960,7 @@
TARGET_MIN_DIVISIONS_FOR_RECIP_MUL, \
TARGET_MODE_REP_EXTENDED, \
TARGET_VALID_POINTER_MODE, \
+ TARGET_ADDR_SPACE_HOOKS, \
TARGET_SCALAR_MODE_SUPPORTED_P, \
TARGET_VECTOR_MODE_SUPPORTED_P, \
TARGET_RTX_COSTS, \
diff --git a/gcc/target.h b/gcc/target.h
index f964b6975f8..6d62d5207e5 100644
--- a/gcc/target.h
+++ b/gcc/target.h
@@ -68,6 +68,12 @@ typedef int (* print_switch_fn_type) (print_switch_type, const char *);
/* An example implementation for ELF targets. Defined in varasm.c */
extern int elf_record_gcc_switches (print_switch_type type, const char *);
+/* Some places still assume that all pointer or address modes are the
+ standard Pmode and ptr_mode. These optimizations become invalid if
+ the target actually supports multiple different modes. For now,
+ we disable such optimizations on such targets, using this function. */
+extern bool target_default_pointer_address_modes_p (void);
+
struct stdarg_info;
struct spec_info_def;
@@ -494,6 +500,11 @@ struct gcc_target
/* The initial value of target_flags. */
int default_target_flags;
+ /* Allow target specific overriding of option settings after options have
+ been changed by an attribute or pragma or when it is reset at the
+ end of the code affected by an attribute or pragma. */
+ void (* override_options_after_change) (void);
+
/* Handle target switch CODE (an OPT_* value). ARG is the argument
passed to the switch; it is NULL if no argument was. VALUE is the
value of ARG if CODE specifies a UInteger option, otherwise it is
@@ -562,6 +573,12 @@ struct gcc_target
/* Set up target-specific built-in functions. */
void (* init_builtins) (void);
+ /* Initialize (if INITIALIZE_P is true) and return the target-specific
+ built-in function decl for CODE.
+ Return NULL if that is not possible. Return error_mark_node if CODE
+ is outside of the range of valid target builtin function codes. */
+ tree (* builtin_decl) (unsigned code, bool initialize_p);
+
/* Expand a target-specific builtin. */
rtx (* expand_builtin) (tree exp, rtx target, rtx subtarget,
enum machine_mode mode, int ignore);
@@ -609,6 +626,9 @@ struct gcc_target
already been generated. */
bool (* branch_target_register_callee_saved) (bool after_pe_gen);
+ /* Return true if the target supports conditional execution. */
+ bool (* have_conditional_execution) (void);
+
/* True if the constant X cannot be placed in the constant pool. */
bool (* cannot_force_const_mem) (rtx);
@@ -688,6 +708,36 @@ struct gcc_target
/* True if MODE is valid for a pointer in __attribute__((mode("MODE"))). */
bool (* valid_pointer_mode) (enum machine_mode mode);
+ /* Support for named address spaces. */
+ struct addr_space {
+ /* MODE to use for a pointer into another address space. */
+ enum machine_mode (* pointer_mode) (addr_space_t);
+
+ /* MODE to use for an address in another address space. */
+ enum machine_mode (* address_mode) (addr_space_t);
+
+ /* True if MODE is valid for a pointer in __attribute__((mode("MODE")))
+ in another address space. */
+ bool (* valid_pointer_mode) (enum machine_mode, addr_space_t);
+
+ /* True if an address is a valid memory address to a given named address
+ space for a given mode. */
+ bool (* legitimate_address_p) (enum machine_mode, rtx, bool, addr_space_t);
+
+ /* Return an updated address to convert an invalid pointer to a named
+ address space to a valid one. If NULL_RTX is returned use machine
+ independent methods to make the address valid. */
+ rtx (* legitimize_address) (rtx, rtx, enum machine_mode, addr_space_t);
+
+ /* True if one named address space is a subset of another named address. */
+ bool (* subset_p) (addr_space_t, addr_space_t);
+
+ /* Function to convert an rtl expression from one address space to
+ another. */
+ rtx (* convert) (rtx, tree, tree);
+
+ } addr_space;
+
/* True if MODE is valid for the target. By "valid", we mean able to
be manipulated in non-trivial ways. In particular, this means all
the arithmetic is supported. */
@@ -902,7 +952,7 @@ struct gcc_target
/* Return the rtx for the result of a libcall of mode MODE,
calling the function FN_NAME. */
- rtx (*libcall_value) (enum machine_mode, rtx);
+ rtx (*libcall_value) (enum machine_mode, const_rtx);
/* Return an rtx for the argument pointer incoming to the
current function. */
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index dd52da98638..dfc470c869e 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -603,14 +603,19 @@ default_function_value (const_tree ret_type ATTRIBUTE_UNUSED,
#ifdef FUNCTION_VALUE
return FUNCTION_VALUE (ret_type, fn_decl_or_type);
#else
- return NULL_RTX;
+ gcc_unreachable ();
#endif
}
rtx
-default_libcall_value (enum machine_mode mode, rtx fun ATTRIBUTE_UNUSED)
+default_libcall_value (enum machine_mode mode ATTRIBUTE_UNUSED,
+ const_rtx fun ATTRIBUTE_UNUSED)
{
+#ifdef LIBCALL_VALUE
return LIBCALL_VALUE (mode);
+#else
+ gcc_unreachable ();
+#endif
}
rtx
@@ -826,6 +831,107 @@ default_builtin_support_vector_misalignment (enum machine_mode mode,
return false;
}
+/* Determine whether or not a pointer mode is valid. Assume defaults
+ of ptr_mode or Pmode - can be overridden. */
+bool
+default_valid_pointer_mode (enum machine_mode mode)
+{
+ return (mode == ptr_mode || mode == Pmode);
+}
+
+/* Return the mode for a pointer to a given ADDRSPACE, defaulting to ptr_mode
+ for the generic address space only. */
+
+enum machine_mode
+default_addr_space_pointer_mode (addr_space_t addrspace ATTRIBUTE_UNUSED)
+{
+ gcc_assert (ADDR_SPACE_GENERIC_P (addrspace));
+ return ptr_mode;
+}
+
+/* Return the mode for an address in a given ADDRSPACE, defaulting to Pmode
+ for the generic address space only. */
+
+enum machine_mode
+default_addr_space_address_mode (addr_space_t addrspace ATTRIBUTE_UNUSED)
+{
+ gcc_assert (ADDR_SPACE_GENERIC_P (addrspace));
+ return Pmode;
+}
+
+/* Named address space version of valid_pointer_mode. */
+
+bool
+default_addr_space_valid_pointer_mode (enum machine_mode mode, addr_space_t as)
+{
+ if (!ADDR_SPACE_GENERIC_P (as))
+ return (mode == targetm.addr_space.pointer_mode (as)
+ || mode == targetm.addr_space.address_mode (as));
+
+ return targetm.valid_pointer_mode (mode);
+}
+
+/* Some places still assume that all pointer or address modes are the
+ standard Pmode and ptr_mode. These optimizations become invalid if
+ the target actually supports multiple different modes. For now,
+ we disable such optimizations on such targets, using this function. */
+
+bool
+target_default_pointer_address_modes_p (void)
+{
+ if (targetm.addr_space.address_mode != default_addr_space_address_mode)
+ return false;
+ if (targetm.addr_space.pointer_mode != default_addr_space_pointer_mode)
+ return false;
+
+ return true;
+}
+
+/* Named address space version of legitimate_address_p. */
+
+bool
+default_addr_space_legitimate_address_p (enum machine_mode mode, rtx mem,
+ bool strict, addr_space_t as)
+{
+ if (!ADDR_SPACE_GENERIC_P (as))
+ gcc_unreachable ();
+
+ return targetm.legitimate_address_p (mode, mem, strict);
+}
+
+/* Named address space version of LEGITIMIZE_ADDRESS. */
+
+rtx
+default_addr_space_legitimize_address (rtx x, rtx oldx,
+ enum machine_mode mode, addr_space_t as)
+{
+ if (!ADDR_SPACE_GENERIC_P (as))
+ return x;
+
+ return targetm.legitimize_address (x, oldx, mode);
+}
+
+/* The default hook for determining if one named address space is a subset of
+ another and to return which address space to use as the common address
+ space. */
+
+bool
+default_addr_space_subset_p (addr_space_t subset, addr_space_t superset)
+{
+ return (subset == superset);
+}
+
+/* The default hook for TARGET_ADDR_SPACE_CONVERT. This hook should never be
+ called for targets with only a generic address space. */
+
+rtx
+default_addr_space_convert (rtx op ATTRIBUTE_UNUSED,
+ tree from_type ATTRIBUTE_UNUSED,
+ tree to_type ATTRIBUTE_UNUSED)
+{
+ gcc_unreachable ();
+}
+
bool
default_hard_regno_scratch_ok (unsigned int regno ATTRIBUTE_UNUSED)
{
@@ -892,4 +998,14 @@ unsigned int default_case_values_threshold (void)
return (HAVE_casesi ? 4 : 5);
}
+bool
+default_have_conditional_execution (void)
+{
+#ifdef HAVE_conditional_execution
+ return HAVE_conditional_execution;
+#else
+ return false;
+#endif
+}
+
#include "gt-targhooks.h"
diff --git a/gcc/targhooks.h b/gcc/targhooks.h
index 490d4ceeb91..365496b9825 100644
--- a/gcc/targhooks.h
+++ b/gcc/targhooks.h
@@ -98,7 +98,7 @@ extern const char *hook_invalid_arg_for_unprototyped_fn
(const_tree, const_tree, const_tree);
extern bool hook_bool_const_rtx_commutative_p (const_rtx, int);
extern rtx default_function_value (const_tree, const_tree, bool);
-extern rtx default_libcall_value (enum machine_mode, rtx);
+extern rtx default_libcall_value (enum machine_mode, const_rtx);
extern rtx default_internal_arg_pointer (void);
extern rtx default_static_chain (const_tree, bool);
extern void default_trampoline_init (rtx, tree, rtx);
@@ -119,4 +119,16 @@ extern bool default_hard_regno_scratch_ok (unsigned int);
extern bool default_target_option_valid_attribute_p (tree, tree, tree, int);
extern bool default_target_option_pragma_parse (tree, tree);
extern bool default_target_can_inline_p (tree, tree);
+extern bool default_valid_pointer_mode (enum machine_mode);
+extern enum machine_mode default_addr_space_pointer_mode (addr_space_t);
+extern enum machine_mode default_addr_space_address_mode (addr_space_t);
+extern bool default_addr_space_valid_pointer_mode (enum machine_mode,
+ addr_space_t);
+extern bool default_addr_space_legitimate_address_p (enum machine_mode, rtx,
+ bool, addr_space_t);
+extern rtx default_addr_space_legitimize_address (rtx, rtx, enum machine_mode,
+ addr_space_t);
+extern bool default_addr_space_subset_p (addr_space_t, addr_space_t);
+extern rtx default_addr_space_convert (rtx, tree, tree);
extern unsigned int default_case_values_threshold (void);
+extern bool default_have_conditional_execution (void);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e40e71d1982..77cf10c03cf 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,1681 @@
+2009-11-06 Jason Merrill <jason@redhat.com>
+
+ PR c++/15946
+ * g++.dg/parse/error36.C: New.
+ * g++.old-deja/g++.other/typename1.C: Adjust.
+
+ PR c++/9381
+ * g++.dg/abi/regparm1.C: New.
+
+2009-11-06 Basile Starynkevitch <basile@starynkevitch.net>
+
+ * g++.dg/plugin/pragma_plugin-test-1.C: new testcase for
+ PLUGIN_PRAGMAS.
+ * g++.dg/plugin/pragma_plugin.c: new test plugin for
+ PLUGIN_PRAGMAS.
+ * g++.dg/plugin/plugin.exp (plugin_test_list): Add pragma_plugin.c and
+ pragma_plugin-test-1.C.
+
+2009-11-06 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR c++/41536
+ * g++.dg/ext/always_inline-5.C: New test.
+
+2009-11-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/41967
+ * g++.dg/gomp/pr41967.C: New test.
+
+2009-11-06 Michael Matz <matz@suse.de>
+
+ PR middle-end/41963
+ * gcc.dg/pr41963.c: New test.
+
+2009-11-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/41935
+ * gcc.dg/pr41935.c: New test.
+ * c-c++-common/pr41935.c: New test.
+ * c-c++-common/builtin-offsetof.c (f0): Allow index one past the last
+ element.
+ * gcc.c-torture/execute/pr41935.c: New test.
+
+2009-11-05 Jason Merrill <jason@redhat.com>
+
+ PR c++/34180
+ * g++.dg/init/synth2.C: New.
+
+ PR c++/7046
+ * g++.dg/abi/pragma-pack1.C: New.
+
+ PR c++/34870
+ * g++.dg/lookup/koenig7.C: New.
+
+ PR c++/41703
+ * g++.dg/template/partial6.C: New.
+
+2009-11-05 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41556
+ * gfortran.dg/class_12.f03: New test.
+
+2009-11-05 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.target/i386/i386.exp (check_effective_target_xop): Fix typo
+ in builtin's name.
+
+2009-11-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/36912
+ * g++.dg/init/static-init2.C: New.
+
+2009-11-05 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41556
+ PR fortran/41873
+ * gfortran.dg/interface_abstract_4.f90: New test.
+
+2009-11-05 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ * gcc.target/m68k/pr41302.c: Fix target triplet.
+
+2009-11-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/39413
+ * g++.dg/template/overload11.C: New.
+ * g++.dg/template/nested3.C: Adjust.
+
+2009-11-04 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/20548
+ * ada/acats/norun.lst: Remove the stack checking tests.
+ * ada/acats/run_acats: Limit the stack to 8MB.
+
+2009-11-04 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41556
+ PR fortran/41937
+ * gfortran.dg/class_11.f03: New test.
+
+2009-11-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/35067
+ * g++.dg/abi/thunk5.C: New.
+
+2009-11-04 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR rtl-opt/41833
+ * gcc.target/powerpc/altivec-33.c: New testcase.
+
+2009-11-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/17365, DR 218
+ * g++.dg/lookup/koenig6.C: New.
+ * g++.dg/lookup/koenig5.C: Adjust.
+ * g++.dg/template/crash56.C: Adjust.
+ * g++.old-deja/g++.ns/koenig5.C: Adjust.
+
+2009-11-04 Harsha Jagasia <harsha.jagasia@amd.com>
+ Dwarakanath Rajagopal <dwarak.rajagopal@amd.com>
+
+ * gcc.target/i386/xop-check.h: New file.
+ * gcc.target/i386/xop-hadduX.c: Ditto.
+ * gcc.target/i386/xop-haddX.c: Ditto.
+ * gcc.target/i386/xop-hsubX.c: Ditto.
+ * gcc.target/i386/xop-imul32widen-vector.c: Ditto.
+ * gcc.target/i386/xop-imul32widen-vector.c: Ditto.
+ * gcc.target/i386/xop-pcmov2.c: Ditto.
+ * gcc.target/i386/xop-pcmov.c: Ditto.
+ * gcc.target/i386/xop-rotate1-vector.c: Ditto.
+ * gcc.target/i386/xop-rotate2-vector.c: Ditto.
+ * gcc.target/i386/xop-rotate3-vector.c: Ditto.
+ * gcc.target/i386/xop-shift1-vector.c: Ditto.
+ * gcc.target/i386/xop-shift2-vector.c: Ditto.
+ * gcc.target/i386/xop-shift3-vector.c: Ditto.
+ * gcc.target/i386/i386.exp: Add check_effective_target_xop.
+ * gcc.target/i386/sse-12.c: Update with new compile options to
+ activate and check xopintrin.h intrinsic file.
+ * 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.
+ * g++.dg/other/i386-5.C: Ditto.
+ * g++.dg/other/i386-6.C: Ditto.
+
+2009-11-04 Wei Guozhi <carrot@google.com>
+
+ PR target/40835
+ * gcc.target/arm/pr40835: New testcase.
+
+2009-11-04 Revital Eres <eres@il.ibm.com>
+
+ * gcc.target/powerpc/vsx-vectorize-3.c: Adjust tetcase following
+ change in decision of peeling for alignment.
+ * gcc.target/powerpc/vsx-vectorize-5.c: Likewise.
+ * gcc.dg/vect/vect-50.c: Likewise.
+ * gcc.dg/vect/vect-42.c: Likewise.
+ * gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c:
+ Likewise.
+ * gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c:
+ Likewise.
+ * gcc.dg/vect/vect-multitypes-6.c: Likewise.
+ * gcc.dg/vect/vect-60.c: Likewise.
+ * gcc.dg/vect/vect-52.c: Likewise.
+ * gcc.dg/vect/vect-44.c: Likewise.
+ * gcc.dg/vect/vect-27.c: Likewise.
+ * gcc.dg/vect/vect-29.c: Likewise.
+ * gcc.dg/vect/vect-72.c: Likewise.
+ * gcc.dg/vect/vect-56.c: Likewise.
+ * gcc.dg/vect/vect-48.c: Likewise.
+ * gcc.dg/vect/vect-multitypes-3.c: Likewise.
+ * gfortran.dg/vect/vect-2.f90: Likewise.
+ * gfortran.dg/vect/vect-5.f90: Likewise.
+
+2009-11-04 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/41919
+ * gcc.c-torture/execute/pr41919.c: New testcase.
+
+2009-11-04 Carlos O'Donell <carlos@codesourcery.com>
+
+ PR target/41302
+ * gcc.target/m68k/pr41302.c: New test.
+
+2009-11-03 Jason Merrill <jason@redhat.com>
+
+ PR c++/36959
+ * g++.dg/opt/inline16.C: New.
+
+2009-11-03 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/stack_check.adb1: New test.
+ * gnat.dg/stack_check.adb2: Likewise.
+
+2009-11-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/41917
+ * gcc.c-torture/execute/pr41917.c: New test.
+
+2009-11-03 Uros Bizjak <ubizjak@gmail.com>
+
+ * gcc.target/i386/pr41900.c: Make test compile only. Scan assembler
+ dump to not include "call *%esp".
+
+2009-11-03 Jason Merrill <jason@redhat.com>
+
+ PR c++/39786
+ * g++.dg/lookup/using22.C: New.
+
+ PR c++/41876
+ * g++.dg/parse/eh-decl.C: New.
+
+ PR c++/41927
+ * g++.dg/template/sfinae16.C: New.
+
+ PR c++/41815
+ * g++.dg/cpp0x/rv-return.C: New.
+ * g++.dg/cpp0x/deduce.C: Adjust.
+
+ PR c++/40944
+ * g++.dg/template/sfinae15.C: New.
+
+ PR c++/40687
+ * g++.dg/cpp0x/auto3.C: Remove xfail.
+
+2009-11-03 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/41907
+ * gfortran.dg/missing_optional_dummy_6.f90: New test.
+
+2009-11-03 Nick Clifton <nickc@redhat.com>
+
+ * gcc.target/rx/builtins.c: Remove redundant tests.
+ Add test of MVTIPL instruction.
+ * gcc.target/rx/interrupts.c: Use fast_interrupt and interrupt
+ function attributes. Add -msave-acc-in-interrupts option to the
+ command line.
+
+2009-11-03 Andrew Stubbs <ams@codesourcery.com>
+ Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ * g++.dg/torture/pr36191.C: Don't run with -fomit-frame-pointer on
+ sh, m68k and fido.
+
+2009-11-03 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/38699
+ * c-c++-common/dfp/builtin-offsetof.c: Moved to ...
+ * c-c++-common/builtin-offsetof.c: ... here.
+
+2009-11-03 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/38699
+ * c-c++-common/dfp/builtin-offsetof.c: New test.
+ * g++.dg/other/offsetof6.C: Likewise.
+
+2009-11-03 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/41900
+ * gcc.target/i386/pr41900.c: New test.
+
+2009-11-02 Andy Hutchinson <hutchinsonandy@gcc.gnu.org>
+
+ * gcc.c-torture/execute/pr40668.c: Correct for 16bit int size.
+
+2009-11-02 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/41856
+ * g++.dg/lookup/extern-c-redecl3.C: Make the test x86 only.
+ * g++.dg/lookup/extern-c-redecl4.C: Likewise.
+
+2009-11-02 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/37093
+ * g++.dg/other/ptrmem10.C: New test.
+ * g++.dg/other/ptrmem11.C: Likewise.
+
+2009-11-02 Janis Johnson <janis187@us.ibm.com>
+
+ PR testsuite/41878
+ * gfortran.dg/vect/vect-2.f90: Fix effective-target expression, add
+ spaces in some expressions.
+
+2009-11-02 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/other/linkage2.C: Move to...
+ * g++.dg/cpp0x/linkage2.C: ..here.
+ * g++.dg/abi/mangle32.C: Add -std=c++0x.
+ * g++.dg/cpp0x/nolinkage1.C: Likewise.
+ * g++.dg/debug/dwarf2/anonname1.C: Likewise.
+ * g++.dg/ext/anon-struct4.C: Revert earlier change.
+ * g++.dg/lookup/anon2.C: Likewise.
+ * g++.dg/other/anon3.C: Likewise.
+ * g++.dg/template/arg2.C: Likewise.
+ * g++.dg/template/local4.C: Likewise.
+ * g++.old-deja/g++.law/operators32.C: Likewise.
+ * g++.old-deja/g++.other/linkage2.C: Likewise.
+ * g++.old-deja/g++.pt/enum6.C: Likewise.
+ * g++.old-deja/g++.other/anon9.C: Likewise.
+ * g++.old-deja/g++.other/linkage1.C: Likewise.
+ * c-c++-common/dfp/pr35620.c: Give the union a name.
+
+2009-11-02 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ PR tree-optimization/41857
+ * gcc.target/spu/ea/pr41857.c: New file.
+
+2009-11-02 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/41750
+ * gcc.c-torture/execute/pr41750.c: New test.
+
+2009-11-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/41841
+ * gcc.dg/pr41841.c: New test.
+
+ PR debug/41893
+ * gcc.dg/debug/pr41893-1.c: New test.
+ * gcc.dg/debug/pr41893-2.c: New file.
+
+ PR c++/41774
+ * g++.dg/ext/visibility/namespace3.C: New test.
+
+2009-11-01 Jason Merrill <jason@redhat.com>
+
+ * gcc.dg/tree-ssa/restrict-1.c: Move to c-c++-common.
+ * gcc.dg/tree-ssa/restrict-2.c: Move to c-c++-common.
+ * gcc.dg/tree-ssa/restrict-4.c: Move to c-c++-common.
+
+2009-11-01 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/opt5.adb: New test.
+
+2009-11-01 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/41872
+ * gfortran.dg/allocatable_scalar_4.f90: New test.
+
+2009-11-01 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/41850
+ * gfortran.dg/intent_out_6.f90: New testcase.
+
+2009-10-31 Richard Guenther <rguenther@suse.de>
+
+ * g++.dg/tree-ssa/restrict1.C: New.
+
+2009-10-31 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/rtti/typeid9.C: New.
+
+ PR c++/41754
+ * g++.dg/cpp0x/initlist25.C: New.
+
+2009-10-31 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/specs/rep_clause4.ads: New test.
+
+2009-10-30 Andy Hutchinson <hutchinsonandy@gcc.gnu.org>
+
+ PR target/41885
+ * gcc.target/avr/torture/pr41885.c: New test.
+
+2009-10-30 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/specs/pack5.ads: New test.
+
+2009-10-30 Andrew Jenner <andrew@codesourcery.com>
+
+ * lib/target-supports.exp: Handle powerpc-*-elf.
+
+2009-10-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/40838
+ * gcc.target/i386/incoming-6.c: New.
+ * gcc.target/i386/incoming-7.c: Likewise.
+ * gcc.target/i386/incoming-8.c: Likewise.
+ * gcc.target/i386/incoming-9.c: Likewise.
+ * gcc.target/i386/incoming-10.c: Likewise.
+ * gcc.target/i386/incoming-11.c: Likewise.
+ * gcc.target/i386/incoming-12.c: Likewise.
+ * gcc.target/i386/incoming-13.c: Likewise.
+ * gcc.target/i386/incoming-14.c: Likewise.
+ * gcc.target/i386/incoming-15.c: Likewise.
+ * gcc.target/i386/pr37843-4.c: Likewise.
+
+2009-10-30 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/41863
+ * g++.dg/template/sizeof12.C: New test.
+
+2009-10-29 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/pack14.adb: New test.
+
+2009-10-29 David Daney <ddaney@caviumnetworks.com>
+
+ * gcc.target/mips/mips.exp (mips_option_groups): Add
+ mcount-ra-address.
+ * gcc.target/mips/mmcount-ra-address-1.c: New test.
+ * gcc.target/mips/mmcount-ra-address-2.c: New test.
+ * gcc.target/mips/mmcount-ra-address-3.c: New test.
+
+2009-10-29 Michael Matz <matz@suse.de>
+
+ * gcc.target/i386/sse-recip.c: Use fabsf instead of != .
+ * gcc.target/i386/sse-recip-vec.c: Ditto.
+ * gcc.target/i386/brokensqrt.c: New test.
+
+2009-10-29 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/41777
+ * gfortran.dg/associated_target_3.f90: New testcase.
+
+2009-10-29 Rafael Avila de Espindola <espindola@google.com>
+
+ * gfortran.dg/lto/pr41764_0.f: New.
+
+2009-10-29 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/41775
+ * testsuite/g++.dg/torture/pr41775.C: New testcase.
+
+2009-10-28 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/inline-ns1.C: New.
+ * g++.dg/cpp0x/inline-ns2.C: New.
+ * g++.dg/cpp0x/inline-ns3.C: New.
+
+2009-10-28 Paolo Bonzini <bonzini@gnu.org>
+
+ PR rtl-optimization/39715
+ * gcc.target/arm/thumb-ltu.c: New.
+
+2009-10-28 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41808
+ PR lto/41839
+ * gcc.dg/lto/20091027-1_0.c: New testcase.
+ * gcc.dg/lto/20091027-1_1.c: Likewise.
+ * g++.dg/lto/20091026-1_0.C: Likewise.
+ * g++.dg/lto/20091026-1_1.C: Likewise.
+ * g++.dg/lto/20091026-1_a.h: Likewise.
+
+2009-10-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/41837
+ * gcc.dg/pr41837.c: New test.
+
+ PR debug/41801
+ * g++.dg/ext/sync-3.C: New test.
+
+ PR target/41762
+ * gcc.dg/pr41762.c: New test.
+
+2009-10-28 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/41855
+ * gfortran.dg/lto/20091028-1_0.f90: New testcase.
+ * gfortran.dg/lto/20091028-1_1.c: Likewise.
+ * gfortran.dg/lto/20091028-2_0.f90: Likewise.
+ * gfortran.dg/lto/20091028-2_1.c: Likewise.
+
+2009-10-28 Paolo Bonzini <bonzini@gnu.org>
+
+ PR rtl-optimization/39715
+ * gcc.target/arm/thumb-bitfld1.c: New.
+
+2009-10-28 Paolo Bonzini <bonzini@gnu.org>
+
+ PR rtl-optimization/40741
+ * gcc.target/arm/thumb-branch1.c: New.
+
+2009-10-27 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/lambda/lambda-conv.C: New.
+ * g++.dg/cpp0x/lambda/lambda-const-neg.C: Adjust.
+ * g++.dg/cpp0x/lambda/lambda-mangle.C: Adjust.
+ * g++.dg/cpp0x/lambda/lambda-non-const.C: Adjust.
+
+2009-10-27 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/null_pointer_deref1.adb: Accept Constraint_Error.
+ * gnat.dg/null_pointer_deref2.adb: Likewise.
+
+2009-10-27 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/torture/ipa-pta-1.c: Adjust testcase.
+
+2009-10-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/41842
+ * gcc.dg/pr41842.c: New test.
+
+2009-10-27 Revital Eres <eres@il.ibm.com>
+
+ PR tree-optimization/40648
+ * gcc.target/powerpc/vsx-vectorize-2.c: Adjust testcase following
+ change in decision of peeling for alignment.
+ * gcc.target/powerpc/vsx-vectorize-3.c: Likewise.
+ * gcc.target/powerpc/vsx-vectorize-4.c: Likewise.
+ * gcc.target/powerpc/vsx-vectorize-5.c: Likewise.
+ * gcc.target/powerpc/vsx-vectorize-6.c: Likewise.
+ * gcc.target/powerpc/vsx-vectorize-7.c: Likewise.
+ * gcc.dg/vect/vect-50.c: Likewise.
+ * gcc.dg/vect/vect-33.c: Likewise.
+ * gcc.dg/vect/no-section-anchors-vect-69.c: Likewise.
+ * gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c:
+ Likewise.
+ * gcc.dg/vect/costmodel/i386/costmodel-vect-31.c: Likewise.
+ * gcc.dg/vect/costmodel/i386/costmodel-vect-33.c: Likewise.
+ * gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c:
+ Likewise.
+ * gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c: Likewise.
+ * gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c: Likewise.
+ * gcc.dg/vect/vect-multitypes-6.c: Likewise.
+ * gcc.dg/vect/vect-60.c: Likewise.
+ * gcc.dg/vect/vect-26.c: Likewise.
+ * gcc.dg/vect/vect-52.c: Likewise.
+ * gcc.dg/vect/vect-44.c: Likewise.
+ * gcc.dg/vect/vect-27.c: Likewise.
+ * gcc.dg/vect/vect-70.c: Likewise.
+ * gcc.dg/vect/vect-28.c: Likewise.
+ * gcc.dg/vect/no-section-anchors-vect-31.c: Likewise.
+ * gcc.dg/vect/vect-109.c: Likewise.
+ * gcc.dg/vect/vect-54.c: Likewise.
+ * gcc.dg/vect/vect-29.c: Likewise.
+ * gcc.dg/vect/vect-72.c: Likewise.
+ * gcc.dg/vect/vect-56.c: Likewise.
+ * gcc.dg/vect/vect-48.c: Likewise.
+ * gcc.dg/vect/vect-91.c: Likewise.
+ * gcc.dg/vect/vect-92.c: Likewise.
+ * gcc.dg/vect/vect-58.c: Likewise.
+ * gcc.dg/vect/slp-25.c: Likewise.
+ * gcc.dg/vect/vect-93.c: Likewise.
+ * gcc.dg/vect/vect-95.c: Likewise.
+ * gcc.dg/vect/no-section-anchors-vect-64.c: Likewise.
+ * gcc.dg/vect/vect-87.c: Likewise.
+ * gcc.dg/vect/vect-96.c: Likewise.
+ * gcc.dg/vect/vect-multitypes-1.c: Likewise.
+ * gcc.dg/vect/vect-88.c: Likewise.
+ * gcc.dg/vect/no-section-anchors-vect-66.c: Likewise.
+ * gcc.dg/vect/vect-89.c: Likewise.
+ * gcc.dg/vect/vect-multitypes-3.c: Likewise.
+ * gcc.dg/vect/no-section-anchors-vect-68.c: Likewise.
+ * gcc.dg/vect/vect-multitypes-4.c: Likewise.
+ * gfortran.dg/vect/vect-2.f90: Likewise.
+ * gfortran.dg/vect/vect-3.f90: Likewise.
+ * gfortran.dg/vect/vect-4.f90: Likewise.
+ * gfortran.dg/vect/vect-5.f90: Likewise.
+
+2009-10-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/41020
+ * g++.dg/lookup/extern-c-redecl5.C: Fix up regexp.
+
+2009-10-26 Ben Elliston <bje@au.ibm.com>
+ Michael Meissner <meissner@linux.vnet.ibm.com>
+ Ulrich Weigand <uweigand@de.ibm.com>
+
+ * gcc.target/spu/ea/ea.exp: New file.
+ * gcc.target/spu/ea/cache1.c: Likewise.
+ * gcc.target/spu/ea/cast1.c: Likewise.
+ * gcc.target/spu/ea/cast2.c: Likewise.
+ * gcc.target/spu/ea/compile1.c: Likewise.
+ * gcc.target/spu/ea/compile2.c: Likewise.
+ * gcc.target/spu/ea/cppdefine.c: Likewise.
+ * gcc.target/spu/ea/errors1.c: Likewise.
+ * gcc.target/spu/ea/errors2.c: Likewise.
+ * gcc.target/spu/ea/execute1.c: Likewise.
+ * gcc.target/spu/ea/execute2.c: Likewise.
+ * gcc.target/spu/ea/execute3.c: Likewise.
+ * gcc.target/spu/ea/ops1.c: Likewise.
+ * gcc.target/spu/ea/ops2.c: Likewise.
+ * gcc.target/spu/ea/options1.c: Likewise.
+ * gcc.target/spu/ea/test-sizes.c: Likewise.
+
+2009-10-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR bootstrap/41345
+ * gcc.dg/pr41345.c: New test.
+
+ PR debug/41828
+ * g++.dg/debug/dwarf2/anonname1.C: New test.
+
+2009-10-26 Jason Merrill <jason@redhat.com>
+
+ PR c++/38796
+ * g++.dg/cpp0x/defaulted15.C: New.
+ * g++.dg/cpp0x/defaulted16.C: New.
+
+2009-10-26 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/41785
+ * gcc/testsuite/g++.dg/cpp0x/variadic96.C: New test.
+
+2009-10-26 Nick Clifton <nickc@redhat.com>
+
+ * lib/target-supports.exp (check_profiling_available):
+ Profiling is not, currently, available for the RX port.
+ (check_effective_target_hard_float): Add support for RX target.
+ * gcc.target/rx: New directory.
+ * gcc.target/rx/builtins.c: New test file.
+ * gcc.target/rx/interrupts.c: New test file.
+ * gcc.target/rx/rx-abi-function-tests.c: New test file.
+ * gcc.target/rx/zero-width-bitfield.c: New test file.
+ * gcc.target/rx/i272091.c: New test file.
+ * gcc.target/rx/packed-struct.c: New test file.
+ * gcc.target/rx/rx.exp: New file: Drives RX tests.
+
+2009-10-26 Andrew Pinski <pinskia@gcc.gnu.org>
+
+ * gcc.dg/lto/20091014-1_0.c: Replace -shared with -r -nostlib.
+ * gcc.dg/lto/20091016-1_0.c: Likewise.
+ * gcc.dg/lto/20090206-1_0.c: Likewise.
+ * gcc.dg/lto/20081120-1_0.c: Likewise.
+ * gcc.dg/lto/20081120-2_0.c: Likewise.
+ * gcc.dg/lto/20090116_0.c: Likewise.
+ * gcc.dg/lto/20081126_0.c: Likewise.
+ * gcc.dg/lto/20091013-1_0.c: Likewise.
+ * gcc.dg/lto/20081212-1_0.c: Likewise.
+ * gcc.dg/lto/20091015-1_0.c: Likewise.
+ * gcc.dg/lto/20090126-1_0.c: Likewise.
+ * gcc.dg/lto/20090126-2_0.c: Likewise.
+ * gcc.dg/lto/20091020-1_0.c: Likewise.
+ * gcc.dg/lto/20091020-2_0.c: Likewise.
+ * gcc.dg/lto/20081204-1_0.c: Likewise.
+ * gcc.dg/lto/20081204-2_0.c: Likewise.
+ * gcc.dg/lto/20081224_0.c: Likewise.
+ * gcc.dg/lto/20090219_0.c: Likewise.
+
+2009-10-26 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/41020
+ * g++.dg/lookup/extern-c-redecl2.C: New test.
+ * g++.dg/lookup/extern-c-redecl3.C: Likewise.
+ * g++.dg/lookup/extern-c-redecl4.C: Likewise.
+ * g++.dg/lookup/extern-c-redecl5.C: Likewise.
+
+2009-10-26 Michael Matz <matz@suse.de>
+
+ PR tree-optimization/41783
+ * gcc.dg/pr41783.c: New test.
+ * gcc.dg/tree-ssa/ssa-pre-23.c: Adjust.
+ * gcc.dg/tree-ssa/ssa-pre-24.c: Don't xfail anymore.
+ * gcc.dg/tree-ssa/ssa-pre-27.c: New test.
+
+2009-10-26 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41714
+ * gfortran.dg/class_allocate_4.f03: New test.
+
+2009-10-24 Adam Nemet <anemet@caviumnetworks.com>
+
+ * gcc.target/mips/mult-1.c: New test.
+
+2009-10-24 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41784
+ * gfortran.dg/extends_8.f03: New test.
+
+2009-10-24 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/specs/pack4.ads: New test.
+
+2009-10-24 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/null_pointer_deref1.adb: New test.
+ * gnat.dg/null_pointer_deref2.adb: Likewise.
+
+2009-10-24 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/41772
+ * gfortran.dg/transfer_intrinsic_3.f90.
+
+2009-10-24 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/opt4.adb: New test.
+
+2009-10-23 Joseph Myers <joseph@codesourcery.com>
+
+ PR c/40033
+ * gcc.dg/noncompile/pr40033-1.c: New test.
+
+2009-10-23 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/40808
+ * g++.dg/abi/mangle34.C: New test
+
+2009-10-23 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/lambda/lambda-nested2.C: New.
+
+ Core issue 899
+ * g++.dg/cpp0x/explicit4.C: New.
+
+2009-10-23 Joseph Myers <joseph@codesourcery.com>
+
+ * g++.dg/abi/rtti3.C, g++.dg/abi/thunk4.C: Skip for *-*-mingw* and
+ *-*-cygwin.
+ * g++.dg/cpp0x/lambda/lambda-mangle.C: Disable weak symbols tests
+ for *-*-mingw* and *-*-cygwin.
+ * g++.dg/opt/vt1.C: Skip for *-*-mingw* and *-*_cygwin.
+ * g++.dg/template/spec35.C: Disable weak symbol test for
+ *-*-mingw* and *-*-cygwin.
+
+ PR testsuite/31342
+ * gcc.target/i386/pic-1.c: Skip for *-*-mingw* and *-*-cygwin.
+
+2009-10-23 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41800
+ * gfortran.dg/class_10.f03: New test.
+
+2009-10-22 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/41787
+ * gcc.target/powerpc/vsx-vrsave.c: New file.
+
+2009-10-23 Joseph Myers <joseph@codesourcery.com>
+
+ PR c/41673
+ * gcc.dg/Wstrict-aliasing-bogus-vla-1.c: New test.
+
+2009-10-23 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/41778
+ * gcc.dg/tree-ssa/ssa-pre-26.c: New testcase.
+
+2009-10-22 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41791
+ * g++.dg/lto/20091022-2_0.C: New testcase.
+
+2009-10-22 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41730
+ * g++.dg/lto/20091022-1_0.C: New testcase.
+
+2009-10-22 Razya Ladelsky <razya@il.ibm.com>
+
+ * gcc.dg/autopar/outer-4.c: Adjust scan.
+ * gcc.dg/autopar/outer-5.c: Adjust scan.
+ * gcc.dg/autopar/outer-5.c: Add scan optimized.
+
+ * libgomp.graphite/force-parallel-2.c: Adjust scan.
+ * gcc.dg/autopar/outer-1.c: New testcase.
+ * gcc.dg/autopar/outer-2.c: New testcase.
+ * gcc.dg/autopar/outer-3.c: New testcase.
+ * gcc.dg/autopar/outer-4.c: New testcase.
+ * gcc.dg/autopar/outer-5.c: New testcase.
+ * gcc.dg/autopar/outer-6.c: New testcase.
+
+2009-10-22 Jan Hubicka <jh@suse.cz>
+
+ * gcc.c-torture/compile/pr40556.c: New testcase.
+
+2009-10-22 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41781
+ * gfortran.dg/goto_8.f90: New test case.
+
+2009-10-21 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/41497
+ * gcc.dg/tree-ssa/pr41497.c: New.
+
+2009-10-21 Steve Ellcey <sje@cup.hp.com>
+
+ * g++.dg/tree-ssa/copyprop.C: Use include to define free().
+
+2009-10-21 Joseph Myers <joseph@codesourcery.com>
+
+ * gcc.dg/tls/pie-1.c: New test.
+
+2009-10-21 Jakub Jelinek <jakub@redhat.com>
+
+ * g++.dg/abi/mangle33.C: New test.
+
+2009-10-21 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/discr22.adb: New test.
+
+2009-10-21 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/loop_optimization7.ad[sb]: New test.
+ * gnat.dg/loop_optimization7_pkg.ads: New helper.
+
+2009-10-21 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41706
+ PR fortran/41766
+ * gfortran.dg/class_9.f03: Extended test case.
+ * gfortran.dg/select_type_7.f03: New test case.
+
+2009-10-20 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/lto/20091020-3_0.c: New testcase.
+
+2009-10-20 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41761
+ * gcc.dg/lto/20091020-1_0.c: New testcase.
+ * gcc.dg/lto/20091020-1_1.c: Likewise.
+ * gcc.dg/lto/20091020-2_0.c: Likewise.
+ * gcc.dg/lto/20091020-2_1.c: Likewise.
+
+2009-10-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/41340
+ * gcc.dg/pr41340.c: New test.
+
+2009-10-20 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/discr21.ad[sb]: New test.
+ * gnat.dg/discr21_pkg.ads: New helper.
+
+2009-10-20 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/41706
+ * gfortran.dg/class_9 : New test.
+
+2009-10-19 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/raw-string-1.c: New test.
+ * gcc.dg/raw-string-2.c: New test.
+ * gcc.dg/raw-string-3.c: New test.
+ * gcc.dg/raw-string-4.c: New test.
+ * gcc.dg/raw-string-5.c: New test.
+ * gcc.dg/raw-string-6.c: New test.
+ * gcc.dg/raw-string-7.c: New test.
+ * gcc.dg/utf8-1.c: New test.
+ * gcc.dg/utf8-2.c: New test.
+ * gcc.dg/utf-badconcat2.c: New test.
+ * gcc.dg/utf-dflt2.c: New test.
+ * gcc.dg/cpp/include6.c: New test.
+ * g++.dg/ext/raw-string-1.C: New test.
+ * g++.dg/ext/raw-string-2.C: New test.
+ * g++.dg/ext/raw-string-3.C: New test.
+ * g++.dg/ext/raw-string-4.C: New test.
+ * g++.dg/ext/raw-string-5.C: New test.
+ * g++.dg/ext/raw-string-6.C: New test.
+ * g++.dg/ext/raw-string-7.C: New test.
+ * g++.dg/ext/utf8-1.C: New test.
+ * g++.dg/ext/utf8-2.C: New test.
+ * g++.dg/ext/utf-badconcat2.C: New test.
+ * g++.dg/ext/utf-dflt2.C: New test.
+
+ * gcc.dg/cleanup-13.c: New test.
+
+2009-10-19 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41586
+ * gfortran.dg/auto_dealloc_1.f90: New test case.
+
+2009-10-19 Jakub Jelinek <jakub@redhat.com>
+
+ Port from redhat/gcc-4_4-branch:
+ 2009-10-08 Jakub Jelinek <jakub@redhat.com>
+ * gcc.dg/debug/vta-2.c: New test.
+
+ 2009-09-30 Alexandre Oliva <aoliva@redhat.com>
+ * gcc.dg/debug/vta-1.c: New.
+
+2009-10-19 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/noreturn2.ad[sb]: New test.
+
+2009-10-19 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/41755
+ * gfortran.dg/equiv_8.f90: New test.
+ * gfortran.dg/class_allocate_1.f03: Remove obsolete FIXME.
+
+2009-10-19 Joseph Myers <joseph@codesourcery.com>
+
+ * gcc.target/arm/neon-thumb2-move.c: New test.
+
+2009-10-19 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/debug/vta-3.c: New test.
+
+2009-10-17 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/nested_proc.adb: Rename into...
+ * gnat.dg/nested_proc1.adb: ...this.
+ * gnat.dg/nested_proc2.adb: New test.
+
+2009-10-17 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/noreturn1.ad[sb]: New test.
+
+2009-10-17 Janus Weil <janus@gcc.gnu.org>
+ Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/41629
+ * gfortran.dg/class_6.f90: New test.
+
+ PR fortran/41608
+ PR fortran/41587
+ * gfortran.dg/class_7.f90: New test.
+
+ PR fortran/41618
+ * gfortran.dg/class_8.f90: New test.
+
+2009-10-17 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/lto/20091017-1_0.c: New testcase.
+ * gcc.dg/lto/20091017-1_1.c: Likewise.
+
+2009-10-17 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/unchecked_convert4.adb: Add missing rep clause.
+
+2009-10-17 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/aggr11.adb: New test.
+ * gnat.dg/aggr11_pkg.ads: New helper.
+
+2009-10-17 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/slice8.adb: New test.
+ * gnat.dg/slice8_pkg1.ads: New helper.
+ * gnat.dg/slice8_pkg2.ads: Likewise.
+ * gnat.dg/slice8_pkg3.ad[sb]: Likewise.
+
+2009-10-17 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/unchecked_convert4.adb: New test.
+
+2009-10-15 Jason Merrill <jason@redhat.com>
+
+ PR c++/38798
+ * g++.dg/cpp0x/trailing5.C: New.
+
+ * g++.dg/cpp0x/auto6.C: Rename to trailing1.C.
+ * g++.dg/cpp0x/auto8.C: Rename to trailing2.C.
+ * g++.dg/cpp0x/auto12.C: Rename to trailing3.C.
+ * g++.dg/cpp0x/auto13.C: Rename to trailing4.C.
+
+2009-10-16 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41719
+ * gfortran.dg/class_5.f03: New test case.
+ * gfortran.dg/typebound_operator_2.f03: Fixing invalid test case.
+ * gfortran.dg/typebound_operator_4.f03: Ditto.
+
+2009-10-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * g++.dg/ipa/iinline-1.C: Use dg-add-options bind_pic_locally.
+ * g++.dg/other/first-global.C: Likewise.
+ * g++.dg/parse/attr-externally-visible-1.C: Likewise.
+ * g++.dg/torture/pr40323.C: Likewise.
+ * g++.dg/tree-ssa/nothrow-1.C: Likewise.
+ * gcc.dg/inline-33.c: Likewise.
+ * gcc.dg/ipa/ipa-1.c: Likewise.
+ * gcc.dg/ipa/ipa-2.c: Likewise.
+ * gcc.dg/ipa/ipa-3.c: Likewise.
+ * gcc.dg/ipa/ipa-4.c: Likewise.
+ * gcc.dg/ipa/ipa-5.c: Likewise.
+ * gcc.dg/ipa/ipa-7.c: Likewise.
+ * gcc.dg/ipa/ipacost-2.c: Likewise.
+ * gcc.dg/tree-ssa/inline-3.c: Likewise.
+ * gcc.dg/tree-ssa/local-pure-const.c: Likewise.
+ * gfortran.dg/whole_file_5.f90: Likewise.
+ * gfortran.dg/whole_file_6.f90: Likewise.
+
+2009-10-16 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/41728
+ * gcc.c-torture/compile/pr41728.c: New testcase.
+
+2009-10-16 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41598
+ * gcc.dg/lto/20091016-1_0.c: New testcase.
+ * gcc.dg/lto/20091016-1_1.c: Likewise.
+ * gcc.dg/lto/20091016-1_a.h: Likewise.
+
+2009-10-16 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41715
+ * gfortran.dg/lto/20091015-1_0.f: New testcase.
+ * gfortran.dg/lto/20091015-1_1.f: Likewise.
+ * gfortran.dg/lto/20091015-1_2.f: Likewise.
+
+2009-10-16 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41713
+ * gfortran.dg/lto/20091016-1_0.f90: New testcase.
+
+2009-10-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/41717
+ * gcc.dg/debug/pr41717.c: New test.
+
+2009-10-16 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/41648
+ * gfortran.dg/dynamic_dispatch_4.f03 : New test.
+
+ PR fortran/41656
+ * gfortran.dg/dynamic_dispatch_5.f03 : New test.
+
+2009-10-15 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/23983
+ * gcc.target/powerpc/altivec-4.c (b): Make sure altivec builtin
+ result used.
+ * g++.dg/ext/altivec-2.C (main): Ditto.
+
+2009-10-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * lib/target-supports.exp (add_options_for_bind_pic_locally): New.
+ * gcc.dg/tree-ssa/ipa-cp-1.c: Bind pic locally.
+
+2009-10-15 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41669
+ * gcc.dg/lto/20091015-1_0.c: New testcase.
+ * gcc.dg/lto/20091015-1_1.c: Likewise.
+ * gcc.dg/lto/20091015-1_2.c: Likewise.
+ * gcc.dg/lto/20091015-1_a.h: Likewise.
+ * gcc.dg/lto/20091015-1_b.h: Likewise.
+
+2009-10-15 Steve Ellcey <sje@cup.hp.com>
+
+ * gcc.dg/torture/pr41555.c: Add -std=c99 option.
+
+2009-10-14 Daniel Gutson <dgutson@codesourcery.com>
+
+ * gcc.target/arm/neon/vfp-shift-a2t2.c: New test case.
+
+2009-10-14 Jakub Jelinek <jakub@redhat.com>
+
+ * obj-c++.dg/layout-1.mm: Don't xfail dg-bogus on lp64, change
+ line from 1 to 0.
+ * obj-c++.dg/bitfield-1.mm: Likewise.
+ * obj-c++.dg/bitfield-4.mm: Likewise.
+
+2009-10-14 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41173
+ * gcc.dg/lto/20091014-1_0.c: New testcase.
+
+2009-10-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR testsuite/41707
+ * g++.dg/plugin/attribute_plugin-test-1.C: Expect the first
+ warning on line 0 instead of 1.
+
+2009-10-14 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41521
+ * gfortran.dg/lto/pr41521_0.f90: New testcase.
+ * gfortran.dg/lto/pr41521_1.f90: Likewise.
+
+2009-10-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/41543
+ * gcc.dg/debug/dwarf2/pr41543.c: New test.
+
+ PR debug/41695
+ * gcc.dg/debug/dwarf2/pr41695.c: New test.
+
+2009-10-14 Uros Bizjak <ubizjak@gmail.com>
+
+ * gcc.target/i386/i386.exp (check_effective_target_ms_hook_prologue):
+ New procedure.
+ * gcc.target/i386/ms_hook_prologue.c: Check for ms_hook_prologue
+ effective target.
+
+2009-10-14 Jason Merrill <jason@redhat.com>
+
+ PR c++/39866
+ * g++.dg/cpp0x/defaulted14.C: New.
+
+2009-10-14 Larry Evans <cppljevans@suddenlink.net>
+
+ * g++.dg/cpp0x/vt-40092.C: New.
+
+2009-10-14 Alexandre Oliva <aoliva@redhat.com>
+
+ * gcc.dg/guality/pr41616-1.c: Drop -O2.
+ * gcc.dg/guality/pr41447-1.c: Likewise. Name main.
+
+2009-10-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gfortran.dg/complex_intrinsic_8.f90: New test.
+
+2009-10-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcc.dg/torture/builtin-math-6.c: Test complex "arc" functions.
+ * lib/target-supports.exp (check_effective_target_mpc_arc): New.
+
+2009-10-14 Hans-Peter Nilsson <hp@axis.com>
+
+ PR target/38948
+ * gcc.dg/torture/pr38948.c: New test.
+
+2009-10-13 Steve Ellcey <sje@cup.hp.com>
+
+ * gfortran.dg/vect/fast-math-pr38968.f90: Add timeout.
+
+2009-10-13 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41581
+ * gfortran.dg/class_allocate_2.f03: Modified.
+ * gfortran.dg/class_allocate_3.f03: New test case.
+
+2009-10-13 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41668
+ * gcc.dg/lto/20091006-2_0.c: New testcase.
+ * gcc.dg/lto/20091006-2_1.c: Likewise.
+ * gcc.dg/lto/20091006-2_2.c: Likewise.
+ * gcc.dg/lto/20091013-1_0.c: Likewise.
+ * gcc.dg/lto/20091013-1_1.c: Likewise.
+ * gcc.dg/lto/20091013-1_2.c: Likewise.
+
+2009-10-13 Martin Jambor <mjambor@suse.cz>
+
+ * gcc.c-torture/compile/pr41661.c: New test.
+
+2009-10-12 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/41683
+ * gfortran.dg/fmt_error_9.f: Add check for repeat count after P.
+
+2009-10-12 Jason Merrill <jason@redhat.com>
+
+ PR c++/37875
+ * g++.dg/cpp0x/decltype18.C: New.
+
+ PR c++/37766
+ * g++.dg/cpp0x/fntmpdefarg1.C: New.
+
+2009-10-12 Janis Johnson <janis187@us.ibm.com>
+
+ * gcc.dg/lto/20090914-2.c: Fix typos in test directives.
+
+2009-10-12 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/41343
+ PR debug/41447
+ PR debug/41264
+ PR debug/41338
+ * gcc.dg/guality/pr41447-1.c: New.
+ * gcc.dg/debug/pr41264-1.c: New.
+ * gcc.dg/debug/pr41343-1.c: New.
+
+2009-10-12 Hans-Peter Nilsson <hp@axis.com>
+
+ PR target/26515
+ * gcc.dg/torture/pr26515.c: New test.
+
+2009-10-12 Janis Johnson <janis187@us.ibm.com>
+
+ PR testsuite/41659
+ * gcc.dg/lto/20090914-2.c: Use dg-skip-if to skip test.
+ * lib/lto.exp (lto-get-options-main): Report error for using "target"
+ or "xfail" with dg-lto-do.
+
+2009-10-12 Stefan Dösinger <stefan@codeweavers.com>
+
+ * gcc.target/i386/ms_hook_prologue.c: New testcase.
+
+2009-10-12 Michael Matz <matz@suse.de>
+
+ * gcc.dg/plugin/one_time_plugin.c: Update test to use the cfg
+ pass.
+
+2009-10-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/41680
+ * g++.dg/torture/pr41680.C: New test.
+
+2009-10-12 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/41570
+ * g++.dg/debug/dwarf2/template-params-7.C: New test.
+
+2009-10-12 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/41616
+ * gcc.dg/guality/pr41616-1.c: New.
+
+2009-10-11 Jason Merrill <jason@redhat.com>
+
+ PR c++/37204
+ * g++.dg/cpp0x/rv-reinterpret.C: New.
+
+2009-10-11 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/38439
+ * gfortran.dg/fmt_error_9.f: New test.
+ * gfortran.dg/fmt_error_10.f: New test.
+
+2009-10-11 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/41583
+ * gfortran.dg/class_4a.f03: New test with class_4b,c and d.f03.
+ * gfortran.dg/class_4b.f03: As above.
+ * gfortran.dg/class_4c.f03: As above.
+ * gfortran.dg/class_4d.f03: As above.
+
+2009-10-11 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/41555
+ * gcc.dg/torture/pr41555.c: New testcase.
+
+2009-10-10 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/35862
+ * gfortran.dg/round_2.f03: Eliminate possible compile error. Use max
+ function correctly.
+
+2009-10-10 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/35862
+ * gfortran.dg/round_2.f03: Update test to also test for smaller kind.
+ Add conditions to avoid runtime errors if not supported.
+
+2009-10-10 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/41654
+ * gfortran.fortran-torture/compile/pr41654.f90: New testcase.
+
+2009-10-09 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp/ucn-1.C: New.
+
+2009-10-09 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41585
+ * gfortran.dg/class_2.f03: Extended test case.
+
+2009-10-09 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/41582
+ * gfortran.dg/class_allocate_1.f03: Modify code such that
+ it compiles with the gfc_warning->gfc_error change.
+ * gfortran.dg/class_allocate_1.f03: New test.
+
+2009-10-09 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41579
+ * gfortran.dg/select_type_6.f03: New test.
+
+2009-10-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/41445
+ * gcc.dg/cpp/separate-1.c: Adjust.
+ * gcc.dg/cpp/spacing1.c: Add -P to dg-options.
+ * gcc.dg/debug/dwarf2/pr41445-1.c: New test.
+ * gcc.dg/debug/dwarf2/pr41445-2.c: New test.
+ * gcc.dg/debug/dwarf2/pr41445-3.c: New test.
+ * gcc.dg/debug/dwarf2/pr41445-4.c: New test.
+ * gcc.dg/debug/dwarf2/pr41445-5.c: New test.
+ * gcc.dg/debug/dwarf2/pr41445-6.c: New test.
+
+ PR rtl-optimization/41646
+ * gcc.c-torture/compile/pr41646.c: New test.
+
+2009-10-09 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/41634
+ * gcc.c-torture/compile/pr41634.c: New testcase.
+
+2009-10-09 Uros Bizjak <ubizjak@gmail.com>
+
+ * gfortran.dg/block_2.f08: Cleanup "original" tree dump.
+
+2009-10-09 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/opt3.adb: New test.
+ * gnat.dg/opt3_pkg.ads: New helper.
+
+2009-10-08 Doug Kwan <dougkwan@google.com>
+
+ PR rtl-optimization/41574
+ * gcc.dg/pr41574.c: New test.
+
+2009-10-08 Cary Coutant <ccoutant@google.com>
+
+ Add support for debugging with ICF (Identical Code Folding).
+ * g++.dg/debug/dwarf2/icf.C: New test.
+
+2009-10-08 Adam Nemet <anemet@caviumnetworks.com>
+
+ * gcc.target/mips/truncate-6.c: New test.
+
+2009-10-08 Jason Merrill <jason@redhat.com>
+
+ PR c++/36816
+ * g++.dg/cpp0x/rv-deduce.C: New.
+
+ PR c++/37177
+ * g++.dg/cpp0x/variadic-throw.C: Adjust errors.
+ * g++.dg/template/explicit-args2.C: New.
+ * g++.dg/template/explicit-args3.C: New.
+ * g++.old-deja/g++.pt/crash58.C: Remove some errors.
+
+2009-10-08 Michael Matz <matz@suse.de>
+
+ PR middle-end/41573
+ * gcc.dg/tree-ssa/foldstring-1.c: Use fre dump.
+ * gcc.dg/tree-ssa/useless-1.c: Use gimple dump.
+ * gcc.dg/pr41573.c: New test.
+
+2009-10-07 Joseph Myers <joseph@codesourcery.com>
+
+ PR c/41182
+ * gcc.c-torture/compile/pr41182-1.c: New.
+
+2009-10-07 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/variadic95.C: New.
+
+2009-10-07 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/template/scope3.C: New.
+
+2009-10-07 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/debug/dwarf2/inline3.c: New test.
+
+2009-10-07 Daniel Kraft <d@domob.eu>
+
+ PR fortran/41615
+ * gfortran.dg/assumed_charlen_function_6.f90: New test.
+
+2009-10-07 Janus Weil <janus@gcc.gnu.org>
+
+ * gfortran.dg/same_type_as_2.f03: Modified (was illegal).
+ * gfortran.dg/select_type_1.f03: Modified error message.
+ * gfortran.dg/select_type_5.f03: New test.
+
+2009-10-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/41612
+ * gfortran.dg/round_2.f03: Fix test to work on platforms that do not
+ have kind=10 reals.
+
+2009-10-06 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/lambda/lambda-init.C: New.
+ * g++.dg/cpp0x/lambda/lambda-direct-init.C: New.
+
+2009-10-06 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41502
+ * gcc.dg/lto/20091006-1_0.c: New testcase.
+ * gcc.dg/lto/20091006-1_1.c: Likewise.
+ * gcc.dg/lto/20091005-2_0.c: Likewise.
+
+2009-10-06 Samuel Tardieu <sam@rfc1149.net>
+
+ PR ada/41383
+ * gnat.dg/timer_cancel.adb: New test.
+
+2009-10-06 Samuel Tardieu <sam@rfc1149.net>
+
+ PR ada/38333
+ * gnat.dg/specs/import_abstract.ads: New.
+
+2009-10-05 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/35862
+ * gfortran.dg/round_2.f03: New test.
+
+2009-10-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/41558
+ * gcc.dg/guality/guality.exp: Move gdb-test proc into...
+ * lib/gcc-gdb-test.exp: ... here. New file.
+ * gfortran.dg/guality/guality.exp: New file.
+ * gfortran.dg/guality/pr41558.f90: New test.
+ * gfortran.dg/guality/arg1.f90: New test.
+
+2009-10-05 Paul Thomas <pault@gcc.gnu.org>
+
+ * gfortran.dg/dynamic_dispatch_1.f90: New test.
+ * gfortran.dg/dynamic_dispatch_2.f90: New test.
+ * gfortran.dg/dynamic_dispatch_3.f90: New test.
+ * gfortran.dg/module_md5_1.f90: Update md5 sum.
+
+2009-10-05 Sriraman Tallam <tmsriram@google.com>
+
+ * gcc.dg/plugin/selfassign.c (plugin_init): Change plugin_pass to
+ register_pass_info.
+ * gcc.dg/plugin/one_time_plugin.c (plugin_init): Change
+ plugin_pass to register_pass_info.
+ * g++.dg/plugin/selfassign.c (plugin_init): Change plugin_pass to
+ register_pass_info.
+ * g++.dg/plugin/dumb_plugin.c (plugin_init): Change plugin_pass to
+ register_pass_info.
+
+2009-10-05 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41281
+ * gcc.dg/lto/20090914-2_0.c: New testcase.
+
+2009-10-05 Richard Guenther <rguenther@suse.de>
+
+ PR lto/40902
+ * gcc.dg/lto/20091005-1_0.c: New testcase.
+ * gcc.dg/lto/20091005-1_1.c: Likewise.
+
+2009-10-05 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41552
+ PR lto/41487
+ * g++.dg/lto/20091002-1_0.C: Adjust flags.
+ * g++.dg/lto/20091004-1_0.C: New testcase.
+ * g++.dg/lto/20091004-1_1.C: Likewise.
+ * g++.dg/lto/20091004-2_0.C: Likewise.
+ * g++.dg/lto/20091004-2_1.C: Likewise.
+ * g++.dg/lto/20091004-3_0.C: Likewise.
+ * g++.dg/lto/20091004-3_1.C: Likewise.
+
+2009-10-05 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/23821
+ * gcc.dg/torture/pr23821.c: New testcase.
+
+2009-10-05 Daniel Kraft <d@domob.eu>
+
+ PR fortran/41403
+ * gfortran.dg/goto_6.f: New test.
+ * gfortran.dg/goto_7.f: New test.
+
+2009-10-03 Ben Elliston <bje@au.ibm.com>
+ Bill Maddox <maddox@google.com>
+ Cary Coutant <ccoutant@google.com>
+ Chris Demetriou <cgd@google.com>
+ Diego Novillo <dnovillo@google.com>
+ Doug Kwan <dougkwan@google.com>
+ Jan Hubicka <jh@suse.cz>
+ Ollie Wild <aaw@google.com>
+ Rafael Espindola <espindola@google.com>
+ Richard Guenther <rguenther@suse.de>
+ Simon Baldwin <simonb@google.com>
+
+ * g++.dg/20090107-1.C: New.
+ * g++.dg/20090121-1.C: New.
+ * g++.dg/ipa/20090113-1.C: New.
+ * g++.dg/lto: New directory.
+ * g++.dg/lto/20080829_0.C: New.
+ * g++.dg/lto/20080904_0.C: New.
+ * g++.dg/lto/20080907_0.C: New.
+ * g++.dg/lto/20080908-1_0.C: New.
+ * g++.dg/lto/20080908-2_0.C: New.
+ * g++.dg/lto/20080908-3_0.C: New.
+ * g++.dg/lto/20080909-1_0.C: New.
+ * g++.dg/lto/20080910-1_0.C: New.
+ * g++.dg/lto/20080912-1_0.C: New.
+ * g++.dg/lto/20080912_0.C: New.
+ * g++.dg/lto/20080915_0.C: New.
+ * g++.dg/lto/20080916_0.C: New.
+ * g++.dg/lto/20080917_0.C: New.
+ * g++.dg/lto/20080924_0.C: New.
+ * g++.dg/lto/20080926_0.C: New.
+ * g++.dg/lto/20081008_0.C: New.
+ * g++.dg/lto/20081022.h: New.
+ * g++.dg/lto/20081022_0.C: New.
+ * g++.dg/lto/20081022_1.C: New.
+ * g++.dg/lto/20081023_0.C: New.
+ * g++.dg/lto/20081109-1_0.C: New.
+ * g++.dg/lto/20081109-2_0.C: New.
+ * g++.dg/lto/20081109_0.C: New.
+ * g++.dg/lto/20081109_1.C: New.
+ * g++.dg/lto/20081118-1_0.C: New.
+ * g++.dg/lto/20081118-1_1.C: New.
+ * g++.dg/lto/20081118_0.C: New.
+ * g++.dg/lto/20081118_1.C: New.
+ * g++.dg/lto/20081119-1.h: New.
+ * g++.dg/lto/20081119-1_0.C: New.
+ * g++.dg/lto/20081119-1_1.C: New.
+ * g++.dg/lto/20081119_0.C: New.
+ * g++.dg/lto/20081119_1.C: New.
+ * g++.dg/lto/20081120-1_0.C: New.
+ * g++.dg/lto/20081120-1_1.C: New.
+ * g++.dg/lto/20081120-2_0.C: New.
+ * g++.dg/lto/20081120-2_1.C: New.
+ * g++.dg/lto/20081123_0.C: New.
+ * g++.dg/lto/20081123_1.C: New.
+ * g++.dg/lto/20081125.h: New.
+ * g++.dg/lto/20081125_0.C: New.
+ * g++.dg/lto/20081125_1.C: New.
+ * g++.dg/lto/20081127_0.C: New.
+ * g++.dg/lto/20081127_1.C: New.
+ * g++.dg/lto/20081203_0.C: New.
+ * g++.dg/lto/20081203_1.C: New.
+ * g++.dg/lto/20081204-1_0.C: New.
+ * g++.dg/lto/20081204-1_1.C: New.
+ * g++.dg/lto/20081204-2_0.C: New.
+ * g++.dg/lto/20081204-2_1.C: New.
+ * g++.dg/lto/20081209_0.C: New.
+ * g++.dg/lto/20081209_1.C: New.
+ * g++.dg/lto/20081211-1.h: New.
+ * g++.dg/lto/20081211-1_0.C: New.
+ * g++.dg/lto/20081211-1_1.C: New.
+ * g++.dg/lto/20081217-1_0.C: New.
+ * g++.dg/lto/20081217-2_0.C: New.
+ * g++.dg/lto/20081219_0.C: New.
+ * g++.dg/lto/20081219_1.C: New.
+ * g++.dg/lto/20090106_0.C: New.
+ * g++.dg/lto/20090112_0.C: New.
+ * g++.dg/lto/20090128_0.C: New.
+ * g++.dg/lto/20090221_0.C: New.
+ * g++.dg/lto/20090302_0.C: New.
+ * g++.dg/lto/20090302_1.C: New.
+ * g++.dg/lto/20090303_0.C: New.
+ * g++.dg/lto/20090311-1.h: New.
+ * g++.dg/lto/20090311-1_0.C: New.
+ * g++.dg/lto/20090311-1_1.C: New.
+ * g++.dg/lto/20090311_0.C: New.
+ * g++.dg/lto/20090311_1.C: New.
+ * g++.dg/lto/20090312.h: New.
+ * g++.dg/lto/20090312_0.C: New.
+ * g++.dg/lto/20090312_1.C: New.
+ * g++.dg/lto/20090313_0.C: New.
+ * g++.dg/lto/20090313_1.C: New.
+ * g++.dg/lto/20090315_0.C: New.
+ * g++.dg/lto/20090315_1.C: New.
+ * g++.dg/lto/20091002-1_0.C: New testcase.
+ * g++.dg/lto/20091002-2_0.C: Likewise..
+ * g++.dg/lto/20091002-3_0.C: Likewise..
+ * g++.dg/lto/README: New.
+ * g++.dg/lto/pr40818_0.C: New.
+ * g++.dg/opt/thunk3-1.C: New.
+ * g++.dg/opt/thunk4.C: New.
+ * gcc.c-torture/execute/builtins/lib/abs.c: Mark builtin
+ replacements with __attribute__ ((__noinline__)).
+ * gcc.c-torture/execute/builtins/lib/bfill.c: Likewise.
+ * gcc.c-torture/execute/builtins/lib/bzero.c: Likewise.
+ * gcc.c-torture/execute/builtins/lib/fprintf.c: Likewise.
+ * gcc.c-torture/execute/builtins/lib/memchr.c: Likewise.
+ * gcc.c-torture/execute/builtins/lib/memcmp.c: Likewise.
+ * gcc.c-torture/execute/builtins/lib/memmove.c: Likewise.
+ * gcc.c-torture/execute/builtins/lib/mempcpy.c: Likewise.
+ * gcc.c-torture/execute/builtins/lib/memset.c: Likewise.
+ * gcc.c-torture/execute/builtins/lib/printf.c: Likewise.
+ * gcc.c-torture/execute/builtins/lib/sprintf.c: Likewise.
+ * gcc.c-torture/execute/builtins/lib/stpcpy.c: Likewise.
+ * gcc.c-torture/execute/builtins/lib/strcat.c: Likewise.
+ * gcc.c-torture/execute/builtins/lib/strchr.c: Likewise.
+ * gcc.c-torture/execute/builtins/lib/strcmp.c: Likewise.
+ * gcc.c-torture/execute/builtins/lib/strcpy.c: Likewise.
+ * gcc.c-torture/execute/builtins/lib/strcspn.c: Likewise.
+ * gcc.c-torture/execute/builtins/lib/strlen.c: Likewise.
+ * gcc.c-torture/execute/builtins/lib/strncat.c: Likewise.
+ * gcc.c-torture/execute/builtins/lib/strncmp.c: Likewise.
+ * gcc.c-torture/execute/builtins/lib/strncpy.c: Likewise.
+ * gcc.c-torture/execute/builtins/lib/strpbrk.c: Likewise.
+ * gcc.c-torture/execute/builtins/lib/strrchr.c: Likewise.
+ * gcc.c-torture/execute/builtins/lib/strspn.c: Likewise.
+ * gcc.c-torture/execute/builtins/lib/strstr.c: Likewise.
+ * gcc.dg/20081223-1.c: New.
+ * gcc.dg/lto: New directory.
+ * gcc.dg/lto/20080908_0.c: New.
+ * gcc.dg/lto/20080917_0.c: New.
+ * gcc.dg/lto/20080924_0.c: New.
+ * gcc.dg/lto/20081024_0.c: New.
+ * gcc.dg/lto/20081109_0.c: New.
+ * gcc.dg/lto/20081111_0.c: New.
+ * gcc.dg/lto/20081111_1.c: New.
+ * gcc.dg/lto/20081112_0.c: New.
+ * gcc.dg/lto/20081112_1.c: New.
+ * gcc.dg/lto/20081115_0.c: New.
+ * gcc.dg/lto/20081115_1.c: New.
+ * gcc.dg/lto/20081115_2.c: New.
+ * gcc.dg/lto/20081118_0.c: New.
+ * gcc.dg/lto/20081118_1.c: New.
+ * gcc.dg/lto/20081118_2.c: New.
+ * gcc.dg/lto/20081120-1_0.c: New.
+ * gcc.dg/lto/20081120-1_1.c: New.
+ * gcc.dg/lto/20081120-2_0.c: New.
+ * gcc.dg/lto/20081120-2_1.c: New.
+ * gcc.dg/lto/20081125_0.c: New.
+ * gcc.dg/lto/20081125_1.c: New.
+ * gcc.dg/lto/20081126_0.c: New.
+ * gcc.dg/lto/20081201-1_0.c: New.
+ * gcc.dg/lto/20081201-1_1.c: New.
+ * gcc.dg/lto/20081201-1_2.c: New.
+ * gcc.dg/lto/20081201-2_0.c: New.
+ * gcc.dg/lto/20081201-2_1.c: New.
+ * gcc.dg/lto/20081202-1_0.c: New.
+ * gcc.dg/lto/20081202-1_1.c: New.
+ * gcc.dg/lto/20081202-2_0.c: New.
+ * gcc.dg/lto/20081202-2_1.c: New.
+ * gcc.dg/lto/20081204-1_0.c: New.
+ * gcc.dg/lto/20081204-1_1.c: New.
+ * gcc.dg/lto/20081204-2_0.c: New.
+ * gcc.dg/lto/20081210-1_0.c: New.
+ * gcc.dg/lto/20081212-1_0.c: New.
+ * gcc.dg/lto/20081222_0.c: New.
+ * gcc.dg/lto/20081222_0.h: New.
+ * gcc.dg/lto/20081222_1.c: New.
+ * gcc.dg/lto/20081224_0.c: New.
+ * gcc.dg/lto/20081224_0.h: New.
+ * gcc.dg/lto/20081224_1.c: New.
+ * gcc.dg/lto/20090116_0.c: New.
+ * gcc.dg/lto/20090120_0.c: New.
+ * gcc.dg/lto/20090126-1_0.c: New.
+ * gcc.dg/lto/20090126-2_0.c: New.
+ * gcc.dg/lto/20090206-1_0.c: New.
+ * gcc.dg/lto/20090206-2_0.c: New.
+ * gcc.dg/lto/20090210_0.c: New.
+ * gcc.dg/lto/20090210_1.c: New.
+ * gcc.dg/lto/20090213_0.c: New.
+ * gcc.dg/lto/20090213_1.c: New.
+ * gcc.dg/lto/20090218-1_0.c: New.
+ * gcc.dg/lto/20090218-1_1.c: New.
+ * gcc.dg/lto/20090218-2_0.c: New.
+ * gcc.dg/lto/20090218-2_1.c: New.
+ * gcc.dg/lto/20090218_0.c: New.
+ * gcc.dg/lto/20090218_1.c: New.
+ * gcc.dg/lto/20090218_2.c: New.
+ * gcc.dg/lto/20090218_3.c: New.
+ * gcc.dg/lto/20090219_0.c: New.
+ * gcc.dg/lto/20090312_0.c: New.
+ * gcc.dg/lto/20090312_1.c: New.
+ * gcc.dg/lto/20090313_0.c: New.
+ * gcc.dg/lto/20090706-1_0.c: New.
+ * gcc.dg/lto/20090706-2_0.c: New.
+ * gcc.dg/lto/20090717_0.c: New.
+ * gcc.dg/lto/20090717_1.c: New.
+ * gcc.dg/lto/20090729_0.c: New.
+ * gcc.dg/lto/20090729_1.c: New.
+ * gcc.dg/lto/20090812_0.c: New.
+ * gcc.dg/lto/20090812_1.c: New.
+ * gcc.dg/lto/20090914-1_0.c: New.
+ * gcc.dg/lto/README: New.
+ * gcc.dg/visibility-7.c: Adjust expected pattern
+ * gfortran.dg/lto: New directory.
+ * gfortran.dg/lto/pr40724_0.f: New.
+ * gfortran.dg/lto/pr40724_1.f: New.
+ * gfortran.dg/lto/pr40725_0.f03: New.
+ * gfortran.dg/lto/pr40725_1.c: New.
+ * gfortran.dg/lto/pr41069_0.f90: New.
+ * gfortran.dg/lto/pr41069_1.f90: New.
+ * gfortran.dg/lto/pr41069_2.f90: New.
+ * g++.dg/README: Add 'lto' directory.
+ * g++.dg/dg.exp: Also scan 'lto' directory
+
+2009-10-03 Ben Elliston <bje@au.ibm.com>
+ Janis Johnson <janis187@us.ibm.com>
+ Diego Novillo <dnovillo@google.com>
+
+ * g++.dg/lto/lto.exp: New.
+ * gcc.c-torture/execute/execute.exp: Add
+ LTO_TORTURE_OPTIONS TO C_TORTURE_OPTIONS.
+ * gcc.c-torture/execute/builtins/builtins.exp: Likewise.
+ * gcc.c-torture/execute/ieee/ieee.exp: Likewise.
+ * gcc.c-torture/unsorted/unsorted.exp: Likewise.
+ * gcc.target/i386/math-torture/math-torture.exp: Likewise.
+ * gcc.dg/lto/lto.exp: New.
+ * gfortran.dg/lto/lto.exp: New.
+ * lib/target-supports.exp (check_effective_target_lto): New.
+ * lib/c-torture.exp: Load target-supports.exp. Define
+ LTO_TORTURE_OPTIONS if check_effective_target_lto returns nonzero.
+ * lib/gcc-dg.exp: Likewise.
+ * lib/lto.exp: New.
+ * lib/torture-options.exp: Add support for a third argument.
+
+2009-10-03 Uros Bizjak <ubizjak@gmail.com>
+
+ PR testsuite/41542
+ * gcc.dg/tree-ssa/ipa-cp-1.c: Remove mis-merged garbage.
+
+2009-10-02 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/abi/mangle32.C: New.
+
2009-10-02 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/atomic2.adb: New test.
@@ -14,7 +1692,7 @@
2009-10-02 Jack Howarth <howarth@bromo.med.uc.edu>
- * gcc.dg/guality/guality.exp: Disable on darwin.
+ * gcc.dg/guality/guality.exp: Disable on darwin.
2009-10-02 Janis Johnson <janis187@us.ibm.com>
@@ -174,56 +1852,55 @@
2009-09-29 Harsha Jagasia <harsha.jagasia@amd.com>
- * gcc.target/i386/fma4-check.h
- * gcc.target/i386/fma4-fma.c
- * gcc.target/i386/fma4-maccXX.c
- * gcc.target/i386/fma4-msubXX.c
- * gcc.target/i386/fma4-nmaccXX.c
- * gcc.target/i386/fma4-nmsubXX.c
- * gcc.target/i386/fma4-vector.c
- * gcc.target/i386/fma4-256-maccXX.c
- * gcc.target/i386/fma4-256-msubXX.c
- * gcc.target/i386/fma4-256-nmaccXX.c
- * gcc.target/i386/fma4-256-nmsubXX.c
- * gcc.target/i386/fma4-256-vector.c
- * gcc.target/i386/funcspec-2.c: New file.
-
- * gcc.target/i386/funcspec-4.c: Test error conditions
- related to FMA4.
-
- * gcc.target/i386/funcspec-5.c
- * gcc.target/i386/funcspec-6.c
- * gcc.target/i386/funcspec-8.c: Add FMA4.
+ * gcc.target/i386/fma4-check.h: New file.
+ * gcc.target/i386/fma4-fma.c: Ditto.
+ * gcc.target/i386/fma4-maccXX.c: Ditto.
+ * gcc.target/i386/fma4-msubXX.c: Ditto.
+ * gcc.target/i386/fma4-nmaccXX.c: Ditto.
+ * gcc.target/i386/fma4-nmsubXX.c: Ditto.
+ * gcc.target/i386/fma4-vector.c: Ditto.
+ * gcc.target/i386/fma4-256-maccXX.c: Ditto.
+ * gcc.target/i386/fma4-256-msubXX.c: Ditto.
+ * gcc.target/i386/fma4-256-nmaccXX.c: Ditto.
+ * gcc.target/i386/fma4-256-nmsubXX.c: Ditto.
+ * gcc.target/i386/fma4-256-vector.c: Ditto.
+ * gcc.target/i386/funcspec-2.c: Ditto.
+
+ * gcc.target/i386/funcspec-4.c: Test error conditions related to FMA4.
+
+ * gcc.target/i386/funcspec-5.c: Add FMA4.
+ * gcc.target/i386/funcspec-6.c: Ditto.
+ * gcc.target/i386/funcspec-8.c: Ditto.
* gcc.target/i386/funcspec-9.c: New file.
* gcc.target/i386/i386.exp: Add check_effective_target_fma4.
- * gcc.target/i386/isa-10.c
- * gcc.target/i386/isa-11.c
- * gcc.target/i386/isa-12.c
- * gcc.target/i386/isa-13.c
- * gcc.target/i386/isa-2.c
- * gcc.target/i386/isa-3.c
- * gcc.target/i386/isa-4.c
- * gcc.target/i386/isa-7.c
- * gcc.target/i386/isa-8.c
- * gcc.target/i386/isa-9.c: New file.
-
- * gcc.target/i386/isa-14.c
- * gcc.target/i386/isa-1.c
- * gcc.target/i386/isa-5.c
- * gcc.target/i386/isa-6.c: Add FMA4.
-
- * gcc.target/i386/sse-12.c
- * gcc.target/i386/sse-13.c
- * gcc.target/i386/sse-14.c
- * gcc.target/i386/sse-22.c: New file.
-
- * g++.dg/other/i386-2.C
- * g++.dg/other/i386-3.C
- * g++.dg/other/i386-5.C
- * g++.dg/other/i386-6.C: Add -mfma4 in dg-options.
+ * gcc.target/i386/isa-10.c: New file.
+ * gcc.target/i386/isa-11.c: Ditto.
+ * gcc.target/i386/isa-12.c: Ditto.
+ * gcc.target/i386/isa-13.c: Ditto.
+ * gcc.target/i386/isa-2.c: Ditto.
+ * gcc.target/i386/isa-3.c: Ditto.
+ * gcc.target/i386/isa-4.c: Ditto.
+ * gcc.target/i386/isa-7.c: Ditto.
+ * gcc.target/i386/isa-8.c: Ditto.
+ * gcc.target/i386/isa-9.c: Ditto.
+
+ * gcc.target/i386/isa-14.c: Add FMA4.
+ * gcc.target/i386/isa-1.c: Ditto.
+ * gcc.target/i386/isa-5.c: Ditto.
+ * gcc.target/i386/isa-6.c: Ditto.
+
+ * gcc.target/i386/sse-12.c: New file.
+ * gcc.target/i386/sse-13.c: Ditto.
+ * gcc.target/i386/sse-14.c: Ditto.
+ * gcc.target/i386/sse-22.c: Ditto.
+
+ * g++.dg/other/i386-2.C: Add -mfma4 to dg-options.
+ * g++.dg/other/i386-3.C: Ditto.
+ * g++.dg/other/i386-5.C: Ditto.
+ * g++.dg/other/i386-6.C: Ditto.
2009-09-29 H.J. Lu <hongjiu.lu@intel.com>
@@ -246,13 +1923,14 @@
2009-09-29 Harsha Jagasia <harsha.jagasia@amd.com>
* gcc.target/i386/i386.exp: Remove check_effective_target_sse5.
- * gcc.target/i386/isa-1.c
- * gcc.target/i386/isa-5.c
- * gcc.target/i386/isa-6.c: Remove SSE5.
- * gcc.target/i386/funcspec-4.c: Remove error conditions related to SSE5.
- * gcc.target/i386/avx-1.c
- * gcc.target/i386/avx-2.c
- * gcc.target/i386/sse-23.c: Remove comments to mmintrin-common.h.
+ * gcc.target/i386/isa-1.c: Remove SSE5.
+ * gcc.target/i386/isa-5.c: Ditto.
+ * gcc.target/i386/isa-6.c: Ditto.
+ * gcc.target/i386/funcspec-4.c: Remove error conditions
+ related to SSE5.
+ * gcc.target/i386/avx-1.c: Remove comments to mmintrin-common.h.
+ * gcc.target/i386/avx-2.c: Ditto.
+ * gcc.target/i386/sse-23.c: Ditto.
* gcc.target/i386/funcspec-9.c: Delete.
2009-09-29 Jakub Jelinek <jakub@redhat.com>
@@ -319,7 +1997,7 @@
2009-09-27 Richard Henderson <rth@redhat.com>
* gcc.c-torture/compile/pr41469.c: Add -fexceptions.
- * testsuite/gcc.dg/tree-ssa/pr41469-1.c: New.
+ * gcc.dg/tree-ssa/pr41469-1.c: New.
2009-09-26 Andreas Schwab <schwab@linux-m68k.org>
@@ -2059,6 +3737,11 @@
2009-08-06 Richard Earnshaw <rearnsha@arm.com>
+ * lib/target-supports.exp (check_effective_target_arm_hard_vfp_ok): New
+ hook.
+ (check_effective_target_arm_neon_ok): Improve test for neon
+ availability.
+ * gcc.target/arm/eabi1.c: Only run test in base variant.
* gcc.target/arm/abitest.h: Allow the test function to have a PCS
attribute.
* gcc.target/arm/vfp1[567].c: New tests.
@@ -5109,7 +6792,7 @@
2009-05-12 David Billinghurst <billingd@gcc.gnu.org>
* lib/target-supports.exp (check_profiling_available): Return
- false for -p on *-*-cygwin* targets.
+ false for -p on *-*-cygwin* targets.
2009-05-11 H.J. Lu <hongjiu.lu@intel.com>
diff --git a/gcc/testsuite/ada/acats/norun.lst b/gcc/testsuite/ada/acats/norun.lst
index 8441024b241..c0b08e42c07 100644
--- a/gcc/testsuite/ada/acats/norun.lst
+++ b/gcc/testsuite/ada/acats/norun.lst
@@ -1,10 +1,2 @@
-c52103x
-c52104x
-c52104y
-cb1010a
-cb1010c
-cb1010d
templat
# Tests must be sorted in alphabetical order
-# c52103x, c52104x, c52104y: -fstack-check doesn't work, PR middle-end/20548
-# cb1010a, cb1010c, cb1010d: likewise
diff --git a/gcc/testsuite/ada/acats/run_acats b/gcc/testsuite/ada/acats/run_acats
index 05f3ff57df5..acb6ab57151 100755
--- a/gcc/testsuite/ada/acats/run_acats
+++ b/gcc/testsuite/ada/acats/run_acats
@@ -52,4 +52,7 @@ echo exec gnatmake '"$@"' >> host_gnatmake
chmod +x host_gnatmake
+# Limit the stack to 8MB for stack checking
+ulimit -s 8192
+
exec $testdir/run_all.sh ${1+"$@"}
diff --git a/gcc/testsuite/c-c++-common/builtin-offsetof.c b/gcc/testsuite/c-c++-common/builtin-offsetof.c
new file mode 100644
index 00000000000..6d97775467d
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/builtin-offsetof.c
@@ -0,0 +1,29 @@
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// Origin PR c++/38699
+// { dg-options "-Warray-bounds" }
+// { dg-do compile }
+
+struct A
+{
+ const char *p;
+};
+
+struct B
+{
+ char p[10];
+ struct A a;
+};
+
+void
+f0 ()
+{
+ __builtin_offsetof(struct A, p); // OK
+ __builtin_offsetof(struct A, p[0]); // { dg-error "non constant address" }
+ __builtin_offsetof(struct B, p[0]); // OK
+ __builtin_offsetof(struct B, p[9]); // OK
+ __builtin_offsetof(struct B, p[10]); // OK
+ __builtin_offsetof(struct B, p[11]); // { dg-warning "greater than size" }
+ __builtin_offsetof(struct B, a.p); // OK
+ __builtin_offsetof(struct B, p[0]); // OK
+ __builtin_offsetof(struct B, a.p[0]); // { dg-error "non constant address" }
+}
diff --git a/gcc/testsuite/c-c++-common/dfp/pr35620.c b/gcc/testsuite/c-c++-common/dfp/pr35620.c
index 37a9c4044ed..2d56ab76b84 100644
--- a/gcc/testsuite/c-c++-common/dfp/pr35620.c
+++ b/gcc/testsuite/c-c++-common/dfp/pr35620.c
@@ -9,7 +9,7 @@ extern void foo (_Decimal32);
_Decimal32 *p;
extern int i;
-union { _Decimal32 a; int b; } u;
+union U { _Decimal32 a; int b; } u;
void
blatz (void)
diff --git a/gcc/testsuite/c-c++-common/pr41935.c b/gcc/testsuite/c-c++-common/pr41935.c
new file mode 100644
index 00000000000..3279e75593d
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr41935.c
@@ -0,0 +1,70 @@
+/* { dg-options "-Warray-bounds" } */
+/* { dg-do compile } */
+
+struct A
+{
+ int i;
+ char p[1];
+};
+
+struct B
+{
+ struct A a;
+ int i;
+};
+
+struct C
+{
+ int i;
+ struct A a;
+};
+
+union D
+{
+ char p[1];
+ struct A a;
+ struct B b;
+ struct C c;
+};
+
+struct E
+{
+ int i;
+ union D d;
+};
+
+struct F
+{
+ union D d;
+ int i;
+};
+
+union G
+{
+ int i;
+ union D d;
+};
+
+void
+f0 ()
+{
+ __builtin_offsetof (struct A, p[4]); /* OK */
+ __builtin_offsetof (struct B, a.p[4]); /* { dg-warning "greater than size" } */
+ __builtin_offsetof (struct C, a.p[4]); /* OK */
+ __builtin_offsetof (union D, p[4]); /* OK */
+ __builtin_offsetof (union D, a.p[4]); /* OK */
+ __builtin_offsetof (union D, b.a.p[4]); /* { dg-warning "greater than size" } */
+ __builtin_offsetof (union D, c.a.p[4]); /* OK */
+ __builtin_offsetof (struct E, d.p[4]); /* OK */
+ __builtin_offsetof (struct E, d.a.p[4]); /* OK */
+ __builtin_offsetof (struct E, d.b.a.p[4]); /* { dg-warning "greater than size" } */
+ __builtin_offsetof (struct E, d.c.a.p[4]); /* OK */
+ __builtin_offsetof (struct F, d.p[4]); /* { dg-warning "greater than size" } */
+ __builtin_offsetof (struct F, d.a.p[4]); /* { dg-warning "greater than size" } */
+ __builtin_offsetof (struct F, d.b.a.p[4]); /* { dg-warning "greater than size" } */
+ __builtin_offsetof (struct F, d.c.a.p[4]); /* { dg-warning "greater than size" } */
+ __builtin_offsetof (union G, d.p[4]); /* OK */
+ __builtin_offsetof (union G, d.a.p[4]); /* OK */
+ __builtin_offsetof (union G, d.b.a.p[4]); /* { dg-warning "greater than size" } */
+ __builtin_offsetof (union G, d.c.a.p[4]); /* OK */
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/restrict-1.c b/gcc/testsuite/c-c++-common/restrict-1.c
index 08fc10f5609..08fc10f5609 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/restrict-1.c
+++ b/gcc/testsuite/c-c++-common/restrict-1.c
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/restrict-2.c b/gcc/testsuite/c-c++-common/restrict-2.c
index ec824653d5f..ec824653d5f 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/restrict-2.c
+++ b/gcc/testsuite/c-c++-common/restrict-2.c
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/restrict-4.c b/gcc/testsuite/c-c++-common/restrict-4.c
index 3a36def25cc..3a36def25cc 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/restrict-4.c
+++ b/gcc/testsuite/c-c++-common/restrict-4.c
diff --git a/gcc/testsuite/g++.dg/20090107-1.C b/gcc/testsuite/g++.dg/20090107-1.C
new file mode 100644
index 00000000000..7c50675dbe0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/20090107-1.C
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target lto } */
+/* { dg-options "-fwhopr -Wuninitialized -O1" } */
+
+template <typename T> struct Q1 { typedef int x; };
+template <typename T> struct Q2 {
+ typename Q1<T>::x f() {
+ int k;
+ return k; /* { dg-warning "'k' is used uninitialized in this function" } */
+ }
+};
+int foo() { return Q2<int>().f(); }
diff --git a/gcc/testsuite/g++.dg/20090121-1.C b/gcc/testsuite/g++.dg/20090121-1.C
new file mode 100644
index 00000000000..9dff0f87af3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/20090121-1.C
@@ -0,0 +1,19 @@
+// { dg-do compile }
+// { dg-require-effective-target lto }
+// { dg-options "-fwhopr -Wuninitialized -O2" }
+class A
+{
+private:
+ int y;
+
+public:
+ A () { int x; y = x + 1; } /* { dg-warning "'x' is used uninitialized in this function" } */
+ int get_y () { return y; }
+};
+
+int foo()
+{
+ A a;
+ return a.get_y ();
+}
+
diff --git a/gcc/testsuite/g++.dg/README b/gcc/testsuite/g++.dg/README
index cdf6b14aee6..fe308a54210 100644
--- a/gcc/testsuite/g++.dg/README
+++ b/gcc/testsuite/g++.dg/README
@@ -14,6 +14,7 @@ gcov Tests for GCOV (code coverage) support.
inherit Tests for inheritance -- virtual functions, multiple inheritance, etc.
init Tests for initialization semantics, constructors/destructors, etc.
lookup Tests for lookup semantics, namespaces, using, etc.
+lto Tests for Link Time Optimization.
opt Tests for fixes of bugs with particular optimizations.
overload Tests for overload resolution and conversions.
parse Tests for parsing.
diff --git a/gcc/testsuite/g++.dg/abi/mangle32.C b/gcc/testsuite/g++.dg/abi/mangle32.C
new file mode 100644
index 00000000000..244d07490f8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/mangle32.C
@@ -0,0 +1,44 @@
+// Testcase for mangling of unnamed types.
+
+// namespace-scope unnamed types have no linkage, so we only test that they
+// are distinct.
+
+// { dg-options -std=c++0x }
+
+typedef struct { } *A;
+typedef struct { } *B;
+
+void f(A) { }
+void f(B) { }
+
+struct C
+{
+ typedef struct { }* D;
+ typedef enum { }* E;
+};
+
+// { dg-final { scan-assembler "_Z2g1PN1CUt_E" } }
+void g1(C::D) { }
+// { dg-final { scan-assembler "_Z2g2PN1CUt0_E" } }
+void g2(C::E) { }
+
+template <class T>
+void h1(T t) { }
+
+template <class T>
+void h2(T t) { }
+
+inline void j()
+{
+ typedef enum { }* F;
+// { dg-final { scan-assembler "_Z2h1IPZ1jvEUt_EvT_" } }
+ h1(F());
+ typedef struct { }* G;
+// { dg-final { scan-assembler "_Z2h2IPZ1jvEUt0_EvT_" } }
+ h2(G());
+}
+
+int main()
+{
+ j();
+}
diff --git a/gcc/testsuite/g++.dg/abi/mangle33.C b/gcc/testsuite/g++.dg/abi/mangle33.C
new file mode 100644
index 00000000000..f0a4e5012d3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/mangle33.C
@@ -0,0 +1,19 @@
+// Testcase for mangling very long names.
+
+#define N \
+abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklm
+
+namespace N {
+ int i;
+}
+
+#undef N
+#define N \
+abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk
+
+namespace N {
+ int j;
+}
+
+// { dg-final { scan-assembler "_ZN4043abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklm1iE" } }
+// { dg-final { scan-assembler "_ZN4041abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk1jE" } }
diff --git a/gcc/testsuite/g++.dg/abi/mangle34.C b/gcc/testsuite/g++.dg/abi/mangle34.C
new file mode 100644
index 00000000000..08c3bc0a19b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/mangle34.C
@@ -0,0 +1,41 @@
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// Origin PR c++/40808
+// { dg-do compile }
+// This tests the mangling of empty template argument list in a template
+// id.
+// { dg-final { scan-assembler "_ZNK5DummyclI3GenEENT_3SigIE10ResultTypeERKS2_" } }
+
+
+struct Void {};
+
+template <class R> struct FunType {
+ typedef R ResultType;
+};
+
+struct WrongNumberOfSigArgs {};
+
+template <typename R> struct CFunType {
+ template <class Dummy1=Void, class Dummy2=Void> struct Sig : public
+FunType<WrongNumberOfSigArgs> {};
+ template <class Dummy> struct Sig<Void,Dummy> : public FunType<R> {};
+};
+
+struct Dummy {
+ template <typename F> typename F::template Sig<>::ResultType operator()(F
+const& f) const {
+ return typename F::template Sig<>::ResultType(0);
+ }
+};
+
+struct Gen: public CFunType<int> {
+ int operator()() const {return 0;}
+ Gen() {}
+};
+
+int myfunction() {
+ return Dummy()(Gen());
+}
+
+int main() {
+ myfunction();
+}
diff --git a/gcc/testsuite/g++.dg/abi/pragma-pack1.C b/gcc/testsuite/g++.dg/abi/pragma-pack1.C
new file mode 100644
index 00000000000..d90fc200cbf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/pragma-pack1.C
@@ -0,0 +1,37 @@
+// PR c++/7046
+
+extern "C" int printf (const char *, ...);
+
+#pragma pack(4)
+
+template <typename X >
+struct T
+{
+ char x1; /* Usually 3 padding bytes are added after x1 member. */
+ int x2;
+};
+
+template <class T>
+int f()
+{
+ struct A { char i1; int i2; };
+ return sizeof (A);
+}
+
+#pragma pack(1)
+template struct T<int>; /* T<int> is instantiated here */
+template int f<int>();
+
+#pragma pack(4)
+template struct T<float>; /* T<float> is instantiated here */
+template int f<double>();
+
+int main()
+{
+ printf("sizeof T<int> = %d\n", sizeof(T<int>));
+ printf("sizeof T<float> = %d\n", sizeof(T<float>));
+ printf("f<int>() = %d\n", f<int>());
+ printf("f<float>() = %d\n", f<float>());
+ return (sizeof(T<int>) != sizeof(T<float>)
+ || f<int>() != f<float>());
+}
diff --git a/gcc/testsuite/g++.dg/abi/regparm1.C b/gcc/testsuite/g++.dg/abi/regparm1.C
new file mode 100644
index 00000000000..a83c4777850
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/regparm1.C
@@ -0,0 +1,40 @@
+// PR c++/29911 (9381)
+// { dg-options -std=c++0x }
+// { dg-do run { target i?86-*-* x86_64-*-* } }
+
+extern "C" int printf(const char *, ...);
+
+void *save_this;
+int *save_addr1, *save_addr2;
+
+struct Base
+{
+ __attribute((regparm(3))) void
+ set(int *addr1, int *addr2)
+ {
+ if (this != save_this)
+ printf("error! this == %p, should be %p\n", this, save_this);
+ if (addr1 != save_addr1)
+ printf("error! addr1 == %p, should be %p\n", addr1, save_addr1);
+ if (addr2 != save_addr2)
+ printf("error! addr2 == %p, should be %p\n", addr2, save_addr1);
+ }
+};
+
+int main()
+{
+ void (__attribute((regparm(3))) Base::* pfm)(int *, int *) = &Base::set;
+ __typeof (&Base::set) pfm2 = &Base::set;
+ decltype (&Base::set) pfm3 = &Base::set;
+ auto pfm4 = &Base::set;
+
+ Base obj; save_this = &obj;
+ int x, y; save_addr1 = &x; save_addr2 = &y;
+
+ (obj.* pfm) (&x, &y);
+ (obj.* pfm2) (&x, &y);
+ (obj.* pfm3) (&x, &y);
+ (obj.* pfm4) (&x, &y);
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/abi/rtti3.C b/gcc/testsuite/g++.dg/abi/rtti3.C
index ee562adac59..c03e4611c0b 100644
--- a/gcc/testsuite/g++.dg/abi/rtti3.C
+++ b/gcc/testsuite/g++.dg/abi/rtti3.C
@@ -2,6 +2,7 @@
// necessarily the type info object
// { dg-require-weak "" }
+// { dg-skip-if "Linkonce not weak" { *-*-mingw* *-*-cygwin } { "*" } { "" } }
// { dg-final { scan-assembler ".weak\[ \t\]_?_ZTSPP1A" { target { ! { *-*-darwin* } } } } }
// { dg-final { scan-assembler-not ".weak\[ \t\]_?_ZTIPP1A" { target { ! { *-*-darwin* } } } } }
// { dg-final { scan-assembler ".weak_definition\[ \t\]_?_ZTSPP1A" { target { *-*-darwin* } } } }
diff --git a/gcc/testsuite/g++.dg/abi/thunk4.C b/gcc/testsuite/g++.dg/abi/thunk4.C
index 79af6624d56..fa5fbd43277 100644
--- a/gcc/testsuite/g++.dg/abi/thunk4.C
+++ b/gcc/testsuite/g++.dg/abi/thunk4.C
@@ -1,4 +1,5 @@
// { dg-require-weak "" }
+// { dg-skip-if "Linkonce not weak" { *-*-mingw* *-*-cygwin } { "*" } { "" } }
// { dg-final { scan-assembler ".weak\[ \t\]_?_ZThn._N7Derived3FooEv" { target { ! { *-*-darwin* } } } } }
// { dg-final { scan-assembler ".weak_definition\[ \t\]_?_ZThn._N7Derived3FooEv" { target { *-*-darwin* } } } }
diff --git a/gcc/testsuite/g++.dg/abi/thunk5.C b/gcc/testsuite/g++.dg/abi/thunk5.C
new file mode 100644
index 00000000000..15526bf9ee3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/thunk5.C
@@ -0,0 +1,13 @@
+// PR c++/35067
+// The thunks should be weak even on targets without one-only support.
+// { dg-require-weak "" }
+// { dg-final { scan-assembler "weak.*ZTv" } }
+
+struct A
+{
+ virtual ~A() { }
+};
+
+struct B: virtual A { };
+
+B b;
diff --git a/gcc/testsuite/g++.dg/cpp/ucn-1.C b/gcc/testsuite/g++.dg/cpp/ucn-1.C
new file mode 100644
index 00000000000..354e1d976b0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp/ucn-1.C
@@ -0,0 +1,13 @@
+// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html
+// { dg-options "-std=c++0x -fextended-identifiers" }
+
+int main()
+{
+ "\u0041"; // 'A' UCN is OK in string literal
+ '\u0041'; // also OK in character literal
+
+ int c\u0041c; // { dg-error "not valid in an identifier" }
+ int c\u0024c; // $ is OK; not part of basic source char set
+
+ U"\uD800"; // { dg-error "not a valid universal character" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/auto3.C b/gcc/testsuite/g++.dg/cpp0x/auto3.C
index 3cea856e601..f792c07b169 100644
--- a/gcc/testsuite/g++.dg/cpp0x/auto3.C
+++ b/gcc/testsuite/g++.dg/cpp0x/auto3.C
@@ -7,7 +7,7 @@ auto x; // { dg-error "auto" }
// If the type deduced for the template parameter U is not the same in each
// deduction, the program is ill-formed.
-auto i = 42, j = 42.0; // { dg-error "" "" { xfail *-*-* } }
+auto i = 42, j = 42.0; // { dg-error "auto" }
// New CWG issue
auto a[2] = { 1, 2 }; // { dg-error "auto" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype18.C b/gcc/testsuite/g++.dg/cpp0x/decltype18.C
new file mode 100644
index 00000000000..0d44586e9d2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype18.C
@@ -0,0 +1,5 @@
+// PR c++/37875
+// { dg-options "-std=c++0x" }
+
+template <typename> struct X {};
+X<decltype(1 > 2)> x;
diff --git a/gcc/testsuite/g++.dg/cpp0x/deduce.C b/gcc/testsuite/g++.dg/cpp0x/deduce.C
index 6bd05160898..635228cca08 100644
--- a/gcc/testsuite/g++.dg/cpp0x/deduce.C
+++ b/gcc/testsuite/g++.dg/cpp0x/deduce.C
@@ -5,7 +5,7 @@ template<typename T> struct same_type<T, T> {};
int lval_int;
int rval_int();
int const lval_const_int=0;
-int const rval_const_int();
+int const&& rval_const_int();
template <typename T> void deduce_lval_int(T && t)
{
diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted14.C b/gcc/testsuite/g++.dg/cpp0x/defaulted14.C
new file mode 100644
index 00000000000..235e646780a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/defaulted14.C
@@ -0,0 +1,18 @@
+// PR c++/39866
+// { dg-options "-std=c++0x" }
+
+struct A {
+ A& operator=(const A&) = delete; // { dg-bogus "" }
+
+ void operator=(int) {} // { dg-message "" }
+ void operator=(char) {} // { dg-message "" }
+};
+
+struct B {};
+
+int main()
+{
+ A a;
+ a = B(); // { dg-error "no match" }
+ a = 1.0; // { dg-error "ambiguous" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted15.C b/gcc/testsuite/g++.dg/cpp0x/defaulted15.C
new file mode 100644
index 00000000000..092b5605901
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/defaulted15.C
@@ -0,0 +1,43 @@
+// PR c++/38796
+// { dg-options -std=c++0x }
+
+struct A
+{
+ A (int);
+ A (const A& = 1) = default; // { dg-error "default argument" }
+ void operator= (const A&) = default; // { dg-error "defaulted|match" }
+};
+
+struct B
+{
+private:
+ B() = default; // { dg-error "access" }
+};
+
+struct C
+{
+protected:
+ ~C() = default; // { dg-error "access" }
+};
+
+struct D
+{
+private:
+ D& operator= (const D&) = default; // { dg-error "access" }
+};
+
+struct E
+{
+ explicit E (const E&) = default; // { dg-error "explicit" }
+};
+
+struct F
+{
+ F(F&) = default; // { dg-error "non-const" }
+};
+
+struct G: public F
+{
+ // Can't be const because F copy ctor isn't.
+ G(const G&) = default; // { dg-error "const" }
+};
diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted16.C b/gcc/testsuite/g++.dg/cpp0x/defaulted16.C
new file mode 100644
index 00000000000..741b43de27d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/defaulted16.C
@@ -0,0 +1,13 @@
+// Test that non-inline default causes the function to be defined even if
+// it isn't used.
+
+// { dg-options -std=c++0x }
+// { dg-final { scan-assembler "_ZN1AC1Ev" } }
+
+struct A
+{
+ A();
+};
+
+A::A() = default;
+
diff --git a/gcc/testsuite/g++.dg/cpp0x/explicit4.C b/gcc/testsuite/g++.dg/cpp0x/explicit4.C
new file mode 100644
index 00000000000..74726a99cad
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/explicit4.C
@@ -0,0 +1,17 @@
+// Negative explicit conv test.
+// { dg-options "-std=c++0x" }
+
+struct A {
+ A(const A&, int = 0); // { dg-message "candidates" }
+};
+struct B
+{
+ explicit operator A();
+};
+
+int main()
+{
+ B b;
+ (A(b)); // OK
+ (A(b,1)); // { dg-error "no match" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg1.C b/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg1.C
new file mode 100644
index 00000000000..25192ad8672
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg1.C
@@ -0,0 +1,7 @@
+// PR c++/37766
+// { dg-options -std=c++0x }
+
+int a = 1;
+template<int& b = a> void f() {
+ f<>();
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist25.C b/gcc/testsuite/g++.dg/cpp0x/initlist25.C
new file mode 100644
index 00000000000..8e5e0065cfc
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist25.C
@@ -0,0 +1,17 @@
+// PR c++/41754
+// { dg-options -std=c++0x }
+// { dg-do run }
+
+#include <map>
+#include <string>
+#include <iostream>
+
+using namespace std;
+
+int main()
+{
+ map<string, string> m;
+ m.insert({{"t", "t"}, {"y", "y"}});
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/inline-ns1.C b/gcc/testsuite/g++.dg/cpp0x/inline-ns1.C
new file mode 100644
index 00000000000..e422d8970f1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/inline-ns1.C
@@ -0,0 +1,12 @@
+// { dg-options -std=c++0x }
+// { dg-final { scan-assembler "_ZN1Q2V11fEv" } }
+// { dg-final { scan-assembler "_ZN1Q2V11iE" } }
+
+namespace Q {
+ inline namespace V1 {
+ extern int i;
+ void f();
+ }
+}
+int Q::i = 1;
+void Q::f() { }
diff --git a/gcc/testsuite/g++.dg/cpp0x/inline-ns2.C b/gcc/testsuite/g++.dg/cpp0x/inline-ns2.C
new file mode 100644
index 00000000000..03851725bbd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/inline-ns2.C
@@ -0,0 +1,25 @@
+// { dg-options -std=c++0x }
+
+namespace Q {
+ inline namespace V1 {
+ extern int i; // { dg-error "" }
+ extern int j; // { dg-error "" }
+ void f(); // { dg-error "" }
+ void g(); // { dg-error "" }
+ }
+ inline namespace V2 {
+ extern int j; // { dg-error "" }
+ void g(); // { dg-error "" }
+ }
+ extern int i; // { dg-error "" }
+ void f(); // { dg-error "" }
+ void h();
+}
+namespace R {
+ using namespace Q;
+}
+int Q::i = 1; // { dg-error "ambiguous" }
+int Q::j = 1; // { dg-error "ambiguous" }
+void Q::f() { } // { dg-error "ambiguous" }
+void Q::g() { } // { dg-error "ambiguous" }
+void R::h() { } // { dg-error "" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/inline-ns3.C b/gcc/testsuite/g++.dg/cpp0x/inline-ns3.C
new file mode 100644
index 00000000000..8981a57ac4c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/inline-ns3.C
@@ -0,0 +1,24 @@
+namespace C
+{
+ void f();
+}
+
+namespace B
+{
+ using namespace C;
+
+ inline namespace B1
+ {
+ void f();
+ }
+}
+
+namespace A
+{
+ using namespace B;
+}
+
+int main()
+{
+ A::f();
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const-neg.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const-neg.C
index f48c6c243d6..0e329e5e161 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const-neg.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const-neg.C
@@ -3,11 +3,11 @@
#include <cassert>
template<typename F>
-void call(const F& f) { f(); } // { dg-error "discards qualifiers" }
+void call(const F& f) { f(); }
int main() {
call([] () -> void {});
- call([] () mutable -> void {}); // { dg-message "" "`f' does not have const `operator()'" }
+ call([] () mutable -> void {}); // { dg-message "" "declared mutable" }
int i = -1;
call([&i] () -> void { i = 0; });
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv.C
new file mode 100644
index 00000000000..e308248b657
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv.C
@@ -0,0 +1,6 @@
+// { dg-options -std=c++0x }
+
+int main()
+{
+ void (*pfn)() = []{};
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-direct-init.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-direct-init.C
new file mode 100644
index 00000000000..bbc2a1ca52d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-direct-init.C
@@ -0,0 +1,14 @@
+// Test that capture by copy uses direct-initialization.
+// { dg-options "-std=c++0x" }
+
+struct A
+{
+ A();
+ explicit A(const A&);
+};
+
+int main()
+{
+ A a;
+ [a]{};
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-init.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-init.C
new file mode 100644
index 00000000000..03c94e95981
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-init.C
@@ -0,0 +1,8 @@
+// Test for the explicit initializer extension
+// { dg-options "-std=c++0x" }
+
+int main()
+{
+ int j = [i = 2]{sizeof(i); return i;}();
+ return (j != 2);
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C
index dc89d2388fb..aa7462b4fcf 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C
@@ -9,8 +9,8 @@ inline void g(int n) {
// The closure type is encoded as Z1giEUlvE_.
// The call operator of that type is _ZZ1giENKUlvE_clEv.
-// { dg-final { scan-assembler "_ZZ1giENKUlvE_clEv" } }
-// { dg-final { scan-assembler "weak\[ \t\]*_?_ZZ1giENKUlvE_clEv" { target { ! { *-*-darwin* } } } } }
+// { dg-final { scan-assembler "_ZZ1giENUlvE_clEv" } }
+// { dg-final { scan-assembler "weak\[ \t\]*_?_ZZ1giENUlvE_clEv" { target { ! { *-*-darwin* *-*-mingw* *-*-cygwin } } } } }
algo([=]{return n+bef();});
// The captured entities do not participate in <lambda-sig>
@@ -31,17 +31,17 @@ struct S {
void f(int =
// Type: ZN1S1fEiiEd0_UlvE_
// Operator: _ZZN1S1fEiiEd0_NKUlvE_clEv
-// { dg-final { scan-assembler "_ZZN1S1fEiiEd0_NKUlvE_clEv" } }
-// { dg-final { scan-assembler "weak\[ \t\]*_?_ZZN1S1fEiiEd0_NKUlvE_clEv" { target { ! { *-*-darwin* } } } } }
+// { dg-final { scan-assembler "_ZZN1S1fEiiEd0_NUlvE_clEv" } }
+// { dg-final { scan-assembler "weak\[ \t\]*_?_ZZN1S1fEiiEd0_NUlvE_clEv" { target { ! { *-*-darwin* *-*-mingw* *-*-cygwin } } } } }
[]{return 1;}()
// Type: ZN1S1fEiiEd0_UlvE0_
// Operator: _ZZN1S1fEiiEd0_NKUlvE0_clEv
-// { dg-final { scan-assembler "_ZZN1S1fEiiEd0_NKUlvE0_clEv" } }
+// { dg-final { scan-assembler "_ZZN1S1fEiiEd0_NUlvE0_clEv" } }
+ []{return 2;}(),
int =
// Type: ZN1S1fEiiEd_UlvE_
// Operator: _ZZN1S1fEiiEd_NKUlvE_clEv
-// { dg-final { scan-assembler "_ZZN1S1fEiiEd_NKUlvE_clEv" } }
+// { dg-final { scan-assembler "_ZZN1S1fEiiEd_NUlvE_clEv" } }
[]{return 3;}());
};
@@ -52,8 +52,8 @@ template<typename T> int R<T>::x = []{return 1;}();
template int R<int>::x;
// Type of lambda in intializer of R<int>::x: N1RIiE1xMUlvE_E
// Corresponding operator(): _ZNK1RIiE1xMUlvE_clEv
-// { dg-final { scan-assembler "_ZNK1RIiE1xMUlvE_clEv" } }
-// { dg-final { scan-assembler "weak\[ \t\]*_?_ZNK1RIiE1xMUlvE_clEv" } }
+// { dg-final { scan-assembler "_ZN1RIiE1xMUlvE_clEv" } }
+// { dg-final { scan-assembler "weak\[ \t\]*_?_ZN1RIiE1xMUlvE_clEv" { target { ! { *-*-mingw* *-*-cygwin } } } } }
void bar()
{
@@ -63,7 +63,7 @@ void bar()
}
// lambdas used in non-template, non-class body initializers are internal.
-// { dg-final { scan-assembler-not "weak\[^\n\r\]*_ZNKUlv" } }
+// { dg-final { scan-assembler-not "weak\[^\n\r\]*_ZNUlv" } }
// { dg-final { scan-assembler-not "weak\[^\n\r\]*variable" } }
int variable = []{return 1;}();
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested2.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested2.C
new file mode 100644
index 00000000000..b7887485595
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested2.C
@@ -0,0 +1,31 @@
+// Testcase from N2998
+// { dg-options -std=c++0x }
+
+void f1(int i) {
+ int const N = 20;
+ auto m1 = [=]{
+ int const M = 30;
+ auto m2 = [i]{
+ int x[N][M]; // OK: N and M are not "used"
+ x[0][0] = i; // OK: i is explicitly captured by m2
+ // and implicitly captured by m1
+ };
+ };
+ struct s1 {
+ int f;
+ int work(int n) {
+ int m = n*n;
+ int j = 40;
+ auto m3 = [this,m]{
+ /*auto m4=*/[&,j]{ // { dg-error "j. is not captured" }
+ int x = n; // { dg-error "n. is not captured" }
+ x += m; // OK: m implicitly captured by m4
+ // and explicitly captured by m3
+ x += i; // { dg-error "i. is not captured" }
+ x += f; // OK: this captured implicitly by m4
+ // and explicitly by m3
+ };
+ };
+ }
+ };
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-non-const.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-non-const.C
index 9c2b1195af3..9ff8c029d5c 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-non-const.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-non-const.C
@@ -8,7 +8,6 @@ void call(F f) { f(); }
int main() {
call([] () -> void {});
- call([] () mutable -> void {});
int i = -1;
call([i] () mutable -> void { i = 0; });
diff --git a/gcc/testsuite/g++.dg/other/linkage2.C b/gcc/testsuite/g++.dg/cpp0x/linkage2.C
index 4e3e6f1eab3..f41c21a7741 100644
--- a/gcc/testsuite/g++.dg/other/linkage2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/linkage2.C
@@ -4,6 +4,8 @@
// o the variable or function is not used (3.2 [basic.def.odr]) or is
// defined in the same translation unit.
+// { dg-options -std=c++0x }
+
template <typename T> struct B {
void g(T){}
void h(T); // { dg-error "never defined" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/nolinkage1.C b/gcc/testsuite/g++.dg/cpp0x/nolinkage1.C
index a31394b08ac..b69b6ddc4cf 100644
--- a/gcc/testsuite/g++.dg/cpp0x/nolinkage1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/nolinkage1.C
@@ -3,6 +3,7 @@
// { dg-additional-sources "nolinkage1a.cc" }
// { dg-do link }
+// { dg-options -std=c++0x }
#include "nolinkage1.h"
diff --git a/gcc/testsuite/g++.dg/cpp0x/rv-deduce.C b/gcc/testsuite/g++.dg/cpp0x/rv-deduce.C
new file mode 100644
index 00000000000..043543631ad
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/rv-deduce.C
@@ -0,0 +1,8 @@
+// PR c++/36816, core issue 873
+// { dg-options -std=c++0x }
+
+template <class T> void h (T&&) { }
+
+void (*pf)(int&) = &h;
+template <> void h(char&);
+template void h(double&);
diff --git a/gcc/testsuite/g++.dg/cpp0x/rv-reinterpret.C b/gcc/testsuite/g++.dg/cpp0x/rv-reinterpret.C
new file mode 100644
index 00000000000..5b6e4c3d126
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/rv-reinterpret.C
@@ -0,0 +1,11 @@
+// { dg-options -std=c++0x }
+// { dg-do run }
+
+void f(int &);
+void f(int &&ir) { ir = 42; }
+int main()
+{
+ int x;
+ f(reinterpret_cast<int&&>(x));
+ return (x != 42);
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/rv-return.C b/gcc/testsuite/g++.dg/cpp0x/rv-return.C
new file mode 100644
index 00000000000..e52101feae1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/rv-return.C
@@ -0,0 +1,18 @@
+// PR c++/41815
+// { dg-options -std=c++0x }
+
+template<typename T, typename U> struct same_type;
+template<typename T> struct same_type<T, T> {};
+
+int const f() { return 0; }
+
+int &&r = f(); // binding "int&&" to "int" should succeed
+same_type<decltype(f()), int const> s1;
+same_type<decltype(0,f()), int> s2;
+
+template <class T>
+T const g() { return 0; }
+
+int &&r2 = g<int>();
+same_type<decltype(g<int>()), int const> s3;
+same_type<decltype(0,g<int>()), int> s4;
diff --git a/gcc/testsuite/g++.dg/cpp0x/auto6.C b/gcc/testsuite/g++.dg/cpp0x/trailing1.C
index 11e73d2e716..11e73d2e716 100644
--- a/gcc/testsuite/g++.dg/cpp0x/auto6.C
+++ b/gcc/testsuite/g++.dg/cpp0x/trailing1.C
diff --git a/gcc/testsuite/g++.dg/cpp0x/auto8.C b/gcc/testsuite/g++.dg/cpp0x/trailing2.C
index e45204fe715..e45204fe715 100644
--- a/gcc/testsuite/g++.dg/cpp0x/auto8.C
+++ b/gcc/testsuite/g++.dg/cpp0x/trailing2.C
diff --git a/gcc/testsuite/g++.dg/cpp0x/auto12.C b/gcc/testsuite/g++.dg/cpp0x/trailing3.C
index 82d36f0d0d2..82d36f0d0d2 100644
--- a/gcc/testsuite/g++.dg/cpp0x/auto12.C
+++ b/gcc/testsuite/g++.dg/cpp0x/trailing3.C
diff --git a/gcc/testsuite/g++.dg/cpp0x/auto13.C b/gcc/testsuite/g++.dg/cpp0x/trailing4.C
index dc7e35aabaa..dc7e35aabaa 100644
--- a/gcc/testsuite/g++.dg/cpp0x/auto13.C
+++ b/gcc/testsuite/g++.dg/cpp0x/trailing4.C
diff --git a/gcc/testsuite/g++.dg/cpp0x/trailing5.C b/gcc/testsuite/g++.dg/cpp0x/trailing5.C
new file mode 100644
index 00000000000..b97d362be2f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/trailing5.C
@@ -0,0 +1,10 @@
+// PR c++/38798, DR 770
+// { dg-options -std=c++0x }
+
+struct A {};
+auto foo() -> struct A {}
+
+enum B {};
+auto bar() -> enum B {}
+
+auto baz() -> struct C {} {} // { dg-error "" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-throw.C b/gcc/testsuite/g++.dg/cpp0x/variadic-throw.C
index f2ff652d8a0..ee85bf2a569 100644
--- a/gcc/testsuite/g++.dg/cpp0x/variadic-throw.C
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic-throw.C
@@ -8,7 +8,7 @@ template<int M, int N> struct pair
template<int... M> struct S
{
- template<int... N> static int foo() throw (pair <M, N>...) // { dg-error "mismatched|no matching" }
+ template<int... N> static int foo() throw (pair <M, N>...) // { dg-error "mismatched" }
{
return 1;
}
@@ -21,5 +21,5 @@ int bar ()
int wibble()
{
- return S<0, 1, 2>::foo<0, 1> ();
+ return S<0, 1, 2>::foo<0, 1> (); // { dg-error "no matching" }
}
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic95.C b/gcc/testsuite/g++.dg/cpp0x/variadic95.C
new file mode 100644
index 00000000000..ebb04ebc10b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic95.C
@@ -0,0 +1,17 @@
+// PR c++/39863
+// { dg-options -std=c++0x }
+
+template <typename... T>
+struct A {};
+
+template <typename T, typename U>
+struct S {};
+
+template <typename... T, typename... U>
+A< S<T, U>... > f(U... u)
+{ return A< S<T, U>... >(); }
+
+int main()
+{
+ f<int>(0.0);
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic96.C b/gcc/testsuite/g++.dg/cpp0x/variadic96.C
new file mode 100644
index 00000000000..d4709d074b6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic96.C
@@ -0,0 +1,26 @@
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// Origin: PR c++/41785
+// { dg-options -std=c++0x }
+
+struct a {};
+
+template < typename T, typename ENCLOSING >
+struct base;
+
+template < typename... T >
+struct derived
+ : public base< T, derived< T... > >...
+{};
+
+template < typename... T>
+struct base< a, derived< T... > >
+{
+ typedef derived< T... >
+ Derived;
+};
+
+int main()
+{
+ derived< a > instance;
+}
+
diff --git a/gcc/testsuite/g++.dg/cpp0x/vt-40092.C b/gcc/testsuite/g++.dg/cpp0x/vt-40092.C
new file mode 100644
index 00000000000..063ed7e16eb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/vt-40092.C
@@ -0,0 +1,21 @@
+// { dg-do "compile" }
+// { dg-options "-std=c++0x" }
+
+template <typename... Types> struct package {};
+
+template <int ArgGen> struct wrapper_gen {};
+
+template <int ArgNest> struct wrapper_nest
+{
+ typedef wrapper_gen<ArgNest> type_nest;
+};
+
+template <int... ArgPack>
+struct wrapper_pack
+{
+ typedef package<wrapper_gen <ArgPack>...> type_pack;
+ // incorrect error: expansion pattern 'wrapper_gen<ArgNest>'
+ // contains no argument packs
+};
+
+
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/anonname1.C b/gcc/testsuite/g++.dg/debug/dwarf2/anonname1.C
new file mode 100644
index 00000000000..c9da2d69866
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/anonname1.C
@@ -0,0 +1,18 @@
+// PR debug/41828
+// { dg-do compile }
+// { dg-options "-gdwarf-2 -dA -std=c++0x" }
+// { dg-final { scan-assembler-not "<anonymous" } }
+// { dg-final { scan-assembler-not "\._\[0-9\]" } }
+// { dg-final { scan-assembler-not "\$_\[0-9\]" } }
+// { dg-final { scan-assembler-not "__anon_" } }
+
+struct
+{
+ union
+ {
+ struct
+ {
+ enum { a, b, c } x;
+ } s;
+ };
+} x;
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/icf.C b/gcc/testsuite/g++.dg/debug/dwarf2/icf.C
new file mode 100644
index 00000000000..627b8347797
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/icf.C
@@ -0,0 +1,50 @@
+// Test support for ICF debugging.
+// { dg-do compile }
+// { dg-options "-O0 -gdwarf-2 -fenable-icf-debug -dA" }
+
+class A
+{
+ public:
+ A();
+ virtual void work();
+ virtual int p();
+ private:
+ int i;
+};
+
+class B
+{
+ public:
+ B();
+ ~B();
+ void work(const A* a);
+ private:
+ int j;
+};
+
+int
+test1(A* a)
+{
+ a->work();
+}
+
+int
+test2(A* a)
+{
+ if (a->p())
+ {
+ B b;
+ b.work(a);
+ }
+}
+
+// Verify that we get .debug_dcall and .debug_vcall tables generated
+// and that we see entries for both virtual calls.
+// { dg-final { scan-assembler "\\.section.*\.debug_dcall" } }
+// { dg-final { scan-assembler "\\.section.*\.debug_vcall" } }
+// { dg-final { scan-assembler "New caller" } }
+// { dg-final { scan-assembler "Caller DIE offset" } }
+// { dg-final { scan-assembler "Point of call" } }
+// { dg-final { scan-assembler "Callee DIE offset" } }
+// { dg-final { scan-assembler "0x0.*Vtable slot" } }
+// { dg-final { scan-assembler "0x1.*Vtable slot" } }
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/template-params-7.C b/gcc/testsuite/g++.dg/debug/dwarf2/template-params-7.C
new file mode 100644
index 00000000000..d021d96f54f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/template-params-7.C
@@ -0,0 +1,21 @@
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// Origin PR debug/30161
+// { dg-options "-std=c++0x -g -dA -fno-merge-debug-strings" }
+
+// The type M<> should have one DW_TAG_GNU_template_parameter_pack DIE,
+// with no DW_AT_name attribute. We don't test the fact that it has no
+// DW_AT_name though.
+// { dg-final { scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_GNU_template_parameter_pack" 1 } }
+
+
+template <typename...>
+struct M
+{
+};
+
+struct R :
+ M<>
+{
+};
+
+R r;
diff --git a/gcc/testsuite/g++.dg/dg.exp b/gcc/testsuite/g++.dg/dg.exp
index af8c1475848..2642da12301 100644
--- a/gcc/testsuite/g++.dg/dg.exp
+++ b/gcc/testsuite/g++.dg/dg.exp
@@ -37,6 +37,7 @@ set tests [prune $tests $srcdir/$subdir/compat/*]
set tests [prune $tests $srcdir/$subdir/debug/*]
set tests [prune $tests $srcdir/$subdir/dfp/*]
set tests [prune $tests $srcdir/$subdir/gcov/*]
+set tests [prune $tests $srcdir/$subdir/lto/*]
set tests [prune $tests $srcdir/$subdir/pch/*]
set tests [prune $tests $srcdir/$subdir/plugin/*]
set tests [prune $tests $srcdir/$subdir/special/*]
diff --git a/gcc/testsuite/g++.dg/eh/pr41819.C b/gcc/testsuite/g++.dg/eh/pr41819.C
new file mode 100644
index 00000000000..07894a29953
--- /dev/null
+++ b/gcc/testsuite/g++.dg/eh/pr41819.C
@@ -0,0 +1,21 @@
+// { dg-do compile }
+// { dg-options "-fno-exceptions" }
+
+struct S { ~S(); };
+extern void bar();
+
+void f0()
+{
+ S s;
+ bar();
+}
+
+void f1()
+{
+ try {} catch (...) {} // { dg-error "" }
+}
+
+void f2() throw(int)
+{
+ bar();
+}
diff --git a/gcc/testsuite/g++.dg/ext/altivec-2.C b/gcc/testsuite/g++.dg/ext/altivec-2.C
index 299693694f6..1185a79e5ec 100644
--- a/gcc/testsuite/g++.dg/ext/altivec-2.C
+++ b/gcc/testsuite/g++.dg/ext/altivec-2.C
@@ -7,6 +7,8 @@
#include <altivec.h>
+vector unsigned char use_lvsl;
+
int main (int argc, const char * argv[])
{
int i = 0;
@@ -17,7 +19,7 @@ int main (int argc, const char * argv[])
vec_dst(&cv, i, 0);
v = vec_ld(0, &cv);
v = vec_lde(0, &cf);
- vec_lvsl(0, &cf);
+ use_lvsl = vec_lvsl(0, &cf);
return 0;
}
diff --git a/gcc/testsuite/g++.dg/ext/always_inline-5.C b/gcc/testsuite/g++.dg/ext/always_inline-5.C
new file mode 100644
index 00000000000..73caa094f47
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/always_inline-5.C
@@ -0,0 +1,28 @@
+// { dg-do compile }
+struct f
+{
+ inline f(void);
+ inline void f1(void);
+ int a;
+};
+
+inline __attribute__((always_inline)) f::f(void)
+{
+ a++;
+}
+
+inline __attribute__((always_inline)) void f::f1(void)
+{
+ a++;
+}
+
+void g(void)
+{
+ f a, b, c, d;
+ a.f1();
+}
+
+// f::f() should be inlined even at -O0
+// { dg-final { scan-assembler-not "_ZN1fC1Ev" } }
+// Likewise for f::f1()
+// { dg-final { scan-assembler-not "_ZN1f2f1Ev" } }
diff --git a/gcc/testsuite/g++.dg/ext/anon-struct4.C b/gcc/testsuite/g++.dg/ext/anon-struct4.C
index 53302d84b79..4f0fcd12b77 100644
--- a/gcc/testsuite/g++.dg/ext/anon-struct4.C
+++ b/gcc/testsuite/g++.dg/ext/anon-struct4.C
@@ -1,3 +1,4 @@
// PR c++/14401
struct { struct { int& i ; } bar ; } foo ; // { dg-error "uninitialized" "uninit" }
+// { dg-warning "anonymous" "anon" { target *-*-* } 3 }
diff --git a/gcc/testsuite/g++.dg/ext/raw-string-1.C b/gcc/testsuite/g++.dg/ext/raw-string-1.C
new file mode 100644
index 00000000000..0e8abf8b498
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/raw-string-1.C
@@ -0,0 +1,96 @@
+// { dg-do run }
+// { dg-options "-std=c++0x" }
+
+const char s0[] = R"[a\
+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
+c]";
+const char s1[] = "a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
+const char s2[] = R"*|*[a\
+b
+c]"
+c]*|"
+c]*|*";
+const char s3[] = "ab\nc]\"\nc]*|\"\nc";
+
+const char t0[] = u8R"[a\
+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
+c]";
+const char t1[] = u8"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
+const char t2[] = u8R"*|*[a\
+b
+c]"
+c]*|"
+c]*|*";
+const char t3[] = u8"ab\nc]\"\nc]*|\"\nc";
+
+const char16_t u0[] = uR"[a\
+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
+c]";
+const char16_t u1[] = u"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
+const char16_t u2[] = uR"*|*[a\
+b
+c]"
+c]*|"
+c]*|*";
+const char16_t u3[] = u"ab\nc]\"\nc]*|\"\nc";
+
+const char32_t U0[] = UR"[a\
+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
+c]";
+const char32_t U1[] = U"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
+const char32_t U2[] = UR"*|*[a\
+b
+c]"
+c]*|"
+c]*|*";
+const char32_t U3[] = U"ab\nc]\"\nc]*|\"\nc";
+
+const wchar_t L0[] = LR"[a\
+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
+c]";
+const wchar_t L1[] = L"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
+const wchar_t L2[] = LR"*|*[a\
+b
+c]"
+c]*|"
+c]*|*";
+const wchar_t L3[] = L"ab\nc]\"\nc]*|\"\nc";
+
+int
+main (void)
+{
+ if (sizeof (s0) != sizeof (s1)
+ || __builtin_memcmp (s0, s1, sizeof (s0)) != 0)
+ __builtin_abort ();
+ if (sizeof (s2) != sizeof (s3)
+ || __builtin_memcmp (s2, s3, sizeof (s2)) != 0)
+ __builtin_abort ();
+ if (sizeof (t0) != sizeof (t1)
+ || __builtin_memcmp (t0, t1, sizeof (t0)) != 0)
+ __builtin_abort ();
+ if (sizeof (t2) != sizeof (t3)
+ || __builtin_memcmp (t2, t3, sizeof (t2)) != 0)
+ __builtin_abort ();
+ if (sizeof (u0) != sizeof (u1)
+ || __builtin_memcmp (u0, u1, sizeof (u0)) != 0)
+ __builtin_abort ();
+ if (sizeof (u2) != sizeof (u3)
+ || __builtin_memcmp (u2, u3, sizeof (u2)) != 0)
+ __builtin_abort ();
+ if (sizeof (U0) != sizeof (U1)
+ || __builtin_memcmp (U0, U1, sizeof (U0)) != 0)
+ __builtin_abort ();
+ if (sizeof (U2) != sizeof (U3)
+ || __builtin_memcmp (U2, U3, sizeof (U2)) != 0)
+ __builtin_abort ();
+ if (sizeof (L0) != sizeof (L1)
+ || __builtin_memcmp (L0, L1, sizeof (L0)) != 0)
+ __builtin_abort ();
+ if (sizeof (L2) != sizeof (L3)
+ || __builtin_memcmp (L2, L3, sizeof (L2)) != 0)
+ __builtin_abort ();
+ if (sizeof (R"*[]*") != 1
+ || __builtin_memcmp (R"*[]*", "", 1) != 0)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/ext/raw-string-2.C b/gcc/testsuite/g++.dg/ext/raw-string-2.C
new file mode 100644
index 00000000000..c7eb602afec
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/raw-string-2.C
@@ -0,0 +1,104 @@
+// { dg-do run }
+// { dg-options "-std=c++0x" }
+
+#define R
+#define u
+#define uR
+#define U
+#define UR
+#define u8
+#define u8R
+#define L
+#define LR
+
+const char s00[] = R"[a]" "[b]";
+const char s01[] = "[a]" R"*[b]*";
+const char s02[] = R"[a]" R"[b]";
+const char s03[] = R"-[a]-" u8"[b]";
+const char s04[] = "[a]" u8R"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ";
+const char s05[] = R"[a]" u8R"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL";
+const char s06[] = u8R";([a];(" "[b]";
+const char s07[] = u8"[a]" R"[b]";
+const char s08[] = u8R"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-";
+const char s09[] = u8R"/^&|~!=,"'\[a]/^&|~!=,"'\" u8"[b]";
+const char s10[] = u8"[a]" u8R"0123456789abcdef[b]0123456789abcdef";
+const char s11[] = u8R"ghijklmnopqrstuv[a]ghijklmnopqrstuv" u8R"w[b]w";
+
+const char16_t u03[] = R"-[a]-" u"[b]";
+const char16_t u04[] = "[a]" uR"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ";
+const char16_t u05[] = R"[a]" uR"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL";
+const char16_t u06[] = uR";([a];(" "[b]";
+const char16_t u07[] = u"[a]" R"[b]";
+const char16_t u08[] = uR"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-";
+const char16_t u09[] = uR"/^&|~!=,"'\[a]/^&|~!=,"'\" u"[b]";
+const char16_t u10[] = u"[a]" uR"0123456789abcdef[b]0123456789abcdef";
+const char16_t u11[] = uR"ghijklmnopqrstuv[a]ghijklmnopqrstuv" uR"w[b]w";
+
+const char32_t U03[] = R"-[a]-" U"[b]";
+const char32_t U04[] = "[a]" UR"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ";
+const char32_t U05[] = R"[a]" UR"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL";
+const char32_t U06[] = UR";([a];(" "[b]";
+const char32_t U07[] = U"[a]" R"[b]";
+const char32_t U08[] = UR"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-";
+const char32_t U09[] = UR"/^&|~!=,"'\[a]/^&|~!=,"'\" U"[b]";
+const char32_t U10[] = U"[a]" UR"0123456789abcdef[b]0123456789abcdef";
+const char32_t U11[] = UR"ghijklmnopqrstuv[a]ghijklmnopqrstuv" UR"w[b]w";
+
+const wchar_t L03[] = R"-[a]-" L"[b]";
+const wchar_t L04[] = "[a]" LR"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ";
+const wchar_t L05[] = R"[a]" LR"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL";
+const wchar_t L06[] = LR";([a];(" "[b]";
+const wchar_t L07[] = L"[a]" R"[b]";
+const wchar_t L08[] = LR"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-";
+const wchar_t L09[] = LR"/^&|~!=,"'\[a]/^&|~!=,"'\" L"[b]";
+const wchar_t L10[] = L"[a]" LR"0123456789abcdef[b]0123456789abcdef";
+const wchar_t L11[] = LR"ghijklmnopqrstuv[a]ghijklmnopqrstuv" LR"w[b]w";
+
+int
+main (void)
+{
+#define TEST(str, val) \
+ if (sizeof (str) != sizeof (val) \
+ || __builtin_memcmp (str, val, sizeof (str)) != 0) \
+ __builtin_abort ()
+ TEST (s00, "a[b]");
+ TEST (s01, "[a]b");
+ TEST (s02, "ab");
+ TEST (s03, "a[b]");
+ TEST (s04, "[a]b");
+ TEST (s05, "ab");
+ TEST (s06, "a[b]");
+ TEST (s07, "[a]b");
+ TEST (s08, "ab");
+ TEST (s09, "a[b]");
+ TEST (s10, "[a]b");
+ TEST (s11, "ab");
+ TEST (u03, u"a[b]");
+ TEST (u04, u"[a]b");
+ TEST (u05, u"ab");
+ TEST (u06, u"a[b]");
+ TEST (u07, u"[a]b");
+ TEST (u08, u"ab");
+ TEST (u09, u"a[b]");
+ TEST (u10, u"[a]b");
+ TEST (u11, u"ab");
+ TEST (U03, U"a[b]");
+ TEST (U04, U"[a]b");
+ TEST (U05, U"ab");
+ TEST (U06, U"a[b]");
+ TEST (U07, U"[a]b");
+ TEST (U08, U"ab");
+ TEST (U09, U"a[b]");
+ TEST (U10, U"[a]b");
+ TEST (U11, U"ab");
+ TEST (L03, L"a[b]");
+ TEST (L04, L"[a]b");
+ TEST (L05, L"ab");
+ TEST (L06, L"a[b]");
+ TEST (L07, L"[a]b");
+ TEST (L08, L"ab");
+ TEST (L09, L"a[b]");
+ TEST (L10, L"[a]b");
+ TEST (L11, L"ab");
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/ext/raw-string-3.C b/gcc/testsuite/g++.dg/ext/raw-string-3.C
new file mode 100644
index 00000000000..46c48620905
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/raw-string-3.C
@@ -0,0 +1,58 @@
+// If c++98, the {,u,u8,U,L}R prefix should be parsed as separate
+// token.
+// { dg-do compile }
+// { dg-options "-std=c++98" }
+
+const void *s0 = R"[a]"; // { dg-error "was not declared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 6 }
+const void *s1 = uR"[a]"; // { dg-error "was not declared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 8 }
+const void *s2 = UR"[a]"; // { dg-error "was not declared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 10 }
+const void *s3 = u8R"[a]"; // { dg-error "was not declared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 12 }
+const void *s4 = LR"[a]"; // { dg-error "was not declared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 14 }
+
+const int i0 = R'a'; // { dg-error "was not declared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 17 }
+const int i1 = uR'a'; // { dg-error "was not declared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 19 }
+const int i2 = UR'a'; // { dg-error "was not declared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 21 }
+const int i3 = u8R'a'; // { dg-error "was not declared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 23 }
+const int i4 = LR'a'; // { dg-error "was not declared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 25 }
+
+#define R "a"
+#define uR "b"
+#define UR "c"
+#define u8R "d"
+#define LR "e"
+
+const void *s5 = R"[a]";
+const void *s6 = uR"[a]";
+const void *s7 = UR"[a]";
+const void *s8 = u8R"[a]";
+const void *s9 = LR"[a]";
+
+#undef R
+#undef uR
+#undef UR
+#undef u8R
+#undef LR
+
+#define R 1 +
+#define uR 2 +
+#define UR 3 +
+#define u8R 4 +
+#define LR 5 +
+
+const int i5 = R'a';
+const int i6 = uR'a';
+const int i7 = UR'a';
+const int i8 = u8R'a';
+const int i9 = LR'a';
+
+int main () {}
diff --git a/gcc/testsuite/g++.dg/ext/raw-string-4.C b/gcc/testsuite/g++.dg/ext/raw-string-4.C
new file mode 100644
index 00000000000..03179befac8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/raw-string-4.C
@@ -0,0 +1,28 @@
+// R is not applicable for character literals.
+// { dg-do compile }
+// { dg-options "-std=c++0x" }
+
+const int i0 = R'a'; // { dg-error "was not declared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 5 }
+const int i1 = uR'a'; // { dg-error "was not declared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 7 }
+const int i2 = UR'a'; // { dg-error "was not declared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 9 }
+const int i3 = u8R'a'; // { dg-error "was not declared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 11 }
+const int i4 = LR'a'; // { dg-error "was not declared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 13 }
+
+#define R 1 +
+#define uR 2 +
+#define UR 3 +
+#define u8R 4 +
+#define LR 5 +
+
+const int i5 = R'a';
+const int i6 = uR'a';
+const int i7 = UR'a';
+const int i8 = u8R'a';
+const int i9 = LR'a';
+
+int main () {}
diff --git a/gcc/testsuite/g++.dg/ext/raw-string-5.C b/gcc/testsuite/g++.dg/ext/raw-string-5.C
new file mode 100644
index 00000000000..b815eb23b16
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/raw-string-5.C
@@ -0,0 +1,23 @@
+// { dg-do compile }
+// { dg-options "-std=c++0x" }
+
+const void *s0 = R"0123456789abcdefg[]0123456789abcdefg";
+ // { dg-error "raw string delimiter longer" "" { target *-*-* } 4 }
+ // { dg-error "stray" "" { target *-*-* } 4 }
+const void *s1 = R" [] ";
+ // { dg-error "invalid character" "" { target *-*-* } 7 }
+ // { dg-error "stray" "" { target *-*-* } 7 }
+const void *s2 = R" [] ";
+ // { dg-error "invalid character" "" { target *-*-* } 10 }
+ // { dg-error "stray" "" { target *-*-* } 10 }
+const void *s3 = R"][]]";
+ // { dg-error "invalid character" "" { target *-*-* } 13 }
+ // { dg-error "stray" "" { target *-*-* } 13 }
+const void *s4 = R"@[]@";
+ // { dg-error "invalid character" "" { target *-*-* } 16 }
+ // { dg-error "stray" "" { target *-*-* } 16 }
+const void *s5 = R"$[]$";
+ // { dg-error "invalid character" "" { target *-*-* } 19 }
+ // { dg-error "stray" "" { target *-*-* } 19 }
+
+int main () {}
diff --git a/gcc/testsuite/g++.dg/ext/raw-string-6.C b/gcc/testsuite/g++.dg/ext/raw-string-6.C
new file mode 100644
index 00000000000..a97d95d5693
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/raw-string-6.C
@@ -0,0 +1,5 @@
+// { dg-do compile }
+// { dg-options "-std=c++0x" }
+
+const void *s0 = R"ouch[]ouCh"; // { dg-error "at end of input" }
+ // { dg-error "unterminated raw string" "" { target *-*-* } 4 }
diff --git a/gcc/testsuite/g++.dg/ext/raw-string-7.C b/gcc/testsuite/g++.dg/ext/raw-string-7.C
new file mode 100644
index 00000000000..0f479193433
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/raw-string-7.C
@@ -0,0 +1,23 @@
+// The trailing whitespace after \ and before newline extension
+// breaks full compliance for raw strings.
+// { dg-do run { xfail *-*-* } }
+// { dg-options "-std=c++0x" }
+
+// Note, there is a single space after \ on the following line.
+const char *s0 = R"[\
+]";
+// { dg-bogus "backslash and newline separated by space" "" { xfail *-*-* } 7 }
+
+// Note, there is a single tab after \ on the following line.
+const char *s1 = R"[\
+]";
+// { dg-bogus "backslash and newline separated by space" "" { xfail *-*-* } 12 }
+
+int
+main (void)
+{
+ if (__builtin_strcmp (s0, "\\ \n") != 0
+ || __builtin_strcmp (s1, "\\\t\n") != 0)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/ext/sync-3.C b/gcc/testsuite/g++.dg/ext/sync-3.C
new file mode 100644
index 00000000000..99faac7bc55
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/sync-3.C
@@ -0,0 +1,21 @@
+// PR debug/41801
+// { dg-do compile }
+// { dg-options "-O2 -g" }
+
+struct T
+{
+ void
+ foo () volatile
+ {
+ __sync_lock_release (&t);
+ __sync_synchronize ();
+ }
+ bool t;
+};
+
+int
+main ()
+{
+ T t = { false };
+ t.foo ();
+}
diff --git a/gcc/testsuite/g++.dg/ext/utf-badconcat2.C b/gcc/testsuite/g++.dg/ext/utf-badconcat2.C
new file mode 100644
index 00000000000..499b323fc19
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/utf-badconcat2.C
@@ -0,0 +1,15 @@
+// Test unsupported concatenation of UTF-8 string literals.
+// { dg-do compile }
+// { dg-options "-std=c++0x" }
+
+const void *s0 = u8"a" "b";
+const void *s1 = "a" u8"b";
+const void *s2 = u8"a" u8"b";
+const void *s3 = u8"a" u"b"; // { dg-error "non-standard concatenation" }
+const void *s4 = u"a" u8"b"; // { dg-error "non-standard concatenation" }
+const void *s5 = u8"a" U"b"; // { dg-error "non-standard concatenation" }
+const void *s6 = U"a" u8"b"; // { dg-error "non-standard concatenation" }
+const void *s7 = u8"a" L"b"; // { dg-error "non-standard concatenation" }
+const void *s8 = L"a" u8"b"; // { dg-error "non-standard concatenation" }
+
+int main () {}
diff --git a/gcc/testsuite/g++.dg/ext/utf-dflt2.C b/gcc/testsuite/g++.dg/ext/utf-dflt2.C
new file mode 100644
index 00000000000..fd2222f672e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/utf-dflt2.C
@@ -0,0 +1,12 @@
+// In C++0x, the u8 prefix should be parsed as separate tokens.
+// { dg-do compile }
+// { dg-options "-std=c++98" }
+
+const void *s0 = u8"a"; // { dg-error "was not declared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 5 }
+
+#define u8 "a"
+
+const void *s1 = u8"a";
+
+int main () {}
diff --git a/gcc/testsuite/g++.dg/ext/utf8-1.C b/gcc/testsuite/g++.dg/ext/utf8-1.C
new file mode 100644
index 00000000000..203b326af79
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/utf8-1.C
@@ -0,0 +1,45 @@
+// { dg-do run }
+// { dg-require-iconv "ISO-8859-2" }
+// { dg-options "-std=c++0x -fexec-charset=ISO-8859-2" }
+
+const char *str1 = "h\u00e1\U0000010Dky ";
+const char *str2 = "\u010d\u00E1rky\n";
+const char *str3 = u8"h\u00e1\U0000010Dky ";
+const char *str4 = u8"\u010d\u00E1rky\n";
+const char *str5 = "h\u00e1\U0000010Dky " "\u010d\u00E1rky\n";
+const char *str6 = u8"h\u00e1\U0000010Dky " "\u010d\u00E1rky\n";
+const char *str7 = "h\u00e1\U0000010Dky " u8"\u010d\u00E1rky\n";
+#define u8
+const char *str8 = u8"h\u00e1\U0000010Dky " u8"\u010d\u00E1rky\n";
+
+const char latin2_1[] = "\x68\xe1\xe8\x6b\x79\x20";
+const char latin2_2[] = "\xe8\xe1\x72\x6b\x79\n";
+const char utf8_1[] = "\x68\xc3\xa1\xc4\x8d\x6b\x79\x20";
+const char utf8_2[] = "\xc4\x8d\xc3\xa1\x72\x6b\x79\n";
+
+int
+main (void)
+{
+ if (__builtin_strcmp (str1, latin2_1) != 0
+ || __builtin_strcmp (str2, latin2_2) != 0
+ || __builtin_strcmp (str3, utf8_1) != 0
+ || __builtin_strcmp (str4, utf8_2) != 0
+ || __builtin_strncmp (str5, latin2_1, sizeof (latin2_1) - 1) != 0
+ || __builtin_strcmp (str5 + sizeof (latin2_1) - 1, latin2_2) != 0
+ || __builtin_strncmp (str6, utf8_1, sizeof (utf8_1) - 1) != 0
+ || __builtin_strcmp (str6 + sizeof (utf8_1) - 1, utf8_2) != 0
+ || __builtin_strncmp (str7, utf8_1, sizeof (utf8_1) - 1) != 0
+ || __builtin_strcmp (str7 + sizeof (utf8_1) - 1, utf8_2) != 0
+ || __builtin_strncmp (str8, utf8_1, sizeof (utf8_1) - 1) != 0
+ || __builtin_strcmp (str8 + sizeof (utf8_1) - 1, utf8_2) != 0)
+ __builtin_abort ();
+ if (sizeof ("a" u8"b"[0]) != 1
+ || sizeof (u8"a" "b"[0]) != 1
+ || sizeof (u8"a" u8"b"[0]) != 1
+ || sizeof ("a" "\u010d") != 3
+ || sizeof ("a" u8"\u010d") != 4
+ || sizeof (u8"a" "\u010d") != 4
+ || sizeof (u8"a" "\u010d") != 4)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/ext/utf8-2.C b/gcc/testsuite/g++.dg/ext/utf8-2.C
new file mode 100644
index 00000000000..417a8bfdc1e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/utf8-2.C
@@ -0,0 +1,21 @@
+// { dg-do compile }
+// { dg-options "-std=c++0x" }
+
+const char s0[] = u8"ab";
+const char16_t s1[] = u8"ab"; // { dg-error "from non-wide" }
+const char32_t s2[] = u8"ab"; // { dg-error "from non-wide" }
+const wchar_t s3[] = u8"ab"; // { dg-error "from non-wide" }
+
+const char t0[0] = u8"ab"; // { dg-error "chars is too long" }
+const char t1[1] = u8"ab"; // { dg-error "chars is too long" }
+const char t2[2] = u8"ab"; // { dg-error "chars is too long" }
+const char t3[3] = u8"ab";
+const char t4[4] = u8"ab";
+
+const char u0[0] = u8"\u2160."; // { dg-error "chars is too long" }
+const char u1[1] = u8"\u2160."; // { dg-error "chars is too long" }
+const char u2[2] = u8"\u2160."; // { dg-error "chars is too long" }
+const char u3[3] = u8"\u2160."; // { dg-error "chars is too long" }
+const char u4[4] = u8"\u2160."; // { dg-error "chars is too long" }
+const char u5[5] = u8"\u2160.";
+const char u6[6] = u8"\u2160.";
diff --git a/gcc/testsuite/g++.dg/ext/visibility/namespace3.C b/gcc/testsuite/g++.dg/ext/visibility/namespace3.C
new file mode 100644
index 00000000000..a07abdcd89a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/visibility/namespace3.C
@@ -0,0 +1,6 @@
+// PR c++/41774
+// { dg-do compile }
+
+namespace std __attribute__ ((__visibility__ ("default"))) {
+#pragma GCC visibility pop // { dg-warning "no matching push for" }
+}
diff --git a/gcc/testsuite/g++.dg/gomp/pr41967.C b/gcc/testsuite/g++.dg/gomp/pr41967.C
new file mode 100644
index 00000000000..0eb489e8bee
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/pr41967.C
@@ -0,0 +1,17 @@
+// PR c++/41967
+// { dg-do compile }
+// { dg-options "-fopenmp" }
+
+int
+foo ()
+{
+ int sum = 0;
+#pragma omp for collapse(2)
+ for (int i = 0; i < 5; ++i)
+ {
+ for (int j = 0; j < 5; ++j)
+ ++sum;
+ ++sum; // { dg-error "collapsed loops not perfectly nested" }
+ }
+ return sum;
+}
diff --git a/gcc/testsuite/g++.dg/init/static-init2.C b/gcc/testsuite/g++.dg/init/static-init2.C
new file mode 100644
index 00000000000..34bf2b2388b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/static-init2.C
@@ -0,0 +1,3 @@
+// PR c++/36912
+// { dg-options -frounding-math }
+const double c = .1, d = c+1;
diff --git a/gcc/testsuite/g++.dg/init/synth2.C b/gcc/testsuite/g++.dg/init/synth2.C
new file mode 100644
index 00000000000..795ce42893c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/synth2.C
@@ -0,0 +1,17 @@
+// PR c++/34180
+
+struct G {
+ G(); // { dg-message "" "candidate" }
+ G(G&); // { dg-message "" "candidate" }
+};
+
+class A
+{ // { dg-error "no match" }
+ const G g;
+};
+
+int main()
+{
+ A a;
+ A b = a; // { dg-message "required here" }
+}
diff --git a/gcc/testsuite/g++.dg/ipa/20090113-1.C b/gcc/testsuite/g++.dg/ipa/20090113-1.C
new file mode 100644
index 00000000000..3f371257e57
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ipa/20090113-1.C
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+struct S1 {
+ S1() { }
+};
+
+struct S2 {
+ int n;
+ S1* p;
+ void f() {
+ p = new S1[n = 1];
+ }
+};
+
+struct S3 {
+ S2 s2;
+ void g() {
+ s2.f();
+ }
+};
+
+void h() {
+ S3().g();
+}
diff --git a/gcc/testsuite/g++.dg/ipa/iinline-1.C b/gcc/testsuite/g++.dg/ipa/iinline-1.C
index 1453c7e4658..6419ac3e8cd 100644
--- a/gcc/testsuite/g++.dg/ipa/iinline-1.C
+++ b/gcc/testsuite/g++.dg/ipa/iinline-1.C
@@ -2,7 +2,7 @@
inlining.. */
/* { dg-do compile } */
/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining" } */
-/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fpie" { target { ! nonpic } } } */
+/* { dg-add-options bind_pic_locally } */
extern void non_existent (const char *, int);
diff --git a/gcc/testsuite/g++.dg/lookup/anon2.C b/gcc/testsuite/g++.dg/lookup/anon2.C
index 3143b62fd33..d556ba0034a 100644
--- a/gcc/testsuite/g++.dg/lookup/anon2.C
+++ b/gcc/testsuite/g++.dg/lookup/anon2.C
@@ -1,9 +1,9 @@
// { dg-do compile }
// { dg-options "" }
-// Make sure we don't issue a diagnostic if a type with no linkage is used
-// to declare a a variable that has linkage if that variable is defined.
+// Make sure we issue a diagnostic if a type with no linkage is used
+// to declare a a variable that has linkage.
-struct { int i; } a;
+struct { int i; } a; // { dg-warning "anonymous type" }
void foo() { a.i; }
diff --git a/gcc/testsuite/g++.dg/lookup/extern-c-redecl2.C b/gcc/testsuite/g++.dg/lookup/extern-c-redecl2.C
new file mode 100644
index 00000000000..055148f3841
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/extern-c-redecl2.C
@@ -0,0 +1,21 @@
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// Origin PR c++/41020
+// { dg-do compile }
+
+extern "C"
+{
+ int fork (void);
+}
+
+class frok
+{
+ int this_errno;
+ friend int fork (void);
+};
+
+extern "C" int
+fork (void)
+{
+ frok grouped;
+ return grouped.this_errno;
+}
diff --git a/gcc/testsuite/g++.dg/lookup/extern-c-redecl3.C b/gcc/testsuite/g++.dg/lookup/extern-c-redecl3.C
new file mode 100644
index 00000000000..56dcefa7670
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/extern-c-redecl3.C
@@ -0,0 +1,23 @@
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// Origin: PR c++/41020
+// { dg-options "" }
+// { dg-do compile }
+// { dg-final { scan-assembler-not "call\[\t \]+\[^\$\]*?_Z4forkv" { target i?86-*-* x86_64-*-* } } }
+// { dg-final { scan-assembler "call\[\t \]+_?fork" { target i?86-*-* x86_64-*-* } } }
+
+extern "C" int fork (void);
+
+void
+foo ()
+{
+ extern int fork (void);
+ fork ();
+}
+
+extern "C"
+int
+fork (void)
+{
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.dg/lookup/extern-c-redecl4.C b/gcc/testsuite/g++.dg/lookup/extern-c-redecl4.C
new file mode 100644
index 00000000000..c385ea701a2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/extern-c-redecl4.C
@@ -0,0 +1,18 @@
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// Origin: PR c++/41020
+
+// { dg-options "" }
+// { dg-do compile }
+// { dg-final { scan-assembler "call\[\t \]+\[^\$\]*?_Z4forkv" { target i?86-*-* x86_64-*-* } } }
+
+class frok
+{
+ int this_errno;
+ friend int fork (void);
+};
+
+void
+foo ()
+{
+ fork ();
+}
diff --git a/gcc/testsuite/g++.dg/lookup/extern-c-redecl5.C b/gcc/testsuite/g++.dg/lookup/extern-c-redecl5.C
new file mode 100644
index 00000000000..51a342d433c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/extern-c-redecl5.C
@@ -0,0 +1,18 @@
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// Origin: PR c++/41020
+// { dg-do compile }
+
+
+class frok
+{
+ int this_errno;
+ friend int fork (void); // { dg-error "previous declaration .*?C\\+\\+. linkage" }
+};
+
+extern "C" int
+fork (void) // { dg-error "conflicts with new declaration .*?C. linkage" }}
+{
+ frok grouped;
+ return grouped.this_errno;
+}
+
diff --git a/gcc/testsuite/g++.dg/lookup/koenig5.C b/gcc/testsuite/g++.dg/lookup/koenig5.C
index 139e3b86684..6ecc25daadb 100644
--- a/gcc/testsuite/g++.dg/lookup/koenig5.C
+++ b/gcc/testsuite/g++.dg/lookup/koenig5.C
@@ -8,39 +8,39 @@
namespace N
{
struct A {};
- void One (...); // { dg-error "conflict with" "" }
- void (*Two) (...); // { dg-error "not a function" "" }
- namespace Three {} // { dg-error "lookup finds|not a function" "" }
+ void One (...);
+ void (*Two) (...);
+ namespace Three {}
}
namespace M
{
struct B {};
- struct One {}; // { dg-error "lookup finds|not a function" "" }
- void (*Two) (...); // { dg-error "conflict with" "" }
- void Three (...); // { dg-error "conflict with" "" }
+ struct One {};
+ void (*Two) (...);
+ void Three (...);
}
namespace O
{
struct C {};
- void Two (...); // { dg-error "conflict with" "" }
+ void Two (...);
}
void g (N::A *a, M::B *b, O::C *c)
{
One (a); // ok
- One (b); // { dg-error "in call to" "" }
- One (a, b); // { dg-error "in call to" "" }
+ One (a, b); // ok
+ One (b); // { dg-error "not declared" }
- Two (a); // ok
- Two (a, a); // ok
- Two (b); // ok
Two (c); // ok
- Two (a, b); // { dg-error "in call to" "" }
- Two (a, c); // { dg-error "in call to" "" }
+ Two (a, c); // ok
+ Two (a); // { dg-error "not declared" }
+ Two (a, a); // error masked by earlier error
+ Two (b); // error masked by earlier error
+ Two (a, b); // error masked by earlier error
- Three (a); // { dg-error "in call to" "" }
Three (b); // ok
- Three (a, b); // { dg-error "in call to" "" }
+ Three (a, b); // ok
+ Three (a); // { dg-error "not declared" }
}
diff --git a/gcc/testsuite/g++.dg/lookup/koenig6.C b/gcc/testsuite/g++.dg/lookup/koenig6.C
new file mode 100644
index 00000000000..9fdf771e0cf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/koenig6.C
@@ -0,0 +1,18 @@
+// PR c++/17365
+// ADL should not find B::N.
+
+namespace A
+{
+ namespace B
+ {
+ template <typename T> struct N {int n_;};
+ }
+ template <typename T> int N( T p ) { return p->n_; }
+ template <typename T> void f( T p ) { N(p); } // #1
+}
+int main()
+{
+ A::B::N<int> n;
+ A::f(&n);
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/lookup/koenig7.C b/gcc/testsuite/g++.dg/lookup/koenig7.C
new file mode 100644
index 00000000000..bc54ba96b6b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/koenig7.C
@@ -0,0 +1,12 @@
+// PR c++/34870
+
+template <typename T>
+struct Foo
+{
+ friend void func(const Foo &) {}
+};
+
+void check(const Foo<int> & x)
+{
+ func(x);
+}
diff --git a/gcc/testsuite/g++.dg/lookup/using16.C b/gcc/testsuite/g++.dg/lookup/using16.C
index ff6a80ee93f..a396afb973c 100644
--- a/gcc/testsuite/g++.dg/lookup/using16.C
+++ b/gcc/testsuite/g++.dg/lookup/using16.C
@@ -3,7 +3,7 @@
// { dg-do compile }
namespace M {
- struct S {}; // { dg-error "candidates are: struct M::S" "candidate 1" }
+ struct S {}; // { dg-error "struct M::S" "candidate 1" }
}
namespace N {
diff --git a/gcc/testsuite/g++.dg/lookup/using22.C b/gcc/testsuite/g++.dg/lookup/using22.C
new file mode 100644
index 00000000000..2396f9ab185
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/using22.C
@@ -0,0 +1,17 @@
+// PR c++/39786
+
+namespace A {
+ char (*f(char *p))[13] { return 0; }
+}
+
+namespace B {
+ namespace C {
+ char (*f(int p))[42] { return 0; }
+ }
+ using namespace C;
+}
+
+using namespace B;
+using namespace A;
+
+char x[sizeof *::f(0) == 42 ? 1 : -1];
diff --git a/gcc/testsuite/g++.dg/lto/20080709_0.C b/gcc/testsuite/g++.dg/lto/20080709_0.C
new file mode 100644
index 00000000000..55ae8c9ec2c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20080709_0.C
@@ -0,0 +1,11 @@
+// { dg-lto-do run }
+
+class Init {
+};
+
+int f(Init *a) {
+}
+
+int main(void){
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/lto/20080829_0.C b/gcc/testsuite/g++.dg/lto/20080829_0.C
new file mode 100644
index 00000000000..0890cf66d3b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20080829_0.C
@@ -0,0 +1,9 @@
+// { dg-lto-do assemble }
+
+/* The replacement of cos+sin with __builtin_cexpi done by
+ pass_cse_sincos was using a builtin for which we had no attributes.
+ This was causing the operand scanner to materialize a VDEF at the
+ builtin call-site which was not marked for renaming, thus tripping
+ up the SSA verifier. */
+extern "C" { extern double cos (double); extern double sin (double); }
+double func(double &in) { return cos(in) + sin(in); }
diff --git a/gcc/testsuite/g++.dg/lto/20080904_0.C b/gcc/testsuite/g++.dg/lto/20080904_0.C
new file mode 100644
index 00000000000..0161a00be7f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20080904_0.C
@@ -0,0 +1,37 @@
+// { dg-lto-do run }
+
+/* This test will fail to link if the vtable for Derived is not emitted. */
+
+class Base {
+public:
+ Base(char *buf, unsigned len)
+ : _buf(buf),
+ _len(len)
+ {}
+
+ virtual int length () { return _len; }
+
+private:
+ char * _buf;
+ unsigned _len;
+};
+
+class Derived : public Base {
+public:
+ Derived(char *buf, unsigned len)
+ : Base(buf, len),
+ _ctr(len)
+ {}
+
+ virtual int length () { return _ctr; }
+
+private:
+ unsigned _ctr;
+};
+
+int main ()
+{
+ Derived *d = new Derived (new char[256], 256);
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/lto/20080907_0.C b/gcc/testsuite/g++.dg/lto/20080907_0.C
new file mode 100644
index 00000000000..9a4552310d9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20080907_0.C
@@ -0,0 +1,3 @@
+// { dg-lto-do assemble }
+struct Foo { void func (); }; Foo & bar () { } struct Baz { Baz (Baz &); };
+Baz dummy() { bar().func(); }
diff --git a/gcc/testsuite/g++.dg/lto/20080908-1_0.C b/gcc/testsuite/g++.dg/lto/20080908-1_0.C
new file mode 100644
index 00000000000..8b761c0844c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20080908-1_0.C
@@ -0,0 +1,36 @@
+/* { dg-lto-do run } */
+extern "C" { extern void *memcpy (void *, const void *, unsigned); }
+
+inline int
+bci (const float &source)
+{
+ int dest;
+ memcpy (&dest, &source, sizeof (dest));
+ return dest;
+}
+
+inline float
+bcf (const int &source)
+{
+ float dest;
+ memcpy (&dest, &source, sizeof (dest));
+ return dest;
+}
+
+float
+Foo ()
+{
+ const int foo = bci (0.0f);
+ int bar = foo;
+ const int baz = foo & 1;
+ if (!baz && (foo & 2))
+ bar = 0;
+ return bcf (bar);
+}
+
+int main ()
+{
+ if (Foo () != 0.0)
+ return 1;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/lto/20080908-2_0.C b/gcc/testsuite/g++.dg/lto/20080908-2_0.C
new file mode 100644
index 00000000000..7042b3d08d6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20080908-2_0.C
@@ -0,0 +1,3 @@
+/* { dg-lto-do assemble } */
+struct Foo { double x[3]; };
+Foo func() { Foo f = { { 0, 0, 0 } }; return f; }
diff --git a/gcc/testsuite/g++.dg/lto/20080908-3_0.C b/gcc/testsuite/g++.dg/lto/20080908-3_0.C
new file mode 100644
index 00000000000..b7e0e1b0271
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20080908-3_0.C
@@ -0,0 +1,14 @@
+/* { dg-lto-do run } */
+
+int foo()
+{
+ double bar, baz = -__builtin_huge_val();
+ return baz <= -bar;
+}
+
+int main()
+{
+ if (foo () != 1)
+ return 1;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/lto/20080909-1_0.C b/gcc/testsuite/g++.dg/lto/20080909-1_0.C
new file mode 100644
index 00000000000..245ca58f308
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20080909-1_0.C
@@ -0,0 +1,3 @@
+// { dg-lto-do assemble }
+// { dg-lto-options {{-flto}} }
+int *i = (int[]) {0};
diff --git a/gcc/testsuite/g++.dg/lto/20080910-1_0.C b/gcc/testsuite/g++.dg/lto/20080910-1_0.C
new file mode 100644
index 00000000000..48e9e5d15cb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20080910-1_0.C
@@ -0,0 +1,2 @@
+// { dg-lto-do assemble }
+struct Foo { Foo(int); }; void func() { new Foo(0); }
diff --git a/gcc/testsuite/g++.dg/lto/20080912-1_0.C b/gcc/testsuite/g++.dg/lto/20080912-1_0.C
new file mode 100644
index 00000000000..ebead90e03a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20080912-1_0.C
@@ -0,0 +1,3 @@
+// { dg-lto-do assemble }
+struct Foo { double x[3]; };
+Foo func() { Foo f = { { 0, 0, 0 } }; return f; }
diff --git a/gcc/testsuite/g++.dg/lto/20080912_0.C b/gcc/testsuite/g++.dg/lto/20080912_0.C
new file mode 100644
index 00000000000..7b3039fbf8d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20080912_0.C
@@ -0,0 +1,4 @@
+// { dg-lto-do assemble }
+class Foo { virtual void f(); };
+class Bar:public Foo { };
+void func() { Bar(); }
diff --git a/gcc/testsuite/g++.dg/lto/20080915_0.C b/gcc/testsuite/g++.dg/lto/20080915_0.C
new file mode 100644
index 00000000000..3789765a964
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20080915_0.C
@@ -0,0 +1,29 @@
+// { dg-lto-do assemble }
+struct Foo {
+ static const int dummy;
+
+ int bit_field:1;
+ int dummy2:1;
+ int dummy3:1;
+};
+
+struct Bar {
+ Foo foo;
+};
+
+int func(const Bar& b) {
+ return b.foo.bit_field;
+}
+
+struct Baz {
+ Bar& operator*() {}
+};
+
+void func1(Baz baz, int i, Bar bar) {
+ i || func(bar);
+ *baz = bar;
+}
+
+void func2(Baz baz, Bar bar) {
+ func1(baz, 0, bar);
+}
diff --git a/gcc/testsuite/g++.dg/lto/20080916_0.C b/gcc/testsuite/g++.dg/lto/20080916_0.C
new file mode 100644
index 00000000000..3c900cd43b5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20080916_0.C
@@ -0,0 +1,12 @@
+/* { dg-lto-do assemble } */
+
+enum _Ios_Fmtflags {
+ _S_boolalpha };
+
+class ios_base {
+ static const _Ios_Fmtflags boolalpha = _S_boolalpha;
+ _Ios_Fmtflags _M_flags;
+};
+
+ios_base& g() {
+}
diff --git a/gcc/testsuite/g++.dg/lto/20080917_0.C b/gcc/testsuite/g++.dg/lto/20080917_0.C
new file mode 100644
index 00000000000..2f4f33bd0e9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20080917_0.C
@@ -0,0 +1,29 @@
+// { dg-lto-do assemble }
+// { dg-lto-options {{-O2 -flto -funsigned-char}} }
+int
+foo (char *s, int flag)
+{
+ for (;;)
+ {
+ unsigned char c;
+ if (flag)
+ c = *s;
+ else
+ c = *s;
+ return c;
+ }
+}
+
+int
+baz (const char *s, int flag)
+{
+ for (;;)
+ {
+ unsigned char c;
+ if (flag)
+ c = *s;
+ else
+ c = *s;
+ return c;
+ }
+}
diff --git a/gcc/testsuite/g++.dg/lto/20080924_0.C b/gcc/testsuite/g++.dg/lto/20080924_0.C
new file mode 100644
index 00000000000..b1e381351bb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20080924_0.C
@@ -0,0 +1,16 @@
+// { dg-lto-do assemble }
+// { dg-lto-options {{-O2 -flto -fno-strict-aliasing}} }
+
+namespace ns
+{
+ template <class> class hash_set { };
+}
+
+struct Foo
+{
+ long long f1, f2, f3;
+};
+
+void func(ns::hash_set<int>) {
+ Foo foo = { 0, 0, 0 };
+}
diff --git a/gcc/testsuite/g++.dg/lto/20080926_0.C b/gcc/testsuite/g++.dg/lto/20080926_0.C
new file mode 100644
index 00000000000..d6a7bbffc70
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20080926_0.C
@@ -0,0 +1,4 @@
+// { dg-lto-do assemble }
+// { dg-lto-options {{-O2 -flto -fno-strict-aliasing}} }
+extern int foo();
+void bar() { try { int i = foo(); } catch(int) { } }
diff --git a/gcc/testsuite/g++.dg/lto/20081008_0.C b/gcc/testsuite/g++.dg/lto/20081008_0.C
new file mode 100644
index 00000000000..258265a4fe1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081008_0.C
@@ -0,0 +1,36 @@
+// { dg-lto-do assemble }
+// { dg-lto-options {{-flto}} }
+
+struct Foo
+{
+ virtual void func() = 0;
+};
+
+struct Bar
+{
+ Foo *field;
+ void func2();
+};
+
+struct Baz
+{
+ Bar &bar();
+ Baz();
+};
+
+struct Zonk
+{
+ virtual ~Zonk() {
+ }
+ virtual void func3() = 0;
+};
+
+void Mumble(Zonk *) {
+}
+
+extern "C"
+{
+ void __attribute__ ((nothrow)) __cxa_pure_virtual() {
+ Baz().bar().func2();
+ }
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081022.h b/gcc/testsuite/g++.dg/lto/20081022.h
new file mode 100644
index 00000000000..bccd2ad7b68
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081022.h
@@ -0,0 +1,8 @@
+class foo
+{
+public:
+ int bar ()
+ {
+ return 0;
+ }
+};
diff --git a/gcc/testsuite/g++.dg/lto/20081022_0.C b/gcc/testsuite/g++.dg/lto/20081022_0.C
new file mode 100644
index 00000000000..219f92d6a96
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081022_0.C
@@ -0,0 +1,11 @@
+#include "20081022.h"
+
+int
+f (foo * a)
+{
+ return a->bar ();
+}
+
+main()
+{
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081022_1.C b/gcc/testsuite/g++.dg/lto/20081022_1.C
new file mode 100644
index 00000000000..94c5aecfd6b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081022_1.C
@@ -0,0 +1,7 @@
+#include "20081022.h"
+
+int
+g (foo * a)
+{
+ return a->bar ();
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081023_0.C b/gcc/testsuite/g++.dg/lto/20081023_0.C
new file mode 100644
index 00000000000..ab3fc36f386
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081023_0.C
@@ -0,0 +1,14 @@
+// { dg-lto-do link }
+extern inline void __attribute__ ((__always_inline__)) func (void)
+{
+}
+
+void
+f (void)
+{
+ func ();
+}
+
+main()
+{
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081109-1_0.C b/gcc/testsuite/g++.dg/lto/20081109-1_0.C
new file mode 100644
index 00000000000..243f0ed7246
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081109-1_0.C
@@ -0,0 +1,5 @@
+// { dg-lto-do link }
+// { dg-lto-options {{-fPIC -fwhopr}} }
+// { dg-extra-ld-options "-fPIC -fwhopr -shared -fno-exceptions" }
+void func(); class Foo { };
+void bar() { try { func(); } catch (Foo) { } };
diff --git a/gcc/testsuite/g++.dg/lto/20081109-2_0.C b/gcc/testsuite/g++.dg/lto/20081109-2_0.C
new file mode 100644
index 00000000000..dc43286bf36
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081109-2_0.C
@@ -0,0 +1,15 @@
+/* { dg-lto-do assemble } */
+extern void func(int);
+
+struct Foo
+{
+ void bar() {
+ static int local;
+ func(local);
+ }
+ void baz();
+};
+
+void Foo::baz() {
+ bar();
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081109_0.C b/gcc/testsuite/g++.dg/lto/20081109_0.C
new file mode 100644
index 00000000000..93cfc67fff2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081109_0.C
@@ -0,0 +1,28 @@
+extern "C" { void abort (void);}
+int foo (int);
+
+class A
+{
+ int x;
+
+public:
+ A() { x = 2304; }
+ ~A() { if (x != 2305) abort (); }
+ void inc () { x++; }
+};
+
+
+int main()
+{
+ A x;
+ x.inc();
+ try
+ {
+ foo (0);
+ abort (); // Should not execute
+ }
+ catch (int e)
+ {
+ return 0;
+ }
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081109_1.C b/gcc/testsuite/g++.dg/lto/20081109_1.C
new file mode 100644
index 00000000000..3395e135501
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081109_1.C
@@ -0,0 +1,4 @@
+int foo (int x)
+{
+ throw 10;
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081118-1_0.C b/gcc/testsuite/g++.dg/lto/20081118-1_0.C
new file mode 100644
index 00000000000..99e024f9e51
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081118-1_0.C
@@ -0,0 +1,27 @@
+/* { dg-lto-do link } */
+
+class C {
+ public:
+ C();
+ virtual ~C();
+ virtual void foo();
+};
+void bar() {
+ new C();
+}
+
+C::C() {
+
+}
+
+C::~C() {
+
+}
+
+void C::foo() {
+}
+
+int main(void)
+{
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081118-1_1.C b/gcc/testsuite/g++.dg/lto/20081118-1_1.C
new file mode 100644
index 00000000000..fc654fe9199
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081118-1_1.C
@@ -0,0 +1,12 @@
+class C {
+ public:
+ C();
+ virtual ~C();
+ virtual void foo();
+};
+class D {
+ ~D();
+ C lexer_;
+};
+D::~D() {
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081118_0.C b/gcc/testsuite/g++.dg/lto/20081118_0.C
new file mode 100644
index 00000000000..cbac06a4747
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081118_0.C
@@ -0,0 +1,20 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fPIC -fwhopr -shared}} } */
+
+/* We used to ICE because of dangling pointers. */
+
+class object
+{
+public:
+ virtual ~object() {}
+};
+
+class foo : public object
+{
+ virtual int method(void);
+};
+
+int
+foo::method(void)
+{
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081118_1.C b/gcc/testsuite/g++.dg/lto/20081118_1.C
new file mode 100644
index 00000000000..b9e56a48b9b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081118_1.C
@@ -0,0 +1,20 @@
+class object {
+ virtual ~object() {}
+};
+
+class bar : public object
+{
+ static bar *method(void);
+};
+
+class quxx : public bar
+{
+ public:
+ static void method();
+};
+
+bar*
+bar::method (void)
+{
+ quxx::method();
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081119-1.h b/gcc/testsuite/g++.dg/lto/20081119-1.h
new file mode 100644
index 00000000000..be193581dcd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081119-1.h
@@ -0,0 +1,8 @@
+namespace __gnu_cxx
+{
+ template < typename _Tp > class new_allocator
+ {
+ public:
+ unsigned max_size () const throw ();
+ };
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081119-1_0.C b/gcc/testsuite/g++.dg/lto/20081119-1_0.C
new file mode 100644
index 00000000000..d38fca3d44d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081119-1_0.C
@@ -0,0 +1,12 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fPIC -fwhopr -shared}} } */
+
+#include "20081119-1.h"
+
+extern __gnu_cxx::new_allocator<int> X;
+
+int
+f (__gnu_cxx::new_allocator<int> * a)
+{
+ return a->max_size () + X.max_size();
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081119-1_1.C b/gcc/testsuite/g++.dg/lto/20081119-1_1.C
new file mode 100644
index 00000000000..c2ba78d6ed7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081119-1_1.C
@@ -0,0 +1,9 @@
+#include "20081119-1.h"
+
+__gnu_cxx::new_allocator<int> X;
+
+int
+f (__gnu_cxx::new_allocator<int> a)
+{
+ return a.max_size ();
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081119_0.C b/gcc/testsuite/g++.dg/lto/20081119_0.C
new file mode 100644
index 00000000000..c77a4309811
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081119_0.C
@@ -0,0 +1,24 @@
+class foo {
+ public:
+ foo () {}
+ virtual ~foo() {}
+ virtual void m() {}
+};
+
+template<typename t>
+class bar : public foo {
+ public:
+ bar () {}
+};
+
+void
+f1 (bar<int> *p)
+{
+ p->m();
+}
+
+int
+main ()
+{
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081119_1.C b/gcc/testsuite/g++.dg/lto/20081119_1.C
new file mode 100644
index 00000000000..71a2a5c0242
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081119_1.C
@@ -0,0 +1,18 @@
+class foo {
+ public:
+ foo () {}
+ virtual ~foo() {}
+ virtual void m() {}
+};
+
+template<typename t>
+class bar : public foo {
+ public:
+ bar () {}
+};
+
+void
+f2 (bar<int> *p)
+{
+ p->m();
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081120-1_0.C b/gcc/testsuite/g++.dg/lto/20081120-1_0.C
new file mode 100644
index 00000000000..3cb97538945
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081120-1_0.C
@@ -0,0 +1,10 @@
+// { dg-lto-do link }
+// { dg-lto-options {{-flto -shared}} }
+extern "C"
+{
+ extern __inline __attribute__((__gnu_inline__)) int pthread_equal(int, int)
+ {
+ }
+}
+static __typeof(pthread_equal)
+ __gthrw_pthread_equal __attribute__((__weakref__("pthread_equal")));
diff --git a/gcc/testsuite/g++.dg/lto/20081120-1_1.C b/gcc/testsuite/g++.dg/lto/20081120-1_1.C
new file mode 100644
index 00000000000..e7e24a58b76
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081120-1_1.C
@@ -0,0 +1,8 @@
+extern "C"
+{
+ extern __inline __attribute__((__gnu_inline__)) int pthread_equal(int, int)
+ {
+ }
+}
+static __typeof(pthread_equal)
+ __gthrw_pthread_equal __attribute__((__weakref__("pthread_equal")));
diff --git a/gcc/testsuite/g++.dg/lto/20081120-2_0.C b/gcc/testsuite/g++.dg/lto/20081120-2_0.C
new file mode 100644
index 00000000000..d4e4cd43cc5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081120-2_0.C
@@ -0,0 +1,13 @@
+// { dg-lto-do link }
+// { dg-lto-options {{-flto -shared}} }
+template < typename > struct Foo
+{
+ inline void rdstate() {
+ }
+};
+
+extern template struct Foo<int>;
+
+struct Bar:virtual public Foo<int>
+{
+};
diff --git a/gcc/testsuite/g++.dg/lto/20081120-2_1.C b/gcc/testsuite/g++.dg/lto/20081120-2_1.C
new file mode 100644
index 00000000000..242d50a41ce
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081120-2_1.C
@@ -0,0 +1,11 @@
+template < typename > struct Foo
+{
+ inline void rdstate() {
+ }
+};
+
+extern template struct Foo<int>;
+
+struct Bar:virtual public Foo<int>
+{
+};
diff --git a/gcc/testsuite/g++.dg/lto/20081123_0.C b/gcc/testsuite/g++.dg/lto/20081123_0.C
new file mode 100644
index 00000000000..2b182a95e42
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081123_0.C
@@ -0,0 +1,8 @@
+// { dg-lto-do link }
+// { dg-lto-options {{-fwhopr -shared -fPIC}} }
+
+int
+f(void)
+{
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081123_1.C b/gcc/testsuite/g++.dg/lto/20081123_1.C
new file mode 100644
index 00000000000..aef512e8e4d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081123_1.C
@@ -0,0 +1,16 @@
+struct foo {
+ const int* int_array;
+ const void* default_instance;
+};
+struct bar {
+ static const bar& _default_instance;
+ static const foo _internal_foo;
+};
+struct quxx {
+ static int trouble[];
+};
+int quxx::trouble[] = { };
+const foo bar::_internal_foo = {
+ quxx::trouble,
+ &bar::_default_instance
+};
diff --git a/gcc/testsuite/g++.dg/lto/20081125.h b/gcc/testsuite/g++.dg/lto/20081125.h
new file mode 100644
index 00000000000..bc470040a67
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081125.h
@@ -0,0 +1,15 @@
+class base
+{
+ public:
+ base() {}
+ virtual ~base() {}
+ static base *factory (void);
+};
+
+class object : public base
+{
+ public:
+ object() {}
+ object (int);
+ virtual void key_method (void);
+};
diff --git a/gcc/testsuite/g++.dg/lto/20081125_0.C b/gcc/testsuite/g++.dg/lto/20081125_0.C
new file mode 100644
index 00000000000..ade9744946d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081125_0.C
@@ -0,0 +1,18 @@
+// { dg-lto-do link }
+// { dg-lto-options {{-fwhopr}} }
+#include "20081125.h"
+
+object::object (int x)
+{
+}
+
+void
+object::key_method (void)
+{
+}
+
+int
+main ()
+{
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081125_1.C b/gcc/testsuite/g++.dg/lto/20081125_1.C
new file mode 100644
index 00000000000..d52b9edcada
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081125_1.C
@@ -0,0 +1,7 @@
+#include "20081125.h"
+
+base *
+base::factory(void)
+{
+ return new object ();
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081127_0.C b/gcc/testsuite/g++.dg/lto/20081127_0.C
new file mode 100644
index 00000000000..a5200ff4bea
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081127_0.C
@@ -0,0 +1,2 @@
+struct Foo { Foo(); };
+static void func() { new Foo(); }
diff --git a/gcc/testsuite/g++.dg/lto/20081127_1.C b/gcc/testsuite/g++.dg/lto/20081127_1.C
new file mode 100644
index 00000000000..6488ac8d797
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081127_1.C
@@ -0,0 +1,3 @@
+struct Foo { Foo(); };
+Foo::Foo() { }
+main() { return 0; }
diff --git a/gcc/testsuite/g++.dg/lto/20081203_0.C b/gcc/testsuite/g++.dg/lto/20081203_0.C
new file mode 100644
index 00000000000..e92d89a4c3b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081203_0.C
@@ -0,0 +1,5 @@
+extern void f();
+extern void g();
+struct Foo { static inline void Bar() { f(); } };
+static void Func() { Foo::Bar(); }
+int main() { g (); Func(); return 0; }
diff --git a/gcc/testsuite/g++.dg/lto/20081203_1.C b/gcc/testsuite/g++.dg/lto/20081203_1.C
new file mode 100644
index 00000000000..83de109eaa9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081203_1.C
@@ -0,0 +1,4 @@
+void f () {}
+struct Foo { static inline void Bar() { f(); } };
+static void Func() { Foo::Bar(); }
+void g () { Func (); }
diff --git a/gcc/testsuite/g++.dg/lto/20081204-1_0.C b/gcc/testsuite/g++.dg/lto/20081204-1_0.C
new file mode 100644
index 00000000000..8c625f51e47
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081204-1_0.C
@@ -0,0 +1,14 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fwhopr -fPIC -shared}} } */
+
+/* Tests for the absence during linking of:
+ lto1: error: type of '_ZTVN10__cxxabiv120__si_class_type_infoE' does
+ not match original declaration */
+
+struct Foo { virtual ~Foo(); };
+namespace __cxxabiv1
+{
+ struct __si_class_type_info: public Foo { };
+ struct Baz: public Foo { virtual void Func(); };
+ void Baz::Func() { }
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081204-1_1.C b/gcc/testsuite/g++.dg/lto/20081204-1_1.C
new file mode 100644
index 00000000000..20627b5c54d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081204-1_1.C
@@ -0,0 +1,3 @@
+struct Foo { virtual ~Foo(); };
+struct Bar:public Foo { Bar() { } };
+void Func() { new Bar(); }
diff --git a/gcc/testsuite/g++.dg/lto/20081204-2_0.C b/gcc/testsuite/g++.dg/lto/20081204-2_0.C
new file mode 100644
index 00000000000..dfae081bfa1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081204-2_0.C
@@ -0,0 +1,10 @@
+// { dg-lto-do link }
+// { dg-lto-options {{-fwhopr -O3}} }
+extern void foo (void);
+
+int
+main ()
+{
+ foo ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081204-2_1.C b/gcc/testsuite/g++.dg/lto/20081204-2_1.C
new file mode 100644
index 00000000000..676b9b27d63
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081204-2_1.C
@@ -0,0 +1,14 @@
+namespace {
+class c
+{
+ public:
+ c () {}
+ virtual ~c() {}
+};
+};
+
+void
+foo (void)
+{
+ c x;
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081209_0.C b/gcc/testsuite/g++.dg/lto/20081209_0.C
new file mode 100644
index 00000000000..3744a9ac42a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081209_0.C
@@ -0,0 +1,18 @@
+/* { dg-lto-do link } */
+
+class foo {
+ public:
+ foo ();
+ virtual ~foo ();
+};
+
+foo::foo ()
+{
+}
+
+int
+main ()
+{
+ foo dummy;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081209_1.C b/gcc/testsuite/g++.dg/lto/20081209_1.C
new file mode 100644
index 00000000000..83eee3e46e8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081209_1.C
@@ -0,0 +1,9 @@
+class foo {
+ public:
+ foo ();
+ virtual ~foo ();
+};
+
+foo::~foo ()
+{
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081211-1.h b/gcc/testsuite/g++.dg/lto/20081211-1.h
new file mode 100644
index 00000000000..f9a8ca7550d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081211-1.h
@@ -0,0 +1,6 @@
+class foo {
+ public:
+ foo () {}
+ virtual ~foo () {}
+ virtual void key_method (void);
+};
diff --git a/gcc/testsuite/g++.dg/lto/20081211-1_0.C b/gcc/testsuite/g++.dg/lto/20081211-1_0.C
new file mode 100644
index 00000000000..89c06acf53a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081211-1_0.C
@@ -0,0 +1,19 @@
+#include "20081211-1.h"
+
+foo *
+create_foo (void)
+{
+ return new foo;
+}
+
+void
+destroy_foo (foo *p)
+{
+ delete p;
+}
+
+int
+main ()
+{
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081211-1_1.C b/gcc/testsuite/g++.dg/lto/20081211-1_1.C
new file mode 100644
index 00000000000..124d69a7cce
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081211-1_1.C
@@ -0,0 +1,6 @@
+#include "20081211-1.h"
+
+void
+foo::key_method (void)
+{
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081217-1_0.C b/gcc/testsuite/g++.dg/lto/20081217-1_0.C
new file mode 100644
index 00000000000..c91872bd2db
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081217-1_0.C
@@ -0,0 +1,28 @@
+class base1
+{
+ public:
+ base1 () {}
+ virtual ~base1 () {}
+};
+
+class base2
+{
+ public:
+ base2 () {}
+ virtual ~base2 () {}
+};
+
+class mi_class : public base1, base2
+{
+ public:
+ mi_class () {}
+ ~mi_class () {}
+};
+
+mi_class dummy;
+
+int
+main ()
+{
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081217-2_0.C b/gcc/testsuite/g++.dg/lto/20081217-2_0.C
new file mode 100644
index 00000000000..a47b0b5781b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081217-2_0.C
@@ -0,0 +1,20 @@
+struct A {
+ virtual int foo() {}
+};
+struct B {
+ virtual int f() {return 1; }
+};
+struct C : public A, public B {
+ C();
+ virtual int f() { return 0; }
+};
+
+C::C()
+{
+}
+
+main()
+{
+ C c;
+ return c.f();
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081219_0.C b/gcc/testsuite/g++.dg/lto/20081219_0.C
new file mode 100644
index 00000000000..29ad575d0a7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081219_0.C
@@ -0,0 +1,72 @@
+// { dg-lto-do link }
+// { dg-lto-options {{-fPIC -fwhopr -O2}} }
+// { dg-extra-ld-options "-O2 -fPIC -fwhopr -shared" }
+
+typedef long int ptrdiff_t;
+extern "C"
+{
+ typedef struct
+ {
+ }
+ __mbstate_t;
+ namespace std
+ {
+ class exception
+ {
+ };
+ }
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+ template < typename _Alloc > class allocator;
+ template < class _CharT > struct char_traits;
+}
+typedef __mbstate_t mbstate_t;
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+ using::mbstate_t;
+ typedef ptrdiff_t streamsize;
+ template < typename _CharT, typename _Traits =
+ char_traits < _CharT > >class basic_istream;
+ template < typename _CharT, typename _Traits =
+ char_traits < _CharT >, typename _Alloc =
+ allocator < _CharT > >class basic_stringbuf;
+ class ios_base
+ {
+ public:class failure:public exception
+ {
+ };
+ virtual ~ ios_base ();
+ };
+ template < typename _CharT, typename _Traits > class basic_streambuf
+ {
+ };
+template < typename _CharT, typename _Traits > class basic_ios:public
+ ios_base
+ {
+ };
+template < typename _CharT, typename _Traits > class basic_istream:virtual public basic_ios < _CharT,
+ _Traits
+ >
+ {
+ typedef basic_streambuf < _CharT, _Traits > __streambuf_type;
+ protected:streamsize _M_gcount;
+ public: explicit basic_istream (__streambuf_type * __sb):_M_gcount (streamsize
+ (0))
+ {
+ }
+ };
+template < typename _CharT, typename _Traits, typename _Alloc > class basic_stringbuf:public basic_streambuf < _CharT,
+ _Traits
+ >
+ {
+ };
+ template < typename V, typename I, typename S = std::mbstate_t > struct character
+ {
+ };
+ typedef character < unsigned short, unsigned int >pod_ushort;
+ typedef basic_stringbuf < pod_ushort > stringbuf_type;
+ typedef basic_istream < pod_ushort > istream_type;
+ stringbuf_type strbuf01;
+ istream_type stream (&strbuf01);
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081219_1.C b/gcc/testsuite/g++.dg/lto/20081219_1.C
new file mode 100644
index 00000000000..1bb96ef37de
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081219_1.C
@@ -0,0 +1,42 @@
+typedef struct
+{
+}
+__mbstate_t;
+typedef __mbstate_t mbstate_t;
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+ using::mbstate_t;
+ typedef int *__c_locale;
+ class locale
+ {
+ class facet;
+ };
+ class locale::facet
+ {
+ };
+template < typename _CharT > class numpunct:public locale::facet
+ {
+ void _M_initialize_numpunct (__c_locale __cloc = __null);
+ };
+}
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+ template < typename V, typename I, typename S = std::mbstate_t > struct character
+ {
+ };
+}
+
+namespace __gnu_test
+{
+ using __gnu_cxx::character;
+ typedef character < unsigned short, unsigned int >pod_ushort;
+}
+namespace std
+{
+ using __gnu_test::pod_ushort;
+ template <> void numpunct <
+ pod_ushort >::_M_initialize_numpunct (__c_locale)
+ {
+ pod_ushort *__truename = new pod_ushort[4 + 1];
+ }
+}
diff --git a/gcc/testsuite/g++.dg/lto/20090106_0.C b/gcc/testsuite/g++.dg/lto/20090106_0.C
new file mode 100644
index 00000000000..8c4d3952ef2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20090106_0.C
@@ -0,0 +1,203 @@
+// { dg-lto-do link }
+typedef long unsigned int size_t;
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ using ::size_t;
+ template<typename _Tp>
+ struct __is_char
+ {
+ };
+# 422 "/usr/include/c++/4.4.0/bits/cpp_type_traits.h" 3
+}
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
+ template<bool, typename>
+ struct __enable_if
+ {
+ };
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<class _T1, class _T2>
+ struct pair
+ {
+ };
+}
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Tp>
+ class new_allocator
+ {
+ };
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Tp>
+ class allocator: public __gnu_cxx::new_allocator<_Tp>
+ {
+ };
+ template<typename _Arg1, typename _Arg2, typename _Result>
+ struct binary_function
+ {
+ };
+ template<typename _Tp>
+ struct less : public binary_function<_Tp, _Tp, bool>
+ {
+ };
+ template<typename _CharT>
+ struct char_traits
+ {
+ typedef _CharT char_type;
+ static std::size_t
+ length(const char_type* __s);
+ };
+ template<typename _CharT>
+ std::size_t
+ char_traits<_CharT>::
+ length(const char_type* __p)
+ {
+ }
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class istreambuf_iterator;
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ class basic_string
+ {
+ };
+}
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ class __versa_string;
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ struct __vstring_utility
+ {
+ };
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ class __rc_string_base
+ {
+ typedef __vstring_utility<_CharT, _Traits, _Alloc> _Util_Base;
+ typedef typename _Util_Base::_CharT_alloc_type _CharT_alloc_type;
+ typedef typename _CharT_alloc_type::size_type size_type;
+ struct _Rep
+ {
+ union
+ {
+ };
+ static _Rep*
+ _S_create(size_type, size_type, const _Alloc&);
+ };
+ };
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename __rc_string_base<_CharT, _Traits, _Alloc>::_Rep*
+ __rc_string_base<_CharT, _Traits, _Alloc>::_Rep::
+ _S_create(size_type __capacity, size_type __old_capacity,
+ const _Alloc& __alloc)
+ {
+ };
+}
+template<typename _CharT, typename _Traits = std::char_traits<_CharT>,
+ typename _Alloc = std::allocator<_CharT> >
+class basic_string
+ : public __gnu_cxx::__versa_string<_CharT, _Traits, _Alloc> {
+};
+template<typename _CharT, typename _Traits, typename _Alloc>
+ operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const std::basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ {
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ struct __uninitialized_copy
+ {
+ template<typename _InputIterator, typename _ForwardIterator>
+ uninitialized_copy(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result)
+ {
+ }
+ };
+ template<typename _InputIterator, typename _ForwardIterator>
+ uninitialized_copy(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result)
+ {
+ }
+ class locale
+ {
+ class facet;
+ };
+ class locale::facet
+ {
+ };
+ class ios_base
+ {
+ template<typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+ istreambuf_iterator<_CharT2> >::__type
+ find(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
+ const _CharT2&);
+ };
+ template<typename _CharT, typename _OutIter>
+ class num_put : public locale::facet
+ {
+ typedef _CharT char_type;
+ typedef _OutIter iter_type;
+ template<typename _ValueT>
+ iter_type
+ _M_insert_float(iter_type, ios_base& __io, char_type __fill,
+ char __mod, _ValueT __v) const;
+ };
+ template<typename _CharT, typename _OutIter>
+ template<typename _ValueT>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ _M_insert_float(_OutIter __s, ios_base& __io, _CharT __fill, char __mod,
+ _ValueT __v) const
+ {
+ }
+ template<typename _CharT, typename _OutIter>
+ class basic_ios : public ios_base
+ {
+ };
+ template<typename _CharT, typename _Traits>
+ class basic_istream : virtual public basic_ios<_CharT, _Traits>
+ {
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ template<typename _ValueT>
+ __istream_type&
+ _M_extract(_ValueT& __v);
+ };
+ template<typename _CharT, typename _Traits>
+ template<typename _ValueT>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ _M_extract(_ValueT& __v)
+ {
+ }
+ class hash_map
+ {
+ };
+}
+class CDE {
+ public:
+ virtual ~CDE() { }
+};
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template <typename _Key, typename _Tp, typename _Compare = std::less<_Key>,
+ typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
+ class map
+ {
+ };
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ operator==(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+ const map<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return !(__x < __y); }
+}
+namespace xyz {
+class XYZ;
+};
+class ABC {
+ public:
+ virtual ~ABC() { }
+};
+class FGH : public CDE, public ABC {
+ public:
+ explicit FGH(CDE* efg);
+};
+namespace {
+class LMN : public FGH {
+ LMN(CDE* efg, xyz::XYZ* hij) : FGH(efg) { }
+};
+}
+main(){}
diff --git a/gcc/testsuite/g++.dg/lto/20090112_0.C b/gcc/testsuite/g++.dg/lto/20090112_0.C
new file mode 100644
index 00000000000..b9dc24bc1bc
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20090112_0.C
@@ -0,0 +1,11 @@
+// { dg-lto-do run }
+const char *func(int val) {
+ switch (val) {
+ case 2147483647: return "foo";
+ default: return "";
+ }
+}
+
+int main() {
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/lto/20090128_0.C b/gcc/testsuite/g++.dg/lto/20090128_0.C
new file mode 100644
index 00000000000..24ff5970c12
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20090128_0.C
@@ -0,0 +1,88 @@
+// { dg-lto-do assemble }
+// { dg-lto-options {{-fpreprocessed -O2 -fwhopr -funsigned-char}} }
+typedef unsigned char uint8;
+extern const uint8 array[256];
+static inline bool
+g (unsigned char c)
+{
+ return array[c] & 0x80;
+}
+
+class Class1
+{
+ static bool f1 (char **dst, const char *end, char c);
+ static bool f2 (const char *map, const char **src, char **dst,
+ const char *end);
+ static bool f3 (const char *src, char *dst, const char *end);
+};
+
+enum JTipL
+{
+ KXHR8 = 0, KXNU3, KX_HASH, KXYYZ, KXFI9, KXX3, KXAFA, KXV4Z, KXZ11,
+};
+
+static const char
+ p9t42[256] = { KXYYZ, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3,
+ KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3,
+ KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3,
+ KXX3, KXX3, KXX3, KXX3, KXX3, KXAFA, KXX3, KX_HASH, KXAFA,
+ KXFI9, KXAFA, KXAFA, KXAFA, KXAFA, KXAFA, KXV4Z, KXAFA, KXAFA,
+ KXAFA, KXV4Z, KXAFA, KXAFA, KXAFA, KXAFA, KXAFA, KXAFA, KXAFA,
+ KXAFA, KXAFA, KXAFA, KXAFA, KXHR8, KXX3, KXV4Z, KXX3, KXNU3,
+ KXAFA, KXAFA, KXAFA, KXAFA, KXAFA, KXAFA, KXAFA, KXAFA, KXAFA,
+ KXAFA, KXAFA, KXAFA, KXAFA, KXAFA, KXAFA, KXAFA, KXAFA, KXAFA,
+ KXAFA, KXAFA, KXAFA, KXAFA, KXAFA, KXAFA, KXAFA, KXAFA, KXAFA,
+ KXX3, KXX3, KXX3, KXX3, KXAFA, KXX3, KXAFA, KXAFA, KXAFA, KXAFA,
+ KXAFA, KXAFA, KXAFA, KXAFA, KXAFA, KXAFA, KXAFA, KXAFA, KXAFA,
+ KXAFA, KXAFA, KXAFA, KXAFA, KXAFA, KXAFA, KXAFA, KXAFA, KXAFA,
+ KXAFA, KXAFA, KXAFA, KXAFA, KXX3, KXX3, KXX3, KXAFA, KXX3, KXX3,
+ KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3,
+ KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3,
+ KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3,
+ KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3,
+ KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3,
+ KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3,
+ KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3,
+ KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3,
+ KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3,
+ KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3,
+ KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3,
+ KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3,
+ KXX3, KXX3, KXX3, KXX3, KXX3, KXX3, KXX3,
+};
+
+inline bool
+Class1::f2 (const char *map, const char **src, char **dst,
+ const char *end)
+{
+ if (g ((*src)[1]) && g ((*src)[2]))
+ {
+ char c = (static_cast < unsigned char >((*src)[1])) & 0xf;
+ if (map[c] == KXAFA)
+ {
+ }
+ else if (f1 (dst, end, c))
+ {
+ }
+ }
+ return true;
+}
+
+bool
+Class1::f3 (const char *src, char *dst, const char *end)
+{
+ while (dst < end)
+ {
+ char c = *src;
+ char m = p9t42[c];
+ switch (m)
+ {
+ case KXYYZ:
+ *dst = '\0';
+ case KXFI9:
+ if (!f2 (p9t42, &src, &dst, end))
+ ;
+ }
+ }
+ return false;
+}
diff --git a/gcc/testsuite/g++.dg/lto/20090221_0.C b/gcc/testsuite/g++.dg/lto/20090221_0.C
new file mode 100644
index 00000000000..5bf031906c7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20090221_0.C
@@ -0,0 +1,53 @@
+// { dg-lto-do assemble }
+extern void some_function (const char *);
+extern bool some_other_function ();
+
+struct Foo
+{
+ long long a;
+ int b;
+};
+
+bool Foo_eq(Foo x, Foo y)
+{
+ return x.a == y.a && x.b == y.b;
+}
+
+struct Bar
+{
+ Foo a;
+ int b;
+};
+
+struct Baz
+{
+ Bar a;
+ Baz(Bar &a):a(a) { }
+};
+
+struct Zonk
+{
+ Baz baz;
+
+ Bar func_1(const Bar & bar) {
+ if (Foo_eq(bar.a, baz.a.a) && bar.b == baz.a.b || some_other_function ())
+ return bar;
+ }
+
+ void func_2(const Baz & baz) {
+ func_1(baz.a);
+ some_function(__PRETTY_FUNCTION__);
+ }
+};
+
+void func() {
+ Bar bar;
+ Zonk *rep;
+ rep->func_1(bar);
+ rep->func_2(Baz(bar));
+}
+
+void foo ()
+{
+ func();
+}
diff --git a/gcc/testsuite/g++.dg/lto/20090302_0.C b/gcc/testsuite/g++.dg/lto/20090302_0.C
new file mode 100644
index 00000000000..c71e062f319
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20090302_0.C
@@ -0,0 +1,9 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fPIC -fwhopr -shared}} } */
+struct Foo {
+ bool Mumble();
+ static void Bar() { if (foo_->Mumble()) foo_ = 0; }
+ static void Baz() { Bar(); }
+ static Foo *foo_;
+};
+void Unused() { Foo::Bar(); Foo::Baz(); }
diff --git a/gcc/testsuite/g++.dg/lto/20090302_1.C b/gcc/testsuite/g++.dg/lto/20090302_1.C
new file mode 100644
index 00000000000..0ccaf3c8205
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20090302_1.C
@@ -0,0 +1,7 @@
+struct Foo {
+ bool Mumble();
+ static void Bar() { if (foo_->Mumble()) foo_ = 0; }
+ static void Baz() { Bar(); }
+ static Foo *foo_;
+};
+Foo *Foo::foo_;
diff --git a/gcc/testsuite/g++.dg/lto/20090303_0.C b/gcc/testsuite/g++.dg/lto/20090303_0.C
new file mode 100644
index 00000000000..f6d5512e123
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20090303_0.C
@@ -0,0 +1,22 @@
+/* { dg-lto-do run } */
+/* { dg-lto-options {{-fwhopr -fPIC}} } */
+/* { dg-suppress-ld-options {-fPIC} } */
+void foobar(int *, int* __x) ;
+int test_ints[30];
+int j;
+
+void foobar (int *x, int *y)
+{
+ *x = *y = 0;
+}
+
+void Test() {
+ int int_set_;
+ foobar (&int_set_, &test_ints[j]);
+}
+main()
+{
+ Test();
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.dg/lto/20090311-1.h b/gcc/testsuite/g++.dg/lto/20090311-1.h
new file mode 100644
index 00000000000..389d94f0054
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20090311-1.h
@@ -0,0 +1,22 @@
+typedef unsigned long uint32;
+typedef int JSIntn;
+#define JS_DLL_CALLBACK
+typedef JSIntn JSBool;
+typedef struct JSContext JSContext;
+typedef struct JSObject JSObject;
+typedef long long JSInt64;
+typedef JSInt64 JSWord;
+typedef JSWord jsword;
+typedef jsword jsval;
+
+typedef JSBool
+(* JS_DLL_CALLBACK JSPropertyOp)(JSContext *cx, JSObject *ojb, jsval id,
+ jsval *vp);
+
+struct JSClass {
+ const char *name;
+ uint32 flags;
+ JSPropertyOp addProperty;
+};
+
+extern struct JSClass K;
diff --git a/gcc/testsuite/g++.dg/lto/20090311-1_0.C b/gcc/testsuite/g++.dg/lto/20090311-1_0.C
new file mode 100644
index 00000000000..6d403272428
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20090311-1_0.C
@@ -0,0 +1,34 @@
+/* { dg-lto-do run } */
+#include "20090311-1.h"
+bool flag;
+
+struct B {
+ int a;
+ enum { ANOTHER, ONE } f2_;
+ float c;
+};
+
+extern struct B x[];
+
+struct C {
+ int x;
+ struct B *p;
+ float d;
+};
+
+C c = { 0, 0, 3.4 };
+
+struct A {
+ enum { UNO, DOS, TRES } f1_;
+ int x;
+};
+
+A a;
+
+extern int foo();
+main()
+{
+ a.x = 4 + c.x;
+ foo();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/lto/20090311-1_1.C b/gcc/testsuite/g++.dg/lto/20090311-1_1.C
new file mode 100644
index 00000000000..520aa957a98
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20090311-1_1.C
@@ -0,0 +1,28 @@
+#include "20090311-1.h"
+
+struct A {
+ enum { UNO, DOS, TRES } f1_;
+ int x;
+};
+
+struct B;
+
+extern struct B x[];
+
+struct C {
+ int x;
+ struct B *p;
+ float d;
+};
+
+extern A a;
+extern B b;
+extern bool flag;
+extern C c;
+
+int foo()
+{
+ if (!flag)
+ return a.x - c.x;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/lto/20090311_0.C b/gcc/testsuite/g++.dg/lto/20090311_0.C
new file mode 100644
index 00000000000..cc54bbfdc96
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20090311_0.C
@@ -0,0 +1,13 @@
+class C1 {
+public: virtual ~C1() {
+}
+};
+class C2 : public C1 {
+public:
+ C2(void *q);
+ virtual void A();
+};
+int main(int argc, char **argv) {
+ C2 h(0);
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/lto/20090311_1.C b/gcc/testsuite/g++.dg/lto/20090311_1.C
new file mode 100644
index 00000000000..e78da7223dd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20090311_1.C
@@ -0,0 +1,13 @@
+class C1 {
+public: virtual ~C1() {
+}
+};
+class C2 : public C1 {
+ C2(void *q);
+ virtual void A();
+};
+void C2::A() {
+}
+C2::C2(void *q)
+{
+}
diff --git a/gcc/testsuite/g++.dg/lto/20090312.h b/gcc/testsuite/g++.dg/lto/20090312.h
new file mode 100644
index 00000000000..c902e93c78d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20090312.h
@@ -0,0 +1,2 @@
+enum Values { ONE, TWO, THREE };
+typedef const char * (* JSErrorCallback)(void *, const char *, const int);
diff --git a/gcc/testsuite/g++.dg/lto/20090312_0.C b/gcc/testsuite/g++.dg/lto/20090312_0.C
new file mode 100644
index 00000000000..b2222c2aa20
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20090312_0.C
@@ -0,0 +1,14 @@
+#include "20090312.h"
+
+extern "C" {
+ extern enum Values x;
+ extern JSErrorCallback p;
+};
+
+main()
+{
+ if ( x == ONE && p == 0)
+ return 0;
+
+ return 1;
+}
diff --git a/gcc/testsuite/g++.dg/lto/20090312_1.C b/gcc/testsuite/g++.dg/lto/20090312_1.C
new file mode 100644
index 00000000000..a0f9085f528
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20090312_1.C
@@ -0,0 +1,21 @@
+#include "20090312.h"
+
+/* This file should be compiled with the C front end. This
+ should be testing what happens when LTO merges enum types and function
+ prototypes compiled by the C and C++ FEs. Since both FEs generate
+ slightly different representations for these, LTO was emitting an
+ ODR violation error.
+
+ Once dejagnu can deal with multiple languages in a single test, remove
+ the __cplusplus checks and force this file to be compiled with the
+ C front end. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+JSErrorCallback p = 0;
+enum Values x = ONE;
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/gcc/testsuite/g++.dg/lto/20090313_0.C b/gcc/testsuite/g++.dg/lto/20090313_0.C
new file mode 100644
index 00000000000..df1a94287b2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20090313_0.C
@@ -0,0 +1,5 @@
+// { dg-lto-do link }
+// { dg-lto-options {{-fwhopr -fPIC}} }
+// { dg-extra-ld-options "-fwhopr -shared" }
+
+int X;
diff --git a/gcc/testsuite/g++.dg/lto/20090313_1.C b/gcc/testsuite/g++.dg/lto/20090313_1.C
new file mode 100644
index 00000000000..088792b2dd3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20090313_1.C
@@ -0,0 +1,12 @@
+struct Foo {
+ virtual void X();
+ virtual void Y();
+};
+struct Bar: public Foo {
+ Bar(Foo *);
+ void Y();
+};
+void Baz() {
+ Foo f;
+ Bar b(&f);
+}
diff --git a/gcc/testsuite/g++.dg/lto/20090315_0.C b/gcc/testsuite/g++.dg/lto/20090315_0.C
new file mode 100644
index 00000000000..930fb16e5cf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20090315_0.C
@@ -0,0 +1,9 @@
+// { dg-lto-do run }
+struct Foo {
+ bool Mumble() { return true; }
+ static void Bar() { if (foo_->Mumble()) foo_ = 0; }
+ static void Baz() { Bar(); }
+ static Foo *foo_;
+};
+Foo *Foo::foo_;
+main() { return 0; }
diff --git a/gcc/testsuite/g++.dg/lto/20090315_1.C b/gcc/testsuite/g++.dg/lto/20090315_1.C
new file mode 100644
index 00000000000..0a2fba552a6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20090315_1.C
@@ -0,0 +1,7 @@
+struct Foo {
+ bool Mumble() { return true; }
+ static void Bar() { if (foo_->Mumble()) foo_ = 0; }
+ static void Baz() { Bar(); }
+ static Foo *foo_;
+};
+void Unused() { Foo::Bar(); Foo::Baz(); }
diff --git a/gcc/testsuite/g++.dg/lto/20091002-1_0.C b/gcc/testsuite/g++.dg/lto/20091002-1_0.C
new file mode 100644
index 00000000000..ad1ecf673f5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20091002-1_0.C
@@ -0,0 +1,58 @@
+// { dg-lto-do link }
+// { dg-lto-options {{-fPIC -flto}} }
+// { dg-extra-ld-options "-fPIC -shared" }
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+ template<class _CharT> struct char_traits;
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_ostream;
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class istreambuf_iterator;
+ typedef basic_ostream<char> ostream;
+ template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
+ class num_get;
+ class locale {
+ class facet;
+ };
+ class locale::facet {
+ };
+ enum _Ios_Iostate { _S_beg = 0, _S_cur = 1, _S_end = 2,
+ _S_ios_seekdir_end = 1L << 16 };
+ class ios_base {
+ public:
+ typedef _Ios_Iostate iostate;
+ };
+ template<typename _CharT, typename _InIter>
+ class num_get : public locale::facet {
+ typedef _InIter iter_type;
+ template<typename _ValueT> iter_type
+ _M_extract_int(iter_type, iter_type, ios_base&,
+ ios_base::iostate&, _ValueT&) const;
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, bool&) const;
+ };
+ extern template class num_get<char>;
+ template<typename _CharT, typename _Traits>
+ class basic_ios : public ios_base {
+ typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
+ __num_get_type;
+ const __num_get_type* _M_num_get;
+ };
+ template<typename _CharT, typename _Traits>
+ class basic_ostream : virtual public basic_ios<_CharT, _Traits> {
+ public:
+ typedef basic_ostream<_CharT, _Traits> __ostream_type;
+ __ostream_type& operator<<(double __f) { }
+ };
+ typedef double Real;
+ class Vector {
+ public:
+ Real operator[](int n) const { }
+ };
+ std::ostream& operator<<(std::ostream& s, const Vector& vec)
+ {
+ int i;
+ s << vec[i] << ')';
+ }
+}
diff --git a/gcc/testsuite/g++.dg/lto/20091002-2_0.C b/gcc/testsuite/g++.dg/lto/20091002-2_0.C
new file mode 100644
index 00000000000..5b000fa580c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20091002-2_0.C
@@ -0,0 +1,20 @@
+// { dg-lto-do link }
+// { dg-lto-options {{-fPIC}} }
+// { dg-extra-ld-options "-fPIC -shared" }
+
+class DataArray {
+ int max() const { }
+};
+template < class HashItem >
+class DataHashTable {
+ template < class ElemHashItem >
+ class Element { };
+ typedef Element< HashItem > Elem;
+ DataArray m_elem;
+};
+class Name { };
+class NameSet {
+ DataHashTable < Name > hashtab;
+};
+NameSet p;
+
diff --git a/gcc/testsuite/g++.dg/lto/20091002-3_0.C b/gcc/testsuite/g++.dg/lto/20091002-3_0.C
new file mode 100644
index 00000000000..7ed81559dd3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20091002-3_0.C
@@ -0,0 +1,15 @@
+// { dg-lto-do link }
+// { dg-lto-options {{-fPIC}} }
+// { dg-extra-ld-options "-fPIC -shared" }
+
+template < class T >
+class DataArray {
+ int max() const { }
+};
+class Name { };
+class DataHashTable {
+ template < class ElemHashItem > class Element { };
+ DataArray < Element < Name > > m_elem;
+};
+DataHashTable p;
+
diff --git a/gcc/testsuite/g++.dg/lto/20091004-1_0.C b/gcc/testsuite/g++.dg/lto/20091004-1_0.C
new file mode 100644
index 00000000000..d65cf29fff1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20091004-1_0.C
@@ -0,0 +1,35 @@
+// { dg-lto-do link }
+// { dg-lto-options {{-fPIC -O -flto}} }
+
+typedef double Real;
+class Vector {
+ int dimen;
+ Real* val;
+public:
+ Vector& operator=(const Vector& vec);
+ Vector(int p_dimen, Real *p_val)
+ : dimen(p_dimen), val(p_val) { }
+ int dim() const;
+};
+class DVector : public Vector {
+public:
+ void reDim(int newdim);
+ explicit DVector(const Vector& old);
+ DVector& operator=(const Vector& vec) {
+ reDim(vec.dim());
+ Vector::operator=(vec);
+ }
+};
+Vector& Vector::operator=(const Vector& vec)
+{
+ dimen = vec.dimen;
+ val = vec.val;
+}
+int Vector::dim() const { return dimen; }
+DVector::DVector(const Vector& old) : Vector(0, 0)
+{
+ *this = old;
+}
+void DVector::reDim(int newdim) {}
+int main() {}
+
diff --git a/gcc/testsuite/g++.dg/lto/20091004-1_1.C b/gcc/testsuite/g++.dg/lto/20091004-1_1.C
new file mode 100644
index 00000000000..0328abaae27
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20091004-1_1.C
@@ -0,0 +1,26 @@
+typedef double Real;
+class Vector {
+ int dimen;
+ Real* val;
+public:
+ Vector& operator=(const Vector& vec);
+ Vector(int p_dimen, Real *p_val)
+ : dimen(p_dimen), val(p_val) { }
+ int dim() const;
+};
+class DVector : public Vector {
+public:
+ void reDim(int newdim);
+ explicit DVector(const Vector& old);
+ DVector& operator=(const Vector& vec) {
+ reDim(vec.dim());
+ Vector::operator=(vec);
+ }
+};
+class SLUFactor {
+ DVector vec;
+ void solveRight (Vector& x, const Vector& b);
+};
+void SLUFactor::solveRight (Vector& x, const Vector& b) {
+ vec = b;
+}
diff --git a/gcc/testsuite/g++.dg/lto/20091004-2_0.C b/gcc/testsuite/g++.dg/lto/20091004-2_0.C
new file mode 100644
index 00000000000..321e50bc28d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20091004-2_0.C
@@ -0,0 +1,29 @@
+// { dg-lto-do link }
+// { dg-lto-options {{-fPIC -O -flto}} }
+
+typedef double Real;
+class Vector {
+ int dimen;
+ Real* val;
+public:
+ Vector& operator=(const Vector& vec);
+ Vector(int p_dimen, Real *p_val)
+ : dimen(p_dimen), val(p_val) { }
+ int dim() const;
+};
+class DVector : public Vector {
+public:
+ void reDim(int newdim);
+ explicit DVector(const Vector& old);
+ DVector& operator=(const Vector& vec) {
+ reDim(vec.dim());
+ Vector::operator=(vec);
+ }
+};
+class SLUFactor {
+ DVector vec;
+ void solveRight (Vector& x, const Vector& b);
+};
+void SLUFactor::solveRight (Vector& x, const Vector& b) {
+ vec = b;
+}
diff --git a/gcc/testsuite/g++.dg/lto/20091004-2_1.C b/gcc/testsuite/g++.dg/lto/20091004-2_1.C
new file mode 100644
index 00000000000..9bbcd51f754
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20091004-2_1.C
@@ -0,0 +1,32 @@
+typedef double Real;
+class Vector {
+ int dimen;
+ Real* val;
+public:
+ Vector& operator=(const Vector& vec);
+ Vector(int p_dimen, Real *p_val)
+ : dimen(p_dimen), val(p_val) { }
+ int dim() const;
+};
+class DVector : public Vector {
+public:
+ void reDim(int newdim);
+ explicit DVector(const Vector& old);
+ DVector& operator=(const Vector& vec) {
+ reDim(vec.dim());
+ Vector::operator=(vec);
+ }
+};
+Vector& Vector::operator=(const Vector& vec)
+{
+ dimen = vec.dimen;
+ val = vec.val;
+}
+int Vector::dim() const { return dimen; }
+DVector::DVector(const Vector& old) : Vector(0, 0)
+{
+ *this = old;
+}
+void DVector::reDim(int newdim) {}
+int main() {}
+
diff --git a/gcc/testsuite/g++.dg/lto/20091004-3_0.C b/gcc/testsuite/g++.dg/lto/20091004-3_0.C
new file mode 100644
index 00000000000..124eea5e4eb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20091004-3_0.C
@@ -0,0 +1,18 @@
+// { dg-lto-do assemble }
+// { dg-lto-options {{-O -flto}} }
+
+extern "C" double sqrt (double __x) throw ();
+typedef double VECTOR[3];
+enum { X = 0, Y = 1, Z = 2, T = 3 };
+inline void VLength(double& a, const VECTOR b)
+{
+ a = sqrt(b[X] * b[X] + b[Y] * b[Y] + b[Z] * b[Z]);
+}
+void
+determine_subpatch_flatness(void)
+{
+ double temp1;
+ VECTOR TempV;
+ VLength(temp1, TempV);
+ VLength(temp1, TempV);
+}
diff --git a/gcc/testsuite/g++.dg/lto/20091004-3_1.C b/gcc/testsuite/g++.dg/lto/20091004-3_1.C
new file mode 100644
index 00000000000..641c7495b4f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20091004-3_1.C
@@ -0,0 +1,16 @@
+extern "C" double sqrt (double __x) throw ();
+typedef double VECTOR[3];
+enum { X = 0, Y = 1, Z = 2, T = 3 };
+inline void VLength(double& a, const VECTOR b)
+{
+ a = sqrt(b[X] * b[X] + b[Y] * b[Y] + b[Z] * b[Z]);
+}
+int
+All_Torus_Intersections(void)
+{
+ double len;
+ VECTOR D;
+ VLength(len, D);
+ VLength(len, D);
+}
+
diff --git a/gcc/testsuite/g++.dg/lto/20091022-1_0.C b/gcc/testsuite/g++.dg/lto/20091022-1_0.C
new file mode 100644
index 00000000000..cb3f20a4ed2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20091022-1_0.C
@@ -0,0 +1,13 @@
+// { dg-lto-do link }
+// { dg-extra-ld-options "-fwhole-program" }
+
+template <int dim>
+struct AutoDerivativeFunction {
+ virtual void gradient_list (void);
+};
+template <int dim>
+void AutoDerivativeFunction<dim>::gradient_list (void)
+{
+}
+template class AutoDerivativeFunction<1>;
+int main() {}
diff --git a/gcc/testsuite/g++.dg/lto/20091022-2_0.C b/gcc/testsuite/g++.dg/lto/20091022-2_0.C
new file mode 100644
index 00000000000..29ed9b6b0a0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20091022-2_0.C
@@ -0,0 +1,12 @@
+// { dg-lto-do link }
+// { dg-lto-options {{-O3 -flto -Winline}} }
+
+#include <string>
+
+int
+main()
+{
+ std::string i;
+ i = "abc";
+}
+
diff --git a/gcc/testsuite/g++.dg/lto/20091026-1_0.C b/gcc/testsuite/g++.dg/lto/20091026-1_0.C
new file mode 100644
index 00000000000..5c74f29cc4c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20091026-1_0.C
@@ -0,0 +1,11 @@
+// { dg-lto-do link }
+// { dg-extra-ld-options "-r -nostdlib" }
+
+#include "20091026-1_a.h"
+cObject *cHead::find(const char *objname) const
+{
+ return firstchildp;
+}
+class cNetworkType : public cObject { };
+cNetworkType *networktype;
+
diff --git a/gcc/testsuite/g++.dg/lto/20091026-1_1.C b/gcc/testsuite/g++.dg/lto/20091026-1_1.C
new file mode 100644
index 00000000000..28816100e29
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20091026-1_1.C
@@ -0,0 +1,14 @@
+#include "20091026-1_a.h"
+extern cHead networks;
+class cNetworkType;
+inline cNetworkType *findNetwork(const char *s)
+{
+ return (cNetworkType *)networks.find(s);
+}
+int run(const char *opt_network_name)
+{
+ cNetworkType *network = findNetwork(opt_network_name);
+ if (!network)
+ throw 1;
+}
+
diff --git a/gcc/testsuite/g++.dg/lto/20091026-1_a.h b/gcc/testsuite/g++.dg/lto/20091026-1_a.h
new file mode 100644
index 00000000000..314dd9610a4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20091026-1_a.h
@@ -0,0 +1,9 @@
+class cObject {
+public:
+ cObject *firstchildp;
+};
+class cHead : public cObject {
+public:
+ cObject *find(const char *objname) const;
+};
+
diff --git a/gcc/testsuite/g++.dg/lto/README b/gcc/testsuite/g++.dg/lto/README
new file mode 100644
index 00000000000..5fa3123b42d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/README
@@ -0,0 +1,35 @@
+This directory contains tests for link-time optimization (LTO).
+Tests in this directory may span multiple files, so the naming of
+the files is significant.
+
+The name of every file must end with '_N' where N is an integer.
+All the files with the same name base and different _N suffixes
+will be compiled separately and linked together to form the final
+executable.
+
+By default, each set of files will be compiled with list of
+options listed in LTO_OPTIONS (../../lib/lto.exp), which can be
+overwritten in the shell environment or using the 'dg-lto-options'
+command in the main file of the set (i.e., the file with _0
+suffix).
+
+For example, given the files a_0.C a_1.C a_2.C, they will be
+compiled as:
+
+$ g++ -c <flags> a_0.C
+$ g++ -c <flags> a_1.C
+$ g++ -c <flags> a_2.C
+$ g++ -o <executable> a_0.o a_1.o a_2.o
+
+Tests that do not need more than one file are a special case
+where there is a single file named 'foo_0.C'.
+
+The only supported dg-lto-do option are 'compile', 'run' and 'link'.
+Additionally, these can only be used in the main file. If
+'compile' is used, only the individual object files are
+generated. If 'link' is used, the final executable is generated
+but not executed (in this case, function main() needs to exist
+but it does not need to do anything). If 'run' is used, the
+final executable is generated and the resulting binary executed.
+
+The default value for dg-lto-do is 'run'.
diff --git a/gcc/testsuite/g++.dg/lto/lto.exp b/gcc/testsuite/g++.dg/lto/lto.exp
new file mode 100644
index 00000000000..d19bad88927
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/lto.exp
@@ -0,0 +1,58 @@
+# Copyright (C) 2009 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+#
+# Contributed by Diego Novillo <dnovillo@google.com>
+
+
+# Test link-time optimization across multiple files.
+#
+# Programs are broken into multiple files. Each one is compiled
+# separately with LTO information. The final executable is generated
+# by collecting all the generated object files using regular LTO or WHOPR.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+# Load procedures from common libraries.
+load_lib standard.exp
+load_lib g++.exp
+load_lib target-libpath.exp
+
+# Load the language-independent compabibility support procedures.
+load_lib lto.exp
+
+g++_init
+lto_init
+
+# Define an identifier for use with this suite to avoid name conflicts
+# with other lto tests running at the same time.
+set sid "cp_lto"
+
+# If LTO has not been enabled, bail.
+if { ![check_effective_target_lto] } {
+ return
+}
+
+# Main loop.
+foreach src [lsort [find $srcdir/$subdir *_0.C]] {
+ # If we're only testing specific files and this isn't one of them, skip it.
+ if ![runtest_file_p $runtests $src] then {
+ continue
+ }
+
+ lto-execute $src $sid
+}
diff --git a/gcc/testsuite/g++.dg/lto/pr40818_0.C b/gcc/testsuite/g++.dg/lto/pr40818_0.C
new file mode 100644
index 00000000000..8430f9cd015
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/pr40818_0.C
@@ -0,0 +1,11 @@
+// { dg-lto-do assemble }
+// Test case from Eugene A. Strizhov.
+
+extern int i;
+struct S { S (); };
+
+S::S ()
+{
+ enum { fifty = 0x50 };
+ if (i > fifty);
+}
diff --git a/gcc/testsuite/g++.dg/opt/eh5.C b/gcc/testsuite/g++.dg/opt/eh5.C
new file mode 100644
index 00000000000..3557ab2aa54
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/eh5.C
@@ -0,0 +1,43 @@
+// PR 41377
+// { dg-do compile }
+// { dg-options "-O3" }
+
+struct A
+{
+ bool foo(int*) const;
+} a;
+
+struct B {};
+
+struct B1 : B
+{
+ bool (A::*pmf)(int*) const;
+ const A* pa;
+
+ B1() : pmf(&A::foo), pa(&a) {}
+ bool operator()() const { return (pa->*pmf)(new int); }
+};
+
+struct B2 : B
+{
+ B1 b1;
+
+ B2(const B1& _b1) : b1(_b1) {}
+ bool operator()() const { return b1(); }
+};
+
+template<int> struct C
+{
+ void bar(B2 b2) { while (b2()) ; }
+ C() { bar(B2(B1())); }
+};
+
+void baz(int i)
+{
+ switch(i)
+ {
+ case 0: new C<0>;
+ case 1: new C<1>;
+ case 2: new C<2>;
+ }
+}
diff --git a/gcc/testsuite/g++.dg/opt/inline16.C b/gcc/testsuite/g++.dg/opt/inline16.C
new file mode 100644
index 00000000000..6ee6d76d925
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/inline16.C
@@ -0,0 +1,19 @@
+// PR c++/36959
+// We shouldn't have to emit fromSlotB just because we need shuf_BZZZ.
+// { dg-options -O }
+// { dg-final { scan-assembler-not "_ZL9fromSlotBv" } }
+
+static inline int *fromSlotB(void)
+{
+ static int shuf_BZZZ = 1;
+ return &shuf_BZZZ;
+}
+
+int *p;
+
+int main(void)
+{
+ p = fromSlotB();
+ return (*p != 1);
+}
+
diff --git a/gcc/testsuite/g++.dg/opt/thunk3-1.C b/gcc/testsuite/g++.dg/opt/thunk3-1.C
new file mode 100644
index 00000000000..c540b0fa2b4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/thunk3-1.C
@@ -0,0 +1,6 @@
+// { dg-do compile }
+// { dg-options "-O1" }
+struct Foo { };
+struct Bar { virtual ~Bar(); };
+struct Baz: public virtual Bar { virtual void Func (Foo); };
+void unused() { Baz().Func(Foo()); }
diff --git a/gcc/testsuite/g++.dg/opt/thunk4.C b/gcc/testsuite/g++.dg/opt/thunk4.C
new file mode 100644
index 00000000000..7dd5ea4338b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/thunk4.C
@@ -0,0 +1,63 @@
+// { dg-do compile }
+// { dg-options "-O1" }
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+ template < class _CharT > struct char_traits;
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+ template < typename _CharT, typename _Traits =
+ char_traits < _CharT > >class basic_iostream;
+}
+
+extern "C++"
+{
+ namespace std
+ {
+ class exception
+ {
+ public:exception () throw ()
+ {
+ }
+ };
+ }
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+ class ios_base
+ {
+ public:class failure:public exception
+ {
+ };
+ virtual ~ ios_base ();
+ };
+template < typename _CharT, typename _Traits > class basic_ios:public
+ ios_base
+ {
+ };
+template < typename _CharT, typename _Traits > class basic_ostream:virtual public basic_ios < _CharT,
+ _Traits
+ >
+ {
+ };
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+template < typename _CharT, typename _Traits > class basic_istream:virtual public basic_ios < _CharT,
+ _Traits
+ >
+ {
+ };
+template < typename _CharT, typename _Traits > class basic_iostream:public basic_istream < _CharT, _Traits >, public basic_ostream < _CharT,
+ _Traits
+ >
+ {
+ };
+ class strstream:public basic_iostream < char >
+ {
+ virtual ~ strstream ();
+ };
+ strstream::~strstream ()
+ {
+ }
+}
diff --git a/gcc/testsuite/g++.dg/opt/vt1.C b/gcc/testsuite/g++.dg/opt/vt1.C
index ea74f52126f..ba871fba2d8 100644
--- a/gcc/testsuite/g++.dg/opt/vt1.C
+++ b/gcc/testsuite/g++.dg/opt/vt1.C
@@ -2,6 +2,7 @@
// { dg-do compile { target fpic } }
// { dg-options "-O2 -fpic -fno-rtti" }
// { dg-skip-if "requires unsupported run-time relocation" { spu-*-* } { "*" } { "" } }
+// { dg-skip-if "No Windows PIC" { *-*-mingw* *-*-cygwin } { "*" } { "" } }
// Origin: Jakub Jelinek <jakub@redhat.com>
struct S
diff --git a/gcc/testsuite/g++.dg/other/anon3.C b/gcc/testsuite/g++.dg/other/anon3.C
index 87cbfb544cd..87116eb8901 100644
--- a/gcc/testsuite/g++.dg/other/anon3.C
+++ b/gcc/testsuite/g++.dg/other/anon3.C
@@ -4,4 +4,4 @@
// { dg-do compile }
-enum { a = 3 } x;
+enum { a = 3 } x; // { dg-warning "anonymous type" }
diff --git a/gcc/testsuite/g++.dg/other/first-global.C b/gcc/testsuite/g++.dg/other/first-global.C
index a993a9d5175..0f39a8abb73 100644
--- a/gcc/testsuite/g++.dg/other/first-global.C
+++ b/gcc/testsuite/g++.dg/other/first-global.C
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-fpie" { target { ! nonpic } } } */
+/* { dg-add-options bind_pic_locally } */
/* { dg-final { scan-assembler "_GLOBAL__I(_|_65535_0_)foobar" } } */
struct foo { foo (); };
diff --git a/gcc/testsuite/g++.dg/other/i386-2.C b/gcc/testsuite/g++.dg/other/i386-2.C
index 4c9579d07cd..1ef6b2775d8 100644
--- a/gcc/testsuite/g++.dg/other/i386-2.C
+++ b/gcc/testsuite/g++.dg/other/i386-2.C
@@ -1,8 +1,9 @@
-/* Test that {,x,e,p,t,s,w,a,i}mmintrin.h, fma4intrin.h, mm3dnow.h and
+/* Test that {,x,e,p,t,s,w,a,i}mmintrin.h, fma4intrin.h, xopintrin.h, mm3dnow.h and
mm_malloc.h are usable with -O -pedantic-errors. */
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
-/* { dg-options "-O -pedantic-errors -march=k8 -m3dnow -mavx -msse4a -mfma4 -maes -mpclmul" } */
+/* { dg-options "-O -pedantic-errors -march=k8 -m3dnow -mavx -msse4a -mfma4 -mxop -maes -mpclmul" } */
#include <x86intrin.h>
int dummy;
+
diff --git a/gcc/testsuite/g++.dg/other/i386-3.C b/gcc/testsuite/g++.dg/other/i386-3.C
index b9e89169ccb..df33af8bbd9 100644
--- a/gcc/testsuite/g++.dg/other/i386-3.C
+++ b/gcc/testsuite/g++.dg/other/i386-3.C
@@ -1,6 +1,6 @@
-/* Test that {,x,e,p,t,s,w,a,i}mmintrin.h, fma4intrin.h, mm3dnow.h and
+/* Test that {,x,e,p,t,s,w,a,i}mmintrin.h, fma4intrin.h, mm3dnow.h, xopintrin.h and
mm_malloc.h are usable with -O -fkeep-inline-functions. */
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
-/* { dg-options "-O -fkeep-inline-functions -march=k8 -m3dnow -mavx -msse4a -mfma4 -maes -mpclmul" } */
+/* { dg-options "-O -fkeep-inline-functions -march=k8 -m3dnow -mavx -msse4a -mfma4 -mxop -maes -mpclmul" } */
#include <x86intrin.h>
diff --git a/gcc/testsuite/g++.dg/other/i386-5.C b/gcc/testsuite/g++.dg/other/i386-5.C
index 6dcb2d3b0d0..383aae365bb 100644
--- a/gcc/testsuite/g++.dg/other/i386-5.C
+++ b/gcc/testsuite/g++.dg/other/i386-5.C
@@ -1,6 +1,6 @@
-/* Test that {,x,e,p,t,s,w,a,i}mmintrin.h, fma4intrin.h, mm3dnow.h and
+/* Test that {,x,e,p,t,s,w,a,i}mmintrin.h, fma4intrin.h, xopintrin.h, mm3dnow.h and
mm_malloc.h are usable with -O -fkeep-inline-functions. */
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
-/* { dg-options "-O -fkeep-inline-functions -march=k8 -m3dnow -mavx -msse4a -mfma4 -maes -mpclmul" } */
+/* { dg-options "-O -fkeep-inline-functions -march=k8 -m3dnow -mavx -msse4a -mfma4 -mxop -maes -mpclmul" } */
#include <x86intrin.h>
diff --git a/gcc/testsuite/g++.dg/other/i386-6.C b/gcc/testsuite/g++.dg/other/i386-6.C
index 4c9579d07cd..2bd4609d671 100644
--- a/gcc/testsuite/g++.dg/other/i386-6.C
+++ b/gcc/testsuite/g++.dg/other/i386-6.C
@@ -1,7 +1,7 @@
-/* Test that {,x,e,p,t,s,w,a,i}mmintrin.h, fma4intrin.h, mm3dnow.h and
+/* Test that {,x,e,p,t,s,w,a,i}mmintrin.h, fma4intrin.h, xopintrin.h, mm3dnow.h and
mm_malloc.h are usable with -O -pedantic-errors. */
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
-/* { dg-options "-O -pedantic-errors -march=k8 -m3dnow -mavx -msse4a -mfma4 -maes -mpclmul" } */
+/* { dg-options "-O -pedantic-errors -march=k8 -m3dnow -mavx -msse4a -mfma4 -mxop -maes -mpclmul" } */
#include <x86intrin.h>
diff --git a/gcc/testsuite/g++.dg/other/i386-7.C b/gcc/testsuite/g++.dg/other/i386-7.C
new file mode 100644
index 00000000000..e2ad51e528d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/i386-7.C
@@ -0,0 +1,8 @@
+/* Test that x86intrin.h is usable with -O -pedantic-errors. */
+/* We were using SSE4.2 builtins without the extension available. */
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O -pedantic-errors" } */
+
+#include <x86intrin.h>
+
+int dummy;
diff --git a/gcc/testsuite/g++.dg/other/offsetof6.C b/gcc/testsuite/g++.dg/other/offsetof6.C
new file mode 100644
index 00000000000..b77d1b99a77
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/offsetof6.C
@@ -0,0 +1,26 @@
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// Origin PR c++/38699
+// { dg-do compile }
+
+template<class T>
+struct A
+{
+ const T *p;
+};
+
+struct B
+{
+ A<int> a;
+};
+
+template class A<char>;
+
+void
+f0 ()
+{
+ __builtin_offsetof(A<char>, p); // OK
+ __builtin_offsetof(A<char>, p[1]); // { dg-error "non constant address" }
+ __builtin_offsetof(B, a.p); // OK
+ __builtin_offsetof(B, a.p[1]); // { dg-error "non constant address" }
+}
+
diff --git a/gcc/testsuite/g++.dg/other/ptrmem10.C b/gcc/testsuite/g++.dg/other/ptrmem10.C
new file mode 100644
index 00000000000..4b8c40ac8ec
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/ptrmem10.C
@@ -0,0 +1,29 @@
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// Origin PR c++/37093
+
+template <class C, void (C::*M) ()>
+static
+void foo(void *obj)
+{
+ C *p = static_cast<C*>(obj);
+ (p->*M)();
+}
+
+template <class C>
+static void
+bar(C *c, void (C::*m) ())
+{
+ foo<C,m>((void *)c);// { dg-error "(not a valid template arg|pointer-to-member|no matching fun)" }
+}
+
+struct S
+{
+ void baz () {}
+};
+
+int
+main ()
+{
+ S a;
+ bar(&a, &S::baz);
+}
diff --git a/gcc/testsuite/g++.dg/other/ptrmem11.C b/gcc/testsuite/g++.dg/other/ptrmem11.C
new file mode 100644
index 00000000000..a850c55c40a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/ptrmem11.C
@@ -0,0 +1,21 @@
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// Origin PR c++/37093
+
+struct A {};
+
+template <int A::* p>
+int
+foo(A* q)
+{
+ return q->*p;
+}
+
+template <typename T>
+int
+bar(int T::* p)
+{
+ return foo<p>(0);// { dg-error "(not a valid template arg|no matching func|pointer-to-member)" }
+}
+
+int i = bar<A>(0);
+
diff --git a/gcc/testsuite/g++.dg/parse/attr-externally-visible-1.C b/gcc/testsuite/g++.dg/parse/attr-externally-visible-1.C
index dbdab88af2d..845d873aacb 100644
--- a/gcc/testsuite/g++.dg/parse/attr-externally-visible-1.C
+++ b/gcc/testsuite/g++.dg/parse/attr-externally-visible-1.C
@@ -1,6 +1,6 @@
// { dg-do compile }
// { dg-options "-O3 -fwhole-program" }
-// { dg-options "-O3 -fwhole-program -fpie" { target { ! nonpic } } }
+// { dg-add-options bind_pic_locally }
// { dg-final { scan-assembler "foo1" } }
// { dg-final { scan-assembler "foo2" } }
// { dg-final { scan-assembler "foo3" } }
diff --git a/gcc/testsuite/g++.dg/parse/eh-decl.C b/gcc/testsuite/g++.dg/parse/eh-decl.C
new file mode 100644
index 00000000000..1c72fd39f55
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/eh-decl.C
@@ -0,0 +1,8 @@
+// PR c++/41876
+
+struct A;
+
+void foo()
+{
+ try {} catch(int A) {}
+}
diff --git a/gcc/testsuite/g++.dg/parse/error36.C b/gcc/testsuite/g++.dg/parse/error36.C
new file mode 100644
index 00000000000..92101e9c99f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/error36.C
@@ -0,0 +1,17 @@
+// Test for helpful error message about missing typename.
+
+template <class T> struct A { typedef T foo; typedef T bar; };
+template <class T>
+void f(T t)
+{
+ typedef A<T>::foo type; // { dg-error "typename" }
+ A<T>::bar b; // { dg-error "typename" }
+} // { dg-error "expected ';'" "" { target *-*-* } 8 }
+
+template <class T> struct B
+{
+ void f()
+ {
+ A<T>::baz z; // { dg-error "typename" }
+ } // { dg-error "expected ';'" "" { target *-*-* } 15 }
+};
diff --git a/gcc/testsuite/g++.dg/plugin/attribute_plugin-test-1.C b/gcc/testsuite/g++.dg/plugin/attribute_plugin-test-1.C
index abb1328670a..1ca321d1fde 100644
--- a/gcc/testsuite/g++.dg/plugin/attribute_plugin-test-1.C
+++ b/gcc/testsuite/g++.dg/plugin/attribute_plugin-test-1.C
@@ -1,4 +1,4 @@
-// { dg-warning "Callback to register attributes" }
+// { dg-warning "Callback to register attributes" "" { target *-*-* } 0 }
void normal_func (char c, char c2);
void normal_func (char __attribute__((user("param"))) c, char);
diff --git a/gcc/testsuite/g++.dg/plugin/dumb_plugin.c b/gcc/testsuite/g++.dg/plugin/dumb_plugin.c
index 18f42c09dcb..8a160771b13 100644
--- a/gcc/testsuite/g++.dg/plugin/dumb_plugin.c
+++ b/gcc/testsuite/g++.dg/plugin/dumb_plugin.c
@@ -82,7 +82,7 @@ int
plugin_init (struct plugin_name_args *plugin_info,
struct plugin_gcc_version *version)
{
- struct plugin_pass pass_info;
+ struct register_pass_info pass_info;
const char *plugin_name = plugin_info->base_name;
int argc = plugin_info->argc;
struct plugin_argument *argv = plugin_info->argv;
diff --git a/gcc/testsuite/g++.dg/plugin/plugin.exp b/gcc/testsuite/g++.dg/plugin/plugin.exp
index 4ba73e53dac..72de92dfd42 100644
--- a/gcc/testsuite/g++.dg/plugin/plugin.exp
+++ b/gcc/testsuite/g++.dg/plugin/plugin.exp
@@ -48,6 +48,7 @@ load_lib plugin-support.exp
# plugin_test_list={ {plugin1 test1 test2 ...} {plugin2 test1 ...} ... }
set plugin_test_list [list \
{ attribute_plugin.c attribute_plugin-test-1.C } \
+ { pragma_plugin.c pragma_plugin-test-1.C } \
{ selfassign.c self-assign-test-1.C self-assign-test-2.C self-assign-test-3.C } \
{ dumb_plugin.c dumb-plugin-test-1.C } \
{ header_plugin.c header-plugin-test.C } ]
diff --git a/gcc/testsuite/g++.dg/plugin/pragma_plugin-test-1.C b/gcc/testsuite/g++.dg/plugin/pragma_plugin-test-1.C
new file mode 100644
index 00000000000..3c084208b71
--- /dev/null
+++ b/gcc/testsuite/g++.dg/plugin/pragma_plugin-test-1.C
@@ -0,0 +1,18 @@
+// { dg-warning "Callback to register pragmas" "" { target *-*-* } 0 }
+
+int some_func (int c);
+
+#pragma GCCPLUGIN sayhello "here" // { dg-warning "'pragma GCCPLUGIN sayhello' outside of function: here" }
+
+int some_func (const char* s)
+{
+#pragma GCCPLUGIN sayhello "at start" // { dg-warning "'pragma GCCPLUGIN sayhello' from function 'some_func': at start" }
+
+#define DO_PRAGMA(x) _Pragma(#x)
+ if (!s)
+ {
+ DO_PRAGMA(GCCPLUGIN sayhello "in block"); // { dg-warning "'pragma GCCPLUGIN sayhello' from function 'some_func': in block" }
+ return 0;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.dg/plugin/pragma_plugin.c b/gcc/testsuite/g++.dg/plugin/pragma_plugin.c
new file mode 100644
index 00000000000..237fcdddfa9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/plugin/pragma_plugin.c
@@ -0,0 +1,60 @@
+/* Demonstrates how to add custom pragmas */
+
+#include "gcc-plugin.h"
+#include <stdlib.h>
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "rtl.h"
+#include "tree.h"
+#include "function.h"
+#include "c-pragma.h"
+#include "cpplib.h"
+#include "tree-pass.h"
+#include "intl.h"
+
+int plugin_is_GPL_compatible;
+
+
+/* handler of #pragma GCCPLUGIN sayhello "message" is quite similar to
+ handler of #pragma GCC message...*/
+
+static void
+handle_pragma_sayhello (cpp_reader *dummy)
+{
+ tree message = 0;
+ if (pragma_lex (&message) != CPP_STRING)
+ {
+ warning (OPT_Wpragmas, "%<#pragma GCCPLUGIN sayhello%> is not a string");
+ return;
+ }
+ if (TREE_STRING_LENGTH (message) > 1)
+ if (cfun)
+ warning (OPT_Wpragmas,
+ "%<pragma GCCPLUGIN sayhello%> from function %qE: %s",
+ cfun->decl, TREE_STRING_POINTER (message));
+ else
+ warning (OPT_Wpragmas,
+ "%<pragma GCCPLUGIN sayhello%> outside of function: %s",
+ TREE_STRING_POINTER (message));
+}
+
+/* Plugin callback called during pragma registration */
+
+static void
+register_my_pragma (void *event_data, void *data)
+{
+ warning (0, G_("Callback to register pragmas"));
+ c_register_pragma ("GCCPLUGIN", "sayhello", handle_pragma_sayhello);
+}
+
+int
+plugin_init (struct plugin_name_args *plugin_info,
+ struct plugin_gcc_version *version)
+{
+ const char *plugin_name = plugin_info->base_name;
+
+ register_callback (plugin_name, PLUGIN_PRAGMAS, register_my_pragma, NULL);
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/plugin/selfassign.c b/gcc/testsuite/g++.dg/plugin/selfassign.c
index 2be48156d6d..6dade300ff0 100644
--- a/gcc/testsuite/g++.dg/plugin/selfassign.c
+++ b/gcc/testsuite/g++.dg/plugin/selfassign.c
@@ -298,7 +298,7 @@ int
plugin_init (struct plugin_name_args *plugin_info,
struct plugin_gcc_version *version)
{
- struct plugin_pass pass_info;
+ struct register_pass_info pass_info;
const char *plugin_name = plugin_info->base_name;
int argc = plugin_info->argc;
struct plugin_argument *argv = plugin_info->argv;
diff --git a/gcc/testsuite/g++.dg/rtti/typeid9.C b/gcc/testsuite/g++.dg/rtti/typeid9.C
new file mode 100644
index 00000000000..381252dc6b0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/rtti/typeid9.C
@@ -0,0 +1,21 @@
+// Test that the typeid name for a local class is properly null-terminated.
+// { dg-do run }
+
+#include <string.h>
+#include <typeinfo>
+#include <stdio.h>
+
+int f()
+{
+ struct A {}; struct B {};
+ const std::type_info &ti = typeid(A);
+ const std::type_info &ti2 = typeid(B);
+ puts (ti.name());
+ puts (ti2.name());
+ return strcmp (ti.name(), "Z1fvE1A") || strcmp (ti2.name(), "Z1fvE1B");
+}
+
+int main()
+{
+ return f();
+}
diff --git a/gcc/testsuite/g++.dg/template/arg2.C b/gcc/testsuite/g++.dg/template/arg2.C
index 1314b258fef..9fb7a68cc78 100644
--- a/gcc/testsuite/g++.dg/template/arg2.C
+++ b/gcc/testsuite/g++.dg/template/arg2.C
@@ -10,5 +10,5 @@ template <typename T> class X {};
void fn ()
{
class L {};
- X<L> f;
+ X<L> f; // { dg-error "uses local type|trying to instantiate|no type|invalid type" "" }
}
diff --git a/gcc/testsuite/g++.dg/template/crash56.C b/gcc/testsuite/g++.dg/template/crash56.C
index 1efa3500d8a..03bddf42a57 100644
--- a/gcc/testsuite/g++.dg/template/crash56.C
+++ b/gcc/testsuite/g++.dg/template/crash56.C
@@ -7,10 +7,10 @@
namespace N
{
- struct A { A (A*); }; // { dg-error "lookup finds" "" }
+ struct A { A (A*); };
}
template<typename T> void g (N::A *p)
{
- (void) A (p); // { dg-error "in call" "" }
+ (void) A (p); // { dg-message "" "" }
}
diff --git a/gcc/testsuite/g++.dg/template/error26.C b/gcc/testsuite/g++.dg/template/error26.C
index 7545762bf34..cd8d46d1e4f 100644
--- a/gcc/testsuite/g++.dg/template/error26.C
+++ b/gcc/testsuite/g++.dg/template/error26.C
@@ -2,4 +2,4 @@
template<typename> struct A;
-template<typename T> void foo (A<&T::template i>); // { dg-error "T::template i|mismatch|& T::i" }
+template<typename T> void foo (A<&T::template i>); // { dg-error "T:: ?template i|mismatch|& T::i" }
diff --git a/gcc/testsuite/g++.dg/template/explicit-args2.C b/gcc/testsuite/g++.dg/template/explicit-args2.C
new file mode 100644
index 00000000000..cd53b456dcc
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/explicit-args2.C
@@ -0,0 +1,38 @@
+// PR c++/37177
+// { dg-options -std=c++0x }
+
+namespace N1
+{
+ template<class T> bool foo();
+}
+
+struct S
+{
+ template <class T>
+ static bool foo();
+
+ template <class T>
+ bool bar();
+};
+
+template<class T> bool foo();
+
+int main()
+{
+ (void)(&S::bar<int>);
+ decltype(&S::bar<int>) a;
+
+ (void*)(&S::foo<int>);
+ (void)(&S::foo<int>);
+ decltype(&S::foo<int>) b;
+
+ (void*)(&N1::foo<int>);
+ (void)(&N1::foo<int>);
+ decltype(&N1::foo<int>) c;
+
+ (void*)(&foo<int>);
+ (void)(&foo<int>);
+ decltype(&foo<int>) d;
+
+ &foo<int> == 0;
+}
diff --git a/gcc/testsuite/g++.dg/template/explicit-args3.C b/gcc/testsuite/g++.dg/template/explicit-args3.C
new file mode 100644
index 00000000000..c095e6688fd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/explicit-args3.C
@@ -0,0 +1,12 @@
+// PR c++/37177
+
+template <class T>
+struct A { };
+
+template <class T>
+void operator+(T, T); // { dg-error "class or enum" }
+
+int main()
+{
+ operator+<int>; // { dg-error "cannot resolve" }
+}
diff --git a/gcc/testsuite/g++.dg/template/local4.C b/gcc/testsuite/g++.dg/template/local4.C
index 41e2370c395..cfa37364975 100644
--- a/gcc/testsuite/g++.dg/template/local4.C
+++ b/gcc/testsuite/g++.dg/template/local4.C
@@ -4,5 +4,5 @@ template <typename T> void foo() {}
int main () {
struct S {};
- foo<S> ();
+ foo<S> (); // { dg-error "match" }
}
diff --git a/gcc/testsuite/g++.dg/template/nested3.C b/gcc/testsuite/g++.dg/template/nested3.C
index 1ae4bf7647d..5652e178a70 100644
--- a/gcc/testsuite/g++.dg/template/nested3.C
+++ b/gcc/testsuite/g++.dg/template/nested3.C
@@ -5,13 +5,13 @@ class A {
int _k;
};
T1 _t1;
- T2 _t2; // { dg-message "instantiated" }
+ T2 _t2;
};
template <class U>
-class B { // { dg-error "declaration" }
+class B {
class SubB1 {
- B _i; // { dg-error "incomplete type" }
+ B _i;
};
class SubB2 {
@@ -19,7 +19,6 @@ class B { // { dg-error "declaration" }
};
A<U,SubB1>::SubA<SubB2> _a; // { dg-error "not a base type" "not base" }
// { dg-message "note" "note" { target *-*-* } 20 }
- // { dg-message "instantiated" "inst" { target *-*-* } 20 }
// { dg-error "non-template" "non-template" { target *-*-* } 20 }
};
diff --git a/gcc/testsuite/g++.dg/template/overload11.C b/gcc/testsuite/g++.dg/template/overload11.C
new file mode 100644
index 00000000000..d7b0a7c9f1c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/overload11.C
@@ -0,0 +1,27 @@
+// PR c++/39413
+// We don't need to instantiate Wrapper<int> to check the
+// foo(const Thingy&) overload.
+
+template <class T> struct Incomplete;
+
+template <typename T> class Wrapper
+{
+ Incomplete<T> i;
+};
+
+template <typename T> struct Thingy
+{
+ Thingy();
+ Thingy(const Wrapper<T>& v);
+
+ template <typename X> void foo(const Thingy<X>&);
+ void foo(const Thingy&);
+};
+
+int main()
+{
+ Thingy<int> ap1;
+ Thingy<float> bp1;
+
+ ap1.foo(bp1);
+}
diff --git a/gcc/testsuite/g++.dg/template/partial6.C b/gcc/testsuite/g++.dg/template/partial6.C
new file mode 100644
index 00000000000..80bbfe3c138
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/partial6.C
@@ -0,0 +1,31 @@
+// PR c++/41703
+// The second GetAllSize template is more specialized because even though
+// deduction on each parameter type succeeds, we never get a template
+// argument for its X to make it match the first template.
+
+template <typename T, int (T::*)() const>
+struct TSizeEnabler
+{
+ typedef T TClass;
+};
+
+template <typename X>
+int
+GetAllSize(const X &Var)
+{ return sizeof(Var); }
+
+template <typename X>
+int
+GetAllSize(const typename TSizeEnabler<X, &X::func>::TClass &Var)
+{ return Var.func(); }
+
+struct H
+{
+ int func() const;
+};
+
+int main()
+{
+ H b;
+ return GetAllSize< H >(b);
+}
diff --git a/gcc/testsuite/g++.dg/template/scope3.C b/gcc/testsuite/g++.dg/template/scope3.C
new file mode 100644
index 00000000000..c191c79c5ce
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/scope3.C
@@ -0,0 +1,15 @@
+// PR c++/41038
+
+struct S
+{
+ int size() const;
+};
+
+template<typename T>
+struct Packer
+{
+ int foo() {
+ return Packer::var.size();
+ }
+ const S& var;
+};
diff --git a/gcc/testsuite/g++.dg/template/sfinae15.C b/gcc/testsuite/g++.dg/template/sfinae15.C
new file mode 100644
index 00000000000..27bce255db3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/sfinae15.C
@@ -0,0 +1,23 @@
+// PR c++/40944
+// { dg-options -std=c++0x }
+// { dg-do run }
+
+template<typename T>
+struct make { static T&& it(); };
+
+void (*pf)(int&) = 0;
+
+template< typename T >
+int bar(T const& x,
+ decltype( pf(make<T const&>::it()) )* = 0 // SFINAE!
+ ) {
+ return 1;
+}
+
+int bar(...) {
+ return 0;
+}
+
+int main() {
+ return bar(42);
+}
diff --git a/gcc/testsuite/g++.dg/template/sfinae16.C b/gcc/testsuite/g++.dg/template/sfinae16.C
new file mode 100644
index 00000000000..5ea564c9f86
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/sfinae16.C
@@ -0,0 +1,34 @@
+// PR c++/41927
+// { dg-options "-std=c++0x -Wall" }
+
+// We were getting a spurious ||/&& warning about the enable_if with the
+// source position of d1.
+
+template<typename Tp>
+ struct is_int
+ { static const bool value = true; };
+
+template<bool, typename Tp = void>
+ struct enable_if
+ { };
+
+template<typename Tp>
+ struct enable_if<true, Tp>
+ { typedef Tp type; };
+
+template<typename Rep>
+ struct duration
+ {
+ duration() { }
+
+ template<typename Rep2, typename = typename
+ enable_if<false || (true && is_int<Rep2>::value)>::type>
+ duration(const duration<Rep2>&) { }
+ };
+
+int main()
+{
+ duration<int> d0;
+ duration<int> d1 = d0;
+}
+
diff --git a/gcc/testsuite/g++.dg/template/sizeof12.C b/gcc/testsuite/g++.dg/template/sizeof12.C
new file mode 100644
index 00000000000..e165d2aab78
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/sizeof12.C
@@ -0,0 +1,19 @@
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// Origin PR c++/41863
+
+template<int X>
+struct Bar
+{
+};
+
+template<typename T>
+class Foo
+{
+ T m_foo;
+
+ void
+ crash()
+ {
+ Bar<sizeof(m_foo)> bar;
+ }
+};
diff --git a/gcc/testsuite/g++.dg/template/spec35.C b/gcc/testsuite/g++.dg/template/spec35.C
index cae33ed3d1f..709ece5dd90 100644
--- a/gcc/testsuite/g++.dg/template/spec35.C
+++ b/gcc/testsuite/g++.dg/template/spec35.C
@@ -24,6 +24,6 @@ void instantiator ()
// { dg-final { scan-assembler-not ".glob(a|)l\[\t \]*_?_Z2f1IiEvT_" } }
f1(0); // Expected to have static linkage
- // { dg-final { scan-assembler ".weak(_definition)?\[\t \]*_?_Z2f2IiEvT_" } }
+ // { dg-final { scan-assembler ".weak(_definition)?\[\t \]*_?_Z2f2IiEvT_" { target { ! { *-*-mingw* *-*-cygwin } } } } }
f2(0); // Expected to have weak global linkage
}
diff --git a/gcc/testsuite/g++.dg/torture/pr36191.C b/gcc/testsuite/g++.dg/torture/pr36191.C
index 18051cedf7a..125d8a12205 100644
--- a/gcc/testsuite/g++.dg/torture/pr36191.C
+++ b/gcc/testsuite/g++.dg/torture/pr36191.C
@@ -1,6 +1,7 @@
// PR c++/36191
// { dg-do compile }
// { dg-options "-fnon-call-exceptions" }
+// { dg-skip-if "Frame pointer required for unwind tables" { sh*-*-* m68k*-*-* fido*-*-* } "-fomit-frame-pointer" "" }
__complex__ double
foo (__complex__ double x, double y)
diff --git a/gcc/testsuite/g++.dg/torture/pr40323.C b/gcc/testsuite/g++.dg/torture/pr40323.C
index adecf7fe5f3..c7ffcb5d3f1 100644
--- a/gcc/testsuite/g++.dg/torture/pr40323.C
+++ b/gcc/testsuite/g++.dg/torture/pr40323.C
@@ -1,7 +1,7 @@
/* Testcase for PR 40323. */
/* { dg-do compile } */
/* { dg-options "-fno-early-inlining" } */
-/* { dg-options "-fno-early-inlining -fpie" { target { ! nonpic } } } */
+/* { dg-add-options bind_pic_locally } */
extern void do_something (const char *, int);
diff --git a/gcc/testsuite/g++.dg/torture/pr41680.C b/gcc/testsuite/g++.dg/torture/pr41680.C
new file mode 100644
index 00000000000..7faab0d5fbc
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr41680.C
@@ -0,0 +1,23 @@
+// PR target/41680
+// { dg-do compile }
+
+extern void baz (float);
+
+inline bool
+bar (float x)
+{
+ union { float f; int i; } u;
+ u.f = x;
+ return (u.i & 1);
+}
+
+void
+foo (float *x)
+{
+ for (int i = 0; i < 10; i++)
+ {
+ float f = x[i];
+ if (!bar (f))
+ baz (f);
+ }
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr41775.C b/gcc/testsuite/g++.dg/torture/pr41775.C
new file mode 100644
index 00000000000..3d8548e3fb0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr41775.C
@@ -0,0 +1,284 @@
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+
+typedef unsigned int size_t;
+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
+ {
+ public:typedef _Iterator iterator_type;
+ typedef typename iterator_traits < _Iterator >::reference reference;
+ reference operator* () const
+ {
+ }
+ __normal_iterator operator++ (int)
+ {
+ }
+ };
+ template < typename _IteratorL, typename _IteratorR,
+ typename _Container > inline bool operator!= (const __normal_iterator <
+ _IteratorL,
+ _Container > &__lhs,
+ const __normal_iterator <
+ _IteratorR,
+ _Container > &__rhs)
+ {
+ }
+}
+
+extern "C"
+{
+ extern "C"
+ {
+ __extension__ typedef __SIZE_TYPE__ __intptr_t;
+ }
+}
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+ template < typename _Tp > class new_allocator
+ {
+ public:typedef size_t size_type;
+ 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 >
+ {
+ };
+}
+
+extern "C"
+{
+ typedef __intptr_t intptr_t;
+}
+namespace llvm
+{
+ template < typename NodeTy > class ilist_half_node
+ {
+ };
+template < typename NodeTy > class ilist_node:private ilist_half_node <
+ NodeTy >
+ {
+ };
+ class MachineBasicBlock;
+ class MachineOperand
+ {
+ public:enum MachineOperandType
+ {
+ }
+ Contents;
+ unsigned getReg () const
+ {
+ }
+ };
+ class TargetRegisterInfo;
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+ template < typename _Tp, typename _Alloc > struct _Vector_base
+ {
+ typedef typename _Alloc::template rebind < _Tp >::other _Tp_alloc_type;
+ };
+template < typename _Tp, typename _Alloc = std::allocator < _Tp > >class vector:protected _Vector_base < _Tp,
+ _Alloc
+ >
+ {
+ typedef _Vector_base < _Tp, _Alloc > _Base;
+ typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
+ public:typedef _Tp value_type;
+ typedef typename _Tp_alloc_type::pointer pointer;
+ typedef __gnu_cxx::__normal_iterator < pointer, vector > iterator;
+ iterator begin ()
+ {
+ }
+ iterator end ()
+ {
+ }
+ };
+}
+
+namespace llvm
+{
+ class MachineFunction;
+ class MachineInstr:public ilist_node < MachineInstr >
+ {
+ public:const MachineBasicBlock *getParent () const
+ {
+ }
+ const MachineOperand & getOperand (unsigned i) const
+ {
+ }
+ bool registerDefIsDead (unsigned Reg, const TargetRegisterInfo * TRI =
+ __null) const
+ {
+ }
+ };
+ class AnalysisResolver;
+ class Pass
+ {
+ AnalysisResolver *Resolver;
+ intptr_t PassID;
+ public: explicit Pass (intptr_t pid):Resolver (0), PassID (pid)
+ {
+ }
+ explicit Pass (const void *pid):Resolver (0), PassID ((intptr_t) pid)
+ {
+ }
+ template < typename AnalysisType > AnalysisType & getAnalysis () const;
+ };
+ class FunctionPass:public Pass
+ {
+ public:explicit FunctionPass (intptr_t pid):Pass (pid)
+ {
+ }
+ explicit FunctionPass (const void *pid):Pass (pid)
+ {
+ }
+ };
+ class PassInfo
+ {
+ public:typedef Pass *(*NormalCtor_t) ();
+ private:const char *const PassName;
+ const char *const PassArgument;
+ const intptr_t PassID;
+ const bool IsCFGOnlyPass;
+ const bool IsAnalysis;
+ const bool IsAnalysisGroup;
+ NormalCtor_t NormalCtor;
+ public: PassInfo (const char *name, const char *arg, intptr_t pi, NormalCtor_t normal = 0, bool isCFGOnly = false, bool is_analysis = false):PassName (name), PassArgument (arg), PassID (pi),
+ IsCFGOnlyPass (isCFGOnly), IsAnalysis (is_analysis),
+ IsAnalysisGroup (false), NormalCtor (normal)
+ {
+ }
+ };
+ template < typename PassName > Pass * callDefaultCtor ()
+ {
+ return new PassName ();
+ }
+ template < typename passName > struct RegisterPass:public PassInfo
+ {
+ RegisterPass (const char *PassArg, const char *Name, bool CFGOnly = false, bool is_analysis = false):PassInfo (Name, PassArg, intptr_t (&passName::ID),
+ PassInfo::NormalCtor_t (callDefaultCtor < passName >), CFGOnly,
+ is_analysis)
+ {
+ }
+ };
+ template < typename T > class SmallVectorImpl
+ {
+ };
+ template < typename T,
+ unsigned N > class SmallVector:public SmallVectorImpl < T >
+ {
+ };
+ class MachineFunctionPass:public FunctionPass
+ {
+ protected:explicit MachineFunctionPass (intptr_t ID):FunctionPass (ID)
+ {
+ }
+ explicit MachineFunctionPass (void *ID):FunctionPass (ID)
+ {
+ }
+ virtual bool runOnMachineFunction (MachineFunction & MF) = 0;
+ };
+ class LiveIndex
+ {
+ private:unsigned index;
+ };
+ class VNInfo
+ {
+ };
+ struct LiveRange
+ {
+ LiveIndex start;
+ LiveIndex end;
+ VNInfo *valno;
+ };
+ class LiveInterval
+ {
+ public:typedef SmallVector < LiveRange, 4 > Ranges;
+ bool containsOneValue () const
+ {
+ }
+ LiveRange *getLiveRangeContaining (LiveIndex Idx)
+ {
+ }
+ void removeRange (LiveIndex Start, LiveIndex End, bool RemoveDeadValNo =
+ false);
+ void removeRange (LiveRange LR, bool RemoveDeadValNo = false)
+ {
+ removeRange (LR.start, LR.end, RemoveDeadValNo);
+ }
+ };
+ class LiveIntervals:public MachineFunctionPass
+ {
+ public:static char ID;
+ LiveIndex getDefIndex (LiveIndex index)
+ {
+ }
+ LiveInterval & getInterval (unsigned reg)
+ {
+ }
+ LiveIndex getInstructionIndex (const MachineInstr * instr) const
+ {
+ }
+ };
+}
+
+using namespace llvm;
+namespace
+{
+struct __attribute__ ((visibility ("hidden"))) StrongPHIElimination:public
+ MachineFunctionPass
+ {
+ static char ID;
+ StrongPHIElimination ():MachineFunctionPass (&ID)
+ {
+ }
+ bool runOnMachineFunction (MachineFunction & Fn);
+ };
+}
+
+static RegisterPass < StrongPHIElimination > X ("strong-phi-node-elimination",
+ "Eliminate PHI nodes for register allocation, intelligently");
+bool
+StrongPHIElimination::runOnMachineFunction (MachineFunction & Fn)
+{
+ LiveIntervals & LI = getAnalysis < LiveIntervals > ();
+ std::vector < MachineInstr * >phis;
+ for (std::vector < MachineInstr * >::iterator I = phis.begin (), E =
+ phis.end (); I != E;)
+ {
+ MachineInstr *PInstr = *(I++);
+ unsigned DestReg = PInstr->getOperand (0).getReg ();
+ LiveInterval & PI = LI.getInterval (DestReg);
+ if (PInstr->registerDefIsDead (DestReg))
+ {
+ if (PI.containsOneValue ())
+ {
+ LiveIndex idx =
+ LI.getDefIndex (LI.getInstructionIndex (PInstr));
+ PI.removeRange (*PI.getLiveRangeContaining (idx), true);
+ }
+ }
+ }
+}
diff --git a/gcc/testsuite/g++.dg/tree-ssa/copyprop.C b/gcc/testsuite/g++.dg/tree-ssa/copyprop.C
index e785755eb07..5ba193618dd 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/copyprop.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/copyprop.C
@@ -7,8 +7,8 @@
#include <map>
#include <vector>
#include <iostream>
+#include <cstdlib>
using namespace std;
-extern void free (void *);
template<typename _FIter, typename _Tp> _FIter lower_bound(_FIter, _FIter, _Tp&);
template<class _Key> struct hash { };
template<class _Val> struct _Hashtable_node {
diff --git a/gcc/testsuite/g++.dg/tree-ssa/nothrow-1.C b/gcc/testsuite/g++.dg/tree-ssa/nothrow-1.C
index 4bb71589de3..33462946aed 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/nothrow-1.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/nothrow-1.C
@@ -1,6 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-cfg" } */
-/* { dg-skip-if "" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
+/* { dg-add-options bind_pic_locally } */
+
double a;
void t()
{
diff --git a/gcc/testsuite/g++.dg/tree-ssa/restrict1.C b/gcc/testsuite/g++.dg/tree-ssa/restrict1.C
new file mode 100644
index 00000000000..dc120b1e817
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tree-ssa/restrict1.C
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-lim-details" } */
+
+struct Foo
+{
+ Foo();
+ Foo(const Foo&);
+ int n;
+ int * __restrict__ p;
+};
+void bar(Foo f, int * __restrict__ q)
+{
+ for (int i = 0; i < f.n; ++i)
+ {
+ *q += f.p[i];
+ }
+}
+
+/* { dg-final { scan-tree-dump "Executing store motion" "lim1" } } */
+/* { dg-final { cleanup-tree-dump "lim1" } } */
diff --git a/gcc/testsuite/g++.old-deja/g++.law/operators32.C b/gcc/testsuite/g++.old-deja/g++.law/operators32.C
index 89f0b6601aa..91de03ee8fc 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/operators32.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/operators32.C
@@ -49,7 +49,7 @@ foo() {std::cout << "foo created" << std::endl; }
};
foo **f2;
-allocate2d(d1, d2, f2);
-ffree(d1, f2);
+allocate2d(d1, d2, f2);// { dg-error "" } type.*// ERROR - trying to.*
+ffree(d1, f2);// { dg-error "" } type.*// ERROR - trying to.*
}
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/koenig5.C b/gcc/testsuite/g++.old-deja/g++.ns/koenig5.C
index d84fc8dbf41..33061ad0bd8 100644
--- a/gcc/testsuite/g++.old-deja/g++.ns/koenig5.C
+++ b/gcc/testsuite/g++.old-deja/g++.ns/koenig5.C
@@ -1,5 +1,5 @@
// { dg-do assemble }
-// To find function pointers in Koenig lookup is ok as long as we only find one.
+// Function pointers are ignored in Koenig lookup. (DR 218)
namespace A{
void foo();
struct X{};
@@ -14,5 +14,5 @@ void g()
foo(new X); // ok -- DR 218 says that we find the global
// foo variable first, and therefore do not
// perform argument-dependent lookup.
- bar(new X); // ok
+ bar(new X); // { dg-error "not declared" }
}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/anon9.C b/gcc/testsuite/g++.old-deja/g++.other/anon9.C
index f4b192337c1..a364db8e962 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/anon9.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/anon9.C
@@ -4,8 +4,3 @@
typedef const struct { int i; } T; // { dg-error "" } referenced below
void f (T* t); // { dg-error "" } uses unnamed type
-
-int main()
-{
- f(0);
-}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/linkage1.C b/gcc/testsuite/g++.old-deja/g++.other/linkage1.C
index de9a6accf18..e9b5a9d2aa3 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/linkage1.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/linkage1.C
@@ -3,16 +3,13 @@ typedef struct {
int i;
} *p;
-void f (p) { }
-p q;
+void f (p) { } // { dg-error "uses anonymous type" }
+p q; // { dg-warning "uses anonymous type" }
int main()
{
- extern p j; // { dg-error "anonymous type" }
- j+1;
+ extern p j; // { dg-warning "uses anonymous type" }
struct A { int j; };
- extern A a; // { dg-error "local type" }
- a.j+1;
- extern void f (A); // { dg-error "local type" }
- f(a);
+ extern A a; // { dg-warning "uses local type" }
+ extern void f (A); // { dg-error "uses local type" }
}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/linkage2.C b/gcc/testsuite/g++.old-deja/g++.other/linkage2.C
index 64f74f7292c..2385b2216fe 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/linkage2.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/linkage2.C
@@ -7,7 +7,7 @@ extern GDBM_FILE gdbm_open();
}
typedef struct { int dummy[10]; } *FAIL_FILE;
-extern FAIL_FILE fail_open(); // OK because it's never used
+extern FAIL_FILE fail_open(); // { dg-error "" } non-local function
typedef struct { int dummy[10]; } *SUCCESS_FILE, S;
extern SUCCESS_FILE success_open();
diff --git a/gcc/testsuite/g++.old-deja/g++.other/typename1.C b/gcc/testsuite/g++.old-deja/g++.other/typename1.C
index 43d13522fe7..4bf3de39f84 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/typename1.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/typename1.C
@@ -13,5 +13,5 @@ public:
template<class T>
void f()
{
- Vector<T>::iterator i = 0; // { dg-error "expected" } missing typename
-}
+ Vector<T>::iterator i = 0; // { dg-error "typename" } missing typename
+} // { dg-error "expected" "" { target *-*-* } 16 }
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash58.C b/gcc/testsuite/g++.old-deja/g++.pt/crash58.C
index 315f3e02896..0ce3d81723d 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/crash58.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/crash58.C
@@ -15,16 +15,16 @@ struct MatrixC
{
void foo () {
EManip::do_assign<T> (0);
- &EManip::do_assign<T>; // { dg-error "" } unresolved
- &do_assign<T>; // { dg-error "" } unresolved
- EManip::do_assign<T>; // { dg-error "" } unresolved
- do_assign<T>; // { dg-error "" } unresolved
+ &EManip::do_assign<T>; // { dg-bogus "" } unresolved
+ &do_assign<T>; // { dg-bogus "" } unresolved
+ EManip::do_assign<T>; // { dg-bogus "" } unresolved
+ do_assign<T>; // { dg-bogus "" } unresolved
}
};
void foo(MatrixC <double> *ptr)
{
- EManip::do_assign<double>; // { dg-error "" } unresolved
- &EManip::do_assign<double>; // { dg-error "" } unresolved
+ EManip::do_assign<double>; // { dg-bogus "" } unresolved
+ &EManip::do_assign<double>; // { dg-bogus "" } unresolved
ptr->foo ();
void (*p1) (int *) = &do_assign<double>; // { dg-error "" } cannot convert
void (*p2) (int *) = &EManip::do_assign<double>; // { dg-error "" } cannot convert
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/enum6.C b/gcc/testsuite/g++.old-deja/g++.pt/enum6.C
index 561254d0d68..254b48bc7fc 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/enum6.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/enum6.C
@@ -8,7 +8,7 @@ void fn(T)
{
enum tern { H, L, X, U };
- vector<tern> ternvec;
+ vector<tern> ternvec; // { dg-error "" } composed from a local type
}
template void fn(int);
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr40556.c b/gcc/testsuite/gcc.c-torture/compile/pr40556.c
new file mode 100644
index 00000000000..625175d7788
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr40556.c
@@ -0,0 +1,11 @@
+struct A {};
+
+struct A foo()
+{
+ return foo();
+}
+
+void bar()
+{
+ foo();
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr41182-1.c b/gcc/testsuite/gcc.c-torture/compile/pr41182-1.c
new file mode 100644
index 00000000000..017174938b3
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr41182-1.c
@@ -0,0 +1,6 @@
+typedef long unsigned int size_t;
+int _lae_process_opts(char *pr, char *pe)
+{
+ return (strlen ("on") < ((size_t) ((pe-&pr[2])>(strlen("on"))
+ ? (pe-&pr[2]) : (strlen("on")))));
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr41634.c b/gcc/testsuite/gcc.c-torture/compile/pr41634.c
new file mode 100644
index 00000000000..976e463e2ba
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr41634.c
@@ -0,0 +1,19 @@
+extern int _xgetw();
+extern int foo(char*);
+
+void test_readmode( int ascii_mode )
+{
+ static const char outbuffer[]
+ = "0,1,2,3,4,5,6,7,8,9\r\n\r\nA,B,C,D,E\r\nX,Y,Z";
+ char buffer[2*512 +256];
+ int i, j, ao;
+ unsigned int fp;
+
+ foo(buffer);
+
+ for (i=0, j=0; i<6; i++) {
+ if (ao==0 || outbuffer[fp-3+i] != '\r')
+ buffer[j++] = outbuffer[fp-3+i];
+ }
+ _xgetw();
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr41646.c b/gcc/testsuite/gcc.c-torture/compile/pr41646.c
new file mode 100644
index 00000000000..f07b6ba19f4
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr41646.c
@@ -0,0 +1,28 @@
+/* PR rtl-optimization/41646 */
+
+struct A { unsigned long a; };
+struct B { unsigned short b, c, d; };
+struct B bar (unsigned long);
+
+char *
+foo (char *a, struct A *x)
+{
+ struct B b = bar (x->a);
+ unsigned char c;
+ unsigned short d;
+ a[3] = ((unsigned char) (b.b % 10) + 48);
+ d = b.b / 10;
+ a[2] = ((unsigned char) (d % 10) + 48);
+ d = d / 10;
+ a[1] = ((unsigned char) (d % 10) + 48);
+ a[0] = ((unsigned char) ((d / 10) % 10) + 48);
+ a[4] = 46;
+ c = (unsigned char) b.c;
+ a[6] = (c % 10 + 48);
+ a[5] = ((c / 10) % 10 + 48);
+ a[7] = 46;
+ c = b.d;
+ a[9] = (c % 10 + 48);
+ a[8] = ((c / 10) % 10 + 48);
+ return a + 10;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr41661.c b/gcc/testsuite/gcc.c-torture/compile/pr41661.c
new file mode 100644
index 00000000000..658e4288b8d
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr41661.c
@@ -0,0 +1,20 @@
+/* PR tree-optimization/41661 */
+/* { dg-do compile } */
+/* { dg-options "-fno-early-inlining" } */
+
+int g;
+
+void foo (int x)
+{
+ g = x;
+}
+
+void bar (double d)
+{
+ foo (d == 1);
+}
+
+void baz (int a)
+{
+ bar (1);
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr41728.c b/gcc/testsuite/gcc.c-torture/compile/pr41728.c
new file mode 100644
index 00000000000..df379d93010
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr41728.c
@@ -0,0 +1,12 @@
+int a[8];
+int s244(void)
+{
+ int lrc, j;
+ lrc = 0;
+ for (j=0; j<7; j++)
+ if(a[j] != a[j+1])
+ lrc = 1;
+ if (lrc != 0)
+ return 0;
+ return 1;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp b/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
index 573be92673d..a54f3c1b53e 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
@@ -35,7 +35,7 @@ load_lib torture-options.exp
load_lib c-torture.exp
torture-init
-set-torture-options $C_TORTURE_OPTIONS
+set-torture-options $C_TORTURE_OPTIONS {{}} $LTO_TORTURE_OPTIONS
set additional_flags ""
if [istarget "powerpc-*-darwin*"] {
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/abs.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/abs.c
index 590ded7892b..1e0857f734d 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/abs.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/abs.c
@@ -8,6 +8,7 @@ extern void abort (void);
typedef __INTMAX_TYPE__ intmax_t;
+__attribute__ ((__noinline__))
int
abs (int x)
{
@@ -15,6 +16,7 @@ abs (int x)
return x < 0 ? -x : x;
}
+__attribute__ ((__noinline__))
long
labs (long x)
{
@@ -22,6 +24,7 @@ labs (long x)
return x < 0 ? -x : x;
}
+__attribute__ ((__noinline__))
long long
llabs (long long x)
{
@@ -29,6 +32,7 @@ llabs (long long x)
return x < 0 ? -x : x;
}
+__attribute__ ((__noinline__))
intmax_t
imaxabs (intmax_t x)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/bfill.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/bfill.c
index c5e9629bd9b..deb6cf5228e 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/bfill.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/bfill.c
@@ -1,5 +1,6 @@
extern int inside_main;
+__attribute__ ((__noinline__))
void
bfill (void *s, __SIZE_TYPE__ n, int ch)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/bzero.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/bzero.c
index bcbe3a4383a..a02b5358b37 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/bzero.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/bzero.c
@@ -1,5 +1,6 @@
extern int inside_main;
+__attribute__ ((__noinline__))
void
bzero (void *s, __SIZE_TYPE__ n)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/fprintf.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/fprintf.c
index a22db41d800..853a705e86d 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/fprintf.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/fprintf.c
@@ -3,6 +3,7 @@
extern void abort (void);
extern int inside_main;
+__attribute__ ((__noinline__))
int
fprintf (FILE *fp, const char *string, ...)
{
@@ -19,6 +20,7 @@ fprintf (FILE *fp, const char *string, ...)
}
/* Locking stdio doesn't matter for the purposes of this test. */
+__attribute__ ((__noinline__))
int
fprintf_unlocked (FILE *fp, const char *string, ...)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/memchr.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/memchr.c
index ddab08bcf8d..2f15c57a770 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/memchr.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/memchr.c
@@ -1,6 +1,7 @@
extern void abort(void);
extern int inside_main;
+__attribute__ ((__noinline__))
void *
memchr (const void *s, int c, __SIZE_TYPE__ n)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/memcmp.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/memcmp.c
index 94c0a576634..fd6556d227b 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/memcmp.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/memcmp.c
@@ -1,6 +1,7 @@
extern void abort(void);
extern int inside_main;
+__attribute__ ((__noinline__))
int
memcmp (const void *s1, const void *s2, __SIZE_TYPE__ len)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/memmove.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/memmove.c
index 03faf5e6262..08fcd080148 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/memmove.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/memmove.c
@@ -1,6 +1,7 @@
extern void abort (void);
extern int inside_main;
+__attribute__ ((__noinline__))
void *
memmove (void *dst, const void *src, __SIZE_TYPE__ n)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/mempcpy.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/mempcpy.c
index 67ee3cbe413..bc16da536ff 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/mempcpy.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/mempcpy.c
@@ -1,6 +1,7 @@
extern void abort (void);
extern int inside_main;
+__attribute__ ((__noinline__))
void *
mempcpy (void *dst, const void *src, __SIZE_TYPE__ n)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/memset.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/memset.c
index 4bfa33ea66f..90545abbf24 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/memset.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/memset.c
@@ -1,6 +1,7 @@
extern void abort (void);
extern int inside_main;
+__attribute__ ((__noinline__))
void *
memset (void *dst, int c, __SIZE_TYPE__ n)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/printf.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/printf.c
index 2f8c133177c..4be7578d124 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/printf.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/printf.c
@@ -3,6 +3,7 @@
extern void abort (void);
extern int inside_main;
+__attribute__ ((__noinline__))
int
printf (const char *string, ...)
{
@@ -20,6 +21,7 @@ printf (const char *string, ...)
/* Locking stdio doesn't matter for the purposes of this test. */
+__attribute__ ((__noinline__))
int
printf_unlocked (const char *string, ...)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/sprintf.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/sprintf.c
index a015d90a64c..3ac447b117f 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/sprintf.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/sprintf.c
@@ -3,6 +3,7 @@
extern void abort (void);
extern int inside_main;
+__attribute__ ((__noinline__))
int
(sprintf) (char *buf, const char *fmt, ...)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/stpcpy.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/stpcpy.c
index e6e1a6dae9c..2c7c8178bab 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/stpcpy.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/stpcpy.c
@@ -1,6 +1,7 @@
extern void abort (void);
extern int inside_main;
+__attribute__ ((__noinline__))
char *
stpcpy (char *dst, const char *src)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcat.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcat.c
index 2cced80f5d7..d592087a933 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcat.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcat.c
@@ -1,6 +1,7 @@
extern int inside_main;
extern void abort(void);
+__attribute__ ((__noinline__))
char *
strcat (char *dst, const char *src)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strchr.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strchr.c
index 7ca78d1f356..bee3d3203eb 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strchr.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strchr.c
@@ -1,6 +1,7 @@
extern void abort (void);
extern int inside_main;
+__attribute__ ((__noinline__))
char *
strchr (const char *s, int c)
{
@@ -19,6 +20,7 @@ strchr (const char *s, int c)
}
}
+__attribute__ ((__noinline__))
char *
index (const char *s, int c)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcmp.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcmp.c
index 220499ab317..82284546f65 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcmp.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcmp.c
@@ -1,6 +1,7 @@
extern void abort (void);
extern int inside_main;
+__attribute__ ((__noinline__))
int
strcmp (const char *s1, const char *s2)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcpy.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcpy.c
index 45c6a45e4da..916446623f9 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcpy.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcpy.c
@@ -1,6 +1,7 @@
extern void abort (void);
extern int inside_main;
+__attribute__ ((__noinline__))
char *
strcpy (char *d, const char *s)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcspn.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcspn.c
index 53f609114bb..8270996374a 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcspn.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcspn.c
@@ -1,6 +1,7 @@
extern void abort (void);
extern int inside_main;
+__attribute__ ((__noinline__))
__SIZE_TYPE__
strcspn (const char *s1, const char *s2)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strlen.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strlen.c
index 3ead79d1de5..7f81c115b81 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strlen.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strlen.c
@@ -1,6 +1,7 @@
extern void abort (void);
extern int inside_main;
+__attribute__ ((__noinline__))
__SIZE_TYPE__
strlen (const char *s)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strncat.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strncat.c
index 290d4cf49bb..7fd334cb4d8 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strncat.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strncat.c
@@ -3,6 +3,7 @@ extern int inside_main;
typedef __SIZE_TYPE__ size_t;
+__attribute__ ((__noinline__))
char *
strncat (char *s1, const char *s2, size_t n)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strncmp.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strncmp.c
index 6599af79044..7a8eb6fd27e 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strncmp.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strncmp.c
@@ -3,6 +3,7 @@ extern int inside_main;
typedef __SIZE_TYPE__ size_t;
+__attribute__ ((__noinline__))
int
strncmp(const char *s1, const char *s2, size_t n)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strncpy.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strncpy.c
index b297345e6ca..a6ec98b054a 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strncpy.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strncpy.c
@@ -3,6 +3,7 @@ extern int inside_main;
typedef __SIZE_TYPE__ size_t;
+__attribute__ ((__noinline__))
char *
strncpy(char *s1, const char *s2, size_t n)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strpbrk.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strpbrk.c
index f6bb0321020..0c049272cca 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strpbrk.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strpbrk.c
@@ -1,6 +1,7 @@
extern void abort (void);
extern int inside_main;
+__attribute__ ((__noinline__))
char *
strpbrk(const char *s1, const char *s2)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strrchr.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strrchr.c
index c2f7107064c..9a45af3c8e5 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strrchr.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strrchr.c
@@ -1,6 +1,7 @@
extern void abort (void);
extern int inside_main;
+__attribute__ ((__noinline__))
char *
strrchr (const char *s, int c)
{
@@ -23,6 +24,7 @@ strrchr (const char *s, int c)
return 0;
}
+__attribute__ ((__noinline__))
char *
rindex (const char *s, int c)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strspn.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strspn.c
index 126c44f263b..622aac6ab38 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strspn.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strspn.c
@@ -1,6 +1,7 @@
extern void abort (void);
extern int inside_main;
+__attribute__ ((__noinline__))
__SIZE_TYPE__
strcspn (const char *s1, const char *s2)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strstr.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strstr.c
index d803f1ee94b..7d35445063e 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strstr.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strstr.c
@@ -1,6 +1,7 @@
extern void abort (void);
extern int inside_main;
+__attribute__ ((__noinline__))
char *
strstr(const char *s1, const char *s2)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/execute.exp b/gcc/testsuite/gcc.c-torture/execute/execute.exp
index 9b6bccd0c31..a26e5907639 100644
--- a/gcc/testsuite/gcc.c-torture/execute/execute.exp
+++ b/gcc/testsuite/gcc.c-torture/execute/execute.exp
@@ -32,7 +32,7 @@ load_lib torture-options.exp
load_lib c-torture.exp
torture-init
-set-torture-options $C_TORTURE_OPTIONS
+set-torture-options $C_TORTURE_OPTIONS {{}} $LTO_TORTURE_OPTIONS
#
# main test loop
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp b/gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp
index 558829aa5f9..c23f32e85ab 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp
@@ -35,7 +35,7 @@ if $tracelevel then {
}
torture-init
-set-torture-options $C_TORTURE_OPTIONS
+set-torture-options $C_TORTURE_OPTIONS {{}} $LTO_TORTURE_OPTIONS
set additional_flags "-fno-inline"
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr40668.c b/gcc/testsuite/gcc.c-torture/execute/pr40668.c
index 70fe63f8916..b860dd7c9ec 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr40668.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr40668.c
@@ -1,3 +1,8 @@
+#if (__SIZEOF_INT__ == 2)
+#define TESTVALUE 0x1234
+#else
+#define TESTVALUE 0x12345678
+#endif
static void
foo (unsigned int x, void *p)
{
@@ -10,7 +15,7 @@ bar (int type, void *number)
switch (type)
{
case 1:
- foo (0x12345678, number);
+ foo (TESTVALUE, number);
break;
case 7:
foo (0, number);
@@ -29,7 +34,7 @@ main (void)
{
unsigned int x;
bar (1, &x);
- if (x != 0x12345678)
+ if (x != TESTVALUE)
__builtin_abort ();
return 0;
}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr41750.c b/gcc/testsuite/gcc.c-torture/execute/pr41750.c
new file mode 100644
index 00000000000..3f5cb635d16
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr41750.c
@@ -0,0 +1,68 @@
+/* PR 41750 - IPA-SRA used to pass hash->sgot by value rather than by
+ reference. */
+
+struct bfd_link_hash_table
+{
+ int hash;
+};
+
+struct foo_link_hash_table
+{
+ struct bfd_link_hash_table root;
+ int *dynobj;
+ int *sgot;
+};
+
+struct foo_link_info
+{
+ struct foo_link_hash_table *hash;
+};
+
+extern void abort (void);
+
+int __attribute__((noinline))
+foo_create_got_section (int *abfd, struct foo_link_info *info)
+{
+ info->hash->sgot = abfd;
+ return 1;
+}
+
+static int *
+get_got (int *abfd, struct foo_link_info *info,
+ struct foo_link_hash_table *hash)
+{
+ int *got;
+ int *dynobj;
+
+ got = hash->sgot;
+ if (!got)
+ {
+ dynobj = hash->dynobj;
+ if (!dynobj)
+ hash->dynobj = dynobj = abfd;
+ if (!foo_create_got_section (dynobj, info))
+ return 0;
+ got = hash->sgot;
+ }
+ return got;
+}
+
+int * __attribute__((noinline,noclone))
+elf64_ia64_check_relocs (int *abfd, struct foo_link_info *info)
+{
+ return get_got (abfd, info, info->hash);
+}
+
+struct foo_link_info link_info;
+struct foo_link_hash_table hash;
+int abfd;
+
+int
+main ()
+{
+ link_info.hash = &hash;
+ if (elf64_ia64_check_relocs (&abfd, &link_info) != &abfd)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr41917.c b/gcc/testsuite/gcc.c-torture/execute/pr41917.c
new file mode 100644
index 00000000000..4a9ada921c4
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr41917.c
@@ -0,0 +1,21 @@
+/* PR rtl-optimization/41917 */
+
+extern void abort (void);
+unsigned int a = 1;
+
+int
+main (void)
+{
+ unsigned int b, c, d;
+
+ if (sizeof (int) != 4 || (int) 0xc7d24b5e > 0)
+ return 0;
+
+ c = 0xc7d24b5e;
+ d = a | -2;
+ b = (d == 0) ? c : (c % d);
+ if (b != c)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr41919.c b/gcc/testsuite/gcc.c-torture/execute/pr41919.c
new file mode 100644
index 00000000000..4ca09141b5e
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr41919.c
@@ -0,0 +1,39 @@
+extern void abort (void);
+
+#define assert(x) if(!(x)) abort()
+
+struct S1
+{
+ char f0;
+};
+
+int g_23 = 0;
+
+static struct S1
+foo (void)
+{
+ int *l_100 = &g_23;
+ int **l_110 = &l_100;
+ struct S1 l_128 = { 1 };
+ assert (l_100 == &g_23);
+ assert (l_100 == &g_23);
+ assert (l_100 == &g_23);
+ assert (l_100 == &g_23);
+ assert (l_100 == &g_23);
+ assert (l_100 == &g_23);
+ assert (l_100 == &g_23);
+ return l_128;
+}
+
+static char bar(char si1, char si2)
+{
+ return (si1 <= 0) ? si1 : (si2 * 2);
+}
+int main (void)
+{
+ struct S1 s = foo();
+ if (bar(0x99 ^ (s.f0 && 1), 1) != -104)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr41935.c b/gcc/testsuite/gcc.c-torture/execute/pr41935.c
new file mode 100644
index 00000000000..ef8d08ce023
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr41935.c
@@ -0,0 +1,25 @@
+/* PR middle-end/41935 */
+
+extern void abort (void);
+
+long int
+foo (int n, int i, int j)
+{
+ typedef int T[n];
+ struct S { int a; T b[n]; };
+ return __builtin_offsetof (struct S, b[i][j]);
+}
+
+int
+main (void)
+{
+ typedef int T[5];
+ struct S { int a; T b[5]; };
+ if (foo (5, 2, 3)
+ != __builtin_offsetof (struct S, b) + (5 * 2 + 3) * sizeof (int))
+ abort ();
+ if (foo (5, 5, 5)
+ != __builtin_offsetof (struct S, b) + (5 * 5 + 5) * sizeof (int))
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/unsorted/unsorted.exp b/gcc/testsuite/gcc.c-torture/unsorted/unsorted.exp
index 4a8ebe75c5e..def4bc5afb6 100644
--- a/gcc/testsuite/gcc.c-torture/unsorted/unsorted.exp
+++ b/gcc/testsuite/gcc.c-torture/unsorted/unsorted.exp
@@ -33,7 +33,7 @@ load_lib c-torture.exp
load_lib torture-options.exp
torture-init
-set-torture-options $C_TORTURE_OPTIONS
+set-torture-options $C_TORTURE_OPTIONS {{}} $LTO_TORTURE_OPTIONS
#
# This loop will run c-torture on any *.c file found in this directory.
diff --git a/gcc/testsuite/gcc.dg/20081223-1.c b/gcc/testsuite/gcc.dg/20081223-1.c
new file mode 100644
index 00000000000..3c36955c9e3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20081223-1.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-fwhopr" { target lto } } */
+
+typedef struct foo_ foo_t;
+foo_t bar; /* { dg-error "storage size of 'bar' isn't known" } */
diff --git a/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-vla-1.c b/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-vla-1.c
new file mode 100644
index 00000000000..e9f63d36872
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-vla-1.c
@@ -0,0 +1,10 @@
+/* PR 41673: bogus -Wstrict-aliasing warning from VLA dereference. */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -O2 -Wall" } */
+
+int main(int argc, char *argv[])
+{
+ float x[argc];
+ float y[argc];
+ return 0 == __builtin_memcpy(y, x, argc * sizeof(*x));
+}
diff --git a/gcc/testsuite/gcc.dg/autopar/outer-1.c b/gcc/testsuite/gcc.dg/autopar/outer-1.c
new file mode 100644
index 00000000000..913d390f684
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/autopar/outer-1.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+void abort (void);
+
+void parloop (int N)
+{
+ int i, j;
+ int x[10000][10000];
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ x[i][j] = i + j + 3;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ if (x[i][j] != i + j + 3)
+ abort ();
+}
+
+int main(void)
+{
+ parloop(10000);
+
+ return 0;
+}
+
+
+/* Check that outer loop is parallelized. */
+/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/autopar/outer-2.c b/gcc/testsuite/gcc.dg/autopar/outer-2.c
new file mode 100644
index 00000000000..351b3499e89
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/autopar/outer-2.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+void abort (void);
+
+void parloop (int N)
+{
+ int i, j,ii;
+ int x[400][10][400];
+
+for (ii = 0; ii < N; ii++)
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ x[i][j][ii] = ii+i + j + 3;
+
+for (ii = 0; ii < N; ii++)
+ for (i = 0; i < N;i++)
+ for (j = 0; j < N; j++)
+ if (x[i][j][ii] != ii+i + j + 3)
+ abort ();
+}
+
+int main(void)
+{
+ parloop(400);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/autopar/outer-3.c b/gcc/testsuite/gcc.dg/autopar/outer-3.c
new file mode 100644
index 00000000000..2f1033f9830
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/autopar/outer-3.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+void abort (void);
+
+void parloop (int N)
+{
+ int i, j;
+ int x[500][500];
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < i; j++)
+ x[i][j] = i + j + 3;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < i; j++)
+ if (x[i][j] != i + j + 3)
+ abort ();
+}
+
+int main(void)
+{
+ parloop(500);
+
+ return 0;
+}
+
+
+/* Check that outer loop is parallelized. */
+/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/autopar/outer-4.c b/gcc/testsuite/gcc.dg/autopar/outer-4.c
new file mode 100644
index 00000000000..56f6123385d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/autopar/outer-4.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+void abort (void);
+
+int g_sum=0;
+int x[500][500];
+
+__attribute__((noinline))
+void parloop (int N)
+{
+ int i, j;
+ int sum;
+
+ /* Double reduction is currently not supported, outer loop is not
+ parallelized. Inner reduction is detected, inner loop is
+ parallelized. */
+ sum = 0;
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ sum += x[i][j];
+
+ g_sum = sum;
+}
+
+int main(void)
+{
+ parloop(500);
+
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/autopar/outer-5.c b/gcc/testsuite/gcc.dg/autopar/outer-5.c
new file mode 100644
index 00000000000..3a542988c26
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/autopar/outer-5.c
@@ -0,0 +1,50 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+void abort (void);
+
+int x[500][500];
+int y[500];
+int g_sum=0;
+
+__attribute__((noinline))
+void init (int i, int j)
+{
+ x[i][j]=1;
+}
+
+__attribute__((noinline))
+void parloop (int N)
+{
+ int i, j;
+ int sum;
+
+ /* Inner cycle is currently not supported, outer loop is not
+ parallelized. Inner reduction is detected, inner loop is
+ parallelized. */
+ for (i = 0; i < N; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j++)
+ sum += x[i][j];
+ y[i]=sum;
+ }
+ g_sum = sum;
+}
+
+int main(void)
+{
+ int i,j;
+ for (i = 0; i < 500; i++)
+ for (j = 0; j < 500; j++)
+ init(i, j);
+
+ parloop(500);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/autopar/outer-6.c b/gcc/testsuite/gcc.dg/autopar/outer-6.c
new file mode 100644
index 00000000000..6e027d2f69a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/autopar/outer-6.c
@@ -0,0 +1,51 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+void abort (void);
+
+int x[500][500];
+int y[500];
+int g_sum=0;
+
+__attribute__((noinline))
+void init (int i, int j)
+{
+ x[i][j]=1;
+}
+
+__attribute__((noinline))
+void parloop (int N)
+{
+ int i, j;
+ int sum;
+
+ /* Outer loop reduction, outerloop is parallelized. */
+ sum=0;
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ y[i]=x[i][j];
+ sum += y[i];
+ }
+ g_sum = sum;
+}
+
+int main(void)
+{
+ int i,j;
+ for (i = 0; i < 500; i++)
+ for (j = 0; j < 500; j++)
+ init(i, j);
+
+ parloop(500);
+
+ return 0;
+}
+
+
+/* Check that outer loop is parallelized. */
+/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "parallelizing inner loop" 0 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/cleanup-13.c b/gcc/testsuite/gcc.dg/cleanup-13.c
new file mode 100644
index 00000000000..0a5a9e9153e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cleanup-13.c
@@ -0,0 +1,319 @@
+/* HP-UX libunwind.so doesn't provide _UA_END_OF_STACK */
+/* { dg-do run } */
+/* { dg-options "-fexceptions" } */
+/* { dg-skip-if "" { "ia64-*-hpux11.*" } { "*" } { "" } } */
+/* Verify DW_OP_* handling in the unwinder. */
+
+#include <unwind.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* #define OP_addr(x) 0x06, ... */
+#define OP_deref 0x06,
+#define SLEB128(x) (x)&0x7f /* Assume here the value is -0x40 ... 0x3f. */
+#define ULEB128(x) (x)&0x7f /* Assume here the value is 0 ... 0x7f. */
+#define VAL1(x) (x)&0xff
+#if defined (__BIG_ENDIAN__)
+#define VAL2(x) ((x)>>8)&0xff,(x)&0xff
+#define VAL4(x) ((x)>>24)&0xff,((x)>>16)&0xff,((x)>>8)&0xff,(x)&0xff
+#define VAL8(x) ((x)>>56)&0xff,((x)>>48)&0xff,((x)>>40)&0xff,((x)>>32)&0xff,((x)>>24)&0xff,((x)>>16)&0xff,((x)>>8)&0xff,(x)&0xff
+#elif defined(__LITTLE_ENDIAN__) || defined(__x86_64__) || defined(__i386__)
+#define VAL2(x) (x)&0xff,((x)>>8)&0xff
+#define VAL4(x) (x)&0xff,((x)>>8)&0xff,((x)>>16)&0xff,((x)>>24)&0xff
+#define VAL8(x) (x)&0xff,((x)>>8)&0xff,((x)>>16)&0xff,((x)>>24)&0xff,((x)>>32)&0xff,((x)>>40)&0xff,((x)>>48)&0xff,((x)>>56)&0xff
+#endif
+#define OP_const1u(x) 0x08,VAL1(x),
+#define OP_const1s(x) 0x09,VAL1(x),
+#define OP_const2u(x) 0x0a,VAL2(x),
+#define OP_const2s(x) 0x0b,VAL2(x),
+#define OP_const4u(x) 0x0c,VAL4(x),
+#define OP_const4s(x) 0x0d,VAL4(x),
+#define OP_const8u(x) 0x0e,VAL8(x),
+#define OP_const8s(x) 0x0f,VAL8(x),
+#define OP_constu(x) 0x10,ULEB128(x),
+#define OP_consts(x) 0x11,SLEB128(x),
+#define OP_dup 0x12,
+#define OP_drop 0x13,
+#define OP_over 0x14,
+#define OP_pick(x) 0x15,VAL1(x),
+#define OP_swap 0x16,
+#define OP_rot 0x17,
+#define OP_xderef 0x18,
+#define OP_abs 0x19,
+#define OP_and 0x1a,
+#define OP_div 0x1b,
+#define OP_minus 0x1c,
+#define OP_mod 0x1d,
+#define OP_mul 0x1e,
+#define OP_neg 0x1f,
+#define OP_not 0x20,
+#define OP_or 0x21,
+#define OP_plus 0x22,
+#define OP_plus_uconst(x) 0x23,ULEB128(x),
+#define OP_shl 0x24,
+#define OP_shr 0x25,
+#define OP_shra 0x26,
+#define OP_xor 0x27,
+#define OP_bra(x) 0x28,VAL2(x),
+#define OP_eq 0x29,
+#define OP_ge 0x2a,
+#define OP_gt 0x2b,
+#define OP_le 0x2c,
+#define OP_lt 0x2d,
+#define OP_ne 0x2e,
+#define OP_skip(x) 0x2f,VAL2(x),
+#define OP_lit0 0x30,
+#define OP_lit1 0x31,
+#define OP_lit2 0x32,
+#define OP_lit3 0x33,
+#define OP_lit4 0x34,
+#define OP_lit5 0x35,
+#define OP_lit6 0x36,
+#define OP_lit7 0x37,
+#define OP_lit8 0x38,
+#define OP_lit9 0x39,
+#define OP_lit10 0x3a,
+#define OP_lit11 0x3b,
+#define OP_lit12 0x3c,
+#define OP_lit13 0x3d,
+#define OP_lit14 0x3e,
+#define OP_lit15 0x3f,
+#define OP_lit16 0x40,
+#define OP_lit17 0x41,
+#define OP_lit18 0x42,
+#define OP_lit19 0x43,
+#define OP_lit20 0x44,
+#define OP_lit21 0x45,
+#define OP_lit22 0x46,
+#define OP_lit23 0x47,
+#define OP_lit24 0x48,
+#define OP_lit25 0x49,
+#define OP_lit26 0x4a,
+#define OP_lit27 0x4b,
+#define OP_lit28 0x4c,
+#define OP_lit29 0x4d,
+#define OP_lit30 0x4e,
+#define OP_lit31 0x4f,
+#define OP_reg0 0x50,
+#define OP_reg1 0x51,
+#define OP_reg2 0x52,
+#define OP_reg3 0x53,
+#define OP_reg4 0x54,
+#define OP_reg5 0x55,
+#define OP_reg6 0x56,
+#define OP_reg7 0x57,
+#define OP_reg8 0x58,
+#define OP_reg9 0x59,
+#define OP_reg10 0x5a,
+#define OP_reg11 0x5b,
+#define OP_reg12 0x5c,
+#define OP_reg13 0x5d,
+#define OP_reg14 0x5e,
+#define OP_reg15 0x5f,
+#define OP_reg16 0x60,
+#define OP_reg17 0x61,
+#define OP_reg18 0x62,
+#define OP_reg19 0x63,
+#define OP_reg20 0x64,
+#define OP_reg21 0x65,
+#define OP_reg22 0x66,
+#define OP_reg23 0x67,
+#define OP_reg24 0x68,
+#define OP_reg25 0x69,
+#define OP_reg26 0x6a,
+#define OP_reg27 0x6b,
+#define OP_reg28 0x6c,
+#define OP_reg29 0x6d,
+#define OP_reg30 0x6e,
+#define OP_reg31 0x6f,
+#define OP_breg0(x) 0x70,SLEB128(x),
+#define OP_breg1(x) 0x71,SLEB128(x),
+#define OP_breg2(x) 0x72,SLEB128(x),
+#define OP_breg3(x) 0x73,SLEB128(x),
+#define OP_breg4(x) 0x74,SLEB128(x),
+#define OP_breg5(x) 0x75,SLEB128(x),
+#define OP_breg6(x) 0x76,SLEB128(x),
+#define OP_breg7(x) 0x77,SLEB128(x),
+#define OP_breg8(x) 0x78,SLEB128(x),
+#define OP_breg9(x) 0x79,SLEB128(x),
+#define OP_breg10(x) 0x7a,SLEB128(x),
+#define OP_breg11(x) 0x7b,SLEB128(x),
+#define OP_breg12(x) 0x7c,SLEB128(x),
+#define OP_breg13(x) 0x7d,SLEB128(x),
+#define OP_breg14(x) 0x7e,SLEB128(x),
+#define OP_breg15(x) 0x7f,SLEB128(x),
+#define OP_breg16(x) 0x80,SLEB128(x),
+#define OP_breg17(x) 0x81,SLEB128(x),
+#define OP_breg18(x) 0x82,SLEB128(x),
+#define OP_breg19(x) 0x83,SLEB128(x),
+#define OP_breg20(x) 0x84,SLEB128(x),
+#define OP_breg21(x) 0x85,SLEB128(x),
+#define OP_breg22(x) 0x86,SLEB128(x),
+#define OP_breg23(x) 0x87,SLEB128(x),
+#define OP_breg24(x) 0x88,SLEB128(x),
+#define OP_breg25(x) 0x89,SLEB128(x),
+#define OP_breg26(x) 0x8a,SLEB128(x),
+#define OP_breg27(x) 0x8b,SLEB128(x),
+#define OP_breg28(x) 0x8c,SLEB128(x),
+#define OP_breg29(x) 0x8d,SLEB128(x),
+#define OP_breg30(x) 0x8e,SLEB128(x),
+#define OP_breg31(x) 0x8f,SLEB128(x),
+#define OP_regx(x) 0x90,SLEB128(x),
+#define OP_fbreg(x) 0x91,SLEB128(x),
+#define OP_bregx(x,y) 0x92,ULEB128(x),SLEB128(y),
+#define OP_piece(x) 0x93,ULEB128(x),
+#define OP_deref_size(x) 0x94,VAL1(x),
+#define OP_xderef_size(x) 0x95,VAL1(x),
+#define OP_nop 0x96,
+#define OP_nop_termination 0x96
+#define OP_push_object_address 0x97,
+#define OP_call2(x) 0x98,VAL2(x),
+#define OP_call4(x) 0x99,VAL4(x),
+/* #define OP_call_ref(x) 0x9a,... */
+#define OP_form_tls_address(x) 0x9b,
+#define OP_call_frame_cfa 0x9c,
+#define OP_bit_piece(x) 0x9d,ULEB128(x),
+/* #define OP_implicit_value(x...) 0x9e,... */
+#define OP_stack_value 0x9f,
+#define OP_GNU_push_tls_address 0xe0,
+/* #define OP_GNU_encoded_addr(x...) 0xf1, */
+
+#define ASSERT_TOS_NON0 OP_bra(3) OP_skip(-3)
+#define ASSERT_TOS_0 OP_lit0 OP_eq ASSERT_TOS_NON0
+
+/* Initially there is CFA value on the stack, we want to
+ keep it there at the end. */
+#define CFI_PROGRAM \
+OP_lit0 OP_nop ASSERT_TOS_0 \
+OP_lit1 ASSERT_TOS_NON0 \
+OP_lit1 OP_const1u(1) OP_eq ASSERT_TOS_NON0 \
+OP_lit16 OP_const2u(16) OP_eq ASSERT_TOS_NON0 \
+OP_lit31 OP_const4u(31) OP_ne ASSERT_TOS_0 \
+OP_lit1 OP_neg OP_const1s(-1) OP_eq ASSERT_TOS_NON0 \
+OP_lit16 OP_neg OP_const2s(-16) OP_ne ASSERT_TOS_0 \
+OP_lit31 OP_const4s(-31) OP_neg OP_ne ASSERT_TOS_0 \
+OP_lit7 OP_dup OP_plus_uconst(2) OP_lit9 OP_eq ASSERT_TOS_NON0 \
+ OP_lit7 OP_eq ASSERT_TOS_NON0 \
+OP_lit20 OP_lit1 OP_drop OP_lit20 OP_eq ASSERT_TOS_NON0 \
+OP_lit17 OP_lit19 OP_over OP_lit17 OP_eq ASSERT_TOS_NON0 \
+ OP_lit19 OP_eq ASSERT_TOS_NON0 OP_lit17 OP_eq ASSERT_TOS_NON0 \
+OP_lit1 OP_lit2 OP_lit3 OP_lit4 OP_pick(2) OP_lit2 OP_eq ASSERT_TOS_NON0\
+ OP_lit4 OP_eq ASSERT_TOS_NON0 OP_lit3 OP_eq ASSERT_TOS_NON0 \
+ OP_pick(0) OP_lit2 OP_eq ASSERT_TOS_NON0 \
+ OP_lit2 OP_eq ASSERT_TOS_NON0 OP_lit1 OP_eq ASSERT_TOS_NON0 \
+OP_lit6 OP_lit12 OP_swap OP_lit6 OP_eq ASSERT_TOS_NON0 \
+ OP_lit12 OP_eq ASSERT_TOS_NON0 \
+OP_lit7 OP_lit8 OP_lit9 OP_rot OP_lit8 OP_eq ASSERT_TOS_NON0 \
+ OP_lit7 OP_eq ASSERT_TOS_NON0 OP_lit9 OP_eq ASSERT_TOS_NON0 \
+OP_lit7 OP_abs OP_lit7 OP_eq ASSERT_TOS_NON0 \
+OP_const1s(-123) OP_abs OP_const1u(123) OP_eq ASSERT_TOS_NON0 \
+OP_lit3 OP_lit6 OP_and OP_lit2 OP_eq ASSERT_TOS_NON0 \
+OP_lit3 OP_lit6 OP_or OP_lit7 OP_eq ASSERT_TOS_NON0 \
+OP_lit17 OP_lit2 OP_minus OP_lit15 OP_eq ASSERT_TOS_NON0 \
+OP_const1s(-6) OP_const1s(-2) OP_div OP_lit3 OP_eq ASSERT_TOS_NON0 \
+OP_const1s(-6) OP_const1s(-4) OP_mod OP_const1s(-2) \
+ OP_eq ASSERT_TOS_NON0 \
+OP_lit16 OP_lit31 OP_plus_uconst(1) OP_mul OP_const2u(512) \
+ OP_eq ASSERT_TOS_NON0 \
+OP_lit5 OP_not OP_lit31 OP_and OP_lit26 OP_eq ASSERT_TOS_NON0 \
+OP_lit12 OP_lit31 OP_plus OP_const1u(43) OP_eq ASSERT_TOS_NON0 \
+OP_const1s(-6) OP_lit2 OP_plus OP_const1s(-4) OP_eq ASSERT_TOS_NON0 \
+OP_const1s(-6) OP_plus_uconst(3) OP_const1s(-3) OP_eq ASSERT_TOS_NON0 \
+OP_lit16 OP_lit4 OP_shl OP_const2u(256) OP_eq ASSERT_TOS_NON0 \
+OP_lit16 OP_lit3 OP_shr OP_lit2 OP_eq ASSERT_TOS_NON0 \
+OP_const1s(-16) OP_lit3 OP_shra OP_const1s(-2) OP_eq ASSERT_TOS_NON0 \
+OP_lit3 OP_lit6 OP_xor OP_lit5 OP_eq ASSERT_TOS_NON0 \
+OP_lit3 OP_lit6 OP_le ASSERT_TOS_NON0 \
+OP_lit3 OP_lit3 OP_le ASSERT_TOS_NON0 \
+OP_lit6 OP_lit3 OP_le ASSERT_TOS_0 \
+OP_lit3 OP_lit6 OP_lt ASSERT_TOS_NON0 \
+OP_lit3 OP_lit3 OP_lt ASSERT_TOS_0 \
+OP_lit6 OP_lit3 OP_lt ASSERT_TOS_0 \
+OP_lit3 OP_lit6 OP_ge ASSERT_TOS_0 \
+OP_lit3 OP_lit3 OP_ge ASSERT_TOS_NON0 \
+OP_lit6 OP_lit3 OP_ge ASSERT_TOS_NON0 \
+OP_lit3 OP_lit6 OP_gt ASSERT_TOS_0 \
+OP_lit3 OP_lit3 OP_gt ASSERT_TOS_0 \
+OP_lit6 OP_lit3 OP_gt ASSERT_TOS_NON0 \
+OP_const1s(-6) OP_lit1 OP_shr OP_lit0 OP_gt ASSERT_TOS_NON0 \
+OP_const1s(-6) OP_lit1 OP_shra OP_lit0 OP_lt ASSERT_TOS_NON0
+
+#define CFI_ESCAPE_VAL_2(VALUES...) #VALUES
+#define CFI_ESCAPE_VAL_1(VALUES...) CFI_ESCAPE_VAL_2(VALUES)
+#define CFI_ESCAPE_VAL(VALUES...) CFI_ESCAPE_VAL_1(VALUES)
+#define CFI_ESCAPE do { } while (0)
+#define CFI_ARCH_PROGRAM OP_nop_termination
+#ifdef __GCC_HAVE_DWARF2_CFI_ASM
+#if defined (__x86_64__)
+#undef CFI_ESCAPE
+#undef CFI_ARCH_PROGRAM
+#define CFI_ARCH_PROGRAM CFI_PROGRAM OP_lit8 OP_minus OP_nop_termination
+unsigned char cfi_arch_program[] = { CFI_ARCH_PROGRAM };
+extern char verify_it[sizeof (cfi_arch_program) - 0x80 < 0x3f80 ? 1 : -1];
+/* DW_CFA_expression %rip, uleb128(l2-l1), l1: program DW_OP_lit8 DW_OP_minus DW_OP_nop l2: */
+#define CFI_ESCAPE \
+ asm volatile (".cfi_escape 0x10, 0x10, (%P0&0x7f)+0x80, %P0>>7, " \
+ CFI_ESCAPE_VAL (CFI_ARCH_PROGRAM) \
+ : : "i" (sizeof (cfi_arch_program)))
+#elif defined (__i386__)
+#undef CFI_ESCAPE
+#undef CFI_ARCH_PROGRAM
+#define CFI_ARCH_PROGRAM CFI_PROGRAM OP_lit4 OP_minus OP_nop_termination
+unsigned char cfi_arch_program[] = { CFI_ARCH_PROGRAM };
+extern char verify_it[sizeof (cfi_arch_program) - 0x80 < 0x3f80 ? 1 : -1];
+/* DW_CFA_expression %eip, uleb128(l2-l1), l1: program DW_OP_lit4 DW_OP_minus DW_OP_nop l2: */
+#define CFI_ESCAPE \
+ asm volatile (".cfi_escape 0x10, 8, (%P0&0x7f)+0x80, %P0>>7, " \
+ CFI_ESCAPE_VAL (CFI_ARCH_PROGRAM) \
+ : : "i" (sizeof (cfi_arch_program)))
+#endif
+#endif
+static _Unwind_Reason_Code
+force_unwind_stop (int version, _Unwind_Action actions,
+ _Unwind_Exception_Class exc_class,
+ struct _Unwind_Exception *exc_obj,
+ struct _Unwind_Context *context,
+ void *stop_parameter)
+{
+ if (actions & _UA_END_OF_STACK)
+ abort ();
+ return _URC_NO_REASON;
+}
+
+static void force_unwind ()
+{
+ struct _Unwind_Exception *exc = malloc (sizeof (*exc));
+ memset (&exc->exception_class, 0, sizeof (exc->exception_class));
+ exc->exception_cleanup = 0;
+
+#ifndef __USING_SJLJ_EXCEPTIONS__
+ _Unwind_ForcedUnwind (exc, force_unwind_stop, 0);
+#else
+ _Unwind_SjLj_ForcedUnwind (exc, force_unwind_stop, 0);
+#endif
+
+ abort ();
+}
+
+static void handler (void *p __attribute__((unused)))
+{
+ exit (0);
+}
+
+__attribute__((noinline)) static void callme ()
+{
+ CFI_ESCAPE;
+ force_unwind ();
+}
+
+__attribute__((noinline)) static void doit ()
+{
+ char dummy __attribute__((cleanup (handler)));
+ callme ();
+}
+
+int main()
+{
+ doit ();
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.dg/cpp/include6.c b/gcc/testsuite/gcc.dg/cpp/include6.c
new file mode 100644
index 00000000000..2bb1320daa2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/include6.c
@@ -0,0 +1,14 @@
+/* { dg-do preprocess } */
+/* { dg-options "-std=gnu99" } */
+
+#include <stddef.h>
+#include "stddef.h"
+#include L"stddef.h" /* { dg-error "include expects" } */
+#include u"stddef.h" /* { dg-error "include expects" } */
+#include U"stddef.h" /* { dg-error "include expects" } */
+#include u8"stddef.h" /* { dg-error "include expects" } */
+#include R"[stddef.h]" /* { dg-error "include expects" } */
+#include LR"[stddef.h]" /* { dg-error "include expects" } */
+#include uR"[stddef.h]" /* { dg-error "include expects" } */
+#include UR"[stddef.h]" /* { dg-error "include expects" } */
+#include u8R"[stddef.h]" /* { dg-error "include expects" } */
diff --git a/gcc/testsuite/gcc.dg/cpp/separate-1.c b/gcc/testsuite/gcc.dg/cpp/separate-1.c
index 6814a0fa2d0..33d910b3c00 100644
--- a/gcc/testsuite/gcc.dg/cpp/separate-1.c
+++ b/gcc/testsuite/gcc.dg/cpp/separate-1.c
@@ -8,8 +8,8 @@
#define FOO()
-int FOO( /* { dg-error "parse error|syntax error|expected" "error on this line" } */
- ), bar;
+int FOO(
+ ), bar; /* { dg-error "parse error|syntax error|expected" "error on this line" } */
int baz FOO /* { dg-error "parse error|syntax error|expected" "error on this line" } */
;
diff --git a/gcc/testsuite/gcc.dg/cpp/spacing1.c b/gcc/testsuite/gcc.dg/cpp/spacing1.c
index 2d70f869d21..c21a6b5159b 100644
--- a/gcc/testsuite/gcc.dg/cpp/spacing1.c
+++ b/gcc/testsuite/gcc.dg/cpp/spacing1.c
@@ -1,6 +1,7 @@
/* Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc. */
/* { dg-do preprocess } */
+/* { dg-options "-P" } */
/* This tests correct spacing of macro expansion output, as well as
the line it falls on. This is quite subtle; it involves newlines
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/inline3.c b/gcc/testsuite/gcc.dg/debug/dwarf2/inline3.c
new file mode 100644
index 00000000000..feafb33e829
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/inline3.c
@@ -0,0 +1,22 @@
+/* Verify that only one DW_AT_const_value is emitted for baz,
+ not for baz abstract DIE and again inside of
+ DW_TAG_inlined_subroutine. */
+/* { dg-options "-O2 -g -dA" } */
+/* { dg-do compile } */
+/* { dg-final { scan-assembler-times " DW_AT_const_value" 1 } } */
+
+struct A { const long i; const long j; };
+
+static inline long
+foo (void)
+{
+ const struct A baz = { .i = 2, .j = 21 };
+ asm volatile ("" : : : "memory");
+ return baz.i * baz.j;
+}
+
+int
+main ()
+{
+ return foo () - 42;
+}
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-1.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-1.c
new file mode 100644
index 00000000000..452c0f6808f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-1.c
@@ -0,0 +1,18 @@
+/* PR preprocessor/41445 */
+/* Test that token after multi-line function-like macro use
+ gets correct locus even when preprocessing separately. */
+/* { dg-do compile } */
+/* { dg-options "-save-temps -g -O0 -dA -fno-merge-debug-strings" } */
+
+#define A(a,b)
+int varh;A(1,
+
+
+
+ 2)int vari;
+int varj;
+
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varh\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0x)?8\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"vari\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xc|12)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varj\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xd|13)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-2.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-2.c
new file mode 100644
index 00000000000..d2ee408ac9d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-2.c
@@ -0,0 +1,9 @@
+/* PR preprocessor/41445 */
+/* { dg-do compile } */
+/* { dg-options "-g -O0 -dA -fno-merge-debug-strings" } */
+
+#include "pr41445-1.c"
+
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varh\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0x)?8\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"vari\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xc|12)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varj\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xd|13)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-3.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-3.c
new file mode 100644
index 00000000000..2a74dc5e3d4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-3.c
@@ -0,0 +1,18 @@
+/* PR preprocessor/41445 */
+/* Test that token after multi-line function-like macro use
+ gets correct locus even when preprocessing separately. */
+/* { dg-do compile } */
+/* { dg-options "-save-temps -g -O0 -dA -fno-merge-debug-strings" } */
+
+#define A(a,b)
+int varh;/*
+
+Some multi-line comment.
+
+ */int vari;
+int varj;
+
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varh\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0x)?8\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"vari\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xc|12)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varj\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xd|13)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-4.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-4.c
new file mode 100644
index 00000000000..8aa92de5dd4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-4.c
@@ -0,0 +1,9 @@
+/* PR preprocessor/41445 */
+/* { dg-do compile } */
+/* { dg-options "-g -O0 -dA -fno-merge-debug-strings" } */
+
+#include "pr41445-3.c"
+
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varh\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0x)?8\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"vari\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xc|12)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varj\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xd|13)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c
new file mode 100644
index 00000000000..03af604a7c0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c
@@ -0,0 +1,14 @@
+/* PR preprocessor/41445 */
+/* Test that token after multi-line function-like macro use
+ gets correct locus even when preprocessing separately. */
+/* { dg-do compile } */
+/* { dg-options "-save-temps -g -O0 -dA -fno-merge-debug-strings" } */
+
+#define A(x) vari x
+#define vari(x)
+#define B , varj
+int A(B) ;
+
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"vari\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0x)?7\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varj\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xa|10)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-6.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-6.c
new file mode 100644
index 00000000000..8aa37d1c1a6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-6.c
@@ -0,0 +1,8 @@
+/* PR preprocessor/41445 */
+/* { dg-do compile } */
+/* { dg-options "-g -O0 -dA -fno-merge-debug-strings" } */
+
+#include "pr41445-5.c"
+
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"vari\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0x)?7\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varj\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xa|10)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr41543.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41543.c
new file mode 100644
index 00000000000..02683960bdb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41543.c
@@ -0,0 +1,14 @@
+/* PR preprocessor/41543 */
+/* { dg-do compile } */
+/* { dg-options "-save-temps -g -O0 -dA -fno-merge-debug-strings" } */
+
+#include <stdarg.h>
+
+int
+foo (va_list ap)
+{
+ return va_arg (ap, int);
+}
+
+/* { dg-final { scan-assembler-not "DW_AT_decl_file\[^\\r\\n\]*\(pr41543\.i\)" } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr41695.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41695.c
new file mode 100644
index 00000000000..d61b5a293f5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41695.c
@@ -0,0 +1,18 @@
+/* PR debug/41695 */
+/* { dg-do compile } */
+/* { dg-options "-g -O2 -dA -fno-merge-debug-strings" } */
+
+int bar (int);
+
+void
+foo (void)
+{
+ int b = 0;
+ b = bar (b);
+ b = bar (b);
+ b = bar (b);
+ b = bar (b);
+ bar (b);
+}
+
+/* { dg-final { scan-assembler-not "LVL(\[0-9\]+)-\[^1\]\[^\\r\\n\]*Location list begin address\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*LVL\\1-1-" } } */
diff --git a/gcc/testsuite/gcc.dg/debug/pr41264-1.c b/gcc/testsuite/gcc.dg/debug/pr41264-1.c
new file mode 100644
index 00000000000..b5555b554ba
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr41264-1.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+
+typedef unsigned int hashval_t;
+static hashval_t __attribute__((always_inline))
+iterative_hash_host_wide_int (long val, hashval_t val2)
+{
+ hashval_t a = (hashval_t) val;
+ int zero = 0;
+ hashval_t b = (hashval_t) (val >> (sizeof (hashval_t) * 8 + zero));
+
+ a -= b; a -= val2; a ^= (val2>>13);
+ b -= val2; b -= a; b ^= (a<< 8);
+ val2 -= a; val2 -= b; val2 ^= ((b&0xffffffff)>>13);
+ a -= b; a -= val2; a ^= ((val2&0xffffffff)>>12);
+ b -= val2; b -= a; b = (b ^ (a<<16)) & 0xffffffff;
+ val2 -= a; val2 -= b; val2 = (val2 ^ (b>> 5)) & 0xffffffff;
+ a -= b; a -= val2; a = (a ^ (val2>> 3)) & 0xffffffff;
+ b -= val2; b -= a; b = (b ^ (a<<10)) & 0xffffffff;
+ val2 -= a; val2 -= b; val2 = (val2 ^ (b>>15)) & 0xffffffff;
+ return val2;
+}
+
+hashval_t
+bla (int nunits, int mode)
+{
+ hashval_t hashcode = 0;
+
+
+ hashcode = iterative_hash_host_wide_int (14, hashcode);
+ hashcode = iterative_hash_host_wide_int (nunits, hashcode);
+ hashcode = iterative_hash_host_wide_int (mode, hashcode);
+ if (nunits)
+ return 0;
+ else
+ return hashcode;
+}
diff --git a/gcc/testsuite/gcc.dg/debug/pr41343-1.c b/gcc/testsuite/gcc.dg/debug/pr41343-1.c
new file mode 100644
index 00000000000..6d56380383d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr41343-1.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+
+#define X(new,old) int i ## new = i ## old + i ## old;
+#define Y(pfx) X(pfx ## 1, pfx) \
+ X(pfx ## 2, pfx ## 1) \
+ X(pfx ## 3, pfx ## 2) \
+ X(pfx ## 4, pfx ## 3) \
+ X(pfx ## 5, pfx ## 4) \
+ X(pfx ## 6, pfx ## 5) \
+ X(pfx ## 7, pfx ## 6) \
+ X(pfx ## 8, pfx ## 7) \
+ X(pfx ## 9, pfx ## 8)
+
+void foo (int i1)
+{
+ Y(1)
+ Y(11)
+ Y(111)
+ asm ("" : : "X" (i1));
+}
diff --git a/gcc/testsuite/gcc.dg/debug/pr41717.c b/gcc/testsuite/gcc.dg/debug/pr41717.c
new file mode 100644
index 00000000000..21250883a11
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr41717.c
@@ -0,0 +1,10 @@
+/* PR debug/41717 */
+/* { dg-do compile } */
+
+void
+foo (void)
+{
+ _Complex float v[1], w;
+ v[1] = 0.0f + 0.8fi;
+ w = __builtin_conjf (v[1] * v[1]);
+}
diff --git a/gcc/testsuite/gcc.dg/debug/pr41893-1.c b/gcc/testsuite/gcc.dg/debug/pr41893-1.c
new file mode 100644
index 00000000000..54a31fb6f2f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr41893-1.c
@@ -0,0 +1,13 @@
+/* PR debug/41893 */
+/* { dg-do compile } */
+/* { dg-options "-combine -fwhole-program -O" } */
+/* { dg-additional-sources "pr41893-2.c" } */
+
+struct S { int v; };
+struct S s;
+
+void __attribute__((externally_visible))
+func1 (void)
+{
+ struct S *p = &s;
+}
diff --git a/gcc/testsuite/gcc.dg/debug/pr41893-2.c b/gcc/testsuite/gcc.dg/debug/pr41893-2.c
new file mode 100644
index 00000000000..f967875f198
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr41893-2.c
@@ -0,0 +1,10 @@
+/* PR debug/41893 */
+/* { dg-do compile } */
+
+extern struct S s;
+
+void
+func2 (void)
+{
+ &s;
+}
diff --git a/gcc/testsuite/gcc.dg/debug/vta-1.c b/gcc/testsuite/gcc.dg/debug/vta-1.c
new file mode 100644
index 00000000000..414083a09c0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/vta-1.c
@@ -0,0 +1,34 @@
+/* https://bugzilla.redhat.com/show_bug.cgi?id=521991#c5
+
+ Distilled from Linux XFS source code. foo, inlined into bar, ends
+ up with debug stmts referencing the addressable variable b.
+ Optimization made it non-addressable, and then completely optimized
+ away, before we got a chance to rename (and discard) the occurrence
+ in the debug stmt. When we did, we crashed, attempting to rename
+ an unreference variable. */
+
+/* { dg-do compile } */
+
+static inline int
+foo (void *x, unsigned y)
+{
+ unsigned z = *(unsigned long *) x % y;
+ *(unsigned long *) x = *(unsigned long *) x / y;
+ return z;
+}
+
+struct S
+{
+ unsigned t;
+};
+
+void
+bar (struct S *x, int *y)
+{
+ int a = 0;
+ unsigned long b = x->t;
+ foo (&b, x->t);
+ for (;; a++)
+ if (b)
+ *y = 1;
+}
diff --git a/gcc/testsuite/gcc.dg/debug/vta-2.c b/gcc/testsuite/gcc.dg/debug/vta-2.c
new file mode 100644
index 00000000000..5d44262ec76
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/vta-2.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+
+static int
+bar (void *a, unsigned int b, int n)
+{
+ int c = *(unsigned long *) a % b;
+ *(unsigned long *) a = (int) (*(unsigned long *) a) / b;
+ return c;
+}
+
+int
+foo (unsigned long x, int *y, int z)
+{
+ int level;
+ for (level = 0; level < *y; level++)
+ {
+ bar (&x, z, sizeof (x));
+ if (x)
+ return *y - 1;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/debug/vta-3.c b/gcc/testsuite/gcc.dg/debug/vta-3.c
new file mode 100644
index 00000000000..7d014f1bc1e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/vta-3.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+int
+foo (void)
+{
+ union { char e[8]; int i; } a, b;
+ char *c, *d;
+ unsigned int i;
+ c = a.e;
+ d = &b.e[sizeof (int) - 1];
+ for (i = 0; i < sizeof (int); i++)
+ {
+ *d = *c++;
+ --d;
+ }
+ return b.i;
+}
diff --git a/gcc/testsuite/gcc.dg/guality/guality.exp b/gcc/testsuite/gcc.dg/guality/guality.exp
index 82185fba1ba..d4ee6864ba4 100644
--- a/gcc/testsuite/gcc.dg/guality/guality.exp
+++ b/gcc/testsuite/gcc.dg/guality/guality.exp
@@ -1,6 +1,7 @@
# This harness is for tests that should be run at all optimisation levels.
load_lib gcc-dg.exp
+load_lib gcc-gdb-test.exp
# Disable on darwin until radr://7264615 is resolved.
if { [istarget *-*-darwin*] } {
@@ -20,82 +21,6 @@ proc check_guality {args} {
return $ret
}
-# Utility for testing variable values using gdb, invoked via dg-final.
-# Call pass if variable has the desired value, otherwise fail.
-#
-# Argument 0 is the line number on which to put a breakpoint
-# Argument 1 is the name of the variable to be checked
-# Argument 2 is the expected value of the variable
-# Argument 3 handles expected failures and the like
-proc gdb-test { args } {
- if { ![isnative] || [is_remote target] } { return }
-
- if { [llength $args] >= 4 } {
- switch [dg-process-target [lindex $args 3]] {
- "S" { }
- "N" { return }
- "F" { setup_xfail "*-*-*" }
- "P" { }
- }
- }
-
- # This assumes that we are three frames down from dg-test, and that
- # it still stores the filename of the testcase in a local variable "name".
- # A cleaner solution would require a new DejaGnu release.
- upvar 2 name testcase
- upvar 2 prog prog
-
- set gdb_name $::env(GUALITY_GDB_NAME)
- set testname "$testcase line [lindex $args 0] [lindex $args 1] == [lindex $args 2]"
- set output_file "[file rootname [file tail $prog]].exe"
- set cmd_file "[file rootname [file tail $prog]].gdb"
-
- set fd [open $cmd_file "w"]
- puts $fd "break [lindex $args 0]"
- puts $fd "run"
- puts $fd "print [lindex $args 1]"
- puts $fd "print [lindex $args 2]"
- puts $fd "quit"
- close $fd
-
- send_log "Spawning: $gdb_name -nx -nw -quiet -x $cmd_file ./$output_file\n"
- set res [remote_spawn target "$gdb_name -nx -nw -quiet -x $cmd_file ./$output_file"]
- if { $res < 0 || $res == "" } {
- unsupported "$testname"
- return
- }
-
- remote_expect target [timeout_value] {
- -re {[\n\r]\$1 = ([^\n\r]*)[\n\r]+\$2 = ([^\n\r]*)[\n\r]} {
- set first $expect_out(1,string)
- set second $expect_out(2,string)
- if { $first == $second } {
- pass "$testname"
- } else {
- send_log "$first != $second\n"
- fail "$testname"
- }
- remote_close target
- return
- }
- # Too old GDB
- -re "Unhandled dwarf expression|Error in sourced command file" {
- unsupported "$testname"
- remote_close target
- return
- }
- timeout {
- unsupported "$testname"
- remote_close target
- return
- }
- }
-
- remote_close target
- unsupported "$testname"
- return
-}
-
dg-init
global GDB
diff --git a/gcc/testsuite/gcc.dg/guality/pr41447-1.c b/gcc/testsuite/gcc.dg/guality/pr41447-1.c
new file mode 100644
index 00000000000..9bb28abe37c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/guality/pr41447-1.c
@@ -0,0 +1,26 @@
+/* { dg-do run { xfail *-*-* } } */
+/* { dg-options "-g" } */
+
+#include "guality.h"
+
+int a;
+
+int
+main (int argc, char *argv[])
+{
+ int tmp = a;
+ int tmp2 = a;
+ int tmp3;
+ int res;
+ GUALCHKVAL (a);
+ GUALCHKVAL (tmp);
+ GUALCHKVAL (tmp2);
+ a = 0;
+ tmp3 = tmp2;
+ GUALCHKVAL (a);
+ GUALCHKVAL (tmp);
+ GUALCHKVAL (tmp2);
+ GUALCHKVAL (tmp3);
+ res = tmp - tmp2 + 1;
+ return res;
+}
diff --git a/gcc/testsuite/gcc.dg/guality/pr41616-1.c b/gcc/testsuite/gcc.dg/guality/pr41616-1.c
new file mode 100644
index 00000000000..24f64ab083d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/guality/pr41616-1.c
@@ -0,0 +1,20 @@
+/* { dg-do run { xfail *-*-* } } */
+/* { dg-options "-g" } */
+
+#include "guality.h"
+
+inline int f(int *a)
+{
+ return *a;
+}
+
+int
+main(int argc, char *argv[])
+{
+ int b = -1;
+ GUALCHKVAL (b);
+ if (argc > 0)
+ b = -f(&b);
+ GUALCHKVAL (b);
+ return b;
+}
diff --git a/gcc/testsuite/gcc.dg/inline-33.c b/gcc/testsuite/gcc.dg/inline-33.c
index ac577e3cb88..d82ff71545b 100644
--- a/gcc/testsuite/gcc.dg/inline-33.c
+++ b/gcc/testsuite/gcc.dg/inline-33.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O3 -fdump-tree-optimized" } */
-/* { dg-options "-O3 -fdump-tree-optimized -fpie" { target { ! nonpic } } } */
+/* { dg-add-options bind_pic_locally } */
int i;
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-1.c b/gcc/testsuite/gcc.dg/ipa/ipa-1.c
index 76ef9a643d6..65c0a0caae3 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-1.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-1.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
-/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
+/* { dg-add-options bind_pic_locally } */
#include <stdio.h>
int g (int b, int c)
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-2.c b/gcc/testsuite/gcc.dg/ipa/ipa-2.c
index 454927a2c19..1b94bbb7bc0 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-2.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-2.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
-/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
+/* { dg-add-options bind_pic_locally } */
#include <stdio.h>
int g (int b, int c)
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-3.c b/gcc/testsuite/gcc.dg/ipa/ipa-3.c
index 6eb3da40a6f..57200a9ca5d 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-3.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-3.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
-/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
+/* { dg-add-options bind_pic_locally } */
/* Double constants. */
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-4.c b/gcc/testsuite/gcc.dg/ipa/ipa-4.c
index c162b2385f2..12af6a4f4d3 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-4.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-4.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
-/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
+/* { dg-add-options bind_pic_locally } */
#include <stdio.h>
int g (int b, int c)
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-5.c b/gcc/testsuite/gcc.dg/ipa/ipa-5.c
index 9e8006a2fef..0ca6ba21dce 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-5.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-5.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
-/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
+/* { dg-add-options bind_pic_locally } */
/* Float & short constants. */
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-7.c b/gcc/testsuite/gcc.dg/ipa/ipa-7.c
index 1c4a1709df6..b3ab0f532e4 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-7.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-7.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
-/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
+/* { dg-add-options bind_pic_locally } */
#include <stdio.h>
void send_addr (int *);
diff --git a/gcc/testsuite/gcc.dg/ipa/ipacost-2.c b/gcc/testsuite/gcc.dg/ipa/ipacost-2.c
index 958059c73e6..d06c9b8a48c 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipacost-2.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipacost-2.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining -fdump-tree-optimized" } */
-/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining -fdump-tree-optimized -fpie" { target { ! nonpic } } } */
+/* { dg-add-options bind_pic_locally } */
int array[100];
diff --git a/gcc/testsuite/gcc.dg/lto/20080908_0.c b/gcc/testsuite/gcc.dg/lto/20080908_0.c
new file mode 100644
index 00000000000..3bc1c3a725c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20080908_0.c
@@ -0,0 +1,16 @@
+/* { dg-lto-do assemble } */
+void foo(void) {
+ char *bar;
+ int baz;
+ while (1)
+ {
+ if (baz)
+ {
+ baz = -baz;
+ do
+ *bar++ = 0;
+ while (++baz);
+ }
+ ++baz;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20080917_0.c b/gcc/testsuite/gcc.dg/lto/20080917_0.c
new file mode 100644
index 00000000000..ac0891081fe
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20080917_0.c
@@ -0,0 +1,29 @@
+/* { dg-lto-do assemble } */
+/* { dg-lto-options {{-O2 -funsigned-char}} } */
+int
+foo (char *s, int flag)
+{
+ for (;;)
+ {
+ unsigned char c;
+ if (flag)
+ c = *s;
+ else
+ c = *s;
+ return c;
+ }
+}
+
+int
+baz (const char *s, int flag)
+{
+ for (;;)
+ {
+ unsigned char c;
+ if (flag)
+ c = *s;
+ else
+ c = *s;
+ return c;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20080924_0.c b/gcc/testsuite/gcc.dg/lto/20080924_0.c
new file mode 100644
index 00000000000..db7745077e2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20080924_0.c
@@ -0,0 +1,9 @@
+/* { dg-lto-do assemble } */
+/* { dg-lto-options {{-O2 -flto -funsigned-char}} } */
+typedef unsigned int size_t;
+foo (const char *src, unsigned char *dst, size_t size)
+{
+ int ch;
+ while ((ch = *src++) != '\0') {
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081024_0.c b/gcc/testsuite/gcc.dg/lto/20081024_0.c
new file mode 100644
index 00000000000..9fa297abc0e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081024_0.c
@@ -0,0 +1,26 @@
+/* { dg-lto-do run } */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+
+char *
+myprintf (const char *fmt, ...)
+{
+ va_list args;
+ static char buf[80];
+
+ va_start (args, fmt);
+ (void) vsnprintf (buf, sizeof (buf), fmt, args);
+ va_end (args);
+ return buf;
+}
+
+int
+main ()
+{
+ char *s;
+
+ s = myprintf ("%s: %d\n", "foo", 1);
+ return strcmp (s, "foo: 1\n") != 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081109_0.c b/gcc/testsuite/gcc.dg/lto/20081109_0.c
new file mode 100644
index 00000000000..eaa25f673d3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081109_0.c
@@ -0,0 +1,3 @@
+/* { dg-lto-do assemble } */
+/* { dg-lto-options {{-w -flto}} } */
+void Foo(void) { char bar[1]; free(bar); }
diff --git a/gcc/testsuite/gcc.dg/lto/20081111_0.c b/gcc/testsuite/gcc.dg/lto/20081111_0.c
new file mode 100644
index 00000000000..899689c1bc4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081111_0.c
@@ -0,0 +1,11 @@
+extern int mumble;
+extern void abort (void);
+extern void exit (int);
+
+int
+main ()
+{
+ if (++mumble != 42)
+ abort ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081111_1.c b/gcc/testsuite/gcc.dg/lto/20081111_1.c
new file mode 100644
index 00000000000..2b7fee58690
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081111_1.c
@@ -0,0 +1,7 @@
+int mumble = 41;
+
+int
+bar (void)
+{
+ return mumble;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081112_0.c b/gcc/testsuite/gcc.dg/lto/20081112_0.c
new file mode 100644
index 00000000000..a90aa70b3ab
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081112_0.c
@@ -0,0 +1,14 @@
+extern void exit (int);
+extern void abort (void);
+
+extern void f ();
+extern int g ();
+
+int
+main ()
+{
+ f ();
+ if (g () != 42)
+ abort ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081112_1.c b/gcc/testsuite/gcc.dg/lto/20081112_1.c
new file mode 100644
index 00000000000..2ba1cb9405c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081112_1.c
@@ -0,0 +1,13 @@
+static int mumble;
+
+void
+f (void)
+{
+ mumble = 41;
+}
+
+int __attribute__((noinline))
+g (void)
+{
+ return ++mumble;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081115_0.c b/gcc/testsuite/gcc.dg/lto/20081115_0.c
new file mode 100644
index 00000000000..f24a92deda4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081115_0.c
@@ -0,0 +1,32 @@
+/* { dg-lto-options {{-O2 -DOPTIMIZE -fwhopr} {-O0 -fwhopr}} } */
+
+extern void abort (void);
+
+int f (void)
+{
+ return 1;
+}
+
+extern inline int
+e_inline_baz (void)
+{
+ return 1 + f();
+}
+
+int
+bar (void)
+{
+ return e_inline_baz ();
+}
+
+main ()
+{
+#ifdef OPTIMIZE
+ if (bar () != 2 || foo () != 3)
+ abort ();
+#else
+ if (bar () != 0 || foo () != 0)
+ abort ();
+#endif
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081115_1.c b/gcc/testsuite/gcc.dg/lto/20081115_1.c
new file mode 100644
index 00000000000..62ffa520000
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081115_1.c
@@ -0,0 +1,11 @@
+extern inline int
+e_inline_baz (void)
+{
+ return 2 + 1;
+}
+
+int
+foo (void)
+{
+ return e_inline_baz ();
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081115_2.c b/gcc/testsuite/gcc.dg/lto/20081115_2.c
new file mode 100644
index 00000000000..0ccecd7363d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081115_2.c
@@ -0,0 +1,5 @@
+int
+e_inline_baz (void)
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081118_0.c b/gcc/testsuite/gcc.dg/lto/20081118_0.c
new file mode 100644
index 00000000000..0640428be6d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081118_0.c
@@ -0,0 +1,28 @@
+/* { dg-lto-options {{-O2 -DOPTIMIZE -fwhopr} {-O0 -fwhopr}} } */
+
+extern void abort (void);
+extern int f (void);
+
+extern inline int
+e_inline_baz (void)
+{
+ return 1 + f();
+}
+
+int
+bar (void)
+{
+ return e_inline_baz ();
+}
+
+main ()
+{
+#ifdef OPTIMIZE
+ if (bar () != 2 || foo () != 3)
+ abort ();
+#else
+ if (bar () != 0 || foo () != 0)
+ abort ();
+#endif
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081118_1.c b/gcc/testsuite/gcc.dg/lto/20081118_1.c
new file mode 100644
index 00000000000..f0a8c3c876b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081118_1.c
@@ -0,0 +1,13 @@
+extern int f (void);
+
+extern inline int
+e_inline_baz (void)
+{
+ return 2 + f ();
+}
+
+int
+foo (void)
+{
+ return e_inline_baz ();
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081118_2.c b/gcc/testsuite/gcc.dg/lto/20081118_2.c
new file mode 100644
index 00000000000..32ce432a128
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081118_2.c
@@ -0,0 +1,11 @@
+int
+e_inline_baz (void)
+{
+ return 0;
+}
+
+ __attribute__((noinline)) int
+f (void)
+{
+ return 1;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081120-1_0.c b/gcc/testsuite/gcc.dg/lto/20081120-1_0.c
new file mode 100644
index 00000000000..e842b37f663
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081120-1_0.c
@@ -0,0 +1,5 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-flto -r -nostdlib}} } */
+extern int stat(void) __asm__("" "stat64");
+extern inline int stat(void) { }
+static void foo(void) { stat(); }
diff --git a/gcc/testsuite/gcc.dg/lto/20081120-1_1.c b/gcc/testsuite/gcc.dg/lto/20081120-1_1.c
new file mode 100644
index 00000000000..73d25000c91
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081120-1_1.c
@@ -0,0 +1,3 @@
+extern int stat(void) __asm__("" "stat64");
+extern inline int stat(void) { }
+static void foo(void) { stat(); }
diff --git a/gcc/testsuite/gcc.dg/lto/20081120-2_0.c b/gcc/testsuite/gcc.dg/lto/20081120-2_0.c
new file mode 100644
index 00000000000..19c4ab34784
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081120-2_0.c
@@ -0,0 +1,3 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fwhopr -r -nostdlib}} } */
+void bar(void) {}
diff --git a/gcc/testsuite/gcc.dg/lto/20081120-2_1.c b/gcc/testsuite/gcc.dg/lto/20081120-2_1.c
new file mode 100644
index 00000000000..c81f8c7fd07
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081120-2_1.c
@@ -0,0 +1,2 @@
+int mumble = 0;
+void foo(void) {}
diff --git a/gcc/testsuite/gcc.dg/lto/20081125_0.c b/gcc/testsuite/gcc.dg/lto/20081125_0.c
new file mode 100644
index 00000000000..4b2e7191fed
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081125_0.c
@@ -0,0 +1,6 @@
+int foo (int);
+
+int main()
+{
+ return foo (0);
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081125_1.c b/gcc/testsuite/gcc.dg/lto/20081125_1.c
new file mode 100644
index 00000000000..1fcf4e7d391
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081125_1.c
@@ -0,0 +1,4 @@
+int foo (int x)
+{
+ return x;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081126_0.c b/gcc/testsuite/gcc.dg/lto/20081126_0.c
new file mode 100644
index 00000000000..9243da96a79
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081126_0.c
@@ -0,0 +1,8 @@
+/* { dg-lto-do link } */
+/* { dg-skip-if "" { ! { i?86-*-* x86_64-*-* } } { "*" } { "" } } */
+/* { dg-lto-options {{-flto -r -nostdlib}} } */
+
+int f(void) {
+ register int ri asm("edi");
+ return ri;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081201-1_0.c b/gcc/testsuite/gcc.dg/lto/20081201-1_0.c
new file mode 100644
index 00000000000..05cbb82fdd1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081201-1_0.c
@@ -0,0 +1,33 @@
+/* { dg-lto-options {{-O2 -DOPTIMIZE -fwhopr} {-O0 -fwhopr}} } */
+
+extern void abort (void);
+
+int
+f (void)
+{
+ return 1;
+}
+
+extern inline int
+e_inline_baz (void)
+{
+ return 1 + f();
+}
+
+int
+bar (void)
+{
+ return e_inline_baz ();
+}
+
+main ()
+{
+#ifdef OPTIMIZE
+ if (bar () != 2 || foo () != 3)
+ abort ();
+#else
+ if (bar () != 0 || foo () != 0)
+ abort ();
+#endif
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081201-1_1.c b/gcc/testsuite/gcc.dg/lto/20081201-1_1.c
new file mode 100644
index 00000000000..f0a8c3c876b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081201-1_1.c
@@ -0,0 +1,13 @@
+extern int f (void);
+
+extern inline int
+e_inline_baz (void)
+{
+ return 2 + f ();
+}
+
+int
+foo (void)
+{
+ return e_inline_baz ();
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081201-1_2.c b/gcc/testsuite/gcc.dg/lto/20081201-1_2.c
new file mode 100644
index 00000000000..bcf87a749b5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081201-1_2.c
@@ -0,0 +1,7 @@
+int
+e_inline_baz (void)
+{
+ return 0;
+}
+
+
diff --git a/gcc/testsuite/gcc.dg/lto/20081201-2_0.c b/gcc/testsuite/gcc.dg/lto/20081201-2_0.c
new file mode 100644
index 00000000000..4c1510d1cec
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081201-2_0.c
@@ -0,0 +1,16 @@
+/* { dg-lto-options {{-O3 -fwhopr}} } */
+
+/* Test that cross-TU inlining works. */
+
+extern void abort ();
+extern void exit (int);
+extern void *foo (void);
+
+int
+main ()
+{
+ if (foo () != __builtin_return_address (0))
+ abort ();
+
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081201-2_1.c b/gcc/testsuite/gcc.dg/lto/20081201-2_1.c
new file mode 100644
index 00000000000..f93e1fd025f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081201-2_1.c
@@ -0,0 +1,5 @@
+void *
+foo (void)
+{
+ return __builtin_return_address (0);
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081202-1_0.c b/gcc/testsuite/gcc.dg/lto/20081202-1_0.c
new file mode 100644
index 00000000000..933610a894b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081202-1_0.c
@@ -0,0 +1,11 @@
+/* { dg-lto-options {{-fwhopr -O3}} } */
+
+extern void exit (int);
+extern void foo (void);
+
+int
+main ()
+{
+ foo ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081202-1_1.c b/gcc/testsuite/gcc.dg/lto/20081202-1_1.c
new file mode 100644
index 00000000000..2f6777864a0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081202-1_1.c
@@ -0,0 +1,10 @@
+static void __attribute__((noinline))
+bar (void)
+{
+}
+
+void
+foo (void)
+{
+ bar ();
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081202-2_0.c b/gcc/testsuite/gcc.dg/lto/20081202-2_0.c
new file mode 100644
index 00000000000..09f417698ca
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081202-2_0.c
@@ -0,0 +1,13 @@
+/* { dg-lto-options {{-fwhopr -O3}} } */
+
+extern void exit (int);
+extern void *foo (void);
+
+void *p;
+
+int
+main ()
+{
+ p = foo ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081202-2_1.c b/gcc/testsuite/gcc.dg/lto/20081202-2_1.c
new file mode 100644
index 00000000000..adb15024502
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081202-2_1.c
@@ -0,0 +1,16 @@
+static void __attribute__((noinline))
+bar (void)
+{
+}
+
+void *
+foo (void)
+{
+ return bar;
+}
+
+void
+quxx (void)
+{
+ return bar ();
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081204-1_0.c b/gcc/testsuite/gcc.dg/lto/20081204-1_0.c
new file mode 100644
index 00000000000..5952b07b76f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081204-1_0.c
@@ -0,0 +1,7 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fwhopr -fPIC -r -nostdlib}} } */
+
+/* Tests for the absence during linking of:
+ lto1: error: type of 'i' does not match original declaration */
+
+const int i[1];
diff --git a/gcc/testsuite/gcc.dg/lto/20081204-1_1.c b/gcc/testsuite/gcc.dg/lto/20081204-1_1.c
new file mode 100644
index 00000000000..95761ea156b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081204-1_1.c
@@ -0,0 +1,5 @@
+extern const int i[];
+
+int dummy(void) {
+ return i[0];
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081204-2_0.c b/gcc/testsuite/gcc.dg/lto/20081204-2_0.c
new file mode 100644
index 00000000000..53446050f95
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081204-2_0.c
@@ -0,0 +1,5 @@
+/* { dg-lto-do link } */
+/* { dg-skip-if "" { ! { i?86-*-* x86_64-*-* } } { "*" } { "" } } */
+/* { dg-lto-options {{-w -flto -fPIC -r -nostdlib}} } */
+
+register int ri asm("edi");
diff --git a/gcc/testsuite/gcc.dg/lto/20081210-1_0.c b/gcc/testsuite/gcc.dg/lto/20081210-1_0.c
new file mode 100644
index 00000000000..5cf020ec227
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081210-1_0.c
@@ -0,0 +1,21 @@
+#if defined(_LP64) || defined(_WIN64)
+typedef unsigned long int uintptr_t;
+#else
+typedef unsigned int uintptr_t;
+#endif
+
+extern void srand (uintptr_t);
+
+inline void
+foo (uintptr_t seed)
+{
+ srand (seed * seed);
+}
+
+int
+main ()
+{
+ foo (0);
+ srand ((uintptr_t) (&foo));
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081212-1_0.c b/gcc/testsuite/gcc.dg/lto/20081212-1_0.c
new file mode 100644
index 00000000000..acc00186840
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081212-1_0.c
@@ -0,0 +1,4 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-r -nostdlib}} } */
+int exported_var = 42;
+/* { dg-final { scan-symbol "exported_var" } } */
diff --git a/gcc/testsuite/gcc.dg/lto/20081222_0.c b/gcc/testsuite/gcc.dg/lto/20081222_0.c
new file mode 100644
index 00000000000..e44766613bd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081222_0.c
@@ -0,0 +1,11 @@
+#include "20081222_0.h"
+
+extern void abort (void);
+
+int
+main ()
+{
+ if (x () == 7)
+ return 0;
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081222_0.h b/gcc/testsuite/gcc.dg/lto/20081222_0.h
new file mode 100644
index 00000000000..4c26f461651
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081222_0.h
@@ -0,0 +1 @@
+int x();
diff --git a/gcc/testsuite/gcc.dg/lto/20081222_1.c b/gcc/testsuite/gcc.dg/lto/20081222_1.c
new file mode 100644
index 00000000000..e8f9254421b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081222_1.c
@@ -0,0 +1,16 @@
+#include "20081222_0.h"
+
+/* Actually, call "x" "INT_X", and make it hidden. */
+extern __typeof (x) x
+ __asm__ ("INT_x")
+ __attribute__ ((__visibility__ ("hidden")));
+
+int x ()
+{
+ return 7;
+}
+
+/* Make an externally-visible symbol "X" that's an alias for INT_x. */
+extern __typeof (x) EXT_x
+ __asm__ ("x")
+ __attribute__ ((__alias__ ("INT_x")));
diff --git a/gcc/testsuite/gcc.dg/lto/20081224_0.c b/gcc/testsuite/gcc.dg/lto/20081224_0.c
new file mode 100644
index 00000000000..9c784fe29ff
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081224_0.c
@@ -0,0 +1,9 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fwhopr -r -nostdlib -fPIC}} } */
+#include "20081224_0.h"
+
+extern struct foo x;
+
+void f(void) {
+ x.x = 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081224_0.h b/gcc/testsuite/gcc.dg/lto/20081224_0.h
new file mode 100644
index 00000000000..7b62a079667
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081224_0.h
@@ -0,0 +1,3 @@
+typedef struct foo {
+ int x;
+} foo_t;
diff --git a/gcc/testsuite/gcc.dg/lto/20081224_1.c b/gcc/testsuite/gcc.dg/lto/20081224_1.c
new file mode 100644
index 00000000000..3e1ff341088
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081224_1.c
@@ -0,0 +1,2 @@
+#include "20081224_0.h"
+foo_t x;
diff --git a/gcc/testsuite/gcc.dg/lto/20090116_0.c b/gcc/testsuite/gcc.dg/lto/20090116_0.c
new file mode 100644
index 00000000000..9fd83ca0766
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090116_0.c
@@ -0,0 +1,12 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-O1 -fwhopr -fPIC}} } */
+/* { dg-extra-ld-options {-r -nostdlib -O0} } */
+
+int foo(void) {
+ int ret, i;
+ for (i = 0; i < 1; i++)
+ ret = 0;
+ for (i = 0; i < 1; i++)
+ ret = 1;
+ return ret;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090120_0.c b/gcc/testsuite/gcc.dg/lto/20090120_0.c
new file mode 100644
index 00000000000..6c69a9918b2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090120_0.c
@@ -0,0 +1,14 @@
+/* { dg-lto-options {{-flto -funsigned-char}} } */
+
+extern void abort ();
+
+char c = 0xff;
+
+int
+main ()
+{
+ int i = (unsigned) c;
+ if (i < 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090126-1_0.c b/gcc/testsuite/gcc.dg/lto/20090126-1_0.c
new file mode 100644
index 00000000000..b2a25b2261c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090126-1_0.c
@@ -0,0 +1,7 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-O0 -fwhopr}} } */
+/* { dg-extra-ld-options {-r -nostdlib -O2 -fwhopr} } */
+
+int main(int argc, char **argv) {
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090126-2_0.c b/gcc/testsuite/gcc.dg/lto/20090126-2_0.c
new file mode 100644
index 00000000000..a366c183873
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090126-2_0.c
@@ -0,0 +1,7 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fPIC -O2 -fwhopr}} } */
+/* { dg-extra-ld-options {-fno-PIC -r -nostdlib -O2 -fwhopr} } */
+
+int main(int argc, char **argv) {
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090206-1_0.c b/gcc/testsuite/gcc.dg/lto/20090206-1_0.c
new file mode 100644
index 00000000000..13cd8861183
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090206-1_0.c
@@ -0,0 +1,10 @@
+/* { dg-lto-do link } */
+/* { dg-skip-if "" { ! { i?86-*-linux* x86_64-*-linux* } } { "*" } { "" } } */
+/* { dg-lto-options {{-fPIC -r -nostdlib -fwhopr -msse2}} } */
+/* { dg-suppress-ld-options {-fPIC -msse2} } */
+
+typedef short v8hi __attribute__((__vector_size__(16)));
+void func (void) {
+ v8hi x, y, z;
+ z = __builtin_ia32_paddw128 (x, y);
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090206-2_0.c b/gcc/testsuite/gcc.dg/lto/20090206-2_0.c
new file mode 100644
index 00000000000..3e85c5d227c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090206-2_0.c
@@ -0,0 +1,18 @@
+/* { dg-lto-do link } */
+/* { dg-skip-if "" { ! { i?86-*-linux* x86_64-*-linux* } } { "*" } { "" } } */
+/* { dg-lto-options {{-fwhopr -fPIC}} } */
+/* { dg-suppress-ld-options {-fPIC} } */
+
+void func(int n) {
+ static int __thread v = 0;
+ int i;
+ for (i = 0; i < n; ++i) {
+ volatile int *p = &v;
+ volatile int x __attribute__ ((unused)) = *p;
+ }
+}
+
+int main(int argc, char **argv) {
+ func(argc);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090210_0.c b/gcc/testsuite/gcc.dg/lto/20090210_0.c
new file mode 100644
index 00000000000..c588e8a2778
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090210_0.c
@@ -0,0 +1,6 @@
+/* { dg-lto-do run } */
+/* { dg-suppress-ld-options {-fPIC} } */
+int foo (int x)
+{
+ return x;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090210_1.c b/gcc/testsuite/gcc.dg/lto/20090210_1.c
new file mode 100644
index 00000000000..bf12aa6c08b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090210_1.c
@@ -0,0 +1,22 @@
+/* { dg-options "-fPIC" } */
+static void
+f (int n)
+{
+ int i;
+ static int __thread value = 100;
+ for (i = 0; i < n; ++i)
+ {
+ volatile int *p = &value;
+ volatile int x __attribute__ ((unused)) = *p;
+ }
+}
+
+
+extern int foo (int);
+
+int
+main (int argc, char **argv)
+{
+ f (foo (4) + argc);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090213_0.c b/gcc/testsuite/gcc.dg/lto/20090213_0.c
new file mode 100644
index 00000000000..6387a0e4716
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090213_0.c
@@ -0,0 +1,11 @@
+/* { dg-lto-do run } */
+#include <stdio.h>
+
+extern int foo (int);
+
+main()
+{
+ int x = foo (10);
+ printf ("x is %d, foo is at 0x%p\n", x, foo);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090213_1.c b/gcc/testsuite/gcc.dg/lto/20090213_1.c
new file mode 100644
index 00000000000..4a852efd193
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090213_1.c
@@ -0,0 +1,6 @@
+int foo (int x)
+{
+ return x * 32;
+}
+
+
diff --git a/gcc/testsuite/gcc.dg/lto/20090218-1_0.c b/gcc/testsuite/gcc.dg/lto/20090218-1_0.c
new file mode 100644
index 00000000000..1dc9ee08540
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090218-1_0.c
@@ -0,0 +1,4 @@
+void set_mem_alias_set () __attribute__ ((always_inline));
+void emit_push_insn () {
+ set_mem_alias_set ();
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090218-1_1.c b/gcc/testsuite/gcc.dg/lto/20090218-1_1.c
new file mode 100644
index 00000000000..33d4fb000f3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090218-1_1.c
@@ -0,0 +1,9 @@
+int main(void)
+{
+ return 0;
+}
+static void __attribute__ ((noinline)) get_mem_attrs () {
+}
+void __attribute__ ((always_inline)) set_mem_alias_set () {
+ get_mem_attrs ();
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090218-2_0.c b/gcc/testsuite/gcc.dg/lto/20090218-2_0.c
new file mode 100644
index 00000000000..8857e7a6d21
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090218-2_0.c
@@ -0,0 +1,3 @@
+void emit_push_insn () {
+ set_mem_alias_set ();
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090218-2_1.c b/gcc/testsuite/gcc.dg/lto/20090218-2_1.c
new file mode 100644
index 00000000000..119fbe4a16b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090218-2_1.c
@@ -0,0 +1,19 @@
+typedef struct {
+} mem_attrs;
+int main(void)
+{
+ return 0;
+}
+void *malloc(unsigned long size);
+void *memcpy(void *dest, const void *src, unsigned long n);
+static mem_attrs * get_mem_attrs () {
+ void **slot;
+ *slot = malloc (3);
+ memcpy (*slot, 0, 3);
+}
+void set_mem_attributes () {
+ get_mem_attrs ();
+}
+void set_mem_alias_set () {
+ get_mem_attrs ();
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090218_0.c b/gcc/testsuite/gcc.dg/lto/20090218_0.c
new file mode 100644
index 00000000000..c4390fa1f10
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090218_0.c
@@ -0,0 +1,7 @@
+void __attribute__((noinline)) *foo1(void);
+void __attribute__((noinline)) *foo2(void);
+
+int main(void)
+{
+ return foo1() != foo2();
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090218_1.c b/gcc/testsuite/gcc.dg/lto/20090218_1.c
new file mode 100644
index 00000000000..c28b84ada6e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090218_1.c
@@ -0,0 +1,6 @@
+void bar(void);
+void __attribute__((noinline)) *foo1 (void)
+{
+ bar();
+ return (void *) bar;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090218_2.c b/gcc/testsuite/gcc.dg/lto/20090218_2.c
new file mode 100644
index 00000000000..e9f835f3627
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090218_2.c
@@ -0,0 +1,6 @@
+void bar(void);
+void __attribute__((noinline)) *foo2 (void)
+{
+ bar();
+ return (void *) bar;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090218_3.c b/gcc/testsuite/gcc.dg/lto/20090218_3.c
new file mode 100644
index 00000000000..e1f4df61479
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090218_3.c
@@ -0,0 +1,3 @@
+void bar(void)
+{
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090219_0.c b/gcc/testsuite/gcc.dg/lto/20090219_0.c
new file mode 100644
index 00000000000..b93dd1fe946
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090219_0.c
@@ -0,0 +1,28 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-O3 -fwhopr -fPIC -r -nostdlib}} } */
+
+struct Foo { int f1, f2, f3, f4, f5; };
+
+int x = 0;
+struct Foo *foo;
+
+inline void Bar(int n){
+ foo[x].f1 = 0;
+ foo[x].f2 = 0;
+ foo[x].f3 = 0;
+ foo[x].f4 = 0;
+ foo[x].f5 = n;
+}
+
+int ei[1];
+inline void Baz(int n) {
+ if (ei[n] == 1)
+ Bar (0);
+ else if (ei[n] == 0)
+ Bar (1);
+}
+
+void mumble(void) {
+ for (;;)
+ Baz (0);
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090312_0.c b/gcc/testsuite/gcc.dg/lto/20090312_0.c
new file mode 100644
index 00000000000..8aaad754cc3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090312_0.c
@@ -0,0 +1,43 @@
+/* { dg-lto-do link } */
+extern int **foo (void);
+extern void mumble (char*, char*, char*);
+
+static int *
+bar (char **sp)
+{
+ char *s = *sp, *rs = s;
+ int c;
+ while (*foo ()[c])
+ rs++;
+ while (c = *rs)
+ {
+ if (c || ((c == '"') || (c == '\'')))
+ {
+ if (c)
+ *rs++ = c;
+ else
+ mumble (0, "", "");
+ }
+ else if (c || (*foo ()[c] & 1))
+ *rs++ = c;
+ }
+ if (c)
+ mumble (0, "", "");
+}
+
+static void
+baz (char *s)
+{
+ char *args[100];
+ while (bar (&s))
+ {
+ mumble (args[0], "", "");
+ }
+}
+
+int
+main (void)
+{
+ baz ("");
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090312_1.c b/gcc/testsuite/gcc.dg/lto/20090312_1.c
new file mode 100644
index 00000000000..882fb0f4157
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090312_1.c
@@ -0,0 +1,9 @@
+int **foo (void)
+{
+
+}
+
+void mumble (char* a, char* b , char* c)
+{
+
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090313_0.c b/gcc/testsuite/gcc.dg/lto/20090313_0.c
new file mode 100644
index 00000000000..120ba3c50e0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090313_0.c
@@ -0,0 +1,9 @@
+void
+_cairo_clip_path_reference () {
+ int a;
+ __sync_fetch_and_add(&a, 1);
+}
+
+int main(void) {
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090706-1_0.c b/gcc/testsuite/gcc.dg/lto/20090706-1_0.c
new file mode 100644
index 00000000000..7877fd350d7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090706-1_0.c
@@ -0,0 +1,42 @@
+#include <stdarg.h>
+
+extern void abort (void);
+
+void foo (int size, ...)
+{
+ struct
+ {
+ struct
+ {
+ char x[size];
+ } e;
+ unsigned r;
+ } d;
+ va_list ap;
+ char c;
+ int i;
+
+ va_start (ap, size);
+ d = va_arg (ap, typeof (d));
+ c = d.e.x[3];
+ if (c != '3')
+ abort ();
+ if (d.r != 2602)
+ abort ();
+ va_end (ap);
+}
+
+int main (void)
+{
+ int z = 5, i;
+ struct { struct { char a[z]; } y; unsigned r; } x;
+
+ x.y.a[0] = '0';
+ x.y.a[1] = '1';
+ x.y.a[2] = '2';
+ x.y.a[3] = '3';
+ x.y.a[4] = '4';
+ x.r = 2602;
+ foo (z, x);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090706-2_0.c b/gcc/testsuite/gcc.dg/lto/20090706-2_0.c
new file mode 100644
index 00000000000..69da98b5cca
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090706-2_0.c
@@ -0,0 +1,16 @@
+extern void abort (void);
+
+int foo (int size)
+{
+ int a[size];
+ a[size - 10] = 42;
+ return a[size - 10] + size;
+}
+
+main()
+{
+ int x = foo (20);
+ if (x != 62)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090717_0.c b/gcc/testsuite/gcc.dg/lto/20090717_0.c
new file mode 100644
index 00000000000..fe13bdf78d4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090717_0.c
@@ -0,0 +1,4 @@
+struct variable {
+ const char *string;
+};
+struct variable table[] = { };
diff --git a/gcc/testsuite/gcc.dg/lto/20090717_1.c b/gcc/testsuite/gcc.dg/lto/20090717_1.c
new file mode 100644
index 00000000000..bda8138214b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090717_1.c
@@ -0,0 +1,11 @@
+struct variable {
+ const char *string;
+};
+extern struct variable table[];
+int main(int argc, char *argv[])
+{
+ struct variable *p;
+ for(p = table; p->string; p++)
+ ;
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090729_0.c b/gcc/testsuite/gcc.dg/lto/20090729_0.c
new file mode 100644
index 00000000000..05ae74f872e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090729_0.c
@@ -0,0 +1,4 @@
+/* { dg-lto-options "-w" } */
+
+double i;
+int j;
diff --git a/gcc/testsuite/gcc.dg/lto/20090729_1.c b/gcc/testsuite/gcc.dg/lto/20090729_1.c
new file mode 100644
index 00000000000..0a5091ac29e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090729_1.c
@@ -0,0 +1,4 @@
+double j;
+int i;
+int main () { return i; }
+
diff --git a/gcc/testsuite/gcc.dg/lto/20090812_0.c b/gcc/testsuite/gcc.dg/lto/20090812_0.c
new file mode 100644
index 00000000000..baf20f520a2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090812_0.c
@@ -0,0 +1,11 @@
+struct X;
+struct Y
+{
+ struct X *p;
+ int i;
+};
+
+void foo (struct Y *p)
+{
+ p->i = 1;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090812_1.c b/gcc/testsuite/gcc.dg/lto/20090812_1.c
new file mode 100644
index 00000000000..e91424492a0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090812_1.c
@@ -0,0 +1,26 @@
+/* struct X is complete in this TU, this causes us to not merge Y and
+ thus assign different alias-sets to them. */
+struct X
+{
+ int i;
+};
+struct Y
+{
+ struct X *p;
+ int i;
+};
+extern void abort (void);
+extern void foo(struct Y *);
+int __attribute__((noinline)) bar(struct Y *p)
+{
+ p->i = 0;
+ foo (p);
+ return p->i;
+}
+int main()
+{
+ struct Y y;
+ if (bar (&y) != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090914-1_0.c b/gcc/testsuite/gcc.dg/lto/20090914-1_0.c
new file mode 100644
index 00000000000..ef9f7b35182
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090914-1_0.c
@@ -0,0 +1,13 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-flto -g -fvar-tracking-assignments}} } */
+/* { dg-suppress-ld-options "-g -fvar-tracking-assignments" } */
+
+void foo()
+{
+ int hex = 0x4;
+}
+
+int main()
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090914-2_0.c b/gcc/testsuite/gcc.dg/lto/20090914-2_0.c
new file mode 100644
index 00000000000..906b3c44196
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090914-2_0.c
@@ -0,0 +1,12 @@
+/* { dg-lto-do run } */
+/* { dg-skip-if "x86 only" { ! { x86_64-*-* i?86-*-* } } { "*" } { "" } } */
+
+/* Doesn't work without this dummy function with -fwhopr. */
+int foo(void) { }
+
+asm(".text\n"
+ ".globl main\n"
+ "\t.type main,@function\n"
+ "main:\n"
+ "\txorl %eax, %eax\n"
+ "\tret\n");
diff --git a/gcc/testsuite/gcc.dg/lto/20091005-1_0.c b/gcc/testsuite/gcc.dg/lto/20091005-1_0.c
new file mode 100644
index 00000000000..f4316efbc35
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091005-1_0.c
@@ -0,0 +1,3 @@
+/* { dg-lto-do run } */
+
+const int i[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
diff --git a/gcc/testsuite/gcc.dg/lto/20091005-1_1.c b/gcc/testsuite/gcc.dg/lto/20091005-1_1.c
new file mode 100644
index 00000000000..52eb8e78b3f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091005-1_1.c
@@ -0,0 +1,2 @@
+extern int i[10];
+int main () { return i[0]; }
diff --git a/gcc/testsuite/gcc.dg/lto/20091005-2_0.c b/gcc/testsuite/gcc.dg/lto/20091005-2_0.c
new file mode 100644
index 00000000000..d1485d671d6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091005-2_0.c
@@ -0,0 +1,11 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fstrict-aliasing -flto}} } */
+
+typedef struct { } t_commrec;
+typedef struct { } t_fft_c;
+void
+solve_pme(t_commrec *cr)
+{
+ t_fft_c *ptr;
+}
+int main () { return 0; }
diff --git a/gcc/testsuite/gcc.dg/lto/20091006-1_0.c b/gcc/testsuite/gcc.dg/lto/20091006-1_0.c
new file mode 100644
index 00000000000..9b4356edc22
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091006-1_0.c
@@ -0,0 +1,14 @@
+/* { dg-lto-do link } */
+
+typedef void (*fnt) (void);
+void __attribute__((noinline)) bar (void) {}
+extern inline void check3 (void)
+{
+ bar ();
+}
+void test (void)
+{
+ const fnt pcheck3 = check3;
+ pcheck3 ();
+}
+int main() { return 0; }
diff --git a/gcc/testsuite/gcc.dg/lto/20091006-1_1.c b/gcc/testsuite/gcc.dg/lto/20091006-1_1.c
new file mode 100644
index 00000000000..f82f827002a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091006-1_1.c
@@ -0,0 +1,2 @@
+extern void bar (void);
+void check3 (void) { bar (); }
diff --git a/gcc/testsuite/gcc.dg/lto/20091006-2_0.c b/gcc/testsuite/gcc.dg/lto/20091006-2_0.c
new file mode 100644
index 00000000000..f8189920cfd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091006-2_0.c
@@ -0,0 +1,4 @@
+/* { dg-lto-do link } */
+
+extern int a[10];
+int main() { return 0; }
diff --git a/gcc/testsuite/gcc.dg/lto/20091006-2_1.c b/gcc/testsuite/gcc.dg/lto/20091006-2_1.c
new file mode 100644
index 00000000000..581839344c1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091006-2_1.c
@@ -0,0 +1 @@
+int a[16];
diff --git a/gcc/testsuite/gcc.dg/lto/20091006-2_2.c b/gcc/testsuite/gcc.dg/lto/20091006-2_2.c
new file mode 100644
index 00000000000..a610b2b1292
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091006-2_2.c
@@ -0,0 +1 @@
+extern int a[14];
diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_0.c b/gcc/testsuite/gcc.dg/lto/20091013-1_0.c
new file mode 100644
index 00000000000..0fecce04f09
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091013-1_0.c
@@ -0,0 +1,21 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fPIC -r -nostdlib -flto} {-fPIC -r -nostdlib -O2 -flto}} } */
+
+void * HeapAlloc(void*,unsigned int,unsigned long);
+
+typedef struct tagGdiFont GdiFont;
+
+typedef struct tagDC {
+ int xunused;
+ GdiFont *gdiFont;
+ unsigned int font_code_page;
+} DC;
+
+DC *alloc_dc_ptr( void *funcs, unsigned short magic )
+{
+ DC *dc;
+ if (!(dc = HeapAlloc( 0, 0, sizeof(*dc) ))) return ((void *)0);
+ dc->gdiFont = 0;
+ return dc;
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_1.c b/gcc/testsuite/gcc.dg/lto/20091013-1_1.c
new file mode 100644
index 00000000000..68294fa62cb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091013-1_1.c
@@ -0,0 +1,111 @@
+typedef struct HDC__ { int unused; } *HDC;
+typedef struct HFONT__ { int unused; } *HFONT;
+
+typedef struct
+{
+ unsigned int ciACP;
+} CHARSETINFO, *PCHARSETINFO, *LPCHARSETINFO;
+
+typedef struct tagTEXTMETRICW
+{
+ int tmCharSet;
+} TEXTMETRICW, *LPTEXTMETRICW, *PTEXTMETRICW;
+
+struct gdi_obj_funcs
+{
+ void* (*pSelectObject)( void* handle, void* hdc );
+};
+
+typedef struct tagGdiFont GdiFont;
+
+typedef struct tagDC
+{
+ int xunused;
+ GdiFont *gdiFont;
+ unsigned int font_code_page;
+} DC;
+
+extern GdiFont* WineEngCreateFontInstance(DC*, HFONT);
+extern unsigned int WineEngGetTextCharsetInfo(GdiFont *font, void* fs, unsigned int flags);
+extern int WineEngGetTextMetrics(GdiFont*, LPTEXTMETRICW);
+extern void* alloc_gdi_handle( void *obj, unsigned short type, const struct gdi_obj_funcs *funcs );
+
+enum __wine_debug_class
+{
+ __WINE_DBCL_FIXME,
+ __WINE_DBCL_ERR,
+ __WINE_DBCL_WARN,
+ __WINE_DBCL_TRACE,
+
+ __WINE_DBCL_INIT = 7
+};
+
+struct __wine_debug_channel
+{
+ unsigned char flags;
+ char name[15];
+};
+
+extern int wine_dbg_log( enum __wine_debug_class cls, struct __wine_debug_channel *ch, const char *func,
+ const char *format, ... ) __attribute__((format (printf,4,5)));
+
+static struct __wine_debug_channel __wine_dbch_font = { ~0, "font" };
+static struct __wine_debug_channel * const __wine_dbch___default = &__wine_dbch_font;
+
+static void* FONT_SelectObject( void* handle, void* hdc );
+
+static const struct gdi_obj_funcs font_funcs =
+{
+ FONT_SelectObject,
+};
+
+HFONT CreateFontIndirectW( const void *plf )
+{
+ return alloc_gdi_handle( 0, 6, &font_funcs );
+}
+
+static void update_font_code_page( DC *dc )
+{
+ CHARSETINFO csi;
+ int charset = (unsigned char)1;
+
+ if (dc->gdiFont)
+ charset = WineEngGetTextCharsetInfo( dc->gdiFont, ((void *)0), 0 );
+
+ if (TranslateCharsetInfo( ((void *)(unsigned long)((unsigned long)charset)), &csi, 1) )
+ dc->font_code_page = csi.ciACP;
+ else {
+ switch(charset) {
+ case (unsigned char)1:
+ dc->font_code_page = GetACP();
+ break;
+
+ case (unsigned char)246:
+ dc->font_code_page = 0;
+ break;
+
+ default:
+ do { if((((__wine_dbch___default))->flags & (1 << __WINE_DBCL_FIXME))) { struct __wine_debug_channel * const __dbch = (__wine_dbch___default); const enum __wine_debug_class __dbcl = __WINE_DBCL_FIXME; wine_dbg_log( __dbcl, __dbch, __FUNCTION__, "Can't find codepage for charset %d\n", charset); } } while(0);
+ dc->font_code_page = 0;
+ break;
+ }
+ }
+
+ do { if((((__wine_dbch___default))->flags & (1 << __WINE_DBCL_TRACE))) { struct __wine_debug_channel * const __dbch = (__wine_dbch___default); const enum __wine_debug_class __dbcl = __WINE_DBCL_TRACE; wine_dbg_log( __dbcl, __dbch, __FUNCTION__, "charset %d => cp %d\n", charset, dc->font_code_page); } } while(0);
+}
+
+static void* FONT_SelectObject( void* handle, void* hdc )
+{
+ DC *dc;
+
+ dc->gdiFont = WineEngCreateFontInstance( dc, handle );
+ update_font_code_page( dc );
+ return 0;
+}
+
+int GetTextMetricsW( HDC hdc, TEXTMETRICW *metrics )
+{
+ DC * dc;
+ return WineEngGetTextMetrics(dc->gdiFont, metrics);
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_2.c b/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
new file mode 100644
index 00000000000..55f8ca1b46d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
@@ -0,0 +1,220 @@
+typedef struct HDC__ { int unused; } *HDC;
+typedef struct HFONT__ { int unused; } *HFONT;
+
+void* HeapAlloc(void*,unsigned int,unsigned long);
+
+typedef struct tagLOGFONTW
+{
+ int lfPitchAndFamily;
+ unsigned short lfFaceName[32];
+} LOGFONTW, *PLOGFONTW, *LPLOGFONTW;
+
+typedef struct tagGdiFont GdiFont;
+typedef struct tagDC DC;
+
+extern unsigned int WineEngGetFontData(GdiFont*, unsigned int, unsigned int, void*, unsigned int);
+
+struct list
+{
+ struct list *next;
+ struct list *prev;
+};
+
+typedef struct FT_FaceRec_
+{
+ signed long face_flags;
+} FT_FaceRec, *FT_Face;
+
+typedef struct { } GM;
+
+typedef struct { } FMAT2;
+
+typedef struct {
+ unsigned int hash;
+ LOGFONTW lf;
+ int can_use_bitmap;
+} FONT_DESC;
+
+
+
+typedef struct tagHFONTLIST {
+ struct list entry;
+ HFONT hfont;
+} HFONTLIST;
+
+typedef struct {
+ struct list entry;
+ void *face;
+ GdiFont *font;
+} CHILD_FONT;
+
+
+struct tagGdiFont {
+ struct list entry;
+ GM **gm;
+ struct list hfontlist;
+ struct list child_fonts;
+
+ FT_Face ft_face;
+ FONT_DESC font_desc;
+ long ppem;
+};
+
+
+
+static struct list gdi_font_list = { &(gdi_font_list), &(gdi_font_list) };
+
+
+
+
+static int get_glyph_index_linked(GdiFont *font, unsigned int c, GdiFont **linked_font, unsigned int *glyph);
+static long load_VDMX(GdiFont*, long);
+
+extern int f1(void*,int);
+
+static FT_Face OpenFontFace(GdiFont *font, void *face, long width, long height)
+{
+ FT_Face ft_face;
+
+ font->ppem = load_VDMX(font, height);
+ if(font->ppem == 0)
+ font->ppem = f1(ft_face, height);
+ return ft_face;
+}
+
+
+static GdiFont *alloc_font(void)
+{
+ GdiFont *ret = HeapAlloc(0, 0x00000008, sizeof(*ret));
+ ret->gm = HeapAlloc(0, 0x00000008, sizeof(GM*));
+ return ret;
+}
+
+
+static long load_VDMX(GdiFont *font,long height)
+{
+ unsigned short hdr[3];
+
+ WineEngGetFontData(font, 0x42424242, 0, hdr, 6);
+ return 0;
+}
+
+static int fontcmp(const GdiFont *font, FONT_DESC *fd)
+{
+ if(font->font_desc.hash != fd->hash) return 1;
+ if(memcmp(&font->font_desc.lf, &fd->lf, __builtin_offsetof (LOGFONTW, lfFaceName))) return 1;
+ if(!font->font_desc.can_use_bitmap != !fd->can_use_bitmap) return 1;
+ return strcmpiW(font->font_desc.lf.lfFaceName, fd->lf.lfFaceName);
+}
+
+static GdiFont *find_in_cache(HFONT hfont, const LOGFONTW *plf, const FMAT2 *pmat, int can_use_bitmap)
+{
+ GdiFont *ret;
+ FONT_DESC fd;
+ HFONTLIST *hflist;
+ struct list *font_elem_ptr, *hfontlist_elem_ptr;
+
+ fd.lf = *plf;
+ fd.can_use_bitmap = can_use_bitmap;
+
+
+ for ((font_elem_ptr) = (&gdi_font_list)->next; (font_elem_ptr) != (&gdi_font_list); (font_elem_ptr) = (font_elem_ptr)->next) {
+ ret = ((struct tagGdiFont *)((char *)(font_elem_ptr) - (unsigned long)(&((struct tagGdiFont *)0)->entry)));
+ if(!fontcmp(ret, &fd)) {
+ if(!can_use_bitmap && !( ret->ft_face->face_flags & ( 1L << 0 ) )) continue;
+ for ((hfontlist_elem_ptr) = (&ret->hfontlist)->next; (hfontlist_elem_ptr) != (&ret->hfontlist); (hfontlist_elem_ptr) = (hfontlist_elem_ptr)->next) {
+ hflist = ((struct tagHFONTLIST *)((char *)(hfontlist_elem_ptr) - (unsigned long)(&((struct tagHFONTLIST *)0)->entry)));
+ if(hflist->hfont == hfont)
+ return ret;
+ }
+ hflist = HeapAlloc(0, 0, sizeof(*hflist));
+ hflist->hfont = hfont;
+ return ret;
+ }
+ }
+
+ while(font_elem_ptr) {
+ ret = ((struct tagGdiFont *)((char *)(font_elem_ptr) - (unsigned long)(&((struct tagGdiFont *)0)->entry)));
+ if(!fontcmp(ret, &fd)) {
+ if(!can_use_bitmap && !( ret->ft_face->face_flags & ( 1L << 0 ) )) continue;
+ hflist = HeapAlloc(0, 0, sizeof(*hflist));
+ hflist->hfont = hfont;
+ return ret;
+ }
+ }
+ return ((void *)0);
+}
+
+
+
+
+GdiFont *WineEngCreateFontInstance(DC *dc, HFONT hfont)
+{
+ GdiFont *ret;
+ int can_use_bitmap;
+ LOGFONTW lf;
+ FMAT2 dcmat;
+
+ if((ret = find_in_cache(hfont, &lf, &dcmat, can_use_bitmap)) != ((void *)0))
+ return ret;
+ return alloc_font();
+}
+
+extern unsigned int f(void*,unsigned int g);
+
+static unsigned int get_glyph_index(void*font, unsigned int glyph)
+{
+ return f(font, glyph);
+}
+
+unsigned int WineEngGetGlyphOutline(GdiFont *incoming_font, unsigned int glyph, unsigned int format,
+ void* lpgm, unsigned int buflen, void* buf,
+ const void* lpmat)
+{
+ unsigned int glyph_index;
+
+ get_glyph_index_linked(incoming_font, glyph, &incoming_font, &glyph_index);
+ return 0;
+}
+
+static int load_child_font(GdiFont *font, CHILD_FONT *child)
+{
+ child->font = alloc_font();
+ child->font->ft_face = OpenFontFace(child->font, child->face, 0, -font->ppem);
+ if(!child->font->ft_face)
+ return 0;
+ return 1;
+}
+
+static int get_glyph_index_linked(GdiFont *font, unsigned int c, GdiFont **linked_font, unsigned int *glyph)
+{
+ unsigned int g;
+ CHILD_FONT *child_font;
+
+ for ((child_font) = ((CHILD_FONT *)((char *)((&font->child_fonts)->next) - (unsigned long)(&((CHILD_FONT *)0)->entry))); &(child_font)->entry != (&font->child_fonts); (child_font) = ((CHILD_FONT *)((char *)((child_font)->entry.next) - (unsigned long)(&((CHILD_FONT *)0)->entry))))
+ {
+ if(!load_child_font(font, child_font))
+ continue;
+
+ g = get_glyph_index(child_font->font, c);
+ if(g) {
+ *glyph = g;
+ *linked_font = child_font->font;
+ return 1;
+ }
+ }
+ return 0;
+}
+
+unsigned int WineEngGetFontData(GdiFont *font, unsigned int table, unsigned int offset, void* buf,
+ unsigned int cbData)
+{
+ unsigned long len;
+ load_sfnt_table(font->ft_face, table, offset, buf, &len);
+ return len;
+}
+
+int WineEngGetLinkedHFont(DC *dc, unsigned short c, HFONT *new_hfont, unsigned int *glyph) {
+ return get_glyph_index_linked(0, 0, 0, 0);
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091014-1_0.c b/gcc/testsuite/gcc.dg/lto/20091014-1_0.c
new file mode 100644
index 00000000000..975214e0430
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091014-1_0.c
@@ -0,0 +1,4 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fPIC -r -nostdlib -flto}} } */
+
+/* Empty file. See PR41173. */
diff --git a/gcc/testsuite/gcc.dg/lto/20091015-1_0.c b/gcc/testsuite/gcc.dg/lto/20091015-1_0.c
new file mode 100644
index 00000000000..d55ebcf4042
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091015-1_0.c
@@ -0,0 +1,5 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fPIC -r -nostdlib -O2 -flto} {-fPIC -r -nostdlib -O2 -fwhopr}} } */
+
+#include "20091015-1_b.h"
+void diagnostic_initialize (FILE **stream) { *stream = stderr; }
diff --git a/gcc/testsuite/gcc.dg/lto/20091015-1_1.c b/gcc/testsuite/gcc.dg/lto/20091015-1_1.c
new file mode 100644
index 00000000000..c000518f45d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091015-1_1.c
@@ -0,0 +1,4 @@
+#include "20091015-1_a.h"
+#include "20091015-1_b.h"
+void ggc_print_common_statistics (FILE *stream) {
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20091015-1_2.c b/gcc/testsuite/gcc.dg/lto/20091015-1_2.c
new file mode 100644
index 00000000000..fd10680866a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091015-1_2.c
@@ -0,0 +1,5 @@
+#include "20091015-1_a.h"
+#include "20091015-1_b.h"
+void debug_optab_libfuncs (void) {
+foo (stderr, 4 );
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20091015-1_a.h b/gcc/testsuite/gcc.dg/lto/20091015-1_a.h
new file mode 100644
index 00000000000..61e56c9a95f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091015-1_a.h
@@ -0,0 +1,2 @@
+struct _IO_FILE { int _flags;
+};
diff --git a/gcc/testsuite/gcc.dg/lto/20091015-1_b.h b/gcc/testsuite/gcc.dg/lto/20091015-1_b.h
new file mode 100644
index 00000000000..88139027467
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091015-1_b.h
@@ -0,0 +1,2 @@
+typedef struct _IO_FILE FILE;
+extern struct _IO_FILE *stderr;
diff --git a/gcc/testsuite/gcc.dg/lto/20091016-1_0.c b/gcc/testsuite/gcc.dg/lto/20091016-1_0.c
new file mode 100644
index 00000000000..39a04b950bf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091016-1_0.c
@@ -0,0 +1,13 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fPIC -r -nostdlib -O2 -flto}} } */
+
+typedef struct VEC_constructor_elt_gc { } VEC_constructor_elt_gc;
+#include "20091016-1_a.h"
+struct stmt_tree_s {
+ tree x_cur_stmt_list;
+};
+void *add_stmt (struct stmt_tree_s *x)
+{
+ return &x->x_cur_stmt_list;
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091016-1_1.c b/gcc/testsuite/gcc.dg/lto/20091016-1_1.c
new file mode 100644
index 00000000000..06389b8e309
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091016-1_1.c
@@ -0,0 +1,18 @@
+typedef struct VEC_constructor_elt_gcx { } VEC_constructor_elt_gc;
+#include "20091016-1_a.h"
+struct gcc_target {
+ void (* builtin_vec_perm) (tree*);
+};
+extern struct gcc_target targetm;
+void dwarf2out_begin_prologue (tree t)
+{
+ (*targetm.builtin_vec_perm) (&t);
+}
+struct die_arg_entry_struct {
+ tree arg;
+};
+void *gt_pch_p_20VEC_die_arg_entry_gc (struct die_arg_entry_struct *vec)
+{
+ return &(vec->arg);
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091016-1_a.h b/gcc/testsuite/gcc.dg/lto/20091016-1_a.h
new file mode 100644
index 00000000000..8eefed5cfad
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091016-1_a.h
@@ -0,0 +1,6 @@
+typedef union tree_node *tree;
+union tree_node {
+ tree * use;
+ VEC_constructor_elt_gc *elts;
+};
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091017-1_0.c b/gcc/testsuite/gcc.dg/lto/20091017-1_0.c
new file mode 100644
index 00000000000..ec4c62e4d7c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091017-1_0.c
@@ -0,0 +1,15 @@
+/* { dg-lto-do run } */
+
+struct X {
+ int i;
+};
+extern void foo (void *);
+extern void abort (void);
+int main ()
+{
+ struct X *p;
+ foo(&p);
+ if (p != (struct X *)0)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20091017-1_1.c b/gcc/testsuite/gcc.dg/lto/20091017-1_1.c
new file mode 100644
index 00000000000..23e5992bde6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091017-1_1.c
@@ -0,0 +1,6 @@
+struct X;
+void foo (void *q)
+{
+ struct X **p = (struct X **)q;
+ *p = (struct X *)0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20091020-1_0.c b/gcc/testsuite/gcc.dg/lto/20091020-1_0.c
new file mode 100644
index 00000000000..c9bcb565d96
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091020-1_0.c
@@ -0,0 +1,8 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fPIC -r -nostdlib -flto}} } */
+
+typedef struct {
+ int NumPackStreams;
+} CSzAr;
+void cli_7unz (CSzAr db) { }
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091020-1_1.c b/gcc/testsuite/gcc.dg/lto/20091020-1_1.c
new file mode 100644
index 00000000000..899183a2459
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091020-1_1.c
@@ -0,0 +1,15 @@
+typedef struct {
+ int NumPackStreams;
+} CSzAr;
+typedef struct {
+ CSzAr db;
+} CSzArEx;
+int SzArEx_Init(CSzArEx *p)
+{
+ return p->db.NumPackStreams;
+}
+int SzArEx_GetFolderFullPackSize(const CSzArEx *p)
+{
+ return p->db.NumPackStreams;
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091020-2_0.c b/gcc/testsuite/gcc.dg/lto/20091020-2_0.c
new file mode 100644
index 00000000000..fb1a82bb8c6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091020-2_0.c
@@ -0,0 +1,18 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fPIC -r -nostdlib -flto}} } */
+
+typedef struct {
+ int NumPackStreams;
+} CSzAr;
+typedef struct {
+ CSzAr db;
+} CSzArEx;
+int SzArEx_Init(CSzArEx *p)
+{
+ return p->db.NumPackStreams;
+}
+int SzArEx_GetFolderFullPackSize(const CSzArEx *p)
+{
+ return p->db.NumPackStreams;
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091020-2_1.c b/gcc/testsuite/gcc.dg/lto/20091020-2_1.c
new file mode 100644
index 00000000000..9174f26c35c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091020-2_1.c
@@ -0,0 +1,5 @@
+typedef struct {
+ int NumPackStreams;
+} CSzAr;
+void cli_7unz (CSzAr db) { }
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091020-3_0.c b/gcc/testsuite/gcc.dg/lto/20091020-3_0.c
new file mode 100644
index 00000000000..441a7b91a7f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091020-3_0.c
@@ -0,0 +1,20 @@
+/* { dg-lto-do assemble } */
+
+typedef __SIZE_TYPE__ size_t;
+static int stack_dir;
+static void find_stack_direction ()
+{
+ static char *addr = ((void *)0);
+ auto char dummy;
+ if (addr == ((void *)0))
+ {
+ addr = &(dummy);
+ find_stack_direction ();
+ }
+}
+void * C_alloca (size_t size)
+{
+ if (stack_dir == 0)
+ find_stack_direction ();
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091027-1_0.c b/gcc/testsuite/gcc.dg/lto/20091027-1_0.c
new file mode 100644
index 00000000000..f2669fe0f00
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091027-1_0.c
@@ -0,0 +1,11 @@
+/* { dg-lto-do link } */
+/* { dg-extra-ld-options "-r -nostdlib" } */
+
+typedef struct _xmlDict xmlDict;
+struct _xmlDict {
+ int ref_counter;
+};
+void xmlDictCreate(void) {
+ xmlDict * dict;
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091027-1_1.c b/gcc/testsuite/gcc.dg/lto/20091027-1_1.c
new file mode 100644
index 00000000000..d92394cc591
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091027-1_1.c
@@ -0,0 +1,9 @@
+typedef struct _xmlDict xmlDict;
+struct _xmlDoc {
+ struct _xmlDict *dict;
+};
+void xmlAddEntity(struct _xmlDoc *a) {
+ xmlDict * dict = a->dict;
+ xmlHashCreateDict(0, dict);
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/README b/gcc/testsuite/gcc.dg/lto/README
new file mode 100644
index 00000000000..1a13dd92c62
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/README
@@ -0,0 +1,35 @@
+This directory contains tests for link-time optimization (LTO).
+Tests in this directory may span multiple files, so the naming of
+the files is significant.
+
+The name of every file must end with '_N' where N is an integer.
+All the files with the same name base and different _N suffixes
+will be compiled separately and linked together to form the final
+executable.
+
+By default, each set of files will be compiled with list of
+options listed in LTO_OPTIONS (../../lib/lto.exp), which can be
+overwritten in the shell environment or using the 'dg-lto-options'
+command in the main file of the set (i.e., the file with _0
+suffix).
+
+For example, given the files a_0.C a_1.C a_2.C, they will be
+compiled as:
+
+$ g++ -c <flags> a_0.C
+$ g++ -c <flags> a_1.C
+$ g++ -c <flags> a_2.C
+$ g++ -o <executable> a_0.o a_1.o a_2.o
+
+Tests that do not need more than one file are a special case
+where there is a single file named 'foo_0.C'.
+
+The only supported dg-lto-do option are 'assemble', 'run' and 'link'.
+Additionally, these can only be used in the main file. If
+'assemble' is used, only the individual object files are
+generated. If 'link' is used, the final executable is generated
+but not executed (in this case, function main() needs to exist
+but it does not need to do anything). If 'run' is used, the
+final executable is generated and the resulting binary executed.
+
+The default value for dg-lto-do is 'run'.
diff --git a/gcc/testsuite/gcc.dg/lto/lto.exp b/gcc/testsuite/gcc.dg/lto/lto.exp
new file mode 100644
index 00000000000..0e343c19b77
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/lto.exp
@@ -0,0 +1,57 @@
+# Copyright (C) 2009 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+#
+# Contributed by Diego Novillo <dnovillo@google.com>
+
+
+# Test link-time optimization across multiple files.
+#
+# Programs are broken into multiple files. Each one is compiled
+# separately with LTO information. The final executable is generated
+# by collecting all the generated object files using regular LTO or WHOPR.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+# Load procedures from common libraries.
+load_lib standard.exp
+load_lib gcc.exp
+
+# Load the language-independent compabibility support procedures.
+load_lib lto.exp
+
+gcc_init
+lto_init
+
+# Define an identifier for use with this suite to avoid name conflicts
+# with other lto tests running at the same time.
+set sid "c_lto"
+
+# If LTO has not been enabled, bail.
+if { ![check_effective_target_lto] } {
+ return
+}
+
+# Main loop.
+foreach src [lsort [find $srcdir/$subdir *_0.c]] {
+ # If we're only testing specific files and this isn't one of them, skip it.
+ if ![runtest_file_p $runtests $src] then {
+ continue
+ }
+
+ lto-execute $src $sid
+}
diff --git a/gcc/testsuite/gcc.dg/noncompile/pr40033-1.c b/gcc/testsuite/gcc.dg/noncompile/pr40033-1.c
new file mode 100644
index 00000000000..4f074420783
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/noncompile/pr40033-1.c
@@ -0,0 +1,7 @@
+/* ICE from error_mark_node being wrapped in a C_MAYBE_CONST_EXPR. PR
+ 40033. */
+
+void foo()
+{
+ ({ 0,; }); /* { dg-error "expected" } */
+}
diff --git a/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c b/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c
index 0c607bdc559..4a6a8a61969 100644
--- a/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c
+++ b/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c
@@ -31,7 +31,7 @@ struct gimple_opt_pass one_pass =
{
{
GIMPLE_PASS,
- "useless", /* name */
+ "cfg", /* name */
one_pass_gate, /* gate */
one_pass_exec, /* execute */
NULL, /* sub */
@@ -50,10 +50,10 @@ struct gimple_opt_pass one_pass =
int plugin_init (struct plugin_name_args *plugin_info,
struct plugin_gcc_version *version)
{
- struct plugin_pass p;
+ struct register_pass_info p;
p.pass = &one_pass.pass;
- p.reference_pass_name = "useless";
+ p.reference_pass_name = "cfg";
p.ref_pass_instance_number = 1;
p.pos_op = PASS_POS_INSERT_AFTER;
diff --git a/gcc/testsuite/gcc.dg/plugin/selfassign.c b/gcc/testsuite/gcc.dg/plugin/selfassign.c
index 13f6be9c2c1..f804222826d 100644
--- a/gcc/testsuite/gcc.dg/plugin/selfassign.c
+++ b/gcc/testsuite/gcc.dg/plugin/selfassign.c
@@ -299,7 +299,7 @@ int
plugin_init (struct plugin_name_args *plugin_info,
struct plugin_gcc_version *version)
{
- struct plugin_pass pass_info;
+ struct register_pass_info pass_info;
const char *plugin_name = plugin_info->base_name;
int argc = plugin_info->argc;
struct plugin_argument *argv = plugin_info->argv;
diff --git a/gcc/testsuite/gcc.dg/pr41340.c b/gcc/testsuite/gcc.dg/pr41340.c
new file mode 100644
index 00000000000..bafa61f5185
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41340.c
@@ -0,0 +1,68 @@
+/* PR debug/41340 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -g -fcompare-debug" } */
+/* { dg-options "-O3 -g -fcompare-debug -march=i686" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+typedef struct { int t; } *T;
+struct S1 { unsigned s1; };
+struct S2 { struct S1 s2; };
+struct S3 { unsigned s3; struct S2 **s4; };
+struct S5 { struct S2 *s5; };
+
+extern void fn0 (void) __attribute__ ((__noreturn__));
+T fn6 (struct S3);
+void fn7 (void);
+
+static inline __attribute__((always_inline)) int
+fn1 (const struct S1 *x)
+{
+ return x->s1;
+}
+
+static inline __attribute__((always_inline)) int
+fn2 (const struct S1 *x, unsigned y)
+{
+ if (y >= x->s1)
+ fn0 ();
+ return 0;
+}
+
+static inline __attribute__((always_inline)) int
+fn3 (struct S3 x)
+{
+ return (x.s3 == fn1 (*x.s4 ? &(*x.s4)->s2 : 0));
+}
+
+static inline __attribute__((always_inline)) int
+fn4 (struct S3 x)
+{
+ return fn2 (&(*x.s4)->s2, x.s3);
+}
+
+int
+fn5 (struct S3 x, T *y)
+{
+ if (!fn3 (x))
+ {
+ *y = (T) (long) fn4 (x);
+ return 1;
+ }
+ return 0;
+}
+
+void
+test (struct S5 *x)
+{
+ struct S3 a;
+ T b;
+ unsigned char c = 0;
+ a.s4 = &x->s5;
+ while (fn5 (a, &b))
+ if (!(b->t & 8))
+ c = 1;
+ a.s4 = &x->s5;
+ while ((b = fn6 (a)))
+ ;
+ if (!c)
+ fn7 ();
+}
diff --git a/gcc/testsuite/gcc.dg/pr41345.c b/gcc/testsuite/gcc.dg/pr41345.c
new file mode 100644
index 00000000000..4b146c0c202
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41345.c
@@ -0,0 +1,14 @@
+/* PR bootstrap/41345 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g -fcompare-debug" } */
+
+void
+foo (int *x)
+{
+ int a;
+ for (a = 0; a < 2; a++)
+ if (x[a])
+ goto lab;
+ __builtin_unreachable ();
+lab:;
+}
diff --git a/gcc/testsuite/gcc.dg/pr41573.c b/gcc/testsuite/gcc.dg/pr41573.c
new file mode 100644
index 00000000000..52961db8f22
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41573.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+__inline __attribute__ ((__always_inline__)) char *
+strcpy (char *__dest, __const char *__src)
+{
+ return __builtin___strcpy_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
+}
+
+const char* get_attr(unsigned attr)
+{
+ static char tmp[256];
+
+ strcpy(tmp, "");
+ return tmp;
+}
diff --git a/gcc/testsuite/gcc.dg/pr41574.c b/gcc/testsuite/gcc.dg/pr41574.c
new file mode 100644
index 00000000000..f5ddcb2fcc8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41574.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=armv7-a -mfloat-abi=softfp -mfpu=neon -fno-unsafe-math-optimizations -fdump-rtl-combine" { target { arm*-*-* } } } */
+/* { dg-options "-O2 -fno-unsafe-math-optimizations -fdump-rtl-combine" { target { ! arm*-*-* } } } */
+
+
+static const double one=1.0;
+
+double
+f(double x)
+{
+ return x*(one+x);
+}
+
+/* { dg-final { scan-rtl-dump-not "\\(plus:DF \\(mult:DF" "combine" } } */
+/* { dg-final { cleanup-rtl-dump "combine*" } } */
diff --git a/gcc/testsuite/gcc.dg/pr41762.c b/gcc/testsuite/gcc.dg/pr41762.c
new file mode 100644
index 00000000000..88d8172f288
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41762.c
@@ -0,0 +1,31 @@
+/* PR target/41762 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftracer -fsched2-use-superblocks" } */
+/* { dg-options "-O2 -ftracer -fsched2-use-superblocks -fpic" { target fpic } } */
+
+extern __SIZE_TYPE__ strlen (const char *);
+extern int f1 (void *);
+extern char *f2 (void);
+extern void f3 (int, int);
+static char *a;
+char *b, *c, *d, *e;
+
+void
+foo (void)
+{
+ int f, g, h;
+ f = (a ? strlen (a) : strlen ("abcde"));
+ f += (b ? strlen (b) : 0);
+ f += (c ? strlen (c) : 0);
+ f += (d ? strlen (d) : 0);
+ f += (e ? strlen (e) : 0);
+ h = f1 (strlen);
+ g = strlen (a);
+ f3 (g, f);
+}
+
+void
+bar (void)
+{
+ a = f2 ();
+}
diff --git a/gcc/testsuite/gcc.dg/pr41783.c b/gcc/testsuite/gcc.dg/pr41783.c
new file mode 100644
index 00000000000..cae066be6f4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41783.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-pre" } */
+int db[100];
+int a_global_var, fact;
+int main()
+{
+ int i,j=0;
+ do
+ {
+ for (i=0; i<100; ++i)
+ db[i] = i;
+ fact = a_global_var * i;
+ }
+ while (j++ < 100);
+}
+/* We want to have exactly one load (not two) from a_global_var,
+ and we want that load to be into a PRE temporary. */
+/* { dg-final { scan-tree-dump-times "= a_global_var;" 1 "pre" } } */
+/* { dg-final { scan-tree-dump "pretmp\[^\\n\]* = a_global_var;" "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc/testsuite/gcc.dg/pr41837.c b/gcc/testsuite/gcc.dg/pr41837.c
new file mode 100644
index 00000000000..f96c3473540
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41837.c
@@ -0,0 +1,38 @@
+/* PR middle-end/41837 */
+/* { dg-do compile } */
+/* { dg-options "-fipa-struct-reorg -O -fwhole-program -fprofile-generate" } */
+
+typedef struct { int a, b; } T1;
+typedef struct S1 *T2;
+typedef struct S2 *T3;
+typedef struct S3 *T4;
+typedef struct S4 *T5;
+struct S4 { union { int c; } d; };
+struct S2 { int e; T2 f; int g; };
+typedef struct { T3 h; } T6;
+typedef struct { int i; } *T7;
+struct S3 { T6 j; T7 k; };
+
+void
+f1 (T4 x)
+{
+ if (!x->j.h->e)
+ f5 (x);
+}
+
+void
+f2 (void)
+{
+ f6 (f1);
+}
+
+void
+f3 (T5 x, T1 *y)
+{
+}
+
+void
+f4 (void)
+{
+ f7 (f3);
+}
diff --git a/gcc/testsuite/gcc.dg/pr41841.c b/gcc/testsuite/gcc.dg/pr41841.c
new file mode 100644
index 00000000000..595bc759207
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41841.c
@@ -0,0 +1,22 @@
+/* PR tree-optimization/41841 */
+/* { dg-do compile } */
+/* { dg-options "-O -fipa-struct-reorg -fwhole-program -fipa-cp" } */
+
+typedef struct S *T;
+typedef struct { } *U;
+extern int f1 (void);
+
+static void
+f3 (U x, int y)
+{
+ T a = (T) x;
+ y && f1 ();
+}
+
+static void
+f2 (T x)
+{
+ f3 ((U) x, 1);
+}
+
+void *volatile a __attribute__((used)) = f2;
diff --git a/gcc/testsuite/gcc.dg/pr41842.c b/gcc/testsuite/gcc.dg/pr41842.c
new file mode 100644
index 00000000000..fa7edd11ecc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41842.c
@@ -0,0 +1,8 @@
+/* PR c/41842 */
+/* { dg-do compile } */
+
+void
+f ()
+{
+ char x[g (h)]; /* { dg-error "undeclared|for each function" } */
+}
diff --git a/gcc/testsuite/gcc.dg/pr41935.c b/gcc/testsuite/gcc.dg/pr41935.c
new file mode 100644
index 00000000000..e6a1b28670a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41935.c
@@ -0,0 +1,25 @@
+/* PR middle-end/41935 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+struct A { int a; int b[10]; };
+
+int
+foo (struct A *p)
+{
+ return __builtin_offsetof (struct A, b[p->a]);
+}
+
+int
+main ()
+{
+ struct A a;
+ a.a = 7;
+ if (foo (&a) != 7 * sizeof (int) + __builtin_offsetof (struct A, b))
+ abort ();
+ a.a = 2;
+ if (foo (&a) != 2 * sizeof (int) + __builtin_offsetof (struct A, b))
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr41963.c b/gcc/testsuite/gcc.dg/pr41963.c
new file mode 100644
index 00000000000..f8bf4a1b81c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41963.c
@@ -0,0 +1,36 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -ffast-math" } */
+#include <math.h>
+
+extern float sqrtf(float);
+
+static __attribute__((noinline)) void f (float *dst, float *src)
+{
+ int i, j;
+ for (i = 0; i < 2; i++)
+ {
+ float len;
+ dst[0] = src[0];
+ dst[1] = src[1];
+ len = sqrtf (dst[0] * dst[0] + dst[1] * dst[1]);
+ if (len > 0.5f)
+ {
+ len = 1.0f / len;
+ dst[0] *= len;
+ dst[1] *= len;
+ }
+ }
+}
+
+extern void abort (void);
+
+int main()
+{
+ float dst[2], src[2];
+ src[0] = 2.0f;
+ src[1] = 5.0f;
+ f (dst, src);
+ if (fabsf (dst[0] * dst[0] + dst[1] * dst[1] - 1.0f) > 0.01f)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/raw-string-1.c b/gcc/testsuite/gcc.dg/raw-string-1.c
new file mode 100644
index 00000000000..b499e5cce69
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/raw-string-1.c
@@ -0,0 +1,101 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+#include <wchar.h>
+
+typedef __CHAR16_TYPE__ char16_t;
+typedef __CHAR32_TYPE__ char32_t;
+
+const char s0[] = R"[a\
+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
+c]";
+const char s1[] = "a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
+const char s2[] = R"*|*[a\
+b
+c]"
+c]*|"
+c]*|*";
+const char s3[] = "ab\nc]\"\nc]*|\"\nc";
+
+const char t0[] = u8R"[a\
+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
+c]";
+const char t1[] = u8"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
+const char t2[] = u8R"*|*[a\
+b
+c]"
+c]*|"
+c]*|*";
+const char t3[] = u8"ab\nc]\"\nc]*|\"\nc";
+
+const char16_t u0[] = uR"[a\
+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
+c]";
+const char16_t u1[] = u"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
+const char16_t u2[] = uR"*|*[a\
+b
+c]"
+c]*|"
+c]*|*";
+const char16_t u3[] = u"ab\nc]\"\nc]*|\"\nc";
+
+const char32_t U0[] = UR"[a\
+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
+c]";
+const char32_t U1[] = U"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
+const char32_t U2[] = UR"*|*[a\
+b
+c]"
+c]*|"
+c]*|*";
+const char32_t U3[] = U"ab\nc]\"\nc]*|\"\nc";
+
+const wchar_t L0[] = LR"[a\
+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
+c]";
+const wchar_t L1[] = L"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
+const wchar_t L2[] = LR"*|*[a\
+b
+c]"
+c]*|"
+c]*|*";
+const wchar_t L3[] = L"ab\nc]\"\nc]*|\"\nc";
+
+int
+main (void)
+{
+ if (sizeof (s0) != sizeof (s1)
+ || __builtin_memcmp (s0, s1, sizeof (s0)) != 0)
+ __builtin_abort ();
+ if (sizeof (s2) != sizeof (s3)
+ || __builtin_memcmp (s2, s3, sizeof (s2)) != 0)
+ __builtin_abort ();
+ if (sizeof (t0) != sizeof (t1)
+ || __builtin_memcmp (t0, t1, sizeof (t0)) != 0)
+ __builtin_abort ();
+ if (sizeof (t2) != sizeof (t3)
+ || __builtin_memcmp (t2, t3, sizeof (t2)) != 0)
+ __builtin_abort ();
+ if (sizeof (u0) != sizeof (u1)
+ || __builtin_memcmp (u0, u1, sizeof (u0)) != 0)
+ __builtin_abort ();
+ if (sizeof (u2) != sizeof (u3)
+ || __builtin_memcmp (u2, u3, sizeof (u2)) != 0)
+ __builtin_abort ();
+ if (sizeof (U0) != sizeof (U1)
+ || __builtin_memcmp (U0, U1, sizeof (U0)) != 0)
+ __builtin_abort ();
+ if (sizeof (U2) != sizeof (U3)
+ || __builtin_memcmp (U2, U3, sizeof (U2)) != 0)
+ __builtin_abort ();
+ if (sizeof (L0) != sizeof (L1)
+ || __builtin_memcmp (L0, L1, sizeof (L0)) != 0)
+ __builtin_abort ();
+ if (sizeof (L2) != sizeof (L3)
+ || __builtin_memcmp (L2, L3, sizeof (L2)) != 0)
+ __builtin_abort ();
+ if (sizeof (R"*[]*") != 1
+ || __builtin_memcmp (R"*[]*", "", 1) != 0)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/raw-string-2.c b/gcc/testsuite/gcc.dg/raw-string-2.c
new file mode 100644
index 00000000000..533abe2bc89
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/raw-string-2.c
@@ -0,0 +1,109 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+#include <wchar.h>
+
+typedef __CHAR16_TYPE__ char16_t;
+typedef __CHAR32_TYPE__ char32_t;
+
+#define R
+#define u
+#define uR
+#define U
+#define UR
+#define u8
+#define u8R
+#define L
+#define LR
+
+const char s00[] = R"[a]" "[b]";
+const char s01[] = "[a]" R"*[b]*";
+const char s02[] = R"[a]" R"[b]";
+const char s03[] = R"-[a]-" u8"[b]";
+const char s04[] = "[a]" u8R"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ";
+const char s05[] = R"[a]" u8R"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL";
+const char s06[] = u8R";([a];(" "[b]";
+const char s07[] = u8"[a]" R"[b]";
+const char s08[] = u8R"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-";
+const char s09[] = u8R"/^&|~!=,"'\[a]/^&|~!=,"'\" u8"[b]";
+const char s10[] = u8"[a]" u8R"0123456789abcdef[b]0123456789abcdef";
+const char s11[] = u8R"ghijklmnopqrstuv[a]ghijklmnopqrstuv" u8R"w[b]w";
+
+const char16_t u03[] = R"-[a]-" u"[b]";
+const char16_t u04[] = "[a]" uR"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ";
+const char16_t u05[] = R"[a]" uR"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL";
+const char16_t u06[] = uR";([a];(" "[b]";
+const char16_t u07[] = u"[a]" R"[b]";
+const char16_t u08[] = uR"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-";
+const char16_t u09[] = uR"/^&|~!=,"'\[a]/^&|~!=,"'\" u"[b]";
+const char16_t u10[] = u"[a]" uR"0123456789abcdef[b]0123456789abcdef";
+const char16_t u11[] = uR"ghijklmnopqrstuv[a]ghijklmnopqrstuv" uR"w[b]w";
+
+const char32_t U03[] = R"-[a]-" U"[b]";
+const char32_t U04[] = "[a]" UR"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ";
+const char32_t U05[] = R"[a]" UR"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL";
+const char32_t U06[] = UR";([a];(" "[b]";
+const char32_t U07[] = U"[a]" R"[b]";
+const char32_t U08[] = UR"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-";
+const char32_t U09[] = UR"/^&|~!=,"'\[a]/^&|~!=,"'\" U"[b]";
+const char32_t U10[] = U"[a]" UR"0123456789abcdef[b]0123456789abcdef";
+const char32_t U11[] = UR"ghijklmnopqrstuv[a]ghijklmnopqrstuv" UR"w[b]w";
+
+const wchar_t L03[] = R"-[a]-" L"[b]";
+const wchar_t L04[] = "[a]" LR"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ";
+const wchar_t L05[] = R"[a]" LR"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL";
+const wchar_t L06[] = LR";([a];(" "[b]";
+const wchar_t L07[] = L"[a]" R"[b]";
+const wchar_t L08[] = LR"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-";
+const wchar_t L09[] = LR"/^&|~!=,"'\[a]/^&|~!=,"'\" L"[b]";
+const wchar_t L10[] = L"[a]" LR"0123456789abcdef[b]0123456789abcdef";
+const wchar_t L11[] = LR"ghijklmnopqrstuv[a]ghijklmnopqrstuv" LR"w[b]w";
+
+int
+main (void)
+{
+#define TEST(str, val) \
+ if (sizeof (str) != sizeof (val) \
+ || __builtin_memcmp (str, val, sizeof (str)) != 0) \
+ __builtin_abort ()
+ TEST (s00, "a[b]");
+ TEST (s01, "[a]b");
+ TEST (s02, "ab");
+ TEST (s03, "a[b]");
+ TEST (s04, "[a]b");
+ TEST (s05, "ab");
+ TEST (s06, "a[b]");
+ TEST (s07, "[a]b");
+ TEST (s08, "ab");
+ TEST (s09, "a[b]");
+ TEST (s10, "[a]b");
+ TEST (s11, "ab");
+ TEST (u03, u"a[b]");
+ TEST (u04, u"[a]b");
+ TEST (u05, u"ab");
+ TEST (u06, u"a[b]");
+ TEST (u07, u"[a]b");
+ TEST (u08, u"ab");
+ TEST (u09, u"a[b]");
+ TEST (u10, u"[a]b");
+ TEST (u11, u"ab");
+ TEST (U03, U"a[b]");
+ TEST (U04, U"[a]b");
+ TEST (U05, U"ab");
+ TEST (U06, U"a[b]");
+ TEST (U07, U"[a]b");
+ TEST (U08, U"ab");
+ TEST (U09, U"a[b]");
+ TEST (U10, U"[a]b");
+ TEST (U11, U"ab");
+ TEST (L03, L"a[b]");
+ TEST (L04, L"[a]b");
+ TEST (L05, L"ab");
+ TEST (L06, L"a[b]");
+ TEST (L07, L"[a]b");
+ TEST (L08, L"ab");
+ TEST (L09, L"a[b]");
+ TEST (L10, L"[a]b");
+ TEST (L11, L"ab");
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/raw-string-3.c b/gcc/testsuite/gcc.dg/raw-string-3.c
new file mode 100644
index 00000000000..9226411d2e0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/raw-string-3.c
@@ -0,0 +1,53 @@
+/* If not gnu99, the {,u,u8,U,L}R prefix should be parsed as separate
+ token. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+const void *s0 = R"[a]"; /* { dg-error "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 6 } */
+const void *s1 = uR"[a]"; /* { dg-error "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 8 } */
+const void *s2 = UR"[a]"; /* { dg-error "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 10 } */
+const void *s3 = u8R"[a]"; /* { dg-error "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 12 } */
+const void *s4 = LR"[a]"; /* { dg-error "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 14 } */
+
+const int i0 = R'a'; /* { dg-error "expected ',' or ';'" } */
+const int i1 = uR'a'; /* { dg-error "expected ',' or ';'" } */
+const int i2 = UR'a'; /* { dg-error "expected ',' or ';'" } */
+const int i3 = u8R'a'; /* { dg-error "expected ',' or ';'" } */
+const int i4 = LR'a'; /* { dg-error "expected ',' or ';'" } */
+
+#define R "a"
+#define uR "b"
+#define UR "c"
+#define u8R "d"
+#define LR "e"
+
+const void *s5 = R"[a]";
+const void *s6 = uR"[a]";
+const void *s7 = UR"[a]";
+const void *s8 = u8R"[a]";
+const void *s9 = LR"[a]";
+
+#undef R
+#undef uR
+#undef UR
+#undef u8R
+#undef LR
+
+#define R 1 +
+#define uR 2 +
+#define UR 3 +
+#define u8R 4 +
+#define LR 5 +
+
+const int i5 = R'a';
+const int i6 = uR'a';
+const int i7 = UR'a';
+const int i8 = u8R'a';
+const int i9 = LR'a';
+
+int main () {}
diff --git a/gcc/testsuite/gcc.dg/raw-string-4.c b/gcc/testsuite/gcc.dg/raw-string-4.c
new file mode 100644
index 00000000000..24d56ed7464
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/raw-string-4.c
@@ -0,0 +1,28 @@
+/* R is not applicable for character literals. */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+const int i0 = R'a'; /* { dg-error "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 5 } */
+const int i1 = uR'a'; /* { dg-error "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 7 } */
+const int i2 = UR'a'; /* { dg-error "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 9 } */
+const int i3 = u8R'a'; /* { dg-error "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 11 } */
+const int i4 = LR'a'; /* { dg-error "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 13 } */
+
+#define R 1 +
+#define uR 2 +
+#define UR 3 +
+#define u8R 4 +
+#define LR 5 +
+
+const int i5 = R'a';
+const int i6 = uR'a';
+const int i7 = UR'a';
+const int i8 = u8R'a';
+const int i9 = LR'a';
+
+int main () {}
diff --git a/gcc/testsuite/gcc.dg/raw-string-5.c b/gcc/testsuite/gcc.dg/raw-string-5.c
new file mode 100644
index 00000000000..3dbf97ded90
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/raw-string-5.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+const void *s0 = R"0123456789abcdefg[]0123456789abcdefg";
+ /* { dg-error "raw string delimiter longer" "" { target *-*-* } 4 } */
+ /* { dg-error "stray" "" { target *-*-* } 4 } */
+const void *s1 = R" [] ";
+ /* { dg-error "invalid character" "" { target *-*-* } 7 } */
+ /* { dg-error "stray" "" { target *-*-* } 7 } */
+const void *s2 = R" [] ";
+ /* { dg-error "invalid character" "" { target *-*-* } 10 } */
+ /* { dg-error "stray" "" { target *-*-* } 10 } */
+const void *s3 = R"][]]";
+ /* { dg-error "invalid character" "" { target *-*-* } 13 } */
+ /* { dg-error "stray" "" { target *-*-* } 13 } */
+const void *s4 = R"@[]@";
+ /* { dg-error "invalid character" "" { target *-*-* } 16 } */
+ /* { dg-error "stray" "" { target *-*-* } 16 } */
+const void *s5 = R"$[]$";
+ /* { dg-error "invalid character" "" { target *-*-* } 19 } */
+ /* { dg-error "stray" "" { target *-*-* } 19 } */
+
+int main () {}
diff --git a/gcc/testsuite/gcc.dg/raw-string-6.c b/gcc/testsuite/gcc.dg/raw-string-6.c
new file mode 100644
index 00000000000..338087a25fd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/raw-string-6.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+const void *s0 = R"ouch[]ouCh"; /* { dg-error "expected expression at end of input" } */
+ /* { dg-error "unterminated raw string" "" { target *-*-* } 4 } */
diff --git a/gcc/testsuite/gcc.dg/raw-string-7.c b/gcc/testsuite/gcc.dg/raw-string-7.c
new file mode 100644
index 00000000000..5bb4bec2085
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/raw-string-7.c
@@ -0,0 +1,23 @@
+/* The trailing whitespace after \ and before newline extension
+ breaks full compliance for raw strings. */
+/* { dg-do run { xfail *-*-* } } */
+/* { dg-options "-std=gnu99" } */
+
+/* Note, there is a single space after \ on the following line. */
+const void *s0 = R"[\
+]";
+/* { dg-bogus "backslash and newline separated by space" "" { xfail *-*-* } 7 } */
+
+/* Note, there is a single tab after \ on the following line. */
+const void *s1 = R"[\
+]";
+/* { dg-bogus "backslash and newline separated by space" "" { xfail *-*-* } 12 } */
+
+int
+main (void)
+{
+ if (__builtin_strcmp (s0, "\\ \n") != 0
+ || __builtin_strcmp (s1, "\\\t\n") != 0)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/tls/pie-1.c b/gcc/testsuite/gcc.dg/tls/pie-1.c
new file mode 100644
index 00000000000..07eb5f1ad25
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tls/pie-1.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-fpie" } */
+/* { dg-require-effective-target tls } */
+
+__thread int a; int b; int main() { return a = b; }
diff --git a/gcc/testsuite/gcc.dg/torture/builtin-math-6.c b/gcc/testsuite/gcc.dg/torture/builtin-math-6.c
index 1bf367a5deb..097a8c25d37 100644
--- a/gcc/testsuite/gcc.dg/torture/builtin-math-6.c
+++ b/gcc/testsuite/gcc.dg/torture/builtin-math-6.c
@@ -6,7 +6,7 @@
Origin: Kaveh R. Ghazi, January 28, 2009. */
/* { dg-do link } */
-/* { dg-require-effective-target mpc_pow } */
+/* { dg-require-effective-target mpc_arc } */
/* All references to link_error should go away at compile-time. The
first number is the line number and the second is the value number
@@ -180,9 +180,48 @@ extern void link_error(int, int);
int main (void)
{
+ TESTIT_COMPLEX (1, cacos, 1, CONJ(0));
+ TESTIT_COMPLEX_R (1, cacos, -1, CONJ(3.141593F));
+ TESTIT_COMPLEX (1, cacos, CONJ(1), 0);
+ TESTIT_COMPLEX_R (1, cacos, CONJ(-1), 3.141593F);
+ TESTIT_COMPLEX_R_ALLNEG (cacos, 3.45678F + 2.34567FI,
+ 0.60971F - 2.11780FI, 2.531875F - 2.117800FI,
+ 0.60971F + 2.11780FI, 2.531875F + 2.117800FI);
+
+ TESTIT_COMPLEX_ALLNEG (casin, 0,
+ 0, -CONJ(0), CONJ(0), CONJ(-0.F));
+ TESTIT_COMPLEX_R_ALLNEG (casin, 3.45678F + 2.34567FI,
+ 0.96107F + 2.11780FI, -0.96107F + 2.11780FI,
+ 0.96107F - 2.11780FI, -0.96107F - 2.11780FI);
+
+ TESTIT_COMPLEX_ALLNEG (catan, 0,
+ 0, -CONJ(0), CONJ(0), CONJ(-0.F));
+ TESTIT_COMPLEX_R_ALLNEG (catan, 3.45678F + 2.34567FI,
+ 1.37188F + 0.12997FI, -1.37188F + 0.12997FI,
+ 1.37188F - 0.12997FI, -1.37188F - 0.12997FI);
+
+ TESTIT_COMPLEX (1, cacosh, 1, 0);
+ TESTIT_COMPLEX_R (1, cacosh, -1, 3.141593FI);
+ TESTIT_COMPLEX (1, cacosh, CONJ(1), CONJ(0));
+ TESTIT_COMPLEX_R (1, cacosh, CONJ(-1), CONJ(3.141593FI));
+ TESTIT_COMPLEX_R_ALLNEG (cacosh, 3.45678F + 2.34567FI,
+ 2.11780F + 0.60971FI, 2.11780F + 2.531875FI,
+ 2.11780F - 0.60971FI, 2.11780F - 2.531875FI);
+
+ TESTIT_COMPLEX_ALLNEG (casinh, 0,
+ 0, -CONJ(0), CONJ(0), CONJ(-0.F));
+ TESTIT_COMPLEX_R_ALLNEG (casinh, 3.45678F + 2.34567FI,
+ 2.12836F + 0.58310FI, -2.12836F + 0.58310FI,
+ 2.12836F - 0.58310FI, -2.12836F - 0.58310FI);
+
+ TESTIT_COMPLEX_ALLNEG (catanh, 0,
+ 0, -CONJ(0), CONJ(0), CONJ(-0.F));
+ TESTIT_COMPLEX_R_ALLNEG (catanh, 3.45678F + 2.34567FI,
+ 0.19693F + 1.43190FI, -0.19693F + 1.43190FI,
+ 0.19693F - 1.43190FI, -0.19693F - 1.43190FI);
+
TESTIT_COMPLEX_ALLNEG (csin, 0,
- 0, -0.F,
- CONJ(0), CONJ(-0.F));
+ 0, -0.F, CONJ(0), CONJ(-0.F));
TESTIT_COMPLEX_R_ALLNEG (csin, 3.45678F + 2.34567FI,
-1.633059F - 4.917448FI, 1.633059F - 4.917448FI,
-1.633059F + 4.917448FI, 1.633059F + 4.917448FI);
@@ -219,8 +258,8 @@ int main (void)
TESTIT_COMPLEX (1, clog, 1, 0);
TESTIT_COMPLEX_R (1, clog, -1, 3.141593FI);
- TESTIT_COMPLEX (1, clog, CONJ(1), CONJ(0)); /* Fails with mpc-0.6. */
- TESTIT_COMPLEX_R (1, clog, CONJ(-1), CONJ(3.141593FI)); /* Fails with mpc-0.6. */
+ TESTIT_COMPLEX (1, clog, CONJ(1), CONJ(0));
+ TESTIT_COMPLEX_R (1, clog, CONJ(-1), CONJ(3.141593FI));
TESTIT_COMPLEX_R_ALLNEG (clog, 3.45678F + 2.34567FI,
1.429713F + 0.596199FI, 1.429713F + 2.545394FI,
1.429713F - 0.596199FI, 1.429713F - 2.545394FI);
diff --git a/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c b/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c
index 10963973c3b..7df130a1f5b 100644
--- a/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c
+++ b/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c
@@ -4,31 +4,37 @@
struct X { char x; char y; };
-void bar (char *p);
+char *q;
-void test1 (char a, char b, char c, char d, char e, char f, char g, char h)
+static void __attribute__((noinline))
+bar (char *p)
{
- char *p = &a;
+ q = p;
+}
+
+void test1 (char a1, char b, char c, char d, char e, char f, char g, char h)
+{
+ char *p = &a1;
p++;
bar (p);
}
-void test2 (struct X a, char b, char c, char d, char e, char f, char g, char h)
+void test2 (struct X a2, char b, char c, char d, char e, char f, char g, char h)
{
- char *p = &a.x;
+ char *p = &a2.x;
p++;
bar (p);
}
-void test3 (struct X a, char b, char c, char d, char e, char f, char g, char h)
+void test3 (struct X a3, char b, char c, char d, char e, char f, char g, char h)
{
- char *p = &a.y;
+ char *p = &a3.y;
bar (p);
}
-void test4 (int a, char b, char c, char d, char e, char f, char g, char h)
+void test4 (int a4, char b, char c, char d, char e, char f, char g, char h)
{
- char *p = (char *)&a;
+ char *p = (char *)&a4;
p++;
p++;
p++;
@@ -36,5 +42,5 @@ void test4 (int a, char b, char c, char d, char e, char f, char g, char h)
bar (p);
}
-/* { dg-final { scan-ipa-dump "bar.arg0 = { test4.arg0 test3.arg0 test2.arg0 test1.arg0 }" "pta" } } */
+/* { dg-final { scan-ipa-dump "bar.arg0 = { a4 a3 a2 a1 }" "pta" } } */
/* { dg-final { cleanup-ipa-dump "pta" } } */
diff --git a/gcc/testsuite/gcc.dg/torture/pr23821.c b/gcc/testsuite/gcc.dg/torture/pr23821.c
new file mode 100644
index 00000000000..7d425831bb8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr23821.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
+/* At -O1 DOM threads a jump in a non-optimal way which leads to
+ the bogus propagation. */
+/* { dg-skip-if "" { *-*-* } { "-O1" } { "" } } */
+/* { dg-options "-fdump-tree-ivcanon-details" } */
+
+static int a[199];
+
+extern void abort (void);
+
+int
+main ()
+{
+ int i, x;
+ for (i = 0; i < 199; i++)
+ {
+ x = a[i];
+ if (x != i)
+ abort ();
+ }
+ return 0;
+}
+
+/* Verify that we do not propagate the equivalence x == i into the
+ induction variable increment. */
+
+/* { dg-final { scan-tree-dump "Added canonical iv" "ivcanon" } } */
+/* { dg-final { cleanup-tree-dump "ivcanon" } } */
diff --git a/gcc/testsuite/gcc.dg/torture/pr26515.c b/gcc/testsuite/gcc.dg/torture/pr26515.c
new file mode 100644
index 00000000000..a051e2e53c4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr26515.c
@@ -0,0 +1,27 @@
+/* { dg-options "-march=v10" { target cris*-*-* } } */
+struct i
+{
+ long long i_size;
+ struct a *i_mapping;
+};
+struct p
+{
+ struct a *mapping;
+ long index;
+};
+extern void b (struct p*, unsigned);
+extern void u (struct p*);
+void
+block_page_mkwrite (struct i *i, struct p *p)
+{
+ unsigned end = 0;
+ long long size = 0;
+ size = i->i_size;
+ if ((p->mapping != i->i_mapping))
+ goto out_unlock;
+ if (((p->index + 1) << 13) > size)
+ end = size & ~(~(((1UL) << 13) - 1));
+ b (p, end);
+out_unlock:
+ u (p);
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr38948.c b/gcc/testsuite/gcc.dg/torture/pr38948.c
new file mode 100644
index 00000000000..98ed493cbd7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr38948.c
@@ -0,0 +1,101 @@
+/* { dg-options "-fno-tree-sra" } */
+/* { dg-options "-fno-tree-sra -march=v32" { target cris-*-* } } */
+typedef unsigned char byte;
+typedef unsigned int uint;
+typedef int bool;
+typedef struct gs_const_string_s
+{
+ const byte *data;
+}
+gs_const_string;
+struct gs_matrix_s
+{
+ float xx, xy, yx, yy, tx, ty;
+};
+typedef struct gs_matrix_s gs_matrix;
+typedef long fixed;
+typedef struct gs_fixed_point_s
+{
+ fixed x, y;
+}
+gs_fixed_point;
+typedef struct gs_matrix_fixed_s
+{
+ int x;
+}
+gs_matrix_fixed;
+static int
+append_simple (const byte * glyph, const gs_matrix_fixed * pmat, void * ppath)
+{
+ int numContours =
+ (int) (((((uint) ((glyph)[0]) << 8) + (glyph)[1]) ^ 0x8000) - 0x8000);
+ const byte *pends = glyph + 10;
+ int code = 0;
+ {
+ uint i = 0;
+ uint np = 0;
+ gs_fixed_point pt = {0};
+ uint reps = 0;
+ for (i = 0, np = 0; i < numContours; ++i)
+ {
+ bool move = ((bool) 1);
+ uint last_point =
+ (((uint) ((pends + i * 2)[0]) << 8) + (pends + i * 2)[1]);
+ int off_curve = 0;
+ gs_fixed_point cpoints[3];
+ for (; np <= last_point; --reps, ++np)
+ {
+ if (move)
+ {
+ cpoints[0] = pt;
+ move = ((bool) 0);
+ }
+ else
+ {
+ switch (off_curve++)
+ {
+ default:
+ cpoints[2].x = ((cpoints[1].x + pt.x) / 2);
+ cpoints[2].y = ((cpoints[1].y + pt.y) / 2);
+ code =
+ gx_path_add_curve_notes (ppath,
+ ((cpoints[0].x +
+ 2 * cpoints[1].x) / 3),
+ ((cpoints[0].y +
+ 2 * cpoints[1].y) / 3),
+ ((2 * cpoints[1].x +
+ cpoints[2].x) / 3),
+ ((2 * cpoints[1].y +
+ cpoints[2].y) / 3),
+ cpoints[2].x, cpoints[2].y,
+ 0);
+ cpoints[0] = cpoints[2];
+ case 0:
+ cpoints[1] = pt;
+ }
+ }
+ }
+ }
+ }
+}
+int
+append_outline (uint glyph_index, const gs_matrix_fixed *pmat, void *ppath)
+{
+ gs_const_string glyph_string = {0};
+ int numContours = 0;
+ numContours =
+ (int) (((((uint) ((glyph_string.data)[0]) << 8) +
+ (glyph_string.data)[1]) ^ 0x8000) - 0x8000);
+ if (numContours >= 0)
+ return append_simple (glyph_string.data, pmat, ppath);
+ {
+ uint flags = 0;
+ do
+ {
+ gs_matrix_fixed mat = {0};
+ gs_matrix scale_mat = {0};
+ gs_matrix_multiply (&scale_mat, (const gs_matrix *) &mat, (gs_matrix *) & mat);
+ }
+ while (flags & 32);
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr41555.c b/gcc/testsuite/gcc.dg/torture/pr41555.c
new file mode 100644
index 00000000000..c201fda0cea
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr41555.c
@@ -0,0 +1,119 @@
+/* { dg-do run } */
+/* { dg-options "-std=c99" } */
+
+#include <stdint.h>
+#include <limits.h>
+
+extern void abort (void);
+
+static uint64_t safe_div_func_uint64_t_u_u (uint64_t _ui1, uint64_t _ui2)
+{
+ if (_ui2==0) return _ui1;
+ return _ui1 / _ui2;
+}
+
+static int64_t safe_div_func_int64_t_s_s (int64_t _si1, int64_t _si2)
+{
+ if (_si2==0 || (_si1==INT64_MIN && _si2==-1)) return _si1;
+ return _si1 / _si2;
+}
+
+#define safe_add_macro_int8_t_s_s(si1,si2) \
+ ((((((int8_t)(si1))>((int8_t)0)) && (((int8_t)(si2))>((int8_t)0)) && (((int8_t)(si1)) > ((INT8_MAX)-((int8_t)(si2))))) \
+ || ((((int8_t)(si1))<((int8_t)0)) && (((int8_t)(si2))<((int8_t)0)) && (((int8_t)(si1)) < ((INT8_MIN)-((int8_t)(si2)))))) \
+ ? ((int8_t)(si1)) \
+ : (((int8_t)(si1)) + ((int8_t)(si2))) \
+ )
+
+static int8_t
+safe_add_func_int8_t_s_s(int8_t _si1, int8_t _si2)
+{
+ return safe_add_macro_int8_t_s_s(_si1,_si2);
+}
+
+#define safe_rshift_macro_uint64_t_u_s(left,right) \
+ (((((int)(right)) < ((uint64_t)0)) \
+ || (((int)(right)) >= sizeof(uint64_t)*CHAR_BIT)) \
+ ? ((uint64_t)(left)) \
+ : (((uint64_t)(left)) >> ((int)(right))))
+
+static uint64_t
+safe_rshift_func_uint64_t_u_s(uint64_t _left, int _right)
+{
+ return safe_rshift_macro_uint64_t_u_s(_left,_right);
+}
+
+#define safe_mul_macro_int32_t_s_s(si1,si2) \
+ ((((((int32_t)(si1)) > ((int32_t)0)) && (((int32_t)(si2)) > ((int32_t)0)) && (((int32_t)(si1)) > ((INT32_MAX) / ((int32_t)(si2))))) || \
+ ((((int32_t)(si1)) > ((int32_t)0)) && (((int32_t)(si2)) <= ((int32_t)0)) && (((int32_t)(si2)) < ((INT32_MIN) / ((int32_t)(si1))))) || \
+ ((((int32_t)(si1)) <= ((int32_t)0)) && (((int32_t)(si2)) > ((int32_t)0)) && (((int32_t)(si1)) < ((INT32_MIN) / ((int32_t)(si2))))) || \
+ ((((int32_t)(si1)) <= ((int32_t)0)) && (((int32_t)(si2)) <= ((int32_t)0)) && (((int32_t)(si1)) != ((int32_t)0)) && (((int32_t)(si2)) < ((INT32_MAX) / ((int32_t)(si1)))))) \
+ ? ((int32_t)(si1)) \
+ : ((int32_t)(si1)) * ((int32_t)(si2)))
+
+static int32_t
+safe_mul_func_int32_t_s_s (int32_t _si1, int32_t _si2)
+{
+ return safe_mul_macro_int32_t_s_s(_si1,_si2);
+}
+
+static int8_t g_39;
+static volatile uint8_t g_46;
+static uint8_t g_47;
+static uint8_t *g_62;
+static uint8_t g_79;
+static int8_t g_101 = -1L;
+static uint8_t *g_114;
+static uint8_t *g_126;
+static uint8_t g_133;
+
+static uint16_t func_35 (int32_t * p_36, uint64_t p_37, uint32_t p_38);
+static uint16_t func_35 (int32_t * p_36, uint64_t p_37, uint32_t p_38)
+{
+ if (g_62 != 0)
+ abort ();
+ for (g_39 = 1; g_39 < 0; g_39 = 1)
+ {
+ }
+ return 1;
+}
+
+static int32_t func_19 (int32_t p_20);
+static int32_t func_19 (int32_t p_20)
+{
+ if (1 !=
+ safe_div_func_uint64_t_u_u ((safe_div_func_int64_t_s_s (p_20, 1)),
+ g_101))
+ {
+ func_35 (0, 1 <= (safe_add_func_int8_t_s_s (g_47, g_46)) > p_20 < 1, 1);
+ g_133 = 1;
+ if (g_114 != 0)
+ abort ();
+ if (g_126 != 0)
+ abort ();
+ }
+ return 1;
+}
+
+static uint8_t func_2 (int32_t p_6);
+static uint8_t func_2 (int32_t p_6)
+{
+ for (1; p_6 > 1; 1)
+ return 0;
+ func_19 (g_79);
+ if (safe_mul_func_int32_t_s_s
+ ((0, 1 < (safe_rshift_func_uint64_t_u_s (1 ^ p_6, 1))),
+ (func_35 (&p_6, 1, 1) < 1)))
+ {
+ }
+ return 1;
+}
+
+int main (void)
+{
+ func_2 (1);
+ if (g_133 != 1)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/foldstring-1.c b/gcc/testsuite/gcc.dg/tree-ssa/foldstring-1.c
index 25a7ef49f8a..fa64ae14cc4 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/foldstring-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/foldstring-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-useless" } */
+/* { dg-options "-O1 -fdump-tree-fre" } */
void
arf ()
@@ -7,5 +7,5 @@ arf ()
if (""[0] == 0)
blah ();
}
-/* { dg-final { scan-tree-dump-times "= 0;" 1 "useless"} } */
-/* { dg-final { cleanup-tree-dump "useless" } } */
+/* { dg-final { scan-tree-dump-times "= 0;" 1 "fre"} } */
+/* { dg-final { cleanup-tree-dump "fre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c b/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c
index 13e27c307a4..511cc9e2562 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c
@@ -1,6 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-einline2" } */
-/* { dg-options "-O2 -fdump-tree-einline2 -fpie" { target { ! nonpic } } } */
+/* { dg-add-options bind_pic_locally } */
+
extern void inlined ();
void inline_me_too (void);
void inline_through_me (void (*ptr)(void));
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c
index bd24446e162..b9c67a62609 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c
@@ -1,33 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-O3 -fdump-tree-optimized -fno-inline" } */
-int
-very_long_function(int a)
-{
- return very_long_function (a)/4;
-}
-main()
-{
- very_long_function (1);
-}
-/* One appereance for dump, one self recursive call and one call from main. */
-/* { dg-final { scan-tree-dump-times "very_long_function.clone.0 \\(\\)" 3 "optimized"} } */
-/* { dg-final { cleanup-tree-dump "optimized" } } */
-/* { dg-do compile } */
-/* { dg-options "-O3 -fdump-tree-optimized -fno-inline" } */
-int
-very_long_function(int a)
-{
- return very_long_function (a)/4;
-}
-main()
-{
- very_long_function (1);
-}
-/* One appereance for dump, one self recursive call and one call from main. */
-/* { dg-final { scan-tree-dump-times "very_long_function.clone.0 \\(\\)" 3 "optimized"} } */
-/* { dg-final { cleanup-tree-dump "optimized" } } */
-/* { dg-do compile } */
-/* { dg-options "-O3 -fdump-tree-optimized -fno-inline" } */
+/* { dg-add-options bind_pic_locally } */
+
int
very_long_function(int a)
{
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c b/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c
index 065d212cb5f..afb7ca4b0df 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c
@@ -1,6 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-local-pure-const1" } */
-/* { dg-options "-O1 -fdump-tree-local-pure-const1 -fpie" { target { ! nonpic } } } */
+/* { dg-add-options bind_pic_locally } */
+
t(int a, int b, int c)
{
int *p;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr41497.c b/gcc/testsuite/gcc.dg/tree-ssa/pr41497.c
new file mode 100644
index 00000000000..e66ee846491
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr41497.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+/* { dg-options "-Os" } */
+
+extern void abort (void);
+
+unsigned int a;
+int b, c;
+
+void
+foo (void)
+{
+ b = 0;
+ do {
+ for (a = -13; a == 0; a = (unsigned short)a)
+ c = 1;
+ b++;
+ } while (b == 0);
+}
+
+int
+main ()
+{
+ foo ();
+ if (a != -13)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-23.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-23.c
index 88c8bb71eb9..6aeb06af9ee 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-23.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-23.c
@@ -9,5 +9,5 @@ void foo(int n)
global.y += global.x*global.x;
}
-/* { dg-final { scan-tree-dump "Eliminated: 2" "pre" } } */
+/* { dg-final { scan-tree-dump "Eliminated: 3" "pre" } } */
/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-24.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-24.c
index 6729e2a297e..f91f4af74df 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-24.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-24.c
@@ -9,12 +9,7 @@ void foo(int *p, double *x, int n)
}
/* We should remove the unnecessary insertion of a phi-node and
- _not_ end up using the phi result for replacement *p.
- The issue here is that when PHI-translating the virtual operands
- we assign different value-numbers to the load. Re-running VN
- after insertion or trying to be clever and doing this on the
- fly during PHI translation would solve this. The next copyprop
- fixes this anyway. */
+ _not_ end up using the phi result for replacement *p. */
-/* { dg-final { scan-tree-dump-not "= prephitmp" "pre" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-not "= prephitmp" "pre" } } */
/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c
new file mode 100644
index 00000000000..978b7abab3a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -fdump-tree-pre-details" } */
+
+typedef union
+{
+ int* data;
+} SA;
+
+typedef struct
+{
+ int reserved;
+ char* array;
+}SB;
+
+typedef struct
+{
+ int status;
+}SC;
+
+void foo(SA* pResult, SB* method, SC* self)
+{
+ if (method->array[0] == 'L' && !self->status && pResult->data != 0)
+ pResult->data = pResult->data;
+}
+
+/* { dg-final { scan-tree-dump "Deleted redundant store" "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/useless-1.c b/gcc/testsuite/gcc.dg/tree-ssa/useless-1.c
index 9170b7ca4de..68eab70046c 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/useless-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/useless-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-useless" } */
+/* { dg-options "-O1 -fdump-tree-gimple" } */
void
foo (void)
@@ -13,5 +13,5 @@ foo (void)
in the loop exit condition, it would be re-introduced during
GIMPLE lowering, at the cost of an extra statement, label,
and basic block. */
-/* { dg-final { scan-tree-dump-times "goto" 3 "useless"} } */
-/* { dg-final { cleanup-tree-dump "useless" } } */
+/* { dg-final { scan-tree-dump-times "goto" 3 "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc/testsuite/gcc.dg/utf-badconcat2.c b/gcc/testsuite/gcc.dg/utf-badconcat2.c
new file mode 100644
index 00000000000..ea71a7f6857
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/utf-badconcat2.c
@@ -0,0 +1,15 @@
+/* Test unsupported concatenation of UTF-8 string literals. */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+void *s0 = u8"a" "b";
+void *s1 = "a" u8"b";
+void *s2 = u8"a" u8"b";
+void *s3 = u8"a" u"b"; /* { dg-error "non-standard concatenation" } */
+void *s4 = u"a" u8"b"; /* { dg-error "non-standard concatenation" } */
+void *s5 = u8"a" U"b"; /* { dg-error "non-standard concatenation" } */
+void *s6 = U"a" u8"b"; /* { dg-error "non-standard concatenation" } */
+void *s7 = u8"a" L"b"; /* { dg-error "non-standard concatenation" } */
+void *s8 = L"a" u8"b"; /* { dg-error "non-standard concatenation" } */
+
+int main () {}
diff --git a/gcc/testsuite/gcc.dg/utf-dflt2.c b/gcc/testsuite/gcc.dg/utf-dflt2.c
new file mode 100644
index 00000000000..ab101f45b78
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/utf-dflt2.c
@@ -0,0 +1,12 @@
+/* If not gnu99, the u8 prefix should be parsed as separate tokens. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+const void *s0 = u8"a"; /* { dg-error "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 5 } */
+
+#define u8 "a"
+
+const void *s1 = u8"a";
+
+int main () {}
diff --git a/gcc/testsuite/gcc.dg/utf8-1.c b/gcc/testsuite/gcc.dg/utf8-1.c
new file mode 100644
index 00000000000..e287e065688
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/utf8-1.c
@@ -0,0 +1,45 @@
+/* { dg-do run } */
+/* { dg-require-iconv "ISO-8859-2" } */
+/* { dg-options "-std=gnu99 -fexec-charset=ISO-8859-2" } */
+
+const char *str1 = "h\u00e1\U0000010Dky ";
+const char *str2 = "\u010d\u00E1rky\n";
+const char *str3 = u8"h\u00e1\U0000010Dky ";
+const char *str4 = u8"\u010d\u00E1rky\n";
+const char *str5 = "h\u00e1\U0000010Dky " "\u010d\u00E1rky\n";
+const char *str6 = u8"h\u00e1\U0000010Dky " "\u010d\u00E1rky\n";
+const char *str7 = "h\u00e1\U0000010Dky " u8"\u010d\u00E1rky\n";
+#define u8
+const char *str8 = u8"h\u00e1\U0000010Dky " u8"\u010d\u00E1rky\n";
+
+const char latin2_1[] = "\x68\xe1\xe8\x6b\x79\x20";
+const char latin2_2[] = "\xe8\xe1\x72\x6b\x79\n";
+const char utf8_1[] = "\x68\xc3\xa1\xc4\x8d\x6b\x79\x20";
+const char utf8_2[] = "\xc4\x8d\xc3\xa1\x72\x6b\x79\n";
+
+int
+main (void)
+{
+ if (__builtin_strcmp (str1, latin2_1) != 0
+ || __builtin_strcmp (str2, latin2_2) != 0
+ || __builtin_strcmp (str3, utf8_1) != 0
+ || __builtin_strcmp (str4, utf8_2) != 0
+ || __builtin_strncmp (str5, latin2_1, sizeof (latin2_1) - 1) != 0
+ || __builtin_strcmp (str5 + sizeof (latin2_1) - 1, latin2_2) != 0
+ || __builtin_strncmp (str6, utf8_1, sizeof (utf8_1) - 1) != 0
+ || __builtin_strcmp (str6 + sizeof (utf8_1) - 1, utf8_2) != 0
+ || __builtin_strncmp (str7, utf8_1, sizeof (utf8_1) - 1) != 0
+ || __builtin_strcmp (str7 + sizeof (utf8_1) - 1, utf8_2) != 0
+ || __builtin_strncmp (str8, utf8_1, sizeof (utf8_1) - 1) != 0
+ || __builtin_strcmp (str8 + sizeof (utf8_1) - 1, utf8_2) != 0)
+ __builtin_abort ();
+ if (sizeof ("a" u8"b"[0]) != 1
+ || sizeof (u8"a" "b"[0]) != 1
+ || sizeof (u8"a" u8"b"[0]) != 1
+ || sizeof ("a" "\u010d") != 3
+ || sizeof ("a" u8"\u010d") != 4
+ || sizeof (u8"a" "\u010d") != 4
+ || sizeof (u8"a" "\u010d") != 4)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/utf8-2.c b/gcc/testsuite/gcc.dg/utf8-2.c
new file mode 100644
index 00000000000..9c0442fde3f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/utf8-2.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+#include <wchar.h>
+
+typedef __CHAR16_TYPE__ char16_t;
+typedef __CHAR32_TYPE__ char32_t;
+
+const char s0[] = u8"ab";
+const char16_t s1[] = u8"ab"; /* { dg-error "from non-wide" } */
+const char32_t s2[] = u8"ab"; /* { dg-error "from non-wide" } */
+const wchar_t s3[] = u8"ab"; /* { dg-error "from non-wide" } */
+
+const char t0[0] = u8"ab"; /* { dg-warning "chars is too long" } */
+const char t1[1] = u8"ab"; /* { dg-warning "chars is too long" } */
+const char t2[2] = u8"ab";
+const char t3[3] = u8"ab";
+const char t4[4] = u8"ab";
+
+const char u0[0] = u8"\u2160."; /* { dg-warning "chars is too long" } */
+const char u1[1] = u8"\u2160."; /* { dg-warning "chars is too long" } */
+const char u2[2] = u8"\u2160."; /* { dg-warning "chars is too long" } */
+const char u3[3] = u8"\u2160."; /* { dg-warning "chars is too long" } */
+const char u4[4] = u8"\u2160.";
+const char u5[5] = u8"\u2160.";
+const char u6[6] = u8"\u2160.";
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c b/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c
index da7b7c3b3f8..b109be23250 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c
@@ -86,8 +86,6 @@ int main (void)
return main1 ();
}
-/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { xfail vect_hw_misalign } } }
- */
-/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" { target vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c b/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c
index 8a14ededc25..5676b247069 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c
@@ -36,5 +36,5 @@ int main (void)
return main1 ();
}
-/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c
index 4490cdc2182..b109be23250 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c
@@ -86,7 +86,6 @@ int main (void)
return main1 ();
}
-/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target {! vect_hw_misalign} } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" { target {vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c
index 8a14ededc25..5676b247069 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c
@@ -36,5 +36,5 @@ int main (void)
return main1 ();
}
-/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c
index 6060a418a3d..21b87a39677 100644
--- a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c
+++ b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c
@@ -87,7 +87,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c
index 2b6f99787c1..1ce3fa7f23b 100644
--- a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c
+++ b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c
@@ -83,7 +83,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c
index 78419fae851..49a9098f79f 100644
--- a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c
+++ b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c
@@ -78,7 +78,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c
index 19bd4f12d05..de036e88ebf 100644
--- a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c
+++ b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c
@@ -87,7 +87,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
index 5f0aeaa9df1..cc4f26fa6c5 100644
--- a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
+++ b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
@@ -113,9 +113,8 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { {! vector_alignment_reachable} || vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail {! vector_alignment_reachable} } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-25.c b/gcc/testsuite/gcc.dg/vect/slp-25.c
index d10720e7d84..b660508a79c 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-25.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-25.c
@@ -55,7 +55,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { vect_no_align } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-109.c b/gcc/testsuite/gcc.dg/vect/vect-109.c
index 173b8c06970..dd9f8ea77a3 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-109.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-109.c
@@ -74,6 +74,6 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 2 "vect" } } */
/* { dg-final { scan-tree-dump-times "not vectorized: unsupported unaligned store" 2 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 10 "vect" { target vect_hw_misalign } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-26.c b/gcc/testsuite/gcc.dg/vect/vect-26.c
index 268ed05061f..bec111b69cf 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-26.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-26.c
@@ -35,7 +35,7 @@ int main (void)
return main1 ();
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail {! vect_hw_misalign} } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-28.c b/gcc/testsuite/gcc.dg/vect/vect-28.c
index ddf1ee3b0ed..794a7c8f438 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-28.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-28.c
@@ -39,7 +39,7 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! { vect_hw_misalign } } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vector_alignment_reachable && { ! { vect_hw_misalign } } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vector_alignment_reachable } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-33.c b/gcc/testsuite/gcc.dg/vect/vect-33.c
index 9ee4aecb2ea..d35bce4d6f6 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-33.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-33.c
@@ -38,7 +38,7 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! { vect_hw_misalign } } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vector_alignment_reachable && {! vect_hw_misalign} } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target vector_alignment_reachable } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-42.c b/gcc/testsuite/gcc.dg/vect/vect-42.c
index ebed418e338..3ba1c6f7fde 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-42.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-42.c
@@ -65,6 +65,6 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target vect_no_align } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { { ! vector_alignment_reachable } && { ! vect_hw_misalign } } } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail { { vect_no_align || vect_hw_misalign } || { ! vector_alignment_reachable } } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align || vect_hw_misalign } || { ! vector_alignment_reachable } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail { vect_no_align || { ! vector_alignment_reachable } } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || { ! vector_alignment_reachable } } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-44.c b/gcc/testsuite/gcc.dg/vect/vect-44.c
index 89d09b36535..ef1a4635bfa 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-44.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-44.c
@@ -65,9 +65,8 @@ int main (void)
two loads to be aligned). */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { xfail { ! {vect_hw_misalign } } } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align || vect_hw_misalign } || {! vector_alignment_reachable} } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || {! vector_alignment_reachable} } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" { target vect_no_align } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { {! vector_alignment_reachable} && {{! vect_no_align} && {! vect_hw_misalign} } } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-50.c b/gcc/testsuite/gcc.dg/vect/vect-50.c
index 70b683e1a9d..068c804a168 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-50.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-50.c
@@ -61,9 +61,9 @@ int main (void)
align the store will not force the two loads to be aligned). */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align || vect_hw_misalign } || {! vector_alignment_reachable} } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || {! vector_alignment_reachable} } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" { target vect_no_align } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { {! vector_alignment_reachable} && { {! vect_no_align } && {! vect_hw_misalign } } } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-54.c b/gcc/testsuite/gcc.dg/vect/vect-54.c
index 85387fa6a34..629e82df59b 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-54.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-54.c
@@ -59,7 +59,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-56.c b/gcc/testsuite/gcc.dg/vect/vect-56.c
index e32d855d08d..7b7da123591 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-56.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-56.c
@@ -68,6 +68,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-58.c b/gcc/testsuite/gcc.dg/vect/vect-58.c
index 5ceb15627fc..fa8c91b3071 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-58.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-58.c
@@ -58,7 +58,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-60.c b/gcc/testsuite/gcc.dg/vect/vect-60.c
index 3319e360710..cbdf63db123 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-60.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-60.c
@@ -69,6 +69,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-70.c b/gcc/testsuite/gcc.dg/vect/vect-70.c
index bf206874ecd..e3ebdcab8b5 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-70.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-70.c
@@ -63,8 +63,7 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target { vector_alignment_reachable && { ! {vect_hw_misalign} } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target { vector_alignment_reachable} } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" {target {{! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-87.c b/gcc/testsuite/gcc.dg/vect/vect-87.c
index e7c5bbc7159..9912f19e724 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-87.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-87.c
@@ -50,8 +50,7 @@ int main (void)
/* Fails for targets that don't vectorize PLUS (e.g alpha). */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target { vector_alignment_reachable && {! vect_hw_misalign} } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target vector_alignment_reachable} } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" {target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-88.c b/gcc/testsuite/gcc.dg/vect/vect-88.c
index 3dc5588e92d..59385465228 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-88.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-88.c
@@ -50,8 +50,7 @@ int main (void)
/* Fails for targets that don't vectorize PLUS (e.g alpha). */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target { vector_alignment_reachable && {! vect_hw_misalign} } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target vector_alignment_reachable } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" {target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-89.c b/gcc/testsuite/gcc.dg/vect/vect-89.c
index 4a6e7ae47f7..131efeab53a 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-89.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-89.c
@@ -45,7 +45,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-91.c b/gcc/testsuite/gcc.dg/vect/vect-91.c
index c5aee4403f2..632340b0fef 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-91.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-91.c
@@ -58,8 +58,7 @@ main3 ()
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" { xfail vect_no_int_add } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 6 "vect" { target vect_hw_misalign } } } */
/* { dg-final { scan-tree-dump-times "accesses have the same alignment." 3 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" {target { vector_alignment_reachable && {! vect_hw_misalign} } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" {target { vector_alignment_reachable } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" {target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-92.c b/gcc/testsuite/gcc.dg/vect/vect-92.c
index 62aa97540f2..3a64e251cb2 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-92.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-92.c
@@ -91,7 +91,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 9 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-93.c b/gcc/testsuite/gcc.dg/vect/vect-93.c
index 4c41e60df0a..85666d9e699 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-93.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-93.c
@@ -71,9 +71,8 @@ int main (void)
/* main && main1 together: */
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 2 "vect" { target powerpc*-*-* i?86-*-* x86_64-*-* } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_hw_misalign } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { target { vect_no_align && {! vector_alignment_reachable} } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" { xfail { { vect_no_align || vect_hw_misalign } || {! vector_alignment_reachable} } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" { xfail { { vect_no_align } || {! vector_alignment_reachable} } } } } */
/* in main1: */
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target !powerpc*-*-* !i?86-*-* !x86_64-*-* } } } */
@@ -81,6 +80,6 @@ int main (void)
/* in main: */
/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-95.c b/gcc/testsuite/gcc.dg/vect/vect-95.c
index 9f1a2c4b256..c1d5926e67d 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-95.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-95.c
@@ -56,14 +56,13 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { xfail {vect_hw_misalign} } } } */
/* For targets that support unaligned loads we version for the two unaligned
stores and generate misaligned accesses for the loads. For targets that
don't support unaligned loads we version for all four accesses. */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { target vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_hw_misalign} } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target vect_no_align } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 4 "vect" { target vect_no_align } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-96.c b/gcc/testsuite/gcc.dg/vect/vect-96.c
index 219c82b0897..f392169f770 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-96.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-96.c
@@ -44,6 +44,6 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { {! vect_no_align} && vector_alignment_reachable } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align || vect_hw_misalign } || {! vector_alignment_reachable} } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align } || {! vector_alignment_reachable} } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { vect_no_align || { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c
index 1a0375266b0..e8fe027f5f3 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c
@@ -78,11 +78,11 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail {! vect_hw_misalign} } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail {! vect_hw_misalign} } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || vect_hw_misalign }} } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail {! vect_hw_misalign} } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail {! vect_hw_misalign} } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail *-*-* } } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c
index ba1f6604861..3346e71e523 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c
@@ -54,6 +54,6 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" {xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" {xfail { vect_no_align } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c
index f1d62f7cd0e..274fb025319 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c
@@ -87,9 +87,9 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail {! vect_hw_misalign} } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail {! vect_hw_misalign} } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 8 "vect" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c
index 7d8f5afe3e4..450855137a6 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c
@@ -61,6 +61,6 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 6 "vect" { target vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 6 "vect" {xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 6 "vect" {xfail { vect_no_align } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon-thumb2-move.c b/gcc/testsuite/gcc.target/arm/neon-thumb2-move.c
new file mode 100644
index 00000000000..88228513130
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-thumb2-move.c
@@ -0,0 +1,98 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_neon_ok } */
+/* { dg-options "-O2 -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon" } */
+
+#include <arm_neon.h>
+#include <stddef.h>
+
+void *
+memset (DST, C, LENGTH)
+ void *DST;
+ int C;
+ size_t LENGTH;
+{
+ void* DST0 = DST;
+ unsigned char C_BYTE = C;
+
+
+ if (__builtin_expect(LENGTH < 4, 1)) {
+ size_t i = 0;
+ while (i < LENGTH) {
+ ((char*)DST)[i] = C_BYTE;
+ i++;
+ }
+ return DST;
+ }
+
+ const char* DST_end = (char*)DST + LENGTH;
+
+
+ while ((uintptr_t)DST % 4 != 0) {
+ *(char*) (DST++) = C_BYTE;
+ }
+
+
+ uint32_t C_SHORTWORD = (uint32_t)(unsigned char)(C_BYTE) * 0x01010101;
+
+
+ if (__builtin_expect(DST_end - (char*)DST >= 16, 0)) {
+ while ((uintptr_t)DST % 16 != 0) {
+ *((uint32_t*)((char*)(DST) + (0))) = C_SHORTWORD;
+ DST += 4;
+ }
+
+
+ uint8x16_t C_WORD = vdupq_n_u8(C_BYTE);
+
+
+
+
+
+ size_t i = 0;
+ LENGTH = DST_end - (char*)DST;
+ while (i + 16 * 16 <= LENGTH) {
+ *((uint8x16_t*)((char*)(DST) + (i))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 1))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 2))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 3))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 4))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 5))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 6))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 7))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 8))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 9))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 10))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 11))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 12))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 13))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 14))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 15))) = C_WORD;
+ i += 16 * 16;
+ }
+ while (i + 16 * 4 <= LENGTH) {
+ *((uint8x16_t*)((char*)(DST) + (i))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 1))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 2))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 3))) = C_WORD;
+ i += 16 * 4;
+ }
+ while (i + 16 <= LENGTH) {
+ *((uint8x16_t*)((char*)(DST) + (i))) = C_WORD;
+ i += 16;
+ }
+ DST += i;
+ }
+
+ while (4 <= DST_end - (char*)DST) {
+ *((uint32_t*)((char*)(DST) + (0))) = C_SHORTWORD;
+ DST += 4;
+ }
+
+
+ while ((char*)DST < DST_end) {
+ *((char*)DST) = C_BYTE;
+ DST++;
+ }
+
+ return DST0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon/vfp-shift-a2t2.c b/gcc/testsuite/gcc.target/arm/neon/vfp-shift-a2t2.c
new file mode 100644
index 00000000000..2541df84169
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon/vfp-shift-a2t2.c
@@ -0,0 +1,27 @@
+/* Check that NEON vector shifts support immediate values == size. /*
+
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_neon_ok } */
+/* { dg-options "-save-temps -mfpu=neon -mfloat-abi=softfp" } */
+
+#include <arm_neon.h>
+
+uint16x8_t test_vshll_n_u8 (uint8x8_t a)
+{
+ return vshll_n_u8(a, 8);
+}
+
+uint32x4_t test_vshll_n_u16 (uint16x4_t a)
+{
+ return vshll_n_u16(a, 16);
+}
+
+uint64x2_t test_vshll_n_u32 (uint32x2_t a)
+{
+ return vshll_n_u32(a, 32);
+}
+
+/* { dg-final { scan-assembler "vshll\.u16\[ \]+\[qQ\]\[0-9\]+, \[dD\]\[0-9\]+, #\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
+/* { dg-final { scan-assembler "vshll\.u32\[ \]+\[qQ\]\[0-9\]+, \[dD\]\[0-9\]+, #\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
+/* { dg-final { scan-assembler "vshll\.u8\[ \]+\[qQ\]\[0-9\]+, \[dD\]\[0-9\]+, #\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/pr40835.c b/gcc/testsuite/gcc.target/arm/pr40835.c
new file mode 100644
index 00000000000..baf94032101
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr40835.c
@@ -0,0 +1,55 @@
+/* { dg-options "-mthumb -Os -march=armv5te" } */
+/* { dg-final { scan-assembler-not "cmp" } } */
+
+int bar();
+void goo(int, int);
+
+void eq()
+{
+ int v = bar();
+ if (v == 0)
+ return;
+ goo(1, v);
+}
+
+void ge()
+{
+ int v = bar();
+ if (v >= 0)
+ return;
+ goo(1, v);
+}
+
+void gt()
+{
+ int v = bar();
+ if (v > 0)
+ return;
+ goo(1, v);
+}
+
+void lt()
+{
+ int v = bar();
+ if (v < 0)
+ return;
+ goo(1, v);
+}
+
+void le()
+{
+ int v = bar();
+ if (v <= 0)
+ return;
+ goo(1, v);
+}
+
+unsigned int foo();
+
+void leu()
+{
+ unsigned int v = foo();
+ if (v <= 0)
+ return;
+ goo(1, v);
+}
diff --git a/gcc/testsuite/gcc.target/arm/thumb-bitfld1.c b/gcc/testsuite/gcc.target/arm/thumb-bitfld1.c
new file mode 100644
index 00000000000..7741b4f45f3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/thumb-bitfld1.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -mthumb -march=armv5t" } */
+
+struct foo
+{
+ unsigned b31 : 1;
+ unsigned b30 : 1;
+ unsigned b29 : 1;
+ unsigned b28 : 1;
+ unsigned rest : 28;
+};
+foo(a)
+ struct foo a;
+{
+ return a.b30;
+}
+
+/* { dg-final { scan-assembler-times "lsl" 1 } } */
+/* { dg-final { scan-assembler-times "lsr" 1 } } */
diff --git a/gcc/testsuite/gcc.target/arm/thumb-branch1.c b/gcc/testsuite/gcc.target/arm/thumb-branch1.c
new file mode 100644
index 00000000000..c479d162c99
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/thumb-branch1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -mthumb -march=armv5te" } */
+
+int returnbool(int a, int b)
+{
+ if (a < b)
+ return 1;
+ return 0;
+}
+
+/* { dg-final { scan-assembler-not "eor" } } */
diff --git a/gcc/testsuite/gcc.target/arm/thumb-ltu.c b/gcc/testsuite/gcc.target/arm/thumb-ltu.c
new file mode 100644
index 00000000000..899b8d23194
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/thumb-ltu.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-mcpu=arm1136jf-s -mthumb -O2" } */
+
+void f(unsigned a, unsigned b, unsigned c, unsigned d)
+{
+ if (a <= b || c > d)
+ foo();
+ else
+ bar();
+}
+
+/* { dg-final { scan-assembler-not "uxtb" } } */
diff --git a/gcc/testsuite/gcc.target/avr/torture/pr41885.c b/gcc/testsuite/gcc.target/avr/torture/pr41885.c
new file mode 100644
index 00000000000..90d00121255
--- /dev/null
+++ b/gcc/testsuite/gcc.target/avr/torture/pr41885.c
@@ -0,0 +1,123 @@
+/* { dg-options "-w -std=c99" } */
+/* { dg-do run } */
+
+#include <limits.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+
+uint16_t rotl_16a (uint16_t x)
+{
+ return (x << 8) | (x >> 8);
+}
+uint16_t rotl_16b (short dummy, uint16_t x)
+{
+ return (x << 8) | (x >> 8);
+}
+
+uint32_t rotl_32a (uint32_t x)
+{
+ return (x << 8) | (x >> 24);
+}
+uint32_t rotl_32b (short dummy, uint32_t x)
+{
+ return (x << 8) | (x >> 24);
+}
+uint32_t rotl_32c (short dummy, uint32_t x)
+{
+ return (x << 16) | (x >> 16);
+}
+uint32_t rotl_32d (short dummy, uint32_t x)
+{
+ return (x << 24) | (x >> 8);
+}
+uint32_t rotl_32e (long dummy, uint32_t x)
+{
+ return (x << 24) | (x >> 8);
+}
+
+uint64_t rotl_64 (uint64_t x)
+{
+ return (x << 56) | (x >> 8);
+}
+
+uint64_t rotl_64a (short dummy, uint64_t x)
+{
+ return (x << 56) | (x >> 8);
+}
+uint64_t rotl_64b (short dummy, uint64_t x)
+{
+ return (x << 48) | (x >> 16);
+}
+uint64_t rotl_64c (short dummy, uint64_t x)
+{
+ return (x << 40) | (x >> 24);
+}
+uint64_t rotl_64d (short dummy, uint64_t x)
+{
+ return (x << 32) | (x >> 32);
+}
+uint64_t rotl_64e (short dummy, uint64_t x)
+{
+ return (x << 24) | (x >> 40);
+}
+uint64_t rotl_64f (short dummy, uint64_t x)
+{
+ return (x << 16) | (x >> 48);
+}
+uint64_t rotl_64g (short dummy, uint64_t x)
+{
+ return (x << 8) | (x >> 56);
+}
+uint64_t rotl_64h (long dummy, uint64_t x)
+{
+ return (x << 16) | (x >> 48);
+}
+
+
+
+
+int main (void)
+{
+ if (rotl_16a(0x1234) != 0x3412)
+ abort();
+ if (rotl_16b(0xAA55,0x1234) != 0x3412)
+ abort();
+
+uint32_t num32 = 0x12345678;
+
+ if (rotl_32a(num32) != 0x34567812)
+ abort();
+ if (rotl_32b(0xAA55,num32) != 0x34567812)
+ abort();
+ if (rotl_32c(0xAA55,num32) != 0x56781234)
+ abort();
+ if (rotl_32d(0xAA55,num32) != 0x78123456)
+ abort();
+ if (rotl_32e(0x1122AA55,num32) != 0x78123456)
+ abort();
+
+uint64_t num = 0x123456789ABCDEF0ULL;
+
+ if (rotl_64(num) != 0xF0123456789ABCDEULL)
+ abort();
+ if (rotl_64a(0xAA55,num) != 0xF0123456789ABCDEULL)
+ abort();
+ if (rotl_64b(0xAA55,num) != 0xDEF0123456789ABCULL)
+ abort();
+ if (rotl_64c(0xAA55,num) != 0xBCDEF0123456789AULL)
+ abort();
+ if (rotl_64d(0xAA55,num) != 0x9ABCDEF012345678ULL)
+ abort();
+ if (rotl_64e(0xAA55,num) != 0x789ABCDEF0123456ULL)
+ abort();
+ if (rotl_64f(0xAA55,num) != 0x56789ABCDEF01234ULL)
+ abort();
+ if (rotl_64g(0xAA55,num) != 0x3456789ABCDEF012ULL)
+ abort();
+ if (rotl_64h(0x1122AA55,num) != 0x56789ABCDEF01234ULL)
+ abort();
+
+ exit (0);
+}
+
diff --git a/gcc/testsuite/gcc.target/i386/brokensqrt.c b/gcc/testsuite/gcc.target/i386/brokensqrt.c
new file mode 100644
index 00000000000..19a59d822e6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/brokensqrt.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -ffast-math -msse -mfpmath=sse -mrecip" } */
+#include "sse-check.h"
+
+extern float sqrtf (float);
+float __attribute__((noinline)) broken (float a, float b)
+{
+ return sqrtf (a / b);
+}
+
+extern void abort (void);
+extern void *memcpy (void *, const void *, __SIZE_TYPE__);
+static void
+sse_test (void)
+{
+ int i;
+ float x;
+ char buf[sizeof (float)];
+ x = broken (0.0f, 10000.0f);
+ /* A convoluted way to check for the correct result (zero) for all
+ floating point formats.
+ We can't use ==, !=, or range checks, or isinf/isnan/isunordered,
+ because all of these will not do the right thing under -ffast-math,
+ as they can assume that neither nan nor inf are returned. */
+ memcpy (&buf, &x, sizeof (float));
+ for (i = 0; i < sizeof (float); i++)
+ if (buf[i] != 0)
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/cold-attribute-4.s b/gcc/testsuite/gcc.target/i386/cold-attribute-4.s
deleted file mode 100644
index 68d05d09d4b..00000000000
--- a/gcc/testsuite/gcc.target/i386/cold-attribute-4.s
+++ /dev/null
@@ -1,41 +0,0 @@
- .file "cold-attribute-4.c"
- .text
- .p2align 4,,15
-.globl t
- .type t, @function
-t:
-.LFB14:
- movl $-1, %eax
- ret
-.LFE14:
- .size t, .-t
- .section .eh_frame,"a",@progbits
-.Lframe1:
- .long .LECIE1-.LSCIE1
-.LSCIE1:
- .long 0x0
- .byte 0x1
- .string "zR"
- .uleb128 0x1
- .sleb128 -8
- .byte 0x10
- .uleb128 0x1
- .byte 0x3
- .byte 0xc
- .uleb128 0x7
- .uleb128 0x8
- .byte 0x90
- .uleb128 0x1
- .align 8
-.LECIE1:
-.LSFDE1:
- .long .LEFDE1-.LASFDE1
-.LASFDE1:
- .long .LASFDE1-.Lframe1
- .long .LFB14
- .long .LFE14-.LFB14
- .uleb128 0x0
- .align 8
-.LEFDE1:
- .ident "GCC: (GNU) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)"
- .section .note.GNU-stack,"",@progbits
diff --git a/gcc/testsuite/gcc.target/i386/i386.exp b/gcc/testsuite/gcc.target/i386/i386.exp
index c7c6e12d1f4..3ef9df66ca5 100644
--- a/gcc/testsuite/gcc.target/i386/i386.exp
+++ b/gcc/testsuite/gcc.target/i386/i386.exp
@@ -24,6 +24,18 @@ if { ![istarget i?86*-*-*] && ![istarget x86_64-*-*] } then {
# Load support procs.
load_lib gcc-dg.exp
+# Return 1 if attribute ms_hook_prologue is supported.
+proc check_effective_target_ms_hook_prologue { } {
+ if { [check_effective_target_ilp32]
+ && [check_no_compiler_messages ms_hook_prologue object {
+ void __attribute__ ((__ms_hook_prologue__)) foo ();
+ } ""] } {
+ return 1
+ } else {
+ return 0
+ }
+}
+
# Return 1 if ssse3 instructions can be compiled.
proc check_effective_target_ssse3 { } {
return [check_no_compiler_messages ssse3 object {
@@ -134,6 +146,20 @@ proc check_effective_target_fma4 { } {
} "-O2 -mfma4" ]
}
+# Return 1 if xop instructions can be compiled.
+proc check_effective_target_xop { } {
+ return [check_no_compiler_messages xop object {
+ typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
+ typedef short __v8hi __attribute__ ((__vector_size__ (16)));
+ __m128i _mm_maccs_epi16(__m128i __A, __m128i __B, __m128i __C)
+ {
+ return (__m128i) __builtin_ia32_vpmacssww ((__v8hi)__A,
+ (__v8hi)__B,
+ (__v8hi)__C);
+ }
+ } "-O2 -mxop" ]
+}
+
# If a testcase doesn't have special options, use these.
global DEFAULT_CFLAGS
if ![info exists DEFAULT_CFLAGS] then {
diff --git a/gcc/testsuite/gcc.target/i386/incoming-10.c b/gcc/testsuite/gcc.target/i386/incoming-10.c
new file mode 100644
index 00000000000..31d9e6180be
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/incoming-10.c
@@ -0,0 +1,19 @@
+/* PR target/40838 */
+/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
+/* { dg-options "-w -mstackrealign -fomit-frame-pointer -O3 -march=barcelona -mpreferred-stack-boundary=4" } */
+
+struct s {
+ int x[8];
+};
+
+void g(struct s *);
+
+void f()
+{
+ int i;
+ struct s s;
+ for (i = 0; i < sizeof(s.x) / sizeof(*s.x); i++) s.x[i] = 0;
+ g(&s);
+}
+
+/* { dg-final { scan-assembler "andl\[\\t \]*\\$-16,\[\\t \]*%esp" } } */
diff --git a/gcc/testsuite/gcc.target/i386/incoming-11.c b/gcc/testsuite/gcc.target/i386/incoming-11.c
new file mode 100644
index 00000000000..e5787af7a62
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/incoming-11.c
@@ -0,0 +1,18 @@
+/* PR target/40838 */
+/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
+/* { dg-options "-w -mstackrealign -fomit-frame-pointer -O3 -march=barcelona -mpreferred-stack-boundary=4" } */
+
+void g();
+
+int p[100];
+int q[100];
+
+void f()
+{
+ int i;
+ for (i = 0; i < 100; i++) p[i] = 0;
+ g();
+ for (i = 0; i < 100; i++) q[i] = 0;
+}
+
+/* { dg-final { scan-assembler "andl\[\\t \]*\\$-16,\[\\t \]*%esp" } } */
diff --git a/gcc/testsuite/gcc.target/i386/incoming-12.c b/gcc/testsuite/gcc.target/i386/incoming-12.c
new file mode 100644
index 00000000000..d7ef1038bb5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/incoming-12.c
@@ -0,0 +1,20 @@
+/* PR target/40838 */
+/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
+/* { dg-options "-w -mstackrealign -O2 -msse2 -mpreferred-stack-boundary=4" } */
+
+typedef int v4si __attribute__ ((vector_size (16)));
+
+struct x {
+ v4si v;
+ v4si w;
+};
+
+void y(void *);
+
+v4si x(void)
+{
+ struct x x;
+ y(&x);
+}
+
+/* { dg-final { scan-assembler "andl\[\\t \]*\\$-16,\[\\t \]*%esp" } } */
diff --git a/gcc/testsuite/gcc.target/i386/incoming-13.c b/gcc/testsuite/gcc.target/i386/incoming-13.c
new file mode 100644
index 00000000000..bbc8993d577
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/incoming-13.c
@@ -0,0 +1,15 @@
+/* PR target/40838 */
+/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
+/* { dg-options "-w -mstackrealign -O2 -mpreferred-stack-boundary=4" } */
+
+extern double y(double *s3);
+
+extern double s1, s2;
+
+double x(void)
+{
+ double s3 = s1 + s2;
+ return y(&s3);
+}
+
+/* { dg-final { scan-assembler-not "andl\[\\t \]*\\$-16,\[\\t \]*%esp" } } */
diff --git a/gcc/testsuite/gcc.target/i386/incoming-14.c b/gcc/testsuite/gcc.target/i386/incoming-14.c
new file mode 100644
index 00000000000..d27179d9578
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/incoming-14.c
@@ -0,0 +1,15 @@
+/* PR target/40838 */
+/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
+/* { dg-options "-w -mstackrealign -O2 -mpreferred-stack-boundary=4" } */
+
+extern int y(int *s3);
+
+extern int s1, s2;
+
+int x(void)
+{
+ int s3 = s1 + s2;
+ return y(&s3);
+}
+
+/* { dg-final { scan-assembler-not "andl\[\\t \]*\\$-16,\[\\t \]*%esp" } } */
diff --git a/gcc/testsuite/gcc.target/i386/incoming-15.c b/gcc/testsuite/gcc.target/i386/incoming-15.c
new file mode 100644
index 00000000000..e6a17490447
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/incoming-15.c
@@ -0,0 +1,15 @@
+/* PR target/40838 */
+/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
+/* { dg-options "-w -mstackrealign -O2 -mpreferred-stack-boundary=4" } */
+
+extern long long y(long long *s3);
+
+extern long long s1, s2;
+
+long long x(void)
+{
+ long long s3 = s1 + s2;
+ return y(&s3);
+}
+
+/* { dg-final { scan-assembler-not "andl\[\\t \]*\\$-16,\[\\t \]*%esp" } } */
diff --git a/gcc/testsuite/gcc.target/i386/incoming-6.c b/gcc/testsuite/gcc.target/i386/incoming-6.c
new file mode 100644
index 00000000000..5cc4ab3f766
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/incoming-6.c
@@ -0,0 +1,17 @@
+/* PR target/40838 */
+/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
+/* { dg-options "-w -mstackrealign -O2 -msse2 -mpreferred-stack-boundary=4" } */
+
+typedef int v4si __attribute__ ((vector_size (16)));
+
+extern v4si y(v4si *s3);
+
+extern v4si s1, s2;
+
+v4si x(void)
+{
+ v4si s3 = s1 + s2;
+ return y(&s3);
+}
+
+/* { dg-final { scan-assembler "andl\[\\t \]*\\$-16,\[\\t \]*%esp" } } */
diff --git a/gcc/testsuite/gcc.target/i386/incoming-7.c b/gcc/testsuite/gcc.target/i386/incoming-7.c
new file mode 100644
index 00000000000..cdd60379683
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/incoming-7.c
@@ -0,0 +1,16 @@
+/* PR target/40838 */
+/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
+/* { dg-options "-w -mstackrealign -O2 -msse2 -mpreferred-stack-boundary=4" } */
+
+typedef int v4si __attribute__ ((vector_size (16)));
+
+extern v4si y(v4si, v4si, v4si, v4si, v4si);
+
+extern v4si s1, s2;
+
+v4si x(void)
+{
+ return y(s1, s2, s1, s2, s2);
+}
+
+/* { dg-final { scan-assembler "andl\[\\t \]*\\$-16,\[\\t \]*%esp" } } */
diff --git a/gcc/testsuite/gcc.target/i386/incoming-8.c b/gcc/testsuite/gcc.target/i386/incoming-8.c
new file mode 100644
index 00000000000..2dd8800fd6c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/incoming-8.c
@@ -0,0 +1,18 @@
+/* PR target/40838 */
+/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
+/* { dg-options "-w -mstackrealign -O3 -msse2 -mpreferred-stack-boundary=4" } */
+
+float
+foo (float f)
+{
+ float array[128];
+ float x;
+ int i;
+ for (i = 0; i < sizeof(array) / sizeof(*array); i++)
+ array[i] = f;
+ for (i = 0; i < sizeof(array) / sizeof(*array); i++)
+ x += array[i];
+ return x;
+}
+
+/* { dg-final { scan-assembler "andl\[\\t \]*\\$-16,\[\\t \]*%esp" } } */
diff --git a/gcc/testsuite/gcc.target/i386/incoming-9.c b/gcc/testsuite/gcc.target/i386/incoming-9.c
new file mode 100644
index 00000000000..e43cbd6bc1c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/incoming-9.c
@@ -0,0 +1,18 @@
+/* PR target/40838 */
+/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
+/* { dg-options "-w -mstackrealign -O3 -mno-sse -mpreferred-stack-boundary=4" } */
+
+float
+foo (float f)
+{
+ float array[128];
+ float x;
+ int i;
+ for (i = 0; i < sizeof(array) / sizeof(*array); i++)
+ array[i] = f;
+ for (i = 0; i < sizeof(array) / sizeof(*array); i++)
+ x += array[i];
+ return x;
+}
+
+/* { dg-final { scan-assembler-not "andl\[\\t \]*\\$-16,\[\\t \]*%esp" } } */
diff --git a/gcc/testsuite/gcc.target/i386/math-torture/math-torture.exp b/gcc/testsuite/gcc.target/i386/math-torture/math-torture.exp
index 78831374455..9b97ccb1b38 100644
--- a/gcc/testsuite/gcc.target/i386/math-torture/math-torture.exp
+++ b/gcc/testsuite/gcc.target/i386/math-torture/math-torture.exp
@@ -52,7 +52,7 @@ load_lib gcc-dg.exp
load_lib torture-options.exp
torture-init
-set-torture-options $MATH_TORTURE_OPTIONS
+set-torture-options $MATH_TORTURE_OPTIONS {{}} $LTO_TORTURE_OPTIONS
dg-init
gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] ""
diff --git a/gcc/testsuite/gcc.target/i386/ms_hook_prologue.c b/gcc/testsuite/gcc.target/i386/ms_hook_prologue.c
new file mode 100644
index 00000000000..f945492dfde
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/ms_hook_prologue.c
@@ -0,0 +1,29 @@
+/* Test that the ms_hook_prologue attribute generates the correct code. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target ms_hook_prologue } */
+/* { dg-options "-O2 -fomit-frame-pointer" } */
+
+int __attribute__ ((__ms_hook_prologue__)) foo ()
+{
+ unsigned char *ptr = (unsigned char *) foo;
+
+ /* The NOP mov must not be optimized away by optimizations.
+ The push %ebp, mov %esp, %ebp must not be removed by
+ -fomit-frame-pointer */
+
+ /* movl.s %edi, %edi */
+ if(*ptr++ != 0x8b) return 1;
+ if(*ptr++ != 0xff) return 1;
+ /* push %ebp */
+ if(*ptr++ != 0x55) return 1;
+ /* movl.s %esp, %ebp */
+ if(*ptr++ != 0x8b) return 1;
+ if(*ptr++ != 0xec) return 1;
+ return 0;
+}
+
+int main ()
+{
+ return foo();
+}
diff --git a/gcc/testsuite/gcc.target/i386/pic-1.c b/gcc/testsuite/gcc.target/i386/pic-1.c
index bc11de90b41..bdf6267c7d8 100644
--- a/gcc/testsuite/gcc.target/i386/pic-1.c
+++ b/gcc/testsuite/gcc.target/i386/pic-1.c
@@ -2,6 +2,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-require-effective-target fpic } */
+/* { dg-skip-if "No Windows PIC" { *-*-mingw* *-*-cygwin } { "*" } { "" } } */
/* { dg-options "-fPIC" } */
int foo ()
diff --git a/gcc/testsuite/gcc.target/i386/pr37843-4.c b/gcc/testsuite/gcc.target/i386/pr37843-4.c
new file mode 100644
index 00000000000..8e5f51f9d8b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr37843-4.c
@@ -0,0 +1,13 @@
+/* Test for stack alignment with sibcall optimization. */
+/* { dg-do compile { target { ilp32 && nonpic } } } */
+/* { dg-options "-O2 -msse2 -mpreferred-stack-boundary=4 -mstackrealign" } */
+/* { dg-final { scan-assembler-not "andl\[\\t \]*\\$-16,\[\\t \]*%\[re\]?sp" } } */
+/* { dg-final { scan-assembler-not "call\[\\t \]*foo" } } */
+/* { dg-final { scan-assembler "jmp\[\\t \]*foo" } } */
+
+extern int foo (void);
+
+int bar (void)
+{
+ return foo();
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr41900.c b/gcc/testsuite/gcc.target/i386/pr41900.c
new file mode 100644
index 00000000000..55f712d1fa4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr41900.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-O2 -fomit-frame-pointer -mpreferred-stack-boundary=2" } */
+
+int main ()
+{
+ volatile unsigned code = 0xc3;
+
+ ((void (*)(void)) &code) ();
+ return 0;
+}
+
+/* { dg-final { scan-assembler-not "call\[ \\t\]+\\*%esp" } } */
diff --git a/gcc/testsuite/gcc.target/i386/sse-12.c b/gcc/testsuite/gcc.target/i386/sse-12.c
index 85c36c8be31..d03c41bf10a 100644
--- a/gcc/testsuite/gcc.target/i386/sse-12.c
+++ b/gcc/testsuite/gcc.target/i386/sse-12.c
@@ -1,7 +1,7 @@
-/* Test that {,x,e,p,t,s,w,a,b,i}mmintrin.h, mm3dnow.h and mm_malloc.h are
+/* Test that {,x,e,p,t,s,w,a,b,i}mmintrin.h, xopintrin.h, mm3dnow.h and mm_malloc.h are
usable with -O -std=c89 -pedantic-errors. */
/* { dg-do compile } */
-/* { dg-options "-O -std=c89 -pedantic-errors -march=k8 -m3dnow -mavx -mfma4 -maes -mpclmul" } */
+/* { dg-options "-O -std=c89 -pedantic-errors -march=k8 -m3dnow -mavx -mfma4 -mxop -maes -mpclmul" } */
#include <x86intrin.h>
diff --git a/gcc/testsuite/gcc.target/i386/sse-13.c b/gcc/testsuite/gcc.target/i386/sse-13.c
index 1ce9d960884..2ef63d5fc68 100644
--- a/gcc/testsuite/gcc.target/i386/sse-13.c
+++ b/gcc/testsuite/gcc.target/i386/sse-13.c
@@ -1,10 +1,10 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -m3dnow -mavx -maes -mpclmul" } */
+/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -m3dnow -mavx -mxop -maes -mpclmul" } */
#include <mm_malloc.h>
/* Test that the intrinsics compile with optimization. All of them are
- defined as inline functions in {,x,e,p,t,s,w,a,b,i}mmintrin.h and mm3dnow.h
+ defined as inline functions in {,x,e,p,t,s,w,a,b,i}mmintrin.h, xopintrin.h and mm3dnow.h
that reference the proper builtin functions. Defining away "extern" and
"__inline" results in all of them being compiled as proper functions. */
@@ -125,4 +125,10 @@
#define __builtin_ia32_vec_ext_v4hi(A, N) __builtin_ia32_vec_ext_v4hi(A, 0)
#define __builtin_ia32_shufps(A, B, N) __builtin_ia32_shufps(A, B, 0)
+/* xopintrin.h */
+#define __builtin_ia32_vprotbi(A, N) __builtin_ia32_vprotbi (A,1)
+#define __builtin_ia32_vprotwi(A, N) __builtin_ia32_vprotwi (A,1)
+#define __builtin_ia32_vprotdi(A, N) __builtin_ia32_vprotdi (A,1)
+#define __builtin_ia32_vprotqi(A, N) __builtin_ia32_vprotqi (A,1)
+
#include <x86intrin.h>
diff --git a/gcc/testsuite/gcc.target/i386/sse-14.c b/gcc/testsuite/gcc.target/i386/sse-14.c
index c1ddb96e5c3..783cd0af106 100644
--- a/gcc/testsuite/gcc.target/i386/sse-14.c
+++ b/gcc/testsuite/gcc.target/i386/sse-14.c
@@ -1,10 +1,10 @@
/* { dg-do compile } */
-/* { dg-options "-O0 -Werror-implicit-function-declaration -march=k8 -m3dnow -mavx -msse4a -maes -mpclmul" } */
+/* { dg-options "-O0 -Werror-implicit-function-declaration -march=k8 -m3dnow -mavx -mxop -msse4a -maes -mpclmul" } */
#include <mm_malloc.h>
/* Test that the intrinsics compile without optimization. All of them are
- defined as inline functions in {,x,e,p,t,s,w,a}mmintrin.h and mm3dnow.h
+ defined as inline functions in {,x,e,p,t,s,w,a}mmintrin.h, xopintrin.h and mm3dnow.h
that reference the proper builtin functions. Defining away "extern" and
"__inline" results in all of them being compiled as proper functions. */
@@ -155,3 +155,10 @@ test_2 (_m_pinsrw, __m64, __m64, int, 1)
test_1 (_mm_shuffle_pi16, __m64, __m64, 1)
test_1 (_m_pshufw, __m64, __m64, 1)
test_1 (_mm_prefetch, void, void *, _MM_HINT_NTA)
+
+/* xopintrin.h */
+test_1 ( _mm_roti_epi8, __m128i, __m128i, 1)
+test_1 ( _mm_roti_epi16, __m128i, __m128i, 1)
+test_1 ( _mm_roti_epi32, __m128i, __m128i, 1)
+test_1 ( _mm_roti_epi64, __m128i, __m128i, 1)
+
diff --git a/gcc/testsuite/gcc.target/i386/sse-22.c b/gcc/testsuite/gcc.target/i386/sse-22.c
index eeae0fcab75..541cad4d439 100644
--- a/gcc/testsuite/gcc.target/i386/sse-22.c
+++ b/gcc/testsuite/gcc.target/i386/sse-22.c
@@ -5,7 +5,7 @@
#include <mm_malloc.h>
/* Test that the intrinsics compile without optimization. All of them are
- defined as inline functions in {,x,e,p,t,s,w,a}mmintrin.h and mm3dnow.h
+ defined as inline functions in {,x,e,p,t,s,w,a}mmintrin.h, xopintrin.h and mm3dnow.h
that reference the proper builtin functions. Defining away "extern" and
"__inline" results in all of them being compiled as proper functions. */
@@ -37,7 +37,7 @@
#ifndef DIFFERENT_PRAGMAS
-#pragma GCC target ("mmx,3dnow,sse,sse2,sse3,ssse3,sse4.1,sse4.2,sse4a,aes,pclmul")
+#pragma GCC target ("mmx,3dnow,sse,sse2,sse3,ssse3,sse4.1,sse4.2,sse4a,aes,pclmul,xop")
#endif
/* Following intrinsics require immediate arguments. They
@@ -159,3 +159,13 @@ test_1 (_mm_round_pd, __m128d, __m128d, 1)
test_1 (_mm_round_ps, __m128, __m128, 1)
test_2 (_mm_round_sd, __m128d, __m128d, __m128d, 1)
test_2 (_mm_round_ss, __m128, __m128, __m128, 1)
+
+/* xopintrin.h (XOP). */
+#ifdef DIFFERENT_PRAGMAS
+#pragma GCC target ("xop")
+#endif
+#include <x86intrin.h>
+test_1 ( _mm_roti_epi8, __m128i, __m128i, 1)
+test_1 ( _mm_roti_epi16, __m128i, __m128i, 1)
+test_1 ( _mm_roti_epi32, __m128i, __m128i, 1)
+test_1 ( _mm_roti_epi64, __m128i, __m128i, 1)
diff --git a/gcc/testsuite/gcc.target/i386/sse-23.c b/gcc/testsuite/gcc.target/i386/sse-23.c
index 63cb811d042..3e0fa1f5ca4 100644
--- a/gcc/testsuite/gcc.target/i386/sse-23.c
+++ b/gcc/testsuite/gcc.target/i386/sse-23.c
@@ -4,7 +4,7 @@
#include <mm_malloc.h>
/* Test that the intrinsics compile with optimization. All of them are
- defined as inline functions in {,x,e,p,t,s,w,a,b}mmintrin.h and mm3dnow.h
+ defined as inline functions in {,x,e,p,t,s,w,a}mmintrin.h, xopintrin.h and mm3dnow.h
that reference the proper builtin functions. Defining away "extern" and
"__inline" results in all of them being compiled as proper functions. */
@@ -93,14 +93,13 @@
#define __builtin_ia32_vec_ext_v4hi(A, N) __builtin_ia32_vec_ext_v4hi(A, 0)
#define __builtin_ia32_shufps(A, B, N) __builtin_ia32_shufps(A, B, 0)
-/* bmmintrin.h */
-#define __builtin_ia32_protbi(A, B) __builtin_ia32_protbi(A,1)
-#define __builtin_ia32_protwi(A, B) __builtin_ia32_protwi(A,1)
-#define __builtin_ia32_protdi(A, B) __builtin_ia32_protdi(A,1)
-#define __builtin_ia32_protqi(A, B) __builtin_ia32_protqi(A,1)
+/* xopintrin.h */
+#define __builtin_ia32_vprotbi(A, B) __builtin_ia32_vprotbi(A,1)
+#define __builtin_ia32_vprotwi(A, B) __builtin_ia32_vprotwi(A,1)
+#define __builtin_ia32_vprotdi(A, B) __builtin_ia32_vprotdi(A,1)
+#define __builtin_ia32_vprotqi(A, B) __builtin_ia32_vprotqi(A,1)
-
-#pragma GCC target ("3dnow,sse4,sse4a,aes,pclmul")
+#pragma GCC target ("3dnow,sse4,sse4a,aes,pclmul,xop")
#include <wmmintrin.h>
#include <smmintrin.h>
#include <mm3dnow.h>
diff --git a/gcc/testsuite/gcc.target/i386/sse-recip-vec.c b/gcc/testsuite/gcc.target/i386/sse-recip-vec.c
index 2f90ec8aeca..202351dc987 100644
--- a/gcc/testsuite/gcc.target/i386/sse-recip-vec.c
+++ b/gcc/testsuite/gcc.target/i386/sse-recip-vec.c
@@ -4,6 +4,7 @@
#include "sse-check.h"
extern float sqrtf (float);
+extern float fabsf (float);
#define N 8
@@ -26,7 +27,7 @@ sse_test (void)
/* check results: */
for (i = 0; i < N; i++)
{
- if (r[i] != rc[i])
+ if (fabsf (r[i] - rc[i]) > 0.0001)
abort();
}
}
diff --git a/gcc/testsuite/gcc.target/i386/sse-recip.c b/gcc/testsuite/gcc.target/i386/sse-recip.c
index b673f400b43..d88eb7f007b 100644
--- a/gcc/testsuite/gcc.target/i386/sse-recip.c
+++ b/gcc/testsuite/gcc.target/i386/sse-recip.c
@@ -4,6 +4,7 @@
#include "sse-check.h"
extern float sqrtf (float);
+extern float fabsf (float);
#define N 8
@@ -26,7 +27,7 @@ sse_test (void)
/* check results: */
for (i = 0; i < N; i++)
{
- if (r[i] != rc[i])
+ if (fabsf (r[i] - rc[i]) > 0.0001)
abort();
}
}
diff --git a/gcc/testsuite/gcc.target/i386/xop-check.h b/gcc/testsuite/gcc.target/i386/xop-check.h
new file mode 100644
index 00000000000..2dede33d851
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/xop-check.h
@@ -0,0 +1,20 @@
+#include <stdlib.h>
+
+#include "cpuid.h"
+
+static void xop_test (void);
+
+int
+main ()
+{
+ unsigned int eax, ebx, ecx, edx;
+
+ if (!__get_cpuid (0x80000001, &eax, &ebx, &ecx, &edx))
+ return 0;
+
+ /* Run XOP test only if host has XOP support. */
+ if (ecx & bit_XOP)
+ xop_test ();
+
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.target/i386/xop-haddX.c b/gcc/testsuite/gcc.target/i386/xop-haddX.c
new file mode 100644
index 00000000000..7d3220baffe
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/xop-haddX.c
@@ -0,0 +1,206 @@
+/* { dg-do run } */
+/* { dg-require-effective-target xop } */
+/* { dg-options "-O2 -mxop" } */
+
+#include "xop-check.h"
+
+#include <x86intrin.h>
+#include <string.h>
+
+#define NUM 10
+
+union
+{
+ __m128i x[NUM];
+ signed char ssi[NUM * 16];
+ short si[NUM * 8];
+ int li[NUM * 4];
+ long long lli[NUM * 2];
+} dst, res, src1;
+
+static void
+init_sbyte ()
+{
+ int i;
+ for (i=0; i < NUM * 16; i++)
+ src1.ssi[i] = i;
+}
+
+static void
+init_sword ()
+{
+ int i;
+ for (i=0; i < NUM * 8; i++)
+ src1.si[i] = i;
+}
+
+
+static void
+init_sdword ()
+{
+ int i;
+ for (i=0; i < NUM * 4; i++)
+ src1.li[i] = i;
+}
+
+static int
+check_sbyte2word ()
+{
+ int i, j, s, t, check_fails = 0;
+ for (i = 0; i < NUM * 16; i = i + 16)
+ {
+ for (j = 0; j < 8; j++)
+ {
+ t = i + (2 * j);
+ s = (i / 2) + j;
+ res.si[s] = src1.ssi[t] + src1.ssi[t + 1] ;
+ if (res.si[s] != dst.si[s])
+ check_fails++;
+ }
+ }
+}
+
+static int
+check_sbyte2dword ()
+{
+ int i, j, s, t, check_fails = 0;
+ for (i = 0; i < NUM * 16; i = i + 16)
+ {
+ for (j = 0; j < 4; j++)
+ {
+ t = i + (4 * j);
+ s = (i / 4) + j;
+ res.li[s] = (src1.ssi[t] + src1.ssi[t + 1]) + (src1.ssi[t + 2]
+ + src1.ssi[t + 3]);
+ if (res.li[s] != dst.li[s])
+ check_fails++;
+ }
+ }
+ return check_fails++;
+}
+
+static int
+check_sbyte2qword ()
+{
+ int i, j, s, t, check_fails = 0;
+ for (i = 0; i < NUM * 16; i = i + 16)
+ {
+ for (j = 0; j < 2; j++)
+ {
+ t = i + (8 * j);
+ s = (i / 8) + j;
+ res.lli[s] = ((src1.ssi[t] + src1.ssi[t + 1]) + (src1.ssi[t + 2]
+ + src1.ssi[t + 3])) + ((src1.ssi[t + 4] + src1.ssi[t +5])
+ + (src1.ssi[t + 6] + src1.ssi[t + 7]));
+ if (res.lli[s] != dst.lli[s])
+ check_fails++;
+ }
+ }
+ return check_fails++;
+}
+
+static int
+check_sword2dword ()
+{
+ int i, j, s, t, check_fails = 0;
+ for (i = 0; i < (NUM * 8); i = i + 8)
+ {
+ for (j = 0; j < 4; j++)
+ {
+ t = i + (2 * j);
+ s = (i / 2) + j;
+ res.li[s] = src1.si[t] + src1.si[t + 1] ;
+ if (res.li[s] != dst.li[s])
+ check_fails++;
+ }
+ }
+}
+
+static int
+check_sword2qword ()
+{
+ int i, j, s, t, check_fails = 0;
+ for (i = 0; i < NUM * 8; i = i + 8)
+ {
+ for (j = 0; j < 2; j++)
+ {
+ t = i + (4 * j);
+ s = (i / 4) + j;
+ res.lli[s] = (src1.si[t] + src1.si[t + 1]) + (src1.si[t + 2]
+ + src1.si[t + 3]);
+ if (res.lli[s] != dst.lli[s])
+ check_fails++;
+ }
+ }
+ return check_fails++;
+}
+
+static int
+check_dword2qword ()
+{
+ int i, j, s, t, check_fails = 0;
+ for (i = 0; i < (NUM * 4); i = i + 4)
+ {
+ for (j = 0; j < 2; j++)
+ {
+ t = i + (2 * j);
+ s = (i / 2) + j;
+ res.lli[s] = src1.li[t] + src1.li[t + 1] ;
+ if (res.lli[s] != dst.lli[s])
+ check_fails++;
+ }
+ }
+}
+
+static void
+xop_test (void)
+{
+ int i;
+
+ init_sbyte ();
+
+ for (i = 0; i < NUM; i++)
+ dst.x[i] = _mm_haddw_epi8 (src1.x[i]);
+
+ if (check_sbyte2word())
+ abort ();
+
+
+ for (i = 0; i < (NUM ); i++)
+ dst.x[i] = _mm_haddd_epi8 (src1.x[i]);
+
+ if (check_sbyte2dword())
+ abort ();
+
+
+ for (i = 0; i < NUM; i++)
+ dst.x[i] = _mm_haddq_epi8 (src1.x[i]);
+
+ if (check_sbyte2qword())
+ abort ();
+
+
+ init_sword ();
+
+ for (i = 0; i < (NUM ); i++)
+ dst.x[i] = _mm_haddd_epi16 (src1.x[i]);
+
+ if (check_sword2dword())
+ abort ();
+
+ for (i = 0; i < NUM; i++)
+ dst.x[i] = _mm_haddq_epi16 (src1.x[i]);
+
+ if (check_sword2qword())
+ abort ();
+
+
+ init_sdword ();
+
+ for (i = 0; i < NUM; i++)
+ dst.x[i] = _mm_haddq_epi32 (src1.x[i]);
+
+ if (check_dword2qword())
+ abort ();
+
+}
diff --git a/gcc/testsuite/gcc.target/i386/xop-hadduX.c b/gcc/testsuite/gcc.target/i386/xop-hadduX.c
new file mode 100644
index 00000000000..9c7ea9a2a60
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/xop-hadduX.c
@@ -0,0 +1,207 @@
+/* { dg-do run } */
+/* { dg-require-effective-target xop } */
+/* { dg-options "-O2 -mxop" } */
+
+#include "xop-check.h"
+
+#include <x86intrin.h>
+#include <string.h>
+
+#define NUM 10
+
+union
+{
+ __m128i x[NUM];
+ unsigned char ssi[NUM * 16];
+ unsigned short si[NUM * 8];
+ unsigned int li[NUM * 4];
+ unsigned long long lli[NUM * 2];
+} dst, res, src1;
+
+static void
+init_byte ()
+{
+ int i;
+ for (i=0; i < NUM * 16; i++)
+ src1.ssi[i] = i;
+}
+
+static void
+init_word ()
+{
+ int i;
+ for (i=0; i < NUM * 8; i++)
+ src1.si[i] = i;
+}
+
+
+static void
+init_dword ()
+{
+ int i;
+ for (i=0; i < NUM * 4; i++)
+ src1.li[i] = i;
+}
+
+static int
+check_byte2word ()
+{
+ int i, j, s, t, check_fails = 0;
+ for (i = 0; i < NUM * 16; i = i + 16)
+ {
+ for (j = 0; j < 8; j++)
+ {
+ t = i + (2 * j);
+ s = (i / 2) + j;
+ res.si[s] = src1.ssi[t] + src1.ssi[t + 1] ;
+ if (res.si[s] != dst.si[s])
+ check_fails++;
+ }
+ }
+}
+
+static int
+check_byte2dword ()
+{
+ int i, j, s, t, check_fails = 0;
+ for (i = 0; i < NUM * 16; i = i + 16)
+ {
+ for (j = 0; j < 4; j++)
+ {
+ t = i + (4 * j);
+ s = (i / 4) + j;
+ res.li[s] = (src1.ssi[t] + src1.ssi[t + 1]) + (src1.ssi[t + 2]
+ + src1.ssi[t + 3]);
+ if (res.li[s] != dst.li[s])
+ check_fails++;
+ }
+ }
+ return check_fails++;
+}
+
+static int
+check_byte2qword ()
+{
+ int i, j, s, t, check_fails = 0;
+ for (i = 0; i < NUM * 16; i = i + 16)
+ {
+ for (j = 0; j < 2; j++)
+ {
+ t = i + (8 * j);
+ s = (i / 8) + j;
+ res.lli[s] = ((src1.ssi[t] + src1.ssi[t + 1]) + (src1.ssi[t + 2]
+ + src1.ssi[t + 3])) + ((src1.ssi[t + 4] + src1.ssi[t +5])
+ + (src1.ssi[t + 6] + src1.ssi[t + 7]));
+ if (res.lli[s] != dst.lli[s])
+ check_fails++;
+ }
+ }
+ return check_fails++;
+}
+
+static int
+check_word2dword ()
+{
+ int i, j, s, t, check_fails = 0;
+ for (i = 0; i < (NUM * 8); i = i + 8)
+ {
+ for (j = 0; j < 4; j++)
+ {
+ t = i + (2 * j);
+ s = (i / 2) + j;
+ res.li[s] = src1.si[t] + src1.si[t + 1] ;
+ if (res.li[s] != dst.li[s])
+ check_fails++;
+ }
+ }
+}
+
+static int
+check_word2qword ()
+{
+ int i, j, s, t, check_fails = 0;
+ for (i = 0; i < NUM * 8; i = i + 8)
+ {
+ for (j = 0; j < 2; j++)
+ {
+ t = i + (4 * j);
+ s = (i / 4) + j;
+ res.lli[s] = (src1.si[t] + src1.si[t + 1]) + (src1.si[t + 2]
+ + src1.si[t + 3]);
+ if (res.lli[s] != dst.lli[s])
+ check_fails++;
+ }
+ }
+ return check_fails++;
+}
+
+static int
+check_dword2qword ()
+{
+ int i, j, s, t, check_fails = 0;
+ for (i = 0; i < (NUM * 4); i = i + 4)
+ {
+ for (j = 0; j < 2; j++)
+ {
+ t = i + (2 * j);
+ s = (i / 2) + j;
+ res.lli[s] = src1.li[t] + src1.li[t + 1] ;
+ if (res.lli[s] != dst.lli[s])
+ check_fails++;
+ }
+ }
+}
+
+static void
+xop_test (void)
+{
+ int i;
+
+ /* Check haddubw */
+ init_byte ();
+
+ for (i = 0; i < NUM; i++)
+ dst.x[i] = _mm_haddw_epu8 (src1.x[i]);
+
+ if (check_byte2word())
+ abort ();
+
+ /* Check haddubd */
+ for (i = 0; i < (NUM ); i++)
+ dst.x[i] = _mm_haddd_epu8 (src1.x[i]);
+
+ if (check_byte2dword())
+ abort ();
+
+ /* Check haddubq */
+ for (i = 0; i < NUM; i++)
+ dst.x[i] = _mm_haddq_epu8 (src1.x[i]);
+
+ if (check_byte2qword())
+ abort ();
+
+ /* Check hadduwd */
+ init_word ();
+
+ for (i = 0; i < (NUM ); i++)
+ dst.x[i] = _mm_haddd_epu16 (src1.x[i]);
+
+ if (check_word2dword())
+ abort ();
+
+ /* Check haddbuwq */
+
+ for (i = 0; i < NUM; i++)
+ dst.x[i] = _mm_haddq_epu16 (src1.x[i]);
+
+ if (check_word2qword())
+ abort ();
+
+ /* Check hadudq */
+ init_dword ();
+ for (i = 0; i < NUM; i++)
+ dst.x[i] = _mm_haddq_epu32 (src1.x[i]);
+
+ if (check_dword2qword())
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/xop-hsubX.c b/gcc/testsuite/gcc.target/i386/xop-hsubX.c
new file mode 100644
index 00000000000..f0fa9b312f2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/xop-hsubX.c
@@ -0,0 +1,128 @@
+/* { dg-do run } */
+/* { dg-require-effective-target xop } */
+/* { dg-options "-O2 -mxop" } */
+
+#include "xop-check.h"
+
+#include <x86intrin.h>
+#include <string.h>
+
+#define NUM 10
+
+union
+{
+ __m128i x[NUM];
+ signed char ssi[NUM * 16];
+ short si[NUM * 8];
+ int li[NUM * 4];
+ long long lli[NUM * 2];
+} dst, res, src1;
+
+static void
+init_sbyte ()
+{
+ int i;
+ for (i=0; i < NUM * 16; i++)
+ src1.ssi[i] = i;
+}
+
+static void
+init_sword ()
+{
+ int i;
+ for (i=0; i < NUM * 8; i++)
+ src1.si[i] = i;
+}
+
+
+static void
+init_sdword ()
+{
+ int i;
+ for (i=0; i < NUM * 4; i++)
+ src1.li[i] = i;
+}
+
+static int
+check_sbyte2word ()
+{
+ int i, j, s, t, check_fails = 0;
+ for (i = 0; i < NUM * 16; i = i + 16)
+ {
+ for (j = 0; j < 8; j++)
+ {
+ t = i + (2 * j);
+ s = (i / 2) + j;
+ res.si[s] = src1.ssi[t] - src1.ssi[t + 1] ;
+ if (res.si[s] != dst.si[s])
+ check_fails++;
+ }
+ }
+}
+
+static int
+check_sword2dword ()
+{
+ int i, j, s, t, check_fails = 0;
+ for (i = 0; i < (NUM * 8); i = i + 8)
+ {
+ for (j = 0; j < 4; j++)
+ {
+ t = i + (2 * j);
+ s = (i / 2) + j;
+ res.li[s] = src1.si[t] - src1.si[t + 1] ;
+ if (res.li[s] != dst.li[s])
+ check_fails++;
+ }
+ }
+}
+
+static int
+check_dword2qword ()
+{
+ int i, j, s, t, check_fails = 0;
+ for (i = 0; i < (NUM * 4); i = i + 4)
+ {
+ for (j = 0; j < 2; j++)
+ {
+ t = i + (2 * j);
+ s = (i / 2) + j;
+ res.lli[s] = src1.li[t] - src1.li[t + 1] ;
+ if (res.lli[s] != dst.lli[s])
+ check_fails++;
+ }
+ }
+}
+
+static void
+xop_test (void)
+{
+ int i;
+
+ /* Check hsubbw */
+ init_sbyte ();
+
+ for (i = 0; i < NUM; i++)
+ dst.x[i] = _mm_hsubw_epi8 (src1.x[i]);
+
+ if (check_sbyte2word())
+ abort ();
+
+
+ /* Check hsubwd */
+ init_sword ();
+
+ for (i = 0; i < (NUM ); i++)
+ dst.x[i] = _mm_hsubd_epi16 (src1.x[i]);
+
+ if (check_sword2dword())
+ abort ();
+
+ /* Check hsubdq */
+ init_sdword ();
+ for (i = 0; i < NUM; i++)
+ dst.x[i] = _mm_hsubq_epi32 (src1.x[i]);
+
+ if (check_dword2qword())
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/xop-imul32widen-vector.c b/gcc/testsuite/gcc.target/i386/xop-imul32widen-vector.c
new file mode 100644
index 00000000000..0406d023df5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/xop-imul32widen-vector.c
@@ -0,0 +1,36 @@
+/* Test that the compiler properly optimizes floating point multiply and add
+ instructions vector into pmacsdd/etc. on XOP systems. */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mxop -ftree-vectorize" } */
+
+extern void exit (int);
+
+typedef long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
+
+#define SIZE 10240
+
+union {
+ __m128i i_align;
+ int i32[SIZE];
+ long i64[SIZE];
+} a, b, c, d;
+
+void
+imul32_to_64 (void)
+{
+ int i;
+
+ for (i = 0; i < SIZE; i++)
+ a.i64[i] = ((long)b.i32[i]) * ((long)c.i32[i]);
+}
+
+int main ()
+{
+ imul32_to_64 ();
+ exit (0);
+}
+
+/* { dg-final { scan-assembler "vpmacsdql" } } */
+/* { dg-final { scan-assembler "vpmacsdqh" } } */
diff --git a/gcc/testsuite/gcc.target/i386/xop-imul64-vector.c b/gcc/testsuite/gcc.target/i386/xop-imul64-vector.c
new file mode 100644
index 00000000000..738cac04105
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/xop-imul64-vector.c
@@ -0,0 +1,36 @@
+/* Test that the compiler properly optimizes floating point multiply and add
+ instructions vector into pmacsdd/etc. on XOP systems. */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mxop -ftree-vectorize" } */
+
+extern void exit (int);
+
+typedef long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
+
+#define SIZE 10240
+
+union {
+ __m128i i_align;
+ long i64[SIZE];
+} a, b, c, d;
+
+void
+imul64 (void)
+{
+ int i;
+
+ for (i = 0; i < SIZE; i++)
+ a.i64[i] = b.i64[i] * c.i64[i];
+}
+
+int main ()
+{
+ imul64 ();
+ exit (0);
+}
+
+/* { dg-final { scan-assembler "vpmacsdd" } } */
+/* { dg-final { scan-assembler "vphadddq" } } */
+/* { dg-final { scan-assembler "vpmacsdql" } } */
diff --git a/gcc/testsuite/gcc.target/i386/xop-pcmov.c b/gcc/testsuite/gcc.target/i386/xop-pcmov.c
new file mode 100644
index 00000000000..d6375b1fd50
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/xop-pcmov.c
@@ -0,0 +1,23 @@
+/* Test that the compiler properly optimizes conditional floating point moves
+ into the pcmov instruction on XOP systems. */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mxop" } */
+
+extern void exit (int);
+
+double dbl_test (double a, double b, double c, double d)
+{
+ return (a > b) ? c : d;
+}
+
+double dbl_a = 1, dbl_b = 2, dbl_c = 3, dbl_d = 4, dbl_e;
+
+int main()
+{
+ dbl_e = dbl_test (dbl_a, dbl_b, dbl_c, dbl_d);
+ exit (0);
+}
+
+/* { dg-final { scan-assembler "vpcmov" } } */
diff --git a/gcc/testsuite/gcc.target/i386/xop-pcmov2.c b/gcc/testsuite/gcc.target/i386/xop-pcmov2.c
new file mode 100644
index 00000000000..617da39da98
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/xop-pcmov2.c
@@ -0,0 +1,23 @@
+/* Test that the compiler properly optimizes conditional floating point moves
+ into the pcmov instruction on XOP systems. */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mxop" } */
+
+extern void exit (int);
+
+float flt_test (float a, float b, float c, float d)
+{
+ return (a > b) ? c : d;
+}
+
+float flt_a = 1, flt_b = 2, flt_c = 3, flt_d = 4, flt_e;
+
+int main()
+{
+ flt_e = flt_test (flt_a, flt_b, flt_c, flt_d);
+ exit (0);
+}
+
+/* { dg-final { scan-assembler "vpcmov" } } */
diff --git a/gcc/testsuite/gcc.target/i386/xop-rotate1-vector.c b/gcc/testsuite/gcc.target/i386/xop-rotate1-vector.c
new file mode 100644
index 00000000000..e3ae644d0b5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/xop-rotate1-vector.c
@@ -0,0 +1,35 @@
+/* Test that the compiler properly optimizes vector rotate instructions vector
+ into prot on XOP systems. */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mxop -ftree-vectorize" } */
+
+extern void exit (int);
+
+typedef long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
+
+#define SIZE 10240
+
+union {
+ __m128i i_align;
+ unsigned u32[SIZE];
+} a, b, c;
+
+void
+left_rotate32 (void)
+{
+ int i;
+
+ for (i = 0; i < SIZE; i++)
+ a.u32[i] = (b.u32[i] << ((sizeof (int) * 8) - 4)) | (b.u32[i] >> 4);
+}
+
+int
+main ()
+{
+ left_rotate32 ();
+ exit (0);
+}
+
+/* { dg-final { scan-assembler "vprotd" } } */
diff --git a/gcc/testsuite/gcc.target/i386/xop-rotate2-vector.c b/gcc/testsuite/gcc.target/i386/xop-rotate2-vector.c
new file mode 100644
index 00000000000..9996279bc0f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/xop-rotate2-vector.c
@@ -0,0 +1,35 @@
+/* Test that the compiler properly optimizes vector rotate instructions vector
+ into prot on XOP systems. */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mxop -ftree-vectorize" } */
+
+extern void exit (int);
+
+typedef long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
+
+#define SIZE 10240
+
+union {
+ __m128i i_align;
+ unsigned u32[SIZE];
+} a, b, c;
+
+void
+right_rotate32_b (void)
+{
+ int i;
+
+ for (i = 0; i < SIZE; i++)
+ a.u32[i] = (b.u32[i] >> ((sizeof (int) * 8) - 4)) | (b.u32[i] << 4);
+}
+
+int
+main ()
+{
+ right_rotate ();
+ exit (0);
+}
+
+/* { dg-final { scan-assembler "vprot" } } */
diff --git a/gcc/testsuite/gcc.target/i386/xop-rotate3-vector.c b/gcc/testsuite/gcc.target/i386/xop-rotate3-vector.c
new file mode 100644
index 00000000000..73d52f5f3f0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/xop-rotate3-vector.c
@@ -0,0 +1,34 @@
+/* Test that the compiler properly optimizes vector rotate instructions vector
+ into prot on XOP systems. */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mxop -ftree-vectorize" } */
+
+extern void exit (int);
+
+typedef long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
+
+#define SIZE 10240
+
+union {
+ __m128i i_align;
+ unsigned u32[SIZE];
+} a, b, c;
+
+void
+vector_rotate32 (void)
+{
+ int i;
+
+ for (i = 0; i < SIZE; i++)
+ a.u32[i] = (b.u32[i] >> ((sizeof (int) * 8) - c.u32[i])) | (b.u32[i] << c.u32[i]);
+}
+
+int main ()
+{
+ vector_rotate32 ();
+ exit (0);
+}
+
+/* { dg-final { scan-assembler "vprotd" } } */
diff --git a/gcc/testsuite/gcc.target/i386/xop-shift1-vector.c b/gcc/testsuite/gcc.target/i386/xop-shift1-vector.c
new file mode 100644
index 00000000000..eb84439c496
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/xop-shift1-vector.c
@@ -0,0 +1,35 @@
+/* Test that the compiler properly optimizes vector shift instructions into
+ psha/pshl on XOP systems. */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mxop -ftree-vectorize" } */
+
+extern void exit (int);
+
+typedef long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
+
+#define SIZE 10240
+
+union {
+ __m128i i_align;
+ int i32[SIZE];
+ unsigned u32[SIZE];
+} a, b, c;
+
+void
+left_shift32 (void)
+{
+ int i;
+
+ for (i = 0; i < SIZE; i++)
+ a.i32[i] = b.i32[i] << c.i32[i];
+}
+
+int main ()
+{
+ left_shfit32 ();
+ exit (0);
+}
+
+/* { dg-final { scan-assembler "vpshad" } } */
diff --git a/gcc/testsuite/gcc.target/i386/xop-shift2-vector.c b/gcc/testsuite/gcc.target/i386/xop-shift2-vector.c
new file mode 100644
index 00000000000..e59c30d021b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/xop-shift2-vector.c
@@ -0,0 +1,35 @@
+/* Test that the compiler properly optimizes vector shift instructions into
+ psha/pshl on XOP systems. */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mxop -ftree-vectorize" } */
+
+extern void exit (int);
+
+typedef long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
+
+#define SIZE 10240
+
+union {
+ __m128i i_align;
+ int i32[SIZE];
+ unsigned u32[SIZE];
+} a, b, c;
+
+void
+right_sign_shift32 (void)
+{
+ int i;
+
+ for (i = 0; i < SIZE; i++)
+ a.i32[i] = b.i32[i] >> c.i32[i];
+}
+
+int main ()
+{
+ right_sign_shfit32 ();
+ exit (0);
+}
+
+/* { dg-final { scan-assembler "vpshad" } } */
diff --git a/gcc/testsuite/gcc.target/i386/xop-shift3-vector.c b/gcc/testsuite/gcc.target/i386/xop-shift3-vector.c
new file mode 100644
index 00000000000..2b9302db52d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/xop-shift3-vector.c
@@ -0,0 +1,35 @@
+/* Test that the compiler properly optimizes vector shift instructions into
+ psha/pshl on XOP systems. */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mxop -ftree-vectorize" } */
+
+extern void exit (int);
+
+typedef long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
+
+#define SIZE 10240
+
+union {
+ __m128i i_align;
+ int i32[SIZE];
+ unsigned u32[SIZE];
+} a, b, c;
+
+void
+right_uns_shift32 (void)
+{
+ int i;
+
+ for (i = 0; i < SIZE; i++)
+ a.u32[i] = b.u32[i] >> c.i32[i];
+}
+
+int main ()
+{
+ right_uns_shfit32 ();
+ exit (0);
+}
+
+/* { dg-final { scan-assembler "vpshld" } } */
diff --git a/gcc/testsuite/gcc.target/m68k/pr41302.c b/gcc/testsuite/gcc.target/m68k/pr41302.c
new file mode 100644
index 00000000000..c3679923e65
--- /dev/null
+++ b/gcc/testsuite/gcc.target/m68k/pr41302.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler "move.l \%d0,\%a0" { target *-*-*linux* } } } */
+
+struct pts {
+ int c;
+};
+
+unsigned int bar (struct pts *a, int b);
+
+struct pts * foo (struct pts *a, int b)
+{
+ return (struct pts *) bar (a, b);
+}
diff --git a/gcc/testsuite/gcc.target/mips/mips.exp b/gcc/testsuite/gcc.target/mips/mips.exp
index aef473f89d5..02e031cd15c 100644
--- a/gcc/testsuite/gcc.target/mips/mips.exp
+++ b/gcc/testsuite/gcc.target/mips/mips.exp
@@ -263,6 +263,7 @@ foreach option {
sym32
synci
relax-pic-calls
+ mcount-ra-address
} {
lappend mips_option_groups $option "-m(no-|)$option"
}
diff --git a/gcc/testsuite/gcc.target/mips/mmcount-ra-address-1.c b/gcc/testsuite/gcc.target/mips/mmcount-ra-address-1.c
new file mode 100644
index 00000000000..cf5b044d636
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/mmcount-ra-address-1.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -pg -mmcount-ra-address -mabi=64" } */
+/* { dg-final { scan-assembler "\tmove\t\\\$12,\\\$0" } } */
+int bazl(int i)
+{
+ return i + 2;
+}
diff --git a/gcc/testsuite/gcc.target/mips/mmcount-ra-address-2.c b/gcc/testsuite/gcc.target/mips/mmcount-ra-address-2.c
new file mode 100644
index 00000000000..bef9dd93d80
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/mmcount-ra-address-2.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -pg -mmcount-ra-address -mabi=64" } */
+/* { dg-final { scan-assembler "\tdla\t\\\$12,8\\(\\\$sp\\)" } } */
+int foo (int);
+int bar (int i)
+{
+ return foo (i) + 2;
+}
diff --git a/gcc/testsuite/gcc.target/mips/mmcount-ra-address-3.c b/gcc/testsuite/gcc.target/mips/mmcount-ra-address-3.c
new file mode 100644
index 00000000000..59007e6ef3c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/mmcount-ra-address-3.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -pg -mmcount-ra-address -mabi=64" } */
+/* { dg-final { scan-assembler "\tdla\t\\\$12,200008\\(\\\$sp\\)" } } */
+int foo (int *);
+int bar(int i)
+{
+ int big[50000];
+ return foo (big) + 2;
+}
diff --git a/gcc/testsuite/gcc.target/mips/mult-1.c b/gcc/testsuite/gcc.target/mips/mult-1.c
new file mode 100644
index 00000000000..d82a4778263
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/mult-1.c
@@ -0,0 +1,14 @@
+/* For SI->DI widening multiplication we should use DINS to combine the two
+ halves. */
+/* { dg-options "-O -mgp64 isa_rev>=2" } */
+/* { dg-final { scan-assembler "\tdins\t" } } */
+/* { dg-final { scan-assembler-not "\tdsll\t" } } */
+/* { dg-final { scan-assembler-not "\tdsrl\t" } } */
+/* { dg-final { scan-assembler-not "\tor\t" } } */
+
+NOMIPS16 unsigned long long
+f (unsigned int i, unsigned int j)
+{
+ i++;
+ return (unsigned long long) i * j;
+}
diff --git a/gcc/testsuite/gcc.target/mips/truncate-6.c b/gcc/testsuite/gcc.target/mips/truncate-6.c
new file mode 100644
index 00000000000..1ccd6c59c3d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/truncate-6.c
@@ -0,0 +1,12 @@
+/* setup_incoming_promotions should detect x to be already sign-extended due
+ to PROMOTE_MODE. Thus the truncation should be removed by combine. Based
+ on gcc.c-torture/execute/pr34070-2.c. */
+/* { dg-options "-O -mgp64" } */
+/* { dg-final { scan-assembler-not "\tsll\t\[^\n\]*,0" } } */
+
+NOMIPS16 int f(unsigned int x, int n, int *p)
+{
+ if (p)
+ *p = 1;
+ return ((int)x) / (1 << n);
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-33.c b/gcc/testsuite/gcc.target/powerpc/altivec-33.c
new file mode 100644
index 00000000000..c1c935a1c59
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/altivec-33.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-O2 -maltivec" } */
+
+/* We should only produce one vspltw as we already splatted the value. */
+/* { dg-final { scan-assembler-times "vspltw" 1 } } */
+
+#include <altivec.h>
+
+vector float f(vector float a)
+{
+ vector float b = vec_splat (a, 2);
+ return vec_splat (b, 0);
+}
+
+
diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-4.c b/gcc/testsuite/gcc.target/powerpc/altivec-4.c
index a5617e25b8a..2c78f6586d6 100644
--- a/gcc/testsuite/gcc.target/powerpc/altivec-4.c
+++ b/gcc/testsuite/gcc.target/powerpc/altivec-4.c
@@ -4,7 +4,7 @@
#define vector __attribute__((vector_size(16)))
-static int vector x, y;
+static int vector x, y, z;
static vector signed int i,j;
static vector signed short s,t;
@@ -20,7 +20,7 @@ static int int1, int2;
void
b()
{
- __builtin_altivec_vadduwm (x, y);
+ z = __builtin_altivec_vadduwm (x, y);
/* Make sure the predicates accept correct argument types. */
diff --git a/gcc/testsuite/gcc.target/vsx-vectorize-1.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-1.c
index 2538ad987d2..2538ad987d2 100644
--- a/gcc/testsuite/gcc.target/vsx-vectorize-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-1.c
diff --git a/gcc/testsuite/gcc.target/vsx-vectorize-2.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-2.c
index e558f413c92..7bb7db0fa5f 100644
--- a/gcc/testsuite/gcc.target/vsx-vectorize-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-2.c
@@ -58,7 +58,7 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" {xfail {! vect_hw_misalign } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" {xfail {! vect_hw_misalign } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/vsx-vectorize-3.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-3.c
index b99bcca49f4..b99bcca49f4 100644
--- a/gcc/testsuite/gcc.target/vsx-vectorize-3.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-3.c
diff --git a/gcc/testsuite/gcc.target/vsx-vectorize-4.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-4.c
index a3bd7e69674..ad6f8f0fec5 100644
--- a/gcc/testsuite/gcc.target/vsx-vectorize-4.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-4.c
@@ -54,7 +54,7 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" {xfail {! vect_hw_misalign } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" {xfail {! vect_hw_misalign } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/vsx-vectorize-5.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-5.c
index 32d05b29829..32d05b29829 100644
--- a/gcc/testsuite/gcc.target/vsx-vectorize-5.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-5.c
diff --git a/gcc/testsuite/gcc.target/vsx-vectorize-6.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-6.c
index c46c8a74711..8e6e288b9bf 100644
--- a/gcc/testsuite/gcc.target/vsx-vectorize-6.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-6.c
@@ -58,7 +58,7 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" {xfail {! vect_hw_misalign } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" {xfail {! vect_hw_misalign } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/vsx-vectorize-7.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-7.c
index 3c57f937fc0..c09583535e1 100644
--- a/gcc/testsuite/gcc.target/vsx-vectorize-7.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-7.c
@@ -58,7 +58,7 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" {xfail {! vect_hw_misalign } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" {xfail {! vect_hw_misalign } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/vsx-vectorize-8.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-8.c
index af671ee79cb..af671ee79cb 100644
--- a/gcc/testsuite/gcc.target/vsx-vectorize-8.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-8.c
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vrsave.c b/gcc/testsuite/gcc.target/powerpc/vsx-vrsave.c
new file mode 100644
index 00000000000..83125f67fcc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vrsave.c
@@ -0,0 +1,20 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-O2 -mcpu=power7" } */
+/* { dg-final { scan-assembler-times "mtvrsave" 2 } } */
+
+/* Check whether VRSAVE is set to non-zero if VSX vector operations were
+ used, but it should not be set if there are no vector operations. */
+
+void
+generates_vrsave (vector double *a, vector double *b, vector double *c)
+{
+ *a = *b + *c;
+}
+
+void
+no_vrsave (double *a, double *b, double *c)
+{
+ *a = *b + *c;
+}
diff --git a/gcc/testsuite/gcc.target/rx/builtins.c b/gcc/testsuite/gcc.target/rx/builtins.c
new file mode 100644
index 00000000000..2a6241d7cce
--- /dev/null
+++ b/gcc/testsuite/gcc.target/rx/builtins.c
@@ -0,0 +1,171 @@
+/* { dg-do run } */
+/* { dg-options "-fno-ipa-cp-clone" } */
+
+/* Verify that the RX specific builtin functions work. */
+
+/* IPA CP cloning is disabled because the constant propagation
+ has no understanding of the saturation behaviour of the
+ __builtin_rx_sat function and so it will optimize away the
+ saturation addition test. */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+/* We need to prevent these functions from being inlined
+ as otherwise gcc will attempt to optimize away their
+ arguments and we need the operations on them in order
+ to correctly set the psw flags. */
+
+int saturate_add (int, int) __attribute__((__noinline__));
+int exchange (int, int) __attribute__((__noinline__));
+
+int
+half_word_swap (int arg)
+{
+ return __builtin_rx_revw (arg);
+}
+
+int
+saturate_add (int arg1, int arg2)
+{
+ arg1 += arg2;
+ return __builtin_rx_sat (arg1);
+}
+
+int
+exchange (int arg1, int arg2)
+{
+ arg1 = __builtin_rx_xchg (arg2);
+ return arg1;
+}
+
+long
+multiply_and_accumulate (long arg1, long arg2, long arg3)
+{
+ __builtin_rx_mvtaclo (0);
+ __builtin_rx_mvtachi (0);
+
+ __builtin_rx_mullo (arg1, arg2);
+ __builtin_rx_mulhi (arg1, arg2);
+ __builtin_rx_maclo (arg1, arg3);
+ __builtin_rx_machi (arg1, arg3);
+
+ __builtin_rx_racw (1);
+
+ arg1 = __builtin_rx_mvfachi ();
+ arg1 += __builtin_rx_mvfacmi ();
+
+ return arg1;
+}
+
+int
+rxround (float arg)
+{
+ return __builtin_rx_round (arg);
+}
+
+/* #define DEBUG 1 */
+
+#ifdef DEBUG
+#define CHECK_0ARG(func, result) \
+ if (func () != result) \
+ { \
+ printf (#func " () fails: %x not %x\n", func (), result); \
+ abort (); \
+ }
+
+#define CHECK_1ARG(func, arg, result) \
+ if (func (arg) != result) \
+ { \
+ printf (#func " (" #arg ") fails: %x not %x\n", func (arg), result); \
+ abort (); \
+ }
+
+#define CHECK_2ARG(func, arg1, arg2, result) \
+ if (func (arg1, arg2) != result) \
+ { \
+ printf (#func " (" #arg1 "," #arg2 ") fails: %x not %x\n", \
+ func (arg1, arg2), result); \
+ abort (); \
+ }
+
+#define CHECK_3ARG(func, arg1, arg2, arg3, result) \
+ if (func (arg1, arg2, arg3) != result) \
+ { \
+ printf (#func " (" #arg1 "," #arg2 "," #arg3 ") fails: %x not %x\n", \
+ func (arg1, arg2, arg3), result); \
+ abort (); \
+ }
+#else
+#define CHECK_0ARG(func, result) \
+ if (func () != result) \
+ abort ();
+
+#define CHECK_1ARG(func, arg, result) \
+ if (func (arg) != result) \
+ abort ();
+
+#define CHECK_2ARG(func, arg1, arg2, result) \
+ if (func (arg1, arg2) != result) \
+ abort ();
+
+#define CHECK_3ARG(func, arg1, arg2, arg3, result) \
+ if (func (arg1, arg2, arg3) != result) \
+ abort ();
+#endif
+
+int
+main (void)
+{
+ CHECK_1ARG (half_word_swap, 0x12345678, 0x34127856);
+ CHECK_2ARG (saturate_add, 0x80000000, 0x80000000, 0x80000000);
+ CHECK_3ARG (multiply_and_accumulate, 0x111, 0x222, 0x333, 0x70007);
+ CHECK_1ARG (rxround, 0.5, 1);
+ return 0;
+}
+
+/* The following builtins are compiled but
+ not executed because they need OS support. */
+
+void
+rxbreak (void)
+{
+ __builtin_rx_brk ();
+}
+
+void
+interrupt (void)
+{
+ __builtin_rx_int (0x12);
+}
+
+int
+get_stack_pointer (void)
+{
+ return __builtin_rx_mvfc (2);
+}
+
+void
+set_stack_pointer (int value)
+{
+ __builtin_rx_mvtc (2, value);
+ __builtin_rx_mvtc (2, 0x1234);
+}
+
+void
+wait (void)
+{
+ __builtin_rx_wait ();
+}
+
+void
+rmpa (int * multiplicand, int * multiplier, int num)
+{
+ __builtin_rx_rmpa ();
+}
+
+void
+set_interrupts (void)
+{
+ __builtin_mvtipl (3);
+}
diff --git a/gcc/testsuite/gcc.target/rx/i272091.c b/gcc/testsuite/gcc.target/rx/i272091.c
new file mode 100644
index 00000000000..39da576326f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/rx/i272091.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-msmall-data-limit=100" } */
+
+double a=6.76,b=7.34,c=0.54;
+double x_1= 45.46;
+static double SD_1;
+static double SD_init = 45.54;
+double DD_1;
+double DD_init=769.0;
+
+
+int main()
+{
+ volatile double x,y,z;
+
+ x = 56.76;
+ y = 4.5645;
+
+ z = x + y;
+ z = x - 4.65;
+ z = 4.566 - x;
+ z = x * y;
+ b = 8;
+ c = 34;
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/rx/interrupts.c b/gcc/testsuite/gcc.target/rx/interrupts.c
new file mode 100644
index 00000000000..cdc4903ded8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/rx/interrupts.c
@@ -0,0 +1,58 @@
+/* { dg-do compile } */
+/* { dg-options "-mint-register=3 -msave-acc-in-interrupts" } */
+
+/* Verify that the RX specific function attributes work. */
+
+void fast_interrupt (void) __attribute__((__fast_interrupt__));
+void interrupt (void) __attribute__((__interrupt__));
+int naked (int) __attribute__((__naked__));
+
+int flag = 0;
+
+/* Fast interrupt handler. Only uses registers marked as fixed
+ by the -fixed-xxx gcc command line option. Returns via RTFI. */
+
+void
+fast_interrupt (void)
+{
+ flag = 1;
+}
+
+/* Interrupt handler. Must preserve any register it uses, even
+ call clobbered ones. Returns via RTE. */
+
+void
+interrupt (void)
+{
+ switch (flag)
+ {
+ case 0:
+ flag = -1;
+ break;
+ case 1:
+ case 2:
+ case 4:
+ flag = flag - 2;
+ break;
+ case 5:
+ case 7:
+ case 6:
+ flag ^= 3;
+ break;
+ default:
+ naked (flag * 2);
+ break;
+ }
+}
+
+/* Naked function. The programmer must supply the function's
+ prologue and epilogue instructions. */
+
+int
+naked (int arg)
+{
+ flag = arg;
+}
+
+/* { dg-final { scan-assembler "rtfi" } } */
+/* { dg-final { scan-assembler "rte" } } */
diff --git a/gcc/testsuite/gcc.target/rx/packed-struct.c b/gcc/testsuite/gcc.target/rx/packed-struct.c
new file mode 100644
index 00000000000..8c2a4345b82
--- /dev/null
+++ b/gcc/testsuite/gcc.target/rx/packed-struct.c
@@ -0,0 +1,55 @@
+/* { dg-do compile } */
+
+struct unpacked
+{
+ int i;
+ char c;
+};
+
+#pragma pack(1)
+
+struct packed
+{
+ int i;
+ char c;
+};
+
+struct packed_contains_unpacked
+{
+ char c;
+ struct unpacked uuuu; /* This should generate an error message. */
+}; /* { dg-error "unpacked structure/union inside a packed struct" "XFAILed until patch for generic GCC structure layout code is accepted" { xfail rx-*-* } } */
+
+union contains_unpacked
+{
+ char c;
+ struct unpacked uuuu; /* This should not. */
+};
+
+struct packed_contains_packed
+{
+ char c;
+ struct packed ppppp; /* This should not. */
+};
+
+#pragma pack()
+
+struct unpacked_contains_packed
+{
+ char c;
+ struct packed p;
+};
+
+struct unpacked_contains_unpacked
+{
+ char c;
+ struct unpacked u;
+};
+
+
+int s1 = sizeof (struct unpacked);
+int s2 = sizeof (struct packed);
+int s3 = sizeof (struct packed_contains_unpacked);
+int s4 = sizeof (struct packed_contains_packed);
+int s5 = sizeof (struct unpacked_contains_packed);
+int s6 = sizeof (struct unpacked_contains_unpacked);
diff --git a/gcc/testsuite/gcc.target/rx/rx-abi-function-tests.c b/gcc/testsuite/gcc.target/rx/rx-abi-function-tests.c
new file mode 100644
index 00000000000..e07ff71a007
--- /dev/null
+++ b/gcc/testsuite/gcc.target/rx/rx-abi-function-tests.c
@@ -0,0 +1,159 @@
+/* { dg-do run } */
+/* { dg-options "-msim" } */
+/* Note: The -msim above is actually there to override the default
+ options which include -ansi -pendantic and -Wlong-long... */
+
+extern int printf (const char *, ...);
+extern void exit (int);
+extern void abort (void);
+
+extern signed long _COM_CONVf32s (float);
+extern unsigned long _COM_CONVf32u (float);
+extern float _COM_CONV32sf (signed long);
+extern float _COM_CONV32uf (unsigned long);
+extern float _COM_ADDf (float, float);
+extern float _COM_SUBf (float, float);
+extern float _COM_MULf (float, float);
+extern float _COM_DIVf (float, float);
+extern int _COM_CMPLTf (float, float);
+
+extern long long _COM_MUL64 (long long, long long);
+extern signed long long _COM_DIV64s (long long, long long);
+extern unsigned long long _COM_DIV64u (unsigned long long, unsigned long long);
+extern long long _COM_SHLL64 (long long, int);
+extern long long _COM_SHLR64 (long long, int);
+extern long long _COM_SHAR64 (long long, int);
+extern signed long long _COM_CONVf64s (float);
+extern unsigned long long _COM_CONVf64u (float);
+extern signed long long _COM_CONVd64s (double);
+extern unsigned long long _COM_CONVd64u (double);
+extern float _COM_CONV64sf (signed long long);
+extern float _COM_CONV64uf (unsigned long long);
+extern double _COM_CONV64sd (signed long long);
+extern double _COM_CONV64ud (unsigned long long);
+extern signed long long _COM_MOD64s (long long, long long);
+extern unsigned long long _COM_MOD64u (unsigned long long, unsigned long long);
+extern int _COM_CMPLT64s (long long, long long);
+extern int _COM_CMPLT64u (unsigned long long, unsigned long long);
+extern int _COM_CMPGT64s (long long, long long);
+extern int _COM_CMPGT64u (unsigned long long, unsigned long long);
+extern int _COM_CMPLE64s (long long, long long);
+extern int _COM_CMPLE64u (unsigned long long, unsigned long long);
+extern int _COM_CMPGE64s (long long, long long);
+extern int _COM_CMPGE64u (unsigned long long, unsigned long long);
+extern int _COM_CMPEQ64 (long long, long long);
+extern int _COM_CMPNE64 (long long, long long);
+
+extern double _COM_ADDd (double, double);
+extern double _COM_SUBd (double, double);
+extern double _COM_MULd (double, double);
+extern double _COM_DIVd (double, double);
+extern signed long _COM_CONVd32s (double);
+extern unsigned long _COM_CONVd32u (double);
+extern double _COM_CONV32sd (signed long);
+extern double _COM_CONV32ud (unsigned long);
+extern double _COM_CONVfd (float);
+extern float _COM_CONVdf (double);
+extern double _COM_NEGd (double);
+
+
+/* #define DEBUG 1 */
+
+#ifdef DEBUG
+# define TEST1(func,arg1,result) if (func (arg1) != result) printf ("fail: " #func " (" #arg1 ") returns %x rather than " #result "\n", func (arg1))
+# define TEST2(func,arg1,arg2,result) if (func (arg1, arg2) != result) printf ("fail: " #func " (" #arg1 ", " #arg2 ") returns %x rather than " #result "\n", func (arg1, arg2))
+# define TEST_CMP(func, low_arg, high_arg, lt_result, eq_result, gt_result) \
+ do \
+ { \
+ int res; \
+ \
+ if ((res = func (low_arg, high_arg)) != lt_result) printf ("fail: " #func " (" #low_arg ", " #high_arg ") returns %d rather than %d\n", res, lt_result); \
+ if ((res = func (high_arg, low_arg)) != gt_result) printf ("fail: " #func " (" #high_arg ", " #low_arg ") returns %d rather than %d\n", res, gt_result); \
+ if ((res = func (low_arg, low_arg)) != eq_result) printf ("fail: " #func " (" #low_arg ", " #low_arg ") returns %d rather than %d\n", res, eq_result); \
+ } \
+ while (0)
+#else
+# define TEST1(func,arg1,result) if (func (arg1) != result) abort ()
+# define TEST2(func,arg1,arg2,result) if (func (arg1, arg2) != result) abort ()
+# define TEST_CMP(func,low,high,lt_res,eq_res,gt_res) \
+ if ( (func (low, high) != lt_res) \
+ || (func (high, low) != gt_res) \
+ || (func (low, low) != eq_res)) \
+ abort ();
+#endif
+
+
+int
+main (void)
+{
+#ifdef DEBUG
+ printf ("Tests starting\n");
+#endif
+
+ TEST1 (_COM_CONVf32s, -2.0f, -2);
+ TEST1 (_COM_CONVf32u, -2.0f, (unsigned) -2);
+ TEST1 (_COM_CONV32sf, -2, -2.0f);
+ TEST1 (_COM_CONV32uf, 2, 2.0f);
+ TEST2 (_COM_ADDf, 1.0f, 2.0f, 3.0f);
+ TEST2 (_COM_SUBf, 3.0f, 2.0f, 1.0f);
+ TEST2 (_COM_MULf, 2.0f, 3.0f, 6.0f);
+ TEST2 (_COM_DIVf, 6.0f, 2.0f, 3.0f);
+ TEST_CMP (_COM_CMPLTf, 1.0f, 2.0f, 1, 0, 0);
+ TEST_CMP (_COM_CMPGTf, 1.0f, 2.0f, 0, 0, 1);
+ TEST_CMP (_COM_CMPLEf, 1.0f, 2.0f, 1, 1, 0);
+ TEST_CMP (_COM_CMPGEf, 1.0f, 2.0f, 0, 1, 1);
+ TEST_CMP (_COM_CMPEQf, 1.0f, 2.0f, 0, 1, 0);
+ TEST_CMP (_COM_CMPNEf, 1.0f, 2.0f, 1, 0, 1);
+
+
+ TEST2 (_COM_MUL64, 2LL, 4LL, 8LL);
+ TEST2 (_COM_DIV64s, 6LL, 3LL, 2LL);
+ TEST2 (_COM_DIV64u, 6ULL, 3ULL, 2ULL);
+ TEST2 (_COM_SHLL64, 6LL, 3, 48LL);
+ TEST2 (_COM_SHLR64, 8LL, 2, 2LL);
+ TEST2 (_COM_SHAR64, -1LL, 2, -1LL);
+ TEST1 (_COM_CONVf64s, -2.0f, -2LL);
+ TEST1 (_COM_CONVf64u, 2.0f, 2ULL);
+ TEST1 (_COM_CONVd64s, -2.0, -2LL);
+ TEST1 (_COM_CONVd64u, 2.0, 2ULL);
+ TEST1 (_COM_CONV64sf, -2LL, -2.0f);
+ TEST1 (_COM_CONV64uf, 2ULL, 2.0f);
+ TEST1 (_COM_CONV64sd, -2LL, -2.0);
+ TEST1 (_COM_CONV64ud, 2ULL, 2.0);
+ TEST2 (_COM_MOD64s, 4LL, 3LL, 1LL);
+ TEST2 (_COM_MOD64u, 4ULL, 3ULL, 1ULL);
+ TEST_CMP (_COM_CMPLT64s, 1LL, 2LL, 1, 0, 0);
+ TEST_CMP (_COM_CMPLT64u, 1ULL, 2ULL, 1, 0, 0);
+ TEST_CMP (_COM_CMPGT64s, 1LL, 2LL, 0, 0, 1);
+ TEST_CMP (_COM_CMPGT64u, 1ULL, 2ULL, 0, 0, 1);
+ TEST_CMP (_COM_CMPLE64s, 1LL, 2LL, 1, 1, 0);
+ TEST_CMP (_COM_CMPLE64u, 1ULL, 2ULL, 1, 1, 0);
+ TEST_CMP (_COM_CMPGE64s, 1LL, 2LL, 0, 1, 1);
+ TEST_CMP (_COM_CMPGE64u, 1ULL, 2ULL, 0, 1, 1);
+ TEST_CMP (_COM_CMPEQ64, 1LL, 2LL, 0, 1, 0);
+ TEST_CMP (_COM_CMPNE64, 1LL, 2LL, 1, 0, 1);
+
+
+ TEST2 (_COM_ADDd, 1.0, 2.0, 3.0);
+ TEST2 (_COM_SUBd, 3.0, 2.0, 1.0);
+ TEST2 (_COM_MULd, 2.0, 3.0, 6.0);
+ TEST2 (_COM_DIVd, 6.0, 2.0, 3.0);
+ TEST1 (_COM_CONVd32s, -2.0, -2);
+ TEST1 (_COM_CONVd32u, -2.0, (unsigned) -2);
+ TEST1 (_COM_CONV32sd, -2, -2.0);
+ TEST1 (_COM_CONV32ud, 2, 2.0);
+ TEST1 (_COM_CONVfd, 2.0f, 2.0);
+ TEST1 (_COM_CONVdf, 2.0, 2.0f);
+ TEST1 (_COM_NEGd, -2.0, 2.0);
+ TEST_CMP (_COM_CMPLTd, 1.0, 2.0, 1, 0, 0);
+ TEST_CMP (_COM_CMPGTd, 1.0, 2.0, 0, 0, 1);
+ TEST_CMP (_COM_CMPLEd, 1.0, 2.0, 1, 1, 0);
+ TEST_CMP (_COM_CMPGEd, 1.0, 2.0, 0, 1, 1);
+ TEST_CMP (_COM_CMPEQd, 1.0, 2.0, 0, 1, 0);
+ TEST_CMP (_COM_CMPNEd, 1.0, 2.0, 1, 0, 1);
+
+#ifdef DEBUG
+ printf ("Tests finished\n");
+#endif
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.target/rx/rx.exp b/gcc/testsuite/gcc.target/rx/rx.exp
new file mode 100644
index 00000000000..aa516e4555d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/rx/rx.exp
@@ -0,0 +1,43 @@
+# Copyright (C) 2008 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Exit immediately if this isn't the right target.
+if { ![istarget rx-*-*] } then {
+ return
+}
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS ""
+}
+
+# Initialize `dg'.
+dg-init
+
+# Find all tests
+set tests [lsort [find $srcdir/$subdir *.\[cS\]]]
+
+# Main loop.
+gcc-dg-runtest $tests $DEFAULT_CFLAGS
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/gcc.target/rx/zero-width-bitfield.c b/gcc/testsuite/gcc.target/rx/zero-width-bitfield.c
new file mode 100644
index 00000000000..26cf5a2b542
--- /dev/null
+++ b/gcc/testsuite/gcc.target/rx/zero-width-bitfield.c
@@ -0,0 +1,32 @@
+/* { dg-do run { xfail rx-*-* } } */
+/* { dg-skip-if "skipped until patch for generic zero=width bit-field handling is accepted" { rx-*-* } { "*" } { "" } } */
+/* { dg-options "-msim" } */
+/* Note: The -msim abiove is actually there to override the default
+ options which do not allow the GCC extension of zero-width bitfields. */
+
+extern void abort (void);
+extern void exit (int);
+
+struct S_zero
+{
+ int f1: 4;
+ int f2: 0;
+ short f3: 4;
+} S_zero;
+
+struct S_norm
+{
+ int f1: 4;
+ short f3: 4;
+} S_norm;
+
+
+int
+main (void)
+{
+ if (sizeof (S_zero) != 4 || sizeof (S_norm) != 8)
+ abort ();
+
+ exit (0);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/spu/ea/cache1.c b/gcc/testsuite/gcc.target/spu/ea/cache1.c
new file mode 100644
index 00000000000..3487ce9806b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/spu/ea/cache1.c
@@ -0,0 +1,195 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+
+ This file is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at your option)
+ any later version.
+
+ This file 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 file; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target "ealib" } */
+
+#include <stdlib.h>
+#include <string.h>
+#include <ea.h>
+#include <spu_cache.h>
+
+#ifdef __EA64__
+#define addr unsigned long long
+#else
+#define addr unsigned long
+#endif
+
+static __ea void *bigblock;
+static __ea void *block;
+static int *ls_block;
+
+extern char __cache_tag_array_size[];
+#define CACHE_SIZE (4 * (int) &__cache_tag_array_size[0])
+#define LINE_SIZE ((addr)128)
+
+void
+init_mem (void)
+{
+ bigblock = malloc_ea (CACHE_SIZE + 2 * LINE_SIZE);
+ block = malloc_ea (2 * LINE_SIZE);
+ ls_block = malloc (LINE_SIZE);
+
+ memset_ea (bigblock, 0, CACHE_SIZE + 2 * LINE_SIZE);
+ memset_ea (block, -1, 2 * LINE_SIZE);
+ memset (ls_block, -1, LINE_SIZE);
+ cache_flush ();
+}
+
+/* Test 1: Simple cache fetching. */
+void
+test1 (void)
+{
+ addr aligned = ((((addr) block) + LINE_SIZE - 1) & -LINE_SIZE);
+ int *p1 = NULL;
+ int *p2 = NULL;
+ int i = 0;
+
+ /* First, check if the same addr give the same cache ptr. */
+ p1 = cache_fetch ((__ea void *) aligned);
+ p2 = cache_fetch ((__ea void *) aligned);
+
+ if (p1 != p2)
+ abort ();
+
+ /* Check that the data actually is in the cache. */
+ for (i = 0; i < LINE_SIZE / sizeof (int); i++)
+ {
+ if (p1[i] != -1)
+ abort ();
+ }
+
+ /* Check returning within the cache line. */
+ p2 = cache_fetch ((__ea void *) (aligned + sizeof (int)));
+
+ if (p2 - p1 != 1)
+ abort ();
+
+ /* Finally, check that fetching an LS pointer returns that pointer. */
+ p1 = cache_fetch ((__ea char *) ls_block);
+ if (p1 != ls_block)
+ abort ();
+}
+
+/* Test 2: Eviction testing. */
+void
+test2 (void)
+{
+ addr aligned = ((((addr) block) + LINE_SIZE - 1) & -LINE_SIZE);
+ int *p = NULL;
+ int i = 0;
+
+ /* First check that clean evictions don't write back. */
+ p = cache_fetch ((__ea void *) aligned);
+ for (i = 0; i < LINE_SIZE / sizeof (int); i++)
+ p[i] = 0;
+
+ cache_evict ((__ea void *) aligned);
+ memcpy_ea ((__ea char *) ls_block, (__ea void *) aligned, LINE_SIZE);
+
+ for (i = 0; i < LINE_SIZE / sizeof (int); i++)
+ {
+ if (ls_block[i] == 0)
+ abort ();
+ }
+
+ /* Now check that dirty evictions do write back. */
+ p = cache_fetch_dirty ((__ea void *) aligned, LINE_SIZE);
+ for (i = 0; i < LINE_SIZE / sizeof (int); i++)
+ p[i] = 0;
+
+ cache_evict ((__ea void *) aligned);
+ memcpy_ea ((__ea char *) ls_block, (__ea void *) aligned, LINE_SIZE);
+
+ for (i = 0; i < LINE_SIZE / sizeof (int); i++)
+ {
+ if (ls_block[i] != 0)
+ abort ();
+ }
+
+ /* Finally, check that non-atomic writeback only writes dirty bytes. */
+
+ for (i = 0; i < LINE_SIZE / sizeof (int); i++)
+ {
+ p = cache_fetch_dirty ((__ea void *) (aligned + i * sizeof (int)),
+ (i % 2) * sizeof (int));
+ p[0] = -1;
+ }
+
+ cache_evict ((__ea void *) aligned);
+ memcpy_ea ((__ea char *) ls_block, (__ea void *) aligned, LINE_SIZE);
+
+ for (i = 0; i < LINE_SIZE / sizeof (int); i++)
+ {
+ if ((ls_block[i] == -1) && (i % 2 == 0))
+ abort ();
+ if ((ls_block[i] == 0) && (i % 2 == 1))
+ abort ();
+ }
+}
+
+/* Test LS forced-eviction. */
+void
+test3 (void)
+{
+ addr aligned = ((((addr) bigblock) + LINE_SIZE - 1) & -LINE_SIZE);
+ char *test = NULL;
+ char *ls = NULL;
+ int i = 0;
+
+ /* Init memory, fill the cache to capacity. */
+ ls = cache_fetch_dirty ((__ea void *) aligned, LINE_SIZE);
+ for (i = 1; i < (CACHE_SIZE / LINE_SIZE); i++)
+ cache_fetch_dirty ((__ea void *) (aligned + i * LINE_SIZE), LINE_SIZE);
+
+ memset (ls, -1, LINE_SIZE);
+ test = cache_fetch ((__ea void *) (aligned + CACHE_SIZE));
+
+ /* test == ls indicates cache collision. */
+ if (test != ls)
+ abort ();
+
+ /* Make sure it actually wrote the cache line. */
+ for (i = 0; i < LINE_SIZE; i++)
+ {
+ if (ls[i] != 0)
+ abort ();
+ }
+
+ ls = cache_fetch ((__ea void *) aligned);
+
+ /* test != ls indicates another entry was evicted. */
+ if (test == ls)
+ abort ();
+
+ /* Make sure that the previous eviction actually wrote back. */
+ for (i = 0; i < LINE_SIZE; i++)
+ {
+ if (ls[i] != 0xFF)
+ abort ();
+ }
+}
+
+int
+main (int argc, char **argv)
+{
+ init_mem ();
+ test1 ();
+ test2 ();
+ test3 ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/spu/ea/cast1.c b/gcc/testsuite/gcc.target/spu/ea/cast1.c
new file mode 100644
index 00000000000..9ec4e154630
--- /dev/null
+++ b/gcc/testsuite/gcc.target/spu/ea/cast1.c
@@ -0,0 +1,43 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+
+ This file is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at your option)
+ any later version.
+
+ This file 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 file; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+/* { dg-do run } */
+
+extern void abort (void);
+extern unsigned long long __ea_local_store;
+
+__ea int *ppu;
+int x, *spu = &x, *spu2;
+
+int
+main (int argc, char **argv)
+{
+ ppu = (__ea int *) spu;
+ spu2 = (int *) ppu;
+
+#ifdef __EA32__
+ if ((int) ppu != (int) __ea_local_store + (int) spu)
+#else
+ if ((unsigned long long) ppu != __ea_local_store + (unsigned long long)(int) spu)
+#endif
+
+ abort ();
+
+ if (spu != spu2)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/spu/ea/cast2.c b/gcc/testsuite/gcc.target/spu/ea/cast2.c
new file mode 100644
index 00000000000..6ce57dc4da7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/spu/ea/cast2.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+
+ This file is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at your option)
+ any later version.
+
+ This file 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 file; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+/* { dg-do run } */
+
+extern void abort (void);
+
+int array[128];
+
+__ea int *ea;
+int *lm;
+
+void verify_ea (void) __attribute__ ((noinline));
+void
+verify_ea (void)
+{
+ if (ea != (__ea int *)lm)
+ abort ();
+}
+
+void verify_lm (void) __attribute__ ((noinline));
+void
+verify_lm (void)
+{
+ if ((int *)ea != lm)
+ abort ();
+}
+
+void verify_diff (int x) __attribute__ ((noinline));
+void
+verify_diff (int x)
+{
+ if (ea - lm != x)
+ abort ();
+}
+
+int
+main (int argc, char **argv)
+{
+ ea = 0;
+ lm = 0;
+ verify_ea ();
+ verify_lm ();
+ verify_diff (0);
+
+ ea = &array[64];
+ lm = &array[64];
+ verify_ea ();
+ verify_lm ();
+ verify_diff (0);
+
+ ea = &array[0];
+ lm = &array[64];
+ verify_diff (-64);
+
+ ea = &array[64];
+ lm = &array[0];
+ verify_diff (64);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/spu/ea/compile1.c b/gcc/testsuite/gcc.target/spu/ea/compile1.c
new file mode 100644
index 00000000000..ee7a32ad29b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/spu/ea/compile1.c
@@ -0,0 +1,109 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+
+ This file is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at your option)
+ any later version.
+
+ This file 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 file; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+/* Valid __ea declarations. */
+
+/* { dg-do compile } */
+
+/* Typedefs. */
+typedef __ea int ea_int_t;
+typedef __ea int *ea_int_star_t;
+typedef int outer_t;
+
+/* Externs. */
+
+__ea extern int i1;
+extern __ea int i2;
+extern int __ea i3;
+extern __ea ea_int_t i4; /* __ea qualifier permitted via typedef. */
+extern int __ea __ea __ea dupe; /* __ea duplicate permitted directly. */
+extern int __ea *ppu;
+
+/* Pointers. */
+__ea int *i4p;
+
+/* Structs. */
+struct st {
+ __ea int *p;
+};
+
+/* Variable definitions. */
+__ea int ii0;
+int *__ea ii1;
+static int __ea ii2;
+
+void
+f1 ()
+{
+ int *spu;
+ ppu = (ea_int_t *) spu;
+ ppu = (ea_int_star_t) spu;
+}
+
+void
+f2 ()
+{
+ int *spu;
+ spu = (int *) ppu;
+ ppu = (__ea int *) spu;
+}
+
+void
+f3 ()
+{
+ int i = sizeof (__ea int);
+}
+
+__ea int *f4 (void)
+{
+ return 0;
+}
+
+int f5 (__ea int *parm)
+{
+ static __ea int local4;
+ int tmp = local4;
+ local4 = *parm;
+ return tmp;
+}
+
+static inline __ea void *f6 (__ea void *start)
+{
+ return 0;
+}
+
+void f7 (void)
+{
+ __ea void *s1;
+ auto __ea void *s2;
+}
+
+__ea int *f8 (__ea int *x)
+{
+ register __ea int *y = x;
+ __ea int *z = y;
+ return z;
+}
+
+long long f9 (__ea long long x[2])
+{
+ return x[0] + x[1];
+}
+
+void f10 ()
+{
+ static __ea outer_t o;
+}
diff --git a/gcc/testsuite/gcc.target/spu/ea/compile2.c b/gcc/testsuite/gcc.target/spu/ea/compile2.c
new file mode 100644
index 00000000000..58e64890e67
--- /dev/null
+++ b/gcc/testsuite/gcc.target/spu/ea/compile2.c
@@ -0,0 +1,43 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+
+ This file is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at your option)
+ any later version.
+
+ This file 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 file; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+/* Make sure __ea structure references work. */
+
+/* { dg-do compile } */
+
+typedef unsigned long int uintptr_t;
+
+struct tostruct
+{
+ uintptr_t selfpc;
+ long count;
+ unsigned short link;
+};
+
+/* froms are indexing tos */
+static __ea unsigned short *froms;
+static __ea struct tostruct *tos = 0;
+
+void
+foo (uintptr_t frompc, uintptr_t selfpc)
+{
+ __ea unsigned short *frompcindex;
+
+ frompcindex = &froms[(frompc) / (4 * sizeof (*froms))];
+ *frompcindex = tos[0].link;
+
+ return;
+}
diff --git a/gcc/testsuite/gcc.target/spu/ea/cppdefine.c b/gcc/testsuite/gcc.target/spu/ea/cppdefine.c
new file mode 100644
index 00000000000..583635734b5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/spu/ea/cppdefine.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+
+ This file is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at your option)
+ any later version.
+
+ This file 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 file; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+/* Test default __EA32__/__EA64__ define. */
+
+/* { dg-do compile } */
+
+#if !defined (__EA32__) && !defined (__EA64__)
+#error both __EA32__ and __EA64__ undefined
+#endif
+
+#if defined (__EA32__) && defined (__EA64__)
+#error both __EA32__ and __EA64__ defined
+#endif
+
+#ifdef __EA32__
+int x [ sizeof (__ea char *) == 4 ? 1 : -1 ];
+#endif
+
+#ifdef __EA64__
+int x [ sizeof (__ea char *) == 8 ? 1 : -1 ];
+#endif
+
diff --git a/gcc/testsuite/gcc.target/spu/ea/ea.exp b/gcc/testsuite/gcc.target/spu/ea/ea.exp
new file mode 100644
index 00000000000..8485d0fc720
--- /dev/null
+++ b/gcc/testsuite/gcc.target/spu/ea/ea.exp
@@ -0,0 +1,54 @@
+# Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Exit immediately if this isn't a SPU target.
+if { ![istarget spu-*-*] } then {
+ return
+}
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# Return 1 if target __ea library functions are available
+proc check_effective_target_ealib { } {
+ return [check_no_compiler_messages ealib executable {
+ #include <ea.h>
+ int main (void)
+ {
+ __ea void *ptr = malloc_ea (1024);
+ return 0;
+ }
+ }]
+}
+
+# If a testcase doesn't have special options, use these.
+# We do not use the global DEFAULT_CFLAGS as all test cases
+# in this directory use the __ea address space qualifier
+# extension and thus will not compile with -ansi.
+set DEFAULT_EA_CFLAGS "-std=gnu99 -pedantic-errors -O2"
+
+# Initialize `dg'.
+dg-init
+
+# Run all tests in both -mea32 and -mea64 mode.
+set tests [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]]
+dg-runtest $tests "-mea32" $DEFAULT_EA_CFLAGS
+dg-runtest $tests "-mea64" $DEFAULT_EA_CFLAGS
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/gcc.target/spu/ea/errors1.c b/gcc/testsuite/gcc.target/spu/ea/errors1.c
new file mode 100644
index 00000000000..7d0b5a11ca9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/spu/ea/errors1.c
@@ -0,0 +1,67 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+
+ This file is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at your option)
+ any later version.
+
+ This file 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 file; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+/* Invalid __ea declarations. */
+
+/* { dg-do compile } */
+
+typedef __ea int eaint;
+
+void func ()
+{
+ register __ea int local1; /* { dg-error "'__ea' combined with 'register' qualifier for 'local1'" } */
+ auto __ea int local2; /* { dg-error "'__ea' combined with 'auto' qualifier for 'local2'" } */
+ __ea int local3; /* { dg-error "'__ea' specified for auto variable 'local3'" } */
+ register int *__ea p1; /* { dg-error "'__ea' combined with 'register' qualifier for 'p1'" } */
+ auto char *__ea p2; /* { dg-error "'__ea' combined with 'auto' qualifier for 'p2'" } */
+ void *__ea p3; /* { dg-error "'__ea' specified for auto variable 'p3'" } */
+ register __ea int a1[2]; /* { dg-error "'__ea' combined with 'register' qualifier for 'a1'" } */
+ auto __ea char a2[1]; /* { dg-error "'__ea' combined with 'auto' qualifier for 'a2'" } */
+ __ea char a3[5]; /* { dg-error "'__ea' specified for auto variable 'a3'" } */
+ register eaint td1; /* { dg-error "'__ea' combined with 'register' qualifier for 'td1'" } */
+ auto eaint td2; /* { dg-error "'__ea' combined with 'auto' qualifier for 'td2'" } */
+ eaint td3; /* { dg-error "'__ea' specified for auto variable 'td3'" } */
+}
+
+void func2 (__ea int x) /* { dg-error "'__ea' specified for parameter 'x'" } */
+{ }
+
+void func2td (eaint x) /* { dg-error "'__ea' specified for parameter 'x'" } */
+{ }
+
+struct st {
+ __ea int x; /* { dg-error "'__ea' specified for structure field 'x'" } */
+ eaint td; /* { dg-error "'__ea' specified for structure field 'td'" } */
+ int *__ea q; /* { dg-error "'__ea' specified for structure field 'q'" } */
+ int __ea b : 7; /* { dg-error "'__ea' specified for structure field 'b'" } */
+ int __ea : 1; /* { dg-error "'__ea' specified for structure field" } */
+} s;
+
+struct A { int a; };
+
+int func3 (int *__ea); /* { dg-error "'__ea' specified for unnamed parameter" } */
+int func3 (int *__ea x) /* { dg-error "'__ea' specified for parameter 'x'" } */
+{
+ struct A i = (__ea struct A) { 1 }; /* { dg-error "compound literal qualified by address-space qualifier" } */
+ return i.a;
+}
+
+extern __ea int ea_var; /* { dg-message "note: previous declaration of 'ea_var' was here" } */
+int ea_var; /* { dg-error "conflicting named address spaces \\(generic vs __ea\\) for 'ea_var'" } */
+
+extern eaint ea_var_td; /* { dg-message "note: previous declaration of 'ea_var_td' was here" } */
+int ea_var_td; /* { dg-error "conflicting named address spaces \\(generic vs __ea\\) for 'ea_var_td'" } */
+
diff --git a/gcc/testsuite/gcc.target/spu/ea/errors2.c b/gcc/testsuite/gcc.target/spu/ea/errors2.c
new file mode 100644
index 00000000000..74a32ff5e7e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/spu/ea/errors2.c
@@ -0,0 +1,107 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+
+ This file is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at your option)
+ any later version.
+
+ This file 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 file; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+/* Invalid __ea declarations. */
+
+/* { dg-do compile } */
+
+__ea char ea_str[] = "abc";
+char lm_str[] = "abc";
+
+__ea char *lm_ea_ptr1 = "abc"; /* { dg-error "initializer element is not computable at load time" } */
+__ea char *lm_ea_ptr2 = (__ea char *)"abc"; /* { dg-error "initializer element is not constant" } */
+__ea char *lm_ea_ptr3 = ea_str;
+__ea char *lm_ea_ptr4 = (__ea char *)ea_str;
+__ea char *lm_ea_ptr5 = lm_str; /* { dg-error "initializer element is not computable at load time" } */
+__ea char *lm_ea_ptr6 = (__ea char *)lm_str; /* { dg-error "initializer element is not constant" } */
+
+__ea char * __ea ea_ea_ptr1 = ea_str;
+__ea char * __ea ea_ea_ptr2 = (__ea char *)ea_str;
+
+char * __ea ea_lm_ptr1 = lm_str;
+char * __ea ea_lm_ptr2 = (char *)lm_str;
+
+struct foo {
+ int first;
+ __ea char *ptr;
+ int last;
+};
+
+__ea struct foo ea_struct1 = {
+ 10,
+ (__ea char *)0,
+ 11,
+};
+
+__ea struct foo ea_struct2 = {
+ 20,
+ 0,
+ 21,
+};
+
+struct foo ea_struct3 = {
+ 30,
+ ea_str,
+ 31,
+};
+
+struct foo ea_struct4 = {
+ 40,
+ (__ea char *)lm_str, /* { dg-error "(initializer element is not constant)|(near initialization)" "" } */
+ 41,
+};
+
+struct bar {
+ int first;
+ char *ptr;
+ int last;
+};
+
+__ea struct bar ea_struct5 = {
+ 50,
+ 0,
+ 51,
+};
+
+__ea struct bar ea_struct6 = {
+ 60,
+ (char *)0,
+ 61,
+};
+
+__ea struct bar ea_struct7 = {
+ 70,
+ lm_str,
+ 71,
+};
+
+struct bar lm_struct8 = {
+ 80,
+ 0,
+ 81,
+};
+
+struct bar lm_struct9 = {
+ 90,
+ (char *)0,
+ 91,
+};
+
+struct bar lm_struct10 = {
+ 100,
+ lm_str,
+ 101,
+};
diff --git a/gcc/testsuite/gcc.target/spu/ea/execute1.c b/gcc/testsuite/gcc.target/spu/ea/execute1.c
new file mode 100644
index 00000000000..99d6d691810
--- /dev/null
+++ b/gcc/testsuite/gcc.target/spu/ea/execute1.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+
+ This file is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at your option)
+ any later version.
+
+ This file 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 file; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+/* { dg-do compile } */
+
+#include <stdlib.h>
+
+__ea char str[] = "abc";
+
+int
+main (void)
+{
+ __ea char *p = str;
+
+ if (*p++ != 'a')
+ abort ();
+
+ if (*p++ != 'b')
+ abort ();
+
+ if (*p++ != 'c')
+ abort ();
+
+ if (*p++ != '\0')
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/spu/ea/execute2.c b/gcc/testsuite/gcc.target/spu/ea/execute2.c
new file mode 100644
index 00000000000..5fce4e673ff
--- /dev/null
+++ b/gcc/testsuite/gcc.target/spu/ea/execute2.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+
+ This file is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at your option)
+ any later version.
+
+ This file 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 file; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+/* { dg-do run } */
+
+#include <stdlib.h>
+
+char str[] = "abc";
+
+int
+main (void)
+{
+ __ea char *p = (__ea char *)str;
+
+ if (*p++ != 'a')
+ abort ();
+
+ if (*p++ != 'b')
+ abort ();
+
+ if (*p++ != 'c')
+ abort ();
+
+ if (*p++ != '\0')
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/spu/ea/execute3.c b/gcc/testsuite/gcc.target/spu/ea/execute3.c
new file mode 100644
index 00000000000..1b8c139d7af
--- /dev/null
+++ b/gcc/testsuite/gcc.target/spu/ea/execute3.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+
+ This file is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at your option)
+ any later version.
+
+ This file 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 file; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+/* { dg-do run } */
+
+#include <stdlib.h>
+
+int
+main (void)
+{
+ __ea char *p = (__ea char *)"abc";
+
+ if (*p++ != 'a')
+ abort ();
+
+ if (*p++ != 'b')
+ abort ();
+
+ if (*p++ != 'c')
+ abort ();
+
+ if (*p++ != '\0')
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/spu/ea/ops1.c b/gcc/testsuite/gcc.target/spu/ea/ops1.c
new file mode 100644
index 00000000000..0d162f21820
--- /dev/null
+++ b/gcc/testsuite/gcc.target/spu/ea/ops1.c
@@ -0,0 +1,94 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+
+ This file is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at your option)
+ any later version.
+
+ This file 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 file; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+/* This is the same as ops2.c except for the compile option.
+ If you modify this code, please modify ops2.c as well. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -std=gnu99 -pedantic-errors -maddress-space-conversion" } */
+
+#define __lm
+
+__ea int ea_var = 1;
+__lm int lm_var = 2;
+
+typedef __ea int *ea_ptr_t;
+typedef __lm int *lm_ptr_t;
+
+typedef __ea void *ea_vptr_t;
+typedef __lm void *lm_vptr_t;
+
+ea_ptr_t ea, ea2;
+lm_ptr_t lm, lm2;
+
+ea_vptr_t eav;
+lm_vptr_t lmv;
+
+extern void call_ea (ea_ptr_t);
+extern void call_lm (lm_ptr_t);
+
+/* Assignment, initialization, argument passing, and return. */
+void to_ea (void) { ea = lm; }
+void to_lm (void) { lm = ea; } /* { dg-error "assignment from pointer to non-enclosed address space" } */
+void init_ea (void) { ea_ptr_t l_ea = lm; }
+void init_lm (void) { lm_ptr_t l_lm = ea; } /* { dg-error "initialization from pointer to non-enclosed address space" } */
+ea_ptr_t ret_ea (void) { return lm; }
+lm_ptr_t ret_lm (void) { return ea; } /* { dg-error "return from pointer to non-enclosed address space" } */
+void call_ea2 (void) { call_ea (lm); }
+void call_lm2 (void) { call_lm (ea); } /* { dg-error "passing argument 1 of 'call_lm' from pointer to non-enclosed address space" } */
+
+/* Explicit casts. */
+void to_ea_with_cast (void) { ea = (ea_ptr_t)lm; }
+void to_lm_with_cast (void) { lm = (lm_ptr_t)ea; }
+void init_ea_with_cast (void) { ea_ptr_t l_ea = (ea_ptr_t)lm; }
+void init_lm_with_cast (void) { lm_ptr_t l_lm = (lm_ptr_t)ea; }
+ea_ptr_t ret_ea_with_cast (void) { return (ea_ptr_t)lm; }
+lm_ptr_t ret_lm_with_cast (void) { return (lm_ptr_t)ea; }
+void call_ea2_with_cast (void) { call_ea ((ea_ptr_t)lm); }
+void call_lm2_with_cast (void) { call_lm ((lm_ptr_t)ea); }
+
+/* Arithmetic operators. */
+int sub_eaea (void) { return ea - ea2; }
+int sub_ealm (void) { return ea - lm2; }
+int sub_lmea (void) { return lm - ea2; }
+int sub_lmlm (void) { return lm - lm2; }
+ea_ptr_t if_eaea1 (int test) { return test? ea : ea2; }
+lm_ptr_t if_eaea2 (int test) { return test? ea : ea2; } /* { dg-error "return from pointer to non-enclosed address space" } */
+ea_ptr_t if_ealm1 (int test) { return test? ea : lm2; }
+lm_ptr_t if_ealm2 (int test) { return test? ea : lm2; } /* { dg-error "return from pointer to non-enclosed address space" } */
+ea_ptr_t if_lmea1 (int test) { return test? lm : ea2; }
+lm_ptr_t if_lmea2 (int test) { return test? lm : ea2; } /* { dg-error "return from pointer to non-enclosed address space" } */
+ea_ptr_t if_lmlm1 (int test) { return test? lm : lm2; }
+lm_ptr_t if_lmlm2 (int test) { return test? lm : lm2; }
+
+/* Relational operators. */
+int eq_eaea (void) { return ea == ea2; }
+int eq_ealm (void) { return ea == lm2; }
+int eq_lmea (void) { return lm == ea2; }
+int eq_lmlm (void) { return lm == lm2; }
+int lt_eaea (void) { return ea < ea2; }
+int lt_ealm (void) { return ea < lm2; }
+int lt_lmea (void) { return lm < ea2; }
+int lt_lmlm (void) { return lm < lm2; }
+
+/* Null pointer. */
+void null_ea1 (void) { ea = 0; }
+void null_ea2 (void) { ea = (void *)0; }
+void null_ea3 (void) { ea = (__ea void *)0; }
+void null_lm1 (void) { lm = 0; }
+void null_lm2 (void) { lm = (void *)0; }
+void null_lm3 (void) { lm = (__ea void *)0; } /* { dg-error "assignment from pointer to non-enclosed address space" } */
+
diff --git a/gcc/testsuite/gcc.target/spu/ea/ops2.c b/gcc/testsuite/gcc.target/spu/ea/ops2.c
new file mode 100644
index 00000000000..2514e6b2095
--- /dev/null
+++ b/gcc/testsuite/gcc.target/spu/ea/ops2.c
@@ -0,0 +1,94 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+
+ This file is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at your option)
+ any later version.
+
+ This file 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 file; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+/* This is the same as ops1.c except for the compile option.
+ If you modify this code, please modify ops1.c as well. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -std=gnu99 -pedantic-errors -mno-address-space-conversion" } */
+
+#define __lm
+
+__ea int ea_var = 1;
+__lm int lm_var = 2;
+
+typedef __ea int *ea_ptr_t;
+typedef __lm int *lm_ptr_t;
+
+typedef __ea void *ea_vptr_t;
+typedef __lm void *lm_vptr_t;
+
+ea_ptr_t ea, ea2;
+lm_ptr_t lm, lm2;
+
+ea_vptr_t eav;
+lm_vptr_t lmv;
+
+extern void call_ea (ea_ptr_t);
+extern void call_lm (lm_ptr_t);
+
+/* Assignment, initialization, argument passing, and return. */
+void to_ea (void) { ea = lm; } /* { dg-error "assignment from pointer to non-enclosed address space" } */
+void to_lm (void) { lm = ea; } /* { dg-error "assignment from pointer to non-enclosed address space" } */
+void init_ea (void) { ea_ptr_t l_ea = lm; } /* { dg-error "initialization from pointer to non-enclosed address space" } */
+void init_lm (void) { lm_ptr_t l_lm = ea; } /* { dg-error "initialization from pointer to non-enclosed address space" } */
+ea_ptr_t ret_ea (void) { return lm; } /* { dg-error "return from pointer to non-enclosed address space" } */
+lm_ptr_t ret_lm (void) { return ea; } /* { dg-error "return from pointer to non-enclosed address space" } */
+void call_ea2 (void) { call_ea (lm); } /* { dg-error "passing argument 1 of 'call_ea' from pointer to non-enclosed address space" } */
+void call_lm2 (void) { call_lm (ea); } /* { dg-error "passing argument 1 of 'call_lm' from pointer to non-enclosed address space" } */
+
+/* Explicit casts. */
+void to_ea_with_cast (void) { ea = (ea_ptr_t)lm; } /* { dg-warning "cast to __ea address space pointer" } */
+void to_lm_with_cast (void) { lm = (lm_ptr_t)ea; } /* { dg-warning "cast to generic address space pointer" } */
+void init_ea_with_cast (void) { ea_ptr_t l_ea = (ea_ptr_t)lm; } /* { dg-warning "cast to __ea address space pointer" } */
+void init_lm_with_cast (void) { lm_ptr_t l_lm = (lm_ptr_t)ea; } /* { dg-warning "cast to generic address space pointer" } */
+ea_ptr_t ret_ea_with_cast (void) { return (ea_ptr_t)lm; } /* { dg-warning "cast to __ea address space pointer" } */
+lm_ptr_t ret_lm_with_cast (void) { return (lm_ptr_t)ea; } /* { dg-warning "cast to generic address space pointer" } */
+void call_ea2_with_cast (void) { call_ea ((ea_ptr_t)lm); } /* { dg-warning "cast to __ea address space pointer" } */
+void call_lm2_with_cast (void) { call_lm ((lm_ptr_t)ea); } /* { dg-warning "cast to generic address space pointer" } */
+
+/* Arithmetic operators. */
+int sub_eaea (void) { return ea - ea2; }
+int sub_ealm (void) { return ea - lm2; } /* { dg-error "invalid operands to binary -" } */
+int sub_lmea (void) { return lm - ea2; } /* { dg-error "invalid operands to binary -" } */
+int sub_lmlm (void) { return lm - lm2; }
+ea_ptr_t if_eaea1 (int test) { return test? ea : ea2; }
+lm_ptr_t if_eaea2 (int test) { return test? ea : ea2; } /* { dg-error "return from pointer to non-enclosed address space" } */
+ea_ptr_t if_ealm1 (int test) { return test? ea : lm2; } /* { dg-error "pointers to disjoint address spaces used in conditional expression" } */
+lm_ptr_t if_ealm2 (int test) { return test? ea : lm2; } /* { dg-error "pointers to disjoint address spaces used in conditional expression" } */
+ea_ptr_t if_lmea1 (int test) { return test? lm : ea2; } /* { dg-error "pointers to disjoint address spaces used in conditional expression" } */
+lm_ptr_t if_lmea2 (int test) { return test? lm : ea2; } /* { dg-error "pointers to disjoint address spaces used in conditional expression" } */
+ea_ptr_t if_lmlm1 (int test) { return test? lm : lm2; } /* { dg-error "return from pointer to non-enclosed address space" } */
+lm_ptr_t if_lmlm2 (int test) { return test? lm : lm2; }
+
+/* Relational operators. */
+int eq_eaea (void) { return ea == ea2; }
+int eq_ealm (void) { return ea == lm2; } /* { dg-error "comparison of pointers to disjoint address spaces" } */
+int eq_lmea (void) { return lm == ea2; } /* { dg-error "comparison of pointers to disjoint address spaces" } */
+int eq_lmlm (void) { return lm == lm2; }
+int lt_eaea (void) { return ea < ea2; }
+int lt_ealm (void) { return ea < lm2; } /* { dg-error "comparison of pointers to disjoint address spaces" } */
+int lt_lmea (void) { return lm < ea2; } /* { dg-error "comparison of pointers to disjoint address spaces" } */
+int lt_lmlm (void) { return lm < lm2; }
+
+/* Null pointer. */
+void null_ea1 (void) { ea = 0; }
+void null_ea2 (void) { ea = (void *)0; }
+void null_ea3 (void) { ea = (__ea void *)0; }
+void null_lm1 (void) { lm = 0; }
+void null_lm2 (void) { lm = (void *)0; }
+void null_lm3 (void) { lm = (__ea void *)0; } /* { dg-error "assignment from pointer to non-enclosed address space" } */
+
diff --git a/gcc/testsuite/gcc.target/spu/ea/options1.c b/gcc/testsuite/gcc.target/spu/ea/options1.c
new file mode 100644
index 00000000000..19040090206
--- /dev/null
+++ b/gcc/testsuite/gcc.target/spu/ea/options1.c
@@ -0,0 +1,22 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+
+ This file is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at your option)
+ any later version.
+
+ This file 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 file; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+/* Test -mcache-size. */
+
+/* { dg-do compile } */
+/* { dg-options "-mcache-size=128" } */
+
+int x;
diff --git a/gcc/testsuite/gcc.target/spu/ea/pr41857.c b/gcc/testsuite/gcc.target/spu/ea/pr41857.c
new file mode 100644
index 00000000000..17710674cf6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/spu/ea/pr41857.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+
+ This file is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at your option)
+ any later version.
+
+ This file 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 file; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+/* { dg-do compile } */
+
+__ea char *strchr_ea (__ea const char *s, int c);
+__ea char *foo (__ea char *s)
+{
+ __ea char *ret = s;
+ int i;
+
+ for (i = 0; i < 3; i++)
+ ret = strchr_ea (ret, s[i]);
+
+ return ret;
+}
diff --git a/gcc/testsuite/gcc.target/spu/ea/test-sizes.c b/gcc/testsuite/gcc.target/spu/ea/test-sizes.c
new file mode 100644
index 00000000000..e467616b628
--- /dev/null
+++ b/gcc/testsuite/gcc.target/spu/ea/test-sizes.c
@@ -0,0 +1,608 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+
+ This file is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at your option)
+ any later version.
+
+ This file 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 file; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+/* { dg-do run } */
+
+#ifdef __EA32__
+#define EA_PTRSIZE 4
+#endif
+#ifdef __EA64__
+#define EA_PTRSIZE 8
+#endif
+
+#if !defined(LEVEL1) && !defined(LEVEL2) && !defined(LEVEL3)
+#define LEVEL1 1 /* single pointer indirection */
+#define LEVEL2 1 /* 2 levels of pointer indirection */
+#define LEVEL3 1 /* 3 levels of pointer indirection */
+
+#else
+#ifndef LEVEL1
+#define LEVEL1 0
+#endif
+
+#ifndef LEVEL2
+#define LEVEL2 0
+#endif
+
+#ifndef LEVEL3
+#define LEVEL3 0
+#endif
+#endif
+
+#if !defined(USE_SIMPLE) && !defined(USE_COMPLEX)
+#define USE_SIMPLE 1 /* build up pointers via multiple typedefs */
+#define USE_COMPLEX 1 /* single typedef for pointer indirections */
+
+#else
+#ifndef USE_SIMPLE
+#define USE_SIMPLE 0
+#endif
+
+#ifndef USE_COMPLEX
+#define USE_COMPLEX 0
+#endif
+#endif
+
+#if !defined(USE_LOCAL_VAR) && !defined(USE_EA_VAR)
+#define USE_LOCAL_VAR 1 /* use variables declared locally */
+#define USE_EA_VAR 1 /* use variables on the host */
+
+#else
+#ifndef USE_LOCAL_VAR
+#define USE_LOCAL_VAR 0
+#endif
+
+#ifndef USE_EA_VAR
+#define USE_EA_VAR 0
+#endif
+#endif
+
+static int errors;
+
+#ifdef USE_PRINTF /* print results via printf */
+#include <stdio.h>
+#include <stdlib.h>
+
+static int num_tests;
+
+#define TEST_SIZE(EXPR, EXPECTED) \
+do { \
+ char *msg; \
+ \
+ if (sizeof (EXPR) != EXPECTED) \
+ { \
+ msg = ", FAIL"; \
+ errors++; \
+ } \
+ else \
+ msg = ""; \
+ \
+ num_tests++; \
+ printf ("sizeof %-20s = %2u, expected = %2u%s\n", \
+ #EXPR, \
+ (unsigned) sizeof (EXPR), \
+ (unsigned) EXPECTED, \
+ msg); \
+} while (0)
+
+#define PRINT1(FMT) printf (FMT)
+#define PRINT2(FMT,A1) printf (FMT,A1)
+#define PRINT3(FMT,A1,A2) printf (FMT,A1,A2)
+
+#else /* standalone */
+extern void abort (void);
+
+#define TEST_SIZE(EXPR, EXPECTED) \
+do { \
+ if (sizeof (EXPR) != EXPECTED) \
+ abort (); \
+} while (0)
+
+#define PRINT1(FMT)
+#define PRINT2(FMT,ARG)
+#define PRINT3(FMT,A1,A2)
+#endif
+
+/* 'local memory' hack to keep the same spacing. */
+#define __lm
+
+#if USE_SIMPLE
+#if (LEVEL1 || LEVEL2 || LEVEL3)
+typedef __lm char *lm_ptr_t;
+typedef __ea char *ea_ptr_t;
+#endif
+
+#if LEVEL1
+#if USE_LOCAL_VAR
+__lm lm_ptr_t lm_ptr;
+__lm ea_ptr_t ea_ptr;
+#endif
+
+#if USE_EA_VAR
+__ea lm_ptr_t lm_ptr_ea;
+__ea ea_ptr_t ea_ptr_ea;
+#endif
+#endif
+
+#if (LEVEL2 || LEVEL3)
+typedef __lm lm_ptr_t *lm_lm_ptr_t;
+typedef __ea lm_ptr_t *ea_lm_ptr_t;
+typedef __lm ea_ptr_t *lm_ea_ptr_t;
+typedef __ea ea_ptr_t *ea_ea_ptr_t;
+#endif
+
+#if LEVEL2
+#if USE_LOCAL_VAR
+__lm lm_lm_ptr_t lm_lm_ptr;
+__lm ea_lm_ptr_t ea_lm_ptr;
+__lm lm_ea_ptr_t lm_ea_ptr;
+__lm ea_ea_ptr_t ea_ea_ptr;
+#endif
+
+#if USE_EA_VAR
+__ea lm_lm_ptr_t lm_lm_ptr_ea;
+__ea ea_lm_ptr_t ea_lm_ptr_ea;
+__ea lm_ea_ptr_t lm_ea_ptr_ea;
+__ea ea_ea_ptr_t ea_ea_ptr_ea;
+#endif
+#endif
+
+#if LEVEL3
+typedef __lm lm_lm_ptr_t *lm_lm_lm_ptr_t;
+typedef __ea lm_lm_ptr_t *ea_lm_lm_ptr_t;
+typedef __lm ea_lm_ptr_t *lm_ea_lm_ptr_t;
+typedef __ea ea_lm_ptr_t *ea_ea_lm_ptr_t;
+typedef __lm lm_ea_ptr_t *lm_lm_ea_ptr_t;
+typedef __ea lm_ea_ptr_t *ea_lm_ea_ptr_t;
+typedef __lm ea_ea_ptr_t *lm_ea_ea_ptr_t;
+typedef __ea ea_ea_ptr_t *ea_ea_ea_ptr_t;
+
+#if USE_LOCAL_VAR
+__lm lm_lm_lm_ptr_t lm_lm_lm_ptr;
+__lm ea_lm_lm_ptr_t ea_lm_lm_ptr;
+__lm lm_ea_lm_ptr_t lm_ea_lm_ptr;
+__lm ea_ea_lm_ptr_t ea_ea_lm_ptr;
+__lm lm_lm_ea_ptr_t lm_lm_ea_ptr;
+__lm ea_lm_ea_ptr_t ea_lm_ea_ptr;
+__lm lm_ea_ea_ptr_t lm_ea_ea_ptr;
+__lm ea_ea_ea_ptr_t ea_ea_ea_ptr;
+#endif
+
+#if USE_EA_VAR
+__ea lm_lm_lm_ptr_t lm_lm_lm_ptr_ea;
+__ea ea_lm_lm_ptr_t ea_lm_lm_ptr_ea;
+__ea lm_ea_lm_ptr_t lm_ea_lm_ptr_ea;
+__ea ea_ea_lm_ptr_t ea_ea_lm_ptr_ea;
+__ea lm_lm_ea_ptr_t lm_lm_ea_ptr_ea;
+__ea ea_lm_ea_ptr_t ea_lm_ea_ptr_ea;
+__ea lm_ea_ea_ptr_t lm_ea_ea_ptr_ea;
+__ea ea_ea_ea_ptr_t ea_ea_ea_ptr_ea;
+#endif
+#endif
+#endif
+
+#if USE_COMPLEX
+#if LEVEL1
+#if USE_LOCAL_VAR
+__lm char *__lm lm_cptr;
+__ea char *__lm ea_cptr;
+#endif
+
+#if USE_EA_VAR
+__lm char *__ea lm_cptr_ea;
+__ea char *__ea ea_cptr_ea;
+#endif
+#endif
+
+#if LEVEL2
+#if USE_LOCAL_VAR
+__lm char *__lm *__lm lm_lm_cptr;
+__lm char *__ea *__lm ea_lm_cptr;
+__ea char *__lm *__lm lm_ea_cptr;
+__ea char *__ea *__lm ea_ea_cptr;
+#endif
+
+#if USE_EA_VAR
+__lm char *__lm *__ea lm_lm_cptr_ea;
+__lm char *__ea *__ea ea_lm_cptr_ea;
+__ea char *__lm *__ea lm_ea_cptr_ea;
+__ea char *__ea *__ea ea_ea_cptr_ea;
+#endif
+#endif
+
+#if LEVEL3
+#if USE_LOCAL_VAR
+__lm char *__lm *__lm *__lm lm_lm_lm_cptr;
+__lm char *__ea *__lm *__lm lm_ea_lm_cptr;
+__ea char *__lm *__lm *__lm lm_lm_ea_cptr;
+__ea char *__ea *__lm *__lm lm_ea_ea_cptr;
+__lm char *__lm *__ea *__lm ea_lm_lm_cptr;
+__lm char *__ea *__ea *__lm ea_ea_lm_cptr;
+__ea char *__lm *__ea *__lm ea_lm_ea_cptr;
+__ea char *__ea *__ea *__lm ea_ea_ea_cptr;
+#endif
+
+#if USE_EA_VAR
+__lm char *__lm *__lm *__ea lm_lm_lm_cptr_ea;
+__lm char *__ea *__lm *__ea lm_ea_lm_cptr_ea;
+__ea char *__lm *__lm *__ea lm_lm_ea_cptr_ea;
+__ea char *__ea *__lm *__ea lm_ea_ea_cptr_ea;
+__lm char *__lm *__ea *__ea ea_lm_lm_cptr_ea;
+__lm char *__ea *__ea *__ea ea_ea_lm_cptr_ea;
+__ea char *__lm *__ea *__ea ea_lm_ea_cptr_ea;
+__ea char *__ea *__ea *__ea ea_ea_ea_cptr_ea;
+#endif
+#endif
+#endif
+
+int
+main ()
+{
+ PRINT2 ("LEVEL1 = %d\n", LEVEL1);
+ PRINT2 ("LEVEL2 = %d\n", LEVEL2);
+ PRINT2 ("LEVEL3 = %d\n", LEVEL3);
+ PRINT2 ("USE_SIMPLE = %d\n", USE_SIMPLE);
+ PRINT2 ("USE_COMPLEX = %d\n", USE_COMPLEX);
+ PRINT2 ("USE_LOCAL_VAR = %d\n", USE_LOCAL_VAR);
+ PRINT2 ("USE_EA_VAR = %d\n", USE_EA_VAR);
+ PRINT1 ("\n");
+
+#if USE_SIMPLE
+#if LEVEL1
+#if USE_LOCAL_VAR
+ TEST_SIZE ( lm_ptr, 4);
+ TEST_SIZE (*lm_ptr, 1);
+ TEST_SIZE ( ea_ptr, EA_PTRSIZE);
+ TEST_SIZE (*ea_ptr, 1);
+ PRINT1 ("\n");
+#endif
+
+#if USE_EA_VAR
+ TEST_SIZE ( lm_ptr_ea, 4);
+ TEST_SIZE (*lm_ptr_ea, 1);
+ TEST_SIZE ( ea_ptr_ea, EA_PTRSIZE);
+ TEST_SIZE (*ea_ptr_ea, 1);
+ PRINT1 ("\n");
+#endif
+#endif
+
+#if LEVEL2
+#if USE_LOCAL_VAR
+ TEST_SIZE ( lm_lm_ptr, 4);
+ TEST_SIZE ( *lm_lm_ptr, 4);
+ TEST_SIZE (**lm_lm_ptr, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( lm_ea_ptr, 4);
+ TEST_SIZE ( *lm_ea_ptr, EA_PTRSIZE);
+ TEST_SIZE (**lm_ea_ptr, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( ea_lm_ptr, EA_PTRSIZE);
+ TEST_SIZE ( *ea_lm_ptr, 4);
+ TEST_SIZE (**ea_lm_ptr, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( ea_ea_ptr, EA_PTRSIZE);
+ TEST_SIZE ( *ea_ea_ptr, EA_PTRSIZE);
+ TEST_SIZE (**ea_ea_ptr, 1);
+ PRINT1 ("\n");
+#endif
+
+#if USE_EA_VAR
+ TEST_SIZE ( lm_lm_ptr_ea, 4);
+ TEST_SIZE ( *lm_lm_ptr_ea, 4);
+ TEST_SIZE (**lm_lm_ptr_ea, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( lm_ea_ptr_ea, 4);
+ TEST_SIZE ( *lm_ea_ptr_ea, EA_PTRSIZE);
+ TEST_SIZE (**lm_ea_ptr_ea, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( ea_lm_ptr_ea, EA_PTRSIZE);
+ TEST_SIZE ( *ea_lm_ptr_ea, 4);
+ TEST_SIZE (**ea_lm_ptr_ea, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( ea_ea_ptr_ea, EA_PTRSIZE);
+ TEST_SIZE ( *ea_ea_ptr_ea, EA_PTRSIZE);
+ TEST_SIZE (**ea_ea_ptr_ea, 1);
+ PRINT1 ("\n");
+#endif
+#endif
+
+#if LEVEL3
+#if USE_LOCAL_VAR
+ TEST_SIZE ( lm_lm_lm_ptr, 4);
+ TEST_SIZE ( *lm_lm_lm_ptr, 4);
+ TEST_SIZE ( **lm_lm_lm_ptr, 4);
+ TEST_SIZE (***lm_lm_lm_ptr, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( lm_lm_ea_ptr, 4);
+ TEST_SIZE ( *lm_lm_ea_ptr, 4);
+ TEST_SIZE ( **lm_lm_ea_ptr, EA_PTRSIZE);
+ TEST_SIZE (***lm_lm_ea_ptr, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( lm_ea_lm_ptr, 4);
+ TEST_SIZE ( *lm_ea_lm_ptr, EA_PTRSIZE);
+ TEST_SIZE ( **lm_ea_lm_ptr, 4);
+ TEST_SIZE (***lm_ea_lm_ptr, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( lm_ea_ea_ptr, 4);
+ TEST_SIZE ( *lm_ea_ea_ptr, EA_PTRSIZE);
+ TEST_SIZE ( **lm_ea_ea_ptr, EA_PTRSIZE);
+ TEST_SIZE (***lm_ea_ea_ptr, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( ea_lm_lm_ptr, EA_PTRSIZE);
+ TEST_SIZE ( *ea_lm_lm_ptr, 4);
+ TEST_SIZE ( **ea_lm_lm_ptr, 4);
+ TEST_SIZE (***ea_lm_lm_ptr, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( ea_lm_ea_ptr, EA_PTRSIZE);
+ TEST_SIZE ( *ea_lm_ea_ptr, 4);
+ TEST_SIZE ( **ea_lm_ea_ptr, EA_PTRSIZE);
+ TEST_SIZE (***ea_lm_ea_ptr, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( ea_ea_lm_ptr, EA_PTRSIZE);
+ TEST_SIZE ( *ea_ea_lm_ptr, EA_PTRSIZE);
+ TEST_SIZE ( **ea_ea_lm_ptr, 4);
+ TEST_SIZE (***ea_ea_lm_ptr, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( ea_ea_ea_ptr, EA_PTRSIZE);
+ TEST_SIZE ( *ea_ea_ea_ptr, EA_PTRSIZE);
+ TEST_SIZE ( **ea_ea_ea_ptr, EA_PTRSIZE);
+ TEST_SIZE (***ea_ea_ea_ptr, 1);
+ PRINT1 ("\n");
+#endif
+
+#if USE_EA_VAR
+ TEST_SIZE ( lm_lm_lm_ptr_ea, 4);
+ TEST_SIZE ( *lm_lm_lm_ptr_ea, 4);
+ TEST_SIZE ( **lm_lm_lm_ptr_ea, 4);
+ TEST_SIZE (***lm_lm_lm_ptr_ea, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( lm_lm_ea_ptr_ea, 4);
+ TEST_SIZE ( *lm_lm_ea_ptr_ea, 4);
+ TEST_SIZE ( **lm_lm_ea_ptr_ea, EA_PTRSIZE);
+ TEST_SIZE (***lm_lm_ea_ptr_ea, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( lm_ea_lm_ptr_ea, 4);
+ TEST_SIZE ( *lm_ea_lm_ptr_ea, EA_PTRSIZE);
+ TEST_SIZE ( **lm_ea_lm_ptr_ea, 4);
+ TEST_SIZE (***lm_ea_lm_ptr_ea, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( lm_ea_ea_ptr_ea, 4);
+ TEST_SIZE ( *lm_ea_ea_ptr_ea, EA_PTRSIZE);
+ TEST_SIZE ( **lm_ea_ea_ptr_ea, EA_PTRSIZE);
+ TEST_SIZE (***lm_ea_ea_ptr_ea, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( ea_lm_lm_ptr_ea, EA_PTRSIZE);
+ TEST_SIZE ( *ea_lm_lm_ptr_ea, 4);
+ TEST_SIZE ( **ea_lm_lm_ptr_ea, 4);
+ TEST_SIZE (***ea_lm_lm_ptr_ea, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( ea_lm_ea_ptr_ea, EA_PTRSIZE);
+ TEST_SIZE ( *ea_lm_ea_ptr_ea, 4);
+ TEST_SIZE ( **ea_lm_ea_ptr_ea, EA_PTRSIZE);
+ TEST_SIZE (***ea_lm_ea_ptr_ea, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( ea_ea_lm_ptr_ea, EA_PTRSIZE);
+ TEST_SIZE ( *ea_ea_lm_ptr_ea, EA_PTRSIZE);
+ TEST_SIZE ( **ea_ea_lm_ptr_ea, 4);
+ TEST_SIZE (***ea_ea_lm_ptr_ea, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( ea_ea_ea_ptr_ea, EA_PTRSIZE);
+ TEST_SIZE ( *ea_ea_ea_ptr_ea, EA_PTRSIZE);
+ TEST_SIZE ( **ea_ea_ea_ptr_ea, EA_PTRSIZE);
+ TEST_SIZE (***ea_ea_ea_ptr_ea, 1);
+ PRINT1 ("\n");
+#endif
+#endif
+#endif
+
+#if USE_COMPLEX
+#if LEVEL1
+#if USE_LOCAL_VAR
+ TEST_SIZE ( lm_cptr, 4);
+ TEST_SIZE (*lm_cptr, 1);
+ TEST_SIZE ( ea_cptr, EA_PTRSIZE);
+ TEST_SIZE (*ea_cptr, 1);
+ PRINT1 ("\n");
+#endif
+
+#if USE_EA_VAR
+ TEST_SIZE ( lm_cptr_ea, 4);
+ TEST_SIZE (*lm_cptr_ea, 1);
+ TEST_SIZE ( ea_cptr_ea, EA_PTRSIZE);
+ TEST_SIZE (*ea_cptr_ea, 1);
+ PRINT1 ("\n");
+#endif
+#endif
+
+#if LEVEL2
+#if USE_LOCAL_VAR
+ TEST_SIZE ( lm_lm_cptr, 4);
+ TEST_SIZE ( *lm_lm_cptr, 4);
+ TEST_SIZE (**lm_lm_cptr, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( lm_ea_cptr, 4);
+ TEST_SIZE ( *lm_ea_cptr, EA_PTRSIZE);
+ TEST_SIZE (**lm_ea_cptr, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( ea_lm_cptr, EA_PTRSIZE);
+ TEST_SIZE ( *ea_lm_cptr, 4);
+ TEST_SIZE (**ea_lm_cptr, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( ea_ea_cptr, EA_PTRSIZE);
+ TEST_SIZE ( *ea_ea_cptr, EA_PTRSIZE);
+ TEST_SIZE (**ea_ea_cptr, 1);
+ PRINT1 ("\n");
+#endif
+
+#if USE_EA_VAR
+ TEST_SIZE ( lm_lm_cptr_ea, 4);
+ TEST_SIZE ( *lm_lm_cptr_ea, 4);
+ TEST_SIZE (**lm_lm_cptr_ea, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( lm_ea_cptr_ea, 4);
+ TEST_SIZE ( *lm_ea_cptr_ea, EA_PTRSIZE);
+ TEST_SIZE (**lm_ea_cptr_ea, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( ea_lm_cptr_ea, EA_PTRSIZE);
+ TEST_SIZE ( *ea_lm_cptr_ea, 4);
+ TEST_SIZE (**ea_lm_cptr_ea, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( ea_ea_cptr_ea, EA_PTRSIZE);
+ TEST_SIZE ( *ea_ea_cptr_ea, EA_PTRSIZE);
+ TEST_SIZE (**ea_ea_cptr_ea, 1);
+ PRINT1 ("\n");
+#endif
+#endif
+
+#if LEVEL3
+#if USE_LOCAL_VAR
+ TEST_SIZE ( lm_lm_lm_cptr, 4);
+ TEST_SIZE ( *lm_lm_lm_cptr, 4);
+ TEST_SIZE ( **lm_lm_lm_cptr, 4);
+ TEST_SIZE (***lm_lm_lm_cptr, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( lm_lm_ea_cptr, 4);
+ TEST_SIZE ( *lm_lm_ea_cptr, 4);
+ TEST_SIZE ( **lm_lm_ea_cptr, EA_PTRSIZE);
+ TEST_SIZE (***lm_lm_ea_cptr, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( lm_ea_lm_cptr, 4);
+ TEST_SIZE ( *lm_ea_lm_cptr, EA_PTRSIZE);
+ TEST_SIZE ( **lm_ea_lm_cptr, 4);
+ TEST_SIZE (***lm_ea_lm_cptr, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( lm_ea_ea_cptr, 4);
+ TEST_SIZE ( *lm_ea_ea_cptr, EA_PTRSIZE);
+ TEST_SIZE ( **lm_ea_ea_cptr, EA_PTRSIZE);
+ TEST_SIZE (***lm_ea_ea_cptr, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( ea_lm_lm_cptr, EA_PTRSIZE);
+ TEST_SIZE ( *ea_lm_lm_cptr, 4);
+ TEST_SIZE ( **ea_lm_lm_cptr, 4);
+ TEST_SIZE (***ea_lm_lm_cptr, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( ea_lm_ea_cptr, EA_PTRSIZE);
+ TEST_SIZE ( *ea_lm_ea_cptr, 4);
+ TEST_SIZE ( **ea_lm_ea_cptr, EA_PTRSIZE);
+ TEST_SIZE (***ea_lm_ea_cptr, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( ea_ea_lm_cptr, EA_PTRSIZE);
+ TEST_SIZE ( *ea_ea_lm_cptr, EA_PTRSIZE);
+ TEST_SIZE ( **ea_ea_lm_cptr, 4);
+ TEST_SIZE (***ea_ea_lm_cptr, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( ea_ea_ea_cptr, EA_PTRSIZE);
+ TEST_SIZE ( *ea_ea_ea_cptr, EA_PTRSIZE);
+ TEST_SIZE ( **ea_ea_ea_cptr, EA_PTRSIZE);
+ TEST_SIZE (***ea_ea_ea_cptr, 1);
+ PRINT1 ("\n");
+#endif
+
+#if USE_EA_VAR
+ TEST_SIZE ( lm_lm_lm_cptr_ea, 4);
+ TEST_SIZE ( *lm_lm_lm_cptr_ea, 4);
+ TEST_SIZE ( **lm_lm_lm_cptr_ea, 4);
+ TEST_SIZE (***lm_lm_lm_cptr_ea, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( lm_lm_ea_cptr_ea, 4);
+ TEST_SIZE ( *lm_lm_ea_cptr_ea, 4);
+ TEST_SIZE ( **lm_lm_ea_cptr_ea, EA_PTRSIZE);
+ TEST_SIZE (***lm_lm_ea_cptr_ea, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( lm_ea_lm_cptr_ea, 4);
+ TEST_SIZE ( *lm_ea_lm_cptr_ea, EA_PTRSIZE);
+ TEST_SIZE ( **lm_ea_lm_cptr_ea, 4);
+ TEST_SIZE (***lm_ea_lm_cptr_ea, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( lm_ea_ea_cptr_ea, 4);
+ TEST_SIZE ( *lm_ea_ea_cptr_ea, EA_PTRSIZE);
+ TEST_SIZE ( **lm_ea_ea_cptr_ea, EA_PTRSIZE);
+ TEST_SIZE (***lm_ea_ea_cptr_ea, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( ea_lm_lm_cptr_ea, EA_PTRSIZE);
+ TEST_SIZE ( *ea_lm_lm_cptr_ea, 4);
+ TEST_SIZE ( **ea_lm_lm_cptr_ea, 4);
+ TEST_SIZE (***ea_lm_lm_cptr_ea, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( ea_lm_ea_cptr_ea, EA_PTRSIZE);
+ TEST_SIZE ( *ea_lm_ea_cptr_ea, 4);
+ TEST_SIZE ( **ea_lm_ea_cptr_ea, EA_PTRSIZE);
+ TEST_SIZE (***ea_lm_ea_cptr_ea, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( ea_ea_lm_cptr_ea, EA_PTRSIZE);
+ TEST_SIZE ( *ea_ea_lm_cptr_ea, EA_PTRSIZE);
+ TEST_SIZE ( **ea_ea_lm_cptr_ea, 4);
+ TEST_SIZE (***ea_ea_lm_cptr_ea, 1);
+ PRINT1 ("\n");
+
+ TEST_SIZE ( ea_ea_ea_cptr_ea, EA_PTRSIZE);
+ TEST_SIZE ( *ea_ea_ea_cptr_ea, EA_PTRSIZE);
+ TEST_SIZE ( **ea_ea_ea_cptr_ea, EA_PTRSIZE);
+ TEST_SIZE (***ea_ea_ea_cptr_ea, 1);
+ PRINT1 ("\n");
+#endif
+#endif
+#endif
+
+ if (errors)
+ {
+ PRINT3 ("%d error(s), %d test(s)\n", errors, num_tests);
+ abort ();
+ }
+ else
+ PRINT2 ("No errors, %d test(s)\n", num_tests);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gfortran.dg/allocatable_scalar_4.f90 b/gcc/testsuite/gfortran.dg/allocatable_scalar_4.f90
new file mode 100644
index 00000000000..9f7a7a07d70
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/allocatable_scalar_4.f90
@@ -0,0 +1,95 @@
+! { dg-do run }
+!
+! PR fortran/41872
+!
+!
+program test
+ implicit none
+ integer, allocatable :: a
+ integer, allocatable :: b
+ allocate(a)
+ call foo(a)
+ if(.not. allocated(a)) call abort()
+ if (a /= 5) call abort()
+
+ call bar(a)
+ if (a /= 7) call abort()
+
+ deallocate(a)
+ if(allocated(a)) call abort()
+ call check3(a)
+ if(.not. allocated(a)) call abort()
+ if(a /= 6874) call abort()
+ call check4(a)
+ if(.not. allocated(a)) call abort()
+ if(a /= -478) call abort()
+
+ allocate(b)
+ b = 7482
+ call checkOptional(.false.,.true., 7482)
+ if (b /= 7482) call abort()
+ call checkOptional(.true., .true., 7482, b)
+ if (b /= 46) call abort()
+contains
+ subroutine foo(a)
+ integer, allocatable, intent(out) :: a
+ if(allocated(a)) call abort()
+ allocate(a)
+ a = 5
+ end subroutine foo
+
+ subroutine bar(a)
+ integer, allocatable, intent(inout) :: a
+ if(.not. allocated(a)) call abort()
+ if (a /= 5) call abort()
+ a = 7
+ end subroutine bar
+
+ subroutine check3(a)
+ integer, allocatable, intent(inout) :: a
+ if(allocated(a)) call abort()
+ allocate(a)
+ a = 6874
+ end subroutine check3
+
+ subroutine check4(a)
+ integer, allocatable, intent(inout) :: a
+ if(.not.allocated(a)) call abort()
+ if (a /= 6874) call abort
+ deallocate(a)
+ if(allocated(a)) call abort()
+ allocate(a)
+ if(.not.allocated(a)) call abort()
+ a = -478
+ end subroutine check4
+
+ subroutine checkOptional(prsnt, alloc, val, x)
+ logical, intent(in) :: prsnt, alloc
+ integer, allocatable, optional :: x
+ integer, intent(in) :: val
+ if (present(x) .neqv. prsnt) call abort()
+ if (present(x)) then
+ if (allocated(x) .neqv. alloc) call abort()
+ end if
+ if (present(x)) then
+ if (allocated(x)) then
+ if (x /= val) call abort()
+ end if
+ end if
+ call checkOptional2(x)
+ if (present(x)) then
+ if (.not. allocated(x)) call abort()
+ if (x /= -6784) call abort()
+ x = 46
+ end if
+ call checkOptional2()
+ end subroutine checkOptional
+ subroutine checkOptional2(x)
+ integer, allocatable, optional, intent(out) :: x
+ if (present(x)) then
+ if (allocated(x)) call abort()
+ allocate(x)
+ x = -6784
+ end if
+ end subroutine checkOptional2
+end program test
diff --git a/gcc/testsuite/gfortran.dg/associated_target_3.f90 b/gcc/testsuite/gfortran.dg/associated_target_3.f90
new file mode 100644
index 00000000000..e6a1d0f0adb
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/associated_target_3.f90
@@ -0,0 +1,35 @@
+! { dg-do run }
+!
+! PR fortran/41777
+!
+module m
+type t2
+ integer :: i
+end type t2
+interface f
+ module procedure f2
+end interface f
+contains
+function f2(a)
+ type(t2), pointer :: f2,a
+ f2 => a
+end function f2
+end module m
+
+use m
+implicit none
+type(t2), pointer :: a
+allocate(a)
+if (.not. associated(a,f(a))) call abort()
+call cmpPtr(a,f2(a))
+call cmpPtr(a,f(a))
+deallocate(a)
+contains
+ subroutine cmpPtr(a,b)
+ type(t2), pointer :: a,b
+! print *, associated(a,b)
+ if (.not. associated (a, b)) call abort()
+ end subroutine cmpPtr
+end
+
+! { dg-final { cleanup-modules "m" } }
diff --git a/gcc/testsuite/gfortran.dg/assumed_charlen_function_6.f90 b/gcc/testsuite/gfortran.dg/assumed_charlen_function_6.f90
new file mode 100644
index 00000000000..49d1a2e55dd
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/assumed_charlen_function_6.f90
@@ -0,0 +1,37 @@
+! { dg-do compile }
+
+! PR fortran/41615
+! Output nicer error message for invalid assumed-len character function result
+! depending on what kind of contained procedure it is.
+
+module funcs
+ implicit none
+contains
+ function assumed_len(x) ! { dg-error "module procedure" }
+ character(*) assumed_len
+ integer, intent(in) :: x
+ end function assumed_len
+end module funcs
+
+module mod2
+ implicit none
+contains
+ subroutine mysub ()
+ contains
+ function assumed_len(x) ! { dg-error "internal function" }
+ character(*) assumed_len
+ integer, intent(in) :: x
+ end function assumed_len
+ end subroutine
+end module mod2
+
+program main
+ implicit none
+contains
+ function assumed_len(x) ! { dg-error "internal function" }
+ character(*) assumed_len
+ integer, intent(in) :: x
+ end function assumed_len
+end program main
+
+! { dg-final { cleanup-modules "funcs mod2" } }
diff --git a/gcc/testsuite/gfortran.dg/auto_dealloc_1.f90 b/gcc/testsuite/gfortran.dg/auto_dealloc_1.f90
new file mode 100644
index 00000000000..176f87a3d34
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/auto_dealloc_1.f90
@@ -0,0 +1,59 @@
+! { dg-do compile }
+! { dg-options "-fdump-tree-original" }
+!
+! PR 41586: Allocatable _scalars_ are never auto-deallocated
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+
+module automatic_deallocation
+
+ type t0
+ integer :: i
+ end type
+
+ type t1
+ real :: pi = 3.14
+ integer, allocatable :: j
+ end type
+
+ type t2
+ class(t0), allocatable :: k
+ end type t2
+
+contains
+
+ ! (1) simple allocatable scalars
+ subroutine a
+ integer, allocatable :: m
+ allocate (m)
+ m = 42
+ end subroutine
+
+ ! (2) allocatable scalar CLASS variables
+ subroutine b
+ class(t0), allocatable :: m
+ allocate (t0 :: m)
+ m%i = 43
+ end subroutine
+
+ ! (3) allocatable scalar components
+ subroutine c
+ type(t1) :: m
+ allocate (m%j)
+ m%j = 44
+ end subroutine
+
+ ! (4) allocatable scalar CLASS components
+ subroutine d
+ type(t2) :: m
+ allocate (t0 :: m%k)
+ m%k%i = 45
+ end subroutine
+
+end module
+
+
+! { dg-final { scan-tree-dump-times "__builtin_free" 5 "original" } }
+
+! { dg-final { cleanup-modules "automatic_deallocation" } }
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/block_2.f08 b/gcc/testsuite/gfortran.dg/block_2.f08
index a2ba2d5caea..484b6ce72fb 100644
--- a/gcc/testsuite/gfortran.dg/block_2.f08
+++ b/gcc/testsuite/gfortran.dg/block_2.f08
@@ -36,3 +36,4 @@ PROGRAM main
END BLOCK
END PROGRAM main
! { dg-final { scan-tree-dump-times "free \\(\\(void \\*\\) alloc_arr\\.data" 1 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/class_10.f03 b/gcc/testsuite/gfortran.dg/class_10.f03
new file mode 100644
index 00000000000..f238a597a65
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_10.f03
@@ -0,0 +1,32 @@
+! { dg-do compile }
+!
+! PR 41800: [OOP] ICE in fold_convert_loc, at fold-const.c:2789
+!
+! Contributed by Harald Anlauf <anlauf@gmx.de>
+
+module abstract_gradient
+
+ implicit none
+ private
+
+ type, public, abstract :: gradient_class
+ contains
+ procedure, nopass :: inner_product
+ end type
+
+contains
+
+ function inner_product ()
+ class(gradient_class), pointer :: inner_product
+ inner_product => NULL()
+ end function
+
+end module
+
+
+ use abstract_gradient
+ class(gradient_class), pointer :: g_initial, ip_save
+ ip_save => g_initial%inner_product() ! ICE
+end
+
+! { dg-final { cleanup-modules "abstract_gradient" } }
diff --git a/gcc/testsuite/gfortran.dg/class_11.f03 b/gcc/testsuite/gfortran.dg/class_11.f03
new file mode 100644
index 00000000000..bf80c4e00e6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_11.f03
@@ -0,0 +1,37 @@
+! { dg-do compile }
+!
+! PR 41556
+! Contributed by Damian Rouson <damian@rouson.net>
+
+ implicit none
+
+ type ,abstract :: object
+ contains
+ procedure(assign_interface) ,deferred :: assign
+ generic :: assignment(=) => assign
+ end type
+
+ abstract interface
+ subroutine assign_interface(lhs,rhs)
+ import :: object
+ class(object) ,intent(inout) :: lhs
+ class(object) ,intent(in) :: rhs
+ end subroutine
+ end interface
+
+! PR 41937
+! Contributed by Juergen Reuter <reuter@physik.uni-freiburg.de>
+
+ type, abstract :: cuba_abstract_type
+ integer :: dim_f = 1
+ real, dimension(:), allocatable :: integral
+ end type cuba_abstract_type
+
+contains
+
+ subroutine cuba_abstract_alloc_dim_f(this)
+ class(cuba_abstract_type) :: this
+ allocate(this%integral(this%dim_f))
+ end subroutine cuba_abstract_alloc_dim_f
+
+end
diff --git a/gcc/testsuite/gfortran.dg/class_12.f03 b/gcc/testsuite/gfortran.dg/class_12.f03
new file mode 100644
index 00000000000..56c68a57787
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_12.f03
@@ -0,0 +1,45 @@
+! { dg-do compile }
+!
+! PR 41556: [OOP] Errors in applying operator/assignment to an abstract type
+!
+! Contributed by Damian Rouson <damian@rouson.net>
+
+module abstract_algebra
+ implicit none
+ private
+ public :: rescale
+ public :: object
+
+ type ,abstract :: object
+ contains
+ procedure(assign_interface) ,deferred :: assign
+ procedure(product_interface) ,deferred :: product
+ generic :: assignment(=) => assign
+ generic :: operator(*) => product
+ end type
+
+ abstract interface
+ function product_interface(lhs,rhs) result(product)
+ import :: object
+ class(object) ,intent(in) :: lhs
+ class(object) ,allocatable :: product
+ real ,intent(in) :: rhs
+ end function
+ subroutine assign_interface(lhs,rhs)
+ import :: object
+ class(object) ,intent(inout) :: lhs
+ class(object) ,intent(in) :: rhs
+ end subroutine
+ end interface
+
+contains
+
+ subroutine rescale(operand,scale)
+ class(object) :: operand
+ real ,intent(in) :: scale
+ operand = operand*scale
+ operand = operand%product(scale)
+ end subroutine
+end module
+
+! { dg-final { cleanup-modules "abstract_algebra" } }
diff --git a/gcc/testsuite/gfortran.dg/class_2.f03 b/gcc/testsuite/gfortran.dg/class_2.f03
index 070d3f76fdd..3a75d55682c 100644
--- a/gcc/testsuite/gfortran.dg/class_2.f03
+++ b/gcc/testsuite/gfortran.dg/class_2.f03
@@ -34,6 +34,11 @@ abstract interface
end subroutine
end interface
+type t6
+ integer :: i
+ class(t6), allocatable :: foo ! { dg-error "must have the POINTER attribute" }
+end type t6
+
class(t1) :: o1 ! { dg-error "must be dummy, allocatable or pointer" }
diff --git a/gcc/testsuite/gfortran.dg/class_4a.f03 b/gcc/testsuite/gfortran.dg/class_4a.f03
new file mode 100644
index 00000000000..3cf0b7abf51
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_4a.f03
@@ -0,0 +1,14 @@
+! { dg-do compile }
+!
+! Test the fix for PR41583, in which the different source files
+! would generate the same 'vindex' for different class declared
+! types.
+!
+! The test comprises class_4a, class_4b class_4c and class_4d.f03
+
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+!
+module m
+ type t
+ end type t
+end module m
diff --git a/gcc/testsuite/gfortran.dg/class_4b.f03 b/gcc/testsuite/gfortran.dg/class_4b.f03
new file mode 100644
index 00000000000..4658b8cf3f5
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_4b.f03
@@ -0,0 +1,15 @@
+! { dg-do compile }
+!
+! Test the fix for PR41583, in which the different source files
+! would generate the same 'vindex' for different class declared
+! types.
+!
+! The test comprises class_4a, class_4b class_4c and class_4d.f03
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+!
+module m2
+ use m
+ type, extends(t) :: t2
+ end type t2
+end module m2
diff --git a/gcc/testsuite/gfortran.dg/class_4c.f03 b/gcc/testsuite/gfortran.dg/class_4c.f03
new file mode 100644
index 00000000000..7909c0eeda0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_4c.f03
@@ -0,0 +1,28 @@
+! { dg-do run }
+!
+! Test the fix for PR41583, in which the different source files
+! would generate the same 'vindex' for different class declared
+! types.
+!
+! The test comprises class_4a, class_4b class_4c and class_4d.f03
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+!
+ use m
+ use m2
+ type,extends(t) :: t3
+ end type t3
+
+ integer :: i
+ class(t), allocatable :: a
+ allocate(t3 :: a)
+ select type(a)
+ type is(t)
+ i = 1
+ type is(t2)
+ i = 2
+ type is(t3)
+ i = 3
+ end select
+ print *, i
+end
diff --git a/gcc/testsuite/gfortran.dg/class_4d.f03 b/gcc/testsuite/gfortran.dg/class_4d.f03
new file mode 100644
index 00000000000..7a962aa01b9
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_4d.f03
@@ -0,0 +1,15 @@
+! { dg-do compile }
+!
+! Test the fix for PR41583, in which the different source files
+! would generate the same 'vindex' for different class declared
+! types.
+!
+! This file does nothing other than clean up the modules.
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+!
+module m
+ type t
+ end type t
+end module m
+! { dg-final { cleanup-modules "m m2" } }
diff --git a/gcc/testsuite/gfortran.dg/class_5.f03 b/gcc/testsuite/gfortran.dg/class_5.f03
new file mode 100644
index 00000000000..087d745aec7
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_5.f03
@@ -0,0 +1,31 @@
+! { dg-do compile }
+!
+! PR 41719: [OOP] invalid: Intrinsic assignment involving polymorphic variables
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+
+ implicit none
+
+ type t1
+ integer :: a
+ end type
+
+ type, extends(t1) :: t2
+ integer :: b
+ end type
+
+ class(t1),pointer :: cp
+ type(t2) :: x
+
+ x = t2(45,478)
+ allocate(t2 :: cp)
+
+ cp = x ! { dg-error "Variable must not be polymorphic" }
+
+ select type (cp)
+ type is (t2)
+ print *, cp%a, cp%b
+ end select
+
+end
+ \ No newline at end of file
diff --git a/gcc/testsuite/gfortran.dg/class_6.f03 b/gcc/testsuite/gfortran.dg/class_6.f03
new file mode 100644
index 00000000000..2f3ff62a6fa
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_6.f03
@@ -0,0 +1,21 @@
+! { dg-do run }
+!
+! PR 41629: [OOP] gimplification error on valid code
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+
+ type t1
+ integer :: comp
+ end type
+
+ type(t1), target :: a
+
+ class(t1) :: x
+ pointer :: x ! This is valid
+
+ a%comp = 3
+ x => a
+ print *,x%comp
+ if (x%comp/=3) call abort()
+
+end
diff --git a/gcc/testsuite/gfortran.dg/class_7.f03 b/gcc/testsuite/gfortran.dg/class_7.f03
new file mode 100644
index 00000000000..ed4eeba9340
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_7.f03
@@ -0,0 +1,21 @@
+! { dg-do compile }
+! Test fixes for PR41587 and PR41608.
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+!
+! PR41587: used to accept the declaration of component 'foo'
+ type t0
+ integer :: j = 42
+ end type t0
+ type t
+ integer :: i
+ class(t0), allocatable :: foo(3) ! { dg-error "deferred shape" }
+ end type t
+
+! PR41608: Would ICE on missing type decl
+ class(t1), pointer :: c ! { dg-error "before it is defined" }
+
+ select type (c) ! { dg-error "shall be polymorphic" }
+ type is (t1) ! { dg-error "Unexpected" }
+ end select ! { dg-error "Expecting END PROGRAM" }
+end
diff --git a/gcc/testsuite/gfortran.dg/class_8.f03 b/gcc/testsuite/gfortran.dg/class_8.f03
new file mode 100644
index 00000000000..78f10ebe2bd
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_8.f03
@@ -0,0 +1,16 @@
+! { dg-do compile }
+! Test fixes for PR41618.
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+!
+ type t1
+ integer :: comp
+ class(t1),pointer :: cc
+ end type
+
+ class(t1) :: x ! { dg-error "must be dummy, allocatable or pointer" }
+
+ x%comp = 3
+ print *,x%comp
+
+end
diff --git a/gcc/testsuite/gfortran.dg/class_9.f03 b/gcc/testsuite/gfortran.dg/class_9.f03
new file mode 100644
index 00000000000..5dbd4597abd
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_9.f03
@@ -0,0 +1,68 @@
+! { dg-do run }
+! Test the fix for PR41706, in which arguments of class methods that
+! were themselves class methods did not work.
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+!
+module m
+type :: t
+ real :: v = 1.5
+contains
+ procedure, nopass :: a
+ procedure, nopass :: b
+ procedure, pass :: c
+ procedure, nopass :: d
+end type
+
+contains
+
+ real function a (x)
+ real :: x
+ a = 2.*x
+ end function
+
+ real function b (x)
+ real :: x
+ b = 3.*x
+ end function
+
+ real function c (x)
+ class (t) :: x
+ c = 4.*x%v
+ end function
+
+ subroutine d (x)
+ real :: x
+ if (abs(x-3.0)>1E-3) call abort()
+ end subroutine
+
+ subroutine s (x)
+ class(t) :: x
+ real :: r
+ r = x%a (1.1) ! worked
+ if (r .ne. a (1.1)) call abort
+
+ r = x%a (b (1.2)) ! worked
+ if (r .ne. a(b (1.2))) call abort
+
+ r = b ( x%a (1.3)) ! worked
+ if (r .ne. b(a (1.3))) call abort
+
+ r = x%a(x%b (1.4)) ! failed
+ if (r .ne. a(b (1.4))) call abort
+
+ r = x%a(x%c ()) ! failed
+ if (r .ne. a(c (x))) call abort
+
+ call x%d (x%a(1.5)) ! failed
+
+ end subroutine
+
+end
+
+ use m
+ class(t),allocatable :: x
+ allocate(x)
+ call s (x)
+end
+! { dg-final { cleanup-modules "m" } }
diff --git a/gcc/testsuite/gfortran.dg/class_allocate_1.f03 b/gcc/testsuite/gfortran.dg/class_allocate_1.f03
index 844e1447fbf..67c8065794b 100644
--- a/gcc/testsuite/gfortran.dg/class_allocate_1.f03
+++ b/gcc/testsuite/gfortran.dg/class_allocate_1.f03
@@ -20,6 +20,7 @@
end type
class(t1),pointer :: cp, cp2
+ type(t2),pointer :: cp3
type(t3) :: x
integer :: i
@@ -67,7 +68,9 @@
i = 0
allocate(t2 :: cp2)
- allocate(cp, source = cp2) ! { dg-warning "not supported yet" }
+ allocate(cp, source = cp2)
+ allocate(t2 :: cp3)
+ allocate(cp, source=cp3)
select type (cp)
type is (t1)
i = 1
diff --git a/gcc/testsuite/gfortran.dg/class_allocate_2.f03 b/gcc/testsuite/gfortran.dg/class_allocate_2.f03
new file mode 100644
index 00000000000..754faa9a9f4
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_allocate_2.f03
@@ -0,0 +1,23 @@
+! { dg-do compile }
+!
+! PR fortran/41582
+!
+subroutine test()
+type :: t
+end type t
+class(t), allocatable :: c,d
+allocate(t :: d)
+allocate(c,source=d)
+end
+
+type, abstract :: t
+end type t
+type t2
+ class(t), pointer :: t
+end type t2
+
+class(t), allocatable :: a,c,d
+type(t2) :: b
+allocate(a) ! { dg-error "requires a type-spec or SOURCE" }
+allocate(b%t) ! { dg-error "requires a type-spec or SOURCE" }
+end
diff --git a/gcc/testsuite/gfortran.dg/class_allocate_3.f03 b/gcc/testsuite/gfortran.dg/class_allocate_3.f03
new file mode 100644
index 00000000000..c6128a8ab51
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_allocate_3.f03
@@ -0,0 +1,39 @@
+! { dg-do run }
+!
+! PR 41581: [OOP] Allocation of a CLASS with SOURCE=<class> does not work
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+
+ type t
+ end type t
+
+ type,extends(t) :: t2
+ integer :: i = 54
+ real :: r = 384.02
+ end type t2
+
+ class(t), allocatable :: m1, m2
+
+ allocate(t2 :: m2)
+ select type(m2)
+ type is (t2)
+ print *, m2%i, m2%r
+ if (m2%i/=54) call abort()
+ if (abs(m2%r-384.02)>1E-3) call abort()
+ m2%i = 42
+ m2%r = -4.0
+ class default
+ call abort()
+ end select
+
+ allocate(m1, source=m2)
+ select type(m1)
+ type is (t2)
+ print *, m1%i, m1%r
+ if (m1%i/=42) call abort()
+ if (abs(m1%r+4.0)>1E-3) call abort()
+ class default
+ call abort()
+ end select
+
+end
diff --git a/gcc/testsuite/gfortran.dg/class_allocate_4.f03 b/gcc/testsuite/gfortran.dg/class_allocate_4.f03
new file mode 100644
index 00000000000..d1ebf8cc915
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_allocate_4.f03
@@ -0,0 +1,23 @@
+! { dg-do run }
+!
+! PR 41714: [OOP] ALLOCATE SOURCE= does not properly copy the value from SOURCE
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+
+type t
+ integer :: i
+end type t
+type, extends(t) :: t2
+ integer :: j
+end type t2
+
+class(t), allocatable :: a
+allocate(a, source=t2(1,2))
+print *,a%i
+if(a%i /= 1) call abort()
+select type (a)
+ type is (t2)
+ print *,a%j
+ if(a%j /= 2) call abort()
+end select
+end
diff --git a/gcc/testsuite/gfortran.dg/complex_intrinsic_8.f90 b/gcc/testsuite/gfortran.dg/complex_intrinsic_8.f90
new file mode 100644
index 00000000000..f9529a52334
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/complex_intrinsic_8.f90
@@ -0,0 +1,50 @@
+! { dg-do link }
+! { dg-require-effective-target mpc_arc }
+!
+! PR fortran/33197
+!
+! Fortran complex trigonometric functions: acos, asin, atan, acosh, asinh, atanh
+!
+! Compile-time simplifications
+!
+implicit none
+real(4), parameter :: pi = 2*acos(0.0_4)
+real(8), parameter :: pi8 = 2*acos(0.0_8)
+real(4), parameter :: eps = 10*epsilon(0.0_4)
+real(8), parameter :: eps8 = 10*epsilon(0.0_8)
+complex(4), parameter :: z0_0 = cmplx(0.0_4, 0.0_4, kind=4)
+complex(4), parameter :: z1_1 = cmplx(1.0_4, 1.0_4, kind=4)
+complex(8), parameter :: z80_0 = cmplx(0.0_8, 0.0_8, kind=8)
+complex(8), parameter :: z81_1 = cmplx(1.0_8, 1.0_8, kind=8)
+
+if (abs(acos(z0_0) - cmplx(pi/2,-0.0,4)) > eps) call link_error()
+if (abs(acos(z1_1) - cmplx(0.904556894, -1.06127506,4)) > eps) call link_error()
+if (abs(acos(z80_0) - cmplx(pi8/2,-0.0_8,8)) > eps8) call link_error()
+if (abs(acos(z81_1) - cmplx(0.90455689430238140_8, -1.0612750619050357_8,8)) > eps8) call link_error()
+
+if (abs(asin(z0_0) - cmplx(0.0,0.0,4)) > eps) call link_error()
+if (abs(asin(z1_1) - cmplx(0.66623943, 1.06127506,4)) > eps) call link_error()
+if (abs(asin(z80_0) - cmplx(0.0_8,0.0_8,8)) > eps8) call link_error()
+if (abs(asin(z81_1) - cmplx(0.66623943249251527_8, 1.0612750619050357_8,8)) > eps8) call link_error()
+
+if (abs(atan(z0_0) - cmplx(0.0,0.0,4)) > eps) call link_error()
+if (abs(atan(z1_1) - cmplx(1.01722196, 0.40235947,4)) > eps) call link_error()
+if (abs(atan(z80_0) - cmplx(0.0_8,0.0_8,8)) > eps8) call link_error()
+if (abs(atan(z81_1) - cmplx(1.0172219678978514_8, 0.40235947810852507_8,8)) > eps8) call link_error()
+
+if (abs(acosh(z0_0) - cmplx(0.0,pi/2,4)) > eps) call link_error()
+if (abs(acosh(z1_1) - cmplx(1.06127506, 0.90455689,4)) > eps) call link_error()
+if (abs(acosh(z80_0) - cmplx(0.0_8,pi8/2,8)) > eps8) call link_error()
+if (abs(acosh(z81_1) - cmplx(1.0612750619050357_8, 0.90455689430238140_8,8)) > eps8) call link_error()
+
+if (abs(asinh(z0_0) - cmplx(0.0,0.0,4)) > eps) call link_error()
+if (abs(asinh(z1_1) - cmplx(1.06127506, 0.66623943,4)) > eps) call link_error()
+if (abs(asinh(z80_0) - cmplx(0.0_8,0.0_8,8)) > eps8) call link_error()
+if (abs(asinh(z81_1) - cmplx(1.0612750619050357_8, 0.66623943249251527_8,8)) > eps8) call link_error()
+
+if (abs(atanh(z0_0) - cmplx(0.0,0.0,4)) > eps) call link_error()
+if (abs(atanh(z1_1) - cmplx(0.40235947, 1.01722196,4)) > eps) call link_error()
+if (abs(atanh(z80_0) - cmplx(0.0_8,0.0_8,8)) > eps8) call link_error()
+if (abs(atanh(z81_1) - cmplx(0.40235947810852507_8, 1.0172219678978514_8,8)) > eps8) call link_error()
+
+end
diff --git a/gcc/testsuite/gfortran.dg/dynamic_dispatch_1.f03 b/gcc/testsuite/gfortran.dg/dynamic_dispatch_1.f03
new file mode 100644
index 00000000000..4854b0ff08d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dynamic_dispatch_1.f03
@@ -0,0 +1,84 @@
+! { dg-do run }
+! Tests dynamic dispatch of class functions.
+!
+! Contributed by Paul Thomas <pault@gcc.gnu.org>
+!
+module m
+ type :: t1
+ integer :: i = 42
+ procedure(make_real), pointer :: ptr
+ contains
+ procedure, pass :: real => make_real
+ procedure, pass :: make_integer
+ procedure, pass :: prod => i_m_j
+ generic, public :: extract => real, make_integer
+ generic, public :: base_extract => real, make_integer
+ end type t1
+
+ type, extends(t1) :: t2
+ integer :: j = 99
+ contains
+ procedure, pass :: real => make_real2
+ procedure, pass :: make_integer_2
+ procedure, pass :: prod => i_m_j_2
+ generic, public :: extract => real, make_integer_2
+ end type t2
+contains
+ real function make_real (arg)
+ class(t1), intent(in) :: arg
+ make_real = real (arg%i)
+ end function make_real
+
+ real function make_real2 (arg)
+ class(t2), intent(in) :: arg
+ make_real2 = real (arg%j)
+ end function make_real2
+
+ integer function make_integer (arg, arg2)
+ class(t1), intent(in) :: arg
+ integer :: arg2
+ make_integer = arg%i * arg2
+ end function make_integer
+
+ integer function make_integer_2 (arg, arg2)
+ class(t2), intent(in) :: arg
+ integer :: arg2
+ make_integer_2 = arg%j * arg2
+ end function make_integer_2
+
+ integer function i_m_j (arg)
+ class(t1), intent(in) :: arg
+ i_m_j = arg%i
+ end function i_m_j
+
+ integer function i_m_j_2 (arg)
+ class(t2), intent(in) :: arg
+ i_m_j_2 = arg%j
+ end function i_m_j_2
+end module m
+
+ use m
+ type, extends(t1) :: l1
+ character(16) :: chr
+ end type l1
+ class(t1), pointer :: a !=> NULL()
+ type(t1), target :: b
+ type(t2), target :: c
+ type(l1), target :: d
+ a => b ! declared type
+ if (a%real() .ne. real (42)) call abort
+ if (a%prod() .ne. 42) call abort
+ if (a%extract (2) .ne. 84) call abort
+ if (a%base_extract (2) .ne. 84) call abort
+ a => c ! extension in module
+ if (a%real() .ne. real (99)) call abort
+ if (a%prod() .ne. 99) call abort
+ if (a%extract (3) .ne. 297) call abort
+ if (a%base_extract (3) .ne. 126) call abort
+ a => d ! extension in main
+ if (a%real() .ne. real (42)) call abort
+ if (a%prod() .ne. 42) call abort
+ if (a%extract (4) .ne. 168) call abort
+ if (a%base_extract (4) .ne. 168) call abort
+end
+! { dg-final { cleanup-modules "m" } }
diff --git a/gcc/testsuite/gfortran.dg/dynamic_dispatch_2.f03 b/gcc/testsuite/gfortran.dg/dynamic_dispatch_2.f03
new file mode 100644
index 00000000000..989a2e0d3f0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dynamic_dispatch_2.f03
@@ -0,0 +1,105 @@
+! { dg-do run }
+! Tests dynamic dispatch of class subroutines.
+!
+! Contributed by Paul Thomas <pault@gcc.gnu.org>
+!
+module m
+ type :: t1
+ integer :: i = 42
+ procedure(make_real), pointer :: ptr
+ contains
+ procedure, pass :: real => make_real
+ procedure, pass :: make_integer
+ procedure, pass :: prod => i_m_j
+ generic, public :: extract => real, make_integer
+ generic, public :: base_extract => real, make_integer
+ end type t1
+
+ type, extends(t1) :: t2
+ integer :: j = 99
+ contains
+ procedure, pass :: real => make_real2
+ procedure, pass :: make_integer_2
+ procedure, pass :: prod => i_m_j_2
+ generic, public :: extract => real, make_integer_2
+ end type t2
+contains
+ subroutine make_real (arg, arg2)
+ class(t1), intent(in) :: arg
+ real :: arg2
+ arg2 = real (arg%i)
+ end subroutine make_real
+
+ subroutine make_real2 (arg, arg2)
+ class(t2), intent(in) :: arg
+ real :: arg2
+ arg2 = real (arg%j)
+ end subroutine make_real2
+
+ subroutine make_integer (arg, arg2, arg3)
+ class(t1), intent(in) :: arg
+ integer :: arg2, arg3
+ arg3 = arg%i * arg2
+ end subroutine make_integer
+
+ subroutine make_integer_2 (arg, arg2, arg3)
+ class(t2), intent(in) :: arg
+ integer :: arg2, arg3
+ arg3 = arg%j * arg2
+ end subroutine make_integer_2
+
+ subroutine i_m_j (arg, arg2)
+ class(t1), intent(in) :: arg
+ integer :: arg2
+ arg2 = arg%i
+ end subroutine i_m_j
+
+ subroutine i_m_j_2 (arg, arg2)
+ class(t2), intent(in) :: arg
+ integer :: arg2
+ arg2 = arg%j
+ end subroutine i_m_j_2
+end module m
+
+ use m
+ type, extends(t1) :: l1
+ character(16) :: chr
+ end type l1
+ class(t1), pointer :: a !=> NULL()
+ type(t1), target :: b
+ type(t2), target :: c
+ type(l1), target :: d
+ real :: r
+ integer :: i
+
+ a => b ! declared type
+ call a%real(r)
+ if (r .ne. real (42)) call abort
+ call a%prod(i)
+ if (i .ne. 42) call abort
+ call a%extract (2, i)
+ if (i .ne. 84) call abort
+ call a%base_extract (2, i)
+ if (i .ne. 84) call abort
+
+ a => c ! extension in module
+ call a%real(r)
+ if (r .ne. real (99)) call abort
+ call a%prod(i)
+ if (i .ne. 99) call abort
+ call a%extract (3, i)
+ if (i .ne. 297) call abort
+ call a%base_extract (3, i)
+ if (i .ne. 126) call abort
+
+ a => d ! extension in main
+ call a%real(r)
+ if (r .ne. real (42)) call abort
+ call a%prod(i)
+ if (i .ne. 42) call abort
+ call a%extract (4, i)
+ if (i .ne. 168) call abort
+ call a%extract (4, i)
+ if (i .ne. 168) call abort
+end
+! { dg-final { cleanup-modules "m" } }
diff --git a/gcc/testsuite/gfortran.dg/dynamic_dispatch_3.f03 b/gcc/testsuite/gfortran.dg/dynamic_dispatch_3.f03
new file mode 100644
index 00000000000..aa8713ef4d4
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dynamic_dispatch_3.f03
@@ -0,0 +1,91 @@
+! { dg-do run }
+! Tests dynamic dispatch of class functions, spread over
+! different modules. Apart from the location of the derived
+! type declarations, this test is the same as
+! dynamic_dispatch_1.f03
+!
+! Contributed by Paul Thomas <pault@gcc.gnu.org>
+!
+module m1
+ type :: t1
+ integer :: i = 42
+ procedure(make_real), pointer :: ptr
+ contains
+ procedure, pass :: real => make_real
+ procedure, pass :: make_integer
+ procedure, pass :: prod => i_m_j
+ generic, public :: extract => real, make_integer
+ generic, public :: base_extract => real, make_integer
+ end type t1
+contains
+ real function make_real (arg)
+ class(t1), intent(in) :: arg
+ make_real = real (arg%i)
+ end function make_real
+
+ integer function make_integer (arg, arg2)
+ class(t1), intent(in) :: arg
+ integer :: arg2
+ make_integer = arg%i * arg2
+ end function make_integer
+
+ integer function i_m_j (arg)
+ class(t1), intent(in) :: arg
+ i_m_j = arg%i
+ end function i_m_j
+end module m1
+
+module m2
+ use m1
+ type, extends(t1) :: t2
+ integer :: j = 99
+ contains
+ procedure, pass :: real => make_real2
+ procedure, pass :: make_integer_2
+ procedure, pass :: prod => i_m_j_2
+ generic, public :: extract => real, make_integer_2
+ end type t2
+contains
+ real function make_real2 (arg)
+ class(t2), intent(in) :: arg
+ make_real2 = real (arg%j)
+ end function make_real2
+
+ integer function make_integer_2 (arg, arg2)
+ class(t2), intent(in) :: arg
+ integer :: arg2
+ make_integer_2 = arg%j * arg2
+ end function make_integer_2
+
+ integer function i_m_j_2 (arg)
+ class(t2), intent(in) :: arg
+ i_m_j_2 = arg%j
+ end function i_m_j_2
+end module m2
+
+ use m1
+ use m2
+ type, extends(t1) :: l1
+ character(16) :: chr
+ end type l1
+ class(t1), pointer :: a !=> NULL()
+ type(t1), target :: b
+ type(t2), target :: c
+ type(l1), target :: d
+ a => b ! declared type in module m1
+ if (a%real() .ne. real (42)) call abort
+ if (a%prod() .ne. 42) call abort
+ if (a%extract (2) .ne. 84) call abort
+ if (a%base_extract (2) .ne. 84) call abort
+ a => c ! extension in module m2
+ if (a%real() .ne. real (99)) call abort
+ if (a%prod() .ne. 99) call abort
+ if (a%extract (3) .ne. 297) call abort
+ if (a%base_extract (3) .ne. 126) call abort
+ a => d ! extension in main
+ if (a%real() .ne. real (42)) call abort
+ if (a%prod() .ne. 42) call abort
+ if (a%extract (4) .ne. 168) call abort
+ if (a%base_extract (4) .ne. 168) call abort
+end
+! { dg-final { cleanup-modules "m1, m2" } }
diff --git a/gcc/testsuite/gfortran.dg/dynamic_dispatch_4.f03 b/gcc/testsuite/gfortran.dg/dynamic_dispatch_4.f03
new file mode 100644
index 00000000000..b72819acc4c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dynamic_dispatch_4.f03
@@ -0,0 +1,96 @@
+! { dg-do run }
+! Tests the fix for PR41648 in which the reference a%a%getit () was wrongly
+! identified as a recursive call to getit.
+!
+! Contributed by Salvatore Filippone <sfilippone@uniroma2.it>
+!
+module foo_mod
+ type foo
+ integer :: i
+ contains
+ procedure, pass(a) :: doit
+ procedure, pass(a) :: getit
+ end type foo
+
+ private doit,getit
+contains
+ subroutine doit(a)
+ class(foo) :: a
+
+ a%i = 1
+ end subroutine doit
+ function getit(a) result(res)
+ class(foo) :: a
+ integer :: res
+
+ res = a%i
+ end function getit
+
+end module foo_mod
+
+module s_bar_mod
+ use foo_mod
+ type, extends(foo) :: s_bar
+ type(foo), allocatable :: a
+ contains
+ procedure, pass(a) :: doit
+ procedure, pass(a) :: getit
+ end type s_bar
+ private doit,getit
+
+contains
+ subroutine doit(a)
+ class(s_bar) :: a
+ allocate (a%a)
+ call a%a%doit()
+ end subroutine doit
+ function getit(a) result(res)
+ class(s_bar) :: a
+ integer :: res
+
+ res = a%a%getit () * 2
+ end function getit
+end module s_bar_mod
+
+module a_bar_mod
+ use foo_mod
+ type, extends(foo) :: a_bar
+ type(foo), allocatable :: a(:)
+ contains
+ procedure, pass(a) :: doit
+ procedure, pass(a) :: getit
+ end type a_bar
+ private doit,getit
+
+contains
+ subroutine doit(a)
+ class(a_bar) :: a
+ allocate (a%a(1))
+ call a%a(1)%doit ()
+ end subroutine doit
+ function getit(a) result(res)
+ class(a_bar) :: a
+ integer :: res
+
+ res = a%a(1)%getit () * 3
+ end function getit
+end module a_bar_mod
+
+ use s_bar_mod
+ use a_bar_mod
+ type(foo), target :: b
+ type(s_bar), target :: c
+ type(a_bar), target :: d
+ class(foo), pointer :: a
+ a => b
+ call a%doit
+ if (a%getit () .ne. 1) call abort
+ a => c
+ call a%doit
+ if (a%getit () .ne. 2) call abort
+ a => d
+ call a%doit
+ if (a%getit () .ne. 3) call abort
+end
+! { dg-final { cleanup-modules "foo_mod s_bar_mod a_bar_mod" } }
+
diff --git a/gcc/testsuite/gfortran.dg/dynamic_dispatch_5.f03 b/gcc/testsuite/gfortran.dg/dynamic_dispatch_5.f03
new file mode 100644
index 00000000000..8533508bcdc
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dynamic_dispatch_5.f03
@@ -0,0 +1,185 @@
+! { dg-do compile }
+! Tests the fix for PR4164656 in which the call to a%a%scal failed to compile.
+!
+! Contributed by Salvatore Filippone <sfilippone@uniroma2.it>
+!
+module const_mod
+ integer, parameter :: longndig=12
+ integer, parameter :: long_int_k_ = selected_int_kind(longndig)
+ integer, parameter :: dpk_ = kind(1.d0)
+ integer, parameter :: spk_ = kind(1.e0)
+end module const_mod
+
+module base_mat_mod
+ use const_mod
+ type :: base_sparse_mat
+ integer, private :: m, n
+ integer, private :: state, duplicate
+ logical, private :: triangle, unitd, upper, sorted
+ contains
+ procedure, pass(a) :: get_nzeros
+ end type base_sparse_mat
+ private :: get_nzeros
+contains
+ function get_nzeros(a) result(res)
+ implicit none
+ class(base_sparse_mat), intent(in) :: a
+ integer :: res
+ integer :: err_act
+ character(len=20) :: name='base_get_nzeros'
+ logical, parameter :: debug=.false.
+ res = -1
+ end function get_nzeros
+end module base_mat_mod
+
+module s_base_mat_mod
+ use base_mat_mod
+ type, extends(base_sparse_mat) :: s_base_sparse_mat
+ contains
+ procedure, pass(a) :: s_scals
+ procedure, pass(a) :: s_scal
+ generic, public :: scal => s_scals, s_scal
+ end type s_base_sparse_mat
+ private :: s_scals, s_scal
+
+ type, extends(s_base_sparse_mat) :: s_coo_sparse_mat
+
+ integer :: nnz
+ integer, allocatable :: ia(:), ja(:)
+ real(spk_), allocatable :: val(:)
+ contains
+ procedure, pass(a) :: get_nzeros => s_coo_get_nzeros
+ procedure, pass(a) :: s_scals => s_coo_scals
+ procedure, pass(a) :: s_scal => s_coo_scal
+ end type s_coo_sparse_mat
+ private :: s_coo_scals, s_coo_scal, s_coo_get_nzeros
+contains
+ subroutine s_scals(d,a,info)
+ implicit none
+ class(s_base_sparse_mat), intent(in) :: a
+ real(spk_), intent(in) :: d
+ integer, intent(out) :: info
+
+ Integer :: err_act
+ character(len=20) :: name='s_scals'
+ logical, parameter :: debug=.false.
+
+ ! This is the base version. If we get here
+ ! it means the derived class is incomplete,
+ ! so we throw an error.
+ info = 700
+ end subroutine s_scals
+
+
+ subroutine s_scal(d,a,info)
+ implicit none
+ class(s_base_sparse_mat), intent(in) :: a
+ real(spk_), intent(in) :: d(:)
+ integer, intent(out) :: info
+
+ Integer :: err_act
+ character(len=20) :: name='s_scal'
+ logical, parameter :: debug=.false.
+
+ ! This is the base version. If we get here
+ ! it means the derived class is incomplete,
+ ! so we throw an error.
+ info = 700
+ end subroutine s_scal
+
+ function s_coo_get_nzeros(a) result(res)
+ implicit none
+ class(s_coo_sparse_mat), intent(in) :: a
+ integer :: res
+ res = a%nnz
+ end function s_coo_get_nzeros
+
+
+ subroutine s_coo_scal(d,a,info)
+ use const_mod
+ implicit none
+ class(s_coo_sparse_mat), intent(inout) :: a
+ real(spk_), intent(in) :: d(:)
+ integer, intent(out) :: info
+
+ Integer :: err_act,mnm, i, j, m
+ character(len=20) :: name='scal'
+ logical, parameter :: debug=.false.
+ info = 0
+ do i=1,a%get_nzeros()
+ j = a%ia(i)
+ a%val(i) = a%val(i) * d(j)
+ enddo
+ end subroutine s_coo_scal
+
+ subroutine s_coo_scals(d,a,info)
+ use const_mod
+ implicit none
+ class(s_coo_sparse_mat), intent(inout) :: a
+ real(spk_), intent(in) :: d
+ integer, intent(out) :: info
+
+ Integer :: err_act,mnm, i, j, m
+ character(len=20) :: name='scal'
+ logical, parameter :: debug=.false.
+
+ info = 0
+ do i=1,a%get_nzeros()
+ a%val(i) = a%val(i) * d
+ enddo
+ end subroutine s_coo_scals
+end module s_base_mat_mod
+
+module s_mat_mod
+ use s_base_mat_mod
+ type :: s_sparse_mat
+ class(s_base_sparse_mat), pointer :: a
+ contains
+ procedure, pass(a) :: s_scals
+ procedure, pass(a) :: s_scal
+ generic, public :: scal => s_scals, s_scal
+ end type s_sparse_mat
+ interface scal
+ module procedure s_scals, s_scal
+ end interface
+contains
+ subroutine s_scal(d,a,info)
+ use const_mod
+ implicit none
+ class(s_sparse_mat), intent(inout) :: a
+ real(spk_), intent(in) :: d(:)
+ integer, intent(out) :: info
+ integer :: err_act
+ character(len=20) :: name='csnmi'
+ logical, parameter :: debug=.false.
+ print *, "s_scal"
+ call a%a%scal(d,info)
+ return
+ end subroutine s_scal
+
+ subroutine s_scals(d,a,info)
+ use const_mod
+ implicit none
+ class(s_sparse_mat), intent(inout) :: a
+ real(spk_), intent(in) :: d
+ integer, intent(out) :: info
+ integer :: err_act
+ character(len=20) :: name='csnmi'
+ logical, parameter :: debug=.false.
+ print *, "s_scals"
+ call a%a%scal(d,info)
+ return
+ end subroutine s_scals
+end module s_mat_mod
+
+ use s_mat_mod
+ class (s_sparse_mat), pointer :: a
+ type (s_sparse_mat), target :: b
+ type (s_base_sparse_mat), target :: c
+ integer info
+ b%a => c
+ a => b
+ call a%scal (1.0_spk_, info)
+end
+! { dg-final { cleanup-modules "const_mod base_mat_mod s_base_mat_mod s_mat_mod" } }
+
diff --git a/gcc/testsuite/gfortran.dg/equiv_8.f90 b/gcc/testsuite/gfortran.dg/equiv_8.f90
new file mode 100644
index 00000000000..a2ed7f0349e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/equiv_8.f90
@@ -0,0 +1,7 @@
+! { dg-do compile }
+!
+! PR fortran/41755
+!
+ common /uno/ aa
+ equivalence (aa,aaaaa) (bb,cc) ! { dg-error "Expecting a comma in EQUIVALENCE" }
+ end
diff --git a/gcc/testsuite/gfortran.dg/extends_8.f03 b/gcc/testsuite/gfortran.dg/extends_8.f03
new file mode 100644
index 00000000000..4af5ab9327c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/extends_8.f03
@@ -0,0 +1,17 @@
+! { dg-do compile }
+!
+! PR 41784: [OOP] ICE in load_derived_extensions
+!
+! Contributed by Salvatore Filippone <sfilippone@uniroma2.it>
+
+module m
+ type :: A
+ end type
+ type, extends(A) :: B
+ end type
+end module
+
+use m, only: A
+end
+
+! { dg-final { cleanup-modules "m" } }
diff --git a/gcc/testsuite/gfortran.dg/fmt_error_10.f b/gcc/testsuite/gfortran.dg/fmt_error_10.f
new file mode 100644
index 00000000000..c2a9117bb68
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/fmt_error_10.f
@@ -0,0 +1,29 @@
+! { dg-do run }
+! { dg-options "-std=legacy" }
+! PR38439 I/O PD edit descriptor inconsistency
+! Test case prepared by Jerry DeLisle <jvdelisle@gcc.gnu.org>
+ character(len=25) :: str
+ character(len=132) :: msg, line
+ str = '(1pd24.15e6)'
+ line = "initial string"
+ x = 555.25
+
+ write (line,str,iostat=istat, iomsg=msg) 1.0d0, 1.234
+ if (istat.ne.0) call abort
+ if (line.ne." 1.000000000000000D+001.E+00") call abort
+
+ write (line,'(1pd24.15e6)',iostat=istat, iomsg=msg) 1.0d0, 1.234 ! { dg-warning "Period required" }
+ if (istat.ne.0) call abort
+ if (line.ne." 1.000000000000000D+001.E+00") call abort
+
+ str = '(1pd0.15)'
+ write (line,str,iostat=istat, iomsg=msg) 1.0d0
+ if (istat.ne.5006 .or. msg(1:15).ne."Positive width ") call abort
+ read (*,str,iostat=istat, iomsg=msg) x
+ if (istat.ne.5006 .or. msg(1:15).ne."Positive width ") call abort
+ if (x.ne.555.25) call abort
+
+ write (line,'(1pd24.15e11.3)') 1.0d0, 1.234
+ if (line.ne." 1.000000000000000D+00 1.234E+00") call abort
+
+ end
diff --git a/gcc/testsuite/gfortran.dg/fmt_error_9.f b/gcc/testsuite/gfortran.dg/fmt_error_9.f
new file mode 100644
index 00000000000..d8abb851210
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/fmt_error_9.f
@@ -0,0 +1,29 @@
+! { dg-do run }
+! { dg-options "-std=gnu" }
+! PR38439 I/O PD edit descriptor inconsistency
+! Test case prepared by Jerry DeLisle <jvdelisle@gcc.gnu.org>
+ character(len=25) :: str
+ character(len=132) :: msg, line
+ str = '(1pd24.15e6)'
+ line = "initial string"
+ x = 555.25
+
+ write (line,str,iostat=istat, iomsg=msg) 1.0d0, 1.234
+ if (istat.ne.5006 .or. msg(1:15).ne."Period required") call abort
+ if (line.ne."initial string") call abort
+
+ str = '(1pf0.15)'
+ write (line,str,iostat=istat, iomsg=msg) 1.0d0
+ if (istat.ne.0) call abort
+ read (*,str,iostat=istat, iomsg=msg) x
+ if (istat.ne.5006 .or. msg(1:15).ne."Positive width ") call abort
+ if (x.ne.555.25) call abort
+
+ write (line,'(1pd24.15e11.3)') 1.0d0, 1.234
+ if (line.ne." 1.000000000000000D+00 1.234E+00") call abort
+
+ str = '(1p2d24.15)'
+ msg = " 1.000000000000000D+00 1.233999967575073D+00That's it!"
+ write (line,'(1p2d24.15a)') 1.0d0, 1.234, "That's it!"
+ if (line.ne.msg) print *, msg
+ end
diff --git a/gcc/testsuite/gfortran.dg/goto_6.f b/gcc/testsuite/gfortran.dg/goto_6.f
new file mode 100644
index 00000000000..5b054b636bc
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/goto_6.f
@@ -0,0 +1,24 @@
+! { dg-do run }
+! { dg-options "-w" }
+
+! PR fortran/41403
+! Assigned-goto with label list used to compare label addresses which
+! failed with optimization. Check this works correctly now.
+! This is the most reduced Fortran code from the PR.
+
+ IVFAIL=0
+ ASSIGN 1263 TO I
+ GO TO I, (1262,1263,1264)
+ 1262 ICON01 = 1262
+ GO TO 1265
+ 1263 ICON01 = 1263
+ GO TO 1265
+ 1264 ICON01 = 1264
+ 1265 CONTINUE
+41260 IF ( ICON01 - 1263 ) 21260, 11260, 21260
+11260 IVPASS = IVPASS + 1
+ GO TO 1271
+21260 IVFAIL = IVFAIL + 1
+ 1271 CONTINUE
+ IF (IVFAIL /= 0) CALL abort ()
+ END
diff --git a/gcc/testsuite/gfortran.dg/goto_7.f b/gcc/testsuite/gfortran.dg/goto_7.f
new file mode 100644
index 00000000000..e230b7b6f14
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/goto_7.f
@@ -0,0 +1,14 @@
+! { dg-do compile }
+! { dg-options "-std=legacy" }
+
+! Check for error message when computed and assigned gotos reference
+! illegal label numbers.
+
+ ASSIGN 1 TO I
+ GOTO (1, 2, 3, 42), 2 ! { dg-error "is never defined" }
+ GOTO I, (1, 2, 3, 43) ! { dg-error "is never defined" }
+ 1 CONTINUE
+ 2 CONTINUE
+ 3 CONTINUE
+c No label 42 or 43.
+ END
diff --git a/gcc/testsuite/gfortran.dg/goto_8.f90 b/gcc/testsuite/gfortran.dg/goto_8.f90
new file mode 100644
index 00000000000..a5f1f7f07b9
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/goto_8.f90
@@ -0,0 +1,31 @@
+! { dg-do compile }
+!
+! PR 41781: [OOP] bogus undefined label error with SELECT TYPE.
+!
+! Contributed by Salvatore Filippone <sfilippone@uniroma2.it>
+! and Tobias Burnus >burnus@gcc.gnu.org>
+
+! 1st example: jumping out of SELECT TYPE (valid)
+type bar
+ integer :: i
+end type bar
+class(bar), pointer :: var
+select type(var)
+class default
+ goto 9999
+end select
+9999 continue
+
+! 2nd example: jumping out of BLOCK (valid)
+block
+ goto 88
+end block
+88 continue
+
+! 3rd example: jumping into BLOCK (invalid)
+goto 99 ! { dg-error "is not in the same block" }
+block
+ 99 continue ! { dg-error "is not in the same block" }
+end block
+
+end
diff --git a/gcc/testsuite/gfortran.dg/guality/arg1.f90 b/gcc/testsuite/gfortran.dg/guality/arg1.f90
new file mode 100644
index 00000000000..332a4ed1d87
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/guality/arg1.f90
@@ -0,0 +1,15 @@
+! { dg-do run }
+! { dg-options "-g" }
+ integer :: a(10), b(12)
+ call sub (a, 10)
+ call sub (b, 12)
+ write (*,*) a, b
+end
+
+subroutine sub (a, n)
+ integer :: a(n), n
+ do i = 1, n
+ a(i) = i
+ end do
+ write (*,*) a ! { dg-final { gdb-test 14 "a(10)" "10" } }
+end subroutine
diff --git a/gcc/testsuite/gfortran.dg/guality/guality.exp b/gcc/testsuite/gfortran.dg/guality/guality.exp
new file mode 100644
index 00000000000..2444d8de7b8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/guality/guality.exp
@@ -0,0 +1,29 @@
+# This harness is for tests that should be run at all optimisation levels.
+
+load_lib gfortran-dg.exp
+load_lib gcc-gdb-test.exp
+
+# Disable on darwin until radr://7264615 is resolved.
+if { [istarget *-*-darwin*] } {
+ return
+}
+
+dg-init
+
+global GDB
+if ![info exists ::env(GUALITY_GDB_NAME)] {
+ if [info exists GDB] {
+ set guality_gdb_name "$GDB"
+ } else {
+ set guality_gdb_name "[transform gdb]"
+ }
+ setenv GUALITY_GDB_NAME "$guality_gdb_name"
+}
+
+gfortran-dg-runtest [lsort [glob $srcdir/$subdir/*.\[fF\]{,90,95,03,08} ]] ""
+
+if [info exists guality_gdb_name] {
+ unsetenv GUALITY_GDB_NAME
+}
+
+dg-finish
diff --git a/gcc/testsuite/gfortran.dg/guality/pr41558.f90 b/gcc/testsuite/gfortran.dg/guality/pr41558.f90
new file mode 100644
index 00000000000..9d1e833998f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/guality/pr41558.f90
@@ -0,0 +1,10 @@
+! PR debug/41558
+! { dg-do run }
+! { dg-options "-g" }
+
+subroutine f (s)
+ character(len=3) :: s
+ write (*,*), s ! { dg-final { gdb-test 7 "s" "'foo'" } }
+end
+ call f ('foo')
+end
diff --git a/gcc/testsuite/gfortran.dg/intent_out_6.f90 b/gcc/testsuite/gfortran.dg/intent_out_6.f90
new file mode 100644
index 00000000000..1a411072faa
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/intent_out_6.f90
@@ -0,0 +1,39 @@
+! { dg-do run }
+!
+! PR fortran/41850
+!
+module test_module
+ implicit none
+contains
+ subroutine sub2(a)
+ implicit none
+ real,allocatable,intent(out),optional :: a(:)
+ if(present(a)) then
+ if(allocated(a)) call abort()
+ allocate(a(1))
+ a(1) = 5
+ end if
+ end subroutine sub2
+ subroutine sub1(a)
+ implicit none
+ real,allocatable,intent(out),optional :: a(:)
+! print *,'in sub1'
+ call sub2(a)
+ if(present(a)) then
+ if(a(1) /= 5) call abort()
+ end if
+ end subroutine sub1
+end module test_module
+
+program test
+ use test_module
+ implicit none
+ real, allocatable :: x(:)
+ allocate(x(1))
+ call sub1()
+ x = 8
+ call sub1(x)
+ if(x(1) /= 5) call abort()
+end program
+
+! { dg-final { cleanup-modules "test_module" } }
diff --git a/gcc/testsuite/gfortran.dg/interface_abstract_4.f90 b/gcc/testsuite/gfortran.dg/interface_abstract_4.f90
new file mode 100644
index 00000000000..50f101577e6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/interface_abstract_4.f90
@@ -0,0 +1,35 @@
+! { dg-do compile }
+!
+! PR 41873: Bogus Error: ABSTRACT INTERFACE must not be referenced...
+!
+! Contributed by Harald Anlauf <anlauf@gmx.de>
+
+ implicit none
+
+ type, abstract :: abstype
+ contains
+ procedure(f), nopass, deferred :: f_bound
+ procedure(s), nopass, deferred :: s_bound
+ end type
+
+ abstract interface
+ real function f ()
+ end function
+ end interface
+
+ abstract interface
+ subroutine s
+ end subroutine
+ end interface
+
+contains
+
+ subroutine cg (c)
+ class(abstype) :: c
+ print *, f() ! { dg-error "must not be referenced" }
+ call s ! { dg-error "must not be referenced" }
+ print *, c%f_bound ()
+ call c%s_bound ()
+ end subroutine
+
+end
diff --git a/gcc/testsuite/gfortran.dg/lto/20091015-1_0.f b/gcc/testsuite/gfortran.dg/lto/20091015-1_0.f
new file mode 100644
index 00000000000..f47e1a4ac6c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/lto/20091015-1_0.f
@@ -0,0 +1,8 @@
+! { dg-lto-do link }
+! We expect some warnings about mismatched symbol types
+! { dg-extra-ld-options "-w" }
+
+ subroutine dalie6s(iqmod6,nz,wx,cor6d)
+ common/dascr/iscrda(100),rscrri(100),iscrri(100),idao
+ call daall(iscrda,100,'$$IS ',no,nv)
+ end
diff --git a/gcc/testsuite/gfortran.dg/lto/20091015-1_1.f b/gcc/testsuite/gfortran.dg/lto/20091015-1_1.f
new file mode 100644
index 00000000000..7a64ffa6786
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/lto/20091015-1_1.f
@@ -0,0 +1,4 @@
+ SUBROUTINE DAALL(IC,L,CCC,NO,NV)
+ COMMON /main1/ eps
+ END
+
diff --git a/gcc/testsuite/gfortran.dg/lto/20091015-1_2.f b/gcc/testsuite/gfortran.dg/lto/20091015-1_2.f
new file mode 100644
index 00000000000..5bfd02227fa
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/lto/20091015-1_2.f
@@ -0,0 +1,5 @@
+ program test
+ common/main1/ eps(2)
+ dimension cor6d(2,2)
+ call dalie6s(iqmod6,1,wx,cor6d)
+ end
diff --git a/gcc/testsuite/gfortran.dg/lto/20091016-1_0.f90 b/gcc/testsuite/gfortran.dg/lto/20091016-1_0.f90
new file mode 100644
index 00000000000..c26ad90fbe2
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/lto/20091016-1_0.f90
@@ -0,0 +1,12 @@
+! { dg-lto-do link }
+! { dg-lto-options {{-flto -g -fPIC -shared} {-O -flto -g -fPIC -shared}} }
+
+ FUNCTION makenumberstring(x)
+ IMPLICIT NONE
+ REAL, INTENT(IN) :: x
+ CHARACTER(len=20) :: makenumberstring
+ INTEGER :: xx
+ xx = x**2 ! << ICE
+ makenumberstring = ''
+ END FUNCTION
+
diff --git a/gcc/testsuite/gfortran.dg/lto/20091028-1_0.f90 b/gcc/testsuite/gfortran.dg/lto/20091028-1_0.f90
new file mode 100644
index 00000000000..57c1b1f6028
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/lto/20091028-1_0.f90
@@ -0,0 +1,9 @@
+! { dg-lto-do link }
+! { dg-extra-ld-options "-r -nostdlib -finline-functions" }
+
+SUBROUTINE int_gen_ti_header_char( hdrbuf, hdrbufsize, itypesize, &
+ DataHandle, Element, VarName, Data, code )
+ CALL int_gen_ti_header_c ( hdrbuf, hdrbufsize, itypesize, 1, &
+ DataHandle, DummyData, DummyCount, code )
+END SUBROUTINE int_gen_ti_header_char
+
diff --git a/gcc/testsuite/gfortran.dg/lto/20091028-1_1.c b/gcc/testsuite/gfortran.dg/lto/20091028-1_1.c
new file mode 100644
index 00000000000..b3afc23fb8e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/lto/20091028-1_1.c
@@ -0,0 +1,11 @@
+extern void bcopy(const void *, void *, __SIZE_TYPE__ n);
+char *p;
+int int_gen_ti_header_c_ (char * hdrbuf, int * hdrbufsize,
+ int * itypesize, int * typesize,
+ int * DataHandle, char * Data,
+ int * Count, int * code)
+{
+ bcopy (typesize, p, sizeof(int)) ;
+ bcopy (Data, p, *Count * *typesize) ;
+}
+
diff --git a/gcc/testsuite/gfortran.dg/lto/20091028-2_0.f90 b/gcc/testsuite/gfortran.dg/lto/20091028-2_0.f90
new file mode 100644
index 00000000000..57c1b1f6028
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/lto/20091028-2_0.f90
@@ -0,0 +1,9 @@
+! { dg-lto-do link }
+! { dg-extra-ld-options "-r -nostdlib -finline-functions" }
+
+SUBROUTINE int_gen_ti_header_char( hdrbuf, hdrbufsize, itypesize, &
+ DataHandle, Element, VarName, Data, code )
+ CALL int_gen_ti_header_c ( hdrbuf, hdrbufsize, itypesize, 1, &
+ DataHandle, DummyData, DummyCount, code )
+END SUBROUTINE int_gen_ti_header_char
+
diff --git a/gcc/testsuite/gfortran.dg/lto/20091028-2_1.c b/gcc/testsuite/gfortran.dg/lto/20091028-2_1.c
new file mode 100644
index 00000000000..496aaf11220
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/lto/20091028-2_1.c
@@ -0,0 +1,11 @@
+extern void *memcpy(void *dest, const void *src, __SIZE_TYPE__ n);
+char *p;
+int int_gen_ti_header_c_ (char * hdrbuf, int * hdrbufsize,
+ int * itypesize, int * typesize,
+ int * DataHandle, char * Data,
+ int * Count, int * code)
+{
+ memcpy (typesize, p, sizeof(int)) ;
+ memcpy (Data, p, *Count * *typesize) ;
+}
+
diff --git a/gcc/testsuite/gfortran.dg/lto/lto.exp b/gcc/testsuite/gfortran.dg/lto/lto.exp
new file mode 100644
index 00000000000..a3707ddbd6b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/lto/lto.exp
@@ -0,0 +1,57 @@
+# Copyright (C) 2009 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+#
+# Contributed by Diego Novillo <dnovillo@google.com>
+
+
+# Test link-time optimization across multiple files.
+#
+# Programs are broken into multiple files. Each one is compiled
+# separately with LTO information. The final executable is generated
+# by collecting all the generated object files using regular LTO or WHOPR.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+# Load procedures from common libraries.
+load_lib standard.exp
+load_lib gfortran-dg.exp
+
+# Load the language-independent compabibility support procedures.
+load_lib lto.exp
+
+lto_init
+
+
+# Define an identifier for use with this suite to avoid name conflicts
+# with other lto tests running at the same time.
+set sid "f_lto"
+
+# If LTO has not been enabled, bail.
+if { ![check_effective_target_lto] } {
+ return
+}
+
+# Main loop.
+foreach src [lsort [glob -nocomplain $srcdir/$subdir/*_0.\[fF\]{,90,95,03,08} ]] {
+ # If we're only testing specific files and this isn't one of them, skip it.
+ if ![runtest_file_p $runtests $src] then {
+ continue
+ }
+
+ lto-execute $src $sid
+}
diff --git a/gcc/testsuite/gfortran.dg/lto/pr40724_0.f b/gcc/testsuite/gfortran.dg/lto/pr40724_0.f
new file mode 100644
index 00000000000..2d7a9864e40
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/lto/pr40724_0.f
@@ -0,0 +1,3 @@
+ subroutine f
+ print *, "Hello World"
+ end
diff --git a/gcc/testsuite/gfortran.dg/lto/pr40724_1.f b/gcc/testsuite/gfortran.dg/lto/pr40724_1.f
new file mode 100644
index 00000000000..ed8f31020dd
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/lto/pr40724_1.f
@@ -0,0 +1,3 @@
+ program test
+ call f
+ end
diff --git a/gcc/testsuite/gfortran.dg/lto/pr40725_0.f03 b/gcc/testsuite/gfortran.dg/lto/pr40725_0.f03
new file mode 100644
index 00000000000..2f33a0f5bf4
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/lto/pr40725_0.f03
@@ -0,0 +1,16 @@
+module bind_c_dts_2
+use, intrinsic :: iso_c_binding
+implicit none
+type, bind(c) :: my_c_type_1
+ integer(c_int) :: j
+end type my_c_type_1
+contains
+ subroutine sub0(my_type, expected_j) bind(c)
+ type(my_c_type_1) :: my_type
+ integer(c_int), value :: expected_j
+ if (my_type%j .ne. expected_j) then
+ call abort ()
+ end if
+ end subroutine sub0
+end module bind_c_dts_2
+
diff --git a/gcc/testsuite/gfortran.dg/lto/pr40725_1.c b/gcc/testsuite/gfortran.dg/lto/pr40725_1.c
new file mode 100644
index 00000000000..7de46b8a988
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/lto/pr40725_1.c
@@ -0,0 +1,12 @@
+typedef struct c_type_1
+{
+ int j;
+} c_type_1_t;
+void sub0(c_type_1_t *c_type, int expected_j);
+int main(int argc, char **argv)
+{
+ c_type_1_t c_type;
+ c_type.j = 11;
+ sub0(&c_type, c_type.j);
+ return 0;
+}
diff --git a/gcc/testsuite/gfortran.dg/lto/pr41069_0.f90 b/gcc/testsuite/gfortran.dg/lto/pr41069_0.f90
new file mode 100644
index 00000000000..4e7d65939c8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/lto/pr41069_0.f90
@@ -0,0 +1,7 @@
+! { dg-lto-do link }
+SUBROUTINE mltfftsg ( a, ldax, lday )
+ INTEGER, PARAMETER :: dbl = SELECTED_REAL_KIND ( 14, 200 )
+ INTEGER, INTENT ( IN ) :: ldax, lday
+ COMPLEX ( dbl ), INTENT ( INOUT ) :: a ( ldax, lday )
+END SUBROUTINE mltfftsg
+
diff --git a/gcc/testsuite/gfortran.dg/lto/pr41069_1.f90 b/gcc/testsuite/gfortran.dg/lto/pr41069_1.f90
new file mode 100644
index 00000000000..0c4e05d66d3
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/lto/pr41069_1.f90
@@ -0,0 +1,10 @@
+SUBROUTINE S(zin)
+ COMPLEX(8), DIMENSION(3,3,3) :: zin
+ INTEGER :: m,n
+ CALL mltfftsg ( zin, m, n )
+END SUBROUTINE
+
+COMPLEX(8), DIMENSION(3,3,3) :: zin
+CALL s(zin)
+END
+
diff --git a/gcc/testsuite/gfortran.dg/lto/pr41069_2.f90 b/gcc/testsuite/gfortran.dg/lto/pr41069_2.f90
new file mode 100644
index 00000000000..121603eaa60
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/lto/pr41069_2.f90
@@ -0,0 +1,9 @@
+SUBROUTINE fftsg3d ( n, zout )
+ INTEGER, PARAMETER :: dp = SELECTED_REAL_KIND ( 14, 200 )
+ INTEGER, DIMENSION(*), INTENT(IN) :: n
+ COMPLEX(KIND=dp), DIMENSION(*), INTENT(INOUT) :: zout
+ INTEGER :: nx
+ nx = n ( 1 )
+ CALL mltfftsg ( zout, nx, nx )
+END SUBROUTINE fftsg3d
+
diff --git a/gcc/testsuite/gfortran.dg/lto/pr41521_0.f90 b/gcc/testsuite/gfortran.dg/lto/pr41521_0.f90
new file mode 100644
index 00000000000..d882779263d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/lto/pr41521_0.f90
@@ -0,0 +1,9 @@
+! { dg-lto-do link }
+! { dg-lto-options {{-g -flto} {-g -O -flto}} }
+program species
+integer spk(2)
+real eval(2)
+spk = 2
+call atom(1.1,spk,eval)
+end program
+
diff --git a/gcc/testsuite/gfortran.dg/lto/pr41521_1.f90 b/gcc/testsuite/gfortran.dg/lto/pr41521_1.f90
new file mode 100644
index 00000000000..897e7aded0a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/lto/pr41521_1.f90
@@ -0,0 +1,9 @@
+subroutine atom(sol,k,eval)
+real, intent(in) :: sol
+integer, intent(in) :: k(2)
+real, intent(out) :: eval(2)
+real t1
+ t1=sqrt(dble(k(1)**2)-(sol)**2)
+ eval(1)=sol**2/sqrt(t1)-sol**2
+end subroutine
+
diff --git a/gcc/testsuite/gfortran.dg/lto/pr41764_0.f b/gcc/testsuite/gfortran.dg/lto/pr41764_0.f
new file mode 100644
index 00000000000..fd231508383
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/lto/pr41764_0.f
@@ -0,0 +1,13 @@
+! { dg-lto-do link }
+! FIXME: This test used to fail with gold and -fuse-linker-plugin. It is
+! here for people testing with RUNTESTFLAGS=-fuse-linker-plugin, but it would
+! be nice to create "dg-effective-target-supports linker-plugin" and use it.
+ PROGRAM INIRAN
+ INTEGER IX, IY, IZ
+ COMMON /XXXRAN/ IX, IY, IZ
+ END
+ BLOCKDATA RAEWIN
+ INTEGER IX, IY, IZ
+ COMMON /XXXRAN/ IX, IY, IZ
+ DATA IX, IY, IZ / 1974, 235, 337 /
+ END
diff --git a/gcc/testsuite/gfortran.dg/missing_optional_dummy_6.f90 b/gcc/testsuite/gfortran.dg/missing_optional_dummy_6.f90
new file mode 100644
index 00000000000..408582289f1
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/missing_optional_dummy_6.f90
@@ -0,0 +1,60 @@
+! { dg-do run }
+! { dg-options "-fdump-tree-original" }
+!
+! PR fortran/41907
+!
+program test
+ implicit none
+ call scalar1 ()
+ call assumed_shape1 ()
+ call explicit_shape1 ()
+contains
+
+ ! Calling functions
+ subroutine scalar1 (slr1)
+ integer, optional :: slr1
+ call scalar2 (slr1)
+ end subroutine scalar1
+
+ subroutine assumed_shape1 (as1)
+ integer, dimension(:), optional :: as1
+ call assumed_shape2 (as1)
+ call explicit_shape2 (as1)
+ end subroutine assumed_shape1
+
+ subroutine explicit_shape1 (es1)
+ integer, dimension(5), optional :: es1
+ call assumed_shape2 (es1)
+ call explicit_shape2 (es1)
+ end subroutine explicit_shape1
+
+
+ ! Called functions
+ subroutine assumed_shape2 (as2)
+ integer, dimension(:),optional :: as2
+ if (present (as2)) call abort()
+ end subroutine assumed_shape2
+
+ subroutine explicit_shape2 (es2)
+ integer, dimension(5),optional :: es2
+ if (present (es2)) call abort()
+ end subroutine explicit_shape2
+
+ subroutine scalar2 (slr2)
+ integer, optional :: slr2
+ if (present (slr2)) call abort()
+ end subroutine scalar2
+
+end program test
+
+! { dg-final { scan-tree-dump-times "scalar2 \\(slr1" 1 "original" } }
+
+! { dg-final { scan-tree-dump-times "= es1 != 0B" 1 "original" } }
+! { dg-final { scan-tree-dump-times "assumed_shape2 \\(es1" 0 "original" } }
+! { dg-final { scan-tree-dump-times "explicit_shape2 \\(es1" 1 "original" } }
+
+! { dg-final { scan-tree-dump-times "= as1 != 0B" 2 "original" } }
+! { dg-final { scan-tree-dump-times "assumed_shape2 \\(as1" 0 "original" } }
+! { dg-final { scan-tree-dump-times "explicit_shape2 \\(as1" 0 "original" } }
+
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/module_md5_1.f90 b/gcc/testsuite/gfortran.dg/module_md5_1.f90
index 7aeeb800f10..88002c204bf 100644
--- a/gcc/testsuite/gfortran.dg/module_md5_1.f90
+++ b/gcc/testsuite/gfortran.dg/module_md5_1.f90
@@ -10,5 +10,5 @@ program test
use foo
print *, pi
end program test
-! { dg-final { scan-module "foo" "MD5:dc2fd1358dcaddc25e3c89dae859ef32" } }
+! { dg-final { scan-module "foo" "MD5:9c43cf4d713824ec6894b83250720e68" } }
! { dg-final { cleanup-modules "foo" } }
diff --git a/gcc/testsuite/gfortran.dg/round_2.f03 b/gcc/testsuite/gfortran.dg/round_2.f03
new file mode 100644
index 00000000000..62190d71673
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/round_2.f03
@@ -0,0 +1,24 @@
+! { dg-do run }
+! PR35962 Implement F2003 rounding modes.
+! Test case prepared by Jerry Delisle <jvdelisle@gcc.gnu.org>
+integer,parameter :: j = max(4, selected_real_kind (precision (0.0_4) + 1))
+integer,parameter :: k = max(4, selected_real_kind (precision (0.0_8) + 1))
+character(64) :: line
+ write(line, '(RN, 4F10.3)') 0.0625_j, 0.1875_j
+ if (line.ne." 0.062 0.188") call abort
+ write(line, '(RN, 4F10.2)') 0.125_j, 0.375_j, 1.125_j, 1.375_j
+ if (line.ne." 0.12 0.38 1.12 1.38") call abort
+ write(line, '(RN, 4F10.1)') 0.25_j, 0.75_j, 1.25_j, 1.75_j
+ if (line.ne." 0.2 0.8 1.2 1.8") call abort
+ write(line, '(RN, 4F10.0)') 0.5_j, 1.5_j, 2.5_j, 3.5_j
+ if (line.ne." 0. 2. 2. 4.") call abort
+
+ write(line, '(RN, 4F10.3)') 0.0625_k, 0.1875_k
+ if (line.ne." 0.062 0.188") call abort
+ write(line, '(RN, 4F10.2)') 0.125_k, 0.375_k, 1.125_k, 1.375_k
+ if (line.ne." 0.12 0.38 1.12 1.38") call abort
+ write(line, '(RN, 4F10.1)') 0.25_k, 0.75_k, 1.25_k, 1.75_k
+ if (line.ne." 0.2 0.8 1.2 1.8") call abort
+ write(line, '(RN, 4F10.0)') 0.5_k, 1.5_k, 2.5_k, 3.5_k
+ if (line.ne." 0. 2. 2. 4.") call abort
+end
diff --git a/gcc/testsuite/gfortran.dg/same_type_as_2.f03 b/gcc/testsuite/gfortran.dg/same_type_as_2.f03
index 9a2110d47b6..6fd03117007 100644
--- a/gcc/testsuite/gfortran.dg/same_type_as_2.f03
+++ b/gcc/testsuite/gfortran.dg/same_type_as_2.f03
@@ -8,12 +8,11 @@
integer :: i
end type
- type :: t2
+ type, extends(t1) :: t2
integer :: j
end type
- CLASS(t1), pointer :: c1
- CLASS(t2), pointer :: c2
+ CLASS(t1), pointer :: c1,c2
TYPE(t1), target :: x1
TYPE(t2) ,target :: x2
diff --git a/gcc/testsuite/gfortran.dg/select_type_1.f03 b/gcc/testsuite/gfortran.dg/select_type_1.f03
index e764ec98f48..6a7db2e8954 100644
--- a/gcc/testsuite/gfortran.dg/select_type_1.f03
+++ b/gcc/testsuite/gfortran.dg/select_type_1.f03
@@ -30,8 +30,8 @@
type is (t1) ! { dg-error "Unexpected TYPE IS statement" }
- select type (3.5) ! { dg-error "Selector must be a named variable" }
- select type (a%cp) ! { dg-error "Selector must be a named variable" }
+ select type (3.5) ! { dg-error "is not a named variable" }
+ select type (a%cp) ! { dg-error "is not a named variable" }
select type (b) ! { dg-error "Selector shall be polymorphic" }
select type (a)
diff --git a/gcc/testsuite/gfortran.dg/select_type_5.f03 b/gcc/testsuite/gfortran.dg/select_type_5.f03
new file mode 100644
index 00000000000..ec9d3cd8d17
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/select_type_5.f03
@@ -0,0 +1,47 @@
+! { dg-do run }
+!
+! SELECT TYPE with associate-name
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+
+ type :: t1
+ integer :: i = -1
+ class(t1), pointer :: c
+ end type t1
+
+ type, extends(t1) :: t2
+ integer :: j = -1
+ end type t2
+
+ type(t2), target :: b
+ integer :: aa
+
+ b%c => b
+ aa = 5
+
+ select type (aa => b%c)
+ type is (t1)
+ aa%i = 1
+ type is (t2)
+ aa%j = 2
+ end select
+
+ print *,b%i,b%j
+ if (b%i /= -1) call abort()
+ if (b%j /= 2) call abort()
+
+ select type (aa => b%c)
+ type is (t1)
+ aa%i = 4
+ type is (t2)
+ aa%i = 3*aa%j
+ end select
+
+ print *,b%i,b%j
+ if (b%i /= 6) call abort()
+ if (b%j /= 2) call abort()
+
+ print *,aa
+ if (aa/=5) call abort()
+
+end
diff --git a/gcc/testsuite/gfortran.dg/select_type_6.f03 b/gcc/testsuite/gfortran.dg/select_type_6.f03
new file mode 100644
index 00000000000..3b3c08e2296
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/select_type_6.f03
@@ -0,0 +1,38 @@
+! { dg-do run }
+!
+! PR 41579: [OOP/Polymorphism] Nesting of SELECT TYPE
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+
+ type t1
+ end type t1
+
+ type, extends(t1) :: t2
+ integer :: i
+ end type t2
+
+ type, extends(t1) :: t3
+ integer :: j
+ end type t3
+
+ class(t1), allocatable :: mt2, mt3
+ allocate(t2 :: mt2)
+ allocate(t3 :: mt3)
+
+ select type (mt2)
+ type is(t2)
+ mt2%i = 5
+ print *,mt2%i
+ select type(mt3)
+ type is(t3)
+ mt3%j = 2*mt2%i
+ print *,mt3%j
+ if (mt3%j /= 10) call abort()
+ class default
+ call abort()
+ end select
+ class default
+ call abort()
+ end select
+
+end
diff --git a/gcc/testsuite/gfortran.dg/select_type_7.f03 b/gcc/testsuite/gfortran.dg/select_type_7.f03
new file mode 100644
index 00000000000..554b6cd122d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/select_type_7.f03
@@ -0,0 +1,40 @@
+! { dg-do run }
+!
+! PR 41766: [OOP] SELECT TYPE selector as actual argument with INTENT(INOUT)
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+
+ implicit none
+
+ type t1
+ integer :: a
+ end type
+
+ type, extends(t1) :: t2
+ integer :: b
+ end type
+
+ class(t1),allocatable :: cp
+
+ allocate(t2 :: cp)
+
+ select type (cp)
+ type is (t2)
+ cp%a = 98
+ cp%b = 76
+ call s(cp)
+ print *,cp%a,cp%b
+ if (cp%a /= cp%b) call abort()
+ class default
+ call abort()
+ end select
+
+contains
+
+ subroutine s(f)
+ type(t2), intent(inout) :: f
+ f%a = 3
+ f%b = 3
+ end subroutine
+
+end
diff --git a/gcc/testsuite/gfortran.dg/transfer_intrinsic_3.f90 b/gcc/testsuite/gfortran.dg/transfer_intrinsic_3.f90
new file mode 100644
index 00000000000..f0b9b546877
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/transfer_intrinsic_3.f90
@@ -0,0 +1,38 @@
+! { dg-do run }
+! Tests the fix for PR41772 in which the empty array reference
+! 'qname(1:n-1)' was not handled correctly in TRANSFER.
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+!
+module m
+ implicit none
+contains
+ pure function str_vs(vs) result(s)
+ character, dimension(:), intent(in) :: vs
+ character(len=size(vs)) :: s
+ s = transfer(vs, s)
+ end function str_vs
+ subroutine has_key_ns(uri, localname, n)
+ character(len=*), intent(in) :: uri, localname
+ integer, intent(in) :: n
+ if ((n .lt. 2) .and. (len (uri) .ne. 0)) then
+ call abort
+ else IF ((n .ge. 2) .and. (len (uri) .ne. n - 1)) then
+ call abort
+ end if
+ end subroutine
+end module m
+
+ use m
+ implicit none
+ character, dimension(:), pointer :: QName
+ integer :: n
+ allocate(qname(6))
+ qname = (/ 'a','b','c','d','e','f' /)
+
+ do n = 0, 3
+ call has_key_ns(str_vs(qname(1:n-1)),"", n)
+ end do
+ deallocate(qname)
+end
+! { dg-final { cleanup-modules "m" } } \ No newline at end of file
diff --git a/gcc/testsuite/gfortran.dg/typebound_operator_2.f03 b/gcc/testsuite/gfortran.dg/typebound_operator_2.f03
index 57b34486313..b8dc5c9d104 100644
--- a/gcc/testsuite/gfortran.dg/typebound_operator_2.f03
+++ b/gcc/testsuite/gfortran.dg/typebound_operator_2.f03
@@ -50,7 +50,6 @@ CONTAINS
LOGICAL FUNCTION func (me, b) ! { dg-error "must be a SUBROUTINE" }
CLASS(t), INTENT(OUT) :: me
CLASS(t), INTENT(IN) :: b
- me = t ()
func = .TRUE.
END FUNCTION func
diff --git a/gcc/testsuite/gfortran.dg/typebound_operator_4.f03 b/gcc/testsuite/gfortran.dg/typebound_operator_4.f03
index 1ce2b97a0d7..835ceb63ff0 100644
--- a/gcc/testsuite/gfortran.dg/typebound_operator_4.f03
+++ b/gcc/testsuite/gfortran.dg/typebound_operator_4.f03
@@ -37,7 +37,7 @@ CONTAINS
PURE SUBROUTINE assign_int (dest, from)
CLASS(myint), INTENT(OUT) :: dest
INTEGER, INTENT(IN) :: from
- dest = myint (from)
+ dest%value = from
END SUBROUTINE assign_int
TYPE(myreal) FUNCTION add_real (a, b)
@@ -49,7 +49,7 @@ CONTAINS
SUBROUTINE assign_real (dest, from)
CLASS(myreal), INTENT(OUT) :: dest
REAL, INTENT(IN) :: from
- dest = myreal (from)
+ dest%value = from
END SUBROUTINE assign_real
SUBROUTINE in_module ()
diff --git a/gcc/testsuite/gfortran.dg/vect/fast-math-pr38968.f90 b/gcc/testsuite/gfortran.dg/vect/fast-math-pr38968.f90
index abb3c5f10df..3b8ac9defc3 100644
--- a/gcc/testsuite/gfortran.dg/vect/fast-math-pr38968.f90
+++ b/gcc/testsuite/gfortran.dg/vect/fast-math-pr38968.f90
@@ -1,3 +1,4 @@
+! { dg-timeout-factor 4.0 }
program mymatmul
implicit none
integer, parameter :: kp = 4
diff --git a/gcc/testsuite/gfortran.dg/vect/vect-2.f90 b/gcc/testsuite/gfortran.dg/vect/vect-2.f90
index adc8d9c0b84..0f45a70c53b 100644
--- a/gcc/testsuite/gfortran.dg/vect/vect-2.f90
+++ b/gcc/testsuite/gfortran.dg/vect/vect-2.f90
@@ -15,9 +15,8 @@ END
! support unaligned loads).
! { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } }
-! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" { xfail { { vect_no_align || vect_hw_misalign } || {! vector_alignment_reachable} } } } }
-! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { target { vect_no_align && { {! vector_alignment_reachable } && {! vect_hw_misalign } } } } } }
-! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_hw_misalign} } } }
-! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 5 "vect" { target vect_hw_misalign } } }
-! { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" {target { vect_no_align || { {! vector_alignment_reachable } && {! vect_hw_misalign }} } } } }
+! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" { xfail { vect_no_align || { ! vector_alignment_reachable } } } } }
+! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { target { vect_no_align && { ! vector_alignment_reachable } } } } }
+! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align } } } }
+! { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" {target { vect_no_align || { { ! vector_alignment_reachable } && { ! vect_hw_misalign } } } } } }
! { dg-final { cleanup-tree-dump "vect" } }
diff --git a/gcc/testsuite/gfortran.dg/vect/vect-3.f90 b/gcc/testsuite/gfortran.dg/vect/vect-3.f90
index c0d7f0001d5..5fc4fbf49e3 100644
--- a/gcc/testsuite/gfortran.dg/vect/vect-3.f90
+++ b/gcc/testsuite/gfortran.dg/vect/vect-3.f90
@@ -7,11 +7,9 @@ Y = Y + A * X
END
! { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target vect_no_align } } }
-! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target vect_no_align } } }
! { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { {! vect_no_align} && { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } }
! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { {! vect_no_align} && { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } }
-! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" {target vect_hw_misalign} } }
-! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align || vect_hw_misalign } || {! vector_alignment_reachable}} } } }
-! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { { vect_no_align || vect_hw_misalign } || { ! vector_alignment_reachable} } } } }
+! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || {! vector_alignment_reachable}} } } }
+! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { { vect_no_align } || { ! vector_alignment_reachable} } } } }
! { dg-final { cleanup-tree-dump "vect" } }
diff --git a/gcc/testsuite/gfortran.dg/vect/vect-4.f90 b/gcc/testsuite/gfortran.dg/vect/vect-4.f90
index 34047343692..592282fb09b 100644
--- a/gcc/testsuite/gfortran.dg/vect/vect-4.f90
+++ b/gcc/testsuite/gfortran.dg/vect/vect-4.f90
@@ -10,9 +10,8 @@ Y = Y + A * X
END
! { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } }
-! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align || vect_hw_misalign } || {! vector_alignment_reachable} } } } }
-! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { { vect_no_align || vect_hw_misalign } || {! vector_alignment_reachable} } } } }
-! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_hw_misalign } } }
+! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align } || {! vector_alignment_reachable} } } } }
+! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { { vect_no_align } || {! vector_alignment_reachable} } } } }
! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } }
! { dg-final { scan-tree-dump-times "accesses have the same alignment." 1 "vect" } }
! { dg-final { cleanup-tree-dump "vect" } }
diff --git a/gcc/testsuite/gfortran.dg/vect/vect-5.f90 b/gcc/testsuite/gfortran.dg/vect/vect-5.f90
index c562a81bacc..72776a6fb49 100644
--- a/gcc/testsuite/gfortran.dg/vect/vect-5.f90
+++ b/gcc/testsuite/gfortran.dg/vect/vect-5.f90
@@ -36,9 +36,8 @@
end
! { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } }
-! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align || vect_hw_misalign } || {! vector_alignment_reachable} } } } }
-! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align || vect_hw_misalign } } } }
-! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { vect_hw_misalign } } } }
+! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || {! vector_alignment_reachable} } } } }
+! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align } } } }
! { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target { vect_no_align } } } }
! { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } }
! { dg-final { cleanup-tree-dump "vect" } }
diff --git a/gcc/testsuite/gfortran.dg/whole_file_5.f90 b/gcc/testsuite/gfortran.dg/whole_file_5.f90
index 07ba4411c4c..c6ad9e1b448 100644
--- a/gcc/testsuite/gfortran.dg/whole_file_5.f90
+++ b/gcc/testsuite/gfortran.dg/whole_file_5.f90
@@ -1,6 +1,6 @@
! { dg-do "compile" }
! { dg-options "-O3 -fwhole-file -fdump-tree-optimized" }
-! { dg-options "-O3 -fwhole-file -fdump-tree-optimized -fpie" { target { ! nonpic } } }
+! { dg-add-options bind_pic_locally }
!
! Check that inlining of functions declared BEFORE usage works.
! If yes, then the dump does not contain a call to F().
diff --git a/gcc/testsuite/gfortran.dg/whole_file_6.f90 b/gcc/testsuite/gfortran.dg/whole_file_6.f90
index f903c7aefc5..274b8a99c6c 100644
--- a/gcc/testsuite/gfortran.dg/whole_file_6.f90
+++ b/gcc/testsuite/gfortran.dg/whole_file_6.f90
@@ -1,6 +1,6 @@
! { dg-do "compile" }
! { dg-options "-O3 -fwhole-file -fdump-tree-optimized" }
-! { dg-options "-O3 -fwhole-file -fdump-tree-optimized -fpie" { target { ! nonpic } } }
+! { dg-add-options bind_pic_locally }
!
! Check that inlining of functions declared AFTER usage works.
! If yes, then the dump does not contain a call to F().
diff --git a/gcc/testsuite/gfortran.fortran-torture/compile/pr41654.f90 b/gcc/testsuite/gfortran.fortran-torture/compile/pr41654.f90
new file mode 100644
index 00000000000..aa61905deaf
--- /dev/null
+++ b/gcc/testsuite/gfortran.fortran-torture/compile/pr41654.f90
@@ -0,0 +1,15 @@
+SUBROUTINE SCANBUFR (LBUFRIGNOREERROR, LBOPRPRO, LLSPLIT)
+LOGICAL :: LBUFRIGNOREERROR, LBOPRPRO, LLSPLIT
+INTEGER :: IBOTYP, IBSTYP
+IF ((IBOTYP.eq.0).AND.(IBSTYP.eq.1)) GO TO 251
+IF ((IBOTYP.eq.0).AND.(IBSTYP.eq.3)) GO TO 251
+IF(LBUFRIGNOREERROR) THEN
+ goto 360
+ENDIF
+251 CONTINUE
+IF(LBOPRPRO.AND.LLSPLIT) THEN
+ CALL OBSCREEN
+ENDIF
+360 CONTINUE
+END SUBROUTINE SCANBUFR
+
diff --git a/gcc/testsuite/gnat.dg/aggr11.adb b/gcc/testsuite/gnat.dg/aggr11.adb
new file mode 100644
index 00000000000..1771d62cacb
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/aggr11.adb
@@ -0,0 +1,17 @@
+-- { dg-do compile }
+-- { dg-options "-O" }
+
+with Aggr11_Pkg; use Aggr11_Pkg;
+
+procedure Aggr11 is
+
+ A : Arr := ((1 => (Kind => No_Error, B => True),
+ 2 => (Kind => Error),
+ 3 => (Kind => Error),
+ 4 => (Kind => No_Error, B => True),
+ 5 => (Kind => No_Error, B => True),
+ 6 => (Kind => No_Error, B => True)));
+
+begin
+ null;
+end;
diff --git a/gcc/testsuite/gnat.dg/aggr11_pkg.ads b/gcc/testsuite/gnat.dg/aggr11_pkg.ads
new file mode 100644
index 00000000000..37008605a30
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/aggr11_pkg.ads
@@ -0,0 +1,14 @@
+package Aggr11_Pkg is
+
+ type Error_Type is (No_Error, Error);
+
+ type Rec (Kind : Error_Type := No_Error) is record
+ case Kind is
+ when Error => null;
+ when others => B : Boolean;
+ end case;
+ end record;
+
+ type Arr is array (1..6) of Rec;
+
+end Aggr11_Pkg;
diff --git a/gcc/testsuite/gnat.dg/discr21.adb b/gcc/testsuite/gnat.dg/discr21.adb
new file mode 100644
index 00000000000..5c105cdb25c
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/discr21.adb
@@ -0,0 +1,34 @@
+-- { dg-do compile }
+-- { dg-options "-gnatws -O3" }
+
+with Discr21_Pkg; use Discr21_Pkg;
+
+package body Discr21 is
+
+ type Index is new Natural range 0 .. 100;
+
+ type Arr is array (Index range <> ) of Position;
+
+ type Rec(Size : Index := 1) is record
+ A : Arr(1 .. Size);
+ end record;
+
+ Data : Rec;
+
+ function To_V(pos : Position) return VPosition is
+ begin
+ return To_Position(pos.x, pos.y, pos.z);
+ end;
+
+ procedure Read(Data : Rec) is
+ pos : VPosition := To_V (Data.A(1));
+ begin
+ null;
+ end;
+
+ procedure Test is
+ begin
+ Read (Data);
+ end;
+
+end Discr21;
diff --git a/gcc/testsuite/gnat.dg/discr21.ads b/gcc/testsuite/gnat.dg/discr21.ads
new file mode 100644
index 00000000000..8de8ed08b76
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/discr21.ads
@@ -0,0 +1,5 @@
+package Discr21 is
+
+ procedure Test;
+
+end Discr21;
diff --git a/gcc/testsuite/gnat.dg/discr21_pkg.ads b/gcc/testsuite/gnat.dg/discr21_pkg.ads
new file mode 100644
index 00000000000..d156df62517
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/discr21_pkg.ads
@@ -0,0 +1,19 @@
+package Discr21_Pkg is
+
+ type Position is record
+ x,y,z : Float;
+ end record;
+
+ type Dim is (Two, Three);
+
+ type VPosition (D: Dim := Three) is record
+ x, y : Float;
+ case D is
+ when Two => null;
+ when Three => z : Float;
+ end case;
+ end record;
+
+ function To_Position (x, y, z : Float) return VPosition;
+
+end Discr21_Pkg;
diff --git a/gcc/testsuite/gnat.dg/discr22.adb b/gcc/testsuite/gnat.dg/discr22.adb
new file mode 100644
index 00000000000..af4f9ab7899
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/discr22.adb
@@ -0,0 +1,23 @@
+-- { dg-do compile }
+-- { dg-options "-gnatws" }
+
+procedure Discr22 is
+
+ subtype Precision is Integer range 1 .. 5;
+
+ type Rec(D1 : Precision; D2 : Integer) is record
+ case D1 is
+ when 1 => I : Integer;
+ when others => null;
+ end case;
+ end record;
+ for Rec use record
+ D1 at 0 range 0 .. 7;
+ end record;
+
+ P : Precision;
+ X : Rec(P, 0);
+
+begin
+ null;
+end;
diff --git a/gcc/testsuite/gnat.dg/loop_optimization7.adb b/gcc/testsuite/gnat.dg/loop_optimization7.adb
new file mode 100644
index 00000000000..16683949465
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/loop_optimization7.adb
@@ -0,0 +1,16 @@
+-- { dg-do compile }
+-- { dg-options "-O3" }
+-- { dg-options "-O3 -msse" { target i?86-*-* x86_64-*-* } }
+
+package body Loop_Optimization7 is
+
+ function Conv (A : Arr) return Arr is
+ Result : Arr;
+ begin
+ for I in A'Range loop
+ Result (I) := Conv (A (I));
+ end loop;
+ return Result;
+ end;
+
+end Loop_Optimization7;
diff --git a/gcc/testsuite/gnat.dg/loop_optimization7.ads b/gcc/testsuite/gnat.dg/loop_optimization7.ads
new file mode 100644
index 00000000000..ab0a165ea90
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/loop_optimization7.ads
@@ -0,0 +1,9 @@
+with Loop_Optimization7_Pkg; use Loop_Optimization7_Pkg;
+
+package Loop_Optimization7 is
+
+ type Arr is array (1..8) of Rec;
+
+ function Conv (A : Arr) return Arr;
+
+end Loop_Optimization7;
diff --git a/gcc/testsuite/gnat.dg/loop_optimization7_pkg.ads b/gcc/testsuite/gnat.dg/loop_optimization7_pkg.ads
new file mode 100644
index 00000000000..0eaefa1b0f3
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/loop_optimization7_pkg.ads
@@ -0,0 +1,10 @@
+package Loop_Optimization7_Pkg is
+ pragma Pure;
+
+ type Rec is record
+ F : Float;
+ end record;
+
+ function Conv (Trig : Rec) return Rec;
+
+end Loop_Optimization7_Pkg;
diff --git a/gcc/testsuite/gnat.dg/nested_proc.adb b/gcc/testsuite/gnat.dg/nested_proc1.adb
index 144533c2832..b3abf262578 100644
--- a/gcc/testsuite/gnat.dg/nested_proc.adb
+++ b/gcc/testsuite/gnat.dg/nested_proc1.adb
@@ -2,7 +2,7 @@
-- Test that a static link is correctly passed to a subprogram which is
-- indirectly called through an aggregate.
-procedure Nested_Proc is
+procedure Nested_Proc1 is
I : Integer := 0;
diff --git a/gcc/testsuite/gnat.dg/nested_proc2.adb b/gcc/testsuite/gnat.dg/nested_proc2.adb
new file mode 100644
index 00000000000..b5349563a99
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/nested_proc2.adb
@@ -0,0 +1,30 @@
+-- { dg-do compile }
+-- { dg-options "-gnatws" }
+
+procedure Nested_Proc2 is
+
+ type Arr is array(1..2) of Integer;
+
+ type Rec is record
+ Data : Arr;
+ end record;
+
+ From : Rec;
+ Index : Integer;
+
+ function F (X : Arr) return Integer is
+ begin
+ return 0;
+ end;
+
+ procedure Test is
+ begin
+ Index := F (From.Data);
+ If Index /= 0 then
+ raise Program_Error;
+ end if;
+ end;
+
+begin
+ Test;
+end;
diff --git a/gcc/testsuite/gnat.dg/noreturn1.adb b/gcc/testsuite/gnat.dg/noreturn1.adb
new file mode 100644
index 00000000000..83eafe7f364
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/noreturn1.adb
@@ -0,0 +1,15 @@
+-- { dg-compile }
+
+package body Noreturn1 is
+
+ procedure Error (E : in Exception_Occurrence) is
+ Occurrence_Message : constant String := Exception_Message (E);
+ begin
+ if Occurrence_Message = "$" then
+ raise Program_Error;
+ else
+ raise Constraint_Error;
+ end if;
+ end;
+
+end Noreturn1;
diff --git a/gcc/testsuite/gnat.dg/noreturn1.ads b/gcc/testsuite/gnat.dg/noreturn1.ads
new file mode 100644
index 00000000000..c63e4399907
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/noreturn1.ads
@@ -0,0 +1,8 @@
+with Ada.Exceptions; use Ada.Exceptions;
+
+package Noreturn1 is
+
+ procedure Error (E : in Exception_Occurrence);
+ pragma No_Return (Error);
+
+end Noreturn1;
diff --git a/gcc/testsuite/gnat.dg/noreturn2.adb b/gcc/testsuite/gnat.dg/noreturn2.adb
new file mode 100644
index 00000000000..5caf222f29b
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/noreturn2.adb
@@ -0,0 +1,23 @@
+-- { dg-do compile }
+
+package body Noreturn2 is
+
+ procedure Raise_Exception_No_Defer (Message : String);
+ pragma No_Return (Raise_Exception_No_Defer);
+
+ procedure Raise_From (X : Exception_Occurrence) is
+ Occurrence_Message : constant String := Exception_Message (X);
+ begin
+ if Occurrence_Message = "$" then
+ Raise_Exception_No_Defer (Occurrence_Message);
+ else
+ Raise_Exception_No_Defer ("::" & Occurrence_Message);
+ end if;
+ end;
+
+ procedure Raise_Exception_No_Defer (Message : String) is
+ begin
+ raise Program_Error;
+ end;
+
+end Noreturn2;
diff --git a/gcc/testsuite/gnat.dg/noreturn2.ads b/gcc/testsuite/gnat.dg/noreturn2.ads
new file mode 100644
index 00000000000..1aaf4e97446
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/noreturn2.ads
@@ -0,0 +1,8 @@
+with Ada.Exceptions; use Ada.Exceptions;
+
+package Noreturn2 is
+
+ procedure Raise_From (X : Exception_Occurrence);
+ pragma No_Return (Raise_From);
+
+end Noreturn2;
diff --git a/gcc/testsuite/gnat.dg/null_pointer_deref1.adb b/gcc/testsuite/gnat.dg/null_pointer_deref1.adb
new file mode 100644
index 00000000000..6e7bf14e5df
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/null_pointer_deref1.adb
@@ -0,0 +1,21 @@
+-- { dg-do run }
+-- { dg-options "-gnatp" }
+
+-- This test requires architecture- and OS-specific support code for unwinding
+-- through signal frames (typically located in *-unwind.h) to pass. Feel free
+-- to disable it if this code hasn't been implemented yet.
+
+procedure Null_Pointer_Deref1 is
+ type Int_Ptr is access all Integer;
+
+ function Ident return Int_Ptr is
+ begin
+ return null;
+ end;
+
+ Data : Int_Ptr := Ident;
+begin
+ Data.all := 1;
+exception
+ when Constraint_Error | Storage_Error => null;
+end;
diff --git a/gcc/testsuite/gnat.dg/null_pointer_deref2.adb b/gcc/testsuite/gnat.dg/null_pointer_deref2.adb
new file mode 100644
index 00000000000..63e2dd11f39
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/null_pointer_deref2.adb
@@ -0,0 +1,28 @@
+-- { dg-do run }
+-- { dg-options "-gnatp" }
+
+-- This test requires architecture- and OS-specific support code for unwinding
+-- through signal frames (typically located in *-unwind.h) to pass. Feel free
+-- to disable it if this code hasn't been implemented yet.
+
+procedure Null_Pointer_Deref2 is
+
+ task T;
+
+ task body T is
+ type Int_Ptr is access all Integer;
+
+ function Ident return Int_Ptr is
+ begin
+ return null;
+ end;
+ Data : Int_Ptr := Ident;
+ begin
+ Data.all := 1;
+ exception
+ when Constraint_Error | Storage_Error => null;
+ end T;
+
+begin
+ null;
+end;
diff --git a/gcc/testsuite/gnat.dg/opt3.adb b/gcc/testsuite/gnat.dg/opt3.adb
new file mode 100644
index 00000000000..b8ca2c7fba6
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt3.adb
@@ -0,0 +1,11 @@
+-- { dg-do compile }
+-- { dg-options "-O3" }
+
+with Opt3_Pkg; use Opt3_Pkg;
+
+procedure Opt3 is
+ type Buffer_Type is array (Integer range <> ) of Short_Integer;
+ B : Buffer_Type (1 .. 256) := (others => 0);
+begin
+ F (B(1));
+end;
diff --git a/gcc/testsuite/gnat.dg/opt3_pkg.ads b/gcc/testsuite/gnat.dg/opt3_pkg.ads
new file mode 100644
index 00000000000..458a98be2de
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt3_pkg.ads
@@ -0,0 +1,5 @@
+package Opt3_Pkg is
+
+ procedure F (I : Short_Integer);
+
+end Opt3_Pkg;
diff --git a/gcc/testsuite/gnat.dg/opt4.adb b/gcc/testsuite/gnat.dg/opt4.adb
new file mode 100644
index 00000000000..caa5ab3a6cb
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt4.adb
@@ -0,0 +1,22 @@
+-- { dg-do run }
+-- { dg-options "-O2" }
+
+procedure Opt4 is
+
+ type Rec (D : Natural) is record
+ S : String (1..D);
+ end record;
+
+ procedure Test (R : Rec) is
+ begin
+ if R.D /= 9 then
+ raise Program_Error;
+ end if;
+ end;
+
+ R : Rec(9);
+
+begin
+ R := (9, "123456789");
+ Test (R);
+end;
diff --git a/gcc/testsuite/gnat.dg/opt5.adb b/gcc/testsuite/gnat.dg/opt5.adb
new file mode 100644
index 00000000000..73a21bde023
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt5.adb
@@ -0,0 +1,21 @@
+-- { dg-do run }
+-- { dg-options "-O2" }
+
+procedure Opt5 is
+
+ type Varray is array (1 .. 4) of Natural;
+
+ procedure Check_All_Ones (A : Varray) is
+ begin
+ for J in A'Range loop
+ if (A (J)) /= 1 then
+ raise Program_Error;
+ end if;
+ end loop;
+ end;
+
+ X : constant Varray := (1, 1, 1, 1);
+
+begin
+ Check_All_Ones (X);
+end;
diff --git a/gcc/testsuite/gnat.dg/pack14.adb b/gcc/testsuite/gnat.dg/pack14.adb
new file mode 100644
index 00000000000..b3764316b2c
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/pack14.adb
@@ -0,0 +1,16 @@
+-- { dg-do compile }
+
+procedure Pack14 is
+
+ subtype False_T is Boolean range False .. False;
+
+ type Rec is record
+ F : False_T;
+ end record;
+ pragma Pack (Rec);
+
+ A : Rec := (F => False);
+
+begin
+ null;
+end;
diff --git a/gcc/testsuite/gnat.dg/slice8.adb b/gcc/testsuite/gnat.dg/slice8.adb
new file mode 100644
index 00000000000..b05829d0f7b
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/slice8.adb
@@ -0,0 +1,13 @@
+-- { dg-do compile }
+-- { dg-options "-gnatws" }
+
+with Slice8_Pkg1;
+with Slice8_Pkg3;
+
+procedure Slice8 is
+
+ package Bp is new Slice8_Pkg3 (Slice8_Pkg1);
+
+begin
+ null;
+end;
diff --git a/gcc/testsuite/gnat.dg/slice8_pkg1.ads b/gcc/testsuite/gnat.dg/slice8_pkg1.ads
new file mode 100644
index 00000000000..3f433fdfb26
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/slice8_pkg1.ads
@@ -0,0 +1,3 @@
+with Slice8_Pkg2;
+
+package Slice8_Pkg1 is new Slice8_Pkg2 (Line_Length => 132, Max_Lines => 1000);
diff --git a/gcc/testsuite/gnat.dg/slice8_pkg2.ads b/gcc/testsuite/gnat.dg/slice8_pkg2.ads
new file mode 100644
index 00000000000..a6eafc6aa18
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/slice8_pkg2.ads
@@ -0,0 +1,23 @@
+generic
+
+ Line_Length : Natural;
+ Max_Lines : Natural;
+
+package Slice8_Pkg2 is
+
+ Subtype Index is Natural Range 0..Line_length;
+ Subtype Line_Count is Natural Range 0..Max_Lines;
+
+ Type Line (Size : Index := 0) is
+ Record
+ Data : String (1..Size);
+ End Record;
+
+ Type Lines is Array (Line_Count Range <>) of Line;
+
+ Type Paragraph (Size : Line_Count) is
+ Record
+ Data : Lines (1..Size);
+ End Record;
+
+end Slice8_Pkg2;
diff --git a/gcc/testsuite/gnat.dg/slice8_pkg3.adb b/gcc/testsuite/gnat.dg/slice8_pkg3.adb
new file mode 100644
index 00000000000..3524de1f0f5
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/slice8_pkg3.adb
@@ -0,0 +1,17 @@
+-- { dg-do compile }
+-- { dg-options "-gnatws" }
+
+package body Slice8_Pkg3 is
+
+ Current : Str.Lines (Str.Line_Count);
+ Last : Natural := 0;
+
+ function Get return Str.Paragraph is
+ Result : constant Str.Paragraph := (Size => Last,
+ Data => Current (1..Last));
+ begin
+ Last := 0;
+ return Result;
+ end Get;
+
+end Slice8_Pkg3;
diff --git a/gcc/testsuite/gnat.dg/slice8_pkg3.ads b/gcc/testsuite/gnat.dg/slice8_pkg3.ads
new file mode 100644
index 00000000000..a802cb72d9b
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/slice8_pkg3.ads
@@ -0,0 +1,11 @@
+with Slice8_Pkg2;
+
+generic
+
+ with package Str is new Slice8_Pkg2 (<>);
+
+package Slice8_Pkg3 is
+
+ function Get return Str.Paragraph;
+
+end Slice8_Pkg3;
diff --git a/gcc/testsuite/gnat.dg/specs/import_abstract.ads b/gcc/testsuite/gnat.dg/specs/import_abstract.ads
new file mode 100644
index 00000000000..9d05f0c1ceb
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/specs/import_abstract.ads
@@ -0,0 +1,6 @@
+-- { dg-do compile }
+package Import_Abstract is
+ type T1 is abstract tagged null record;
+ procedure p1(X : T1) is abstract;
+ pragma Import (Ada, p1); -- { dg-error "cannot import abstract subprogram" }
+end Import_Abstract;
diff --git a/gcc/testsuite/gnat.dg/specs/pack4.ads b/gcc/testsuite/gnat.dg/specs/pack4.ads
new file mode 100644
index 00000000000..82b76d2f457
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/specs/pack4.ads
@@ -0,0 +1,12 @@
+package Pack4 is
+
+ type Buffer is array (Natural range <>) of Boolean;
+
+ type Root (Size : Natural) is tagged record
+ Data : Buffer (1..Size);
+ end record;
+ pragma Pack (Root);
+
+ type Derived is new Root with null record;
+
+end Pack4;
diff --git a/gcc/testsuite/gnat.dg/specs/pack5.ads b/gcc/testsuite/gnat.dg/specs/pack5.ads
new file mode 100644
index 00000000000..65c8fc744de
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/specs/pack5.ads
@@ -0,0 +1,13 @@
+package Pack5 is
+
+ type Small is range -32 .. 31;
+
+ type Arr is array (Integer range <>) of Small;
+ pragma Pack (Arr);
+
+ type Rec is record
+ Y: Arr (1 .. 10);
+ end record;
+ pragma Pack (Rec);
+
+end Pack5;
diff --git a/gcc/testsuite/gnat.dg/specs/rep_clause4.ads b/gcc/testsuite/gnat.dg/specs/rep_clause4.ads
new file mode 100644
index 00000000000..8009f876cf2
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/specs/rep_clause4.ads
@@ -0,0 +1,42 @@
+-- { dg-do compile }
+-- { dg-options "-O" }
+
+package Rep_Clause4 is
+
+ type Uns16 is mod 2**16;
+
+ type Rec32 is
+ record
+ W1 : Uns16 := 1;
+ W2 : Uns16 := 2;
+ end record;
+ for Rec32 use
+ record
+ W1 at 0 range 0..15;
+ W2 at 2 range 0..15;
+ end record;
+ for Rec32'size use 32;
+
+ type Rec48 is
+ record
+ W1andW2 : Rec32;
+ W3 : Uns16;
+ end record;
+ for Rec48 use
+ record
+ W1andW2 at 0 range 0..31;
+ W3 at 4 range 0..15;
+ end record;
+ for Rec48'size use 48;
+
+ type Rec_Type is
+ record
+ Field1 : Rec48;
+ end record;
+ for Rec_Type use
+ record
+ Field1 at 0 range 0 .. 47;
+ end record;
+ for Rec_Type'size use 48;
+
+end Rep_Clause4;
diff --git a/gcc/testsuite/gnat.dg/stack_check1.adb b/gcc/testsuite/gnat.dg/stack_check1.adb
new file mode 100644
index 00000000000..51ee1a633b3
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/stack_check1.adb
@@ -0,0 +1,38 @@
+-- { dg-do run }
+-- { dg-options "-fstack-check" }
+
+-- This test requires architecture- and OS-specific support code for unwinding
+-- through signal frames (typically located in *-unwind.h) to pass. Feel free
+-- to disable it if this code hasn't been implemented yet.
+
+procedure Stack_Check1 is
+
+ type A is Array (1..2048) of Integer;
+
+ procedure Consume_Stack (N : Integer) is
+ My_A : A; -- 8 KB static
+ begin
+ My_A (1) := 0;
+ if N <= 0 then
+ return;
+ end if;
+ Consume_Stack (N-1);
+ end;
+
+ Task T;
+
+ Task body T is
+ begin
+ begin
+ Consume_Stack (Integer'Last);
+ raise Program_Error;
+ exception
+ when Storage_Error => null;
+ end;
+
+ Consume_Stack (128);
+ end;
+
+begin
+ null;
+end;
diff --git a/gcc/testsuite/gnat.dg/stack_check2.adb b/gcc/testsuite/gnat.dg/stack_check2.adb
new file mode 100644
index 00000000000..4a3008ba02b
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/stack_check2.adb
@@ -0,0 +1,43 @@
+-- { dg-do run }
+-- { dg-options "-fstack-check" }
+
+-- This test requires architecture- and OS-specific support code for unwinding
+-- through signal frames (typically located in *-unwind.h) to pass. Feel free
+-- to disable it if this code hasn't been implemented yet.
+
+procedure Stack_Check2 is
+
+ function UB return Integer is
+ begin
+ return 2048;
+ end;
+
+ type A is Array (Positive range <>) of Integer;
+
+ procedure Consume_Stack (N : Integer) is
+ My_A : A (1..UB); -- 8 KB dynamic
+ begin
+ My_A (1) := 0;
+ if N <= 0 then
+ return;
+ end if;
+ Consume_Stack (N-1);
+ end;
+
+ Task T;
+
+ Task body T is
+ begin
+ begin
+ Consume_Stack (Integer'Last);
+ raise Program_Error;
+ exception
+ when Storage_Error => null;
+ end;
+
+ Consume_Stack (128);
+ end;
+
+begin
+ null;
+end;
diff --git a/gcc/testsuite/gnat.dg/timer_cancel.adb b/gcc/testsuite/gnat.dg/timer_cancel.adb
new file mode 100644
index 00000000000..c300b47a859
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/timer_cancel.adb
@@ -0,0 +1,38 @@
+-- { dg-do run }
+
+with Ada.Real_Time.Timing_Events;
+use Ada.Real_Time, Ada.Real_Time.Timing_Events;
+
+procedure Timer_Cancel is
+
+ E : Timing_Event;
+ C : Boolean;
+
+ protected Dummy is
+ procedure Trigger (Event : in out Timing_Event);
+ end Dummy;
+
+ protected body Dummy is
+ procedure Trigger (Event : in out Timing_Event) is
+ begin
+ null;
+ end Trigger;
+ end Dummy;
+
+begin
+ Set_Handler (E, Time_Last, Dummy.Trigger'Unrestricted_Access);
+
+ if Time_Of_Event (E) /= Time_Last then
+ raise Program_Error with "Event time not set correctly";
+ end if;
+
+ Cancel_Handler (E, C);
+
+ if not C then
+ raise Program_Error with "Event triggered already";
+ end if;
+
+ if Time_Of_Event (E) /= Time_First then
+ raise Program_Error with "Event time not reset correctly";
+ end if;
+end Timer_Cancel;
diff --git a/gcc/testsuite/gnat.dg/unchecked_convert4.adb b/gcc/testsuite/gnat.dg/unchecked_convert4.adb
new file mode 100644
index 00000000000..8f3a1aa4efe
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/unchecked_convert4.adb
@@ -0,0 +1,24 @@
+-- { dg-do compile }
+
+with Unchecked_Conversion;
+
+procedure Unchecked_Convert4 is
+
+ type Uint32 is mod 2**32;
+
+ type Rec is record
+ I : Uint32;
+ end record;
+ for Rec'Size use 32;
+ pragma Atomic (Rec);
+
+ function Conv is new Unchecked_Conversion (Uint32, Rec);
+
+ function F return Uint32;
+ pragma Import (Ada, F);
+
+ procedure Proc (R : Rec) is begin null; end;
+
+begin
+ Proc (Conv (F or 1));
+end;
diff --git a/gcc/testsuite/lib/c-torture.exp b/gcc/testsuite/lib/c-torture.exp
index 769ec97d3ec..8b15b577005 100644
--- a/gcc/testsuite/lib/c-torture.exp
+++ b/gcc/testsuite/lib/c-torture.exp
@@ -17,6 +17,7 @@
# This file was written by Rob Savoye. (rob@cygnus.com)
+load_lib target-supports.exp
load_lib file-format.exp
load_lib target-libpath.exp
@@ -49,6 +50,14 @@ if [info exists ADDITIONAL_TORTURE_OPTIONS] {
[concat $C_TORTURE_OPTIONS $ADDITIONAL_TORTURE_OPTIONS]
}
+set LTO_TORTURE_OPTIONS ""
+if [check_effective_target_lto] {
+ set LTO_TORTURE_OPTIONS [list \
+ { -O2 -flto } \
+ { -O2 -fwhopr }
+ ]
+}
+
global GCC_UNDER_TEST
if ![info exists GCC_UNDER_TEST] {
set GCC_UNDER_TEST "[find_gcc]"
diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index feec5058214..4acfdfec8ff 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -60,6 +60,15 @@ if [info exists ADDITIONAL_TORTURE_OPTIONS] {
[concat $DG_TORTURE_OPTIONS $ADDITIONAL_TORTURE_OPTIONS]
}
+set LTO_TORTURE_OPTIONS ""
+if [check_effective_target_lto] {
+ set LTO_TORTURE_OPTIONS [list \
+ { -O2 -flto } \
+ { -O2 -fwhopr }
+ ]
+}
+
+
global GCC_UNDER_TEST
if ![info exists GCC_UNDER_TEST] {
set GCC_UNDER_TEST "[find_gcc]"
@@ -241,9 +250,9 @@ proc gcc-dg-runtest { testcases default-extra-flags } {
# Some callers set torture options themselves; don't override those.
set existing_torture_options [torture-options-exist]
if { $existing_torture_options == 0 } {
- global DG_TORTURE_OPTIONS
+ global DG_TORTURE_OPTIONS LTO_TORTURE_OPTIONS
torture-init
- set-torture-options $DG_TORTURE_OPTIONS
+ set-torture-options $DG_TORTURE_OPTIONS [list {}] $LTO_TORTURE_OPTIONS
}
dump-torture-options
diff --git a/gcc/testsuite/lib/gcc-gdb-test.exp b/gcc/testsuite/lib/gcc-gdb-test.exp
new file mode 100644
index 00000000000..c8933c2b930
--- /dev/null
+++ b/gcc/testsuite/lib/gcc-gdb-test.exp
@@ -0,0 +1,91 @@
+# Copyright (C) 2009 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# Utility for testing variable values using gdb, invoked via dg-final.
+# Call pass if variable has the desired value, otherwise fail.
+#
+# Argument 0 is the line number on which to put a breakpoint
+# Argument 1 is the name of the variable to be checked
+# Argument 2 is the expected value of the variable
+# Argument 3 handles expected failures and the like
+proc gdb-test { args } {
+ if { ![isnative] || [is_remote target] } { return }
+
+ if { [llength $args] >= 4 } {
+ switch [dg-process-target [lindex $args 3]] {
+ "S" { }
+ "N" { return }
+ "F" { setup_xfail "*-*-*" }
+ "P" { }
+ }
+ }
+
+ # This assumes that we are three frames down from dg-test, and that
+ # it still stores the filename of the testcase in a local variable "name".
+ # A cleaner solution would require a new DejaGnu release.
+ upvar 2 name testcase
+ upvar 2 prog prog
+
+ set gdb_name $::env(GUALITY_GDB_NAME)
+ set testname "$testcase line [lindex $args 0] [lindex $args 1] == [lindex $args 2]"
+ set output_file "[file rootname [file tail $prog]].exe"
+ set cmd_file "[file rootname [file tail $prog]].gdb"
+
+ set fd [open $cmd_file "w"]
+ puts $fd "break [lindex $args 0]"
+ puts $fd "run"
+ puts $fd "print [lindex $args 1]"
+ puts $fd "print [lindex $args 2]"
+ puts $fd "quit"
+ close $fd
+
+ send_log "Spawning: $gdb_name -nx -nw -quiet -x $cmd_file ./$output_file\n"
+ set res [remote_spawn target "$gdb_name -nx -nw -quiet -x $cmd_file ./$output_file"]
+ if { $res < 0 || $res == "" } {
+ unsupported "$testname"
+ return
+ }
+
+ remote_expect target [timeout_value] {
+ -re {[\n\r]\$1 = ([^\n\r]*)[\n\r]+\$2 = ([^\n\r]*)[\n\r]} {
+ set first $expect_out(1,string)
+ set second $expect_out(2,string)
+ if { $first == $second } {
+ pass "$testname"
+ } else {
+ send_log "$first != $second\n"
+ fail "$testname"
+ }
+ remote_close target
+ return
+ }
+ # Too old GDB
+ -re "Unhandled dwarf expression|Error in sourced command file" {
+ unsupported "$testname"
+ remote_close target
+ return
+ }
+ timeout {
+ unsupported "$testname"
+ remote_close target
+ return
+ }
+ }
+
+ remote_close target
+ unsupported "$testname"
+ return
+}
diff --git a/gcc/testsuite/lib/lto.exp b/gcc/testsuite/lib/lto.exp
new file mode 100644
index 00000000000..cccd64220bc
--- /dev/null
+++ b/gcc/testsuite/lib/lto.exp
@@ -0,0 +1,511 @@
+# Copyright (C) 2009 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# Contributed by Diego Novillo <dnovillo@google.com>
+
+
+# lto_init -- called at the start of eac subdir of tests
+
+proc lto_init { args } {
+ global LTO_OPTIONS
+
+ # Each test is run with the compiler options from this list.
+ # The default option lists can be overridden by LTO_OPTIONS="[list
+ # {opts_1} {opts_2}... {opts_n}]" where opts_i are lists of options.
+ # You can put this in the environment before site.exp is written or
+ # add it to site.exp directly.
+ if ![info exists LTO_OPTIONS] {
+ set LTO_OPTIONS [list \
+ {-O0 -fwhopr} \
+ {-O2 -fwhopr} \
+ {-O0 -flto} \
+ {-O2 -flto} \
+ ]
+ }
+}
+
+
+# Subsets of tests can be selectively disabled by members of this list:
+# - ATTRIBUTE: disable all tests using the __attribute__ extension,
+# - COMPLEX: disable all tests using the complex types feature,
+# - COMPLEX_INT: disable all tests using the complex integral types extension,
+# - VA: disable all tests using the variable number of arguments feature,
+# - VLA_IN_STRUCT: disable all tests using the variable-length arrays as
+# structure members extension,
+# - ZERO_ARRAY: disable all tests using the zero-sized arrays extension.
+# The default skip lists can be overriden by
+# LTO_SKIPS="[list {skip_1}...{skip_n}]"
+# where skip_i are skip identifiers. You can put this in the environment
+# before site.exp is written or add it to site.exp directly.
+if ![info exists LTO_SKIPS] {
+ set LTO_SKIPS [list {}]
+}
+
+global lto_skip_list
+set lto_skip_list $LTO_SKIPS
+
+load_lib dg.exp
+load_lib gcc-dg.exp
+
+# lto-obj -- compile to an object file
+#
+# SOURCE is the source file
+# DEST is the object file
+# OPTALL is the list of compiler options to use with all tests
+# OPTFILE is the list of compiler options to use with this file
+# OPTSTR is the options to print with test messages
+# XFAILDATA is the xfail data to be passed to the compiler
+proc lto-obj { source dest optall optfile optstr xfaildata } {
+ global testcase
+ global tool
+ global compiler_conditional_xfail_data
+ global lto_skip_list
+
+ # Add the skip specifiers.
+ foreach skip $lto_skip_list {
+ if { ![string match $skip ""] } {
+ lappend optall "-DSKIP_$skip"
+ }
+ }
+
+ # Set up the options for compiling this file.
+ set options ""
+ lappend options "additional_flags=$optall $optfile"
+
+ set compiler_conditional_xfail_data $xfaildata
+ set comp_output [${tool}_target_compile "$source" "$dest" object $options]
+ ${tool}_check_compile "$testcase $dest assemble" $optstr $dest $comp_output
+}
+
+# lto-link-and-maybe-run -- link the object files and run the executable
+# if compile_type is set to "run"
+#
+# TESTNAME is the mixture of object files to link
+# OBJLIST is the list of object files to link
+# DEST is the name of the executable
+# OPTALL is a list of compiler and linker options to use for all tests
+# OPTFILE is a list of compiler and linker options to use for this test
+# OPTSTR is the list of options to list in messages
+proc lto-link-and-maybe-run { testname objlist dest optall optfile optstr } {
+ global testcase
+ global tool
+ global compile_type
+
+ # Check that all of the objects were built successfully.
+ foreach obj [split $objlist] {
+ if ![file_on_host exists $obj] then {
+ unresolved "$testcase $testname link $optstr"
+ unresolved "$testcase $testname execute $optstr"
+ return
+ }
+ }
+
+ # Set up the options for linking this test.
+ set options ""
+ lappend options "additional_flags=$optall $optfile"
+
+ # Link the objects into an executable.
+ set comp_output [${tool}_target_compile "$objlist" $dest executable \
+ "$options"]
+ if ![${tool}_check_compile "$testcase $testname link" "" \
+ $dest $comp_output] then {
+ unresolved "$testcase $testname execute $optstr"
+ return
+ }
+
+ # Return if we only needed to link.
+ if { ![string compare "link" $compile_type] } {
+ return
+ }
+
+ # Run the self-checking executable.
+ if ![string match "*/*" $dest] then {
+ set dest "./$dest"
+ }
+ set result [${tool}_load $dest "" ""]
+ set status [lindex $result 0]
+ if { $status == "pass" } then {
+ file_on_host delete $dest
+ }
+ $status "$testcase $testname execute $optstr"
+}
+
+# lto-get-options-main -- get target requirements for a test and
+# options for the primary source file and the test as a whole
+#
+# SRC is the full pathname of the primary source file.
+proc lto-get-options-main { src } {
+ global compile_type
+ global dg-extra-ld-options
+ global dg-suppress-ld-options
+
+ set dg-extra-ld-options ""
+ set dg-suppress-ld-options ""
+
+ # dg-options sets a variable called dg-extra-tool-flags.
+ set dg-extra-tool-flags ""
+
+ # dg-options sets a variable called tool_flags.
+ set tool_flags ""
+
+ # dg-require-* sets dg-do-what.
+ upvar dg-do-what dg-do-what
+ upvar dg-final-code dg-final-code
+ set dg-final-code ""
+
+ set tmp [dg-get-options $src]
+ verbose "getting options for $src: $tmp"
+ foreach op $tmp {
+ set cmd [lindex $op 0]
+ verbose "cmd is $cmd"
+ if { [string match "dg-skip-if" $cmd] \
+ || [string match "dg-require-*" $cmd] } {
+ set status [catch "$op" errmsg]
+ if { $status != 0 } {
+ perror "src: $errmsg for \"$op\"\n"
+ unresolved "$src: $errmsg for \"$op\""
+ return
+ }
+ } elseif { [string match "dg-lto-options" $cmd] } {
+ set op [lreplace $op 0 0 "dg-options"]
+ set status [catch "$op" errmsg]
+ if { $status != 0 } {
+ perror "src: $errmsg for \"$op\"\n"
+ unresolved "$src: $errmsg for \"$op\""
+ return
+ }
+ } elseif { ![string compare "dg-xfail-if" $cmd] \
+ || ![string compare "dg-options" $cmd] } {
+ warning "lto.exp does not support $cmd in primary source file"
+ } elseif { ![string compare "dg-lto-do" $cmd] } {
+ if { [llength $op] > 3 } {
+ set kw [lindex [lindex $op 3] 0]
+ if [string match "target" $kw] {
+ perror "$src: dg-lto-do does not support \"target\""
+ } elseif [string match "xfail" $kw] {
+ perror "$src: dg-lto-do does not support \"xfail\""
+ } else {
+ perror "$src: dg-lto-do takes a single argument"
+ }
+ }
+ set dgdo [lindex $op 2]
+ verbose "dg-lto-do command for \"$op\" is $dgdo"
+ if { ![string compare "assemble" $dgdo] } {
+ set compile_type "assemble"
+ } elseif { ![string compare "run" $dgdo] } {
+ set compile_type "run"
+ } elseif { ![string compare "link" $dgdo] } {
+ set compile_type "link"
+ } else {
+ warning "lto.exp does not support dg-lto-do $dgdo"
+ }
+ } elseif { ![string compare "dg-extra-ld-options" $cmd] } {
+ set dg-extra-ld-options [lindex $op 2]
+ verbose "dg-extra-ld-options for main is ${dg-extra-ld-options}"
+ } elseif { ![string compare "dg-suppress-ld-options" $cmd] } {
+ set dg-suppress-ld-options [lindex $op 2]
+ verbose \
+ "dg-suppress-ld-options for main is ${dg-suppress-ld-options}"
+ } elseif { ![string compare "dg-final" $cmd] } {
+ if { [llength $op] > 3 } {
+ error "[lindex $op 0]: too many arguments"
+ } else {
+ append dg-final-code "[lindex $op 2]\n"
+ }
+ } else {
+ # Ignore unrecognized dg- commands, but warn about them.
+ warning "lto.exp does not support $cmd"
+ }
+ }
+
+ # Return flags to use for compiling the primary source file and for
+ # linking.
+ verbose "dg-extra-tool-flags for main is ${dg-extra-tool-flags}"
+ return ${dg-extra-tool-flags}
+}
+
+
+# lto-get-options -- get special tool flags to use for a secondary
+# source file
+#
+# SRC is the full pathname of the source file.
+# The result is a list of options to use.
+#
+# This code is copied from proc dg-test in dg.exp from DejaGNU.
+proc lto-get-options { src } {
+ # dg-options sets a variable called dg-extra-tool-flags.
+ set dg-extra-tool-flags ""
+
+ # dg-xfail-if sets compiler_conditional_xfail_data.
+ global compiler_conditional_xfail_data
+ set compiler_conditional_xfail_data ""
+
+ # dg-xfail-if needs access to dg-do-what.
+ upvar dg-do-what dg-do-what
+
+ set tmp [dg-get-options $src]
+ foreach op $tmp {
+ set cmd [lindex $op 0]
+ if { ![string compare "dg-options" $cmd] \
+ || ![string compare "dg-xfail-if" $cmd] } {
+ set status [catch "$op" errmsg]
+ if { $status != 0 } {
+ perror "src: $errmsg for \"$op\"\n"
+ unresolved "$src: $errmsg for \"$op\""
+ return
+ }
+ } elseif { [string match "dg-require-*" $cmd] } {
+ warning "lto.exp does not support $cmd in secondary source files"
+ } else {
+ # Ignore unrecognized dg- commands, but warn about them.
+ warning "lto.exp does not support $cmd in secondary source files"
+ }
+ }
+
+ return ${dg-extra-tool-flags}
+}
+
+# lto-execute -- compile multi-file tests
+#
+# SRC1 is the full pathname of the main file of the testcase.
+# SID identifies a test suite in the names of temporary files.
+proc lto-execute { src1 sid } {
+ global srcdir tmpdir
+ global option_list
+ global tool
+ global verbose
+ global testcase
+ global gluefile
+ global compiler_conditional_xfail_data
+ global dg-do-what-default
+ global compile_type
+ global dg-extra-ld-options
+ global dg-suppress-ld-options
+ global LTO_OPTIONS
+ global dg-final-code
+
+ # Get extra flags for this test from the primary source file, and
+ # process other dg-* options that this suite supports. Warn about
+ # unsupported flags.
+ verbose "lto-execute: $src1" 1
+ set compile_type "run"
+ set dg-do-what [list ${dg-do-what-default} "" P]
+ set extra_flags(0) [lto-get-options-main $src1]
+ set compile_xfail(0) ""
+
+ # If the main file defines dg-options, those flags are used to
+ # overwrite the default option_list taken from LTO_OPTIONS.
+ if { [string length $extra_flags(0)] > 0 } {
+ set option_list $extra_flags(0)
+ set extra_flags(0) ""
+ } else {
+ set option_list $LTO_OPTIONS
+ }
+
+ # Check whether this test is supported for this target.
+ if { [lindex ${dg-do-what} 1 ] == "N" } {
+ unsupported "$src1"
+ verbose "$src1 not supported on this target, skipping it" 3
+ return
+ }
+
+ # Set up the names of the other source files.
+ set dir [file dirname $src1]
+ set base [file rootname $src1]
+ set base [string range $base [string length $dir] end]
+ regsub "_0" $base "" base
+ regsub "/" $base "" base
+ set src_list $src1
+ set i 1
+ set done 0
+ while { !$done } {
+ set names [glob -nocomplain -types f -- "${dir}/${base}_${i}.*"]
+ if { [llength ${names}] > 1 } {
+ warning "lto-execute: more than one file matched ${dir}/${base}_${i}.*"
+ }
+ if { [llength ${names}] == 1 } {
+ lappend src_list [lindex ${names} 0]
+ incr i
+ } else {
+ set num_srcs ${i}
+ set done 1
+ }
+ }
+
+ # Use the dg-options mechanism to specify extra flags for each
+ # of the secondary files.
+ # The extra flags in each file are used to compile that file, and the
+ # extra flags in *_0.* are also used for linking.
+ verbose "\tsrc_list is: $src_list"
+ for {set i 1} {$i < $num_srcs} {incr i} {
+ set extra_flags($i) [lto-get-options [lindex $src_list $i]]
+ set compile_xfail($i) $compiler_conditional_xfail_data
+ }
+
+ # Define the names of the object files.
+ set obj_list ""
+ for {set i 0} {$i < $num_srcs} {incr i} {
+ lappend obj_list "${sid}_${base}_${i}.o"
+ }
+
+ # Get the base name of this test, for use in messages.
+ set testcase [lindex ${src_list} 0]
+
+ # Remove the $srcdir and $tmpdir prefixes from $src1. (It would
+ # be possible to use "regsub" here, if we were careful to escape
+ # all regular expression characters in $srcdir and $tmpdir, but
+ # that would be more complicated that this approach.)
+ if {[string first "$srcdir/" "${testcase}"] == 0} {
+ set testcase [string range "${testcase}" [string length "$srcdir/"] end]
+ }
+ if {[string first "$tmpdir/" "$testcase"] == 0} {
+ set testcase [string range "$testcase" [string length "$tmpdir/"] end]
+ set testcase "tmpdir-$testcase"
+ }
+ regsub "_0.*" $testcase "" testcase
+
+ # Set up the base name of executable files so they'll be unique.
+ regsub -all "\[./\]" $testcase "-" execbase
+
+ # If we couldn't rip $srcdir out of `src1' then just do the best we can.
+ # The point is to reduce the unnecessary noise in the logs. Don't strip
+ # out too much because different testcases with the same name can confuse
+ # `test-tool'.
+ if [string match "/*" $testcase] then {
+ set testcase "[file tail [file dirname $src1]]/[file tail $src1]"
+ }
+
+ # Loop through all of the option lists used for this test.
+ set count 0
+ foreach option $option_list {
+ verbose "Testing $testcase, $option"
+
+ # There's a unique name for each executable we generate.
+ set execname "${execbase}-${count}1"
+ incr count
+
+ file_on_host delete $execname
+
+ # Compile pieces with the compiler under test.
+ set i 0
+ foreach src $src_list obj $obj_list {
+ lto-obj $src $obj $option $extra_flags($i) $option \
+ $compile_xfail($i)
+ incr i
+ }
+
+ # Link (using the compiler under test), run, and clean up tests.
+ if { ![string compare "run" $compile_type] \
+ || ![string compare "link" $compile_type] } {
+
+ # Filter out any link options we were asked to suppress.
+ set reduced {}
+ foreach x [split $option] {
+ if {[lsearch ${dg-suppress-ld-options} $x] == -1} {
+ lappend reduced $x
+ }
+ }
+ set filtered [join $reduced " "]
+
+ lto-link-and-maybe-run \
+ "[lindex $obj_list 0]-[lindex $obj_list end]" \
+ $obj_list $execname $filtered ${dg-extra-ld-options} \
+ $filtered
+ }
+
+
+ # Are there any further tests to perform?
+ # Note that if the program has special run-time requirements, running
+ # of the program can be delayed until here. Ditto for other situations.
+ # It would be a bit cumbersome though.
+
+ if ![string match ${dg-final-code} ""] {
+ regsub -all "\\\\(\[{}\])" ${dg-final-code} "\\1" dg-final-code
+ # Note that the use of `args' here makes this a varargs proc.
+ proc dg-final-proc { args } ${dg-final-code}
+ verbose "Running dg-final tests." 3
+ verbose "dg-final-proc:\n[info body dg-final-proc]" 4
+ if [catch "dg-final-proc $src1" errmsg] {
+ perror "$name: error executing dg-final: $errmsg"
+ # ??? The call to unresolved here is necessary to clear
+ # `errcnt'. What we really need is a proc like perror that
+ # doesn't set errcnt. It should also set exit_status to 1.
+ unresolved "$name: error executing dg-final: $errmsg"
+ }
+ }
+
+ # Clean up object files.
+ set files [glob -nocomplain ${sid}_*.o]
+ if { $files != "" } {
+ foreach objfile $files {
+ if { ![info exists gluefile] || $objfile != $gluefile } {
+ eval "file_on_host delete $objfile"
+ }
+ }
+ }
+
+ if { ![string compare "run" $compile_type] \
+ || ![string compare "link" $compile_type] } {
+ file_on_host delete $execname
+ }
+ }
+}
+
+# Utility for scanning a symbol in the final executable, invoked via dg-final.
+# Call pass if pattern is present, otherwise fail.
+#
+# Argument 0 is the regexp to match.
+# Argument 1 handles expected failures and the like
+proc scan-symbol { args } {
+ global nm
+ global base_dir
+ upvar 2 execname execname
+
+ if { [llength $args] >= 2 } {
+ switch [dg-process-target [lindex $args 1]] {
+ "S" { }
+ "N" { return }
+ "F" { setup_xfail "*-*-*" }
+ "P" { }
+ }
+ }
+
+ # Find nm like we find g++ in g++.exp.
+ if ![info exists nm] {
+ set nm [findfile $base_dir/../../../binutils/nm \
+ $base_dir/../../../binutils/nm \
+ [findfile $base_dir/../../nm $base_dir/../../nm \
+ [findfile $base_dir/nm $base_dir/nm \
+ [transform nm]]]]
+ verbose -log "nm is $nm"
+ }
+
+ set output_file $execname
+ if { $output_file == "" } {
+ fail "scan-symbol $args: dump file does not exist"
+ return
+ }
+
+ set fd [open "| $nm $output_file" r]
+ set text [read $fd]
+ close $fd
+
+ if [regexp -- [lindex $args 0] $text] {
+ pass "scan-symbol $args"
+ } else {
+ fail "scan-symbol $args"
+ }
+}
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 5272bcd3791..8d89ed830fd 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -491,6 +491,7 @@ proc check_profiling_available { test_what } {
|| [istarget avr-*-*]
|| [istarget bfin-*-*]
|| [istarget powerpc-*-eabi*]
+ || [istarget powerpc-*-elf]
|| [istarget cris-*-*]
|| [istarget crisv32-*-*]
|| [istarget fido-*-elf]
@@ -501,6 +502,7 @@ proc check_profiling_available { test_what } {
|| [istarget mep-*-elf]
|| [istarget mips*-*-elf*]
|| [istarget moxie-*-elf*]
+ || [istarget rx-*-*]
|| [istarget xstormy16-*]
|| [istarget xtensa*-*-elf]
|| [istarget *-*-rtems*]
@@ -686,6 +688,18 @@ proc check_effective_target_hard_float { } {
}]
}
+ # This proc is actually checking the availabilty of FPU
+ # support for doubles, so on the RX we must fail if the
+ # 64-bit double multilib has been selected.
+ if { [istarget rx-*-*] } {
+ return 0
+ # return [check_no_compiler_messages hard_float assembly {
+ #if defined __RX_64_BIT_DOUBLES__
+ #error FOO
+ #endif
+ # }]
+ }
+
# The generic test equates hard_float with "no call for adding doubles".
return [check_no_messages_and_pattern hard_float "!\\(call" rtl-expand {
double a (double b, double c) { return b + c; }
@@ -2505,8 +2519,8 @@ proc check_effective_target_vect_short_mult { } {
if { [istarget ia64-*-*]
|| [istarget spu-*-*]
|| [istarget i?86-*-*]
- || [istarget x86_64-*-*]
- || [istarget powerpc*-*-*]
+ || [istarget x86_64-*-*]
+ || [istarget powerpc*-*-*]
|| [check_effective_target_arm32] } {
set et_vect_short_mult_saved 1
}
@@ -2646,7 +2660,7 @@ proc check_effective_target_section_anchors { } {
verbose "check_effective_target_section_anchors: using cached result" 2
} else {
set et_section_anchors_saved 0
- if { [istarget powerpc*-*-*]
+ if { [istarget powerpc*-*-*]
|| [istarget arm*-*-*] } {
set et_section_anchors_saved 1
}
@@ -2984,6 +2998,28 @@ proc add_options_for_ieee { flags } {
return $flags
}
+# Add to FLAGS the flags needed to enable functions to bind locally
+# when using pic/PIC passes in the testsuite.
+
+proc add_options_for_bind_pic_locally { flags } {
+ if {[check_no_compiler_messages using_pic2 assembly {
+ #if __PIC__ != 2
+ #error FOO
+ #endif
+ }]} {
+ return "$flags -fPIE"
+ }
+ if {[check_no_compiler_messages using_pic1 assembly {
+ #if __PIC__ != 1
+ #error FOO
+ #endif
+ }]} {
+ return "$flags -fpie"
+ }
+
+ return $flags
+}
+
# Return 1 if the target provides a full C99 runtime.
proc check_effective_target_c99_runtime { } {
@@ -3093,6 +3129,14 @@ proc check_effective_target_correct_iso_cpp_string_wchar_protos { } {
}]
}
+# Return 1 if the compiler has been configure with link-time optimization
+# (LTO) support.
+
+proc check_effective_target_lto { } {
+ global ENABLE_LTO
+ return [info exists ENABLE_LTO]
+}
+
# Return 1 if the MPC library is integrated with GCC, 0 otherwise.
proc check_effective_target_mpc { } {
@@ -3119,6 +3163,29 @@ proc check_effective_target_mpc_pow { } {
}]
}
+# Return 1 if the MPC library with "arc" functions is integrated with GCC, 0 otherwise.
+
+proc check_effective_target_mpc_arc { } {
+ return [check_no_compiler_messages mpc_arc executable {
+ extern void link_error(void);
+ int main ()
+ {
+ if (__builtin_cacos(1) != 0)
+ link_error();
+ if (__builtin_casin(0) != 0)
+ link_error();
+ if (__builtin_catan(0) != 0)
+ link_error();
+ if (__builtin_cacosh(1) != 0)
+ link_error();
+ if (__builtin_casinh(0) != 0)
+ link_error();
+ if (__builtin_catanh(0) != 0)
+ link_error();
+ }
+ }]
+}
+
# Return 1 if the language for the compiler under test is C.
proc check_effective_target_c { } {
diff --git a/gcc/testsuite/lib/torture-options.exp b/gcc/testsuite/lib/torture-options.exp
index 7721f901bfe..f3b3e22948b 100644
--- a/gcc/testsuite/lib/torture-options.exp
+++ b/gcc/testsuite/lib/torture-options.exp
@@ -48,12 +48,14 @@ proc contains-loop-option-p { arg } {
#
# Argument 0 is the list to use as torture options
# Argument 1 is the list to combine with the torture options.
+# Argument 2 is the list to be appended to the torture options after
+# combining argument 0 and 1.
proc set-torture-options { args } {
global torture_with_loops torture_without_loops
set torture_list [lindex $args 0]
- if { [llength $args] != 1 } {
+ if { [llength $args] > 1 } {
set other_list [lindex $args 1]
} else {
set other_list [list {}]
@@ -71,6 +73,12 @@ proc set-torture-options { args } {
lappend torture_with_loops "$torture_opts $other_opts"
}
}
+
+ if { [llength $args] > 2 } {
+ set append_list [lindex $args 2]
+ append torture_with_loops " $append_list"
+ append torture_without_loops " $append_list"
+ }
}
# Finish up after using a set of torture options.
diff --git a/gcc/testsuite/obj-c++.dg/bitfield-1.mm b/gcc/testsuite/obj-c++.dg/bitfield-1.mm
index d9b65a4f453..f17d9f0baca 100644
--- a/gcc/testsuite/obj-c++.dg/bitfield-1.mm
+++ b/gcc/testsuite/obj-c++.dg/bitfield-1.mm
@@ -115,7 +115,7 @@ int main(void)
}
/* { dg-prune-output "In file included from" } Ignore this message. */
-/* { dg-bogus "padding struct to align" "PR23610" { xfail lp64 } 1 } */
+/* { dg-bogus "padding struct to align" "PR23610" { target *-*-* } 0 } */
/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 42 } */
/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 45 } */
/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 59 } */
diff --git a/gcc/testsuite/obj-c++.dg/bitfield-4.mm b/gcc/testsuite/obj-c++.dg/bitfield-4.mm
index 72c1396d706..a2c2173085a 100644
--- a/gcc/testsuite/obj-c++.dg/bitfield-4.mm
+++ b/gcc/testsuite/obj-c++.dg/bitfield-4.mm
@@ -50,7 +50,7 @@ int main(void)
}
/* { dg-prune-output "In file included from" } Ignore this message. */
-/* { dg-bogus "padding struct to align" "PR23610" { xfail lp64 } 1 } */
+/* { dg-bogus "padding struct to align" "PR23610" { target *-*-* } 0 } */
/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 28 } */
/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 34 } */
diff --git a/gcc/testsuite/obj-c++.dg/layout-1.mm b/gcc/testsuite/obj-c++.dg/layout-1.mm
index 35ffa49da3b..bc99e758f8c 100644
--- a/gcc/testsuite/obj-c++.dg/layout-1.mm
+++ b/gcc/testsuite/obj-c++.dg/layout-1.mm
@@ -14,4 +14,4 @@
@end
/* { dg-prune-output "In output included from" } Ignore this message. */
-/* { dg-bogus "padding struct to align" "PR23610" { xfail lp64 } 1 } */
+/* { dg-bogus "padding struct to align" "PR23610" { target *-*-* } 0 } */
diff --git a/gcc/timevar.def b/gcc/timevar.def
index 92f280d4a73..d885e50dd30 100644
--- a/gcc/timevar.def
+++ b/gcc/timevar.def
@@ -42,6 +42,15 @@ DEFTIMEVAR (TV_DUMP , "dump files")
DEFTIMEVAR (TV_CGRAPH , "callgraph construction")
DEFTIMEVAR (TV_CGRAPHOPT , "callgraph optimization")
DEFTIMEVAR (TV_IPA_CONSTANT_PROP , "ipa cp")
+DEFTIMEVAR (TV_IPA_LTO_GIMPLE_IO , "ipa lto gimple I/O")
+DEFTIMEVAR (TV_IPA_LTO_DECL_IO , "ipa lto decl I/O")
+DEFTIMEVAR (TV_IPA_LTO_CGRAPH_IO , "ipa lto cgraph I/O")
+DEFTIMEVAR (TV_LTO , "lto")
+DEFTIMEVAR (TV_WHOPR_WPA , "whopr wpa")
+DEFTIMEVAR (TV_WHOPR_WPA_IO , "whopr wpa I/O")
+DEFTIMEVAR (TV_WHOPR_LTRANS , "whopr ltrans")
+DEFTIMEVAR (TV_WHOPR_WPA_FIXUP , "whopr wpa fixup")
+DEFTIMEVAR (TV_WHOPR_WPA_LTRANS_EXEC , "whopr wpa->ltrans")
DEFTIMEVAR (TV_IPA_REFERENCE , "ipa reference")
DEFTIMEVAR (TV_IPA_PURE_CONST , "ipa pure const")
DEFTIMEVAR (TV_IPA_TYPE_ESCAPE , "ipa type escape")
diff --git a/gcc/tlink.c b/gcc/tlink.c
index 50206472eba..969c75d0aa6 100644
--- a/gcc/tlink.c
+++ b/gcc/tlink.c
@@ -283,7 +283,7 @@ tlink_execute (const char *prog, char **argv, const char *outname,
{
struct pex_obj *pex;
- pex = collect_execute (prog, argv, outname, errname);
+ pex = collect_execute (prog, argv, outname, errname, PEX_LAST | PEX_SEARCH);
return collect_wait (prog, pex);
}
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 4dd17e4b0c8..8686e4dd947 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -198,6 +198,17 @@ int optimize = 0;
int optimize_size = 0;
+/* True if this is the lto front end. This is used to disable
+ gimple generation and lowering passes that are normally run on the
+ output of a front end. These passes must be bypassed for lto since
+ they have already been done before the gimple was written. */
+
+bool in_lto_p = false;
+
+/* Nonzero if we should write GIMPLE bytecode for link-time optimization. */
+
+int flag_generate_lto;
+
/* The FUNCTION_DECL for the function currently being compiled,
or 0 if between functions. */
tree current_function_decl;
@@ -1087,6 +1098,14 @@ compile_file (void)
/* Flush any pending external directives. */
process_pending_assemble_externals ();
+ /* Emit LTO marker if LTO info has been previously emitted. This is
+ used by collect2 to determine whether an object file contains IL.
+ We used to emit an undefined reference here, but this produces
+ link errors if an object file with IL is stored into a shared
+ library without invoking lto1. */
+ if (flag_generate_lto)
+ fprintf (asm_out_file,"\t.comm\tgnu_lto_v1,1,1\n");
+
/* Attach a special .ident directive to the end of the file to identify
the version of GCC which compiled this code. The format of the .ident
string is patterned after the ones produced by native SVR4 compilers. */
@@ -2344,6 +2363,8 @@ finalize (void)
fatal_error ("error writing to %s: %m", asm_file_name);
if (fclose (asm_out_file) != 0)
fatal_error ("error closing %s: %m", asm_file_name);
+ if (flag_wpa)
+ unlink_if_ordinary (asm_file_name);
}
statistics_fini ();
diff --git a/gcc/toplev.h b/gcc/toplev.h
index cca68675f87..88ab7e8ecf0 100644
--- a/gcc/toplev.h
+++ b/gcc/toplev.h
@@ -142,6 +142,7 @@ extern int flag_unroll_all_loops;
extern int flag_unswitch_loops;
extern int flag_cprop_registers;
extern int time_report;
+extern int flag_ira_loop_pressure;
extern int flag_ira_coalesce;
extern int flag_ira_move_spills;
extern int flag_ira_share_save_slots;
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index df1f6caa857..97b08924ff7 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -1715,423 +1715,6 @@ single_noncomplex_succ (basic_block bb)
return bb;
}
-
-/* Walk the function tree removing unnecessary statements.
-
- * Empty statement nodes are removed
-
- * Unnecessary TRY_FINALLY and TRY_CATCH blocks are removed
-
- * Unnecessary COND_EXPRs are removed
-
- * Some unnecessary BIND_EXPRs are removed
-
- * GOTO_EXPRs immediately preceding destination are removed.
-
- Clearly more work could be done. The trick is doing the analysis
- and removal fast enough to be a net improvement in compile times.
-
- Note that when we remove a control structure such as a COND_EXPR
- BIND_EXPR, or TRY block, we will need to repeat this optimization pass
- to ensure we eliminate all the useless code. */
-
-struct rus_data
-{
- bool repeat;
- bool may_throw;
- bool may_branch;
- bool has_label;
- bool last_was_goto;
- gimple_stmt_iterator last_goto_gsi;
-};
-
-
-static void remove_useless_stmts_1 (gimple_stmt_iterator *gsi, struct rus_data *);
-
-/* Given a statement sequence, find the first executable statement with
- location information, and warn that it is unreachable. When searching,
- descend into containers in execution order. */
-
-static bool
-remove_useless_stmts_warn_notreached (gimple_seq stmts)
-{
- gimple_stmt_iterator gsi;
-
- for (gsi = gsi_start (stmts); !gsi_end_p (gsi); gsi_next (&gsi))
- {
- gimple stmt = gsi_stmt (gsi);
-
- if (gimple_no_warning_p (stmt)) return false;
-
- if (gimple_has_location (stmt))
- {
- location_t loc = gimple_location (stmt);
- if (LOCATION_LINE (loc) > 0)
- {
- warning_at (loc, OPT_Wunreachable_code, "will never be executed");
- return true;
- }
- }
-
- switch (gimple_code (stmt))
- {
- /* Unfortunately, we need the CFG now to detect unreachable
- branches in a conditional, so conditionals are not handled here. */
-
- case GIMPLE_TRY:
- if (remove_useless_stmts_warn_notreached (gimple_try_eval (stmt)))
- return true;
- if (remove_useless_stmts_warn_notreached (gimple_try_cleanup (stmt)))
- return true;
- break;
-
- case GIMPLE_CATCH:
- return remove_useless_stmts_warn_notreached (gimple_catch_handler (stmt));
-
- case GIMPLE_EH_FILTER:
- return remove_useless_stmts_warn_notreached (gimple_eh_filter_failure (stmt));
-
- case GIMPLE_BIND:
- return remove_useless_stmts_warn_notreached (gimple_bind_body (stmt));
-
- default:
- break;
- }
- }
-
- return false;
-}
-
-/* Helper for remove_useless_stmts_1. Handle GIMPLE_COND statements. */
-
-static void
-remove_useless_stmts_cond (gimple_stmt_iterator *gsi, struct rus_data *data)
-{
- gimple stmt = gsi_stmt (*gsi);
-
- /* The folded result must still be a conditional statement. */
- fold_stmt (gsi);
- gcc_assert (gsi_stmt (*gsi) == stmt);
-
- data->may_branch = true;
-
- /* Replace trivial conditionals with gotos. */
- if (gimple_cond_true_p (stmt))
- {
- /* Goto THEN label. */
- tree then_label = gimple_cond_true_label (stmt);
-
- gsi_replace (gsi, gimple_build_goto (then_label), false);
- data->last_goto_gsi = *gsi;
- data->last_was_goto = true;
- data->repeat = true;
- }
- else if (gimple_cond_false_p (stmt))
- {
- /* Goto ELSE label. */
- tree else_label = gimple_cond_false_label (stmt);
-
- gsi_replace (gsi, gimple_build_goto (else_label), false);
- data->last_goto_gsi = *gsi;
- data->last_was_goto = true;
- data->repeat = true;
- }
- else
- {
- tree then_label = gimple_cond_true_label (stmt);
- tree else_label = gimple_cond_false_label (stmt);
-
- if (then_label == else_label)
- {
- /* Goto common destination. */
- gsi_replace (gsi, gimple_build_goto (then_label), false);
- data->last_goto_gsi = *gsi;
- data->last_was_goto = true;
- data->repeat = true;
- }
- }
-
- gsi_next (gsi);
-
- data->last_was_goto = false;
-}
-
-/* Helper for remove_useless_stmts_1.
- Handle the try-finally case for GIMPLE_TRY statements. */
-
-static void
-remove_useless_stmts_tf (gimple_stmt_iterator *gsi, struct rus_data *data)
-{
- bool save_may_branch, save_may_throw;
- bool this_may_branch, this_may_throw;
-
- gimple_seq eval_seq, cleanup_seq;
- gimple_stmt_iterator eval_gsi, cleanup_gsi;
-
- gimple stmt = gsi_stmt (*gsi);
-
- /* Collect may_branch and may_throw information for the body only. */
- save_may_branch = data->may_branch;
- save_may_throw = data->may_throw;
- data->may_branch = false;
- data->may_throw = false;
- data->last_was_goto = false;
-
- eval_seq = gimple_try_eval (stmt);
- eval_gsi = gsi_start (eval_seq);
- remove_useless_stmts_1 (&eval_gsi, data);
-
- this_may_branch = data->may_branch;
- this_may_throw = data->may_throw;
- data->may_branch |= save_may_branch;
- data->may_throw |= save_may_throw;
- data->last_was_goto = false;
-
- cleanup_seq = gimple_try_cleanup (stmt);
- cleanup_gsi = gsi_start (cleanup_seq);
- remove_useless_stmts_1 (&cleanup_gsi, data);
-
- /* If the body is empty, then we can emit the FINALLY block without
- the enclosing TRY_FINALLY_EXPR. */
- if (gimple_seq_empty_p (eval_seq))
- {
- gsi_insert_seq_before (gsi, cleanup_seq, GSI_SAME_STMT);
- gsi_remove (gsi, false);
- data->repeat = true;
- }
-
- /* If the handler is empty, then we can emit the TRY block without
- the enclosing TRY_FINALLY_EXPR. */
- else if (gimple_seq_empty_p (cleanup_seq))
- {
- gsi_insert_seq_before (gsi, eval_seq, GSI_SAME_STMT);
- gsi_remove (gsi, false);
- data->repeat = true;
- }
-
- /* If the body neither throws, nor branches, then we can safely
- string the TRY and FINALLY blocks together. */
- else if (!this_may_branch && !this_may_throw)
- {
- gsi_insert_seq_before (gsi, eval_seq, GSI_SAME_STMT);
- gsi_insert_seq_before (gsi, cleanup_seq, GSI_SAME_STMT);
- gsi_remove (gsi, false);
- data->repeat = true;
- }
- else
- gsi_next (gsi);
-}
-
-/* Helper for remove_useless_stmts_1.
- Handle the try-catch case for GIMPLE_TRY statements. */
-
-static void
-remove_useless_stmts_tc (gimple_stmt_iterator *gsi, struct rus_data *data)
-{
- bool save_may_throw, this_may_throw;
-
- gimple_seq eval_seq, cleanup_seq, handler_seq, failure_seq;
- gimple_stmt_iterator eval_gsi, cleanup_gsi, handler_gsi, failure_gsi;
-
- gimple stmt = gsi_stmt (*gsi);
-
- /* Collect may_throw information for the body only. */
- save_may_throw = data->may_throw;
- data->may_throw = false;
- data->last_was_goto = false;
-
- eval_seq = gimple_try_eval (stmt);
- eval_gsi = gsi_start (eval_seq);
- remove_useless_stmts_1 (&eval_gsi, data);
-
- this_may_throw = data->may_throw;
- data->may_throw = save_may_throw;
-
- cleanup_seq = gimple_try_cleanup (stmt);
-
- /* If the body cannot throw, then we can drop the entire TRY_CATCH_EXPR. */
- if (!this_may_throw)
- {
- if (warn_notreached)
- {
- remove_useless_stmts_warn_notreached (cleanup_seq);
- }
- gsi_insert_seq_before (gsi, eval_seq, GSI_SAME_STMT);
- gsi_remove (gsi, false);
- data->repeat = true;
- return;
- }
-
- /* Process the catch clause specially. We may be able to tell that
- no exceptions propagate past this point. */
-
- this_may_throw = true;
- cleanup_gsi = gsi_start (cleanup_seq);
- stmt = gsi_stmt (cleanup_gsi);
- data->last_was_goto = false;
-
- switch (gimple_code (stmt))
- {
- case GIMPLE_CATCH:
- /* If the first element is a catch, they all must be. */
- while (!gsi_end_p (cleanup_gsi))
- {
- stmt = gsi_stmt (cleanup_gsi);
- /* If we catch all exceptions, then the body does not
- propagate exceptions past this point. */
- if (gimple_catch_types (stmt) == NULL)
- this_may_throw = false;
- data->last_was_goto = false;
- handler_seq = gimple_catch_handler (stmt);
- handler_gsi = gsi_start (handler_seq);
- remove_useless_stmts_1 (&handler_gsi, data);
- gsi_next (&cleanup_gsi);
- }
- gsi_next (gsi);
- break;
-
- case GIMPLE_EH_FILTER:
- if (gimple_eh_filter_types (stmt) == NULL)
- this_may_throw = false;
- failure_seq = gimple_eh_filter_failure (stmt);
- failure_gsi = gsi_start (failure_seq);
- remove_useless_stmts_1 (&failure_gsi, data);
- gsi_next (gsi);
- break;
-
- case GIMPLE_EH_MUST_NOT_THROW:
- this_may_throw = false;
- gsi_next (gsi);
- break;
-
- default:
- /* Otherwise this is a list of cleanup statements. */
- remove_useless_stmts_1 (&cleanup_gsi, data);
-
- /* If the cleanup is empty, then we can emit the TRY block without
- the enclosing TRY_CATCH_EXPR. */
- if (gimple_seq_empty_p (cleanup_seq))
- {
- gsi_insert_seq_before (gsi, eval_seq, GSI_SAME_STMT);
- gsi_remove(gsi, false);
- data->repeat = true;
- }
- else
- gsi_next (gsi);
- break;
- }
-
- data->may_throw |= this_may_throw;
-}
-
-/* Helper for remove_useless_stmts_1. Handle GIMPLE_BIND statements. */
-
-static void
-remove_useless_stmts_bind (gimple_stmt_iterator *gsi, struct rus_data *data ATTRIBUTE_UNUSED)
-{
- tree block;
- gimple_seq body_seq, fn_body_seq;
- gimple_stmt_iterator body_gsi;
-
- gimple stmt = gsi_stmt (*gsi);
-
- /* First remove anything underneath the BIND_EXPR. */
-
- body_seq = gimple_bind_body (stmt);
- body_gsi = gsi_start (body_seq);
- remove_useless_stmts_1 (&body_gsi, data);
-
- /* If the GIMPLE_BIND has no variables, then we can pull everything
- up one level and remove the GIMPLE_BIND, unless this is the toplevel
- GIMPLE_BIND for the current function or an inlined function.
-
- When this situation occurs we will want to apply this
- optimization again. */
- block = gimple_bind_block (stmt);
- fn_body_seq = gimple_body (current_function_decl);
- if (gimple_bind_vars (stmt) == NULL_TREE
- && (gimple_seq_empty_p (fn_body_seq)
- || stmt != gimple_seq_first_stmt (fn_body_seq))
- && (! block
- || ! BLOCK_ABSTRACT_ORIGIN (block)
- || (TREE_CODE (BLOCK_ABSTRACT_ORIGIN (block))
- != FUNCTION_DECL)))
- {
- tree var = NULL_TREE;
- /* Even if there are no gimple_bind_vars, there might be other
- decls in BLOCK_VARS rendering the GIMPLE_BIND not useless. */
- if (block && !BLOCK_NUM_NONLOCALIZED_VARS (block))
- for (var = BLOCK_VARS (block); var; var = TREE_CHAIN (var))
- if (TREE_CODE (var) == IMPORTED_DECL)
- break;
- if (var || (block && BLOCK_NUM_NONLOCALIZED_VARS (block)))
- gsi_next (gsi);
- else
- {
- gsi_insert_seq_before (gsi, body_seq, GSI_SAME_STMT);
- gsi_remove (gsi, false);
- data->repeat = true;
- }
- }
- else
- gsi_next (gsi);
-}
-
-/* Helper for remove_useless_stmts_1. Handle GIMPLE_GOTO statements. */
-
-static void
-remove_useless_stmts_goto (gimple_stmt_iterator *gsi, struct rus_data *data)
-{
- gimple stmt = gsi_stmt (*gsi);
-
- tree dest = gimple_goto_dest (stmt);
-
- data->may_branch = true;
- data->last_was_goto = false;
-
- /* Record iterator for last goto expr, so that we can delete it if unnecessary. */
- if (TREE_CODE (dest) == LABEL_DECL)
- {
- data->last_goto_gsi = *gsi;
- data->last_was_goto = true;
- }
-
- gsi_next(gsi);
-}
-
-/* Helper for remove_useless_stmts_1. Handle GIMPLE_LABEL statements. */
-
-static void
-remove_useless_stmts_label (gimple_stmt_iterator *gsi, struct rus_data *data)
-{
- gimple stmt = gsi_stmt (*gsi);
-
- tree label = gimple_label_label (stmt);
-
- data->has_label = true;
-
- /* We do want to jump across non-local label receiver code. */
- if (DECL_NONLOCAL (label))
- data->last_was_goto = false;
-
- else if (data->last_was_goto
- && gimple_goto_dest (gsi_stmt (data->last_goto_gsi)) == label)
- {
- /* Replace the preceding GIMPLE_GOTO statement with
- a GIMPLE_NOP, which will be subsequently removed.
- In this way, we avoid invalidating other iterators
- active on the statement sequence. */
- gsi_replace(&data->last_goto_gsi, gimple_build_nop(), false);
- data->last_was_goto = false;
- data->repeat = true;
- }
-
- /* ??? Add something here to delete unused labels. */
-
- gsi_next (gsi);
-}
-
-
/* T is CALL_EXPR. Set current_function_calls_* flags. */
void
@@ -2156,188 +1739,6 @@ clear_special_calls (void)
cfun->calls_setjmp = false;
}
-/* Remove useless statements from a statement sequence, and perform
- some preliminary simplifications. */
-
-static void
-remove_useless_stmts_1 (gimple_stmt_iterator *gsi, struct rus_data *data)
-{
- while (!gsi_end_p (*gsi))
- {
- gimple stmt = gsi_stmt (*gsi);
-
- switch (gimple_code (stmt))
- {
- case GIMPLE_COND:
- remove_useless_stmts_cond (gsi, data);
- break;
-
- case GIMPLE_GOTO:
- remove_useless_stmts_goto (gsi, data);
- break;
-
- case GIMPLE_LABEL:
- remove_useless_stmts_label (gsi, data);
- break;
-
- case GIMPLE_ASSIGN:
- fold_stmt (gsi);
- stmt = gsi_stmt (*gsi);
- data->last_was_goto = false;
- if (stmt_could_throw_p (stmt))
- data->may_throw = true;
- gsi_next (gsi);
- break;
-
- case GIMPLE_ASM:
- fold_stmt (gsi);
- data->last_was_goto = false;
- gsi_next (gsi);
- break;
-
- case GIMPLE_CALL:
- fold_stmt (gsi);
- stmt = gsi_stmt (*gsi);
- data->last_was_goto = false;
- if (is_gimple_call (stmt))
- notice_special_calls (stmt);
-
- /* We used to call update_gimple_call_flags here,
- which copied side-effects and nothrows status
- from the function decl to the call. In the new
- tuplified GIMPLE, the accessors for this information
- always consult the function decl, so this copying
- is no longer necessary. */
- if (stmt_could_throw_p (stmt))
- data->may_throw = true;
- gsi_next (gsi);
- break;
-
- case GIMPLE_RETURN:
- fold_stmt (gsi);
- data->last_was_goto = false;
- data->may_branch = true;
- gsi_next (gsi);
- break;
-
- case GIMPLE_BIND:
- remove_useless_stmts_bind (gsi, data);
- break;
-
- case GIMPLE_TRY:
- if (gimple_try_kind (stmt) == GIMPLE_TRY_CATCH)
- remove_useless_stmts_tc (gsi, data);
- else if (gimple_try_kind (stmt) == GIMPLE_TRY_FINALLY)
- remove_useless_stmts_tf (gsi, data);
- else
- gcc_unreachable ();
- break;
-
- case GIMPLE_CATCH:
- gcc_unreachable ();
- break;
-
- case GIMPLE_NOP:
- gsi_remove (gsi, false);
- break;
-
- case GIMPLE_OMP_FOR:
- {
- gimple_seq pre_body_seq = gimple_omp_for_pre_body (stmt);
- gimple_stmt_iterator pre_body_gsi = gsi_start (pre_body_seq);
-
- remove_useless_stmts_1 (&pre_body_gsi, data);
- data->last_was_goto = false;
- }
- /* FALLTHROUGH */
- case GIMPLE_OMP_CRITICAL:
- case GIMPLE_OMP_CONTINUE:
- case GIMPLE_OMP_MASTER:
- case GIMPLE_OMP_ORDERED:
- case GIMPLE_OMP_SECTION:
- case GIMPLE_OMP_SECTIONS:
- case GIMPLE_OMP_SINGLE:
- {
- gimple_seq body_seq = gimple_omp_body (stmt);
- gimple_stmt_iterator body_gsi = gsi_start (body_seq);
-
- remove_useless_stmts_1 (&body_gsi, data);
- data->last_was_goto = false;
- gsi_next (gsi);
- }
- break;
-
- case GIMPLE_OMP_PARALLEL:
- case GIMPLE_OMP_TASK:
- {
- /* Make sure the outermost GIMPLE_BIND isn't removed
- as useless. */
- gimple_seq body_seq = gimple_omp_body (stmt);
- gimple bind = gimple_seq_first_stmt (body_seq);
- gimple_seq bind_seq = gimple_bind_body (bind);
- gimple_stmt_iterator bind_gsi = gsi_start (bind_seq);
-
- remove_useless_stmts_1 (&bind_gsi, data);
- data->last_was_goto = false;
- gsi_next (gsi);
- }
- break;
-
- default:
- data->last_was_goto = false;
- gsi_next (gsi);
- break;
- }
- }
-}
-
-/* Walk the function tree, removing useless statements and performing
- some preliminary simplifications. */
-
-static unsigned int
-remove_useless_stmts (void)
-{
- struct rus_data data;
-
- clear_special_calls ();
-
- do
- {
- gimple_stmt_iterator gsi;
-
- gsi = gsi_start (gimple_body (current_function_decl));
- memset (&data, 0, sizeof (data));
- remove_useless_stmts_1 (&gsi, &data);
- }
- while (data.repeat);
-
-#ifdef ENABLE_TYPES_CHECKING
- verify_types_in_gimple_seq (gimple_body (current_function_decl));
-#endif
-
- return 0;
-}
-
-
-struct gimple_opt_pass pass_remove_useless_stmts =
-{
- {
- GIMPLE_PASS,
- "useless", /* name */
- NULL, /* gate */
- remove_useless_stmts, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_gimple_any, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_dump_func /* todo_flags_finish */
- }
-};
-
/* Remove PHI nodes associated with basic block BB and all edges out of BB. */
static void
@@ -3706,6 +3107,21 @@ verify_gimple_assign_unary (gimple stmt)
return false;
}
+ case ADDR_SPACE_CONVERT_EXPR:
+ {
+ if (!POINTER_TYPE_P (rhs1_type) || !POINTER_TYPE_P (lhs_type)
+ || (TYPE_ADDR_SPACE (TREE_TYPE (rhs1_type))
+ == TYPE_ADDR_SPACE (TREE_TYPE (lhs_type))))
+ {
+ error ("invalid types in address space conversion");
+ debug_generic_expr (lhs_type);
+ debug_generic_expr (rhs1_type);
+ return true;
+ }
+
+ return false;
+ }
+
case FIXED_CONVERT_EXPR:
{
if (!valid_fixed_convert_types_p (lhs_type, rhs1_type)
@@ -4526,7 +3942,7 @@ verify_stmt (gimple_stmt_iterator *gsi)
/* Return true when the T can be shared. */
-static bool
+bool
tree_node_can_be_shared (tree t)
{
if (IS_TYPE_OR_DECL_P (t)
@@ -5449,6 +4865,31 @@ gimple_duplicate_bb (basic_block bb)
return new_bb;
}
+/* Add phi arguments to the phi nodes in E_COPY->dest according to
+ the phi arguments coming from the equivalent edge at
+ the phi nodes of DEST. */
+
+static void
+add_phi_args_after_redirect (edge e_copy, edge orig_e)
+{
+ gimple_stmt_iterator psi, psi_copy;
+ gimple phi, phi_copy;
+ tree def;
+
+ for (psi = gsi_start_phis (orig_e->dest),
+ psi_copy = gsi_start_phis (e_copy->dest);
+ !gsi_end_p (psi);
+ gsi_next (&psi), gsi_next (&psi_copy))
+ {
+
+ phi = gsi_stmt (psi);
+ phi_copy = gsi_stmt (psi_copy);
+ def = PHI_ARG_DEF_FROM_EDGE (phi, orig_e);
+ add_phi_arg (phi_copy, def, e_copy,
+ gimple_phi_arg_location_from_edge (phi, orig_e));
+ }
+}
+
/* Adds phi node arguments for edge E_COPY after basic block duplication. */
static void
@@ -5730,9 +5171,14 @@ gimple_duplicate_sese_tail (edge entry ATTRIBUTE_UNUSED, edge exit ATTRIBUTE_UNU
int total_freq = 0, exit_freq = 0;
gcov_type total_count = 0, exit_count = 0;
edge exits[2], nexits[2], e;
- gimple_stmt_iterator gsi;
+ gimple_stmt_iterator gsi,gsi1;
gimple cond_stmt;
- edge sorig, snew;
+ edge sorig, snew, orig_e;
+ basic_block exit_bb;
+ edge_iterator ei;
+ VEC (edge, heap) *redirect_edges;
+ basic_block iters_bb, orig_src;
+ tree new_rhs;
gcc_assert (EDGE_COUNT (exit->src->succs) == 2);
exits[0] = exit;
@@ -5748,17 +5194,13 @@ gimple_duplicate_sese_tail (edge entry ATTRIBUTE_UNUSED, edge exit ATTRIBUTE_UNU
it will work, but the resulting code will not be correct. */
for (i = 0; i < n_region; i++)
{
- /* We do not handle subloops, i.e. all the blocks must belong to the
- same loop. */
- if (region[i]->loop_father != orig_loop)
- return false;
-
if (region[i] == orig_loop->latch)
return false;
}
initialize_original_copy_tables ();
set_loop_copy (orig_loop, loop);
+ duplicate_subloops (orig_loop, loop);
if (!region_copy)
{
@@ -5824,8 +5266,36 @@ gimple_duplicate_sese_tail (edge entry ATTRIBUTE_UNUSED, edge exit ATTRIBUTE_UNU
cond_stmt = last_stmt (exit->src);
gcc_assert (gimple_code (cond_stmt) == GIMPLE_COND);
cond_stmt = gimple_copy (cond_stmt);
+
+ /* If the block consisting of the exit condition has the latch as
+ successor, then the body of the loop is executed before
+ the exit condition is tested. In such case, moving the
+ condition to the entry, causes that the loop will iterate
+ one less iteration (which is the wanted outcome, since we
+ peel out the last iteration). If the body is executed after
+ the condition, moving the condition to the entry requires
+ decrementing one iteration. */
+ if (exits[1]->dest == orig_loop->latch)
+ new_rhs = gimple_cond_rhs (cond_stmt);
+ else
+ {
+ new_rhs = fold_build2 (MINUS_EXPR, TREE_TYPE (gimple_cond_rhs (cond_stmt)),
+ gimple_cond_rhs (cond_stmt),
+ build_int_cst (TREE_TYPE (gimple_cond_rhs (cond_stmt)), 1));
+
+ if (TREE_CODE (gimple_cond_rhs (cond_stmt)) == SSA_NAME)
+ {
+ iters_bb = gimple_bb (SSA_NAME_DEF_STMT (gimple_cond_rhs (cond_stmt)));
+ for (gsi1 = gsi_start_bb (iters_bb); !gsi_end_p (gsi1); gsi_next (&gsi1))
+ if (gsi_stmt (gsi1) == SSA_NAME_DEF_STMT (gimple_cond_rhs (cond_stmt)))
+ break;
+
+ new_rhs = force_gimple_operand_gsi (&gsi1, new_rhs, true,
+ NULL_TREE,false,GSI_CONTINUE_LINKING);
+ }
+ }
+ gimple_cond_set_rhs (cond_stmt, unshare_expr (new_rhs));
gimple_cond_set_lhs (cond_stmt, unshare_expr (gimple_cond_lhs (cond_stmt)));
- gimple_cond_set_rhs (cond_stmt, unshare_expr (gimple_cond_rhs (cond_stmt)));
gsi_insert_after (&gsi, cond_stmt, GSI_NEW_STMT);
sorig = single_succ_edge (switch_bb);
@@ -5837,13 +5307,74 @@ gimple_duplicate_sese_tail (edge entry ATTRIBUTE_UNUSED, edge exit ATTRIBUTE_UNU
/* Add the PHI node arguments. */
add_phi_args_after_copy (region_copy, n_region, snew);
-
+
/* Get rid of now superfluous conditions and associated edges (and phi node
arguments). */
+ exit_bb = exit->dest;
+
e = redirect_edge_and_branch (exits[0], exits[1]->dest);
PENDING_STMT (e) = NULL;
- e = redirect_edge_and_branch (nexits[1], nexits[0]->dest);
- PENDING_STMT (e) = NULL;
+
+ /* If the block consisting of the exit condition has the latch as
+ successor, then the body of the loop is executed before
+ the exit condition is tested.
+
+ { body }
+ { cond } (exit[0]) -> { latch }
+ |
+ V (exit[1])
+
+ { exit_bb }
+
+
+ In such case, the equivalent copied edge nexits[1]
+ (for the peeled iteration) needs to be redirected to exit_bb.
+
+ Otherwise,
+
+ { cond } (exit[0]) -> { body }
+ |
+ V (exit[1])
+
+ { exit_bb }
+
+
+ exit[0] is pointing to the body of the loop,
+ and the equivalent nexits[0] needs to be redirected to
+ the copied body (of the peeled iteration). */
+
+ if (exits[1]->dest == orig_loop->latch)
+ e = redirect_edge_and_branch (nexits[1], nexits[0]->dest);
+ else
+ e = redirect_edge_and_branch (nexits[0], nexits[1]->dest);
+ PENDING_STMT (e) = NULL;
+
+ redirect_edges = VEC_alloc (edge, heap, 10);
+
+ for (i = 0; i < n_region; i++)
+ region_copy[i]->flags |= BB_DUPLICATED;
+
+ /* Iterate all incoming edges to latch. All those coming from
+ copied bbs will be redirected to exit_bb. */
+ FOR_EACH_EDGE (e, ei, orig_loop->latch->preds)
+ {
+ if (e->src->flags & BB_DUPLICATED)
+ VEC_safe_push (edge, heap, redirect_edges, e);
+ }
+
+ for (i = 0; i < n_region; i++)
+ region_copy[i]->flags &= ~BB_DUPLICATED;
+
+ for (i = 0; VEC_iterate (edge, redirect_edges, i, e); ++i)
+ {
+ e = redirect_edge_and_branch (e, exit_bb);
+ PENDING_STMT (e) = NULL;
+ orig_src = get_bb_original (e->src);
+ orig_e = find_edge (orig_src, orig_loop->latch);
+ add_phi_args_after_redirect (e, orig_e);
+ }
+
+ VEC_free (edge, heap, redirect_edges);
/* Anything that is outside of the region, but was dominated by something
inside needs to update dominance info. */
diff --git a/gcc/tree-chrec.h b/gcc/tree-chrec.h
index f21aa74d795..545db38a730 100644
--- a/gcc/tree-chrec.h
+++ b/gcc/tree-chrec.h
@@ -115,6 +115,7 @@ no_evolution_in_loop_p (tree chrec, unsigned loop_num, bool *res)
|| chrec_contains_symbols_defined_in_loop (chrec, loop_num))
return false;
+ STRIP_NOPS (chrec);
scev = hide_evolution_in_other_loops_than_loop (chrec, loop_num);
*res = !tree_is_chrec (scev);
return true;
diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
index 199f1dcf54c..5108e07cd48 100644
--- a/gcc/tree-complex.c
+++ b/gcc/tree-complex.c
@@ -1114,12 +1114,12 @@ expand_complex_div_wide (gimple_stmt_iterator *gsi, tree inner_type,
t1 = gimplify_build1 (gsi, ABS_EXPR, inner_type, br);
t2 = gimplify_build1 (gsi, ABS_EXPR, inner_type, bi);
compare = fold_build2_loc (gimple_location (gsi_stmt (*gsi)),
- LT_EXPR, boolean_type_node, t1, t2);
+ LT_EXPR, boolean_type_node, t1, t2);
STRIP_NOPS (compare);
bb_cond = bb_true = bb_false = bb_join = NULL;
rr = ri = tr = ti = NULL;
- if (!TREE_CONSTANT (compare))
+ if (TREE_CODE (compare) != INTEGER_CST)
{
edge e;
gimple stmt;
diff --git a/gcc/tree-dump.c b/gcc/tree-dump.c
index 61ccc6ce792..7b7a85f5082 100644
--- a/gcc/tree-dump.c
+++ b/gcc/tree-dump.c
@@ -511,6 +511,10 @@ dequeue_and_dump (dump_info_p di)
dump_child ("cnst", DECL_INITIAL (t));
break;
+ case DEBUG_EXPR_DECL:
+ dump_int (di, "-uid", DEBUG_TEMP_UID (t));
+ /* Fall through. */
+
case VAR_DECL:
case PARM_DECL:
case FIELD_DECL:
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index 3ed92a59bc7..c5c7f7146c8 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -340,7 +340,7 @@ static gimple_seq eh_seq;
/* Record whether an EH region contains something that can throw,
indexed by EH region number. */
-static bitmap eh_region_may_contain_throw;
+static bitmap eh_region_may_contain_throw_map;
/* The GOTO_QUEUE is is an array of GIMPLE_GOTO and GIMPLE_RETURN
statements that are seen to escape this GIMPLE_TRY_FINALLY node.
@@ -863,15 +863,24 @@ emit_eh_dispatch (gimple_seq *seq, eh_region region)
static void
note_eh_region_may_contain_throw (eh_region region)
{
- while (!bitmap_bit_p (eh_region_may_contain_throw, region->index))
+ while (!bitmap_bit_p (eh_region_may_contain_throw_map, region->index))
{
- bitmap_set_bit (eh_region_may_contain_throw, region->index);
+ bitmap_set_bit (eh_region_may_contain_throw_map, region->index);
region = region->outer;
if (region == NULL)
break;
}
}
+/* Check if REGION has been marked as containing a throw. If REGION is
+ NULL, this predicate is false. */
+
+static inline bool
+eh_region_may_contain_throw (eh_region r)
+{
+ return r && bitmap_bit_p (eh_region_may_contain_throw_map, r->index);
+}
+
/* We want to transform
try { body; } catch { stuff; }
to
@@ -1192,12 +1201,11 @@ lower_try_finally_copy (struct leh_state *state, struct leh_tf_state *tf)
if (tf->may_throw)
{
- emit_post_landing_pad (&eh_seq, tf->region);
-
seq = lower_try_finally_dup_block (finally, state);
lower_eh_constructs_1 (state, seq);
- gimple_seq_add_seq (&eh_seq, seq);
+ emit_post_landing_pad (&eh_seq, tf->region);
+ gimple_seq_add_seq (&eh_seq, seq);
emit_resx (&eh_seq, tf->region);
}
@@ -1560,8 +1568,7 @@ lower_try_finally (struct leh_state *state, gimple tp)
/* Determine if any exceptions are possible within the try block. */
if (using_eh_for_cleanups_p)
- this_tf.may_throw = bitmap_bit_p (eh_region_may_contain_throw,
- this_tf.region->index);
+ this_tf.may_throw = eh_region_may_contain_throw (this_tf.region);
if (this_tf.may_throw)
honor_protect_cleanup_actions (state, &this_state, &this_tf);
@@ -1619,22 +1626,23 @@ lower_try_finally (struct leh_state *state, gimple tp)
static gimple_seq
lower_catch (struct leh_state *state, gimple tp)
{
- eh_region try_region;
- struct leh_state this_state;
+ eh_region try_region = NULL;
+ struct leh_state this_state = *state;
gimple_stmt_iterator gsi;
tree out_label;
gimple_seq new_seq;
gimple x;
location_t try_catch_loc = gimple_location (tp);
- try_region = gen_eh_region_try (state->cur_region);
-
- this_state = *state;
- this_state.cur_region = try_region;
+ if (flag_exceptions)
+ {
+ try_region = gen_eh_region_try (state->cur_region);
+ this_state.cur_region = try_region;
+ }
lower_eh_constructs_1 (&this_state, gimple_try_eval (tp));
- if (!bitmap_bit_p (eh_region_may_contain_throw, try_region->index))
+ if (!eh_region_may_contain_throw (try_region))
return gimple_try_eval (tp);
new_seq = NULL;
@@ -1687,21 +1695,23 @@ lower_catch (struct leh_state *state, gimple tp)
static gimple_seq
lower_eh_filter (struct leh_state *state, gimple tp)
{
- struct leh_state this_state;
- eh_region this_region;
+ struct leh_state this_state = *state;
+ eh_region this_region = NULL;
gimple inner, x;
gimple_seq new_seq;
inner = gimple_seq_first_stmt (gimple_try_cleanup (tp));
- this_region = gen_eh_region_allowed (state->cur_region,
- gimple_eh_filter_types (inner));
- this_state = *state;
- this_state.cur_region = this_region;
+ if (flag_exceptions)
+ {
+ this_region = gen_eh_region_allowed (state->cur_region,
+ gimple_eh_filter_types (inner));
+ this_state.cur_region = this_region;
+ }
lower_eh_constructs_1 (&this_state, gimple_try_eval (tp));
- if (!bitmap_bit_p (eh_region_may_contain_throw, this_region->index))
+ if (!eh_region_may_contain_throw (this_region))
return gimple_try_eval (tp);
new_seq = NULL;
@@ -1730,24 +1740,25 @@ lower_eh_filter (struct leh_state *state, gimple tp)
static gimple_seq
lower_eh_must_not_throw (struct leh_state *state, gimple tp)
{
- struct leh_state this_state;
- eh_region this_region;
- gimple inner;
+ struct leh_state this_state = *state;
- inner = gimple_seq_first_stmt (gimple_try_cleanup (tp));
+ if (flag_exceptions)
+ {
+ gimple inner = gimple_seq_first_stmt (gimple_try_cleanup (tp));
+ eh_region this_region;
- this_region = gen_eh_region_must_not_throw (state->cur_region);
- this_region->u.must_not_throw.failure_decl
- = gimple_eh_must_not_throw_fndecl (inner);
- this_region->u.must_not_throw.failure_loc = gimple_location (tp);
+ this_region = gen_eh_region_must_not_throw (state->cur_region);
+ this_region->u.must_not_throw.failure_decl
+ = gimple_eh_must_not_throw_fndecl (inner);
+ this_region->u.must_not_throw.failure_loc = gimple_location (tp);
- /* In order to get mangling applied to this decl, we must mark it
- used now. Otherwise, pass_ipa_free_lang_data won't think it
- needs to happen. */
- TREE_USED (this_region->u.must_not_throw.failure_decl) = 1;
+ /* In order to get mangling applied to this decl, we must mark it
+ used now. Otherwise, pass_ipa_free_lang_data won't think it
+ needs to happen. */
+ TREE_USED (this_region->u.must_not_throw.failure_decl) = 1;
- this_state = *state;
- this_state.cur_region = this_region;
+ this_state.cur_region = this_region;
+ }
lower_eh_constructs_1 (&this_state, gimple_try_eval (tp));
@@ -1760,26 +1771,20 @@ lower_eh_must_not_throw (struct leh_state *state, gimple tp)
static gimple_seq
lower_cleanup (struct leh_state *state, gimple tp)
{
- struct leh_state this_state;
- eh_region this_region;
+ struct leh_state this_state = *state;
+ eh_region this_region = NULL;
struct leh_tf_state fake_tf;
gimple_seq result;
- /* If not using eh, then exception-only cleanups are no-ops. */
- if (!flag_exceptions)
+ if (flag_exceptions)
{
- result = gimple_try_eval (tp);
- lower_eh_constructs_1 (state, result);
- return result;
+ this_region = gen_eh_region_cleanup (state->cur_region);
+ this_state.cur_region = this_region;
}
- this_region = gen_eh_region_cleanup (state->cur_region);
- this_state = *state;
- this_state.cur_region = this_region;
-
lower_eh_constructs_1 (&this_state, gimple_try_eval (tp));
- if (!bitmap_bit_p (eh_region_may_contain_throw, this_region->index))
+ if (!eh_region_may_contain_throw (this_region))
return gimple_try_eval (tp);
/* Build enough of a try-finally state so that we can reuse
@@ -1919,21 +1924,27 @@ lower_eh_constructs_2 (struct leh_state *state, gimple_stmt_iterator *gsi)
else
{
x = gimple_seq_first_stmt (gimple_try_cleanup (stmt));
- switch (gimple_code (x))
+ if (!x)
{
- case GIMPLE_CATCH:
- replace = lower_catch (state, stmt);
- break;
- case GIMPLE_EH_FILTER:
- replace = lower_eh_filter (state, stmt);
- break;
- case GIMPLE_EH_MUST_NOT_THROW:
- replace = lower_eh_must_not_throw (state, stmt);
- break;
- default:
- replace = lower_cleanup (state, stmt);
- break;
+ replace = gimple_try_eval (stmt);
+ lower_eh_constructs_1 (state, replace);
}
+ else
+ switch (gimple_code (x))
+ {
+ case GIMPLE_CATCH:
+ replace = lower_catch (state, stmt);
+ break;
+ case GIMPLE_EH_FILTER:
+ replace = lower_eh_filter (state, stmt);
+ break;
+ case GIMPLE_EH_MUST_NOT_THROW:
+ replace = lower_eh_must_not_throw (state, stmt);
+ break;
+ default:
+ replace = lower_cleanup (state, stmt);
+ break;
+ }
}
/* Remove the old stmt and insert the transformed sequence
@@ -1974,7 +1985,7 @@ lower_eh_constructs (void)
return 0;
finally_tree = htab_create (31, struct_ptr_hash, struct_ptr_eq, free);
- eh_region_may_contain_throw = BITMAP_ALLOC (NULL);
+ eh_region_may_contain_throw_map = BITMAP_ALLOC (NULL);
memset (&null_state, 0, sizeof (null_state));
collect_finally_tree_1 (bodyp, NULL);
@@ -1991,7 +2002,7 @@ lower_eh_constructs (void)
gcc_assert (bodyp == gimple_body (current_function_decl));
htab_delete (finally_tree);
- BITMAP_FREE (eh_region_may_contain_throw);
+ BITMAP_FREE (eh_region_may_contain_throw_map);
eh_seq = NULL;
/* If this function needs a language specific EH personality routine
@@ -3375,12 +3386,31 @@ unsplit_eh (eh_landing_pad lp)
if (find_edge (e_in->src, e_out->dest))
return false;
- /* ??? I can't imagine there would be PHI nodes, since by nature
- of critical edge splitting this block should never have been
- a dominance frontier. If cfg cleanups somehow confuse this,
- due to single edges in and out we ought to have degenerate PHIs
- and can easily propagate the PHI arguments. */
- gcc_assert (gimple_seq_empty_p (phi_nodes (bb)));
+ /* ??? We can get degenerate phis due to cfg cleanups. I would have
+ thought this should have been cleaned up by a phicprop pass, but
+ that doesn't appear to handle virtuals. Propagate by hand. */
+ if (!gimple_seq_empty_p (phi_nodes (bb)))
+ {
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); )
+ {
+ gimple use_stmt, phi = gsi_stmt (gsi);
+ tree lhs = gimple_phi_result (phi);
+ tree rhs = gimple_phi_arg_def (phi, 0);
+ use_operand_p use_p;
+ imm_use_iterator iter;
+
+ FOR_EACH_IMM_USE_STMT (use_stmt, iter, lhs)
+ {
+ FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
+ SET_USE (use_p, rhs);
+ }
+
+ if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
+ SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rhs) = 1;
+
+ remove_phi_node (&gsi, true);
+ }
+ }
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "Unsplit EH landing pad %d to block %i.\n",
@@ -3425,7 +3455,7 @@ unsplit_all_eh (void)
static bool
cleanup_empty_eh_merge_phis (basic_block new_bb, basic_block old_bb,
- edge old_bb_out)
+ edge old_bb_out, bool change_region)
{
gimple_stmt_iterator ngsi, ogsi;
edge_iterator ei;
@@ -3525,7 +3555,7 @@ cleanup_empty_eh_merge_phis (basic_block new_bb, basic_block old_bb,
for (ei = ei_start (old_bb->preds); (e = ei_safe_edge (ei)); )
if (e->flags & EDGE_EH)
{
- redirect_eh_edge_1 (e, new_bb, true);
+ redirect_eh_edge_1 (e, new_bb, change_region);
redirect_edge_succ (e, new_bb);
flush_pending_stmts (e);
}
@@ -3577,10 +3607,9 @@ cleanup_empty_eh_move_lp (basic_block bb, edge e_out,
multiple incoming edges and phis are involved. */
static bool
-cleanup_empty_eh_unsplit (basic_block bb, edge e_out, eh_landing_pad olp)
+cleanup_empty_eh_unsplit (basic_block bb, edge e_out, eh_landing_pad lp)
{
gimple_stmt_iterator gsi;
- eh_landing_pad nlp;
tree lab;
/* We really ought not have totally lost everything following
@@ -3588,35 +3617,30 @@ cleanup_empty_eh_unsplit (basic_block bb, edge e_out, eh_landing_pad olp)
be a successor. */
gcc_assert (e_out != NULL);
- /* Look for an EH label in the successor block. */
+ /* The destination block must not already have a landing pad
+ for a different region. */
lab = NULL;
for (gsi = gsi_start_bb (e_out->dest); !gsi_end_p (gsi); gsi_next (&gsi))
{
gimple stmt = gsi_stmt (gsi);
+ int lp_nr;
+
if (gimple_code (stmt) != GIMPLE_LABEL)
break;
lab = gimple_label_label (stmt);
- if (EH_LANDING_PAD_NR (lab))
- goto found;
+ lp_nr = EH_LANDING_PAD_NR (lab);
+ if (lp_nr && get_eh_region_from_lp_number (lp_nr) != lp->region)
+ return false;
}
- return false;
- found:
-
- /* The other label had better be part of the same EH region. Given that
- we've not lowered RESX, there should be no way to have a totally empty
- landing pad that crosses to another EH region. */
- nlp = get_eh_landing_pad_from_number (EH_LANDING_PAD_NR (lab));
- gcc_assert (nlp->region == olp->region);
/* Attempt to move the PHIs into the successor block. */
- if (cleanup_empty_eh_merge_phis (e_out->dest, bb, e_out))
+ if (cleanup_empty_eh_merge_phis (e_out->dest, bb, e_out, false))
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file,
- "Unsplit EH landing pad %d to block %d via lp %d.\n",
- olp->index, e_out->dest->index, nlp->index);
-
- remove_eh_landing_pad (olp);
+ "Unsplit EH landing pad %d to block %i "
+ "(via cleanup_empty_eh).\n",
+ lp->index, e_out->dest->index);
return true;
}
@@ -3719,7 +3743,7 @@ cleanup_empty_eh (eh_landing_pad lp)
landing pad block. If the merge succeeds, we'll already have redirected
all the EH edges. The handler itself will go unreachable if there were
no normal edges. */
- if (cleanup_empty_eh_merge_phis (e_out->dest, bb, e_out))
+ if (cleanup_empty_eh_merge_phis (e_out->dest, bb, e_out, true))
goto succeed;
/* Finally, if all input edges are EH edges, then we can (potentially)
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index 77cd80bdfe9..40fad2dd556 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -540,6 +540,7 @@ extern basic_block move_sese_region_to_fn (struct function *, basic_block,
basic_block, tree);
void remove_edge_and_dominated_blocks (edge);
void mark_virtual_ops_in_bb (basic_block);
+bool tree_node_can_be_shared (tree);
/* In tree-cfgcleanup.c */
extern bitmap cfgcleanup_altered_bbs;
@@ -636,10 +637,8 @@ typedef bool (*walk_use_def_chains_fn) (tree, gimple, void *);
extern void walk_use_def_chains (tree, walk_use_def_chains_fn, void *, bool);
-void propagate_defs_into_debug_stmts (gimple, basic_block,
- const gimple_stmt_iterator *);
-void propagate_var_def_into_debug_stmts (tree, basic_block,
- const gimple_stmt_iterator *);
+void insert_debug_temps_for_defs (gimple_stmt_iterator *);
+void insert_debug_temp_for_var_def (gimple_stmt_iterator *, tree);
void release_defs_bitset (bitmap toremove);
/* In tree-into-ssa.c */
@@ -891,7 +890,8 @@ extern void tree_check_data_deps (void);
/* In tree-ssa-loop-ivopts.c */
bool expr_invariant_in_loop_p (struct loop *, tree);
bool stmt_invariant_in_loop_p (struct loop *, gimple);
-bool multiplier_allowed_in_address_p (HOST_WIDE_INT, enum machine_mode);
+bool multiplier_allowed_in_address_p (HOST_WIDE_INT, enum machine_mode,
+ addr_space_t);
unsigned multiply_by_cost (HOST_WIDE_INT, enum machine_mode, bool);
/* In tree-ssa-threadupdate.c. */
@@ -921,8 +921,8 @@ struct mem_address
struct affine_tree_combination;
tree create_mem_ref (gimple_stmt_iterator *, tree,
- struct affine_tree_combination *, bool);
-rtx addr_for_mem_ref (struct mem_address *, bool);
+ struct affine_tree_combination *, tree, bool);
+rtx addr_for_mem_ref (struct mem_address *, addr_space_t, bool);
void get_address_description (tree, struct mem_address *);
tree maybe_fold_tmr (tree);
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 6e1ea39aa92..f0ed4ba73a7 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1632,6 +1632,7 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
edge = cgraph_edge (id->src_node, orig_stmt);
if (edge)
edge = cgraph_clone_edge (edge, id->dst_node, stmt,
+ gimple_uid (stmt),
REG_BR_PROB_BASE, 1,
edge->frequency, true);
break;
@@ -3082,6 +3083,7 @@ estimate_operator_cost (enum tree_code code, eni_weights *weights,
case MINUS_EXPR:
case MULT_EXPR:
+ case ADDR_SPACE_CONVERT_EXPR:
case FIXED_CONVERT_EXPR:
case FIX_TRUNC_EXPR:
@@ -3345,7 +3347,7 @@ estimate_num_insns (gimple stmt, eni_weights *weights)
return 0;
case GIMPLE_ASM:
- return 1;
+ return asm_str_count (gimple_asm_string (stmt));
case GIMPLE_RESX:
/* This is either going to be an external function call with one
@@ -5119,13 +5121,16 @@ tree_can_inline_p (struct cgraph_edge *e)
{
e->inline_failed = CIF_TARGET_OPTION_MISMATCH;
gimple_call_set_cannot_inline (e->call_stmt, true);
+ e->call_stmt_cannot_inline_p = true;
return false;
}
- if (!gimple_check_call_args (e->call_stmt))
+ if (e->call_stmt
+ && !gimple_check_call_args (e->call_stmt))
{
e->inline_failed = CIF_MISMATCHED_ARGUMENTS;
gimple_call_set_cannot_inline (e->call_stmt, true);
+ e->call_stmt_cannot_inline_p = true;
return false;
}
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index 031e50e59df..8672a5e6317 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -1121,9 +1121,12 @@ insert_phi_nodes_for (tree var, bitmap phi_insertion_points, bool update_p)
else
{
tree tracked_var;
+
gcc_assert (DECL_P (var));
phi = create_phi_node (var, bb);
- if (!update_p && (tracked_var = target_for_debug_bind (var)))
+
+ tracked_var = target_for_debug_bind (var);
+ if (tracked_var)
{
gimple note = gimple_build_debug_bind (tracked_var,
PHI_RESULT (phi),
@@ -1818,7 +1821,8 @@ maybe_replace_use_in_debug_stmt (use_operand_p use_p)
DEF_P. */
static inline void
-maybe_register_def (def_operand_p def_p, gimple stmt)
+maybe_register_def (def_operand_p def_p, gimple stmt,
+ gimple_stmt_iterator gsi)
{
tree def = DEF_FROM_PTR (def_p);
tree sym = DECL_P (def) ? def : SSA_NAME_VAR (def);
@@ -1829,8 +1833,17 @@ maybe_register_def (def_operand_p def_p, gimple stmt)
{
if (DECL_P (def))
{
+ tree tracked_var;
+
def = make_ssa_name (def, stmt);
SET_DEF (def_p, def);
+
+ tracked_var = target_for_debug_bind (sym);
+ if (tracked_var)
+ {
+ gimple note = gimple_build_debug_bind (tracked_var, def, stmt);
+ gsi_insert_after (&gsi, note, GSI_SAME_STMT);
+ }
}
register_new_update_single (def, sym);
@@ -1858,7 +1871,7 @@ maybe_register_def (def_operand_p def_p, gimple stmt)
in OLD_SSA_NAMES. */
static void
-rewrite_update_stmt (gimple stmt)
+rewrite_update_stmt (gimple stmt, gimple_stmt_iterator gsi)
{
use_operand_p use_p;
def_operand_p def_p;
@@ -1920,7 +1933,7 @@ rewrite_update_stmt (gimple stmt)
marked for renaming. */
if (register_defs_p (stmt))
FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, iter, SSA_OP_ALL_DEFS)
- maybe_register_def (def_p, stmt);
+ maybe_register_def (def_p, stmt, gsi);
}
@@ -2079,11 +2092,11 @@ rewrite_update_enter_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
/* Step 2. Rewrite every variable used in each statement in the block. */
if (TEST_BIT (interesting_blocks, bb->index))
- {
- gcc_assert (bitmap_bit_p (blocks_to_update, bb->index));
+ {
+ gcc_assert (bitmap_bit_p (blocks_to_update, bb->index));
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- rewrite_update_stmt (gsi_stmt (gsi));
- }
+ rewrite_update_stmt (gsi_stmt (gsi), gsi);
+ }
/* Step 3. Update PHI nodes. */
rewrite_update_phi_arguments (bb);
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index 706571c59ec..0b5e7321b16 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -1307,6 +1307,12 @@ convert_nonlocal_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p,
*handled_ops_p = false;
return NULL_TREE;
+ case GIMPLE_COND:
+ wi->val_only = true;
+ wi->is_lhs = false;
+ *handled_ops_p = false;
+ return NULL_TREE;
+
default:
/* For every other statement that we are not interested in
handling here, let the walker traverse the operands. */
@@ -1707,6 +1713,12 @@ convert_local_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p,
info, gimple_omp_body (stmt));
break;
+ case GIMPLE_COND:
+ wi->val_only = true;
+ wi->is_lhs = false;
+ *handled_ops_p = false;
+ return NULL_TREE;
+
default:
/* For every other statement that we are not interested in
handling here, let the walker traverse the operands. */
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c
index 73eacf6c2f2..abd56fcc484 100644
--- a/gcc/tree-optimize.c
+++ b/gcc/tree-optimize.c
@@ -87,7 +87,7 @@ static bool
gate_all_early_local_passes (void)
{
/* Don't bother doing anything if the program has errors. */
- return (!errorcount && !sorrycount);
+ return (!errorcount && !sorrycount && !in_lto_p);
}
struct simple_ipa_opt_pass pass_early_local_passes =
@@ -385,6 +385,9 @@ tree_rest_of_compilation (tree fndecl)
gimple_register_cfg_hooks ();
bitmap_obstack_initialize (&reg_obstack); /* FIXME, only at RTL generation*/
+
+ execute_all_ipa_transforms ();
+
/* Perform all tree transforms and optimizations. */
execute_pass_list (all_passes);
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index 12b4ac0171a..61e372a54c3 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -255,7 +255,13 @@ loop_parallel_p (struct loop *loop)
bool ret = false;
if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "\nConsidering loop %d\n", loop->num);
+ {
+ fprintf (dump_file, "Considering loop %d\n", loop->num);
+ if (!loop->inner)
+ fprintf (dump_file, "loop is innermost\n");
+ else
+ fprintf (dump_file, "loop NOT innermost\n");
+ }
/* Check for problems with dependences. If the loop can be reversed,
the iterations are independent. */
@@ -715,6 +721,8 @@ separate_decls_in_region_debug_bind (gimple stmt,
void **slot, **dslot;
var = gimple_debug_bind_get_var (stmt);
+ if (TREE_CODE (var) == DEBUG_EXPR_DECL)
+ return true;
gcc_assert (DECL_P (var) && SSA_VAR_P (var));
ielt.uid = DECL_UID (var);
dslot = htab_find_slot_with_hash (decl_copies, &ielt, ielt.uid, NO_INSERT);
@@ -1287,8 +1295,9 @@ transform_to_exit_first_loop (struct loop *loop, htab_t reduction_list, tree nit
bool ok;
edge exit = single_dom_exit (loop), hpred;
tree control, control_name, res, t;
- gimple phi, nphi, cond_stmt, stmt;
+ gimple phi, nphi, cond_stmt, stmt, cond_nit;
gimple_stmt_iterator gsi;
+ tree nit_1;
split_block_after_labels (loop->header);
orig_header = single_succ (loop->header);
@@ -1306,7 +1315,6 @@ transform_to_exit_first_loop (struct loop *loop, htab_t reduction_list, tree nit
res = PHI_RESULT (phi);
t = make_ssa_name (SSA_NAME_VAR (res), phi);
SET_PHI_RESULT (phi, t);
-
nphi = create_phi_node (res, orig_header);
SSA_NAME_DEF_STMT (res) = nphi;
add_phi_arg (nphi, t, hpred, UNKNOWN_LOCATION);
@@ -1318,10 +1326,11 @@ transform_to_exit_first_loop (struct loop *loop, htab_t reduction_list, tree nit
control = t;
}
}
-
bbs = get_loop_body_in_dom_order (loop);
- for (n = 0; bbs[n] != exit->src; n++)
+
+ for (n = 0; bbs[n] != loop->latch; n++)
continue;
+ n--;
nbbs = XNEWVEC (basic_block, n);
ok = gimple_duplicate_sese_tail (single_succ_edge (loop->header), exit,
bbs + 1, n, nbbs);
@@ -1356,7 +1365,6 @@ transform_to_exit_first_loop (struct loop *loop, htab_t reduction_list, tree nit
struct reduction_info *red;
tree val = PHI_ARG_DEF_FROM_EDGE (phi, exit);
-
red = reduction_phi (reduction_list, SSA_NAME_DEF_STMT (val));
if (red)
{
@@ -1372,12 +1380,15 @@ transform_to_exit_first_loop (struct loop *loop, htab_t reduction_list, tree nit
}
gcc_assert (control_name != NULL_TREE);
- /* Initialize the control variable to NIT. */
+ /* Initialize the control variable to number of iterations
+ according to the rhs of the exit condition. */
gsi = gsi_after_labels (ex_bb);
- nit = force_gimple_operand_gsi (&gsi,
- fold_convert (TREE_TYPE (control_name), nit),
+ cond_nit = last_stmt (exit->src);
+ nit_1 = gimple_cond_rhs (cond_nit);
+ nit_1 = force_gimple_operand_gsi (&gsi,
+ fold_convert (TREE_TYPE (control_name), nit_1),
false, NULL_TREE, false, GSI_SAME_STMT);
- stmt = gimple_build_assign (control_name, nit);
+ stmt = gimple_build_assign (control_name, nit_1);
gsi_insert_before (&gsi, stmt, GSI_NEW_STMT);
SSA_NAME_DEF_STMT (control_name) = stmt;
}
@@ -1738,7 +1749,7 @@ gather_scalar_reductions (loop_p loop, htab_t reduction_list)
&& simple_loop_info)
{
gimple reduc_stmt = vect_is_simple_reduction (simple_loop_info, phi, true, &double_reduc);
- if (reduc_stmt)
+ if (reduc_stmt && !double_reduc)
build_new_reduction (reduction_list, reduc_stmt, phi);
}
}
@@ -1888,15 +1899,32 @@ parallelize_loops (void)
FOR_EACH_LOOP (li, loop, 0)
{
htab_empty (reduction_list);
-
- /* If we use autopar in graphite pass, we use it's marked dependency
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "Trying loop %d as candidate\n",loop->num);
+ if (loop->inner)
+ fprintf (dump_file, "loop %d is not innermost\n",loop->num);
+ else
+ fprintf (dump_file, "loop %d is innermost\n",loop->num);
+ }
+
+ /* If we use autopar in graphite pass, we use its marked dependency
checking results. */
if (flag_loop_parallelize_all && !loop->can_be_parallel)
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "loop is not parallel according to graphite\n");
continue;
+ }
- /* FIXME: Only consider innermost loops with just one exit. */
- if (loop->inner || !single_dom_exit (loop))
+ if (!single_dom_exit (loop))
+ {
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "loop is !single_dom_exit\n");
+
continue;
+ }
if (/* And of course, the loop must be parallelizable. */
!can_duplicate_loop_p (loop)
@@ -1913,7 +1941,7 @@ parallelize_loops (void)
/* Do not bother with loops in cold areas. */
|| optimize_loop_nest_for_size_p (loop)))
continue;
-
+
if (!try_get_loop_niter (loop, &niter_desc))
continue;
@@ -1924,6 +1952,14 @@ parallelize_loops (void)
continue;
changed = true;
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "parallelizing ");
+ if (loop->inner)
+ fprintf (dump_file, "outer loop\n");
+ else
+ fprintf (dump_file, "inner loop\n");
+ }
gen_parallel_loop (loop, reduction_list,
n_threads, &niter_desc);
verify_flow_info ();
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index 3241ee1482c..e8d6faeb96b 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -333,7 +333,6 @@ extern void tree_lowering_passes (tree decl);
extern struct gimple_opt_pass pass_mudflap_1;
extern struct gimple_opt_pass pass_mudflap_2;
-extern struct gimple_opt_pass pass_remove_useless_stmts;
extern struct gimple_opt_pass pass_lower_cf;
extern struct gimple_opt_pass pass_refactor_eh;
extern struct gimple_opt_pass pass_lower_eh;
@@ -402,7 +401,6 @@ extern struct gimple_opt_pass pass_early_warn_uninitialized;
extern struct gimple_opt_pass pass_late_warn_uninitialized;
extern struct gimple_opt_pass pass_cse_reciprocals;
extern struct gimple_opt_pass pass_cse_sincos;
-extern struct gimple_opt_pass pass_convert_to_rsqrt;
extern struct gimple_opt_pass pass_optimize_bswap;
extern struct gimple_opt_pass pass_warn_function_return;
extern struct gimple_opt_pass pass_warn_function_noreturn;
@@ -432,20 +430,25 @@ extern struct gimple_opt_pass pass_tracer;
extern struct gimple_opt_pass pass_warn_unused_result;
/* IPA Passes */
+extern struct simple_ipa_opt_pass pass_ipa_function_and_variable_visibility;
+extern struct simple_ipa_opt_pass pass_ipa_early_inline;
+
+extern struct simple_ipa_opt_pass pass_early_local_passes;
+
+extern struct ipa_opt_pass_d pass_ipa_whole_program_visibility;
+extern struct ipa_opt_pass_d pass_ipa_lto_gimple_out;
+extern struct simple_ipa_opt_pass pass_ipa_increase_alignment;
+extern struct simple_ipa_opt_pass pass_ipa_matrix_reorg;
extern struct ipa_opt_pass_d pass_ipa_inline;
extern struct simple_ipa_opt_pass pass_ipa_free_lang_data;
extern struct ipa_opt_pass_d pass_ipa_cp;
extern struct ipa_opt_pass_d pass_ipa_reference;
extern struct ipa_opt_pass_d pass_ipa_pure_const;
-
-extern struct simple_ipa_opt_pass pass_ipa_matrix_reorg;
-extern struct simple_ipa_opt_pass pass_ipa_early_inline;
extern struct simple_ipa_opt_pass pass_ipa_type_escape;
extern struct simple_ipa_opt_pass pass_ipa_pta;
extern struct simple_ipa_opt_pass pass_ipa_struct_reorg;
-extern struct simple_ipa_opt_pass pass_early_local_passes;
-extern struct simple_ipa_opt_pass pass_ipa_increase_alignment;
-extern struct simple_ipa_opt_pass pass_ipa_function_and_variable_visibility;
+extern struct ipa_opt_pass_d pass_ipa_lto_wpa_fixup;
+extern struct ipa_opt_pass_d pass_ipa_lto_finish_out;
extern struct gimple_opt_pass pass_all_optimizations;
extern struct gimple_opt_pass pass_cleanup_cfg_post_optimizing;
@@ -493,8 +496,6 @@ extern struct rtl_opt_pass pass_cse2;
extern struct rtl_opt_pass pass_df_initialize_opt;
extern struct rtl_opt_pass pass_df_initialize_no_opt;
extern struct rtl_opt_pass pass_reginfo_init;
-extern struct rtl_opt_pass pass_subregs_of_mode_init;
-extern struct rtl_opt_pass pass_subregs_of_mode_finish;
extern struct rtl_opt_pass pass_inc_dec;
extern struct rtl_opt_pass pass_stack_ptr_mod;
extern struct rtl_opt_pass pass_initialize_regs;
@@ -554,7 +555,8 @@ extern struct gimple_opt_pass pass_update_address_taken;
extern struct gimple_opt_pass pass_convert_switch;
/* The root of the compilation pass tree, once constructed. */
-extern struct opt_pass *all_passes, *all_ipa_passes, *all_lowering_passes;
+extern struct opt_pass *all_passes, *all_small_ipa_passes, *all_lowering_passes,
+ *all_regular_ipa_passes, *all_lto_gen_passes;
/* Current optimization pass. */
extern struct opt_pass *current_pass;
@@ -562,8 +564,15 @@ extern struct opt_pass *current_pass;
extern struct opt_pass * get_pass_for_id (int);
extern void execute_pass_list (struct opt_pass *);
extern void execute_ipa_pass_list (struct opt_pass *);
+extern void execute_ipa_summary_passes (struct ipa_opt_pass_d *);
+extern void execute_all_ipa_transforms (void);
+
extern void print_current_pass (FILE *);
extern void debug_pass (void);
+extern void ipa_write_summaries (void);
+extern void ipa_write_summaries_of_cgraph_node_set (
+ struct cgraph_node_set_def *);
+extern void ipa_read_summaries (void);
extern void register_one_dump_file (struct opt_pass *);
extern bool function_called_by_processed_nodes_p (void);
extern void register_pass (struct register_pass_info *);
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index a325d75d914..7173ad2331b 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -183,6 +183,8 @@ dump_decl_name (pretty_printer *buffer, tree node, int flags)
{
if (TREE_CODE (node) == LABEL_DECL && LABEL_DECL_UID (node) != -1)
pp_printf (buffer, "L.%d", (int) LABEL_DECL_UID (node));
+ else if (TREE_CODE (node) == DEBUG_EXPR_DECL)
+ pp_printf (buffer, "D#%i", DEBUG_TEMP_UID (node));
else
{
char c = TREE_CODE (node) == CONST_DECL ? 'C' : 'D';
@@ -655,6 +657,13 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
else if (quals & TYPE_QUAL_RESTRICT)
pp_string (buffer, "restrict ");
+ if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node)))
+ {
+ pp_string (buffer, "<address-space-");
+ pp_decimal_int (buffer, TYPE_ADDR_SPACE (node));
+ pp_string (buffer, "> ");
+ }
+
tclass = TREE_CODE_CLASS (TREE_CODE (node));
if (tclass == tcc_declaration)
@@ -753,6 +762,13 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
if (quals & TYPE_QUAL_RESTRICT)
pp_string (buffer, " restrict");
+ if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node)))
+ {
+ pp_string (buffer, " <address-space-");
+ pp_decimal_int (buffer, TYPE_ADDR_SPACE (node));
+ pp_string (buffer, ">");
+ }
+
if (TYPE_REF_CAN_ALIAS_ALL (node))
pp_string (buffer, " {ref-all}");
}
@@ -1051,6 +1067,7 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
case VAR_DECL:
case PARM_DECL:
case FIELD_DECL:
+ case DEBUG_EXPR_DECL:
case NAMESPACE_DECL:
dump_decl_name (buffer, node, flags);
break;
@@ -1547,6 +1564,7 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
NIY;
break;
+ case ADDR_SPACE_CONVERT_EXPR:
case FIXED_CONVERT_EXPR:
case FIX_TRUNC_EXPR:
case FLOAT_EXPR:
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c
index 02a4eed646e..70af0fda610 100644
--- a/gcc/tree-scalar-evolution.c
+++ b/gcc/tree-scalar-evolution.c
@@ -1492,18 +1492,29 @@ analyze_evolution_in_loop (gimple loop_phi_node,
bb = gimple_phi_arg_edge (loop_phi_node, i)->src;
if (!flow_bb_inside_loop_p (loop, bb))
continue;
-
+
if (TREE_CODE (arg) == SSA_NAME)
{
+ bool val = false;
+
ssa_chain = SSA_NAME_DEF_STMT (arg);
/* Pass in the initial condition to the follow edge function. */
ev_fn = init_cond;
res = follow_ssa_edge (loop, ssa_chain, loop_phi_node, &ev_fn, 0);
+
+ /* If ev_fn has no evolution in the inner loop, and the
+ init_cond is not equal to ev_fn, then we have an
+ ambiguity between two possible values, as we cannot know
+ the number of iterations at this point. */
+ if (TREE_CODE (ev_fn) != POLYNOMIAL_CHREC
+ && no_evolution_in_loop_p (ev_fn, loop->num, &val) && val
+ && !operand_equal_p (init_cond, ev_fn, 0))
+ ev_fn = chrec_dont_know;
}
else
res = t_false;
-
+
/* When it is impossible to go back on the same
loop_phi_node by following the ssa edges, the
evolution is represented by a peeled chrec, i.e. the
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 3922c22d824..67001a64564 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -144,7 +144,9 @@ struct access
points to the first one. */
struct access *first_child;
- /* Pointer to the next sibling in the access tree as described above. */
+ /* In intraprocedural SRA, pointer to the next sibling in the access tree as
+ described above. In IPA-SRA this is a pointer to the next access
+ belonging to the same group (having the same representative). */
struct access *next_sibling;
/* Pointers to the first and last element in the linked list of assign
@@ -1231,7 +1233,6 @@ build_ref_for_offset_1 (tree *res, tree type, HOST_WIDE_INT offset,
case UNION_TYPE:
case QUAL_UNION_TYPE:
case RECORD_TYPE:
- /* Some ADA records are half-unions, treat all of them the same. */
for (fld = TYPE_FIELDS (type); fld; fld = TREE_CHAIN (fld))
{
HOST_WIDE_INT pos, size;
@@ -1242,7 +1243,10 @@ build_ref_for_offset_1 (tree *res, tree type, HOST_WIDE_INT offset,
pos = int_bit_position (fld);
gcc_assert (TREE_CODE (type) == RECORD_TYPE || pos == 0);
- size = tree_low_cst (DECL_SIZE (fld), 1);
+ tr_size = DECL_SIZE (fld);
+ if (!tr_size || !host_integerp (tr_size, 1))
+ continue;
+ size = tree_low_cst (tr_size, 1);
if (pos > offset || (pos + size) <= offset)
continue;
@@ -1300,7 +1304,8 @@ build_ref_for_offset_1 (tree *res, tree type, HOST_WIDE_INT offset,
/* Construct an expression that would reference a part of aggregate *EXPR of
type TYPE at the given OFFSET of the type EXP_TYPE. If EXPR is NULL, the
function only determines whether it can build such a reference without
- actually doing it.
+ actually doing it, otherwise, the tree it points to is unshared first and
+ then used as a base for furhter sub-references.
FIXME: Eventually this should be replaced with
maybe_fold_offset_to_reference() from tree-ssa-ccp.c but that requires a
@@ -1313,6 +1318,9 @@ build_ref_for_offset (tree *expr, tree type, HOST_WIDE_INT offset,
{
location_t loc = expr ? EXPR_LOCATION (*expr) : UNKNOWN_LOCATION;
+ if (expr)
+ *expr = unshare_expr (*expr);
+
if (allow_ptr && POINTER_TYPE_P (type))
{
type = TREE_TYPE (type);
@@ -1755,7 +1763,7 @@ create_artificial_child_access (struct access *parent, struct access *model,
access but LACC is not, change the type of the latter, if possible. */
static bool
-propagate_subacesses_accross_link (struct access *lacc, struct access *racc)
+propagate_subaccesses_across_link (struct access *lacc, struct access *racc)
{
struct access *rchild;
HOST_WIDE_INT norm_delta = lacc->offset - racc->offset;
@@ -1796,7 +1804,7 @@ propagate_subacesses_accross_link (struct access *lacc, struct access *racc)
rchild->grp_hint = 1;
new_acc->grp_hint |= new_acc->grp_read;
if (rchild->first_child)
- ret |= propagate_subacesses_accross_link (new_acc, rchild);
+ ret |= propagate_subaccesses_across_link (new_acc, rchild);
}
continue;
}
@@ -1814,7 +1822,7 @@ propagate_subacesses_accross_link (struct access *lacc, struct access *racc)
{
ret = true;
if (racc->first_child)
- propagate_subacesses_accross_link (new_acc, rchild);
+ propagate_subaccesses_across_link (new_acc, rchild);
}
}
@@ -1840,7 +1848,7 @@ propagate_all_subaccesses (void)
if (!bitmap_bit_p (candidate_bitmap, DECL_UID (lacc->base)))
continue;
lacc = lacc->group_representative;
- if (propagate_subacesses_accross_link (lacc, racc)
+ if (propagate_subaccesses_across_link (lacc, racc)
&& lacc->first_link)
add_access_to_work_queue (lacc);
}
@@ -1956,7 +1964,7 @@ generate_subtree_copies (struct access *access, tree agg,
{
do
{
- tree expr = unshare_expr (agg);
+ tree expr = agg;
if (chunk_size && access->offset >= start_offset + chunk_size)
return;
@@ -2231,7 +2239,7 @@ load_assign_lhs_subreplacements (struct access *lacc, struct access *top_racc,
rhs = unshare_expr (lacc->expr);
else
{
- rhs = unshare_expr (top_racc->base);
+ rhs = top_racc->base;
repl_found = build_ref_for_offset (&rhs,
TREE_TYPE (top_racc->base),
offset, lacc->type, false);
@@ -2368,7 +2376,7 @@ sra_modify_assign (gimple *stmt, gimple_stmt_iterator *gsi,
if (AGGREGATE_TYPE_P (TREE_TYPE (lhs))
&& !access_has_children_p (lacc))
{
- tree expr = unshare_expr (lhs);
+ tree expr = lhs;
if (build_ref_for_offset (&expr, TREE_TYPE (lhs), 0,
TREE_TYPE (rhs), false))
{
@@ -2379,7 +2387,7 @@ sra_modify_assign (gimple *stmt, gimple_stmt_iterator *gsi,
else if (AGGREGATE_TYPE_P (TREE_TYPE (rhs))
&& !access_has_children_p (racc))
{
- tree expr = unshare_expr (rhs);
+ tree expr = rhs;
if (build_ref_for_offset (&expr, TREE_TYPE (rhs), 0,
TREE_TYPE (lhs), false))
rhs = expr;
@@ -2812,33 +2820,34 @@ analyze_modified_params (VEC (access_p, heap) *representatives)
for (i = 0; i < func_param_count; i++)
{
- struct access *repr = VEC_index (access_p, representatives, i);
- VEC (access_p, heap) *access_vec;
- int j, access_count;
- tree parm;
+ struct access *repr;
- if (!repr || no_accesses_p (repr))
- continue;
- parm = repr->base;
- if (!POINTER_TYPE_P (TREE_TYPE (parm))
- || repr->grp_maybe_modified)
- continue;
-
- access_vec = get_base_access_vector (parm);
- access_count = VEC_length (access_p, access_vec);
- for (j = 0; j < access_count; j++)
+ for (repr = VEC_index (access_p, representatives, i);
+ repr;
+ repr = repr->next_grp)
{
struct access *access;
+ bitmap visited;
ao_ref ar;
- /* All accesses are read ones, otherwise grp_maybe_modified would be
- trivially set. */
- access = VEC_index (access_p, access_vec, j);
- ao_ref_init (&ar, access->expr);
- walk_aliased_vdefs (&ar, gimple_vuse (access->stmt),
- mark_maybe_modified, repr, NULL);
- if (repr->grp_maybe_modified)
- break;
+ if (no_accesses_p (repr))
+ continue;
+ if (!POINTER_TYPE_P (TREE_TYPE (repr->base))
+ || repr->grp_maybe_modified)
+ continue;
+
+ ao_ref_init (&ar, repr->expr);
+ visited = BITMAP_ALLOC (NULL);
+ for (access = repr; access; access = access->next_sibling)
+ {
+ /* All accesses are read ones, otherwise grp_maybe_modified would
+ be trivially set. */
+ walk_aliased_vdefs (&ar, gimple_vuse (access->stmt),
+ mark_maybe_modified, repr, &visited);
+ if (repr->grp_maybe_modified)
+ break;
+ }
+ BITMAP_FREE (visited);
}
}
}
@@ -3007,24 +3016,30 @@ static struct access *
unmodified_by_ref_scalar_representative (tree parm)
{
int i, access_count;
- struct access *access;
+ struct access *repr;
VEC (access_p, heap) *access_vec;
access_vec = get_base_access_vector (parm);
gcc_assert (access_vec);
- access_count = VEC_length (access_p, access_vec);
+ repr = VEC_index (access_p, access_vec, 0);
+ if (repr->write)
+ return NULL;
+ repr->group_representative = repr;
- for (i = 0; i < access_count; i++)
+ access_count = VEC_length (access_p, access_vec);
+ for (i = 1; i < access_count; i++)
{
- access = VEC_index (access_p, access_vec, i);
+ struct access *access = VEC_index (access_p, access_vec, i);
if (access->write)
return NULL;
+ access->group_representative = repr;
+ access->next_sibling = repr->next_sibling;
+ repr->next_sibling = access;
}
- access = VEC_index (access_p, access_vec, 0);
- access->grp_read = 1;
- access->grp_scalar_ptr = 1;
- return access;
+ repr->grp_read = 1;
+ repr->grp_scalar_ptr = 1;
+ return repr;
}
/* Sort collected accesses for parameter PARM, identify representatives for
@@ -3079,6 +3094,9 @@ splice_param_accesses (tree parm, bool *ro_grp)
return NULL;
modification |= ac2->write;
+ ac2->group_representative = access;
+ ac2->next_sibling = access->next_sibling;
+ access->next_sibling = ac2;
j++;
}
diff --git a/gcc/tree-ssa-address.c b/gcc/tree-ssa-address.c
index 7a2ba399172..37bce5e2d2e 100644
--- a/gcc/tree-ssa-address.c
+++ b/gcc/tree-ssa-address.c
@@ -42,6 +42,7 @@ along with GCC; see the file COPYING3. If not see
#include "expr.h"
#include "ggc.h"
#include "tree-affine.h"
+#include "target.h"
/* TODO -- handling of symbols (according to Richard Hendersons
comments, http://gcc.gnu.org/ml/gcc-patches/2005-04/msg00949.html):
@@ -70,32 +71,38 @@ along with GCC; see the file COPYING3. If not see
/* A "template" for memory address, used to determine whether the address is
valid for mode. */
-struct GTY (()) mem_addr_template {
+typedef struct GTY (()) mem_addr_template {
rtx ref; /* The template. */
rtx * GTY ((skip)) step_p; /* The point in template where the step should be
filled in. */
rtx * GTY ((skip)) off_p; /* The point in template where the offset should
be filled in. */
-};
+} mem_addr_template;
-/* The templates. Each of the five bits of the index corresponds to one
- component of TARGET_MEM_REF being present, see TEMPL_IDX. */
+DEF_VEC_O (mem_addr_template);
+DEF_VEC_ALLOC_O (mem_addr_template, gc);
-static GTY (()) struct mem_addr_template templates[32];
+/* The templates. Each of the low five bits of the index corresponds to one
+ component of TARGET_MEM_REF being present, while the high bits identify
+ the address space. See TEMPL_IDX. */
-#define TEMPL_IDX(SYMBOL, BASE, INDEX, STEP, OFFSET) \
- (((SYMBOL != 0) << 4) \
+static GTY(()) VEC (mem_addr_template, gc) *mem_addr_template_list;
+
+#define TEMPL_IDX(AS, SYMBOL, BASE, INDEX, STEP, OFFSET) \
+ (((int) (AS) << 5) \
+ | ((SYMBOL != 0) << 4) \
| ((BASE != 0) << 3) \
| ((INDEX != 0) << 2) \
| ((STEP != 0) << 1) \
| (OFFSET != 0))
/* Stores address for memory reference with parameters SYMBOL, BASE, INDEX,
- STEP and OFFSET to *ADDR. Stores pointers to where step is placed to
- *STEP_P and offset to *OFFSET_P. */
+ STEP and OFFSET to *ADDR using address mode ADDRESS_MODE. Stores pointers
+ to where step is placed to *STEP_P and offset to *OFFSET_P. */
static void
-gen_addr_rtx (rtx symbol, rtx base, rtx index, rtx step, rtx offset,
+gen_addr_rtx (enum machine_mode address_mode,
+ rtx symbol, rtx base, rtx index, rtx step, rtx offset,
rtx *addr, rtx **step_p, rtx **offset_p)
{
rtx act_elem;
@@ -111,7 +118,7 @@ gen_addr_rtx (rtx symbol, rtx base, rtx index, rtx step, rtx offset,
act_elem = index;
if (step)
{
- act_elem = gen_rtx_MULT (Pmode, act_elem, step);
+ act_elem = gen_rtx_MULT (address_mode, act_elem, step);
if (step_p)
*step_p = &XEXP (act_elem, 1);
@@ -123,7 +130,7 @@ gen_addr_rtx (rtx symbol, rtx base, rtx index, rtx step, rtx offset,
if (base)
{
if (*addr)
- *addr = simplify_gen_binary (PLUS, Pmode, base, *addr);
+ *addr = simplify_gen_binary (PLUS, address_mode, base, *addr);
else
*addr = base;
}
@@ -133,7 +140,7 @@ gen_addr_rtx (rtx symbol, rtx base, rtx index, rtx step, rtx offset,
act_elem = symbol;
if (offset)
{
- act_elem = gen_rtx_PLUS (Pmode, act_elem, offset);
+ act_elem = gen_rtx_PLUS (address_mode, act_elem, offset);
if (offset_p)
*offset_p = &XEXP (act_elem, 1);
@@ -141,11 +148,11 @@ gen_addr_rtx (rtx symbol, rtx base, rtx index, rtx step, rtx offset,
if (GET_CODE (symbol) == SYMBOL_REF
|| GET_CODE (symbol) == LABEL_REF
|| GET_CODE (symbol) == CONST)
- act_elem = gen_rtx_CONST (Pmode, act_elem);
+ act_elem = gen_rtx_CONST (address_mode, act_elem);
}
if (*addr)
- *addr = gen_rtx_PLUS (Pmode, *addr, act_elem);
+ *addr = gen_rtx_PLUS (address_mode, *addr, act_elem);
else
*addr = act_elem;
}
@@ -153,7 +160,7 @@ gen_addr_rtx (rtx symbol, rtx base, rtx index, rtx step, rtx offset,
{
if (*addr)
{
- *addr = gen_rtx_PLUS (Pmode, *addr, offset);
+ *addr = gen_rtx_PLUS (address_mode, *addr, offset);
if (offset_p)
*offset_p = &XEXP (*addr, 1);
}
@@ -169,55 +176,64 @@ gen_addr_rtx (rtx symbol, rtx base, rtx index, rtx step, rtx offset,
*addr = const0_rtx;
}
-/* Returns address for TARGET_MEM_REF with parameters given by ADDR.
+/* Returns address for TARGET_MEM_REF with parameters given by ADDR
+ in address space AS.
If REALLY_EXPAND is false, just make fake registers instead
of really expanding the operands, and perform the expansion in-place
by using one of the "templates". */
rtx
-addr_for_mem_ref (struct mem_address *addr, bool really_expand)
+addr_for_mem_ref (struct mem_address *addr, addr_space_t as,
+ bool really_expand)
{
+ enum machine_mode address_mode = targetm.addr_space.address_mode (as);
rtx address, sym, bse, idx, st, off;
- static bool templates_initialized = false;
struct mem_addr_template *templ;
if (addr->step && !integer_onep (addr->step))
st = immed_double_const (TREE_INT_CST_LOW (addr->step),
- TREE_INT_CST_HIGH (addr->step), Pmode);
+ TREE_INT_CST_HIGH (addr->step), address_mode);
else
st = NULL_RTX;
if (addr->offset && !integer_zerop (addr->offset))
off = immed_double_const (TREE_INT_CST_LOW (addr->offset),
- TREE_INT_CST_HIGH (addr->offset), Pmode);
+ TREE_INT_CST_HIGH (addr->offset), address_mode);
else
off = NULL_RTX;
if (!really_expand)
{
+ unsigned int templ_index
+ = TEMPL_IDX (as, addr->symbol, addr->base, addr->index, st, off);
+
+ if (templ_index
+ >= VEC_length (mem_addr_template, mem_addr_template_list))
+ VEC_safe_grow_cleared (mem_addr_template, gc, mem_addr_template_list,
+ templ_index + 1);
+
/* Reuse the templates for addresses, so that we do not waste memory. */
- if (!templates_initialized)
+ templ = VEC_index (mem_addr_template, mem_addr_template_list, templ_index);
+ if (!templ->ref)
{
- unsigned i;
-
- templates_initialized = true;
- sym = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup ("test_symbol"));
- bse = gen_raw_REG (Pmode, LAST_VIRTUAL_REGISTER + 1);
- idx = gen_raw_REG (Pmode, LAST_VIRTUAL_REGISTER + 2);
-
- for (i = 0; i < 32; i++)
- gen_addr_rtx ((i & 16 ? sym : NULL_RTX),
- (i & 8 ? bse : NULL_RTX),
- (i & 4 ? idx : NULL_RTX),
- (i & 2 ? const0_rtx : NULL_RTX),
- (i & 1 ? const0_rtx : NULL_RTX),
- &templates[i].ref,
- &templates[i].step_p,
- &templates[i].off_p);
+ sym = (addr->symbol ?
+ gen_rtx_SYMBOL_REF (address_mode, ggc_strdup ("test_symbol"))
+ : NULL_RTX);
+ bse = (addr->base ?
+ gen_raw_REG (address_mode, LAST_VIRTUAL_REGISTER + 1)
+ : NULL_RTX);
+ idx = (addr->index ?
+ gen_raw_REG (address_mode, LAST_VIRTUAL_REGISTER + 2)
+ : NULL_RTX);
+
+ gen_addr_rtx (address_mode, sym, bse, idx,
+ st? const0_rtx : NULL_RTX,
+ off? const0_rtx : NULL_RTX,
+ &templ->ref,
+ &templ->step_p,
+ &templ->off_p);
}
- templ = templates + TEMPL_IDX (addr->symbol, addr->base, addr->index,
- st, off);
if (st)
*templ->step_p = st;
if (off)
@@ -229,16 +245,16 @@ addr_for_mem_ref (struct mem_address *addr, bool really_expand)
/* Otherwise really expand the expressions. */
sym = (addr->symbol
? expand_expr (build_addr (addr->symbol, current_function_decl),
- NULL_RTX, Pmode, EXPAND_NORMAL)
+ NULL_RTX, address_mode, EXPAND_NORMAL)
: NULL_RTX);
bse = (addr->base
- ? expand_expr (addr->base, NULL_RTX, Pmode, EXPAND_NORMAL)
+ ? expand_expr (addr->base, NULL_RTX, address_mode, EXPAND_NORMAL)
: NULL_RTX);
idx = (addr->index
- ? expand_expr (addr->index, NULL_RTX, Pmode, EXPAND_NORMAL)
+ ? expand_expr (addr->index, NULL_RTX, address_mode, EXPAND_NORMAL)
: NULL_RTX);
- gen_addr_rtx (sym, bse, idx, st, off, &address, NULL, NULL);
+ gen_addr_rtx (address_mode, sym, bse, idx, st, off, &address, NULL, NULL);
return address;
}
@@ -305,15 +321,16 @@ tree_mem_ref_addr (tree type, tree mem_ref)
ADDR is valid on the current target. */
static bool
-valid_mem_ref_p (enum machine_mode mode, struct mem_address *addr)
+valid_mem_ref_p (enum machine_mode mode, addr_space_t as,
+ struct mem_address *addr)
{
rtx address;
- address = addr_for_mem_ref (addr, false);
+ address = addr_for_mem_ref (addr, as, false);
if (!address)
return false;
- return memory_address_p (mode, address);
+ return memory_address_addr_space_p (mode, address, as);
}
/* Checks whether a TARGET_MEM_REF with type TYPE and parameters given by ADDR
@@ -323,7 +340,7 @@ valid_mem_ref_p (enum machine_mode mode, struct mem_address *addr)
static tree
create_mem_ref_raw (tree type, struct mem_address *addr)
{
- if (!valid_mem_ref_p (TYPE_MODE (type), addr))
+ if (!valid_mem_ref_p (TYPE_MODE (type), TYPE_ADDR_SPACE (type), addr))
return NULL_TREE;
if (addr->step && integer_onep (addr->step))
@@ -375,6 +392,33 @@ move_fixed_address_to_symbol (struct mem_address *parts, aff_tree *addr)
aff_combination_remove_elt (addr, i);
}
+/* If ADDR contains an instance of BASE_HINT, move it to PARTS->base. */
+
+static void
+move_hint_to_base (tree type, struct mem_address *parts, tree base_hint,
+ aff_tree *addr)
+{
+ unsigned i;
+ tree val = NULL_TREE;
+
+ for (i = 0; i < addr->n; i++)
+ {
+ if (!double_int_one_p (addr->elts[i].coef))
+ continue;
+
+ val = addr->elts[i].val;
+ if (operand_equal_p (val, base_hint, 0))
+ break;
+ }
+
+ if (i == addr->n)
+ return;
+
+ /* Cast value to appropriate pointer type. */
+ parts->base = fold_convert (build_pointer_type (type), val);
+ aff_combination_remove_elt (addr, i);
+}
+
/* If ADDR contains an address of a dereferenced pointer, move it to
PARTS->base. */
@@ -436,9 +480,11 @@ add_to_parts (struct mem_address *parts, tree elt)
element(s) to PARTS. */
static void
-most_expensive_mult_to_index (struct mem_address *parts, aff_tree *addr,
- bool speed)
+most_expensive_mult_to_index (tree type, struct mem_address *parts,
+ aff_tree *addr, bool speed)
{
+ addr_space_t as = TYPE_ADDR_SPACE (type);
+ enum machine_mode address_mode = targetm.addr_space.address_mode (as);
HOST_WIDE_INT coef;
double_int best_mult, amult, amult_neg;
unsigned best_mult_cost = 0, acost;
@@ -452,14 +498,12 @@ most_expensive_mult_to_index (struct mem_address *parts, aff_tree *addr,
if (!double_int_fits_in_shwi_p (addr->elts[i].coef))
continue;
- /* FIXME: Should use the correct memory mode rather than Pmode. */
-
coef = double_int_to_shwi (addr->elts[i].coef);
if (coef == 1
- || !multiplier_allowed_in_address_p (coef, Pmode))
+ || !multiplier_allowed_in_address_p (coef, TYPE_MODE (type), as))
continue;
- acost = multiply_by_cost (coef, Pmode, speed);
+ acost = multiply_by_cost (coef, address_mode, speed);
if (acost > best_mult_cost)
{
@@ -502,8 +546,10 @@ most_expensive_mult_to_index (struct mem_address *parts, aff_tree *addr,
parts->step = double_int_to_tree (sizetype, best_mult);
}
-/* Splits address ADDR into PARTS.
-
+/* Splits address ADDR for a memory access of type TYPE into PARTS.
+ If BASE_HINT is non-NULL, it specifies an SSA name to be used
+ preferentially as base of the reference.
+
TODO -- be more clever about the distribution of the elements of ADDR
to PARTS. Some architectures do not support anything but single
register in address, possibly with a small integer offset; while
@@ -512,7 +558,8 @@ most_expensive_mult_to_index (struct mem_address *parts, aff_tree *addr,
addressing modes is useless. */
static void
-addr_to_parts (aff_tree *addr, struct mem_address *parts, bool speed)
+addr_to_parts (tree type, aff_tree *addr, tree base_hint,
+ struct mem_address *parts, bool speed)
{
tree part;
unsigned i;
@@ -532,12 +579,14 @@ addr_to_parts (aff_tree *addr, struct mem_address *parts, bool speed)
/* First move the most expensive feasible multiplication
to index. */
- most_expensive_mult_to_index (parts, addr, speed);
+ most_expensive_mult_to_index (type, parts, addr, speed);
/* Try to find a base of the reference. Since at the moment
there is no reliable way how to distinguish between pointer and its
offset, this is just a guess. */
- if (!parts->symbol)
+ if (!parts->symbol && base_hint)
+ move_hint_to_base (type, parts, base_hint, addr);
+ if (!parts->symbol && !parts->base)
move_pointer_to_base (parts, addr);
/* Then try to process the remaining elements. */
@@ -574,13 +623,13 @@ gimplify_mem_ref_parts (gimple_stmt_iterator *gsi, struct mem_address *parts)
tree
create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
- bool speed)
+ tree base_hint, bool speed)
{
tree mem_ref, tmp;
tree atype;
struct mem_address parts;
- addr_to_parts (addr, &parts, speed);
+ addr_to_parts (type, addr, base_hint, &parts, speed);
gimplify_mem_ref_parts (gsi, &parts);
mem_ref = create_mem_ref_raw (type, &parts);
if (mem_ref)
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index e619190386c..4c052be418f 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -553,10 +553,10 @@ same_type_for_tbaa (tree type1, tree type2)
on an indirect reference may alias. */
static bool
-nonaliasing_component_refs_p (tree ref1, tree type1,
- HOST_WIDE_INT offset1, HOST_WIDE_INT max_size1,
- tree ref2, tree type2,
- HOST_WIDE_INT offset2, HOST_WIDE_INT max_size2)
+aliasing_component_refs_p (tree ref1, tree type1,
+ HOST_WIDE_INT offset1, HOST_WIDE_INT max_size1,
+ tree ref2, tree type2,
+ HOST_WIDE_INT offset2, HOST_WIDE_INT max_size2)
{
/* If one reference is a component references through pointers try to find a
common base and apply offset based disambiguation. This handles
@@ -600,9 +600,19 @@ nonaliasing_component_refs_p (tree ref1, tree type1,
offset1 -= offadj;
return ranges_overlap_p (offset1, max_size1, offset2, max_size2);
}
- /* If we have two type access paths B1.path1 and B2.path2 they may
- only alias if either B1 is in B2.path2 or B2 is in B1.path1. */
- return false;
+
+ /* We haven't found any common base to apply offset-based disambiguation.
+ There are two cases:
+ 1. The base access types have the same alias set. This can happen
+ in Ada when a function with an unconstrained parameter passed by
+ reference is called on a constrained object and inlined: the types
+ have the same alias set but aren't equivalent. The references may
+ alias in this case.
+ 2. The base access types don't have the same alias set, i.e. one set
+ is a subset of the other. We have proved that B1 is not in the
+ access path B2.path and that B2 is not in the access path B1.path
+ so the references may not alias. */
+ return get_alias_set (type1) == get_alias_set (type2);
}
/* Return true if two memory references based on the variables BASE1
@@ -681,10 +691,10 @@ indirect_ref_may_alias_decl_p (tree ref1, tree ptr1,
if (ref1 && ref2
&& handled_component_p (ref1)
&& handled_component_p (ref2))
- return nonaliasing_component_refs_p (ref1, TREE_TYPE (TREE_TYPE (ptr1)),
- offset1, max_size1,
- ref2, TREE_TYPE (base2),
- offset2, max_size2);
+ return aliasing_component_refs_p (ref1, TREE_TYPE (TREE_TYPE (ptr1)),
+ offset1, max_size1,
+ ref2, TREE_TYPE (base2),
+ offset2, max_size2);
return true;
}
@@ -742,10 +752,10 @@ indirect_refs_may_alias_p (tree ref1, tree ptr1,
if (ref1 && ref2
&& handled_component_p (ref1)
&& handled_component_p (ref2))
- return nonaliasing_component_refs_p (ref1, TREE_TYPE (TREE_TYPE (ptr1)),
- offset1, max_size1,
- ref2, TREE_TYPE (TREE_TYPE (ptr2)),
- offset2, max_size2);
+ return aliasing_component_refs_p (ref1, TREE_TYPE (TREE_TYPE (ptr1)),
+ offset1, max_size1,
+ ref2, TREE_TYPE (TREE_TYPE (ptr2)),
+ offset2, max_size2);
return true;
}
@@ -766,12 +776,14 @@ refs_may_alias_p_1 (ao_ref *ref1, ao_ref *ref2, bool tbaa_p)
|| SSA_VAR_P (ref1->ref)
|| handled_component_p (ref1->ref)
|| INDIRECT_REF_P (ref1->ref)
- || TREE_CODE (ref1->ref) == TARGET_MEM_REF)
+ || TREE_CODE (ref1->ref) == TARGET_MEM_REF
+ || TREE_CODE (ref1->ref) == CONST_DECL)
&& (!ref2->ref
|| SSA_VAR_P (ref2->ref)
|| handled_component_p (ref2->ref)
|| INDIRECT_REF_P (ref2->ref)
- || TREE_CODE (ref2->ref) == TARGET_MEM_REF));
+ || TREE_CODE (ref2->ref) == TARGET_MEM_REF
+ || TREE_CODE (ref2->ref) == CONST_DECL));
/* Decompose the references into their base objects and the access. */
base1 = ao_ref_base (ref1);
@@ -788,6 +800,8 @@ refs_may_alias_p_1 (ao_ref *ref1, ao_ref *ref2, bool tbaa_p)
which is seen as a struct copy. */
if (TREE_CODE (base1) == SSA_NAME
|| TREE_CODE (base2) == SSA_NAME
+ || TREE_CODE (base1) == CONST_DECL
+ || TREE_CODE (base2) == CONST_DECL
|| is_gimple_min_invariant (base1)
|| is_gimple_min_invariant (base2))
return false;
@@ -924,7 +938,6 @@ ref_maybe_used_by_call_p_1 (gimple call, ao_ref *ref)
their first argument. */
case BUILT_IN_STRCPY:
case BUILT_IN_STRNCPY:
- case BUILT_IN_BCOPY:
case BUILT_IN_MEMCPY:
case BUILT_IN_MEMMOVE:
case BUILT_IN_MEMPCPY:
@@ -942,6 +955,15 @@ ref_maybe_used_by_call_p_1 (gimple call, ao_ref *ref)
size);
return refs_may_alias_p_1 (&dref, ref, false);
}
+ case BUILT_IN_BCOPY:
+ {
+ ao_ref dref;
+ tree size = gimple_call_arg (call, 2);
+ ao_ref_init_from_ptr_and_size (&dref,
+ gimple_call_arg (call, 0),
+ size);
+ return refs_may_alias_p_1 (&dref, ref, false);
+ }
/* The following builtins do not read from memory. */
case BUILT_IN_FREE:
case BUILT_IN_MEMSET:
@@ -1141,7 +1163,6 @@ call_may_clobber_ref_p_1 (gimple call, ao_ref *ref)
their first argument. */
case BUILT_IN_STRCPY:
case BUILT_IN_STRNCPY:
- case BUILT_IN_BCOPY:
case BUILT_IN_MEMCPY:
case BUILT_IN_MEMMOVE:
case BUILT_IN_MEMPCPY:
@@ -1160,6 +1181,15 @@ call_may_clobber_ref_p_1 (gimple call, ao_ref *ref)
size);
return refs_may_alias_p_1 (&dref, ref, false);
}
+ case BUILT_IN_BCOPY:
+ {
+ ao_ref dref;
+ tree size = gimple_call_arg (call, 2);
+ ao_ref_init_from_ptr_and_size (&dref,
+ gimple_call_arg (call, 1),
+ size);
+ return refs_may_alias_p_1 (&dref, ref, false);
+ }
/* Freeing memory kills the pointed-to memory. More importantly
the call has to serve as a barrier for moving loads and stores
across it. */
@@ -1303,8 +1333,6 @@ stmt_may_clobber_ref_p (gimple stmt, tree ref)
}
-static tree get_continuation_for_phi (gimple, ao_ref *, bitmap *);
-
/* Walk the virtual use-def chain of VUSE until hitting the virtual operand
TARGET or a statement clobbering the memory reference REF in which
case false is returned. The walk starts with VUSE, one argument of PHI. */
@@ -1348,7 +1376,7 @@ maybe_skip_until (gimple phi, tree target, ao_ref *ref,
clobber REF. Returns NULL_TREE if no suitable virtual operand can
be found. */
-static tree
+tree
get_continuation_for_phi (gimple phi, ao_ref *ref, bitmap *visited)
{
unsigned nargs = gimple_phi_num_args (phi);
@@ -1365,6 +1393,7 @@ get_continuation_for_phi (gimple phi, ao_ref *ref, bitmap *visited)
tree arg1 = PHI_ARG_DEF (phi, 1);
gimple def0 = SSA_NAME_DEF_STMT (arg0);
gimple def1 = SSA_NAME_DEF_STMT (arg1);
+ tree common_vuse;
if (arg0 == arg1)
return arg0;
@@ -1383,6 +1412,26 @@ get_continuation_for_phi (gimple phi, ao_ref *ref, bitmap *visited)
if (maybe_skip_until (phi, arg1, ref, arg0, visited))
return arg1;
}
+ /* Special case of a diamond:
+ MEM_1 = ...
+ goto (cond) ? L1 : L2
+ L1: store1 = ... #MEM_2 = vuse(MEM_1)
+ goto L3
+ L2: store2 = ... #MEM_3 = vuse(MEM_1)
+ L3: MEM_4 = PHI<MEM_2, MEM_3>
+ We were called with the PHI at L3, MEM_2 and MEM_3 don't
+ dominate each other, but still we can easily skip this PHI node
+ if we recognize that the vuse MEM operand is the same for both,
+ and that we can skip both statements (they don't clobber us).
+ This is still linear. Don't use maybe_skip_until, that might
+ potentially be slow. */
+ else if ((common_vuse = gimple_vuse (def0))
+ && common_vuse == gimple_vuse (def1))
+ {
+ if (!stmt_may_clobber_ref_p_1 (def0, ref)
+ && !stmt_may_clobber_ref_p_1 (def1, ref))
+ return common_vuse;
+ }
}
return NULL_TREE;
diff --git a/gcc/tree-ssa-alias.h b/gcc/tree-ssa-alias.h
index 49706925836..289fb86d04c 100644
--- a/gcc/tree-ssa-alias.h
+++ b/gcc/tree-ssa-alias.h
@@ -99,6 +99,7 @@ extern bool refs_output_dependent_p (tree, tree);
extern bool ref_maybe_used_by_stmt_p (gimple, tree);
extern bool stmt_may_clobber_ref_p (gimple, tree);
extern bool stmt_may_clobber_ref_p_1 (gimple, ao_ref *);
+extern tree get_continuation_for_phi (gimple, ao_ref *, bitmap *);
extern void *walk_non_aliased_vuses (ao_ref *, tree,
void *(*)(ao_ref *, tree, void *),
void *(*)(ao_ref *, tree, void *), void *);
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index 67d0472cc59..f0135a9c42d 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -325,7 +325,13 @@ mark_stmt_if_obviously_necessary (gimple stmt, bool aggressive)
break;
case GIMPLE_DEBUG:
- mark_stmt_necessary (stmt, false);
+ /* Debug temps without a value are not useful. ??? If we could
+ easily locate the debug temp bind stmt for a use thereof,
+ would could refrain from marking all debug temps here, and
+ mark them only if they're used. */
+ if (gimple_debug_bind_has_value_p (stmt)
+ || TREE_CODE (gimple_debug_bind_get_var (stmt)) != DEBUG_EXPR_DECL)
+ mark_stmt_necessary (stmt, false);
return;
case GIMPLE_GOTO:
@@ -1071,7 +1077,7 @@ eliminate_unnecessary_stmts (void)
{
bool something_changed = false;
basic_block bb;
- gimple_stmt_iterator gsi;
+ gimple_stmt_iterator gsi, psi;
gimple stmt;
tree call;
VEC (basic_block, heap) *h;
@@ -1111,25 +1117,21 @@ eliminate_unnecessary_stmts (void)
bb = VEC_pop (basic_block, h);
/* Remove dead statements. */
- for (gsi = gsi_last_bb (bb); !gsi_end_p (gsi);)
+ for (gsi = gsi_last_bb (bb); !gsi_end_p (gsi); gsi = psi)
{
stmt = gsi_stmt (gsi);
+ psi = gsi;
+ gsi_prev (&psi);
+
stats.total++;
/* If GSI is not necessary then remove it. */
if (!gimple_plf (stmt, STMT_NECESSARY))
{
+ if (!is_gimple_debug (stmt))
+ something_changed = true;
remove_dead_stmt (&gsi, bb);
- something_changed = true;
-
- /* If stmt was the last stmt in the block, we want to
- move gsi to the stmt that became the last stmt, but
- gsi_prev would crash. */
- if (gsi_end_p (gsi))
- gsi = gsi_last_bb (bb);
- else
- gsi_prev (&gsi);
}
else if (is_gimple_call (stmt))
{
@@ -1159,10 +1161,7 @@ eliminate_unnecessary_stmts (void)
}
notice_special_calls (stmt);
}
- gsi_prev (&gsi);
}
- else
- gsi_prev (&gsi);
}
}
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 05a8d92a86f..6e861b15e4c 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -816,24 +816,25 @@ remove_local_expressions_from_table (void)
/* Remove all the expressions made available in this block. */
while (VEC_length (expr_hash_elt_t, avail_exprs_stack) > 0)
{
- struct expr_hash_elt element;
expr_hash_elt_t victim = VEC_pop (expr_hash_elt_t, avail_exprs_stack);
+ void **slot;
if (victim == NULL)
break;
- element = *victim;
-
/* This must precede the actual removal from the hash table,
as ELEMENT and the table entry may share a call argument
vector which will be freed during removal. */
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "<<<< ");
- print_expr_hash_elt (dump_file, &element);
+ print_expr_hash_elt (dump_file, victim);
}
- htab_remove_elt_with_hash (avail_exprs, &element, element.hash);
+ slot = htab_find_slot_with_hash (avail_exprs,
+ victim, victim->hash, NO_INSERT);
+ gcc_assert (slot && *slot == (void *) victim);
+ htab_clear_slot (avail_exprs, slot);
}
}
@@ -1998,6 +1999,12 @@ cprop_operand (gimple stmt, use_operand_p op_p)
if (loop_depth_of_name (val) > loop_depth_of_name (op))
return;
+ /* Do not propagate copies into simple IV increment statements.
+ See PR23821 for how this can disturb IV analysis. */
+ if (TREE_CODE (val) != INTEGER_CST
+ && simple_iv_increment_p (stmt))
+ return;
+
/* Dump details. */
if (dump_file && (dump_flags & TDF_DETAILS))
{
@@ -2092,6 +2099,7 @@ optimize_stmt (basic_block bb, gimple_stmt_iterator si)
if (fold_stmt (&si))
{
stmt = gsi_stmt (si);
+ gimple_set_modified (stmt, true);
if (dump_file && (dump_flags & TDF_DETAILS))
{
@@ -2131,8 +2139,6 @@ optimize_stmt (basic_block bb, gimple_stmt_iterator si)
if (may_optimize_p)
{
- eliminate_redundant_computations (&si);
- stmt = gsi_stmt (si);
if (gimple_code (stmt) == GIMPLE_CALL)
{
/* Resolve __builtin_constant_p. If it hasn't been
@@ -2147,6 +2153,10 @@ optimize_stmt (basic_block bb, gimple_stmt_iterator si)
stmt = gsi_stmt (si);
}
}
+
+ update_stmt_if_modified (stmt);
+ eliminate_redundant_computations (&si);
+ stmt = gsi_stmt (si);
}
/* Record any additional equivalences created by this statement. */
@@ -2182,7 +2192,7 @@ optimize_stmt (basic_block bb, gimple_stmt_iterator si)
{
tree val = NULL;
- update_stmt (stmt);
+ update_stmt_if_modified (stmt);
if (gimple_code (stmt) == GIMPLE_COND)
val = fold_binary_loc (gimple_location (stmt),
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index 87795a28223..6ba800d8288 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -939,7 +939,6 @@ forward_propagate_addr_expr (tree name, tree rhs)
gimple use_stmt;
bool all = true;
bool single_use_p = has_single_use (name);
- bool debug = false;
FOR_EACH_IMM_USE_STMT (use_stmt, iter, name)
{
@@ -950,9 +949,7 @@ forward_propagate_addr_expr (tree name, tree rhs)
there is nothing we can do. */
if (gimple_code (use_stmt) != GIMPLE_ASSIGN)
{
- if (is_gimple_debug (use_stmt))
- debug = true;
- else
+ if (!is_gimple_debug (use_stmt))
all = false;
continue;
}
@@ -995,9 +992,6 @@ forward_propagate_addr_expr (tree name, tree rhs)
}
}
- if (all && debug)
- propagate_var_def_into_debug_stmts (name, NULL, NULL);
-
return all;
}
diff --git a/gcc/tree-ssa-ifcombine.c b/gcc/tree-ssa-ifcombine.c
index 1d2d85b7a8f..335b4fd95fc 100644
--- a/gcc/tree-ssa-ifcombine.c
+++ b/gcc/tree-ssa-ifcombine.c
@@ -340,6 +340,9 @@ ifcombine_ifandif (basic_block inner_cond_bb, basic_block outer_cond_bb)
t2 = force_gimple_operand_gsi (&gsi, t2, true, NULL_TREE,
true, GSI_SAME_STMT);
t = fold_build2 (EQ_EXPR, boolean_type_node, t2, t);
+ t = canonicalize_cond_expr_cond (t);
+ if (!t)
+ return false;
gimple_cond_set_condition_from_tree (inner_cond, t);
update_stmt (inner_cond);
@@ -488,6 +491,9 @@ ifcombine_iforif (basic_block inner_cond_bb, basic_block outer_cond_bb)
true, GSI_SAME_STMT);
t = fold_build2 (NE_EXPR, boolean_type_node, t,
build_int_cst (TREE_TYPE (t), 0));
+ t = canonicalize_cond_expr_cond (t);
+ if (!t)
+ return false;
gimple_cond_set_condition_from_tree (inner_cond, t);
update_stmt (inner_cond);
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index 738249445b0..6c6a9f17a1d 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -764,6 +764,7 @@ rewrite_reciprocal (gimple_stmt_iterator *bsi)
gimple stmt, stmt1, stmt2;
tree var, name, lhs, type;
tree real_one;
+ gimple_stmt_iterator gsi;
stmt = gsi_stmt (*bsi);
lhs = gimple_assign_lhs (stmt);
@@ -798,8 +799,9 @@ rewrite_reciprocal (gimple_stmt_iterator *bsi)
/* Replace division stmt with reciprocal and multiply stmts.
The multiply stmt is not invariant, so update iterator
and avoid rescanning. */
- gsi_replace (bsi, stmt1, true);
- gsi_insert_after (bsi, stmt2, GSI_NEW_STMT);
+ gsi = *bsi;
+ gsi_insert_before (bsi, stmt1, GSI_NEW_STMT);
+ gsi_replace (&gsi, stmt2, true);
/* Continue processing with invariant reciprocal statement. */
return stmt1;
@@ -858,6 +860,8 @@ rewrite_bittest (gimple_stmt_iterator *bsi)
if (outermost_invariant_loop (b, loop_containing_stmt (stmt1)) != NULL
&& outermost_invariant_loop (a, loop_containing_stmt (stmt1)) == NULL)
{
+ gimple_stmt_iterator rsi;
+
/* 1 << B */
var = create_tmp_var (TREE_TYPE (a), "shifttmp");
add_referenced_var (var);
@@ -878,9 +882,14 @@ rewrite_bittest (gimple_stmt_iterator *bsi)
SET_USE (use, name);
gimple_cond_set_rhs (use_stmt, build_int_cst_type (TREE_TYPE (name), 0));
- gsi_insert_before (bsi, stmt1, GSI_SAME_STMT);
- propagate_defs_into_debug_stmts (gsi_stmt (*bsi), NULL, NULL);
- gsi_replace (bsi, stmt2, true);
+ /* Don't use gsi_replace here, none of the new assignments sets
+ the variable originally set in stmt. Move bsi to stmt1, and
+ then remove the original stmt, so that we get a chance to
+ retain debug info for it. */
+ rsi = *bsi;
+ gsi_insert_before (bsi, stmt1, GSI_NEW_STMT);
+ gsi_insert_before (&rsi, stmt2, GSI_SAME_STMT);
+ gsi_remove (&rsi, true);
return stmt1;
}
@@ -1060,7 +1069,6 @@ move_computations_stmt (struct dom_walk_data *dw_data ATTRIBUTE_UNUSED,
mark_virtual_ops_for_renaming (stmt);
gsi_insert_on_edge (loop_preheader_edge (level), stmt);
- propagate_defs_into_debug_stmts (gsi_stmt (bsi), NULL, NULL);
gsi_remove (&bsi, false);
}
}
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 42b2ef36252..e89ee0e4ce8 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -2642,21 +2642,25 @@ seq_cost (rtx seq, bool speed)
static rtx
produce_memory_decl_rtl (tree obj, int *regno)
{
+ addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (obj));
+ enum machine_mode address_mode = targetm.addr_space.address_mode (as);
rtx x;
gcc_assert (obj);
if (TREE_STATIC (obj) || DECL_EXTERNAL (obj))
{
const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (obj));
- x = gen_rtx_SYMBOL_REF (Pmode, name);
+ x = gen_rtx_SYMBOL_REF (address_mode, name);
SET_SYMBOL_REF_DECL (x, obj);
x = gen_rtx_MEM (DECL_MODE (obj), x);
+ set_mem_addr_space (x, as);
targetm.encode_section_info (obj, x, true);
}
else
{
- x = gen_raw_REG (Pmode, (*regno)++);
+ x = gen_raw_REG (address_mode, (*regno)++);
x = gen_rtx_MEM (DECL_MODE (obj), x);
+ set_mem_addr_space (x, as);
}
return x;
@@ -2744,7 +2748,8 @@ computation_cost (tree expr, bool speed)
cost = seq_cost (seq, speed);
if (MEM_P (rslt))
- cost += address_cost (XEXP (rslt, 0), TYPE_MODE (type), speed);
+ cost += address_cost (XEXP (rslt, 0), TYPE_MODE (type),
+ TYPE_ADDR_SPACE (type), speed);
return cost;
}
@@ -3020,51 +3025,65 @@ multiply_by_cost (HOST_WIDE_INT cst, enum machine_mode mode, bool speed)
}
/* Returns true if multiplying by RATIO is allowed in an address. Test the
- validity for a memory reference accessing memory of mode MODE. */
+ validity for a memory reference accessing memory of mode MODE in
+ address space AS. */
+
+DEF_VEC_P (sbitmap);
+DEF_VEC_ALLOC_P (sbitmap, heap);
bool
-multiplier_allowed_in_address_p (HOST_WIDE_INT ratio, enum machine_mode mode)
+multiplier_allowed_in_address_p (HOST_WIDE_INT ratio, enum machine_mode mode,
+ addr_space_t as)
{
#define MAX_RATIO 128
- static sbitmap valid_mult[MAX_MACHINE_MODE];
-
- if (!valid_mult[mode])
+ unsigned int data_index = (int) as * MAX_MACHINE_MODE + (int) mode;
+ static VEC (sbitmap, heap) *valid_mult_list;
+ sbitmap valid_mult;
+
+ if (data_index >= VEC_length (sbitmap, valid_mult_list))
+ VEC_safe_grow_cleared (sbitmap, heap, valid_mult_list, data_index + 1);
+
+ valid_mult = VEC_index (sbitmap, valid_mult_list, data_index);
+ if (!valid_mult)
{
- rtx reg1 = gen_raw_REG (Pmode, LAST_VIRTUAL_REGISTER + 1);
+ enum machine_mode address_mode = targetm.addr_space.address_mode (as);
+ rtx reg1 = gen_raw_REG (address_mode, LAST_VIRTUAL_REGISTER + 1);
rtx addr;
HOST_WIDE_INT i;
- valid_mult[mode] = sbitmap_alloc (2 * MAX_RATIO + 1);
- sbitmap_zero (valid_mult[mode]);
- addr = gen_rtx_fmt_ee (MULT, Pmode, reg1, NULL_RTX);
+ valid_mult = sbitmap_alloc (2 * MAX_RATIO + 1);
+ sbitmap_zero (valid_mult);
+ addr = gen_rtx_fmt_ee (MULT, address_mode, reg1, NULL_RTX);
for (i = -MAX_RATIO; i <= MAX_RATIO; i++)
{
- XEXP (addr, 1) = gen_int_mode (i, Pmode);
- if (memory_address_p (mode, addr))
- SET_BIT (valid_mult[mode], i + MAX_RATIO);
+ XEXP (addr, 1) = gen_int_mode (i, address_mode);
+ if (memory_address_addr_space_p (mode, addr, as))
+ SET_BIT (valid_mult, i + MAX_RATIO);
}
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, " allowed multipliers:");
for (i = -MAX_RATIO; i <= MAX_RATIO; i++)
- if (TEST_BIT (valid_mult[mode], i + MAX_RATIO))
+ if (TEST_BIT (valid_mult, i + MAX_RATIO))
fprintf (dump_file, " %d", (int) i);
fprintf (dump_file, "\n");
fprintf (dump_file, "\n");
}
+
+ VEC_replace (sbitmap, valid_mult_list, data_index, valid_mult);
}
if (ratio > MAX_RATIO || ratio < -MAX_RATIO)
return false;
- return TEST_BIT (valid_mult[mode], ratio + MAX_RATIO);
+ return TEST_BIT (valid_mult, ratio + MAX_RATIO);
}
/* Returns cost of address in shape symbol + var + OFFSET + RATIO * index.
If SYMBOL_PRESENT is false, symbol is omitted. If VAR_PRESENT is false,
variable is omitted. Compute the cost for a memory reference that accesses
- a memory location of mode MEM_MODE.
+ a memory location of mode MEM_MODE in address space AS.
MAY_AUTOINC is set to true if the autoincrement (increasing index by
size of MEM_MODE / RATIO) is available. To make this determination, we
@@ -3075,16 +3094,26 @@ multiplier_allowed_in_address_p (HOST_WIDE_INT ratio, enum machine_mode mode)
TODO -- there must be some better way. This all is quite crude. */
+typedef struct
+{
+ HOST_WIDE_INT min_offset, max_offset;
+ unsigned costs[2][2][2][2];
+} *address_cost_data;
+
+DEF_VEC_P (address_cost_data);
+DEF_VEC_ALLOC_P (address_cost_data, heap);
+
static comp_cost
get_address_cost (bool symbol_present, bool var_present,
unsigned HOST_WIDE_INT offset, HOST_WIDE_INT ratio,
- HOST_WIDE_INT cstep, enum machine_mode mem_mode, bool speed,
+ HOST_WIDE_INT cstep, enum machine_mode mem_mode,
+ addr_space_t as, bool speed,
bool stmt_after_inc, bool *may_autoinc)
{
- static bool initialized[MAX_MACHINE_MODE];
- static HOST_WIDE_INT rat[MAX_MACHINE_MODE], off[MAX_MACHINE_MODE];
- static HOST_WIDE_INT min_offset[MAX_MACHINE_MODE], max_offset[MAX_MACHINE_MODE];
- static unsigned costs[MAX_MACHINE_MODE][2][2][2][2];
+ enum machine_mode address_mode = targetm.addr_space.address_mode (as);
+ static VEC(address_cost_data, heap) *address_cost_data_list;
+ unsigned int data_index = (int) as * MAX_MACHINE_MODE + (int) mem_mode;
+ address_cost_data data;
static bool has_preinc[MAX_MACHINE_MODE], has_postinc[MAX_MACHINE_MODE];
static bool has_predec[MAX_MACHINE_MODE], has_postdec[MAX_MACHINE_MODE];
unsigned cost, acost, complexity;
@@ -3093,80 +3122,90 @@ get_address_cost (bool symbol_present, bool var_present,
unsigned HOST_WIDE_INT mask;
unsigned bits;
- if (!initialized[mem_mode])
+ if (data_index >= VEC_length (address_cost_data, address_cost_data_list))
+ VEC_safe_grow_cleared (address_cost_data, heap, address_cost_data_list,
+ data_index + 1);
+
+ data = VEC_index (address_cost_data, address_cost_data_list, data_index);
+ if (!data)
{
HOST_WIDE_INT i;
HOST_WIDE_INT start = BIGGEST_ALIGNMENT / BITS_PER_UNIT;
+ HOST_WIDE_INT rat, off;
int old_cse_not_expected;
unsigned sym_p, var_p, off_p, rat_p, add_c;
rtx seq, addr, base;
rtx reg0, reg1;
- initialized[mem_mode] = true;
+ data = (address_cost_data) xcalloc (1, sizeof (*data));
- reg1 = gen_raw_REG (Pmode, LAST_VIRTUAL_REGISTER + 1);
+ reg1 = gen_raw_REG (address_mode, LAST_VIRTUAL_REGISTER + 1);
- addr = gen_rtx_fmt_ee (PLUS, Pmode, reg1, NULL_RTX);
+ addr = gen_rtx_fmt_ee (PLUS, address_mode, reg1, NULL_RTX);
for (i = start; i <= 1 << 20; i <<= 1)
{
- XEXP (addr, 1) = gen_int_mode (i, Pmode);
- if (!memory_address_p (mem_mode, addr))
+ XEXP (addr, 1) = gen_int_mode (i, address_mode);
+ if (!memory_address_addr_space_p (mem_mode, addr, as))
break;
}
- max_offset[mem_mode] = i == start ? 0 : i >> 1;
- off[mem_mode] = max_offset[mem_mode];
+ data->max_offset = i == start ? 0 : i >> 1;
+ off = data->max_offset;
for (i = start; i <= 1 << 20; i <<= 1)
{
- XEXP (addr, 1) = gen_int_mode (-i, Pmode);
- if (!memory_address_p (mem_mode, addr))
+ XEXP (addr, 1) = gen_int_mode (-i, address_mode);
+ if (!memory_address_addr_space_p (mem_mode, addr, as))
break;
}
- min_offset[mem_mode] = i == start ? 0 : -(i >> 1);
+ data->min_offset = i == start ? 0 : -(i >> 1);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "get_address_cost:\n");
fprintf (dump_file, " min offset %s %d\n",
GET_MODE_NAME (mem_mode),
- (int) min_offset[mem_mode]);
+ (int) data->min_offset);
fprintf (dump_file, " max offset %s %d\n",
GET_MODE_NAME (mem_mode),
- (int) max_offset[mem_mode]);
+ (int) data->max_offset);
}
- rat[mem_mode] = 1;
+ rat = 1;
for (i = 2; i <= MAX_RATIO; i++)
- if (multiplier_allowed_in_address_p (i, mem_mode))
+ if (multiplier_allowed_in_address_p (i, mem_mode, as))
{
- rat[mem_mode] = i;
+ rat = i;
break;
}
/* Compute the cost of various addressing modes. */
acost = 0;
- reg0 = gen_raw_REG (Pmode, LAST_VIRTUAL_REGISTER + 1);
- reg1 = gen_raw_REG (Pmode, LAST_VIRTUAL_REGISTER + 2);
+ reg0 = gen_raw_REG (address_mode, LAST_VIRTUAL_REGISTER + 1);
+ reg1 = gen_raw_REG (address_mode, LAST_VIRTUAL_REGISTER + 2);
if (HAVE_PRE_DECREMENT)
{
- addr = gen_rtx_PRE_DEC (Pmode, reg0);
- has_predec[mem_mode] = memory_address_p (mem_mode, addr);
+ addr = gen_rtx_PRE_DEC (address_mode, reg0);
+ has_predec[mem_mode]
+ = memory_address_addr_space_p (mem_mode, addr, as);
}
if (HAVE_POST_DECREMENT)
{
- addr = gen_rtx_POST_DEC (Pmode, reg0);
- has_postdec[mem_mode] = memory_address_p (mem_mode, addr);
+ addr = gen_rtx_POST_DEC (address_mode, reg0);
+ has_postdec[mem_mode]
+ = memory_address_addr_space_p (mem_mode, addr, as);
}
if (HAVE_PRE_INCREMENT)
{
- addr = gen_rtx_PRE_INC (Pmode, reg0);
- has_preinc[mem_mode] = memory_address_p (mem_mode, addr);
+ addr = gen_rtx_PRE_INC (address_mode, reg0);
+ has_preinc[mem_mode]
+ = memory_address_addr_space_p (mem_mode, addr, as);
}
if (HAVE_POST_INCREMENT)
{
- addr = gen_rtx_POST_INC (Pmode, reg0);
- has_postinc[mem_mode] = memory_address_p (mem_mode, addr);
+ addr = gen_rtx_POST_INC (address_mode, reg0);
+ has_postinc[mem_mode]
+ = memory_address_addr_space_p (mem_mode, addr, as);
}
for (i = 0; i < 16; i++)
{
@@ -3177,15 +3216,15 @@ get_address_cost (bool symbol_present, bool var_present,
addr = reg0;
if (rat_p)
- addr = gen_rtx_fmt_ee (MULT, Pmode, addr,
- gen_int_mode (rat[mem_mode], Pmode));
+ addr = gen_rtx_fmt_ee (MULT, address_mode, addr,
+ gen_int_mode (rat, address_mode));
if (var_p)
- addr = gen_rtx_fmt_ee (PLUS, Pmode, addr, reg1);
+ addr = gen_rtx_fmt_ee (PLUS, address_mode, addr, reg1);
if (sym_p)
{
- base = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (""));
+ base = gen_rtx_SYMBOL_REF (address_mode, ggc_strdup (""));
/* ??? We can run into trouble with some backends by presenting
it with symbols which haven't been properly passed through
targetm.encode_section_info. By setting the local bit, we
@@ -3193,36 +3232,35 @@ get_address_cost (bool symbol_present, bool var_present,
SYMBOL_REF_FLAGS (base) = SYMBOL_FLAG_LOCAL;
if (off_p)
- base = gen_rtx_fmt_e (CONST, Pmode,
- gen_rtx_fmt_ee (PLUS, Pmode,
- base,
- gen_int_mode (off[mem_mode],
- Pmode)));
+ base = gen_rtx_fmt_e (CONST, address_mode,
+ gen_rtx_fmt_ee
+ (PLUS, address_mode, base,
+ gen_int_mode (off, address_mode)));
}
else if (off_p)
- base = gen_int_mode (off[mem_mode], Pmode);
+ base = gen_int_mode (off, address_mode);
else
base = NULL_RTX;
if (base)
- addr = gen_rtx_fmt_ee (PLUS, Pmode, addr, base);
+ addr = gen_rtx_fmt_ee (PLUS, address_mode, addr, base);
start_sequence ();
/* To avoid splitting addressing modes, pretend that no cse will
follow. */
old_cse_not_expected = cse_not_expected;
cse_not_expected = true;
- addr = memory_address (mem_mode, addr);
+ addr = memory_address_addr_space (mem_mode, addr, as);
cse_not_expected = old_cse_not_expected;
seq = get_insns ();
end_sequence ();
acost = seq_cost (seq, speed);
- acost += address_cost (addr, mem_mode, speed);
+ acost += address_cost (addr, mem_mode, as, speed);
if (!acost)
acost = 1;
- costs[mem_mode][sym_p][var_p][off_p][rat_p] = acost;
+ data->costs[sym_p][var_p][off_p][rat_p] = acost;
}
/* On some targets, it is quite expensive to load symbol to a register,
@@ -3237,19 +3275,19 @@ get_address_cost (bool symbol_present, bool var_present,
If VAR_PRESENT is true, try whether the mode with
SYMBOL_PRESENT = false is cheaper even with cost of addition, and
if this is the case, use it. */
- add_c = add_cost (Pmode, speed);
+ add_c = add_cost (address_mode, speed);
for (i = 0; i < 8; i++)
{
var_p = i & 1;
off_p = (i >> 1) & 1;
rat_p = (i >> 2) & 1;
- acost = costs[mem_mode][0][1][off_p][rat_p] + 1;
+ acost = data->costs[0][1][off_p][rat_p] + 1;
if (var_p)
acost += add_c;
- if (acost < costs[mem_mode][1][var_p][off_p][rat_p])
- costs[mem_mode][1][var_p][off_p][rat_p] = acost;
+ if (acost < data->costs[1][var_p][off_p][rat_p])
+ data->costs[1][var_p][off_p][rat_p] = acost;
}
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -3273,7 +3311,7 @@ get_address_cost (bool symbol_present, bool var_present,
if (rat_p)
fprintf (dump_file, "rat * ");
- acost = costs[mem_mode][sym_p][var_p][off_p][rat_p];
+ acost = data->costs[sym_p][var_p][off_p][rat_p];
fprintf (dump_file, "index costs %d\n", acost);
}
if (has_predec[mem_mode] || has_postdec[mem_mode]
@@ -3281,9 +3319,12 @@ get_address_cost (bool symbol_present, bool var_present,
fprintf (dump_file, " May include autoinc/dec\n");
fprintf (dump_file, "\n");
}
+
+ VEC_replace (address_cost_data, address_cost_data_list,
+ data_index, data);
}
- bits = GET_MODE_BITSIZE (Pmode);
+ bits = GET_MODE_BITSIZE (address_mode);
mask = ~(~(unsigned HOST_WIDE_INT) 0 << (bits - 1) << 1);
offset &= mask;
if ((offset >> (bits - 1) & 1))
@@ -3309,20 +3350,20 @@ get_address_cost (bool symbol_present, bool var_present,
cost = 0;
offset_p = (s_offset != 0
- && min_offset[mem_mode] <= s_offset
- && s_offset <= max_offset[mem_mode]);
+ && data->min_offset <= s_offset
+ && s_offset <= data->max_offset);
ratio_p = (ratio != 1
- && multiplier_allowed_in_address_p (ratio, mem_mode));
+ && multiplier_allowed_in_address_p (ratio, mem_mode, as));
if (ratio != 1 && !ratio_p)
- cost += multiply_by_cost (ratio, Pmode, speed);
+ cost += multiply_by_cost (ratio, address_mode, speed);
if (s_offset && !offset_p && !symbol_present)
- cost += add_cost (Pmode, speed);
+ cost += add_cost (address_mode, speed);
if (may_autoinc)
*may_autoinc = autoinc;
- acost = costs[mem_mode][symbol_present][var_present][offset_p][ratio_p];
+ acost = data->costs[symbol_present][var_present][offset_p][ratio_p];
complexity = (symbol_present != 0) + (var_present != 0) + offset_p + ratio_p;
return new_cost (cost + acost, complexity);
}
@@ -3742,8 +3783,9 @@ get_computation_cost_at (struct ivopts_data *data,
}
else if (address_p
&& !POINTER_TYPE_P (ctype)
- && multiplier_allowed_in_address_p (ratio,
- TYPE_MODE (TREE_TYPE (utype))))
+ && multiplier_allowed_in_address_p
+ (ratio, TYPE_MODE (TREE_TYPE (utype)),
+ TYPE_ADDR_SPACE (TREE_TYPE (utype))))
{
cbase
= fold_build2 (MULT_EXPR, ctype, cbase, build_int_cst (ctype, ratio));
@@ -3777,6 +3819,7 @@ get_computation_cost_at (struct ivopts_data *data,
get_address_cost (symbol_present, var_present,
offset, ratio, cstepi,
TYPE_MODE (TREE_TYPE (utype)),
+ TYPE_ADDR_SPACE (TREE_TYPE (utype)),
speed, stmt_is_after_inc,
can_autoinc));
@@ -5467,6 +5510,7 @@ rewrite_use_address (struct ivopts_data *data,
{
aff_tree aff;
gimple_stmt_iterator bsi = gsi_for_stmt (use->stmt);
+ tree base_hint = NULL_TREE;
tree ref;
bool ok;
@@ -5474,7 +5518,22 @@ rewrite_use_address (struct ivopts_data *data,
gcc_assert (ok);
unshare_aff_combination (&aff);
- ref = create_mem_ref (&bsi, TREE_TYPE (*use->op_p), &aff, data->speed);
+ /* To avoid undefined overflow problems, all IV candidates use unsigned
+ integer types. The drawback is that this makes it impossible for
+ create_mem_ref to distinguish an IV that is based on a memory object
+ from one that represents simply an offset.
+
+ To work around this problem, we pass a hint to create_mem_ref that
+ indicates which variable (if any) in aff is an IV based on a memory
+ object. Note that we only consider the candidate. If this is not
+ based on an object, the base of the reference is in some subexpression
+ of the use -- but these will use pointer types, so they are recognized
+ by the create_mem_ref heuristics anyway. */
+ if (cand->iv->base_object)
+ base_hint = var_at_stmt (data->current_loop, cand, use->stmt);
+
+ ref = create_mem_ref (&bsi, TREE_TYPE (*use->op_p), &aff, base_hint,
+ data->speed);
copy_ref_info (ref, *use->op_p);
*use->op_p = ref;
}
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index 11ce546e2d4..c0ddc8afa30 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -531,7 +531,9 @@ execute_cse_reciprocals (void)
|| DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD))
{
enum built_in_function code;
- bool md_code;
+ bool md_code, fail;
+ imm_use_iterator ui;
+ use_operand_p use_p;
code = DECL_FUNCTION_CODE (fndecl);
md_code = DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD;
@@ -540,12 +542,36 @@ execute_cse_reciprocals (void)
if (!fndecl)
continue;
+ /* Check that all uses of the SSA name are divisions,
+ otherwise replacing the defining statement will do
+ the wrong thing. */
+ fail = false;
+ FOR_EACH_IMM_USE_FAST (use_p, ui, arg1)
+ {
+ gimple stmt2 = USE_STMT (use_p);
+ if (is_gimple_debug (stmt2))
+ continue;
+ if (!is_gimple_assign (stmt2)
+ || gimple_assign_rhs_code (stmt2) != RDIV_EXPR
+ || gimple_assign_rhs1 (stmt2) == arg1
+ || gimple_assign_rhs2 (stmt2) != arg1)
+ {
+ fail = true;
+ break;
+ }
+ }
+ if (fail)
+ continue;
+
gimple_call_set_fndecl (stmt1, fndecl);
update_stmt (stmt1);
- gimple_assign_set_rhs_code (stmt, MULT_EXPR);
- fold_stmt_inplace (stmt);
- update_stmt (stmt);
+ FOR_EACH_IMM_USE_STMT (stmt, ui, arg1)
+ {
+ gimple_assign_set_rhs_code (stmt, MULT_EXPR);
+ fold_stmt_inplace (stmt);
+ update_stmt (stmt);
+ }
}
}
}
@@ -791,98 +817,6 @@ struct gimple_opt_pass pass_cse_sincos =
}
};
-/* Find all expressions in the form of sqrt(a/b) and
- convert them to rsqrt(b/a). */
-
-static unsigned int
-execute_convert_to_rsqrt (void)
-{
- basic_block bb;
-
- FOR_EACH_BB (bb)
- {
- gimple_stmt_iterator gsi;
-
- for (gsi = gsi_after_labels (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- {
- gimple stmt = gsi_stmt (gsi);
- tree fndecl;
-
- if (is_gimple_call (stmt)
- && gimple_call_lhs (stmt)
- && (fndecl = gimple_call_fndecl (stmt))
- && (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
- || DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD))
- {
- enum built_in_function code;
- bool md_code;
- tree arg1;
- gimple stmt1;
-
- code = DECL_FUNCTION_CODE (fndecl);
- md_code = DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD;
-
- fndecl = targetm.builtin_reciprocal (code, md_code, true);
- if (!fndecl)
- continue;
-
- arg1 = gimple_call_arg (stmt, 0);
-
- if (TREE_CODE (arg1) != SSA_NAME)
- continue;
-
- stmt1 = SSA_NAME_DEF_STMT (arg1);
-
- if (is_gimple_assign (stmt1)
- && gimple_assign_rhs_code (stmt1) == RDIV_EXPR)
- {
- tree arg10, arg11;
-
- arg10 = gimple_assign_rhs1 (stmt1);
- arg11 = gimple_assign_rhs2 (stmt1);
-
- /* Swap operands of RDIV_EXPR. */
- gimple_assign_set_rhs1 (stmt1, arg11);
- gimple_assign_set_rhs2 (stmt1, arg10);
- fold_stmt_inplace (stmt1);
- update_stmt (stmt1);
-
- gimple_call_set_fndecl (stmt, fndecl);
- update_stmt (stmt);
- }
- }
- }
- }
-
- return 0;
-}
-
-static bool
-gate_convert_to_rsqrt (void)
-{
- return flag_unsafe_math_optimizations && optimize;
-}
-
-struct gimple_opt_pass pass_convert_to_rsqrt =
-{
- {
- GIMPLE_PASS,
- "rsqrt", /* name */
- gate_convert_to_rsqrt, /* gate */
- execute_convert_to_rsqrt, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_dump_func | TODO_update_ssa | TODO_verify_ssa
- | TODO_verify_stmts /* todo_flags_finish */
- }
-};
-
/* A symbolic number is used to detect byte permutation and selection
patterns. Therefore the field N contains an artificial number
consisting of byte size markers:
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index 28e6ec65826..6af31a437ea 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -894,6 +894,10 @@ get_expr_operands (gimple stmt, tree *expr_p, int flags)
add_stmt_operand (expr_p, stmt, flags);
return;
+ case DEBUG_EXPR_DECL:
+ gcc_assert (gimple_debug_bind_p (stmt));
+ return;
+
case MISALIGNED_INDIRECT_REF:
get_expr_operands (stmt, &TREE_OPERAND (expr, 1), flags);
/* fall through */
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index 5da6c63b400..2ef6d76a40a 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -1243,43 +1243,74 @@ do_unary:
}
/* Translate the VUSE backwards through phi nodes in PHIBLOCK, so that
- it has the value it would have in BLOCK. */
+ it has the value it would have in BLOCK. Set *SAME_VALID to true
+ in case the new vuse doesn't change the value id of the OPERANDS. */
static tree
translate_vuse_through_block (VEC (vn_reference_op_s, heap) *operands,
alias_set_type set, tree type, tree vuse,
basic_block phiblock,
- basic_block block)
+ basic_block block, bool *same_valid)
{
gimple phi = SSA_NAME_DEF_STMT (vuse);
ao_ref ref;
+ edge e = NULL;
+ bool use_oracle;
+
+ *same_valid = true;
if (gimple_bb (phi) != phiblock)
return vuse;
- if (gimple_code (phi) == GIMPLE_PHI)
- {
- edge e = find_edge (block, phiblock);
- return PHI_ARG_DEF (phi, e->dest_idx);
- }
-
- if (!ao_ref_init_from_vn_reference (&ref, set, type, operands))
- return NULL_TREE;
+ use_oracle = ao_ref_init_from_vn_reference (&ref, set, type, operands);
/* Use the alias-oracle to find either the PHI node in this block,
the first VUSE used in this block that is equivalent to vuse or
the first VUSE which definition in this block kills the value. */
- while (!stmt_may_clobber_ref_p_1 (phi, &ref))
+ if (gimple_code (phi) == GIMPLE_PHI)
+ e = find_edge (block, phiblock);
+ else if (use_oracle)
+ while (!stmt_may_clobber_ref_p_1 (phi, &ref))
+ {
+ vuse = gimple_vuse (phi);
+ phi = SSA_NAME_DEF_STMT (vuse);
+ if (gimple_bb (phi) != phiblock)
+ return vuse;
+ if (gimple_code (phi) == GIMPLE_PHI)
+ {
+ e = find_edge (block, phiblock);
+ break;
+ }
+ }
+ else
+ return NULL_TREE;
+
+ if (e)
{
- vuse = gimple_vuse (phi);
- phi = SSA_NAME_DEF_STMT (vuse);
- if (gimple_bb (phi) != phiblock)
- return vuse;
- if (gimple_code (phi) == GIMPLE_PHI)
+ if (use_oracle)
{
- edge e = find_edge (block, phiblock);
- return PHI_ARG_DEF (phi, e->dest_idx);
+ bitmap visited = NULL;
+ /* Try to find a vuse that dominates this phi node by skipping
+ non-clobbering statements. */
+ vuse = get_continuation_for_phi (phi, &ref, &visited);
+ if (visited)
+ BITMAP_FREE (visited);
}
+ else
+ vuse = NULL_TREE;
+ if (!vuse)
+ {
+ /* If we didn't find any, the value ID can't stay the same,
+ but return the translated vuse. */
+ *same_valid = false;
+ vuse = PHI_ARG_DEF (phi, e->dest_idx);
+ }
+ /* ??? We would like to return vuse here as this is the canonical
+ upmost vdef that this reference is associated with. But during
+ insertion of the references into the hash tables we only ever
+ directly insert with their direct gimple_vuse, hence returning
+ something else would make us not find the other expression. */
+ return PHI_ARG_DEF (phi, e->dest_idx);
}
return NULL_TREE;
@@ -1541,7 +1572,7 @@ phi_translate_1 (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2,
tree vuse = ref->vuse;
tree newvuse = vuse;
VEC (vn_reference_op_s, heap) *newoperands = NULL;
- bool changed = false;
+ bool changed = false, same_valid = true;
unsigned int i, j;
vn_reference_op_t operand;
vn_reference_t newref;
@@ -1647,16 +1678,16 @@ phi_translate_1 (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2,
{
newvuse = translate_vuse_through_block (newoperands,
ref->set, ref->type,
- vuse, phiblock, pred);
+ vuse, phiblock, pred,
+ &same_valid);
if (newvuse == NULL_TREE)
{
VEC_free (vn_reference_op_s, heap, newoperands);
return NULL;
}
}
- changed |= newvuse != vuse;
- if (changed)
+ if (changed || newvuse != vuse)
{
unsigned int new_val_id;
pre_expr constant;
@@ -1690,9 +1721,15 @@ phi_translate_1 (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2,
}
else
{
- new_val_id = get_next_value_id ();
- VEC_safe_grow_cleared (bitmap_set_t, heap, value_expressions,
- get_max_value_id() + 1);
+ if (changed || !same_valid)
+ {
+ new_val_id = get_next_value_id ();
+ VEC_safe_grow_cleared (bitmap_set_t, heap,
+ value_expressions,
+ get_max_value_id() + 1);
+ }
+ else
+ new_val_id = ref->value_id;
newref = vn_reference_insert_pieces (newvuse, ref->set,
ref->type,
newoperands,
@@ -3405,6 +3442,7 @@ do_regular_insertion (basic_block block, basic_block dom)
pre_expr eprime = NULL;
edge_iterator ei;
pre_expr edoubleprime = NULL;
+ bool do_insertion = false;
val = get_expr_value_id (expr);
if (bitmap_set_contains_value (PHI_GEN (block), val))
@@ -3456,6 +3494,10 @@ do_regular_insertion (basic_block block, basic_block dom)
{
avail[bprime->index] = edoubleprime;
by_some = true;
+ /* We want to perform insertions to remove a redundancy on
+ a path in the CFG we want to optimize for speed. */
+ if (optimize_edge_for_speed_p (pred))
+ do_insertion = true;
if (first_s == NULL)
first_s = edoubleprime;
else if (!pre_expr_eq (first_s, edoubleprime))
@@ -3466,7 +3508,8 @@ do_regular_insertion (basic_block block, basic_block dom)
already existing along every predecessor, and
it's defined by some predecessor, it is
partially redundant. */
- if (!cant_insert && !all_same && by_some && dbg_cnt (treepre_insert))
+ if (!cant_insert && !all_same && by_some && do_insertion
+ && dbg_cnt (treepre_insert))
{
if (insert_into_preds_of_block (block, get_expression_id (expr),
avail))
@@ -3908,7 +3951,7 @@ compute_avail (void)
vn_reference_lookup (gimple_assign_rhs1 (stmt),
gimple_vuse (stmt),
- false, &ref);
+ true, &ref);
if (!ref)
continue;
@@ -4526,11 +4569,11 @@ fini_pre (bool do_fre)
only wants to do full redundancy elimination. */
static unsigned int
-execute_pre (bool do_fre ATTRIBUTE_UNUSED)
+execute_pre (bool do_fre)
{
unsigned int todo = 0;
- do_partial_partial = optimize > 2;
+ do_partial_partial = optimize > 2 && optimize_function_for_speed_p (cfun);
/* This has to happen before SCCVN runs because
loop_optimizer_init may create new phis, etc. */
@@ -4615,8 +4658,7 @@ do_pre (void)
static bool
gate_pre (void)
{
- /* PRE tends to generate bigger code. */
- return flag_tree_pre != 0 && optimize_function_for_speed_p (cfun);
+ return flag_tree_pre != 0;
}
struct gimple_opt_pass pass_pre =
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 55ce2f65a4f..5136aee5d32 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -1405,7 +1405,6 @@ rewrite_expr_tree (gimple stmt, unsigned int opindex,
{
stmt2 = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (stmt1));
gsirhs1 = gsi_for_stmt (stmt2);
- propagate_defs_into_debug_stmts (stmt2, gimple_bb (stmt), &gsinow);
gsi_move_before (&gsirhs1, &gsinow);
gsi_prev (&gsinow);
stmt1 = stmt2;
@@ -1452,7 +1451,6 @@ linearize_expr (gimple stmt)
gsinow = gsi_for_stmt (stmt);
gsirhs = gsi_for_stmt (binrhs);
- propagate_defs_into_debug_stmts (binrhs, gimple_bb (stmt), &gsinow);
gsi_move_before (&gsirhs, &gsinow);
gimple_assign_set_rhs2 (stmt, gimple_assign_rhs1 (binrhs));
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 4158fbd88df..0a8dcaa36c4 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -1157,7 +1157,9 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_)
/* Adjust *ref from the new operands. */
if (!ao_ref_init_from_vn_reference (&r, vr->set, vr->type, vr->operands))
return (void *)-1;
- gcc_assert (ref->size == r.size);
+ /* This can happen with bitfields. */
+ if (ref->size != r.size)
+ return (void *)-1;
*ref = r;
/* Keep looking for the adjusted *REF / VR pair. */
diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c
index a9b4b67679b..be3fb7145fd 100644
--- a/gcc/tree-ssa-sink.c
+++ b/gcc/tree-ssa-sink.c
@@ -385,9 +385,6 @@ statement_sink_location (gimple stmt, basic_block frombb,
*togsi = gsi_after_labels (commondom);
- if (debug_stmts)
- propagate_defs_into_debug_stmts (stmt, commondom, togsi);
-
return true;
}
@@ -406,8 +403,6 @@ statement_sink_location (gimple stmt, basic_block frombb,
*togsi = gsi_for_stmt (use);
- propagate_defs_into_debug_stmts (stmt, sinkbb, togsi);
-
return true;
}
@@ -441,8 +436,6 @@ statement_sink_location (gimple stmt, basic_block frombb,
*togsi = gsi_after_labels (sinkbb);
- propagate_defs_into_debug_stmts (stmt, sinkbb, togsi);
-
return true;
}
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index e5f4a292855..74dc6d2c1ba 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -2825,7 +2825,7 @@ static void
get_constraint_for_ptr_offset (tree ptr, tree offset,
VEC (ce_s, heap) **results)
{
- struct constraint_expr *c;
+ struct constraint_expr c;
unsigned int j, n;
HOST_WIDE_INT rhsunitoffset, rhsoffset;
@@ -2863,14 +2863,14 @@ get_constraint_for_ptr_offset (tree ptr, tree offset,
for (j = 0; j < n; j++)
{
varinfo_t curr;
- c = VEC_index (ce_s, *results, j);
- curr = get_varinfo (c->var);
+ c = *VEC_index (ce_s, *results, j);
+ curr = get_varinfo (c.var);
- if (c->type == ADDRESSOF
+ if (c.type == ADDRESSOF
/* If this varinfo represents a full variable just use it. */
&& curr->is_full_var)
- c->offset = 0;
- else if (c->type == ADDRESSOF
+ c.offset = 0;
+ else if (c.type == ADDRESSOF
/* If we do not know the offset add all subfields. */
&& rhsoffset == UNKNOWN_OFFSET)
{
@@ -2881,13 +2881,13 @@ get_constraint_for_ptr_offset (tree ptr, tree offset,
c2.var = temp->id;
c2.type = ADDRESSOF;
c2.offset = 0;
- if (c2.var != c->var)
+ if (c2.var != c.var)
VEC_safe_push (ce_s, heap, *results, &c2);
temp = temp->next;
}
while (temp);
}
- else if (c->type == ADDRESSOF)
+ else if (c.type == ADDRESSOF)
{
varinfo_t temp;
unsigned HOST_WIDE_INT offset = curr->offset + rhsoffset;
@@ -2919,11 +2919,13 @@ get_constraint_for_ptr_offset (tree ptr, tree offset,
c2.offset = 0;
VEC_safe_push (ce_s, heap, *results, &c2);
}
- c->var = temp->id;
- c->offset = 0;
+ c.var = temp->id;
+ c.offset = 0;
}
else
- c->offset = rhsoffset;
+ c.offset = rhsoffset;
+
+ VEC_replace (ce_s, *results, j, &c);
}
}
@@ -3661,8 +3663,8 @@ find_func_aliases (gimple origt)
pointer passed by address. */
else if (is_gimple_call (t))
{
- tree fndecl;
- if ((fndecl = gimple_call_fndecl (t)) != NULL_TREE
+ tree fndecl = gimple_call_fndecl (t);
+ if (fndecl != NULL_TREE
&& DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)
/* ??? All builtins that are handled here need to be handled
in the alias-oracle query functions explicitly! */
@@ -3685,8 +3687,10 @@ find_func_aliases (gimple origt)
case BUILT_IN_STRNCAT:
{
tree res = gimple_call_lhs (t);
- tree dest = gimple_call_arg (t, 0);
- tree src = gimple_call_arg (t, 1);
+ tree dest = gimple_call_arg (t, (DECL_FUNCTION_CODE (fndecl)
+ == BUILT_IN_BCOPY ? 1 : 0));
+ tree src = gimple_call_arg (t, (DECL_FUNCTION_CODE (fndecl)
+ == BUILT_IN_BCOPY ? 0 : 1));
if (res != NULL_TREE)
{
get_constraint_for (res, &lhsc);
@@ -3772,7 +3776,9 @@ find_func_aliases (gimple origt)
default:
/* Fallthru to general call handling. */;
}
- if (!in_ipa_mode)
+ if (!in_ipa_mode
+ || (fndecl
+ && !lookup_vi_for_tree (fndecl)))
{
VEC(ce_s, heap) *rhsc = NULL;
int flags = gimple_call_flags (t);
@@ -4423,9 +4429,6 @@ create_variable_info_for (tree decl, const char *name)
tree declsize = DECL_P (decl) ? DECL_SIZE (decl) : TYPE_SIZE (decl_type);
VEC (fieldoff_s,heap) *fieldstack = NULL;
- if (TREE_CODE (decl) == FUNCTION_DECL && in_ipa_mode)
- return create_function_info_for (decl, name);
-
if (var_can_have_subvars (decl) && use_field_sensitive)
push_fields_onto_fieldstack (decl_type, &fieldstack, 0);
@@ -4771,8 +4774,6 @@ set_uids_in_ptset (bitmap into, bitmap from, struct pt_solution *pt)
}
-static bool have_alias_info = false;
-
/* Compute the points-to solution *PT for the variable VI. */
static void
@@ -5397,44 +5398,12 @@ delete_alias_heapvars (void)
heapvar_for_stmt = NULL;
}
-/* Create points-to sets for the current function. See the comments
- at the start of the file for an algorithmic overview. */
+/* Solve the constraint set. */
static void
-compute_points_to_sets (void)
+solve_constraints (void)
{
struct scc_info *si;
- basic_block bb;
- unsigned i;
- varinfo_t vi;
-
- timevar_push (TV_TREE_PTA);
-
- init_alias_vars ();
- init_alias_heapvars ();
-
- intra_create_variable_infos ();
-
- /* Now walk all statements and derive aliases. */
- FOR_EACH_BB (bb)
- {
- gimple_stmt_iterator gsi;
-
- for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- {
- gimple phi = gsi_stmt (gsi);
-
- if (is_gimple_reg (gimple_phi_result (phi)))
- find_func_aliases (phi);
- }
-
- for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- {
- gimple stmt = gsi_stmt (gsi);
-
- find_func_aliases (stmt);
- }
- }
if (dump_file)
{
@@ -5491,6 +5460,48 @@ compute_points_to_sets (void)
if (dump_file)
dump_sa_points_to_info (dump_file);
+}
+
+/* Create points-to sets for the current function. See the comments
+ at the start of the file for an algorithmic overview. */
+
+static void
+compute_points_to_sets (void)
+{
+ basic_block bb;
+ unsigned i;
+ varinfo_t vi;
+
+ timevar_push (TV_TREE_PTA);
+
+ init_alias_vars ();
+ init_alias_heapvars ();
+
+ intra_create_variable_infos ();
+
+ /* Now walk all statements and derive aliases. */
+ FOR_EACH_BB (bb)
+ {
+ gimple_stmt_iterator gsi;
+
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple phi = gsi_stmt (gsi);
+
+ if (is_gimple_reg (gimple_phi_result (phi)))
+ find_func_aliases (phi);
+ }
+
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple stmt = gsi_stmt (gsi);
+
+ find_func_aliases (stmt);
+ }
+ }
+
+ /* From the constraints compute the points-to sets. */
+ solve_constraints ();
/* Compute the points-to sets for ESCAPED and CALLUSED used for
call-clobber analysis. */
@@ -5522,8 +5533,6 @@ compute_points_to_sets (void)
}
timevar_pop (TV_TREE_PTA);
-
- have_alias_info = true;
}
@@ -5557,7 +5566,6 @@ delete_points_to_sets (void)
VEC_free (varinfo_t, heap, varmap);
free_alloc_pool (variable_info_pool);
free_alloc_pool (constraint_pool);
- have_alias_info = false;
}
@@ -5656,101 +5664,94 @@ static unsigned int
ipa_pta_execute (void)
{
struct cgraph_node *node;
- struct scc_info *si;
in_ipa_mode = 1;
+
init_alias_heapvars ();
init_alias_vars ();
+ /* Build the constraints. */
for (node = cgraph_nodes; node; node = node->next)
{
unsigned int varid;
+ /* Nodes without a body are not interesting. Especially do not
+ visit clones at this point for now - we get duplicate decls
+ there for inline clones at least. */
+ if (!gimple_has_body_p (node->decl)
+ || node->clone_of)
+ continue;
+
+ /* It does not make sense to have graph edges into or out of
+ externally visible functions. There is no extra information
+ we can gather from them. */
+ if (node->local.externally_visible)
+ continue;
+
varid = create_function_info_for (node->decl,
cgraph_node_name (node));
- if (node->local.externally_visible)
- {
- varinfo_t fi = get_varinfo (varid);
- for (; fi; fi = fi->next)
- make_constraint_from (fi, anything_id);
- }
}
+
for (node = cgraph_nodes; node; node = node->next)
{
- if (node->analyzed)
- {
- struct function *func = DECL_STRUCT_FUNCTION (node->decl);
- basic_block bb;
- tree old_func_decl = current_function_decl;
- if (dump_file)
- fprintf (dump_file,
- "Generating constraints for %s\n",
- cgraph_node_name (node));
- push_cfun (func);
- current_function_decl = node->decl;
+ struct function *func;
+ basic_block bb;
+ tree old_func_decl;
- FOR_EACH_BB_FN (bb, func)
- {
- gimple_stmt_iterator gsi;
+ /* Nodes without a body are not interesting. */
+ if (!gimple_has_body_p (node->decl)
+ || node->clone_of)
+ continue;
- for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi);
- gsi_next (&gsi))
- {
- gimple phi = gsi_stmt (gsi);
+ if (dump_file)
+ fprintf (dump_file,
+ "Generating constraints for %s\n",
+ cgraph_node_name (node));
- if (is_gimple_reg (gimple_phi_result (phi)))
- find_func_aliases (phi);
- }
+ func = DECL_STRUCT_FUNCTION (node->decl);
+ old_func_decl = current_function_decl;
+ push_cfun (func);
+ current_function_decl = node->decl;
- for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- find_func_aliases (gsi_stmt (gsi));
- }
- current_function_decl = old_func_decl;
- pop_cfun ();
- }
- else
- {
- /* Make point to anything. */
- }
- }
+ /* For externally visible functions use local constraints for
+ their arguments. For local functions we see all callers
+ and thus do not need initial constraints for parameters. */
+ if (node->local.externally_visible)
+ intra_create_variable_infos ();
- if (dump_file)
- {
- fprintf (dump_file, "Points-to analysis\n\nConstraints:\n\n");
- dump_constraints (dump_file);
- }
+ /* Build constriants for the function body. */
+ FOR_EACH_BB_FN (bb, func)
+ {
+ gimple_stmt_iterator gsi;
- if (dump_file)
- fprintf (dump_file,
- "\nCollapsing static cycles and doing variable "
- "substitution:\n");
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi);
+ gsi_next (&gsi))
+ {
+ gimple phi = gsi_stmt (gsi);
- init_graph (VEC_length (varinfo_t, varmap) * 2);
- build_pred_graph ();
- si = perform_var_substitution (graph);
- rewrite_constraints (graph, si);
+ if (is_gimple_reg (gimple_phi_result (phi)))
+ find_func_aliases (phi);
+ }
- build_succ_graph ();
- free_var_substitution_info (si);
- move_complex_constraints (graph);
- unite_pointer_equivalences (graph);
- find_indirect_cycles (graph);
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple stmt = gsi_stmt (gsi);
- /* Implicit nodes and predecessors are no longer necessary at this
- point. */
- remove_preds_and_fake_succs (graph);
+ find_func_aliases (stmt);
+ }
+ }
- if (dump_file)
- fprintf (dump_file, "\nSolving graph\n");
+ current_function_decl = old_func_decl;
+ pop_cfun ();
+ }
- solve_graph (graph);
+ /* From the constraints compute the points-to sets. */
+ solve_constraints ();
- if (dump_file)
- dump_sa_points_to_info (dump_file);
+ delete_points_to_sets ();
in_ipa_mode = 0;
- delete_alias_heapvars ();
- delete_points_to_sets ();
+
return 0;
}
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 9015d19c189..8e88c2f73b0 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -295,152 +295,198 @@ find_released_ssa_name (tree *tp, int *walk_subtrees, void *data_)
return NULL_TREE;
}
-/* Given a VAR whose definition STMT is to be moved to the iterator
- position TOGSIP in the TOBB basic block, verify whether we're
- moving it across any of the debug statements that use it, and
- adjust them as needed. If TOBB is NULL, then the definition is
- understood as being removed, and TOGSIP is unused. */
+/* Insert a DEBUG BIND stmt before the DEF of VAR if VAR is referenced
+ by other DEBUG stmts, and replace uses of the DEF with the
+ newly-created debug temp. */
+
void
-propagate_var_def_into_debug_stmts (tree var,
- basic_block tobb,
- const gimple_stmt_iterator *togsip)
+insert_debug_temp_for_var_def (gimple_stmt_iterator *gsi, tree var)
{
imm_use_iterator imm_iter;
- gimple stmt;
use_operand_p use_p;
+ gimple stmt;
+ gimple def_stmt = NULL;
+ int usecount = 0;
tree value = NULL;
- bool no_value = false;
if (!MAY_HAVE_DEBUG_STMTS)
return;
- FOR_EACH_IMM_USE_STMT (stmt, imm_iter, var)
+ /* First of all, check whether there are debug stmts that reference
+ this variable and, if there are, decide whether we should use a
+ debug temp. */
+ FOR_EACH_IMM_USE_FAST (use_p, imm_iter, var)
{
- basic_block bb;
- gimple_stmt_iterator si;
+ stmt = USE_STMT (use_p);
- if (!is_gimple_debug (stmt))
+ if (!gimple_debug_bind_p (stmt))
continue;
- if (tobb)
+ if (usecount++)
+ break;
+
+ if (gimple_debug_bind_get_value (stmt) != var)
{
- bb = gimple_bb (stmt);
+ /* Count this as an additional use, so as to make sure we
+ use a temp unless VAR's definition has a SINGLE_RHS that
+ can be shared. */
+ usecount++;
+ break;
+ }
+ }
- if (bb != tobb)
- {
- gcc_assert (dom_info_available_p (CDI_DOMINATORS));
- if (dominated_by_p (CDI_DOMINATORS, bb, tobb))
- continue;
- }
- else
- {
- si = *togsip;
+ if (!usecount)
+ return;
+
+ if (gsi)
+ def_stmt = gsi_stmt (*gsi);
+ else
+ def_stmt = SSA_NAME_DEF_STMT (var);
- if (gsi_end_p (si))
- continue;
+ /* If we didn't get an insertion point, and the stmt has already
+ been removed, we won't be able to insert the debug bind stmt, so
+ we'll have to drop debug information. */
+ if (is_gimple_assign (def_stmt))
+ {
+ bool no_value = false;
- do
- {
- gsi_prev (&si);
- if (gsi_end_p (si))
- break;
- }
- while (gsi_stmt (si) != stmt);
+ if (!dom_info_available_p (CDI_DOMINATORS))
+ {
+ struct walk_stmt_info wi;
- if (gsi_end_p (si))
- continue;
- }
+ memset (&wi, 0, sizeof (wi));
+
+ /* When removing blocks without following reverse dominance
+ order, we may sometimes encounter SSA_NAMEs that have
+ already been released, referenced in other SSA_DEFs that
+ we're about to release. Consider:
+
+ <bb X>:
+ v_1 = foo;
+
+ <bb Y>:
+ w_2 = v_1 + bar;
+ # DEBUG w => w_2
+
+ If we deleted BB X first, propagating the value of w_2
+ won't do us any good. It's too late to recover their
+ original definition of v_1: when it was deleted, it was
+ only referenced in other DEFs, it couldn't possibly know
+ it should have been retained, and propagating every
+ single DEF just in case it might have to be propagated
+ into a DEBUG STMT would probably be too wasteful.
+
+ When dominator information is not readily available, we
+ check for and accept some loss of debug information. But
+ if it is available, there's no excuse for us to remove
+ blocks in the wrong order, so we don't even check for
+ dead SSA NAMEs. SSA verification shall catch any
+ errors. */
+ if ((!gsi && !gimple_bb (def_stmt))
+ || !walk_gimple_op (def_stmt, find_released_ssa_name,
+ &wi))
+ no_value = true;
}
- /* Here we compute (lazily) the value assigned to VAR, but we
- remember if we tried before and failed, so that we don't try
- again. */
- if (!value && !no_value)
+ if (!no_value)
+ value = gimple_assign_rhs_to_tree (def_stmt);
+ }
+
+ if (value)
+ {
+ /* If there's a single use of VAR, and VAR is the entire debug
+ expression (usecount would have been incremented again
+ otherwise), and the definition involves only constants and
+ SSA names, then we can propagate VALUE into this single use,
+ avoiding the temp.
+
+ We can also avoid using a temp if VALUE can be shared and
+ propagated into all uses, without generating expressions that
+ wouldn't be valid gimple RHSs.
+
+ Other cases that would require unsharing or non-gimple RHSs
+ are deferred to a debug temp, although we could avoid temps
+ at the expense of duplication of expressions. */
+
+ if (CONSTANT_CLASS_P (value)
+ || (usecount == 1
+ && (!gimple_assign_single_p (def_stmt)
+ || is_gimple_min_invariant (value)))
+ || is_gimple_reg (value))
+ value = unshare_expr (value);
+ else
{
- gimple def_stmt = SSA_NAME_DEF_STMT (var);
+ gimple def_temp;
+ tree vexpr = make_node (DEBUG_EXPR_DECL);
- if (is_gimple_assign (def_stmt))
- {
- if (!dom_info_available_p (CDI_DOMINATORS))
- {
- struct walk_stmt_info wi;
-
- memset (&wi, 0, sizeof (wi));
-
- /* When removing blocks without following reverse
- dominance order, we may sometimes encounter SSA_NAMEs
- that have already been released, referenced in other
- SSA_DEFs that we're about to release. Consider:
-
- <bb X>:
- v_1 = foo;
-
- <bb Y>:
- w_2 = v_1 + bar;
- # DEBUG w => w_2
-
- If we deleted BB X first, propagating the value of
- w_2 won't do us any good. It's too late to recover
- their original definition of v_1: when it was
- deleted, it was only referenced in other DEFs, it
- couldn't possibly know it should have been retained,
- and propagating every single DEF just in case it
- might have to be propagated into a DEBUG STMT would
- probably be too wasteful.
-
- When dominator information is not readily
- available, we check for and accept some loss of
- debug information. But if it is available,
- there's no excuse for us to remove blocks in the
- wrong order, so we don't even check for dead SSA
- NAMEs. SSA verification shall catch any
- errors. */
- if (!walk_gimple_op (def_stmt, find_released_ssa_name, &wi))
- no_value = true;
- }
+ def_temp = gimple_build_debug_bind (vexpr,
+ unshare_expr (value),
+ def_stmt);
+
+ DECL_ARTIFICIAL (vexpr) = 1;
+ TREE_TYPE (vexpr) = TREE_TYPE (value);
+ if (DECL_P (value))
+ DECL_MODE (vexpr) = DECL_MODE (value);
+ else
+ DECL_MODE (vexpr) = TYPE_MODE (TREE_TYPE (value));
- if (!no_value)
- value = gimple_assign_rhs_to_tree (def_stmt);
+ if (gsi)
+ gsi_insert_before (gsi, def_temp, GSI_SAME_STMT);
+ else
+ {
+ gimple_stmt_iterator ngsi = gsi_for_stmt (def_stmt);
+ gsi_insert_before (&ngsi, def_temp, GSI_SAME_STMT);
}
- if (!value)
- no_value = true;
+ value = vexpr;
}
+ }
- if (no_value)
- gimple_debug_bind_reset_value (stmt);
- else
+ FOR_EACH_IMM_USE_STMT (stmt, imm_iter, var)
+ {
+ if (!gimple_debug_bind_p (stmt))
+ continue;
+
+ if (value)
FOR_EACH_IMM_USE_ON_STMT (use_p, imm_iter)
- SET_USE (use_p, unshare_expr (value));
+ /* unshare_expr is not needed here. vexpr is either a
+ SINGLE_RHS, that can be safely shared, some other RHS
+ that was unshared when we found it had a single debug
+ use, or a DEBUG_EXPR_DECL, that can be safely
+ shared. */
+ SET_USE (use_p, value);
+ else
+ gimple_debug_bind_reset_value (stmt);
update_stmt (stmt);
}
}
-/* Given a STMT to be moved to the iterator position TOBSIP in the
- TOBB basic block, verify whether we're moving it across any of the
- debug statements that use it. If TOBB is NULL, then the definition
- is understood as being removed, and TOBSIP is unused. */
+/* Insert a DEBUG BIND stmt before STMT for each DEF referenced by
+ other DEBUG stmts, and replace uses of the DEF with the
+ newly-created debug temp. */
void
-propagate_defs_into_debug_stmts (gimple def, basic_block tobb,
- const gimple_stmt_iterator *togsip)
+insert_debug_temps_for_defs (gimple_stmt_iterator *gsi)
{
+ gimple stmt;
ssa_op_iter op_iter;
def_operand_p def_p;
if (!MAY_HAVE_DEBUG_STMTS)
return;
- FOR_EACH_SSA_DEF_OPERAND (def_p, def, op_iter, SSA_OP_DEF)
+ stmt = gsi_stmt (*gsi);
+
+ FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, op_iter, SSA_OP_DEF)
{
tree var = DEF_FROM_PTR (def_p);
if (TREE_CODE (var) != SSA_NAME)
continue;
- propagate_var_def_into_debug_stmts (var, tobb, togsip);
+ insert_debug_temp_for_var_def (gsi, var);
}
}
@@ -1146,15 +1192,15 @@ useless_type_conversion_p (tree outer_type, tree inner_type)
if (POINTER_TYPE_P (inner_type)
&& POINTER_TYPE_P (outer_type))
{
+ /* Do not lose casts between pointers to different address spaces. */
+ if (TYPE_ADDR_SPACE (TREE_TYPE (outer_type))
+ != TYPE_ADDR_SPACE (TREE_TYPE (inner_type)))
+ return false;
+
/* If the outer type is (void *) or a pointer to an incomplete
record type or a pointer to an unprototyped function,
then the conversion is not necessary. */
if (VOID_TYPE_P (TREE_TYPE (outer_type))
- || (AGGREGATE_TYPE_P (TREE_TYPE (outer_type))
- && TREE_CODE (TREE_TYPE (outer_type)) != ARRAY_TYPE
- && (TREE_CODE (TREE_TYPE (outer_type))
- == TREE_CODE (TREE_TYPE (inner_type)))
- && !COMPLETE_TYPE_P (TREE_TYPE (outer_type)))
|| ((TREE_CODE (TREE_TYPE (outer_type)) == FUNCTION_TYPE
|| TREE_CODE (TREE_TYPE (outer_type)) == METHOD_TYPE)
&& (TREE_CODE (TREE_TYPE (outer_type))
diff --git a/gcc/tree-ssanames.c b/gcc/tree-ssanames.c
index 45183218a2c..bb0880260ff 100644
--- a/gcc/tree-ssanames.c
+++ b/gcc/tree-ssanames.c
@@ -206,7 +206,7 @@ release_ssa_name (tree var)
use_operand_p imm = &(SSA_NAME_IMM_USE_NODE (var));
if (MAY_HAVE_DEBUG_STMTS)
- propagate_var_def_into_debug_stmts (var, NULL, NULL);
+ insert_debug_temp_for_var_def (NULL, var);
#ifdef ENABLE_CHECKING
verify_imm_links (stderr, var);
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index bc18f0272f8..c13c2750270 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -1138,8 +1138,8 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
/* While cost model enhancements are expected in the future, the high level
view of the code at this time is as follows:
- A) If there is an unsupported misaligned access then see if peeling
- to align this access can make all data references satisfy
+ A) If there is a misaligned access then see if peeling to align
+ this access can make all data references satisfy
vect_supportable_dr_alignment. If so, update data structures
as needed and return true.
@@ -1176,7 +1176,6 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
{
stmt = DR_STMT (dr);
stmt_info = vinfo_for_stmt (stmt);
- supportable_dr_alignment = vect_supportable_dr_alignment (dr);
/* For interleaving, only the alignment of the first access
matters. */
@@ -1184,7 +1183,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
&& DR_GROUP_FIRST_DR (stmt_info) != stmt)
continue;
- if (!supportable_dr_alignment)
+ if (!DR_IS_READ (dr) && !aligned_access_p (dr))
{
do_peeling = vector_alignment_reachable_p (dr);
if (do_peeling)
@@ -2369,9 +2368,22 @@ vect_create_data_ref_ptr (gimple stmt, struct loop *at_loop,
vect_ptr_type = build_pointer_type (vectype);
vect_ptr = vect_get_new_vect_var (vect_ptr_type, vect_pointer_var,
get_name (base_name));
- /* If any of the data-references in the stmt group does not conflict
- with the created vector data-reference use a ref-all pointer instead. */
- if (STMT_VINFO_DR_GROUP_SIZE (stmt_info) > 1)
+
+ /* Vector types inherit the alias set of their component type by default so
+ we need to use a ref-all pointer if the data reference does not conflict
+ with the created vector data reference because it is not addressable. */
+ if (!alias_sets_conflict_p (get_deref_alias_set (vect_ptr),
+ get_alias_set (DR_REF (dr))))
+ {
+ vect_ptr_type
+ = build_pointer_type_for_mode (vectype,
+ TYPE_MODE (vect_ptr_type), true);
+ vect_ptr = vect_get_new_vect_var (vect_ptr_type, vect_pointer_var,
+ get_name (base_name));
+ }
+
+ /* Likewise for any of the data references in the stmt group. */
+ else if (STMT_VINFO_DR_GROUP_SIZE (stmt_info) > 1)
{
gimple orig_stmt = STMT_VINFO_DR_GROUP_FIRST_DR (stmt_info);
do
@@ -2380,10 +2392,12 @@ vect_create_data_ref_ptr (gimple stmt, struct loop *at_loop,
if (!alias_sets_conflict_p (get_deref_alias_set (vect_ptr),
get_alias_set (lhs)))
{
- vect_ptr_type = build_pointer_type_for_mode (vectype,
- ptr_mode, true);
- vect_ptr = vect_get_new_vect_var (vect_ptr_type, vect_pointer_var,
- get_name (base_name));
+ vect_ptr_type
+ = build_pointer_type_for_mode (vectype,
+ TYPE_MODE (vect_ptr_type), true);
+ vect_ptr
+ = vect_get_new_vect_var (vect_ptr_type, vect_pointer_var,
+ get_name (base_name));
break;
}
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index ddaee818310..fb4a5bf5dd7 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -172,13 +172,13 @@ exist_non_indexing_operands_for_use_p (tree use, gimple stmt)
{
tree operand;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
-
+
/* USE corresponds to some operand in STMT. If there is no data
reference in STMT, then any operand that corresponds to USE
is not indexing an array. */
if (!STMT_VINFO_DATA_REF (stmt_info))
return true;
-
+
/* STMT has a data_ref. FORNOW this means that its of one of
the following forms:
-1- ARRAY_REF = var
@@ -191,14 +191,12 @@ exist_non_indexing_operands_for_use_p (tree use, gimple stmt)
Therefore, all we need to check is if STMT falls into the
first case, and whether var corresponds to USE. */
-
- if (TREE_CODE (gimple_assign_lhs (stmt)) == SSA_NAME)
- return false;
if (!gimple_assign_copy_p (stmt))
return false;
+ if (TREE_CODE (gimple_assign_lhs (stmt)) == SSA_NAME)
+ return false;
operand = gimple_assign_rhs1 (stmt);
-
if (TREE_CODE (operand) != SSA_NAME)
return false;
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 57800075e94..5adc0da84da 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -6748,13 +6748,9 @@ test_for_singularity (enum tree_code cond_code, tree op0,
value range information we have for op0. */
if (min && max)
{
- if (compare_values (vr->min, min) == -1)
- min = min;
- else
+ if (compare_values (vr->min, min) == 1)
min = vr->min;
- if (compare_values (vr->max, max) == 1)
- max = max;
- else
+ if (compare_values (vr->max, max) == -1)
max = vr->max;
/* If the new min/max values have converged to a single value,
@@ -7237,7 +7233,7 @@ vrp_finalize (void)
}
/* We may have ended with ranges that have exactly one value. Those
- values can be substituted as any other copy/const propagated
+ values can be substituted as any other const propagated
value using substitute_and_fold. */
single_val_range = XCNEWVEC (prop_value_t, num_ssa_names);
@@ -7245,7 +7241,8 @@ vrp_finalize (void)
for (i = 0; i < num_ssa_names; i++)
if (vr_value[i]
&& vr_value[i]->type == VR_RANGE
- && vr_value[i]->min == vr_value[i]->max)
+ && vr_value[i]->min == vr_value[i]->max
+ && is_gimple_min_invariant (vr_value[i]->min))
{
single_val_range[i].value = vr_value[i]->min;
do_value_subst_p = true;
diff --git a/gcc/tree.c b/gcc/tree.c
index 315df903b30..f3970dd3a55 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -59,6 +59,7 @@ along with GCC; see the file COPYING3. If not see
#include "timevar.h"
#include "except.h"
#include "debug.h"
+#include "intl.h"
/* Tree code classes. */
@@ -152,6 +153,9 @@ static const char * const tree_node_kind_names[] = {
static GTY(()) int next_decl_uid;
/* Unique id for next type created. */
static GTY(()) int next_type_uid = 1;
+/* Unique id for next debug decl created. Use negative numbers,
+ to catch erroneous uses. */
+static GTY(()) int next_debug_decl_uid;
/* Since we cannot rehash a type after it is in the table, we have to
keep the hash code. */
@@ -284,6 +288,8 @@ tree_node_structure_for_code (enum tree_code code)
return TS_LABEL_DECL;
case RESULT_DECL:
return TS_RESULT_DECL;
+ case DEBUG_EXPR_DECL:
+ return TS_DECL_WRTL;
case CONST_DECL:
return TS_CONST_DECL;
case TYPE_DECL:
@@ -667,6 +673,8 @@ tree_code_size (enum tree_code code)
return sizeof (struct tree_type_decl);
case FUNCTION_DECL:
return sizeof (struct tree_function_decl);
+ case DEBUG_EXPR_DECL:
+ return sizeof (struct tree_decl_with_rtl);
default:
return sizeof (struct tree_decl_non_common);
}
@@ -872,7 +880,10 @@ make_node_stat (enum tree_code code MEM_STAT_DECL)
DECL_ALIGN (t) = 1;
}
DECL_SOURCE_LOCATION (t) = input_location;
- DECL_UID (t) = next_decl_uid++;
+ if (TREE_CODE (t) == DEBUG_EXPR_DECL)
+ DECL_UID (t) = --next_debug_decl_uid;
+ else
+ DECL_UID (t) = next_decl_uid++;
if (TREE_CODE (t) == LABEL_DECL)
LABEL_DECL_UID (t) = -1;
@@ -948,7 +959,10 @@ copy_node_stat (tree node MEM_STAT_DECL)
if (TREE_CODE_CLASS (code) == tcc_declaration)
{
- DECL_UID (t) = next_decl_uid++;
+ if (code == DEBUG_EXPR_DECL)
+ DECL_UID (t) = --next_debug_decl_uid;
+ else
+ DECL_UID (t) = next_decl_uid++;
if ((TREE_CODE (node) == PARM_DECL || TREE_CODE (node) == VAR_DECL)
&& DECL_HAS_VALUE_EXPR_P (node))
{
@@ -1670,8 +1684,7 @@ integer_pow2p (const_tree expr)
if (TREE_CODE (expr) != INTEGER_CST)
return 0;
- prec = (POINTER_TYPE_P (TREE_TYPE (expr))
- ? POINTER_SIZE : TYPE_PRECISION (TREE_TYPE (expr)));
+ prec = int_or_pointer_precision (TREE_TYPE (expr));
high = TREE_INT_CST_HIGH (expr);
low = TREE_INT_CST_LOW (expr);
@@ -1735,9 +1748,7 @@ tree_log2 (const_tree expr)
if (TREE_CODE (expr) == COMPLEX_CST)
return tree_log2 (TREE_REALPART (expr));
- prec = (POINTER_TYPE_P (TREE_TYPE (expr))
- ? POINTER_SIZE : TYPE_PRECISION (TREE_TYPE (expr)));
-
+ prec = int_or_pointer_precision (TREE_TYPE (expr));
high = TREE_INT_CST_HIGH (expr);
low = TREE_INT_CST_LOW (expr);
@@ -1773,9 +1784,7 @@ tree_floor_log2 (const_tree expr)
if (TREE_CODE (expr) == COMPLEX_CST)
return tree_log2 (TREE_REALPART (expr));
- prec = (POINTER_TYPE_P (TREE_TYPE (expr))
- ? POINTER_SIZE : TYPE_PRECISION (TREE_TYPE (expr)));
-
+ prec = int_or_pointer_precision (TREE_TYPE (expr));
high = TREE_INT_CST_HIGH (expr);
low = TREE_INT_CST_LOW (expr);
@@ -3939,9 +3948,9 @@ expanded_location
expand_location (source_location loc)
{
expanded_location xloc;
- if (loc == 0)
+ if (loc <= BUILTINS_LOCATION)
{
- xloc.file = NULL;
+ xloc.file = loc == UNKNOWN_LOCATION ? NULL : _("<built-in>");
xloc.line = 0;
xloc.column = 0;
xloc.sysp = 0;
@@ -4130,6 +4139,31 @@ build_type_attribute_variant (tree ttype, tree attribute)
TYPE_QUALS (ttype));
}
+
+/* Reset all the fields in a binfo node BINFO. We only keep
+ BINFO_VIRTUALS, which is used by gimple_fold_obj_type_ref. */
+
+static void
+free_lang_data_in_binfo (tree binfo)
+{
+ unsigned i;
+ tree t;
+
+ gcc_assert (TREE_CODE (binfo) == TREE_BINFO);
+
+ BINFO_OFFSET (binfo) = NULL_TREE;
+ BINFO_VTABLE (binfo) = NULL_TREE;
+ BINFO_VPTR_FIELD (binfo) = NULL_TREE;
+ BINFO_BASE_ACCESSES (binfo) = NULL;
+ BINFO_INHERITANCE_CHAIN (binfo) = NULL_TREE;
+ BINFO_SUBVTT_INDEX (binfo) = NULL_TREE;
+ BINFO_VPTR_FIELD (binfo) = NULL_TREE;
+
+ for (i = 0; VEC_iterate (tree, BINFO_BASE_BINFOS (binfo), i, t); i++)
+ free_lang_data_in_binfo (t);
+}
+
+
/* Reset all language specific information still present in TYPE. */
static void
@@ -4137,11 +4171,6 @@ free_lang_data_in_type (tree type)
{
gcc_assert (TYPE_P (type));
- /* Fill in the alias-set. We need to at least track zeroness here
- for correctness. */
- if (lang_hooks.get_alias_set (type) == 0)
- TYPE_ALIAS_SET (type) = 0;
-
/* Give the FE a chance to remove its own data first. */
lang_hooks.free_lang_data (type);
@@ -4179,9 +4208,7 @@ free_lang_data_in_type (tree type)
/* Remove members that are not actually FIELD_DECLs from the field
list of an aggregate. These occur in C++. */
- if (TREE_CODE (type) == RECORD_TYPE
- || TREE_CODE (type) == UNION_TYPE
- || TREE_CODE (type) == QUAL_UNION_TYPE)
+ if (RECORD_OR_UNION_TYPE_P (type))
{
tree prev, member;
@@ -4215,30 +4242,7 @@ free_lang_data_in_type (tree type)
TYPE_METHODS (type) = NULL_TREE;
if (TYPE_BINFO (type))
- {
- tree binfo = TYPE_BINFO (type);
-
- if (BINFO_VIRTUALS (binfo))
- {
- /* If the virtual function table for BINFO contains
- entries, these may be useful for folding OBJ_TYPE_REF
- expressions (see gimple_fold_obj_type_ref). In that
- case, we only clear the unused fields in the BINFO
- structure. */
- BINFO_OFFSET (binfo) = NULL_TREE;
- BINFO_VTABLE (binfo) = NULL_TREE;
- BINFO_VPTR_FIELD (binfo) = NULL_TREE;
- BINFO_BASE_ACCESSES (binfo) = NULL;
- BINFO_INHERITANCE_CHAIN (binfo) = NULL_TREE;
- BINFO_SUBVTT_INDEX (binfo) = NULL_TREE;
- BINFO_VPTR_FIELD (binfo) = NULL_TREE;
- }
- else
- {
- /* Otherwise, get rid of the whole binfo data. */
- TYPE_BINFO (type) = NULL_TREE;
- }
- }
+ free_lang_data_in_binfo (TYPE_BINFO (type));
}
else
{
@@ -4276,19 +4280,22 @@ need_assembler_name_p (tree decl)
&& !DECL_EXTERNAL (decl))
return false;
- /* Do not set assembler name on builtins. Allow RTL expansion to
- decide whether to expand inline or via a regular call. */
- if (TREE_CODE (decl) == FUNCTION_DECL
- && DECL_BUILT_IN (decl)
- && DECL_BUILT_IN_CLASS (decl) != BUILT_IN_FRONTEND)
- return false;
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ {
+ /* Do not set assembler name on builtins. Allow RTL expansion to
+ decide whether to expand inline or via a regular call. */
+ if (DECL_BUILT_IN (decl)
+ && DECL_BUILT_IN_CLASS (decl) != BUILT_IN_FRONTEND)
+ return false;
- /* For FUNCTION_DECLs, only used functions and functions
- represented in the callgraph need an assembler name. */
- if (TREE_CODE (decl) == FUNCTION_DECL
- && cgraph_node_for_decl (decl) == NULL
- && !TREE_USED (decl))
- return false;
+ /* Functions represented in the callgraph need an assembler name. */
+ if (cgraph_node_for_decl (decl) != NULL)
+ return true;
+
+ /* Unused and not public functions don't need an assembler name. */
+ if (!TREE_USED (decl) && !TREE_PUBLIC (decl))
+ return false;
+ }
return true;
}
@@ -4340,9 +4347,6 @@ free_lang_data_in_decl (tree decl)
if (DECL_NAME (decl))
TREE_TYPE (DECL_NAME (decl)) = NULL_TREE;
- if (TREE_CODE (decl) == CONST_DECL)
- DECL_CONTEXT (decl) = NULL_TREE;
-
/* Ignore any intervening types, because we are going to clear their
TYPE_CONTEXT fields. */
if (TREE_CODE (decl) != FIELD_DECL)
@@ -4388,6 +4392,10 @@ free_lang_data_in_decl (tree decl)
&& DECL_FIELD_OFFSET (decl)
&& TREE_CODE (DECL_FIELD_OFFSET (decl)) != INTEGER_CST)
DECL_FIELD_OFFSET (decl) = NULL_TREE;
+
+ /* DECL_FCONTEXT is only used for debug info generation. */
+ if (TREE_CODE (decl) == FIELD_DECL)
+ DECL_FCONTEXT (decl) = NULL_TREE;
}
else if (TREE_CODE (decl) == FUNCTION_DECL)
{
@@ -4438,7 +4446,8 @@ free_lang_data_in_decl (tree decl)
&& !TREE_STATIC (expr) && !DECL_EXTERNAL (expr))
SET_DECL_DEBUG_EXPR (decl, NULL_TREE);
- if (DECL_EXTERNAL (decl))
+ if (DECL_EXTERNAL (decl)
+ && (!TREE_STATIC (decl) || !TREE_READONLY (decl)))
DECL_INITIAL (decl) = NULL_TREE;
}
else if (TREE_CODE (decl) == TYPE_DECL)
@@ -4522,15 +4531,21 @@ add_tree_to_fld_list (tree t, struct free_lang_data_d *fld)
gcc_unreachable ();
}
-#define PUSH(t) \
- if (t && !pointer_set_contains (fld->pset, t)) \
- VEC_safe_push (tree, heap, fld->worklist, (t))
+/* Push tree node T into FLD->WORKLIST. */
+
+static inline void
+fld_worklist_push (tree t, struct free_lang_data_d *fld)
+{
+ if (t && !is_lang_specific (t) && !pointer_set_contains (fld->pset, t))
+ VEC_safe_push (tree, heap, fld->worklist, (t));
+}
+
/* Operand callback helper for free_lang_data_in_node. *TP is the
subtree operand being considered. */
static tree
-find_decls_types_r (tree *tp, int *ws ATTRIBUTE_UNUSED, void *data)
+find_decls_types_r (tree *tp, int *ws, void *data)
{
tree t = *tp;
struct free_lang_data_d *fld = (struct free_lang_data_d *) data;
@@ -4538,45 +4553,59 @@ find_decls_types_r (tree *tp, int *ws ATTRIBUTE_UNUSED, void *data)
if (TREE_CODE (t) == TREE_LIST)
return NULL_TREE;
+ /* Language specific nodes will be removed, so there is no need
+ to gather anything under them. */
+ if (is_lang_specific (t))
+ {
+ *ws = 0;
+ return NULL_TREE;
+ }
+
if (DECL_P (t))
{
/* Note that walk_tree does not traverse every possible field in
decls, so we have to do our own traversals here. */
add_tree_to_fld_list (t, fld);
- PUSH (DECL_NAME (t));
- PUSH (DECL_CONTEXT (t));
- PUSH (DECL_SIZE (t));
- PUSH (DECL_SIZE_UNIT (t));
- PUSH (DECL_INITIAL(t));
- PUSH (DECL_ATTRIBUTES (t));
- PUSH (DECL_ABSTRACT_ORIGIN (t));
+ fld_worklist_push (DECL_NAME (t), fld);
+ fld_worklist_push (DECL_CONTEXT (t), fld);
+ fld_worklist_push (DECL_SIZE (t), fld);
+ fld_worklist_push (DECL_SIZE_UNIT (t), fld);
+
+ /* We are going to remove everything under DECL_INITIAL for
+ TYPE_DECLs. No point walking them. */
+ if (TREE_CODE (t) != TYPE_DECL)
+ fld_worklist_push (DECL_INITIAL (t), fld);
+
+ fld_worklist_push (DECL_ATTRIBUTES (t), fld);
+ fld_worklist_push (DECL_ABSTRACT_ORIGIN (t), fld);
if (TREE_CODE (t) == FUNCTION_DECL)
{
- PUSH (DECL_ARGUMENTS (t));
- PUSH (DECL_RESULT (t));
+ fld_worklist_push (DECL_ARGUMENTS (t), fld);
+ fld_worklist_push (DECL_RESULT (t), fld);
}
else if (TREE_CODE (t) == TYPE_DECL)
{
- PUSH (DECL_ARGUMENT_FLD (t));
- PUSH (DECL_VINDEX (t));
+ fld_worklist_push (DECL_ARGUMENT_FLD (t), fld);
+ fld_worklist_push (DECL_VINDEX (t), fld);
}
else if (TREE_CODE (t) == FIELD_DECL)
{
- PUSH (DECL_FIELD_OFFSET (t));
- PUSH (DECL_BIT_FIELD_TYPE (t));
- PUSH (DECL_QUALIFIER (t));
- PUSH (DECL_FIELD_BIT_OFFSET (t));
- PUSH (DECL_FCONTEXT (t));
+ fld_worklist_push (DECL_FIELD_OFFSET (t), fld);
+ fld_worklist_push (DECL_BIT_FIELD_TYPE (t), fld);
+ fld_worklist_push (DECL_QUALIFIER (t), fld);
+ fld_worklist_push (DECL_FIELD_BIT_OFFSET (t), fld);
+ fld_worklist_push (DECL_FCONTEXT (t), fld);
}
else if (TREE_CODE (t) == VAR_DECL)
{
- PUSH (DECL_SECTION_NAME (t));
- PUSH (DECL_COMDAT_GROUP (t));
+ fld_worklist_push (DECL_SECTION_NAME (t), fld);
+ fld_worklist_push (DECL_COMDAT_GROUP (t), fld);
}
- PUSH (TREE_CHAIN (t));
+ if (TREE_CODE (t) != FIELD_DECL)
+ fld_worklist_push (TREE_CHAIN (t), fld);
*ws = 0;
}
else if (TYPE_P (t))
@@ -4585,40 +4614,63 @@ find_decls_types_r (tree *tp, int *ws ATTRIBUTE_UNUSED, void *data)
types, so we have to do our own traversals here. */
add_tree_to_fld_list (t, fld);
- PUSH (TYPE_CACHED_VALUES (t));
- PUSH (TYPE_SIZE (t));
- PUSH (TYPE_SIZE_UNIT (t));
- PUSH (TYPE_ATTRIBUTES (t));
- PUSH (TYPE_POINTER_TO (t));
- PUSH (TYPE_REFERENCE_TO (t));
- PUSH (TYPE_NAME (t));
- PUSH (TYPE_MINVAL (t));
- PUSH (TYPE_MAXVAL (t));
- PUSH (TYPE_MAIN_VARIANT (t));
- PUSH (TYPE_NEXT_VARIANT (t));
- PUSH (TYPE_CONTEXT (t));
- PUSH (TYPE_CANONICAL (t));
-
- if (RECORD_OR_UNION_TYPE_P (t)
- && TYPE_BINFO (t))
+ if (!RECORD_OR_UNION_TYPE_P (t))
+ fld_worklist_push (TYPE_CACHED_VALUES (t), fld);
+ fld_worklist_push (TYPE_SIZE (t), fld);
+ fld_worklist_push (TYPE_SIZE_UNIT (t), fld);
+ fld_worklist_push (TYPE_ATTRIBUTES (t), fld);
+ fld_worklist_push (TYPE_POINTER_TO (t), fld);
+ fld_worklist_push (TYPE_REFERENCE_TO (t), fld);
+ fld_worklist_push (TYPE_NAME (t), fld);
+ fld_worklist_push (TYPE_MINVAL (t), fld);
+ if (!RECORD_OR_UNION_TYPE_P (t))
+ fld_worklist_push (TYPE_MAXVAL (t), fld);
+ fld_worklist_push (TYPE_MAIN_VARIANT (t), fld);
+ fld_worklist_push (TYPE_NEXT_VARIANT (t), fld);
+ fld_worklist_push (TYPE_CONTEXT (t), fld);
+ fld_worklist_push (TYPE_CANONICAL (t), fld);
+
+ if (RECORD_OR_UNION_TYPE_P (t) && TYPE_BINFO (t))
{
unsigned i;
tree tem;
for (i = 0; VEC_iterate (tree, BINFO_BASE_BINFOS (TYPE_BINFO (t)),
i, tem); ++i)
- PUSH (TREE_TYPE (tem));
+ fld_worklist_push (TREE_TYPE (tem), fld);
+ tem = BINFO_VIRTUALS (TYPE_BINFO (t));
+ if (tem
+ /* The Java FE overloads BINFO_VIRTUALS for its own purpose. */
+ && TREE_CODE (tem) == TREE_LIST)
+ do
+ {
+ fld_worklist_push (TREE_VALUE (tem), fld);
+ tem = TREE_CHAIN (tem);
+ }
+ while (tem);
+ }
+ if (RECORD_OR_UNION_TYPE_P (t))
+ {
+ tree tem;
+ /* Push all TYPE_FIELDS - there can be interleaving interesting
+ and non-interesting things. */
+ tem = TYPE_FIELDS (t);
+ while (tem)
+ {
+ if (TREE_CODE (tem) == FIELD_DECL)
+ fld_worklist_push (tem, fld);
+ tem = TREE_CHAIN (tem);
+ }
}
- PUSH (TREE_CHAIN (t));
+ fld_worklist_push (TREE_CHAIN (t), fld);
*ws = 0;
}
- PUSH (TREE_TYPE (t));
+ fld_worklist_push (TREE_TYPE (t), fld);
return NULL_TREE;
}
-#undef PUSH
/* Find decls and types in T. */
@@ -4867,6 +4919,20 @@ free_lang_data_in_cgraph (void)
static unsigned
free_lang_data (void)
{
+ unsigned i;
+
+ /* Allocate and assign alias sets to the standard integer types
+ while the slots are still in the way the frontends generated them. */
+ for (i = 0; i < itk_none; ++i)
+ if (integer_types[i])
+ TYPE_ALIAS_SET (integer_types[i]) = get_alias_set (integer_types[i]);
+
+ /* FIXME. Remove after save_debug_info is working. */
+ if (!(flag_generate_lto
+ || (!in_lto_p
+ && !flag_gtoggle && debug_info_level <= DINFO_LEVEL_TERSE)))
+ return 0;
+
/* Traverse the IL resetting language specific information for
operands, expressions, etc. */
free_lang_data_in_cgraph ();
@@ -4894,9 +4960,9 @@ free_lang_data (void)
else
signed_char_type_node = char_type_node;
- /* Reset some langhooks. */
+ /* Reset some langhooks. Do not reset types_compatible_p, it may
+ still be used indirectly via the get_alias_set langhook. */
lang_hooks.callgraph.analyze_expr = NULL;
- lang_hooks.types_compatible_p = NULL;
lang_hooks.dwarf_name = lhd_dwarf_name;
lang_hooks.decl_printable_name = gimple_decl_printable_name;
lang_hooks.set_decl_assembler_name = lhd_set_decl_assembler_name;
@@ -4907,17 +4973,14 @@ free_lang_data (void)
diagnostic_finalizer (global_dc) = default_diagnostic_finalizer;
diagnostic_format_decoder (global_dc) = default_tree_printer;
- return 0;
-}
-
+ /* FIXME. We remove sufficient language data that the debug
+ info writer gets completely confused. Disable debug information
+ for now. */
+ debug_info_level = DINFO_LEVEL_NONE;
+ write_symbols = NO_DEBUG;
+ debug_hooks = &do_nothing_debug_hooks;
-/* Gate function for free_lang_data. */
-
-static bool
-gate_free_lang_data (void)
-{
- /* FIXME. Remove after save_debug_info is working. */
- return !flag_gtoggle && debug_info_level <= DINFO_LEVEL_TERSE;
+ return 0;
}
@@ -4926,7 +4989,7 @@ struct simple_ipa_opt_pass pass_ipa_free_lang_data =
{
SIMPLE_IPA_PASS,
NULL, /* name */
- gate_free_lang_data, /* gate */
+ NULL, /* gate */
free_lang_data, /* execute */
NULL, /* sub */
NULL, /* next */
@@ -5353,6 +5416,7 @@ set_type_quals (tree type, int type_quals)
TYPE_READONLY (type) = (type_quals & TYPE_QUAL_CONST) != 0;
TYPE_VOLATILE (type) = (type_quals & TYPE_QUAL_VOLATILE) != 0;
TYPE_RESTRICT (type) = (type_quals & TYPE_QUAL_RESTRICT) != 0;
+ TYPE_ADDR_SPACE (type) = DECODE_QUAL_ADDR_SPACE (type_quals);
}
/* Returns true iff CAND is equivalent to BASE with TYPE_QUALS. */
@@ -6674,7 +6738,10 @@ build_pointer_type_for_mode (tree to_type, enum machine_mode mode,
tree
build_pointer_type (tree to_type)
{
- return build_pointer_type_for_mode (to_type, ptr_mode, false);
+ addr_space_t as = to_type == error_mark_node? ADDR_SPACE_GENERIC
+ : TYPE_ADDR_SPACE (to_type);
+ enum machine_mode pointer_mode = targetm.addr_space.pointer_mode (as);
+ return build_pointer_type_for_mode (to_type, pointer_mode, false);
}
/* Same as build_pointer_type_for_mode, but for REFERENCE_TYPE. */
@@ -6738,7 +6805,10 @@ build_reference_type_for_mode (tree to_type, enum machine_mode mode,
tree
build_reference_type (tree to_type)
{
- return build_reference_type_for_mode (to_type, ptr_mode, false);
+ addr_space_t as = to_type == error_mark_node? ADDR_SPACE_GENERIC
+ : TYPE_ADDR_SPACE (to_type);
+ enum machine_mode pointer_mode = targetm.addr_space.pointer_mode (as);
+ return build_reference_type_for_mode (to_type, pointer_mode, false);
}
/* Build a type that is compatible with t but has no cv quals anywhere
@@ -6932,6 +7002,7 @@ build_array_type (tree elt_type, tree index_type)
t = make_node (ARRAY_TYPE);
TREE_TYPE (t) = elt_type;
TYPE_DOMAIN (t) = index_type;
+ TYPE_ADDR_SPACE (t) = TYPE_ADDR_SPACE (elt_type);
layout_type (t);
/* If the element type is incomplete at this point we get marked for
@@ -8938,7 +9009,8 @@ build_common_builtin_nodes (void)
tmp = tree_cons (NULL_TREE, size_type_node, void_list_node);
ftype = build_function_type (ptr_type_node, tmp);
local_define_builtin ("__builtin_alloca", ftype, BUILT_IN_ALLOCA,
- "alloca", ECF_NOTHROW | ECF_MALLOC);
+ "alloca",
+ ECF_MALLOC | (flag_stack_check ? 0 : ECF_NOTHROW));
}
tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
@@ -9602,7 +9674,19 @@ signed_or_unsigned_type_for (int unsignedp, tree type)
{
tree t = type;
if (POINTER_TYPE_P (type))
- t = size_type_node;
+ {
+ /* If the pointer points to the normal address space, use the
+ size_type_node. Otherwise use an appropriate size for the pointer
+ based on the named address space it points to. */
+ if (!TYPE_ADDR_SPACE (TREE_TYPE (t)))
+ t = size_type_node;
+
+ else
+ {
+ int prec = int_or_pointer_precision (t);
+ return lang_hooks.types.type_for_size (prec, unsignedp);
+ }
+ }
if (!INTEGRAL_TYPE_P (t) || TYPE_UNSIGNED (t) == unsignedp)
return t;
@@ -10110,9 +10194,7 @@ walk_tree_1 (tree *tp, walk_tree_fn func, void *data,
return result;
/* If this is a record type, also walk the fields. */
- if (TREE_CODE (*type_p) == RECORD_TYPE
- || TREE_CODE (*type_p) == UNION_TYPE
- || TREE_CODE (*type_p) == QUAL_UNION_TYPE)
+ if (RECORD_OR_UNION_TYPE_P (*type_p))
{
tree field;
@@ -10478,6 +10560,41 @@ build_target_option_node (void)
return t;
}
+/* Return the size in bits of an integer or pointer type. TYPE_PRECISION
+ contains the bits, but in the past it was not set in some cases and there
+ was special purpose code that checked for POINTER_TYPE_P or OFFSET_TYPE, so
+ check that it is consitant when assertion checking is used. */
+
+unsigned int
+int_or_pointer_precision (const_tree type)
+{
+#if ENABLE_ASSERT_CHECKING
+ unsigned int prec;
+
+ if (POINTER_TYPE_P (type))
+ {
+ addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (type));
+ prec = GET_MODE_BITSIZE (targetm.addr_space.pointer_mode (as));
+ gcc_assert (prec == TYPE_PRECISION (type));
+ }
+ else if (TREE_CODE (type) == OFFSET_TYPE)
+ {
+ prec = POINTER_SIZE;
+ gcc_assert (prec == TYPE_PRECISION (type));
+ }
+ else
+ {
+ prec = TYPE_PRECISION (type);
+ gcc_assert (prec != 0);
+ }
+
+ return prec;
+
+#else
+ return TYPE_PRECISION (type);
+#endif
+}
+
/* Determine the "ultimate origin" of a block. The block may be an inlined
instance of an inlined instance of a block which is local to an inline
function, so we have to trace all of the way back through the origin chain
diff --git a/gcc/tree.def b/gcc/tree.def
index c1ba96aa966..01d9b3060de 100644
--- a/gcc/tree.def
+++ b/gcc/tree.def
@@ -351,6 +351,10 @@ DEFTREECODE (PARM_DECL, "parm_decl", tcc_declaration, 0)
DEFTREECODE (TYPE_DECL, "type_decl", tcc_declaration, 0)
DEFTREECODE (RESULT_DECL, "result_decl", tcc_declaration, 0)
+/* A "declaration" of a debug temporary. It should only appear in
+ DEBUG stmts. */
+DEFTREECODE (DEBUG_EXPR_DECL, "debug_expr_decl", tcc_declaration, 0)
+
/* A namespace declaration. Namespaces appear in DECL_CONTEXT of other
_DECLs, providing a hierarchy of names. */
DEFTREECODE (NAMESPACE_DECL, "namespace_decl", tcc_declaration, 0)
@@ -748,6 +752,10 @@ DEFTREECODE (PAREN_EXPR, "paren_expr", tcc_unary, 1)
represented by CONVERT_EXPR or NOP_EXPR nodes. */
DEFTREECODE (CONVERT_EXPR, "convert_expr", tcc_unary, 1)
+/* Conversion of a pointer value to a pointer to a different
+ address space. */
+DEFTREECODE (ADDR_SPACE_CONVERT_EXPR, "addr_space_convert_expr", tcc_unary, 1)
+
/* Conversion of a fixed-point value to an integer, a real, or a fixed-point
value. Or conversion of a fixed-point value from an integer, a real, or
a fixed-point value. */
@@ -959,9 +967,9 @@ DEFTREECODE (REALIGN_LOAD_EXPR, "realign_load", tcc_expression, 3)
The type of STEP, INDEX and OFFSET is sizetype. The type of BASE is
sizetype or a pointer type (if SYMBOL is NULL).
-
+
The sixth argument is the reference to the original memory access, which
- is preserved for the purposes of the RTL alias analysis. */
+ is preserved for the purpose of alias analysis. */
DEFTREECODE (TARGET_MEM_REF, "target_mem_ref", tcc_reference, 6)
diff --git a/gcc/tree.h b/gcc/tree.h
index 7e2e88b2a42..36deb0d51e5 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -392,7 +392,12 @@ struct GTY(()) tree_base {
unsigned packed_flag : 1;
unsigned user_align : 1;
- unsigned spare : 21;
+ unsigned spare : 13;
+
+ /* This field is only used with type nodes; the only reason it is present
+ in tree_base instead of tree_type is to save space. The size of the
+ field must be large enough to hold addr_space_t values. */
+ unsigned address_space : 8;
union tree_ann_d *ann;
};
@@ -2169,6 +2174,9 @@ extern enum machine_mode vector_type_mode (const_tree);
the term. */
#define TYPE_RESTRICT(NODE) (TYPE_CHECK (NODE)->type.restrict_flag)
+/* The address space the type is in. */
+#define TYPE_ADDR_SPACE(NODE) (TYPE_CHECK (NODE)->base.address_space)
+
/* There is a TYPE_QUAL value for each type qualifier. They can be
combined by bitwise-or to form the complete set of qualifiers for a
type. */
@@ -2178,10 +2186,29 @@ extern enum machine_mode vector_type_mode (const_tree);
#define TYPE_QUAL_VOLATILE 0x2
#define TYPE_QUAL_RESTRICT 0x4
+/* Encode/decode the named memory support as part of the qualifier. If more
+ than 8 qualifiers are added, these macros need to be adjusted. */
+#define ENCODE_QUAL_ADDR_SPACE(NUM) ((NUM & 0xFF) << 8)
+#define DECODE_QUAL_ADDR_SPACE(X) (((X) >> 8) & 0xFF)
+
+/* Return all qualifiers except for the address space qualifiers. */
+#define CLEAR_QUAL_ADDR_SPACE(X) ((X) & ~0xFF00)
+
+/* Only keep the address space out of the qualifiers and discard the other
+ qualifiers. */
+#define KEEP_QUAL_ADDR_SPACE(X) ((X) & 0xFF00)
+
/* The set of type qualifiers for this type. */
#define TYPE_QUALS(NODE) \
((TYPE_READONLY (NODE) * TYPE_QUAL_CONST) \
| (TYPE_VOLATILE (NODE) * TYPE_QUAL_VOLATILE) \
+ | (TYPE_RESTRICT (NODE) * TYPE_QUAL_RESTRICT) \
+ | (ENCODE_QUAL_ADDR_SPACE (TYPE_ADDR_SPACE (NODE))))
+
+/* The same as TYPE_QUALS without the address space qualifications. */
+#define TYPE_QUALS_NO_ADDR_SPACE(NODE) \
+ ((TYPE_READONLY (NODE) * TYPE_QUAL_CONST) \
+ | (TYPE_VOLATILE (NODE) * TYPE_QUAL_VOLATILE) \
| (TYPE_RESTRICT (NODE) * TYPE_QUAL_RESTRICT))
/* These flags are available for each language front end to use internally. */
@@ -2455,6 +2482,10 @@ struct function;
/* Every ..._DECL node gets a unique number. */
#define DECL_UID(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.uid)
+/* DEBUG_EXPR_DECLs get negative UID numbers, to catch erroneous
+ uses. */
+#define DEBUG_TEMP_UID(NODE) (-DECL_UID (TREE_CHECK ((NODE), DEBUG_EXPR_DECL)))
+
/* These two fields describe where in the source code the declaration
was. If the declaration appears in several places (as for a C
function that is declared first and then defined later), this
@@ -4672,6 +4703,7 @@ extern const char *get_name (tree);
extern bool stdarg_p (tree);
extern bool prototype_p (tree);
extern bool auto_var_in_fn_p (const_tree, const_tree);
+extern unsigned int int_or_pointer_precision (const_tree);
extern tree build_low_bits_mask (tree, unsigned);
extern tree tree_strip_nop_conversions (tree);
extern tree tree_strip_sign_nop_conversions (tree);
@@ -4906,7 +4938,8 @@ extern bool validate_arglist (const_tree, ...);
extern rtx builtin_memset_read_str (void *, HOST_WIDE_INT, enum machine_mode);
extern bool can_trust_pointer_alignment (void);
extern int get_pointer_alignment (tree, unsigned int);
-extern bool is_builtin_name (const char*);
+extern bool is_builtin_name (const char *);
+extern bool is_builtin_fn (tree);
extern int get_object_alignment (tree, unsigned int, unsigned int);
extern tree fold_call_stmt (gimple, bool);
extern tree gimple_fold_builtin_snprintf_chk (gimple, tree, enum built_in_function);
@@ -4914,6 +4947,7 @@ extern tree make_range (tree, int *, tree *, tree *, bool *);
extern tree build_range_check (location_t, tree, tree, int, tree, tree);
extern bool merge_ranges (int *, tree *, tree *, int, tree, tree, int,
tree, tree);
+extern void set_builtin_user_assembler_name (tree decl, const char *asmspec);
/* In convert.c */
extern tree strip_float_extensions (tree);
@@ -5409,4 +5443,11 @@ more_const_call_expr_args_p (const const_call_expr_arg_iterator *iter)
for ((arg) = first_const_call_expr_arg ((call), &(iter)); (arg); \
(arg) = next_const_call_expr_arg (&(iter)))
+/* Return true if tree node T is a language-specific node. */
+static inline bool
+is_lang_specific (tree t)
+{
+ return TREE_CODE (t) == LANG_TYPE || TREE_CODE (t) >= NUM_TREE_CODES;
+}
+
#endif /* GCC_TREE_H */
diff --git a/gcc/unwind-dw2.c b/gcc/unwind-dw2.c
index a86c21b7129..2208f17dc1d 100644
--- a/gcc/unwind-dw2.c
+++ b/gcc/unwind-dw2.c
@@ -789,22 +789,22 @@ execute_stack_op (const unsigned char *op_ptr, const unsigned char *op_end,
result = second ^ first;
break;
case DW_OP_le:
- result = (_Unwind_Sword) first <= (_Unwind_Sword) second;
+ result = (_Unwind_Sword) second <= (_Unwind_Sword) first;
break;
case DW_OP_ge:
- result = (_Unwind_Sword) first >= (_Unwind_Sword) second;
+ result = (_Unwind_Sword) second >= (_Unwind_Sword) first;
break;
case DW_OP_eq:
- result = (_Unwind_Sword) first == (_Unwind_Sword) second;
+ result = (_Unwind_Sword) second == (_Unwind_Sword) first;
break;
case DW_OP_lt:
- result = (_Unwind_Sword) first < (_Unwind_Sword) second;
+ result = (_Unwind_Sword) second < (_Unwind_Sword) first;
break;
case DW_OP_gt:
- result = (_Unwind_Sword) first > (_Unwind_Sword) second;
+ result = (_Unwind_Sword) second > (_Unwind_Sword) first;
break;
case DW_OP_ne:
- result = (_Unwind_Sword) first != (_Unwind_Sword) second;
+ result = (_Unwind_Sword) second != (_Unwind_Sword) first;
break;
default:
@@ -1559,7 +1559,13 @@ uw_install_context_1 (struct _Unwind_Context *current,
static inline _Unwind_Ptr
uw_identify_context (struct _Unwind_Context *context)
{
- return _Unwind_GetCFA (context);
+ /* The CFA is not sufficient to disambiguate the context of a function
+ interrupted by a signal before establishing its frame and the context
+ of the signal itself. */
+ if (STACK_GROWS_DOWNWARD)
+ return _Unwind_GetCFA (context) - _Unwind_IsSignalFrame (context);
+ else
+ return _Unwind_GetCFA (context) + _Unwind_IsSignalFrame (context);
}
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index bdd3bdee34e..5cc8ced3956 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -732,6 +732,7 @@ dv_is_decl_p (decl_or_value dv)
case (int)PARM_DECL:
case (int)RESULT_DECL:
case (int)FUNCTION_DECL:
+ case (int)DEBUG_EXPR_DECL:
case (int)COMPONENT_REF:
return true;
@@ -2222,7 +2223,7 @@ dataflow_set_union (dataflow_set *dst, dataflow_set *src)
/* Whether the value is currently being expanded. */
#define VALUE_RECURSED_INTO(x) \
- (RTL_FLAG_CHECK1 ("VALUE_RECURSED_INTO", (x), VALUE)->used)
+ (RTL_FLAG_CHECK2 ("VALUE_RECURSED_INTO", (x), VALUE, DEBUG_EXPR)->used)
/* Whether the value is in changed_variables hash table. */
#define VALUE_CHANGED(x) \
(RTL_FLAG_CHECK1 ("VALUE_CHANGED", (x), VALUE)->frame_related)
@@ -4112,6 +4113,9 @@ track_expr_p (tree expr, bool need_rtl)
rtx decl_rtl;
tree realdecl;
+ if (TREE_CODE (expr) == DEBUG_EXPR_DECL)
+ return DECL_RTL_SET_P (expr);
+
/* If EXPR is not a parameter or a variable do not track it. */
if (TREE_CODE (expr) != VAR_DECL && TREE_CODE (expr) != PARM_DECL)
return 0;
@@ -4355,7 +4359,9 @@ replace_expr_with_values (rtx loc)
return NULL;
else if (MEM_P (loc))
{
- cselib_val *addr = cselib_lookup (XEXP (loc, 0), Pmode, 0);
+ enum machine_mode address_mode
+ = targetm.addr_space.address_mode (MEM_ADDR_SPACE (loc));
+ cselib_val *addr = cselib_lookup (XEXP (loc, 0), address_mode, 0);
if (addr)
return replace_equiv_address_nv (loc, addr->val_rtx);
else
@@ -4489,7 +4495,9 @@ count_uses (rtx *loc, void *cuip)
if (MEM_P (*loc)
&& !REG_P (XEXP (*loc, 0)) && !MEM_P (XEXP (*loc, 0)))
{
- val = cselib_lookup (XEXP (*loc, 0), Pmode, false);
+ enum machine_mode address_mode
+ = targetm.addr_space.address_mode (MEM_ADDR_SPACE (*loc));
+ val = cselib_lookup (XEXP (*loc, 0), address_mode, false);
if (val && !cselib_preserved_value_p (val))
{
@@ -4609,7 +4617,10 @@ add_uses (rtx *loc, void *data)
&& !REG_P (XEXP (vloc, 0)) && !MEM_P (XEXP (vloc, 0)))
{
rtx mloc = vloc;
- cselib_val *val = cselib_lookup (XEXP (mloc, 0), Pmode, 0);
+ enum machine_mode address_mode
+ = targetm.addr_space.address_mode (MEM_ADDR_SPACE (mloc));
+ cselib_val *val
+ = cselib_lookup (XEXP (mloc, 0), address_mode, 0);
if (val && !cselib_preserved_value_p (val))
{
@@ -4620,7 +4631,8 @@ add_uses (rtx *loc, void *data)
cselib_preserve_value (val);
mo->type = MO_VAL_USE;
mloc = cselib_subst_to_values (XEXP (mloc, 0));
- mo->u.loc = gen_rtx_CONCAT (Pmode, val->val_rtx, mloc);
+ mo->u.loc = gen_rtx_CONCAT (address_mode,
+ val->val_rtx, mloc);
if (dump_file && (dump_flags & TDF_DETAILS))
log_op_type (mo->u.loc, cui->bb, cui->insn,
mo->type, dump_file);
@@ -4676,7 +4688,10 @@ add_uses (rtx *loc, void *data)
&& !REG_P (XEXP (oloc, 0)) && !MEM_P (XEXP (oloc, 0)))
{
rtx mloc = oloc;
- cselib_val *val = cselib_lookup (XEXP (mloc, 0), Pmode, 0);
+ enum machine_mode address_mode
+ = targetm.addr_space.address_mode (MEM_ADDR_SPACE (mloc));
+ cselib_val *val
+ = cselib_lookup (XEXP (mloc, 0), address_mode, 0);
if (val && !cselib_preserved_value_p (val))
{
@@ -4687,7 +4702,8 @@ add_uses (rtx *loc, void *data)
cselib_preserve_value (val);
mo->type = MO_VAL_USE;
mloc = cselib_subst_to_values (XEXP (mloc, 0));
- mo->u.loc = gen_rtx_CONCAT (Pmode, val->val_rtx, mloc);
+ mo->u.loc = gen_rtx_CONCAT (address_mode,
+ val->val_rtx, mloc);
mo->insn = cui->insn;
if (dump_file && (dump_flags & TDF_DETAILS))
log_op_type (mo->u.loc, cui->bb, cui->insn,
@@ -4820,14 +4836,16 @@ add_stores (rtx loc, const_rtx expr, void *cuip)
&& !REG_P (XEXP (loc, 0)) && !MEM_P (XEXP (loc, 0)))
{
rtx mloc = loc;
- cselib_val *val = cselib_lookup (XEXP (mloc, 0), Pmode, 0);
+ enum machine_mode address_mode
+ = targetm.addr_space.address_mode (MEM_ADDR_SPACE (mloc));
+ cselib_val *val = cselib_lookup (XEXP (mloc, 0), address_mode, 0);
if (val && !cselib_preserved_value_p (val))
{
cselib_preserve_value (val);
mo->type = MO_VAL_USE;
mloc = cselib_subst_to_values (XEXP (mloc, 0));
- mo->u.loc = gen_rtx_CONCAT (Pmode, val->val_rtx, mloc);
+ mo->u.loc = gen_rtx_CONCAT (address_mode, val->val_rtx, mloc);
mo->insn = cui->insn;
if (dump_file && (dump_flags & TDF_DETAILS))
log_op_type (mo->u.loc, cui->bb, cui->insn,
@@ -6242,24 +6260,6 @@ delete_variable_part (dataflow_set *set, rtx loc, decl_or_value dv,
slot = delete_slot_part (set, loc, slot, offset);
}
-/* Wrap result in CONST:MODE if needed to preserve the mode. */
-
-static rtx
-check_wrap_constant (enum machine_mode mode, rtx result)
-{
- if (!result || GET_MODE (result) == mode)
- return result;
-
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, " wrapping result in const to preserve mode %s\n",
- GET_MODE_NAME (mode));
-
- result = wrap_constant (mode, result);
- gcc_assert (GET_MODE (result) == mode);
-
- return result;
-}
-
/* Callback for cselib_expand_value, that looks for expressions
holding the value in the var-tracking hash tables. Return X for
standard processing, anything else is to be used as-is. */
@@ -6271,11 +6271,12 @@ vt_expand_loc_callback (rtx x, bitmap regs, int max_depth, void *data)
decl_or_value dv;
variable var;
location_chain loc;
- rtx result;
+ rtx result, subreg, xret;
- if (GET_CODE (x) == SUBREG)
+ switch (GET_CODE (x))
{
- rtx subreg = SUBREG_REG (x);
+ case SUBREG:
+ subreg = SUBREG_REG (x);
if (GET_CODE (SUBREG_REG (x)) != VALUE)
return x;
@@ -6297,22 +6298,31 @@ vt_expand_loc_callback (rtx x, bitmap regs, int max_depth, void *data)
result = gen_rtx_raw_SUBREG (GET_MODE (x), subreg, SUBREG_BYTE (x));
return result;
- }
- if (GET_CODE (x) != VALUE)
- return x;
+ case DEBUG_EXPR:
+ dv = dv_from_decl (DEBUG_EXPR_TREE_DECL (x));
+ xret = NULL;
+ break;
+
+ case VALUE:
+ dv = dv_from_value (x);
+ xret = x;
+ break;
+
+ default:
+ return x;
+ }
if (VALUE_RECURSED_INTO (x))
- return x;
+ return NULL;
- dv = dv_from_value (x);
var = (variable) htab_find_with_hash (vars, dv, dv_htab_hash (dv));
if (!var)
- return x;
+ return xret;
if (var->n_var_parts == 0)
- return x;
+ return xret;
gcc_assert (var->n_var_parts == 1);
@@ -6323,7 +6333,6 @@ vt_expand_loc_callback (rtx x, bitmap regs, int max_depth, void *data)
{
result = cselib_expand_value_rtx_cb (loc->loc, regs, max_depth,
vt_expand_loc_callback, vars);
- result = check_wrap_constant (GET_MODE (loc->loc), result);
if (result)
break;
}
@@ -6332,7 +6341,7 @@ vt_expand_loc_callback (rtx x, bitmap regs, int max_depth, void *data)
if (result)
return result;
else
- return x;
+ return xret;
}
/* Expand VALUEs in LOC, using VARS as well as cselib's equivalence
@@ -6341,14 +6350,11 @@ vt_expand_loc_callback (rtx x, bitmap regs, int max_depth, void *data)
static rtx
vt_expand_loc (rtx loc, htab_t vars)
{
- rtx newloc;
-
if (!MAY_HAVE_DEBUG_INSNS)
return loc;
- newloc = cselib_expand_value_rtx_cb (loc, scratch_regs, 5,
- vt_expand_loc_callback, vars);
- loc = check_wrap_constant (GET_MODE (loc), newloc);
+ loc = cselib_expand_value_rtx_cb (loc, scratch_regs, 5,
+ vt_expand_loc_callback, vars);
if (loc && MEM_P (loc))
loc = targetm.delegitimize_address (loc);
@@ -6382,6 +6388,9 @@ emit_note_insn_var_location (void **varp, void *data)
decl = dv_as_decl (var->dv);
+ if (TREE_CODE (decl) == DEBUG_EXPR_DECL)
+ goto clear;
+
gcc_assert (decl);
complete = true;
@@ -6407,7 +6416,7 @@ emit_note_insn_var_location (void **varp, void *data)
continue;
}
loc[n_var_parts] = loc2;
- mode = GET_MODE (loc[n_var_parts]);
+ mode = GET_MODE (var->var_part[i].loc_chain->loc);
initialized = var->var_part[i].loc_chain->init;
last_limit = offsets[n_var_parts] + GET_MODE_SIZE (mode);
@@ -6418,9 +6427,10 @@ emit_note_insn_var_location (void **varp, void *data)
break;
if (j < var->n_var_parts
&& wider_mode != VOIDmode
+ && mode == GET_MODE (var->var_part[j].loc_chain->loc)
+ && (REG_P (loc[n_var_parts]) || MEM_P (loc[n_var_parts]))
&& (loc2 = vt_expand_loc (var->var_part[j].loc_chain->loc, vars))
&& GET_CODE (loc[n_var_parts]) == GET_CODE (loc2)
- && mode == GET_MODE (loc2)
&& last_limit == var->var_part[j].offset)
{
rtx new_loc = NULL;
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 46ec00da180..c9953d128da 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1168,11 +1168,17 @@ align_variable (tree decl, bool dont_output_data)
static section *
get_variable_section (tree decl, bool prefer_noswitch_p)
{
+ addr_space_t as = ADDR_SPACE_GENERIC;
int reloc;
- /* If the decl has been given an explicit section name, then it
- isn't common, and shouldn't be handled as such. */
- if (DECL_COMMON (decl) && DECL_SECTION_NAME (decl) == NULL)
+ if (TREE_TYPE (decl) != error_mark_node)
+ as = TYPE_ADDR_SPACE (TREE_TYPE (decl));
+
+ /* If the decl has been given an explicit section name, or it resides
+ in a non-generic address space, then it isn't common, and shouldn't
+ be handled as such. */
+ if (DECL_COMMON (decl) && DECL_SECTION_NAME (decl) == NULL
+ && ADDR_SPACE_GENERIC_P (as))
{
if (DECL_THREAD_LOCAL_P (decl))
return tls_comm_section;
@@ -1196,7 +1202,8 @@ get_variable_section (tree decl, bool prefer_noswitch_p)
if (IN_NAMED_SECTION (decl))
return get_named_section (decl, NULL, reloc);
- if (!DECL_THREAD_LOCAL_P (decl)
+ if (ADDR_SPACE_GENERIC_P (as)
+ && !DECL_THREAD_LOCAL_P (decl)
&& !(prefer_noswitch_p && targetm.have_switchable_bss_sections)
&& bss_initializer_p (decl))
{
@@ -1440,7 +1447,15 @@ make_decl_rtl (tree decl)
if (use_object_blocks_p () && use_blocks_for_decl_p (decl))
x = create_block_symbol (name, get_block_for_decl (decl), -1);
else
- x = gen_rtx_SYMBOL_REF (Pmode, name);
+ {
+ enum machine_mode address_mode = Pmode;
+ if (TREE_TYPE (decl) != error_mark_node)
+ {
+ addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (decl));
+ address_mode = targetm.addr_space.address_mode (as);
+ }
+ x = gen_rtx_SYMBOL_REF (address_mode, name);
+ }
SYMBOL_REF_WEAK (x) = DECL_WEAK (decl);
SET_SYMBOL_REF_DECL (x, decl);
@@ -2082,7 +2097,7 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
Without this, if the variable is placed in a
section-anchored block, the template will only be marked
when it's too late. */
- record_references_in_initializer (to);
+ record_references_in_initializer (to, false);
}
decl = to;
@@ -4307,8 +4322,13 @@ initializer_constant_valid_p (tree value, tree endtype)
case POINTER_PLUS_EXPR:
case PLUS_EXPR:
+ /* Any valid floating-point constants will have been folded by now;
+ with -frounding-math we hit this with addition of two constants. */
+ if (TREE_CODE (endtype) == REAL_TYPE)
+ return NULL_TREE;
if (! INTEGRAL_TYPE_P (endtype)
- || TYPE_PRECISION (endtype) >= POINTER_SIZE)
+ || TYPE_PRECISION (endtype)
+ >= int_or_pointer_precision (TREE_TYPE (value)))
{
tree valid0 = initializer_constant_valid_p (TREE_OPERAND (value, 0),
endtype);
@@ -4329,8 +4349,11 @@ initializer_constant_valid_p (tree value, tree endtype)
break;
case MINUS_EXPR:
+ if (TREE_CODE (endtype) == REAL_TYPE)
+ return NULL_TREE;
if (! INTEGRAL_TYPE_P (endtype)
- || TYPE_PRECISION (endtype) >= POINTER_SIZE)
+ || TYPE_PRECISION (endtype)
+ >= int_or_pointer_precision (TREE_TYPE (value)))
{
tree valid0 = initializer_constant_valid_p (TREE_OPERAND (value, 0),
endtype);
@@ -4451,7 +4474,9 @@ output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align)
resolving it. */
if (TREE_CODE (exp) == NOP_EXPR
&& POINTER_TYPE_P (TREE_TYPE (exp))
- && targetm.valid_pointer_mode (TYPE_MODE (TREE_TYPE (exp))))
+ && targetm.addr_space.valid_pointer_mode
+ (TYPE_MODE (TREE_TYPE (exp)),
+ TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp)))))
{
tree saved_type = TREE_TYPE (exp);
@@ -4459,7 +4484,9 @@ output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align)
pointer modes. */
while (TREE_CODE (exp) == NOP_EXPR
&& POINTER_TYPE_P (TREE_TYPE (exp))
- && targetm.valid_pointer_mode (TYPE_MODE (TREE_TYPE (exp))))
+ && targetm.addr_space.valid_pointer_mode
+ (TYPE_MODE (TREE_TYPE (exp)),
+ TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp)))))
exp = TREE_OPERAND (exp, 0);
/* If what we're left with is the address of something, we can
@@ -4539,8 +4566,8 @@ output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align)
case REAL_TYPE:
if (TREE_CODE (exp) != REAL_CST)
error ("initializer for floating value is not a floating constant");
-
- assemble_real (TREE_REAL_CST (exp), TYPE_MODE (TREE_TYPE (exp)), align);
+ else
+ assemble_real (TREE_REAL_CST (exp), TYPE_MODE (TREE_TYPE (exp)), align);
break;
case COMPLEX_TYPE:
@@ -6555,14 +6582,6 @@ default_binds_local_p_1 (const_tree exp, int shlib)
return local_p;
}
-/* Determine whether or not a pointer mode is valid. Assume defaults
- of ptr_mode or Pmode - can be overridden. */
-bool
-default_valid_pointer_mode (enum machine_mode mode)
-{
- return (mode == ptr_mode || mode == Pmode);
-}
-
/* Default function to output code that will globalize a label. A
target must define GLOBAL_ASM_OP or provide its own function to
globalize a label. */
diff --git a/gcc/varpool.c b/gcc/varpool.c
index 12cdad90e28..8815efda249 100644
--- a/gcc/varpool.c
+++ b/gcc/varpool.c
@@ -35,6 +35,7 @@ along with GCC; see the file COPYING3. If not see
#include "output.h"
#include "gimple.h"
#include "tree-flow.h"
+#include "flags.h"
/* This file contains basic routines manipulating variable pool.
@@ -245,7 +246,11 @@ decide_is_variable_needed (struct varpool_node *node, tree decl)
/* Externally visible variables must be output. The exception is
COMDAT variables that must be output only when they are needed. */
- if (TREE_PUBLIC (decl) && !flag_whole_program && !DECL_COMDAT (decl)
+ if (TREE_PUBLIC (decl)
+ && !flag_whole_program
+ && !flag_lto
+ && !flag_whopr
+ && !DECL_COMDAT (decl)
&& !DECL_EXTERNAL (decl))
return true;
@@ -279,6 +284,17 @@ varpool_finalize_decl (tree decl)
{
struct varpool_node *node = varpool_node (decl);
+ /* FIXME: We don't really stream varpool datastructure and instead rebuild it
+ by varpool_finalize_decl. This is not quite correct since this way we can't
+ attach any info to varpool. Eventually we will want to stream varpool nodes
+ and the flags.
+
+ For the moment just prevent analysis of varpool nodes to happen again, so
+ we will re-try to compute "address_taken" flag of varpool that breaks
+ in presence of clones. */
+ if (in_lto_p)
+ node->analyzed = true;
+
/* The first declaration of a variable that comes through this function
decides whether it is global (in C, has external linkage)
or local (in C, has internal linkage). So do nothing more
@@ -333,17 +349,24 @@ varpool_analyze_pending_decls (void)
while (varpool_first_unanalyzed_node)
{
tree decl = varpool_first_unanalyzed_node->decl;
+ bool analyzed = varpool_first_unanalyzed_node->analyzed;
varpool_first_unanalyzed_node->analyzed = true;
varpool_first_unanalyzed_node = varpool_first_unanalyzed_node->next_needed;
- /* Compute the alignment early so function body expanders are
- already informed about increased alignment. */
- align_variable (decl, 0);
-
+ /* When reading back varpool at LTO time, we re-construct the queue in order
+ to have "needed" list right by inserting all needed nodes into varpool.
+ We however don't want to re-analyze already analyzed nodes. */
+ if (!analyzed)
+ {
+ gcc_assert (!in_lto_p);
+ /* Compute the alignment early so function body expanders are
+ already informed about increased alignment. */
+ align_variable (decl, 0);
+ }
if (DECL_INITIAL (decl))
- record_references_in_initializer (decl);
+ record_references_in_initializer (decl, analyzed);
changed = true;
}
timevar_pop (TV_CGRAPH);
diff --git a/gcc/vmsdbgout.c b/gcc/vmsdbgout.c
index f7cca03d051..74285af56c6 100644
--- a/gcc/vmsdbgout.c
+++ b/gcc/vmsdbgout.c
@@ -168,6 +168,7 @@ static int write_srccorrs (int);
static void vmsdbgout_init (const char *);
static void vmsdbgout_finish (const char *);
+static void vmsdbgout_assembly_start (void);
static void vmsdbgout_define (unsigned int, const char *);
static void vmsdbgout_undef (unsigned int, const char *);
static void vmsdbgout_start_source_file (unsigned int, const char *);
@@ -190,6 +191,7 @@ static void vmsdbgout_abstract_function (tree);
const struct gcc_debug_hooks vmsdbg_debug_hooks
= {vmsdbgout_init,
vmsdbgout_finish,
+ vmsdbgout_assembly_start,
vmsdbgout_define,
vmsdbgout_undef,
vmsdbgout_start_source_file,
@@ -213,6 +215,10 @@ const struct gcc_debug_hooks vmsdbg_debug_hooks
debug_nothing_int, /* handle_pch */
debug_nothing_rtx, /* var_location */
debug_nothing_void, /* switch_text_section */
+ debug_nothing_tree, /* direct_call */
+ debug_nothing_tree_int, /* virtual_call_token */
+ debug_nothing_rtx_rtx, /* copy_call_info */
+ debug_nothing_uid, /* virtual_call */
debug_nothing_tree_tree, /* set_name */
0 /* start_end_main_source_file */
};
@@ -1615,6 +1621,15 @@ vmsdbgout_init (const char *main_input_filename)
/* Not implemented in VMS Debug. */
static void
+vmsdbgout_assembly_start (void)
+{
+ if (write_symbols == VMS_AND_DWARF2_DEBUG)
+ (*dwarf2_debug_hooks.assembly_start) ();
+}
+
+/* Not implemented in VMS Debug. */
+
+static void
vmsdbgout_define (unsigned int lineno, const char *buffer)
{
if (write_symbols == VMS_AND_DWARF2_DEBUG)
diff --git a/include/ChangeLog b/include/ChangeLog
index 2a2bebcd3c0..000eeda414f 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,51 @@
+2009-11-06 Jonas Maebe <jonas.maebe@elis.ugent.be>
+
+ Add DWARF attribute value for the "Borland fastcall" calling
+ convention.
+ * elf/dwarf2.h: Add DW_CC_GNU_borland_fastcall_i386 constant.
+
+2009-10-23 Kai Tietz <kai.tietz@onevision.com>
+
+ * splay-tree.h (libi_uhostptr_t): Add gcc specific
+ __extension__ for long long type case to silent cX9.
+ (libi_shostptr_t): Likewise.
+
+2009-10-19 Rafael Avila de Espindola <espindola@google.com>
+
+ PR40790
+ * plugin-api.h: Don't include stdint.h unconditionally.
+
+2009-10-15 Jakub Jelinek <jakub@redhat.com>
+
+ * include/dwarf2.h (DW_LANG_Python): Add comment that it is
+ a DWARF 4 addition.
+
+2009-10-09 Rafael Espindola <espindola@google.com>
+
+ * plugin-api.h (ld_plugin_add_input_library): Change argument name to
+ libname.
+
+2009-10-05 Rafael Espindola <espindola@google.com>
+
+ * plugin-api.h (ld_plugin_status): Add LDPS_BAD_HANDLE.
+ (ld_plugin_get_input_file): New.
+ (ld_plugin_release_input_file): New.
+ (ld_plugin_add_input_library): New.
+ (ld_plugin_message): Mark format const.
+ (ld_plugin_level): Add LDPT_GET_INPUT_FILE, LDPT_RELEASE_INPUT_FILE and
+ LDPT_ADD_INPUT_LIBRARY.
+ (ld_plugin_tv): Add tv_get_input_file, tv_release_input_file and
+ tv_add_input_library.
+
+2009-10-04 Jerry Quinn <jlquinn@optonline.net>
+
+ * plugin-api.h: Fix compile.
+
+2008-10-03 Rafael Espindola <espindola@google.com>
+
+ * plugin-api.h: New.
+ * lto-symtab.h: New.
+
2009-09-29 Jason Merrill <jason@redhat.com>
* demangle.h (enum demangle_component_type): Add
diff --git a/include/dwarf2.h b/include/dwarf2.h
index 385ab2256fa..559b82d7876 100644
--- a/include/dwarf2.h
+++ b/include/dwarf2.h
@@ -721,7 +721,8 @@ enum dwarf_calling_convention
DW_CC_lo_user = 0x40,
DW_CC_hi_user = 0xff,
- DW_CC_GNU_renesas_sh = 0x40
+ DW_CC_GNU_renesas_sh = 0x40,
+ DW_CC_GNU_borland_fastcall_i386 = 0x41
};
/* Inline attribute. */
@@ -858,6 +859,7 @@ enum dwarf_source_language
DW_LANG_ObjC_plus_plus = 0x0011,
DW_LANG_UPC = 0x0012,
DW_LANG_D = 0x0013,
+ /* DWARF 4. */
DW_LANG_Python = 0x0014,
DW_LANG_lo_user = 0x8000, /* Implementation-defined range start. */
diff --git a/include/lto-symtab.h b/include/lto-symtab.h
new file mode 100644
index 00000000000..9312c5d9d33
--- /dev/null
+++ b/include/lto-symtab.h
@@ -0,0 +1,41 @@
+/* Data types used in the IL symbol table.
+ Copyright (C) 2009 Free Software Foundation, Inc.
+ Contributed by Rafael Espindola <espindola@google.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef GCC_LTO_SYMTAB_H
+#define GCC_LTO_SYMTAB_H
+
+enum gcc_plugin_symbol_kind
+ {
+ GCCPK_DEF,
+ GCCPK_WEAKDEF,
+ GCCPK_UNDEF,
+ GCCPK_WEAKUNDEF,
+ GCCPK_COMMON
+ };
+
+enum gcc_plugin_symbol_visibility
+ {
+ GCCPV_DEFAULT,
+ GCCPV_PROTECTED,
+ GCCPV_INTERNAL,
+ GCCPV_HIDDEN
+ };
+
+#endif /* GCC_LTO_SYMTAB_H */
diff --git a/include/plugin-api.h b/include/plugin-api.h
new file mode 100644
index 00000000000..572621fc374
--- /dev/null
+++ b/include/plugin-api.h
@@ -0,0 +1,298 @@
+/* plugin-api.h -- External linker plugin API. */
+
+/* Copyright 2009 Free Software Foundation, Inc.
+ Written by Cary Coutant <ccoutant@google.com>.
+
+ This file is part of binutils.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+/* This file defines the interface for writing a linker plugin, which is
+ described at < http://gcc.gnu.org/wiki/whopr/driver >. */
+
+#ifndef PLUGIN_API_H
+#define PLUGIN_API_H
+
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#elif defined(HAVE_INTTYPES_H)
+#include <inttypes.h>
+#endif
+#include <sys/types.h>
+#if !defined(HAVE_STDINT_H) && !defined(HAVE_INTTYPES_H) && \
+ !defined(UINT64_MAX) && !defined(uint64_t)
+#error can not find uint64_t type
+#endif
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/* Status code returned by most API routines. */
+
+enum ld_plugin_status
+{
+ LDPS_OK = 0,
+ LDPS_NO_SYMS, /* Attempt to get symbols that haven't been added. */
+ LDPS_BAD_HANDLE, /* No claimed object associated with given handle. */
+ LDPS_ERR
+ /* Additional Error codes TBD. */
+};
+
+/* The version of the API specification. */
+
+enum ld_plugin_api_version
+{
+ LD_PLUGIN_API_VERSION = 1
+};
+
+/* The type of output file being generated by the linker. */
+
+enum ld_plugin_output_file_type
+{
+ LDPO_REL,
+ LDPO_EXEC,
+ LDPO_DYN
+};
+
+/* An input file managed by the plugin library. */
+
+struct ld_plugin_input_file
+{
+ const char *name;
+ int fd;
+ off_t offset;
+ off_t filesize;
+ void *handle;
+};
+
+/* A symbol belonging to an input file managed by the plugin library. */
+
+struct ld_plugin_symbol
+{
+ char *name;
+ char *version;
+ int def;
+ int visibility;
+ uint64_t size;
+ char *comdat_key;
+ int resolution;
+};
+
+/* Whether the symbol is a definition, reference, or common, weak or not. */
+
+enum ld_plugin_symbol_kind
+{
+ LDPK_DEF,
+ LDPK_WEAKDEF,
+ LDPK_UNDEF,
+ LDPK_WEAKUNDEF,
+ LDPK_COMMON
+};
+
+/* The visibility of the symbol. */
+
+enum ld_plugin_symbol_visibility
+{
+ LDPV_DEFAULT,
+ LDPV_PROTECTED,
+ LDPV_INTERNAL,
+ LDPV_HIDDEN
+};
+
+/* How a symbol is resolved. */
+
+enum ld_plugin_symbol_resolution
+{
+ LDPR_UNKNOWN = 0,
+
+ /* Symbol is still undefined at this point. */
+ LDPR_UNDEF,
+
+ /* This is the prevailing definition of the symbol, with references from
+ regular object code. */
+ LDPR_PREVAILING_DEF,
+
+ /* This is the prevailing definition of the symbol, with no
+ references from regular objects. It is only referenced from IR
+ code. */
+ LDPR_PREVAILING_DEF_IRONLY,
+
+ /* This definition was pre-empted by a definition in a regular
+ object file. */
+ LDPR_PREEMPTED_REG,
+
+ /* This definition was pre-empted by a definition in another IR file. */
+ LDPR_PREEMPTED_IR,
+
+ /* This symbol was resolved by a definition in another IR file. */
+ LDPR_RESOLVED_IR,
+
+ /* This symbol was resolved by a definition in a regular object
+ linked into the main executable. */
+ LDPR_RESOLVED_EXEC,
+
+ /* This symbol was resolved by a definition in a shared object. */
+ LDPR_RESOLVED_DYN
+};
+
+/* The plugin library's "claim file" handler. */
+
+typedef
+enum ld_plugin_status
+(*ld_plugin_claim_file_handler) (
+ const struct ld_plugin_input_file *file, int *claimed);
+
+/* The plugin library's "all symbols read" handler. */
+
+typedef
+enum ld_plugin_status
+(*ld_plugin_all_symbols_read_handler) (void);
+
+/* The plugin library's cleanup handler. */
+
+typedef
+enum ld_plugin_status
+(*ld_plugin_cleanup_handler) (void);
+
+/* The linker's interface for registering the "claim file" handler. */
+
+typedef
+enum ld_plugin_status
+(*ld_plugin_register_claim_file) (ld_plugin_claim_file_handler handler);
+
+/* The linker's interface for registering the "all symbols read" handler. */
+
+typedef
+enum ld_plugin_status
+(*ld_plugin_register_all_symbols_read) (
+ ld_plugin_all_symbols_read_handler handler);
+
+/* The linker's interface for registering the cleanup handler. */
+
+typedef
+enum ld_plugin_status
+(*ld_plugin_register_cleanup) (ld_plugin_cleanup_handler handler);
+
+/* The linker's interface for adding symbols from a claimed input file. */
+
+typedef
+enum ld_plugin_status
+(*ld_plugin_add_symbols) (void *handle, int nsyms,
+ const struct ld_plugin_symbol *syms);
+
+/* The linker's interface for getting the input file information with
+ an open (possibly re-opened) file descriptor. */
+
+typedef
+enum ld_plugin_status
+(*ld_plugin_get_input_file) (const void *handle,
+ struct ld_plugin_input_file *file);
+
+/* The linker's interface for releasing the input file. */
+
+typedef
+enum ld_plugin_status
+(*ld_plugin_release_input_file) (const void *handle);
+
+/* The linker's interface for retrieving symbol resolution information. */
+
+typedef
+enum ld_plugin_status
+(*ld_plugin_get_symbols) (const void *handle, int nsyms,
+ struct ld_plugin_symbol *syms);
+
+/* The linker's interface for adding a compiled input file. */
+
+typedef
+enum ld_plugin_status
+(*ld_plugin_add_input_file) (char *pathname);
+
+/* The linker's interface for adding a library that should be searched. */
+
+typedef
+enum ld_plugin_status
+(*ld_plugin_add_input_library) (char *libname);
+
+/* The linker's interface for issuing a warning or error message. */
+
+typedef
+enum ld_plugin_status
+(*ld_plugin_message) (int level, const char *format, ...);
+
+enum ld_plugin_level
+{
+ LDPL_INFO,
+ LDPL_WARNING,
+ LDPL_ERROR,
+ LDPL_FATAL
+};
+
+/* Values for the tv_tag field of the transfer vector. */
+
+enum ld_plugin_tag
+{
+ LDPT_NULL = 0,
+ LDPT_API_VERSION,
+ LDPT_GOLD_VERSION,
+ LDPT_LINKER_OUTPUT,
+ LDPT_OPTION,
+ LDPT_REGISTER_CLAIM_FILE_HOOK,
+ LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK,
+ LDPT_REGISTER_CLEANUP_HOOK,
+ LDPT_ADD_SYMBOLS,
+ LDPT_GET_SYMBOLS,
+ LDPT_ADD_INPUT_FILE,
+ LDPT_MESSAGE,
+ LDPT_GET_INPUT_FILE,
+ LDPT_RELEASE_INPUT_FILE,
+ LDPT_ADD_INPUT_LIBRARY
+};
+
+/* The plugin transfer vector. */
+
+struct ld_plugin_tv
+{
+ enum ld_plugin_tag tv_tag;
+ union
+ {
+ int tv_val;
+ const char *tv_string;
+ ld_plugin_register_claim_file tv_register_claim_file;
+ ld_plugin_register_all_symbols_read tv_register_all_symbols_read;
+ ld_plugin_register_cleanup tv_register_cleanup;
+ ld_plugin_add_symbols tv_add_symbols;
+ ld_plugin_get_symbols tv_get_symbols;
+ ld_plugin_add_input_file tv_add_input_file;
+ ld_plugin_message tv_message;
+ ld_plugin_get_input_file tv_get_input_file;
+ ld_plugin_release_input_file tv_release_input_file;
+ ld_plugin_add_input_library tv_add_input_library;
+ } tv_u;
+};
+
+/* The plugin library's "onload" entry point. */
+
+typedef
+enum ld_plugin_status
+(*ld_plugin_onload) (struct ld_plugin_tv *tv);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !defined(PLUGIN_API_H) */
diff --git a/include/splay-tree.h b/include/splay-tree.h
index 8a56a20cdc3..57a96c4a3de 100644
--- a/include/splay-tree.h
+++ b/include/splay-tree.h
@@ -41,7 +41,13 @@ extern "C" {
typedef unsigned long int libi_uhostptr_t;
typedef long int libi_shostptr_t;
#else
+#ifdef __GNUC__
+ __extension__
+#endif
typedef unsigned long long libi_uhostptr_t;
+#ifdef __GNUC__
+ __extension__
+#endif
typedef long long libi_shostptr_t;
#endif
diff --git a/intl/ChangeLog b/intl/ChangeLog
index 83a74febece..20aaed376b0 100644
--- a/intl/ChangeLog
+++ b/intl/ChangeLog
@@ -1,3 +1,9 @@
+2009-10-15 Jim Blandy <jimb@red-bean.com>
+
+ * libgnuintl.h (_INTL_MAY_RETURN_STRING_ARG, gettext, dgettext)
+ (dcgettext, ngettext, dngettext, dcngettext): Backport changes
+ from current gettext to provide GCC format_arg attributes.
+
2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* configure.ac (AC_PREREQ): Bump to 2.64.
diff --git a/intl/libgnuintl.h b/intl/libgnuintl.h
index f6138affb59..acc9093a9de 100644
--- a/intl/libgnuintl.h
+++ b/intl/libgnuintl.h
@@ -112,11 +112,21 @@ extern "C" {
# define _INTL_ASM(cname)
#endif
+/* _INTL_MAY_RETURN_STRING_ARG(n) declares that the given function may return
+ its n-th argument literally. This enables GCC to warn for example about
+ printf (gettext ("foo %y")). */
+#if __GNUC__ >= 3 && !(__APPLE_CC__ > 1 && defined __cplusplus)
+# define _INTL_MAY_RETURN_STRING_ARG(n) __attribute__ ((__format_arg__ (n)))
+#else
+# define _INTL_MAY_RETURN_STRING_ARG(n)
+#endif
+
/* Look up MSGID in the current default message catalog for the current
LC_MESSAGES locale. If not found, returns MSGID itself (the default
text). */
#ifdef _INTL_REDIRECT_INLINE
-extern char *libintl_gettext (const char *__msgid);
+extern char *libintl_gettext (const char *__msgid)
+ _INTL_MAY_RETURN_STRING_ARG (1);
static inline char *gettext (const char *__msgid)
{
return libintl_gettext (__msgid);
@@ -126,13 +136,15 @@ static inline char *gettext (const char *__msgid)
# define gettext libintl_gettext
#endif
extern char *gettext _INTL_PARAMS ((const char *__msgid))
- _INTL_ASM (libintl_gettext);
+ _INTL_ASM (libintl_gettext)
+ _INTL_MAY_RETURN_STRING_ARG (1);
#endif
/* Look up MSGID in the DOMAINNAME message catalog for the current
LC_MESSAGES locale. */
#ifdef _INTL_REDIRECT_INLINE
-extern char *libintl_dgettext (const char *__domainname, const char *__msgid);
+extern char *libintl_dgettext (const char *__domainname, const char *__msgid)
+ _INTL_MAY_RETURN_STRING_ARG (2);
static inline char *dgettext (const char *__domainname, const char *__msgid)
{
return libintl_dgettext (__domainname, __msgid);
@@ -143,14 +155,16 @@ static inline char *dgettext (const char *__domainname, const char *__msgid)
#endif
extern char *dgettext _INTL_PARAMS ((const char *__domainname,
const char *__msgid))
- _INTL_ASM (libintl_dgettext);
+ _INTL_ASM (libintl_dgettext)
+ _INTL_MAY_RETURN_STRING_ARG (2);
#endif
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
locale. */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_dcgettext (const char *__domainname, const char *__msgid,
- int __category);
+ int __category)
+ _INTL_MAY_RETURN_STRING_ARG (2);
static inline char *dcgettext (const char *__domainname, const char *__msgid,
int __category)
{
@@ -163,7 +177,8 @@ static inline char *dcgettext (const char *__domainname, const char *__msgid,
extern char *dcgettext _INTL_PARAMS ((const char *__domainname,
const char *__msgid,
int __category))
- _INTL_ASM (libintl_dcgettext);
+ _INTL_ASM (libintl_dcgettext)
+ _INTL_MAY_RETURN_STRING_ARG (2);
#endif
@@ -171,7 +186,8 @@ extern char *dcgettext _INTL_PARAMS ((const char *__domainname,
number N. */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2,
- unsigned long int __n);
+ unsigned long int __n)
+ _INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2);
static inline char *ngettext (const char *__msgid1, const char *__msgid2,
unsigned long int __n)
{
@@ -184,14 +200,16 @@ static inline char *ngettext (const char *__msgid1, const char *__msgid2,
extern char *ngettext _INTL_PARAMS ((const char *__msgid1,
const char *__msgid2,
unsigned long int __n))
- _INTL_ASM (libintl_ngettext);
+ _INTL_ASM (libintl_ngettext)
+ _INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2);
#endif
/* Similar to `dgettext' but select the plural form corresponding to the
number N. */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_dngettext (const char *__domainname, const char *__msgid1,
- const char *__msgid2, unsigned long int __n);
+ const char *__msgid2, unsigned long int __n)
+ _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
static inline char *dngettext (const char *__domainname, const char *__msgid1,
const char *__msgid2, unsigned long int __n)
{
@@ -205,7 +223,8 @@ extern char *dngettext _INTL_PARAMS ((const char *__domainname,
const char *__msgid1,
const char *__msgid2,
unsigned long int __n))
- _INTL_ASM (libintl_dngettext);
+ _INTL_ASM (libintl_dngettext)
+ _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
#endif
/* Similar to `dcgettext' but select the plural form corresponding to the
@@ -213,7 +232,8 @@ extern char *dngettext _INTL_PARAMS ((const char *__domainname,
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_dcngettext (const char *__domainname,
const char *__msgid1, const char *__msgid2,
- unsigned long int __n, int __category);
+ unsigned long int __n, int __category)
+ _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
static inline char *dcngettext (const char *__domainname,
const char *__msgid1, const char *__msgid2,
unsigned long int __n, int __category)
@@ -229,7 +249,8 @@ extern char *dcngettext _INTL_PARAMS ((const char *__domainname,
const char *__msgid2,
unsigned long int __n,
int __category))
- _INTL_ASM (libintl_dcngettext);
+ _INTL_ASM (libintl_dcngettext)
+ _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
#endif
diff --git a/libada/ChangeLog b/libada/ChangeLog
index a3add748971..deffec6515f 100644
--- a/libada/ChangeLog
+++ b/libada/ChangeLog
@@ -1,3 +1,11 @@
+2009-10-24 Eric Botcazou <ebotcazou@adacore.com>
+
+ * Makefile.in (GNATLIBCFLAGS_FOR_C): New variable.
+ (LIBADA_FLAGS_TO_PASS): Add GNATLIBCFLAGS_FOR_C.
+ * configure.ac: Include config/unwind_ipinfo.m4.
+ Check for _Unwind_GetIPInfo.
+ * configure: Regenerate.
+
2009-08-30 Paolo Bonzini <bonzini@gnu.org>
PR ada/41122
diff --git a/libada/Makefile.in b/libada/Makefile.in
index eec1649f9e1..01fa8362374 100644
--- a/libada/Makefile.in
+++ b/libada/Makefile.in
@@ -58,6 +58,8 @@ WARN_CFLAGS = @warn_cflags@
TARGET_LIBGCC2_CFLAGS=
GNATLIBCFLAGS= -g -O2
+GNATLIBCFLAGS_FOR_C = $(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) -fexceptions \
+ -DIN_RTS @have_getipinfo@
# Get target-specific overrides for TARGET_LIBGCC2_CFLAGS.
host_subdir = @host_subdir@
@@ -80,6 +82,7 @@ LIBADA_FLAGS_TO_PASS = \
"SHELL=$(SHELL)" \
"GNATLIBFLAGS=$(GNATLIBFLAGS) $(MULTIFLAGS)" \
"GNATLIBCFLAGS=$(GNATLIBCFLAGS) $(MULTIFLAGS)" \
+ "GNATLIBCFLAGS_FOR_C=$(GNATLIBCFLAGS_FOR_C) $(MULTIFLAGS)" \
"TARGET_LIBGCC2_CFLAGS=$(TARGET_LIBGCC2_CFLAGS)" \
"THREAD_KIND=$(THREAD_KIND)" \
"TRACE=$(TRACE)" \
diff --git a/libada/configure b/libada/configure
index ce8c0039e35..4137364df21 100755
--- a/libada/configure
+++ b/libada/configure
@@ -554,6 +554,7 @@ ac_unique_file="Makefile.in"
ac_subst_vars='LTLIBOBJS
LIBOBJS
warn_cflags
+have_getipinfo
default_gnatlib_target
LN_S
AWK
@@ -631,6 +632,7 @@ with_build_libsubdir
enable_maintainer_mode
enable_multilib
enable_shared
+with_system_libunwind
'
ac_precious_vars='build_alias
host_alias
@@ -1258,6 +1260,7 @@ Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-build-libsubdir=DIR Directory where to find libraries for build system
+ --with-system-libunwind use installed libunwind
Some influential environment variables:
CC C compiler command
@@ -2879,6 +2882,49 @@ else
fi
+# Check for _Unwind_GetIPInfo
+
+
+# Check whether --with-system-libunwind was given.
+if test "${with_system_libunwind+set}" = set; then :
+ withval=$with_system_libunwind;
+fi
+
+ # If system-libunwind was not specifically set, pick a default setting.
+ if test x$with_system_libunwind = x; then
+ case ${target} in
+ ia64-*-hpux*) with_system_libunwind=yes ;;
+ *) with_system_libunwind=no ;;
+ esac
+ fi
+ # Based on system-libunwind and target, do we have ipinfo?
+ if test x$with_system_libunwind = xyes; then
+ case ${target} in
+ ia64-*-*) have_unwind_getipinfo=no ;;
+ *) have_unwind_getipinfo=yes ;;
+ esac
+ else
+ # Darwin before version 9 does not have _Unwind_GetIPInfo.
+
+ case ${target} in
+ *-*-darwin[3-8]|*-*-darwin[3-8].*) have_unwind_getipinfo=no ;;
+ *) have_unwind_getipinfo=yes ;;
+ esac
+
+ fi
+
+ if test x$have_unwind_getipinfo = xyes; then
+
+$as_echo "#define HAVE_GETIPINFO 1" >>confdefs.h
+
+ fi
+
+have_getipinfo=
+if test x$have_unwind_getipinfo = xyes; then
+ have_getipinfo=-DHAVE_GETIPINFO
+fi
+
+
warn_cflags=
if test "x$GCC" = "xyes"; then
warn_cflags='$(GCC_WARN_CFLAGS)'
diff --git a/libada/configure.ac b/libada/configure.ac
index 2fd8080f23b..3aa8a62a522 100644
--- a/libada/configure.ac
+++ b/libada/configure.ac
@@ -18,6 +18,7 @@
sinclude(../config/acx.m4)
sinclude(../config/multi.m4)
sinclude(../config/override.m4)
+sinclude(../config/unwind_ipinfo.m4)
AC_INIT
AC_PREREQ([2.64])
@@ -131,6 +132,14 @@ else
fi
AC_SUBST([default_gnatlib_target])
+# Check for _Unwind_GetIPInfo
+GCC_CHECK_UNWIND_GETIPINFO
+have_getipinfo=
+if test x$have_unwind_getipinfo = xyes; then
+ have_getipinfo=-DHAVE_GETIPINFO
+fi
+AC_SUBST(have_getipinfo)
+
warn_cflags=
if test "x$GCC" = "xyes"; then
warn_cflags='$(GCC_WARN_CFLAGS)'
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 7a30a8426f9..5946b29dc56 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,37 @@
+2009-10-19 Jakub Jelinek <jakub@redhat.com>
+
+ * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
+ (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
+ and char32_cset_desc.
+ (converter_for_type): Handle CPP_UTF8STRING.
+ (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
+ * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
+ (parse_include): Reject raw strings.
+ * include/cpplib.h (CPP_UTF8STRING): New token type.
+ * internal.h (struct cpp_reader): Add utf8_cset_desc field.
+ * lex.c (lex_raw_string): New function.
+ (lex_string): Handle u8 string literals, call lex_raw_string
+ for raw string literals.
+ (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
+ sequences.
+ * macro.c (stringify_arg): Handle CPP_UTF8STRING.
+
+2009-10-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/41543
+ * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
+ * line-map.c (linemap_init): Initialize highest_location and
+ highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
+
+2009-10-09 Jason Merrill <jason@redhat.com>
+
+ * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
+
+2009-10-09 Neil Vachharajani <nvachhar@google.com>
+
+ * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
+ sccs.
+
2009-09-23 Loren J. Rittle <ljrittle@acm.org>
* configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
diff --git a/libcpp/charset.c b/libcpp/charset.c
index b96c646f58e..837ccd77aab 100644
--- a/libcpp/charset.c
+++ b/libcpp/charset.c
@@ -721,6 +721,8 @@ cpp_init_iconv (cpp_reader *pfile)
pfile->narrow_cset_desc = init_iconv_desc (pfile, ncset, SOURCE_CHARSET);
pfile->narrow_cset_desc.width = CPP_OPTION (pfile, char_precision);
+ pfile->utf8_cset_desc = init_iconv_desc (pfile, "UTF-8", SOURCE_CHARSET);
+ pfile->utf8_cset_desc.width = CPP_OPTION (pfile, char_precision);
pfile->char16_cset_desc = init_iconv_desc (pfile,
be ? "UTF-16BE" : "UTF-16LE",
SOURCE_CHARSET);
@@ -741,6 +743,12 @@ _cpp_destroy_iconv (cpp_reader *pfile)
{
if (pfile->narrow_cset_desc.func == convert_using_iconv)
iconv_close (pfile->narrow_cset_desc.cd);
+ if (pfile->utf8_cset_desc.func == convert_using_iconv)
+ iconv_close (pfile->utf8_cset_desc.cd);
+ if (pfile->char16_cset_desc.func == convert_using_iconv)
+ iconv_close (pfile->char16_cset_desc.cd);
+ if (pfile->char32_cset_desc.func == convert_using_iconv)
+ iconv_close (pfile->char32_cset_desc.cd);
if (pfile->wide_cset_desc.func == convert_using_iconv)
iconv_close (pfile->wide_cset_desc.cd);
}
@@ -948,10 +956,16 @@ ucn_valid_in_identifier (cpp_reader *pfile, cppchar_t c,
ISO/IEC 10646 is NNNNNNNN; the character designated by the
universal character name \uNNNN is that character whose character
short name in ISO/IEC 10646 is 0000NNNN. If the hexadecimal value
- for a universal character name is less than 0x20 or in the range
- 0x7F-0x9F (inclusive), or if the universal character name
- designates a character in the basic source character set, then the
- program is ill-formed.
+ for a universal character name corresponds to a surrogate code point
+ (in the range 0xD800-0xDFFF, inclusive), the program is ill-formed.
+ Additionally, if the hexadecimal value for a universal-character-name
+ outside a character or string literal corresponds to a control character
+ (in either of the ranges 0x00-0x1F or 0x7F-0x9F, both inclusive) or to a
+ character in the basic source character set, the program is ill-formed.
+
+ C99 6.4.3: A universal character name shall not specify a character
+ whose short identifier is less than 00A0 other than 0024 ($), 0040 (@),
+ or 0060 (`), nor one in the range D800 through DFFF inclusive.
*PSTR must be preceded by "\u" or "\U"; it is assumed that the
buffer end is delimited by a non-hex digit. Returns zero if the
@@ -1018,9 +1032,12 @@ _cpp_valid_ucn (cpp_reader *pfile, const uchar **pstr,
(int) (str - base), base);
result = 1;
}
- /* The standard permits $, @ and ` to be specified as UCNs. We use
- hex escapes so that this also works with EBCDIC hosts. */
+ /* The C99 standard permits $, @ and ` to be specified as UCNs. We use
+ hex escapes so that this also works with EBCDIC hosts.
+ C++0x permits everything below 0xa0 within literals;
+ ucn_valid_in_identifier will complain about identifiers. */
else if ((result < 0xa0
+ && !CPP_OPTION (pfile, cplusplus)
&& (result != 0x24 && result != 0x40 && result != 0x60))
|| (result & 0x80000000)
|| (result >= 0xD800 && result <= 0xDFFF))
@@ -1330,6 +1347,8 @@ converter_for_type (cpp_reader *pfile, enum cpp_ttype type)
{
default:
return pfile->narrow_cset_desc;
+ case CPP_UTF8STRING:
+ return pfile->utf8_cset_desc;
case CPP_CHAR16:
case CPP_STRING16:
return pfile->char16_cset_desc;
@@ -1364,7 +1383,47 @@ cpp_interpret_string (cpp_reader *pfile, const cpp_string *from, size_t count,
for (i = 0; i < count; i++)
{
p = from[i].text;
- if (*p == 'L' || *p == 'u' || *p == 'U') p++;
+ if (*p == 'u')
+ {
+ if (*++p == '8')
+ p++;
+ }
+ else if (*p == 'L' || *p == 'U') p++;
+ if (*p == 'R')
+ {
+ const uchar *prefix;
+
+ /* Skip over 'R"'. */
+ p += 2;
+ prefix = p;
+ while (*p != '[')
+ p++;
+ p++;
+ limit = from[i].text + from[i].len;
+ if (limit >= p + (p - prefix) + 1)
+ limit -= (p - prefix) + 1;
+
+ for (;;)
+ {
+ base = p;
+ while (p < limit && (*p != '\\' || (p[1] != 'u' && p[1] != 'U')))
+ p++;
+ if (p > base)
+ {
+ /* We have a run of normal characters; these can be fed
+ directly to convert_cset. */
+ if (!APPLY_CONVERSION (cvt, base, p - base, &tbuf))
+ goto fail;
+ }
+ if (p == limit)
+ break;
+
+ p = convert_ucn (pfile, p + 1, limit, &tbuf, cvt);
+ }
+
+ continue;
+ }
+
p++; /* Skip leading quote. */
limit = from[i].text + from[i].len - 1; /* Skip trailing quote. */
diff --git a/libcpp/directives.c b/libcpp/directives.c
index c5a1895b86e..01bb599e266 100644
--- a/libcpp/directives.c
+++ b/libcpp/directives.c
@@ -151,11 +151,11 @@ D(error, T_ERROR, STDC89, 0) /* 475 */ \
D(pragma, T_PRAGMA, STDC89, IN_I) /* 195 */ \
D(warning, T_WARNING, EXTENSION, 0) /* 22 */ \
D(include_next, T_INCLUDE_NEXT, EXTENSION, INCL | EXPAND) /* 19 */ \
-D(ident, T_IDENT, EXTENSION, IN_I | DEPRECATED) /* 11 */ \
+D(ident, T_IDENT, EXTENSION, IN_I) /* 11 */ \
D(import, T_IMPORT, EXTENSION, INCL | EXPAND) /* 0 ObjC */ \
D(assert, T_ASSERT, EXTENSION, DEPRECATED) /* 0 SVR4 */ \
D(unassert, T_UNASSERT, EXTENSION, DEPRECATED) /* 0 SVR4 */ \
-D(sccs, T_SCCS, EXTENSION, IN_I | DEPRECATED) /* 0 SVR4? */
+D(sccs, T_SCCS, EXTENSION, IN_I) /* 0 SVR4? */
/* #sccs is synonymous with #ident. */
#define do_sccs do_ident
@@ -697,7 +697,8 @@ parse_include (cpp_reader *pfile, int *pangle_brackets,
/* Allow macro expansion. */
header = get_token_no_padding (pfile);
*location = header->src_loc;
- if (header->type == CPP_STRING || header->type == CPP_HEADER_NAME)
+ if ((header->type == CPP_STRING && header->val.str.text[0] != 'R')
+ || header->type == CPP_HEADER_NAME)
{
fname = XNEWVEC (char, header->val.str.len - 1);
memcpy (fname, header->val.str.text + 1, header->val.str.len - 2);
@@ -1537,7 +1538,8 @@ get__Pragma_string (cpp_reader *pfile)
if (string->type == CPP_EOF)
_cpp_backup_tokens (pfile, 1);
if (string->type != CPP_STRING && string->type != CPP_WSTRING
- && string->type != CPP_STRING32 && string->type != CPP_STRING16)
+ && string->type != CPP_STRING32 && string->type != CPP_STRING16
+ && string->type != CPP_UTF8STRING)
return NULL;
paren = get_token_no_padding (pfile);
diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h
index df04668dda0..e95f01a412a 100644
--- a/libcpp/include/cpplib.h
+++ b/libcpp/include/cpplib.h
@@ -127,6 +127,7 @@ struct _cpp_file;
TK(WSTRING, LITERAL) /* L"string" */ \
TK(STRING16, LITERAL) /* u"string" */ \
TK(STRING32, LITERAL) /* U"string" */ \
+ TK(UTF8STRING, LITERAL) /* u8"string" */ \
TK(OBJC_STRING, LITERAL) /* @"string" - Objective-C */ \
TK(HEADER_NAME, LITERAL) /* <stdio.h> in #include */ \
\
@@ -728,10 +729,10 @@ extern const unsigned char *cpp_macro_definition (cpp_reader *,
extern void _cpp_backup_tokens (cpp_reader *, unsigned int);
extern const cpp_token *cpp_peek_token (cpp_reader *, int);
-/* Evaluate a CPP_CHAR or CPP_WCHAR token. */
+/* Evaluate a CPP_*CHAR* token. */
extern cppchar_t cpp_interpret_charconst (cpp_reader *, const cpp_token *,
unsigned int *, int *);
-/* Evaluate a vector of CPP_STRING or CPP_WSTRING tokens. */
+/* Evaluate a vector of CPP_*STRING* tokens. */
extern bool cpp_interpret_string (cpp_reader *,
const cpp_string *, size_t,
cpp_string *, enum cpp_ttype);
diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h
index 31ac8e5d4c3..9e31a6ae3b9 100644
--- a/libcpp/include/line-map.h
+++ b/libcpp/include/line-map.h
@@ -143,6 +143,11 @@ extern const struct line_map *linemap_add
extern const struct line_map *linemap_lookup
(struct line_maps *, source_location);
+/* source_location values from 0 to RESERVED_LOCATION_COUNT-1 will
+ be reserved for libcpp user as special values, no token from libcpp
+ will contain any of those locations. */
+#define RESERVED_LOCATION_COUNT 2
+
/* Converts a map and a source_location to source line. */
#define SOURCE_LINE(MAP, LOC) \
((((LOC) - (MAP)->start_location) >> (MAP)->column_bits) + (MAP)->to_line)
diff --git a/libcpp/internal.h b/libcpp/internal.h
index 21e51c6553c..aaa231c2ab1 100644
--- a/libcpp/internal.h
+++ b/libcpp/internal.h
@@ -397,6 +397,10 @@ struct cpp_reader
struct cset_converter narrow_cset_desc;
/* Descriptor for converting from the source character set to the
+ UTF-8 execution character set. */
+ struct cset_converter utf8_cset_desc;
+
+ /* Descriptor for converting from the source character set to the
UTF-16 execution character set. */
struct cset_converter char16_cset_desc;
diff --git a/libcpp/lex.c b/libcpp/lex.c
index bab14a4baa3..55bffa9a326 100644
--- a/libcpp/lex.c
+++ b/libcpp/lex.c
@@ -617,12 +617,192 @@ create_literal (cpp_reader *pfile, cpp_token *token, const uchar *base,
token->val.str.text = dest;
}
+/* Lexes a raw string. The stored string contains the spelling, including
+ double quotes, delimiter string, '[' and ']', any leading
+ 'L', 'u', 'U' or 'u8' and 'R' modifier. It returns the type of the
+ literal, or CPP_OTHER if it was not properly terminated.
+
+ The spelling is NUL-terminated, but it is not guaranteed that this
+ is the first NUL since embedded NULs are preserved. */
+
+static void
+lex_raw_string (cpp_reader *pfile, cpp_token *token, const uchar *base,
+ const uchar *cur)
+{
+ source_location saw_NUL = 0;
+ const uchar *raw_prefix;
+ unsigned int raw_prefix_len = 0;
+ enum cpp_ttype type;
+ size_t total_len = 0;
+ _cpp_buff *first_buff = NULL, *last_buff = NULL;
+
+ type = (*base == 'L' ? CPP_WSTRING :
+ *base == 'U' ? CPP_STRING32 :
+ *base == 'u' ? (base[1] == '8' ? CPP_UTF8STRING : CPP_STRING16)
+ : CPP_STRING);
+
+ raw_prefix = cur + 1;
+ while (raw_prefix_len < 16)
+ {
+ switch (raw_prefix[raw_prefix_len])
+ {
+ case ' ': case '[': case ']': case '\t':
+ case '\v': case '\f': case '\n': default:
+ break;
+ /* Basic source charset except the above chars. */
+ case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
+ case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
+ case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
+ case 's': case 't': case 'u': case 'v': case 'w': case 'x':
+ case 'y': case 'z':
+ case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
+ case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
+ case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
+ case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
+ case 'Y': case 'Z':
+ case '0': case '1': case '2': case '3': case '4': case '5':
+ case '6': case '7': case '8': case '9':
+ case '_': case '{': case '}': case '#': case '(': case ')':
+ case '<': case '>': case '%': case ':': case ';': case '.':
+ case '?': case '*': case '+': case '-': case '/': case '^':
+ case '&': case '|': case '~': case '!': case '=': case ',':
+ case '\\': case '"': case '\'':
+ raw_prefix_len++;
+ continue;
+ }
+ break;
+ }
+
+ if (raw_prefix[raw_prefix_len] != '[')
+ {
+ int col = CPP_BUF_COLUMN (pfile->buffer, raw_prefix + raw_prefix_len)
+ + 1;
+ if (raw_prefix_len == 16)
+ cpp_error_with_line (pfile, CPP_DL_ERROR, token->src_loc, col,
+ "raw string delimiter longer than 16 characters");
+ else
+ cpp_error_with_line (pfile, CPP_DL_ERROR, token->src_loc, col,
+ "invalid character '%c' in raw string delimiter",
+ (int) raw_prefix[raw_prefix_len]);
+ pfile->buffer->cur = raw_prefix - 1;
+ create_literal (pfile, token, base, raw_prefix - 1 - base, CPP_OTHER);
+ return;
+ }
+
+ cur = raw_prefix + raw_prefix_len + 1;
+ for (;;)
+ {
+ cppchar_t c = *cur++;
+
+ if (c == ']'
+ && strncmp ((const char *) cur, (const char *) raw_prefix,
+ raw_prefix_len) == 0
+ && cur[raw_prefix_len] == '"')
+ {
+ cur += raw_prefix_len + 1;
+ break;
+ }
+ else if (c == '\n')
+ {
+ if (pfile->state.in_directive
+ || pfile->state.parsing_args
+ || pfile->state.in_deferred_pragma)
+ {
+ cur--;
+ type = CPP_OTHER;
+ cpp_error_with_line (pfile, CPP_DL_ERROR, token->src_loc, 0,
+ "unterminated raw string");
+ break;
+ }
+
+ /* raw strings allow embedded non-escaped newlines, which
+ complicates this routine a lot. */
+ if (first_buff == NULL)
+ {
+ total_len = cur - base;
+ first_buff = last_buff = _cpp_get_buff (pfile, total_len);
+ memcpy (BUFF_FRONT (last_buff), base, total_len);
+ raw_prefix = BUFF_FRONT (last_buff) + (raw_prefix - base);
+ BUFF_FRONT (last_buff) += total_len;
+ }
+ else
+ {
+ size_t len = cur - base;
+ size_t cur_len = len > BUFF_ROOM (last_buff)
+ ? BUFF_ROOM (last_buff) : len;
+
+ total_len += len;
+ memcpy (BUFF_FRONT (last_buff), base, cur_len);
+ BUFF_FRONT (last_buff) += cur_len;
+ if (len > cur_len)
+ {
+ last_buff = _cpp_append_extend_buff (pfile, last_buff,
+ len - cur_len);
+ memcpy (BUFF_FRONT (last_buff), base + cur_len,
+ len - cur_len);
+ BUFF_FRONT (last_buff) += len - cur_len;
+ }
+ }
+
+ if (pfile->buffer->cur < pfile->buffer->rlimit)
+ CPP_INCREMENT_LINE (pfile, 0);
+ pfile->buffer->need_line = true;
+
+ if (!_cpp_get_fresh_line (pfile))
+ {
+ source_location src_loc = token->src_loc;
+ token->type = CPP_EOF;
+ /* Tell the compiler the line number of the EOF token. */
+ token->src_loc = pfile->line_table->highest_line;
+ token->flags = BOL;
+ if (first_buff != NULL)
+ _cpp_release_buff (pfile, first_buff);
+ cpp_error_with_line (pfile, CPP_DL_ERROR, src_loc, 0,
+ "unterminated raw string");
+ return;
+ }
+
+ cur = base = pfile->buffer->cur;
+ }
+ else if (c == '\0' && !saw_NUL)
+ LINEMAP_POSITION_FOR_COLUMN (saw_NUL, pfile->line_table,
+ CPP_BUF_COLUMN (pfile->buffer, cur));
+ }
+
+ if (saw_NUL && !pfile->state.skipping)
+ cpp_error_with_line (pfile, CPP_DL_WARNING, saw_NUL, 0,
+ "null character(s) preserved in literal");
+
+ pfile->buffer->cur = cur;
+ if (first_buff == NULL)
+ create_literal (pfile, token, base, cur - base, type);
+ else
+ {
+ uchar *dest = _cpp_unaligned_alloc (pfile, total_len + (cur - base) + 1);
+
+ token->type = type;
+ token->val.str.len = total_len + (cur - base);
+ token->val.str.text = dest;
+ last_buff = first_buff;
+ while (last_buff != NULL)
+ {
+ memcpy (dest, last_buff->base,
+ BUFF_FRONT (last_buff) - last_buff->base);
+ dest += BUFF_FRONT (last_buff) - last_buff->base;
+ last_buff = last_buff->next;
+ }
+ _cpp_release_buff (pfile, first_buff);
+ memcpy (dest, base, cur - base);
+ dest[cur - base] = '\0';
+ }
+}
+
/* Lexes a string, character constant, or angle-bracketed header file
name. The stored string contains the spelling, including opening
- quote and leading any leading 'L', 'u' or 'U'. It returns the type
- of the literal, or CPP_OTHER if it was not properly terminated, or
- CPP_LESS for an unterminated header name which must be relexed as
- normal tokens.
+ quote and any leading 'L', 'u', 'U' or 'u8' and optional
+ 'R' modifier. It returns the type of the literal, or CPP_OTHER
+ if it was not properly terminated, or CPP_LESS for an unterminated
+ header name which must be relexed as normal tokens.
The spelling is NUL-terminated, but it is not guaranteed that this
is the first NUL since embedded NULs are preserved. */
@@ -636,12 +816,24 @@ lex_string (cpp_reader *pfile, cpp_token *token, const uchar *base)
cur = base;
terminator = *cur++;
- if (terminator == 'L' || terminator == 'u' || terminator == 'U')
+ if (terminator == 'L' || terminator == 'U')
terminator = *cur++;
- if (terminator == '\"')
+ else if (terminator == 'u')
+ {
+ terminator = *cur++;
+ if (terminator == '8')
+ terminator = *cur++;
+ }
+ if (terminator == 'R')
+ {
+ lex_raw_string (pfile, token, base, cur);
+ return;
+ }
+ if (terminator == '"')
type = (*base == 'L' ? CPP_WSTRING :
*base == 'U' ? CPP_STRING32 :
- *base == 'u' ? CPP_STRING16 : CPP_STRING);
+ *base == 'u' ? (base[1] == '8' ? CPP_UTF8STRING : CPP_STRING16)
+ : CPP_STRING);
else if (terminator == '\'')
type = (*base == 'L' ? CPP_WCHAR :
*base == 'U' ? CPP_CHAR32 :
@@ -1101,10 +1293,21 @@ _cpp_lex_direct (cpp_reader *pfile)
case 'L':
case 'u':
case 'U':
- /* 'L', 'u' or 'U' may introduce wide characters or strings. */
+ case 'R':
+ /* 'L', 'u', 'U', 'u8' or 'R' may introduce wide characters,
+ wide strings or raw strings. */
if (c == 'L' || CPP_OPTION (pfile, uliterals))
{
- if (*buffer->cur == '\'' || *buffer->cur == '"')
+ if ((*buffer->cur == '\'' && c != 'R')
+ || *buffer->cur == '"'
+ || (*buffer->cur == 'R'
+ && c != 'R'
+ && buffer->cur[1] == '"'
+ && CPP_OPTION (pfile, uliterals))
+ || (*buffer->cur == '8'
+ && c == 'u'
+ && (buffer->cur[1] == '"'
+ || (buffer->cur[1] == 'R' && buffer->cur[2] == '"'))))
{
lex_string (pfile, result, buffer->cur - 1);
break;
@@ -1120,7 +1323,7 @@ _cpp_lex_direct (cpp_reader *pfile)
case 'y': case 'z':
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
case 'G': case 'H': case 'I': case 'J': case 'K':
- case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
+ case 'M': case 'N': case 'O': case 'P': case 'Q':
case 'S': case 'T': case 'V': case 'W': case 'X':
case 'Y': case 'Z':
result->type = CPP_NAME;
diff --git a/libcpp/line-map.c b/libcpp/line-map.c
index 553cc2ab605..a82c4286f07 100644
--- a/libcpp/line-map.c
+++ b/libcpp/line-map.c
@@ -38,8 +38,8 @@ linemap_init (struct line_maps *set)
set->trace_includes = false;
set->depth = 0;
set->cache = 0;
- set->highest_location = 0;
- set->highest_line = 0;
+ set->highest_location = RESERVED_LOCATION_COUNT - 1;
+ set->highest_line = RESERVED_LOCATION_COUNT - 1;
set->max_column_hint = 0;
set->reallocator = 0;
}
diff --git a/libcpp/macro.c b/libcpp/macro.c
index f31805955c6..1d284cf9f8a 100644
--- a/libcpp/macro.c
+++ b/libcpp/macro.c
@@ -379,7 +379,8 @@ stringify_arg (cpp_reader *pfile, macro_arg *arg)
escape_it = (token->type == CPP_STRING || token->type == CPP_CHAR
|| token->type == CPP_WSTRING || token->type == CPP_WCHAR
|| token->type == CPP_STRING32 || token->type == CPP_CHAR32
- || token->type == CPP_STRING16 || token->type == CPP_CHAR16);
+ || token->type == CPP_STRING16 || token->type == CPP_CHAR16
+ || token->type == CPP_UTF8STRING);
/* Room for each char being written in octal, initial space and
final quote and NUL. */
diff --git a/libcpp/po/ChangeLog b/libcpp/po/ChangeLog
index 1a295b5c1f4..e6ce3126a60 100644
--- a/libcpp/po/ChangeLog
+++ b/libcpp/po/ChangeLog
@@ -1,3 +1,7 @@
+2009-10-17 Joseph Myers <joseph@codesourcery.com>
+
+ * cpplib.pot: Regenerate.
+
2009-09-19 Joseph Myers <joseph@codesourcery.com>
* vi.po: Update.
diff --git a/libcpp/po/cpplib.pot b/libcpp/po/cpplib.pot
index 94adf5d08f5..7a5450ff9da 100644
--- a/libcpp/po/cpplib.pot
+++ b/libcpp/po/cpplib.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n"
-"POT-Creation-Date: 2009-04-22 16:24+0000\n"
+"POT-Creation-Date: 2009-10-17 13:36+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -36,7 +36,7 @@ msgid "character 0x%lx is not in the basic source character set\n"
msgstr ""
#: charset.c:790
-#: charset.c:1398
+#: charset.c:1407
msgid "converting to execution character set"
msgstr ""
@@ -50,355 +50,355 @@ msgstr ""
msgid "Character %x might not be NFKC"
msgstr ""
-#: charset.c:980
+#: charset.c:986
msgid "universal character names are only valid in C++ and C99"
msgstr ""
-#: charset.c:983
+#: charset.c:989
#, c-format
msgid "the meaning of '\\%c' is different in traditional C"
msgstr ""
-#: charset.c:992
+#: charset.c:998
msgid "In _cpp_valid_ucn but not a UCN"
msgstr ""
-#: charset.c:1017
+#: charset.c:1023
#, c-format
msgid "incomplete universal character name %.*s"
msgstr ""
-#: charset.c:1029
+#: charset.c:1038
#, c-format
msgid "%.*s is not a valid universal character"
msgstr ""
-#: charset.c:1039
+#: charset.c:1048
#: lex.c:486
msgid "'$' in identifier or number"
msgstr ""
-#: charset.c:1049
+#: charset.c:1058
#, c-format
msgid "universal character %.*s is not valid in an identifier"
msgstr ""
-#: charset.c:1053
+#: charset.c:1062
#, c-format
msgid "universal character %.*s is not valid at the start of an identifier"
msgstr ""
-#: charset.c:1085
-#: charset.c:1628
+#: charset.c:1094
+#: charset.c:1637
msgid "converting UCN to source character set"
msgstr ""
-#: charset.c:1089
+#: charset.c:1098
msgid "converting UCN to execution character set"
msgstr ""
-#: charset.c:1161
+#: charset.c:1170
msgid "the meaning of '\\x' is different in traditional C"
msgstr ""
-#: charset.c:1178
+#: charset.c:1187
msgid "\\x used with no following hex digits"
msgstr ""
-#: charset.c:1185
+#: charset.c:1194
msgid "hex escape sequence out of range"
msgstr ""
-#: charset.c:1223
+#: charset.c:1232
msgid "octal escape sequence out of range"
msgstr ""
-#: charset.c:1289
+#: charset.c:1298
msgid "the meaning of '\\a' is different in traditional C"
msgstr ""
-#: charset.c:1296
+#: charset.c:1305
#, c-format
msgid "non-ISO-standard escape sequence, '\\%c'"
msgstr ""
-#: charset.c:1304
+#: charset.c:1313
#, c-format
-msgid "unknown escape sequence '\\%c'"
+msgid "unknown escape sequence: '\\%c'"
msgstr ""
-#: charset.c:1312
+#: charset.c:1321
#, c-format
msgid "unknown escape sequence: '\\%s'"
msgstr ""
-#: charset.c:1319
+#: charset.c:1328
msgid "converting escape sequence to execution character set"
msgstr ""
-#: charset.c:1463
-#: charset.c:1527
+#: charset.c:1472
+#: charset.c:1536
msgid "character constant too long for its type"
msgstr ""
-#: charset.c:1466
+#: charset.c:1475
msgid "multi-character character constant"
msgstr ""
-#: charset.c:1566
+#: charset.c:1575
msgid "empty character constant"
msgstr ""
-#: charset.c:1675
+#: charset.c:1684
#, c-format
msgid "failure to convert %s to %s"
msgstr ""
-#: directives.c:219
-#: directives.c:245
+#: directives.c:220
+#: directives.c:246
#, c-format
msgid "extra tokens at end of #%s directive"
msgstr ""
-#: directives.c:351
+#: directives.c:352
#, c-format
msgid "#%s is a GCC extension"
msgstr ""
-#: directives.c:355
+#: directives.c:356
#, c-format
msgid "#%s is a deprecated GCC extension"
msgstr ""
-#: directives.c:369
+#: directives.c:370
msgid "suggest not using #elif in traditional C"
msgstr ""
-#: directives.c:372
+#: directives.c:373
#, c-format
msgid "traditional C ignores #%s with the # indented"
msgstr ""
-#: directives.c:376
+#: directives.c:377
#, c-format
msgid "suggest hiding #%s from traditional C with an indented #"
msgstr ""
-#: directives.c:402
+#: directives.c:403
msgid "embedding a directive within macro arguments is not portable"
msgstr ""
-#: directives.c:422
+#: directives.c:423
msgid "style of line directive is a GCC extension"
msgstr ""
-#: directives.c:477
+#: directives.c:478
#, c-format
msgid "invalid preprocessing directive #%s"
msgstr ""
-#: directives.c:545
+#: directives.c:546
msgid "\"defined\" cannot be used as a macro name"
msgstr ""
-#: directives.c:551
+#: directives.c:552
#, c-format
msgid "\"%s\" cannot be used as a macro name as it is an operator in C++"
msgstr ""
-#: directives.c:554
+#: directives.c:555
#, c-format
msgid "no macro name given in #%s directive"
msgstr ""
-#: directives.c:557
+#: directives.c:558
msgid "macro names must be identifiers"
msgstr ""
-#: directives.c:606
+#: directives.c:607
#, c-format
msgid "undefining \"%s\""
msgstr ""
-#: directives.c:661
+#: directives.c:662
msgid "missing terminating > character"
msgstr ""
-#: directives.c:716
+#: directives.c:720
#, c-format
msgid "#%s expects \"FILENAME\" or <FILENAME>"
msgstr ""
-#: directives.c:760
+#: directives.c:766
#, c-format
msgid "empty filename in #%s"
msgstr ""
-#: directives.c:770
+#: directives.c:776
msgid "#include nested too deeply"
msgstr ""
-#: directives.c:811
+#: directives.c:817
msgid "#include_next in primary source file"
msgstr ""
-#: directives.c:837
+#: directives.c:843
#, c-format
msgid "invalid flag \"%s\" in line directive"
msgstr ""
-#: directives.c:897
+#: directives.c:903
msgid "unexpected end of file after #line"
msgstr ""
-#: directives.c:900
+#: directives.c:906
#, c-format
msgid "\"%s\" after #line is not a positive integer"
msgstr ""
-#: directives.c:906
-#: directives.c:908
+#: directives.c:912
+#: directives.c:914
msgid "line number out of range"
msgstr ""
-#: directives.c:921
-#: directives.c:1001
+#: directives.c:927
+#: directives.c:1007
#, c-format
msgid "\"%s\" is not a valid filename"
msgstr ""
-#: directives.c:961
+#: directives.c:967
#, c-format
msgid "\"%s\" after # is not a positive integer"
msgstr ""
-#: directives.c:1045
+#: directives.c:1059
#, c-format
msgid "%s"
msgstr ""
-#: directives.c:1069
+#: directives.c:1083
#, c-format
msgid "invalid #%s directive"
msgstr ""
-#: directives.c:1132
+#: directives.c:1146
#, c-format
msgid "registering pragmas in namespace \"%s\" with mismatched name expansion"
msgstr ""
-#: directives.c:1141
+#: directives.c:1155
#, c-format
msgid "registering pragma \"%s\" with name expansion and no namespace"
msgstr ""
-#: directives.c:1159
+#: directives.c:1173
#, c-format
msgid "registering \"%s\" as both a pragma and a pragma namespace"
msgstr ""
-#: directives.c:1162
+#: directives.c:1176
#, c-format
msgid "#pragma %s %s is already registered"
msgstr ""
-#: directives.c:1165
+#: directives.c:1179
#, c-format
msgid "#pragma %s is already registered"
msgstr ""
-#: directives.c:1195
+#: directives.c:1209
msgid "registering pragma with NULL handler"
msgstr ""
-#: directives.c:1405
+#: directives.c:1419
msgid "#pragma once in main file"
msgstr ""
-#: directives.c:1428
+#: directives.c:1442
msgid "invalid #pragma GCC poison directive"
msgstr ""
-#: directives.c:1437
+#: directives.c:1451
#, c-format
msgid "poisoning existing macro \"%s\""
msgstr ""
-#: directives.c:1456
+#: directives.c:1470
msgid "#pragma system_header ignored outside include file"
msgstr ""
-#: directives.c:1480
+#: directives.c:1495
#, c-format
msgid "cannot find source file %s"
msgstr ""
-#: directives.c:1484
+#: directives.c:1499
#, c-format
msgid "current file is older than %s"
msgstr ""
-#: directives.c:1668
+#: directives.c:1683
msgid "_Pragma takes a parenthesized string literal"
msgstr ""
-#: directives.c:1769
+#: directives.c:1784
msgid "#else without #if"
msgstr ""
-#: directives.c:1774
+#: directives.c:1789
msgid "#else after #else"
msgstr ""
-#: directives.c:1776
-#: directives.c:1809
+#: directives.c:1791
+#: directives.c:1824
msgid "the conditional began here"
msgstr ""
-#: directives.c:1802
+#: directives.c:1817
msgid "#elif without #if"
msgstr ""
-#: directives.c:1807
+#: directives.c:1822
msgid "#elif after #else"
msgstr ""
-#: directives.c:1845
+#: directives.c:1860
msgid "#endif without #if"
msgstr ""
-#: directives.c:1922
+#: directives.c:1940
msgid "missing '(' after predicate"
msgstr ""
-#: directives.c:1937
+#: directives.c:1955
msgid "missing ')' to complete answer"
msgstr ""
-#: directives.c:1957
+#: directives.c:1975
msgid "predicate's answer is empty"
msgstr ""
-#: directives.c:1984
+#: directives.c:2002
msgid "assertion without predicate"
msgstr ""
-#: directives.c:1986
+#: directives.c:2005
msgid "predicate must be an identifier"
msgstr ""
-#: directives.c:2072
+#: directives.c:2091
#, c-format
msgid "\"%s\" re-asserted"
msgstr ""
-#: directives.c:2371
+#: directives.c:2391
#, c-format
msgid "unterminated #%s"
msgstr ""
#: directives-only.c:222
-#: lex.c:1149
+#: lex.c:1155
#: traditional.c:163
msgid "unterminated comment"
msgstr ""
@@ -412,243 +412,243 @@ msgstr ""
msgid "%s: %s"
msgstr ""
-#: expr.c:278
+#: expr.c:279
msgid "too many decimal points in number"
msgstr ""
-#: expr.c:307
-#: expr.c:389
+#: expr.c:308
+#: expr.c:390
msgid "fixed-point constants are a GCC extension"
msgstr ""
-#: expr.c:320
+#: expr.c:321
#, c-format
msgid "invalid digit \"%c\" in binary constant"
msgstr ""
-#: expr.c:322
+#: expr.c:323
#, c-format
msgid "invalid digit \"%c\" in octal constant"
msgstr ""
-#: expr.c:330
+#: expr.c:331
msgid "invalid prefix \"0b\" for floating constant"
msgstr ""
-#: expr.c:336
+#: expr.c:337
msgid "use of C99 hexadecimal floating constant"
msgstr ""
-#: expr.c:345
+#: expr.c:346
msgid "exponent has no digits"
msgstr ""
-#: expr.c:352
+#: expr.c:353
msgid "hexadecimal floating constants require an exponent"
msgstr ""
-#: expr.c:358
+#: expr.c:359
#, c-format
msgid "invalid suffix \"%.*s\" on floating constant"
msgstr ""
-#: expr.c:368
-#: expr.c:417
+#: expr.c:369
+#: expr.c:418
#, c-format
msgid "traditional C rejects the \"%.*s\" suffix"
msgstr ""
-#: expr.c:376
+#: expr.c:377
msgid "suffix for double constant is a GCC extension"
msgstr ""
-#: expr.c:382
+#: expr.c:383
#, c-format
msgid "invalid suffix \"%.*s\" with hexadecimal floating constant"
msgstr ""
-#: expr.c:393
+#: expr.c:394
msgid "decimal float constants are a GCC extension"
msgstr ""
-#: expr.c:403
+#: expr.c:404
#, c-format
msgid "invalid suffix \"%.*s\" on integer constant"
msgstr ""
-#: expr.c:426
+#: expr.c:427
msgid "use of C++0x long long integer constant"
msgstr ""
-#: expr.c:435
+#: expr.c:436
msgid "imaginary constants are a GCC extension"
msgstr ""
-#: expr.c:438
+#: expr.c:439
msgid "binary constants are a GCC extension"
msgstr ""
-#: expr.c:531
+#: expr.c:532
msgid "integer constant is too large for its type"
msgstr ""
-#: expr.c:543
+#: expr.c:563
msgid "integer constant is so large that it is unsigned"
msgstr ""
-#: expr.c:638
+#: expr.c:658
msgid "missing ')' after \"defined\""
msgstr ""
-#: expr.c:645
+#: expr.c:665
msgid "operator \"defined\" requires an identifier"
msgstr ""
-#: expr.c:653
+#: expr.c:673
#, c-format
msgid "(\"%s\" is an alternative token for \"%s\" in C++)"
msgstr ""
-#: expr.c:663
+#: expr.c:683
msgid "this use of \"defined\" may not be portable"
msgstr ""
-#: expr.c:716
+#: expr.c:736
msgid "floating constant in preprocessor expression"
msgstr ""
-#: expr.c:722
+#: expr.c:742
msgid "imaginary number in preprocessor expression"
msgstr ""
-#: expr.c:769
+#: expr.c:789
#, c-format
msgid "\"%s\" is not defined"
msgstr ""
-#: expr.c:781
+#: expr.c:801
msgid "assertions are a GCC extension"
msgstr ""
-#: expr.c:784
+#: expr.c:804
msgid "assertions are a deprecated extension"
msgstr ""
-#: expr.c:917
-#: expr.c:946
+#: expr.c:937
+#: expr.c:966
#, c-format
msgid "missing binary operator before token \"%s\""
msgstr ""
-#: expr.c:937
+#: expr.c:957
#, c-format
msgid "token \"%s\" is not valid in preprocessor expressions"
msgstr ""
-#: expr.c:954
+#: expr.c:974
msgid "missing expression between '(' and ')'"
msgstr ""
-#: expr.c:957
+#: expr.c:977
#, c-format
msgid "%s with no expression"
msgstr ""
-#: expr.c:960
+#: expr.c:980
#, c-format
msgid "operator '%s' has no right operand"
msgstr ""
-#: expr.c:965
+#: expr.c:985
#, c-format
msgid "operator '%s' has no left operand"
msgstr ""
-#: expr.c:991
+#: expr.c:1011
msgid " ':' without preceding '?'"
msgstr ""
-#: expr.c:1019
+#: expr.c:1039
#, c-format
msgid "unbalanced stack in %s"
msgstr ""
-#: expr.c:1039
+#: expr.c:1059
#, c-format
msgid "impossible operator '%u'"
msgstr ""
-#: expr.c:1140
+#: expr.c:1160
msgid "missing ')' in expression"
msgstr ""
-#: expr.c:1169
+#: expr.c:1189
msgid "'?' without following ':'"
msgstr ""
-#: expr.c:1179
+#: expr.c:1199
msgid "integer overflow in preprocessor expression"
msgstr ""
-#: expr.c:1184
+#: expr.c:1204
msgid "missing '(' in expression"
msgstr ""
-#: expr.c:1216
+#: expr.c:1236
#, c-format
msgid "the left operand of \"%s\" changes sign when promoted"
msgstr ""
-#: expr.c:1221
+#: expr.c:1241
#, c-format
msgid "the right operand of \"%s\" changes sign when promoted"
msgstr ""
-#: expr.c:1480
+#: expr.c:1500
msgid "traditional C rejects the unary plus operator"
msgstr ""
-#: expr.c:1563
+#: expr.c:1583
msgid "comma operator in operand of #if"
msgstr ""
-#: expr.c:1695
+#: expr.c:1719
msgid "division by zero in #if"
msgstr ""
-#: files.c:457
+#: files.c:463
msgid "NULL directory in find_file"
msgstr ""
-#: files.c:494
+#: files.c:500
msgid "one or more PCH files were found, but they were invalid"
msgstr ""
-#: files.c:497
+#: files.c:503
msgid "use -Winvalid-pch for more information"
msgstr ""
-#: files.c:588
+#: files.c:594
#, c-format
msgid "%s is a block device"
msgstr ""
-#: files.c:605
+#: files.c:611
#, c-format
msgid "%s is too large"
msgstr ""
-#: files.c:640
+#: files.c:646
#, c-format
msgid "%s is shorter than expected"
msgstr ""
-#: files.c:875
+#: files.c:881
#, c-format
msgid "no include path in which to search for %s"
msgstr ""
-#: files.c:1286
+#: files.c:1306
msgid "Multiple include guards may be useful for:\n"
msgstr ""
@@ -740,28 +740,33 @@ msgstr ""
msgid "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro"
msgstr ""
-#: lex.c:675
+#: lex.c:567
+#, c-format
+msgid "identifier \"%s\" is a special operator name in C++"
+msgstr ""
+
+#: lex.c:681
msgid "null character(s) preserved in literal"
msgstr ""
-#: lex.c:678
+#: lex.c:684
#, c-format
msgid "missing terminating %c character"
msgstr ""
-#: lex.c:1160
+#: lex.c:1166
msgid "C++ style comments are not allowed in ISO C90"
msgstr ""
-#: lex.c:1162
+#: lex.c:1168
msgid "(this will be reported only once per input file)"
msgstr ""
-#: lex.c:1167
+#: lex.c:1173
msgid "multi-line comment"
msgstr ""
-#: lex.c:1487
+#: lex.c:1493
#, c-format
msgid "unspellable token %s"
msgstr ""
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index 8484f0c1a3e..651a01e0b6e 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,8 @@
+2009-11-02 Andreas Tobler <a.tobler@schweiz.org>
+
+ PR libffi/41908
+ * testsuite/libffi.call/testclosure.c: New test.
+
2009-09-28 Kai Tietz <kai.tietz@onevision.com>
* src/x86/win64.S (_ffi_call_win64 stack): Remove for gnu
diff --git a/libffi/testsuite/libffi.call/testclosure.c b/libffi/testsuite/libffi.call/testclosure.c
new file mode 100644
index 00000000000..161cc891798
--- /dev/null
+++ b/libffi/testsuite/libffi.call/testclosure.c
@@ -0,0 +1,70 @@
+/* Area: closure_call
+ Purpose: Check return value float.
+ Limitations: none.
+ PR: 41908.
+ Originator: <rfm@gnu.org> 20091102 */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+typedef struct cls_struct_combined {
+ float a;
+ float b;
+ float c;
+ float d;
+} cls_struct_combined;
+
+void cls_struct_combined_fn(struct cls_struct_combined arg)
+{
+ printf("%g %g %g %g\n",
+ arg.a, arg.b,
+ arg.c, arg.d);
+ fflush(stdout);
+}
+
+static void
+cls_struct_combined_gn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__,
+ void** args, void* userdata __UNUSED__)
+{
+ struct cls_struct_combined a0;
+
+ a0 = *(struct cls_struct_combined*)(args[0]);
+
+ cls_struct_combined_fn(a0);
+}
+
+
+int main (void)
+{
+ ffi_cif cif;
+ void *code;
+ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+ ffi_type* cls_struct_fields0[5];
+ ffi_type cls_struct_type0;
+ ffi_type* dbl_arg_types[5];
+
+ cls_struct_type0.size = 0;
+ cls_struct_type0.alignment = 0;
+ cls_struct_type0.type = FFI_TYPE_STRUCT;
+ cls_struct_type0.elements = cls_struct_fields0;
+
+ struct cls_struct_combined g_dbl = {4.0, 5.0, 1.0, 8.0};
+
+ cls_struct_fields0[0] = &ffi_type_float;
+ cls_struct_fields0[1] = &ffi_type_float;
+ cls_struct_fields0[2] = &ffi_type_float;
+ cls_struct_fields0[3] = &ffi_type_float;
+ cls_struct_fields0[4] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type0;
+ dbl_arg_types[1] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_void,
+ dbl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_combined_gn, NULL, code) == FFI_OK);
+
+ ((void(*)(cls_struct_combined)) (code))(g_dbl);
+ /* { dg-output "4 5 1 8" } */
+ exit(0);
+}
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index d10d5cc4630..2db5d2901c8 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,34 @@
+2009-10-26 Nick Clifton <nickc@redhat.com>
+
+ * config.host: Add support for RX target.
+ * config/rx: New directory.
+ * config/rx/rx-abi-functions.c: New file. Supplementary
+ functions for libgcc to support the RX ABI.
+ * config/rx/rx-abi.h: New file. Supplementary header file for
+ libgcc RX ABI functions.
+ * config/rx/t-rx: New file: Makefile fragment for building
+ libgcc for the RX.
+
+2009-10-09 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/32/sfp-machine.h (__FP_FRAC_SUB_4): Change operand
+ constraint of y0 to "g".
+
+2009-10-07 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * config.host: Include the s390 makefile fragments.
+ * config/s390/32/_fixdfdi.c: New file.
+ * config/s390/32/_fixsfdi.c: New file.
+ * config/s390/32/_fixtfdi.c: New file.
+ * config/s390/32/_fixunsdfdi.c: New file.
+ * config/s390/32/_fixunssfdi.c: New file.
+ * config/s390/32/_fixunstfdi.c: New file.
+ * config/s390/32/t-floattodi: New file.
+ * config/s390/libgcc-glibc.ver: New file.
+ * config/s390/t-crtstuff: New file.
+ * config/s390/t-linux: New file.
+ * config/s390/t-tpf: New file.
+
2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* configure.ac (AC_PREREQ): Bump to 2.64.
@@ -32,7 +63,7 @@
2009-06-22 Kai Tietz <kai.tietz@onevision.com>
* config.host: Add i386/${host_address}/t-fprules-softfp and
- t-softfp to tmake_file for i[34567]86-*-mingw*, x86_64-*-mingw*.
+ t-softfp to tmake_file for i[34567]86-*-mingw*, x86_64-*-mingw*.
* config/i386/64/_divtc3.c: Disable usage of .symver assembly symbol
for mingw targets.
@@ -59,7 +90,7 @@
2009-05-29 David Billinghurst <billingd@gcc.gnu.org>
* config.host: Add i386/${host_address}/t-fprules-softfp and
- t-softfp to tmake_file for i[34567]86-*-cygwin*.
+ t-softfp to tmake_file for i[34567]86-*-cygwin*.
2009-04-17 Aurelien Jarno <aurelien@aurel32.net>
@@ -394,7 +425,7 @@
* config.host: Add i386/${host_address}/t-fprules-softfp to
tmake_file for i[34567]86-*-darwin*, x86_64-*-darwin*,
- i[34567]86-*-linux*, x86_64-*-linux*.
+ i[34567]86-*-linux*, x86_64-*-linux*.
* configure.ac: Set host_address to 64 or 32 for x86.
* configure: Regenerated.
@@ -490,7 +521,7 @@
* Makefile.in: Use @shlib_slibdir@ substitution to get
correct install name on darwin.
* config/t-slibgcc-darwin: Use @shlib_slibdir@ for -install_name.
-
+
2007-12-15 Hans-Peter Nilsson <hp@axis.com>
* config.host (crisv32-*-elf, crisv32-*-none): New, same as
@@ -550,7 +581,7 @@
* config/t-tls: New file.
- * Makefile.in (INTERNAL_CFLAGS): Add @set_have_cc_tls@.
+ * Makefile.in (INTERNAL_CFLAGS): Add @set_have_cc_tls@.
* configure.ac: Include ../config/enable.m4 and
../config/tls.m4. Use GCC_CHECK_CC_TLS to check if assembler
@@ -564,7 +595,7 @@
2007-06-14 Danny Smith <dannysmith@users.sourceforge.net>
* config.host(*-cygwin* |*-mingw* ): Add crtbegin.o, crtend.o to
- extra_parts. Add config/i386/t-cygming to tmake_file.
+ extra_parts. Add config/i386/t-cygming to tmake_file.
* config/i386/t-cygming: New file with rules for crtbegin.o, crtend.o.
2007-05-29 Zuxy Meng <zuxy.meng@gmail.com>
@@ -689,7 +720,7 @@
* configure.ac: Add GCC_TOPLEV_SUBDIRS.
* configure: Regenerate.
* Makefile.in (host_subdir): Substitute it.
- (gcc_objdir): Use it.
+ (gcc_objdir): Use it.
2007-01-04 Daniel Jacobowitz <dan@codesourcery.com>
diff --git a/libgcc/config.host b/libgcc/config.host
index da4600489ba..f0861159adc 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -482,11 +482,18 @@ rs6000-ibm-aix5.1.* | powerpc-ibm-aix5.1.*)
;;
rs6000-ibm-aix[56789].* | powerpc-ibm-aix[56789].*)
;;
+rx-*-elf)
+ extra_parts="crtbegin.o crtend.o"
+ tmake_file="rx/t-rx"
+ ;;
s390-*-linux*)
+ tmake_file="${tmake_file} s390/t-crtstuff s390/t-linux s390/32/t-floattodi"
;;
s390x-*-linux*)
+ tmake_file="${tmake_file} s390/t-crtstuff s390/t-linux"
;;
s390x-ibm-tpf*)
+ tmake_file="${tmake_file} s390/t-crtstuff s390/t-tpf"
;;
score-*-elf)
;;
diff --git a/libgcc/config/i386/32/sfp-machine.h b/libgcc/config/i386/32/sfp-machine.h
index 746ae7c1287..85ddb74b643 100644
--- a/libgcc/config/i386/32/sfp-machine.h
+++ b/libgcc/config/i386/32/sfp-machine.h
@@ -38,9 +38,6 @@ typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__)));
"g" ((USItype) (y1)), \
"%2" ((USItype) (x0)), \
"g" ((USItype) (y0)))
-
-/* FIXME: Change last operand constraint
- from "im" to "g" when reload works properly. */
#define __FP_FRAC_SUB_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0) \
__asm__ ("sub{l} {%11,%3|%3,%11}\n\t" \
"sbb{l} {%9,%2|%2,%9}\n\t" \
@@ -57,7 +54,7 @@ typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__)));
"2" ((USItype) (x1)), \
"g" ((USItype) (y1)), \
"3" ((USItype) (x0)), \
- "im" ((USItype) (y0)))
+ "g" ((USItype) (y0)))
#define __FP_FRAC_SUB_3(r2,r1,r0,x2,x1,x0,y2,y1,y0) \
__asm__ ("sub{l} {%8,%2|%2,%8}\n\t" \
"sbb{l} {%6,%1|%1,%6}\n\t" \
diff --git a/libgcc/config/rx/rx-abi-functions.c b/libgcc/config/rx/rx-abi-functions.c
new file mode 100644
index 00000000000..10dd9530d6b
--- /dev/null
+++ b/libgcc/config/rx/rx-abi-functions.c
@@ -0,0 +1,90 @@
+/* RX C ABI functions
+ Copyright (C) 2009 Free Software Foundation, Inc.
+ Contributed by Red Hat.
+
+ 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
+ along with GCC; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+
+/* The RX C ABI includes the specification of a set of compiler support
+ functions. Libgcc2 includes some of them, although the names have to
+ be changed (see rx-abi.h), and the rest are defined here.
+
+ FIXME: Given that FINE_GRAINED_LIBRARIES is defined we ought to consider
+ compiling this file multiple times with one function per iteration being
+ compiled. */
+
+#ifdef __RX_64BIT_DOUBLES__
+
+int _COM_CMPLTd (double a, double b) { return __ltdf2 (a, b) == -1; }
+int _COM_CMPGTd (double a, double b) { return __gtdf2 (a, b) == 1; }
+int _COM_CMPLEd (double a, double b) { return __ledf2 (a, b) != 1; }
+int _COM_CMPGEd (double a, double b) { return __gedf2 (a, b) != -1; }
+int _COM_CMPEQd (double a, double b) { return __eqdf2 (a, b) == 0; }
+int _COM_CMPNEd (double a, double b) { return __nedf2 (a, b) != 0; }
+
+int _COM_CMPLTf (double, double) __attribute__ ((weak, alias ("_COM_CMPLTd")));
+int _COM_CMPGTf (double, double) __attribute__ ((weak, alias ("_COM_CMPGTd")));
+int _COM_CMPLEf (double, double) __attribute__ ((weak, alias ("_COM_CMPLEd")));
+int _COM_CMPGEf (double, double) __attribute__ ((weak, alias ("_COM_CMPGEd")));
+int _COM_CMPEQf (double, double) __attribute__ ((weak, alias ("_COM_CMPEQd")));
+int _COM_CMPNEf (double, double) __attribute__ ((weak, alias ("_COM_CMPNEd")));
+
+#else /* 32-bit doubles. */
+
+double _COM_CONVfd (float a) { return a; }
+float _COM_CONVdf (double a) { return a; }
+
+int _COM_CMPLTd (double a, double b) __attribute__ ((weak, alias ("_COM_CMPLTf")));
+int _COM_CMPGTd (double a, double b) __attribute__ ((weak, alias ("_COM_CMPGTf")));
+int _COM_CMPLEd (double a, double b) __attribute__ ((weak, alias ("_COM_CMPLEf")));
+int _COM_CMPGEd (double a, double b) __attribute__ ((weak, alias ("_COM_CMPGEf")));
+int _COM_CMPEQd (double a, double b) __attribute__ ((weak, alias ("_COM_CMPEQf")));
+int _COM_CMPNEd (double a, double b) __attribute__ ((weak, alias ("_COM_CMPNEf")));
+
+signed long long _COM_CONVd64s (double a) { return (signed long long) a; }
+unsigned long long _COM_CONVd64u (double a) { return (unsigned long long) a; }
+
+int _COM_CMPLTf (float a, float b) { return __ltsf2 (a, b) == -1; }
+int _COM_CMPGTf (float a, float b) { return __gtsf2 (a, b) == 1; }
+int _COM_CMPLEf (float a, float b) { return __lesf2 (a, b) != 1; }
+int _COM_CMPGEf (float a, float b) { return __gesf2 (a, b) != -1; }
+int _COM_CMPEQf (float a, float b) { return __eqsf2 (a, b) == 0; }
+int _COM_CMPNEf (float a, float b) { return __nesf2 (a, b) != 0; }
+
+#endif /* 64-bit vs 32-bit doubles. */
+
+double _COM_CONV64sd (signed long long a) { return (double) a; }
+double _COM_CONV64ud (unsigned long long a) { return (double) a; }
+
+extern int __cmpdi2 (long long, long long);
+extern int __ucmpdi2 (long long, long long);
+
+int _COM_CMPLT64s (long long a, long long b) { return __cmpdi2 (a, b) == 0; }
+int _COM_CMPLT64u (long long a, long long b) { return __ucmpdi2 (a, b) == 0; }
+int _COM_CMPGT64s (long long a, long long b) { return __cmpdi2 (a, b) == 2; }
+int _COM_CMPGT64u (long long a, long long b) { return __ucmpdi2 (a, b) == 2; }
+int _COM_CMPLE64s (long long a, long long b) { return __cmpdi2 (a, b) != 2; }
+int _COM_CMPLE64u (long long a, long long b) { return __ucmpdi2 (a, b) != 2; }
+int _COM_CMPGE64s (long long a, long long b) { return __cmpdi2 (a, b) != 0; }
+int _COM_CMPGE64u (long long a, long long b) { return __ucmpdi2 (a, b) != 0; }
+int _COM_CMPEQ64 (long long a, long long b) { return __cmpdi2 (a, b) == 1; }
+int _COM_CMPNE64 (long long a, long long b) { return __cmpdi2 (a, b) != 1; }
+
diff --git a/libgcc/config/rx/rx-abi.h b/libgcc/config/rx/rx-abi.h
new file mode 100644
index 00000000000..8a0bbdcd82c
--- /dev/null
+++ b/libgcc/config/rx/rx-abi.h
@@ -0,0 +1,235 @@
+/* Header file for RX ABI versions of libgcc functions.
+ Copyright (C) 2009
+ Free Software Foundation, Inc.
+ Contributed by Red Hat.
+
+ 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
+ along with GCC; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+/* Make __COM_<RX_NAME> an alias for __<GCC_NAME>. */
+#define RENAME_LIBRARY(GCC_NAME, RX_NAME) \
+ __asm__ (".globl\t__COM_" #RX_NAME "\n" \
+ ".set\t__COM_" #RX_NAME ", ___" #GCC_NAME "\n");
+
+
+/* The long-long aliases... */
+
+#ifdef L_muldi3
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (muldi3, MUL64)
+#endif
+
+#ifdef L_divdi3
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (divdi3, DIV64s)
+#endif
+
+#ifdef L_udivdi3
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (udivdi3, DIV64u)
+#endif
+
+#ifdef L_ashldi3
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (ashldi3, SHLL64)
+#endif
+
+#ifdef L_lshrdi3
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (lshrdi3, SHLR64)
+#endif
+
+#ifdef L_ashrdi3
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (ashrdi3, SHAR64)
+#endif
+
+#ifdef L_fixsfdi
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixsfdi, CONVf64s)
+#endif
+
+#ifdef L_fixunssfdi
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunssfdi, CONVf64u)
+#endif
+
+#ifdef L_floatdisf
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatdisf, CONV64sf)
+#endif
+
+#ifdef L_floatundisf
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatundisf, CONV64uf)
+#endif
+
+#ifdef L_moddi3
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (moddi3, MOD64s)
+#endif
+
+#ifdef L_umoddi3
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (umoddi3, MOD64u)
+#endif
+
+
+#ifdef L_si_to_sf
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatsisf, CONV32sf)
+#endif
+
+#ifdef L_usi_to_sf
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatunsisf, CONV32uf)
+#endif
+
+
+
+#ifdef __RX_64BIT_DOUBLES__
+
+/* Float (32-bit) aliases... */
+
+#ifdef L_sf_to_si
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixsfsi, CONVf32s)
+#endif
+
+#ifdef L_fixunssfsi
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunssfsi, CONVf32u)
+#endif
+
+#ifdef L_addsub_sf
+#define DECLARE_LIBRARY_RENAMES \
+ RENAME_LIBRARY (addsf3, ADDf) \
+ RENAME_LIBRARY (subsf3, SUBf)
+#endif
+
+#ifdef L_mul_sf
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (mulsf3, MULf)
+#endif
+
+#ifdef L_div_sf
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (divsf3, DIVf)
+#endif
+
+/* Double (64-bit) aliases... */
+
+#ifdef L_addsub_df
+#define DECLARE_LIBRARY_RENAMES \
+ RENAME_LIBRARY (adddf3, ADDd) \
+ RENAME_LIBRARY (subdf3, SUBd)
+#endif
+
+#ifdef L_mul_df
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (muldf3, MULd)
+#endif
+
+#ifdef L_div_df
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (divdf3, DIVd)
+#endif
+
+#ifdef L_fixdfdi
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixdfdi, CONVd64s)
+#endif
+
+#ifdef L_fixunsdfdi
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunsdfdi, CONVd64u)
+#endif
+
+#ifdef L_floatdidf
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatdisf, CONV64sd)
+#endif
+
+#ifdef L_floatundidf
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatdisf, CONV64ud)
+#endif
+
+#ifdef L_df_to_si
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixdfsi, CONVd32s)
+#endif
+
+#ifdef L_fixunsdfsi
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunsdfsi, CONVd32u)
+#endif
+
+#ifdef L_si_to_df
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatsidf, CONV32sd)
+#endif
+
+#ifdef L_usi_to_df
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatunsidf, CONV32ud)
+#endif
+
+#ifdef L_sf_to_df
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (extendsfdf2, CONVfd)
+#endif
+
+#ifdef L_df_to_sf
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (truncdfsf2, CONVdf)
+#endif
+
+#ifdef L_negate_df
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (negdf2, NEGd)
+#endif
+
+/* The 64-bit comparison functions do not have aliases because libgcc2
+ does not provide them. Instead they have to be supplied in
+ rx-abi-functions.c. */
+
+
+#else /* 32-bit doubles. */
+
+
+#ifdef L_addsub_sf
+#define DECLARE_LIBRARY_RENAMES \
+ RENAME_LIBRARY (addsf3, ADDd) \
+ RENAME_LIBRARY (subsf3, SUBd) \
+ RENAME_LIBRARY (addsf3, ADDf) \
+ RENAME_LIBRARY (subsf3, SUBf)
+#endif
+
+#ifdef L_mul_sf
+#define DECLARE_LIBRARY_RENAMES \
+ RENAME_LIBRARY (mulsf3, MULd) \
+ RENAME_LIBRARY (mulsf3, MULf)
+#endif
+
+#ifdef L_div_sf
+#define DECLARE_LIBRARY_RENAMES \
+ RENAME_LIBRARY (divsf3, DIVd) \
+ RENAME_LIBRARY (divsf3, DIVf)
+#endif
+
+#ifdef L_sf_to_si
+#define DECLARE_LIBRARY_RENAMES \
+ RENAME_LIBRARY (fixsfsi, CONVd32s) \
+ RENAME_LIBRARY (fixsfsi, CONVf32s)
+#endif
+
+#ifdef L_fixunssfsi
+#define DECLARE_LIBRARY_RENAMES \
+ RENAME_LIBRARY (fixunssfsi, CONVd32u) \
+ RENAME_LIBRARY (fixunssfsi, CONVf32u)
+#endif
+
+#ifdef L_si_to_sf
+#define DECLARE_LIBRARY_RENAMES \
+ RENAME_LIBRARY (floatsisf, CONV32sd) \
+ RENAME_LIBRARY (floatsisf, CONV32sf)
+#endif
+
+#ifdef L_usi_to_sf
+#define DECLARE_LIBRARY_RENAMES \
+ RENAME_LIBRARY (floatunsisf, CONV32ud) \
+ RENAME_LIBRARY (floatunsisf, CONV32uf)
+#endif
+
+#ifdef L_negate_sf
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (negsf2, NEGd)
+#endif
+
+#endif /* 64-bit vs 32-bit doubles. */
diff --git a/libgcc/config/rx/t-rx b/libgcc/config/rx/t-rx
new file mode 100644
index 00000000000..1e66af0c8d3
--- /dev/null
+++ b/libgcc/config/rx/t-rx
@@ -0,0 +1,44 @@
+# Makefile fragment for building LIBGCC for the Renesas RX target.
+# Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+# Contributed by Red Hat.
+#
+# 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/>.
+
+
+# Add functions required by the RX ABI which are not part of
+# the normal libgcc sources:
+
+LIB2ADD = $(srcdir)/config/rx/rx-abi-functions.c
+
+
+# We need special handling of the floating point conversion
+# routines, to allow for the varying size of a double:
+
+FPBIT = fp-bit.c
+$(gcc_objdir)/fp-bit.c: $(gcc_srcdir)/config/fp-bit.c
+ echo '#define FLOAT' > $@
+ echo '#ifndef __RX_64BIT_DOUBLES__' >> $@
+ echo '#define DF SF' >> $@
+ echo '#define FLOAT_ONLY' >> $@
+ echo '#endif' >> $@
+ cat $(gcc_srcdir)/config/fp-bit.c >> $@
+
+DPBIT = dp-bit.c
+$(gcc_objdir)/dp-bit.c: $(gcc_srcdir)/config/fp-bit.c
+ echo '#ifdef __RX_64BIT_DOUBLES__' > $@
+ cat $(gcc_srcdir)/config/fp-bit.c >> $@
+ echo '#endif' >> $@
diff --git a/libgcc/config/s390/32/_fixdfdi.c b/libgcc/config/s390/32/_fixdfdi.c
new file mode 100644
index 00000000000..364849c2d56
--- /dev/null
+++ b/libgcc/config/s390/32/_fixdfdi.c
@@ -0,0 +1,97 @@
+/* Definitions of target machine for GNU compiler, for IBM S/390
+ Copyright (C) 1999, 2000, 2001, 2007, 2008 and 2009
+ Free Software Foundation, Inc.
+ Contributed by Hartmut Penner (hpenner@de.ibm.com) and
+ Ulrich Weigand (uweigand@de.ibm.com).
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+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/>. */
+
+#define EXPD(fp) (((fp.l.upper) >> 20) & 0x7FF)
+#define EXCESSD 1022
+#define SIGNBIT 0x80000000
+#define SIGND(fp) ((fp.l.upper) & SIGNBIT)
+#define MANTD_LL(fp) ((fp.ll & (HIDDEND_LL-1)) | HIDDEND_LL)
+#define FRACD_LL(fp) (fp.ll & (HIDDEND_LL-1))
+#define HIDDEND_LL ((UDItype_x)1 << 52)
+
+typedef int DItype_x __attribute__ ((mode (DI)));
+typedef unsigned int UDItype_x __attribute__ ((mode (DI)));
+typedef int SItype_x __attribute__ ((mode (SI)));
+typedef unsigned int USItype_x __attribute__ ((mode (SI)));
+
+union double_long {
+ double d;
+ struct {
+ SItype_x upper;
+ USItype_x lower;
+ } l;
+ UDItype_x ll;
+};
+
+DItype_x __fixdfdi (double a1);
+
+/* convert double to int */
+DItype_x
+__fixdfdi (double a1)
+{
+ register union double_long dl1;
+ register int exp;
+ register DItype_x l;
+
+ dl1.d = a1;
+
+ /* +/- 0, denormalized */
+
+ if (!EXPD (dl1))
+ return 0;
+
+ exp = EXPD (dl1) - EXCESSD - 53;
+
+ /* number < 1 */
+
+ if (exp < -53)
+ return 0;
+
+ /* NaN */
+
+ if ((EXPD(dl1) == 0x7ff) && (FRACD_LL(dl1) != 0)) /* NaN */
+ return 0x8000000000000000ULL;
+
+ /* Number big number & +/- inf */
+
+ if (exp >= 11) {
+ l = (long long)1<<63;
+ if (!SIGND(dl1))
+ l--;
+ return l;
+ }
+
+ l = MANTD_LL(dl1);
+
+ /* shift down until exp < 12 or l = 0 */
+ if (exp > 0)
+ l <<= exp;
+ else
+ l >>= -exp;
+
+ return (SIGND (dl1) ? -l : l);
+}
diff --git a/libgcc/config/s390/32/_fixsfdi.c b/libgcc/config/s390/32/_fixsfdi.c
new file mode 100644
index 00000000000..06336c12d2b
--- /dev/null
+++ b/libgcc/config/s390/32/_fixsfdi.c
@@ -0,0 +1,93 @@
+/* Definitions of target machine for GNU compiler, for IBM S/390
+ Copyright (C) 1999, 2000, 2001, 2007, 2008 and 2009
+ Free Software Foundation, Inc.
+ Contributed by Hartmut Penner (hpenner@de.ibm.com) and
+ Ulrich Weigand (uweigand@de.ibm.com).
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+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/>. */
+
+#define EXP(fp) (((fp.l) >> 23) & 0xFF)
+#define EXCESS 126
+#define SIGNBIT 0x80000000
+#define SIGN(fp) ((fp.l) & SIGNBIT)
+#define HIDDEN (1 << 23)
+#define MANT(fp) (((fp.l) & 0x7FFFFF) | HIDDEN)
+#define FRAC(fp) ((fp.l) & 0x7FFFFF)
+
+typedef int DItype_x __attribute__ ((mode (DI)));
+typedef unsigned int UDItype_x __attribute__ ((mode (DI)));
+typedef int SItype_x __attribute__ ((mode (SI)));
+typedef unsigned int USItype_x __attribute__ ((mode (SI)));
+
+union float_long
+ {
+ float f;
+ USItype_x l;
+ };
+
+DItype_x __fixsfdi (float a1);
+
+/* convert double to int */
+DItype_x
+__fixsfdi (float a1)
+{
+ register union float_long fl1;
+ register int exp;
+ register DItype_x l;
+
+ fl1.f = a1;
+
+ /* +/- 0, denormalized */
+
+ if (!EXP (fl1))
+ return 0;
+
+ exp = EXP (fl1) - EXCESS - 24;
+
+ /* number < 1 */
+
+ if (exp < -24)
+ return 0;
+
+ /* NaN */
+
+ if ((EXP(fl1) == 0xff) && (FRAC(fl1) != 0)) /* NaN */
+ return 0x8000000000000000ULL;
+
+ /* Number big number & +/- inf */
+
+ if (exp >= 40) {
+ l = (long long)1<<63;
+ if (!SIGN(fl1))
+ l--;
+ return l;
+ }
+
+ l = MANT(fl1);
+
+ if (exp > 0)
+ l <<= exp;
+ else
+ l >>= -exp;
+
+ return (SIGN (fl1) ? -l : l);
+}
diff --git a/libgcc/config/s390/32/_fixtfdi.c b/libgcc/config/s390/32/_fixtfdi.c
new file mode 100644
index 00000000000..719703ee189
--- /dev/null
+++ b/libgcc/config/s390/32/_fixtfdi.c
@@ -0,0 +1,102 @@
+/* Definitions of target machine for GNU compiler, for IBM S/390
+ Copyright (C) 1999, 2000, 2001, 2007, 2008 and 2009
+ Free Software Foundation, Inc.
+ Contributed by Hartmut Penner (hpenner@de.ibm.com) and
+ Ulrich Weigand (uweigand@de.ibm.com).
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+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/>. */
+
+#define EXPD(fp) (((fp.l.i[0]) >> 16) & 0x7FFF)
+#define EXPONENT_BIAS 16383
+#define MANTISSA_BITS 112
+#define PRECISION (MANTISSA_BITS + 1)
+#define SIGNBIT 0x80000000
+#define SIGND(fp) ((fp.l.i[0]) & SIGNBIT)
+#define MANTD_HIGH_LL(fp) ((fp.ll[0] & HIGH_LL_FRAC_MASK) | HIGH_LL_UNIT_BIT)
+#define MANTD_LOW_LL(fp) (fp.ll[1])
+#define FRACD_ZERO_P(fp) (!fp.ll[1] && !(fp.ll[0] & HIGH_LL_FRAC_MASK))
+#define HIGH_LL_FRAC_BITS 48
+#define HIGH_LL_UNIT_BIT ((UDItype_x)1 << HIGH_LL_FRAC_BITS)
+#define HIGH_LL_FRAC_MASK (HIGH_LL_UNIT_BIT - 1)
+
+typedef int DItype_x __attribute__ ((mode (DI)));
+typedef unsigned int UDItype_x __attribute__ ((mode (DI)));
+typedef int SItype_x __attribute__ ((mode (SI)));
+typedef unsigned int USItype_x __attribute__ ((mode (SI)));
+
+union double_long {
+ long double d;
+ struct {
+ SItype_x i[4]; /* 32 bit parts: 0 upper ... 3 lowest */
+ } l;
+ UDItype_x ll[2]; /* 64 bit parts: 0 upper, 1 lower */
+};
+
+DItype_x __fixtfdi (long double a1);
+
+/* convert double to unsigned int */
+DItype_x
+__fixtfdi (long double a1)
+{
+ register union double_long dl1;
+ register int exp;
+ register UDItype_x l;
+
+ dl1.d = a1;
+
+ /* +/- 0, denormalized */
+ if (!EXPD (dl1))
+ return 0;
+
+ /* The exponent - considered the binary point at the right end of
+ the mantissa. */
+ exp = EXPD (dl1) - EXPONENT_BIAS - MANTISSA_BITS;
+
+ /* number < 1: If the mantissa would need to be right-shifted more bits than
+ its size the result would be zero. */
+ if (exp <= -PRECISION)
+ return 0;
+
+ /* NaN: All exponent bits set and a nonzero fraction. */
+ if ((EXPD(dl1) == 0x7fff) && !FRACD_ZERO_P (dl1))
+ return 0x8000000000000000ULL;
+
+ /* One extra bit is needed for the unit bit which is appended by
+ MANTD_HIGH_LL on the left of the matissa. */
+ exp += HIGH_LL_FRAC_BITS + 1;
+
+ /* If the result would still need a left shift it will be too large
+ to be represented. Compared to the unsigned variant we have to
+ take care that there is still space for the sign bit to be
+ applied. So we can only go on if there is a right-shift by one
+ or more. */
+ if (exp >= 0)
+ {
+ l = 1ULL << 63; /* long long min */
+ return SIGND (dl1) ? l : l - 1;
+ }
+
+ l = MANTD_LOW_LL (dl1) >> (HIGH_LL_FRAC_BITS + 1)
+ | MANTD_HIGH_LL (dl1) << (64 - (HIGH_LL_FRAC_BITS + 1));
+
+ return SIGND (dl1) ? -(l >> -exp) : l >> -exp;
+}
diff --git a/libgcc/config/s390/32/_fixunsdfdi.c b/libgcc/config/s390/32/_fixunsdfdi.c
new file mode 100644
index 00000000000..2c336529967
--- /dev/null
+++ b/libgcc/config/s390/32/_fixunsdfdi.c
@@ -0,0 +1,94 @@
+/* Definitions of target machine for GNU compiler, for IBM S/390
+ Copyright (C) 1999, 2000, 2001, 2007, 2008 and 2009
+ Free Software Foundation, Inc.
+ Contributed by Hartmut Penner (hpenner@de.ibm.com) and
+ Ulrich Weigand (uweigand@de.ibm.com).
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+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/>. */
+
+#define EXPD(fp) (((fp.l.upper) >> 20) & 0x7FF)
+#define EXCESSD 1022
+#define SIGNBIT 0x80000000
+#define SIGND(fp) ((fp.l.upper) & SIGNBIT)
+#define MANTD_LL(fp) ((fp.ll & (HIDDEND_LL-1)) | HIDDEND_LL)
+#define FRACD_LL(fp) (fp.ll & (HIDDEND_LL-1))
+#define HIDDEND_LL ((UDItype_x)1 << 52)
+
+typedef int DItype_x __attribute__ ((mode (DI)));
+typedef unsigned int UDItype_x __attribute__ ((mode (DI)));
+typedef int SItype_x __attribute__ ((mode (SI)));
+typedef unsigned int USItype_x __attribute__ ((mode (SI)));
+
+union double_long {
+ double d;
+ struct {
+ SItype_x upper;
+ USItype_x lower;
+ } l;
+ UDItype_x ll;
+};
+
+UDItype_x __fixunsdfdi (double a1);
+
+/* convert double to unsigned int */
+UDItype_x
+__fixunsdfdi (double a1)
+{
+ register union double_long dl1;
+ register int exp;
+ register UDItype_x l;
+
+ dl1.d = a1;
+
+ /* +/- 0, denormalized, negative */
+
+ if (!EXPD (dl1) || SIGND(dl1))
+ return 0;
+
+ exp = EXPD (dl1) - EXCESSD - 53;
+
+ /* number < 1 */
+
+ if (exp < -53)
+ return 0;
+
+ /* NaN */
+
+ if ((EXPD(dl1) == 0x7ff) && (FRACD_LL(dl1) != 0)) /* NaN */
+ return 0x0ULL;
+
+ /* Number big number & + inf */
+
+ if (exp >= 12) {
+ return 0xFFFFFFFFFFFFFFFFULL;
+ }
+
+ l = MANTD_LL(dl1);
+
+ /* shift down until exp < 12 or l = 0 */
+ if (exp > 0)
+ l <<= exp;
+ else
+ l >>= -exp;
+
+ return l;
+}
diff --git a/libgcc/config/s390/32/_fixunssfdi.c b/libgcc/config/s390/32/_fixunssfdi.c
new file mode 100644
index 00000000000..eaaad9648d0
--- /dev/null
+++ b/libgcc/config/s390/32/_fixunssfdi.c
@@ -0,0 +1,90 @@
+/* Definitions of target machine for GNU compiler, for IBM S/390
+ Copyright (C) 1999, 2000, 2001, 2007, 2008 and 2009
+ Free Software Foundation, Inc.
+ Contributed by Hartmut Penner (hpenner@de.ibm.com) and
+ Ulrich Weigand (uweigand@de.ibm.com).
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+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/>. */
+
+#define EXP(fp) (((fp.l) >> 23) & 0xFF)
+#define EXCESS 126
+#define SIGNBIT 0x80000000
+#define SIGN(fp) ((fp.l) & SIGNBIT)
+#define HIDDEN (1 << 23)
+#define MANT(fp) (((fp.l) & 0x7FFFFF) | HIDDEN)
+#define FRAC(fp) ((fp.l) & 0x7FFFFF)
+
+typedef int DItype_x __attribute__ ((mode (DI)));
+typedef unsigned int UDItype_x __attribute__ ((mode (DI)));
+typedef int SItype_x __attribute__ ((mode (SI)));
+typedef unsigned int USItype_x __attribute__ ((mode (SI)));
+
+union float_long
+ {
+ float f;
+ USItype_x l;
+ };
+
+UDItype_x __fixunssfdi (float a1);
+
+/* convert float to unsigned int */
+UDItype_x
+__fixunssfdi (float a1)
+{
+ register union float_long fl1;
+ register int exp;
+ register UDItype_x l;
+
+ fl1.f = a1;
+
+ /* +/- 0, denormalized, negative */
+
+ if (!EXP (fl1) || SIGN(fl1))
+ return 0;
+
+ exp = EXP (fl1) - EXCESS - 24;
+
+ /* number < 1 */
+
+ if (exp < -24)
+ return 0;
+
+ /* NaN */
+
+ if ((EXP(fl1) == 0xff) && (FRAC(fl1) != 0)) /* NaN */
+ return 0x0ULL;
+
+ /* Number big number & + inf */
+
+ if (exp >= 41) {
+ return 0xFFFFFFFFFFFFFFFFULL;
+ }
+
+ l = MANT(fl1);
+
+ if (exp > 0)
+ l <<= exp;
+ else
+ l >>= -exp;
+
+ return l;
+}
diff --git a/libgcc/config/s390/32/_fixunstfdi.c b/libgcc/config/s390/32/_fixunstfdi.c
new file mode 100644
index 00000000000..cc7ada5e0cf
--- /dev/null
+++ b/libgcc/config/s390/32/_fixunstfdi.c
@@ -0,0 +1,97 @@
+/* Definitions of target machine for GNU compiler, for IBM S/390
+ Copyright (C) 1999, 2000, 2001, 2007, 2008 and 2009
+ Free Software Foundation, Inc.
+ Contributed by Hartmut Penner (hpenner@de.ibm.com) and
+ Ulrich Weigand (uweigand@de.ibm.com).
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+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/>. */
+
+#define EXPD(fp) (((fp.l.i[0]) >> 16) & 0x7FFF)
+#define EXPONENT_BIAS 16383
+#define MANTISSA_BITS 112
+#define PRECISION (MANTISSA_BITS + 1)
+#define SIGNBIT 0x80000000
+#define SIGND(fp) ((fp.l.i[0]) & SIGNBIT)
+#define MANTD_HIGH_LL(fp) ((fp.ll[0] & HIGH_LL_FRAC_MASK) | HIGH_LL_UNIT_BIT)
+#define MANTD_LOW_LL(fp) (fp.ll[1])
+#define FRACD_ZERO_P(fp) (!fp.ll[1] && !(fp.ll[0] & HIGH_LL_FRAC_MASK))
+#define HIGH_LL_FRAC_BITS 48
+#define HIGH_LL_UNIT_BIT ((UDItype_x)1 << HIGH_LL_FRAC_BITS)
+#define HIGH_LL_FRAC_MASK (HIGH_LL_UNIT_BIT - 1)
+
+typedef int DItype_x __attribute__ ((mode (DI)));
+typedef unsigned int UDItype_x __attribute__ ((mode (DI)));
+typedef int SItype_x __attribute__ ((mode (SI)));
+typedef unsigned int USItype_x __attribute__ ((mode (SI)));
+
+union double_long {
+ long double d;
+ struct {
+ SItype_x i[4]; /* 32 bit parts: 0 upper ... 3 lowest */
+ } l;
+ UDItype_x ll[2]; /* 64 bit parts: 0 upper, 1 lower */
+};
+
+UDItype_x __fixunstfdi (long double a1);
+
+/* convert double to unsigned int */
+UDItype_x
+__fixunstfdi (long double a1)
+{
+ register union double_long dl1;
+ register int exp;
+ register UDItype_x l;
+
+ dl1.d = a1;
+
+ /* +/- 0, denormalized, negative */
+ if (!EXPD (dl1) || SIGND(dl1))
+ return 0;
+
+ /* The exponent - considered the binary point at the right end of
+ the mantissa. */
+ exp = EXPD (dl1) - EXPONENT_BIAS - MANTISSA_BITS;
+
+ /* number < 1: If the mantissa would need to be right-shifted more bits than
+ its size (plus the implied one bit on the left) the result would be
+ zero. */
+ if (exp <= -PRECISION)
+ return 0;
+
+ /* NaN: All exponent bits set and a nonzero fraction. */
+ if ((EXPD(dl1) == 0x7fff) && !FRACD_ZERO_P (dl1))
+ return 0x0ULL;
+
+ /* One extra bit is needed for the unit bit which is appended by
+ MANTD_HIGH_LL on the left of the matissa. */
+ exp += HIGH_LL_FRAC_BITS + 1;
+
+ /* If the result would still need a left shift it will be too large
+ to be represented. */
+ if (exp > 0)
+ return 0xFFFFFFFFFFFFFFFFULL;
+
+ l = MANTD_LOW_LL (dl1) >> (HIGH_LL_FRAC_BITS + 1)
+ | MANTD_HIGH_LL (dl1) << (64 - (HIGH_LL_FRAC_BITS + 1));
+
+ return l >> -exp;
+}
diff --git a/libgcc/config/s390/32/t-floattodi b/libgcc/config/s390/32/t-floattodi
new file mode 100644
index 00000000000..4bd87b1f888
--- /dev/null
+++ b/libgcc/config/s390/32/t-floattodi
@@ -0,0 +1,5 @@
+floattodi-functions = _fixsfdi _fixdfdi _fixtfdi _fixunssfdi _fixunsdfdi _fixunstfdi
+LIB2FUNCS_EXCLUDE += $(floattodi-functions)
+
+floattodi-src = $(addsuffix .c, $(floattodi-functions))
+LIB2ADD = $(addprefix $(srcdir)/config/s390/32/, $(floattodi-src))
diff --git a/gcc/config/s390/libgcc-glibc.ver b/libgcc/config/s390/libgcc-glibc.ver
index 6fc52e40d78..6fc52e40d78 100644
--- a/gcc/config/s390/libgcc-glibc.ver
+++ b/libgcc/config/s390/libgcc-glibc.ver
diff --git a/gcc/config/s390/t-crtstuff b/libgcc/config/s390/t-crtstuff
index 39b0eba6b97..92e87b2da7e 100644
--- a/gcc/config/s390/t-crtstuff
+++ b/libgcc/config/s390/t-crtstuff
@@ -1,5 +1,6 @@
# crtend*.o cannot be compiled without -fno-asynchronous-unwind-tables,
# because then __FRAME_END__ might not be the last thing in .eh_frame
# section.
-CRTSTUFF_T_CFLAGS = -fno-asynchronous-unwind-tables
-TARGET_LIBGCC2_CFLAGS += -mlong-double-128
+CRTSTUFF_T_CFLAGS += -fno-asynchronous-unwind-tables
+CRTSTUFF_T_CFLAGS_S += -fno-asynchronous-unwind-tables
+
diff --git a/libgcc/config/s390/t-linux b/libgcc/config/s390/t-linux
new file mode 100644
index 00000000000..a0f10cb2995
--- /dev/null
+++ b/libgcc/config/s390/t-linux
@@ -0,0 +1,7 @@
+DFP_ENABLE = true
+
+# Override t-slibgcc-elf-ver to export some libgcc symbols with
+# the symbol versions that glibc used.
+SHLIB_MAPFILES = $(gcc_srcdir)/libgcc-std.ver $(srcdir)/config/s390/libgcc-glibc.ver
+
+HOST_LIBGCC2_CFLAGS += -mlong-double-128 \ No newline at end of file
diff --git a/libgcc/config/s390/t-tpf b/libgcc/config/s390/t-tpf
new file mode 100644
index 00000000000..b1e8f6910da
--- /dev/null
+++ b/libgcc/config/s390/t-tpf
@@ -0,0 +1,8 @@
+# Compile libgcc2.a with pic.
+HOST_LIBGCC2_CFLAGS += -fPIC
+
+# Use unwind-dw2-fde-glibc.
+LIB2ADDEH = $(gcc_srcdir)/unwind-dw2.c $(gcc_srcdir)/unwind-dw2-fde-glibc.c \
+ $(gcc_srcdir)/unwind-sjlj.c $(gcc_srcdir)/gthr-gnat.c $(gcc_srcdir)/unwind-c.c \
+ $(gcc_srcdir)/emutls.c
+LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 2530bf7d3ea..3ee00936037 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,134 @@
+2009-11-02 Janne Blomqvist <jb@gcc.gnu.org>
+
+ * Makefile.am (gfor_io_headers): Add fbuf.h, format.h, unix.h.
+ * Makefile.in: Regenerated.
+ * io/fbuf.h: New file.
+ * io/format.h: New file.
+ * io/unix.h: New file.
+ * io/io.h (struct stream): Move to unix.h, add forward declaration.
+ (sread): Likewise.
+ (swrite): Likewise.
+ (sseek): Likewise.
+ (stell): Likewise.
+ (struncate): Likewise.
+ (sflush): Likewise.
+ (sflush): Likewise.
+ (sclose): Likewise.
+ (compared_files): Move prototype to unix.h.
+ (open_external): Likewise.
+ (open_internal): Likewise.
+ (mem_alloc_w): Likewise.
+ (mem_alloc_r): Likewise.
+ (input_stream): Likewise.
+ (output_stream): Likewise.
+ (error_stream): Likewise.
+ (compare_file_filename): Likewise.
+ (find_file): Likewise.
+ (delete_file): Likewise.
+ (file_exists): Likewise.
+ (inquire_sequential): Likewise.
+ (inquire_direct): Likewise.
+ (inquire_formatted): Likewise.
+ (inquire_unformatted): Likewise.
+ (inquire_read): Likewise.
+ (inquire_write): Likewise.
+ (inquire_readwrite): Likewise.
+ (file_length): Likewise.
+ (is_seekable): Likewise.
+ (is_special): Likewise.
+ (flush_if_preconnected): Likewise.
+ (empty_internal_buffer): Likewise.
+ (stream_isatty): Likewise.
+ (stream_ttyname): Likewise.
+ (unpack_filename): Likewise.
+ (struct fbuf): Move to fbuf.h, add forward declaration.
+ (fbuf_init): Move prototype to fbuf.h.
+ (fbuf_destroy): Likewise.
+ (fbuf_reset): Likewise.
+ (fbuf_alloc): Likewise.
+ (fbuf_flush): Likewise.
+ (fbuf_seek): Likewise.
+ (fbuf_read): Likewise.
+ (fbuf_getc_refill): Likewise.
+ (fbuf_getc): Move inline function to fbuf.h.
+ (enum format_token): Move to format.h.
+ (struct fnode): Move to format.h, add forward declaration.
+ (parse_format): Move prototype to format.h.
+ (next_format): Likewise.
+ (unget_format): Likewise.
+ (format_error): Likewise.
+ (free_format_data): Likewise.
+ (free_format_hash_table): Likewise.
+ (init_format_hash): Likewise.
+ (free_format_hash): Likewise.
+ * io/close.c: Include unix.h.
+ * io/fbuf.c: Include fbuf.h and unix.h.
+ * io/file_pos.c: Include fbuf.h and unix.h.
+ * io/format.c: Include format.h.
+ * io/inquire.c: Include unix.h.
+ * io/intrinsics.c: Include fbuf.h and unix.h.
+ * io/list_read.c: Include fbuf.h and unix.h.
+ * io/open.c: Include fbuf.h and unix.h.
+ * io/read.c: Include format.h.
+ * io/transfer.c: Include fbuf.h, format.h, and unix.h.
+ * io/unit.c: Likewise.
+ * io/unix.c: Include unix.h.
+ * io/write.c: Include format.h and unix.h.
+
+2009-10-31 Janne Blomqvist <jb@gcc.gnu.org>
+
+ PR libfortran/41219
+ * intrinsics/unpack_generic.c (unpack_internal): Remove unused
+ argument from prototype.
+ (unpack1): Update unpack_internal call.
+ (unpack1_char): Likewise.
+ (unpack1_char4): Likewise.
+ (unpack0): Likewise.
+ (unpack0_char): Likewise.
+ (unpack0_char4): Likewise.
+ * intrinsics/iso_c_binding.c (c_f_pointer_u0): Get rid of
+ uninitialized variable warning.
+
+2009-10-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/41711
+ * libgfortran.h: Define larger sizes for BOZ conversion buffers.
+ * io/write.c (extract_uint): Include case where size is 10 if integer
+ is large enough. (write_int): Rename to write_boz. (write_boz): Factor
+ out extract_uint and delete the conversion function.
+ (btoa_big): New binary conversion function.
+ (otoa_big): New octal conversion function.
+ (ztoa_big): New hexidecimal conversion function.
+ (write_b): Modify to use new function.
+ (write_o): Likewise.
+ (write_z): Likewise.
+
+2009-10-12 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/41683
+ * io/format.c (parse_format_list): Allow a repeat specifier immediately
+ after a P specifier.
+
+2009-10-11 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/38439
+ * io/format.c (parse_format_list): Correct logic for FMT_F reading vs
+ writing. Code clean-up.
+
+2009-10-11 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/38439
+ * io/format.c (parse_format_list): Add check for tokens not allowed
+ after P specifier. Fix comments. Remove un-needed code. Fix the
+ default exponent list. Correct pointer assignment error.
+
+2009-10-05 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/35862
+ * write_float.def (outout_float): Fix handling of special case where no
+ digits after the decimal point and values less than 1.0. Adjust index
+ into digits string. (WRITE_FLOAT): Remove special case code from macro.
+
2009-09-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/35862
diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am
index c2fd941a992..db086bbc6c5 100644
--- a/libgfortran/Makefile.am
+++ b/libgfortran/Makefile.am
@@ -59,7 +59,10 @@ io/write.c \
io/fbuf.c
gfor_io_headers= \
-io/io.h
+io/io.h \
+io/fbuf.h \
+io/format.h \
+io/unix.h
gfor_helper_src= \
intrinsics/associated.c \
diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in
index 462b07b487b..8fca11eaa1c 100644
--- a/libgfortran/Makefile.in
+++ b/libgfortran/Makefile.in
@@ -451,8 +451,8 @@ am__libgfortran_la_SOURCES_DIST = runtime/backtrace.c runtime/bounds.c \
intrinsics/time.c intrinsics/transpose_generic.c \
intrinsics/umask.c intrinsics/unlink.c \
intrinsics/unpack_generic.c runtime/in_pack_generic.c \
- runtime/in_unpack_generic.c io/io.h \
- $(srcdir)/generated/_abs_c4.F90 \
+ runtime/in_unpack_generic.c io/io.h io/fbuf.h io/format.h \
+ io/unix.h $(srcdir)/generated/_abs_c4.F90 \
$(srcdir)/generated/_abs_c8.F90 \
$(srcdir)/generated/_abs_c10.F90 \
$(srcdir)/generated/_abs_c16.F90 \
@@ -1004,7 +1004,10 @@ io/write.c \
io/fbuf.c
gfor_io_headers = \
-io/io.h
+io/io.h \
+io/fbuf.h \
+io/format.h \
+io/unix.h
gfor_helper_src = \
intrinsics/associated.c \
diff --git a/libgfortran/intrinsics/iso_c_binding.c b/libgfortran/intrinsics/iso_c_binding.c
index ea1bab39501..d0549b03dfa 100644
--- a/libgfortran/intrinsics/iso_c_binding.c
+++ b/libgfortran/intrinsics/iso_c_binding.c
@@ -94,11 +94,11 @@ ISO_C_BINDING_PREFIX (c_f_pointer_u0) (void *c_ptr_in,
if (shape != NULL)
{
- index_type source_stride;
- index_type size, str;
+ index_type source_stride, size;
+ index_type str = 1;
char *p;
- f_ptr_out->offset = 0;
+ f_ptr_out->offset = str;
shapeSize = 0;
p = shape->data;
size = GFC_DESCRIPTOR_SIZE(shape);
@@ -145,12 +145,7 @@ ISO_C_BINDING_PREFIX (c_f_pointer_u0) (void *c_ptr_in,
}
p += source_stride;
- if (i == 0)
- {
- str = 1;
- f_ptr_out->offset = str;
- }
- else
+ if (i != 0)
{
str = str * GFC_DESCRIPTOR_EXTENT(f_ptr_out,i-1);
f_ptr_out->offset += str;
diff --git a/libgfortran/intrinsics/unpack_generic.c b/libgfortran/intrinsics/unpack_generic.c
index 4a4c2192e9d..a457988095a 100644
--- a/libgfortran/intrinsics/unpack_generic.c
+++ b/libgfortran/intrinsics/unpack_generic.c
@@ -57,7 +57,7 @@ unpack_bounds (gfc_array_char *ret, const gfc_array_char *vector,
static void
unpack_internal (gfc_array_char *ret, const gfc_array_char *vector,
const gfc_array_l1 *mask, const gfc_array_char *field,
- index_type size, index_type fsize)
+ index_type size)
{
/* r.* indicates the return array. */
index_type rstride[GFC_MAX_DIMENSIONS];
@@ -345,8 +345,7 @@ unpack1 (gfc_array_char *ret, const gfc_array_char *vector,
#endif
}
- unpack_internal (ret, vector, mask, field, size,
- GFC_DESCRIPTOR_SIZE (field));
+ unpack_internal (ret, vector, mask, field, size);
}
@@ -361,13 +360,13 @@ unpack1_char (gfc_array_char *ret,
GFC_INTEGER_4 ret_length __attribute__((unused)),
const gfc_array_char *vector, const gfc_array_l1 *mask,
const gfc_array_char *field, GFC_INTEGER_4 vector_length,
- GFC_INTEGER_4 field_length)
+ GFC_INTEGER_4 field_length __attribute__((unused)))
{
if (unlikely(compile_options.bounds_check))
unpack_bounds (ret, vector, mask, field);
- unpack_internal (ret, vector, mask, field, vector_length, field_length);
+ unpack_internal (ret, vector, mask, field, vector_length);
}
@@ -382,15 +381,14 @@ unpack1_char4 (gfc_array_char *ret,
GFC_INTEGER_4 ret_length __attribute__((unused)),
const gfc_array_char *vector, const gfc_array_l1 *mask,
const gfc_array_char *field, GFC_INTEGER_4 vector_length,
- GFC_INTEGER_4 field_length)
+ GFC_INTEGER_4 field_length __attribute__((unused)))
{
if (unlikely(compile_options.bounds_check))
unpack_bounds (ret, vector, mask, field);
unpack_internal (ret, vector, mask, field,
- vector_length * sizeof (gfc_char4_t),
- field_length * sizeof (gfc_char4_t));
+ vector_length * sizeof (gfc_char4_t));
}
@@ -543,7 +541,7 @@ unpack0 (gfc_array_char *ret, const gfc_array_char *vector,
memset (&tmp, 0, sizeof (tmp));
tmp.dtype = 0;
tmp.data = field;
- unpack_internal (ret, vector, mask, &tmp, GFC_DESCRIPTOR_SIZE (vector), 0);
+ unpack_internal (ret, vector, mask, &tmp, GFC_DESCRIPTOR_SIZE (vector));
}
@@ -567,7 +565,7 @@ unpack0_char (gfc_array_char *ret,
memset (&tmp, 0, sizeof (tmp));
tmp.dtype = 0;
tmp.data = field;
- unpack_internal (ret, vector, mask, &tmp, vector_length, 0);
+ unpack_internal (ret, vector, mask, &tmp, vector_length);
}
@@ -592,5 +590,5 @@ unpack0_char4 (gfc_array_char *ret,
tmp.dtype = 0;
tmp.data = field;
unpack_internal (ret, vector, mask, &tmp,
- vector_length * sizeof (gfc_char4_t), 0);
+ vector_length * sizeof (gfc_char4_t));
}
diff --git a/libgfortran/io/close.c b/libgfortran/io/close.c
index 848b7c9e71a..1a4d7d16eb6 100644
--- a/libgfortran/io/close.c
+++ b/libgfortran/io/close.c
@@ -23,6 +23,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
#include "io.h"
+#include "unix.h"
#include <limits.h>
typedef enum
diff --git a/libgfortran/io/fbuf.c b/libgfortran/io/fbuf.c
index e1daa0d32d6..d79cf15c473 100644
--- a/libgfortran/io/fbuf.c
+++ b/libgfortran/io/fbuf.c
@@ -24,6 +24,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "io.h"
+#include "fbuf.h"
+#include "unix.h"
#include <string.h>
#include <stdlib.h>
@@ -37,7 +39,7 @@ fbuf_init (gfc_unit * u, int len)
if (len == 0)
len = 512; /* Default size. */
- u->fbuf = get_mem (sizeof (fbuf));
+ u->fbuf = get_mem (sizeof (struct fbuf));
u->fbuf->buf = get_mem (len);
u->fbuf->len = len;
u->fbuf->act = u->fbuf->pos = 0;
diff --git a/libgfortran/io/fbuf.h b/libgfortran/io/fbuf.h
new file mode 100644
index 00000000000..368cec28b2c
--- /dev/null
+++ b/libgfortran/io/fbuf.h
@@ -0,0 +1,81 @@
+/* Copyright (C) 2009
+ Free Software Foundation, Inc.
+ Contributed by Janne Blomqvist
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran 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.
+
+Libgfortran 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/>. */
+
+#include "io.h"
+
+#ifndef GFOR_FBUF_H
+#define GFOR_FBUF_H
+
+
+/* Formatting buffer. This is a temporary scratch buffer used by
+ formatted read and writes. After every formatted I/O statement,
+ this buffer is flushed. This buffer is needed since not all devices
+ are seekable, and T or TL edit descriptors require moving backwards
+ in the record. However, advance='no' complicates the situation, so
+ the buffer must only be partially flushed from the end of the last
+ flush until the current position in the record. */
+
+struct fbuf
+{
+ char *buf; /* Start of buffer. */
+ int len; /* Length of buffer. */
+ int act; /* Active bytes in buffer. */
+ int pos; /* Current position in buffer. */
+};
+
+extern void fbuf_init (gfc_unit *, int);
+internal_proto(fbuf_init);
+
+extern void fbuf_destroy (gfc_unit *);
+internal_proto(fbuf_destroy);
+
+extern int fbuf_reset (gfc_unit *);
+internal_proto(fbuf_reset);
+
+extern char * fbuf_alloc (gfc_unit *, int);
+internal_proto(fbuf_alloc);
+
+extern int fbuf_flush (gfc_unit *, unit_mode);
+internal_proto(fbuf_flush);
+
+extern int fbuf_seek (gfc_unit *, int, int);
+internal_proto(fbuf_seek);
+
+extern char * fbuf_read (gfc_unit *, int *);
+internal_proto(fbuf_read);
+
+/* Never call this function, only use fbuf_getc(). */
+extern int fbuf_getc_refill (gfc_unit *);
+internal_proto(fbuf_getc_refill);
+
+static inline int
+fbuf_getc (gfc_unit * u)
+{
+ if (u->fbuf->pos < u->fbuf->act)
+ return (unsigned char) u->fbuf->buf[u->fbuf->pos++];
+ return fbuf_getc_refill (u);
+}
+
+#endif
diff --git a/libgfortran/io/file_pos.c b/libgfortran/io/file_pos.c
index c1690173658..f7d94996163 100644
--- a/libgfortran/io/file_pos.c
+++ b/libgfortran/io/file_pos.c
@@ -23,6 +23,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
#include "io.h"
+#include "fbuf.h"
+#include "unix.h"
#include <string.h>
/* file_pos.c-- Implement the file positioning statements, i.e. BACKSPACE,
diff --git a/libgfortran/io/format.c b/libgfortran/io/format.c
index 4ab70e8c3ad..cafea8732e4 100644
--- a/libgfortran/io/format.c
+++ b/libgfortran/io/format.c
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
* interpretation during I/O statements */
#include "io.h"
+#include "format.h"
#include <ctype.h>
#include <string.h>
#include <stdbool.h>
@@ -706,6 +707,13 @@ parse_format_list (st_parameter_dt *dtp, bool *save_ok)
goto data_desc;
}
+ if (t != FMT_COMMA && t != FMT_RPAREN && t != FMT_SLASH
+ && t != FMT_POSINT)
+ {
+ fmt->error = "Comma required after P descriptor";
+ goto finished;
+ }
+
fmt->saved_token = t;
goto optional_comma;
@@ -734,7 +742,7 @@ parse_format_list (st_parameter_dt *dtp, bool *save_ok)
goto between_desc;
case FMT_STRING:
- /* TODO: Find out why is is necessary to turn off format caching. */
+ /* TODO: Find out why it is necessary to turn off format caching. */
saveit = false;
get_fnode (fmt, &head, &tail, FMT_STRING);
tail->u.string.p = fmt->string;
@@ -851,19 +859,6 @@ parse_format_list (st_parameter_dt *dtp, bool *save_ok)
data_desc:
switch (t)
{
- case FMT_P:
- t = format_lex (fmt);
- if (t == FMT_POSINT)
- {
- fmt->error = "Repeat count cannot follow P descriptor";
- goto finished;
- }
-
- fmt->saved_token = t;
- get_fnode (fmt, &head, &tail, FMT_P);
-
- goto optional_comma;
-
case FMT_L:
t = format_lex (fmt);
if (t != FMT_POSINT)
@@ -940,7 +935,7 @@ parse_format_list (st_parameter_dt *dtp, bool *save_ok)
tail->u.real.d = fmt->value;
break;
}
- if (t == FMT_F || dtp->u.p.mode == WRITING)
+ if (t == FMT_F && dtp->u.p.mode == WRITING)
{
if (u != FMT_POSINT && u != FMT_ZERO)
{
@@ -948,13 +943,10 @@ parse_format_list (st_parameter_dt *dtp, bool *save_ok)
goto finished;
}
}
- else
+ else if (u != FMT_POSINT)
{
- if (u != FMT_POSINT)
- {
- fmt->error = posint_required;
- goto finished;
- }
+ fmt->error = posint_required;
+ goto finished;
}
tail->u.real.w = fmt->value;
@@ -971,6 +963,7 @@ parse_format_list (st_parameter_dt *dtp, bool *save_ok)
}
fmt->saved_token = t;
tail->u.real.d = 0;
+ tail->u.real.e = -1;
break;
}
@@ -982,11 +975,11 @@ parse_format_list (st_parameter_dt *dtp, bool *save_ok)
}
tail->u.real.d = fmt->value;
+ tail->u.real.e = -1;
- if (t == FMT_D || t == FMT_F)
+ if (t2 == FMT_D || t2 == FMT_F)
break;
- tail->u.real.e = -1;
/* Look for optional exponent */
t = format_lex (fmt);
diff --git a/libgfortran/io/format.h b/libgfortran/io/format.h
new file mode 100644
index 00000000000..c338daa1950
--- /dev/null
+++ b/libgfortran/io/format.h
@@ -0,0 +1,118 @@
+/* Copyright (C) 2009
+ Free Software Foundation, Inc.
+ Contributed by Janne Blomqvist
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran 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.
+
+Libgfortran 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/>. */
+
+#include "io.h"
+
+#ifndef GFOR_FORMAT_H
+#define GFOR_FORMAT_H
+
+/* Format tokens. Only about half of these can be stored in the
+ format nodes. */
+
+typedef enum
+{
+ FMT_NONE = 0, FMT_UNKNOWN, FMT_SIGNED_INT, FMT_ZERO, FMT_POSINT, FMT_PERIOD,
+ FMT_COMMA, FMT_COLON, FMT_SLASH, FMT_DOLLAR, FMT_T, FMT_TR, FMT_TL,
+ FMT_LPAREN, FMT_RPAREN, FMT_X, FMT_S, FMT_SS, FMT_SP, FMT_STRING,
+ FMT_BADSTRING, FMT_P, FMT_I, FMT_B, FMT_BN, FMT_BZ, FMT_O, FMT_Z, FMT_F,
+ FMT_E, FMT_EN, FMT_ES, FMT_G, FMT_L, FMT_A, FMT_D, FMT_H, FMT_END, FMT_DC,
+ FMT_DP, FMT_STAR, FMT_RC, FMT_RD, FMT_RN, FMT_RP, FMT_RU, FMT_RZ
+}
+format_token;
+
+
+/* Format nodes. A format string is converted into a tree of these
+ structures, which is traversed as part of a data transfer statement. */
+
+struct fnode
+{
+ format_token format;
+ int repeat;
+ struct fnode *next;
+ char *source;
+
+ union
+ {
+ struct
+ {
+ int w, d, e;
+ }
+ real;
+
+ struct
+ {
+ int length;
+ char *p;
+ }
+ string;
+
+ struct
+ {
+ int w, m;
+ }
+ integer;
+
+ int w;
+ int k;
+ int r;
+ int n;
+
+ struct fnode *child;
+ }
+ u;
+
+ /* Members for traversing the tree during data transfer. */
+
+ int count;
+ struct fnode *current;
+
+};
+
+
+extern void parse_format (st_parameter_dt *);
+internal_proto(parse_format);
+
+extern const fnode *next_format (st_parameter_dt *);
+internal_proto(next_format);
+
+extern void unget_format (st_parameter_dt *, const fnode *);
+internal_proto(unget_format);
+
+extern void format_error (st_parameter_dt *, const fnode *, const char *);
+internal_proto(format_error);
+
+extern void free_format_data (struct format_data *);
+internal_proto(free_format_data);
+
+extern void free_format_hash_table (gfc_unit *);
+internal_proto(free_format_hash_table);
+
+extern void init_format_hash (st_parameter_dt *);
+internal_proto(init_format_hash);
+
+extern void free_format_hash (st_parameter_dt *);
+internal_proto(free_format_hash);
+
+#endif
diff --git a/libgfortran/io/inquire.c b/libgfortran/io/inquire.c
index 015b68a26f8..c36b9e5fa69 100644
--- a/libgfortran/io/inquire.c
+++ b/libgfortran/io/inquire.c
@@ -26,6 +26,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
/* Implement the non-IOLENGTH variant of the INQUIRY statement */
#include "io.h"
+#include "unix.h"
static const char undefined[] = "UNDEFINED";
diff --git a/libgfortran/io/intrinsics.c b/libgfortran/io/intrinsics.c
index 0e33e8490da..9428b759d15 100644
--- a/libgfortran/io/intrinsics.c
+++ b/libgfortran/io/intrinsics.c
@@ -24,6 +24,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
#include "io.h"
+#include "fbuf.h"
+#include "unix.h"
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
diff --git a/libgfortran/io/io.h b/libgfortran/io/io.h
index 51143f548aa..b24f81026f0 100644
--- a/libgfortran/io/io.h
+++ b/libgfortran/io/io.h
@@ -42,63 +42,13 @@ typedef enum
}
bt;
+/* Forward declarations. */
struct st_parameter_dt;
-
-typedef struct stream
-{
- ssize_t (*read) (struct stream *, void *, ssize_t);
- ssize_t (*write) (struct stream *, const void *, ssize_t);
- off_t (*seek) (struct stream *, off_t, int);
- off_t (*tell) (struct stream *);
- /* Avoid keyword truncate due to AIX namespace collision. */
- int (*trunc) (struct stream *, off_t);
- int (*flush) (struct stream *);
- int (*close) (struct stream *);
-}
-stream;
-
-/* Inline functions for doing file I/O given a stream. */
-static inline ssize_t
-sread (stream * s, void * buf, ssize_t nbyte)
-{
- return s->read (s, buf, nbyte);
-}
-
-static inline ssize_t
-swrite (stream * s, const void * buf, ssize_t nbyte)
-{
- return s->write (s, buf, nbyte);
-}
-
-static inline off_t
-sseek (stream * s, off_t offset, int whence)
-{
- return s->seek (s, offset, whence);
-}
-
-static inline off_t
-stell (stream * s)
-{
- return s->tell (s);
-}
-
-static inline int
-struncate (stream * s, off_t length)
-{
- return s->trunc (s, length);
-}
-
-static inline int
-sflush (stream * s)
-{
- return s->flush (s);
-}
-
-static inline int
-sclose (stream * s)
-{
- return s->close (s);
-}
+typedef struct stream stream;
+struct fbuf;
+struct format_data;
+typedef struct fnode fnode;
+struct gfc_unit;
/* Macros for testing what kinds of I/O we are doing. */
@@ -131,7 +81,7 @@ array_loop_spec;
/* A stucture to build a hash table for format data. */
-#define FORMAT_HASH_SIZE 16
+#define FORMAT_HASH_SIZE 16
typedef struct format_hash_entry
{
@@ -386,8 +336,6 @@ typedef struct
}
st_parameter_inquire;
-struct gfc_unit;
-struct format_data;
#define IOPARM_DT_LIST_FORMAT (1 << 7)
#define IOPARM_DT_NAMELIST_READ_MODE (1 << 8)
@@ -564,24 +512,6 @@ typedef struct
unit_flags;
-/* Formatting buffer. This is a temporary scratch buffer. Currently used only
- by formatted writes. After every
- formatted write statement, this buffer is flushed. This buffer is needed since
- not all devices are seekable, and T or TL edit descriptors require
- moving backwards in the record. However, advance='no' complicates the
- situation, so the buffer must only be partially flushed from the end of the
- last flush until the current position in the record. */
-
-typedef struct fbuf
-{
- char *buf; /* Start of buffer. */
- int len; /* Length of buffer. */
- int act; /* Active bytes in buffer. */
- int pos; /* Current position in buffer. */
-}
-fbuf;
-
-
typedef struct gfc_unit
{
int unit_number;
@@ -645,152 +575,6 @@ typedef struct gfc_unit
}
gfc_unit;
-/* Format tokens. Only about half of these can be stored in the
- format nodes. */
-
-typedef enum
-{
- FMT_NONE = 0, FMT_UNKNOWN, FMT_SIGNED_INT, FMT_ZERO, FMT_POSINT, FMT_PERIOD,
- FMT_COMMA, FMT_COLON, FMT_SLASH, FMT_DOLLAR, FMT_T, FMT_TR, FMT_TL,
- FMT_LPAREN, FMT_RPAREN, FMT_X, FMT_S, FMT_SS, FMT_SP, FMT_STRING,
- FMT_BADSTRING, FMT_P, FMT_I, FMT_B, FMT_BN, FMT_BZ, FMT_O, FMT_Z, FMT_F,
- FMT_E, FMT_EN, FMT_ES, FMT_G, FMT_L, FMT_A, FMT_D, FMT_H, FMT_END, FMT_DC,
- FMT_DP, FMT_STAR, FMT_RC, FMT_RD, FMT_RN, FMT_RP, FMT_RU, FMT_RZ
-}
-format_token;
-
-
-/* Format nodes. A format string is converted into a tree of these
- structures, which is traversed as part of a data transfer statement. */
-
-typedef struct fnode
-{
- format_token format;
- int repeat;
- struct fnode *next;
- char *source;
-
- union
- {
- struct
- {
- int w, d, e;
- }
- real;
-
- struct
- {
- int length;
- char *p;
- }
- string;
-
- struct
- {
- int w, m;
- }
- integer;
-
- int w;
- int k;
- int r;
- int n;
-
- struct fnode *child;
- }
- u;
-
- /* Members for traversing the tree during data transfer. */
-
- int count;
- struct fnode *current;
-
-}
-fnode;
-
-
-/* unix.c */
-
-extern int compare_files (stream *, stream *);
-internal_proto(compare_files);
-
-extern stream *open_external (st_parameter_open *, unit_flags *);
-internal_proto(open_external);
-
-extern stream *open_internal (char *, int, gfc_offset);
-internal_proto(open_internal);
-
-extern char * mem_alloc_w (stream *, int *);
-internal_proto(mem_alloc_w);
-
-extern char * mem_alloc_r (stream *, int *);
-internal_proto(mem_alloc_w);
-
-extern stream *input_stream (void);
-internal_proto(input_stream);
-
-extern stream *output_stream (void);
-internal_proto(output_stream);
-
-extern stream *error_stream (void);
-internal_proto(error_stream);
-
-extern int compare_file_filename (gfc_unit *, const char *, int);
-internal_proto(compare_file_filename);
-
-extern gfc_unit *find_file (const char *file, gfc_charlen_type file_len);
-internal_proto(find_file);
-
-extern int delete_file (gfc_unit *);
-internal_proto(delete_file);
-
-extern int file_exists (const char *file, gfc_charlen_type file_len);
-internal_proto(file_exists);
-
-extern const char *inquire_sequential (const char *, int);
-internal_proto(inquire_sequential);
-
-extern const char *inquire_direct (const char *, int);
-internal_proto(inquire_direct);
-
-extern const char *inquire_formatted (const char *, int);
-internal_proto(inquire_formatted);
-
-extern const char *inquire_unformatted (const char *, int);
-internal_proto(inquire_unformatted);
-
-extern const char *inquire_read (const char *, int);
-internal_proto(inquire_read);
-
-extern const char *inquire_write (const char *, int);
-internal_proto(inquire_write);
-
-extern const char *inquire_readwrite (const char *, int);
-internal_proto(inquire_readwrite);
-
-extern gfc_offset file_length (stream *);
-internal_proto(file_length);
-
-extern int is_seekable (stream *);
-internal_proto(is_seekable);
-
-extern int is_special (stream *);
-internal_proto(is_special);
-
-extern void flush_if_preconnected (stream *);
-internal_proto(flush_if_preconnected);
-
-extern void empty_internal_buffer(stream *);
-internal_proto(empty_internal_buffer);
-
-extern int stream_isatty (stream *);
-internal_proto(stream_isatty);
-
-extern char * stream_ttyname (stream *);
-internal_proto(stream_ttyname);
-
-extern int unpack_filename (char *, const char *, int);
-internal_proto(unpack_filename);
/* unit.c */
@@ -847,31 +631,6 @@ internal_proto(get_unique_unit_number);
extern gfc_unit *new_unit (st_parameter_open *, gfc_unit *, unit_flags *);
internal_proto(new_unit);
-/* format.c */
-
-extern void parse_format (st_parameter_dt *);
-internal_proto(parse_format);
-
-extern const fnode *next_format (st_parameter_dt *);
-internal_proto(next_format);
-
-extern void unget_format (st_parameter_dt *, const fnode *);
-internal_proto(unget_format);
-
-extern void format_error (st_parameter_dt *, const fnode *, const char *);
-internal_proto(format_error);
-
-extern void free_format_data (struct format_data *);
-internal_proto(free_format_data);
-
-extern void free_format_hash_table (gfc_unit *);
-internal_proto(free_format_hash_table);
-
-extern void init_format_hash (st_parameter_dt *);
-internal_proto(init_format_hash);
-
-extern void free_format_hash (st_parameter_dt *);
-internal_proto(free_format_hash);
/* transfer.c */
@@ -1014,39 +773,6 @@ internal_proto(size_from_real_kind);
extern size_t size_from_complex_kind (int);
internal_proto(size_from_complex_kind);
-/* fbuf.c */
-extern void fbuf_init (gfc_unit *, int);
-internal_proto(fbuf_init);
-
-extern void fbuf_destroy (gfc_unit *);
-internal_proto(fbuf_destroy);
-
-extern int fbuf_reset (gfc_unit *);
-internal_proto(fbuf_reset);
-
-extern char * fbuf_alloc (gfc_unit *, int);
-internal_proto(fbuf_alloc);
-
-extern int fbuf_flush (gfc_unit *, unit_mode);
-internal_proto(fbuf_flush);
-
-extern int fbuf_seek (gfc_unit *, int, int);
-internal_proto(fbuf_seek);
-
-extern char * fbuf_read (gfc_unit *, int *);
-internal_proto(fbuf_read);
-
-/* Never call this function, only use fbuf_getc(). */
-extern int fbuf_getc_refill (gfc_unit *);
-internal_proto(fbuf_getc_refill);
-
-static inline int
-fbuf_getc (gfc_unit * u)
-{
- if (u->fbuf->pos < u->fbuf->act)
- return (unsigned char) u->fbuf->buf[u->fbuf->pos++];
- return fbuf_getc_refill (u);
-}
/* lock.c */
extern void free_ionml (st_parameter_dt *);
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index d8ad602e593..c281e34eacf 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -27,6 +27,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "io.h"
+#include "fbuf.h"
+#include "unix.h"
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c
index d5b4007ea23..bca21062956 100644
--- a/libgfortran/io/open.c
+++ b/libgfortran/io/open.c
@@ -25,6 +25,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
#include "io.h"
+#include "fbuf.h"
+#include "unix.h"
#include <unistd.h>
#include <string.h>
#include <errno.h>
diff --git a/libgfortran/io/read.c b/libgfortran/io/read.c
index 23a8fa3019d..a5cb97a00e5 100644
--- a/libgfortran/io/read.c
+++ b/libgfortran/io/read.c
@@ -24,6 +24,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
#include "io.h"
+#include "format.h"
#include <string.h>
#include <errno.h>
#include <ctype.h>
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index 06a1d2eb984..b5f52b1ccf3 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -29,6 +29,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
/* transfer.c -- Top level handling of data transfer statements. */
#include "io.h"
+#include "fbuf.h"
+#include "format.h"
+#include "unix.h"
#include <string.h>
#include <assert.h>
#include <stdlib.h>
diff --git a/libgfortran/io/unit.c b/libgfortran/io/unit.c
index 5dc3538f264..3eb66e9d26d 100644
--- a/libgfortran/io/unit.c
+++ b/libgfortran/io/unit.c
@@ -24,6 +24,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
#include "io.h"
+#include "fbuf.h"
+#include "format.h"
+#include "unix.h"
#include <stdlib.h>
#include <string.h>
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index 4ecba3a8f69..d385b040c9e 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
/* Unix stream I/O module */
#include "io.h"
+#include "unix.h"
#include <stdlib.h>
#include <limits.h>
diff --git a/libgfortran/io/unix.h b/libgfortran/io/unix.h
new file mode 100644
index 00000000000..721c63c02e4
--- /dev/null
+++ b/libgfortran/io/unix.h
@@ -0,0 +1,169 @@
+/* Copyright (C) 2009
+ Free Software Foundation, Inc.
+ Contributed by Janne Blomqvist
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran 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.
+
+Libgfortran 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/>. */
+
+#include "io.h"
+
+#ifndef GFOR_UNIX_H
+#define GFOR_UNIX_H
+
+struct stream
+{
+ ssize_t (*read) (struct stream *, void *, ssize_t);
+ ssize_t (*write) (struct stream *, const void *, ssize_t);
+ off_t (*seek) (struct stream *, off_t, int);
+ off_t (*tell) (struct stream *);
+ /* Avoid keyword truncate due to AIX namespace collision. */
+ int (*trunc) (struct stream *, off_t);
+ int (*flush) (struct stream *);
+ int (*close) (struct stream *);
+};
+
+/* Inline functions for doing file I/O given a stream. */
+static inline ssize_t
+sread (stream * s, void * buf, ssize_t nbyte)
+{
+ return s->read (s, buf, nbyte);
+}
+
+static inline ssize_t
+swrite (stream * s, const void * buf, ssize_t nbyte)
+{
+ return s->write (s, buf, nbyte);
+}
+
+static inline off_t
+sseek (stream * s, off_t offset, int whence)
+{
+ return s->seek (s, offset, whence);
+}
+
+static inline off_t
+stell (stream * s)
+{
+ return s->tell (s);
+}
+
+static inline int
+struncate (stream * s, off_t length)
+{
+ return s->trunc (s, length);
+}
+
+static inline int
+sflush (stream * s)
+{
+ return s->flush (s);
+}
+
+static inline int
+sclose (stream * s)
+{
+ return s->close (s);
+}
+
+
+extern int compare_files (stream *, stream *);
+internal_proto(compare_files);
+
+extern stream *open_external (st_parameter_open *, unit_flags *);
+internal_proto(open_external);
+
+extern stream *open_internal (char *, int, gfc_offset);
+internal_proto(open_internal);
+
+extern char * mem_alloc_w (stream *, int *);
+internal_proto(mem_alloc_w);
+
+extern char * mem_alloc_r (stream *, int *);
+internal_proto(mem_alloc_w);
+
+extern stream *input_stream (void);
+internal_proto(input_stream);
+
+extern stream *output_stream (void);
+internal_proto(output_stream);
+
+extern stream *error_stream (void);
+internal_proto(error_stream);
+
+extern int compare_file_filename (gfc_unit *, const char *, int);
+internal_proto(compare_file_filename);
+
+extern gfc_unit *find_file (const char *file, gfc_charlen_type file_len);
+internal_proto(find_file);
+
+extern int delete_file (gfc_unit *);
+internal_proto(delete_file);
+
+extern int file_exists (const char *file, gfc_charlen_type file_len);
+internal_proto(file_exists);
+
+extern const char *inquire_sequential (const char *, int);
+internal_proto(inquire_sequential);
+
+extern const char *inquire_direct (const char *, int);
+internal_proto(inquire_direct);
+
+extern const char *inquire_formatted (const char *, int);
+internal_proto(inquire_formatted);
+
+extern const char *inquire_unformatted (const char *, int);
+internal_proto(inquire_unformatted);
+
+extern const char *inquire_read (const char *, int);
+internal_proto(inquire_read);
+
+extern const char *inquire_write (const char *, int);
+internal_proto(inquire_write);
+
+extern const char *inquire_readwrite (const char *, int);
+internal_proto(inquire_readwrite);
+
+extern gfc_offset file_length (stream *);
+internal_proto(file_length);
+
+extern int is_seekable (stream *);
+internal_proto(is_seekable);
+
+extern int is_special (stream *);
+internal_proto(is_special);
+
+extern void flush_if_preconnected (stream *);
+internal_proto(flush_if_preconnected);
+
+extern void empty_internal_buffer(stream *);
+internal_proto(empty_internal_buffer);
+
+extern int stream_isatty (stream *);
+internal_proto(stream_isatty);
+
+extern char * stream_ttyname (stream *);
+internal_proto(stream_ttyname);
+
+extern int unpack_filename (char *, const char *, int);
+internal_proto(unpack_filename);
+
+
+#endif
diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c
index 3c16a43b9ab..63482461cc2 100644
--- a/libgfortran/io/write.c
+++ b/libgfortran/io/write.c
@@ -26,6 +26,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
#include "io.h"
+#include "format.h"
+#include "unix.h"
#include <assert.h>
#include <string.h>
#include <ctype.h>
@@ -446,9 +448,10 @@ extract_uint (const void *p, int len)
}
break;
#ifdef HAVE_GFC_INTEGER_16
+ case 10:
case 16:
{
- GFC_INTEGER_16 tmp;
+ GFC_INTEGER_16 tmp = 0;
memcpy ((void *) &tmp, p, len);
i = (GFC_UINTEGER_16) tmp;
}
@@ -482,20 +485,14 @@ write_l (st_parameter_dt *dtp, const fnode *f, char *source, int len)
static void
-write_int (st_parameter_dt *dtp, const fnode *f, const char *source, int len,
- const char *(*conv) (GFC_UINTEGER_LARGEST, char *, size_t))
+write_boz (st_parameter_dt *dtp, const fnode *f, const char *q, int n)
{
- GFC_UINTEGER_LARGEST n = 0;
int w, m, digits, nzero, nblank;
char *p;
- const char *q;
- char itoa_buf[GFC_BTOA_BUF_SIZE];
w = f->u.integer.w;
m = f->u.integer.m;
- n = extract_uint (source, len);
-
/* Special case: */
if (m == 0 && n == 0)
@@ -511,7 +508,6 @@ write_int (st_parameter_dt *dtp, const fnode *f, const char *source, int len,
goto done;
}
- q = conv (n, itoa_buf, sizeof (itoa_buf));
digits = strlen (q);
/* Select a width if none was specified. The idea here is to always
@@ -538,7 +534,6 @@ write_int (st_parameter_dt *dtp, const fnode *f, const char *source, int len,
goto done;
}
-
if (!dtp->u.p.no_leading_blank)
{
memset (p, ' ', nblank);
@@ -706,6 +701,202 @@ btoa (GFC_UINTEGER_LARGEST n, char *buffer, size_t len)
return p;
}
+/* The following three functions, btoa_big, otoa_big, and ztoa_big, are needed
+ to convert large reals with kind sizes that exceed the largest integer type
+ available on certain platforms. In these cases, byte by byte conversion is
+ performed. Endianess is taken into account. */
+
+/* Conversion to binary. */
+
+static const char *
+btoa_big (const char *s, char *buffer, int len, GFC_UINTEGER_LARGEST *n)
+{
+ char *q;
+ int i, j;
+
+ q = buffer;
+ if (big_endian)
+ {
+ const char *p = s;
+ for (i = 0; i < len; i++)
+ {
+ char c = *p;
+
+ /* Test for zero. Needed by write_boz later. */
+ if (*p != 0)
+ *n = 1;
+
+ for (j = 0; j < 8; j++)
+ {
+ *q++ = (c & 128) ? '1' : '0';
+ c <<= 1;
+ }
+ p++;
+ }
+ }
+ else
+ {
+ const char *p = s + len - 1;
+ for (i = 0; i < len; i++)
+ {
+ char c = *p;
+
+ /* Test for zero. Needed by write_boz later. */
+ if (*p != 0)
+ *n = 1;
+
+ for (j = 0; j < 8; j++)
+ {
+ *q++ = (c & 128) ? '1' : '0';
+ c <<= 1;
+ }
+ p--;
+ }
+ }
+
+ *q = '\0';
+
+ if (*n == 0)
+ return "0";
+
+ /* Move past any leading zeros. */
+ while (*buffer == '0')
+ buffer++;
+
+ return buffer;
+
+}
+
+/* Conversion to octal. */
+
+static const char *
+otoa_big (const char *s, char *buffer, int len, GFC_UINTEGER_LARGEST *n)
+{
+ char *q;
+ int i, j, k;
+ uint8_t octet;
+
+ q = buffer + GFC_OTOA_BUF_SIZE - 1;
+ *q = '\0';
+ i = k = octet = 0;
+
+ if (big_endian)
+ {
+ const char *p = s + len - 1;
+ char c = *p;
+ while (i < len)
+ {
+ /* Test for zero. Needed by write_boz later. */
+ if (*p != 0)
+ *n = 1;
+
+ for (j = 0; j < 3 && i < len; j++)
+ {
+ octet |= (c & 1) << j;
+ c >>= 1;
+ if (++k > 7)
+ {
+ i++;
+ k = 0;
+ c = *--p;
+ }
+ }
+ *--q = '0' + octet;
+ octet = 0;
+ }
+ }
+ else
+ {
+ const char *p = s;
+ char c = *p;
+ while (i < len)
+ {
+ /* Test for zero. Needed by write_boz later. */
+ if (*p != 0)
+ *n = 1;
+
+ for (j = 0; j < 3 && i < len; j++)
+ {
+ octet |= (c & 1) << j;
+ c >>= 1;
+ if (++k > 7)
+ {
+ i++;
+ k = 0;
+ c = *++p;
+ }
+ }
+ *--q = '0' + octet;
+ octet = 0;
+ }
+ }
+
+ if (*n == 0)
+ return "0";
+
+ /* Move past any leading zeros. */
+ while (*q == '0')
+ q++;
+
+ return q;
+}
+
+/* Conversion to hexidecimal. */
+
+static const char *
+ztoa_big (const char *s, char *buffer, int len, GFC_UINTEGER_LARGEST *n)
+{
+ static char a[16] = {'0', '1', '2', '3', '4', '5', '6', '7',
+ '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
+
+ char *q;
+ uint8_t h, l;
+ int i;
+
+ q = buffer;
+
+ if (big_endian)
+ {
+ const char *p = s;
+ for (i = 0; i < len; i++)
+ {
+ /* Test for zero. Needed by write_boz later. */
+ if (*p != 0)
+ *n = 1;
+
+ h = (*p >> 4) & 0x0F;
+ l = *p++ & 0x0F;
+ *q++ = a[h];
+ *q++ = a[l];
+ }
+ }
+ else
+ {
+ const char *p = s + len - 1;
+ for (i = 0; i < len; i++)
+ {
+ /* Test for zero. Needed by write_boz later. */
+ if (*p != 0)
+ *n = 1;
+
+ h = (*p >> 4) & 0x0F;
+ l = *p-- & 0x0F;
+ *q++ = a[h];
+ *q++ = a[l];
+ }
+ }
+
+ *q = '\0';
+
+ if (*n == 0)
+ return "0";
+
+ /* Move past any leading zeros. */
+ while (*buffer == '0')
+ buffer++;
+
+ return buffer;
+}
/* gfc_itoa()-- Integer to decimal conversion.
The itoa function is a widespread non-standard extension to standard
@@ -757,22 +948,64 @@ write_i (st_parameter_dt *dtp, const fnode *f, const char *p, int len)
void
-write_b (st_parameter_dt *dtp, const fnode *f, const char *p, int len)
+write_b (st_parameter_dt *dtp, const fnode *f, const char *source, int len)
{
- write_int (dtp, f, p, len, btoa);
+ const char *p;
+ char itoa_buf[GFC_BTOA_BUF_SIZE];
+ GFC_UINTEGER_LARGEST n = 0;
+
+ if (len > (int) sizeof (GFC_UINTEGER_LARGEST))
+ {
+ p = btoa_big (source, itoa_buf, len, &n);
+ write_boz (dtp, f, p, n);
+ }
+ else
+ {
+ n = extract_uint (source, len);
+ p = btoa (n, itoa_buf, sizeof (itoa_buf));
+ write_boz (dtp, f, p, n);
+ }
}
void
-write_o (st_parameter_dt *dtp, const fnode *f, const char *p, int len)
+write_o (st_parameter_dt *dtp, const fnode *f, const char *source, int len)
{
- write_int (dtp, f, p, len, otoa);
+ const char *p;
+ char itoa_buf[GFC_OTOA_BUF_SIZE];
+ GFC_UINTEGER_LARGEST n = 0;
+
+ if (len > (int) sizeof (GFC_UINTEGER_LARGEST))
+ {
+ p = otoa_big (source, itoa_buf, len, &n);
+ write_boz (dtp, f, p, n);
+ }
+ else
+ {
+ n = extract_uint (source, len);
+ p = otoa (n, itoa_buf, sizeof (itoa_buf));
+ write_boz (dtp, f, p, n);
+ }
}
void
-write_z (st_parameter_dt *dtp, const fnode *f, const char *p, int len)
+write_z (st_parameter_dt *dtp, const fnode *f, const char *source, int len)
{
- write_int (dtp, f, p, len, gfc_xtoa);
+ const char *p;
+ char itoa_buf[GFC_XTOA_BUF_SIZE];
+ GFC_UINTEGER_LARGEST n = 0;
+
+ if (len > (int) sizeof (GFC_UINTEGER_LARGEST))
+ {
+ p = ztoa_big (source, itoa_buf, len, &n);
+ write_boz (dtp, f, p, n);
+ }
+ else
+ {
+ n = extract_uint (source, len);
+ p = gfc_xtoa (n, itoa_buf, sizeof (itoa_buf));
+ write_boz (dtp, f, p, n);
+ }
}
diff --git a/libgfortran/io/write_float.def b/libgfortran/io/write_float.def
index e6880027a86..eca0e56a5e9 100644
--- a/libgfortran/io/write_float.def
+++ b/libgfortran/io/write_float.def
@@ -141,6 +141,13 @@ output_float (st_parameter_dt *dtp, const fnode *f, char *buffer, size_t size,
switch (ft)
{
case FMT_F:
+ if (d == 0 && e <= 0 && dtp->u.p.scale_factor == 0)
+ {
+ memmove (digits + 1, digits, ndigits - 1);
+ digits[0] = '0';
+ e++;
+ }
+
nbefore = e + dtp->u.p.scale_factor;
if (nbefore < 0)
{
@@ -255,7 +262,7 @@ output_float (st_parameter_dt *dtp, const fnode *f, char *buffer, size_t size,
case ROUND_NEAREST:
/* Round compatible unless there is a tie. A tie is a 5 with
all trailing zero's. */
- i = nafter + 1;
+ i = nafter + nbefore;
if (digits[i] == '5')
{
for(i++ ; i < ndigits; i++)
@@ -264,7 +271,7 @@ output_float (st_parameter_dt *dtp, const fnode *f, char *buffer, size_t size,
goto do_rnd;
}
/* It is a tie so round to even. */
- switch (digits[nafter])
+ switch (digits[nafter + nbefore - 1])
{
case '1':
case '3':
@@ -818,14 +825,6 @@ sprintf (buffer, "%+-#" STR(MIN_FIELD_WIDTH) ".*" \
return;\
}\
tmp = sign_bit ? -tmp : tmp;\
- if (f->u.real.d == 0 && f->format == FMT_F\
- && dtp->u.p.scale_factor == 0)\
- {\
- if (tmp < 0.5)\
- tmp = 0.0;\
- else if (tmp < 1.0)\
- tmp = 1.0;\
- }\
zero_flag = (tmp == 0.0);\
\
DTOA ## y\
diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h
index 40cb080a78c..bba95f7c781 100644
--- a/libgfortran/libgfortran.h
+++ b/libgfortran/libgfortran.h
@@ -672,10 +672,18 @@ internal_proto(show_backtrace);
/* error.c */
+#if defined(HAVE_GFC_REAL_16)
+#define GFC_LARGEST_BUF (sizeof (GFC_REAL_16))
+#elif defined(HAVE_GFC_REAL_10)
+#define GFC_LARGEST_BUF (sizeof (GFC_REAL_10))
+#else
+#define GFC_LARGEST_BUF (sizeof (GFC_INTEGER_LARGEST))
+#endif
+
#define GFC_ITOA_BUF_SIZE (sizeof (GFC_INTEGER_LARGEST) * 3 + 2)
-#define GFC_XTOA_BUF_SIZE (sizeof (GFC_UINTEGER_LARGEST) * 2 + 1)
-#define GFC_OTOA_BUF_SIZE (sizeof (GFC_INTEGER_LARGEST) * 3 + 1)
-#define GFC_BTOA_BUF_SIZE (sizeof (GFC_INTEGER_LARGEST) * 8 + 1)
+#define GFC_XTOA_BUF_SIZE (GFC_LARGEST_BUF * 2 + 1)
+#define GFC_OTOA_BUF_SIZE (GFC_LARGEST_BUF * 3 + 1)
+#define GFC_BTOA_BUF_SIZE (GFC_LARGEST_BUF * 8 + 1)
extern void sys_exit (int) __attribute__ ((noreturn));
internal_proto(sys_exit);
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 682da80e297..ba9393ed960 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,20 @@
+2009-10-26 Jakub Jelinek <jakub@redhat.com>
+
+ * acinclude.m4 (LIBGOMP_CHECK_LINKER_FEATURES): Avoid using too many
+ *s. Accept ld version without text in ()s.
+ * configure: Regenerated.
+
+2009-10-22 Razya Ladelsky <razya@il.ibm.com>
+
+ * testsuite/libgomp.graphite/force-parallel-2.c: Adjust scan.
+
+2009-10-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ PR libgomp/41418
+ * configure.ac: Set FC to "no" if $GFORTRAN starts with "no"
+ or a hyphen (happens with fortran language disabled).
+ * configure: Regenerate.
+
2009-09-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* acinclude.m4 (LIBGOMP_CHECK_LINKER_FEATURES): Avoid 'head',
diff --git a/libgomp/acinclude.m4 b/libgomp/acinclude.m4
index 5e0f96c70f5..9e6b77b247a 100644
--- a/libgomp/acinclude.m4
+++ b/libgomp/acinclude.m4
@@ -153,7 +153,7 @@ AC_DEFUN([LIBGOMP_CHECK_LINKER_FEATURES], [
fi
changequote(,)
ldver=`$LD --version 2>/dev/null |
- sed -e 's/GNU g*o*ld v*e*r*s*i*o*n* *\(([^)]*)* *\) \([0-9.][0-9.]*\).*/\2/; q'`
+ sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'`
changequote([,])
libgomp_gnu_ld_version=`echo $ldver | \
$AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'`
diff --git a/libgomp/configure b/libgomp/configure
index d138f687983..dac0399f7b6 100755
--- a/libgomp/configure
+++ b/libgomp/configure
@@ -11340,7 +11340,12 @@ fi
# We need gfortran to compile parts of the library
# We can't use AC_PROG_FC because it expects a fully working gfortran.
#AC_PROG_FC(gfortran)
-FC="$GFORTRAN"
+case `echo $GFORTRAN` in
+ -* | no* )
+ FC=no ;;
+ *)
+ FC="$GFORTRAN" ;;
+esac
ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
@@ -12351,11 +12356,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12354: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12359: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:12358: \$? = $ac_status" >&5
+ echo "$as_me:12363: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -12450,11 +12455,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12453: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12458: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:12457: \$? = $ac_status" >&5
+ echo "$as_me:12462: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -12502,11 +12507,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12505: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12510: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:12509: \$? = $ac_status" >&5
+ echo "$as_me:12514: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -15693,7 +15698,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
fi
ldver=`$LD --version 2>/dev/null |
- sed -e 's/GNU g*o*ld v*e*r*s*i*o*n* *\(([^)]*)* *\) \([0-9.][0-9.]*\).*/\2/; q'`
+ sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'`
libgomp_gnu_ld_version=`echo $ldver | \
$AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
diff --git a/libgomp/configure.ac b/libgomp/configure.ac
index e0bdf2b9ac9..792c9f52068 100644
--- a/libgomp/configure.ac
+++ b/libgomp/configure.ac
@@ -142,7 +142,12 @@ AM_MAINTAINER_MODE
# We need gfortran to compile parts of the library
# We can't use AC_PROG_FC because it expects a fully working gfortran.
#AC_PROG_FC(gfortran)
-FC="$GFORTRAN"
+case `echo $GFORTRAN` in
+ -* | no* )
+ FC=no ;;
+ *)
+ FC="$GFORTRAN" ;;
+esac
AC_PROG_FC(gfortran)
FCFLAGS="$FCFLAGS -Wall"
diff --git a/libgomp/testsuite/libgomp.graphite/force-parallel-2.c b/libgomp/testsuite/libgomp.graphite/force-parallel-2.c
index a198fed658a..7f2c823f73e 100644
--- a/libgomp/testsuite/libgomp.graphite/force-parallel-2.c
+++ b/libgomp/testsuite/libgomp.graphite/force-parallel-2.c
@@ -23,7 +23,7 @@ int main(void)
}
/* Check that parallel code generation part make the right answer. */
-/* { dg-final { scan-tree-dump-times "2 loops carried no dependency" 1 "graphite" } } */
+/* { dg-final { scan-tree-dump-times "2 loops carried no dependency" 2 "graphite" } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
/* { dg-final { cleanup-tree-dump "parloops" } } */
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 1b3a44c4a2e..05e594e7cf0 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,17 @@
+2009-10-08 Daniel Gutson <dgutson@codesourcery.com>
+ Daniel Jacobowitz <dan@codesourcery.com>
+ Pedro Alves <pedro@codesourcery.com>
+
+ libiberty/
+ * argv.c (consume_whitespace): New function.
+ (only_whitespace): New function.
+ (buildargv): Always use ISSPACE by calling consume_whitespace.
+ (expandargv): Skip empty files. Do not stop at the first empty
+ argument (calling only_whitespace)..
+ * testsuite/test-expandargv.c: (test_data): Test empty lines
+ and empty arguments.
+ (run_tests): Fix false positives due to shorter arguments.
+
2009-09-30 Martin Thuresson <martint@google.com>
* regex.c (byte_re_match_2_internal): Split declaration and
diff --git a/libiberty/argv.c b/libiberty/argv.c
index 38bd4497090..3084248b96c 100644
--- a/libiberty/argv.c
+++ b/libiberty/argv.c
@@ -119,6 +119,24 @@ void freeargv (char **vector)
}
}
+static void
+consume_whitespace (const char **input)
+{
+ while (ISSPACE (**input))
+ {
+ (*input)++;
+ }
+}
+
+static int
+only_whitespace (const char* input)
+{
+ while (*input != EOS && ISSPACE (*input))
+ input++;
+
+ return (*input == EOS);
+}
+
/*
@deftypefn Extension char** buildargv (char *@var{sp})
@@ -179,10 +197,8 @@ char **buildargv (const char *input)
do
{
/* Pick off argv[argc] */
- while (ISBLANK (*input))
- {
- input++;
- }
+ consume_whitespace (&input);
+
if ((maxargc == 0) || (argc >= (maxargc - 1)))
{
/* argv needs initialization, or expansion */
@@ -278,10 +294,7 @@ char **buildargv (const char *input)
argc++;
argv[argc] = NULL;
- while (ISSPACE (*input))
- {
- input++;
- }
+ consume_whitespace (&input);
}
while (*input != EOS);
}
@@ -420,8 +433,17 @@ expandargv (int *argcp, char ***argvp)
goto error;
/* Add a NUL terminator. */
buffer[len] = '\0';
- /* Parse the string. */
- file_argv = buildargv (buffer);
+ /* If the file is empty or contains only whitespace, buildargv would
+ return a single empty argument. In this context we want no arguments,
+ instead. */
+ if (only_whitespace (buffer))
+ {
+ file_argv = (char **) xmalloc (sizeof (char *));
+ file_argv[0] = NULL;
+ }
+ else
+ /* Parse the string. */
+ file_argv = buildargv (buffer);
/* If *ARGVP is not already dynamically allocated, copy it. */
if (!argv_dynamic)
{
@@ -434,7 +456,7 @@ expandargv (int *argcp, char ***argvp)
}
/* Count the number of arguments. */
file_argc = 0;
- while (file_argv[file_argc] && *file_argv[file_argc])
+ while (file_argv[file_argc])
++file_argc;
/* Now, insert FILE_ARGV into ARGV. The "+1" below handles the
NULL terminator at the end of ARGV. */
diff --git a/libiberty/testsuite/test-expandargv.c b/libiberty/testsuite/test-expandargv.c
index 9d1af014545..c16a0322a6c 100644
--- a/libiberty/testsuite/test-expandargv.c
+++ b/libiberty/testsuite/test-expandargv.c
@@ -107,6 +107,38 @@ const char *test_data[] = {
ARGV0,
0,
+ /* Test 4 - Check for options beginning with an empty line. */
+ "\na\nb", /* Test 4 data */
+ ARGV0,
+ "@test-expandargv-4.lst",
+ 0,
+ ARGV0,
+ "a",
+ "b",
+ 0,
+
+ /* Test 5 - Check for options containing an empty argument. */
+ "a\n''\nb", /* Test 5 data */
+ ARGV0,
+ "@test-expandargv-5.lst",
+ 0,
+ ARGV0,
+ "a",
+ "",
+ "b",
+ 0,
+
+ /* Test 6 - Check for options containing a quoted newline. */
+ "a\n'a\n\nb'\nb", /* Test 6 data */
+ ARGV0,
+ "@test-expandargv-6.lst",
+ 0,
+ ARGV0,
+ "a",
+ "a\n\nb",
+ "b",
+ 0,
+
0 /* Test done marker, don't remove. */
};
@@ -246,7 +278,7 @@ run_tests (const char **test_data)
/* Compare each of the argv's ... */
else
for (k = 0; k < argc_after; k++)
- if (strncmp (argv_before[k], argv_after[k], strlen(argv_after[k])) != 0)
+ if (strcmp (argv_before[k], argv_after[k]) != 0)
{
printf ("FAIL: test-expandargv-%d. Arguments don't match.\n", i);
failed++;
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 78aaa3e473a..d7c6d36a09d 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,16 @@
+2009-11-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ PR bootstrap/38867
+ * configure.ac (expanded_prefix): New variable, set to the
+ default prefix if none was passed on the command line.
+ * configure: Regenerate.
+
+2009-10-22 Matthias Klose <doko@ubuntu.com>
+
+ * configure.ac: Rename --enable-plugin to --enable-browser-plugin,
+ pass --{en,dis}able-plugin to the classpath configure.
+ * configure: Regenerate.
+
2009-09-30 Dave Korn <dave.korn.cygwin@gmail.com>
* configure.host (libgcj_sublib_ltflags): New variable.
diff --git a/libjava/classpath/ChangeLog b/libjava/classpath/ChangeLog
index 475e6bdc1b3..a2df28c46cf 100644
--- a/libjava/classpath/ChangeLog
+++ b/libjava/classpath/ChangeLog
@@ -1,3 +1,10 @@
+2009-10-22 Richard Guenther <rguenther@suse.de>
+
+ PR cp-tools/39177
+ * tools/gnu/classpath/tools/jar/Creator.java (writeCommandLineEntries):
+ Do not use uninitialized manifest.
+ * tools/classes/gnu/classpath/tools/jar/Creator.class: Re-generated.
+
2009-08-26 Dave Korn <dave.korn.cygwin@gmail.com>
* ltmain.sh (removedotparts): Don't use comma as 's' separator.
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Creator.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Creator.class
index 517fe0c7a33..ad4cc74f732 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Creator.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Creator.class
Binary files differ
diff --git a/libjava/classpath/tools/gnu/classpath/tools/jar/Creator.java b/libjava/classpath/tools/gnu/classpath/tools/jar/Creator.java
index a6b6112caa1..6ffce18ac05 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/jar/Creator.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/jar/Creator.java
@@ -216,11 +216,14 @@ public class Creator
manifest = createManifest(parameters);
/* If no version is specified, provide the same manifest version default
* as Sun's jar tool */
- Attributes attr = manifest.getMainAttributes();
- if (attr.getValue(Attributes.Name.MANIFEST_VERSION) == null)
- attr.putValue(Attributes.Name.MANIFEST_VERSION.toString(), "1.0");
- attr.putValue("Created-By", System.getProperty("java.version") +
+ if (parameters.wantManifest)
+ {
+ Attributes attr = manifest.getMainAttributes();
+ if (attr.getValue(Attributes.Name.MANIFEST_VERSION) == null)
+ attr.putValue(Attributes.Name.MANIFEST_VERSION.toString(), "1.0");
+ attr.putValue("Created-By", System.getProperty("java.version") +
" (" + System.getProperty("java.vendor") + ")");
+ }
outputStream = new JarOutputStream(os, manifest);
// FIXME: this sets the method too late for the manifest file.
outputStream.setMethod(parameters.storageMode);
diff --git a/libjava/configure b/libjava/configure
index 95d21af1e5f..5eabcf573b3 100755
--- a/libjava/configure
+++ b/libjava/configure
@@ -1050,7 +1050,7 @@ enable_multilib
with_cross_host
with_newlib
enable_version_specific_runtime_libs
-enable_plugin
+enable_browser_plugin
enable_gconf_peer
with_antlr_jar
enable_gjdoc
@@ -1739,7 +1739,7 @@ Optional Features:
--enable-version-specific-runtime-libs
specify that runtime libraries should be installed
in a compiler-specific directory
- --enable-plugin build gcjwebplugin web browser plugin
+ --enable-browser-plugin build gcjwebplugin web browser plugin
--enable-gconf-peer compile GConf native peers for util.preferences
--disable-gjdoc compile GJDoc (disabled by --disable-gjdoc)
default=yes
@@ -3363,15 +3363,15 @@ else
fi
-# Check whether --enable-plugin was given.
-if test "${enable_plugin+set}" = set; then :
- enableval=$enable_plugin; case "$enableval" in
- yes) plugin_enabled=yes ;;
- no) plugin_enabled=no ;;
- *) as_fn_error "Unknown argument to enable/disable plugin" "$LINENO" 5;;
+# Check whether --enable-browser-plugin was given.
+if test "${enable_browser_plugin+set}" = set; then :
+ enableval=$enable_browser_plugin; case "$enableval" in
+ yes) browser_plugin_enabled=yes ;;
+ no) browser_plugin_enabled=no ;;
+ *) as_fn_error "Unknown argument to enable/disable browser plugin" "$LINENO" 5;;
esac
else
- plugin_enabled=no
+ browser_plugin_enabled=no
fi
@@ -6705,9 +6705,14 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
+expanded_prefix=$prefix
+if test "X$prefix" = XNONE; then
+ expanded_prefix=${ac_default_prefix}
+fi
+
cat >>confdefs.h <<_ACEOF
-#define LIBGCJ_PREFIX "$prefix"
+#define LIBGCJ_PREFIX "$expanded_prefix"
_ACEOF
@@ -6833,8 +6838,10 @@ ac_configure_args="$ac_configure_args --with-vm-classes=$dir1:$dir2"
ac_configure_args="$ac_configure_args --disable-core-jni"
ac_configure_args="$ac_configure_args --disable-examples"
ac_configure_args="$ac_configure_args --with-glibj=build"
-if test "$plugin_enabled" != yes; then
+if test "$browser_plugin_enabled" != yes; then
ac_configure_args="$ac_configure_args --disable-plugin"
+else
+ ac_configure_args="$ac_configure_args --enable-plugin"
fi
if test "$gconf_enabled" != yes; then
ac_configure_args="$ac_configure_args --disable-gconf-peer"
@@ -7504,13 +7511,13 @@ if test "${lt_cv_nm_interface+set}" = set; then :
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:7507: $ac_compile\"" >&5)
+ (eval echo "\"\$as_me:7514: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
- (eval echo "\"\$as_me:7510: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval echo "\"\$as_me:7517: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
- (eval echo "\"\$as_me:7513: output\"" >&5)
+ (eval echo "\"\$as_me:7520: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
@@ -8705,7 +8712,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 8708 "configure"' > conftest.$ac_ext
+ echo '#line 8715 "configure"' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -10639,11 +10646,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:10642: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:10649: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:10646: \$? = $ac_status" >&5
+ echo "$as_me:10653: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -10978,11 +10985,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:10981: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:10988: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:10985: \$? = $ac_status" >&5
+ echo "$as_me:10992: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -11083,11 +11090,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:11086: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:11093: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:11090: \$? = $ac_status" >&5
+ echo "$as_me:11097: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -11138,11 +11145,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:11141: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:11148: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:11145: \$? = $ac_status" >&5
+ echo "$as_me:11152: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -13547,7 +13554,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 13550 "configure"
+#line 13557 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -13643,7 +13650,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 13646 "configure"
+#line 13653 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -15605,11 +15612,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:15608: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:15615: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:15612: \$? = $ac_status" >&5
+ echo "$as_me:15619: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -15704,11 +15711,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:15707: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:15714: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:15711: \$? = $ac_status" >&5
+ echo "$as_me:15718: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -15756,11 +15763,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:15759: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:15766: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:15763: \$? = $ac_status" >&5
+ echo "$as_me:15770: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -17172,11 +17179,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17175: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17182: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:17179: \$? = $ac_status" >&5
+ echo "$as_me:17186: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -17505,11 +17512,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17508: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17515: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:17512: \$? = $ac_status" >&5
+ echo "$as_me:17519: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -17604,11 +17611,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17607: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17614: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:17611: \$? = $ac_status" >&5
+ echo "$as_me:17618: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -17656,11 +17663,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17659: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17666: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:17663: \$? = $ac_status" >&5
+ echo "$as_me:17670: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -19258,7 +19265,7 @@ if test "${enable_sjlj_exceptions+set}" = set; then :
enableval=$enable_sjlj_exceptions; :
else
cat > conftest.$ac_ext << EOF
-#line 19261 "configure"
+#line 19268 "configure"
struct S { ~S(); };
void bar();
void foo()
@@ -22933,7 +22940,7 @@ if test ! -f gnu/classpath/Configuration.java; then
test -d gnu || mkdir gnu
test -d gnu/classpath || mkdir gnu/classpath
# Note that it is not crucial that all the values here be correct.
- sed -e "s,@prefix@,$prefix," \
+ sed -e "s,@prefix@,$expanded_prefix," \
-e "s,@VERSION@,$VERSION," \
-e "s,@LIBDEBUG@,false," \
-e "s,@INIT_LOAD_LIBRARY@,false," \
@@ -24265,10 +24272,10 @@ then
# Needed for installing Python modules during make install.
python_mod_dir="\${prefix}/share/python"
# Needed for substituting into aot-compile*
- python_mod_dir_expanded="${prefix}/share/python"
+ python_mod_dir_expanded="${expanded_prefix}/share/python"
else
python_mod_dir="\${prefix}${with_python_dir}"
- python_mod_dir_expanded="${prefix}${with_python_dir}"
+ python_mod_dir_expanded="${expanded_prefix}${with_python_dir}"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Python modules dir: ${python_mod_dir_expanded}" >&5
$as_echo "Python modules dir: ${python_mod_dir_expanded}" >&6; };
@@ -24510,7 +24517,7 @@ $as_echo "arch directory: ${host_cpu}" >&6; }
LIBDIR=$libdir
if test "x${exec_prefix}" = "xNONE"
then
- lib_exec_prefix=$prefix
+ lib_exec_prefix=$expanded_prefix
else
lib_exec_prefix=$exec_prefix
fi
diff --git a/libjava/configure.ac b/libjava/configure.ac
index bfd33fd5154..b2037d28152 100644
--- a/libjava/configure.ac
+++ b/libjava/configure.ac
@@ -55,15 +55,15 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
[version_specific_libs=no]
)
-AC_ARG_ENABLE(plugin,
- AS_HELP_STRING([--enable-plugin],
+AC_ARG_ENABLE(browser-plugin,
+ AS_HELP_STRING([--enable-browser-plugin],
[build gcjwebplugin web browser plugin]),
[case "$enableval" in
- yes) plugin_enabled=yes ;;
- no) plugin_enabled=no ;;
- *) AC_MSG_ERROR([Unknown argument to enable/disable plugin]);;
+ yes) browser_plugin_enabled=yes ;;
+ no) browser_plugin_enabled=no ;;
+ *) AC_MSG_ERROR([Unknown argument to enable/disable browser plugin]);;
esac],
- [plugin_enabled=no]
+ [browser_plugin_enabled=no]
)
AC_ARG_ENABLE(gconf-peer,
@@ -366,7 +366,12 @@ AM_CONDITIONAL(X_AWT, test "$use_x_awt" = yes)
AC_DEFINE_UNQUOTED(AWT_TOOLKIT, "$TOOLKIT", [Name of default AWT toolkit])
-AC_DEFINE_UNQUOTED(LIBGCJ_PREFIX, "$prefix", [Installation prefix])
+expanded_prefix=$prefix
+if test "X$prefix" = XNONE; then
+ expanded_prefix=${ac_default_prefix}
+fi
+
+AC_DEFINE_UNQUOTED(LIBGCJ_PREFIX, "$expanded_prefix", [Installation prefix])
# Create standard.omit based on decisions we just made.
cp $srcdir/standard.omit.in standard.omit
@@ -491,8 +496,10 @@ ac_configure_args="$ac_configure_args --disable-core-jni"
dnl FIXME?
ac_configure_args="$ac_configure_args --disable-examples"
ac_configure_args="$ac_configure_args --with-glibj=build"
-if test "$plugin_enabled" != yes; then
+if test "$browser_plugin_enabled" != yes; then
ac_configure_args="$ac_configure_args --disable-plugin"
+else
+ ac_configure_args="$ac_configure_args --enable-plugin"
fi
if test "$gconf_enabled" != yes; then
ac_configure_args="$ac_configure_args --disable-gconf-peer"
@@ -1435,7 +1442,7 @@ if test ! -f gnu/classpath/Configuration.java; then
test -d gnu || mkdir gnu
test -d gnu/classpath || mkdir gnu/classpath
# Note that it is not crucial that all the values here be correct.
- sed -e "s,@prefix@,$prefix," \
+ sed -e "s,@prefix@,$expanded_prefix," \
-e "s,@VERSION@,$VERSION," \
-e "s,@LIBDEBUG@,false," \
-e "s,@INIT_LOAD_LIBRARY@,false," \
@@ -1773,10 +1780,10 @@ then
# Needed for installing Python modules during make install.
python_mod_dir="\${prefix}/share/python"
# Needed for substituting into aot-compile*
- python_mod_dir_expanded="${prefix}/share/python"
+ python_mod_dir_expanded="${expanded_prefix}/share/python"
else
python_mod_dir="\${prefix}${with_python_dir}"
- python_mod_dir_expanded="${prefix}${with_python_dir}"
+ python_mod_dir_expanded="${expanded_prefix}${with_python_dir}"
fi
AC_MSG_RESULT(Python modules dir: ${python_mod_dir_expanded});
AC_SUBST(python_mod_dir)
@@ -1954,7 +1961,7 @@ then
LIBDIR=$libdir
if test "x${exec_prefix}" = "xNONE"
then
- lib_exec_prefix=$prefix
+ lib_exec_prefix=$expanded_prefix
else
lib_exec_prefix=$exec_prefix
fi
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 860b2000214..8661b23700d 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,14 +1,688 @@
+2009-11-06 Benjamin Kosnik <bkoz@redhat.com>
+
+ * doc/doxygen/user.cfg.in: Adjust includes.
+
+ * doc/doxygen/doxygroups.cc: Move group markup.
+ * include/tr1_impl/regex: Change " to '. Add group markup.
+ * include/std/utility: Same.
+ * include/std/type_traits: Same.
+ * include/std/streambuf: Same.
+ * include/std/iosfwd: Same.
+ * include/std/limits: Same.
+ * include/std/sstream: Same.
+ * include/profile/impl/profiler_state.h: Same.
+ * include/profile/impl/profiler_hashtable_size.h: Same.
+ * include/bits/stl_algobase.h: Same.
+ * include/bits/stl_iterator_base_types.h: Same.
+ * include/bits/stream_iterator.h: Same.
+ * include/bits/stl_iterator.h: Same.
+ * include/bits/stl_tempbuf.h: Same.
+ * include/bits/streambuf_iterator.h: Same.
+ * libsupc++/exception: Same.
+ * libsupc++/cxxabi.h: Same.
+ * include/tr1_impl/type_traits: Same.
+
+ * include/parallel/multiway_merge.h: Change @__c to @c, @__f to @f.
+ * include/parallel/list_partition.h: Same.
+ * include/parallel/for_each.h: Same.
+ * include/parallel/workstealing.h: Same.
+ * include/parallel/base.h: Same.
+ * include/parallel/equally_split.h: Same.
+ * include/parallel/random_shuffle.h: Same.
+ * include/parallel/balanced_quicksort.h: Same.
+ * include/parallel/merge.h: Same.
+ * include/parallel/multiway_mergesort.h: Same.
+ * include/parallel/compatibility.h: Same.
+ * include/parallel/queue.h: Same.
+ * include/parallel/checkers.h: Same.
+ * include/parallel/random_number.h: Same.
+
+
+ * include/c_global/csignal: Change # to \#.
+ * include/c_global/cstdlib: Same.
+ * include/c_global/cstdio: Same.
+ * include/c_global/cstdarg: Same.
+ * include/c_global/cctype: Same.
+ * include/c_global/cerrno: Same.
+ * include/c_global/cstdatomic: Same.
+ * include/c_global/cmath: Same.
+ * include/c_global/ciso646: Same.
+ * include/c_global/ctime: Same.
+ * include/c_global/clocale: Same.
+ * include/c_global/climits: Same.
+ * include/c_global/cassert: Same.
+ * include/c_global/csetjmp: Same.
+ * include/c_global/cwchar: Same.
+ * include/c_global/cfloat: Same.
+ * include/c_global/cstring: Same.
+ * include/c_global/cstddef: Same.
+ * include/c_global/cwctype: Same.
+
+ * include/std/memory: Only dance around boost_sp_counted_base.h.
+ * include/tr1_impl/boost_sp_counted_base.h: Add markup.
+ * include/tr1/shared_ptr.h: Strip markup.
+ * include/bits/shared_ptr.h: Move base types...
+ * include/bits/shared_ptr_base.h: ...here.
+ * include/Makefile.am: Add.
+ * include/Makefile.in: Regenerate.
+ * configure: Same.
+ * testsuite/20_util/make_signed/requirements/typedefs_neg.cc:
+ Adjust line numbers.
+ * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same.
+
+2009-11-06 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/parallel/multiway_merge.h: Simple formatting and
+ uglification fixes.
+ * include/parallel/find_selectors.h: Likewise.
+ * include/parallel/losertree.h: Likewise.
+ * include/parallel/list_partition.h: Likewise.
+ * include/parallel/for_each.h: Likewise.
+ * include/parallel/multiseq_selection.h: Likewise.
+ * include/parallel/workstealing.h: Likewise.
+ * include/parallel/par_loop.h: Likewise.
+ * include/parallel/numeric: Likewise.
+ * include/parallel/quicksort.h: Likewise.
+ * include/parallel/equally_split.h: Likewise.
+ * include/parallel/omp_loop_static.h: Likewise.
+ * include/parallel/random_shuffle.h: Likewise.
+ * include/parallel/balanced_quicksort.h: Likewise.
+ * include/parallel/tags.h: Likewise.
+ * include/parallel/set_operations.h: Likewise.
+ * include/parallel/merge.h: Likewise.
+ * include/parallel/unique_copy.h: Likewise.
+ * include/parallel/multiway_mergesort.h: Likewise.
+ * include/parallel/search.h: Likewise.
+ * include/parallel/partition.h: Likewise.
+ * include/parallel/partial_sum.h: Likewise.
+ * include/parallel/find.h: Likewise.
+ * include/parallel/queue.h: Likewise.
+ * include/parallel/omp_loop.h: Likewise.
+ * include/parallel/checkers.h: Likewise.
+ * include/parallel/sort.h: Likewise.
+
+2009-11-06 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ PR libstdc++/41949
+ * include/std/ostream: Adjust link.
+
+2009-11-05 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/parallel/multiway_merge.h: Simple formatting and
+ uglification fixes.
+ * include/parallel/losertree.h: Likewise.
+ * include/parallel/base.h: Likewise.
+ * include/parallel/par_loop.h: Likewise.
+ * include/parallel/omp_loop_static.h: Likewise.
+ * include/parallel/multiway_mergesort.h: Likewise.
+ * include/parallel/partial_sum.h: Likewise.
+ * include/parallel/omp_loop.h: Likewise.
+
+2009-11-04 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/25_algorithms/fill/5.cc: Move...
+ * testsuite/25_algorithms/fill_n/1.cc: ...here.
+
+2009-11-04 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/parallel/multiway_merge.h: Simple formatting and
+ uglification fixes.
+ * include/parallel/losertree.h: Likewise.
+
+2009-11-03 David Krauss <potswa@mac.com>
+ Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/41351
+ * include/bits/stl_algo.h (__rotate(_RandomAccessIterator,
+ _RandomAccessIterator, _RandomAccessIterator,
+ random_access_iterator_tag)): Rewrite to use only std::swap in
+ general and std::copy/std::copy_backward when safe.
+
+2009-11-02 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/std/future: Use base class with nested types.
+ (__future_base): New.
+ (__future_base::_Result_base): From _Future_result_base.
+ (__future_base::_Result): From _Future_result.
+ (__future_base::_Move_result): From _Move_future_result.
+ (__future_base::_Ptr): From _Future_ptr.
+ (__future_base::_State): From _Future_state.
+ (__basic_future): From _Future_impl.
+ * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust line
+ numbers.
+ * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Same.
+ * testsuite/30_threads/shared_future/cons/assign_neg.cc: Same.
+ * testsuite/30_threads/unique_future/cons/assign_neg.cc: Same.
+ * testsuite/30_threads/unique_future/cons/copy_neg.cc: Same.
+ * testsuite/30_threads/promise/cons/assign_neg.cc: Same.
+ * testsuite/30_threads/promise/cons/copy_neg.cc: Same.
+
+2009-10-31 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/std/chrono (struct __common_rep_type): New.
+ (duration_cast(const duration<>&),
+ duration<>::duration(const _Rep2&),
+ duration<>::duration(const duration<>&),
+ operator*(const duration<>&, const _Rep2&),
+ operator*(const _Rep1&, const duration<>&),
+ operator/(const duration<>&, const _Rep2&),
+ time_point_cast(const time_point<>&)): Implement resolution of
+ DR 1177 ([Ready] in Santa Cruz), change to not participate to
+ overload resolution if the constraints are not met.
+ * testsuite/20_util/duration/cons/1_neg.cc: Adjust dg-errors.
+ * testsuite/20_util/duration/cons/dr974.cc: Likewise.
+ * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust
+ dg-error line numbers.
+ * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise.
+ * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Likewise.
+
+2009-10-31 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * doc/xml/manual/intro.xml: Refer to our bugs page instead of
+ Bugzilla directly.
+
+2009-10-30 Jerry Quinn <jlquinn@optonline.net>
+
+ * libsupc++/tinfo.cc (operator=(const type_info&)): Reapply 153734.
+ * libsupc++/typeinfo (type_info::name()): Likewise.
+ * libsupc++/tinfo2.cc (before): Likewise.
+
+2009-10-30 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/bits/random.h: Fix typo in static_assert text.
+
+2009-10-30 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/41759
+ * include/bits/random.h: Tweak a bit the text of some static_asserts.
+
+2009-10-30 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/std/type_traits (__is_convertible_simple): Remove.
+ (__is_convertible_helper): Adjust.
+ * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust
+ dg-error line numbers.
+ * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
+ Likewise.
+
+2009-10-30 Jerry Quinn <jlquinn@optonline.net>
+
+ * libsupc++/tinfo.cc (operator=(const type_info&)): Revert 153734.
+ * libsupc++/typeinfo (type_info::name()): Likewise.
+ * libsupc++/tinfo2.cc (before): Likewise.
+
+2009-10-28 Jerry Quinn <jlquinn@optonline.net>
+
+ * libsupc++/tinfo.cc (operator=(const type_info&)): Compare by
+ pointer if name begins with '*'.
+ * libsupc++/typeinfo (type_info::name()): Likewise.
+ * libsupc++/tinfo2.cc (before): Likewise.
+
+2009-10-29 Paolo Carlini <paolo.carlini@oracle.com>
+ Douglas Gregor <doug.gregor@gmail.com>
+
+ PR libstdc++/40925 (again)
+ * include/bits/stl_pair.h (pair<_T1, _T2>::pair(_U1&&, const _T2&),
+ pair<_T1, _T2>::pair(const _T1&, _U2&&)): Add, to deal correctly
+ with move-only types in the presence of "null pointers".
+ * testsuite/20_util/pair/40925.cc: Extend.
+
+2009-10-29 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/std/type_traits (__is_int_or_cref): Remove.
+ (__is_convertible_helper): Fix per C++0x and simplify (the hack to
+ suppress warnings isn't necessary anymore).
+ * testsuite/20_util/is_convertible/requirements/typedefs.cc: New.
+ * testsuite/20_util/is_convertible/requirements/
+ explicit_instantiation.cc: Likewise.
+ * testsuite/20_util/is_convertible/value.cc: Likewise.
+ * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust
+ dg-error line numbers.
+ * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
+ Likewise.
+
+2009-10-29 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * testsuite/20_util/pair/40925.cc: Minor comment fix.
+
+2009-10-29 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/40925
+ * include/bits/stl_pair.h (pair<_T1, _T2>::pair(_U1&&, _U2&&)):
+ Use enable_if to remove it from the overload set when either _U1
+ is not convertible to _T1 or _U2 is not convertible to _T2.
+ (pair<>::pair(_U1&&, _Arg0&&, _Args&&...)): Remove.
+
+2009-10-29 Douglas Gregor <doug.gregor@gmail.com>
+
+ PR libstdc++/40925
+ * testsuite/20_util/pair/40925.cc: Add.
+
+2009-10-29 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/decimal/decimal: Minor formatting and uglification fixes.
+ * include/decimal/decimal.h: Likewise.
+
+2009-10-28 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/bits/stl_iterator_base_funcs.h: (next): Change
+ template parameter name consistently with the resolution
+ of DR 1011 ([Ready] in Santa Cruz).
+
+2009-10-28 Johannes Singler <singler@kit.edu>
+
+ PR libstdc++/40852
+ * include/parallel/multiseq_selection.h
+ (multiseq_partition, multiseq_selection): Avoid intermediate
+ values exceeding the integer type range for very large inputs.
+
+2009-10-26 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/std/chrono (duration<>::duration(const duration<>&)): Fix
+ per the straightforward resolution of DR 974.
+ * testsuite/20_util/duration/cons/dr974.cc: Add.
+
+2009-10-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR libstdc++/38923
+ * acinclude.m4 (GLIBCXX_CHECK_LINKER_FEATURES): Avoid using too many
+ *s. Accept ld version without text in ()s.
+ * configure: Regenerated.
+
+2009-10-26 Jason Merrill <jason@redhat.com>
+
+ Core issue 906
+ * include/std/future (~Future_result_base): Default outside class
+ body.
+ * include/std/system_error (error_category()): Likewise.
+ * libsupc++/nested_exception.h (nested_exception): Remove
+ exception specifications from defaulted methods.
+
+009-10-20 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/41773
+ Revert:
+ 2009-10-20 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/bits/basic_string.h (_S_construct(const _CharT*, size_type,
+ const _Alloc&)): New, declare.
+ (_S_construct(_CharT*, _CharT*, const _Alloc&),
+ _S_construct(const _CharT*, const _CharT*, const _Alloc&),
+ _S_construct(iterator, iterator, const _Alloc&),
+ _S_construct(const_iterator, const_iterator, const _Alloc&)): New,
+ forward to the latter.
+ * include/bits/basic_string.tcc (_S_construct(const _CharT*,
+ size_type, const _Alloc&)): Define.
+ (basic_string(const basic_string&, size_type, size_type),
+ basic_string(const basic_string&, size_type, size_type,
+ const _Alloc&), basic_string(const _CharT*, size_type,
+ const _Alloc&), basic_string(const _CharT*, const _Alloc&),
+ basic_string(initializer_list<>, const _Alloc&)): Call the latter.
+ * config/abi/pre/gnu.ver: Remove recently added exports.
+ * src/string-inst.cc: Remove instantiations.
+
+2009-10-20 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/41763
+ * include/bits/valarray_array.h (__valarray_default_construct,
+ __valarray_fill_construct, __valarray_copy_construct, __valarray_sum
+ __valarray_destroy_elements, __valarray_product): Do not qualify with
+ __restrict__ pointers accessing data also accessed by other pointers.
+
+2009-10-20 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/bits/basic_string.h (_S_construct(const _CharT*, size_type,
+ const _Alloc&)): New, declare.
+ (_S_construct(_CharT*, _CharT*, const _Alloc&),
+ _S_construct(const _CharT*, const _CharT*, const _Alloc&),
+ _S_construct(iterator, iterator, const _Alloc&),
+ _S_construct(const_iterator, const_iterator, const _Alloc&)): New,
+ forward to the latter.
+ * include/bits/basic_string.tcc (_S_construct(const _CharT*,
+ size_type, const _Alloc&)): Define.
+ (basic_string(const basic_string&, size_type, size_type),
+ basic_string(const basic_string&, size_type, size_type,
+ const _Alloc&), basic_string(const _CharT*, size_type,
+ const _Alloc&), basic_string(const _CharT*, const _Alloc&),
+ basic_string(initializer_list<>, const _Alloc&)): Call the latter.
+ * config/abi/pre/gnu.ver: Remove recently added exports.
+ * src/string-inst.cc: Remove instantiations.
+
+2009-10-15 Phil Muldoon <pmuldoon@redhat.com>
+
+ * python/libstdcxx/v6/printers.py (StdTuplePrinter): New printer.
+ (build_libstdcxx_dictionary): Add StdTuplePrinter registration.
+
+2009-10-16 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/c_compatibility/stdatomic.h: Include cstdatomic if
+ __cplusplus.
+
+2009-10-15 Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/40654
+ PR libstdc++/40826
+ * src/atomic.cc (atomic_flag_test_and_set_explicit): Add
+ static_cast from base to derived.
+ (atomic_flag_clear_explicit): Same.
+ * include/bits/atomic_2.h (__atomic2::atomic_flag): Public derivation.
+ Remove value type constructor.
+ * include/bits/atomic_0.h (__atomic0::atomic_flag): Same.
+ * include/std/future (_Future_state): Use ATOMIC_FLAG_INIT to
+ initialized the atomic_flag member.
+
+2009-10-14 Benjamin Kosnik <bkoz@redhat.com>
+
+ * doc/xml/authors.xml: Update.
+ * doc/xml/manual/intro.xml: Move test section...
+ * doc/xml/manual/appendix_porting.xml: ...here.
+ * doc/xml/manual/diagnostics.xml: Edit.
+ * doc/xml/manual/using.xml: Break out exception section.
+ * doc/xml/manual/using_exceptions.xml: New.
+ * doc/html: Regenerate.
+
+2009-10-14 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * config/abi/pre/gnu.ver: Export the _S_construct<> helpers.
+
+2009-10-14 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/bits/basic_string.h (operator+=(initializer_list<>),
+ append(initializer_list<>)): Forward to the append overload taking
+ a const CharT* pointer and a size, thus avoiding instantiating
+ unnecessarily in the built library the overload taking a pair of
+ iterators.
+ (operator=(initializer_list<>), assign(initializer_list<>)): Likewise
+ for assign.
+ (insert(iterator, initializer_list<>): Likewise for insert.
+
+2009-10-14 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/bits/c++config: Do not disable extern templates for string
+ in plain parallel-mode and in profile-mode; add comment explaining
+ _GLIBCXX_EXTERN_TEMPLATE == -1.
+ * testsuite/ext/profile/mutex_extensions.cc: Adjust dg-error line.
+
+2009-10-14 Jason Merrill <jason@redhat.com>
+
+ * testsuite/20_util/unique_ptr/assign/assign_neg.cc: Adjust expected.
+
+2009-10-13 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/parallel/for_each_selectors.h: Minor uglification and
+ stylistic fixes.
+
+2009-10-13 Edward Smith-Rowland <3dw4rd@verizon.net>
+
+ * include/precompiled/stdc++.h: Include <initializer_list>
+ for completeness.
+
+2009-10-12 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/bits/random.h (class linear_congruential_engine,
+ class mersenne_twister_engine, class subtract_with_carry_engine,
+ class discard_block_engine, class independent_bits_engine,
+ class shuffle_order_engine, class uniform_int_distribution,
+ class binomial_distribution, class geometric_distribution,
+ class negative_binomial_distribution, class poisson_distribution,
+ class discrete_distribution): Do not use simulated concept checks,
+ tidy startic_asserts on argument types and ranges.
+ (class uniform_real_distribution, class normal_distribution,
+ class lognormal_distribution, class gamma_distribution,
+ class chi_squared_distribution, class cauchy_distribution,
+ class fisher_f_distribution, class student_t_distribution,
+ class exponential_distribution, class weibull_distribution,
+ class extreme_value_distribution, class piecewise_linear_distribution,
+ class piecewise_constant_distribution): Add static_assert on
+ template argument type.
+ * include/std/random: Do not include <bits/concept_check.h>.
+ * testsuite/26_numerics/random/discard_block_engine/cons/base_move.cc:
+ Fix.
+ * testsuite/26_numerics/random/discard_block_engine/cons/seed1.cc:
+ Likewise.
+ * testsuite/26_numerics/random/discard_block_engine/cons/seed2.cc:
+ Likewise.
+ * testsuite/26_numerics/random/discard_block_engine/cons/base_copy.cc:
+ Likewise.
+ * testsuite/26_numerics/random/discard_block_engine/cons/default.cc:
+ Likewise.
+ * testsuite/26_numerics/random/discard_block_engine/cons/seed_seq.cc:
+ Likewise.
+ * testsuite/26_numerics/random/discard_block_engine/requirements/
+ typedefs.cc: Likewise.
+ * testsuite/26_numerics/random/discard_block_engine/operators/
+ equal.cc: Likewise.
+ * testsuite/26_numerics/random/discard_block_engine/operators/
+ serialize.cc: Likewise.
+ * testsuite/26_numerics/random/linear_congruential_engine/
+ requirements/non_uint_neg.cc: Tweak.
+
+2009-10-10 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * doc/xml/manual/messages.xml: Update GNU gettext reference.
+
+2009-10-10 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * doc/xml/manual/codecvt.xml: Refer to The Open Group Base
+ Specifications, Issue 6 (IEEE Std. 1003.1-2004).
+ Update link to bogus site with reference to unix.org.
+ * doc/xml/manual/ctype.xml: Ditto.
+ * doc/xml/manual/locale.xml: Ditto.
+
+2009-10-09 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/parallel/numeric (__adjacent_difference_switch): Fix typo.
+ * include/parallel/for_each_selectors.h
+ (__adjacent_difference_selector): Likewise.
+
+2009-10-08 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/ext/bitmap_allocator.h: Minor clean-ups.
+
+2009-10-08 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * config/abi/pre/gnu.ver: Adjust exports.
+
+2009-10-07 Phil Muldoon <pmuldoon@redhat.com>
+
+ * doc/xml/manual/debug.xml: Rewrite and expand GDB Python
+ pretty-printer section.
+
+2009-10-07 Chris Jefferson <chris@bubblescope.net>
+
+ * testsuite/25_algorithms/rotate/moveable2.cc: New.
+
+2009-10-06 Janis Johnson <janis187@us.ibm.com>
+
+ * testsuite/decimal/binary-arith.cc: Fix directive to skip test.
+ * testsuite/decimal/cast_neg.cc: Ditto.
+ * testsuite/decimal/comparison.cc: Ditto.
+ * testsuite/decimal/compound-assignment.cc: Ditto.
+ * testsuite/decimal/compound-assignment-memfunc.cc: Ditto.
+ * testsuite/decimal/conversion-from-float.cc: Ditto.
+ * testsuite/decimal/conversion-from-integral.cc: Ditto.
+ * testsuite/decimal/conversion-to-generic-float.cc: Ditto.
+ * testsuite/decimal/conversion-to-integral.cc: Ditto.
+ * testsuite/decimal/ctor.cc: Ditto.
+ * testsuite/decimal/incdec.cc: Ditto.
+ * testsuite/decimal/incdec-memfunc.cc: Ditto.
+ * testsuite/decimal/make-decimal.cc: Ditto.
+ * testsuite/decimal/mixed-mode_neg.cc: Ditto.
+ * testsuite/decimal/operator_neg.cc: Ditto.
+ * testsuite/decimal/unary-arith.cc: Ditto.
+
+2009-10-05 Benjamin Kosnik <bkoz@redhat.com>
+
+ * doc/html/*: Regenerate.
+
+2009-10-05 John Bytheway <jbytheway@gmail.com>
+
+ PR libstdc++/41530
+ * include/std/tuple (_Tuple_impl<>::_Tuple_impl(_Tuple_impl<>&&)):
+ Fix to just move.
+ * testsuite/20_util/tuple/cons/41530.cc: New.
+
+2009-10-05 Phil Muldoon <pmuldoon@redhat.com>
+
+ * doc/xml/manual/debug.xml: Add narrative for GDB Python pretty
+ printers. Add links to GDB wiki/online manual.
+
+2009-10-05 Benjamin Kosnik <bkoz@redhat.com>
+ Edward Smith-Rowland <3dw4rd@verizon.net>
+
+ * include/decimal/decimal: Warn if decimal floating point types
+ are not available.
+ * acinclude.m4 (GLIBCXX_ENABLE_DECIMAL_FLOAT): New.
+ * configure.ac: Use it.
+ * configure: Regenerate.
+ * config.h.in: Regenerate.
+
+2009-10-05 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/Makefile.am: Remove stray line break.
+
+ * include/decimal/decimal: Brief class doxygen markup.
+ * libsupc++/exception: Whitespace cleanup.
+
+ * testsuite/libstdc++-dg/conformance.exp: Add testsuite directory
+ decimal.
+ * scripts/create_testsuite_files (dlist): Same.
+
+ * doc/xml/manual/using.xml: One column in table. Move after TR1.
+
+ * testsuite/decimal/bad-cast.cc: Move to...
+ * testsuite/decimal/cast_neg.cc: ...here.
+ * testsuite/decimal/bad-mixed-mode.cc: Move to...
+ * testsuite/decimal/mixed-mode_neg.cc: ...here.
+ * testsuite/decimal/bad-operator.cc: Move to...
+ * testsuite/decimal/operator_neg.cc: ...here.
+
+ * doc/doxygen/user.cfg.in (INPUT): Add decimal/decimal.
+
+2009-10-05 Janis Johnson <janis187@us.ibm.com>
+
+ * doc/Makefile.am: Process new file.
+ * doc/xml/manual/intro.xml: Ditto.
+ * doc/xml/manual/using.xml: Document new header.
+ * doc/xml/manual/status_cxxdecimal.xml: New file.
+ * include/Makefile.am: Process new headers.
+ * include/decimal/decimal: New file.
+ * include/decimal/decimal.h: New file.
+
+2009-10-05 Janis Johnson <janis187@us.ibm.com>
+
+ * testsuite/decimal: New directory.
+ * testsuite/decimal/bad-cast.cc: New test.
+ * testsuite/decimal/bad-mixed-mode.cc: New test.
+ * testsuite/decimal/bad-operator.cc: New test.
+ * testsuite/decimal/binary-arith.cc: New test.
+ * testsuite/decimal/comparison.cc: New test.
+ * testsuite/decimal/compound-assignment.cc: New test.
+ * testsuite/decimal/compound-assignment-memfunc.cc: New test.
+ * testsuite/decimal/conversion-from-float.cc: New test.
+ * testsuite/decimal/conversion-from-integral.cc: New test.
+ * testsuite/decimal/conversion-to-generic-float.cc: New test.
+ * testsuite/decimal/conversion-to-integral.cc: New test.
+ * testsuite/decimal/ctor.cc: New test.
+ * testsuite/decimal/incdec.cc: New test.
+ * testsuite/decimal/incdec-memfunc.cc: New test.
+ * testsuite/decimal/make-decimal.cc: New test.
+ * testsuite/decimal/unary-arith.cc: New test.
+
+2009-10-05 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * testsuite/lib/libstdc++.exp (check_v3_target_rvalref): Remove.
+ * testsuite/lib/dg-options.exp (dg-require-rvalref): Likewise.
+
+2009-10-05 Chris Jefferson <chris@bubblescope.net>
+
+ * include/bits/stl_algo.h (__stable_partition_adaptive,
+ __rotate_adaptive, __merge_adaptive, __merge_sort_loop):
+ Extend to work with rvalue references in C++0x mode.
+ * testsuite/25_algorithms/inplace_merge/moveable2.cc: New.
+ * testsuite/25_algorithms/inplace_merge/moveable.cc: Likewise.
+ * testsuite/25_algorithms/stable_partition/moveable.cc: Likewise.
+ * testsuite/25_algorithms/stable_sort/moveable2.cc: Likewise.
+ * testsuite/25_algorithms/stable_sort/moveable.cc: Likewise.
+
+2009-10-04 Benjamin Kosnik <bkoz@redhat.com>
+
+ * doc/xml/manual/using.xml: Add profile headers.
+ * testsuite/ext/profile/mh.cc: Restrict to linux.
+
+2009-10-02 Silvius Rus <silvius.rus@gmail.com>
+
+ * configure: Add check for execinfo.h.
+ * config.h.in: Add undef for HAVE_EXECINFO_H.
+ * include/Makefile.am: Add build support for profile mode.
+ * include/Makefile.in: Same.
+ * include/profile/base.h: New file.
+ * include/profile/bitset: Same.
+ * include/profile/deque: Same.
+ * include/profile/hashtable.h: Same.
+ * include/profile/list: Same.
+ * include/profile/map: Same.
+ * include/profile/map.h: Same.
+ * include/profile/multimap.h: Same.
+ * include/profile/multiset.h: Same.
+ * include/profile/set: Same.
+ * include/profile/set.h: Same.
+ * include/profile/unordered_map: Same.
+ * include/profile/unordered_set: Same.
+ * include/profile/vector: Same.
+ * include/profile/impl/profiler.h: Same.
+ * include/profile/impl/profiler_container_size.h: Same.
+ * include/profile/impl/profiler_hash_func.h: Same.
+ * include/profile/impl/profiler_hashtable_size.h: Same.
+ * include/profile/impl/profiler_map_to_unordered_map.h: Same.
+ * include/profile/impl/profiler_node.h: Same.
+ * include/profile/impl/profiler_state.h: Same.
+ * include/profile/impl/profiler_trace.h: Same.
+ * include/profile/impl/profiler_vector_size.h: Same.
+ * include/profile/impl/profiler_vector_to_list.h: Same.
+ * include/std/vector: Include corresponding profile header guarded by
+ _GLIBCXX_PROFILE.
+ * include/std/deque: Same.
+ * include/std/list: Same.
+ * include/std/map: Same.
+ * include/std/unordered_map: Same.
+ * include/std/bitset: Same.
+ * include/std/set: Same.
+ * include/std/unordered_set: Same.
+ * include/backward/hash_map: Same.
+ * include/backward/hash_set: Same.
+ * include/tr1_impl/hashtable (_Hashtable): Expose insert_return_type.
+ * include/bits/c++config: Define profile namespace.
+ * testsuite/Makefile.in: Add check-profile.
+ * testsuite/Makefile.am: Same.
+ * testsuite/ext/profile/all.cc: New file.
+ * testsuite/ext/profile/mh.cc: Same.
+ * testsuite/ext/profile/mutex_extensions.cc: Same.
+ * testsuite/23_containers/unordered_map/profile/hash_map.cc: Same.
+ * testsuite/23_containers/unordered_map/profile/unordered.cc: Same.
+ * testsuite/23_containers/vector/profile/vector.cc: Same.
+ * testsuite/23_containers/vector/resize/moveable.cc: Make it pass
+ in profile mode.
+ * testsuite/23_containers/deque/capacity/moveable.cc: Same.
+ * testsuite/23_containers/list/capacity/29134.cc: Same.
+ * doc/Makefile.in: Add reference to profile_mode.xml.
+ * doc/Makefile.am: Same.
+ * doc/xml/manual/profile_mode.xml: New file.
+ * doc/xml/manual/debug.xml: Add link to profile mode section.
+ * doc/xml/manual/extensions.xml: Add profile mode. Update numbering.
+ * doc/doxygen/user.cfg.in: Add profile mode files.
+
2009-10-02 Johannes Singler <singler@ira.uka.de>
- * include/parallel/base.h: Take integer types from <tr1/cstdint>.
- * include/parallel/compatibility.h: Likewise.
- * include/parallel/multiseq_selection.h: Likewise.
- * include/parallel/random_shuffle.h: Likewise.
- * include/parallel/random_number.h: Likewise;
- use numeric_limits<>::digit instead of sizeof()*8.
- * include/parallel/types.h: Likewise.
- * doc/html/manual/bk01pt12ch31s03.html:
- Document dependency on stdint.h.
+ * include/parallel/base.h: Take integer types from <tr1/cstdint>.
+ * include/parallel/compatibility.h: Likewise.
+ * include/parallel/multiseq_selection.h: Likewise.
+ * include/parallel/random_shuffle.h: Likewise.
+ * include/parallel/random_number.h: Likewise;
+ use numeric_limits<>::digit instead of sizeof()*8.
+ * include/parallel/types.h: Likewise.
+ * doc/html/manual/bk01pt12ch31s03.html:
+ Document dependency on stdint.h.
2009-10-01 Phil Muldoon <pmuldoon@redhat.com>
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index ef5a01a709d..bf34443d5aa 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -210,7 +210,7 @@ AC_DEFUN([GLIBCXX_CHECK_LINKER_FEATURES], [
glibcxx_ld_is_gold=yes
fi
ldver=`$LD --version 2>/dev/null |
- sed -e 's/GNU g*o*ld v*e*r*s*i*o*n* *\(([^)]*)* *\) \([0-9.][0-9.]*\).*/\2/; q'`
+ sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'`
changequote([,])
glibcxx_gnu_ld_version=`echo $ldver | \
$AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'`
@@ -2223,6 +2223,44 @@ AC_DEFUN([GLIBCXX_ENABLE_LONG_LONG], [
dnl
+dnl Check for decimal floating point.
+dnl See:
+dnl http://gcc.gnu.org/onlinedocs/gcc/Decimal-Float.html#Decimal-Float
+dnl
+dnl This checks to see if the host supports decimal floating point types.
+dnl
+dnl Defines:
+dnl _GLIBCXX_USE_DECIMAL_FLOAT
+dnl
+AC_DEFUN([GLIBCXX_ENABLE_DECIMAL_FLOAT], [
+
+ # Fake what AC_TRY_COMPILE does, without linking as this is
+ # unnecessary for this test.
+
+ cat > conftest.$ac_ext << EOF
+[#]line __oline__ "configure"
+int main()
+{
+ _Decimal32 d1;
+ _Decimal64 d2;
+ _Decimal128 d3;
+ return 0;
+}
+EOF
+
+ AC_MSG_CHECKING([for ISO/IEC TR 24733 ])
+ if AC_TRY_EVAL(ac_compile); then
+ AC_DEFINE(_GLIBCXX_USE_DECIMAL_FLOAT, 1,
+ [Define if ISO/IEC TR 24733 decimal floating point types are supported on this host.])
+ enable_dfp=yes
+ else
+ enable_dfp=no
+ fi
+ AC_MSG_RESULT($enable_dfp)
+ rm -f conftest*
+])
+
+dnl
dnl Check for template specializations for the 'wchar_t' type.
dnl
dnl --enable-wchar_t defines _GLIBCXX_USE_WCHAR_T
diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in
index 506b00e31b2..0f30168abbc 100644
--- a/libstdc++-v3/config.h.in
+++ b/libstdc++-v3/config.h.in
@@ -772,6 +772,10 @@
/* Defined if clock_gettime has realtime clock support. */
#undef _GLIBCXX_USE_CLOCK_REALTIME
+/* Define if ISO/IEC TR 24733 decimal floating point types are supported on
+ this host. */
+#undef _GLIBCXX_USE_DECIMAL_FLOAT
+
/* Defined if gettimeofday is available. */
#undef _GLIBCXX_USE_GETTIMEOFDAY
diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
index a175be857ea..2337a5a3fbf 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -79,11 +79,14 @@ GLIBCXX_3.4 {
std::gslice*;
std::h[^a]*;
std::i[a-n]*;
- std::ios_base::[A-Ha-z]*;
+# std::ios_base::[A-Ha-z]*;
+ std::ios_base::[A-Ha-f]*;
+ std::ios_base::goodbit;
+ std::ios_base::[h-z]*;
std::ios_base::_M_grow_words*;
std::ios_base::_M_init*;
std::ios_base::Init::[A-Za-z]*;
- std::ios_base::[J-Za-z]*;
+# std::ios_base::[J-Za-z]*;
std::i[p-r]*;
# std::istream
# std::istreambuf_iterator
@@ -121,7 +124,7 @@ GLIBCXX_3.4 {
std::ostrstream*;
std::out_of_range*;
std::overflow_error*;
- std::[p-q]*;
+# std::[p-q]*;
std::r[^e]*;
std::re[^t]*;
# std::rethrow_exception
@@ -167,7 +170,12 @@ GLIBCXX_3.4 {
_ZNSsC[12][EI][PRjmvN]*;
_ZNSsD*;
_ZNSs[0-58-9][a-z]*;
- _ZNSs[67][a-z]*E[PRcjmv]*;
+# _ZNSs[67][a-z]*E[PRcjmv]*;
+ _ZNSs6appendE[PRcjmv]*;
+ _ZNSs6assignE[PRcjmv]*;
+ _ZNSs6insertE[PRcjmv]*;
+ _ZNSs6insertEN9__gnu_cxx17__normal_iteratorIPcSsEE[PRcjmv]*;
+ _ZNSs[67][j-z]*E[PRcjmv]*;
_ZNSs7[a-z]*EES2_[NPRjm]*;
_ZNSs7[a-z]*EES2_S[12]*;
_ZNSs12_Alloc_hiderC*;
@@ -217,8 +225,12 @@ GLIBCXX_3.4 {
_ZNSbIwSt11char_traitsIwESaIwEEC[12][EI][PRjmvN]*;
_ZNSbIwSt11char_traitsIwESaIwEED*;
_ZNSbIwSt11char_traitsIwESaIwEE[0-58-9][a-z]*;
- _ZNSbIwSt11char_traitsIwESaIwEE[67][a-b]*E[PRwjmv]*;
- _ZNSbIwSt11char_traitsIwESaIwEE[67][d-z]*E[PRwjmv]*;
+# _ZNSbIwSt11char_traitsIwESaIwEE[67][a-b]*E[PRwjmv]*;
+ _ZNSbIwSt11char_traitsIwESaIwEE6appendE[PRwjmv]*;
+ _ZNSbIwSt11char_traitsIwESaIwEE6assignE[PRwjmv]*;
+ _ZNSbIwSt11char_traitsIwESaIwEE6insertE[PRwjmv]*;
+ _ZNSbIwSt11char_traitsIwESaIwEE6insertEN9__gnu_cxx17__normal_iteratorIPwS2_EE[PRwjmv]*;
+ _ZNSbIwSt11char_traitsIwESaIwEE[67][j-z]*E[PRwjmv]*;
_ZNSbIwSt11char_traitsIwESaIwEE7[a-z]*EES6_[NPRjm]*;
_ZNSbIwSt11char_traitsIwESaIwEE7[a-z]*EES6_S[56]*;
_ZNSbIwSt11char_traitsIwESaIwEE12_Alloc_hiderC*;
@@ -284,7 +296,6 @@ GLIBCXX_3.4 {
_ZNSt15basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EE[0-9]_M_[a-z]*;
_ZNSt15basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EE[0-9][0-9]_M_[a-z]*;
-
# std::basic_iostream constructors, destructors
_ZNSdC*;
_ZNSdD*;
@@ -1028,6 +1039,10 @@ GLIBCXX_3.4.14 {
_ZNKSbIwSt11char_traitsIwESaIwEE7crbeginEv;
_ZNKSbIwSt11char_traitsIwESaIwEE5crendEv;
+ # string|wstring ::_S_construct<> helpers
+ _ZNSs12_S_constructI*;
+ _ZNSbIwSt11char_traitsIwESaIwEE12_S_constructI*;
+
} GLIBCXX_3.4.13;
# Symbols in the support library (libsupc++) have their own tag.
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 0ba287cec5a..cb74f9a0a37 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -15358,6 +15358,40 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu
+
+ # Fake what AC_TRY_COMPILE does, without linking as this is
+ # unnecessary for this test.
+
+ cat > conftest.$ac_ext << EOF
+#line 15366 "configure"
+int main()
+{
+ _Decimal32 d1;
+ _Decimal64 d2;
+ _Decimal128 d3;
+ return 0;
+}
+EOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ISO/IEC TR 24733 " >&5
+$as_echo_n "checking for ISO/IEC TR 24733 ... " >&6; }
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+
+$as_echo "#define _GLIBCXX_USE_DECIMAL_FLOAT 1" >>confdefs.h
+
+ enable_dfp=yes
+ else
+ enable_dfp=no
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_dfp" >&5
+$as_echo "$enable_dfp" >&6; }
+ rm -f conftest*
+
+
# Checks for compiler support that doesn't require linking.
# All these tests are for C++; save the language and the compiler flags.
@@ -19508,7 +19542,7 @@ $as_echo_n "checking for ld version... " >&6; }
glibcxx_ld_is_gold=yes
fi
ldver=`$LD --version 2>/dev/null |
- sed -e 's/GNU g*o*ld v*e*r*s*i*o*n* *\(([^)]*)* *\) \([0-9.][0-9.]*\).*/\2/; q'`
+ sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'`
glibcxx_gnu_ld_version=`echo $ldver | \
$AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
@@ -26410,7 +26444,7 @@ $as_echo_n "checking for ld version... " >&6; }
glibcxx_ld_is_gold=yes
fi
ldver=`$LD --version 2>/dev/null |
- sed -e 's/GNU g*o*ld v*e*r*s*i*o*n* *\(([^)]*)* *\) \([0-9.][0-9.]*\).*/\2/; q'`
+ sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'`
glibcxx_gnu_ld_version=`echo $ldver | \
$AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
@@ -32225,7 +32259,7 @@ $as_echo_n "checking for ld version... " >&6; }
glibcxx_ld_is_gold=yes
fi
ldver=`$LD --version 2>/dev/null |
- sed -e 's/GNU g*o*ld v*e*r*s*i*o*n* *\(([^)]*)* *\) \([0-9.][0-9.]*\).*/\2/; q'`
+ sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'`
glibcxx_gnu_ld_version=`echo $ldver | \
$AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
@@ -43870,7 +43904,7 @@ $as_echo_n "checking for ld version... " >&6; }
glibcxx_ld_is_gold=yes
fi
ldver=`$LD --version 2>/dev/null |
- sed -e 's/GNU g*o*ld v*e*r*s*i*o*n* *\(([^)]*)* *\) \([0-9.][0-9.]*\).*/\2/; q'`
+ sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'`
glibcxx_gnu_ld_version=`echo $ldver | \
$AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
@@ -44084,7 +44118,7 @@ $as_echo_n "checking for ld version... " >&6; }
glibcxx_ld_is_gold=yes
fi
ldver=`$LD --version 2>/dev/null |
- sed -e 's/GNU g*o*ld v*e*r*s*i*o*n* *\(([^)]*)* *\) \([0-9.][0-9.]*\).*/\2/; q'`
+ sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'`
glibcxx_gnu_ld_version=`echo $ldver | \
$AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
@@ -44559,7 +44593,7 @@ $as_echo_n "checking for ld version... " >&6; }
glibcxx_ld_is_gold=yes
fi
ldver=`$LD --version 2>/dev/null |
- sed -e 's/GNU g*o*ld v*e*r*s*i*o*n* *\(([^)]*)* *\) \([0-9.][0-9.]*\).*/\2/; q'`
+ sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'`
glibcxx_gnu_ld_version=`echo $ldver | \
$AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
@@ -50728,7 +50762,7 @@ $as_echo_n "checking for ld version... " >&6; }
glibcxx_ld_is_gold=yes
fi
ldver=`$LD --version 2>/dev/null |
- sed -e 's/GNU g*o*ld v*e*r*s*i*o*n* *\(([^)]*)* *\) \([0-9.][0-9.]*\).*/\2/; q'`
+ sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'`
glibcxx_gnu_ld_version=`echo $ldver | \
$AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
@@ -56528,7 +56562,7 @@ $as_echo_n "checking for ld version... " >&6; }
glibcxx_ld_is_gold=yes
fi
ldver=`$LD --version 2>/dev/null |
- sed -e 's/GNU g*o*ld v*e*r*s*i*o*n* *\(([^)]*)* *\) \([0-9.][0-9.]*\).*/\2/; q'`
+ sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'`
glibcxx_gnu_ld_version=`echo $ldver | \
$AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
@@ -56695,7 +56729,7 @@ $as_echo_n "checking for ld version... " >&6; }
glibcxx_ld_is_gold=yes
fi
ldver=`$LD --version 2>/dev/null |
- sed -e 's/GNU g*o*ld v*e*r*s*i*o*n* *\(([^)]*)* *\) \([0-9.][0-9.]*\).*/\2/; q'`
+ sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'`
glibcxx_gnu_ld_version=`echo $ldver | \
$AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
@@ -56844,7 +56878,7 @@ $as_echo_n "checking for ld version... " >&6; }
glibcxx_ld_is_gold=yes
fi
ldver=`$LD --version 2>/dev/null |
- sed -e 's/GNU g*o*ld v*e*r*s*i*o*n* *\(([^)]*)* *\) \([0-9.][0-9.]*\).*/\2/; q'`
+ sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'`
glibcxx_gnu_ld_version=`echo $ldver | \
$AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
@@ -57011,7 +57045,7 @@ $as_echo_n "checking for ld version... " >&6; }
glibcxx_ld_is_gold=yes
fi
ldver=`$LD --version 2>/dev/null |
- sed -e 's/GNU g*o*ld v*e*r*s*i*o*n* *\(([^)]*)* *\) \([0-9.][0-9.]*\).*/\2/; q'`
+ sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'`
glibcxx_gnu_ld_version=`echo $ldver | \
$AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
@@ -57183,7 +57217,7 @@ $as_echo_n "checking for ld version... " >&6; }
glibcxx_ld_is_gold=yes
fi
ldver=`$LD --version 2>/dev/null |
- sed -e 's/GNU g*o*ld v*e*r*s*i*o*n* *\(([^)]*)* *\) \([0-9.][0-9.]*\).*/\2/; q'`
+ sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'`
glibcxx_gnu_ld_version=`echo $ldver | \
$AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
index e35bc0a9d51..1fd8119b51d 100644
--- a/libstdc++-v3/configure.ac
+++ b/libstdc++-v3/configure.ac
@@ -128,6 +128,7 @@ GLIBCXX_ENABLE_SJLJ_EXCEPTIONS
GLIBCXX_ENABLE_PCH($is_hosted)
GLIBCXX_ENABLE_THREADS
GLIBCXX_ENABLE_ATOMIC_BUILTINS
+GLIBCXX_ENABLE_DECIMAL_FLOAT
# Checks for compiler support that doesn't require linking.
GLIBCXX_CHECK_COMPILER_FEATURES
diff --git a/libstdc++-v3/doc/Makefile.am b/libstdc++-v3/doc/Makefile.am
index 21a770512b8..5619fab6a22 100644
--- a/libstdc++-v3/doc/Makefile.am
+++ b/libstdc++-v3/doc/Makefile.am
@@ -101,12 +101,14 @@ xml_sources = \
${xml_srcdir}/manual/parallel_mode.xml \
${xml_srcdir}/manual/profile_mode.xml \
${xml_srcdir}/manual/prerequisites.xml \
+ ${xml_srcdir}/manual/profile_mode.xml \
${xml_srcdir}/manual/internals.xml \
${xml_srcdir}/manual/shared_ptr.xml \
${xml_srcdir}/manual/spine.xml \
${xml_srcdir}/manual/status_cxx1998.xml \
${xml_srcdir}/manual/status_cxx200x.xml \
${xml_srcdir}/manual/status_cxxtr1.xml \
+ ${xml_srcdir}/manual/status_cxxtr24733.xml \
${xml_srcdir}/manual/strings.xml \
${xml_srcdir}/manual/support.xml \
${xml_srcdir}/manual/test.xml \
diff --git a/libstdc++-v3/doc/Makefile.in b/libstdc++-v3/doc/Makefile.in
index 7da915d78e9..40b92b6a4ee 100644
--- a/libstdc++-v3/doc/Makefile.in
+++ b/libstdc++-v3/doc/Makefile.in
@@ -313,12 +313,14 @@ xml_sources = \
${xml_srcdir}/manual/parallel_mode.xml \
${xml_srcdir}/manual/profile_mode.xml \
${xml_srcdir}/manual/prerequisites.xml \
+ ${xml_srcdir}/manual/profile_mode.xml \
${xml_srcdir}/manual/internals.xml \
${xml_srcdir}/manual/shared_ptr.xml \
${xml_srcdir}/manual/spine.xml \
${xml_srcdir}/manual/status_cxx1998.xml \
${xml_srcdir}/manual/status_cxx200x.xml \
${xml_srcdir}/manual/status_cxxtr1.xml \
+ ${xml_srcdir}/manual/status_cxxtr24733.xml \
${xml_srcdir}/manual/strings.xml \
${xml_srcdir}/manual/support.xml \
${xml_srcdir}/manual/test.xml \
diff --git a/libstdc++-v3/doc/doxygen/doxygroups.cc b/libstdc++-v3/doc/doxygen/doxygroups.cc
index d11fb3bd2d1..e7c664a92fb 100644
--- a/libstdc++-v3/doc/doxygen/doxygroups.cc
+++ b/libstdc++-v3/doc/doxygen/doxygroups.cc
@@ -149,10 +149,3 @@ summarized in <a href="tables.html">tables</a>. */
* Components for concurrent operations, including threads, mutexes,
* and condition variables.
*/
-
-/**
- * @defgroup pointer_abstractions Pointer Abstractions
- * @ingroup memory
- *
- * Components for memory allocation, deallocation, and management.
- */
diff --git a/libstdc++-v3/doc/doxygen/user.cfg.in b/libstdc++-v3/doc/doxygen/user.cfg.in
index 9ffcf1ef75c..b6b9b38ea97 100644
--- a/libstdc++-v3/doc/doxygen/user.cfg.in
+++ b/libstdc++-v3/doc/doxygen/user.cfg.in
@@ -669,17 +669,6 @@ INPUT = @srcdir@/doc/doxygen/doxygroups.cc \
include/profile/unordered_map \
include/profile/unordered_set \
include/profile/vector \
- include/profile/base.h \
- include/profile/impl/profiler.h \
- include/profile/impl/profiler_container_size.h \
- include/profile/impl/profiler_hash_func.h \
- include/profile/impl/profiler_hashtable_size.h \
- include/profile/impl/profiler_map_to_unordered_map.h \
- include/profile/impl/profiler_node.h \
- include/profile/impl/profiler_state.h \
- include/profile/impl/profiler_trace.h \
- include/profile/impl/profiler_vector_size.h \
- include/profile/impl/profiler_vector_to_list.h \
include/ext/algorithm \
include/ext/functional \
include/ext/iterator \
@@ -720,21 +709,21 @@ INPUT = @srcdir@/doc/doxygen/doxygroups.cc \
include/tr1_impl/cwctype \
include/tr1_impl/functional \
include/tr1_impl/hashtable \
- include/tr1_impl/random \
include/tr1_impl/regex \
include/tr1_impl/type_traits \
include/tr1_impl/unordered_map \
include/tr1_impl/unordered_set \
include/tr1_impl/utility \
include/tr1_impl \
+ include/decimal/decimal \
include/ \
include/@host_alias@/bits \
include/backward \
include/bits \
- include/bits/shared_ptr.h \
include/debug \
include/parallel \
include/profile \
+ include/profile/impl \
include/ext \
include/ext/pb_ds \
include/ext/pb_ds/detail
diff --git a/libstdc++-v3/doc/html/api.html b/libstdc++-v3/doc/html/api.html
index cb2d72d61e6..fd511df55dd 100644
--- a/libstdc++-v3/doc/html/api.html
+++ b/libstdc++-v3/doc/html/api.html
@@ -5,7 +5,7 @@
<a class="ulink" href="http://www.fsf.org/" target="_top">FSF
</a>
- </p></div><div><div class="legalnotice"><a id="id391427"></a><p>
+ </p></div><div><div class="legalnotice"><a id="id596116"></a><p>
<a class="link" href="manual/license.html" title="License">License
</a>
</p></div></div></div><hr /></div><p>
diff --git a/libstdc++-v3/doc/html/index.html b/libstdc++-v3/doc/html/index.html
index 96ff103fb04..b3b2ee69d6c 100644
--- a/libstdc++-v3/doc/html/index.html
+++ b/libstdc++-v3/doc/html/index.html
@@ -12,7 +12,7 @@
<div>
<h1>The GNU C++ Library Documentation</h1>
-<p>Copyright 2008 FSF</p>
+<p>Copyright 2008, 2009 FSF</p>
<p>
Permission is granted to copy, distribute and/or modify this
diff --git a/libstdc++-v3/doc/html/manual/abi.html b/libstdc++-v3/doc/html/manual/abi.html
index b0d2c7c905d..7d11f768464 100644
--- a/libstdc++-v3/doc/html/manual/abi.html
+++ b/libstdc++-v3/doc/html/manual/abi.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ABI Policy and Guidelines</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; ABI&#10; , &#10; version&#10; , &#10; dynamic&#10; , &#10; shared&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="internals.html" title="Porting to New Hardware or Operating Systems" /><link rel="next" href="api.html" title="API Evolution and Deprecation History" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ABI Policy and Guidelines</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="internals.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ABI Policy and Guidelines</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; ABI&#10; , &#10; version&#10; , &#10; dynamic&#10; , &#10; shared&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="test.html" title="Test" /><link rel="next" href="api.html" title="API Evolution and Deprecation History" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ABI Policy and Guidelines</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="test.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
Porting and Maintenance
</th><td width="20%" align="right"> <a accesskey="n" href="api.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="appendix.porting.abi"></a>ABI Policy and Guidelines</h2></div></div></div><p>
@@ -464,60 +464,60 @@ gcc test.c -g -O2 -L. -lone -ltwo /usr/lib/libstdc++.so.5 /usr/lib/libstdc++.so.
<a class="ulink" href="http://gcc.gnu.org/PR24660" target="_top">24660: versioning weak symbols in libstdc++</a>
</p><p>
<a class="ulink" href="http://gcc.gnu.org/PR19664" target="_top">19664: libstdc++ headers should have pop/push of the visibility around the declarations</a>
-</p></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="abi.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id548079"></a><p><span class="title"><i>
+</p></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="abi.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id658186"></a><p><span class="title"><i>
ABIcheck, a vague idea of checking ABI compatibility
</i>. </span><span class="biblioid">
<a class="ulink" href="http://abicheck.sourceforge.net/" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id548097"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id658203"></a><p><span class="title"><i>
C++ ABI Reference
</i>. </span><span class="biblioid">
<a class="ulink" href="http://www.codesourcery.com/public/cxx-abi/" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id548114"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id658220"></a><p><span class="title"><i>
Intel® Compilers for Linux* -Compatibility with the GNU Compilers
</i>. </span><span class="biblioid">
<a class="ulink" href="http://www.intel.com/cd/software/products/asmo-na/eng/284736.htm" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id548131"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id658238"></a><p><span class="title"><i>
Sun Solaris 2.9 : Linker and Libraries Guide (document 816-1386)
</i>. </span><span class="biblioid">
<a class="ulink" href="http://docs.sun.com/app/docs/doc/817-1984" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id548148"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id658254"></a><p><span class="title"><i>
Sun Solaris 2.9 : C++ Migration Guide (document 816-2459)
</i>. </span><span class="biblioid">
<a class="ulink" href="http://docs.sun.com/app/docs/doc/819-5266" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id526655"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id658272"></a><p><span class="title"><i>
How to Write Shared Libraries
</i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="biblioid">
<a class="ulink" href="http://people.redhat.com/drepper/dsohowto.pdf" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id526683"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id675905"></a><p><span class="title"><i>
C++ ABI for the ARM Architecture
</i>. </span><span class="biblioid">
<a class="ulink" href="http://www.arm.com/miscPDFs/8033.pdf" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id526700"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id675922"></a><p><span class="title"><i>
Dynamic Shared Objects: Survey and Issues
</i>. </span><span class="subtitle">
ISO C++ J16/06-0046
. </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span><span class="biblioid">
<a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1976.html" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id526733"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id675954"></a><p><span class="title"><i>
Versioning With Namespaces
</i>. </span><span class="subtitle">
ISO C++ J16/06-0083
. </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span><span class="biblioid">
<a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2013.html" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id526765"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id675987"></a><p><span class="title"><i>
Binary Compatibility of Shared Libraries Implemented in C++ on GNU/Linux Systems
</i>. </span><span class="subtitle">
SYRCoSE 2009
. </span><span class="author"><span class="firstname">Pavel</span> <span class="surname">Shved</span>. </span><span class="author"><span class="firstname">Denis</span> <span class="surname">Silakov</span>. </span><span class="biblioid">
<a class="ulink" href="http://syrcose.ispras.ru/2009/files/SYRCoSE2009-CfP.pdf" target="_top">
</a>
- . </span></p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="internals.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="appendix_porting.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="api.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Porting to New Hardware or Operating Systems </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> API Evolution and Deprecation History</td></tr></table></div></body></html>
+ . </span></p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="test.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="appendix_porting.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="api.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Test </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> API Evolution and Deprecation History</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/algorithms.html b/libstdc++-v3/doc/html/manual/algorithms.html
index 92e33d33d7b..aaaa42c27ef 100644
--- a/libstdc++-v3/doc/html/manual/algorithms.html
+++ b/libstdc++-v3/doc/html/manual/algorithms.html
@@ -5,5 +5,5 @@
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt08ch19s02.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt09pr02.html">Next</a></td></tr></table><hr /></div><div class="part" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="manual.algorithms"></a>Part IX. 
Algorithms
- <a id="id445064" class="indexterm"></a>
+ <a id="id721514" class="indexterm"></a>
</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="preface"><a href="bk01pt09pr02.html"></a></span></dt><dt><span class="chapter"><a href="bk01pt09ch20.html">20. Mutating</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt09ch20.html#algorithms.mutating.swap">swap</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt09ch20.html#algorithms.swap.specializations">Specializations</a></span></dt></dl></dd></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt08ch19s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt09pr02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">One Past the End </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/api.html b/libstdc++-v3/doc/html/manual/api.html
index 6af29925e46..f0f0e271f1a 100644
--- a/libstdc++-v3/doc/html/manual/api.html
+++ b/libstdc++-v3/doc/html/manual/api.html
@@ -75,11 +75,11 @@ _Alloc_traits</code> have been removed.
<span class="type">__alloc</span> to select an underlying allocator that
satisfied memory allocation requests. The selection of this
underlying allocator was not user-configurable.
- </p><div class="table"><a id="id539341"></a><p class="title"><b>Table B.1. Extension Allocators</b></p><div class="table-contents"><table summary="Extension Allocators" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Allocator (3.4)</th><th align="left">Header (3.4)</th><th align="left">Allocator (3.[0-3])</th><th align="left">Header (3.[0-3])</th></tr></thead><tbody><tr><td align="left"><code class="classname">__gnu_cxx::new_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/new_allocator.h</code></td><td align="left"><code class="classname">std::__new_alloc</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::malloc_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/malloc_allocator.h</code></td><td align="left"><code class="classname">std::__malloc_alloc_template&lt;int&gt;</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::debug_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/debug_allocator.h</code></td><td align="left"><code class="classname">std::debug_alloc&lt;T&gt;</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::__pool_alloc&lt;T&gt;</code></td><td align="left"><code class="filename">ext/pool_allocator.h</code></td><td align="left"><code class="classname">std::__default_alloc_template&lt;bool,int&gt;</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::__mt_alloc&lt;T&gt;</code></td><td align="left"><code class="filename">ext/mt_allocator.h</code></td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left"><code class="classname">__gnu_cxx::bitmap_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/bitmap_allocator.h</code></td><td align="left"> </td><td align="left"> </td></tr></tbody></table></div></div><br class="table-break" /><p> Releases after gcc-3.4 have continued to add to the collection
+ </p><div class="table"><a id="id623096"></a><p class="title"><b>Table B.1. Extension Allocators</b></p><div class="table-contents"><table summary="Extension Allocators" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Allocator (3.4)</th><th align="left">Header (3.4)</th><th align="left">Allocator (3.[0-3])</th><th align="left">Header (3.[0-3])</th></tr></thead><tbody><tr><td align="left"><code class="classname">__gnu_cxx::new_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/new_allocator.h</code></td><td align="left"><code class="classname">std::__new_alloc</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::malloc_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/malloc_allocator.h</code></td><td align="left"><code class="classname">std::__malloc_alloc_template&lt;int&gt;</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::debug_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/debug_allocator.h</code></td><td align="left"><code class="classname">std::debug_alloc&lt;T&gt;</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::__pool_alloc&lt;T&gt;</code></td><td align="left"><code class="filename">ext/pool_allocator.h</code></td><td align="left"><code class="classname">std::__default_alloc_template&lt;bool,int&gt;</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::__mt_alloc&lt;T&gt;</code></td><td align="left"><code class="filename">ext/mt_allocator.h</code></td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left"><code class="classname">__gnu_cxx::bitmap_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/bitmap_allocator.h</code></td><td align="left"> </td><td align="left"> </td></tr></tbody></table></div></div><br class="table-break" /><p> Releases after gcc-3.4 have continued to add to the collection
of available allocators. All of these new allocators are
standard-style. The following table includes details, along with
the first released version of GCC that included the extension allocator.
- </p><div class="table"><a id="id545205"></a><p class="title"><b>Table B.2. Extension Allocators Continued</b></p><div class="table-contents"><table summary="Extension Allocators Continued" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Allocator</th><th align="left">Include</th><th align="left">Version</th></tr></thead><tbody><tr><td align="left"><code class="classname">__gnu_cxx::array_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/array_allocator.h</code></td><td align="left">4.0.0</td></tr><tr><td align="left"><code class="classname">__gnu_cxx::throw_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/throw_allocator.h</code></td><td align="left">4.2.0</td></tr></tbody></table></div></div><br class="table-break" /><p>
+ </p><div class="table"><a id="id721371"></a><p class="title"><b>Table B.2. Extension Allocators Continued</b></p><div class="table-contents"><table summary="Extension Allocators Continued" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Allocator</th><th align="left">Include</th><th align="left">Version</th></tr></thead><tbody><tr><td align="left"><code class="classname">__gnu_cxx::array_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/array_allocator.h</code></td><td align="left">4.0.0</td></tr><tr><td align="left"><code class="classname">__gnu_cxx::throw_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/throw_allocator.h</code></td><td align="left">4.2.0</td></tr></tbody></table></div></div><br class="table-break" /><p>
Debug mode first appears.
</p><p>
Precompiled header support <acronym class="acronym">PCH</acronym> support.
diff --git a/libstdc++-v3/doc/html/manual/appendix_contributing.html b/libstdc++-v3/doc/html/manual/appendix_contributing.html
index 5fea7a933b8..b54faf1b14d 100644
--- a/libstdc++-v3/doc/html/manual/appendix_contributing.html
+++ b/libstdc++-v3/doc/html/manual/appendix_contributing.html
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Appendix A.  Contributing</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="bk01pt12ch40s03.html" title="Use" /><link rel="next" href="source_organization.html" title="Directory Layout and Source Conventions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix A. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Appendix A.  Contributing</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="bk01pt12ch41s03.html" title="Use" /><link rel="next" href="source_organization.html" title="Directory Layout and Source Conventions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix A. 
Contributing
-</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch40s03.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="source_organization.html">Next</a></td></tr></table><hr /></div><div class="appendix" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="appendix.contrib"></a>Appendix A. 
+</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch41s03.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="source_organization.html">Next</a></td></tr></table><hr /></div><div class="appendix" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="appendix.contrib"></a>Appendix A. 
Contributing
- <a id="id419637" class="indexterm"></a>
+ <a id="id622754" class="indexterm"></a>
</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="appendix_contributing.html#contrib.list">Contributor Checklist</a></span></dt><dd><dl><dt><span class="sect2"><a href="appendix_contributing.html#list.reading">Reading</a></span></dt><dt><span class="sect2"><a href="appendix_contributing.html#list.copyright">Assignment</a></span></dt><dt><span class="sect2"><a href="appendix_contributing.html#list.getting">Getting Sources</a></span></dt><dt><span class="sect2"><a href="appendix_contributing.html#list.patches">Submitting Patches</a></span></dt></dl></dd><dt><span class="sect1"><a href="source_organization.html">Directory Layout and Source Conventions</a></span></dt><dt><span class="sect1"><a href="source_code_style.html">Coding Style</a></span></dt><dd><dl><dt><span class="sect2"><a href="source_code_style.html#coding_style.bad_identifiers">Bad Identifiers</a></span></dt><dt><span class="sect2"><a href="source_code_style.html#coding_style.example">By Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="documentation_style.html">Documentation Style</a></span></dt><dd><dl><dt><span class="sect2"><a href="documentation_style.html#doc_style.doxygen">Doxygen</a></span></dt><dt><span class="sect2"><a href="documentation_style.html#doc_style.docbook">Docbook</a></span></dt></dl></dd><dt><span class="sect1"><a href="source_design_notes.html">Design Notes</a></span></dt></dl></div><p>
The GNU C++ Library follows an open development model. Active
contributors are assigned maintainer-ship responsibility, and given
@@ -110,4 +110,4 @@
mail message and send it to libstdc++@gcc.gnu.org. All
patches and related discussion should be sent to the
libstdc++ mailing list.
- </p></li></ul></div></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch40s03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="source_organization.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Use </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Directory Layout and Source Conventions</td></tr></table></div></body></html>
+ </p></li></ul></div></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch41s03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="source_organization.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Use </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Directory Layout and Source Conventions</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/appendix_free.html b/libstdc++-v3/doc/html/manual/appendix_free.html
index a27d6e59e31..5b529f93e8e 100644
--- a/libstdc++-v3/doc/html/manual/appendix_free.html
+++ b/libstdc++-v3/doc/html/manual/appendix_free.html
@@ -5,7 +5,7 @@
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="backwards.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="appendix_gpl.html">Next</a></td></tr></table><hr /></div><div class="appendix" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="appendix.free"></a>Appendix C. 
Free Software Needs Free Documentation
- <a id="id469283" class="indexterm"></a>
+ <a id="id675332" class="indexterm"></a>
</h2></div></div></div><p>
The biggest deficiency in free operating systems is not in the
software--it is the lack of good free manuals that we can include in
diff --git a/libstdc++-v3/doc/html/manual/appendix_gpl.html b/libstdc++-v3/doc/html/manual/appendix_gpl.html
index 281aeec7fef..0f9a838f365 100644
--- a/libstdc++-v3/doc/html/manual/appendix_gpl.html
+++ b/libstdc++-v3/doc/html/manual/appendix_gpl.html
@@ -76,7 +76,7 @@
</p><p>
The precise terms and conditions for copying, distribution and modification
follow.
- </p><h2><a id="id460710"></a>
+ </p><h2><a id="id746936"></a>
TERMS AND CONDITIONS
</h2><h2><a id="gpl-3-definitions"></a>
0. Definitions.
@@ -617,7 +617,7 @@
waiver of all civil liability in connection with the Program, unless a
warranty or assumption of liability accompanies a copy of the Program in
return for a fee.
- </p><h2><a id="id468427"></a>
+ </p><h2><a id="id654357"></a>
END OF TERMS AND CONDITIONS
</h2><h2><a id="HowToApply"></a>
How to Apply These Terms to Your New Programs
diff --git a/libstdc++-v3/doc/html/manual/appendix_porting.html b/libstdc++-v3/doc/html/manual/appendix_porting.html
index f45d19b3e06..037759421ee 100644
--- a/libstdc++-v3/doc/html/manual/appendix_porting.html
+++ b/libstdc++-v3/doc/html/manual/appendix_porting.html
@@ -5,8 +5,8 @@
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="source_design_notes.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="internals.html">Next</a></td></tr></table><hr /></div><div class="appendix" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="appendix.porting"></a>Appendix B. 
Porting and Maintenance
- <a id="id492719" class="indexterm"></a>
-</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="appendix_porting.html#appendix.porting.build_hacking">Configure and Build Hacking</a></span></dt><dd><dl><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.map">Overview: What Comes from Where</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.scripts">Storing Information in non-AC files (like configure.host)</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.conventions">Coding and Commenting Conventions</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.acinclude">The acinclude.m4 layout</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.enable">GLIBCXX_ENABLE, the --enable maker</a></span></dt></dl></dd><dt><span class="sect1"><a href="internals.html">Porting to New Hardware or Operating Systems</a></span></dt><dd><dl><dt><span class="sect2"><a href="internals.html#internals.os">Operating System</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.cpu">CPU</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.char_types">Character Types</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.numeric_limits">Numeric Limits</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.libtool">Libtool</a></span></dt></dl></dd><dt><span class="sect1"><a href="abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="sect2"><a href="abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.versioning">Versioning</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.testing">Testing</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="sect1"><a href="api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="sect2"><a href="api.html#api.rel_300">3.0</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_310">3.1</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_320">3.2</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_330">3.3</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_340">3.4</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_400">4.0</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_410">4.1</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_420">4.2</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_430">4.3</a></span></dt></dl></dd><dt><span class="sect1"><a href="backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="sect2"><a href="backwards.html#backwards.first">First</a></span></dt><dt><span class="sect2"><a href="backwards.html#backwards.second">Second</a></span></dt><dt><span class="sect2"><a href="backwards.html#backwards.third">Third</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="appendix.porting.build_hacking"></a>Configure and Build Hacking</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="build_hacking.prereq"></a>Prerequisites</h3></div></div></div><p>
+ <a id="id744430" class="indexterm"></a>
+</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="appendix_porting.html#appendix.porting.build_hacking">Configure and Build Hacking</a></span></dt><dd><dl><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.map">Overview: What Comes from Where</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.scripts">Storing Information in non-AC files (like configure.host)</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.conventions">Coding and Commenting Conventions</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.acinclude">The acinclude.m4 layout</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.enable">GLIBCXX_ENABLE, the --enable maker</a></span></dt></dl></dd><dt><span class="sect1"><a href="internals.html">Porting to New Hardware or Operating Systems</a></span></dt><dd><dl><dt><span class="sect2"><a href="internals.html#internals.os">Operating System</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.cpu">CPU</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.char_types">Character Types</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.numeric_limits">Numeric Limits</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.libtool">Libtool</a></span></dt></dl></dd><dt><span class="sect1"><a href="test.html">Test</a></span></dt><dd><dl><dt><span class="sect2"><a href="test.html#test.organization">Organization</a></span></dt><dt><span class="sect2"><a href="test.html#test.run">Running the Testsuite</a></span></dt><dt><span class="sect2"><a href="test.html#test.new_tests">Writing a new test case</a></span></dt><dt><span class="sect2"><a href="test.html#test.harness">Test Harness and Utilities</a></span></dt></dl></dd><dt><span class="sect1"><a href="abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="sect2"><a href="abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.versioning">Versioning</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.testing">Testing</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="sect1"><a href="api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="sect2"><a href="api.html#api.rel_300">3.0</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_310">3.1</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_320">3.2</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_330">3.3</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_340">3.4</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_400">4.0</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_410">4.1</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_420">4.2</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_430">4.3</a></span></dt></dl></dd><dt><span class="sect1"><a href="backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="sect2"><a href="backwards.html#backwards.first">First</a></span></dt><dt><span class="sect2"><a href="backwards.html#backwards.second">Second</a></span></dt><dt><span class="sect2"><a href="backwards.html#backwards.third">Third</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="appendix.porting.build_hacking"></a>Configure and Build Hacking</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="build_hacking.prereq"></a>Prerequisites</h3></div></div></div><p>
As noted <a class="ulink" href="http://gcc.gnu.org/install/prerequisites.html" target="_top">previously</a>,
certain other tools are necessary for hacking on files that
control configure (<code class="code">configure.ac</code>,
@@ -23,8 +23,8 @@
Regenerate all generated files by using the command sequence
<code class="code">"autoreconf"</code> at the top level of the libstdc++ source
directory. The following will also work, but is much more complex:
- <code class="code">"aclocal-1.7 &amp;&amp; autoconf-2.59 &amp;&amp;
- autoheader-2.59 &amp;&amp; automake-1.7"</code> The version
+ <code class="code">"aclocal-1.11 &amp;&amp; autoconf-2.64 &amp;&amp;
+ autoheader-2.64 &amp;&amp; automake-1.11"</code> The version
numbers may be absent entirely or otherwise vary depending on
<a class="ulink" href="http://gcc.gnu.org/install/prerequisites.html" target="_top">the
current requirements</a> and your vendor's choice of
@@ -196,7 +196,7 @@
</p><p>
If you're wondering what that line noise in the last example was,
that's how you embed autoconf special characters in output text.
- They're called <a class="ulink" href="http://ftp.gnu.org/pub/old-gnu/Manuals/autoconf-2.57/html_mono/autoconf.html#SEC95" target="_top"><span class="emphasis"><em>quadrigraphs</em></span></a>
+ They're called <a class="ulink" href="http://www.gnu.org/software/autoconf/manual/autoconf.html#Quadrigraphs" target="_top"><span class="emphasis"><em>quadrigraphs</em></span></a>
and you should use them whenever necessary.
</p></li><li><p>HELP-STRING is what you think it is. Do not include the
"default" text like we used to do; it will be done for you by
diff --git a/libstdc++-v3/doc/html/manual/backwards.html b/libstdc++-v3/doc/html/manual/backwards.html
index 854ed1d1a8c..252d177d4aa 100644
--- a/libstdc++-v3/doc/html/manual/backwards.html
+++ b/libstdc++-v3/doc/html/manual/backwards.html
@@ -17,8 +17,8 @@ ISO Standard (e.g., statistical analysis). While there are a lot of
really useful things that are used by a lot of people, the Standards
Committee couldn't include everything, and so a lot of those
“<span class="quote">obvious</span>†classes didn't get included.
-</p><p>Known Issues include many of the limitations of its immediate ancestor.</p><p>Portability notes and known implementation limitations are as follows.</p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id467544"></a>No <code class="code">ios_base</code></h4></div></div></div><p> At least some older implementations don't have <code class="code">std::ios_base</code>, so you should use <code class="code">std::ios::badbit</code>, <code class="code">std::ios::failbit</code> and <code class="code">std::ios::eofbit</code> and <code class="code">std::ios::goodbit</code>.
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id467576"></a>No <code class="code">cout</code> in <code class="code">ostream.h</code>, no <code class="code">cin</code> in <code class="code">istream.h</code></h4></div></div></div><p>
+</p><p>Known Issues include many of the limitations of its immediate ancestor.</p><p>Portability notes and known implementation limitations are as follows.</p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id744149"></a>No <code class="code">ios_base</code></h4></div></div></div><p> At least some older implementations don't have <code class="code">std::ios_base</code>, so you should use <code class="code">std::ios::badbit</code>, <code class="code">std::ios::failbit</code> and <code class="code">std::ios::eofbit</code> and <code class="code">std::ios::goodbit</code>.
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id744181"></a>No <code class="code">cout</code> in <code class="code">ostream.h</code>, no <code class="code">cin</code> in <code class="code">istream.h</code></h4></div></div></div><p>
In earlier versions of the standard,
<code class="filename">fstream.h</code>,
<code class="filename">ostream.h</code>
@@ -44,7 +44,7 @@ considered replaced and rewritten.
archived. The code is considered replaced and rewritten.
</p><p>
Portability notes and known implementation limitations are as follows.
-</p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id467674"></a>Namespace <code class="code">std::</code> not supported</h4></div></div></div><p>
+</p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id744279"></a>Namespace <code class="code">std::</code> not supported</h4></div></div></div><p>
Some care is required to support C++ compiler and or library
implementation that do not have the standard library in
<code class="code">namespace std</code>.
@@ -108,7 +108,7 @@ AC_DEFUN([AC_CXX_NAMESPACE_STD], [
AC_DEFINE(HAVE_NAMESPACE_STD,,[Define if g++ supports namespace std. ])
fi
])
-</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id524920"></a>Illegal iterator usage</h4></div></div></div><p>
+</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id673182"></a>Illegal iterator usage</h4></div></div></div><p>
The following illustrate implementation-allowed illegal iterator
use, and then correct use.
</p><div class="itemizedlist"><ul type="disc"><li><p>
@@ -121,7 +121,7 @@ AC_DEFUN([AC_CXX_NAMESPACE_STD], [
</p></li><li><p>
<code class="code">if (iterator)</code> won't work any more =&gt; use
<code class="code">if (iterator != iterator_type())</code>
- </p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id524981"></a><code class="code">isspace</code> from <code class="filename">cctype</code> is a macro
+ </p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id673243"></a><code class="code">isspace</code> from <code class="filename">cctype</code> is a macro
</h4></div></div></div><p>
Glibc 2.0.x and 2.1.x define <code class="filename">ctype.h</code> functionality as macros
(isspace, isalpha etc.).
@@ -154,7 +154,7 @@ std:: (__ctype_b[(int) ( ( 'X' ) )] &amp; (unsigned short int) _ISspace ) ;
(<code class="filename">ctype.h</code>) and the
definitions in namespace <code class="code">std::</code>
(<code class="code">&lt;cctype&gt;</code>).
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id525075"></a>No <code class="code">vector::at</code>, <code class="code">deque::at</code>, <code class="code">string::at</code></h4></div></div></div><p>
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id586519"></a>No <code class="code">vector::at</code>, <code class="code">deque::at</code>, <code class="code">string::at</code></h4></div></div></div><p>
One solution is to add an autoconf-test for this:
</p><pre class="programlisting">
AC_MSG_CHECKING(for container::at)
@@ -180,7 +180,7 @@ AC_DEFINE(HAVE_CONTAINER_AT)],
</pre><p>
If you are using other (non-GNU) compilers it might be a good idea
to check for <code class="code">string::at</code> separately.
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id525113"></a>No <code class="code">std::char_traits&lt;char&gt;::eof</code></h4></div></div></div><p>
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id586557"></a>No <code class="code">std::char_traits&lt;char&gt;::eof</code></h4></div></div></div><p>
Use some kind of autoconf test, plus this:
</p><pre class="programlisting">
#ifdef HAVE_CHAR_TRAITS
@@ -188,7 +188,7 @@ AC_DEFINE(HAVE_CONTAINER_AT)],
#else
#define CPP_EOF EOF
#endif
-</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id525131"></a>No <code class="code">string::clear</code></h4></div></div></div><p>
+</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id586575"></a>No <code class="code">string::clear</code></h4></div></div></div><p>
There are two functions for deleting the contents of a string:
<code class="code">clear</code> and <code class="code">erase</code> (the latter returns the
string).
@@ -206,12 +206,12 @@ erase(size_type __pos = 0, size_type __n = npos)
Unfortunately, <code class="code">clear</code> is not implemented in this
version, so you should use <code class="code">erase</code> (which is probably
faster than <code class="code">operator=(charT*)</code>).
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id525176"></a>
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id586620"></a>
Removal of <code class="code">ostream::form</code> and <code class="code">istream::scan</code>
extensions
</h4></div></div></div><p>
These are no longer supported. Please use stringstreams instead.
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id525195"></a>No <code class="code">basic_stringbuf</code>, <code class="code">basic_stringstream</code></h4></div></div></div><p>
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id586640"></a>No <code class="code">basic_stringbuf</code>, <code class="code">basic_stringstream</code></h4></div></div></div><p>
Although the ISO standard <code class="code">i/ostringstream</code>-classes are
provided, (<code class="filename">sstream</code>), for
compatibility with older implementations the pre-ISO
@@ -299,14 +299,14 @@ any = temp;
Another example of using stringstreams is in <a class="link" href="bk01pt05ch13s05.html" title="Shrink to Fit">this howto</a>.
</p><p> There is additional information in the libstdc++-v2 info files, in
particular “<span class="quote">info iostream</span>â€.
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id545596"></a>Little or no wide character support</h4></div></div></div><p>
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id659623"></a>Little or no wide character support</h4></div></div></div><p>
Classes <code class="classname">wstring</code> and
<code class="classname">char_traits&lt;wchar_t&gt;</code> are
not supported.
- </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id545615"></a>No templatized iostreams</h4></div></div></div><p>
+ </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id659642"></a>No templatized iostreams</h4></div></div></div><p>
Classes <code class="classname">wfilebuf</code> and
<code class="classname">wstringstream</code> are not supported.
- </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id545634"></a>Thread safety issues</h4></div></div></div><p>
+ </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id659661"></a>Thread safety issues</h4></div></div></div><p>
Earlier GCC releases had a somewhat different approach to
threading configuration and proper compilation. Before GCC 3.0,
configuration of the threading model was dictated by compiler
@@ -364,7 +364,7 @@ libstdc++-v3.
of the SGI STL (version 3.3), with extensive changes.
</p><p>A more formal description of the V3 goals can be found in the
official <a class="link" href="source_design_notes.html" title="Design Notes">design document</a>.
- </p><p>Portability notes and known implementation limitations are as follows.</p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id545751"></a>Pre-ISO headers moved to backwards or removed</h4></div></div></div><p> The pre-ISO C++ headers
+ </p><p>Portability notes and known implementation limitations are as follows.</p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id659778"></a>Pre-ISO headers moved to backwards or removed</h4></div></div></div><p> The pre-ISO C++ headers
(<code class="code">iostream.h</code>, <code class="code">defalloc.h</code> etc.) are
available, unlike previous libstdc++ versions, but inclusion
generates a warning that you are using deprecated headers.
@@ -436,7 +436,7 @@ like <code class="filename">vector.h</code> can be replaced with <code class="fi
directive <code class="code">using namespace std;</code> can be put at the global
scope. This should be enough to get this code compiling, assuming the
other usage is correct.
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id545834"></a>Extension headers hash_map, hash_set moved to ext or backwards</h4></div></div></div><p>At this time most of the features of the SGI STL extension have been
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id674389"></a>Extension headers hash_map, hash_set moved to ext or backwards</h4></div></div></div><p>At this time most of the features of the SGI STL extension have been
replaced by standardized libraries.
In particular, the unordered_map and unordered_set containers of TR1
are suitable replacement for the non-standard hash_map and hash_set
@@ -508,7 +508,7 @@ AC_DEFUN([AC_HEADER_EXT_HASH_SET], [
AC_DEFINE(HAVE_EXT_HASH_SET,,[Define if ext/hash_set is present. ])
fi
])
-</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id476825"></a>No <code class="code">ios::nocreate/ios::noreplace</code>.
+</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id674492"></a>No <code class="code">ios::nocreate/ios::noreplace</code>.
</h4></div></div></div><p> The existence of <code class="code">ios::nocreate</code> being used for
input-streams has been confirmed, most probably because the author
thought it would be more correct to specify nocreate explicitly. So
@@ -519,7 +519,7 @@ open the file for reading, check if it has been opened, and then
decide whether you want to create/replace or not. To my knowledge,
even older implementations support <code class="code">app</code>, <code class="code">ate</code>
and <code class="code">trunc</code> (except for <code class="code">app</code> ?).
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id476873"></a>
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id674539"></a>
No <code class="code">stream::attach(int fd)</code>
</h4></div></div></div><p>
Phil Edwards writes: It was considered and rejected for the ISO
@@ -542,7 +542,7 @@ No <code class="code">stream::attach(int fd)</code>
For another example of this, refer to
<a class="ulink" href="http://www.josuttis.com/cppcode/fdstream.html" target="_top">fdstream example</a>
by Nicolai Josuttis.
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id476937"></a>
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id674603"></a>
Support for C++98 dialect.
</h4></div></div></div><p>Check for complete library coverage of the C++1998/2003 standard.
</p><pre class="programlisting">
@@ -610,7 +610,7 @@ AC_DEFUN([AC_HEADER_STDCXX_98], [
AC_DEFINE(STDCXX_98_HEADERS,,[Define if ISO C++ 1998 header files are present. ])
fi
])
-</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id476964"></a>
+</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id674631"></a>
Support for C++TR1 dialect.
</h4></div></div></div><p>Check for library coverage of the TR1 standard.
</p><pre class="programlisting">
@@ -687,7 +687,7 @@ AC_DEFUN([AC_HEADER_TR1_UNORDERED_SET], [
AC_DEFINE(HAVE_TR1_UNORDERED_SET,,[Define if tr1/unordered_set is present. ])
fi
])
-</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id477008"></a>
+</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id675096"></a>
Support for C++0x dialect.
</h4></div></div></div><p>Check for baseline language coverage in the compiler for the C++0xstandard.
</p><pre class="programlisting">
@@ -899,27 +899,27 @@ AC_DEFUN([AC_HEADER_UNORDERED_SET], [
AC_DEFINE(HAVE_UNORDERED_SET,,[Define if unordered_set is present. ])
fi
])
-</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id477085"></a>
+</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id675173"></a>
Container::iterator_type is not necessarily Container::value_type*
</h4></div></div></div><p>
This is a change in behavior from the previous version. Now, most
<span class="type">iterator_type</span> typedefs in container classes are POD
objects, not <span class="type">value_type</span> pointers.
-</p></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="backwards.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id477115"></a><p>[<abbr class="abbrev">
+</p></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="backwards.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id675202"></a><p>[<abbr class="abbrev">
kegel41
</abbr>] <span class="title"><i>
Migrating to GCC 4.1
</i>. </span><span class="author"><span class="firstname">Dan</span> <span class="surname">Kegel</span>. </span><span class="biblioid">
<a class="ulink" href="http://www.kegel.com/gcc/gcc4.html" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id469192"></a><p>[<abbr class="abbrev">
+ . </span></p></div><div class="biblioentry"><a id="id675235"></a><p>[<abbr class="abbrev">
kegel41
</abbr>] <span class="title"><i>
Building the Whole Debian Archive with GCC 4.1: A Summary
</i>. </span><span class="author"><span class="firstname">Martin</span> <span class="surname">Michlmayr</span>. </span><span class="biblioid">
<a class="ulink" href="http://lists.debian.org/debian-gcc/2006/03/msg00405.html" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id469224"></a><p>[<abbr class="abbrev">
+ . </span></p></div><div class="biblioentry"><a id="id675268"></a><p>[<abbr class="abbrev">
lbl32
</abbr>] <span class="title"><i>
Migration guide for GCC-3.2
diff --git a/libstdc++-v3/doc/html/manual/bitmap_allocator.html b/libstdc++-v3/doc/html/manual/bitmap_allocator.html
index 72eec938105..806ca047865 100644
--- a/libstdc++-v3/doc/html/manual/bitmap_allocator.html
+++ b/libstdc++-v3/doc/html/manual/bitmap_allocator.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>bitmap_allocator</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; allocator&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="ext_allocators.html" title="Chapter 32. Allocators" /><link rel="prev" href="ext_allocators.html" title="Chapter 32. Allocators" /><link rel="next" href="ext_containers.html" title="Chapter 33. Containers" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">bitmap_allocator</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_allocators.html">Prev</a> </td><th width="60%" align="center">Chapter 32. Allocators</th><td width="20%" align="right"> <a accesskey="n" href="ext_containers.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.allocator.bitmap"></a>bitmap_allocator</h2></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>bitmap_allocator</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; allocator&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="ext_allocators.html" title="Chapter 33. Allocators" /><link rel="prev" href="ext_allocators.html" title="Chapter 33. Allocators" /><link rel="next" href="ext_containers.html" title="Chapter 34. Containers" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">bitmap_allocator</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_allocators.html">Prev</a> </td><th width="60%" align="center">Chapter 33. Allocators</th><td width="20%" align="right"> <a accesskey="n" href="ext_containers.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.allocator.bitmap"></a>bitmap_allocator</h2></div></div></div><p>
</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.bitmap.design"></a>Design</h3></div></div></div><p>
As this name suggests, this allocator uses a bit-map to keep track
of the used and unused memory locations for it's book-keeping
@@ -103,7 +103,7 @@ else return false.</p></li></ol></div><p>
</p><p>
Consider a block of size 64 ints. In memory, it would look like this:
(assume a 32-bit system where, size_t is a 32-bit entity).
- </p><div class="table"><a id="id508940"></a><p class="title"><b>Table 32.1. Bitmap Allocator Memory Map</b></p><div class="table-contents"><table summary="Bitmap Allocator Memory Map" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left">268</td><td align="left">0</td><td align="left">4294967295</td><td align="left">4294967295</td><td align="left">Data -&gt; Space for 64 ints</td></tr></tbody></table></div></div><br class="table-break" /><p>
+ </p><div class="table"><a id="id730908"></a><p class="title"><b>Table 33.1. Bitmap Allocator Memory Map</b></p><div class="table-contents"><table summary="Bitmap Allocator Memory Map" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left">268</td><td align="left">0</td><td align="left">4294967295</td><td align="left">4294967295</td><td align="left">Data -&gt; Space for 64 ints</td></tr></tbody></table></div></div><br class="table-break" /><p>
The first Column(268) represents the size of the Block in bytes as
seen by the Bitmap Allocator. Internally, a global free list is
used to keep track of the free blocks used and given back by the
@@ -337,4 +337,4 @@ equivalent.</p></li><li><p>And also this would preserve the cache as far as poss
sizeof(size_t) x 8 which is the number of bits in an integer,
which can fit exactly in a CPU register. Hence, the term given is
exponential growth of the internal pool.
- </p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_allocators.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ext_allocators.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_containers.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 32. Allocators </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 33. Containers</td></tr></table></div></body></html>
+ </p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_allocators.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ext_allocators.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_containers.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 33. Allocators </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 34. Containers</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bitset.html b/libstdc++-v3/doc/html/manual/bitset.html
index 85dbc857ae7..acc150df7e8 100644
--- a/libstdc++-v3/doc/html/manual/bitset.html
+++ b/libstdc++-v3/doc/html/manual/bitset.html
@@ -84,7 +84,7 @@
author would love to hear from you...
</p><p>
Also note that the implementation of bitset used in libstdc++ has
- <a class="link" href="bk01pt12ch33s02.html" title="HP/SGI">some extensions</a>.
+ <a class="link" href="bk01pt12ch34s02.html" title="HP/SGI">some extensions</a>.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="associative.bitset.type_string"></a>Type String</h3></div></div></div><p>
</p><p>
Bitmasks do not take char* nor const char* arguments in their
diff --git a/libstdc++-v3/doc/html/manual/bk01ix01.html b/libstdc++-v3/doc/html/manual/bk01ix01.html
index e46ca2ea195..51a67bbe12d 100644
--- a/libstdc++-v3/doc/html/manual/bk01ix01.html
+++ b/libstdc++-v3/doc/html/manual/bk01ix01.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Index</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="appendix_gfdl.html" title="Appendix E. GNU Free Documentation License" /><link rel="next" href="../bk02.html" title="" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Index</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="appendix_gfdl.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="../bk02.html">Next</a></td></tr></table><hr /></div><div class="index"><div class="titlepage"><div><div><h2 class="title"><a id="id546577"></a>Index</h2></div></div></div><div class="index"><div class="indexdiv"><h3>A</h3><dl><dt>Algorithms, <a class="indexterm" href="algorithms.html">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Index</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="appendix_gfdl.html" title="Appendix E. GNU Free Documentation License" /><link rel="next" href="../bk02.html" title="" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Index</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="appendix_gfdl.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="../bk02.html">Next</a></td></tr></table><hr /></div><div class="index"><div class="titlepage"><div><div><h2 class="title"><a id="id692397"></a>Index</h2></div></div></div><div class="index"><div class="indexdiv"><h3>A</h3><dl><dt>Algorithms, <a class="indexterm" href="algorithms.html">
Algorithms
</a></dt><dt>Appendix</dt><dd><dl><dt>Contributing, <a class="indexterm" href="appendix_contributing.html">
diff --git a/libstdc++-v3/doc/html/manual/bk01pt02pr01.html b/libstdc++-v3/doc/html/manual/bk01pt02pr01.html
index 724322683bf..4ec01fefd93 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt02pr01.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt02pr01.html
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="support.html" title="Part II.  Support" /><link rel="prev" href="support.html" title="Part II.  Support" /><link rel="next" href="fundamental_types.html" title="Chapter 4. Types" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="support.html">Prev</a> </td><th width="60%" align="center">Part II. 
Support
-</th><td width="20%" align="right"> <a accesskey="n" href="fundamental_types.html">Next</a></td></tr></table><hr /></div><div class="preface" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id455418"></a></h2></div></div></div><p>
+</th><td width="20%" align="right"> <a accesskey="n" href="fundamental_types.html">Next</a></td></tr></table><hr /></div><div class="preface" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id650354"></a></h2></div></div></div><p>
This part deals with the functions called and objects created
automatically during the course of a program's existence.
</p><p>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch07s02.html b/libstdc++-v3/doc/html/manual/bk01pt03ch07s02.html
index 5194208173b..d72d23d2d95 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch07s02.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch07s02.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Adding Data to Exceptions</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="exceptions.html" title="Chapter 7. Exceptions" /><link rel="prev" href="exceptions.html" title="Chapter 7. Exceptions" /><link rel="next" href="bk01pt03ch07s03.html" title="Cancellation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Adding Data to Exceptions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="exceptions.html">Prev</a> </td><th width="60%" align="center">Chapter 7. Exceptions</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt03ch07s03.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.diagnostics.exceptions.data"></a>Adding Data to Exceptions</h2></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Adding Data to Exceptions</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="exceptions.html" title="Chapter 7. Exceptions" /><link rel="prev" href="exceptions.html" title="Chapter 7. Exceptions" /><link rel="next" href="bk01pt03ch08.html" title="Chapter 8. Concept Checking" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Adding Data to Exceptions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="exceptions.html">Prev</a> </td><th width="60%" align="center">Chapter 7. Exceptions</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt03ch08.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.diagnostics.exceptions.data"></a>Adding Data to Exceptions</h2></div></div></div><p>
The standard exception classes carry with them a single string as
data (usually describing what went wrong or where the 'throw' took
place). It's good to remember that you can add your own data to
@@ -17,4 +17,4 @@
int e;
DBID id; // some user-defined type
};
- </pre></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="exceptions.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="exceptions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt03ch07s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 7. Exceptions </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Cancellation</td></tr></table></div></body></html>
+ </pre></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="exceptions.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="exceptions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt03ch08.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 7. Exceptions </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 8. Concept Checking</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch08.html b/libstdc++-v3/doc/html/manual/bk01pt03ch08.html
index 758405f356c..5c6d0c83a24 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch08.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch08.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 8. Concept Checking</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="diagnostics.html" title="Part III.  Diagnostics" /><link rel="prev" href="bk01pt03ch07s03.html" title="Cancellation" /><link rel="next" href="utilities.html" title="Part IV.  Utilities" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 8. Concept Checking</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt03ch07s03.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 8. Concept Checking</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="diagnostics.html" title="Part III.  Diagnostics" /><link rel="prev" href="bk01pt03ch07s02.html" title="Adding Data to Exceptions" /><link rel="next" href="utilities.html" title="Part IV.  Utilities" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 8. Concept Checking</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt03ch07s02.html">Prev</a> </td><th width="60%" align="center">Part III. 
Diagnostics
</th><td width="20%" align="right"> <a accesskey="n" href="utilities.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.diagnostics.concept_checking"></a>Chapter 8. Concept Checking</h2></div></div></div><p>
@@ -39,7 +39,7 @@
support for template parameter constraints based on concepts in the core
language. This will obviate the need for the library-simulated concept
checking described above.
- </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt03ch07s03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="diagnostics.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="utilities.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Cancellation </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Part IV. 
+ </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt03ch07s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="diagnostics.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="utilities.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Adding Data to Exceptions </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Part IV. 
Utilities
</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt09pr02.html b/libstdc++-v3/doc/html/manual/bk01pt09pr02.html
index 35101a56e1e..420cb81b855 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt09pr02.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt09pr02.html
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; , &#10; algorithm&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="algorithms.html" title="Part IX.  Algorithms" /><link rel="prev" href="algorithms.html" title="Part IX.  Algorithms" /><link rel="next" href="bk01pt09ch20.html" title="Chapter 20. Mutating" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="algorithms.html">Prev</a> </td><th width="60%" align="center">Part IX. 
Algorithms
-</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt09ch20.html">Next</a></td></tr></table><hr /></div><div class="preface" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id445072"></a></h2></div></div></div><p>
+</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt09ch20.html">Next</a></td></tr></table><hr /></div><div class="preface" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id617760"></a></h2></div></div></div><p>
The neatest accomplishment of the algorithms chapter is that all the
work is done via iterators, not containers directly. This means two
important things:
diff --git a/libstdc++-v3/doc/html/manual/bk01pt11ch27s03.html b/libstdc++-v3/doc/html/manual/bk01pt11ch27s03.html
deleted file mode 100644
index ff71f7d383b..00000000000
--- a/libstdc++-v3/doc/html/manual/bk01pt11ch27s03.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>More Binary Input and Output</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="fstreams.html" title="Chapter 27. File Based Streams" /><link rel="prev" href="bk01pt11ch27s02.html" title="Binary Input and Output" /><link rel="next" href="io_and_c.html" title="Chapter 28. Interacting with C" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">More Binary Input and Output</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt11ch27s02.html">Prev</a> </td><th width="60%" align="center">Chapter 27. File Based Streams</th><td width="20%" align="right"> <a accesskey="n" href="io_and_c.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.io.filestreams.binary2"></a>More Binary Input and Output</h2></div></div></div><p>Towards the beginning of February 2001, the subject of
- "binary" I/O was brought up in a couple of places at the
- same time. One notable place was Usenet, where James Kanze and
- Dietmar Kühl separately posted articles on why attempting
- generic binary I/O was not a good idea. (Here are copies of
- <a class="ulink" href="binary_iostreams_kanze.txt" target="_top">Kanze's article</a> and
- <a class="ulink" href="binary_iostreams_kuehl.txt" target="_top">Kühl's article</a>.)
- </p><p>Briefly, the problems of byte ordering and type sizes mean that
- the unformatted functions like <code class="code">ostream::put()</code> and
- <code class="code">istream::get()</code> cannot safely be used to communicate
- between arbitrary programs, or across a network, or from one
- invocation of a program to another invocation of the same program
- on a different platform, etc.
- </p><p>The entire Usenet thread is instructive, and took place under the
- subject heading "binary iostreams" on both comp.std.c++
- and comp.lang.c++.moderated in parallel. Also in that thread,
- Dietmar Kühl mentioned that he had written a pair of stream
- classes that would read and write XDR, which is a good step towards
- a portable binary format.
- </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt11ch27s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="fstreams.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="io_and_c.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Binary Input and Output </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 28. Interacting with C</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt12ch30s03.html b/libstdc++-v3/doc/html/manual/bk01pt12ch30s03.html
index 9bbbdc2fc11..089058c2ff7 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt12ch30s03.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt12ch30s03.html
@@ -19,6 +19,6 @@
mode or with debug mode. The
following table provides the names and headers of the debugging
containers:
-</p><div class="table"><a id="id452232"></a><p class="title"><b>Table 30.1. Debugging Containers</b></p><div class="table-contents"><table summary="Debugging Containers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Container</th><th align="left">Header</th><th align="left">Debug container</th><th align="left">Debug header</th></tr></thead><tbody><tr><td align="left"><code class="classname">std::bitset</code></td><td align="left"><code class="filename">bitset</code></td><td align="left"><code class="classname">__gnu_debug::bitset</code></td><td align="left"><code class="filename">bitset</code></td></tr><tr><td align="left"><code class="classname">std::deque</code></td><td align="left"><code class="filename">deque</code></td><td align="left"><code class="classname">__gnu_debug::deque</code></td><td align="left"><code class="filename">deque</code></td></tr><tr><td align="left"><code class="classname">std::list</code></td><td align="left"><code class="filename">list</code></td><td align="left"><code class="classname">__gnu_debug::list</code></td><td align="left"><code class="filename">list</code></td></tr><tr><td align="left"><code class="classname">std::map</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="classname">__gnu_debug::map</code></td><td align="left"><code class="filename">map</code></td></tr><tr><td align="left"><code class="classname">std::multimap</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="classname">__gnu_debug::multimap</code></td><td align="left"><code class="filename">map</code></td></tr><tr><td align="left"><code class="classname">std::multiset</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="classname">__gnu_debug::multiset</code></td><td align="left"><code class="filename">set</code></td></tr><tr><td align="left"><code class="classname">std::set</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="classname">__gnu_debug::set</code></td><td align="left"><code class="filename">set</code></td></tr><tr><td align="left"><code class="classname">std::string</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="classname">__gnu_debug::string</code></td><td align="left"><code class="filename">string</code></td></tr><tr><td align="left"><code class="classname">std::wstring</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="classname">__gnu_debug::wstring</code></td><td align="left"><code class="filename">string</code></td></tr><tr><td align="left"><code class="classname">std::basic_string</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="classname">__gnu_debug::basic_string</code></td><td align="left"><code class="filename">string</code></td></tr><tr><td align="left"><code class="classname">std::vector</code></td><td align="left"><code class="filename">vector</code></td><td align="left"><code class="classname">__gnu_debug::vector</code></td><td align="left"><code class="filename">vector</code></td></tr></tbody></table></div></div><br class="table-break" /><p>In addition, when compiling in C++0x mode, these additional
+</p><div class="table"><a id="id672482"></a><p class="title"><b>Table 30.1. Debugging Containers</b></p><div class="table-contents"><table summary="Debugging Containers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Container</th><th align="left">Header</th><th align="left">Debug container</th><th align="left">Debug header</th></tr></thead><tbody><tr><td align="left"><code class="classname">std::bitset</code></td><td align="left"><code class="filename">bitset</code></td><td align="left"><code class="classname">__gnu_debug::bitset</code></td><td align="left"><code class="filename">bitset</code></td></tr><tr><td align="left"><code class="classname">std::deque</code></td><td align="left"><code class="filename">deque</code></td><td align="left"><code class="classname">__gnu_debug::deque</code></td><td align="left"><code class="filename">deque</code></td></tr><tr><td align="left"><code class="classname">std::list</code></td><td align="left"><code class="filename">list</code></td><td align="left"><code class="classname">__gnu_debug::list</code></td><td align="left"><code class="filename">list</code></td></tr><tr><td align="left"><code class="classname">std::map</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="classname">__gnu_debug::map</code></td><td align="left"><code class="filename">map</code></td></tr><tr><td align="left"><code class="classname">std::multimap</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="classname">__gnu_debug::multimap</code></td><td align="left"><code class="filename">map</code></td></tr><tr><td align="left"><code class="classname">std::multiset</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="classname">__gnu_debug::multiset</code></td><td align="left"><code class="filename">set</code></td></tr><tr><td align="left"><code class="classname">std::set</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="classname">__gnu_debug::set</code></td><td align="left"><code class="filename">set</code></td></tr><tr><td align="left"><code class="classname">std::string</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="classname">__gnu_debug::string</code></td><td align="left"><code class="filename">string</code></td></tr><tr><td align="left"><code class="classname">std::wstring</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="classname">__gnu_debug::wstring</code></td><td align="left"><code class="filename">string</code></td></tr><tr><td align="left"><code class="classname">std::basic_string</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="classname">__gnu_debug::basic_string</code></td><td align="left"><code class="filename">string</code></td></tr><tr><td align="left"><code class="classname">std::vector</code></td><td align="left"><code class="filename">vector</code></td><td align="left"><code class="classname">__gnu_debug::vector</code></td><td align="left"><code class="filename">vector</code></td></tr></tbody></table></div></div><br class="table-break" /><p>In addition, when compiling in C++0x mode, these additional
containers have additional debug capability.
-</p><div class="table"><a id="id387544"></a><p class="title"><b>Table 30.2. Debugging Containers C++0x</b></p><div class="table-contents"><table summary="Debugging Containers C++0x" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Container</th><th align="left">Header</th><th align="left">Debug container</th><th align="left">Debug header</th></tr></thead><tbody><tr><td align="left"><code class="classname">std::unordered_map</code></td><td align="left"><code class="filename">unordered_map</code></td><td align="left"><code class="classname">__gnu_debug::unordered_map</code></td><td align="left"><code class="filename">unordered_map</code></td></tr><tr><td align="left"><code class="classname">std::unordered_multimap</code></td><td align="left"><code class="filename">unordered_map</code></td><td align="left"><code class="classname">__gnu_debug::unordered_multimap</code></td><td align="left"><code class="filename">unordered_map</code></td></tr><tr><td align="left"><code class="classname">std::unordered_set</code></td><td align="left"><code class="filename">unordered_set</code></td><td align="left"><code class="classname">__gnu_debug::unordered_set</code></td><td align="left"><code class="filename">unordered_set</code></td></tr><tr><td align="left"><code class="classname">std::unordered_multiset</code></td><td align="left"><code class="filename">unordered_set</code></td><td align="left"><code class="classname">__gnu_debug::unordered_multiset</code></td><td align="left"><code class="filename">unordered_set</code></td></tr></tbody></table></div></div><br class="table-break" /></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch30s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="debug_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch30s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Semantics </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Design</td></tr></table></div></body></html>
+</p><div class="table"><a id="id646525"></a><p class="title"><b>Table 30.2. Debugging Containers C++0x</b></p><div class="table-contents"><table summary="Debugging Containers C++0x" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Container</th><th align="left">Header</th><th align="left">Debug container</th><th align="left">Debug header</th></tr></thead><tbody><tr><td align="left"><code class="classname">std::unordered_map</code></td><td align="left"><code class="filename">unordered_map</code></td><td align="left"><code class="classname">__gnu_debug::unordered_map</code></td><td align="left"><code class="filename">unordered_map</code></td></tr><tr><td align="left"><code class="classname">std::unordered_multimap</code></td><td align="left"><code class="filename">unordered_map</code></td><td align="left"><code class="classname">__gnu_debug::unordered_multimap</code></td><td align="left"><code class="filename">unordered_map</code></td></tr><tr><td align="left"><code class="classname">std::unordered_set</code></td><td align="left"><code class="filename">unordered_set</code></td><td align="left"><code class="classname">__gnu_debug::unordered_set</code></td><td align="left"><code class="filename">unordered_set</code></td></tr><tr><td align="left"><code class="classname">std::unordered_multiset</code></td><td align="left"><code class="filename">unordered_set</code></td><td align="left"><code class="classname">__gnu_debug::unordered_multiset</code></td><td align="left"><code class="filename">unordered_set</code></td></tr></tbody></table></div></div><br class="table-break" /></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch30s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="debug_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch30s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Semantics </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Design</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt12ch31s03.html b/libstdc++-v3/doc/html/manual/bk01pt12ch31s03.html
index cdd2f3df46a..265a3116022 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt12ch31s03.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt12ch31s03.html
@@ -17,11 +17,7 @@ In addition, hardware that supports atomic operations and a compiler
as <code class="literal">-march=i686</code>,
<code class="literal">-march=native</code> or <code class="literal">-mcpu=v9</code>. See
the GCC manual for more information.
-</p>
-<p>
- Also, the parallel mode requires platform support for stdint.h.
-</p>
-</div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="parallel_mode.using.parallel_mode"></a>Using Parallel Mode</h3></div></div></div><p>
+</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="parallel_mode.using.parallel_mode"></a>Using Parallel Mode</h3></div></div></div><p>
To use the libstdc++ parallel mode, compile your application with
the prerequisite flags as detailed above, and in addition
add <code class="constant">-D_GLIBCXX_PARALLEL</code>. This will convert all
@@ -67,4 +63,4 @@ Then compile this code with the prerequisite compiler flags
flags for atomic operations.)
</p><p> The following table provides the names and headers of all the
parallel algorithms that can be used in a similar manner:
-</p><div class="table"><a id="id468908"></a><p class="title"><b>Table 31.1. Parallel Algorithms</b></p><div class="table-contents"><table summary="Parallel Algorithms" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Algorithm</th><th align="left">Header</th><th align="left">Parallel algorithm</th><th align="left">Parallel header</th></tr></thead><tbody><tr><td align="left"><code class="function">std::accumulate</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="function">__gnu_parallel::accumulate</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr><tr><td align="left"><code class="function">std::adjacent_difference</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="function">__gnu_parallel::adjacent_difference</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr><tr><td align="left"><code class="function">std::inner_product</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="function">__gnu_parallel::inner_product</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr><tr><td align="left"><code class="function">std::partial_sum</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="function">__gnu_parallel::partial_sum</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr><tr><td align="left"><code class="function">std::adjacent_find</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::adjacent_find</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::count</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::count</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::count_if</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::count_if</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::equal</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::equal</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::find</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::find</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::find_if</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::find_if</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::find_first_of</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::find_first_of</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::for_each</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::for_each</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::generate</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::generate</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::generate_n</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::generate_n</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::lexicographical_compare</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::lexicographical_compare</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::mismatch</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::mismatch</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::search</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::search</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::search_n</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::search_n</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::transform</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::transform</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::replace</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::replace</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::replace_if</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::replace_if</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::max_element</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::max_element</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::merge</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::merge</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::min_element</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::min_element</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::nth_element</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::nth_element</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::partial_sort</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::partial_sort</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::partition</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::partition</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::random_shuffle</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::random_shuffle</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::set_union</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::set_union</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::set_intersection</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::set_intersection</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::set_symmetric_difference</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::set_symmetric_difference</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::set_difference</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::set_difference</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::sort</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::sort</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::stable_sort</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::stable_sort</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::unique_copy</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::unique_copy</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr></tbody></table></div></div><br class="table-break" /></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch31s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="parallel_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch31s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Semantics </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Design</td></tr></table></div></body></html>
+</p><div class="table"><a id="id731921"></a><p class="title"><b>Table 31.1. Parallel Algorithms</b></p><div class="table-contents"><table summary="Parallel Algorithms" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Algorithm</th><th align="left">Header</th><th align="left">Parallel algorithm</th><th align="left">Parallel header</th></tr></thead><tbody><tr><td align="left"><code class="function">std::accumulate</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="function">__gnu_parallel::accumulate</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr><tr><td align="left"><code class="function">std::adjacent_difference</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="function">__gnu_parallel::adjacent_difference</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr><tr><td align="left"><code class="function">std::inner_product</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="function">__gnu_parallel::inner_product</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr><tr><td align="left"><code class="function">std::partial_sum</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="function">__gnu_parallel::partial_sum</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr><tr><td align="left"><code class="function">std::adjacent_find</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::adjacent_find</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::count</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::count</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::count_if</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::count_if</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::equal</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::equal</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::find</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::find</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::find_if</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::find_if</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::find_first_of</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::find_first_of</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::for_each</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::for_each</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::generate</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::generate</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::generate_n</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::generate_n</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::lexicographical_compare</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::lexicographical_compare</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::mismatch</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::mismatch</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::search</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::search</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::search_n</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::search_n</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::transform</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::transform</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::replace</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::replace</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::replace_if</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::replace_if</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::max_element</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::max_element</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::merge</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::merge</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::min_element</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::min_element</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::nth_element</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::nth_element</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::partial_sort</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::partial_sort</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::partition</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::partition</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::random_shuffle</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::random_shuffle</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::set_union</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::set_union</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::set_intersection</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::set_intersection</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::set_symmetric_difference</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::set_symmetric_difference</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::set_difference</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::set_difference</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::sort</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::sort</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::stable_sort</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::stable_sort</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::unique_copy</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::unique_copy</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr></tbody></table></div></div><br class="table-break" /></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch31s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="parallel_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch31s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Semantics </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Design</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt12ch31s05.html b/libstdc++-v3/doc/html/manual/bk01pt12ch31s05.html
index 8de6c2dc633..18598fcb319 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt12ch31s05.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt12ch31s05.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Testing</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; parallel&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="parallel_mode.html" title="Chapter 31. Parallel Mode" /><link rel="prev" href="bk01pt12ch31s04.html" title="Design" /><link rel="next" href="ext_allocators.html" title="Chapter 32. Allocators" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Testing</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch31s04.html">Prev</a> </td><th width="60%" align="center">Chapter 31. Parallel Mode</th><td width="20%" align="right"> <a accesskey="n" href="ext_allocators.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.parallel_mode.test"></a>Testing</h2></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Testing</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; parallel&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="parallel_mode.html" title="Chapter 31. Parallel Mode" /><link rel="prev" href="bk01pt12ch31s04.html" title="Design" /><link rel="next" href="profile_mode.html" title="Chapter 32. Profile Mode" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Testing</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch31s04.html">Prev</a> </td><th width="60%" align="center">Chapter 31. Parallel Mode</th><td width="20%" align="right"> <a accesskey="n" href="profile_mode.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.parallel_mode.test"></a>Testing</h2></div></div></div><p>
Both the normal conformance and regression tests and the
supplemental performance tests work.
</p><p>
@@ -23,4 +23,4 @@
additional software dependencies than the usual bare-boned text
file, and can be generated by using the <code class="code">make
doc-performance</code> rule in the testsuite's Makefile.
-</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch31s04.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="parallel_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_allocators.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Design </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 32. Allocators</td></tr></table></div></body></html>
+</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch31s04.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="parallel_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="profile_mode.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Design </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 32. Profile Mode</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt12ch32s02.html b/libstdc++-v3/doc/html/manual/bk01pt12ch32s02.html
new file mode 100644
index 00000000000..70f0eef3199
--- /dev/null
+++ b/libstdc++-v3/doc/html/manual/bk01pt12ch32s02.html
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Design</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="profile_mode.html" title="Chapter 32. Profile Mode" /><link rel="prev" href="profile_mode.html" title="Chapter 32. Profile Mode" /><link rel="next" href="bk01pt12ch32s03.html" title="Extensions for Custom Containers" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="profile_mode.html">Prev</a> </td><th width="60%" align="center">Chapter 32. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch32s03.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.design"></a>Design</h2></div></div></div><p>
+</p><div class="table"><a id="id647548"></a><p class="title"><b>Table 32.1. Code Location</b></p><div class="table-contents"><table summary="Code Location" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Code Location</th><th align="left">Use</th></tr></thead><tbody><tr><td align="left"><code class="code">libstdc++-v3/include/std/*</code></td><td align="left">Preprocessor code to redirect to profile extension headers.</td></tr><tr><td align="left"><code class="code">libstdc++-v3/include/profile/*</code></td><td align="left">Profile extension public headers (map, vector, ...).</td></tr><tr><td align="left"><code class="code">libstdc++-v3/include/profile/impl/*</code></td><td align="left">Profile extension internals. Implementation files are
+ only included from <code class="code">impl/profiler.h</code>, which is the only
+ file included from the public headers.</td></tr></tbody></table></div></div><br class="table-break" /><p>
+</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.wrapper"></a>Wrapper Model</h3></div></div></div><p>
+ In order to get our instrumented library version included instead of the
+ release one,
+ we use the same wrapper model as the debug mode.
+ We subclass entities from the release version. Wherever
+ <code class="code">_GLIBCXX_PROFILE</code> is defined, the release namespace is
+ <code class="code">std::__norm</code>, whereas the profile namespace is
+ <code class="code">std::__profile</code>. Using plain <code class="code">std</code> translates
+ into <code class="code">std::__profile</code>.
+ </p><p>
+ Whenever possible, we try to wrap at the public interface level, e.g.,
+ in <code class="code">unordered_set</code> rather than in <code class="code">hashtable</code>,
+ in order not to depend on implementation.
+ </p><p>
+ Mixing object files built with and without the profile mode must
+ not affect the program execution. However, there are no guarantees to
+ the accuracy of diagnostics when using even a single object not built with
+ <code class="code">-D_GLIBCXX_PROFILE</code>.
+ Currently, mixing the profile mode with debug and parallel extensions is
+ not allowed. Mixing them at compile time will result in preprocessor errors.
+ Mixing them at link time is undefined.
+ </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.instrumentation"></a>Instrumentation</h3></div></div></div><p>
+ Instead of instrumenting every public entry and exit point,
+ we chose to add instrumentation on demand, as needed
+ by individual diagnostics.
+ The main reason is that some diagnostics require us to extract bits of
+ internal state that are particular only to that diagnostic.
+ We plan to formalize this later, after we learn more about the requirements
+ of several diagnostics.
+ </p><p>
+ All the instrumentation points can be switched on and off using
+ <code class="code">-D[_NO]_GLIBCXX_PROFILE_&lt;diagnostic&gt;</code> options.
+ With all the instrumentation calls off, there should be negligible
+ overhead over the release version. This property is needed to support
+ diagnostics based on timing of internal operations. For such diagnostics,
+ we anticipate turning most of the instrumentation off in order to prevent
+ profiling overhead from polluting time measurements, and thus diagnostics.
+ </p><p>
+ All the instrumentation on/off compile time switches live in
+ <code class="code">include/profile/profiler.h</code>.
+ </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.rtlib"></a>Run Time Behavior</h3></div></div></div><p>
+ For practical reasons, the instrumentation library processes the trace
+ partially
+ rather than dumping it to disk in raw form. Each event is processed when
+ it occurs. It is usually attached a cost and it is aggregated into
+ the database of a specific diagnostic class. The cost model
+ is based largely on the standard performance guarantees, but in some
+ cases we use knowledge about GCC's standard library implementation.
+ </p><p>
+ Information is indexed by (1) call stack and (2) instance id or address
+ to be able to understand and summarize precise creation-use-destruction
+ dynamic chains. Although the analysis is sensitive to dynamic instances,
+ the reports are only sensitive to call context. Whenever a dynamic instance
+ is destroyed, we accumulate its effect to the corresponding entry for the
+ call stack of its constructor location.
+ </p><p>
+ For details, see
+ <a class="ulink" href="http://dx.doi.org/10.1109/CGO.2009.36" target="_top">paper presented at
+ CGO 2009</a>.
+ </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.analysis"></a>Analysis and Diagnostics</h3></div></div></div><p>
+ Final analysis takes place offline, and it is based entirely on the
+ generated trace and debugging info in the application binary.
+ See section Diagnostics for a list of analysis types that we plan to support.
+ </p><p>
+ The input to the analysis is a table indexed by profile type and call stack.
+ The data type for each entry depends on the profile type.
+ </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.cost-model"></a>Cost Model</h3></div></div></div><p>
+ While it is likely that cost models become complex as we get into
+ more sophisticated analysis, we will try to follow a simple set of rules
+ at the beginning.
+ </p><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Relative benefit estimation:</em></span>
+ The idea is to estimate or measure the cost of all operations
+ in the original scenario versus the scenario we advise to switch to.
+ For instance, when advising to change a vector to a list, an occurrence
+ of the <code class="code">insert</code> method will generally count as a benefit.
+ Its magnitude depends on (1) the number of elements that get shifted
+ and (2) whether it triggers a reallocation.
+ </p></li><li><p><span class="emphasis"><em>Synthetic measurements:</em></span>
+ We will measure the relative difference between similar operations on
+ different containers. We plan to write a battery of small tests that
+ compare the times of the executions of similar methods on different
+ containers. The idea is to run these tests on the target machine.
+ If this training phase is very quick, we may decide to perform it at
+ library initialization time. The results can be cached on disk and reused
+ across runs.
+ </p></li><li><p><span class="emphasis"><em>Timers:</em></span>
+ We plan to use timers for operations of larger granularity, such as sort.
+ For instance, we can switch between different sort methods on the fly
+ and report the one that performs best for each call context.
+ </p></li><li><p><span class="emphasis"><em>Show stoppers:</em></span>
+ We may decide that the presence of an operation nullifies the advice.
+ For instance, when considering switching from <code class="code">set</code> to
+ <code class="code">unordered_set</code>, if we detect use of operator <code class="code">++</code>,
+ we will simply not issue the advice, since this could signal that the use
+ care require a sorted container.</p></li></ul></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.reports"></a>Reports</h3></div></div></div><p>
+There are two types of reports. First, if we recognize a pattern for which
+we have a substitute that is likely to give better performance, we print
+the advice and estimated performance gain. The advice is usually associated
+to a code position and possibly a call stack.
+ </p><p>
+Second, we report performance characteristics for which we do not have
+a clear solution for improvement. For instance, we can point to the user
+the top 10 <code class="code">multimap</code> locations
+which have the worst data locality in actual traversals.
+Although this does not offer a solution,
+it helps the user focus on the key problems and ignore the uninteresting ones.
+ </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.testing"></a>Testing</h3></div></div></div><p>
+ First, we want to make sure we preserve the behavior of the release mode.
+ You can just type <code class="code">"make check-profile"</code>, which
+ builds and runs the whole test suite in profile mode.
+ </p><p>
+ Second, we want to test the correctness of each diagnostic.
+ We created a <code class="code">profile</code> directory in the test suite.
+ Each diagnostic must come with at least two tests, one for false positives
+ and one for false negatives.
+ </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="profile_mode.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="profile_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch32s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 32. Profile Mode </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Extensions for Custom Containers</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt12ch32s03.html b/libstdc++-v3/doc/html/manual/bk01pt12ch32s03.html
new file mode 100644
index 00000000000..36aaf9392da
--- /dev/null
+++ b/libstdc++-v3/doc/html/manual/bk01pt12ch32s03.html
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Extensions for Custom Containers</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="profile_mode.html" title="Chapter 32. Profile Mode" /><link rel="prev" href="bk01pt12ch32s02.html" title="Design" /><link rel="next" href="bk01pt12ch32s04.html" title="Empirical Cost Model" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Extensions for Custom Containers</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch32s02.html">Prev</a> </td><th width="60%" align="center">Chapter 32. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch32s04.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.api"></a>Extensions for Custom Containers</h2></div></div></div><p>
+ Many large projects use their own data structures instead of the ones in the
+ standard library. If these data structures are similar in functionality
+ to the standard library, they can be instrumented with the same hooks
+ that are used to instrument the standard library.
+ The instrumentation API is exposed in file
+ <code class="code">profiler.h</code> (look for "Instrumentation hooks").
+ </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch32s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="profile_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch32s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Design </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Empirical Cost Model</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt12ch32s04.html b/libstdc++-v3/doc/html/manual/bk01pt12ch32s04.html
new file mode 100644
index 00000000000..4246904d4fe
--- /dev/null
+++ b/libstdc++-v3/doc/html/manual/bk01pt12ch32s04.html
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Empirical Cost Model</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="profile_mode.html" title="Chapter 32. Profile Mode" /><link rel="prev" href="bk01pt12ch32s03.html" title="Extensions for Custom Containers" /><link rel="next" href="bk01pt12ch32s05.html" title="Implementation Issues" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Empirical Cost Model</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch32s03.html">Prev</a> </td><th width="60%" align="center">Chapter 32. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch32s05.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.cost_model"></a>Empirical Cost Model</h2></div></div></div><p>
+ Currently, the cost model uses formulas with predefined relative weights
+ for alternative containers or container implementations. For instance,
+ iterating through a vector is X times faster than iterating through a list.
+ </p><p>
+ (Under development.)
+ We are working on customizing this to a particular machine by providing
+ an automated way to compute the actual relative weights for operations
+ on the given machine.
+ </p><p>
+ (Under development.)
+ We plan to provide a performance parameter database format that can be
+ filled in either by hand or by an automated training mechanism.
+ The analysis module will then use this database instead of the built in.
+ generic parameters.
+ </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch32s03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="profile_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch32s05.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Extensions for Custom Containers </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Implementation Issues</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt12ch32s05.html b/libstdc++-v3/doc/html/manual/bk01pt12ch32s05.html
new file mode 100644
index 00000000000..42fae0c1ed6
--- /dev/null
+++ b/libstdc++-v3/doc/html/manual/bk01pt12ch32s05.html
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Implementation Issues</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="profile_mode.html" title="Chapter 32. Profile Mode" /><link rel="prev" href="bk01pt12ch32s04.html" title="Empirical Cost Model" /><link rel="next" href="bk01pt12ch32s06.html" title="Developer Information" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation Issues</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch32s04.html">Prev</a> </td><th width="60%" align="center">Chapter 32. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch32s06.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.implementation"></a>Implementation Issues</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.stack"></a>Stack Traces</h3></div></div></div><p>
+ Accurate stack traces are needed during profiling since we group events by
+ call context and dynamic instance. Without accurate traces, diagnostics
+ may be hard to interpret. For instance, when giving advice to the user
+ it is imperative to reference application code, not library code.
+ </p><p>
+ Currently we are using the libc <code class="code">backtrace</code> routine to get
+ stack traces.
+ <code class="code">_GLIBCXX_PROFILE_STACK_DEPTH</code> can be set
+ to 0 if you are willing to give up call context information, or to a small
+ positive value to reduce run time overhead.
+ </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.symbols"></a>Symbolization of Instruction Addresses</h3></div></div></div><p>
+ The profiling and analysis phases use only instruction addresses.
+ An external utility such as addr2line is needed to postprocess the result.
+ We do not plan to add symbolization support in the profile extension.
+ This would require access to symbol tables, debug information tables,
+ external programs or libraries and other system dependent information.
+ </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.concurrency"></a>Concurrency</h3></div></div></div><p>
+ Our current model is simplistic, but precise.
+ We cannot afford to approximate because some of our diagnostics require
+ precise matching of operations to container instance and call context.
+ During profiling, we keep a single information table per diagnostic.
+ There is a single lock per information table.
+ </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.stdlib-in-proflib"></a>Using the Standard Library in the Instrumentation Implementation</h3></div></div></div><p>
+ As much as we would like to avoid uses of stdlibc++ within our
+ instrumentation library, containers such as unordered_map are very
+ appealing. We plan to use them as long as they are named properly
+ to avoid ambiguity.
+ </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.malloc-hooks"></a>Malloc Hooks</h3></div></div></div><p>
+ User applications/libraries can provide malloc hooks.
+ When the implementation of the malloc hooks uses stdlibc++, there can
+ be an infinite cycle between the profile mode instrumentation and the
+ the malloc hook code.
+ </p><p>
+ We protect against reentrance to the profile mode instrumentation code,
+ which should avoid this problem in most cases.
+ The protection mechanism is thread safe and exception safe.
+ This mechanism does not prevent reentrance to the malloc hook itself,
+ which could still result in deadlock, if, for instance, the malloc hook
+ uses non-recursive locks.
+ XXX: A definitive solution to this problem would be for the profile extension
+ to use a custom allocator internally, and perhaps not to use libstdc++.
+ </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.construction-destruction"></a>Construction and Destruction of Global Objects</h3></div></div></div><p>
+ The profiling library state is initialized at the first call to a profiling
+ method. This allows us to record the construction of all global objects.
+ However, we cannot do the same at destruction time. The trace is written
+ by a function registered by <code class="code">atexit</code>, thus invoked by
+ <code class="code">exit</code>.
+ </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch32s04.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="profile_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch32s06.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Empirical Cost Model </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Developer Information</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt12ch32s06.html b/libstdc++-v3/doc/html/manual/bk01pt12ch32s06.html
new file mode 100644
index 00000000000..475b2d4fffc
--- /dev/null
+++ b/libstdc++-v3/doc/html/manual/bk01pt12ch32s06.html
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Developer Information</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="profile_mode.html" title="Chapter 32. Profile Mode" /><link rel="prev" href="bk01pt12ch32s05.html" title="Implementation Issues" /><link rel="next" href="bk01pt12ch32s07.html" title="Diagnostics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Developer Information</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch32s05.html">Prev</a> </td><th width="60%" align="center">Chapter 32. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch32s07.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.developer"></a>Developer Information</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.developer.bigpic"></a>Big Picture</h3></div></div></div><p>The profile mode headers are included with
+ <code class="code">-D_GLIBCXX_PROFILE</code> through preprocessor directives in
+ <code class="code">include/std/*</code>.
+ </p><p>Instrumented implementations are provided in
+ <code class="code">include/profile/*</code>. All instrumentation hooks are macros
+ defined in <code class="code">include/profile/profiler.h</code>.
+ </p><p>All the implementation of the instrumentation hooks is in
+ <code class="code">include/profile/impl/*</code>. Although all the code gets included,
+ thus is publicly visible, only a small number of functions are called from
+ outside this directory. All calls to hook implementations must be
+ done through macros defined in <code class="code">profiler.h</code>. The macro
+ must ensure (1) that the call is guarded against reentrance and
+ (2) that the call can be turned off at compile time using a
+ <code class="code">-D_GLIBCXX_PROFILE_...</code> compiler option.
+ </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.developer.howto"></a>How To Add A Diagnostic</h3></div></div></div><p>Let's say the diagnostic name is "magic".
+ </p><p>If you need to instrument a header not already under
+ <code class="code">include/profile/*</code>, first edit the corresponding header
+ under <code class="code">include/std/</code> and add a preprocessor directive such
+ as the one in <code class="code">include/std/vector</code>:
+</p><pre class="programlisting">
+#ifdef _GLIBCXX_PROFILE
+# include &lt;profile/vector&gt;
+#endif
+</pre><p>
+ </p><p>If the file you need to instrument is not yet under
+ <code class="code">include/profile/</code>, make a copy of the one in
+ <code class="code">include/debug</code>, or the main implementation.
+ You'll need to include the main implementation and inherit the classes
+ you want to instrument. Then define the methods you want to instrument,
+ define the instrumentation hooks and add calls to them.
+ Look at <code class="code">include/profile/vector</code> for an example.
+ </p><p>Add macros for the instrumentation hooks in
+ <code class="code">include/profile/impl/profiler.h</code>.
+ Hook names must start with <code class="code">__profcxx_</code>.
+ Make sure they transform
+ in no code with <code class="code">-D_NO_GLBICXX_PROFILE_MAGIC</code>.
+ Make sure all calls to any method in namespace <code class="code">__cxxprof_impl</code>
+ is protected against reentrance using macro
+ <code class="code">_GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD</code>.
+ All names of methods in namespace <code class="code">__cxxprof_impl</code> called from
+ <code class="code">profiler.h</code> must start with <code class="code">__trace_magic_</code>.
+ </p><p>Add the implementation of the diagnostic.
+ </p><div class="itemizedlist"><ul type="disc"><li><p>
+ Create new file <code class="code">include/profile/impl/profiler_magic.h</code>.
+ </p></li><li><p>
+ Define class <code class="code">__magic_info: public __object_info_base</code>.
+ This is the representation of a line in the object table.
+ The <code class="code">__merge</code> method is used to aggregate information
+ across all dynamic instances created at the same call context.
+ The <code class="code">__magnitude</code> must return the estimation of the benefit
+ as a number of small operations, e.g., number of words copied.
+ The <code class="code">__write</code> method is used to produce the raw trace.
+ The <code class="code">__advice</code> method is used to produce the advice string.
+ </p></li><li><p>
+ Define class <code class="code">__magic_stack_info: public __magic_info</code>.
+ This defines the content of a line in the stack table.
+ </p></li><li><p>
+ Define class <code class="code">__trace_magic: public __trace_base&lt;__magic_info,
+ __magic_stack_info&gt;</code>.
+ It defines the content of the trace associated with this diagnostic.
+ </p></li></ul></div><p>
+ </p><p>Add initialization and reporting calls in
+ <code class="code">include/profile/impl/profiler_trace.h</code>. Use
+ <code class="code">__trace_vector_to_list</code> as an example.
+ </p><p>Add documentation in file <code class="code">doc/xml/manual/profile_mode.xml</code>.
+ </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch32s05.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="profile_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch32s07.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Implementation Issues </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Diagnostics</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt12ch32s07.html b/libstdc++-v3/doc/html/manual/bk01pt12ch32s07.html
new file mode 100644
index 00000000000..cbe09f0f19d
--- /dev/null
+++ b/libstdc++-v3/doc/html/manual/bk01pt12ch32s07.html
@@ -0,0 +1,528 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Diagnostics</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="profile_mode.html" title="Chapter 32. Profile Mode" /><link rel="prev" href="bk01pt12ch32s06.html" title="Developer Information" /><link rel="next" href="ext_allocators.html" title="Chapter 33. Allocators" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Diagnostics</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch32s06.html">Prev</a> </td><th width="60%" align="center">Chapter 32. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="ext_allocators.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.diagnostics"></a>Diagnostics</h2></div></div></div><p>
+ The table below presents all the diagnostics we intend to implement.
+ Each diagnostic has a corresponding compile time switch
+ <code class="code">-D_GLIBCXX_PROFILE_&lt;diagnostic&gt;</code>.
+ Groups of related diagnostics can be turned on with a single switch.
+ For instance, <code class="code">-D_GLIBCXX_PROFILE_LOCALITY</code> is equivalent to
+ <code class="code">-D_GLIBCXX_PROFILE_SOFTWARE_PREFETCH
+ -D_GLIBCXX_PROFILE_RBTREE_LOCALITY</code>.
+ </p><p>
+ The benefit, cost, expected frequency and accuracy of each diagnostic
+ was given a grade from 1 to 10, where 10 is highest.
+ A high benefit means that, if the diagnostic is accurate, the expected
+ performance improvement is high.
+ A high cost means that turning this diagnostic on leads to high slowdown.
+ A high frequency means that we expect this to occur relatively often.
+ A high accuracy means that the diagnostic is unlikely to be wrong.
+ These grades are not perfect. They are just meant to guide users with
+ specific needs or time budgets.
+ </p><div class="table"><a id="id521055"></a><p class="title"><b>Table 32.2. Diagnostics</b></p><div class="table-contents"><table summary="Diagnostics" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Group</th><th align="left">Flag</th><th align="left">Benefit</th><th align="left">Cost</th><th align="left">Freq.</th><th align="left">Implemented</th></tr></thead><tbody><tr><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.containers" target="_top">
+ CONTAINERS</a></td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.hashtable_too_small" target="_top">
+ HASHTABLE_TOO_SMALL</a></td><td align="left">10</td><td align="left">1</td><td align="left"> </td><td align="left">10</td><td align="left">yes</td></tr><tr><td align="left"> </td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.hashtable_too_large" target="_top">
+ HASHTABLE_TOO_LARGE</a></td><td align="left">5</td><td align="left">1</td><td align="left"> </td><td align="left">10</td><td align="left">yes</td></tr><tr><td align="left"> </td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.inefficient_hash" target="_top">
+ INEFFICIENT_HASH</a></td><td align="left">7</td><td align="left">3</td><td align="left"> </td><td align="left">10</td><td align="left">yes</td></tr><tr><td align="left"> </td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.vector_too_small" target="_top">
+ VECTOR_TOO_SMALL</a></td><td align="left">8</td><td align="left">1</td><td align="left"> </td><td align="left">10</td><td align="left">yes</td></tr><tr><td align="left"> </td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.vector_too_large" target="_top">
+ VECTOR_TOO_LARGE</a></td><td align="left">5</td><td align="left">1</td><td align="left"> </td><td align="left">10</td><td align="left">yes</td></tr><tr><td align="left"> </td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.vector_to_hashtable" target="_top">
+ VECTOR_TO_HASHTABLE</a></td><td align="left">7</td><td align="left">7</td><td align="left"> </td><td align="left">10</td><td align="left">no</td></tr><tr><td align="left"> </td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.hashtable_to_vector" target="_top">
+ HASHTABLE_TO_VECTOR</a></td><td align="left">7</td><td align="left">7</td><td align="left"> </td><td align="left">10</td><td align="left">no</td></tr><tr><td align="left"> </td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.vector_to_list" target="_top">
+ VECTOR_TO_LIST</a></td><td align="left">8</td><td align="left">5</td><td align="left"> </td><td align="left">10</td><td align="left">yes</td></tr><tr><td align="left"> </td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.list_to_vector" target="_top">
+ LIST_TO_VECTOR</a></td><td align="left">10</td><td align="left">5</td><td align="left"> </td><td align="left">10</td><td align="left">no</td></tr><tr><td align="left"> </td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.assoc_ord_to_unord" target="_top">
+ ORDERED_TO_UNORDERED</a></td><td align="left">10</td><td align="left">5</td><td align="left"> </td><td align="left">10</td><td align="left">only map/unordered_map</td></tr><tr><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.algorithms" target="_top">
+ ALGORITHMS</a></td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.algorithms.sort" target="_top">
+ SORT</a></td><td align="left">7</td><td align="left">8</td><td align="left"> </td><td align="left">7</td><td align="left">no</td></tr><tr><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.locality" target="_top">
+ LOCALITY</a></td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.locality.sw_prefetch" target="_top">
+ SOFTWARE_PREFETCH</a></td><td align="left">8</td><td align="left">8</td><td align="left"> </td><td align="left">5</td><td align="left">no</td></tr><tr><td align="left"> </td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.locality.linked" target="_top">
+ RBTREE_LOCALITY</a></td><td align="left">4</td><td align="left">8</td><td align="left"> </td><td align="left">5</td><td align="left">no</td></tr><tr><td align="left"> </td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.mthread.false_share" target="_top">
+ FALSE_SHARING</a></td><td align="left">8</td><td align="left">10</td><td align="left"> </td><td align="left">10</td><td align="left">no</td></tr></tbody></table></div></div><br class="table-break" /><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.analysis.template"></a>Diagnostic Template</h3></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span>
+ <code class="code">_GLIBCXX_PROFILE_&lt;diagnostic&gt;</code>.
+ </p></li><li><p><span class="emphasis"><em>Goal:</em></span> What problem will it diagnose?
+ </p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span>.
+ What is the fundamental reason why this is a problem</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>
+ Percentage reduction in execution time. When reduction is more than
+ a constant factor, describe the reduction rate formula.
+ </p></li><li><p><span class="emphasis"><em>Recommendation:</em></span>
+ What would the advise look like?</p></li><li><p><span class="emphasis"><em>To instrument:</em></span>
+ What stdlibc++ components need to be instrumented?</p></li><li><p><span class="emphasis"><em>Analysis:</em></span>
+ How do we decide when to issue the advice?</p></li><li><p><span class="emphasis"><em>Cost model:</em></span>
+ How do we measure benefits? Math goes here.</p></li><li><p><span class="emphasis"><em>Example:</em></span>
+</p><pre class="programlisting">
+program code
+...
+advice sample
+</pre><p>
+</p></li></ul></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.analysis.containers"></a>Containers</h3></div></div></div><p>
+<span class="emphasis"><em>Switch:</em></span>
+ <code class="code">_GLIBCXX_PROFILE_CONTAINERS</code>.
+</p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.hashtable_too_small"></a>Hashtable Too Small</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span>
+ <code class="code">_GLIBCXX_PROFILE_HASHTABLE_TOO_SMALL</code>.
+ </p></li><li><p><span class="emphasis"><em>Goal:</em></span> Detect hashtables with many
+ rehash operations, small construction size and large destruction size.
+ </p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span> Rehash is very expensive.
+ Read content, follow chains within bucket, evaluate hash function, place at
+ new location in different order.</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span> 36%.
+ Code similar to example below.
+ </p></li><li><p><span class="emphasis"><em>Recommendation:</em></span>
+ Set initial size to N at construction site S.
+ </p></li><li><p><span class="emphasis"><em>To instrument:</em></span>
+ <code class="code">unordered_set, unordered_map</code> constructor, destructor, rehash.
+ </p></li><li><p><span class="emphasis"><em>Analysis:</em></span>
+ For each dynamic instance of <code class="code">unordered_[multi]set|map</code>,
+ record initial size and call context of the constructor.
+ Record size increase, if any, after each relevant operation such as insert.
+ Record the estimated rehash cost.</p></li><li><p><span class="emphasis"><em>Cost model:</em></span>
+ Number of individual rehash operations * cost per rehash.</p></li><li><p><span class="emphasis"><em>Example:</em></span>
+</p><pre class="programlisting">
+1 unordered_set&lt;int&gt; us;
+2 for (int k = 0; k &lt; 1000000; ++k) {
+3 us.insert(k);
+4 }
+
+foo.cc:1: advice: Changing initial unordered_set size from 10 to 1000000 saves 1025530 rehash operations.
+</pre><p>
+</p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.hashtable_too_large"></a>Hashtable Too Large</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span>
+ <code class="code">_GLIBCXX_PROFILE_HASHTABLE_TOO_LARGE</code>.
+ </p></li><li><p><span class="emphasis"><em>Goal:</em></span> Detect hashtables which are
+ never filled up because fewer elements than reserved are ever
+ inserted.
+ </p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span> Save memory, which
+ is good in itself and may also improve memory reference performance through
+ fewer cache and TLB misses.</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span> unknown.
+ </p></li><li><p><span class="emphasis"><em>Recommendation:</em></span>
+ Set initial size to N at construction site S.
+ </p></li><li><p><span class="emphasis"><em>To instrument:</em></span>
+ <code class="code">unordered_set, unordered_map</code> constructor, destructor, rehash.
+ </p></li><li><p><span class="emphasis"><em>Analysis:</em></span>
+ For each dynamic instance of <code class="code">unordered_[multi]set|map</code>,
+ record initial size and call context of the constructor, and correlate it
+ with its size at destruction time.
+ </p></li><li><p><span class="emphasis"><em>Cost model:</em></span>
+ Number of iteration operations + memory saved.</p></li><li><p><span class="emphasis"><em>Example:</em></span>
+</p><pre class="programlisting">
+1 vector&lt;unordered_set&lt;int&gt;&gt; v(100000, unordered_set&lt;int&gt;(100)) ;
+2 for (int k = 0; k &lt; 100000; ++k) {
+3 for (int j = 0; j &lt; 10; ++j) {
+4 v[k].insert(k + j);
+5 }
+6 }
+
+foo.cc:1: advice: Changing initial unordered_set size from 100 to 10 saves N
+bytes of memory and M iteration steps.
+</pre><p>
+</p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.inefficient_hash"></a>Inefficient Hash</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span>
+ <code class="code">_GLIBCXX_PROFILE_INEFFICIENT_HASH</code>.
+ </p></li><li><p><span class="emphasis"><em>Goal:</em></span> Detect hashtables with polarized
+ distribution.
+ </p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span> A non-uniform
+ distribution may lead to long chains, thus possibly increasing complexity
+ by a factor up to the number of elements.
+ </p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span> factor up
+ to container size.
+ </p></li><li><p><span class="emphasis"><em>Recommendation:</em></span> Change hash function
+ for container built at site S. Distribution score = N. Access score = S.
+ Longest chain = C, in bucket B.
+ </p></li><li><p><span class="emphasis"><em>To instrument:</em></span>
+ <code class="code">unordered_set, unordered_map</code> constructor, destructor, [],
+ insert, iterator.
+ </p></li><li><p><span class="emphasis"><em>Analysis:</em></span>
+ Count the exact number of link traversals.
+ </p></li><li><p><span class="emphasis"><em>Cost model:</em></span>
+ Total number of links traversed.</p></li><li><p><span class="emphasis"><em>Example:</em></span>
+</p><pre class="programlisting">
+class dumb_hash {
+ public:
+ size_t operator() (int i) const { return 0; }
+};
+...
+ unordered_set&lt;int, dumb_hash&gt; hs;
+ ...
+ for (int i = 0; i &lt; COUNT; ++i) {
+ hs.find(i);
+ }
+</pre><p>
+</p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.vector_too_small"></a>Vector Too Small</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span>
+ <code class="code">_GLIBCXX_PROFILE_VECTOR_TOO_SMALL</code>.
+ </p></li><li><p><span class="emphasis"><em>Goal:</em></span>Detect vectors with many
+ resize operations, small construction size and large destruction size..
+ </p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span>Resizing can be expensive.
+ Copying large amounts of data takes time. Resizing many small vectors may
+ have allocation overhead and affect locality.</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>%.
+ </p></li><li><p><span class="emphasis"><em>Recommendation:</em></span>
+ Set initial size to N at construction site S.</p></li><li><p><span class="emphasis"><em>To instrument:</em></span><code class="code">vector</code>.
+ </p></li><li><p><span class="emphasis"><em>Analysis:</em></span>
+ For each dynamic instance of <code class="code">vector</code>,
+ record initial size and call context of the constructor.
+ Record size increase, if any, after each relevant operation such as
+ <code class="code">push_back</code>. Record the estimated resize cost.
+ </p></li><li><p><span class="emphasis"><em>Cost model:</em></span>
+ Total number of words copied * time to copy a word.</p></li><li><p><span class="emphasis"><em>Example:</em></span>
+</p><pre class="programlisting">
+1 vector&lt;int&gt; v;
+2 for (int k = 0; k &lt; 1000000; ++k) {
+3 v.push_back(k);
+4 }
+
+foo.cc:1: advice: Changing initial vector size from 10 to 1000000 saves
+copying 4000000 bytes and 20 memory allocations and deallocations.
+</pre><p>
+</p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.vector_too_large"></a>Vector Too Large</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span>
+ <code class="code">_GLIBCXX_PROFILE_VECTOR_TOO_LARGE</code>
+ </p></li><li><p><span class="emphasis"><em>Goal:</em></span>Detect vectors which are
+ never filled up because fewer elements than reserved are ever
+ inserted.
+ </p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span>Save memory, which
+ is good in itself and may also improve memory reference performance through
+ fewer cache and TLB misses.</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>%.
+ </p></li><li><p><span class="emphasis"><em>Recommendation:</em></span>
+ Set initial size to N at construction site S.</p></li><li><p><span class="emphasis"><em>To instrument:</em></span><code class="code">vector</code>.
+ </p></li><li><p><span class="emphasis"><em>Analysis:</em></span>
+ For each dynamic instance of <code class="code">vector</code>,
+ record initial size and call context of the constructor, and correlate it
+ with its size at destruction time.</p></li><li><p><span class="emphasis"><em>Cost model:</em></span>
+ Total amount of memory saved.</p></li><li><p><span class="emphasis"><em>Example:</em></span>
+</p><pre class="programlisting">
+1 vector&lt;vector&lt;int&gt;&gt; v(100000, vector&lt;int&gt;(100)) ;
+2 for (int k = 0; k &lt; 100000; ++k) {
+3 for (int j = 0; j &lt; 10; ++j) {
+4 v[k].insert(k + j);
+5 }
+6 }
+
+foo.cc:1: advice: Changing initial vector size from 100 to 10 saves N
+bytes of memory and may reduce the number of cache and TLB misses.
+</pre><p>
+</p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.vector_to_hashtable"></a>Vector to Hashtable</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span>
+ <code class="code">_GLIBCXX_PROFILE_VECTOR_TO_HASHTABLE</code>.
+ </p></li><li><p><span class="emphasis"><em>Goal:</em></span> Detect uses of
+ <code class="code">vector</code> that can be substituted with <code class="code">unordered_set</code>
+ to reduce execution time.
+ </p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span>
+ Linear search in a vector is very expensive, whereas searching in a hashtable
+ is very quick.</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>factor up
+ to container size.
+ </p></li><li><p><span class="emphasis"><em>Recommendation:</em></span>Replace
+ <code class="code">vector</code> with <code class="code">unordered_set</code> at site S.
+ </p></li><li><p><span class="emphasis"><em>To instrument:</em></span><code class="code">vector</code>
+ operations and access methods.</p></li><li><p><span class="emphasis"><em>Analysis:</em></span>
+ For each dynamic instance of <code class="code">vector</code>,
+ record call context of the constructor. Issue the advice only if the
+ only methods called on this <code class="code">vector</code> are <code class="code">push_back</code>,
+ <code class="code">insert</code> and <code class="code">find</code>.
+ </p></li><li><p><span class="emphasis"><em>Cost model:</em></span>
+ Cost(vector::push_back) + cost(vector::insert) + cost(find, vector) -
+ cost(unordered_set::insert) + cost(unordered_set::find).
+ </p></li><li><p><span class="emphasis"><em>Example:</em></span>
+</p><pre class="programlisting">
+1 vector&lt;int&gt; v;
+...
+2 for (int i = 0; i &lt; 1000; ++i) {
+3 find(v.begin(), v.end(), i);
+4 }
+
+foo.cc:1: advice: Changing "vector" to "unordered_set" will save about 500,000
+comparisons.
+</pre><p>
+</p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.hashtable_to_vector"></a>Hashtable to Vector</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span>
+ <code class="code">_GLIBCXX_PROFILE_HASHTABLE_TO_VECTOR</code>.
+ </p></li><li><p><span class="emphasis"><em>Goal:</em></span> Detect uses of
+ <code class="code">unordered_set</code> that can be substituted with <code class="code">vector</code>
+ to reduce execution time.
+ </p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span>
+ Hashtable iterator is slower than vector iterator.</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>95%.
+ </p></li><li><p><span class="emphasis"><em>Recommendation:</em></span>Replace
+ <code class="code">unordered_set</code> with <code class="code">vector</code> at site S.
+ </p></li><li><p><span class="emphasis"><em>To instrument:</em></span><code class="code">unordered_set</code>
+ operations and access methods.</p></li><li><p><span class="emphasis"><em>Analysis:</em></span>
+ For each dynamic instance of <code class="code">unordered_set</code>,
+ record call context of the constructor. Issue the advice only if the
+ number of <code class="code">find</code>, <code class="code">insert</code> and <code class="code">[]</code>
+ operations on this <code class="code">unordered_set</code> are small relative to the
+ number of elements, and methods <code class="code">begin</code> or <code class="code">end</code>
+ are invoked (suggesting iteration).</p></li><li><p><span class="emphasis"><em>Cost model:</em></span>
+ Number of .</p></li><li><p><span class="emphasis"><em>Example:</em></span>
+</p><pre class="programlisting">
+1 unordered_set&lt;int&gt; us;
+...
+2 int s = 0;
+3 for (unordered_set&lt;int&gt;::iterator it = us.begin(); it != us.end(); ++it) {
+4 s += *it;
+5 }
+
+foo.cc:1: advice: Changing "unordered_set" to "vector" will save about N
+indirections and may achieve better data locality.
+</pre><p>
+</p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.vector_to_list"></a>Vector to List</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span>
+ <code class="code">_GLIBCXX_PROFILE_VECTOR_TO_LIST</code>.
+ </p></li><li><p><span class="emphasis"><em>Goal:</em></span> Detect cases where
+ <code class="code">vector</code> could be substituted with <code class="code">list</code> for
+ better performance.
+ </p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span>
+ Inserting in the middle of a vector is expensive compared to inserting in a
+ list.
+ </p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>factor up to
+ container size.
+ </p></li><li><p><span class="emphasis"><em>Recommendation:</em></span>Replace vector with list
+ at site S.</p></li><li><p><span class="emphasis"><em>To instrument:</em></span><code class="code">vector</code>
+ operations and access methods.</p></li><li><p><span class="emphasis"><em>Analysis:</em></span>
+ For each dynamic instance of <code class="code">vector</code>,
+ record the call context of the constructor. Record the overhead of each
+ <code class="code">insert</code> operation based on current size and insert position.
+ Report instance with high insertion overhead.
+ </p></li><li><p><span class="emphasis"><em>Cost model:</em></span>
+ (Sum(cost(vector::method)) - Sum(cost(list::method)), for
+ method in [push_back, insert, erase])
+ + (Cost(iterate vector) - Cost(iterate list))</p></li><li><p><span class="emphasis"><em>Example:</em></span>
+</p><pre class="programlisting">
+1 vector&lt;int&gt; v;
+2 for (int i = 0; i &lt; 10000; ++i) {
+3 v.insert(v.begin(), i);
+4 }
+
+foo.cc:1: advice: Changing "vector" to "list" will save about 5,000,000
+operations.
+</pre><p>
+</p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.list_to_vector"></a>List to Vector</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span>
+ <code class="code">_GLIBCXX_PROFILE_LIST_TO_VECTOR</code>.
+ </p></li><li><p><span class="emphasis"><em>Goal:</em></span> Detect cases where
+ <code class="code">list</code> could be substituted with <code class="code">vector</code> for
+ better performance.
+ </p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span>
+ Iterating through a vector is faster than through a list.
+ </p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>64%.
+ </p></li><li><p><span class="emphasis"><em>Recommendation:</em></span>Replace list with vector
+ at site S.</p></li><li><p><span class="emphasis"><em>To instrument:</em></span><code class="code">vector</code>
+ operations and access methods.</p></li><li><p><span class="emphasis"><em>Analysis:</em></span>
+ Issue the advice if there are no <code class="code">insert</code> operations.
+ </p></li><li><p><span class="emphasis"><em>Cost model:</em></span>
+ (Sum(cost(vector::method)) - Sum(cost(list::method)), for
+ method in [push_back, insert, erase])
+ + (Cost(iterate vector) - Cost(iterate list))</p></li><li><p><span class="emphasis"><em>Example:</em></span>
+</p><pre class="programlisting">
+1 list&lt;int&gt; l;
+...
+2 int sum = 0;
+3 for (list&lt;int&gt;::iterator it = l.begin(); it != l.end(); ++it) {
+4 sum += *it;
+5 }
+
+foo.cc:1: advice: Changing "list" to "vector" will save about 1000000 indirect
+memory references.
+</pre><p>
+</p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.assoc_ord_to_unord"></a>Ordered to Unordered Associative Container</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span>
+ <code class="code">_GLIBCXX_PROFILE_ORDERED_TO_UNORDERED</code>.
+ </p></li><li><p><span class="emphasis"><em>Goal:</em></span> Detect cases where ordered
+ associative containers can be replaced with unordered ones.
+ </p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span>
+ Insert and search are quicker in a hashtable than in
+ a red-black tree.</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>52%.
+ </p></li><li><p><span class="emphasis"><em>Recommendation:</em></span>
+ Replace set with unordered_set at site S.</p></li><li><p><span class="emphasis"><em>To instrument:</em></span>
+ <code class="code">set</code>, <code class="code">multiset</code>, <code class="code">map</code>,
+ <code class="code">multimap</code> methods.</p></li><li><p><span class="emphasis"><em>Analysis:</em></span>
+ Issue the advice only if we are not using operator <code class="code">++</code> on any
+ iterator on a particular <code class="code">[multi]set|map</code>.
+ </p></li><li><p><span class="emphasis"><em>Cost model:</em></span>
+ (Sum(cost(hashtable::method)) - Sum(cost(rbtree::method)), for
+ method in [insert, erase, find])
+ + (Cost(iterate hashtable) - Cost(iterate rbtree))</p></li><li><p><span class="emphasis"><em>Example:</em></span>
+</p><pre class="programlisting">
+1 set&lt;int&gt; s;
+2 for (int i = 0; i &lt; 100000; ++i) {
+3 s.insert(i);
+4 }
+5 int sum = 0;
+6 for (int i = 0; i &lt; 100000; ++i) {
+7 sum += *s.find(i);
+8 }
+</pre><p>
+</p></li></ul></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.analysis.algorithms"></a>Algorithms</h3></div></div></div><p><span class="emphasis"><em>Switch:</em></span>
+ <code class="code">_GLIBCXX_PROFILE_ALGORITHMS</code>.
+ </p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.algorithms.sort"></a>Sort Algorithm Performance</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span>
+ <code class="code">_GLIBCXX_PROFILE_SORT</code>.
+ </p></li><li><p><span class="emphasis"><em>Goal:</em></span> Give measure of sort algorithm
+ performance based on actual input. For instance, advise Radix Sort over
+ Quick Sort for a particular call context.
+ </p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span>
+ See papers:
+ <a class="ulink" href="http://portal.acm.org/citation.cfm?doid=1065944.1065981" target="_top">
+ A framework for adaptive algorithm selection in STAPL</a> and
+ <a class="ulink" href="http://ieeexplore.ieee.org/search/wrapper.jsp?arnumber=4228227" target="_top">
+ Optimizing Sorting with Machine Learning Algorithms</a>.
+ </p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>60%.
+ </p></li><li><p><span class="emphasis"><em>Recommendation:</em></span> Change sort algorithm
+ at site S from X Sort to Y Sort.</p></li><li><p><span class="emphasis"><em>To instrument:</em></span> <code class="code">sort</code>
+ algorithm.</p></li><li><p><span class="emphasis"><em>Analysis:</em></span>
+ Issue the advice if the cost model tells us that another sort algorithm
+ would do better on this input. Requires us to know what algorithm we
+ are using in our sort implementation in release mode.</p></li><li><p><span class="emphasis"><em>Cost model:</em></span>
+ Runtime(algo) for algo in [radix, quick, merge, ...]</p></li><li><p><span class="emphasis"><em>Example:</em></span>
+</p><pre class="programlisting">
+</pre><p>
+</p></li></ul></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.analysis.locality"></a>Data Locality</h3></div></div></div><p><span class="emphasis"><em>Switch:</em></span>
+ <code class="code">_GLIBCXX_PROFILE_LOCALITY</code>.
+ </p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.locality.sw_prefetch"></a>Need Software Prefetch</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span>
+ <code class="code">_GLIBCXX_PROFILE_SOFTWARE_PREFETCH</code>.
+ </p></li><li><p><span class="emphasis"><em>Goal:</em></span> Discover sequences of indirect
+ memory accesses that are not regular, thus cannot be predicted by
+ hardware prefetchers.
+ </p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span>
+ Indirect references are hard to predict and are very expensive when they
+ miss in caches.</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>25%.
+ </p></li><li><p><span class="emphasis"><em>Recommendation:</em></span> Insert prefetch
+ instruction.</p></li><li><p><span class="emphasis"><em>To instrument:</em></span> Vector iterator and
+ access operator [].
+ </p></li><li><p><span class="emphasis"><em>Analysis:</em></span>
+ First, get cache line size and page size from system.
+ Then record iterator dereference sequences for which the value is a pointer.
+ For each sequence within a container, issue a warning if successive pointer
+ addresses are not within cache lines and do not form a linear pattern
+ (otherwise they may be prefetched by hardware).
+ If they also step across page boundaries, make the warning stronger.
+ </p><p>The same analysis applies to containers other than vector.
+ However, we cannot give the same advice for linked structures, such as list,
+ as there is no random access to the n-th element. The user may still be
+ able to benefit from this information, for instance by employing frays (user
+ level light weight threads) to hide the latency of chasing pointers.
+ </p><p>
+ This analysis is a little oversimplified. A better cost model could be
+ created by understanding the capability of the hardware prefetcher.
+ This model could be trained automatically by running a set of synthetic
+ cases.
+ </p></li><li><p><span class="emphasis"><em>Cost model:</em></span>
+ Total distance between pointer values of successive elements in vectors
+ of pointers.</p></li><li><p><span class="emphasis"><em>Example:</em></span>
+</p><pre class="programlisting">
+1 int zero = 0;
+2 vector&lt;int*&gt; v(10000000, &amp;zero);
+3 for (int k = 0; k &lt; 10000000; ++k) {
+4 v[random() % 10000000] = new int(k);
+5 }
+6 for (int j = 0; j &lt; 10000000; ++j) {
+7 count += (*v[j] == 0 ? 0 : 1);
+8 }
+
+foo.cc:7: advice: Insert prefetch instruction.
+</pre><p>
+</p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.locality.linked"></a>Linked Structure Locality</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span>
+ <code class="code">_GLIBCXX_PROFILE_RBTREE_LOCALITY</code>.
+ </p></li><li><p><span class="emphasis"><em>Goal:</em></span> Give measure of locality of
+ objects stored in linked structures (lists, red-black trees and hashtables)
+ with respect to their actual traversal patterns.
+ </p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span>Allocation can be tuned
+ to a specific traversal pattern, to result in better data locality.
+ See paper:
+ <a class="ulink" href="http://www.springerlink.com/content/8085744l00x72662/" target="_top">
+ Custom Memory Allocation for Free</a>.
+ </p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>30%.
+ </p></li><li><p><span class="emphasis"><em>Recommendation:</em></span>
+ High scatter score N for container built at site S.
+ Consider changing allocation sequence or choosing a structure conscious
+ allocator.</p></li><li><p><span class="emphasis"><em>To instrument:</em></span> Methods of all
+ containers using linked structures.</p></li><li><p><span class="emphasis"><em>Analysis:</em></span>
+ First, get cache line size and page size from system.
+ Then record the number of successive elements that are on different line
+ or page, for each traversal method such as <code class="code">find</code>. Give advice
+ only if the ratio between this number and the number of total node hops
+ is above a threshold.</p></li><li><p><span class="emphasis"><em>Cost model:</em></span>
+ Sum(same_cache_line(this,previous))</p></li><li><p><span class="emphasis"><em>Example:</em></span>
+</p><pre class="programlisting">
+ 1 set&lt;int&gt; s;
+ 2 for (int i = 0; i &lt; 10000000; ++i) {
+ 3 s.insert(i);
+ 4 }
+ 5 set&lt;int&gt; s1, s2;
+ 6 for (int i = 0; i &lt; 10000000; ++i) {
+ 7 s1.insert(i);
+ 8 s2.insert(i);
+ 9 }
+...
+ // Fast, better locality.
+10 for (set&lt;int&gt;::iterator it = s.begin(); it != s.end(); ++it) {
+11 sum += *it;
+12 }
+ // Slow, elements are further apart.
+13 for (set&lt;int&gt;::iterator it = s1.begin(); it != s1.end(); ++it) {
+14 sum += *it;
+15 }
+
+foo.cc:5: advice: High scatter score NNN for set built here. Consider changing
+the allocation sequence or switching to a structure conscious allocator.
+</pre><p>
+</p></li></ul></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.analysis.mthread"></a>Multithreaded Data Access</h3></div></div></div><p>
+ The diagnostics in this group are not meant to be implemented short term.
+ They require compiler support to know when container elements are written
+ to. Instrumentation can only tell us when elements are referenced.
+ </p><p><span class="emphasis"><em>Switch:</em></span>
+ <code class="code">_GLIBCXX_PROFILE_MULTITHREADED</code>.
+ </p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.mthread.ddtest"></a>Data Dependence Violations at Container Level</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span>
+ <code class="code">_GLIBCXX_PROFILE_DDTEST</code>.
+ </p></li><li><p><span class="emphasis"><em>Goal:</em></span> Detect container elements
+ that are referenced from multiple threads in the parallel region or
+ across parallel regions.
+ </p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span>
+ Sharing data between threads requires communication and perhaps locking,
+ which may be expensive.
+ </p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>?%.
+ </p></li><li><p><span class="emphasis"><em>Recommendation:</em></span> Change data
+ distribution or parallel algorithm.</p></li><li><p><span class="emphasis"><em>To instrument:</em></span> Container access methods
+ and iterators.
+ </p></li><li><p><span class="emphasis"><em>Analysis:</em></span>
+ Keep a shadow for each container. Record iterator dereferences and
+ container member accesses. Issue advice for elements referenced by
+ multiple threads.
+ See paper: <a class="ulink" href="http://portal.acm.org/citation.cfm?id=207110.207148" target="_top">
+ The LRPD test: speculative run-time parallelization of loops with
+ privatization and reduction parallelization</a>.
+ </p></li><li><p><span class="emphasis"><em>Cost model:</em></span>
+ Number of accesses to elements referenced from multiple threads
+ </p></li><li><p><span class="emphasis"><em>Example:</em></span>
+</p><pre class="programlisting">
+</pre><p>
+</p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.mthread.false_share"></a>False Sharing</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span>
+ <code class="code">_GLIBCXX_PROFILE_FALSE_SHARING</code>.
+ </p></li><li><p><span class="emphasis"><em>Goal:</em></span> Detect elements in the
+ same container which share a cache line, are written by at least one
+ thread, and accessed by different threads.
+ </p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span> Under these assumptions,
+ cache protocols require
+ communication to invalidate lines, which may be expensive.
+ </p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>68%.
+ </p></li><li><p><span class="emphasis"><em>Recommendation:</em></span> Reorganize container
+ or use padding to avoid false sharing.</p></li><li><p><span class="emphasis"><em>To instrument:</em></span> Container access methods
+ and iterators.
+ </p></li><li><p><span class="emphasis"><em>Analysis:</em></span>
+ First, get the cache line size.
+ For each shared container, record all the associated iterator dereferences
+ and member access methods with the thread id. Compare the address lists
+ across threads to detect references in two different threads to the same
+ cache line. Issue a warning only if the ratio to total references is
+ significant. Do the same for iterator dereference values if they are
+ pointers.</p></li><li><p><span class="emphasis"><em>Cost model:</em></span>
+ Number of accesses to same cache line from different threads.
+ </p></li><li><p><span class="emphasis"><em>Example:</em></span>
+</p><pre class="programlisting">
+1 vector&lt;int&gt; v(2, 0);
+2 #pragma omp parallel for shared(v, SIZE) schedule(static, 1)
+3 for (i = 0; i &lt; SIZE; ++i) {
+4 v[i % 2] += i;
+5 }
+
+OMP_NUM_THREADS=2 ./a.out
+foo.cc:1: advice: Change container structure or padding to avoid false
+sharing in multithreaded access at foo.cc:4. Detected N shared cache lines.
+</pre><p>
+</p></li></ul></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.analysis.statistics"></a>Statistics</h3></div></div></div><p>
+<span class="emphasis"><em>Switch:</em></span>
+ <code class="code">_GLIBCXX_PROFILE_STATISTICS</code>.
+</p><p>
+ In some cases the cost model may not tell us anything because the costs
+ appear to offset the benefits. Consider the choice between a vector and
+ a list. When there are both inserts and iteration, an automatic advice
+ may not be issued. However, the programmer may still be able to make use
+ of this information in a different way.
+</p><p>
+ This diagnostic will not issue any advice, but it will print statistics for
+ each container construction site. The statistics will contain the cost
+ of each operation actually performed on the container.
+</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch32s06.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="profile_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_allocators.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Developer Information </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 33. Allocators</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt12ch33s02.html b/libstdc++-v3/doc/html/manual/bk01pt12ch34s02.html
index b8d6ff1a129..e1588498eb9 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt12ch33s02.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt12ch34s02.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>HP/SGI</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="ext_containers.html" title="Chapter 33. Containers" /><link rel="prev" href="ext_containers.html" title="Chapter 33. Containers" /><link rel="next" href="bk01pt12ch33s03.html" title="Deprecated HP/SGI" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">HP/SGI</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_containers.html">Prev</a> </td><th width="60%" align="center">Chapter 33. Containers</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch33s03.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.containers.sgi"></a>HP/SGI</h2></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>HP/SGI</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="ext_containers.html" title="Chapter 34. Containers" /><link rel="prev" href="ext_containers.html" title="Chapter 34. Containers" /><link rel="next" href="bk01pt12ch34s03.html" title="Deprecated HP/SGI" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">HP/SGI</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_containers.html">Prev</a> </td><th width="60%" align="center">Chapter 34. Containers</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch34s03.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.containers.sgi"></a>HP/SGI</h2></div></div></div><p>
</p><p>A few extensions and nods to backwards-compatibility have been made with
containers. Those dealing with older SGI-style allocators are dealt with
elsewhere. The remaining ones all deal with bits:
@@ -40,4 +40,4 @@
</p><pre class="programlisting">
size_t _Find_first() const;
size_t _Find_next (size_t prev) const;</pre><p>The same caveat given for the _Unchecked_* functions applies here also.
-</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_containers.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ext_containers.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch33s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 33. Containers </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Deprecated HP/SGI</td></tr></table></div></body></html>
+</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_containers.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ext_containers.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch34s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 34. Containers </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Deprecated HP/SGI</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt12ch33s03.html b/libstdc++-v3/doc/html/manual/bk01pt12ch34s03.html
index bf42e104c24..3e3b28d9998 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt12ch33s03.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt12ch34s03.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Deprecated HP/SGI</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="ext_containers.html" title="Chapter 33. Containers" /><link rel="prev" href="bk01pt12ch33s02.html" title="HP/SGI" /><link rel="next" href="ext_utilities.html" title="Chapter 34. Utilities" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Deprecated HP/SGI</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch33s02.html">Prev</a> </td><th width="60%" align="center">Chapter 33. Containers</th><td width="20%" align="right"> <a accesskey="n" href="ext_utilities.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.containers.deprecated_sgi"></a>Deprecated HP/SGI</h2></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Deprecated HP/SGI</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="ext_containers.html" title="Chapter 34. Containers" /><link rel="prev" href="bk01pt12ch34s02.html" title="HP/SGI" /><link rel="next" href="ext_utilities.html" title="Chapter 35. Utilities" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Deprecated HP/SGI</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch34s02.html">Prev</a> </td><th width="60%" align="center">Chapter 34. Containers</th><td width="20%" align="right"> <a accesskey="n" href="ext_utilities.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.containers.deprecated_sgi"></a>Deprecated HP/SGI</h2></div></div></div><p>
The SGI hashing classes <code class="classname">hash_set</code> and
<code class="classname">hash_set</code> have been deprecated by the
unordered_set, unordered_multiset, unordered_map,
@@ -47,4 +47,4 @@
possibility of pathological cases, you'll probably get better
performance from hash_map.
</em></span>
- </p></blockquote></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch33s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ext_containers.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_utilities.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">HP/SGI </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 34. Utilities</td></tr></table></div></body></html>
+ </p></blockquote></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch34s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ext_containers.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_utilities.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">HP/SGI </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 35. Utilities</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt12ch40s02.html b/libstdc++-v3/doc/html/manual/bk01pt12ch41s02.html
index cae19ae432d..cd976c38f26 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt12ch40s02.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt12ch41s02.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Implementation</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="ext_concurrency.html" title="Chapter 40. Concurrency" /><link rel="prev" href="ext_concurrency.html" title="Chapter 40. Concurrency" /><link rel="next" href="bk01pt12ch40s03.html" title="Use" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_concurrency.html">Prev</a> </td><th width="60%" align="center">Chapter 40. Concurrency</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch40s03.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.impl"></a>Implementation</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.impl.atomic_fallbacks"></a>Using Builtin Atomic Functions</h3></div></div></div><p>The functions for atomic operations described above are either
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Implementation</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="ext_concurrency.html" title="Chapter 41. Concurrency" /><link rel="prev" href="ext_concurrency.html" title="Chapter 41. Concurrency" /><link rel="next" href="bk01pt12ch41s03.html" title="Use" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_concurrency.html">Prev</a> </td><th width="60%" align="center">Chapter 41. Concurrency</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch41s03.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.impl"></a>Implementation</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.impl.atomic_fallbacks"></a>Using Builtin Atomic Functions</h3></div></div></div><p>The functions for atomic operations described above are either
implemented via compiler intrinsics (if the underlying host is
capable) or by library fallbacks.</p><p>Compiler intrinsics (builtins) are always preferred. However, as
the compiler builtins for atomics are not universally implemented,
@@ -38,4 +38,4 @@ use this layer. More detail as to the specific interface can be found in the sou
functions, and usage found in the usual &lt;pthread.h&gt; file,
including <code class="code">pthread_t</code>, <code class="code">pthread_once_t</code>, <code class="code">pthread_create</code>,
etc.
-</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_concurrency.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ext_concurrency.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch40s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 40. Concurrency </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Use</td></tr></table></div></body></html>
+</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_concurrency.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ext_concurrency.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch41s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 41. Concurrency </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Use</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt12ch40s03.html b/libstdc++-v3/doc/html/manual/bk01pt12ch41s03.html
index 77b0dea6125..cba67ced6b4 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt12ch40s03.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt12ch41s03.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Use</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="ext_concurrency.html" title="Chapter 40. Concurrency" /><link rel="prev" href="bk01pt12ch40s02.html" title="Implementation" /><link rel="next" href="appendix_contributing.html" title="Appendix A.  Contributing" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Use</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch40s02.html">Prev</a> </td><th width="60%" align="center">Chapter 40. Concurrency</th><td width="20%" align="right"> <a accesskey="n" href="appendix_contributing.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.use"></a>Use</h2></div></div></div><p>Typical usage of the last two constructs is demonstrated as follows:
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Use</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="ext_concurrency.html" title="Chapter 41. Concurrency" /><link rel="prev" href="bk01pt12ch41s02.html" title="Implementation" /><link rel="next" href="appendix_contributing.html" title="Appendix A.  Contributing" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Use</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch41s02.html">Prev</a> </td><th width="60%" align="center">Chapter 41. Concurrency</th><td width="20%" align="right"> <a accesskey="n" href="appendix_contributing.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.use"></a>Use</h2></div></div></div><p>Typical usage of the last two constructs is demonstrated as follows:
</p><pre class="programlisting">
#include &lt;ext/concurrence.h&gt;
@@ -31,7 +31,7 @@ the mutex as control moves out of this block.
concurrence-related errors. These classes
are: <code class="code">__concurrence_lock_error</code>, <code class="code">__concurrence_unlock_error</code>, <code class="code">__concurrence_wait_error</code>,
and <code class="code">__concurrence_broadcast_error</code>.
-</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch40s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ext_concurrency.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="appendix_contributing.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Implementation </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Appendix A. 
+</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch41s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ext_concurrency.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="appendix_contributing.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Implementation </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Appendix A. 
Contributing
</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt12pr03.html b/libstdc++-v3/doc/html/manual/bk01pt12pr03.html
index f76bab1e466..68f3a89765d 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt12pr03.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt12pr03.html
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="extensions.html" title="Part XII.  Extensions" /><link rel="next" href="ext_compile_checks.html" title="Chapter 29. Compile Time Checks" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="extensions.html">Prev</a> </td><th width="60%" align="center">Part XII. 
Extensions
-</th><td width="20%" align="right"> <a accesskey="n" href="ext_compile_checks.html">Next</a></td></tr></table><hr /></div><div class="preface" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id450786"></a></h2></div></div></div><p>
+</th><td width="20%" align="right"> <a accesskey="n" href="ext_compile_checks.html">Next</a></td></tr></table><hr /></div><div class="preface" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id646774"></a></h2></div></div></div><p>
Here we will make an attempt at describing the non-Standard extensions to
the library. Some of these are from SGI's STL, some of these are GNU's,
and some just seemed to appear on the doorstep.
diff --git a/libstdc++-v3/doc/html/manual/bugs.html b/libstdc++-v3/doc/html/manual/bugs.html
index 01c623516dc..12ed9a966fa 100644
--- a/libstdc++-v3/doc/html/manual/bugs.html
+++ b/libstdc++-v3/doc/html/manual/bugs.html
@@ -123,6 +123,9 @@
</p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-defects.html#129" target="_top">129</a>:
<span class="emphasis"><em>Need error indication from seekp() and seekg()</em></span>
</span></dt><dd><p>These functions set <code class="code">failbit</code> on error now.
+ </p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-defects.html#130" target="_top">130</a>:
+ <span class="emphasis"><em>Return type of container::erase(iterator) differs for associative containers</em></span>
+ </span></dt><dd><p>Make member <code class="code">erase</code> return iterator for <code class="code">set</code>, <code class="code">multiset</code>, <code class="code">map</code>, <code class="code">multimap</code>.
</p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-defects.html#136" target="_top">136</a>:
<span class="emphasis"><em>seekp, seekg setting wrong streams?</em></span>
</span></dt><dd><p><code class="code">seekp</code> should only set the output stream, and
@@ -335,7 +338,7 @@
</p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-defects.html#844" target="_top">844</a>:
<span class="emphasis"><em>complex pow return type is ambiguous</em></span>
</span></dt><dd><p>In C++0x mode, remove the pow(complex&lt;T&gt;, int) signature.
- </p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-active.html#853" target="_top">853</a>:
+ </p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-defects.html#853" target="_top">853</a>:
<span class="emphasis"><em>to_string needs updating with zero and one</em></span>
</span></dt><dd><p>Update / add the signatures.
</p></dd></dl></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="license.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="status.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="setup.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">License </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 2. Setup</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/codecvt.html b/libstdc++-v3/doc/html/manual/codecvt.html
index 2b06179cdf2..0ac3285f1e9 100644
--- a/libstdc++-v3/doc/html/manual/codecvt.html
+++ b/libstdc++-v3/doc/html/manual/codecvt.html
@@ -337,41 +337,41 @@ codecvt usage.
</p></li><li><p>
wchar_t/char internal buffers and conversions between
internal/external buffers?
- </p></li></ul></div></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="facet.codecvt.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id514958"></a><p><span class="title"><i>
+ </p></li></ul></div></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="facet.codecvt.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id703118"></a><p><span class="title"><i>
The GNU C Library
- </i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling and 7 Locales and Internationalization. </span></p></div><div class="biblioentry"><a id="id455172"></a><p><span class="title"><i>
+ </i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling and 7 Locales and Internationalization. </span></p></div><div class="biblioentry"><a id="id644322"></a><p><span class="title"><i>
Correspondence
- </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id448478"></a><p><span class="title"><i>
+ </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id644350"></a><p><span class="title"><i>
ISO/IEC 14882:1998 Programming languages - C++
- </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id448497"></a><p><span class="title"><i>
+ </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id660838"></a><p><span class="title"><i>
ISO/IEC 9899:1999 Programming languages - C
- </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id431624"></a><p><span class="title"><i>
- System Interface Definitions, Issue 6 (IEEE Std. 1003.1-200x)
+ </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id660857"></a><p><span class="title"><i>
+ The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004)
</i>. </span><span class="copyright">Copyright © 1999
The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span><span class="biblioid">
- <a class="ulink" href="http://www.opennc.org/austin/docreg.html" target="_top">
+ <a class="ulink" href="http://www.unix.org/version3/ieee_std.html" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id431651"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id686728"></a><p><span class="title"><i>
The C++ Programming Language, Special Edition
</i>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry"><a id="id437273"></a><p><span class="title"><i>
+ . </span></span></p></div><div class="biblioentry"><a id="id720408"></a><p><span class="title"><i>
Standard C++ IOStreams and Locales
</i>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference
. </span><span class="author"><span class="firstname">Angelika</span> <span class="surname">Langer</span>. </span><span class="author"><span class="firstname">Klaus</span> <span class="surname">Kreft</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley Longman, Inc.. </span><span class="publisher"><span class="publishername">
Addison Wesley Longman
- . </span></span></p></div><div class="biblioentry"><a id="id322717"></a><p><span class="title"><i>
+ . </span></span></p></div><div class="biblioentry"><a id="id692630"></a><p><span class="title"><i>
A brief description of Normative Addendum 1
</i>. </span><span class="author"><span class="firstname">Clive</span> <span class="surname">Feather</span>. </span><span class="pagenums">Extended Character Sets. </span><span class="biblioid">
<a class="ulink" href="http://www.lysator.liu.se/c/na1.html" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id322748"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id617963"></a><p><span class="title"><i>
The Unicode HOWTO
</i>. </span><span class="author"><span class="firstname">Bruno</span> <span class="surname">Haible</span>. </span><span class="biblioid">
<a class="ulink" href="ftp://ftp.ilog.fr/pub/Users/haible/utf8/Unicode-HOWTO.html" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id448720"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id681295"></a><p><span class="title"><i>
UTF-8 and Unicode FAQ for Unix/Linux
</i>. </span><span class="author"><span class="firstname">Markus</span> <span class="surname">Khun</span>. </span><span class="biblioid">
<a class="ulink" href="http://www.cl.cam.ac.uk/~mgk25/unicode.html" target="_top">
diff --git a/libstdc++-v3/doc/html/manual/containers.html b/libstdc++-v3/doc/html/manual/containers.html
index ff0146ddcef..9fc6bcdab56 100644
--- a/libstdc++-v3/doc/html/manual/containers.html
+++ b/libstdc++-v3/doc/html/manual/containers.html
@@ -5,5 +5,5 @@
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="messages.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="sequences.html">Next</a></td></tr></table><hr /></div><div class="part" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="manual.containers"></a>Part VII. 
Containers
- <a id="id430539" class="indexterm"></a>
+ <a id="id644180" class="indexterm"></a>
</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="sequences.html">16. Sequences</a></span></dt><dd><dl><dt><span class="sect1"><a href="sequences.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="sect2"><a href="sequences.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="sect1"><a href="vector.html">vector</a></span></dt><dd><dl><dt><span class="sect2"><a href="vector.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="associative.html">17. Associative</a></span></dt><dd><dl><dt><span class="sect1"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="sect1"><a href="bitset.html">bitset</a></span></dt><dd><dl><dt><span class="sect2"><a href="bitset.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="sect2"><a href="bitset.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="containers_and_c.html">18. Interacting with C</a></span></dt><dd><dl><dt><span class="sect1"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="messages.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="sequences.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">messages </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 16. Sequences</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/debug.html b/libstdc++-v3/doc/html/manual/debug.html
index ac6f8077648..d1a4fb2232b 100644
--- a/libstdc++-v3/doc/html/manual/debug.html
+++ b/libstdc++-v3/doc/html/manual/debug.html
@@ -137,7 +137,44 @@
set print vtbl on
set print demangle on
set demangle-style gnu-v3
-</pre></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="debug.exceptions"></a>Tracking uncaught exceptions</h3></div></div></div><p>
+</pre><p>
+ Starting with version 7.0, GDB includes support for writing
+ pretty-printers in Python. Pretty printers for STL classes are
+ distributed with GCC from version 4.5.0. The most recent version of
+ these printers are always found in libstdc++ svn repository.
+ To enable these printers, check-out the latest printers to a local
+ directory:
+</p><pre class="programlisting">
+ svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python
+</pre><p>
+ Next, add the following section to your ~/.gdbinit The path must
+ match the location where the Python module above was checked-out.
+ So if checked out to: /home/maude/gdb_printers/, the path would be as
+ written in the example below.
+</p><pre class="programlisting">
+ python
+ import sys
+ sys.path.insert(0, '/home/maude/gdb_printers/python')
+ from libstdcxx.v6.printers import register_libstdcxx_printers
+ register_libstdcxx_printers (None)
+ end
+</pre><p>
+ The path should be the only element that needs to be adjusted in the
+ example. Once loaded, STL classes that the printers support
+ should print in a more human-readable format. To print the classes
+ in the old style, use the /r (raw) switch in the print command
+ (i.e., print /r foo). This will print the classes as if the Python
+ pretty-printers were not loaded.
+</p><p>
+ For additional information on STL support and GDB please visit:
+ <a class="ulink" href="http://sourceware.org/gdb/wiki/STLSupport" target="_top"> "GDB Support
+ for STL" </a> in the GDB wiki. Additionally, in-depth
+ documentation and discussion of the pretty printing feature can be
+ found in "Pretty Printing" node in the GDB manual. You can find
+ on-line versions of the GDB user manual in GDB's homepage, at
+ <a class="ulink" href="http://sourceware.org/gdb/" target="_top"> "GDB: The GNU Project
+ Debugger" </a>.
+</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="debug.exceptions"></a>Tracking uncaught exceptions</h3></div></div></div><p>
The <a class="link" href="verbose_termination.html" title="Verbose Terminate Handler">verbose
termination handler</a> gives information about uncaught
exceptions which are killing the program. It is described in the
@@ -146,6 +183,9 @@
has compile and run-time checks for many containers.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="debug.compile_time_checks"></a>Compile Time Checking</h3></div></div></div><p> The <a class="link" href="ext_compile_checks.html" title="Chapter 29. Compile Time Checks">Compile-Time
Checks</a> Extension has compile-time checks for many algorithms.
+ </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="debug.profile_mode"></a>Profile-based Performance Analysis</h3></div></div></div><p> The <a class="link" href="profile_mode.html" title="Chapter 32. Profile Mode">Profile-based
+ Performance Analysis</a> Extension has performance checks for many
+ algorithms.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="using_exceptions.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="using.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="support.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Exceptions </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Part II. 
Support
diff --git a/libstdc++-v3/doc/html/manual/diagnostics.html b/libstdc++-v3/doc/html/manual/diagnostics.html
index 3624e126e13..b869aec22f8 100644
--- a/libstdc++-v3/doc/html/manual/diagnostics.html
+++ b/libstdc++-v3/doc/html/manual/diagnostics.html
@@ -5,5 +5,5 @@
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="verbose_termination.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="exceptions.html">Next</a></td></tr></table><hr /></div><div class="part" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="manual.diagnostics"></a>Part III. 
Diagnostics
- <a id="id427594" class="indexterm"></a>
-</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="exceptions.html">7. Exceptions</a></span></dt><dd><dl><dt><span class="sect1"><a href="exceptions.html#manual.diagnostics.exceptions.hierarchy">Exception Classes</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch07s02.html">Adding Data to Exceptions</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch07s03.html">Cancellation</a></span></dt></dl></dd><dt><span class="chapter"><a href="bk01pt03ch08.html">8. Concept Checking</a></span></dt></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="verbose_termination.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="exceptions.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Verbose Terminate Handler </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 7. Exceptions</td></tr></table></div></body></html>
+ <a id="id702920" class="indexterm"></a>
+</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="exceptions.html">7. Exceptions</a></span></dt><dd><dl><dt><span class="sect1"><a href="exceptions.html#manual.diagnostics.exceptions.hierarchy">Exception Classes</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch07s02.html">Adding Data to Exceptions</a></span></dt></dl></dd><dt><span class="chapter"><a href="bk01pt03ch08.html">8. Concept Checking</a></span></dt></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="verbose_termination.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="exceptions.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Verbose Terminate Handler </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 7. Exceptions</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/documentation_style.html b/libstdc++-v3/doc/html/manual/documentation_style.html
index 9490bb6e19a..e8d7831cb5c 100644
--- a/libstdc++-v3/doc/html/manual/documentation_style.html
+++ b/libstdc++-v3/doc/html/manual/documentation_style.html
@@ -6,7 +6,7 @@
</th><td width="20%" align="right"> <a accesskey="n" href="source_design_notes.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="contrib.doc_style"></a>Documentation Style</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="doc_style.doxygen"></a>Doxygen</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="doxygen.prereq"></a>Prerequisites</h4></div></div></div><p>
Prerequisite tools are Bash 2.x,
<a class="ulink" href="http://www.doxygen.org/" target="_top">Doxygen</a>, and
- the <a class="ulink" href="http://www.gnu.org/software/coreutils" target="_top">GNU
+ the <a class="ulink" href="http://www.gnu.org/software/coreutils/" target="_top">GNU
coreutils</a>. (GNU versions of find, xargs, and possibly
sed and grep are used, just because the GNU versions make
things very easy.)
@@ -211,11 +211,11 @@ Complete details on Docbook markup can be found in the DocBook Element
Reference, <a class="ulink" href="http://www.docbook.org/tdg/en/html/part2.html" target="_top">online</a>. An
incomplete reference for HTML to Docbook conversion is detailed in the
table below.
-</p><div class="table"><a id="id447935"></a><p class="title"><b>Table A.1. HTML to Docbook XML markup comparison</b></p><div class="table-contents"><table summary="HTML to Docbook XML markup comparison" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">HTML</th><th align="left">XML</th></tr></thead><tbody><tr><td align="left">&lt;p&gt;</td><td align="left">&lt;para&gt;</td></tr><tr><td align="left">&lt;pre&gt;</td><td align="left">&lt;computeroutput&gt;, &lt;programlisting&gt;,
+</p><div class="table"><a id="id740402"></a><p class="title"><b>Table A.1. HTML to Docbook XML markup comparison</b></p><div class="table-contents"><table summary="HTML to Docbook XML markup comparison" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">HTML</th><th align="left">XML</th></tr></thead><tbody><tr><td align="left">&lt;p&gt;</td><td align="left">&lt;para&gt;</td></tr><tr><td align="left">&lt;pre&gt;</td><td align="left">&lt;computeroutput&gt;, &lt;programlisting&gt;,
&lt;literallayout&gt;</td></tr><tr><td align="left">&lt;ul&gt;</td><td align="left">&lt;itemizedlist&gt;</td></tr><tr><td align="left">&lt;ol&gt;</td><td align="left">&lt;orderedlist&gt;</td></tr><tr><td align="left">&lt;il&gt;</td><td align="left">&lt;listitem&gt;</td></tr><tr><td align="left">&lt;dl&gt;</td><td align="left">&lt;variablelist&gt;</td></tr><tr><td align="left">&lt;dt&gt;</td><td align="left">&lt;term&gt;</td></tr><tr><td align="left">&lt;dd&gt;</td><td align="left">&lt;listitem&gt;</td></tr><tr><td align="left">&lt;a href=""&gt;</td><td align="left">&lt;ulink url=""&gt;</td></tr><tr><td align="left">&lt;code&gt;</td><td align="left">&lt;literal&gt;, &lt;programlisting&gt;</td></tr><tr><td align="left">&lt;strong&gt;</td><td align="left">&lt;emphasis&gt;</td></tr><tr><td align="left">&lt;em&gt;</td><td align="left">&lt;emphasis&gt;</td></tr><tr><td align="left">"</td><td align="left">&lt;quote&gt;</td></tr></tbody></table></div></div><br class="table-break" /><p>
And examples of detailed markup for which there are no real HTML
equivalents are listed in the table below.
-</p><div class="table"><a id="id458695"></a><p class="title"><b>Table A.2. Docbook XML Element Use</b></p><div class="table-contents"><table summary="Docbook XML Element Use" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Element</th><th align="left">Use</th></tr></thead><tbody><tr><td align="left">&lt;structname&gt;</td><td align="left">&lt;structname&gt;char_traits&lt;/structname&gt;</td></tr><tr><td align="left">&lt;classname&gt;</td><td align="left">&lt;classname&gt;string&lt;/classname&gt;</td></tr><tr><td align="left">&lt;function&gt;</td><td align="left">
+</p><div class="table"><a id="id613462"></a><p class="title"><b>Table A.2. Docbook XML Element Use</b></p><div class="table-contents"><table summary="Docbook XML Element Use" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Element</th><th align="left">Use</th></tr></thead><tbody><tr><td align="left">&lt;structname&gt;</td><td align="left">&lt;structname&gt;char_traits&lt;/structname&gt;</td></tr><tr><td align="left">&lt;classname&gt;</td><td align="left">&lt;classname&gt;string&lt;/classname&gt;</td></tr><tr><td align="left">&lt;function&gt;</td><td align="left">
<p>&lt;function&gt;clear()&lt;/function&gt;</p>
<p>&lt;function&gt;fs.clear()&lt;/function&gt;</p>
</td></tr><tr><td align="left">&lt;type&gt;</td><td align="left">&lt;type&gt;long long&lt;/type&gt;</td></tr><tr><td align="left">&lt;varname&gt;</td><td align="left">&lt;varname&gt;fs&lt;/varname&gt;</td></tr><tr><td align="left">&lt;literal&gt;</td><td align="left">
diff --git a/libstdc++-v3/doc/html/manual/exceptions.html b/libstdc++-v3/doc/html/manual/exceptions.html
index 74bcdebe14f..83eb8892fa4 100644
--- a/libstdc++-v3/doc/html/manual/exceptions.html
+++ b/libstdc++-v3/doc/html/manual/exceptions.html
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 7. Exceptions</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="diagnostics.html" title="Part III.  Diagnostics" /><link rel="prev" href="diagnostics.html" title="Part III.  Diagnostics" /><link rel="next" href="bk01pt03ch07s02.html" title="Adding Data to Exceptions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 7. Exceptions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="diagnostics.html">Prev</a> </td><th width="60%" align="center">Part III. 
Diagnostics
-</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt03ch07s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.diagnostics.exceptions"></a>Chapter 7. Exceptions</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="exceptions.html#manual.diagnostics.exceptions.hierarchy">Exception Classes</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch07s02.html">Adding Data to Exceptions</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch07s03.html">Cancellation</a></span></dt></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.diagnostics.exceptions.hierarchy"></a>Exception Classes</h2></div></div></div><p>
+</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt03ch07s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.diagnostics.exceptions"></a>Chapter 7. Exceptions</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="exceptions.html#manual.diagnostics.exceptions.hierarchy">Exception Classes</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch07s02.html">Adding Data to Exceptions</a></span></dt></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.diagnostics.exceptions.hierarchy"></a>Exception Classes</h2></div></div></div><p>
All exception objects are defined in one of the standard header
files: <code class="filename">exception</code>,
<code class="filename">stdexcept</code>, <code class="filename">new</code>, and
diff --git a/libstdc++-v3/doc/html/manual/ext_algorithms.html b/libstdc++-v3/doc/html/manual/ext_algorithms.html
index b77a24a50ce..eadb4441b1e 100644
--- a/libstdc++-v3/doc/html/manual/ext_algorithms.html
+++ b/libstdc++-v3/doc/html/manual/ext_algorithms.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 35. Algorithms</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_utilities.html" title="Chapter 34. Utilities" /><link rel="next" href="ext_numerics.html" title="Chapter 36. Numerics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 35. Algorithms</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_utilities.html">Prev</a> </td><th width="60%" align="center">Part XII. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 36. Algorithms</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_utilities.html" title="Chapter 35. Utilities" /><link rel="next" href="ext_numerics.html" title="Chapter 37. Numerics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 36. Algorithms</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_utilities.html">Prev</a> </td><th width="60%" align="center">Part XII. 
Extensions
-</th><td width="20%" align="right"> <a accesskey="n" href="ext_numerics.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.algorithms"></a>Chapter 35. Algorithms</h2></div></div></div><p>25.1.6 (count, count_if) is extended with two more versions of count
+</th><td width="20%" align="right"> <a accesskey="n" href="ext_numerics.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.algorithms"></a>Chapter 36. Algorithms</h2></div></div></div><p>25.1.6 (count, count_if) is extended with two more versions of count
and count_if. The standard versions return their results. The
additional signatures return void, but take a final parameter by
reference to which they assign their results, e.g.,
@@ -20,4 +20,4 @@
</p><pre class="programlisting">
lexicographical_compare_3way(_InputIter1 first1, _InputIter1 last1,
_InputIter2 first2, _InputIter2 last2)</pre><p>which does... what?
-</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_utilities.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_numerics.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 34. Utilities </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 36. Numerics</td></tr></table></div></body></html>
+</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_utilities.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_numerics.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 35. Utilities </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 37. Numerics</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/ext_allocators.html b/libstdc++-v3/doc/html/manual/ext_allocators.html
index 91d38b5b990..cec9f8228a0 100644
--- a/libstdc++-v3/doc/html/manual/ext_allocators.html
+++ b/libstdc++-v3/doc/html/manual/ext_allocators.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 32. Allocators</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="bk01pt12ch31s05.html" title="Testing" /><link rel="next" href="bitmap_allocator.html" title="bitmap_allocator" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 32. Allocators</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch31s05.html">Prev</a> </td><th width="60%" align="center">Part XII. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 33. Allocators</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="bk01pt12ch32s07.html" title="Diagnostics" /><link rel="next" href="bitmap_allocator.html" title="bitmap_allocator" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 33. Allocators</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch32s07.html">Prev</a> </td><th width="60%" align="center">Part XII. 
Extensions
-</th><td width="20%" align="right"> <a accesskey="n" href="bitmap_allocator.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.allocator"></a>Chapter 32. Allocators</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ext_allocators.html#manual.ext.allocator.mt">mt_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.example_single">Single Thread Example</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.example_multi">Multiple Thread Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="bitmap_allocator.html">bitmap_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="sect2"><a href="bitmap_allocator.html#allocator.bitmap.impl">Implementation</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.allocator.mt"></a>mt_allocator</h2></div></div></div><p>
+</th><td width="20%" align="right"> <a accesskey="n" href="bitmap_allocator.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.allocator"></a>Chapter 33. Allocators</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ext_allocators.html#manual.ext.allocator.mt">mt_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.example_single">Single Thread Example</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.example_multi">Multiple Thread Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="bitmap_allocator.html">bitmap_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="sect2"><a href="bitmap_allocator.html#allocator.bitmap.impl">Implementation</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.allocator.mt"></a>mt_allocator</h2></div></div></div><p>
</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.intro"></a>Intro</h3></div></div></div><p>
The mt allocator [hereinafter referred to simply as "the allocator"]
is a fixed size (power of two) allocator that was initially
@@ -394,4 +394,4 @@ mutex to be locked) this operation is also made in chunks of blocks
a threads freelist mentioned above). The "formula" used can probably
be improved to further reduce the risk of blocks being "bounced back
and forth" between freelists.
-</p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch31s05.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bitmap_allocator.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Testing </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> bitmap_allocator</td></tr></table></div></body></html>
+</p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch32s07.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bitmap_allocator.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Diagnostics </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> bitmap_allocator</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/ext_concurrency.html b/libstdc++-v3/doc/html/manual/ext_concurrency.html
index b9d7d3503e8..9fa8f74d7b1 100644
--- a/libstdc++-v3/doc/html/manual/ext_concurrency.html
+++ b/libstdc++-v3/doc/html/manual/ext_concurrency.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 40. Concurrency</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_demangling.html" title="Chapter 39. Demangling" /><link rel="next" href="bk01pt12ch40s02.html" title="Implementation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 40. Concurrency</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_demangling.html">Prev</a> </td><th width="60%" align="center">Part XII. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 41. Concurrency</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_demangling.html" title="Chapter 40. Demangling" /><link rel="next" href="bk01pt12ch41s02.html" title="Implementation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 41. Concurrency</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_demangling.html">Prev</a> </td><th width="60%" align="center">Part XII. 
Extensions
-</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch40s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.concurrency"></a>Chapter 40. Concurrency</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="sect2"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch40s02.html">Implementation</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch40s02.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch40s02.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch40s03.html">Use</a></span></dt></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.design"></a>Design</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.design.threads"></a>Interface to Locks and Mutexes</h3></div></div></div><p>The file &lt;ext/concurrence.h&gt; contains all the higher-level
+</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch41s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.concurrency"></a>Chapter 41. Concurrency</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="sect2"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch41s02.html">Implementation</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch41s02.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch41s02.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch41s03.html">Use</a></span></dt></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.design"></a>Design</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.design.threads"></a>Interface to Locks and Mutexes</h3></div></div></div><p>The file &lt;ext/concurrence.h&gt; contains all the higher-level
constructs for playing with threads. In contrast to the atomics layer,
the concurrence layer consists largely of types. All types are defined within <code class="code">namespace __gnu_cxx</code>.
</p><p>
@@ -88,4 +88,4 @@ _GLIBCXX_WRITE_MEM_BARRIER
</p><p>
Which expand to the appropriate write and read barrier required by the
host hardware and operating system.
-</p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_demangling.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch40s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 39. Demangling </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Implementation</td></tr></table></div></body></html>
+</p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_demangling.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch41s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 40. Demangling </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Implementation</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/ext_containers.html b/libstdc++-v3/doc/html/manual/ext_containers.html
index 44d7f17e8cd..47ada7b5db6 100644
--- a/libstdc++-v3/doc/html/manual/ext_containers.html
+++ b/libstdc++-v3/doc/html/manual/ext_containers.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 33. Containers</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="bitmap_allocator.html" title="bitmap_allocator" /><link rel="next" href="bk01pt12ch33s02.html" title="HP/SGI" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 33. Containers</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bitmap_allocator.html">Prev</a> </td><th width="60%" align="center">Part XII. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 34. Containers</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="bitmap_allocator.html" title="bitmap_allocator" /><link rel="next" href="bk01pt12ch34s02.html" title="HP/SGI" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 34. Containers</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bitmap_allocator.html">Prev</a> </td><th width="60%" align="center">Part XII. 
Extensions
-</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch33s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.containers"></a>Chapter 33. Containers</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ext_containers.html#manual.ext.containers.pbds">Policy Based Data Structures</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch33s02.html">HP/SGI</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch33s03.html">Deprecated HP/SGI</a></span></dt></dl></div><p>
+</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch34s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.containers"></a>Chapter 34. Containers</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ext_containers.html#manual.ext.containers.pbds">Policy Based Data Structures</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch34s02.html">HP/SGI</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch34s03.html">Deprecated HP/SGI</a></span></dt></dl></div><p>
</p><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.containers.pbds"></a>Policy Based Data Structures</h2></div></div></div><p>
<a class="ulink" href="http://gcc.gnu.org/onlinedocs/libstdc++/ext/pb_ds/index.html" target="_top">More details here</a>.
- </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bitmap_allocator.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch33s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">bitmap_allocator </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> HP/SGI</td></tr></table></div></body></html>
+ </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bitmap_allocator.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch34s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">bitmap_allocator </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> HP/SGI</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/ext_demangling.html b/libstdc++-v3/doc/html/manual/ext_demangling.html
index 5eaf54a9804..46866b82bf9 100644
--- a/libstdc++-v3/doc/html/manual/ext_demangling.html
+++ b/libstdc++-v3/doc/html/manual/ext_demangling.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 39. Demangling</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_io.html" title="Chapter 38. Input and Output" /><link rel="next" href="ext_concurrency.html" title="Chapter 40. Concurrency" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 39. Demangling</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_io.html">Prev</a> </td><th width="60%" align="center">Part XII. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 40. Demangling</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_io.html" title="Chapter 39. Input and Output" /><link rel="next" href="ext_concurrency.html" title="Chapter 41. Concurrency" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 40. Demangling</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_io.html">Prev</a> </td><th width="60%" align="center">Part XII. 
Extensions
-</th><td width="20%" align="right"> <a accesskey="n" href="ext_concurrency.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.demangle"></a>Chapter 39. Demangling</h2></div></div></div><p>
+</th><td width="20%" align="right"> <a accesskey="n" href="ext_concurrency.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.demangle"></a>Chapter 40. Demangling</h2></div></div></div><p>
Transforming C++ ABI identifiers (like RTTI symbols) into the
original C++ source identifiers is called
“<span class="quote">demangling.</span>â€
@@ -71,4 +71,4 @@ int main()
be writing C++ in order to demangle C++. (That also means we have to
use crummy memory management facilities, so don't forget to free()
the returned char array.)
- </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_io.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_concurrency.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 38. Input and Output </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 40. Concurrency</td></tr></table></div></body></html>
+ </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_io.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_concurrency.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 39. Input and Output </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 41. Concurrency</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/ext_io.html b/libstdc++-v3/doc/html/manual/ext_io.html
index 53618a04975..d257c2c51e5 100644
--- a/libstdc++-v3/doc/html/manual/ext_io.html
+++ b/libstdc++-v3/doc/html/manual/ext_io.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 38. Input and Output</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_iterators.html" title="Chapter 37. Iterators" /><link rel="next" href="ext_demangling.html" title="Chapter 39. Demangling" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 38. Input and Output</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_iterators.html">Prev</a> </td><th width="60%" align="center">Part XII. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 39. Input and Output</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_iterators.html" title="Chapter 38. Iterators" /><link rel="next" href="ext_demangling.html" title="Chapter 40. Demangling" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 39. Input and Output</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_iterators.html">Prev</a> </td><th width="60%" align="center">Part XII. 
Extensions
-</th><td width="20%" align="right"> <a accesskey="n" href="ext_demangling.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.io"></a>Chapter 38. Input and Output</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></div><p>
+</th><td width="20%" align="right"> <a accesskey="n" href="ext_demangling.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.io"></a>Chapter 39. Input and Output</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></div><p>
Extensions allowing <code class="code">filebuf</code>s to be constructed from
"C" types like FILE*s and file descriptors.
</p><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.io.filebuf_derived"></a>Derived filebufs</h2></div></div></div><p>The v2 library included non-standard extensions to construct
@@ -47,4 +47,4 @@
call) then you might be interested in Henry Suter's RWLock class.
</p><p>
- </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_iterators.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_demangling.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 37. Iterators </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 39. Demangling</td></tr></table></div></body></html>
+ </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_iterators.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_demangling.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 38. Iterators </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 40. Demangling</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/ext_iterators.html b/libstdc++-v3/doc/html/manual/ext_iterators.html
index 51b0e0f12bd..20be5ac7831 100644
--- a/libstdc++-v3/doc/html/manual/ext_iterators.html
+++ b/libstdc++-v3/doc/html/manual/ext_iterators.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 37. Iterators</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_numerics.html" title="Chapter 36. Numerics" /><link rel="next" href="ext_io.html" title="Chapter 38. Input and Output" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 37. Iterators</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_numerics.html">Prev</a> </td><th width="60%" align="center">Part XII. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 38. Iterators</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_numerics.html" title="Chapter 37. Numerics" /><link rel="next" href="ext_io.html" title="Chapter 39. Input and Output" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 38. Iterators</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_numerics.html">Prev</a> </td><th width="60%" align="center">Part XII. 
Extensions
-</th><td width="20%" align="right"> <a accesskey="n" href="ext_io.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.iterators"></a>Chapter 37. Iterators</h2></div></div></div><p>24.3.2 describes <code class="code">struct iterator</code>, which didn't exist in the
+</th><td width="20%" align="right"> <a accesskey="n" href="ext_io.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.iterators"></a>Chapter 38. Iterators</h2></div></div></div><p>24.3.2 describes <code class="code">struct iterator</code>, which didn't exist in the
original HP STL implementation (the language wasn't rich enough at the
time). For backwards compatibility, base classes are provided which
declare the same nested typedefs:
@@ -11,4 +11,4 @@
two iterators and returns a result. It is extended by another signature
which takes two iterators and a reference to a result. The result is
modified, and the function returns nothing.
-</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_numerics.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_io.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 36. Numerics </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 38. Input and Output</td></tr></table></div></body></html>
+</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_numerics.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_io.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 37. Numerics </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 39. Input and Output</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/ext_numerics.html b/libstdc++-v3/doc/html/manual/ext_numerics.html
index f1bb1ac93eb..dc47b617dbf 100644
--- a/libstdc++-v3/doc/html/manual/ext_numerics.html
+++ b/libstdc++-v3/doc/html/manual/ext_numerics.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 36. Numerics</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_algorithms.html" title="Chapter 35. Algorithms" /><link rel="next" href="ext_iterators.html" title="Chapter 37. Iterators" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 36. Numerics</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_algorithms.html">Prev</a> </td><th width="60%" align="center">Part XII. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 37. Numerics</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_algorithms.html" title="Chapter 36. Algorithms" /><link rel="next" href="ext_iterators.html" title="Chapter 38. Iterators" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 37. Numerics</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_algorithms.html">Prev</a> </td><th width="60%" align="center">Part XII. 
Extensions
-</th><td width="20%" align="right"> <a accesskey="n" href="ext_iterators.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.numerics"></a>Chapter 36. Numerics</h2></div></div></div><p>26.4, the generalized numeric operations such as accumulate, are extended
+</th><td width="20%" align="right"> <a accesskey="n" href="ext_iterators.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.numerics"></a>Chapter 37. Numerics</h2></div></div></div><p>26.4, the generalized numeric operations such as accumulate, are extended
with the following functions:
</p><pre class="programlisting">
power (x, n);
@@ -17,4 +17,4 @@
That is, it assigns value to *first, value + 1 to *(first + 1) and so
on." Quoted from SGI documentation.
</p><pre class="programlisting">
- void iota(_ForwardIter first, _ForwardIter last, _Tp value);</pre></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_algorithms.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_iterators.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 35. Algorithms </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 37. Iterators</td></tr></table></div></body></html>
+ void iota(_ForwardIter first, _ForwardIter last, _Tp value);</pre></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_algorithms.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_iterators.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 36. Algorithms </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 38. Iterators</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/ext_utilities.html b/libstdc++-v3/doc/html/manual/ext_utilities.html
index 2b432e5c56f..cf475c6f064 100644
--- a/libstdc++-v3/doc/html/manual/ext_utilities.html
+++ b/libstdc++-v3/doc/html/manual/ext_utilities.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 34. Utilities</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="bk01pt12ch33s03.html" title="Deprecated HP/SGI" /><link rel="next" href="ext_algorithms.html" title="Chapter 35. Algorithms" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 34. Utilities</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch33s03.html">Prev</a> </td><th width="60%" align="center">Part XII. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 35. Utilities</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="bk01pt12ch34s03.html" title="Deprecated HP/SGI" /><link rel="next" href="ext_algorithms.html" title="Chapter 36. Algorithms" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 35. Utilities</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch34s03.html">Prev</a> </td><th width="60%" align="center">Part XII. 
Extensions
-</th><td width="20%" align="right"> <a accesskey="n" href="ext_algorithms.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.util"></a>Chapter 34. Utilities</h2></div></div></div><p>
+</th><td width="20%" align="right"> <a accesskey="n" href="ext_algorithms.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.util"></a>Chapter 35. Utilities</h2></div></div></div><p>
The &lt;functional&gt; header contains many additional functors
and helper functions, extending section 20.3. They are
implemented in the file stl_function.h:
@@ -38,4 +38,4 @@ get_temporary_buffer(5, (int*)0);
</p><p>
The specialized algorithms of section 20.4.4 are extended with
<code class="code">uninitialized_copy_n</code>. *
-</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch33s03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_algorithms.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Deprecated HP/SGI </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 35. Algorithms</td></tr></table></div></body></html>
+</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch34s03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_algorithms.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Deprecated HP/SGI </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 36. Algorithms</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/extensions.html b/libstdc++-v3/doc/html/manual/extensions.html
index a757f077356..e80e4110ec5 100644
--- a/libstdc++-v3/doc/html/manual/extensions.html
+++ b/libstdc++-v3/doc/html/manual/extensions.html
@@ -5,5 +5,5 @@
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt11ch28s02.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12pr03.html">Next</a></td></tr></table><hr /></div><div class="part" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="manual.ext"></a>Part XII. 
Extensions
- <a id="id450777" class="indexterm"></a>
-</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="preface"><a href="bk01pt12pr03.html"></a></span></dt><dt><span class="chapter"><a href="ext_compile_checks.html">29. Compile Time Checks</a></span></dt><dt><span class="chapter"><a href="debug_mode.html">30. Debug Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch30s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch30s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch30s03.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch30s03.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch30s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch30s04.html#debug_mode.design.goals">Goals</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch30s04.html#debug_mode.design.methods">Methods</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch30s04.html#debug_mode.design.other">Other Implementations</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="parallel_mode.html">31. Parallel Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch31s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch31s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch31s03.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s03.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s03.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch31s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch31s04.html#parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s04.html#parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s04.html#parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch31s05.html">Testing</a></span></dt><dt><span class="bibliography"><a href="parallel_mode.html#parallel_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_allocators.html">32. Allocators</a></span></dt><dd><dl><dt><span class="sect1"><a href="ext_allocators.html#manual.ext.allocator.mt">mt_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.example_single">Single Thread Example</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.example_multi">Multiple Thread Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="bitmap_allocator.html">bitmap_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="sect2"><a href="bitmap_allocator.html#allocator.bitmap.impl">Implementation</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="ext_containers.html">33. Containers</a></span></dt><dd><dl><dt><span class="sect1"><a href="ext_containers.html#manual.ext.containers.pbds">Policy Based Data Structures</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch33s02.html">HP/SGI</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch33s03.html">Deprecated HP/SGI</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_utilities.html">34. Utilities</a></span></dt><dt><span class="chapter"><a href="ext_algorithms.html">35. Algorithms</a></span></dt><dt><span class="chapter"><a href="ext_numerics.html">36. Numerics</a></span></dt><dt><span class="chapter"><a href="ext_iterators.html">37. Iterators</a></span></dt><dt><span class="chapter"><a href="ext_io.html">38. Input and Output</a></span></dt><dd><dl><dt><span class="sect1"><a href="ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_demangling.html">39. Demangling</a></span></dt><dt><span class="chapter"><a href="ext_concurrency.html">40. Concurrency</a></span></dt><dd><dl><dt><span class="sect1"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="sect2"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch40s02.html">Implementation</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch40s02.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch40s02.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch40s03.html">Use</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt11ch28s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12pr03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Performance </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>
+ <a id="id646766" class="indexterm"></a>
+</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="preface"><a href="bk01pt12pr03.html"></a></span></dt><dt><span class="chapter"><a href="ext_compile_checks.html">29. Compile Time Checks</a></span></dt><dt><span class="chapter"><a href="debug_mode.html">30. Debug Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch30s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch30s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch30s03.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch30s03.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch30s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch30s04.html#debug_mode.design.goals">Goals</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch30s04.html#debug_mode.design.methods">Methods</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch30s04.html#debug_mode.design.other">Other Implementations</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="parallel_mode.html">31. Parallel Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch31s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch31s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch31s03.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s03.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s03.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch31s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch31s04.html#parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s04.html#parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s04.html#parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch31s05.html">Testing</a></span></dt><dt><span class="bibliography"><a href="parallel_mode.html#parallel_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="profile_mode.html">32. Profile Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="profile_mode.html#manual.ext.profile_mode.intro">Intro</a></span></dt><dd><dl><dt><span class="sect2"><a href="profile_mode.html#manual.ext.profile_mode.using">Using the Profile Mode</a></span></dt><dt><span class="sect2"><a href="profile_mode.html#manual.ext.profile_mode.tuning">Tuning the Profile Mode</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch32s02.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch32s02.html#manual.ext.profile_mode.design.wrapper">Wrapper Model</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s02.html#manual.ext.profile_mode.design.instrumentation">Instrumentation</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s02.html#manual.ext.profile_mode.design.rtlib">Run Time Behavior</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s02.html#manual.ext.profile_mode.design.analysis">Analysis and Diagnostics</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s02.html#manual.ext.profile_mode.design.cost-model">Cost Model</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s02.html#manual.ext.profile_mode.design.reports">Reports</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s02.html#manual.ext.profile_mode.design.testing">Testing</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch32s03.html">Extensions for Custom Containers</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch32s04.html">Empirical Cost Model</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch32s05.html">Implementation Issues</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch32s05.html#manual.ext.profile_mode.implementation.stack">Stack Traces</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s05.html#manual.ext.profile_mode.implementation.symbols">Symbolization of Instruction Addresses</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s05.html#manual.ext.profile_mode.implementation.concurrency">Concurrency</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s05.html#manual.ext.profile_mode.implementation.stdlib-in-proflib">Using the Standard Library in the Instrumentation Implementation</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s05.html#manual.ext.profile_mode.implementation.malloc-hooks">Malloc Hooks</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s05.html#manual.ext.profile_mode.implementation.construction-destruction">Construction and Destruction of Global Objects</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch32s06.html">Developer Information</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch32s06.html#manual.ext.profile_mode.developer.bigpic">Big Picture</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s06.html#manual.ext.profile_mode.developer.howto">How To Add A Diagnostic</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch32s07.html">Diagnostics</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch32s07.html#manual.ext.profile_mode.analysis.template">Diagnostic Template</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s07.html#manual.ext.profile_mode.analysis.containers">Containers</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s07.html#manual.ext.profile_mode.analysis.algorithms">Algorithms</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s07.html#manual.ext.profile_mode.analysis.locality">Data Locality</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s07.html#manual.ext.profile_mode.analysis.mthread">Multithreaded Data Access</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s07.html#manual.ext.profile_mode.analysis.statistics">Statistics</a></span></dt></dl></dd><dt><span class="bibliography"><a href="profile_mode.html#profile_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_allocators.html">33. Allocators</a></span></dt><dd><dl><dt><span class="sect1"><a href="ext_allocators.html#manual.ext.allocator.mt">mt_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.example_single">Single Thread Example</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.example_multi">Multiple Thread Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="bitmap_allocator.html">bitmap_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="sect2"><a href="bitmap_allocator.html#allocator.bitmap.impl">Implementation</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="ext_containers.html">34. Containers</a></span></dt><dd><dl><dt><span class="sect1"><a href="ext_containers.html#manual.ext.containers.pbds">Policy Based Data Structures</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch34s02.html">HP/SGI</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch34s03.html">Deprecated HP/SGI</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_utilities.html">35. Utilities</a></span></dt><dt><span class="chapter"><a href="ext_algorithms.html">36. Algorithms</a></span></dt><dt><span class="chapter"><a href="ext_numerics.html">37. Numerics</a></span></dt><dt><span class="chapter"><a href="ext_iterators.html">38. Iterators</a></span></dt><dt><span class="chapter"><a href="ext_io.html">39. Input and Output</a></span></dt><dd><dl><dt><span class="sect1"><a href="ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_demangling.html">40. Demangling</a></span></dt><dt><span class="chapter"><a href="ext_concurrency.html">41. Concurrency</a></span></dt><dd><dl><dt><span class="sect1"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="sect2"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch41s02.html">Implementation</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch41s02.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch41s02.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch41s03.html">Use</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt11ch28s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12pr03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Performance </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/facets.html b/libstdc++-v3/doc/html/manual/facets.html
index 48a6a384825..ff42a5bbe0a 100644
--- a/libstdc++-v3/doc/html/manual/facets.html
+++ b/libstdc++-v3/doc/html/manual/facets.html
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 15. Facets aka Categories</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="localization.html" title="Part VI.  Localization" /><link rel="prev" href="locales.html" title="Chapter 14. Locales" /><link rel="next" href="codecvt.html" title="codecvt" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 15. Facets aka Categories</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="locales.html">Prev</a> </td><th width="60%" align="center">Part VI. 
Localization
-</th><td width="20%" align="right"> <a accesskey="n" href="codecvt.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.localization.facet"></a>Chapter 15. Facets aka Categories</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="facets.html#manual.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="sect2"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="codecvt.html">codecvt</a></span></dt><dd><dl><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.design">Design</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.use">Use</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="messages.html">messages</a></span></dt><dd><dl><dt><span class="sect2"><a href="messages.html#facet.messages.req">Requirements</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.design">Design</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.use">Use</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.localization.facet.ctype"></a>ctype</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="facet.ctype.impl"></a>Implementation</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id435289"></a>Specializations</h4></div></div></div><p>
+</th><td width="20%" align="right"> <a accesskey="n" href="codecvt.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.localization.facet"></a>Chapter 15. Facets aka Categories</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="facets.html#manual.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="sect2"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="codecvt.html">codecvt</a></span></dt><dd><dl><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.design">Design</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.use">Use</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="messages.html">messages</a></span></dt><dd><dl><dt><span class="sect2"><a href="messages.html#facet.messages.req">Requirements</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.design">Design</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.use">Use</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.localization.facet.ctype"></a>ctype</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="facet.ctype.impl"></a>Implementation</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id639240"></a>Specializations</h4></div></div></div><p>
For the required specialization codecvt&lt;wchar_t, char, mbstate_t&gt; ,
conversions are made between the internal character set (always UCS4
on GNU/Linux) and whatever the currently selected locale for the
@@ -50,25 +50,25 @@ characters.
</p></li><li><p>
Rename abstract base class. See if just smash-overriding is a
better approach. Clarify, add sanity to naming.
- </p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="facet.ctype.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id444358"></a><p><span class="title"><i>
+ </p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="facet.ctype.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id621794"></a><p><span class="title"><i>
The GNU C Library
- </i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling and 7 Locales and Internationalization. </span></p></div><div class="biblioentry"><a id="id455494"></a><p><span class="title"><i>
+ </i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling and 7 Locales and Internationalization. </span></p></div><div class="biblioentry"><a id="id641198"></a><p><span class="title"><i>
Correspondence
- </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id440437"></a><p><span class="title"><i>
+ </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id734835"></a><p><span class="title"><i>
ISO/IEC 14882:1998 Programming languages - C++
- </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id440455"></a><p><span class="title"><i>
+ </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id629980"></a><p><span class="title"><i>
ISO/IEC 9899:1999 Programming languages - C
- </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id440473"></a><p><span class="title"><i>
- System Interface Definitions, Issue 6 (IEEE Std. 1003.1-200x)
+ </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id629998"></a><p><span class="title"><i>
+ The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004)
</i>. </span><span class="copyright">Copyright © 1999
The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span><span class="biblioid">
- <a class="ulink" href="http://www.opennc.org/austin/docreg.html" target="_top">
+ <a class="ulink" href="http://www.unix.org/version3/ieee_std.html" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id517128"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id619025"></a><p><span class="title"><i>
The C++ Programming Language, Special Edition
</i>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry"><a id="id438741"></a><p><span class="title"><i>
+ . </span></span></p></div><div class="biblioentry"><a id="id637327"></a><p><span class="title"><i>
Standard C++ IOStreams and Locales
</i>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference
diff --git a/libstdc++-v3/doc/html/manual/internals.html b/libstdc++-v3/doc/html/manual/internals.html
index 8ba004ece5a..aca09ecaf51 100644
--- a/libstdc++-v3/doc/html/manual/internals.html
+++ b/libstdc++-v3/doc/html/manual/internals.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Porting to New Hardware or Operating Systems</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; internals&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="next" href="abi.html" title="ABI Policy and Guidelines" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Porting to New Hardware or Operating Systems</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="appendix_porting.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Porting to New Hardware or Operating Systems</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; internals&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="next" href="test.html" title="Test" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Porting to New Hardware or Operating Systems</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="appendix_porting.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
Porting and Maintenance
-</th><td width="20%" align="right"> <a accesskey="n" href="abi.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="appendix.porting.internals"></a>Porting to New Hardware or Operating Systems</h2></div></div></div><p>
+</th><td width="20%" align="right"> <a accesskey="n" href="test.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="appendix.porting.internals"></a>Porting to New Hardware or Operating Systems</h2></div></div></div><p>
</p><p>This document explains how to port libstdc++ (the GNU C++ library) to
a new target.
</p><p>In order to make the GNU C++ library (libstdc++) work with a new
@@ -368,7 +368,7 @@ do this is to build the library using <code class="code">gcc -shared</code>.
<code class="code">ltcf-c.sh</code> in the top-level directory. Find the switch statement
that sets <code class="code">archive_cmds</code>. Here, adjust the setting for your
operating system.
- </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="appendix_porting.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="appendix_porting.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="abi.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix B. 
+ </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="appendix_porting.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="appendix_porting.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="test.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix B. 
Porting and Maintenance
- </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> ABI Policy and Guidelines</td></tr></table></div></body></html>
+ </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Test</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/intro.html b/libstdc++-v3/doc/html/manual/intro.html
index ed795fc6e81..350d617ccc2 100644
--- a/libstdc++-v3/doc/html/manual/intro.html
+++ b/libstdc++-v3/doc/html/manual/intro.html
@@ -5,5 +5,5 @@
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="spine.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="status.html">Next</a></td></tr></table><hr /></div><div class="part" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="manual.intro"></a>Part I. 
Introduction
- <a id="id387018" class="indexterm"></a>
-</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="status.html">1. Status</a></span></dt><dd><dl><dt><span class="sect1"><a href="status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="sect2"><a href="status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dt><span class="sect2"><a href="status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="sect2"><a href="status.html#status.iso.200x">C++ 200x</a></span></dt></dl></dd><dt><span class="sect1"><a href="license.html">License</a></span></dt><dd><dl><dt><span class="sect2"><a href="license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="sect2"><a href="license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="sect1"><a href="bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="sect2"><a href="bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="sect2"><a href="bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="setup.html">2. Setup</a></span></dt><dd><dl><dt><span class="sect1"><a href="setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="sect1"><a href="configure.html">Configure</a></span></dt><dt><span class="sect1"><a href="make.html">Make</a></span></dt><dt><span class="sect1"><a href="test.html">Test</a></span></dt><dd><dl><dt><span class="sect2"><a href="test.html#test.organization">Organization</a></span></dt><dt><span class="sect2"><a href="test.html#test.run">Running the Testsuite</a></span></dt><dt><span class="sect2"><a href="test.html#test.new_tests">Writing a new test case</a></span></dt><dt><span class="sect2"><a href="test.html#test.harness">Test Harness and Utilities</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="using.html">3. Using</a></span></dt><dd><dl><dt><span class="sect1"><a href="using.html#manual.intro.using.lib">Linking Library Binary Files</a></span></dt><dt><span class="sect1"><a href="using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.cheaders">The C Headers and namespace std</a></span></dt><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="sect1"><a href="using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="sect2"><a href="using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="sect2"><a href="using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="sect1"><a href="using_macros.html">Macros</a></span></dt><dt><span class="sect1"><a href="using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.propagating">Propagating Exceptions aka Exception Neutrality</a></span></dt><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.no">Support for -fno-exceptions</a></span></dt></dl></dd><dt><span class="sect1"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="sect2"><a href="debug.html#debug.compiler">Using g++</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.gdb">Using gdb</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt></dl></dd></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="spine.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="status.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">The GNU C++ Library </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 1. Status</td></tr></table></div></body></html>
+ <a id="id690392" class="indexterm"></a>
+</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="status.html">1. Status</a></span></dt><dd><dl><dt><span class="sect1"><a href="status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="sect2"><a href="status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dt><span class="sect2"><a href="status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="sect2"><a href="status.html#status.iso.200x">C++ 200x</a></span></dt><dt><span class="sect2"><a href="status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="sect1"><a href="license.html">License</a></span></dt><dd><dl><dt><span class="sect2"><a href="license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="sect2"><a href="license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="sect1"><a href="bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="sect2"><a href="bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="sect2"><a href="bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="setup.html">2. Setup</a></span></dt><dd><dl><dt><span class="sect1"><a href="setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="sect1"><a href="configure.html">Configure</a></span></dt><dt><span class="sect1"><a href="make.html">Make</a></span></dt></dl></dd><dt><span class="chapter"><a href="using.html">3. Using</a></span></dt><dd><dl><dt><span class="sect1"><a href="using.html#manual.intro.using.lib">Linking Library Binary Files</a></span></dt><dt><span class="sect1"><a href="using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.cheaders">The C Headers and namespace std</a></span></dt><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="sect1"><a href="using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="sect2"><a href="using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="sect2"><a href="using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="sect1"><a href="using_macros.html">Macros</a></span></dt><dt><span class="sect1"><a href="using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt></dl></dd><dt><span class="sect1"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="sect2"><a href="debug.html#debug.compiler">Using g++</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.gdb">Using gdb</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="spine.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="status.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">The GNU C++ Library </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 1. Status</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/io.html b/libstdc++-v3/doc/html/manual/io.html
index b5a30497632..1ede95bdcda 100644
--- a/libstdc++-v3/doc/html/manual/io.html
+++ b/libstdc++-v3/doc/html/manual/io.html
@@ -5,5 +5,5 @@
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt10ch23s02.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="iostream_objects.html">Next</a></td></tr></table><hr /></div><div class="part" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="manual.io"></a>Part XI. 
Input and Output
- <a id="id460605" class="indexterm"></a>
+ <a id="id585725" class="indexterm"></a>
</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="iostream_objects.html">24. Iostream Objects</a></span></dt><dt><span class="chapter"><a href="streambufs.html">25. Stream Buffers</a></span></dt><dd><dl><dt><span class="sect1"><a href="streambufs.html#io.streambuf.derived">Derived streambuf Classes</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch25s02.html">Buffering</a></span></dt></dl></dd><dt><span class="chapter"><a href="stringstreams.html">26. Memory Based Streams</a></span></dt><dd><dl><dt><span class="sect1"><a href="stringstreams.html#manual.io.memstreams.compat">Compatibility With strstream</a></span></dt></dl></dd><dt><span class="chapter"><a href="fstreams.html">27. File Based Streams</a></span></dt><dd><dl><dt><span class="sect1"><a href="fstreams.html#manual.io.filestreams.copying_a_file">Copying a File</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch27s02.html">Binary Input and Output</a></span></dt></dl></dd><dt><span class="chapter"><a href="io_and_c.html">28. Interacting with C</a></span></dt><dd><dl><dt><span class="sect1"><a href="io_and_c.html#manual.io.c.FILE">Using FILE* and file descriptors</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch28s02.html">Performance</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt10ch23s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="iostream_objects.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">C99 </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 24. Iostream Objects</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/io_and_c.html b/libstdc++-v3/doc/html/manual/io_and_c.html
index e85fe0d00d2..e5fe3c77da2 100644
--- a/libstdc++-v3/doc/html/manual/io_and_c.html
+++ b/libstdc++-v3/doc/html/manual/io_and_c.html
@@ -4,7 +4,7 @@
Input and Output
</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt11ch28s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.io.c"></a>Chapter 28. Interacting with C</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="io_and_c.html#manual.io.c.FILE">Using FILE* and file descriptors</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch28s02.html">Performance</a></span></dt></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.io.c.FILE"></a>Using FILE* and file descriptors</h2></div></div></div><p>
- See the <a class="link" href="ext_io.html" title="Chapter 38. Input and Output">extensions</a> for using
+ See the <a class="link" href="ext_io.html" title="Chapter 39. Input and Output">extensions</a> for using
<span class="type">FILE</span> and <span class="type">file descriptors</span> with
<code class="classname">ofstream</code> and
<code class="classname">ifstream</code>.
diff --git a/libstdc++-v3/doc/html/manual/iterators.html b/libstdc++-v3/doc/html/manual/iterators.html
index 046bf075b9b..a002097bfcd 100644
--- a/libstdc++-v3/doc/html/manual/iterators.html
+++ b/libstdc++-v3/doc/html/manual/iterators.html
@@ -5,5 +5,5 @@
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bitset.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt08ch19.html">Next</a></td></tr></table><hr /></div><div class="part" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="manual.iterators"></a>Part VIII. 
Iterators
- <a id="id388807" class="indexterm"></a>
+ <a id="id632651" class="indexterm"></a>
</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="bk01pt08ch19.html">19. Predefined</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt08ch19.html#iterators.predefined.vs_pointers">Iterators vs. Pointers</a></span></dt><dt><span class="sect1"><a href="bk01pt08ch19s02.html">One Past the End</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bitset.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt08ch19.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">bitset </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 19. Predefined</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/locales.html b/libstdc++-v3/doc/html/manual/locales.html
index 49634676312..296e8aecbba 100644
--- a/libstdc++-v3/doc/html/manual/locales.html
+++ b/libstdc++-v3/doc/html/manual/locales.html
@@ -398,25 +398,25 @@ global locale" (emphasis Paolo), that is:
What should non-required facet instantiations do? If the
generic implementation is provided, then how to end-users
provide specializations?
- </p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="locales.locale.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id419927"></a><p><span class="title"><i>
+ </p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="locales.locale.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id658666"></a><p><span class="title"><i>
The GNU C Library
- </i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling and 7 Locales and Internationalization. </span></p></div><div class="biblioentry"><a id="id426714"></a><p><span class="title"><i>
+ </i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling and 7 Locales and Internationalization. </span></p></div><div class="biblioentry"><a id="id679103"></a><p><span class="title"><i>
Correspondence
- </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id426743"></a><p><span class="title"><i>
+ </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id635262"></a><p><span class="title"><i>
ISO/IEC 14882:1998 Programming languages - C++
- </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id438110"></a><p><span class="title"><i>
+ </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id709948"></a><p><span class="title"><i>
ISO/IEC 9899:1999 Programming languages - C
- </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id438128"></a><p><span class="title"><i>
- System Interface Definitions, Issue 6 (IEEE Std. 1003.1-200x)
+ </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id709967"></a><p><span class="title"><i>
+ The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004)
</i>. </span><span class="copyright">Copyright © 1999
The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span><span class="biblioid">
- <a class="ulink" href="http://www.opennc.org/austin/docreg.html" target="_top">
+ <a class="ulink" href="http://www.unix.org/version3/ieee_std.html" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id516788"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id618881"></a><p><span class="title"><i>
The C++ Programming Language, Special Edition
</i>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry"><a id="id532385"></a><p><span class="title"><i>
+ . </span></span></p></div><div class="biblioentry"><a id="id641063"></a><p><span class="title"><i>
Standard C++ IOStreams and Locales
</i>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference
diff --git a/libstdc++-v3/doc/html/manual/localization.html b/libstdc++-v3/doc/html/manual/localization.html
index 5f30a5fb542..152956fa176 100644
--- a/libstdc++-v3/doc/html/manual/localization.html
+++ b/libstdc++-v3/doc/html/manual/localization.html
@@ -5,5 +5,5 @@
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt05ch13s06.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="locales.html">Next</a></td></tr></table><hr /></div><div class="part" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="manual.localization"></a>Part VI. 
Localization
- <a id="id453876" class="indexterm"></a>
+ <a id="id585411" class="indexterm"></a>
</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="locales.html">14. Locales</a></span></dt><dd><dl><dt><span class="sect1"><a href="locales.html#manual.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="sect2"><a href="locales.html#locales.locale.req">Requirements</a></span></dt><dt><span class="sect2"><a href="locales.html#locales.locale.design">Design</a></span></dt><dt><span class="sect2"><a href="locales.html#locales.locale.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="locales.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="facets.html">15. Facets aka Categories</a></span></dt><dd><dl><dt><span class="sect1"><a href="facets.html#manual.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="sect2"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="codecvt.html">codecvt</a></span></dt><dd><dl><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.design">Design</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.use">Use</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="messages.html">messages</a></span></dt><dd><dl><dt><span class="sect2"><a href="messages.html#facet.messages.req">Requirements</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.design">Design</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.use">Use</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt05ch13s06.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="locales.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">CString (MFC) </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 14. Locales</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/make.html b/libstdc++-v3/doc/html/manual/make.html
index 6a56ea690da..2563d277938 100644
--- a/libstdc++-v3/doc/html/manual/make.html
+++ b/libstdc++-v3/doc/html/manual/make.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Make</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="setup.html" title="Chapter 2. Setup" /><link rel="prev" href="configure.html" title="Configure" /><link rel="next" href="test.html" title="Test" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Make</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="configure.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Setup</th><td width="20%" align="right"> <a accesskey="n" href="test.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.setup.make"></a>Make</h2></div></div></div><p>If you have never done this before, you should read the basic
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Make</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="setup.html" title="Chapter 2. Setup" /><link rel="prev" href="configure.html" title="Configure" /><link rel="next" href="using.html" title="Chapter 3. Using" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Make</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="configure.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Setup</th><td width="20%" align="right"> <a accesskey="n" href="using.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.setup.make"></a>Make</h2></div></div></div><p>If you have never done this before, you should read the basic
<a class="ulink" href="http://gcc.gnu.org/install/" target="_top">GCC Installation
Instructions</a> first. Read <span class="emphasis"><em>all of them</em></span>.
<span class="emphasis"><em>Twice.</em></span>
</p><p>Then type:<span class="command"><strong>make</strong></span>, and congratulations, you're
started to build.
-</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="configure.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="setup.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="test.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Configure </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Test</td></tr></table></div></body></html>
+</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="configure.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="setup.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="using.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Configure </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 3. Using</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/memory.html b/libstdc++-v3/doc/html/manual/memory.html
index 25e863d9e89..b49003b7a82 100644
--- a/libstdc++-v3/doc/html/manual/memory.html
+++ b/libstdc++-v3/doc/html/manual/memory.html
@@ -93,7 +93,7 @@
or loading and unloading shared objects in memory. As such, using
caching allocators on systems that do not support
<code class="function">abi::__cxa_atexit</code> is not recommended.
- </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.impl"></a>Implementation</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id387134"></a>Interface Design</h4></div></div></div><p>
+ </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.impl"></a>Implementation</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id712986"></a>Interface Design</h4></div></div></div><p>
The only allocator interface that
is support is the standard C++ interface. As such, all STL
containers have been adjusted, and all external allocators have
@@ -106,7 +106,7 @@
</p><p>
The base class that <code class="classname">allocator</code> is derived from
may not be user-configurable.
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id511422"></a>Selecting Default Allocation Policy</h4></div></div></div><p>
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id629278"></a>Selecting Default Allocation Policy</h4></div></div></div><p>
It's difficult to pick an allocation strategy that will provide
maximum utility, without excessively penalizing some behavior. In
fact, it's difficult just deciding which typical actions to measure
@@ -143,7 +143,7 @@
The current default choice for
<code class="classname">allocator</code> is
<code class="classname">__gnu_cxx::new_allocator</code>.
- </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id532133"></a>Disabling Memory Caching</h4></div></div></div><p>
+ </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id711751"></a>Disabling Memory Caching</h4></div></div></div><p>
In use, <code class="classname">allocator</code> may allocate and
deallocate using implementation-specified strategies and
heuristics. Because of this, every call to an allocator object's
@@ -308,11 +308,11 @@
A high-performance allocator that uses a bit-map to keep track
of the used and unused memory locations. It has its own
documentation, found <a class="link" href="bitmap_allocator.html" title="bitmap_allocator">here</a>.
- </p></li></ol></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id426851"></a><p><span class="title"><i>
+ </p></li></ol></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id710951"></a><p><span class="title"><i>
ISO/IEC 14882:1998 Programming languages - C++
</i>. </span>
isoc++_1998
- <span class="pagenums">20.4 Memory. </span></p></div><div class="biblioentry"><a id="id426866"></a><p><span class="title"><i>The Standard Librarian: What Are Allocators Good
+ <span class="pagenums">20.4 Memory. </span></p></div><div class="biblioentry"><a id="id710966"></a><p><span class="title"><i>The Standard Librarian: What Are Allocators Good
</i>. </span>
austernm
<span class="author"><span class="firstname">Matt</span> <span class="surname">Austern</span>. </span><span class="publisher"><span class="publishername">
@@ -320,28 +320,28 @@
. </span></span><span class="biblioid">
<a class="ulink" href="http://www.cuj.com/documents/s=8000/cujcexp1812austern/" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id495648"></a><p><span class="title"><i>The Hoard Memory Allocator</i>. </span>
+ . </span></p></div><div class="biblioentry"><a id="id644430"></a><p><span class="title"><i>The Hoard Memory Allocator</i>. </span>
emeryb
<span class="author"><span class="firstname">Emery</span> <span class="surname">Berger</span>. </span><span class="biblioid">
<a class="ulink" href="http://www.cs.umass.edu/~emery/hoard/" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id459688"></a><p><span class="title"><i>Reconsidering Custom Memory Allocation</i>. </span>
+ . </span></p></div><div class="biblioentry"><a id="id689922"></a><p><span class="title"><i>Reconsidering Custom Memory Allocation</i>. </span>
bergerzorn
<span class="author"><span class="firstname">Emery</span> <span class="surname">Berger</span>. </span><span class="author"><span class="firstname">Ben</span> <span class="surname">Zorn</span>. </span><span class="author"><span class="firstname">Kathryn</span> <span class="surname">McKinley</span>. </span><span class="copyright">Copyright © 2002 OOPSLA. </span><span class="biblioid">
<a class="ulink" href="http://www.cs.umass.edu/~emery/pubs/berger-oopsla2002.pdf" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id516756"></a><p><span class="title"><i>Allocator Types</i>. </span>
+ . </span></p></div><div class="biblioentry"><a id="id709355"></a><p><span class="title"><i>Allocator Types</i>. </span>
kreftlanger
<span class="author"><span class="firstname">Klaus</span> <span class="surname">Kreft</span>. </span><span class="author"><span class="firstname">Angelika</span> <span class="surname">Langer</span>. </span><span class="publisher"><span class="publishername">
C/C++ Users Journal
. </span></span><span class="biblioid">
<a class="ulink" href="http://www.langer.camelot.de/Articles/C++Report/Allocators/Allocators.html" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id459976"></a><p><span class="title"><i>The C++ Programming Language</i>. </span>
+ . </span></p></div><div class="biblioentry"><a id="id642689"></a><p><span class="title"><i>The C++ Programming Language</i>. </span>
tcpl
<span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 . </span><span class="pagenums">19.4 Allocators. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry"><a id="id451788"></a><p><span class="title"><i>Yalloc: A Recycling C++ Allocator</i>. </span>
+ . </span></span></p></div><div class="biblioentry"><a id="id614194"></a><p><span class="title"><i>Yalloc: A Recycling C++ Allocator</i>. </span>
yenf
<span class="author"><span class="firstname">Felix</span> <span class="surname">Yen</span>. </span><span class="copyright">Copyright © . </span><span class="biblioid">
<a class="ulink" href="http://home.earthlink.net/~brimar/yalloc/" target="_top">
diff --git a/libstdc++-v3/doc/html/manual/messages.html b/libstdc++-v3/doc/html/manual/messages.html
index eb5b9f04c9a..e21adac3025 100644
--- a/libstdc++-v3/doc/html/manual/messages.html
+++ b/libstdc++-v3/doc/html/manual/messages.html
@@ -241,42 +241,42 @@ void test01()
model. As of this writing, it is unknown how to query to see
if a specified message catalog exists using the gettext
package.
- </p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="facet.messages.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id442887"></a><p><span class="title"><i>
+ </p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="facet.messages.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id699687"></a><p><span class="title"><i>
The GNU C Library
</i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling, and 7 Locales and Internationalization
- . </span></p></div><div class="biblioentry"><a id="id417173"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id622574"></a><p><span class="title"><i>
Correspondence
- </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id417202"></a><p><span class="title"><i>
+ </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id630269"></a><p><span class="title"><i>
ISO/IEC 14882:1998 Programming languages - C++
- </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id468091"></a><p><span class="title"><i>
+ </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id630287"></a><p><span class="title"><i>
ISO/IEC 9899:1999 Programming languages - C
- </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id468109"></a><p><span class="title"><i>
+ </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id630306"></a><p><span class="title"><i>
System Interface Definitions, Issue 6 (IEEE Std. 1003.1-200x)
</i>. </span><span class="copyright">Copyright © 1999
The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span><span class="biblioid">
<a class="ulink" href="http://www.opengroup.org/austin/" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id524743"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id567615"></a><p><span class="title"><i>
The C++ Programming Language, Special Edition
</i>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry"><a id="id450555"></a><p><span class="title"><i>
+ . </span></span></p></div><div class="biblioentry"><a id="id621555"></a><p><span class="title"><i>
Standard C++ IOStreams and Locales
</i>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference
. </span><span class="author"><span class="firstname">Angelika</span> <span class="surname">Langer</span>. </span><span class="author"><span class="firstname">Klaus</span> <span class="surname">Kreft</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley Longman, Inc.. </span><span class="publisher"><span class="publishername">
Addison Wesley Longman
- . </span></span></p></div><div class="biblioentry"><a id="id486251"></a><p><span class="title"><i>
+ . </span></span></p></div><div class="biblioentry"><a id="id646611"></a><p><span class="title"><i>
Java 2 Platform, Standard Edition, v 1.3.1 API Specification
</i>. </span><span class="pagenums">java.util.Properties, java.text.MessageFormat,
java.util.Locale, java.util.ResourceBundle. </span><span class="biblioid">
<a class="ulink" href="http://java.sun.com/reference/api/index.html" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id486272"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id682026"></a><p><span class="title"><i>
GNU gettext tools, version 0.10.38, Native Language Support
Library and Tools.
</i>. </span><span class="biblioid">
- <a class="ulink" href="http://sources.redhat.com/gettext" target="_top">
+ <a class="ulink" href="http://www.gnu.org/software/gettext/" target="_top">
</a>
. </span></p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="codecvt.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="facets.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="containers.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">codecvt </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Part VII. 
Containers
diff --git a/libstdc++-v3/doc/html/manual/numerics.html b/libstdc++-v3/doc/html/manual/numerics.html
index e4339376002..457f548f437 100644
--- a/libstdc++-v3/doc/html/manual/numerics.html
+++ b/libstdc++-v3/doc/html/manual/numerics.html
@@ -5,5 +5,5 @@
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt09ch20.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="complex.html">Next</a></td></tr></table><hr /></div><div class="part" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="manual.numerics"></a>Part X. 
Numerics
- <a id="id443615" class="indexterm"></a>
+ <a id="id624917" class="indexterm"></a>
</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="complex.html">21. Complex</a></span></dt><dd><dl><dt><span class="sect1"><a href="complex.html#numerics.complex.processing">complex Processing</a></span></dt></dl></dd><dt><span class="chapter"><a href="generalized_numeric_operations.html">22. Generalized Operations</a></span></dt><dt><span class="chapter"><a href="numerics_and_c.html">23. Interacting with C</a></span></dt><dd><dl><dt><span class="sect1"><a href="numerics_and_c.html#numerics.c.array">Numerics vs. Arrays</a></span></dt><dt><span class="sect1"><a href="bk01pt10ch23s02.html">C99</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt09ch20.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="complex.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 20. Mutating </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 21. Complex</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/parallel_mode.html b/libstdc++-v3/doc/html/manual/parallel_mode.html
index cbcdebaf9b9..635ef1dd6a1 100644
--- a/libstdc++-v3/doc/html/manual/parallel_mode.html
+++ b/libstdc++-v3/doc/html/manual/parallel_mode.html
@@ -13,11 +13,11 @@ explicit source declaration or by compiling existing sources with a
specific compiler flag.
</p><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.parallel_mode.intro"></a>Intro</h2></div></div></div><p>The following library components in the include
<code class="filename">numeric</code> are included in the parallel mode:</p><div class="itemizedlist"><ul type="disc"><li><p><code class="function">std::accumulate</code></p></li><li><p><code class="function">std::adjacent_difference</code></p></li><li><p><code class="function">std::inner_product</code></p></li><li><p><code class="function">std::partial_sum</code></p></li></ul></div><p>The following library components in the include
-<code class="filename">algorithm</code> are included in the parallel mode:</p><div class="itemizedlist"><ul type="disc"><li><p><code class="function">std::adjacent_find</code></p></li><li><p><code class="function">std::count</code></p></li><li><p><code class="function">std::count_if</code></p></li><li><p><code class="function">std::equal</code></p></li><li><p><code class="function">std::find</code></p></li><li><p><code class="function">std::find_if</code></p></li><li><p><code class="function">std::find_first_of</code></p></li><li><p><code class="function">std::for_each</code></p></li><li><p><code class="function">std::generate</code></p></li><li><p><code class="function">std::generate_n</code></p></li><li><p><code class="function">std::lexicographical_compare</code></p></li><li><p><code class="function">std::mismatch</code></p></li><li><p><code class="function">std::search</code></p></li><li><p><code class="function">std::search_n</code></p></li><li><p><code class="function">std::transform</code></p></li><li><p><code class="function">std::replace</code></p></li><li><p><code class="function">std::replace_if</code></p></li><li><p><code class="function">std::max_element</code></p></li><li><p><code class="function">std::merge</code></p></li><li><p><code class="function">std::min_element</code></p></li><li><p><code class="function">std::nth_element</code></p></li><li><p><code class="function">std::partial_sort</code></p></li><li><p><code class="function">std::partition</code></p></li><li><p><code class="function">std::random_shuffle</code></p></li><li><p><code class="function">std::set_union</code></p></li><li><p><code class="function">std::set_intersection</code></p></li><li><p><code class="function">std::set_symmetric_difference</code></p></li><li><p><code class="function">std::set_difference</code></p></li><li><p><code class="function">std::sort</code></p></li><li><p><code class="function">std::stable_sort</code></p></li><li><p><code class="function">std::unique_copy</code></p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h2 class="title"><a id="parallel_mode.biblio"></a>Bibliography</h2></div></div></div><div class="biblioentry"><a id="id426541"></a><p><span class="title"><i>
+<code class="filename">algorithm</code> are included in the parallel mode:</p><div class="itemizedlist"><ul type="disc"><li><p><code class="function">std::adjacent_find</code></p></li><li><p><code class="function">std::count</code></p></li><li><p><code class="function">std::count_if</code></p></li><li><p><code class="function">std::equal</code></p></li><li><p><code class="function">std::find</code></p></li><li><p><code class="function">std::find_if</code></p></li><li><p><code class="function">std::find_first_of</code></p></li><li><p><code class="function">std::for_each</code></p></li><li><p><code class="function">std::generate</code></p></li><li><p><code class="function">std::generate_n</code></p></li><li><p><code class="function">std::lexicographical_compare</code></p></li><li><p><code class="function">std::mismatch</code></p></li><li><p><code class="function">std::search</code></p></li><li><p><code class="function">std::search_n</code></p></li><li><p><code class="function">std::transform</code></p></li><li><p><code class="function">std::replace</code></p></li><li><p><code class="function">std::replace_if</code></p></li><li><p><code class="function">std::max_element</code></p></li><li><p><code class="function">std::merge</code></p></li><li><p><code class="function">std::min_element</code></p></li><li><p><code class="function">std::nth_element</code></p></li><li><p><code class="function">std::partial_sort</code></p></li><li><p><code class="function">std::partition</code></p></li><li><p><code class="function">std::random_shuffle</code></p></li><li><p><code class="function">std::set_union</code></p></li><li><p><code class="function">std::set_intersection</code></p></li><li><p><code class="function">std::set_symmetric_difference</code></p></li><li><p><code class="function">std::set_difference</code></p></li><li><p><code class="function">std::sort</code></p></li><li><p><code class="function">std::stable_sort</code></p></li><li><p><code class="function">std::unique_copy</code></p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h2 class="title"><a id="parallel_mode.biblio"></a>Bibliography</h2></div></div></div><div class="biblioentry"><a id="id660222"></a><p><span class="title"><i>
Parallelization of Bulk Operations for STL Dictionaries
</i>. </span><span class="author"><span class="firstname">Johannes</span> <span class="surname">Singler</span>. </span><span class="author"><span class="firstname">Leonor</span> <span class="surname">Frias</span>. </span><span class="copyright">Copyright © 2007 . </span><span class="publisher"><span class="publishername">
Workshop on Highly Parallel Processing on a Chip (HPPC) 2007. (LNCS)
- . </span></span></p></div><div class="biblioentry"><a id="id426587"></a><p><span class="title"><i>
+ . </span></span></p></div><div class="biblioentry"><a id="id660269"></a><p><span class="title"><i>
The Multi-Core Standard Template Library
</i>. </span><span class="author"><span class="firstname">Johannes</span> <span class="surname">Singler</span>. </span><span class="author"><span class="firstname">Peter</span> <span class="surname">Sanders</span>. </span><span class="author"><span class="firstname">Felix</span> <span class="surname">Putze</span>. </span><span class="copyright">Copyright © 2007 . </span><span class="publisher"><span class="publishername">
Euro-Par 2007: Parallel Processing. (LNCS 4641)
diff --git a/libstdc++-v3/doc/html/manual/profile_mode.html b/libstdc++-v3/doc/html/manual/profile_mode.html
new file mode 100644
index 00000000000..e47ecdb67e1
--- /dev/null
+++ b/libstdc++-v3/doc/html/manual/profile_mode.html
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 32. Profile Mode</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="bk01pt12ch31s05.html" title="Testing" /><link rel="next" href="bk01pt12ch32s02.html" title="Design" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 32. Profile Mode</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch31s05.html">Prev</a> </td><th width="60%" align="center">Part XII. 
+ Extensions
+
+</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch32s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.profile_mode"></a>Chapter 32. Profile Mode</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="profile_mode.html#manual.ext.profile_mode.intro">Intro</a></span></dt><dd><dl><dt><span class="sect2"><a href="profile_mode.html#manual.ext.profile_mode.using">Using the Profile Mode</a></span></dt><dt><span class="sect2"><a href="profile_mode.html#manual.ext.profile_mode.tuning">Tuning the Profile Mode</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch32s02.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch32s02.html#manual.ext.profile_mode.design.wrapper">Wrapper Model</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s02.html#manual.ext.profile_mode.design.instrumentation">Instrumentation</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s02.html#manual.ext.profile_mode.design.rtlib">Run Time Behavior</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s02.html#manual.ext.profile_mode.design.analysis">Analysis and Diagnostics</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s02.html#manual.ext.profile_mode.design.cost-model">Cost Model</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s02.html#manual.ext.profile_mode.design.reports">Reports</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s02.html#manual.ext.profile_mode.design.testing">Testing</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch32s03.html">Extensions for Custom Containers</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch32s04.html">Empirical Cost Model</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch32s05.html">Implementation Issues</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch32s05.html#manual.ext.profile_mode.implementation.stack">Stack Traces</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s05.html#manual.ext.profile_mode.implementation.symbols">Symbolization of Instruction Addresses</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s05.html#manual.ext.profile_mode.implementation.concurrency">Concurrency</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s05.html#manual.ext.profile_mode.implementation.stdlib-in-proflib">Using the Standard Library in the Instrumentation Implementation</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s05.html#manual.ext.profile_mode.implementation.malloc-hooks">Malloc Hooks</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s05.html#manual.ext.profile_mode.implementation.construction-destruction">Construction and Destruction of Global Objects</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch32s06.html">Developer Information</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch32s06.html#manual.ext.profile_mode.developer.bigpic">Big Picture</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s06.html#manual.ext.profile_mode.developer.howto">How To Add A Diagnostic</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch32s07.html">Diagnostics</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch32s07.html#manual.ext.profile_mode.analysis.template">Diagnostic Template</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s07.html#manual.ext.profile_mode.analysis.containers">Containers</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s07.html#manual.ext.profile_mode.analysis.algorithms">Algorithms</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s07.html#manual.ext.profile_mode.analysis.locality">Data Locality</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s07.html#manual.ext.profile_mode.analysis.mthread">Multithreaded Data Access</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s07.html#manual.ext.profile_mode.analysis.statistics">Statistics</a></span></dt></dl></dd><dt><span class="bibliography"><a href="profile_mode.html#profile_mode.biblio">Bibliography</a></span></dt></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.intro"></a>Intro</h2></div></div></div><p>
+ <span class="emphasis"><em>Goal: </em></span>Give performance improvement advice based on
+ recognition of suboptimal usage patterns of the standard library.
+ </p><p>
+ <span class="emphasis"><em>Method: </em></span>Wrap the standard library code. Insert
+ calls to an instrumentation library to record the internal state of
+ various components at interesting entry/exit points to/from the standard
+ library. Process trace, recognize suboptimal patterns, give advice.
+ For details, see
+ <a class="ulink" href="http://dx.doi.org/10.1109/CGO.2009.36" target="_top">paper presented at
+ CGO 2009</a>.
+ </p><p>
+ <span class="emphasis"><em>Strengths: </em></span>
+</p><div class="itemizedlist"><ul type="disc"><li><p>
+ Unintrusive solution. The application code does not require any
+ modification.
+ </p></li><li><p> The advice is call context sensitive, thus capable of
+ identifying precisely interesting dynamic performance behavior.
+ </p></li><li><p>
+ The overhead model is pay-per-view. When you turn off a diagnostic class
+ at compile time, its overhead disappears.
+ </p></li></ul></div><p>
+ </p><p>
+ <span class="emphasis"><em>Drawbacks: </em></span>
+</p><div class="itemizedlist"><ul type="disc"><li><p>
+ You must recompile the application code with custom options.
+ </p></li><li><p>You must run the application on representative input.
+ The advice is input dependent.
+ </p></li><li><p>
+ The execution time will increase, in some cases by factors.
+ </p></li></ul></div><p>
+ </p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.using"></a>Using the Profile Mode</h3></div></div></div><p>
+ This is the anticipated common workflow for program <code class="code">foo.cc</code>:
+</p><pre class="programlisting">
+$ cat foo.cc
+#include &lt;vector&gt;
+int main() {
+ vector&lt;int&gt; v;
+ for (int k = 0; k &lt; 1024; ++k) v.insert(v.begin(), k);
+}
+
+$ g++ -D_GLIBCXX_PROFILE foo.cc
+$ ./a.out
+$ cat libstdcxx-profile.txt
+vector-to-list: improvement = 5: call stack = 0x804842c ...
+ : advice = change std::vector to std::list
+vector-size: improvement = 3: call stack = 0x804842c ...
+ : advice = change initial container size from 0 to 1024
+</pre><p>
+ </p><p>
+ Anatomy of a warning:
+ </p><div class="itemizedlist"><ul type="disc"><li><p>
+ Warning id. This is a short descriptive string for the class
+ that this warning belongs to. E.g., "vector-to-list".
+ </p></li><li><p>
+ Estimated improvement. This is an approximation of the benefit expected
+ from implementing the change suggested by the warning. It is given on
+ a log10 scale. Negative values mean that the alternative would actually
+ do worse than the current choice.
+ In the example above, 5 comes from the fact that the overhead of
+ inserting at the beginning of a vector vs. a list is around 1024 * 1024 / 2,
+ which is around 10e5. The improvement from setting the initial size to
+ 1024 is in the range of 10e3, since the overhead of dynamic resizing is
+ linear in this case.
+ </p></li><li><p>
+ Call stack. Currently, the addresses are printed without
+ symbol name or code location attribution.
+ Users are expected to postprocess the output using, for instance, addr2line.
+ </p></li><li><p>
+ The warning message. For some warnings, this is static text, e.g.,
+ "change vector to list". For other warnings, such as the one above,
+ the message contains numeric advice, e.g., the suggested initial size
+ of the hashtable.
+ </p></li></ul></div><p>
+ </p><p>Two files are generated. <code class="code">libstdcxx-profile.txt</code>
+ contains human readable advice. <code class="code">libstdcxx-profile.raw</code>
+ contains implementation specific data about each diagnostic.
+ Their format is not documented. They are sufficient to generate
+ all the advice given in <code class="code">libstdcxx-profile.txt</code>. The advantage
+ of keeping this raw format is that traces from multiple executions can
+ be aggregated simply by concatenating the raw traces. We intend to
+ offer an external utility program that can issue advice from a trace.
+ </p><p>Advice is given regardless whether the transformation is valid.
+ For instance, we advise changing a map to an unordered_map even if the
+ application semantics require that data be ordered.
+ We believe such warnings can help users understand the performance
+ behavior of their application better, which can lead to changes
+ at a higher abstraction level.
+ </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.tuning"></a>Tuning the Profile Mode</h3></div></div></div><p>Compile time switches and environment variables (see also file
+ profiler.h). Unless specified otherwise, they can be set at compile time
+ using -D_&lt;name&gt; or by setting variable &lt;name&gt;
+ in the environment where the program is run, before starting execution.
+ </p><div class="itemizedlist"><ul type="disc"><li><p>
+ <code class="code">[NO]_GLIBCXX_PROFILE_&lt;diagnostic&gt;</code>:
+ enable/disable specific diagnostics.
+ See section Diagnostics for possible values.
+ (Environment variables not supported.)
+ </p></li><li><p>
+ <code class="code">GLIBCXX_PROFILE_TRACE_PATH_ROOT</code>: set an alternative root
+ path for the output files.
+ </p></li><li><p>GLIBCXX_PROFILE_MAX_WARN_COUNT: set it to the maximum
+ number of warnings desired. The default value is 10.</p></li><li><p>
+ <code class="code">GLIBCXX_PROFILE_MAX_STACK_DEPTH</code>: if set to 0,
+ the advice will
+ be collected and reported for the program as a whole, and not for each
+ call context.
+ This could also be used in continuous regression tests, where you
+ just need to know whether there is a regression or not.
+ The default value is 32.
+ </p></li><li><p>
+ <code class="code">GLIBCXX_PROFILE_MEM_PER_DIAGNOSTIC</code>:
+ set a limit on how much memory to use for the accounting tables for each
+ diagnostic type. When this limit is reached, new events are ignored
+ until the memory usage decreases under the limit. Generally, this means
+ that newly created containers will not be instrumented until some
+ live containers are deleted. The default is 128 MB.
+ </p></li><li><p>
+ <code class="code">GLIBCXX_PROFILE_NOTHREADS</code>:
+ Make the library not use threads. Otherwise, pthread mutexes are used
+ to protect access to internal data structures. This should be useful
+ only if the program is single threaded and you want to avoid the overhead
+ of aquiring/releasing locks unnecessarily.
+ (Environment variable not supported.)
+ </p></li><li><p>
+ <code class="code">HAVE_EXECINFO_H</code>:
+ This name should be defined at library configuration time.
+ If your library was configured without <code class="code">execinfo.h</code>, but
+ you have it in your include path, you can define it explicitly. Without
+ it, advice is collected for the program as a whole, and not for each
+ call context.
+ (Environment variable not supported.)
+ </p></li></ul></div><p>
+ </p></div></div><div class="bibliography"><div class="titlepage"><div><div><h2 class="title"><a id="profile_mode.biblio"></a>Bibliography</h2></div></div></div><div class="biblioentry"><a id="id659013"></a><p><span class="title"><i>
+ Perflint: A Context Sensitive Performance Advisor for C++ Programs
+ </i>. </span><span class="author"><span class="firstname">Lixia</span> <span class="surname">Liu</span>. </span><span class="author"><span class="firstname">Silvius</span> <span class="surname">Rus</span>. </span><span class="copyright">Copyright © 2009 . </span><span class="publisher"><span class="publishername">
+ Proceedings of the 2009 International Symposium on Code Generation
+ and Optimization
+ . </span></span></p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch31s05.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch32s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Testing </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Design</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/setup.html b/libstdc++-v3/doc/html/manual/setup.html
index bab3b46b30c..4d8f3d01172 100644
--- a/libstdc++-v3/doc/html/manual/setup.html
+++ b/libstdc++-v3/doc/html/manual/setup.html
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 2. Setup</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="intro.html" title="Part I.  Introduction" /><link rel="prev" href="bugs.html" title="Bugs" /><link rel="next" href="configure.html" title="Configure" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 2. Setup</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bugs.html">Prev</a> </td><th width="60%" align="center">Part I. 
Introduction
-</th><td width="20%" align="right"> <a accesskey="n" href="configure.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.setup"></a>Chapter 2. Setup</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="sect1"><a href="configure.html">Configure</a></span></dt><dt><span class="sect1"><a href="make.html">Make</a></span></dt><dt><span class="sect1"><a href="test.html">Test</a></span></dt><dd><dl><dt><span class="sect2"><a href="test.html#test.organization">Organization</a></span></dt><dt><span class="sect2"><a href="test.html#test.run">Running the Testsuite</a></span></dt><dt><span class="sect2"><a href="test.html#test.new_tests">Writing a new test case</a></span></dt><dt><span class="sect2"><a href="test.html#test.harness">Test Harness and Utilities</a></span></dt></dl></dd></dl></div><p>To transform libstdc++ sources into installed include files
+</th><td width="20%" align="right"> <a accesskey="n" href="configure.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.setup"></a>Chapter 2. Setup</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="sect1"><a href="configure.html">Configure</a></span></dt><dt><span class="sect1"><a href="make.html">Make</a></span></dt></dl></div><p>To transform libstdc++ sources into installed include files
and properly built binaries useful for linking to other software is
a multi-step process. Steps include getting the sources,
configuring and building the sources, testing, and installation.
diff --git a/libstdc++-v3/doc/html/manual/shared_ptr.html b/libstdc++-v3/doc/html/manual/shared_ptr.html
index 2561558047b..978c7ec54c6 100644
--- a/libstdc++-v3/doc/html/manual/shared_ptr.html
+++ b/libstdc++-v3/doc/html/manual/shared_ptr.html
@@ -29,7 +29,7 @@ drops to zero.
Derived classes override those functions to destroy resources in a context
where the correct dynamic type is known. This is an application of the
technique known as type erasure.
- </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="shared_ptr.impl"></a>Implementation</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id436681"></a>Class Hierarchy</h4></div></div></div><p>
+ </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="shared_ptr.impl"></a>Implementation</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id737043"></a>Class Hierarchy</h4></div></div></div><p>
A <code class="classname">shared_ptr&lt;T&gt;</code> contains a pointer of
type <span class="type">T*</span> and an object of type
<code class="classname">__shared_count</code>. The shared_count contains a
@@ -71,7 +71,7 @@ be forwarded to <span class="type">Tp</span>'s constructor.
Unlike the other <code class="classname">_Sp_counted_*</code> classes, this one is parameterized on the
type of object, not the type of pointer; this is purely a convenience
that simplifies the implementation slightly.
- </p></dd></dl></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id451950"></a>Thread Safety</h4></div></div></div><p>
+ </p></dd></dl></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id656080"></a>Thread Safety</h4></div></div></div><p>
The interface of <code class="classname">tr1::shared_ptr</code> was extended for C++0x
with support for rvalue-references and the other features from
N2351. As with other libstdc++ headers shared by TR1 and C++0x,
@@ -129,7 +129,7 @@ compiler, standard library, platform etc. For the version of
shared_ptr in libstdc++ the compiler and library are fixed, which
makes things much simpler: we have an atomic CAS or we don't, see Lock
Policy below for details.
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id420332"></a>Selecting Lock Policy</h4></div></div></div><p>
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id618309"></a>Selecting Lock Policy</h4></div></div></div><p>
</p><p>
There is a single <code class="classname">_Sp_counted_base</code> class,
which is a template parameterized on the enum
@@ -170,7 +170,7 @@ used when libstdc++ is built without <code class="literal">--enable-threads</cod
<code class="filename">ext/atomicity.h</code>, which detect if the program
is multi-threaded. If only one thread of execution exists in
the program then less expensive non-atomic operations are used.
- </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id515700"></a>Dual C++0x and TR1 Implementation</h4></div></div></div><p>
+ </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id679959"></a>Dual C++0x and TR1 Implementation</h4></div></div></div><p>
The classes derived from <code class="classname">_Sp_counted_base</code> (see Class Hierarchy
below) and <code class="classname">__shared_count</code> are implemented separately for C++0x
and TR1, in <code class="filename">bits/boost_sp_shared_count.h</code> and
@@ -181,7 +181,7 @@ The TR1 implementation is considered relatively stable, so is unlikely to
change unless bug fixes require it. If the code that is common to both
C++0x and TR1 modes needs to diverge further then it might be necessary to
duplicate additional classes and only make changes to the C++0x versions.
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id486010"></a>Related functions and classes</h4></div></div></div><div class="variablelist"><dl><dt><span class="term"><code class="code">dynamic_pointer_cast</code>, <code class="code">static_pointer_cast</code>,
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id680859"></a>Related functions and classes</h4></div></div></div><div class="variablelist"><dl><dt><span class="term"><code class="code">dynamic_pointer_cast</code>, <code class="code">static_pointer_cast</code>,
<code class="code">const_pointer_cast</code></span></dt><dd><p>
As noted in N2351, these functions can be implemented non-intrusively using
the alias constructor. However the aliasing constructor is only available
@@ -214,10 +214,10 @@ is called. Users should not try to use this.
As well as the extra constructors, this implementation also needs some
members of _Sp_counted_deleter to be protected where they could otherwise
be private.
- </p></dd></dl></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="shared_ptr.using"></a>Use</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id478324"></a>Examples</h4></div></div></div><p>
+ </p></dd></dl></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="shared_ptr.using"></a>Use</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id715170"></a>Examples</h4></div></div></div><p>
Examples of use can be found in the testsuite, under
<code class="filename">testsuite/tr1/2_general_utilities/shared_ptr</code>.
- </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id505148"></a>Unresolved Issues</h4></div></div></div><p>
+ </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id686787"></a>Unresolved Issues</h4></div></div></div><p>
The resolution to C++ Standard Library issue <a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#674" target="_top">674</a>,
"shared_ptr interface changes for consistency with N1856" will
need to be implemented after it is accepted into the working
@@ -265,7 +265,7 @@ be private.
code to work with, Peter Dimov in particular for his help and
invaluable advice on thread safety. Phillip Jordan and Paolo
Carlini for the lock policy implementation.
- </p></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="shared_ptr.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id450490"></a><p>[<abbr class="abbrev">
+ </p></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="shared_ptr.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id622100"></a><p>[<abbr class="abbrev">
n2351
</abbr>] <span class="title"><i>
Improving shared_ptr for C++0x, Revision 2
@@ -274,7 +274,7 @@ be private.
. </span><span class="biblioid">
<a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2351.htm" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id450514"></a><p>[<abbr class="abbrev">
+ . </span></p></div><div class="biblioentry"><a id="id622124"></a><p>[<abbr class="abbrev">
n2456
</abbr>] <span class="title"><i>
C++ Standard Library Active Issues List (Revision R52)
@@ -283,7 +283,7 @@ be private.
. </span><span class="biblioid">
<a class="ulink" href="http://open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2456.html" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id419756"></a><p>[<abbr class="abbrev">
+ . </span></p></div><div class="biblioentry"><a id="id635143"></a><p>[<abbr class="abbrev">
n2461
</abbr>] <span class="title"><i>
Working Draft, Standard for Programming Language C++
@@ -292,7 +292,7 @@ be private.
. </span><span class="biblioid">
<a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2461.pdf" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id509508"></a><p>[<abbr class="abbrev">
+ . </span></p></div><div class="biblioentry"><a id="id685426"></a><p>[<abbr class="abbrev">
boostshared_ptr
</abbr>] <span class="title"><i>
Boost C++ Libraries documentation - shared_ptr class template
diff --git a/libstdc++-v3/doc/html/manual/spine.html b/libstdc++-v3/doc/html/manual/spine.html
index 2b326459013..09f971a46e3 100644
--- a/libstdc++-v3/doc/html/manual/spine.html
+++ b/libstdc++-v3/doc/html/manual/spine.html
@@ -2,18 +2,18 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>The GNU C++ Library</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="prev" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="next" href="intro.html" title="Part I.  Introduction" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The GNU C++ Library</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="../spine.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="intro.html">Next</a></td></tr></table><hr /></div><div class="book" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="manual-index"></a>The GNU C++ Library</h1></div><div><p class="copyright">Copyright © 2009
<a class="ulink" href="http://www.fsf.org" target="_top">FSF</a>
- </p></div><div><div class="legalnotice"><a id="id426452"></a><p>
+ </p></div><div><div class="legalnotice"><a id="id699529"></a><p>
<a class="link" href="license.html" title="License">License</a>
</p></div></div></div><hr /></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="part"><a href="intro.html">I.
Introduction
-</a></span></dt><dd><dl><dt><span class="chapter"><a href="status.html">1. Status</a></span></dt><dd><dl><dt><span class="sect1"><a href="status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="sect2"><a href="status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dt><span class="sect2"><a href="status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="sect2"><a href="status.html#status.iso.200x">C++ 200x</a></span></dt></dl></dd><dt><span class="sect1"><a href="license.html">License</a></span></dt><dd><dl><dt><span class="sect2"><a href="license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="sect2"><a href="license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="sect1"><a href="bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="sect2"><a href="bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="sect2"><a href="bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="setup.html">2. Setup</a></span></dt><dd><dl><dt><span class="sect1"><a href="setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="sect1"><a href="configure.html">Configure</a></span></dt><dt><span class="sect1"><a href="make.html">Make</a></span></dt><dt><span class="sect1"><a href="test.html">Test</a></span></dt><dd><dl><dt><span class="sect2"><a href="test.html#test.organization">Organization</a></span></dt><dt><span class="sect2"><a href="test.html#test.run">Running the Testsuite</a></span></dt><dt><span class="sect2"><a href="test.html#test.new_tests">Writing a new test case</a></span></dt><dt><span class="sect2"><a href="test.html#test.harness">Test Harness and Utilities</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="using.html">3. Using</a></span></dt><dd><dl><dt><span class="sect1"><a href="using.html#manual.intro.using.lib">Linking Library Binary Files</a></span></dt><dt><span class="sect1"><a href="using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.cheaders">The C Headers and namespace std</a></span></dt><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="sect1"><a href="using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="sect2"><a href="using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="sect2"><a href="using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="sect1"><a href="using_macros.html">Macros</a></span></dt><dt><span class="sect1"><a href="using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.propagating">Propagating Exceptions aka Exception Neutrality</a></span></dt><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.no">Support for -fno-exceptions</a></span></dt></dl></dd><dt><span class="sect1"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="sect2"><a href="debug.html#debug.compiler">Using g++</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.gdb">Using gdb</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="support.html">II.
+</a></span></dt><dd><dl><dt><span class="chapter"><a href="status.html">1. Status</a></span></dt><dd><dl><dt><span class="sect1"><a href="status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="sect2"><a href="status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dt><span class="sect2"><a href="status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="sect2"><a href="status.html#status.iso.200x">C++ 200x</a></span></dt><dt><span class="sect2"><a href="status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="sect1"><a href="license.html">License</a></span></dt><dd><dl><dt><span class="sect2"><a href="license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="sect2"><a href="license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="sect1"><a href="bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="sect2"><a href="bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="sect2"><a href="bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="setup.html">2. Setup</a></span></dt><dd><dl><dt><span class="sect1"><a href="setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="sect1"><a href="configure.html">Configure</a></span></dt><dt><span class="sect1"><a href="make.html">Make</a></span></dt></dl></dd><dt><span class="chapter"><a href="using.html">3. Using</a></span></dt><dd><dl><dt><span class="sect1"><a href="using.html#manual.intro.using.lib">Linking Library Binary Files</a></span></dt><dt><span class="sect1"><a href="using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.cheaders">The C Headers and namespace std</a></span></dt><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="sect1"><a href="using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="sect2"><a href="using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="sect2"><a href="using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="sect1"><a href="using_macros.html">Macros</a></span></dt><dt><span class="sect1"><a href="using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt></dl></dd><dt><span class="sect1"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="sect2"><a href="debug.html#debug.compiler">Using g++</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.gdb">Using gdb</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="support.html">II.
Support
</a></span></dt><dd><dl><dt><span class="preface"><a href="bk01pt02pr01.html"></a></span></dt><dt><span class="chapter"><a href="fundamental_types.html">4. Types</a></span></dt><dd><dl><dt><span class="sect1"><a href="fundamental_types.html#manual.support.types.fundamental">Fundamental Types</a></span></dt><dt><span class="sect1"><a href="bk01pt02ch04s02.html">Numeric Properties</a></span></dt><dt><span class="sect1"><a href="bk01pt02ch04s03.html">NULL</a></span></dt></dl></dd><dt><span class="chapter"><a href="dynamic_memory.html">5. Dynamic Memory</a></span></dt><dt><span class="chapter"><a href="termination.html">6. Termination</a></span></dt><dd><dl><dt><span class="sect1"><a href="termination.html#support.termination.handlers">Termination Handlers</a></span></dt><dt><span class="sect1"><a href="verbose_termination.html">Verbose Terminate Handler</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="diagnostics.html">III.
Diagnostics
-</a></span></dt><dd><dl><dt><span class="chapter"><a href="exceptions.html">7. Exceptions</a></span></dt><dd><dl><dt><span class="sect1"><a href="exceptions.html#manual.diagnostics.exceptions.hierarchy">Exception Classes</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch07s02.html">Adding Data to Exceptions</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch07s03.html">Cancellation</a></span></dt></dl></dd><dt><span class="chapter"><a href="bk01pt03ch08.html">8. Concept Checking</a></span></dt></dl></dd><dt><span class="part"><a href="utilities.html">IV.
+</a></span></dt><dd><dl><dt><span class="chapter"><a href="exceptions.html">7. Exceptions</a></span></dt><dd><dl><dt><span class="sect1"><a href="exceptions.html#manual.diagnostics.exceptions.hierarchy">Exception Classes</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch07s02.html">Adding Data to Exceptions</a></span></dt></dl></dd><dt><span class="chapter"><a href="bk01pt03ch08.html">8. Concept Checking</a></span></dt></dl></dd><dt><span class="part"><a href="utilities.html">IV.
Utilities
</a></span></dt><dd><dl><dt><span class="chapter"><a href="functors.html">9. Functors</a></span></dt><dt><span class="chapter"><a href="pairs.html">10. Pairs</a></span></dt><dt><span class="chapter"><a href="memory.html">11. Memory</a></span></dt><dd><dl><dt><span class="sect1"><a href="memory.html#manual.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="sect2"><a href="memory.html#allocator.req">Requirements</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="sect1"><a href="auto_ptr.html">auto_ptr</a></span></dt><dd><dl><dt><span class="sect2"><a href="auto_ptr.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="sect2"><a href="auto_ptr.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="shared_ptr.html">shared_ptr</a></span></dt><dd><dl><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.using">Use</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="traits.html">12. Traits</a></span></dt></dl></dd><dt><span class="part"><a href="strings.html">V.
@@ -40,18 +40,18 @@
</a></span></dt><dd><dl><dt><span class="chapter"><a href="iostream_objects.html">24. Iostream Objects</a></span></dt><dt><span class="chapter"><a href="streambufs.html">25. Stream Buffers</a></span></dt><dd><dl><dt><span class="sect1"><a href="streambufs.html#io.streambuf.derived">Derived streambuf Classes</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch25s02.html">Buffering</a></span></dt></dl></dd><dt><span class="chapter"><a href="stringstreams.html">26. Memory Based Streams</a></span></dt><dd><dl><dt><span class="sect1"><a href="stringstreams.html#manual.io.memstreams.compat">Compatibility With strstream</a></span></dt></dl></dd><dt><span class="chapter"><a href="fstreams.html">27. File Based Streams</a></span></dt><dd><dl><dt><span class="sect1"><a href="fstreams.html#manual.io.filestreams.copying_a_file">Copying a File</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch27s02.html">Binary Input and Output</a></span></dt></dl></dd><dt><span class="chapter"><a href="io_and_c.html">28. Interacting with C</a></span></dt><dd><dl><dt><span class="sect1"><a href="io_and_c.html#manual.io.c.FILE">Using FILE* and file descriptors</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch28s02.html">Performance</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="extensions.html">XII.
Extensions
-</a></span></dt><dd><dl><dt><span class="preface"><a href="bk01pt12pr03.html"></a></span></dt><dt><span class="chapter"><a href="ext_compile_checks.html">29. Compile Time Checks</a></span></dt><dt><span class="chapter"><a href="debug_mode.html">30. Debug Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch30s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch30s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch30s03.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch30s03.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch30s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch30s04.html#debug_mode.design.goals">Goals</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch30s04.html#debug_mode.design.methods">Methods</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch30s04.html#debug_mode.design.other">Other Implementations</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="parallel_mode.html">31. Parallel Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch31s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch31s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch31s03.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s03.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s03.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch31s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch31s04.html#parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s04.html#parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s04.html#parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch31s05.html">Testing</a></span></dt><dt><span class="bibliography"><a href="parallel_mode.html#parallel_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_allocators.html">32. Allocators</a></span></dt><dd><dl><dt><span class="sect1"><a href="ext_allocators.html#manual.ext.allocator.mt">mt_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.example_single">Single Thread Example</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.example_multi">Multiple Thread Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="bitmap_allocator.html">bitmap_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="sect2"><a href="bitmap_allocator.html#allocator.bitmap.impl">Implementation</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="ext_containers.html">33. Containers</a></span></dt><dd><dl><dt><span class="sect1"><a href="ext_containers.html#manual.ext.containers.pbds">Policy Based Data Structures</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch33s02.html">HP/SGI</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch33s03.html">Deprecated HP/SGI</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_utilities.html">34. Utilities</a></span></dt><dt><span class="chapter"><a href="ext_algorithms.html">35. Algorithms</a></span></dt><dt><span class="chapter"><a href="ext_numerics.html">36. Numerics</a></span></dt><dt><span class="chapter"><a href="ext_iterators.html">37. Iterators</a></span></dt><dt><span class="chapter"><a href="ext_io.html">38. Input and Output</a></span></dt><dd><dl><dt><span class="sect1"><a href="ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_demangling.html">39. Demangling</a></span></dt><dt><span class="chapter"><a href="ext_concurrency.html">40. Concurrency</a></span></dt><dd><dl><dt><span class="sect1"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="sect2"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch40s02.html">Implementation</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch40s02.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch40s02.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch40s03.html">Use</a></span></dt></dl></dd></dl></dd><dt><span class="appendix"><a href="appendix_contributing.html">A.
+</a></span></dt><dd><dl><dt><span class="preface"><a href="bk01pt12pr03.html"></a></span></dt><dt><span class="chapter"><a href="ext_compile_checks.html">29. Compile Time Checks</a></span></dt><dt><span class="chapter"><a href="debug_mode.html">30. Debug Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch30s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch30s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch30s03.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch30s03.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch30s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch30s04.html#debug_mode.design.goals">Goals</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch30s04.html#debug_mode.design.methods">Methods</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch30s04.html#debug_mode.design.other">Other Implementations</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="parallel_mode.html">31. Parallel Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch31s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch31s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch31s03.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s03.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s03.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch31s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch31s04.html#parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s04.html#parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s04.html#parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch31s05.html">Testing</a></span></dt><dt><span class="bibliography"><a href="parallel_mode.html#parallel_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="profile_mode.html">32. Profile Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="profile_mode.html#manual.ext.profile_mode.intro">Intro</a></span></dt><dd><dl><dt><span class="sect2"><a href="profile_mode.html#manual.ext.profile_mode.using">Using the Profile Mode</a></span></dt><dt><span class="sect2"><a href="profile_mode.html#manual.ext.profile_mode.tuning">Tuning the Profile Mode</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch32s02.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch32s02.html#manual.ext.profile_mode.design.wrapper">Wrapper Model</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s02.html#manual.ext.profile_mode.design.instrumentation">Instrumentation</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s02.html#manual.ext.profile_mode.design.rtlib">Run Time Behavior</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s02.html#manual.ext.profile_mode.design.analysis">Analysis and Diagnostics</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s02.html#manual.ext.profile_mode.design.cost-model">Cost Model</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s02.html#manual.ext.profile_mode.design.reports">Reports</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s02.html#manual.ext.profile_mode.design.testing">Testing</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch32s03.html">Extensions for Custom Containers</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch32s04.html">Empirical Cost Model</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch32s05.html">Implementation Issues</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch32s05.html#manual.ext.profile_mode.implementation.stack">Stack Traces</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s05.html#manual.ext.profile_mode.implementation.symbols">Symbolization of Instruction Addresses</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s05.html#manual.ext.profile_mode.implementation.concurrency">Concurrency</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s05.html#manual.ext.profile_mode.implementation.stdlib-in-proflib">Using the Standard Library in the Instrumentation Implementation</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s05.html#manual.ext.profile_mode.implementation.malloc-hooks">Malloc Hooks</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s05.html#manual.ext.profile_mode.implementation.construction-destruction">Construction and Destruction of Global Objects</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch32s06.html">Developer Information</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch32s06.html#manual.ext.profile_mode.developer.bigpic">Big Picture</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s06.html#manual.ext.profile_mode.developer.howto">How To Add A Diagnostic</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch32s07.html">Diagnostics</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch32s07.html#manual.ext.profile_mode.analysis.template">Diagnostic Template</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s07.html#manual.ext.profile_mode.analysis.containers">Containers</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s07.html#manual.ext.profile_mode.analysis.algorithms">Algorithms</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s07.html#manual.ext.profile_mode.analysis.locality">Data Locality</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s07.html#manual.ext.profile_mode.analysis.mthread">Multithreaded Data Access</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32s07.html#manual.ext.profile_mode.analysis.statistics">Statistics</a></span></dt></dl></dd><dt><span class="bibliography"><a href="profile_mode.html#profile_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_allocators.html">33. Allocators</a></span></dt><dd><dl><dt><span class="sect1"><a href="ext_allocators.html#manual.ext.allocator.mt">mt_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.example_single">Single Thread Example</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.example_multi">Multiple Thread Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="bitmap_allocator.html">bitmap_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="sect2"><a href="bitmap_allocator.html#allocator.bitmap.impl">Implementation</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="ext_containers.html">34. Containers</a></span></dt><dd><dl><dt><span class="sect1"><a href="ext_containers.html#manual.ext.containers.pbds">Policy Based Data Structures</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch34s02.html">HP/SGI</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch34s03.html">Deprecated HP/SGI</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_utilities.html">35. Utilities</a></span></dt><dt><span class="chapter"><a href="ext_algorithms.html">36. Algorithms</a></span></dt><dt><span class="chapter"><a href="ext_numerics.html">37. Numerics</a></span></dt><dt><span class="chapter"><a href="ext_iterators.html">38. Iterators</a></span></dt><dt><span class="chapter"><a href="ext_io.html">39. Input and Output</a></span></dt><dd><dl><dt><span class="sect1"><a href="ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_demangling.html">40. Demangling</a></span></dt><dt><span class="chapter"><a href="ext_concurrency.html">41. Concurrency</a></span></dt><dd><dl><dt><span class="sect1"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="sect2"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch41s02.html">Implementation</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch41s02.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch41s02.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch41s03.html">Use</a></span></dt></dl></dd></dl></dd><dt><span class="appendix"><a href="appendix_contributing.html">A.
Contributing
</a></span></dt><dd><dl><dt><span class="sect1"><a href="appendix_contributing.html#contrib.list">Contributor Checklist</a></span></dt><dd><dl><dt><span class="sect2"><a href="appendix_contributing.html#list.reading">Reading</a></span></dt><dt><span class="sect2"><a href="appendix_contributing.html#list.copyright">Assignment</a></span></dt><dt><span class="sect2"><a href="appendix_contributing.html#list.getting">Getting Sources</a></span></dt><dt><span class="sect2"><a href="appendix_contributing.html#list.patches">Submitting Patches</a></span></dt></dl></dd><dt><span class="sect1"><a href="source_organization.html">Directory Layout and Source Conventions</a></span></dt><dt><span class="sect1"><a href="source_code_style.html">Coding Style</a></span></dt><dd><dl><dt><span class="sect2"><a href="source_code_style.html#coding_style.bad_identifiers">Bad Identifiers</a></span></dt><dt><span class="sect2"><a href="source_code_style.html#coding_style.example">By Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="documentation_style.html">Documentation Style</a></span></dt><dd><dl><dt><span class="sect2"><a href="documentation_style.html#doc_style.doxygen">Doxygen</a></span></dt><dt><span class="sect2"><a href="documentation_style.html#doc_style.docbook">Docbook</a></span></dt></dl></dd><dt><span class="sect1"><a href="source_design_notes.html">Design Notes</a></span></dt></dl></dd><dt><span class="appendix"><a href="appendix_porting.html">B.
Porting and Maintenance
-</a></span></dt><dd><dl><dt><span class="sect1"><a href="appendix_porting.html#appendix.porting.build_hacking">Configure and Build Hacking</a></span></dt><dd><dl><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.map">Overview: What Comes from Where</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.scripts">Storing Information in non-AC files (like configure.host)</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.conventions">Coding and Commenting Conventions</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.acinclude">The acinclude.m4 layout</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.enable">GLIBCXX_ENABLE, the --enable maker</a></span></dt></dl></dd><dt><span class="sect1"><a href="internals.html">Porting to New Hardware or Operating Systems</a></span></dt><dd><dl><dt><span class="sect2"><a href="internals.html#internals.os">Operating System</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.cpu">CPU</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.char_types">Character Types</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.numeric_limits">Numeric Limits</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.libtool">Libtool</a></span></dt></dl></dd><dt><span class="sect1"><a href="abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="sect2"><a href="abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.versioning">Versioning</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.testing">Testing</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="sect1"><a href="api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="sect2"><a href="api.html#api.rel_300">3.0</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_310">3.1</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_320">3.2</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_330">3.3</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_340">3.4</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_400">4.0</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_410">4.1</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_420">4.2</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_430">4.3</a></span></dt></dl></dd><dt><span class="sect1"><a href="backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="sect2"><a href="backwards.html#backwards.first">First</a></span></dt><dt><span class="sect2"><a href="backwards.html#backwards.second">Second</a></span></dt><dt><span class="sect2"><a href="backwards.html#backwards.third">Third</a></span></dt></dl></dd></dl></dd><dt><span class="appendix"><a href="appendix_free.html">C.
+</a></span></dt><dd><dl><dt><span class="sect1"><a href="appendix_porting.html#appendix.porting.build_hacking">Configure and Build Hacking</a></span></dt><dd><dl><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.map">Overview: What Comes from Where</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.scripts">Storing Information in non-AC files (like configure.host)</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.conventions">Coding and Commenting Conventions</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.acinclude">The acinclude.m4 layout</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.enable">GLIBCXX_ENABLE, the --enable maker</a></span></dt></dl></dd><dt><span class="sect1"><a href="internals.html">Porting to New Hardware or Operating Systems</a></span></dt><dd><dl><dt><span class="sect2"><a href="internals.html#internals.os">Operating System</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.cpu">CPU</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.char_types">Character Types</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.numeric_limits">Numeric Limits</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.libtool">Libtool</a></span></dt></dl></dd><dt><span class="sect1"><a href="test.html">Test</a></span></dt><dd><dl><dt><span class="sect2"><a href="test.html#test.organization">Organization</a></span></dt><dt><span class="sect2"><a href="test.html#test.run">Running the Testsuite</a></span></dt><dt><span class="sect2"><a href="test.html#test.new_tests">Writing a new test case</a></span></dt><dt><span class="sect2"><a href="test.html#test.harness">Test Harness and Utilities</a></span></dt></dl></dd><dt><span class="sect1"><a href="abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="sect2"><a href="abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.versioning">Versioning</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.testing">Testing</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="sect1"><a href="api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="sect2"><a href="api.html#api.rel_300">3.0</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_310">3.1</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_320">3.2</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_330">3.3</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_340">3.4</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_400">4.0</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_410">4.1</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_420">4.2</a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_430">4.3</a></span></dt></dl></dd><dt><span class="sect1"><a href="backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="sect2"><a href="backwards.html#backwards.first">First</a></span></dt><dt><span class="sect2"><a href="backwards.html#backwards.second">Second</a></span></dt><dt><span class="sect2"><a href="backwards.html#backwards.third">Third</a></span></dt></dl></dd></dl></dd><dt><span class="appendix"><a href="appendix_free.html">C.
Free Software Needs Free Documentation
</a></span></dt><dt><span class="appendix"><a href="appendix_gpl.html">D.
GNU General Public License version 3
- </a></span></dt><dt><span class="appendix"><a href="appendix_gfdl.html">E. GNU Free Documentation License</a></span></dt><dt><span class="index"><a href="bk01ix01.html">Index</a></span></dt></dl></div><div class="list-of-tables"><p><b>List of Tables</b></p><dl><dt>1.1. <a href="status.html#id446021">C++ 1998/2003 Implementation Status</a></dt><dt>1.2. <a href="status.html#id433682">C++ TR1 Implementation Status</a></dt><dt>1.3. <a href="status.html#id483878">C++ 200x Implementation Status</a></dt><dt>3.1. <a href="using_headers.html#id450185">C++ 1998 Library Headers</a></dt><dt>3.2. <a href="using_headers.html#id455065">C++ 1998 Library Headers for C Library Facilities</a></dt><dt>3.3. <a href="using_headers.html#id440168">C++ 200x Library Headers</a></dt><dt>3.4. <a href="using_headers.html#id485458">C++ 200x Library Headers for C Library Facilities</a></dt><dt>3.5. <a href="using_headers.html#id437190">C++ TR1 Library Headers</a></dt><dt>3.6. <a href="using_headers.html#id387281">C++ TR1 Library Headers for C Library Facilities</a></dt><dt>3.7. <a href="using_headers.html#id517054">C++ ABI Headers</a></dt><dt>3.8. <a href="using_headers.html#id439669">Extension Headers</a></dt><dt>3.9. <a href="using_headers.html#id422368">Extension Debug Headers</a></dt><dt>3.10. <a href="using_headers.html#id436860">Extension Parallel Headers</a></dt><dt>30.1. <a href="bk01pt12ch30s03.html#id452232">Debugging Containers</a></dt><dt>30.2. <a href="bk01pt12ch30s03.html#id387544">Debugging Containers C++0x</a></dt><dt>31.1. <a href="bk01pt12ch31s03.html#id468908">Parallel Algorithms</a></dt><dt>32.1. <a href="bitmap_allocator.html#id508940">Bitmap Allocator Memory Map</a></dt><dt>A.1. <a href="documentation_style.html#id447935">HTML to Docbook XML markup comparison</a></dt><dt>A.2. <a href="documentation_style.html#id458695">Docbook XML Element Use</a></dt><dt>B.1. <a href="api.html#id539341">Extension Allocators</a></dt><dt>B.2. <a href="api.html#id545205">Extension Allocators Continued</a></dt></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="../spine.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="intro.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">The GNU C++ Library Documentation </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Part I. 
+ </a></span></dt><dt><span class="appendix"><a href="appendix_gfdl.html">E. GNU Free Documentation License</a></span></dt><dt><span class="index"><a href="bk01ix01.html">Index</a></span></dt></dl></div><div class="list-of-tables"><p><b>List of Tables</b></p><dl><dt>1.1. <a href="status.html#id700007">C++ 1998/2003 Implementation Status</a></dt><dt>1.2. <a href="status.html#id693868">C++ TR1 Implementation Status</a></dt><dt>1.3. <a href="status.html#id633674">C++ 200x Implementation Status</a></dt><dt>1.4. <a href="status.html#id631613">C++ TR 24733 Implementation Status</a></dt><dt>3.1. <a href="using_headers.html#id651524">C++ 1998 Library Headers</a></dt><dt>3.2. <a href="using_headers.html#id639501">C++ 1998 Library Headers for C Library Facilities</a></dt><dt>3.3. <a href="using_headers.html#id645876">C++ 200x Library Headers</a></dt><dt>3.4. <a href="using_headers.html#id646983">C++ 200x Library Headers for C Library Facilities</a></dt><dt>3.5. <a href="using_headers.html#id631952">C++ TR 1 Library Headers</a></dt><dt>3.6. <a href="using_headers.html#id636818">C++ TR 1 Library Headers for C Library Facilities</a></dt><dt>3.7. <a href="using_headers.html#id685876">C++ TR 24733 Decimal Floating-Point Header</a></dt><dt>3.8. <a href="using_headers.html#id639029">C++ ABI Headers</a></dt><dt>3.9. <a href="using_headers.html#id637647">Extension Headers</a></dt><dt>3.10. <a href="using_headers.html#id631989">Extension Debug Headers</a></dt><dt>3.11. <a href="using_headers.html#id521103">Extension Profile Headers</a></dt><dt>3.12. <a href="using_headers.html#id684216">Extension Parallel Headers</a></dt><dt>30.1. <a href="bk01pt12ch30s03.html#id672482">Debugging Containers</a></dt><dt>30.2. <a href="bk01pt12ch30s03.html#id646525">Debugging Containers C++0x</a></dt><dt>31.1. <a href="bk01pt12ch31s03.html#id731921">Parallel Algorithms</a></dt><dt>32.1. <a href="bk01pt12ch32s02.html#id647548">Code Location</a></dt><dt>32.2. <a href="bk01pt12ch32s07.html#id521055">Diagnostics</a></dt><dt>33.1. <a href="bitmap_allocator.html#id730908">Bitmap Allocator Memory Map</a></dt><dt>A.1. <a href="documentation_style.html#id740402">HTML to Docbook XML markup comparison</a></dt><dt>A.2. <a href="documentation_style.html#id613462">Docbook XML Element Use</a></dt><dt>B.1. <a href="api.html#id623096">Extension Allocators</a></dt><dt>B.2. <a href="api.html#id721371">Extension Allocators Continued</a></dt></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="../spine.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="intro.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">The GNU C++ Library Documentation </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Part I. 
Introduction
</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/status.html b/libstdc++-v3/doc/html/manual/status.html
index 07c9a1d415e..40dc1a26eb2 100644
--- a/libstdc++-v3/doc/html/manual/status.html
+++ b/libstdc++-v3/doc/html/manual/status.html
@@ -3,12 +3,12 @@
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 1. Status</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="intro.html" title="Part I.  Introduction" /><link rel="prev" href="intro.html" title="Part I.  Introduction" /><link rel="next" href="license.html" title="License" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 1. Status</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="intro.html">Prev</a> </td><th width="60%" align="center">Part I. 
Introduction
-</th><td width="20%" align="right"> <a accesskey="n" href="license.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.status"></a>Chapter 1. Status</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="sect2"><a href="status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dt><span class="sect2"><a href="status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="sect2"><a href="status.html#status.iso.200x">C++ 200x</a></span></dt></dl></dd><dt><span class="sect1"><a href="license.html">License</a></span></dt><dd><dl><dt><span class="sect2"><a href="license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="sect2"><a href="license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="sect1"><a href="bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="sect2"><a href="bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="sect2"><a href="bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.status.iso"></a>Implementation Status</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="status.iso.1998"></a>C++ 1998/2003</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="iso.1998.status"></a>Implementation Status</h4></div></div></div><p>
+</th><td width="20%" align="right"> <a accesskey="n" href="license.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.status"></a>Chapter 1. Status</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="sect2"><a href="status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dt><span class="sect2"><a href="status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="sect2"><a href="status.html#status.iso.200x">C++ 200x</a></span></dt><dt><span class="sect2"><a href="status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="sect1"><a href="license.html">License</a></span></dt><dd><dl><dt><span class="sect2"><a href="license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="sect2"><a href="license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="sect1"><a href="bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="sect2"><a href="bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="sect2"><a href="bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.status.iso"></a>Implementation Status</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="status.iso.1998"></a>C++ 1998/2003</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="iso.1998.status"></a>Implementation Status</h4></div></div></div><p>
This status table is based on the table of contents of ISO/IEC 14882:2003.
</p><p>
This page describes the C++0x support in mainline GCC SVN, not in any
particular release.
-</p><div class="table"><a id="id446021"></a><p class="title"><b>Table 1.1. C++ 1998/2003 Implementation Status</b></p><div class="table-contents"><table summary="C++ 1998/2003 Implementation Status" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Section</th><th align="left">Description</th><th align="left">Status</th><th align="left">Comments</th></tr></thead><tbody><tr><td align="left">
+</p><div class="table"><a id="id700007"></a><p class="title"><b>Table 1.1. C++ 1998/2003 Implementation Status</b></p><div class="table-contents"><table summary="C++ 1998/2003 Implementation Status" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Section</th><th align="left">Description</th><th align="left">Status</th><th align="left">Comments</th></tr></thead><tbody><tr><td align="left">
<span class="emphasis"><em>18</em></span>
</td><td colspan="3" align="left">
<span class="emphasis"><em>Language support</em></span>
@@ -90,7 +90,7 @@ particular release.
class. But they are the <span class="emphasis"><em>mangled</em></span> names; you will need to call
<code class="code">c++filt</code> and pass the names as command-line parameters to
demangle them, or call a
- <a class="link" href="ext_demangling.html" title="Chapter 39. Demangling">runtime demangler function</a>.
+ <a class="link" href="ext_demangling.html" title="Chapter 40. Demangling">runtime demangler function</a>.
(The classes in <code class="code">&lt;stdexcept&gt;</code> have constructors which
require an argument to use later for <code class="code">what()</code> calls, so the
problem of <code class="code">what()</code>'s value does not arise in most
@@ -153,7 +153,7 @@ In this implementation the header names are prefixed by
</p><p>
This page describes the TR1 support in mainline GCC SVN, not in any particular
release.
-</p><div class="table"><a id="id433682"></a><p class="title"><b>Table 1.2. C++ TR1 Implementation Status</b></p><div class="table-contents"><table summary="C++ TR1 Implementation Status" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Section</th><th align="left">Description</th><th align="left">Status</th><th align="left">Comments</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>2</em></span></td><td colspan="3" align="left"><span class="emphasis"><em>General Utilities</em></span></td></tr><tr><td align="left">2.1</td><td align="left">Reference wrappers</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.1.1</td><td align="left">Additions to header <code class="code">&lt;functional&gt;</code> synopsis</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.1.2</td><td align="left">Class template <code class="code">reference_wrapper</code></td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.1.2.1</td><td align="left"><code class="code">reference_wrapper</code> construct/copy/destroy</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.1.2.2</td><td align="left"><code class="code">reference_wrapper</code> assignment</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.1.2.3</td><td align="left"><code class="code">reference_wrapper</code> access</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.1.2.4</td><td align="left"><code class="code">reference_wrapper</code> invocation</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.1.2.5</td><td align="left"><code class="code">reference_wrapper</code> helper functions</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.2</td><td align="left">Smart pointers</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.1</td><td align="left">Additions to header <code class="code">&lt;memory&gt;</code> synopsis</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.2.2</td><td align="left">Class <code class="code">bad_weak_ptr</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.2.3</td><td align="left">Class template <code class="code">shared_ptr</code></td><td align="left"> </td><td align="left">
+</p><div class="table"><a id="id693868"></a><p class="title"><b>Table 1.2. C++ TR1 Implementation Status</b></p><div class="table-contents"><table summary="C++ TR1 Implementation Status" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Section</th><th align="left">Description</th><th align="left">Status</th><th align="left">Comments</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>2</em></span></td><td colspan="3" align="left"><span class="emphasis"><em>General Utilities</em></span></td></tr><tr><td align="left">2.1</td><td align="left">Reference wrappers</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.1.1</td><td align="left">Additions to header <code class="code">&lt;functional&gt;</code> synopsis</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.1.2</td><td align="left">Class template <code class="code">reference_wrapper</code></td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.1.2.1</td><td align="left"><code class="code">reference_wrapper</code> construct/copy/destroy</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.1.2.2</td><td align="left"><code class="code">reference_wrapper</code> assignment</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.1.2.3</td><td align="left"><code class="code">reference_wrapper</code> access</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.1.2.4</td><td align="left"><code class="code">reference_wrapper</code> invocation</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.1.2.5</td><td align="left"><code class="code">reference_wrapper</code> helper functions</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.2</td><td align="left">Smart pointers</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.1</td><td align="left">Additions to header <code class="code">&lt;memory&gt;</code> synopsis</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.2.2</td><td align="left">Class <code class="code">bad_weak_ptr</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.2.3</td><td align="left">Class template <code class="code">shared_ptr</code></td><td align="left"> </td><td align="left">
<p>
Uses code from
<a class="ulink" href="http://www.boost.org/libs/smart_ptr/shared_ptr.htm" target="_top">boost::shared_ptr</a>.
@@ -171,7 +171,7 @@ presence of the required flag.
</p><p>
This page describes the C++0x support in mainline GCC SVN, not in any
particular release.
-</p><div class="table"><a id="id483878"></a><p class="title"><b>Table 1.3. C++ 200x Implementation Status</b></p><div class="table-contents"><table summary="C++ 200x Implementation Status" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Section</th><th align="left">Description</th><th align="left">Status</th><th align="left">Comments</th></tr></thead><tbody><tr><td align="left">
+</p><div class="table"><a id="id633674"></a><p class="title"><b>Table 1.3. C++ 200x Implementation Status</b></p><div class="table-contents"><table summary="C++ 200x Implementation Status" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Section</th><th align="left">Description</th><th align="left">Status</th><th align="left">Comments</th></tr></thead><tbody><tr><td align="left">
<span class="emphasis"><em>18</em></span>
</td><td colspan="3" align="left">
<span class="emphasis"><em>Language support</em></span>
@@ -232,7 +232,35 @@ particular release.
<span class="emphasis"><em>Appendix D</em></span>
</td><td colspan="3" align="left">
<span class="emphasis"><em>Compatibility features</em></span>
- </td></tr><tr><td align="left">D.1</td><td align="left">Increment operator with bool operand</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">D.2</td><td align="left"><code class="code">static</code> keyword</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">D.3</td><td align="left">Access declarations</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">D.4</td><td align="left">Implicit conversion from const strings</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">D.5</td><td align="left">C standard library headers</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">D.6</td><td align="left">Old iostreams members</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">D.7</td><td align="left">char* streams</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">D.8</td><td align="left">Binders</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">D.9</td><td align="left"><code class="code">auto_ptr</code></td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">D.10</td><td align="left">Iterator primitives</td><td align="left"> </td><td align="left"> </td></tr></tbody></table></div></div><br class="table-break" /></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="intro.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="intro.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="license.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Part I. 
+ </td></tr><tr><td align="left">D.1</td><td align="left">Increment operator with bool operand</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">D.2</td><td align="left"><code class="code">static</code> keyword</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">D.3</td><td align="left">Access declarations</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">D.4</td><td align="left">Implicit conversion from const strings</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">D.5</td><td align="left">C standard library headers</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">D.6</td><td align="left">Old iostreams members</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">D.7</td><td align="left">char* streams</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">D.8</td><td align="left">Binders</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">D.9</td><td align="left"><code class="code">auto_ptr</code></td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">D.10</td><td align="left">Iterator primitives</td><td align="left"> </td><td align="left"> </td></tr></tbody></table></div></div><br class="table-break" /></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="status.iso.tr24733"></a>C++ TR 24733</h3></div></div></div><p>
+This table is based on the table of contents of
+ISO/IEC TR 24733 Date: 2009-08-28
+Extension for the programming language C++ to support
+decimal floating-point arithmetic
+</p><p>
+This page describes the TR 24733 support in mainline GCC SVN, not in any
+particular release.
+</p><div class="table"><a id="id631613"></a><p class="title"><b>Table 1.4. C++ TR 24733 Implementation Status</b></p><div class="table-contents"><table summary="C++ TR 24733 Implementation Status" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Section</th><th align="left">Description</th><th align="left">Status</th><th align="left">Comments</th></tr></thead><tbody><tr><td align="left">
+ <span class="emphasis"><em>0</em></span>
+ </td><td colspan="3" align="left">
+ <span class="emphasis"><em>Introduction</em></span>
+ </td></tr><tr><td align="left">
+ <span class="emphasis"><em>1</em></span>
+ </td><td colspan="3" align="left">
+ <span class="emphasis"><em>Normative references</em></span>
+ </td></tr><tr><td align="left">
+ <span class="emphasis"><em>2</em></span>
+ </td><td colspan="3" align="left">
+ <span class="emphasis"><em>Conventions</em></span>
+ </td></tr><tr><td align="left">
+ <span class="emphasis"><em>3</em></span>
+ </td><td colspan="3" align="left">
+ <span class="emphasis"><em>Decimal floating-point types</em></span>
+ </td></tr><tr><td align="left">3.1</td><td align="left">Characteristics of decimal floating-point types</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.2</td><td align="left">Decimal Types</td><td align="left"> </td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">3.2.1</td><td align="left">Class <code class="code">decimal</code> synopsis</td><td align="left">Partial</td><td align="left">Missing declarations for formatted input/output; non-conforming extension for functions converting to integral type</td></tr><tr bgcolor="#B0B0B0"><td align="left">3.2.2</td><td align="left">Class <code class="code">decimal32</code></td><td align="left">Partial</td><td align="left">Missing 3.2.2.5 conversion to integral type; conforming extension for conversion from scalar decimal floating-point</td></tr><tr bgcolor="#B0B0B0"><td align="left">3.2.3</td><td align="left">Class <code class="code">decimal64</code></td><td align="left">Partial</td><td align="left">Missing 3.2.3.5 conversion to integral type; conforming extension for conversion from scalar decimal floating-point</td></tr><tr bgcolor="#B0B0B0"><td align="left">3.2.4</td><td align="left">Class <code class="code">decimal128</code></td><td align="left">Partial</td><td align="left">Missing 3.2.4.5 conversion to integral type; conforming extension for conversion from scalar decimal floating-point</td></tr><tr><td align="left">3.2.5</td><td align="left">Initialization from coefficient and exponent</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">3.2.6</td><td align="left">Conversion to generic floating-point type</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">3.2.7</td><td align="left">Unary arithmetic operators</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">3.2.8</td><td align="left">Binary arithmetic operators</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">3.2.9</td><td align="left">Comparison operators</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#C8B0B0"><td align="left">3.2.10</td><td align="left">Formatted input</td><td align="left">N</td><td align="left"> </td></tr><tr bgcolor="#C8B0B0"><td align="left">3.2.11</td><td align="left">Formatted output</td><td align="left">N</td><td align="left"> </td></tr><tr bgcolor="#C8B0B0"><td align="left">3.3</td><td align="left">Additions to header <code class="code">limits</code></td><td align="left">N</td><td align="left"> </td></tr><tr><td align="left">3.4</td><td align="left">Headers <code class="code">cfloat</code> and <code class="code">float.h</code></td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.4.2</td><td align="left">Additions to header <code class="code">cfloat</code> synopsis</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">3.4.3</td><td align="left">Additions to header <code class="code">float.h</code> synopsis</td><td align="left">N</td><td align="left"> </td></tr><tr><td align="left">3.4.4</td><td align="left">Maximum finite value</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">3.4.5</td><td align="left">Epsilon</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">3.4.6</td><td align="left">Minimum positive normal value</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">3.4.7</td><td align="left">Minimum positive subnormal value</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">3.4.8</td><td align="left">Evaluation format</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#C8B0B0"><td align="left">3.5</td><td align="left">Additions to <code class="code">cfenv</code> and <code class="code">fenv.h</code></td><td align="left">Outside the scope of GCC</td><td align="left"> </td></tr><tr bgcolor="#C8B0B0"><td align="left">3.6</td><td align="left">Additions to <code class="code">cmath</code> and <code class="code">math.h</code></td><td align="left">Outside the scope of GCC</td><td align="left"> </td></tr><tr bgcolor="#C8B0B0"><td align="left">3.7</td><td align="left">Additions to <code class="code">cstdio</code> and <code class="code">stdio.h</code></td><td align="left">Outside the scope of GCC</td><td align="left"> </td></tr><tr bgcolor="#C8B0B0"><td align="left">3.8</td><td align="left">Additions to <code class="code">cstdlib</code> and <code class="code">stdlib.h</code></td><td align="left">Outside the scope of GCC</td><td align="left"> </td></tr><tr bgcolor="#C8B0B0"><td align="left">3.9</td><td align="left">Additions to <code class="code">cwchar</code> and <code class="code">wchar.h</code></td><td align="left">Outside the scope of GCC</td><td align="left"> </td></tr><tr bgcolor="#C8B0B0"><td align="left">3.10</td><td align="left">Facets</td><td align="left">N</td><td align="left"> </td></tr><tr bgcolor="#C8B0B0"><td align="left">3.11</td><td align="left">Type traits</td><td align="left">N</td><td align="left"> </td></tr><tr bgcolor="#C8B0B0"><td align="left">3.12</td><td align="left">Hash functions</td><td align="left">N</td><td align="left"> </td></tr><tr><td align="left">
+ <span class="emphasis"><em>4</em></span>
+ </td><td colspan="3" align="left">
+ <span class="emphasis"><em>Notes on C compatibility</em></span>
+ </td></tr></tbody></table></div></div><br class="table-break" /></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="intro.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="intro.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="license.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Part I. 
Introduction
 </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> License</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/strings.html b/libstdc++-v3/doc/html/manual/strings.html
index c2e94a8bfd3..a1e78f27289 100644
--- a/libstdc++-v3/doc/html/manual/strings.html
+++ b/libstdc++-v3/doc/html/manual/strings.html
@@ -5,5 +5,5 @@
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="shared_ptr.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt05ch13.html">Next</a></td></tr></table><hr /></div><div class="part" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="manual.strings"></a>Part V. 
Strings
- <a id="id442055" class="indexterm"></a>
+ <a id="id710761" class="indexterm"></a>
</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="bk01pt05ch13.html">13. String Classes</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt05ch13.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s02.html">Case Sensitivity</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s03.html">Arbitrary Character Types</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s04.html">Tokenizing</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s05.html">Shrink to Fit</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s06.html">CString (MFC)</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="shared_ptr.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt05ch13.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">shared_ptr </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 13. String Classes</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/support.html b/libstdc++-v3/doc/html/manual/support.html
index a539e63b3bf..fb217b89a0d 100644
--- a/libstdc++-v3/doc/html/manual/support.html
+++ b/libstdc++-v3/doc/html/manual/support.html
@@ -5,5 +5,5 @@
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="debug.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt02pr01.html">Next</a></td></tr></table><hr /></div><div class="part" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="manual.support"></a>Part II. 
Support
- <a id="id455542" class="indexterm"></a>
+ <a id="id652738" class="indexterm"></a>
</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="preface"><a href="bk01pt02pr01.html"></a></span></dt><dt><span class="chapter"><a href="fundamental_types.html">4. Types</a></span></dt><dd><dl><dt><span class="sect1"><a href="fundamental_types.html#manual.support.types.fundamental">Fundamental Types</a></span></dt><dt><span class="sect1"><a href="bk01pt02ch04s02.html">Numeric Properties</a></span></dt><dt><span class="sect1"><a href="bk01pt02ch04s03.html">NULL</a></span></dt></dl></dd><dt><span class="chapter"><a href="dynamic_memory.html">5. Dynamic Memory</a></span></dt><dt><span class="chapter"><a href="termination.html">6. Termination</a></span></dt><dd><dl><dt><span class="sect1"><a href="termination.html#support.termination.handlers">Termination Handlers</a></span></dt><dt><span class="sect1"><a href="verbose_termination.html">Verbose Terminate Handler</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="debug.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt02pr01.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Debugging Support </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/test.html b/libstdc++-v3/doc/html/manual/test.html
index 9d95b85ea2e..80988a4febe 100644
--- a/libstdc++-v3/doc/html/manual/test.html
+++ b/libstdc++-v3/doc/html/manual/test.html
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Test</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; test&#10; , &#10; testsuite&#10; , &#10; performance&#10; , &#10; conformance&#10; , &#10; ABI&#10; , &#10; exception safety&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="setup.html" title="Chapter 2. Setup" /><link rel="prev" href="make.html" title="Make" /><link rel="next" href="using.html" title="Chapter 3. Using" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Test</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="make.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Setup</th><td width="20%" align="right"> <a accesskey="n" href="using.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.setup.test"></a>Test</h2></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Test</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; test&#10; , &#10; testsuite&#10; , &#10; performance&#10; , &#10; conformance&#10; , &#10; ABI&#10; , &#10; exception safety&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="internals.html" title="Porting to New Hardware or Operating Systems" /><link rel="next" href="abi.html" title="ABI Policy and Guidelines" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Test</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="internals.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
+ Porting and Maintenance
+
+</th><td width="20%" align="right"> <a accesskey="n" href="abi.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.setup.test"></a>Test</h2></div></div></div><p>
The libstdc++ testsuite includes testing for standard conformance,
regressions, ABI, and performance.
</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="test.organization"></a>Organization</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="test.organization.layout"></a>Directory Layout</h4></div></div></div><p>
@@ -486,4 +489,4 @@ only default variables.
</p><p>
A number of class abstractions for performance counters, and
reporting functions including:
- </p><div class="itemizedlist"><ul type="circle"><li><p>time_counter</p></li><li><p>resource_counter</p></li><li><p>report_performance</p></li></ul></div></li></ul></div></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="make.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="setup.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="using.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Make </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 3. Using</td></tr></table></div></body></html>
+ </p><div class="itemizedlist"><ul type="circle"><li><p>time_counter</p></li><li><p>resource_counter</p></li><li><p>report_performance</p></li></ul></div></li></ul></div></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="internals.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="appendix_porting.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="abi.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Porting to New Hardware or Operating Systems </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> ABI Policy and Guidelines</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/using.html b/libstdc++-v3/doc/html/manual/using.html
index 0a502094f7f..1d63cb53087 100644
--- a/libstdc++-v3/doc/html/manual/using.html
+++ b/libstdc++-v3/doc/html/manual/using.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 3. Using</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="intro.html" title="Part I.  Introduction" /><link rel="prev" href="test.html" title="Test" /><link rel="next" href="using_headers.html" title="Headers" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 3. Using</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="test.html">Prev</a> </td><th width="60%" align="center">Part I. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 3. Using</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="intro.html" title="Part I.  Introduction" /><link rel="prev" href="make.html" title="Make" /><link rel="next" href="using_headers.html" title="Headers" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 3. Using</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="make.html">Prev</a> </td><th width="60%" align="center">Part I. 
Introduction
-</th><td width="20%" align="right"> <a accesskey="n" href="using_headers.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using"></a>Chapter 3. Using</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="using.html#manual.intro.using.lib">Linking Library Binary Files</a></span></dt><dt><span class="sect1"><a href="using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.cheaders">The C Headers and namespace std</a></span></dt><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="sect1"><a href="using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="sect2"><a href="using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="sect2"><a href="using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="sect1"><a href="using_macros.html">Macros</a></span></dt><dt><span class="sect1"><a href="using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.propagating">Propagating Exceptions aka Exception Neutrality</a></span></dt><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.no">Support for -fno-exceptions</a></span></dt></dl></dd><dt><span class="sect1"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="sect2"><a href="debug.html#debug.compiler">Using g++</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.gdb">Using gdb</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.using.lib"></a>Linking Library Binary Files</h2></div></div></div><p>
+</th><td width="20%" align="right"> <a accesskey="n" href="using_headers.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using"></a>Chapter 3. Using</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="using.html#manual.intro.using.lib">Linking Library Binary Files</a></span></dt><dt><span class="sect1"><a href="using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.cheaders">The C Headers and namespace std</a></span></dt><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="sect1"><a href="using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="sect2"><a href="using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="sect2"><a href="using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="sect1"><a href="using_macros.html">Macros</a></span></dt><dt><span class="sect1"><a href="using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt></dl></dd><dt><span class="sect1"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="sect2"><a href="debug.html#debug.compiler">Using g++</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.gdb">Using gdb</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.using.lib"></a>Linking Library Binary Files</h2></div></div></div><p>
If you only built a static library (libstdc++.a), or if you
specified static linking, you don't have to worry about this.
But if you built a shared library (libstdc++.so) and linked
@@ -41,4 +41,4 @@
A libstdc++.la file is also installed, for use with Libtool. If
you use Libtool to create your executables, these details are
taken care of for you.
- </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="test.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="intro.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="using_headers.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Test </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Headers</td></tr></table></div></body></html>
+ </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="make.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="intro.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="using_headers.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Make </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Headers</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/using_exceptions.html b/libstdc++-v3/doc/html/manual/using_exceptions.html
index 6bc776c2c6c..5c74e93ac8f 100644
--- a/libstdc++-v3/doc/html/manual/using_exceptions.html
+++ b/libstdc++-v3/doc/html/manual/using_exceptions.html
@@ -1,6 +1,319 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Exceptions</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="using.html" title="Chapter 3. Using" /><link rel="prev" href="using_concurrency.html" title="Concurrency" /><link rel="next" href="debug.html" title="Debugging Support" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Exceptions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="using_concurrency.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td width="20%" align="right"> <a accesskey="n" href="debug.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.using.exception"></a>Exceptions</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="intro.using.exception.propagating"></a>Propagating Exceptions aka Exception Neutrality</h3></div></div></div><p>
- </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="intro.using.exception.safety"></a>Exception Safety</h3></div></div></div><p>
- </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="intro.using.exception.no"></a>Support for <code class="literal">-fno-exceptions</code></h3></div></div></div><p>
- </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="using_concurrency.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="using.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="debug.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Concurrency </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Debugging Support</td></tr></table></div></body></html>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Exceptions</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; exception&#10; , &#10; error&#10; , &#10; exception neutrality&#10; , &#10; exception safety&#10; , &#10; exception propagation&#10; , &#10; -fno-exceptions&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="using.html" title="Chapter 3. Using" /><link rel="prev" href="using_concurrency.html" title="Concurrency" /><link rel="next" href="debug.html" title="Debugging Support" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Exceptions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="using_concurrency.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td width="20%" align="right"> <a accesskey="n" href="debug.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.using.exceptions"></a>Exceptions</h2></div></div></div><p>
+The C++ language provides language support for stack unwinding
+with <code class="literal">try</code> and <code class="literal">catch</code> blocks and
+the <code class="literal">throw</code> keyword.
+</p><p>
+These are very powerful constructs, and require some thought when
+applied to the standard library in order to yield components that work
+efficiently while cleaning up resources when unexpectedly killed via
+exceptional circumstances.
+</p><p>
+Two general topics of discussion follow:
+exception neutrality and exception safety.
+</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="intro.using.exception.safety"></a>Exception Safety</h3></div></div></div><p>
+ What is exception-safe code?
+ </p><p>
+ Will define this as reasonable and well-defined behavior by classes
+ and functions from the standard library when used by user-defined
+ classes and functions that are themselves exception safe.
+ </p><p>
+ Please note that using exceptions in combination with templates
+ imposes an additional requirement for exception
+ safety. Instantiating types are required to have destructors that
+ do no throw.
+ </p><p>
+ Using the layered approach from Abrahams, can classify library
+ components as providing set levels of safety. These will be called
+ exception guarantees, and can be divided into three categories.
+ </p><div class="itemizedlist"><ul type="disc"><li><p>
+ One. Don't throw.
+ </p><p>
+ As specified in 23.2.1 general container requirements. Applicable
+ to container and string classes.
+ </p><p>
+ Member
+ functions <code class="function">erase</code>, <code class="function">pop_back</code>, <code class="function">pop_front</code>, <code class="function">swap</code>, <code class="function">clear</code>. And <span class="type">iterator</span>
+ copy constructor and assignment operator.
+ </p></li><li><p>
+ Two. Don't leak resources when exceptions are thrown. This is
+ also referred to as the “<span class="quote">basic</span>†exception safety guarantee.
+ </p><p>
+ This applicable throughout the standard library.
+ </p></li><li><p>
+ Three. Commit-or-rollback semantics. This is
+ referred to as “<span class="quote">strong</span>†exception safety guarantee.
+ </p><p>
+ As specified in 23.2.1 general container requirements. Applicable
+ to container and string classes.
+ </p><p>
+ Member functions <code class="function">insert</code> of a single
+ element, <code class="function">push_back</code>, <code class="function">push_front</code>,
+ and <code class="function">rehash</code>.
+ </p></li></ul></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="intro.using.exception.propagating"></a>Exception Neutrality</h3></div></div></div><p>
+ Simply put, once thrown an exception object should continue in
+ flight unless handled explicitly. In practice, this means
+ propagating exceptions should not be swallowed in
+ gratuitous <code class="literal">catch(...)</code> blocks. Instead,
+ matching <code class="literal">try</code> and <code class="literal">catch</code>
+ blocks should have specific catch handlers and allow un-handed
+ exception objects to propagate. If a
+ terminating <code class="literal">catch(...)</code> blocks exist then it
+ should end with a <code class="literal">throw</code> to re-throw the current
+ exception.
+ </p><p>
+ Why do this?
+ </p><p>
+ By allowing exception objects to propagate, a more flexible
+ approach to error handling is made possible (although not
+ required.) Instead of dealing with an error immediately, one can
+ allow the exception to propagate up until sufficient context is
+ available and the choice of exiting or retrying can be made in an
+ informed manner.
+ </p><p>
+ Unfortunately, this tends to be more of a guideline than a strict
+ rule as applied to the standard library. As such, the following is
+ a list of known problem areas where exceptions are not propagated.
+ </p><div class="itemizedlist"><ul type="disc"><li><p>
+ Input/Output
+ </p><p>
+ The destructor <code class="function">ios_base::Init::~Init()</code>
+ swallows all exceptions from <code class="function">flush</code> called on
+ all open streams at termination.
+ </p><p>
+ All formatted input in <code class="classname">basic_istream</code> or
+ formatted output in <code class="classname">basic_ostream</code> can be
+ configured to swallow exceptions
+ when <code class="function">exceptions</code> is set to
+ ignore <span class="type">ios_base::badbit</span>.
+ </p><p>
+ Functions that have been registered
+ with <code class="function">ios_base::register_callback</code> swallow all
+ exceptions when called as part of a callback event.
+ </p><p>
+ When closing the underlying
+ file, <code class="function">basic_filebuf::close</code> will swallow
+ (non-cancellation) exceptions thrown and return <code class="literal">NULL</code>.
+ </p></li><li><p>
+ Thread
+ </p><p>
+ The constructors of <code class="classname">thread</code> that take a
+ callable function argument swallow all exceptions resulting from
+ executing the function argument.
+ </p></li></ul></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="intro.using.exception.no"></a>Doing without</h3></div></div></div><p>
+ C++ is a language that strives to be as efficient as is possible
+ in delivering features. As such, considerable care is used by both
+ language implementer and designers to make sure unused features
+ not impose hidden or unexpected costs. The GNU system tries to be
+ as flexible and as configurable as possible. So, it should come as
+ no surprise that GNU C++ provides an optional language extension,
+ spelled <code class="literal">-fno-exceptions</code>, as a way to excise the
+ implicitly generated magic necessary to
+ support <code class="literal">try</code> and <code class="literal">catch</code> blocks
+ and thrown objects. (Language support
+ for <code class="literal">-fno-exceptions</code> is documented in the GNU
+ GCC <a class="ulink" href="http://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options" target="_top">manual</a>.)
+ </p><p>Before detailing the library support
+ for <code class="literal">-fno-exceptions</code>, first a passing note on
+ the things lost when this flag is used: it will break exceptions
+ trying to pass through code compiled
+ with <code class="literal">-fno-exceptions</code> whether or not that code
+ has any <code class="literal">try</code> or <code class="literal">catch</code>
+ constructs. If you might have some code that throws, you shouldn't
+ use <code class="literal">-fno-exceptions</code>. If you have some code that
+ uses <code class="literal">try</code> or <code class="literal">catch</code>, you
+ shouldn't use <code class="literal">-fno-exceptions</code>.
+ </p><p>
+ And what it to be gained, tinkering in the back alleys with a
+ language like this? Exception handling overhead can be measured
+ in the size of the executable binary, and varies with the
+ capabilities of the underlying operating system and specific
+ configuration of the C++ compiler. On recent hardware with GNU
+ system software of the same age, the combined code and data size
+ overhead for enabling exception handling is around 7%. Of course,
+ if code size is of singular concern than using the appropriate
+ optimizer setting with exception handling enabled
+ (ie, <code class="literal">-Os -fexceptions</code>) may save up to twice
+ that, and preserve error checking.
+ </p><p>
+ So. Hell bent, we race down the slippery track, knowing the brakes
+ are a little soft and that the right front wheel has a tendency to
+ wobble at speed. Go on: detail the standard library support
+ for <code class="literal">-fno-exceptions</code>.
+ </p><p>
+ In sum, valid C++ code with exception handling is transformed into
+ a dialect without exception handling. In detailed steps: all use
+ of the C++
+ keywords <code class="literal">try</code>, <code class="literal">catch</code>,
+ and <code class="literal">throw</code> in the standard library have been
+ permanently replaced with the pre-processor controlled equivalents
+ spelled <code class="literal">__try</code>, <code class="literal">__catch</code>,
+ and <code class="literal">__throw_exception_again</code>. They are defined
+ as follows.
+ </p><pre class="programlisting">
+#ifdef __EXCEPTIONS
+# define __try try
+# define __catch(X) catch(X)
+# define __throw_exception_again throw
+#else
+# define __try if (true)
+# define __catch(X) if (false)
+# define __throw_exception_again
+#endif
+</pre><p>
+ In addition, for every object derived from
+ class <code class="classname">exception</code>, there exists a corresponding
+ function with C language linkage. An example:
+</p><pre class="programlisting">
+#ifdef __EXCEPTIONS
+ void __throw_bad_exception(void)
+ { throw bad_exception(); }
+#else
+ void __throw_bad_exception(void)
+ { abort(); }
+#endif
+</pre><p>
+ The last language feature needing to be transformed
+ by <code class="literal">-fno-exceptions</code> is treatment of exception
+ specifications on member functions. Fortunately, the compiler deals
+ with this by ignoring exception specifications and so no alternate
+ source markup is needed.
+</p><p>
+ By using this combination of language re-specification by the
+ compiler, and the pre-processor tricks and the functional
+ indirection layer for thrown exception objects by the library,
+ libstdc++ files can be compiled
+ with <code class="literal">-fno-exceptions</code>.
+</p><p>
+ User code that uses C++ keywords
+ like <code class="literal">throw</code>, <code class="literal">try</code>,
+ and <code class="literal">catch</code> will produce errors even if the user
+ code has included libstdc++ headers and is using constructs
+ like <code class="classname">basic_iostream</code>. Even though the standard
+ library has been transformed, user code may need modification. User
+ code that attempts or expects to do error checking on standard
+ library components compiled with exception handling disabled should
+ be evaluated and potentially made conditional.
+</p><p>
+ Some issues remain with this approach (see bugzilla entry
+ 25191). Code paths are not equivalent, in
+ particular <code class="literal">catch</code> blocks are not evaluated. Also
+ problematic are <code class="literal">throw</code> expressions expecting a
+ user-defined throw handler. Known problem areas in the standard
+ library include using an instance
+ of <code class="classname">basic_istream</code>
+ with <code class="function">exceptions</code> set to specific
+ <span class="type">ios_base::iostate</span> conditions, or
+ cascading <code class="literal">catch</code> blocks that dispatch error
+ handling or recovery efforts based on the type of exception object
+ thrown.
+</p><p>
+ Oh, and by the way: none of this hackery is at all
+ special. (Although perhaps well-deserving of a raised eyebrow.)
+ Support continues to evolve and may change in the future. Similar
+ and even additional techniques are used in other C++ libraries and
+ compilers.
+</p><p>
+ C++ hackers with a bent for language and control-flow purity have
+ been successfully consoled by grizzled C veterans lamenting the
+ substitution of the C language keyword
+ <code class="literal">const</code> with the uglified
+ doppelganger <code class="literal">__const</code>.
+</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="intro.using.exception.compat"></a>Compatibility</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="using.exception.compat.c"></a>With <code class="literal">C</code></h4></div></div></div><p>
+ C language code that is expecting to interoperate with C++ should be
+ compiled with <code class="literal">-fexceptions</code>. This will make
+ debugging a C language function called as part of C++-induced stack
+ unwinding possible.
+</p><p>
+ In particular, unwinding into a frame with no exception handling
+data will cause a runtime abort. If the unwinder runs out of unwind
+info before it finds a handler, <code class="function">std::terminate()</code>
+is called.
+</p><p>
+ Please note that most development environments should take care of
+ getting these details right. For GNU systems, all appropriate parts
+ of the GNU C library are already compiled
+ with <code class="literal">-fexceptions</code>.
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="using.exception.compat.posix"></a>With <code class="literal">POSIX</code> thread cancellation</h4></div></div></div><p>
+ GNU systems re-use some of the exception handling mechanisms to
+ track control flow for <code class="literal">POSIX</code> thread cancellation.
+</p><p>
+ Cancellation points are functions defined by POSIX as worthy of
+ special treatment. The standard library may use some of these
+ functions to implement parts of the ISO C++ standard or depend on
+ them for extensions.
+</p><p>
+ Of note:
+</p><p>
+ <code class="function">nanosleep</code>,
+ <code class="function">read</code>, <code class="function">write</code>, <code class="function">open</code>, <code class="function">close</code>,
+ and <code class="function">wait</code>.
+</p><p>
+ The parts of libstdc++ that use C library functions marked as
+ cancellation points should take pains to be exception neutral.
+ Failing this, <code class="literal">catch</code> blocks have been augmented to
+ show that the POSIX cancellation object is in flight.
+</p><p>
+ This augmentation adds a <code class="literal">catch</code> block
+ for <code class="classname">__cxxabiv1::__forced_unwind</code>, which is the
+ object representing the POSIX cancellation object. Like so:
+</p><pre class="programlisting">
+ catch(const __cxxabiv1::__forced_unwind&amp;)
+ {
+ this-&gt;_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this-&gt;_M_setstate(ios_base::badbit); }
+</pre></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="using.exceptions.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id618326"></a><p><span class="title"><i>
+ System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
+ </i>. </span><span class="pagenums">
+ 2.9.5 Thread Cancellation
+ . </span><span class="copyright">Copyright © 2008
+ The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span><span class="biblioid">
+ <a class="ulink" href="http://www.opengroup.org/austin/" target="_top">
+ </a>
+ . </span></p></div><div class="biblioentry"><a id="id627763"></a><p><span class="title"><i>
+ Error and Exception Handling
+ </i>. </span><span class="author"><span class="firstname">David</span> <span class="surname">Abrahams </span>. </span><span class="publisher"><span class="publishername">
+ Boost
+ . </span></span><span class="biblioid">
+ <a class="ulink" href="http://www.boost.org/community/error_handling.html" target="_top">
+ </a>
+ . </span></p></div><div class="biblioentry"><a id="id633982"></a><p><span class="title"><i>
+ Exception-Safety in Generic Components
+ </i>. </span><span class="author"><span class="firstname">David</span> <span class="surname">Abrahams</span>. </span><span class="publisher"><span class="publishername">
+ Boost
+ . </span></span><span class="biblioid">
+ <a class="ulink" href="http://www.boost.org/community/exception_safety.html" target="_top">
+ </a>
+ . </span></p></div><div class="biblioentry"><a id="id634268"></a><p><span class="title"><i>
+ Standard Library Exception Policy
+ </i>. </span><span class="author"><span class="firstname">Matt</span> <span class="surname">Austern</span>. </span><span class="publisher"><span class="publishername">
+ WG21 N1077
+ . </span></span><span class="biblioid">
+ <a class="ulink" href="www.open-std.org/jtc1/sc22/wg21/docs/papers/1997/N1077.pdf" target="_top">
+ </a>
+ . </span></p></div><div class="biblioentry"><a id="id642510"></a><p><span class="title"><i>
+ ia64 c++ abi exception handling
+ </i>. </span><span class="author"><span class="firstname">Richard</span> <span class="surname">Henderson</span>. </span><span class="publisher"><span class="publishername">
+ GNU
+ . </span></span><span class="biblioid">
+ <a class="ulink" href="http://gcc.gnu.org/ml/gcc-patches/2001-03/msg00661.html" target="_top">
+ </a>
+ . </span></p></div><div class="biblioentry"><a id="id636666"></a><p><span class="title"><i>
+ Appendix E: Standard-Library Exception Safety
+ </i>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="biblioid">
+ <a class="ulink" href="http://www.research.att.com/~bs/3rd_safe.pdf" target="_top">
+ </a>
+ . </span></p></div><div class="biblioentry"><a id="id707620"></a><p><span class="title"><i>
+ Exceptional C++
+ </i>. </span><span class="pagenums">
+ Exception-Safety Issues and Techniques
+ . </span><span class="author"><span class="firstname">Herb</span> <span class="surname">Sutter</span>. </span></p></div><div class="biblioentry"><a id="id652939"></a><p><span class="title"><i>
+ exception_defines.h #defines try/catch
+ </i>. </span><span class="subtitle">
+ GCC Bug <a class="ulink" href="http://gcc.gnu.org/PR25191" target="_top">25191</a>
+ . </span><span class="biblioid">
+ . </span></p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="using_concurrency.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="using.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="debug.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Concurrency </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Debugging Support</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/using_headers.html b/libstdc++-v3/doc/html/manual/using_headers.html
index a7b21388bd2..4986fe585a3 100644
--- a/libstdc++-v3/doc/html/manual/using_headers.html
+++ b/libstdc++-v3/doc/html/manual/using_headers.html
@@ -20,16 +20,19 @@
upcoming 200x standard.
</p><p>
C++98/03 include files. These are available in the default compilation mode, i.e. <code class="code">-std=c++98</code> or <code class="code">-std=gnu++98</code>.
- </p><div class="table"><a id="id450185"></a><p class="title"><b>Table 3.1. C++ 1998 Library Headers</b></p><div class="table-contents"><table summary="C++ 1998 Library Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col /></colgroup><tbody><tr><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="filename">bitset</code></td><td align="left"><code class="filename">complex</code></td><td align="left"><code class="filename">deque</code></td><td align="left"><code class="filename">exception</code></td></tr><tr><td align="left"><code class="filename">fstream</code></td><td align="left"><code class="filename">functional</code></td><td align="left"><code class="filename">iomanip</code></td><td align="left"><code class="filename">ios</code></td><td align="left"><code class="filename">iosfwd</code></td></tr><tr><td align="left"><code class="filename">iostream</code></td><td align="left"><code class="filename">istream</code></td><td align="left"><code class="filename">iterator</code></td><td align="left"><code class="filename">limits</code></td><td align="left"><code class="filename">list</code></td></tr><tr><td align="left"><code class="filename">locale</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="filename">memory</code></td><td align="left"><code class="filename">new</code></td><td align="left"><code class="filename">numeric</code></td></tr><tr><td align="left"><code class="filename">ostream</code></td><td align="left"><code class="filename">queue</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="filename">sstream</code></td><td align="left"><code class="filename">stack</code></td></tr><tr><td align="left"><code class="filename">stdexcept</code></td><td align="left"><code class="filename">streambuf</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="filename">utility</code></td><td align="left"><code class="filename">typeinfo</code></td></tr><tr><td align="left"><code class="filename">valarray</code></td><td align="left"><code class="filename">vector</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id455065"></a><p class="title"><b>Table 3.2. C++ 1998 Library Headers for C Library Facilities</b></p><div class="table-contents"><table summary="C++ 1998 Library Headers for C Library Facilities" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col /></colgroup><tbody><tr><td align="left"><code class="filename">cassert</code></td><td align="left"><code class="filename">cerrno</code></td><td align="left"><code class="filename">cctype</code></td><td align="left"><code class="filename">cfloat</code></td><td align="left"><code class="filename">ciso646</code></td></tr><tr><td align="left"><code class="filename">climits</code></td><td align="left"><code class="filename">clocale</code></td><td align="left"><code class="filename">cmath</code></td><td align="left"><code class="filename">csetjmp</code></td><td align="left"><code class="filename">csignal</code></td></tr><tr><td align="left"><code class="filename">cstdarg</code></td><td align="left"><code class="filename">cstddef</code></td><td align="left"><code class="filename">cstdio</code></td><td align="left"><code class="filename">cstdlib</code></td><td align="left"><code class="filename">cstring</code></td></tr><tr><td align="left"><code class="filename">ctime</code></td><td align="left"><code class="filename">cwchar</code></td><td align="left"><code class="filename">cwctype</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p>
+ </p><div class="table"><a id="id651524"></a><p class="title"><b>Table 3.1. C++ 1998 Library Headers</b></p><div class="table-contents"><table summary="C++ 1998 Library Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col /></colgroup><tbody><tr><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="filename">bitset</code></td><td align="left"><code class="filename">complex</code></td><td align="left"><code class="filename">deque</code></td><td align="left"><code class="filename">exception</code></td></tr><tr><td align="left"><code class="filename">fstream</code></td><td align="left"><code class="filename">functional</code></td><td align="left"><code class="filename">iomanip</code></td><td align="left"><code class="filename">ios</code></td><td align="left"><code class="filename">iosfwd</code></td></tr><tr><td align="left"><code class="filename">iostream</code></td><td align="left"><code class="filename">istream</code></td><td align="left"><code class="filename">iterator</code></td><td align="left"><code class="filename">limits</code></td><td align="left"><code class="filename">list</code></td></tr><tr><td align="left"><code class="filename">locale</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="filename">memory</code></td><td align="left"><code class="filename">new</code></td><td align="left"><code class="filename">numeric</code></td></tr><tr><td align="left"><code class="filename">ostream</code></td><td align="left"><code class="filename">queue</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="filename">sstream</code></td><td align="left"><code class="filename">stack</code></td></tr><tr><td align="left"><code class="filename">stdexcept</code></td><td align="left"><code class="filename">streambuf</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="filename">utility</code></td><td align="left"><code class="filename">typeinfo</code></td></tr><tr><td align="left"><code class="filename">valarray</code></td><td align="left"><code class="filename">vector</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id639501"></a><p class="title"><b>Table 3.2. C++ 1998 Library Headers for C Library Facilities</b></p><div class="table-contents"><table summary="C++ 1998 Library Headers for C Library Facilities" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col /></colgroup><tbody><tr><td align="left"><code class="filename">cassert</code></td><td align="left"><code class="filename">cerrno</code></td><td align="left"><code class="filename">cctype</code></td><td align="left"><code class="filename">cfloat</code></td><td align="left"><code class="filename">ciso646</code></td></tr><tr><td align="left"><code class="filename">climits</code></td><td align="left"><code class="filename">clocale</code></td><td align="left"><code class="filename">cmath</code></td><td align="left"><code class="filename">csetjmp</code></td><td align="left"><code class="filename">csignal</code></td></tr><tr><td align="left"><code class="filename">cstdarg</code></td><td align="left"><code class="filename">cstddef</code></td><td align="left"><code class="filename">cstdio</code></td><td align="left"><code class="filename">cstdlib</code></td><td align="left"><code class="filename">cstring</code></td></tr><tr><td align="left"><code class="filename">ctime</code></td><td align="left"><code class="filename">cwchar</code></td><td align="left"><code class="filename">cwctype</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p>
C++0x include files. These are only available in C++0x compilation
mode, i.e. <code class="literal">-std=c++0x</code> or <code class="literal">-std=gnu++0x</code>.
-</p><p></p><div class="table"><a id="id440168"></a><p class="title"><b>Table 3.3. C++ 200x Library Headers</b></p><div class="table-contents"><table summary="C++ 200x Library Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col /></colgroup><tbody><tr><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="filename">array</code></td><td align="left"><code class="filename">bitset</code></td><td align="left"><code class="filename">chrono</code></td><td align="left"><code class="filename">complex</code></td></tr><tr><td align="left"><code class="filename">condition_variable</code></td><td align="left"><code class="filename">deque</code></td><td align="left"><code class="filename">exception</code></td><td align="left"><code class="filename">forward_list</code></td><td align="left"><code class="filename">fstream</code></td></tr><tr><td align="left"><code class="filename">functional</code></td><td align="left"><code class="filename">initalizer_list</code></td><td align="left"><code class="filename">iomanip</code></td><td align="left"><code class="filename">ios</code></td><td align="left"><code class="filename">iosfwd</code></td></tr><tr><td align="left"><code class="filename">iostream</code></td><td align="left"><code class="filename">istream</code></td><td align="left"><code class="filename">iterator</code></td><td align="left"><code class="filename">limits</code></td><td align="left"><code class="filename">list</code></td></tr><tr><td align="left"><code class="filename">locale</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="filename">memory</code></td><td align="left"><code class="filename">mutex</code></td><td align="left"><code class="filename">new</code></td></tr><tr><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="filename">ostream</code></td><td align="left"><code class="filename">queue</code></td><td align="left"><code class="filename">random</code></td><td align="left"><code class="filename">ratio</code></td></tr><tr><td align="left"><code class="filename">regex</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="filename">sstream</code></td><td align="left"><code class="filename">stack</code></td><td align="left"><code class="filename">stdexcept</code></td></tr><tr><td align="left"><code class="filename">streambuf</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="filename">system_error</code></td><td align="left"><code class="filename">thread</code></td><td align="left"><code class="filename">tuple</code></td></tr><tr><td align="left"><code class="filename">type_traits</code></td><td align="left"><code class="filename">typeinfo</code></td><td align="left"><code class="filename">unordered_map</code></td><td align="left"><code class="filename">unordered_set</code></td><td align="left"><code class="filename">utility</code></td></tr><tr><td align="left"><code class="filename">valarray</code></td><td align="left"><code class="filename">vector</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id485458"></a><p class="title"><b>Table 3.4. C++ 200x Library Headers for C Library Facilities</b></p><div class="table-contents"><table summary="C++ 200x Library Headers for C Library Facilities" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">cassert</code></td><td align="left"><code class="filename">ccomplex</code></td><td align="left"><code class="filename">cctype</code></td><td align="left"><code class="filename">cerrno</code></td><td align="left"><code class="filename">cfenv</code></td></tr><tr><td align="left"><code class="filename">cfloat</code></td><td align="left"><code class="filename">cinttypes</code></td><td align="left"><code class="filename">ciso646</code></td><td align="left"><code class="filename">climits</code></td><td align="left"><code class="filename">clocale</code></td></tr><tr><td align="left"><code class="filename">cmath</code></td><td align="left"><code class="filename">csetjmp</code></td><td align="left"><code class="filename">csignal</code></td><td align="left"><code class="filename">cstdarg</code></td><td align="left"><code class="filename">cstdatomic</code></td></tr><tr><td align="left"><code class="filename">cstdbool</code></td><td align="left"><code class="filename">cstddef</code></td><td align="left"><code class="filename">cstdint</code></td><td align="left"><code class="filename">cstdlib</code></td><td align="left"><code class="filename">cstdio</code></td></tr><tr><td align="left"><code class="filename">cstring</code></td><td align="left"><code class="filename">ctgmath</code></td><td align="left"><code class="filename">ctime</code></td><td align="left"><code class="filename">cuchar</code></td><td align="left"><code class="filename">cwchar</code></td></tr><tr><td align="left"><code class="filename">cwctype</code></td><td align="left"><code class="filename">stdatomic.h</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p>
+</p><p></p><div class="table"><a id="id645876"></a><p class="title"><b>Table 3.3. C++ 200x Library Headers</b></p><div class="table-contents"><table summary="C++ 200x Library Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col /></colgroup><tbody><tr><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="filename">array</code></td><td align="left"><code class="filename">bitset</code></td><td align="left"><code class="filename">chrono</code></td><td align="left"><code class="filename">complex</code></td></tr><tr><td align="left"><code class="filename">condition_variable</code></td><td align="left"><code class="filename">deque</code></td><td align="left"><code class="filename">exception</code></td><td align="left"><code class="filename">forward_list</code></td><td align="left"><code class="filename">fstream</code></td></tr><tr><td align="left"><code class="filename">functional</code></td><td align="left"><code class="filename">future</code></td><td align="left"><code class="filename">initalizer_list</code></td><td align="left"><code class="filename">iomanip</code></td><td align="left"><code class="filename">ios</code></td></tr><tr><td align="left"><code class="filename">iosfwd</code></td><td align="left"><code class="filename">iostream</code></td><td align="left"><code class="filename">istream</code></td><td align="left"><code class="filename">iterator</code></td><td align="left"><code class="filename">limits</code></td></tr><tr><td align="left"><code class="filename">list</code></td><td align="left"><code class="filename">locale</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="filename">memory</code></td><td align="left"><code class="filename">mutex</code></td></tr><tr><td align="left"><code class="filename">new</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="filename">ostream</code></td><td align="left"><code class="filename">queue</code></td><td align="left"><code class="filename">random</code></td></tr><tr><td align="left"><code class="filename">ratio</code></td><td align="left"><code class="filename">regex</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="filename">sstream</code></td><td align="left"><code class="filename">stack</code></td></tr><tr><td align="left"><code class="filename">stdexcept</code></td><td align="left"><code class="filename">streambuf</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="filename">system_error</code></td><td align="left"><code class="filename">thread</code></td></tr><tr><td align="left"><code class="filename">tuple</code></td><td align="left"><code class="filename">type_traits</code></td><td align="left"><code class="filename">typeinfo</code></td><td align="left"><code class="filename">unordered_map</code></td><td align="left"><code class="filename">unordered_set</code></td></tr><tr><td align="left"><code class="filename">utility</code></td><td align="left"><code class="filename">valarray</code></td><td align="left"><code class="filename">vector</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id646983"></a><p class="title"><b>Table 3.4. C++ 200x Library Headers for C Library Facilities</b></p><div class="table-contents"><table summary="C++ 200x Library Headers for C Library Facilities" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">cassert</code></td><td align="left"><code class="filename">ccomplex</code></td><td align="left"><code class="filename">cctype</code></td><td align="left"><code class="filename">cerrno</code></td><td align="left"><code class="filename">cfenv</code></td></tr><tr><td align="left"><code class="filename">cfloat</code></td><td align="left"><code class="filename">cinttypes</code></td><td align="left"><code class="filename">ciso646</code></td><td align="left"><code class="filename">climits</code></td><td align="left"><code class="filename">clocale</code></td></tr><tr><td align="left"><code class="filename">cmath</code></td><td align="left"><code class="filename">csetjmp</code></td><td align="left"><code class="filename">csignal</code></td><td align="left"><code class="filename">cstdarg</code></td><td align="left"><code class="filename">cstdatomic</code></td></tr><tr><td align="left"><code class="filename">cstdbool</code></td><td align="left"><code class="filename">cstddef</code></td><td align="left"><code class="filename">cstdint</code></td><td align="left"><code class="filename">cstdlib</code></td><td align="left"><code class="filename">cstdio</code></td></tr><tr><td align="left"><code class="filename">cstring</code></td><td align="left"><code class="filename">ctgmath</code></td><td align="left"><code class="filename">ctime</code></td><td align="left"><code class="filename">cuchar</code></td><td align="left"><code class="filename">cwchar</code></td></tr><tr><td align="left"><code class="filename">cwctype</code></td><td align="left"><code class="filename">stdatomic.h</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p>
In addition, TR1 includes as:
-</p><div class="table"><a id="id437190"></a><p class="title"><b>Table 3.5. C++ TR1 Library Headers</b></p><div class="table-contents"><table summary="C++ TR1 Library Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">tr1/array</code></td><td align="left"><code class="filename">tr1/complex</code></td><td align="left"><code class="filename">tr1/memory</code></td><td align="left"><code class="filename">tr1/functional</code></td><td align="left"><code class="filename">tr1/random</code></td></tr><tr><td align="left"><code class="filename">tr1/regex</code></td><td align="left"><code class="filename">tr1/tuple</code></td><td align="left"><code class="filename">tr1/type_traits</code></td><td align="left"><code class="filename">tr1/unordered_map</code></td><td align="left"><code class="filename">tr1/unordered_set</code></td></tr><tr><td align="left"><code class="filename">tr1/utility</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id387281"></a><p class="title"><b>Table 3.6. C++ TR1 Library Headers for C Library Facilities</b></p><div class="table-contents"><table summary="C++ TR1 Library Headers for C Library Facilities" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">tr1/ccomplex</code></td><td align="left"><code class="filename">tr1/cfenv</code></td><td align="left"><code class="filename">tr1/cfloat</code></td><td align="left"><code class="filename">tr1/cmath</code></td><td align="left"><code class="filename">tr1/cinttypes</code></td></tr><tr><td align="left"><code class="filename">tr1/climits</code></td><td align="left"><code class="filename">tr1/cstdarg</code></td><td align="left"><code class="filename">tr1/cstdbool</code></td><td align="left"><code class="filename">tr1/cstdint</code></td><td align="left"><code class="filename">tr1/cstdio</code></td></tr><tr><td align="left"><code class="filename">tr1/cstdlib</code></td><td align="left"><code class="filename">tr1/ctgmath</code></td><td align="left"><code class="filename">tr1/ctime</code></td><td align="left"><code class="filename">tr1/cwchar</code></td><td align="left"><code class="filename">tr1/cwctype</code></td></tr></tbody></table></div></div><br class="table-break" /><p>
+</p><div class="table"><a id="id631952"></a><p class="title"><b>Table 3.5. C++ TR 1 Library Headers</b></p><div class="table-contents"><table summary="C++ TR 1 Library Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">tr1/array</code></td><td align="left"><code class="filename">tr1/complex</code></td><td align="left"><code class="filename">tr1/memory</code></td><td align="left"><code class="filename">tr1/functional</code></td><td align="left"><code class="filename">tr1/random</code></td></tr><tr><td align="left"><code class="filename">tr1/regex</code></td><td align="left"><code class="filename">tr1/tuple</code></td><td align="left"><code class="filename">tr1/type_traits</code></td><td align="left"><code class="filename">tr1/unordered_map</code></td><td align="left"><code class="filename">tr1/unordered_set</code></td></tr><tr><td align="left"><code class="filename">tr1/utility</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id636818"></a><p class="title"><b>Table 3.6. C++ TR 1 Library Headers for C Library Facilities</b></p><div class="table-contents"><table summary="C++ TR 1 Library Headers for C Library Facilities" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">tr1/ccomplex</code></td><td align="left"><code class="filename">tr1/cfenv</code></td><td align="left"><code class="filename">tr1/cfloat</code></td><td align="left"><code class="filename">tr1/cmath</code></td><td align="left"><code class="filename">tr1/cinttypes</code></td></tr><tr><td align="left"><code class="filename">tr1/climits</code></td><td align="left"><code class="filename">tr1/cstdarg</code></td><td align="left"><code class="filename">tr1/cstdbool</code></td><td align="left"><code class="filename">tr1/cstdint</code></td><td align="left"><code class="filename">tr1/cstdio</code></td></tr><tr><td align="left"><code class="filename">tr1/cstdlib</code></td><td align="left"><code class="filename">tr1/ctgmath</code></td><td align="left"><code class="filename">tr1/ctime</code></td><td align="left"><code class="filename">tr1/cwchar</code></td><td align="left"><code class="filename">tr1/cwctype</code></td></tr></tbody></table></div></div><br class="table-break" /><p>Decimal floating-point arithmetic is available if the C++
+compiler supports scalar decimal floating-point types defined via
+<code class="code">__attribute__((mode(SD|DD|LD)))</code>.
+</p><div class="table"><a id="id685876"></a><p class="title"><b>Table 3.7. C++ TR 24733 Decimal Floating-Point Header</b></p><div class="table-contents"><table summary="C++ TR 24733 Decimal Floating-Point Header" border="1"><colgroup><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">decimal/decimal</code></td></tr></tbody></table></div></div><br class="table-break" /><p>
Also included are files for the C++ ABI interface:
-</p><div class="table"><a id="id517054"></a><p class="title"><b>Table 3.7. C++ ABI Headers</b></p><div class="table-contents"><table summary="C++ ABI Headers" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">cxxabi.h</code></td><td align="left"><code class="filename">cxxabi_forced.h</code></td></tr></tbody></table></div></div><br class="table-break" /><p>
+</p><div class="table"><a id="id639029"></a><p class="title"><b>Table 3.8. C++ ABI Headers</b></p><div class="table-contents"><table summary="C++ ABI Headers" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">cxxabi.h</code></td><td align="left"><code class="filename">cxxabi_forced.h</code></td></tr></tbody></table></div></div><br class="table-break" /><p>
And a large variety of extensions.
-</p><div class="table"><a id="id439669"></a><p class="title"><b>Table 3.8. Extension Headers</b></p><div class="table-contents"><table summary="Extension Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">ext/algorithm</code></td><td align="left"><code class="filename">ext/atomicity.h</code></td><td align="left"><code class="filename">ext/array_allocator.h</code></td><td align="left"><code class="filename">ext/bitmap_allocator.h</code></td><td align="left"><code class="filename">ext/cast.h</code></td></tr><tr><td align="left"><code class="filename">ext/codecvt_specializations.h</code></td><td align="left"><code class="filename">ext/concurrence.h</code></td><td align="left"><code class="filename">ext/debug_allocator.h</code></td><td align="left"><code class="filename">ext/enc_filebuf.h</code></td><td align="left"><code class="filename">ext/extptr_allocator.h</code></td></tr><tr><td align="left"><code class="filename">ext/functional</code></td><td align="left"><code class="filename">ext/iterator</code></td><td align="left"><code class="filename">ext/malloc_allocator.h</code></td><td align="left"><code class="filename">ext/memory</code></td><td align="left"><code class="filename">ext/mt_allocator.h</code></td></tr><tr><td align="left"><code class="filename">ext/new_allocator.h</code></td><td align="left"><code class="filename">ext/numeric</code></td><td align="left"><code class="filename">ext/numeric_traits.h</code></td><td align="left"><code class="filename">ext/pb_ds/assoc_container.h</code></td><td align="left"><code class="filename">ext/pb_ds/priority_queue.h</code></td></tr><tr><td align="left"><code class="filename">ext/pod_char_traits.h</code></td><td align="left"><code class="filename">ext/pool_allocator.h</code></td><td align="left"><code class="filename">ext/rb_tree</code></td><td align="left"><code class="filename">ext/rope</code></td><td align="left"><code class="filename">ext/slist</code></td></tr><tr><td align="left"><code class="filename">ext/stdio_filebuf.h</code></td><td align="left"><code class="filename">ext/stdio_sync_filebuf.h</code></td><td align="left"><code class="filename">ext/throw_allocator.h</code></td><td align="left"><code class="filename">ext/typelist.h</code></td><td align="left"><code class="filename">ext/type_traits.h</code></td></tr><tr><td align="left"><code class="filename">ext/vstring.h</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id422368"></a><p class="title"><b>Table 3.9. Extension Debug Headers</b></p><div class="table-contents"><table summary="Extension Debug Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">debug/bitset</code></td><td align="left"><code class="filename">debug/deque</code></td><td align="left"><code class="filename">debug/list</code></td><td align="left"><code class="filename">debug/map</code></td><td align="left"><code class="filename">debug/set</code></td></tr><tr><td align="left"><code class="filename">debug/string</code></td><td align="left"><code class="filename">debug/unordered_map</code></td><td align="left"><code class="filename">debug/unordered_set</code></td><td align="left"><code class="filename">debug/vector</code></td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id436860"></a><p class="title"><b>Table 3.10. Extension Parallel Headers</b></p><div class="table-contents"><table summary="Extension Parallel Headers" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">parallel/algorithm</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr></tbody></table></div></div><br class="table-break" /></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.headers.mixing"></a>Mixing Headers</h3></div></div></div><p> A few simple rules.
+</p><div class="table"><a id="id637647"></a><p class="title"><b>Table 3.9. Extension Headers</b></p><div class="table-contents"><table summary="Extension Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">ext/algorithm</code></td><td align="left"><code class="filename">ext/atomicity.h</code></td><td align="left"><code class="filename">ext/array_allocator.h</code></td><td align="left"><code class="filename">ext/bitmap_allocator.h</code></td><td align="left"><code class="filename">ext/cast.h</code></td></tr><tr><td align="left"><code class="filename">ext/codecvt_specializations.h</code></td><td align="left"><code class="filename">ext/concurrence.h</code></td><td align="left"><code class="filename">ext/debug_allocator.h</code></td><td align="left"><code class="filename">ext/enc_filebuf.h</code></td><td align="left"><code class="filename">ext/extptr_allocator.h</code></td></tr><tr><td align="left"><code class="filename">ext/functional</code></td><td align="left"><code class="filename">ext/iterator</code></td><td align="left"><code class="filename">ext/malloc_allocator.h</code></td><td align="left"><code class="filename">ext/memory</code></td><td align="left"><code class="filename">ext/mt_allocator.h</code></td></tr><tr><td align="left"><code class="filename">ext/new_allocator.h</code></td><td align="left"><code class="filename">ext/numeric</code></td><td align="left"><code class="filename">ext/numeric_traits.h</code></td><td align="left"><code class="filename">ext/pb_ds/assoc_container.h</code></td><td align="left"><code class="filename">ext/pb_ds/priority_queue.h</code></td></tr><tr><td align="left"><code class="filename">ext/pod_char_traits.h</code></td><td align="left"><code class="filename">ext/pool_allocator.h</code></td><td align="left"><code class="filename">ext/rb_tree</code></td><td align="left"><code class="filename">ext/rope</code></td><td align="left"><code class="filename">ext/slist</code></td></tr><tr><td align="left"><code class="filename">ext/stdio_filebuf.h</code></td><td align="left"><code class="filename">ext/stdio_sync_filebuf.h</code></td><td align="left"><code class="filename">ext/throw_allocator.h</code></td><td align="left"><code class="filename">ext/typelist.h</code></td><td align="left"><code class="filename">ext/type_traits.h</code></td></tr><tr><td align="left"><code class="filename">ext/vstring.h</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id631989"></a><p class="title"><b>Table 3.10. Extension Debug Headers</b></p><div class="table-contents"><table summary="Extension Debug Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">debug/bitset</code></td><td align="left"><code class="filename">debug/deque</code></td><td align="left"><code class="filename">debug/list</code></td><td align="left"><code class="filename">debug/map</code></td><td align="left"><code class="filename">debug/set</code></td></tr><tr><td align="left"><code class="filename">debug/string</code></td><td align="left"><code class="filename">debug/unordered_map</code></td><td align="left"><code class="filename">debug/unordered_set</code></td><td align="left"><code class="filename">debug/vector</code></td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id521103"></a><p class="title"><b>Table 3.11. Extension Profile Headers</b></p><div class="table-contents"><table summary="Extension Profile Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">profile/bitset</code></td><td align="left"><code class="filename">profile/deque</code></td><td align="left"><code class="filename">profile/list</code></td><td align="left"><code class="filename">profile/map</code></td></tr><tr><td align="left"><code class="filename">profile/set</code></td><td align="left"><code class="filename">profile/unordered_map</code></td><td align="left"><code class="filename">profile/unordered_set</code></td><td align="left"><code class="filename">profile/vector</code></td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id684216"></a><p class="title"><b>Table 3.12. Extension Parallel Headers</b></p><div class="table-contents"><table summary="Extension Parallel Headers" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">parallel/algorithm</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr></tbody></table></div></div><br class="table-break" /></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.headers.mixing"></a>Mixing Headers</h3></div></div></div><p> A few simple rules.
</p><p>First, mixing different dialects of the standard headers is not
possible. It's an all-or-nothing affair. Thus, code like
</p><pre class="programlisting">
diff --git a/libstdc++-v3/doc/html/manual/utilities.html b/libstdc++-v3/doc/html/manual/utilities.html
index ca5573140d2..26cef8e6d18 100644
--- a/libstdc++-v3/doc/html/manual/utilities.html
+++ b/libstdc++-v3/doc/html/manual/utilities.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Part IV.  Utilities</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="bk01pt03ch07s03.html" title="Cancellation" /><link rel="next" href="functors.html" title="Chapter 9. Functors" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part IV. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Part IV.  Utilities</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="bk01pt03ch07s02.html" title="Adding Data to Exceptions" /><link rel="next" href="functors.html" title="Chapter 9. Functors" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part IV. 
Utilities
-</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt03ch07s03.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="functors.html">Next</a></td></tr></table><hr /></div><div class="part" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="manual.util"></a>Part IV. 
+</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt03ch07s02.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="functors.html">Next</a></td></tr></table><hr /></div><div class="part" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="manual.util"></a>Part IV. 
Utilities
- <a id="id440726" class="indexterm"></a>
-</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="functors.html">9. Functors</a></span></dt><dt><span class="chapter"><a href="pairs.html">10. Pairs</a></span></dt><dt><span class="chapter"><a href="memory.html">11. Memory</a></span></dt><dd><dl><dt><span class="sect1"><a href="memory.html#manual.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="sect2"><a href="memory.html#allocator.req">Requirements</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="sect1"><a href="auto_ptr.html">auto_ptr</a></span></dt><dd><dl><dt><span class="sect2"><a href="auto_ptr.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="sect2"><a href="auto_ptr.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="shared_ptr.html">shared_ptr</a></span></dt><dd><dl><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.using">Use</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="traits.html">12. Traits</a></span></dt></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt03ch07s03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="functors.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Cancellation </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 9. Functors</td></tr></table></div></body></html>
+ <a id="id622508" class="indexterm"></a>
+</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="functors.html">9. Functors</a></span></dt><dt><span class="chapter"><a href="pairs.html">10. Pairs</a></span></dt><dt><span class="chapter"><a href="memory.html">11. Memory</a></span></dt><dd><dl><dt><span class="sect1"><a href="memory.html#manual.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="sect2"><a href="memory.html#allocator.req">Requirements</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="sect1"><a href="auto_ptr.html">auto_ptr</a></span></dt><dd><dl><dt><span class="sect2"><a href="auto_ptr.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="sect2"><a href="auto_ptr.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="shared_ptr.html">shared_ptr</a></span></dt><dd><dl><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.using">Use</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="traits.html">12. Traits</a></span></dt></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt03ch07s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="functors.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Adding Data to Exceptions </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 9. Functors</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/spine.html b/libstdc++-v3/doc/html/spine.html
index 6df1f0173bc..4d153da62b4 100644
--- a/libstdc++-v3/doc/html/spine.html
+++ b/libstdc++-v3/doc/html/spine.html
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>The GNU C++ Library Documentation</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><link rel="home" href="spine.html" title="The GNU C++ Library Documentation" /><link rel="next" href="manual/spine.html" title="The GNU C++ Library" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The GNU C++ Library Documentation</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="manual/spine.html">Next</a></td></tr></table><hr /></div><div class="set" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="set-index"></a>The GNU C++ Library Documentation</h1></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname"></span> <span class="surname"></span></h3></div><div class="author"><h3 class="author"><span class="firstname">Paolo</span> <span class="surname">Carlini</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Phil</span> <span class="surname">Edwards</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Doug</span> <span class="surname">Gregor</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Dhruv</span> <span class="surname">Matani</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Jason</span> <span class="surname">Merrill</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Mark</span> <span class="surname">Mitchell</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Nathan</span> <span class="surname">Myers</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Felix</span> <span class="surname">Natter</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Stefan</span> <span class="surname">Olsson</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Johannes</span> <span class="surname">Singler</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Ami</span> <span class="surname">Tavory</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Jonathan</span> <span class="surname">Wakely</span></h3></div></div></div><div><p class="copyright">Copyright © 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>The GNU C++ Library Documentation</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><link rel="home" href="spine.html" title="The GNU C++ Library Documentation" /><link rel="next" href="manual/spine.html" title="The GNU C++ Library" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The GNU C++ Library Documentation</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="manual/spine.html">Next</a></td></tr></table><hr /></div><div class="set" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="set-index"></a>The GNU C++ Library Documentation</h1></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname"></span> <span class="surname"></span></h3></div><div class="author"><h3 class="author"><span class="firstname">Paolo</span> <span class="surname">Carlini</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Phil</span> <span class="surname">Edwards</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Doug</span> <span class="surname">Gregor</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Dhruv</span> <span class="surname">Matani</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Jason</span> <span class="surname">Merrill</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Mark</span> <span class="surname">Mitchell</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Nathan</span> <span class="surname">Myers</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Felix</span> <span class="surname">Natter</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Stefan</span> <span class="surname">Olsson</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Silvius</span> <span class="surname">Rus</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Johannes</span> <span class="surname">Singler</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Ami</span> <span class="surname">Tavory</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Jonathan</span> <span class="surname">Wakely</span></h3></div></div></div><div><p class="copyright">Copyright © 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
<a class="ulink" href="http://www.fsf.org" target="_top">FSF</a>
</p></div></div><hr /></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="book"><a href="manual/spine.html">The GNU C++ Library</a></span></dt><dd><dl><dt><span class="part"><a href="manual/intro.html">I.
Introduction
-</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/status.html">1. Status</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dt><span class="sect2"><a href="manual/status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="sect2"><a href="manual/status.html#status.iso.200x">C++ 200x</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/license.html">License</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="sect2"><a href="manual/license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="sect2"><a href="manual/bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/setup.html">2. Setup</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="sect1"><a href="manual/configure.html">Configure</a></span></dt><dt><span class="sect1"><a href="manual/make.html">Make</a></span></dt><dt><span class="sect1"><a href="manual/test.html">Test</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/test.html#test.organization">Organization</a></span></dt><dt><span class="sect2"><a href="manual/test.html#test.run">Running the Testsuite</a></span></dt><dt><span class="sect2"><a href="manual/test.html#test.new_tests">Writing a new test case</a></span></dt><dt><span class="sect2"><a href="manual/test.html#test.harness">Test Harness and Utilities</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/using.html">3. Using</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/using.html#manual.intro.using.lib">Linking Library Binary Files</a></span></dt><dt><span class="sect1"><a href="manual/using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="sect2"><a href="manual/using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="sect2"><a href="manual/using_headers.html#manual.intro.using.headers.cheaders">The C Headers and namespace std</a></span></dt><dt><span class="sect2"><a href="manual/using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="sect2"><a href="manual/using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="sect2"><a href="manual/using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/using_macros.html">Macros</a></span></dt><dt><span class="sect1"><a href="manual/using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="sect2"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dt><span class="sect2"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/using_exceptions.html#intro.using.exception.propagating">Propagating Exceptions aka Exception Neutrality</a></span></dt><dt><span class="sect2"><a href="manual/using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="sect2"><a href="manual/using_exceptions.html#intro.using.exception.no">Support for -fno-exceptions</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/debug.html#debug.compiler">Using g++</a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.gdb">Using gdb</a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="manual/support.html">II.
+</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/status.html">1. Status</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dt><span class="sect2"><a href="manual/status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="sect2"><a href="manual/status.html#status.iso.200x">C++ 200x</a></span></dt><dt><span class="sect2"><a href="manual/status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/license.html">License</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="sect2"><a href="manual/license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="sect2"><a href="manual/bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/setup.html">2. Setup</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="sect1"><a href="manual/configure.html">Configure</a></span></dt><dt><span class="sect1"><a href="manual/make.html">Make</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/using.html">3. Using</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/using.html#manual.intro.using.lib">Linking Library Binary Files</a></span></dt><dt><span class="sect1"><a href="manual/using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="sect2"><a href="manual/using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="sect2"><a href="manual/using_headers.html#manual.intro.using.headers.cheaders">The C Headers and namespace std</a></span></dt><dt><span class="sect2"><a href="manual/using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="sect2"><a href="manual/using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="sect2"><a href="manual/using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/using_macros.html">Macros</a></span></dt><dt><span class="sect1"><a href="manual/using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="sect2"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dt><span class="sect2"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="sect2"><a href="manual/using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="sect2"><a href="manual/using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="sect2"><a href="manual/using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/debug.html#debug.compiler">Using g++</a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.gdb">Using gdb</a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="manual/support.html">II.
Support
</a></span></dt><dd><dl><dt><span class="preface"><a href="manual/bk01pt02pr01.html"></a></span></dt><dt><span class="chapter"><a href="manual/fundamental_types.html">4. Types</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/fundamental_types.html#manual.support.types.fundamental">Fundamental Types</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt02ch04s02.html">Numeric Properties</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt02ch04s03.html">NULL</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/dynamic_memory.html">5. Dynamic Memory</a></span></dt><dt><span class="chapter"><a href="manual/termination.html">6. Termination</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/termination.html#support.termination.handlers">Termination Handlers</a></span></dt><dt><span class="sect1"><a href="manual/verbose_termination.html">Verbose Terminate Handler</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="manual/diagnostics.html">III.
Diagnostics
-</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/exceptions.html">7. Exceptions</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/exceptions.html#manual.diagnostics.exceptions.hierarchy">Exception Classes</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt03ch07s02.html">Adding Data to Exceptions</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt03ch07s03.html">Cancellation</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/bk01pt03ch08.html">8. Concept Checking</a></span></dt></dl></dd><dt><span class="part"><a href="manual/utilities.html">IV.
+</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/exceptions.html">7. Exceptions</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/exceptions.html#manual.diagnostics.exceptions.hierarchy">Exception Classes</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt03ch07s02.html">Adding Data to Exceptions</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/bk01pt03ch08.html">8. Concept Checking</a></span></dt></dl></dd><dt><span class="part"><a href="manual/utilities.html">IV.
Utilities
</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/functors.html">9. Functors</a></span></dt><dt><span class="chapter"><a href="manual/pairs.html">10. Pairs</a></span></dt><dt><span class="chapter"><a href="manual/memory.html">11. Memory</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/memory.html#manual.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/memory.html#allocator.req">Requirements</a></span></dt><dt><span class="sect2"><a href="manual/memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="manual/memory.html#allocator.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="manual/memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="sect2"><a href="manual/memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="sect2"><a href="manual/memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/auto_ptr.html">auto_ptr</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/auto_ptr.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="sect2"><a href="manual/auto_ptr.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/shared_ptr.html">shared_ptr</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/shared_ptr.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="sect2"><a href="manual/shared_ptr.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="manual/shared_ptr.html#shared_ptr.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="manual/shared_ptr.html#shared_ptr.using">Use</a></span></dt><dt><span class="sect2"><a href="manual/shared_ptr.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/traits.html">12. Traits</a></span></dt></dl></dd><dt><span class="part"><a href="manual/strings.html">V.
@@ -38,13 +38,13 @@
</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/iostream_objects.html">24. Iostream Objects</a></span></dt><dt><span class="chapter"><a href="manual/streambufs.html">25. Stream Buffers</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/streambufs.html#io.streambuf.derived">Derived streambuf Classes</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt11ch25s02.html">Buffering</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/stringstreams.html">26. Memory Based Streams</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/stringstreams.html#manual.io.memstreams.compat">Compatibility With strstream</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/fstreams.html">27. File Based Streams</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/fstreams.html#manual.io.filestreams.copying_a_file">Copying a File</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt11ch27s02.html">Binary Input and Output</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/io_and_c.html">28. Interacting with C</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/io_and_c.html#manual.io.c.FILE">Using FILE* and file descriptors</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt11ch28s02.html">Performance</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="manual/extensions.html">XII.
Extensions
-</a></span></dt><dd><dl><dt><span class="preface"><a href="manual/bk01pt12pr03.html"></a></span></dt><dt><span class="chapter"><a href="manual/ext_compile_checks.html">29. Compile Time Checks</a></span></dt><dt><span class="chapter"><a href="manual/debug_mode.html">30. Debug Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch30s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch30s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch30s03.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch30s03.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt12ch30s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch30s04.html#debug_mode.design.goals">Goals</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch30s04.html#debug_mode.design.methods">Methods</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch30s04.html#debug_mode.design.other">Other Implementations</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/parallel_mode.html">31. Parallel Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch31s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch31s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch31s03.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch31s03.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch31s03.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt12ch31s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch31s04.html#parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch31s04.html#parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch31s04.html#parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt12ch31s05.html">Testing</a></span></dt><dt><span class="bibliography"><a href="manual/parallel_mode.html#parallel_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/ext_allocators.html">32. Allocators</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/ext_allocators.html#manual.ext.allocator.mt">mt_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/ext_allocators.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="sect2"><a href="manual/ext_allocators.html#allocator.mt.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="manual/ext_allocators.html#allocator.mt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="manual/ext_allocators.html#allocator.mt.example_single">Single Thread Example</a></span></dt><dt><span class="sect2"><a href="manual/ext_allocators.html#allocator.mt.example_multi">Multiple Thread Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bitmap_allocator.html">bitmap_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="sect2"><a href="manual/bitmap_allocator.html#allocator.bitmap.impl">Implementation</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/ext_containers.html">33. Containers</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/ext_containers.html#manual.ext.containers.pbds">Policy Based Data Structures</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch33s02.html">HP/SGI</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch33s03.html">Deprecated HP/SGI</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/ext_utilities.html">34. Utilities</a></span></dt><dt><span class="chapter"><a href="manual/ext_algorithms.html">35. Algorithms</a></span></dt><dt><span class="chapter"><a href="manual/ext_numerics.html">36. Numerics</a></span></dt><dt><span class="chapter"><a href="manual/ext_iterators.html">37. Iterators</a></span></dt><dt><span class="chapter"><a href="manual/ext_io.html">38. Input and Output</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/ext_demangling.html">39. Demangling</a></span></dt><dt><span class="chapter"><a href="manual/ext_concurrency.html">40. Concurrency</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="sect2"><a href="manual/ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt12ch40s02.html">Implementation</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch40s02.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch40s02.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt12ch40s03.html">Use</a></span></dt></dl></dd></dl></dd><dt><span class="appendix"><a href="manual/appendix_contributing.html">A.
+</a></span></dt><dd><dl><dt><span class="preface"><a href="manual/bk01pt12pr03.html"></a></span></dt><dt><span class="chapter"><a href="manual/ext_compile_checks.html">29. Compile Time Checks</a></span></dt><dt><span class="chapter"><a href="manual/debug_mode.html">30. Debug Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch30s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch30s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch30s03.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch30s03.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt12ch30s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch30s04.html#debug_mode.design.goals">Goals</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch30s04.html#debug_mode.design.methods">Methods</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch30s04.html#debug_mode.design.other">Other Implementations</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/parallel_mode.html">31. Parallel Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch31s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch31s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch31s03.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch31s03.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch31s03.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt12ch31s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch31s04.html#parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch31s04.html#parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch31s04.html#parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt12ch31s05.html">Testing</a></span></dt><dt><span class="bibliography"><a href="manual/parallel_mode.html#parallel_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/profile_mode.html">32. Profile Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/profile_mode.html#manual.ext.profile_mode.intro">Intro</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/profile_mode.html#manual.ext.profile_mode.using">Using the Profile Mode</a></span></dt><dt><span class="sect2"><a href="manual/profile_mode.html#manual.ext.profile_mode.tuning">Tuning the Profile Mode</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt12ch32s02.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch32s02.html#manual.ext.profile_mode.design.wrapper">Wrapper Model</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32s02.html#manual.ext.profile_mode.design.instrumentation">Instrumentation</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32s02.html#manual.ext.profile_mode.design.rtlib">Run Time Behavior</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32s02.html#manual.ext.profile_mode.design.analysis">Analysis and Diagnostics</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32s02.html#manual.ext.profile_mode.design.cost-model">Cost Model</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32s02.html#manual.ext.profile_mode.design.reports">Reports</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32s02.html#manual.ext.profile_mode.design.testing">Testing</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt12ch32s03.html">Extensions for Custom Containers</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch32s04.html">Empirical Cost Model</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch32s05.html">Implementation Issues</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch32s05.html#manual.ext.profile_mode.implementation.stack">Stack Traces</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32s05.html#manual.ext.profile_mode.implementation.symbols">Symbolization of Instruction Addresses</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32s05.html#manual.ext.profile_mode.implementation.concurrency">Concurrency</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32s05.html#manual.ext.profile_mode.implementation.stdlib-in-proflib">Using the Standard Library in the Instrumentation Implementation</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32s05.html#manual.ext.profile_mode.implementation.malloc-hooks">Malloc Hooks</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32s05.html#manual.ext.profile_mode.implementation.construction-destruction">Construction and Destruction of Global Objects</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt12ch32s06.html">Developer Information</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch32s06.html#manual.ext.profile_mode.developer.bigpic">Big Picture</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32s06.html#manual.ext.profile_mode.developer.howto">How To Add A Diagnostic</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt12ch32s07.html">Diagnostics</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch32s07.html#manual.ext.profile_mode.analysis.template">Diagnostic Template</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32s07.html#manual.ext.profile_mode.analysis.containers">Containers</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32s07.html#manual.ext.profile_mode.analysis.algorithms">Algorithms</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32s07.html#manual.ext.profile_mode.analysis.locality">Data Locality</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32s07.html#manual.ext.profile_mode.analysis.mthread">Multithreaded Data Access</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32s07.html#manual.ext.profile_mode.analysis.statistics">Statistics</a></span></dt></dl></dd><dt><span class="bibliography"><a href="manual/profile_mode.html#profile_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/ext_allocators.html">33. Allocators</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/ext_allocators.html#manual.ext.allocator.mt">mt_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/ext_allocators.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="sect2"><a href="manual/ext_allocators.html#allocator.mt.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="manual/ext_allocators.html#allocator.mt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="manual/ext_allocators.html#allocator.mt.example_single">Single Thread Example</a></span></dt><dt><span class="sect2"><a href="manual/ext_allocators.html#allocator.mt.example_multi">Multiple Thread Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bitmap_allocator.html">bitmap_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="sect2"><a href="manual/bitmap_allocator.html#allocator.bitmap.impl">Implementation</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/ext_containers.html">34. Containers</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/ext_containers.html#manual.ext.containers.pbds">Policy Based Data Structures</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch34s02.html">HP/SGI</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch34s03.html">Deprecated HP/SGI</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/ext_utilities.html">35. Utilities</a></span></dt><dt><span class="chapter"><a href="manual/ext_algorithms.html">36. Algorithms</a></span></dt><dt><span class="chapter"><a href="manual/ext_numerics.html">37. Numerics</a></span></dt><dt><span class="chapter"><a href="manual/ext_iterators.html">38. Iterators</a></span></dt><dt><span class="chapter"><a href="manual/ext_io.html">39. Input and Output</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/ext_demangling.html">40. Demangling</a></span></dt><dt><span class="chapter"><a href="manual/ext_concurrency.html">41. Concurrency</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="sect2"><a href="manual/ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt12ch41s02.html">Implementation</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch41s02.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch41s02.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt12ch41s03.html">Use</a></span></dt></dl></dd></dl></dd><dt><span class="appendix"><a href="manual/appendix_contributing.html">A.
Contributing
</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/appendix_contributing.html#contrib.list">Contributor Checklist</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/appendix_contributing.html#list.reading">Reading</a></span></dt><dt><span class="sect2"><a href="manual/appendix_contributing.html#list.copyright">Assignment</a></span></dt><dt><span class="sect2"><a href="manual/appendix_contributing.html#list.getting">Getting Sources</a></span></dt><dt><span class="sect2"><a href="manual/appendix_contributing.html#list.patches">Submitting Patches</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/source_organization.html">Directory Layout and Source Conventions</a></span></dt><dt><span class="sect1"><a href="manual/source_code_style.html">Coding Style</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/source_code_style.html#coding_style.bad_identifiers">Bad Identifiers</a></span></dt><dt><span class="sect2"><a href="manual/source_code_style.html#coding_style.example">By Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/documentation_style.html">Documentation Style</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/documentation_style.html#doc_style.doxygen">Doxygen</a></span></dt><dt><span class="sect2"><a href="manual/documentation_style.html#doc_style.docbook">Docbook</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/source_design_notes.html">Design Notes</a></span></dt></dl></dd><dt><span class="appendix"><a href="manual/appendix_porting.html">B.
Porting and Maintenance
-</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/appendix_porting.html#appendix.porting.build_hacking">Configure and Build Hacking</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/appendix_porting.html#build_hacking.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="manual/appendix_porting.html#build_hacking.map">Overview: What Comes from Where</a></span></dt><dt><span class="sect2"><a href="manual/appendix_porting.html#build_hacking.scripts">Storing Information in non-AC files (like configure.host)</a></span></dt><dt><span class="sect2"><a href="manual/appendix_porting.html#build_hacking.conventions">Coding and Commenting Conventions</a></span></dt><dt><span class="sect2"><a href="manual/appendix_porting.html#build_hacking.acinclude">The acinclude.m4 layout</a></span></dt><dt><span class="sect2"><a href="manual/appendix_porting.html#build_hacking.enable">GLIBCXX_ENABLE, the --enable maker</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/internals.html">Porting to New Hardware or Operating Systems</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/internals.html#internals.os">Operating System</a></span></dt><dt><span class="sect2"><a href="manual/internals.html#internals.cpu">CPU</a></span></dt><dt><span class="sect2"><a href="manual/internals.html#internals.char_types">Character Types</a></span></dt><dt><span class="sect2"><a href="manual/internals.html#internals.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="manual/internals.html#internals.numeric_limits">Numeric Limits</a></span></dt><dt><span class="sect2"><a href="manual/internals.html#internals.libtool">Libtool</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="sect2"><a href="manual/abi.html#abi.versioning">Versioning</a></span></dt><dt><span class="sect2"><a href="manual/abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="sect2"><a href="manual/abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="sect2"><a href="manual/abi.html#abi.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="manual/abi.html#abi.testing">Testing</a></span></dt><dt><span class="sect2"><a href="manual/abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/api.html#api.rel_300">3.0</a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_310">3.1</a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_320">3.2</a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_330">3.3</a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_340">3.4</a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_400">4.0</a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_410">4.1</a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_420">4.2</a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_430">4.3</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/backwards.html#backwards.first">First</a></span></dt><dt><span class="sect2"><a href="manual/backwards.html#backwards.second">Second</a></span></dt><dt><span class="sect2"><a href="manual/backwards.html#backwards.third">Third</a></span></dt></dl></dd></dl></dd><dt><span class="appendix"><a href="manual/appendix_free.html">C.
+</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/appendix_porting.html#appendix.porting.build_hacking">Configure and Build Hacking</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/appendix_porting.html#build_hacking.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="manual/appendix_porting.html#build_hacking.map">Overview: What Comes from Where</a></span></dt><dt><span class="sect2"><a href="manual/appendix_porting.html#build_hacking.scripts">Storing Information in non-AC files (like configure.host)</a></span></dt><dt><span class="sect2"><a href="manual/appendix_porting.html#build_hacking.conventions">Coding and Commenting Conventions</a></span></dt><dt><span class="sect2"><a href="manual/appendix_porting.html#build_hacking.acinclude">The acinclude.m4 layout</a></span></dt><dt><span class="sect2"><a href="manual/appendix_porting.html#build_hacking.enable">GLIBCXX_ENABLE, the --enable maker</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/internals.html">Porting to New Hardware or Operating Systems</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/internals.html#internals.os">Operating System</a></span></dt><dt><span class="sect2"><a href="manual/internals.html#internals.cpu">CPU</a></span></dt><dt><span class="sect2"><a href="manual/internals.html#internals.char_types">Character Types</a></span></dt><dt><span class="sect2"><a href="manual/internals.html#internals.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="manual/internals.html#internals.numeric_limits">Numeric Limits</a></span></dt><dt><span class="sect2"><a href="manual/internals.html#internals.libtool">Libtool</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/test.html">Test</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/test.html#test.organization">Organization</a></span></dt><dt><span class="sect2"><a href="manual/test.html#test.run">Running the Testsuite</a></span></dt><dt><span class="sect2"><a href="manual/test.html#test.new_tests">Writing a new test case</a></span></dt><dt><span class="sect2"><a href="manual/test.html#test.harness">Test Harness and Utilities</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="sect2"><a href="manual/abi.html#abi.versioning">Versioning</a></span></dt><dt><span class="sect2"><a href="manual/abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="sect2"><a href="manual/abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="sect2"><a href="manual/abi.html#abi.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="manual/abi.html#abi.testing">Testing</a></span></dt><dt><span class="sect2"><a href="manual/abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/api.html#api.rel_300">3.0</a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_310">3.1</a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_320">3.2</a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_330">3.3</a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_340">3.4</a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_400">4.0</a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_410">4.1</a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_420">4.2</a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_430">4.3</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/backwards.html#backwards.first">First</a></span></dt><dt><span class="sect2"><a href="manual/backwards.html#backwards.second">Second</a></span></dt><dt><span class="sect2"><a href="manual/backwards.html#backwards.third">Third</a></span></dt></dl></dd></dl></dd><dt><span class="appendix"><a href="manual/appendix_free.html">C.
Free Software Needs Free Documentation
</a></span></dt><dt><span class="appendix"><a href="manual/appendix_gpl.html">D.
diff --git a/libstdc++-v3/doc/xml/authors.xml b/libstdc++-v3/doc/xml/authors.xml
index 43d8d864130..5d7909f8b14 100644
--- a/libstdc++-v3/doc/xml/authors.xml
+++ b/libstdc++-v3/doc/xml/authors.xml
@@ -74,7 +74,7 @@
Allocators, ABI, API evolution and deprecation history,
Backwards Compatibility, Thread, Debug Support, Locales,
Facets, Parallel Mode, Headers, Namespaces, Construction and
- Structure, DocBook conversion and layout.
+ Structure, Using Exceptions, DocBook conversion and layout.
</para>
</authorblurb>
</author>
@@ -148,6 +148,17 @@
</author>
<author>
+ <firstname>Silvius</firstname>
+ <surname>Rus</surname>
+
+ <authorblurb>
+ <para>
+ Profile mode
+ </para>
+ </authorblurb>
+ </author>
+
+ <author>
<firstname>Johannes</firstname>
<surname>Singler</surname>
diff --git a/libstdc++-v3/doc/xml/manual/appendix_porting.xml b/libstdc++-v3/doc/xml/manual/appendix_porting.xml
index f565c0e03d4..c44a9adeb86 100644
--- a/libstdc++-v3/doc/xml/manual/appendix_porting.xml
+++ b/libstdc++-v3/doc/xml/manual/appendix_porting.xml
@@ -35,6 +35,11 @@
parse="xml" href="internals.xml">
</xi:include>
+ <!-- Test -->
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
+ parse="xml" href="test.xml">
+ </xi:include>
+
<!-- ABI Policy and Guidelines -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="abi.xml">
diff --git a/libstdc++-v3/doc/xml/manual/codecvt.xml b/libstdc++-v3/doc/xml/manual/codecvt.xml
index 0b731f00464..a5a558965cf 100644
--- a/libstdc++-v3/doc/xml/manual/codecvt.xml
+++ b/libstdc++-v3/doc/xml/manual/codecvt.xml
@@ -600,7 +600,7 @@ codecvt usage.
<biblioentry>
<title>
- System Interface Definitions, Issue 6 (IEEE Std. 1003.1-200x)
+ The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004)
</title>
<copyright>
@@ -610,7 +610,7 @@ codecvt usage.
</copyright>
<biblioid>
- <ulink url="http://www.opennc.org/austin/docreg.html">
+ <ulink url="http://www.unix.org/version3/ieee_std.html">
</ulink>
</biblioid>
diff --git a/libstdc++-v3/doc/xml/manual/ctype.xml b/libstdc++-v3/doc/xml/manual/ctype.xml
index 955dea90b4f..9a0a7ceaec7 100644
--- a/libstdc++-v3/doc/xml/manual/ctype.xml
+++ b/libstdc++-v3/doc/xml/manual/ctype.xml
@@ -182,7 +182,7 @@ characters.
<biblioentry>
<title>
- System Interface Definitions, Issue 6 (IEEE Std. 1003.1-200x)
+ The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004)
</title>
<copyright>
@@ -192,7 +192,7 @@ characters.
</copyright>
<biblioid>
- <ulink url="http://www.opennc.org/austin/docreg.html">
+ <ulink url="http://www.unix.org/version3/ieee_std.html">
</ulink>
</biblioid>
diff --git a/libstdc++-v3/doc/xml/manual/debug.xml b/libstdc++-v3/doc/xml/manual/debug.xml
index 8aa53070377..ca091268149 100644
--- a/libstdc++-v3/doc/xml/manual/debug.xml
+++ b/libstdc++-v3/doc/xml/manual/debug.xml
@@ -217,6 +217,56 @@
set print demangle on
set demangle-style gnu-v3
</programlisting>
+
+<para>
+ Starting with version 7.0, GDB includes support for writing
+ pretty-printers in Python. Pretty printers for STL classes are
+ distributed with GCC from version 4.5.0. The most recent version of
+ these printers are always found in libstdc++ svn repository.
+ To enable these printers, check-out the latest printers to a local
+ directory:
+</para>
+
+<programlisting>
+ svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python
+</programlisting>
+
+<para>
+ Next, add the following section to your ~/.gdbinit The path must
+ match the location where the Python module above was checked-out.
+ So if checked out to: /home/maude/gdb_printers/, the path would be as
+ written in the example below.
+</para>
+
+<programlisting>
+ python
+ import sys
+ sys.path.insert(0, '/home/maude/gdb_printers/python')
+ from libstdcxx.v6.printers import register_libstdcxx_printers
+ register_libstdcxx_printers (None)
+ end
+</programlisting>
+
+<para>
+ The path should be the only element that needs to be adjusted in the
+ example. Once loaded, STL classes that the printers support
+ should print in a more human-readable format. To print the classes
+ in the old style, use the /r (raw) switch in the print command
+ (i.e., print /r foo). This will print the classes as if the Python
+ pretty-printers were not loaded.
+</para>
+
+<para>
+ For additional information on STL support and GDB please visit:
+ <ulink url="http://sourceware.org/gdb/wiki/STLSupport"> "GDB Support
+ for STL" </ulink> in the GDB wiki. Additionally, in-depth
+ documentation and discussion of the pretty printing feature can be
+ found in "Pretty Printing" node in the GDB manual. You can find
+ on-line versions of the GDB user manual in GDB's homepage, at
+ <ulink url="http://sourceware.org/gdb/"> "GDB: The GNU Project
+ Debugger" </ulink>.
+</para>
+
</sect2>
<sect2 id="debug.exceptions">
diff --git a/libstdc++-v3/doc/xml/manual/diagnostics.xml b/libstdc++-v3/doc/xml/manual/diagnostics.xml
index d76f6e8e419..097d8917695 100644
--- a/libstdc++-v3/doc/xml/manual/diagnostics.xml
+++ b/libstdc++-v3/doc/xml/manual/diagnostics.xml
@@ -71,11 +71,6 @@
</programlisting>
</sect1>
- <sect1 id="manual.diagnostics.exceptions.cancellation" xreflabel="Cancellation">
- <title>Cancellation</title>
- <para>
- </para>
- </sect1>
</chapter>
<chapter id="manual.diagnostics.concept_checking" xreflabel="Concept Checking">
diff --git a/libstdc++-v3/doc/xml/manual/intro.xml b/libstdc++-v3/doc/xml/manual/intro.xml
index 2fcdeb1b09c..33bacae60b0 100644
--- a/libstdc++-v3/doc/xml/manual/intro.xml
+++ b/libstdc++-v3/doc/xml/manual/intro.xml
@@ -44,6 +44,11 @@
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="status_cxx200x.xml">
</xi:include>
+
+ <!-- Section 01.4 : Status C++ TR24733 -->
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
+ parse="xml" href="status_cxxtr24733.xml">
+ </xi:include>
</sect1>
<!-- Section 02 : License -->
@@ -190,10 +195,9 @@ requirements of the license of GCC.
<title>Implementation Bugs</title>
<para>
Information on known bugs, details on efforts to fix them, and
- fixed bugs are all available as part of the GCC bug tracking
- system, <ulink
- url="http://gcc.gnu.org/bugzilla">bugzilla</ulink>, with the
- category set to <literal>libstdc++</literal>.
+ fixed bugs are all available as part of the <ulink
+ url="http://gcc.gnu.org/bugs/">GCC bug tracking system</ulink>,
+ with the category set to <literal>libstdc++</literal>.
</para>
</sect2>
@@ -865,13 +869,8 @@ started to build.
</sect1>
- <!-- Section 04 : Test -->
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="test.xml">
- </xi:include>
</chapter>
-
<!-- Chapter 03 : Using -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="using.xml">
diff --git a/libstdc++-v3/doc/xml/manual/locale.xml b/libstdc++-v3/doc/xml/manual/locale.xml
index 893e4711804..faf5e938560 100644
--- a/libstdc++-v3/doc/xml/manual/locale.xml
+++ b/libstdc++-v3/doc/xml/manual/locale.xml
@@ -575,7 +575,7 @@ global locale" (emphasis Paolo), that is:
<biblioentry>
<title>
- System Interface Definitions, Issue 6 (IEEE Std. 1003.1-200x)
+ The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004)
</title>
<copyright>
@@ -585,7 +585,7 @@ global locale" (emphasis Paolo), that is:
</copyright>
<biblioid>
- <ulink url="http://www.opennc.org/austin/docreg.html">
+ <ulink url="http://www.unix.org/version3/ieee_std.html">
</ulink>
</biblioid>
diff --git a/libstdc++-v3/doc/xml/manual/messages.xml b/libstdc++-v3/doc/xml/manual/messages.xml
index c209ca7f018..2794030353c 100644
--- a/libstdc++-v3/doc/xml/manual/messages.xml
+++ b/libstdc++-v3/doc/xml/manual/messages.xml
@@ -594,7 +594,7 @@ java.util.Locale, java.util.ResourceBundle</pagenums>
Library and Tools.
</title>
<biblioid>
- <ulink url="http://sources.redhat.com/gettext">
+ <ulink url="http://www.gnu.org/software/gettext/">
</ulink>
</biblioid>
</biblioentry>
diff --git a/libstdc++-v3/doc/xml/manual/status_cxxtr24733.xml b/libstdc++-v3/doc/xml/manual/status_cxxtr24733.xml
new file mode 100644
index 00000000000..08e9a436703
--- /dev/null
+++ b/libstdc++-v3/doc/xml/manual/status_cxxtr24733.xml
@@ -0,0 +1,299 @@
+<sect2 id="status.iso.tr24733" xreflabel="Status C++ TR24733">
+<?dbhtml filename="status_iso_cxxtr24733.html"?>
+
+<sect2info>
+ <keywordset>
+ <keyword>
+ TR 24733
+ </keyword>
+ </keywordset>
+</sect2info>
+
+<title>C++ TR 24733</title>
+
+<para>
+This table is based on the table of contents of
+ISO/IEC TR 24733 Date: 2009-08-28
+Extension for the programming language C++ to support
+decimal floating-point arithmetic
+</para>
+
+<para>
+This page describes the TR 24733 support in mainline GCC SVN, not in any
+particular release.
+</para>
+
+<!-- Status is Yes or No, Broken/Partial-->
+<!--
+ Yes
+
+ No
+ <?dbhtml bgcolor="#C8B0B0" ?>
+ Broken/Partial
+ <?dbhtml bgcolor="#B0B0B0" ?>
+-->
+<table frame='all'>
+<title>C++ TR 24733 Implementation Status</title>
+<tgroup cols='4' align='left' colsep='0' rowsep='1'>
+<colspec colname='c1'></colspec>
+<colspec colname='c2'></colspec>
+<colspec colname='c3'></colspec>
+<colspec colname='c4'></colspec>
+ <thead>
+ <row>
+ <entry>Section</entry>
+ <entry>Description</entry>
+ <entry>Status</entry>
+ <entry>Comments</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>
+ <emphasis>0</emphasis>
+ </entry>
+ <entry namest="c2" nameend="c4" align="left">
+ <emphasis>Introduction</emphasis>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <emphasis>1</emphasis>
+ </entry>
+ <entry namest="c2" nameend="c4" align="left">
+ <emphasis>Normative references</emphasis>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <emphasis>2</emphasis>
+ </entry>
+ <entry namest="c2" nameend="c4" align="left">
+ <emphasis>Conventions</emphasis>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <emphasis>3</emphasis>
+ </entry>
+ <entry namest="c2" nameend="c4" align="left">
+ <emphasis>Decimal floating-point types</emphasis>
+ </entry>
+ </row>
+
+ <row>
+ <entry>3.1</entry>
+ <entry>Characteristics of decimal floating-point types</entry>
+ <entry></entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>3.2</entry>
+ <entry>Decimal Types</entry>
+ <entry></entry>
+ <entry></entry>
+ </row>
+ <row>
+ <?dbhtml bgcolor="#B0B0B0" ?>
+ <entry>3.2.1</entry>
+ <entry>Class <code>decimal</code> synopsis</entry>
+ <entry>Partial</entry>
+ <entry>Missing declarations for formatted input/output; non-conforming extension for functions converting to integral type</entry>
+ </row>
+ <row>
+ <?dbhtml bgcolor="#B0B0B0" ?>
+ <entry>3.2.2</entry>
+ <entry>Class <code>decimal32</code></entry>
+ <entry>Partial</entry>
+ <entry>Missing 3.2.2.5 conversion to integral type; conforming extension for conversion from scalar decimal floating-point</entry>
+ </row>
+ <row>
+ <?dbhtml bgcolor="#B0B0B0" ?>
+ <entry>3.2.3</entry>
+ <entry>Class <code>decimal64</code></entry>
+ <entry>Partial</entry>
+ <entry>Missing 3.2.3.5 conversion to integral type; conforming extension for conversion from scalar decimal floating-point</entry>
+ </row>
+ <row>
+ <?dbhtml bgcolor="#B0B0B0" ?>
+ <entry>3.2.4</entry>
+ <entry>Class <code>decimal128</code></entry>
+ <entry>Partial</entry>
+ <entry>Missing 3.2.4.5 conversion to integral type; conforming extension for conversion from scalar decimal floating-point</entry>
+ </row>
+ <row>
+ <entry>3.2.5</entry>
+ <entry>Initialization from coefficient and exponent</entry>
+ <entry>Y</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>3.2.6</entry>
+ <entry>Conversion to generic floating-point type</entry>
+ <entry>Y</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>3.2.7</entry>
+ <entry>Unary arithmetic operators</entry>
+ <entry>Y</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>3.2.8</entry>
+ <entry>Binary arithmetic operators</entry>
+ <entry>Y</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>3.2.9</entry>
+ <entry>Comparison operators</entry>
+ <entry>Y</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <?dbhtml bgcolor="#C8B0B0" ?>
+ <entry>3.2.10</entry>
+ <entry>Formatted input</entry>
+ <entry>N</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <?dbhtml bgcolor="#C8B0B0" ?>
+ <entry>3.2.11</entry>
+ <entry>Formatted output</entry>
+ <entry>N</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <?dbhtml bgcolor="#C8B0B0" ?>
+ <entry>3.3</entry>
+ <entry>Additions to header <code>limits</code></entry>
+ <entry>N</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>3.4</entry>
+ <entry>Headers <code>cfloat</code> and <code>float.h</code></entry>
+ <entry></entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>3.4.2</entry>
+ <entry>Additions to header <code>cfloat</code> synopsis</entry>
+ <entry>Y</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <?dbhtml bgcolor="#B0B0B0" ?>
+ <entry>3.4.3</entry>
+ <entry>Additions to header <code>float.h</code> synopsis</entry>
+ <entry>N</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>3.4.4</entry>
+ <entry>Maximum finite value</entry>
+ <entry>Y</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>3.4.5</entry>
+ <entry>Epsilon</entry>
+ <entry>Y</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>3.4.6</entry>
+ <entry>Minimum positive normal value</entry>
+ <entry>Y</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>3.4.7</entry>
+ <entry>Minimum positive subnormal value</entry>
+ <entry>Y</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>3.4.8</entry>
+ <entry>Evaluation format</entry>
+ <entry>Y</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <?dbhtml bgcolor="#C8B0B0" ?>
+ <entry>3.5</entry>
+ <entry>Additions to <code>cfenv</code> and <code>fenv.h</code></entry>
+ <entry>Outside the scope of GCC</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <?dbhtml bgcolor="#C8B0B0" ?>
+ <entry>3.6</entry>
+ <entry>Additions to <code>cmath</code> and <code>math.h</code></entry>
+ <entry>Outside the scope of GCC</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <?dbhtml bgcolor="#C8B0B0" ?>
+ <entry>3.7</entry>
+ <entry>Additions to <code>cstdio</code> and <code>stdio.h</code></entry>
+ <entry>Outside the scope of GCC</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <?dbhtml bgcolor="#C8B0B0" ?>
+ <entry>3.8</entry>
+ <entry>Additions to <code>cstdlib</code> and <code>stdlib.h</code></entry>
+ <entry>Outside the scope of GCC</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <?dbhtml bgcolor="#C8B0B0" ?>
+ <entry>3.9</entry>
+ <entry>Additions to <code>cwchar</code> and <code>wchar.h</code></entry>
+ <entry>Outside the scope of GCC</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <?dbhtml bgcolor="#C8B0B0" ?>
+ <entry>3.10</entry>
+ <entry>Facets</entry>
+ <entry>N</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <?dbhtml bgcolor="#C8B0B0" ?>
+ <entry>3.11</entry>
+ <entry>Type traits</entry>
+ <entry>N</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <?dbhtml bgcolor="#C8B0B0" ?>
+ <entry>3.12</entry>
+ <entry>Hash functions</entry>
+ <entry>N</entry>
+ <entry></entry>
+ </row>
+
+ <row>
+ <entry>
+ <emphasis>4</emphasis>
+ </entry>
+ <entry namest="c2" nameend="c4" align="left">
+ <emphasis>Notes on C compatibility</emphasis>
+ </entry>
+ </row>
+
+ </tbody>
+</tgroup>
+</table>
+
+
+</sect2>
diff --git a/libstdc++-v3/doc/xml/manual/using.xml b/libstdc++-v3/doc/xml/manual/using.xml
index a32cdb1cd93..d9ff8cadef4 100644
--- a/libstdc++-v3/doc/xml/manual/using.xml
+++ b/libstdc++-v3/doc/xml/manual/using.xml
@@ -360,7 +360,7 @@ mode, i.e. <literal>-std=c++0x</literal> or <literal>-std=gnu++0x</literal>.
</para>
<table frame='all'>
-<title>C++ TR1 Library Headers</title>
+<title>C++ TR 1 Library Headers</title>
<tgroup cols='5' align='left' colsep='1' rowsep='1'>
<colspec colname='c1'></colspec>
<colspec colname='c2'></colspec>
@@ -395,7 +395,7 @@ mode, i.e. <literal>-std=c++0x</literal> or <literal>-std=gnu++0x</literal>.
<table frame='all'>
-<title>C++ TR1 Library Headers for C Library Facilities</title>
+<title>C++ TR 1 Library Headers for C Library Facilities</title>
<tgroup cols='5' align='left' colsep='1' rowsep='1'>
<colspec colname='c1'></colspec>
<colspec colname='c2'></colspec>
@@ -430,6 +430,24 @@ mode, i.e. <literal>-std=c++0x</literal> or <literal>-std=gnu++0x</literal>.
</tgroup>
</table>
+
+<para>Decimal floating-point arithmetic is available if the C++
+compiler supports scalar decimal floating-point types defined via
+<code>__attribute__((mode(SD|DD|LD)))</code>.
+</para>
+
+<table frame='all'>
+<title>C++ TR 24733 Decimal Floating-Point Header</title>
+<tgroup cols='1' align='left' colsep='1' rowsep='1'>
+<colspec colname='c1'></colspec>
+<tbody>
+<row>
+<entry><filename class="headerfile">decimal/decimal</filename></entry>
+</row>
+</tbody>
+</tgroup>
+</table>
+
<para>
Also included are files for the C++ ABI interface:
</para>
@@ -543,6 +561,35 @@ mode, i.e. <literal>-std=c++0x</literal> or <literal>-std=gnu++0x</literal>.
<para></para>
<table frame='all'>
+<title>Extension Profile Headers</title>
+<tgroup cols='4' align='left' colsep='1' rowsep='1'>
+<colspec colname='c1'></colspec>
+<colspec colname='c2'></colspec>
+<colspec colname='c3'></colspec>
+<colspec colname='c4'></colspec>
+<tbody>
+
+<row>
+<entry><filename class="headerfile">profile/bitset</filename></entry>
+<entry><filename class="headerfile">profile/deque</filename></entry>
+<entry><filename class="headerfile">profile/list</filename></entry>
+<entry><filename class="headerfile">profile/map</filename></entry>
+</row>
+
+<row>
+<entry><filename class="headerfile">profile/set</filename></entry>
+<entry><filename class="headerfile">profile/unordered_map</filename></entry>
+<entry><filename class="headerfile">profile/unordered_set</filename></entry>
+<entry><filename class="headerfile">profile/vector</filename></entry>
+</row>
+
+</tbody>
+</tgroup>
+</table>
+
+<para></para>
+
+<table frame='all'>
<title>Extension Parallel Headers</title>
<tgroup cols='2' align='left' colsep='1' rowsep='1'>
<colspec colname='c1'></colspec>
@@ -1243,32 +1290,12 @@ gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)
</para>
</sect2>
- </sect1>
-
- <sect1 id="manual.intro.using.exception" xreflabel="Exceptions">
- <?dbhtml filename="using_exceptions.html"?>
- <title>Exceptions</title>
+</sect1>
- <sect2 id="intro.using.exception.propagating" xreflabel="Propagating Exceptions">
-
- <title>Propagating Exceptions aka Exception Neutrality</title>
- <para>
- </para>
- </sect2>
-
- <sect2 id="intro.using.exception.safety" xreflabel="Exception Safety">
- <title>Exception Safety</title>
- <para>
- </para>
- </sect2>
-
- <sect2 id="intro.using.exception.no" xreflabel="-fno-exceptions">
- <title>Support for <literal>-fno-exceptions</literal></title>
- <para>
- </para>
- </sect2>
-
- </sect1>
+<!-- Section 0x : Exception policies, expectations, topics -->
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
+ parse="xml" href="using_exceptions.xml">
+</xi:include>
<!-- Section 0x : Debug -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
diff --git a/libstdc++-v3/doc/xml/manual/using_exceptions.xml b/libstdc++-v3/doc/xml/manual/using_exceptions.xml
new file mode 100644
index 00000000000..09c21d41ccc
--- /dev/null
+++ b/libstdc++-v3/doc/xml/manual/using_exceptions.xml
@@ -0,0 +1,579 @@
+<sect1 id="manual.intro.using.exceptions" xreflabel="Using Exceptions">
+<?dbhtml filename="using_exceptions.html"?>
+
+<sect1info>
+ <keywordset>
+ <keyword>
+ C++
+ </keyword>
+ <keyword>
+ exception
+ </keyword>
+ <keyword>
+ error
+ </keyword>
+ <keyword>
+ exception neutrality
+ </keyword>
+ <keyword>
+ exception safety
+ </keyword>
+ <keyword>
+ exception propagation
+ </keyword>
+ <keyword>
+ -fno-exceptions
+ </keyword>
+ </keywordset>
+</sect1info>
+
+<title>Exceptions</title>
+
+<para>
+The C++ language provides language support for stack unwinding
+with <literal>try</literal> and <literal>catch</literal> blocks and
+the <literal>throw</literal> keyword.
+</para>
+
+<para>
+These are very powerful constructs, and require some thought when
+applied to the standard library in order to yield components that work
+efficiently while cleaning up resources when unexpectedly killed via
+exceptional circumstances.
+</para>
+
+<para>
+Two general topics of discussion follow:
+exception neutrality and exception safety.
+</para>
+
+
+<sect2 id="intro.using.exception.safety" xreflabel="Exception Safety">
+<title>Exception Safety</title>
+
+ <para>
+ What is exception-safe code?
+ </para>
+
+ <para>
+ Will define this as reasonable and well-defined behavior by classes
+ and functions from the standard library when used by user-defined
+ classes and functions that are themselves exception safe.
+ </para>
+
+ <para>
+ Please note that using exceptions in combination with templates
+ imposes an additional requirement for exception
+ safety. Instantiating types are required to have destructors that
+ do no throw.
+ </para>
+
+ <para>
+ Using the layered approach from Abrahams, can classify library
+ components as providing set levels of safety. These will be called
+ exception guarantees, and can be divided into three categories.
+ </para>
+
+<itemizedlist>
+
+ <listitem>
+ <para>
+ One. Don't throw.
+ </para>
+ <para>
+ As specified in 23.2.1 general container requirements. Applicable
+ to container and string classes.
+ </para>
+ <para>
+ Member
+ functions <function>erase</function>, <function>pop_back</function>, <function>pop_front</function>, <function>swap</function>, <function>clear</function>. And <type>iterator</type>
+ copy constructor and assignment operator.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Two. Don't leak resources when exceptions are thrown. This is
+ also referred to as the <quote>basic</quote> exception safety guarantee.
+ </para>
+
+ <para>
+ This applicable throughout the standard library.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Three. Commit-or-rollback semantics. This is
+ referred to as <quote>strong</quote> exception safety guarantee.
+ </para>
+
+ <para>
+ As specified in 23.2.1 general container requirements. Applicable
+ to container and string classes.
+ </para>
+ <para>
+ Member functions <function>insert</function> of a single
+ element, <function>push_back</function>, <function>push_front</function>,
+ and <function>rehash</function>.
+ </para>
+
+ </listitem>
+</itemizedlist>
+
+</sect2>
+
+
+<sect2 id="intro.using.exception.propagating" xreflabel="Exceptions Neutrality">
+<title>Exception Neutrality</title>
+ <para>
+ Simply put, once thrown an exception object should continue in
+ flight unless handled explicitly. In practice, this means
+ propagating exceptions should not be swallowed in
+ gratuitous <literal>catch(...)</literal> blocks. Instead,
+ matching <literal>try</literal> and <literal>catch</literal>
+ blocks should have specific catch handlers and allow un-handed
+ exception objects to propagate. If a
+ terminating <literal>catch(...)</literal> blocks exist then it
+ should end with a <literal>throw</literal> to re-throw the current
+ exception.
+ </para>
+
+ <para>
+ Why do this?
+ </para>
+
+ <para>
+ By allowing exception objects to propagate, a more flexible
+ approach to error handling is made possible (although not
+ required.) Instead of dealing with an error immediately, one can
+ allow the exception to propagate up until sufficient context is
+ available and the choice of exiting or retrying can be made in an
+ informed manner.
+ </para>
+
+ <para>
+ Unfortunately, this tends to be more of a guideline than a strict
+ rule as applied to the standard library. As such, the following is
+ a list of known problem areas where exceptions are not propagated.
+ </para>
+
+<itemizedlist>
+ <listitem>
+ <para>
+ Input/Output
+ </para>
+ <para>
+ The destructor <function>ios_base::Init::~Init()</function>
+ swallows all exceptions from <function>flush</function> called on
+ all open streams at termination.
+ </para>
+
+ <para>
+ All formatted input in <classname>basic_istream</classname> or
+ formatted output in <classname>basic_ostream</classname> can be
+ configured to swallow exceptions
+ when <function>exceptions</function> is set to
+ ignore <type>ios_base::badbit</type>.
+ </para>
+
+ <para>
+ Functions that have been registered
+ with <function>ios_base::register_callback</function> swallow all
+ exceptions when called as part of a callback event.
+ </para>
+
+ <para>
+ When closing the underlying
+ file, <function>basic_filebuf::close</function> will swallow
+ (non-cancellation) exceptions thrown and return <literal>NULL</literal>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Thread
+ </para>
+ <para>
+ The constructors of <classname>thread</classname> that take a
+ callable function argument swallow all exceptions resulting from
+ executing the function argument.
+ </para>
+ </listitem>
+</itemizedlist>
+
+</sect2>
+
+<sect2 id="intro.using.exception.no" xreflabel="-fno-exceptions">
+<title>Doing without</title>
+ <para>
+ C++ is a language that strives to be as efficient as is possible
+ in delivering features. As such, considerable care is used by both
+ language implementer and designers to make sure unused features
+ not impose hidden or unexpected costs. The GNU system tries to be
+ as flexible and as configurable as possible. So, it should come as
+ no surprise that GNU C++ provides an optional language extension,
+ spelled <literal>-fno-exceptions</literal>, as a way to excise the
+ implicitly generated magic necessary to
+ support <literal>try</literal> and <literal>catch</literal> blocks
+ and thrown objects. (Language support
+ for <literal>-fno-exceptions</literal> is documented in the GNU
+ GCC <ulink url="http://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options">manual</ulink>.)
+ </para>
+
+ <para>Before detailing the library support
+ for <literal>-fno-exceptions</literal>, first a passing note on
+ the things lost when this flag is used: it will break exceptions
+ trying to pass through code compiled
+ with <literal>-fno-exceptions</literal> whether or not that code
+ has any <literal>try</literal> or <literal>catch</literal>
+ constructs. If you might have some code that throws, you shouldn't
+ use <literal>-fno-exceptions</literal>. If you have some code that
+ uses <literal>try</literal> or <literal>catch</literal>, you
+ shouldn't use <literal>-fno-exceptions</literal>.
+ </para>
+
+ <para>
+ And what it to be gained, tinkering in the back alleys with a
+ language like this? Exception handling overhead can be measured
+ in the size of the executable binary, and varies with the
+ capabilities of the underlying operating system and specific
+ configuration of the C++ compiler. On recent hardware with GNU
+ system software of the same age, the combined code and data size
+ overhead for enabling exception handling is around 7%. Of course,
+ if code size is of singular concern than using the appropriate
+ optimizer setting with exception handling enabled
+ (ie, <literal>-Os -fexceptions</literal>) may save up to twice
+ that, and preserve error checking.
+ </para>
+
+ <para>
+ So. Hell bent, we race down the slippery track, knowing the brakes
+ are a little soft and that the right front wheel has a tendency to
+ wobble at speed. Go on: detail the standard library support
+ for <literal>-fno-exceptions</literal>.
+ </para>
+
+ <para>
+ In sum, valid C++ code with exception handling is transformed into
+ a dialect without exception handling. In detailed steps: all use
+ of the C++
+ keywords <literal>try</literal>, <literal>catch</literal>,
+ and <literal>throw</literal> in the standard library have been
+ permanently replaced with the pre-processor controlled equivalents
+ spelled <literal>__try</literal>, <literal>__catch</literal>,
+ and <literal>__throw_exception_again</literal>. They are defined
+ as follows.
+ </para>
+
+<programlisting>
+#ifdef __EXCEPTIONS
+# define __try try
+# define __catch(X) catch(X)
+# define __throw_exception_again throw
+#else
+# define __try if (true)
+# define __catch(X) if (false)
+# define __throw_exception_again
+#endif
+</programlisting>
+
+<para>
+ In addition, for every object derived from
+ class <classname>exception</classname>, there exists a corresponding
+ function with C language linkage. An example:
+</para>
+
+<programlisting>
+#ifdef __EXCEPTIONS
+ void __throw_bad_exception(void)
+ { throw bad_exception(); }
+#else
+ void __throw_bad_exception(void)
+ { abort(); }
+#endif
+</programlisting>
+
+<para>
+ The last language feature needing to be transformed
+ by <literal>-fno-exceptions</literal> is treatment of exception
+ specifications on member functions. Fortunately, the compiler deals
+ with this by ignoring exception specifications and so no alternate
+ source markup is needed.
+</para>
+
+<para>
+ By using this combination of language re-specification by the
+ compiler, and the pre-processor tricks and the functional
+ indirection layer for thrown exception objects by the library,
+ libstdc++ files can be compiled
+ with <literal>-fno-exceptions</literal>.
+</para>
+
+<para>
+ User code that uses C++ keywords
+ like <literal>throw</literal>, <literal>try</literal>,
+ and <literal>catch</literal> will produce errors even if the user
+ code has included libstdc++ headers and is using constructs
+ like <classname>basic_iostream</classname>. Even though the standard
+ library has been transformed, user code may need modification. User
+ code that attempts or expects to do error checking on standard
+ library components compiled with exception handling disabled should
+ be evaluated and potentially made conditional.
+</para>
+
+<para>
+ Some issues remain with this approach (see bugzilla entry
+ 25191). Code paths are not equivalent, in
+ particular <literal>catch</literal> blocks are not evaluated. Also
+ problematic are <literal>throw</literal> expressions expecting a
+ user-defined throw handler. Known problem areas in the standard
+ library include using an instance
+ of <classname>basic_istream</classname>
+ with <function>exceptions</function> set to specific
+ <type>ios_base::iostate</type> conditions, or
+ cascading <literal>catch</literal> blocks that dispatch error
+ handling or recovery efforts based on the type of exception object
+ thrown.
+</para>
+
+<para>
+ Oh, and by the way: none of this hackery is at all
+ special. (Although perhaps well-deserving of a raised eyebrow.)
+ Support continues to evolve and may change in the future. Similar
+ and even additional techniques are used in other C++ libraries and
+ compilers.
+</para>
+
+<para>
+ C++ hackers with a bent for language and control-flow purity have
+ been successfully consoled by grizzled C veterans lamenting the
+ substitution of the C language keyword
+ <literal>const</literal> with the uglified
+ doppelganger <literal>__const</literal>.
+</para>
+
+
+</sect2>
+
+<sect2 id="intro.using.exception.compat">
+<title>Compatibility</title>
+
+<sect3 id="using.exception.compat.c">
+<title>With <literal>C</literal></title>
+<para>
+ C language code that is expecting to interoperate with C++ should be
+ compiled with <literal>-fexceptions</literal>. This will make
+ debugging a C language function called as part of C++-induced stack
+ unwinding possible.
+</para>
+
+<para>
+ In particular, unwinding into a frame with no exception handling
+data will cause a runtime abort. If the unwinder runs out of unwind
+info before it finds a handler, <function>std::terminate()</function>
+is called.
+</para>
+
+<para>
+ Please note that most development environments should take care of
+ getting these details right. For GNU systems, all appropriate parts
+ of the GNU C library are already compiled
+ with <literal>-fexceptions</literal>.
+</para>
+
+</sect3>
+
+<sect3 id="using.exception.compat.posix">
+<title>With <literal>POSIX</literal> thread cancellation</title>
+
+<para>
+ GNU systems re-use some of the exception handling mechanisms to
+ track control flow for <literal>POSIX</literal> thread cancellation.
+</para>
+
+<para>
+ Cancellation points are functions defined by POSIX as worthy of
+ special treatment. The standard library may use some of these
+ functions to implement parts of the ISO C++ standard or depend on
+ them for extensions.
+</para>
+
+<para>
+ Of note:
+</para>
+
+<para>
+ <function>nanosleep</function>,
+ <function>read</function>, <function>write</function>, <function>open</function>, <function>close</function>,
+ and <function>wait</function>.
+</para>
+
+<para>
+ The parts of libstdc++ that use C library functions marked as
+ cancellation points should take pains to be exception neutral.
+ Failing this, <literal>catch</literal> blocks have been augmented to
+ show that the POSIX cancellation object is in flight.
+</para>
+
+<para>
+ This augmentation adds a <literal>catch</literal> block
+ for <classname>__cxxabiv1::__forced_unwind</classname>, which is the
+ object representing the POSIX cancellation object. Like so:
+</para>
+
+<programlisting>
+ catch(const __cxxabiv1::__forced_unwind&amp;)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+</programlisting>
+
+
+</sect3>
+</sect2>
+
+<bibliography id="using.exceptions.biblio">
+<title>Bibliography</title>
+
+ <biblioentry>
+ <title>
+ System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
+ </title>
+ <pagenums>
+ 2.9.5 Thread Cancellation
+ </pagenums>
+
+ <copyright>
+ <year>2008</year>
+ <holder>
+ The Open Group/The Institute of Electrical and Electronics Engineers, Inc.</holder>
+ </copyright>
+
+ <biblioid>
+ <ulink url="http://www.opengroup.org/austin/">
+ </ulink>
+ </biblioid>
+
+ </biblioentry>
+
+ <biblioentry>
+ <title>
+ Error and Exception Handling
+ </title>
+ <author>
+ <firstname>David</firstname>
+ <surname>Abrahams </surname>
+ </author>
+ <publisher>
+ <publishername>
+ Boost
+ </publishername>
+ </publisher>
+ <biblioid>
+ <ulink url="http://www.boost.org/community/error_handling.html">
+ </ulink>
+ </biblioid>
+ </biblioentry>
+
+
+ <biblioentry>
+ <title>
+ Exception-Safety in Generic Components
+ </title>
+ <author>
+ <firstname>David</firstname>
+ <surname>Abrahams</surname>
+ </author>
+ <publisher>
+ <publishername>
+ Boost
+ </publishername>
+ </publisher>
+ <biblioid>
+ <ulink url="http://www.boost.org/community/exception_safety.html">
+ </ulink>
+ </biblioid>
+ </biblioentry>
+
+ <biblioentry>
+ <title>
+ Standard Library Exception Policy
+ </title>
+ <author>
+ <firstname>Matt</firstname>
+ <surname>Austern</surname>
+ </author>
+ <publisher>
+ <publishername>
+ WG21 N1077
+ </publishername>
+ </publisher>
+ <biblioid>
+ <ulink url="www.open-std.org/jtc1/sc22/wg21/docs/papers/1997/N1077.pdf">
+ </ulink>
+ </biblioid>
+ </biblioentry>
+
+ <biblioentry>
+ <title>
+ ia64 c++ abi exception handling
+ </title>
+ <author>
+ <firstname>Richard</firstname>
+ <surname>Henderson</surname>
+ </author>
+ <publisher>
+ <publishername>
+ GNU
+ </publishername>
+ </publisher>
+ <biblioid>
+ <ulink url="http://gcc.gnu.org/ml/gcc-patches/2001-03/msg00661.html">
+ </ulink>
+ </biblioid>
+ </biblioentry>
+
+ <biblioentry>
+ <title>
+ Appendix E: Standard-Library Exception Safety
+ </title>
+ <author>
+ <firstname>Bjarne</firstname>
+ <surname>Stroustrup</surname>
+ </author>
+ <biblioid>
+ <ulink url="http://www.research.att.com/~bs/3rd_safe.pdf">
+ </ulink>
+ </biblioid>
+ </biblioentry>
+
+ <biblioentry>
+ <title>
+ Exceptional C++
+ </title>
+ <pagenums>
+ Exception-Safety Issues and Techniques
+ </pagenums>
+ <author>
+ <firstname>Herb</firstname>
+ <surname>Sutter</surname>
+ </author>
+ </biblioentry>
+
+ <biblioentry>
+ <title>
+ exception_defines.h #defines try/catch
+ </title>
+ <subtitle>
+ GCC Bug <ulink url="http://gcc.gnu.org/PR25191">25191</ulink>
+ </subtitle>
+ <biblioid>
+ </biblioid>
+ </biblioentry>
+
+</bibliography>
+
+</sect1>
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
index f3dcd19b79f..1cea8a24e94 100644
--- a/libstdc++-v3/include/Makefile.am
+++ b/libstdc++-v3/include/Makefile.am
@@ -121,6 +121,7 @@ bits_headers = \
${bits_srcdir}/stream_iterator.h \
${bits_srcdir}/streambuf_iterator.h \
${bits_srcdir}/shared_ptr.h \
+ ${bits_srcdir}/shared_ptr_base.h \
${bits_srcdir}/slice_array.h \
${bits_srcdir}/sstream.tcc \
${bits_srcdir}/stl_algo.h \
@@ -618,6 +619,11 @@ tr1_impl_headers = \
${tr1_impl_srcdir}/unordered_set \
${tr1_impl_srcdir}/utility
+decimal_srcdir = ${glibcxx_srcdir}/include/decimal
+decimal_builddir = ./decimal
+decimal_headers = \
+ ${decimal_srcdir}/decimal \
+ ${decimal_srcdir}/decimal.h
# This is the common subset of C++ files that all three "C" header models use.
c_base_srcdir = $(C_INCLUDE_DIR)
@@ -896,8 +902,8 @@ endif
allstamped = \
stamp-std stamp-bits stamp-c_base stamp-c_base_extra \
stamp-c_compatibility stamp-backward stamp-ext stamp-pb \
- stamp-tr1 stamp-tr1-impl stamp-debug stamp-parallel stamp-host \
- stamp-profile stamp-profile-impl
+ stamp-tr1 stamp-tr1-impl stamp-decimal stamp-debug \
+ stamp-parallel stamp-profile stamp-profile-impl stamp-host
# List of all files that are created by explicit building, editing, or
# catenation.
@@ -1011,6 +1017,11 @@ stamp-tr1-impl: ${tr1_impl_headers}
@-cd ${tr1_impl_builddir} && $(LN_S) $? . 2>/dev/null
@$(STAMP) stamp-tr1-impl
+stamp-decimal: ${decimal_headers}
+ @-mkdir -p ${decimal_builddir}
+ @-cd ${decimal_builddir} && $(LN_S) $? . 2>/dev/null
+ @$(STAMP) stamp-decimal
+
stamp-debug: ${debug_headers}
@-mkdir -p ${debug_builddir}
@-cd ${debug_builddir} && $(LN_S) $? . 2>/dev/null
@@ -1239,6 +1250,9 @@ install-headers:
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${tr1_impl_builddir}
for file in ${tr1_impl_headers}; do \
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${tr1_impl_builddir}; done
+ $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${decimal_builddir}
+ for file in ${decimal_headers}; do \
+ $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${decimal_builddir}; done
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${c_base_builddir}
for file in ${c_base_headers}; do \
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${c_base_builddir}; done
@@ -1283,9 +1297,10 @@ clean-local:
# directory. (This is more of an example of how this kind of rule can
# be made.)
.PRECIOUS: $(std_headers) $(c_base_headers) $(tr1_headers) $(tr1_impl_headers)
- $(ext_headers)
+ $(decimal_headers) $(ext_headers)
$(std_headers): ; @:
$(c_base_headers): ; @:
$(tr1_headers): ; @:
$(tr1_impl_headers): ; @:
+$(decimal_headers): ; @:
$(ext_headers): ; @:
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index 4c69a2be288..fa741a59bd1 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -14,6 +14,8 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
+
+#o# Makefile for the include subdirectory of the GNU C++ Standard library.
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -362,6 +364,7 @@ bits_headers = \
${bits_srcdir}/stream_iterator.h \
${bits_srcdir}/streambuf_iterator.h \
${bits_srcdir}/shared_ptr.h \
+ ${bits_srcdir}/shared_ptr_base.h \
${bits_srcdir}/slice_array.h \
${bits_srcdir}/sstream.tcc \
${bits_srcdir}/stl_algo.h \
@@ -856,6 +859,12 @@ tr1_impl_headers = \
${tr1_impl_srcdir}/unordered_set \
${tr1_impl_srcdir}/utility
+decimal_srcdir = ${glibcxx_srcdir}/include/decimal
+decimal_builddir = ./decimal
+decimal_headers = \
+ ${decimal_srcdir}/decimal \
+ ${decimal_srcdir}/decimal.h
+
# This is the common subset of C++ files that all three "C" header models use.
c_base_srcdir = $(C_INCLUDE_DIR)
@@ -1001,25 +1010,25 @@ parallel_builddir = ./parallel
@ENABLE_PARALLEL_TRUE@ ${parallel_srcdir}/unique_copy.h \
@ENABLE_PARALLEL_TRUE@ ${parallel_srcdir}/workstealing.h
-
# Profile mode headers
profile_srcdir = ${glibcxx_srcdir}/include/profile
profile_builddir = ./profile
profile_headers = \
- ${profile_srcdir}/base.h \
- ${profile_srcdir}/unordered_map \
- ${profile_srcdir}/unordered_set \
- ${profile_srcdir}/vector \
- ${profile_srcdir}/bitset \
- ${profile_srcdir}/deque \
- ${profile_srcdir}/list \
- ${profile_srcdir}/map \
- ${profile_srcdir}/map.h \
- ${profile_srcdir}/multimap.h \
- ${profile_srcdir}/multiset.h \
- ${profile_srcdir}/set \
- ${profile_srcdir}/set.h \
- ${profile_srcdir}/hashtable.h
+ ${profile_srcdir}/base.h \
+ ${profile_srcdir}/unordered_map \
+ ${profile_srcdir}/unordered_set \
+ ${profile_srcdir}/vector \
+ ${profile_srcdir}/bitset \
+ ${profile_srcdir}/deque \
+ ${profile_srcdir}/list \
+ ${profile_srcdir}/map \
+ ${profile_srcdir}/map.h \
+ ${profile_srcdir}/multimap.h \
+ ${profile_srcdir}/multiset.h \
+ ${profile_srcdir}/set \
+ ${profile_srcdir}/set.h \
+ ${profile_srcdir}/hashtable.h
+
profile_impl_srcdir = ${glibcxx_srcdir}/include/profile/impl
profile_impl_builddir = ./profile/impl
profile_impl_headers = \
@@ -1116,8 +1125,8 @@ PCHFLAGS = -x c++-header $(CXXFLAGS)
allstamped = \
stamp-std stamp-bits stamp-c_base stamp-c_base_extra \
stamp-c_compatibility stamp-backward stamp-ext stamp-pb \
- stamp-tr1 stamp-tr1-impl stamp-debug stamp-parallel stamp-host \
- stamp-profile stamp-profile-impl
+ stamp-tr1 stamp-tr1-impl stamp-decimal stamp-debug \
+ stamp-parallel stamp-profile stamp-profile-impl stamp-host
# List of all files that are created by explicit building, editing, or
@@ -1424,6 +1433,11 @@ stamp-tr1-impl: ${tr1_impl_headers}
@-cd ${tr1_impl_builddir} && $(LN_S) $? . 2>/dev/null
@$(STAMP) stamp-tr1-impl
+stamp-decimal: ${decimal_headers}
+ @-mkdir -p ${decimal_builddir}
+ @-cd ${decimal_builddir} && $(LN_S) $? . 2>/dev/null
+ @$(STAMP) stamp-decimal
+
stamp-debug: ${debug_headers}
@-mkdir -p ${debug_builddir}
@-cd ${debug_builddir} && $(LN_S) $? . 2>/dev/null
@@ -1640,6 +1654,9 @@ install-headers:
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${tr1_impl_builddir}
for file in ${tr1_impl_headers}; do \
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${tr1_impl_builddir}; done
+ $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${decimal_builddir}
+ for file in ${decimal_headers}; do \
+ $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${decimal_builddir}; done
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${c_base_builddir}
for file in ${c_base_headers}; do \
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${c_base_builddir}; done
@@ -1660,8 +1677,7 @@ install-headers:
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${parallel_builddir};\
for file in $$parallel_headers_install; do \
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${parallel_builddir}; done
- $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${profile_builddir} \
- $(DESTDIR)${gxx_include_dir}/${profile_builddir}/impl
+ $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${profile_builddir}
for file in ${profile_headers}; do \
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${profile_builddir}; done
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${profile_impl_builddir}
@@ -1682,11 +1698,12 @@ clean-local:
# directory. (This is more of an example of how this kind of rule can
# be made.)
.PRECIOUS: $(std_headers) $(c_base_headers) $(tr1_headers) $(tr1_impl_headers)
- $(ext_headers)
+ $(decimal_headers) $(ext_headers)
$(std_headers): ; @:
$(c_base_headers): ; @:
$(tr1_headers): ; @:
$(tr1_impl_headers): ; @:
+$(decimal_headers): ; @:
$(ext_headers): ; @:
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/libstdc++-v3/include/bits/atomic_0.h b/libstdc++-v3/include/bits/atomic_0.h
index a493ea66af9..0caffaf1e9f 100644
--- a/libstdc++-v3/include/bits/atomic_0.h
+++ b/libstdc++-v3/include/bits/atomic_0.h
@@ -82,14 +82,15 @@ namespace __atomic0
__r; })
/// atomic_flag
- struct atomic_flag : private __atomic_flag_base
+ struct atomic_flag : public __atomic_flag_base
{
atomic_flag() = default;
~atomic_flag() = default;
atomic_flag(const atomic_flag&) = delete;
atomic_flag& operator=(const atomic_flag&) = delete;
- atomic_flag(bool __i) { _M_i = __i; } // XXX deleted copy ctor != agg
+ // Conversion to ATOMIC_FLAG_INIT.
+ atomic_flag(bool __i): __atomic_flag_base({ __i }) { }
bool
test_and_set(memory_order __m = memory_order_seq_cst) volatile;
diff --git a/libstdc++-v3/include/bits/atomic_2.h b/libstdc++-v3/include/bits/atomic_2.h
index 8e8e7ff16f8..d39adb920a2 100644
--- a/libstdc++-v3/include/bits/atomic_2.h
+++ b/libstdc++-v3/include/bits/atomic_2.h
@@ -44,14 +44,15 @@
namespace __atomic2
{
/// atomic_flag
- struct atomic_flag : private __atomic_flag_base
+ struct atomic_flag : public __atomic_flag_base
{
atomic_flag() = default;
~atomic_flag() = default;
atomic_flag(const atomic_flag&) = delete;
atomic_flag& operator=(const atomic_flag&) = delete;
- atomic_flag(bool __i) { _M_i = __i; } // XXX deleted copy ctor != agg
+ // Conversion to ATOMIC_FLAG_INIT.
+ atomic_flag(bool __i): __atomic_flag_base({ __i }) { }
bool
test_and_set(memory_order __m = memory_order_seq_cst) volatile
diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h
index bd54537cdc1..9d44dc4fdfc 100644
--- a/libstdc++-v3/include/bits/basic_string.h
+++ b/libstdc++-v3/include/bits/basic_string.h
@@ -540,7 +540,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
basic_string&
operator=(initializer_list<_CharT> __l)
{
- this->assign (__l.begin(), __l.end());
+ this->assign(__l.begin(), __l.size());
return *this;
}
#endif // __GXX_EXPERIMENTAL_CXX0X__
@@ -860,7 +860,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
*/
basic_string&
operator+=(initializer_list<_CharT> __l)
- { return this->append(__l.begin(), __l.end()); }
+ { return this->append(__l.begin(), __l.size()); }
#endif // __GXX_EXPERIMENTAL_CXX0X__
/**
@@ -926,7 +926,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
*/
basic_string&
append(initializer_list<_CharT> __l)
- { return this->append(__l.begin(), __l.end()); }
+ { return this->append(__l.begin(), __l.size()); }
#endif // __GXX_EXPERIMENTAL_CXX0X__
/**
@@ -1045,7 +1045,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
*/
basic_string&
assign(initializer_list<_CharT> __l)
- { return this->assign(__l.begin(), __l.end()); }
+ { return this->assign(__l.begin(), __l.size()); }
#endif // __GXX_EXPERIMENTAL_CXX0X__
/**
@@ -1089,7 +1089,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
*/
void
insert(iterator __p, initializer_list<_CharT> __l)
- { this->insert(__p, __l.begin(), __l.end()); }
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(__p >= _M_ibegin() && __p <= _M_iend());
+ this->insert(__p - _M_ibegin(), __l.begin(), __l.size());
+ }
#endif // __GXX_EXPERIMENTAL_CXX0X__
/**
diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config
index 724f373ebae..f4f1f8b901f 100644
--- a/libstdc++-v3/include/bits/c++config
+++ b/libstdc++-v3/include/bits/c++config
@@ -147,7 +147,6 @@
# define _GLIBCXX_STD __cxx1998
# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
# define _GLIBCXX_END_NAMESPACE }
-# define _GLIBCXX_EXTERN_TEMPLATE -1
# endif
// debug + parallel
@@ -172,7 +171,6 @@
# define _GLIBCXX_STD __cxx1998
# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
# define _GLIBCXX_END_NAMESPACE }
-# define _GLIBCXX_EXTERN_TEMPLATE -1
# endif
# if __NO_INLINE__ && !__GXX_WEAK__
@@ -287,6 +285,10 @@ namespace std
// library to avoid multiple weak definitions for required types that
// are already explicitly instantiated in the library binary. This
// substantially reduces the binary size of resulting executables.
+
+// Special case: _GLIBCXX_EXTERN_TEMPLATE == -1 disallows extern
+// templates only in basic_string, thus activating its debug-mode
+// checks even at -O0.
#ifndef _GLIBCXX_EXTERN_TEMPLATE
# define _GLIBCXX_EXTERN_TEMPLATE 1
#endif
diff --git a/libstdc++-v3/include/bits/random.h b/libstdc++-v3/include/bits/random.h
index 06aa6f87b91..ab661e9594c 100644
--- a/libstdc++-v3/include/bits/random.h
+++ b/libstdc++-v3/include/bits/random.h
@@ -32,7 +32,6 @@
namespace std
{
-
// [26.4] Random number generation
/**
@@ -154,10 +153,10 @@ namespace std
template<typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
class linear_congruential_engine
{
- __glibcxx_class_requires(_UIntType, _UnsignedIntegerConcept)
- static_assert(__m == 0 || (__a < __m && __c < __m),
- "template arguments out of bounds"
- " in linear_congruential_engine");
+ static_assert(std::is_unsigned<_UIntType>::value, "template argument "
+ "substituting _UIntType not an unsigned integral type");
+ static_assert(__m == 0u || (__a < __m && __c < __m),
+ "template argument substituting __m out of bounds");
public:
/** The type of the generated random value. */
@@ -341,35 +340,32 @@ namespace std
_UIntType __c, size_t __l, _UIntType __f>
class mersenne_twister_engine
{
- __glibcxx_class_requires(_UIntType, _UnsignedIntegerConcept)
-
- static_assert(__m >= 1U,
- "mersenne_twister_engine template arguments out of bounds");
- static_assert(__n >= __m,
- "mersenne_twister_engine template arguments out of bounds");
- static_assert(__w >= __r,
- "mersenne_twister_engine template arguments out of bounds");
- static_assert(__w >= __u,
- "mersenne_twister_engine template arguments out of bounds");
- static_assert(__w >= __s,
- "mersenne_twister_engine template arguments out of bounds");
- static_assert(__w >= __t,
- "mersenne_twister_engine template arguments out of bounds");
- static_assert(__w >= __l,
- "mersenne_twister_engine template arguments out of bounds");
- static_assert(__w <=
- static_cast<size_t>(std::numeric_limits<_UIntType>::digits),
- "mersenne_twister_engine template arguments out of bounds");
+ static_assert(std::is_unsigned<_UIntType>::value, "template argument "
+ "substituting _UIntType not an unsigned integral type");
+ static_assert(1u <= __m && __m <= __n,
+ "template argument substituting __m out of bounds");
+ static_assert(__r <= __w, "template argument substituting "
+ "__r out of bound");
+ static_assert(__u <= __w, "template argument substituting "
+ "__u out of bound");
+ static_assert(__s <= __w, "template argument substituting "
+ "__s out of bound");
+ static_assert(__t <= __w, "template argument substituting "
+ "__t out of bound");
+ static_assert(__l <= __w, "template argument substituting "
+ "__l out of bound");
+ static_assert(__w <= std::numeric_limits<_UIntType>::digits,
+ "template argument substituting __w out of bound");
static_assert(__a <= (__detail::_Shift<_UIntType, __w>::__value - 1),
- "mersenne_twister_engine template arguments out of bounds");
+ "template argument substituting __a out of bound");
static_assert(__b <= (__detail::_Shift<_UIntType, __w>::__value - 1),
- "mersenne_twister_engine template arguments out of bounds");
+ "template argument substituting __b out of bound");
static_assert(__c <= (__detail::_Shift<_UIntType, __w>::__value - 1),
- "mersenne_twister_engine template arguments out of bounds");
+ "template argument substituting __c out of bound");
static_assert(__d <= (__detail::_Shift<_UIntType, __w>::__value - 1),
- "mersenne_twister_engine template arguments out of bounds");
+ "template argument substituting __d out of bound");
static_assert(__f <= (__detail::_Shift<_UIntType, __w>::__value - 1),
- "mersenne_twister_engine template arguments out of bounds");
+ "template argument substituting __f out of bound");
public:
/** The type of the generated random value. */
@@ -538,13 +534,12 @@ namespace std
template<typename _UIntType, size_t __w, size_t __s, size_t __r>
class subtract_with_carry_engine
{
- __glibcxx_class_requires(_UIntType, _UnsignedIntegerConcept)
- static_assert(__s > 0U && __r > __s
- && __w > 0U
- && __w <= static_cast<size_t>
- (std::numeric_limits<_UIntType>::digits),
- "template arguments out of bounds"
- " in subtract_with_carry_engine");
+ static_assert(std::is_unsigned<_UIntType>::value, "template argument "
+ "substituting _UIntType not an unsigned integral type");
+ static_assert(0u < __s && __s < __r,
+ "template argument substituting __s out of bounds");
+ static_assert(0u < __w && __w <= std::numeric_limits<_UIntType>::digits,
+ "template argument substituting __w out of bounds");
public:
/** The type of the generated random value. */
@@ -702,9 +697,8 @@ namespace std
template<typename _RandomNumberEngine, size_t __p, size_t __r>
class discard_block_engine
{
- static_assert(__r >= 1U && __p >= __r,
- "template arguments out of bounds"
- " in discard_block_engine");
+ static_assert(1 <= __r && __r <= __p,
+ "template argument substituting __r out of bounds");
public:
/** The type of the generated random value. */
@@ -903,12 +897,10 @@ namespace std
template<typename _RandomNumberEngine, size_t __w, typename _UIntType>
class independent_bits_engine
{
- static_assert(__w > 0U
- && __w <=
- static_cast<size_t>
- (std::numeric_limits<_UIntType>::digits),
- "template arguments out of bounds "
- "in independent_bits_engine");
+ static_assert(std::is_unsigned<_UIntType>::value, "template argument "
+ "substituting _UIntType not an unsigned integral type");
+ static_assert(0u < __w && __w <= std::numeric_limits<_UIntType>::digits,
+ "template argument substituting __w out of bounds");
public:
/** The type of the generated random value. */
@@ -1102,9 +1094,8 @@ namespace std
template<typename _RandomNumberEngine, size_t __k>
class shuffle_order_engine
{
- static_assert(__k >= 1U,
- "template arguments out of bounds"
- " in shuffle_order_engine");
+ static_assert(1u <= __k, "template argument substituting "
+ "__k out of bound");
public:
/** The type of the generated random value. */
@@ -1480,7 +1471,8 @@ namespace std
template<typename _IntType = int>
class uniform_int_distribution
{
- __glibcxx_class_requires(_IntType, _IntegerConcept)
+ static_assert(std::is_integral<_IntType>::value,
+ "template argument not an integral type");
public:
/** The type of the range of the distribution. */
@@ -1633,6 +1625,9 @@ namespace std
template<typename _RealType = double>
class uniform_real_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
@@ -1791,6 +1786,9 @@ namespace std
template<typename _RealType = double>
class normal_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
@@ -1943,6 +1941,9 @@ namespace std
template<typename _RealType = double>
class lognormal_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
@@ -2086,6 +2087,9 @@ namespace std
template<typename _RealType = double>
class gamma_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
@@ -2243,6 +2247,9 @@ namespace std
template<typename _RealType = double>
class chi_squared_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
@@ -2378,6 +2385,9 @@ namespace std
template<typename _RealType = double>
class cauchy_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
@@ -2519,6 +2529,9 @@ namespace std
template<typename _RealType = double>
class fisher_f_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
@@ -2670,6 +2683,9 @@ namespace std
template<typename _RealType = double>
class student_t_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
@@ -2972,7 +2988,8 @@ namespace std
template<typename _IntType = int>
class binomial_distribution
{
- __glibcxx_class_requires(_IntType, _IntegerConcept)
+ static_assert(std::is_integral<_IntType>::value,
+ "template argument not an integral type");
public:
/** The type of the range of the distribution. */
@@ -3142,7 +3159,8 @@ namespace std
template<typename _IntType = int>
class geometric_distribution
{
- __glibcxx_class_requires(_IntType, _IntegerConcept)
+ static_assert(std::is_integral<_IntType>::value,
+ "template argument not an integral type");
public:
/** The type of the range of the distribution. */
@@ -3287,7 +3305,8 @@ namespace std
template<typename _IntType = int>
class negative_binomial_distribution
{
- __glibcxx_class_requires(_IntType, _IntegerConcept)
+ static_assert(std::is_integral<_IntType>::value,
+ "template argument not an integral type");
public:
/** The type of the range of the distribution. */
@@ -3439,7 +3458,8 @@ namespace std
template<typename _IntType = int>
class poisson_distribution
{
- __glibcxx_class_requires(_IntType, _IntegerConcept)
+ static_assert(std::is_integral<_IntType>::value,
+ "template argument not an integral type");
public:
/** The type of the range of the distribution. */
@@ -3594,6 +3614,9 @@ namespace std
template<typename _RealType = double>
class exponential_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
@@ -3736,6 +3759,9 @@ namespace std
template<typename _RealType = double>
class weibull_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
@@ -3879,6 +3905,9 @@ namespace std
template<typename _RealType = double>
class extreme_value_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
@@ -4021,7 +4050,8 @@ namespace std
template<typename _IntType = int>
class discrete_distribution
{
- __glibcxx_class_requires(_IntType, _IntegerConcept)
+ static_assert(std::is_integral<_IntType>::value,
+ "template argument not an integral type");
public:
/** The type of the range of the distribution. */
@@ -4185,6 +4215,9 @@ namespace std
template<typename _RealType = double>
class piecewise_constant_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
@@ -4363,6 +4396,9 @@ namespace std
template<typename _RealType = double>
class piecewise_linear_distribution
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
public:
/** The type of the range of the distribution. */
typedef _RealType result_type;
diff --git a/libstdc++-v3/include/bits/shared_ptr.h b/libstdc++-v3/include/bits/shared_ptr.h
index 81bef585940..796df14c2c4 100644
--- a/libstdc++-v3/include/bits/shared_ptr.h
+++ b/libstdc++-v3/include/bits/shared_ptr.h
@@ -22,6 +22,8 @@
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
+// GCC Note: Based on files from version 1.32.0 of the Boost library.
+
// shared_count.hpp
// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
@@ -39,8 +41,6 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-// GCC Note: based on version 1.32.0 of the Boost library.
-
/** @file bits/shared_ptr.h
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
@@ -53,9 +53,7 @@
# include <c++0x_warning.h>
#endif
-#if defined(_GLIBCXX_INCLUDE_AS_TR1)
-# error C++0x header cannot be included from TR1 header
-#endif
+#include <bits/shared_ptr_base.h>
_GLIBCXX_BEGIN_NAMESPACE(std)
@@ -64,563 +62,89 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* @{
*/
- // counted ptr with no deleter or allocator support
- template<typename _Ptr, _Lock_policy _Lp>
- class _Sp_counted_ptr
- : public _Sp_counted_base<_Lp>
- {
- public:
- _Sp_counted_ptr(_Ptr __p)
- : _M_ptr(__p) { }
-
- virtual void
- _M_dispose() // nothrow
- { delete _M_ptr; }
-
- virtual void
- _M_destroy() // nothrow
- { delete this; }
-
- virtual void*
- _M_get_deleter(const std::type_info& __ti)
- { return 0; }
-
- _Sp_counted_ptr(const _Sp_counted_ptr&) = delete;
- _Sp_counted_ptr& operator=(const _Sp_counted_ptr&) = delete;
-
- protected:
- _Ptr _M_ptr; // copy constructor must not throw
- };
-
- // support for custom deleter and/or allocator
- template<typename _Ptr, typename _Deleter, typename _Alloc, _Lock_policy _Lp>
- class _Sp_counted_deleter
- : public _Sp_counted_ptr<_Ptr, _Lp>
- {
- typedef typename _Alloc::template
- rebind<_Sp_counted_deleter>::other _My_alloc_type;
-
- // Helper class that stores the Deleter and also acts as an allocator.
- // Used to dispose of the owned pointer and the internal refcount
- // Requires that copies of _Alloc can free each other's memory.
- struct _My_Deleter
- : public _My_alloc_type // copy constructor must not throw
- {
- _Deleter _M_del; // copy constructor must not throw
- _My_Deleter(_Deleter __d, const _Alloc& __a)
- : _My_alloc_type(__a), _M_del(__d) { }
- };
-
- protected:
- typedef _Sp_counted_ptr<_Ptr, _Lp> _Base_type;
-
- public:
- /**
- * @brief
- * @pre __d(__p) must not throw.
- */
- _Sp_counted_deleter(_Ptr __p, _Deleter __d)
- : _Base_type(__p), _M_del(__d, _Alloc()) { }
-
- /**
- * @brief
- * @pre __d(__p) must not throw.
- */
- _Sp_counted_deleter(_Ptr __p, _Deleter __d, const _Alloc& __a)
- : _Base_type(__p), _M_del(__d, __a) { }
-
- virtual void
- _M_dispose() // nothrow
- { _M_del._M_del(_Base_type::_M_ptr); }
-
- virtual void
- _M_destroy() // nothrow
- {
- _My_alloc_type __a(_M_del);
- this->~_Sp_counted_deleter();
- __a.deallocate(this, 1);
- }
-
- virtual void*
- _M_get_deleter(const std::type_info& __ti)
- { return __ti == typeid(_Deleter) ? &_M_del._M_del : 0; }
-
- protected:
- _My_Deleter _M_del; // copy constructor must not throw
- };
-
- // helpers for make_shared / allocate_shared
-
- template<typename _Tp>
- struct _Sp_destroy_inplace
- {
- void operator()(_Tp* __p) const { if (__p) __p->~_Tp(); }
- };
-
- struct _Sp_make_shared_tag { };
-
- template<typename _Tp, typename _Alloc, _Lock_policy _Lp>
- class _Sp_counted_ptr_inplace
- : public _Sp_counted_deleter<_Tp*, _Sp_destroy_inplace<_Tp>, _Alloc, _Lp>
- {
- typedef _Sp_counted_deleter<_Tp*, _Sp_destroy_inplace<_Tp>, _Alloc, _Lp>
- _Base_type;
-
- public:
- _Sp_counted_ptr_inplace(_Alloc __a)
- : _Base_type(static_cast<_Tp*>(0), _Sp_destroy_inplace<_Tp>(), __a)
- , _M_storage()
- {
- void* __p = &_M_storage;
- ::new (__p) _Tp(); // might throw
- _Base_type::_Base_type::_M_ptr = static_cast<_Tp*>(__p);
- }
-
- template<typename... _Args>
- _Sp_counted_ptr_inplace(_Alloc __a, _Args&&... __args)
- : _Base_type(static_cast<_Tp*>(0), _Sp_destroy_inplace<_Tp>(), __a)
- , _M_storage()
- {
- void* __p = &_M_storage;
- ::new (__p) _Tp(std::forward<_Args>(__args)...); // might throw
- _Base_type::_Base_type::_M_ptr = static_cast<_Tp*>(__p);
- }
-
- // override because the allocator needs to know the dynamic type
- virtual void
- _M_destroy() // nothrow
- {
- typedef typename _Alloc::template
- rebind<_Sp_counted_ptr_inplace>::other _My_alloc_type;
- _My_alloc_type __a(_Base_type::_M_del);
- this->~_Sp_counted_ptr_inplace();
- __a.deallocate(this, 1);
- }
-
- // sneaky trick so __shared_ptr can get the managed pointer
- virtual void*
- _M_get_deleter(const std::type_info& __ti)
- {
- return __ti == typeid(_Sp_make_shared_tag)
- ? static_cast<void*>(&_M_storage)
- : _Base_type::_M_get_deleter(__ti);
- }
-
- private:
- typename aligned_storage<sizeof(_Tp), alignment_of<_Tp>::value>::type
- _M_storage;
- };
-
- template<_Lock_policy _Lp = __default_lock_policy>
- class __weak_count;
-
- template<_Lock_policy _Lp = __default_lock_policy>
- class __shared_count
- {
- public:
- __shared_count()
- : _M_pi(0) // nothrow
- { }
-
- template<typename _Ptr>
- __shared_count(_Ptr __p) : _M_pi(0)
- {
- __try
- {
- _M_pi = new _Sp_counted_ptr<_Ptr, _Lp>(__p);
- }
- __catch(...)
- {
- delete __p;
- __throw_exception_again;
- }
- }
-
- template<typename _Ptr, typename _Deleter>
- __shared_count(_Ptr __p, _Deleter __d) : _M_pi(0)
- {
- // allocator's value_type doesn't matter, will rebind it anyway
- typedef std::allocator<int> _Alloc;
- typedef _Sp_counted_deleter<_Ptr, _Deleter, _Alloc, _Lp> _Sp_cd_type;
- typedef std::allocator<_Sp_cd_type> _Alloc2;
- _Alloc2 __a2;
- __try
- {
- _M_pi = __a2.allocate(1);
- ::new(static_cast<void*>(_M_pi)) _Sp_cd_type(__p, __d);
- }
- __catch(...)
- {
- __d(__p); // Call _Deleter on __p.
- if (_M_pi)
- __a2.deallocate(static_cast<_Sp_cd_type*>(_M_pi), 1);
- __throw_exception_again;
- }
- }
-
- template<typename _Ptr, typename _Deleter, typename _Alloc>
- __shared_count(_Ptr __p, _Deleter __d, _Alloc __a) : _M_pi(0)
- {
- typedef _Sp_counted_deleter<_Ptr, _Deleter, _Alloc, _Lp> _Sp_cd_type;
- typedef typename _Alloc::template rebind<_Sp_cd_type>::other _Alloc2;
- _Alloc2 __a2(__a);
- __try
- {
- _M_pi = __a2.allocate(1);
- ::new(static_cast<void*>(_M_pi)) _Sp_cd_type(__p, __d, __a);
- }
- __catch(...)
- {
- __d(__p); // Call _Deleter on __p.
- if (_M_pi)
- __a2.deallocate(static_cast<_Sp_cd_type*>(_M_pi), 1);
- __throw_exception_again;
- }
- }
-
- template<typename _Tp, typename _Alloc, typename... _Args>
- __shared_count(_Sp_make_shared_tag, _Tp*, _Alloc __a, _Args&&... __args)
- : _M_pi(0)
- {
- typedef _Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp> _Sp_cp_type;
- typedef typename _Alloc::template rebind<_Sp_cp_type>::other _Alloc2;
- _Alloc2 __a2(__a);
- __try
- {
- _M_pi = __a2.allocate(1);
- ::new(static_cast<void*>(_M_pi)) _Sp_cp_type(__a,
- std::forward<_Args>(__args)...);
- }
- __catch(...)
- {
- if (_M_pi)
- __a2.deallocate(static_cast<_Sp_cp_type*>(_M_pi), 1);
- __throw_exception_again;
- }
- }
-
-#if _GLIBCXX_DEPRECATED
- // Special case for auto_ptr<_Tp> to provide the strong guarantee.
- template<typename _Tp>
- explicit
- __shared_count(std::auto_ptr<_Tp>&& __r)
- : _M_pi(new _Sp_counted_ptr<_Tp*, _Lp>(__r.get()))
- { __r.release(); }
-#endif
-
- // Special case for unique_ptr<_Tp,_Del> to provide the strong guarantee.
- template<typename _Tp, typename _Del>
- explicit
- __shared_count(std::unique_ptr<_Tp, _Del>&& __r)
- : _M_pi(_S_create_from_up(std::move(__r)))
- { __r.release(); }
-
- // Throw bad_weak_ptr when __r._M_get_use_count() == 0.
- explicit
- __shared_count(const __weak_count<_Lp>& __r);
-
- ~__shared_count() // nothrow
- {
- if (_M_pi != 0)
- _M_pi->_M_release();
- }
-
- __shared_count(const __shared_count& __r)
- : _M_pi(__r._M_pi) // nothrow
- {
- if (_M_pi != 0)
- _M_pi->_M_add_ref_copy();
- }
-
- __shared_count&
- operator=(const __shared_count& __r) // nothrow
- {
- _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
- if (__tmp != _M_pi)
- {
- if (__tmp != 0)
- __tmp->_M_add_ref_copy();
- if (_M_pi != 0)
- _M_pi->_M_release();
- _M_pi = __tmp;
- }
- return *this;
- }
-
- void
- _M_swap(__shared_count& __r) // nothrow
- {
- _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
- __r._M_pi = _M_pi;
- _M_pi = __tmp;
- }
-
- long
- _M_get_use_count() const // nothrow
- { return _M_pi != 0 ? _M_pi->_M_get_use_count() : 0; }
-
- bool
- _M_unique() const // nothrow
- { return this->_M_get_use_count() == 1; }
-
- void*
- _M_get_deleter(const std::type_info& __ti) const
- { return _M_pi ? _M_pi->_M_get_deleter(__ti) : 0; }
-
- bool
- _M_less(const __shared_count& __rhs) const
- { return std::less<_Sp_counted_base<_Lp>*>()(this->_M_pi, __rhs._M_pi); }
-
- bool
- _M_less(const __weak_count<_Lp>& __rhs) const
- { return std::less<_Sp_counted_base<_Lp>*>()(this->_M_pi, __rhs._M_pi); }
-
- // friend function injected into enclosing namespace and found by ADL
- friend inline bool
- operator==(const __shared_count& __a, const __shared_count& __b)
- { return __a._M_pi == __b._M_pi; }
-
- private:
- friend class __weak_count<_Lp>;
-
- template<typename _Tp, typename _Del>
- static _Sp_counted_base<_Lp>*
- _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>,
- _Lp>(__r.get(), __r.get_deleter());
- }
-
- template<typename _Tp, typename _Del>
- static _Sp_counted_base<_Lp>*
- _S_create_from_up(std::unique_ptr<_Tp, _Del>&& __r,
- typename std::enable_if<std::is_reference<_Del>::value>::type* = 0)
- {
- typedef typename std::remove_reference<_Del>::type _Del1;
- typedef std::reference_wrapper<_Del1> _Del2;
- return new _Sp_counted_deleter<_Tp*, _Del2, std::allocator<_Tp>,
- _Lp>(__r.get(), std::ref(__r.get_deleter()));
- }
-
- _Sp_counted_base<_Lp>* _M_pi;
- };
-
-
- template<_Lock_policy _Lp>
- class __weak_count
- {
- public:
- __weak_count()
- : _M_pi(0) // nothrow
- { }
-
- __weak_count(const __shared_count<_Lp>& __r)
- : _M_pi(__r._M_pi) // nothrow
- {
- if (_M_pi != 0)
- _M_pi->_M_weak_add_ref();
- }
-
- __weak_count(const __weak_count<_Lp>& __r)
- : _M_pi(__r._M_pi) // nothrow
- {
- if (_M_pi != 0)
- _M_pi->_M_weak_add_ref();
- }
-
- ~__weak_count() // nothrow
- {
- if (_M_pi != 0)
- _M_pi->_M_weak_release();
- }
-
- __weak_count<_Lp>&
- operator=(const __shared_count<_Lp>& __r) // nothrow
- {
- _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
- if (__tmp != 0)
- __tmp->_M_weak_add_ref();
- if (_M_pi != 0)
- _M_pi->_M_weak_release();
- _M_pi = __tmp;
- return *this;
- }
-
- __weak_count<_Lp>&
- operator=(const __weak_count<_Lp>& __r) // nothrow
- {
- _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
- if (__tmp != 0)
- __tmp->_M_weak_add_ref();
- if (_M_pi != 0)
- _M_pi->_M_weak_release();
- _M_pi = __tmp;
- return *this;
- }
-
- void
- _M_swap(__weak_count<_Lp>& __r) // nothrow
- {
- _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
- __r._M_pi = _M_pi;
- _M_pi = __tmp;
- }
-
- long
- _M_get_use_count() const // nothrow
- { return _M_pi != 0 ? _M_pi->_M_get_use_count() : 0; }
-
- bool
- _M_less(const __weak_count& __rhs) const
- { return std::less<_Sp_counted_base<_Lp>*>()(this->_M_pi, __rhs._M_pi); }
-
- bool
- _M_less(const __shared_count<_Lp>& __rhs) const
- { return std::less<_Sp_counted_base<_Lp>*>()(this->_M_pi, __rhs._M_pi); }
-
- // friend function injected into enclosing namespace and found by ADL
- friend inline bool
- operator==(const __weak_count& __a, const __weak_count& __b)
- { return __a._M_pi == __b._M_pi; }
-
- private:
- friend class __shared_count<_Lp>;
-
- _Sp_counted_base<_Lp>* _M_pi;
- };
-
- // now that __weak_count is defined we can define this constructor:
- template<_Lock_policy _Lp>
- inline
- __shared_count<_Lp>::
- __shared_count(const __weak_count<_Lp>& __r)
- : _M_pi(__r._M_pi)
+ /// 2.2.3.7 shared_ptr I/O
+ template<typename _Ch, typename _Tr, typename _Tp, _Lock_policy _Lp>
+ std::basic_ostream<_Ch, _Tr>&
+ operator<<(std::basic_ostream<_Ch, _Tr>& __os,
+ const __shared_ptr<_Tp, _Lp>& __p)
{
- if (_M_pi != 0)
- _M_pi->_M_add_ref_lock();
- else
- __throw_bad_weak_ptr();
+ __os << __p.get();
+ return __os;
}
- // Forward declarations.
- template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
- class __shared_ptr;
-
- template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
- class __weak_ptr;
-
- template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
- class __enable_shared_from_this;
+ /// 2.2.3.10 shared_ptr get_deleter (experimental)
+ template<typename _Del, typename _Tp, _Lock_policy _Lp>
+ inline _Del*
+ get_deleter(const __shared_ptr<_Tp, _Lp>& __p)
+ { return static_cast<_Del*>(__p._M_get_deleter(typeid(_Del))); }
- template<typename _Tp>
- class shared_ptr;
-
- template<typename _Tp>
- class weak_ptr;
+ /**
+ * @brief A smart pointer with reference-counted copy semantics.
+ *
+ * The object pointed to is deleted when the last shared_ptr pointing to
+ * it is destroyed or reset.
+ */
template<typename _Tp>
- class enable_shared_from_this;
-
- // Support for enable_shared_from_this.
-
- // Friend of __enable_shared_from_this.
- template<_Lock_policy _Lp, typename _Tp1, typename _Tp2>
- void
- __enable_shared_from_this_helper(const __shared_count<_Lp>&,
- const __enable_shared_from_this<_Tp1,
- _Lp>*, const _Tp2*);
-
- // Friend of enable_shared_from_this.
- template<typename _Tp1, typename _Tp2>
- void
- __enable_shared_from_this_helper(const __shared_count<>&,
- const enable_shared_from_this<_Tp1>*,
- const _Tp2*);
-
- template<_Lock_policy _Lp>
- inline void
- __enable_shared_from_this_helper(const __shared_count<_Lp>&, ...)
- { }
-
-
- template<typename _Tp, _Lock_policy _Lp>
- class __shared_ptr
+ class shared_ptr : public __shared_ptr<_Tp>
{
public:
- typedef _Tp element_type;
-
- /** @brief Construct an empty %__shared_ptr.
+ /**
+ * @brief Construct an empty %shared_ptr.
* @post use_count()==0 && get()==0
*/
- __shared_ptr()
- : _M_ptr(0), _M_refcount() // never throws
- { }
+ shared_ptr() : __shared_ptr<_Tp>() { }
- /** @brief Construct a %__shared_ptr that owns the pointer @a __p.
+ /**
+ * @brief Construct a %shared_ptr that owns the pointer @a __p.
* @param __p A pointer that is convertible to element_type*.
* @post use_count() == 1 && get() == __p
* @throw std::bad_alloc, in which case @c delete @a __p is called.
*/
template<typename _Tp1>
- explicit
- __shared_ptr(_Tp1* __p)
- : _M_ptr(__p), _M_refcount(__p)
- {
- __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
- // __glibcxx_function_requires(_CompleteConcept<_Tp1*>)
- __enable_shared_from_this_helper(_M_refcount, __p, __p);
- }
+ explicit shared_ptr(_Tp1* __p) : __shared_ptr<_Tp>(__p) { }
- //
- // Requirements: _Deleter's copy constructor and destructor must
- // not throw
- //
- // __shared_ptr will release __p by calling __d(__p)
- //
- /** @brief Construct a %__shared_ptr that owns the pointer @a __p
+ /**
+ * @brief Construct a %shared_ptr that owns the pointer @a __p
* and the deleter @a __d.
* @param __p A pointer.
* @param __d A deleter.
* @post use_count() == 1 && get() == __p
* @throw std::bad_alloc, in which case @a __d(__p) is called.
+ *
+ * Requirements: _Deleter's copy constructor and destructor must
+ * not throw
+ *
+ * __shared_ptr will release __p by calling __d(__p)
*/
- template<typename _Tp1, typename _Deleter>
- __shared_ptr(_Tp1* __p, _Deleter __d)
- : _M_ptr(__p), _M_refcount(__p, __d)
- {
- __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
- // TODO requires _Deleter CopyConstructible and __d(__p) well-formed
- __enable_shared_from_this_helper(_M_refcount, __p, __p);
- }
-
- //
- // Requirements: _Deleter's copy constructor and destructor must
- // not throw _Alloc's copy constructor and destructor must not
- // throw.
- //
- // __shared_ptr will release __p by calling __d(__p)
- //
- /** @brief Construct a %__shared_ptr that owns the pointer @a __p
+ template<typename _Tp1, typename _Deleter>
+ shared_ptr(_Tp1* __p, _Deleter __d) : __shared_ptr<_Tp>(__p, __d) { }
+
+ /**
+ * @brief Construct a %shared_ptr that owns the pointer @a __p
* and the deleter @a __d.
* @param __p A pointer.
* @param __d A deleter.
* @param __a An allocator.
* @post use_count() == 1 && get() == __p
* @throw std::bad_alloc, in which case @a __d(__p) is called.
+ *
+ * Requirements: _Deleter's copy constructor and destructor must
+ * not throw _Alloc's copy constructor and destructor must not
+ * throw.
+ *
+ * __shared_ptr will release __p by calling __d(__p)
*/
template<typename _Tp1, typename _Deleter, typename _Alloc>
- __shared_ptr(_Tp1* __p, _Deleter __d, const _Alloc& __a)
- : _M_ptr(__p), _M_refcount(__p, __d, __a)
- {
- __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
- // TODO requires _Deleter CopyConstructible and __d(__p) well-formed
- __enable_shared_from_this_helper(_M_refcount, __p, __p);
- }
+ shared_ptr(_Tp1* __p, _Deleter __d, const _Alloc& __a)
+ : __shared_ptr<_Tp>(__p, __d, __a) { }
+
+ // Aliasing constructor
- /** @brief Constructs a %__shared_ptr instance that stores @a __p
+ /**
+ * @brief Constructs a %shared_ptr instance that stores @a __p
* and shares ownership with @a __r.
- * @param __r A %__shared_ptr.
+ * @param __r A %shared_ptr.
* @param __p A pointer that will remain valid while @a *__r is valid.
* @post get() == __p && use_count() == __r.use_count()
*
@@ -634,48 +158,38 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* @endcode
*/
template<typename _Tp1>
- __shared_ptr(const __shared_ptr<_Tp1, _Lp>& __r, _Tp* __p)
- : _M_ptr(__p), _M_refcount(__r._M_refcount) // never throws
- { }
-
- // generated copy constructor, assignment, destructor are fine.
-
- /** @brief If @a __r is empty, constructs an empty %__shared_ptr;
- * otherwise construct a %__shared_ptr that shares ownership
+ shared_ptr(const shared_ptr<_Tp1>& __r, _Tp* __p)
+ : __shared_ptr<_Tp>(__r, __p) { }
+
+ /**
+ * @brief If @a __r is empty, constructs an empty %shared_ptr;
+ * otherwise construct a %shared_ptr that shares ownership
* with @a __r.
- * @param __r A %__shared_ptr.
+ * @param __r A %shared_ptr.
* @post get() == __r.get() && use_count() == __r.use_count()
*/
template<typename _Tp1>
- __shared_ptr(const __shared_ptr<_Tp1, _Lp>& __r)
- : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws
- { __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) }
+ shared_ptr(const shared_ptr<_Tp1>& __r) : __shared_ptr<_Tp>(__r) { }
- /** @brief Move-constructs a %__shared_ptr instance from @a __r.
- * @param __r A %__shared_ptr rvalue.
+ /**
+ * @brief Move-constructs a %shared_ptr instance from @a __r.
+ * @param __r A %shared_ptr rvalue.
* @post *this contains the old value of @a __r, @a __r is empty.
*/
- __shared_ptr(__shared_ptr&& __r)
- : _M_ptr(__r._M_ptr), _M_refcount() // never throws
- {
- _M_refcount._M_swap(__r._M_refcount);
- __r._M_ptr = 0;
- }
+ shared_ptr(shared_ptr&& __r)
+ : __shared_ptr<_Tp>(std::move(__r)) { }
- /** @brief Move-constructs a %__shared_ptr instance from @a __r.
- * @param __r A %__shared_ptr rvalue.
+ /**
+ * @brief Move-constructs a %shared_ptr instance from @a __r.
+ * @param __r A %shared_ptr rvalue.
* @post *this contains the old value of @a __r, @a __r is empty.
*/
template<typename _Tp1>
- __shared_ptr(__shared_ptr<_Tp1, _Lp>&& __r)
- : _M_ptr(__r._M_ptr), _M_refcount() // never throws
- {
- __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
- _M_refcount._M_swap(__r._M_refcount);
- __r._M_ptr = 0;
- }
-
- /** @brief Constructs a %__shared_ptr that shares ownership with @a __r
+ shared_ptr(shared_ptr<_Tp1>&& __r)
+ : __shared_ptr<_Tp>(std::move(__r)) { }
+
+ /**
+ * @brief Constructs a %shared_ptr that shares ownership with @a __r
* and stores a copy of the pointer stored in @a __r.
* @param __r A weak_ptr.
* @post use_count() == __r.use_count()
@@ -683,609 +197,36 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* in which case the constructor has no effect.
*/
template<typename _Tp1>
- explicit
- __shared_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
- : _M_refcount(__r._M_refcount) // may throw
- {
- __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
- // It is now safe to copy __r._M_ptr, as _M_refcount(__r._M_refcount)
- // did not throw.
- _M_ptr = __r._M_ptr;
- }
-
- template<typename _Tp1, typename _Del>
- explicit
- __shared_ptr(const std::unique_ptr<_Tp1, _Del>&) = delete;
-
- /**
- * If an exception is thrown this constructor has no effect.
- */
- template<typename _Tp1, typename _Del>
- explicit
- __shared_ptr(std::unique_ptr<_Tp1, _Del>&& __r)
- : _M_ptr(__r.get()), _M_refcount()
- {
- __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
- _Tp1* __tmp = __r.get();
- _M_refcount = __shared_count<_Lp>(std::move(__r));
- __enable_shared_from_this_helper(_M_refcount, __tmp, __tmp);
- }
-
-#if _GLIBCXX_DEPRECATED
- /**
- * @post use_count() == 1 and __r.get() == 0
- */
- template<typename _Tp1>
- explicit
- __shared_ptr(std::auto_ptr<_Tp1>&& __r)
- : _M_ptr(__r.get()), _M_refcount()
- {
- __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
- // TODO requires _Tp1 is complete, delete __r.release() well-formed
- _Tp1* __tmp = __r.get();
- _M_refcount = __shared_count<_Lp>(std::move(__r));
- __enable_shared_from_this_helper(_M_refcount, __tmp, __tmp);
- }
-#endif
-
- template<typename _Tp1>
- __shared_ptr&
- operator=(const __shared_ptr<_Tp1, _Lp>& __r) // never throws
- {
- _M_ptr = __r._M_ptr;
- _M_refcount = __r._M_refcount; // __shared_count::op= doesn't throw
- return *this;
- }
-
-#if _GLIBCXX_DEPRECATED
- template<typename _Tp1>
- __shared_ptr&
- operator=(std::auto_ptr<_Tp1>&& __r)
- {
- __shared_ptr(std::move(__r)).swap(*this);
- return *this;
- }
-#endif
-
- __shared_ptr&
- operator=(__shared_ptr&& __r)
- {
- __shared_ptr(std::move(__r)).swap(*this);
- return *this;
- }
-
- template<class _Tp1>
- __shared_ptr&
- operator=(__shared_ptr<_Tp1, _Lp>&& __r)
- {
- __shared_ptr(std::move(__r)).swap(*this);
- return *this;
- }
-
- template<typename _Tp1, typename _Del>
- __shared_ptr&
- operator=(const std::unique_ptr<_Tp1, _Del>& __r) = delete;
-
- template<typename _Tp1, typename _Del>
- __shared_ptr&
- operator=(std::unique_ptr<_Tp1, _Del>&& __r)
- {
- __shared_ptr(std::move(__r)).swap(*this);
- return *this;
- }
-
- void
- reset() // never throws
- { __shared_ptr().swap(*this); }
-
- template<typename _Tp1>
- void
- reset(_Tp1* __p) // _Tp1 must be complete.
- {
- // Catch self-reset errors.
- _GLIBCXX_DEBUG_ASSERT(__p == 0 || __p != _M_ptr);
- __shared_ptr(__p).swap(*this);
- }
-
- template<typename _Tp1, typename _Deleter>
- void
- reset(_Tp1* __p, _Deleter __d)
- { __shared_ptr(__p, __d).swap(*this); }
-
- template<typename _Tp1, typename _Deleter, typename _Alloc>
- void
- reset(_Tp1* __p, _Deleter __d, const _Alloc& __a)
- { __shared_ptr(__p, __d, __a).swap(*this); }
-
- // Allow class instantiation when _Tp is [cv-qual] void.
- typename std::add_lvalue_reference<_Tp>::type
- operator*() const // never throws
- {
- _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0);
- return *_M_ptr;
- }
-
- _Tp*
- operator->() const // never throws
- {
- _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0);
- return _M_ptr;
- }
-
- _Tp*
- get() const // never throws
- { return _M_ptr; }
-
- explicit operator bool() const // never throws
- { return _M_ptr == 0 ? false : true; }
-
- bool
- unique() const // never throws
- { return _M_refcount._M_unique(); }
-
- long
- use_count() const // never throws
- { return _M_refcount._M_get_use_count(); }
-
- void
- swap(__shared_ptr<_Tp, _Lp>& __other) // never throws
- {
- std::swap(_M_ptr, __other._M_ptr);
- _M_refcount._M_swap(__other._M_refcount);
- }
-
- template<typename _Tp1>
- bool
- owner_before(__shared_ptr<_Tp1, _Lp> const& __rhs) const
- { return _M_refcount._M_less(__rhs._M_refcount); }
-
- template<typename _Tp1>
- bool
- owner_before(__weak_ptr<_Tp1, _Lp> const& __rhs) const
- { return _M_refcount._M_less(__rhs._M_refcount); }
-
- protected:
- // This constructor is non-standard, it is used by allocate_shared.
- template<typename _Alloc, typename... _Args>
- __shared_ptr(_Sp_make_shared_tag __tag, _Alloc __a, _Args&&... __args)
- : _M_ptr(), _M_refcount(__tag, (_Tp*)0, __a,
- std::forward<_Args>(__args)...)
- {
- // _M_ptr needs to point to the newly constructed object.
- // This relies on _Sp_counted_ptr_inplace::_M_get_deleter.
- void* __p = _M_refcount._M_get_deleter(typeid(__tag));
- _M_ptr = static_cast<_Tp*>(__p);
- __enable_shared_from_this_helper(_M_refcount, _M_ptr, _M_ptr);
- }
-
- template<typename _Tp1, _Lock_policy _Lp1, typename _Alloc,
- typename... _Args>
- friend __shared_ptr<_Tp1, _Lp1>
- __allocate_shared(_Alloc __a, _Args&&... __args);
-
- private:
- void*
- _M_get_deleter(const std::type_info& __ti) const
- { return _M_refcount._M_get_deleter(__ti); }
-
- template<typename _Tp1, _Lock_policy _Lp1> friend class __shared_ptr;
- template<typename _Tp1, _Lock_policy _Lp1> friend class __weak_ptr;
-
- template<typename _Del, typename _Tp1, _Lock_policy _Lp1>
- friend _Del* get_deleter(const __shared_ptr<_Tp1, _Lp1>&);
-
- _Tp* _M_ptr; // Contained pointer.
- __shared_count<_Lp> _M_refcount; // Reference counter.
- };
-
- // 20.8.13.2.7 shared_ptr comparisons
- template<typename _Tp1, typename _Tp2, _Lock_policy _Lp>
- inline bool
- operator==(const __shared_ptr<_Tp1, _Lp>& __a,
- const __shared_ptr<_Tp2, _Lp>& __b)
- { return __a.get() == __b.get(); }
-
- template<typename _Tp1, typename _Tp2, _Lock_policy _Lp>
- inline bool
- operator!=(const __shared_ptr<_Tp1, _Lp>& __a,
- const __shared_ptr<_Tp2, _Lp>& __b)
- { return __a.get() != __b.get(); }
-
- template<typename _Tp1, typename _Tp2, _Lock_policy _Lp>
- inline bool
- operator<(const __shared_ptr<_Tp1, _Lp>& __a,
- const __shared_ptr<_Tp2, _Lp>& __b)
- { return __a.get() < __b.get(); }
-
- template<typename _Sp>
- struct _Sp_less : public binary_function<_Sp, _Sp, bool>
- {
- bool
- operator()(const _Sp& __lhs, const _Sp& __rhs) const
- {
- return std::less<typename _Sp::element_type*>()(__lhs.get(),
- __rhs.get());
- }
- };
-
- template<typename _Tp, _Lock_policy _Lp>
- struct less<__shared_ptr<_Tp, _Lp>>
- : public _Sp_less<__shared_ptr<_Tp, _Lp>>
- { };
-
- // XXX LessThanComparable<_Tp> concept should provide >, >= and <=
- template<typename _Tp, _Lock_policy _Lp>
- inline bool
- operator>(const __shared_ptr<_Tp, _Lp>& __a,
- const __shared_ptr<_Tp, _Lp>& __b)
- { return __a.get() > __b.get(); }
-
- template<typename _Tp, _Lock_policy _Lp>
- inline bool
- operator>=(const __shared_ptr<_Tp, _Lp>& __a,
- const __shared_ptr<_Tp, _Lp>& __b)
- { return __a.get() >= __b.get(); }
-
- template<typename _Tp, _Lock_policy _Lp>
- inline bool
- operator<=(const __shared_ptr<_Tp, _Lp>& __a,
- const __shared_ptr<_Tp, _Lp>& __b)
- { return __a.get() <= __b.get(); }
-
- // 2.2.3.8 shared_ptr specialized algorithms.
- template<typename _Tp, _Lock_policy _Lp>
- inline void
- swap(__shared_ptr<_Tp, _Lp>& __a, __shared_ptr<_Tp, _Lp>& __b)
- { __a.swap(__b); }
-
- // 2.2.3.9 shared_ptr casts
- /** @warning The seemingly equivalent
- * <code>shared_ptr<_Tp, _Lp>(static_cast<_Tp*>(__r.get()))</code>
- * will eventually result in undefined behaviour,
- * attempting to delete the same object twice.
- */
- template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
- inline __shared_ptr<_Tp, _Lp>
- static_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
- { return __shared_ptr<_Tp, _Lp>(__r, static_cast<_Tp*>(__r.get())); }
-
- /** @warning The seemingly equivalent
- * <code>shared_ptr<_Tp, _Lp>(const_cast<_Tp*>(__r.get()))</code>
- * will eventually result in undefined behaviour,
- * attempting to delete the same object twice.
- */
- template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
- inline __shared_ptr<_Tp, _Lp>
- const_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
- { return __shared_ptr<_Tp, _Lp>(__r, const_cast<_Tp*>(__r.get())); }
-
- /** @warning The seemingly equivalent
- * <code>shared_ptr<_Tp, _Lp>(dynamic_cast<_Tp*>(__r.get()))</code>
- * will eventually result in undefined behaviour,
- * attempting to delete the same object twice.
- */
- template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
- inline __shared_ptr<_Tp, _Lp>
- dynamic_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
- {
- if (_Tp* __p = dynamic_cast<_Tp*>(__r.get()))
- return __shared_ptr<_Tp, _Lp>(__r, __p);
- return __shared_ptr<_Tp, _Lp>();
- }
-
- // 2.2.3.7 shared_ptr I/O
- template<typename _Ch, typename _Tr, typename _Tp, _Lock_policy _Lp>
- std::basic_ostream<_Ch, _Tr>&
- operator<<(std::basic_ostream<_Ch, _Tr>& __os,
- const __shared_ptr<_Tp, _Lp>& __p)
- {
- __os << __p.get();
- return __os;
- }
-
- // 2.2.3.10 shared_ptr get_deleter (experimental)
- template<typename _Del, typename _Tp, _Lock_policy _Lp>
- inline _Del*
- get_deleter(const __shared_ptr<_Tp, _Lp>& __p)
- { return static_cast<_Del*>(__p._M_get_deleter(typeid(_Del))); }
-
-
- template<typename _Tp, _Lock_policy _Lp>
- class __weak_ptr
- {
- public:
- typedef _Tp element_type;
-
- __weak_ptr()
- : _M_ptr(0), _M_refcount() // never throws
- { }
-
- // Generated copy constructor, assignment, destructor are fine.
-
- // The "obvious" converting constructor implementation:
- //
- // template<typename _Tp1>
- // __weak_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
- // : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws
- // { }
- //
- // has a serious problem.
- //
- // __r._M_ptr may already have been invalidated. The _M_ptr(__r._M_ptr)
- // conversion may require access to *__r._M_ptr (virtual inheritance).
- //
- // It is not possible to avoid spurious access violations since
- // in multithreaded programs __r._M_ptr may be invalidated at any point.
- template<typename _Tp1>
- __weak_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
- : _M_refcount(__r._M_refcount) // never throws
- {
- __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
- _M_ptr = __r.lock().get();
- }
-
- template<typename _Tp1>
- __weak_ptr(const __shared_ptr<_Tp1, _Lp>& __r)
- : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws
- { __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) }
-
- template<typename _Tp1>
- __weak_ptr&
- operator=(const __weak_ptr<_Tp1, _Lp>& __r) // never throws
- {
- _M_ptr = __r.lock().get();
- _M_refcount = __r._M_refcount;
- return *this;
- }
-
- template<typename _Tp1>
- __weak_ptr&
- operator=(const __shared_ptr<_Tp1, _Lp>& __r) // never throws
- {
- _M_ptr = __r._M_ptr;
- _M_refcount = __r._M_refcount;
- return *this;
- }
-
- __shared_ptr<_Tp, _Lp>
- lock() const // never throws
- {
-#ifdef __GTHREADS
- // Optimization: avoid throw overhead.
- if (expired())
- return __shared_ptr<element_type, _Lp>();
-
- __try
- {
- return __shared_ptr<element_type, _Lp>(*this);
- }
- __catch(const bad_weak_ptr&)
- {
- // Q: How can we get here?
- // A: Another thread may have invalidated r after the
- // use_count test above.
- return __shared_ptr<element_type, _Lp>();
- }
-
-#else
- // Optimization: avoid try/catch overhead when single threaded.
- return expired() ? __shared_ptr<element_type, _Lp>()
- : __shared_ptr<element_type, _Lp>(*this);
-
-#endif
- } // XXX MT
-
- long
- use_count() const // never throws
- { return _M_refcount._M_get_use_count(); }
-
- bool
- expired() const // never throws
- { return _M_refcount._M_get_use_count() == 0; }
-
- template<typename _Tp1>
- bool
- owner_before(const __shared_ptr<_Tp1, _Lp>& __rhs) const
- { return _M_refcount._M_less(__rhs._M_refcount); }
-
- template<typename _Tp1>
- bool
- owner_before(const __weak_ptr<_Tp1, _Lp>& __rhs) const
- { return _M_refcount._M_less(__rhs._M_refcount); }
-
- void
- reset() // never throws
- { __weak_ptr().swap(*this); }
-
- void
- swap(__weak_ptr& __s) // never throws
- {
- std::swap(_M_ptr, __s._M_ptr);
- _M_refcount._M_swap(__s._M_refcount);
- }
-
- // comparisons
- template<typename _Tp1>
- bool operator<(const __weak_ptr<_Tp1, _Lp>&) const = delete;
- template<typename _Tp1>
- bool operator<=(const __weak_ptr<_Tp1, _Lp>&) const = delete;
- template<typename _Tp1>
- bool operator>(const __weak_ptr<_Tp1, _Lp>&) const = delete;
- template<typename _Tp1>
- bool operator>=(const __weak_ptr<_Tp1, _Lp>&) const = delete;
-
- private:
- // Used by __enable_shared_from_this.
- void
- _M_assign(_Tp* __ptr, const __shared_count<_Lp>& __refcount)
- {
- _M_ptr = __ptr;
- _M_refcount = __refcount;
- }
-
- template<typename _Tp1, _Lock_policy _Lp1> friend class __shared_ptr;
- template<typename _Tp1, _Lock_policy _Lp1> friend class __weak_ptr;
- friend class __enable_shared_from_this<_Tp, _Lp>;
- friend class enable_shared_from_this<_Tp>;
-
- _Tp* _M_ptr; // Contained pointer.
- __weak_count<_Lp> _M_refcount; // Reference counter.
- };
-
- // 20.8.13.3.7 weak_ptr specialized algorithms.
- template<typename _Tp, _Lock_policy _Lp>
- inline void
- swap(__weak_ptr<_Tp, _Lp>& __a, __weak_ptr<_Tp, _Lp>& __b)
- { __a.swap(__b); }
-
- /// owner_less
- template<typename _Tp> struct owner_less;
-
- template<typename _Tp, typename _Tp1>
- struct _Sp_owner_less : public binary_function<_Tp, _Tp, bool>
- {
- bool
- operator()(const _Tp& __lhs, const _Tp& __rhs) const
- { return __lhs.owner_before(__rhs); }
- bool
- operator()(const _Tp& __lhs, const _Tp1& __rhs) const
- { return __lhs.owner_before(__rhs); }
- bool
- operator()(const _Tp1& __lhs, const _Tp& __rhs) const
- { return __lhs.owner_before(__rhs); }
- };
-
- template<typename _Tp, _Lock_policy _Lp>
- struct owner_less<__shared_ptr<_Tp, _Lp>>
- : public _Sp_owner_less<__shared_ptr<_Tp, _Lp>, __weak_ptr<_Tp, _Lp>>
- { };
-
- template<typename _Tp, _Lock_policy _Lp>
- struct owner_less<__weak_ptr<_Tp, _Lp>>
- : public _Sp_owner_less<__weak_ptr<_Tp, _Lp>, __shared_ptr<_Tp, _Lp>>
- {
- };
-
-
- template<typename _Tp, _Lock_policy _Lp>
- class __enable_shared_from_this
- {
- protected:
- __enable_shared_from_this() { }
-
- __enable_shared_from_this(const __enable_shared_from_this&) { }
-
- __enable_shared_from_this&
- operator=(const __enable_shared_from_this&)
- { return *this; }
-
- ~__enable_shared_from_this() { }
-
- public:
- __shared_ptr<_Tp, _Lp>
- shared_from_this()
- { return __shared_ptr<_Tp, _Lp>(this->_M_weak_this); }
-
- __shared_ptr<const _Tp, _Lp>
- shared_from_this() const
- { return __shared_ptr<const _Tp, _Lp>(this->_M_weak_this); }
-
- private:
- template<typename _Tp1>
- void
- _M_weak_assign(_Tp1* __p, const __shared_count<_Lp>& __n) const
- { _M_weak_this._M_assign(__p, __n); }
-
- template<typename _Tp1>
- friend void
- __enable_shared_from_this_helper(const __shared_count<_Lp>& __pn,
- const __enable_shared_from_this* __pe,
- const _Tp1* __px)
- {
- if (__pe != 0)
- __pe->_M_weak_assign(const_cast<_Tp1*>(__px), __pn);
- }
-
- mutable __weak_ptr<_Tp, _Lp> _M_weak_this;
- };
-
- /**
- * @brief A smart pointer with reference-counted copy semantics.
- *
- * The object pointed to is deleted when the last shared_ptr pointing to
- * it is destroyed or reset.
- */
- template<typename _Tp>
- class shared_ptr
- : public __shared_ptr<_Tp>
- {
- public:
- shared_ptr()
- : __shared_ptr<_Tp>() { }
-
- template<typename _Tp1>
- explicit
- shared_ptr(_Tp1* __p)
- : __shared_ptr<_Tp>(__p) { }
-
- template<typename _Tp1, typename _Deleter>
- shared_ptr(_Tp1* __p, _Deleter __d)
- : __shared_ptr<_Tp>(__p, __d) { }
-
- template<typename _Tp1, typename _Deleter, typename _Alloc>
- shared_ptr(_Tp1* __p, _Deleter __d, const _Alloc& __a)
- : __shared_ptr<_Tp>(__p, __d, __a) { }
-
- // Aliasing constructor
- template<typename _Tp1>
- shared_ptr(const shared_ptr<_Tp1>& __r, _Tp* __p)
- : __shared_ptr<_Tp>(__r, __p) { }
-
- template<typename _Tp1>
- shared_ptr(const shared_ptr<_Tp1>& __r)
- : __shared_ptr<_Tp>(__r) { }
-
- shared_ptr(shared_ptr&& __r)
- : __shared_ptr<_Tp>(std::move(__r)) { }
-
- template<typename _Tp1>
- shared_ptr(shared_ptr<_Tp1>&& __r)
- : __shared_ptr<_Tp>(std::move(__r)) { }
-
- template<typename _Tp1>
- explicit
- shared_ptr(const weak_ptr<_Tp1>& __r)
+ explicit shared_ptr(const weak_ptr<_Tp1>& __r)
: __shared_ptr<_Tp>(__r) { }
#if _GLIBCXX_DEPRECATED
template<typename _Tp1>
- explicit
- shared_ptr(std::auto_ptr<_Tp1>&& __r)
+ explicit
+ shared_ptr(std::auto_ptr<_Tp1>&& __r)
: __shared_ptr<_Tp>(std::move(__r)) { }
#endif
template<typename _Tp1, typename _Del>
- explicit
- shared_ptr(const std::unique_ptr<_Tp1, _Del>&) = delete;
+ explicit shared_ptr(const std::unique_ptr<_Tp1, _Del>&) = delete;
template<typename _Tp1, typename _Del>
- explicit
- shared_ptr(std::unique_ptr<_Tp1, _Del>&& __r)
+ explicit shared_ptr(std::unique_ptr<_Tp1, _Del>&& __r)
: __shared_ptr<_Tp>(std::move(__r)) { }
template<typename _Tp1>
- shared_ptr&
- operator=(const shared_ptr<_Tp1>& __r) // never throws
- {
+ shared_ptr&
+ operator=(const shared_ptr<_Tp1>& __r) // never throws
+ {
this->__shared_ptr<_Tp>::operator=(__r);
return *this;
}
#if _GLIBCXX_DEPRECATED
template<typename _Tp1>
- shared_ptr&
- operator=(std::auto_ptr<_Tp1>&& __r)
- {
+ shared_ptr&
+ operator=(std::auto_ptr<_Tp1>&& __r)
+ {
this->__shared_ptr<_Tp>::operator=(std::move(__r));
return *this;
}
@@ -1294,26 +235,26 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
shared_ptr&
operator=(shared_ptr&& __r)
{
- this->__shared_ptr<_Tp>::operator=(std::move(__r));
- return *this;
+ this->__shared_ptr<_Tp>::operator=(std::move(__r));
+ return *this;
}
-
+
template<class _Tp1>
- shared_ptr&
- operator=(shared_ptr<_Tp1>&& __r)
- {
- this->__shared_ptr<_Tp>::operator=(std::move(__r));
- return *this;
- }
+ shared_ptr&
+ operator=(shared_ptr<_Tp1>&& __r)
+ {
+ this->__shared_ptr<_Tp>::operator=(std::move(__r));
+ return *this;
+ }
template<typename _Tp1, typename _Del>
- shared_ptr&
- operator=(const std::unique_ptr<_Tp1, _Del>& __r) = delete;
+ shared_ptr&
+ operator=(const std::unique_ptr<_Tp1, _Del>& __r) = delete;
template<typename _Tp1, typename _Del>
- shared_ptr&
- operator=(std::unique_ptr<_Tp1, _Del>&& __r)
- {
+ shared_ptr&
+ operator=(std::unique_ptr<_Tp1, _Del>&& __r)
+ {
this->__shared_ptr<_Tp>::operator=(std::move(__r));
return *this;
}
@@ -1321,13 +262,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
private:
// This constructor is non-standard, it is used by allocate_shared.
template<typename _Alloc, typename... _Args>
- shared_ptr(_Sp_make_shared_tag __tag, _Alloc __a, _Args&&... __args)
- : __shared_ptr<_Tp>(__tag, __a, std::forward<_Args>(__args)...)
- { }
+ shared_ptr(_Sp_make_shared_tag __tag, _Alloc __a, _Args&&... __args)
+ : __shared_ptr<_Tp>(__tag, __a, std::forward<_Args>(__args)...)
+ { }
template<typename _Tp1, typename _Alloc, typename... _Args>
- friend shared_ptr<_Tp1>
- allocate_shared(_Alloc __a, _Args&&... __args);
+ friend shared_ptr<_Tp1>
+ allocate_shared(_Alloc __a, _Args&&... __args);
};
// 20.8.13.2.7 shared_ptr comparisons
@@ -1347,8 +288,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ return __a.get() < __b.get(); }
template<typename _Tp>
- struct less<shared_ptr<_Tp>>
- : public _Sp_less<shared_ptr<_Tp>>
+ struct less<shared_ptr<_Tp>> : public _Sp_less<shared_ptr<_Tp>>
{ };
// 20.8.13.2.9 shared_ptr specialized algorithms.
@@ -1373,44 +313,42 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
dynamic_pointer_cast(const shared_ptr<_Tp1>& __r)
{
if (_Tp* __p = dynamic_cast<_Tp*>(__r.get()))
- return shared_ptr<_Tp>(__r, __p);
+ return shared_ptr<_Tp>(__r, __p);
return shared_ptr<_Tp>();
}
- /**
- * @brief A smart pointer with weak semantics.
- *
+ /**
+ * @brief A smart pointer with weak semantics.
+ *
* With forwarding constructors and assignment operators.
*/
template<typename _Tp>
- class weak_ptr
- : public __weak_ptr<_Tp>
+ class weak_ptr : public __weak_ptr<_Tp>
{
public:
- weak_ptr()
- : __weak_ptr<_Tp>() { }
-
+ weak_ptr() : __weak_ptr<_Tp>() { }
+
template<typename _Tp1>
- weak_ptr(const weak_ptr<_Tp1>& __r)
+ weak_ptr(const weak_ptr<_Tp1>& __r)
: __weak_ptr<_Tp>(__r) { }
template<typename _Tp1>
- weak_ptr(const shared_ptr<_Tp1>& __r)
+ weak_ptr(const shared_ptr<_Tp1>& __r)
: __weak_ptr<_Tp>(__r) { }
template<typename _Tp1>
- weak_ptr&
- operator=(const weak_ptr<_Tp1>& __r) // never throws
- {
+ weak_ptr&
+ operator=(const weak_ptr<_Tp1>& __r) // never throws
+ {
this->__weak_ptr<_Tp>::operator=(__r);
return *this;
}
template<typename _Tp1>
- weak_ptr&
- operator=(const shared_ptr<_Tp1>& __r) // never throws
- {
+ weak_ptr&
+ operator=(const shared_ptr<_Tp1>& __r) // never throws
+ {
this->__weak_ptr<_Tp>::operator=(__r);
return *this;
}
@@ -1431,20 +369,19 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
return shared_ptr<_Tp>();
}
#else
- return this->expired() ? shared_ptr<_Tp>()
- : shared_ptr<_Tp>(*this);
+ return this->expired() ? shared_ptr<_Tp>() : shared_ptr<_Tp>(*this);
#endif
}
- // comparisons
+ // Comparisons
template<typename _Tp1>
- bool operator<(const weak_ptr<_Tp1>&) const = delete;
+ bool operator<(const weak_ptr<_Tp1>&) const = delete;
template<typename _Tp1>
- bool operator<=(const weak_ptr<_Tp1>&) const = delete;
+ bool operator<=(const weak_ptr<_Tp1>&) const = delete;
template<typename _Tp1>
- bool operator>(const weak_ptr<_Tp1>&) const = delete;
+ bool operator>(const weak_ptr<_Tp1>&) const = delete;
template<typename _Tp1>
- bool operator>=(const weak_ptr<_Tp1>&) const = delete;
+ bool operator>=(const weak_ptr<_Tp1>&) const = delete;
};
// 20.8.13.3.7 weak_ptr specialized algorithms.
@@ -1453,18 +390,24 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
swap(weak_ptr<_Tp>& __a, weak_ptr<_Tp>& __b)
{ __a.swap(__b); }
- /// owner_less
+
+ /// Primary template owner_less
+ template<typename _Tp>
+ struct owner_less;
+
+ /// Partial specialization of owner_less for shared_ptr.
template<typename _Tp>
struct owner_less<shared_ptr<_Tp>>
: public _Sp_owner_less<shared_ptr<_Tp>, weak_ptr<_Tp>>
{ };
+ /// Partial specialization of owner_less for weak_ptr.
template<typename _Tp>
struct owner_less<weak_ptr<_Tp>>
: public _Sp_owner_less<weak_ptr<_Tp>, shared_ptr<_Tp>>
{ };
- /**
+ /**
* @brief Base class allowing use of member function shared_from_this.
*/
template<typename _Tp>
@@ -1472,7 +415,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{
protected:
enable_shared_from_this() { }
-
+
enable_shared_from_this(const enable_shared_from_this&) { }
enable_shared_from_this&
@@ -1492,16 +435,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
private:
template<typename _Tp1>
- void
- _M_weak_assign(_Tp1* __p, const __shared_count<>& __n) const
- { _M_weak_this._M_assign(__p, __n); }
+ void
+ _M_weak_assign(_Tp1* __p, const __shared_count<>& __n) const
+ { _M_weak_this._M_assign(__p, __n); }
template<typename _Tp1>
- friend void
- __enable_shared_from_this_helper(const __shared_count<>& __pn,
+ friend void
+ __enable_shared_from_this_helper(const __shared_count<>& __pn,
const enable_shared_from_this* __pe,
const _Tp1* __px)
- {
+ {
if (__pe != 0)
__pe->_M_weak_assign(const_cast<_Tp1*>(__px), __pn);
}
@@ -1509,24 +452,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
mutable weak_ptr<_Tp> _M_weak_this;
};
- template<typename _Tp, _Lock_policy _Lp, typename _Alloc, typename... _Args>
- inline __shared_ptr<_Tp, _Lp>
- __allocate_shared(_Alloc __a, _Args&&... __args)
- {
- return __shared_ptr<_Tp, _Lp>(_Sp_make_shared_tag(),
- std::forward<_Alloc>(__a), std::forward<_Args>(__args)...);
- }
-
- template<typename _Tp, _Lock_policy _Lp, typename... _Args>
- inline __shared_ptr<_Tp, _Lp>
- __make_shared(_Args&&... __args)
- {
- typedef typename std::remove_const<_Tp>::type _Tp_nc;
- return __allocate_shared<_Tp, _Lp>(std::allocator<_Tp_nc>(),
- std::forward<_Args>(__args)...);
- }
-
- /** @brief Create an object that is owned by a shared_ptr.
+ /**
+ * @brief Create an object that is owned by a shared_ptr.
* @param __a An allocator.
* @param __args Arguments for the @a _Tp object's constructor.
* @return A shared_ptr that owns the newly created object.
@@ -1541,10 +468,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
allocate_shared(_Alloc __a, _Args&&... __args)
{
return shared_ptr<_Tp>(_Sp_make_shared_tag(), std::forward<_Alloc>(__a),
- std::forward<_Args>(__args)...);
+ std::forward<_Args>(__args)...);
}
- /** @brief Create an object that is owned by a shared_ptr.
+ /**
+ * @brief Create an object that is owned by a shared_ptr.
* @param __args Arguments for the @a _Tp object's constructor.
* @return A shared_ptr that owns the newly created object.
* @throw std::bad_alloc, or an exception thrown from the
@@ -1556,7 +484,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{
typedef typename std::remove_const<_Tp>::type _Tp_nc;
return allocate_shared<_Tp>(std::allocator<_Tp_nc>(),
- std::forward<_Args>(__args)...);
+ std::forward<_Args>(__args)...);
}
// @} group pointer_abstractions
diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h
new file mode 100644
index 00000000000..b8083e405c8
--- /dev/null
+++ b/libstdc++-v3/include/bits/shared_ptr_base.h
@@ -0,0 +1,1114 @@
+// shared_ptr and weak_ptr implementation details -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// GCC Note: Based on files from version 1.32.0 of the Boost library.
+
+// shared_count.hpp
+// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
+
+// shared_ptr.hpp
+// Copyright (C) 1998, 1999 Greg Colvin and Beman Dawes.
+// Copyright (C) 2001, 2002, 2003 Peter Dimov
+
+// weak_ptr.hpp
+// Copyright (C) 2001, 2002, 2003 Peter Dimov
+
+// enable_shared_from_this.hpp
+// Copyright (C) 2002 Peter Dimov
+
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+/** @file bits/shared_ptr_base.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _SHARED_PTR_BASE_H
+#define _SHARED_PTR_BASE_H 1
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Forward declarations.
+ template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
+ class __shared_ptr;
+
+ template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
+ class __weak_ptr;
+
+ template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
+ class __enable_shared_from_this;
+
+ template<typename _Tp>
+ class shared_ptr;
+
+ template<typename _Tp>
+ class weak_ptr;
+
+ template<typename _Tp>
+ struct owner_less;
+
+ template<typename _Tp>
+ class enable_shared_from_this;
+
+ template<_Lock_policy _Lp = __default_lock_policy>
+ class __weak_count;
+
+ template<_Lock_policy _Lp = __default_lock_policy>
+ class __shared_count;
+
+
+ // Counted ptr with no deleter or allocator support
+ template<typename _Ptr, _Lock_policy _Lp>
+ class _Sp_counted_ptr : public _Sp_counted_base<_Lp>
+ {
+ public:
+ _Sp_counted_ptr(_Ptr __p)
+ : _M_ptr(__p) { }
+
+ virtual void
+ _M_dispose() // nothrow
+ { delete _M_ptr; }
+
+ virtual void
+ _M_destroy() // nothrow
+ { delete this; }
+
+ virtual void*
+ _M_get_deleter(const std::type_info& __ti)
+ { return 0; }
+
+ _Sp_counted_ptr(const _Sp_counted_ptr&) = delete;
+ _Sp_counted_ptr& operator=(const _Sp_counted_ptr&) = delete;
+
+ protected:
+ _Ptr _M_ptr; // copy constructor must not throw
+ };
+
+ // Support for custom deleter and/or allocator
+ template<typename _Ptr, typename _Deleter, typename _Alloc, _Lock_policy _Lp>
+ class _Sp_counted_deleter : public _Sp_counted_ptr<_Ptr, _Lp>
+ {
+ typedef typename _Alloc::template
+ rebind<_Sp_counted_deleter>::other _My_alloc_type;
+
+ // Helper class that stores the Deleter and also acts as an allocator.
+ // Used to dispose of the owned pointer and the internal refcount
+ // Requires that copies of _Alloc can free each other's memory.
+ struct _My_Deleter
+ : public _My_alloc_type // copy constructor must not throw
+ {
+ _Deleter _M_del; // copy constructor must not throw
+ _My_Deleter(_Deleter __d, const _Alloc& __a)
+ : _My_alloc_type(__a), _M_del(__d) { }
+ };
+
+ protected:
+ typedef _Sp_counted_ptr<_Ptr, _Lp> _Base_type;
+
+ public:
+ // __d(__p) must not throw.
+ _Sp_counted_deleter(_Ptr __p, _Deleter __d)
+ : _Base_type(__p), _M_del(__d, _Alloc()) { }
+
+ // __d(__p) must not throw.
+ _Sp_counted_deleter(_Ptr __p, _Deleter __d, const _Alloc& __a)
+ : _Base_type(__p), _M_del(__d, __a) { }
+
+ virtual void
+ _M_dispose() // nothrow
+ { _M_del._M_del(_Base_type::_M_ptr); }
+
+ virtual void
+ _M_destroy() // nothrow
+ {
+ _My_alloc_type __a(_M_del);
+ this->~_Sp_counted_deleter();
+ __a.deallocate(this, 1);
+ }
+
+ virtual void*
+ _M_get_deleter(const std::type_info& __ti)
+ { return __ti == typeid(_Deleter) ? &_M_del._M_del : 0; }
+
+ protected:
+ _My_Deleter _M_del; // copy constructor must not throw
+ };
+
+ // helpers for make_shared / allocate_shared
+
+ template<typename _Tp>
+ struct _Sp_destroy_inplace
+ {
+ void operator()(_Tp* __p) const { if (__p) __p->~_Tp(); }
+ };
+
+ struct _Sp_make_shared_tag { };
+
+ template<typename _Tp, typename _Alloc, _Lock_policy _Lp>
+ class _Sp_counted_ptr_inplace
+ : public _Sp_counted_deleter<_Tp*, _Sp_destroy_inplace<_Tp>, _Alloc, _Lp>
+ {
+ typedef _Sp_counted_deleter<_Tp*, _Sp_destroy_inplace<_Tp>, _Alloc, _Lp>
+ _Base_type;
+
+ public:
+ _Sp_counted_ptr_inplace(_Alloc __a)
+ : _Base_type(static_cast<_Tp*>(0), _Sp_destroy_inplace<_Tp>(), __a)
+ , _M_storage()
+ {
+ void* __p = &_M_storage;
+ ::new (__p) _Tp(); // might throw
+ _Base_type::_Base_type::_M_ptr = static_cast<_Tp*>(__p);
+ }
+
+ template<typename... _Args>
+ _Sp_counted_ptr_inplace(_Alloc __a, _Args&&... __args)
+ : _Base_type(static_cast<_Tp*>(0), _Sp_destroy_inplace<_Tp>(), __a)
+ , _M_storage()
+ {
+ void* __p = &_M_storage;
+ ::new (__p) _Tp(std::forward<_Args>(__args)...); // might throw
+ _Base_type::_Base_type::_M_ptr = static_cast<_Tp*>(__p);
+ }
+
+ // Override because the allocator needs to know the dynamic type
+ virtual void
+ _M_destroy() // nothrow
+ {
+ typedef typename _Alloc::template
+ rebind<_Sp_counted_ptr_inplace>::other _My_alloc_type;
+ _My_alloc_type __a(_Base_type::_M_del);
+ this->~_Sp_counted_ptr_inplace();
+ __a.deallocate(this, 1);
+ }
+
+ // Sneaky trick so __shared_ptr can get the managed pointer
+ virtual void*
+ _M_get_deleter(const std::type_info& __ti)
+ {
+ return __ti == typeid(_Sp_make_shared_tag)
+ ? static_cast<void*>(&_M_storage)
+ : _Base_type::_M_get_deleter(__ti);
+ }
+
+ private:
+ typename aligned_storage<sizeof(_Tp), alignment_of<_Tp>::value>::type
+ _M_storage;
+ };
+
+ template<_Lock_policy _Lp>
+ class __shared_count
+ {
+ public:
+ __shared_count() : _M_pi(0) // nothrow
+ { }
+
+ template<typename _Ptr>
+ __shared_count(_Ptr __p) : _M_pi(0)
+ {
+ __try
+ {
+ _M_pi = new _Sp_counted_ptr<_Ptr, _Lp>(__p);
+ }
+ __catch(...)
+ {
+ delete __p;
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _Ptr, typename _Deleter>
+ __shared_count(_Ptr __p, _Deleter __d) : _M_pi(0)
+ {
+ // The allocator's value_type doesn't matter, will rebind it anyway.
+ typedef std::allocator<int> _Alloc;
+ typedef _Sp_counted_deleter<_Ptr, _Deleter, _Alloc, _Lp> _Sp_cd_type;
+ typedef std::allocator<_Sp_cd_type> _Alloc2;
+ _Alloc2 __a2;
+ __try
+ {
+ _M_pi = __a2.allocate(1);
+ ::new(static_cast<void*>(_M_pi)) _Sp_cd_type(__p, __d);
+ }
+ __catch(...)
+ {
+ __d(__p); // Call _Deleter on __p.
+ if (_M_pi)
+ __a2.deallocate(static_cast<_Sp_cd_type*>(_M_pi), 1);
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _Ptr, typename _Deleter, typename _Alloc>
+ __shared_count(_Ptr __p, _Deleter __d, _Alloc __a) : _M_pi(0)
+ {
+ typedef _Sp_counted_deleter<_Ptr, _Deleter, _Alloc, _Lp> _Sp_cd_type;
+ typedef typename _Alloc::template rebind<_Sp_cd_type>::other _Alloc2;
+ _Alloc2 __a2(__a);
+ __try
+ {
+ _M_pi = __a2.allocate(1);
+ ::new(static_cast<void*>(_M_pi)) _Sp_cd_type(__p, __d, __a);
+ }
+ __catch(...)
+ {
+ __d(__p); // Call _Deleter on __p.
+ if (_M_pi)
+ __a2.deallocate(static_cast<_Sp_cd_type*>(_M_pi), 1);
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _Tp, typename _Alloc, typename... _Args>
+ __shared_count(_Sp_make_shared_tag, _Tp*, _Alloc __a, _Args&&... __args)
+ : _M_pi(0)
+ {
+ typedef _Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp> _Sp_cp_type;
+ typedef typename _Alloc::template rebind<_Sp_cp_type>::other _Alloc2;
+ _Alloc2 __a2(__a);
+ __try
+ {
+ _M_pi = __a2.allocate(1);
+ ::new(static_cast<void*>(_M_pi)) _Sp_cp_type(__a,
+ std::forward<_Args>(__args)...);
+ }
+ __catch(...)
+ {
+ if (_M_pi)
+ __a2.deallocate(static_cast<_Sp_cp_type*>(_M_pi), 1);
+ __throw_exception_again;
+ }
+ }
+
+#if _GLIBCXX_DEPRECATED
+ // Special case for auto_ptr<_Tp> to provide the strong guarantee.
+ template<typename _Tp>
+ explicit __shared_count(std::auto_ptr<_Tp>&& __r)
+ : _M_pi(new _Sp_counted_ptr<_Tp*, _Lp>(__r.get()))
+ { __r.release(); }
+#endif
+
+ // Special case for unique_ptr<_Tp,_Del> to provide the strong guarantee.
+ template<typename _Tp, typename _Del>
+ explicit __shared_count(std::unique_ptr<_Tp, _Del>&& __r)
+ : _M_pi(_S_create_from_up(std::move(__r)))
+ { __r.release(); }
+
+ // Throw bad_weak_ptr when __r._M_get_use_count() == 0.
+ explicit __shared_count(const __weak_count<_Lp>& __r);
+
+ ~__shared_count() // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_release();
+ }
+
+ __shared_count(const __shared_count& __r)
+ : _M_pi(__r._M_pi) // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_add_ref_copy();
+ }
+
+ __shared_count&
+ operator=(const __shared_count& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ if (__tmp != _M_pi)
+ {
+ if (__tmp != 0)
+ __tmp->_M_add_ref_copy();
+ if (_M_pi != 0)
+ _M_pi->_M_release();
+ _M_pi = __tmp;
+ }
+ return *this;
+ }
+
+ void
+ _M_swap(__shared_count& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ __r._M_pi = _M_pi;
+ _M_pi = __tmp;
+ }
+
+ long
+ _M_get_use_count() const // nothrow
+ { return _M_pi != 0 ? _M_pi->_M_get_use_count() : 0; }
+
+ bool
+ _M_unique() const // nothrow
+ { return this->_M_get_use_count() == 1; }
+
+ void*
+ _M_get_deleter(const std::type_info& __ti) const
+ { return _M_pi ? _M_pi->_M_get_deleter(__ti) : 0; }
+
+ bool
+ _M_less(const __shared_count& __rhs) const
+ { return std::less<_Sp_counted_base<_Lp>*>()(this->_M_pi, __rhs._M_pi); }
+
+ bool
+ _M_less(const __weak_count<_Lp>& __rhs) const
+ { return std::less<_Sp_counted_base<_Lp>*>()(this->_M_pi, __rhs._M_pi); }
+
+ // Friend function injected into enclosing namespace and found by ADL
+ friend inline bool
+ operator==(const __shared_count& __a, const __shared_count& __b)
+ { return __a._M_pi == __b._M_pi; }
+
+ private:
+ friend class __weak_count<_Lp>;
+
+ template<typename _Tp, typename _Del>
+ static _Sp_counted_base<_Lp>*
+ _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>,
+ _Lp>(__r.get(), __r.get_deleter());
+ }
+
+ template<typename _Tp, typename _Del>
+ static _Sp_counted_base<_Lp>*
+ _S_create_from_up(std::unique_ptr<_Tp, _Del>&& __r,
+ typename std::enable_if<std::is_reference<_Del>::value>::type* = 0)
+ {
+ typedef typename std::remove_reference<_Del>::type _Del1;
+ typedef std::reference_wrapper<_Del1> _Del2;
+ return new _Sp_counted_deleter<_Tp*, _Del2, std::allocator<_Tp>,
+ _Lp>(__r.get(), std::ref(__r.get_deleter()));
+ }
+
+ _Sp_counted_base<_Lp>* _M_pi;
+ };
+
+
+ template<_Lock_policy _Lp>
+ class __weak_count
+ {
+ public:
+ __weak_count() : _M_pi(0) // nothrow
+ { }
+
+ __weak_count(const __shared_count<_Lp>& __r) : _M_pi(__r._M_pi) // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_weak_add_ref();
+ }
+
+ __weak_count(const __weak_count<_Lp>& __r) : _M_pi(__r._M_pi) // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_weak_add_ref();
+ }
+
+ ~__weak_count() // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_weak_release();
+ }
+
+ __weak_count<_Lp>&
+ operator=(const __shared_count<_Lp>& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ if (__tmp != 0)
+ __tmp->_M_weak_add_ref();
+ if (_M_pi != 0)
+ _M_pi->_M_weak_release();
+ _M_pi = __tmp;
+ return *this;
+ }
+
+ __weak_count<_Lp>&
+ operator=(const __weak_count<_Lp>& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ if (__tmp != 0)
+ __tmp->_M_weak_add_ref();
+ if (_M_pi != 0)
+ _M_pi->_M_weak_release();
+ _M_pi = __tmp;
+ return *this;
+ }
+
+ void
+ _M_swap(__weak_count<_Lp>& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ __r._M_pi = _M_pi;
+ _M_pi = __tmp;
+ }
+
+ long
+ _M_get_use_count() const // nothrow
+ { return _M_pi != 0 ? _M_pi->_M_get_use_count() : 0; }
+
+ bool
+ _M_less(const __weak_count& __rhs) const
+ { return std::less<_Sp_counted_base<_Lp>*>()(this->_M_pi, __rhs._M_pi); }
+
+ bool
+ _M_less(const __shared_count<_Lp>& __rhs) const
+ { return std::less<_Sp_counted_base<_Lp>*>()(this->_M_pi, __rhs._M_pi); }
+
+ // Friend function injected into enclosing namespace and found by ADL
+ friend inline bool
+ operator==(const __weak_count& __a, const __weak_count& __b)
+ { return __a._M_pi == __b._M_pi; }
+
+ private:
+ friend class __shared_count<_Lp>;
+
+ _Sp_counted_base<_Lp>* _M_pi;
+ };
+
+ // Now that __weak_count is defined we can define this constructor:
+ template<_Lock_policy _Lp>
+ inline __shared_count<_Lp>:: __shared_count(const __weak_count<_Lp>& __r)
+ : _M_pi(__r._M_pi)
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_add_ref_lock();
+ else
+ __throw_bad_weak_ptr();
+ }
+
+
+ // Support for enable_shared_from_this.
+
+ // Friend of __enable_shared_from_this.
+ template<_Lock_policy _Lp, typename _Tp1, typename _Tp2>
+ void
+ __enable_shared_from_this_helper(const __shared_count<_Lp>&,
+ const __enable_shared_from_this<_Tp1,
+ _Lp>*, const _Tp2*);
+
+ // Friend of enable_shared_from_this.
+ template<typename _Tp1, typename _Tp2>
+ void
+ __enable_shared_from_this_helper(const __shared_count<>&,
+ const enable_shared_from_this<_Tp1>*,
+ const _Tp2*);
+
+ template<_Lock_policy _Lp>
+ inline void
+ __enable_shared_from_this_helper(const __shared_count<_Lp>&, ...)
+ { }
+
+
+ template<typename _Tp, _Lock_policy _Lp>
+ class __shared_ptr
+ {
+ public:
+ typedef _Tp element_type;
+
+ __shared_ptr() : _M_ptr(0), _M_refcount() // never throws
+ { }
+
+ template<typename _Tp1>
+ explicit __shared_ptr(_Tp1* __p) : _M_ptr(__p), _M_refcount(__p)
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ // __glibcxx_function_requires(_CompleteConcept<_Tp1*>)
+ __enable_shared_from_this_helper(_M_refcount, __p, __p);
+ }
+
+ template<typename _Tp1, typename _Deleter>
+ __shared_ptr(_Tp1* __p, _Deleter __d)
+ : _M_ptr(__p), _M_refcount(__p, __d)
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ // TODO requires _Deleter CopyConstructible and __d(__p) well-formed
+ __enable_shared_from_this_helper(_M_refcount, __p, __p);
+ }
+
+ template<typename _Tp1, typename _Deleter, typename _Alloc>
+ __shared_ptr(_Tp1* __p, _Deleter __d, const _Alloc& __a)
+ : _M_ptr(__p), _M_refcount(__p, __d, __a)
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ // TODO requires _Deleter CopyConstructible and __d(__p) well-formed
+ __enable_shared_from_this_helper(_M_refcount, __p, __p);
+ }
+
+ template<typename _Tp1>
+ __shared_ptr(const __shared_ptr<_Tp1, _Lp>& __r, _Tp* __p)
+ : _M_ptr(__p), _M_refcount(__r._M_refcount) // never throws
+ { }
+
+ // generated copy constructor, assignment, destructor are fine.
+
+ template<typename _Tp1>
+ __shared_ptr(const __shared_ptr<_Tp1, _Lp>& __r)
+ : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws
+ { __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) }
+
+ __shared_ptr(__shared_ptr&& __r)
+ : _M_ptr(__r._M_ptr), _M_refcount() // never throws
+ {
+ _M_refcount._M_swap(__r._M_refcount);
+ __r._M_ptr = 0;
+ }
+
+ template<typename _Tp1>
+ __shared_ptr(__shared_ptr<_Tp1, _Lp>&& __r)
+ : _M_ptr(__r._M_ptr), _M_refcount() // never throws
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ _M_refcount._M_swap(__r._M_refcount);
+ __r._M_ptr = 0;
+ }
+
+ template<typename _Tp1>
+ explicit __shared_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
+ : _M_refcount(__r._M_refcount) // may throw
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+
+ // It is now safe to copy __r._M_ptr, as
+ // _M_refcount(__r._M_refcount) did not throw.
+ _M_ptr = __r._M_ptr;
+ }
+
+ template<typename _Tp1, typename _Del>
+ explicit __shared_ptr(const std::unique_ptr<_Tp1, _Del>&) = delete;
+
+ // If an exception is thrown this constructor has no effect.
+ template<typename _Tp1, typename _Del>
+ explicit __shared_ptr(std::unique_ptr<_Tp1, _Del>&& __r)
+ : _M_ptr(__r.get()), _M_refcount()
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ _Tp1* __tmp = __r.get();
+ _M_refcount = __shared_count<_Lp>(std::move(__r));
+ __enable_shared_from_this_helper(_M_refcount, __tmp, __tmp);
+ }
+
+#if _GLIBCXX_DEPRECATED
+ // Postcondition: use_count() == 1 and __r.get() == 0
+ template<typename _Tp1>
+ explicit __shared_ptr(std::auto_ptr<_Tp1>&& __r)
+ : _M_ptr(__r.get()), _M_refcount()
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ // TODO requires _Tp1 is complete, delete __r.release() well-formed
+ _Tp1* __tmp = __r.get();
+ _M_refcount = __shared_count<_Lp>(std::move(__r));
+ __enable_shared_from_this_helper(_M_refcount, __tmp, __tmp);
+ }
+#endif
+
+ template<typename _Tp1>
+ __shared_ptr&
+ operator=(const __shared_ptr<_Tp1, _Lp>& __r) // never throws
+ {
+ _M_ptr = __r._M_ptr;
+ _M_refcount = __r._M_refcount; // __shared_count::op= doesn't throw
+ return *this;
+ }
+
+#if _GLIBCXX_DEPRECATED
+ template<typename _Tp1>
+ __shared_ptr&
+ operator=(std::auto_ptr<_Tp1>&& __r)
+ {
+ __shared_ptr(std::move(__r)).swap(*this);
+ return *this;
+ }
+#endif
+
+ __shared_ptr&
+ operator=(__shared_ptr&& __r)
+ {
+ __shared_ptr(std::move(__r)).swap(*this);
+ return *this;
+ }
+
+ template<class _Tp1>
+ __shared_ptr&
+ operator=(__shared_ptr<_Tp1, _Lp>&& __r)
+ {
+ __shared_ptr(std::move(__r)).swap(*this);
+ return *this;
+ }
+
+ template<typename _Tp1, typename _Del>
+ __shared_ptr&
+ operator=(const std::unique_ptr<_Tp1, _Del>& __r) = delete;
+
+ template<typename _Tp1, typename _Del>
+ __shared_ptr&
+ operator=(std::unique_ptr<_Tp1, _Del>&& __r)
+ {
+ __shared_ptr(std::move(__r)).swap(*this);
+ return *this;
+ }
+
+ void
+ reset() // never throws
+ { __shared_ptr().swap(*this); }
+
+ template<typename _Tp1>
+ void
+ reset(_Tp1* __p) // _Tp1 must be complete.
+ {
+ // Catch self-reset errors.
+ _GLIBCXX_DEBUG_ASSERT(__p == 0 || __p != _M_ptr);
+ __shared_ptr(__p).swap(*this);
+ }
+
+ template<typename _Tp1, typename _Deleter>
+ void
+ reset(_Tp1* __p, _Deleter __d)
+ { __shared_ptr(__p, __d).swap(*this); }
+
+ template<typename _Tp1, typename _Deleter, typename _Alloc>
+ void
+ reset(_Tp1* __p, _Deleter __d, const _Alloc& __a)
+ { __shared_ptr(__p, __d, __a).swap(*this); }
+
+ // Allow class instantiation when _Tp is [cv-qual] void.
+ typename std::add_lvalue_reference<_Tp>::type
+ operator*() const // never throws
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0);
+ return *_M_ptr;
+ }
+
+ _Tp*
+ operator->() const // never throws
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0);
+ return _M_ptr;
+ }
+
+ _Tp*
+ get() const // never throws
+ { return _M_ptr; }
+
+ explicit operator bool() const // never throws
+ { return _M_ptr == 0 ? false : true; }
+
+ bool
+ unique() const // never throws
+ { return _M_refcount._M_unique(); }
+
+ long
+ use_count() const // never throws
+ { return _M_refcount._M_get_use_count(); }
+
+ void
+ swap(__shared_ptr<_Tp, _Lp>& __other) // never throws
+ {
+ std::swap(_M_ptr, __other._M_ptr);
+ _M_refcount._M_swap(__other._M_refcount);
+ }
+
+ template<typename _Tp1>
+ bool
+ owner_before(__shared_ptr<_Tp1, _Lp> const& __rhs) const
+ { return _M_refcount._M_less(__rhs._M_refcount); }
+
+ template<typename _Tp1>
+ bool
+ owner_before(__weak_ptr<_Tp1, _Lp> const& __rhs) const
+ { return _M_refcount._M_less(__rhs._M_refcount); }
+
+ protected:
+ // This constructor is non-standard, it is used by allocate_shared.
+ template<typename _Alloc, typename... _Args>
+ __shared_ptr(_Sp_make_shared_tag __tag, _Alloc __a, _Args&&... __args)
+ : _M_ptr(), _M_refcount(__tag, (_Tp*)0, __a,
+ std::forward<_Args>(__args)...)
+ {
+ // _M_ptr needs to point to the newly constructed object.
+ // This relies on _Sp_counted_ptr_inplace::_M_get_deleter.
+ void* __p = _M_refcount._M_get_deleter(typeid(__tag));
+ _M_ptr = static_cast<_Tp*>(__p);
+ __enable_shared_from_this_helper(_M_refcount, _M_ptr, _M_ptr);
+ }
+
+ template<typename _Tp1, _Lock_policy _Lp1, typename _Alloc,
+ typename... _Args>
+ friend __shared_ptr<_Tp1, _Lp1>
+ __allocate_shared(_Alloc __a, _Args&&... __args);
+
+ private:
+ void*
+ _M_get_deleter(const std::type_info& __ti) const
+ { return _M_refcount._M_get_deleter(__ti); }
+
+ template<typename _Tp1, _Lock_policy _Lp1> friend class __shared_ptr;
+ template<typename _Tp1, _Lock_policy _Lp1> friend class __weak_ptr;
+
+ template<typename _Del, typename _Tp1, _Lock_policy _Lp1>
+ friend _Del* get_deleter(const __shared_ptr<_Tp1, _Lp1>&);
+
+ _Tp* _M_ptr; // Contained pointer.
+ __shared_count<_Lp> _M_refcount; // Reference counter.
+ };
+
+
+ // 20.8.13.2.7 shared_ptr comparisons
+ template<typename _Tp1, typename _Tp2, _Lock_policy _Lp>
+ inline bool
+ operator==(const __shared_ptr<_Tp1, _Lp>& __a,
+ const __shared_ptr<_Tp2, _Lp>& __b)
+ { return __a.get() == __b.get(); }
+
+ template<typename _Tp1, typename _Tp2, _Lock_policy _Lp>
+ inline bool
+ operator!=(const __shared_ptr<_Tp1, _Lp>& __a,
+ const __shared_ptr<_Tp2, _Lp>& __b)
+ { return __a.get() != __b.get(); }
+
+ template<typename _Tp1, typename _Tp2, _Lock_policy _Lp>
+ inline bool
+ operator<(const __shared_ptr<_Tp1, _Lp>& __a,
+ const __shared_ptr<_Tp2, _Lp>& __b)
+ { return __a.get() < __b.get(); }
+
+ template<typename _Sp>
+ struct _Sp_less : public binary_function<_Sp, _Sp, bool>
+ {
+ bool
+ operator()(const _Sp& __lhs, const _Sp& __rhs) const
+ {
+ typedef typename _Sp::element_type element_type;
+ return std::less<element_type*>()(__lhs.get(), __rhs.get());
+ }
+ };
+
+ template<typename _Tp, _Lock_policy _Lp>
+ struct less<__shared_ptr<_Tp, _Lp>>
+ : public _Sp_less<__shared_ptr<_Tp, _Lp>>
+ { };
+
+ // XXX LessThanComparable<_Tp> concept should provide >, >= and <=
+ template<typename _Tp, _Lock_policy _Lp>
+ inline bool
+ operator>(const __shared_ptr<_Tp, _Lp>& __a,
+ const __shared_ptr<_Tp, _Lp>& __b)
+ { return __a.get() > __b.get(); }
+
+ template<typename _Tp, _Lock_policy _Lp>
+ inline bool
+ operator>=(const __shared_ptr<_Tp, _Lp>& __a,
+ const __shared_ptr<_Tp, _Lp>& __b)
+ { return __a.get() >= __b.get(); }
+
+ template<typename _Tp, _Lock_policy _Lp>
+ inline bool
+ operator<=(const __shared_ptr<_Tp, _Lp>& __a,
+ const __shared_ptr<_Tp, _Lp>& __b)
+ { return __a.get() <= __b.get(); }
+
+ // 2.2.3.8 shared_ptr specialized algorithms.
+ template<typename _Tp, _Lock_policy _Lp>
+ inline void
+ swap(__shared_ptr<_Tp, _Lp>& __a, __shared_ptr<_Tp, _Lp>& __b)
+ { __a.swap(__b); }
+
+ // 2.2.3.9 shared_ptr casts
+
+ // The seemingly equivalent code:
+ // shared_ptr<_Tp, _Lp>(static_cast<_Tp*>(__r.get()))
+ // will eventually result in undefined behaviour, attempting to
+ // delete the same object twice.
+ /// static_pointer_cast
+ template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
+ inline __shared_ptr<_Tp, _Lp>
+ static_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
+ { return __shared_ptr<_Tp, _Lp>(__r, static_cast<_Tp*>(__r.get())); }
+
+ // The seemingly equivalent code:
+ // shared_ptr<_Tp, _Lp>(const_cast<_Tp*>(__r.get()))
+ // will eventually result in undefined behaviour, attempting to
+ // delete the same object twice.
+ /// const_pointer_cast
+ template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
+ inline __shared_ptr<_Tp, _Lp>
+ const_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
+ { return __shared_ptr<_Tp, _Lp>(__r, const_cast<_Tp*>(__r.get())); }
+
+ // The seemingly equivalent code:
+ // shared_ptr<_Tp, _Lp>(dynamic_cast<_Tp*>(__r.get()))
+ // will eventually result in undefined behaviour, attempting to
+ // delete the same object twice.
+ /// dynamic_pointer_cast
+ template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
+ inline __shared_ptr<_Tp, _Lp>
+ dynamic_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
+ {
+ if (_Tp* __p = dynamic_cast<_Tp*>(__r.get()))
+ return __shared_ptr<_Tp, _Lp>(__r, __p);
+ return __shared_ptr<_Tp, _Lp>();
+ }
+
+
+ template<typename _Tp, _Lock_policy _Lp>
+ class __weak_ptr
+ {
+ public:
+ typedef _Tp element_type;
+
+ __weak_ptr() : _M_ptr(0), _M_refcount() // never throws
+ { }
+
+ // Generated copy constructor, assignment, destructor are fine.
+
+ // The "obvious" converting constructor implementation:
+ //
+ // template<typename _Tp1>
+ // __weak_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
+ // : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws
+ // { }
+ //
+ // has a serious problem.
+ //
+ // __r._M_ptr may already have been invalidated. The _M_ptr(__r._M_ptr)
+ // conversion may require access to *__r._M_ptr (virtual inheritance).
+ //
+ // It is not possible to avoid spurious access violations since
+ // in multithreaded programs __r._M_ptr may be invalidated at any point.
+ template<typename _Tp1>
+ __weak_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
+ : _M_refcount(__r._M_refcount) // never throws
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ _M_ptr = __r.lock().get();
+ }
+
+ template<typename _Tp1>
+ __weak_ptr(const __shared_ptr<_Tp1, _Lp>& __r)
+ : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws
+ { __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) }
+
+ template<typename _Tp1>
+ __weak_ptr&
+ operator=(const __weak_ptr<_Tp1, _Lp>& __r) // never throws
+ {
+ _M_ptr = __r.lock().get();
+ _M_refcount = __r._M_refcount;
+ return *this;
+ }
+
+ template<typename _Tp1>
+ __weak_ptr&
+ operator=(const __shared_ptr<_Tp1, _Lp>& __r) // never throws
+ {
+ _M_ptr = __r._M_ptr;
+ _M_refcount = __r._M_refcount;
+ return *this;
+ }
+
+ __shared_ptr<_Tp, _Lp>
+ lock() const // never throws
+ {
+#ifdef __GTHREADS
+ // Optimization: avoid throw overhead.
+ if (expired())
+ return __shared_ptr<element_type, _Lp>();
+
+ __try
+ {
+ return __shared_ptr<element_type, _Lp>(*this);
+ }
+ __catch(const bad_weak_ptr&)
+ {
+ // Q: How can we get here?
+ // A: Another thread may have invalidated r after the
+ // use_count test above.
+ return __shared_ptr<element_type, _Lp>();
+ }
+
+#else
+ // Optimization: avoid try/catch overhead when single threaded.
+ return expired() ? __shared_ptr<element_type, _Lp>()
+ : __shared_ptr<element_type, _Lp>(*this);
+
+#endif
+ } // XXX MT
+
+ long
+ use_count() const // never throws
+ { return _M_refcount._M_get_use_count(); }
+
+ bool
+ expired() const // never throws
+ { return _M_refcount._M_get_use_count() == 0; }
+
+ template<typename _Tp1>
+ bool
+ owner_before(const __shared_ptr<_Tp1, _Lp>& __rhs) const
+ { return _M_refcount._M_less(__rhs._M_refcount); }
+
+ template<typename _Tp1>
+ bool
+ owner_before(const __weak_ptr<_Tp1, _Lp>& __rhs) const
+ { return _M_refcount._M_less(__rhs._M_refcount); }
+
+ void
+ reset() // never throws
+ { __weak_ptr().swap(*this); }
+
+ void
+ swap(__weak_ptr& __s) // never throws
+ {
+ std::swap(_M_ptr, __s._M_ptr);
+ _M_refcount._M_swap(__s._M_refcount);
+ }
+
+ // Comparisons
+ template<typename _Tp1>
+ bool operator<(const __weak_ptr<_Tp1, _Lp>&) const = delete;
+
+ template<typename _Tp1>
+ bool operator<=(const __weak_ptr<_Tp1, _Lp>&) const = delete;
+
+ template<typename _Tp1>
+ bool operator>(const __weak_ptr<_Tp1, _Lp>&) const = delete;
+
+ template<typename _Tp1>
+ bool operator>=(const __weak_ptr<_Tp1, _Lp>&) const = delete;
+
+ private:
+ // Used by __enable_shared_from_this.
+ void
+ _M_assign(_Tp* __ptr, const __shared_count<_Lp>& __refcount)
+ {
+ _M_ptr = __ptr;
+ _M_refcount = __refcount;
+ }
+
+ template<typename _Tp1, _Lock_policy _Lp1> friend class __shared_ptr;
+ template<typename _Tp1, _Lock_policy _Lp1> friend class __weak_ptr;
+ friend class __enable_shared_from_this<_Tp, _Lp>;
+ friend class enable_shared_from_this<_Tp>;
+
+ _Tp* _M_ptr; // Contained pointer.
+ __weak_count<_Lp> _M_refcount; // Reference counter.
+ };
+
+ // 20.8.13.3.7 weak_ptr specialized algorithms.
+ template<typename _Tp, _Lock_policy _Lp>
+ inline void
+ swap(__weak_ptr<_Tp, _Lp>& __a, __weak_ptr<_Tp, _Lp>& __b)
+ { __a.swap(__b); }
+
+ template<typename _Tp, typename _Tp1>
+ struct _Sp_owner_less : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __lhs, const _Tp& __rhs) const
+ { return __lhs.owner_before(__rhs); }
+
+ bool
+ operator()(const _Tp& __lhs, const _Tp1& __rhs) const
+ { return __lhs.owner_before(__rhs); }
+
+ bool
+ operator()(const _Tp1& __lhs, const _Tp& __rhs) const
+ { return __lhs.owner_before(__rhs); }
+ };
+
+ template<typename _Tp, _Lock_policy _Lp>
+ struct owner_less<__shared_ptr<_Tp, _Lp>>
+ : public _Sp_owner_less<__shared_ptr<_Tp, _Lp>, __weak_ptr<_Tp, _Lp>>
+ { };
+
+ template<typename _Tp, _Lock_policy _Lp>
+ struct owner_less<__weak_ptr<_Tp, _Lp>>
+ : public _Sp_owner_less<__weak_ptr<_Tp, _Lp>, __shared_ptr<_Tp, _Lp>>
+ { };
+
+
+ template<typename _Tp, _Lock_policy _Lp>
+ class __enable_shared_from_this
+ {
+ protected:
+ __enable_shared_from_this() { }
+
+ __enable_shared_from_this(const __enable_shared_from_this&) { }
+
+ __enable_shared_from_this&
+ operator=(const __enable_shared_from_this&)
+ { return *this; }
+
+ ~__enable_shared_from_this() { }
+
+ public:
+ __shared_ptr<_Tp, _Lp>
+ shared_from_this()
+ { return __shared_ptr<_Tp, _Lp>(this->_M_weak_this); }
+
+ __shared_ptr<const _Tp, _Lp>
+ shared_from_this() const
+ { return __shared_ptr<const _Tp, _Lp>(this->_M_weak_this); }
+
+ private:
+ template<typename _Tp1>
+ void
+ _M_weak_assign(_Tp1* __p, const __shared_count<_Lp>& __n) const
+ { _M_weak_this._M_assign(__p, __n); }
+
+ template<typename _Tp1>
+ friend void
+ __enable_shared_from_this_helper(const __shared_count<_Lp>& __pn,
+ const __enable_shared_from_this* __pe,
+ const _Tp1* __px)
+ {
+ if (__pe != 0)
+ __pe->_M_weak_assign(const_cast<_Tp1*>(__px), __pn);
+ }
+
+ mutable __weak_ptr<_Tp, _Lp> _M_weak_this;
+ };
+
+
+ template<typename _Tp, _Lock_policy _Lp, typename _Alloc, typename... _Args>
+ inline __shared_ptr<_Tp, _Lp>
+ __allocate_shared(_Alloc __a, _Args&&... __args)
+ {
+ return __shared_ptr<_Tp, _Lp>(_Sp_make_shared_tag(),
+ std::forward<_Alloc>(__a), std::forward<_Args>(__args)...);
+ }
+
+ template<typename _Tp, _Lock_policy _Lp, typename... _Args>
+ inline __shared_ptr<_Tp, _Lp>
+ __make_shared(_Args&&... __args)
+ {
+ typedef typename std::remove_const<_Tp>::type _Tp_nc;
+ return __allocate_shared<_Tp, _Lp>(std::allocator<_Tp_nc>(),
+ std::forward<_Args>(__args)...);
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif // _SHARED_PTR_BASE_H
diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h
index a745295e9b0..9b6f2afb9ec 100644
--- a/libstdc++-v3/include/bits/stl_algo.h
+++ b/libstdc++-v3/include/bits/stl_algo.h
@@ -1647,53 +1647,64 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
typedef typename iterator_traits<_RandomAccessIterator>::value_type
_ValueType;
- const _Distance __n = __last - __first;
- const _Distance __k = __middle - __first;
- const _Distance __l = __n - __k;
+ _Distance __n = __last - __first;
+ _Distance __k = __middle - __first;
- if (__k == __l)
+ if (__k == __n - __k)
{
std::swap_ranges(__first, __middle, __middle);
return;
}
- const _Distance __d = std::__gcd(__n, __k);
+ _RandomAccessIterator __p = __first;
- for (_Distance __i = 0; __i < __d; __i++)
+ for (;;)
{
- _ValueType __tmp = _GLIBCXX_MOVE(*__first);
- _RandomAccessIterator __p = __first;
-
- if (__k < __l)
+ if (__k < __n - __k)
{
- for (_Distance __j = 0; __j < __l / __d; __j++)
+ if (__is_pod(_ValueType) && __k == 1)
+ {
+ _ValueType __t = _GLIBCXX_MOVE(*__p);
+ _GLIBCXX_MOVE3(__p + 1, __p + __n, __p);
+ *(__p + __n - 1) = _GLIBCXX_MOVE(__t);
+ return;
+ }
+ _RandomAccessIterator __q = __p + __k;
+ for (_Distance __i = 0; __i < __n - __k; ++ __i)
{
- if (__p > __first + __l)
- {
- *__p = _GLIBCXX_MOVE(*(__p - __l));
- __p -= __l;
- }
-
- *__p = _GLIBCXX_MOVE(*(__p + __k));
- __p += __k;
+ std::iter_swap(__p, __q);
+ ++__p;
+ ++__q;
}
+ __n %= __k;
+ if (__n == 0)
+ return;
+ std::swap(__n, __k);
+ __k = __n - __k;
}
else
{
- for (_Distance __j = 0; __j < __k / __d - 1; __j ++)
+ __k = __n - __k;
+ if (__is_pod(_ValueType) && __k == 1)
{
- if (__p < __last - __k)
- {
- *__p = _GLIBCXX_MOVE(*(__p + __k));
- __p += __k;
- }
- *__p = _GLIBCXX_MOVE(*(__p - __l));
- __p -= __l;
+ _ValueType __t = _GLIBCXX_MOVE(*(__p + __n - 1));
+ _GLIBCXX_MOVE_BACKWARD3(__p, __p + __n - 1, __p + __n);
+ *__p = _GLIBCXX_MOVE(__t);
+ return;
}
+ _RandomAccessIterator __q = __p + __n;
+ __p = __q - __k;
+ for (_Distance __i = 0; __i < __n - __k; ++ __i)
+ {
+ --__p;
+ --__q;
+ std::iter_swap(__p, __q);
+ }
+ __n %= __k;
+ if (__n == 0)
+ return;
+ std::swap(__n, __k);
}
-
- *__p = _GLIBCXX_MOVE(__tmp);
- ++__first;
}
}
@@ -1862,15 +1873,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
for (; __first != __last; ++__first)
if (__pred(*__first))
{
- *__result1 = *__first;
+ *__result1 = _GLIBCXX_MOVE(*__first);
++__result1;
}
else
{
- *__result2 = *__first;
+ *__result2 = _GLIBCXX_MOVE(*__first);
++__result2;
}
- std::copy(__buffer, __result2, __result1);
+ _GLIBCXX_MOVE3(__buffer, __result2, __result1);
return __result1;
}
else
@@ -2926,15 +2937,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_BidirectionalIterator2 __buffer_end;
if (__len1 > __len2 && __len2 <= __buffer_size)
{
- __buffer_end = std::copy(__middle, __last, __buffer);
- std::copy_backward(__first, __middle, __last);
- return std::copy(__buffer, __buffer_end, __first);
+ __buffer_end = _GLIBCXX_MOVE3(__middle, __last, __buffer);
+ _GLIBCXX_MOVE_BACKWARD3(__first, __middle, __last);
+ return _GLIBCXX_MOVE3(__buffer, __buffer_end, __first);
}
else if (__len1 <= __buffer_size)
{
- __buffer_end = std::copy(__first, __middle, __buffer);
- std::copy(__middle, __last, __first);
- return std::copy_backward(__buffer, __buffer_end, __last);
+ __buffer_end = _GLIBCXX_MOVE3(__first, __middle, __buffer);
+ _GLIBCXX_MOVE3(__middle, __last, __first);
+ return _GLIBCXX_MOVE_BACKWARD3(__buffer, __buffer_end, __last);
}
else
{
@@ -2956,15 +2967,21 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{
if (__len1 <= __len2 && __len1 <= __buffer_size)
{
- _Pointer __buffer_end = std::copy(__first, __middle, __buffer);
- _GLIBCXX_STD_P::merge(__buffer, __buffer_end, __middle, __last,
+ _Pointer __buffer_end = _GLIBCXX_MOVE3(__first, __middle, __buffer);
+ _GLIBCXX_STD_P::merge(_GLIBCXX_MAKE_MOVE_ITERATOR(__buffer),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__buffer_end),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__middle),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__last),
__first);
}
else if (__len2 <= __buffer_size)
{
- _Pointer __buffer_end = std::copy(__middle, __last, __buffer);
- std::__merge_backward(__first, __middle, __buffer,
- __buffer_end, __last);
+ _Pointer __buffer_end = _GLIBCXX_MOVE3(__middle, __last, __buffer);
+ std::__merge_backward(_GLIBCXX_MAKE_MOVE_ITERATOR(__first),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__middle),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__buffer),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__buffer_end),
+ __last);
}
else
{
@@ -3013,15 +3030,21 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{
if (__len1 <= __len2 && __len1 <= __buffer_size)
{
- _Pointer __buffer_end = std::copy(__first, __middle, __buffer);
- _GLIBCXX_STD_P::merge(__buffer, __buffer_end, __middle, __last,
+ _Pointer __buffer_end = _GLIBCXX_MOVE3(__first, __middle, __buffer);
+ _GLIBCXX_STD_P::merge(_GLIBCXX_MAKE_MOVE_ITERATOR(__buffer),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__buffer_end),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__middle),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__last),
__first, __comp);
}
else if (__len2 <= __buffer_size)
{
- _Pointer __buffer_end = std::copy(__middle, __last, __buffer);
- std::__merge_backward(__first, __middle, __buffer, __buffer_end,
- __last, __comp);
+ _Pointer __buffer_end = _GLIBCXX_MOVE3(__middle, __last, __buffer);
+ std::__merge_backward(_GLIBCXX_MAKE_MOVE_ITERATOR(__first),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__middle),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__buffer),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__buffer_end),
+ __last,__comp);
}
else
{
@@ -3270,16 +3293,22 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
while (__last - __first >= __two_step)
{
- __result = _GLIBCXX_STD_P::merge(__first, __first + __step_size,
- __first + __step_size,
- __first + __two_step,
- __result);
+ __result = _GLIBCXX_STD_P::merge(
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__first),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__first + __step_size),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__first + __step_size),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__first + __two_step),
+ __result);
__first += __two_step;
}
__step_size = std::min(_Distance(__last - __first), __step_size);
- _GLIBCXX_STD_P::merge(__first, __first + __step_size,
- __first + __step_size, __last,
+ _GLIBCXX_STD_P::merge(_GLIBCXX_MAKE_MOVE_ITERATOR(__first),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__first +
+ __step_size),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__first +
+ __step_size),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__last),
__result);
}
@@ -3295,16 +3324,23 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
while (__last - __first >= __two_step)
{
- __result = _GLIBCXX_STD_P::merge(__first, __first + __step_size,
- __first + __step_size, __first + __two_step,
- __result,
- __comp);
+ __result = _GLIBCXX_STD_P::merge(
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__first),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__first + __step_size),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__first + __step_size),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__first + __two_step),
+ __result, __comp);
__first += __two_step;
}
__step_size = std::min(_Distance(__last - __first), __step_size);
- _GLIBCXX_STD_P::merge(__first, __first + __step_size,
- __first + __step_size, __last, __result, __comp);
+ _GLIBCXX_STD_P::merge(_GLIBCXX_MAKE_MOVE_ITERATOR(__first),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__first +
+ __step_size),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__first +
+ __step_size),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__last),
+ __result, __comp);
}
template<typename _RandomAccessIterator, typename _Distance>
diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h
index c638c547887..f9c3ab2b428 100644
--- a/libstdc++-v3/include/bits/stl_algobase.h
+++ b/libstdc++-v3/include/bits/stl_algobase.h
@@ -998,7 +998,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_P)
}
/**
- * @brief Performs "dictionary" comparison on ranges.
+ * @brief Performs 'dictionary' comparison on ranges.
* @ingroup sorting_algorithms
* @param first1 An input iterator.
* @param last1 An input iterator.
@@ -1006,9 +1006,9 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_P)
* @param last2 An input iterator.
* @return A boolean true or false.
*
- * "Returns true if the sequence of elements defined by the range
+ * 'Returns true if the sequence of elements defined by the range
* [first1,last1) is lexicographically less than the sequence of elements
- * defined by the range [first2,last2). Returns false otherwise."
+ * defined by the range [first2,last2). Returns false otherwise.'
* (Quoted from [25.3.8]/1.) If the iterators are all character pointers,
* then this is an inline call to @c memcmp.
*/
diff --git a/libstdc++-v3/include/bits/stl_iterator.h b/libstdc++-v3/include/bits/stl_iterator.h
index eb7290053ed..a60fea60a6b 100644
--- a/libstdc++-v3/include/bits/stl_iterator.h
+++ b/libstdc++-v3/include/bits/stl_iterator.h
@@ -67,9 +67,14 @@
_GLIBCXX_BEGIN_NAMESPACE(std)
+ /**
+ * @addtogroup iterators
+ * @{
+ */
+
// 24.4.1 Reverse iterators
/**
- * "Bidirectional and random access iterators have corresponding reverse
+ * 'Bidirectional and random access iterators have corresponding reverse
* %iterator adaptors that iterate through the data structure in the
* opposite direction. They have the same signatures as the corresponding
* iterators. The fundamental relation between a reverse %iterator and its
@@ -80,7 +85,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
*
* This mapping is dictated by the fact that while there is always a
* pointer past the end of an array, there might not be a valid pointer
- * before the beginning of an array." [24.4.1]/1,2
+ * before the beginning of an array.' [24.4.1]/1,2
*
* Reverse iterators can be tricky and surprising at first. Their
* semantics make sense, however, and the trickiness is a side effect of
@@ -97,14 +102,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
protected:
_Iterator current;
- public:
- typedef _Iterator iterator_type;
- typedef typename iterator_traits<_Iterator>::difference_type
- difference_type;
- typedef typename iterator_traits<_Iterator>::reference reference;
- typedef typename iterator_traits<_Iterator>::pointer pointer;
+ typedef iterator_traits<_Iterator> __traits_type;
public:
+ typedef _Iterator iterator_type;
+ typedef typename __traits_type::difference_type difference_type;
+ typedef typename __traits_type::pointer pointer;
+ typedef typename __traits_type::reference reference;
+
/**
* The default constructor default-initializes member @p current.
* If it is a pointer, that means it is zero-initialized.
@@ -651,6 +656,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
typename _Container::iterator(__i));
}
+ // @} group iterators
+
_GLIBCXX_END_NAMESPACE
_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
@@ -670,15 +677,15 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
protected:
_Iterator _M_current;
+ typedef iterator_traits<_Iterator> __traits_type;
+
public:
- typedef _Iterator iterator_type;
- typedef typename iterator_traits<_Iterator>::iterator_category
- iterator_category;
- typedef typename iterator_traits<_Iterator>::value_type value_type;
- typedef typename iterator_traits<_Iterator>::difference_type
- difference_type;
- typedef typename iterator_traits<_Iterator>::reference reference;
- typedef typename iterator_traits<_Iterator>::pointer pointer;
+ typedef _Iterator iterator_type;
+ typedef typename __traits_type::iterator_category iterator_category;
+ typedef typename __traits_type::value_type value_type;
+ typedef typename __traits_type::difference_type difference_type;
+ typedef typename __traits_type::reference reference;
+ typedef typename __traits_type::pointer pointer;
__normal_iterator() : _M_current(_Iterator()) { }
@@ -869,6 +876,11 @@ _GLIBCXX_END_NAMESPACE
_GLIBCXX_BEGIN_NAMESPACE(std)
+ /**
+ * @addtogroup iterators
+ * @{
+ */
+
// 24.4.3 Move iterators
/**
* Class template move_iterator is an iterator adapter with the same
@@ -884,18 +896,17 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
protected:
_Iterator _M_current;
+ typedef iterator_traits<_Iterator> __traits_type;
+
public:
- typedef _Iterator iterator_type;
- typedef typename iterator_traits<_Iterator>::difference_type
- difference_type;
+ typedef _Iterator iterator_type;
+ typedef typename __traits_type::iterator_category iterator_category;
+ typedef typename __traits_type::value_type value_type;
+ typedef typename __traits_type::difference_type difference_type;
// NB: DR 680.
- typedef _Iterator pointer;
- typedef typename iterator_traits<_Iterator>::value_type value_type;
- typedef typename iterator_traits<_Iterator>::iterator_category
- iterator_category;
- typedef value_type&& reference;
+ typedef _Iterator pointer;
+ typedef value_type&& reference;
- public:
move_iterator()
: _M_current() { }
@@ -1031,6 +1042,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
make_move_iterator(const _Iterator& __i)
{ return move_iterator<_Iterator>(__i); }
+ // @} group iterators
+
_GLIBCXX_END_NAMESPACE
#define _GLIBCXX_MAKE_MOVE_ITERATOR(_Iter) std::make_move_iterator(_Iter)
diff --git a/libstdc++-v3/include/bits/stl_iterator_base_funcs.h b/libstdc++-v3/include/bits/stl_iterator_base_funcs.h
index 0a854faa14c..b629ca20231 100644
--- a/libstdc++-v3/include/bits/stl_iterator_base_funcs.h
+++ b/libstdc++-v3/include/bits/stl_iterator_base_funcs.h
@@ -173,10 +173,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
}
#ifdef __GXX_EXPERIMENTAL_CXX0X__
- template<typename _InputIterator>
- inline _InputIterator
- next(_InputIterator __x, typename
- iterator_traits<_InputIterator>::difference_type __n = 1)
+ template<typename _ForwardIterator>
+ inline _ForwardIterator
+ next(_ForwardIterator __x, typename
+ iterator_traits<_ForwardIterator>::difference_type __n = 1)
{
std::advance(__x, __n);
return __x;
diff --git a/libstdc++-v3/include/bits/stl_iterator_base_types.h b/libstdc++-v3/include/bits/stl_iterator_base_types.h
index 6dc0d7838d3..d2bf647f058 100644
--- a/libstdc++-v3/include/bits/stl_iterator_base_types.h
+++ b/libstdc++-v3/include/bits/stl_iterator_base_types.h
@@ -77,15 +77,19 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
//@{
/// Marking input iterators.
struct input_iterator_tag { };
+
/// Marking output iterators.
struct output_iterator_tag { };
+
/// Forward iterators support a superset of input iterator operations.
struct forward_iterator_tag : public input_iterator_tag { };
+
/// Bidirectional iterators support a superset of forward iterator
/// operations.
struct bidirectional_iterator_tag : public forward_iterator_tag { };
- /// Random-access iterators support a superset of bidirectional iterator
- /// operations.
+
+ /// Random-access iterators support a superset of bidirectional
+ /// iterator operations.
struct random_access_iterator_tag : public bidirectional_iterator_tag { };
@@ -116,6 +120,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
};
/**
+ * @brief Traits class for iterators.
+ *
* This class does nothing but define nested typedefs. The general
* version simply "forwards" the nested typedefs from the Iterator
* argument. Specialized versions for pointers and pointers-to-const
@@ -131,6 +137,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
typedef typename _Iterator::reference reference;
};
+ /// Partial specialization for pointer types.
template<typename _Tp>
struct iterator_traits<_Tp*>
{
@@ -141,6 +148,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
typedef _Tp& reference;
};
+ /// Partial specialization for const pointer types.
template<typename _Tp>
struct iterator_traits<const _Tp*>
{
diff --git a/libstdc++-v3/include/bits/stl_pair.h b/libstdc++-v3/include/bits/stl_pair.h
index d6c590186d6..4a9fb6be485 100644
--- a/libstdc++-v3/include/bits/stl_pair.h
+++ b/libstdc++-v3/include/bits/stl_pair.h
@@ -60,6 +60,10 @@
#include <bits/move.h> // for std::move / std::forward, std::decay, and
// std::swap
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#include <type_traits>
+#endif
+
_GLIBCXX_BEGIN_NAMESPACE(std)
/// pair holds two objects of arbitrary type.
@@ -84,7 +88,22 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
: first(__a), second(__b) { }
#ifdef __GXX_EXPERIMENTAL_CXX0X__
- template<class _U1, class _U2>
+ // DR 811.
+ template<class _U1, class = typename
+ std::enable_if<std::is_convertible<_U1, _T1>::value>::type>
+ pair(_U1&& __x, const _T2& __y)
+ : first(std::forward<_U1>(__x)),
+ second(__y) { }
+
+ template<class _U2, class = typename
+ std::enable_if<std::is_convertible<_U2, _T2>::value>::type>
+ pair(const _T1& __x, _U2&& __y)
+ : first(__x),
+ second(std::forward<_U2>(__y)) { }
+
+ template<class _U1, class _U2, class = typename
+ std::enable_if<std::is_convertible<_U1, _T1>::value
+ && std::is_convertible<_U2, _T2>::value>::type>
pair(_U1&& __x, _U2&& __y)
: first(std::forward<_U1>(__x)),
second(std::forward<_U2>(__y)) { }
@@ -106,13 +125,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
: first(std::move(__p.first)),
second(std::move(__p.second)) { }
- // http://gcc.gnu.org/ml/libstdc++/2007-08/msg00052.html
- template<class _U1, class _Arg0, class... _Args>
- pair(_U1&& __x, _Arg0&& __arg0, _Args&&... __args)
- : first(std::forward<_U1>(__x)),
- second(std::forward<_Arg0>(__arg0),
- std::forward<_Args>(__args)...) { }
-
pair&
operator=(pair&& __p)
{
diff --git a/libstdc++-v3/include/bits/stl_tempbuf.h b/libstdc++-v3/include/bits/stl_tempbuf.h
index 2b887912a10..27b58bf5f81 100644
--- a/libstdc++-v3/include/bits/stl_tempbuf.h
+++ b/libstdc++-v3/include/bits/stl_tempbuf.h
@@ -72,9 +72,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
*
* This function tries to obtain storage for @c len adjacent Tp
* objects. The objects themselves are not constructed, of course.
- * A pair<> is returned containing "the buffer s address and
+ * A pair<> is returned containing 'the buffer s address and
* capacity (in the units of sizeof(Tp)), or a pair of 0 values if
- * no storage can be obtained." Note that the capacity obtained
+ * no storage can be obtained.' Note that the capacity obtained
* may be less than that requested if the memory is unavailable;
* you should compare len with the .second return value.
*
diff --git a/libstdc++-v3/include/bits/stream_iterator.h b/libstdc++-v3/include/bits/stream_iterator.h
index fce6c26d1a5..90f1b552b60 100644
--- a/libstdc++-v3/include/bits/stream_iterator.h
+++ b/libstdc++-v3/include/bits/stream_iterator.h
@@ -36,6 +36,11 @@
_GLIBCXX_BEGIN_NAMESPACE(std)
+ /**
+ * @addtogroup iterators
+ * @{
+ */
+
/// Provides input iterator semantics for streams.
template<typename _Tp, typename _CharT = char,
typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>
@@ -206,6 +211,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ return *this; }
};
+ // @} group iterators
+
_GLIBCXX_END_NAMESPACE
#endif
diff --git a/libstdc++-v3/include/bits/streambuf_iterator.h b/libstdc++-v3/include/bits/streambuf_iterator.h
index d02b555343a..71c323035a2 100644
--- a/libstdc++-v3/include/bits/streambuf_iterator.h
+++ b/libstdc++-v3/include/bits/streambuf_iterator.h
@@ -39,6 +39,11 @@
_GLIBCXX_BEGIN_NAMESPACE(std)
+ /**
+ * @addtogroup iterators
+ * @{
+ */
+
// 24.5.3 Template class istreambuf_iterator
/// Provides input iterator semantics for streambufs.
template<typename _CharT, typename _Traits>
@@ -387,6 +392,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
return __first;
}
+// @} group iterators
+
_GLIBCXX_END_NAMESPACE
#endif
diff --git a/libstdc++-v3/include/bits/valarray_array.h b/libstdc++-v3/include/bits/valarray_array.h
index 492891bc9d8..a12b3347b9d 100644
--- a/libstdc++-v3/include/bits/valarray_array.h
+++ b/libstdc++-v3/include/bits/valarray_array.h
@@ -1,7 +1,7 @@
// The template and inlines for the -*- C++ -*- internal _Array helper class.
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-// 2006, 2007, 2009
+// 2006, 2007, 2008, 2009
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -73,7 +73,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// Please note that this isn't exception safe. But
// valarrays aren't required to be exception safe.
inline static void
- _S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e)
+ _S_do_it(_Tp* __b, _Tp* __e)
{
while (__b != __e)
new(__b++) _Tp();
@@ -85,13 +85,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{
// For fundamental types, it suffices to say 'memset()'
inline static void
- _S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e)
+ _S_do_it(_Tp* __b, _Tp* __e)
{ __builtin_memset(__b, 0, (__e - __b) * sizeof(_Tp)); }
};
template<typename _Tp>
inline void
- __valarray_default_construct(_Tp* __restrict__ __b, _Tp* __restrict__ __e)
+ __valarray_default_construct(_Tp* __b, _Tp* __e)
{
_Array_default_ctor<_Tp, __is_scalar<_Tp>::__value>::_S_do_it(__b, __e);
}
@@ -105,7 +105,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// Please note that this isn't exception safe. But
// valarrays aren't required to be exception safe.
inline static void
- _S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e, const _Tp __t)
+ _S_do_it(_Tp* __b, _Tp* __e, const _Tp __t)
{
while (__b != __e)
new(__b++) _Tp(__t);
@@ -116,7 +116,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
struct _Array_init_ctor<_Tp, true>
{
inline static void
- _S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e, const _Tp __t)
+ _S_do_it(_Tp* __b, _Tp* __e, const _Tp __t)
{
while (__b != __e)
*__b++ = __t;
@@ -125,8 +125,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _Tp>
inline void
- __valarray_fill_construct(_Tp* __restrict__ __b, _Tp* __restrict__ __e,
- const _Tp __t)
+ __valarray_fill_construct(_Tp* __b, _Tp* __e, const _Tp __t)
{
_Array_init_ctor<_Tp, __is_pod(_Tp)>::_S_do_it(__b, __e, __t);
}
@@ -141,8 +140,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// Please note that this isn't exception safe. But
// valarrays aren't required to be exception safe.
inline static void
- _S_do_it(const _Tp* __restrict__ __b, const _Tp* __restrict__ __e,
- _Tp* __restrict__ __o)
+ _S_do_it(const _Tp* __b, const _Tp* __e, _Tp* __restrict__ __o)
{
while (__b != __e)
new(__o++) _Tp(*__b++);
@@ -153,15 +151,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
struct _Array_copy_ctor<_Tp, true>
{
inline static void
- _S_do_it(const _Tp* __restrict__ __b, const _Tp* __restrict__ __e,
- _Tp* __restrict__ __o)
+ _S_do_it(const _Tp* __b, const _Tp* __e, _Tp* __restrict__ __o)
{ __builtin_memcpy(__o, __b, (__e - __b) * sizeof(_Tp)); }
};
template<typename _Tp>
inline void
- __valarray_copy_construct(const _Tp* __restrict__ __b,
- const _Tp* __restrict__ __e,
+ __valarray_copy_construct(const _Tp* __b, const _Tp* __e,
_Tp* __restrict__ __o)
{
_Array_copy_ctor<_Tp, __is_pod(_Tp)>::_S_do_it(__b, __e, __o);
@@ -205,7 +201,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// Do the necessary cleanup when we're done with arrays.
template<typename _Tp>
inline void
- __valarray_destroy_elements(_Tp* __restrict__ __b, _Tp* __restrict__ __e)
+ __valarray_destroy_elements(_Tp* __b, _Tp* __e)
{
if (!__is_pod(_Tp))
while (__b != __e)
@@ -347,7 +343,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
//
template<typename _Tp>
inline _Tp
- __valarray_sum(const _Tp* __restrict__ __f, const _Tp* __restrict__ __l)
+ __valarray_sum(const _Tp* __f, const _Tp* __l)
{
_Tp __r = _Tp();
while (__f != __l)
@@ -358,8 +354,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// Compute the product of all elements in range [__f, __l)
template<typename _Tp>
inline _Tp
- __valarray_product(const _Tp* __restrict__ __f,
- const _Tp* __restrict__ __l)
+ __valarray_product(const _Tp* __f, const _Tp* __l)
{
_Tp __r = _Tp(1);
while (__f != __l)
diff --git a/libstdc++-v3/include/c_compatibility/stdatomic.h b/libstdc++-v3/include/c_compatibility/stdatomic.h
index f4771166d2b..eaa45cddac1 100644
--- a/libstdc++-v3/include/c_compatibility/stdatomic.h
+++ b/libstdc++-v3/include/c_compatibility/stdatomic.h
@@ -186,8 +186,11 @@ _GLIBCXX_BEGIN_EXTERN_C
_GLIBCXX_END_EXTERN_C
_GLIBCXX_END_NAMESPACE
-// Inject into global namespace. XXX
-#if defined(__cplusplus) && !defined(_GLIBCXX_STDATOMIC)
+// Inject into global namespace.
+#ifdef __cplusplus
+
+#include <cstdatomic>
+
using std::memory_order;
using std::memory_order_relaxed;
using std::memory_order_consume;
diff --git a/libstdc++-v3/include/c_global/cassert b/libstdc++-v3/include/c_global/cassert
index 186de0fbcd1..231e419efb5 100644
--- a/libstdc++-v3/include/c_global/cassert
+++ b/libstdc++-v3/include/c_global/cassert
@@ -25,7 +25,7 @@
// <http://www.gnu.org/licenses/>.
/** @file cassert
- * This is a Standard C++ Library file. You should @c #include this file
+ * This is a Standard C++ Library file. You should @c \#include this file
* in your programs, rather than any of the "*.h" implementation files.
*
* This is the C++ version of the Standard C Library header @c assert.h,
diff --git a/libstdc++-v3/include/c_global/cctype b/libstdc++-v3/include/c_global/cctype
index 44ef4d4a0f2..bfe45929e3c 100644
--- a/libstdc++-v3/include/c_global/cctype
+++ b/libstdc++-v3/include/c_global/cctype
@@ -25,7 +25,7 @@
// <http://www.gnu.org/licenses/>.
/** @file include/cctype
- * This is a Standard C++ Library file. You should @c #include this file
+ * This is a Standard C++ Library file. You should @c \#include this file
* in your programs, rather than any of the "*.h" implementation files.
*
* This is the C++ version of the Standard C Library header @c ctype.h,
diff --git a/libstdc++-v3/include/c_global/cerrno b/libstdc++-v3/include/c_global/cerrno
index 371642936cf..f02d732079c 100644
--- a/libstdc++-v3/include/c_global/cerrno
+++ b/libstdc++-v3/include/c_global/cerrno
@@ -25,7 +25,7 @@
// <http://www.gnu.org/licenses/>.
/** @file cerrno
- * This is a Standard C++ Library file. You should @c #include this file
+ * This is a Standard C++ Library file. You should @c \#include this file
* in your programs, rather than any of the "*.h" implementation files.
*
* This is the C++ version of the Standard C Library header @c errno.h,
diff --git a/libstdc++-v3/include/c_global/cfloat b/libstdc++-v3/include/c_global/cfloat
index 54eb7788746..7f551446cb3 100644
--- a/libstdc++-v3/include/c_global/cfloat
+++ b/libstdc++-v3/include/c_global/cfloat
@@ -25,7 +25,7 @@
// <http://www.gnu.org/licenses/>.
/** @file include/cfloat
- * This is a Standard C++ Library file. You should @c #include this file
+ * This is a Standard C++ Library file. You should @c \#include this file
* in your programs, rather than any of the "*.h" implementation files.
*
* This is the C++ version of the Standard C Library header @c float.h,
diff --git a/libstdc++-v3/include/c_global/ciso646 b/libstdc++-v3/include/c_global/ciso646
index a3c3f9b7794..bb7e6294fd8 100644
--- a/libstdc++-v3/include/c_global/ciso646
+++ b/libstdc++-v3/include/c_global/ciso646
@@ -23,7 +23,7 @@
// <http://www.gnu.org/licenses/>.
/** @file ciso646
- * This is a Standard C++ Library file. You should @c #include this file
+ * This is a Standard C++ Library file. You should @c \#include this file
* in your programs, rather than any of the "*.h" implementation files.
*
* This is the C++ version of the Standard C Library header @c iso646.h,
diff --git a/libstdc++-v3/include/c_global/climits b/libstdc++-v3/include/c_global/climits
index 943d69e522f..1bbe6cf27a5 100644
--- a/libstdc++-v3/include/c_global/climits
+++ b/libstdc++-v3/include/c_global/climits
@@ -25,7 +25,7 @@
// <http://www.gnu.org/licenses/>.
/** @file include/climits
- * This is a Standard C++ Library file. You should @c #include this file
+ * This is a Standard C++ Library file. You should @c \#include this file
* in your programs, rather than any of the "*.h" implementation files.
*
* This is the C++ version of the Standard C Library header @c limits.h,
diff --git a/libstdc++-v3/include/c_global/clocale b/libstdc++-v3/include/c_global/clocale
index eb955c9b181..52d2b9d2148 100644
--- a/libstdc++-v3/include/c_global/clocale
+++ b/libstdc++-v3/include/c_global/clocale
@@ -25,7 +25,7 @@
// <http://www.gnu.org/licenses/>.
/** @file clocale
- * This is a Standard C++ Library file. You should @c #include this file
+ * This is a Standard C++ Library file. You should @c \#include this file
* in your programs, rather than any of the "*.h" implementation files.
*
* This is the C++ version of the Standard C Library header @c locale.h,
diff --git a/libstdc++-v3/include/c_global/cmath b/libstdc++-v3/include/c_global/cmath
index a5c31c436d7..2568d6b3bf6 100644
--- a/libstdc++-v3/include/c_global/cmath
+++ b/libstdc++-v3/include/c_global/cmath
@@ -25,7 +25,7 @@
// <http://www.gnu.org/licenses/>.
/** @file include/cmath
- * This is a Standard C++ Library file. You should @c #include this file
+ * This is a Standard C++ Library file. You should @c \#include this file
* in your programs, rather than any of the "*.h" implementation files.
*
* This is the C++ version of the Standard C Library header @c math.h,
diff --git a/libstdc++-v3/include/c_global/csetjmp b/libstdc++-v3/include/c_global/csetjmp
index 6d7ecab47b6..c643d1b437a 100644
--- a/libstdc++-v3/include/c_global/csetjmp
+++ b/libstdc++-v3/include/c_global/csetjmp
@@ -25,7 +25,7 @@
// <http://www.gnu.org/licenses/>.
/** @file csetjmp
- * This is a Standard C++ Library file. You should @c #include this file
+ * This is a Standard C++ Library file. You should @c \#include this file
* in your programs, rather than any of the "*.h" implementation files.
*
* This is the C++ version of the Standard C Library header @c setjmp.h,
diff --git a/libstdc++-v3/include/c_global/csignal b/libstdc++-v3/include/c_global/csignal
index 41af5e694a4..147b5b61859 100644
--- a/libstdc++-v3/include/c_global/csignal
+++ b/libstdc++-v3/include/c_global/csignal
@@ -25,7 +25,7 @@
// <http://www.gnu.org/licenses/>.
/** @file csignal
- * This is a Standard C++ Library file. You should @c #include this file
+ * This is a Standard C++ Library file. You should @c \#include this file
* in your programs, rather than any of the "*.h" implementation files.
*
* This is the C++ version of the Standard C Library header @c signal.h,
diff --git a/libstdc++-v3/include/c_global/cstdarg b/libstdc++-v3/include/c_global/cstdarg
index 73327b1a353..c61a866bfe7 100644
--- a/libstdc++-v3/include/c_global/cstdarg
+++ b/libstdc++-v3/include/c_global/cstdarg
@@ -25,7 +25,7 @@
// <http://www.gnu.org/licenses/>.
/** @file include/cstdarg
- * This is a Standard C++ Library file. You should @c #include this file
+ * This is a Standard C++ Library file. You should @c \#include this file
* in your programs, rather than any of the "*.h" implementation files.
*
* This is the C++ version of the Standard C Library header @c stdarg.h,
diff --git a/libstdc++-v3/include/c_global/cstdatomic b/libstdc++-v3/include/c_global/cstdatomic
index 7489d97c07d..c2aea8f02c2 100644
--- a/libstdc++-v3/include/c_global/cstdatomic
+++ b/libstdc++-v3/include/c_global/cstdatomic
@@ -24,7 +24,7 @@
// <http://www.gnu.org/licenses/>.
/** @file cstdatomic
- * This is a Standard C++ Library file. You should @c #include this file
+ * This is a Standard C++ Library file. You should @c \#include this file
* in your programs, rather than any of the "*.h" implementation files.
*
* This is the C++ version of the Standard C Library header @c stdatomic.h,
diff --git a/libstdc++-v3/include/c_global/cstddef b/libstdc++-v3/include/c_global/cstddef
index bb16e75e0ac..6beb52588bc 100644
--- a/libstdc++-v3/include/c_global/cstddef
+++ b/libstdc++-v3/include/c_global/cstddef
@@ -25,7 +25,7 @@
// <http://www.gnu.org/licenses/>.
/** @file cstddef
- * This is a Standard C++ Library file. You should @c #include this file
+ * This is a Standard C++ Library file. You should @c \#include this file
* in your programs, rather than any of the "*.h" implementation files.
*
* This is the C++ version of the Standard C Library header @c stddef.h,
diff --git a/libstdc++-v3/include/c_global/cstdio b/libstdc++-v3/include/c_global/cstdio
index ff5a635a152..b17f5ccf864 100644
--- a/libstdc++-v3/include/c_global/cstdio
+++ b/libstdc++-v3/include/c_global/cstdio
@@ -25,7 +25,7 @@
// <http://www.gnu.org/licenses/>.
/** @file include/cstdio
- * This is a Standard C++ Library file. You should @c #include this file
+ * This is a Standard C++ Library file. You should @c \#include this file
* in your programs, rather than any of the "*.h" implementation files.
*
* This is the C++ version of the Standard C Library header @c stdio.h,
diff --git a/libstdc++-v3/include/c_global/cstdlib b/libstdc++-v3/include/c_global/cstdlib
index e252d089e75..0e0d7d5c18c 100644
--- a/libstdc++-v3/include/c_global/cstdlib
+++ b/libstdc++-v3/include/c_global/cstdlib
@@ -25,7 +25,7 @@
// <http://www.gnu.org/licenses/>.
/** @file include/cstdlib
- * This is a Standard C++ Library file. You should @c #include this file
+ * This is a Standard C++ Library file. You should @c \#include this file
* in your programs, rather than any of the "*.h" implementation files.
*
* This is the C++ version of the Standard C Library header @c stdlib.h,
diff --git a/libstdc++-v3/include/c_global/cstring b/libstdc++-v3/include/c_global/cstring
index de0ce2425e3..acd6166b15f 100644
--- a/libstdc++-v3/include/c_global/cstring
+++ b/libstdc++-v3/include/c_global/cstring
@@ -25,7 +25,7 @@
// <http://www.gnu.org/licenses/>.
/** @file cstring
- * This is a Standard C++ Library file. You should @c #include this file
+ * This is a Standard C++ Library file. You should @c \#include this file
* in your programs, rather than any of the "*.h" implementation files.
*
* This is the C++ version of the Standard C Library header @c string.h,
diff --git a/libstdc++-v3/include/c_global/ctime b/libstdc++-v3/include/c_global/ctime
index e236cf48367..8430dc84234 100644
--- a/libstdc++-v3/include/c_global/ctime
+++ b/libstdc++-v3/include/c_global/ctime
@@ -25,7 +25,7 @@
// <http://www.gnu.org/licenses/>.
/** @file include/ctime
- * This is a Standard C++ Library file. You should @c #include this file
+ * This is a Standard C++ Library file. You should @c \#include this file
* in your programs, rather than any of the "*.h" implementation files.
*
* This is the C++ version of the Standard C Library header @c time.h,
diff --git a/libstdc++-v3/include/c_global/cwchar b/libstdc++-v3/include/c_global/cwchar
index f7f07c3caf5..f2f36cfc75c 100644
--- a/libstdc++-v3/include/c_global/cwchar
+++ b/libstdc++-v3/include/c_global/cwchar
@@ -25,7 +25,7 @@
// <http://www.gnu.org/licenses/>.
/** @file include/cwchar
- * This is a Standard C++ Library file. You should @c #include this file
+ * This is a Standard C++ Library file. You should @c \#include this file
* in your programs, rather than any of the "*.h" implementation files.
*
* This is the C++ version of the Standard C Library header @c wchar.h,
diff --git a/libstdc++-v3/include/c_global/cwctype b/libstdc++-v3/include/c_global/cwctype
index 4e94fec3426..ffc75c82ba5 100644
--- a/libstdc++-v3/include/c_global/cwctype
+++ b/libstdc++-v3/include/c_global/cwctype
@@ -25,7 +25,7 @@
// <http://www.gnu.org/licenses/>.
/** @file include/cwctype
- * This is a Standard C++ Library file. You should @c #include this file
+ * This is a Standard C++ Library file. You should @c \#include this file
* in your programs, rather than any of the "*.h" implementation files.
*
* This is the C++ version of the Standard C Library header @c wctype.h,
diff --git a/libstdc++-v3/include/decimal/decimal b/libstdc++-v3/include/decimal/decimal
new file mode 100644
index 00000000000..8ef5a91c0ca
--- /dev/null
+++ b/libstdc++-v3/include/decimal/decimal
@@ -0,0 +1,482 @@
+// <decimal> -*- C++ -*-
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/decimal/decimal
+ * This is a Standard C++ Library header.
+ */
+
+// ISO/IEC TR 24733
+// Written by Janis Johnson <janis187@us.ibm.com>
+
+#ifndef _GLIBCXX_DECIMAL
+#define _GLIBCXX_DECIMAL 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+
+#ifndef _GLIBCXX_USE_DECIMAL_FLOAT
+#error This file requires compiler and library support for ISO/IEC TR 24733 \
+that is currently not available.
+#endif
+
+namespace std
+{
+ /**
+ * @defgroup decimal Decimal Floating-Point Arithmetic
+ * @ingroup numerics
+ *
+ * Classes and functions for decimal floating-point arithmetic.
+ * @{
+ */
+
+ /** @namespace std::decimal
+ * @brief ISO/IEC TR 24733 Decimal floating-point arithmetic.
+ */
+namespace decimal
+{
+ class decimal32;
+ class decimal64;
+ class decimal128;
+
+ // 3.2.5 Initialization from coefficient and exponent.
+ static decimal32 make_decimal32(long long __coeff, int __exp);
+ static decimal32 make_decimal32(unsigned long long __coeff, int __exp);
+ static decimal64 make_decimal64(long long __coeff, int __exp);
+ static decimal64 make_decimal64(unsigned long long __coeff, int __exp);
+ static decimal128 make_decimal128(long long __coeff, int __exp);
+ static decimal128 make_decimal128(unsigned long long __coeff, int __exp);
+
+ /// Non-conforming extension: Conversion to integral type.
+ long long decimal32_to_long_long(decimal32 __d);
+ long long decimal64_to_long_long(decimal64 __d);
+ long long decimal128_to_long_long(decimal128 __d);
+ long long decimal_to_long_long(decimal32 __d);
+ long long decimal_to_long_long(decimal64 __d);
+ long long decimal_to_long_long(decimal128 __d);
+
+ // 3.2.6 Conversion to generic floating-point type.
+ float decimal32_to_float(decimal32 __d);
+ float decimal64_to_float(decimal64 __d);
+ float decimal128_to_float(decimal128 __d);
+ float decimal_to_float(decimal32 __d);
+ float decimal_to_float(decimal64 __d);
+ float decimal_to_float(decimal128 __d);
+
+ double decimal32_to_double(decimal32 __d);
+ double decimal64_to_double(decimal64 __d);
+ double decimal128_to_double(decimal128 __d);
+ double decimal_to_double(decimal32 __d);
+ double decimal_to_double(decimal64 __d);
+ double decimal_to_double(decimal128 __d);
+
+ long double decimal32_to_long_double(decimal32 __d);
+ long double decimal64_to_long_double(decimal64 __d);
+ long double decimal128_to_long_double(decimal128 __d);
+ long double decimal_to_long_double(decimal32 __d);
+ long double decimal_to_long_double(decimal64 __d);
+ long double decimal_to_long_double(decimal128 __d);
+
+ // 3.2.7 Unary arithmetic operators.
+ decimal32 operator+(decimal32 __rhs);
+ decimal64 operator+(decimal64 __rhs);
+ decimal128 operator+(decimal128 __rhs);
+ decimal32 operator-(decimal32 __rhs);
+ decimal64 operator-(decimal64 __rhs);
+ decimal128 operator-(decimal128 __rhs);
+
+ // 3.2.8 Binary arithmetic operators.
+#define _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(_Op, _T1, _T2, _T3) \
+ _T1 operator _Op(_T2 __lhs, _T3 __rhs);
+#define _DECLARE_DECIMAL_BINARY_OP_WITH_INT(_Op, _Tp) \
+ _Tp operator _Op(_Tp __lhs, int __rhs); \
+ _Tp operator _Op(_Tp __lhs, unsigned int __rhs); \
+ _Tp operator _Op(_Tp __lhs, long __rhs); \
+ _Tp operator _Op(_Tp __lhs, unsigned long __rhs); \
+ _Tp operator _Op(_Tp __lhs, long long __rhs); \
+ _Tp operator _Op(_Tp __lhs, unsigned long long __rhs); \
+ _Tp operator _Op(int __lhs, _Tp __rhs); \
+ _Tp operator _Op(unsigned int __lhs, _Tp __rhs); \
+ _Tp operator _Op(long __lhs, _Tp __rhs); \
+ _Tp operator _Op(unsigned long __lhs, _Tp __rhs); \
+ _Tp operator _Op(long long __lhs, _Tp __rhs); \
+ _Tp operator _Op(unsigned long long __lhs, _Tp __rhs);
+
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal32, decimal32, decimal32)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_INT(+, decimal32)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal64, decimal32, decimal64)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal64, decimal64, decimal32)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal64, decimal64, decimal64)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_INT(+, decimal64)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal32, decimal128)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal64, decimal128)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal128, decimal32)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal128, decimal64)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal128, decimal128)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_INT(+, decimal128)
+
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal32, decimal32, decimal32)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_INT(-, decimal32)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal64, decimal32, decimal64)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal64, decimal64, decimal32)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal64, decimal64, decimal64)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_INT(-, decimal64)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal32, decimal128)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal64, decimal128)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal128, decimal32)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal128, decimal64)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal128, decimal128)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_INT(-, decimal128)
+
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal32, decimal32, decimal32)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_INT(*, decimal32)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal64, decimal32, decimal64)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal64, decimal64, decimal32)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal64, decimal64, decimal64)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_INT(*, decimal64)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal32, decimal128)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal64, decimal128)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal128, decimal32)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal128, decimal64)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal128, decimal128)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_INT(*, decimal128)
+
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal32, decimal32, decimal32)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_INT(/, decimal32)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal64, decimal32, decimal64)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal64, decimal64, decimal32)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal64, decimal64, decimal64)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_INT(/, decimal64)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal32, decimal128)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal64, decimal128)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal128, decimal32)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal128, decimal64)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal128, decimal128)
+ _DECLARE_DECIMAL_BINARY_OP_WITH_INT(/, decimal128)
+
+#undef _DECLARE_DECIMAL_BINARY_OP_WITH_DEC
+#undef _DECLARE_DECIMAL_BINARY_OP_WITH_INT
+
+ // 3.2.9 Comparison operators.
+#define _DECLARE_DECIMAL_COMPARISON(_Op, _Tp) \
+ bool operator _Op(_Tp __lhs, decimal32 __rhs); \
+ bool operator _Op(_Tp __lhs, decimal64 __rhs); \
+ bool operator _Op(_Tp __lhs, decimal128 __rhs); \
+ bool operator _Op(_Tp __lhs, int __rhs); \
+ bool operator _Op(_Tp __lhs, unsigned int __rhs); \
+ bool operator _Op(_Tp __lhs, long __rhs); \
+ bool operator _Op(_Tp __lhs, unsigned long __rhs); \
+ bool operator _Op(_Tp __lhs, long long __rhs); \
+ bool operator _Op(_Tp __lhs, unsigned long long __rhs); \
+ bool operator _Op(int __lhs, _Tp __rhs); \
+ bool operator _Op(unsigned int __lhs, _Tp __rhs); \
+ bool operator _Op(long __lhs, _Tp __rhs); \
+ bool operator _Op(unsigned long __lhs, _Tp __rhs); \
+ bool operator _Op(long long __lhs, _Tp __rhs); \
+ bool operator _Op(unsigned long long __lhs, _Tp __rhs);
+
+ _DECLARE_DECIMAL_COMPARISON(==, decimal32)
+ _DECLARE_DECIMAL_COMPARISON(==, decimal64)
+ _DECLARE_DECIMAL_COMPARISON(==, decimal128)
+
+ _DECLARE_DECIMAL_COMPARISON(!=, decimal32)
+ _DECLARE_DECIMAL_COMPARISON(!=, decimal64)
+ _DECLARE_DECIMAL_COMPARISON(!=, decimal128)
+
+ _DECLARE_DECIMAL_COMPARISON(<, decimal32)
+ _DECLARE_DECIMAL_COMPARISON(<, decimal64)
+ _DECLARE_DECIMAL_COMPARISON(<, decimal128)
+
+ _DECLARE_DECIMAL_COMPARISON(>=, decimal32)
+ _DECLARE_DECIMAL_COMPARISON(>=, decimal64)
+ _DECLARE_DECIMAL_COMPARISON(>=, decimal128)
+
+ _DECLARE_DECIMAL_COMPARISON(>, decimal32)
+ _DECLARE_DECIMAL_COMPARISON(>, decimal64)
+ _DECLARE_DECIMAL_COMPARISON(>, decimal128)
+
+ _DECLARE_DECIMAL_COMPARISON(>=, decimal32)
+ _DECLARE_DECIMAL_COMPARISON(>=, decimal64)
+ _DECLARE_DECIMAL_COMPARISON(>=, decimal128)
+
+#undef _DECLARE_DECIMAL_COMPARISON
+
+ /// 3.2.2 Class decimal32.
+ class decimal32
+ {
+ public:
+ typedef float __decfloat32 __attribute__((mode(SD)));
+
+ // 3.2.2.2 Construct/copy/destroy.
+ decimal32() : __val(0.e-101DF) {}
+
+ // 3.2.2.3 Conversion from floating-point type.
+ explicit decimal32(decimal64 __d64);
+ explicit decimal32(decimal128 __d128);
+ explicit decimal32(float __r) : __val(__r) {}
+ explicit decimal32(double __r) : __val(__r) {}
+ explicit decimal32(long double __r) : __val(__r) {}
+
+ // 3.2.2.4 Conversion from integral type.
+ decimal32(int __z) : __val(__z) {}
+ decimal32(unsigned int __z) : __val(__z) {}
+ decimal32(long __z) : __val(__z) {}
+ decimal32(unsigned long __z) : __val(__z) {}
+ decimal32(long long __z) : __val(__z) {}
+ decimal32(unsigned long long __z) : __val(__z) {}
+
+ /// Conforming extension: Conversion from scalar decimal type.
+ decimal32(__decfloat32 __z) : __val(__z) {}
+
+ // 3.2.2.5 Conversion to integral type. (DISABLED)
+ //operator long long() const { return (long long)__val; }
+
+ // 3.2.2.6 Increment and decrement operators.
+ decimal32& operator++()
+ {
+ __val += 1;
+ return *this;
+ }
+
+ decimal32 operator++(int)
+ {
+ decimal32 __tmp = *this;
+ __val += 1;
+ return __tmp;
+ }
+
+ decimal32& operator--()
+ {
+ __val -= 1;
+ return *this;
+ }
+
+ decimal32 operator--(int)
+ {
+ decimal32 __tmp = *this;
+ __val -= 1;
+ return __tmp;
+ }
+
+ // 3.2.2.7 Compound assignment.
+#define _DECLARE_DECIMAL32_COMPOUND_ASSIGNMENT(_Op) \
+ decimal32& operator _Op(decimal32 __rhs); \
+ decimal32& operator _Op(decimal64 __rhs); \
+ decimal32& operator _Op(decimal128 __rhs); \
+ decimal32& operator _Op(int __rhs); \
+ decimal32& operator _Op(unsigned int __rhs); \
+ decimal32& operator _Op(long __rhs); \
+ decimal32& operator _Op(unsigned long __rhs); \
+ decimal32& operator _Op(long long __rhs); \
+ decimal32& operator _Op(unsigned long long __rhs);
+
+ _DECLARE_DECIMAL32_COMPOUND_ASSIGNMENT(+=)
+ _DECLARE_DECIMAL32_COMPOUND_ASSIGNMENT(-=)
+ _DECLARE_DECIMAL32_COMPOUND_ASSIGNMENT(*=)
+ _DECLARE_DECIMAL32_COMPOUND_ASSIGNMENT(/=)
+#undef _DECLARE_DECIMAL32_COMPOUND_ASSIGNMENT
+
+ private:
+ __decfloat32 __val;
+
+ public:
+ __decfloat32 __getval(void) { return __val; }
+ void __setval(__decfloat32 __x) { __val = __x; }
+ };
+
+ /// 3.2.3 Class decimal64.
+ class decimal64
+ {
+ public:
+ typedef float __decfloat64 __attribute__((mode(DD)));
+
+ // 3.2.3.2 Construct/copy/destroy.
+ decimal64() : __val(0.e-398dd) {}
+
+ // 3.2.3.3 Conversion from floating-point type.
+ decimal64(decimal32 d32);
+ explicit decimal64(decimal128 d128);
+ explicit decimal64(float __r) : __val(__r) {}
+ explicit decimal64(double __r) : __val(__r) {}
+ explicit decimal64(long double __r) : __val(__r) {}
+
+ // 3.2.3.4 Conversion from integral type.
+ decimal64(int __z) : __val(__z) {}
+ decimal64(unsigned int __z) : __val(__z) {}
+ decimal64(long __z) : __val(__z) {}
+ decimal64(unsigned long __z) : __val(__z) {}
+ decimal64(long long __z) : __val(__z) {}
+ decimal64(unsigned long long __z) : __val(__z) {}
+
+ /// Conforming extension: Conversion from scalar decimal type.
+ decimal64(__decfloat64 __z) : __val(__z) {}
+
+ // 3.2.3.5 Conversion to integral type. (DISABLED)
+ //operator long long() const { return (long long)__val; }
+
+ // 3.2.3.6 Increment and decrement operators.
+ decimal64& operator++()
+ {
+ __val += 1;
+ return *this;
+ }
+
+ decimal64 operator++(int)
+ {
+ decimal64 __tmp = *this;
+ __val += 1;
+ return __tmp;
+ }
+
+ decimal64& operator--()
+ {
+ __val -= 1;
+ return *this;
+ }
+
+ decimal64 operator--(int)
+ {
+ decimal64 __tmp = *this;
+ __val -= 1;
+ return __tmp;
+ }
+
+ // 3.2.3.7 Compound assignment.
+#define _DECLARE_DECIMAL64_COMPOUND_ASSIGNMENT(_Op) \
+ decimal64& operator _Op(decimal32 __rhs); \
+ decimal64& operator _Op(decimal64 __rhs); \
+ decimal64& operator _Op(decimal128 __rhs); \
+ decimal64& operator _Op(int __rhs); \
+ decimal64& operator _Op(unsigned int __rhs); \
+ decimal64& operator _Op(long __rhs); \
+ decimal64& operator _Op(unsigned long __rhs); \
+ decimal64& operator _Op(long long __rhs); \
+ decimal64& operator _Op(unsigned long long __rhs);
+
+ _DECLARE_DECIMAL64_COMPOUND_ASSIGNMENT(+=)
+ _DECLARE_DECIMAL64_COMPOUND_ASSIGNMENT(-=)
+ _DECLARE_DECIMAL64_COMPOUND_ASSIGNMENT(*=)
+ _DECLARE_DECIMAL64_COMPOUND_ASSIGNMENT(/=)
+#undef _DECLARE_DECIMAL64_COMPOUND_ASSIGNMENT
+
+ private:
+ __decfloat64 __val;
+
+ public:
+ __decfloat64 __getval(void) { return __val; }
+ void __setval(__decfloat64 __x) { __val = __x; }
+ };
+
+ /// 3.2.4 Class decimal128.
+ class decimal128
+ {
+ public:
+ typedef float __decfloat128 __attribute__((mode(TD)));
+
+ // 3.2.4.2 Construct/copy/destroy.
+ decimal128() : __val(0.e-6176DL) {}
+
+ // 3.2.4.3 Conversion from floating-point type.
+ decimal128(decimal32 d32);
+ decimal128(decimal64 d64);
+ explicit decimal128(float __r) : __val(__r) {}
+ explicit decimal128(double __r) : __val(__r) {}
+ explicit decimal128(long double __r) : __val(__r) {}
+
+
+ // 3.2.4.4 Conversion from integral type.
+ decimal128(int __z) : __val(__z) {}
+ decimal128(unsigned int __z) : __val(__z) {}
+ decimal128(long __z) : __val(__z) {}
+ decimal128(unsigned long __z) : __val(__z) {}
+ decimal128(long long __z) : __val(__z) {}
+ decimal128(unsigned long long __z) : __val(__z) {}
+
+ /// Conforming extension: Conversion from scalar decimal type.
+ decimal128(__decfloat128 __z) : __val(__z) {}
+
+ // 3.2.4.5 Conversion to integral type. (DISABLED)
+ //operator long long() const { return (long long)__val; }
+
+ // 3.2.4.6 Increment and decrement operators.
+ decimal128& operator++()
+ {
+ __val += 1;
+ return *this;
+ }
+
+ decimal128 operator++(int)
+ {
+ decimal128 __tmp = *this;
+ __val += 1;
+ return __tmp;
+ }
+
+ decimal128& operator--()
+ {
+ __val -= 1;
+ return *this;
+ }
+
+ decimal128 operator--(int)
+ {
+ decimal128 __tmp = *this;
+ __val -= 1;
+ return __tmp;
+ }
+
+ // 3.2.4.7 Compound assignment.
+#define _DECLARE_DECIMAL128_COMPOUND_ASSIGNMENT(_Op) \
+ decimal128& operator _Op(decimal32 __rhs); \
+ decimal128& operator _Op(decimal64 __rhs); \
+ decimal128& operator _Op(decimal128 __rhs); \
+ decimal128& operator _Op(int __rhs); \
+ decimal128& operator _Op(unsigned int __rhs); \
+ decimal128& operator _Op(long __rhs); \
+ decimal128& operator _Op(unsigned long __rhs); \
+ decimal128& operator _Op(long long __rhs); \
+ decimal128& operator _Op(unsigned long long __rhs);
+
+ _DECLARE_DECIMAL128_COMPOUND_ASSIGNMENT(+=)
+ _DECLARE_DECIMAL128_COMPOUND_ASSIGNMENT(-=)
+ _DECLARE_DECIMAL128_COMPOUND_ASSIGNMENT(*=)
+ _DECLARE_DECIMAL128_COMPOUND_ASSIGNMENT(/=)
+#undef _DECLARE_DECIMAL128_COMPOUND_ASSIGNMENT
+
+ private:
+ __decfloat128 __val;
+
+ public:
+ __decfloat128 __getval(void) { return __val; }
+ void __setval(__decfloat128 __x) { __val = __x; }
+ };
+
+#define _GLIBCXX_USE_DECIMAL_ 1
+
+} // namespace decimal
+ // @} group decimal
+} // namespace std
+
+#include <decimal/decimal.h>
+
+#endif /* _GLIBCXX_DECIMAL */
diff --git a/libstdc++-v3/include/decimal/decimal.h b/libstdc++-v3/include/decimal/decimal.h
new file mode 100644
index 00000000000..45a6fbc20a8
--- /dev/null
+++ b/libstdc++-v3/include/decimal/decimal.h
@@ -0,0 +1,466 @@
+// decimal classes -*- C++ -*-
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/decimal.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// ISO/IEC TR 24733
+// Written by Janis Johnson <janis187@us.ibm.com>
+
+#ifndef _GLIBCXX_DECIMAL_IMPL
+#define _GLIBCXX_DECIMAL_IMPL 1
+
+#pragma GCC system_header
+
+namespace std
+{
+namespace decimal
+{
+ // ISO/IEC TR 24733 3.2.[234].1 Construct/copy/destroy.
+
+ inline decimal32::decimal32(decimal64 __r) : __val(__r.__getval()) {}
+ inline decimal32::decimal32(decimal128 __r) : __val(__r.__getval()) {}
+ inline decimal64::decimal64(decimal32 __r) : __val(__r.__getval()) {}
+ inline decimal64::decimal64(decimal128 __r) : __val(__r.__getval()) {}
+ inline decimal128::decimal128(decimal32 __r) : __val(__r.__getval()) {}
+ inline decimal128::decimal128(decimal64 __r) : __val(__r.__getval()) {}
+
+ // ISO/IEC TR 24733 3.2.[234].6 Compound assignment.
+
+#define _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_DEC(_Op1, _Op2, _T1, _T2) \
+ inline _T1& _T1::operator _Op1(_T2 __rhs) \
+ { \
+ __setval(__getval() _Op2 __rhs.__getval()); \
+ return *this; \
+ }
+
+#define _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT(_Op1, _Op2, _T1, _T2) \
+ inline _T1& _T1::operator _Op1(_T2 __rhs) \
+ { \
+ __setval(__getval() _Op2 __rhs); \
+ return *this; \
+ }
+
+#define _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS(_Op1, _Op2, _T1) \
+ _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_DEC(_Op1, _Op2, _T1, decimal32) \
+ _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_DEC(_Op1, _Op2, _T1, decimal64) \
+ _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_DEC(_Op1, _Op2, _T1, decimal128) \
+ _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT(_Op1, _Op2, _T1, int) \
+ _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT(_Op1, _Op2, _T1, unsigned int) \
+ _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT(_Op1, _Op2, _T1, long) \
+ _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT(_Op1, _Op2, _T1, unsigned long)\
+ _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT(_Op1, _Op2, _T1, long long) \
+ _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT(_Op1, _Op2, _T1, unsigned long long)
+
+ _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS(+=, +, decimal32)
+ _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS(-=, -, decimal32)
+ _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS(*=, *, decimal32)
+ _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS(/=, /, decimal32)
+
+ _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS(+=, +, decimal64)
+ _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS(-=, -, decimal64)
+ _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS(*=, *, decimal64)
+ _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS(/=, /, decimal64)
+
+ _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS(+=, +, decimal128)
+ _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS(-=, -, decimal128)
+ _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS(*=, *, decimal128)
+ _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS(/=, /, decimal128)
+
+#undef _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_DEC
+#undef _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT
+#undef _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS
+
+ // Extension: Conversion to integral type.
+
+ inline long long decimal32_to_long_long(decimal32 __d)
+ { return (long long)__d.__getval(); }
+
+ inline long long decimal64_to_long_long(decimal64 __d)
+ { return (long long)__d.__getval(); }
+
+ inline long long decimal128_to_long_long(decimal128 __d)
+ { return (long long)__d.__getval(); }
+
+ inline long long decimal_to_long_long(decimal32 __d)
+ { return (long long)__d.__getval(); }
+
+ inline long long decimal_to_long_long(decimal64 __d)
+ { return (long long)__d.__getval(); }
+
+ inline long long decimal_to_long_long(decimal128 __d)
+ { return (long long)__d.__getval(); }
+
+ // ISO/IEC TR 24733 3.2.5 Initialization from coefficient and exponent.
+
+ static decimal32 make_decimal32(long long __coeff, int __exponent)
+ {
+ decimal32 __decexp = 1, __multiplier;
+
+ if (__exponent < 0)
+ {
+ __multiplier = 1.E-1DF;
+ __exponent = -__exponent;
+ }
+ else
+ __multiplier = 1.E1DF;
+
+ for (int __i = 0; __i < __exponent; ++__i)
+ __decexp *= __multiplier;
+
+ return __coeff * __decexp;
+ }
+
+ static decimal32 make_decimal32(unsigned long long __coeff, int __exponent)
+ {
+ decimal32 __decexp = 1, __multiplier;
+
+ if (__exponent < 0)
+ {
+ __multiplier = 1.E-1DF;
+ __exponent = -__exponent;
+ }
+ else
+ __multiplier = 1.E1DF;
+
+ for (int __i = 0; __i < __exponent; ++__i)
+ __decexp *= __multiplier;
+
+ return __coeff * __decexp;
+ }
+
+ static decimal64 make_decimal64(long long __coeff, int __exponent)
+ {
+ decimal64 __decexp = 1, __multiplier;
+
+ if (__exponent < 0)
+ {
+ __multiplier = 1.E-1DD;
+ __exponent = -__exponent;
+ }
+ else
+ __multiplier = 1.E1DD;
+
+ for (int __i = 0; __i < __exponent; ++__i)
+ __decexp *= __multiplier;
+
+ return __coeff * __decexp;
+ }
+
+ static decimal64 make_decimal64(unsigned long long __coeff, int __exponent)
+ {
+ decimal64 __decexp = 1, __multiplier;
+
+ if (__exponent < 0)
+ {
+ __multiplier = 1.E-1DD;
+ __exponent = -__exponent;
+ }
+ else
+ __multiplier = 1.E1DD;
+
+ for (int __i = 0; __i < __exponent; ++__i)
+ __decexp *= __multiplier;
+
+ return __coeff * __decexp;
+ }
+
+ static decimal128 make_decimal128(long long __coeff, int __exponent)
+ {
+ decimal128 __decexp = 1, __multiplier;
+
+ if (__exponent < 0)
+ {
+ __multiplier = 1.E-1DL;
+ __exponent = -__exponent;
+ }
+ else
+ __multiplier = 1.E1DL;
+
+ for (int __i = 0; __i < __exponent; ++__i)
+ __decexp *= __multiplier;
+
+ return __coeff * __decexp;
+ }
+
+ static decimal128 make_decimal128(unsigned long long __coeff, int __exponent)
+ {
+ decimal128 __decexp = 1, __multiplier;
+
+ if (__exponent < 0)
+ {
+ __multiplier = 1.E-1DL;
+ __exponent = -__exponent;
+ }
+ else
+ __multiplier = 1.E1DL;
+
+ for (int __i = 0; __i < __exponent; ++__i)
+ __decexp *= __multiplier;
+
+ return __coeff * __decexp;
+ }
+
+ // ISO/IEC TR 24733 3.2.6 Conversion to generic floating-point type.
+
+ inline float decimal32_to_float(decimal32 __d)
+ { return (float)__d.__getval(); }
+
+ inline float decimal64_to_float(decimal64 __d)
+ { return (float)__d.__getval(); }
+
+ inline float decimal128_to_float(decimal128 __d)
+ { return (float)__d.__getval(); }
+
+ inline float decimal_to_float(decimal32 __d)
+ { return (float)__d.__getval(); }
+
+ inline float decimal_to_float(decimal64 __d)
+ { return (float)__d.__getval(); }
+
+ inline float decimal_to_float(decimal128 __d)
+ { return (float)__d.__getval(); }
+
+ inline double decimal32_to_double(decimal32 __d)
+ { return (double)__d.__getval(); }
+
+ inline double decimal64_to_double(decimal64 __d)
+ { return (double)__d.__getval(); }
+
+ inline double decimal128_to_double(decimal128 __d)
+ { return (double)__d.__getval(); }
+
+ inline double decimal_to_double(decimal32 __d)
+ { return (double)__d.__getval(); }
+
+ inline double decimal_to_double(decimal64 __d)
+ { return (double)__d.__getval(); }
+
+ inline double decimal_to_double(decimal128 __d)
+ { return (double)__d.__getval(); }
+
+ inline long double decimal32_to_long_double(decimal32 __d)
+ { return (long double)__d.__getval(); }
+
+ inline long double decimal64_to_long_double(decimal64 __d)
+ { return (long double)__d.__getval(); }
+
+ inline long double decimal128_to_long_double(decimal128 __d)
+ { return (long double)__d.__getval(); }
+
+ inline long double decimal_to_long_double(decimal32 __d)
+ { return (long double)__d.__getval(); }
+
+ inline long double decimal_to_long_double(decimal64 __d)
+ { return (long double)__d.__getval(); }
+
+ inline long double decimal_to_long_double(decimal128 __d)
+ { return (long double)__d.__getval(); }
+
+ // ISO/IEC TR 24733 3.2.7 Unary arithmetic operators.
+
+#define _DEFINE_DECIMAL_UNARY_OP(_Op, _Tp) \
+ inline _Tp operator _Op(_Tp __rhs) \
+ { \
+ _Tp __tmp; \
+ __tmp.__setval(0 _Op __rhs.__getval()); \
+ return __tmp; \
+ }
+
+ _DEFINE_DECIMAL_UNARY_OP(+, decimal32)
+ _DEFINE_DECIMAL_UNARY_OP(+, decimal64)
+ _DEFINE_DECIMAL_UNARY_OP(+, decimal128)
+ _DEFINE_DECIMAL_UNARY_OP(-, decimal32)
+ _DEFINE_DECIMAL_UNARY_OP(-, decimal64)
+ _DEFINE_DECIMAL_UNARY_OP(-, decimal128)
+
+#undef _DEFINE_DECIMAL_UNARY_OP
+
+ // ISO/IEC TR 24733 3.2.8 Binary arithmetic operators.
+
+#define _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(_Op, _T1, _T2, _T3) \
+ inline _T1 operator _Op(_T2 __lhs, _T3 __rhs) \
+ { \
+ _T1 __retval; \
+ __retval.__setval(__lhs.__getval() _Op __rhs.__getval()); \
+ return __retval; \
+ }
+
+#define _DEFINE_DECIMAL_BINARY_OP_BOTH(_Op, _T1, _T2, _T3) \
+ inline _T1 operator _Op(_T2 __lhs, _T3 __rhs) \
+ { \
+ _T1 __retval; \
+ __retval.__setval(__lhs.__getval() _Op __rhs.__getval()); \
+ return __retval; \
+ }
+
+#define _DEFINE_DECIMAL_BINARY_OP_LHS(_Op, _T1, _T2) \
+ inline _T1 operator _Op(_T1 __lhs, _T2 __rhs) \
+ { \
+ _T1 __retval; \
+ __retval.__setval(__lhs.__getval() _Op __rhs); \
+ return __retval; \
+ }
+
+#define _DEFINE_DECIMAL_BINARY_OP_RHS(_Op, _T1, _T2) \
+ inline _T1 operator _Op(_T2 __lhs, _T1 __rhs) \
+ { \
+ _T1 __retval; \
+ __retval.__setval(__lhs _Op __rhs.__getval()); \
+ return __retval; \
+ }
+
+#define _DEFINE_DECIMAL_BINARY_OP_WITH_INT(_Op, _T1) \
+ _DEFINE_DECIMAL_BINARY_OP_LHS(_Op, _T1, int); \
+ _DEFINE_DECIMAL_BINARY_OP_LHS(_Op, _T1, unsigned int); \
+ _DEFINE_DECIMAL_BINARY_OP_LHS(_Op, _T1, long); \
+ _DEFINE_DECIMAL_BINARY_OP_LHS(_Op, _T1, unsigned long); \
+ _DEFINE_DECIMAL_BINARY_OP_LHS(_Op, _T1, long long); \
+ _DEFINE_DECIMAL_BINARY_OP_LHS(_Op, _T1, unsigned long long); \
+ _DEFINE_DECIMAL_BINARY_OP_RHS(_Op, _T1, int); \
+ _DEFINE_DECIMAL_BINARY_OP_RHS(_Op, _T1, unsigned int); \
+ _DEFINE_DECIMAL_BINARY_OP_RHS(_Op, _T1, long); \
+ _DEFINE_DECIMAL_BINARY_OP_RHS(_Op, _T1, unsigned long); \
+ _DEFINE_DECIMAL_BINARY_OP_RHS(_Op, _T1, long long); \
+ _DEFINE_DECIMAL_BINARY_OP_RHS(_Op, _T1, unsigned long long); \
+
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal32, decimal32, decimal32)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_INT(+, decimal32)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal64, decimal32, decimal64)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal64, decimal64, decimal32)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal64, decimal64, decimal64)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_INT(+, decimal64)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal32, decimal128)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal64, decimal128)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal128, decimal32)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal128, decimal64)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal128, decimal128)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_INT(+, decimal128)
+
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal32, decimal32, decimal32)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_INT(-, decimal32)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal64, decimal32, decimal64)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal64, decimal64, decimal32)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal64, decimal64, decimal64)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_INT(-, decimal64)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal32, decimal128)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal64, decimal128)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal128, decimal32)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal128, decimal64)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal128, decimal128)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_INT(-, decimal128)
+
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal32, decimal32, decimal32)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_INT(*, decimal32)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal64, decimal32, decimal64)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal64, decimal64, decimal32)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal64, decimal64, decimal64)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_INT(*, decimal64)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal32, decimal128)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal64, decimal128)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal128, decimal32)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal128, decimal64)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal128, decimal128)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_INT(*, decimal128)
+
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal32, decimal32, decimal32)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_INT(/, decimal32)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal64, decimal32, decimal64)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal64, decimal64, decimal32)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal64, decimal64, decimal64)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_INT(/, decimal64)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal32, decimal128)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal64, decimal128)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal128, decimal32)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal128, decimal64)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal128, decimal128)
+ _DEFINE_DECIMAL_BINARY_OP_WITH_INT(/, decimal128)
+
+#undef _DEFINE_DECIMAL_BINARY_OP_WITH_DEC
+#undef _DEFINE_DECIMAL_BINARY_OP_BOTH
+#undef _DEFINE_DECIMAL_BINARY_OP_LHS
+#undef _DEFINE_DECIMAL_BINARY_OP_RHS
+#undef _DEFINE_DECIMAL_BINARY_OP_WITH_INT
+
+ // ISO/IEC TR 24733 3.2.9 Comparison operators.
+
+#define _DEFINE_DECIMAL_COMPARISON_BOTH(_Op, _T1, _T2) \
+ inline bool operator _Op(_T1 __lhs, _T2 __rhs) \
+ { return __lhs.__getval() _Op __rhs.__getval(); }
+
+#define _DEFINE_DECIMAL_COMPARISON_LHS(_Op, _T1, _T2) \
+ inline bool operator _Op(_T1 __lhs, _T2 __rhs) \
+ { return __lhs.__getval() _Op __rhs; }
+
+#define _DEFINE_DECIMAL_COMPARISON_RHS(_Op, _T1, _T2) \
+ inline bool operator _Op(_T1 __lhs, _T2 __rhs) \
+ { return __lhs _Op __rhs.__getval(); }
+
+#define _DEFINE_DECIMAL_COMPARISONS(_Op, _Tp) \
+ _DEFINE_DECIMAL_COMPARISON_BOTH(_Op, _Tp, decimal32) \
+ _DEFINE_DECIMAL_COMPARISON_BOTH(_Op, _Tp, decimal64) \
+ _DEFINE_DECIMAL_COMPARISON_BOTH(_Op, _Tp, decimal128) \
+ _DEFINE_DECIMAL_COMPARISON_LHS(_Op, _Tp, int) \
+ _DEFINE_DECIMAL_COMPARISON_LHS(_Op, _Tp, unsigned int) \
+ _DEFINE_DECIMAL_COMPARISON_LHS(_Op, _Tp, long) \
+ _DEFINE_DECIMAL_COMPARISON_LHS(_Op, _Tp, unsigned long) \
+ _DEFINE_DECIMAL_COMPARISON_LHS(_Op, _Tp, long long) \
+ _DEFINE_DECIMAL_COMPARISON_LHS(_Op, _Tp, unsigned long long) \
+ _DEFINE_DECIMAL_COMPARISON_RHS(_Op, int, _Tp) \
+ _DEFINE_DECIMAL_COMPARISON_RHS(_Op, unsigned int, _Tp) \
+ _DEFINE_DECIMAL_COMPARISON_RHS(_Op, long, _Tp) \
+ _DEFINE_DECIMAL_COMPARISON_RHS(_Op, unsigned long, _Tp) \
+ _DEFINE_DECIMAL_COMPARISON_RHS(_Op, long long, _Tp) \
+ _DEFINE_DECIMAL_COMPARISON_RHS(_Op, unsigned long long, _Tp)
+
+ _DEFINE_DECIMAL_COMPARISONS(==, decimal32)
+ _DEFINE_DECIMAL_COMPARISONS(==, decimal64)
+ _DEFINE_DECIMAL_COMPARISONS(==, decimal128)
+ _DEFINE_DECIMAL_COMPARISONS(!=, decimal32)
+ _DEFINE_DECIMAL_COMPARISONS(!=, decimal64)
+ _DEFINE_DECIMAL_COMPARISONS(!=, decimal128)
+ _DEFINE_DECIMAL_COMPARISONS(<, decimal32)
+ _DEFINE_DECIMAL_COMPARISONS(<, decimal64)
+ _DEFINE_DECIMAL_COMPARISONS(<, decimal128)
+ _DEFINE_DECIMAL_COMPARISONS(<=, decimal32)
+ _DEFINE_DECIMAL_COMPARISONS(<=, decimal64)
+ _DEFINE_DECIMAL_COMPARISONS(<=, decimal128)
+ _DEFINE_DECIMAL_COMPARISONS(>, decimal32)
+ _DEFINE_DECIMAL_COMPARISONS(>, decimal64)
+ _DEFINE_DECIMAL_COMPARISONS(>, decimal128)
+ _DEFINE_DECIMAL_COMPARISONS(>=, decimal32)
+ _DEFINE_DECIMAL_COMPARISONS(>=, decimal64)
+ _DEFINE_DECIMAL_COMPARISONS(>=, decimal128)
+
+#undef _DEFINE_DECIMAL_COMPARISON_BOTH
+#undef _DEFINE_DECIMAL_COMPARISON_LHS
+#undef _DEFINE_DECIMAL_COMPARISON_RHS
+#undef _DEFINE_DECIMAL_COMPARISONS
+
+} // namespace decimal
+} // namespace std
+
+#endif /* _GLIBCXX_DECIMAL_IMPL */
diff --git a/libstdc++-v3/include/ext/bitmap_allocator.h b/libstdc++-v3/include/ext/bitmap_allocator.h
index f6790d00043..d91d9aa5cc6 100644
--- a/libstdc++-v3/include/ext/bitmap_allocator.h
+++ b/libstdc++-v3/include/ext/bitmap_allocator.h
@@ -104,20 +104,8 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
// insert(iterator, const_reference), erase(iterator),
// begin(), end(), back(), operator[].
- __mini_vector() : _M_start(0), _M_finish(0),
- _M_end_of_storage(0)
- { }
-
-#if 0
- ~__mini_vector()
- {
- if (this->_M_start)
- {
- this->deallocate(this->_M_start, this->_M_end_of_storage
- - this->_M_start);
- }
- }
-#endif
+ __mini_vector()
+ : _M_start(0), _M_finish(0), _M_end_of_storage(0) { }
size_type
size() const throw()
@@ -276,15 +264,6 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
return __first;
}
- template<typename _InputIterator, typename _Predicate>
- inline _InputIterator
- __find_if(_InputIterator __first, _InputIterator __last, _Predicate __p)
- {
- while (__first != __last && !__p(*__first))
- ++__first;
- return __first;
- }
-
/** @brief The number of Blocks pointed to by the address pair
* passed to the function.
*/
@@ -380,12 +359,10 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
// is equal to the number of Objects that the current Block can
// store, then there is definitely no space for another single
// object, so just return false.
- _Counter_type __diff =
- __gnu_cxx::__detail::__num_bitmaps(__bp);
+ _Counter_type __diff = __detail::__num_bitmaps(__bp);
if (*(reinterpret_cast<size_t*>
- (__bp.first) - (__diff + 1))
- == __gnu_cxx::__detail::__num_blocks(__bp))
+ (__bp.first) - (__diff + 1)) == __detail::__num_blocks(__bp))
return false;
size_t* __rover = reinterpret_cast<size_t*>(__bp.first) - 1;
@@ -402,7 +379,6 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
}
return false;
}
-
size_t*
_M_get() const throw()
@@ -413,7 +389,6 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
{ return _M_data_offset * size_t(bits_per_block); }
};
-
/** @class _Bitmap_counter bitmap_allocator.h bitmap_allocator.h
*
* @brief The bitmap counter which acts as the bitmap
@@ -424,11 +399,11 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
template<typename _Tp>
class _Bitmap_counter
{
- typedef typename __detail::__mini_vector<typename std::pair<_Tp, _Tp> >
- _BPVector;
+ typedef typename
+ __detail::__mini_vector<typename std::pair<_Tp, _Tp> > _BPVector;
typedef typename _BPVector::size_type _Index_type;
typedef _Tp pointer;
-
+
_BPVector& _M_vbp;
size_t* _M_curr_bmap;
size_t* _M_last_bmap_in_block;
@@ -613,7 +588,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
}
// Just add the block to the list of free lists unconditionally.
- iterator __temp = __gnu_cxx::__detail::__lower_bound
+ iterator __temp = __detail::__lower_bound
(__free_list.begin(), __free_list.end(),
*__addr, _LT_pointer_compare());
@@ -656,7 +631,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
_M_insert(size_t* __addr) throw()
{
#if defined __GTHREADS
- __gnu_cxx::__scoped_lock __bfl_lock(_M_get_mutex());
+ __scoped_lock __bfl_lock(_M_get_mutex());
#endif
// Call _M_validate to decide what should be done with
// this particular free list.
@@ -747,8 +722,18 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
typedef typename std::pair<_Alloc_block*, _Alloc_block*> _Block_pair;
- typedef typename
- __detail::__mini_vector<_Block_pair> _BPVector;
+ typedef typename __detail::__mini_vector<_Block_pair> _BPVector;
+ typedef typename _BPVector::iterator _BPiter;
+
+ template<typename _Predicate>
+ static _BPiter
+ _S_find(_Predicate __p)
+ {
+ _BPiter __first = _S_mem_blocks.begin();
+ while (__first != _S_mem_blocks.end() && !__p(*__first))
+ ++__first;
+ return __first;
+ }
#if defined _GLIBCXX_DEBUG
// Complexity: O(lg(N)). Where, N is the number of block of size
@@ -756,14 +741,8 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
void
_S_check_for_free_blocks() throw()
{
- typedef typename
- __gnu_cxx::__detail::_Ffit_finder<_Alloc_block*> _FFF;
- _FFF __fff;
- typedef typename _BPVector::iterator _BPiter;
- _BPiter __bpi =
- __gnu_cxx::__detail::__find_if
- (_S_mem_blocks.begin(), _S_mem_blocks.end(),
- __gnu_cxx::__detail::_Functor_Ref<_FFF>(__fff));
+ typedef typename __detail::_Ffit_finder<_Alloc_block*> _FFF;
+ _BPiter __bpi = _S_find(_FFF());
_GLIBCXX_DEBUG_ASSERT(__bpi == _S_mem_blocks.end());
}
@@ -793,9 +772,8 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+ _S_block_size * sizeof(_Alloc_block)
+ __num_bitmaps * sizeof(size_t);
- size_t* __temp =
- reinterpret_cast<size_t*>
- (this->_M_get(__size_to_allocate));
+ size_t* __temp =
+ reinterpret_cast<size_t*>(this->_M_get(__size_to_allocate));
*__temp = 0;
++__temp;
@@ -810,20 +788,15 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
// Fill the Vector with this information.
_S_mem_blocks.push_back(__bp);
- size_t __bit_mask = 0; // 0 Indicates all Allocated.
- __bit_mask = ~__bit_mask; // 1 Indicates all Free.
-
for (size_t __i = 0; __i < __num_bitmaps; ++__i)
- __temp[__i] = __bit_mask;
+ __temp[__i] = ~static_cast<size_t>(0); // 1 Indicates all Free.
_S_block_size *= 2;
}
-
static _BPVector _S_mem_blocks;
static size_t _S_block_size;
- static __gnu_cxx::__detail::
- _Bitmap_counter<_Alloc_block*> _S_last_request;
+ static __detail::_Bitmap_counter<_Alloc_block*> _S_last_request;
static typename _BPVector::size_type _S_last_dealloc_index;
#if defined __GTHREADS
static __mutex_type _S_mut;
@@ -848,7 +821,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
_M_allocate_single_object() throw(std::bad_alloc)
{
#if defined __GTHREADS
- __gnu_cxx::__scoped_lock __bit_lock(_S_mut);
+ __scoped_lock __bit_lock(_S_mut);
#endif
// The algorithm is something like this: The last_request
@@ -866,21 +839,14 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
// dereference if tinkered with.
while (_S_last_request._M_finished() == false
&& (*(_S_last_request._M_get()) == 0))
- {
- _S_last_request.operator++();
- }
+ _S_last_request.operator++();
if (__builtin_expect(_S_last_request._M_finished() == true, false))
{
// Fall Back to First Fit algorithm.
- typedef typename
- __gnu_cxx::__detail::_Ffit_finder<_Alloc_block*> _FFF;
+ typedef typename __detail::_Ffit_finder<_Alloc_block*> _FFF;
_FFF __fff;
- typedef typename _BPVector::iterator _BPiter;
- _BPiter __bpi =
- __gnu_cxx::__detail::__find_if
- (_S_mem_blocks.begin(), _S_mem_blocks.end(),
- __gnu_cxx::__detail::_Functor_Ref<_FFF>(__fff));
+ _BPiter __bpi = _S_find(__detail::_Functor_Ref<_FFF>(__fff));
if (__bpi != _S_mem_blocks.end())
{
@@ -897,8 +863,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
(__bpi->first + __fff._M_offset() + __nz_bit);
size_t* __puse_count =
reinterpret_cast<size_t*>
- (__bpi->first)
- - (__gnu_cxx::__detail::__num_bitmaps(*__bpi) + 1);
+ (__bpi->first) - (__detail::__num_bitmaps(*__bpi) + 1);
++(*__puse_count);
return __ret;
@@ -927,7 +892,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
size_t* __puse_count = reinterpret_cast<size_t*>
(_S_mem_blocks[_S_last_request._M_where()].first)
- - (__gnu_cxx::__detail::
+ - (__detail::
__num_bitmaps(_S_mem_blocks[_S_last_request._M_where()]) + 1);
++(*__puse_count);
@@ -946,7 +911,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
_M_deallocate_single_object(pointer __p) throw()
{
#if defined __GTHREADS
- __gnu_cxx::__scoped_lock __bit_lock(_S_mut);
+ __scoped_lock __bit_lock(_S_mut);
#endif
_Alloc_block* __real_p = reinterpret_cast<_Alloc_block*>(__p);
@@ -958,9 +923,8 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
_GLIBCXX_DEBUG_ASSERT(_S_last_dealloc_index >= 0);
-
- if (__gnu_cxx::__detail::_Inclusive_between<_Alloc_block*>
- (__real_p) (_S_mem_blocks[_S_last_dealloc_index]))
+ __detail::_Inclusive_between<_Alloc_block*> __ibt(__real_p);
+ if (__ibt(_S_mem_blocks[_S_last_dealloc_index]))
{
_GLIBCXX_DEBUG_ASSERT(_S_last_dealloc_index
<= _S_mem_blocks.size() - 1);
@@ -971,11 +935,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
}
else
{
- _Iterator _iter = __gnu_cxx::__detail::
- __find_if(_S_mem_blocks.begin(),
- _S_mem_blocks.end(),
- __gnu_cxx::__detail::
- _Inclusive_between<_Alloc_block*>(__real_p));
+ _Iterator _iter = _S_find(__ibt);
_GLIBCXX_DEBUG_ASSERT(_iter != _S_mem_blocks.end());
@@ -995,7 +955,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
__detail::__bit_free(__bitmapC, __rotate);
size_t* __puse_count = reinterpret_cast<size_t*>
(_S_mem_blocks[__diff].first)
- - (__gnu_cxx::__detail::__num_bitmaps(_S_mem_blocks[__diff]) + 1);
+ - (__detail::__num_bitmaps(_S_mem_blocks[__diff]) + 1);
_GLIBCXX_DEBUG_ASSERT(*__puse_count != 0);
@@ -1127,12 +1087,12 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
2 * size_t(__detail::bits_per_block);
template<typename _Tp>
- typename __gnu_cxx::bitmap_allocator<_Tp>::_BPVector::size_type
+ typename bitmap_allocator<_Tp>::_BPVector::size_type
bitmap_allocator<_Tp>::_S_last_dealloc_index = 0;
template<typename _Tp>
- __gnu_cxx::__detail::_Bitmap_counter
- <typename bitmap_allocator<_Tp>::_Alloc_block*>
+ __detail::_Bitmap_counter
+ <typename bitmap_allocator<_Tp>::_Alloc_block*>
bitmap_allocator<_Tp>::_S_last_request(_S_mem_blocks);
#if defined __GTHREADS
diff --git a/libstdc++-v3/include/parallel/balanced_quicksort.h b/libstdc++-v3/include/parallel/balanced_quicksort.h
index 85e4d699e26..f3ac555908f 100644
--- a/libstdc++-v3/include/parallel/balanced_quicksort.h
+++ b/libstdc++-v3/include/parallel/balanced_quicksort.h
@@ -57,436 +57,435 @@
namespace __gnu_parallel
{
-/** @brief Information local to one thread in the parallel quicksort run. */
-template<typename _RAIter>
- struct _QSBThreadLocal
- {
- typedef std::iterator_traits<_RAIter> _TraitsType;
- typedef typename _TraitsType::difference_type _DifferenceType;
-
- /** @brief Continuous part of the sequence, described by an
- iterator pair. */
- typedef std::pair<_RAIter, _RAIter> _Piece;
-
- /** @brief Initial piece to work on. */
- _Piece _M_initial;
-
- /** @brief Work-stealing queue. */
- _RestrictedBoundedConcurrentQueue<_Piece> _M_leftover_parts;
-
- /** @brief Number of threads involved in this algorithm. */
- _ThreadIndex _M_num_threads;
-
- /** @brief Pointer to a counter of elements left over to sort. */
- volatile _DifferenceType* _M_elements_leftover;
-
- /** @brief The complete sequence to sort. */
- _Piece _M_global;
-
- /** @brief Constructor.
- * @param __queue_size size of the work-stealing queue. */
- _QSBThreadLocal(int __queue_size) : _M_leftover_parts(__queue_size) { }
- };
-
-/** @brief Balanced quicksort divide step.
- * @param __begin Begin iterator of subsequence.
- * @param __end End iterator of subsequence.
- * @param __comp Comparator.
- * @param __num_threads Number of threads that are allowed to work on
- * this part.
- * @pre @__c (__end-__begin)>=1 */
-template<typename _RAIter, typename _Compare>
- typename std::iterator_traits<_RAIter>::difference_type
- __qsb_divide(_RAIter __begin, _RAIter __end,
- _Compare __comp, _ThreadIndex __num_threads)
- {
- _GLIBCXX_PARALLEL_ASSERT(__num_threads > 0);
-
- typedef std::iterator_traits<_RAIter> _TraitsType;
- typedef typename _TraitsType::value_type _ValueType;
- typedef typename _TraitsType::difference_type _DifferenceType;
-
- _RAIter __pivot_pos =
- __median_of_three_iterators(__begin, __begin + (__end - __begin) / 2,
- __end - 1, __comp);
+ /** @brief Information local to one thread in the parallel quicksort run. */
+ template<typename _RAIter>
+ struct _QSBThreadLocal
+ {
+ typedef std::iterator_traits<_RAIter> _TraitsType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
+
+ /** @brief Continuous part of the sequence, described by an
+ iterator pair. */
+ typedef std::pair<_RAIter, _RAIter> _Piece;
+
+ /** @brief Initial piece to work on. */
+ _Piece _M_initial;
+
+ /** @brief Work-stealing queue. */
+ _RestrictedBoundedConcurrentQueue<_Piece> _M_leftover_parts;
+
+ /** @brief Number of threads involved in this algorithm. */
+ _ThreadIndex _M_num_threads;
+
+ /** @brief Pointer to a counter of elements left over to sort. */
+ volatile _DifferenceType* _M_elements_leftover;
+
+ /** @brief The complete sequence to sort. */
+ _Piece _M_global;
+
+ /** @brief Constructor.
+ * @param __queue_size size of the work-stealing queue. */
+ _QSBThreadLocal(int __queue_size) : _M_leftover_parts(__queue_size) { }
+ };
+
+ /** @brief Balanced quicksort divide step.
+ * @param __begin Begin iterator of subsequence.
+ * @param __end End iterator of subsequence.
+ * @param __comp Comparator.
+ * @param __num_threads Number of threads that are allowed to work on
+ * this part.
+ * @pre @c (__end-__begin)>=1 */
+ template<typename _RAIter, typename _Compare>
+ typename std::iterator_traits<_RAIter>::difference_type
+ __qsb_divide(_RAIter __begin, _RAIter __end,
+ _Compare __comp, _ThreadIndex __num_threads)
+ {
+ _GLIBCXX_PARALLEL_ASSERT(__num_threads > 0);
+
+ typedef std::iterator_traits<_RAIter> _TraitsType;
+ typedef typename _TraitsType::value_type _ValueType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
+
+ _RAIter __pivot_pos =
+ __median_of_three_iterators(__begin, __begin + (__end - __begin) / 2,
+ __end - 1, __comp);
#if defined(_GLIBCXX_ASSERTIONS)
- // Must be in between somewhere.
- _DifferenceType __n = __end - __begin;
-
- _GLIBCXX_PARALLEL_ASSERT(
- (!__comp(*__pivot_pos, *__begin) &&
- !__comp(*(__begin + __n / 2), *__pivot_pos))
- || (!__comp(*__pivot_pos, *__begin) &&
- !__comp(*(__end - 1), *__pivot_pos))
- || (!__comp(*__pivot_pos, *(__begin + __n / 2)) &&
- !__comp(*__begin, *__pivot_pos))
- || (!__comp(*__pivot_pos, *(__begin + __n / 2)) &&
- !__comp(*(__end - 1), *__pivot_pos))
- || (!__comp(*__pivot_pos, *(__end - 1)) &&
- !__comp(*__begin, *__pivot_pos))
- || (!__comp(*__pivot_pos, *(__end - 1)) &&
- !__comp(*(__begin + __n / 2), *__pivot_pos)));
+ // Must be in between somewhere.
+ _DifferenceType __n = __end - __begin;
+
+ _GLIBCXX_PARALLEL_ASSERT((!__comp(*__pivot_pos, *__begin)
+ && !__comp(*(__begin + __n / 2),
+ *__pivot_pos))
+ || (!__comp(*__pivot_pos, *__begin)
+ && !__comp(*(__end - 1), *__pivot_pos))
+ || (!__comp(*__pivot_pos, *(__begin + __n / 2))
+ && !__comp(*__begin, *__pivot_pos))
+ || (!__comp(*__pivot_pos, *(__begin + __n / 2))
+ && !__comp(*(__end - 1), *__pivot_pos))
+ || (!__comp(*__pivot_pos, *(__end - 1))
+ && !__comp(*__begin, *__pivot_pos))
+ || (!__comp(*__pivot_pos, *(__end - 1))
+ && !__comp(*(__begin + __n / 2),
+ *__pivot_pos)));
#endif
- // Swap pivot value to end.
- if (__pivot_pos != (__end - 1))
- std::swap(*__pivot_pos, *(__end - 1));
- __pivot_pos = __end - 1;
+ // Swap pivot value to end.
+ if (__pivot_pos != (__end - 1))
+ std::swap(*__pivot_pos, *(__end - 1));
+ __pivot_pos = __end - 1;
- __gnu_parallel::binder2nd<_Compare, _ValueType, _ValueType, bool>
- __pred(__comp, *__pivot_pos);
+ __gnu_parallel::binder2nd<_Compare, _ValueType, _ValueType, bool>
+ __pred(__comp, *__pivot_pos);
- // Divide, returning __end - __begin - 1 in the worst case.
- _DifferenceType __split_pos = __parallel_partition(
- __begin, __end - 1, __pred, __num_threads);
+ // Divide, returning __end - __begin - 1 in the worst case.
+ _DifferenceType __split_pos = __parallel_partition(__begin, __end - 1,
+ __pred,
+ __num_threads);
- // Swap back pivot to middle.
- std::swap(*(__begin + __split_pos), *__pivot_pos);
- __pivot_pos = __begin + __split_pos;
+ // Swap back pivot to middle.
+ std::swap(*(__begin + __split_pos), *__pivot_pos);
+ __pivot_pos = __begin + __split_pos;
#if _GLIBCXX_ASSERTIONS
- _RAIter __r;
- for (__r = __begin; __r != __pivot_pos; ++__r)
- _GLIBCXX_PARALLEL_ASSERT(__comp(*__r, *__pivot_pos));
- for (; __r != __end; ++__r)
- _GLIBCXX_PARALLEL_ASSERT(!__comp(*__r, *__pivot_pos));
+ _RAIter __r;
+ for (__r = __begin; __r != __pivot_pos; ++__r)
+ _GLIBCXX_PARALLEL_ASSERT(__comp(*__r, *__pivot_pos));
+ for (; __r != __end; ++__r)
+ _GLIBCXX_PARALLEL_ASSERT(!__comp(*__r, *__pivot_pos));
#endif
- return __split_pos;
- }
-
-/** @brief Quicksort conquer step.
- * @param __tls Array of thread-local storages.
- * @param __begin Begin iterator of subsequence.
- * @param __end End iterator of subsequence.
- * @param __comp Comparator.
- * @param __iam Number of the thread processing this function.
- * @param __num_threads
- * Number of threads that are allowed to work on this part. */
-template<typename _RAIter, typename _Compare>
- void
- __qsb_conquer(_QSBThreadLocal<_RAIter>** __tls,
- _RAIter __begin, _RAIter __end,
- _Compare __comp,
- _ThreadIndex __iam, _ThreadIndex __num_threads,
- bool __parent_wait)
- {
- typedef std::iterator_traits<_RAIter> _TraitsType;
- typedef typename _TraitsType::value_type _ValueType;
- typedef typename _TraitsType::difference_type _DifferenceType;
-
- _DifferenceType __n = __end - __begin;
-
- if (__num_threads <= 1 || __n <= 1)
- {
- __tls[__iam]->_M_initial.first = __begin;
- __tls[__iam]->_M_initial.second = __end;
+ return __split_pos;
+ }
- __qsb_local_sort_with_helping(__tls, __comp, __iam, __parent_wait);
+ /** @brief Quicksort conquer step.
+ * @param __tls Array of thread-local storages.
+ * @param __begin Begin iterator of subsequence.
+ * @param __end End iterator of subsequence.
+ * @param __comp Comparator.
+ * @param __iam Number of the thread processing this function.
+ * @param __num_threads
+ * Number of threads that are allowed to work on this part. */
+ template<typename _RAIter, typename _Compare>
+ void
+ __qsb_conquer(_QSBThreadLocal<_RAIter>** __tls,
+ _RAIter __begin, _RAIter __end,
+ _Compare __comp,
+ _ThreadIndex __iam, _ThreadIndex __num_threads,
+ bool __parent_wait)
+ {
+ typedef std::iterator_traits<_RAIter> _TraitsType;
+ typedef typename _TraitsType::value_type _ValueType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
- return;
- }
+ _DifferenceType __n = __end - __begin;
+
+ if (__num_threads <= 1 || __n <= 1)
+ {
+ __tls[__iam]->_M_initial.first = __begin;
+ __tls[__iam]->_M_initial.second = __end;
+
+ __qsb_local_sort_with_helping(__tls, __comp, __iam, __parent_wait);
+
+ return;
+ }
- // Divide step.
- _DifferenceType __split_pos =
- __qsb_divide(__begin, __end, __comp, __num_threads);
+ // Divide step.
+ _DifferenceType __split_pos =
+ __qsb_divide(__begin, __end, __comp, __num_threads);
#if _GLIBCXX_ASSERTIONS
- _GLIBCXX_PARALLEL_ASSERT(0 <= __split_pos &&
- __split_pos < (__end - __begin));
+ _GLIBCXX_PARALLEL_ASSERT(0 <= __split_pos &&
+ __split_pos < (__end - __begin));
#endif
- _ThreadIndex __num_threads_leftside =
- std::max<_ThreadIndex>(1, std::min<_ThreadIndex>(
- __num_threads - 1, __split_pos * __num_threads / __n));
+ _ThreadIndex
+ __num_threads_leftside = std::max<_ThreadIndex>
+ (1, std::min<_ThreadIndex>(__num_threads - 1, __split_pos
+ * __num_threads / __n));
-# pragma omp atomic
- *__tls[__iam]->_M_elements_leftover -= (_DifferenceType)1;
+# pragma omp atomic
+ *__tls[__iam]->_M_elements_leftover -= (_DifferenceType)1;
- // Conquer step.
-# pragma omp parallel num_threads(2)
- {
- bool __wait;
- if(omp_get_num_threads() < 2)
- __wait = false;
- else
- __wait = __parent_wait;
-
-# pragma omp sections
- {
+ // Conquer step.
+# pragma omp parallel num_threads(2)
+ {
+ bool __wait;
+ if(omp_get_num_threads() < 2)
+ __wait = false;
+ else
+ __wait = __parent_wait;
+
+# pragma omp sections
+ {
# pragma omp section
- {
- __qsb_conquer(__tls, __begin, __begin + __split_pos, __comp,
- __iam,
- __num_threads_leftside,
- __wait);
- __wait = __parent_wait;
- }
- // The pivot_pos is left in place, to ensure termination.
+ {
+ __qsb_conquer(__tls, __begin, __begin + __split_pos, __comp,
+ __iam, __num_threads_leftside, __wait);
+ __wait = __parent_wait;
+ }
+ // The pivot_pos is left in place, to ensure termination.
# pragma omp section
- {
- __qsb_conquer(__tls, __begin + __split_pos + 1, __end, __comp,
- __iam + __num_threads_leftside,
- __num_threads - __num_threads_leftside,
- __wait);
- __wait = __parent_wait;
- }
- }
+ {
+ __qsb_conquer(__tls, __begin + __split_pos + 1, __end, __comp,
+ __iam + __num_threads_leftside,
+ __num_threads - __num_threads_leftside, __wait);
+ __wait = __parent_wait;
+ }
+ }
+ }
}
- }
-
-/**
- * @brief Quicksort step doing load-balanced local sort.
- * @param __tls Array of thread-local storages.
- * @param __comp Comparator.
- * @param __iam Number of the thread processing this function.
- */
-template<typename _RAIter, typename _Compare>
- void
- __qsb_local_sort_with_helping(_QSBThreadLocal<_RAIter>** __tls,
- _Compare& __comp, int __iam, bool __wait)
- {
- typedef std::iterator_traits<_RAIter> _TraitsType;
- typedef typename _TraitsType::value_type _ValueType;
- typedef typename _TraitsType::difference_type _DifferenceType;
- typedef std::pair<_RAIter, _RAIter> _Piece;
-
- _QSBThreadLocal<_RAIter>& __tl = *__tls[__iam];
-
- _DifferenceType __base_case_n =
- _Settings::get().sort_qsb_base_case_maximal_n;
- if (__base_case_n < 2)
- __base_case_n = 2;
- _ThreadIndex __num_threads = __tl._M_num_threads;
-
- // Every thread has its own random number generator.
- _RandomNumber __rng(__iam + 1);
-
- _Piece __current = __tl._M_initial;
-
- _DifferenceType __elements_done = 0;
+
+ /**
+ * @brief Quicksort step doing load-balanced local sort.
+ * @param __tls Array of thread-local storages.
+ * @param __comp Comparator.
+ * @param __iam Number of the thread processing this function.
+ */
+ template<typename _RAIter, typename _Compare>
+ void
+ __qsb_local_sort_with_helping(_QSBThreadLocal<_RAIter>** __tls,
+ _Compare& __comp, int __iam, bool __wait)
+ {
+ typedef std::iterator_traits<_RAIter> _TraitsType;
+ typedef typename _TraitsType::value_type _ValueType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
+ typedef std::pair<_RAIter, _RAIter> _Piece;
+
+ _QSBThreadLocal<_RAIter>& __tl = *__tls[__iam];
+
+ _DifferenceType
+ __base_case_n = _Settings::get().sort_qsb_base_case_maximal_n;
+ if (__base_case_n < 2)
+ __base_case_n = 2;
+ _ThreadIndex __num_threads = __tl._M_num_threads;
+
+ // Every thread has its own random number generator.
+ _RandomNumber __rng(__iam + 1);
+
+ _Piece __current = __tl._M_initial;
+
+ _DifferenceType __elements_done = 0;
#if _GLIBCXX_ASSERTIONS
- _DifferenceType __total_elements_done = 0;
+ _DifferenceType __total_elements_done = 0;
#endif
- for (;;)
- {
- // Invariant: __current must be a valid (maybe empty) range.
- _RAIter __begin = __current.first, __end = __current.second;
- _DifferenceType __n = __end - __begin;
-
- if (__n > __base_case_n)
- {
- // Divide.
- _RAIter __pivot_pos = __begin + __rng(__n);
-
- // Swap __pivot_pos value to end.
- if (__pivot_pos != (__end - 1))
- std::swap(*__pivot_pos, *(__end - 1));
- __pivot_pos = __end - 1;
-
- __gnu_parallel::binder2nd
- <_Compare, _ValueType, _ValueType, bool>
- __pred(__comp, *__pivot_pos);
-
- // Divide, leave pivot unchanged in last place.
- _RAIter __split_pos1, __split_pos2;
- __split_pos1 =
- __gnu_sequential::partition(__begin, __end - 1, __pred);
-
- // Left side: < __pivot_pos; __right side: >= __pivot_pos.
+ for (;;)
+ {
+ // Invariant: __current must be a valid (maybe empty) range.
+ _RAIter __begin = __current.first, __end = __current.second;
+ _DifferenceType __n = __end - __begin;
+
+ if (__n > __base_case_n)
+ {
+ // Divide.
+ _RAIter __pivot_pos = __begin + __rng(__n);
+
+ // Swap __pivot_pos value to end.
+ if (__pivot_pos != (__end - 1))
+ std::swap(*__pivot_pos, *(__end - 1));
+ __pivot_pos = __end - 1;
+
+ __gnu_parallel::binder2nd
+ <_Compare, _ValueType, _ValueType, bool>
+ __pred(__comp, *__pivot_pos);
+
+ // Divide, leave pivot unchanged in last place.
+ _RAIter __split_pos1, __split_pos2;
+ __split_pos1 = __gnu_sequential::partition(__begin, __end - 1,
+ __pred);
+
+ // Left side: < __pivot_pos; __right side: >= __pivot_pos.
#if _GLIBCXX_ASSERTIONS
- _GLIBCXX_PARALLEL_ASSERT(__begin <= __split_pos1
- && __split_pos1 < __end);
+ _GLIBCXX_PARALLEL_ASSERT(__begin <= __split_pos1
+ && __split_pos1 < __end);
#endif
- // Swap pivot back to middle.
- if (__split_pos1 != __pivot_pos)
- std::swap(*__split_pos1, *__pivot_pos);
- __pivot_pos = __split_pos1;
-
- // In case all elements are equal, __split_pos1 == 0.
- if ((__split_pos1 + 1 - __begin) < (__n >> 7)
- || (__end - __split_pos1) < (__n >> 7))
- {
- // Very unequal split, one part smaller than one 128th
- // elements not strictly larger than the pivot.
- __gnu_parallel::__unary_negate<__gnu_parallel::__binder1st
- <_Compare, _ValueType, _ValueType, bool>, _ValueType>
- __pred(__gnu_parallel::__binder1st
- <_Compare, _ValueType, _ValueType, bool>(
- __comp, *__pivot_pos));
-
- // Find other end of pivot-equal range.
- __split_pos2 = __gnu_sequential::partition(__split_pos1 + 1,
- __end, __pred);
- }
- else
- // Only skip the pivot.
- __split_pos2 = __split_pos1 + 1;
-
- // Elements equal to pivot are done.
- __elements_done += (__split_pos2 - __split_pos1);
+ // Swap pivot back to middle.
+ if (__split_pos1 != __pivot_pos)
+ std::swap(*__split_pos1, *__pivot_pos);
+ __pivot_pos = __split_pos1;
+
+ // In case all elements are equal, __split_pos1 == 0.
+ if ((__split_pos1 + 1 - __begin) < (__n >> 7)
+ || (__end - __split_pos1) < (__n >> 7))
+ {
+ // Very unequal split, one part smaller than one 128th
+ // elements not strictly larger than the pivot.
+ __gnu_parallel::__unary_negate<__gnu_parallel::__binder1st
+ <_Compare, _ValueType, _ValueType, bool>, _ValueType>
+ __pred(__gnu_parallel::__binder1st
+ <_Compare, _ValueType, _ValueType, bool>
+ (__comp, *__pivot_pos));
+
+ // Find other end of pivot-equal range.
+ __split_pos2 = __gnu_sequential::partition(__split_pos1 + 1,
+ __end, __pred);
+ }
+ else
+ // Only skip the pivot.
+ __split_pos2 = __split_pos1 + 1;
+
+ // Elements equal to pivot are done.
+ __elements_done += (__split_pos2 - __split_pos1);
#if _GLIBCXX_ASSERTIONS
- __total_elements_done += (__split_pos2 - __split_pos1);
+ __total_elements_done += (__split_pos2 - __split_pos1);
#endif
- // Always push larger part onto stack.
- if (((__split_pos1 + 1) - __begin) < (__end - (__split_pos2)))
- {
- // Right side larger.
- if ((__split_pos2) != __end)
- __tl._M_leftover_parts.push_front(
- std::make_pair(__split_pos2, __end));
-
- //__current.first = __begin; //already set anyway
- __current.second = __split_pos1;
- continue;
- }
- else
- {
- // Left side larger.
- if (__begin != __split_pos1)
- __tl._M_leftover_parts.push_front(std::make_pair(__begin,
- __split_pos1));
-
- __current.first = __split_pos2;
- //__current.second = __end; //already set anyway
- continue;
- }
- }
- else
- {
- __gnu_sequential::sort(__begin, __end, __comp);
- __elements_done += __n;
+ // Always push larger part onto stack.
+ if (((__split_pos1 + 1) - __begin) < (__end - (__split_pos2)))
+ {
+ // Right side larger.
+ if ((__split_pos2) != __end)
+ __tl._M_leftover_parts.push_front
+ (std::make_pair(__split_pos2, __end));
+
+ //__current.first = __begin; //already set anyway
+ __current.second = __split_pos1;
+ continue;
+ }
+ else
+ {
+ // Left side larger.
+ if (__begin != __split_pos1)
+ __tl._M_leftover_parts.push_front(std::make_pair
+ (__begin, __split_pos1));
+
+ __current.first = __split_pos2;
+ //__current.second = __end; //already set anyway
+ continue;
+ }
+ }
+ else
+ {
+ __gnu_sequential::sort(__begin, __end, __comp);
+ __elements_done += __n;
#if _GLIBCXX_ASSERTIONS
- __total_elements_done += __n;
+ __total_elements_done += __n;
#endif
- // Prefer own stack, small pieces.
- if (__tl._M_leftover_parts.pop_front(__current))
- continue;
+ // Prefer own stack, small pieces.
+ if (__tl._M_leftover_parts.pop_front(__current))
+ continue;
-# pragma omp atomic
- *__tl._M_elements_leftover -= __elements_done;
+# pragma omp atomic
+ *__tl._M_elements_leftover -= __elements_done;
- __elements_done = 0;
+ __elements_done = 0;
#if _GLIBCXX_ASSERTIONS
- double __search_start = omp_get_wtime();
+ double __search_start = omp_get_wtime();
#endif
- // Look for new work.
- bool __successfully_stolen = false;
- while (__wait && *__tl._M_elements_leftover > 0
- && !__successfully_stolen
+ // Look for new work.
+ bool __successfully_stolen = false;
+ while (__wait && *__tl._M_elements_leftover > 0
+ && !__successfully_stolen
#if _GLIBCXX_ASSERTIONS
- // Possible dead-lock.
- && (omp_get_wtime() < (__search_start + 1.0))
+ // Possible dead-lock.
+ && (omp_get_wtime() < (__search_start + 1.0))
#endif
- )
- {
- _ThreadIndex __victim;
- __victim = __rng(__num_threads);
-
- // Large pieces.
- __successfully_stolen = (__victim != __iam)
- && __tls[__victim]->_M_leftover_parts.pop_back(__current);
- if (!__successfully_stolen)
- __yield();
+ )
+ {
+ _ThreadIndex __victim;
+ __victim = __rng(__num_threads);
+
+ // Large pieces.
+ __successfully_stolen = (__victim != __iam)
+ && __tls[__victim]->_M_leftover_parts.pop_back(__current);
+ if (!__successfully_stolen)
+ __yield();
#if !defined(__ICC) && !defined(__ECC)
-# pragma omp flush
+# pragma omp flush
#endif
- }
+ }
#if _GLIBCXX_ASSERTIONS
- if (omp_get_wtime() >= (__search_start + 1.0))
- {
- sleep(1);
- _GLIBCXX_PARALLEL_ASSERT(omp_get_wtime()
- < (__search_start + 1.0));
- }
+ if (omp_get_wtime() >= (__search_start + 1.0))
+ {
+ sleep(1);
+ _GLIBCXX_PARALLEL_ASSERT(omp_get_wtime()
+ < (__search_start + 1.0));
+ }
#endif
- if (!__successfully_stolen)
- {
+ if (!__successfully_stolen)
+ {
#if _GLIBCXX_ASSERTIONS
- _GLIBCXX_PARALLEL_ASSERT(*__tl._M_elements_leftover == 0);
+ _GLIBCXX_PARALLEL_ASSERT(*__tl._M_elements_leftover == 0);
#endif
- return;
- }
- }
- }
- }
-
-/** @brief Top-level quicksort routine.
- * @param __begin Begin iterator of sequence.
- * @param __end End iterator of sequence.
- * @param __comp Comparator.
- * @param __num_threads Number of threads that are allowed to work on
- * this part.
- */
-template<typename _RAIter, typename _Compare>
- void
- __parallel_sort_qsb(_RAIter __begin, _RAIter __end,
- _Compare __comp,
- _ThreadIndex __num_threads)
- {
- _GLIBCXX_CALL(__end - __begin)
-
- typedef std::iterator_traits<_RAIter> _TraitsType;
- typedef typename _TraitsType::value_type _ValueType;
- typedef typename _TraitsType::difference_type _DifferenceType;
- typedef std::pair<_RAIter, _RAIter> _Piece;
-
- typedef _QSBThreadLocal<_RAIter> _TLSType;
-
- _DifferenceType __n = __end - __begin;
-
- if (__n <= 1)
- return;
-
- // At least one element per processor.
- if (__num_threads > __n)
- __num_threads = static_cast<_ThreadIndex>(__n);
-
- // Initialize thread local storage
- _TLSType** __tls = new _TLSType*[__num_threads];
- _DifferenceType __queue_size =
- __num_threads * (_ThreadIndex)(log2(__n) + 1);
- for (_ThreadIndex __t = 0; __t < __num_threads; ++__t)
- __tls[__t] = new _QSBThreadLocal<_RAIter>(__queue_size);
-
- // There can never be more than ceil(log2(__n)) ranges on the stack,
- // because
- // 1. Only one processor pushes onto the stack
- // 2. The largest range has at most length __n
- // 3. Each range is larger than half of the range remaining
- volatile _DifferenceType _M_elements_leftover = __n;
- for (int __i = 0; __i < __num_threads; ++__i)
- {
- __tls[__i]->_M_elements_leftover = &_M_elements_leftover;
- __tls[__i]->_M_num_threads = __num_threads;
- __tls[__i]->_M_global = std::make_pair(__begin, __end);
-
- // Just in case nothing is left to assign.
- __tls[__i]->_M_initial = std::make_pair(__end, __end);
- }
+ return;
+ }
+ }
+ }
+ }
- // Main recursion call.
- __qsb_conquer(
- __tls, __begin, __begin + __n, __comp, 0, __num_threads, true);
+ /** @brief Top-level quicksort routine.
+ * @param __begin Begin iterator of sequence.
+ * @param __end End iterator of sequence.
+ * @param __comp Comparator.
+ * @param __num_threads Number of threads that are allowed to work on
+ * this part.
+ */
+ template<typename _RAIter, typename _Compare>
+ void
+ __parallel_sort_qsb(_RAIter __begin, _RAIter __end,
+ _Compare __comp, _ThreadIndex __num_threads)
+ {
+ _GLIBCXX_CALL(__end - __begin)
+
+ typedef std::iterator_traits<_RAIter> _TraitsType;
+ typedef typename _TraitsType::value_type _ValueType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
+ typedef std::pair<_RAIter, _RAIter> _Piece;
+
+ typedef _QSBThreadLocal<_RAIter> _TLSType;
+
+ _DifferenceType __n = __end - __begin;
+
+ if (__n <= 1)
+ return;
+
+ // At least one element per processor.
+ if (__num_threads > __n)
+ __num_threads = static_cast<_ThreadIndex>(__n);
+
+ // Initialize thread local storage
+ _TLSType** __tls = new _TLSType*[__num_threads];
+ _DifferenceType __queue_size = (__num_threads
+ * (_ThreadIndex)(__rd_log2(__n) + 1));
+ for (_ThreadIndex __t = 0; __t < __num_threads; ++__t)
+ __tls[__t] = new _QSBThreadLocal<_RAIter>(__queue_size);
+
+ // There can never be more than ceil(__rd_log2(__n)) ranges on the
+ // stack, because
+ // 1. Only one processor pushes onto the stack
+ // 2. The largest range has at most length __n
+ // 3. Each range is larger than half of the range remaining
+ volatile _DifferenceType __elements_leftover = __n;
+ for (int __i = 0; __i < __num_threads; ++__i)
+ {
+ __tls[__i]->_M_elements_leftover = &__elements_leftover;
+ __tls[__i]->_M_num_threads = __num_threads;
+ __tls[__i]->_M_global = std::make_pair(__begin, __end);
+
+ // Just in case nothing is left to assign.
+ __tls[__i]->_M_initial = std::make_pair(__end, __end);
+ }
+
+ // Main recursion call.
+ __qsb_conquer(__tls, __begin, __begin + __n, __comp, 0,
+ __num_threads, true);
#if _GLIBCXX_ASSERTIONS
- // All stack must be empty.
- _Piece __dummy;
- for (int __i = 1; __i < __num_threads; ++__i)
- _GLIBCXX_PARALLEL_ASSERT(
- !__tls[__i]->_M_leftover_parts.pop_back(__dummy));
+ // All stack must be empty.
+ _Piece __dummy;
+ for (int __i = 1; __i < __num_threads; ++__i)
+ _GLIBCXX_PARALLEL_ASSERT(
+ !__tls[__i]->_M_leftover_parts.pop_back(__dummy));
#endif
- for (int __i = 0; __i < __num_threads; ++__i)
- delete __tls[__i];
- delete[] __tls;
- }
+ for (int __i = 0; __i < __num_threads; ++__i)
+ delete __tls[__i];
+ delete[] __tls;
+ }
} // namespace __gnu_parallel
#endif /* _GLIBCXX_PARALLEL_BALANCED_QUICKSORT_H */
diff --git a/libstdc++-v3/include/parallel/base.h b/libstdc++-v3/include/parallel/base.h
index 6bdcedc206a..87d5752441a 100644
--- a/libstdc++-v3/include/parallel/base.h
+++ b/libstdc++-v3/include/parallel/base.h
@@ -93,13 +93,13 @@ namespace __gnu_parallel
__is_parallel(const _Parallelism __p) { return __p != sequential; }
-/** @brief Calculates the rounded-down logarithm of @__c __n for base 2.
- * @param __n Argument.
- * @return Returns 0 for any argument <1.
- */
-template<typename _Size>
- inline _Size
- __rd_log2(_Size __n)
+ /** @brief Calculates the rounded-down logarithm of @c __n for base 2.
+ * @param __n Argument.
+ * @return Returns 0 for any argument <1.
+ */
+ template<typename _Size>
+ inline _Size
+ __rd_log2(_Size __n)
{
_Size __k;
for (__k = 0; __n > 1; __n >>= 1)
@@ -107,356 +107,352 @@ template<typename _Size>
return __k;
}
-/** @brief Encode two integers into one gnu_parallel::_CASable.
- * @param __a First integer, to be encoded in the most-significant @__c
- * _CASable_bits/2 bits.
- * @param __b Second integer, to be encoded in the least-significant
- * @__c _CASable_bits/2 bits.
- * @return value encoding @__c __a and @__c __b.
- * @see decode2
- */
-inline _CASable
-__encode2(int __a, int __b) //must all be non-negative, actually
-{
- return (((_CASable)__a) << (_CASable_bits / 2)) | (((_CASable)__b) << 0);
-}
-
-/** @brief Decode two integers from one gnu_parallel::_CASable.
- * @param __x __gnu_parallel::_CASable to decode integers from.
- * @param __a First integer, to be decoded from the most-significant
- * @__c _CASable_bits/2 bits of @__c __x.
- * @param __b Second integer, to be encoded in the least-significant
- * @__c _CASable_bits/2 bits of @__c __x.
- * @see __encode2
- */
-inline void
-decode2(_CASable __x, int& __a, int& __b)
-{
- __a = (int)((__x >> (_CASable_bits / 2)) & _CASable_mask);
- __b = (int)((__x >> 0 ) & _CASable_mask);
-}
-
-//needed for parallel "numeric", even if "algorithm" not included
-
-/** @brief Equivalent to std::min. */
-template<typename _Tp>
- const _Tp&
- min(const _Tp& __a, const _Tp& __b)
- { return (__a < __b) ? __a : __b; }
-
-/** @brief Equivalent to std::max. */
-template<typename _Tp>
- const _Tp&
- max(const _Tp& __a, const _Tp& __b)
- { return (__a > __b) ? __a : __b; }
-
-/** @brief Constructs predicate for equality from strict weak
- * ordering predicate
- */
-template<typename _T1, typename _T2, typename _Compare>
- class _EqualFromLess : public std::binary_function<_T1, _T2, bool>
+ /** @brief Encode two integers into one gnu_parallel::_CASable.
+ * @param __a First integer, to be encoded in the most-significant @c
+ * _CASable_bits/2 bits.
+ * @param __b Second integer, to be encoded in the least-significant
+ * @c _CASable_bits/2 bits.
+ * @return value encoding @c __a and @c __b.
+ * @see decode2
+ */
+ inline _CASable
+ __encode2(int __a, int __b) //must all be non-negative, actually
{
- private:
- _Compare& _M_comp;
+ return (((_CASable)__a) << (_CASable_bits / 2)) | (((_CASable)__b) << 0);
+ }
- public:
- _EqualFromLess(_Compare& __comp) : _M_comp(__comp) { }
+ /** @brief Decode two integers from one gnu_parallel::_CASable.
+ * @param __x __gnu_parallel::_CASable to decode integers from.
+ * @param __a First integer, to be decoded from the most-significant
+ * @c _CASable_bits/2 bits of @c __x.
+ * @param __b Second integer, to be encoded in the least-significant
+ * @c _CASable_bits/2 bits of @c __x.
+ * @see __encode2
+ */
+ inline void
+ decode2(_CASable __x, int& __a, int& __b)
+ {
+ __a = (int)((__x >> (_CASable_bits / 2)) & _CASable_mask);
+ __b = (int)((__x >> 0 ) & _CASable_mask);
+ }
- bool operator()(const _T1& __a, const _T2& __b)
- {
- return !_M_comp(__a, __b) && !_M_comp(__b, __a);
- }
- };
+ //needed for parallel "numeric", even if "algorithm" not included
+ /** @brief Equivalent to std::min. */
+ template<typename _Tp>
+ const _Tp&
+ min(const _Tp& __a, const _Tp& __b)
+ { return (__a < __b) ? __a : __b; }
-/** @brief Similar to std::binder1st,
- * but giving the argument types explicitly. */
-template<typename _Predicate, typename argument_type>
- class __unary_negate
- : public std::unary_function<argument_type, bool>
- {
- protected:
- _Predicate _M_pred;
-
- public:
- explicit
- __unary_negate(const _Predicate& __x) : _M_pred(__x) { }
-
- bool
- operator()(const argument_type& __x)
- { return !_M_pred(__x); }
- };
-
-/** @brief Similar to std::binder1st,
- * but giving the argument types explicitly. */
-template<typename _Operation, typename _FirstArgumentType,
- typename _SecondArgumentType, typename _ResultType>
- class __binder1st
- : public std::unary_function<_SecondArgumentType, _ResultType>
- {
- protected:
- _Operation _M_op;
- _FirstArgumentType _M_value;
-
- public:
- __binder1st(const _Operation& __x,
- const _FirstArgumentType& __y)
- : _M_op(__x), _M_value(__y) { }
-
- _ResultType
- operator()(const _SecondArgumentType& __x)
- { return _M_op(_M_value, __x); }
-
- // _GLIBCXX_RESOLVE_LIB_DEFECTS
- // 109. Missing binders for non-const sequence elements
- _ResultType
- operator()(_SecondArgumentType& __x) const
- { return _M_op(_M_value, __x); }
- };
+ /** @brief Equivalent to std::max. */
+ template<typename _Tp>
+ const _Tp&
+ max(const _Tp& __a, const _Tp& __b)
+ { return (__a > __b) ? __a : __b; }
+
+ /** @brief Constructs predicate for equality from strict weak
+ * ordering predicate
+ */
+ template<typename _T1, typename _T2, typename _Compare>
+ class _EqualFromLess : public std::binary_function<_T1, _T2, bool>
+ {
+ private:
+ _Compare& _M_comp;
-/**
- * @brief Similar to std::binder2nd, but giving the argument types
- * explicitly.
- */
-template<typename _Operation, typename _FirstArgumentType,
- typename _SecondArgumentType, typename _ResultType>
- class binder2nd
- : public std::unary_function<_FirstArgumentType, _ResultType>
- {
- protected:
- _Operation _M_op;
- _SecondArgumentType _M_value;
-
- public:
- binder2nd(const _Operation& __x,
- const _SecondArgumentType& __y)
- : _M_op(__x), _M_value(__y) { }
-
- _ResultType
- operator()(const _FirstArgumentType& __x) const
- { return _M_op(__x, _M_value); }
-
- // _GLIBCXX_RESOLVE_LIB_DEFECTS
- // 109. Missing binders for non-const sequence elements
- _ResultType
- operator()(_FirstArgumentType& __x)
- { return _M_op(__x, _M_value); }
- };
-
-/** @brief Similar to std::equal_to, but allows two different types. */
-template<typename _T1, typename _T2>
- struct _EqualTo : std::binary_function<_T1, _T2, bool>
- {
- bool operator()(const _T1& __t1, const _T2& __t2) const
- { return __t1 == __t2; }
- };
+ public:
+ _EqualFromLess(_Compare& __comp) : _M_comp(__comp) { }
-/** @brief Similar to std::less, but allows two different types. */
-template<typename _T1, typename _T2>
- struct _Less : std::binary_function<_T1, _T2, bool>
- {
- bool
- operator()(const _T1& __t1, const _T2& __t2) const
- { return __t1 < __t2; }
-
- bool
- operator()(const _T2& __t2, const _T1& __t1) const
- { return __t2 < __t1; }
- };
-
-// Partial specialization for one type. Same as std::less.
-template<typename _Tp>
-struct _Less<_Tp, _Tp> : public std::binary_function<_Tp, _Tp, bool>
- {
- bool
- operator()(const _Tp& __x, const _Tp& __y) const
- { return __x < __y; }
- };
+ bool operator()(const _T1& __a, const _T2& __b)
+ { return !_M_comp(__a, __b) && !_M_comp(__b, __a); }
+ };
- /** @brief Similar to std::plus, but allows two different types. */
-template<typename _Tp1, typename _Tp2>
- struct _Plus : public std::binary_function<_Tp1, _Tp2, _Tp1>
- {
- typedef __typeof__(*static_cast<_Tp1*>(NULL)
- + *static_cast<_Tp2*>(NULL)) __result;
+ /** @brief Similar to std::binder1st,
+ * but giving the argument types explicitly. */
+ template<typename _Predicate, typename argument_type>
+ class __unary_negate
+ : public std::unary_function<argument_type, bool>
+ {
+ protected:
+ _Predicate _M_pred;
+
+ public:
+ explicit
+ __unary_negate(const _Predicate& __x) : _M_pred(__x) { }
+
+ bool
+ operator()(const argument_type& __x)
+ { return !_M_pred(__x); }
+ };
+
+ /** @brief Similar to std::binder1st,
+ * but giving the argument types explicitly. */
+ template<typename _Operation, typename _FirstArgumentType,
+ typename _SecondArgumentType, typename _ResultType>
+ class __binder1st
+ : public std::unary_function<_SecondArgumentType, _ResultType>
+ {
+ protected:
+ _Operation _M_op;
+ _FirstArgumentType _M_value;
+
+ public:
+ __binder1st(const _Operation& __x, const _FirstArgumentType& __y)
+ : _M_op(__x), _M_value(__y) { }
+
+ _ResultType
+ operator()(const _SecondArgumentType& __x)
+ { return _M_op(_M_value, __x); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 109. Missing binders for non-const sequence elements
+ _ResultType
+ operator()(_SecondArgumentType& __x) const
+ { return _M_op(_M_value, __x); }
+ };
+
+ /**
+ * @brief Similar to std::binder2nd, but giving the argument types
+ * explicitly.
+ */
+ template<typename _Operation, typename _FirstArgumentType,
+ typename _SecondArgumentType, typename _ResultType>
+ class binder2nd
+ : public std::unary_function<_FirstArgumentType, _ResultType>
+ {
+ protected:
+ _Operation _M_op;
+ _SecondArgumentType _M_value;
+
+ public:
+ binder2nd(const _Operation& __x, const _SecondArgumentType& __y)
+ : _M_op(__x), _M_value(__y) { }
+
+ _ResultType
+ operator()(const _FirstArgumentType& __x) const
+ { return _M_op(__x, _M_value); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 109. Missing binders for non-const sequence elements
+ _ResultType
+ operator()(_FirstArgumentType& __x)
+ { return _M_op(__x, _M_value); }
+ };
+
+ /** @brief Similar to std::equal_to, but allows two different types. */
+ template<typename _T1, typename _T2>
+ struct _EqualTo : std::binary_function<_T1, _T2, bool>
+ {
+ bool operator()(const _T1& __t1, const _T2& __t2) const
+ { return __t1 == __t2; }
+ };
- __result
- operator()(const _Tp1& __x, const _Tp2& __y) const
- { return __x + __y; }
- };
+ /** @brief Similar to std::less, but allows two different types. */
+ template<typename _T1, typename _T2>
+ struct _Less : std::binary_function<_T1, _T2, bool>
+ {
+ bool
+ operator()(const _T1& __t1, const _T2& __t2) const
+ { return __t1 < __t2; }
+
+ bool
+ operator()(const _T2& __t2, const _T1& __t1) const
+ { return __t2 < __t1; }
+ };
+
+ // Partial specialization for one type. Same as std::less.
+ template<typename _Tp>
+ struct _Less<_Tp, _Tp> : public std::binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x < __y; }
+ };
-// Partial specialization for one type. Same as std::plus.
-template<typename _Tp>
- struct _Plus<_Tp, _Tp> : public std::binary_function<_Tp, _Tp, _Tp>
- {
- typedef __typeof__(*static_cast<_Tp*>(NULL)
- + *static_cast<_Tp*>(NULL)) __result;
- __result
- operator()(const _Tp& __x, const _Tp& __y) const
- { return __x + __y; }
- };
+ /** @brief Similar to std::plus, but allows two different types. */
+ template<typename _Tp1, typename _Tp2>
+ struct _Plus : public std::binary_function<_Tp1, _Tp2, _Tp1>
+ {
+ typedef __typeof__(*static_cast<_Tp1*>(NULL)
+ + *static_cast<_Tp2*>(NULL)) __result;
+ __result
+ operator()(const _Tp1& __x, const _Tp2& __y) const
+ { return __x + __y; }
+ };
-/** @brief Similar to std::multiplies, but allows two different types. */
-template<typename _Tp1, typename _Tp2>
- struct _Multiplies : public std::binary_function<_Tp1, _Tp2, _Tp1>
- {
- typedef __typeof__(*static_cast<_Tp1*>(NULL)
- * *static_cast<_Tp2*>(NULL)) __result;
+ // Partial specialization for one type. Same as std::plus.
+ template<typename _Tp>
+ struct _Plus<_Tp, _Tp> : public std::binary_function<_Tp, _Tp, _Tp>
+ {
+ typedef __typeof__(*static_cast<_Tp*>(NULL)
+ + *static_cast<_Tp*>(NULL)) __result;
- __result
- operator()(const _Tp1& __x, const _Tp2& __y) const
- { return __x * __y; }
- };
+ __result
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x + __y; }
+ };
-// Partial specialization for one type. Same as std::multiplies.
-template<typename _Tp>
- struct _Multiplies<_Tp, _Tp> : public std::binary_function<_Tp, _Tp, _Tp>
- {
- typedef __typeof__(*static_cast<_Tp*>(NULL)
- * *static_cast<_Tp*>(NULL)) __result;
- __result
- operator()(const _Tp& __x, const _Tp& __y) const
- { return __x * __y; }
- };
+ /** @brief Similar to std::multiplies, but allows two different types. */
+ template<typename _Tp1, typename _Tp2>
+ struct _Multiplies : public std::binary_function<_Tp1, _Tp2, _Tp1>
+ {
+ typedef __typeof__(*static_cast<_Tp1*>(NULL)
+ * *static_cast<_Tp2*>(NULL)) __result;
+ __result
+ operator()(const _Tp1& __x, const _Tp2& __y) const
+ { return __x * __y; }
+ };
-template<typename _Tp, typename _DifferenceTp>
- class _PseudoSequence;
+ // Partial specialization for one type. Same as std::multiplies.
+ template<typename _Tp>
+ struct _Multiplies<_Tp, _Tp> : public std::binary_function<_Tp, _Tp, _Tp>
+ {
+ typedef __typeof__(*static_cast<_Tp*>(NULL)
+ * *static_cast<_Tp*>(NULL)) __result;
-/** @brief _Iterator associated with __gnu_parallel::_PseudoSequence.
- * If features the usual random-access iterator functionality.
- * @param _Tp Sequence _M_value type.
- * @param _DifferenceType Sequence difference type.
- */
-template<typename _Tp, typename _DifferenceTp>
- class _PseudoSequenceIterator
- {
- public:
- typedef _DifferenceTp _DifferenceType;
+ __result
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x * __y; }
+ };
- private:
- const _Tp& _M_val;
- _DifferenceType _M_pos;
- public:
- _PseudoSequenceIterator(const _Tp& _M_val, _DifferenceType _M_pos)
- : _M_val(_M_val), _M_pos(_M_pos) { }
+ template<typename _Tp, typename _DifferenceTp>
+ class _PseudoSequence;
- // Pre-increment operator.
- _PseudoSequenceIterator&
- operator++()
+ /** @brief _Iterator associated with __gnu_parallel::_PseudoSequence.
+ * If features the usual random-access iterator functionality.
+ * @param _Tp Sequence _M_value type.
+ * @param _DifferenceType Sequence difference type.
+ */
+ template<typename _Tp, typename _DifferenceTp>
+ class _PseudoSequenceIterator
{
- ++_M_pos;
- return *this;
- }
+ public:
+ typedef _DifferenceTp _DifferenceType;
- // Post-increment operator.
- const _PseudoSequenceIterator
- operator++(int)
- { return _PseudoSequenceIterator(_M_pos++); }
+ private:
+ const _Tp& _M_val;
+ _DifferenceType _M_pos;
- const _Tp&
- operator*() const
- { return _M_val; }
+ public:
+ _PseudoSequenceIterator(const _Tp& __val, _DifferenceType __pos)
+ : _M_val(__val), _M_pos(__pos) { }
- const _Tp&
- operator[](_DifferenceType) const
- { return _M_val; }
-
- bool
- operator==(const _PseudoSequenceIterator& __i2)
- { return _M_pos == __i2._M_pos; }
-
- _DifferenceType
- operator!=(const _PseudoSequenceIterator& __i2)
- { return _M_pos != __i2._M_pos; }
-
- _DifferenceType
- operator-(const _PseudoSequenceIterator& __i2)
- { return _M_pos - __i2._M_pos; }
- };
-
-/** @brief Sequence that conceptually consists of multiple copies of
- the same element.
- * The copies are not stored explicitly, of course.
- * @param _Tp Sequence _M_value type.
- * @param _DifferenceType Sequence difference type.
- */
-template<typename _Tp, typename _DifferenceTp>
- class _PseudoSequence
- {
- public:
- typedef _DifferenceTp _DifferenceType;
-
- // Better cast down to uint64_t, than up to _DifferenceTp.
- typedef _PseudoSequenceIterator<_Tp, uint64_t> iterator;
+ // Pre-increment operator.
+ _PseudoSequenceIterator&
+ operator++()
+ {
+ ++_M_pos;
+ return *this;
+ }
- /** @brief Constructor.
- * @param _M_val Element of the sequence.
- * @param __count Number of (virtual) copies.
+ // Post-increment operator.
+ const _PseudoSequenceIterator
+ operator++(int)
+ { return _PseudoSequenceIterator(_M_pos++); }
+
+ const _Tp&
+ operator*() const
+ { return _M_val; }
+
+ const _Tp&
+ operator[](_DifferenceType) const
+ { return _M_val; }
+
+ bool
+ operator==(const _PseudoSequenceIterator& __i2)
+ { return _M_pos == __i2._M_pos; }
+
+ _DifferenceType
+ operator!=(const _PseudoSequenceIterator& __i2)
+ { return _M_pos != __i2._M_pos; }
+
+ _DifferenceType
+ operator-(const _PseudoSequenceIterator& __i2)
+ { return _M_pos - __i2._M_pos; }
+ };
+
+ /** @brief Sequence that conceptually consists of multiple copies of
+ the same element.
+ * The copies are not stored explicitly, of course.
+ * @param _Tp Sequence _M_value type.
+ * @param _DifferenceType Sequence difference type.
*/
- _PseudoSequence(const _Tp& _M_val, _DifferenceType __count)
- : _M_val(_M_val), __count(__count) { }
-
- /** @brief Begin iterator. */
- iterator
- begin() const
- { return iterator(_M_val, 0); }
-
- /** @brief End iterator. */
- iterator
- end() const
- { return iterator(_M_val, __count); }
-
- private:
- const _Tp& _M_val;
- _DifferenceType __count;
- };
-
-/** @brief Functor that does nothing */
-template<typename _ValueTp>
- class _VoidFunctor
- {
- inline void
- operator()(const _ValueTp& __v) const { }
- };
-
-/** @brief Compute the median of three referenced elements,
- according to @__c __comp.
- * @param __a First iterator.
- * @param __b Second iterator.
- * @param __c Third iterator.
- * @param __comp Comparator.
- */
-template<typename _RAIter, typename _Compare>
- _RAIter
- __median_of_three_iterators(_RAIter __a, _RAIter __b,
- _RAIter __c, _Compare& __comp)
- {
- if (__comp(*__a, *__b))
- if (__comp(*__b, *__c))
- return __b;
+ template<typename _Tp, typename _DifferenceTp>
+ class _PseudoSequence
+ {
+ public:
+ typedef _DifferenceTp _DifferenceType;
+
+ // Better cast down to uint64_t, than up to _DifferenceTp.
+ typedef _PseudoSequenceIterator<_Tp, uint64_t> iterator;
+
+ /** @brief Constructor.
+ * @param _M_val Element of the sequence.
+ * @param __count Number of (virtual) copies.
+ */
+ _PseudoSequence(const _Tp& __val, _DifferenceType __count)
+ : _M_val(__val), _M_count(__count) { }
+
+ /** @brief Begin iterator. */
+ iterator
+ begin() const
+ { return iterator(_M_val, 0); }
+
+ /** @brief End iterator. */
+ iterator
+ end() const
+ { return iterator(_M_val, _M_count); }
+
+ private:
+ const _Tp& _M_val;
+ _DifferenceType _M_count;
+ };
+
+ /** @brief Functor that does nothing */
+ template<typename _ValueTp>
+ class _VoidFunctor
+ {
+ inline void
+ operator()(const _ValueTp& __v) const { }
+ };
+
+ /** @brief Compute the median of three referenced elements,
+ according to @c __comp.
+ * @param __a First iterator.
+ * @param __b Second iterator.
+ * @param __c Third iterator.
+ * @param __comp Comparator.
+ */
+ template<typename _RAIter, typename _Compare>
+ _RAIter
+ __median_of_three_iterators(_RAIter __a, _RAIter __b,
+ _RAIter __c, _Compare& __comp)
+ {
+ if (__comp(*__a, *__b))
+ if (__comp(*__b, *__c))
+ return __b;
+ else
+ if (__comp(*__a, *__c))
+ return __c;
+ else
+ return __a;
else
- if (__comp(*__a, *__c))
- return __c;
- else
- return __a;
- else
- {
- // Just swap __a and __b.
- if (__comp(*__a, *__c))
- return __a;
- else
- if (__comp(*__b, *__c))
- return __c;
- else
- return __b;
- }
- }
+ {
+ // Just swap __a and __b.
+ if (__comp(*__a, *__c))
+ return __a;
+ else
+ if (__comp(*__b, *__c))
+ return __c;
+ else
+ return __b;
+ }
+ }
#define _GLIBCXX_PARALLEL_ASSERT(_Condition) __glibcxx_assert(_Condition)
diff --git a/libstdc++-v3/include/parallel/checkers.h b/libstdc++-v3/include/parallel/checkers.h
index 70cc949e3fe..2a977acedf4 100644
--- a/libstdc++-v3/include/parallel/checkers.h
+++ b/libstdc++-v3/include/parallel/checkers.h
@@ -39,12 +39,12 @@
namespace __gnu_parallel
{
/**
- * @brief Check whether @__c [__begin, @__c __end) is sorted according
- * to @__c __comp.
+ * @brief Check whether @c [__begin, @c __end) is sorted according
+ * to @c __comp.
* @param __begin Begin iterator of sequence.
* @param __end End iterator of sequence.
* @param __comp Comparator.
- * @return @__c true if sorted, @__c false otherwise.
+ * @return @c true if sorted, @c false otherwise.
*/
template<typename _IIter, typename _Compare>
bool
@@ -68,5 +68,6 @@ namespace __gnu_parallel
return true;
}
+}
#endif /* _GLIBCXX_PARALLEL_CHECKERS_H */
diff --git a/libstdc++-v3/include/parallel/compatibility.h b/libstdc++-v3/include/parallel/compatibility.h
index c4f691e5b77..688a7cf348f 100644
--- a/libstdc++-v3/include/parallel/compatibility.h
+++ b/libstdc++-v3/include/parallel/compatibility.h
@@ -227,8 +227,8 @@ namespace __gnu_parallel
#endif
- /** @brief Compare @__c *__ptr and @__c __comparand. If equal, let @__c
- * *__ptr=__replacement and return @__c true, return @__c false otherwise.
+ /** @brief Compare @c *__ptr and @c __comparand. If equal, let @c
+ * *__ptr=__replacement and return @c true, return @c false otherwise.
*
* Implementation is heavily platform-dependent.
* @param __ptr Pointer to 32-bit signed integer.
@@ -270,8 +270,8 @@ namespace __gnu_parallel
#endif
}
- /** @brief Compare @__c *__ptr and @__c __comparand. If equal, let @__c
- * *__ptr=__replacement and return @__c true, return @__c false otherwise.
+ /** @brief Compare @c *__ptr and @c __comparand. If equal, let @c
+ * *__ptr=__replacement and return @c true, return @c false otherwise.
*
* Implementation is heavily platform-dependent.
* @param __ptr Pointer to 64-bit signed integer.
@@ -323,8 +323,8 @@ namespace __gnu_parallel
#endif
}
- /** @brief Compare @__c *__ptr and @__c __comparand. If equal, let @__c
- * *__ptr=__replacement and return @__c true, return @__c false otherwise.
+ /** @brief Compare @c *__ptr and @c __comparand. If equal, let @c
+ * *__ptr=__replacement and return @c true, return @c false otherwise.
*
* Implementation is heavily platform-dependent.
* @param __ptr Pointer to signed integer.
diff --git a/libstdc++-v3/include/parallel/equally_split.h b/libstdc++-v3/include/parallel/equally_split.h
index 31ed87d16f3..481c9886840 100644
--- a/libstdc++-v3/include/parallel/equally_split.h
+++ b/libstdc++-v3/include/parallel/equally_split.h
@@ -1,6 +1,6 @@
// -*- C++ -*-
-// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -33,57 +33,56 @@
namespace __gnu_parallel
{
-/** @brief function to split a sequence into parts of almost equal size.
- *
- * The resulting sequence __s of length __num_threads+1 contains the splitting
- * positions when splitting the range [0,__n) into parts of almost
- * equal size (plus minus 1). The first entry is 0, the last one
-* n. There may result empty parts.
- * @param __n Number of elements
- * @param __num_threads Number of parts
- * @param __s Splitters
- * @returns End of __splitter sequence, i.e. @__c __s+__num_threads+1 */
-template<typename _DifferenceType, typename _OutputIterator>
- _OutputIterator
- equally_split(_DifferenceType __n, _ThreadIndex __num_threads,
- _OutputIterator __s)
- {
- _DifferenceType __chunk_length = __n / __num_threads;
- _DifferenceType __num_longer_chunks = __n % __num_threads;
- _DifferenceType __pos = 0;
- for (_ThreadIndex __i = 0; __i < __num_threads; ++__i)
- {
- *__s++ = __pos;
- __pos += (__i < __num_longer_chunks) ?
- (__chunk_length + 1) : __chunk_length;
- }
- *__s++ = __n;
- return __s;
- }
+ /** @brief function to split a sequence into parts of almost equal size.
+ *
+ * The resulting sequence __s of length __num_threads+1 contains the
+ * splitting positions when splitting the range [0,__n) into parts of
+ * almost equal size (plus minus 1). The first entry is 0, the last
+ * one n. There may result empty parts.
+ * @param __n Number of elements
+ * @param __num_threads Number of parts
+ * @param __s Splitters
+ * @returns End of __splitter sequence, i.e. @c __s+__num_threads+1 */
+ template<typename _DifferenceType, typename _OutputIterator>
+ _OutputIterator
+ equally_split(_DifferenceType __n, _ThreadIndex __num_threads,
+ _OutputIterator __s)
+ {
+ _DifferenceType __chunk_length = __n / __num_threads;
+ _DifferenceType __num_longer_chunks = __n % __num_threads;
+ _DifferenceType __pos = 0;
+ for (_ThreadIndex __i = 0; __i < __num_threads; ++__i)
+ {
+ *__s++ = __pos;
+ __pos += ((__i < __num_longer_chunks)
+ ? (__chunk_length + 1) : __chunk_length);
+ }
+ *__s++ = __n;
+ return __s;
+ }
-
-/** @brief function to split a sequence into parts of almost equal size.
- *
- * Returns the position of the splitting point between
- * thread number __thread_no (included) and
- * thread number __thread_no+1 (excluded).
- * @param __n Number of elements
- * @param __num_threads Number of parts
- * @returns splitting point */
-template<typename _DifferenceType>
- _DifferenceType
- equally_split_point(_DifferenceType __n,
- _ThreadIndex __num_threads,
- _ThreadIndex __thread_no)
- {
- _DifferenceType __chunk_length = __n / __num_threads;
- _DifferenceType __num_longer_chunks = __n % __num_threads;
- if (__thread_no < __num_longer_chunks)
- return __thread_no * (__chunk_length + 1);
- else
- return __num_longer_chunks * (__chunk_length + 1)
+ /** @brief function to split a sequence into parts of almost equal size.
+ *
+ * Returns the position of the splitting point between
+ * thread number __thread_no (included) and
+ * thread number __thread_no+1 (excluded).
+ * @param __n Number of elements
+ * @param __num_threads Number of parts
+ * @returns splitting point */
+ template<typename _DifferenceType>
+ _DifferenceType
+ equally_split_point(_DifferenceType __n,
+ _ThreadIndex __num_threads,
+ _ThreadIndex __thread_no)
+ {
+ _DifferenceType __chunk_length = __n / __num_threads;
+ _DifferenceType __num_longer_chunks = __n % __num_threads;
+ if (__thread_no < __num_longer_chunks)
+ return __thread_no * (__chunk_length + 1);
+ else
+ return __num_longer_chunks * (__chunk_length + 1)
+ (__thread_no - __num_longer_chunks) * __chunk_length;
- }
+ }
}
#endif /* _GLIBCXX_PARALLEL_EQUALLY_SPLIT_H */
diff --git a/libstdc++-v3/include/parallel/find.h b/libstdc++-v3/include/parallel/find.h
index 050a80d8af0..b4e581488ae 100644
--- a/libstdc++-v3/include/parallel/find.h
+++ b/libstdc++-v3/include/parallel/find.h
@@ -42,360 +42,363 @@
namespace __gnu_parallel
{
-/**
- * @brief Parallel std::find, switch for different algorithms.
- * @param __begin1 Begin iterator of first sequence.
- * @param __end1 End iterator of first sequence.
- * @param __begin2 Begin iterator of second sequence. Must have same
- * length as first sequence.
- * @param __pred Find predicate.
- * @param __selector _Functionality (e. g. std::find_if (), std::equal(),...)
- * @return Place of finding in both sequences.
- */
-template<typename _RAIter1,
- typename _RAIter2,
- typename _Pred,
- typename _Selector>
- inline std::pair<_RAIter1, _RAIter2>
- __find_template(_RAIter1 __begin1, _RAIter1 __end1,
- _RAIter2 __begin2, _Pred __pred, _Selector __selector)
- {
- switch (_Settings::get().find_algorithm)
- {
- case GROWING_BLOCKS:
- return __find_template(__begin1, __end1, __begin2, __pred, __selector,
- growing_blocks_tag());
- case CONSTANT_SIZE_BLOCKS:
- return __find_template(__begin1, __end1, __begin2, __pred, __selector,
- constant_size_blocks_tag());
- case EQUAL_SPLIT:
- return __find_template(__begin1, __end1, __begin2, __pred, __selector,
- equal_split_tag());
- default:
- _GLIBCXX_PARALLEL_ASSERT(false);
- return std::make_pair(__begin1, __begin2);
- }
- }
+ /**
+ * @brief Parallel std::find, switch for different algorithms.
+ * @param __begin1 Begin iterator of first sequence.
+ * @param __end1 End iterator of first sequence.
+ * @param __begin2 Begin iterator of second sequence. Must have same
+ * length as first sequence.
+ * @param __pred Find predicate.
+ * @param __selector _Functionality (e. g. std::find_if(), std::equal(),...)
+ * @return Place of finding in both sequences.
+ */
+ template<typename _RAIter1,
+ typename _RAIter2,
+ typename _Pred,
+ typename _Selector>
+ inline std::pair<_RAIter1, _RAIter2>
+ __find_template(_RAIter1 __begin1, _RAIter1 __end1,
+ _RAIter2 __begin2, _Pred __pred, _Selector __selector)
+ {
+ switch (_Settings::get().find_algorithm)
+ {
+ case GROWING_BLOCKS:
+ return __find_template(__begin1, __end1, __begin2, __pred,
+ __selector, growing_blocks_tag());
+ case CONSTANT_SIZE_BLOCKS:
+ return __find_template(__begin1, __end1, __begin2, __pred,
+ __selector, constant_size_blocks_tag());
+ case EQUAL_SPLIT:
+ return __find_template(__begin1, __end1, __begin2, __pred,
+ __selector, equal_split_tag());
+ default:
+ _GLIBCXX_PARALLEL_ASSERT(false);
+ return std::make_pair(__begin1, __begin2);
+ }
+ }
#if _GLIBCXX_FIND_EQUAL_SPLIT
-/**
- * @brief Parallel std::find, equal splitting variant.
- * @param __begin1 Begin iterator of first sequence.
- * @param __end1 End iterator of first sequence.
- * @param __begin2 Begin iterator of second sequence. Second __sequence
- * must have same length as first sequence.
- * @param __pred Find predicate.
- * @param __selector _Functionality (e. g. std::find_if (), std::equal(),...)
- * @return Place of finding in both sequences.
- */
-template<typename _RAIter1,
- typename _RAIter2,
- typename _Pred,
- typename _Selector>
- std::pair<_RAIter1, _RAIter2>
- __find_template(_RAIter1 __begin1,
- _RAIter1 __end1,
- _RAIter2 __begin2,
- _Pred __pred,
- _Selector __selector,
- equal_split_tag)
- {
- _GLIBCXX_CALL(__end1 - __begin1)
-
- typedef std::iterator_traits<_RAIter1> _TraitsType;
- typedef typename _TraitsType::difference_type _DifferenceType;
- typedef typename _TraitsType::value_type _ValueType;
-
- _DifferenceType __length = __end1 - __begin1;
- _DifferenceType __result = __length;
- _DifferenceType* __borders;
-
- omp_lock_t __result_lock;
- omp_init_lock(&__result_lock);
-
- _ThreadIndex __num_threads = __get_max_threads();
-# pragma omp parallel num_threads(__num_threads)
+ /**
+ * @brief Parallel std::find, equal splitting variant.
+ * @param __begin1 Begin iterator of first sequence.
+ * @param __end1 End iterator of first sequence.
+ * @param __begin2 Begin iterator of second sequence. Second __sequence
+ * must have same length as first sequence.
+ * @param __pred Find predicate.
+ * @param __selector _Functionality (e. g. std::find_if(), std::equal(),...)
+ * @return Place of finding in both sequences.
+ */
+ template<typename _RAIter1,
+ typename _RAIter2,
+ typename _Pred,
+ typename _Selector>
+ std::pair<_RAIter1, _RAIter2>
+ __find_template(_RAIter1 __begin1, _RAIter1 __end1,
+ _RAIter2 __begin2, _Pred __pred,
+ _Selector __selector, equal_split_tag)
+ {
+ _GLIBCXX_CALL(__end1 - __begin1)
+
+ typedef std::iterator_traits<_RAIter1> _TraitsType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
+ typedef typename _TraitsType::value_type _ValueType;
+
+ _DifferenceType __length = __end1 - __begin1;
+ _DifferenceType __result = __length;
+ _DifferenceType* __borders;
+
+ omp_lock_t __result_lock;
+ omp_init_lock(&__result_lock);
+
+ _ThreadIndex __num_threads = __get_max_threads();
+# pragma omp parallel num_threads(__num_threads)
{
-# pragma omp single
- {
- __num_threads = omp_get_num_threads();
- __borders = new _DifferenceType[__num_threads + 1];
- equally_split(__length, __num_threads, __borders);
- } //single
-
- _ThreadIndex __iam = omp_get_thread_num();
- _DifferenceType __start = __borders[__iam],
- __stop = __borders[__iam + 1];
-
- _RAIter1 __i1 = __begin1 + __start;
- _RAIter2 __i2 = __begin2 + __start;
- for (_DifferenceType __pos = __start; __pos < __stop; ++__pos)
- {
- #pragma omp flush(__result)
- // Result has been set to something lower.
- if (__result < __pos)
- break;
-
- if (__selector(__i1, __i2, __pred))
- {
- omp_set_lock(&__result_lock);
- if (__pos < __result)
- __result = __pos;
- omp_unset_lock(&__result_lock);
- break;
- }
- ++__i1;
- ++__i2;
- }
+# pragma omp single
+ {
+ __num_threads = omp_get_num_threads();
+ __borders = new _DifferenceType[__num_threads + 1];
+ equally_split(__length, __num_threads, __borders);
+ } //single
+
+ _ThreadIndex __iam = omp_get_thread_num();
+ _DifferenceType __start = __borders[__iam],
+ __stop = __borders[__iam + 1];
+
+ _RAIter1 __i1 = __begin1 + __start;
+ _RAIter2 __i2 = __begin2 + __start;
+ for (_DifferenceType __pos = __start; __pos < __stop; ++__pos)
+ {
+# pragma omp flush(__result)
+ // Result has been set to something lower.
+ if (__result < __pos)
+ break;
+
+ if (__selector(__i1, __i2, __pred))
+ {
+ omp_set_lock(&__result_lock);
+ if (__pos < __result)
+ __result = __pos;
+ omp_unset_lock(&__result_lock);
+ break;
+ }
+ ++__i1;
+ ++__i2;
+ }
} //parallel
- omp_destroy_lock(&__result_lock);
- delete[] __borders;
+ omp_destroy_lock(&__result_lock);
+ delete[] __borders;
- return
- std::pair<_RAIter1, _RAIter2>(__begin1 + __result, __begin2 + __result);
- }
+ return std::pair<_RAIter1, _RAIter2>(__begin1 + __result,
+ __begin2 + __result);
+ }
#endif
#if _GLIBCXX_FIND_GROWING_BLOCKS
-/**
- * @brief Parallel std::find, growing block size variant.
- * @param __begin1 Begin iterator of first sequence.
- * @param __end1 End iterator of first sequence.
- * @param __begin2 Begin iterator of second sequence. Second __sequence
- * must have same length as first sequence.
- * @param __pred Find predicate.
- * @param __selector _Functionality (e. g. std::find_if (), std::equal(),...)
- * @return Place of finding in both sequences.
- * @see __gnu_parallel::_Settings::find_sequential_search_size
- * @see __gnu_parallel::_Settings::find_initial_block_size
- * @see __gnu_parallel::_Settings::find_maximum_block_size
- * @see __gnu_parallel::_Settings::find_increasing_factor
- *
- * There are two main differences between the growing blocks and
- * the constant-size blocks variants.
- * 1. For GB, the block size grows; for CSB, the block size is fixed.
- * 2. For GB, the blocks are allocated dynamically;
- * for CSB, the blocks are allocated in a predetermined manner,
- * namely spacial round-robin.
- */
-template<typename _RAIter1,
- typename _RAIter2,
- typename _Pred,
- typename _Selector>
- std::pair<_RAIter1, _RAIter2>
- __find_template(_RAIter1 __begin1, _RAIter1 __end1,
- _RAIter2 __begin2, _Pred __pred, _Selector __selector,
- growing_blocks_tag)
- {
- _GLIBCXX_CALL(__end1 - __begin1)
-
- typedef std::iterator_traits<_RAIter1> _TraitsType;
- typedef typename _TraitsType::difference_type _DifferenceType;
- typedef typename _TraitsType::value_type _ValueType;
-
- const _Settings& __s = _Settings::get();
-
- _DifferenceType __length = __end1 - __begin1;
-
- _DifferenceType __sequential_search_size =
- std::min<_DifferenceType>(__length, __s.find_sequential_search_size);
-
- // Try it sequentially first.
- std::pair<_RAIter1, _RAIter2> __find_seq_result =
- __selector._M_sequential_algorithm(
- __begin1, __begin1 + __sequential_search_size, __begin2, __pred);
-
- if (__find_seq_result.first != (__begin1 + __sequential_search_size))
- return __find_seq_result;
-
- // Index of beginning of next free block (after sequential find).
- _DifferenceType __next_block_start = __sequential_search_size;
- _DifferenceType __result = __length;
-
- omp_lock_t __result_lock;
- omp_init_lock(&__result_lock);
-
- _ThreadIndex __num_threads = __get_max_threads();
-# pragma omp parallel shared(__result) num_threads(__num_threads)
+ /**
+ * @brief Parallel std::find, growing block size variant.
+ * @param __begin1 Begin iterator of first sequence.
+ * @param __end1 End iterator of first sequence.
+ * @param __begin2 Begin iterator of second sequence. Second __sequence
+ * must have same length as first sequence.
+ * @param __pred Find predicate.
+ * @param __selector _Functionality (e. g. std::find_if(), std::equal(),...)
+ * @return Place of finding in both sequences.
+ * @see __gnu_parallel::_Settings::find_sequential_search_size
+ * @see __gnu_parallel::_Settings::find_initial_block_size
+ * @see __gnu_parallel::_Settings::find_maximum_block_size
+ * @see __gnu_parallel::_Settings::find_increasing_factor
+ *
+ * There are two main differences between the growing blocks and
+ * the constant-size blocks variants.
+ * 1. For GB, the block size grows; for CSB, the block size is fixed.
+ * 2. For GB, the blocks are allocated dynamically;
+ * for CSB, the blocks are allocated in a predetermined manner,
+ * namely spacial round-robin.
+ */
+ template<typename _RAIter1,
+ typename _RAIter2,
+ typename _Pred,
+ typename _Selector>
+ std::pair<_RAIter1, _RAIter2>
+ __find_template(_RAIter1 __begin1, _RAIter1 __end1,
+ _RAIter2 __begin2, _Pred __pred, _Selector __selector,
+ growing_blocks_tag)
+ {
+ _GLIBCXX_CALL(__end1 - __begin1)
+
+ typedef std::iterator_traits<_RAIter1> _TraitsType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
+ typedef typename _TraitsType::value_type _ValueType;
+
+ const _Settings& __s = _Settings::get();
+
+ _DifferenceType __length = __end1 - __begin1;
+
+ _DifferenceType
+ __sequential_search_size = std::min<_DifferenceType>
+ (__length, __s.find_sequential_search_size);
+
+ // Try it sequentially first.
+ std::pair<_RAIter1, _RAIter2>
+ __find_seq_result = __selector._M_sequential_algorithm
+ (__begin1, __begin1 + __sequential_search_size,
+ __begin2, __pred);
+
+ if (__find_seq_result.first != (__begin1 + __sequential_search_size))
+ return __find_seq_result;
+
+ // Index of beginning of next free block (after sequential find).
+ _DifferenceType __next_block_start = __sequential_search_size;
+ _DifferenceType __result = __length;
+
+ omp_lock_t __result_lock;
+ omp_init_lock(&__result_lock);
+
+ _ThreadIndex __num_threads = __get_max_threads();
+# pragma omp parallel shared(__result) num_threads(__num_threads)
{
# pragma omp single
- __num_threads = omp_get_num_threads();
+ __num_threads = omp_get_num_threads();
- // Not within first __k elements -> start parallel.
- _ThreadIndex __iam = omp_get_thread_num();
+ // Not within first __k elements -> start parallel.
+ _ThreadIndex __iam = omp_get_thread_num();
- _DifferenceType __block_size = __s.find_initial_block_size;
- _DifferenceType __start =
- __fetch_and_add<_DifferenceType>(&__next_block_start, __block_size);
+ _DifferenceType __block_size = __s.find_initial_block_size;
+ _DifferenceType __start = __fetch_and_add<_DifferenceType>
+ (&__next_block_start, __block_size);
- // Get new block, update pointer to next block.
- _DifferenceType __stop =
- std::min<_DifferenceType>(__length, __start + __block_size);
+ // Get new block, update pointer to next block.
+ _DifferenceType __stop =
+ std::min<_DifferenceType>(__length, __start + __block_size);
- std::pair<_RAIter1, _RAIter2> __local_result;
+ std::pair<_RAIter1, _RAIter2> __local_result;
- while (__start < __length)
- {
+ while (__start < __length)
+ {
# pragma omp flush(__result)
- // Get new value of result.
- if (__result < __start)
- {
- // No chance to find first element.
- break;
- }
-
- __local_result = __selector._M_sequential_algorithm(
- __begin1 + __start, __begin1 + __stop,
- __begin2 + __start, __pred);
- if (__local_result.first != (__begin1 + __stop))
- {
- omp_set_lock(&__result_lock);
- if ((__local_result.first - __begin1) < __result)
- {
- __result = __local_result.first - __begin1;
-
- // Result cannot be in future blocks, stop algorithm.
- __fetch_and_add<_DifferenceType>(
- &__next_block_start, __length);
- }
- omp_unset_lock(&__result_lock);
- }
-
- __block_size = std::min<_DifferenceType>(
- __block_size * __s.find_increasing_factor,
- __s.find_maximum_block_size);
-
- // Get new block, update pointer to next block.
- __start =
- __fetch_and_add<_DifferenceType>(
- &__next_block_start, __block_size);
- __stop = ((__length < (__start + __block_size))
- ? __length : (__start + __block_size));
- }
+ // Get new value of result.
+ if (__result < __start)
+ {
+ // No chance to find first element.
+ break;
+ }
+
+ __local_result = __selector._M_sequential_algorithm
+ (__begin1 + __start, __begin1 + __stop,
+ __begin2 + __start, __pred);
+
+ if (__local_result.first != (__begin1 + __stop))
+ {
+ omp_set_lock(&__result_lock);
+ if ((__local_result.first - __begin1) < __result)
+ {
+ __result = __local_result.first - __begin1;
+
+ // Result cannot be in future blocks, stop algorithm.
+ __fetch_and_add<_DifferenceType>(&__next_block_start,
+ __length);
+ }
+ omp_unset_lock(&__result_lock);
+ }
+
+ __block_size = std::min<_DifferenceType>
+ (__block_size * __s.find_increasing_factor,
+ __s.find_maximum_block_size);
+
+ // Get new block, update pointer to next block.
+ __start = __fetch_and_add<_DifferenceType>(&__next_block_start,
+ __block_size);
+ __stop = (__length < (__start + __block_size)
+ ? __length : (__start + __block_size));
+ }
} //parallel
- omp_destroy_lock(&__result_lock);
+ omp_destroy_lock(&__result_lock);
- // Return iterator on found element.
- return
- std::pair<_RAIter1, _RAIter2>(__begin1 + __result, __begin2 + __result);
- }
+ // Return iterator on found element.
+ return
+ std::pair<_RAIter1, _RAIter2>(__begin1 + __result,
+ __begin2 + __result);
+ }
#endif
#if _GLIBCXX_FIND_CONSTANT_SIZE_BLOCKS
-/**
- * @brief Parallel std::find, constant block size variant.
- * @param __begin1 Begin iterator of first sequence.
- * @param __end1 End iterator of first sequence.
- * @param __begin2 Begin iterator of second sequence. Second __sequence
- * must have same length as first sequence.
- * @param __pred Find predicate.
- * @param __selector _Functionality (e. g. std::find_if (), std::equal(),...)
- * @return Place of finding in both sequences.
- * @see __gnu_parallel::_Settings::find_sequential_search_size
- * @see __gnu_parallel::_Settings::find_block_size
- * There are two main differences between the growing blocks and the
- * constant-size blocks variants.
- * 1. For GB, the block size grows; for CSB, the block size is fixed.
- * 2. For GB, the blocks are allocated dynamically; for CSB, the
- * blocks are allocated in a predetermined manner, namely spacial
- * round-robin.
- */
-template<typename _RAIter1,
- typename _RAIter2,
- typename _Pred,
- typename _Selector>
- std::pair<_RAIter1, _RAIter2>
- __find_template(_RAIter1 __begin1, _RAIter1 __end1,
- _RAIter2 __begin2, _Pred __pred, _Selector __selector,
- constant_size_blocks_tag)
- {
- _GLIBCXX_CALL(__end1 - __begin1)
- typedef std::iterator_traits<_RAIter1> _TraitsType;
- typedef typename _TraitsType::difference_type _DifferenceType;
- typedef typename _TraitsType::value_type _ValueType;
-
- const _Settings& __s = _Settings::get();
-
- _DifferenceType __length = __end1 - __begin1;
-
- _DifferenceType __sequential_search_size = std::min<_DifferenceType>(
- __length, __s.find_sequential_search_size);
-
- // Try it sequentially first.
- std::pair<_RAIter1, _RAIter2> __find_seq_result =
- __selector._M_sequential_algorithm(
- __begin1, __begin1 + __sequential_search_size, __begin2, __pred);
-
- if (__find_seq_result.first != (__begin1 + __sequential_search_size))
- return __find_seq_result;
-
- _DifferenceType __result = __length;
- omp_lock_t __result_lock;
- omp_init_lock(&__result_lock);
-
- // Not within first __sequential_search_size elements -> start parallel.
-
- _ThreadIndex __num_threads = __get_max_threads();
-# pragma omp parallel shared(__result) num_threads(__num_threads)
+ /**
+ * @brief Parallel std::find, constant block size variant.
+ * @param __begin1 Begin iterator of first sequence.
+ * @param __end1 End iterator of first sequence.
+ * @param __begin2 Begin iterator of second sequence. Second __sequence
+ * must have same length as first sequence.
+ * @param __pred Find predicate.
+ * @param __selector _Functionality (e. g. std::find_if(), std::equal(),...)
+ * @return Place of finding in both sequences.
+ * @see __gnu_parallel::_Settings::find_sequential_search_size
+ * @see __gnu_parallel::_Settings::find_block_size
+ * There are two main differences between the growing blocks and the
+ * constant-size blocks variants.
+ * 1. For GB, the block size grows; for CSB, the block size is fixed.
+ * 2. For GB, the blocks are allocated dynamically; for CSB, the
+ * blocks are allocated in a predetermined manner, namely spacial
+ * round-robin.
+ */
+ template<typename _RAIter1,
+ typename _RAIter2,
+ typename _Pred,
+ typename _Selector>
+ std::pair<_RAIter1, _RAIter2>
+ __find_template(_RAIter1 __begin1, _RAIter1 __end1,
+ _RAIter2 __begin2, _Pred __pred, _Selector __selector,
+ constant_size_blocks_tag)
+ {
+ _GLIBCXX_CALL(__end1 - __begin1)
+ typedef std::iterator_traits<_RAIter1> _TraitsType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
+ typedef typename _TraitsType::value_type _ValueType;
+
+ const _Settings& __s = _Settings::get();
+
+ _DifferenceType __length = __end1 - __begin1;
+
+ _DifferenceType __sequential_search_size = std::min<_DifferenceType>
+ (__length, __s.find_sequential_search_size);
+
+ // Try it sequentially first.
+ std::pair<_RAIter1, _RAIter2>
+ __find_seq_result = __selector._M_sequential_algorithm
+ (__begin1, __begin1 + __sequential_search_size, __begin2, __pred);
+
+ if (__find_seq_result.first != (__begin1 + __sequential_search_size))
+ return __find_seq_result;
+
+ _DifferenceType __result = __length;
+ omp_lock_t __result_lock;
+ omp_init_lock(&__result_lock);
+
+ // Not within first __sequential_search_size elements -> start parallel.
+
+ _ThreadIndex __num_threads = __get_max_threads();
+# pragma omp parallel shared(__result) num_threads(__num_threads)
{
# pragma omp single
- __num_threads = omp_get_num_threads();
+ __num_threads = omp_get_num_threads();
- _ThreadIndex __iam = omp_get_thread_num();
- _DifferenceType __block_size = __s.find_initial_block_size;
+ _ThreadIndex __iam = omp_get_thread_num();
+ _DifferenceType __block_size = __s.find_initial_block_size;
- // First element of thread's current iteration.
- _DifferenceType __iteration_start = __sequential_search_size;
+ // First element of thread's current iteration.
+ _DifferenceType __iteration_start = __sequential_search_size;
- // Where to work (initialization).
- _DifferenceType __start = __iteration_start + __iam * __block_size;
- _DifferenceType __stop =
- std::min<_DifferenceType>(__length, __start + __block_size);
+ // Where to work (initialization).
+ _DifferenceType __start = __iteration_start + __iam * __block_size;
+ _DifferenceType __stop = std::min<_DifferenceType>(__length,
+ __start
+ + __block_size);
- std::pair<_RAIter1, _RAIter2> __local_result;
+ std::pair<_RAIter1, _RAIter2> __local_result;
- while (__start < __length)
- {
- // Get new value of result.
+ while (__start < __length)
+ {
+ // Get new value of result.
# pragma omp flush(__result)
- // No chance to find first element.
- if (__result < __start)
- break;
- __local_result = __selector._M_sequential_algorithm(
- __begin1 + __start, __begin1 + __stop,
- __begin2 + __start, __pred);
- if (__local_result.first != (__begin1 + __stop))
- {
- omp_set_lock(&__result_lock);
- if ((__local_result.first - __begin1) < __result)
- __result = __local_result.first - __begin1;
- omp_unset_lock(&__result_lock);
- // Will not find better value in its interval.
- break;
- }
-
- __iteration_start += __num_threads * __block_size;
-
- // Where to work.
- __start = __iteration_start + __iam * __block_size;
- __stop = std::min<_DifferenceType>(
- __length, __start + __block_size);
- }
+ // No chance to find first element.
+ if (__result < __start)
+ break;
+
+ __local_result = __selector._M_sequential_algorithm
+ (__begin1 + __start, __begin1 + __stop,
+ __begin2 + __start, __pred);
+
+ if (__local_result.first != (__begin1 + __stop))
+ {
+ omp_set_lock(&__result_lock);
+ if ((__local_result.first - __begin1) < __result)
+ __result = __local_result.first - __begin1;
+ omp_unset_lock(&__result_lock);
+ // Will not find better value in its interval.
+ break;
+ }
+
+ __iteration_start += __num_threads * __block_size;
+
+ // Where to work.
+ __start = __iteration_start + __iam * __block_size;
+ __stop = std::min<_DifferenceType>(__length,
+ __start + __block_size);
+ }
} //parallel
- omp_destroy_lock(&__result_lock);
+ omp_destroy_lock(&__result_lock);
- // Return iterator on found element.
- return
- std::pair<_RAIter1, _RAIter2>(__begin1 + __result, __begin2 + __result);
- }
+ // Return iterator on found element.
+ return std::pair<_RAIter1, _RAIter2>(__begin1 + __result,
+ __begin2 + __result);
+ }
#endif
} // end namespace
diff --git a/libstdc++-v3/include/parallel/find_selectors.h b/libstdc++-v3/include/parallel/find_selectors.h
index 0d385bc6c94..df77978a9dd 100644
--- a/libstdc++-v3/include/parallel/find_selectors.h
+++ b/libstdc++-v3/include/parallel/find_selectors.h
@@ -103,12 +103,12 @@ namespace __gnu_parallel
typename _Pred>
std::pair<_RAIter1, _RAIter2>
_M_sequential_algorithm(_RAIter1 __begin1,
- _RAIter1 __end1,
- _RAIter2 __begin2, _Pred __pred)
+ _RAIter1 __end1,
+ _RAIter2 __begin2, _Pred __pred)
{
// Passed end iterator is one short.
_RAIter1 __spot = adjacent_find(__begin1, __end1 + 1,
- __pred, sequential_tag());
+ __pred, sequential_tag());
if (__spot == (__end1 + 1))
__spot = __end1;
return std::make_pair(__spot, __begin2);
@@ -141,56 +141,57 @@ namespace __gnu_parallel
typename _Pred>
std::pair<_RAIter1, _RAIter2>
_M_sequential_algorithm(_RAIter1 __begin1,
- _RAIter1 __end1,
- _RAIter2 __begin2, _Pred __pred)
- { return mismatch(__begin1, __end1, __begin2, __pred, sequential_tag());
- }
+ _RAIter1 __end1,
+ _RAIter2 __begin2, _Pred __pred)
+ { return mismatch(__begin1, __end1, __begin2,
+ __pred, sequential_tag()); }
};
/** @brief Test predicate on several elements. */
template<typename _FIterator>
- struct __find_first_of_selector : public __generic_find_selector
- {
- _FIterator _M_begin;
- _FIterator _M_end;
-
- explicit __find_first_of_selector(_FIterator __begin, _FIterator __end)
- : _M_begin(__begin), _M_end(__end) { }
-
- /** @brief Test on one position.
- * @param __i1 _Iterator on first sequence.
- * @param __i2 _Iterator on second sequence (unused).
- * @param __pred Find predicate. */
- template<typename _RAIter1, typename _RAIter2,
- typename _Pred>
- bool
- operator()(_RAIter1 __i1, _RAIter2 __i2, _Pred __pred)
- {
- for (_FIterator __pos_in_candidates = _M_begin;
- __pos_in_candidates != _M_end; ++__pos_in_candidates)
- if (__pred(*__i1, *__pos_in_candidates))
- return true;
- return false;
- }
-
- /** @brief Corresponding sequential algorithm on a sequence.
- * @param __begin1 Begin iterator of first sequence.
- * @param __end1 End iterator of first sequence.
- * @param __begin2 Begin iterator of second sequence.
- * @param __pred Find predicate. */
- template<typename _RAIter1, typename _RAIter2,
- typename _Pred>
- std::pair<_RAIter1, _RAIter2>
- _M_sequential_algorithm(_RAIter1 __begin1,
- _RAIter1 __end1,
- _RAIter2 __begin2, _Pred __pred)
- {
- return std::make_pair(
- find_first_of(__begin1, __end1, _M_begin, _M_end, __pred,
- sequential_tag()), __begin2);
- }
- };
+ struct __find_first_of_selector : public __generic_find_selector
+ {
+ _FIterator _M_begin;
+ _FIterator _M_end;
+
+ explicit __find_first_of_selector(_FIterator __begin,
+ _FIterator __end)
+ : _M_begin(__begin), _M_end(__end) { }
+
+ /** @brief Test on one position.
+ * @param __i1 _Iterator on first sequence.
+ * @param __i2 _Iterator on second sequence (unused).
+ * @param __pred Find predicate. */
+ template<typename _RAIter1, typename _RAIter2,
+ typename _Pred>
+ bool
+ operator()(_RAIter1 __i1, _RAIter2 __i2, _Pred __pred)
+ {
+ for (_FIterator __pos_in_candidates = _M_begin;
+ __pos_in_candidates != _M_end; ++__pos_in_candidates)
+ if (__pred(*__i1, *__pos_in_candidates))
+ return true;
+ return false;
+ }
+
+ /** @brief Corresponding sequential algorithm on a sequence.
+ * @param __begin1 Begin iterator of first sequence.
+ * @param __end1 End iterator of first sequence.
+ * @param __begin2 Begin iterator of second sequence.
+ * @param __pred Find predicate. */
+ template<typename _RAIter1, typename _RAIter2,
+ typename _Pred>
+ std::pair<_RAIter1, _RAIter2>
+ _M_sequential_algorithm(_RAIter1 __begin1,
+ _RAIter1 __end1,
+ _RAIter2 __begin2, _Pred __pred)
+ {
+ return std::make_pair(find_first_of(__begin1, __end1,
+ _M_begin, _M_end, __pred,
+ sequential_tag()), __begin2);
+ }
+ };
}
#endif /* _GLIBCXX_PARALLEL_FIND_SELECTORS_H */
diff --git a/libstdc++-v3/include/parallel/for_each.h b/libstdc++-v3/include/parallel/for_each.h
index b585999f514..e6e573ddbbf 100644
--- a/libstdc++-v3/include/parallel/for_each.h
+++ b/libstdc++-v3/include/parallel/for_each.h
@@ -42,7 +42,7 @@
namespace __gnu_parallel
{
- /** @brief Chose the desired algorithm by evaluating @__c __parallelism_tag.
+ /** @brief Chose the desired algorithm by evaluating @c __parallelism_tag.
* @param __begin Begin iterator of input sequence.
* @param __end End iterator of input sequence.
* @param __user_op A user-specified functor (comparator, predicate,
@@ -69,31 +69,21 @@ namespace __gnu_parallel
_Parallelism __parallelism_tag)
{
if (__parallelism_tag == parallel_unbalanced)
- return __for_each_template_random_access_ed(__begin, __end, __user_op,
- __functionality, __reduction,
- __reduction_start,
- __output, __bound);
+ return __for_each_template_random_access_ed
+ (__begin, __end, __user_op, __functionality, __reduction,
+ __reduction_start, __output, __bound);
else if (__parallelism_tag == parallel_omp_loop)
- return __for_each_template_random_access_omp_loop(
- __begin, __end, __user_op,
- __functionality,
- __reduction,
- __reduction_start,
- __output, __bound);
+ return __for_each_template_random_access_omp_loop
+ (__begin, __end, __user_op, __functionality, __reduction,
+ __reduction_start, __output, __bound);
else if (__parallelism_tag == parallel_omp_loop_static)
- return __for_each_template_random_access_omp_loop(
- __begin, __end, __user_op,
- __functionality,
- __reduction,
- __reduction_start,
- __output, __bound);
+ return __for_each_template_random_access_omp_loop
+ (__begin, __end, __user_op, __functionality, __reduction,
+ __reduction_start, __output, __bound);
else //e. g. parallel_balanced
- return __for_each_template_random_access_workstealing(__begin, __end,
- __user_op,
- __functionality,
- __reduction,
- __reduction_start,
- __output, __bound);
+ return __for_each_template_random_access_workstealing
+ (__begin, __end, __user_op, __functionality, __reduction,
+ __reduction_start, __output, __bound);
}
}
diff --git a/libstdc++-v3/include/parallel/for_each_selectors.h b/libstdc++-v3/include/parallel/for_each_selectors.h
index 092398de0f9..3a37e5ca637 100644
--- a/libstdc++-v3/include/parallel/for_each_selectors.h
+++ b/libstdc++-v3/include/parallel/for_each_selectors.h
@@ -37,17 +37,15 @@
namespace __gnu_parallel
{
-
/** @brief Generic __selector for embarrassingly parallel functions. */
template<typename _It>
- struct __generic_for_each_selector
- {
- /** @brief _Iterator on last element processed; needed for some
- * algorithms (e. g. std::transform()).
- */
- _It _M_finish_iterator;
- };
-
+ struct __generic_for_each_selector
+ {
+ /** @brief _Iterator on last element processed; needed for some
+ * algorithms (e. g. std::transform()).
+ */
+ _It _M_finish_iterator;
+ };
/** @brief std::for_each() selector. */
template<typename _It>
@@ -220,21 +218,21 @@ namespace __gnu_parallel
};
/** @brief std::inner_product() selector. */
- template<typename _It, typename It2, typename _Tp>
+ template<typename _It, typename _It2, typename _Tp>
struct __inner_product_selector : public __generic_for_each_selector<_It>
{
/** @brief Begin iterator of first sequence. */
- _It __begin1_iterator;
+ _It __begin1_iterator;
/** @brief Begin iterator of second sequence. */
- It2 begin2_iterator;
+ _It2 __begin2_iterator;
/** @brief Constructor.
* @param b1 Begin iterator of first sequence.
* @param b2 Begin iterator of second sequence. */
explicit
- __inner_product_selector(_It b1, It2 b2)
- : __begin1_iterator(b1), begin2_iterator(b2) { }
+ __inner_product_selector(_It __b1, _It2 __b2)
+ : __begin1_iterator(__b1), __begin2_iterator(__b2) { }
/** @brief Functor execution.
* @param __mult Multiplication functor.
@@ -246,7 +244,7 @@ namespace __gnu_parallel
{
typename std::iterator_traits<_It>::difference_type __position
= __current - __begin1_iterator;
- return __mult(*__current, *(begin2_iterator + __position));
+ return __mult(*__current, *(__begin2_iterator + __position));
}
};
@@ -268,8 +266,8 @@ namespace __gnu_parallel
* __elements.
*/
template<typename _It>
- struct __adjacent_difference_selector :
- public __generic_for_each_selector<_It>
+ struct __adjacent_difference_selector
+ : public __generic_for_each_selector<_It>
{
template<typename _Op>
bool
@@ -277,7 +275,7 @@ namespace __gnu_parallel
{
typename _It::first_type __go_back_one = __i.first;
--__go_back_one;
- *__i.__second = __o(*__i.__first, *__go_back_one);
+ *__i.second = __o(*__i.first, *__go_back_one);
return true;
}
};
@@ -293,14 +291,14 @@ namespace __gnu_parallel
* @param __i iterator referencing object. */
template<typename _It>
void
- operator()(_It __i) { }
+ operator()(_It) { }
};
/** @brief Reduction function doing nothing. */
struct _DummyReduct
{
bool
- operator()(bool /*__x*/, bool /*__y*/) const
+ operator()(bool, bool) const
{ return true; }
};
@@ -315,12 +313,7 @@ namespace __gnu_parallel
_It
operator()(_It __x, _It __y)
- {
- if (__comp(*__x, *__y))
- return __x;
- else
- return __y;
- }
+ { return (__comp(*__x, *__y)) ? __x : __y; }
};
/** @brief Reduction for finding the maximum element, using a comparator. */
@@ -334,12 +327,7 @@ namespace __gnu_parallel
_It
operator()(_It __x, _It __y)
- {
- if (__comp(*__x, *__y))
- return __y;
- else
- return __x;
- }
+ { return (__comp(*__x, *__y)) ? __y : __x; }
};
/** @brief General reduction, using a binary operator. */
diff --git a/libstdc++-v3/include/parallel/list_partition.h b/libstdc++-v3/include/parallel/list_partition.h
index 9c4f48187f0..1f1bfa22e44 100644
--- a/libstdc++-v3/include/parallel/list_partition.h
+++ b/libstdc++-v3/include/parallel/list_partition.h
@@ -42,17 +42,17 @@ namespace __gnu_parallel
* @param __os_starts Start positions worked on (oversampled).
* @param __count_to_two Counts up to 2.
* @param __range_length Current length of a chunk.
- * @param __make_twice Whether the @__c __os_starts is allowed to be
+ * @param __make_twice Whether the @c __os_starts is allowed to be
* grown or not
*/
template<typename _IIter>
void
__shrink_and_double(std::vector<_IIter>& __os_starts,
- size_t& __count_to_two, size_t& __range_length,
- const bool __make_twice)
+ size_t& __count_to_two, size_t& __range_length,
+ const bool __make_twice)
{
++__count_to_two;
- if (not __make_twice or __count_to_two < 2)
+ if (!__make_twice || __count_to_two < 2)
__shrink(__os_starts, __count_to_two, __range_length);
else
{
@@ -68,7 +68,7 @@ namespace __gnu_parallel
template<typename _IIter>
void
__shrink(std::vector<_IIter>& __os_starts, size_t& __count_to_two,
- size_t& __range_length)
+ size_t& __range_length)
{
for (typename std::vector<_IIter>::size_type __i = 0;
__i <= (__os_starts.size() / 2); ++__i)
@@ -83,16 +83,17 @@ namespace __gnu_parallel
* @param __begin Begin iterator of input sequence.
* @param __end End iterator of input sequence.
* @param __starts Start iterators for the resulting parts, dimension
- * @__c __num_parts+1. For convenience, @__c __starts @__c [__num_parts]
+ * @c __num_parts+1. For convenience, @c __starts @c [__num_parts]
* contains the end iterator of the sequence.
* @param __lengths Length of the resulting parts.
* @param __num_parts Number of parts to split the sequence into.
* @param __f Functor to be applied to each element by traversing __it
* @param __oversampling Oversampling factor. If 0, then the
- * partitions will differ in at most @__f$ \sqrt{\mathrm{__end} -
- * \mathrm{__begin}} @__f$ __elements. Otherwise, the ratio between the
- * longest and the shortest part is bounded by @__f$
- * 1/(\mathrm{__oversampling} \cdot \mathrm{num\_parts}) @__f$.
+ * partitions will differ in at most
+ * \sqrt{\mathrm{__end} - \mathrm{__begin}}
+ * __elements. Otherwise, the ratio between the
+ * longest and the shortest part is bounded by
+ * 1/(\mathrm{__oversampling} \cdot \mathrm{num\_parts})
* @return Length of the whole sequence.
*/
template<typename _IIter, typename _FunctorType>
@@ -112,8 +113,8 @@ namespace __gnu_parallel
std::vector<_IIter> __os_starts(2 * __oversampling * __num_parts + 1);
- __os_starts[0]= __begin;
- _IIter __prev = __begin, __it = __begin;
+ __os_starts[0] = __begin;
+ _IIter __prev = __begin, __it = __begin;
size_t __dist_limit = 0, __dist = 0;
size_t __cur = 1, __next = 1;
size_t __range_length = 1;
diff --git a/libstdc++-v3/include/parallel/losertree.h b/libstdc++-v3/include/parallel/losertree.h
index 0da84abe4ab..425cf6d4b6f 100644
--- a/libstdc++-v3/include/parallel/losertree.h
+++ b/libstdc++-v3/include/parallel/losertree.h
@@ -40,992 +40,1000 @@
namespace __gnu_parallel
{
-
-/**
- * @brief Guarded loser/tournament tree.
- *
- * The smallest element is at the top.
- *
- * Guarding is done explicitly through one flag _M_sup per element,
- * inf is not needed due to a better initialization routine. This
- * is a well-performing variant.
- *
- * @param _Tp the element type
- * @param _Compare the comparator to use, defaults to std::less<_Tp>
- */
-template<typename _Tp, typename _Compare>
-class _LoserTreeBase
-{
-protected:
- /** @brief Internal representation of a _LoserTree element. */
- struct _Loser
- {
- /** @brief flag, true iff this is a "maximum" __sentinel. */
- bool _M_sup;
- /** @brief __index of the __source __sequence. */
- int _M_source;
- /** @brief _M_key of the element in the _LoserTree. */
- _Tp _M_key;
- };
-
- unsigned int _M_ik, _M_k, _M_offset;
-
- /** log_2{_M_k} */
- unsigned int _M_log_k;
-
- /** @brief _LoserTree __elements. */
- _Loser* _M_losers;
-
- /** @brief _Compare to use. */
- _Compare _M_comp;
-
/**
- * @brief State flag that determines whether the _LoserTree is empty.
+ * @brief Guarded loser/tournament tree.
*
- * Only used for building the _LoserTree.
- */
- bool _M_first_insert;
-
-public:
- /**
- * @brief The constructor.
+ * The smallest element is at the top.
+ *
+ * Guarding is done explicitly through one flag _M_sup per element,
+ * inf is not needed due to a better initialization routine. This
+ * is a well-performing variant.
*
- * @param __k The number of sequences to merge.
- * @param __comp The comparator to use.
+ * @param _Tp the element type
+ * @param _Compare the comparator to use, defaults to std::less<_Tp>
*/
- _LoserTreeBase(unsigned int __k, _Compare __comp)
- : _M_comp(__comp)
- {
- _M_ik = __k;
-
- // Compute log_2{_M_k} for the _Loser Tree
- _M_log_k = __rd_log2(_M_ik - 1) + 1;
-
- // Next greater power of 2.
- _M_k = 1 << _M_log_k;
- _M_offset = _M_k;
-
- // Avoid default-constructing _M_losers[]._M_key
- _M_losers
- = static_cast<_Loser*>(::operator new(2 * _M_k * sizeof(_Loser)));
- for (unsigned int __i = _M_ik - 1; __i < _M_k; ++__i)
- _M_losers[__i + _M_k]._M_sup = true;
+ template<typename _Tp, typename _Compare>
+ class _LoserTreeBase
+ {
+ protected:
+ /** @brief Internal representation of a _LoserTree element. */
+ struct _Loser
+ {
+ /** @brief flag, true iff this is a "maximum" __sentinel. */
+ bool _M_sup;
+ /** @brief __index of the __source __sequence. */
+ int _M_source;
+ /** @brief _M_key of the element in the _LoserTree. */
+ _Tp _M_key;
+ };
+
+ unsigned int _M_ik, _M_k, _M_offset;
+
+ /** log_2{_M_k} */
+ unsigned int _M_log_k;
+
+ /** @brief _LoserTree __elements. */
+ _Loser* _M_losers;
+
+ /** @brief _Compare to use. */
+ _Compare _M_comp;
+
+ /**
+ * @brief State flag that determines whether the _LoserTree is empty.
+ *
+ * Only used for building the _LoserTree.
+ */
+ bool _M_first_insert;
+
+ public:
+ /**
+ * @brief The constructor.
+ *
+ * @param __k The number of sequences to merge.
+ * @param __comp The comparator to use.
+ */
+ _LoserTreeBase(unsigned int __k, _Compare __comp)
+ : _M_comp(__comp)
+ {
+ _M_ik = __k;
- _M_first_insert = true;
- }
+ // Compute log_2{_M_k} for the _Loser Tree
+ _M_log_k = __rd_log2(_M_ik - 1) + 1;
- /**
- * @brief The destructor.
- */
- ~_LoserTreeBase()
- { ::operator delete(_M_losers); }
+ // Next greater power of 2.
+ _M_k = 1 << _M_log_k;
+ _M_offset = _M_k;
- /**
- * @brief Initializes the sequence "_M_source" with the element "_M_key".
- *
- * @param _M_key the element to insert
- * @param _M_source __index of the __source __sequence
- * @param _M_sup flag that determines whether the value to insert is an
- * explicit __supremum.
- */
- inline void
- __insert_start(const _Tp& _M_key, int _M_source, bool _M_sup)
- {
- unsigned int __pos = _M_k + _M_source;
+ // Avoid default-constructing _M_losers[]._M_key
+ _M_losers = static_cast<_Loser*>(::operator new(2 * _M_k
+ * sizeof(_Loser)));
+ for (unsigned int __i = _M_ik - 1; __i < _M_k; ++__i)
+ _M_losers[__i + _M_k]._M_sup = true;
- if(_M_first_insert)
- {
- // Construct all keys, so we can easily deconstruct them.
- for (unsigned int __i = 0; __i < (2 * _M_k); ++__i)
- new(&(_M_losers[__i]._M_key)) _Tp(_M_key);
- _M_first_insert = false;
+ _M_first_insert = true;
}
- else
- new(&(_M_losers[__pos]._M_key)) _Tp(_M_key);
-
- _M_losers[__pos]._M_sup = _M_sup;
- _M_losers[__pos]._M_source = _M_source;
- }
- /**
- * @return the index of the sequence with the smallest element.
- */
- int __get_min_source()
- { return _M_losers[0]._M_source; }
-};
-
-/**
- * @brief Stable _LoserTree variant.
- *
- * Provides the stable implementations of insert_start, __init_winner,
- * __init and __delete_min_insert.
- *
- * Unstable variant is done using partial specialisation below.
- */
-template<bool __stable/* default == true */, typename _Tp, typename _Compare>
-class _LoserTree : public _LoserTreeBase<_Tp, _Compare>
-{
- typedef _LoserTreeBase<_Tp, _Compare> Base;
- using Base::_M_k;
- using Base::_M_losers;
- using Base::_M_first_insert;
-
-public:
- _LoserTree(unsigned int __k, _Compare __comp)
- : Base::_LoserTreeBase(__k, __comp)
- {}
-
- unsigned int
- __init_winner(unsigned int __root)
- {
- if (__root >= _M_k)
+ /**
+ * @brief The destructor.
+ */
+ ~_LoserTreeBase()
+ { ::operator delete(_M_losers); }
+
+ /**
+ * @brief Initializes the sequence "_M_source" with the element "__key".
+ *
+ * @param __key the element to insert
+ * @param __source __index of the __source __sequence
+ * @param __sup flag that determines whether the value to insert is an
+ * explicit __supremum.
+ */
+ void
+ __insert_start(const _Tp& __key, int __source, bool __sup)
{
- return __root;
+ unsigned int __pos = _M_k + __source;
+
+ if(_M_first_insert)
+ {
+ // Construct all keys, so we can easily deconstruct them.
+ for (unsigned int __i = 0; __i < (2 * _M_k); ++__i)
+ new(&(_M_losers[__i]._M_key)) _Tp(__key);
+ _M_first_insert = false;
+ }
+ else
+ new(&(_M_losers[__pos]._M_key)) _Tp(__key);
+
+ _M_losers[__pos]._M_sup = __sup;
+ _M_losers[__pos]._M_source = __source;
}
- else
+
+ /**
+ * @return the index of the sequence with the smallest element.
+ */
+ int __get_min_source()
+ { return _M_losers[0]._M_source; }
+ };
+
+ /**
+ * @brief Stable _LoserTree variant.
+ *
+ * Provides the stable implementations of insert_start, __init_winner,
+ * __init and __delete_min_insert.
+ *
+ * Unstable variant is done using partial specialisation below.
+ */
+ template<bool __stable/* default == true */, typename _Tp,
+ typename _Compare>
+ class _LoserTree
+ : public _LoserTreeBase<_Tp, _Compare>
+ {
+ typedef _LoserTreeBase<_Tp, _Compare> _Base;
+ using _Base::_M_k;
+ using _Base::_M_losers;
+ using _Base::_M_first_insert;
+
+ public:
+ _LoserTree(unsigned int __k, _Compare __comp)
+ : _Base::_LoserTreeBase(__k, __comp)
+ { }
+
+ unsigned int
+ __init_winner(unsigned int __root)
{
- unsigned int __left = __init_winner (2 * __root);
- unsigned int __right = __init_winner (2 * __root + 1);
- if (_M_losers[__right]._M_sup
- || (!_M_losers[__left]._M_sup
- && !_M_comp(_M_losers[__right]._M_key, _M_losers[__left]._M_key)))
- {
- // Left one is less or equal.
- _M_losers[__root] = _M_losers[__right];
- return __left;
- }
- else
- {
- // Right one is less.
- _M_losers[__root] = _M_losers[__left];
- return __right;
- }
+ if (__root >= _M_k)
+ return __root;
+ else
+ {
+ unsigned int __left = __init_winner(2 * __root);
+ unsigned int __right = __init_winner(2 * __root + 1);
+ if (_M_losers[__right]._M_sup
+ || (!_M_losers[__left]._M_sup
+ && !_M_comp(_M_losers[__right]._M_key,
+ _M_losers[__left]._M_key)))
+ {
+ // Left one is less or equal.
+ _M_losers[__root] = _M_losers[__right];
+ return __left;
+ }
+ else
+ {
+ // Right one is less.
+ _M_losers[__root] = _M_losers[__left];
+ return __right;
+ }
+ }
}
- }
-
- void __init()
- { _M_losers[0] = _M_losers[__init_winner(1)]; }
- /**
- * @brief Delete the smallest element and insert a new element from
- * the previously smallest element's sequence.
- *
- * This implementation is stable.
- */
- // Do not pass a const reference since _M_key will be used as local variable.
- void __delete_min_insert(_Tp _M_key, bool _M_sup)
- {
+ void __init()
+ { _M_losers[0] = _M_losers[__init_winner(1)]; }
+
+ /**
+ * @brief Delete the smallest element and insert a new element from
+ * the previously smallest element's sequence.
+ *
+ * This implementation is stable.
+ */
+ // Do not pass a const reference since __key will be used as
+ // local variable.
+ void
+ __delete_min_insert(_Tp __key, bool __sup)
+ {
#if _GLIBCXX_ASSERTIONS
- // no dummy sequence can ever be at the top!
- _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
#endif
- int _M_source = _M_losers[0]._M_source;
- for (unsigned int __pos = (_M_k + _M_source) / 2; __pos > 0; __pos /= 2)
+ int __source = _M_losers[0]._M_source;
+ for (unsigned int __pos = (_M_k + __source) / 2; __pos > 0;
+ __pos /= 2)
+ {
+ // The smaller one gets promoted, ties are broken by _M_source.
+ if ((__sup && (!_M_losers[__pos]._M_sup
+ || _M_losers[__pos]._M_source < __source))
+ || (!__sup && !_M_losers[__pos]._M_sup
+ && ((_M_comp(_M_losers[__pos]._M_key, __key))
+ || (!_M_comp(__key, _M_losers[__pos]._M_key)
+ && _M_losers[__pos]._M_source < __source))))
+ {
+ // The other one is smaller.
+ std::swap(_M_losers[__pos]._M_sup, __sup);
+ std::swap(_M_losers[__pos]._M_source, __source);
+ std::swap(_M_losers[__pos]._M_key, __key);
+ }
+ }
+
+ _M_losers[0]._M_sup = __sup;
+ _M_losers[0]._M_source = __source;
+ _M_losers[0]._M_key = __key;
+ }
+ };
+
+ /**
+ * @brief Unstable _LoserTree variant.
+ *
+ * Stability (non-stable here) is selected with partial specialization.
+ */
+ template<typename _Tp, typename _Compare>
+ class _LoserTree</* __stable == */false, _Tp, _Compare>
+ : public _LoserTreeBase<_Tp, _Compare>
+ {
+ typedef _LoserTreeBase<_Tp, _Compare> _Base;
+ using _Base::_M_log_k;
+ using _Base::_M_k;
+ using _Base::_M_losers;
+ using _Base::_M_first_insert;
+
+ public:
+ _LoserTree(unsigned int __k, _Compare __comp)
+ : _Base::_LoserTreeBase(__k, __comp)
+ { }
+
+ /**
+ * Computes the winner of the competition at position "__root".
+ *
+ * Called recursively (starting at 0) to build the initial tree.
+ *
+ * @param __root __index of the "game" to start.
+ */
+ unsigned int
+ __init_winner(unsigned int __root)
{
- // The smaller one gets promoted, ties are broken by _M_source.
- if ((_M_sup && (!_M_losers[__pos]._M_sup
- || _M_losers[__pos]._M_source < _M_source))
- || (!_M_sup && !_M_losers[__pos]._M_sup
- && ((_M_comp(_M_losers[__pos]._M_key, _M_key))
- || (!_M_comp(_M_key, _M_losers[__pos]._M_key)
- && _M_losers[__pos]._M_source < _M_source))))
- {
- // The other one is smaller.
- std::swap(_M_losers[__pos]._M_sup, _M_sup);
- std::swap(_M_losers[__pos]._M_source, _M_source);
- std::swap(_M_losers[__pos]._M_key, _M_key);
- }
+ if (__root >= _M_k)
+ return __root;
+ else
+ {
+ unsigned int __left = __init_winner(2 * __root);
+ unsigned int __right = __init_winner(2 * __root + 1);
+ if (_M_losers[__right]._M_sup
+ || (!_M_losers[__left]._M_sup
+ && !_M_comp(_M_losers[__right]._M_key,
+ _M_losers[__left]._M_key)))
+ {
+ // Left one is less or equal.
+ _M_losers[__root] = _M_losers[__right];
+ return __left;
+ }
+ else
+ {
+ // Right one is less.
+ _M_losers[__root] = _M_losers[__left];
+ return __right;
+ }
+ }
}
- _M_losers[0]._M_sup = _M_sup;
- _M_losers[0]._M_source = _M_source;
- _M_losers[0]._M_key = _M_key;
- }
-};
-
-/**
- * @brief Unstable _LoserTree variant.
- *
- * Stability (non-stable here) is selected with partial specialization.
- */
-template<typename _Tp, typename _Compare>
-class _LoserTree</* __stable == */false, _Tp, _Compare> :
- public _LoserTreeBase<_Tp, _Compare>
-{
- typedef _LoserTreeBase<_Tp, _Compare> Base;
- using Base::_M_log_k;
- using Base::_M_k;
- using Base::_M_losers;
- using Base::_M_first_insert;
+ void
+ __init()
+ { _M_losers[0] = _M_losers[__init_winner(1)]; }
+
+ /**
+ * Delete the _M_key smallest element and insert the element __key
+ * instead.
+ *
+ * @param __key the _M_key to insert
+ * @param __sup true iff __key is an explicitly marked supremum
+ */
+ // Do not pass a const reference since __key will be used as local
+ // variable.
+ void
+ __delete_min_insert(_Tp __key, bool __sup)
+ {
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
+#endif
-public:
- _LoserTree(unsigned int __k, _Compare __comp)
- : Base::_LoserTreeBase(__k, __comp)
- {}
+ int __source = _M_losers[0]._M_source;
+ for (unsigned int __pos = (_M_k + __source) / 2; __pos > 0;
+ __pos /= 2)
+ {
+ // The smaller one gets promoted.
+ if (__sup || (!_M_losers[__pos]._M_sup
+ && _M_comp(_M_losers[__pos]._M_key, __key)))
+ {
+ // The other one is smaller.
+ std::swap(_M_losers[__pos]._M_sup, __sup);
+ std::swap(_M_losers[__pos]._M_source, __source);
+ std::swap(_M_losers[__pos]._M_key, __key);
+ }
+ }
+
+ _M_losers[0]._M_sup = __sup;
+ _M_losers[0]._M_source = __source;
+ _M_losers[0]._M_key = __key;
+ }
+ };
/**
- * Computes the winner of the competition at position "__root".
- *
- * Called recursively (starting at 0) to build the initial tree.
- *
- * @param __root __index of the "game" to start.
+ * @brief Base class of _Loser Tree implementation using pointers.
*/
- unsigned int
- __init_winner (unsigned int __root)
- {
- if (__root >= _M_k)
+ template<typename _Tp, typename _Compare>
+ class _LoserTreePointerBase
+ {
+ protected:
+ /** @brief Internal representation of _LoserTree __elements. */
+ struct _Loser
{
- return __root;
- }
- else
+ bool _M_sup;
+ int _M_source;
+ const _Tp* _M_keyp;
+ };
+
+ unsigned int _M_ik, _M_k, _M_offset;
+ _Loser* _M_losers;
+ _Compare _M_comp;
+
+ public:
+ _LoserTreePointerBase(unsigned int __k,
+ _Compare __comp = std::less<_Tp>())
+ : _M_comp(__comp)
{
- unsigned int __left = __init_winner (2 * __root);
- unsigned int __right = __init_winner (2 * __root + 1);
- if (_M_losers[__right]._M_sup
- || (!_M_losers[__left]._M_sup
- && !_M_comp(_M_losers[__right]._M_key, _M_losers[__left]._M_key)))
- {
- // Left one is less or equal.
- _M_losers[__root] = _M_losers[__right];
- return __left;
- }
- else
- {
- // Right one is less.
- _M_losers[__root] = _M_losers[__left];
- return __right;
- }
+ _M_ik = __k;
+
+ // Next greater power of 2.
+ _M_k = 1 << (__rd_log2(_M_ik - 1) + 1);
+ _M_offset = _M_k;
+ _M_losers = new _Loser[_M_k * 2];
+ for (unsigned int __i = _M_ik - 1; __i < _M_k; __i++)
+ _M_losers[__i + _M_k]._M_sup = true;
}
- }
- inline void
- __init()
- { _M_losers[0] = _M_losers[__init_winner(1)]; }
+ ~_LoserTreePointerBase()
+ { ::operator delete[](_M_losers); }
- /**
- * Delete the _M_key smallest element and insert the element _M_key instead.
- *
- * @param _M_key the _M_key to insert
- * @param _M_sup true iff _M_key is an explicitly marked supremum
- */
- // Do not pass a const reference since _M_key will be used as local variable.
- inline void
- __delete_min_insert(_Tp _M_key, bool _M_sup)
- {
-#if _GLIBCXX_ASSERTIONS
- // no dummy sequence can ever be at the top!
- _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
-#endif
+ int __get_min_source()
+ { return _M_losers[0]._M_source; }
- int _M_source = _M_losers[0]._M_source;
- for (unsigned int __pos = (_M_k + _M_source) / 2; __pos > 0; __pos /= 2)
- {
- // The smaller one gets promoted.
- if (_M_sup || (!_M_losers[__pos]._M_sup
- && _M_comp(_M_losers[__pos]._M_key, _M_key)))
+ void __insert_start(const _Tp& __key, int __source, bool __sup)
{
- // The other one is smaller.
- std::swap(_M_losers[__pos]._M_sup, _M_sup);
- std::swap(_M_losers[__pos]._M_source, _M_source);
- std::swap(_M_losers[__pos]._M_key, _M_key);
+ unsigned int __pos = _M_k + __source;
+
+ _M_losers[__pos]._M_sup = __sup;
+ _M_losers[__pos]._M_source = __source;
+ _M_losers[__pos]._M_keyp = &__key;
}
- }
+ };
- _M_losers[0]._M_sup = _M_sup;
- _M_losers[0]._M_source = _M_source;
- _M_losers[0]._M_key = _M_key;
- }
-};
+ /**
+ * @brief Stable _LoserTree implementation.
+ *
+ * The unstable variant is implemented using partial instantiation below.
+ */
+ template<bool __stable/* default == true */, typename _Tp, typename _Compare>
+ class _LoserTreePointer
+ : public _LoserTreePointerBase<_Tp, _Compare>
+ {
+ typedef _LoserTreePointerBase<_Tp, _Compare> _Base;
+ using _Base::_M_k;
+ using _Base::_M_losers;
+ public:
+ _LoserTreePointer(unsigned int __k, _Compare __comp = std::less<_Tp>())
+ : _Base::_LoserTreePointerBase(__k, __comp)
+ { }
-/**
- * @brief Base class of _Loser Tree implementation using pointers.
- */
-template<typename _Tp, typename _Compare>
-class _LoserTreePointerBase
-{
-protected:
- /** @brief Internal representation of _LoserTree __elements. */
- struct _Loser
- {
- bool _M_sup;
- int _M_source;
- const _Tp* _M_keyp;
- };
-
- unsigned int _M_ik, _M_k, _M_offset;
- _Loser* _M_losers;
- _Compare _M_comp;
-
-public:
- _LoserTreePointerBase(unsigned int __k, _Compare __comp = std::less<_Tp>())
- : _M_comp(__comp)
- {
- _M_ik = __k;
-
- // Next greater power of 2.
- _M_k = 1 << (__rd_log2(_M_ik - 1) + 1);
- _M_offset = _M_k;
- _M_losers = new _Loser[_M_k * 2];
- for (unsigned int __i = _M_ik - 1; __i < _M_k; __i++)
- _M_losers[__i + _M_k]._M_sup = true;
- }
-
- ~_LoserTreePointerBase()
- { ::operator delete[](_M_losers); }
-
- int __get_min_source()
- { return _M_losers[0]._M_source; }
-
- void __insert_start(const _Tp& _M_key, int _M_source, bool _M_sup)
- {
- unsigned int __pos = _M_k + _M_source;
-
- _M_losers[__pos]._M_sup = _M_sup;
- _M_losers[__pos]._M_source = _M_source;
- _M_losers[__pos]._M_keyp = &_M_key;
- }
-};
-
-/**
- * @brief Stable _LoserTree implementation.
- *
- * The unstable variant is implemented using partial instantiation below.
- */
-template<bool __stable/* default == true */, typename _Tp, typename _Compare>
-class _LoserTreePointer : public _LoserTreePointerBase<_Tp, _Compare>
-{
- typedef _LoserTreePointerBase<_Tp, _Compare> Base;
- using Base::_M_k;
- using Base::_M_losers;
-
-public:
- _LoserTreePointer(unsigned int __k, _Compare __comp = std::less<_Tp>())
- : Base::_LoserTreePointerBase(__k, __comp)
- {}
-
- unsigned int
- __init_winner(unsigned int __root)
- {
- if (__root >= _M_k)
- {
- return __root;
- }
- else
+ unsigned int
+ __init_winner(unsigned int __root)
{
- unsigned int __left = __init_winner (2 * __root);
- unsigned int __right = __init_winner (2 * __root + 1);
- if (_M_losers[__right]._M_sup
- || (!_M_losers[__left]._M_sup
- && !_M_comp(*_M_losers[__right]._M_keyp,
- *_M_losers[__left]._M_keyp)))
- {
- // Left one is less or equal.
- _M_losers[__root] = _M_losers[__right];
- return __left;
- }
- else
- {
- // Right one is less.
- _M_losers[__root] = _M_losers[__left];
- return __right;
- }
+ if (__root >= _M_k)
+ return __root;
+ else
+ {
+ unsigned int __left = __init_winner(2 * __root);
+ unsigned int __right = __init_winner(2 * __root + 1);
+ if (_M_losers[__right]._M_sup
+ || (!_M_losers[__left]._M_sup
+ && !_M_comp(*_M_losers[__right]._M_keyp,
+ *_M_losers[__left]._M_keyp)))
+ {
+ // Left one is less or equal.
+ _M_losers[__root] = _M_losers[__right];
+ return __left;
+ }
+ else
+ {
+ // Right one is less.
+ _M_losers[__root] = _M_losers[__left];
+ return __right;
+ }
+ }
}
- }
- void __init()
- { _M_losers[0] = _M_losers[__init_winner(1)]; }
+ void __init()
+ { _M_losers[0] = _M_losers[__init_winner(1)]; }
- void __delete_min_insert(const _Tp& _M_key, bool _M_sup)
- {
+ void __delete_min_insert(const _Tp& __key, bool __sup)
+ {
#if _GLIBCXX_ASSERTIONS
- // no dummy sequence can ever be at the top!
- _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
#endif
- const _Tp* _M_keyp = &_M_key;
- int _M_source = _M_losers[0]._M_source;
- for (unsigned int __pos = (_M_k + _M_source) / 2; __pos > 0; __pos /= 2)
- {
- // The smaller one gets promoted, ties are broken by _M_source.
- if ((_M_sup && (!_M_losers[__pos]._M_sup ||
- _M_losers[__pos]._M_source < _M_source)) ||
- (!_M_sup && !_M_losers[__pos]._M_sup &&
- ((_M_comp(*_M_losers[__pos]._M_keyp, *_M_keyp)) ||
- (!_M_comp(*_M_keyp, *_M_losers[__pos]._M_keyp)
- && _M_losers[__pos]._M_source < _M_source))))
- {
- // The other one is smaller.
- std::swap(_M_losers[__pos]._M_sup, _M_sup);
- std::swap(_M_losers[__pos]._M_source, _M_source);
- std::swap(_M_losers[__pos]._M_keyp, _M_keyp);
- }
+ const _Tp* __keyp = &__key;
+ int __source = _M_losers[0]._M_source;
+ for (unsigned int __pos = (_M_k + __source) / 2; __pos > 0;
+ __pos /= 2)
+ {
+ // The smaller one gets promoted, ties are broken by __source.
+ if ((__sup && (!_M_losers[__pos]._M_sup
+ || _M_losers[__pos]._M_source < __source))
+ || (!__sup && !_M_losers[__pos]._M_sup &&
+ ((_M_comp(*_M_losers[__pos]._M_keyp, *__keyp))
+ || (!_M_comp(*__keyp, *_M_losers[__pos]._M_keyp)
+ && _M_losers[__pos]._M_source < __source))))
+ {
+ // The other one is smaller.
+ std::swap(_M_losers[__pos]._M_sup, __sup);
+ std::swap(_M_losers[__pos]._M_source, __source);
+ std::swap(_M_losers[__pos]._M_keyp, __keyp);
+ }
+ }
+
+ _M_losers[0]._M_sup = __sup;
+ _M_losers[0]._M_source = __source;
+ _M_losers[0]._M_keyp = __keyp;
}
+ };
- _M_losers[0]._M_sup = _M_sup;
- _M_losers[0]._M_source = _M_source;
- _M_losers[0]._M_keyp = _M_keyp;
- }
-};
-
-/**
- * @brief Unstable _LoserTree implementation.
- *
- * The stable variant is above.
- */
-template<typename _Tp, typename _Compare>
-class _LoserTreePointer</* __stable == */false, _Tp, _Compare> :
- public _LoserTreePointerBase<_Tp, _Compare>
-{
- typedef _LoserTreePointerBase<_Tp, _Compare> Base;
- using Base::_M_k;
- using Base::_M_losers;
-
-public:
- _LoserTreePointer(unsigned int __k, _Compare __comp = std::less<_Tp>())
- : Base::_LoserTreePointerBase(__k, __comp)
- {}
-
- unsigned int
- __init_winner(unsigned int __root)
- {
- if (__root >= _M_k)
- {
- return __root;
- }
- else
+ /**
+ * @brief Unstable _LoserTree implementation.
+ *
+ * The stable variant is above.
+ */
+ template<typename _Tp, typename _Compare>
+ class _LoserTreePointer</* __stable == */false, _Tp, _Compare>
+ : public _LoserTreePointerBase<_Tp, _Compare>
+ {
+ typedef _LoserTreePointerBase<_Tp, _Compare> _Base;
+ using _Base::_M_k;
+ using _Base::_M_losers;
+
+ public:
+ _LoserTreePointer(unsigned int __k, _Compare __comp = std::less<_Tp>())
+ : _Base::_LoserTreePointerBase(__k, __comp)
+ { }
+
+ unsigned int
+ __init_winner(unsigned int __root)
{
- unsigned int __left = __init_winner (2 * __root);
- unsigned int __right = __init_winner (2 * __root + 1);
- if (_M_losers[__right]._M_sup
- || (!_M_losers[__left]._M_sup
- && !_M_comp(*_M_losers[__right]._M_keyp,
- *_M_losers[__left]._M_keyp)))
- {
- // Left one is less or equal.
- _M_losers[__root] = _M_losers[__right];
- return __left;
- }
- else
- {
- // Right one is less.
- _M_losers[__root] = _M_losers[__left];
- return __right;
- }
+ if (__root >= _M_k)
+ return __root;
+ else
+ {
+ unsigned int __left = __init_winner(2 * __root);
+ unsigned int __right = __init_winner(2 * __root + 1);
+ if (_M_losers[__right]._M_sup
+ || (!_M_losers[__left]._M_sup
+ && !_M_comp(*_M_losers[__right]._M_keyp,
+ *_M_losers[__left]._M_keyp)))
+ {
+ // Left one is less or equal.
+ _M_losers[__root] = _M_losers[__right];
+ return __left;
+ }
+ else
+ {
+ // Right one is less.
+ _M_losers[__root] = _M_losers[__left];
+ return __right;
+ }
+ }
}
- }
- void __init()
- { _M_losers[0] = _M_losers[__init_winner(1)]; }
+ void __init()
+ { _M_losers[0] = _M_losers[__init_winner(1)]; }
- void __delete_min_insert(const _Tp& _M_key, bool _M_sup)
- {
+ void __delete_min_insert(const _Tp& __key, bool __sup)
+ {
#if _GLIBCXX_ASSERTIONS
- // no dummy sequence can ever be at the top!
- _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
#endif
- const _Tp* _M_keyp = &_M_key;
- int _M_source = _M_losers[0]._M_source;
- for (unsigned int __pos = (_M_k + _M_source) / 2; __pos > 0; __pos /= 2)
- {
- // The smaller one gets promoted.
- if (_M_sup || (!_M_losers[__pos]._M_sup
- && _M_comp(*_M_losers[__pos]._M_keyp, *_M_keyp)))
- {
- // The other one is smaller.
- std::swap(_M_losers[__pos]._M_sup, _M_sup);
- std::swap(_M_losers[__pos]._M_source, _M_source);
- std::swap(_M_losers[__pos]._M_keyp, _M_keyp);
- }
+ const _Tp* __keyp = &__key;
+ int __source = _M_losers[0]._M_source;
+ for (unsigned int __pos = (_M_k + __source) / 2; __pos > 0;
+ __pos /= 2)
+ {
+ // The smaller one gets promoted.
+ if (__sup || (!_M_losers[__pos]._M_sup
+ && _M_comp(*_M_losers[__pos]._M_keyp, *__keyp)))
+ {
+ // The other one is smaller.
+ std::swap(_M_losers[__pos]._M_sup, __sup);
+ std::swap(_M_losers[__pos]._M_source, __source);
+ std::swap(_M_losers[__pos]._M_keyp, __keyp);
+ }
+ }
+
+ _M_losers[0]._M_sup = __sup;
+ _M_losers[0]._M_source = __source;
+ _M_losers[0]._M_keyp = __keyp;
}
+ };
- _M_losers[0]._M_sup = _M_sup;
- _M_losers[0]._M_source = _M_source;
- _M_losers[0]._M_keyp = _M_keyp;
- }
-};
-
-/** @brief Base class for unguarded _LoserTree implementation.
- *
- * The whole element is copied into the tree structure.
- *
- * No guarding is done, therefore not a single input sequence must
- * run empty. Unused __sequence heads are marked with a sentinel which
- * is &gt; all elements that are to be merged.
- *
- * This is a very fast variant.
- */
-template<typename _Tp, typename _Compare>
-class _LoserTreeUnguardedBase
-{
-protected:
- struct _Loser
- {
- int _M_source;
- _Tp _M_key;
- };
-
- unsigned int _M_ik, _M_k, _M_offset;
- _Loser* _M_losers;
- _Compare _M_comp;
-
-public:
- inline
- _LoserTreeUnguardedBase(unsigned int __k, const _Tp _sentinel,
- _Compare __comp = std::less<_Tp>())
- : _M_comp(__comp)
- {
- _M_ik = __k;
-
- // Next greater power of 2.
- _M_k = 1 << (__rd_log2(_M_ik - 1) + 1);
- _M_offset = _M_k;
- // Avoid default-constructing _M_losers[]._M_key
- _M_losers
- = static_cast<_Loser*>(::operator new(2 * _M_k * sizeof(_Loser)));
-
- for (unsigned int __i = _M_k + _M_ik - 1; __i < (2 * _M_k); ++__i)
+ /** @brief Base class for unguarded _LoserTree implementation.
+ *
+ * The whole element is copied into the tree structure.
+ *
+ * No guarding is done, therefore not a single input sequence must
+ * run empty. Unused __sequence heads are marked with a sentinel which
+ * is &gt; all elements that are to be merged.
+ *
+ * This is a very fast variant.
+ */
+ template<typename _Tp, typename _Compare>
+ class _LoserTreeUnguardedBase
+ {
+ protected:
+ struct _Loser
+ {
+ int _M_source;
+ _Tp _M_key;
+ };
+
+ unsigned int _M_ik, _M_k, _M_offset;
+ _Loser* _M_losers;
+ _Compare _M_comp;
+
+ public:
+ _LoserTreeUnguardedBase(unsigned int __k, const _Tp __sentinel,
+ _Compare __comp = std::less<_Tp>())
+ : _M_comp(__comp)
{
- _M_losers[__i]._M_key = _sentinel;
- _M_losers[__i]._M_source = -1;
+ _M_ik = __k;
+
+ // Next greater power of 2.
+ _M_k = 1 << (__rd_log2(_M_ik - 1) + 1);
+ _M_offset = _M_k;
+ // Avoid default-constructing _M_losers[]._M_key
+ _M_losers = static_cast<_Loser*>(::operator new(2 * _M_k
+ * sizeof(_Loser)));
+
+ for (unsigned int __i = _M_k + _M_ik - 1; __i < (2 * _M_k); ++__i)
+ {
+ _M_losers[__i]._M_key = __sentinel;
+ _M_losers[__i]._M_source = -1;
+ }
}
- }
- inline ~_LoserTreeUnguardedBase()
- { ::operator delete(_M_losers); }
+ ~_LoserTreeUnguardedBase()
+ { ::operator delete(_M_losers); }
- inline int
- __get_min_source()
- {
+ int
+ __get_min_source()
+ {
#if _GLIBCXX_ASSERTIONS
- // no dummy sequence can ever be at the top!
- _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
#endif
- return _M_losers[0]._M_source;
- }
-
- inline void
- __insert_start(const _Tp& _M_key, int _M_source, bool)
- {
- unsigned int __pos = _M_k + _M_source;
-
- new(&(_M_losers[__pos]._M_key)) _Tp(_M_key);
- _M_losers[__pos]._M_source = _M_source;
- }
-};
-
-/**
- * @brief Stable implementation of unguarded _LoserTree.
- *
- * Unstable variant is selected below with partial specialization.
- */
-template<bool __stable/* default == true */, typename _Tp, typename _Compare>
-class _LoserTreeUnguarded : public _LoserTreeUnguardedBase<_Tp, _Compare>
-{
- typedef _LoserTreeUnguardedBase<_Tp, _Compare> Base;
- using Base::_M_k;
- using Base::_M_losers;
-
-public:
- _LoserTreeUnguarded(unsigned int __k, const _Tp _sentinel,
- _Compare __comp = std::less<_Tp>())
- : Base::_LoserTreeUnguardedBase(__k, _sentinel, __comp)
- {}
-
- unsigned int
- __init_winner(unsigned int __root)
- {
- if (__root >= _M_k)
+ return _M_losers[0]._M_source;
+ }
+
+ void
+ __insert_start(const _Tp& __key, int __source, bool)
{
- return __root;
+ unsigned int __pos = _M_k + __source;
+
+ new(&(_M_losers[__pos]._M_key)) _Tp(__key);
+ _M_losers[__pos]._M_source = __source;
}
- else
+ };
+
+ /**
+ * @brief Stable implementation of unguarded _LoserTree.
+ *
+ * Unstable variant is selected below with partial specialization.
+ */
+ template<bool __stable/* default == true */, typename _Tp, typename _Compare>
+ class _LoserTreeUnguarded
+ : public _LoserTreeUnguardedBase<_Tp, _Compare>
+ {
+ typedef _LoserTreeUnguardedBase<_Tp, _Compare> _Base;
+ using _Base::_M_k;
+ using _Base::_M_losers;
+
+ public:
+ _LoserTreeUnguarded(unsigned int __k, const _Tp __sentinel,
+ _Compare __comp = std::less<_Tp>())
+ : _Base::_LoserTreeUnguardedBase(__k, __sentinel, __comp)
+ { }
+
+ unsigned int
+ __init_winner(unsigned int __root)
{
- unsigned int __left = __init_winner (2 * __root);
- unsigned int __right = __init_winner (2 * __root + 1);
- if (!_M_comp(_M_losers[__right]._M_key, _M_losers[__left]._M_key))
- {
- // Left one is less or equal.
- _M_losers[__root] = _M_losers[__right];
- return __left;
- }
- else
- {
- // Right one is less.
- _M_losers[__root] = _M_losers[__left];
- return __right;
- }
+ if (__root >= _M_k)
+ return __root;
+ else
+ {
+ unsigned int __left = __init_winner(2 * __root);
+ unsigned int __right = __init_winner(2 * __root + 1);
+ if (!_M_comp(_M_losers[__right]._M_key,
+ _M_losers[__left]._M_key))
+ {
+ // Left one is less or equal.
+ _M_losers[__root] = _M_losers[__right];
+ return __left;
+ }
+ else
+ {
+ // Right one is less.
+ _M_losers[__root] = _M_losers[__left];
+ return __right;
+ }
+ }
}
- }
- inline void
- __init()
- {
- _M_losers[0] = _M_losers[__init_winner(1)];
+ void
+ __init()
+ {
+ _M_losers[0] = _M_losers[__init_winner(1)];
#if _GLIBCXX_ASSERTIONS
- // no dummy sequence can ever be at the top at the beginning (0 sequences!)
- _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
+ // no dummy sequence can ever be at the top at the beginning
+ // (0 sequences!)
+ _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
#endif
- }
+ }
- // Do not pass a const reference since _M_key will be used as local variable.
- inline void
- __delete_min_insert(_Tp _M_key, bool)
- {
+ // Do not pass a const reference since __key will be used as
+ // local variable.
+ void
+ __delete_min_insert(_Tp __key, bool)
+ {
#if _GLIBCXX_ASSERTIONS
- // no dummy sequence can ever be at the top!
- _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
#endif
- int _M_source = _M_losers[0]._M_source;
- for (unsigned int __pos = (_M_k + _M_source) / 2; __pos > 0; __pos /= 2)
- {
- // The smaller one gets promoted, ties are broken by _M_source.
- if (_M_comp(_M_losers[__pos]._M_key, _M_key)
- || (!_M_comp(_M_key, _M_losers[__pos]._M_key)
- && _M_losers[__pos]._M_source < _M_source))
- {
- // The other one is smaller.
- std::swap(_M_losers[__pos]._M_source, _M_source);
- std::swap(_M_losers[__pos]._M_key, _M_key);
- }
+ int __source = _M_losers[0]._M_source;
+ for (unsigned int __pos = (_M_k + __source) / 2; __pos > 0;
+ __pos /= 2)
+ {
+ // The smaller one gets promoted, ties are broken by _M_source.
+ if (_M_comp(_M_losers[__pos]._M_key, __key)
+ || (!_M_comp(__key, _M_losers[__pos]._M_key)
+ && _M_losers[__pos]._M_source < __source))
+ {
+ // The other one is smaller.
+ std::swap(_M_losers[__pos]._M_source, __source);
+ std::swap(_M_losers[__pos]._M_key, __key);
+ }
+ }
+
+ _M_losers[0]._M_source = __source;
+ _M_losers[0]._M_key = __key;
}
+ };
- _M_losers[0]._M_source = _M_source;
- _M_losers[0]._M_key = _M_key;
- }
-};
-
-/**
- * @brief Non-Stable implementation of unguarded _LoserTree.
- *
- * Stable implementation is above.
- */
-template<typename _Tp, typename _Compare>
-class _LoserTreeUnguarded</* __stable == */false, _Tp, _Compare> :
- public _LoserTreeUnguardedBase<_Tp, _Compare>
-{
- typedef _LoserTreeUnguardedBase<_Tp, _Compare> Base;
- using Base::_M_k;
- using Base::_M_losers;
-
-public:
- _LoserTreeUnguarded(unsigned int __k, const _Tp _sentinel,
- _Compare __comp = std::less<_Tp>())
- : Base::_LoserTreeUnguardedBase(__k, _sentinel, __comp)
- {}
-
- unsigned int
- __init_winner (unsigned int __root)
- {
- if (__root >= _M_k)
- {
- return __root;
- }
- else
+ /**
+ * @brief Non-Stable implementation of unguarded _LoserTree.
+ *
+ * Stable implementation is above.
+ */
+ template<typename _Tp, typename _Compare>
+ class _LoserTreeUnguarded</* __stable == */false, _Tp, _Compare>
+ : public _LoserTreeUnguardedBase<_Tp, _Compare>
+ {
+ typedef _LoserTreeUnguardedBase<_Tp, _Compare> _Base;
+ using _Base::_M_k;
+ using _Base::_M_losers;
+
+ public:
+ _LoserTreeUnguarded(unsigned int __k, const _Tp __sentinel,
+ _Compare __comp = std::less<_Tp>())
+ : _Base::_LoserTreeUnguardedBase(__k, __sentinel, __comp)
+ { }
+
+ unsigned int
+ __init_winner(unsigned int __root)
{
- unsigned int __left = __init_winner (2 * __root);
- unsigned int __right = __init_winner (2 * __root + 1);
+ if (__root >= _M_k)
+ return __root;
+ else
+ {
+ unsigned int __left = __init_winner(2 * __root);
+ unsigned int __right = __init_winner(2 * __root + 1);
#if _GLIBCXX_ASSERTIONS
- // If __left one is sentinel then __right one must be, too.
- if (_M_losers[__left]._M_source == -1)
- _GLIBCXX_PARALLEL_ASSERT(_M_losers[__right]._M_source == -1);
+ // If __left one is sentinel then __right one must be, too.
+ if (_M_losers[__left]._M_source == -1)
+ _GLIBCXX_PARALLEL_ASSERT(_M_losers[__right]._M_source == -1);
#endif
- if (!_M_comp(_M_losers[__right]._M_key, _M_losers[__left]._M_key))
- {
- // Left one is less or equal.
- _M_losers[__root] = _M_losers[__right];
- return __left;
- }
- else
- {
- // Right one is less.
- _M_losers[__root] = _M_losers[__left];
- return __right;
- }
+ if (!_M_comp(_M_losers[__right]._M_key,
+ _M_losers[__left]._M_key))
+ {
+ // Left one is less or equal.
+ _M_losers[__root] = _M_losers[__right];
+ return __left;
+ }
+ else
+ {
+ // Right one is less.
+ _M_losers[__root] = _M_losers[__left];
+ return __right;
+ }
+ }
}
- }
- inline void
- __init()
- {
- _M_losers[0] = _M_losers[__init_winner(1)];
+ void
+ __init()
+ {
+ _M_losers[0] = _M_losers[__init_winner(1)];
#if _GLIBCXX_ASSERTIONS
- // no dummy sequence can ever be at the top at the beginning (0 sequences!)
- _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
+ // no dummy sequence can ever be at the top at the beginning
+ // (0 sequences!)
+ _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
#endif
- }
+ }
- // Do not pass a const reference since _M_key will be used as local variable.
- inline void
- __delete_min_insert(_Tp _M_key, bool)
- {
+ // Do not pass a const reference since __key will be used as
+ // local variable.
+ void
+ __delete_min_insert(_Tp __key, bool)
+ {
#if _GLIBCXX_ASSERTIONS
- // no dummy sequence can ever be at the top!
- _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
#endif
- int _M_source = _M_losers[0]._M_source;
- for (unsigned int __pos = (_M_k + _M_source) / 2; __pos > 0; __pos /= 2)
- {
- // The smaller one gets promoted.
- if (_M_comp(_M_losers[__pos]._M_key, _M_key))
- {
- // The other one is smaller.
- std::swap(_M_losers[__pos]._M_source, _M_source);
- std::swap(_M_losers[__pos]._M_key, _M_key);
- }
+ int __source = _M_losers[0]._M_source;
+ for (unsigned int __pos = (_M_k + __source) / 2; __pos > 0;
+ __pos /= 2)
+ {
+ // The smaller one gets promoted.
+ if (_M_comp(_M_losers[__pos]._M_key, __key))
+ {
+ // The other one is smaller.
+ std::swap(_M_losers[__pos]._M_source, __source);
+ std::swap(_M_losers[__pos]._M_key, __key);
+ }
+ }
+
+ _M_losers[0]._M_source = __source;
+ _M_losers[0]._M_key = __key;
}
+ };
+
+ /** @brief Unguarded loser tree, keeping only pointers to the
+ * elements in the tree structure.
+ *
+ * No guarding is done, therefore not a single input sequence must
+ * run empty. This is a very fast variant.
+ */
+ template<typename _Tp, typename _Compare>
+ class _LoserTreePointerUnguardedBase
+ {
+ protected:
+ struct _Loser
+ {
+ int _M_source;
+ const _Tp* _M_keyp;
+ };
- _M_losers[0]._M_source = _M_source;
- _M_losers[0]._M_key = _M_key;
- }
-};
+ unsigned int _M_ik, _M_k, _M_offset;
+ _Loser* _M_losers;
+ _Compare _M_comp;
-/** @brief Unguarded loser tree, keeping only pointers to the
-* elements in the tree structure.
-*
-* No guarding is done, therefore not a single input sequence must
-* run empty. This is a very fast variant.
-*/
-template<typename _Tp, typename _Compare>
-class LoserTreePointerUnguardedBase
-{
-protected:
- struct _Loser
- {
- int _M_source;
- const _Tp* _M_keyp;
- };
-
- unsigned int _M_ik, _M_k, _M_offset;
- _Loser* _M_losers;
- _Compare _M_comp;
-
-public:
-
- inline
- LoserTreePointerUnguardedBase(unsigned int __k, const _Tp& _sentinel,
- _Compare __comp = std::less<_Tp>())
- : _M_comp(__comp)
- {
- _M_ik = __k;
-
- // Next greater power of 2.
- _M_k = 1 << (__rd_log2(_M_ik - 1) + 1);
- _M_offset = _M_k;
- // Avoid default-constructing _M_losers[]._M_key
- _M_losers = new _Loser[2 * _M_k];
-
- for (unsigned int __i = _M_k + _M_ik - 1; __i < (2 * _M_k); ++__i)
+ public:
+
+ _LoserTreePointerUnguardedBase(unsigned int __k, const _Tp& __sentinel,
+ _Compare __comp = std::less<_Tp>())
+ : _M_comp(__comp)
{
- _M_losers[__i]._M_keyp = &_sentinel;
- _M_losers[__i]._M_source = -1;
+ _M_ik = __k;
+
+ // Next greater power of 2.
+ _M_k = 1 << (__rd_log2(_M_ik - 1) + 1);
+ _M_offset = _M_k;
+ // Avoid default-constructing _M_losers[]._M_key
+ _M_losers = new _Loser[2 * _M_k];
+
+ for (unsigned int __i = _M_k + _M_ik - 1; __i < (2 * _M_k); ++__i)
+ {
+ _M_losers[__i]._M_keyp = &__sentinel;
+ _M_losers[__i]._M_source = -1;
+ }
}
- }
- inline ~LoserTreePointerUnguardedBase()
- { delete[] _M_losers; }
+ ~_LoserTreePointerUnguardedBase()
+ { delete[] _M_losers; }
- inline int
- __get_min_source()
- {
+ int
+ __get_min_source()
+ {
#if _GLIBCXX_ASSERTIONS
- // no dummy sequence can ever be at the top!
- _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
#endif
- return _M_losers[0]._M_source;
- }
-
- inline void
- __insert_start(const _Tp& _M_key, int _M_source, bool)
- {
- unsigned int __pos = _M_k + _M_source;
-
- _M_losers[__pos]._M_keyp = &_M_key;
- _M_losers[__pos]._M_source = _M_source;
- }
-};
-
-/**
- * @brief Stable unguarded _LoserTree variant storing pointers.
- *
- * Unstable variant is implemented below using partial specialization.
- */
-template<bool __stable/* default == true */, typename _Tp, typename _Compare>
-class _LoserTreePointerUnguarded :
- public LoserTreePointerUnguardedBase<_Tp, _Compare>
-{
- typedef LoserTreePointerUnguardedBase<_Tp, _Compare> Base;
- using Base::_M_k;
- using Base::_M_losers;
-
-public:
- _LoserTreePointerUnguarded(unsigned int __k, const _Tp& _sentinel,
- _Compare __comp = std::less<_Tp>())
- : Base::LoserTreePointerUnguardedBase(__k, _sentinel, __comp)
- {}
-
- unsigned int
- __init_winner(unsigned int __root)
- {
- if (__root >= _M_k)
+ return _M_losers[0]._M_source;
+ }
+
+ void
+ __insert_start(const _Tp& __key, int __source, bool)
{
- return __root;
+ unsigned int __pos = _M_k + __source;
+
+ _M_losers[__pos]._M_keyp = &__key;
+ _M_losers[__pos]._M_source = __source;
}
- else
+ };
+
+ /**
+ * @brief Stable unguarded _LoserTree variant storing pointers.
+ *
+ * Unstable variant is implemented below using partial specialization.
+ */
+ template<bool __stable/* default == true */, typename _Tp, typename _Compare>
+ class _LoserTreePointerUnguarded
+ : public _LoserTreePointerUnguardedBase<_Tp, _Compare>
+ {
+ typedef _LoserTreePointerUnguardedBase<_Tp, _Compare> _Base;
+ using _Base::_M_k;
+ using _Base::_M_losers;
+
+ public:
+ _LoserTreePointerUnguarded(unsigned int __k, const _Tp& __sentinel,
+ _Compare __comp = std::less<_Tp>())
+ : _Base::_LoserTreePointerUnguardedBase(__k, __sentinel, __comp)
+ { }
+
+ unsigned int
+ __init_winner(unsigned int __root)
{
- unsigned int __left = __init_winner (2 * __root);
- unsigned int __right = __init_winner (2 * __root + 1);
- if (!_M_comp(*_M_losers[__right]._M_keyp, *_M_losers[__left]._M_keyp))
- {
- // Left one is less or equal.
- _M_losers[__root] = _M_losers[__right];
- return __left;
- }
- else
- {
- // Right one is less.
- _M_losers[__root] = _M_losers[__left];
- return __right;
- }
+ if (__root >= _M_k)
+ return __root;
+ else
+ {
+ unsigned int __left = __init_winner(2 * __root);
+ unsigned int __right = __init_winner(2 * __root + 1);
+ if (!_M_comp(*_M_losers[__right]._M_keyp,
+ *_M_losers[__left]._M_keyp))
+ {
+ // Left one is less or equal.
+ _M_losers[__root] = _M_losers[__right];
+ return __left;
+ }
+ else
+ {
+ // Right one is less.
+ _M_losers[__root] = _M_losers[__left];
+ return __right;
+ }
+ }
}
- }
- inline void
- __init()
- {
- _M_losers[0] = _M_losers[__init_winner(1)];
+ void
+ __init()
+ {
+ _M_losers[0] = _M_losers[__init_winner(1)];
#if _GLIBCXX_ASSERTIONS
- // no dummy sequence can ever be at the top at the beginning (0 sequences!)
- _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
+ // no dummy sequence can ever be at the top at the beginning
+ // (0 sequences!)
+ _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
#endif
- }
+ }
- inline void
- __delete_min_insert(const _Tp& _M_key, bool _M_sup)
- {
+ void
+ __delete_min_insert(const _Tp& __key, bool __sup)
+ {
#if _GLIBCXX_ASSERTIONS
- // no dummy sequence can ever be at the top!
- _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
#endif
- const _Tp* _M_keyp = &_M_key;
- int _M_source = _M_losers[0]._M_source;
- for (unsigned int __pos = (_M_k + _M_source) / 2; __pos > 0; __pos /= 2)
- {
- // The smaller one gets promoted, ties are broken by _M_source.
- if (_M_comp(*_M_losers[__pos]._M_keyp, *_M_keyp)
- || (!_M_comp(*_M_keyp, *_M_losers[__pos]._M_keyp)
- && _M_losers[__pos]._M_source < _M_source))
- {
- // The other one is smaller.
- std::swap(_M_losers[__pos]._M_source, _M_source);
- std::swap(_M_losers[__pos]._M_keyp, _M_keyp);
- }
+ const _Tp* __keyp = &__key;
+ int __source = _M_losers[0]._M_source;
+ for (unsigned int __pos = (_M_k + __source) / 2; __pos > 0;
+ __pos /= 2)
+ {
+ // The smaller one gets promoted, ties are broken by _M_source.
+ if (_M_comp(*_M_losers[__pos]._M_keyp, *__keyp)
+ || (!_M_comp(*__keyp, *_M_losers[__pos]._M_keyp)
+ && _M_losers[__pos]._M_source < __source))
+ {
+ // The other one is smaller.
+ std::swap(_M_losers[__pos]._M_source, __source);
+ std::swap(_M_losers[__pos]._M_keyp, __keyp);
+ }
+ }
+
+ _M_losers[0]._M_source = __source;
+ _M_losers[0]._M_keyp = __keyp;
}
+ };
- _M_losers[0]._M_source = _M_source;
- _M_losers[0]._M_keyp = _M_keyp;
- }
-};
-
-/**
- * @brief Unstable unguarded _LoserTree variant storing pointers.
- *
- * Stable variant is above.
- */
-template<typename _Tp, typename _Compare>
-class _LoserTreePointerUnguarded</* __stable == */false, _Tp, _Compare> :
- public LoserTreePointerUnguardedBase<_Tp, _Compare>
-{
- typedef LoserTreePointerUnguardedBase<_Tp, _Compare> Base;
- using Base::_M_k;
- using Base::_M_losers;
-
-public:
- _LoserTreePointerUnguarded(unsigned int __k, const _Tp& _sentinel,
- _Compare __comp = std::less<_Tp>())
- : Base::LoserTreePointerUnguardedBase(__k, _sentinel, __comp)
- {}
-
- unsigned int
- __init_winner(unsigned int __root)
- {
- if (__root >= _M_k)
- {
- return __root;
- }
- else
+ /**
+ * @brief Unstable unguarded _LoserTree variant storing pointers.
+ *
+ * Stable variant is above.
+ */
+ template<typename _Tp, typename _Compare>
+ class _LoserTreePointerUnguarded</* __stable == */false, _Tp, _Compare>
+ : public _LoserTreePointerUnguardedBase<_Tp, _Compare>
+ {
+ typedef _LoserTreePointerUnguardedBase<_Tp, _Compare> _Base;
+ using _Base::_M_k;
+ using _Base::_M_losers;
+
+ public:
+ _LoserTreePointerUnguarded(unsigned int __k, const _Tp& __sentinel,
+ _Compare __comp = std::less<_Tp>())
+ : _Base::_LoserTreePointerUnguardedBase(__k, __sentinel, __comp)
+ { }
+
+ unsigned int
+ __init_winner(unsigned int __root)
{
- unsigned int __left = __init_winner (2 * __root);
- unsigned int __right = __init_winner (2 * __root + 1);
+ if (__root >= _M_k)
+ return __root;
+ else
+ {
+ unsigned int __left = __init_winner(2 * __root);
+ unsigned int __right = __init_winner(2 * __root + 1);
#if _GLIBCXX_ASSERTIONS
- // If __left one is sentinel then __right one must be, too.
- if (_M_losers[__left]._M_source == -1)
- _GLIBCXX_PARALLEL_ASSERT(_M_losers[__right]._M_source == -1);
+ // If __left one is sentinel then __right one must be, too.
+ if (_M_losers[__left]._M_source == -1)
+ _GLIBCXX_PARALLEL_ASSERT(_M_losers[__right]._M_source == -1);
#endif
- if (!_M_comp(*_M_losers[__right]._M_keyp, *_M_losers[__left]._M_keyp))
- {
- // Left one is less or equal.
- _M_losers[__root] = _M_losers[__right];
- return __left;
- }
- else
- {
- // Right one is less.
- _M_losers[__root] = _M_losers[__left];
- return __right;
- }
+ if (!_M_comp(*_M_losers[__right]._M_keyp,
+ *_M_losers[__left]._M_keyp))
+ {
+ // Left one is less or equal.
+ _M_losers[__root] = _M_losers[__right];
+ return __left;
+ }
+ else
+ {
+ // Right one is less.
+ _M_losers[__root] = _M_losers[__left];
+ return __right;
+ }
+ }
}
- }
- inline void
- __init()
- {
- _M_losers[0] = _M_losers[__init_winner(1)];
+ void
+ __init()
+ {
+ _M_losers[0] = _M_losers[__init_winner(1)];
#if _GLIBCXX_ASSERTIONS
- // no dummy sequence can ever be at the top at the beginning (0 sequences!)
- _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
+ // no dummy sequence can ever be at the top at the beginning
+ // (0 sequences!)
+ _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
#endif
- }
+ }
- inline void
- __delete_min_insert(const _Tp& _M_key, bool _M_sup)
- {
+ void
+ __delete_min_insert(const _Tp& __key, bool __sup)
+ {
#if _GLIBCXX_ASSERTIONS
- // no dummy sequence can ever be at the top!
- _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
#endif
- const _Tp* _M_keyp = &_M_key;
- int _M_source = _M_losers[0]._M_source;
- for (unsigned int __pos = (_M_k + _M_source) / 2; __pos > 0; __pos /= 2)
- {
- // The smaller one gets promoted.
- if (_M_comp(*(_M_losers[__pos]._M_keyp), *_M_keyp))
- {
- // The other one is smaller.
- std::swap(_M_losers[__pos]._M_source, _M_source);
- std::swap(_M_losers[__pos]._M_keyp, _M_keyp);
- }
+ const _Tp* __keyp = &__key;
+ int __source = _M_losers[0]._M_source;
+ for (unsigned int __pos = (_M_k + __source) / 2; __pos > 0;
+ __pos /= 2)
+ {
+ // The smaller one gets promoted.
+ if (_M_comp(*(_M_losers[__pos]._M_keyp), *__keyp))
+ {
+ // The other one is smaller.
+ std::swap(_M_losers[__pos]._M_source, __source);
+ std::swap(_M_losers[__pos]._M_keyp, __keyp);
+ }
+ }
+
+ _M_losers[0]._M_source = __source;
+ _M_losers[0]._M_keyp = __keyp;
}
-
- _M_losers[0]._M_source = _M_source;
- _M_losers[0]._M_keyp = _M_keyp;
- }
-};
-
+ };
} // namespace __gnu_parallel
#endif /* _GLIBCXX_PARALLEL_LOSERTREE_H */
diff --git a/libstdc++-v3/include/parallel/merge.h b/libstdc++-v3/include/parallel/merge.h
index c323c629893..a19e996a055 100644
--- a/libstdc++-v3/include/parallel/merge.h
+++ b/libstdc++-v3/include/parallel/merge.h
@@ -37,11 +37,11 @@
namespace __gnu_parallel
{
- /** @brief Merge routine being able to merge only the @__c __max_length
+ /** @brief Merge routine being able to merge only the @c __max_length
* smallest elements.
*
- * The @__c __begin iterators are advanced accordingly, they might not
- * reach @__c __end, in contrast to the usual variant.
+ * The @c __begin iterators are advanced accordingly, they might not
+ * reach @c __end, in contrast to the usual variant.
* @param __begin1 Begin iterator of first sequence.
* @param __end1 End iterator of first sequence.
* @param __begin2 Begin iterator of second sequence.
@@ -54,11 +54,10 @@ namespace __gnu_parallel
typename _OutputIterator, typename _DifferenceTp,
typename _Compare>
_OutputIterator
- __merge_advance_usual(_RAIter1& __begin1,
- _RAIter1 __end1,
- _RAIter2& __begin2,
- _RAIter2 __end2, _OutputIterator __target,
- _DifferenceTp __max_length, _Compare __comp)
+ __merge_advance_usual(_RAIter1& __begin1, _RAIter1 __end1,
+ _RAIter2& __begin2, _RAIter2 __end2,
+ _OutputIterator __target,
+ _DifferenceTp __max_length, _Compare __comp)
{
typedef _DifferenceTp _DifferenceType;
while (__begin1 != __end1 && __begin2 != __end2 && __max_length > 0)
@@ -84,11 +83,11 @@ namespace __gnu_parallel
return __target;
}
- /** @brief Merge routine being able to merge only the @__c __max_length
+ /** @brief Merge routine being able to merge only the @c __max_length
* smallest elements.
*
- * The @__c __begin iterators are advanced accordingly, they might not
- * reach @__c __end, in contrast to the usual variant.
+ * The @c __begin iterators are advanced accordingly, they might not
+ * reach @c __end, in contrast to the usual variant.
* Specially designed code should allow the compiler to generate
* conditional moves instead of branches.
* @param __begin1 Begin iterator of first sequence.
@@ -103,12 +102,10 @@ namespace __gnu_parallel
typename _OutputIterator, typename _DifferenceTp,
typename _Compare>
_OutputIterator
- __merge_advance_movc(_RAIter1& __begin1,
- _RAIter1 __end1,
- _RAIter2& __begin2,
- _RAIter2 __end2,
- _OutputIterator __target,
- _DifferenceTp __max_length, _Compare __comp)
+ __merge_advance_movc(_RAIter1& __begin1, _RAIter1 __end1,
+ _RAIter2& __begin2, _RAIter2 __end2,
+ _OutputIterator __target,
+ _DifferenceTp __max_length, _Compare __comp)
{
typedef _DifferenceTp _DifferenceType;
typedef typename std::iterator_traits<_RAIter1>::value_type
@@ -153,11 +150,11 @@ namespace __gnu_parallel
return __target;
}
- /** @brief Merge routine being able to merge only the @__c __max_length
+ /** @brief Merge routine being able to merge only the @c __max_length
* smallest elements.
*
- * The @__c __begin iterators are advanced accordingly, they might not
- * reach @__c __end, in contrast to the usual variant.
+ * The @c __begin iterators are advanced accordingly, they might not
+ * reach @c __end, in contrast to the usual variant.
* Static switch on whether to use the conditional-move variant.
* @param __begin1 Begin iterator of first sequence.
* @param __end1 End iterator of first sequence.
@@ -172,14 +169,14 @@ namespace __gnu_parallel
typename _Compare>
inline _OutputIterator
__merge_advance(_RAIter1& __begin1, _RAIter1 __end1,
- _RAIter2& __begin2, _RAIter2 __end2,
- _OutputIterator __target, _DifferenceTp __max_length,
- _Compare __comp)
+ _RAIter2& __begin2, _RAIter2 __end2,
+ _OutputIterator __target, _DifferenceTp __max_length,
+ _Compare __comp)
{
_GLIBCXX_CALL(__max_length)
- return __merge_advance_movc(__begin1, __end1, __begin2, __end2, __target,
- __max_length, __comp);
+ return __merge_advance_movc(__begin1, __end1, __begin2, __end2,
+ __target, __max_length, __comp);
}
/** @brief Merge routine fallback to sequential in case the
@@ -195,23 +192,21 @@ namespace __gnu_parallel
template<typename _RAIter1, typename _RAIter2,
typename _RAIter3, typename _Compare>
inline _RAIter3
- __parallel_merge_advance(_RAIter1& __begin1,
- _RAIter1 __end1,
- _RAIter2& __begin2,
- // different iterators, parallel implementation
- // not available
- _RAIter2 __end2,
- _RAIter3 __target, typename
- std::iterator_traits<_RAIter1>::
- difference_type __max_length, _Compare __comp)
+ __parallel_merge_advance(_RAIter1& __begin1, _RAIter1 __end1,
+ _RAIter2& __begin2,
+ // different iterators, parallel implementation
+ // not available
+ _RAIter2 __end2, _RAIter3 __target, typename
+ std::iterator_traits<_RAIter1>::
+ difference_type __max_length, _Compare __comp)
{ return __merge_advance(__begin1, __end1, __begin2, __end2, __target,
- __max_length, __comp); }
+ __max_length, __comp); }
- /** @brief Parallel merge routine being able to merge only the @__c
+ /** @brief Parallel merge routine being able to merge only the @c
* __max_length smallest elements.
*
- * The @__c __begin iterators are advanced accordingly, they might not
- * reach @__c __end, in contrast to the usual variant.
+ * The @c __begin iterators are advanced accordingly, they might not
+ * reach @c __end, in contrast to the usual variant.
* The functionality is projected onto parallel_multiway_merge.
* @param __begin1 Begin iterator of first sequence.
* @param __end1 End iterator of first sequence.
@@ -225,13 +220,11 @@ namespace __gnu_parallel
template<typename _RAIter1, typename _RAIter3,
typename _Compare>
inline _RAIter3
- __parallel_merge_advance(_RAIter1& __begin1,
- _RAIter1 __end1,
- _RAIter1& __begin2,
- _RAIter1 __end2,
- _RAIter3 __target, typename
- std::iterator_traits<_RAIter1>::
- difference_type __max_length, _Compare __comp)
+ __parallel_merge_advance(_RAIter1& __begin1, _RAIter1 __end1,
+ _RAIter1& __begin2, _RAIter1 __end2,
+ _RAIter3 __target, typename
+ std::iterator_traits<_RAIter1>::
+ difference_type __max_length, _Compare __comp)
{
typedef typename
std::iterator_traits<_RAIter1>::value_type _ValueType;
@@ -242,17 +235,14 @@ namespace __gnu_parallel
typedef typename std::pair<_RAIter1, _RAIter1>
_IteratorPair;
- _IteratorPair
- seqs[2] = { std::make_pair(__begin1, __end1),
- std::make_pair(__begin2, __end2) };
- _RAIter3
- __target_end = parallel_multiway_merge
- < /* __stable = */ true, /* __sentinels = */ false>(
- seqs, seqs + 2, __target,
- multiway_merge_exact_splitting
- < /* __stable = */ true, _IteratorPair*,
- _Compare, _DifferenceType1>,
- __max_length, __comp, omp_get_max_threads());
+ _IteratorPair __seqs[2] = { std::make_pair(__begin1, __end1),
+ std::make_pair(__begin2, __end2) };
+ _RAIter3 __target_end = parallel_multiway_merge
+ < /* __stable = */ true, /* __sentinels = */ false>
+ (__seqs, __seqs + 2, __target, multiway_merge_exact_splitting
+ < /* __stable = */ true, _IteratorPair*,
+ _Compare, _DifferenceType1>, __max_length, __comp,
+ omp_get_max_threads());
return __target_end;
}
diff --git a/libstdc++-v3/include/parallel/multiseq_selection.h b/libstdc++-v3/include/parallel/multiseq_selection.h
index fdce872c5a1..e434eee624c 100644
--- a/libstdc++-v3/include/parallel/multiseq_selection.h
+++ b/libstdc++-v3/include/parallel/multiseq_selection.h
@@ -53,8 +53,8 @@ namespace __gnu_parallel
/** @brief Compare __a pair of types lexicographically, ascending. */
template<typename _T1, typename _T2, typename _Compare>
class _Lexicographic
- : public std::binary_function<
- std::pair<_T1, _T2>, std::pair<_T1, _T2>, bool>
+ : public std::binary_function<std::pair<_T1, _T2>,
+ std::pair<_T1, _T2>, bool>
{
private:
_Compare& _M_comp;
@@ -142,19 +142,19 @@ namespace __gnu_parallel
// Number of sequences, number of elements in total (possibly
// including padding).
- _DifferenceType __m = std::distance(__begin_seqs, __end_seqs), __N = 0,
+ _DifferenceType __m = std::distance(__begin_seqs, __end_seqs), __nn = 0,
__nmax, __n, __r;
for (int __i = 0; __i < __m; __i++)
{
- __N += std::distance(__begin_seqs[__i].first,
+ __nn += std::distance(__begin_seqs[__i].first,
__begin_seqs[__i].second);
_GLIBCXX_PARALLEL_ASSERT(
std::distance(__begin_seqs[__i].first,
__begin_seqs[__i].second) > 0);
}
- if (__rank == __N)
+ if (__rank == __nn)
{
for (int __i = 0; __i < __m; __i++)
__begin_offsets[__i] = __begin_seqs[__i].second; // Very end.
@@ -163,9 +163,9 @@ namespace __gnu_parallel
}
_GLIBCXX_PARALLEL_ASSERT(__m != 0);
- _GLIBCXX_PARALLEL_ASSERT(__N != 0);
+ _GLIBCXX_PARALLEL_ASSERT(__nn != 0);
_GLIBCXX_PARALLEL_ASSERT(__rank >= 0);
- _GLIBCXX_PARALLEL_ASSERT(__rank < __N);
+ _GLIBCXX_PARALLEL_ASSERT(__rank < __nn);
_DifferenceType* __ns = new _DifferenceType[__m];
_DifferenceType* __a = new _DifferenceType[__m];
@@ -187,9 +187,6 @@ namespace __gnu_parallel
// equality iff __nmax = 2^__k - 1.
__l = (1ULL << __r) - 1;
- // From now on, including padding.
- __N = __l * __m;
-
for (int __i = 0; __i < __m; __i++)
{
__a[__i] = 0;
@@ -215,7 +212,7 @@ namespace __gnu_parallel
__sample.push_back(
std::make_pair(__S(__i)[0] /*__dummy element*/, __i));
- _DifferenceType __localrank = __rank * __m / __N ;
+ _DifferenceType __localrank = __rank / __l;
int __j;
for (__j = 0;
@@ -265,15 +262,11 @@ namespace __gnu_parallel
__b[__i] -= __n + 1;
}
- _DifferenceType __leftsize = 0, __total = 0;
+ _DifferenceType __leftsize = 0;
for (int __i = 0; __i < __m; __i++)
- {
__leftsize += __a[__i] / (__n + 1);
- __total += __l / (__n + 1);
- }
-
- _DifferenceType __skew = static_cast<_DifferenceType>
- (static_cast<uint64_t>(__total) * __rank / __N - __leftsize);
+
+ _DifferenceType __skew = __rank / (__n + 1) - __leftsize;
if (__skew > 0)
{
@@ -408,14 +401,14 @@ namespace __gnu_parallel
// Number of sequences, number of elements in total (possibly
// including padding).
_DifferenceType __m = std::distance(__begin_seqs, __end_seqs);
- _DifferenceType __N = 0;
+ _DifferenceType __nn = 0;
_DifferenceType __nmax, __n, __r;
for (int __i = 0; __i < __m; __i++)
- __N += std::distance(__begin_seqs[__i].first,
- __begin_seqs[__i].second);
+ __nn += std::distance(__begin_seqs[__i].first,
+ __begin_seqs[__i].second);
- if (__m == 0 || __N == 0 || __rank < 0 || __rank >= __N)
+ if (__m == 0 || __nn == 0 || __rank < 0 || __rank >= __nn)
{
// result undefined if there is no data or __rank is outside bounds
throw std::exception();
@@ -440,10 +433,7 @@ namespace __gnu_parallel
// Pad all lists to this length, at least as long as any ns[__i],
// equality iff __nmax = 2^__k - 1
- __l = pow2(__r) - 1;
-
- // From now on, including padding.
- __N = __l * __m;
+ __l = __round_up_to_pow2(__r) - 1;
for (int __i = 0; __i < __m; ++__i)
{
@@ -472,7 +462,7 @@ namespace __gnu_parallel
__sample.push_back(
std::make_pair(__S(__i)[0] /*__dummy element*/, __i));
- _DifferenceType __localrank = __rank * __m / __N ;
+ _DifferenceType __localrank = __rank / __l;
int __j;
for (__j = 0;
@@ -513,15 +503,11 @@ namespace __gnu_parallel
__b[__i] -= __n + 1;
}
- _DifferenceType __leftsize = 0, __total = 0;
+ _DifferenceType __leftsize = 0;
for (int __i = 0; __i < __m; ++__i)
- {
__leftsize += __a[__i] / (__n + 1);
- __total += __l / (__n + 1);
- }
- _DifferenceType __skew = ((unsigned long long)__total * __rank / __N
- - __leftsize);
+ _DifferenceType __skew = __rank / (__n + 1) - __leftsize;
if (__skew > 0)
{
diff --git a/libstdc++-v3/include/parallel/multiway_merge.h b/libstdc++-v3/include/parallel/multiway_merge.h
index 310a07a766c..cdf21540d12 100644
--- a/libstdc++-v3/include/parallel/multiway_merge.h
+++ b/libstdc++-v3/include/parallel/multiway_merge.h
@@ -54,2113 +54,1998 @@
namespace __gnu_parallel
{
+ /** @brief _Iterator wrapper supporting an implicit supremum at the end
+ * of the sequence, dominating all comparisons.
+ *
+ * The implicit supremum comes with a performance cost.
+ *
+ * Deriving from _RAIter is not possible since
+ * _RAIter need not be a class.
+ */
+ template<typename _RAIter, typename _Compare>
+ class _GuardedIterator
+ {
+ private:
+ /** @brief Current iterator __position. */
+ _RAIter _M_current;
+
+ /** @brief End iterator of the sequence. */
+ _RAIter _M_end;
+
+ /** @brief _Compare. */
+ _Compare& __comp;
+
+ public:
+ /** @brief Constructor. Sets iterator to beginning of sequence.
+ * @param __begin Begin iterator of sequence.
+ * @param __end End iterator of sequence.
+ * @param __comp Comparator provided for associated overloaded
+ * compare operators. */
+ _GuardedIterator(_RAIter __begin, _RAIter __end, _Compare& __comp)
+ : _M_current(__begin), _M_end(__end), __comp(__comp)
+ { }
+
+ /** @brief Pre-increment operator.
+ * @return This. */
+ _GuardedIterator<_RAIter, _Compare>&
+ operator++()
+ {
+ ++_M_current;
+ return *this;
+ }
-// Announce guarded and unguarded iterator.
-
-template<typename _RAIter, typename _Compare>
- class _GuardedIterator;
-
-// Making the arguments const references seems to dangerous,
-// the user-defined comparator might not be const.
-template<typename _RAIter, typename _Compare>
- inline bool
- operator<(_GuardedIterator<_RAIter, _Compare>& __bi1,
- _GuardedIterator<_RAIter, _Compare>& __bi2);
-
-template<typename _RAIter, typename _Compare>
- inline bool
- operator<=(_GuardedIterator<_RAIter, _Compare>& __bi1,
- _GuardedIterator<_RAIter, _Compare>& __bi2);
-
-/** @brief _Iterator wrapper supporting an implicit supremum at the end
- * of the sequence, dominating all comparisons.
- *
- * The implicit supremum comes with a performance cost.
- *
- * Deriving from _RAIter is not possible since
- * _RAIter need not be a class.
- */
-template<typename _RAIter, typename _Compare>
- class _GuardedIterator
- {
- private:
- /** @brief Current iterator __position. */
- _RAIter _M_current;
-
- /** @brief End iterator of the sequence. */
- _RAIter _M_end;
-
- /** @brief _Compare. */
- _Compare& __comp;
-
- public:
- /** @brief Constructor. Sets iterator to beginning of sequence.
- * @param __begin Begin iterator of sequence.
- * @param _M_end End iterator of sequence.
- * @param __comp Comparator provided for associated overloaded
- * compare operators. */
- _GuardedIterator(_RAIter __begin,
- _RAIter _M_end, _Compare& __comp)
- : _M_current(__begin), _M_end(_M_end), __comp(__comp)
- { }
-
- /** @brief Pre-increment operator.
- * @return This. */
- _GuardedIterator<_RAIter, _Compare>&
- operator++()
+ /** @brief Dereference operator.
+ * @return Referenced element. */
+ typename std::iterator_traits<_RAIter>::value_type&
+ operator*()
+ { return *_M_current; }
+
+ /** @brief Convert to wrapped iterator.
+ * @return Wrapped iterator. */
+ operator _RAIter()
+ { return _M_current; }
+
+ /** @brief Compare two elements referenced by guarded iterators.
+ * @param __bi1 First iterator.
+ * @param __bi2 Second iterator.
+ * @return @c true if less. */
+ friend bool
+ operator<(_GuardedIterator<_RAIter, _Compare>& __bi1,
+ _GuardedIterator<_RAIter, _Compare>& __bi2)
+ {
+ if (__bi1._M_current == __bi1._M_end) // __bi1 is sup
+ return __bi2._M_current == __bi2._M_end; // __bi2 is not sup
+ if (__bi2._M_current == __bi2._M_end) // __bi2 is sup
+ return true;
+ return (__bi1.__comp)(*__bi1, *__bi2); // normal compare
+ }
+
+ /** @brief Compare two elements referenced by guarded iterators.
+ * @param __bi1 First iterator.
+ * @param __bi2 Second iterator.
+ * @return @c True if less equal. */
+ friend bool
+ operator<=(_GuardedIterator<_RAIter, _Compare>& __bi1,
+ _GuardedIterator<_RAIter, _Compare>& __bi2)
+ {
+ if (__bi2._M_current == __bi2._M_end) // __bi1 is sup
+ return __bi1._M_current != __bi1._M_end; // __bi2 is not sup
+ if (__bi1._M_current == __bi1._M_end) // __bi2 is sup
+ return false;
+ return !(__bi1.__comp)(*__bi2, *__bi1); // normal compare
+ }
+ };
+
+ template<typename _RAIter, typename _Compare>
+ class _UnguardedIterator
{
- ++_M_current;
- return *this;
- }
+ private:
+ /** @brief Current iterator __position. */
+ _RAIter _M_current;
+ /** @brief _Compare. */
+ mutable _Compare& __comp;
+
+ public:
+ /** @brief Constructor. Sets iterator to beginning of sequence.
+ * @param __begin Begin iterator of sequence.
+ * @param __end Unused, only for compatibility.
+ * @param __comp Unused, only for compatibility. */
+ _UnguardedIterator(_RAIter __begin,
+ _RAIter /* __end */, _Compare& __comp)
+ : _M_current(__begin), __comp(__comp)
+ { }
+
+ /** @brief Pre-increment operator.
+ * @return This. */
+ _UnguardedIterator<_RAIter, _Compare>&
+ operator++()
+ {
+ ++_M_current;
+ return *this;
+ }
- /** @brief Dereference operator.
- * @return Referenced element. */
- typename std::iterator_traits<_RAIter>::value_type&
- operator*()
- { return *_M_current; }
-
- /** @brief Convert to wrapped iterator.
- * @return Wrapped iterator. */
- operator _RAIter()
- { return _M_current; }
-
- friend bool
- operator< <_RAIter, _Compare>(
- _GuardedIterator<_RAIter, _Compare>& __bi1,
- _GuardedIterator<_RAIter, _Compare>& __bi2);
-
- friend bool
- operator<= <_RAIter, _Compare>(
- _GuardedIterator<_RAIter, _Compare>& __bi1,
- _GuardedIterator<_RAIter, _Compare>& __bi2);
- };
-
-/** @brief Compare two elements referenced by guarded iterators.
- * @param __bi1 First iterator.
- * @param __bi2 Second iterator.
- * @return @__c true if less. */
-template<typename _RAIter, typename _Compare>
- inline bool
- operator<(_GuardedIterator<_RAIter, _Compare>& __bi1,
- _GuardedIterator<_RAIter, _Compare>& __bi2)
- {
- if (__bi1._M_current == __bi1._M_end) //__bi1 is sup
- return __bi2._M_current == __bi2._M_end; //__bi2 is not sup
- if (__bi2._M_current == __bi2._M_end) //__bi2 is sup
- return true;
- return (__bi1.__comp)(*__bi1, *__bi2); //normal compare
- }
-
-/** @brief Compare two elements referenced by guarded iterators.
- * @param __bi1 First iterator.
- * @param __bi2 Second iterator.
- * @return @__c True if less equal. */
-template<typename _RAIter, typename _Compare>
- inline bool
- operator<=(_GuardedIterator<_RAIter, _Compare>& __bi1,
- _GuardedIterator<_RAIter, _Compare>& __bi2)
- {
- if (__bi2._M_current == __bi2._M_end) //__bi1 is sup
- return __bi1._M_current != __bi1._M_end; //__bi2 is not sup
- if (__bi1._M_current == __bi1._M_end) //__bi2 is sup
- return false;
- return !(__bi1.__comp)(*__bi2, *__bi1); //normal compare
- }
-
-template<typename _RAIter, typename _Compare>
- class _UnguardedIterator;
-
-template<typename _RAIter, typename _Compare>
- inline bool
- operator<(_UnguardedIterator<_RAIter, _Compare>& __bi1,
- _UnguardedIterator<_RAIter, _Compare>& __bi2);
-
-template<typename _RAIter, typename _Compare>
- inline bool
- operator<=(_UnguardedIterator<_RAIter, _Compare>& __bi1,
- _UnguardedIterator<_RAIter, _Compare>& __bi2);
-
-template<typename _RAIter, typename _Compare>
- class _UnguardedIterator
- {
- private:
- /** @brief Current iterator __position. */
- _RAIter _M_current;
- /** @brief _Compare. */
- mutable _Compare& __comp;
-
- public:
- /** @brief Constructor. Sets iterator to beginning of sequence.
- * @param __begin Begin iterator of sequence.
- * @param _M_end Unused, only for compatibility.
- * @param __comp Unused, only for compatibility. */
- _UnguardedIterator(_RAIter __begin,
- _RAIter _M_end, _Compare& __comp)
- : _M_current(__begin), __comp(__comp)
- { }
-
- /** @brief Pre-increment operator.
- * @return This. */
- _UnguardedIterator<_RAIter, _Compare>&
- operator++()
+ /** @brief Dereference operator.
+ * @return Referenced element. */
+ typename std::iterator_traits<_RAIter>::value_type&
+ operator*()
+ { return *_M_current; }
+
+ /** @brief Convert to wrapped iterator.
+ * @return Wrapped iterator. */
+ operator _RAIter()
+ { return _M_current; }
+
+ /** @brief Compare two elements referenced by unguarded iterators.
+ * @param __bi1 First iterator.
+ * @param __bi2 Second iterator.
+ * @return @c true if less. */
+ friend bool
+ operator<(_UnguardedIterator<_RAIter, _Compare>& __bi1,
+ _UnguardedIterator<_RAIter, _Compare>& __bi2)
+ {
+ // Normal compare.
+ return (__bi1.__comp)(*__bi1, *__bi2);
+ }
+
+ /** @brief Compare two elements referenced by unguarded iterators.
+ * @param __bi1 First iterator.
+ * @param __bi2 Second iterator.
+ * @return @c True if less equal. */
+ friend bool
+ operator<=(_UnguardedIterator<_RAIter, _Compare>& __bi1,
+ _UnguardedIterator<_RAIter, _Compare>& __bi2)
+ {
+ // Normal compare.
+ return !(__bi1.__comp)(*__bi2, *__bi1);
+ }
+ };
+
+ /** @brief Highly efficient 3-way merging procedure.
+ *
+ * Merging is done with the algorithm implementation described by Peter
+ * Sanders. Basically, the idea is to minimize the number of necessary
+ * comparison after merging an element. The implementation trick
+ * that makes this fast is that the order of the sequences is stored
+ * in the instruction pointer (translated into labels in C++).
+ *
+ * This works well for merging up to 4 sequences.
+ *
+ * Note that making the merging stable does <em>not</em> come at a
+ * performance hit.
+ *
+ * Whether the merging is done guarded or unguarded is selected by the
+ * used iterator class.
+ *
+ * @param __seqs_begin Begin iterator of iterator pair input sequence.
+ * @param __seqs_end End iterator of iterator pair input sequence.
+ * @param __target Begin iterator of output sequence.
+ * @param __comp Comparator.
+ * @param __length Maximum length to merge, less equal than the
+ * total number of elements available.
+ *
+ * @return End iterator of output sequence.
+ */
+ template<template<typename RAI, typename C> class iterator,
+ typename _RAIterIterator,
+ typename _RAIter3,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIter3
+ multiway_merge_3_variant(_RAIterIterator __seqs_begin,
+ _RAIterIterator __seqs_end,
+ _RAIter3 __target,
+ _DifferenceTp __length, _Compare __comp)
{
- ++_M_current;
- return *this;
- }
+ _GLIBCXX_CALL(__length);
- /** @brief Dereference operator.
- * @return Referenced element. */
- typename std::iterator_traits<_RAIter>::value_type&
- operator*()
- { return *_M_current; }
-
- /** @brief Convert to wrapped iterator.
- * @return Wrapped iterator. */
- operator _RAIter()
- { return _M_current; }
-
- friend bool
- operator< <_RAIter, _Compare>(
- _UnguardedIterator<_RAIter, _Compare>& __bi1,
- _UnguardedIterator<_RAIter, _Compare>& __bi2);
-
- friend bool
- operator<= <_RAIter, _Compare>(
- _UnguardedIterator<_RAIter, _Compare>& __bi1,
- _UnguardedIterator<_RAIter, _Compare>& __bi2);
- };
-
-/** @brief Compare two elements referenced by unguarded iterators.
- * @param __bi1 First iterator.
- * @param __bi2 Second iterator.
- * @return @__c true if less. */
-template<typename _RAIter, typename _Compare>
- inline bool
- operator<(_UnguardedIterator<_RAIter, _Compare>& __bi1,
- _UnguardedIterator<_RAIter, _Compare>& __bi2)
- {
- // Normal compare.
- return (__bi1.__comp)(*__bi1, *__bi2);
- }
-
-/** @brief Compare two elements referenced by unguarded iterators.
- * @param __bi1 First iterator.
- * @param __bi2 Second iterator.
- * @return @__c True if less equal. */
-template<typename _RAIter, typename _Compare>
- inline bool
- operator<=(_UnguardedIterator<_RAIter, _Compare>& __bi1,
- _UnguardedIterator<_RAIter, _Compare>& __bi2)
- {
- // Normal compare.
- return !(__bi1.__comp)(*__bi2, *__bi1);
- }
-
-/** @brief Highly efficient 3-way merging procedure.
- *
- * Merging is done with the algorithm implementation described by Peter
- * Sanders. Basically, the idea is to minimize the number of necessary
- * comparison after merging an element. The implementation trick
- * that makes this fast is that the order of the sequences is stored
- * in the instruction pointer (translated into labels in C++).
- *
- * This works well for merging up to 4 sequences.
- *
- * Note that making the merging stable does <em>not</em> come at a
- * performance hit.
- *
- * Whether the merging is done guarded or unguarded is selected by the
- * used iterator class.
- *
- * @param __seqs_begin Begin iterator of iterator pair input sequence.
- * @param __seqs_end End iterator of iterator pair input sequence.
- * @param __target Begin iterator of output sequence.
- * @param __comp Comparator.
- * @param __length Maximum length to merge, less equal than the
- * total number of elements available.
- *
- * @return End iterator of output sequence.
- */
-template<template<typename RAI, typename C> class iterator,
- typename _RAIterIterator,
- typename _RAIter3,
- typename _DifferenceTp,
- typename _Compare>
- _RAIter3
- multiway_merge_3_variant(
- _RAIterIterator __seqs_begin,
- _RAIterIterator __seqs_end,
- _RAIter3 __target,
- _DifferenceTp __length, _Compare __comp)
- {
- _GLIBCXX_CALL(__length);
-
- typedef _DifferenceTp _DifferenceType;
-
- typedef typename std::iterator_traits<_RAIterIterator>
- ::value_type::first_type
- _RAIter1;
- typedef typename std::iterator_traits<_RAIter1>::value_type
- _ValueType;
-
- if (__length == 0)
- return __target;
+ typedef _DifferenceTp _DifferenceType;
+
+ typedef typename std::iterator_traits<_RAIterIterator>
+ ::value_type::first_type
+ _RAIter1;
+ typedef typename std::iterator_traits<_RAIter1>::value_type
+ _ValueType;
+
+ if (__length == 0)
+ return __target;
#if _GLIBCXX_ASSERTIONS
- _DifferenceTp orig_length = __length;
+ _DifferenceTp __orig_length = __length;
#endif
- iterator<_RAIter1, _Compare>
- __seq0(__seqs_begin[0].first, __seqs_begin[0].second, __comp),
- __seq1(__seqs_begin[1].first, __seqs_begin[1].second, __comp),
- __seq2(__seqs_begin[2].first, __seqs_begin[2].second, __comp);
+ iterator<_RAIter1, _Compare>
+ __seq0(__seqs_begin[0].first, __seqs_begin[0].second, __comp),
+ __seq1(__seqs_begin[1].first, __seqs_begin[1].second, __comp),
+ __seq2(__seqs_begin[2].first, __seqs_begin[2].second, __comp);
- if (__seq0 <= __seq1)
- {
- if (__seq1 <= __seq2)
- goto __s012;
- else
- if (__seq2 < __seq0)
- goto __s201;
+ if (__seq0 <= __seq1)
+ {
+ if (__seq1 <= __seq2)
+ goto __s012;
else
- goto __s021;
- }
- else
- {
- if (__seq1 <= __seq2)
- {
- if (__seq0 <= __seq2)
- goto __s102;
+ if (__seq2 < __seq0)
+ goto __s201;
else
- goto __s120;
- }
- else
- goto __s210;
- }
-#define _GLIBCXX_PARALLEL_MERGE_3_CASE(__a,__b,__c,c0,c1) \
- __s ## __a ## __b ## __c : \
- *__target = *__seq ## __a; \
- ++__target; \
- --__length; \
- ++__seq ## __a; \
- if (__length == 0) goto finish; \
- if (__seq ## __a c0 __seq ## __b) goto __s ## __a ## __b ## __c; \
- if (__seq ## __a c1 __seq ## __c) goto __s ## __b ## __a ## __c; \
- goto __s ## __b ## __c ## __a;
-
- _GLIBCXX_PARALLEL_MERGE_3_CASE(0, 1, 2, <=, <=);
- _GLIBCXX_PARALLEL_MERGE_3_CASE(1, 2, 0, <=, < );
- _GLIBCXX_PARALLEL_MERGE_3_CASE(2, 0, 1, < , < );
- _GLIBCXX_PARALLEL_MERGE_3_CASE(1, 0, 2, < , <=);
- _GLIBCXX_PARALLEL_MERGE_3_CASE(0, 2, 1, <=, <=);
- _GLIBCXX_PARALLEL_MERGE_3_CASE(2, 1, 0, < , < );
+ goto __s021;
+ }
+ else
+ {
+ if (__seq1 <= __seq2)
+ {
+ if (__seq0 <= __seq2)
+ goto __s102;
+ else
+ goto __s120;
+ }
+ else
+ goto __s210;
+ }
+#define _GLIBCXX_PARALLEL_MERGE_3_CASE(__a, __b, __c, __c0, __c1) \
+ __s ## __a ## __b ## __c : \
+ *__target = *__seq ## __a; \
+ ++__target; \
+ --__length; \
+ ++__seq ## __a; \
+ if (__length == 0) goto __finish; \
+ if (__seq ## __a __c0 __seq ## __b) goto __s ## __a ## __b ## __c; \
+ if (__seq ## __a __c1 __seq ## __c) goto __s ## __b ## __a ## __c; \
+ goto __s ## __b ## __c ## __a;
+
+ _GLIBCXX_PARALLEL_MERGE_3_CASE(0, 1, 2, <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_3_CASE(1, 2, 0, <=, < );
+ _GLIBCXX_PARALLEL_MERGE_3_CASE(2, 0, 1, < , < );
+ _GLIBCXX_PARALLEL_MERGE_3_CASE(1, 0, 2, < , <=);
+ _GLIBCXX_PARALLEL_MERGE_3_CASE(0, 2, 1, <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_3_CASE(2, 1, 0, < , < );
#undef _GLIBCXX_PARALLEL_MERGE_3_CASE
- finish:
- ;
+ __finish:
+ ;
#if _GLIBCXX_ASSERTIONS
- _GLIBCXX_PARALLEL_ASSERT(
- ((_RAIter1)__seq0 - __seqs_begin[0].first) +
- ((_RAIter1)__seq1 - __seqs_begin[1].first) +
- ((_RAIter1)__seq2 - __seqs_begin[2].first)
- == orig_length);
+ _GLIBCXX_PARALLEL_ASSERT(
+ ((_RAIter1)__seq0 - __seqs_begin[0].first) +
+ ((_RAIter1)__seq1 - __seqs_begin[1].first) +
+ ((_RAIter1)__seq2 - __seqs_begin[2].first)
+ == __orig_length);
#endif
- __seqs_begin[0].first = __seq0;
- __seqs_begin[1].first = __seq1;
- __seqs_begin[2].first = __seq2;
-
- return __target;
- }
-
-/**
- * @brief Highly efficient 4-way merging procedure.
- *
- * Merging is done with the algorithm implementation described by Peter
- * Sanders. Basically, the idea is to minimize the number of necessary
- * comparison after merging an element. The implementation trick
- * that makes this fast is that the order of the sequences is stored
- * in the instruction pointer (translated into goto labels in C++).
- *
- * This works well for merging up to 4 sequences.
- *
- * Note that making the merging stable does <em>not</em> come at a
- * performance hit.
- *
- * Whether the merging is done guarded or unguarded is selected by the
- * used iterator class.
- *
- * @param __seqs_begin Begin iterator of iterator pair input sequence.
- * @param __seqs_end End iterator of iterator pair input sequence.
- * @param __target Begin iterator of output sequence.
- * @param __comp Comparator.
- * @param __length Maximum length to merge, less equal than the
- * total number of elements available.
- *
- * @return End iterator of output sequence.
- */
-template<template<typename RAI, typename C> class iterator,
- typename _RAIterIterator,
- typename _RAIter3,
- typename _DifferenceTp,
- typename _Compare>
- _RAIter3
- multiway_merge_4_variant(_RAIterIterator __seqs_begin,
- _RAIterIterator __seqs_end,
- _RAIter3 __target,
- _DifferenceTp __length, _Compare __comp)
- {
- _GLIBCXX_CALL(__length);
- typedef _DifferenceTp _DifferenceType;
-
- typedef typename std::iterator_traits<_RAIterIterator>
- ::value_type::first_type
- _RAIter1;
- typedef typename std::iterator_traits<_RAIter1>::value_type
- _ValueType;
-
- iterator<_RAIter1, _Compare>
- __seq0(__seqs_begin[0].first, __seqs_begin[0].second, __comp),
- __seq1(__seqs_begin[1].first, __seqs_begin[1].second, __comp),
- __seq2(__seqs_begin[2].first, __seqs_begin[2].second, __comp),
- __seq3(__seqs_begin[3].first, __seqs_begin[3].second, __comp);
-
-#define _GLIBCXX_PARALLEL_DECISION(__a,__b,__c,d) { \
- if (__seq ## d < __seq ## __a) goto __s ## d ## __a ## __b ## __c; \
- if (__seq ## d < __seq ## __b) goto __s ## __a ## d ## __b ## __c; \
- if (__seq ## d < __seq ## __c) goto __s ## __a ## __b ## d ## __c; \
- goto __s ## __a ## __b ## __c ## d; }
-
- if (__seq0 <= __seq1)
- {
- if (__seq1 <= __seq2)
- _GLIBCXX_PARALLEL_DECISION(0,1,2,3)
- else
- if (__seq2 < __seq0)
- _GLIBCXX_PARALLEL_DECISION(2,0,1,3)
- else
- _GLIBCXX_PARALLEL_DECISION(0,2,1,3)
- }
- else
- {
- if (__seq1 <= __seq2)
- {
- if (__seq0 <= __seq2)
- _GLIBCXX_PARALLEL_DECISION(1,0,2,3)
- else
- _GLIBCXX_PARALLEL_DECISION(1,2,0,3)
- }
- else
- _GLIBCXX_PARALLEL_DECISION(2,1,0,3)
- }
+ __seqs_begin[0].first = __seq0;
+ __seqs_begin[1].first = __seq1;
+ __seqs_begin[2].first = __seq2;
-#define _GLIBCXX_PARALLEL_MERGE_4_CASE(__a,__b,__c,d,c0,c1,c2) \
- __s ## __a ## __b ## __c ## d: \
- if (__length == 0) goto finish; \
- *__target = *__seq ## __a; \
- ++__target; \
- --__length; \
- ++__seq ## __a; \
- if (__seq ## __a c0 __seq ## __b) goto __s ## __a ## __b ## __c ## d; \
- if (__seq ## __a c1 __seq ## __c) goto __s ## __b ## __a ## __c ## d; \
- if (__seq ## __a c2 __seq ## d) goto __s ## __b ## __c ## __a ## d; \
- goto __s ## __b ## __c ## d ## __a;
-
- _GLIBCXX_PARALLEL_MERGE_4_CASE(0, 1, 2, 3, <=, <=, <=);
- _GLIBCXX_PARALLEL_MERGE_4_CASE(0, 1, 3, 2, <=, <=, <=);
- _GLIBCXX_PARALLEL_MERGE_4_CASE(0, 2, 1, 3, <=, <=, <=);
- _GLIBCXX_PARALLEL_MERGE_4_CASE(0, 2, 3, 1, <=, <=, <=);
- _GLIBCXX_PARALLEL_MERGE_4_CASE(0, 3, 1, 2, <=, <=, <=);
- _GLIBCXX_PARALLEL_MERGE_4_CASE(0, 3, 2, 1, <=, <=, <=);
- _GLIBCXX_PARALLEL_MERGE_4_CASE(1, 0, 2, 3, < , <=, <=);
- _GLIBCXX_PARALLEL_MERGE_4_CASE(1, 0, 3, 2, < , <=, <=);
- _GLIBCXX_PARALLEL_MERGE_4_CASE(1, 2, 0, 3, <=, < , <=);
- _GLIBCXX_PARALLEL_MERGE_4_CASE(1, 2, 3, 0, <=, <=, < );
- _GLIBCXX_PARALLEL_MERGE_4_CASE(1, 3, 0, 2, <=, < , <=);
- _GLIBCXX_PARALLEL_MERGE_4_CASE(1, 3, 2, 0, <=, <=, < );
- _GLIBCXX_PARALLEL_MERGE_4_CASE(2, 0, 1, 3, < , < , <=);
- _GLIBCXX_PARALLEL_MERGE_4_CASE(2, 0, 3, 1, < , <=, < );
- _GLIBCXX_PARALLEL_MERGE_4_CASE(2, 1, 0, 3, < , < , <=);
- _GLIBCXX_PARALLEL_MERGE_4_CASE(2, 1, 3, 0, < , <=, < );
- _GLIBCXX_PARALLEL_MERGE_4_CASE(2, 3, 0, 1, <=, < , < );
- _GLIBCXX_PARALLEL_MERGE_4_CASE(2, 3, 1, 0, <=, < , < );
- _GLIBCXX_PARALLEL_MERGE_4_CASE(3, 0, 1, 2, < , < , < );
- _GLIBCXX_PARALLEL_MERGE_4_CASE(3, 0, 2, 1, < , < , < );
- _GLIBCXX_PARALLEL_MERGE_4_CASE(3, 1, 0, 2, < , < , < );
- _GLIBCXX_PARALLEL_MERGE_4_CASE(3, 1, 2, 0, < , < , < );
- _GLIBCXX_PARALLEL_MERGE_4_CASE(3, 2, 0, 1, < , < , < );
- _GLIBCXX_PARALLEL_MERGE_4_CASE(3, 2, 1, 0, < , < , < );
+ return __target;
+ }
+
+ /**
+ * @brief Highly efficient 4-way merging procedure.
+ *
+ * Merging is done with the algorithm implementation described by Peter
+ * Sanders. Basically, the idea is to minimize the number of necessary
+ * comparison after merging an element. The implementation trick
+ * that makes this fast is that the order of the sequences is stored
+ * in the instruction pointer (translated into goto labels in C++).
+ *
+ * This works well for merging up to 4 sequences.
+ *
+ * Note that making the merging stable does <em>not</em> come at a
+ * performance hit.
+ *
+ * Whether the merging is done guarded or unguarded is selected by the
+ * used iterator class.
+ *
+ * @param __seqs_begin Begin iterator of iterator pair input sequence.
+ * @param __seqs_end End iterator of iterator pair input sequence.
+ * @param __target Begin iterator of output sequence.
+ * @param __comp Comparator.
+ * @param __length Maximum length to merge, less equal than the
+ * total number of elements available.
+ *
+ * @return End iterator of output sequence.
+ */
+ template<template<typename RAI, typename C> class iterator,
+ typename _RAIterIterator,
+ typename _RAIter3,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIter3
+ multiway_merge_4_variant(_RAIterIterator __seqs_begin,
+ _RAIterIterator __seqs_end,
+ _RAIter3 __target,
+ _DifferenceTp __length, _Compare __comp)
+ {
+ _GLIBCXX_CALL(__length);
+ typedef _DifferenceTp _DifferenceType;
+
+ typedef typename std::iterator_traits<_RAIterIterator>
+ ::value_type::first_type
+ _RAIter1;
+ typedef typename std::iterator_traits<_RAIter1>::value_type
+ _ValueType;
+
+ iterator<_RAIter1, _Compare>
+ __seq0(__seqs_begin[0].first, __seqs_begin[0].second, __comp),
+ __seq1(__seqs_begin[1].first, __seqs_begin[1].second, __comp),
+ __seq2(__seqs_begin[2].first, __seqs_begin[2].second, __comp),
+ __seq3(__seqs_begin[3].first, __seqs_begin[3].second, __comp);
+
+#define _GLIBCXX_PARALLEL_DECISION(__a, __b, __c, __d) { \
+ if (__seq ## __d < __seq ## __a) \
+ goto __s ## __d ## __a ## __b ## __c; \
+ if (__seq ## __d < __seq ## __b) \
+ goto __s ## __a ## __d ## __b ## __c; \
+ if (__seq ## __d < __seq ## __c) \
+ goto __s ## __a ## __b ## __d ## __c; \
+ goto __s ## __a ## __b ## __c ## __d; }
+
+ if (__seq0 <= __seq1)
+ {
+ if (__seq1 <= __seq2)
+ _GLIBCXX_PARALLEL_DECISION(0,1,2,3)
+ else
+ if (__seq2 < __seq0)
+ _GLIBCXX_PARALLEL_DECISION(2,0,1,3)
+ else
+ _GLIBCXX_PARALLEL_DECISION(0,2,1,3)
+ }
+ else
+ {
+ if (__seq1 <= __seq2)
+ {
+ if (__seq0 <= __seq2)
+ _GLIBCXX_PARALLEL_DECISION(1,0,2,3)
+ else
+ _GLIBCXX_PARALLEL_DECISION(1,2,0,3)
+ }
+ else
+ _GLIBCXX_PARALLEL_DECISION(2,1,0,3)
+ }
+
+#define _GLIBCXX_PARALLEL_MERGE_4_CASE(__a, __b, __c, __d, \
+ __c0, __c1, __c2) \
+ __s ## __a ## __b ## __c ## __d: \
+ if (__length == 0) goto __finish; \
+ *__target = *__seq ## __a; \
+ ++__target; \
+ --__length; \
+ ++__seq ## __a; \
+ if (__seq ## __a __c0 __seq ## __b) \
+ goto __s ## __a ## __b ## __c ## __d; \
+ if (__seq ## __a __c1 __seq ## __c) \
+ goto __s ## __b ## __a ## __c ## __d; \
+ if (__seq ## __a __c2 __seq ## __d) \
+ goto __s ## __b ## __c ## __a ## __d; \
+ goto __s ## __b ## __c ## __d ## __a;
+
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(0, 1, 2, 3, <=, <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(0, 1, 3, 2, <=, <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(0, 2, 1, 3, <=, <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(0, 2, 3, 1, <=, <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(0, 3, 1, 2, <=, <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(0, 3, 2, 1, <=, <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(1, 0, 2, 3, < , <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(1, 0, 3, 2, < , <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(1, 2, 0, 3, <=, < , <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(1, 2, 3, 0, <=, <=, < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(1, 3, 0, 2, <=, < , <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(1, 3, 2, 0, <=, <=, < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(2, 0, 1, 3, < , < , <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(2, 0, 3, 1, < , <=, < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(2, 1, 0, 3, < , < , <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(2, 1, 3, 0, < , <=, < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(2, 3, 0, 1, <=, < , < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(2, 3, 1, 0, <=, < , < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(3, 0, 1, 2, < , < , < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(3, 0, 2, 1, < , < , < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(3, 1, 0, 2, < , < , < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(3, 1, 2, 0, < , < , < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(3, 2, 0, 1, < , < , < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(3, 2, 1, 0, < , < , < );
#undef _GLIBCXX_PARALLEL_MERGE_4_CASE
#undef _GLIBCXX_PARALLEL_DECISION
- finish:
- ;
-
- __seqs_begin[0].first = __seq0;
- __seqs_begin[1].first = __seq1;
- __seqs_begin[2].first = __seq2;
- __seqs_begin[3].first = __seq3;
-
- return __target;
- }
-
-/** @brief Multi-way merging procedure for a high branching factor,
- * guarded case.
- *
- * This merging variant uses a LoserTree class as selected by <tt>LT</tt>.
- *
- * Stability is selected through the used LoserTree class <tt>LT</tt>.
- *
- * At least one non-empty sequence is required.
- *
- * @param __seqs_begin Begin iterator of iterator pair input sequence.
- * @param __seqs_end End iterator of iterator pair input sequence.
- * @param __target Begin iterator of output sequence.
- * @param __comp Comparator.
- * @param __length Maximum length to merge, less equal than the
- * total number of elements available.
- *
- * @return End iterator of output sequence.
- */
-template<typename LT,
- typename _RAIterIterator,
- typename _RAIter3,
- typename _DifferenceTp,
- typename _Compare>
- _RAIter3
- multiway_merge_loser_tree(_RAIterIterator __seqs_begin,
- _RAIterIterator __seqs_end,
- _RAIter3 __target,
- _DifferenceTp __length, _Compare __comp)
- {
- _GLIBCXX_CALL(__length)
+ __finish:
+ ;
- typedef _DifferenceTp _DifferenceType;
- typedef typename std::iterator_traits<_RAIterIterator>
- ::value_type::first_type
- _RAIter1;
- typedef typename std::iterator_traits<_RAIter1>::value_type
- _ValueType;
+ __seqs_begin[0].first = __seq0;
+ __seqs_begin[1].first = __seq1;
+ __seqs_begin[2].first = __seq2;
+ __seqs_begin[3].first = __seq3;
- int __k = static_cast<int>(__seqs_end - __seqs_begin);
+ return __target;
+ }
- LT __lt(__k, __comp);
+ /** @brief Multi-way merging procedure for a high branching factor,
+ * guarded case.
+ *
+ * This merging variant uses a LoserTree class as selected by <tt>_LT</tt>.
+ *
+ * Stability is selected through the used LoserTree class <tt>_LT</tt>.
+ *
+ * At least one non-empty sequence is required.
+ *
+ * @param __seqs_begin Begin iterator of iterator pair input sequence.
+ * @param __seqs_end End iterator of iterator pair input sequence.
+ * @param __target Begin iterator of output sequence.
+ * @param __comp Comparator.
+ * @param __length Maximum length to merge, less equal than the
+ * total number of elements available.
+ *
+ * @return End iterator of output sequence.
+ */
+ template<typename _LT,
+ typename _RAIterIterator,
+ typename _RAIter3,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIter3
+ multiway_merge_loser_tree(_RAIterIterator __seqs_begin,
+ _RAIterIterator __seqs_end,
+ _RAIter3 __target,
+ _DifferenceTp __length, _Compare __comp)
+ {
+ _GLIBCXX_CALL(__length)
- // Default value for potentially non-default-constructible types.
- _ValueType* __arbitrary_element = NULL;
+ typedef _DifferenceTp _DifferenceType;
+ typedef typename std::iterator_traits<_RAIterIterator>
+ ::value_type::first_type
+ _RAIter1;
+ typedef typename std::iterator_traits<_RAIter1>::value_type
+ _ValueType;
- for (int __t = 0; __t < __k; ++__t)
- {
- if(__arbitrary_element == NULL
- && _GLIBCXX_PARALLEL_LENGTH(__seqs_begin[__t]) > 0)
- __arbitrary_element = &(*__seqs_begin[__t].first);
- }
+ int __k = static_cast<int>(__seqs_end - __seqs_begin);
- for (int __t = 0; __t < __k; ++__t)
- {
- if (__seqs_begin[__t].first == __seqs_begin[__t].second)
- __lt.__insert_start(*__arbitrary_element, __t, true);
- else
- __lt.__insert_start(*__seqs_begin[__t].first, __t, false);
- }
+ _LT __lt(__k, __comp);
- __lt.__init();
+ // Default value for potentially non-default-constructible types.
+ _ValueType* __arbitrary_element = NULL;
- int __source;
+ for (int __t = 0; __t < __k; ++__t)
+ {
+ if(__arbitrary_element == NULL
+ && _GLIBCXX_PARALLEL_LENGTH(__seqs_begin[__t]) > 0)
+ __arbitrary_element = &(*__seqs_begin[__t].first);
+ }
- for (_DifferenceType __i = 0; __i < __length; ++__i)
- {
- //take out
- __source = __lt.__get_min_source();
+ for (int __t = 0; __t < __k; ++__t)
+ {
+ if (__seqs_begin[__t].first == __seqs_begin[__t].second)
+ __lt.__insert_start(*__arbitrary_element, __t, true);
+ else
+ __lt.__insert_start(*__seqs_begin[__t].first, __t, false);
+ }
- *(__target++) = *(__seqs_begin[__source].first++);
+ __lt.__init();
- // Feed.
- if (__seqs_begin[__source].first == __seqs_begin[__source].second)
- __lt.__delete_min_insert(*__arbitrary_element, true);
- else
- // Replace from same __source.
- __lt.__delete_min_insert(*__seqs_begin[__source].first, false);
- }
+ int __source;
- return __target;
- }
-
-/** @brief Multi-way merging procedure for a high branching factor,
- * unguarded case.
- *
- * Merging is done using the LoserTree class <tt>LT</tt>.
- *
- * Stability is selected by the used LoserTrees.
- *
- * @pre No input will run out of elements during the merge.
- *
- * @param __seqs_begin Begin iterator of iterator pair input sequence.
- * @param __seqs_end End iterator of iterator pair input sequence.
- * @param __target Begin iterator of output sequence.
- * @param __comp Comparator.
- * @param __length Maximum length to merge, less equal than the
- * total number of elements available.
- *
- * @return End iterator of output sequence.
- */
-template<typename LT,
- typename _RAIterIterator,
- typename _RAIter3,
- typename _DifferenceTp, typename _Compare>
- _RAIter3
- multiway_merge_loser_tree_unguarded(
- _RAIterIterator __seqs_begin,
- _RAIterIterator __seqs_end,
- _RAIter3 __target,
- const typename std::iterator_traits<typename std::iterator_traits<
- _RAIterIterator>::value_type::first_type>::value_type&
- __sentinel,
- _DifferenceTp __length,
- _Compare __comp)
- {
- _GLIBCXX_CALL(__length)
- typedef _DifferenceTp _DifferenceType;
+ for (_DifferenceType __i = 0; __i < __length; ++__i)
+ {
+ //take out
+ __source = __lt.__get_min_source();
- typedef typename std::iterator_traits<_RAIterIterator>
- ::value_type::first_type
- _RAIter1;
- typedef typename std::iterator_traits<_RAIter1>::value_type
- _ValueType;
+ *(__target++) = *(__seqs_begin[__source].first++);
- int __k = __seqs_end - __seqs_begin;
+ // Feed.
+ if (__seqs_begin[__source].first == __seqs_begin[__source].second)
+ __lt.__delete_min_insert(*__arbitrary_element, true);
+ else
+ // Replace from same __source.
+ __lt.__delete_min_insert(*__seqs_begin[__source].first, false);
+ }
- LT __lt(__k, __sentinel, __comp);
+ return __target;
+ }
- for (int __t = 0; __t < __k; ++__t)
- {
-#if _GLIBCXX_ASSERTIONS
- _GLIBCXX_PARALLEL_ASSERT(__seqs_begin[__t].first
- != __seqs_begin[__t].second);
-#endif
- __lt.__insert_start(*__seqs_begin[__t].first, __t, false);
- }
+ /** @brief Multi-way merging procedure for a high branching factor,
+ * unguarded case.
+ *
+ * Merging is done using the LoserTree class <tt>_LT</tt>.
+ *
+ * Stability is selected by the used LoserTrees.
+ *
+ * @pre No input will run out of elements during the merge.
+ *
+ * @param __seqs_begin Begin iterator of iterator pair input sequence.
+ * @param __seqs_end End iterator of iterator pair input sequence.
+ * @param __target Begin iterator of output sequence.
+ * @param __comp Comparator.
+ * @param __length Maximum length to merge, less equal than the
+ * total number of elements available.
+ *
+ * @return End iterator of output sequence.
+ */
+ template<typename _LT,
+ typename _RAIterIterator,
+ typename _RAIter3,
+ typename _DifferenceTp, typename _Compare>
+ _RAIter3
+ multiway_merge_loser_tree_unguarded(_RAIterIterator __seqs_begin,
+ _RAIterIterator __seqs_end,
+ _RAIter3 __target,
+ const typename std::iterator_traits<typename std::iterator_traits<
+ _RAIterIterator>::value_type::first_type>::value_type&
+ __sentinel,
+ _DifferenceTp __length,
+ _Compare __comp)
+ {
+ _GLIBCXX_CALL(__length)
+ typedef _DifferenceTp _DifferenceType;
- __lt.__init();
+ typedef typename std::iterator_traits<_RAIterIterator>
+ ::value_type::first_type
+ _RAIter1;
+ typedef typename std::iterator_traits<_RAIter1>::value_type
+ _ValueType;
+
+ int __k = __seqs_end - __seqs_begin;
- int __source;
+ _LT __lt(__k, __sentinel, __comp);
+ for (int __t = 0; __t < __k; ++__t)
+ {
#if _GLIBCXX_ASSERTIONS
- _DifferenceType __i = 0;
+ _GLIBCXX_PARALLEL_ASSERT(__seqs_begin[__t].first
+ != __seqs_begin[__t].second);
#endif
+ __lt.__insert_start(*__seqs_begin[__t].first, __t, false);
+ }
- _RAIter3 __target_end = __target + __length;
- while (__target < __target_end)
- {
- // Take out.
- __source = __lt.__get_min_source();
+ __lt.__init();
+
+ int __source;
#if _GLIBCXX_ASSERTIONS
- _GLIBCXX_PARALLEL_ASSERT(0 <= __source && __source < __k);
- _GLIBCXX_PARALLEL_ASSERT(__i == 0
- || !__comp(*(__seqs_begin[__source].first), *(__target - 1)));
+ _DifferenceType __i = 0;
#endif
- // Feed.
- *(__target++) = *(__seqs_begin[__source].first++);
+ _RAIter3 __target_end = __target + __length;
+ while (__target < __target_end)
+ {
+ // Take out.
+ __source = __lt.__get_min_source();
#if _GLIBCXX_ASSERTIONS
- ++__i;
+ _GLIBCXX_PARALLEL_ASSERT(0 <= __source && __source < __k);
+ _GLIBCXX_PARALLEL_ASSERT(__i == 0
+ || !__comp(*(__seqs_begin[__source].first), *(__target - 1)));
#endif
- // Replace from same __source.
- __lt.__delete_min_insert(*__seqs_begin[__source].first, false);
- }
- return __target;
- }
-
-
-/** @brief Multi-way merging procedure for a high branching factor,
- * requiring sentinels to exist.
- *
- * @param __stable The value must the same as for the used LoserTrees.
- * @param UnguardedLoserTree _Loser Tree variant to use for the unguarded
- * merging.
- * @param GuardedLoserTree _Loser Tree variant to use for the guarded
- * merging.
- *
- * @param __seqs_begin Begin iterator of iterator pair input sequence.
- * @param __seqs_end End iterator of iterator pair input sequence.
- * @param __target Begin iterator of output sequence.
- * @param __comp Comparator.
- * @param __length Maximum length to merge, less equal than the
- * total number of elements available.
- *
- * @return End iterator of output sequence.
- */
-template<
- typename UnguardedLoserTree,
- typename _RAIterIterator,
- typename _RAIter3,
- typename _DifferenceTp,
- typename _Compare>
- _RAIter3
- multiway_merge_loser_tree_sentinel(
- _RAIterIterator __seqs_begin,
- _RAIterIterator __seqs_end,
- _RAIter3 __target,
- const typename std::iterator_traits<typename std::iterator_traits<
- _RAIterIterator>::value_type::first_type>::value_type&
- __sentinel,
- _DifferenceTp __length,
- _Compare __comp)
- {
- _GLIBCXX_CALL(__length)
-
- typedef _DifferenceTp _DifferenceType;
- typedef std::iterator_traits<_RAIterIterator> _TraitsType;
- typedef typename std::iterator_traits<_RAIterIterator>
- ::value_type::first_type
- _RAIter1;
- typedef typename std::iterator_traits<_RAIter1>::value_type
- _ValueType;
-
- _RAIter3 __target_end;
-
- for (_RAIterIterator __s = __seqs_begin; __s != __seqs_end; ++__s)
- // Move the sequence ends to the sentinel. This has the
- // effect that the sentinel appears to be within the sequence. Then,
- // we can use the unguarded variant if we merge out as many
- // non-sentinel elements as we have.
- ++((*__s).second);
-
- __target_end = multiway_merge_loser_tree_unguarded
- <UnguardedLoserTree>
- (__seqs_begin, __seqs_end, __target, __sentinel, __length, __comp);
+ // Feed.
+ *(__target++) = *(__seqs_begin[__source].first++);
#if _GLIBCXX_ASSERTIONS
- _GLIBCXX_PARALLEL_ASSERT(__target_end == __target + __length);
- _GLIBCXX_PARALLEL_ASSERT(__is_sorted(__target, __target_end, __comp));
+ ++__i;
#endif
+ // Replace from same __source.
+ __lt.__delete_min_insert(*__seqs_begin[__source].first, false);
+ }
- // Restore the sequence ends so the sentinels are not contained in the
- // sequence any more (see comment in loop above).
- for (_RAIterIterator __s = __seqs_begin; __s != __seqs_end; ++__s)
- --((*__s).second);
-
- return __target_end;
- }
-
-/**
- * @brief Traits for determining whether the loser tree should
- * use pointers or copies.
- *
- * The field "_M_use_pointer" is used to determine whether to use pointers in
- * the loser trees or whether to copy the values into the loser tree.
- *
- * The default behavior is to use pointers if the data type is 4 times as
- * big as the pointer to it.
- *
- * Specialize for your data type to customize the behavior.
- *
- * Example:
- *
- * template<>
- * struct _LoserTreeTraits<int>
- * { static const bool _M_use_pointer = false; };
- *
- * template<>
- * struct _LoserTreeTraits<heavyweight_type>
- * { static const bool _M_use_pointer = true; };
- *
- * @param _Tp type to give the loser tree traits for.
- */
-template <typename _Tp>
-struct _LoserTreeTraits
-{
- /**
- * @brief True iff to use pointers instead of values in loser trees.
+ return __target;
+ }
+
+
+ /** @brief Multi-way merging procedure for a high branching factor,
+ * requiring sentinels to exist.
*
- * The default behavior is to use pointers if the data type is four
- * times as big as the pointer to it.
+ * @param __stable The value must the same as for the used LoserTrees.
+ * @param UnguardedLoserTree _Loser Tree variant to use for the unguarded
+ * merging.
+ * @param GuardedLoserTree _Loser Tree variant to use for the guarded
+ * merging.
+ *
+ * @param __seqs_begin Begin iterator of iterator pair input sequence.
+ * @param __seqs_end End iterator of iterator pair input sequence.
+ * @param __target Begin iterator of output sequence.
+ * @param __comp Comparator.
+ * @param __length Maximum length to merge, less equal than the
+ * total number of elements available.
+ *
+ * @return End iterator of output sequence.
*/
- static const bool _M_use_pointer = (sizeof(_Tp) > 4 * sizeof(_Tp*));
-};
-
-/**
- * @brief Switch for 3-way merging with __sentinels turned off.
- *
- * Note that 3-way merging is always stable!
- */
-template<
- bool __sentinels /*default == false*/,
- typename _RAIterIterator,
- typename _RAIter3,
- typename _DifferenceTp,
- typename _Compare>
-struct __multiway_merge_3_variant_sentinel_switch
-{
- _RAIter3 operator()(
- _RAIterIterator __seqs_begin,
- _RAIterIterator __seqs_end,
- _RAIter3 __target,
- _DifferenceTp __length, _Compare __comp)
- {
- return multiway_merge_3_variant<_GuardedIterator>(
- __seqs_begin, __seqs_end, __target, __length, __comp);
- }
-};
-
-/**
- * @brief Switch for 3-way merging with __sentinels turned on.
- *
- * Note that 3-way merging is always stable!
- */
-template<
- typename _RAIterIterator,
- typename _RAIter3,
- typename _DifferenceTp,
- typename _Compare>
-struct __multiway_merge_3_variant_sentinel_switch
- <true, _RAIterIterator, _RAIter3,
- _DifferenceTp, _Compare>
-{
- _RAIter3 operator()(
- _RAIterIterator __seqs_begin,
- _RAIterIterator __seqs_end,
- _RAIter3 __target,
- _DifferenceTp __length, _Compare __comp)
- {
- return multiway_merge_3_variant<_UnguardedIterator>(
- __seqs_begin, __seqs_end, __target, __length, __comp);
- }
-};
-
-/**
- * @brief Switch for 4-way merging with __sentinels turned off.
- *
- * Note that 4-way merging is always stable!
- */
-template<
- bool __sentinels /*default == false*/,
- typename _RAIterIterator,
- typename _RAIter3,
- typename _DifferenceTp,
- typename _Compare>
-struct __multiway_merge_4_variant_sentinel_switch
-{
- _RAIter3 operator()(
- _RAIterIterator __seqs_begin,
- _RAIterIterator __seqs_end,
- _RAIter3 __target,
- _DifferenceTp __length, _Compare __comp)
- {
- return multiway_merge_4_variant<_GuardedIterator>(
- __seqs_begin, __seqs_end, __target, __length, __comp);
- }
-};
-
-/**
- * @brief Switch for 4-way merging with __sentinels turned on.
- *
- * Note that 4-way merging is always stable!
- */
-template<
- typename _RAIterIterator,
- typename _RAIter3,
- typename _DifferenceTp,
- typename _Compare>
-struct __multiway_merge_4_variant_sentinel_switch
- <true, _RAIterIterator, _RAIter3,
- _DifferenceTp, _Compare>
-{
- _RAIter3 operator()(
- _RAIterIterator __seqs_begin,
- _RAIterIterator __seqs_end,
- _RAIter3 __target,
- _DifferenceTp __length, _Compare __comp)
- {
- return multiway_merge_4_variant<_UnguardedIterator>(
- __seqs_begin, __seqs_end, __target, __length, __comp);
- }
-};
-
-/**
- * @brief Switch for k-way merging with __sentinels turned on.
- */
-template<
- bool __sentinels,
- bool __stable,
- typename _RAIterIterator,
- typename _RAIter3,
- typename _DifferenceTp,
- typename _Compare>
-struct __multiway_merge_k_variant_sentinel_switch
-{
- _RAIter3 operator()(
- _RAIterIterator __seqs_begin,
- _RAIterIterator __seqs_end,
- _RAIter3 __target,
+ template<typename UnguardedLoserTree,
+ typename _RAIterIterator,
+ typename _RAIter3,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIter3
+ multiway_merge_loser_tree_sentinel(_RAIterIterator __seqs_begin,
+ _RAIterIterator __seqs_end,
+ _RAIter3 __target,
const typename std::iterator_traits<typename std::iterator_traits<
- _RAIterIterator>::value_type::first_type>::value_type&
- __sentinel,
- _DifferenceTp __length, _Compare __comp)
- {
- typedef typename std::iterator_traits<_RAIterIterator>
- ::value_type::first_type
- _RAIter1;
- typedef typename std::iterator_traits<_RAIter1>::value_type
- _ValueType;
-
- return multiway_merge_loser_tree_sentinel<
- typename __gnu_cxx::__conditional_type<
- _LoserTreeTraits<_ValueType>::_M_use_pointer
- , _LoserTreePointerUnguarded<__stable, _ValueType, _Compare>
- , _LoserTreeUnguarded<__stable, _ValueType, _Compare>
- >::__type>(
- __seqs_begin, __seqs_end, __target, __sentinel, __length, __comp);
- }
-};
-
-/**
- * @brief Switch for k-way merging with __sentinels turned off.
- */
-template<
- bool __stable,
- typename _RAIterIterator,
- typename _RAIter3,
- typename _DifferenceTp,
- typename _Compare>
-struct __multiway_merge_k_variant_sentinel_switch
- <false, __stable, _RAIterIterator, _RAIter3,
- _DifferenceTp, _Compare>
-{
- _RAIter3 operator()(
- _RAIterIterator __seqs_begin,
- _RAIterIterator __seqs_end,
- _RAIter3 __target,
- const typename std::iterator_traits<typename std::iterator_traits<
- _RAIterIterator>::value_type::first_type>::value_type&
- __sentinel,
- _DifferenceTp __length, _Compare __comp)
- {
- typedef typename std::iterator_traits<_RAIterIterator>
- ::value_type::first_type
- _RAIter1;
- typedef typename std::iterator_traits<_RAIter1>::value_type
- _ValueType;
-
- return multiway_merge_loser_tree<
- typename __gnu_cxx::__conditional_type<
- _LoserTreeTraits<_ValueType>::_M_use_pointer
- , _LoserTreePointer<__stable, _ValueType, _Compare>
- , _LoserTree<__stable, _ValueType, _Compare>
- >::__type >(__seqs_begin, __seqs_end, __target, __length, __comp);
- }
-};
-
-/** @brief Sequential multi-way merging switch.
- *
- * The _GLIBCXX_PARALLEL_DECISION is based on the branching factor and
- * runtime settings.
- * @param __seqs_begin Begin iterator of iterator pair input sequence.
- * @param __seqs_end End iterator of iterator pair input sequence.
- * @param __target Begin iterator of output sequence.
- * @param __comp Comparator.
- * @param __length Maximum length to merge, possibly larger than the
- * number of elements available.
- * @param __stable Stable merging incurs a performance penalty.
- * @param __sentinel The sequences have __a __sentinel element.
- * @return End iterator of output sequence. */
-template<
- bool __stable,
- bool __sentinels,
- typename _RAIterIterator,
- typename _RAIter3,
- typename _DifferenceTp,
- typename _Compare>
- _RAIter3
- __sequential_multiway_merge(
- _RAIterIterator __seqs_begin,
- _RAIterIterator __seqs_end,
- _RAIter3 __target,
- const typename std::iterator_traits<typename std::iterator_traits<
- _RAIterIterator>::value_type::first_type>::value_type&
- __sentinel,
- _DifferenceTp __length, _Compare __comp)
- {
- _GLIBCXX_CALL(__length)
-
- typedef _DifferenceTp _DifferenceType;
- typedef typename std::iterator_traits<_RAIterIterator>
- ::value_type::first_type
- _RAIter1;
- typedef typename std::iterator_traits<_RAIter1>::value_type
- _ValueType;
-
-#if _GLIBCXX_ASSERTIONS
- for (_RAIterIterator __s = __seqs_begin; __s != __seqs_end; ++__s)
- {
- _GLIBCXX_PARALLEL_ASSERT(
- __is_sorted((*__s).first, (*__s).second, __comp));
- }
-#endif
+ _RAIterIterator>::value_type::first_type>::value_type&
+ __sentinel,
+ _DifferenceTp __length,
+ _Compare __comp)
+ {
+ _GLIBCXX_CALL(__length)
- _DifferenceTp __total_length = 0;
- for (_RAIterIterator __s = __seqs_begin; __s != __seqs_end; ++__s)
- __total_length += _GLIBCXX_PARALLEL_LENGTH(*__s);
+ typedef _DifferenceTp _DifferenceType;
+ typedef std::iterator_traits<_RAIterIterator> _TraitsType;
+ typedef typename std::iterator_traits<_RAIterIterator>
+ ::value_type::first_type
+ _RAIter1;
+ typedef typename std::iterator_traits<_RAIter1>::value_type
+ _ValueType;
- __length = std::min<_DifferenceTp>(__length, __total_length);
+ _RAIter3 __target_end;
- if(__length == 0)
- return __target;
+ for (_RAIterIterator __s = __seqs_begin; __s != __seqs_end; ++__s)
+ // Move the sequence ends to the sentinel. This has the
+ // effect that the sentinel appears to be within the sequence. Then,
+ // we can use the unguarded variant if we merge out as many
+ // non-sentinel elements as we have.
+ ++((*__s).second);
- _RAIter3 __return_target = __target;
- int __k = static_cast<int>(__seqs_end - __seqs_begin);
+ __target_end = multiway_merge_loser_tree_unguarded<UnguardedLoserTree>
+ (__seqs_begin, __seqs_end, __target, __sentinel, __length, __comp);
- switch (__k)
- {
- case 0:
- break;
- case 1:
- __return_target = std::copy(__seqs_begin[0].first,
- __seqs_begin[0].first + __length,
- __target);
- __seqs_begin[0].first += __length;
- break;
- case 2:
- __return_target = __merge_advance(__seqs_begin[0].first,
- __seqs_begin[0].second,
- __seqs_begin[1].first,
- __seqs_begin[1].second,
- __target, __length, __comp);
- break;
- case 3:
- __return_target = __multiway_merge_3_variant_sentinel_switch<
- __sentinels
- , _RAIterIterator
- , _RAIter3
- , _DifferenceTp
- , _Compare>()(__seqs_begin, __seqs_end, __target, __length, __comp);
- break;
- case 4:
- __return_target = __multiway_merge_4_variant_sentinel_switch<
- __sentinels
- , _RAIterIterator
- , _RAIter3
- , _DifferenceTp
- , _Compare>()(__seqs_begin, __seqs_end, __target, __length, __comp);
- break;
- default:
- __return_target = __multiway_merge_k_variant_sentinel_switch<
- __sentinels
- , __stable
- , _RAIterIterator
- , _RAIter3
- , _DifferenceTp
- , _Compare>()(__seqs_begin, __seqs_end, __target, __sentinel,
- __length, __comp);
- break;
- }
#if _GLIBCXX_ASSERTIONS
- _GLIBCXX_PARALLEL_ASSERT(
- __is_sorted(__target, __target + __length, __comp));
+ _GLIBCXX_PARALLEL_ASSERT(__target_end == __target + __length);
+ _GLIBCXX_PARALLEL_ASSERT(__is_sorted(__target, __target_end, __comp));
#endif
- return __return_target;
- }
+ // Restore the sequence ends so the sentinels are not contained in the
+ // sequence any more (see comment in loop above).
+ for (_RAIterIterator __s = __seqs_begin; __s != __seqs_end; ++__s)
+ --((*__s).second);
-/**
- * @brief Stable sorting functor.
- *
- * Used to reduce code instanciation in multiway_merge_sampling_splitting.
- */
-template<bool __stable, class _RAIter, class _StrictWeakOrdering>
-struct _SamplingSorter
-{
- void operator()(_RAIter __first, _RAIter __last,
- _StrictWeakOrdering __comp)
- { __gnu_sequential::stable_sort(__first, __last, __comp); }
-};
-
-/**
- * @brief Non-__stable sorting functor.
- *
- * Used to reduce code instantiation in multiway_merge_sampling_splitting.
- */
-template<class _RAIter, class _StrictWeakOrdering>
-struct _SamplingSorter<false, _RAIter, _StrictWeakOrdering>
-{
- void operator()(_RAIter __first, _RAIter __last,
- _StrictWeakOrdering __comp)
- { __gnu_sequential::sort(__first, __last, __comp); }
-};
-
-/**
- * @brief Sampling based splitting for parallel multiway-merge routine.
- */
-template<
- bool __stable
- , typename _RAIterIterator
- , typename _Compare
- , typename _DifferenceType>
-void multiway_merge_sampling_splitting(
- _RAIterIterator __seqs_begin,
- _RAIterIterator __seqs_end,
- _DifferenceType __length, _DifferenceType __total_length, _Compare __comp,
- std::vector<std::pair<_DifferenceType, _DifferenceType> > *__pieces)
-{
- typedef typename std::iterator_traits<_RAIterIterator>
- ::value_type::first_type
- _RAIter1;
- typedef typename std::iterator_traits<_RAIter1>::value_type
- _ValueType;
+ return __target_end;
+ }
- // __k sequences.
- int __k = static_cast<int>(__seqs_end - __seqs_begin);
+ /**
+ * @brief Traits for determining whether the loser tree should
+ * use pointers or copies.
+ *
+ * The field "_M_use_pointer" is used to determine whether to use pointers
+ * in he loser trees or whether to copy the values into the loser tree.
+ *
+ * The default behavior is to use pointers if the data type is 4 times as
+ * big as the pointer to it.
+ *
+ * Specialize for your data type to customize the behavior.
+ *
+ * Example:
+ *
+ * template<>
+ * struct _LoserTreeTraits<int>
+ * { static const bool _M_use_pointer = false; };
+ *
+ * template<>
+ * struct _LoserTreeTraits<heavyweight_type>
+ * { static const bool _M_use_pointer = true; };
+ *
+ * @param _Tp type to give the loser tree traits for.
+ */
+ template <typename _Tp>
+ struct _LoserTreeTraits
+ {
+ /**
+ * @brief True iff to use pointers instead of values in loser trees.
+ *
+ * The default behavior is to use pointers if the data type is four
+ * times as big as the pointer to it.
+ */
+ static const bool _M_use_pointer = (sizeof(_Tp) > 4 * sizeof(_Tp*));
+ };
- int __num_threads = omp_get_num_threads();
+ /**
+ * @brief Switch for 3-way merging with __sentinels turned off.
+ *
+ * Note that 3-way merging is always stable!
+ */
+ template<bool __sentinels /*default == false*/,
+ typename _RAIterIterator,
+ typename _RAIter3,
+ typename _DifferenceTp,
+ typename _Compare>
+ struct __multiway_merge_3_variant_sentinel_switch
+ {
+ _RAIter3
+ operator()(_RAIterIterator __seqs_begin,
+ _RAIterIterator __seqs_end,
+ _RAIter3 __target,
+ _DifferenceTp __length, _Compare __comp)
+ { return multiway_merge_3_variant<_GuardedIterator>
+ (__seqs_begin, __seqs_end, __target, __length, __comp); }
+ };
+
+ /**
+ * @brief Switch for 3-way merging with __sentinels turned on.
+ *
+ * Note that 3-way merging is always stable!
+ */
+ template<typename _RAIterIterator,
+ typename _RAIter3,
+ typename _DifferenceTp,
+ typename _Compare>
+ struct __multiway_merge_3_variant_sentinel_switch<true, _RAIterIterator,
+ _RAIter3, _DifferenceTp,
+ _Compare>
+ {
+ _RAIter3
+ operator()(_RAIterIterator __seqs_begin,
+ _RAIterIterator __seqs_end,
+ _RAIter3 __target,
+ _DifferenceTp __length, _Compare __comp)
+ { return multiway_merge_3_variant<_UnguardedIterator>
+ (__seqs_begin, __seqs_end, __target, __length, __comp); }
+ };
+
+ /**
+ * @brief Switch for 4-way merging with __sentinels turned off.
+ *
+ * Note that 4-way merging is always stable!
+ */
+ template<bool __sentinels /*default == false*/,
+ typename _RAIterIterator,
+ typename _RAIter3,
+ typename _DifferenceTp,
+ typename _Compare>
+ struct __multiway_merge_4_variant_sentinel_switch
+ {
+ _RAIter3
+ operator()(_RAIterIterator __seqs_begin,
+ _RAIterIterator __seqs_end,
+ _RAIter3 __target,
+ _DifferenceTp __length, _Compare __comp)
+ { return multiway_merge_4_variant<_GuardedIterator>
+ (__seqs_begin, __seqs_end, __target, __length, __comp); }
+ };
- _DifferenceType __num_samples =
- __gnu_parallel::_Settings::get().merge_oversampling * __num_threads;
+ /**
+ * @brief Switch for 4-way merging with __sentinels turned on.
+ *
+ * Note that 4-way merging is always stable!
+ */
+ template<typename _RAIterIterator,
+ typename _RAIter3,
+ typename _DifferenceTp,
+ typename _Compare>
+ struct __multiway_merge_4_variant_sentinel_switch<true, _RAIterIterator,
+ _RAIter3, _DifferenceTp,
+ _Compare>
+ {
+ _RAIter3
+ operator()(_RAIterIterator __seqs_begin,
+ _RAIterIterator __seqs_end,
+ _RAIter3 __target,
+ _DifferenceTp __length, _Compare __comp)
+ { return multiway_merge_4_variant<_UnguardedIterator>
+ (__seqs_begin, __seqs_end, __target, __length, __comp); }
+ };
- _ValueType* __samples = static_cast<_ValueType*>(
- ::operator new(sizeof(_ValueType) * __k * __num_samples));
- // Sample.
- for (int __s = 0; __s < __k; ++__s)
- for (_DifferenceType __i = 0; __i < __num_samples; ++__i)
+ /**
+ * @brief Switch for k-way merging with __sentinels turned on.
+ */
+ template<bool __sentinels,
+ bool __stable,
+ typename _RAIterIterator,
+ typename _RAIter3,
+ typename _DifferenceTp,
+ typename _Compare>
+ struct __multiway_merge_k_variant_sentinel_switch
+ {
+ _RAIter3
+ operator()(_RAIterIterator __seqs_begin,
+ _RAIterIterator __seqs_end,
+ _RAIter3 __target,
+ const typename std::iterator_traits<typename std::iterator_traits<
+ _RAIterIterator>::value_type::first_type>::value_type&
+ __sentinel,
+ _DifferenceTp __length, _Compare __comp)
{
- _DifferenceType sample_index =
- static_cast<_DifferenceType>(
- _GLIBCXX_PARALLEL_LENGTH(__seqs_begin[__s])
- * (double(__i + 1) / (__num_samples + 1))
- * (double(__length) / __total_length));
- new(&(__samples[__s * __num_samples + __i]))
- _ValueType(__seqs_begin[__s].first[sample_index]);
+ typedef typename std::iterator_traits<_RAIterIterator>
+ ::value_type::first_type
+ _RAIter1;
+ typedef typename std::iterator_traits<_RAIter1>::value_type
+ _ValueType;
+
+ return multiway_merge_loser_tree_sentinel<
+ typename __gnu_cxx::__conditional_type<
+ _LoserTreeTraits<_ValueType>::_M_use_pointer,
+ _LoserTreePointerUnguarded<__stable, _ValueType, _Compare>,
+ _LoserTreeUnguarded<__stable, _ValueType, _Compare>
+ >::__type>
+ (__seqs_begin, __seqs_end, __target, __sentinel, __length, __comp);
}
+ };
- // Sort stable or non-stable, depending on value of template parameter
- // "__stable".
- _SamplingSorter<__stable, _ValueType*, _Compare>()(
- __samples, __samples + (__num_samples * __k), __comp);
-
- for (int __slab = 0; __slab < __num_threads; ++__slab)
- // For each slab / processor.
- for (int __seq = 0; __seq < __k; ++__seq)
+ /**
+ * @brief Switch for k-way merging with __sentinels turned off.
+ */
+ template<bool __stable,
+ typename _RAIterIterator,
+ typename _RAIter3,
+ typename _DifferenceTp,
+ typename _Compare>
+ struct __multiway_merge_k_variant_sentinel_switch<false, __stable,
+ _RAIterIterator, _RAIter3,
+ _DifferenceTp, _Compare>
+ {
+ _RAIter3
+ operator()(_RAIterIterator __seqs_begin,
+ _RAIterIterator __seqs_end,
+ _RAIter3 __target,
+ const typename std::iterator_traits<typename std::iterator_traits<
+ _RAIterIterator>::value_type::first_type>::value_type&
+ __sentinel,
+ _DifferenceTp __length, _Compare __comp)
{
- // For each sequence.
- if (__slab > 0)
- __pieces[__slab][__seq].first =
- std::upper_bound(
- __seqs_begin[__seq].first,
- __seqs_begin[__seq].second,
- __samples[__num_samples * __k * __slab / __num_threads],
- __comp)
- - __seqs_begin[__seq].first;
- else
- // Absolute beginning.
- __pieces[__slab][__seq].first = 0;
- if ((__slab + 1) < __num_threads)
- __pieces[__slab][__seq].second =
- std::upper_bound(
- __seqs_begin[__seq].first,
- __seqs_begin[__seq].second,
- __samples[__num_samples * __k * (__slab + 1) /
- __num_threads], __comp)
- - __seqs_begin[__seq].first;
- else
- // Absolute end.
- __pieces[__slab][__seq].second
- = _GLIBCXX_PARALLEL_LENGTH(__seqs_begin[__seq]);
+ typedef typename std::iterator_traits<_RAIterIterator>
+ ::value_type::first_type
+ _RAIter1;
+ typedef typename std::iterator_traits<_RAIter1>::value_type
+ _ValueType;
+
+ return multiway_merge_loser_tree<
+ typename __gnu_cxx::__conditional_type<
+ _LoserTreeTraits<_ValueType>::_M_use_pointer,
+ _LoserTreePointer<__stable, _ValueType, _Compare>,
+ _LoserTree<__stable, _ValueType, _Compare>
+ >::__type >(__seqs_begin, __seqs_end, __target, __length, __comp);
}
- ::operator delete(__samples);
-}
-
-/**
- * @brief Exact splitting for parallel multiway-merge routine.
- *
- * None of the passed sequences may be empty.
- */
-template<
- bool __stable
- , typename _RAIterIterator
- , typename _Compare
- , typename _DifferenceType>
-void multiway_merge_exact_splitting(
- _RAIterIterator __seqs_begin,
- _RAIterIterator __seqs_end,
- _DifferenceType __length, _DifferenceType __total_length, _Compare __comp,
- std::vector<std::pair<_DifferenceType, _DifferenceType> > *__pieces)
-{
- typedef typename std::iterator_traits<_RAIterIterator>
- ::value_type::first_type
- _RAIter1;
+ };
+
+ /** @brief Sequential multi-way merging switch.
+ *
+ * The _GLIBCXX_PARALLEL_DECISION is based on the branching factor and
+ * runtime settings.
+ * @param __seqs_begin Begin iterator of iterator pair input sequence.
+ * @param __seqs_end End iterator of iterator pair input sequence.
+ * @param __target Begin iterator of output sequence.
+ * @param __comp Comparator.
+ * @param __length Maximum length to merge, possibly larger than the
+ * number of elements available.
+ * @param __stable Stable merging incurs a performance penalty.
+ * @param __sentinel The sequences have __a __sentinel element.
+ * @return End iterator of output sequence. */
+ template<bool __stable,
+ bool __sentinels,
+ typename _RAIterIterator,
+ typename _RAIter3,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIter3
+ __sequential_multiway_merge(_RAIterIterator __seqs_begin,
+ _RAIterIterator __seqs_end,
+ _RAIter3 __target,
+ const typename std::iterator_traits<typename std::iterator_traits<
+ _RAIterIterator>::value_type::first_type>::value_type&
+ __sentinel,
+ _DifferenceTp __length, _Compare __comp)
+ {
+ _GLIBCXX_CALL(__length)
+
+ typedef _DifferenceTp _DifferenceType;
+ typedef typename std::iterator_traits<_RAIterIterator>
+ ::value_type::first_type
+ _RAIter1;
+ typedef typename std::iterator_traits<_RAIter1>::value_type
+ _ValueType;
+
+#if _GLIBCXX_ASSERTIONS
+ for (_RAIterIterator __s = __seqs_begin; __s != __seqs_end; ++__s)
+ {
+ _GLIBCXX_PARALLEL_ASSERT(__is_sorted((*__s).first,
+ (*__s).second, __comp));
+ }
+#endif
- const bool __tight = (__total_length == __length);
+ _DifferenceTp __total_length = 0;
+ for (_RAIterIterator __s = __seqs_begin; __s != __seqs_end; ++__s)
+ __total_length += _GLIBCXX_PARALLEL_LENGTH(*__s);
- // __k sequences.
- const int __k = static_cast<int>(__seqs_end - __seqs_begin);
+ __length = std::min<_DifferenceTp>(__length, __total_length);
- const int __num_threads = omp_get_num_threads();
+ if(__length == 0)
+ return __target;
- // (Settings::multiway_merge_splitting == __gnu_parallel::_Settings::EXACT).
- std::vector<_RAIter1>* __offsets =
- new std::vector<_RAIter1>[__num_threads];
- std::vector<
- std::pair<_RAIter1, _RAIter1>
- > __se(__k);
+ _RAIter3 __return_target = __target;
+ int __k = static_cast<int>(__seqs_end - __seqs_begin);
- copy(__seqs_begin, __seqs_end, __se.begin());
+ switch (__k)
+ {
+ case 0:
+ break;
+ case 1:
+ __return_target = std::copy(__seqs_begin[0].first,
+ __seqs_begin[0].first + __length,
+ __target);
+ __seqs_begin[0].first += __length;
+ break;
+ case 2:
+ __return_target = __merge_advance(__seqs_begin[0].first,
+ __seqs_begin[0].second,
+ __seqs_begin[1].first,
+ __seqs_begin[1].second,
+ __target, __length, __comp);
+ break;
+ case 3:
+ __return_target = __multiway_merge_3_variant_sentinel_switch
+ <__sentinels, _RAIterIterator, _RAIter3, _DifferenceTp, _Compare>()
+ (__seqs_begin, __seqs_end, __target, __length, __comp);
+ break;
+ case 4:
+ __return_target = __multiway_merge_4_variant_sentinel_switch
+ <__sentinels, _RAIterIterator, _RAIter3, _DifferenceTp, _Compare>()
+ (__seqs_begin, __seqs_end, __target, __length, __comp);
+ break;
+ default:
+ __return_target = __multiway_merge_k_variant_sentinel_switch
+ <__sentinels, __stable, _RAIterIterator, _RAIter3, _DifferenceTp,
+ _Compare>()
+ (__seqs_begin, __seqs_end, __target, __sentinel, __length, __comp);
+ break;
+ }
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(
+ __is_sorted(__target, __target + __length, __comp));
+#endif
- _DifferenceType* __borders =
- new _DifferenceType[__num_threads + 1];
- equally_split(__length, __num_threads, __borders);
+ return __return_target;
+ }
- for (int __s = 0; __s < (__num_threads - 1); ++__s)
+ /**
+ * @brief Stable sorting functor.
+ *
+ * Used to reduce code instanciation in multiway_merge_sampling_splitting.
+ */
+ template<bool __stable, class _RAIter, class _StrictWeakOrdering>
+ struct _SamplingSorter
{
- __offsets[__s].resize(__k);
- multiseq_partition(
- __se.begin(), __se.end(), __borders[__s + 1],
- __offsets[__s].begin(), __comp);
-
- // Last one also needed and available.
- if (!__tight)
- {
- __offsets[__num_threads - 1].resize(__k);
- multiseq_partition(__se.begin(), __se.end(),
- _DifferenceType(__length),
- __offsets[__num_threads - 1].begin(), __comp);
- }
- }
- delete[] __borders;
+ void
+ operator()(_RAIter __first, _RAIter __last, _StrictWeakOrdering __comp)
+ { __gnu_sequential::stable_sort(__first, __last, __comp); }
+ };
- for (int __slab = 0; __slab < __num_threads; ++__slab)
+ /**
+ * @brief Non-__stable sorting functor.
+ *
+ * Used to reduce code instantiation in multiway_merge_sampling_splitting.
+ */
+ template<class _RAIter, class _StrictWeakOrdering>
+ struct _SamplingSorter<false, _RAIter, _StrictWeakOrdering>
{
- // For each slab / processor.
- for (int __seq = 0; __seq < __k; ++__seq)
- {
- // For each sequence.
- if (__slab == 0)
- {
- // Absolute beginning.
- __pieces[__slab][__seq].first = 0;
- }
- else
- __pieces[__slab][__seq].first =
- __pieces[__slab - 1][__seq].second;
- if (!__tight || __slab < (__num_threads - 1))
- __pieces[__slab][__seq].second =
- __offsets[__slab][__seq] - __seqs_begin[__seq].first;
- else
- {
- // __slab == __num_threads - 1
- __pieces[__slab][__seq].second =
- _GLIBCXX_PARALLEL_LENGTH(__seqs_begin[__seq]);
- }
- }
+ void
+ operator()(_RAIter __first, _RAIter __last, _StrictWeakOrdering __comp)
+ { __gnu_sequential::sort(__first, __last, __comp); }
+ };
+
+ /**
+ * @brief Sampling based splitting for parallel multiway-merge routine.
+ */
+ template<bool __stable,
+ typename _RAIterIterator,
+ typename _Compare,
+ typename _DifferenceType>
+ void
+ multiway_merge_sampling_splitting(_RAIterIterator __seqs_begin,
+ _RAIterIterator __seqs_end,
+ _DifferenceType __length,
+ _DifferenceType __total_length,
+ _Compare __comp,
+ std::vector<std::pair<_DifferenceType, _DifferenceType> > *__pieces)
+ {
+ typedef typename std::iterator_traits<_RAIterIterator>
+ ::value_type::first_type
+ _RAIter1;
+ typedef typename std::iterator_traits<_RAIter1>::value_type
+ _ValueType;
+
+ // __k sequences.
+ int __k = static_cast<int>(__seqs_end - __seqs_begin);
+
+ int __num_threads = omp_get_num_threads();
+
+ _DifferenceType __num_samples =
+ __gnu_parallel::_Settings::get().merge_oversampling * __num_threads;
+
+ _ValueType* __samples = static_cast<_ValueType*>
+ (::operator new(sizeof(_ValueType) * __k * __num_samples));
+ // Sample.
+ for (int __s = 0; __s < __k; ++__s)
+ for (_DifferenceType __i = 0; __i < __num_samples; ++__i)
+ {
+ _DifferenceType sample_index = static_cast<_DifferenceType>
+ (_GLIBCXX_PARALLEL_LENGTH(__seqs_begin[__s])
+ * (double(__i + 1) / (__num_samples + 1))
+ * (double(__length) / __total_length));
+ new(&(__samples[__s * __num_samples + __i]))
+ _ValueType(__seqs_begin[__s].first[sample_index]);
+ }
+
+ // Sort stable or non-stable, depending on value of template parameter
+ // "__stable".
+ _SamplingSorter<__stable, _ValueType*, _Compare>()
+ (__samples, __samples + (__num_samples * __k), __comp);
+
+ for (int __slab = 0; __slab < __num_threads; ++__slab)
+ // For each slab / processor.
+ for (int __seq = 0; __seq < __k; ++__seq)
+ {
+ // For each sequence.
+ if (__slab > 0)
+ __pieces[__slab][__seq].first = std::upper_bound
+ (__seqs_begin[__seq].first, __seqs_begin[__seq].second,
+ __samples[__num_samples * __k * __slab / __num_threads],
+ __comp)
+ - __seqs_begin[__seq].first;
+ else
+ // Absolute beginning.
+ __pieces[__slab][__seq].first = 0;
+ if ((__slab + 1) < __num_threads)
+ __pieces[__slab][__seq].second = std::upper_bound
+ (__seqs_begin[__seq].first, __seqs_begin[__seq].second,
+ __samples[__num_samples * __k * (__slab + 1) / __num_threads],
+ __comp)
+ - __seqs_begin[__seq].first;
+ else
+ // Absolute end.
+ __pieces[__slab][__seq].second =
+ _GLIBCXX_PARALLEL_LENGTH(__seqs_begin[__seq]);
+ }
+ ::operator delete(__samples);
}
- delete[] __offsets;
-}
-
-/** @brief Parallel multi-way merge routine.
- *
- * The _GLIBCXX_PARALLEL_DECISION is based on the branching factor
- * and runtime settings.
- *
- * Must not be called if the number of sequences is 1.
- *
- * @param _Splitter functor to split input (either __exact or sampling based)
- *
- * @param __seqs_begin Begin iterator of iterator pair input sequence.
- * @param __seqs_end End iterator of iterator pair input sequence.
- * @param __target Begin iterator of output sequence.
- * @param __comp Comparator.
- * @param __length Maximum length to merge, possibly larger than the
- * number of elements available.
- * @param __stable Stable merging incurs a performance penalty.
- * @param __sentinel Ignored.
- * @return End iterator of output sequence.
- */
-template<
- bool __stable,
- bool __sentinels,
- typename _RAIterIterator,
- typename _RAIter3,
- typename _DifferenceTp,
- typename _Splitter,
- typename _Compare
- >
- _RAIter3
- parallel_multiway_merge(_RAIterIterator __seqs_begin,
- _RAIterIterator __seqs_end,
- _RAIter3 __target,
- _Splitter __splitter,
- _DifferenceTp __length,
- _Compare __comp,
- _ThreadIndex __num_threads)
+
+ /**
+ * @brief Exact splitting for parallel multiway-merge routine.
+ *
+ * None of the passed sequences may be empty.
+ */
+ template<bool __stable,
+ typename _RAIterIterator,
+ typename _Compare,
+ typename _DifferenceType>
+ void
+ multiway_merge_exact_splitting(_RAIterIterator __seqs_begin,
+ _RAIterIterator __seqs_end,
+ _DifferenceType __length,
+ _DifferenceType __total_length,
+ _Compare __comp,
+ std::vector<std::pair<_DifferenceType, _DifferenceType> > *__pieces)
{
+ typedef typename std::iterator_traits<_RAIterIterator>
+ ::value_type::first_type
+ _RAIter1;
+
+ const bool __tight = (__total_length == __length);
+
+ // __k sequences.
+ const int __k = static_cast<int>(__seqs_end - __seqs_begin);
+
+ const int __num_threads = omp_get_num_threads();
+
+ // (Settings::multiway_merge_splitting
+ // == __gnu_parallel::_Settings::EXACT).
+ std::vector<_RAIter1>* __offsets =
+ new std::vector<_RAIter1>[__num_threads];
+ std::vector<std::pair<_RAIter1, _RAIter1> > __se(__k);
+
+ copy(__seqs_begin, __seqs_end, __se.begin());
+
+ _DifferenceType* __borders =
+ new _DifferenceType[__num_threads + 1];
+ equally_split(__length, __num_threads, __borders);
+
+ for (int __s = 0; __s < (__num_threads - 1); ++__s)
+ {
+ __offsets[__s].resize(__k);
+ multiseq_partition(__se.begin(), __se.end(), __borders[__s + 1],
+ __offsets[__s].begin(), __comp);
+
+ // Last one also needed and available.
+ if (!__tight)
+ {
+ __offsets[__num_threads - 1].resize(__k);
+ multiseq_partition(__se.begin(), __se.end(),
+ _DifferenceType(__length),
+ __offsets[__num_threads - 1].begin(),
+ __comp);
+ }
+ }
+ delete[] __borders;
+
+ for (int __slab = 0; __slab < __num_threads; ++__slab)
+ {
+ // For each slab / processor.
+ for (int __seq = 0; __seq < __k; ++__seq)
+ {
+ // For each sequence.
+ if (__slab == 0)
+ {
+ // Absolute beginning.
+ __pieces[__slab][__seq].first = 0;
+ }
+ else
+ __pieces[__slab][__seq].first =
+ __pieces[__slab - 1][__seq].second;
+ if (!__tight || __slab < (__num_threads - 1))
+ __pieces[__slab][__seq].second =
+ __offsets[__slab][__seq] - __seqs_begin[__seq].first;
+ else
+ {
+ // __slab == __num_threads - 1
+ __pieces[__slab][__seq].second =
+ _GLIBCXX_PARALLEL_LENGTH(__seqs_begin[__seq]);
+ }
+ }
+ }
+ delete[] __offsets;
+ }
+
+ /** @brief Parallel multi-way merge routine.
+ *
+ * The _GLIBCXX_PARALLEL_DECISION is based on the branching factor
+ * and runtime settings.
+ *
+ * Must not be called if the number of sequences is 1.
+ *
+ * @param _Splitter functor to split input (either __exact or sampling based)
+ *
+ * @param __seqs_begin Begin iterator of iterator pair input sequence.
+ * @param __seqs_end End iterator of iterator pair input sequence.
+ * @param __target Begin iterator of output sequence.
+ * @param __comp Comparator.
+ * @param __length Maximum length to merge, possibly larger than the
+ * number of elements available.
+ * @param __stable Stable merging incurs a performance penalty.
+ * @param __sentinel Ignored.
+ * @return End iterator of output sequence.
+ */
+ template<bool __stable,
+ bool __sentinels,
+ typename _RAIterIterator,
+ typename _RAIter3,
+ typename _DifferenceTp,
+ typename _Splitter,
+ typename _Compare>
+ _RAIter3
+ parallel_multiway_merge(_RAIterIterator __seqs_begin,
+ _RAIterIterator __seqs_end,
+ _RAIter3 __target,
+ _Splitter __splitter,
+ _DifferenceTp __length,
+ _Compare __comp,
+ _ThreadIndex __num_threads)
+ {
#if _GLIBCXX_ASSERTIONS
- _GLIBCXX_PARALLEL_ASSERT(__seqs_end - __seqs_begin > 1);
+ _GLIBCXX_PARALLEL_ASSERT(__seqs_end - __seqs_begin > 1);
#endif
- _GLIBCXX_CALL(__length)
-
- typedef _DifferenceTp _DifferenceType;
- typedef typename std::iterator_traits<_RAIterIterator>
- ::value_type::first_type
- _RAIter1;
- typedef typename
- std::iterator_traits<_RAIter1>::value_type _ValueType;
-
- // Leave only non-empty sequences.
- typedef std::pair<_RAIter1, _RAIter1> seq_type;
- seq_type* __ne_seqs = new seq_type[__seqs_end - __seqs_begin];
- int __k = 0;
- _DifferenceType __total_length = 0;
- for (_RAIterIterator __raii = __seqs_begin;
- __raii != __seqs_end; ++__raii)
- {
- _DifferenceTp __seq_length = _GLIBCXX_PARALLEL_LENGTH(*__raii);
- if(__seq_length > 0)
- {
- __total_length += __seq_length;
- __ne_seqs[__k++] = *__raii;
- }
- }
+ _GLIBCXX_CALL(__length)
+
+ typedef _DifferenceTp _DifferenceType;
+ typedef typename std::iterator_traits<_RAIterIterator>
+ ::value_type::first_type
+ _RAIter1;
+ typedef typename
+ std::iterator_traits<_RAIter1>::value_type _ValueType;
+
+ // Leave only non-empty sequences.
+ typedef std::pair<_RAIter1, _RAIter1> seq_type;
+ seq_type* __ne_seqs = new seq_type[__seqs_end - __seqs_begin];
+ int __k = 0;
+ _DifferenceType __total_length = 0;
+ for (_RAIterIterator __raii = __seqs_begin;
+ __raii != __seqs_end; ++__raii)
+ {
+ _DifferenceTp __seq_length = _GLIBCXX_PARALLEL_LENGTH(*__raii);
+ if(__seq_length > 0)
+ {
+ __total_length += __seq_length;
+ __ne_seqs[__k++] = *__raii;
+ }
+ }
- _GLIBCXX_CALL(__total_length)
+ _GLIBCXX_CALL(__total_length)
- __length = std::min<_DifferenceTp>(__length, __total_length);
+ __length = std::min<_DifferenceTp>(__length, __total_length);
- if (__total_length == 0 || __k == 0)
- {
- delete[] __ne_seqs;
- return __target;
- }
+ if (__total_length == 0 || __k == 0)
+ {
+ delete[] __ne_seqs;
+ return __target;
+ }
- std::vector<std::pair<_DifferenceType, _DifferenceType> >* __pieces;
+ std::vector<std::pair<_DifferenceType, _DifferenceType> >* __pieces;
- __num_threads = static_cast<_ThreadIndex>
- (std::min<_DifferenceType>(__num_threads, __total_length));
+ __num_threads = static_cast<_ThreadIndex>
+ (std::min<_DifferenceType>(__num_threads, __total_length));
-# pragma omp parallel num_threads (__num_threads)
- {
+# pragma omp parallel num_threads (__num_threads)
+ {
# pragma omp single
- {
- __num_threads = omp_get_num_threads();
- // Thread __t will have to merge pieces[__iam][0..__k - 1]
- __pieces = new std::vector<
- std::pair<_DifferenceType, _DifferenceType> >[__num_threads];
- for (int __s = 0; __s < __num_threads; ++__s)
- __pieces[__s].resize(__k);
+ {
+ __num_threads = omp_get_num_threads();
+ // Thread __t will have to merge pieces[__iam][0..__k - 1]
+ __pieces = new std::vector<
+ std::pair<_DifferenceType, _DifferenceType> >[__num_threads];
+ for (int __s = 0; __s < __num_threads; ++__s)
+ __pieces[__s].resize(__k);
- _DifferenceType __num_samples =
- __gnu_parallel::_Settings::get().merge_oversampling *
- __num_threads;
+ _DifferenceType __num_samples =
+ __gnu_parallel::_Settings::get().merge_oversampling
+ * __num_threads;
- __splitter(__ne_seqs, __ne_seqs + __k, __length, __total_length,
- __comp, __pieces);
- } //single
+ __splitter(__ne_seqs, __ne_seqs + __k, __length, __total_length,
+ __comp, __pieces);
+ } //single
- _ThreadIndex __iam = omp_get_thread_num();
+ _ThreadIndex __iam = omp_get_thread_num();
- _DifferenceType __target_position = 0;
+ _DifferenceType __target_position = 0;
- for (int __c = 0; __c < __k; ++__c)
- __target_position += __pieces[__iam][__c].first;
+ for (int __c = 0; __c < __k; ++__c)
+ __target_position += __pieces[__iam][__c].first;
- seq_type* __chunks = new seq_type[__k];
+ seq_type* __chunks = new seq_type[__k];
- for (int __s = 0; __s < __k; ++__s)
- {
- __chunks[__s] = std::make_pair(
- __ne_seqs[__s].first + __pieces[__iam][__s].first,
- __ne_seqs[__s].first + __pieces[__iam][__s].second);
- }
+ for (int __s = 0; __s < __k; ++__s)
+ __chunks[__s] = std::make_pair(__ne_seqs[__s].first
+ + __pieces[__iam][__s].first,
+ __ne_seqs[__s].first
+ + __pieces[__iam][__s].second);
- if(__length > __target_position)
- __sequential_multiway_merge<__stable, __sentinels>(
- __chunks, __chunks + __k, __target + __target_position,
- *(__seqs_begin->second), __length - __target_position, __comp);
+ if(__length > __target_position)
+ __sequential_multiway_merge<__stable, __sentinels>
+ (__chunks, __chunks + __k, __target + __target_position,
+ *(__seqs_begin->second), __length - __target_position, __comp);
- delete[] __chunks;
- } // parallel
+ delete[] __chunks;
+ } // parallel
#if _GLIBCXX_ASSERTIONS
- _GLIBCXX_PARALLEL_ASSERT(
- __is_sorted(__target, __target + __length, __comp));
+ _GLIBCXX_PARALLEL_ASSERT(
+ __is_sorted(__target, __target + __length, __comp));
#endif
- __k = 0;
- // Update ends of sequences.
- for (_RAIterIterator __raii = __seqs_begin;
- __raii != __seqs_end; ++__raii)
- {
- _DifferenceTp __length = _GLIBCXX_PARALLEL_LENGTH(*__raii);
- if(__length > 0)
- (*__raii).first += __pieces[__num_threads - 1][__k++].second;
- }
+ __k = 0;
+ // Update ends of sequences.
+ for (_RAIterIterator __raii = __seqs_begin;
+ __raii != __seqs_end; ++__raii)
+ {
+ _DifferenceTp __length = _GLIBCXX_PARALLEL_LENGTH(*__raii);
+ if(__length > 0)
+ (*__raii).first += __pieces[__num_threads - 1][__k++].second;
+ }
- delete[] __pieces;
- delete[] __ne_seqs;
+ delete[] __pieces;
+ delete[] __ne_seqs;
- return __target + __length;
- }
+ return __target + __length;
+ }
-/**
- * @brief Multiway Merge Frontend.
- *
- * Merge the sequences specified by seqs_begin and __seqs_end into
- * __target. __seqs_begin and __seqs_end must point to a sequence of
- * pairs. These pairs must contain an iterator to the beginning
- * of a sequence in their first entry and an iterator the _M_end of
- * the same sequence in their second entry.
- *
- * Ties are broken arbitrarily. See stable_multiway_merge for a variant
- * that breaks ties by sequence number but is slower.
- *
- * The first entries of the pairs (i.e. the begin iterators) will be moved
- * forward.
- *
- * The output sequence has to provide enough space for all elements
- * that are written to it.
- *
- * This function will merge the input sequences:
- *
- * - not stable
- * - parallel, depending on the input size and Settings
- * - using sampling for splitting
- * - not using sentinels
- *
- * Example:
- *
- * <pre>
- * int sequences[10][10];
- * for (int __i = 0; __i < 10; ++__i)
- * for (int __j = 0; __i < 10; ++__j)
- * sequences[__i][__j] = __j;
- *
- * int __out[33];
- * std::vector<std::pair<int*> > seqs;
- * for (int __i = 0; __i < 10; ++__i)
- * { seqs.push(std::make_pair<int*>(sequences[__i], sequences[__i] + 10)) }
- *
- * multiway_merge(seqs.begin(), seqs.end(), __target, std::less<int>(), 33);
- * </pre>
- *
- * @see stable_multiway_merge
- *
- * @pre All input sequences must be sorted.
- * @pre Target must provide enough space to merge out length elements or
- * the number of elements in all sequences, whichever is smaller.
- *
- * @post [__target, return __value) contains merged __elements from the
- * input sequences.
- * @post return __value - __target = min(__length, number of elements in all
- * sequences).
- *
- * @param _RAIterPairIterator iterator over sequence
- * of pairs of iterators
- * @param _RAIterOut iterator over target sequence
- * @param _DifferenceTp difference type for the sequence
- * @param _Compare strict weak ordering type to compare elements
- * in sequences
- *
- * @param __seqs_begin __begin of sequence __sequence
- * @param __seqs_end _M_end of sequence __sequence
- * @param __target target sequence to merge to.
- * @param __comp strict weak ordering to use for element comparison.
- * @param __length Maximum length to merge, possibly larger than the
- * number of elements available.
- *
- * @return _M_end iterator of output sequence
- */
-// multiway_merge
-// public interface
-template<
- typename _RAIterPairIterator
- , typename _RAIterOut
- , typename _DifferenceTp
- , typename _Compare>
-_RAIterOut
-multiway_merge(_RAIterPairIterator __seqs_begin
- , _RAIterPairIterator __seqs_end
- , _RAIterOut __target
- , _DifferenceTp __length, _Compare __comp
- , __gnu_parallel::sequential_tag)
-{
- typedef _DifferenceTp _DifferenceType;
- _GLIBCXX_CALL(__seqs_end - __seqs_begin)
-
- // catch special case: no sequences
- if (__seqs_begin == __seqs_end)
- return __target;
-
- // Execute multiway merge *sequentially*.
- return __sequential_multiway_merge
- </* __stable = */ false, /* __sentinels = */ false>
- (__seqs_begin, __seqs_end, __target,
- *(__seqs_begin->second), __length, __comp);
-}
-
-// public interface
-template<
- typename _RAIterPairIterator
- , typename _RAIterOut
- , typename _DifferenceTp
- , typename _Compare>
-_RAIterOut
-multiway_merge(_RAIterPairIterator __seqs_begin
- , _RAIterPairIterator __seqs_end
- , _RAIterOut __target
- , _DifferenceTp __length, _Compare __comp
- , __gnu_parallel::exact_tag __tag)
-{
- typedef _DifferenceTp _DifferenceType;
- _GLIBCXX_CALL(__seqs_end - __seqs_begin)
+ /**
+ * @brief Multiway Merge Frontend.
+ *
+ * Merge the sequences specified by seqs_begin and __seqs_end into
+ * __target. __seqs_begin and __seqs_end must point to a sequence of
+ * pairs. These pairs must contain an iterator to the beginning
+ * of a sequence in their first entry and an iterator the _M_end of
+ * the same sequence in their second entry.
+ *
+ * Ties are broken arbitrarily. See stable_multiway_merge for a variant
+ * that breaks ties by sequence number but is slower.
+ *
+ * The first entries of the pairs (i.e. the begin iterators) will be moved
+ * forward.
+ *
+ * The output sequence has to provide enough space for all elements
+ * that are written to it.
+ *
+ * This function will merge the input sequences:
+ *
+ * - not stable
+ * - parallel, depending on the input size and Settings
+ * - using sampling for splitting
+ * - not using sentinels
+ *
+ * Example:
+ *
+ * <pre>
+ * int sequences[10][10];
+ * for (int __i = 0; __i < 10; ++__i)
+ * for (int __j = 0; __i < 10; ++__j)
+ * sequences[__i][__j] = __j;
+ *
+ * int __out[33];
+ * std::vector<std::pair<int*> > seqs;
+ * for (int __i = 0; __i < 10; ++__i)
+ * { seqs.push(std::make_pair<int*>(sequences[__i],
+ * sequences[__i] + 10)) }
+ *
+ * multiway_merge(seqs.begin(), seqs.end(), __target, std::less<int>(), 33);
+ * </pre>
+ *
+ * @see stable_multiway_merge
+ *
+ * @pre All input sequences must be sorted.
+ * @pre Target must provide enough space to merge out length elements or
+ * the number of elements in all sequences, whichever is smaller.
+ *
+ * @post [__target, return __value) contains merged __elements from the
+ * input sequences.
+ * @post return __value - __target = min(__length, number of elements in all
+ * sequences).
+ *
+ * @param _RAIterPairIterator iterator over sequence
+ * of pairs of iterators
+ * @param _RAIterOut iterator over target sequence
+ * @param _DifferenceTp difference type for the sequence
+ * @param _Compare strict weak ordering type to compare elements
+ * in sequences
+ *
+ * @param __seqs_begin __begin of sequence __sequence
+ * @param __seqs_end _M_end of sequence __sequence
+ * @param __target target sequence to merge to.
+ * @param __comp strict weak ordering to use for element comparison.
+ * @param __length Maximum length to merge, possibly larger than the
+ * number of elements available.
+ *
+ * @return _M_end iterator of output sequence
+ */
+ // multiway_merge
+ // public interface
+ template<typename _RAIterPairIterator,
+ typename _RAIterOut,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIterOut
+ multiway_merge(_RAIterPairIterator __seqs_begin,
+ _RAIterPairIterator __seqs_end,
+ _RAIterOut __target,
+ _DifferenceTp __length, _Compare __comp,
+ __gnu_parallel::sequential_tag)
+ {
+ typedef _DifferenceTp _DifferenceType;
+ _GLIBCXX_CALL(__seqs_end - __seqs_begin)
- // catch special case: no sequences
- if (__seqs_begin == __seqs_end)
- return __target;
+ // catch special case: no sequences
+ if (__seqs_begin == __seqs_end)
+ return __target;
- // Execute merge; maybe parallel, depending on the number of merged
- // elements and the number of sequences and global thresholds in
- // Settings.
- if ((__seqs_end - __seqs_begin > 1) &&
- _GLIBCXX_PARALLEL_CONDITION(
- ((__seqs_end - __seqs_begin) >=
- __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
- && ((_SequenceIndex)__length >=
- __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
- return parallel_multiway_merge
- </* __stable = */ false, /* __sentinels = */ false>(
- __seqs_begin, __seqs_end, __target,
- multiway_merge_exact_splitting</* __stable = */ false,
- typename std::iterator_traits<_RAIterPairIterator>
- ::value_type*, _Compare, _DifferenceTp>,
- static_cast<_DifferenceType>(__length), __comp,
- __tag.__get_num_threads());
- else
+ // Execute multiway merge *sequentially*.
return __sequential_multiway_merge
- </* __stable = */ false, /* __sentinels = */ false>(
- __seqs_begin, __seqs_end, __target, *(__seqs_begin->second),
- __length, __comp);
-}
-
-// public interface
-template<
- typename _RAIterPairIterator
- , typename _RAIterOut
- , typename _DifferenceTp
- , typename _Compare>
-_RAIterOut
-multiway_merge(_RAIterPairIterator __seqs_begin
- , _RAIterPairIterator __seqs_end
- , _RAIterOut __target
- , _DifferenceTp __length, _Compare __comp
- , __gnu_parallel::sampling_tag __tag)
-{
- typedef _DifferenceTp _DifferenceType;
- _GLIBCXX_CALL(__seqs_end - __seqs_begin)
+ </* __stable = */ false, /* __sentinels = */ false>
+ (__seqs_begin, __seqs_end, __target,
+ *(__seqs_begin->second), __length, __comp);
+ }
- // catch special case: no sequences
- if (__seqs_begin == __seqs_end)
- return __target;
+ // public interface
+ template<typename _RAIterPairIterator,
+ typename _RAIterOut,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIterOut
+ multiway_merge(_RAIterPairIterator __seqs_begin,
+ _RAIterPairIterator __seqs_end,
+ _RAIterOut __target,
+ _DifferenceTp __length, _Compare __comp,
+ __gnu_parallel::exact_tag __tag)
+ {
+ typedef _DifferenceTp _DifferenceType;
+ _GLIBCXX_CALL(__seqs_end - __seqs_begin)
+
+ // catch special case: no sequences
+ if (__seqs_begin == __seqs_end)
+ return __target;
+
+ // Execute merge; maybe parallel, depending on the number of merged
+ // elements and the number of sequences and global thresholds in
+ // Settings.
+ if ((__seqs_end - __seqs_begin > 1)
+ && _GLIBCXX_PARALLEL_CONDITION(
+ ((__seqs_end - __seqs_begin) >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
+ && ((_SequenceIndex)__length >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
+ return parallel_multiway_merge
+ </* __stable = */ false, /* __sentinels = */ false>
+ (__seqs_begin, __seqs_end, __target,
+ multiway_merge_exact_splitting</* __stable = */ false,
+ typename std::iterator_traits<_RAIterPairIterator>
+ ::value_type*, _Compare, _DifferenceTp>,
+ static_cast<_DifferenceType>(__length), __comp,
+ __tag.__get_num_threads());
+ else
+ return __sequential_multiway_merge
+ </* __stable = */ false, /* __sentinels = */ false>
+ (__seqs_begin, __seqs_end, __target,
+ *(__seqs_begin->second), __length, __comp);
+ }
- // Execute merge; maybe parallel, depending on the number of merged
- // elements and the number of sequences and global thresholds in
- // Settings.
- if ((__seqs_end - __seqs_begin > 1) &&
- _GLIBCXX_PARALLEL_CONDITION(
- ((__seqs_end - __seqs_begin) >=
- __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
- && ((_SequenceIndex)__length >=
- __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
- return parallel_multiway_merge
- </* __stable = */ false, /* __sentinels = */ false>(
- __seqs_begin, __seqs_end,
- __target,
- multiway_merge_exact_splitting</* __stable = */ false,
- typename std::iterator_traits<_RAIterPairIterator>
- ::value_type*, _Compare, _DifferenceTp>,
- static_cast<_DifferenceType>(__length), __comp,
- __tag.__get_num_threads());
- else
- return __sequential_multiway_merge
- </* __stable = */ false, /* __sentinels = */ false>(
- __seqs_begin, __seqs_end,
- __target, *(__seqs_begin->second), __length, __comp);
-}
-
-// public interface
-template<
- typename _RAIterPairIterator
- , typename _RAIterOut
- , typename _DifferenceTp
- , typename _Compare>
-_RAIterOut
-multiway_merge(_RAIterPairIterator __seqs_begin
- , _RAIterPairIterator __seqs_end
- , _RAIterOut __target
- , _DifferenceTp __length, _Compare __comp
- , parallel_tag __tag = parallel_tag(0))
-{
- return multiway_merge(__seqs_begin, __seqs_end, __target, __length, __comp,
- exact_tag(__tag.__get_num_threads()));
-}
-
-// public interface
-template<
- typename _RAIterPairIterator
- , typename _RAIterOut
- , typename _DifferenceTp
- , typename _Compare>
-_RAIterOut
-multiway_merge(_RAIterPairIterator __seqs_begin
- , _RAIterPairIterator __seqs_end
- , _RAIterOut __target
- , _DifferenceTp __length, _Compare __comp
- , default_parallel_tag __tag)
-{
- return multiway_merge(__seqs_begin, __seqs_end, __target, __length, __comp,
- exact_tag(__tag.__get_num_threads()));
-}
-
-// stable_multiway_merge
-// public interface
-template<
- typename _RAIterPairIterator
- , typename _RAIterOut
- , typename _DifferenceTp
- , typename _Compare>
-_RAIterOut
-stable_multiway_merge(_RAIterPairIterator __seqs_begin
- , _RAIterPairIterator __seqs_end
- , _RAIterOut __target
- , _DifferenceTp __length, _Compare __comp
- , __gnu_parallel::sequential_tag)
-{
- typedef _DifferenceTp _DifferenceType;
- _GLIBCXX_CALL(__seqs_end - __seqs_begin)
+ // public interface
+ template<typename _RAIterPairIterator,
+ typename _RAIterOut,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIterOut
+ multiway_merge(_RAIterPairIterator __seqs_begin,
+ _RAIterPairIterator __seqs_end,
+ _RAIterOut __target,
+ _DifferenceTp __length, _Compare __comp,
+ __gnu_parallel::sampling_tag __tag)
+ {
+ typedef _DifferenceTp _DifferenceType;
+ _GLIBCXX_CALL(__seqs_end - __seqs_begin)
+
+ // catch special case: no sequences
+ if (__seqs_begin == __seqs_end)
+ return __target;
+
+ // Execute merge; maybe parallel, depending on the number of merged
+ // elements and the number of sequences and global thresholds in
+ // Settings.
+ if ((__seqs_end - __seqs_begin > 1)
+ && _GLIBCXX_PARALLEL_CONDITION(
+ ((__seqs_end - __seqs_begin) >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
+ && ((_SequenceIndex)__length >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
+ return parallel_multiway_merge
+ </* __stable = */ false, /* __sentinels = */ false>
+ (__seqs_begin, __seqs_end, __target,
+ multiway_merge_exact_splitting</* __stable = */ false,
+ typename std::iterator_traits<_RAIterPairIterator>
+ ::value_type*, _Compare, _DifferenceTp>,
+ static_cast<_DifferenceType>(__length), __comp,
+ __tag.__get_num_threads());
+ else
+ return __sequential_multiway_merge
+ </* __stable = */ false, /* __sentinels = */ false>
+ (__seqs_begin, __seqs_end, __target,
+ *(__seqs_begin->second), __length, __comp);
+ }
- // catch special case: no sequences
- if (__seqs_begin == __seqs_end)
- return __target;
+ // public interface
+ template<typename _RAIterPairIterator,
+ typename _RAIterOut,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIterOut
+ multiway_merge(_RAIterPairIterator __seqs_begin,
+ _RAIterPairIterator __seqs_end,
+ _RAIterOut __target,
+ _DifferenceTp __length, _Compare __comp,
+ parallel_tag __tag = parallel_tag(0))
+ { return multiway_merge(__seqs_begin, __seqs_end, __target, __length,
+ __comp, exact_tag(__tag.__get_num_threads())); }
+
+ // public interface
+ template<typename _RAIterPairIterator,
+ typename _RAIterOut,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIterOut
+ multiway_merge(_RAIterPairIterator __seqs_begin,
+ _RAIterPairIterator __seqs_end,
+ _RAIterOut __target,
+ _DifferenceTp __length, _Compare __comp,
+ default_parallel_tag __tag)
+ { return multiway_merge(__seqs_begin, __seqs_end, __target, __length,
+ __comp, exact_tag(__tag.__get_num_threads())); }
+
+ // stable_multiway_merge
+ // public interface
+ template<typename _RAIterPairIterator,
+ typename _RAIterOut,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIterOut
+ stable_multiway_merge(_RAIterPairIterator __seqs_begin,
+ _RAIterPairIterator __seqs_end,
+ _RAIterOut __target,
+ _DifferenceTp __length, _Compare __comp,
+ __gnu_parallel::sequential_tag)
+ {
+ typedef _DifferenceTp _DifferenceType;
+ _GLIBCXX_CALL(__seqs_end - __seqs_begin)
- // Execute multiway merge *sequentially*.
- return __sequential_multiway_merge
- </* __stable = */ true, /* __sentinels = */ false>
- (__seqs_begin, __seqs_end, __target, *(__seqs_begin->second), __length,
- __comp);
-}
-
-// public interface
-template<
- typename _RAIterPairIterator
- , typename _RAIterOut
- , typename _DifferenceTp
- , typename _Compare>
-_RAIterOut
-stable_multiway_merge(_RAIterPairIterator __seqs_begin
- , _RAIterPairIterator __seqs_end
- , _RAIterOut __target
- , _DifferenceTp __length, _Compare __comp
- , __gnu_parallel::exact_tag __tag)
-{
- typedef _DifferenceTp _DifferenceType;
- _GLIBCXX_CALL(__seqs_end - __seqs_begin)
+ // catch special case: no sequences
+ if (__seqs_begin == __seqs_end)
+ return __target;
- // catch special case: no sequences
- if (__seqs_begin == __seqs_end)
- return __target;
+ // Execute multiway merge *sequentially*.
+ return __sequential_multiway_merge
+ </* __stable = */ true, /* __sentinels = */ false>
+ (__seqs_begin, __seqs_end, __target,
+ *(__seqs_begin->second), __length, __comp);
+ }
- // Execute merge; maybe parallel, depending on the number of merged
- // elements and the number of sequences and global thresholds in
- // Settings.
- if ((__seqs_end - __seqs_begin > 1) &&
- _GLIBCXX_PARALLEL_CONDITION(
- ((__seqs_end - __seqs_begin) >=
- __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
- && ((_SequenceIndex)__length >=
- __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
- return parallel_multiway_merge
- </* __stable = */ true, /* __sentinels = */ false>(
- __seqs_begin, __seqs_end,
- __target,
- multiway_merge_exact_splitting</* __stable = */ true,
- typename std::iterator_traits<_RAIterPairIterator>
- ::value_type*, _Compare, _DifferenceTp>,
- static_cast<_DifferenceType>(__length), __comp,
- __tag.__get_num_threads());
- else
- return __sequential_multiway_merge</* __stable = */ true,
- /* __sentinels = */ false>(
- __seqs_begin, __seqs_end,
- __target, *(__seqs_begin->second), __length, __comp);
-}
-
-// public interface
-template<
- typename _RAIterPairIterator
- , typename _RAIterOut
- , typename _DifferenceTp
- , typename _Compare>
-_RAIterOut
-stable_multiway_merge(_RAIterPairIterator __seqs_begin
- , _RAIterPairIterator __seqs_end
- , _RAIterOut __target
- , _DifferenceTp __length, _Compare __comp
- , sampling_tag __tag)
-{
- typedef _DifferenceTp _DifferenceType;
- _GLIBCXX_CALL(__seqs_end - __seqs_begin)
+ // public interface
+ template<typename _RAIterPairIterator,
+ typename _RAIterOut,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIterOut
+ stable_multiway_merge(_RAIterPairIterator __seqs_begin,
+ _RAIterPairIterator __seqs_end,
+ _RAIterOut __target,
+ _DifferenceTp __length, _Compare __comp,
+ __gnu_parallel::exact_tag __tag)
+ {
+ typedef _DifferenceTp _DifferenceType;
+ _GLIBCXX_CALL(__seqs_end - __seqs_begin)
+
+ // catch special case: no sequences
+ if (__seqs_begin == __seqs_end)
+ return __target;
+
+ // Execute merge; maybe parallel, depending on the number of merged
+ // elements and the number of sequences and global thresholds in
+ // Settings.
+ if ((__seqs_end - __seqs_begin > 1)
+ && _GLIBCXX_PARALLEL_CONDITION(
+ ((__seqs_end - __seqs_begin) >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
+ && ((_SequenceIndex)__length >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
+ return parallel_multiway_merge
+ </* __stable = */ true, /* __sentinels = */ false>
+ (__seqs_begin, __seqs_end, __target,
+ multiway_merge_exact_splitting</* __stable = */ true,
+ typename std::iterator_traits<_RAIterPairIterator>
+ ::value_type*, _Compare, _DifferenceTp>,
+ static_cast<_DifferenceType>(__length), __comp,
+ __tag.__get_num_threads());
+ else
+ return __sequential_multiway_merge
+ </* __stable = */ true, /* __sentinels = */ false>
+ (__seqs_begin, __seqs_end, __target,
+ *(__seqs_begin->second), __length, __comp);
+ }
- // catch special case: no sequences
- if (__seqs_begin == __seqs_end)
- return __target;
+ // public interface
+ template<typename _RAIterPairIterator,
+ typename _RAIterOut,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIterOut
+ stable_multiway_merge(_RAIterPairIterator __seqs_begin,
+ _RAIterPairIterator __seqs_end,
+ _RAIterOut __target,
+ _DifferenceTp __length, _Compare __comp,
+ sampling_tag __tag)
+ {
+ typedef _DifferenceTp _DifferenceType;
+ _GLIBCXX_CALL(__seqs_end - __seqs_begin)
+
+ // catch special case: no sequences
+ if (__seqs_begin == __seqs_end)
+ return __target;
+
+ // Execute merge; maybe parallel, depending on the number of merged
+ // elements and the number of sequences and global thresholds in
+ // Settings.
+ if ((__seqs_end - __seqs_begin > 1)
+ && _GLIBCXX_PARALLEL_CONDITION(
+ ((__seqs_end - __seqs_begin) >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
+ && ((_SequenceIndex)__length >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
+ return parallel_multiway_merge
+ </* __stable = */ true, /* __sentinels = */ false>
+ (__seqs_begin, __seqs_end, __target,
+ multiway_merge_sampling_splitting</* __stable = */ true,
+ typename std::iterator_traits<_RAIterPairIterator>
+ ::value_type*, _Compare, _DifferenceTp>,
+ static_cast<_DifferenceType>(__length), __comp,
+ __tag.__get_num_threads());
+ else
+ return __sequential_multiway_merge
+ </* __stable = */ true, /* __sentinels = */ false>
+ (__seqs_begin, __seqs_end, __target,
+ *(__seqs_begin->second), __length, __comp);
+ }
- // Execute merge; maybe parallel, depending on the number of merged
- // elements and the number of sequences and global thresholds in
- // Settings.
- if ((__seqs_end - __seqs_begin > 1) &&
- _GLIBCXX_PARALLEL_CONDITION(
- ((__seqs_end - __seqs_begin) >=
- __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
- && ((_SequenceIndex)__length >=
- __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
- return parallel_multiway_merge
- </* __stable = */ true, /* __sentinels = */ false>(
- __seqs_begin, __seqs_end,
- __target,
- multiway_merge_sampling_splitting</* __stable = */ true,
- typename std::iterator_traits<_RAIterPairIterator>
- ::value_type*, _Compare, _DifferenceTp>,
- static_cast<_DifferenceType>(__length), __comp,
- __tag.__get_num_threads());
- else
- return __sequential_multiway_merge
- </* __stable = */ true, /* __sentinels = */ false>(
- __seqs_begin, __seqs_end,
- __target, *(__seqs_begin->second), __length, __comp);
-}
-
-
-// public interface
-template<
- typename _RAIterPairIterator
- , typename _RAIterOut
- , typename _DifferenceTp
- , typename _Compare>
-_RAIterOut
-stable_multiway_merge(_RAIterPairIterator __seqs_begin
- , _RAIterPairIterator __seqs_end
- , _RAIterOut __target
- , _DifferenceTp __length, _Compare __comp
- , parallel_tag __tag = parallel_tag(0))
-{
- return stable_multiway_merge(
- __seqs_begin, __seqs_end, __target, __length, __comp,
- exact_tag(__tag.__get_num_threads()));
-}
-
-// public interface
-template<
- typename _RAIterPairIterator
- , typename _RAIterOut
- , typename _DifferenceTp
- , typename _Compare>
-_RAIterOut
-stable_multiway_merge(_RAIterPairIterator __seqs_begin
- , _RAIterPairIterator __seqs_end
- , _RAIterOut __target
- , _DifferenceTp __length, _Compare __comp
- , default_parallel_tag __tag)
-{
- return stable_multiway_merge(
- __seqs_begin, __seqs_end, __target, __length, __comp,
- exact_tag(__tag.__get_num_threads()));
-}
-
-/**
- * @brief Multiway Merge Frontend.
- *
- * Merge the sequences specified by seqs_begin and __seqs_end into
- * __target. __seqs_begin and __seqs_end must point to a sequence of
- * pairs. These pairs must contain an iterator to the beginning
- * of a sequence in their first entry and an iterator the _M_end of
- * the same sequence in their second entry.
- *
- * Ties are broken arbitrarily. See stable_multiway_merge for a variant
- * that breaks ties by sequence number but is slower.
- *
- * The first entries of the pairs (i.e. the begin iterators) will be moved
- * forward accordingly.
- *
- * The output sequence has to provide enough space for all elements
- * that are written to it.
- *
- * This function will merge the input sequences:
- *
- * - not stable
- * - parallel, depending on the input size and Settings
- * - using sampling for splitting
- * - using sentinels
- *
- * You have to take care that the element the _M_end iterator points to is
- * readable and contains a value that is greater than any other non-sentinel
- * value in all sequences.
- *
- * Example:
- *
- * <pre>
- * int sequences[10][11];
- * for (int __i = 0; __i < 10; ++__i)
- * for (int __j = 0; __i < 11; ++__j)
- * sequences[__i][__j] = __j; // __last one is sentinel!
- *
- * int __out[33];
- * std::vector<std::pair<int*> > seqs;
- * for (int __i = 0; __i < 10; ++__i)
- * { seqs.push(std::make_pair<int*>(sequences[__i], sequences[__i] + 10)) }
- *
- * multiway_merge(seqs.begin(), seqs.end(), __target, std::less<int>(), 33);
- * </pre>
- *
- * @pre All input sequences must be sorted.
- * @pre Target must provide enough space to merge out length elements or
- * the number of elements in all sequences, whichever is smaller.
- * @pre For each @__c __i, @__c __seqs_begin[__i].second must be the end
- * marker of the sequence, but also reference the one more __sentinel
- * element.
- *
- * @post [__target, return __value) contains merged __elements from the
- * input sequences.
- * @post return __value - __target = min(__length, number of elements in all
- * sequences).
- *
- * @see stable_multiway_merge_sentinels
- *
- * @param _RAIterPairIterator iterator over sequence
- * of pairs of iterators
- * @param _RAIterOut iterator over target sequence
- * @param _DifferenceTp difference type for the sequence
- * @param _Compare strict weak ordering type to compare elements
- * in sequences
- *
- * @param __seqs_begin __begin of sequence __sequence
- * @param __seqs_end _M_end of sequence __sequence
- * @param __target target sequence to merge to.
- * @param __comp strict weak ordering to use for element comparison.
- * @param __length Maximum length to merge, possibly larger than the
- * number of elements available.
- *
- * @return _M_end iterator of output sequence
- */
-// multiway_merge_sentinels
-// public interface
-template<
- typename _RAIterPairIterator
- , typename _RAIterOut
- , typename _DifferenceTp
- , typename _Compare>
-_RAIterOut
-multiway_merge_sentinels(_RAIterPairIterator __seqs_begin
- , _RAIterPairIterator __seqs_end
- , _RAIterOut __target
- , _DifferenceTp __length, _Compare __comp
- , __gnu_parallel::sequential_tag)
-{
- typedef _DifferenceTp _DifferenceType;
- _GLIBCXX_CALL(__seqs_end - __seqs_begin)
+ // public interface
+ template<typename _RAIterPairIterator,
+ typename _RAIterOut,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIterOut
+ stable_multiway_merge(_RAIterPairIterator __seqs_begin,
+ _RAIterPairIterator __seqs_end,
+ _RAIterOut __target,
+ _DifferenceTp __length, _Compare __comp,
+ parallel_tag __tag = parallel_tag(0))
+ {
+ return stable_multiway_merge
+ (__seqs_begin, __seqs_end, __target, __length, __comp,
+ exact_tag(__tag.__get_num_threads()));
+ }
- // catch special case: no sequences
- if (__seqs_begin == __seqs_end)
- return __target;
+ // public interface
+ template<typename _RAIterPairIterator,
+ typename _RAIterOut,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIterOut
+ stable_multiway_merge(_RAIterPairIterator __seqs_begin,
+ _RAIterPairIterator __seqs_end,
+ _RAIterOut __target,
+ _DifferenceTp __length, _Compare __comp,
+ default_parallel_tag __tag)
+ {
+ return stable_multiway_merge
+ (__seqs_begin, __seqs_end, __target, __length, __comp,
+ exact_tag(__tag.__get_num_threads()));
+ }
- // Execute multiway merge *sequentially*.
- return __sequential_multiway_merge
- </* __stable = */ false, /* __sentinels = */ true>
- (__seqs_begin, __seqs_end,
- __target, *(__seqs_begin->second), __length, __comp);
-}
-
-// public interface
-template<
- typename _RAIterPairIterator
- , typename _RAIterOut
- , typename _DifferenceTp
- , typename _Compare>
-_RAIterOut
-multiway_merge_sentinels(_RAIterPairIterator __seqs_begin
- , _RAIterPairIterator __seqs_end
- , _RAIterOut __target
- , _DifferenceTp __length, _Compare __comp
- , __gnu_parallel::exact_tag __tag)
-{
- typedef _DifferenceTp _DifferenceType;
- _GLIBCXX_CALL(__seqs_end - __seqs_begin)
+ /**
+ * @brief Multiway Merge Frontend.
+ *
+ * Merge the sequences specified by seqs_begin and __seqs_end into
+ * __target. __seqs_begin and __seqs_end must point to a sequence of
+ * pairs. These pairs must contain an iterator to the beginning
+ * of a sequence in their first entry and an iterator the _M_end of
+ * the same sequence in their second entry.
+ *
+ * Ties are broken arbitrarily. See stable_multiway_merge for a variant
+ * that breaks ties by sequence number but is slower.
+ *
+ * The first entries of the pairs (i.e. the begin iterators) will be moved
+ * forward accordingly.
+ *
+ * The output sequence has to provide enough space for all elements
+ * that are written to it.
+ *
+ * This function will merge the input sequences:
+ *
+ * - not stable
+ * - parallel, depending on the input size and Settings
+ * - using sampling for splitting
+ * - using sentinels
+ *
+ * You have to take care that the element the _M_end iterator points to is
+ * readable and contains a value that is greater than any other non-sentinel
+ * value in all sequences.
+ *
+ * Example:
+ *
+ * <pre>
+ * int sequences[10][11];
+ * for (int __i = 0; __i < 10; ++__i)
+ * for (int __j = 0; __i < 11; ++__j)
+ * sequences[__i][__j] = __j; // __last one is sentinel!
+ *
+ * int __out[33];
+ * std::vector<std::pair<int*> > seqs;
+ * for (int __i = 0; __i < 10; ++__i)
+ * { seqs.push(std::make_pair<int*>(sequences[__i],
+ * sequences[__i] + 10)) }
+ *
+ * multiway_merge(seqs.begin(), seqs.end(), __target, std::less<int>(), 33);
+ * </pre>
+ *
+ * @pre All input sequences must be sorted.
+ * @pre Target must provide enough space to merge out length elements or
+ * the number of elements in all sequences, whichever is smaller.
+ * @pre For each @c __i, @c __seqs_begin[__i].second must be the end
+ * marker of the sequence, but also reference the one more __sentinel
+ * element.
+ *
+ * @post [__target, return __value) contains merged __elements from the
+ * input sequences.
+ * @post return __value - __target = min(__length, number of elements in all
+ * sequences).
+ *
+ * @see stable_multiway_merge_sentinels
+ *
+ * @param _RAIterPairIterator iterator over sequence
+ * of pairs of iterators
+ * @param _RAIterOut iterator over target sequence
+ * @param _DifferenceTp difference type for the sequence
+ * @param _Compare strict weak ordering type to compare elements
+ * in sequences
+ *
+ * @param __seqs_begin __begin of sequence __sequence
+ * @param __seqs_end _M_end of sequence __sequence
+ * @param __target target sequence to merge to.
+ * @param __comp strict weak ordering to use for element comparison.
+ * @param __length Maximum length to merge, possibly larger than the
+ * number of elements available.
+ *
+ * @return _M_end iterator of output sequence
+ */
+ // multiway_merge_sentinels
+ // public interface
+ template<typename _RAIterPairIterator,
+ typename _RAIterOut,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIterOut
+ multiway_merge_sentinels(_RAIterPairIterator __seqs_begin,
+ _RAIterPairIterator __seqs_end,
+ _RAIterOut __target,
+ _DifferenceTp __length, _Compare __comp,
+ __gnu_parallel::sequential_tag)
+ {
+ typedef _DifferenceTp _DifferenceType;
+ _GLIBCXX_CALL(__seqs_end - __seqs_begin)
- // catch special case: no sequences
- if (__seqs_begin == __seqs_end)
- return __target;
+ // catch special case: no sequences
+ if (__seqs_begin == __seqs_end)
+ return __target;
- // Execute merge; maybe parallel, depending on the number of merged
- // elements and the number of sequences and global thresholds in
- // Settings.
- if ((__seqs_end - __seqs_begin > 1) &&
- _GLIBCXX_PARALLEL_CONDITION(
- ((__seqs_end - __seqs_begin) >=
- __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
- && ((_SequenceIndex)__length >=
- __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
- return parallel_multiway_merge
- </* __stable = */ false, /* __sentinels = */ true>(
- __seqs_begin, __seqs_end,
- __target,
- multiway_merge_exact_splitting</* __stable = */ false,
- typename std::iterator_traits<_RAIterPairIterator>
- ::value_type*, _Compare, _DifferenceTp>,
- static_cast<_DifferenceType>(__length), __comp,
- __tag.__get_num_threads());
- else
+ // Execute multiway merge *sequentially*.
return __sequential_multiway_merge
- </* __stable = */ false, /* __sentinels = */ true>(
- __seqs_begin, __seqs_end,
- __target, *(__seqs_begin->second), __length, __comp);
-}
-
-// public interface
-template<
- typename _RAIterPairIterator
- , typename _RAIterOut
- , typename _DifferenceTp
- , typename _Compare>
-_RAIterOut
-multiway_merge_sentinels(_RAIterPairIterator __seqs_begin
- , _RAIterPairIterator __seqs_end
- , _RAIterOut __target
- , _DifferenceTp __length, _Compare __comp
- , sampling_tag __tag)
-{
- typedef _DifferenceTp _DifferenceType;
- _GLIBCXX_CALL(__seqs_end - __seqs_begin)
+ </* __stable = */ false, /* __sentinels = */ true>
+ (__seqs_begin, __seqs_end,
+ __target, *(__seqs_begin->second), __length, __comp);
+ }
- // catch special case: no sequences
- if (__seqs_begin == __seqs_end)
- return __target;
+ // public interface
+ template<typename _RAIterPairIterator,
+ typename _RAIterOut,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIterOut
+ multiway_merge_sentinels(_RAIterPairIterator __seqs_begin,
+ _RAIterPairIterator __seqs_end,
+ _RAIterOut __target,
+ _DifferenceTp __length, _Compare __comp,
+ __gnu_parallel::exact_tag __tag)
+ {
+ typedef _DifferenceTp _DifferenceType;
+ _GLIBCXX_CALL(__seqs_end - __seqs_begin)
+
+ // catch special case: no sequences
+ if (__seqs_begin == __seqs_end)
+ return __target;
+
+ // Execute merge; maybe parallel, depending on the number of merged
+ // elements and the number of sequences and global thresholds in
+ // Settings.
+ if ((__seqs_end - __seqs_begin > 1)
+ && _GLIBCXX_PARALLEL_CONDITION(
+ ((__seqs_end - __seqs_begin) >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
+ && ((_SequenceIndex)__length >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
+ return parallel_multiway_merge
+ </* __stable = */ false, /* __sentinels = */ true>
+ (__seqs_begin, __seqs_end, __target,
+ multiway_merge_exact_splitting</* __stable = */ false,
+ typename std::iterator_traits<_RAIterPairIterator>
+ ::value_type*, _Compare, _DifferenceTp>,
+ static_cast<_DifferenceType>(__length), __comp,
+ __tag.__get_num_threads());
+ else
+ return __sequential_multiway_merge
+ </* __stable = */ false, /* __sentinels = */ true>
+ (__seqs_begin, __seqs_end, __target,
+ *(__seqs_begin->second), __length, __comp);
+ }
- // Execute merge; maybe parallel, depending on the number of merged
- // elements and the number of sequences and global thresholds in
- // Settings.
- if ((__seqs_end - __seqs_begin > 1) &&
- _GLIBCXX_PARALLEL_CONDITION(
- ((__seqs_end - __seqs_begin) >=
- __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
- && ((_SequenceIndex)__length >=
- __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
- return parallel_multiway_merge
- </* __stable = */ false, /* __sentinels = */ true>
- (__seqs_begin, __seqs_end, __target,
- multiway_merge_sampling_splitting</* __stable = */ false,
- typename std::iterator_traits<_RAIterPairIterator>
- ::value_type*, _Compare, _DifferenceTp>,
- static_cast<_DifferenceType>(__length), __comp,
- __tag.__get_num_threads());
- else
- return __sequential_multiway_merge
- </* __stable = */false, /* __sentinels = */ true>(
- __seqs_begin, __seqs_end,
- __target, *(__seqs_begin->second), __length, __comp);
-}
-
-// public interface
-template<
- typename _RAIterPairIterator
- , typename _RAIterOut
- , typename _DifferenceTp
- , typename _Compare>
-_RAIterOut
-multiway_merge_sentinels(_RAIterPairIterator __seqs_begin
- , _RAIterPairIterator __seqs_end
- , _RAIterOut __target
- , _DifferenceTp __length, _Compare __comp
- , parallel_tag __tag = parallel_tag(0))
-{
- return multiway_merge_sentinels(
- __seqs_begin, __seqs_end, __target, __length, __comp,
- exact_tag(__tag.__get_num_threads()));
-}
-
-// public interface
-template<
- typename _RAIterPairIterator
- , typename _RAIterOut
- , typename _DifferenceTp
- , typename _Compare>
-_RAIterOut
-multiway_merge_sentinels(_RAIterPairIterator __seqs_begin
- , _RAIterPairIterator __seqs_end
- , _RAIterOut __target
- , _DifferenceTp __length, _Compare __comp
- , default_parallel_tag __tag)
-{
- return multiway_merge_sentinels(
- __seqs_begin, __seqs_end, __target, __length, __comp,
- exact_tag(__tag.__get_num_threads()));
-}
-
-// stable_multiway_merge_sentinels
-// public interface
-template<
- typename _RAIterPairIterator
- , typename _RAIterOut
- , typename _DifferenceTp
- , typename _Compare>
-_RAIterOut
-stable_multiway_merge_sentinels(_RAIterPairIterator __seqs_begin
- , _RAIterPairIterator __seqs_end
- , _RAIterOut __target
- , _DifferenceTp __length, _Compare __comp
- , __gnu_parallel::sequential_tag)
-{
- typedef _DifferenceTp _DifferenceType;
- _GLIBCXX_CALL(__seqs_end - __seqs_begin)
+ // public interface
+ template<typename _RAIterPairIterator,
+ typename _RAIterOut,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIterOut
+ multiway_merge_sentinels(_RAIterPairIterator __seqs_begin,
+ _RAIterPairIterator __seqs_end,
+ _RAIterOut __target,
+ _DifferenceTp __length, _Compare __comp,
+ sampling_tag __tag)
+ {
+ typedef _DifferenceTp _DifferenceType;
+ _GLIBCXX_CALL(__seqs_end - __seqs_begin)
+
+ // catch special case: no sequences
+ if (__seqs_begin == __seqs_end)
+ return __target;
+
+ // Execute merge; maybe parallel, depending on the number of merged
+ // elements and the number of sequences and global thresholds in
+ // Settings.
+ if ((__seqs_end - __seqs_begin > 1)
+ && _GLIBCXX_PARALLEL_CONDITION(
+ ((__seqs_end - __seqs_begin) >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
+ && ((_SequenceIndex)__length >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
+ return parallel_multiway_merge
+ </* __stable = */ false, /* __sentinels = */ true>
+ (__seqs_begin, __seqs_end, __target,
+ multiway_merge_sampling_splitting</* __stable = */ false,
+ typename std::iterator_traits<_RAIterPairIterator>
+ ::value_type*, _Compare, _DifferenceTp>,
+ static_cast<_DifferenceType>(__length), __comp,
+ __tag.__get_num_threads());
+ else
+ return __sequential_multiway_merge
+ </* __stable = */false, /* __sentinels = */ true>(
+ __seqs_begin, __seqs_end, __target,
+ *(__seqs_begin->second), __length, __comp);
+ }
- // catch special case: no sequences
- if (__seqs_begin == __seqs_end)
- return __target;
+ // public interface
+ template<typename _RAIterPairIterator,
+ typename _RAIterOut,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIterOut
+ multiway_merge_sentinels(_RAIterPairIterator __seqs_begin,
+ _RAIterPairIterator __seqs_end,
+ _RAIterOut __target,
+ _DifferenceTp __length, _Compare __comp,
+ parallel_tag __tag = parallel_tag(0))
+ {
+ return multiway_merge_sentinels
+ (__seqs_begin, __seqs_end, __target, __length, __comp,
+ exact_tag(__tag.__get_num_threads()));
+ }
- // Execute multiway merge *sequentially*.
- return __sequential_multiway_merge
- </* __stable = */ true, /* __sentinels = */ true>
- (__seqs_begin, __seqs_end, __target, *(__seqs_begin->second), __length,
- __comp);
-}
-
-// public interface
-template<
- typename _RAIterPairIterator
- , typename _RAIterOut
- , typename _DifferenceTp
- , typename _Compare>
-_RAIterOut
-stable_multiway_merge_sentinels(_RAIterPairIterator __seqs_begin
- , _RAIterPairIterator __seqs_end
- , _RAIterOut __target
- , _DifferenceTp __length, _Compare __comp
- , __gnu_parallel::exact_tag __tag)
-{
- typedef _DifferenceTp _DifferenceType;
- _GLIBCXX_CALL(__seqs_end - __seqs_begin)
+ // public interface
+ template<typename _RAIterPairIterator,
+ typename _RAIterOut,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIterOut
+ multiway_merge_sentinels(_RAIterPairIterator __seqs_begin,
+ _RAIterPairIterator __seqs_end,
+ _RAIterOut __target,
+ _DifferenceTp __length, _Compare __comp,
+ default_parallel_tag __tag)
+ {
+ return multiway_merge_sentinels
+ (__seqs_begin, __seqs_end, __target, __length, __comp,
+ exact_tag(__tag.__get_num_threads()));
+ }
- // catch special case: no sequences
- if (__seqs_begin == __seqs_end)
- return __target;
+ // stable_multiway_merge_sentinels
+ // public interface
+ template<typename _RAIterPairIterator,
+ typename _RAIterOut,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIterOut
+ stable_multiway_merge_sentinels(_RAIterPairIterator __seqs_begin,
+ _RAIterPairIterator __seqs_end,
+ _RAIterOut __target,
+ _DifferenceTp __length, _Compare __comp,
+ __gnu_parallel::sequential_tag)
+ {
+ typedef _DifferenceTp _DifferenceType;
+ _GLIBCXX_CALL(__seqs_end - __seqs_begin)
- // Execute merge; maybe parallel, depending on the number of merged
- // elements and the number of sequences and global thresholds in
- // Settings.
- if ((__seqs_end - __seqs_begin > 1) &&
- _GLIBCXX_PARALLEL_CONDITION(
- ((__seqs_end - __seqs_begin) >=
- __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
- && ((_SequenceIndex)__length >=
- __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
- return parallel_multiway_merge
- </* __stable = */ true, /* __sentinels = */ true>(
- __seqs_begin, __seqs_end,
- __target,
- multiway_merge_exact_splitting</* __stable = */ true,
- typename std::iterator_traits<_RAIterPairIterator>
- ::value_type*, _Compare, _DifferenceTp>,
- static_cast<_DifferenceType>(__length), __comp,
- __tag.__get_num_threads());
- else
- return __sequential_multiway_merge
- </* __stable = */ true, /* __sentinels = */ true>(
- __seqs_begin, __seqs_end, __target, *(__seqs_begin->second),
- __length, __comp);
-}
-
-// public interface
-template<
- typename _RAIterPairIterator
- , typename _RAIterOut
- , typename _DifferenceTp
- , typename _Compare>
-_RAIterOut
-stable_multiway_merge_sentinels(_RAIterPairIterator __seqs_begin
- , _RAIterPairIterator __seqs_end
- , _RAIterOut __target
- , _DifferenceTp __length, _Compare __comp
- , sampling_tag __tag)
-{
- typedef _DifferenceTp _DifferenceType;
- _GLIBCXX_CALL(__seqs_end - __seqs_begin)
+ // catch special case: no sequences
+ if (__seqs_begin == __seqs_end)
+ return __target;
- // catch special case: no sequences
- if (__seqs_begin == __seqs_end)
- return __target;
+ // Execute multiway merge *sequentially*.
+ return __sequential_multiway_merge
+ </* __stable = */ true, /* __sentinels = */ true>
+ (__seqs_begin, __seqs_end, __target,
+ *(__seqs_begin->second), __length, __comp);
+ }
- // Execute merge; maybe parallel, depending on the number of merged
- // elements and the number of sequences and global thresholds in
- // Settings.
- if ((__seqs_end - __seqs_begin > 1) &&
- _GLIBCXX_PARALLEL_CONDITION(
- ((__seqs_end - __seqs_begin) >=
+ // public interface
+ template<typename _RAIterPairIterator,
+ typename _RAIterOut,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIterOut
+ stable_multiway_merge_sentinels(_RAIterPairIterator __seqs_begin,
+ _RAIterPairIterator __seqs_end,
+ _RAIterOut __target,
+ _DifferenceTp __length, _Compare __comp,
+ __gnu_parallel::exact_tag __tag)
+ {
+ typedef _DifferenceTp _DifferenceType;
+ _GLIBCXX_CALL(__seqs_end - __seqs_begin)
+
+ // catch special case: no sequences
+ if (__seqs_begin == __seqs_end)
+ return __target;
+
+ // Execute merge; maybe parallel, depending on the number of merged
+ // elements and the number of sequences and global thresholds in
+ // Settings.
+ if ((__seqs_end - __seqs_begin > 1)
+ && _GLIBCXX_PARALLEL_CONDITION(
+ ((__seqs_end - __seqs_begin) >=
__gnu_parallel::_Settings::get().multiway_merge_minimal_k)
- && ((_SequenceIndex)__length >=
+ && ((_SequenceIndex)__length >=
__gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
- return parallel_multiway_merge
- </* __stable = */ true, /* __sentinels = */ true>(
- __seqs_begin, __seqs_end,
- __target,
- multiway_merge_sampling_splitting</* __stable = */ true,
- typename std::iterator_traits<_RAIterPairIterator>
- ::value_type*, _Compare, _DifferenceTp>,
- static_cast<_DifferenceType>(__length), __comp,
- __tag.__get_num_threads());
- else
- return __sequential_multiway_merge
- </* __stable = */ true, /* __sentinels = */ true>(
- __seqs_begin, __seqs_end,
- __target, *(__seqs_begin->second), __length, __comp);
-}
-
-// public interface
-template<
- typename _RAIterPairIterator
- , typename _RAIterOut
- , typename _DifferenceTp
- , typename _Compare>
-_RAIterOut
-stable_multiway_merge_sentinels(_RAIterPairIterator __seqs_begin
- , _RAIterPairIterator __seqs_end
- , _RAIterOut __target
- , _DifferenceTp __length, _Compare __comp
- , parallel_tag __tag = parallel_tag(0))
-{
- return stable_multiway_merge_sentinels(
- __seqs_begin, __seqs_end, __target, __length, __comp,
- exact_tag(__tag.__get_num_threads()));
-}
-
-// public interface
-template<
- typename _RAIterPairIterator
- , typename _RAIterOut
- , typename _DifferenceTp
- , typename _Compare>
-_RAIterOut
-stable_multiway_merge_sentinels(_RAIterPairIterator __seqs_begin
- , _RAIterPairIterator __seqs_end
- , _RAIterOut __target
- , _DifferenceTp __length, _Compare __comp
- , default_parallel_tag __tag)
-{
- return stable_multiway_merge_sentinels(
- __seqs_begin, __seqs_end, __target, __length, __comp,
- exact_tag(__tag.__get_num_threads()));
-}
+ return parallel_multiway_merge
+ </* __stable = */ true, /* __sentinels = */ true>
+ (__seqs_begin, __seqs_end, __target,
+ multiway_merge_exact_splitting</* __stable = */ true,
+ typename std::iterator_traits<_RAIterPairIterator>
+ ::value_type*, _Compare, _DifferenceTp>,
+ static_cast<_DifferenceType>(__length), __comp,
+ __tag.__get_num_threads());
+ else
+ return __sequential_multiway_merge
+ </* __stable = */ true, /* __sentinels = */ true>
+ (__seqs_begin, __seqs_end, __target,
+ *(__seqs_begin->second), __length, __comp);
+ }
+
+ // public interface
+ template<typename _RAIterPairIterator,
+ typename _RAIterOut,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIterOut
+ stable_multiway_merge_sentinels(_RAIterPairIterator __seqs_begin,
+ _RAIterPairIterator __seqs_end,
+ _RAIterOut __target,
+ _DifferenceTp __length,
+ _Compare __comp,
+ sampling_tag __tag)
+ {
+ typedef _DifferenceTp _DifferenceType;
+ _GLIBCXX_CALL(__seqs_end - __seqs_begin)
+
+ // catch special case: no sequences
+ if (__seqs_begin == __seqs_end)
+ return __target;
+
+ // Execute merge; maybe parallel, depending on the number of merged
+ // elements and the number of sequences and global thresholds in
+ // Settings.
+ if ((__seqs_end - __seqs_begin > 1)
+ && _GLIBCXX_PARALLEL_CONDITION(
+ ((__seqs_end - __seqs_begin) >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
+ && ((_SequenceIndex)__length >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
+ return parallel_multiway_merge
+ </* __stable = */ true, /* __sentinels = */ true>
+ (__seqs_begin, __seqs_end, __target,
+ multiway_merge_sampling_splitting</* __stable = */ true,
+ typename std::iterator_traits<_RAIterPairIterator>
+ ::value_type*, _Compare, _DifferenceTp>,
+ static_cast<_DifferenceType>(__length), __comp,
+ __tag.__get_num_threads());
+ else
+ return __sequential_multiway_merge
+ </* __stable = */ true, /* __sentinels = */ true>
+ (__seqs_begin, __seqs_end, __target,
+ *(__seqs_begin->second), __length, __comp);
+ }
+
+ // public interface
+ template<typename _RAIterPairIterator,
+ typename _RAIterOut,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIterOut
+ stable_multiway_merge_sentinels(_RAIterPairIterator __seqs_begin,
+ _RAIterPairIterator __seqs_end,
+ _RAIterOut __target,
+ _DifferenceTp __length,
+ _Compare __comp,
+ parallel_tag __tag = parallel_tag(0))
+ {
+ return stable_multiway_merge_sentinels
+ (__seqs_begin, __seqs_end, __target, __length, __comp,
+ exact_tag(__tag.__get_num_threads()));
+ }
+ // public interface
+ template<typename _RAIterPairIterator,
+ typename _RAIterOut,
+ typename _DifferenceTp,
+ typename _Compare>
+ _RAIterOut
+ stable_multiway_merge_sentinels(_RAIterPairIterator __seqs_begin,
+ _RAIterPairIterator __seqs_end,
+ _RAIterOut __target,
+ _DifferenceTp __length, _Compare __comp,
+ default_parallel_tag __tag)
+ {
+ return stable_multiway_merge_sentinels
+ (__seqs_begin, __seqs_end, __target, __length, __comp,
+ exact_tag(__tag.__get_num_threads()));
+ }
}; // namespace __gnu_parallel
#endif /* _GLIBCXX_PARALLEL_MULTIWAY_MERGE_H */
diff --git a/libstdc++-v3/include/parallel/multiway_mergesort.h b/libstdc++-v3/include/parallel/multiway_mergesort.h
index c7f10ae7511..f2bb6fbc30d 100644
--- a/libstdc++-v3/include/parallel/multiway_mergesort.h
+++ b/libstdc++-v3/include/parallel/multiway_mergesort.h
@@ -41,451 +41,434 @@
namespace __gnu_parallel
{
+ /** @brief Subsequence description. */
+ template<typename _DifferenceTp>
+ struct _Piece
+ {
+ typedef _DifferenceTp _DifferenceType;
-/** @brief Subsequence description. */
-template<typename _DifferenceTp>
- struct _Piece
- {
- typedef _DifferenceTp _DifferenceType;
+ /** @brief Begin of subsequence. */
+ _DifferenceType _M_begin;
- /** @brief Begin of subsequence. */
- _DifferenceType _M_begin;
+ /** @brief End of subsequence. */
+ _DifferenceType _M_end;
+ };
- /** @brief End of subsequence. */
- _DifferenceType _M_end;
- };
+ /** @brief Data accessed by all threads.
+ *
+ * PMWMS = parallel multiway mergesort */
+ template<typename _RAIter>
+ struct _PMWMSSortingData
+ {
+ typedef std::iterator_traits<_RAIter> _TraitsType;
+ typedef typename _TraitsType::value_type _ValueType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
-/** @brief Data accessed by all threads.
- *
- * PMWMS = parallel multiway mergesort */
-template<typename _RAIter>
- struct _PMWMSSortingData
- {
- typedef std::iterator_traits<_RAIter> _TraitsType;
- typedef typename _TraitsType::value_type _ValueType;
- typedef typename _TraitsType::difference_type _DifferenceType;
-
- /** @brief Number of threads involved. */
- _ThreadIndex _M_num_threads;
-
- /** @brief Input __begin. */
- _RAIter _M_source;
-
- /** @brief Start indices, per thread. */
- _DifferenceType* _M_starts;
-
- /** @brief Storage in which to sort. */
- _ValueType** _M_temporary;
-
- /** @brief Samples. */
- _ValueType* _M_samples;
-
- /** @brief Offsets to add to the found positions. */
- _DifferenceType* _M_offsets;
-
- /** @brief Pieces of data to merge @__c [thread][__sequence] */
- std::vector<_Piece<_DifferenceType> >* _M_pieces;
-};
-
-/**
- * @brief Select _M_samples from a sequence.
- * @param __sd Pointer to algorithm data. _Result will be placed in
- * @__c __sd->_M_samples.
- * @param __num_samples Number of _M_samples to select.
- */
-template<typename _RAIter, typename _DifferenceTp>
- void
- __determine_samples(_PMWMSSortingData<_RAIter>* __sd,
- _DifferenceTp __num_samples)
- {
- typedef std::iterator_traits<_RAIter> _TraitsType;
- typedef typename _TraitsType::value_type _ValueType;
- typedef _DifferenceTp _DifferenceType;
-
- _ThreadIndex __iam = omp_get_thread_num();
-
- _DifferenceType* __es = new _DifferenceType[__num_samples + 2];
-
- equally_split(__sd->_M_starts[__iam + 1] - __sd->_M_starts[__iam],
- __num_samples + 1, __es);
-
- for (_DifferenceType __i = 0; __i < __num_samples; ++__i)
- ::new(&(__sd->_M_samples[__iam * __num_samples + __i]))
- _ValueType(__sd->_M_source[__sd->_M_starts[__iam] + __es[__i + 1]]);
-
- delete[] __es;
- }
-
-/** @brief Split consistently. */
-template<bool __exact, typename _RAIter,
- typename _Compare, typename _SortingPlacesIterator>
- struct _SplitConsistently
- {
- };
+ /** @brief Number of threads involved. */
+ _ThreadIndex _M_num_threads;
-/** @brief Split by exact splitting. */
-template<typename _RAIter, typename _Compare,
- typename _SortingPlacesIterator>
- struct _SplitConsistently
- <true, _RAIter, _Compare, _SortingPlacesIterator>
- {
- void operator()(
- const _ThreadIndex __iam,
- _PMWMSSortingData<_RAIter>* __sd,
- _Compare& __comp,
- const typename
- std::iterator_traits<_RAIter>::difference_type
- __num_samples)
- const
- {
-# pragma omp barrier
-
- std::vector<std::pair<_SortingPlacesIterator, _SortingPlacesIterator> >
- seqs(__sd->_M_num_threads);
- for (_ThreadIndex __s = 0; __s < __sd->_M_num_threads; __s++)
- seqs[__s] = std::make_pair(__sd->_M_temporary[__s],
- __sd->_M_temporary[__s]
- + (__sd->_M_starts[__s + 1]
- - __sd->_M_starts[__s]));
-
- std::vector<_SortingPlacesIterator> _M_offsets(__sd->_M_num_threads);
-
- // if not last thread
- if (__iam < __sd->_M_num_threads - 1)
- multiseq_partition(seqs.begin(), seqs.end(),
- __sd->_M_starts[__iam + 1], _M_offsets.begin(),
- __comp);
-
- for (int __seq = 0; __seq < __sd->_M_num_threads; __seq++)
- {
- // for each sequence
- if (__iam < (__sd->_M_num_threads - 1))
- __sd->_M_pieces[__iam][__seq]._M_end
- = _M_offsets[__seq] - seqs[__seq].first;
- else
- // very end of this sequence
- __sd->_M_pieces[__iam][__seq]._M_end =
- __sd->_M_starts[__seq + 1] - __sd->_M_starts[__seq];
- }
+ /** @brief Input __begin. */
+ _RAIter _M_source;
-# pragma omp barrier
+ /** @brief Start indices, per thread. */
+ _DifferenceType* _M_starts;
- for (_ThreadIndex __seq = 0; __seq < __sd->_M_num_threads; __seq++)
- {
- // For each sequence.
- if (__iam > 0)
- __sd->_M_pieces[__iam][__seq]._M_begin =
- __sd->_M_pieces[__iam - 1][__seq]._M_end;
- else
- // Absolute beginning.
- __sd->_M_pieces[__iam][__seq]._M_begin = 0;
- }
- }
+ /** @brief Storage in which to sort. */
+ _ValueType** _M_temporary;
+
+ /** @brief Samples. */
+ _ValueType* _M_samples;
+
+ /** @brief Offsets to add to the found positions. */
+ _DifferenceType* _M_offsets;
+
+ /** @brief Pieces of data to merge @c [thread][__sequence] */
+ std::vector<_Piece<_DifferenceType> >* _M_pieces;
};
-/** @brief Split by sampling. */
-template<typename _RAIter, typename _Compare,
- typename _SortingPlacesIterator>
- struct _SplitConsistently<false, _RAIter, _Compare,
- _SortingPlacesIterator>
- {
- void operator()(
- const _ThreadIndex __iam,
- _PMWMSSortingData<_RAIter>* __sd,
- _Compare& __comp,
- const typename
- std::iterator_traits<_RAIter>::difference_type
- __num_samples)
- const
+ /**
+ * @brief Select _M_samples from a sequence.
+ * @param __sd Pointer to algorithm data. _Result will be placed in
+ * @c __sd->_M_samples.
+ * @param __num_samples Number of _M_samples to select.
+ */
+ template<typename _RAIter, typename _DifferenceTp>
+ void
+ __determine_samples(_PMWMSSortingData<_RAIter>* __sd,
+ _DifferenceTp __num_samples)
{
typedef std::iterator_traits<_RAIter> _TraitsType;
typedef typename _TraitsType::value_type _ValueType;
- typedef typename _TraitsType::difference_type _DifferenceType;
+ typedef _DifferenceTp _DifferenceType;
- __determine_samples(__sd, __num_samples);
+ _ThreadIndex __iam = omp_get_thread_num();
-# pragma omp barrier
+ _DifferenceType* __es = new _DifferenceType[__num_samples + 2];
-# pragma omp single
- __gnu_sequential::sort(__sd->_M_samples,
- __sd->_M_samples
- + (__num_samples * __sd->_M_num_threads),
- __comp);
+ equally_split(__sd->_M_starts[__iam + 1] - __sd->_M_starts[__iam],
+ __num_samples + 1, __es);
-# pragma omp barrier
+ for (_DifferenceType __i = 0; __i < __num_samples; ++__i)
+ ::new(&(__sd->_M_samples[__iam * __num_samples + __i]))
+ _ValueType(__sd->_M_source[__sd->_M_starts[__iam]
+ + __es[__i + 1]]);
+
+ delete[] __es;
+ }
- for (_ThreadIndex __s = 0; __s < __sd->_M_num_threads; ++__s)
- {
- // For each sequence.
- if (__num_samples * __iam > 0)
- __sd->_M_pieces[__iam][__s]._M_begin =
+ /** @brief Split consistently. */
+ template<bool __exact, typename _RAIter,
+ typename _Compare, typename _SortingPlacesIterator>
+ struct _SplitConsistently
+ { };
+
+ /** @brief Split by exact splitting. */
+ template<typename _RAIter, typename _Compare,
+ typename _SortingPlacesIterator>
+ struct _SplitConsistently<true, _RAIter, _Compare, _SortingPlacesIterator>
+ {
+ void
+ operator()(const _ThreadIndex __iam,
+ _PMWMSSortingData<_RAIter>* __sd,
+ _Compare& __comp,
+ const typename
+ std::iterator_traits<_RAIter>::difference_type
+ __num_samples) const
+ {
+# pragma omp barrier
+
+ std::vector<std::pair<_SortingPlacesIterator,
+ _SortingPlacesIterator> >
+ __seqs(__sd->_M_num_threads);
+ for (_ThreadIndex __s = 0; __s < __sd->_M_num_threads; __s++)
+ __seqs[__s] = std::make_pair(__sd->_M_temporary[__s],
+ __sd->_M_temporary[__s]
+ + (__sd->_M_starts[__s + 1]
+ - __sd->_M_starts[__s]));
+
+ std::vector<_SortingPlacesIterator> __offsets(__sd->_M_num_threads);
+
+ // if not last thread
+ if (__iam < __sd->_M_num_threads - 1)
+ multiseq_partition(__seqs.begin(), __seqs.end(),
+ __sd->_M_starts[__iam + 1], __offsets.begin(),
+ __comp);
+
+ for (int __seq = 0; __seq < __sd->_M_num_threads; __seq++)
+ {
+ // for each sequence
+ if (__iam < (__sd->_M_num_threads - 1))
+ __sd->_M_pieces[__iam][__seq]._M_end
+ = __offsets[__seq] - __seqs[__seq].first;
+ else
+ // very end of this sequence
+ __sd->_M_pieces[__iam][__seq]._M_end =
+ __sd->_M_starts[__seq + 1] - __sd->_M_starts[__seq];
+ }
+
+# pragma omp barrier
+
+ for (_ThreadIndex __seq = 0; __seq < __sd->_M_num_threads; __seq++)
+ {
+ // For each sequence.
+ if (__iam > 0)
+ __sd->_M_pieces[__iam][__seq]._M_begin =
+ __sd->_M_pieces[__iam - 1][__seq]._M_end;
+ else
+ // Absolute beginning.
+ __sd->_M_pieces[__iam][__seq]._M_begin = 0;
+ }
+ }
+ };
+
+ /** @brief Split by sampling. */
+ template<typename _RAIter, typename _Compare,
+ typename _SortingPlacesIterator>
+ struct _SplitConsistently<false, _RAIter, _Compare, _SortingPlacesIterator>
+ {
+ void
+ operator()(const _ThreadIndex __iam,
+ _PMWMSSortingData<_RAIter>* __sd,
+ _Compare& __comp,
+ const typename
+ std::iterator_traits<_RAIter>::difference_type
+ __num_samples) const
+ {
+ typedef std::iterator_traits<_RAIter> _TraitsType;
+ typedef typename _TraitsType::value_type _ValueType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
+
+ __determine_samples(__sd, __num_samples);
+
+# pragma omp barrier
+
+# pragma omp single
+ __gnu_sequential::sort(__sd->_M_samples,
+ __sd->_M_samples
+ + (__num_samples * __sd->_M_num_threads),
+ __comp);
+
+# pragma omp barrier
+
+ for (_ThreadIndex __s = 0; __s < __sd->_M_num_threads; ++__s)
+ {
+ // For each sequence.
+ if (__num_samples * __iam > 0)
+ __sd->_M_pieces[__iam][__s]._M_begin =
std::lower_bound(__sd->_M_temporary[__s],
- __sd->_M_temporary[__s]
- + (__sd->_M_starts[__s + 1] - __sd->_M_starts[__s]),
- __sd->_M_samples[__num_samples * __iam],
- __comp)
+ __sd->_M_temporary[__s]
+ + (__sd->_M_starts[__s + 1]
+ - __sd->_M_starts[__s]),
+ __sd->_M_samples[__num_samples * __iam],
+ __comp)
- __sd->_M_temporary[__s];
- else
- // Absolute beginning.
- __sd->_M_pieces[__iam][__s]._M_begin = 0;
+ else
+ // Absolute beginning.
+ __sd->_M_pieces[__iam][__s]._M_begin = 0;
- if ((__num_samples * (__iam + 1)) <
- (__num_samples * __sd->_M_num_threads))
- __sd->_M_pieces[__iam][__s]._M_end =
+ if ((__num_samples * (__iam + 1)) <
+ (__num_samples * __sd->_M_num_threads))
+ __sd->_M_pieces[__iam][__s]._M_end =
std::lower_bound(__sd->_M_temporary[__s],
- __sd->_M_temporary[__s]
- + (__sd->_M_starts[__s + 1] - __sd->_M_starts[__s]),
- __sd->_M_samples[__num_samples * (__iam + 1)],
- __comp)
+ __sd->_M_temporary[__s]
+ + (__sd->_M_starts[__s + 1]
+ - __sd->_M_starts[__s]),
+ __sd->_M_samples[__num_samples * (__iam + 1)],
+ __comp)
- __sd->_M_temporary[__s];
- else
- // Absolute end.
- __sd->_M_pieces[__iam][__s]._M_end = __sd->_M_starts[__s + 1]
- - __sd->_M_starts[__s];
- }
- }
+ else
+ // Absolute end.
+ __sd->_M_pieces[__iam][__s]._M_end = (__sd->_M_starts[__s + 1]
+ - __sd->_M_starts[__s]);
+ }
+ }
};
-template<bool __stable, typename _RAIter, typename _Compare>
- struct __possibly_stable_sort
- {
- };
+ template<bool __stable, typename _RAIter, typename _Compare>
+ struct __possibly_stable_sort
+ { };
-template<typename _RAIter, typename _Compare>
- struct __possibly_stable_sort<true, _RAIter, _Compare>
- {
- void operator()(const _RAIter& __begin,
- const _RAIter& __end, _Compare& __comp) const
+ template<typename _RAIter, typename _Compare>
+ struct __possibly_stable_sort<true, _RAIter, _Compare>
{
- __gnu_sequential::stable_sort(__begin, __end, __comp);
- }
- };
+ void operator()(const _RAIter& __begin,
+ const _RAIter& __end, _Compare& __comp) const
+ { __gnu_sequential::stable_sort(__begin, __end, __comp); }
+ };
-template<typename _RAIter, typename _Compare>
- struct __possibly_stable_sort<false, _RAIter, _Compare>
- {
- void operator()(const _RAIter __begin,
- const _RAIter __end, _Compare& __comp) const
+ template<typename _RAIter, typename _Compare>
+ struct __possibly_stable_sort<false, _RAIter, _Compare>
{
- __gnu_sequential::sort(__begin, __end, __comp);
- }
- };
-
-template<bool __stable, typename Seq_RAIter,
- typename _RAIter, typename _Compare,
- typename DiffType>
- struct __possibly_stable_multiway_merge
- {
- };
-
-template<typename Seq_RAIter, typename _RAIter,
- typename _Compare, typename DiffType>
- struct __possibly_stable_multiway_merge
- <true, Seq_RAIter, _RAIter, _Compare,
- DiffType>
- {
- void operator()(const Seq_RAIter& __seqs_begin,
- const Seq_RAIter& __seqs_end,
- const _RAIter& __target,
- _Compare& __comp,
- DiffType __length_am) const
+ void operator()(const _RAIter __begin,
+ const _RAIter __end, _Compare& __comp) const
+ { __gnu_sequential::sort(__begin, __end, __comp); }
+ };
+
+ template<bool __stable, typename Seq_RAIter,
+ typename _RAIter, typename _Compare,
+ typename DiffType>
+ struct __possibly_stable_multiway_merge
+ { };
+
+ template<typename Seq_RAIter, typename _RAIter,
+ typename _Compare, typename _DiffType>
+ struct __possibly_stable_multiway_merge<true, Seq_RAIter,
+ _RAIter, _Compare, _DiffType>
{
- stable_multiway_merge(__seqs_begin, __seqs_end, __target, __length_am,
- __comp, sequential_tag());
- }
- };
-
-template<typename Seq_RAIter, typename _RAIter,
- typename _Compare, typename DiffType>
- struct __possibly_stable_multiway_merge
- <false, Seq_RAIter, _RAIter, _Compare,
- DiffType>
- {
- void operator()(const Seq_RAIter& __seqs_begin,
+ void operator()(const Seq_RAIter& __seqs_begin,
+ const Seq_RAIter& __seqs_end,
+ const _RAIter& __target,
+ _Compare& __comp,
+ _DiffType __length_am) const
+ { stable_multiway_merge(__seqs_begin, __seqs_end, __target,
+ __length_am, __comp, sequential_tag()); }
+ };
+
+ template<typename Seq_RAIter, typename _RAIter,
+ typename _Compare, typename _DiffType>
+ struct __possibly_stable_multiway_merge<false, Seq_RAIter,
+ _RAIter, _Compare, _DiffType>
+ {
+ void operator()(const Seq_RAIter& __seqs_begin,
const Seq_RAIter& __seqs_end,
const _RAIter& __target,
_Compare& __comp,
- DiffType __length_am) const
+ _DiffType __length_am) const
+ { multiway_merge(__seqs_begin, __seqs_end, __target, __length_am,
+ __comp, sequential_tag()); }
+ };
+
+ /** @brief PMWMS code executed by each thread.
+ * @param __sd Pointer to algorithm data.
+ * @param __comp Comparator.
+ */
+ template<bool __stable, bool __exact, typename _RAIter,
+ typename _Compare>
+ void
+ parallel_sort_mwms_pu(_PMWMSSortingData<_RAIter>* __sd,
+ _Compare& __comp)
{
- multiway_merge(__seqs_begin, __seqs_end, __target, __length_am, __comp,
- sequential_tag());
- }
- };
+ typedef std::iterator_traits<_RAIter> _TraitsType;
+ typedef typename _TraitsType::value_type _ValueType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
+
+ _ThreadIndex __iam = omp_get_thread_num();
+
+ // Length of this thread's chunk, before merging.
+ _DifferenceType __length_local =
+ __sd->_M_starts[__iam + 1] - __sd->_M_starts[__iam];
-/** @brief PMWMS code executed by each thread.
- * @param __sd Pointer to algorithm data.
- * @param __comp Comparator.
- */
-template<bool __stable, bool __exact, typename _RAIter,
- typename _Compare>
- void
- parallel_sort_mwms_pu(_PMWMSSortingData<_RAIter>* __sd,
- _Compare& __comp)
- {
- typedef std::iterator_traits<_RAIter> _TraitsType;
- typedef typename _TraitsType::value_type _ValueType;
- typedef typename _TraitsType::difference_type _DifferenceType;
-
- _ThreadIndex __iam = omp_get_thread_num();
-
- // Length of this thread's chunk, before merging.
- _DifferenceType __length_local
- = __sd->_M_starts[__iam + 1] - __sd->_M_starts[__iam];
-
- // Sort in temporary storage, leave space for sentinel.
-
- typedef _ValueType* _SortingPlacesIterator;
-
- __sd->_M_temporary[__iam] =
- static_cast<_ValueType*>(
- ::operator new(sizeof(_ValueType) * (__length_local + 1)));
-
- // Copy there.
- std::uninitialized_copy(
- __sd->_M_source + __sd->_M_starts[__iam],
- __sd->_M_source + __sd->_M_starts[__iam] + __length_local,
- __sd->_M_temporary[__iam]);
-
- __possibly_stable_sort<__stable, _SortingPlacesIterator, _Compare>()
+ // Sort in temporary storage, leave space for sentinel.
+
+ typedef _ValueType* _SortingPlacesIterator;
+
+ __sd->_M_temporary[__iam] =
+ static_cast<_ValueType*>(::operator new(sizeof(_ValueType)
+ * (__length_local + 1)));
+
+ // Copy there.
+ std::uninitialized_copy(__sd->_M_source + __sd->_M_starts[__iam],
+ __sd->_M_source + __sd->_M_starts[__iam]
+ + __length_local,
+ __sd->_M_temporary[__iam]);
+
+ __possibly_stable_sort<__stable, _SortingPlacesIterator, _Compare>()
(__sd->_M_temporary[__iam],
- __sd->_M_temporary[__iam] + __length_local,
+ __sd->_M_temporary[__iam] + __length_local,
__comp);
- // Invariant: locally sorted subsequence in sd->_M_temporary[__iam],
- // __sd->_M_temporary[__iam] + __length_local.
+ // Invariant: locally sorted subsequence in sd->_M_temporary[__iam],
+ // __sd->_M_temporary[__iam] + __length_local.
- // No barrier here: Synchronization is done by the splitting routine.
+ // No barrier here: Synchronization is done by the splitting routine.
- _DifferenceType __num_samples =
+ _DifferenceType __num_samples =
_Settings::get().sort_mwms_oversampling * __sd->_M_num_threads - 1;
- _SplitConsistently
- <__exact, _RAIter, _Compare, _SortingPlacesIterator>()
+ _SplitConsistently<__exact, _RAIter, _Compare, _SortingPlacesIterator>()
(__iam, __sd, __comp, __num_samples);
- // Offset from __target __begin, __length after merging.
- _DifferenceType __offset = 0, __length_am = 0;
- for (_ThreadIndex __s = 0; __s < __sd->_M_num_threads; __s++)
- {
- __length_am += __sd->_M_pieces[__iam][__s]._M_end
- - __sd->_M_pieces[__iam][__s]._M_begin;
- __offset += __sd->_M_pieces[__iam][__s]._M_begin;
- }
-
- typedef std::vector<
- std::pair<_SortingPlacesIterator, _SortingPlacesIterator> >
+ // Offset from __target __begin, __length after merging.
+ _DifferenceType __offset = 0, __length_am = 0;
+ for (_ThreadIndex __s = 0; __s < __sd->_M_num_threads; __s++)
+ {
+ __length_am += (__sd->_M_pieces[__iam][__s]._M_end
+ - __sd->_M_pieces[__iam][__s]._M_begin);
+ __offset += __sd->_M_pieces[__iam][__s]._M_begin;
+ }
+
+ typedef std::vector<
+ std::pair<_SortingPlacesIterator, _SortingPlacesIterator> >
_SeqVector;
- _SeqVector seqs(__sd->_M_num_threads);
+ _SeqVector __seqs(__sd->_M_num_threads);
+
+ for (int __s = 0; __s < __sd->_M_num_threads; ++__s)
+ {
+ __seqs[__s] =
+ std::make_pair(__sd->_M_temporary[__s]
+ + __sd->_M_pieces[__iam][__s]._M_begin,
+ __sd->_M_temporary[__s]
+ + __sd->_M_pieces[__iam][__s]._M_end);
+ }
+
+ __possibly_stable_multiway_merge<
+ __stable, typename _SeqVector::iterator,
+ _RAIter, _Compare, _DifferenceType>()(__seqs.begin(), __seqs.end(),
+ __sd->_M_source + __offset, __comp,
+ __length_am);
- for (int __s = 0; __s < __sd->_M_num_threads; ++__s)
- {
- seqs[__s] =
- std::make_pair(
- __sd->_M_temporary[__s] + __sd->_M_pieces[__iam][__s]._M_begin,
- __sd->_M_temporary[__s] + __sd->_M_pieces[__iam][__s]._M_end);
- }
+# pragma omp barrier
+
+ ::operator delete(__sd->_M_temporary[__iam]);
+ }
- __possibly_stable_multiway_merge<
- __stable,
- typename _SeqVector::iterator,
- _RAIter,
- _Compare, _DifferenceType>()
- (seqs.begin(), seqs.end(),
- __sd->_M_source + __offset, __comp,
- __length_am);
-
-# pragma omp barrier
-
- ::operator delete(__sd->_M_temporary[__iam]);
- }
-
-/** @brief PMWMS main call.
- * @param __begin Begin iterator of sequence.
- * @param __end End iterator of sequence.
- * @param __comp Comparator.
- * @param __n Length of sequence.
- * @param __num_threads Number of threads to use.
- */
-template<bool __stable, bool __exact, typename _RAIter,
+ /** @brief PMWMS main call.
+ * @param __begin Begin iterator of sequence.
+ * @param __end End iterator of sequence.
+ * @param __comp Comparator.
+ * @param __n Length of sequence.
+ * @param __num_threads Number of threads to use.
+ */
+ template<bool __stable, bool __exact, typename _RAIter,
typename _Compare>
- void
- parallel_sort_mwms(_RAIter __begin, _RAIter __end,
- _Compare __comp,
- _ThreadIndex __num_threads)
- {
- _GLIBCXX_CALL(__end - __begin)
+ void
+ parallel_sort_mwms(_RAIter __begin, _RAIter __end,
+ _Compare __comp,
+ _ThreadIndex __num_threads)
+ {
+ _GLIBCXX_CALL(__end - __begin)
- typedef std::iterator_traits<_RAIter> _TraitsType;
- typedef typename _TraitsType::value_type _ValueType;
- typedef typename _TraitsType::difference_type _DifferenceType;
+ typedef std::iterator_traits<_RAIter> _TraitsType;
+ typedef typename _TraitsType::value_type _ValueType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
- _DifferenceType __n = __end - __begin;
+ _DifferenceType __n = __end - __begin;
- if (__n <= 1)
- return;
+ if (__n <= 1)
+ return;
- // at least one element per thread
- if (__num_threads > __n)
- __num_threads = static_cast<_ThreadIndex>(__n);
+ // at least one element per thread
+ if (__num_threads > __n)
+ __num_threads = static_cast<_ThreadIndex>(__n);
- // shared variables
- _PMWMSSortingData<_RAIter> __sd;
- _DifferenceType* _M_starts;
+ // shared variables
+ _PMWMSSortingData<_RAIter> __sd;
+ _DifferenceType* __starts;
-# pragma omp parallel num_threads(__num_threads)
+# pragma omp parallel num_threads(__num_threads)
{
__num_threads = omp_get_num_threads(); //no more threads than requested
# pragma omp single
- {
- __sd._M_num_threads = __num_threads;
- __sd._M_source = __begin;
-
- __sd._M_temporary = new _ValueType*[__num_threads];
-
- if (!__exact)
- {
- _DifferenceType __size =
- (_Settings::get().sort_mwms_oversampling * __num_threads - 1)
- * __num_threads;
- __sd._M_samples = static_cast<_ValueType*>(
- ::operator new(__size * sizeof(_ValueType)));
- }
- else
- __sd._M_samples = NULL;
-
- __sd._M_offsets = new _DifferenceType[__num_threads - 1];
- __sd._M_pieces
- = new std::vector<_Piece<_DifferenceType> >[__num_threads];
- for (int __s = 0; __s < __num_threads; ++__s)
- __sd._M_pieces[__s].resize(__num_threads);
- _M_starts = __sd._M_starts
- = new _DifferenceType[__num_threads + 1];
-
- _DifferenceType __chunk_length = __n / __num_threads;
- _DifferenceType __split = __n % __num_threads;
- _DifferenceType __pos = 0;
- for (int __i = 0; __i < __num_threads; ++__i)
- {
- _M_starts[__i] = __pos;
- __pos += (__i < __split)
- ? (__chunk_length + 1) : __chunk_length;
- }
- _M_starts[__num_threads] = __pos;
- } //single
+ {
+ __sd._M_num_threads = __num_threads;
+ __sd._M_source = __begin;
+
+ __sd._M_temporary = new _ValueType*[__num_threads];
+
+ if (!__exact)
+ {
+ _DifferenceType __size =
+ (_Settings::get().sort_mwms_oversampling * __num_threads - 1)
+ * __num_threads;
+ __sd._M_samples = static_cast<_ValueType*>
+ (::operator new(__size * sizeof(_ValueType)));
+ }
+ else
+ __sd._M_samples = NULL;
+
+ __sd._M_offsets = new _DifferenceType[__num_threads - 1];
+ __sd._M_pieces
+ = new std::vector<_Piece<_DifferenceType> >[__num_threads];
+ for (int __s = 0; __s < __num_threads; ++__s)
+ __sd._M_pieces[__s].resize(__num_threads);
+ __starts = __sd._M_starts = new _DifferenceType[__num_threads + 1];
+
+ _DifferenceType __chunk_length = __n / __num_threads;
+ _DifferenceType __split = __n % __num_threads;
+ _DifferenceType __pos = 0;
+ for (int __i = 0; __i < __num_threads; ++__i)
+ {
+ __starts[__i] = __pos;
+ __pos += ((__i < __split)
+ ? (__chunk_length + 1) : __chunk_length);
+ }
+ __starts[__num_threads] = __pos;
+ } //single
// Now sort in parallel.
parallel_sort_mwms_pu<__stable, __exact>(&__sd, __comp);
} //parallel
- delete[] _M_starts;
- delete[] __sd._M_temporary;
+ delete[] __starts;
+ delete[] __sd._M_temporary;
- if (!__exact)
- ::operator delete(__sd._M_samples);
+ if (!__exact)
+ ::operator delete(__sd._M_samples);
+
+ delete[] __sd._M_offsets;
+ delete[] __sd._M_pieces;
+ }
- delete[] __sd._M_offsets;
- delete[] __sd._M_pieces;
- }
} //namespace __gnu_parallel
#endif /* _GLIBCXX_PARALLEL_MULTIWAY_MERGESORT_H */
diff --git a/libstdc++-v3/include/parallel/numeric b/libstdc++-v3/include/parallel/numeric
index 06985ba99c9..6c5607cedc5 100644
--- a/libstdc++-v3/include/parallel/numeric
+++ b/libstdc++-v3/include/parallel/numeric
@@ -69,7 +69,7 @@ namespace __parallel
__accumulate_switch(_IIter __begin, _IIter __end,
_Tp __init, _IteratorTag)
{ return accumulate(__begin, __end, __init,
-__gnu_parallel::sequential_tag()); }
+ __gnu_parallel::sequential_tag()); }
template<typename _IIter, typename _Tp, typename _BinaryOperation,
typename _IteratorTag>
@@ -435,7 +435,7 @@ __gnu_parallel::sequential_tag()); }
__for_each_template_random_access_ed(
__begin_pair, __end_pair, __bin_op, __functionality,
__gnu_parallel::_DummyReduct(), __dummy, __dummy, -1);
- return __functionality.finish_iterator;
+ return __functionality._M_finish_iterator;
}
else
return adjacent_difference(__begin, __end, __result, __bin_op,
diff --git a/libstdc++-v3/include/parallel/omp_loop.h b/libstdc++-v3/include/parallel/omp_loop.h
index 2424bfbdde8..d07fd7a9307 100644
--- a/libstdc++-v3/include/parallel/omp_loop.h
+++ b/libstdc++-v3/include/parallel/omp_loop.h
@@ -41,74 +41,74 @@
namespace __gnu_parallel
{
-/** @brief Embarrassingly parallel algorithm for random access
- * iterators, using an OpenMP for loop.
- *
- * @param __begin Begin iterator of element sequence.
- * @param __end End iterator of element sequence.
- * @param __o User-supplied functor (comparator, predicate, adding
- * functor, etc.).
- * @param __f Functor to "process" an element with __op (depends on
- * desired functionality, e. g. for std::for_each(), ...).
- * @param __r Functor to "add" a single __result to the already
- * processed elements (depends on functionality).
- * @param __base Base value for reduction.
- * @param __output Pointer to position where final result is written to
- * @param __bound Maximum number of elements processed (e. g. for
- * std::count_n()).
- * @return User-supplied functor (that may contain a part of the result).
- */
-template<typename _RAIter,
- typename _Op,
- typename _Fu,
- typename _Red,
- typename _Result>
- _Op
- __for_each_template_random_access_omp_loop(
- _RAIter __begin, _RAIter __end, _Op __o, _Fu& __f, _Red __r,
- _Result __base, _Result& __output,
- typename std::iterator_traits<_RAIter>::difference_type __bound)
- {
- typedef typename
- std::iterator_traits<_RAIter>::difference_type
+ /** @brief Embarrassingly parallel algorithm for random access
+ * iterators, using an OpenMP for loop.
+ *
+ * @param __begin Begin iterator of element sequence.
+ * @param __end End iterator of element sequence.
+ * @param __o User-supplied functor (comparator, predicate, adding
+ * functor, etc.).
+ * @param __f Functor to "process" an element with __op (depends on
+ * desired functionality, e. g. for std::for_each(), ...).
+ * @param __r Functor to "add" a single __result to the already
+ * processed elements (depends on functionality).
+ * @param __base Base value for reduction.
+ * @param __output Pointer to position where final result is written to
+ * @param __bound Maximum number of elements processed (e. g. for
+ * std::count_n()).
+ * @return User-supplied functor (that may contain a part of the result).
+ */
+ template<typename _RAIter,
+ typename _Op,
+ typename _Fu,
+ typename _Red,
+ typename _Result>
+ _Op
+ __for_each_template_random_access_omp_loop(_RAIter __begin, _RAIter __end,
+ _Op __o, _Fu& __f, _Red __r,
+ _Result __base,
+ _Result& __output,
+ typename std::iterator_traits<_RAIter>::difference_type __bound)
+ {
+ typedef typename std::iterator_traits<_RAIter>::difference_type
_DifferenceType;
- _DifferenceType __length = __end - __begin;
- _ThreadIndex __num_threads =
- __gnu_parallel::min<_DifferenceType>(__get_max_threads(), __length);
+ _DifferenceType __length = __end - __begin;
+ _ThreadIndex __num_threads = __gnu_parallel::min<_DifferenceType>
+ (__get_max_threads(), __length);
- _Result *__thread_results;
+ _Result *__thread_results;
-# pragma omp parallel num_threads(__num_threads)
+# pragma omp parallel num_threads(__num_threads)
{
# pragma omp single
- {
- __num_threads = omp_get_num_threads();
- __thread_results = new _Result[__num_threads];
+ {
+ __num_threads = omp_get_num_threads();
+ __thread_results = new _Result[__num_threads];
- for (_ThreadIndex __i = 0; __i < __num_threads; ++__i)
- __thread_results[__i] = _Result();
- }
+ for (_ThreadIndex __i = 0; __i < __num_threads; ++__i)
+ __thread_results[__i] = _Result();
+ }
_ThreadIndex __iam = omp_get_thread_num();
#pragma omp for schedule(dynamic, _Settings::get().workstealing_chunk_size)
for (_DifferenceType __pos = 0; __pos < __length; ++__pos)
- __thread_results[__iam] =
- __r(__thread_results[__iam], __f(__o, __begin+__pos));
+ __thread_results[__iam] = __r(__thread_results[__iam],
+ __f(__o, __begin+__pos));
} //parallel
- for (_ThreadIndex __i = 0; __i < __num_threads; ++__i)
+ for (_ThreadIndex __i = 0; __i < __num_threads; ++__i)
__output = __r(__output, __thread_results[__i]);
- delete [] __thread_results;
+ delete [] __thread_results;
- // Points to last element processed (needed as return value for
- // some algorithms like transform).
- __f._M_finish_iterator = __begin + __length;
+ // Points to last element processed (needed as return value for
+ // some algorithms like transform).
+ __f._M_finish_iterator = __begin + __length;
- return __o;
- }
+ return __o;
+ }
} // end namespace
diff --git a/libstdc++-v3/include/parallel/omp_loop_static.h b/libstdc++-v3/include/parallel/omp_loop_static.h
index 3d9ed841ac6..f43726e1973 100644
--- a/libstdc++-v3/include/parallel/omp_loop_static.h
+++ b/libstdc++-v3/include/parallel/omp_loop_static.h
@@ -40,7 +40,6 @@
namespace __gnu_parallel
{
-
/** @brief Embarrassingly parallel algorithm for random access
* iterators, using an OpenMP for loop with static scheduling.
*
@@ -58,37 +57,38 @@ namespace __gnu_parallel
* std::count_n()).
* @return User-supplied functor (that may contain a part of the result).
*/
-template<typename _RAIter,
- typename _Op,
- typename _Fu,
- typename _Red,
- typename _Result>
- _Op
- __for_each_template_random_access_omp_loop_static(
- _RAIter __begin, _RAIter __end, _Op __o, _Fu& __f, _Red __r,
- _Result __base, _Result& __output,
- typename std::iterator_traits<_RAIter>::difference_type __bound)
- {
- typedef typename
- std::iterator_traits<_RAIter>::difference_type
- _DifferenceType;
-
- _DifferenceType __length = __end - __begin;
- _ThreadIndex __num_threads =
- std::min<_DifferenceType>(__get_max_threads(), __length);
-
- _Result *__thread_results;
-
-# pragma omp parallel num_threads(__num_threads)
+ template<typename _RAIter,
+ typename _Op,
+ typename _Fu,
+ typename _Red,
+ typename _Result>
+ _Op
+ __for_each_template_random_access_omp_loop_static(_RAIter __begin,
+ _RAIter __end, _Op __o,
+ _Fu& __f, _Red __r,
+ _Result __base,
+ _Result& __output,
+ typename std::iterator_traits<_RAIter>::difference_type __bound)
+ {
+ typedef typename std::iterator_traits<_RAIter>::difference_type
+ _DifferenceType;
+
+ _DifferenceType __length = __end - __begin;
+ _ThreadIndex __num_threads = std::min<_DifferenceType>
+ (__get_max_threads(), __length);
+
+ _Result *__thread_results;
+
+# pragma omp parallel num_threads(__num_threads)
{
# pragma omp single
- {
- __num_threads = omp_get_num_threads();
- __thread_results = new _Result[__num_threads];
+ {
+ __num_threads = omp_get_num_threads();
+ __thread_results = new _Result[__num_threads];
- for (_ThreadIndex __i = 0; __i < __num_threads; ++__i)
- __thread_results[__i] = _Result();
- }
+ for (_ThreadIndex __i = 0; __i < __num_threads; ++__i)
+ __thread_results[__i] = _Result();
+ }
_ThreadIndex __iam = omp_get_thread_num();
@@ -98,17 +98,17 @@ template<typename _RAIter,
__f(__o, __begin+__pos));
} //parallel
- for (_ThreadIndex __i = 0; __i < __num_threads; ++__i)
- __output = __r(__output, __thread_results[__i]);
+ for (_ThreadIndex __i = 0; __i < __num_threads; ++__i)
+ __output = __r(__output, __thread_results[__i]);
- delete [] __thread_results;
+ delete [] __thread_results;
- // Points to last element processed (needed as return value for
- // some algorithms like transform).
- __f.finish_iterator = __begin + __length;
+ // Points to last element processed (needed as return value for
+ // some algorithms like transform).
+ __f.finish_iterator = __begin + __length;
- return __o;
- }
+ return __o;
+ }
} // end namespace
diff --git a/libstdc++-v3/include/parallel/par_loop.h b/libstdc++-v3/include/parallel/par_loop.h
index c842364a6fd..1e21d3ad042 100644
--- a/libstdc++-v3/include/parallel/par_loop.h
+++ b/libstdc++-v3/include/parallel/par_loop.h
@@ -40,94 +40,92 @@
namespace __gnu_parallel
{
-
-/** @brief Embarrassingly parallel algorithm for random access
- * iterators, using hand-crafted parallelization by equal splitting
- * the work.
- *
- * @param __begin Begin iterator of element sequence.
- * @param __end End iterator of element sequence.
- * @param __o User-supplied functor (comparator, predicate, adding
- * functor, ...)
- * @param __f Functor to "process" an element with __op (depends on
- * desired functionality, e. g. for std::for_each(), ...).
- * @param __r Functor to "add" a single __result to the already
- * processed elements (depends on functionality).
- * @param __base Base value for reduction.
- * @param __output Pointer to position where final result is written to
- * @param __bound Maximum number of elements processed (e. g. for
- * std::count_n()).
- * @return User-supplied functor (that may contain a part of the result).
- */
-template<typename _RAIter,
- typename _Op,
- typename _Fu,
- typename _Red,
- typename _Result>
- _Op
- __for_each_template_random_access_ed(
- _RAIter __begin, _RAIter __end, _Op __o, _Fu& __f, _Red __r,
- _Result __base, _Result& __output,
- typename std::iterator_traits<_RAIter>::difference_type __bound)
- {
- typedef std::iterator_traits<_RAIter> _TraitsType;
- typedef typename _TraitsType::difference_type _DifferenceType;
- const _DifferenceType __length = __end - __begin;
- _Result *__thread_results;
- bool* __constructed;
-
- _ThreadIndex __num_threads =
- __gnu_parallel::min<_DifferenceType>(__get_max_threads(), __length);
-
-# pragma omp parallel num_threads(__num_threads)
+ /** @brief Embarrassingly parallel algorithm for random access
+ * iterators, using hand-crafted parallelization by equal splitting
+ * the work.
+ *
+ * @param __begin Begin iterator of element sequence.
+ * @param __end End iterator of element sequence.
+ * @param __o User-supplied functor (comparator, predicate, adding
+ * functor, ...)
+ * @param __f Functor to "process" an element with __op (depends on
+ * desired functionality, e. g. for std::for_each(), ...).
+ * @param __r Functor to "add" a single __result to the already
+ * processed elements (depends on functionality).
+ * @param __base Base value for reduction.
+ * @param __output Pointer to position where final result is written to
+ * @param __bound Maximum number of elements processed (e. g. for
+ * std::count_n()).
+ * @return User-supplied functor (that may contain a part of the result).
+ */
+ template<typename _RAIter,
+ typename _Op,
+ typename _Fu,
+ typename _Red,
+ typename _Result>
+ _Op
+ __for_each_template_random_access_ed(_RAIter __begin, _RAIter __end,
+ _Op __o, _Fu& __f, _Red __r,
+ _Result __base, _Result& __output,
+ typename std::iterator_traits<_RAIter>::difference_type __bound)
+ {
+ typedef std::iterator_traits<_RAIter> _TraitsType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
+ const _DifferenceType __length = __end - __begin;
+ _Result *__thread_results;
+ bool* __constructed;
+
+ _ThreadIndex __num_threads = __gnu_parallel::min<_DifferenceType>
+ (__get_max_threads(), __length);
+
+# pragma omp parallel num_threads(__num_threads)
{
# pragma omp single
- {
- __num_threads = omp_get_num_threads();
- __thread_results =
- static_cast<_Result*>(
- ::operator new(__num_threads * sizeof(_Result)));
- __constructed = new bool[__num_threads];
- }
-
- _ThreadIndex __iam = omp_get_thread_num();
-
- // Neutral element.
- _Result* __reduct =
- static_cast<_Result*>(::operator new(sizeof(_Result)));
-
- _DifferenceType
- __start = equally_split_point(__length, __num_threads, __iam),
- __stop = equally_split_point(__length, __num_threads, __iam + 1);
-
- if (__start < __stop)
- {
- new(__reduct) _Result(__f(__o, __begin + __start));
- ++__start;
- __constructed[__iam] = true;
- }
- else
- __constructed[__iam] = false;
-
- for (; __start < __stop; ++__start)
- *__reduct = __r(*__reduct, __f(__o, __begin + __start));
-
- __thread_results[__iam] = *__reduct;
+ {
+ __num_threads = omp_get_num_threads();
+ __thread_results = static_cast<_Result*>
+ (::operator new(__num_threads * sizeof(_Result)));
+ __constructed = new bool[__num_threads];
+ }
+
+ _ThreadIndex __iam = omp_get_thread_num();
+
+ // Neutral element.
+ _Result* __reduct = static_cast<_Result*>
+ (::operator new(sizeof(_Result)));
+
+ _DifferenceType
+ __start = equally_split_point(__length, __num_threads, __iam),
+ __stop = equally_split_point(__length, __num_threads, __iam + 1);
+
+ if (__start < __stop)
+ {
+ new(__reduct) _Result(__f(__o, __begin + __start));
+ ++__start;
+ __constructed[__iam] = true;
+ }
+ else
+ __constructed[__iam] = false;
+
+ for (; __start < __stop; ++__start)
+ *__reduct = __r(*__reduct, __f(__o, __begin + __start));
+
+ __thread_results[__iam] = *__reduct;
} //parallel
- for (_ThreadIndex __i = 0; __i < __num_threads; ++__i)
- if (__constructed[__i])
- __output = __r(__output, __thread_results[__i]);
+ for (_ThreadIndex __i = 0; __i < __num_threads; ++__i)
+ if (__constructed[__i])
+ __output = __r(__output, __thread_results[__i]);
- // Points to last element processed (needed as return value for
- // some algorithms like transform).
- __f._M_finish_iterator = __begin + __length;
+ // Points to last element processed (needed as return value for
+ // some algorithms like transform).
+ __f._M_finish_iterator = __begin + __length;
- delete[] __thread_results;
- delete[] __constructed;
+ delete[] __thread_results;
+ delete[] __constructed;
- return __o;
- }
+ return __o;
+ }
} // end namespace
diff --git a/libstdc++-v3/include/parallel/partial_sum.h b/libstdc++-v3/include/parallel/partial_sum.h
index b121e1ff8c7..02404203f4e 100644
--- a/libstdc++-v3/include/parallel/partial_sum.h
+++ b/libstdc++-v3/include/parallel/partial_sum.h
@@ -43,114 +43,116 @@ namespace __gnu_parallel
{
// Problem: there is no 0-element given.
-/** @brief Base case prefix sum routine.
- * @param __begin Begin iterator of input sequence.
- * @param __end End iterator of input sequence.
- * @param __result Begin iterator of output sequence.
- * @param __bin_op Associative binary function.
- * @param __value Start value. Must be passed since the neutral
- * element is unknown in general.
- * @return End iterator of output sequence. */
-template<typename _IIter,
- typename _OutputIterator,
- typename _BinaryOperation>
- _OutputIterator
- __parallel_partial_sum_basecase(
- _IIter __begin, _IIter __end, _OutputIterator __result,
- _BinaryOperation __bin_op,
- typename std::iterator_traits <_IIter>::value_type __value)
- {
- if (__begin == __end)
+ /** @brief Base case prefix sum routine.
+ * @param __begin Begin iterator of input sequence.
+ * @param __end End iterator of input sequence.
+ * @param __result Begin iterator of output sequence.
+ * @param __bin_op Associative binary function.
+ * @param __value Start value. Must be passed since the neutral
+ * element is unknown in general.
+ * @return End iterator of output sequence. */
+ template<typename _IIter,
+ typename _OutputIterator,
+ typename _BinaryOperation>
+ _OutputIterator
+ __parallel_partial_sum_basecase(_IIter __begin, _IIter __end,
+ _OutputIterator __result,
+ _BinaryOperation __bin_op,
+ typename std::iterator_traits <_IIter>::value_type __value)
+ {
+ if (__begin == __end)
+ return __result;
+
+ while (__begin != __end)
+ {
+ __value = __bin_op(__value, *__begin);
+ *__result = __value;
+ ++__result;
+ ++__begin;
+ }
return __result;
-
- while (__begin != __end)
- {
- __value = __bin_op(__value, *__begin);
- *__result = __value;
- ++__result;
- ++__begin;
- }
- return __result;
- }
-
-/** @brief Parallel partial sum implementation, two-phase approach,
- no recursion.
- * @param __begin Begin iterator of input sequence.
- * @param __end End iterator of input sequence.
- * @param __result Begin iterator of output sequence.
- * @param __bin_op Associative binary function.
- * @param __n Length of sequence.
- * @param __num_threads Number of threads to use.
- * @return End iterator of output sequence.
- */
-template<typename _IIter,
- typename _OutputIterator,
- typename _BinaryOperation>
- _OutputIterator
- __parallel_partial_sum_linear(
- _IIter __begin, _IIter __end, _OutputIterator __result,
- _BinaryOperation __bin_op,
- typename std::iterator_traits<_IIter>::difference_type __n)
- {
- typedef std::iterator_traits<_IIter> _TraitsType;
- typedef typename _TraitsType::value_type _ValueType;
- typedef typename _TraitsType::difference_type _DifferenceType;
-
- if (__begin == __end)
- return __result;
-
- _ThreadIndex __num_threads =
+ }
+
+ /** @brief Parallel partial sum implementation, two-phase approach,
+ no recursion.
+ * @param __begin Begin iterator of input sequence.
+ * @param __end End iterator of input sequence.
+ * @param __result Begin iterator of output sequence.
+ * @param __bin_op Associative binary function.
+ * @param __n Length of sequence.
+ * @param __num_threads Number of threads to use.
+ * @return End iterator of output sequence.
+ */
+ template<typename _IIter,
+ typename _OutputIterator,
+ typename _BinaryOperation>
+ _OutputIterator
+ __parallel_partial_sum_linear(_IIter __begin, _IIter __end,
+ _OutputIterator __result,
+ _BinaryOperation __bin_op,
+ typename std::iterator_traits<_IIter>::difference_type __n)
+ {
+ typedef std::iterator_traits<_IIter> _TraitsType;
+ typedef typename _TraitsType::value_type _ValueType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
+
+ if (__begin == __end)
+ return __result;
+
+ _ThreadIndex __num_threads =
std::min<_DifferenceType>(__get_max_threads(), __n - 1);
- if (__num_threads < 2)
- {
- *__result = *__begin;
- return __parallel_partial_sum_basecase(
- __begin + 1, __end, __result + 1, __bin_op, *__begin);
- }
+ if (__num_threads < 2)
+ {
+ *__result = *__begin;
+ return __parallel_partial_sum_basecase(__begin + 1, __end,
+ __result + 1, __bin_op,
+ *__begin);
+ }
- _DifferenceType* __borders;
- _ValueType* __sums;
+ _DifferenceType* __borders;
+ _ValueType* __sums;
- const _Settings& __s = _Settings::get();
+ const _Settings& __s = _Settings::get();
-# pragma omp parallel num_threads(__num_threads)
+# pragma omp parallel num_threads(__num_threads)
{
# pragma omp single
- {
- __num_threads = omp_get_num_threads();
-
- __borders = new _DifferenceType[__num_threads + 2];
-
- if (__s.partial_sum_dilation == 1.0f)
- equally_split(__n, __num_threads + 1, __borders);
- else
- {
- _DifferenceType __chunk_length =
- ((double)__n
- / ((double)__num_threads + __s.partial_sum_dilation)),
- __borderstart = __n - __num_threads * __chunk_length;
- __borders[0] = 0;
- for (int __i = 1; __i < (__num_threads + 1); ++__i)
- {
- __borders[__i] = __borderstart;
- __borderstart += __chunk_length;
- }
- __borders[__num_threads + 1] = __n;
- }
-
- __sums = static_cast<_ValueType*>(::operator new(sizeof(_ValueType)
+ {
+ __num_threads = omp_get_num_threads();
+
+ __borders = new _DifferenceType[__num_threads + 2];
+
+ if (__s.partial_sum_dilation == 1.0f)
+ equally_split(__n, __num_threads + 1, __borders);
+ else
+ {
+ _DifferenceType __chunk_length =
+ ((double)__n
+ / ((double)__num_threads + __s.partial_sum_dilation)),
+ __borderstart = __n - __num_threads * __chunk_length;
+ __borders[0] = 0;
+ for (int __i = 1; __i < (__num_threads + 1); ++__i)
+ {
+ __borders[__i] = __borderstart;
+ __borderstart += __chunk_length;
+ }
+ __borders[__num_threads + 1] = __n;
+ }
+
+ __sums = static_cast<_ValueType*>(::operator new(sizeof(_ValueType)
* __num_threads));
- _OutputIterator __target_end;
- } //single
+ _OutputIterator __target_end;
+ } //single
_ThreadIndex __iam = omp_get_thread_num();
if (__iam == 0)
{
*__result = *__begin;
- __parallel_partial_sum_basecase(
- __begin + 1, __begin + __borders[1], __result + 1,
- __bin_op, *__begin);
+ __parallel_partial_sum_basecase(__begin + 1,
+ __begin + __borders[1],
+ __result + 1,
+ __bin_op, *__begin);
::new(&(__sums[__iam])) _ValueType(*(__result + __borders[1] - 1));
}
else
@@ -166,58 +168,57 @@ template<typename _IIter,
# pragma omp barrier
# pragma omp single
- __parallel_partial_sum_basecase(__sums + 1, __sums + __num_threads,
- __sums + 1, __bin_op, __sums[0]);
+ __parallel_partial_sum_basecase(__sums + 1, __sums + __num_threads,
+ __sums + 1, __bin_op, __sums[0]);
# pragma omp barrier
- // Still same team.
- __parallel_partial_sum_basecase(
- __begin + __borders[__iam + 1],
- __begin + __borders[__iam + 2],
- __result + __borders[__iam + 1],
- __bin_op, __sums[__iam]);
+ // Still same team.
+ __parallel_partial_sum_basecase(__begin + __borders[__iam + 1],
+ __begin + __borders[__iam + 2],
+ __result + __borders[__iam + 1],
+ __bin_op, __sums[__iam]);
} //parallel
- ::operator delete(__sums);
- delete[] __borders;
-
- return __result + __n;
- }
-
-/** @brief Parallel partial sum front-__end.
- * @param __begin Begin iterator of input sequence.
- * @param __end End iterator of input sequence.
- * @param __result Begin iterator of output sequence.
- * @param __bin_op Associative binary function.
- * @return End iterator of output sequence. */
-template<typename _IIter,
- typename _OutputIterator,
- typename _BinaryOperation>
- _OutputIterator
- __parallel_partial_sum(_IIter __begin, _IIter __end,
- _OutputIterator __result, _BinaryOperation __bin_op)
- {
- _GLIBCXX_CALL(__begin - __end)
-
- typedef std::iterator_traits<_IIter> _TraitsType;
- typedef typename _TraitsType::value_type _ValueType;
- typedef typename _TraitsType::difference_type _DifferenceType;
-
- _DifferenceType __n = __end - __begin;
-
- switch (_Settings::get().partial_sum_algorithm)
- {
- case LINEAR:
- // Need an initial offset.
- return __parallel_partial_sum_linear(
- __begin, __end, __result, __bin_op, __n);
- default:
- // Partial_sum algorithm not implemented.
- _GLIBCXX_PARALLEL_ASSERT(0);
- return __result + __n;
- }
- }
+ ::operator delete(__sums);
+ delete[] __borders;
+
+ return __result + __n;
+ }
+
+ /** @brief Parallel partial sum front-__end.
+ * @param __begin Begin iterator of input sequence.
+ * @param __end End iterator of input sequence.
+ * @param __result Begin iterator of output sequence.
+ * @param __bin_op Associative binary function.
+ * @return End iterator of output sequence. */
+ template<typename _IIter,
+ typename _OutputIterator,
+ typename _BinaryOperation>
+ _OutputIterator
+ __parallel_partial_sum(_IIter __begin, _IIter __end,
+ _OutputIterator __result, _BinaryOperation __bin_op)
+ {
+ _GLIBCXX_CALL(__begin - __end)
+
+ typedef std::iterator_traits<_IIter> _TraitsType;
+ typedef typename _TraitsType::value_type _ValueType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
+
+ _DifferenceType __n = __end - __begin;
+
+ switch (_Settings::get().partial_sum_algorithm)
+ {
+ case LINEAR:
+ // Need an initial offset.
+ return __parallel_partial_sum_linear(__begin, __end, __result,
+ __bin_op, __n);
+ default:
+ // Partial_sum algorithm not implemented.
+ _GLIBCXX_PARALLEL_ASSERT(0);
+ return __result + __n;
+ }
+ }
}
#endif /* _GLIBCXX_PARALLEL_PARTIAL_SUM_H */
diff --git a/libstdc++-v3/include/parallel/partition.h b/libstdc++-v3/include/parallel/partition.h
index 11362939fc8..86723c51270 100644
--- a/libstdc++-v3/include/parallel/partition.h
+++ b/libstdc++-v3/include/parallel/partition.h
@@ -44,387 +44,391 @@
namespace __gnu_parallel
{
-/** @brief Parallel implementation of std::partition.
- * @param __begin Begin iterator of input sequence to split.
- * @param __end End iterator of input sequence to split.
- * @param __pred Partition predicate, possibly including some kind of pivot.
- * @param __num_threads Maximum number of threads to use for this task.
- * @return Number of elements not fulfilling the predicate. */
-template<typename _RAIter, typename _Predicate>
- typename std::iterator_traits<_RAIter>::difference_type
- __parallel_partition(_RAIter __begin, _RAIter __end,
- _Predicate __pred, _ThreadIndex __num_threads)
- {
- typedef std::iterator_traits<_RAIter> _TraitsType;
- typedef typename _TraitsType::value_type _ValueType;
- typedef typename _TraitsType::difference_type _DifferenceType;
-
- _DifferenceType __n = __end - __begin;
-
- _GLIBCXX_CALL(__n)
-
- const _Settings& __s = _Settings::get();
-
- // Shared.
- _GLIBCXX_VOLATILE _DifferenceType __left = 0, __right = __n - 1;
- _GLIBCXX_VOLATILE _DifferenceType __leftover_left, __leftover_right;
- _GLIBCXX_VOLATILE _DifferenceType __leftnew, __rightnew;
-
- bool* __reserved_left = NULL, * __reserved_right = NULL;
-
- _DifferenceType __chunk_size;
-
- omp_lock_t __result_lock;
- omp_init_lock(&__result_lock);
-
- //at least two chunks per thread
- if(__right - __left + 1 >= 2 * __num_threads * __chunk_size)
-# pragma omp parallel num_threads(__num_threads)
- {
-# pragma omp single
- {
- __num_threads = omp_get_num_threads();
- __reserved_left = new bool[__num_threads];
- __reserved_right = new bool[__num_threads];
-
- if (__s.partition_chunk_share > 0.0)
- __chunk_size = std::max<_DifferenceType>(
- __s.partition_chunk_size,
- (double)__n * __s.partition_chunk_share /
- (double)__num_threads);
- else
- __chunk_size = __s.partition_chunk_size;
- }
-
- while (__right - __left + 1 >= 2 * __num_threads * __chunk_size)
- {
-# pragma omp single
- {
- _DifferenceType __num_chunks
- = (__right - __left + 1) / __chunk_size;
-
- for (int __r = 0; __r < __num_threads; ++__r)
- {
- __reserved_left[__r] = false;
- __reserved_right[__r] = false;
- }
- __leftover_left = 0;
- __leftover_right = 0;
- } //implicit barrier
-
- // Private.
- _DifferenceType __thread_left, __thread_left_border,
- __thread_right, __thread_right_border;
- __thread_left = __left + 1;
-
- // Just to satisfy the condition below.
- __thread_left_border = __thread_left - 1;
- __thread_right = __n - 1;
- __thread_right_border = __thread_right + 1;
-
- bool __iam_finished = false;
- while (!__iam_finished)
- {
- if (__thread_left > __thread_left_border)
- {
- omp_set_lock(&__result_lock);
- if (__left + (__chunk_size - 1) > __right)
- __iam_finished = true;
- else
- {
- __thread_left = __left;
- __thread_left_border = __left + (__chunk_size - 1);
- __left += __chunk_size;
- }
- omp_unset_lock(&__result_lock);
- }
-
- if (__thread_right < __thread_right_border)
- {
- omp_set_lock(&__result_lock);
- if (__left > __right - (__chunk_size - 1))
- __iam_finished = true;
- else
- {
- __thread_right = __right;
- __thread_right_border = __right - (__chunk_size - 1);
- __right -= __chunk_size;
- }
- omp_unset_lock(&__result_lock);
- }
-
- if (__iam_finished)
- break;
-
- // Swap as usual.
- while (__thread_left < __thread_right)
- {
- while (__pred(__begin[__thread_left])
- && __thread_left <= __thread_left_border)
- ++__thread_left;
- while (!__pred(__begin[__thread_right])
- && __thread_right >= __thread_right_border)
- --__thread_right;
-
- if (__thread_left > __thread_left_border
- || __thread_right < __thread_right_border)
- // Fetch new chunk(__s).
- break;
-
- std::swap(__begin[__thread_left], __begin[__thread_right]);
- ++__thread_left;
- --__thread_right;
- }
- }
-
- // Now swap the leftover chunks to the right places.
- if (__thread_left <= __thread_left_border)
-# pragma omp atomic
- ++__leftover_left;
- if (__thread_right >= __thread_right_border)
-# pragma omp atomic
- ++__leftover_right;
-
-# pragma omp barrier
-
-# pragma omp single
- {
- __leftnew = __left - __leftover_left * __chunk_size;
- __rightnew = __right + __leftover_right * __chunk_size;
- }
-
-# pragma omp barrier
-
- // <=> __thread_left_border + (__chunk_size - 1) >= __leftnew
- if (__thread_left <= __thread_left_border
- && __thread_left_border >= __leftnew)
- {
- // Chunk already in place, reserve spot.
- __reserved_left
- [(__left - (__thread_left_border + 1)) / __chunk_size]
- = true;
- }
-
- // <=> __thread_right_border - (__chunk_size - 1) <= __rightnew
- if (__thread_right >= __thread_right_border
- && __thread_right_border <= __rightnew)
- {
- // Chunk already in place, reserve spot.
- __reserved_right[((__thread_right_border - 1) - __right)
- / __chunk_size] = true;
- }
-
-# pragma omp barrier
-
- if (__thread_left <= __thread_left_border
- && __thread_left_border < __leftnew)
- {
- // Find spot and swap.
- _DifferenceType __swapstart = -1;
- omp_set_lock(&__result_lock);
- for (int __r = 0; __r < __leftover_left; ++__r)
- if (!__reserved_left[__r])
- {
- __reserved_left[__r] = true;
- __swapstart = __left - (__r + 1) * __chunk_size;
- break;
- }
- omp_unset_lock(&__result_lock);
+ /** @brief Parallel implementation of std::partition.
+ * @param __begin Begin iterator of input sequence to split.
+ * @param __end End iterator of input sequence to split.
+ * @param __pred Partition predicate, possibly including some kind
+ * of pivot.
+ * @param __num_threads Maximum number of threads to use for this task.
+ * @return Number of elements not fulfilling the predicate. */
+ template<typename _RAIter, typename _Predicate>
+ typename std::iterator_traits<_RAIter>::difference_type
+ __parallel_partition(_RAIter __begin, _RAIter __end,
+ _Predicate __pred, _ThreadIndex __num_threads)
+ {
+ typedef std::iterator_traits<_RAIter> _TraitsType;
+ typedef typename _TraitsType::value_type _ValueType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
+
+ _DifferenceType __n = __end - __begin;
+
+ _GLIBCXX_CALL(__n)
+
+ const _Settings& __s = _Settings::get();
+
+ // Shared.
+ _GLIBCXX_VOLATILE _DifferenceType __left = 0, __right = __n - 1;
+ _GLIBCXX_VOLATILE _DifferenceType __leftover_left, __leftover_right;
+ _GLIBCXX_VOLATILE _DifferenceType __leftnew, __rightnew;
+
+ bool* __reserved_left = NULL, * __reserved_right = NULL;
+
+ _DifferenceType __chunk_size;
+
+ omp_lock_t __result_lock;
+ omp_init_lock(&__result_lock);
+
+ //at least two chunks per thread
+ if (__right - __left + 1 >= 2 * __num_threads * __chunk_size)
+# pragma omp parallel num_threads(__num_threads)
+ {
+# pragma omp single
+ {
+ __num_threads = omp_get_num_threads();
+ __reserved_left = new bool[__num_threads];
+ __reserved_right = new bool[__num_threads];
+
+ if (__s.partition_chunk_share > 0.0)
+ __chunk_size = std::max<_DifferenceType>
+ (__s.partition_chunk_size, (double)__n
+ * __s.partition_chunk_share / (double)__num_threads);
+ else
+ __chunk_size = __s.partition_chunk_size;
+ }
+
+ while (__right - __left + 1 >= 2 * __num_threads * __chunk_size)
+ {
+# pragma omp single
+ {
+ _DifferenceType __num_chunks = ((__right - __left + 1)
+ / __chunk_size);
+
+ for (int __r = 0; __r < __num_threads; ++__r)
+ {
+ __reserved_left[__r] = false;
+ __reserved_right[__r] = false;
+ }
+ __leftover_left = 0;
+ __leftover_right = 0;
+ } //implicit barrier
+
+ // Private.
+ _DifferenceType __thread_left, __thread_left_border,
+ __thread_right, __thread_right_border;
+ __thread_left = __left + 1;
+
+ // Just to satisfy the condition below.
+ __thread_left_border = __thread_left - 1;
+ __thread_right = __n - 1;
+ __thread_right_border = __thread_right + 1;
+
+ bool __iam_finished = false;
+ while (!__iam_finished)
+ {
+ if (__thread_left > __thread_left_border)
+ {
+ omp_set_lock(&__result_lock);
+ if (__left + (__chunk_size - 1) > __right)
+ __iam_finished = true;
+ else
+ {
+ __thread_left = __left;
+ __thread_left_border = __left + (__chunk_size - 1);
+ __left += __chunk_size;
+ }
+ omp_unset_lock(&__result_lock);
+ }
+
+ if (__thread_right < __thread_right_border)
+ {
+ omp_set_lock(&__result_lock);
+ if (__left > __right - (__chunk_size - 1))
+ __iam_finished = true;
+ else
+ {
+ __thread_right = __right;
+ __thread_right_border = __right - (__chunk_size - 1);
+ __right -= __chunk_size;
+ }
+ omp_unset_lock(&__result_lock);
+ }
+
+ if (__iam_finished)
+ break;
+
+ // Swap as usual.
+ while (__thread_left < __thread_right)
+ {
+ while (__pred(__begin[__thread_left])
+ && __thread_left <= __thread_left_border)
+ ++__thread_left;
+ while (!__pred(__begin[__thread_right])
+ && __thread_right >= __thread_right_border)
+ --__thread_right;
+
+ if (__thread_left > __thread_left_border
+ || __thread_right < __thread_right_border)
+ // Fetch new chunk(__s).
+ break;
+
+ std::swap(__begin[__thread_left],
+ __begin[__thread_right]);
+ ++__thread_left;
+ --__thread_right;
+ }
+ }
+
+ // Now swap the leftover chunks to the right places.
+ if (__thread_left <= __thread_left_border)
+# pragma omp atomic
+ ++__leftover_left;
+ if (__thread_right >= __thread_right_border)
+# pragma omp atomic
+ ++__leftover_right;
+
+# pragma omp barrier
+
+# pragma omp single
+ {
+ __leftnew = __left - __leftover_left * __chunk_size;
+ __rightnew = __right + __leftover_right * __chunk_size;
+ }
+
+# pragma omp barrier
+
+ // <=> __thread_left_border + (__chunk_size - 1) >= __leftnew
+ if (__thread_left <= __thread_left_border
+ && __thread_left_border >= __leftnew)
+ {
+ // Chunk already in place, reserve spot.
+ __reserved_left[(__left - (__thread_left_border + 1))
+ / __chunk_size] = true;
+ }
+
+ // <=> __thread_right_border - (__chunk_size - 1) <= __rightnew
+ if (__thread_right >= __thread_right_border
+ && __thread_right_border <= __rightnew)
+ {
+ // Chunk already in place, reserve spot.
+ __reserved_right[((__thread_right_border - 1) - __right)
+ / __chunk_size] = true;
+ }
+
+# pragma omp barrier
+
+ if (__thread_left <= __thread_left_border
+ && __thread_left_border < __leftnew)
+ {
+ // Find spot and swap.
+ _DifferenceType __swapstart = -1;
+ omp_set_lock(&__result_lock);
+ for (int __r = 0; __r < __leftover_left; ++__r)
+ if (!__reserved_left[__r])
+ {
+ __reserved_left[__r] = true;
+ __swapstart = __left - (__r + 1) * __chunk_size;
+ break;
+ }
+ omp_unset_lock(&__result_lock);
#if _GLIBCXX_ASSERTIONS
- _GLIBCXX_PARALLEL_ASSERT(__swapstart != -1);
+ _GLIBCXX_PARALLEL_ASSERT(__swapstart != -1);
#endif
- std::swap_ranges(__begin + __thread_left_border
- - (__chunk_size - 1),
- __begin + __thread_left_border + 1,
- __begin + __swapstart);
- }
-
- if (__thread_right >= __thread_right_border
- && __thread_right_border > __rightnew)
- {
- // Find spot and swap
- _DifferenceType __swapstart = -1;
- omp_set_lock(&__result_lock);
- for (int __r = 0; __r < __leftover_right; ++__r)
- if (!__reserved_right[__r])
- {
- __reserved_right[__r] = true;
- __swapstart = __right + __r * __chunk_size + 1;
- break;
- }
- omp_unset_lock(&__result_lock);
+ std::swap_ranges(__begin + __thread_left_border
+ - (__chunk_size - 1),
+ __begin + __thread_left_border + 1,
+ __begin + __swapstart);
+ }
+
+ if (__thread_right >= __thread_right_border
+ && __thread_right_border > __rightnew)
+ {
+ // Find spot and swap
+ _DifferenceType __swapstart = -1;
+ omp_set_lock(&__result_lock);
+ for (int __r = 0; __r < __leftover_right; ++__r)
+ if (!__reserved_right[__r])
+ {
+ __reserved_right[__r] = true;
+ __swapstart = __right + __r * __chunk_size + 1;
+ break;
+ }
+ omp_unset_lock(&__result_lock);
#if _GLIBCXX_ASSERTIONS
- _GLIBCXX_PARALLEL_ASSERT(__swapstart != -1);
+ _GLIBCXX_PARALLEL_ASSERT(__swapstart != -1);
#endif
- std::swap_ranges(
- __begin + __thread_right_border,
- __begin + __thread_right_border + __chunk_size,
- __begin + __swapstart);
- }
+ std::swap_ranges(__begin + __thread_right_border,
+ __begin + __thread_right_border
+ + __chunk_size, __begin + __swapstart);
+ }
#if _GLIBCXX_ASSERTIONS
# pragma omp barrier
# pragma omp single
- {
- for (int __r = 0; __r < __leftover_left; ++__r)
- _GLIBCXX_PARALLEL_ASSERT(__reserved_left[__r]);
- for (int __r = 0; __r < __leftover_right; ++__r)
- _GLIBCXX_PARALLEL_ASSERT(__reserved_right[__r]);
- }
+ {
+ for (int __r = 0; __r < __leftover_left; ++__r)
+ _GLIBCXX_PARALLEL_ASSERT(__reserved_left[__r]);
+ for (int __r = 0; __r < __leftover_right; ++__r)
+ _GLIBCXX_PARALLEL_ASSERT(__reserved_right[__r]);
+ }
# pragma omp barrier
#endif
# pragma omp barrier
- __left = __leftnew;
- __right = __rightnew;
- }
-# pragma omp flush(__left, __right)
- } // end "recursion" //parallel
-
- _DifferenceType __final_left = __left, __final_right = __right;
-
- while (__final_left < __final_right)
- {
- // Go right until key is geq than pivot.
- while (__pred(__begin[__final_left]) && __final_left < __final_right)
- ++__final_left;
-
- // Go left until key is less than pivot.
- while (!__pred(__begin[__final_right]) && __final_left < __final_right)
- --__final_right;
-
- if (__final_left == __final_right)
- break;
- std::swap(__begin[__final_left], __begin[__final_right]);
- ++__final_left;
- --__final_right;
- }
-
- // All elements on the left side are < piv, all elements on the
- // right are >= piv
- delete[] __reserved_left;
- delete[] __reserved_right;
-
- omp_destroy_lock(&__result_lock);
-
- // Element "between" __final_left and __final_right might not have
- // been regarded yet
- if (__final_left < __n && !__pred(__begin[__final_left]))
- // Really swapped.
- return __final_left;
- else
- return __final_left + 1;
- }
-
-/**
- * @brief Parallel implementation of std::nth_element().
+ __left = __leftnew;
+ __right = __rightnew;
+ }
+
+# pragma omp flush(__left, __right)
+ } // end "recursion" //parallel
+
+ _DifferenceType __final_left = __left, __final_right = __right;
+
+ while (__final_left < __final_right)
+ {
+ // Go right until key is geq than pivot.
+ while (__pred(__begin[__final_left])
+ && __final_left < __final_right)
+ ++__final_left;
+
+ // Go left until key is less than pivot.
+ while (!__pred(__begin[__final_right])
+ && __final_left < __final_right)
+ --__final_right;
+
+ if (__final_left == __final_right)
+ break;
+ std::swap(__begin[__final_left], __begin[__final_right]);
+ ++__final_left;
+ --__final_right;
+ }
+
+ // All elements on the left side are < piv, all elements on the
+ // right are >= piv
+ delete[] __reserved_left;
+ delete[] __reserved_right;
+
+ omp_destroy_lock(&__result_lock);
+
+ // Element "between" __final_left and __final_right might not have
+ // been regarded yet
+ if (__final_left < __n && !__pred(__begin[__final_left]))
+ // Really swapped.
+ return __final_left;
+ else
+ return __final_left + 1;
+ }
+
+ /**
+ * @brief Parallel implementation of std::nth_element().
+ * @param __begin Begin iterator of input sequence.
+ * @param __nth _Iterator of element that must be in position afterwards.
+ * @param __end End iterator of input sequence.
+ * @param __comp Comparator.
+ */
+ template<typename _RAIter, typename _Compare>
+ void
+ __parallel_nth_element(_RAIter __begin, _RAIter __nth,
+ _RAIter __end, _Compare __comp)
+ {
+ typedef std::iterator_traits<_RAIter> _TraitsType;
+ typedef typename _TraitsType::value_type _ValueType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
+
+ _GLIBCXX_CALL(__end - __begin)
+
+ _RAIter __split;
+ _RandomNumber __rng;
+
+ _DifferenceType __minimum_length =
+ std::max<_DifferenceType>(2, _Settings::get().partition_minimal_n);
+
+ // Break if input range to small.
+ while (static_cast<_SequenceIndex>(__end - __begin) >= __minimum_length)
+ {
+ _DifferenceType __n = __end - __begin;
+
+ _RAIter __pivot_pos = __begin + __rng(__n);
+
+ // Swap __pivot_pos value to end.
+ if (__pivot_pos != (__end - 1))
+ std::swap(*__pivot_pos, *(__end - 1));
+ __pivot_pos = __end - 1;
+
+ // _Compare must have first_value_type, second_value_type,
+ // result_type
+ // _Compare ==
+ // __gnu_parallel::_Lexicographic<S, int,
+ // __gnu_parallel::_Less<S, S> >
+ // __pivot_pos == std::pair<S, int>*
+ __gnu_parallel::binder2nd<_Compare, _ValueType, _ValueType, bool>
+ __pred(__comp, *__pivot_pos);
+
+ // Divide, leave pivot unchanged in last place.
+ _RAIter __split_pos1, __split_pos2;
+ __split_pos1 = __begin + __parallel_partition(__begin, __end - 1,
+ __pred,
+ __get_max_threads());
+
+ // Left side: < __pivot_pos; __right side: >= __pivot_pos
+
+ // Swap pivot back to middle.
+ if (__split_pos1 != __pivot_pos)
+ std::swap(*__split_pos1, *__pivot_pos);
+ __pivot_pos = __split_pos1;
+
+ // In case all elements are equal, __split_pos1 == 0
+ if ((__split_pos1 + 1 - __begin) < (__n >> 7)
+ || (__end - __split_pos1) < (__n >> 7))
+ {
+ // Very unequal split, one part smaller than one 128th
+ // elements not strictly larger than the pivot.
+ __gnu_parallel::__unary_negate<__gnu_parallel::
+ __binder1st<_Compare, _ValueType,
+ _ValueType, bool>, _ValueType>
+ __pred(__gnu_parallel::__binder1st<_Compare, _ValueType,
+ _ValueType, bool>(__comp, *__pivot_pos));
+
+ // Find other end of pivot-equal range.
+ __split_pos2 = __gnu_sequential::partition(__split_pos1 + 1,
+ __end, __pred);
+ }
+ else
+ // Only skip the pivot.
+ __split_pos2 = __split_pos1 + 1;
+
+ // Compare iterators.
+ if (__split_pos2 <= __nth)
+ __begin = __split_pos2;
+ else if (__nth < __split_pos1)
+ __end = __split_pos1;
+ else
+ break;
+ }
+
+ // Only at most _Settings::partition_minimal_n __elements __left.
+ __gnu_sequential::sort(__begin, __end, __comp);
+ }
+
+ /** @brief Parallel implementation of std::partial_sort().
* @param __begin Begin iterator of input sequence.
- * @param __nth _Iterator of element that must be in position afterwards.
+ * @param __middle Sort until this position.
* @param __end End iterator of input sequence.
- * @param __comp Comparator.
- */
-template<typename _RAIter, typename _Compare>
- void
- __parallel_nth_element(_RAIter __begin, _RAIter __nth,
- _RAIter __end, _Compare __comp)
- {
- typedef std::iterator_traits<_RAIter> _TraitsType;
- typedef typename _TraitsType::value_type _ValueType;
- typedef typename _TraitsType::difference_type _DifferenceType;
-
- _GLIBCXX_CALL(__end - __begin)
-
- _RAIter __split;
- _RandomNumber __rng;
-
- _DifferenceType __minimum_length =
- std::max<_DifferenceType>(2, _Settings::get().partition_minimal_n);
-
- // Break if input range to small.
- while (static_cast<_SequenceIndex>(__end - __begin) >= __minimum_length)
- {
- _DifferenceType __n = __end - __begin;
-
- _RAIter __pivot_pos = __begin + __rng(__n);
-
- // Swap __pivot_pos value to end.
- if (__pivot_pos != (__end - 1))
- std::swap(*__pivot_pos, *(__end - 1));
- __pivot_pos = __end - 1;
-
- // _Compare must have first_value_type, second_value_type,
- // result_type
- // _Compare ==
- // __gnu_parallel::_Lexicographic<S, int, __gnu_parallel::_Less<S, S> >
- // __pivot_pos == std::pair<S, int>*
- __gnu_parallel::binder2nd<_Compare, _ValueType, _ValueType, bool>
- __pred(__comp, *__pivot_pos);
-
- // Divide, leave pivot unchanged in last place.
- _RAIter __split_pos1, __split_pos2;
- __split_pos1 = __begin
- + __parallel_partition(__begin, __end - 1, __pred,
- __get_max_threads());
-
- // Left side: < __pivot_pos; __right side: >= __pivot_pos
-
- // Swap pivot back to middle.
- if (__split_pos1 != __pivot_pos)
- std::swap(*__split_pos1, *__pivot_pos);
- __pivot_pos = __split_pos1;
-
- // In case all elements are equal, __split_pos1 == 0
- if ((__split_pos1 + 1 - __begin) < (__n >> 7)
- || (__end - __split_pos1) < (__n >> 7))
- {
- // Very unequal split, one part smaller than one 128th
- // elements not strictly larger than the pivot.
- __gnu_parallel::__unary_negate<__gnu_parallel::
- __binder1st<_Compare, _ValueType, _ValueType, bool>, _ValueType>
- __pred(__gnu_parallel::__binder1st<_Compare, _ValueType,
- _ValueType, bool>(__comp, *__pivot_pos));
-
- // Find other end of pivot-equal range.
- __split_pos2 = __gnu_sequential::partition(__split_pos1 + 1,
- __end, __pred);
- }
- else
- // Only skip the pivot.
- __split_pos2 = __split_pos1 + 1;
-
- // Compare iterators.
- if (__split_pos2 <= __nth)
- __begin = __split_pos2;
- else if (__nth < __split_pos1)
- __end = __split_pos1;
- else
- break;
- }
-
- // Only at most _Settings::partition_minimal_n __elements __left.
- __gnu_sequential::sort(__begin, __end, __comp);
- }
-
-/** @brief Parallel implementation of std::partial_sort().
-* @param __begin Begin iterator of input sequence.
-* @param __middle Sort until this position.
-* @param __end End iterator of input sequence.
-* @param __comp Comparator. */
-template<typename _RAIter, typename _Compare>
- void
- __parallel_partial_sort(_RAIter __begin,
- _RAIter __middle,
- _RAIter __end, _Compare __comp)
- {
- __parallel_nth_element(__begin, __middle, __end, __comp);
- std::sort(__begin, __middle, __comp);
- }
+ * @param __comp Comparator. */
+ template<typename _RAIter, typename _Compare>
+ void
+ __parallel_partial_sort(_RAIter __begin,
+ _RAIter __middle,
+ _RAIter __end, _Compare __comp)
+ {
+ __parallel_nth_element(__begin, __middle, __end, __comp);
+ std::sort(__begin, __middle, __comp);
+ }
} //namespace __gnu_parallel
diff --git a/libstdc++-v3/include/parallel/queue.h b/libstdc++-v3/include/parallel/queue.h
index 348bb1ac900..28c78600860 100644
--- a/libstdc++-v3/include/parallel/queue.h
+++ b/libstdc++-v3/include/parallel/queue.h
@@ -45,7 +45,7 @@ namespace __gnu_parallel
* atomic access. push_front() and pop_front() must not be called
* concurrently to each other, while pop_back() can be called
* concurrently at all times.
- * @__c empty(), @__c size(), and @__c top() are intentionally not provided.
+ * @c empty(), @c size(), and @c top() are intentionally not provided.
* Calling them would not make sense in a concurrent setting.
* @param _Tp Contained element type. */
template<typename _Tp>
@@ -65,10 +65,10 @@ namespace __gnu_parallel
public:
/** @brief Constructor. Not to be called concurrent, of course.
* @param _M_max_size Maximal number of elements to be contained. */
- _RestrictedBoundedConcurrentQueue(_SequenceIndex _M_max_size)
+ _RestrictedBoundedConcurrentQueue(_SequenceIndex __max_size)
{
- this->_M_max_size = _M_max_size;
- _M_base = new _Tp[_M_max_size];
+ _M_max_size = __max_size;
+ _M_base = new _Tp[__max_size];
_M_borders = __encode2(0, 0);
#pragma omp flush
}
@@ -105,12 +105,12 @@ namespace __gnu_parallel
while (__former_front > __former_back)
{
// Chance.
- _CASable
- __former_borders = __encode2(__former_front, __former_back);
- _CASable
- __new_borders = __encode2(__former_front - 1, __former_back);
- if (__compare_and_swap(
- &_M_borders, __former_borders, __new_borders))
+ _CASable __former_borders = __encode2(__former_front,
+ __former_back);
+ _CASable __new_borders = __encode2(__former_front - 1,
+ __former_back);
+ if (__compare_and_swap(&_M_borders, __former_borders,
+ __new_borders))
{
__t = *(_M_base + (__former_front - 1) % _M_max_size);
return true;
@@ -132,12 +132,12 @@ namespace __gnu_parallel
while (__former_front > __former_back)
{
// Chance.
- _CASable
- __former_borders = __encode2(__former_front, __former_back);
- _CASable
- __new_borders = __encode2(__former_front, __former_back + 1);
- if (__compare_and_swap(
- &_M_borders, __former_borders, __new_borders))
+ _CASable __former_borders = __encode2(__former_front,
+ __former_back);
+ _CASable __new_borders = __encode2(__former_front,
+ __former_back + 1);
+ if (__compare_and_swap(&_M_borders, __former_borders,
+ __new_borders))
{
__t = *(_M_base + __former_back % _M_max_size);
return true;
diff --git a/libstdc++-v3/include/parallel/quicksort.h b/libstdc++-v3/include/parallel/quicksort.h
index 1ed46b4a77f..508c3c1763c 100644
--- a/libstdc++-v3/include/parallel/quicksort.h
+++ b/libstdc++-v3/include/parallel/quicksort.h
@@ -48,13 +48,12 @@ namespace __gnu_parallel
*/
template<typename _RAIter, typename _Compare>
typename std::iterator_traits<_RAIter>::difference_type
- __parallel_sort_qs_divide(_RAIter __begin,
- _RAIter __end,
- _Compare __comp, typename std::iterator_traits
- <_RAIter>::difference_type __pivot_rank,
- typename std::iterator_traits
- <_RAIter>::difference_type
- __num_samples, _ThreadIndex __num_threads)
+ __parallel_sort_qs_divide(_RAIter __begin, _RAIter __end,
+ _Compare __comp, typename std::iterator_traits
+ <_RAIter>::difference_type __pivot_rank,
+ typename std::iterator_traits
+ <_RAIter>::difference_type
+ __num_samples, _ThreadIndex __num_threads)
{
typedef std::iterator_traits<_RAIter> _TraitsType;
typedef typename _TraitsType::value_type _ValueType;
@@ -64,25 +63,24 @@ namespace __gnu_parallel
__num_samples = std::min(__num_samples, __n);
// Allocate uninitialized, to avoid default constructor.
- _ValueType* __samples =
- static_cast<_ValueType*>(::operator new(__num_samples
- * sizeof(_ValueType)));
+ _ValueType* __samples = static_cast<_ValueType*>
+ (::operator new(__num_samples * sizeof(_ValueType)));
for (_DifferenceType __s = 0; __s < __num_samples; ++__s)
{
- const unsigned long long __index
- = static_cast<unsigned long long>(__s) * __n / __num_samples;
+ const unsigned long long __index = static_cast<unsigned long long>
+ (__s) * __n / __num_samples;
::new(&(__samples[__s])) _ValueType(__begin[__index]);
}
__gnu_sequential::sort(__samples, __samples + __num_samples, __comp);
- _ValueType& pivot = __samples[__pivot_rank * __num_samples / __n];
+ _ValueType& __pivot = __samples[__pivot_rank * __num_samples / __n];
__gnu_parallel::binder2nd<_Compare, _ValueType, _ValueType, bool>
- __pred(__comp, pivot);
- _DifferenceType __split =
- __parallel_partition(__begin, __end, __pred, __num_threads);
+ __pred(__comp, __pivot);
+ _DifferenceType __split = __parallel_partition(__begin, __end,
+ __pred, __num_threads);
::operator delete(__samples);
@@ -98,10 +96,9 @@ namespace __gnu_parallel
*/
template<typename _RAIter, typename _Compare>
void
- __parallel_sort_qs_conquer(_RAIter __begin,
- _RAIter __end,
- _Compare __comp,
- _ThreadIndex __num_threads)
+ __parallel_sort_qs_conquer(_RAIter __begin, _RAIter __end,
+ _Compare __comp,
+ _ThreadIndex __num_threads)
{
typedef std::iterator_traits<_RAIter> _TraitsType;
typedef typename _TraitsType::value_type _ValueType;
@@ -127,24 +124,22 @@ namespace __gnu_parallel
__pivot_rank = __n * __num_threads_left / __num_threads;
- _DifferenceType __split =
- __parallel_sort_qs_divide(__begin, __end, __comp, __pivot_rank,
- _Settings::get().sort_qs_num_samples_preset,
- __num_threads);
+ _DifferenceType __split = __parallel_sort_qs_divide
+ (__begin, __end, __comp, __pivot_rank,
+ _Settings::get().sort_qs_num_samples_preset, __num_threads);
#pragma omp parallel sections num_threads(2)
{
#pragma omp section
__parallel_sort_qs_conquer(__begin, __begin + __split,
- __comp, __num_threads_left);
+ __comp, __num_threads_left);
#pragma omp section
__parallel_sort_qs_conquer(__begin + __split, __end,
- __comp, __num_threads - __num_threads_left);
+ __comp, __num_threads - __num_threads_left);
}
}
-
/** @brief Unbalanced quicksort main call.
* @param __begin Begin iterator of input sequence.
* @param __end End iterator input sequence, ignored.
@@ -154,10 +149,9 @@ namespace __gnu_parallel
*/
template<typename _RAIter, typename _Compare>
void
- __parallel_sort_qs(_RAIter __begin,
- _RAIter __end,
- _Compare __comp,
- _ThreadIndex __num_threads)
+ __parallel_sort_qs(_RAIter __begin, _RAIter __end,
+ _Compare __comp,
+ _ThreadIndex __num_threads)
{
_GLIBCXX_CALL(__n)
diff --git a/libstdc++-v3/include/parallel/random_number.h b/libstdc++-v3/include/parallel/random_number.h
index 4df91df0583..c39f15e1298 100644
--- a/libstdc++-v3/include/parallel/random_number.h
+++ b/libstdc++-v3/include/parallel/random_number.h
@@ -81,7 +81,7 @@ namespace __gnu_parallel
/** @brief Constructor.
* @param __seed Random __seed.
* @param _M_supremum Generate integer random numbers in the
- * interval @__c [0,_M_supremum). */
+ * interval @c [0,_M_supremum). */
_RandomNumber(uint32_t __seed, uint64_t _M_supremum = 0x100000000ULL)
: _M_mt(__seed), _M_supremum(_M_supremum),
_M_rand_sup(1ULL << std::numeric_limits<uint32_t>::digits),
@@ -95,7 +95,7 @@ namespace __gnu_parallel
{ return __scale_down(_M_mt(), _M_supremum, _M_supremum_reciprocal); }
/** @brief Generate unsigned random 32-bit integer in the
- interval @__c [0,local_supremum). */
+ interval @c [0,local_supremum). */
uint32_t
operator()(uint64_t local_supremum)
{
diff --git a/libstdc++-v3/include/parallel/random_shuffle.h b/libstdc++-v3/include/parallel/random_shuffle.h
index a74b9ac82ac..3082ea8dbc0 100644
--- a/libstdc++-v3/include/parallel/random_shuffle.h
+++ b/libstdc++-v3/include/parallel/random_shuffle.h
@@ -39,492 +39,484 @@
namespace __gnu_parallel
{
-/** @brief Type to hold the index of a bin.
- *
- * Since many variables of this type are allocated, it should be
- * chosen as small as possible.
- */
-typedef unsigned short _BinIndex;
-
-/** @brief Data known to every thread participating in
- __gnu_parallel::__parallel_random_shuffle(). */
-template<typename _RAIter>
- struct _DRandomShufflingGlobalData
- {
- typedef std::iterator_traits<_RAIter> _TraitsType;
- typedef typename _TraitsType::value_type _ValueType;
- typedef typename _TraitsType::difference_type _DifferenceType;
-
- /** @brief Begin iterator of the __source. */
- _RAIter& _M_source;
-
- /** @brief Temporary arrays for each thread. */
- _ValueType** _M_temporaries;
-
- /** @brief Two-dimensional array to hold the thread-bin distribution.
- *
- * Dimensions (_M_num_threads + 1) __x (_M_num_bins + 1). */
- _DifferenceType** _M_dist;
-
- /** @brief Start indexes of the threads' __chunks. */
- _DifferenceType* _M_starts;
-
- /** @brief Number of the thread that will further process the
- corresponding bin. */
- _ThreadIndex* _M_bin_proc;
-
- /** @brief Number of bins to distribute to. */
- int _M_num_bins;
-
- /** @brief Number of bits needed to address the bins. */
- int _M_num_bits;
-
- /** @brief Constructor. */
- _DRandomShufflingGlobalData(_RAIter& __source)
- : _M_source(__source) { }
- };
-
-/** @brief Local data for a thread participating in
- __gnu_parallel::__parallel_random_shuffle().
- */
-template<typename _RAIter, typename _RandomNumberGenerator>
- struct _DRSSorterPU
- {
- /** @brief Number of threads participating in total. */
- int _M_num_threads;
-
- /** @brief Begin index for bins taken care of by this thread. */
- _BinIndex _M_bins_begin;
-
- /** @brief End index for bins taken care of by this thread. */
- _BinIndex __bins_end;
-
- /** @brief Random _M_seed for this thread. */
- uint32_t _M_seed;
-
- /** @brief Pointer to global data. */
- _DRandomShufflingGlobalData<_RAIter>* _M_sd;
- };
-
-/** @brief Generate a random number in @__c [0,2^logp).
- * @param logp Logarithm (basis 2) of the upper range __bound.
- * @param __rng Random number generator to use.
- */
-template<typename _RandomNumberGenerator>
- inline int
- __random_number_pow2(int logp, _RandomNumberGenerator& __rng)
- { return __rng.__genrand_bits(logp); }
-
-/** @brief Random shuffle code executed by each thread.
- * @param __pus Array of thread-local data records. */
-template<typename _RAIter, typename _RandomNumberGenerator>
- void
- __parallel_random_shuffle_drs_pu(_DRSSorterPU<_RAIter,
- _RandomNumberGenerator>* __pus)
- {
- typedef std::iterator_traits<_RAIter> _TraitsType;
- typedef typename _TraitsType::value_type _ValueType;
- typedef typename _TraitsType::difference_type _DifferenceType;
-
- _ThreadIndex __iam = omp_get_thread_num();
- _DRSSorterPU<_RAIter, _RandomNumberGenerator>* d = &__pus[__iam];
- _DRandomShufflingGlobalData<_RAIter>* _M_sd = d->_M_sd;
-
- // Indexing: _M_dist[bin][processor]
- _DifferenceType __length = _M_sd->_M_starts[__iam + 1] -
- _M_sd->_M_starts[__iam];
- _BinIndex* __oracles = new _BinIndex[__length];
- _DifferenceType* _M_dist = new _DifferenceType[_M_sd->_M_num_bins + 1];
- _BinIndex* _M_bin_proc = new _BinIndex[_M_sd->_M_num_bins];
- _ValueType** _M_temporaries = new _ValueType*[d->_M_num_threads];
-
- // Compute oracles and count appearances.
- for (_BinIndex __b = 0; __b < _M_sd->_M_num_bins + 1; ++__b)
- _M_dist[__b] = 0;
- int _M_num_bits = _M_sd->_M_num_bits;
-
- _RandomNumber __rng(d->_M_seed);
-
- // First main loop.
- for (_DifferenceType __i = 0; __i < __length; ++__i)
- {
- _BinIndex __oracle = __random_number_pow2(_M_num_bits, __rng);
- __oracles[__i] = __oracle;
+ /** @brief Type to hold the index of a bin.
+ *
+ * Since many variables of this type are allocated, it should be
+ * chosen as small as possible.
+ */
+ typedef unsigned short _BinIndex;
+
+ /** @brief Data known to every thread participating in
+ __gnu_parallel::__parallel_random_shuffle(). */
+ template<typename _RAIter>
+ struct _DRandomShufflingGlobalData
+ {
+ typedef std::iterator_traits<_RAIter> _TraitsType;
+ typedef typename _TraitsType::value_type _ValueType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
- // To allow prefix (partial) sum.
- ++(_M_dist[__oracle + 1]);
- }
+ /** @brief Begin iterator of the __source. */
+ _RAIter& _M_source;
- for (_BinIndex __b = 0; __b < _M_sd->_M_num_bins + 1; ++__b)
- _M_sd->_M_dist[__b][__iam + 1] = _M_dist[__b];
+ /** @brief Temporary arrays for each thread. */
+ _ValueType** _M_temporaries;
-# pragma omp barrier
+ /** @brief Two-dimensional array to hold the thread-bin distribution.
+ *
+ * Dimensions (_M_num_threads + 1) __x (_M_num_bins + 1). */
+ _DifferenceType** _M_dist;
-# pragma omp single
- {
- // Sum up bins, _M_sd->_M_dist[__s + 1][d->_M_num_threads] now contains
- // the total number of items in bin __s
- for (_BinIndex __s = 0; __s < _M_sd->_M_num_bins; ++__s)
- __gnu_sequential::partial_sum(
- _M_sd->_M_dist[__s + 1],
- _M_sd->_M_dist[__s + 1] + d->_M_num_threads + 1,
- _M_sd->_M_dist[__s + 1]);
- }
+ /** @brief Start indexes of the threads' __chunks. */
+ _DifferenceType* _M_starts;
-# pragma omp barrier
+ /** @brief Number of the thread that will further process the
+ corresponding bin. */
+ _ThreadIndex* _M_bin_proc;
- _SequenceIndex __offset = 0, __global_offset = 0;
- for (_BinIndex __s = 0; __s < d->_M_bins_begin; ++__s)
- __global_offset += _M_sd->_M_dist[__s + 1][d->_M_num_threads];
+ /** @brief Number of bins to distribute to. */
+ int _M_num_bins;
-# pragma omp barrier
+ /** @brief Number of bits needed to address the bins. */
+ int _M_num_bits;
- for (_BinIndex __s = d->_M_bins_begin; __s < d->__bins_end; ++__s)
- {
- for (int __t = 0; __t < d->_M_num_threads + 1; ++__t)
- _M_sd->_M_dist[__s + 1][__t] += __offset;
- __offset = _M_sd->_M_dist[__s + 1][d->_M_num_threads];
- }
+ /** @brief Constructor. */
+ _DRandomShufflingGlobalData(_RAIter& __source)
+ : _M_source(__source) { }
+ };
+
+ /** @brief Local data for a thread participating in
+ __gnu_parallel::__parallel_random_shuffle().
+ */
+ template<typename _RAIter, typename _RandomNumberGenerator>
+ struct _DRSSorterPU
+ {
+ /** @brief Number of threads participating in total. */
+ int _M_num_threads;
+
+ /** @brief Begin index for bins taken care of by this thread. */
+ _BinIndex _M_bins_begin;
+
+ /** @brief End index for bins taken care of by this thread. */
+ _BinIndex __bins_end;
+
+ /** @brief Random _M_seed for this thread. */
+ uint32_t _M_seed;
+
+ /** @brief Pointer to global data. */
+ _DRandomShufflingGlobalData<_RAIter>* _M_sd;
+ };
+
+ /** @brief Generate a random number in @c [0,2^__logp).
+ * @param __logp Logarithm (basis 2) of the upper range __bound.
+ * @param __rng Random number generator to use.
+ */
+ template<typename _RandomNumberGenerator>
+ inline int
+ __random_number_pow2(int __logp, _RandomNumberGenerator& __rng)
+ { return __rng.__genrand_bits(__logp); }
+
+ /** @brief Random shuffle code executed by each thread.
+ * @param __pus Array of thread-local data records. */
+ template<typename _RAIter, typename _RandomNumberGenerator>
+ void
+ __parallel_random_shuffle_drs_pu(_DRSSorterPU<_RAIter,
+ _RandomNumberGenerator>* __pus)
+ {
+ typedef std::iterator_traits<_RAIter> _TraitsType;
+ typedef typename _TraitsType::value_type _ValueType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
- _M_sd->_M_temporaries[__iam] = static_cast<_ValueType*>(
- ::operator new(sizeof(_ValueType) * __offset));
+ _ThreadIndex __iam = omp_get_thread_num();
+ _DRSSorterPU<_RAIter, _RandomNumberGenerator>* __d = &__pus[__iam];
+ _DRandomShufflingGlobalData<_RAIter>* __sd = __d->_M_sd;
-# pragma omp barrier
+ // Indexing: _M_dist[bin][processor]
+ _DifferenceType __length = (__sd->_M_starts[__iam + 1]
+ - __sd->_M_starts[__iam]);
+ _BinIndex* __oracles = new _BinIndex[__length];
+ _DifferenceType* __dist = new _DifferenceType[__sd->_M_num_bins + 1];
+ _BinIndex* __bin_proc = new _BinIndex[__sd->_M_num_bins];
+ _ValueType** __temporaries = new _ValueType*[__d->_M_num_threads];
- // Draw local copies to avoid false sharing.
- for (_BinIndex __b = 0; __b < _M_sd->_M_num_bins + 1; ++__b)
- _M_dist[__b] = _M_sd->_M_dist[__b][__iam];
- for (_BinIndex __b = 0; __b < _M_sd->_M_num_bins; ++__b)
- _M_bin_proc[__b] = _M_sd->_M_bin_proc[__b];
- for (_ThreadIndex __t = 0; __t < d->_M_num_threads; ++__t)
- _M_temporaries[__t] = _M_sd->_M_temporaries[__t];
+ // Compute oracles and count appearances.
+ for (_BinIndex __b = 0; __b < __sd->_M_num_bins + 1; ++__b)
+ __dist[__b] = 0;
+ int __num_bits = __sd->_M_num_bits;
- _RAIter _M_source = _M_sd->_M_source;
- _DifferenceType __start = _M_sd->_M_starts[__iam];
+ _RandomNumber __rng(__d->_M_seed);
- // Distribute according to oracles, second main loop.
- for (_DifferenceType __i = 0; __i < __length; ++__i)
- {
- _BinIndex target_bin = __oracles[__i];
- _ThreadIndex target_p = _M_bin_proc[target_bin];
+ // First main loop.
+ for (_DifferenceType __i = 0; __i < __length; ++__i)
+ {
+ _BinIndex __oracle = __random_number_pow2(__num_bits, __rng);
+ __oracles[__i] = __oracle;
- // Last column [d->_M_num_threads] stays unchanged.
- ::new(&(_M_temporaries[target_p][_M_dist[target_bin + 1]++]))
- _ValueType(*(_M_source + __i + __start));
- }
+ // To allow prefix (partial) sum.
+ ++(__dist[__oracle + 1]);
+ }
- delete[] __oracles;
- delete[] _M_dist;
- delete[] _M_bin_proc;
- delete[] _M_temporaries;
+ for (_BinIndex __b = 0; __b < __sd->_M_num_bins + 1; ++__b)
+ __sd->_M_dist[__b][__iam + 1] = __dist[__b];
-# pragma omp barrier
+# pragma omp barrier
- // Shuffle bins internally.
- for (_BinIndex __b = d->_M_bins_begin; __b < d->__bins_end; ++__b)
+# pragma omp single
{
- _ValueType* __begin =
- _M_sd->_M_temporaries[__iam] +
- ((__b == d->_M_bins_begin)
- ? 0 : _M_sd->_M_dist[__b][d->_M_num_threads]),
- * __end =
- _M_sd->_M_temporaries[__iam] +
- _M_sd->_M_dist[__b + 1][d->_M_num_threads];
- __sequential_random_shuffle(__begin, __end, __rng);
- std::copy(__begin, __end, _M_sd->_M_source + __global_offset +
- ((__b == d->_M_bins_begin)
- ? 0 : _M_sd->_M_dist[__b][d->_M_num_threads]));
+ // Sum up bins, __sd->_M_dist[__s + 1][__d->_M_num_threads] now
+ // contains the total number of items in bin __s
+ for (_BinIndex __s = 0; __s < __sd->_M_num_bins; ++__s)
+ __gnu_sequential::partial_sum(__sd->_M_dist[__s + 1],
+ __sd->_M_dist[__s + 1]
+ + __d->_M_num_threads + 1,
+ __sd->_M_dist[__s + 1]);
}
- ::operator delete(_M_sd->_M_temporaries[__iam]);
- }
-
-/** @brief Round up to the next greater power of 2.
- * @param __x _Integer to round up */
-template<typename _Tp>
- _Tp
- __round_up_to_pow2(_Tp __x)
- {
- if (__x <= 1)
- return 1;
- else
- return (_Tp)1 << (__rd_log2(__x - 1) + 1);
- }
-
-/** @brief Main parallel random shuffle step.
- * @param __begin Begin iterator of sequence.
- * @param __end End iterator of sequence.
- * @param __n Length of sequence.
- * @param __num_threads Number of threads to use.
- * @param __rng Random number generator to use.
- */
-template<typename _RAIter, typename _RandomNumberGenerator>
- void
- __parallel_random_shuffle_drs(_RAIter __begin,
- _RAIter __end,
- typename std::iterator_traits
- <_RAIter>::difference_type __n,
- _ThreadIndex __num_threads,
- _RandomNumberGenerator& __rng)
- {
- typedef std::iterator_traits<_RAIter> _TraitsType;
- typedef typename _TraitsType::value_type _ValueType;
- typedef typename _TraitsType::difference_type _DifferenceType;
-
- _GLIBCXX_CALL(__n)
-
- const _Settings& __s = _Settings::get();
-
- if (__num_threads > __n)
- __num_threads = static_cast<_ThreadIndex>(__n);
-
- _BinIndex _M_num_bins, __num_bins_cache;
+# pragma omp barrier
+
+ _SequenceIndex __offset = 0, __global_offset = 0;
+ for (_BinIndex __s = 0; __s < __d->_M_bins_begin; ++__s)
+ __global_offset += __sd->_M_dist[__s + 1][__d->_M_num_threads];
+
+# pragma omp barrier
+
+ for (_BinIndex __s = __d->_M_bins_begin; __s < __d->__bins_end; ++__s)
+ {
+ for (int __t = 0; __t < __d->_M_num_threads + 1; ++__t)
+ __sd->_M_dist[__s + 1][__t] += __offset;
+ __offset = __sd->_M_dist[__s + 1][__d->_M_num_threads];
+ }
+
+ __sd->_M_temporaries[__iam] = static_cast<_ValueType*>
+ (::operator new(sizeof(_ValueType) * __offset));
+
+# pragma omp barrier
+
+ // Draw local copies to avoid false sharing.
+ for (_BinIndex __b = 0; __b < __sd->_M_num_bins + 1; ++__b)
+ __dist[__b] = __sd->_M_dist[__b][__iam];
+ for (_BinIndex __b = 0; __b < __sd->_M_num_bins; ++__b)
+ __bin_proc[__b] = __sd->_M_bin_proc[__b];
+ for (_ThreadIndex __t = 0; __t < __d->_M_num_threads; ++__t)
+ __temporaries[__t] = __sd->_M_temporaries[__t];
+
+ _RAIter __source = __sd->_M_source;
+ _DifferenceType __start = __sd->_M_starts[__iam];
+
+ // Distribute according to oracles, second main loop.
+ for (_DifferenceType __i = 0; __i < __length; ++__i)
+ {
+ _BinIndex __target_bin = __oracles[__i];
+ _ThreadIndex __target_p = __bin_proc[__target_bin];
+
+ // Last column [__d->_M_num_threads] stays unchanged.
+ ::new(&(__temporaries[__target_p][__dist[__target_bin + 1]++]))
+ _ValueType(*(__source + __i + __start));
+ }
+
+ delete[] __oracles;
+ delete[] __dist;
+ delete[] __bin_proc;
+ delete[] __temporaries;
+
+# pragma omp barrier
+
+ // Shuffle bins internally.
+ for (_BinIndex __b = __d->_M_bins_begin; __b < __d->__bins_end; ++__b)
+ {
+ _ValueType* __begin =
+ (__sd->_M_temporaries[__iam]
+ + (__b == __d->_M_bins_begin
+ ? 0 : __sd->_M_dist[__b][__d->_M_num_threads])),
+ * __end = (__sd->_M_temporaries[__iam]
+ + __sd->_M_dist[__b + 1][__d->_M_num_threads]);
+
+ __sequential_random_shuffle(__begin, __end, __rng);
+ std::copy(__begin, __end, __sd->_M_source + __global_offset
+ + (__b == __d->_M_bins_begin
+ ? 0 : __sd->_M_dist[__b][__d->_M_num_threads]));
+ }
+
+ ::operator delete(__sd->_M_temporaries[__iam]);
+ }
+
+ /** @brief Round up to the next greater power of 2.
+ * @param __x _Integer to round up */
+ template<typename _Tp>
+ _Tp
+ __round_up_to_pow2(_Tp __x)
+ {
+ if (__x <= 1)
+ return 1;
+ else
+ return (_Tp)1 << (__rd_log2(__x - 1) + 1);
+ }
+
+ /** @brief Main parallel random shuffle step.
+ * @param __begin Begin iterator of sequence.
+ * @param __end End iterator of sequence.
+ * @param __n Length of sequence.
+ * @param __num_threads Number of threads to use.
+ * @param __rng Random number generator to use.
+ */
+ template<typename _RAIter, typename _RandomNumberGenerator>
+ void
+ __parallel_random_shuffle_drs(_RAIter __begin, _RAIter __end,
+ typename std::iterator_traits
+ <_RAIter>::difference_type __n,
+ _ThreadIndex __num_threads,
+ _RandomNumberGenerator& __rng)
+ {
+ typedef std::iterator_traits<_RAIter> _TraitsType;
+ typedef typename _TraitsType::value_type _ValueType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
+
+ _GLIBCXX_CALL(__n)
+
+ const _Settings& __s = _Settings::get();
+
+ if (__num_threads > __n)
+ __num_threads = static_cast<_ThreadIndex>(__n);
+
+ _BinIndex __num_bins, __num_bins_cache;
#if _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_L1
- // Try the L1 cache first.
+ // Try the L1 cache first.
- // Must fit into L1.
- __num_bins_cache = std::max<_DifferenceType>(
- 1, __n / (__s.L1_cache_size_lb / sizeof(_ValueType)));
- __num_bins_cache = __round_up_to_pow2(__num_bins_cache);
+ // Must fit into L1.
+ __num_bins_cache =
+ std::max<_DifferenceType>(1, __n / (__s.L1_cache_size_lb
+ / sizeof(_ValueType)));
+ __num_bins_cache = __round_up_to_pow2(__num_bins_cache);
- // No more buckets than TLB entries, power of 2
- // Power of 2 and at least one element per bin, at most the TLB size.
- _M_num_bins = std::min<_DifferenceType>(__n, __num_bins_cache);
+ // No more buckets than TLB entries, power of 2
+ // Power of 2 and at least one element per bin, at most the TLB size.
+ __num_bins = std::min<_DifferenceType>(__n, __num_bins_cache);
#if _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_TLB
- // 2 TLB entries needed per bin.
- _M_num_bins = std::min<_DifferenceType>(__s.TLB_size / 2, _M_num_bins);
+ // 2 TLB entries needed per bin.
+ __num_bins = std::min<_DifferenceType>(__s.TLB_size / 2, __num_bins);
#endif
- _M_num_bins = __round_up_to_pow2(_M_num_bins);
+ __num_bins = __round_up_to_pow2(__num_bins);
- if (_M_num_bins < __num_bins_cache)
- {
+ if (__num_bins < __num_bins_cache)
+ {
#endif
- // Now try the L2 cache
- // Must fit into L2
- __num_bins_cache = static_cast<_BinIndex>(std::max<_DifferenceType>(
- 1, __n / (__s.L2_cache_size / sizeof(_ValueType))));
- __num_bins_cache = __round_up_to_pow2(__num_bins_cache);
-
- // No more buckets than TLB entries, power of 2.
- _M_num_bins = static_cast<_BinIndex>(
- std::min(__n, static_cast<_DifferenceType>(__num_bins_cache)));
- // Power of 2 and at least one element per bin, at most the TLB size.
+ // Now try the L2 cache
+ // Must fit into L2
+ __num_bins_cache = static_cast<_BinIndex>
+ (std::max<_DifferenceType>(1, __n / (__s.L2_cache_size
+ / sizeof(_ValueType))));
+ __num_bins_cache = __round_up_to_pow2(__num_bins_cache);
+
+ // No more buckets than TLB entries, power of 2.
+ __num_bins = static_cast<_BinIndex>
+ (std::min(__n, static_cast<_DifferenceType>(__num_bins_cache)));
+ // Power of 2 and at least one element per bin, at most the TLB size.
#if _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_TLB
- // 2 TLB entries needed per bin.
- _M_num_bins = std::min(
- static_cast<_DifferenceType>(__s.TLB_size / 2), _M_num_bins);
+ // 2 TLB entries needed per bin.
+ __num_bins = std::min(static_cast<_DifferenceType>(__s.TLB_size / 2),
+ __num_bins);
#endif
- _M_num_bins = __round_up_to_pow2(_M_num_bins);
+ __num_bins = __round_up_to_pow2(__num_bins);
#if _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_L1
- }
+ }
#endif
- __num_threads = std::min<_BinIndex>(__num_threads, _M_num_bins);
+ __num_threads = std::min<_BinIndex>(__num_threads, __num_bins);
- if (__num_threads <= 1)
- return __sequential_random_shuffle(__begin, __end, __rng);
+ if (__num_threads <= 1)
+ return __sequential_random_shuffle(__begin, __end, __rng);
- _DRandomShufflingGlobalData<_RAIter> _M_sd(__begin);
- _DRSSorterPU<_RAIter, _RandomNumber >* __pus;
- _DifferenceType* _M_starts;
+ _DRandomShufflingGlobalData<_RAIter> __sd(__begin);
+ _DRSSorterPU<_RAIter, _RandomNumber >* __pus;
+ _DifferenceType* __starts;
-# pragma omp parallel num_threads(__num_threads)
+# pragma omp parallel num_threads(__num_threads)
{
- _ThreadIndex __num_threads = omp_get_num_threads();
+ _ThreadIndex __num_threads = omp_get_num_threads();
# pragma omp single
- {
- __pus = new _DRSSorterPU<_RAIter, _RandomNumber>
- [__num_threads];
-
- _M_sd._M_temporaries = new _ValueType*[__num_threads];
- _M_sd._M_dist = new _DifferenceType*[_M_num_bins + 1];
- _M_sd._M_bin_proc = new _ThreadIndex[_M_num_bins];
- for (_BinIndex __b = 0; __b < _M_num_bins + 1; ++__b)
- _M_sd._M_dist[__b] = new _DifferenceType[__num_threads + 1];
- for (_BinIndex __b = 0; __b < (_M_num_bins + 1); ++__b)
- {
- _M_sd._M_dist[0][0] = 0;
- _M_sd._M_dist[__b][0] = 0;
- }
- _M_starts = _M_sd._M_starts
- = new _DifferenceType[__num_threads + 1];
- int bin_cursor = 0;
- _M_sd._M_num_bins = _M_num_bins;
- _M_sd._M_num_bits = __rd_log2(_M_num_bins);
-
- _DifferenceType __chunk_length = __n / __num_threads,
- __split = __n % __num_threads, __start = 0;
- _DifferenceType bin_chunk_length = _M_num_bins / __num_threads,
- bin_split = _M_num_bins % __num_threads;
- for (_ThreadIndex __i = 0; __i < __num_threads; ++__i)
- {
- _M_starts[__i] = __start;
- __start += (__i < __split)
- ? (__chunk_length + 1) : __chunk_length;
- int __j = __pus[__i]._M_bins_begin = bin_cursor;
-
- // Range of bins for this processor.
- bin_cursor += (__i < bin_split) ?
- (bin_chunk_length + 1) : bin_chunk_length;
- __pus[__i].__bins_end = bin_cursor;
- for (; __j < bin_cursor; ++__j)
- _M_sd._M_bin_proc[__j] = __i;
- __pus[__i]._M_num_threads = __num_threads;
- __pus[__i]._M_seed =
- __rng(std::numeric_limits<uint32_t>::max());
- __pus[__i]._M_sd = &_M_sd;
- }
- _M_starts[__num_threads] = __start;
- } //single
- // Now shuffle in parallel.
- __parallel_random_shuffle_drs_pu(__pus);
+ {
+ __pus = new _DRSSorterPU<_RAIter, _RandomNumber>[__num_threads];
+
+ __sd._M_temporaries = new _ValueType*[__num_threads];
+ __sd._M_dist = new _DifferenceType*[__num_bins + 1];
+ __sd._M_bin_proc = new _ThreadIndex[__num_bins];
+ for (_BinIndex __b = 0; __b < __num_bins + 1; ++__b)
+ __sd._M_dist[__b] = new _DifferenceType[__num_threads + 1];
+ for (_BinIndex __b = 0; __b < (__num_bins + 1); ++__b)
+ {
+ __sd._M_dist[0][0] = 0;
+ __sd._M_dist[__b][0] = 0;
+ }
+ __starts = __sd._M_starts = new _DifferenceType[__num_threads + 1];
+ int __bin_cursor = 0;
+ __sd._M_num_bins = __num_bins;
+ __sd._M_num_bits = __rd_log2(__num_bins);
+
+ _DifferenceType __chunk_length = __n / __num_threads,
+ __split = __n % __num_threads,
+ __start = 0;
+ _DifferenceType __bin_chunk_length = __num_bins / __num_threads,
+ __bin_split = __num_bins % __num_threads;
+ for (_ThreadIndex __i = 0; __i < __num_threads; ++__i)
+ {
+ __starts[__i] = __start;
+ __start += (__i < __split
+ ? (__chunk_length + 1) : __chunk_length);
+ int __j = __pus[__i]._M_bins_begin = __bin_cursor;
+
+ // Range of bins for this processor.
+ __bin_cursor += (__i < __bin_split
+ ? (__bin_chunk_length + 1)
+ : __bin_chunk_length);
+ __pus[__i].__bins_end = __bin_cursor;
+ for (; __j < __bin_cursor; ++__j)
+ __sd._M_bin_proc[__j] = __i;
+ __pus[__i]._M_num_threads = __num_threads;
+ __pus[__i]._M_seed = __rng(std::numeric_limits<uint32_t>::max());
+ __pus[__i]._M_sd = &__sd;
+ }
+ __starts[__num_threads] = __start;
+ } //single
+ // Now shuffle in parallel.
+ __parallel_random_shuffle_drs_pu(__pus);
} // parallel
- delete[] _M_starts;
- delete[] _M_sd._M_bin_proc;
- for (int __s = 0; __s < (_M_num_bins + 1); ++__s)
- delete[] _M_sd._M_dist[__s];
- delete[] _M_sd._M_dist;
- delete[] _M_sd._M_temporaries;
+ delete[] __starts;
+ delete[] __sd._M_bin_proc;
+ for (int __s = 0; __s < (__num_bins + 1); ++__s)
+ delete[] __sd._M_dist[__s];
+ delete[] __sd._M_dist;
+ delete[] __sd._M_temporaries;
- delete[] __pus;
- }
+ delete[] __pus;
+ }
-/** @brief Sequential cache-efficient random shuffle.
- * @param __begin Begin iterator of sequence.
- * @param __end End iterator of sequence.
- * @param __rng Random number generator to use.
- */
-template<typename _RAIter, typename _RandomNumberGenerator>
- void
- __sequential_random_shuffle(_RAIter __begin,
- _RAIter __end,
- _RandomNumberGenerator& __rng)
- {
- typedef std::iterator_traits<_RAIter> _TraitsType;
- typedef typename _TraitsType::value_type _ValueType;
- typedef typename _TraitsType::difference_type _DifferenceType;
+ /** @brief Sequential cache-efficient random shuffle.
+ * @param __begin Begin iterator of sequence.
+ * @param __end End iterator of sequence.
+ * @param __rng Random number generator to use.
+ */
+ template<typename _RAIter, typename _RandomNumberGenerator>
+ void
+ __sequential_random_shuffle(_RAIter __begin, _RAIter __end,
+ _RandomNumberGenerator& __rng)
+ {
+ typedef std::iterator_traits<_RAIter> _TraitsType;
+ typedef typename _TraitsType::value_type _ValueType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
- _DifferenceType __n = __end - __begin;
- const _Settings& __s = _Settings::get();
+ _DifferenceType __n = __end - __begin;
+ const _Settings& __s = _Settings::get();
- _BinIndex _M_num_bins, __num_bins_cache;
+ _BinIndex __num_bins, __num_bins_cache;
#if _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_L1
- // Try the L1 cache first, must fit into L1.
- __num_bins_cache =
- std::max<_DifferenceType>
- (1, __n / (__s.L1_cache_size_lb / sizeof(_ValueType)));
- __num_bins_cache = __round_up_to_pow2(__num_bins_cache);
-
- // No more buckets than TLB entries, power of 2
- // Power of 2 and at least one element per bin, at most the TLB size
- _M_num_bins = std::min(__n, (_DifferenceType)__num_bins_cache);
+ // Try the L1 cache first, must fit into L1.
+ __num_bins_cache = std::max<_DifferenceType>
+ (1, __n / (__s.L1_cache_size_lb / sizeof(_ValueType)));
+ __num_bins_cache = __round_up_to_pow2(__num_bins_cache);
+
+ // No more buckets than TLB entries, power of 2
+ // Power of 2 and at least one element per bin, at most the TLB size
+ __num_bins = std::min(__n, (_DifferenceType)__num_bins_cache);
#if _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_TLB
- // 2 TLB entries needed per bin
- _M_num_bins = std::min((_DifferenceType)__s.TLB_size / 2, _M_num_bins);
+ // 2 TLB entries needed per bin
+ __num_bins = std::min((_DifferenceType)__s.TLB_size / 2, __num_bins);
#endif
- _M_num_bins = __round_up_to_pow2(_M_num_bins);
+ __num_bins = __round_up_to_pow2(__num_bins);
- if (_M_num_bins < __num_bins_cache)
- {
+ if (__num_bins < __num_bins_cache)
+ {
#endif
- // Now try the L2 cache, must fit into L2.
- __num_bins_cache =
- static_cast<_BinIndex>(std::max<_DifferenceType>(
- 1, __n / (__s.L2_cache_size / sizeof(_ValueType))));
- __num_bins_cache = __round_up_to_pow2(__num_bins_cache);
+ // Now try the L2 cache, must fit into L2.
+ __num_bins_cache = static_cast<_BinIndex>
+ (std::max<_DifferenceType>(1, __n / (__s.L2_cache_size
+ / sizeof(_ValueType))));
+ __num_bins_cache = __round_up_to_pow2(__num_bins_cache);
- // No more buckets than TLB entries, power of 2
- // Power of 2 and at least one element per bin, at most the TLB size.
- _M_num_bins = static_cast<_BinIndex>
- (std::min(__n, static_cast<_DifferenceType>(__num_bins_cache)));
+ // No more buckets than TLB entries, power of 2
+ // Power of 2 and at least one element per bin, at most the TLB size.
+ __num_bins = static_cast<_BinIndex>
+ (std::min(__n, static_cast<_DifferenceType>(__num_bins_cache)));
#if _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_TLB
- // 2 TLB entries needed per bin
- _M_num_bins =
- std::min<_DifferenceType>(__s.TLB_size / 2, _M_num_bins);
+ // 2 TLB entries needed per bin
+ __num_bins = std::min<_DifferenceType>(__s.TLB_size / 2, __num_bins);
#endif
- _M_num_bins = __round_up_to_pow2(_M_num_bins);
+ __num_bins = __round_up_to_pow2(__num_bins);
#if _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_L1
- }
+ }
#endif
- int _M_num_bits = __rd_log2(_M_num_bins);
+ int __num_bits = __rd_log2(__num_bins);
- if (_M_num_bins > 1)
- {
- _ValueType* __target = static_cast<_ValueType*>(
- ::operator new(sizeof(_ValueType) * __n));
- _BinIndex* __oracles = new _BinIndex[__n];
- _DifferenceType* __dist0 = new _DifferenceType[_M_num_bins + 1],
- * __dist1 = new _DifferenceType[_M_num_bins + 1];
-
- for (int __b = 0; __b < _M_num_bins + 1; ++__b)
- __dist0[__b] = 0;
-
- _RandomNumber bitrng(__rng(0xFFFFFFFF));
-
- for (_DifferenceType __i = 0; __i < __n; ++__i)
- {
- _BinIndex __oracle = __random_number_pow2(_M_num_bits, bitrng);
- __oracles[__i] = __oracle;
-
- // To allow prefix (partial) sum.
- ++(__dist0[__oracle + 1]);
- }
-
- // Sum up bins.
- __gnu_sequential::
- partial_sum(__dist0, __dist0 + _M_num_bins + 1, __dist0);
-
- for (int __b = 0; __b < _M_num_bins + 1; ++__b)
- __dist1[__b] = __dist0[__b];
-
- // Distribute according to oracles.
- for (_DifferenceType __i = 0; __i < __n; ++__i)
- ::new(&(__target[(__dist0[__oracles[__i]])++]))
- _ValueType(*(__begin + __i));
-
- for (int __b = 0; __b < _M_num_bins; ++__b)
- {
- __sequential_random_shuffle(__target + __dist1[__b],
- __target + __dist1[__b + 1],
- __rng);
- }
-
- // Copy elements back.
- std::copy(__target, __target + __n, __begin);
-
- delete[] __dist0;
- delete[] __dist1;
- delete[] __oracles;
- ::operator delete(__target);
- }
- else
- __gnu_sequential::random_shuffle(__begin, __end, __rng);
- }
-
-/** @brief Parallel random public call.
- * @param __begin Begin iterator of sequence.
- * @param __end End iterator of sequence.
- * @param __rng Random number generator to use.
- */
-template<typename _RAIter, typename _RandomNumberGenerator>
- inline void
- __parallel_random_shuffle(_RAIter __begin,
- _RAIter __end,
- _RandomNumberGenerator __rng = _RandomNumber())
- {
- typedef std::iterator_traits<_RAIter> _TraitsType;
- typedef typename _TraitsType::difference_type _DifferenceType;
- _DifferenceType __n = __end - __begin;
- __parallel_random_shuffle_drs(
- __begin, __end, __n, __get_max_threads(), __rng) ;
- }
+ if (__num_bins > 1)
+ {
+ _ValueType* __target =
+ static_cast<_ValueType*>(::operator new(sizeof(_ValueType) * __n));
+ _BinIndex* __oracles = new _BinIndex[__n];
+ _DifferenceType* __dist0 = new _DifferenceType[__num_bins + 1],
+ * __dist1 = new _DifferenceType[__num_bins + 1];
+
+ for (int __b = 0; __b < __num_bins + 1; ++__b)
+ __dist0[__b] = 0;
+
+ _RandomNumber __bitrng(__rng(0xFFFFFFFF));
+ for (_DifferenceType __i = 0; __i < __n; ++__i)
+ {
+ _BinIndex __oracle = __random_number_pow2(__num_bits, __bitrng);
+ __oracles[__i] = __oracle;
+
+ // To allow prefix (partial) sum.
+ ++(__dist0[__oracle + 1]);
+ }
+
+ // Sum up bins.
+ __gnu_sequential::partial_sum(__dist0, __dist0 + __num_bins + 1,
+ __dist0);
+
+ for (int __b = 0; __b < __num_bins + 1; ++__b)
+ __dist1[__b] = __dist0[__b];
+
+ // Distribute according to oracles.
+ for (_DifferenceType __i = 0; __i < __n; ++__i)
+ ::new(&(__target[(__dist0[__oracles[__i]])++]))
+ _ValueType(*(__begin + __i));
+
+ for (int __b = 0; __b < __num_bins; ++__b)
+ __sequential_random_shuffle(__target + __dist1[__b],
+ __target + __dist1[__b + 1], __rng);
+
+ // Copy elements back.
+ std::copy(__target, __target + __n, __begin);
+
+ delete[] __dist0;
+ delete[] __dist1;
+ delete[] __oracles;
+ ::operator delete(__target);
+ }
+ else
+ __gnu_sequential::random_shuffle(__begin, __end, __rng);
+ }
+
+ /** @brief Parallel random public call.
+ * @param __begin Begin iterator of sequence.
+ * @param __end End iterator of sequence.
+ * @param __rng Random number generator to use.
+ */
+ template<typename _RAIter, typename _RandomNumberGenerator>
+ inline void
+ __parallel_random_shuffle(_RAIter __begin, _RAIter __end,
+ _RandomNumberGenerator __rng = _RandomNumber())
+ {
+ typedef std::iterator_traits<_RAIter> _TraitsType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
+ _DifferenceType __n = __end - __begin;
+ __parallel_random_shuffle_drs(__begin, __end, __n,
+ __get_max_threads(), __rng);
+ }
}
#endif /* _GLIBCXX_PARALLEL_RANDOM_SHUFFLE_H */
diff --git a/libstdc++-v3/include/parallel/search.h b/libstdc++-v3/include/parallel/search.h
index 1fc8ceaa5c8..9709925618d 100644
--- a/libstdc++-v3/include/parallel/search.h
+++ b/libstdc++-v3/include/parallel/search.h
@@ -38,7 +38,6 @@
#include <parallel/parallel.h>
#include <parallel/equally_split.h>
-
namespace __gnu_parallel
{
/**
@@ -47,24 +46,24 @@ namespace __gnu_parallel
* @param __length Length of sequence to search for.
* @param __advances Returned __offsets.
*/
-template<typename _RAIter, typename _DifferenceTp>
- void
- __calc_borders(_RAIter __elements, _DifferenceTp __length,
- _DifferenceTp* __off)
- {
- typedef _DifferenceTp _DifferenceType;
-
- __off[0] = -1;
- if (__length > 1)
- __off[1] = 0;
- _DifferenceType __k = 0;
- for (_DifferenceType __j = 2; __j <= __length; __j++)
- {
- while ((__k >= 0) && !(__elements[__k] == __elements[__j-1]))
- __k = __off[__k];
- __off[__j] = ++__k;
- }
- }
+ template<typename _RAIter, typename _DifferenceTp>
+ void
+ __calc_borders(_RAIter __elements, _DifferenceTp __length,
+ _DifferenceTp* __off)
+ {
+ typedef _DifferenceTp _DifferenceType;
+
+ __off[0] = -1;
+ if (__length > 1)
+ __off[1] = 0;
+ _DifferenceType __k = 0;
+ for (_DifferenceType __j = 2; __j <= __length; __j++)
+ {
+ while ((__k >= 0) && !(__elements[__k] == __elements[__j-1]))
+ __k = __off[__k];
+ __off[__j] = ++__k;
+ }
+ }
// Generic parallel find algorithm (requires random access iterator).
@@ -75,100 +74,99 @@ template<typename _RAIter, typename _DifferenceTp>
* @param __end2 End iterator of second sequence.
* @param __pred Find predicate.
* @return Place of finding in first sequences. */
-template<typename __RAIter1,
- typename __RAIter2,
- typename _Pred>
- __RAIter1
- __search_template(__RAIter1 __begin1, __RAIter1 __end1,
- __RAIter2 __begin2, __RAIter2 __end2,
- _Pred __pred)
- {
- typedef std::iterator_traits<__RAIter1> _TraitsType;
- typedef typename _TraitsType::difference_type _DifferenceType;
+ template<typename __RAIter1,
+ typename __RAIter2,
+ typename _Pred>
+ __RAIter1
+ __search_template(__RAIter1 __begin1, __RAIter1 __end1,
+ __RAIter2 __begin2, __RAIter2 __end2,
+ _Pred __pred)
+ {
+ typedef std::iterator_traits<__RAIter1> _TraitsType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
- _GLIBCXX_CALL((__end1 - __begin1) + (__end2 - __begin2));
+ _GLIBCXX_CALL((__end1 - __begin1) + (__end2 - __begin2));
- _DifferenceType __pattern_length = __end2 - __begin2;
+ _DifferenceType __pattern_length = __end2 - __begin2;
- // Pattern too short.
- if(__pattern_length <= 0)
- return __end1;
+ // Pattern too short.
+ if(__pattern_length <= 0)
+ return __end1;
- // Last point to start search.
- _DifferenceType __input_length = (__end1 - __begin1) - __pattern_length;
+ // Last point to start search.
+ _DifferenceType __input_length = (__end1 - __begin1) - __pattern_length;
- // Where is first occurrence of pattern? defaults to end.
- _DifferenceType __result = (__end1 - __begin1);
- _DifferenceType *__splitters;
+ // Where is first occurrence of pattern? defaults to end.
+ _DifferenceType __result = (__end1 - __begin1);
+ _DifferenceType *__splitters;
- // Pattern too long.
- if (__input_length < 0)
- return __end1;
+ // Pattern too long.
+ if (__input_length < 0)
+ return __end1;
- omp_lock_t __result_lock;
- omp_init_lock(&__result_lock);
+ omp_lock_t __result_lock;
+ omp_init_lock(&__result_lock);
- _ThreadIndex __num_threads =
- std::max<_DifferenceType>(1,
- std::min<_DifferenceType>(__input_length, __get_max_threads()));
+ _ThreadIndex __num_threads = std::max<_DifferenceType>
+ (1, std::min<_DifferenceType>(__input_length,
+ __get_max_threads()));
- _DifferenceType __advances[__pattern_length];
- __calc_borders(__begin2, __pattern_length, __advances);
+ _DifferenceType __advances[__pattern_length];
+ __calc_borders(__begin2, __pattern_length, __advances);
-# pragma omp parallel num_threads(__num_threads)
+# pragma omp parallel num_threads(__num_threads)
{
# pragma omp single
- {
- __num_threads = omp_get_num_threads();
- __splitters = new _DifferenceType[__num_threads + 1];
- equally_split(__input_length, __num_threads, __splitters);
- }
-
- _ThreadIndex __iam = omp_get_thread_num();
-
- _DifferenceType __start = __splitters[__iam],
- __stop = __splitters[__iam + 1];
-
- _DifferenceType __pos_in_pattern = 0;
- bool __found_pattern = false;
-
- while (__start <= __stop && !__found_pattern)
- {
- // Get new value of result.
- #pragma omp flush(__result)
- // No chance for this thread to find first occurrence.
- if (__result < __start)
- break;
- while (__pred(__begin1[__start + __pos_in_pattern],
- __begin2[__pos_in_pattern]))
- {
- ++__pos_in_pattern;
- if (__pos_in_pattern == __pattern_length)
- {
- // Found new candidate for result.
- omp_set_lock(&__result_lock);
- __result = std::min(__result, __start);
- omp_unset_lock(&__result_lock);
-
- __found_pattern = true;
- break;
- }
- }
- // Make safe jump.
- __start += (__pos_in_pattern - __advances[__pos_in_pattern]);
- __pos_in_pattern =
- (__advances[__pos_in_pattern] < 0) ?
- 0 : __advances[__pos_in_pattern];
- }
+ {
+ __num_threads = omp_get_num_threads();
+ __splitters = new _DifferenceType[__num_threads + 1];
+ equally_split(__input_length, __num_threads, __splitters);
+ }
+
+ _ThreadIndex __iam = omp_get_thread_num();
+
+ _DifferenceType __start = __splitters[__iam],
+ __stop = __splitters[__iam + 1];
+
+ _DifferenceType __pos_in_pattern = 0;
+ bool __found_pattern = false;
+
+ while (__start <= __stop && !__found_pattern)
+ {
+ // Get new value of result.
+#pragma omp flush(__result)
+ // No chance for this thread to find first occurrence.
+ if (__result < __start)
+ break;
+ while (__pred(__begin1[__start + __pos_in_pattern],
+ __begin2[__pos_in_pattern]))
+ {
+ ++__pos_in_pattern;
+ if (__pos_in_pattern == __pattern_length)
+ {
+ // Found new candidate for result.
+ omp_set_lock(&__result_lock);
+ __result = std::min(__result, __start);
+ omp_unset_lock(&__result_lock);
+
+ __found_pattern = true;
+ break;
+ }
+ }
+ // Make safe jump.
+ __start += (__pos_in_pattern - __advances[__pos_in_pattern]);
+ __pos_in_pattern = (__advances[__pos_in_pattern] < 0
+ ? 0 : __advances[__pos_in_pattern]);
+ }
} //parallel
- omp_destroy_lock(&__result_lock);
-
- delete[] __splitters;
+ omp_destroy_lock(&__result_lock);
- // Return iterator on found element.
- return (__begin1 + __result);
- }
+ delete[] __splitters;
+
+ // Return iterator on found element.
+ return (__begin1 + __result);
+ }
} // end namespace
#endif /* _GLIBCXX_PARALLEL_SEARCH_H */
diff --git a/libstdc++-v3/include/parallel/set_operations.h b/libstdc++-v3/include/parallel/set_operations.h
index ac669c55d5d..6dd63c9b128 100644
--- a/libstdc++-v3/include/parallel/set_operations.h
+++ b/libstdc++-v3/include/parallel/set_operations.h
@@ -41,490 +41,489 @@
namespace __gnu_parallel
{
-template<typename _IIter, typename _OutputIterator>
- _OutputIterator
- copy_tail(std::pair<_IIter, _IIter> __b,
- std::pair<_IIter, _IIter> __e, _OutputIterator __r)
- {
- if (__b.first != __e.first)
+ template<typename _IIter, typename _OutputIterator>
+ _OutputIterator
+ __copy_tail(std::pair<_IIter, _IIter> __b,
+ std::pair<_IIter, _IIter> __e, _OutputIterator __r)
+ {
+ if (__b.first != __e.first)
+ {
+ do
+ {
+ *__r++ = *__b.first++;
+ }
+ while (__b.first != __e.first);
+ }
+ else
+ {
+ while (__b.second != __e.second)
+ *__r++ = *__b.second++;
+ }
+ return __r;
+ }
+
+ template<typename _IIter,
+ typename _OutputIterator,
+ typename _Compare>
+ struct __symmetric_difference_func
+ {
+ typedef std::iterator_traits<_IIter> _TraitsType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
+ typedef typename std::pair<_IIter, _IIter> _IteratorPair;
+
+ __symmetric_difference_func(_Compare __comp) : _M_comp(__comp) {}
+
+ _Compare _M_comp;
+
+ _OutputIterator
+ _M_invoke(_IIter __a, _IIter __b, _IIter __c, _IIter __d,
+ _OutputIterator __r) const
{
- do
+ while (__a != __b && __c != __d)
{
- *__r++ = *__b.first++;
+ if (_M_comp(*__a, *__c))
+ {
+ *__r = *__a;
+ ++__a;
+ ++__r;
+ }
+ else if (_M_comp(*__c, *__a))
+ {
+ *__r = *__c;
+ ++__c;
+ ++__r;
+ }
+ else
+ {
+ ++__a;
+ ++__c;
+ }
}
- while (__b.first != __e.first);
+ return std::copy(__c, __d, std::copy(__a, __b, __r));
}
- else
+
+ _DifferenceType
+ __count(_IIter __a, _IIter __b, _IIter __c, _IIter d) const
{
- while (__b.second != __e.second)
- *__r++ = *__b.second++;
+ _DifferenceType __counter = 0;
+
+ while (__a != __b && __c != d)
+ {
+ if (_M_comp(*__a, *__c))
+ {
+ ++__a;
+ ++__counter;
+ }
+ else if (_M_comp(*__c, *__a))
+ {
+ ++__c;
+ ++__counter;
+ }
+ else
+ {
+ ++__a;
+ ++__c;
+ }
+ }
+
+ return __counter + (__b - __a) + (d - __c);
}
- return __r;
- }
-template<typename _IIter,
- typename _OutputIterator,
- typename _Compare>
- struct symmetric_difference_func
- {
- typedef std::iterator_traits<_IIter> _TraitsType;
- typedef typename _TraitsType::difference_type _DifferenceType;
- typedef typename std::pair<_IIter, _IIter> _IteratorPair;
+ _OutputIterator
+ __first_empty(_IIter __c, _IIter d, _OutputIterator __out) const
+ { return std::copy(__c, d, __out); }
- symmetric_difference_func(_Compare __comp) : _M_comp(__comp) {}
+ _OutputIterator
+ __second_empty(_IIter __a, _IIter __b, _OutputIterator __out) const
+ { return std::copy(__a, __b, __out); }
+ };
- _Compare _M_comp;
- _OutputIterator
- _M_invoke(_IIter __a, _IIter __b,
- _IIter __c, _IIter d,
- _OutputIterator __r) const
+ template<typename _IIter,
+ typename _OutputIterator,
+ typename _Compare>
+ struct __difference_func
{
- while (__a != __b && __c != d)
- {
- if (_M_comp(*__a, *__c))
- {
- *__r = *__a;
- ++__a;
- ++__r;
- }
- else if (_M_comp(*__c, *__a))
- {
- *__r = *__c;
- ++__c;
- ++__r;
- }
- else
- {
- ++__a;
- ++__c;
- }
- }
- return std::copy(__c, d, std::copy(__a, __b, __r));
- }
+ typedef std::iterator_traits<_IIter> _TraitsType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
+ typedef typename std::pair<_IIter, _IIter> _IteratorPair;
- _DifferenceType
- __count(_IIter __a, _IIter __b,
- _IIter __c, _IIter d) const
- {
- _DifferenceType __counter = 0;
+ __difference_func(_Compare __comp) : _M_comp(__comp) {}
- while (__a != __b && __c != d)
- {
- if (_M_comp(*__a, *__c))
- {
- ++__a;
- ++__counter;
- }
- else if (_M_comp(*__c, *__a))
- {
- ++__c;
- ++__counter;
- }
- else
- {
- ++__a;
- ++__c;
- }
- }
+ _Compare _M_comp;
- return __counter + (__b - __a) + (d - __c);
- }
+ _OutputIterator
+ _M_invoke(_IIter __a, _IIter __b, _IIter __c, _IIter d,
+ _OutputIterator __r) const
+ {
+ while (__a != __b && __c != d)
+ {
+ if (_M_comp(*__a, *__c))
+ {
+ *__r = *__a;
+ ++__a;
+ ++__r;
+ }
+ else if (_M_comp(*__c, *__a))
+ { ++__c; }
+ else
+ {
+ ++__a;
+ ++__c;
+ }
+ }
+ return std::copy(__a, __b, __r);
+ }
- _OutputIterator
- __first_empty(_IIter __c, _IIter d, _OutputIterator __out) const
- { return std::copy(__c, d, __out); }
+ _DifferenceType
+ __count(_IIter __a, _IIter __b,
+ _IIter __c, _IIter d) const
+ {
+ _DifferenceType __counter = 0;
- _OutputIterator
- __second_empty(_IIter __a, _IIter __b, _OutputIterator __out) const
- { return std::copy(__a, __b, __out); }
- };
+ while (__a != __b && __c != d)
+ {
+ if (_M_comp(*__a, *__c))
+ {
+ ++__a;
+ ++__counter;
+ }
+ else if (_M_comp(*__c, *__a))
+ { ++__c; }
+ else
+ { ++__a; ++__c; }
+ }
+ return __counter + (__b - __a);
+ }
-template<typename _IIter,
- typename _OutputIterator,
- typename _Compare>
- struct __difference_func
- {
- typedef std::iterator_traits<_IIter> _TraitsType;
- typedef typename _TraitsType::difference_type _DifferenceType;
- typedef typename std::pair<_IIter, _IIter> _IteratorPair;
+ _OutputIterator
+ __first_empty(_IIter, _IIter, _OutputIterator __out) const
+ { return __out; }
- __difference_func(_Compare __comp) : _M_comp(__comp) {}
+ _OutputIterator
+ __second_empty(_IIter __a, _IIter __b, _OutputIterator __out) const
+ { return std::copy(__a, __b, __out); }
+ };
- _Compare _M_comp;
- _OutputIterator
- _M_invoke(_IIter __a, _IIter __b, _IIter __c, _IIter d,
- _OutputIterator __r) const
+ template<typename _IIter,
+ typename _OutputIterator,
+ typename _Compare>
+ struct __intersection_func
{
- while (__a != __b && __c != d)
- {
- if (_M_comp(*__a, *__c))
- {
- *__r = *__a;
- ++__a;
- ++__r;
- }
- else if (_M_comp(*__c, *__a))
- { ++__c; }
- else
- {
- ++__a;
- ++__c;
- }
- }
- return std::copy(__a, __b, __r);
- }
+ typedef std::iterator_traits<_IIter> _TraitsType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
+ typedef typename std::pair<_IIter, _IIter> _IteratorPair;
- _DifferenceType
- __count(_IIter __a, _IIter __b,
- _IIter __c, _IIter d) const
- {
- _DifferenceType __counter = 0;
+ __intersection_func(_Compare __comp) : _M_comp(__comp) {}
- while (__a != __b && __c != d)
- {
- if (_M_comp(*__a, *__c))
- {
- ++__a;
- ++__counter;
- }
- else if (_M_comp(*__c, *__a))
- { ++__c; }
- else
- { ++__a; ++__c; }
- }
+ _Compare _M_comp;
- return __counter + (__b - __a);
- }
+ _OutputIterator
+ _M_invoke(_IIter __a, _IIter __b, _IIter __c, _IIter __d,
+ _OutputIterator __r) const
+ {
+ while (__a != __b && __c != __d)
+ {
+ if (_M_comp(*__a, *__c))
+ { ++__a; }
+ else if (_M_comp(*__c, *__a))
+ { ++__c; }
+ else
+ {
+ *__r = *__a;
+ ++__a;
+ ++__c;
+ ++__r;
+ }
+ }
- inline _OutputIterator
- __first_empty(_IIter __c, _IIter d, _OutputIterator __out) const
- { return __out; }
+ return __r;
+ }
- inline _OutputIterator
- __second_empty(_IIter __a, _IIter __b, _OutputIterator __out) const
- { return std::copy(__a, __b, __out); }
- };
+ _DifferenceType
+ __count(_IIter __a, _IIter __b, _IIter __c, _IIter __d) const
+ {
+ _DifferenceType __counter = 0;
+ while (__a != __b && __c != __d)
+ {
+ if (_M_comp(*__a, *__c))
+ { ++__a; }
+ else if (_M_comp(*__c, *__a))
+ { ++__c; }
+ else
+ {
+ ++__a;
+ ++__c;
+ ++__counter;
+ }
+ }
-template<typename _IIter,
- typename _OutputIterator,
- typename _Compare>
- struct __intersection_func
- {
- typedef std::iterator_traits<_IIter> _TraitsType;
- typedef typename _TraitsType::difference_type _DifferenceType;
- typedef typename std::pair<_IIter, _IIter> _IteratorPair;
+ return __counter;
+ }
- __intersection_func(_Compare __comp) : _M_comp(__comp) {}
+ _OutputIterator
+ __first_empty(_IIter, _IIter, _OutputIterator __out) const
+ { return __out; }
- _Compare _M_comp;
+ _OutputIterator
+ __second_empty(_IIter, _IIter, _OutputIterator __out) const
+ { return __out; }
+ };
- _OutputIterator
- _M_invoke(_IIter __a, _IIter __b, _IIter __c, _IIter d,
- _OutputIterator __r) const
+ template<class _IIter, class _OutputIterator, class _Compare>
+ struct __union_func
{
- while (__a != __b && __c != d)
- {
- if (_M_comp(*__a, *__c))
- { ++__a; }
- else if (_M_comp(*__c, *__a))
- { ++__c; }
- else
- {
- *__r = *__a;
- ++__a;
- ++__c;
- ++__r;
- }
- }
+ typedef typename std::iterator_traits<_IIter>::difference_type
+ _DifferenceType;
- return __r;
- }
+ __union_func(_Compare __comp) : _M_comp(__comp) {}
- _DifferenceType
- __count(_IIter __a, _IIter __b,
- _IIter __c, _IIter d) const
- {
- _DifferenceType __counter = 0;
-
- while (__a != __b && __c != d)
- {
- if (_M_comp(*__a, *__c))
- { ++__a; }
- else if (_M_comp(*__c, *__a))
- { ++__c; }
- else
- {
- ++__a;
- ++__c;
- ++__counter;
- }
- }
+ _Compare _M_comp;
- return __counter;
- }
+ _OutputIterator
+ _M_invoke(_IIter __a, const _IIter __b, _IIter __c,
+ const _IIter __d, _OutputIterator __r) const
+ {
+ while (__a != __b && __c != __d)
+ {
+ if (_M_comp(*__a, *__c))
+ {
+ *__r = *__a;
+ ++__a;
+ }
+ else if (_M_comp(*__c, *__a))
+ {
+ *__r = *__c;
+ ++__c;
+ }
+ else
+ {
+ *__r = *__a;
+ ++__a;
+ ++__c;
+ }
+ ++__r;
+ }
+ return std::copy(__c, __d, std::copy(__a, __b, __r));
+ }
- inline _OutputIterator
- __first_empty(_IIter __c, _IIter d, _OutputIterator __out) const
- { return __out; }
+ _DifferenceType
+ __count(_IIter __a, _IIter __b, _IIter __c, _IIter __d) const
+ {
+ _DifferenceType __counter = 0;
- inline _OutputIterator
- __second_empty(_IIter __a, _IIter __b, _OutputIterator __out) const
- { return __out; }
- };
+ while (__a != __b && __c != __d)
+ {
+ if (_M_comp(*__a, *__c))
+ { ++__a; }
+ else if (_M_comp(*__c, *__a))
+ { ++__c; }
+ else
+ {
+ ++__a;
+ ++__c;
+ }
+ ++__counter;
+ }
-template<class _IIter, class _OutputIterator, class _Compare>
- struct __union_func
- {
- typedef typename std::iterator_traits<_IIter>::difference_type
- _DifferenceType;
+ __counter += (__b - __a);
+ __counter += (__d - __c);
+ return __counter;
+ }
- __union_func(_Compare __comp) : _M_comp(__comp) {}
+ _OutputIterator
+ __first_empty(_IIter __c, _IIter __d, _OutputIterator __out) const
+ { return std::copy(__c, __d, __out); }
- _Compare _M_comp;
+ _OutputIterator
+ __second_empty(_IIter __a, _IIter __b, _OutputIterator __out) const
+ { return std::copy(__a, __b, __out); }
+ };
+ template<typename _IIter,
+ typename _OutputIterator,
+ typename Operation>
_OutputIterator
- _M_invoke(_IIter __a, const _IIter __b, _IIter __c,
- const _IIter d, _OutputIterator __r) const
+ __parallel_set_operation(_IIter __begin1, _IIter __end1,
+ _IIter __begin2, _IIter __end2,
+ _OutputIterator __result, Operation __op)
{
- while (__a != __b && __c != d)
- {
- if (_M_comp(*__a, *__c))
- {
- *__r = *__a;
- ++__a;
- }
- else if (_M_comp(*__c, *__a))
- {
- *__r = *__c;
- ++__c;
- }
- else
- {
- *__r = *__a;
- ++__a;
- ++__c;
- }
- ++__r;
- }
- return std::copy(__c, d, std::copy(__a, __b, __r));
- }
+ _GLIBCXX_CALL((__end1 - __begin1) + (__end2 - __begin2))
- _DifferenceType
- __count(_IIter __a, _IIter __b,
- _IIter __c, _IIter d) const
- {
- _DifferenceType __counter = 0;
-
- while (__a != __b && __c != d)
- {
- if (_M_comp(*__a, *__c))
- { ++__a; }
- else if (_M_comp(*__c, *__a))
- { ++__c; }
- else
- {
- ++__a;
- ++__c;
- }
- ++__counter;
- }
+ typedef std::iterator_traits<_IIter> _TraitsType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
+ typedef typename std::pair<_IIter, _IIter> _IteratorPair;
- __counter += (__b - __a);
- __counter += (d - __c);
- return __counter;
- }
+ if (__begin1 == __end1)
+ return __op.__first_empty(__begin2, __end2, __result);
- inline _OutputIterator
- __first_empty(_IIter __c, _IIter d, _OutputIterator __out) const
- { return std::copy(__c, d, __out); }
+ if (__begin2 == __end2)
+ return __op.__second_empty(__begin1, __end1, __result);
- inline _OutputIterator
- __second_empty(_IIter __a, _IIter __b, _OutputIterator __out) const
- { return std::copy(__a, __b, __out); }
- };
-
-template<typename _IIter,
- typename _OutputIterator,
- typename Operation>
- _OutputIterator
- __parallel_set_operation(_IIter __begin1, _IIter __end1,
- _IIter __begin2, _IIter __end2,
- _OutputIterator __result, Operation __op)
- {
- _GLIBCXX_CALL((__end1 - __begin1) + (__end2 - __begin2))
-
- typedef std::iterator_traits<_IIter> _TraitsType;
- typedef typename _TraitsType::difference_type _DifferenceType;
- typedef typename std::pair<_IIter, _IIter> _IteratorPair;
-
- if (__begin1 == __end1)
- return __op.__first_empty(__begin2, __end2, __result);
-
- if (__begin2 == __end2)
- return __op.__second_empty(__begin1, __end1, __result);
-
- const _DifferenceType size = (__end1 - __begin1) + (__end2 - __begin2);
-
- const _IteratorPair __sequence[ 2 ] =
- { std::make_pair(__begin1, __end1), std::make_pair(__begin2, __end2) };
- _OutputIterator return_value = __result;
- _DifferenceType *__borders;
- _IteratorPair *__block_begins;
- _DifferenceType* __lengths;
-
- _ThreadIndex __num_threads =
- std::min<_DifferenceType>(__get_max_threads(),
- std::min(__end1 - __begin1, __end2 - __begin2));
-
-# pragma omp parallel num_threads(__num_threads)
+ const _DifferenceType __size = (__end1 - __begin1) + (__end2 - __begin2);
+
+ const _IteratorPair __sequence[2] = { std::make_pair(__begin1, __end1),
+ std::make_pair(__begin2, __end2) };
+ _OutputIterator __return_value = __result;
+ _DifferenceType *__borders;
+ _IteratorPair *__block_begins;
+ _DifferenceType* __lengths;
+
+ _ThreadIndex __num_threads =
+ std::min<_DifferenceType>(__get_max_threads(),
+ std::min(__end1 - __begin1, __end2 - __begin2));
+
+# pragma omp parallel num_threads(__num_threads)
{
# pragma omp single
- {
- __num_threads = omp_get_num_threads();
-
- __borders = new _DifferenceType[__num_threads + 2];
- equally_split(size, __num_threads + 1, __borders);
- __block_begins = new _IteratorPair[__num_threads + 1];
- // Very __start.
- __block_begins[0] = std::make_pair(__begin1, __begin2);
- __lengths = new _DifferenceType[__num_threads];
- } //single
-
- _ThreadIndex __iam = omp_get_thread_num();
-
- // _Result from multiseq_partition.
- _IIter __offset[2];
- const _DifferenceType __rank = __borders[__iam + 1];
-
- multiseq_partition(__sequence, __sequence + 2,
- __rank, __offset, __op._M_comp);
-
- // allowed to read?
- // together
- // *(__offset[ 0 ] - 1) == *__offset[ 1 ]
- if (__offset[ 0 ] != __begin1 && __offset[ 1 ] != __end2
- && !__op._M_comp(*(__offset[ 0 ] - 1), *__offset[ 1 ])
- && !__op._M_comp(*__offset[ 1 ], *(__offset[ 0 ] - 1)))
- {
- // Avoid split between globally equal elements: move one to
- // front in first sequence.
- --__offset[ 0 ];
- }
-
- _IteratorPair block_end = __block_begins[ __iam + 1 ] =
- _IteratorPair(__offset[ 0 ], __offset[ 1 ]);
+ {
+ __num_threads = omp_get_num_threads();
+
+ __borders = new _DifferenceType[__num_threads + 2];
+ equally_split(__size, __num_threads + 1, __borders);
+ __block_begins = new _IteratorPair[__num_threads + 1];
+ // Very __start.
+ __block_begins[0] = std::make_pair(__begin1, __begin2);
+ __lengths = new _DifferenceType[__num_threads];
+ } //single
+
+ _ThreadIndex __iam = omp_get_thread_num();
+
+ // _Result from multiseq_partition.
+ _IIter __offset[2];
+ const _DifferenceType __rank = __borders[__iam + 1];
+
+ multiseq_partition(__sequence, __sequence + 2,
+ __rank, __offset, __op._M_comp);
+
+ // allowed to read?
+ // together
+ // *(__offset[ 0 ] - 1) == *__offset[ 1 ]
+ if (__offset[ 0 ] != __begin1 && __offset[1] != __end2
+ && !__op._M_comp(*(__offset[0] - 1), *__offset[1])
+ && !__op._M_comp(*__offset[1], *(__offset[0] - 1)))
+ {
+ // Avoid split between globally equal elements: move one to
+ // front in first sequence.
+ --__offset[0];
+ }
+
+ _IteratorPair __block_end = __block_begins[__iam + 1] =
+ _IteratorPair(__offset[0], __offset[1]);
+
+ // Make sure all threads have their block_begin result written out.
+# pragma omp barrier
- // Make sure all threads have their block_begin result written out.
+ _IteratorPair __block_begin = __block_begins[__iam];
+
+ // Begin working for the first block, while the others except
+ // the last start to count.
+ if (__iam == 0)
+ {
+ // The first thread can copy already.
+ __lengths[ __iam ] =
+ __op._M_invoke(__block_begin.first, __block_end.first,
+ __block_begin.second, __block_end.second,
+ __result) - __result;
+ }
+ else
+ {
+ __lengths[ __iam ] =
+ __op.__count(__block_begin.first, __block_end.first,
+ __block_begin.second, __block_end.second);
+ }
+
+ // Make sure everyone wrote their lengths.
# pragma omp barrier
- _IteratorPair __block_begin = __block_begins[ __iam ];
+ _OutputIterator __r = __result;
- // Begin working for the first block, while the others except
- // the last start to count.
- if (__iam == 0)
- {
- // The first thread can copy already.
- __lengths[ __iam ] =
- __op._M_invoke(__block_begin.first, block_end.first,
- __block_begin.second, block_end.second, __result)
- - __result;
- }
- else
- {
- __lengths[ __iam ] =
- __op.__count(__block_begin.first, block_end.first,
- __block_begin.second, block_end.second);
- }
+ if (__iam == 0)
+ {
+ // Do the last block.
+ for (int __i = 0; __i < __num_threads; ++__i)
+ __r += __lengths[__i];
- // Make sure everyone wrote their lengths.
-# pragma omp barrier
+ __block_begin = __block_begins[__num_threads];
- _OutputIterator __r = __result;
+ // Return the result iterator of the last block.
+ __return_value =
+ __op._M_invoke(__block_begin.first, __end1,
+ __block_begin.second, __end2, __r);
- if (__iam == 0)
- {
- // Do the last block.
- for (int __i = 0; __i < __num_threads; ++__i)
- __r += __lengths[__i];
+ }
+ else
+ {
+ for (int __i = 0; __i < __iam; ++__i)
+ __r += __lengths[ __i ];
- __block_begin = __block_begins[__num_threads];
+ // Reset begins for copy pass.
+ __op._M_invoke(__block_begin.first, __block_end.first,
+ __block_begin.second, __block_end.second, __r);
+ }
+ }
+ return __return_value;
+ }
- // Return the result iterator of the last block.
- return_value = __op._M_invoke(
- __block_begin.first, __end1, __block_begin.second, __end2, __r);
+ template<typename _IIter,
+ typename _OutputIterator,
+ typename _Compare>
+ inline _OutputIterator
+ __parallel_set_union(_IIter __begin1, _IIter __end1,
+ _IIter __begin2, _IIter __end2,
+ _OutputIterator __result, _Compare __comp)
+ {
+ return __parallel_set_operation(__begin1, __end1, __begin2, __end2,
+ __result,
+ __union_func< _IIter, _OutputIterator,
+ _Compare>(__comp));
+ }
- }
- else
- {
- for (int __i = 0; __i < __iam; ++__i)
- __r += __lengths[ __i ];
+ template<typename _IIter,
+ typename _OutputIterator,
+ typename _Compare>
+ inline _OutputIterator
+ __parallel_set_intersection(_IIter __begin1, _IIter __end1,
+ _IIter __begin2, _IIter __end2,
+ _OutputIterator __result, _Compare __comp)
+ {
+ return __parallel_set_operation(__begin1, __end1, __begin2, __end2,
+ __result,
+ __intersection_func<_IIter,
+ _OutputIterator, _Compare>(__comp));
+ }
- // Reset begins for copy pass.
- __op._M_invoke(__block_begin.first, block_end.first,
- __block_begin.second, block_end.second, __r);
- }
- }
- return return_value;
- }
-
-
-template<typename _IIter,
- typename _OutputIterator,
- typename _Compare>
- inline _OutputIterator
- __parallel_set_union(_IIter __begin1, _IIter __end1,
- _IIter __begin2, _IIter __end2,
- _OutputIterator __result, _Compare _M_comp)
- {
- return __parallel_set_operation(__begin1, __end1, __begin2, __end2,
- __result, __union_func< _IIter, _OutputIterator, _Compare>(_M_comp));
- }
-
-template<typename _IIter,
- typename _OutputIterator,
- typename _Compare>
- inline _OutputIterator
- __parallel_set_intersection(_IIter __begin1, _IIter __end1,
+ template<typename _IIter,
+ typename _OutputIterator,
+ typename _Compare>
+ inline _OutputIterator
+ __parallel_set_difference(_IIter __begin1, _IIter __end1,
_IIter __begin2, _IIter __end2,
- _OutputIterator __result, _Compare _M_comp)
- {
- return __parallel_set_operation(
- __begin1, __end1, __begin2, __end2, __result,
- __intersection_func<_IIter, _OutputIterator, _Compare>(_M_comp));
- }
-
-template<typename _IIter,
- typename _OutputIterator,
- typename _Compare>
- inline _OutputIterator
- __parallel_set_difference(_IIter __begin1, _IIter __end1,
- _IIter __begin2, _IIter __end2,
- _OutputIterator __result, _Compare _M_comp)
- {
- return __parallel_set_operation(
- __begin1, __end1, __begin2, __end2, __result,
- __difference_func<_IIter, _OutputIterator, _Compare>(_M_comp));
- }
-
-template<typename _IIter,
- typename _OutputIterator,
- typename _Compare>
- inline _OutputIterator
- __parallel_set_symmetric_difference(_IIter __begin1, _IIter __end1,
- _IIter __begin2, _IIter __end2,
- _OutputIterator __result,
- _Compare _M_comp)
- {
- return __parallel_set_operation(
- __begin1, __end1, __begin2, __end2, __result,
- symmetric_difference_func<_IIter, _OutputIterator, _Compare>
- (_M_comp));
- }
+ _OutputIterator __result, _Compare __comp)
+ {
+ return __parallel_set_operation(__begin1, __end1, __begin2, __end2,
+ __result,
+ __difference_func<_IIter,
+ _OutputIterator, _Compare>(__comp));
+ }
+ template<typename _IIter,
+ typename _OutputIterator,
+ typename _Compare>
+ inline _OutputIterator
+ __parallel_set_symmetric_difference(_IIter __begin1, _IIter __end1,
+ _IIter __begin2, _IIter __end2,
+ _OutputIterator __result,
+ _Compare __comp)
+ {
+ return __parallel_set_operation(__begin1, __end1, __begin2, __end2,
+ __result,
+ __symmetric_difference_func<_IIter,
+ _OutputIterator, _Compare>(__comp));
+ }
}
#endif /* _GLIBCXX_PARALLEL_SET_OPERATIONS_H */
diff --git a/libstdc++-v3/include/parallel/sort.h b/libstdc++-v3/include/parallel/sort.h
index 2d38cad4d96..f1a163c63b6 100644
--- a/libstdc++-v3/include/parallel/sort.h
+++ b/libstdc++-v3/include/parallel/sort.h
@@ -54,12 +54,12 @@
namespace __gnu_parallel
{
- //prototype
+ //prototype
template<bool __stable, typename _RAIter,
typename _Compare, typename _Parallelism>
- void
- __parallel_sort(_RAIter __begin, _RAIter __end,
- _Compare __comp, _Parallelism __parallelism);
+ void
+ __parallel_sort(_RAIter __begin, _RAIter __end,
+ _Compare __comp, _Parallelism __parallelism);
/**
* @brief Choose multiway mergesort, splitting variant at run-time,
@@ -70,19 +70,19 @@ namespace __gnu_parallel
* @callgraph
*/
template<bool __stable, typename _RAIter, typename _Compare>
- inline void
- __parallel_sort(_RAIter __begin, _RAIter __end,
- _Compare __comp, multiway_mergesort_tag __parallelism)
- {
- _GLIBCXX_CALL(__end - __begin)
+ inline void
+ __parallel_sort(_RAIter __begin, _RAIter __end,
+ _Compare __comp, multiway_mergesort_tag __parallelism)
+ {
+ _GLIBCXX_CALL(__end - __begin)
- if(_Settings::get().sort_splitting == EXACT)
- parallel_sort_mwms<__stable, true>
- (__begin, __end, __comp, __parallelism.__get_num_threads());
- else
- parallel_sort_mwms<__stable, false>
- (__begin, __end, __comp, __parallelism.__get_num_threads());
- }
+ if(_Settings::get().sort_splitting == EXACT)
+ parallel_sort_mwms<__stable, true>
+ (__begin, __end, __comp, __parallelism.__get_num_threads());
+ else
+ parallel_sort_mwms<__stable, false>
+ (__begin, __end, __comp, __parallelism.__get_num_threads());
+ }
/**
* @brief Choose multiway mergesort with exact splitting,
@@ -93,15 +93,16 @@ namespace __gnu_parallel
* @callgraph
*/
template<bool __stable, typename _RAIter, typename _Compare>
- inline void
- __parallel_sort(_RAIter __begin, _RAIter __end,
- _Compare __comp, multiway_mergesort_exact_tag __parallelism)
- {
- _GLIBCXX_CALL(__end - __begin)
+ inline void
+ __parallel_sort(_RAIter __begin, _RAIter __end,
+ _Compare __comp,
+ multiway_mergesort_exact_tag __parallelism)
+ {
+ _GLIBCXX_CALL(__end - __begin)
parallel_sort_mwms<__stable, true>
(__begin, __end, __comp, __parallelism.__get_num_threads());
- }
+ }
/**
* @brief Choose multiway mergesort with splitting by sampling,
@@ -112,15 +113,16 @@ namespace __gnu_parallel
* @callgraph
*/
template<bool __stable, typename _RAIter, typename _Compare>
- inline void
- __parallel_sort(_RAIter __begin, _RAIter __end,
- _Compare __comp, multiway_mergesort_sampling_tag __parallelism)
- {
- _GLIBCXX_CALL(__end - __begin)
+ inline void
+ __parallel_sort(_RAIter __begin, _RAIter __end,
+ _Compare __comp,
+ multiway_mergesort_sampling_tag __parallelism)
+ {
+ _GLIBCXX_CALL(__end - __begin)
- parallel_sort_mwms<__stable, false>
+ parallel_sort_mwms<__stable, false>
(__begin, __end, __comp, __parallelism.__get_num_threads());
- }
+ }
/**
* @brief Choose quicksort for parallel sorting.
@@ -130,17 +132,17 @@ namespace __gnu_parallel
* @callgraph
*/
template<bool __stable, typename _RAIter, typename _Compare>
- inline void
- __parallel_sort(_RAIter __begin, _RAIter __end,
- _Compare __comp, quicksort_tag __parallelism)
- {
- _GLIBCXX_CALL(__end - __begin)
+ inline void
+ __parallel_sort(_RAIter __begin, _RAIter __end,
+ _Compare __comp, quicksort_tag __parallelism)
+ {
+ _GLIBCXX_CALL(__end - __begin)
- _GLIBCXX_PARALLEL_ASSERT(__stable == false);
+ _GLIBCXX_PARALLEL_ASSERT(__stable == false);
- __parallel_sort_qs(__begin, __end, __comp,
- __parallelism.__get_num_threads());
- }
+ __parallel_sort_qs(__begin, __end, __comp,
+ __parallelism.__get_num_threads());
+ }
/**
* @brief Choose balanced quicksort for parallel sorting.
@@ -150,19 +152,18 @@ namespace __gnu_parallel
* @param __stable Sort __stable.
* @callgraph
*/
- template<bool __stable, typename _RAIter, typename _Compare>
- inline void
- __parallel_sort(_RAIter __begin, _RAIter __end,
- _Compare __comp, balanced_quicksort_tag __parallelism)
- {
- _GLIBCXX_CALL(__end - __begin)
-
- _GLIBCXX_PARALLEL_ASSERT(__stable == false);
+ template<bool __stable, typename _RAIter, typename _Compare>
+ inline void
+ __parallel_sort(_RAIter __begin, _RAIter __end,
+ _Compare __comp, balanced_quicksort_tag __parallelism)
+ {
+ _GLIBCXX_CALL(__end - __begin)
- __parallel_sort_qsb(__begin, __end, __comp,
- __parallelism.__get_num_threads());
- }
+ _GLIBCXX_PARALLEL_ASSERT(__stable == false);
+ __parallel_sort_qsb(__begin, __end, __comp,
+ __parallelism.__get_num_threads());
+ }
/**
* @brief Choose multiway mergesort with exact splitting,
@@ -173,17 +174,16 @@ namespace __gnu_parallel
* @callgraph
*/
template<bool __stable, typename _RAIter, typename _Compare>
- inline void
- __parallel_sort(_RAIter __begin, _RAIter __end,
- _Compare __comp, default_parallel_tag __parallelism)
- {
- _GLIBCXX_CALL(__end - __begin)
-
- __parallel_sort<__stable>
- (__begin, __end, __comp,
- multiway_mergesort_exact_tag(__parallelism.__get_num_threads()));
- }
+ inline void
+ __parallel_sort(_RAIter __begin, _RAIter __end,
+ _Compare __comp, default_parallel_tag __parallelism)
+ {
+ _GLIBCXX_CALL(__end - __begin)
+ __parallel_sort<__stable>
+ (__begin, __end, __comp,
+ multiway_mergesort_exact_tag(__parallelism.__get_num_threads()));
+ }
/**
* @brief Choose a parallel sorting algorithm.
@@ -196,7 +196,7 @@ namespace __gnu_parallel
template<bool __stable, typename _RAIter, typename _Compare>
inline void
__parallel_sort(_RAIter __begin, _RAIter __end,
- _Compare __comp, parallel_tag __parallelism)
+ _Compare __comp, parallel_tag __parallelism)
{
_GLIBCXX_CALL(__end - __begin)
typedef std::iterator_traits<_RAIter> _TraitsType;
diff --git a/libstdc++-v3/include/parallel/tags.h b/libstdc++-v3/include/parallel/tags.h
index 43561d28d5c..bc47b2699b4 100644
--- a/libstdc++-v3/include/parallel/tags.h
+++ b/libstdc++-v3/include/parallel/tags.h
@@ -51,20 +51,16 @@ namespace __gnu_parallel
public:
/** @brief Default constructor. Use default number of threads. */
parallel_tag()
- {
- this->_M_num_threads = 0;
- }
+ { _M_num_threads = 0; }
/** @brief Default constructor. Recommend number of threads to use.
* @param __num_threads Desired number of threads. */
parallel_tag(_ThreadIndex __num_threads)
- {
- this->_M_num_threads = __num_threads;
- }
+ { _M_num_threads = __num_threads; }
/** @brief Find out desired number of threads.
* @return Desired number of threads. */
- inline _ThreadIndex __get_num_threads()
+ _ThreadIndex __get_num_threads()
{
if(_M_num_threads == 0)
return omp_get_max_threads();
@@ -74,19 +70,17 @@ namespace __gnu_parallel
/** @brief Set the desired number of threads.
* @param __num_threads Desired number of threads. */
- inline void set_num_threads(_ThreadIndex __num_threads)
- {
- this->_M_num_threads = __num_threads;
- }
+ void set_num_threads(_ThreadIndex __num_threads)
+ { _M_num_threads = __num_threads; }
};
/** @brief Recommends parallel execution using the
default parallel algorithm. */
struct default_parallel_tag : public parallel_tag
{
- default_parallel_tag() { }
- default_parallel_tag(_ThreadIndex __num_threads)
- : parallel_tag(__num_threads) { }
+ default_parallel_tag() { }
+ default_parallel_tag(_ThreadIndex __num_threads)
+ : parallel_tag(__num_threads) { }
};
/** @brief Recommends parallel execution using dynamic
@@ -114,18 +108,18 @@ namespace __gnu_parallel
* with exact splitting, at compile time. */
struct exact_tag : public parallel_tag
{
- exact_tag() { }
- exact_tag(_ThreadIndex __num_threads)
- : parallel_tag(__num_threads) { }
+ exact_tag() { }
+ exact_tag(_ThreadIndex __num_threads)
+ : parallel_tag(__num_threads) { }
};
/** @brief Forces parallel merging
* with exact splitting, at compile time. */
struct sampling_tag : public parallel_tag
{
- sampling_tag() { }
- sampling_tag(_ThreadIndex __num_threads)
- : parallel_tag(__num_threads) { }
+ sampling_tag() { }
+ sampling_tag(_ThreadIndex __num_threads)
+ : parallel_tag(__num_threads) { }
};
@@ -133,45 +127,45 @@ namespace __gnu_parallel
* at compile time. */
struct multiway_mergesort_tag : public parallel_tag
{
- multiway_mergesort_tag() { }
- multiway_mergesort_tag(_ThreadIndex __num_threads)
- : parallel_tag(__num_threads) { }
+ multiway_mergesort_tag() { }
+ multiway_mergesort_tag(_ThreadIndex __num_threads)
+ : parallel_tag(__num_threads) { }
};
/** @brief Forces parallel sorting using multiway mergesort
* with exact splitting at compile time. */
struct multiway_mergesort_exact_tag : public parallel_tag
{
- multiway_mergesort_exact_tag() { }
- multiway_mergesort_exact_tag(_ThreadIndex __num_threads)
- : parallel_tag(__num_threads) { }
+ multiway_mergesort_exact_tag() { }
+ multiway_mergesort_exact_tag(_ThreadIndex __num_threads)
+ : parallel_tag(__num_threads) { }
};
/** @brief Forces parallel sorting using multiway mergesort
* with splitting by sampling at compile time. */
struct multiway_mergesort_sampling_tag : public parallel_tag
{
- multiway_mergesort_sampling_tag() { }
- multiway_mergesort_sampling_tag(_ThreadIndex __num_threads)
- : parallel_tag(__num_threads) { }
+ multiway_mergesort_sampling_tag() { }
+ multiway_mergesort_sampling_tag(_ThreadIndex __num_threads)
+ : parallel_tag(__num_threads) { }
};
/** @brief Forces parallel sorting using unbalanced quicksort
* at compile time. */
struct quicksort_tag : public parallel_tag
{
- quicksort_tag() { }
- quicksort_tag(_ThreadIndex __num_threads)
- : parallel_tag(__num_threads) { }
+ quicksort_tag() { }
+ quicksort_tag(_ThreadIndex __num_threads)
+ : parallel_tag(__num_threads) { }
};
/** @brief Forces parallel sorting using balanced quicksort
* at compile time. */
struct balanced_quicksort_tag : public parallel_tag
{
- balanced_quicksort_tag() { }
- balanced_quicksort_tag(_ThreadIndex __num_threads)
- : parallel_tag(__num_threads) { }
+ balanced_quicksort_tag() { }
+ balanced_quicksort_tag(_ThreadIndex __num_threads)
+ : parallel_tag(__num_threads) { }
};
diff --git a/libstdc++-v3/include/parallel/unique_copy.h b/libstdc++-v3/include/parallel/unique_copy.h
index 327870e7d86..1ae5a12316d 100644
--- a/libstdc++-v3/include/parallel/unique_copy.h
+++ b/libstdc++-v3/include/parallel/unique_copy.h
@@ -37,155 +37,160 @@
namespace __gnu_parallel
{
-
-/** @brief Parallel std::unique_copy(), w/__o explicit equality predicate.
- * @param __first Begin iterator of input sequence.
- * @param __last End iterator of input sequence.
- * @param __result Begin iterator of result __sequence.
- * @param __binary_pred Equality predicate.
- * @return End iterator of result __sequence. */
-template<typename _IIter,
- class _OutputIterator,
- class _BinaryPredicate>
- _OutputIterator
- __parallel_unique_copy(_IIter __first, _IIter __last,
- _OutputIterator __result, _BinaryPredicate __binary_pred)
- {
- _GLIBCXX_CALL(__last - __first)
-
- typedef std::iterator_traits<_IIter> _TraitsType;
- typedef typename _TraitsType::value_type _ValueType;
- typedef typename _TraitsType::difference_type _DifferenceType;
-
- _DifferenceType size = __last - __first;
-
- if (size == 0)
- return __result;
-
- // Let the first thread process two parts.
- _DifferenceType *__counter;
- _DifferenceType *__borders;
-
- _ThreadIndex __num_threads = __get_max_threads();
- // First part contains at least one element.
-# pragma omp parallel num_threads(__num_threads)
+ /** @brief Parallel std::unique_copy(), w/__o explicit equality predicate.
+ * @param __first Begin iterator of input sequence.
+ * @param __last End iterator of input sequence.
+ * @param __result Begin iterator of result __sequence.
+ * @param __binary_pred Equality predicate.
+ * @return End iterator of result __sequence. */
+ template<typename _IIter,
+ class _OutputIterator,
+ class _BinaryPredicate>
+ _OutputIterator
+ __parallel_unique_copy(_IIter __first, _IIter __last,
+ _OutputIterator __result,
+ _BinaryPredicate __binary_pred)
+ {
+ _GLIBCXX_CALL(__last - __first)
+
+ typedef std::iterator_traits<_IIter> _TraitsType;
+ typedef typename _TraitsType::value_type _ValueType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
+
+ _DifferenceType __size = __last - __first;
+
+ if (__size == 0)
+ return __result;
+
+ // Let the first thread process two parts.
+ _DifferenceType *__counter;
+ _DifferenceType *__borders;
+
+ _ThreadIndex __num_threads = __get_max_threads();
+ // First part contains at least one element.
+# pragma omp parallel num_threads(__num_threads)
{
# pragma omp single
+ {
+ __num_threads = omp_get_num_threads();
+ __borders = new _DifferenceType[__num_threads + 2];
+ equally_split(__size, __num_threads + 1, __borders);
+ __counter = new _DifferenceType[__num_threads + 1];
+ }
+
+ _ThreadIndex __iam = omp_get_thread_num();
+
+ _DifferenceType __begin, __end;
+
+ // Check for length without duplicates
+ // Needed for position in output
+ _DifferenceType __i = 0;
+ _OutputIterator __out = __result;
+
+ if (__iam == 0)
{
- __num_threads = omp_get_num_threads();
- __borders = new _DifferenceType[__num_threads + 2];
- equally_split(size, __num_threads + 1, __borders);
- __counter = new _DifferenceType[__num_threads + 1];
+ __begin = __borders[0] + 1; // == 1
+ __end = __borders[__iam + 1];
+
+ ++__i;
+ *__out++ = *__first;
+
+ for (_IIter __iter = __first + __begin; __iter < __first + __end;
+ ++__iter)
+ {
+ if (!__binary_pred(*__iter, *(__iter - 1)))
+ {
+ ++__i;
+ *__out++ = *__iter;
+ }
+ }
}
+ else
+ {
+ __begin = __borders[__iam]; //one part
+ __end = __borders[__iam + 1];
- _ThreadIndex __iam = omp_get_thread_num();
+ for (_IIter __iter = __first + __begin; __iter < __first + __end;
+ ++__iter)
+ {
+ if (!__binary_pred(*__iter, *(__iter - 1)))
+ ++__i;
+ }
+ }
+ __counter[__iam] = __i;
- _DifferenceType __begin, __end;
+ // Last part still untouched.
+ _DifferenceType __begin_output;
- // Check for length without duplicates
- // Needed for position in output
- _DifferenceType __i = 0;
- _OutputIterator __out = __result;
+# pragma omp barrier
- if (__iam == 0)
- {
- __begin = __borders[0] + 1; // == 1
- __end = __borders[__iam + 1];
+ // Store result in output on calculated positions.
+ __begin_output = 0;
- ++__i;
- *__out++ = *__first;
+ if (__iam == 0)
+ {
+ for (int __t = 0; __t < __num_threads; ++__t)
+ __begin_output += __counter[__t];
- for (_IIter iter = __first + __begin; iter < __first + __end; ++iter)
- {
- if (!__binary_pred(*iter, *(iter-1)))
- {
- ++__i;
- *__out++ = *iter;
- }
- }
- }
- else
- {
- __begin = __borders[__iam]; //one part
- __end = __borders[__iam + 1];
-
- for (_IIter iter = __first + __begin; iter < __first + __end; ++iter)
- {
- if (!__binary_pred(*iter, *(iter - 1)))
- ++__i;
- }
- }
- __counter[__iam] = __i;
-
- // Last part still untouched.
- _DifferenceType __begin_output;
-
-# pragma omp barrier
-
- // Store result in output on calculated positions.
- __begin_output = 0;
-
- if (__iam == 0)
- {
- for (int __t = 0; __t < __num_threads; ++__t)
- __begin_output += __counter[__t];
-
- __i = 0;
-
- _OutputIterator __iter_out = __result + __begin_output;
-
- __begin = __borders[__num_threads];
- __end = size;
-
- for (_IIter iter = __first + __begin; iter < __first + __end; ++iter)
- {
- if (iter == __first || !__binary_pred(*iter, *(iter - 1)))
- {
- ++__i;
- *__iter_out++ = *iter;
- }
- }
-
- __counter[__num_threads] = __i;
- }
- else
- {
- for (int __t = 0; __t < __iam; __t++)
- __begin_output += __counter[__t];
-
- _OutputIterator __iter_out = __result + __begin_output;
- for (_IIter iter = __first + __begin; iter < __first + __end; ++iter)
- {
- if (!__binary_pred(*iter, *(iter-1)))
- *__iter_out++ = *iter;
- }
- }
+ __i = 0;
+
+ _OutputIterator __iter_out = __result + __begin_output;
+
+ __begin = __borders[__num_threads];
+ __end = __size;
+
+ for (_IIter __iter = __first + __begin; __iter < __first + __end;
+ ++__iter)
+ {
+ if (__iter == __first
+ || !__binary_pred(*__iter, *(__iter - 1)))
+ {
+ ++__i;
+ *__iter_out++ = *__iter;
+ }
+ }
+
+ __counter[__num_threads] = __i;
+ }
+ else
+ {
+ for (int __t = 0; __t < __iam; __t++)
+ __begin_output += __counter[__t];
+
+ _OutputIterator __iter_out = __result + __begin_output;
+ for (_IIter __iter = __first + __begin; __iter < __first + __end;
+ ++__iter)
+ {
+ if (!__binary_pred(*__iter, *(__iter - 1)))
+ *__iter_out++ = *__iter;
+ }
+ }
+ }
+
+ _DifferenceType __end_output = 0;
+ for (int __t = 0; __t < __num_threads + 1; __t++)
+ __end_output += __counter[__t];
+
+ delete[] __borders;
+
+ return __result + __end_output;
}
- _DifferenceType __end_output = 0;
- for (int __t = 0; __t < __num_threads + 1; __t++)
- __end_output += __counter[__t];
-
- delete[] __borders;
-
- return __result + __end_output;
- }
-
-/** @brief Parallel std::unique_copy(), without explicit equality predicate
- * @param __first Begin iterator of input sequence.
- * @param __last End iterator of input sequence.
- * @param __result Begin iterator of result __sequence.
- * @return End iterator of result __sequence. */
-template<typename _IIter, class _OutputIterator>
- inline _OutputIterator
- __parallel_unique_copy(_IIter __first, _IIter __last,
- _OutputIterator __result)
- {
- typedef typename std::iterator_traits<_IIter>::value_type
- _ValueType;
- return __parallel_unique_copy(__first, __last, __result,
- std::equal_to<_ValueType>());
- }
+ /** @brief Parallel std::unique_copy(), without explicit equality predicate
+ * @param __first Begin iterator of input sequence.
+ * @param __last End iterator of input sequence.
+ * @param __result Begin iterator of result __sequence.
+ * @return End iterator of result __sequence. */
+ template<typename _IIter, class _OutputIterator>
+ inline _OutputIterator
+ __parallel_unique_copy(_IIter __first, _IIter __last,
+ _OutputIterator __result)
+ {
+ typedef typename std::iterator_traits<_IIter>::value_type
+ _ValueType;
+ return __parallel_unique_copy(__first, __last, __result,
+ std::equal_to<_ValueType>());
+ }
}//namespace __gnu_parallel
diff --git a/libstdc++-v3/include/parallel/workstealing.h b/libstdc++-v3/include/parallel/workstealing.h
index 638057ca740..9e0db3a9584 100644
--- a/libstdc++-v3/include/parallel/workstealing.h
+++ b/libstdc++-v3/include/parallel/workstealing.h
@@ -49,261 +49,264 @@ namespace __gnu_parallel
#define _GLIBCXX_JOB_VOLATILE volatile
-/** @brief One __job for a certain thread. */
-template<typename _DifferenceTp>
- struct _Job
- {
- typedef _DifferenceTp _DifferenceType;
-
- /** @brief First element.
- *
- * Changed by owning and stealing thread. By stealing thread,
- * always incremented. */
- _GLIBCXX_JOB_VOLATILE _DifferenceType _M_first;
-
- /** @brief Last element.
- *
- * Changed by owning thread only. */
- _GLIBCXX_JOB_VOLATILE _DifferenceType _M_last;
-
- /** @brief Number of elements, i.e. @__c _M_last-_M_first+1.
- *
- * Changed by owning thread only. */
- _GLIBCXX_JOB_VOLATILE _DifferenceType _M_load;
- };
-
-/** @brief Work stealing algorithm for random access iterators.
- *
- * Uses O(1) additional memory. Synchronization at job lists is
- * done with atomic operations.
- * @param __begin Begin iterator of element sequence.
- * @param __end End iterator of element sequence.
- * @param __op User-supplied functor (comparator, predicate, adding
- * functor, ...).
- * @param __f Functor to "process" an element with __op (depends on
- * desired functionality, e. g. for std::for_each(), ...).
- * @param __r Functor to "add" a single __result to the already
- * processed elements (depends on functionality).
- * @param __base Base value for reduction.
- * @param __output Pointer to position where final result is written to
- * @param __bound Maximum number of elements processed (e. g. for
- * std::count_n()).
- * @return User-supplied functor (that may contain a part of the result).
- */
-template<typename _RAIter,
- typename _Op,
- typename _Fu,
- typename _Red,
- typename _Result>
- _Op
- __for_each_template_random_access_workstealing(
- _RAIter __begin, _RAIter __end, _Op __op, _Fu& __f, _Red __r,
- _Result __base, _Result& __output,
- typename std::iterator_traits<_RAIter>::difference_type __bound)
- {
- _GLIBCXX_CALL(__end - __begin)
-
- typedef std::iterator_traits<_RAIter> _TraitsType;
- typedef typename _TraitsType::difference_type _DifferenceType;
-
- const _Settings& __s = _Settings::get();
-
- _DifferenceType __chunk_size =
- static_cast<_DifferenceType>(__s.workstealing_chunk_size);
-
- // How many jobs?
- _DifferenceType __length = (__bound < 0) ? (__end - __begin) : __bound;
-
- // To avoid false sharing in a cache line.
- const int __stride =
- __s.cache_line_size * 10 / sizeof(_Job<_DifferenceType>) + 1;
-
- // Total number of threads currently working.
- _ThreadIndex __busy = 0;
-
- _Job<_DifferenceType> *__job;
-
- omp_lock_t __output_lock;
- omp_init_lock(&__output_lock);
-
- // Write base value to output.
- __output = __base;
-
- // No more threads than jobs, at least one thread.
- _ThreadIndex __num_threads =
- __gnu_parallel::max<_ThreadIndex>(1,
- __gnu_parallel::min<_DifferenceType>(__length, __get_max_threads()));
-
-# pragma omp parallel shared(__busy) num_threads(__num_threads)
+ /** @brief One __job for a certain thread. */
+ template<typename _DifferenceTp>
+ struct _Job
+ {
+ typedef _DifferenceTp _DifferenceType;
+
+ /** @brief First element.
+ *
+ * Changed by owning and stealing thread. By stealing thread,
+ * always incremented. */
+ _GLIBCXX_JOB_VOLATILE _DifferenceType _M_first;
+
+ /** @brief Last element.
+ *
+ * Changed by owning thread only. */
+ _GLIBCXX_JOB_VOLATILE _DifferenceType _M_last;
+
+ /** @brief Number of elements, i.e. @c _M_last-_M_first+1.
+ *
+ * Changed by owning thread only. */
+ _GLIBCXX_JOB_VOLATILE _DifferenceType _M_load;
+ };
+
+ /** @brief Work stealing algorithm for random access iterators.
+ *
+ * Uses O(1) additional memory. Synchronization at job lists is
+ * done with atomic operations.
+ * @param __begin Begin iterator of element sequence.
+ * @param __end End iterator of element sequence.
+ * @param __op User-supplied functor (comparator, predicate, adding
+ * functor, ...).
+ * @param __f Functor to "process" an element with __op (depends on
+ * desired functionality, e. g. for std::for_each(), ...).
+ * @param __r Functor to "add" a single __result to the already
+ * processed elements (depends on functionality).
+ * @param __base Base value for reduction.
+ * @param __output Pointer to position where final result is written to
+ * @param __bound Maximum number of elements processed (e. g. for
+ * std::count_n()).
+ * @return User-supplied functor (that may contain a part of the result).
+ */
+ template<typename _RAIter,
+ typename _Op,
+ typename _Fu,
+ typename _Red,
+ typename _Result>
+ _Op
+ __for_each_template_random_access_workstealing(_RAIter __begin,
+ _RAIter __end, _Op __op,
+ _Fu& __f, _Red __r,
+ _Result __base,
+ _Result& __output,
+ typename std::iterator_traits<_RAIter>::difference_type __bound)
+ {
+ _GLIBCXX_CALL(__end - __begin)
+
+ typedef std::iterator_traits<_RAIter> _TraitsType;
+ typedef typename _TraitsType::difference_type _DifferenceType;
+
+ const _Settings& __s = _Settings::get();
+
+ _DifferenceType __chunk_size =
+ static_cast<_DifferenceType>(__s.workstealing_chunk_size);
+
+ // How many jobs?
+ _DifferenceType __length = (__bound < 0) ? (__end - __begin) : __bound;
+
+ // To avoid false sharing in a cache line.
+ const int __stride = (__s.cache_line_size * 10
+ / sizeof(_Job<_DifferenceType>) + 1);
+
+ // Total number of threads currently working.
+ _ThreadIndex __busy = 0;
+
+ _Job<_DifferenceType> *__job;
+
+ omp_lock_t __output_lock;
+ omp_init_lock(&__output_lock);
+
+ // Write base value to output.
+ __output = __base;
+
+ // No more threads than jobs, at least one thread.
+ _ThreadIndex __num_threads = __gnu_parallel::max<_ThreadIndex>
+ (1, __gnu_parallel::min<_DifferenceType>(__length,
+ __get_max_threads()));
+
+# pragma omp parallel shared(__busy) num_threads(__num_threads)
{
-
# pragma omp single
- {
- __num_threads = omp_get_num_threads();
+ {
+ __num_threads = omp_get_num_threads();
- // Create job description array.
- __job = new _Job<_DifferenceType>[__num_threads * __stride];
- }
+ // Create job description array.
+ __job = new _Job<_DifferenceType>[__num_threads * __stride];
+ }
- // Initialization phase.
+ // Initialization phase.
- // Flags for every thread if it is doing productive work.
- bool __iam_working = false;
+ // Flags for every thread if it is doing productive work.
+ bool __iam_working = false;
- // Thread id.
- _ThreadIndex __iam = omp_get_thread_num();
+ // Thread id.
+ _ThreadIndex __iam = omp_get_thread_num();
- // This job.
- _Job<_DifferenceType>& __my_job = __job[__iam * __stride];
+ // This job.
+ _Job<_DifferenceType>& __my_job = __job[__iam * __stride];
- // Random number (for work stealing).
- _ThreadIndex __victim;
+ // Random number (for work stealing).
+ _ThreadIndex __victim;
- // Local value for reduction.
- _Result __result = _Result();
+ // Local value for reduction.
+ _Result __result = _Result();
- // Number of elements to steal in one attempt.
- _DifferenceType __steal;
+ // Number of elements to steal in one attempt.
+ _DifferenceType __steal;
- // Every thread has its own random number generator
- // (modulo __num_threads).
- _RandomNumber rand_gen(__iam, __num_threads);
+ // Every thread has its own random number generator
+ // (modulo __num_threads).
+ _RandomNumber __rand_gen(__iam, __num_threads);
- // This thread is currently working.
+ // This thread is currently working.
# pragma omp atomic
- ++__busy;
+ ++__busy;
- __iam_working = true;
+ __iam_working = true;
- // How many jobs per thread? last thread gets the rest.
- __my_job._M_first =
- static_cast<_DifferenceType>(__iam * (__length / __num_threads));
+ // How many jobs per thread? last thread gets the rest.
+ __my_job._M_first = static_cast<_DifferenceType>
+ (__iam * (__length / __num_threads));
- __my_job._M_last = (__iam == (__num_threads - 1)) ?
- (__length - 1) : ((__iam + 1) * (__length / __num_threads) - 1);
- __my_job._M_load = __my_job._M_last - __my_job._M_first + 1;
+ __my_job._M_last = (__iam == (__num_threads - 1)
+ ? (__length - 1)
+ : ((__iam + 1) * (__length / __num_threads) - 1));
+ __my_job._M_load = __my_job._M_last - __my_job._M_first + 1;
- // Init result with _M_first value (to have a base value for reduction)
- if (__my_job._M_first <= __my_job._M_last)
- {
- // Cannot use volatile variable directly.
- _DifferenceType __my_first = __my_job._M_first;
- __result = __f(__op, __begin + __my_first);
- ++__my_job._M_first;
- --__my_job._M_load;
- }
+ // Init result with _M_first value (to have a base value for reduction)
+ if (__my_job._M_first <= __my_job._M_last)
+ {
+ // Cannot use volatile variable directly.
+ _DifferenceType __my_first = __my_job._M_first;
+ __result = __f(__op, __begin + __my_first);
+ ++__my_job._M_first;
+ --__my_job._M_load;
+ }
- _RAIter __current;
+ _RAIter __current;
# pragma omp barrier
- // Actual work phase
- // Work on own or stolen current start
- while (__busy > 0)
- {
- // Work until no productive thread left.
+ // Actual work phase
+ // Work on own or stolen current start
+ while (__busy > 0)
+ {
+ // Work until no productive thread left.
# pragma omp flush(__busy)
- // Thread has own work to do
- while (__my_job._M_first <= __my_job._M_last)
- {
- // fetch-and-add call
- // Reserve current job block (size __chunk_size) in my queue.
- _DifferenceType __current_job =
- __fetch_and_add<_DifferenceType>(
- &(__my_job._M_first), __chunk_size);
-
- // Update _M_load, to make the three values consistent,
- // _M_first might have been changed in the meantime
- __my_job._M_load = __my_job._M_last - __my_job._M_first + 1;
- for (_DifferenceType __job_counter = 0;
- __job_counter < __chunk_size
- && __current_job <= __my_job._M_last;
- ++__job_counter)
- {
- // Yes: process it!
- __current = __begin + __current_job;
- ++__current_job;
-
- // Do actual work.
- __result = __r(__result, __f(__op, __current));
- }
+ // Thread has own work to do
+ while (__my_job._M_first <= __my_job._M_last)
+ {
+ // fetch-and-add call
+ // Reserve current job block (size __chunk_size) in my queue.
+ _DifferenceType __current_job =
+ __fetch_and_add<_DifferenceType>(&(__my_job._M_first),
+ __chunk_size);
+
+ // Update _M_load, to make the three values consistent,
+ // _M_first might have been changed in the meantime
+ __my_job._M_load = __my_job._M_last - __my_job._M_first + 1;
+ for (_DifferenceType __job_counter = 0;
+ __job_counter < __chunk_size
+ && __current_job <= __my_job._M_last;
+ ++__job_counter)
+ {
+ // Yes: process it!
+ __current = __begin + __current_job;
+ ++__current_job;
+
+ // Do actual work.
+ __result = __r(__result, __f(__op, __current));
+ }
# pragma omp flush(__busy)
- }
+ }
- // After reaching this point, a thread's __job list is empty.
- if (__iam_working)
- {
- // This thread no longer has work.
+ // After reaching this point, a thread's __job list is empty.
+ if (__iam_working)
+ {
+ // This thread no longer has work.
# pragma omp atomic
- --__busy;
+ --__busy;
- __iam_working = false;
- }
+ __iam_working = false;
+ }
- _DifferenceType __supposed_first, __supposed_last, __supposed_load;
- do
- {
- // Find random nonempty deque (not own), do consistency check.
- __yield();
+ _DifferenceType __supposed_first, __supposed_last,
+ __supposed_load;
+ do
+ {
+ // Find random nonempty deque (not own), do consistency check.
+ __yield();
# pragma omp flush(__busy)
- __victim = rand_gen();
- __supposed_first = __job[__victim * __stride]._M_first;
- __supposed_last = __job[__victim * __stride]._M_last;
- __supposed_load = __job[__victim * __stride]._M_load;
- }
- while (__busy > 0
- && ((__supposed_load <= 0)
- || ((__supposed_first + __supposed_load - 1)
- != __supposed_last)));
-
- if (__busy == 0)
- break;
-
- if (__supposed_load > 0)
- {
- // Has work and work to do.
- // Number of elements to steal (at least one).
- __steal = (__supposed_load < 2) ? 1 : __supposed_load / 2;
-
- // Push __victim's current start forward.
- _DifferenceType __stolen_first =
- __fetch_and_add<_DifferenceType>(
- &(__job[__victim * __stride]._M_first), __steal);
- _DifferenceType __stolen_try =
- __stolen_first + __steal - _DifferenceType(1);
-
- __my_job._M_first = __stolen_first;
- __my_job._M_last =
- __gnu_parallel::min(__stolen_try, __supposed_last);
- __my_job._M_load = __my_job._M_last - __my_job._M_first + 1;
-
- // Has potential work again.
+ __victim = __rand_gen();
+ __supposed_first = __job[__victim * __stride]._M_first;
+ __supposed_last = __job[__victim * __stride]._M_last;
+ __supposed_load = __job[__victim * __stride]._M_load;
+ }
+ while (__busy > 0
+ && ((__supposed_load <= 0)
+ || ((__supposed_first + __supposed_load - 1)
+ != __supposed_last)));
+
+ if (__busy == 0)
+ break;
+
+ if (__supposed_load > 0)
+ {
+ // Has work and work to do.
+ // Number of elements to steal (at least one).
+ __steal = (__supposed_load < 2) ? 1 : __supposed_load / 2;
+
+ // Push __victim's current start forward.
+ _DifferenceType __stolen_first =
+ __fetch_and_add<_DifferenceType>
+ (&(__job[__victim * __stride]._M_first), __steal);
+ _DifferenceType __stolen_try = (__stolen_first + __steal
+ - _DifferenceType(1));
+
+ __my_job._M_first = __stolen_first;
+ __my_job._M_last = __gnu_parallel::min(__stolen_try,
+ __supposed_last);
+ __my_job._M_load = __my_job._M_last - __my_job._M_first + 1;
+
+ // Has potential work again.
# pragma omp atomic
- ++__busy;
- __iam_working = true;
+ ++__busy;
+ __iam_working = true;
# pragma omp flush(__busy)
- }
+ }
# pragma omp flush(__busy)
- } // end while __busy > 0
- // Add accumulated result to output.
- omp_set_lock(&__output_lock);
- __output = __r(__output, __result);
- omp_unset_lock(&__output_lock);
+ } // end while __busy > 0
+ // Add accumulated result to output.
+ omp_set_lock(&__output_lock);
+ __output = __r(__output, __result);
+ omp_unset_lock(&__output_lock);
}
- delete[] __job;
+ delete[] __job;
- // Points to last element processed (needed as return value for
- // some algorithms like transform)
- __f._M_finish_iterator = __begin + __length;
+ // Points to last element processed (needed as return value for
+ // some algorithms like transform)
+ __f._M_finish_iterator = __begin + __length;
- omp_destroy_lock(&__output_lock);
+ omp_destroy_lock(&__output_lock);
- return __op;
- }
+ return __op;
+ }
} // end namespace
#endif /* _GLIBCXX_PARALLEL_WORKSTEALING_H */
diff --git a/libstdc++-v3/include/precompiled/stdc++.h b/libstdc++-v3/include/precompiled/stdc++.h
index 1c615091bdc..99def363142 100644
--- a/libstdc++-v3/include/precompiled/stdc++.h
+++ b/libstdc++-v3/include/precompiled/stdc++.h
@@ -101,6 +101,7 @@
#include <condition_variable>
#include <forward_list>
#include <future>
+#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
diff --git a/libstdc++-v3/include/profile/impl/profiler_hashtable_size.h b/libstdc++-v3/include/profile/impl/profiler_hashtable_size.h
index 2192879325e..bfbafc14f90 100644
--- a/libstdc++-v3/include/profile/impl/profiler_hashtable_size.h
+++ b/libstdc++-v3/include/profile/impl/profiler_hashtable_size.h
@@ -28,7 +28,7 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/** @file profile/impl/profiler_hashtable_size.cc
+/** @file profile/impl/profiler_hashtable_size.h
* @brief Collection of hashtable size traces.
*/
diff --git a/libstdc++-v3/include/profile/impl/profiler_state.h b/libstdc++-v3/include/profile/impl/profiler_state.h
index 64c10db616c..03065715463 100644
--- a/libstdc++-v3/include/profile/impl/profiler_state.h
+++ b/libstdc++-v3/include/profile/impl/profiler_state.h
@@ -28,7 +28,7 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/** @file profile/impl/profiler_state.cc
+/** @file profile/impl/profiler_state.h
* @brief Global profiler state.
*/
diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono
index aa4888d9a9d..e80ec13c093 100644
--- a/libstdc++-v3/include/std/chrono
+++ b/libstdc++-v3/include/std/chrono
@@ -138,9 +138,20 @@ namespace std
}
};
+ template<typename _Tp>
+ struct __is_duration
+ : std::false_type
+ { };
+
+ template<typename _Rep, typename _Period>
+ struct __is_duration<duration<_Rep, _Period>>
+ : std::true_type
+ { };
+
/// duration_cast
template<typename _ToDuration, typename _Rep, typename _Period>
- inline _ToDuration
+ inline typename enable_if<__is_duration<_ToDuration>::value,
+ _ToDuration>::type
duration_cast(const duration<_Rep, _Period>& __d)
{
typedef typename
@@ -175,16 +186,6 @@ namespace std
{ return numeric_limits<_Rep>::min(); }
};
- template<typename _Tp>
- struct __is_duration
- : std::false_type
- { };
-
- template<typename _Rep, typename _Period>
- struct __is_duration<duration<_Rep, _Period>>
- : std::true_type
- { };
-
template<typename T>
struct __is_ratio
: std::false_type
@@ -210,24 +211,19 @@ namespace std
// 20.8.3.1 construction / copy / destroy
duration() = default;
- template<typename _Rep2>
+ template<typename _Rep2, typename = typename
+ enable_if<is_convertible<_Rep2, rep>::value
+ && (treat_as_floating_point<rep>::value
+ || !treat_as_floating_point<_Rep2>::value)>::type>
explicit duration(const _Rep2& __rep)
- : __r(static_cast<rep>(__rep))
- {
- static_assert(is_convertible<_Rep2,rep>::value
- && (treat_as_floating_point<rep>::value
- || !treat_as_floating_point<_Rep2>::value),
- "cannot construct integral duration with floating point type");
- }
+ : __r(static_cast<rep>(__rep)) { }
- template<typename _Rep2, typename _Period2>
+ template<typename _Rep2, typename _Period2, typename = typename
+ enable_if<treat_as_floating_point<rep>::value
+ || (ratio_divide<_Period2, period>::type::den == 1
+ && !treat_as_floating_point<_Rep2>::value)>::type>
duration(const duration<_Rep2, _Period2>& __d)
- : __r(duration_cast<duration>(__d).count())
- {
- static_assert(treat_as_floating_point<rep>::value == true
- || ratio_divide<_Period2, period>::type::den == 1,
- "the resulting duration is not exactly representable");
- }
+ : __r(duration_cast<duration>(__d).count()) { }
~duration() = default;
duration(const duration&) = default;
@@ -358,8 +354,17 @@ namespace std
return __ct(__lhs) -= __rhs;
}
+ template<typename _Rep1, typename _Rep2, bool =
+ is_convertible<_Rep2,
+ typename common_type<_Rep1, _Rep2>::type>::value>
+ struct __common_rep_type { };
+
+ template<typename _Rep1, typename _Rep2>
+ struct __common_rep_type<_Rep1, _Rep2, true>
+ { typedef typename common_type<_Rep1, _Rep2>::type type; };
+
template<typename _Rep1, typename _Period, typename _Rep2>
- inline duration<typename common_type<_Rep1, _Rep2>::type, _Period>
+ inline duration<typename __common_rep_type<_Rep1, _Rep2>::type, _Period>
operator*(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
{
typedef typename common_type<_Rep1, _Rep2>::type __cr;
@@ -367,12 +372,12 @@ namespace std
}
template<typename _Rep1, typename _Period, typename _Rep2>
- inline duration<typename common_type<_Rep1, _Rep2>::type, _Period>
- operator*(const _Rep2& __s, const duration<_Rep1, _Period>& __d)
+ inline duration<typename __common_rep_type<_Rep2, _Rep1>::type, _Period>
+ operator*(const _Rep1& __s, const duration<_Rep2, _Period>& __d)
{ return __d * __s; }
template<typename _Rep1, typename _Period, typename _Rep2>
- inline duration<typename common_type<_Rep1, typename
+ inline duration<typename __common_rep_type<_Rep1, typename
enable_if<!__is_duration<_Rep2>::value, _Rep2>::type>::type, _Period>
operator/(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
{
@@ -393,7 +398,7 @@ namespace std
// DR 934.
template<typename _Rep1, typename _Period, typename _Rep2>
- inline duration<typename common_type<_Rep1, typename
+ inline duration<typename __common_rep_type<_Rep1, typename
enable_if<!__is_duration<_Rep2>::value, _Rep2>::type>::type, _Period>
operator%(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
{
@@ -540,7 +545,8 @@ namespace std
/// time_point_cast
template<typename _ToDuration, typename _Clock, typename _Duration>
- inline time_point<_Clock, _ToDuration>
+ inline typename enable_if<__is_duration<_ToDuration>::value,
+ time_point<_Clock, _ToDuration>>::type
time_point_cast(const time_point<_Clock, _Duration>& __t)
{
return time_point<_Clock, _ToDuration>(
diff --git a/libstdc++-v3/include/std/future b/libstdc++-v3/include/std/future
index badb6e07e5a..b8c54b6075f 100644
--- a/libstdc++-v3/include/std/future
+++ b/libstdc++-v3/include/std/future
@@ -79,7 +79,7 @@ namespace std
*/
class future_error : public logic_error
{
- error_code _M_code;
+ error_code _M_code;
public:
explicit future_error(future_errc __ec)
@@ -96,250 +96,286 @@ namespace std
};
// Forward declarations.
- template<typename _Result>
+ template<typename _Res>
class unique_future;
- template<typename _Result>
+ template<typename _Res>
class shared_future;
template<typename>
class packaged_task;
- template<typename _Result>
+ template<typename _Res>
class promise;
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) \
&& defined(_GLIBCXX_ATOMIC_BUILTINS_4)
- // Holds the result of a future
- struct _Future_result_base
+ /// Base class and enclosing scope.
+ struct __future_base
{
- _Future_result_base() = default;
- _Future_result_base(const _Future_result_base&) = delete;
- _Future_result_base& operator=(const _Future_result_base&) = delete;
+ /// Base class for results.
+ struct _Result_base
+ {
+ exception_ptr _M_error;
- exception_ptr _M_error;
+ _Result_base() = default;
+ _Result_base(const _Result_base&) = delete;
+ _Result_base& operator=(const _Result_base&) = delete;
- // _M_destroy() allows derived classes to control deallocation,
- // which will be needed when allocator support is added to promise.
- // See http://gcc.gnu.org/ml/libstdc++/2009-06/msg00032.html
- virtual void _M_destroy() = 0;
- struct _Deleter
- {
- void operator()(_Future_result_base* __fr) const { __fr->_M_destroy(); }
- };
+ // _M_destroy() allows derived classes to control deallocation,
+ // which will be needed when allocator support is added to promise.
+ // See http://gcc.gnu.org/ml/libstdc++/2009-06/msg00032.html
+ virtual void _M_destroy() = 0;
- protected:
- ~_Future_result_base() = default;
- };
+ struct _Deleter
+ {
+ void operator()(_Result_base* __fr) const { __fr->_M_destroy(); }
+ };
- // TODO: use template alias when available
- /*
- template<typename _Res>
- using _Future_ptr = unique_ptr<_Res, _Future_result_base::_Deleter>;
- */
- template<typename _Res>
- struct _Future_ptr
- {
- typedef unique_ptr<_Res, _Future_result_base::_Deleter> type;
+ protected:
+ ~_Result_base();
};
- // State shared between a promise and one or more associated futures.
- class _Future_state
- {
- typedef _Future_ptr<_Future_result_base>::type _Future_ptr_type;
+ /// Result.
+ template<typename _Res>
+ struct _Result : _Result_base
+ {
+ private:
+ typedef alignment_of<_Res> __a_of;
+ typedef aligned_storage<sizeof(_Res), __a_of::value> __align_storage;
+ typedef typename __align_storage::type __align_type;
+
+ __align_type _M_storage;
+ bool _M_initialized;
+
+ public:
+ _Result() : _M_initialized() { }
+
+ ~_Result()
+ {
+ if (_M_initialized)
+ _M_value().~_Res();
+ }
+
+ // Return lvalue, future will add const or rvalue-reference
+ _Res&
+ _M_value() { return *static_cast<_Res*>(_M_addr()); }
+
+ void
+ _M_set(const _Res& __res)
+ {
+ ::new (_M_addr()) _Res(__res);
+ _M_initialized = true;
+ }
+
+ void
+ _M_set(_Res&& __res)
+ {
+ ::new (_M_addr()) _Res(_Move_result<_Res>::_S_move(__res));
+ _M_initialized = true;
+ }
+
+ private:
+ void _M_destroy() { delete this; }
+
+ void* _M_addr() { return static_cast<void*>(&_M_storage); }
+ };
- public:
- _Future_state() : _M_result(), _M_retrieved(false) { }
- _Future_state(const _Future_state&) = delete;
- _Future_state& operator=(const _Future_state&) = delete;
+ /// Workaround for CWG issue 664 and c++/34022
+ template<typename _Res, bool = is_scalar<_Res>::value>
+ struct _Move_result;
- bool
- is_ready()
- { return _M_get() != 0; }
+ /// Specialization for scalar types returns rvalue not rvalue-reference.
+ template<typename _Res>
+ struct _Move_result<_Res, true>
+ {
+ typedef _Res __rval_type;
+ static _Res _S_move(_Res __res) { return __res; }
+ };
+
+ /// Specialization for non-scalar types returns rvalue-reference.
+ template<typename _Res>
+ struct _Move_result<_Res, false>
+ {
+ typedef _Res&& __rval_type;
+ static _Res&& _S_move(_Res& __res) { return std::move(__res); }
+ };
+
+
+ // TODO: use template alias when available
+ /*
+ template<typename _Res>
+ using _Ptr = unique_ptr<_Res, _Result_base::_Deleter>;
+ */
+ /// A unique_ptr based on the instantiating type.
+ template<typename _Res>
+ struct _Ptr
+ {
+ typedef unique_ptr<_Res, _Result_base::_Deleter> type;
+ };
- bool
- has_exception()
- {
- _Future_result_base* const __res = _M_get();
- return __res && !(__res->_M_error == 0);
- }
- bool
- has_value()
+ /// Shared state between a promise and one or more associated futures.
+ class _State
{
- _Future_result_base* const __res = _M_get();
- return __res && (__res->_M_error == 0);
- }
+ typedef _Ptr<_Result_base>::type _Ptr_type;
- _Future_result_base&
- wait()
- {
- unique_lock<mutex> __lock(_M_mutex);
- if (!_M_ready())
- _M_cond.wait(__lock, std::bind(&_Future_state::_M_ready, this));
- return *_M_result;
- }
+ _Ptr_type _M_result;
+ mutex _M_mutex;
+ condition_variable _M_cond;
+ atomic_flag _M_retrieved;
+
+ public:
+ _State() : _M_result(), _M_retrieved(ATOMIC_FLAG_INIT) { }
+
+ _State(const _State&) = delete;
+ _State& operator=(const _State&) = delete;
- template<typename _Rep, typename _Period>
bool
- wait_for(const chrono::duration<_Rep, _Period>& __rel)
- {
- unique_lock<mutex> __lock(_M_mutex);
- return _M_ready() || _M_cond.wait_for(__lock, __rel,
- std::bind(&_Future_state::_M_ready, this));
- }
+ is_ready()
+ { return _M_get() != 0; }
- template<typename _Clock, typename _Duration>
bool
- wait_until(const chrono::time_point<_Clock, _Duration>& __abs)
+ has_exception()
{
- unique_lock<mutex> __lock(_M_mutex);
- return _M_ready() || _M_cond.wait_until(__lock, __abs,
- std::bind(&_Future_state::_M_ready, this));
+ _Result_base* const __res = _M_get();
+ return __res && !(__res->_M_error == 0);
}
- void
- _M_set_result(_Future_ptr_type __res)
- {
+ bool
+ has_value()
{
- lock_guard<mutex> __lock(_M_mutex);
- if (_M_ready())
- __throw_future_error(int(future_errc::promise_already_satisfied));
- _M_result.swap(__res);
+ _Result_base* const __res = _M_get();
+ return __res && (__res->_M_error == 0);
}
- _M_cond.notify_all();
- }
- void
- _M_break_promise(_Future_ptr_type __res)
- {
- if (static_cast<bool>(__res))
+ _Result_base&
+ wait()
{
- __res->_M_error
- = std::copy_exception(future_error(future_errc::broken_promise));
- {
- lock_guard<mutex> __lock(_M_mutex);
- _M_result.swap(__res);
- }
- _M_cond.notify_all();
+ unique_lock<mutex> __lock(_M_mutex);
+ if (!_M_ready())
+ _M_cond.wait(__lock, std::bind(&_State::_M_ready, this));
+ return *_M_result;
}
- }
- // called when this object is passed to a unique_future
- void
- _M_set_retrieved_flag()
- {
- if (_M_retrieved.test_and_set())
- __throw_future_error(int(future_errc::future_already_retrieved));
- }
-
- private:
- _Future_result_base*
- _M_get()
- {
- lock_guard<mutex> __lock(_M_mutex);
- return _M_result.get();
- }
-
- bool _M_ready() const { return static_cast<bool>(_M_result); }
-
- _Future_ptr_type _M_result;
- mutex _M_mutex;
- condition_variable _M_cond;
- atomic_flag _M_retrieved;
- };
-
- // workaround for CWG issue 664 and c++/34022
- template<typename _Result, bool = is_scalar<_Result>::value>
- struct _Move_future_result
- {
- typedef _Result&& __rval_type;
- static _Result&& _S_move(_Result& __res) { return std::move(__res); }
- };
-
- // specialization for scalar types returns rvalue not rvalue-reference
- template<typename _Result>
- struct _Move_future_result<_Result, true>
- {
- typedef _Result __rval_type;
- static _Result _S_move(_Result __res) { return __res; }
- };
+ template<typename _Rep, typename _Period>
+ bool
+ wait_for(const chrono::duration<_Rep, _Period>& __rel)
+ {
+ unique_lock<mutex> __lock(_M_mutex);
+ auto __bound = std::bind(&_State::_M_ready, this);
+ return _M_ready() || _M_cond.wait_for(__lock, __rel, __bound);
+ }
- template<typename _Result>
- struct _Future_result : _Future_result_base
- {
- _Future_result() : _M_initialized() { }
+ template<typename _Clock, typename _Duration>
+ bool
+ wait_until(const chrono::time_point<_Clock, _Duration>& __abs)
+ {
+ unique_lock<mutex> __lock(_M_mutex);
+ auto __bound = std::bind(&_State::_M_ready, this);
+ return _M_ready() || _M_cond.wait_until(__lock, __abs, __bound);
+ }
- ~_Future_result()
+ void
+ _M_set_result(_Ptr_type __res)
{
- if (_M_initialized)
- _M_value().~_Result();
+ {
+ lock_guard<mutex> __lock(_M_mutex);
+ if (_M_ready())
+ __throw_future_error(int(future_errc::promise_already_satisfied));
+ _M_result.swap(__res);
+ }
+ _M_cond.notify_all();
}
- // return lvalue, future will add const or rvalue-reference
- _Result& _M_value()
- { return *static_cast<_Result*>(_M_addr()); }
-
void
- _M_set(const _Result& __res)
+ _M_break_promise(_Ptr_type __res)
{
- ::new (_M_addr()) _Result(__res);
- _M_initialized = true;
+ if (static_cast<bool>(__res))
+ {
+ future_errc __ec(future_errc::broken_promise); // XXX
+ __res->_M_error = copy_exception(future_error(__ec));
+ {
+ lock_guard<mutex> __lock(_M_mutex);
+ _M_result.swap(__res);
+ }
+ _M_cond.notify_all();
+ }
}
+ // Called when this object is passed to a unique_future.
void
- _M_set(_Result&& __res)
+ _M_set_retrieved_flag()
{
- typedef _Move_future_result<_Result> _Mover;
- ::new (_M_addr()) _Result(_Mover::_S_move(__res));
- _M_initialized = true;
+ if (_M_retrieved.test_and_set())
+ __throw_future_error(int(future_errc::future_already_retrieved));
}
private:
- void _M_destroy() { delete this; }
-
- void* _M_addr() { return static_cast<void*>(&_M_storage); }
+ _Result_base*
+ _M_get()
+ {
+ lock_guard<mutex> __lock(_M_mutex);
+ return _M_result.get();
+ }
- typename aligned_storage<sizeof(_Result),
- alignment_of<_Result>::value>::type _M_storage;
- bool _M_initialized;
+ bool _M_ready() const { return static_cast<bool>(_M_result); }
};
+ };
- template<typename _Result>
- struct _Future_result<_Result&> : _Future_result_base
- {
- _Future_result() : _M_value_ptr() { }
+ inline __future_base::_Result_base::~_Result_base() = default;
- _Result* _M_value_ptr;
+ /// Partial specialization for reference types.
+ template<typename _Res>
+ struct __future_base::_Result<_Res&> : __future_base::_Result_base
+ {
+ _Result() : _M_value_ptr() { }
+ _Res* _M_value_ptr;
+
+ private:
void _M_destroy() { delete this; }
};
+ /// Explicit specialization for void.
template<>
- struct _Future_result<void> : _Future_result_base
+ struct __future_base::_Result<void> : __future_base::_Result_base
{
+ private:
void _M_destroy() { delete this; }
};
- // common implementation for unique_future and shared_future
- template<typename _Result>
- class _Future_impl
+
+ /// Common implementation for unique_future and shared_future.
+ template<typename _Res>
+ class __basic_future : public __future_base
{
+ protected:
+ typedef shared_ptr<_State> __state_type;
+ typedef __future_base::_Result<_Res>& __result_type;
+
+ private:
+ __state_type _M_state;
+
public:
- // disable copying
- _Future_impl(const _Future_impl&) = delete;
- _Future_impl& operator=(const _Future_impl&) = delete;
+ // Disable copying.
+ __basic_future(const __basic_future&) = delete;
+ __basic_future& operator=(const __basic_future&) = delete;
- // functions to check state and wait for ready
- bool is_ready() const { return this->_M_state->is_ready(); }
+ // Functions to check state and wait for ready.
+ bool
+ is_ready() const { return this->_M_state->is_ready(); }
- bool has_exception() const { return this->_M_state->has_exception(); }
+ bool
+ has_exception() const { return this->_M_state->has_exception(); }
- bool has_value() const { return this->_M_state->has_value(); }
+ bool
+ has_value() const { return this->_M_state->has_value(); }
- void wait() const { this->_M_state->wait(); }
+ void
+ wait() const { this->_M_state->wait(); }
template<typename _Rep, typename _Period>
bool
@@ -352,22 +388,19 @@ namespace std
{ return this->_M_state->wait_until(__abs); }
protected:
- // wait for the state to be ready and rethrow any stored exception
- _Future_result<_Result>&
+ /// Wait for the state to be ready and rethrow any stored exception
+ __result_type
_M_get_result()
{
- _Future_result_base& __res = this->_M_state->wait();
+ _Result_base& __res = this->_M_state->wait();
if (!(__res._M_error == 0))
rethrow_exception(__res._M_error);
- return static_cast<_Future_result<_Result>&>(__res);
+ return static_cast<__result_type>(__res);
}
- typedef shared_ptr<_Future_state> _State_ptr;
-
- // construction of a unique_future by promise::get_future()
+ // Construction of a unique_future by promise::get_future()
explicit
- _Future_impl(const _State_ptr& __state)
- : _M_state(__state)
+ __basic_future(const __state_type& __state) : _M_state(__state)
{
if (static_cast<bool>(this->_M_state))
this->_M_state->_M_set_retrieved_flag();
@@ -375,146 +408,149 @@ namespace std
__throw_future_error(int(future_errc::future_already_retrieved));
}
- // copy construction from a shared_future
+ // Copy construction from a shared_future
explicit
- _Future_impl(const shared_future<_Result>&);
+ __basic_future(const shared_future<_Res>&);
- // move construction from a unique_future
+ // Move construction from a unique_future
explicit
- _Future_impl(unique_future<_Result>&&);
-
- _State_ptr _M_state;
+ __basic_future(unique_future<_Res>&&);
};
- /// primary template for unique_future
- template<typename _Result>
- class unique_future : public _Future_impl<_Result>
+
+ /// Primary template for unique_future.
+ template<typename _Res>
+ class unique_future : public __basic_future<_Res>
{
- typedef _Move_future_result<_Result> _Mover;
+ friend class promise<_Res>;
+
+ typedef __basic_future<_Res> _Base_type;
+ typedef typename _Base_type::__state_type __state_type;
+ typedef __future_base::_Move_result<_Res> _Mover;
+
+ explicit
+ unique_future(const __state_type& __state) : _Base_type(__state) { }
public:
/// Move constructor
unique_future(unique_future&& __uf) : _Base_type(std::move(__uf)) { }
- // disable copying
+ // Disable copying
unique_future(const unique_future&) = delete;
unique_future& operator=(const unique_future&) = delete;
- // retrieving the value
+ /// Retrieving the value
typename _Mover::__rval_type
get()
{ return _Mover::_S_move(this->_M_get_result()._M_value()); }
-
- private:
- typedef _Future_impl<_Result> _Base_type;
- typedef typename _Base_type::_State_ptr _State_ptr;
-
- friend class promise<_Result>;
-
- explicit
- unique_future(const _State_ptr& __state) : _Base_type(__state) { }
};
- // partial specialization for unique_future<R&>
- template<typename _Result>
- class unique_future<_Result&> : public _Future_impl<_Result&>
+ /// Partial specialization for unique_future<R&>
+ template<typename _Res>
+ class unique_future<_Res&> : public __basic_future<_Res&>
{
+ friend class promise<_Res&>;
+
+ typedef __basic_future<_Res&> _Base_type;
+ typedef typename _Base_type::__state_type __state_type;
+
+ explicit
+ unique_future(const __state_type& __state) : _Base_type(__state) { }
+
public:
/// Move constructor
unique_future(unique_future&& __uf) : _Base_type(std::move(__uf)) { }
- // disable copying
+ // Disable copying
unique_future(const unique_future&) = delete;
unique_future& operator=(const unique_future&) = delete;
- // retrieving the value
- _Result& get() { return *this->_M_get_result()._M_value_ptr; }
+ /// Retrieving the value
+ _Res&
+ get() { return *this->_M_get_result()._M_value_ptr; }
+ };
- private:
- typedef _Future_impl<_Result&> _Base_type;
- typedef typename _Base_type::_State_ptr _State_ptr;
+ /// Explicit specialization for unique_future<void>
+ template<>
+ class unique_future<void> : public __basic_future<void>
+ {
+ friend class promise<void>;
- friend class promise<_Result&>;
+ typedef __basic_future<void> _Base_type;
+ typedef typename _Base_type::__state_type __state_type;
explicit
- unique_future(const _State_ptr& __state) : _Base_type(__state) { }
- };
+ unique_future(const __state_type& __state) : _Base_type(__state) { }
- // specialization for unique_future<void>
- template<>
- class unique_future<void> : public _Future_impl<void>
- {
public:
/// Move constructor
unique_future(unique_future&& __uf) : _Base_type(std::move(__uf)) { }
- // disable copying
+ // Disable copying
unique_future(const unique_future&) = delete;
unique_future& operator=(const unique_future&) = delete;
- // retrieving the value
- void get() { this->_M_get_result(); }
-
- private:
- typedef _Future_impl<void> _Base_type;
- typedef _Base_type::_State_ptr _State_ptr;
-
- friend class promise<void>;
-
- explicit
- unique_future(const _State_ptr& __state) : _Base_type(__state) { }
+ /// Retrieving the value
+ void
+ get() { this->_M_get_result(); }
};
- /// primary template for shared_future
- template<typename _Result>
- class shared_future : public _Future_impl<_Result>
+
+ /// Primary template for shared_future.
+ template<typename _Res>
+ class shared_future : public __basic_future<_Res>
{
+ typedef __basic_future<_Res> _Base_type;
+
public:
/// Copy constructor
shared_future(const shared_future& __sf) : _Base_type(__sf) { }
/// Construct from a unique_future rvalue
- shared_future(unique_future<_Result>&& __uf)
+ shared_future(unique_future<_Res>&& __uf)
: _Base_type(std::move(__uf))
{ }
shared_future& operator=(const shared_future&) = delete;
- // retrieving the value
- const _Result&
+ /// Retrieving the value
+ const _Res&
get()
- { return this->_M_get_result()._M_value(); }
-
- private:
- typedef _Future_impl<_Result> _Base_type;
+ {
+ typename _Base_type::__result_type __r = this->_M_get_result();
+ _Res& __rs(__r._M_value());
+ return __rs;
+ }
};
- // partial specialization for shared_future<R&>
- template<typename _Result>
- class shared_future<_Result&> : public _Future_impl<_Result&>
+ /// Partial specialization for shared_future<R&>
+ template<typename _Res>
+ class shared_future<_Res&> : public __basic_future<_Res&>
{
+ typedef __basic_future<_Res&> _Base_type;
+
public:
/// Copy constructor
shared_future(const shared_future& __sf) : _Base_type(__sf) { }
/// Construct from a unique_future rvalue
- shared_future(unique_future<_Result&>&& __uf)
+ shared_future(unique_future<_Res&>&& __uf)
: _Base_type(std::move(__uf))
{ }
shared_future& operator=(const shared_future&) = delete;
- // retrieving the value
- _Result& get() { return *this->_M_get_result()._M_value_ptr; }
-
- private:
- typedef _Future_impl<_Result&> _Base_type;
+ /// Retrieving the value
+ _Res&
+ get() { return *this->_M_get_result()._M_value_ptr; }
};
- // specialization for shared_future<void>
+ /// Explicit specialization for shared_future<void>
template<>
- class shared_future<void> : public _Future_impl<void>
+ class shared_future<void> : public __basic_future<void>
{
+ typedef __basic_future<void> _Base_type;
+
public:
/// Copy constructor
shared_future(const shared_future& __sf) : _Base_type(__sf) { }
@@ -526,33 +562,39 @@ namespace std
shared_future& operator=(const shared_future&) = delete;
- // retrieving the value
- void get() { this->_M_get_result(); }
-
- private:
- typedef _Future_impl<void> _Base_type;
+ // Retrieving the value
+ void
+ get() { this->_M_get_result(); }
};
- // now we can define the protected _Future_impl constructors
-
- template<typename _Result>
- _Future_impl<_Result>::_Future_impl(const shared_future<_Result>& __sf)
+ // Now we can define the protected __basic_future constructors.
+ template<typename _Res>
+ __basic_future<_Res>::__basic_future(const shared_future<_Res>& __sf)
: _M_state(__sf._M_state)
{ }
- template<typename _Result>
- _Future_impl<_Result>::_Future_impl(unique_future<_Result>&& __uf)
+ template<typename _Res>
+ __basic_future<_Res>::__basic_future(unique_future<_Res>&& __uf)
: _M_state(std::move(__uf._M_state))
{ }
- /// primary template for promise
- template<typename _Result>
+
+ /// Primary template for promise
+ template<typename _Res>
class promise
{
+ template<typename> friend class packaged_task;
+
+ typedef __future_base::_State _State;
+ typedef __future_base::_Move_result<_Res> _Mover;
+ typedef __future_base::_Result<_Res> result_type;
+
+ shared_ptr<_State> _M_future;
+ typename __future_base::_Ptr<result_type>::type _M_storage;
+
public:
promise()
- : _M_future(std::make_shared<_Future_state>()),
- _M_storage(new _Future_result<_Result>())
+ : _M_future(std::make_shared<_State>()), _M_storage(new result_type())
{ }
promise(promise&& __rhs)
@@ -577,7 +619,7 @@ namespace std
_M_future->_M_break_promise(std::move(_M_storage));
}
- // assignment
+ // Assignment
promise&
operator=(promise&& __rhs)
{
@@ -594,14 +636,14 @@ namespace std
_M_storage.swap(__rhs._M_storage);
}
- // retrieving the result
- unique_future<_Result>
+ // Retrieving the result
+ unique_future<_Res>
get_future()
- { return unique_future<_Result>(_M_future); }
+ { return unique_future<_Res>(_M_future); }
- // setting the result
+ // Setting the result
void
- set_value(const _Result& __r)
+ set_value(const _Res& __r)
{
if (!_M_satisfied())
_M_storage->_M_set(__r);
@@ -609,7 +651,7 @@ namespace std
}
void
- set_value(_Result&& __r)
+ set_value(_Res&& __r)
{
if (!_M_satisfied())
_M_storage->_M_set(_Mover::_S_move(__r));
@@ -625,26 +667,29 @@ namespace std
}
private:
- template<typename> friend class packaged_task;
- typedef _Move_future_result<_Result> _Mover;
bool _M_satisfied() { return !static_cast<bool>(_M_storage); }
- shared_ptr<_Future_state> _M_future;
- typename _Future_ptr<_Future_result<_Result>>::type _M_storage;
};
- // partial specialization for promise<R&>
- template<typename _Result>
- class promise<_Result&>
+ /// Partial specialization for promise<R&>
+ template<typename _Res>
+ class promise<_Res&>
{
+ template<typename> friend class packaged_task;
+ typedef __future_base::_State _State;
+
+ typedef __future_base::_Result<_Res&> result_type;
+
+ shared_ptr<_State> _M_future;
+ typename __future_base::_Ptr<result_type>::type _M_storage;
+
public:
promise()
- : _M_future(std::make_shared<_Future_state>()),
- _M_storage(new _Future_result<_Result&>())
+ : _M_future(std::make_shared<_State>()), _M_storage(new result_type())
{ }
promise(promise&& __rhs)
- : _M_future(std::move(__rhs._M_future)),
- _M_storage(std::move(__rhs._M_storage))
+ : _M_future(std::move(__rhs._M_future)),
+ _M_storage(std::move(__rhs._M_storage))
{ }
// TODO: requires allocator concepts
@@ -664,7 +709,7 @@ namespace std
_M_future->_M_break_promise(std::move(_M_storage));
}
- // assignment
+ // Assignment
promise&
operator=(promise&& __rhs)
{
@@ -681,14 +726,14 @@ namespace std
_M_storage.swap(__rhs._M_storage);
}
- // retrieving the result
- unique_future<_Result&>
+ // Retrieving the result
+ unique_future<_Res&>
get_future()
- { return unique_future<_Result&>(_M_future); }
+ { return unique_future<_Res&>(_M_future); }
- // setting the result
+ // Setting the result
void
- set_value(_Result& __r)
+ set_value(_Res& __r)
{
if (!_M_satisfied())
_M_storage->_M_value_ptr = &__r;
@@ -704,20 +749,24 @@ namespace std
}
private:
- template<typename> friend class packaged_task;
bool _M_satisfied() { return !static_cast<bool>(_M_storage); }
- shared_ptr<_Future_state> _M_future;
- typename _Future_ptr<_Future_result<_Result&>>::type _M_storage;
};
- // specialization for promise<void>
+ /// Explicit specialization for promise<void>
template<>
class promise<void>
{
+ template<typename> friend class packaged_task;
+ typedef __future_base::_State _State;
+ typedef __future_base::_Result<void> result_type;
+
+ shared_ptr<__future_base::_State> _M_future;
+ typename __future_base::_Ptr<result_type>::type _M_storage;
+
public:
promise()
- : _M_future(std::make_shared<_Future_state>()),
- _M_storage(new _Future_result<void>())
+ : _M_future(std::make_shared<_State>()),
+ _M_storage(new result_type())
{ }
promise(promise&& __rhs)
@@ -742,7 +791,7 @@ namespace std
_M_future->_M_break_promise(std::move(_M_storage));
}
- // assignment
+ // Assignment
promise&
operator=(promise&& __rhs)
{
@@ -759,12 +808,12 @@ namespace std
_M_storage.swap(__rhs._M_storage);
}
- // retrieving the result
+ // Retrieving the result
unique_future<void>
get_future()
{ return unique_future<void>(_M_future); }
- // setting the result
+ // Setting the result
void
set_value()
{
@@ -780,53 +829,54 @@ namespace std
}
private:
- template<typename> friend class packaged_task;
bool _M_satisfied() { return !static_cast<bool>(_M_storage); }
- shared_ptr<_Future_state> _M_future;
- _Future_ptr<_Future_result<void>>::type _M_storage;
};
// TODO: requires allocator concepts
/*
- template<typename _Result, class Alloc>
- concept_map UsesAllocator<promise<_Result>, Alloc>
+ template<typename _Res, class Alloc>
+ concept_map UsesAllocator<promise<_Res>, Alloc>
{
typedef Alloc allocator_type;
}
*/
-
- template<typename _Result, typename... _ArgTypes>
+ /// Primary template.
+ template<typename _Res, typename... _ArgTypes>
struct _Run_task
{
static void
- _S_run(promise<_Result>& __p, function<_Result(_ArgTypes...)>& __f,
- _ArgTypes... __args)
+ _S_run(promise<_Res>& __p, function<_Res(_ArgTypes...)>& __f,
+ _ArgTypes... __args)
{
__p.set_value(__f(std::forward<_ArgTypes>(__args)...));
}
};
- // specialization used by packaged_task<void(...)>
+ /// Specialization used by packaged_task<void(...)>
template<typename... _ArgTypes>
struct _Run_task<void, _ArgTypes...>
{
static void
_S_run(promise<void>& __p, function<void(_ArgTypes...)>& __f,
- _ArgTypes... __args)
+ _ArgTypes... __args)
{
__f(std::forward<_ArgTypes>(__args)...);
__p.set_value();
}
};
+
/// packaged_task
- template<typename _Result, typename... _ArgTypes>
- class packaged_task<_Result(_ArgTypes...)>
+ template<typename _Res, typename... _ArgTypes>
+ class packaged_task<_Res(_ArgTypes...)>
{
+ function<_Res(_ArgTypes...)> _M_task;
+ promise<_Res> _M_promise;
+
public:
- typedef _Result result_type;
+ typedef _Res result_type;
- // construction and destruction
+ // Construction and destruction
packaged_task() { }
template<typename _Fn>
@@ -838,7 +888,7 @@ namespace std
packaged_task(_Fn&& __fn) : _M_task(std::move(__fn)) { }
explicit
- packaged_task(_Result(*__fn)(_ArgTypes...)) : _M_task(__fn) { }
+ packaged_task(_Res(*__fn)(_ArgTypes...)) : _M_task(__fn) { }
// TODO: requires allocator concepts
/*
@@ -857,11 +907,11 @@ namespace std
~packaged_task() = default;
- // no copy
+ // No copy
packaged_task(packaged_task&) = delete;
packaged_task& operator=(packaged_task&) = delete;
- // move support
+ // Move support
packaged_task(packaged_task&& __other)
{ this->swap(__other); }
@@ -880,8 +930,8 @@ namespace std
explicit operator bool() const { return static_cast<bool>(_M_task); }
- // result retrieval
- unique_future<_Result>
+ // Result retrieval
+ unique_future<_Res>
get_future()
{
__try
@@ -898,7 +948,7 @@ namespace std
}
}
- // execution
+ // Execution
void
operator()(_ArgTypes... __args)
{
@@ -913,7 +963,7 @@ namespace std
__try
{
- _Run_task<_Result, _ArgTypes...>::_S_run(_M_promise, _M_task,
+ _Run_task<_Res, _ArgTypes...>::_S_run(_M_promise, _M_task,
std::forward<_ArgTypes>(__args)...);
}
__catch (...)
@@ -922,11 +972,7 @@ namespace std
}
}
- void reset() { promise<_Result>().swap(_M_promise); }
-
- private:
- function<_Result(_ArgTypes...)> _M_task;
- promise<_Result> _M_promise;
+ void reset() { promise<_Res>().swap(_M_promise); }
};
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
diff --git a/libstdc++-v3/include/std/iosfwd b/libstdc++-v3/include/std/iosfwd
index 9bba0ab6bfc..b3405d7f1d5 100644
--- a/libstdc++-v3/include/std/iosfwd
+++ b/libstdc++-v3/include/std/iosfwd
@@ -43,6 +43,36 @@
_GLIBCXX_BEGIN_NAMESPACE(std)
+ /**
+ * @defgroup io I/O
+ *
+ * Nearly all of the I/O classes are parameterized on the type of
+ * characters they read and write. (The major exception is ios_base at
+ * the top of the hierarchy.) This is a change from pre-Standard
+ * streams, which were not templates.
+ *
+ * For ease of use and compatibility, all of the basic_* I/O-related
+ * classes are given typedef names for both of the builtin character
+ * widths (wide and narrow). The typedefs are the same as the
+ * pre-Standard names, for example:
+ *
+ * @code
+ * typedef basic_ifstream<char> ifstream;
+ * @endcode
+ *
+ * Because properly forward-declaring these classes can be difficult, you
+ * should not do it yourself. Instead, include the &lt;iosfwd&gt;
+ * header, which contains only declarations of all the I/O classes as
+ * well as the typedefs. Trying to forward-declare the typedefs
+ * themselves (e.g., "class ostream;") is not valid ISO C++.
+ *
+ * For more specific declarations, see
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch24.html
+ *
+ * @{
+ */
+ class ios_base;
+
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_ios;
@@ -94,36 +124,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// Not included. (??? Apparently no LWG number?)
- class ios_base;
- /**
- * @defgroup io I/O
- *
- * Nearly all of the I/O classes are parameterized on the type of
- * characters they read and write. (The major exception is ios_base at
- * the top of the hierarchy.) This is a change from pre-Standard
- * streams, which were not templates.
- *
- * For ease of use and compatibility, all of the basic_* I/O-related
- * classes are given typedef names for both of the builtin character
- * widths (wide and narrow). The typedefs are the same as the
- * pre-Standard names, for example:
- *
- * @code
- * typedef basic_ifstream<char> ifstream;
- * @endcode
- *
- * Because properly forward-declaring these classes can be difficult, you
- * should not do it yourself. Instead, include the &lt;iosfwd&gt;
- * header, which contains only declarations of all the I/O classes as
- * well as the typedefs. Trying to forward-declare the typedefs
- * themselves (e.g., "class ostream;") is not valid ISO C++.
- *
- * For more specific declarations, see
- * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch24.html
- *
- * @{
- */
typedef basic_ios<char> ios; ///< @isiosfwd
typedef basic_streambuf<char> streambuf; ///< @isiosfwd
typedef basic_istream<char> istream; ///< @isiosfwd
diff --git a/libstdc++-v3/include/std/limits b/libstdc++-v3/include/std/limits
index 41bf806d5eb..1f3f078d0f0 100644
--- a/libstdc++-v3/include/std/limits
+++ b/libstdc++-v3/include/std/limits
@@ -203,9 +203,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* Is this supposed to be "if the type is integral"?
*/
static const bool is_integer = false;
- /** True if the type uses an exact representation. "All integer types are
+ /** True if the type uses an exact representation. 'All integer types are
exact, but not all exact types are integer. For example, rational and
- fixed-exponent representations are exact but not integer."
+ fixed-exponent representations are exact but not integer.'
[18.2.1.2]/15 */
static const bool is_exact = false;
/** For integer types, specifies the base of the representation. For
@@ -229,23 +229,23 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
/** True if the type has a representation for positive infinity. */
static const bool has_infinity = false;
/** True if the type has a representation for a quiet (non-signaling)
- "Not a Number." */
+ 'Not a Number.' */
static const bool has_quiet_NaN = false;
/** True if the type has a representation for a signaling
- "Not a Number." */
+ 'Not a Number.' */
static const bool has_signaling_NaN = false;
/** See std::float_denorm_style for more information. */
static const float_denorm_style has_denorm = denorm_absent;
- /** "True if loss of accuracy is detected as a denormalization loss,
- rather than as an inexact result." [18.2.1.2]/42 */
+ /** 'True if loss of accuracy is detected as a denormalization loss,
+ rather than as an inexact result.' [18.2.1.2]/42 */
static const bool has_denorm_loss = false;
/** True if-and-only-if the type adheres to the IEC 559 standard, also
known as IEEE 754. (Only makes sense for floating point types.) */
static const bool is_iec559 = false;
- /** "True if the set of values representable by the type is finite. All
+ /** 'True if the set of values representable by the type is finite. All
built-in types are bounded, this member would be false for arbitrary
- precision types." [18.2.1.2]/54 */
+ precision types.' [18.2.1.2]/54 */
static const bool is_bounded = false;
/** True if the type is @e modulo, that is, if it is possible to add two
positive numbers and have a result that wraps around to a third number
diff --git a/libstdc++-v3/include/std/memory b/libstdc++-v3/include/std/memory
index 9defd487c60..3e7d4e8466b 100644
--- a/libstdc++-v3/include/std/memory
+++ b/libstdc++-v3/include/std/memory
@@ -46,6 +46,20 @@
#pragma GCC system_header
+/**
+ * @defgroup memory Memory
+ * @ingroup utilities
+ *
+ * Components for memory allocation, deallocation, and management.
+ */
+
+/**
+ * @defgroup pointer_abstractions Pointer Abstractions
+ * @ingroup memory
+ *
+ * Smart pointers, etc.
+ */
+
#include <bits/stl_algobase.h>
#include <bits/allocator.h>
#include <bits/stl_construct.h>
@@ -64,37 +78,29 @@
# include <ext/concurrence.h>
# include <bits/functexcept.h>
# include <bits/stl_function.h> // std::less
-# include <bits/unique_ptr.h>
-# include <debug/debug.h>
# include <type_traits>
# include <functional>
+# include <debug/debug.h>
+# include <bits/unique_ptr.h>
# if _GLIBCXX_DEPRECATED
# include <backward/auto_ptr.h>
# endif
# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/boost_sp_counted_base.h>
-# include <bits/shared_ptr.h>
# else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/boost_sp_counted_base.h>
-# include <bits/shared_ptr.h>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
# endif
+# include <bits/shared_ptr.h>
#else
# include <backward/auto_ptr.h>
#endif
-/**
- * @defgroup memory Memory
- * @ingroup utilities
- *
- * Components for memory allocation, deallocation, and management.
- */
-
#endif /* _GLIBCXX_MEMORY */
diff --git a/libstdc++-v3/include/std/ostream b/libstdc++-v3/include/std/ostream
index 9fc693cb3c3..d6241ba39a2 100644
--- a/libstdc++-v3/include/std/ostream
+++ b/libstdc++-v3/include/std/ostream
@@ -533,8 +533,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
*
* This manipulator is often mistakenly used when a simple newline is
* desired, leading to poor buffering performance. See
- * http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#2 for more
- * on this subject.
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch25s02.html
+ * for more on this subject.
*/
template<typename _CharT, typename _Traits>
inline basic_ostream<_CharT, _Traits>&
diff --git a/libstdc++-v3/include/std/random b/libstdc++-v3/include/std/random
index b57ef4925d6..72d3ceb7f43 100644
--- a/libstdc++-v3/include/std/random
+++ b/libstdc++-v3/include/std/random
@@ -43,7 +43,6 @@
#include <limits>
#include <ext/type_traits.h>
#include <ext/numeric_traits.h>
-#include <bits/concept_check.h>
#include <debug/debug.h>
#include <type_traits>
diff --git a/libstdc++-v3/include/std/sstream b/libstdc++-v3/include/std/sstream
index f5e3191c4cd..0ebf506d0c7 100644
--- a/libstdc++-v3/include/std/sstream
+++ b/libstdc++-v3/include/std/sstream
@@ -112,9 +112,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* @brief Copying out the string buffer.
* @return A copy of one of the underlying sequences.
*
- * "If the buffer is only created in input mode, the underlying
+ * 'If the buffer is only created in input mode, the underlying
* character sequence is equal to the input sequence; otherwise, it
- * is equal to the output sequence." [27.7.1.2]/1
+ * is equal to the output sequence.' [27.7.1.2]/1
*/
__string_type
str() const
diff --git a/libstdc++-v3/include/std/streambuf b/libstdc++-v3/include/std/streambuf
index 790be0ec4d4..7d6b8c789cb 100644
--- a/libstdc++-v3/include/std/streambuf
+++ b/libstdc++-v3/include/std/streambuf
@@ -341,7 +341,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* @return The previous character, if possible.
*
* Similar to sungetc(), but @a c is pushed onto the stream instead
- * of "the previous character". If successful, the next character
+ * of 'the previous character.' If successful, the next character
* fetched from the input stream will be @a c.
*/
int_type
@@ -366,8 +366,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
*
* If a putback position is available, this function decrements the
* input pointer and returns that character. Otherwise, calls and
- * returns pbackfail(). The effect is to "unget" the last character
- * "gotten".
+ * returns pbackfail(). The effect is to 'unget' the last character
+ * 'gotten.'
*/
int_type
sungetc()
@@ -541,10 +541,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* @param loc A new locale.
*
* Translations done during I/O which depend on the current locale
- * are changed by this call. The standard adds, "Between invocations
+ * are changed by this call. The standard adds, 'Between invocations
* of this function a class derived from streambuf can safely cache
* results of calls to locale functions and to members of facets
- * so obtained."
+ * so obtained.'
*
* @note Base class version does nothing.
*/
@@ -608,18 +608,18 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* @return An estimate of the number of characters available in the
* input sequence, or -1.
*
- * "If it returns a positive value, then successive calls to
+ * 'If it returns a positive value, then successive calls to
* @c underflow() will not return @c traits::eof() until at least that
* number of characters have been supplied. If @c showmanyc()
- * returns -1, then calls to @c underflow() or @c uflow() will fail."
+ * returns -1, then calls to @c underflow() or @c uflow() will fail.'
* [27.5.2.4.3]/1
*
* @note Base class version does nothing, returns zero.
- * @note The standard adds that "the intention is not only that the
+ * @note The standard adds that 'the intention is not only that the
* calls [to underflow or uflow] will not return @c eof() but
- * that they will return "immediately".
- * @note The standard adds that "the morphemes of @c showmanyc are
- * "es-how-many-see", not "show-manic".
+ * that they will return immediately.'
+ * @note The standard adds that 'the morphemes of @c showmanyc are
+ * 'es-how-many-see', not 'show-manic'.'
*/
virtual streamsize
showmanyc() { return 0; }
@@ -646,7 +646,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
*
* Informally, this function is called when the input buffer is
* exhausted (or does not exist, as buffering need not actually be
- * done). If a buffer exists, it is "refilled". In either case, the
+ * done). If a buffer exists, it is 'refilled'. In either case, the
* next available character is returned, or @c traits::eof() to
* indicate a null pending sequence.
*
@@ -690,7 +690,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
/**
* @brief Tries to back up the input sequence.
* @param c The character to be inserted back into the sequence.
- * @return eof() on failure, "some other value" on success
+ * @return eof() on failure, 'some other value' on success
* @post The constraints of @c gptr(), @c eback(), and @c pptr()
* are the same as for @c underflow().
*
@@ -726,7 +726,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
*
* Informally, this function is called when the output buffer is full
* (or does not exist, as buffering need not actually be done). If a
- * buffer exists, it is "consumed", with "some effect" on the
+ * buffer exists, it is 'consumed', with 'some effect' on the
* controlled sequence. (Typically, the buffer is written out to the
* sequence verbatim.) In either case, the character @a c is also
* written out, if @a c is not @c eof().
diff --git a/libstdc++-v3/include/std/system_error b/libstdc++-v3/include/std/system_error
index 7f462a20dff..864741129a9 100644
--- a/libstdc++-v3/include/std/system_error
+++ b/libstdc++-v3/include/std/system_error
@@ -64,7 +64,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
class error_category
{
protected:
- error_category() = default;
+ error_category();
public:
virtual ~error_category() { }
@@ -100,6 +100,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ return this != &__other; }
};
+ inline error_category::error_category() = default;
+
// DR 890.
_GLIBCXX_CONST const error_category& system_category() throw ();
_GLIBCXX_CONST const error_category& generic_category() throw ();
diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple
index 18cd89bca3b..1c46852a8fa 100644
--- a/libstdc++-v3/include/std/tuple
+++ b/libstdc++-v3/include/std/tuple
@@ -174,8 +174,7 @@ namespace std
template<typename... _UElements>
_Tuple_impl(_Tuple_impl<_Idx, _UElements...>&& __in)
: _Inherited(std::move(__in._M_tail())),
- _Base(std::forward<typename _Tuple_impl<_Idx, _UElements...>::
- _Base>(__in._M_head())) { }
+ _Base(std::move(__in._M_head())) { }
_Tuple_impl&
operator=(const _Tuple_impl& __in)
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
index dd26bb84dbf..788edf66cff 100644
--- a/libstdc++-v3/include/std/type_traits
+++ b/libstdc++-v3/include/std/type_traits
@@ -57,7 +57,8 @@
namespace std
{
- /** @addtogroup metaprogramming
+ /**
+ * @addtogroup metaprogramming
* @{
*/
@@ -154,7 +155,7 @@ namespace std
template<typename _Tp>
struct __is_signed_helper<_Tp, true, false>
- : public integral_constant<bool, _Tp(-1) < _Tp(0)>
+ : public integral_constant<bool, static_cast<bool>(_Tp(-1) < _Tp(0))>
{ };
/// is_signed
@@ -240,52 +241,28 @@ namespace std
{ };
// Relationships between types.
+ template<typename _From, typename _To,
+ bool = (is_void<_From>::value || is_void<_To>::value
+ || is_function<_To>::value || is_array<_To>::value)>
+ struct __is_convertible_helper
+ { static const bool __value = (is_void<_From>::value
+ && is_void<_To>::value); };
+
template<typename _From, typename _To>
- struct __is_convertible_simple
+ struct __is_convertible_helper<_From, _To, false>
: public __sfinae_types
{
private:
static __one __test(_To);
static __two __test(...);
- static _From __makeFrom();
-
+ static typename add_rvalue_reference<_From>::type __makeFrom();
+
public:
static const bool __value = sizeof(__test(__makeFrom())) == 1;
};
- template<typename _Tp>
- struct __is_int_or_cref
- {
- typedef typename remove_reference<_Tp>::type __rr_Tp;
- static const bool __value = (is_integral<_Tp>::value
- || (is_integral<__rr_Tp>::value
- && is_const<__rr_Tp>::value
- && !is_volatile<__rr_Tp>::value));
- };
-
- template<typename _From, typename _To,
- bool = (is_void<_From>::value || is_void<_To>::value
- || is_function<_To>::value || is_array<_To>::value
- // This special case is here only to avoid warnings.
- || (is_floating_point<typename
- remove_reference<_From>::type>::value
- && __is_int_or_cref<_To>::__value))>
- struct __is_convertible_helper
- {
- // "An imaginary lvalue of type From...".
- static const bool __value = (__is_convertible_simple<typename
- add_lvalue_reference<_From>::type,
- _To>::__value);
- };
-
- template<typename _From, typename _To>
- struct __is_convertible_helper<_From, _To, true>
- { static const bool __value = (is_void<_To>::value
- || (__is_int_or_cref<_To>::__value
- && !is_void<_From>::value)); };
-
// XXX FIXME
- // The C++0x specifications are different, see N2255.
+ // The C++0x specifications require front-end support, see N2255.
/// is_convertible
template<typename _From, typename _To>
struct is_convertible
diff --git a/libstdc++-v3/include/std/utility b/libstdc++-v3/include/std/utility
index 1a6d0b1b6b5..c3826eaca6b 100644
--- a/libstdc++-v3/include/std/utility
+++ b/libstdc++-v3/include/std/utility
@@ -58,6 +58,14 @@
#pragma GCC system_header
+/**
+ * @defgroup utilities Utilities
+ *
+ * Components deemed generally useful. Includes pair, tuple,
+ * forward/move helpers, ratio, function object, metaprogramming and
+ * type traits, time, date, and memory functions.
+ */
+
#include <bits/c++config.h>
#include <bits/stl_relops.h>
#include <bits/stl_pair.h>
@@ -83,12 +91,4 @@
# include <initializer_list>
#endif
-/**
- * @defgroup utilities Utilities
- *
- * Components deemed generally useful. Includes pair, tuple,
- * forward/move helpers, ratio, function object, metaprogramming and
- * type traits, time, date, and memory functions.
- */
-
#endif /* _GLIBCXX_UTILITY */
diff --git a/libstdc++-v3/include/tr1/shared_ptr.h b/libstdc++-v3/include/tr1/shared_ptr.h
index 0afce01557b..ba2cacae4ed 100644
--- a/libstdc++-v3/include/tr1/shared_ptr.h
+++ b/libstdc++-v3/include/tr1/shared_ptr.h
@@ -57,16 +57,12 @@ namespace std
{
namespace tr1
{
-
template<typename _Ptr, typename _Deleter, _Lock_policy _Lp>
class _Sp_counted_base_impl
: public _Sp_counted_base<_Lp>
{
public:
- /**
- * @brief
- * @pre __d(__p) must not throw.
- */
+ // Precondition: __d(__p) must not throw.
_Sp_counted_base_impl(_Ptr __p, _Deleter __d)
: _M_ptr(__p), _M_del(__d) { }
@@ -346,31 +342,19 @@ namespace tr1
struct __const_cast_tag { };
struct __dynamic_cast_tag { };
- /**
- * @class __shared_ptr
- *
- * A smart pointer with reference-counted copy semantics.
- * The object pointed to is deleted when the last shared_ptr pointing to
- * it is destroyed or reset.
- */
+ // A smart pointer with reference-counted copy semantics. The
+ // object pointed to is deleted when the last shared_ptr pointing to
+ // it is destroyed or reset.
template<typename _Tp, _Lock_policy _Lp>
class __shared_ptr
{
public:
typedef _Tp element_type;
- /** @brief Construct an empty %__shared_ptr.
- * @post use_count()==0 && get()==0
- */
__shared_ptr()
: _M_ptr(0), _M_refcount() // never throws
{ }
- /** @brief Construct a %__shared_ptr that owns the pointer @a __p.
- * @param __p A pointer that is convertible to element_type*.
- * @post use_count() == 1 && get() == __p
- * @throw std::bad_alloc, in which case @c delete @a __p is called.
- */
template<typename _Tp1>
explicit
__shared_ptr(_Tp1* __p)
@@ -381,19 +365,6 @@ namespace tr1
__enable_shared_from_this_helper(_M_refcount, __p, __p);
}
- //
- // Requirements: _Deleter's copy constructor and destructor must
- // not throw
- //
- // __shared_ptr will release __p by calling __d(__p)
- //
- /** @brief Construct a %__shared_ptr that owns the pointer @a __p
- * and the deleter @a __d.
- * @param __p A pointer.
- * @param __d A deleter.
- * @post use_count() == 1 && get() == __p
- * @throw std::bad_alloc, in which case @a __d(__p) is called.
- */
template<typename _Tp1, typename _Deleter>
__shared_ptr(_Tp1* __p, _Deleter __d)
: _M_ptr(__p), _M_refcount(__p, __d)
@@ -405,24 +376,11 @@ namespace tr1
// generated copy constructor, assignment, destructor are fine.
- /** @brief If @a __r is empty, constructs an empty %__shared_ptr;
- * otherwise construct a %__shared_ptr that shares ownership
- * with @a __r.
- * @param __r A %__shared_ptr.
- * @post get() == __r.get() && use_count() == __r.use_count()
- */
template<typename _Tp1>
__shared_ptr(const __shared_ptr<_Tp1, _Lp>& __r)
: _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws
{ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) }
- /** @brief Constructs a %__shared_ptr that shares ownership with @a __r
- * and stores a copy of the pointer stored in @a __r.
- * @param __r A weak_ptr.
- * @post use_count() == __r.use_count()
- * @throw bad_weak_ptr when __r.expired(),
- * in which case the constructor has no effect.
- */
template<typename _Tp1>
explicit
__shared_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
@@ -435,9 +393,7 @@ namespace tr1
}
#if !defined(__GXX_EXPERIMENTAL_CXX0X__) || _GLIBCXX_DEPRECATED
- /**
- * @post use_count() == 1 and __r.get() == 0
- */
+ // Postcondition: use_count() == 1 and __r.get() == 0
template<typename _Tp1>
explicit
__shared_ptr(std::auto_ptr<_Tp1>& __r)
@@ -595,30 +551,30 @@ namespace tr1
{ __a.swap(__b); }
// 2.2.3.9 shared_ptr casts
- /** @warning The seemingly equivalent
- * <code>shared_ptr<_Tp, _Lp>(static_cast<_Tp*>(__r.get()))</code>
- * will eventually result in undefined behaviour,
- * attempting to delete the same object twice.
+ /* The seemingly equivalent
+ * shared_ptr<_Tp, _Lp>(static_cast<_Tp*>(__r.get()))
+ * will eventually result in undefined behaviour,
+ * attempting to delete the same object twice.
*/
template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
inline __shared_ptr<_Tp, _Lp>
static_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
{ return __shared_ptr<_Tp, _Lp>(__r, __static_cast_tag()); }
- /** @warning The seemingly equivalent
- * <code>shared_ptr<_Tp, _Lp>(const_cast<_Tp*>(__r.get()))</code>
- * will eventually result in undefined behaviour,
- * attempting to delete the same object twice.
+ /* The seemingly equivalent
+ * shared_ptr<_Tp, _Lp>(const_cast<_Tp*>(__r.get()))
+ * will eventually result in undefined behaviour,
+ * attempting to delete the same object twice.
*/
template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
inline __shared_ptr<_Tp, _Lp>
const_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
{ return __shared_ptr<_Tp, _Lp>(__r, __const_cast_tag()); }
- /** @warning The seemingly equivalent
- * <code>shared_ptr<_Tp, _Lp>(dynamic_cast<_Tp*>(__r.get()))</code>
- * will eventually result in undefined behaviour,
- * attempting to delete the same object twice.
+ /* The seemingly equivalent
+ * shared_ptr<_Tp, _Lp>(dynamic_cast<_Tp*>(__r.get()))
+ * will eventually result in undefined behaviour,
+ * attempting to delete the same object twice.
*/
template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
inline __shared_ptr<_Tp, _Lp>
@@ -825,7 +781,6 @@ namespace tr1
};
- /// shared_ptr
// The actual shared_ptr, with forwarding constructors and
// assignment operators.
template<typename _Tp>
@@ -914,7 +869,6 @@ namespace tr1
{ return shared_ptr<_Tp>(__r, __dynamic_cast_tag()); }
- /// weak_ptr
// The actual weak_ptr, with forwarding constructors and
// assignment operators.
template<typename _Tp>
@@ -971,7 +925,6 @@ namespace tr1
}
};
- /// enable_shared_from_this
template<typename _Tp>
class enable_shared_from_this
{
@@ -1013,7 +966,6 @@ namespace tr1
mutable weak_ptr<_Tp> _M_weak_this;
};
-
}
}
diff --git a/libstdc++-v3/include/tr1_impl/boost_sp_counted_base.h b/libstdc++-v3/include/tr1_impl/boost_sp_counted_base.h
index 48e601f2171..56030856dca 100644
--- a/libstdc++-v3/include/tr1_impl/boost_sp_counted_base.h
+++ b/libstdc++-v3/include/tr1_impl/boost_sp_counted_base.h
@@ -51,6 +51,10 @@ namespace std
{
_GLIBCXX_BEGIN_NAMESPACE_TR1
+ /**
+ * @brief Exception possibly thrown by @c shared_ptr.
+ * @ingroup exceptions
+ */
class bad_weak_ptr : public std::exception
{
public:
diff --git a/libstdc++-v3/include/tr1_impl/regex b/libstdc++-v3/include/tr1_impl/regex
index 6f76a981419..8df62c212cc 100644
--- a/libstdc++-v3/include/tr1_impl/regex
+++ b/libstdc++-v3/include/tr1_impl/regex
@@ -135,9 +135,9 @@ namespace regex_constants
* Specifies that the grammar recognized by the regular expression engine is
* that used by POSIX utility awk in IEEE Std 1003.1-2001. This option is
* identical to syntax_option_type extended, except that C-style escape
- * sequences are supported. These sequences are, explicitly, "\\", "\a",
- * "\b", "\f", "\n", "\r", "\t" , "\v", "\"", "'",
- * and "\ddd" (where ddd is one, two, or three octal digits).
+ * sequences are supported. These sequences are, explicitly, '\\', '\a',
+ * '\b', '\f', '\n', '\r', '\t' , '\v', '\'', ''',
+ * and '\ddd' (where ddd is one, two, or three octal digits).
*/
static const syntax_option_type awk = 1 << _S_awk;
@@ -202,26 +202,26 @@ namespace regex_constants
/**
* The first character in the sequence [first, last) is treated as though it
- * is not at the beginning of a line, so the character "^" in the regular
+ * is not at the beginning of a line, so the character '^' in the regular
* expression shall not match [first, first).
*/
static const match_flag_type match_not_bol = 1 << _S_not_bol;
/**
* The last character in the sequence [first, last) is treated as though it
- * is not at the end of a line, so the character "$" in the regular
+ * is not at the end of a line, so the character '$' in the regular
* expression shall not match [last, last).
*/
static const match_flag_type match_not_eol = 1 << _S_not_eol;
/**
- * The expression "\b" is not matched against the sub-sequence
+ * The expression '\b' is not matched against the sub-sequence
* [first,first).
*/
static const match_flag_type match_not_bow = 1 << _S_not_bow;
/**
- * The expression "\b" should not be matched against the sub-sequence
+ * The expression '\b' should not be matched against the sub-sequence
* [last,last).
*/
static const match_flag_type match_not_eow = 1 << _S_not_eow;
@@ -363,7 +363,7 @@ namespace regex_constants
static const error_type error_space(_S_error_space);
/**
- * One of "*?+{" was not preceded by a valid regular expression.
+ * One of '*?+{' was not preceded by a valid regular expression.
*/
static const error_type error_badrepeat(_S_error_badrepeat);
@@ -2532,7 +2532,7 @@ namespace regex_constants
// [7.12.2] Class template regex_token_iterator
/**
- * Iterates over submatches in a range (or "splits" a text string).
+ * Iterates over submatches in a range (or 'splits' a text string).
*
* The purpose of this iterator is to enumerate all, or all specified,
* matches of a regular expression within a text range. The dereferenced
diff --git a/libstdc++-v3/include/tr1_impl/type_traits b/libstdc++-v3/include/tr1_impl/type_traits
index 75b85ea2f82..47f5e8f7e60 100644
--- a/libstdc++-v3/include/tr1_impl/type_traits
+++ b/libstdc++-v3/include/tr1_impl/type_traits
@@ -497,5 +497,6 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
#undef _DEFINE_SPEC
// @} group metaprogramming
+
_GLIBCXX_END_NAMESPACE_TR1
}
diff --git a/libstdc++-v3/libsupc++/cxxabi.h b/libstdc++-v3/libsupc++/cxxabi.h
index 834e434e1e1..18861609040 100644
--- a/libstdc++-v3/libsupc++/cxxabi.h
+++ b/libstdc++-v3/libsupc++/cxxabi.h
@@ -582,7 +582,7 @@ namespace __cxxabiv1
/** @namespace abi
* @brief The cross-vendor C++ Application Binary Interface. A
* namespace alias to __cxxabiv1, but user programs should use the
- * alias `abi'.
+ * alias 'abi'.
*
* A brief overview of an ABI is given in the libstdc++ FAQ, question
* 5.8 (you may have a copy of the FAQ locally, or you can view the online
@@ -594,10 +594,10 @@ namespace __cxxabiv1
* along with the current specification.
*
* For users of GCC greater than or equal to 3.x, entry points are
- * available in <cxxabi.h>, which notes, <em>"It is not normally
+ * available in <cxxabi.h>, which notes, <em>'It is not normally
* necessary for user programs to include this header, or use the
* entry points directly. However, this header is available should
- * that be needed."</em>
+ * that be needed.'</em>
*/
namespace abi = __cxxabiv1;
diff --git a/libstdc++-v3/libsupc++/exception b/libstdc++-v3/libsupc++/exception
index be7dec69ab7..989a9ff6f74 100644
--- a/libstdc++-v3/libsupc++/exception
+++ b/libstdc++-v3/libsupc++/exception
@@ -10,12 +10,12 @@
// 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.
@@ -38,7 +38,7 @@
extern "C++" {
-namespace std
+namespace std
{
/**
* @defgroup exceptions Exceptions
@@ -56,7 +56,7 @@ namespace std
* your own %exception classes, or use a different hierarchy, or to
* throw non-class data (e.g., fundamental types).
*/
- class exception
+ class exception
{
public:
exception() throw() { }
@@ -69,7 +69,7 @@ namespace std
/** If an %exception is thrown which is not listed in a function's
* %exception specification, one of these may be thrown. */
- class bad_exception : public exception
+ class bad_exception : public exception
{
public:
bad_exception() throw() { }
@@ -102,15 +102,16 @@ namespace std
* violates the function's %exception specification. */
void unexpected() __attribute__ ((__noreturn__));
- /** [18.6.4]/1: "Returns true after completing evaluation of a
+ /** [18.6.4]/1: 'Returns true after completing evaluation of a
* throw-expression until either completing initialization of the
* exception-declaration in the matching handler or entering @c unexpected()
* due to the throw; or after entering @c terminate() for any reason
* other than an explicit call to @c terminate(). [Note: This includes
- * stack unwinding [15.2]. end note]"
+ * stack unwinding [15.2]. end note]'
*
- * 2: "When @c uncaught_exception() is true, throwing an %exception can
- * result in a call of @c terminate() (15.5.1)."
+ * 2: 'When @c uncaught_exception() is true, throwing an
+ * %exception can result in a call of @c terminate()
+ * (15.5.1).'
*/
bool uncaught_exception() throw() __attribute__ ((__pure__));
@@ -119,10 +120,10 @@ namespace std
_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
- /**
+ /**
* @brief A replacement for the standard terminate_handler which
* prints more information about the terminating exception (if any)
- * on stderr.
+ * on stderr.
*
* @ingroup exceptions
*
@@ -138,7 +139,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
void __verbose_terminate_handler();
_GLIBCXX_END_NAMESPACE
-
+
} // extern "C++"
#pragma GCC visibility pop
diff --git a/libstdc++-v3/libsupc++/nested_exception.h b/libstdc++-v3/libsupc++/nested_exception.h
index 752c595b49b..d4e1347114b 100644
--- a/libstdc++-v3/libsupc++/nested_exception.h
+++ b/libstdc++-v3/libsupc++/nested_exception.h
@@ -57,9 +57,9 @@ namespace std
public:
nested_exception() throw() : _M_ptr(current_exception()) { }
- nested_exception(const nested_exception&) throw() = default;
+ nested_exception(const nested_exception&) = default;
- nested_exception& operator=(const nested_exception&) throw() = default;
+ nested_exception& operator=(const nested_exception&) = default;
virtual ~nested_exception() = default;
diff --git a/libstdc++-v3/libsupc++/tinfo.cc b/libstdc++-v3/libsupc++/tinfo.cc
index 1ce6f8f46ab..d939a3fdab7 100644
--- a/libstdc++-v3/libsupc++/tinfo.cc
+++ b/libstdc++-v3/libsupc++/tinfo.cc
@@ -41,7 +41,8 @@ operator== (const std::type_info& arg) const
#if __GXX_MERGED_TYPEINFO_NAMES
return name () == arg.name ();
#else
- return (&arg == this) || (__builtin_strcmp (name (), arg.name ()) == 0);
+ return (&arg == this)
+ || (name ()[0] != '*' && (__builtin_strcmp (name (), arg.name ()) == 0));
#endif
}
diff --git a/libstdc++-v3/libsupc++/tinfo2.cc b/libstdc++-v3/libsupc++/tinfo2.cc
index 4b01037f3b9..0182c6cc0de 100644
--- a/libstdc++-v3/libsupc++/tinfo2.cc
+++ b/libstdc++-v3/libsupc++/tinfo2.cc
@@ -37,7 +37,8 @@ type_info::before (const type_info &arg) const
#if __GXX_MERGED_TYPEINFO_NAMES
return name () < arg.name ();
#else
- return __builtin_strcmp (name (), arg.name ()) < 0;
+ return (name ()[0] == '*') ? name () < arg.name ()
+ : __builtin_strcmp (name (), arg.name ()) < 0;
#endif
}
diff --git a/libstdc++-v3/libsupc++/typeinfo b/libstdc++-v3/libsupc++/typeinfo
index 4c470430def..f7f9d4e2cc2 100644
--- a/libstdc++-v3/libsupc++/typeinfo
+++ b/libstdc++-v3/libsupc++/typeinfo
@@ -94,7 +94,7 @@ namespace std
/** Returns an @e implementation-defined byte string; this is not
* portable between compilers! */
const char* name() const
- { return __name; }
+ { return __name[0] == '*' ? __name + 1 : __name; }
#if !__GXX_TYPEINFO_EQUALITY_INLINE
// In old abi, or when weak symbols are not supported, there can
@@ -110,12 +110,15 @@ namespace std
// we can run into cases where type_info names aren't merged,
// so we still need to do string comparison.
bool before(const type_info& __arg) const
- { return __builtin_strcmp (__name, __arg.__name) < 0; }
+ { return (__name[0] == '*' && __arg.__name[0] == '*')
+ ? __name < __arg.__name
+ : __builtin_strcmp (__name, __arg.__name) < 0; }
bool operator==(const type_info& __arg) const
{
return ((__name == __arg.__name)
- || __builtin_strcmp (__name, __arg.__name) == 0);
+ || (__name[0] != '*' &&
+ __builtin_strcmp (__name, __arg.__name) == 0));
}
#else
// On some targets we can rely on type_info's NTBS being unique,
diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py
index a5e5b0d02a2..872e2d30a97 100644
--- a/libstdc++-v3/python/libstdcxx/v6/printers.py
+++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -197,6 +197,64 @@ class StdVectorIteratorPrinter:
def to_string(self):
return self.val['_M_current'].dereference()
+class StdTuplePrinter:
+ "Print a std::tuple"
+
+ class _iterator:
+ def __init__ (self, head):
+ self.head = head
+
+ # Set the base class as the initial head of the
+ # tuple.
+ nodes = self.head.type.fields ()
+ if len (nodes) != 1:
+ raise "Top of tuple tree does not consist of a single node."
+
+ # Set the actual head to the first pair.
+ self.head = self.head.cast (nodes[0].type)
+ self.count = 0
+
+ def __iter__ (self):
+ return self
+
+ def next (self):
+ nodes = self.head.type.fields ()
+ # Check for further recursions in the inheritance tree.
+ if len (nodes) == 0:
+ raise StopIteration
+ # Check that this iteration has an expected structure.
+ if len (nodes) != 2:
+ raise "Cannot parse more than 2 nodes in a tuple tree."
+
+ # - Left node is the next recursion parent.
+ # - Right node is the actual class contained in the tuple.
+
+ # Process right node.
+ impl = self.head.cast (nodes[1].type)
+
+ # Process left node and set it as head.
+ self.head = self.head.cast (nodes[0].type)
+ self.count = self.count + 1
+
+ # Finally, check the implementation. If it is
+ # wrapped in _M_head_impl return that, otherwise return
+ # the value "as is".
+ fields = impl.type.fields ()
+ if len (fields) < 1 or fields[0].name != "_M_head_impl":
+ return ('[%d]' % self.count, impl)
+ else:
+ return ('[%d]' % self.count, impl['_M_head_impl'])
+
+ def __init__ (self, typename, val):
+ self.typename = typename
+ self.val = val;
+
+ def children (self):
+ return self._iterator (self.val)
+
+ def to_string (self):
+ return '%s containing' % (self.typename)
+
class StdStackOrQueuePrinter:
"Print a std::stack or std::queue"
@@ -641,6 +699,7 @@ def build_libstdcxx_dictionary ():
pretty_printers_dict[re.compile('^std::multiset<.*>$')] = lambda val: StdSetPrinter("std::multiset", val)
pretty_printers_dict[re.compile('^std::priority_queue<.*>$')] = lambda val: StdStackOrQueuePrinter("std::priority_queue", val)
pretty_printers_dict[re.compile('^std::queue<.*>$')] = lambda val: StdStackOrQueuePrinter("std::queue", val)
+ pretty_printers_dict[re.compile('^std::tuple<.*>$')] = lambda val: StdTuplePrinter("std::tuple", val)
pretty_printers_dict[re.compile('^std::set<.*>$')] = lambda val: StdSetPrinter("std::set", val)
pretty_printers_dict[re.compile('^std::stack<.*>$')] = lambda val: StdStackOrQueuePrinter("std::stack", val)
pretty_printers_dict[re.compile('^std::unique_ptr<.*>$')] = UniquePointerPrinter
diff --git a/libstdc++-v3/scripts/create_testsuite_files b/libstdc++-v3/scripts/create_testsuite_files
index edb9e4a2ce8..f4a0bcd80e0 100755
--- a/libstdc++-v3/scripts/create_testsuite_files
+++ b/libstdc++-v3/scripts/create_testsuite_files
@@ -32,7 +32,7 @@ cd $srcdir
# This is the ugly version of "everything but the current directory". It's
# what has to happen when find(1) doesn't support -mindepth, or -xtype.
dlist=`echo [0-9][0-9]*`
-dlist="$dlist abi backward ext performance tr1"
+dlist="$dlist abi backward ext performance tr1 decimal"
find $dlist "(" -type f -o -type l ")" -name "*.cc" -print > $tmp.01
find $dlist "(" -type f -o -type l ")" -name "*.c" -print > $tmp.02
cat $tmp.01 $tmp.02 | sort > $tmp.1
diff --git a/libstdc++-v3/src/atomic.cc b/libstdc++-v3/src/atomic.cc
index 3a2ff3d52e9..775bb7601c1 100644
--- a/libstdc++-v3/src/atomic.cc
+++ b/libstdc++-v3/src/atomic.cc
@@ -80,16 +80,16 @@ namespace std
atomic_flag_test_and_set_explicit(volatile __atomic_flag_base* __a,
memory_order __m) throw ()
{
- volatile atomic_flag d(__a->_M_i);
- return d.test_and_set(__m);
+ volatile atomic_flag* d = static_cast<volatile atomic_flag*>(__a);
+ return d->test_and_set(__m);
}
void
atomic_flag_clear_explicit(volatile __atomic_flag_base* __a,
memory_order __m) throw ()
{
- volatile atomic_flag d(__a->_M_i);
- return d.clear(__m);
+ volatile atomic_flag* d = static_cast<volatile atomic_flag*>(__a);
+ return d->clear(__m);
}
void
diff --git a/libstdc++-v3/testsuite/20_util/duration/cons/1_neg.cc b/libstdc++-v3/testsuite/20_util/duration/cons/1_neg.cc
index 40d8219093e..56b4e4f413e 100644
--- a/libstdc++-v3/testsuite/20_util/duration/cons/1_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/duration/cons/1_neg.cc
@@ -26,7 +26,7 @@
void
test01()
{
- std::chrono::duration<int> d1(1.0);
+ std::chrono::duration<int> d1(1.0); // { dg-error "no matching" }
}
void
@@ -35,11 +35,7 @@ test02()
using namespace std::chrono;
duration<int, std::micro> d2(8);
- duration<int, std::milli> d2_copy(d2);
+ duration<int, std::milli> d2_copy(d2); // { dg-error "no matching" }
}
-// { dg-error "instantiated from here" "" { target *-*-* } 29 }
-// { dg-error "instantiated from here" "" { target *-*-* } 38 }
-// { dg-error "not exactly representable" "" { target *-*-* } 227 }
-// { dg-error "integral duration with floating point" "" { target *-*-* } 217 }
-// { dg-excess-errors "In instantiation of" }
+// { dg-excess-errors "candidates are" }
diff --git a/libstdc++-v3/testsuite/20_util/duration/cons/dr974.cc b/libstdc++-v3/testsuite/20_util/duration/cons/dr974.cc
new file mode 100644
index 00000000000..4466d30097a
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/duration/cons/dr974.cc
@@ -0,0 +1,33 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+
+// Copyright (C) 2009 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/>.
+
+// 20.8.3.1 duration constructors [time.duration.cons]
+
+#include <chrono>
+
+// DR 974.
+void test01()
+{
+ using namespace std::chrono;
+
+ duration<double> d(3.5);
+ duration<int> i = d; // { dg-error "conversion" }
+}
diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc
index e8b6d33a1ea..297b5cb690d 100644
--- a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc
+++ b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc
@@ -31,6 +31,6 @@ void test01()
test_type d;
}
-// { dg-error "rep cannot be a duration" "" { target *-*-* } 202 }
+// { dg-error "rep cannot be a duration" "" { target *-*-* } 203 }
// { dg-error "instantiated from here" "" { target *-*-* } 31 }
// { dg-excess-errors "In instantiation of" }
diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc
index 91081836779..b83bf494db5 100644
--- a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc
+++ b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc
@@ -32,6 +32,6 @@ void test01()
test_type d;
}
-// { dg-error "must be a specialization of ratio" "" { target *-*-* } 203 }
+// { dg-error "must be a specialization of ratio" "" { target *-*-* } 204 }
// { dg-error "instantiated from here" "" { target *-*-* } 32 }
// { dg-excess-errors "In instantiation of" }
diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc
index 540d72dde46..b4224401d47 100644
--- a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc
+++ b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc
@@ -33,6 +33,6 @@ void test01()
test_type d;
}
-// { dg-error "period must be positive" "" { target *-*-* } 205 }
+// { dg-error "period must be positive" "" { target *-*-* } 206 }
// { dg-error "instantiated from here" "" { target *-*-* } 33 }
// { dg-excess-errors "In instantiation of" }
diff --git a/libstdc++-v3/testsuite/20_util/is_convertible/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_convertible/requirements/explicit_instantiation.cc
new file mode 100644
index 00000000000..646c4b25b0a
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/is_convertible/requirements/explicit_instantiation.cc
@@ -0,0 +1,31 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// 2009-10-29 Paolo Carlini <paolo.carlini@oracle.com>
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// 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/>.
+
+// NB: This file is for testing type_traits with NO OTHER INCLUDES.
+
+#include <type_traits>
+
+namespace std
+{
+ typedef short test_type;
+ template struct is_convertible<test_type, test_type>;
+}
diff --git a/libstdc++-v3/testsuite/20_util/is_convertible/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_convertible/requirements/typedefs.cc
new file mode 100644
index 00000000000..1e8deb511c8
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/is_convertible/requirements/typedefs.cc
@@ -0,0 +1,36 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// 2009-10-29 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// 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/>.
+
+//
+// NB: This file is for testing type_traits with NO OTHER INCLUDES.
+
+#include <type_traits>
+
+void test01()
+{
+ // Check for required typedefs
+ typedef std::is_convertible<int, int> test_type;
+ typedef test_type::value_type value_type;
+ typedef test_type::type type;
+ typedef test_type::type::value_type type_value_type;
+ typedef test_type::type::type type_type;
+}
diff --git a/libstdc++-v3/testsuite/20_util/is_convertible/value.cc b/libstdc++-v3/testsuite/20_util/is_convertible/value.cc
new file mode 100644
index 00000000000..6ec22d024a9
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/is_convertible/value.cc
@@ -0,0 +1,102 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2009-10-29 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// 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 <type_traits>
+#include <testsuite_hooks.h>
+#include <testsuite_tr1.h>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ using std::is_convertible;
+ using namespace __gnu_test;
+
+ // Positive tests.
+ VERIFY( (test_relationship<is_convertible, int, int>(true)) );
+ VERIFY( (test_relationship<is_convertible, int, const int>(true)) );
+ VERIFY( (test_relationship<is_convertible, volatile int, const int>(true)) );
+ VERIFY( (test_relationship<is_convertible, int, float>(true)) );
+ VERIFY( (test_relationship<is_convertible, double, float>(true)) );
+ VERIFY( (test_relationship<is_convertible, float, int>(true)) );
+ VERIFY( (test_relationship<is_convertible, int*, const int*>(true)) );
+ VERIFY( (test_relationship<is_convertible, int*, void*>(true)) );
+ VERIFY( (test_relationship<is_convertible, int[4], int*>(true)) );
+ VERIFY( (test_relationship<is_convertible, float&, int>(true)) );
+ VERIFY( (test_relationship<is_convertible, int, const int&>(true)) );
+ VERIFY( (test_relationship<is_convertible, const int&, int>(true)) );
+ VERIFY( (test_relationship<is_convertible, float, const int&>(true)) );
+ VERIFY( (test_relationship<is_convertible, int(int), int(*)(int)>(true)) );
+ VERIFY( (test_relationship<is_convertible, int(&)(int), int(*)(int)>(true)) );
+ VERIFY( (test_relationship<is_convertible, EnumType, int>(true)) );
+ VERIFY( (test_relationship<is_convertible, ClassType, ClassType>(true)) );
+ VERIFY( (test_relationship<is_convertible, DerivedType, ClassType>(true)) );
+ VERIFY( (test_relationship<is_convertible, DerivedType*, ClassType*>(true)) );
+ VERIFY( (test_relationship<is_convertible, DerivedType&, ClassType&>(true)) );
+
+ VERIFY( (test_relationship<is_convertible, const int, const int&>(true)) );
+
+ VERIFY( (test_relationship<is_convertible, void, void>(true)) );
+ VERIFY( (test_relationship<is_convertible, const void, void>(true)) );
+ VERIFY( (test_relationship<is_convertible, void, volatile void>(true)) );
+
+ // Negative tests.
+ VERIFY( (test_relationship<is_convertible, const int*, int*>(false)) );
+ VERIFY( (test_relationship<is_convertible, int*, float*>(false)) );
+ VERIFY( (test_relationship<is_convertible, const int[4], int*>(false)) );
+ VERIFY( (test_relationship<is_convertible, int[4], int[4]>(false)) );
+ VERIFY( (test_relationship<is_convertible, const int&, int&>(false)) );
+ VERIFY( (test_relationship<is_convertible, float&, int&>(false)) );
+ VERIFY( (test_relationship<is_convertible, float, volatile int&>(false)) );
+ VERIFY( (test_relationship<is_convertible, int(int), int(int)>(false)) );
+ VERIFY( (test_relationship<is_convertible, int(int), int(*)(void)>(false)) );
+ VERIFY( (test_relationship<is_convertible, int(*)(int),
+ int(&)(int)>(false)) );
+ VERIFY( (test_relationship<is_convertible, int, EnumType>(false)) );
+ VERIFY( (test_relationship<is_convertible, int, ClassType>(false)) );
+ VERIFY( (test_relationship<is_convertible, ClassType, DerivedType>(false)) );
+ VERIFY( (test_relationship<is_convertible, ClassType*,
+ DerivedType*>(false)) );
+ VERIFY( (test_relationship<is_convertible, ClassType&,
+ DerivedType&>(false)) );
+
+ VERIFY( (test_relationship<is_convertible, void, int>(false)) );
+ VERIFY( (test_relationship<is_convertible, void, float>(false)) );
+ VERIFY( (test_relationship<is_convertible, void, int(*)(int)>(false)) );
+
+ // C++0x
+ VERIFY( (test_relationship<is_convertible, int, void>(false)) );
+ VERIFY( (test_relationship<is_convertible, int[4], void>(false)) );
+
+ VERIFY( (test_relationship<is_convertible, int, int&>(false)) );
+ VERIFY( (test_relationship<is_convertible, float,
+ volatile float&>(false)) );
+ VERIFY( (test_relationship<is_convertible, const volatile int,
+ const volatile int&>(false)) );
+ VERIFY( (test_relationship<is_convertible, volatile int,
+ volatile int&>(false)) );
+ VERIFY( (test_relationship<is_convertible, int(int), int(&)(int)>(false)) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
index 3455462869b..2ae375454e0 100644
--- a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
@@ -3,7 +3,7 @@
// 2007-05-03 Benjamin Kosnik <bkoz@redhat.com>
//
-// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -48,8 +48,8 @@ void test01()
// { dg-error "instantiated from here" "" { target *-*-* } 40 }
// { dg-error "instantiated from here" "" { target *-*-* } 42 }
-// { dg-error "invalid use of incomplete type" "" { target *-*-* } 570 }
-// { dg-error "declaration of" "" { target *-*-* } 532 }
+// { dg-error "invalid use of incomplete type" "" { target *-*-* } 547 }
+// { dg-error "declaration of" "" { target *-*-* } 509 }
// { dg-excess-errors "At global scope" }
// { dg-excess-errors "In instantiation of" }
diff --git a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
index 3d3a10a9ba8..5bf030cabcb 100644
--- a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
@@ -3,7 +3,7 @@
// 2007-05-03 Benjamin Kosnik <bkoz@redhat.com>
//
-// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -48,8 +48,8 @@ void test01()
// { dg-error "instantiated from here" "" { target *-*-* } 40 }
// { dg-error "instantiated from here" "" { target *-*-* } 42 }
-// { dg-error "invalid use of incomplete type" "" { target *-*-* } 491 }
-// { dg-error "declaration of" "" { target *-*-* } 453 }
+// { dg-error "invalid use of incomplete type" "" { target *-*-* } 468 }
+// { dg-error "declaration of" "" { target *-*-* } 430 }
// { dg-excess-errors "At global scope" }
// { dg-excess-errors "In instantiation of" }
diff --git a/libstdc++-v3/testsuite/20_util/pair/40925.cc b/libstdc++-v3/testsuite/20_util/pair/40925.cc
new file mode 100644
index 00000000000..6abeb617fa0
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/pair/40925.cc
@@ -0,0 +1,67 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// 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 <utility>
+
+struct X
+{
+ explicit X(int, int) { }
+
+private:
+ X(const X&) = delete;
+};
+
+struct move_only
+{
+ move_only() { }
+ move_only(move_only&&) { }
+
+private:
+ move_only(const move_only&) = delete;
+};
+
+// libstdc++/40925
+void test01()
+{
+ int *ip = 0;
+ int X::*mp = 0;
+
+ std::pair<int*, int*> p1(0, 0);
+ std::pair<int*, int*> p2(ip, 0);
+ std::pair<int*, int*> p3(0, ip);
+ std::pair<int*, int*> p4(ip, ip);
+
+ std::pair<int X::*, int*> p5(0, 0);
+ std::pair<int X::*, int X::*> p6(mp, 0);
+ std::pair<int X::*, int X::*> p7(0, mp);
+ std::pair<int X::*, int X::*> p8(mp, mp);
+
+ std::pair<int*, move_only> p9(0, move_only());
+ std::pair<int X::*, move_only> p10(0, move_only());
+ std::pair<move_only, int*> p11(move_only(), 0);
+ std::pair<move_only, int X::*> p12(move_only(), 0);
+
+ std::pair<int*, move_only> p13(ip, move_only());
+ std::pair<int X::*, move_only> p14(mp, move_only());
+ std::pair<move_only, int*> p15(move_only(), ip);
+ std::pair<move_only, int X::*> p16(move_only(), mp);
+
+ std::pair<move_only, move_only> p17(move_only(), move_only());
+}
diff --git a/libstdc++-v3/testsuite/20_util/tuple/cons/41530.cc b/libstdc++-v3/testsuite/20_util/tuple/cons/41530.cc
new file mode 100644
index 00000000000..6bd405c093b
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/tuple/cons/41530.cc
@@ -0,0 +1,34 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// 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/>.
+
+// Tuple
+
+#include <tuple>
+
+class A {};
+class B : public A {};
+
+// PR libstdc++/41530
+void test01()
+{
+ std::tuple<B*> b;
+ std::tuple<A*> a1(b);
+ std::tuple<A*> a2(std::move(b));
+}
diff --git a/libstdc++-v3/testsuite/20_util/unique_ptr/assign/assign_neg.cc b/libstdc++-v3/testsuite/20_util/unique_ptr/assign/assign_neg.cc
index f0236eb2637..bf49aa6b080 100644
--- a/libstdc++-v3/testsuite/20_util/unique_ptr/assign/assign_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/unique_ptr/assign/assign_neg.cc
@@ -49,10 +49,13 @@ test03()
std::unique_ptr<int[2]> p2 = p1;
}
+// { dg-error "deleted function" "" { target *-*-* } 358 }
// { dg-error "used here" "" { target *-*-* } 42 }
// { dg-error "no matching" "" { target *-*-* } 48 }
-// { dg-error "used here" "" { target *-*-* } 49 }
-// { dg-error "candidates are" "" { target *-*-* } 213 }
+// { dg-warning "candidates are" "" { target *-*-* } 119 }
+// { dg-warning "note" "" { target *-*-* } 112 }
+// { dg-warning "note" "" { target *-*-* } 107 }
+// { dg-warning "note" "" { target *-*-* } 102 }
+// { dg-warning "note" "" { target *-*-* } 96 }
// { dg-error "deleted function" "" { target *-*-* } 213 }
-// { dg-error "deleted function" "" { target *-*-* } 358 }
-// { dg-excess-errors "note" }
+// { dg-error "used here" "" { target *-*-* } 49 }
diff --git a/libstdc++-v3/testsuite/25_algorithms/fill/5.cc b/libstdc++-v3/testsuite/25_algorithms/fill_n/1.cc
index edabe1fcc29..edabe1fcc29 100644
--- a/libstdc++-v3/testsuite/25_algorithms/fill/5.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/fill_n/1.cc
diff --git a/libstdc++-v3/testsuite/25_algorithms/inplace_merge/moveable.cc b/libstdc++-v3/testsuite/25_algorithms/inplace_merge/moveable.cc
new file mode 100644
index 00000000000..4b07a63edee
--- /dev/null
+++ b/libstdc++-v3/testsuite/25_algorithms/inplace_merge/moveable.cc
@@ -0,0 +1,52 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// 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/>.
+
+// 25.3.4 [lib.alg.merge]
+
+#include <algorithm>
+#include <testsuite_hooks.h>
+#include <testsuite_iterators.h>
+#include <testsuite_rvalref.h>
+
+using __gnu_test::test_container;
+using __gnu_test::bidirectional_iterator_wrapper;
+using __gnu_test::rvalstruct;
+
+typedef test_container<rvalstruct, bidirectional_iterator_wrapper> container;
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ int array[]={0,2,4,1,3,5};
+ rvalstruct rv_array[6];
+ std::copy(array, array + 6, rv_array);
+ container con(rv_array, rv_array + 6);
+ std::inplace_merge(con.begin(), con.it(3), con.end());
+ VERIFY( rv_array[0] == 0 && rv_array[1] == 1 && rv_array[2] == 2
+ && rv_array[3] == 3 && rv_array[4] == 4 && rv_array[5] == 5 );
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/25_algorithms/inplace_merge/moveable2.cc b/libstdc++-v3/testsuite/25_algorithms/inplace_merge/moveable2.cc
new file mode 100644
index 00000000000..32ab3c70c6b
--- /dev/null
+++ b/libstdc++-v3/testsuite/25_algorithms/inplace_merge/moveable2.cc
@@ -0,0 +1,56 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// 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/>.
+
+// 25.3.4 [lib.alg.merge]
+
+#include <algorithm>
+#include <testsuite_hooks.h>
+#include <testsuite_iterators.h>
+#include <testsuite_rvalref.h>
+
+using __gnu_test::test_container;
+using __gnu_test::bidirectional_iterator_wrapper;
+using __gnu_test::rvalstruct;
+
+typedef test_container<rvalstruct, bidirectional_iterator_wrapper> container;
+
+bool
+are_ordered(const rvalstruct& lhs, const rvalstruct& rhs)
+{ return lhs < rhs; }
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ int array[]={0,2,4,1,3,5};
+ rvalstruct rv_array[6];
+ std::copy(array, array + 6, rv_array);
+ container con(rv_array, rv_array + 6);
+ std::inplace_merge(con.begin(), con.it(3), con.end(), are_ordered);
+ VERIFY( rv_array[0] == 0 && rv_array[1] == 1 && rv_array[2] == 2
+ && rv_array[3] == 3 && rv_array[4] == 4 && rv_array[5] == 5 );
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/25_algorithms/rotate/moveable2.cc b/libstdc++-v3/testsuite/25_algorithms/rotate/moveable2.cc
new file mode 100644
index 00000000000..d48d6029a52
--- /dev/null
+++ b/libstdc++-v3/testsuite/25_algorithms/rotate/moveable2.cc
@@ -0,0 +1,79 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// 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/>.
+
+// 25.2.10 rotate
+
+// Tests rotate when an moveable class is used
+
+#undef _GLIBCXX_CONCEPT_CHECKS
+
+#include <algorithm>
+#include <testsuite_hooks.h>
+#include <testsuite_iterators.h>
+#include <testsuite_rvalref.h>
+
+using __gnu_test::test_container;
+using __gnu_test::forward_iterator_wrapper;
+using __gnu_test::bidirectional_iterator_wrapper;
+using __gnu_test::random_access_iterator_wrapper;
+using __gnu_test::rvalstruct;
+
+typedef test_container<rvalstruct, forward_iterator_wrapper> Fcontainer;
+typedef test_container<rvalstruct, bidirectional_iterator_wrapper> Bcontainer;
+typedef test_container<rvalstruct, random_access_iterator_wrapper> Rcontainer;
+
+template<typename Con>
+ void
+ test_con(int length, int rotate_pos)
+ {
+ bool test __attribute__((unused)) = true;
+
+ rvalstruct array[length];
+ for(int i = 0; i < length; ++i)
+ array[i] = i;
+ Con con(array, array + length);
+ std::rotate(con.begin(), con.it(rotate_pos), con.end());
+
+ if(length != 0)
+ {
+ for(int i = 0; i < length; ++i)
+ VERIFY( array[i].valid && array[i].val == (i + rotate_pos) % length );
+ }
+ }
+
+void
+test01()
+{
+ for(int i = 0; i < 20; ++i)
+ {
+ for(int j = 0; j <= i; ++j)
+ {
+ test_con<Fcontainer>(i, j);
+ test_con<Bcontainer>(i, j);
+ test_con<Rcontainer>(i, j);
+ }
+ }
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/25_algorithms/stable_partition/moveable.cc b/libstdc++-v3/testsuite/25_algorithms/stable_partition/moveable.cc
new file mode 100644
index 00000000000..193f1312849
--- /dev/null
+++ b/libstdc++-v3/testsuite/25_algorithms/stable_partition/moveable.cc
@@ -0,0 +1,64 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without Pred 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/>.
+
+// 25.2.12 [lib.alg.partitions] Partitions.
+
+#include <algorithm>
+#include <functional>
+#include <testsuite_hooks.h>
+#include <testsuite_iterators.h>
+#include <testsuite_rvalref.h>
+
+using __gnu_test::test_container;
+using __gnu_test::random_access_iterator_wrapper;
+using __gnu_test::rvalstruct;
+
+typedef test_container<rvalstruct, random_access_iterator_wrapper> Container;
+
+const int A[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17};
+const int B[] = {2, 4, 6, 8, 10, 12, 14, 16, 1, 3, 5, 7, 9, 11, 13, 15, 17};
+const int N = sizeof(A) / sizeof(int);
+
+struct Pred
+{
+ bool
+ operator()(const rvalstruct& x) const
+ { return (x.val % 2) == 0; }
+};
+
+// 25.2.12 stable_partition()
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ rvalstruct s1[N];
+ std::copy(A, A + N, s1);
+ Container con(s1, s1 + N);
+
+ std::stable_partition(con.begin(), con.end(), Pred());
+ VERIFY( std::equal(s1, s1 + N, B) );
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/25_algorithms/stable_sort/moveable.cc b/libstdc++-v3/testsuite/25_algorithms/stable_sort/moveable.cc
new file mode 100644
index 00000000000..09d6129c06c
--- /dev/null
+++ b/libstdc++-v3/testsuite/25_algorithms/stable_sort/moveable.cc
@@ -0,0 +1,59 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// 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/>.
+
+// 25.3.1.2 [lib.stable.sort]
+
+#undef _GLIBCXX_CONCEPT_CHECKS
+
+#include <algorithm>
+#include <testsuite_hooks.h>
+#include <testsuite_iterators.h>
+#include <testsuite_rvalref.h>
+
+using __gnu_test::test_container;
+using __gnu_test::random_access_iterator_wrapper;
+using __gnu_test::rvalstruct;
+
+typedef test_container<rvalstruct, random_access_iterator_wrapper> Container;
+
+const int A[] = { 10, 20, 1, 11, 2, 12, 3, 13, 4, 14, 5, 15, 6, 16, 7,
+ 17, 8, 18, 9, 19 };
+const int N = sizeof(A) / sizeof(int);
+
+// 25.3.1.2 stable_sort()
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ rvalstruct s1[N];
+ std::copy(A, A + N, s1);
+ Container con(s1, s1 + N);
+ std::stable_sort(con.begin(), con.end());
+ VERIFY( s1[0].valid );
+ for(int i = 1; i < N; ++i)
+ VERIFY( s1[i].val>s1[i-1].val && s1[i].valid );
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/25_algorithms/stable_sort/moveable2.cc b/libstdc++-v3/testsuite/25_algorithms/stable_sort/moveable2.cc
new file mode 100644
index 00000000000..86ff353967d
--- /dev/null
+++ b/libstdc++-v3/testsuite/25_algorithms/stable_sort/moveable2.cc
@@ -0,0 +1,62 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// 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/>.
+
+// 25.3.1.2 [lib.stable.sort]
+
+#undef _GLIBCXX_CONCEPT_CHECKS
+
+#include <algorithm>
+#include <testsuite_hooks.h>
+#include <testsuite_iterators.h>
+#include <testsuite_rvalref.h>
+
+using __gnu_test::test_container;
+using __gnu_test::random_access_iterator_wrapper;
+using __gnu_test::rvalstruct;
+
+typedef test_container<rvalstruct, random_access_iterator_wrapper> Container;
+
+const int A[] = { 10, 20, 1, 11, 2, 12, 3, 13, 4, 14, 5, 15, 6, 16, 7,
+ 17, 8, 18, 9, 19 };
+const int N = sizeof(A) / sizeof(int);
+
+bool order(const rvalstruct& lhs, const rvalstruct& rhs)
+{ return lhs < rhs; }
+
+// 25.3.1.2 stable_sort()
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ rvalstruct s1[N];
+ std::copy(A, A + N, s1);
+ Container con(s1, s1 + N);
+ std::stable_sort(con.begin(), con.end(), order);
+ VERIFY( s1[0].valid );
+ for(int i = 1; i < N; ++i)
+ VERIFY( s1[i].val>s1[i-1].val && s1[i].valid );
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_copy.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_copy.cc
index 328dd71d0bb..6c8498e7b10 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_copy.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_copy.cc
@@ -31,7 +31,7 @@ test01()
{
bool test __attribute__((unused)) = true;
- typedef std::subtract_with_carry_engine<long, 24, 10, 24>
+ typedef std::subtract_with_carry_engine<unsigned long, 24, 10, 24>
base_engine;
base_engine b;
diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_move.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_move.cc
index 990dc9b3fe9..fabe17a2b56 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_move.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_move.cc
@@ -31,7 +31,7 @@ test01()
{
bool test __attribute__((unused)) = true;
- typedef std::subtract_with_carry_engine<long, 24, 10, 24>
+ typedef std::subtract_with_carry_engine<unsigned long, 24, 10, 24>
base_engine;
std::discard_block_engine<base_engine, 389, 24>
diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/default.cc
index 17fea5bdb47..926bb2c24db 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/default.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/default.cc
@@ -33,7 +33,7 @@ test01()
std::discard_block_engine
<
- std::subtract_with_carry_engine<long, 24, 10, 24>,
+ std::subtract_with_carry_engine<unsigned long, 24, 10, 24>,
389, 24
> e;
}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed1.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed1.cc
index efe194c99f0..4cedeb85d39 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed1.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed1.cc
@@ -35,7 +35,7 @@ test01()
std::discard_block_engine
<
- std::subtract_with_carry_engine<long, 24, 10, 24>,
+ std::subtract_with_carry_engine<unsigned long, 24, 10, 24>,
389, 24
> e(seed);
}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed2.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed2.cc
index 82f6fdb1c74..b66752c2b6e 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed2.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed2.cc
@@ -35,7 +35,7 @@ test01()
std::discard_block_engine
<
- std::subtract_with_carry_engine<long, 24, 10, 24>,
+ std::subtract_with_carry_engine<unsigned long, 24, 10, 24>,
389, 24
> e(seed);
}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed_seq.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed_seq.cc
index 58f0f1c392a..aa86b9afedc 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed_seq.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed_seq.cc
@@ -35,7 +35,7 @@ test01()
std::discard_block_engine
<
- std::subtract_with_carry_engine<long, 24, 10, 24>,
+ std::subtract_with_carry_engine<unsigned long, 24, 10, 24>,
389, 24
> e(seq);
}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/equal.cc
index db2497540a3..5d63114fef3 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/equal.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/equal.cc
@@ -33,7 +33,7 @@ test01()
std::discard_block_engine
<
- std::subtract_with_carry_engine<long, 24, 10, 24>,
+ std::subtract_with_carry_engine<unsigned long, 24, 10, 24>,
389, 24
> u, v;
diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/serialize.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/serialize.cc
index 1d39a213f47..7aec649c03b 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/serialize.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/serialize.cc
@@ -35,7 +35,7 @@ test01()
std::stringstream str;
std::discard_block_engine
<
- std::subtract_with_carry_engine<long, 24, 10, 24>,
+ std::subtract_with_carry_engine<unsigned long, 24, 10, 24>,
389, 24
> u, v;
diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/requirements/typedefs.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/requirements/typedefs.cc
index 379b3aeb978..6e23316caa1 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/requirements/typedefs.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/requirements/typedefs.cc
@@ -31,7 +31,7 @@ test01()
{
typedef std::discard_block_engine
<
- std::subtract_with_carry_engine<long, 24, 10, 24>,
+ std::subtract_with_carry_engine<unsigned long, 24, 10, 24>,
389, 24
> test_type;
diff --git a/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/non_uint_neg.cc b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/non_uint_neg.cc
index f54d76ada07..18fb44fdac5 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/non_uint_neg.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/non_uint_neg.cc
@@ -19,7 +19,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-options "-std=c++0x -D_GLIBCXX_CONCEPT_CHECKS" }
+// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
// { dg-error "not a valid type" "" { target *-*-* } 32 }
// { dg-error "invalid type" "" { target *-*-* } 32 }
diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_flag/clear/1.c b/libstdc++-v3/testsuite/29_atomics/atomic_flag/clear/1.c
new file mode 100644
index 00000000000..3fd2f2c799d
--- /dev/null
+++ b/libstdc++-v3/testsuite/29_atomics/atomic_flag/clear/1.c
@@ -0,0 +1,34 @@
+// { dg-options "-x c -shared-libgcc -lstdc++" }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// 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 <cassert>
+#include <stdatomic.h>
+
+// libstdc++/40826
+// libstdc++/40654
+int main()
+{
+ atomic_flag f = ATOMIC_FLAG_INIT;
+
+ atomic_flag_clear(&f); // set to false
+ assert( false == atomic_flag_test_and_set(&f) ); // return previous false, set to true
+ assert( true == atomic_flag_test_and_set(&f) ); // return true
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_flag/clear/1.cc b/libstdc++-v3/testsuite/29_atomics/atomic_flag/clear/1.cc
new file mode 100644
index 00000000000..6cb09f34b7a
--- /dev/null
+++ b/libstdc++-v3/testsuite/29_atomics/atomic_flag/clear/1.cc
@@ -0,0 +1,33 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// 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 <cstdatomic>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ std::atomic_flag f = ATOMIC_FLAG_INIT;
+
+ f.clear(); // set to false
+ VERIFY( false == f.test_and_set() ); // return previous false, set to true
+ VERIFY( true == f.test_and_set() ); // return true
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_flag/cons/1.cc b/libstdc++-v3/testsuite/29_atomics/atomic_flag/cons/1.cc
new file mode 100644
index 00000000000..cfb0c1bbb7a
--- /dev/null
+++ b/libstdc++-v3/testsuite/29_atomics/atomic_flag/cons/1.cc
@@ -0,0 +1,27 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// 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 <stdatomic.h>
+
+void test01()
+{
+ using namespace std;
+ atomic_flag af = ATOMIC_FLAG_INIT;
+}
diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/assign_neg.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/assign_neg.cc
index 0bad6ba2f32..db3baf35772 100644
--- a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/assign_neg.cc
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/assign_neg.cc
@@ -33,4 +33,4 @@ void test01()
}
// { dg-error "used here" "" { target *-*-* } 32 }
-// { dg-error "deleted function" "" { target *-*-* } 862 }
+// { dg-error "deleted function" "" { target *-*-* } 912 }
diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/copy_neg.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/copy_neg.cc
index 655ca8c2f95..8e57d3198f4 100644
--- a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/copy_neg.cc
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/copy_neg.cc
@@ -32,4 +32,4 @@ void test01()
}
// { dg-error "used here" "" { target *-*-* } 31 }
-// { dg-error "deleted function" "" { target *-*-* } 861 }
+// { dg-error "deleted function" "" { target *-*-* } 911 }
diff --git a/libstdc++-v3/testsuite/30_threads/promise/cons/assign_neg.cc b/libstdc++-v3/testsuite/30_threads/promise/cons/assign_neg.cc
index f2fbf178c36..5e16d145ccc 100644
--- a/libstdc++-v3/testsuite/30_threads/promise/cons/assign_neg.cc
+++ b/libstdc++-v3/testsuite/30_threads/promise/cons/assign_neg.cc
@@ -33,4 +33,4 @@ void test01()
}
// { dg-error "used here" "" { target *-*-* } 32 }
-// { dg-error "deleted function" "" { target *-*-* } 588 }
+// { dg-error "deleted function" "" { target *-*-* } 630 }
diff --git a/libstdc++-v3/testsuite/30_threads/promise/cons/copy_neg.cc b/libstdc++-v3/testsuite/30_threads/promise/cons/copy_neg.cc
index 17757aed0ad..1e857977927 100644
--- a/libstdc++-v3/testsuite/30_threads/promise/cons/copy_neg.cc
+++ b/libstdc++-v3/testsuite/30_threads/promise/cons/copy_neg.cc
@@ -32,4 +32,4 @@ void test01()
}
// { dg-error "used here" "" { target *-*-* } 31 }
-// { dg-error "deleted function" "" { target *-*-* } 572 }
+// { dg-error "deleted function" "" { target *-*-* } 614 }
diff --git a/libstdc++-v3/testsuite/30_threads/shared_future/cons/assign_neg.cc b/libstdc++-v3/testsuite/30_threads/shared_future/cons/assign_neg.cc
index 868e0b8a4b8..26211fe1c76 100644
--- a/libstdc++-v3/testsuite/30_threads/shared_future/cons/assign_neg.cc
+++ b/libstdc++-v3/testsuite/30_threads/shared_future/cons/assign_neg.cc
@@ -35,4 +35,4 @@ void test01()
}
// { dg-error "used here" "" { target *-*-* } 34 }
-// { dg-error "deleted function" "" { target *-*-* } 481 }
+// { dg-error "deleted function" "" { target *-*-* } 514 }
diff --git a/libstdc++-v3/testsuite/30_threads/unique_future/cons/assign_neg.cc b/libstdc++-v3/testsuite/30_threads/unique_future/cons/assign_neg.cc
index f8f5a690cf4..e29148ee785 100644
--- a/libstdc++-v3/testsuite/30_threads/unique_future/cons/assign_neg.cc
+++ b/libstdc++-v3/testsuite/30_threads/unique_future/cons/assign_neg.cc
@@ -35,4 +35,4 @@ void test01()
}
// { dg-error "used here" "" { target *-*-* } 34 }
-// { dg-error "deleted function" "" { target *-*-* } 401 }
+// { dg-error "deleted function" "" { target *-*-* } 440 }
diff --git a/libstdc++-v3/testsuite/30_threads/unique_future/cons/copy_neg.cc b/libstdc++-v3/testsuite/30_threads/unique_future/cons/copy_neg.cc
index 95b5a1d7d9a..8134c7d9219 100644
--- a/libstdc++-v3/testsuite/30_threads/unique_future/cons/copy_neg.cc
+++ b/libstdc++-v3/testsuite/30_threads/unique_future/cons/copy_neg.cc
@@ -34,4 +34,4 @@ void test01()
}
// { dg-error "used here" "" { target *-*-* } 33 }
-// { dg-error "deleted function" "" { target *-*-* } 400 }
+// { dg-error "deleted function" "" { target *-*-* } 439 }
diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in
index da2a59ad8bc..cae3d6c07fe 100644
--- a/libstdc++-v3/testsuite/Makefile.in
+++ b/libstdc++-v3/testsuite/Makefile.in
@@ -299,7 +299,7 @@ libgomp_flags = -B${glibcxx_builddir}/../libgomp \
atomic_flags = $(ATOMIC_FLAGS)
parallel_flags = "unix/-D_GLIBCXX_PARALLEL/-fopenmp"
-# Runs the testsuite in profile
+# Runs the testsuite in profile mode.
profile_flags = "unix/-D_GLIBCXX_PROFILE"
# By adding these files here, automake will remove them for 'make clean'
@@ -652,7 +652,7 @@ check-profile: site.exp
fi; \
srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \
EXPECT=$(EXPECT); export EXPECT; \
- $(MAKE) CXXFLAGS="$(atomic_flags)" RUNTESTFLAGS="$(RUNTESTFLAGS) conformance.exp --outdir $${outputdir} --objdir $${outputdir} --target_board=$(profile_flags)" check-DEJAGNU; )
+ $(MAKE) CXXFLAGS="$(atomic_flags) " RUNTESTFLAGS="$(RUNTESTFLAGS) conformance.exp --outdir $${outputdir} --objdir $${outputdir} --target_board=$(profile_flags)" check-DEJAGNU; )
.PHONY: baseline_symbols new-abi-baseline \
check-abi check-compile check-performance check-parallel check-profile
diff --git a/libstdc++-v3/testsuite/decimal/binary-arith.cc b/libstdc++-v3/testsuite/decimal/binary-arith.cc
new file mode 100644
index 00000000000..180bca57167
--- /dev/null
+++ b/libstdc++-v3/testsuite/decimal/binary-arith.cc
@@ -0,0 +1,372 @@
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.8 Binary arithmetic operators.
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+using namespace std::decimal;
+
+decimal32 d32 (5);
+decimal64 d64 (-10);
+decimal128 d128 (25);
+int si = -20;
+unsigned int ui = 50;
+long sl = -10;
+unsigned long ul = 20;
+long long sll = -25;
+unsigned long long ull = 50;
+
+void
+binary_add_32 (void)
+{
+ decimal32 a (1000), b;
+
+ b = si + a; VERIFY (b == 980);
+ b = ui + a; VERIFY (b == 1050);
+ b = sl + a; VERIFY (b == 990);
+ b = ul + a; VERIFY (b == 1020);
+ b = sll + a; VERIFY (b == 975);
+ b = ull + a; VERIFY (b == 1050);
+ b = d32 + a; VERIFY (b == 1005);
+ b = (decimal32)(d64 + a); VERIFY (b == 990);
+ b = (decimal32)(d128 + a); VERIFY (b == 1025);
+
+ b = a + si; VERIFY (b == 980);
+ b = a + ui; VERIFY (b == 1050);
+ b = a + sl; VERIFY (b == 990);
+ b = a + ul; VERIFY (b == 1020);
+ b = a + sll; VERIFY (b == 975);
+ b = a + ull; VERIFY (b == 1050);
+ b = a + d32; VERIFY (b == 1005);
+ b = (decimal32)(a + d64); VERIFY (b == 990);
+ b = (decimal32)(a + d128); VERIFY (b == 1025);
+}
+
+void
+binary_subtract_32 (void)
+{
+ decimal32 a (1000), b;
+
+ b = a - si; VERIFY (b == 1020);
+ b = a - ui; VERIFY (b == 950);
+ b = a - sl; VERIFY (b == 1010);
+ b = a - ul; VERIFY (b == 980);
+ b = a - sll; VERIFY (b == 1025);
+ b = a - ull; VERIFY (b == 950);
+ b = a - d32; VERIFY (b == 995);
+ b = (decimal32)(a - d64); VERIFY (b == 1010);
+ b = (decimal32)(a - d128); VERIFY (b == 975);
+
+ a = -1000;
+ b = si - a; VERIFY (b == 980);
+ b = ui - a; VERIFY (b == 1050);
+ b = sl - a; VERIFY (b == 990);
+ b = ul - a; VERIFY (b == 1020);
+ b = sll - a; VERIFY (b == 975);
+ b = ull - a; VERIFY (b == 1050);
+ b = d32 - a; VERIFY (b == 1005);
+ b = (decimal32)(d64 - a); VERIFY (b == 990);
+ b = (decimal32)(d128 - a); VERIFY (b == 1025);
+}
+
+void
+binary_multiply_32 (void)
+{
+ decimal32 a (1000), b;
+
+ b = a * si; VERIFY (b == -20000);
+ b = a * ui; VERIFY (b == 50000);
+ b = a * sl; VERIFY (b == -10000);
+ b = a * ul; VERIFY (b == 20000);
+ b = a * sll; VERIFY (b == -25000);
+ b = a * ull; VERIFY (b == 50000);
+ b = a * d32; VERIFY (b == 5000);
+ b = (decimal32)(a * d64); VERIFY (b == -10000);
+ b = (decimal32)(a * d128); VERIFY (b == 25000);
+
+ b = si * a; VERIFY (b == -20000);
+ b = ui * a; VERIFY (b == 50000);
+ b = sl * a; VERIFY (b == -10000);
+ b = ul * a; VERIFY (b == 20000);
+ b = sll * a; VERIFY (b == -25000);
+ b = ull * a; VERIFY (b == 50000);
+ b = d32 * a; VERIFY (b == 5000);
+ b = (decimal32)(d64 * a); VERIFY (b == -10000);
+ b = (decimal32)(d128 * a); VERIFY (b == 25000);
+}
+
+void
+binary_divide_32 (void)
+{
+ decimal32 a (1000), b;
+
+ b = a / si; VERIFY (b == -50);
+ b = a / ui; VERIFY (b == 20);
+ b = a / sl; VERIFY (b == -100);
+ b = a / ul; VERIFY (b == 50);
+ b = a / sll; VERIFY (b == -40);
+ b = a / ull; VERIFY (b == 20);
+ b = a / d32; VERIFY (b == 200);
+ b = (decimal32)(a / d64); VERIFY (b == -100);
+ b = (decimal32)(a / d128); VERIFY (b == 40);
+
+ a = 5;
+ b = si / a; VERIFY (b == -4);
+ b = ui / a; VERIFY (b == 10);
+ b = sl / a; VERIFY (b == -2);
+ b = ul / a; VERIFY (b == 4);
+ b = sll / a; VERIFY (b == -5);
+ b = ull / a; VERIFY (b == 10);
+ b = d32 / a; VERIFY (b == 1);
+ b = (decimal32)(d64 / a); VERIFY (b == -2);
+ b = (decimal32)(d128 / a); VERIFY (b == 5);
+}
+
+void
+binary_add_64 (void)
+{
+ decimal64 a (1000), b;
+
+ b = a + si; VERIFY (b == 980);
+ b = a + ui; VERIFY (b == 1050);
+ b = a + sl; VERIFY (b == 990);
+ b = a + ul; VERIFY (b == 1020);
+ b = a + sll; VERIFY (b == 975);
+ b = a + ull; VERIFY (b == 1050);
+ b = a + d32; VERIFY (b == 1005);
+ b = a + d64; VERIFY (b == 990);
+ b = (decimal64)(a + d128); VERIFY (b == 1025);
+
+ b = a + si; VERIFY (b == 980);
+ b = a + ui; VERIFY (b == 1050);
+ b = a + sl; VERIFY (b == 990);
+ b = a + ul; VERIFY (b == 1020);
+ b = a + sll; VERIFY (b == 975);
+ b = a + ull; VERIFY (b == 1050);
+ b = a + d32; VERIFY (b == 1005);
+ b = a + d64; VERIFY (b == 990);
+ b = (decimal64)(a + d128); VERIFY (b == 1025);
+}
+
+void
+binary_subtract_64 (void)
+{
+ decimal64 a (1000), b;
+
+ b = a - si; VERIFY (b == 1020);
+ b = a - ui; VERIFY (b == 950);
+ b = a - sl; VERIFY (b == 1010);
+ b = a - ul; VERIFY (b == 980);
+ b = a - sll; VERIFY (b == 1025);
+ b = a - ull; VERIFY (b == 950);
+ b = a - d32; VERIFY (b == 995);
+ b = a - d64; VERIFY (b == 1010);
+ b = (decimal64)(a - d128); VERIFY (b == 975);
+
+ a = -1000;
+ b = si - a; VERIFY (b == 980);
+ b = ui - a; VERIFY (b == 1050);
+ b = sl - a; VERIFY (b == 990);
+ b = ul - a; VERIFY (b == 1020);
+ b = sll - a; VERIFY (b == 975);
+ b = ull - a; VERIFY (b == 1050);
+ b = d32 - a; VERIFY (b == 1005);
+ b = d64 - a; VERIFY (b == 990);
+ b = (decimal64)(d128 - a); VERIFY (b == 1025);
+}
+
+void
+binary_multiply_64 (void)
+{
+ decimal64 a (1000), b;
+
+ b = a * si; VERIFY (b == -20000);
+ b = a * ui; VERIFY (b == 50000);
+ b = a * sl; VERIFY (b == -10000);
+ b = a * ul; VERIFY (b == 20000);
+ b = a * sll; VERIFY (b == -25000);
+ b = a * ull; VERIFY (b == 50000);
+ b = a * d32; VERIFY (b == 5000);
+ b = a * d64; VERIFY (b == -10000);
+ b = (decimal64)(a * d128); VERIFY (b == 25000);
+
+ b = si * a; VERIFY (b == -20000);
+ b = ui * a; VERIFY (b == 50000);
+ b = sl * a; VERIFY (b == -10000);
+ b = ul * a; VERIFY (b == 20000);
+ b = sll * a; VERIFY (b == -25000);
+ b = ull * a; VERIFY (b == 50000);
+ b = d32 * a; VERIFY (b == 5000);
+ b = d64 * a; VERIFY (b == -10000);
+ b = (decimal64)(d128 * a); VERIFY (b == 25000);
+}
+
+void
+binary_divide_64 (void)
+{
+ decimal64 a (1000), b;
+
+ b = a / si; VERIFY (b == -50);
+ b = a / ui; VERIFY (b == 20);
+ b = a / sl; VERIFY (b == -100);
+ b = a / ul; VERIFY (b == 50);
+ b = a / sll; VERIFY (b == -40);
+ b = a / ull; VERIFY (b == 20);
+ b = a / d32; VERIFY (b == 200);
+ b = a / d64; VERIFY (b == -100);
+ b = (decimal64)(a / d128); VERIFY (b == 40);
+
+ a = 5;
+ b = si / a; VERIFY (b == -4);
+ b = ui / a; VERIFY (b == 10);
+ b = sl / a; VERIFY (b == -2);
+ b = ul / a; VERIFY (b == 4);
+ b = sll / a; VERIFY (b == -5);
+ b = ull / a; VERIFY (b == 10);
+ b = d32 / a; VERIFY (b == 1);
+ b = d64 / a; VERIFY (b == -2);
+ b = (decimal64)(d128 / a); VERIFY (b == 5);
+}
+
+void
+binary_add_128 (void)
+{
+ decimal128 a (1000), b;
+
+ b = a + si; VERIFY (b == 980);
+ b = a + ui; VERIFY (b == 1050);
+ b = a + sl; VERIFY (b == 990);
+ b = a + ul; VERIFY (b == 1020);
+ b = a + sll; VERIFY (b == 975);
+ b = a + ull; VERIFY (b == 1050);
+ b = a + d32; VERIFY (b == 1005);
+ b = a + d64; VERIFY (b == 990);
+ b = a + d128; VERIFY (b == 1025);
+
+ b = a + si; VERIFY (b == 980);
+ b = a + ui; VERIFY (b == 1050);
+ b = a + sl; VERIFY (b == 990);
+ b = a + ul; VERIFY (b == 1020);
+ b = a + sll; VERIFY (b == 975);
+ b = a + ull; VERIFY (b == 1050);
+ b = a + d32; VERIFY (b == 1005);
+ b = a + d64; VERIFY (b == 990);
+ b = a + d128; VERIFY (b == 1025);
+}
+
+void
+binary_subtract_128 (void)
+{
+ decimal128 a (1000), b;
+
+ b = a - si; VERIFY (b == 1020);
+ b = a - ui; VERIFY (b == 950);
+ b = a - sl; VERIFY (b == 1010);
+ b = a - ul; VERIFY (b == 980);
+ b = a - sll; VERIFY (b == 1025);
+ b = a - ull; VERIFY (b == 950);
+ b = a - d32; VERIFY (b == 995);
+ b = a - d64; VERIFY (b == 1010);
+ b = a - d128; VERIFY (b == 975);
+
+ a = -1000;
+ b = si - a; VERIFY (b == 980);
+ b = ui - a; VERIFY (b == 1050);
+ b = sl - a; VERIFY (b == 990);
+ b = ul - a; VERIFY (b == 1020);
+ b = sll - a; VERIFY (b == 975);
+ b = ull - a; VERIFY (b == 1050);
+ b = d32 - a; VERIFY (b == 1005);
+ b = d64 - a; VERIFY (b == 990);
+ b = d128 - a; VERIFY (b == 1025);
+}
+
+void
+binary_multiply_128 (void)
+{
+ decimal128 a (1000), b;
+
+ b = a * si; VERIFY (b == -20000);
+ b = a * ui; VERIFY (b == 50000);
+ b = a * sl; VERIFY (b == -10000);
+ b = a * ul; VERIFY (b == 20000);
+ b = a * sll; VERIFY (b == -25000);
+ b = a * ull; VERIFY (b == 50000);
+ b = a * d32; VERIFY (b == 5000);
+ b = a * d64; VERIFY (b == -10000);
+ b = a * d128; VERIFY (b == 25000);
+
+ b = si * a; VERIFY (b == -20000);
+ b = ui * a; VERIFY (b == 50000);
+ b = sl * a; VERIFY (b == -10000);
+ b = ul * a; VERIFY (b == 20000);
+ b = sll * a; VERIFY (b == -25000);
+ b = ull * a; VERIFY (b == 50000);
+ b = d32 * a; VERIFY (b == 5000);
+ b = d64 * a; VERIFY (b == -10000);
+ b = d128 * a; VERIFY (b == 25000);
+}
+
+void
+binary_divide_128 (void)
+{
+ decimal128 a (1000), b;
+
+ b = a / si; VERIFY (b == -50);
+ b = a / ui; VERIFY (b == 20);
+ b = a / sl; VERIFY (b == -100);
+ b = a / ul; VERIFY (b == 50);
+ b = a / sll; VERIFY (b == -40);
+ b = a / ull; VERIFY (b == 20);
+ b = a / d32; VERIFY (b == 200);
+ b = a / d64; VERIFY (b == -100);
+ b = a / d128; VERIFY (b == 40);
+
+ a = 5;
+ b = si / a; VERIFY (b == -4);
+ b = ui / a; VERIFY (b == 10);
+ b = sl / a; VERIFY (b == -2);
+ b = ul / a; VERIFY (b == 4);
+ b = sll / a; VERIFY (b == -5);
+ b = ull / a; VERIFY (b == 10);
+ b = d32 / a; VERIFY (b == 1);
+ b = d64 / a; VERIFY (b == -2);
+ b = d128 / a; VERIFY (b == 5);
+}
+
+int
+main ()
+{
+ binary_add_32 ();
+ binary_subtract_32 ();
+ binary_multiply_32 ();
+ binary_divide_32 ();
+
+ binary_add_64 ();
+ binary_subtract_64 ();
+ binary_multiply_64 ();
+ binary_divide_64 ();
+
+ binary_add_128 ();
+ binary_subtract_128 ();
+ binary_multiply_128 ();
+ binary_divide_128 ();
+}
diff --git a/libstdc++-v3/testsuite/decimal/cast_neg.cc b/libstdc++-v3/testsuite/decimal/cast_neg.cc
new file mode 100644
index 00000000000..23749ba5e75
--- /dev/null
+++ b/libstdc++-v3/testsuite/decimal/cast_neg.cc
@@ -0,0 +1,62 @@
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile }
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 doesn't say explicitly that the conversion from a
+// decimal floating-point type to a generic float type is prohibited but
+// it implies that in section 4.3 when it says "In C, objects of decimal
+// floating-oint type can be converted to generic floating-point type by
+// means of an explicit cast. In C++ this is not possible." Check that
+// attempt to do a cast are flagged as errors.
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+using namespace std::decimal;
+
+float f;
+double d;
+long double ld;
+decimal32 d32;
+decimal64 d64;
+decimal128 d128;
+
+void
+foo (void)
+{
+ f = d32; // { dg-error "error" }
+ f = d64; // { dg-error "error" }
+ f = d128; // { dg-error "error" }
+ d = d32; // { dg-error "error" }
+ d = d64; // { dg-error "error" }
+ d = d128; // { dg-error "error" }
+ ld = d32; // { dg-error "error" }
+ ld = d64; // { dg-error "error" }
+ ld = d128; // { dg-error "error" }
+
+ f = (float)d32; // { dg-error "error" }
+ f = (float)d64; // { dg-error "error" }
+ f = (float)d128; // { dg-error "error" }
+ d = (double)d32; // { dg-error "error" }
+ d = (double)d64; // { dg-error "error" }
+ d = (double)d128; // { dg-error "error" }
+ ld = (long double)d32; // { dg-error "error" }
+ ld = (long double)d64; // { dg-error "error" }
+ ld = (long double)d128; // { dg-error "error" }
+}
diff --git a/libstdc++-v3/testsuite/decimal/comparison.cc b/libstdc++-v3/testsuite/decimal/comparison.cc
new file mode 100644
index 00000000000..1efa637ac4a
--- /dev/null
+++ b/libstdc++-v3/testsuite/decimal/comparison.cc
@@ -0,0 +1,546 @@
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.9 Comparison operators.
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+using namespace std::decimal;
+
+decimal32 d32 (5);
+decimal64 d64 (-10);
+decimal128 d128 (25);
+int si = -20;
+unsigned int ui = 50;
+long sl = -10;
+unsigned long ul = 20;
+long long sll = -25;
+unsigned long long ull = 50;
+
+void
+compare_eq_32 (void)
+{
+ decimal32 a;
+
+ a = si; VERIFY (a == si); VERIFY (si == a);
+ a = ui; VERIFY (a == ui); VERIFY (ui == a);
+ a = sl; VERIFY (a == sl); VERIFY (sl == a);
+ a = ul; VERIFY (a == ul); VERIFY (ul == a);
+ a = sll; VERIFY (a == sll); VERIFY (sll == a);
+ a = ull; VERIFY (a == ull); VERIFY (ull == a);
+ a = d32; VERIFY (a == d32); VERIFY (d32 == a);
+ a = (decimal32)d64; VERIFY (a == d64); VERIFY (d64 == a);
+ a = (decimal32)d128; VERIFY (a == d128); VERIFY (d128 == a);
+}
+
+void
+compare_ne_32 (void)
+{
+ decimal32 a = 100;
+
+ VERIFY (a != si); VERIFY (si != a);
+ VERIFY (a != ui); VERIFY (ui != a);
+ VERIFY (a != sl); VERIFY (sl != a);
+ VERIFY (a != ul); VERIFY (ul != a);
+ VERIFY (a != sll); VERIFY (sll != a);
+ VERIFY (a != ull); VERIFY (ull != a);
+ VERIFY (a != d32); VERIFY (d32 != a);
+ VERIFY (a != d64); VERIFY (d64 != a);
+ VERIFY (a != d128); VERIFY (d128 != a);
+}
+
+void
+compare_lt_32 (void)
+{
+ decimal32 a = -100;
+
+ VERIFY (a < si);
+ VERIFY (a < ui);
+ VERIFY (a < sl);
+ VERIFY (a < ul);
+ VERIFY (a < sll);
+ VERIFY (a < ull);
+ VERIFY (a < d32);
+ VERIFY (a < d64);
+ VERIFY (a < d128);
+
+ a = 100;
+ VERIFY (si < a);
+ VERIFY (ui < a);
+ VERIFY (sl < a);
+ VERIFY (ul < a);
+ VERIFY (sll < a);
+ VERIFY (ull < a);
+ VERIFY (d32 < a);
+ VERIFY (d64 < a);
+ VERIFY (d128 < a);
+}
+
+void
+compare_le_32 (void)
+{
+ decimal32 a;
+
+ a = si; VERIFY (a <= si); VERIFY (si <= a);
+ a = ui; VERIFY (a <= ui); VERIFY (ui <= a);
+ a = sl; VERIFY (a <= sl); VERIFY (sl <= a);
+ a = ul; VERIFY (a <= ul); VERIFY (ul <= a);
+ a = sll; VERIFY (a <= sll); VERIFY (sll <= a);
+ a = ull; VERIFY (a <= ull); VERIFY (ull <= a);
+ a = d32; VERIFY (a <= d32); VERIFY (d32 <= a);
+ a = (decimal32)d64; VERIFY (a <= d64); VERIFY (d64 <= a);
+ a = (decimal32)d128; VERIFY (a <= d128); VERIFY (d128 <= a);
+
+ a = -100;
+ VERIFY (a <= si);
+ VERIFY (a <= ui);
+ VERIFY (a <= sl);
+ VERIFY (a <= ul);
+ VERIFY (a <= sll);
+ VERIFY (a <= ull);
+ VERIFY (a <= d32);
+ VERIFY (a <= d64);
+ VERIFY (a <= d128);
+
+ a = 100;
+ VERIFY (si <= a);
+ VERIFY (ui <= a);
+ VERIFY (sl <= a);
+ VERIFY (ul <= a);
+ VERIFY (sll <= a);
+ VERIFY (ull <= a);
+ VERIFY (d32 <= a);
+ VERIFY (d64 <= a);
+ VERIFY (d128 <= a);
+}
+
+void
+compare_gt_32 (void)
+{
+ decimal32 a = 100;
+
+ VERIFY (a > si);
+ VERIFY (a > ui);
+ VERIFY (a > sl);
+ VERIFY (a > ul);
+ VERIFY (a > sll);
+ VERIFY (a > ull);
+ VERIFY (a > d32);
+ VERIFY (a > d64);
+ VERIFY (a > d128);
+
+ a = -100;
+ VERIFY (si > a);
+ VERIFY (ui > a);
+ VERIFY (sl > a);
+ VERIFY (ul > a);
+ VERIFY (sll > a);
+ VERIFY (ull > a);
+ VERIFY (d32 > a);
+ VERIFY (d64 > a);
+ VERIFY (d128 > a);
+}
+
+void
+compare_ge_32 (void)
+{
+ decimal32 a;
+
+ a = si; VERIFY (a >= si); VERIFY (si <= a);
+ a = ui; VERIFY (a >= ui); VERIFY (ui <= a);
+ a = sl; VERIFY (a >= sl); VERIFY (sl <= a);
+ a = ul; VERIFY (a >= ul); VERIFY (ul <= a);
+ a = sll; VERIFY (a >= sll); VERIFY (sll <= a);
+ a = ull; VERIFY (a >= ull); VERIFY (ull <= a);
+ a = d32; VERIFY (a >= d32); VERIFY (d32 <= a);
+ a = (decimal32)d64; VERIFY (a >= d64); VERIFY (d64 <= a);
+ a = (decimal32)d128; VERIFY (a >= d128); VERIFY (d128 <= a);
+
+ a = 100;
+ VERIFY (a >= si);
+ VERIFY (a >= ui);
+ VERIFY (a >= sl);
+ VERIFY (a >= ul);
+ VERIFY (a >= sll);
+ VERIFY (a >= ull);
+ VERIFY (a >= d32);
+ VERIFY (a >= d64);
+ VERIFY (a >= d128);
+
+ a = -100;
+ VERIFY (si >= a);
+ VERIFY (ui >= a);
+ VERIFY (sl >= a);
+ VERIFY (ul >= a);
+ VERIFY (sll >= a);
+ VERIFY (ull >= a);
+ VERIFY (d32 >= a);
+ VERIFY (d64 >= a);
+ VERIFY (d128 >= a);
+}
+
+void
+compare_eq_64 (void)
+{
+ decimal64 a;
+
+ a = si; VERIFY (a == si); VERIFY (si == a);
+ a = ui; VERIFY (a == ui); VERIFY (ui == a);
+ a = sl; VERIFY (a == sl); VERIFY (sl == a);
+ a = ul; VERIFY (a == ul); VERIFY (ul == a);
+ a = sll; VERIFY (a == sll); VERIFY (sll == a);
+ a = ull; VERIFY (a == ull); VERIFY (ull == a);
+ a = d32; VERIFY (a == d32); VERIFY (d32 == a);
+ a = d64; VERIFY (a == d64); VERIFY (d64 == a);
+ a = (decimal64)d128; VERIFY (a == d128); VERIFY (d128 == a);
+}
+
+void
+compare_ne_64 (void)
+{
+ decimal64 a = 100;
+
+ VERIFY (a != si); VERIFY (si != a);
+ VERIFY (a != ui); VERIFY (ui != a);
+ VERIFY (a != sl); VERIFY (sl != a);
+ VERIFY (a != ul); VERIFY (ul != a);
+ VERIFY (a != sll); VERIFY (sll != a);
+ VERIFY (a != ull); VERIFY (ull != a);
+ VERIFY (a != d32); VERIFY (d32 != a);
+ VERIFY (a != d64); VERIFY (d64 != a);
+ VERIFY (a != d128); VERIFY (d128 != a);
+}
+
+void
+compare_lt_64 (void)
+{
+ decimal64 a = -100;
+
+ VERIFY (a < si);
+ VERIFY (a < ui);
+ VERIFY (a < sl);
+ VERIFY (a < ul);
+ VERIFY (a < sll);
+ VERIFY (a < ull);
+ VERIFY (a < d32);
+ VERIFY (a < d64);
+ VERIFY (a < d128);
+
+ a = 100;
+ VERIFY (si < a);
+ VERIFY (ui < a);
+ VERIFY (sl < a);
+ VERIFY (ul < a);
+ VERIFY (sll < a);
+ VERIFY (ull < a);
+ VERIFY (d32 < a);
+ VERIFY (d64 < a);
+ VERIFY (d128 < a);
+}
+
+void
+compare_le_64 (void)
+{
+ decimal64 a;
+
+ a = si; VERIFY (a <= si); VERIFY (si <= a);
+ a = ui; VERIFY (a <= ui); VERIFY (ui <= a);
+ a = sl; VERIFY (a <= sl); VERIFY (sl <= a);
+ a = ul; VERIFY (a <= ul); VERIFY (ul <= a);
+ a = sll; VERIFY (a <= sll); VERIFY (sll <= a);
+ a = ull; VERIFY (a <= ull); VERIFY (ull <= a);
+ a = d32; VERIFY (a <= d32); VERIFY (d32 <= a);
+ a = (decimal32)d64; VERIFY (a <= d64); VERIFY (d64 <= a);
+ a = (decimal32)d128; VERIFY (a <= d128); VERIFY (d128 <= a);
+
+ a = -100;
+ VERIFY (a <= si);
+ VERIFY (a <= ui);
+ VERIFY (a <= sl);
+ VERIFY (a <= ul);
+ VERIFY (a <= sll);
+ VERIFY (a <= ull);
+ VERIFY (a <= d32);
+ VERIFY (a <= d64);
+ VERIFY (a <= d128);
+
+ a = 100;
+ VERIFY (si <= a);
+ VERIFY (ui <= a);
+ VERIFY (sl <= a);
+ VERIFY (ul <= a);
+ VERIFY (sll <= a);
+ VERIFY (ull <= a);
+ VERIFY (d32 <= a);
+ VERIFY (d64 <= a);
+ VERIFY (d128 <= a);
+}
+
+void
+compare_gt_64 (void)
+{
+ decimal64 a = 100;
+
+ VERIFY (a > si);
+ VERIFY (a > ui);
+ VERIFY (a > sl);
+ VERIFY (a > ul);
+ VERIFY (a > sll);
+ VERIFY (a > ull);
+ VERIFY (a > d32);
+ VERIFY (a > d64);
+ VERIFY (a > d128);
+
+ a = -100;
+ VERIFY (si > a);
+ VERIFY (ui > a);
+ VERIFY (sl > a);
+ VERIFY (ul > a);
+ VERIFY (sll > a);
+ VERIFY (ull > a);
+ VERIFY (d32 > a);
+ VERIFY (d64 > a);
+ VERIFY (d128 > a);
+}
+
+void
+compare_ge_64 (void)
+{
+ decimal64 a;
+
+ a = si; VERIFY (a >= si); VERIFY (si <= a);
+ a = ui; VERIFY (a >= ui); VERIFY (ui <= a);
+ a = sl; VERIFY (a >= sl); VERIFY (sl <= a);
+ a = ul; VERIFY (a >= ul); VERIFY (ul <= a);
+ a = sll; VERIFY (a >= sll); VERIFY (sll <= a);
+ a = ull; VERIFY (a >= ull); VERIFY (ull <= a);
+ a = d32; VERIFY (a >= d32); VERIFY (d32 <= a);
+ a = (decimal32)d64; VERIFY (a >= d64); VERIFY (d64 <= a);
+ a = (decimal32)d128; VERIFY (a >= d128); VERIFY (d128 <= a);
+
+ a = 100;
+ VERIFY (a >= si);
+ VERIFY (a >= ui);
+ VERIFY (a >= sl);
+ VERIFY (a >= ul);
+ VERIFY (a >= sll);
+ VERIFY (a >= ull);
+ VERIFY (a >= d32);
+ VERIFY (a >= d64);
+ VERIFY (a >= d128);
+
+ a = -100;
+ VERIFY (si >= a);
+ VERIFY (ui >= a);
+ VERIFY (sl >= a);
+ VERIFY (ul >= a);
+ VERIFY (sll >= a);
+ VERIFY (ull >= a);
+ VERIFY (d32 >= a);
+ VERIFY (d64 >= a);
+ VERIFY (d128 >= a);
+}
+
+void
+compare_eq_128 (void)
+{
+ decimal128 a;
+
+ a = si; VERIFY (a == si); VERIFY (si == a);
+ a = ui; VERIFY (a == ui); VERIFY (ui == a);
+ a = sl; VERIFY (a == sl); VERIFY (sl == a);
+ a = ul; VERIFY (a == ul); VERIFY (ul == a);
+ a = sll; VERIFY (a == sll); VERIFY (sll == a);
+ a = ull; VERIFY (a == ull); VERIFY (ull == a);
+ a = d32; VERIFY (a == d32); VERIFY (d32 == a);
+ a = d64; VERIFY (a == d64); VERIFY (d64 == a);
+ a = d128; VERIFY (a == d128); VERIFY (d128 == a);
+}
+
+void
+compare_ne_128 (void)
+{
+ decimal128 a = 100;
+
+ VERIFY (a != si); VERIFY (si != a);
+ VERIFY (a != ui); VERIFY (ui != a);
+ VERIFY (a != sl); VERIFY (sl != a);
+ VERIFY (a != ul); VERIFY (ul != a);
+ VERIFY (a != sll); VERIFY (sll != a);
+ VERIFY (a != ull); VERIFY (ull != a);
+ VERIFY (a != d32); VERIFY (d32 != a);
+ VERIFY (a != d64); VERIFY (d64 != a);
+ VERIFY (a != d128); VERIFY (d128 != a);
+}
+
+void
+compare_lt_128 (void)
+{
+ decimal128 a = -100;
+
+ VERIFY (a < si);
+ VERIFY (a < ui);
+ VERIFY (a < sl);
+ VERIFY (a < ul);
+ VERIFY (a < sll);
+ VERIFY (a < ull);
+ VERIFY (a < d32);
+ VERIFY (a < d64);
+ VERIFY (a < d128);
+
+ a = 100;
+ VERIFY (si < a);
+ VERIFY (ui < a);
+ VERIFY (sl < a);
+ VERIFY (ul < a);
+ VERIFY (sll < a);
+ VERIFY (ull < a);
+ VERIFY (d32 < a);
+ VERIFY (d64 < a);
+ VERIFY (d128 < a);
+}
+
+void
+compare_le_128 (void)
+{
+ decimal128 a;
+
+ a = si; VERIFY (a <= si); VERIFY (si <= a);
+ a = ui; VERIFY (a <= ui); VERIFY (ui <= a);
+ a = sl; VERIFY (a <= sl); VERIFY (sl <= a);
+ a = ul; VERIFY (a <= ul); VERIFY (ul <= a);
+ a = sll; VERIFY (a <= sll); VERIFY (sll <= a);
+ a = ull; VERIFY (a <= ull); VERIFY (ull <= a);
+ a = d32; VERIFY (a <= d32); VERIFY (d32 <= a);
+ a = (decimal32)d64; VERIFY (a <= d64); VERIFY (d64 <= a);
+ a = (decimal32)d128; VERIFY (a <= d128); VERIFY (d128 <= a);
+
+ a = -100;
+ VERIFY (a <= si);
+ VERIFY (a <= ui);
+ VERIFY (a <= sl);
+ VERIFY (a <= ul);
+ VERIFY (a <= sll);
+ VERIFY (a <= ull);
+ VERIFY (a <= d32);
+ VERIFY (a <= d64);
+ VERIFY (a <= d128);
+
+ a = 100;
+ VERIFY (si <= a);
+ VERIFY (ui <= a);
+ VERIFY (sl <= a);
+ VERIFY (ul <= a);
+ VERIFY (sll <= a);
+ VERIFY (ull <= a);
+ VERIFY (d32 <= a);
+ VERIFY (d64 <= a);
+ VERIFY (d128 <= a);
+}
+
+void
+compare_gt_128 (void)
+{
+ decimal128 a = 100;
+
+ VERIFY (a > si);
+ VERIFY (a > ui);
+ VERIFY (a > sl);
+ VERIFY (a > ul);
+ VERIFY (a > sll);
+ VERIFY (a > ull);
+ VERIFY (a > d32);
+ VERIFY (a > d64);
+ VERIFY (a > d128);
+
+ a = -100;
+ VERIFY (si > a);
+ VERIFY (ui > a);
+ VERIFY (sl > a);
+ VERIFY (ul > a);
+ VERIFY (sll > a);
+ VERIFY (ull > a);
+ VERIFY (d32 > a);
+ VERIFY (d64 > a);
+ VERIFY (d128 > a);
+}
+
+void
+compare_ge_128 (void)
+{
+ decimal128 a;
+
+ a = si; VERIFY (a >= si); VERIFY (si <= a);
+ a = ui; VERIFY (a >= ui); VERIFY (ui <= a);
+ a = sl; VERIFY (a >= sl); VERIFY (sl <= a);
+ a = ul; VERIFY (a >= ul); VERIFY (ul <= a);
+ a = sll; VERIFY (a >= sll); VERIFY (sll <= a);
+ a = ull; VERIFY (a >= ull); VERIFY (ull <= a);
+ a = d32; VERIFY (a >= d32); VERIFY (d32 <= a);
+ a = (decimal32)d64; VERIFY (a >= d64); VERIFY (d64 <= a);
+ a = (decimal32)d128; VERIFY (a >= d128); VERIFY (d128 <= a);
+
+ a = 100;
+ VERIFY (a >= si);
+ VERIFY (a >= ui);
+ VERIFY (a >= sl);
+ VERIFY (a >= ul);
+ VERIFY (a >= sll);
+ VERIFY (a >= ull);
+ VERIFY (a >= d32);
+ VERIFY (a >= d64);
+ VERIFY (a >= d128);
+
+ a = -100;
+ VERIFY (si >= a);
+ VERIFY (ui >= a);
+ VERIFY (sl >= a);
+ VERIFY (ul >= a);
+ VERIFY (sll >= a);
+ VERIFY (ull >= a);
+ VERIFY (d32 >= a);
+ VERIFY (d64 >= a);
+ VERIFY (d128 >= a);
+}
+
+int
+main ()
+{
+ compare_eq_32 ();
+ compare_ne_32 ();
+ compare_lt_32 ();
+ compare_le_32 ();
+ compare_gt_32 ();
+ compare_ge_32 ();
+
+ compare_eq_64 ();
+ compare_ne_64 ();
+ compare_lt_64 ();
+ compare_le_64 ();
+ compare_gt_64 ();
+ compare_ge_64 ();
+
+ compare_eq_128 ();
+ compare_ne_128 ();
+ compare_lt_128 ();
+ compare_le_128 ();
+ compare_gt_128 ();
+ compare_ge_128 ();
+}
diff --git a/libstdc++-v3/testsuite/decimal/compound-assignment-memfunc.cc b/libstdc++-v3/testsuite/decimal/compound-assignment-memfunc.cc
new file mode 100644
index 00000000000..c216faa8095
--- /dev/null
+++ b/libstdc++-v3/testsuite/decimal/compound-assignment-memfunc.cc
@@ -0,0 +1,250 @@
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.2.6 Compound assignment (decimal32).
+// ISO/IEC TR 24733 3.2.3.6 Compound assignment (decimal64).
+// ISO/IEC TR 24733 3.2.4.6 Compound assignment (decimal128).
+
+// Access member functions directly.
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+using namespace std::decimal;
+
+decimal32 d32 (5);
+decimal64 d64 (-10);
+decimal128 d128 (25);
+int si = -2;
+unsigned int ui = 5;
+long sl = -10;
+unsigned long ul = 20;
+long long sll = -25;
+unsigned long long ull = 50;
+
+void
+compound_assignment_add_32 (void)
+{
+ decimal32 a (1000), b;
+
+ b = a; b.operator+=(d32); VERIFY (b == 1005);
+ b = a; b.operator+=(d64); VERIFY (b == 990);
+ b = a; b.operator+=(d128); VERIFY (b == 1025);
+ b = a; b.operator+=(si); VERIFY (b == 998);
+ b = a; b.operator+=(ui); VERIFY (b == 1005);
+ b = a; b.operator+=(sl); VERIFY (b == 990);
+ b = a; b.operator+=(ul); VERIFY (b == 1020);
+ b = a; b.operator+=(sll); VERIFY (b == 975);
+ b = a; b.operator+=(ull); VERIFY (b == 1050);
+}
+
+void
+compound_assignment_subtract_32 (void)
+{
+ decimal32 a (1000), b;
+
+ b = a; b.operator-=(d32); VERIFY (b == 995);
+ b = a; b.operator-=(d64); VERIFY (b == 1010);
+ b = a; b.operator-=(d128); VERIFY (b == 975);
+ b = a; b.operator-=(si); VERIFY (b == 1002);
+ b = a; b.operator-=(ui); VERIFY (b == 995);
+ b = a; b.operator-=(sl); VERIFY (b == 1010);
+ b = a; b.operator-=(ul); VERIFY (b == 980);
+ b = a; b.operator-=(sll); VERIFY (b == 1025);
+ b = a; b.operator-=(ull); VERIFY (b == 950);
+}
+
+void
+compound_assignment_multiply_32 (void)
+{
+ decimal32 a (1000), b;
+
+ b = a; b.operator*=(d32); VERIFY (b == 5000);
+ b = a; b.operator*=(d64); VERIFY (b == -10000);
+ b = a; b.operator*=(d128); VERIFY (b == 25000);
+ b = a; b.operator*=(si); VERIFY (b == -2000);
+ b = a; b.operator*=(ui); VERIFY (b == 5000);
+ b = a; b.operator*=(sl); VERIFY (b == -10000);
+ b = a; b.operator*=(ul); VERIFY (b == 20000);
+ b = a; b.operator*=(sll); VERIFY (b == -25000);
+ b = a; b.operator*=(ull); VERIFY (b == 50000);
+}
+
+void
+compound_assignment_divide_32 (void)
+{
+ decimal32 a (1000), b;
+
+ b = a; b.operator/=(d32); VERIFY (b == 200);
+ b = a; b.operator/=(d64); VERIFY (b == -100);
+ b = a; b.operator/=(d128); VERIFY (b == 40);
+ b = a; b.operator/=(si); VERIFY (b == -500);
+ b = a; b.operator/=(ui); VERIFY (b == 200);
+ b = a; b.operator/=(sl); VERIFY (b == -100);
+ b = a; b.operator/=(ul); VERIFY (b == 50);
+ b = a; b.operator/=(sll); VERIFY (b == -40);
+ b = a; b.operator/=(ull); VERIFY (b == 20);
+}
+
+void
+compound_assignment_add_64 (void)
+{
+ decimal64 a (1000), b;
+
+ b = a; b.operator+=(d32); VERIFY (b == 1005);
+ b = a; b.operator+=(d64); VERIFY (b == 990);
+ b = a; b.operator+=(d128); VERIFY (b == 1025);
+ b = a; b.operator+=(si); VERIFY (b == 998);
+ b = a; b.operator+=(ui); VERIFY (b == 1005);
+ b = a; b.operator+=(sl); VERIFY (b == 990);
+ b = a; b.operator+=(ul); VERIFY (b == 1020);
+ b = a; b.operator+=(sll); VERIFY (b == 975);
+ b = a; b.operator+=(ull); VERIFY (b == 1050);
+}
+
+void
+compound_assignment_subtract_64 (void)
+{
+ decimal64 a (1000), b;
+
+ b = a; b.operator-=(d32); VERIFY (b == 995);
+ b = a; b.operator-=(d64); VERIFY (b == 1010);
+ b = a; b.operator-=(d128); VERIFY (b == 975);
+ b = a; b.operator-=(si); VERIFY (b == 1002);
+ b = a; b.operator-=(ui); VERIFY (b == 995);
+ b = a; b.operator-=(sl); VERIFY (b == 1010);
+ b = a; b.operator-=(ul); VERIFY (b == 980);
+ b = a; b.operator-=(sll); VERIFY (b == 1025);
+ b = a; b.operator-=(ull); VERIFY (b == 950);
+}
+
+void
+compound_assignment_multiply_64 (void)
+{
+ decimal64 a (1000), b;
+
+ b = a; b.operator*=(d32); VERIFY (b == 5000);
+ b = a; b.operator*=(d64); VERIFY (b == -10000);
+ b = a; b.operator*=(d128); VERIFY (b == 25000);
+ b = a; b.operator*=(si); VERIFY (b == -2000);
+ b = a; b.operator*=(ui); VERIFY (b == 5000);
+ b = a; b.operator*=(sl); VERIFY (b == -10000);
+ b = a; b.operator*=(ul); VERIFY (b == 20000);
+ b = a; b.operator*=(sll); VERIFY (b == -25000);
+ b = a; b.operator*=(ull); VERIFY (b == 50000);
+}
+
+void
+compound_assignment_divide_64 (void)
+{
+ decimal64 a (1000), b;
+
+ b = a; b.operator/=(d32); VERIFY (b == 200);
+ b = a; b.operator/=(d64); VERIFY (b == -100);
+ b = a; b.operator/=(d128); VERIFY (b == 40);
+ b = a; b.operator/=(si); VERIFY (b == -500);
+ b = a; b.operator/=(ui); VERIFY (b == 200);
+ b = a; b.operator/=(sl); VERIFY (b == -100);
+ b = a; b.operator/=(ul); VERIFY (b == 50);
+ b = a; b.operator/=(sll); VERIFY (b == -40);
+ b = a; b.operator/=(ull); VERIFY (b == 20);
+}
+
+void
+compound_assignment_add_128 (void)
+{
+ decimal128 a (1000), b;
+
+ b = a; b.operator+=(d32); VERIFY (b == 1005);
+ b = a; b.operator+=(d64); VERIFY (b == 990);
+ b = a; b.operator+=(d128); VERIFY (b == 1025);
+ b = a; b.operator+=(si); VERIFY (b == 998);
+ b = a; b.operator+=(ui); VERIFY (b == 1005);
+ b = a; b.operator+=(sl); VERIFY (b == 990);
+ b = a; b.operator+=(ul); VERIFY (b == 1020);
+ b = a; b.operator+=(sll); VERIFY (b == 975);
+ b = a; b.operator+=(ull); VERIFY (b == 1050);
+}
+
+void
+compound_assignment_subtract_128 (void)
+{
+ decimal128 a (1000), b;
+
+ b = a; b.operator-=(d32); VERIFY (b == 995);
+ b = a; b.operator-=(d64); VERIFY (b == 1010);
+ b = a; b.operator-=(d128); VERIFY (b == 975);
+ b = a; b.operator-=(si); VERIFY (b == 1002);
+ b = a; b.operator-=(ui); VERIFY (b == 995);
+ b = a; b.operator-=(sl); VERIFY (b == 1010);
+ b = a; b.operator-=(ul); VERIFY (b == 980);
+ b = a; b.operator-=(sll); VERIFY (b == 1025);
+ b = a; b.operator-=(ull); VERIFY (b == 950);
+}
+
+void
+compound_assignment_multiply_128 (void)
+{
+ decimal128 a (1000), b;
+
+ b = a; b.operator*=(d32); VERIFY (b == 5000);
+ b = a; b.operator*=(d64); VERIFY (b == -10000);
+ b = a; b.operator*=(d128); VERIFY (b == 25000);
+ b = a; b.operator*=(si); VERIFY (b == -2000);
+ b = a; b.operator*=(ui); VERIFY (b == 5000);
+ b = a; b.operator*=(sl); VERIFY (b == -10000);
+ b = a; b.operator*=(ul); VERIFY (b == 20000);
+ b = a; b.operator*=(sll); VERIFY (b == -25000);
+ b = a; b.operator*=(ull); VERIFY (b == 50000);
+}
+
+void
+compound_assignment_divide_128 (void)
+{
+ decimal128 a (1000), b;
+
+ b = a; b.operator/=(d32); VERIFY (b == 200);
+ b = a; b.operator/=(d64); VERIFY (b == -100);
+ b = a; b.operator/=(d128); VERIFY (b == 40);
+ b = a; b.operator/=(si); VERIFY (b == -500);
+ b = a; b.operator/=(ui); VERIFY (b == 200);
+ b = a; b.operator/=(sl); VERIFY (b == -100);
+ b = a; b.operator/=(ul); VERIFY (b == 50);
+ b = a; b.operator/=(sll); VERIFY (b == -40);
+ b = a; b.operator/=(ull); VERIFY (b == 20);
+}
+
+int
+main ()
+{
+ compound_assignment_add_32 ();
+ compound_assignment_subtract_32 ();
+ compound_assignment_multiply_32 ();
+ compound_assignment_divide_32 ();
+
+ compound_assignment_add_64 ();
+ compound_assignment_subtract_64 ();
+ compound_assignment_multiply_64 ();
+ compound_assignment_divide_64 ();
+
+ compound_assignment_add_128 ();
+ compound_assignment_subtract_128 ();
+ compound_assignment_multiply_128 ();
+ compound_assignment_divide_128 ();
+}
diff --git a/libstdc++-v3/testsuite/decimal/compound-assignment.cc b/libstdc++-v3/testsuite/decimal/compound-assignment.cc
new file mode 100644
index 00000000000..2a1f4a7218c
--- /dev/null
+++ b/libstdc++-v3/testsuite/decimal/compound-assignment.cc
@@ -0,0 +1,248 @@
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.2.6 Compound assignment (decimal32).
+// ISO/IEC TR 24733 3.2.3.6 Compound assignment (decimal64).
+// ISO/IEC TR 24733 3.2.4.6 Compound assignment (decimal128).
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+using namespace std::decimal;
+
+decimal32 d32 (5);
+decimal64 d64 (-10);
+decimal128 d128 (25);
+int si = -2;
+unsigned int ui = 5;
+long sl = -10;
+unsigned long ul = 20;
+long long sll = -25;
+unsigned long long ull = 50;
+
+void
+compound_assignment_add_32 (void)
+{
+ decimal32 a (1000), b;
+
+ b = a; b += d32; VERIFY (b == 1005);
+ b = a; b += d64; VERIFY (b == 990);
+ b = a; b += d128; VERIFY (b == 1025);
+ b = a; b += si; VERIFY (b == 998);
+ b = a; b += ui; VERIFY (b == 1005);
+ b = a; b += sl; VERIFY (b == 990);
+ b = a; b += ul; VERIFY (b == 1020);
+ b = a; b += sll; VERIFY (b == 975);
+ b = a; b += ull; VERIFY (b == 1050);
+}
+
+void
+compound_assignment_subtract_32 (void)
+{
+ decimal32 a (1000), b;
+
+ b = a; b -= d32; VERIFY (b == 995);
+ b = a; b -= d64; VERIFY (b == 1010);
+ b = a; b -= d128; VERIFY (b == 975);
+ b = a; b -= si; VERIFY (b == 1002);
+ b = a; b -= ui; VERIFY (b == 995);
+ b = a; b -= sl; VERIFY (b == 1010);
+ b = a; b -= ul; VERIFY (b == 980);
+ b = a; b -= sll; VERIFY (b == 1025);
+ b = a; b -= ull; VERIFY (b == 950);
+}
+
+void
+compound_assignment_multiply_32 (void)
+{
+ decimal32 a (1000), b;
+
+ b = a; b *= d32; VERIFY (b == 5000);
+ b = a; b *= d64; VERIFY (b == -10000);
+ b = a; b *= d128; VERIFY (b == 25000);
+ b = a; b *= si; VERIFY (b == -2000);
+ b = a; b *= ui; VERIFY (b == 5000);
+ b = a; b *= sl; VERIFY (b == -10000);
+ b = a; b *= ul; VERIFY (b == 20000);
+ b = a; b *= sll; VERIFY (b == -25000);
+ b = a; b *= ull; VERIFY (b == 50000);
+}
+
+void
+compound_assignment_divide_32 (void)
+{
+ decimal32 a (1000), b;
+
+ b = a; b /= d32; VERIFY (b == 200);
+ b = a; b /= d64; VERIFY (b == -100);
+ b = a; b /= d128; VERIFY (b == 40);
+ b = a; b /= si; VERIFY (b == -500);
+ b = a; b /= ui; VERIFY (b == 200);
+ b = a; b /= sl; VERIFY (b == -100);
+ b = a; b /= ul; VERIFY (b == 50);
+ b = a; b /= sll; VERIFY (b == -40);
+ b = a; b /= ull; VERIFY (b == 20);
+}
+
+void
+compound_assignment_add_64 (void)
+{
+ decimal64 a (1000), b;
+
+ b = a; b += d32; VERIFY (b == 1005);
+ b = a; b += d64; VERIFY (b == 990);
+ b = a; b += d128; VERIFY (b == 1025);
+ b = a; b += si; VERIFY (b == 998);
+ b = a; b += ui; VERIFY (b == 1005);
+ b = a; b += sl; VERIFY (b == 990);
+ b = a; b += ul; VERIFY (b == 1020);
+ b = a; b += sll; VERIFY (b == 975);
+ b = a; b += ull; VERIFY (b == 1050);
+}
+
+void
+compound_assignment_subtract_64 (void)
+{
+ decimal64 a (1000), b;
+
+ b = a; b -= d32; VERIFY (b == 995);
+ b = a; b -= d64; VERIFY (b == 1010);
+ b = a; b -= d128; VERIFY (b == 975);
+ b = a; b -= si; VERIFY (b == 1002);
+ b = a; b -= ui; VERIFY (b == 995);
+ b = a; b -= sl; VERIFY (b == 1010);
+ b = a; b -= ul; VERIFY (b == 980);
+ b = a; b -= sll; VERIFY (b == 1025);
+ b = a; b -= ull; VERIFY (b == 950);
+}
+
+void
+compound_assignment_multiply_64 (void)
+{
+ decimal64 a (1000), b;
+
+ b = a; b *= d32; VERIFY (b == 5000);
+ b = a; b *= d64; VERIFY (b == -10000);
+ b = a; b *= d128; VERIFY (b == 25000);
+ b = a; b *= si; VERIFY (b == -2000);
+ b = a; b *= ui; VERIFY (b == 5000);
+ b = a; b *= sl; VERIFY (b == -10000);
+ b = a; b *= ul; VERIFY (b == 20000);
+ b = a; b *= sll; VERIFY (b == -25000);
+ b = a; b *= ull; VERIFY (b == 50000);
+}
+
+void
+compound_assignment_divide_64 (void)
+{
+ decimal64 a (1000), b;
+
+ b = a; b /= d32; VERIFY (b == 200);
+ b = a; b /= d64; VERIFY (b == -100);
+ b = a; b /= d128; VERIFY (b == 40);
+ b = a; b /= si; VERIFY (b == -500);
+ b = a; b /= ui; VERIFY (b == 200);
+ b = a; b /= sl; VERIFY (b == -100);
+ b = a; b /= ul; VERIFY (b == 50);
+ b = a; b /= sll; VERIFY (b == -40);
+ b = a; b /= ull; VERIFY (b == 20);
+}
+
+void
+compound_assignment_add_128 (void)
+{
+ decimal128 a (1000), b;
+
+ b = a; b += d32; VERIFY (b == 1005);
+ b = a; b += d64; VERIFY (b == 990);
+ b = a; b += d128; VERIFY (b == 1025);
+ b = a; b += si; VERIFY (b == 998);
+ b = a; b += ui; VERIFY (b == 1005);
+ b = a; b += sl; VERIFY (b == 990);
+ b = a; b += ul; VERIFY (b == 1020);
+ b = a; b += sll; VERIFY (b == 975);
+ b = a; b += ull; VERIFY (b == 1050);
+}
+
+void
+compound_assignment_subtract_128 (void)
+{
+ decimal128 a (1000), b;
+
+ b = a; b -= d32; VERIFY (b == 995);
+ b = a; b -= d64; VERIFY (b == 1010);
+ b = a; b -= d128; VERIFY (b == 975);
+ b = a; b -= si; VERIFY (b == 1002);
+ b = a; b -= ui; VERIFY (b == 995);
+ b = a; b -= sl; VERIFY (b == 1010);
+ b = a; b -= ul; VERIFY (b == 980);
+ b = a; b -= sll; VERIFY (b == 1025);
+ b = a; b -= ull; VERIFY (b == 950);
+}
+
+void
+compound_assignment_multiply_128 (void)
+{
+ decimal128 a (1000), b;
+
+ b = a; b *= d32; VERIFY (b == 5000);
+ b = a; b *= d64; VERIFY (b == -10000);
+ b = a; b *= d128; VERIFY (b == 25000);
+ b = a; b *= si; VERIFY (b == -2000);
+ b = a; b *= ui; VERIFY (b == 5000);
+ b = a; b *= sl; VERIFY (b == -10000);
+ b = a; b *= ul; VERIFY (b == 20000);
+ b = a; b *= sll; VERIFY (b == -25000);
+ b = a; b *= ull; VERIFY (b == 50000);
+}
+
+void
+compound_assignment_divide_128 (void)
+{
+ decimal128 a (1000), b;
+
+ b = a; b /= d32; VERIFY (b == 200);
+ b = a; b /= d64; VERIFY (b == -100);
+ b = a; b /= d128; VERIFY (b == 40);
+ b = a; b /= si; VERIFY (b == -500);
+ b = a; b /= ui; VERIFY (b == 200);
+ b = a; b /= sl; VERIFY (b == -100);
+ b = a; b /= ul; VERIFY (b == 50);
+ b = a; b /= sll; VERIFY (b == -40);
+ b = a; b /= ull; VERIFY (b == 20);
+}
+
+int
+main ()
+{
+ compound_assignment_add_32 ();
+ compound_assignment_subtract_32 ();
+ compound_assignment_multiply_32 ();
+ compound_assignment_divide_32 ();
+
+ compound_assignment_add_64 ();
+ compound_assignment_subtract_64 ();
+ compound_assignment_multiply_64 ();
+ compound_assignment_divide_64 ();
+
+ compound_assignment_add_128 ();
+ compound_assignment_subtract_128 ();
+ compound_assignment_multiply_128 ();
+ compound_assignment_divide_128 ();
+}
diff --git a/libstdc++-v3/testsuite/decimal/conversion-from-float.cc b/libstdc++-v3/testsuite/decimal/conversion-from-float.cc
new file mode 100644
index 00000000000..c1824a827cc
--- /dev/null
+++ b/libstdc++-v3/testsuite/decimal/conversion-from-float.cc
@@ -0,0 +1,101 @@
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.2.2 Conversion from floating-point type (decimal32).
+// ISO/IEC TR 24733 3.2.3.2 Conversion from floating-point type (decimal64).
+// ISO/IEC TR 24733 3.2.4.2 Conversion from floating-point type (decimal128).
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+using namespace std::decimal;
+
+void
+conversion_from_float_32 ()
+{
+ decimal32 d32(123);
+ decimal64 d64(234);
+ decimal128 d128(345);
+ float f = 456.F;
+ double d = 567.;
+ long double ld = 678.L;
+
+ d32 = (decimal32) d64;
+ VERIFY (d32 == make_decimal32 (234LL, 0));
+ d32 = (decimal32) d128;
+ VERIFY (d32 == make_decimal32 (345LL, 0));
+ d32 = (decimal32) f;
+ VERIFY (d32 == make_decimal32 (456LL, 0));
+ d32 = (decimal32) d;
+ VERIFY (d32 == make_decimal32 (567LL, 0));
+ d32 = (decimal32) ld;
+ VERIFY (d32 == make_decimal32 (678LL, 0));
+}
+
+void
+conversion_from_float_64 ()
+{
+ decimal32 d32(123);
+ decimal64 d64(234);
+ decimal128 d128(345);
+ float f = 456.F;
+ double d = 567.;
+ long double ld = 678.L;
+
+ d64 = d32;
+ VERIFY (d64 == make_decimal64 (123LL, 0));
+ d64 = (decimal64) d128;
+ VERIFY (d64 == make_decimal64 (345LL, 0));
+ d64 = (decimal64) f;
+ VERIFY (d64 == make_decimal64 (456LL, 0));
+ d64 = (decimal64) d;
+ VERIFY (d64 == make_decimal64 (567LL, 0));
+ d64 = (decimal64) ld;
+ VERIFY (d64 == make_decimal64 (678LL, 0));
+}
+
+void
+conversion_from_float_128 ()
+{
+ decimal32 d32(123);
+ decimal64 d64(234);
+ decimal128 d128(345);
+ float f = 456.F;
+ double d = 567.;
+ long double ld = 678.L;
+
+ d128 = d32;
+ VERIFY (d128 == make_decimal128 (123LL, 0));
+ d128 = d64;
+ VERIFY (d128 == make_decimal128 (234LL, 0));
+ d128 = (decimal128) f;
+ VERIFY (d128 == make_decimal128 (456LL, 0));
+ d128 = (decimal128) d;
+ VERIFY (d128 == make_decimal128 (567LL, 0));
+ d128 = (decimal128) ld;
+ VERIFY (d128 == make_decimal128 (678LL, 0));
+}
+
+int
+main ()
+{
+ conversion_from_float_32 ();
+ conversion_from_float_64 ();
+ conversion_from_float_128 ();
+}
diff --git a/libstdc++-v3/testsuite/decimal/conversion-from-integral.cc b/libstdc++-v3/testsuite/decimal/conversion-from-integral.cc
new file mode 100644
index 00000000000..78d5eb76a79
--- /dev/null
+++ b/libstdc++-v3/testsuite/decimal/conversion-from-integral.cc
@@ -0,0 +1,193 @@
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.2.3 Conversion from integral type (decimal32).
+// ISO/IEC TR 24733 3.2.3.3 Conversion from integral type (decimal64).
+// ISO/IEC TR 24733 3.2.4.3 Conversion from integral type (decimal128).
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+using namespace std::decimal;
+
+void
+conversion_from_integral_p32 ()
+{
+ decimal32 d;
+ decimal32 from_si (1);
+ decimal32 from_ui (2U);
+ decimal32 from_sl (3L);
+ decimal32 from_ul (4UL);
+ decimal32 from_sll (5LL);
+ decimal32 from_ull (6ULL);
+
+ d++; VERIFY (from_si == d);
+ d++; VERIFY (from_ui == d);
+ d++; VERIFY (from_sl == d);
+ d++; VERIFY (from_ul == d);
+ d++; VERIFY (from_sll == d);
+ d++; VERIFY (from_ull == d);
+
+ from_si = 7;
+ d++; VERIFY (from_si == d);
+ from_ui = 8U;
+ d++; VERIFY (from_ui == d);
+ from_sl = 9L;
+ d++; VERIFY (from_sl == d);
+ from_ul = 10UL;
+ d++; VERIFY (from_ul == d);
+ from_sll = 11LL;
+ d++; VERIFY (from_sll == d);
+ from_ull = 12ULL;
+ d++; VERIFY (from_ull == d);
+}
+
+void
+conversion_from_integral_m32 ()
+{
+ decimal32 d;
+ decimal32 from_si (-1);
+ decimal32 from_sl (-2L);
+ decimal32 from_sll (-3LL);
+
+ d--; VERIFY (from_si == d);
+ d--; VERIFY (from_sl == d);
+ d--; VERIFY (from_sll == d);
+
+ from_si = -4;
+ d--; VERIFY (from_si == d);
+ from_sl = -5L;
+ d--; VERIFY (from_sl == d);
+ from_sll = -6LL;
+ d--; VERIFY (from_sll == d);
+}
+
+void
+conversion_from_integral_p64 ()
+{
+ decimal64 d;
+ decimal64 from_si (1);
+ decimal64 from_ui (2U);
+ decimal64 from_sl (3L);
+ decimal64 from_ul (4UL);
+ decimal64 from_sll (5LL);
+ decimal64 from_ull (6ULL);
+
+ d++; VERIFY (from_si == d);
+ d++; VERIFY (from_ui == d);
+ d++; VERIFY (from_sl == d);
+ d++; VERIFY (from_ul == d);
+ d++; VERIFY (from_sll == d);
+ d++; VERIFY (from_ull == d);
+
+ from_si = 7;
+ d++; VERIFY (from_si == d);
+ from_ui = 8U;
+ d++; VERIFY (from_ui == d);
+ from_sl = 9L;
+ d++; VERIFY (from_sl == d);
+ from_ul = 10UL;
+ d++; VERIFY (from_ul == d);
+ from_sll = 11LL;
+ d++; VERIFY (from_sll == d);
+ from_ull = 12ULL;
+ d++; VERIFY (from_ull == d);
+}
+
+void
+conversion_from_integral_m64 ()
+{
+ decimal64 d;
+ decimal64 from_si (-1);
+ decimal64 from_sl (-2L);
+ decimal64 from_sll (-3LL);
+
+ d--; VERIFY (from_si == d);
+ d--; VERIFY (from_sl == d);
+ d--; VERIFY (from_sll == d);
+
+ from_si = -4;
+ d--; VERIFY (from_si == d);
+ from_sl = -5L;
+ d--; VERIFY (from_sl == d);
+ from_sll = -6LL;
+ d--; VERIFY (from_sll == d);
+}
+
+void
+conversion_from_integral_p128 ()
+{
+ decimal128 d;
+ decimal128 from_si (1);
+ decimal128 from_ui (2U);
+ decimal128 from_sl (3L);
+ decimal128 from_ul (4UL);
+ decimal128 from_sll (5LL);
+ decimal128 from_ull (6ULL);
+
+ d++; VERIFY (from_si == d);
+ d++; VERIFY (from_ui == d);
+ d++; VERIFY (from_sl == d);
+ d++; VERIFY (from_ul == d);
+ d++; VERIFY (from_sll == d);
+ d++; VERIFY (from_ull == d);
+
+ from_si = 7;
+ d++; VERIFY (from_si == d);
+ from_ui = 8U;
+ d++; VERIFY (from_ui == d);
+ from_sl = 9L;
+ d++; VERIFY (from_sl == d);
+ from_ul = 10UL;
+ d++; VERIFY (from_ul == d);
+ from_sll = 11LL;
+ d++; VERIFY (from_sll == d);
+ from_ull = 12ULL;
+}
+
+void
+conversion_from_integral_m128 ()
+{
+ decimal128 d;
+ decimal128 from_si (-1);
+ decimal128 from_sl (-2L);
+ decimal128 from_sll (-3LL);
+
+ d--; VERIFY (from_si == d);
+ d--; VERIFY (from_sl == d);
+ d--; VERIFY (from_sll == d);
+
+ from_si = -4;
+ d--; VERIFY (from_si == d);
+ from_sl = -5L;
+ d--; VERIFY (from_sl == d);
+ from_sll = -6LL;
+ d--; VERIFY (from_sll == d);
+}
+
+int
+main ()
+{
+ conversion_from_integral_p32 ();
+ conversion_from_integral_m32 ();
+ conversion_from_integral_p64 ();
+ conversion_from_integral_m64 ();
+ conversion_from_integral_p128 ();
+ conversion_from_integral_m128 ();
+}
diff --git a/libstdc++-v3/testsuite/decimal/conversion-to-generic-float.cc b/libstdc++-v3/testsuite/decimal/conversion-to-generic-float.cc
new file mode 100644
index 00000000000..bac0c820ee6
--- /dev/null
+++ b/libstdc++-v3/testsuite/decimal/conversion-to-generic-float.cc
@@ -0,0 +1,105 @@
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.6 Conversion to generic floating-point type.
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+using namespace std::decimal;
+
+void
+conversion_to_generic_float_32 ()
+{
+ std::decimal::decimal32 d32(123);
+ float f;
+ double d;
+ long double ld;
+
+ f = decimal32_to_float (d32);
+ VERIFY (f == 123.F);
+ d = decimal32_to_double (d32);
+ VERIFY (d == 123.);
+ ld = decimal32_to_long_double (d32);
+ VERIFY (ld == 123.L);
+
+ d32++;
+ f = decimal_to_float (d32);
+ VERIFY (f == 124.F);
+ d = decimal_to_double (d32);
+ VERIFY (d == 124.);
+ ld = decimal_to_long_double (d32);
+ VERIFY (ld == 124.L);
+}
+
+void
+conversion_to_generic_float_64 ()
+{
+ std::decimal::decimal64 d64(234);
+ float f;
+ double d;
+ long double ld;
+
+ f = decimal64_to_float (d64);
+ VERIFY (f == 234.F);
+ d = decimal64_to_double (d64);
+ VERIFY (d == 234.);
+ ld = decimal64_to_long_double (d64);
+ VERIFY (ld == 234.L);
+
+ d64++;
+ f = decimal_to_float (d64);
+ VERIFY (f == 235.F);
+ d = decimal_to_double (d64);
+ VERIFY (d == 235.);
+ ld = decimal_to_long_double (d64);
+ VERIFY (ld == 235.L);
+}
+
+void
+conversion_to_generic_float_128 ()
+{
+ std::decimal::decimal128 d128(345);
+ float f;
+ double d;
+ long double ld;
+
+ f = decimal128_to_float (d128);
+ VERIFY (f == 345.F);
+ d = decimal128_to_double (d128);
+ VERIFY (d == 345.);
+ ld = decimal128_to_long_double (d128);
+ VERIFY (ld == 345.L);
+
+ d128++;
+ f = decimal_to_float (d128);
+ VERIFY (f == 346.F);
+ d = decimal_to_double (d128);
+ VERIFY (d == 346.);
+ ld = decimal_to_long_double (d128);
+ VERIFY (ld == 346.L);
+}
+
+int
+main ()
+{
+ conversion_to_generic_float_32 ();
+ conversion_to_generic_float_64 ();
+ conversion_to_generic_float_128 ();
+}
diff --git a/libstdc++-v3/testsuite/decimal/conversion-to-integral.cc b/libstdc++-v3/testsuite/decimal/conversion-to-integral.cc
new file mode 100644
index 00000000000..9322c1bc78f
--- /dev/null
+++ b/libstdc++-v3/testsuite/decimal/conversion-to-integral.cc
@@ -0,0 +1,85 @@
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.2.4 Conversion to integral type (decimal32).
+// ISO/IEC TR 24733 3.2.3.4 Conversion to integral type (decimal64).
+// ISO/IEC TR 24733 3.2.4.4 Conversion to integral type (decimal128).
+
+#include <decimal/decimal>
+#include <climits>
+#include <cstdio>
+#include <testsuite_hooks.h>
+
+// Use extension to replace implicit long long conversion with function call.
+#define LONGLONG(X) decimal_to_long_long(X)
+
+using namespace std::decimal;
+
+void
+conversion_to_integral_32 (void)
+{
+ #undef MAXVAL
+ #define MAXVAL 999999LL
+ decimal32 a, b (1), c (-1), d (MAXVAL), e (-MAXVAL);
+ long long ll;
+
+ ll = LONGLONG (a); VERIFY (ll == 0LL);
+ ll = LONGLONG (b); VERIFY (ll == 1LL);
+ ll = LONGLONG (c); VERIFY (ll == -1LL);
+ ll = LONGLONG (d); VERIFY (ll == MAXVAL);
+ ll = LONGLONG (e); VERIFY (ll == -MAXVAL);
+}
+
+void
+conversion_to_integral_64 (void)
+{
+ #undef MAXVAL
+ #define MAXVAL 999999999999999LL
+ decimal64 a, b (1), c (-1), d (MAXVAL), e (-MAXVAL);
+ long long ll;
+
+ ll = LONGLONG (a); VERIFY (ll == 0LL);
+ ll = LONGLONG (b); VERIFY (ll == 1LL);
+ ll = LONGLONG (c); VERIFY (ll == -1LL);
+ ll = LONGLONG (d); VERIFY (ll == MAXVAL);
+ ll = LONGLONG (e); VERIFY (ll == -MAXVAL);
+}
+
+void
+conversion_to_integral_128 (void)
+{
+ #undef MAXVAL
+ #define MAXVAL LONG_LONG_MAX
+ decimal128 a, b (1), c (-1), d (MAXVAL), e (-MAXVAL);
+ long long ll;
+
+ ll = LONGLONG (a); VERIFY (ll == 0LL);
+ ll = LONGLONG (b); VERIFY (ll == 1LL);
+ ll = LONGLONG (c); VERIFY (ll == -1LL);
+ ll = LONGLONG (d); VERIFY (ll == MAXVAL);
+ ll = LONGLONG (e); VERIFY (ll == -MAXVAL);
+}
+
+int
+main ()
+{
+ conversion_to_integral_32 ();
+ conversion_to_integral_64 ();
+ conversion_to_integral_128 ();
+}
diff --git a/libstdc++-v3/testsuite/decimal/ctor.cc b/libstdc++-v3/testsuite/decimal/ctor.cc
new file mode 100644
index 00000000000..84e04ade691
--- /dev/null
+++ b/libstdc++-v3/testsuite/decimal/ctor.cc
@@ -0,0 +1,65 @@
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.2.1 Construct/copy/destroy (decimal32).
+// ISO/IEC TR 24733 3.2.3.1 Construct/copy/destroy (decimal64).
+// ISO/IEC TR 24733 3.2.4.1 Construct/copy/destroy (decimal128).
+
+// Test the default constructor.
+
+#include <decimal/decimal>
+#include <cstring>
+#include <testsuite_hooks.h>
+
+using namespace std::decimal;
+
+void
+ctor_32 (void)
+{
+ decimal32 a;
+ float b __attribute__((mode(SD))) = 0.e-101DF;
+
+ VERIFY (memcmp (&a, &b, 4) == 0);
+}
+
+void
+ctor_64 (void)
+{
+ decimal64 a;
+ float b __attribute__((mode(DD))) = 0.e-398DD;
+
+ VERIFY (memcmp (&a, &b, 8) == 0);
+}
+
+void
+ctor_128 (void)
+{
+ decimal128 a;
+ float b __attribute__((mode(TD))) = 0.e-6176DL;
+
+ VERIFY (memcmp (&a, &b, 16) == 0);
+}
+
+int
+main ()
+{
+ ctor_32 ();
+ ctor_64 ();
+ ctor_128 ();
+}
diff --git a/libstdc++-v3/testsuite/decimal/incdec-memfunc.cc b/libstdc++-v3/testsuite/decimal/incdec-memfunc.cc
new file mode 100644
index 00000000000..f2d1178a6f1
--- /dev/null
+++ b/libstdc++-v3/testsuite/decimal/incdec-memfunc.cc
@@ -0,0 +1,181 @@
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.2.5 Increment and decrement operators (decimal32).
+// ISO/IEC TR 24733 3.2.3.5 Increment and decrement operators (decimal64).
+// ISO/IEC TR 24733 3.2.4.5 Increment and decrement operators (decimal128).
+
+// Access member functions directly.
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+// Use extension to replace implicit long long conversion with function call.
+#define LONGLONG(X) decimal_to_long_long(X)
+
+using namespace std::decimal;
+
+void
+incdec32 (void)
+{
+ int ival;
+ std::decimal::decimal32 a(11), b, c;
+
+ // Verify that we get the expected value of b after assignment.
+ b = a;
+ ival = LONGLONG (b); VERIFY (ival == 11);
+
+ // Check that the increment and decrement operators change the value
+ // of the original class.
+ b = a;
+ b.operator++();
+ ival = LONGLONG (b); VERIFY (ival == 12);
+
+ b = a;
+ b.operator++(1);
+ ival = LONGLONG (b); VERIFY (ival == 12);
+
+ b = a;
+ b.operator--();
+ ival = LONGLONG (b); VERIFY (ival == 10);
+
+ b = a;
+ b.operator--(1);
+ ival = LONGLONG (b); VERIFY (ival == 10);
+
+ // Check that the increment and decrement operators return the
+ // correct value.
+ b = a;
+ c = b.operator++();
+ ival = LONGLONG (c); VERIFY (ival == 12);
+
+ b = a;
+ c = b.operator++(1);
+ ival = LONGLONG (c); VERIFY (ival == 11);
+
+ b = a;
+ c = b.operator--();
+ ival = LONGLONG (c); VERIFY (ival == 10);
+
+ b = a;
+ c = b.operator--(1);
+ ival = LONGLONG (c); VERIFY (ival == 11);
+}
+
+void
+incdec64 (void)
+{
+ int ival;
+ std::decimal::decimal64 a(11), b, c;
+
+ // Verify that we get the expected value of b after assignment.
+ b = a;
+ ival = LONGLONG (b); VERIFY (ival == 11);
+
+ // Check that the increment and decrement operators change the value
+ // of the original class.
+ b = a;
+ b.operator++();
+ ival = LONGLONG (b); VERIFY (ival == 12);
+
+ b = a;
+ b.operator++(1);
+ ival = LONGLONG (b); VERIFY (ival == 12);
+
+ b = a;
+ b.operator--();
+ ival = LONGLONG (b); VERIFY (ival == 10);
+
+ b = a;
+ b.operator--(1);
+ ival = LONGLONG (b); VERIFY (ival == 10);
+
+ // Check that the increment and decrement operators return the
+ // correct value.
+ b = a;
+ c = b.operator++();
+ ival = LONGLONG (c); VERIFY (ival == 12);
+
+ b = a;
+ c = b.operator++(1);
+ ival = LONGLONG (c); VERIFY (ival == 11);
+
+ b = a;
+ c = b.operator--();
+ ival = LONGLONG (c); VERIFY (ival == 10);
+
+ b = a;
+ c = b.operator--(1);
+ ival = LONGLONG (c); VERIFY (ival == 11);
+}
+
+void
+incdec128 (void)
+{
+ int ival;
+ std::decimal::decimal128 a(11), b, c;
+
+ // Verify that we get the expected value of b after assignment.
+ b = a;
+ ival = LONGLONG (b); VERIFY (ival == 11);
+
+ // Check that the increment and decrement operators change the value
+ // of the original class.
+ b = a;
+ b.operator++();
+ ival = LONGLONG (b); VERIFY (ival == 12);
+
+ b = a;
+ b.operator++(1);
+ ival = LONGLONG (b); VERIFY (ival == 12);
+
+ b = a;
+ b.operator--();
+ ival = LONGLONG (b); VERIFY (ival == 10);
+
+ b = a;
+ b.operator--(1);
+ ival = LONGLONG (b); VERIFY (ival == 10);
+
+ // Check that the increment and decrement operators return the
+ // correct value.
+ b = a;
+ c = b.operator++();
+ ival = LONGLONG (c); VERIFY (ival == 12);
+
+ b = a;
+ c = b.operator++(1);
+ ival = LONGLONG (c); VERIFY (ival == 11);
+
+ b = a;
+ c = b.operator--();
+ ival = LONGLONG (c); VERIFY (ival == 10);
+
+ b = a;
+ c = b.operator--(1);
+ ival = LONGLONG (c); VERIFY (ival == 11);
+}
+
+int
+main ()
+{
+ incdec32 ();
+ incdec64 ();
+ incdec128 ();
+}
diff --git a/libstdc++-v3/testsuite/decimal/incdec.cc b/libstdc++-v3/testsuite/decimal/incdec.cc
new file mode 100644
index 00000000000..45211b1de21
--- /dev/null
+++ b/libstdc++-v3/testsuite/decimal/incdec.cc
@@ -0,0 +1,179 @@
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.2.5 Increment and decrement operators (decimal32).
+// ISO/IEC TR 24733 3.2.3.5 Increment and decrement operators (decimal64).
+// ISO/IEC TR 24733 3.2.4.5 Increment and decrement operators (decimal128).
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+// Use extension to replace implicit long long conversion with function call.
+#define LONGLONG(X) decimal_to_long_long(X)
+
+using namespace std::decimal;
+
+void
+incdec32 (void)
+{
+ int ival;
+ std::decimal::decimal32 a(11), b, c;
+
+ // Verify that we get the expected value of b after assignment.
+ b = a;
+ ival = LONGLONG (b); VERIFY (ival == 11);
+
+ // Check that the increment and decrement operators change the value
+ // of the original class.
+ b = a;
+ ++b;
+ ival = LONGLONG (b); VERIFY (ival == 12);
+
+ b = a;
+ b++;
+ ival = LONGLONG (b); VERIFY (ival == 12);
+
+ b = a;
+ --b;
+ ival = LONGLONG (b); VERIFY (ival == 10);
+
+ b = a;
+ b--;
+ ival = LONGLONG (b); VERIFY (ival == 10);
+
+ // Check that the increment and decrement operators return the
+ // correct value.
+ b = a;
+ c = ++b;
+ ival = LONGLONG (c); VERIFY (ival == 12);
+
+ b = a;
+ c = b++;
+ ival = LONGLONG (c); VERIFY (ival == 11);
+
+ b = a;
+ c = --b;
+ ival = LONGLONG (c); VERIFY (ival == 10);
+
+ b = a;
+ c = b--;
+ ival = LONGLONG (c); VERIFY (ival == 11);
+}
+
+void
+incdec64 (void)
+{
+ int ival;
+ std::decimal::decimal64 a(11), b, c;
+
+ // Verify that we get the expected value of b after assignment.
+ b = a;
+ ival = LONGLONG (b); VERIFY (ival == 11);
+
+ // Check that the increment and decrement operators change the value
+ // of the original class.
+ b = a;
+ ++b;
+ ival = LONGLONG (b); VERIFY (ival == 12);
+
+ b = a;
+ b++;
+ ival = LONGLONG (b); VERIFY (ival == 12);
+
+ b = a;
+ --b;
+ ival = LONGLONG (b); VERIFY (ival == 10);
+
+ b = a;
+ b--;
+ ival = LONGLONG (b); VERIFY (ival == 10);
+
+ // Check that the increment and decrement operators return the
+ // correct value.
+ b = a;
+ c = ++b;
+ ival = LONGLONG (c); VERIFY (ival == 12);
+
+ b = a;
+ c = b++;
+ ival = LONGLONG (c); VERIFY (ival == 11);
+
+ b = a;
+ c = --b;
+ ival = LONGLONG (c); VERIFY (ival == 10);
+
+ b = a;
+ c = b--;
+ ival = LONGLONG (c); VERIFY (ival == 11);
+}
+
+void
+incdec128 (void)
+{
+ int ival;
+ std::decimal::decimal128 a(11), b, c;
+
+ // Verify that we get the expected value of b after assignment.
+ b = a;
+ ival = LONGLONG (b); VERIFY (ival == 11);
+
+ // Check that the increment and decrement operators change the value
+ // of the original class.
+ b = a;
+ ++b;
+ ival = LONGLONG (b); VERIFY (ival == 12);
+
+ b = a;
+ b++;
+ ival = LONGLONG (b); VERIFY (ival == 12);
+
+ b = a;
+ --b;
+ ival = LONGLONG (b); VERIFY (ival == 10);
+
+ b = a;
+ b--;
+ ival = LONGLONG (b); VERIFY (ival == 10);
+
+ // Check that the increment and decrement operators return the
+ // correct value.
+ b = a;
+ c = ++b;
+ ival = LONGLONG (c); VERIFY (ival == 12);
+
+ b = a;
+ c = b++;
+ ival = LONGLONG (c); VERIFY (ival == 11);
+
+ b = a;
+ c = --b;
+ ival = LONGLONG (c); VERIFY (ival == 10);
+
+ b = a;
+ c = b--;
+ ival = LONGLONG (c); VERIFY (ival == 11);
+}
+
+int
+main ()
+{
+ incdec32 ();
+ incdec64 ();
+ incdec128 ();
+}
diff --git a/libstdc++-v3/testsuite/decimal/make-decimal.cc b/libstdc++-v3/testsuite/decimal/make-decimal.cc
new file mode 100644
index 00000000000..be4fa4632ad
--- /dev/null
+++ b/libstdc++-v3/testsuite/decimal/make-decimal.cc
@@ -0,0 +1,132 @@
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.5 Initialization from coefficient and exponent.
+
+#include <decimal/decimal>
+#include <cstring>
+#include <testsuite_hooks.h>
+
+#define PASTE2(A,B) A ## B
+#define PASTE(A,B) PASTE2(A,B)
+
+#define TESTVAL_NEG(COEFF,ESIGN,EXP,SUF,NUM,SIZE) \
+ x = PASTE(PASTE(PASTE(PASTE(PASTE(COEFF,.),E),ESIGN),EXP),SUF); \
+ sll = PASTE(COEFF,LL); \
+ i = ESIGN EXP; \
+ a = PASTE(make_decimal,32) (sll, i); \
+ b = PASTE(make_decimal,32) (PASTE(COEFF,LL), ESIGN EXP); \
+ VERIFY ((__builtin_memcmp ((void *)&x, (void *)&a, SIZE) == 0) \
+ && (__builtin_memcmp ((void *)&x, (void *)&b,SIZE) == 0));
+
+#define TESTVAL_NONNEG(COEFF,ESIGN,EXP,SUF,NUM,SIZE) \
+ x = PASTE(PASTE(PASTE(PASTE(PASTE(COEFF,.),E),ESIGN),EXP),SUF); \
+ sll = PASTE(COEFF,LL); \
+ ull = PASTE(COEFF,ULL); \
+ i = ESIGN EXP; \
+ a = PASTE(make_decimal,32) (sll, i); \
+ b = PASTE(make_decimal,32) (PASTE(COEFF,LL), ESIGN EXP); \
+ c = PASTE(make_decimal,32) (ull, i); \
+ d = PASTE(make_decimal,32) (PASTE(COEFF,ULL), ESIGN EXP); \
+ VERIFY ((__builtin_memcmp ((void *)&x, (void *)&a, SIZE) == 0) \
+ && (__builtin_memcmp ((void *)&x, (void *)&b,SIZE) == 0) \
+ && (__builtin_memcmp ((void *)&x, (void *)&c,SIZE) == 0) \
+ && (__builtin_memcmp ((void *)&x, (void *)&d,SIZE) == 0));
+
+using namespace std::decimal;
+
+void
+make_decimal_32 (void)
+{
+ decimal32 a, b, c, d;
+ float x __attribute__((mode(SD)));
+ int i;
+ unsigned long sz = sizeof (decimal32);
+ volatile long long sll;
+ volatile unsigned long long ull;
+
+ TESTVAL_NONNEG (0, +, 0, DF, 32, sz);
+ TESTVAL_NONNEG (5, +, 1, DF, 32, sz);
+ TESTVAL_NONNEG (50, +, 0, DF, 32, sz);
+ TESTVAL_NONNEG (500, +, 0, DF, 32, sz);
+ TESTVAL_NEG (-25, -, 3, DF, 32, sz)
+ TESTVAL_NEG (-500, +, 0, DF, 32, sz);
+ TESTVAL_NONNEG (999999, +, 91, DF, 32, sz);
+ TESTVAL_NONNEG (1, -, 9, DF, 32, sz);
+ TESTVAL_NONNEG (1, -, 90, DF, 32, sz);
+ TESTVAL_NONNEG (1, -, 95, DF, 32, sz);
+ TESTVAL_NONNEG (1, -, 101, DF, 32, sz);
+ TESTVAL_NEG (-1, -, 101, DF, 32, sz);
+}
+
+void
+make_decimal_64 (void)
+{
+ decimal64 a, b, c, d;
+ float x __attribute__((mode(DD)));
+ int i;
+ unsigned long sz = sizeof (decimal64);
+ volatile long long sll;
+ volatile unsigned long long ull;
+
+ TESTVAL_NONNEG (0, +, 0, DF, 64, sz);
+ TESTVAL_NONNEG (5, +, 1, DF, 64, sz);
+ TESTVAL_NONNEG (50, +, 0, DF, 64, sz);
+ TESTVAL_NONNEG (500, +, 0, DF, 64, sz);
+ TESTVAL_NEG (-25, -, 3, DF, 64, sz)
+ TESTVAL_NEG (-500, +, 0, DF, 64, sz);
+ TESTVAL_NONNEG (999999, +, 91, DF, 64, sz);
+ TESTVAL_NONNEG (1, -, 9, DF, 64, sz);
+ TESTVAL_NONNEG (1, -, 90, DF, 64, sz);
+ TESTVAL_NONNEG (1, -, 95, DF, 64, sz);
+ TESTVAL_NONNEG (1, -, 101, DF, 64, sz);
+ TESTVAL_NEG (-1, -, 101, DF, 64, sz);
+}
+
+void
+make_decimal_128 (void)
+{
+ decimal128 a, b, c, d;
+ float x __attribute__((mode(TD)));
+ int i;
+ unsigned long sz = sizeof (decimal128);
+ volatile long long sll;
+ volatile unsigned long long ull;
+
+ TESTVAL_NONNEG (0, +, 0, DF, 128, sz);
+ TESTVAL_NONNEG (5, +, 1, DF, 128, sz);
+ TESTVAL_NONNEG (50, +, 0, DF, 128, sz);
+ TESTVAL_NONNEG (500, +, 0, DF, 128, sz);
+ TESTVAL_NEG (-25, -, 3, DF, 128, sz)
+ TESTVAL_NEG (-500, +, 0, DF, 128, sz);
+ TESTVAL_NONNEG (999999, +, 91, DF, 128, sz);
+ TESTVAL_NONNEG (1, -, 9, DF, 128, sz);
+ TESTVAL_NONNEG (1, -, 90, DF, 128, sz);
+ TESTVAL_NONNEG (1, -, 95, DF, 128, sz);
+ TESTVAL_NONNEG (1, -, 101, DF, 128, sz);
+ TESTVAL_NEG (-1, -, 101, DF, 128, sz);
+}
+
+int
+main ()
+{
+ make_decimal_32 ();
+ make_decimal_64 ();
+ make_decimal_128 ();
+}
diff --git a/libstdc++-v3/testsuite/decimal/mixed-mode_neg.cc b/libstdc++-v3/testsuite/decimal/mixed-mode_neg.cc
new file mode 100644
index 00000000000..7f9da43ed43
--- /dev/null
+++ b/libstdc++-v3/testsuite/decimal/mixed-mode_neg.cc
@@ -0,0 +1,206 @@
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile }
+// { dg-require-effective-target dfp }
+
+// Test that binary operators do not accept mixed decimal and generic
+// floating-point operands. This isn't explicity prohibited in
+// ISO/IEC TR 24733 but it is prohibited in C, and in C++ there should
+// not be an implicit conversion from a decimal floating-point type to
+// a generic floating-point type.
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+using namespace std::decimal;
+
+decimal32 a32, b32, c32;
+decimal64 a64, b64, c64;
+decimal128 a128, b128, c128;
+float f;
+double d;
+long double ld;
+bool b1, b2, b3, b4, b5, b6;
+
+void
+bad_add (void)
+{
+ a32 = b32 + f; // { dg-error "error" }
+ a32 = ld + b32; // { dg-error "error" }
+ a64 = b64 + d; // { dg-error "error" }
+ a64 = ld + b64; // { dg-error "error" }
+ a128 = b128 + ld; // { dg-error "error" }
+ a128 = d + b128; // { dg-error "error" }
+}
+
+void
+bad_subtract (void)
+{
+ a32 = b32 - f; // { dg-error "error" }
+ a32 = ld - b32; // { dg-error "error" }
+ a64 = b64 - d; // { dg-error "error" }
+ a64 = ld - b64; // { dg-error "error" }
+ a128 = b128 - ld; // { dg-error "error" }
+ a128 = d - b128; // { dg-error "error" }
+}
+
+void
+bad_multiply (void)
+{
+ a32 = b32 * f; // { dg-error "error" }
+ a32 = ld * b32; // { dg-error "error" }
+ a64 = b64 * d; // { dg-error "error" }
+ a64 = ld * b64; // { dg-error "error" }
+ a128 = b128 * ld; // { dg-error "error" }
+ a128 = d * b128; // { dg-error "error" }
+}
+
+void
+bad_divide (void)
+{
+ a32 = b32 / f; // { dg-error "error" }
+ a32 = ld / b32; // { dg-error "error" }
+ a64 = b64 / d; // { dg-error "error" }
+ a64 = ld / b64; // { dg-error "error" }
+ a128 = b128 / ld; // { dg-error "error" }
+ a128 = d / b128; // { dg-error "error" }
+}
+
+void
+bad_eq (void)
+{
+ b1 = b32 == f; // { dg-error "error" }
+ b2 = ld == b32; // { dg-error "error" }
+ b3 = b64 == d; // { dg-error "error" }
+ b4 = ld == b64; // { dg-error "error" }
+ b5 = b128 == ld; // { dg-error "error" }
+ b6 = d == b128; // { dg-error "error" }
+}
+
+void
+bad_ne (void)
+{
+ b1 = b32 != f; // { dg-error "error" }
+ b2 = ld != b32; // { dg-error "error" }
+ b3 = b64 != d; // { dg-error "error" }
+ b4 = ld != b64; // { dg-error "error" }
+ b5 = b128 != ld; // { dg-error "error" }
+ b6 = d != b128; // { dg-error "error" }
+}
+
+void
+bad_lt (void)
+{
+ b1 = b32 < f; // { dg-error "error" }
+ b2 = ld < b32; // { dg-error "error" }
+ b3 = b64 < d; // { dg-error "error" }
+ b4 = ld < b64; // { dg-error "error" }
+ b5 = b128 < ld; // { dg-error "error" }
+ b6 = d < b128; // { dg-error "error" }
+}
+
+void
+bad_le (void)
+{
+ b1 = b32 <= f; // { dg-error "error" }
+ b2 = ld <= b32; // { dg-error "error" }
+ b3 = b64 <= d; // { dg-error "error" }
+ b4 = ld <= b64; // { dg-error "error" }
+ b5 = b128 <= ld; // { dg-error "error" }
+ b6 = d <= b128; // { dg-error "error" }
+}
+
+void
+bad_gt (void)
+{
+ b1 = b32 > f; // { dg-error "error" }
+ b2 = ld > b32; // { dg-error "error" }
+ b3 = b64 > d; // { dg-error "error" }
+ b4 = ld > b64; // { dg-error "error" }
+ b5 = b128 > ld; // { dg-error "error" }
+ b6 = d > b128; // { dg-error "error" }
+}
+
+void
+bad_ge (void)
+{
+ b1 = b32 >= f; // { dg-error "error" }
+ b2 = ld >= b32; // { dg-error "error" }
+ b3 = b64 >= d; // { dg-error "error" }
+ b4 = ld >= b64; // { dg-error "error" }
+ b5 = b128 >= ld; // { dg-error "error" }
+ b6 = d >= b128; // { dg-error "error" }
+}
+
+void
+bad_pluseq (void)
+{
+ a32 += f; // { dg-error "error" }
+ a32 += d; // { dg-error "error" }
+ a32 += ld; // { dg-error "error" }
+ a64 += f; // { dg-error "error" }
+ a64 += d; // { dg-error "error" }
+ a64 += ld; // { dg-error "error" }
+ a128 += f; // { dg-error "error" }
+ a128 += d; // { dg-error "error" }
+ a128 += ld; // { dg-error "error" }
+}
+
+void
+bad_minuseq (void)
+{
+ a32 -= f; // { dg-error "error" }
+ a32 -= d; // { dg-error "error" }
+ a32 -= ld; // { dg-error "error" }
+ a64 -= f; // { dg-error "error" }
+ a64 -= d; // { dg-error "error" }
+ a64 -= ld; // { dg-error "error" }
+ a128 -= f; // { dg-error "error" }
+ a128 -= d; // { dg-error "error" }
+ a128 -= ld; // { dg-error "error" }
+}
+
+void
+bad_timeseq (void)
+{
+ a32 *= f; // { dg-error "error" }
+ a32 *= d; // { dg-error "error" }
+ a32 *= ld; // { dg-error "error" }
+ a64 *= f; // { dg-error "error" }
+ a64 *= d; // { dg-error "error" }
+ a64 *= ld; // { dg-error "error" }
+ a128 *= f; // { dg-error "error" }
+ a128 *= d; // { dg-error "error" }
+ a128 *= ld; // { dg-error "error" }
+}
+
+void
+bad_divideeq (void)
+{
+ a32 /= f; // { dg-error "error" }
+ a32 /= d; // { dg-error "error" }
+ a32 /= ld; // { dg-error "error" }
+ a64 /= f; // { dg-error "error" }
+ a64 /= d; // { dg-error "error" }
+ a64 /= ld; // { dg-error "error" }
+ a128 /= f; // { dg-error "error" }
+ a128 /= d; // { dg-error "error" }
+ a128 /= ld; // { dg-error "error" }
+}
+
+// { dg-excess-errors "notes about candidates" }
diff --git a/libstdc++-v3/testsuite/decimal/operator_neg.cc b/libstdc++-v3/testsuite/decimal/operator_neg.cc
new file mode 100644
index 00000000000..fff81d1c06f
--- /dev/null
+++ b/libstdc++-v3/testsuite/decimal/operator_neg.cc
@@ -0,0 +1,160 @@
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile }
+// { dg-require-effective-target dfp }
+
+// Test that C++ binary operators that are restricted to integer operands
+// do not accept decimal float operands.
+
+#include <decimal/decimal>
+
+using namespace std::decimal;
+
+decimal32 a32, b32, c32;
+decimal64 a64, b64, c64;
+decimal128 a128, b128, c128;
+
+void
+modulus (void)
+{
+ a32 = b32 % c32; // { dg-error "error" }
+ a64 = b64 % c64; // { dg-error "error" }
+ a128 = b128 % c128; // { dg-error "error" }
+ a128 = b32 % c128; // { dg-error "error" }
+ a128 = b64 % c128; // { dg-error "error" }
+ a32 = 100 % c32; // { dg-error "error" }
+ a64 = 10 % c64; // { dg-error "error" }
+ a128 = 1000 % c128; // { dg-error "error" }
+ a32 = b32 % 7; // { dg-error "error" }
+ a64 = b64 % 5; // { dg-error "error" }
+ a128 = b128 % 3; // { dg-error "error" }
+}
+
+void
+bitwise_right_shift (void)
+{
+ a32 = b32 >> c32; // { dg-error "error" }
+ a64 = b64 >> c64; // { dg-error "error" }
+ a128 = b128 >> c128; // { dg-error "error" }
+ a128 = b32 >> c128; // { dg-error "error" }
+ a128 = b64 >> c128; // { dg-error "error" }
+ a32 = 100 >> c32; // { dg-error "error" }
+ a64 = 10 >> c64; // { dg-error "error" }
+ a128 = 1000 >> c128; // { dg-error "error" }
+ a32 = b32 >> 7; // { dg-error "error" }
+ a64 = b64 >> 5; // { dg-error "error" }
+ a128 = b128 >> 3; // { dg-error "error" }
+}
+
+void
+bitwise_left_shift (void)
+{
+ a32 = b32 << c32; // { dg-error "error" }
+ a64 = b64 << c64; // { dg-error "error" }
+ a128 = b128 << c128; // { dg-error "error" }
+ a128 = b32 << c128; // { dg-error "error" }
+ a128 = b64 << c128; // { dg-error "error" }
+ a32 = 100 << c32; // { dg-error "error" }
+ a64 = 10 << c64; // { dg-error "error" }
+ a128 = 1000 << c128; // { dg-error "error" }
+ a32 = b32 << 7; // { dg-error "error" }
+ a64 = b64 << 5; // { dg-error "error" }
+ a128 = b128 << 3; // { dg-error "error" }
+}
+
+void
+bitwise_exclusive_or (void)
+{
+ a32 = b32 ^ c32; // { dg-error "error" }
+ a64 = b64 ^ c64; // { dg-error "error" }
+ a128 = b128 ^ c128; // { dg-error "error" }
+ a128 = b32 ^ c128; // { dg-error "error" }
+ a128 = b64 ^ c128; // { dg-error "error" }
+ a32 = 100 ^ c32; // { dg-error "error" }
+ a64 = 10 ^ c64; // { dg-error "error" }
+ a128 = 1000 ^ c128; // { dg-error "error" }
+ a32 = b32 ^ 7; // { dg-error "error" }
+ a64 = b64 ^ 5; // { dg-error "error" }
+ a128 = b128 ^ 3; // { dg-error "error" }
+}
+
+void
+bitwise_inclusive_or (void)
+{
+ a32 = b32 | c32; // { dg-error "error" }
+ a64 = b64 | c64; // { dg-error "error" }
+ a128 = b128 | c128; // { dg-error "error" }
+ a128 = b32 | c128; // { dg-error "error" }
+ a128 = b64 | c128; // { dg-error "error" }
+ a32 = 100 | c32; // { dg-error "error" }
+ a64 = 10 | c64; // { dg-error "error" }
+ a128 = 1000 | c128; // { dg-error "error" }
+ a32 = b32 | 7; // { dg-error "error" }
+ a64 = b64 | 5; // { dg-error "error" }
+ a128 = b128 | 3; // { dg-error "error" }
+}
+
+void
+logical_and (void)
+{
+ a32 = b32 && c32; // { dg-error "error" }
+ a64 = b64 && c64; // { dg-error "error" }
+ a128 = b128 && c128; // { dg-error "error" }
+ a128 = b32 && c128; // { dg-error "error" }
+ a128 = b64 && c128; // { dg-error "error" }
+ a32 = 100 && c32; // { dg-error "error" }
+ a64 = 10 && c64; // { dg-error "error" }
+ a128 = 1000 && c128; // { dg-error "error" }
+ a32 = b32 && 7; // { dg-error "error" }
+ a64 = b64 && 5; // { dg-error "error" }
+ a128 = b128 && 3; // { dg-error "error" }
+}
+
+void
+logical_or (void)
+{
+ a32 = b32 || c32; // { dg-error "error" }
+ a64 = b64 || c64; // { dg-error "error" }
+ a128 = b128 || c128; // { dg-error "error" }
+ a128 = b32 || c128; // { dg-error "error" }
+ a128 = b64 || c128; // { dg-error "error" }
+ a32 = 100 || c32; // { dg-error "error" }
+ a64 = 10 || c64; // { dg-error "error" }
+ a128 = 1000 || c128; // { dg-error "error" }
+ a32 = b32 || 7; // { dg-error "error" }
+ a64 = b64 || 5; // { dg-error "error" }
+ a128 = b128 || 3; // { dg-error "error" }
+}
+
+void
+bitwise_complement (void)
+{
+ a32 = ~b32; // { dg-error "error" }
+ a64 = ~b64; // { dg-error "error" }
+ a128 = ~b128; // { dg-error "error" }
+}
+
+void
+logical_not (void)
+{
+ a32 = !b32; // { dg-error "error" }
+ a64 = !b64; // { dg-error "error" }
+ a128 = !b128; // { dg-error "error" }
+}
+
+// { dg-excess-errors "" { target *-*-* } }
diff --git a/libstdc++-v3/testsuite/decimal/unary-arith.cc b/libstdc++-v3/testsuite/decimal/unary-arith.cc
new file mode 100644
index 00000000000..d32b98d0d51
--- /dev/null
+++ b/libstdc++-v3/testsuite/decimal/unary-arith.cc
@@ -0,0 +1,93 @@
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.7 Unary arithmetic operators.
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+using namespace std::decimal;
+
+decimal32 a32 (20), b32 (-20);
+decimal64 a64 (124), b64 (-124);
+decimal128 a128 (5001), b128 (-5001);
+
+void
+unary_plus_32 (void)
+{
+ decimal32 a;
+
+ a = +a32; VERIFY (a == a32);
+ a = +b32; VERIFY (a == b32);
+}
+
+void
+unary_minus_32 (void)
+{
+ decimal32 a;
+
+ a = -a32; VERIFY (a == b32);
+ a = -b32; VERIFY (a == a32);
+}
+
+void
+unary_plus_64 (void)
+{
+ decimal64 a;
+
+ a = +a64; VERIFY (a == a64);
+ a = +b64; VERIFY (a == b64);
+}
+
+void
+unary_minus_64 (void)
+{
+ decimal64 a;
+
+ a = -a64; VERIFY (a == b64);
+ a = -b64; VERIFY (a == a64);
+}
+
+void
+unary_plus_128 (void)
+{
+ decimal128 a;
+
+ a = +a128; VERIFY (a == a128);
+ a = +b128; VERIFY (a == b128);
+}
+
+void
+unary_minus_128 (void)
+{
+ decimal128 a;
+
+ a = -a128; VERIFY (a == b128);
+ a = -b128; VERIFY (a == a128);
+}
+
+int main ()
+{
+ unary_plus_32 ();
+ unary_minus_32 ();
+ unary_plus_64 ();
+ unary_minus_64 ();
+ unary_plus_128 ();
+ unary_minus_128 ();
+}
diff --git a/libstdc++-v3/testsuite/ext/profile/mh.cc b/libstdc++-v3/testsuite/ext/profile/mh.cc
index dc910949867..44a667c0442 100644
--- a/libstdc++-v3/testsuite/ext/profile/mh.cc
+++ b/libstdc++-v3/testsuite/ext/profile/mh.cc
@@ -1,3 +1,6 @@
+// { dg-options "-D_GLIBCXX_PROFILE" }
+// { dg-do compile { target *-*-linux* } }
+
// -*- C++ -*-
// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
@@ -17,9 +20,6 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// { dg-options "-D_GLIBCXX_PROFILE" }
-// { dg-do compile }
-
#include <stdio.h>
#include <malloc.h>
#include <vector>
@@ -58,7 +58,8 @@ my_malloc_hook (size_t size, const void *caller)
}
-int main() {
+int main()
+{
int* test = (int*) malloc(sizeof(int));
*test = 1;
return *test;
diff --git a/libstdc++-v3/testsuite/ext/profile/mutex_extensions.cc b/libstdc++-v3/testsuite/ext/profile/mutex_extensions.cc
index c8bcf720e1d..5237107da1f 100644
--- a/libstdc++-v3/testsuite/ext/profile/mutex_extensions.cc
+++ b/libstdc++-v3/testsuite/ext/profile/mutex_extensions.cc
@@ -22,5 +22,5 @@
#include <vector>
-// { dg-error "Cannot use -D_GLIBCXX_PROFILE with " "" { target *-*-* } 166 }
+// { dg-error "Cannot use -D_GLIBCXX_PROFILE with " "" { target *-*-* } 165 }
// { dg-excess-errors "In file included from" }
diff --git a/libstdc++-v3/testsuite/lib/dg-options.exp b/libstdc++-v3/testsuite/lib/dg-options.exp
index 1d9af09a3a6..60e9b78fdba 100644
--- a/libstdc++-v3/testsuite/lib/dg-options.exp
+++ b/libstdc++-v3/testsuite/lib/dg-options.exp
@@ -80,15 +80,6 @@ proc dg-require-time { args } {
return
}
-proc dg-require-rvalref { args } {
- if { ![ check_v3_target_rvalref ] } {
- upvar dg-do-what dg-do-what
- set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
- return
- }
- return
-}
-
proc dg-require-cstdint { args } {
if { ![ check_v3_target_cstdint ] } {
upvar dg-do-what dg-do-what
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index 05a9b5db860..c71991afc90 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -805,61 +805,6 @@ proc check_v3_target_time { } {
return $et_time_saved
}
-proc check_v3_target_rvalref { } {
- global et_rvalref_saved
- global et_rvalref_target_name
- global tool
-
- if { ![info exists et_rvalref_target_name] } {
- set et_rvalref_target_name ""
- }
-
- # If the target has changed since we set the cached value, clear it.
- set current_target [current_target_name]
- if { $current_target != $et_rvalref_target_name } {
- verbose "check_v3_target_rvalref: `$et_rvalref_target_name'" 2
- set et_rvalref_target_name $current_target
- if [info exists et_rvalref_saved] {
- verbose "check_v3_target_rvalref: removing cached result" 2
- unset et_rvalref_saved
- }
- }
-
- if [info exists et_rvalref_saved] {
- verbose "check_v3_target_rvalref: using cached result" 2
- } else {
- set et_rvalref_saved 0
-
- # Set up and compile a C++ test program that tries to use
- # the library components of rval references
- set src rvalref[pid].cc
- set exe rvalref[pid].x
-
- set f [open $src "w"]
- puts $f "#include <iterator>"
- puts $f "#include <utility>"
- puts $f "using std::move;"
- puts $f "using std::identity;"
- puts $f "using std::forward;"
- puts $f "using std::move_iterator;"
- puts $f "using std::make_move_iterator;"
- close $f
-
- set lines [v3_target_compile $src $exe executable ""]
- file delete $src
-
- if [string match "" $lines] {
- # No error message, compilation succeeded.
- verbose "check_v3_target_rvalref: compilation succeeded" 2
- remote_file build delete $exe
- set et_rvalref_saved 1
- } else {
- verbose "check_v3_target_rvalref: compilation failed" 2
- }
- }
- return $et_rvalref_saved
-}
-
proc check_v3_target_namedlocale { } {
global et_namedlocale_saved
global et_namedlocale_target_name
diff --git a/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp b/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp
index fa3d087ddac..ae339496cda 100644
--- a/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp
+++ b/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp
@@ -58,6 +58,7 @@ if {[info exists tests_file] && [file exists $tests_file]} {
lappend subdirs "$srcdir/ext"
lappend subdirs "$srcdir/performance"
lappend subdirs "$srcdir/tr1"
+ lappend subdirs "$srcdir/decimal"
verbose "subdirs are $subdirs"
# Find all the tests.
diff --git a/lto-plugin/ChangeLog b/lto-plugin/ChangeLog
new file mode 100644
index 00000000000..27713cad3d9
--- /dev/null
+++ b/lto-plugin/ChangeLog
@@ -0,0 +1,433 @@
+2009-11-05 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-plugin.c (temp_obj_dir_name): Remove.
+ (arguments_file_name): New.
+ (free_2): Free arguments_file_name instead of temp_obj_dir_name.
+ (exec_lto_wrapper): Create arguments file with make_temp_file.
+ (cleanup_handler): Don't remove the temporary directory. Remove the
+ arguments file.
+ (onload): Don't create the temporary directory.
+
+2009-11-04 Richard Guenther <rguenther@suse.de>
+ Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-plugin.c (plugin_file_info): Remove temp field.
+ (cleanup_handler): Don't delete temporary objects.
+ (claim_file_handler): Don't create temporary objects.
+
+2009-11-04 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-plugin.c (cleanup_handler): Don't cleanup if debugging.
+
+2009-10-30 Rafael Avila de Espindola <espindola@google.com>
+
+ PR41871
+ * lto-plugin.c (claim_file_handler): Close files that we created.
+
+2009-10-28 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-plugin.c (all_symbols_read_handler): Use LDPL_FATAL instead of
+ LDPL_ERROR
+
+2009-10-27 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
+
+ PR lto/41652
+ * configure.ac: Call AC_SYS_LARGEFILE before AC_OUTPUT.
+ * configure: Regenerate.
+
+2009-10-26 Richard Guenther <rguenther@suse.de>
+
+ * configure.ac: Use AM_MAINTAINER_MODE.
+ * acinclude.m4: Remove.
+ * configure: Re-generate.
+ * Makefile.in: Likewise.
+ * aclocal.m4: Likewise.
+
+2009-10-19 Rafael Avila de Espindola <espindola@google.com>
+
+ PR40790
+ * configure: Regenerate.
+ * configure.ac: Add AC_TYPE_UINT64_T.
+
+2009-10-16 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-plugin.c (message): New variable.
+ (check): New function.
+ (parse_table_entry, translate, write_resolution,add_output_files,
+ exec_lto_wrapper,claim_file_handler, onload): Use check instead of
+ assert.
+ (cleanup_handler): Use check instead of assert. Remove the arguments
+ file if it exists.
+
+2009-10-15 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-plugin.c (resolution_file): New.
+ (free_1): Update comment.
+ (free_2): Free resolution_file.
+ (write_resolution): Write resolution to specified file. Use the
+ syms array from the symbol table.
+ (all_symbols_read_handler): Delay call to free_1 past call to
+ write_resolution.
+ (process_option): Add a -resolution option.
+
+2009-10-13 Richard Guenther <rguenther@suse.de>
+
+ * Makefile.am (liblto_plugin_la_LIBADD): Link against the
+ correct libiberty.
+ * Makefile.in: Regenerated.
+
+2009-10-08 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-plugin.c (add_input_library): New.
+ (all_symbols_read_handler): Use add_input_library for items that
+ start with -l.
+ (process_option): Fit in 80 columns.
+ (onload): Handle LDPT_ADD_INPUT_LIBRARY.
+
+2009-10-02 Diego Novillo <dnovillo@google.com>
+
+ * Makefile.am (AM_CPPFLAGS): Remove -D_LARGEFILE_SOURCE
+ and -D_FILE_OFFSET_BITS=64.
+ * configure.ac: Add AC_SYS_LARGEFILE.
+ * configure: Regenerate.
+ * Makefile.in: Regenerate.
+ * lto-plugin.c: Fix copyright boilerplate.
+
+2009-10-02 Diego Novillo <dnovillo@google.com>
+
+ * Makefile.am (ACLOCAL_AMFLAGS): Define.
+ * aclocal.m4: Regenerate with aclocal-2.64
+ * acinclude.m4: Remove.
+ * Makefile.in: Regenerate with automake-1.11
+ * configure.ac (AC_PREREQ): Update to 2.64.
+ * configure: Regenerate.
+
+2009-10-02 Diego Novillo <dnovillo@google.com>
+
+ * Makefile.am (AM_CPPFLAGS): Remove -D_LARGEFILE_SOURCE
+ and -D_FILE_OFFSET_BITS=64.
+ * configure.ac: Add AC_SYS_LARGEFILE.
+ * configure: Regenerate.
+ * Makefile.in: Regenerate.
+ * lto-plugin.c: Fix copyright boilerplate.
+
+2009-10-02 Diego Novillo <dnovillo@google.com>
+
+ * Makefile.am (ACLOCAL_AMFLAGS): Define.
+ * aclocal.m4: Regenerate with aclocal-2.64
+ * acinclude.m4: Remove.
+ * Makefile.in: Regenerate with automake-1.11
+ * configure.ac (AC_PREREQ): Update to 2.64.
+ * configure: Regenerate.
+
+2009-10-02 Rafael Avila de Espindola <espindola@google.com>
+
+ * Makefile.am (liblto_plugin_la_SOURCES): Remove
+ $(top_srcdir)/../gcc/lto/common.c
+ * Makefile.in: Regenerate.
+
+2009-10-01 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-plugin.c (pass_through_items): New.
+ (num_pass_through_items): New.
+ (all_symbols_read_handler): Update to use the -pass-through option.
+ (process_option): Replace -libgcc with -pass-through.
+
+2009-09-30 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-plugin.c (onload): Return a ld_plugin_status. Don't require
+ register_cleanup to be set.
+
+2009-09-30 Rafael Avila de Espindola <espindola@google.com>
+
+ * Makefile.am: Remove all reference to ltosymtab.
+ * Makefile.in: Regenerate.
+ * lto-symtab.c: Remove.
+
+2009-05-21 Diego Novillo <dnovillo@google.com>
+
+ * configure.ac: Remove call to AC_CHECK_GELF.
+ Call AC_ARG_VAR for LIBELFLIBS and LIBELFINC.
+ * acinclude.m4: Do not include ../config/libelf.m4
+ * Makefile.am (LIBELFLIBS): Define.
+ (LIBELFINC): Define.
+ (AM_CPPFLAGS): Add $(LIBELFINC).
+ (ltosymtab_LDADD): Add $(LIBELFLIBS).
+ (liblto_plugin_la_LIBADD): Add $(LIBELFLIBS)
+ * lto-plugin.c: Always include <gelf.h>
+ * lto-symtab.c: Likewise.
+ * configure: Regenerate.
+ * Makefile.in: Regenerate.
+
+2009-03-23 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-plugin.c (libgcc_filename): New.
+ (all_symbols_read_handler): Pass libgcc to the linker.
+ (all_symbols_read_handler): Parse -libgcc
+
+2009-02-05 Rafael Avila de Espindola <espindola@google.com>
+
+ * Makefile.am (liblto_plugin_la_LIBADD): Link with libiberty.
+ * Makefile.in: Regenerate.
+ * lto-plugin.c (add_output_files): Argument is now a FILE.
+ (exec_lto_wrapper): Use writeargv and pex.
+
+2009-02-04 Rafael Avila de Espindola <espindola@google.com>
+
+ Revert:
+ 2009-02-04 Rafael Avila de Espindola <espindola@google.com>
+ * lto-plugin.c (exec_lto_wrapper): Use writeargv.
+
+
+2009-02-04 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-plugin.c (exec_lto_wrapper): Use writeargv.
+
+2009-01-29 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-plugin.c: Include libiberty.h.
+ (exec_lto_wrapper, claim_file_handler): Use asprintf instead of
+ snprintf.
+
+2009-01-29 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-plugin.c (exec_lto_wrapper): Write argv to a file. Pass that
+ file to lto-wrapper.
+
+2009-01-28 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-plugin.c (plugin_file_info): Remove fd and elf.
+ (parse_table_entry): strdup entry->name and entry->comdat_key.
+ (free_1): Free name and comdat_key. Don't close the file. Don't call
+ elf_end.
+ (claim_file_handler): Always call elf_end.
+
+2008-12-23 Rafael Avila de Espindola <espindola@google.com>
+
+ * Makefile.am (AM_CPPFLAGS): Add -D_LARGEFILE_SOURCE
+ -D_FILE_OFFSET_BITS=64
+ * Makefile.in: Regenerate
+
+2008-12-22 Rafael Avila de Espindola <espindola@google.com>
+
+ * Makefile.am (gcc_version, target_noncanonical, libexecsubdir): New.
+ (lib_LTLIBRARIES): Rename to libexecsub_LTLIBRARIES.
+ * Makefile.in: Regenerate.
+ * acinclude.m4: Include ../config/acx.m4 and ../lt~obsolete.m4
+ * configure: Regenerate.
+ * configure.ac: Add AC_SUBST(target_noncanonical).
+
+2008-12-08 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-plugin.c: Include stdbool.h.
+ (debug, nop): Declare as bool.
+
+2008-12-08 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-plugin.c (nop): New.
+ (use_original_files): New.
+ (all_symbols_read_handler): Call use_original_files if nop is true.
+ (process_option): Parse the -nop option.
+
+2008-12-08 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-plugin.c (debug): New.
+ (exec_lto_wrapper): Print argv if debug is true.
+ (process_option): Process the -debug command line option.
+
+2008-12-03 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-plugin.c (process_option): The argument is now a single option,
+ not a space separated list.
+
+2008-12-02 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-plugin.c: Include sys/types.h and sys/wait.h
+ (output_files, num_output_files, lto_wrapper_argv,
+ lto_wrapper_num_args): New.
+ (free_2): Free output_files.
+ (write_resolution): Disable.
+ (add_output_files): New.
+ (exec_lto_wrapper): New.
+ (all_symbols_read_handler): Run lto-wrapper.
+ (claim_file_handler): Free lto_file.name and call elf_end.
+ (process_option): New.
+
+2008-11-26 Rafael Espindola <espindola@google.com>
+
+ * lto-plugin.c (add_input_file): New.
+ (get_section): Return NULL if get_section fails.
+ (write_resolution): New.
+ (all_symbols_read_handler): Call add_input_file.
+ (claim_file_handler): Unlink the correct file.
+ (onload): Record add_input_file.
+
+2008-09-23 Rafael Espindola <espindola@google.com>
+
+ * Makefile.am (ltosymtab_SOURCES, liblto_plugin_la_SOURCES):
+ Update the location of common.c.
+ * Makefile.in: Regenerate.
+ * common.c: Moved to gcc/lto.
+ * common.h: Moved to gcc/lto.
+ * lto-plugin.c: Update the location of common.h.
+ * lto-symtab.c: Update the location of common.h.
+
+2008-09-23 Rafael Espindola <espindola@google.com>
+
+ * common.c: Include common.h.
+ (lto_kind_str, lto_visibility_str, lto_resolution_str): Use explicit
+ sizes.
+ * common.h (lto_kind_str, lto_visibility_str, lto_resolution_str): Use
+ explicit sizes.
+
+2008-09-23 Rafael Espindola <espindola@google.com>
+
+ * lto-plugin.c (plugin_file_info): Add temp.
+ (cleanup_handler): Only delete temporary files.
+ (claim_file_handler): Initialize lto_file.temp.
+
+2008-09-23 Rafael Espindola <espindola@google.com>
+
+ * plugin-api.h: Moved to include.
+
+2008-09-23 Rafael Espindola <espindola@google.com>
+
+ * lto-plugin.c (all_symbols_read_handler): Print resolution in a new
+ format.
+
+2008-09-22 Rafael Espindola <espindola@google.com>
+
+ * plugin-api.h: Copy from binutils' cvs.
+
+2008-09-22 Rafael Espindola <espindola@google.com>
+
+ * lto-symtab.c (get_symbols, add_symbols): Update signature.
+ * plugin-api.h: Copy from binutils' cvs.
+
+2008-09-22 Rafael Espindola <espindola@google.com>
+
+ * common.h (lto_kind_str, lto_visibility_str, lto_resolution_str):
+ Make extern
+
+2008-09-10 Rafael Espindola <espindola@google.com>
+
+ * lto-plugin.c (onload): add missing break statements and asserts.
+ * lto-symtab.c (claim_file_handler): Make it static.
+ (all_symbols_read_handler): Make it static.
+ (all_file_handles): Make it static.
+ (num_file_handles): Make it static.
+ (register_claim_file): Make it static.
+ (register_object): Indent properly.
+
+2008-09-10 Rafael Avila de Espindola <espindola@google.com>
+
+ * Makefile.am (ltosymtab_LDADD): Add -lelf.
+ * Makefiel.in: Regenerate.
+ * lto-plugin.c: Include ar.h.
+ (claim_file_handler): Handle file->offset != 0.
+ * lto-symtab.c: Include gelf.h.
+ (all_file_handles): Change type.
+ (register_object): New.
+ (register_file): Add support for archives.
+ (resolve): Update to new type of all_file_handles.
+ (print): Update to new type of all_file_handles.
+ (free_all): Update to new type of all_file_handles.
+ (main): Update to new type of all_file_handles.
+
+2008-09-10 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-plugin.c (get_string_table): Remove.
+ (get_section): Use elf_strptr instead of get_string_table.
+
+2008-09-08 Doug Kwan <dougkwan@google.com>
+
+ * lto-plugin.c (all_symbols_read_handler): Widen fprintf arguments
+ to 64-bit to fix a 32-bit bootstrap failure due to format warnings.
+
+2008-09-08 Rafael Avila de Espindola <espindola@google.com>
+
+ * Makefile.am (ltosymtab_SOURCES): add common.c.
+ (ltosymtab_CFLAGS): New.
+ (liblto_plugin_la_SOURCES): Add common.c.
+ * Makefile.in: Regenerate.
+ * common.c: New.
+ * common.h: New.
+ * lto-plugin.c: Include stdio.h, inttypes.h and common.h.
+ (plugin_symtab): New.
+ (plugin_file_info): New.
+ (register_all_symbols_read): New.
+ (get_symbols): New.
+ (claimed_files): New.
+ (num_claimed_files): New.
+ (translate): Don't drop the slot number.
+ (free_1): New.
+ (free_2): New.
+ (all_symbols_read_handler): New.
+ (claim_file_handler): Record every claimed file.
+ (onload): Handle LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK and
+ LDPT_GET_SYMBOLS.
+ * lto-symtab.c: Include stdlib.h, string.h and common.h.
+ (current_file_handle): Remove.
+ (ld_plugin_all_symbols_read_handler): New.
+ (plugin_handle): New.
+ (file_handle): New.
+ (all_file_handles): New.
+ (num_file_handles): New.
+ (get_symbols): New.
+ (register_all_symbols_read): New.
+ (add_symbols): Don't print the symbols, just record them.
+ (ld_plugin_tv): Add LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK and
+ LDPT_GET_SYMBOLS.
+ (load_plugin): Use plugin_handle.
+ (register_file): Add the file handle to all_file_handles.
+ (resolve): New.
+ (print): New.
+ (unload_plugin): New.
+ (free_all): New.
+ (main): Call all_symbols_read_handler and free resources.
+
+2008-09-03 Rafael Avila de Espindola <espindola@google.com>
+
+ * Makefile.am (AM_CFLAGS): New.
+ (ltosymtab_LDADD): Remove -lelf. Add -ldl.
+ (lib_LTLIBRARIES): New.
+ (liblto_plugin_la_SOURCES): New.
+ (liblto_plugin_la_LIBADD): New.
+ * Makefile.in: Regenerate.
+ * acinclude.m4: Don't include ../config/acx.m4 and
+ ../config/no-executables.m4.
+ Include ../ltsugar.m4, ../ltoptions.m4, ../ltversion.m4 and
+ ../libtool.m4.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+ * configure.ac: Use AM_PROG_LIBTOOL.
+ * lto-plugin.c: New.
+ * lto-symtab.c: Rewrite to use the plugin.
+ * plugin-api.h: New.
+
+2008-08-25 Rafael Avila de Espindola <espindola@google.com>
+
+ * configure: Regenerate.
+ * configure.ac: Use AC_CHECK_GELF.
+ * lto-symtab.c: Include gelf.h.
+ (get_string_table): Use size independent API.
+ (printTable): Use lld to print 64 bit integers.
+
+2008-08-22 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-symtab.c (parse_table_entry): Assert entry->kind and
+ entry->visibility are valid.
+
+2008-07-22 Rafael Avila de Espindola <espindola@google.com>
+ * lto-symtab.c (table_entry): Add comdat.
+ (parse_table_entry): Read comdat.
+
+2008-08-21 Rafael Espindola <espindola@google.com>
+
+ * Makefile.am: New.
+ * Makefile.in: New.
+ * acinclude.m4: New.
+ * aclocal.m4: New.
+ * configure: New.
+ * configure.ac: New.
+ * lto-symtab.c: New.
diff --git a/lto-plugin/Makefile.am b/lto-plugin/Makefile.am
new file mode 100644
index 00000000000..19fbdcd8ef5
--- /dev/null
+++ b/lto-plugin/Makefile.am
@@ -0,0 +1,19 @@
+# Makefile.am is used by automake 1.11 to generate Makefile.in.
+
+ACLOCAL_AMFLAGS = -I .. -I ../config
+
+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+target_noncanonical := @target_noncanonical@
+libexecsubdir := $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
+
+# How to find libelf
+LIBELFLIBS = @LIBELFLIBS@
+LIBELFINC = @LIBELFINC@
+
+AM_CPPFLAGS = -I$(top_srcdir)/../include $(LIBELFINC)
+AM_CFLAGS = -Wall -Werror
+
+libexecsub_LTLIBRARIES = liblto_plugin.la
+
+liblto_plugin_la_SOURCES = lto-plugin.c
+liblto_plugin_la_LIBADD = $(LIBELFLIBS) ../libiberty/pic/libiberty.a
diff --git a/lto-plugin/Makefile.in b/lto-plugin/Makefile.in
new file mode 100644
index 00000000000..804d441caee
--- /dev/null
+++ b/lto-plugin/Makefile.in
@@ -0,0 +1,682 @@
+# Makefile.in generated by automake 1.11 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Makefile.am is used by automake 1.11 to generate Makefile.in.
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = .
+DIST_COMMON = $(am__configure_deps) $(srcdir)/../config.guess \
+ $(srcdir)/../config.sub $(srcdir)/../depcomp \
+ $(srcdir)/../install-sh $(srcdir)/../ltmain.sh \
+ $(srcdir)/../missing $(srcdir)/../mkinstalldirs \
+ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(top_srcdir)/configure ChangeLog
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
+ $(top_srcdir)/../config/depstand.m4 \
+ $(top_srcdir)/../config/lead-dot.m4 \
+ $(top_srcdir)/../config/override.m4 \
+ $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \
+ $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
+ $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(libexecsubdir)"
+LTLIBRARIES = $(libexecsub_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+liblto_plugin_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ ../libiberty/pic/libiberty.a
+am_liblto_plugin_la_OBJECTS = lto-plugin.lo
+liblto_plugin_la_OBJECTS = $(am_liblto_plugin_la_OBJECTS)
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/../depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(liblto_plugin_la_SOURCES)
+DIST_SOURCES = $(liblto_plugin_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ { test ! -d "$(distdir)" \
+ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr "$(distdir)"; }; }
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBELFINC = @LIBELFINC@
+
+# How to find libelf
+LIBELFLIBS = @LIBELFLIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_libsubdir = @build_libsubdir@
+build_os = @build_os@
+build_subdir = @build_subdir@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_subdir = @host_subdir@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+target_noncanonical := @target_noncanonical@
+target_subdir = @target_subdir@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+ACLOCAL_AMFLAGS = -I .. -I ../config
+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+libexecsubdir := $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
+AM_CPPFLAGS = -I$(top_srcdir)/../include $(LIBELFINC)
+AM_CFLAGS = -Wall -Werror
+libexecsub_LTLIBRARIES = liblto_plugin.la
+liblto_plugin_la_SOURCES = lto-plugin.c
+liblto_plugin_la_LIBADD = $(LIBELFLIBS) ../libiberty/pic/libiberty.a
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+am--refresh:
+ @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+install-libexecsubLTLIBRARIES: $(libexecsub_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(libexecsubdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecsubdir)"
+ @list='$(libexecsub_LTLIBRARIES)'; test -n "$(libexecsubdir)" || list=; \
+ list2=; for p in $$list; do \
+ if test -f $$p; then \
+ list2="$$list2 $$p"; \
+ else :; fi; \
+ done; \
+ test -z "$$list2" || { \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libexecsubdir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libexecsubdir)"; \
+ }
+
+uninstall-libexecsubLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libexecsub_LTLIBRARIES)'; test -n "$(libexecsubdir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libexecsubdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libexecsubdir)/$$f"; \
+ done
+
+clean-libexecsubLTLIBRARIES:
+ -test -z "$(libexecsub_LTLIBRARIES)" || rm -f $(libexecsub_LTLIBRARIES)
+ @list='$(libexecsub_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+liblto_plugin.la: $(liblto_plugin_la_OBJECTS) $(liblto_plugin_la_DEPENDENCIES)
+ $(LINK) -rpath $(libexecsubdir) $(liblto_plugin_la_OBJECTS) $(liblto_plugin_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lto-plugin.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool config.lt
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ test -d "$(distdir)" || mkdir "$(distdir)"
+ @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
+ -test -n "$(am__skip_mode_fix)" \
+ || find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-lzma: distdir
+ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+ $(am__remove_distdir)
+
+dist-xz: distdir
+ tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+ $(am__remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lzma*) \
+ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+ *.tar.xz*) \
+ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ test -d $(distdir)/_build || exit 0; \
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && am__cwd=`pwd` \
+ && $(am__cd) $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+ && cd "$$am__cwd" \
+ || exit 1
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @$(am__cd) '$(distuninstallcheck_dir)' \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+ for dir in "$(DESTDIR)$(libexecsubdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libexecsubLTLIBRARIES clean-libtool \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-libexecsubLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libexecsubLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
+ clean-generic clean-libexecsubLTLIBRARIES clean-libtool ctags \
+ dist dist-all dist-bzip2 dist-gzip dist-lzma dist-shar \
+ dist-tarZ dist-xz dist-zip distcheck distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distcleancheck distdir distuninstallcheck 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-libexecsubLTLIBRARIES \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am uninstall-libexecsubLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/lto-plugin/aclocal.m4 b/lto-plugin/aclocal.m4
new file mode 100644
index 00000000000..8b9d65bf21e
--- /dev/null
+++ b/lto-plugin/aclocal.m4
@@ -0,0 +1,979 @@
+# generated automatically by aclocal 1.11 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.64],,
+[m4_warning([this file was generated for autoconf 2.64.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.11], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 10
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], UPC, [depcc="$UPC" am_compiler_list=],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ am__universal=false
+ m4_case([$1], [CC],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac],
+ [CXX],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac])
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+ # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 16
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.62])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES(OBJC)],
+ [define([AC_PROG_OBJC],
+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+ [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+AC_SUBST(install_sh)])
+
+# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless `enable' is passed literally.
+# For symmetry, `disable' may be passed as well. Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+ [enable], [m4_define([am_maintainer_other], [disable])],
+ [disable], [m4_define([am_maintainer_other], [enable])],
+ [m4_define([am_maintainer_other], [enable])
+ m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
+ dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+ AC_ARG_ENABLE([maintainer-mode],
+[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],
+ [USE_MAINTAINER_MODE=$enableval],
+ [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST([MAINT])dnl
+]
+)
+
+AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+ [[\\/$]]* | ?:[[\\/]]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[[\\\"\#\$\&\'\`$am_lf]]*)
+ AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+ *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
+ AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([../config/acx.m4])
+m4_include([../config/depstand.m4])
+m4_include([../config/lead-dot.m4])
+m4_include([../config/override.m4])
+m4_include([../libtool.m4])
+m4_include([../ltoptions.m4])
+m4_include([../ltsugar.m4])
+m4_include([../ltversion.m4])
+m4_include([../lt~obsolete.m4])
diff --git a/lto-plugin/configure b/lto-plugin/configure
new file mode 100755
index 00000000000..1265e10c4f9
--- /dev/null
+++ b/lto-plugin/configure
@@ -0,0 +1,12814 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.64 for LTO plugin for ld 0.1.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
+# Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ # We cannot yet assume a decent shell, so we have to provide a
+ # neutralization value for shells without unset; and this also
+ # works around shells that cannot unset nonexistent variables.
+ BASH_ENV=/dev/null
+ ENV=/dev/null
+ (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with status $?, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$?; test $as_status -eq 0 && as_status=1
+ if test "$3"; then
+ as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+ fi
+ $as_echo "$as_me: error: $1" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in #(
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$lt_ECHO in
+X*--fallback-echo)
+ # Remove one level of quotation (which was required for Make).
+ ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','`
+ ;;
+esac
+
+ECHO=${lt_ECHO-echo}
+if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X$1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $ECHO works!
+ :
+else
+ # Restart under the correct shell.
+ exec $SHELL "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<_LT_EOF
+$*
+_LT_EOF
+ exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test -z "$lt_ECHO"; then
+ if test "X${echo_test_string+set}" != Xset; then
+ # find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
+ { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
+ then
+ break
+ fi
+ done
+ fi
+
+ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+ else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ ECHO="$dir/echo"
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ if test "X$ECHO" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ ECHO='print -r'
+ elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
+ else
+ # Try using printf.
+ ECHO='printf %s\n'
+ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ ECHO="$CONFIG_SHELL $0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ ECHO="$CONFIG_SHELL $0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
+
+ for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
+ if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
+
+ if test "$prev" != 'sed 50q "$0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ ECHO=echo
+ fi
+ fi
+ fi
+ fi
+ fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+lt_ECHO=$ECHO
+if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+ lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+fi
+
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='LTO plugin for ld'
+PACKAGE_TARNAME='lto-plugin'
+PACKAGE_VERSION='0.1'
+PACKAGE_STRING='LTO plugin for ld 0.1'
+PACKAGE_BUGREPORT=''
+PACKAGE_URL=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+target_noncanonical
+CPP
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+lt_ECHO
+RANLIB
+AR
+OBJDUMP
+LN_S
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+EGREP
+GREP
+SED
+host_os
+host_vendor
+host_cpu
+host
+LIBTOOL
+LIBELFINC
+LIBELFLIBS
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_subdir
+host_subdir
+build_subdir
+build_libsubdir
+build_os
+build_vendor
+build_cpu
+build
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+with_build_libsubdir
+enable_maintainer_mode
+enable_dependency_tracking
+enable_largefile
+enable_shared
+enable_static
+with_pic
+enable_fast_install
+with_gnu_ld
+enable_libtool_lock
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+LIBELFLIBS
+LIBELFINC
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) as_fn_error "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information."
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures LTO plugin for ld 0.1 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/lto-plugin]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of LTO plugin for ld 0.1:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer
+ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors
+ --disable-largefile omit support for large files
+ --enable-shared[=PKGS] build shared libraries [default=yes]
+ --enable-static[=PKGS] build static libraries [default=yes]
+ --enable-fast-install[=PKGS]
+ optimize for fast installation [default=yes]
+ --disable-libtool-lock avoid locking (might break parallel builds)
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-build-libsubdir=DIR Directory where to find libraries for build system
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ LIBELFLIBS How to link libelf
+ LIBELFINC How to find libelf include files
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to the package provider.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+LTO plugin for ld configure 0.1
+generated by GNU Autoconf 2.64
+
+Copyright (C) 2009 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ return $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ return $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ return $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ return $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_func
+
+# ac_fn_c_find_uintX_t LINENO BITS VAR
+# ------------------------------------
+# Finds an unsigned integer type with width BITS, setting cache variable VAR
+# accordingly.
+ac_fn_c_find_uintX_t ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5
+$as_echo_n "checking for uint$2_t... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \
+ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(($ac_type) -1 >> ($2 - 1) == 1)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ case $ac_type in #(
+ uint$2_t) :
+ eval "$3=yes" ;; #(
+ *) :
+ eval "$3=\$ac_type" ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ eval as_val=\$$3
+ if test "x$as_val" = x""no; then :
+
+else
+ break
+fi
+ done
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_find_uintX_t
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by LTO plugin for ld $as_me 0.1, which was
+generated by GNU Autoconf 2.64. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+ for ac_t in install-sh install.sh shtool; do
+ if test -f "$ac_dir/$ac_t"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/$ac_t -c"
+ break 2
+ fi
+ done
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+ case ${build_alias} in
+ "") build_noncanonical=${build} ;;
+ *) build_noncanonical=${build_alias} ;;
+esac
+
+ case ${host_alias} in
+ "") host_noncanonical=${build_noncanonical} ;;
+ *) host_noncanonical=${host_alias} ;;
+esac
+
+ case ${target_alias} in
+ "") target_noncanonical=${host_noncanonical} ;;
+ *) target_noncanonical=${target_alias} ;;
+esac
+
+
+# post-stage1 host modules use a different CC_FOR_BUILD so, in order to
+# have matching libraries, they should use host libraries: Makefile.tpl
+# arranges to pass --with-build-libsubdir=$(HOST_SUBDIR).
+# However, they still use the build modules, because the corresponding
+# host modules (e.g. bison) are only built for the host when bootstrap
+# finishes. So:
+# - build_subdir is where we find build modules, and never changes.
+# - build_libsubdir is where we find build libraries, and can be overridden.
+
+# Prefix 'build-' so this never conflicts with target_subdir.
+build_subdir="build-${build_noncanonical}"
+
+# Check whether --with-build-libsubdir was given.
+if test "${with_build_libsubdir+set}" = set; then :
+ withval=$with_build_libsubdir; build_libsubdir="$withval"
+else
+ build_libsubdir="$build_subdir"
+fi
+
+# --srcdir=. covers the toplevel, while "test -d" covers the subdirectories
+if ( test $srcdir = . && test -d gcc ) \
+ || test -d $srcdir/../host-${host_noncanonical}; then
+ host_subdir="host-${host_noncanonical}"
+else
+ host_subdir=.
+fi
+# No prefix.
+target_subdir=${target_noncanonical}
+
+am__api_version='1.11'
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+ ./ | .// | /[cC]/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+ done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[\\\"\#\$\&\'\`$am_lf]*)
+ as_fn_error "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+ *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ as_fn_error "ls -t appears to fail. Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+ fi
+
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ as_fn_error "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if test "${ac_cv_path_mkdir+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+ done
+IFS=$as_save_IFS
+
+fi
+
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ test -d ./--version && rmdir ./--version
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+ [\\/$]* | ?:[\\/]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='lto-plugin'
+ VERSION='0.1'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+ # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then :
+ enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "no acceptable C compiler found in \$PATH
+See \`config.log' for more details." "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ rm -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out conftest.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+if test -z "$ac_file"; then :
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "C compiler cannot create executables
+See \`config.log' for more details." "$LINENO" 5; }; }
+fi
+ac_exeext=$ac_cv_exeext
+
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out conftest.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." "$LINENO" 5; }
+fi
+rm -f conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+
+# Check whether --enable-largefile was given.
+if test "${enable_largefile+set}" = set; then :
+ enableval=$enable_largefile;
+fi
+
+if test "$enable_largefile" != no; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
+if test "${ac_cv_sys_largefile_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_sys_largefile_CC=no
+ if test "$GCC" != yes; then
+ ac_save_CC=$CC
+ while :; do
+ # IRIX 6.2 and later do not support large files by default,
+ # so use the C compiler's -n32 option if that helps.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ if ac_fn_c_try_compile "$LINENO"; then :
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext
+ CC="$CC -n32"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_largefile_CC=' -n32'; break
+fi
+rm -f core conftest.err conftest.$ac_objext
+ break
+ done
+ CC=$ac_save_CC
+ rm -f conftest.$ac_ext
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
+$as_echo "$ac_cv_sys_largefile_CC" >&6; }
+ if test "$ac_cv_sys_largefile_CC" != no; then
+ CC=$CC$ac_cv_sys_largefile_CC
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
+if test "${ac_cv_sys_file_offset_bits+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_file_offset_bits=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_file_offset_bits=64; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_file_offset_bits=unknown
+ break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+;;
+esac
+rm -rf conftest*
+ if test $ac_cv_sys_file_offset_bits = unknown; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
+if test "${ac_cv_sys_large_files+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_large_files=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_large_files=1; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_large_files=unknown
+ break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
+$as_echo "$ac_cv_sys_large_files" >&6; }
+case $ac_cv_sys_large_files in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+;;
+esac
+rm -rf conftest*
+ fi
+fi
+
+
+
+case `pwd` in
+ *\ * | *\ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.2.6'
+macro_revision='1.3012'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if test "${ac_cv_path_SED+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ { ac_script=; unset ac_script;}
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_SED_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_SED"; then
+ as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5
+ fi
+else
+ ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if test "${ac_cv_path_FGREP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+ then ac_cv_path_FGREP="$GREP -F"
+ else
+ if test -z "$FGREP"; then
+ ac_path_FGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in fgrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+ # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'FGREP' >> "conftest.nl"
+ "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_FGREP="$ac_path_FGREP"
+ ac_path_FGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_FGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_FGREP"; then
+ as_fn_error "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_FGREP=$FGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if test "${lt_cv_path_LD+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if test "${lt_cv_path_NM+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in "dumpbin -symbols" "link -dump -symbols"
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DUMPBIN+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DUMPBIN"; then
+ ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$DUMPBIN" && break
+ done
+fi
+if test -z "$DUMPBIN"; then
+ ac_ct_DUMPBIN=$DUMPBIN
+ for ac_prog in "dumpbin -symbols" "link -dump -symbols"
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DUMPBIN"; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_DUMPBIN" && break
+done
+
+ if test "x$ac_ct_DUMPBIN" = x; then
+ DUMPBIN=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DUMPBIN=$ac_ct_DUMPBIN
+ fi
+fi
+
+
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if test "${lt_cv_nm_interface+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:4683: $ac_compile\"" >&5)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:4686: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:4689: output\"" >&5)
+ cat conftest.out >&5
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
+ = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
+
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if test "${lt_cv_ld_reload_flag+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OBJDUMP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OBJDUMP"; then
+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+ ac_ct_OBJDUMP=$OBJDUMP
+ # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OBJDUMP"; then
+ ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OBJDUMP="objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OBJDUMP" = x; then
+ OBJDUMP="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OBJDUMP=$ac_ct_OBJDUMP
+ fi
+else
+ OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if test "${lt_cv_deplibs_check_method+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[45]*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ if ( file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[3-9]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AR+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AR="${ac_tool_prefix}ar"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+ ac_ct_AR=$AR
+ # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_AR="ar"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+else
+ AR="$ac_cv_prog_AR"
+fi
+
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[BCDT]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[ABCDGISTW]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[ABCDEGRST]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[BCDEGRST]'
+ ;;
+osf*)
+ symcode='[BCDEGQRST]'
+ ;;
+solaris*)
+ symcode='[BDRT]'
+ ;;
+sco3.2v5*)
+ symcode='[DT]'
+ ;;
+sysv4.2uw2*)
+ symcode='[DT]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[ABDT]'
+ ;;
+sysv4)
+ symcode='[DFNSTU]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK '"\
+" {last_section=section; section=\$ 3};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5
+ (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_save_LIBS="$LIBS"
+ lt_save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS="$lt_save_LIBS"
+ CFLAGS="$lt_save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&5
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+ fi
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then :
+ enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line 5894 "configure"' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if test "${lt_cv_cc_needs_belf+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_cc_needs_belf=yes
+else
+ lt_cv_cc_needs_belf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+
+
+ case $host_os in
+ rhapsody* | darwin*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DSYMUTIL+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DSYMUTIL"; then
+ ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+ ac_ct_DSYMUTIL=$DSYMUTIL
+ # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DSYMUTIL"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DSYMUTIL" = x; then
+ DSYMUTIL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DSYMUTIL=$ac_ct_DSYMUTIL
+ fi
+else
+ DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_NMEDIT+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NMEDIT"; then
+ ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+ ac_ct_NMEDIT=$NMEDIT
+ # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_NMEDIT"; then
+ ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_NMEDIT="nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_NMEDIT" = x; then
+ NMEDIT=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ NMEDIT=$ac_ct_NMEDIT
+ fi
+else
+ NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_LIPO+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$LIPO"; then
+ ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+ ac_ct_LIPO=$LIPO
+ # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_LIPO"; then
+ ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_LIPO="lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_LIPO" = x; then
+ LIPO=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ LIPO=$ac_ct_LIPO
+ fi
+else
+ LIPO="$ac_cv_prog_LIPO"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OTOOL+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL"; then
+ ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+ ac_ct_OTOOL=$OTOOL
+ # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL"; then
+ ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OTOOL="otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL" = x; then
+ OTOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL=$ac_ct_OTOOL
+ fi
+else
+ OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OTOOL64+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL64"; then
+ ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+ ac_ct_OTOOL64=$OTOOL64
+ # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL64"; then
+ ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OTOOL64="otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL64" = x; then
+ OTOOL64=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL64=$ac_ct_OTOOL64
+ fi
+else
+ OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if test "${lt_cv_apple_cc_single_mod+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if test "${lt_cv_ld_exported_symbols_list+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_ld_exported_symbols_list=yes
+else
+ lt_cv_ld_exported_symbols_list=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+ case $host_os in
+ rhapsody* | darwin1.[012])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[012]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+eval as_val=\$$as_ac_Header
+ if test "x$as_val" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in dlfcn.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+# Set options
+
+
+
+ enable_dlopen=no
+
+
+ enable_win32_dll=no
+
+
+ # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+ enableval=$enable_shared; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_shared=yes
+fi
+
+
+
+
+
+
+
+
+
+ # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+ enableval=$enable_static; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_static=yes
+fi
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+ withval=$with_pic; pic_mode="$withval"
+else
+ pic_mode=default
+fi
+
+
+test -z "$pic_mode" && pic_mode=default
+
+
+
+
+
+
+
+ # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+ enableval=$enable_fast_install; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if test "${lt_cv_objdir+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/${ac_tool_prefix}file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ else
+ MAGIC_CMD=:
+ fi
+fi
+
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+ lt_prog_compiler_no_builtin_flag=' -fno-builtin'
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-fno-rtti -fno-exceptions"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:7424: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:7428: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_rtti_exceptions=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+ lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+ :
+fi
+
+fi
+
+
+
+
+
+
+ lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_static='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ else
+ lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+ xl*)
+ # IBM XL C 8.0/Fortran 10.1 on PPC
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-qpic'
+ lt_prog_compiler_static='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl=''
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ rdos*)
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl='-Qoption ld '
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic='-Kconform_pic'
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_can_build_shared=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic='-pic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+$as_echo "$lt_prog_compiler_pic" >&6; }
+
+
+
+
+
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if test "${lt_cv_prog_compiler_pic_works+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:7763: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:7767: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+ case $lt_prog_compiler_pic in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+ esac
+else
+ lt_prog_compiler_pic=
+ lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if test "${lt_cv_prog_compiler_static_works+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+ :
+else
+ lt_prog_compiler_static=
+fi
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:7868: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:7872: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:7923: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:7927: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ runpath_var=
+ allow_undefined_flag=
+ always_export_symbols=no
+ archive_cmds=
+ archive_expsym_cmds=
+ compiler_needs_object=no
+ enable_shared_with_static_runtimes=no
+ export_dynamic_flag_spec=
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ hardcode_automatic=no
+ hardcode_direct=no
+ hardcode_direct_absolute=no
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld=
+ hardcode_libdir_separator=
+ hardcode_minus_L=no
+ hardcode_shlibpath_var=unsupported
+ inherit_rpath=no
+ link_all_deplibs=unknown
+ module_cmds=
+ module_expsym_cmds=
+ old_archive_from_new_cmds=
+ old_archive_from_expsyms_cmds=
+ thread_safe_flag_spec=
+ whole_archive_flag_spec=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ whole_archive_flag_spec=
+ tmp_sharedflag='--shared' ;;
+ xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld='-rpath $libdir'
+ archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs" = no; then
+ runpath_var=
+ hardcode_libdir_flag_spec=
+ export_dynamic_flag_spec=
+ whole_archive_flag_spec=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds=''
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ file_list_spec='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ export_dynamic_flag_spec='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag="-z nodefs"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag=' ${wl}-bernotok'
+ allow_undefined_flag=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec='$convenience'
+ archive_cmds_need_lc=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[45]*)
+ export_dynamic_flag_spec=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_from_new_cmds='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path='`cygpath -w "$srcfile"`'
+ enable_shared_with_static_runtimes=yes
+ ;;
+
+ darwin* | rhapsody*)
+
+
+ archive_cmds_need_lc=no
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ whole_archive_flag_spec=''
+ link_all_deplibs=yes
+ allow_undefined_flag="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=echo
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+ else
+ ld_shlibs=no
+ fi
+
+ ;;
+
+ dgux*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ export_dynamic_flag_spec='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld='+b $libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ ;;
+ *)
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int foo(void) {}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ inherit_rpath=yes
+ link_all_deplibs=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ newsos6)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_shlibpath_var=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ hardcode_direct_absolute=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_separator=:
+ ;;
+
+ solaris*)
+ no_undefined_flag=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_shlibpath_var=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ link_all_deplibs=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds='$CC -r -o $output$reload_objs'
+ hardcode_direct=no
+ ;;
+ motorola)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ export_dynamic_flag_spec='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag='${wl}-z,text'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag='${wl}-z,text'
+ allow_undefined_flag='${wl}-z,nodefs'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-R,$libdir'
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ export_dynamic_flag_spec='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if test "${lt_cv_archive_cmds_need_lc+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl
+ pic_flag=$lt_prog_compiler_pic
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag
+ allow_undefined_flag=
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+ (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ then
+ lt_cv_archive_cmds_need_lc=no
+ else
+ lt_cv_archive_cmds_need_lc=yes
+ fi
+ allow_undefined_flag=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+ archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[lt_foo]++; }
+ if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+ sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[123]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+interix[3-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+ lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+fi
+
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+ test -n "$runpath_var" ||
+ test "X$hardcode_automatic" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$hardcode_direct" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
+ test "$hardcode_minus_L" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink ||
+ test "$inherit_rpath" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+
+
+
+
+ if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+
+fi
+
+ ;;
+
+ *)
+ ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = x""yes; then :
+ lt_cv_dlopen="shl_load"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_shl_load=yes
+else
+ ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = x""yes; then :
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+ ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = x""yes; then :
+ lt_cv_dlopen="dlopen"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_svld_dlopen=yes
+else
+ ac_cv_lib_svld_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = x""yes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_dld_link=yes
+else
+ ac_cv_lib_dld_dld_link=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = x""yes; then :
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line 10305 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line 10401 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+ # Report which library types will actually be built
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+
+ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t"
+case $ac_cv_c_uint64_t in #(
+ no|yes) ;; #(
+ *)
+
+$as_echo "#define _UINT64_T 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint64_t $ac_cv_c_uint64_t
+_ACEOF
+;;
+ esac
+
+ac_config_files="$ac_config_files Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ test "x$cache_file" != "x/dev/null" &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ cat confcache >$cache_file
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then branch to the quote section. Otherwise,
+# look for a macro that doesn't take arguments.
+ac_script='
+:mline
+/\\$/{
+ N
+ s,\\\n,,
+ b mline
+}
+t clear
+:clear
+s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
+t quote
+s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
+t quote
+b any
+:quote
+s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
+s/\[/\\&/g
+s/\]/\\&/g
+s/\$/$$/g
+H
+:any
+${
+ g
+ s/^\n//
+ s/\n/ /g
+ p
+}
+'
+DEFS=`sed -n "$ac_script" confdefs.h`
+
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+ am__EXEEXT_TRUE=
+ am__EXEEXT_FALSE='#'
+else
+ am__EXEEXT_TRUE='#'
+ am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ as_fn_error "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ as_fn_error "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ as_fn_error "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with status $?, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$?; test $as_status -eq 0 && as_status=1
+ if test "$3"; then
+ as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+ fi
+ $as_echo "$as_me: error: $1" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in #(
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by LTO plugin for ld $as_me 0.1, which was
+generated by GNU Autoconf 2.64. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+
+Configuration files:
+$config_files
+
+Configuration commands:
+$config_commands
+
+Report bugs to the package provider."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_version="\\
+LTO plugin for ld config.status 0.1
+configured by $0, generated by GNU Autoconf 2.64,
+ with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2009 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h | --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`'
+enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`'
+host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`'
+host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`'
+host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`'
+build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`'
+build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`'
+build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`'
+SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`'
+Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`'
+GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`'
+EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`'
+FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`'
+LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`'
+NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`'
+LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`'
+exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`'
+AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`'
+STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`'
+compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`'
+GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
+objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`'
+SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`'
+ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`'
+need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`'
+LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`'
+libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`'
+fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
+need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`'
+version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`'
+striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# Quote evaled strings.
+for var in SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+OBJDUMP \
+deplibs_check_method \
+file_magic_cmd \
+AR \
+AR_FLAGS \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+SHELL \
+ECHO \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_wl \
+lt_prog_compiler_pic \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_flag_spec_ld \
+hardcode_libdir_separator \
+fix_srcfile_path \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+finish_eval \
+old_striplib \
+striplib; do
+ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec; do
+ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Fix-up fallback echo if it was mangled by the above quoting rules.
+case \$lt_ECHO in
+*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\`
+ ;;
+esac
+
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'
+
+
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+ *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp=
+ trap 'exit_status=$?
+ { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+ || as_fn_error "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[ ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+
+eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$tmp/stdin" \
+ || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+ || as_fn_error "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&2;}
+
+ rm -f "$tmp/stdin"
+ case $ac_file in
+ -) cat "$tmp/out" && rm -f "$tmp/out";;
+ *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error "could not create $ac_file" "$LINENO" 5
+ ;;
+
+
+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+ # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir=$dirpart/$fdir; as_fn_mkdir_p
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+ ;;
+ "libtool":C)
+
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags=""
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# An object symbol dumper.
+OBJDUMP=$lt_OBJDUMP
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that does not interpret backslashes.
+ECHO=$lt_ECHO
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking. This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ case $xsi_shell in
+ yes)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+}
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result="${1##*/}"
+}
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+# dirname: Compute the dirname of FILE. If nonempty,
+# add APPEND to the result, otherwise set result
+# to NONDIR_REPLACEMENT.
+# value returned in "$func_dirname_result"
+# basename: Compute filename of FILE.
+# value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+ func_basename_result="${1##*/}"
+}
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+func_stripname ()
+{
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary parameter first.
+ func_stripname_result=${3}
+ func_stripname_result=${func_stripname_result#"${1}"}
+ func_stripname_result=${func_stripname_result%"${2}"}
+}
+
+# func_opt_split
+func_opt_split ()
+{
+ func_opt_split_opt=${1%%=*}
+ func_opt_split_arg=${1#*=}
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=${1%.*}.lo
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=$(( $* ))
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=${#1}
+}
+
+_LT_EOF
+ ;;
+ *) # Bourne compatible functions.
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+}
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "X${3}" \
+ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "X${3}" \
+ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
+ esac
+}
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[^=]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+ func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
+ func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+ func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'`
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=`expr "$@"`
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+}
+
+_LT_EOF
+esac
+
+case $lt_shell_append in
+ yes)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "$1+=\$2"
+}
+_LT_EOF
+ ;;
+ *)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "$1=\$$1\$2"
+}
+
+_LT_EOF
+ ;;
+ esac
+
+
+ sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+ ;;
+
+ esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || as_fn_exit $?
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/lto-plugin/configure.ac b/lto-plugin/configure.ac
new file mode 100644
index 00000000000..daefde67ccd
--- /dev/null
+++ b/lto-plugin/configure.ac
@@ -0,0 +1,14 @@
+AC_PREREQ(2.64)
+AC_INIT([LTO plugin for ld], 0.1,,[lto-plugin])
+GCC_TOPLEV_SUBDIRS
+AM_INIT_AUTOMAKE([foreign])
+AM_MAINTAINER_MODE
+AC_PROG_CC
+AC_SYS_LARGEFILE
+AC_ARG_VAR(LIBELFLIBS,[How to link libelf])
+AC_ARG_VAR(LIBELFINC,[How to find libelf include files])
+AM_PROG_LIBTOOL
+AC_SUBST(target_noncanonical)
+AC_TYPE_UINT64_T
+AC_CONFIG_FILES(Makefile)
+AC_OUTPUT
diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto-plugin.c
new file mode 100644
index 00000000000..e8e88cbb3c7
--- /dev/null
+++ b/lto-plugin/lto-plugin.c
@@ -0,0 +1,709 @@
+/* LTO plugin for gold.
+ Copyright (C) 2009 Free Software Foundation, Inc.
+ Contributed by Rafael Avila de Espindola (espindola@google.com).
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+/* The plugin has only one external function: onload. Gold passes it an array of
+ function that the plugin uses to communicate back to gold.
+
+ With the functions provided by gold, the plugin can be notified when
+ gold first analyzes a file and pass a symbol table back to gold. The plugin
+ is also notified when all symbols have been read and it is time to generate
+ machine code for the necessary symbols.
+
+ More information at http://gcc.gnu.org/wiki/whopr/driver.
+
+ This plugin should be passed the lto-wrapper options and will forward them.
+ It also has 2 options of its own:
+ -debug: Print the command line used to run lto-wrapper.
+ -nop: Instead of running lto-wrapper, pass the original to the plugin. This
+ only works if the input files are hybrid. */
+
+#include <assert.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <inttypes.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <stdbool.h>
+#include <libiberty.h>
+
+/* The presence of gelf.h is checked by the toplevel configure script. */
+#include <gelf.h>
+
+#include "plugin-api.h"
+#include "../gcc/lto/common.h"
+
+/* The part of the symbol table the plugin has to keep track of. Note that we
+ must keep SYMS until all_symbols_read is called to give the linker time to
+ copy the symbol information. */
+
+struct plugin_symtab
+{
+ int nsyms;
+ uint32_t *slots;
+ struct ld_plugin_symbol *syms;
+};
+
+/* All that we have to remember about a file. */
+
+struct plugin_file_info
+{
+ char *name;
+ void *handle;
+ struct plugin_symtab symtab;
+};
+
+
+static char *arguments_file_name;
+static ld_plugin_register_claim_file register_claim_file;
+static ld_plugin_add_symbols add_symbols;
+static ld_plugin_register_all_symbols_read register_all_symbols_read;
+static ld_plugin_get_symbols get_symbols;
+static ld_plugin_register_cleanup register_cleanup;
+static ld_plugin_add_input_file add_input_file;
+static ld_plugin_add_input_library add_input_library;
+static ld_plugin_message message;
+
+static struct plugin_file_info *claimed_files = NULL;
+static unsigned int num_claimed_files = 0;
+
+static char **output_files = NULL;
+static unsigned int num_output_files = 0;
+
+static char **lto_wrapper_argv;
+static int lto_wrapper_num_args;
+
+static char **pass_through_items = NULL;
+static unsigned int num_pass_through_items;
+
+static bool debug;
+static bool nop;
+static char *resolution_file = NULL;
+
+static void
+check (bool gate, enum ld_plugin_level level, const char *text)
+{
+ if (gate)
+ return;
+
+ if (message)
+ message (level, text);
+ else
+ {
+ /* If there is no nicer way to inform the user, fallback to stderr. */
+ fprintf (stderr, "%s\n", text);
+ if (level == LDPL_FATAL)
+ abort ();
+ }
+}
+
+/* Parse an entry of the IL symbol table. The data to be parsed is pointed
+ by P and the result is written in ENTRY. The slot number is stored in SLOT.
+ Returns the address of the next entry. */
+
+static char *
+parse_table_entry (char *p, struct ld_plugin_symbol *entry, uint32_t *slot)
+{
+ unsigned char t;
+ enum ld_plugin_symbol_kind translate_kind[] =
+ {
+ LDPK_DEF,
+ LDPK_WEAKDEF,
+ LDPK_UNDEF,
+ LDPK_WEAKUNDEF,
+ LDPK_COMMON
+ };
+
+ enum ld_plugin_symbol_visibility translate_visibility[] =
+ {
+ LDPV_DEFAULT,
+ LDPV_PROTECTED,
+ LDPV_INTERNAL,
+ LDPV_HIDDEN
+ };
+
+ entry->name = strdup (p);
+ while (*p)
+ p++;
+ p++;
+
+ entry->version = NULL;
+
+ entry->comdat_key = p;
+ while (*p)
+ p++;
+ p++;
+
+ if (strlen (entry->comdat_key) == 0)
+ entry->comdat_key = NULL;
+ else
+ entry->comdat_key = strdup (entry->comdat_key);
+
+ t = *p;
+ check (t <= 4, LDPL_FATAL, "invalid symbol kind found");
+ entry->def = translate_kind[t];
+ p++;
+
+ t = *p;
+ check (t <= 3, LDPL_FATAL, "invalid symbol visibility found");
+ entry->visibility = translate_visibility[t];
+ p++;
+
+ entry->size = *(uint64_t *) p;
+ p += 8;
+
+ *slot = *(uint32_t *) p;
+ p += 4;
+
+ entry->resolution = LDPR_UNKNOWN;
+
+ return p;
+}
+
+/* Return the section in ELF that is named NAME. */
+
+static Elf_Scn *
+get_section (Elf *elf, const char *name)
+{
+ Elf_Scn *section = 0;
+ GElf_Ehdr header;
+ GElf_Ehdr *t = gelf_getehdr (elf, &header);
+ if (t == NULL)
+ return NULL;
+ assert (t == &header);
+
+ while ((section = elf_nextscn(elf, section)) != 0)
+ {
+ GElf_Shdr shdr;
+ GElf_Shdr *tshdr = gelf_getshdr (section, &shdr);
+ const char *t;
+ assert (tshdr == &shdr);
+ t = elf_strptr (elf, header.e_shstrndx, shdr.sh_name);
+ assert (t != NULL);
+ if (strcmp (t, name) == 0)
+ return section;
+ }
+ return NULL;
+}
+
+/* Returns the IL symbol table of file ELF. */
+
+static Elf_Data *
+get_symtab (Elf *elf)
+{
+ Elf_Data *data = 0;
+ Elf_Scn *section = get_section (elf, ".gnu.lto_.symtab");
+ if (!section)
+ return NULL;
+
+ data = elf_getdata (section, data);
+ assert (data);
+ return data;
+}
+
+/* Translate the IL symbol table SYMTAB. Write the slots and symbols in OUT. */
+
+static void
+translate (Elf_Data *symtab, struct plugin_symtab *out)
+{
+ uint32_t *slots = NULL;
+ char *data = symtab->d_buf;
+ char *end = data + symtab->d_size;
+ struct ld_plugin_symbol *syms = NULL;
+ int n = 0;
+
+ while (data < end)
+ {
+ n++;
+ syms = realloc (syms, n * sizeof (struct ld_plugin_symbol));
+ check (syms, LDPL_FATAL, "could not allocate memory");
+ slots = realloc (slots, n * sizeof (uint32_t));
+ check (slots, LDPL_FATAL, "could not allocate memory");
+ data = parse_table_entry (data, &syms[n - 1], &slots[n - 1]);
+ }
+
+ out->nsyms = n;
+ out->syms = syms;
+ out->slots = slots;
+}
+
+/* Free all memory that is no longer needed after writing the symbol
+ resolution. */
+
+static void
+free_1 (void)
+{
+ unsigned int i;
+ for (i = 0; i < num_claimed_files; i++)
+ {
+ struct plugin_file_info *info = &claimed_files[i];
+ struct plugin_symtab *symtab = &info->symtab;
+ unsigned int j;
+ for (j = 0; j < symtab->nsyms; j++)
+ {
+ struct ld_plugin_symbol *s = &symtab->syms[j];
+ free (s->name);
+ if (s->comdat_key)
+ free (s->comdat_key);
+ }
+ free (symtab->syms);
+ symtab->syms = NULL;
+ }
+}
+
+/* Free all remaining memory. */
+
+static void
+free_2 (void)
+{
+ unsigned int i;
+ for (i = 0; i < num_claimed_files; i++)
+ {
+ struct plugin_file_info *info = &claimed_files[i];
+ struct plugin_symtab *symtab = &info->symtab;
+ free (symtab->slots);
+ free (info->name);
+ }
+
+ for (i = 0; i < num_output_files; i++)
+ free (output_files[i]);
+ free (output_files);
+
+ free (claimed_files);
+ claimed_files = NULL;
+ num_claimed_files = 0;
+
+ if (arguments_file_name)
+ free (arguments_file_name);
+ arguments_file_name = NULL;
+
+ if (resolution_file)
+ {
+ free (resolution_file);
+ resolution_file = NULL;
+ }
+}
+
+/* Writes the relocations to disk. */
+
+static void
+write_resolution (void)
+{
+ unsigned int i;
+ FILE *f;
+
+ if (!resolution_file)
+ return;
+
+ f = fopen (resolution_file, "w");
+ check (f, LDPL_FATAL, "could not open file");
+
+ fprintf (f, "%d\n", num_claimed_files);
+
+ for (i = 0; i < num_claimed_files; i++)
+ {
+ struct plugin_file_info *info = &claimed_files[i];
+ struct plugin_symtab *symtab = &info->symtab;
+ struct ld_plugin_symbol *syms = symtab->syms;
+ unsigned j;
+
+ assert (syms);
+ get_symbols (info->handle, symtab->nsyms, syms);
+
+ fprintf (f, "%s %d\n", info->name, info->symtab.nsyms);
+
+ for (j = 0; j < info->symtab.nsyms; j++)
+ {
+ uint32_t slot = symtab->slots[j];
+ unsigned int resolution = syms[j].resolution;
+ fprintf (f, "%d %s\n", slot, lto_resolution_str[resolution]);
+ }
+ }
+ fclose (f);
+}
+
+/* Pass files generated by the lto-wrapper to the linker. FD is lto-wrapper's
+ stdout. */
+
+static void
+add_output_files (FILE *f)
+{
+ char fname[1000]; /* FIXME: Remove this restriction. */
+
+ for (;;)
+ {
+ size_t len;
+ char *s = fgets (fname, sizeof (fname), f);
+ if (!s)
+ break;
+
+ len = strlen (s);
+ check (s[len - 1] == '\n', LDPL_FATAL, "file name too long");
+ s[len - 1] = '\0';
+
+ num_output_files++;
+ output_files = realloc (output_files, num_output_files * sizeof (char *));
+ output_files[num_output_files - 1] = strdup (s);
+ add_input_file (output_files[num_output_files - 1]);
+ }
+}
+
+/* Execute the lto-wrapper. ARGV[0] is the binary. The rest of ARGV is the
+ argument list. */
+
+static void
+exec_lto_wrapper (char *argv[])
+{
+ int t;
+ int status;
+ char *at_args;
+ FILE *args;
+ FILE *wrapper_output;
+ char *new_argv[3];
+ struct pex_obj *pex;
+ const char *errmsg;
+
+ /* Write argv to a file to avoid a command line that is too long. */
+ arguments_file_name = make_temp_file ("");
+ check (arguments_file_name, LDPL_FATAL,
+ "Failed to generate a temorary file name");
+
+ args = fopen (arguments_file_name, "w");
+ check (args, LDPL_FATAL, "could not open arguments file");
+
+ t = writeargv (&argv[1], args);
+ check (t == 0, LDPL_FATAL, "could not write arguments");
+ t = fclose (args);
+ check (t == 0, LDPL_FATAL, "could not close arguments file");
+
+ at_args = concat ("@", arguments_file_name, NULL);
+ check (at_args, LDPL_FATAL, "could not allocate");
+
+ new_argv[0] = argv[0];
+ new_argv[1] = at_args;
+ new_argv[2] = NULL;
+
+ if (debug)
+ {
+ int i;
+ for (i = 0; new_argv[i]; i++)
+ fprintf (stderr, "%s ", new_argv[i]);
+ fprintf (stderr, "\n");
+ }
+
+
+ pex = pex_init (PEX_USE_PIPES, "lto-wrapper", NULL);
+ check (pex != NULL, LDPL_FATAL, "could not pex_init lto-wrapper");
+
+ errmsg = pex_run (pex, 0, new_argv[0], new_argv, NULL, NULL, &t);
+ check (errmsg == NULL, LDPL_FATAL, "could not run lto-wrapper");
+ check (t == 0, LDPL_FATAL, "could not run lto-wrapper");
+
+ wrapper_output = pex_read_output (pex, 0);
+ check (wrapper_output, LDPL_FATAL, "could not read lto-wrapper output");
+
+ add_output_files (wrapper_output);
+
+ t = pex_get_status (pex, 1, &status);
+ check (t == 1, LDPL_FATAL, "could not get lto-wrapper exit status");
+ check (WIFEXITED (status) && WEXITSTATUS (status) == 0, LDPL_FATAL,
+ "lto-wrapper failed");
+
+ pex_free (pex);
+
+ free (at_args);
+}
+
+/* Pass the original files back to the linker. */
+
+static void
+use_original_files (void)
+{
+ unsigned i;
+ for (i = 0; i < num_claimed_files; i++)
+ {
+ struct plugin_file_info *info = &claimed_files[i];
+ add_input_file (info->name);
+ }
+}
+
+
+/* Called by the linker once all symbols have been read. */
+
+static enum ld_plugin_status
+all_symbols_read_handler (void)
+{
+ unsigned i;
+ unsigned num_lto_args = num_claimed_files + lto_wrapper_num_args + 1;
+ char **lto_argv;
+ const char **lto_arg_ptr;
+ if (num_claimed_files == 0)
+ return LDPS_OK;
+
+ if (nop)
+ {
+ use_original_files ();
+ return LDPS_OK;
+ }
+
+ lto_argv = (char **) calloc (sizeof (char *), num_lto_args);
+ lto_arg_ptr = (const char **) lto_argv;
+ assert (lto_wrapper_argv);
+
+ write_resolution ();
+
+ free_1 ();
+
+ for (i = 0; i < lto_wrapper_num_args; i++)
+ *lto_arg_ptr++ = lto_wrapper_argv[i];
+
+ for (i = 0; i < num_claimed_files; i++)
+ {
+ struct plugin_file_info *info = &claimed_files[i];
+
+ *lto_arg_ptr++ = info->name;
+ }
+
+ *lto_arg_ptr++ = NULL;
+ exec_lto_wrapper (lto_argv);
+
+ free (lto_argv);
+
+ if (pass_through_items)
+ {
+ unsigned int i;
+ for (i = 0; i < num_pass_through_items; i++)
+ {
+ if (strncmp (pass_through_items[i], "-l", 2) == 0)
+ add_input_library (pass_through_items[i] + 2);
+ else
+ add_input_file (pass_through_items[i]);
+ free (pass_through_items[i]);
+ pass_through_items[i] = NULL;
+ }
+ free (pass_through_items);
+ pass_through_items = NULL;
+ }
+
+ return LDPS_OK;
+}
+
+/* Remove temporary files at the end of the link. */
+
+static enum ld_plugin_status
+cleanup_handler (void)
+{
+ int t;
+
+ if (debug)
+ return LDPS_OK;
+
+ if (arguments_file_name)
+ {
+ t = unlink (arguments_file_name);
+ check (t == 0, LDPL_FATAL, "could not unlink arguments file");
+ }
+
+ free_2 ();
+ return LDPS_OK;
+}
+
+/* Callback used by gold to check if the plugin will claim FILE. Writes
+ the result in CLAIMED. */
+
+static enum ld_plugin_status
+claim_file_handler (const struct ld_plugin_input_file *file, int *claimed)
+{
+ enum ld_plugin_status status;
+ Elf *elf;
+ struct plugin_file_info lto_file;
+ Elf_Data *symtab;
+
+ if (file->offset != 0)
+ {
+ char *objname;
+ Elf *archive;
+ off_t offset;
+ /* We pass the offset of the actual file, not the archive header. */
+ int t = asprintf (&objname, "%s@%" PRId64, file->name,
+ (int64_t) file->offset);
+ check (t >= 0, LDPL_FATAL, "asprintf failed");
+ lto_file.name = objname;
+
+ archive = elf_begin (file->fd, ELF_C_READ, NULL);
+ check (elf_kind (archive) == ELF_K_AR, LDPL_FATAL,
+ "Not an archive and offset not 0");
+
+ /* elf_rand expects the offset to point to the ar header, not the
+ object itself. Subtract the size of the ar header (60 bytes).
+ We don't uses sizeof (struct ar_hd) to avoid including ar.h */
+
+ offset = file->offset - 60;
+ check (offset == elf_rand (archive, offset), LDPL_FATAL,
+ "could not seek in archive");
+ elf = elf_begin (file->fd, ELF_C_READ, archive);
+ check (elf != NULL, LDPL_FATAL, "could not find archive member");
+ elf_end (archive);
+ }
+ else
+ {
+ lto_file.name = strdup (file->name);
+ elf = elf_begin (file->fd, ELF_C_READ, NULL);
+ }
+ lto_file.handle = file->handle;
+
+ *claimed = 0;
+
+ if (!elf)
+ goto err;
+
+ symtab = get_symtab (elf);
+ if (!symtab)
+ goto err;
+
+ translate (symtab, &lto_file.symtab);
+
+ status = add_symbols (file->handle, lto_file.symtab.nsyms,
+ lto_file.symtab.syms);
+ check (status == LDPS_OK, LDPL_FATAL, "could not add symbols");
+
+ *claimed = 1;
+ num_claimed_files++;
+ claimed_files =
+ realloc (claimed_files,
+ num_claimed_files * sizeof (struct plugin_file_info));
+ claimed_files[num_claimed_files - 1] = lto_file;
+
+ goto cleanup;
+
+ err:
+ free (lto_file.name);
+
+ cleanup:
+ if (elf)
+ elf_end (elf);
+
+ return LDPS_OK;
+}
+
+/* Parse the plugin options. */
+
+static void
+process_option (const char *option)
+{
+ if (strcmp (option, "-debug") == 0)
+ debug = 1;
+ else if (strcmp (option, "-nop") == 0)
+ nop = 1;
+ else if (!strncmp (option, "-resolution=", strlen("-resolution=")))
+ {
+ resolution_file = strdup (option + strlen("-resolution="));
+ }
+ else if (!strncmp (option, "-pass-through=", strlen("-pass-through=")))
+ {
+ num_pass_through_items++;
+ pass_through_items = realloc (pass_through_items,
+ num_pass_through_items * sizeof (char *));
+ pass_through_items[num_pass_through_items - 1] =
+ strdup (option + strlen ("-pass-through="));
+ }
+ else
+ {
+ int size;
+ lto_wrapper_num_args += 1;
+ size = lto_wrapper_num_args * sizeof (char *);
+ lto_wrapper_argv = (char **) realloc (lto_wrapper_argv, size);
+ lto_wrapper_argv[lto_wrapper_num_args - 1] = strdup(option);
+ }
+}
+
+/* Called by gold after loading the plugin. TV is the transfer vector. */
+
+enum ld_plugin_status
+onload (struct ld_plugin_tv *tv)
+{
+ struct ld_plugin_tv *p;
+ enum ld_plugin_status status;
+
+ unsigned version = elf_version (EV_CURRENT);
+ check (version != EV_NONE, LDPL_FATAL, "invalid ELF version");
+
+ p = tv;
+ while (p->tv_tag)
+ {
+ switch (p->tv_tag)
+ {
+ case LDPT_MESSAGE:
+ message = p->tv_u.tv_message;
+ break;
+ case LDPT_REGISTER_CLAIM_FILE_HOOK:
+ register_claim_file = p->tv_u.tv_register_claim_file;
+ break;
+ case LDPT_ADD_SYMBOLS:
+ add_symbols = p->tv_u.tv_add_symbols;
+ break;
+ case LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK:
+ register_all_symbols_read = p->tv_u.tv_register_all_symbols_read;
+ break;
+ case LDPT_GET_SYMBOLS:
+ get_symbols = p->tv_u.tv_get_symbols;
+ break;
+ case LDPT_REGISTER_CLEANUP_HOOK:
+ register_cleanup = p->tv_u.tv_register_cleanup;
+ break;
+ case LDPT_ADD_INPUT_FILE:
+ add_input_file = p->tv_u.tv_add_input_file;
+ break;
+ case LDPT_ADD_INPUT_LIBRARY:
+ add_input_library = p->tv_u.tv_add_input_library;
+ break;
+ case LDPT_OPTION:
+ process_option (p->tv_u.tv_string);
+ break;
+ default:
+ break;
+ }
+ p++;
+ }
+
+ check (register_claim_file, LDPL_FATAL, "register_claim_file not found");
+ check (add_symbols, LDPL_FATAL, "add_symbols not found");
+ status = register_claim_file (claim_file_handler);
+ check (status == LDPS_OK, LDPL_FATAL,
+ "could not register the claim_file callback");
+
+ if (register_cleanup)
+ {
+ status = register_cleanup (cleanup_handler);
+ check (status == LDPS_OK, LDPL_FATAL,
+ "could not register the cleanup callback");
+ }
+
+ if (register_all_symbols_read)
+ {
+ check (get_symbols, LDPL_FATAL, "get_symbols not found");
+ status = register_all_symbols_read (all_symbols_read_handler);
+ check (status == LDPS_OK, LDPL_FATAL,
+ "could not register the all_symbols_read callback");
+ }
+
+ return LDPS_OK;
+}
diff --git a/lto-plugin/lto-symtab.c b/lto-plugin/lto-symtab.c
new file mode 100644
index 00000000000..fc42a9eb816
--- /dev/null
+++ b/lto-plugin/lto-symtab.c
@@ -0,0 +1,359 @@
+/* Program to read the IL symbol table.
+ Copyright (C) 2008 Free Software Foundation, Inc.
+ Contributed by Rafael Avila de Espindola (espindola@google.com).
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#include <fcntl.h>
+#include <assert.h>
+#include <dlfcn.h>
+#include <stdio.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "plugin-api.h"
+#include "../gcc/lto/common.h"
+
+/* The presence of gelf.h is checked by the toplevel configure script. */
+# include <gelf.h>
+
+static ld_plugin_claim_file_handler claim_file_handler;
+static ld_plugin_all_symbols_read_handler all_symbols_read_handler;
+static ld_plugin_cleanup_handler cleanup_handler;
+static void *plugin_handle;
+
+struct file_handle {
+ unsigned nsyms;
+ struct ld_plugin_symbol *syms;
+};
+
+static struct file_handle **all_file_handles = NULL;
+static unsigned int num_file_handles;
+
+/* Write NSYMS symbols from file HANDLE in SYMS. */
+
+static enum ld_plugin_status
+get_symbols (const void *handle, int nsyms, struct ld_plugin_symbol *syms)
+{
+ unsigned i;
+ struct file_handle *h = (struct file_handle *) handle;
+ assert (h->nsyms == nsyms);
+
+ for (i = 0; i < nsyms; i++)
+ syms[i] = h->syms[i];
+
+ return LDPS_OK;
+}
+
+/* Register HANDLER as the callback for notifying the plugin that all symbols
+ have been read. */
+
+static enum ld_plugin_status
+register_all_symbols_read (ld_plugin_all_symbols_read_handler handler)
+{
+ all_symbols_read_handler = handler;
+ return LDPS_OK;
+}
+
+/* Register HANDLER as the callback for claiming a file. */
+
+static enum ld_plugin_status
+register_claim_file(ld_plugin_claim_file_handler handler)
+{
+ claim_file_handler = handler;
+ return LDPS_OK;
+}
+
+/* Register HANDLER as the callback to removing temporary files. */
+
+static enum ld_plugin_status
+register_cleanup (ld_plugin_cleanup_handler handler)
+{
+ cleanup_handler = handler;
+ return LDPS_OK;
+}
+
+/* For a file identified by HANDLE, add NSYMS symbols from SYMS. */
+
+static enum ld_plugin_status
+add_symbols (void *handle, int nsyms,
+ const struct ld_plugin_symbol *syms)
+{
+ int i;
+ struct file_handle *h = (struct file_handle *) handle;
+ h->nsyms = nsyms;
+ h->syms = calloc (nsyms, sizeof (struct ld_plugin_symbol));
+ assert (h->syms);
+
+ for (i = 0; i < nsyms; i++)
+ {
+ h->syms[i] = syms[i];
+ h->syms[i].name = strdup (h->syms[i].name);
+ if (h->syms[i].version)
+ h->syms[i].version = strdup (h->syms[i].version);
+ if (h->syms[i].comdat_key)
+ h->syms[i].comdat_key = strdup (h->syms[i].comdat_key);
+ }
+
+ return LDPS_OK;
+}
+
+struct ld_plugin_tv tv[] = {
+ {LDPT_REGISTER_CLAIM_FILE_HOOK,
+ {.tv_register_claim_file = register_claim_file}
+ },
+ {LDPT_ADD_SYMBOLS,
+ {.tv_add_symbols = add_symbols}
+ },
+
+ {LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK,
+ {.tv_register_all_symbols_read = register_all_symbols_read}
+ },
+ {LDPT_GET_SYMBOLS,
+ {.tv_get_symbols = get_symbols}
+ },
+ {LDPT_REGISTER_CLEANUP_HOOK,
+ {.tv_register_cleanup = register_cleanup}
+ },
+ {0, {0}}
+};
+
+/* Load a plugin from a file named NAME. */
+
+static void
+load_plugin (const char *name)
+{
+ ld_plugin_onload onload;
+ plugin_handle = dlopen (name, RTLD_LAZY);
+
+ assert (plugin_handle != NULL);
+ onload = dlsym (plugin_handle, "onload");
+ assert (onload);
+ onload (tv);
+ assert (claim_file_handler);
+}
+
+/* Send object to the plugin. The file (archive or object) name is NAME.
+ FD is an open file descriptor. The object data starts at OFFSET and is
+ FILESIZE bytes long. */
+
+static void
+register_object (const char *name, int fd, off_t offset, off_t filesize)
+{
+ int claimed;
+ struct ld_plugin_input_file file;
+ void *handle;
+
+ num_file_handles++;
+ all_file_handles = realloc (all_file_handles, num_file_handles
+ * sizeof (struct file_handle *));
+ assert (all_file_handles);
+
+ all_file_handles[num_file_handles - 1] = calloc (1,
+ sizeof (struct file_handle));
+ handle = all_file_handles[num_file_handles - 1];
+ assert (handle);
+
+ file.name = (char *) name;
+ file.fd = fd;
+ file.offset = offset;
+ file.filesize = filesize;
+
+ file.handle = handle;
+
+ claim_file_handler (&file, &claimed);
+}
+
+/* Send file named NAME to the plugin. */
+
+static void
+register_file (const char *name)
+{
+ int fd = open (name, O_RDONLY);
+ Elf *elf;
+
+ assert (fd >= 0);
+
+ elf = elf_begin (fd, ELF_C_READ, NULL);
+ assert (elf);
+
+ Elf_Kind kind = elf_kind (elf);
+
+ assert (kind == ELF_K_ELF || kind == ELF_K_AR);
+
+ if (kind == ELF_K_AR)
+ {
+ Elf *member = elf_begin (fd, ELF_C_READ, elf);
+ while (member)
+ {
+ Elf_Arhdr *h = elf_getarhdr (member);
+ assert (h);
+
+ if (h->ar_name[0] != '/')
+ {
+ off_t offset = elf_getbase (member);
+ register_object (name, fd, offset, h->ar_size);
+ }
+
+ Elf_Cmd cmd = elf_next (member);
+ elf_end (member);
+ member = elf_begin (fd, cmd, elf);
+ }
+ }
+ else /* Single File */
+ register_object (name, fd, 0, 0);
+
+ elf_end (elf);
+}
+
+/* Fake symbol resolution for testing. */
+
+static void
+resolve (void)
+{
+ unsigned j;
+ for (j = 0; j < num_file_handles; j++)
+ {
+ struct file_handle *handle = all_file_handles[j];
+ unsigned int nsyms = handle->nsyms;
+ struct ld_plugin_symbol *syms = handle->syms;
+ unsigned i;
+ for (i = 0; i < nsyms; i++)
+ {
+ switch (syms[i].def)
+ {
+ case LDPK_DEF:
+ case LDPK_WEAKDEF:
+ case LDPK_COMMON:
+ syms[i].resolution = LDPR_PREVAILING_DEF;
+ break;
+ case LDPK_UNDEF:
+ case LDPK_WEAKUNDEF:
+ syms[i].resolution = LDPR_RESOLVED_IR;
+ break;
+ }
+ }
+ }
+}
+
+/* Print all symbol information. */
+
+static void
+print (void)
+{
+ unsigned j;
+ for (j = 0; j < num_file_handles; j++)
+ {
+ struct file_handle *handle = all_file_handles[j];
+ unsigned int nsyms = handle->nsyms;
+ struct ld_plugin_symbol *syms = handle->syms;
+ unsigned i;
+ for (i = 0; i < nsyms; i++)
+ {
+ printf("name: %s; ", syms[i].name);
+ if (syms[i].version)
+ printf("version: %s;", syms[i].version);
+ else
+ printf("not versioned; ");
+ printf("kind: %s; ", lto_kind_str[syms[i].def]);
+ printf("visibility: %s; ", lto_visibility_str[syms[i].visibility]);
+ printf("size: %" PRId64 "; ", syms[i].size);
+ if (syms[i].comdat_key)
+ printf("comdat_key: %s; ", syms[i].comdat_key);
+ else
+ printf("no comdat_key; ");
+ printf ("resolution: %s\n", lto_resolution_str[syms[i].resolution]);
+ }
+ }
+}
+
+/* Unload the plugin. */
+
+static void
+unload_plugin (void)
+{
+ unsigned err = dlclose (plugin_handle);
+ assert (err == 0);
+ claim_file_handler = 0;
+ all_symbols_read_handler = 0;
+}
+
+/* Free all memory allocated by us that hasn't been freed yet. */
+
+static void
+free_all (void)
+{
+ unsigned j;
+ for (j = 0; j < num_file_handles; j++)
+ {
+ struct file_handle *handle = all_file_handles[j];
+ unsigned int nsyms = handle->nsyms;
+ struct ld_plugin_symbol *syms = handle->syms;
+ unsigned i;
+ for (i = 0; i < nsyms; i++)
+ {
+ free (syms[i].name);
+ syms[i].name = 0;
+ if (syms[i].version)
+ {
+ free (syms[i].version);
+ syms[i].version = 0;
+ }
+ if (syms[i].comdat_key)
+ {
+ free (syms[i].comdat_key);
+ syms[i].comdat_key = 0;
+ }
+ }
+ free (syms);
+ handle->syms = NULL;
+ handle->nsyms = 0;
+ free (all_file_handles[j]);
+ all_file_handles[j] = NULL;
+ }
+
+ free (all_file_handles);
+ all_file_handles = NULL;
+ num_file_handles = 0;
+}
+
+int
+main(int argc, char *argv[])
+{
+ const char *plugin;
+ unsigned int i;
+ assert (argc >= 3);
+ plugin = argv[1];
+
+ load_plugin (plugin);
+
+ for (i = 2; i < argc; i++)
+ register_file (argv[i]);
+
+ resolve ();
+
+ print ();
+
+ all_symbols_read_handler ();
+
+ free_all ();
+
+ cleanup_handler ();
+
+ unload_plugin ();
+
+ return 0;
+}
diff --git a/maintainer-scripts/ChangeLog b/maintainer-scripts/ChangeLog
index 71190393b6a..7b023138ac2 100644
--- a/maintainer-scripts/ChangeLog
+++ b/maintainer-scripts/ChangeLog
@@ -1,3 +1,11 @@
+2009-10-10 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * update_web_docs_svn: Update BUGURL to http://gcc.gnu.org/bugs/.
+
+2009-10-03 Diego Novillo <dnovillo@google.com>
+
+ * gcc_release (JAVA_DIRS): Remove zlib.
+
2009-04-23 Gerald Pfeifer <gerald@pfeifer.com>
* update_web_docs_svn: Redirect output of texi2dvi to /dev/null.
diff --git a/maintainer-scripts/gcc_release b/maintainer-scripts/gcc_release
index 0ecf54bfbbc..ddcd22f7ca0 100755
--- a/maintainer-scripts/gcc_release
+++ b/maintainer-scripts/gcc_release
@@ -547,7 +547,7 @@ SOURCE_DIRECTORY=""
ADA_DIRS="gcc/ada libada gnattools"
CPLUSPLUS_DIRS="gcc/cp libstdc++-v3"
FORTRAN95_DIRS="gcc/fortran libgfortran"
-JAVA_DIRS="gcc/java libjava libffi zlib boehm-gc"
+JAVA_DIRS="gcc/java libjava libffi boehm-gc"
OBJECTIVEC_DIRS="gcc/objc gcc/objcp libobjc"
TESTSUITE_DIRS="gcc/testsuite"
diff --git a/maintainer-scripts/update_web_docs_svn b/maintainer-scripts/update_web_docs_svn
index 719a2df3c29..8fb59fd90b5 100755
--- a/maintainer-scripts/update_web_docs_svn
+++ b/maintainer-scripts/update_web_docs_svn
@@ -146,7 +146,7 @@ fi
fi
echo "@set srcdir $WORKDIR/gcc/gcc"
echo "@set VERSION_PACKAGE (GCC)"
- echo "@set BUGURL @uref{http://gcc.gnu.org/bugs.html}"
+ echo "@set BUGURL @uref{http://gcc.gnu.org/bugs/}"
) > $includedir/gcc-vers.texi
# Now convert the relevant files from texi to HTML, PDF and PostScript.